File indexing completed on 2024-05-05 17:42:26

0001 /*  This file is part of the KDE libraries
0002     SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 #ifndef KWAYLANDINTEGRATION_H
0007 #define KWAYLANDINTEGRATION_H
0008 
0009 #include "kdeplatformtheme.h"
0010 #include <QHash>
0011 #include <QObject>
0012 #include <QtWaylandClient/QWaylandClientExtensionTemplate>
0013 
0014 class QWindow;
0015 
0016 class AppMenuManager;
0017 class ServerSideDecorationPaletteManager;
0018 
0019 class KWaylandIntegration : public QObject
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit KWaylandIntegration(KdePlatformTheme *platformTheme);
0024     ~KWaylandIntegration() override;
0025 
0026     void setAppMenu(QWindow *window, const QString &serviceName, const QString &objectPath);
0027     void setPalette(QWindow *window, const QString &paletteName);
0028 
0029     bool eventFilter(QObject *watched, QEvent *event) override;
0030 
0031 private:
0032     static bool isRelevantTopLevel(QWindow *w);
0033     static struct wl_surface *surfaceFromWindow(QWindow *w);
0034     void shellSurfaceCreated(QWindow *w);
0035     void shellSurfaceDestroyed(QWindow *w);
0036 
0037     void installColorScheme(QWindow *w);
0038     QScopedPointer<AppMenuManager> m_appMenuManager;
0039     QScopedPointer<ServerSideDecorationPaletteManager> m_paletteManager;
0040 
0041     KdePlatformTheme *m_platformTheme;
0042 };
0043 
0044 #endif