summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandshell.h
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-24 16:51:01 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-28 13:10:33 +0200
commitd2d70779224b067f6035f431319036054272ce65 (patch)
tree0ea297990553ff75cf82fb840d59dde903903dcd /src/compositor/extensions/qwaylandshell.h
parent88f821e189bd1d4d4550c1864f622ca7df2a7c34 (diff)
Make the default wl_shell available from QML
This finaly ties together how to use QWaylandQuickItems with different shells It was required to decouple QWaylandView from the QWaylandQuickItem since QML doesn't play to well with muliple inheritance. The QWaylandQuickItem can be retrieved from the QWaylandView which is now conveniently a QObject. Also the QWaylandQuickItem owns the QWaylandView. This architecture also leaves room for creating a QWaylandWidget :) Change-Id: Ib8a00e6f17f0f1bfc3ff244753f021c76db22cb1
Diffstat (limited to 'src/compositor/extensions/qwaylandshell.h')
-rw-r--r--src/compositor/extensions/qwaylandshell.h116
1 files changed, 116 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandshell.h b/src/compositor/extensions/qwaylandshell.h
new file mode 100644
index 000000000..a44c08030
--- /dev/null
+++ b/src/compositor/extensions/qwaylandshell.h
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
+** 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 QWAYLANDSHELL_H
+#define QWAYLANDSHELL_H
+
+#include <QtCompositor/QWaylandExtension>
+
+class QWaylandShellSurface;
+class QWaylandShellSurfacePrivate;
+class QWaylandSurface;
+class QWaylandView;
+class QWaylandShellPrivate;
+
+class Q_COMPOSITOR_EXPORT QWaylandShell : public QWaylandExtensionTemplate<QWaylandShell>
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QWaylandShell)
+public:
+ QWaylandShell();
+ QWaylandShell(QWaylandCompositor *compositor);
+
+ void initialize() Q_DECL_OVERRIDE;
+
+ static const struct wl_interface *interface();
+ static QByteArray interfaceName();
+
+Q_SIGNALS:
+ void shellSurfaceCreated(QWaylandSurface *surface, QWaylandShellSurface *shellSurface);
+};
+
+class Q_COMPOSITOR_EXPORT QWaylandShellSurface : public QWaylandExtensionTemplate<QWaylandShellSurface>
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QWaylandShellSurface)
+ Q_PROPERTY(SurfaceType surfaceType READ surfaceType NOTIFY surfaceTypeChanged)
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged)
+ Q_PROPERTY(QString className READ className NOTIFY classNameChanged)
+ Q_PROPERTY(QWaylandView *view READ view WRITE setView NOTIFY viewChanged)
+ Q_PROPERTY(QWaylandSurface *transientParent READ transientParent NOTIFY transientParentChanged)
+ Q_PROPERTY(QWaylandSurface *surface READ surface CONSTANT)
+
+public:
+ enum SurfaceType {
+ None,
+ Toplevel,
+ Transient,
+ Popup
+ };
+
+ QWaylandShellSurface(QWaylandShell *shell, struct wl_client *client, uint32_t id, QWaylandSurface *surface);
+
+ SurfaceType surfaceType() const;
+
+ QWaylandView *view() const;
+ void setView(QWaylandView *view);
+
+ QString title() const;
+ QString className() const;
+
+ QWaylandSurface *surface() const;
+
+ QWaylandSurface *transientParent() const;
+ QPointF transientOffset() const;
+
+ bool isTransientInactive() const;
+
+ static const struct wl_interface *interface();
+ static QByteArray interfaceName();
+Q_SIGNALS:
+ void surfaceTypeChanged();
+ void viewChanged();
+ void titleChanged();
+ void classNameChanged();
+ void transientParentChanged();
+ void pong();
+
+private Q_SLOTS:
+ void mappedChanged();
+ void adjustOffset(const QPoint &p);
+};
+
+#endif /*QWAYLANDSHELL_H*/