Debian Codegraph @

xcb/libqt5xcbqpa-dev/5.9.3/qxcbintegration.h

raw
1 // Copyright (C) 2016 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 QXCBINTEGRATION_H
6 #define QXCBINTEGRATION_H
7
8 #include <QtGui/private/qtguiglobal_p.h>
9 #include <qpa/qplatformintegration.h>
10 #include <qpa/qplatformscreen.h>
11
12 #include "qxcbexport.h"
13
14 #include <xcb/xcb.h>
15
16 QT_BEGIN_NAMESPACE
17
18 class QXcbConnection;
19 class QAbstractEventDispatcher;
20 class QXcbNativeInterface;
21 class QXcbScreen;
22
23 class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration
24 {
25 public:
26 QXcbIntegration(const QStringList &parameters, int &argc, char **argv);
27 ~QXcbIntegration();
28
29 QPlatformWindow *createPlatformWindow(QWindow *window) const override;
30 QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override;
31 #ifndef QT_NO_OPENGL
32 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
33 #endif
34 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
35
36 QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
37
38 bool hasCapability(Capability cap) const override;
39 QAbstractEventDispatcher *createEventDispatcher() const override;
40 void initialize() override;
41
42 void moveToScreen(QWindow *window, int screen);
43
44 QPlatformFontDatabase *fontDatabase() const override;
45
46 QPlatformNativeInterface *nativeInterface()const override;
47
48 #ifndef QT_NO_CLIPBOARD
49 QPlatformClipboard *clipboard() const override;
50 #endif
51 #ifndef QT_NO_DRAGANDDROP
52 QPlatformDrag *drag() const override;
53 #endif
54
55 QPlatformInputContext *inputContext() const override;
56
57 #ifndef QT_NO_ACCESSIBILITY
58 QPlatformAccessibility *accessibility() const override;
59 #endif
60
61 QPlatformServices *services() const override;
62
63 Qt::KeyboardModifiers queryKeyboardModifiers() const override;
64 QList<int> possibleKeys(const QKeyEvent *e) const override;
65
66 QStringList themeNames() const override;
67 QPlatformTheme *createPlatformTheme(const QString &name) const override;
68 QVariant styleHint(StyleHint hint) const override;
69
70 QXcbConnection *defaultConnection() const { return m_connections.first(); }
71
72 QByteArray wmClass() const;
73
74 #if QT_CONFIG(xcb_sm)
75 QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override;
76 #endif
77
78 void sync() override;
79
80 void beep() const override;
81
82 static QXcbIntegration *instance() { return m_instance; }
83
84 private:
85 QList<QXcbConnection *> m_connections;
86
87 QScopedPointer<QPlatformFontDatabase> m_fontDatabase;
88 QScopedPointer<QXcbNativeInterface> m_nativeInterface;
89
90 QScopedPointer<QPlatformInputContext> m_inputContext;
91
92 #ifndef QT_NO_ACCESSIBILITY
93 mutable QScopedPointer<QPlatformAccessibility> m_accessibility;
94 #endif
95
96 QScopedPointer<QPlatformServices> m_services;
97
98 friend class QXcbConnection; // access QPlatformIntegration::screenAdded()
99
100 mutable QByteArray m_wmClass;
101 const char *m_instanceName;
102 bool m_canGrab;
103 xcb_visualid_t m_defaultVisualId;
104
105 static QXcbIntegration *m_instance;
106 };
107
108 QT_END_NAMESPACE
109
110 #endif