From 6aaba1066fe89f324d4bae67497f4035fe997d5f Mon Sep 17 00:00:00 2001 From: Yuta Doi Date: Mon, 11 Dec 2017 11:38:01 +0900 Subject: 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 --- src/wayland.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/wayland.cpp') diff --git a/src/wayland.cpp b/src/wayland.cpp index 53668d2..9361b74 100644 --- a/src/wayland.cpp +++ b/src/wayland.cpp @@ -148,6 +148,8 @@ void output::geometry(int32_t x, int32_t y, int32_t pw, int32_t ph, HMI_DEBUG("wm", "wl::output %s @ %p x %i y %i w %i h %i spel %x make %s model %s tx %i", __func__, this->proxy.get(), x, y, pw, ph, subpel, make, model, tx); + this->physical_width = pw; + this->physical_height = ph; this->transform = tx; } @@ -169,6 +171,7 @@ void output::done() { this->transform == WL_OUTPUT_TRANSFORM_FLIPPED_90 || this->transform == WL_OUTPUT_TRANSFORM_FLIPPED_270) { std::swap(this->width, this->height); + std::swap(this->physical_width, this->physical_height); } } -- cgit 1.2.3-korg