Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 QPlatformKeyMapper *keyMapper() const override;
78
79 QStringList themeNames() const override;
80 QPlatformTheme *createPlatformTheme(const QString &name) const override;
81 QVariant styleHint(StyleHint hint) const override;
82
83 bool hasConnection() const { return m_connection; }
84 QXcbConnection *connection() const { return m_connection; }
85
86 QByteArray wmClass() const;
87
88#if QT_CONFIG(xcb_sm)
90#endif
91
92 void sync() override;
93
94 void beep() const override;
95
96 bool nativePaintingEnabled() const;
97
98#if QT_CONFIG(vulkan)
99 QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
100#endif
101
102 static QXcbIntegration *instance() { return m_instance; }
103
104 void setApplicationBadge(qint64 number) override;
105
106private:
107 QXcbConnection *m_connection = nullptr;
108
109 QScopedPointer<QPlatformFontDatabase> m_fontDatabase;
110 QScopedPointer<QXcbNativeInterface> m_nativeInterface;
111
112 QScopedPointer<QPlatformInputContext> m_inputContext;
113
114#if QT_CONFIG(accessibility)
115 mutable QScopedPointer<QPlatformAccessibility> m_accessibility;
116#endif
117
118 QScopedPointer<QPlatformServices> m_services;
119
120 mutable QByteArray m_wmClass;
121 const char *m_instanceName;
122 bool m_canGrab;
123 xcb_visualid_t m_defaultVisualId;
124
125 static QXcbIntegration *m_instance;
126};
127
129
130#endif
\inmodule QtCore
Definition qbytearray.h:57
\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 QPlatformKeyMapper * keyMapper() const
Accessor for the platform integration's key mapper.
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 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
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
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
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:60
#define Q_XCB_EXPORT
Definition qxcbexport.h:14
aWidget window() -> setWindowTitle("New Window Title")
[2]