summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-04-23 21:58:38 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-06-24 17:56:05 +0300
commit01c01f55534dad5cc055c26eb67d9d0e6cf37b3d (patch)
tree1f9b33f8b0ea262984b37bdba038d154c7458433
parentf8ef14823e661ff00285ffddd86397c49c081162 (diff)
Conversion to agl-compositor
Bug-AGL: SPEC-3447 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I5b2dca1677f88e01cc28f10911e036707c3c6924
-rw-r--r--app/Settings.qml7
-rw-r--r--app/app.pro2
-rw-r--r--app/main.cpp35
-rw-r--r--package/config.xml1
4 files changed, 10 insertions, 35 deletions
diff --git a/app/Settings.qml b/app/Settings.qml
index 47e720e..0bf6c3f 100644
--- a/app/Settings.qml
+++ b/app/Settings.qml
@@ -17,6 +17,7 @@
import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
+import QtQuick.Window 2.13
import 'datetime'
import 'bluetooth'
@@ -38,9 +39,9 @@ ApplicationWindow {
Item {
id: container
anchors.centerIn: parent
- width: 1080
- height: 1487
- scale: screenInfo.scale_factor()
+ width: Screen.width
+ height: Screen.height
+ scale: 1
StackView {
id: stack
diff --git a/app/app.pro b/app/app.pro
index 8809bc0..8236dd5 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-network qtappfw-bt qtappfw-voice qtqrcode-quickitem
+PKGCONFIG += libhomescreen qtappfw-network qtappfw-bt qtappfw-voice qtqrcode-quickitem
CONFIG(release, debug|release) {
QMAKE_POST_LINK = $(STRIP) --strip-unneeded $(TARGET)
diff --git a/app/main.cpp b/app/main.cpp
index 20aff96..655690a 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -28,7 +28,6 @@
#include <libhomescreen.hpp>
#include <bluetooth.h>
#include <network.h>
-#include <qlibwindowmanager.h>
#include <voice.h>
int main(int argc, char *argv[])
@@ -36,10 +35,14 @@ int main(int argc, char *argv[])
QString graphic_role = QString("settings"); // defined in layers.json in window manager
QGuiApplication app(argc, argv);
+
app.setApplicationName(graphic_role);
app.setApplicationVersion(QStringLiteral("0.1.1"));
app.setOrganizationDomain(QStringLiteral("automotivelinux.org"));
app.setOrganizationName(QStringLiteral("AutomotiveGradeLinux"));
+ // necessary as the app_id will be a combination of 'automotivelinux.org'
+ // and 'settings'
+ app.setDesktopFileName(graphic_role);
QQuickStyle::setStyle("AGL");
@@ -71,31 +74,6 @@ int main(int argc, char *argv[])
context->setContextProperty("network", new Network(bindingAddressWS, context));
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);
- });
QFile version("/proc/version");
if (version.open(QFile::ReadOnly)) {
@@ -119,11 +97,8 @@ int main(int argc, char *argv[])
QtQrCodeQuickItem::registerQmlTypes();
engine.rootContext()->setContextProperty("bluetooth", new Bluetooth(bindingAddressWS, context));
engine.rootContext()->setContextProperty("voice", new Voice(bindingAddressWS, context));
- engine.rootContext()->setContextProperty(QStringLiteral("screenInfo"), &screenInfo);
+
engine.load(QUrl(QStringLiteral("qrc:/Settings.qml")));
- QObject *root = engine.rootObjects().first();
- QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
- QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateWindow()));
return app.exec();
}
diff --git a/package/config.xml b/package/config.xml
index 2c251d0..f4427ff 100644
--- a/package/config.xml
+++ b/package/config.xml
@@ -7,7 +7,6 @@
<author>Tasuku Suzuki &lt;tasuku.suzuki@qt.io&gt;</author>
<license>APL 2.0</license>
<feature name="urn:AGL:widget:required-api">
- <param name="windowmanager" value="ws" />
<param name="homescreen" value="ws" />
<param name="network-manager" value="ws" />
<param name="Bluetooth-Manager" value="ws" />