File indexing completed on 2024-11-24 03:41:30

0001 /*
0002     SPDX-FileCopyrightText: 2023 Kai Uwe Broulik <kde@broulik.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef WAYLANDXDGFOREIGNV2_P_H
0008 #define WAYLANDXDGFOREIGNV2_P_H
0009 
0010 #include "qwayland-xdg-foreign-unstable-v2.h"
0011 
0012 #include <QObject>
0013 #include <QtWaylandClient/QWaylandClientExtension>
0014 
0015 class WaylandXdgForeignExportedV2 : public QObject, public QtWayland::zxdg_exported_v2
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     explicit WaylandXdgForeignExportedV2(::zxdg_exported_v2 *object);
0021     ~WaylandXdgForeignExportedV2() override;
0022 
0023     QString handle() const;
0024 
0025 Q_SIGNALS:
0026     void handleReceived(const QString &handle);
0027 
0028 protected:
0029     void zxdg_exported_v2_handle(const QString &handle) override;
0030 
0031 private:
0032     QString m_handle;
0033 };
0034 
0035 class WaylandXdgForeignExporterV2 : public QWaylandClientExtensionTemplate<WaylandXdgForeignExporterV2>, public QtWayland::zxdg_exporter_v2
0036 {
0037 public:
0038     ~WaylandXdgForeignExporterV2() override;
0039 
0040     static WaylandXdgForeignExporterV2 &self();
0041 
0042     WaylandXdgForeignExportedV2 *exportToplevel(struct ::wl_surface *surface);
0043 
0044 private:
0045     WaylandXdgForeignExporterV2();
0046 };
0047 
0048 class WaylandXdgForeignImportedV2 : public QObject, public QtWayland::zxdg_imported_v2
0049 {
0050 public:
0051     explicit WaylandXdgForeignImportedV2(const QString &handle, ::zxdg_imported_v2 *object);
0052     ~WaylandXdgForeignImportedV2() override;
0053 
0054     QString handle() const;
0055 
0056 protected:
0057     void zxdg_imported_v2_destroyed() override;
0058 
0059 private:
0060     QString m_handle;
0061 };
0062 
0063 class WaylandXdgForeignImporterV2 : public QWaylandClientExtensionTemplate<WaylandXdgForeignImporterV2>, public QtWayland::zxdg_importer_v2
0064 {
0065 public:
0066     ~WaylandXdgForeignImporterV2() override;
0067 
0068     static WaylandXdgForeignImporterV2 &self();
0069 
0070     WaylandXdgForeignImportedV2 *importToplevel(const QString &handle);
0071 
0072 private:
0073     WaylandXdgForeignImporterV2();
0074 };
0075 
0076 #endif // WAYLANDXDGFOREIGNV2_P_H