Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qxcbintegration.h
Go to the documentation of this file.
1// Copyright (C) 2016 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// Qt-Security score:significant reason:default
4
5#pragma once
6
7#include <QtGui/private/qtguiglobal_p.h>
8#include <qpa/qplatformintegration.h>
9#include <qpa/qplatformscreen.h>
10#include <qpa/qplatformopenglcontext.h>
11
12#include "qxcbexport.h"
13
14#include <xcb/xcb.h>
15
17
18class QXcbConnection;
19class QAbstractEventDispatcher;
20class QXcbNativeInterface;
22
23class Q_XCB_EXPORT QXcbIntegration : public QPlatformIntegration
24#ifndef QT_NO_OPENGL
25# if QT_CONFIG(xcb_glx_plugin)
26 , public QNativeInterface::Private::QGLXIntegration
27# endif
28# if QT_CONFIG(egl)
29 , public QNativeInterface::Private::QEGLIntegration
30# endif
31#endif
32{
33public:
34 QXcbIntegration(const QStringList &parameters, int &argc, char **argv);
35 ~QXcbIntegration();
36
37 QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override;
38 QPlatformWindow *createPlatformWindow(QWindow *window) const override;
39 QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override;
40#ifndef QT_NO_OPENGL
41 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
42# if QT_CONFIG(xcb_glx_plugin)
43 QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override;
44# endif
45# if QT_CONFIG(egl)
46 QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override;
47# endif
48#endif
49 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
50
51 QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
52
53 bool hasCapability(Capability cap) const override;
54 QAbstractEventDispatcher *createEventDispatcher() const override;
55 void initialize() override;
56
57 void moveToScreen(QWindow *window, int screen);
58
59 QPlatformFontDatabase *fontDatabase() const override;
60
61 QPlatformNativeInterface *nativeInterface()const override;
62
63#ifndef QT_NO_CLIPBOARD
64 QPlatformClipboard *clipboard() const override;
65#endif
66#if QT_CONFIG(draganddrop)
67 QPlatformDrag *drag() const override;
68#endif
69
70 QPlatformInputContext *inputContext() const override;
71
72#if QT_CONFIG(accessibility)
73 QPlatformAccessibility *accessibility() const override;
74#endif
75
76 QPlatformServices *services() const override;
77
78 QPlatformKeyMapper *keyMapper() const override;
79
80 QStringList themeNames() const override;
81 QPlatformTheme *createPlatformTheme(const QString &name) const override;
82 QVariant styleHint(StyleHint hint) const override;
83
84 bool hasConnection() const { return m_connection; }
85 QXcbConnection *connection() const { return m_connection; }
86
87 QByteArray wmClass() const;
88
89#if QT_CONFIG(xcb_sm)
90 QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override;
91#endif
92
93 void sync() override;
94
95 void beep() const override;
96
97 bool nativePaintingEnabled() const;
98
99#if QT_CONFIG(vulkan)
100 QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
101#endif
102
103 static QXcbIntegration *instance() { return m_instance; }
104
105 void setApplicationBadge(qint64 number) override;
106
107private:
108 QXcbConnection *m_connection = nullptr;
109
110 QScopedPointer<QPlatformFontDatabase> m_fontDatabase;
111 QScopedPointer<QXcbNativeInterface> m_nativeInterface;
112
113 QScopedPointer<QPlatformInputContext> m_inputContext;
114
115#if QT_CONFIG(accessibility)
116 mutable QScopedPointer<QPlatformAccessibility> m_accessibility;
117#endif
118
119 QScopedPointer<QXcbUnixServices> m_services;
120
121 mutable QByteArray m_wmClass;
122 const char *m_instanceName;
123 bool m_canGrab;
124 xcb_visualid_t m_defaultVisualId;
125
126 static QXcbIntegration *m_instance;
127};
128
129QT_END_NAMESPACE
QPlatformNativeInterface::NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) const override
QXcbEglNativeInterfaceHandler(QXcbNativeInterface *nativeInterface)
QPlatformNativeInterface::NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) const override
QPlatformNativeInterface::NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) const override
static QT_BEGIN_NAMESPACE int resourceType(const QByteArray &key)
#define Q_XCB_EXPORT
Definition qxcbexport.h:14