| 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 QXCBINTEGRATION_H |
| 6 |
#define QXCBINTEGRATION_H |
| 7 |
|
| 8 |
#include <qpa/qplatformintegration.h> |
| 9 |
#include <qpa/qplatformscreen.h> |
| 10 |
|
| 11 |
QT_BEGIN_NAMESPACE |
| 12 |
|
| 13 |
class QXcbConnection; |
| 14 |
class QAbstractEventDispatcher; |
| 15 |
class QXcbNativeInterface; |
| 16 |
class QXcbScreen; |
| 17 |
|
| 18 |
class QXcbIntegration : public QPlatformIntegration |
| 19 |
{ |
| 20 |
public: |
| 21 |
QXcbIntegration(const QStringList ¶meters, int &argc, char **argv); |
| 22 |
~QXcbIntegration(); |
| 23 |
|
| 24 |
QPlatformWindow *createPlatformWindow(QWindow *window) const; |
| 25 |
#ifndef QT_NO_OPENGL |
| 26 |
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; |
| 27 |
#endif |
| 28 |
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; |
| 29 |
|
| 30 |
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; |
| 31 |
|
| 32 |
bool hasCapability(Capability cap) const; |
| 33 |
QAbstractEventDispatcher *createEventDispatcher() const; |
| 34 |
void initialize(); |
| 35 |
|
| 36 |
void moveToScreen(QWindow *window, int screen); |
| 37 |
|
| 38 |
QPlatformFontDatabase *fontDatabase() const; |
| 39 |
|
| 40 |
QPlatformNativeInterface *nativeInterface()const; |
| 41 |
|
| 42 |
#ifndef QT_NO_CLIPBOARD |
| 43 |
QPlatformClipboard *clipboard() const; |
| 44 |
#endif |
| 45 |
#ifndef QT_NO_DRAGANDDROP |
| 46 |
QPlatformDrag *drag() const; |
| 47 |
#endif |
| 48 |
|
| 49 |
QPlatformInputContext *inputContext() const; |
| 50 |
|
| 51 |
#ifndef QT_NO_ACCESSIBILITY |
| 52 |
QPlatformAccessibility *accessibility() const; |
| 53 |
#endif |
| 54 |
|
| 55 |
QPlatformServices *services() const; |
| 56 |
|
| 57 |
Qt::KeyboardModifiers queryKeyboardModifiers() const; |
| 58 |
QList<int> possibleKeys(const QKeyEvent *e) const; |
| 59 |
|
| 60 |
QStringList themeNames() const; |
| 61 |
QPlatformTheme *createPlatformTheme(const QString &name) const; |
| 62 |
QVariant styleHint(StyleHint hint) const; |
| 63 |
|
| 64 |
QXcbConnection *defaultConnection() const { return m_connections.first(); } |
| 65 |
|
| 66 |
QByteArray wmClass() const; |
| 67 |
|
| 68 |
#if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) |
| 69 |
QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; |
| 70 |
#endif |
| 71 |
|
| 72 |
void sync(); |
| 73 |
private: |
| 74 |
QList<QXcbConnection *> m_connections; |
| 75 |
|
| 76 |
QScopedPointer<QPlatformFontDatabase> m_fontDatabase; |
| 77 |
QScopedPointer<QXcbNativeInterface> m_nativeInterface; |
| 78 |
|
| 79 |
QScopedPointer<QPlatformInputContext> m_inputContext; |
| 80 |
|
| 81 |
#ifndef QT_NO_ACCESSIBILITY |
| 82 |
mutable QScopedPointer<QPlatformAccessibility> m_accessibility; |
| 83 |
#endif |
| 84 |
|
| 85 |
QScopedPointer<QPlatformServices> m_services; |
| 86 |
|
| 87 |
friend class QXcbConnection; // access QPlatformIntegration::screenAdded() |
| 88 |
|
| 89 |
mutable QByteArray m_wmClass; |
| 90 |
const char *m_instanceName; |
| 91 |
bool m_canGrab; |
| 92 |
}; |
| 93 |
|
| 94 |
QT_END_NAMESPACE |
| 95 |
|
| 96 |
#endif |