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.cpp | |
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.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 9391164cf..ed028824f 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -130,6 +130,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate() , mapped(false) , isInitialized(false) , contentOrientation(Qt::PrimaryOrientation) + , subsurface(0) { pending.buffer = 0; pending.newlyAttached = false; @@ -777,4 +778,50 @@ void QWaylandSurfacePrivate::derefView(QWaylandView *view) } } +void QWaylandSurfacePrivate::initSubsurface(QWaylandSurface *parent, wl_client *client, int id, int version) +{ + Q_Q(QWaylandSurface); + QWaylandSurface *oldParent = 0; // TODO: implement support for switching parents + + subsurface = new Subsurface(this); + subsurface->init(client, id, version); + subsurface->parentSurface = parent->d_func(); + emit q->parentChanged(parent, oldParent); + emit parent->childAdded(q); +} + +void QWaylandSurfacePrivate::Subsurface::subsurface_set_position(wl_subsurface::Resource *resource, int32_t x, int32_t y) +{ + Q_UNUSED(resource); + position = QPoint(x,y); + emit surface->q_func()->subsurfacePositionChanged(position); + +} + +void QWaylandSurfacePrivate::Subsurface::subsurface_place_above(wl_subsurface::Resource *resource, struct wl_resource *sibling) +{ + Q_UNUSED(resource); + emit surface->q_func()->subsurfacePlaceAbove(QWaylandSurface::fromResource(sibling)); +} + +void QWaylandSurfacePrivate::Subsurface::subsurface_place_below(wl_subsurface::Resource *resource, struct wl_resource *sibling) +{ + Q_UNUSED(resource); + emit surface->q_func()->subsurfacePlaceBelow(QWaylandSurface::fromResource(sibling)); +} + +void QWaylandSurfacePrivate::Subsurface::subsurface_set_sync(wl_subsurface::Resource *resource) +{ + Q_UNUSED(resource); + // TODO: sync/desync implementation + qDebug() << Q_FUNC_INFO; +} + +void QWaylandSurfacePrivate::Subsurface::subsurface_set_desync(wl_subsurface::Resource *resource) +{ + Q_UNUSED(resource); + // TODO: sync/desync implementation + qDebug() << Q_FUNC_INFO; +} + QT_END_NAMESPACE |