Debian Codegraph @

wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandintegration_p.h

raw symbols SCIP
1 // Copyright (C) 2019 The Qt Company Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5 #ifndef QPLATFORMINTEGRATION_WAYLAND_H
6 #define QPLATFORMINTEGRATION_WAYLAND_H
7
8 //
9 // W A R N I N G
10 // -------------
11 //
12 // This file is not part of the Qt API. It exists purely as an
13 // implementation detail. This header file may change from version to
14 // version without notice, or even be removed.
15 //
16 // We mean it.
17 //
18
19 #include <QtWaylandClient/qtwaylandclientglobal.h>
20 #include <qpa/qplatformintegration.h>
21 #include <QtCore/QScopedPointer>
22
23 QT_BEGIN_NAMESPACE
24
25 namespace QtWaylandClient {
26
27 class QWaylandBuffer;
28 class QWaylandDisplay;
29 class QWaylandClientBufferIntegration;
30 class QWaylandServerBufferIntegration;
31 class QWaylandShellIntegration;
32 class QWaylandInputDeviceIntegration;
33 class QWaylandInputDevice;
34
35 class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration
36 {
37 public:
38 QWaylandIntegration();
39 ~QWaylandIntegration() override;
40
41 bool hasFailed() { return mFailed; }
42
43 bool hasCapability(QPlatformIntegration::Capability cap) const override;
44 QPlatformWindow *createPlatformWindow(QWindow *window) const override;
45 #if QT_CONFIG(opengl)
46 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
47 #endif
48 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
49
50 QAbstractEventDispatcher *createEventDispatcher() const override;
51 void initialize() override;
52
53 QPlatformFontDatabase *fontDatabase() const override;
54
55 QPlatformNativeInterface *nativeInterface() const override;
56 #if QT_CONFIG(clipboard)
57 QPlatformClipboard *clipboard() const override;
58 #endif
59 #if QT_CONFIG(draganddrop)
60 QPlatformDrag *drag() const override;
61 #endif
62 QPlatformInputContext *inputContext() const override;
63
64 QVariant styleHint(StyleHint hint) const override;
65
66 #if QT_CONFIG(accessibility)
67 QPlatformAccessibility *accessibility() const override;
68 #endif
69
70 QPlatformServices *services() const override;
71
72 QWaylandDisplay *display() const;
73
74 QStringList themeNames() const override;
75
76 QPlatformTheme *createPlatformTheme(const QString &name) const override;
77
78 QWaylandInputDevice *createInputDevice(QWaylandDisplay *display, int version, uint32_t id);
79
80 virtual QWaylandClientBufferIntegration *clientBufferIntegration() const;
81 virtual QWaylandServerBufferIntegration *serverBufferIntegration() const;
82 virtual QWaylandShellIntegration *shellIntegration() const;
83
84 private:
85 // NOTE: mDisplay *must* be destructed after mDrag and mClientBufferIntegration.
86 // Do not move this definition into the private section at the bottom.
87 QScopedPointer<QWaylandDisplay> mDisplay;
88
89 protected:
90 QScopedPointer<QWaylandClientBufferIntegration> mClientBufferIntegration;
91 QScopedPointer<QWaylandServerBufferIntegration> mServerBufferIntegration;
92 QScopedPointer<QWaylandShellIntegration> mShellIntegration;
93 QScopedPointer<QWaylandInputDeviceIntegration> mInputDeviceIntegration;
94
95 private:
96 void initializeClientBufferIntegration();
97 void initializeServerBufferIntegration();
98 void initializeShellIntegration();
99 void initializeInputDeviceIntegration();
100 QWaylandShellIntegration *createShellIntegration(const QString& interfaceName);
101
102 QScopedPointer<QPlatformFontDatabase> mFontDb;
103 #if QT_CONFIG(clipboard)
104 QScopedPointer<QPlatformClipboard> mClipboard;
105 #endif
106 #if QT_CONFIG(draganddrop)
107 QScopedPointer<QPlatformDrag> mDrag;
108 #endif
109 QScopedPointer<QPlatformNativeInterface> mNativeInterface;
110 QScopedPointer<QPlatformInputContext> mInputContext;
111 #if QT_CONFIG(accessibility)
112 QScopedPointer<QPlatformAccessibility> mAccessibility;
113 #endif
114 bool mFailed = false;
115 bool mClientBufferIntegrationInitialized = false;
116 bool mServerBufferIntegrationInitialized = false;
117 bool mShellIntegrationInitialized = false;
118
119 friend class QWaylandDisplay;
120 };
121
122 }
123
124 QT_END_NAMESPACE
125
126 #endif