diff options
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquickitem.h')
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h index 07b6a40a4..5c89d58b4 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.h +++ b/src/compositor/compositor_api/qwaylandquickitem.h @@ -51,14 +51,13 @@ Q_DECLARE_METATYPE(QWaylandQuickSurface*) QT_BEGIN_NAMESPACE -class QWaylandInputDevice; +class QWaylandSeat; class QWaylandQuickItemPrivate; class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickItem : public QQuickItem { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandQuickItem) - Q_PROPERTY(QWaylandView *view READ view CONSTANT) Q_PROPERTY(QWaylandCompositor *compositor READ compositor) Q_PROPERTY(QWaylandSurface *surface READ surface WRITE setSurface NOTIFY surfaceChanged) Q_PROPERTY(bool paintEnabled READ paintEnabled WRITE setPaintEnabled) @@ -68,6 +67,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickItem : public QQuickItem Q_PROPERTY(bool focusOnClick READ focusOnClick WRITE setFocusOnClick NOTIFY focusOnClickChanged) Q_PROPERTY(bool sizeFollowsSurface READ sizeFollowsSurface WRITE setSizeFollowsSurface NOTIFY sizeFollowsSurfaceChanged) Q_PROPERTY(QObject *subsurfaceHandler READ subsurfaceHandler WRITE setSubsurfaceHandler NOTIFY subsurfaceHandlerChanged) + Q_PROPERTY(QWaylandOutput *output READ output WRITE setOutput NOTIFY outputChanged) + Q_PROPERTY(bool bufferLocked READ isBufferLocked WRITE setBufferLocked NOTIFY bufferLockedChanged) + Q_PROPERTY(bool allowDiscardFrontBuffer READ allowDiscardFrontBuffer WRITE setAllowDiscardFrontBuffer NOTIFY allowDiscardFrontBufferChanged) public: QWaylandQuickItem(QQuickItem *parent = nullptr); ~QWaylandQuickItem(); @@ -95,6 +97,7 @@ public: void setFocusOnClick(bool focus); bool inputRegionContains(const QPointF &localPosition); + Q_INVOKABLE QPointF mapToSurface(const QPointF &point) const; bool sizeFollowsSurface() const; void setSizeFollowsSurface(bool sizeFollowsSurface); @@ -107,6 +110,15 @@ public: QObject *subsurfaceHandler() const; void setSubsurfaceHandler(QObject*); + QWaylandOutput *output() const; + void setOutput(QWaylandOutput *output); + + bool isBufferLocked() const; + void setBufferLocked(bool locked); + + bool allowDiscardFrontBuffer() const; + void setAllowDiscardFrontBuffer(bool discard); + protected: void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; @@ -128,7 +140,7 @@ protected: virtual void surfaceChangedEvent(QWaylandSurface *newSurface, QWaylandSurface *oldSurface); public Q_SLOTS: - virtual void takeFocus(QWaylandInputDevice *device = nullptr); + virtual void takeFocus(QWaylandSeat *device = nullptr); void setPaintEnabled(bool paintEnabled); void raise(); void lower(); @@ -143,6 +155,7 @@ private Q_SLOTS: void beforeSync(); void handleSubsurfaceAdded(QWaylandSurface *childSurface); void handleSubsurfacePosition(const QPoint &pos); + void handleDragStarted(QWaylandDrag *drag); #ifndef QT_NO_IM void updateInputMethod(Qt::InputMethodQueries queries); #endif @@ -158,6 +171,9 @@ Q_SIGNALS: void mouseRelease(); void sizeFollowsSurfaceChanged(); void subsurfaceHandlerChanged(); + void outputChanged(); + void bufferLockedChanged(); + void allowDiscardFrontBufferChanged(); protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) Q_DECL_OVERRIDE; |