From 7fd8b36ce15d7617229a86a05e4e431631e684d5 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Thu, 30 Nov 2023 13:06:40 +0200 Subject: 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 --- app/main.cpp | 99 +----------------------------------------------------------- 1 file changed, 1 insertion(+), 98 deletions(-) (limited to 'app/main.cpp') 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 #include #include -#include #include "navigation_client.h" #include "qcheapruler.hpp" #include "file_operation.h" -#include "shell-desktop.h" - -#include -#include - -#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(data); - - if (strcmp(interface, agl_shell_desktop_interface.name) == 0) { - *shell = static_cast( - 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(native->nativeResourceForIntegration("display")); - registry = wl_display_get_registry(wl); - - wl_registry_add_listener(registry, ®istry_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 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 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("mapwindow")); -- cgit 1.2.3-korg