Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwaylandintegration_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QPLATFORMINTEGRATION_WAYLAND_H
5#define QPLATFORMINTEGRATION_WAYLAND_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtWaylandClient/qtwaylandclientglobal.h>
19#include <qpa/qplatformintegration.h>
20#include <QtCore/QScopedPointer>
21#include <QtCore/QMutex>
22#include <QtCore/private/qglobal_p.h>
23
25
26namespace QtWaylandClient {
27
28class QWaylandBuffer;
29class QWaylandDisplay;
30class QWaylandClientBufferIntegration;
31class QWaylandServerBufferIntegration;
32class QWaylandShellIntegration;
33class QWaylandInputDeviceIntegration;
34class QWaylandInputDevice;
35class QWaylandScreen;
36class QWaylandCursor;
37
38class Q_WAYLANDCLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration
39{
40public:
42 ~QWaylandIntegration() override;
43
44 static QWaylandIntegration *instance() { return sInstance; }
45
46 bool init();
47
48 bool hasCapability(QPlatformIntegration::Capability cap) const override;
49 QPlatformWindow *createPlatformWindow(QWindow *window) const override;
50#if QT_CONFIG(opengl)
51 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
52#endif
53 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
54
55 QAbstractEventDispatcher *createEventDispatcher() const override;
56 void initialize() override;
57
58 QPlatformFontDatabase *fontDatabase() const override;
59
60 QPlatformNativeInterface *nativeInterface() const override;
61#if QT_CONFIG(clipboard)
62 QPlatformClipboard *clipboard() const override;
63#endif
64#if QT_CONFIG(draganddrop)
65 QPlatformDrag *drag() const override;
66#endif
67 QPlatformInputContext *inputContext() const override;
68
69 QVariant styleHint(StyleHint hint) const override;
70
71#if QT_CONFIG(accessibility)
72 QPlatformAccessibility *accessibility() const override;
73#endif
74
75 QPlatformServices *services() const override;
76
77 QWaylandDisplay *display() const;
78
79 Qt::KeyboardModifiers queryKeyboardModifiers() const override;
80
81 QList<int> possibleKeys(const QKeyEvent *event) const override;
82
83 QStringList themeNames() const override;
84
85 QPlatformTheme *createPlatformTheme(const QString &name) const override;
86
87#if QT_CONFIG(vulkan)
88 QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
89#endif
90
91 void setApplicationBadge(qint64 number) override;
92
93 virtual QWaylandInputDevice *createInputDevice(QWaylandDisplay *display, int version, uint32_t id) const;
94 virtual QWaylandScreen *createPlatformScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id) const;
95 virtual QWaylandCursor *createPlatformCursor(QWaylandDisplay *display) const;
96
97 virtual QWaylandClientBufferIntegration *clientBufferIntegration() const;
98 virtual QWaylandServerBufferIntegration *serverBufferIntegration() const;
99 virtual QWaylandShellIntegration *shellIntegration() const;
100
101 void reconfigureInputContext();
102
103protected:
104 // NOTE: mDisplay *must* be destructed after mDrag and mClientBufferIntegration
105 // and mShellIntegration.
106 // Do not move this definition into the private section at the bottom.
108
109protected:
110 void reset();
111 virtual QPlatformNativeInterface *createPlatformNativeInterface();
112
117
119
120private:
121 void initializePlatform();
122 void initializeClientBufferIntegration();
123 void initializeServerBufferIntegration();
124 void initializeShellIntegration();
125 void initializeInputDeviceIntegration();
126 QWaylandShellIntegration *createShellIntegration(const QString& interfaceName);
127
129#if QT_CONFIG(clipboard)
131#endif
132#if QT_CONFIG(draganddrop)
134#endif
136#if QT_CONFIG(accessibility)
137 mutable QScopedPointer<QPlatformAccessibility> mAccessibility;
138#endif
139 QMutex mClientBufferInitLock;
140 bool mClientBufferIntegrationInitialized = false;
141 bool mServerBufferIntegrationInitialized = false;
142 bool mShellIntegrationInitialized = false;
143
144 static QWaylandIntegration *sInstance;
145
146 friend class QWaylandDisplay;
147};
148
149}
150
152
153#endif
std::vector< ObjCStrongReference< CBMutableService > > services
The QKeyEvent class describes a key event.
Definition qevent.h:423
Definition qlist.h:74
\inmodule QtCore
Definition qmutex.h:285
\inmodule QtGui
The QPlatformBackingStore class provides the drawing area for top-level windows.
The QPlatformClipboard class provides an abstraction for the system clipboard.
The QPlatformDrag class provides an abstraction for drag.
The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they ...
The QPlatformInputContext class abstracts the input method dependent data and composing state.
The QPlatformIntegration class is the entry for WindowSystem specific functionality.
Capability
Capabilities are used to determine specific features of a platform integration.
The QPlatformNativeInterface class provides an abstraction for retrieving native resource handles.
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
The QPlatformServices provides the backend for desktop-related functionality.
The QPlatformTheme class allows customizing the UI based on themes.
The QPlatformVulkanInstance class provides an abstraction for Vulkan instances.
The QPlatformWindow class provides an abstraction for top-level windows.
\inmodule QtCore
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qvariant.h:64
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
\inmodule QtGui
Definition qwindow.h:63
QScopedPointer< QWaylandInputDeviceIntegration > mInputDeviceIntegration
QScopedPointer< QWaylandClientBufferIntegration > mClientBufferIntegration
static QWaylandIntegration * instance()
QScopedPointer< QWaylandDisplay > mDisplay
QScopedPointer< QWaylandShellIntegration > mShellIntegration
QScopedPointer< QWaylandServerBufferIntegration > mServerBufferIntegration
QScopedPointer< QPlatformInputContext > mInputContext
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
static void * context
static bool initialize()
Definition qctf.cpp:67
GLuint name
struct _cl_event * event
GLboolean reset
GLenum cap
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
long long qint64
Definition qtypes.h:55
QWinTabPointingDevice * createInputDevice(const QSharedPointer< QWindowsTabletDeviceData > &d, QInputDevice::DeviceType devType, QPointingDevice::PointerType pointerType)
static const wchar_t * themeNames[QWindowsVistaStylePrivate::NThemes]
aWidget window() -> setWindowTitle("New Window Title")
[2]