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);
125 void surfaceMappedChanged();
126 void handleSurfaceChanged();
127 void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent);
129 void updateBuffer(
bool hasBuffer);
133 void handleSubsurfaceAdded(QWaylandSurface *childSurface);
134 void handleSubsurfacePosition(
const QPoint &pos);
135 void handlePlaceAbove(QWaylandSurface *referenceSurface);
136 void handlePlaceBelow(QWaylandSurface *referenceSurface);
137#if QT_CONFIG(draganddrop)
138 void handleDragStarted(QWaylandDrag *drag);
141 void updateInputMethod(Qt::InputMethodQueries queries);
146 void surfaceChanged();
147 void compositorChanged();
148 void paintEnabledChanged();
149 void touchEventsEnabledChanged();
150 void originChanged();
151 void surfaceDestroyed();
152 void inputEventsEnabledChanged();
153 void focusOnClickChanged();
154 void mouseMove(
const QPointF &windowPosition);
156 void subsurfaceHandlerChanged();
157 void outputChanged();
158 void bufferLockedChanged();
159 void allowDiscardFrontBufferChanged();
161 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override;
163 QWaylandQuickItem(QWaylandQuickItemPrivate &dd, QQuickItem *parent =
nullptr);