diff options
Diffstat (limited to 'src/gui/kernel/qplatformwindow_p.h')
-rw-r--r-- | src/gui/kernel/qplatformwindow_p.h | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/src/gui/kernel/qplatformwindow_p.h b/src/gui/kernel/qplatformwindow_p.h index 8facac927d..2bbdfd5bf9 100644 --- a/src/gui/kernel/qplatformwindow_p.h +++ b/src/gui/kernel/qplatformwindow_p.h @@ -19,6 +19,14 @@ #include <QtCore/qbasictimer.h> #include <QtCore/qrect.h> #include <QtCore/qnativeinterface.h> +#include <QtGui/qwindow.h> + +#if QT_CONFIG(wayland) +#include <any> +#include <QtCore/qobject.h> + +struct wl_surface; +#endif QT_BEGIN_NAMESPACE @@ -35,7 +43,16 @@ public: namespace QNativeInterface::Private { -#if defined(Q_OS_MACOS) || defined(Q_CLANG_QDOC) +#if defined(Q_OS_WASM) || defined(Q_QDOC) +struct Q_GUI_EXPORT QWasmWindow +{ + QT_DECLARE_NATIVE_INTERFACE(QWasmWindow, 1, QWindow) + virtual emscripten::val document() const = 0; + virtual emscripten::val clientArea() const = 0; +}; +#endif + +#if defined(Q_OS_MACOS) || defined(Q_QDOC) struct Q_GUI_EXPORT QCocoaWindow { QT_DECLARE_NATIVE_INTERFACE(QCocoaWindow, 1, QWindow) @@ -44,7 +61,7 @@ struct Q_GUI_EXPORT QCocoaWindow }; #endif -#if QT_CONFIG(xcb) || defined(Q_CLANG_QDOC) +#if QT_CONFIG(xcb) || defined(Q_QDOC) struct Q_GUI_EXPORT QXcbWindow { QT_DECLARE_NATIVE_INTERFACE(QXcbWindow, 1, QWindow) @@ -76,7 +93,7 @@ struct Q_GUI_EXPORT QXcbWindow }; #endif // xcb -#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC) +#if defined(Q_OS_WIN) || defined(Q_QDOC) struct Q_GUI_EXPORT QWindowsWindow { QT_DECLARE_NATIVE_INTERFACE(QWindowsWindow, 1, QWindow) @@ -89,6 +106,35 @@ struct Q_GUI_EXPORT QWindowsWindow }; #endif // Q_OS_WIN +#if QT_CONFIG(wayland) +struct Q_GUI_EXPORT QWaylandWindow : public QObject +{ + Q_OBJECT +public: + QT_DECLARE_NATIVE_INTERFACE(QWaylandWindow, 1, QWindow) + + virtual wl_surface *surface() const = 0; + virtual void setCustomMargins(const QMargins &margins) = 0; + virtual void requestXdgActivationToken(uint serial) = 0; + template<typename T> + T *surfaceRole() const + { + std::any anyRole = _surfaceRole(); + auto role = std::any_cast<T *>(&anyRole); + return role ? *role : nullptr; + } +Q_SIGNALS: + void surfaceCreated(); + void surfaceDestroyed(); + void surfaceRoleCreated(); + void surfaceRoleDestroyed(); + void xdgActivationTokenCreated(const QString &token); + +protected: + virtual std::any _surfaceRole() const = 0; +}; +#endif + } // QNativeInterface::Private QT_END_NAMESPACE |