Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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;
37class QWaylandPlatformServices;
38
39class Q_WAYLANDCLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration
40{
41public:
43 ~QWaylandIntegration() override;
44
45 static QWaylandIntegration *instance() { return sInstance; }
46
47 bool init();
48
49 bool hasCapability(QPlatformIntegration::Capability cap) const override;
50 QPlatformWindow *createPlatformWindow(QWindow *window) const override;
51#if QT_CONFIG(opengl)
52 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
53#endif
54 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
55
56 QAbstractEventDispatcher *createEventDispatcher() const override;
57 void initialize() override;
58
59 QPlatformFontDatabase *fontDatabase() const override;
60
61 QPlatformNativeInterface *nativeInterface() const override;
62#if QT_CONFIG(clipboard)
63 QPlatformClipboard *clipboard() const override;
64#endif
65#if QT_CONFIG(draganddrop)
66 QPlatformDrag *drag() const override;
67#endif
68 QPlatformInputContext *inputContext() const override;
69
70 QVariant styleHint(StyleHint hint) const override;
71
72#if QT_CONFIG(accessibility)
73 QPlatformAccessibility *accessibility() const override;
74#endif
75
76 QPlatformServices *services() const override;
77
78 QWaylandDisplay *display() const;
79
80 Qt::KeyboardModifiers queryKeyboardModifiers() const override;
81
82 QList<int> possibleKeys(const QKeyEvent *event) const override;
83
84 QStringList themeNames() const override;
85
86 QPlatformTheme *createPlatformTheme(const QString &name) const override;
87
88#if QT_CONFIG(vulkan)
89 QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
90#endif
91
92 void setApplicationBadge(qint64 number) override;
93
94 virtual QWaylandInputDevice *createInputDevice(QWaylandDisplay *display, int version, uint32_t id) const;
95 virtual QWaylandScreen *createPlatformScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id) const;
96 virtual QWaylandCursor *createPlatformCursor(QWaylandDisplay *display) const;
97
98 virtual QWaylandClientBufferIntegration *clientBufferIntegration() const;
99 virtual QWaylandServerBufferIntegration *serverBufferIntegration() const;
100 virtual QWaylandShellIntegration *shellIntegration() const;
101
102 void reconfigureInputContext();
103
104protected:
105 // NOTE: mDisplay *must* be destructed after mDrag and mClientBufferIntegration
106 // and mShellIntegration.
107 // Do not move this definition into the private section at the bottom.
108 QScopedPointer<QWaylandDisplay> mDisplay;
109
110protected:
111 void reset();
112 virtual QPlatformNativeInterface *createPlatformNativeInterface();
113
114 QScopedPointer<QWaylandClientBufferIntegration> mClientBufferIntegration;
115 QScopedPointer<QWaylandServerBufferIntegration> mServerBufferIntegration;
116 QScopedPointer<QWaylandShellIntegration> mShellIntegration;
117 QScopedPointer<QWaylandInputDeviceIntegration> mInputDeviceIntegration;
118
119 QScopedPointer<QPlatformInputContext> mInputContext;
120
121private:
122 void initializePlatform();
123 void initializeClientBufferIntegration();
124 void initializeServerBufferIntegration();
125 void initializeShellIntegration();
126 void initializeInputDeviceIntegration();
127 QWaylandShellIntegration *createShellIntegration(const QString& interfaceName);
128
129 QScopedPointer<QPlatformFontDatabase> mFontDb;
130#if QT_CONFIG(clipboard)
131 QScopedPointer<QPlatformClipboard> mClipboard;
132#endif
133#if QT_CONFIG(draganddrop)
134 QScopedPointer<QPlatformDrag> mDrag;
135#endif
136 QScopedPointer<QPlatformNativeInterface> mNativeInterface;
137#if QT_CONFIG(accessibility)
138 mutable QScopedPointer<QPlatformAccessibility> mAccessibility;
139#endif
140 QScopedPointer<QWaylandPlatformServices> mPlatformServices;
141 QMutex mClientBufferInitLock;
142 bool mClientBufferIntegrationInitialized = false;
143 bool mServerBufferIntegrationInitialized = false;
144 bool mShellIntegrationInitialized = false;
145
146 static QWaylandIntegration *sInstance;
147
148 friend class QWaylandDisplay;
149};
150
151}
152
154
155#endif
std::vector< ObjCStrongReference< CBMutableService > > services
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtCore
Definition qmutex.h:281
\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
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
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:94
GLuint name
struct _cl_event * event
GLboolean reset
GLenum cap
QAnyStringView interfaceName(const Interface &iface)
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:60
QWinTabPointingDevice * createInputDevice(const QSharedPointer< QWindowsTabletDeviceData > &d, QInputDevice::DeviceType devType, QPointingDevice::PointerType pointerType)
QT_BEGIN_NAMESPACE constexpr const wchar_t * themeNames[]
aWidget window() -> setWindowTitle("New Window Title")
[2]