summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2023-11-30 13:06:40 +0200
committerMarius Vlad <marius.vlad@collabora.com>2023-12-04 23:47:03 +0200
commit7fd8b36ce15d7617229a86a05e4e431631e684d5 (patch)
treef8360e055f221f74e41e376d0aee4b4790f149e8 /app/main.cpp
parent7627784a867bd21e76d2889a3c99bbcfc12d3c3f (diff)
tbtnavi: Migrate to meson
This patch removes agl-shell-desktop support and migrates the entire tree to meson build system. Bug-AGL: SPEC-5003 Change-Id: Ia7728003e8069776c29641d91d1440cc65f297c5 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp99
1 files changed, 1 insertions, 98 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 4486d61..0b896b4 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -9,83 +9,10 @@
#include <QtQuick/QQuickWindow>
#include <navigation.h>
#include <vehiclesignals.h>
-#include <QScreen>
#include "navigation_client.h"
#include "qcheapruler.hpp"
#include "file_operation.h"
-#include "shell-desktop.h"
-
-#include <qpa/qplatformnativeinterface.h>
-#include <wayland-client.h>
-
-#include "wayland-agl-shell-desktop-client-protocol.h"
-
-#define OUTPUT_ID "remoting-remote-1"
-
-static void
-global_add(void *data, struct wl_registry *reg, uint32_t name,
- const char *interface, uint32_t)
-{
- struct agl_shell_desktop **shell = static_cast<struct agl_shell_desktop **>(data);
-
- if (strcmp(interface, agl_shell_desktop_interface.name) == 0) {
- *shell = static_cast<struct agl_shell_desktop *>(
- wl_registry_bind(reg, name, &agl_shell_desktop_interface, 1)
- );
- }
-}
-
-static void
-global_remove(void *data, struct wl_registry *reg, uint32_t id)
-{
- /* Don't care */
- (void) data;
- (void) reg;
- (void) id;
-}
-
-static const struct wl_registry_listener registry_listener = {
- global_add,
- global_remove,
-};
-
-static struct agl_shell_desktop *
-register_agl_shell_desktop(QPlatformNativeInterface *native)
-{
- struct wl_display *wl;
- struct wl_registry *registry;
- struct agl_shell_desktop *shell = nullptr;
-
- wl = static_cast<struct wl_display *>(native->nativeResourceForIntegration("display"));
- registry = wl_display_get_registry(wl);
-
- wl_registry_add_listener(registry, &registry_listener, &shell);
-
- /* Roundtrip to get all globals advertised by the compositor */
- wl_display_roundtrip(wl);
- wl_registry_destroy(registry);
-
- return shell;
-}
-
-
-static QScreen *
-find_qscreen(const char *screen_name)
-{
- QList<QScreen *> screens = qApp->screens();
- QScreen *found = nullptr;
- QString qstr_name = QString::fromUtf8(screen_name, -1);
-
- for (QScreen *xscreen : screens) {
- if (qstr_name == xscreen->name()) {
- found = xscreen;
- break;
- }
- }
-
- return found;
-}
int main(int argc, char *argv[])
{
@@ -101,30 +28,6 @@ int main(int argc, char *argv[])
QCoreApplication::setApplicationVersion("0.1.0");
app.setDesktopFileName(graphic_role);
- QPlatformNativeInterface *native = qApp->platformNativeInterface();
- agl_shell_desktop = register_agl_shell_desktop(native);
- if (!agl_shell_desktop) {
- qDebug() << "Could not find agl_shell_desktop extension. Is agl-compositor running?";
- exit(EXIT_FAILURE);
- }
-
- std::shared_ptr<struct agl_shell_desktop> shell{agl_shell_desktop, agl_shell_desktop_destroy};
- Shell *aglShell = new Shell(shell, nullptr);
-
- /* inform the compositor that the window be placed on a different
- * output */
- QScreen *screen_to_put = find_qscreen(OUTPUT_ID);
- if (screen_to_put) {
- qDebug() << "Found screen to put " << screen_to_put->name();
- aglShell->set_window_on_screen(screen_to_put, graphic_role);
- } else {
- qDebug() << "Couldn't find screen to put " << OUTPUT_ID;
- qDebug() << "Available screens: ";
- for (auto &ss: qApp->screens()) {
- qDebug() << "screen: " << ss->name();
- }
- }
-
// Load qml
QQmlApplicationEngine engine;
@@ -147,7 +50,7 @@ int main(int argc, char *argv[])
// notification streams separate.
Navigation *navigation = new Navigation(new VehicleSignals(vsConfig), false, context);
- engine.load(QUrl(QStringLiteral("qrc:qml/Main.qml")));
+ engine.load(QUrl(QStringLiteral("qrc:/Main.qml")));
QObject *root = engine.rootObjects().first();
new navigation_client(navigation, root->findChild<QObject*>("mapwindow"));