Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qguiapplication_platform.h
Go to the documentation of this file.
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)
22typedef struct _XDisplay Display;
23struct xcb_connection_t;
24#endif
25
26#if QT_CONFIG(wayland)
27struct wl_display;
28struct wl_compositor;
29struct wl_seat;
30struct wl_keyboard;
31struct wl_pointer;
32struct wl_touch;
33
34#if QT_CONFIG(xkbcommon)
35struct xkb_context;
36#endif
37
38#endif
39
40#if defined(Q_OS_VISIONOS) || defined(Q_QDOC)
41# ifdef __OBJC__
42Q_FORWARD_DECLARE_OBJC_CLASS(CP_OBJECT_cp_layer_renderer_capabilities);
43typedef CP_OBJECT_cp_layer_renderer_capabilities *cp_layer_renderer_capabilities_t;
44Q_FORWARD_DECLARE_OBJC_CLASS(CP_OBJECT_cp_layer_renderer_configuration);
45typedef CP_OBJECT_cp_layer_renderer_configuration *cp_layer_renderer_configuration_t;
46Q_FORWARD_DECLARE_OBJC_CLASS(CP_OBJECT_cp_layer_renderer);
47typedef CP_OBJECT_cp_layer_renderer *cp_layer_renderer_t;
48# else
49typedef struct cp_layer_renderer_capabilities_s *cp_layer_renderer_capabilities_t;
50typedef struct cp_layer_renderer_configuration_s *cp_layer_renderer_configuration_t;
51typedef struct cp_layer_renderer_s *cp_layer_renderer_t;
52# endif
53#endif
54
55
56QT_BEGIN_NAMESPACE
57
58namespace QNativeInterface
59{
60
61#if QT_CONFIG(xcb) || defined(Q_QDOC)
62struct Q_GUI_EXPORT QX11Application
63{
64 QT_DECLARE_NATIVE_INTERFACE(QX11Application, 1, QGuiApplication)
65 virtual Display *display() const = 0;
66 virtual xcb_connection_t *connection() const = 0;
67};
68#endif
69
70#if QT_CONFIG(wayland) || defined(Q_QDOC)
71struct Q_GUI_EXPORT QWaylandApplication
72{
73 QT_DECLARE_NATIVE_INTERFACE(QWaylandApplication, 2, QGuiApplication)
74 virtual wl_display *display() const = 0;
75 virtual wl_compositor *compositor() const = 0;
76 virtual wl_seat *seat() const = 0;
77 virtual wl_keyboard *keyboard() const = 0;
78 virtual wl_pointer *pointer() const = 0;
79 virtual wl_touch *touch() const = 0;
80 virtual uint lastInputSerial() const = 0;
81 virtual wl_seat *lastInputSeat() const = 0;
82#if QT_CONFIG(xkbcommon)
83 virtual xkb_context *xkbContext() const = 0;
84#endif
85};
86#endif
87
88#if defined(Q_OS_VISIONOS) || defined(Q_QDOC)
89struct Q_GUI_EXPORT QVisionOSApplication
90{
91 QT_DECLARE_NATIVE_INTERFACE(QVisionOSApplication, 1, QGuiApplication)
92 struct ImmersiveSpaceCompositorLayer {
93 virtual void configure(cp_layer_renderer_capabilities_t, cp_layer_renderer_configuration_t) const {}
94 virtual void render(cp_layer_renderer_t) = 0;
95 virtual void handleSpatialEvents(const QJsonObject &) {};
96 };
97 virtual void setImmersiveSpaceCompositorLayer(ImmersiveSpaceCompositorLayer *layer) = 0;
98 virtual void openImmersiveSpace() = 0;
99 virtual void dismissImmersiveSpace() = 0;
100};
101#endif
102
103} // QNativeInterface
104
105QT_END_NAMESPACE
106
107#endif // QGUIAPPLICATION_PLATFORM_H