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
qwaylandnativeinterface_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QWAYLANDNATIVEINTERFACE_P_H
5#define QWAYLANDNATIVEINTERFACE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QVariantMap>
19#include <qpa/qplatformnativeinterface.h>
20
21#include <QtWaylandClient/qtwaylandclientglobal.h>
22#include <QtCore/private/qglobal_p.h>
23#include <QtCore/qhash.h>
24#include <QtGui/qguiapplication_platform.h>
25
27
28class QMargins;
29
30namespace QtWaylandClient {
31
32class QWaylandIntegration;
33class QWaylandScreen;
34
35class Q_WAYLANDCLIENT_EXPORT QWaylandNativeInterface : public QPlatformNativeInterface,
36 public QNativeInterface::QWaylandApplication
37{
38public:
40 void *nativeResourceForIntegration(const QByteArray &resource) override;
41 void *nativeResourceForWindow(const QByteArray &resourceString,
42 QWindow *window) override;
43 void *nativeResourceForScreen(const QByteArray &resourceString,
44 QScreen *screen) override;
45#if QT_CONFIG(opengl)
46 void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override;
47#endif
48 NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource) override;
49 QVariantMap windowProperties(QPlatformWindow *window) const override;
50 QVariant windowProperty(QPlatformWindow *window, const QString &name) const override;
51 QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const override;
52 void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) override;
53
54 void emitWindowPropertyChanged(QPlatformWindow *window, const QString &name);
55
56 // QWaylandApplication interface
57 wl_display *display() const override;
58 wl_compositor *compositor() const override;
59 wl_seat *seat() const override;
60 wl_keyboard *keyboard() const override;
61 wl_pointer *pointer() const override;
62 wl_touch *touch() const override;
63 uint lastInputSerial() const override;
64 wl_seat *lastInputSeat() const override;
65
66private:
67 static void setWindowMargins(QWindow *window, const QMargins &margins);
68
69 QWaylandIntegration *m_integration = nullptr;
70 QHash<QPlatformWindow*, QVariantMap> m_windowProperties;
71};
72
73}
74
76
77#endif // QWAYLANDNATIVEINTERFACE_P_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qmargins.h:24
\inmodule QtGui
The QPlatformNativeInterface class provides an abstraction for retrieving native resource handles.
The QPlatformWindow class provides an abstraction for top-level windows.
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 QtCore
Definition qvariant.h:65
\inmodule QtGui
Definition qwindow.h:63
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
static void * context
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QOpenGLCompositor * compositor
GLuint name
GLsizei const void * pointer
Definition qopenglext.h:384
QScreen * screen
[1]
Definition main.cpp:29
unsigned int uint
Definition qtypes.h:34
aWidget window() -> setWindowTitle("New Window Title")
[2]