diff options
Diffstat (limited to 'src/imports/compositor-extensions/xdgshell')
7 files changed, 103 insertions, 363 deletions
diff --git a/src/imports/compositor-extensions/xdgshell/CMakeLists.txt b/src/imports/compositor-extensions/xdgshell/CMakeLists.txt index 00210ab21..32f032d93 100644 --- a/src/imports/compositor-extensions/xdgshell/CMakeLists.txt +++ b/src/imports/compositor-extensions/xdgshell/CMakeLists.txt @@ -1,23 +1,18 @@ -# Generated from xdgshell.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause -##################################################################### -## qwaylandcompositorxdgshellplugin Plugin: -##################################################################### - -qt_internal_add_qml_module(qwaylandcompositorxdgshellplugin +qt_internal_add_qml_module(WaylandCompositorXdgShell URI "QtWayland.Compositor.XdgShell" - VERSION "${CMAKE_PROJECT_VERSION}" - CLASSNAME QWaylandCompositorXdgShellPlugin - SKIP_TYPE_REGISTRATION + VERSION "${PROJECT_VERSION}" SOURCES - qwaylandcompositorxdgshellplugin.cpp - PUBLIC_LIBRARIES + qwaylandcompositorxdgshell_p.h + qwaylandcompositorxdgshell.cpp + LIBRARIES Qt::Core Qt::Gui Qt::WaylandCompositor + NO_GENERATE_CPP_EXPORTS + PAST_MAJOR_VERSIONS 1 ) -#### Keys ignored in scope 1:.:.:xdgshell.pro:<TRUE>: -# CXX_MODULE = "qml" -# QML_IMPORT_VERSION = "$$QT_VERSION" -# TARGETPATH = "QtWayland/Compositor/XdgShell" +qt_internal_add_autogen_sync_header_dependencies(WaylandCompositorXdgShell WaylandCompositor) diff --git a/src/imports/compositor-extensions/xdgshell/plugins.qmltypes b/src/imports/compositor-extensions/xdgshell/plugins.qmltypes deleted file mode 100644 index b5bf435a0..000000000 --- a/src/imports/compositor-extensions/xdgshell/plugins.qmltypes +++ /dev/null @@ -1,260 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtWayland.Compositor.XdgShell 6.0' - -Module { - dependencies: ["QtQuick 2.0"] - Component { name: "QWaylandCompositorExtension"; prototype: "QWaylandObject" } - Component { name: "QWaylandObject"; prototype: "QObject" } - Component { - name: "QWaylandQuickXdgOutputV1" - defaultProperty: "data" - prototype: "QWaylandXdgOutputV1" - exports: ["QtWayland.Compositor.XdgShell/XdgOutputV1 1.14"] - exportMetaObjectRevisions: [0] - } - Component { - name: "QWaylandShell" - prototype: "QWaylandCompositorExtension" - Enum { - name: "FocusPolicy" - values: { - "AutomaticFocus": 0, - "ManualFocus": 1 - } - } - Property { name: "focusPolicy"; type: "FocusPolicy" } - } - Component { - name: "QWaylandShellSurface" - prototype: "QWaylandCompositorExtension" - Property { name: "windowType"; type: "Qt::WindowType"; isReadonly: true } - } - Component { - name: "QWaylandXdgDecorationManagerV1" - prototype: "QWaylandCompositorExtension" - Property { name: "preferredMode"; type: "QWaylandXdgToplevel::DecorationMode" } - } - Component { - name: "QWaylandXdgDecorationManagerV1QuickExtension" - defaultProperty: "data" - prototype: "QWaylandXdgDecorationManagerV1" - exports: ["QtWayland.Compositor.XdgShell/XdgDecorationManagerV1 1.3"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { name: "QWaylandXdgOutputManagerV1"; prototype: "QWaylandCompositorExtension" } - Component { - name: "QWaylandXdgOutputManagerV1QuickExtension" - defaultProperty: "data" - prototype: "QWaylandXdgOutputManagerV1" - exports: ["QtWayland.Compositor.XdgShell/XdgOutputManagerV1 1.14"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QWaylandXdgOutputV1" - defaultProperty: "data" - prototype: "QObject" - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { - name: "manager" - type: "QWaylandXdgOutputManagerV1" - isReadonly: true - isPointer: true - } - Property { name: "output"; type: "QWaylandOutput"; isReadonly: true; isPointer: true } - Property { name: "name"; type: "string" } - Property { name: "description"; type: "string" } - Property { name: "logicalPosition"; type: "QPoint" } - Property { name: "logicalSize"; type: "QSize" } - Property { name: "logicalGeometry"; type: "QRect"; isReadonly: true } - } - Component { - name: "QWaylandXdgPopup" - prototype: "QObject" - exports: ["QtWayland.Compositor.XdgShell/XdgPopup 1.3"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "xdgSurface"; type: "QWaylandXdgSurface"; isReadonly: true; isPointer: true } - Property { - name: "parentXdgSurface" - type: "QWaylandXdgSurface" - isReadonly: true - isPointer: true - } - Property { name: "configuredGeometry"; type: "QRect"; isReadonly: true } - Property { name: "anchorRect"; type: "QRect"; isReadonly: true } - Property { name: "anchorEdges"; type: "Qt::Edges"; isReadonly: true } - Property { name: "gravityEdges"; type: "Qt::Edges"; isReadonly: true } - Property { name: "slideConstraints"; type: "Qt::Orientations"; isReadonly: true } - Property { name: "flipConstraints"; type: "Qt::Orientations"; isReadonly: true } - Property { name: "resizeConstraints"; type: "Qt::Orientations"; isReadonly: true } - Property { name: "offset"; type: "QPoint"; isReadonly: true } - Property { name: "positionerSize"; type: "QSize"; isReadonly: true } - Property { name: "unconstrainedPosition"; type: "QPoint"; isReadonly: true } - Method { - name: "sendConfigure" - type: "uint" - Parameter { name: "geometry"; type: "QRect" } - } - Method { name: "sendPopupDone"; revision: 270 } - } - Component { - name: "QWaylandXdgShell" - prototype: "QWaylandShell" - Signal { - name: "xdgSurfaceCreated" - Parameter { name: "xdgSurface"; type: "QWaylandXdgSurface"; isPointer: true } - } - Signal { - name: "toplevelCreated" - Parameter { name: "toplevel"; type: "QWaylandXdgToplevel"; isPointer: true } - Parameter { name: "xdgSurface"; type: "QWaylandXdgSurface"; isPointer: true } - } - Signal { - name: "popupCreated" - Parameter { name: "popup"; type: "QWaylandXdgPopup"; isPointer: true } - Parameter { name: "xdgSurface"; type: "QWaylandXdgSurface"; isPointer: true } - } - Signal { - name: "pong" - Parameter { name: "serial"; type: "uint" } - } - Method { - name: "ping" - type: "uint" - Parameter { name: "client"; type: "QWaylandClient"; isPointer: true } - } - } - Component { - name: "QWaylandXdgShellQuickExtension" - defaultProperty: "data" - prototype: "QWaylandXdgShell" - exports: ["QtWayland.Compositor.XdgShell/XdgShell 1.3"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QWaylandXdgSurface" - defaultProperty: "data" - prototype: "QWaylandShellSurface" - exports: ["QtWayland.Compositor.XdgShell/XdgSurface 1.3"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "shell"; type: "QWaylandXdgShell"; isReadonly: true; isPointer: true } - Property { name: "surface"; type: "QWaylandSurface"; isReadonly: true; isPointer: true } - Property { name: "toplevel"; type: "QWaylandXdgToplevel"; isReadonly: true; isPointer: true } - Property { name: "popup"; type: "QWaylandXdgPopup"; isReadonly: true; isPointer: true } - Property { name: "windowGeometry"; type: "QRect"; isReadonly: true } - Signal { name: "toplevelCreated" } - Signal { name: "popupCreated" } - Method { - name: "initialize" - Parameter { name: "xdgShell"; type: "QWaylandXdgShell"; isPointer: true } - Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "resource"; type: "QWaylandResource" } - } - } - Component { - name: "QWaylandXdgToplevel" - prototype: "QObject" - exports: ["QtWayland.Compositor.XdgShell/XdgToplevel 1.3"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "State" - values: { - "MaximizedState": 1, - "FullscreenState": 2, - "ResizingState": 3, - "ActivatedState": 4 - } - } - Enum { - name: "DecorationMode" - values: { - "ClientSideDecoration": 1, - "ServerSideDecoration": 2 - } - } - Property { name: "xdgSurface"; type: "QWaylandXdgSurface"; isReadonly: true; isPointer: true } - Property { - name: "parentToplevel" - type: "QWaylandXdgToplevel" - isReadonly: true - isPointer: true - } - Property { name: "title"; type: "string"; isReadonly: true } - Property { name: "appId"; type: "string"; isReadonly: true } - Property { name: "maxSize"; type: "QSize"; isReadonly: true } - Property { name: "minSize"; type: "QSize"; isReadonly: true } - Property { name: "states"; type: "QList<int>"; isReadonly: true } - Property { name: "maximized"; type: "bool"; isReadonly: true } - Property { name: "fullscreen"; type: "bool"; isReadonly: true } - Property { name: "resizing"; type: "bool"; isReadonly: true } - Property { name: "activated"; type: "bool"; isReadonly: true } - Property { name: "decorationMode"; type: "DecorationMode"; isReadonly: true } - Signal { - name: "startMove" - Parameter { name: "seat"; type: "QWaylandSeat"; isPointer: true } - } - Signal { - name: "startResize" - Parameter { name: "seat"; type: "QWaylandSeat"; isPointer: true } - Parameter { name: "edges"; type: "Qt::Edges" } - } - Signal { - name: "showWindowMenu" - Parameter { name: "seat"; type: "QWaylandSeat"; isPointer: true } - Parameter { name: "localSurfacePosition"; type: "QPoint" } - } - Signal { name: "setMaximized" } - Signal { name: "unsetMaximized" } - Signal { - name: "setFullscreen" - Parameter { name: "output"; type: "QWaylandOutput"; isPointer: true } - } - Signal { name: "unsetFullscreen" } - Signal { name: "setMinimized" } - Method { - name: "sizeForResize" - type: "QSize" - Parameter { name: "size"; type: "QSizeF" } - Parameter { name: "delta"; type: "QPointF" } - Parameter { name: "edges"; type: "Qt::Edges" } - } - Method { - name: "sendConfigure" - type: "uint" - Parameter { name: "size"; type: "QSize" } - Parameter { name: "states"; type: "QList<int>" } - } - Method { name: "sendClose" } - Method { - name: "sendMaximized" - type: "uint" - Parameter { name: "size"; type: "QSize" } - } - Method { - name: "sendUnmaximized" - type: "uint" - Parameter { name: "size"; type: "QSize" } - } - Method { name: "sendUnmaximized"; type: "uint" } - Method { - name: "sendFullscreen" - type: "uint" - Parameter { name: "size"; type: "QSize" } - } - Method { - name: "sendResizing" - type: "uint" - Parameter { name: "maxSize"; type: "QSize" } - } - } -} diff --git a/src/imports/compositor-extensions/xdgshell/qmldir b/src/imports/compositor-extensions/xdgshell/qmldir deleted file mode 100644 index d011ddc16..000000000 --- a/src/imports/compositor-extensions/xdgshell/qmldir +++ /dev/null @@ -1,5 +0,0 @@ -module QtWayland.Compositor.XdgShell -plugin qwaylandcompositorxdgshellplugin -classname QWaylandCompositorXdgShellPlugin -typeinfo plugins.qmltypes -typeinfo plugins.qmltypes diff --git a/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshell.cpp b/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshell.cpp new file mode 100644 index 000000000..15c96c718 --- /dev/null +++ b/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshell.cpp @@ -0,0 +1,27 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include "qwaylandcompositorxdgshell_p.h" + +QT_BEGIN_NAMESPACE +/*! + \qmlmodule QtWayland.Compositor.XdgShell + \title Qt Wayland XdgShell Extension + \ingroup qmlmodules + \brief Provides a Qt API for the XdgShell shell extension. + + \section2 Summary + XdgShell is a shell extension providing window system features typical to + desktop systems. + + XdgShell corresponds to the Wayland interface, \c xdg_shell. + + \section2 Usage + To use this module, import it like this: + \qml + import QtWayland.Compositor.XdgShell + \endqml +*/ +QT_END_NAMESPACE + +#include "moc_qwaylandcompositorxdgshell_p.cpp" diff --git a/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshell_p.h b/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshell_p.h new file mode 100644 index 000000000..f8a70d6ef --- /dev/null +++ b/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshell_p.h @@ -0,0 +1,66 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#ifndef QWAYLANDCOMPOSITORXDGSHELLFOREIGN_H +#define QWAYLANDCOMPOSITORXDGSHELLFOREIGN_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 <QtQml/qqmlextensionplugin.h> +#include <QtQml/qqml.h> + +#include <QtWaylandCompositor/QWaylandQuickExtension> +#include <QtWaylandCompositor/QWaylandXdgShell> +#include <QtWaylandCompositor/QWaylandXdgDecorationManagerV1> +#include <QtWaylandCompositor/QWaylandQuickXdgOutputV1> + +QT_BEGIN_NAMESPACE + +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandXdgShell, XdgShell, 1, 3) +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandXdgDecorationManagerV1, + XdgDecorationManagerV1, 1, 3) +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandXdgOutputManagerV1, XdgOutputManagerV1, + 1, 14) + +struct QWaylandXdgSurfaceForeign { + Q_GADGET + QML_FOREIGN(QWaylandXdgSurface) + QML_NAMED_ELEMENT(XdgSurface) + QML_ADDED_IN_VERSION(1, 3) +}; + +struct QWaylandXdgTopLevelForeign { + Q_GADGET + QML_FOREIGN(QWaylandXdgToplevel) + QML_NAMED_ELEMENT(XdgToplevel) + QML_ADDED_IN_VERSION(1, 3) + QML_UNCREATABLE("Cannot create instance of XdgShellToplevel") +}; + +struct QWaylandXdgPopupForeign { + Q_GADGET + QML_FOREIGN(QWaylandXdgPopup) + QML_NAMED_ELEMENT(XdgPopup) + QML_ADDED_IN_VERSION(1, 3) + QML_UNCREATABLE("Cannot create instance of XdgShellPopup") +}; + +struct QWaylandQuickXdgOutputV1Foreign { + Q_GADGET + QML_FOREIGN(QWaylandQuickXdgOutputV1) + QML_NAMED_ELEMENT(XdgOutputV1) + QML_ADDED_IN_VERSION(1, 14) +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshellplugin.cpp b/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshellplugin.cpp deleted file mode 100644 index 9ea8a115b..000000000 --- a/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshellplugin.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWaylandCompositor module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtQml/qqmlextensionplugin.h> -#include <QtQml/qqml.h> - -#include <QtWaylandCompositor/QWaylandQuickExtension> -#include <QtWaylandCompositor/QWaylandXdgShell> -#include <QtWaylandCompositor/QWaylandXdgDecorationManagerV1> -#include <QtWaylandCompositor/QWaylandQuickXdgOutputV1> - -QT_BEGIN_NAMESPACE - -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandXdgShell) -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandXdgDecorationManagerV1) -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandXdgOutputManagerV1) - -class QWaylandCompositorXdgShellPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) -public: - void registerTypes(const char *uri) override - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor.XdgShell")); - defineModule(uri); - } - - static void defineModule(const char *uri) - { - qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR); - - qmlRegisterType<QWaylandXdgShellQuickExtension>(uri, 1, 3, "XdgShell"); - qmlRegisterType<QWaylandXdgSurface>(uri, 1, 3, "XdgSurface"); - qmlRegisterUncreatableType<QWaylandXdgToplevel>(uri, 1, 3, "XdgToplevel", QObject::tr("Cannot create instance of XdgShellToplevel")); - qmlRegisterUncreatableType<QWaylandXdgPopup>(uri, 1, 3, "XdgPopup", QObject::tr("Cannot create instance of XdgShellPopup")); - - qmlRegisterType<QWaylandXdgDecorationManagerV1QuickExtension>(uri, 1, 3, "XdgDecorationManagerV1"); - qmlRegisterType<QWaylandXdgOutputManagerV1QuickExtension>(uri, 1, 14, "XdgOutputManagerV1"); - qmlRegisterType<QWaylandQuickXdgOutputV1>(uri, 1, 14, "XdgOutputV1"); - } -}; - -QT_END_NAMESPACE - -#include "qwaylandcompositorxdgshellplugin.moc" diff --git a/src/imports/compositor-extensions/xdgshell/xdgshell.pro b/src/imports/compositor-extensions/xdgshell/xdgshell.pro deleted file mode 100644 index 0afcb76cc..000000000 --- a/src/imports/compositor-extensions/xdgshell/xdgshell.pro +++ /dev/null @@ -1,11 +0,0 @@ -CXX_MODULE = qml -TARGET = qwaylandcompositorxdgshellplugin -TARGETPATH = QtWayland/Compositor/XdgShell -QML_IMPORT_VERSION = $$QT_VERSION - -SOURCES += \ - qwaylandcompositorxdgshellplugin.cpp - -QT += waylandcompositor - -load(qml_plugin) |