summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-18 16:31:03 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-05-22 17:54:44 +0900
commit08b7c066d58c713e04e96c97a987e5b20cd56cda (patch)
tree5e709f502c3bcd07623207bde09f85037cdf3d6c
parent54d8385d9177d117b52f58e68729f618790bef3a (diff)
Add API which can get informationssandbox/knimitz/add_event
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 <yuta-d@witz-inc.co.jp>
-rw-r--r--src/qlibwindowmanager.cpp16
-rw-r--r--src/qlibwindowmanager.h3
2 files changed, 18 insertions, 1 deletions
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 3754778..deba7fd 100644
--- a/src/qlibwindowmanager.h
+++ b/src/qlibwindowmanager.h
@@ -66,6 +66,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: