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/qwaylandshellsurface.cpp | |
parent | 05d054ad7207764293525661876ebc689940a15c (diff) | |
download | qtwayland-82d52cdae8bb5c328db68123cb16d9d1fe4efb81.tar.gz |
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/qwaylandshellsurface.cpp')
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp | 69 |
1 files changed, 25 insertions, 44 deletions
diff --git a/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp b/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp index 81392204..c9eb5da5 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp @@ -51,46 +51,44 @@ QT_USE_NAMESPACE -QWaylandShellSurface::QWaylandShellSurface(struct wl_shell_surface *shell_surface, QWaylandWindow *window) - : m_shell_surface(shell_surface) +QWaylandShellSurface::QWaylandShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window) + : QtWayland::wl_shell_surface(shell_surface) , m_window(window) , m_maximized(false) , m_fullscreen(false) { - wl_shell_surface_add_listener(m_shell_surface,&m_shell_surface_listener,this); } QWaylandShellSurface::~QWaylandShellSurface() { - wl_shell_surface_destroy(m_shell_surface); + wl_shell_surface_destroy(object()); } void QWaylandShellSurface::resize(QWaylandInputDevice *inputDevice, enum wl_shell_surface_resize edges) { - wl_shell_surface_resize(m_shell_surface,inputDevice->wl_seat(), - inputDevice->serial(), - edges); + resize(inputDevice->wl_seat(), + inputDevice->serial(), + edges); } void QWaylandShellSurface::move(QWaylandInputDevice *inputDevice) { - wl_shell_surface_move(m_shell_surface, - inputDevice->wl_seat(), - inputDevice->serial()); + move(inputDevice->wl_seat(), + inputDevice->serial()); } void QWaylandShellSurface::setMaximized() { m_maximized = true; m_size = m_window->window()->geometry().size(); - wl_shell_surface_set_maximized(m_shell_surface, 0); + set_maximized(0); } void QWaylandShellSurface::setFullscreen() { m_fullscreen = true; m_size = m_window->window()->geometry().size(); - wl_shell_surface_set_fullscreen(m_shell_surface, 0, 0, 0); + set_fullscreen(0, 0, 0); } void QWaylandShellSurface::setNormal() @@ -110,7 +108,7 @@ void QWaylandShellSurface::setMinimized() void QWaylandShellSurface::setTopLevel() { - wl_shell_surface_set_toplevel(m_shell_surface); + set_toplevel(); } void QWaylandShellSurface::updateTransientParent(QWindow *parent) @@ -134,51 +132,34 @@ void QWaylandShellSurface::updateTransientParent(QWindow *parent) || wf.testFlag(Qt::WindowTransparentForInput)) flags |= WL_SHELL_SURFACE_TRANSIENT_INACTIVE; - wl_shell_surface_set_transient(m_shell_surface, - parent_wayland_window->wl_surface(), - transientPos.x(), - transientPos.y(), - flags); + set_transient(parent_wayland_window->wl_surface(), + transientPos.x(), + transientPos.y(), + flags); } -void QWaylandShellSurface::setClassName(const char *_class) +void QWaylandShellSurface::setClassName(const char *className) { - wl_shell_surface_set_class(m_shell_surface, _class); + set_class(className); } void QWaylandShellSurface::setTitle(const char *title) { - wl_shell_surface_set_title(m_shell_surface, title); + set_title(title); } -void QWaylandShellSurface::ping(void *data, - struct wl_shell_surface *wl_shell_surface, - uint32_t serial) +void QWaylandShellSurface::shell_surface_ping(uint32_t serial) { - Q_UNUSED(data); - wl_shell_surface_pong(wl_shell_surface, serial); + pong(serial); } -void QWaylandShellSurface::configure(void *data, - wl_shell_surface *wl_shell_surface, - uint32_t edges, - int32_t width, - int32_t height) +void QWaylandShellSurface::shell_surface_configure(uint32_t edges, + int32_t width, + int32_t height) { - Q_UNUSED(wl_shell_surface); - QWaylandShellSurface *shell_surface = static_cast<QWaylandShellSurface *>(data); - shell_surface->m_window->configure(edges, width, height); + m_window->configure(edges, width, height); } -void QWaylandShellSurface::popup_done(void *data, - struct wl_shell_surface *wl_shell_surface) +void QWaylandShellSurface::shell_surface_popup_done() { - Q_UNUSED(data); - Q_UNUSED(wl_shell_surface); } - -const wl_shell_surface_listener QWaylandShellSurface::m_shell_surface_listener = { - QWaylandShellSurface::ping, - QWaylandShellSurface::configure, - QWaylandShellSurface::popup_done -}; |