summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-01-22 20:35:47 +0200
committerMarius Vlad <marius.vlad@collabora.com>2020-01-22 20:39:20 +0200
commitd98e5a070e4109e28289000a7d99ff6fc91b5670 (patch)
tree562fdae2754c27c0aa3cb86b59f93d7fe20877fb /app
parentf8e8fa13f0fa1d51b7aa2b045801434ea986a72c (diff)
app/: Remove any libhomescreen and libwindowmanager callbackssandbox/mvlad/agl-compositor
Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I5e26faaac3615887945f15896b746d73dedd6535
Diffstat (limited to 'app')
-rw-r--r--app/app.pri9
-rw-r--r--app/app.pro1
-rw-r--r--app/main.cpp43
3 files changed, 2 insertions, 51 deletions
diff --git a/app/app.pri b/app/app.pri
index c3b1fd1..399d71f 100644
--- a/app/app.pri
+++ b/app/app.pri
@@ -1,13 +1,4 @@
TEMPLATE = app
QMAKE_LFLAGS += "-Wl,--hash-style=gnu -Wl,--as-needed"
-load(configure)
-qtCompileTest(libhomescreen)
-
-config_libhomescreen {
- CONFIG += link_pkgconfig
- PKGCONFIG += homescreen
- DEFINES += HAVE_LIBHOMESCREEN
-}
-
DESTDIR = $${OUT_PWD}/../package/root/bin
diff --git a/app/app.pro b/app/app.pro
index 4eef717..230f9c1 100644
--- a/app/app.pro
+++ b/app/app.pro
@@ -1,7 +1,6 @@
TARGET = navigation
CONFIG += link_pkgconfig
-PKGCONFIG += libhomescreen qlibwindowmanager
QT = qml network quick positioning location quickcontrols2
diff --git a/app/main.cpp b/app/main.cpp
index fb7dbed..5cb8a65 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -48,18 +48,12 @@
#include <QtQml/qqml.h>
#include <QtQuickControls2/QQuickStyle>
#include <QQuickWindow>
-#include <libhomescreen.hpp>
-#include <qlibwindowmanager.h>
int main(int argc, char *argv[])
{
-
- QString myname = QString("Navigation");
-
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
QGuiApplication app(argc, argv);
- QQuickStyle::setStyle("AGL");
QQmlApplicationEngine engine;
QQmlContext *context = engine.rootContext();
@@ -74,59 +68,26 @@ int main(int argc, char *argv[])
if (positionalArguments.length() == 2) {
int port = positionalArguments.takeFirst().toInt();
QString secret = positionalArguments.takeFirst();
+
QUrl bindingAddress;
bindingAddress.setScheme(QStringLiteral("ws"));
bindingAddress.setHost(QStringLiteral("localhost"));
bindingAddress.setPort(port);
bindingAddress.setPath(QStringLiteral("/api"));
+
QUrlQuery query;
query.addQueryItem(QStringLiteral("token"), secret);
bindingAddress.setQuery(query);
context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress);
std::string token = secret.toStdString();
- LibHomeScreen* hs = new LibHomeScreen();
- QLibWindowmanager* qwm = new QLibWindowmanager();
-
- // WindowManager
- if(qwm->init(port,secret) != 0){
- exit(EXIT_FAILURE);
- }
- // Request a surface as described in layers.json windowmanager’s file
- 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
- qwm->set_event_handler(QLibWindowmanager::Event_SyncDraw, [qwm, myname](json_object *object) {
- fprintf(stderr, "Surface got syncDraw!\n");
- 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){
- json_object *appnameJ = nullptr;
- if(json_object_object_get_ex(object, "application_name", &appnameJ))
- {
- const char *appname = json_object_get_string(appnameJ);
- if(myname == appname)
- {
- qDebug("Surface %s got tapShortcut\n", appname);
- qwm->activateSurface(myname);
- }
- }
- });
QVariantMap parameters;
parameters[QStringLiteral("osm.useragent")] = QStringLiteral("Automotive Grade Linux Navigation");
engine.addImportPath(QStringLiteral(":/imports"));
engine.load(QUrl(QStringLiteral("qrc:/mapviewer.qml")));
- QObject::connect(&engine, SIGNAL(quit()), qApp, SLOT(quit()));
QObject *root = engine.rootObjects().first();
- QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
- QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateSurface()));
QMetaObject::invokeMethod(root, "initializeProviders",
Q_ARG(QVariant, QVariant::fromValue(parameters)));