diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-05-11 14:28:56 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-05-20 12:11:17 +0000 |
commit | 5e5e866c8c1fc8234c25770d84e9591041e67d69 (patch) | |
tree | 111913497f39e6cbad7403743ab40a5d9aed734c /src/compositor/extensions/qwaylandwlshell.cpp | |
parent | 8817a981389b4f22a614f258f3575360645f2fd9 (diff) |
Create a general ShellSurfaceItem to avoid duplication
XdgSurfaceItem and WlShellSurfaceItem have been removed in favor
of the more general ShellSurfaceItem. An XdgSurface or a WlShellSurface
can be assigned to the shellSurface property of a ShellSurfaceItem
and leaves open the possibility for additional shells.
A shared base class for QWaylandXdgSurface and QWaylandWlShellSurface
has been added which has a factory method for creating
a QWaylandQuickShellIntegration for that shell implementation.
The property "shellSurface" on the ShellSurfaceItem allows QML code to
attach to signals regardless of whether it's a WlShell or XdgShell
client. The pure-qml example has been updated to take advantage of this.
Change-Id: I9d3427586e100d6c44a24f319dd8e1486ff062ee
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'src/compositor/extensions/qwaylandwlshell.cpp')
-rw-r--r-- | src/compositor/extensions/qwaylandwlshell.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index ecd206f8c..4e9937680 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -38,6 +38,8 @@ #include "qwaylandwlshell.h" #include "qwaylandwlshell_p.h" +#include "qwaylandwlshellintegration_p.h" + #include <QtWaylandCompositor/QWaylandCompositor> #include <QtWaylandCompositor/QWaylandView> #include <QtWaylandCompositor/QWaylandOutput> @@ -370,7 +372,7 @@ QByteArray QWaylandWlShell::interfaceName() * Constructs a QWaylandWlShellSurface. */ QWaylandWlShellSurface::QWaylandWlShellSurface() - : QWaylandCompositorExtensionTemplate<QWaylandWlShellSurface>(*new QWaylandWlShellSurfacePrivate) + : QWaylandShellSurfaceTemplate<QWaylandWlShellSurface>(*new QWaylandWlShellSurfacePrivate) { } @@ -378,7 +380,7 @@ QWaylandWlShellSurface::QWaylandWlShellSurface() * Constructs a QWaylandWlShellSurface for \a surface and initializes it with the given \a shell and \a resource. */ QWaylandWlShellSurface::QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &res) - : QWaylandCompositorExtensionTemplate<QWaylandWlShellSurface>(*new QWaylandWlShellSurfacePrivate) + : QWaylandShellSurfaceTemplate<QWaylandWlShellSurface>(*new QWaylandWlShellSurfacePrivate) { initialize(shell, surface, res); } @@ -408,7 +410,7 @@ void QWaylandWlShellSurface::initialize(QWaylandWlShell *shell, QWaylandSurface */ void QWaylandWlShellSurface::initialize() { - QWaylandCompositorExtensionTemplate::initialize(); + QWaylandCompositorExtension::initialize(); } const struct wl_interface *QWaylandWlShellSurface::interface() @@ -494,6 +496,11 @@ void QWaylandWlShellSurface::sendPopupDone() d->send_popup_done(); } +QWaylandQuickShellIntegration *QWaylandWlShellSurface::createIntegration(QWaylandQuickShellSurfaceItem *item) +{ + return new QtWayland::WlShellIntegration(item); +} + /*! * \qmlproperty object QtWaylandCompositor::WlShellSurface::surface * |