diff options
author | Giulio Camuffo <giulio.camuffo@kdab.com> | 2016-08-29 15:15:29 +0200 |
---|---|---|
committer | Giulio Camuffo <giulio.camuffo@kdab.com> | 2016-09-05 11:30:27 +0000 |
commit | da61739728b2df7981b898da5dbdd4b74be068fc (patch) | |
tree | 7fc5100c02b883a9f58983bc01b2bf010f1f776d /examples | |
parent | 7eccad7db057ed841e3670d14274213dcf8416e5 (diff) |
Rename the QWaylandXdg* classes to QWaylandXdg*V5
This frees the QWaylandXdg name for the hopefully coming stable
version of xdg-shell.
Change-Id: I9beb9b035c6497fb45bee5c9104485b564ca0619
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/wayland/minimal-qml/main.qml | 2 | ||||
-rw-r--r-- | examples/wayland/pure-qml/qml/main.qml | 2 | ||||
-rw-r--r-- | examples/wayland/qwindow-compositor/compositor.cpp | 38 | ||||
-rw-r--r-- | examples/wayland/qwindow-compositor/compositor.h | 14 | ||||
-rw-r--r-- | examples/wayland/qwindow-compositor/window.cpp | 4 |
5 files changed, 30 insertions, 30 deletions
diff --git a/examples/wayland/minimal-qml/main.qml b/examples/wayland/minimal-qml/main.qml index ce64084ce..3d6c3b7bb 100644 --- a/examples/wayland/minimal-qml/main.qml +++ b/examples/wayland/minimal-qml/main.qml @@ -75,7 +75,7 @@ WaylandCompositor { onWlShellSurfaceCreated: chromeComponent.createObject(surfaceArea, { "shellSurface": shellSurface } ); } - XdgShell { + XdgShellV5 { onXdgSurfaceCreated: chromeComponent.createObject(surfaceArea, { "shellSurface": xdgSurface } ); } diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml index 69e8d2c84..9bce7bcb8 100644 --- a/examples/wayland/pure-qml/qml/main.qml +++ b/examples/wayland/pure-qml/qml/main.qml @@ -73,7 +73,7 @@ WaylandCompositor { } } - XdgShell { + XdgShellV5 { property variant viewsBySurface: ({}) onXdgSurfaceCreated: { var item = chromeComponent.createObject(defaultOutput.surfaceArea, { "shellSurface": xdgSurface } ); diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp index d9f850424..9d608d404 100644 --- a/examples/wayland/qwindow-compositor/compositor.cpp +++ b/examples/wayland/qwindow-compositor/compositor.cpp @@ -44,7 +44,7 @@ #include <QKeyEvent> #include <QTouchEvent> -#include <QtWaylandCompositor/QWaylandXdgShell> +#include <QtWaylandCompositor/QWaylandXdgShellV5> #include <QtWaylandCompositor/QWaylandWlShellSurface> #include <QtWaylandCompositor/qwaylandseat.h> #include <QtWaylandCompositor/qwaylanddrag.h> @@ -145,11 +145,11 @@ Compositor::Compositor(QWindow *window) : QWaylandCompositor() , m_window(window) , m_wlShell(new QWaylandWlShell(this)) - , m_xdgShell(new QWaylandXdgShell(this)) + , m_xdgShell(new QWaylandXdgShellV5(this)) { connect(m_wlShell, &QWaylandWlShell::wlShellSurfaceCreated, this, &Compositor::onWlShellSurfaceCreated); - connect(m_xdgShell, &QWaylandXdgShell::xdgSurfaceCreated, this, &Compositor::onXdgSurfaceCreated); - connect(m_xdgShell, &QWaylandXdgShell::xdgPopupRequested, this, &Compositor::onXdgPopupRequested); + connect(m_xdgShell, &QWaylandXdgShellV5::xdgSurfaceCreated, this, &Compositor::onXdgSurfaceCreated); + connect(m_xdgShell, &QWaylandXdgShellV5::xdgPopupRequested, this, &Compositor::onXdgPopupRequested); } Compositor::~Compositor() @@ -189,8 +189,8 @@ void Compositor::surfaceHasContentChanged() QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); if (surface->hasContent()) { if (surface->role() == QWaylandWlShellSurface::role() - || surface->role() == QWaylandXdgSurface::role() - || surface->role() == QWaylandXdgPopup::role()) { + || surface->role() == QWaylandXdgSurfaceV5::role() + || surface->role() == QWaylandXdgPopupV5::role()) { defaultSeat()->setKeyboardFocus(surface); } } else if (popupActive()) { @@ -237,19 +237,19 @@ void Compositor::onWlShellSurfaceCreated(QWaylandWlShellSurface *wlShellSurface) view->m_wlShellSurface = wlShellSurface; } -void Compositor::onXdgSurfaceCreated(QWaylandXdgSurface *xdgSurface) +void Compositor::onXdgSurfaceCreated(QWaylandXdgSurfaceV5 *xdgSurface) { - connect(xdgSurface, &QWaylandXdgSurface::startMove, this, &Compositor::onStartMove); - connect(xdgSurface, &QWaylandXdgSurface::startResize, this, &Compositor::onXdgStartResize); + connect(xdgSurface, &QWaylandXdgSurfaceV5::startMove, this, &Compositor::onStartMove); + connect(xdgSurface, &QWaylandXdgSurfaceV5::startResize, this, &Compositor::onXdgStartResize); View *view = findView(xdgSurface->surface()); Q_ASSERT(view); view->m_xdgSurface = xdgSurface; - connect(xdgSurface, &QWaylandXdgSurface::setMaximized, view, &View::onXdgSetMaximized); - connect(xdgSurface, &QWaylandXdgSurface::setFullscreen, view, &View::onXdgSetFullscreen); - connect(xdgSurface, &QWaylandXdgSurface::unsetMaximized, view, &View::onXdgUnsetMaximized); - connect(xdgSurface, &QWaylandXdgSurface::unsetFullscreen, view, &View::onXdgUnsetFullscreen); + connect(xdgSurface, &QWaylandXdgSurfaceV5::setMaximized, view, &View::onXdgSetMaximized); + connect(xdgSurface, &QWaylandXdgSurfaceV5::setFullscreen, view, &View::onXdgSetFullscreen); + connect(xdgSurface, &QWaylandXdgSurfaceV5::unsetMaximized, view, &View::onXdgUnsetMaximized); + connect(xdgSurface, &QWaylandXdgSurfaceV5::unsetFullscreen, view, &View::onXdgUnsetFullscreen); } void Compositor::onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface *parent, @@ -258,7 +258,7 @@ void Compositor::onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface * { Q_UNUSED(seat); - QWaylandXdgPopup *xdgPopup = new QWaylandXdgPopup(m_xdgShell, surface, parent, position, resource); + QWaylandXdgPopupV5 *xdgPopup = new QWaylandXdgPopupV5(m_xdgShell, surface, parent, position, resource); View *view = findView(surface); Q_ASSERT(view); @@ -283,7 +283,7 @@ void Compositor::onWlStartResize(QWaylandSeat *, QWaylandWlShellSurface::ResizeE } void Compositor::onXdgStartResize(QWaylandSeat *seat, - QWaylandXdgSurface::ResizeEdge edges) + QWaylandXdgSurfaceV5::ResizeEdge edges) { Q_UNUSED(seat); emit startResize(int(edges), true); @@ -403,8 +403,8 @@ void Compositor::handleMouseEvent(QWaylandView *target, QMouseEvent *me) if (surface != input->keyboardFocus()) { if (surface == nullptr || surface->role() == QWaylandWlShellSurface::role() - || surface->role() == QWaylandXdgSurface::role() - || surface->role() == QWaylandXdgPopup::role()) { + || surface->role() == QWaylandXdgSurfaceV5::role() + || surface->role() == QWaylandXdgPopupV5::role()) { input->setKeyboardFocus(surface); } } @@ -428,9 +428,9 @@ void Compositor::handleResize(View *target, const QSize &initialSize, const QPoi wlShellSurface->sendConfigure(newSize, edges); } - QWaylandXdgSurface *xdgSurface = target->m_xdgSurface; + QWaylandXdgSurfaceV5 *xdgSurface = target->m_xdgSurface; if (xdgSurface) { - QWaylandXdgSurface::ResizeEdge edges = static_cast<QWaylandXdgSurface::ResizeEdge>(edge); + QWaylandXdgSurfaceV5::ResizeEdge edges = static_cast<QWaylandXdgSurfaceV5::ResizeEdge>(edge); QSize newSize = xdgSurface->sizeForResize(initialSize, delta, edges); xdgSurface->sendResizing(newSize); } diff --git a/examples/wayland/qwindow-compositor/compositor.h b/examples/wayland/qwindow-compositor/compositor.h index 3de25a9bb..cfeccffda 100644 --- a/examples/wayland/qwindow-compositor/compositor.h +++ b/examples/wayland/qwindow-compositor/compositor.h @@ -45,14 +45,14 @@ #include <QtWaylandCompositor/QWaylandSurface> #include <QtWaylandCompositor/QWaylandView> #include <QtWaylandCompositor/QWaylandWlShellSurface> -#include <QtWaylandCompositor/QWaylandXdgSurface> +#include <QtWaylandCompositor/QWaylandXdgSurfaceV5> #include <QTimer> QT_BEGIN_NAMESPACE class QWaylandWlShell; class QWaylandWlShellSurface; -class QWaylandXdgShell; +class QWaylandXdgShellV5; class View : public QWaylandView { @@ -76,8 +76,8 @@ private: GLuint m_texture; QPointF m_position; QWaylandWlShellSurface *m_wlShellSurface; - QWaylandXdgSurface *m_xdgSurface; - QWaylandXdgPopup *m_xdgPopup; + QWaylandXdgSurfaceV5 *m_xdgSurface; + QWaylandXdgPopupV5 *m_xdgPopup; View *m_parentView; QPoint m_offset; @@ -124,7 +124,7 @@ private slots: void viewSurfaceDestroyed(); void onStartMove(); void onWlStartResize(QWaylandSeat *seat, QWaylandWlShellSurface::ResizeEdge edges); - void onXdgStartResize(QWaylandSeat *seat, QWaylandXdgSurface::ResizeEdge edges); + void onXdgStartResize(QWaylandSeat *seat, QWaylandXdgSurfaceV5::ResizeEdge edges); void startDrag(); @@ -132,7 +132,7 @@ private slots: void onSurfaceCreated(QWaylandSurface *surface); void onWlShellSurfaceCreated(QWaylandWlShellSurface *wlShellSurface); - void onXdgSurfaceCreated(QWaylandXdgSurface *xdgSurface); + void onXdgSurfaceCreated(QWaylandXdgSurfaceV5 *xdgSurface); void onXdgPopupRequested(QWaylandSurface *surface, QWaylandSurface *parent, QWaylandSeat *seat, const QPoint &position, const QWaylandResource &resource); void onSetTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, QWaylandWlShellSurface::FocusPolicy focusPolicy); @@ -148,7 +148,7 @@ private: QList<View*> m_views; QList<View*> m_popupViews; QWaylandWlShell *m_wlShell; - QWaylandXdgShell *m_xdgShell; + QWaylandXdgShellV5 *m_xdgShell; QWaylandView m_cursorView; int m_cursorHotspotX; int m_cursorHotspotY; diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp index b73c7be39..617d79c0e 100644 --- a/examples/wayland/qwindow-compositor/window.cpp +++ b/examples/wayland/qwindow-compositor/window.cpp @@ -88,11 +88,11 @@ void Window::drawBackground() QPointF Window::getAnchorPosition(const QPointF &position, int resizeEdge, const QSize &windowSize) { float y = position.y(); - if (resizeEdge & QWaylandXdgSurface::ResizeEdge::TopEdge) + if (resizeEdge & QWaylandXdgSurfaceV5::ResizeEdge::TopEdge) y += windowSize.height(); float x = position.x(); - if (resizeEdge & QWaylandXdgSurface::ResizeEdge::LeftEdge) + if (resizeEdge & QWaylandXdgSurfaceV5::ResizeEdge::LeftEdge) x += windowSize.width(); return QPointF(x, y); |