summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-07-08 14:28:54 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-08-20 09:57:06 +0200
commitf3d40b02558f5eca54ddb33b132d350b958cac1e (patch)
treeca6fdbdd8525b75810feaccf62aa0d1c1de05002 /src
parenteca2eb2c19fdbb4ed5003d636d935fbf83968d70 (diff)
downloadqtwayland-f3d40b02558f5eca54ddb33b132d350b958cac1e.tar.gz
Port QtWayland.Compositor to new QML extension API
In order to add new properties and types in Qt 6, we need to port everything over to the new extension API in QML. This is generally more type safe and needs less manual maintenance, but there is some work involved in porting. The previous version exposed some types from the QtWaylandCompositor C++ library, extended a few of them with Qt Quick-specific subclass, added one additional C++-implemented type (QWaylandMouseTracker) and two additional QML-implemented types. We need all types to be defined in the same place for the automatic generation of plugins.qmltypes to work. Therefore all the additional types are moved from the plugin into the library, but still not exposed through public API. The plugin still exposes the types, so for the user this change will be transparent. Fixes: QTBUG-85512 Change-Id: I46e9e80424c9299c3eaee92773d233b1ec29cf2c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/.prev_CMakeLists.txt34
-rw-r--r--src/compositor/CMakeLists.txt35
-rw-r--r--src/compositor/compositor.pro7
-rw-r--r--src/compositor/compositor.qrc4
-rw-r--r--src/compositor/compositor_api/compositor_api.pri7
-rw-r--r--src/compositor/compositor_api/qml/WaylandCursorItem.qml (renamed from src/imports/compositor/WaylandCursorItem.qml)0
-rw-r--r--src/compositor/compositor_api/qml/WaylandOutputWindow.qml (renamed from src/imports/compositor/WaylandOutputWindow.qml)0
-rw-r--r--src/compositor/compositor_api/qwaylandclient.h5
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.h3
-rw-r--r--src/compositor/compositor_api/qwaylandcompositorquickextensions_p.h112
-rw-r--r--src/compositor/compositor_api/qwaylanddrag.h5
-rw-r--r--src/compositor/compositor_api/qwaylandkeymap.h3
-rw-r--r--src/compositor/compositor_api/qwaylandmousetracker.cpp (renamed from src/imports/compositor/qwaylandmousetracker.cpp)0
-rw-r--r--src/compositor/compositor_api/qwaylandmousetracker_p.h (renamed from src/imports/compositor/qwaylandmousetracker_p.h)13
-rw-r--r--src/compositor/compositor_api/qwaylandoutput.h3
-rw-r--r--src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h2
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.h2
-rw-r--r--src/compositor/compositor_api/qwaylandquickoutput.h2
-rw-r--r--src/compositor/compositor_api/qwaylandquicksurface.h2
-rw-r--r--src/compositor/compositor_api/qwaylandresource.h4
-rw-r--r--src/compositor/compositor_api/qwaylandseat.h4
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.h3
-rw-r--r--src/compositor/extensions/qwaylandquickshellsurfaceitem.h2
-rw-r--r--src/compositor/extensions/qwaylandshell.h4
-rw-r--r--src/compositor/extensions/qwaylandshellsurface.h3
-rw-r--r--src/compositor/global/qtwaylandcompositorglobal.h2
-rw-r--r--src/compositor/global/qwaylandcompositorextension.h4
-rw-r--r--src/compositor/global/qwaylandquickextension.h21
-rw-r--r--src/imports/compositor-extensions/iviapplication/qmldir2
-rw-r--r--src/imports/compositor-extensions/wlshell/qmldir2
-rw-r--r--src/imports/compositor-extensions/xdgshell/qmldir2
-rw-r--r--src/imports/compositor/CMakeLists.txt24
-rw-r--r--src/imports/compositor/compositor.pro17
-rw-r--r--src/imports/compositor/compositor.qrc6
-rw-r--r--src/imports/compositor/plugins.qmltypes552
-rw-r--r--src/imports/compositor/qmldir1
-rw-r--r--src/imports/compositor/qwaylandquickcompositorplugin.cpp114
-rw-r--r--src/imports/texture-sharing-extension/qmldir1
-rw-r--r--src/imports/texture-sharing/qmldir1
39 files changed, 304 insertions, 704 deletions
diff --git a/src/compositor/.prev_CMakeLists.txt b/src/compositor/.prev_CMakeLists.txt
index bb9809c7..59b0700d 100644
--- a/src/compositor/.prev_CMakeLists.txt
+++ b/src/compositor/.prev_CMakeLists.txt
@@ -5,6 +5,7 @@
#####################################################################
qt_add_module(WaylandCompositor
+ GENERATE_METATYPES
PLUGIN_TYPES wayland-graphics-integration-server wayland-hardware-layer-integration
SOURCES
../shared/qwaylandinputmethodeventbuilder.cpp ../shared/qwaylandinputmethodeventbuilder_p.h
@@ -13,9 +14,11 @@ qt_add_module(WaylandCompositor
compositor_api/qwaylandbufferref.cpp compositor_api/qwaylandbufferref.h
compositor_api/qwaylandclient.cpp compositor_api/qwaylandclient.h
compositor_api/qwaylandcompositor.cpp compositor_api/qwaylandcompositor.h compositor_api/qwaylandcompositor_p.h
+ compositor_api/qwaylandcompositorquickextensions_p.h
compositor_api/qwaylanddestroylistener.cpp compositor_api/qwaylanddestroylistener.h compositor_api/qwaylanddestroylistener_p.h
compositor_api/qwaylandkeyboard.cpp compositor_api/qwaylandkeyboard.h compositor_api/qwaylandkeyboard_p.h
compositor_api/qwaylandkeymap.cpp compositor_api/qwaylandkeymap.h compositor_api/qwaylandkeymap_p.h
+ compositor_api/qwaylandmousetracker.cpp compositor_api/qwaylandmousetracker_p.h
compositor_api/qwaylandoutput.cpp compositor_api/qwaylandoutput.h compositor_api/qwaylandoutput_p.h
compositor_api/qwaylandoutputmode.cpp compositor_api/qwaylandoutputmode.h compositor_api/qwaylandoutputmode_p.h
compositor_api/qwaylandpointer.cpp compositor_api/qwaylandpointer.h compositor_api/qwaylandpointer_p.h
@@ -82,6 +85,23 @@ qt_add_resource(WaylandCompositor "compositor"
FILES
${compositor_resource_files}
)
+set_source_files_properties("compositor_api/qml/WaylandCursorItem.qml"
+ PROPERTIES QT_RESOURCE_ALIAS "WaylandCursorItem.qml"
+)
+set_source_files_properties("compositor_api/qml/WaylandOutputWindow.qml"
+ PROPERTIES QT_RESOURCE_ALIAS "WaylandOutputWindow.qml"
+)
+set(compositor1_resource_files
+ "compositor_api/qml/WaylandCursorItem.qml"
+ "compositor_api/qml/WaylandOutputWindow.qml"
+)
+
+qt_add_resource(WaylandCompositor "compositor1"
+ PREFIX
+ "/QtWayland/Compositor"
+ FILES
+ ${compositor1_resource_files}
+)
qt6_generate_wayland_protocol_server_sources(WaylandCompositor
@@ -102,6 +122,10 @@ qt6_generate_wayland_protocol_server_sources(WaylandCompositor
#### Keys ignored in scope 1:.:.:compositor.pro:<TRUE>:
# MODULE = "waylandcompositor"
+# QMLTYPES_FILENAME = "plugins.qmltypes"
+# QMLTYPES_INSTALL_DIR = "$$[QT_INSTALL_QML]/QtWayland/Compositor"
+# QML_IMPORT_NAME = "QtWayland.Compositor"
+# QML_IMPORT_VERSION = "$$QT_VERSION"
## Scopes:
#####################################################################
@@ -206,3 +230,13 @@ qt_add_docs(WaylandCompositor
doc/qtwaylandcompositor.qdocconf
)
+
+set_target_properties(WaylandCompositor PROPERTIES
+ QT_QML_MODULE_INSTALL_QMLTYPES TRUE
+ QT_QML_MODULE_VERSION ${CMAKE_PROJECT_VERSION}
+ QT_QML_MODULE_URI QtWayland.Compositor
+ QT_QMLTYPES_FILENAME plugins.qmltypes
+ QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtWayland/Compositor"
+)
+
+qt6_qml_type_registration(WaylandCompositor)
diff --git a/src/compositor/CMakeLists.txt b/src/compositor/CMakeLists.txt
index 71a7e133..bbeba1e7 100644
--- a/src/compositor/CMakeLists.txt
+++ b/src/compositor/CMakeLists.txt
@@ -5,6 +5,7 @@
#####################################################################
qt_add_module(WaylandCompositor
+ GENERATE_METATYPES
PLUGIN_TYPES wayland-graphics-integration-server wayland-hardware-layer-integration
SOURCES
../shared/qwaylandinputmethodeventbuilder.cpp ../shared/qwaylandinputmethodeventbuilder_p.h
@@ -13,9 +14,11 @@ qt_add_module(WaylandCompositor
compositor_api/qwaylandbufferref.cpp compositor_api/qwaylandbufferref.h
compositor_api/qwaylandclient.cpp compositor_api/qwaylandclient.h
compositor_api/qwaylandcompositor.cpp compositor_api/qwaylandcompositor.h compositor_api/qwaylandcompositor_p.h
+ compositor_api/qwaylandcompositorquickextensions_p.h
compositor_api/qwaylanddestroylistener.cpp compositor_api/qwaylanddestroylistener.h compositor_api/qwaylanddestroylistener_p.h
compositor_api/qwaylandkeyboard.cpp compositor_api/qwaylandkeyboard.h compositor_api/qwaylandkeyboard_p.h
compositor_api/qwaylandkeymap.cpp compositor_api/qwaylandkeymap.h compositor_api/qwaylandkeymap_p.h
+ compositor_api/qwaylandmousetracker.cpp compositor_api/qwaylandmousetracker_p.h
compositor_api/qwaylandoutput.cpp compositor_api/qwaylandoutput.h compositor_api/qwaylandoutput_p.h
compositor_api/qwaylandoutputmode.cpp compositor_api/qwaylandoutputmode.h compositor_api/qwaylandoutputmode_p.h
compositor_api/qwaylandpointer.cpp compositor_api/qwaylandpointer.h compositor_api/qwaylandpointer_p.h
@@ -82,6 +85,23 @@ qt_add_resource(WaylandCompositor "compositor"
FILES
${compositor_resource_files}
)
+set_source_files_properties("compositor_api/qml/WaylandCursorItem.qml"
+ PROPERTIES QT_RESOURCE_ALIAS "WaylandCursorItem.qml"
+)
+set_source_files_properties("compositor_api/qml/WaylandOutputWindow.qml"
+ PROPERTIES QT_RESOURCE_ALIAS "WaylandOutputWindow.qml"
+)
+set(compositor1_resource_files
+ "compositor_api/qml/WaylandCursorItem.qml"
+ "compositor_api/qml/WaylandOutputWindow.qml"
+)
+
+qt_add_resource(WaylandCompositor "compositor1"
+ PREFIX
+ "/QtWayland/Compositor"
+ FILES
+ ${compositor1_resource_files}
+)
qt6_generate_wayland_protocol_server_sources(WaylandCompositor
@@ -102,6 +122,10 @@ qt6_generate_wayland_protocol_server_sources(WaylandCompositor
#### Keys ignored in scope 1:.:.:compositor.pro:<TRUE>:
# MODULE = "waylandcompositor"
+# QMLTYPES_FILENAME = "plugins.qmltypes"
+# QMLTYPES_INSTALL_DIR = "$$[QT_INSTALL_QML]/QtWayland/Compositor"
+# QML_IMPORT_NAME = "QtWayland.Compositor"
+# QML_IMPORT_VERSION = "$$QT_VERSION"
## Scopes:
#####################################################################
@@ -206,6 +230,17 @@ qt_add_docs(WaylandCompositor
doc/qtwaylandcompositor.qdocconf
)
+set_target_properties(WaylandCompositor PROPERTIES
+ QT_QML_MODULE_INSTALL_QMLTYPES TRUE
+ QT_QML_MODULE_VERSION ${CMAKE_PROJECT_VERSION}
+ QT_QML_MODULE_URI QtWayland.Compositor
+ QT_QMLTYPES_FILENAME plugins.qmltypes
+ QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtWayland/Compositor"
+)
+
+qt6_qml_type_registration(WaylandCompositor)
+
# special case begin
qt_record_extra_qt_package_dependency(WaylandCompositor WaylandScannerTools "")
# special case end
+
diff --git a/src/compositor/compositor.pro b/src/compositor/compositor.pro
index f9c67328..8a08494c 100644
--- a/src/compositor/compositor.pro
+++ b/src/compositor/compositor.pro
@@ -36,3 +36,10 @@ MODULE_PLUGIN_TYPES = \
wayland-hardware-layer-integration \
load(qt_module)
+
+QMLTYPES_FILENAME = plugins.qmltypes
+QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtWayland/Compositor
+QML_IMPORT_NAME = QtWayland.Compositor
+QML_IMPORT_VERSION = $$QT_VERSION
+CONFIG += qmltypes install_qmltypes
+
diff --git a/src/compositor/compositor.qrc b/src/compositor/compositor.qrc
index 1b8c0f5d..b0a78d41 100644
--- a/src/compositor/compositor.qrc
+++ b/src/compositor/compositor.qrc
@@ -7,4 +7,8 @@
<file>shaders/surface_y_uv.frag.qsb</file>
<file>shaders/surface_y_xuxv.frag.qsb</file>
</qresource>
+ <qresource prefix="/QtWayland/Compositor">
+ <file alias="WaylandCursorItem.qml">compositor_api/qml/WaylandCursorItem.qml</file>
+ <file alias="WaylandOutputWindow.qml">compositor_api/qml/WaylandOutputWindow.qml</file>
+ </qresource>
</RCC>
diff --git a/src/compositor/compositor_api/compositor_api.pri b/src/compositor/compositor_api/compositor_api.pri
index 53101f47..7014b05c 100644
--- a/src/compositor/compositor_api/compositor_api.pri
+++ b/src/compositor/compositor_api/compositor_api.pri
@@ -28,7 +28,9 @@ HEADERS += \
compositor_api/qwaylandresource.h \
compositor_api/qwaylandsurfacegrabber.h \
compositor_api/qwaylandoutputmode_p.h \
- compositor_api/qwaylandquickchildren.h
+ compositor_api/qwaylandquickchildren.h \
+ compositor_api/qwaylandmousetracker_p.h \
+ compositor_api/qwaylandcompositorquickextensions_p.h
SOURCES += \
compositor_api/qwaylandcompositor.cpp \
@@ -45,7 +47,8 @@ SOURCES += \
compositor_api/qwaylanddestroylistener.cpp \
compositor_api/qwaylandview.cpp \
compositor_api/qwaylandresource.cpp \
- compositor_api/qwaylandsurfacegrabber.cpp
+ compositor_api/qwaylandsurfacegrabber.cpp \
+ compositor_api/qwaylandmousetracker.cpp
qtConfig(im) {
HEADERS += \
diff --git a/src/imports/compositor/WaylandCursorItem.qml b/src/compositor/compositor_api/qml/WaylandCursorItem.qml
index ba2e044c..ba2e044c 100644
--- a/src/imports/compositor/WaylandCursorItem.qml
+++ b/src/compositor/compositor_api/qml/WaylandCursorItem.qml
diff --git a/src/imports/compositor/WaylandOutputWindow.qml b/src/compositor/compositor_api/qml/WaylandOutputWindow.qml
index 0462a9a2..0462a9a2 100644
--- a/src/imports/compositor/WaylandOutputWindow.qml
+++ b/src/compositor/compositor_api/qml/WaylandOutputWindow.qml
diff --git a/src/compositor/compositor_api/qwaylandclient.h b/src/compositor/compositor_api/qwaylandclient.h
index 69fbfec0..9598990f 100644
--- a/src/compositor/compositor_api/qwaylandclient.h
+++ b/src/compositor/compositor_api/qwaylandclient.h
@@ -30,6 +30,7 @@
#ifndef QWAYLANDCLIENT_H
#define QWAYLANDCLIENT_H
+#include <QtQml/qqml.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
#include <QObject>
@@ -53,6 +54,10 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandClient : public QObject
Q_PROPERTY(qint64 groupId READ groupId CONSTANT)
Q_PROPERTY(qint64 processId READ processId CONSTANT)
Q_MOC_INCLUDE("qwaylandcompositor.h")
+
+ QML_NAMED_ELEMENT(WaylandClient)
+ QML_ADDED_IN_VERSION(1, 0)
+ QML_UNCREATABLE("")
public:
~QWaylandClient() override;
diff --git a/src/compositor/compositor_api/qwaylandcompositor.h b/src/compositor/compositor_api/qwaylandcompositor.h
index b8ca6589..21c7e673 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.h
+++ b/src/compositor/compositor_api/qwaylandcompositor.h
@@ -76,6 +76,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandCompositor : public QWaylandObject
Q_PROPERTY(QWaylandSeat *defaultSeat READ defaultSeat NOTIFY defaultSeatChanged)
Q_MOC_INCLUDE("qwaylandseat.h")
+ QML_NAMED_ELEMENT(WaylandCompositorBase)
+ QML_UNCREATABLE("Cannot create instance of WaylandCompositorBase, use WaylandCompositor instead")
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandCompositor(QObject *parent = nullptr);
~QWaylandCompositor() override;
diff --git a/src/compositor/compositor_api/qwaylandcompositorquickextensions_p.h b/src/compositor/compositor_api/qwaylandcompositorquickextensions_p.h
new file mode 100644
index 00000000..901ce30c
--- /dev/null
+++ b/src/compositor/compositor_api/qwaylandcompositorquickextensions_p.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDCOMPOSITORQUICKEXTENSIONS_P_H
+#define QWAYLANDCOMPOSITORQUICKEXTENSIONS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtQml/qqml.h>
+#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qwaylandquickextension.h>
+
+#include <QtWaylandCompositor/qwaylandcompositor.h>
+#include <QtWaylandCompositor/qwaylandquickcompositor.h>
+#include <QtWaylandCompositor/qwaylandqtwindowmanager.h>
+#include <QtWaylandCompositor/qwaylandtextinputmanager.h>
+#include <QtWaylandCompositor/qwaylandidleinhibitv1.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickCompositorQuickExtensionContainer : public QWaylandQuickCompositor
+{
+ Q_OBJECT
+ Q_PROPERTY(QQmlListProperty<QWaylandCompositorExtension> extensions READ extensions)
+ Q_PROPERTY(QQmlListProperty<QObject> data READ data DESIGNABLE false)
+ Q_CLASSINFO("DefaultProperty", "data")
+ QML_NAMED_ELEMENT(WaylandCompositor)
+ QML_ADDED_IN_VERSION(1, 0)
+public:
+ QQmlListProperty<QObject> data()
+ {
+ return QQmlListProperty<QObject>(this, &m_objects);
+ }
+
+ QQmlListProperty<QWaylandCompositorExtension> extensions()
+ {
+ return QQmlListProperty<QWaylandCompositorExtension>(this, this,
+ &append_extension,
+ &countFunction,
+ &atFunction,
+ &clearFunction);
+ }
+
+ static int countFunction(QQmlListProperty<QWaylandCompositorExtension> *list)
+ {
+ return static_cast<QWaylandQuickCompositorQuickExtensionContainer *>(list->data)->extension_vector.size();
+ }
+
+ static QWaylandCompositorExtension *atFunction(QQmlListProperty<QWaylandCompositorExtension> *list, int index)
+ {
+ return static_cast<QWaylandQuickCompositorQuickExtensionContainer *>(list->data)->extension_vector.at(index);
+ }
+
+ static void append_extension(QQmlListProperty<QWaylandCompositorExtension> *list, QWaylandCompositorExtension *extension)
+ {
+ QWaylandQuickCompositorQuickExtensionContainer *quickExtObj = static_cast<QWaylandQuickCompositorQuickExtensionContainer *>(list->data);
+ extension->setExtensionContainer(quickExtObj);
+ }
+
+ static void clearFunction(QQmlListProperty<QWaylandCompositorExtension> *list)
+ {
+ static_cast<QWaylandQuickCompositorQuickExtensionContainer *>(list->data)->extension_vector.clear();
+ }
+
+private:
+ QList<QObject *> m_objects;
+};
+
+
+// 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)
+
+QT_END_NAMESPACE
+
+#endif // QWAYLANDCOMPOSITORQUICKEXTENSIONS_P_H
diff --git a/src/compositor/compositor_api/qwaylanddrag.h b/src/compositor/compositor_api/qwaylanddrag.h
index 2c66515a..6519cd96 100644
--- a/src/compositor/compositor_api/qwaylanddrag.h
+++ b/src/compositor/compositor_api/qwaylanddrag.h
@@ -35,6 +35,8 @@
#include <QtCore/QObject>
#include <QtCore/QPointF>
+#include <QtQml/qqml.h>
+
QT_REQUIRE_CONFIG(draganddrop);
QT_BEGIN_NAMESPACE
@@ -52,6 +54,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandDrag : public QObject
Q_PROPERTY(bool visible READ visible NOTIFY iconChanged)
Q_MOC_INCLUDE("qwaylandsurface.h")
+ QML_NAMED_ELEMENT(WaylandDrag)
+ QML_ADDED_IN_VERSION(1, 0)
+ QML_UNCREATABLE("")
public:
explicit QWaylandDrag(QWaylandSeat *seat);
diff --git a/src/compositor/compositor_api/qwaylandkeymap.h b/src/compositor/compositor_api/qwaylandkeymap.h
index 30034e66..01fcfbdf 100644
--- a/src/compositor/compositor_api/qwaylandkeymap.h
+++ b/src/compositor/compositor_api/qwaylandkeymap.h
@@ -31,6 +31,7 @@
#define QWAYLANDKEYMAP_H
#include <QtCore/QObject>
+#include <QtQml/qqml.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
#include <QtWaylandCompositor/qwaylandquickchildren.h>
@@ -48,6 +49,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandKeymap : public QObject
Q_PROPERTY(QString options READ options WRITE setOptions NOTIFY optionsChanged)
Q_PROPERTY(QString rules READ rules WRITE setRules NOTIFY rulesChanged)
Q_PROPERTY(QString model READ model WRITE setModel NOTIFY modelChanged)
+ QML_NAMED_ELEMENT(WaylandKeymap)
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandKeymap(const QString &layout = QString(), const QString &variant = QString(), const QString &options = QString(),
const QString &model = QString(), const QString &rules = QString(), QObject *parent = nullptr);
diff --git a/src/imports/compositor/qwaylandmousetracker.cpp b/src/compositor/compositor_api/qwaylandmousetracker.cpp
index c195f03c..c195f03c 100644
--- a/src/imports/compositor/qwaylandmousetracker.cpp
+++ b/src/compositor/compositor_api/qwaylandmousetracker.cpp
diff --git a/src/imports/compositor/qwaylandmousetracker_p.h b/src/compositor/compositor_api/qwaylandmousetracker_p.h
index abc0942d..178c0065 100644
--- a/src/imports/compositor/qwaylandmousetracker_p.h
+++ b/src/compositor/compositor_api/qwaylandmousetracker_p.h
@@ -30,6 +30,17 @@
#ifndef QWAYLANDMOUSETRACKER_P_H
#define QWAYLANDMOUSETRACKER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtQuick/private/qquickmousearea_p.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
@@ -47,6 +58,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandMouseTracker : public QQuickItem
Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged)
Q_PROPERTY(bool windowSystemCursorEnabled READ windowSystemCursorEnabled WRITE setWindowSystemCursorEnabled NOTIFY windowSystemCursorEnabledChanged)
+ QML_NAMED_ELEMENT(WaylandMouseTracker)
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandMouseTracker(QQuickItem *parent = nullptr);
diff --git a/src/compositor/compositor_api/qwaylandoutput.h b/src/compositor/compositor_api/qwaylandoutput.h
index c8fdcf51..fc885987 100644
--- a/src/compositor/compositor_api/qwaylandoutput.h
+++ b/src/compositor/compositor_api/qwaylandoutput.h
@@ -69,6 +69,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandOutput : public QWaylandObject
Q_PROPERTY(bool sizeFollowsWindow READ sizeFollowsWindow WRITE setSizeFollowsWindow NOTIFY sizeFollowsWindowChanged)
Q_ENUMS(Subpixel Transform)
+ QML_NAMED_ELEMENT(WaylandOutputBase)
+ QML_ADDED_IN_VERSION(1, 0)
+ QML_UNCREATABLE("Cannot create instance of WaylandOutputBase, use WaylandOutput instead")
public:
enum Subpixel {
SubpixelUnknown = 0,
diff --git a/src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h b/src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h
index 594ed490..90eaf85b 100644
--- a/src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h
+++ b/src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h
@@ -53,6 +53,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickHardwareLayer : public QObject, p
Q_INTERFACES(QQmlParserStatus)
Q_DECLARE_PRIVATE(QWaylandQuickHardwareLayer)
Q_PROPERTY(int stackingLevel READ stackingLevel WRITE setStackingLevel NOTIFY stackingLevelChanged)
+ QML_NAMED_ELEMENT(WaylandHardwareLayer)
+ QML_ADDED_IN_VERSION(1, 2)
public:
explicit QWaylandQuickHardwareLayer(QObject *parent = nullptr);
~QWaylandQuickHardwareLayer() override;
diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h
index 1f4cae5b..ef1b6c76 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.h
+++ b/src/compositor/compositor_api/qwaylandquickitem.h
@@ -63,6 +63,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickItem : public QQuickItem
Q_PROPERTY(bool bufferLocked READ isBufferLocked WRITE setBufferLocked NOTIFY bufferLockedChanged)
Q_PROPERTY(bool allowDiscardFrontBuffer READ allowDiscardFrontBuffer WRITE setAllowDiscardFrontBuffer NOTIFY allowDiscardFrontBufferChanged)
Q_MOC_INCLUDE("qwaylandcompositor.h")
+ QML_NAMED_ELEMENT(WaylandQuickItem)
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandQuickItem(QQuickItem *parent = nullptr);
~QWaylandQuickItem() override;
diff --git a/src/compositor/compositor_api/qwaylandquickoutput.h b/src/compositor/compositor_api/qwaylandquickoutput.h
index 636dc6d7..da466b13 100644
--- a/src/compositor/compositor_api/qwaylandquickoutput.h
+++ b/src/compositor/compositor_api/qwaylandquickoutput.h
@@ -46,6 +46,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickOutput : public QWaylandOutput, p
Q_OBJECT
Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandQuickOutput)
Q_PROPERTY(bool automaticFrameCallback READ automaticFrameCallback WRITE setAutomaticFrameCallback NOTIFY automaticFrameCallbackChanged)
+ QML_NAMED_ELEMENT(WaylandOutput)
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandQuickOutput();
QWaylandQuickOutput(QWaylandCompositor *compositor, QWindow *window);
diff --git a/src/compositor/compositor_api/qwaylandquicksurface.h b/src/compositor/compositor_api/qwaylandquicksurface.h
index b0f3f012..e3381525 100644
--- a/src/compositor/compositor_api/qwaylandquicksurface.h
+++ b/src/compositor/compositor_api/qwaylandquicksurface.h
@@ -46,6 +46,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickSurface : public QWaylandSurface
Q_DECLARE_PRIVATE(QWaylandQuickSurface)
Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandQuickSurface)
Q_PROPERTY(bool useTextureAlpha READ useTextureAlpha WRITE setUseTextureAlpha NOTIFY useTextureAlphaChanged)
+ QML_NAMED_ELEMENT(WaylandSurface)
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandQuickSurface();
QWaylandQuickSurface(QWaylandCompositor *compositor, QWaylandClient *client, quint32 id, int version);
diff --git a/src/compositor/compositor_api/qwaylandresource.h b/src/compositor/compositor_api/qwaylandresource.h
index fda1200d..e2802732 100644
--- a/src/compositor/compositor_api/qwaylandresource.h
+++ b/src/compositor/compositor_api/qwaylandresource.h
@@ -31,6 +31,7 @@
#define QWAYLANDRESOURCE_H
#include <QtCore/QObject>
+#include <QtQml/qqml.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
struct wl_resource;
@@ -40,6 +41,9 @@ QT_BEGIN_NAMESPACE
class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandResource
{
Q_GADGET
+ QML_NAMED_ELEMENT(WaylandResource)
+ QML_UNCREATABLE("")
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandResource();
explicit QWaylandResource(wl_resource *resource);
diff --git a/src/compositor/compositor_api/qwaylandseat.h b/src/compositor/compositor_api/qwaylandseat.h
index c3e83c7e..3cb2e0b0 100644
--- a/src/compositor/compositor_api/qwaylandseat.h
+++ b/src/compositor/compositor_api/qwaylandseat.h
@@ -63,6 +63,10 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandSeat : public QWaylandObject
#endif
Q_PROPERTY(QWaylandKeymap *keymap READ keymap CONSTANT)
Q_MOC_INCLUDE("qwaylandkeymap.h")
+
+ QML_NAMED_ELEMENT(WaylandSeat)
+ QML_ADDED_IN_VERSION(1, 0)
+ QML_UNCREATABLE("")
public:
enum CapabilityFlag {
// The order should match the enum WL_SEAT_CAPABILITY_*
diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h
index 13b900d7..d66e276b 100644
--- a/src/compositor/compositor_api/qwaylandsurface.h
+++ b/src/compositor/compositor_api/qwaylandsurface.h
@@ -81,6 +81,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandSurface : public QWaylandObject
Q_PROPERTY(bool cursorSurface READ isCursorSurface WRITE markAsCursorSurface NOTIFY cursorSurfaceChanged)
Q_PROPERTY(bool inhibitsIdle READ inhibitsIdle NOTIFY inhibitsIdleChanged REVISION(1, 14))
+ QML_NAMED_ELEMENT(WaylandSurfaceBase)
+ QML_ADDED_IN_VERSION(1, 0)
+ QML_UNCREATABLE("Cannot create instance of WaylandSurfaceBase, use WaylandSurface instead")
public:
enum Origin {
OriginTopLeft,
diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.h b/src/compositor/extensions/qwaylandquickshellsurfaceitem.h
index 38af5645..9307909e 100644
--- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.h
+++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem.h
@@ -46,6 +46,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellSurfaceItem : public QWaylan
Q_PROPERTY(QQuickItem *moveItem READ moveItem WRITE setMoveItem NOTIFY moveItemChanged)
Q_PROPERTY(bool autoCreatePopupItems READ autoCreatePopupItems WRITE setAutoCreatePopupItems NOTIFY autoCreatePopupItemsChanged)
Q_MOC_INCLUDE("qwaylandshellsurface.h")
+ QML_NAMED_ELEMENT(ShellSurfaceItem)
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandQuickShellSurfaceItem(QQuickItem *parent = nullptr);
~QWaylandQuickShellSurfaceItem() override;
diff --git a/src/compositor/extensions/qwaylandshell.h b/src/compositor/extensions/qwaylandshell.h
index bb7c73c1..739fd8f2 100644
--- a/src/compositor/extensions/qwaylandshell.h
+++ b/src/compositor/extensions/qwaylandshell.h
@@ -41,6 +41,10 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShell : public QWaylandCompositorExten
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandShell)
Q_PROPERTY(FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy NOTIFY focusPolicyChanged)
+
+ QML_NAMED_ELEMENT(Shell)
+ QML_UNCREATABLE("")
+ QML_ADDED_IN_VERSION(1, 0)
public:
enum FocusPolicy {
AutomaticFocus,
diff --git a/src/compositor/extensions/qwaylandshellsurface.h b/src/compositor/extensions/qwaylandshellsurface.h
index bcc93122..67450e54 100644
--- a/src/compositor/extensions/qwaylandshellsurface.h
+++ b/src/compositor/extensions/qwaylandshellsurface.h
@@ -43,6 +43,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShellSurface : public QWaylandComposit
{
Q_OBJECT
Q_PROPERTY(Qt::WindowType windowType READ windowType NOTIFY windowTypeChanged)
+ QML_NAMED_ELEMENT(ShellSurface)
+ QML_UNCREATABLE("")
+ QML_ADDED_IN_VERSION(1, 0)
public:
#if QT_CONFIG(wayland_compositor_quick)
virtual QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) = 0;
diff --git a/src/compositor/global/qtwaylandcompositorglobal.h b/src/compositor/global/qtwaylandcompositorglobal.h
index 3b5ba5c2..cd8cd9ef 100644
--- a/src/compositor/global/qtwaylandcompositorglobal.h
+++ b/src/compositor/global/qtwaylandcompositorglobal.h
@@ -58,5 +58,7 @@ QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
+void Q_WAYLAND_COMPOSITOR_EXPORT qml_register_types_QtWayland_Compositor();
+
#endif // QWAYLANDCOMPOSITORGLOBAL_H
diff --git a/src/compositor/global/qwaylandcompositorextension.h b/src/compositor/global/qwaylandcompositorextension.h
index d520dac0..ccb6dd0f 100644
--- a/src/compositor/global/qwaylandcompositorextension.h
+++ b/src/compositor/global/qwaylandcompositorextension.h
@@ -30,6 +30,7 @@
#ifndef QWAYLANDEXTENSION_H
#define QWAYLANDEXTENSION_H
+#include <QtQml/qqml.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
#include <QtCore/QObject>
@@ -64,6 +65,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandCompositorExtension : public QWaylandO
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandCompositorExtension)
+ QML_NAMED_ELEMENT(WaylandExtension)
+ QML_ADDED_IN_VERSION(1, 0)
+ QML_UNCREATABLE("")
public:
QWaylandCompositorExtension();
QWaylandCompositorExtension(QWaylandObject *container);
diff --git a/src/compositor/global/qwaylandquickextension.h b/src/compositor/global/qwaylandquickextension.h
index 5b01f16f..f6426c7c 100644
--- a/src/compositor/global/qwaylandquickextension.h
+++ b/src/compositor/global/qwaylandquickextension.h
@@ -97,6 +97,27 @@ QT_BEGIN_NAMESPACE
QList<QObject *> m_objects; \
};
+#define Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(className, QmlType) \
+ class Q_WAYLAND_COMPOSITOR_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; \
+ };
+
QT_END_NAMESPACE
#endif /*QWAYLANDQUICKEXTENSION_H*/
diff --git a/src/imports/compositor-extensions/iviapplication/qmldir b/src/imports/compositor-extensions/iviapplication/qmldir
index 75f6403e..a4d10b31 100644
--- a/src/imports/compositor-extensions/iviapplication/qmldir
+++ b/src/imports/compositor-extensions/iviapplication/qmldir
@@ -1,3 +1,5 @@
module QtWayland.Compositor.IviApplication
plugin qwaylandcompositoriviapplicationplugin
classname QWaylandCompositorIviApplicationPlugin
+typeinfo plugins.qmltypes
+typeinfo plugins.qmltypes
diff --git a/src/imports/compositor-extensions/wlshell/qmldir b/src/imports/compositor-extensions/wlshell/qmldir
index 75e1f2b3..51019c35 100644
--- a/src/imports/compositor-extensions/wlshell/qmldir
+++ b/src/imports/compositor-extensions/wlshell/qmldir
@@ -1,3 +1,5 @@
module QtWayland.Compositor.WlShell
plugin qwaylandcompositorwlshellplugin
classname QWaylandCompositorWlShellPlugin
+typeinfo plugins.qmltypes
+typeinfo plugins.qmltypes
diff --git a/src/imports/compositor-extensions/xdgshell/qmldir b/src/imports/compositor-extensions/xdgshell/qmldir
index 9880a20a..d011ddc1 100644
--- a/src/imports/compositor-extensions/xdgshell/qmldir
+++ b/src/imports/compositor-extensions/xdgshell/qmldir
@@ -1,3 +1,5 @@
module QtWayland.Compositor.XdgShell
plugin qwaylandcompositorxdgshellplugin
classname QWaylandCompositorXdgShellPlugin
+typeinfo plugins.qmltypes
+typeinfo plugins.qmltypes
diff --git a/src/imports/compositor/CMakeLists.txt b/src/imports/compositor/CMakeLists.txt
index 79aa5dbb..71f2e665 100644
--- a/src/imports/compositor/CMakeLists.txt
+++ b/src/imports/compositor/CMakeLists.txt
@@ -8,9 +8,7 @@ qt_add_qml_module(qwaylandcompositorplugin
URI "QtWayland.Compositor"
VERSION "${CMAKE_PROJECT_VERSION}"
CLASSNAME QWaylandCompositorPlugin
- SKIP_TYPE_REGISTRATION
SOURCES
- qwaylandmousetracker.cpp qwaylandmousetracker_p.h
qwaylandquickcompositorplugin.cpp
PUBLIC_LIBRARIES
Qt::Core
@@ -23,28 +21,8 @@ qt_add_qml_module(qwaylandcompositorplugin
Qt::WaylandCompositorPrivate
)
-# Resources:
-set(compositor_resource_files
- "WaylandCursorItem.qml"
- "WaylandOutputWindow.qml"
-)
-
-qt_add_resource(qwaylandcompositorplugin "compositor"
- PREFIX
- "/QtWaylandCompositor"
- FILES
- ${compositor_resource_files}
-)
-
-
#### Keys ignored in scope 1:.:.:compositor.pro:<TRUE>:
# CXX_MODULE = "qml"
-# QMAKE_QMLPLUGINDUMP_FLAGS = "-defaultplatform"
# QML_IMPORT_VERSION = "$$QT_VERSION"
+# QMl_IMPORT_NAME = "QtWayland.Compositor"
# TARGETPATH = "QtWayland/Compositor"
-
-## Scopes:
-#####################################################################
-
-#### Keys ignored in scope 2:.:.:compositor.pro:(CMAKE_BUILD_TYPE STREQUAL Debug):
-# QML_FILES = "WaylandOutputWindow.qml" "WaylandCursorItem.qml"
diff --git a/src/imports/compositor/compositor.pro b/src/imports/compositor/compositor.pro
index 193450a8..dcfadb55 100644
--- a/src/imports/compositor/compositor.pro
+++ b/src/imports/compositor/compositor.pro
@@ -1,24 +1,11 @@
CXX_MODULE = qml
TARGET = qwaylandcompositorplugin
TARGETPATH = QtWayland/Compositor
+QMl_IMPORT_NAME = QtWayland.Compositor
QML_IMPORT_VERSION = $$QT_VERSION
-HEADERS += \
- qwaylandmousetracker_p.h
-
SOURCES += \
- qwaylandquickcompositorplugin.cpp \
- qwaylandmousetracker.cpp
-
-RESOURCES += compositor.qrc
-
-# In case of a debug build, deploy the QML files too
-CONFIG(debug, debug|release): \
- QML_FILES += \
- WaylandOutputWindow.qml \
- WaylandCursorItem.qml
+ qwaylandquickcompositorplugin.cpp
QT += quick-private qml-private gui-private core-private waylandcompositor waylandcompositor-private
-
-QMAKE_QMLPLUGINDUMP_FLAGS = -defaultplatform
load(qml_plugin)
diff --git a/src/imports/compositor/compositor.qrc b/src/imports/compositor/compositor.qrc
deleted file mode 100644
index 0004e083..00000000
--- a/src/imports/compositor/compositor.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
-<qresource prefix="/QtWaylandCompositor">
- <file>WaylandOutputWindow.qml</file>
- <file>WaylandCursorItem.qml</file>
-</qresource>
-</RCC>
diff --git a/src/imports/compositor/plugins.qmltypes b/src/imports/compositor/plugins.qmltypes
deleted file mode 100644
index a37f99d5..00000000
--- a/src/imports/compositor/plugins.qmltypes
+++ /dev/null
@@ -1,552 +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 6.0'
-
-Module {
- dependencies: [
- "QtQuick 2.15",
- "QtQuick.Window 2.15"
- ]
- Component {
- name: "QWaylandClient"
- prototype: "QObject"
- exports: ["QtWayland.Compositor/WaylandClient 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "compositor"; type: "QWaylandCompositor"; isReadonly: true; isPointer: true }
- Property { name: "userId"; type: "qlonglong"; isReadonly: true }
- Property { name: "groupId"; type: "qlonglong"; isReadonly: true }
- Property { name: "processId"; type: "qlonglong"; isReadonly: true }
- Method { name: "close" }
- Method {
- name: "kill"
- Parameter { name: "signal"; type: "int" }
- }
- Method { name: "kill" }
- }
- Component {
- name: "QWaylandCompositor"
- prototype: "QWaylandObject"
- exports: ["QtWayland.Compositor/WaylandCompositorBase 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "socketName"; type: "QByteArray" }
- Property { name: "created"; type: "bool"; isReadonly: true }
- Property { name: "retainedSelection"; type: "bool" }
- Property { name: "defaultOutput"; type: "QWaylandOutput"; isPointer: true }
- Property { name: "useHardwareIntegrationExtension"; type: "bool" }
- Property { name: "defaultSeat"; type: "QWaylandSeat"; isReadonly: true; isPointer: true }
- Signal {
- name: "socketNameChanged"
- Parameter { name: "socketName"; type: "QByteArray" }
- }
- Signal {
- name: "retainedSelectionChanged"
- Parameter { name: "retainedSelection"; type: "bool" }
- }
- Signal {
- name: "surfaceRequested"
- Parameter { name: "client"; type: "QWaylandClient"; isPointer: true }
- Parameter { name: "id"; type: "uint" }
- Parameter { name: "version"; type: "int" }
- }
- Signal {
- name: "surfaceCreated"
- Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true }
- }
- Signal {
- name: "surfaceAboutToBeDestroyed"
- Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true }
- }
- Signal {
- name: "subsurfaceChanged"
- Parameter { name: "child"; type: "QWaylandSurface"; isPointer: true }
- Parameter { name: "parent"; type: "QWaylandSurface"; isPointer: true }
- }
- Signal {
- name: "defaultSeatChanged"
- Parameter { name: "newDevice"; type: "QWaylandSeat"; isPointer: true }
- Parameter { name: "oldDevice"; type: "QWaylandSeat"; isPointer: true }
- }
- Signal {
- name: "outputAdded"
- Parameter { name: "output"; type: "QWaylandOutput"; isPointer: true }
- }
- Signal {
- name: "outputRemoved"
- Parameter { name: "output"; type: "QWaylandOutput"; isPointer: true }
- }
- Method { name: "processWaylandEvents" }
- Method {
- name: "addSocketDescriptor"
- Parameter { name: "fd"; type: "int" }
- }
- Method {
- name: "destroyClientForSurface"
- Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true }
- }
- Method {
- name: "destroyClient"
- Parameter { name: "client"; type: "QWaylandClient"; isPointer: true }
- }
- Method {
- name: "outputFor"
- type: "QWaylandOutput*"
- Parameter { name: "window"; type: "QWindow"; isPointer: true }
- }
- }
- Component {
- name: "QWaylandCompositorExtension"
- prototype: "QWaylandObject"
- exports: ["QtWayland.Compositor/WaylandExtension 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QWaylandDrag"
- prototype: "QObject"
- exports: ["QtWayland.Compositor/WaylandDrag 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "icon"; type: "QWaylandSurface"; isReadonly: true; isPointer: true }
- Property { name: "visible"; type: "bool"; isReadonly: true }
- Signal { name: "dragStarted" }
- Method {
- name: "dragMove"
- Parameter { name: "target"; type: "QWaylandSurface"; isPointer: true }
- Parameter { name: "pos"; type: "QPointF" }
- }
- Method { name: "drop" }
- Method { name: "cancelDrag" }
- }
- Component { name: "QWaylandIdleInhibitManagerV1"; prototype: "QWaylandCompositorExtension" }
- Component {
- name: "QWaylandIdleInhibitManagerV1QuickExtension"
- defaultProperty: "data"
- prototype: "QWaylandIdleInhibitManagerV1"
- exports: ["QtWayland.Compositor/IdleInhibitManagerV1 1.14"]
- exportMetaObjectRevisions: [0]
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- }
- Component {
- name: "QWaylandKeymap"
- defaultProperty: "data"
- prototype: "QObject"
- exports: ["QtWayland.Compositor/WaylandKeymap 1.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "layout"; type: "string" }
- Property { name: "variant"; type: "string" }
- Property { name: "options"; type: "string" }
- Property { name: "rules"; type: "string" }
- Property { name: "model"; type: "string" }
- }
- Component {
- name: "QWaylandMouseTracker"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["QtWayland.Compositor/WaylandMouseTracker 1.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "mouseX"; type: "double"; isReadonly: true }
- Property { name: "mouseY"; type: "double"; isReadonly: true }
- Property { name: "containsMouse"; type: "bool"; isReadonly: true }
- Property { name: "windowSystemCursorEnabled"; type: "bool" }
- Signal { name: "hoveredChanged" }
- }
- Component { name: "QWaylandObject"; prototype: "QObject" }
- Component {
- name: "QWaylandOutput"
- prototype: "QWaylandObject"
- exports: ["QtWayland.Compositor/WaylandOutputBase 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "Subpixel"
- values: {
- "SubpixelUnknown": 0,
- "SubpixelNone": 1,
- "SubpixelHorizontalRgb": 2,
- "SubpixelHorizontalBgr": 3,
- "SubpixelVerticalRgb": 4,
- "SubpixelVerticalBgr": 5
- }
- }
- Enum {
- name: "Transform"
- values: {
- "TransformNormal": 0,
- "Transform90": 1,
- "Transform180": 2,
- "Transform270": 3,
- "TransformFlipped": 4,
- "TransformFlipped90": 5,
- "TransformFlipped180": 6,
- "TransformFlipped270": 7
- }
- }
- Property { name: "compositor"; type: "QWaylandCompositor"; isPointer: true }
- Property { name: "window"; type: "QWindow"; isPointer: true }
- Property { name: "manufacturer"; type: "string" }
- Property { name: "model"; type: "string" }
- Property { name: "position"; type: "QPoint" }
- Property { name: "geometry"; type: "QRect"; isReadonly: true }
- Property { name: "availableGeometry"; type: "QRect" }
- Property { name: "physicalSize"; type: "QSize" }
- Property { name: "subpixel"; type: "QWaylandOutput::Subpixel" }
- Property { name: "transform"; type: "QWaylandOutput::Transform" }
- Property { name: "scaleFactor"; type: "int" }
- Property { name: "sizeFollowsWindow"; type: "bool" }
- Signal { name: "modeAdded" }
- Signal { name: "currentModeChanged" }
- Signal { name: "physicalSizeFollowsSizeChanged" }
- Signal { name: "windowDestroyed" }
- }
- Component {
- name: "QWaylandQtWindowManager"
- prototype: "QWaylandCompositorExtension"
- Property { name: "showIsFullScreen"; type: "bool" }
- Signal {
- name: "openUrl"
- Parameter { name: "client"; type: "QWaylandClient"; isPointer: true }
- Parameter { name: "url"; type: "QUrl" }
- }
- }
- Component {
- name: "QWaylandQtWindowManagerQuickExtension"
- defaultProperty: "data"
- prototype: "QWaylandQtWindowManager"
- exports: ["QtWayland.Compositor/QtWindowManager 1.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- }
- Component { name: "QWaylandQuickCompositor"; prototype: "QWaylandCompositor" }
- Component {
- name: "QWaylandQuickCompositorQuickExtensionContainer"
- defaultProperty: "data"
- prototype: "QWaylandQuickCompositor"
- exports: ["QtWayland.Compositor/WaylandCompositor 1.0"]
- exportMetaObjectRevisions: [0]
- Property {
- name: "extensions"
- type: "QWaylandCompositorExtension"
- isList: true
- isReadonly: true
- }
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- }
- Component {
- name: "QWaylandQuickHardwareLayer"
- prototype: "QObject"
- exports: ["QtWayland.Compositor/WaylandHardwareLayer 1.2"]
- exportMetaObjectRevisions: [0]
- Property { name: "stackingLevel"; type: "int" }
- }
- Component {
- name: "QWaylandQuickItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: [
- "QtWayland.Compositor/WaylandQuickItem 1.0",
- "QtWayland.Compositor/WaylandQuickItem 1.13"
- ]
- exportMetaObjectRevisions: [0, 65293]
- Property { name: "compositor"; type: "QWaylandCompositor"; isReadonly: true; isPointer: true }
- Property { name: "surface"; type: "QWaylandSurface"; isPointer: true }
- Property { name: "paintEnabled"; type: "bool" }
- Property { name: "touchEventsEnabled"; type: "bool" }
- Property { name: "origin"; type: "QWaylandSurface::Origin"; isReadonly: true }
- Property { name: "inputEventsEnabled"; type: "bool" }
- Property { name: "focusOnClick"; type: "bool" }
- Property { name: "subsurfaceHandler"; type: "QObject"; isPointer: true }
- Property { name: "output"; type: "QWaylandOutput"; isPointer: true }
- Property { name: "bufferLocked"; type: "bool" }
- Property { name: "allowDiscardFrontBuffer"; type: "bool" }
- Signal { name: "surfaceDestroyed" }
- Signal {
- name: "mouseMove"
- Parameter { name: "windowPosition"; type: "QPointF" }
- }
- Signal { name: "mouseRelease" }
- Method {
- name: "takeFocus"
- Parameter { name: "device"; type: "QWaylandSeat"; isPointer: true }
- }
- Method { name: "takeFocus" }
- Method {
- name: "setPaintEnabled"
- Parameter { name: "paintEnabled"; type: "bool" }
- }
- Method { name: "raise" }
- Method { name: "lower" }
- Method {
- name: "sendMouseMoveEvent"
- Parameter { name: "position"; type: "QPointF" }
- Parameter { name: "seat"; type: "QWaylandSeat"; isPointer: true }
- }
- Method {
- name: "sendMouseMoveEvent"
- Parameter { name: "position"; type: "QPointF" }
- }
- Method {
- name: "mapToSurface"
- type: "QPointF"
- Parameter { name: "point"; type: "QPointF" }
- }
- Method {
- name: "mapFromSurface"
- revision: 269
- type: "QPointF"
- Parameter { name: "point"; type: "QPointF" }
- }
- Method {
- name: "inputMethodQuery"
- type: "QVariant"
- Parameter { name: "query"; type: "Qt::InputMethodQuery" }
- Parameter { name: "argument"; type: "QVariant" }
- }
- Method { name: "setPrimary" }
- }
- Component {
- name: "QWaylandQuickOutput"
- defaultProperty: "data"
- prototype: "QWaylandOutput"
- exports: ["QtWayland.Compositor/WaylandOutput 1.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "automaticFrameCallback"; type: "bool" }
- Method { name: "updateStarted" }
- }
- Component {
- name: "QWaylandQuickShellSurfaceItem"
- defaultProperty: "data"
- prototype: "QWaylandQuickItem"
- exports: ["QtWayland.Compositor/ShellSurfaceItem 1.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "shellSurface"; type: "QWaylandShellSurface"; isPointer: true }
- Property { name: "moveItem"; type: "QQuickItem"; isPointer: true }
- Property { name: "autoCreatePopupItems"; type: "bool" }
- }
- Component {
- name: "QWaylandQuickSurface"
- defaultProperty: "data"
- prototype: "QWaylandSurface"
- exports: [
- "QtWayland.Compositor/WaylandSurface 1.0",
- "QtWayland.Compositor/WaylandSurface 1.13"
- ]
- exportMetaObjectRevisions: [0, 65293]
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "useTextureAlpha"; type: "bool" }
- }
- Component {
- name: "QWaylandResource"
- exports: ["QtWayland.Compositor/WaylandResource 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QWaylandSeat"
- prototype: "QWaylandObject"
- exports: ["QtWayland.Compositor/WaylandSeat 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "CapabilityFlags"
- values: {
- "Pointer": 1,
- "Keyboard": 2,
- "Touch": 4,
- "DefaultCapabilities": 7
- }
- }
- Property { name: "drag"; type: "QWaylandDrag"; isReadonly: true; isPointer: true }
- Property { name: "keymap"; type: "QWaylandKeymap"; isReadonly: true; isPointer: true }
- Signal {
- name: "mouseFocusChanged"
- Parameter { name: "newFocus"; type: "QWaylandView"; isPointer: true }
- Parameter { name: "oldFocus"; type: "QWaylandView"; isPointer: true }
- }
- Signal {
- name: "keyboardFocusChanged"
- Parameter { name: "newFocus"; type: "QWaylandSurface"; isPointer: true }
- Parameter { name: "oldFocus"; type: "QWaylandSurface"; isPointer: true }
- }
- Signal {
- name: "cursorSurfaceRequest"
- Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true }
- Parameter { name: "hotspotX"; type: "int" }
- Parameter { name: "hotspotY"; type: "int" }
- }
- Method {
- name: "sendKeyEvent"
- Parameter { name: "qtKey"; type: "int" }
- Parameter { name: "pressed"; type: "bool" }
- }
- Method {
- name: "sendTouchPointPressed"
- type: "uint"
- Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true }
- Parameter { name: "id"; type: "int" }
- Parameter { name: "position"; type: "QPointF" }
- }
- Method {
- name: "sendTouchPointReleased"
- type: "uint"
- Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true }
- Parameter { name: "id"; type: "int" }
- Parameter { name: "position"; type: "QPointF" }
- }
- Method {
- name: "sendTouchPointMoved"
- type: "uint"
- Parameter { name: "surface"; type: "QWaylandSurface"; isPointer: true }
- Parameter { name: "id"; type: "int" }
- Parameter { name: "position"; type: "QPointF" }
- }
- Method {
- name: "sendTouchFrameEvent"
- Parameter { name: "client"; type: "QWaylandClient"; isPointer: true }
- }
- Method {
- name: "sendTouchCancelEvent"
- Parameter { name: "client"; type: "QWaylandClient"; isPointer: true }
- }
- }
- Component {
- name: "QWaylandShell"
- prototype: "QWaylandCompositorExtension"
- exports: ["QtWayland.Compositor/Shell 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "FocusPolicy"
- values: {
- "AutomaticFocus": 0,
- "ManualFocus": 1
- }
- }
- Property { name: "focusPolicy"; type: "FocusPolicy" }
- }
- Component {
- name: "QWaylandShellSurface"
- prototype: "QWaylandCompositorExtension"
- exports: ["QtWayland.Compositor/ShellSurface 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Property { name: "windowType"; type: "Qt::WindowType"; isReadonly: true }
- }
- Component {
- name: "QWaylandSurface"
- prototype: "QWaylandObject"
- exports: ["QtWayland.Compositor/WaylandSurfaceBase 1.0"]
- isCreatable: false
- exportMetaObjectRevisions: [0]
- Enum {
- name: "Origin"
- values: {
- "OriginTopLeft": 0,
- "OriginBottomLeft": 1
- }
- }
- Property { name: "client"; type: "QWaylandClient"; isReadonly: true; isPointer: true }
- Property { name: "sourceGeometry"; revision: 269; type: "QRectF"; isReadonly: true }
- Property { name: "destinationSize"; revision: 269; type: "QSize"; isReadonly: true }
- Property { name: "bufferSize"; revision: 269; type: "QSize"; isReadonly: true }
- Property { name: "bufferScale"; type: "int"; isReadonly: true }
- Property { name: "contentOrientation"; type: "Qt::ScreenOrientation"; isReadonly: true }
- Property { name: "origin"; type: "QWaylandSurface::Origin"; isReadonly: true }
- Property { name: "hasContent"; type: "bool"; isReadonly: true }
- Property { name: "cursorSurface"; type: "bool" }
- Property { name: "inhibitsIdle"; revision: 270; type: "bool"; isReadonly: true }
- Signal {
- name: "damaged"
- Parameter { name: "rect"; type: "QRegion" }
- }
- Signal {
- name: "parentChanged"
- Parameter { name: "newParent"; type: "QWaylandSurface"; isPointer: true }
- Parameter { name: "oldParent"; type: "QWaylandSurface"; isPointer: true }
- }
- Signal {
- name: "childAdded"
- Parameter { name: "child"; type: "QWaylandSurface"; isPointer: true }
- }
- Signal { name: "sourceGeometryChanged"; revision: 269 }
- Signal { name: "destinationSizeChanged"; revision: 269 }
- Signal { name: "bufferSizeChanged"; revision: 269 }
- Signal {
- name: "offsetForNextFrame"
- Parameter { name: "offset"; type: "QPoint" }
- }
- Signal { name: "surfaceDestroyed" }
- Signal {
- name: "subsurfacePositionChanged"
- Parameter { name: "position"; type: "QPoint" }
- }
- Signal {
- name: "subsurfacePlaceAbove"
- Parameter { name: "sibling"; type: "QWaylandSurface"; isPointer: true }
- }
- Signal {
- name: "subsurfacePlaceBelow"
- Parameter { name: "sibling"; type: "QWaylandSurface"; isPointer: true }
- }
- Signal {
- name: "dragStarted"
- Parameter { name: "drag"; type: "QWaylandDrag"; isPointer: true }
- }
- Signal { name: "inhibitsIdleChanged"; revision: 65294 }
- Signal {
- name: "configure"
- Parameter { name: "hasBuffer"; type: "bool" }
- }
- Signal { name: "redraw" }
- Method { name: "updateSelection" }
- Method {
- name: "initialize"
- Parameter { name: "compositor"; type: "QWaylandCompositor"; isPointer: true }
- Parameter { name: "client"; type: "QWaylandClient"; isPointer: true }
- Parameter { name: "id"; type: "uint" }
- Parameter { name: "version"; type: "int" }
- }
- Method { name: "destroy" }
- Method { name: "isDestroyed"; type: "bool" }
- Method { name: "frameStarted" }
- Method { name: "sendFrameCallbacks" }
- }
- Component { name: "QWaylandTextInputManager"; prototype: "QWaylandCompositorExtension" }
- Component {
- name: "QWaylandTextInputManagerQuickExtension"
- defaultProperty: "data"
- prototype: "QWaylandTextInputManager"
- exports: ["QtWayland.Compositor/TextInputManager 1.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- }
- Component {
- prototype: "QWaylandQuickItem"
- name: "QtWayland.Compositor/WaylandCursorItem 1.0"
- exports: ["QtWayland.Compositor/WaylandCursorItem 1.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "seat"; type: "QObject"; isPointer: true }
- Property { name: "hotspotX"; type: "int" }
- Property { name: "hotspotY"; type: "int" }
- }
- Component {
- prototype: "QQuickWindowQmlImpl"
- name: "QtWayland.Compositor/WaylandOutputWindow 1.0"
- exports: ["QtWayland.Compositor/WaylandOutputWindow 1.0"]
- exportMetaObjectRevisions: [0]
- isComposite: true
- defaultProperty: "data"
- Property { name: "compositor"; type: "QObject"; isPointer: true }
- Property { name: "output"; type: "QObject"; isPointer: true }
- Property { name: "automaticFrameCallback"; type: "bool" }
- }
-}
diff --git a/src/imports/compositor/qmldir b/src/imports/compositor/qmldir
index 6307e1a8..0a9a719e 100644
--- a/src/imports/compositor/qmldir
+++ b/src/imports/compositor/qmldir
@@ -1,3 +1,4 @@
module QtWayland.Compositor
plugin qwaylandcompositorplugin
classname QWaylandCompositorPlugin
+typeinfo plugins.qmltypes
diff --git a/src/imports/compositor/qwaylandquickcompositorplugin.cpp b/src/imports/compositor/qwaylandquickcompositorplugin.cpp
index 9711fc05..aa2d822d 100644
--- a/src/imports/compositor/qwaylandquickcompositorplugin.cpp
+++ b/src/imports/compositor/qwaylandquickcompositorplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** 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.
@@ -26,123 +26,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <QtCore/QDir>
#include <QtQml/qqmlextensionplugin.h>
-
-#include <QtQuick/QQuickItem>
-
-#include <QtWaylandCompositor/QWaylandQuickCompositor>
-#include <QtWaylandCompositor/QWaylandQuickItem>
-#include <QtWaylandCompositor/private/qwaylandquickhardwarelayer_p.h>
-#include <QtWaylandCompositor/QWaylandQuickSurface>
-#include <QtWaylandCompositor/QWaylandClient>
-#include <QtWaylandCompositor/QWaylandQuickOutput>
-#include <QtWaylandCompositor/QWaylandCompositorExtension>
-#include <QtWaylandCompositor/QWaylandQuickExtension>
-#include <QtWaylandCompositor/QWaylandSeat>
-#if QT_CONFIG(draganddrop)
-#include <QtWaylandCompositor/QWaylandDrag>
-#endif
-#include <QtWaylandCompositor/QWaylandKeymap>
-#include <QtWaylandCompositor/QWaylandQuickShellSurfaceItem>
-#include <QtWaylandCompositor/QWaylandResource>
-
-#include <QtWaylandCompositor/QWaylandQtWindowManager>
-#include <QtWaylandCompositor/QWaylandShell>
-#include <QtWaylandCompositor/QWaylandShellSurface>
-#include <QtWaylandCompositor/QWaylandTextInputManager>
-#include <QtWaylandCompositor/QWaylandIdleInhibitManagerV1>
-
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
-#include "qwaylandmousetracker_p.h"
-
-QT_BEGIN_NAMESPACE
+#include <QtWaylandCompositor/private/qwaylandcompositor_p.h>
-Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CONTAINER_CLASS(QWaylandQuickCompositor)
-Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandQtWindowManager)
-Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandIdleInhibitManagerV1)
-Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandTextInputManager)
+extern void qml_register_types_QtWayland_Compositor();
-class QmlUrlResolver
-{
-public:
- QmlUrlResolver(bool useResource, const QDir &qmlDir, const QString &qrcPath)
- : m_useResource(useResource)
- , m_qmlDir(qmlDir)
- , m_qrcPath(qrcPath)
- { }
-
- QUrl get(const QString &fileName)
- {
- return m_useResource ? QUrl(m_qrcPath + fileName) :
- QUrl::fromLocalFile(m_qmlDir.filePath(fileName));
- }
-private:
- bool m_useResource;
- const QDir m_qmlDir;
- const QString m_qrcPath;
-};
+QT_BEGIN_NAMESPACE
//![class decl]
-class QWaylandCompositorPlugin : public QQmlExtensionPlugin
+class QWaylandCompositorPlugin : public QQmlEngineExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
- void registerTypes(const char *uri) override
+ QWaylandCompositorPlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent)
{
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor"));
- defineModule(uri);
-
- bool useResource = true;
- QDir qmlDir(baseUrl().toLocalFile());
- if (qmlDir.exists(QStringLiteral("WaylandCursorItem.qml")))
- useResource = false;
-
- QmlUrlResolver resolver(useResource, qmlDir, QStringLiteral("qrc:/QtWayland/Compositor/"));
-
- qmlRegisterType(resolver.get(QStringLiteral("WaylandOutputWindow.qml")), uri, 1, 0, "WaylandOutputWindow");
- qmlRegisterType(resolver.get(QStringLiteral("WaylandCursorItem.qml")), uri, 1, 0, "WaylandCursorItem");
- }
-
- static void defineModule(const char *uri)
- {
- // The minor version used to be the current Qt 5 minor. For compatibility it is the last
- // Qt release.
- qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR);
-
- qmlRegisterType<QWaylandQuickCompositorQuickExtensionContainer>(uri, 1, 0, "WaylandCompositor");
- qmlRegisterType<QWaylandQuickItem>(uri, 1, 0, "WaylandQuickItem");
- qmlRegisterType<QWaylandQuickItem, 13>(uri, 1, 13, "WaylandQuickItem");
-#if QT_CONFIG(opengl)
- qmlRegisterType<QWaylandQuickHardwareLayer>(uri, 1, 2, "WaylandHardwareLayer");
-#endif
- qmlRegisterType<QWaylandMouseTracker>(uri, 1, 0, "WaylandMouseTracker");
- qmlRegisterType<QWaylandQuickOutput>(uri, 1, 0, "WaylandOutput");
- qmlRegisterType<QWaylandQuickSurface>(uri, 1, 0, "WaylandSurface");
- qmlRegisterType<QWaylandQuickSurface, 13>(uri, 1, 13, "WaylandSurface");
- qmlRegisterType<QWaylandKeymap>(uri, 1, 0, "WaylandKeymap");
-
- qmlRegisterUncreatableType<QWaylandCompositorExtension>(uri, 1, 0, "WaylandExtension", QObject::tr("Cannot create instance of WaylandExtension"));
- qmlRegisterUncreatableType<QWaylandClient>(uri, 1, 0, "WaylandClient", QObject::tr("Cannot create instance of WaylandClient"));
- qmlRegisterUncreatableType<QWaylandOutput>(uri, 1, 0, "WaylandOutputBase", QObject::tr("Cannot create instance of WaylandOutputBase, use WaylandOutput instead"));
- qmlRegisterUncreatableType<QWaylandSeat>(uri, 1, 0, "WaylandSeat", QObject::tr("Cannot create instance of WaylandSeat"));
-#if QT_CONFIG(draganddrop)
- qmlRegisterUncreatableType<QWaylandDrag>(uri, 1, 0, "WaylandDrag", QObject::tr("Cannot create instance of WaylandDrag"));
-#endif
- qmlRegisterUncreatableType<QWaylandCompositor>(uri, 1, 0, "WaylandCompositorBase", QObject::tr("Cannot create instance of WaylandCompositorBase, use WaylandCompositor instead"));
- qmlRegisterUncreatableType<QWaylandSurface>(uri, 1, 0, "WaylandSurfaceBase", QObject::tr("Cannot create instance of WaylandSurfaceBase, use WaylandSurface instead"));
- qmlRegisterUncreatableType<QWaylandShell>(uri, 1, 0, "Shell", QObject::tr("Cannot create instance of Shell"));
- qmlRegisterUncreatableType<QWaylandShellSurface>(uri, 1, 0, "ShellSurface", QObject::tr("Cannot create instance of ShellSurface"));
- qmlRegisterUncreatableType<QWaylandResource>(uri, 1, 0, "WaylandResource", QObject::tr("Cannot create instance of WaylandResource"));
-
- //This should probably be somewhere else
- qmlRegisterType<QWaylandQtWindowManagerQuickExtension>(uri, 1, 0, "QtWindowManager");
- qmlRegisterType<QWaylandQuickShellSurfaceItem>(uri, 1, 0, "ShellSurfaceItem");
- qmlRegisterType<QWaylandTextInputManagerQuickExtension>(uri, 1, 0, "TextInputManager");
-
- qmlRegisterType<QWaylandIdleInhibitManagerV1QuickExtension>(uri, 1, 14, "IdleInhibitManagerV1");
+ volatile auto registration = &qml_register_types_QtWayland_Compositor;
+ Q_UNUSED(registration);
}
};
//![class decl]
diff --git a/src/imports/texture-sharing-extension/qmldir b/src/imports/texture-sharing-extension/qmldir
index 182e5c0e..c66f29bc 100644
--- a/src/imports/texture-sharing-extension/qmldir
+++ b/src/imports/texture-sharing-extension/qmldir
@@ -1,3 +1,4 @@
module QtWayland.Compositor.TextureSharingExtension
plugin qwaylandtexturesharingextension
classname QWaylandTextureSharingExtensionPlugin
+typeinfo plugins.qmltypes
diff --git a/src/imports/texture-sharing/qmldir b/src/imports/texture-sharing/qmldir
index cf3b74c4..4107ebc2 100644
--- a/src/imports/texture-sharing/qmldir
+++ b/src/imports/texture-sharing/qmldir
@@ -1,3 +1,4 @@
module QtWayland.Client.TextureSharing
plugin qwaylandtexturesharing
classname QWaylandTextureSharingPlugin
+typeinfo plugins.qmltypes