Debian Codegraph @

xcb/libqt6xcbqpa-dev/6.2.4/qxcbintegration.h

raw
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 3 requirements
23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24 **
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 2.0 or (at your option) the GNU General
28 ** Public license version 3 or any later version approved by the KDE Free
29 ** Qt Foundation. The licenses are as published by the Free Software
30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31 ** included in the packaging of this file. Please review the following
32 ** information to ensure the GNU General Public License requirements will
33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34 ** https://www.gnu.org/licenses/gpl-3.0.html.
35 **
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39
40 #ifndef QXCBINTEGRATION_H
41 #define QXCBINTEGRATION_H
42
43 #include <QtGui/private/qtguiglobal_p.h>
44 #include <qpa/qplatformintegration.h>
45 #include <qpa/qplatformscreen.h>
46 #include <qpa/qplatformopenglcontext.h>
47
48 #include "qxcbexport.h"
49
50 #include <xcb/xcb.h>
51
52 QT_BEGIN_NAMESPACE
53
54 class QXcbConnection;
55 class QAbstractEventDispatcher;
56 class QXcbNativeInterface;
57
58 class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration
59 #ifndef QT_NO_OPENGL
60 # if QT_CONFIG(xcb_glx_plugin)
61 , public QNativeInterface::Private::QGLXIntegration
62 # endif
63 # if QT_CONFIG(egl)
64 , public QNativeInterface::Private::QEGLIntegration
65 # endif
66 #endif
67 {
68 public:
69 QXcbIntegration(const QStringList &parameters, int &argc, char **argv);
70 ~QXcbIntegration();
71
72 QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override;
73 QPlatformWindow *createPlatformWindow(QWindow *window) const override;
74 QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override;
75 #ifndef QT_NO_OPENGL
76 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
77 # if QT_CONFIG(xcb_glx_plugin)
78 QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override;
79 # endif
80 # if QT_CONFIG(egl)
81 QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override;
82 # endif
83 #endif
84 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
85
86 QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
87
88 bool hasCapability(Capability cap) const override;
89 QAbstractEventDispatcher *createEventDispatcher() const override;
90 void initialize() override;
91
92 void moveToScreen(QWindow *window, int screen);
93
94 QPlatformFontDatabase *fontDatabase() const override;
95
96 QPlatformNativeInterface *nativeInterface()const override;
97
98 #ifndef QT_NO_CLIPBOARD
99 QPlatformClipboard *clipboard() const override;
100 #endif
101 #if QT_CONFIG(draganddrop)
102 QPlatformDrag *drag() const override;
103 #endif
104
105 QPlatformInputContext *inputContext() const override;
106
107 #ifndef QT_NO_ACCESSIBILITY
108 QPlatformAccessibility *accessibility() const override;
109 #endif
110
111 QPlatformServices *services() const override;
112
113 Qt::KeyboardModifiers queryKeyboardModifiers() const override;
114 QList<int> possibleKeys(const QKeyEvent *e) const override;
115
116 QStringList themeNames() const override;
117 QPlatformTheme *createPlatformTheme(const QString &name) const override;
118 QVariant styleHint(StyleHint hint) const override;
119
120 bool hasConnection() const { return m_connection; }
121 QXcbConnection *connection() const { return m_connection; }
122
123 QByteArray wmClass() const;
124
125 #if QT_CONFIG(xcb_sm)
126 QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override;
127 #endif
128
129 void sync() override;
130
131 void beep() const override;
132
133 bool nativePaintingEnabled() const;
134
135 #if QT_CONFIG(vulkan)
136 QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
137 #endif
138
139 static QXcbIntegration *instance() { return m_instance; }
140
141 private:
142 QXcbConnection *m_connection = nullptr;
143
144 QScopedPointer<QPlatformFontDatabase> m_fontDatabase;
145 QScopedPointer<QXcbNativeInterface> m_nativeInterface;
146
147 QScopedPointer<QPlatformInputContext> m_inputContext;
148
149 #ifndef QT_NO_ACCESSIBILITY
150 mutable QScopedPointer<QPlatformAccessibility> m_accessibility;
151 #endif
152
153 QScopedPointer<QPlatformServices> m_services;
154
155 mutable QByteArray m_wmClass;
156 const char *m_instanceName;
157 bool m_canGrab;
158 xcb_visualid_t m_defaultVisualId;
159
160 static QXcbIntegration *m_instance;
161 };
162
163 QT_END_NAMESPACE
164
165 #endif