summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-11-13 23:01:57 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-11-14 13:38:02 +0000
commit4f843a3f37537aa9a3969c7cb33eb429ddeb5ddd (patch)
tree1f4689f414d4df2af53c73ea0dac49506d877deb /app/main.cpp
parent101b535c71b6055bb35884b606e4a978d2ce2599 (diff)
qlibwindowmanager is now outside of the projecteel_4.99.3eel/4.99.34.99.3
Change-Id: Ifdabb7a3456ade9449e399a13ec43aac68ded108 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh> Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 7722a0a..57c731e 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -23,14 +23,13 @@
#include <QtQuickControls2/QQuickStyle>
#include <QQuickWindow>
#include <libhomescreen.hpp>
-#include "qlibwindowmanager.h"
+#include <qlibwindowmanager.h>
int main(int argc, char *argv[])
{
- std::string myname = std::string("HVAC");
+ QString myname = QString("HVAC");
QGuiApplication app(argc, argv);
- app.setApplicationName(myname.c_str());
app.setApplicationVersion(QStringLiteral("0.1.0"));
app.setOrganizationDomain(QStringLiteral("automotivelinux.org"));
app.setOrganizationName(QStringLiteral("AutomotiveGradeLinux"));
@@ -69,29 +68,27 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
// Request a surface as described in layers.json windowmanager’s file
- if (qwm->requestSurface(json_object_new_string(myname.c_str())) != 0) {
+ if (qwm->requestSurface(myname) != 0) {
exit(EXIT_FAILURE);
}
- // Create an event callback against an event type. Here a lambda is called when SyncDraw event occurs
+ // Create an event callbnewack against an event type. Here a lambda is called when SyncDraw event occurs
qwm->set_event_handler(QLibWindowmanager::Event_SyncDraw, [qwm, myname](json_object *object) {
fprintf(stderr, "Surface got syncDraw!\n");
- qwm->endDraw(json_object_new_string(myname.c_str()));
+ qwm->endDraw(myname);
});
// HomeScreen
hs->init(port, token.c_str());
// Set the event handler for Event_TapShortcut which will activate the surface for windowmanager
hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [qwm, myname](json_object *object){
- qDebug("object %s", json_object_to_json_string(object));
json_object *appnameJ = nullptr;
if(json_object_object_get_ex(object, "application_name", &appnameJ))
{
const char *appname = json_object_get_string(appnameJ);
- qDebug("appnameJ %s", json_object_to_json_string(appnameJ));
if(myname == appname)
{
qDebug("Surface %s got tapShortcut\n", appname);
- qwm->activateSurface(json_object_new_string(myname.c_str()));
+ qwm->activateSurface(myname);
}
}
});