Debian Codegraph @

xcb/libqt5xcbqpa-dev/5.4.1/qxcbnativeinterface.h

raw
1 // Copyright (C) 2016 The Qt Company Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5 #ifndef QXCBNATIVEINTERFACE_H
6 #define QXCBNATIVEINTERFACE_H
7
8 #include <qpa/qplatformnativeinterface.h>
9 #include <xcb/xcb.h>
10
11 #include <QtCore/QRect>
12
13 QT_BEGIN_NAMESPACE
14
15 class QWidget;
16 class QXcbScreen;
17 class QXcbConnection;
18
19 class QXcbNativeInterface : public QPlatformNativeInterface
20 {
21 Q_OBJECT
22 public:
23 enum ResourceType {
24 Display,
25 EglDisplay,
26 Connection,
27 Screen,
28 EglContext,
29 EglConfig,
30 GLXConfig,
31 GLXContext,
32 AppTime,
33 AppUserTime,
34 ScreenHintStyle,
35 StartupId,
36 TrayWindow,
37 GetTimestamp,
38 X11Screen,
39 RootWindow,
40 ScreenSubpixelType,
41 ScreenAntialiasingEnabled,
42 NoFontHinting
43 };
44
45 QXcbNativeInterface();
46
47 void *nativeResourceForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE;
48 void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE;
49 void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) Q_DECL_OVERRIDE;
50 void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE;
51
52 NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE;
53 NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE;
54 NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE;
55
56 QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE;
57
58 inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; }
59
60 void *displayForWindow(QWindow *window);
61 void *eglDisplayForWindow(QWindow *window);
62 void *connectionForWindow(QWindow *window);
63 void *screenForWindow(QWindow *window);
64 void *appTime(const QXcbScreen *screen);
65 void *appUserTime(const QXcbScreen *screen);
66 void *getTimestamp(const QXcbScreen *screen);
67 void *startupId();
68 void *x11Screen();
69 void *rootWindow();
70 static void setStartupId(const char *);
71 static void setAppTime(QScreen *screen, xcb_timestamp_t time);
72 static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);
73 static void *eglContextForContext(QOpenGLContext *context);
74 static void *eglConfigForContext(QOpenGLContext *context);
75 static void *glxContextForContext(QOpenGLContext *context);
76 static void *glxConfigForContext(QOpenGLContext *context);
77
78 Q_INVOKABLE void beep();
79 Q_INVOKABLE bool systemTrayAvailable(const QScreen *screen) const;
80 Q_INVOKABLE void clearRegion(const QWindow *qwindow, const QRect& rect);
81 Q_INVOKABLE bool systrayVisualHasAlphaChannel();
82 Q_INVOKABLE bool requestSystemTrayWindowDock(const QWindow *window);
83 Q_INVOKABLE QRect systemTrayWindowGlobalGeometry(const QWindow *window);
84
85 signals:
86 void systemTrayWindowChanged(QScreen *screen);
87
88 private:
89 xcb_window_t locateSystemTray(xcb_connection_t *conn, const QXcbScreen *screen);
90
91 const QByteArray m_genericEventFilterType;
92
93 xcb_atom_t m_sysTraySelectionAtom;
94 xcb_visualid_t m_systrayVisualId;
95
96 static QXcbScreen *qPlatformScreenForWindow(QWindow *window);
97 };
98
99 QT_END_NAMESPACE
100
101 #endif // QXCBNATIVEINTERFACE_H