summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@theqtcompany.com>2016-03-29 15:04:42 +0200
committerJohan Helsing <johan.helsing@theqtcompany.com>2016-04-05 14:05:28 +0000
commit465e6f559fccf04203997cdf5182693567a9e697 (patch)
treeca1c50eb8fd3a26e02d8a2b205d1775febb0859e /examples
parentac670666395882c60b512ff493b66d58a1ad6541 (diff)
Rename compositor Shell to WlShell
* QWaylandShell -> QWaylandWlShell * QWaylandShellSurface -> QWaylandWlShellSurface * QWaylandQuickShellSurfaceItem -> QWaylandQuickWlShellSurfaceItem * Shell -> WlShell (QML) * ShellSurface -> WlShellSurface (QML) * ShellSurfaceItem -> WlShellSurfaceItem (QML) This is done to avoid confusion with XdgShell and will hopefully help clarify that some of the examples only support wl_shell and not xdg_shell. Additionally, this makes "Shell" an available name in the compositor API, which may in turn enable the creation of a more general abstraction hiding the details of the shell backends (i.e. xdg_shell, wl_shell, and eventually ivi_shell). Change-Id: Iebac1f36505084bfaaea68838005d54db6c55e21 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/custom-extension/compositor/qml/main.qml4
-rw-r--r--examples/wayland/multi-output/qml/ShellChrome.qml4
-rw-r--r--examples/wayland/multi-output/qml/main.qml2
-rw-r--r--examples/wayland/pure-qml/qml/Chrome.qml4
-rw-r--r--examples/wayland/pure-qml/qml/main.qml2
-rw-r--r--examples/wayland/qwindow-compositor/windowcompositor.cpp48
-rw-r--r--examples/wayland/qwindow-compositor/windowcompositor.h20
7 files changed, 42 insertions, 42 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;