summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandwlshell.h
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 /src/compositor/extensions/qwaylandwlshell.h
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 'src/compositor/extensions/qwaylandwlshell.h')
-rw-r--r--src/compositor/extensions/qwaylandwlshell.h155
1 files changed, 155 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandwlshell.h b/src/compositor/extensions/qwaylandwlshell.h
new file mode 100644
index 000000000..2420f4cd0
--- /dev/null
+++ b/src/compositor/extensions/qwaylandwlshell.h
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDWLSHELL_H
+#define QWAYLANDWLSHELL_H
+
+#include <QtWaylandCompositor/QWaylandExtension>
+#include <QtWaylandCompositor/QWaylandResource>
+
+#include <QtCore/QSize>
+
+QT_BEGIN_NAMESPACE
+
+class QWaylandWlShellPrivate;
+class QWaylandWlShellSurfacePrivate;
+class QWaylandSurface;
+class QWaylandClient;
+class QWaylandInputDevice;
+class QWaylandOutput;
+class QWaylandSurfaceRole;
+
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWlShell : public QWaylandExtensionTemplate<QWaylandWlShell>
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QWaylandWlShell)
+public:
+ QWaylandWlShell();
+ QWaylandWlShell(QWaylandCompositor *compositor);
+
+ void initialize() Q_DECL_OVERRIDE;
+
+ static const struct wl_interface *interface();
+ static QByteArray interfaceName();
+
+Q_SIGNALS:
+ void createShellSurface(QWaylandSurface *surface, const QWaylandResource &resource);
+};
+
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWlShellSurface : public QWaylandExtensionTemplate<QWaylandWlShellSurface>
+{
+ Q_OBJECT
+ 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)
+ Q_PROPERTY(FocusPolicy focusPolicy READ focusPolicy NOTIFY focusPolicyChanged)
+
+public:
+ enum FullScreenMethod {
+ DefaultFullScreen,
+ ScaleFullScreen,
+ DriverFullScreen,
+ FillFullScreen
+ };
+ Q_ENUM(FullScreenMethod);
+
+ enum ResizeEdge {
+ NoneEdge = 0,
+ TopEdge = 1,
+ BottomEdge = 2,
+ LeftEdge = 4,
+ TopLeftEdge = 5,
+ BottomLeftEdge = 6,
+ RightEdge = 8,
+ TopRightEdge = 9,
+ BottomRightEdge = 10
+ };
+ Q_ENUM(ResizeEdge);
+
+ enum FocusPolicy{
+ DefaultFocus,
+ NoKeyboardFocus
+ };
+ Q_ENUM(FocusPolicy)
+
+ QWaylandWlShellSurface();
+ QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource);
+
+ Q_INVOKABLE void initialize(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource);
+
+ QString title() const;
+ QString className() const;
+
+ QWaylandSurface *surface() const;
+
+ FocusPolicy focusPolicy() const;
+
+ static const struct wl_interface *interface();
+ static QByteArray interfaceName();
+ static QWaylandSurfaceRole *role();
+
+ 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);
+ Q_INVOKABLE void sendPopupDone();
+
+public Q_SLOTS:
+ void ping();
+
+Q_SIGNALS:
+ void surfaceChanged();
+ void titleChanged();
+ void classNameChanged();
+ void focusPolicyChanged();
+ void pong();
+ void startMove(QWaylandInputDevice *inputDevice);
+ void startResize(QWaylandInputDevice *inputDevice, ResizeEdge edges);
+
+ void setDefaultToplevel();
+ void setTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, FocusPolicy focusPolicy);
+ void setFullScreen(FullScreenMethod method, uint framerate, QWaylandOutput *output);
+ void setPopup(QWaylandInputDevice *inputDevice, QWaylandSurface *parentSurface, const QPoint &relativeToParent);
+ void setMaximized(QWaylandOutput *output);
+
+private:
+ void initialize();
+};
+
+QT_END_NAMESPACE
+
+#endif /*QWAYLANDWLSHELL_H*/