diff options
20 files changed, 401 insertions, 401 deletions
diff --git a/examples/wayland/custom-extension/compositor/qml/main.qml b/examples/wayland/custom-extension/compositor/qml/main.qml index 737c42c62..54d0707ac 100644 --- a/examples/wayland/custom-extension/compositor/qml/main.qml +++ b/examples/wayland/custom-extension/compositor/qml/main.qml @@ -64,7 +64,7 @@ WaylandCompositor { Component { id: chromeComponent - ShellSurfaceItem { + WlShellSurfaceItem { id: chrome onSurfaceDestroyed: { if (chrome === lastItem) @@ -75,7 +75,7 @@ WaylandCompositor { } extensions: [ - Shell { + WlShell { id: defaultShell onCreateShellSurface: { diff --git a/examples/wayland/multi-output/qml/ShellChrome.qml b/examples/wayland/multi-output/qml/ShellChrome.qml index 83f883dac..1dc90647d 100644 --- a/examples/wayland/multi-output/qml/ShellChrome.qml +++ b/examples/wayland/multi-output/qml/ShellChrome.qml @@ -41,10 +41,10 @@ import QtQuick 2.0 import QtWayland.Compositor 1.0 -ShellSurfaceItem { +WlShellSurfaceItem { id: rootChrome - shellSurface: ShellSurface { + shellSurface: WlShellSurface { } onSurfaceDestroyed: { diff --git a/examples/wayland/multi-output/qml/main.qml b/examples/wayland/multi-output/qml/main.qml index a6a7f8a8d..9e11d3613 100644 --- a/examples/wayland/multi-output/qml/main.qml +++ b/examples/wayland/multi-output/qml/main.qml @@ -82,7 +82,7 @@ WaylandCompositor { } extensions: [ - Shell { + WlShell { id: defaultShell onCreateShellSurface: { diff --git a/examples/wayland/pure-qml/qml/Chrome.qml b/examples/wayland/pure-qml/qml/Chrome.qml index 83f883dac..1dc90647d 100644 --- a/examples/wayland/pure-qml/qml/Chrome.qml +++ b/examples/wayland/pure-qml/qml/Chrome.qml @@ -41,10 +41,10 @@ import QtQuick 2.0 import QtWayland.Compositor 1.0 -ShellSurfaceItem { +WlShellSurfaceItem { id: rootChrome - shellSurface: ShellSurface { + shellSurface: WlShellSurface { } onSurfaceDestroyed: { diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml index 338c00f80..d706945e2 100644 --- a/examples/wayland/pure-qml/qml/main.qml +++ b/examples/wayland/pure-qml/qml/main.qml @@ -63,7 +63,7 @@ WaylandCompositor { } extensions: [ - Shell { + WlShell { id: defaultShell diff --git a/examples/wayland/qwindow-compositor/windowcompositor.cpp b/examples/wayland/qwindow-compositor/windowcompositor.cpp index 9778220c0..a8504b517 100644 --- a/examples/wayland/qwindow-compositor/windowcompositor.cpp +++ b/examples/wayland/qwindow-compositor/windowcompositor.cpp @@ -44,8 +44,8 @@ #include <QKeyEvent> #include <QTouchEvent> -#include <QtWaylandCompositor/QWaylandShellSurface> #include <QtWaylandCompositor/QWaylandXdgShell> +#include <QtWaylandCompositor/QWaylandWlShellSurface> #include <QtWaylandCompositor/qwaylandinput.h> #include <QtWaylandCompositor/qwaylanddrag.h> @@ -108,10 +108,10 @@ void WindowCompositorView::onXdgUnsetFullscreen() WindowCompositor::WindowCompositor(QWindow *window) : QWaylandCompositor() , m_window(window) - , m_shell(new QWaylandShell(this)) + , m_wlShell(new QWaylandWlShell(this)) , m_xdgShell(new QWaylandXdgShell(this)) { - connect(m_shell, &QWaylandShell::createShellSurface, this, &WindowCompositor::onCreateShellSurface); + connect(m_wlShell, &QWaylandWlShell::createShellSurface, this, &WindowCompositor::onCreateWlShellSurface); connect(m_xdgShell, &QWaylandXdgShell::createXdgSurface, this, &WindowCompositor::onCreateXdgSurface); connect(m_xdgShell, &QWaylandXdgShell::createXdgPopup, this, &WindowCompositor::onCreateXdgPopup); } @@ -152,7 +152,7 @@ void WindowCompositor::surfaceMappedChanged() { QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); if (surface->isMapped()) { - if (surface->role() == QWaylandShellSurface::role() + if (surface->role() == QWaylandWlShellSurface::role() || surface->role() == QWaylandXdgSurface::role() || surface->role() == QWaylandXdgPopup::role()) { defaultInputDevice()->setKeyboardFocus(surface); @@ -189,18 +189,18 @@ WindowCompositorView * WindowCompositor::findView(const QWaylandSurface *s) cons return Q_NULLPTR; } -void WindowCompositor::onCreateShellSurface(QWaylandSurface *s, const QWaylandResource &res) +void WindowCompositor::onCreateWlShellSurface(QWaylandSurface *s, const QWaylandResource &res) { QWaylandSurface *surface = s; - QWaylandShellSurface *shellSurface = new QWaylandShellSurface(m_shell, surface, res); - connect(shellSurface, &QWaylandShellSurface::startMove, this, &WindowCompositor::onStartMove); - connect(shellSurface, &QWaylandShellSurface::startResize, this, &WindowCompositor::onStartResize); - connect(shellSurface, &QWaylandShellSurface::setTransient, this, &WindowCompositor::onSetTransient); - connect(shellSurface, &QWaylandShellSurface::setPopup, this, &WindowCompositor::onSetPopup); + QWaylandWlShellSurface *wlShellSurface = new QWaylandWlShellSurface(m_wlShell, surface, res); + connect(wlShellSurface, &QWaylandWlShellSurface::startMove, this, &WindowCompositor::onStartMove); + connect(wlShellSurface, &QWaylandWlShellSurface::startResize, this, &WindowCompositor::onWlStartResize); + connect(wlShellSurface, &QWaylandWlShellSurface::setTransient, this, &WindowCompositor::onSetTransient); + connect(wlShellSurface, &QWaylandWlShellSurface::setPopup, this, &WindowCompositor::onSetPopup); WindowCompositorView *view = findView(s); Q_ASSERT(view); - view->m_shellSurface = shellSurface; + view->m_wlShellSurface = wlShellSurface; } void WindowCompositor::onCreateXdgSurface(QWaylandSurface *surface, const QWaylandResource &res) @@ -242,7 +242,7 @@ void WindowCompositor::onStartMove() emit startMove(); } -void WindowCompositor::onStartResize(QWaylandInputDevice *, QWaylandShellSurface::ResizeEdge edges) +void WindowCompositor::onWlStartResize(QWaylandInputDevice *, QWaylandWlShellSurface::ResizeEdge edges) { closePopups(); emit startResize(int(edges), false); @@ -255,10 +255,10 @@ void WindowCompositor::onXdgStartResize(QWaylandInputDevice *inputDevice, emit startResize(int(edges), true); } -void WindowCompositor::onSetTransient(QWaylandSurface *parent, const QPoint &relativeToParent, QWaylandShellSurface::FocusPolicy focusPolicy) +void WindowCompositor::onSetTransient(QWaylandSurface *parent, const QPoint &relativeToParent, QWaylandWlShellSurface::FocusPolicy focusPolicy) { - QWaylandShellSurface *surface = qobject_cast<QWaylandShellSurface*>(sender()); - WindowCompositorView *view = findView(surface->surface()); + QWaylandWlShellSurface *wlShellSurface = qobject_cast<QWaylandWlShellSurface*>(sender()); + WindowCompositorView *view = findView(wlShellSurface->surface()); if (view) { raise(view); @@ -271,7 +271,7 @@ void WindowCompositor::onSetTransient(QWaylandSurface *parent, const QPoint &rel void WindowCompositor::onSetPopup(QWaylandInputDevice *inputDevice, QWaylandSurface *parent, const QPoint &relativeToParent) { Q_UNUSED(inputDevice); - QWaylandShellSurface *surface = qobject_cast<QWaylandShellSurface*>(sender()); + QWaylandWlShellSurface *surface = qobject_cast<QWaylandWlShellSurface*>(sender()); WindowCompositorView *view = findView(surface->surface()); m_popupViews << view; if (view) { @@ -346,8 +346,8 @@ void WindowCompositor::adjustCursorSurface(QWaylandSurface *surface, int hotspot void WindowCompositor::closePopups() { Q_FOREACH (WindowCompositorView *view, m_popupViews) { - if (view->m_shellSurface) - view->m_shellSurface->sendPopupDone(); + if (view->m_wlShellSurface) + view->m_wlShellSurface->sendPopupDone(); } m_popupViews.clear(); @@ -367,7 +367,7 @@ void WindowCompositor::handleMouseEvent(QWaylandView *target, QMouseEvent *me) input->sendMousePressEvent(me->button()); if (surface != input->keyboardFocus()) { if (surface == nullptr - || surface->role() == QWaylandShellSurface::role() + || surface->role() == QWaylandWlShellSurface::role() || surface->role() == QWaylandXdgSurface::role() || surface->role() == QWaylandXdgPopup::role()) { input->setKeyboardFocus(surface); @@ -386,11 +386,11 @@ void WindowCompositor::handleMouseEvent(QWaylandView *target, QMouseEvent *me) void WindowCompositor::handleResize(WindowCompositorView *target, const QSize &initialSize, const QPoint &delta, int edge) { - QWaylandShellSurface *shellSurface = target->m_shellSurface; - if (shellSurface) { - QWaylandShellSurface::ResizeEdge edges = QWaylandShellSurface::ResizeEdge(edge); - QSize newSize = shellSurface->sizeForResize(initialSize, delta, edges); - shellSurface->sendConfigure(newSize, edges); + QWaylandWlShellSurface *wlShellSurface = target->m_wlShellSurface; + if (wlShellSurface) { + QWaylandWlShellSurface::ResizeEdge edges = QWaylandWlShellSurface::ResizeEdge(edge); + QSize newSize = wlShellSurface->sizeForResize(initialSize, delta, edges); + wlShellSurface->sendConfigure(newSize, edges); } QWaylandXdgSurface *xdgSurface = target->m_xdgSurface; diff --git a/examples/wayland/qwindow-compositor/windowcompositor.h b/examples/wayland/qwindow-compositor/windowcompositor.h index 3c5525a3b..63068d1ae 100644 --- a/examples/wayland/qwindow-compositor/windowcompositor.h +++ b/examples/wayland/qwindow-compositor/windowcompositor.h @@ -44,26 +44,26 @@ #include <QtWaylandCompositor/QWaylandCompositor> #include <QtWaylandCompositor/QWaylandSurface> #include <QtWaylandCompositor/QWaylandView> -#include <QtWaylandCompositor/QWaylandShellSurface> +#include <QtWaylandCompositor/QWaylandWlShellSurface> #include <QtWaylandCompositor/QWaylandXdgSurface> #include <QTimer> QT_BEGIN_NAMESPACE -class QWaylandShell; +class QWaylandWlShell; +class QWaylandWlShellSurface; class QWaylandXdgShell; -class QWaylandShellSurface; class WindowCompositorView : public QWaylandView { Q_OBJECT public: - WindowCompositorView() : m_texture(0), m_shellSurface(0), m_parentView(0) {} + WindowCompositorView() : m_texture(0), m_wlShellSurface(0), m_parentView(0) {} GLuint getTexture(); QPointF position() const { return m_position; } void setPosition(const QPointF &pos) { m_position = pos; } bool isCursor() const; - bool hasShell() const { return m_shellSurface; } + bool hasShell() const { return m_wlShellSurface; } void setParentView(WindowCompositorView *parent) { m_parentView = parent; } WindowCompositorView *parentView() const { return m_parentView; } QPointF parentPosition() const { return m_parentView ? (m_parentView->position() + m_parentView->parentPosition()) : QPointF(); } @@ -73,7 +73,7 @@ private: friend class WindowCompositor; GLuint m_texture; QPointF m_position; - QWaylandShellSurface *m_shellSurface; + QWaylandWlShellSurface *m_wlShellSurface; QWaylandXdgSurface *m_xdgSurface; QWaylandXdgPopup *m_xdgPopup; WindowCompositorView *m_parentView; @@ -119,7 +119,7 @@ private slots: void surfaceDestroyed(); void viewSurfaceDestroyed(); void onStartMove(); - void onStartResize(QWaylandInputDevice *inputDevice, QWaylandShellSurface::ResizeEdge edges); + void onWlStartResize(QWaylandInputDevice *inputDevice, QWaylandWlShellSurface::ResizeEdge edges); void onXdgStartResize(QWaylandInputDevice *inputDevice, QWaylandXdgSurface::ResizeEdge edges); void startDrag(); @@ -127,11 +127,11 @@ private slots: void triggerRender(); void onSurfaceCreated(QWaylandSurface *surface); - void onCreateShellSurface(QWaylandSurface *s, const QWaylandResource &resource); + void onCreateWlShellSurface(QWaylandSurface *s, const QWaylandResource &resource); void onCreateXdgSurface(QWaylandSurface *surface, const QWaylandResource &resource); void onCreateXdgPopup(QWaylandSurface *surface, QWaylandSurface *parent, QWaylandInputDevice *inputDevice, const QPoint &position, const QWaylandResource &resource); - void onSetTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, QWaylandShellSurface::FocusPolicy focusPolicy); + void onSetTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, QWaylandWlShellSurface::FocusPolicy focusPolicy); void onSetPopup(QWaylandInputDevice *inputDevice, QWaylandSurface *parent, const QPoint &relativeToParent); void onSubsurfaceChanged(QWaylandSurface *child, QWaylandSurface *parent); @@ -143,7 +143,7 @@ private: QWindow *m_window; QList<WindowCompositorView*> m_views; QList<WindowCompositorView*> m_popupViews; - QWaylandShell *m_shell; + QWaylandWlShell *m_wlShell; QWaylandXdgShell *m_xdgShell; QWaylandView m_cursorView; int m_cursorHotspotX; diff --git a/src/compositor/compositor_api/qwaylandinput.cpp b/src/compositor/compositor_api/qwaylandinput.cpp index 512ad6e37..ed1a9c786 100644 --- a/src/compositor/compositor_api/qwaylandinput.cpp +++ b/src/compositor/compositor_api/qwaylandinput.cpp @@ -42,7 +42,7 @@ #include <QtWaylandCompositor/QWaylandDrag> #include <QtWaylandCompositor/QWaylandTouch> #include <QtWaylandCompositor/QWaylandPointer> -#include <QtWaylandCompositor/QWaylandShellSurface> +#include <QtWaylandCompositor/QWaylandWlShellSurface> #include <QtWaylandCompositor/private/qwlinputmethod_p.h> #include <QtWaylandCompositor/private/qwaylandinput_p.h> #include <QtWaylandCompositor/private/qwaylandcompositor_p.h> @@ -346,8 +346,8 @@ bool QWaylandInputDevice::setKeyboardFocus(QWaylandSurface *surface) if (surface == oldSurface) return true; - QWaylandShellSurface *shellsurface = QWaylandShellSurface::findIn(surface); - if (shellsurface && shellsurface->focusPolicy() == QWaylandShellSurface::NoKeyboardFocus) + QWaylandWlShellSurface *wlShellsurface = QWaylandWlShellSurface::findIn(surface); + if (wlShellsurface && wlShellsurface->focusPolicy() == QWaylandWlShellSurface::NoKeyboardFocus) return false; d->keyboardFocus = surface; diff --git a/src/compositor/compositor_api/qwaylandquickcompositor.cpp b/src/compositor/compositor_api/qwaylandquickcompositor.cpp index 8a7ef7451..a30ea05b3 100644 --- a/src/compositor/compositor_api/qwaylandquickcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandquickcompositor.cpp @@ -73,14 +73,14 @@ QWaylandQuickCompositor::QWaylandQuickCompositor(QObject *parent) * any Wayland extension the compositor should support, instantiate its component, * and add it to the list of extensions. * - * For instance, the following code would allow the clients to request shell surfaces + * For instance, the following code would allow the clients to request wl shell surfaces * in the compositor using the wl_shell interface. * * \code * import QtWayland.Compositor 1.0 * * WaylandCompositor { - * extensions: [ Shell { + * extensions: [ WlShell { * // ... * } ] * } diff --git a/src/compositor/extensions/extensions.pri b/src/compositor/extensions/extensions.pri index a62490585..03be3905e 100644 --- a/src/compositor/extensions/extensions.pri +++ b/src/compositor/extensions/extensions.pri @@ -12,8 +12,8 @@ HEADERS += \ extensions/qwlextendedsurface_p.h \ extensions/qwlqttouch_p.h \ extensions/qwlqtkey_p.h \ - extensions/qwaylandshell.h \ - extensions/qwaylandshell_p.h \ + extensions/qwaylandwlshell.h \ + extensions/qwaylandwlshell_p.h \ extensions/qwaylandwindowmanagerextension.h \ extensions/qwaylandwindowmanagerextension_p.h \ extensions/qwltextinput_p.h \ @@ -29,7 +29,7 @@ SOURCES += \ extensions/qwlextendedsurface.cpp \ extensions/qwlqttouch.cpp \ extensions/qwlqtkey.cpp \ - extensions/qwaylandshell.cpp \ + extensions/qwaylandwlshell.cpp \ extensions/qwaylandwindowmanagerextension.cpp \ extensions/qwltextinput.cpp \ extensions/qwltextinputmanager.cpp \ @@ -41,11 +41,11 @@ SOURCES += \ qtHaveModule(quick) { HEADERS += \ - extensions/qwaylandquickshellsurfaceitem.h \ - extensions/qwaylandquickshellsurfaceitem_p.h \ + extensions/qwaylandquickwlshellsurfaceitem.h \ + extensions/qwaylandquickwlshellsurfaceitem_p.h \ SOURCES += \ - extensions/qwaylandquickshellsurfaceitem.cpp \ + extensions/qwaylandquickwlshellsurfaceitem.cpp \ } diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp b/src/compositor/extensions/qwaylandquickwlshellsurfaceitem.cpp index 5eb34b849..fc6d856d8 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp +++ b/src/compositor/extensions/qwaylandquickwlshellsurfaceitem.cpp @@ -34,8 +34,8 @@ ** ****************************************************************************/ -#include "qwaylandquickshellsurfaceitem.h" -#include "qwaylandquickshellsurfaceitem_p.h" +#include "qwaylandquickwlshellsurfaceitem.h" +#include "qwaylandquickwlshellsurfaceitem_p.h" #include <QtWaylandCompositor/QWaylandCompositor> #include <QtWaylandCompositor/QWaylandInputDevice> @@ -43,91 +43,91 @@ QT_BEGIN_NAMESPACE /*! - * \qmltype ShellSurfaceItem + * \qmltype WlShellSurfaceItem * \inqmlmodule QtWayland.Compositor - * \brief An item representing a ShellSurface. + * \brief An item representing a WlShellSurface. * - * This type can be used to render shell surfaces as part of a Qt Quick scene. + * This type can be used to render wl_shell_surfaces as part of a Qt Quick scene. * It handles moving and resizing triggered by clicking on the window decorations. */ /*! - * \class QWaylandQuickShellSurfaceItem + * \class QWaylandQuickWlShellSurfaceItem * \inmodule QtWaylandCompositor - * \brief A Qt Quick item for QWaylandShellSurface. + * \brief A Qt Quick item for QWaylandWlShellSurface. * - * This class can be used to create Qt Quick items representing shell surfaces. + * This class can be used to create Qt Quick items representing wl_shell_surfaces. * It handles moving and resizing triggered by clicking on the window decorations. * * \sa QWaylandQuickItem */ /*! - * Constructs a QWaylandQuickShellSurfaceItem with the given \a parent. + * Constructs a QWaylandQuickWlShellSurfaceItem with the given \a parent. */ -QWaylandQuickShellSurfaceItem::QWaylandQuickShellSurfaceItem(QQuickItem *parent) - : QWaylandQuickItem(*new QWaylandQuickShellSurfaceItemPrivate(), parent) +QWaylandQuickWlShellSurfaceItem::QWaylandQuickWlShellSurfaceItem(QQuickItem *parent) + : QWaylandQuickItem(*new QWaylandQuickWlShellSurfaceItemPrivate(), parent) { } /*! * \internal */ -QWaylandQuickShellSurfaceItem::QWaylandQuickShellSurfaceItem(QWaylandQuickShellSurfaceItemPrivate &dd, QQuickItem *parent) +QWaylandQuickWlShellSurfaceItem::QWaylandQuickWlShellSurfaceItem(QWaylandQuickWlShellSurfaceItemPrivate &dd, QQuickItem *parent) : QWaylandQuickItem(dd, parent) { } /*! - * \qmlproperty object QtWaylandCompositor::ShellSurfaceItem::shellSurface + * \qmlproperty object QtWaylandCompositor::WlShellSurfaceItem::shellSurface * - * This property holds the shell surface rendered by this ShellSurfaceItem. + * This property holds the wl_shell_surface rendered by this WlShellSurfaceItem. */ /*! - * \property QWaylandQuickShellSurfaceItem::shellSurface + * \property QWaylandQuickWlShellSurfaceItem::shellSurface * - * This property holds the shell surface rendered by this QWaylandQuickShellSurfaceItem. + * This property holds the wl_shell_surface rendered by this QWaylandQuickWlShellSurfaceItem. */ -QWaylandShellSurface *QWaylandQuickShellSurfaceItem::shellSurface() const +QWaylandWlShellSurface *QWaylandQuickWlShellSurfaceItem::shellSurface() const { - Q_D(const QWaylandQuickShellSurfaceItem); + Q_D(const QWaylandQuickWlShellSurfaceItem); return d->shellSurface; } -void QWaylandQuickShellSurfaceItem::setShellSurface(QWaylandShellSurface *shellSurface) +void QWaylandQuickWlShellSurfaceItem::setShellSurface(QWaylandWlShellSurface *shellSurface) { - Q_D(QWaylandQuickShellSurfaceItem); + Q_D(QWaylandQuickWlShellSurfaceItem); if (shellSurface == d->shellSurface) return; if (d->shellSurface) { - disconnect(d->shellSurface, &QWaylandShellSurface::startMove, this, &QWaylandQuickShellSurfaceItem::handleStartMove); - disconnect(d->shellSurface, &QWaylandShellSurface::startResize, this, &QWaylandQuickShellSurfaceItem::handleStartResize); + disconnect(d->shellSurface, &QWaylandWlShellSurface::startMove, this, &QWaylandQuickWlShellSurfaceItem::handleStartMove); + disconnect(d->shellSurface, &QWaylandWlShellSurface::startResize, this, &QWaylandQuickWlShellSurfaceItem::handleStartResize); } d->shellSurface = shellSurface; if (d->shellSurface) { - connect(d->shellSurface, &QWaylandShellSurface::startMove, this, &QWaylandQuickShellSurfaceItem::handleStartMove); - connect(d->shellSurface, &QWaylandShellSurface::startResize, this, &QWaylandQuickShellSurfaceItem::handleStartResize); + connect(d->shellSurface, &QWaylandWlShellSurface::startMove, this, &QWaylandQuickWlShellSurfaceItem::handleStartMove); + connect(d->shellSurface, &QWaylandWlShellSurface::startResize, this, &QWaylandQuickWlShellSurfaceItem::handleStartResize); } emit shellSurfaceChanged(); } /*! * \internal - * \property QWaylandQuickShellSurfaceItem::moveItem + * \property QWaylandQuickWlShellSurfaceItem::moveItem * - * This property holds the move item for this QWaylandQuickShellSurfaceItem. + * This property holds the move item for this QWaylandQuickWlShellSurfaceItem. */ -QQuickItem *QWaylandQuickShellSurfaceItem::moveItem() const +QQuickItem *QWaylandQuickWlShellSurfaceItem::moveItem() const { - Q_D(const QWaylandQuickShellSurfaceItem); + Q_D(const QWaylandQuickWlShellSurfaceItem); return d->moveItem; } -void QWaylandQuickShellSurfaceItem::setMoveItem(QQuickItem *moveItem) +void QWaylandQuickWlShellSurfaceItem::setMoveItem(QQuickItem *moveItem) { - Q_D(QWaylandQuickShellSurfaceItem); + Q_D(QWaylandQuickWlShellSurfaceItem); if (d->moveItem == moveItem) return; d->moveItem = moveItem; @@ -137,10 +137,10 @@ void QWaylandQuickShellSurfaceItem::setMoveItem(QQuickItem *moveItem) /*! * \internal */ -void QWaylandQuickShellSurfaceItem::handleStartMove(QWaylandInputDevice *inputDevice) +void QWaylandQuickWlShellSurfaceItem::handleStartMove(QWaylandInputDevice *inputDevice) { - Q_D(QWaylandQuickShellSurfaceItem); - d->grabberState = QWaylandQuickShellSurfaceItemPrivate::MoveState; + Q_D(QWaylandQuickWlShellSurfaceItem); + d->grabberState = QWaylandQuickWlShellSurfaceItemPrivate::MoveState; d->moveState.inputDevice = inputDevice; d->moveState.initialized = false; } @@ -148,10 +148,10 @@ void QWaylandQuickShellSurfaceItem::handleStartMove(QWaylandInputDevice *inputDe /*! * \internal */ -void QWaylandQuickShellSurfaceItem::handleStartResize(QWaylandInputDevice *inputDevice, QWaylandShellSurface::ResizeEdge edges) +void QWaylandQuickWlShellSurfaceItem::handleStartResize(QWaylandInputDevice *inputDevice, QWaylandWlShellSurface::ResizeEdge edges) { - Q_D(QWaylandQuickShellSurfaceItem); - d->grabberState = QWaylandQuickShellSurfaceItemPrivate::ResizeState; + Q_D(QWaylandQuickWlShellSurfaceItem); + d->grabberState = QWaylandQuickWlShellSurfaceItemPrivate::ResizeState; d->resizeState.inputDevice = inputDevice; d->resizeState.resizeEdges = edges; d->resizeState.initialSize = surface()->size(); @@ -161,9 +161,9 @@ void QWaylandQuickShellSurfaceItem::handleStartResize(QWaylandInputDevice *input /*! * \internal */ -void QWaylandQuickShellSurfaceItem::adjustOffsetForNextFrame(const QPointF &offset) +void QWaylandQuickWlShellSurfaceItem::adjustOffsetForNextFrame(const QPointF &offset) { - Q_D(QWaylandQuickShellSurfaceItem); + Q_D(QWaylandQuickWlShellSurfaceItem); QQuickItem *moveItem = d->moveItem ? d->moveItem : this; moveItem->setPosition(moveItem->position() + offset); } @@ -171,10 +171,10 @@ void QWaylandQuickShellSurfaceItem::adjustOffsetForNextFrame(const QPointF &offs /*! * \internal */ -void QWaylandQuickShellSurfaceItem::mouseMoveEvent(QMouseEvent *event) +void QWaylandQuickWlShellSurfaceItem::mouseMoveEvent(QMouseEvent *event) { - Q_D(QWaylandQuickShellSurfaceItem); - if (d->grabberState == QWaylandQuickShellSurfaceItemPrivate::ResizeState) { + Q_D(QWaylandQuickWlShellSurfaceItem); + if (d->grabberState == QWaylandQuickWlShellSurfaceItemPrivate::ResizeState) { Q_ASSERT(d->resizeState.inputDevice == compositor()->inputDeviceFor(event)); if (!d->resizeState.initialized) { d->resizeState.initialMousePos = event->windowPos(); @@ -184,7 +184,7 @@ void QWaylandQuickShellSurfaceItem::mouseMoveEvent(QMouseEvent *event) QPointF delta = event->windowPos() - d->resizeState.initialMousePos; QSize newSize = shellSurface()->sizeForResize(d->resizeState.initialSize, delta, d->resizeState.resizeEdges); shellSurface()->sendConfigure(newSize, d->resizeState.resizeEdges); - } else if (d->grabberState == QWaylandQuickShellSurfaceItemPrivate::MoveState) { + } else if (d->grabberState == QWaylandQuickWlShellSurfaceItemPrivate::MoveState) { Q_ASSERT(d->moveState.inputDevice == compositor()->inputDeviceFor(event)); QQuickItem *moveItem = d->moveItem ? d->moveItem : this; if (!d->moveState.initialized) { @@ -204,11 +204,11 @@ void QWaylandQuickShellSurfaceItem::mouseMoveEvent(QMouseEvent *event) /*! * \internal */ -void QWaylandQuickShellSurfaceItem::mouseReleaseEvent(QMouseEvent *event) +void QWaylandQuickWlShellSurfaceItem::mouseReleaseEvent(QMouseEvent *event) { - Q_D(QWaylandQuickShellSurfaceItem); - if (d->grabberState != QWaylandQuickShellSurfaceItemPrivate::DefaultState) { - d->grabberState = QWaylandQuickShellSurfaceItemPrivate::DefaultState; + Q_D(QWaylandQuickWlShellSurfaceItem); + if (d->grabberState != QWaylandQuickWlShellSurfaceItemPrivate::DefaultState) { + d->grabberState = QWaylandQuickWlShellSurfaceItemPrivate::DefaultState; return; } QWaylandQuickItem::mouseReleaseEvent(event); @@ -217,23 +217,23 @@ void QWaylandQuickShellSurfaceItem::mouseReleaseEvent(QMouseEvent *event) /*! * \internal */ -void QWaylandQuickShellSurfaceItem::surfaceChangedEvent(QWaylandSurface *newSurface, QWaylandSurface *oldSurface) +void QWaylandQuickWlShellSurfaceItem::surfaceChangedEvent(QWaylandSurface *newSurface, QWaylandSurface *oldSurface) { if (oldSurface) - disconnect(oldSurface, &QWaylandSurface::offsetForNextFrame, this, &QWaylandQuickShellSurfaceItem::adjustOffsetForNextFrame); + disconnect(oldSurface, &QWaylandSurface::offsetForNextFrame, this, &QWaylandQuickWlShellSurfaceItem::adjustOffsetForNextFrame); if (newSurface) - connect(newSurface, &QWaylandSurface::offsetForNextFrame, this, &QWaylandQuickShellSurfaceItem::adjustOffsetForNextFrame); + connect(newSurface, &QWaylandSurface::offsetForNextFrame, this, &QWaylandQuickWlShellSurfaceItem::adjustOffsetForNextFrame); } /*! * \internal */ -void QWaylandQuickShellSurfaceItem::componentComplete() +void QWaylandQuickWlShellSurfaceItem::componentComplete() { - Q_D(QWaylandQuickShellSurfaceItem); + Q_D(QWaylandQuickWlShellSurfaceItem); if (!d->shellSurface) - setShellSurface(new QWaylandShellSurface()); + setShellSurface(new QWaylandWlShellSurface()); QWaylandQuickItem::componentComplete(); } diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.h b/src/compositor/extensions/qwaylandquickwlshellsurfaceitem.h index f65172690..626926f85 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.h +++ b/src/compositor/extensions/qwaylandquickwlshellsurfaceitem.h @@ -34,31 +34,31 @@ ** ****************************************************************************/ -#ifndef QWAYLANDQUICKSHELLSURFACEITEM_H -#define QWAYLANDQUICKSHELLSURFACEITEM_H +#ifndef QWAYLANDQUICKWLSHELLSURFACEITEM_H +#define QWAYLANDQUICKWLSHELLSURFACEITEM_H #include <QtWaylandCompositor/QWaylandExtension> #include <QtWaylandCompositor/QWaylandQuickItem> -#include <QtWaylandCompositor/QWaylandShellSurface> +#include <QtWaylandCompositor/QWaylandWlShellSurface> QT_BEGIN_NAMESPACE -class QWaylandQuickShellSurfaceItemPrivate; +class QWaylandQuickWlShellSurfaceItemPrivate; -class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellSurfaceItem : public QWaylandQuickItem +class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickWlShellSurfaceItem : public QWaylandQuickItem { Q_OBJECT - Q_DECLARE_PRIVATE(QWaylandQuickShellSurfaceItem) - Q_PROPERTY(QWaylandShellSurface *shellSurface READ shellSurface WRITE setShellSurface NOTIFY shellSurfaceChanged) + Q_DECLARE_PRIVATE(QWaylandQuickWlShellSurfaceItem) + Q_PROPERTY(QWaylandWlShellSurface *shellSurface READ shellSurface WRITE setShellSurface NOTIFY shellSurfaceChanged) Q_PROPERTY(QQuickItem *moveItem READ moveItem WRITE setMoveItem NOTIFY moveItemChanged) public: - QWaylandQuickShellSurfaceItem(QQuickItem *parent = 0); + QWaylandQuickWlShellSurfaceItem(QQuickItem *parent = 0); - static QWaylandQuickShellSurfaceItemPrivate *get(QWaylandQuickShellSurfaceItem *item) { return item->d_func(); } + static QWaylandQuickWlShellSurfaceItemPrivate *get(QWaylandQuickWlShellSurfaceItem *item) { return item->d_func(); } - QWaylandShellSurface *shellSurface() const; - void setShellSurface(QWaylandShellSurface *shellSurface); + QWaylandWlShellSurface *shellSurface() const; + void setShellSurface(QWaylandWlShellSurface *shellSurface); QQuickItem *moveItem() const; void setMoveItem(QQuickItem *moveItem); @@ -68,10 +68,10 @@ Q_SIGNALS: private Q_SLOTS: void handleStartMove(QWaylandInputDevice *inputDevice); - void handleStartResize(QWaylandInputDevice *inputDevice, QWaylandShellSurface::ResizeEdge edges); + void handleStartResize(QWaylandInputDevice *inputDevice, QWaylandWlShellSurface::ResizeEdge edges); void adjustOffsetForNextFrame(const QPointF &offset); protected: - QWaylandQuickShellSurfaceItem(QWaylandQuickShellSurfaceItemPrivate &dd, QQuickItem *parent); + QWaylandQuickWlShellSurfaceItem(QWaylandQuickWlShellSurfaceItemPrivate &dd, QQuickItem *parent); void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; @@ -83,4 +83,4 @@ protected: QT_END_NAMESPACE -#endif /*QWAYLANDQUICKSHELLSURFACEITEM_H*/ +#endif /*QWAYLANDQUICKWLSHELLSURFACEITEM_H*/ diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h b/src/compositor/extensions/qwaylandquickwlshellsurfaceitem_p.h index 22e0d8a6c..3e6834771 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h +++ b/src/compositor/extensions/qwaylandquickwlshellsurfaceitem_p.h @@ -34,8 +34,8 @@ ** ****************************************************************************/ -#ifndef QWAYLANDQUICKSHELLSURFACEITEM_P_H -#define QWAYLANDQUICKSHELLSURFACEITEM_P_H +#ifndef QWAYLANDQUICKWLSHELLSURFACEITEM_P_H +#define QWAYLANDQUICKWLSHELLSURFACEITEM_P_H #include <QtWaylandCompositor/private/qwaylandquickitem_p.h> @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE // We mean it. // -class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellSurfaceItemPrivate : public QWaylandQuickItemPrivate +class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickWlShellSurfaceItemPrivate : public QWaylandQuickItemPrivate { public: enum GrabberState { @@ -61,14 +61,14 @@ public: MoveState }; - QWaylandQuickShellSurfaceItemPrivate() + QWaylandQuickWlShellSurfaceItemPrivate() : QWaylandQuickItemPrivate() , shellSurface(Q_NULLPTR) , moveItem(Q_NULLPTR) , grabberState(DefaultState) {} - QWaylandShellSurface *shellSurface; + QWaylandWlShellSurface *shellSurface; QQuickItem *moveItem; GrabberState grabberState; @@ -80,7 +80,7 @@ public: struct { QWaylandInputDevice *inputDevice; - QWaylandShellSurface::ResizeEdge resizeEdges; + QWaylandWlShellSurface::ResizeEdge resizeEdges; QSizeF initialSize; QPointF initialMousePos; bool initialized; @@ -89,4 +89,4 @@ public: QT_END_NAMESPACE -#endif /*QWAYLANDQUICKSHELLSURFACEITEM_P_H*/ +#endif /*QWAYLANDQUICKWLSHELLSURFACEITEM_P_H*/ diff --git a/src/compositor/extensions/qwaylandshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index 7965c9c6c..c6d13b392 100644 --- a/src/compositor/extensions/qwaylandshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -35,8 +35,8 @@ ** ****************************************************************************/ -#include "qwaylandshell.h" -#include "qwaylandshell_p.h" +#include "qwaylandwlshell.h" +#include "qwaylandwlshell_p.h" #include <QtWaylandCompositor/QWaylandCompositor> #include <QtWaylandCompositor/QWaylandView> @@ -48,17 +48,17 @@ QT_BEGIN_NAMESPACE -QWaylandSurfaceRole QWaylandShellSurfacePrivate::s_role("wl_shell_surface"); +QWaylandSurfaceRole QWaylandWlShellSurfacePrivate::s_role("wl_shell_surface"); -QWaylandShellPrivate::QWaylandShellPrivate() +QWaylandWlShellPrivate::QWaylandWlShellPrivate() : QWaylandExtensionTemplatePrivate() , wl_shell() { } -void QWaylandShellPrivate::shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface_res) +void QWaylandWlShellPrivate::shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface_res) { - Q_Q(QWaylandShell); + Q_Q(QWaylandWlShell); QWaylandSurface *surface = QWaylandSurface::fromResource(surface_res); wl_resource *res = wl_resource_create(resource->client(), &wl_shell_surface_interface, @@ -71,70 +71,70 @@ void QWaylandShellPrivate::shell_get_shell_surface(Resource *resource, uint32_t // However we're still using wayland 1.4, which doesn't have interface specific role // errors, so the best we can do is to use wl_display's object_id error. wl_resource *displayRes = wl_client_get_object(resource->client(), 1); - if (surface->setRole(QWaylandShellSurface::role(), displayRes, WL_DISPLAY_ERROR_INVALID_OBJECT)) + if (surface->setRole(QWaylandWlShellSurface::role(), displayRes, WL_DISPLAY_ERROR_INVALID_OBJECT)) emit q->createShellSurface(surface, QWaylandResource(res)); } -QWaylandShellSurfacePrivate::QWaylandShellSurfacePrivate() +QWaylandWlShellSurfacePrivate::QWaylandWlShellSurfacePrivate() : QWaylandExtensionTemplatePrivate() , wl_shell_surface() , m_shell(Q_NULLPTR) , m_surface(Q_NULLPTR) - , m_focusPolicy(QWaylandShellSurface::DefaultFocus) + , m_focusPolicy(QWaylandWlShellSurface::DefaultFocus) { } -QWaylandShellSurfacePrivate::~QWaylandShellSurfacePrivate() +QWaylandWlShellSurfacePrivate::~QWaylandWlShellSurfacePrivate() { } -void QWaylandShellSurfacePrivate::ping(uint32_t serial) +void QWaylandWlShellSurfacePrivate::ping(uint32_t serial) { m_pings.insert(serial); send_ping(serial); } -void QWaylandShellSurfacePrivate::shell_surface_destroy_resource(Resource *) +void QWaylandWlShellSurfacePrivate::shell_surface_destroy_resource(Resource *) { - Q_Q(QWaylandShellSurface); + Q_Q(QWaylandWlShellSurface); delete q; } -void QWaylandShellSurfacePrivate::shell_surface_move(Resource *resource, +void QWaylandWlShellSurfacePrivate::shell_surface_move(Resource *resource, struct wl_resource *input_device_super, uint32_t serial) { Q_UNUSED(resource); Q_UNUSED(serial); - Q_Q(QWaylandShellSurface); + Q_Q(QWaylandWlShellSurface); QWaylandInputDevice *input_device = QWaylandInputDevice::fromSeatResource(input_device_super); emit q->startMove(input_device); } -void QWaylandShellSurfacePrivate::shell_surface_resize(Resource *resource, +void QWaylandWlShellSurfacePrivate::shell_surface_resize(Resource *resource, struct wl_resource *input_device_super, uint32_t serial, uint32_t edges) { Q_UNUSED(resource); Q_UNUSED(serial); - Q_Q(QWaylandShellSurface); + Q_Q(QWaylandWlShellSurface); QWaylandInputDevice *input_device = QWaylandInputDevice::fromSeatResource(input_device_super); - emit q->startResize(input_device, QWaylandShellSurface::ResizeEdge(edges)); + emit q->startResize(input_device, QWaylandWlShellSurface::ResizeEdge(edges)); } -void QWaylandShellSurfacePrivate::shell_surface_set_toplevel(Resource *resource) +void QWaylandWlShellSurfacePrivate::shell_surface_set_toplevel(Resource *resource) { Q_UNUSED(resource); - Q_Q(QWaylandShellSurface); - setFocusPolicy(QWaylandShellSurface::DefaultFocus); + Q_Q(QWaylandWlShellSurface); + setFocusPolicy(QWaylandWlShellSurface::DefaultFocus); emit q->setDefaultToplevel(); } -void QWaylandShellSurfacePrivate::shell_surface_set_transient(Resource *resource, +void QWaylandWlShellSurfacePrivate::shell_surface_set_transient(Resource *resource, struct wl_resource *parent_surface_resource, int x, int y, @@ -142,16 +142,16 @@ void QWaylandShellSurfacePrivate::shell_surface_set_transient(Resource *resource { Q_UNUSED(resource); - Q_Q(QWaylandShellSurface); + Q_Q(QWaylandWlShellSurface); QWaylandSurface *parent_surface = QWaylandSurface::fromResource(parent_surface_resource); - QWaylandShellSurface::FocusPolicy focusPolicy = - flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE ? QWaylandShellSurface::NoKeyboardFocus - : QWaylandShellSurface::DefaultFocus; + QWaylandWlShellSurface::FocusPolicy focusPolicy = + flags & WL_SHELL_SURFACE_TRANSIENT_INACTIVE ? QWaylandWlShellSurface::NoKeyboardFocus + : QWaylandWlShellSurface::DefaultFocus; setFocusPolicy(focusPolicy); emit q->setTransient(parent_surface, QPoint(x,y), focusPolicy); } -void QWaylandShellSurfacePrivate::shell_surface_set_fullscreen(Resource *resource, +void QWaylandWlShellSurfacePrivate::shell_surface_set_fullscreen(Resource *resource, uint32_t method, uint32_t framerate, struct wl_resource *output_resource) @@ -159,91 +159,91 @@ void QWaylandShellSurfacePrivate::shell_surface_set_fullscreen(Resource *resourc Q_UNUSED(resource); Q_UNUSED(method); Q_UNUSED(framerate); - Q_Q(QWaylandShellSurface); - setFocusPolicy(QWaylandShellSurface::DefaultFocus); + Q_Q(QWaylandWlShellSurface); + setFocusPolicy(QWaylandWlShellSurface::DefaultFocus); QWaylandOutput *output = output_resource ? QWaylandOutput::fromResource(output_resource) : Q_NULLPTR; - emit q->setFullScreen(QWaylandShellSurface::FullScreenMethod(method), framerate, output); + emit q->setFullScreen(QWaylandWlShellSurface::FullScreenMethod(method), framerate, output); } -void QWaylandShellSurfacePrivate::shell_surface_set_popup(Resource *resource, wl_resource *input_device, uint32_t serial, wl_resource *parent, int32_t x, int32_t y, uint32_t flags) +void QWaylandWlShellSurfacePrivate::shell_surface_set_popup(Resource *resource, wl_resource *input_device, uint32_t serial, wl_resource *parent, int32_t x, int32_t y, uint32_t flags) { Q_UNUSED(resource); Q_UNUSED(serial); Q_UNUSED(flags); - Q_Q(QWaylandShellSurface); - setFocusPolicy(QWaylandShellSurface::DefaultFocus); + Q_Q(QWaylandWlShellSurface); + setFocusPolicy(QWaylandWlShellSurface::DefaultFocus); QWaylandInputDevice *input = QWaylandInputDevice::fromSeatResource(input_device); QWaylandSurface *parentSurface = QWaylandSurface::fromResource(parent); emit q->setPopup(input, parentSurface, QPoint(x,y)); } -void QWaylandShellSurfacePrivate::shell_surface_set_maximized(Resource *resource, +void QWaylandWlShellSurfacePrivate::shell_surface_set_maximized(Resource *resource, struct wl_resource *output_resource) { Q_UNUSED(resource); - Q_Q(QWaylandShellSurface); - setFocusPolicy(QWaylandShellSurface::DefaultFocus); + Q_Q(QWaylandWlShellSurface); + setFocusPolicy(QWaylandWlShellSurface::DefaultFocus); QWaylandOutput *output = output_resource ? QWaylandOutput::fromResource(output_resource) : Q_NULLPTR; emit q->setMaximized(output); } -void QWaylandShellSurfacePrivate::shell_surface_pong(Resource *resource, +void QWaylandWlShellSurfacePrivate::shell_surface_pong(Resource *resource, uint32_t serial) { Q_UNUSED(resource); - Q_Q(QWaylandShellSurface); + Q_Q(QWaylandWlShellSurface); if (m_pings.remove(serial)) emit q->pong(); else qWarning("Received an unexpected pong!"); } -void QWaylandShellSurfacePrivate::shell_surface_set_title(Resource *resource, +void QWaylandWlShellSurfacePrivate::shell_surface_set_title(Resource *resource, const QString &title) { Q_UNUSED(resource); if (title == m_title) return; - Q_Q(QWaylandShellSurface); + Q_Q(QWaylandWlShellSurface); m_title = title; emit q->titleChanged(); } -void QWaylandShellSurfacePrivate::shell_surface_set_class(Resource *resource, +void QWaylandWlShellSurfacePrivate::shell_surface_set_class(Resource *resource, const QString &className) { Q_UNUSED(resource); if (className == m_className) return; - Q_Q(QWaylandShellSurface); + Q_Q(QWaylandWlShellSurface); m_className = className; emit q->classNameChanged(); } /*! - * \qmltype Shell + * \qmltype WlShell * \inqmlmodule QtWayland.Compositor * \brief Extension for desktop-style user interfaces. * - * The Shell extension provides a way to assiociate a \l{ShellSurface} + * The WlShell extension provides a way to assiociate a \l{ShellSurface} * with a regular Wayland surface. Using the shell surface interface, the client * can request that the surface is resized, moved, and so on. * - * Shell corresponds to the Wayland interface wl_shell. + * WlShell corresponds to the Wayland interface wl_shell. * * To provide the functionality of the shell extension in a compositor, create - * an instance of the Shell component and add it to the list of extensions + * an instance of the WlShell component and add it to the list of extensions * supported by the compositor: * \code * import QtWayland.Compositor 1.0 * * WaylandCompositor { - * extensions: Shell { + * extensions: WlShell { * // ... * } * } @@ -251,66 +251,66 @@ void QWaylandShellSurfacePrivate::shell_surface_set_class(Resource *resource, */ /*! - * \class QWaylandShell + * \class QWaylandWlShell * \inmodule QtWaylandCompositor * \brief Extension for desktop-style user interfaces. * - * The QWaylandShell extension provides a way to assiociate a QWaylandShellSurface with + * The QWaylandWlShell extension provides a way to assiociate a QWaylandWlShellSurface with * a regular Wayland surface. Using the shell surface interface, the client * can request that the surface is resized, moved, and so on. * - * Shell corresponds to the Wayland interface wl_shell. + * WlShell corresponds to the Wayland interface wl_shell. */ /*! - * Constructs a QWaylandShell object. + * Constructs a QWaylandWlShell object. */ -QWaylandShell::QWaylandShell() - : QWaylandExtensionTemplate<QWaylandShell>(*new QWaylandShellPrivate()) +QWaylandWlShell::QWaylandWlShell() + : QWaylandExtensionTemplate<QWaylandWlShell>(*new QWaylandWlShellPrivate()) { } /*! - * Constructs a QWaylandShell object for the provided \a compositor. + * Constructs a QWaylandWlShell object for the provided \a compositor. */ -QWaylandShell::QWaylandShell(QWaylandCompositor *compositor) - : QWaylandExtensionTemplate<QWaylandShell>(compositor, *new QWaylandShellPrivate()) +QWaylandWlShell::QWaylandWlShell(QWaylandCompositor *compositor) + : QWaylandExtensionTemplate<QWaylandWlShell>(compositor, *new QWaylandWlShellPrivate()) { } /*! - * Initializes the shell extension. + * Initializes the WlShell extension. */ -void QWaylandShell::initialize() +void QWaylandWlShell::initialize() { - Q_D(QWaylandShell); + Q_D(QWaylandWlShell); QWaylandExtensionTemplate::initialize(); QWaylandCompositor *compositor = static_cast<QWaylandCompositor *>(extensionContainer()); if (!compositor) { - qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandShell"; + qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandWlShell"; return; } d->init(compositor->display(), 1); } /*! - * Returns the Wayland interface for the QWaylandShell. + * Returns the Wayland interface for the QWaylandWlShell. */ -const struct wl_interface *QWaylandShell::interface() +const struct wl_interface *QWaylandWlShell::interface() { - return QWaylandShellPrivate::interface(); + return QWaylandWlShellPrivate::interface(); } /*! - * \qmlsignal void QtWaylandCompositor::Shell::createShellSurface(object surface, object client, int id) + * \qmlsignal void QtWaylandCompositor::WlShell::createShellSurface(object surface, object client, int id) * - * This signal is emitted when the \a client has requested a shell surface to be associated + * This signal is emitted when the \a client has requested a wl_shell_surface to be associated * with \a surface and be assigned the given \a id. The handler for this signal is * expected to create the shell surface and initialize it within the scope of the * signal emission. */ /*! - * \fn void QWaylandShell::createShellSurface(QWaylandSurface *surface, QWaylandClient *client, uint id) + * \fn void QWaylandWlShell::createShellSurface(QWaylandSurface *surface, QWaylandClient *client, uint id) * * This signal is emitted when the \a client has requested a shell surface to be associated * with \a surface and be assigned the given \a id. The handler for this signal is @@ -321,17 +321,17 @@ const struct wl_interface *QWaylandShell::interface() /*! * \internal */ -QByteArray QWaylandShell::interfaceName() +QByteArray QWaylandWlShell::interfaceName() { - return QWaylandShellPrivate::interfaceName(); + return QWaylandWlShellPrivate::interfaceName(); } /*! - * \qmltype ShellSurface + * \qmltype WlShellSurface * \inqmlmodule QtWayland.Compositor - * \brief A shell surface providing desktop-style compositor-specific features to a surface. + * \brief A wl_shell_surface providing desktop-style compositor-specific features to a surface. * - * This type is part of the \l{Shell} extension and provides a way to extend + * This type is part of the \l{WlShell} extension and provides a way to extend * the functionality of an existing WaylandSurface with features specific to desktop-style * compositors, such as resizing and moving the surface. * @@ -339,11 +339,11 @@ QByteArray QWaylandShell::interfaceName() */ /*! - * \class QWaylandShellSurface + * \class QWaylandWlShellSurface * \inmodule QtWaylandCompositor * \brief A shell surface providing desktop-style compositor-specific features to a surface. * - * This class is part of the QWaylandShell extension and provides a way to extend + * This class is part of the QWaylandWlShell extension and provides a way to extend * the functionality of an existing QWaylandSurface with features specific to desktop-style * compositors, such as resizing and moving the surface. * @@ -351,34 +351,34 @@ QByteArray QWaylandShell::interfaceName() */ /*! - * Constructs a QWaylandShellSurface. + * Constructs a QWaylandWlShellSurface. */ -QWaylandShellSurface::QWaylandShellSurface() - : QWaylandExtensionTemplate<QWaylandShellSurface>(*new QWaylandShellSurfacePrivate) +QWaylandWlShellSurface::QWaylandWlShellSurface() + : QWaylandExtensionTemplate<QWaylandWlShellSurface>(*new QWaylandWlShellSurfacePrivate) { } /*! - * Constructs a QWaylandShellSurface for \a surface and initializes it with the given \a shell and \a resource. + * Constructs a QWaylandWlShellSurface for \a surface and initializes it with the given \a shell and \a resource. */ -QWaylandShellSurface::QWaylandShellSurface(QWaylandShell *shell, QWaylandSurface *surface, const QWaylandResource &res) - : QWaylandExtensionTemplate<QWaylandShellSurface>(*new QWaylandShellSurfacePrivate) +QWaylandWlShellSurface::QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &res) + : QWaylandExtensionTemplate<QWaylandWlShellSurface>(*new QWaylandWlShellSurfacePrivate) { initialize(shell, surface, res); } /*! - * \qmlmethod void QtWaylandCompositor::ShellSurface::initialize(object shell, object surface, object client, int id) + * \qmlmethod void QtWaylandCompositor::WlShellSurface::initialize(object shell, object surface, object client, int id) * - * Initializes the ShellSurface, associating it with the given \a shell, \a surface, \a client, and \a id. + * Initializes the WlShellSurface, associating it with the given \a shell, \a surface, \a client, and \a id. */ /*! - * Initializes the QWaylandShellSurface, associating it with the given \a shell, \a surface and \a resource. + * Initializes the QWaylandWlShellSurface, associating it with the given \a shell, \a surface and \a resource. */ -void QWaylandShellSurface::initialize(QWaylandShell *shell, QWaylandSurface *surface, const QWaylandResource &resource) +void QWaylandWlShellSurface::initialize(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource) { - Q_D(QWaylandShellSurface); + Q_D(QWaylandWlShellSurface); d->m_shell = shell; d->m_surface = surface; d->init(resource.resource()); @@ -390,25 +390,25 @@ void QWaylandShellSurface::initialize(QWaylandShell *shell, QWaylandSurface *sur /*! * \internal */ -void QWaylandShellSurface::initialize() +void QWaylandWlShellSurface::initialize() { QWaylandExtensionTemplate::initialize(); } -const struct wl_interface *QWaylandShellSurface::interface() +const struct wl_interface *QWaylandWlShellSurface::interface() { - return QWaylandShellSurfacePrivate::interface(); + return QWaylandWlShellSurfacePrivate::interface(); } /*! * \internal */ -QByteArray QWaylandShellSurface::interfaceName() +QByteArray QWaylandWlShellSurface::interfaceName() { - return QWaylandShellSurfacePrivate::interfaceName(); + return QWaylandWlShellSurfacePrivate::interfaceName(); } -QSize QWaylandShellSurface::sizeForResize(const QSizeF &size, const QPointF &delta, QWaylandShellSurface::ResizeEdge edge) +QSize QWaylandWlShellSurface::sizeForResize(const QSizeF &size, const QPointF &delta, QWaylandWlShellSurface::ResizeEdge edge) { qreal width = size.width(); qreal height = size.height(); @@ -426,7 +426,7 @@ QSize QWaylandShellSurface::sizeForResize(const QSizeF &size, const QPointF &del } /*! - * \enum QWaylandShellSurface::ResizeEdge + * \enum QWaylandWlShellSurface::ResizeEdge * * This enum type provides a way to specify a specific edge or corner of * the surface. @@ -443,7 +443,7 @@ QSize QWaylandShellSurface::sizeForResize(const QSizeF &size, const QPointF &del */ /*! - * \qmlmethod void QtWaylandCompositor::ShellSurface::sendConfigure(size size, enum edges) + * \qmlmethod void QtWaylandCompositor::WlShellSurface::sendConfigure(size size, enum edges) * * Sends a configure event to the client, suggesting that it resize its surface to * the provided \a size. The \a edges provide a hint about how the surface @@ -455,14 +455,14 @@ QSize QWaylandShellSurface::sizeForResize(const QSizeF &size, const QPointF &del * the provided \a size. The \a edges provide a hint about how the surface * was resized. */ -void QWaylandShellSurface::sendConfigure(const QSize &size, ResizeEdge edges) +void QWaylandWlShellSurface::sendConfigure(const QSize &size, ResizeEdge edges) { - Q_D(QWaylandShellSurface); + Q_D(QWaylandWlShellSurface); d->send_configure(edges, size.width(), size.height()); } /*! - * \qmlmethod void QtWaylandCompositor::ShellSurface::sendPopupDone() + * \qmlmethod void QtWaylandCompositor::WlShellSurface::sendPopupDone() * * Sends a popup_done event to the client to indicate that the user has clicked * somewhere outside the client's surfaces. @@ -472,31 +472,31 @@ void QWaylandShellSurface::sendConfigure(const QSize &size, ResizeEdge edges) * Sends a popup_done event to the client to indicate that the user has clicked * somewhere outside the client's surfaces. */ -void QWaylandShellSurface::sendPopupDone() +void QWaylandWlShellSurface::sendPopupDone() { - Q_D(QWaylandShellSurface); + Q_D(QWaylandWlShellSurface); d->send_popup_done(); } /*! - * \qmlproperty object QtWaylandCompositor::ShellSurface::surface + * \qmlproperty object QtWaylandCompositor::WlShellSurface::surface * - * This property holds the surface associated with this ShellSurface. + * This property holds the wl_surface associated with this WlShellSurface. */ /*! - * \property QWaylandShellSurface::surface + * \property QWaylandWlShellSurface::surface * - * This property holds the surface associated with this QWaylandShellSurface. + * This property holds the surface associated with this QWaylandWlShellSurface. */ -QWaylandSurface *QWaylandShellSurface::surface() const +QWaylandSurface *QWaylandWlShellSurface::surface() const { - Q_D(const QWaylandShellSurface); + Q_D(const QWaylandWlShellSurface); return d->m_surface; } /*! - * \enum QWaylandShellSurface::FocusPolicy + * \enum QWaylandWlShellSurface::FocusPolicy * * This enum type is used to specify the focus policy of a shell surface. * @@ -505,63 +505,63 @@ QWaylandSurface *QWaylandShellSurface::surface() const */ /*! - * \qmlproperty enum QtWaylandCompositor::ShellSurface::focusPolicy + * \qmlproperty enum QtWaylandCompositor::WlShellSurface::focusPolicy * - * This property holds the focus policy of the ShellSurface. + * This property holds the focus policy of the WlShellSurface. */ /*! - * \property QWaylandShellSurface::focusPolicy + * \property QWaylandWlShellSurface::focusPolicy * - * This property holds the focus policy of the QWaylandShellSurface. + * This property holds the focus policy of the QWaylandWlShellSurface. */ -QWaylandShellSurface::FocusPolicy QWaylandShellSurface::focusPolicy() const +QWaylandWlShellSurface::FocusPolicy QWaylandWlShellSurface::focusPolicy() const { - Q_D(const QWaylandShellSurface); + Q_D(const QWaylandWlShellSurface); return d->m_focusPolicy; } /*! - * \qmlproperty string QtWaylandCompositor::ShellSurface::title + * \qmlproperty string QtWaylandCompositor::WlShellSurface::title * - * This property holds the title of the ShellSurface. + * This property holds the title of the WlShellSurface. */ /*! - * \property QWaylandShellSurface::title + * \property QWaylandWlShellSurface::title * - * This property holds the title of the QWaylandShellSurface. + * This property holds the title of the QWaylandWlShellSurface. */ -QString QWaylandShellSurface::title() const +QString QWaylandWlShellSurface::title() const { - Q_D(const QWaylandShellSurface); + Q_D(const QWaylandWlShellSurface); return d->m_title; } /*! - * \qmlproperty string QtWaylandCompositor::ShellSurface::className + * \qmlproperty string QtWaylandCompositor::WlShellSurface::className * - * This property holds the class name of the ShellSurface. + * This property holds the class name of the WlShellSurface. */ /*! - * \property QWaylandShellSurface::className + * \property QWaylandWlShellSurface::className * - * This property holds the class name of the QWaylandShellSurface. + * This property holds the class name of the QWaylandWlShellSurface. */ -QString QWaylandShellSurface::className() const +QString QWaylandWlShellSurface::className() const { - Q_D(const QWaylandShellSurface); + Q_D(const QWaylandWlShellSurface); return d->m_className; } -QWaylandSurfaceRole *QWaylandShellSurface::role() +QWaylandSurfaceRole *QWaylandWlShellSurface::role() { - return &QWaylandShellSurfacePrivate::s_role; + return &QWaylandWlShellSurfacePrivate::s_role; } /*! - * \qmlmethod void QtWaylandCompositor::ShellSurface::ping() + * \qmlmethod void QtWaylandCompositor::WlShellSurface::ping() * * Sends a ping event to the client. If the client replies to the event the \a pong * signal will be emitted. @@ -571,21 +571,21 @@ QWaylandSurfaceRole *QWaylandShellSurface::role() * Sends a ping event to the client. If the client replies to the event the \a pong * signal will be emitted. */ -void QWaylandShellSurface::ping() +void QWaylandWlShellSurface::ping() { - Q_D(QWaylandShellSurface); + Q_D(QWaylandWlShellSurface); uint32_t serial = d->m_surface->compositor()->nextSerial(); d->ping(serial); } /*! - * Returns the QWaylandShellSurface object associated with the given \a resource, or null if no such object exists. + * Returns the QWaylandWlShellSurface object associated with the given \a resource, or null if no such object exists. */ -QWaylandShellSurface *QWaylandShellSurface::fromResource(wl_resource *resource) +QWaylandWlShellSurface *QWaylandWlShellSurface::fromResource(wl_resource *resource) { - QWaylandShellSurfacePrivate::Resource *res = QWaylandShellSurfacePrivate::Resource::fromResource(resource); + QWaylandWlShellSurfacePrivate::Resource *res = QWaylandWlShellSurfacePrivate::Resource::fromResource(resource); if (res) - return static_cast<QWaylandShellSurfacePrivate *>(res->shell_surface_object)->q_func(); + return static_cast<QWaylandWlShellSurfacePrivate *>(res->shell_surface_object)->q_func(); return 0; } diff --git a/src/compositor/extensions/qwaylandshell.h b/src/compositor/extensions/qwaylandwlshell.h index 5fec80ffc..2420f4cd0 100644 --- a/src/compositor/extensions/qwaylandshell.h +++ b/src/compositor/extensions/qwaylandwlshell.h @@ -34,8 +34,8 @@ ** ****************************************************************************/ -#ifndef QWAYLANDSHELL_H -#define QWAYLANDSHELL_H +#ifndef QWAYLANDWLSHELL_H +#define QWAYLANDWLSHELL_H #include <QtWaylandCompositor/QWaylandExtension> #include <QtWaylandCompositor/QWaylandResource> @@ -44,21 +44,21 @@ QT_BEGIN_NAMESPACE -class QWaylandShellPrivate; -class QWaylandShellSurfacePrivate; +class QWaylandWlShellPrivate; +class QWaylandWlShellSurfacePrivate; class QWaylandSurface; class QWaylandClient; class QWaylandInputDevice; class QWaylandOutput; class QWaylandSurfaceRole; -class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShell : public QWaylandExtensionTemplate<QWaylandShell> +class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWlShell : public QWaylandExtensionTemplate<QWaylandWlShell> { Q_OBJECT - Q_DECLARE_PRIVATE(QWaylandShell) + Q_DECLARE_PRIVATE(QWaylandWlShell) public: - QWaylandShell(); - QWaylandShell(QWaylandCompositor *compositor); + QWaylandWlShell(); + QWaylandWlShell(QWaylandCompositor *compositor); void initialize() Q_DECL_OVERRIDE; @@ -69,10 +69,10 @@ Q_SIGNALS: void createShellSurface(QWaylandSurface *surface, const QWaylandResource &resource); }; -class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShellSurface : public QWaylandExtensionTemplate<QWaylandShellSurface> +class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWlShellSurface : public QWaylandExtensionTemplate<QWaylandWlShellSurface> { Q_OBJECT - Q_DECLARE_PRIVATE(QWaylandShellSurface) + Q_DECLARE_PRIVATE(QWaylandWlShellSurface) Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged) Q_PROPERTY(QString title READ title NOTIFY titleChanged) Q_PROPERTY(QString className READ className NOTIFY classNameChanged) @@ -106,10 +106,10 @@ public: }; Q_ENUM(FocusPolicy) - QWaylandShellSurface(); - QWaylandShellSurface(QWaylandShell *shell, QWaylandSurface *surface, const QWaylandResource &resource); + QWaylandWlShellSurface(); + QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource); - Q_INVOKABLE void initialize(QWaylandShell *shell, QWaylandSurface *surface, const QWaylandResource &resource); + Q_INVOKABLE void initialize(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource); QString title() const; QString className() const; @@ -122,7 +122,7 @@ public: static QByteArray interfaceName(); static QWaylandSurfaceRole *role(); - static QWaylandShellSurface *fromResource(wl_resource *res); + static QWaylandWlShellSurface *fromResource(wl_resource *res); Q_INVOKABLE QSize sizeForResize(const QSizeF &size, const QPointF &delta, ResizeEdge edges); Q_INVOKABLE void sendConfigure(const QSize &size, ResizeEdge edges); @@ -152,4 +152,4 @@ private: QT_END_NAMESPACE -#endif /*QWAYLANDSHELL_H*/ +#endif /*QWAYLANDWLSHELL_H*/ diff --git a/src/compositor/extensions/qwaylandshell_p.h b/src/compositor/extensions/qwaylandwlshell_p.h index bfa8c4004..8d7129fa8 100644 --- a/src/compositor/extensions/qwaylandshell_p.h +++ b/src/compositor/extensions/qwaylandwlshell_p.h @@ -34,13 +34,13 @@ ** ****************************************************************************/ -#ifndef QWAYLANDSHELL_P_H -#define QWAYLANDSHELL_P_H +#ifndef QWAYLANDWLSHELL_P_H +#define QWAYLANDWLSHELL_P_H #include <QtWaylandCompositor/qwaylandexport.h> #include <QtWaylandCompositor/qwaylandsurface.h> #include <QtWaylandCompositor/private/qwaylandextension_p.h> -#include <QtWaylandCompositor/QWaylandShellSurface> +#include <QtWaylandCompositor/QWaylandWlShellSurface> #include <QtWaylandCompositor/QWaylandInputDevice> #include <wayland-server.h> @@ -63,49 +63,49 @@ QT_BEGIN_NAMESPACE -class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShellPrivate +class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWlShellPrivate : public QWaylandExtensionTemplatePrivate , public QtWaylandServer::wl_shell { - Q_DECLARE_PUBLIC(QWaylandShell) + Q_DECLARE_PUBLIC(QWaylandWlShell) public: - QWaylandShellPrivate(); - static QWaylandShellPrivate *get(QWaylandShell *shell) { return shell->d_func(); } + QWaylandWlShellPrivate(); + static QWaylandWlShellPrivate *get(QWaylandWlShell *shell) { return shell->d_func(); } protected: void shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) Q_DECL_OVERRIDE; }; -class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShellSurfacePrivate +class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWlShellSurfacePrivate : public QWaylandExtensionTemplatePrivate , public QtWaylandServer::wl_shell_surface { - Q_DECLARE_PUBLIC(QWaylandShellSurface) + Q_DECLARE_PUBLIC(QWaylandWlShellSurface) public: - QWaylandShellSurfacePrivate(); - ~QWaylandShellSurfacePrivate(); + QWaylandWlShellSurfacePrivate(); + ~QWaylandWlShellSurfacePrivate(); - static QWaylandShellSurfacePrivate *get(QWaylandShellSurface *surface) { return surface->d_func(); } + static QWaylandWlShellSurfacePrivate *get(QWaylandWlShellSurface *surface) { return surface->d_func(); } void ping(uint32_t serial); - void setFocusPolicy(QWaylandShellSurface::FocusPolicy focusPolicy) + void setFocusPolicy(QWaylandWlShellSurface::FocusPolicy focusPolicy) { if (focusPolicy == m_focusPolicy) return; - Q_Q(QWaylandShellSurface); + Q_Q(QWaylandWlShellSurface); m_focusPolicy = focusPolicy; emit q->focusPolicyChanged(); } private: - QWaylandShell *m_shell; + QWaylandWlShell *m_shell; QWaylandSurface *m_surface; QSet<uint32_t> m_pings; QString m_title; QString m_className; - QWaylandShellSurface::FocusPolicy m_focusPolicy; + QWaylandWlShellSurface::FocusPolicy m_focusPolicy; void shell_surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; @@ -147,4 +147,4 @@ private: QT_END_NAMESPACE -#endif // QWAYLANDSHELL_P_H +#endif // QWAYLANDWLSHELL_P_H diff --git a/src/imports/compositor/plugins.qmltypes b/src/imports/compositor/plugins.qmltypes index f9f78463a..4fba02b13 100644 --- a/src/imports/compositor/plugins.qmltypes +++ b/src/imports/compositor/plugins.qmltypes @@ -214,15 +214,6 @@ Module { Method { name: "updateStarted" } } Component { - name: "QWaylandQuickShellSurfaceItem" - defaultProperty: "data" - prototype: "QWaylandQuickItem" - exports: ["QtWayland.Compositor/ShellSurfaceItem 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "shellSurface"; type: "QWaylandShellSurface"; isPointer: true } - Property { name: "moveItem"; type: "QQuickItem"; isPointer: true } - } - Component { name: "QWaylandQuickSurface" prototype: "QWaylandSurface" exports: ["QtWayland.Compositor/WaylandSurface 1.0"] @@ -231,13 +222,104 @@ Module { Property { name: "clientRenderingEnabled"; type: "bool" } } Component { + name: "QWaylandQuickWlShellSurfaceItem" + defaultProperty: "data" + prototype: "QWaylandQuickItem" + exports: ["QtWayland.Compositor/WlShellSurfaceItem 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "shellSurface"; type: "QWaylandWlShellSurface"; isPointer: true } + Property { name: "moveItem"; type: "QQuickItem"; isPointer: true } + } + Component { name: "QWaylandResource" exports: ["QtWayland.Compositor/WaylandResource 1.0"] isCreatable: false exportMetaObjectRevisions: [0] } Component { - name: "QWaylandShell" + name: "QWaylandSurface" + prototype: "QObject" + exports: ["QtWayland.Compositor/WaylandSurfaceBase 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "Origin" + values: { + "OriginTopLeft": 0, + "OriginBottomLeft": 1 + } + } + Property { name: "client"; type: "QWaylandClient"; isReadonly: true; isPointer: true } + Property { name: "size"; type: "QSize"; isReadonly: true } + Property { name: "contentOrientation"; type: "Qt::ScreenOrientation"; isReadonly: true } + Property { name: "origin"; type: "QWaylandSurface::Origin"; isReadonly: true } + Property { name: "isMapped"; type: "bool"; isReadonly: true } + Property { name: "cursorSurface"; type: "bool" } + Signal { name: "mappedChanged" } + Signal { + name: "damaged" + Parameter { name: "rect"; type: "QRegion" } + } + Signal { + name: "parentChanged" + Parameter { name: "newParent"; type: "QWaylandSurface"; isPointer: true } + Parameter { name: "oldParent"; type: "QWaylandSurface"; isPointer: true } + } + Signal { + name: "childAdded" + Parameter { name: "child"; type: "QWaylandSurface"; isPointer: true } + } + Signal { + name: "offsetForNextFrame" + Parameter { name: "offset"; type: "QPoint" } + } + Signal { name: "pong" } + Signal { name: "surfaceDestroyed" } + Signal { + name: "subsurfacePositionChanged" + Parameter { name: "position"; type: "QPoint" } + } + Signal { + name: "subsurfacePlaceAbove" + Parameter { name: "sibling"; type: "QWaylandSurface"; isPointer: true } + } + Signal { + name: "subsurfacePlaceBelow" + Parameter { name: "sibling"; type: "QWaylandSurface"; isPointer: true } + } + Signal { + name: "configure" + Parameter { name: "hasBuffer"; type: "bool" } + } + Signal { name: "redraw" } + Method { name: "updateSelection" } + Method { + name: "initialize" + Parameter { name: "compositor"; type: "QWaylandCompositor"; isPointer: true } + Parameter { name: "client"; type: "QWaylandClient"; isPointer: true } + Parameter { name: "id"; type: "uint" } + Parameter { name: "version"; type: "int" } + } + Method { name: "destroy" } + Method { name: "isDestroyed"; type: "bool" } + Method { name: "frameStarted" } + Method { name: "sendFrameCallbacks" } + } + Component { + name: "QWaylandView" + prototype: "QObject" + exports: ["QtWayland.Compositor/WaylandView 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "renderObject"; type: "QObject"; isReadonly: true; isPointer: true } + Property { name: "surface"; type: "QWaylandSurface"; isPointer: true } + Property { name: "output"; type: "QWaylandOutput"; isPointer: true } + Property { name: "bufferLock"; type: "bool" } + Property { name: "discardFrontBuffers"; type: "bool" } + Signal { name: "surfaceDestroyed" } + } + Component { + name: "QWaylandWlShell" prototype: "QWaylandExtension" Signal { name: "createShellSurface" @@ -246,17 +328,17 @@ Module { } } Component { - name: "QWaylandShellQuickData" + name: "QWaylandWlShellQuickData" defaultProperty: "data" - prototype: "QWaylandShell" - exports: ["QtWayland.Compositor/Shell 1.0"] + prototype: "QWaylandWlShell" + exports: ["QtWayland.Compositor/WlShell 1.0"] exportMetaObjectRevisions: [0] Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } } Component { - name: "QWaylandShellSurface" + name: "QWaylandWlShellSurface" prototype: "QWaylandExtension" - exports: ["QtWayland.Compositor/ShellSurfaceBase 1.0"] + exports: ["QtWayland.Compositor/WlShellSurfaceBase 1.0"] isCreatable: false exportMetaObjectRevisions: [0] Enum { @@ -329,7 +411,7 @@ Module { Method { name: "ping" } Method { name: "initialize" - Parameter { name: "shell"; type: "QWaylandShell"; isPointer: true } + Parameter { name: "shell"; type: "QWaylandWlShell"; isPointer: true } Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true } Parameter { name: "resource"; type: "QWaylandResource" } } @@ -348,96 +430,14 @@ Module { Method { name: "sendPopupDone" } } Component { - name: "QWaylandShellSurfaceQuickData" + name: "QWaylandWlShellSurfaceQuickData" defaultProperty: "data" - prototype: "QWaylandShellSurface" - exports: ["QtWayland.Compositor/ShellSurface 1.0"] + prototype: "QWaylandWlShellSurface" + exports: ["QtWayland.Compositor/WlShellSurface 1.0"] exportMetaObjectRevisions: [0] Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } } Component { - name: "QWaylandSurface" - prototype: "QObject" - exports: ["QtWayland.Compositor/WaylandSurfaceBase 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "Origin" - values: { - "OriginTopLeft": 0, - "OriginBottomLeft": 1 - } - } - Property { name: "client"; type: "QWaylandClient"; isReadonly: true; isPointer: true } - Property { name: "size"; type: "QSize"; isReadonly: true } - Property { name: "contentOrientation"; type: "Qt::ScreenOrientation"; isReadonly: true } - Property { name: "origin"; type: "QWaylandSurface::Origin"; isReadonly: true } - Property { name: "isMapped"; type: "bool"; isReadonly: true } - Property { name: "cursorSurface"; type: "bool" } - Signal { name: "mappedChanged" } - Signal { - name: "damaged" - Parameter { name: "rect"; type: "QRegion" } - } - Signal { - name: "parentChanged" - Parameter { name: "newParent"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "oldParent"; type: "QWaylandSurface"; isPointer: true } - } - Signal { - name: "childAdded" - Parameter { name: "child"; type: "QWaylandSurface"; isPointer: true } - } - Signal { - name: "offsetForNextFrame" - Parameter { name: "offset"; type: "QPoint" } - } - Signal { name: "pong" } - Signal { name: "surfaceDestroyed" } - Signal { - name: "subsurfacePositionChanged" - Parameter { name: "position"; type: "QPoint" } - } - Signal { - name: "subsurfacePlaceAbove" - Parameter { name: "sibling"; type: "QWaylandSurface"; isPointer: true } - } - Signal { - name: "subsurfacePlaceBelow" - Parameter { name: "sibling"; type: "QWaylandSurface"; isPointer: true } - } - Signal { - name: "configure" - Parameter { name: "hasBuffer"; type: "bool" } - } - Signal { name: "redraw" } - Method { name: "updateSelection" } - Method { - name: "initialize" - Parameter { name: "compositor"; type: "QWaylandCompositor"; isPointer: true } - Parameter { name: "client"; type: "QWaylandClient"; isPointer: true } - Parameter { name: "id"; type: "uint" } - Parameter { name: "version"; type: "int" } - } - Method { name: "destroy" } - Method { name: "isDestroyed"; type: "bool" } - Method { name: "frameStarted" } - Method { name: "sendFrameCallbacks" } - } - Component { - name: "QWaylandView" - prototype: "QObject" - exports: ["QtWayland.Compositor/WaylandView 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "renderObject"; type: "QObject"; isReadonly: true; isPointer: true } - Property { name: "surface"; type: "QWaylandSurface"; isPointer: true } - Property { name: "output"; type: "QWaylandOutput"; isPointer: true } - Property { name: "bufferLock"; type: "bool" } - Property { name: "discardFrontBuffers"; type: "bool" } - Signal { name: "surfaceDestroyed" } - } - Component { prototype: "QQuickItem" name: "QtWayland.Compositor/WaylandCursorItem 1.0" exports: ["QtWayland.Compositor/WaylandCursorItem 1.0"] diff --git a/src/imports/compositor/qwaylandquickcompositorplugin.cpp b/src/imports/compositor/qwaylandquickcompositorplugin.cpp index 6b1137178..7be257d37 100644 --- a/src/imports/compositor/qwaylandquickcompositorplugin.cpp +++ b/src/imports/compositor/qwaylandquickcompositorplugin.cpp @@ -47,10 +47,10 @@ #include <QtWaylandCompositor/QWaylandExtension> #include <QtWaylandCompositor/QWaylandQuickExtension> #include <QtWaylandCompositor/QWaylandInputDevice> -#include <QtWaylandCompositor/QWaylandQuickShellSurfaceItem> +#include <QtWaylandCompositor/QWaylandQuickWlShellSurfaceItem> #include <QtWaylandCompositor/QWaylandResource> -#include <QtWaylandCompositor/QWaylandShell> +#include <QtWaylandCompositor/QWaylandWlShell> #include <QtWaylandCompositor/qwaylandexport.h> #include "qwaylandmousetracker_p.h" @@ -58,8 +58,8 @@ QT_BEGIN_NAMESPACE Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandQuickCompositor) -Q_COMPOSITOR_DECLARE_QUICK_DATA_CLASS(QWaylandShell) -Q_COMPOSITOR_DECLARE_QUICK_DATA_CLASS(QWaylandShellSurface) +Q_COMPOSITOR_DECLARE_QUICK_DATA_CLASS(QWaylandWlShell) +Q_COMPOSITOR_DECLARE_QUICK_DATA_CLASS(QWaylandWlShellSurface) class QmlUrlResolver { @@ -135,13 +135,13 @@ public: qmlRegisterUncreatableType<QWaylandInputDevice>(uri, 1, 0, "WaylandInputDevice", QObject::tr("Cannot create instance of WaylandInputDevice")); qmlRegisterUncreatableType<QWaylandCompositor>(uri, 1, 0, "WaylandCompositorBase", QObject::tr("Cannot create instance of WaylandCompositorBase, use WaylandCompositor instead")); qmlRegisterUncreatableType<QWaylandSurface>(uri, 1, 0, "WaylandSurfaceBase", QObject::tr("Cannot create instance of WaylandSurfaceBase, use WaylandSurface instead")); - qmlRegisterUncreatableType<QWaylandShellSurface>(uri, 1, 0, "ShellSurfaceBase", QObject::tr("Cannot create instance of ShellSurfaceBase, use ShellSurface instead")); + qmlRegisterUncreatableType<QWaylandWlShellSurface>(uri, 1, 0, "WlShellSurfaceBase", QObject::tr("Cannot create instance of WlShellSurfaceBase, use WlShellSurface instead")); qmlRegisterUncreatableType<QWaylandResource>(uri, 1, 0, "WaylandResource", QObject::tr("Cannot create instance of WaylandResource")); //This should probably be somewhere else - qmlRegisterType<QWaylandShellQuickData>(uri, 1, 0, "Shell"); - qmlRegisterType<QWaylandShellSurfaceQuickData>(uri, 1, 0, "ShellSurface"); - qmlRegisterType<QWaylandQuickShellSurfaceItem>(uri, 1, 0, "ShellSurfaceItem"); + qmlRegisterType<QWaylandWlShellQuickData>(uri, 1, 0, "WlShell"); + qmlRegisterType<QWaylandWlShellSurfaceQuickData>(uri, 1, 0, "WlShellSurface"); + qmlRegisterType<QWaylandQuickWlShellSurfaceItem>(uri, 1, 0, "WlShellSurfaceItem"); } }; diff --git a/tests/auto/compositor/testcompositor.cpp b/tests/auto/compositor/testcompositor.cpp index d63e85c7c..d3b9ded9a 100644 --- a/tests/auto/compositor/testcompositor.cpp +++ b/tests/auto/compositor/testcompositor.cpp @@ -32,7 +32,7 @@ TestCompositor::TestCompositor(bool createInputDev) : QWaylandCompositor() - , shell(new QWaylandShell(this)) + , shell(new QWaylandWlShell(this)) , m_createInputDevice(createInputDev) { setSocketName("wayland-qt-test-0"); diff --git a/tests/auto/compositor/testcompositor.h b/tests/auto/compositor/testcompositor.h index affef7ec8..d0be1cec5 100644 --- a/tests/auto/compositor/testcompositor.h +++ b/tests/auto/compositor/testcompositor.h @@ -28,7 +28,7 @@ #include "qwaylandcompositor.h" #include "qwaylandsurface.h" -#include "qwaylandshell.h" +#include "qwaylandwlshell.h" class TestCompositor : public QWaylandCompositor { @@ -47,7 +47,7 @@ protected: public: QList<QWaylandSurface *> surfaces; - QWaylandShell* shell; + QWaylandWlShell* shell; bool m_createInputDevice; }; |