summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-18 16:31:03 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-05-18 16:31:03 +0900
commitbe4dfa878deb5dd6b7d097cb4c371ad05557420d (patch)
tree598f8ba98316b5bb39708edc5314a4758d36bbc5
parent696956618c85a6203464720721bdf3ad50bcdaa1 (diff)
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 <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 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: