From 58bfe9d9b51786792d5b7af8a90698af87207ad1 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Fri, 8 Apr 2016 08:30:36 +0200 Subject: Rename QWaylandWindowManagerExtension to QWaylandQtWindowManager * QWaylandWindowManagerExtension become QWaylandQtWindowManager * WindowManager become QtWindowManager Follow naming convention already established for other extensions like QWaylandWlShell and avoid confusion that might arise with a name as generic as WindowManager. Use QWaylandClient rather than wl_client. Also the Wayland protocol definition has been renamed to qt-windowmanager.xml Change-Id: I941621ce229327c21eff9e80c7e92205cc60e8eb Reviewed-by: Giulio Camuffo Reviewed-by: Johan Helsing --- examples/wayland/pure-qml/qml/main.qml | 2 +- src/client/client.pro | 2 +- src/client/qwaylandwindowmanagerintegration_p.h | 2 +- .../compositor_api/qwaylandcompositor.cpp | 6 +- src/compositor/extensions/extensions.pri | 8 +- .../extensions/qwaylandqtwindowmanager.cpp | 150 +++++++++++++++++++++ .../extensions/qwaylandqtwindowmanager.h | 76 +++++++++++ .../extensions/qwaylandqtwindowmanager_p.h | 80 +++++++++++ .../extensions/qwaylandwindowmanagerextension.cpp | 148 -------------------- .../extensions/qwaylandwindowmanagerextension.h | 77 ----------- .../extensions/qwaylandwindowmanagerextension_p.h | 79 ----------- src/extensions/qt-windowmanager.xml | 58 ++++++++ src/extensions/windowmanager.xml | 58 -------- src/imports/compositor/plugins.qmltypes | 36 ++--- .../compositor/qwaylandquickcompositorplugin.cpp | 6 +- 15 files changed, 395 insertions(+), 393 deletions(-) create mode 100644 src/compositor/extensions/qwaylandqtwindowmanager.cpp create mode 100644 src/compositor/extensions/qwaylandqtwindowmanager.h create mode 100644 src/compositor/extensions/qwaylandqtwindowmanager_p.h delete mode 100644 src/compositor/extensions/qwaylandwindowmanagerextension.cpp delete mode 100644 src/compositor/extensions/qwaylandwindowmanagerextension.h delete mode 100644 src/compositor/extensions/qwaylandwindowmanagerextension_p.h create mode 100644 src/extensions/qt-windowmanager.xml delete mode 100644 src/extensions/windowmanager.xml diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml index 6ee09f802..fb61aeacd 100644 --- a/examples/wayland/pure-qml/qml/main.qml +++ b/examples/wayland/pure-qml/qml/main.qml @@ -63,7 +63,7 @@ WaylandCompositor { } extensions: [ - WindowManager { + QtWindowManager { id: qtWindowManager onShowIsFullScreenChanged: console.debug("Show is fullscreen hint for Qt applications:", showIsFullScreen) }, diff --git a/src/client/client.pro b/src/client/client.pro index 994cf5443..f0142c9a5 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -38,7 +38,7 @@ WAYLANDCLIENTSOURCES += \ ../extensions/surface-extension.xml \ ../extensions/touch-extension.xml \ ../extensions/qtkey-extension.xml \ - ../extensions/windowmanager.xml \ + ../extensions/qt-windowmanager.xml \ ../3rdparty/protocol/text-input-unstable-v2.xml \ ../3rdparty/protocol/xdg-shell.xml \ diff --git a/src/client/qwaylandwindowmanagerintegration_p.h b/src/client/qwaylandwindowmanagerintegration_p.h index 80513af3a..f2c0ac6be 100644 --- a/src/client/qwaylandwindowmanagerintegration_p.h +++ b/src/client/qwaylandwindowmanagerintegration_p.h @@ -57,7 +57,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 41de5b459..3a499fa74 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -60,7 +60,7 @@ #include "hardware_integration/qwlserverbufferintegrationfactory_p.h" #include "hardware_integration/qwlhwintegration_p.h" -#include "extensions/qwaylandwindowmanagerextension.h" +#include "extensions/qwaylandqtwindowmanager.h" #include "qwaylandxkb_p.h" #include "qwaylandshmformathelper_p.h" @@ -572,9 +572,9 @@ void QWaylandCompositor::destroyClient(QWaylandClient *client) if (!client) return; - QWaylandWindowManagerExtension *wmExtension = QWaylandWindowManagerExtension::findIn(this); + QWaylandQtWindowManager *wmExtension = QWaylandQtWindowManager::findIn(this); if (wmExtension) - wmExtension->sendQuitMessage(client->client()); + wmExtension->sendQuitMessage(client); wl_client_destroy(client->client()); } diff --git a/src/compositor/extensions/extensions.pri b/src/compositor/extensions/extensions.pri index 4ab267276..ab21fe5ab 100644 --- a/src/compositor/extensions/extensions.pri +++ b/src/compositor/extensions/extensions.pri @@ -3,7 +3,7 @@ WAYLANDSERVERSOURCES += \ ../extensions/surface-extension.xml \ ../extensions/touch-extension.xml \ ../extensions/qtkey-extension.xml \ - ../extensions/windowmanager.xml \ + ../extensions/qt-windowmanager.xml \ ../3rdparty/protocol/text-input-unstable-v2.xml \ ../3rdparty/protocol/xdg-shell.xml \ @@ -17,8 +17,8 @@ HEADERS += \ extensions/qwaylandtextinput_p.h \ extensions/qwaylandtextinputmanager.h \ extensions/qwaylandtextinputmanager_p.h \ - extensions/qwaylandwindowmanagerextension.h \ - extensions/qwaylandwindowmanagerextension_p.h \ + extensions/qwaylandqtwindowmanager.h \ + extensions/qwaylandqtwindowmanager_p.h \ extensions/qwaylandxdgshell.h \ extensions/qwaylandxdgshell_p.h \ extensions/qwaylandshellsurface.h \ @@ -30,7 +30,7 @@ SOURCES += \ extensions/qwaylandwlshell.cpp \ extensions/qwaylandtextinput.cpp \ extensions/qwaylandtextinputmanager.cpp \ - extensions/qwaylandwindowmanagerextension.cpp \ + extensions/qwaylandqtwindowmanager.cpp \ extensions/qwaylandxdgshell.cpp \ qtHaveModule(quick) { diff --git a/src/compositor/extensions/qwaylandqtwindowmanager.cpp b/src/compositor/extensions/qwaylandqtwindowmanager.cpp new file mode 100644 index 000000000..f82a8e46f --- /dev/null +++ b/src/compositor/extensions/qwaylandqtwindowmanager.cpp @@ -0,0 +1,150 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 Pier Luigi Fiorini +** 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$ +** +****************************************************************************/ + +#include +#include + +#include +#include + +#include "qwaylandqtwindowmanager.h" +#include "qwaylandqtwindowmanager_p.h" + +QT_BEGIN_NAMESPACE + +QWaylandQtWindowManagerPrivate::QWaylandQtWindowManagerPrivate() + : QWaylandCompositorExtensionPrivate() + , qt_windowmanager() + , showIsFullScreen(false) +{ +} + +void QWaylandQtWindowManagerPrivate::windowmanager_bind_resource(Resource *resource) +{ + send_hints(resource->handle, static_cast(showIsFullScreen)); +} + +void QWaylandQtWindowManagerPrivate::windowmanager_destroy_resource(Resource *resource) +{ + urls.remove(resource); +} + +void QWaylandQtWindowManagerPrivate::windowmanager_open_url(Resource *resource, uint32_t remaining, const QString &newUrl) +{ + Q_Q(QWaylandQtWindowManager); + + QWaylandCompositor *compositor = static_cast(q->extensionContainer()); + if (!compositor) { + qWarning() << "Failed to find QWaylandCompositor from QWaylandQtWindowManager::windowmanager_open_url()"; + return; + } + + QString url = urls.value(resource, QString()); + + url.append(newUrl); + + if (remaining) + urls.insert(resource, url); + else { + urls.remove(resource); + q->openUrl(QWaylandClient::fromWlClient(compositor, resource->client()), QUrl(url)); + } +} + +QWaylandQtWindowManager::QWaylandQtWindowManager() + : QWaylandCompositorExtensionTemplate(*new QWaylandQtWindowManagerPrivate()) +{ +} + +QWaylandQtWindowManager::QWaylandQtWindowManager(QWaylandCompositor *compositor) + : QWaylandCompositorExtensionTemplate(compositor, *new QWaylandQtWindowManagerPrivate()) +{ +} + +bool QWaylandQtWindowManager::showIsFullScreen() const +{ + Q_D(const QWaylandQtWindowManager); + return d->showIsFullScreen; +} + +void QWaylandQtWindowManager::setShowIsFullScreen(bool value) +{ + Q_D(QWaylandQtWindowManager); + + if (d->showIsFullScreen == value) + return; + + d->showIsFullScreen = value; + Q_FOREACH (QWaylandQtWindowManagerPrivate::Resource *resource, d->resourceMap().values()) { + d->send_hints(resource->handle, static_cast(d->showIsFullScreen)); + } + Q_EMIT showIsFullScreenChanged(); +} + +void QWaylandQtWindowManager::sendQuitMessage(QWaylandClient *client) +{ + Q_D(QWaylandQtWindowManager); + QWaylandQtWindowManagerPrivate::Resource *resource = d->resourceMap().value(client->client()); + + if (resource) + d->send_quit(resource->handle); +} + +void QWaylandQtWindowManager::initialize() +{ + Q_D(QWaylandQtWindowManager); + + QWaylandCompositorExtensionTemplate::initialize(); + QWaylandCompositor *compositor = static_cast(extensionContainer()); + if (!compositor) { + qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandQtWindowManager"; + return; + } + d->init(compositor->display(), 1); +} + +const struct wl_interface *QWaylandQtWindowManager::interface() +{ + return QWaylandQtWindowManagerPrivate::interface(); +} + +QByteArray QWaylandQtWindowManager::interfaceName() +{ + return QWaylandQtWindowManagerPrivate::interfaceName(); +} + +QT_END_NAMESPACE diff --git a/src/compositor/extensions/qwaylandqtwindowmanager.h b/src/compositor/extensions/qwaylandqtwindowmanager.h new file mode 100644 index 000000000..4d3951025 --- /dev/null +++ b/src/compositor/extensions/qwaylandqtwindowmanager.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 Pier Luigi Fiorini +** 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 QWAYLANDQTWINDOWMANAGER_H +#define QWAYLANDQTWINDOWMANAGER_H + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QWaylandQtWindowManagerPrivate; + +class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQtWindowManager : public QWaylandCompositorExtensionTemplate +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QWaylandQtWindowManager) + Q_PROPERTY(bool showIsFullScreen READ showIsFullScreen WRITE setShowIsFullScreen NOTIFY showIsFullScreenChanged) +public: + QWaylandQtWindowManager(); + explicit QWaylandQtWindowManager(QWaylandCompositor *compositor); + + bool showIsFullScreen() const; + void setShowIsFullScreen(bool value); + + void sendQuitMessage(QWaylandClient *client); + + void initialize() Q_DECL_OVERRIDE; + + static const struct wl_interface *interface(); + static QByteArray interfaceName(); + +Q_SIGNALS: + void showIsFullScreenChanged(); + void openUrl(QWaylandClient *client, const QUrl &url); +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDQTWINDOWMANAGER_H diff --git a/src/compositor/extensions/qwaylandqtwindowmanager_p.h b/src/compositor/extensions/qwaylandqtwindowmanager_p.h new file mode 100644 index 000000000..a6df2138f --- /dev/null +++ b/src/compositor/extensions/qwaylandqtwindowmanager_p.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 Pier Luigi Fiorini +** 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 QWAYLANDQTWINDOWMANAGER_P_H +#define QWAYLANDQTWINDOWMANAGER_P_H + +#include + +#include +#include +#include + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE + +class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQtWindowManagerPrivate + : public QWaylandCompositorExtensionPrivate + , public QtWaylandServer::qt_windowmanager +{ + Q_DECLARE_PUBLIC(QWaylandQtWindowManager) +public: + QWaylandQtWindowManagerPrivate(); + +protected: + void windowmanager_bind_resource(Resource *resource) Q_DECL_OVERRIDE; + void windowmanager_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; + void windowmanager_open_url(Resource *resource, uint32_t remaining, const QString &url) Q_DECL_OVERRIDE; + +private: + bool showIsFullScreen; + QMap urls; +}; + +QT_END_NAMESPACE + +#endif // QWAYLANDQTWINDOWMANAGER_P_H diff --git a/src/compositor/extensions/qwaylandwindowmanagerextension.cpp b/src/compositor/extensions/qwaylandwindowmanagerextension.cpp deleted file mode 100644 index 1e7ed2892..000000000 --- a/src/compositor/extensions/qwaylandwindowmanagerextension.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ - -#include "qwaylandwindowmanagerextension.h" -#include "qwaylandwindowmanagerextension_p.h" - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -QWaylandWindowManagerExtension::QWaylandWindowManagerExtension() - : QWaylandCompositorExtensionTemplate(*new QWaylandWindowManagerExtensionPrivate) -{ -} - -QWaylandWindowManagerExtension::QWaylandWindowManagerExtension(QWaylandCompositor *compositor) - : QWaylandCompositorExtensionTemplate(compositor, *new QWaylandWindowManagerExtensionPrivate) -{ -} - -QWaylandWindowManagerExtensionPrivate::QWaylandWindowManagerExtensionPrivate() - : QWaylandCompositorExtensionPrivate() - , QtWaylandServer::qt_windowmanager() - , showIsFullScreen(false) -{ -} - -bool QWaylandWindowManagerExtension::showIsFullScreen() const -{ - Q_D(const QWaylandWindowManagerExtension); - return d->showIsFullScreen; -} - -void QWaylandWindowManagerExtension::setShowIsFullScreen(bool value) -{ - Q_D(QWaylandWindowManagerExtension); - - if (d->showIsFullScreen == value) - return; - - d->showIsFullScreen = value; - Q_FOREACH (QWaylandWindowManagerExtensionPrivate::Resource *resource, d->resourceMap().values()) { - d->send_hints(resource->handle, static_cast(d->showIsFullScreen)); - } - Q_EMIT showIsFullScreenChanged(); -} - -void QWaylandWindowManagerExtension::sendQuitMessage(wl_client *client) -{ - Q_D(QWaylandWindowManagerExtension); - QWaylandWindowManagerExtensionPrivate::Resource *resource = d->resourceMap().value(client); - - if (resource) - d->send_quit(resource->handle); -} - -void QWaylandWindowManagerExtension::initialize() -{ - Q_D(QWaylandWindowManagerExtension); - - QWaylandCompositorExtensionTemplate::initialize(); - QWaylandCompositor *compositor = static_cast(extensionContainer()); - if (!compositor) { - qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandWindowManagerExtension"; - return; - } - d->init(compositor->display(), 1); -} - -void QWaylandWindowManagerExtensionPrivate::windowmanager_bind_resource(Resource *resource) -{ - send_hints(resource->handle, static_cast(showIsFullScreen)); -} - -void QWaylandWindowManagerExtensionPrivate::windowmanager_destroy_resource(Resource *resource) -{ - urls.remove(resource); -} - -void QWaylandWindowManagerExtensionPrivate::windowmanager_open_url(Resource *resource, uint32_t remaining, const QString &newUrl) -{ - Q_Q(QWaylandWindowManagerExtension); - - QWaylandCompositor *compositor = static_cast(q->extensionContainer()); - if (!compositor) { - qWarning() << "Failed to find QWaylandCompositor from QWaylandWindowManagerExtension::windowmanager_open_url()"; - return; - } - - QString url = urls.value(resource, QString()); - - url.append(newUrl); - - if (remaining) - urls.insert(resource, url); - else { - urls.remove(resource); - q->openUrl(QWaylandClient::fromWlClient(compositor, resource->client()), QUrl(url)); - } -} - -const struct wl_interface *QWaylandWindowManagerExtension::interface() -{ - return QWaylandWindowManagerExtensionPrivate::interface(); -} - -QByteArray QWaylandWindowManagerExtension::interfaceName() -{ - return QWaylandWindowManagerExtensionPrivate::interfaceName(); -} - -QT_END_NAMESPACE diff --git a/src/compositor/extensions/qwaylandwindowmanagerextension.h b/src/compositor/extensions/qwaylandwindowmanagerextension.h deleted file mode 100644 index 184bcc3c5..000000000 --- a/src/compositor/extensions/qwaylandwindowmanagerextension.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** 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 WAYLANDWINDOWMANAGERINTEGRATION_H -#define WAYLANDWINDOWMANAGERINTEGRATION_H - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QWaylandCompositor; - -class QWaylandWindowManagerExtensionPrivate; - -class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWindowManagerExtension : public QWaylandCompositorExtensionTemplate -{ - Q_OBJECT - Q_PROPERTY(bool showIsFullScreen READ showIsFullScreen WRITE setShowIsFullScreen NOTIFY showIsFullScreenChanged) - Q_DECLARE_PRIVATE(QWaylandWindowManagerExtension) -public: - QWaylandWindowManagerExtension(); - explicit QWaylandWindowManagerExtension(QWaylandCompositor *compositor); - - bool showIsFullScreen() const; - void setShowIsFullScreen(bool value); - - void sendQuitMessage(wl_client *client); - - void initialize() Q_DECL_OVERRIDE; - - static const struct wl_interface *interface(); - static QByteArray interfaceName(); - -Q_SIGNALS: - void showIsFullScreenChanged(); - void openUrl(QWaylandClient *client, const QUrl &url); -}; - -QT_END_NAMESPACE - -#endif // WAYLANDWINDOWMANAGERINTEGRATION_H diff --git a/src/compositor/extensions/qwaylandwindowmanagerextension_p.h b/src/compositor/extensions/qwaylandwindowmanagerextension_p.h deleted file mode 100644 index 9573855d5..000000000 --- a/src/compositor/extensions/qwaylandwindowmanagerextension_p.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** 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 QWAYLANDWINDOWMANAGEREXTENSION_P_H -#define QWAYLANDWINDOWMANAGEREXTENSION_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWindowManagerExtensionPrivate - : public QWaylandCompositorExtensionPrivate - , public QtWaylandServer::qt_windowmanager -{ - Q_DECLARE_PUBLIC(QWaylandWindowManagerExtension) -public: - QWaylandWindowManagerExtensionPrivate(); - -protected: - void windowmanager_bind_resource(Resource *resource) Q_DECL_OVERRIDE; - void windowmanager_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - void windowmanager_open_url(Resource *resource, uint32_t remaining, const QString &url) Q_DECL_OVERRIDE; - -private: - bool showIsFullScreen; - QMap urls; -}; - -QT_END_NAMESPACE - -#endif /*QWAYLANDWINDOWMANAGEREXTENSION_P_H*/ diff --git a/src/extensions/qt-windowmanager.xml b/src/extensions/qt-windowmanager.xml new file mode 100644 index 000000000..86ddff72e --- /dev/null +++ b/src/extensions/qt-windowmanager.xml @@ -0,0 +1,58 @@ + + + + Copyright (C) 2015 The Qt Company Ltd. + Contact: http://www.qt.io/licensing/ + + This file is part of the plugins of the Qt Toolkit. + + $QT_BEGIN_LICENSE:BSD$ + You may use this file under the terms of the BSD license as follows: + + "Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of The Qt Company Ltd nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + + $QT_END_LICENSE$ + + + + + + If remaining is not 0 this is a multipart request, and + the server must concatenate subsequent requst urls to and + including a request where remaining is set to 0, before + it can handle the url. + + + + + + + + + + + diff --git a/src/extensions/windowmanager.xml b/src/extensions/windowmanager.xml deleted file mode 100644 index 3d3bbd7fe..000000000 --- a/src/extensions/windowmanager.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - Copyright (C) 2015 The Qt Company Ltd. - Contact: http://www.qt.io/licensing/ - - This file is part of the plugins of the Qt Toolkit. - - $QT_BEGIN_LICENSE:BSD$ - You may use this file under the terms of the BSD license as follows: - - "Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of The Qt Company Ltd nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - - $QT_END_LICENSE$ - - - - - - If remaining is not 0 this is a multipart request, and - the server must concatenate subsequent requst urls to and - including a request where remaining is set to 0, before - it can handle the url. - - - - - - - - - - - diff --git a/src/imports/compositor/plugins.qmltypes b/src/imports/compositor/plugins.qmltypes index 8d07403c0..33bebb441 100644 --- a/src/imports/compositor/plugins.qmltypes +++ b/src/imports/compositor/plugins.qmltypes @@ -173,6 +173,24 @@ Module { Signal { name: "physicalSizeFollowsSizeChanged" } Signal { name: "windowDestroyed" } } + Component { + name: "QWaylandQtWindowManager" + prototype: "QWaylandCompositorExtension" + Property { name: "showIsFullScreen"; type: "bool" } + Signal { + name: "openUrl" + Parameter { name: "client"; type: "QWaylandClient"; isPointer: true } + Parameter { name: "url"; type: "QUrl" } + } + } + Component { + name: "QWaylandQtWindowManagerQuickExtension" + defaultProperty: "data" + prototype: "QWaylandQtWindowManager" + exports: ["QtWayland.Compositor/QtWindowManager 1.0"] + exportMetaObjectRevisions: [0] + Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } + } Component { name: "QWaylandQuickCompositor"; prototype: "QWaylandCompositor" } Component { name: "QWaylandQuickCompositorQuickExtensionContainer" @@ -357,24 +375,6 @@ Module { Property { name: "discardFrontBuffers"; type: "bool" } Signal { name: "surfaceDestroyed" } } - Component { - name: "QWaylandWindowManagerExtension" - prototype: "QWaylandCompositorExtension" - Property { name: "showIsFullScreen"; type: "bool" } - Signal { - name: "openUrl" - Parameter { name: "client"; type: "QWaylandClient"; isPointer: true } - Parameter { name: "url"; type: "QUrl" } - } - } - Component { - name: "QWaylandWindowManagerExtensionQuickExtension" - defaultProperty: "data" - prototype: "QWaylandWindowManagerExtension" - exports: ["QtWayland.Compositor/WindowManager 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } Component { name: "QWaylandWlShell" prototype: "QWaylandCompositorExtension" diff --git a/src/imports/compositor/qwaylandquickcompositorplugin.cpp b/src/imports/compositor/qwaylandquickcompositorplugin.cpp index 6f00351c5..112ad5787 100644 --- a/src/imports/compositor/qwaylandquickcompositorplugin.cpp +++ b/src/imports/compositor/qwaylandquickcompositorplugin.cpp @@ -50,7 +50,7 @@ #include #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CONTAINER_CLASS(QWaylandQuickCompositor) -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandWindowManagerExtension) +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandQtWindowManager) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandWlShell) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandXdgShell) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandTextInputManager) @@ -146,7 +146,7 @@ public: qmlRegisterUncreatableType(uri, 1, 0, "WaylandResource", QObject::tr("Cannot create instance of WaylandResource")); //This should probably be somewhere else - qmlRegisterType(uri, 1, 0, "WindowManager"); + qmlRegisterType(uri, 1, 0, "QtWindowManager"); qmlRegisterType(uri, 1, 0, "WlShell"); qmlRegisterType(uri, 1, 0, "WlShellSurface"); qmlRegisterType(uri, 1, 0, "ShellSurfaceItem"); -- cgit v1.2.3