diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2013-04-09 16:52:59 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@digia.com> | 2013-04-17 09:39:21 +0200 |
commit | 82d52cdae8bb5c328db68123cb16d9d1fe4efb81 (patch) | |
tree | 58429ba7ec7cf33d520c28765ebb216d9415e620 /src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp | |
parent | 05d054ad7207764293525661876ebc689940a15c (diff) |
Adapted code to use qtwaylandscanner.
We include the wayland.xml since we need to generate bindings for the
core protocol as well.
Also, WAYLANDSOURCES has been split into WAYLANDSERVERSOURCES and
WAYLANDCLIENTSOURCES since we need to produce different output in the
server and client cases.
Change-Id: I0bd493d41ca6b26dfd2d9b1463d4b762786537f9
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp')
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp b/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp index 0ec955a86..6b1c9b329 100644 --- a/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp @@ -43,42 +43,23 @@ #include "qwaylandwindow.h" -#include "wayland-sub-surface-extension-client-protocol.h" - #include <QtCore/QDebug> QT_USE_NAMESPACE -QWaylandSubSurfaceExtension::QWaylandSubSurfaceExtension(QWaylandDisplay *display, uint32_t id) -{ - m_sub_surface_extension = static_cast<struct wl_sub_surface_extension *>( - wl_registry_bind(display->wl_registry(), id, &wl_sub_surface_extension_interface, 1)); -} - -QWaylandSubSurface *QWaylandSubSurfaceExtension::getSubSurfaceAwareWindow(QWaylandWindow *window) -{ - struct wl_surface *surface = window->wl_surface(); - Q_ASSERT(surface); - struct wl_sub_surface *sub_surface = - wl_sub_surface_extension_get_sub_surface_aware_surface(m_sub_surface_extension,surface); - - return new QWaylandSubSurface(window,sub_surface); - -} - -QWaylandSubSurface::QWaylandSubSurface(QWaylandWindow *window, struct wl_sub_surface *sub_surface) - : m_window(window) - , m_sub_surface(sub_surface) +QWaylandSubSurface::QWaylandSubSurface(QWaylandWindow *window, struct ::wl_sub_surface *sub_surface) + : QtWayland::wl_sub_surface(sub_surface) + , m_window(window) { } void QWaylandSubSurface::setParent(const QWaylandWindow *parent) { - QWaylandSubSurface *parentSurface = parent? parent->subSurfaceWindow():0; + QWaylandSubSurface *parentSurface = parent ? parent->subSurfaceWindow() : 0; if (parentSurface) { int x = m_window->geometry().x() + parent->frameMargins().left(); int y = m_window->geometry().y() + parent->frameMargins().top(); - wl_sub_surface_attach_sub_surface(parentSurface->m_sub_surface,m_sub_surface,x,y); + parentSurface->attach_sub_surface(object(), x, y); } } |