diff options
author | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2018-08-01 07:42:43 +0000 |
---|---|---|
committer | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2018-08-02 06:47:03 +0000 |
commit | b306138515459445eb2173301e012f2848495f00 (patch) | |
tree | 0e76de58677fe86f2590dec8daaec3953fa1cb9a | |
parent | f23acb4b26d3f51317936ebf5dcff66b1c54ae31 (diff) |
Add new parameter 'scale' for multiple resolutionflounder_5.99.4flounder_5.99.3flounder/5.99.4flounder/5.99.35.99.45.99.3
To support rendering which fits screen resolution,
new parameter 'scale' is added to API, getDisplayInfo
If window manager doesn't support multi-resolution,
scale is set 1.0 for backward compatibility.
Bug-AGL: SPEC-1611
Change-Id: I1050dd6b3ac919ce5f495ca8ea0bf13c7240b501
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
-rw-r--r-- | src/libwindowmanager.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp index 5f0f5e5..19cef6e 100644 --- a/src/libwindowmanager.cpp +++ b/src/libwindowmanager.cpp @@ -392,10 +392,11 @@ int LibWindowmanager::Impl::getDisplayInfo(json_object *object) { int w_px, h_px, w_mm, h_mm; int rc = -1; + double scale; /* send the request */ int rc2 = this->api_call("GetDisplayInfo", nullptr, - [&rc, &w_px, &h_px, &w_mm, &h_mm](bool ok, json_object *j) { + [&rc, &w_px, &h_px, &w_mm, &h_mm, &scale](bool ok, json_object *j) { if (ok) { json_object *val; if (json_object_object_get_ex(j, "response", &val)) { @@ -432,6 +433,14 @@ int LibWindowmanager::Impl::getDisplayInfo(json_object *object) { return; } h_mm = json_object_get_int(j_h_mm); + + json_object *j_scale = nullptr; + if (!json_object_object_get_ex(val, "scale", &j_scale)) { + HMI_DEBUG("libwm:", "Not found key \"scale\""); + scale = 1.0; // for backward compatibility + } else { + scale = json_object_get_double(j_scale); + } rc = 0; } else { @@ -458,6 +467,7 @@ int LibWindowmanager::Impl::getDisplayInfo(json_object *object) { json_object_object_add(object, "height_pixel", json_object_new_int(h_px)); json_object_object_add(object, "width_mm", json_object_new_int(w_mm)); json_object_object_add(object, "height_mm", json_object_new_int(h_mm)); + json_object_object_add(object, "scale", json_object_new_double(scale)); } return rc; |