diff options
40 files changed, 497 insertions, 1263 deletions
diff --git a/dependencies.yaml b/dependencies.yaml index 7929629d8..fece2dc11 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,10 +1,10 @@ dependencies: ../qtbase: - ref: 0cd5eb895cc96126a495eb3d2d258be47eed193a + ref: f1c6c66985d1ceda16b0f74e91f36b0df44daf58 required: true ../qtdeclarative: - ref: c63bb2bad5b4e741ed8a1e16d8f1f916c9baf61d + ref: 6083d39de9c003ffbb4b32fd8d5c9941479f3ad0 required: false ../qtsvg: - ref: 69d4dcf5d4bfab4c3a8a3ea7a90e6694b995f799 + ref: cbef67469371d2e3f5e682928d5b61c1aa97c198 required: false diff --git a/src/client/doc/src/cmake/qt_generate_wayland_protocol_client_sources.qdoc b/src/client/doc/src/cmake/qt_generate_wayland_protocol_client_sources.qdoc index 43f448fbd..0abd14d4e 100644 --- a/src/client/doc/src/cmake/qt_generate_wayland_protocol_client_sources.qdoc +++ b/src/client/doc/src/cmake/qt_generate_wayland_protocol_client_sources.qdoc @@ -37,7 +37,8 @@ code in C and C++ for implementing the protocols, and the resulting files will b of the \c target. The options \c{PUBLIC_CODE} and \c{PRIVATE_CODE} correspond to the \c{public-code} and -\c{private-code} options of \c{wayland-scanner}. For backwards compatibility \c{PUBLIC_CODE} is the +\c{private-code} options of \c{wayland-scanner}. \c{PUBLIC_CODE} will cause the symbols in the +code that is generated by \c{wayland-scanner} to be exported. For backwards compatibility \c{PUBLIC_CODE} is the default but generally \c{PRIVATE_CODE} is strongly recommended. qt_generate_wayland_protocol_client_sources() will trigger generation of the files needed to diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 9bd60e741..e6ed0772f 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -891,7 +891,12 @@ bool QWaylandDisplay::supportsWindowDecoration() const if (disabled) return false; - static bool integrationSupport = clientBufferIntegration() && clientBufferIntegration()->supportsWindowDecoration(); + // Don't initialize client buffer integration just to check whether it can have a decoration. + if (!mWaylandIntegration->mClientBufferIntegrationInitialized) + return true; + + // We can do software-rendered decorations, only disable them if the integration explicitly says it can't. + static bool integrationSupport = !clientBufferIntegration() || clientBufferIntegration()->supportsWindowDecoration(); return integrationSupport; } diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 73fb331eb..878332ca3 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -60,8 +60,6 @@ QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display) mFrameCallbackTimeout = frameCallbackTimeout; } - mScale = waylandScreen() ? waylandScreen()->scale() : 1; // fallback to 1 if we don't have a real screen - static WId id = 1; mWindowId = id++; initializeWlSurface(); @@ -327,6 +325,7 @@ void QWaylandWindow::reset() mWaitingToApplyConfigure = false; mCanResize = true; mResizeDirty = false; + mScale = std::nullopt; mOpaqueArea = QRegion(); mMask = QRegion(); @@ -1185,8 +1184,13 @@ QWaylandWindow *QWaylandWindow::guessTransientParent() const if (auto transientParent = closestShellSurfaceWindow(window()->transientParent())) return transientParent; - if (QGuiApplication::focusWindow() && (window()->type() == Qt::ToolTip || window()->type() == Qt::Popup)) - return closestShellSurfaceWindow(QGuiApplication::focusWindow()); + if (window()->type() == Qt::Popup) { + if (mTopPopup) + return mTopPopup; + } + + if (window()->type() == Qt::ToolTip || window()->type() == Qt::Popup) + return display()->lastInputWindow(); return nullptr; } @@ -1476,7 +1480,7 @@ void QWaylandWindow::updateScale() void QWaylandWindow::setScale(qreal newScale) { - if (qFuzzyCompare(mScale, newScale)) + if (mScale.has_value() && qFuzzyCompare(mScale.value(), newScale)) return; mScale = newScale; @@ -1485,7 +1489,7 @@ void QWaylandWindow::setScale(qreal newScale) if (mViewport) updateViewport(); else if (mSurface->version() >= 3) - mSurface->set_buffer_scale(std::ceil(mScale)); + mSurface->set_buffer_scale(std::ceil(newScale)); } ensureSize(); @@ -1547,7 +1551,7 @@ qreal QWaylandWindow::scale() const qreal QWaylandWindow::devicePixelRatio() const { - return qreal(mScale); + return mScale.value_or(waylandScreen() ? waylandScreen()->scale() : 1); } bool QWaylandWindow::setMouseGrabEnabled(bool grab) diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index b78c8ce4e..63b140f0b 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -310,7 +310,7 @@ protected: bool mSentInitialResize = false; QPoint mOffset; - qreal mScale = 1; + std::optional<qreal> mScale = 1; QPlatformScreen *mLastReportedScreen = nullptr; QString mWindowTitle; diff --git a/src/client/qwaylandwindowmanagerintegration.cpp b/src/client/qwaylandwindowmanagerintegration.cpp index c7a5c0d14..9668491d2 100644 --- a/src/client/qwaylandwindowmanagerintegration.cpp +++ b/src/client/qwaylandwindowmanagerintegration.cpp @@ -24,8 +24,7 @@ namespace QtWaylandClient { QWaylandWindowManagerIntegration::QWaylandWindowManagerIntegration(QWaylandDisplay *waylandDisplay, uint id, uint version) - : QtWayland::qt_windowmanager(waylandDisplay->object(), id, version), - m_waylandDisplay(waylandDisplay) + : QtWayland::qt_windowmanager(waylandDisplay->object(), id, version) { } diff --git a/src/client/qwaylandwindowmanagerintegration_p.h b/src/client/qwaylandwindowmanagerintegration_p.h index 76d9b0da0..be06d68ee 100644 --- a/src/client/qwaylandwindowmanagerintegration_p.h +++ b/src/client/qwaylandwindowmanagerintegration_p.h @@ -44,7 +44,6 @@ private: void windowmanager_hints(int32_t showIsFullScreen) override; void windowmanager_quit() override; - QWaylandDisplay *m_waylandDisplay = nullptr; bool m_showIsFullScreen = false; }; diff --git a/src/compositor/CMakeLists.txt b/src/compositor/CMakeLists.txt index 856fd07f9..19bdc7d3a 100644 --- a/src/compositor/CMakeLists.txt +++ b/src/compositor/CMakeLists.txt @@ -80,6 +80,12 @@ qt_internal_add_module(WaylandCompositor "^qwayland-.*\.h|^wayland-.*-protocol\.h" ) +# all those macros define structs with Q_OBJECT macros, and should be picked up by moc +set_target_properties(WaylandCompositor WaylandCompositorPrivate + PROPERTIES + INTERFACE_AUTOMOC_MACRO_NAMES "Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT;Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS;Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS;Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CONTAINER_CLASS" +) + set(compositor_no_pch_sources compat/removed_api.cpp ) diff --git a/src/compositor/compositor_api/qwaylandcompositorquickextensions_p.h b/src/compositor/compositor_api/qwaylandcompositorquickextensions_p.h index 3150f90ae..7e59a5d6e 100644 --- a/src/compositor/compositor_api/qwaylandcompositorquickextensions_p.h +++ b/src/compositor/compositor_api/qwaylandcompositorquickextensions_p.h @@ -80,11 +80,14 @@ private: // Note: These have to be in a header with a Q_OBJECT macro, otherwise we won't run moc on it -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(QWaylandQtWindowManager, QtWindowManager) -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(QWaylandIdleInhibitManagerV1, IdleInhibitManagerV1) -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(QWaylandTextInputManager, TextInputManager) -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(QWaylandTextInputManagerV3, TextInputManagerV3) -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(QWaylandQtTextInputMethodManager, QtTextInputMethodManager) +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandQtWindowManager, QtWindowManager, 1, 0) +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandIdleInhibitManagerV1, + IdleInhibitManagerV1, 1, 0) +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandTextInputManager, TextInputManager, 1, 0) +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandTextInputManagerV3, TextInputManagerV3, + 1, 0) +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandQtTextInputMethodManager, + QtTextInputMethodManager, 1, 0) QT_END_NAMESPACE diff --git a/src/compositor/global/qwaylandquickextension.h b/src/compositor/global/qwaylandquickextension.h index 2338b0d6e..5286f120a 100644 --- a/src/compositor/global/qwaylandquickextension.h +++ b/src/compositor/global/qwaylandquickextension.h @@ -78,24 +78,63 @@ QT_BEGIN_NAMESPACE }; #define Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(className, QmlType) \ - class Q_WAYLANDCOMPOSITOR_EXPORT className##QuickExtension : public className, public QQmlParserStatus \ - { \ -/* qmake ignore Q_OBJECT */ \ - Q_OBJECT \ - Q_PROPERTY(QQmlListProperty<QObject> data READ data DESIGNABLE false) \ - Q_CLASSINFO("DefaultProperty", "data") \ - Q_INTERFACES(QQmlParserStatus) \ - QML_NAMED_ELEMENT(QmlType) \ - QML_ADDED_IN_VERSION(1, 0) \ - public: \ - QQmlListProperty<QObject> data() \ - { \ - return QQmlListProperty<QObject>(this, &m_objects); \ - } \ - void classBegin() override {} \ - void componentComplete() override { if (!isInitialized()) initialize(); } \ - private: \ - QList<QObject *> m_objects; \ + Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(className, QmlType, 1, 0) + +#define Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(...) \ + QT_OVERLOADED_MACRO(Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT, __VA_ARGS__) + +#define Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT_4(className, QmlType, versionMajor, \ + versionMinor) \ + class Q_WAYLANDCOMPOSITOR_EXPORT className##QuickExtension : public className, \ + public QQmlParserStatus \ + { \ + /* qmake ignore Q_OBJECT */ \ + Q_OBJECT \ + Q_PROPERTY(QQmlListProperty<QObject> data READ data DESIGNABLE false) \ + Q_CLASSINFO("DefaultProperty", "data") \ + Q_INTERFACES(QQmlParserStatus) \ + QML_NAMED_ELEMENT(QmlType) \ + QML_ADDED_IN_VERSION(versionMajor, versionMinor) \ + public: \ + QQmlListProperty<QObject> data() \ + { \ + return QQmlListProperty<QObject>(this, &m_objects); \ + } \ + void classBegin() override { } \ + void componentComplete() override \ + { \ + if (!isInitialized()) \ + initialize(); \ + } \ + \ + private: \ + QList<QObject *> m_objects; \ + }; + +#define Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT_2(className, QmlType) \ + class Q_WAYLANDCOMPOSITOR_EXPORT className##QuickExtension : public className, \ + public QQmlParserStatus \ + { \ + /* qmake ignore Q_OBJECT */ \ + Q_OBJECT \ + Q_PROPERTY(QQmlListProperty<QObject> data READ data DESIGNABLE false) \ + Q_CLASSINFO("DefaultProperty", "data") \ + Q_INTERFACES(QQmlParserStatus) \ + QML_NAMED_ELEMENT(QmlType) \ + public: \ + QQmlListProperty<QObject> data() \ + { \ + return QQmlListProperty<QObject>(this, &m_objects); \ + } \ + void classBegin() override { } \ + void componentComplete() override \ + { \ + if (!isInitialized()) \ + initialize(); \ + } \ + \ + private: \ + QList<QObject *> m_objects; \ }; QT_END_NAMESPACE diff --git a/src/compositor/global/qwaylandquickextension.qdoc b/src/compositor/global/qwaylandquickextension.qdoc index 5977e56c9..f3a213a11 100644 --- a/src/compositor/global/qwaylandquickextension.qdoc +++ b/src/compositor/global/qwaylandquickextension.qdoc @@ -27,7 +27,7 @@ * \l{QWaylandCompositorExtension::initialize()} will be called automatically. The type must be * manually registered in Qt Quick using \l{qmlRegisterType()}. * - * \sa Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS + * \sa Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT */ /*! @@ -48,10 +48,38 @@ /*! * \macro Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(className, QmlType) * \relates <QWaylandQuickExtension> + * \deprecated [6.8] Use Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT instead. * * This macro can be used to define a Qt Quick class based on a Wayland extension. It defines * a new class which inherits from \a className and which suffixes the name with "QuickExtension". * * The macro works the same as \l{Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS}, but will also - * automatically register the new type as \a QmlType in Qt Quick. + * automatically register the new type as \a QmlType in the current QML module with \l + * QML_ADDED_IN_VERSION set to 1.0. + */ + +/*! +\macro Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(className, QmlType) +\relates <QWaylandQuickExtension> +\since 6.8 + +This macro can be used to define a Qt Quick class based on a Wayland extension. It defines +a new class which inherits from \a className and which suffixes the name with "QuickExtension". + +The macro works the same as \l{Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS}, but will also +automatically register the new type as \a QmlType in the current QML module. +*/ + +/*! +\macro Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(className, QmlType, versionMajor, versionMinor) +\relates <QWaylandQuickExtension> +\internal +\since 6.8 + +This macro can be used to define a Qt Quick class based on a Wayland extension. It defines +a new class which inherits from \a className and which suffixes the name with "QuickExtension". + +The macro works the same as \l{Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS}, but will also +automatically register the new type as \a QmlType in the current QML module with +\l QML_ADDED_IN_VERSION set to the version passed via \a versionMajor and \a versionMinor. */ diff --git a/src/imports/compositor-extensions/iviapplication/CMakeLists.txt b/src/imports/compositor-extensions/iviapplication/CMakeLists.txt index eaf0f8770..a2899fa27 100644 --- a/src/imports/compositor-extensions/iviapplication/CMakeLists.txt +++ b/src/imports/compositor-extensions/iviapplication/CMakeLists.txt @@ -10,19 +10,14 @@ qt_internal_add_qml_module(WaylandCompositorIviapplication URI "QtWayland.Compositor.IviApplication" VERSION "${PROJECT_VERSION}" - CLASS_NAME QWaylandCompositorIviApplicationPlugin - PLUGIN_TARGET WaylandCompositorIviapplication - NO_PLUGIN_OPTIONAL - NO_GENERATE_PLUGIN_SOURCE - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" SOURCES - qwaylandcompositoriviapplicationplugin.cpp + qwaylandcompositoriviapplicationforeign.cpp qwaylandcompositoriviapplicationforeign_p.h LIBRARIES Qt::Core Qt::Gui Qt::WaylandCompositor NO_GENERATE_CPP_EXPORTS + PAST_MAJOR_VERSIONS 1 ) qt_internal_add_autogen_sync_header_dependencies(WaylandCompositorIviapplication WaylandCompositor) diff --git a/src/imports/compositor-extensions/iviapplication/plugins.qmltypes b/src/imports/compositor-extensions/iviapplication/plugins.qmltypes deleted file mode 100644 index 4427fe42a..000000000 --- a/src/imports/compositor-extensions/iviapplication/plugins.qmltypes +++ /dev/null @@ -1,61 +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.IviApplication 6.0' - -Module { - dependencies: ["QtQuick 2.0"] - Component { name: "QWaylandCompositorExtension"; prototype: "QWaylandObject" } - Component { - name: "QWaylandIviApplication" - prototype: "QWaylandCompositorExtension" - Signal { - name: "iviSurfaceRequested" - Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "iviId"; type: "uint" } - Parameter { name: "resource"; type: "QWaylandResource" } - } - Signal { - name: "iviSurfaceCreated" - Parameter { name: "iviSurface"; type: "QWaylandIviSurface"; isPointer: true } - } - } - Component { - name: "QWaylandIviApplicationQuickExtension" - defaultProperty: "data" - prototype: "QWaylandIviApplication" - exports: ["QtWayland.Compositor.IviApplication/IviApplication 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QWaylandIviSurface" - defaultProperty: "data" - prototype: "QWaylandShellSurface" - exports: ["QtWayland.Compositor.IviApplication/IviSurface 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "surface"; type: "QWaylandSurface"; isReadonly: true; isPointer: true } - Property { name: "iviId"; type: "uint"; isReadonly: true } - Method { - name: "initialize" - Parameter { name: "iviApplication"; type: "QWaylandIviApplication"; isPointer: true } - Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "iviId"; type: "uint" } - Parameter { name: "resource"; type: "QWaylandResource" } - } - Method { - name: "sendConfigure" - Parameter { name: "size"; type: "QSize" } - } - } - Component { name: "QWaylandObject"; prototype: "QObject" } - Component { - name: "QWaylandShellSurface" - prototype: "QWaylandCompositorExtension" - Property { name: "windowType"; type: "Qt::WindowType"; isReadonly: true } - } -} diff --git a/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationforeign.cpp b/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationforeign.cpp new file mode 100644 index 000000000..66a38fbf4 --- /dev/null +++ b/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationforeign.cpp @@ -0,0 +1,29 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include "qwaylandcompositoriviapplicationforeign_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \qmlmodule QtWayland.Compositor.IviApplication + \title Qt Wayland IviApplication Extension + \ingroup qmlmodules + \brief Provides a Qt API for the IviApplication shell extension. + + \section2 Summary + IviApplication is a shell extension suitable for lightweight compositors, + for example in In-Vehicle Infotainment (IVI) systems. + + IviApplication corresponds to the Wayland \c ivi_application interface. + + \section2 Usage + To use this module, import it like this: + \qml + import QtWayland.Compositor.IviApplication + \endqml +*/ + +QT_END_NAMESPACE + +#include "moc_qwaylandcompositoriviapplicationforeign_p.cpp" diff --git a/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationforeign_p.h b/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationforeign_p.h new file mode 100644 index 000000000..89d5e7eba --- /dev/null +++ b/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationforeign_p.h @@ -0,0 +1,39 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#ifndef QWAYLANDCOMPOSITORIVIAPPLICATIONFOREIGN_H +#define QWAYLANDCOMPOSITORIVIAPPLICATIONFOREIGN_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.h> +#include <QtWaylandCompositor/qwaylandiviapplication.h> +#include <QtWaylandCompositor/qwaylandivisurface.h> + +QT_BEGIN_NAMESPACE + +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandIviApplication, IviApplication, 1, 0) + +struct QWaylandIviSurfaceForeign { + Q_GADGET + QML_FOREIGN(QWaylandIviSurface) + QML_NAMED_ELEMENT(IviSurface) + QML_ADDED_IN_VERSION(1, 0) +}; + + +QT_END_NAMESPACE + +#endif diff --git a/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationplugin.cpp b/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationplugin.cpp deleted file mode 100644 index 0c53fb332..000000000 --- a/src/imports/compositor-extensions/iviapplication/qwaylandcompositoriviapplicationplugin.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -#include <QtQml/qqmlextensionplugin.h> -#include <QtQml/qqml.h> - -#include <QtWaylandCompositor/qwaylandquickextension.h> -#include <QtWaylandCompositor/qwaylandiviapplication.h> -#include <QtWaylandCompositor/qwaylandivisurface.h> - -QT_BEGIN_NAMESPACE - -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandIviApplication) - -/*! - \qmlmodule QtWayland.Compositor.IviApplication - \title Qt Wayland IviApplication Extension - \ingroup qmlmodules - \brief Provides a Qt API for the IviApplication shell extension. - - \section2 Summary - IviApplication is a shell extension suitable for lightweight compositors, - for example in In-Vehicle Infotainment (IVI) systems. - - IviApplication corresponds to the Wayland \c ivi_application interface. - - \section2 Usage - To use this module, import it like this: - \qml - import QtWayland.Compositor.IviApplication - \endqml -*/ - -class QWaylandCompositorIviApplicationPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) -public: - void registerTypes(const char *uri) override - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor.IviApplication")); - defineModule(uri); - } - - static void defineModule(const char *uri) - { - qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR); - qmlRegisterType<QWaylandIviApplicationQuickExtension>(uri, 1, 0, "IviApplication"); - qmlRegisterType<QWaylandIviSurface>(uri, 1, 0, "IviSurface"); - } -}; - -QT_END_NAMESPACE - -#include "qwaylandcompositoriviapplicationplugin.moc" diff --git a/src/imports/compositor-extensions/presentationtime/CMakeLists.txt b/src/imports/compositor-extensions/presentationtime/CMakeLists.txt index f1413dfc1..2a817c012 100644 --- a/src/imports/compositor-extensions/presentationtime/CMakeLists.txt +++ b/src/imports/compositor-extensions/presentationtime/CMakeLists.txt @@ -5,21 +5,24 @@ ## qwaylandcompositorpresentationtimeplugin Plugin: ##################################################################### +# Note: INTERFACE_AUTOMOC_MACRO_NAMES is a CMake 3.27 feature, so readd it here for older CMake versions. +list(APPEND CMAKE_AUTOMOC_MACRO_NAMES + "Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT" + "Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS" + "Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS" + "Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CONTAINER_CLASS") + qt_internal_add_qml_module(WaylandCompositorPresentationTime URI "QtWayland.Compositor.PresentationTime" VERSION "${PROJECT_VERSION}" - CLASS_NAME QWaylandCompositorPresentationTimePlugin - PLUGIN_TARGET WaylandCompositorPresentationTime - NO_PLUGIN_OPTIONAL - NO_GENERATE_PLUGIN_SOURCE - NO_GENERATE_QMLTYPES SOURCES - qwaylandcompositorpresentationtimeplugin.cpp + qwaylandcompositorpresentationtimeforeign.cpp qwaylandcompositorpresentationtimeforeign_p.h LIBRARIES Qt::Core Qt::Gui Qt::WaylandCompositorPrivate NO_GENERATE_CPP_EXPORTS + PAST_MAJOR_VERSIONS 1 ) qt_internal_add_autogen_sync_header_dependencies(WaylandCompositorPresentationTime diff --git a/src/imports/compositor-extensions/presentationtime/qwaylandcompositorpresentationtimeplugin.cpp b/src/imports/compositor-extensions/presentationtime/qwaylandcompositorpresentationtimeforeign.cpp index ad835af91..05807e74f 100644 --- a/src/imports/compositor-extensions/presentationtime/qwaylandcompositorpresentationtimeplugin.cpp +++ b/src/imports/compositor-extensions/presentationtime/qwaylandcompositorpresentationtimeforeign.cpp @@ -1,16 +1,10 @@ // Copyright (C) 2021 LG Electronics Inc. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only -#include <QtQml/qqmlextensionplugin.h> -#include <QtQml/qqml.h> - -#include <QtWaylandCompositor/qwaylandquickextension.h> -#include <QtWaylandCompositor/private/qwaylandpresentationtime_p.h> +#include "qwaylandcompositorpresentationtimeforeign_p.h" QT_BEGIN_NAMESPACE -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandPresentationTime) - /*! \qmlmodule QtWayland.Compositor.PresentationTime \title Qt Wayland Presentation Time Extension @@ -33,23 +27,6 @@ Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandPresentationTime) \endqml */ -class QWaylandCompositorPresentationTimePlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) -public: - void registerTypes(const char *uri) override - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor.PresentationTime")); - defineModule(uri); - } - - static void defineModule(const char *uri) - { - qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR); - qmlRegisterType<QWaylandPresentationTime>(uri, 1, 0, "PresentationTime"); - } -}; QT_END_NAMESPACE -#include "qwaylandcompositorpresentationtimeplugin.moc" +#include "moc_qwaylandcompositorpresentationtimeforeign_p.cpp" diff --git a/src/imports/compositor-extensions/presentationtime/qwaylandcompositorpresentationtimeforeign_p.h b/src/imports/compositor-extensions/presentationtime/qwaylandcompositorpresentationtimeforeign_p.h new file mode 100644 index 000000000..63827320e --- /dev/null +++ b/src/imports/compositor-extensions/presentationtime/qwaylandcompositorpresentationtimeforeign_p.h @@ -0,0 +1,30 @@ +// Copyright (C) 2021 LG Electronics Inc. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#ifndef QWAYLANDCOMPOSITORPRESENTATIONTIMEFOREIGN_H +#define QWAYLANDCOMPOSITORPRESENTATIONTIMEFOREIGN_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.h> +#include <QtWaylandCompositor/private/qwaylandpresentationtime_p.h> + +QT_BEGIN_NAMESPACE + +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandPresentationTime, PresentationTime, 1, 0) + +QT_END_NAMESPACE + +#endif diff --git a/src/imports/compositor-extensions/qtshell/CMakeLists.txt b/src/imports/compositor-extensions/qtshell/CMakeLists.txt index 7bb165bf3..429d0c26b 100644 --- a/src/imports/compositor-extensions/qtshell/CMakeLists.txt +++ b/src/imports/compositor-extensions/qtshell/CMakeLists.txt @@ -8,18 +8,13 @@ qt_internal_add_qml_module(WaylandCompositorQtShell URI "QtWayland.Compositor.QtShell" VERSION "${PROJECT_VERSION}" - CLASS_NAME QWaylandQtShellPlugin - NO_PLUGIN_OPTIONAL PLUGIN_TARGET WaylandCompositorQtShell - NO_GENERATE_PLUGIN_SOURCE - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" - SOURCES - qwaylandqtshellplugin.cpp qwaylandqtshell.cpp qwaylandqtshell.h qwaylandqtshell_p.h qwaylandqtshellintegration.cpp qwaylandqtshellintegration_p.h qwaylandqtshellchrome.cpp qwaylandqtshellchrome.h qwaylandqtshellchrome_p.h + DEPENDENCIES + QtQuick LIBRARIES Qt::Core Qt::Gui @@ -27,7 +22,7 @@ qt_internal_add_qml_module(WaylandCompositorQtShell Qt::QuickPrivate Qt::WaylandCompositor Qt::WaylandCompositorPrivate - NO_GENERATE_CPP_EXPORTS + PAST_MAJOR_VERSIONS 1 ) qt6_generate_wayland_protocol_server_sources(WaylandCompositorQtShell diff --git a/src/imports/compositor-extensions/qtshell/plugins.qmltypes b/src/imports/compositor-extensions/qtshell/plugins.qmltypes deleted file mode 100644 index 3c09260f9..000000000 --- a/src/imports/compositor-extensions/qtshell/plugins.qmltypes +++ /dev/null @@ -1,442 +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.QtShell 6.2' -// -// qmlplugindump is deprecated! You should use qmltyperegistrar instead. - -Module { - Component { - name: "QQuickAnchors" - prototype: "QObject" - Enum { - name: "Anchors" - values: { - "InvalidAnchor": 0, - "LeftAnchor": 1, - "RightAnchor": 2, - "TopAnchor": 4, - "BottomAnchor": 8, - "HCenterAnchor": 16, - "VCenterAnchor": 32, - "BaselineAnchor": 64, - "Horizontal_Mask": 19, - "Vertical_Mask": 108 - } - } - Property { name: "left"; type: "QQuickAnchorLine" } - Property { name: "right"; type: "QQuickAnchorLine" } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine" } - Property { name: "top"; type: "QQuickAnchorLine" } - Property { name: "bottom"; type: "QQuickAnchorLine" } - Property { name: "verticalCenter"; type: "QQuickAnchorLine" } - Property { name: "baseline"; type: "QQuickAnchorLine" } - Property { name: "margins"; type: "double" } - Property { name: "leftMargin"; type: "double" } - Property { name: "rightMargin"; type: "double" } - Property { name: "horizontalCenterOffset"; type: "double" } - Property { name: "topMargin"; type: "double" } - Property { name: "bottomMargin"; type: "double" } - Property { name: "verticalCenterOffset"; type: "double" } - Property { name: "baselineOffset"; type: "double" } - Property { name: "fill"; type: "QQuickItem"; isPointer: true } - Property { name: "centerIn"; type: "QQuickItem"; isPointer: true } - Property { name: "alignWhenCentered"; type: "bool" } - Signal { name: "centerAlignedChanged" } - } - Component { - name: "QQuickColorGroup" - prototype: "QObject" - Property { name: "alternateBase"; type: "QColor" } - Property { name: "base"; type: "QColor" } - Property { name: "brightText"; type: "QColor" } - Property { name: "button"; type: "QColor" } - Property { name: "buttonText"; type: "QColor" } - Property { name: "dark"; type: "QColor" } - Property { name: "highlight"; type: "QColor" } - Property { name: "highlightedText"; type: "QColor" } - Property { name: "light"; type: "QColor" } - Property { name: "link"; type: "QColor" } - Property { name: "linkVisited"; type: "QColor" } - Property { name: "mid"; type: "QColor" } - Property { name: "midlight"; type: "QColor" } - Property { name: "shadow"; type: "QColor" } - Property { name: "text"; type: "QColor" } - Property { name: "toolTipBase"; type: "QColor" } - Property { name: "toolTipText"; type: "QColor" } - Property { name: "window"; type: "QColor" } - Property { name: "windowText"; type: "QColor" } - Property { name: "placeholderText"; revision: 1538; type: "QColor" } - Signal { name: "placeholderTextChanged"; revision: 1538 } - Signal { name: "changed" } - } - Component { - name: "QQuickItem" - defaultProperty: "data" - prototype: "QObject" - Enum { - name: "Flags" - values: { - "ItemClipsChildrenToShape": 1, - "ItemAcceptsInputMethod": 2, - "ItemIsFocusScope": 4, - "ItemHasContents": 8, - "ItemAcceptsDrops": 16 - } - } - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "palette"; revision: 1536; type: "QQuickPalette"; isPointer: true } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "state"; type: "string" } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 513; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "QQuickItem::TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "containmentMask"; revision: 523; type: "QObject"; isPointer: true } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 513 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 513 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Signal { name: "containmentMaskChanged"; revision: 523 } - Signal { name: "paletteChanged"; revision: 1536 } - Signal { name: "paletteCreated"; revision: 1536 } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 516 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 516 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 519 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 519 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 513 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 513; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickItemLayer" - prototype: "QObject" - Property { name: "enabled"; type: "bool" } - Property { name: "textureSize"; type: "QSize" } - Property { name: "sourceRect"; type: "QRectF" } - Property { name: "mipmap"; type: "bool" } - Property { name: "smooth"; type: "bool" } - Property { name: "wrapMode"; type: "QQuickShaderEffectSource::WrapMode" } - Property { name: "format"; type: "QQuickShaderEffectSource::Format" } - Property { name: "samplerName"; type: "QByteArray" } - Property { name: "effect"; type: "QQmlComponent"; isPointer: true } - Property { name: "textureMirroring"; type: "QQuickShaderEffectSource::TextureMirroring" } - Property { name: "samples"; type: "int" } - Signal { - name: "enabledChanged" - Parameter { name: "enabled"; type: "bool" } - } - Signal { - name: "sizeChanged" - Parameter { name: "size"; type: "QSize" } - } - Signal { - name: "mipmapChanged" - Parameter { name: "mipmap"; type: "bool" } - } - Signal { - name: "wrapModeChanged" - Parameter { name: "mode"; type: "QQuickShaderEffectSource::WrapMode" } - } - Signal { - name: "nameChanged" - Parameter { name: "name"; type: "QByteArray" } - } - Signal { - name: "effectChanged" - Parameter { name: "component"; type: "QQmlComponent"; isPointer: true } - } - Signal { - name: "smoothChanged" - Parameter { name: "smooth"; type: "bool" } - } - Signal { - name: "formatChanged" - Parameter { name: "format"; type: "QQuickShaderEffectSource::Format" } - } - Signal { - name: "sourceRectChanged" - Parameter { name: "sourceRect"; type: "QRectF" } - } - Signal { - name: "textureMirroringChanged" - Parameter { name: "mirroring"; type: "QQuickShaderEffectSource::TextureMirroring" } - } - Signal { - name: "samplesChanged" - Parameter { name: "count"; type: "int" } - } - } - Component { - name: "QQuickPalette" - prototype: "QQuickColorGroup" - Property { name: "active"; type: "QQuickColorGroup"; isPointer: true } - Property { name: "inactive"; type: "QQuickColorGroup"; isPointer: true } - Property { name: "disabled"; type: "QQuickColorGroup"; isPointer: true } - Method { - name: "setActive" - Parameter { name: "active"; type: "QQuickColorGroup"; isPointer: true } - } - Method { - name: "setInactive" - Parameter { name: "inactive"; type: "QQuickColorGroup"; isPointer: true } - } - Method { - name: "setDisabled" - Parameter { name: "disabled"; type: "QQuickColorGroup"; isPointer: true } - } - } - Component { name: "QWaylandCompositorExtension"; prototype: "QWaylandObject" } - Component { name: "QWaylandObject"; prototype: "QObject" } - Component { - name: "QWaylandQtShell" - prototype: "QWaylandCompositorExtension" - Signal { - name: "qtShellSurfaceRequested" - Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "windowId"; type: "uint" } - Parameter { name: "resource"; type: "QWaylandResource" } - } - Signal { - name: "qtShellSurfaceCreated" - Parameter { name: "qtShellSurface"; type: "QWaylandQtShellSurface"; isPointer: true } - } - } - Component { - name: "QWaylandQtShellChrome" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWayland.Compositor.QtShell/QtShellChrome 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "hasDecorations"; type: "bool"; isReadonly: true } - Property { name: "windowState"; type: "uint"; isReadonly: true } - Property { name: "windowFlags"; type: "uint"; isReadonly: true } - Property { name: "shellSurfaceItem"; type: "QWaylandQuickShellSurfaceItem"; isPointer: true } - Property { name: "maximizedRect"; type: "QRect" } - Property { name: "frameMarginLeft"; type: "int" } - Property { name: "frameMarginRight"; type: "int" } - Property { name: "frameMarginTop"; type: "int" } - Property { name: "frameMarginBottom"; type: "int" } - Property { name: "titleBar"; type: "QQuickItem"; isPointer: true } - Property { name: "leftResizeHandle"; type: "QQuickItem"; isPointer: true } - Property { name: "rightResizeHandle"; type: "QQuickItem"; isPointer: true } - Property { name: "topResizeHandle"; type: "QQuickItem"; isPointer: true } - Property { name: "bottomResizeHandle"; type: "QQuickItem"; isPointer: true } - Property { name: "topLeftResizeHandle"; type: "QQuickItem"; isPointer: true } - Property { name: "topRightResizeHandle"; type: "QQuickItem"; isPointer: true } - Property { name: "bottomLeftResizeHandle"; type: "QQuickItem"; isPointer: true } - Property { name: "bottomRightResizeHandle"; type: "QQuickItem"; isPointer: true } - Signal { name: "currentWindowStateChanged" } - Signal { name: "currentWindowFlagsChanged" } - Signal { name: "windowMetaInfoChanged" } - Signal { name: "activated" } - Signal { name: "deactivated" } - Signal { name: "clientDestroyed" } - Signal { name: "frameMarginChanged" } - Method { name: "raise" } - Method { name: "lower" } - Method { name: "toggleMaximized" } - Method { name: "toggleMinimized" } - Method { name: "toggleFullScreen" } - Method { name: "activate" } - Method { name: "deactivate" } - } - Component { - name: "QWaylandQtShellQuickExtension" - defaultProperty: "data" - prototype: "QWaylandQtShell" - exports: ["QtWayland.Compositor.QtShell/QtShell 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QWaylandQtShellSurface" - defaultProperty: "data" - prototype: "QWaylandShellSurface" - exports: ["QtWayland.Compositor.QtShell/QtShellSurface 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "surface"; type: "QWaylandSurface"; isReadonly: true; isPointer: true } - Property { name: "windowId"; type: "uint"; isReadonly: true } - Property { name: "windowFlags"; type: "uint"; isReadonly: true } - Property { name: "windowState"; type: "uint"; isReadonly: true } - Property { name: "windowTitle"; type: "string"; isReadonly: true } - Property { name: "windowGeometry"; type: "QRect"; isReadonly: true } - Property { name: "windowPosition"; type: "QPoint" } - Property { name: "positionAutomatic"; type: "bool"; isReadonly: true } - Property { name: "minimumSize"; type: "QSize"; isReadonly: true } - Property { name: "maximumSize"; type: "QSize"; isReadonly: true } - Property { name: "frameMarginLeft"; type: "int" } - Property { name: "frameMarginRight"; type: "int" } - Property { name: "frameMarginTop"; type: "int" } - Property { name: "frameMarginBottom"; type: "int" } - Property { name: "active"; type: "bool" } - Signal { name: "startMove" } - Signal { name: "startResize" } - Signal { name: "frameMarginChanged" } - Signal { name: "raiseRequested" } - Signal { name: "lowerRequested" } - Method { - name: "initialize" - Parameter { name: "qtShell"; type: "QWaylandQtShell"; isPointer: true } - Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "windowId"; type: "uint" } - Parameter { name: "resource"; type: "QWaylandResource" } - } - Method { - name: "requestWindowGeometry" - Parameter { name: "windowState"; type: "uint" } - Parameter { name: "windowGeometry"; type: "QRect" } - } - Method { name: "sendClose" } - } - Component { - name: "QWaylandShellSurface" - prototype: "QWaylandCompositorExtension" - Property { name: "windowType"; type: "Qt::WindowType"; isReadonly: true } - } -} diff --git a/src/imports/compositor-extensions/qtshell/qwaylandqtshell.cpp b/src/imports/compositor-extensions/qtshell/qwaylandqtshell.cpp index d0715e8c2..0e918e734 100644 --- a/src/imports/compositor-extensions/qtshell/qwaylandqtshell.cpp +++ b/src/imports/compositor-extensions/qtshell/qwaylandqtshell.cpp @@ -844,4 +844,4 @@ void QWaylandQtShellSurfacePrivate::zqt_shell_surface_v1_lower(Resource *resourc QT_END_NAMESPACE -#include "moc_qwaylandqtshell.cpp" +#include "moc_qwaylandqtshell_p.cpp" diff --git a/src/imports/compositor-extensions/qtshell/qwaylandqtshell.h b/src/imports/compositor-extensions/qtshell/qwaylandqtshell.h index 6982e0b05..d322b9415 100644 --- a/src/imports/compositor-extensions/qtshell/qwaylandqtshell.h +++ b/src/imports/compositor-extensions/qtshell/qwaylandqtshell.h @@ -11,6 +11,7 @@ #include <QtWaylandCompositor/QWaylandShellSurface> #include <QtWaylandCompositor/qwaylandquickchildren.h> +#include <QtWaylandCompositor/qwaylandquickextension.h> struct wl_resource; struct wl_interface; @@ -50,6 +51,8 @@ private: bool moveChromeToFront(QWaylandQtShellChrome *chrome); }; +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandQtShell, QtShell, 1, 0) + class QWaylandQtShellSurfacePrivate; class QWaylandSurfaceRole; @@ -58,6 +61,8 @@ class QWaylandResource; class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQtShellSurface : public QWaylandShellSurfaceTemplate<QWaylandQtShellSurface> { Q_OBJECT + QML_NAMED_ELEMENT(QtShellSurface) + QML_ADDED_IN_VERSION(1, 0) Q_DECLARE_PRIVATE(QWaylandQtShellSurface) Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandQtShellSurface) Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged) diff --git a/src/imports/compositor-extensions/qtshell/qwaylandqtshell.qdoc b/src/imports/compositor-extensions/qtshell/qwaylandqtshell.qdoc new file mode 100644 index 000000000..d0e961245 --- /dev/null +++ b/src/imports/compositor-extensions/qtshell/qwaylandqtshell.qdoc @@ -0,0 +1,22 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \qmlmodule QtWayland.Compositor.QtShell + \title Qt Wayland Qt Shell Extension + \ingroup qmlmodules + \since 6.3 + \brief Provides a shell extension for Qt applications running on a Qt Wayland Compositor. + \section2 Summary + The QtShell extension provides a way to associate an QtShellSurface with a regular Wayland + surface. The QtShell extension is written to support the window management features which are + supported by Qt. It may be suitable on a platform where both the compositor and client + applications are written with Qt, and where applications are trusted not to abuse features such + as manual window positioning and "bring-to-front". + For other use cases, consider using IviApplication or XdgShell instead. + \section2 Usage + To use this module, import it like this: + \qml + import QtWayland.Compositor.IviApplication + \endqml +*/ diff --git a/src/imports/compositor-extensions/qtshell/qwaylandqtshellchrome.h b/src/imports/compositor-extensions/qtshell/qwaylandqtshellchrome.h index 381dd7f6d..4fb98008c 100644 --- a/src/imports/compositor-extensions/qtshell/qwaylandqtshellchrome.h +++ b/src/imports/compositor-extensions/qtshell/qwaylandqtshellchrome.h @@ -13,6 +13,8 @@ class QWaylandQtShellChromePrivate; class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQtShellChrome : public QQuickItem { Q_OBJECT + QML_NAMED_ELEMENT(QtShellChrome) + QML_ADDED_IN_VERSION(1, 0) Q_DECLARE_PRIVATE(QWaylandQtShellChrome) Q_PROPERTY(bool hasDecorations READ hasDecorations NOTIFY windowMetaInfoChanged) Q_PROPERTY(uint windowState READ currentWindowState NOTIFY currentWindowStateChanged) diff --git a/src/imports/compositor-extensions/qtshell/qwaylandqtshellplugin.cpp b/src/imports/compositor-extensions/qtshell/qwaylandqtshellplugin.cpp deleted file mode 100644 index 84f7090ab..000000000 --- a/src/imports/compositor-extensions/qtshell/qwaylandqtshellplugin.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -#include <QtQml/qqmlextensionplugin.h> -#include <QtQml/qqml.h> - -#include <QtWaylandCompositor/qwaylandquickextension.h> -#include "qwaylandqtshell.h" -#include "qwaylandqtshellchrome.h" - -QT_BEGIN_NAMESPACE - -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandQtShell) - -/*! - \qmlmodule QtWayland.Compositor.QtShell - \title Qt Wayland Qt Shell Extension - \ingroup qmlmodules - \since 6.3 - \brief Provides a shell extension for Qt applications running on a Qt Wayland Compositor. - - \section2 Summary - The QtShell extension provides a way to associate an QtShellSurface with a regular Wayland - surface. The QtShell extension is written to support the window management features which are - supported by Qt. It may be suitable on a platform where both the compositor and client - applications are written with Qt, and where applications are trusted not to abuse features such - as manual window positioning and "bring-to-front". - - For other use cases, consider using IviApplication or XdgShell instead. - - \section2 Usage - To use this module, import it like this: - \qml - import QtWayland.Compositor.IviApplication - \endqml -*/ - -class QQtWaylandShellPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) -public: - void registerTypes(const char *uri) override - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor.QtShell")); - defineModule(uri); - } - - static void defineModule(const char *uri) - { - qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR); - qmlRegisterType<QWaylandQtShellQuickExtension>(uri, 1, 0, "QtShell"); - qmlRegisterType<QWaylandQtShellSurface>(uri, 1, 0, "QtShellSurface"); - qmlRegisterType<QWaylandQtShellChrome>(uri, 1, 0, "QtShellChrome"); - } -}; - -QT_END_NAMESPACE - -#include "qwaylandqtshellplugin.moc" diff --git a/src/imports/compositor-extensions/wlshell/CMakeLists.txt b/src/imports/compositor-extensions/wlshell/CMakeLists.txt index 0dd155e35..8987621d3 100644 --- a/src/imports/compositor-extensions/wlshell/CMakeLists.txt +++ b/src/imports/compositor-extensions/wlshell/CMakeLists.txt @@ -1,33 +1,17 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -# Generated from wlshell.pro. - -##################################################################### -## qwaylandcompositorwlshellplugin Plugin: -##################################################################### - qt_internal_add_qml_module(WaylandCompositorWLShell URI "QtWayland.Compositor.WlShell" VERSION "${PROJECT_VERSION}" - CLASS_NAME QWaylandCompositorWlShellPlugin - NO_PLUGIN_OPTIONAL - PLUGIN_TARGET WaylandCompositorWLShell - NO_GENERATE_PLUGIN_SOURCE - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" SOURCES - qwaylandcompositorwlshellplugin.cpp + qwaylandcompositorwlshell_p.h qwaylandcompositorwlshell.cpp LIBRARIES Qt::Core Qt::Gui Qt::WaylandCompositor NO_GENERATE_CPP_EXPORTS + PAST_MAJOR_VERSIONS 1 ) qt_internal_add_autogen_sync_header_dependencies(WaylandCompositorWLShell WaylandCompositor) - -#### Keys ignored in scope 1:.:.:wlshell.pro:<TRUE>: -# CXX_MODULE = "qml" -# QML_IMPORT_VERSION = "$$QT_VERSION" -# TARGETPATH = "QtWayland/Compositor/WlShell" diff --git a/src/imports/compositor-extensions/wlshell/plugins.qmltypes b/src/imports/compositor-extensions/wlshell/plugins.qmltypes deleted file mode 100644 index 99a3ce9a6..000000000 --- a/src/imports/compositor-extensions/wlshell/plugins.qmltypes +++ /dev/null @@ -1,140 +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.WlShell 6.0' - -Module { - dependencies: ["QtQuick 2.0"] - Component { name: "QWaylandCompositorExtension"; prototype: "QWaylandObject" } - Component { name: "QWaylandObject"; prototype: "QObject" } - 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: "QWaylandWlShell" - prototype: "QWaylandShell" - Signal { - name: "wlShellSurfaceRequested" - Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "resource"; type: "QWaylandResource" } - } - Signal { - name: "wlShellSurfaceCreated" - Parameter { name: "shellSurface"; type: "QWaylandWlShellSurface"; isPointer: true } - } - Method { name: "closeAllPopups" } - } - Component { - name: "QWaylandWlShellQuickExtension" - defaultProperty: "data" - prototype: "QWaylandWlShell" - exports: ["QtWayland.Compositor.WlShell/WlShell 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QWaylandWlShellSurface" - defaultProperty: "data" - prototype: "QWaylandShellSurface" - exports: ["QtWayland.Compositor.WlShell/WlShellSurface 1.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "FullScreenMethod" - values: { - "DefaultFullScreen": 0, - "ScaleFullScreen": 1, - "DriverFullScreen": 2, - "FillFullScreen": 3 - } - } - Enum { - name: "ResizeEdge" - values: { - "NoneEdge": 0, - "TopEdge": 1, - "BottomEdge": 2, - "LeftEdge": 4, - "TopLeftEdge": 5, - "BottomLeftEdge": 6, - "RightEdge": 8, - "TopRightEdge": 9, - "BottomRightEdge": 10 - } - } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "surface"; type: "QWaylandSurface"; isReadonly: true; isPointer: true } - Property { name: "shell"; type: "QWaylandWlShell"; isReadonly: true; isPointer: true } - Property { name: "title"; type: "string"; isReadonly: true } - Property { name: "className"; type: "string"; isReadonly: true } - Signal { name: "pong" } - Signal { - name: "startMove" - Parameter { name: "seat"; type: "QWaylandSeat"; isPointer: true } - } - Signal { - name: "startResize" - Parameter { name: "seat"; type: "QWaylandSeat"; isPointer: true } - Parameter { name: "edges"; type: "ResizeEdge" } - } - Signal { name: "setDefaultToplevel" } - Signal { - name: "setTransient" - Parameter { name: "parentSurface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "relativeToParent"; type: "QPoint" } - Parameter { name: "inactive"; type: "bool" } - } - Signal { - name: "setFullScreen" - Parameter { name: "method"; type: "FullScreenMethod" } - Parameter { name: "framerate"; type: "uint" } - Parameter { name: "output"; type: "QWaylandOutput"; isPointer: true } - } - Signal { - name: "setPopup" - Parameter { name: "seat"; type: "QWaylandSeat"; isPointer: true } - Parameter { name: "parentSurface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "relativeToParent"; type: "QPoint" } - } - Signal { - name: "setMaximized" - Parameter { name: "output"; type: "QWaylandOutput"; isPointer: true } - } - Method { name: "ping" } - Method { - name: "initialize" - Parameter { name: "shell"; type: "QWaylandWlShell"; isPointer: true } - Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true } - Parameter { name: "resource"; type: "QWaylandResource" } - } - Method { - name: "sizeForResize" - type: "QSize" - Parameter { name: "size"; type: "QSizeF" } - Parameter { name: "delta"; type: "QPointF" } - Parameter { name: "edges"; type: "ResizeEdge" } - } - Method { - name: "sendConfigure" - Parameter { name: "size"; type: "QSize" } - Parameter { name: "edges"; type: "ResizeEdge" } - } - Method { name: "sendPopupDone" } - } -} diff --git a/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshell.cpp b/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshell.cpp new file mode 100644 index 000000000..3d7e6a6f1 --- /dev/null +++ b/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshell.cpp @@ -0,0 +1,30 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include "qwaylandcompositorwlshell_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \qmlmodule QtWayland.Compositor.WlShell + \title Qt Wayland WlShell extension + \ingroup qmlmodules + \brief Provides a Qt API for the WlShell extension. + + \section2 Summary + WlShell is a shell extension providing window system features typical to + desktop systems. It is superseded by XdgShell and exists in Qt mainly + for backwards compatibility with older applications. + + WlShell corresponds to the Wayland interface \c wl_shell. + + \section2 Usage + To use this module, import it like this: + \qml + import QtWayland.Compositor.WlShell + \endqml +*/ + +QT_END_NAMESPACE + +#include "moc_qwaylandcompositorwlshell_p.cpp" diff --git a/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshell_p.h b/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshell_p.h new file mode 100644 index 000000000..295d3562f --- /dev/null +++ b/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshell_p.h @@ -0,0 +1,37 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#ifndef QWAYLANDWLSHELLFOREIGN_H +#define QWAYLANDWLSHELLFOREIGN_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.h> +#include <QtWaylandCompositor/qwaylandwlshell.h> + +QT_BEGIN_NAMESPACE + +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_ELEMENT(QWaylandWlShell, WlShell, 1, 0) + +struct QWaylandWlShellForeign { + Q_GADGET + QML_FOREIGN(QWaylandWlShell) + QML_NAMED_ELEMENT(WlShellSurface) + QML_ADDED_IN_VERSION(1, 0) +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshellplugin.cpp b/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshellplugin.cpp deleted file mode 100644 index f489cdf12..000000000 --- a/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshellplugin.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -#include <QtQml/qqmlextensionplugin.h> -#include <QtQml/qqml.h> - -#include <QtWaylandCompositor/qwaylandquickextension.h> -#include <QtWaylandCompositor/qwaylandwlshell.h> - -QT_BEGIN_NAMESPACE - -Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandWlShell) - -/*! - \qmlmodule QtWayland.Compositor.WlShell - \title Qt Wayland WlShell extension - \ingroup qmlmodules - \brief Provides a Qt API for the WlShell extension. - - \section2 Summary - WlShell is a shell extension providing window system features typical to - desktop systems. It is superseded by XdgShell and exists in Qt mainly - for backwards compatibility with older applications. - - WlShell corresponds to the Wayland interface \c wl_shell. - - \section2 Usage - To use this module, import it like this: - \qml - import QtWayland.Compositor.WlShell - \endqml -*/ - -class QWaylandCompositorWlShellPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) -public: - void registerTypes(const char *uri) override - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor.WlShell")); - defineModule(uri); - } - - static void defineModule(const char *uri) - { - qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR); - qmlRegisterType<QWaylandWlShellQuickExtension>(uri, 1, 0, "WlShell"); - qmlRegisterType<QWaylandWlShellSurface>(uri, 1, 0, "WlShellSurface"); - } -}; - -QT_END_NAMESPACE - -#include "qwaylandcompositorwlshellplugin.moc" diff --git a/src/imports/compositor-extensions/xdgshell/CMakeLists.txt b/src/imports/compositor-extensions/xdgshell/CMakeLists.txt index d5bfd9dd8..32f032d93 100644 --- a/src/imports/compositor-extensions/xdgshell/CMakeLists.txt +++ b/src/imports/compositor-extensions/xdgshell/CMakeLists.txt @@ -1,33 +1,18 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -# Generated from xdgshell.pro. - -##################################################################### -## qwaylandcompositorxdgshellplugin Plugin: -##################################################################### - qt_internal_add_qml_module(WaylandCompositorXdgShell URI "QtWayland.Compositor.XdgShell" VERSION "${PROJECT_VERSION}" - NO_PLUGIN_OPTIONAL - PLUGIN_TARGET WaylandCompositorXdgShell - NO_GENERATE_PLUGIN_SOURCE - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" - CLASS_NAME QWaylandCompositorXdgShellPlugin SOURCES - qwaylandcompositorxdgshellplugin.cpp + qwaylandcompositorxdgshell_p.h + qwaylandcompositorxdgshell.cpp LIBRARIES Qt::Core Qt::Gui Qt::WaylandCompositor NO_GENERATE_CPP_EXPORTS + PAST_MAJOR_VERSIONS 1 ) qt_internal_add_autogen_sync_header_dependencies(WaylandCompositorXdgShell WaylandCompositor) - -#### Keys ignored in scope 1:.:.:xdgshell.pro:<TRUE>: -# CXX_MODULE = "qml" -# QML_IMPORT_VERSION = "$$QT_VERSION" -# TARGETPATH = "QtWayland/Compositor/XdgShell" 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/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 7dd4a3307..000000000 --- a/src/imports/compositor-extensions/xdgshell/qwaylandcompositorxdgshellplugin.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -#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) - -/*! - \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 -*/ - -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/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp b/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp index 54b15b3bf..5ee856944 100644 --- a/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp +++ b/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp @@ -111,7 +111,7 @@ public: explicit XdgDecorationCompositor() { exec([this] { - m_config.autoConfigure = true; + m_config.autoConfigure = false; add<XdgDecorationManagerV1>(xdgDecorationVersion); }); } diff --git a/tests/manual/import-qml-modules/CMakeLists.txt b/tests/manual/import-qml-modules/CMakeLists.txt new file mode 100644 index 000000000..c99218203 --- /dev/null +++ b/tests/manual/import-qml-modules/CMakeLists.txt @@ -0,0 +1,25 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) + +project(import_wayland_qml_modules VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Qt6 6.4 REQUIRED + COMPONENTS + Quick + WaylandCompositor + WaylandCompositorIviapplication + WaylandCompositorPresentationTime + WaylandCompositorWLShell + WaylandCompositorXdgShell +) + +qt_standard_project_setup() + +qt_add_qml_module(import_wayland_qml_modules + URI Qml + QML_FILES Main.qml +) diff --git a/tests/manual/import-qml-modules/Main.qml b/tests/manual/import-qml-modules/Main.qml new file mode 100644 index 000000000..07b8bc482 --- /dev/null +++ b/tests/manual/import-qml-modules/Main.qml @@ -0,0 +1,18 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtWayland.Compositor.IviApplication +import QtWayland.Compositor.PresentationTime +import QtWayland.Compositor.QtShell +import QtWayland.Compositor.WlShell +import QtWayland.Compositor.XdgShell + + +Item { + property var p1: IviApplication {} + property var p2: PresentationTime {} + property var p3: QtShellChrome {} + property var p4: WlShellSurface {} + property var p5: XdgPopup {} +} diff --git a/tests/manual/import-qml-modules/main.cpp b/tests/manual/import-qml-modules/main.cpp new file mode 100644 index 000000000..1b0b801ff --- /dev/null +++ b/tests/manual/import-qml-modules/main.cpp @@ -0,0 +1,19 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QtGui/QGuiApplication> +#include <QtQml/QQmlApplicationEngine> + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/Qml/Main.qml")); + QObject::connect( + &engine, &QQmlApplicationEngine::objectCreationFailed, &app, + []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); + engine.load(url); + + return app.exec(); +} |