29 Q_DECLARE_PRIVATE(QWaylandQuickItem)
30 Q_PROPERTY(QWaylandCompositor *compositor READ compositor NOTIFY compositorChanged)
31 Q_PROPERTY(QWaylandSurface *surface READ surface WRITE setSurface NOTIFY surfaceChanged)
32 Q_PROPERTY(
bool paintEnabled READ isPaintEnabled WRITE setPaintEnabled NOTIFY paintEnabledChanged)
33 Q_PROPERTY(
bool touchEventsEnabled READ touchEventsEnabled WRITE setTouchEventsEnabled NOTIFY touchEventsEnabledChanged)
34 Q_PROPERTY(QWaylandSurface::Origin origin READ origin NOTIFY originChanged)
35 Q_PROPERTY(
bool inputEventsEnabled READ inputEventsEnabled WRITE setInputEventsEnabled NOTIFY inputEventsEnabledChanged)
36 Q_PROPERTY(
bool focusOnClick READ focusOnClick WRITE setFocusOnClick NOTIFY focusOnClickChanged)
37 Q_PROPERTY(QObject *subsurfaceHandler READ subsurfaceHandler WRITE setSubsurfaceHandler NOTIFY subsurfaceHandlerChanged)
38 Q_PROPERTY(QWaylandOutput *output READ output WRITE setOutput NOTIFY outputChanged)
39 Q_PROPERTY(
bool bufferLocked READ isBufferLocked WRITE setBufferLocked NOTIFY bufferLockedChanged)
40 Q_PROPERTY(
bool allowDiscardFrontBuffer READ allowDiscardFrontBuffer WRITE setAllowDiscardFrontBuffer NOTIFY allowDiscardFrontBufferChanged)
41 Q_MOC_INCLUDE(
"qwaylandcompositor.h")
42 Q_MOC_INCLUDE(
"qwaylandseat.h")
43 Q_MOC_INCLUDE(
"qwaylanddrag.h")
44 QML_NAMED_ELEMENT(WaylandQuickItem)
45 QML_ADDED_IN_VERSION(1, 0)
47 QWaylandQuickItem(QQuickItem *parent =
nullptr);
48 ~QWaylandQuickItem() override;
50 QWaylandCompositor *compositor()
const;
51 QWaylandView *view()
const;
53 QWaylandSurface *surface()
const;
54 void setSurface(QWaylandSurface *surface);
56 QWaylandSurface::Origin origin()
const;
58 bool isTextureProvider()
const override;
59 QSGTextureProvider *textureProvider()
const override;
61 bool isPaintEnabled()
const;
62 bool touchEventsEnabled()
const;
64 void setTouchEventsEnabled(
bool enabled);
66 bool inputEventsEnabled()
const;
67 void setInputEventsEnabled(
bool enabled);
69 bool focusOnClick()
const;
70 void setFocusOnClick(
bool focus);
72 bool inputRegionContains(
const QPointF &localPosition)
const;
73 Q_INVOKABLE QPointF mapToSurface(
const QPointF &point)
const;
74 Q_REVISION(1, 13) Q_INVOKABLE QPointF mapFromSurface(
const QPointF &point)
const;
77 QVariant inputMethodQuery(Qt::InputMethodQuery query)
const override;
78 Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument)
const;
81 QObject *subsurfaceHandler()
const;
82 void setSubsurfaceHandler(QObject*);
84 QWaylandOutput *output()
const;
85 void setOutput(QWaylandOutput *output);
87 bool isBufferLocked()
const;
88 void setBufferLocked(
bool locked);
90 bool allowDiscardFrontBuffer()
const;
91 void setAllowDiscardFrontBuffer(
bool discard);
93 Q_INVOKABLE
void setPrimary();
96 void mousePressEvent(QMouseEvent *event) override;
97 void mouseMoveEvent(QMouseEvent *event) override;
98 void mouseReleaseEvent(QMouseEvent *event) override;
99 void hoverEnterEvent(QHoverEvent *event) override;
100 void hoverMoveEvent(QHoverEvent *event) override;
101 void hoverLeaveEvent(QHoverEvent *event) override;
102#if QT_CONFIG(wheelevent)
103 void wheelEvent(QWheelEvent *event) override;
106 void keyPressEvent(QKeyEvent *event) override;
107 void keyReleaseEvent(QKeyEvent *event) override;
109 void touchEvent(QTouchEvent *event) override;
110 void touchUngrabEvent() override;
113 void inputMethodEvent(QInputMethodEvent *event) override;
116 virtual void surfaceChangedEvent(QWaylandSurface *newSurface, QWaylandSurface *oldSurface);
118 virtual void takeFocus(QWaylandSeat *device =
nullptr);
119 void setPaintEnabled(
bool paintEnabled);
122 void sendMouseMoveEvent(
const QPointF &position, QWaylandSeat *seat =
nullptr);
124#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
126 void surfaceMappedChanged();
130 void handleSurfaceChanged();
131 void handleBufferLockedChanged();
132 void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent);
134 void updateBuffer(
bool hasBuffer);
138 void handleSubsurfaceAdded(QWaylandSurface *childSurface);
139 void handleSubsurfacePosition(
const QPoint &pos);
140 void handlePlaceAbove(QWaylandSurface *referenceSurface);
141 void handlePlaceBelow(QWaylandSurface *referenceSurface);
142#if QT_CONFIG(draganddrop)
143 void handleDragStarted(QWaylandDrag *drag);
146 void updateInputMethod(Qt::InputMethodQueries queries);
151 void surfaceChanged();
152 void compositorChanged();
153 void paintEnabledChanged();
154 void touchEventsEnabledChanged();
155 void originChanged();
156 void surfaceDestroyed();
157 void inputEventsEnabledChanged();
158 void focusOnClickChanged();
159 void mouseMove(
const QPointF &windowPosition);
161 void subsurfaceHandlerChanged();
162 void outputChanged();
163 void bufferLockedChanged();
164 void allowDiscardFrontBufferChanged();
166 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override;
168 QWaylandQuickItem(QWaylandQuickItemPrivate &dd, QQuickItem *parent =
nullptr);