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