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
qwaylandsurface.h
Go to the documentation of this file.
1// Copyright (C) 2017-2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// Copyright (C) 2017 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QWAYLANDSURFACE_H
6#define QWAYLANDSURFACE_H
7
8#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
9#include <QtWaylandCompositor/qwaylandcompositor.h>
10#include <QtWaylandCompositor/qwaylandcompositorextension.h>
11#include <QtWaylandCompositor/qwaylandclient.h>
12#include <QtWaylandCompositor/qwaylanddrag.h>
13
14#include <QtCore/QScopedPointer>
15#include <QtGui/QImage>
16#include <QtGui/QWindow>
17#include <QtCore/QVariantMap>
18
19struct wl_client;
20struct wl_resource;
21
23
24class QTouchEvent;
27class QWaylandView;
29
31{
32public:
33 QWaylandSurfaceRole(const QByteArray &n) : m_name(n) {}
34
35 const QByteArray name() { return m_name; }
36
37private:
38 QByteArray m_name;
39};
40
41class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandSurface : public QWaylandObject
42{
44 Q_DECLARE_PRIVATE(QWaylandSurface)
45 Q_PROPERTY(QWaylandClient *client READ client CONSTANT)
46 Q_PROPERTY(QRectF sourceGeometry READ sourceGeometry NOTIFY sourceGeometryChanged REVISION(1, 13))
47 Q_PROPERTY(QSize destinationSize READ destinationSize NOTIFY destinationSizeChanged REVISION(1, 13))
48 Q_PROPERTY(QSize bufferSize READ bufferSize NOTIFY bufferSizeChanged REVISION(1, 13))
49 Q_PROPERTY(int bufferScale READ bufferScale NOTIFY bufferScaleChanged)
50 Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation NOTIFY contentOrientationChanged)
51 Q_PROPERTY(QWaylandSurface::Origin origin READ origin NOTIFY originChanged)
52 Q_PROPERTY(bool hasContent READ hasContent NOTIFY hasContentChanged)
53 Q_PROPERTY(bool cursorSurface READ isCursorSurface WRITE markAsCursorSurface NOTIFY cursorSurfaceChanged)
54 Q_PROPERTY(bool inhibitsIdle READ inhibitsIdle NOTIFY inhibitsIdleChanged REVISION(1, 14))
55 Q_PROPERTY(bool isOpaque READ isOpaque NOTIFY isOpaqueChanged REVISION(6, 4))
56 Q_MOC_INCLUDE("qwaylanddrag.h")
57 Q_MOC_INCLUDE("qwaylandcompositor.h")
58
59 QML_NAMED_ELEMENT(WaylandSurfaceBase)
61 QML_UNCREATABLE("Cannot create instance of WaylandSurfaceBase, use WaylandSurface instead")
62public:
63 enum Origin {
65 OriginBottomLeft
66 };
67 Q_ENUM(Origin)
68
71 ~QWaylandSurface() override;
72
74 bool isInitialized() const;
75
76 QWaylandClient *client() const;
77 ::wl_client *waylandClient() const;
78
79 bool setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode);
80 QWaylandSurfaceRole *role() const;
81
82 bool hasContent() const;
83
84 QRectF sourceGeometry() const;
85 QSize destinationSize() const;
86 QSize bufferSize() const;
87 int bufferScale() const;
88
89 Qt::ScreenOrientation contentOrientation() const;
90
91 Origin origin() const;
92
94
95 bool inputRegionContains(const QPoint &p) const;
96 bool inputRegionContains(const QPointF &position) const;
97
98 Q_INVOKABLE void destroy();
99 Q_INVOKABLE bool isDestroyed() const;
100
101 Q_INVOKABLE void frameStarted();
102 Q_INVOKABLE void sendFrameCallbacks();
103
104 QWaylandView *primaryView() const;
105 void setPrimaryView(QWaylandView *view);
106
107 QList<QWaylandView *> views() const;
108
109 static QWaylandSurface *fromResource(::wl_resource *resource);
110 struct wl_resource *resource() const;
111
112 void markAsCursorSurface(bool cursorSurface);
113 bool isCursorSurface() const;
114
115 bool inhibitsIdle() const;
116 bool isOpaque() const;
117
118#if QT_CONFIG(im)
119 QWaylandInputMethodControl *inputMethodControl() const;
120#endif
121
122public Q_SLOTS:
123#if QT_CONFIG(clipboard)
124 void updateSelection();
125#endif
126
127protected:
129
132 void damaged(const QRegion &rect);
133 void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent);
135 Q_REVISION(1, 13) void sourceGeometryChanged();
136 Q_REVISION(1, 13) void destinationSizeChanged();
137 Q_REVISION(1, 13) void bufferSizeChanged();
138 void bufferScaleChanged();
139 void offsetForNextFrame(const QPoint &offset);
140 void contentOrientationChanged();
141 void surfaceDestroyed();
142 void originChanged();
143 void subsurfacePositionChanged(const QPoint &position);
144 void subsurfacePlaceAbove(QWaylandSurface *sibling);
145 void subsurfacePlaceBelow(QWaylandSurface *sibling);
146 void dragStarted(QWaylandDrag *drag);
147 void cursorSurfaceChanged();
148 Q_REVISION(14) void inhibitsIdleChanged();
149 Q_REVISION(6, 4) void isOpaqueChanged();
150
151 void configure(bool hasBuffer);
152 void redraw();
153};
154
156
157#endif // QWAYLANDSURFACE_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:484
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtCore
Definition qsize.h:25
The QTouchEvent class contains parameters that describe a touch event.
Definition qevent.h:917
\inmodule QtWaylandCompositor
\qmltype WaylandClient \instantiates QWaylandClient \inqmlmodule QtWayland.Compositor
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\inmodule QtWaylandCompositor
\inmodule QtWaylandCompositor
QWaylandSurfaceRole(const QByteArray &n)
Creates a QWaylandSurfaceRole and assigns it name.
const QByteArray name()
Returns the name of the QWaylandSurfaceRole.
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent)
void childAdded(QWaylandSurface *child)
\qmlsignal QtWayland.Compositor::WaylandSurface::childAdded(WaylandSurface child)
void hasContentChanged()
Origin
This enum type is used to specify the origin of a QWaylandSurface's buffer.
Q_REVISION(1, 13) void sourceGeometryChanged()
void damaged(const QRegion &rect)
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
rect
[4]
Combined button and popup list for selecting options.
Definition qcompare.h:63
ScreenOrientation
Definition qnamespace.h:271
static bool initialize()
Definition qctf.cpp:94
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static QOpenGLCompositor * compositor
GLenum GLuint GLintptr offset
GLfloat n
GLfloat GLfloat GLfloat GLfloat h
GLfloat GLfloat p
[1]
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_INVOKABLE
#define Q_SLOTS
#define Q_MOC_INCLUDE(...)
#define Q_SIGNALS
unsigned int uint
Definition qtypes.h:34
QLayoutItem * child
[0]
QQuickView * view
[0]
view create()