| 1 | // Copyright (C) 2021 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QGUIAPPLICATION_PLATFORM_H |
| 5 | #define QGUIAPPLICATION_PLATFORM_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is part of the native interface APIs. Usage of |
| 12 | // this API may make your code source and binary incompatible |
| 13 | // with future versions of Qt. |
| 14 | // |
| 15 | |
| 16 | #include <QtGui/qtguiglobal.h> |
| 17 | |
| 18 | #include <QtCore/qnativeinterface.h> |
| 19 | #include <QtGui/qguiapplication.h> |
| 20 | |
| 21 | #if QT_CONFIG(xcb) |
| 22 | typedef struct _XDisplay Display; |
| 23 | struct xcb_connection_t; |
| 24 | #endif |
| 25 | |
| 26 | #if QT_CONFIG(wayland) |
| 27 | struct wl_display; |
| 28 | struct wl_compositor; |
| 29 | struct wl_seat; |
| 30 | struct wl_keyboard; |
| 31 | struct wl_pointer; |
| 32 | struct wl_touch; |
| 33 | #endif |
| 34 | |
| 35 | #if defined(Q_OS_VISIONOS) || defined(Q_QDOC) |
| 36 | # ifdef __OBJC__ |
| 37 | Q_FORWARD_DECLARE_OBJC_CLASS(CP_OBJECT_cp_layer_renderer_capabilities); |
| 38 | typedef CP_OBJECT_cp_layer_renderer_capabilities *cp_layer_renderer_capabilities_t; |
| 39 | Q_FORWARD_DECLARE_OBJC_CLASS(CP_OBJECT_cp_layer_renderer_configuration); |
| 40 | typedef CP_OBJECT_cp_layer_renderer_configuration *cp_layer_renderer_configuration_t; |
| 41 | Q_FORWARD_DECLARE_OBJC_CLASS(CP_OBJECT_cp_layer_renderer); |
| 42 | typedef CP_OBJECT_cp_layer_renderer *cp_layer_renderer_t; |
| 43 | # else |
| 44 | typedef struct cp_layer_renderer_capabilities_s *cp_layer_renderer_capabilities_t; |
| 45 | typedef struct cp_layer_renderer_configuration_s *cp_layer_renderer_configuration_t; |
| 46 | typedef struct cp_layer_renderer_s *cp_layer_renderer_t; |
| 47 | # endif |
| 48 | #endif |
| 49 | |
| 50 | |
| 51 | QT_BEGIN_NAMESPACE |
| 52 | |
| 53 | namespace QNativeInterface |
| 54 | { |
| 55 | |
| 56 | #if QT_CONFIG(xcb) || defined(Q_QDOC) |
| 57 | struct Q_GUI_EXPORT QX11Application |
| 58 | { |
| 59 | QT_DECLARE_NATIVE_INTERFACE(QX11Application, 1, QGuiApplication) |
| 60 | virtual Display *display() const = 0; |
| 61 | virtual xcb_connection_t *connection() const = 0; |
| 62 | }; |
| 63 | #endif |
| 64 | |
| 65 | #if QT_CONFIG(wayland) || defined(Q_QDOC) |
| 66 | struct Q_GUI_EXPORT QWaylandApplication |
| 67 | { |
| 68 | QT_DECLARE_NATIVE_INTERFACE(QWaylandApplication, 1, QGuiApplication) |
| 69 | virtual wl_display *display() const = 0; |
| 70 | virtual wl_compositor *compositor() const = 0; |
| 71 | virtual wl_seat *seat() const = 0; |
| 72 | virtual wl_keyboard *keyboard() const = 0; |
| 73 | virtual wl_pointer *pointer() const = 0; |
| 74 | virtual wl_touch *touch() const = 0; |
| 75 | virtual uint lastInputSerial() const = 0; |
| 76 | virtual wl_seat *lastInputSeat() const = 0; |
| 77 | }; |
| 78 | #endif |
| 79 | |
| 80 | #if defined(Q_OS_VISIONOS) || defined(Q_QDOC) |
| 81 | struct Q_GUI_EXPORT QVisionOSApplication |
| 82 | { |
| 83 | QT_DECLARE_NATIVE_INTERFACE(QVisionOSApplication, 1, QGuiApplication) |
| 84 | struct ImmersiveSpaceCompositorLayer { |
| 85 | virtual void configure(cp_layer_renderer_capabilities_t, cp_layer_renderer_configuration_t) const {} |
| 86 | virtual void render(cp_layer_renderer_t) = 0; |
| 87 | virtual void handleSpatialEvents(const QJsonObject &) {}; |
| 88 | }; |
| 89 | virtual void setImmersiveSpaceCompositorLayer(ImmersiveSpaceCompositorLayer *layer) = 0; |
| 90 | virtual void openImmersiveSpace() = 0; |
| 91 | virtual void dismissImmersiveSpace() = 0; |
| 92 | }; |
| 93 | #endif |
| 94 | |
| 95 | } // QNativeInterface |
| 96 | |
| 97 | QT_END_NAMESPACE |
| 98 | |
| 99 | #endif // QGUIAPPLICATION_PLATFORM_H |
| 100 | |