diff options
author | Yuta Doi <yuta-d@witz-inc.co.jp> | 2017-12-11 11:38:01 +0900 |
---|---|---|
committer | Yuta Doi <yuta-d@witz-inc.co.jp> | 2017-12-11 11:38:01 +0900 |
commit | 6aaba1066fe89f324d4bae67497f4035fe997d5f (patch) | |
tree | 89ecc85436fcc1e5567d6dfa8f10dadee0121c61 /src/afb_binding_api.cpp | |
parent | 7fb167a27e9e12ef38c5942cf73679bff12a5b25 (diff) |
Add APIs which can get information of display and area
getDisplayInfo() can get the display information as follows:
- width[pixel]
- height[pixel]
- width[mm]
- height[mm]
NOTE:
It uses wl_output::geometry() for getting physical width[mm] and height[mm] of the display,
but the value is different with measured value.
value from wl_output::geometry(): width:320 height:520
measured value : width:193 height:343
getAreaInfo() can get the information of area drawn by the application as follows:
- x-coordinate
- y-coordinate
- width
- height
The details are described in doc/ApplicationGuide.md.
Change-Id: I41eec6251527862ef25d1b84cd37d736d3f9c8aa
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src/afb_binding_api.cpp')
-rw-r--r-- | src/afb_binding_api.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/afb_binding_api.cpp b/src/afb_binding_api.cpp index 3c75524..825bc99 100644 --- a/src/afb_binding_api.cpp +++ b/src/afb_binding_api.cpp @@ -69,6 +69,23 @@ binding_api::result_type binding_api::enddraw(char const* drawing_name) { return Ok(json_object_new_object()); } +binding_api::result_type binding_api::getdisplayinfo() { + auto r = this->app->api_get_display_info(); + if (r.is_err()) { + return Err<json_object *>(r.unwrap_err()); + } + return Ok(r.unwrap()); +} + +binding_api::result_type binding_api::getareainfo( + char const *drawing_name) { + auto r = this->app->api_get_area_info(drawing_name); + if (r.is_err()) { + return Err<json_object *>(r.unwrap_err()); + } + return Ok(r.unwrap()); +} + binding_api::result_type binding_api::list_drawing_names() { HMI_DEBUG("wm", "%s", __func__); json j = this->app->id_alloc.name2id; |