| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef QWAYLANDNATIVEINTERFACE_H |
| 6 |
#define QWAYLANDNATIVEINTERFACE_H |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#include <QVariantMap> |
| 20 |
#include <qpa/qplatformnativeinterface.h> |
| 21 |
|
| 22 |
#include <QtWaylandClient/qtwaylandclientglobal.h> |
| 23 |
|
| 24 |
QT_BEGIN_NAMESPACE |
| 25 |
|
| 26 |
namespace QtWaylandClient { |
| 27 |
|
| 28 |
class QWaylandIntegration; |
| 29 |
class QWaylandScreen; |
| 30 |
|
| 31 |
class Q_WAYLAND_CLIENT_EXPORT QWaylandNativeInterface : public QPlatformNativeInterface |
| 32 |
{ |
| 33 |
public: |
| 34 |
QWaylandNativeInterface(QWaylandIntegration *integration); |
| 35 |
void *nativeResourceForIntegration(const QByteArray &resource) override; |
| 36 |
void *nativeResourceForWindow(const QByteArray &resourceString, |
| 37 |
QWindow *window) override; |
| 38 |
void *nativeResourceForScreen(const QByteArray &resourceString, |
| 39 |
QScreen *screen) override; |
| 40 |
#if QT_CONFIG(opengl) |
| 41 |
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override; |
| 42 |
#endif |
| 43 |
QVariantMap windowProperties(QPlatformWindow *window) const override; |
| 44 |
QVariant windowProperty(QPlatformWindow *window, const QString &name) const override; |
| 45 |
QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const override; |
| 46 |
void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) override; |
| 47 |
|
| 48 |
void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name); |
| 49 |
|
| 50 |
QFunctionPointer platformFunction(const QByteArray &resource) const override; |
| 51 |
|
| 52 |
private: |
| 53 |
QWaylandIntegration *m_integration = nullptr; |
| 54 |
QHash<QPlatformWindow*, QVariantMap> m_windowProperties; |
| 55 |
|
| 56 |
static void setSync(QWindow *window); |
| 57 |
static void setDeSync(QWindow *window); |
| 58 |
static bool isSync(QWindow *window); |
| 59 |
}; |
| 60 |
|
| 61 |
} |
| 62 |
|
| 63 |
QT_END_NAMESPACE |
| 64 |
|
| 65 |
#endif |