From be4dfa878deb5dd6b7d097cb4c371ad05557420d Mon Sep 17 00:00:00 2001 From: Yuta Doi Date: Fri, 18 May 2018 16:31:03 +0900 Subject: Add API which can get informations 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 getCarInfo() can get the car state informations as follows: - parking brake state : true/false - accelerator pedal position : 0-127.5 - car state : "stop"/"run" The details are described in doc/ApplicationGuide.md in project apps/agl-service-windowmanager-2017. Change-Id: Icfb945ea3f2a8701d110b4063bbef5a54119e511 Signed-off-by: Yuta Doi --- src/qlibwindowmanager.cpp | 16 +++++++++++++++- src/qlibwindowmanager.h | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/qlibwindowmanager.cpp b/src/qlibwindowmanager.cpp index bc313e5..79d7f79 100644 --- a/src/qlibwindowmanager.cpp +++ b/src/qlibwindowmanager.cpp @@ -82,7 +82,21 @@ int QLibWindowmanager::endDraw(const QString &label) { string clabel = label.toStdString(); json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(clabel.c_str())); return this->wm->endDraw(obj); - } +} + +int QLibWindowmanager::getDisplayInfo(json_object *out) { + return this->wm->getDisplayInfo(out); +} + +int QLibWindowmanager::getAreaInfo(const QString &label, json_object *out) { + string clabel = label.toStdString(); + return this->wm->getAreaInfo(clabel.c_str(), out); +} + +int QLibWindowmanager::getCarInfo(const QString &label, json_object *out) { + string clabel = label.toStdString(); + return this->wm->getCarInfo(clabel.c_str(), out); +} void QLibWindowmanager::set_event_handler(enum QEventType et, handler_fun f) { diff --git a/src/qlibwindowmanager.h b/src/qlibwindowmanager.h index 9183bd5..7ae487a 100644 --- a/src/qlibwindowmanager.h +++ b/src/qlibwindowmanager.h @@ -61,6 +61,9 @@ public: Q_INVOKABLE int activateSurface(const QString &label, const QString &drawing_area); Q_INVOKABLE int deactivateSurface(const QString &label); Q_INVOKABLE int endDraw(const QString &label); + Q_INVOKABLE int getDisplayInfo(json_object *out); + Q_INVOKABLE int getAreaInfo(const QString &label, json_object *out); + Q_INVOKABLE int getCarInfo(const QString &label, json_object *out); void set_event_handler(enum QEventType et, handler_fun f); public slots: -- cgit 1.2.3-korg