diff options
author | 2020-01-22 20:30:28 +0200 | |
---|---|---|
committer | 2020-06-12 16:11:49 +0300 | |
commit | 25e961af7becf2d0b75161a467c342e9ca24b34c (patch) | |
tree | 1222d356cb8e6b7c224a9189112cfe5656453386 /app | |
parent | 419fc3c50d25fe0f55313f63b717ad16c5100187 (diff) |
app: Remove libhomescreen and windowmanger callbacks
Removes also depedencies from config.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I1e455a81a06f5d7d712d09621de585459122edd7
Diffstat (limited to 'app')
-rw-r--r-- | app/app.pri | 9 | ||||
-rw-r--r-- | app/app.pro | 2 | ||||
-rw-r--r-- | app/main.cpp | 34 |
3 files changed, 2 insertions, 43 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 39b0048..655598b 100644 --- a/app/app.pro +++ b/app/app.pro @@ -4,7 +4,7 @@ QT = quickcontrols2 websockets SOURCES = main.cpp CONFIG += link_pkgconfig -PKGCONFIG += libhomescreen qlibwindowmanager qtappfw-mediaplayer +PKGCONFIG += libhomescreen qtappfw-mediaplayer RESOURCES += \ mediaplayer.qrc \ diff --git a/app/main.cpp b/app/main.cpp index e40cf98..d72c492 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -26,8 +26,7 @@ #include <QtQml/qqml.h> #include <QtQuickControls2/QQuickStyle> #include <QQuickWindow> -#include <libhomescreen.hpp> -#include <qlibwindowmanager.h> + #include <mediaplayer.h> #include <unistd.h> @@ -63,42 +62,11 @@ int main(int argc, char *argv[]) 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); - } - AGLScreenInfo screenInfo(qwm->get_scale_factor()); - // Request a surface as described in layers.json windowmanager’s file - if (qwm->requestSurface(graphic_role) != 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, &graphic_role](json_object *object) { - fprintf(stderr, "Surface got syncDraw!\n"); - qwm->endDraw(graphic_role); - }); - - // HomeScreen - hs->init(port, token.c_str()); - // Set the event handler for Event_ShowWindow which will activate the surface for windowmanager - hs->set_event_handler(LibHomeScreen::Event_ShowWindow, [qwm, &graphic_role](json_object *object){ - qDebug("Surface %s got showWindow\n", graphic_role.toStdString().c_str()); - qwm->activateWindow(graphic_role); - }); context->setContextProperty("AlbumArt", ""); context->setContextProperty("mediaplayer", new Mediaplayer(bindingAddress, context)); - context->setContextProperty(QStringLiteral("screenInfo"), &screenInfo); engine.load(QUrl(QStringLiteral("qrc:/MediaPlayer.qml"))); - QObject *root = engine.rootObjects().first(); - QQuickWindow *window = qobject_cast<QQuickWindow *>(root); - QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateWindow() - )); } return app.exec(); } |