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
qxcbnativeinterface.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 QXCBNATIVEINTERFACE_H
5#define QXCBNATIVEINTERFACE_H
6
7#include <qpa/qplatformnativeinterface.h>
8#include <xcb/xcb.h>
9
10#include <QtCore/QRect>
11
12#include <QtGui/qguiapplication.h>
13
14#include "qxcbexport.h"
15#include "qxcbconnection.h"
16
18
19class QXcbScreen;
21
23 , public QNativeInterface::QX11Application
24{
26public:
48
50
51 void *nativeResourceForIntegration(const QByteArray &resource) override;
52 void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override;
53 void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override;
54 void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override;
55 void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) override;
56#ifndef QT_NO_CURSOR
57 void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override;
58#endif
59
60 NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override;
61 NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override;
62 NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) override;
63 NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override;
64 NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource) override;
65
66 QFunctionPointer platformFunction(const QByteArray &function) const override;
67
68 inline const QByteArray &nativeEventType() const { return m_nativeEventType; }
69
70 void *displayForWindow(QWindow *window);
71 void *connectionForWindow(QWindow *window);
72 void *screenForWindow(QWindow *window);
73 void *appTime(const QXcbScreen *screen);
74 void *appUserTime(const QXcbScreen *screen);
75 void *getTimestamp(const QXcbScreen *screen);
76 void *startupId();
77 void *x11Screen();
78 void *rootWindow();
79
80 Display *display() const override;
81 xcb_connection_t *connection() const override;
82
83 void *atspiBus();
84 static void setStartupId(const char *);
85 static void setAppTime(QScreen *screen, xcb_timestamp_t time);
86 static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);
87
88 static qint32 generatePeekerId();
89 static bool removePeekerId(qint32 peekerId);
90 static bool peekEventQueue(QXcbEventQueue::PeekerCallback peeker, void *peekerData = nullptr,
91 QXcbEventQueue::PeekOptions option = QXcbEventQueue::PeekDefault,
92 qint32 peekerId = -1);
93
94 Q_INVOKABLE QString dumpConnectionNativeWindows(const QXcbConnection *connection, WId root) const;
95 Q_INVOKABLE QString dumpNativeWindows(WId root = 0) const;
96
97 void addHandler(QXcbNativeInterfaceHandler *handler);
98 void removeHandler(QXcbNativeInterfaceHandler *handler);
101
102private:
103 const QByteArray m_nativeEventType = QByteArrayLiteral("xcb_generic_event_t");
104
105 static QXcbScreen *qPlatformScreenForWindow(QWindow *window);
106
107 QList<QXcbNativeInterfaceHandler *> m_handlers;
108 NativeResourceForIntegrationFunction handlerNativeResourceFunctionForIntegration(const QByteArray &resource) const;
109 NativeResourceForContextFunction handlerNativeResourceFunctionForContext(const QByteArray &resource) const;
110 NativeResourceForScreenFunction handlerNativeResourceFunctionForScreen(const QByteArray &resource) const;
111 NativeResourceForWindowFunction handlerNativeResourceFunctionForWindow(const QByteArray &resource) const;
112 NativeResourceForBackingStoreFunction handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const;
113 QFunctionPointer handlerPlatformFunction(const QByteArray &function) const;
114 void *handlerNativeResourceForIntegration(const QByteArray &resource) const;
115 void *handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const;
116 void *handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const;
117 void *handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const;
118 void *handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const;
119};
120
122
123#endif // QXCBNATIVEINTERFACE_H
The QBackingStore class provides a drawing area for QWindow.
\inmodule QtCore
Definition qbytearray.h:57
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition qcursor.h:45
\inmodule QtGui
The QPlatformNativeInterface class provides an abstraction for retrieving native resource handles.
virtual NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource)
virtual void * nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
virtual void * nativeResourceForWindow(const QByteArray &resource, QWindow *window)
virtual NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource)
virtual void * nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore)
virtual NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource)
virtual void * nativeResourceForScreen(const QByteArray &resource, QScreen *screen)
virtual QFunctionPointer platformFunction(const QByteArray &function) const
virtual void * nativeResourceForIntegration(const QByteArray &resource)
virtual NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource)
virtual void * nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor)
virtual NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource)
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtGui
Definition qwindow.h:63
bool(*)(xcb_generic_event_t *event, void *peekerData) PeekerCallback
void systemTrayWindowChanged(QScreen *screen)
const QByteArray & nativeEventType() const
QCursor cursor
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
static void * context
#define QByteArrayLiteral(str)
Definition qbytearray.h:52
DBusConnection * connection
GLuint GLenum option
QScreen * screen
[1]
Definition main.cpp:29
#define Q_OBJECT
#define Q_INVOKABLE
#define signals
struct _XDisplay Display
int qint32
Definition qtypes.h:49
#define Q_XCB_EXPORT
Definition qxcbexport.h:14
aWidget window() -> setWindowTitle("New Window Title")
[2]