diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-12-09 14:38:30 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2016-02-04 12:08:58 +0000 |
commit | 933d69af3061e9fdfe9e9ca1ea61055aac2c0482 (patch) | |
tree | 0fccef825cf65421816d7a4104c01bd735b87495 /src/compositor/compositor_api/qwaylandsurface_p.h | |
parent | 93ca929fb9caf34715012dec608afd42e6ccf1e5 (diff) |
Subsurface implementation, with C++ API
This adds support for subsurfaces to QWaylandCompositor and
QWaylandSurface.
Task-number: QTBUG-49809
Change-Id: I2fa9ee4dcd1f48a2a28dab536f9cd6edc716e42b
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandsurface_p.h')
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface_p.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface_p.h b/src/compositor/compositor_api/qwaylandsurface_p.h index 1f3676bd9..de71b7fe3 100644 --- a/src/compositor/compositor_api/qwaylandsurface_p.h +++ b/src/compositor/compositor_api/qwaylandsurface_p.h @@ -112,6 +112,11 @@ public: static void removeUninitializedSurface(QWaylandSurfacePrivate *surface); static bool hasUninitializedSurface(); #endif + + void initSubsurface(QWaylandSurface *parent, struct ::wl_client *client, int id, int version); + bool isSubsurface() const { return subsurface; } + QWaylandSurfacePrivate *parentSurface() const { return subsurface ? subsurface->parentSurface : nullptr; } + protected: void surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; @@ -170,6 +175,28 @@ protected: //member variables Qt::ScreenOrientation contentOrientation; QWindow::Visibility visibility; + class Subsurface : public QtWaylandServer::wl_subsurface + { + public: + Subsurface(QWaylandSurfacePrivate *s) : surface(s) {} + QWaylandSurfacePrivate *surfaceFromResource(); + + protected: + void subsurface_set_position(wl_subsurface::Resource *resource, int32_t x, int32_t y); + void subsurface_place_above(wl_subsurface::Resource *resource, struct wl_resource *sibling); + void subsurface_place_below(wl_subsurface::Resource *resource, struct wl_resource *sibling); + void subsurface_set_sync(wl_subsurface::Resource *resource); + void subsurface_set_desync(wl_subsurface::Resource *resource); + + private: + friend class QWaylandSurfacePrivate; + QWaylandSurfacePrivate *surface; + QWaylandSurfacePrivate *parentSurface; + QPoint position; + }; + + Subsurface *subsurface; + #ifndef QT_NO_DEBUG static QList<QWaylandSurfacePrivate *> uninitializedSurfaces; #endif |