Qt 6.x
The Qt SDK
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
4#ifndef QXCBINTEGRATION_H
5#define QXCBINTEGRATION_H
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;
21
23#ifndef QT_NO_OPENGL
24# if QT_CONFIG(xcb_glx_plugin)
25 , public QNativeInterface::Private::QGLXIntegration
26# endif
27# if QT_CONFIG(egl)
28 , public QNativeInterface::Private::QEGLIntegration
29# endif
30#endif
31{
32public:
33 QXcbIntegration(const QStringList &parameters, int &argc, char **argv);
35
38 QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override;
39#ifndef QT_NO_OPENGL
41# if QT_CONFIG(xcb_glx_plugin)
42 QOpenGLContext *createOpenGLContext(GLXContext context, void *visualInfo, QOpenGLContext *shareContext) const override;
43# endif
44# if QT_CONFIG(egl)
45 QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override;
46# endif
47#endif
49
51
52 bool hasCapability(Capability cap) const override;
54 void initialize() override;
55
56 void moveToScreen(QWindow *window, int screen);
57
58 QPlatformFontDatabase *fontDatabase() const override;
59
61
62#ifndef QT_NO_CLIPBOARD
63 QPlatformClipboard *clipboard() const override;
64#endif
65#if QT_CONFIG(draganddrop)
66 QPlatformDrag *drag() const override;
67#endif
68
69 QPlatformInputContext *inputContext() const override;
70
71#if QT_CONFIG(accessibility)
72 QPlatformAccessibility *accessibility() const override;
73#endif
74
75 QPlatformServices *services() const override;
76
77 Qt::KeyboardModifiers queryKeyboardModifiers() const override;
78 QList<int> possibleKeys(const QKeyEvent *e) 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)
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
111 QScopedPointer<QXcbNativeInterface> m_nativeInterface;
112
114
115#if QT_CONFIG(accessibility)
116 mutable QScopedPointer<QPlatformAccessibility> m_accessibility;
117#endif
118
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
130
131#endif
\inmodule QtCore
Definition qbytearray.h:57
The QKeyEvent class describes a key event.
Definition qevent.h:423
Definition qlist.h:74
\inmodule QtGui
\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.
virtual QPlatformPixmap * createPlatformPixmap(QPlatformPixmap::PixelType type) const
Factory function for QPlatformPixmap.
virtual QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const =0
Factory function for QPlatformBackingStore.
virtual QPlatformSessionManager * createPlatformSessionManager(const QString &id, const QString &key) const
virtual QStringList themeNames() const
virtual QVariant styleHint(StyleHint hint) const
virtual QAbstractEventDispatcher * createEventDispatcher() const =0
Factory function for the GUI event dispatcher.
virtual bool hasCapability(Capability cap) const
virtual void setApplicationBadge(qint64 number)
virtual QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const
Factory function for QPlatformOpenGLContext.
virtual QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const
Factory function for QOffscreenSurface.
virtual QPlatformWindow * createForeignWindow(QWindow *, WId) const
virtual QPlatformClipboard * clipboard() const
Accessor for the platform integration's clipboard.
virtual QPlatformInputContext * inputContext() const
Returns the platforms input context.
virtual Qt::KeyboardModifiers queryKeyboardModifiers() const
virtual QPlatformServices * services() const
virtual QPlatformNativeInterface * nativeInterface() const
virtual QPlatformFontDatabase * fontDatabase() const
Accessor for the platform integration's fontdatabase.
virtual QPlatformTheme * createPlatformTheme(const QString &name) const
virtual void beep() const
virtual void initialize()
Performs initialization steps that depend on having an event dispatcher available.
virtual QList< int > possibleKeys(const QKeyEvent *) const
Should be used to obtain a list of possible shortcuts for the given key event.
virtual QPlatformWindow * createPlatformWindow(QWindow *window) const =0
Factory function for QPlatformWindow.
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 QPlatformPixmap class provides an abstraction for native pixmaps.
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
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qvariant.h:64
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
\inmodule QtGui
Definition qwindow.h:63
bool hasConnection() const
static QXcbIntegration * instance()
QXcbConnection * connection() const
double e
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
static void * context
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
GLuint64 key
GLenum type
GLuint name
GLenum cap
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QScreen * screen
[1]
Definition main.cpp:29
long long qint64
Definition qtypes.h:55
#define Q_XCB_EXPORT
Definition qxcbexport.h:14
aWidget window() -> setWindowTitle("New Window Title")
[2]