summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-06-03 11:51:46 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-06-05 09:05:09 +0200
commitdb33032ff1cf66796d8fdcff5ce6f0ce99e0699e (patch)
treede554196edafe1814dd29c6b7d0fa1c178db204b
parent77cf64fb1f17b46145f06cf2af57216feec9a1de (diff)
downloadqtwayland-db33032ff1cf66796d8fdcff5ce6f0ce99e0699e.tar.gz
Port qtwayland to new QML CMake API
The compositor part was already in a good shape, and we can get rid of the custom plugin. The other plugins aren't ported to declarative type registration yet, so we keep the plugins as they are for now. Change-Id: I2cbaa761f0313878864fd615e21c003c58243b48 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/compositor/CMakeLists.txt49
-rw-r--r--src/compositor/qmlfiles/WaylandCursorItem.qml (renamed from src/imports/compositor/WaylandCursorItem.qml)0
-rw-r--r--src/compositor/qmlfiles/WaylandOutputWindow.qml (renamed from src/imports/compositor/WaylandOutputWindow.qml)0
-rw-r--r--src/imports/CMakeLists.txt1
-rw-r--r--src/imports/compositor-extensions/iviapplication/CMakeLists.txt9
-rw-r--r--src/imports/compositor-extensions/wlshell/CMakeLists.txt10
-rw-r--r--src/imports/compositor-extensions/xdgshell/CMakeLists.txt10
-rw-r--r--src/imports/compositor/CMakeLists.txt46
-rw-r--r--src/imports/compositor/qwaylandquickcompositorplugin.cpp54
-rw-r--r--src/imports/texture-sharing-extension/CMakeLists.txt8
-rw-r--r--src/imports/texture-sharing/CMakeLists.txt16
-rw-r--r--src/imports/texture-sharing/plugin.cpp2
-rw-r--r--src/imports/texture-sharing/sharedtextureprovider.cpp4
-rw-r--r--src/imports/texture-sharing/sharedtextureprovider_p.h (renamed from src/imports/texture-sharing/sharedtextureprovider.h)11
-rw-r--r--src/imports/texture-sharing/texturesharingextension.cpp2
-rw-r--r--src/imports/texture-sharing/texturesharingextension_p.h (renamed from src/imports/texture-sharing/texturesharingextension.h)11
16 files changed, 85 insertions, 148 deletions
diff --git a/src/compositor/CMakeLists.txt b/src/compositor/CMakeLists.txt
index 140bf587..0f53f730 100644
--- a/src/compositor/CMakeLists.txt
+++ b/src/compositor/CMakeLists.txt
@@ -160,11 +160,6 @@ qt_internal_extend_target(WaylandCompositor CONDITION QT_FEATURE_wayland_composi
Qt::QuickPrivate
)
-#### Keys ignored in scope 4:.:.:compositor.pro:QT_FEATURE_wayland_compositor_quick:
-# QMLTYPES_FILENAME = "plugins.qmltypes"
-# QMLTYPES_INSTALL_DIR = "$$[QT_INSTALL_QML]/QtWayland/Compositor"
-# QML_IMPORT_NAME = "QtWayland.Compositor"
-# QML_IMPORT_VERSION = "$$QT_VERSION"
qt_internal_extend_target(WaylandCompositor CONDITION QT_FEATURE_wayland_datadevice
SOURCES
@@ -174,16 +169,6 @@ qt_internal_extend_target(WaylandCompositor CONDITION QT_FEATURE_wayland_datadev
wayland_wrapper/qwldatasource.cpp wayland_wrapper/qwldatasource_p.h
)
-# special case begin
-#
-# Do not explicitly add XKB::XKB. This is already done by Qt::GuiPrivate.
-#
-#qt_internal_extend_target(WaylandCompositor CONDITION QT_FEATURE_xkbcommon
-# PUBLIC_LIBRARIES
-# XKB::XKB
-#)
-# special case end
-
qt_internal_extend_target(WaylandCompositor CONDITION QT_FEATURE_im
SOURCES
compositor_api/qwaylandinputmethodcontrol.cpp compositor_api/qwaylandinputmethodcontrol.h compositor_api/qwaylandinputmethodcontrol_p.h
@@ -203,19 +188,31 @@ qt_internal_add_docs(WaylandCompositor
doc/qtwaylandcompositor.qdocconf
)
-# special case begin
+set(qmlfiles
+ qmlfiles/WaylandCursorItem.qml
+ qmlfiles/WaylandOutputWindow.qml
+)
+
+set_source_files_properties(qmlfiles/WaylandOutputWindow.qml PROPERTIES
+ QT_QML_SOURCE_VERSION "1.0"
+ QT_QML_SOURCE_TYPENAME WaylandOutputWindow
+)
+set_source_files_properties(qmlfiles/WaylandCursorItem.qml PROPERTIES
+ QT_QML_SOURCE_VERSION "1.0"
+ QT_QML_SOURCE_TYPENAME WaylandCursorItem
+)
+
if (TARGET Qt::Qml)
- set_target_properties(WaylandCompositor PROPERTIES
- QT_QML_MODULE_INSTALL_QMLTYPES TRUE
- QT_QML_MODULE_VERSION ${PROJECT_VERSION}
- QT_QML_MODULE_URI QtWayland.Compositor
- QT_QMLTYPES_FILENAME plugins.qmltypes
- QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtWayland/Compositor"
+ qt_internal_add_qml_module(WaylandCompositor
+ URI QtWayland.Compositor
+ VERSION ${PROJECT_VERSION}
+ CLASS_NAME QWaylandCompositorPlugin
+ NO_CREATE_BACKING_TARGET
+ PLUGIN_TARGET qwaylandcompositorplugin
+ QML_FILES ${qmlfiles}
+ DEPENDENCIES
+ QtQuick
)
-
- qt6_qml_type_registration(WaylandCompositor)
endif()
qt_record_extra_qt_main_tools_package_dependency(WaylandCompositor WaylandScannerTools "${PROJECT_VERSION}")
-# special case end
-
diff --git a/src/imports/compositor/WaylandCursorItem.qml b/src/compositor/qmlfiles/WaylandCursorItem.qml
index ba2e044c..ba2e044c 100644
--- a/src/imports/compositor/WaylandCursorItem.qml
+++ b/src/compositor/qmlfiles/WaylandCursorItem.qml
diff --git a/src/imports/compositor/WaylandOutputWindow.qml b/src/compositor/qmlfiles/WaylandOutputWindow.qml
index 0462a9a2..0462a9a2 100644
--- a/src/imports/compositor/WaylandOutputWindow.qml
+++ b/src/compositor/qmlfiles/WaylandOutputWindow.qml
diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt
index bb767b60..9ff345ae 100644
--- a/src/imports/CMakeLists.txt
+++ b/src/imports/CMakeLists.txt
@@ -1,7 +1,6 @@
# Generated from imports.pro.
if(TARGET Qt::Quick AND TARGET Qt::WaylandCompositor)
- add_subdirectory(compositor)
add_subdirectory(compositor-extensions)
endif()
if(QT_FEATURE_opengl AND TARGET Qt::Quick AND TARGET Qt::WaylandClient AND TARGET Qt::WaylandCompositor)
diff --git a/src/imports/compositor-extensions/iviapplication/CMakeLists.txt b/src/imports/compositor-extensions/iviapplication/CMakeLists.txt
index 8d8cdb4f..1989d462 100644
--- a/src/imports/compositor-extensions/iviapplication/CMakeLists.txt
+++ b/src/imports/compositor-extensions/iviapplication/CMakeLists.txt
@@ -4,11 +4,14 @@
## qwaylandcompositoriviapplicationplugin Plugin:
#####################################################################
-qt_internal_add_qml_module(qwaylandcompositoriviapplicationplugin
+qt_internal_add_qml_module(WaylandCompositorIviapplication
URI "QtWayland.Compositor.IviApplication"
VERSION "${PROJECT_VERSION}"
- CLASSNAME QWaylandCompositorIviApplicationPlugin
- SKIP_TYPE_REGISTRATION
+ CLASS_NAME QWaylandCompositorIviApplicationPlugin
+ PLUGIN_TARGET WaylandCompositorIviapplication
+ NO_PLUGIN_OPTIONAL
+ NO_GENERATE_PLUGIN_SOURCE
+ NO_GENERATE_QMLTYPES
SOURCES
qwaylandcompositoriviapplicationplugin.cpp
PUBLIC_LIBRARIES
diff --git a/src/imports/compositor-extensions/wlshell/CMakeLists.txt b/src/imports/compositor-extensions/wlshell/CMakeLists.txt
index 618c461e..7c05e38e 100644
--- a/src/imports/compositor-extensions/wlshell/CMakeLists.txt
+++ b/src/imports/compositor-extensions/wlshell/CMakeLists.txt
@@ -4,11 +4,15 @@
## qwaylandcompositorwlshellplugin Plugin:
#####################################################################
-qt_internal_add_qml_module(qwaylandcompositorwlshellplugin
+qt_internal_add_qml_module(WaylandCompositorWLShell
URI "QtWayland.Compositor.WlShell"
VERSION "${PROJECT_VERSION}"
- CLASSNAME QWaylandCompositorWlShellPlugin
- SKIP_TYPE_REGISTRATION
+ CLASS_NAME QWaylandCompositorWlShellPlugin
+ NO_PLUGIN_OPTIONAL
+ PLUGIN_TARGET WaylandCompositorWLShell
+ NO_GENERATE_PLUGIN_SOURCE
+ NO_GENERATE_QMLTYPES
+ INSTALL_SOURCE_QMLTYPES "plugins.qmltypes"
SOURCES
qwaylandcompositorwlshellplugin.cpp
PUBLIC_LIBRARIES
diff --git a/src/imports/compositor-extensions/xdgshell/CMakeLists.txt b/src/imports/compositor-extensions/xdgshell/CMakeLists.txt
index 400647b5..e975fe7a 100644
--- a/src/imports/compositor-extensions/xdgshell/CMakeLists.txt
+++ b/src/imports/compositor-extensions/xdgshell/CMakeLists.txt
@@ -4,11 +4,15 @@
## qwaylandcompositorxdgshellplugin Plugin:
#####################################################################
-qt_internal_add_qml_module(qwaylandcompositorxdgshellplugin
+qt_internal_add_qml_module(WaylandCompositorXdgShell
URI "QtWayland.Compositor.XdgShell"
VERSION "${PROJECT_VERSION}"
- CLASSNAME QWaylandCompositorXdgShellPlugin
- SKIP_TYPE_REGISTRATION
+ NO_PLUGIN_OPTIONAL
+ PLUGIN_TARGET WaylandCompositorXdgShell
+ NO_GENERATE_PLUGIN_SOURCE
+ NO_GENERATE_QMLTYPES
+ INSTALL_SOURCE_QMLTYPES "plugins.qmltypes"
+ CLASS_NAME QWaylandCompositorXdgShellPlugin
SOURCES
qwaylandcompositorxdgshellplugin.cpp
PUBLIC_LIBRARIES
diff --git a/src/imports/compositor/CMakeLists.txt b/src/imports/compositor/CMakeLists.txt
deleted file mode 100644
index f51ea79c..00000000
--- a/src/imports/compositor/CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-# Generated from compositor.pro.
-
-#####################################################################
-## qwaylandcompositorplugin Plugin:
-#####################################################################
-
-qt_internal_add_qml_module(qwaylandcompositorplugin
- URI "QtWayland.Compositor"
- VERSION "${PROJECT_VERSION}"
- CLASSNAME QWaylandCompositorPlugin
- SOURCES
- qwaylandquickcompositorplugin.cpp
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::CorePrivate
- Qt::Gui
- Qt::GuiPrivate
- Qt::QmlPrivate
- Qt::QuickPrivate
- Qt::WaylandCompositor
- Qt::WaylandCompositorPrivate
-)
-
-#### Keys ignored in scope 1:.:.:compositor.pro:<TRUE>:
-# CXX_MODULE = "qml"
-# OTHER_FILES = "qmldir" "$$QML_FILES"
-# QML_FILES = "$$PWD/WaylandOutputWindow.qml" "$$PWD/WaylandCursorItem.qml"
-# QML_IMPORT_VERSION = "$$QT_VERSION"
-# QMl_IMPORT_NAME = "QtWayland.Compositor"
-# TARGETPATH = "QtWayland/Compositor"
-
-set(qml_files
- "WaylandOutputWindow.qml"
- "WaylandCursorItem.qml"
-)
-set_source_files_properties(WaylandOutputWindow.qml PROPERTIES
- QT_QML_SOURCE_VERSION "1.0"
-)
-set_source_files_properties(WaylandCursorItem.qml PROPERTIES
- QT_QML_SOURCE_VERSION "1.0"
-)
-
-qt6_target_qml_files(qwaylandcompositorplugin
- FILES
- ${qml_files}
-)
diff --git a/src/imports/compositor/qwaylandquickcompositorplugin.cpp b/src/imports/compositor/qwaylandquickcompositorplugin.cpp
deleted file mode 100644
index aa2d822d..00000000
--- a/src/imports/compositor/qwaylandquickcompositorplugin.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtQml/qqmlextensionplugin.h>
-#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
-#include <QtWaylandCompositor/private/qwaylandcompositor_p.h>
-
-extern void qml_register_types_QtWayland_Compositor();
-
-QT_BEGIN_NAMESPACE
-
-//![class decl]
-class QWaylandCompositorPlugin : public QQmlEngineExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
-public:
- QWaylandCompositorPlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent)
- {
- volatile auto registration = &qml_register_types_QtWayland_Compositor;
- Q_UNUSED(registration);
- }
-};
-//![class decl]
-
-QT_END_NAMESPACE
-
-#include "qwaylandquickcompositorplugin.moc"
diff --git a/src/imports/texture-sharing-extension/CMakeLists.txt b/src/imports/texture-sharing-extension/CMakeLists.txt
index c1de21ae..d95dc821 100644
--- a/src/imports/texture-sharing-extension/CMakeLists.txt
+++ b/src/imports/texture-sharing-extension/CMakeLists.txt
@@ -4,11 +4,15 @@
## qwaylandtexturesharingextension Plugin:
#####################################################################
-qt_internal_add_qml_module(qwaylandtexturesharingextension
+qt_internal_add_qml_module(WaylandTextureSharingExtension
URI "QtWayland.Compositor.TextureSharingExtension"
VERSION "1.${PROJECT_VERSION_MINOR}"
CLASSNAME QWaylandTextureSharingExtensionPlugin
- SKIP_TYPE_REGISTRATION
+ NO_PLUGIN_OPTIONAL
+ NO_GENERATE_PLUGIN_SOURCE
+ NO_GENERATE_QMLTYPES
+ PLUGIN_TARGET WaylandTextureSharingExtension
+ # misses a plugin.qmltypes files, so nothing to install
SOURCES
plugin.cpp
PUBLIC_LIBRARIES
diff --git a/src/imports/texture-sharing/CMakeLists.txt b/src/imports/texture-sharing/CMakeLists.txt
index dacc0f0f..6f34dea0 100644
--- a/src/imports/texture-sharing/CMakeLists.txt
+++ b/src/imports/texture-sharing/CMakeLists.txt
@@ -4,15 +4,19 @@
## qwaylandtexturesharing Plugin:
#####################################################################
-qt_internal_add_qml_module(qwaylandtexturesharing
+qt_internal_add_qml_module(WaylandTextureSharing
URI "QtWayland.Client.TextureSharing"
VERSION "1.${PROJECT_VERSION_MINOR}"
- CLASSNAME QWaylandTextureSharingPlugin
- SKIP_TYPE_REGISTRATION
+ NO_PLUGIN_OPTIONAL
+ NO_GENERATE_PLUGIN_SOURCE
+ NO_GENERATE_QMLTYPES
+ PLUGIN_TARGET WaylandTextureSharing
+ # no qmltypes file available, so nothing to install
+ CLASS_NAME QWaylandTextureSharingPlugin
SOURCES
plugin.cpp
- sharedtextureprovider.cpp sharedtextureprovider.h
- texturesharingextension.cpp texturesharingextension.h
+ sharedtextureprovider.cpp sharedtextureprovider_p.h
+ texturesharingextension.cpp texturesharingextension_p.h
PUBLIC_LIBRARIES
Qt::Core
Qt::CorePrivate
@@ -25,7 +29,7 @@ qt_internal_add_qml_module(qwaylandtexturesharing
Qt::WaylandClientPrivate
)
-qt6_generate_wayland_protocol_client_sources(qwaylandtexturesharing
+qt6_generate_wayland_protocol_client_sources(WaylandTextureSharing
FILES
${CMAKE_CURRENT_SOURCE_DIR}/../../extensions/qt-texture-sharing-unstable-v1.xml
)
diff --git a/src/imports/texture-sharing/plugin.cpp b/src/imports/texture-sharing/plugin.cpp
index 695ce874..67221b63 100644
--- a/src/imports/texture-sharing/plugin.cpp
+++ b/src/imports/texture-sharing/plugin.cpp
@@ -40,7 +40,7 @@
#include <QtQml/qqmlextensionplugin.h>
#include <QtQml/qqmlengine.h>
-#include "sharedtextureprovider.h"
+#include "sharedtextureprovider_p.h"
/*!
\internal
diff --git a/src/imports/texture-sharing/sharedtextureprovider.cpp b/src/imports/texture-sharing/sharedtextureprovider.cpp
index 45da3333..2346d352 100644
--- a/src/imports/texture-sharing/sharedtextureprovider.cpp
+++ b/src/imports/texture-sharing/sharedtextureprovider.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
-#include "sharedtextureprovider.h"
+#include "sharedtextureprovider_p.h"
#include <QFile>
#include <QDebug>
@@ -57,7 +57,7 @@
#include <QTimer>
-#include "texturesharingextension.h"
+#include "texturesharingextension_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/imports/texture-sharing/sharedtextureprovider.h b/src/imports/texture-sharing/sharedtextureprovider_p.h
index 7eaf9e0d..be3d3c5b 100644
--- a/src/imports/texture-sharing/sharedtextureprovider.h
+++ b/src/imports/texture-sharing/sharedtextureprovider_p.h
@@ -37,6 +37,17 @@
**
****************************************************************************/
+//
+// 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.
+//
+
#ifndef SHAREDTEXTUREPROVIDER_H
#define SHAREDTEXTUREPROVIDER_H
diff --git a/src/imports/texture-sharing/texturesharingextension.cpp b/src/imports/texture-sharing/texturesharingextension.cpp
index 31106d69..79a641a7 100644
--- a/src/imports/texture-sharing/texturesharingextension.cpp
+++ b/src/imports/texture-sharing/texturesharingextension.cpp
@@ -38,7 +38,7 @@
**
****************************************************************************/
-#include "texturesharingextension.h"
+#include "texturesharingextension_p.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QtWaylandClient/private/qwaylandintegration_p.h>
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
diff --git a/src/imports/texture-sharing/texturesharingextension.h b/src/imports/texture-sharing/texturesharingextension_p.h
index 7b864fbc..b9c4ea90 100644
--- a/src/imports/texture-sharing/texturesharingextension.h
+++ b/src/imports/texture-sharing/texturesharingextension_p.h
@@ -37,6 +37,17 @@
**
****************************************************************************/
+//
+// 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.
+//
+
#ifndef TEXTURESHARINGEXTENSION_H
#define TEXTURESHARINGEXTENSION_H