1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include <QtQml/qqmlextensionplugin.h>
5#include <QtQml/qqml.h>
6
7#include <QtWaylandCompositor/qwaylandquickextension.h>
8#include <QtWaylandCompositor/qwaylandwlshell.h>
9
10QT_BEGIN_NAMESPACE
11
12Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandWlShell)
13
14/*!
15 \qmlmodule QtWayland.Compositor.WlShell
16 \title Qt Wayland WlShell extension
17 \ingroup qmlmodules
18 \brief Provides a Qt API for the WlShell extension.
19
20 \section2 Summary
21 WlShell is a shell extension providing window system features typical to
22 desktop systems. It is superseded by XdgShell and exists in Qt mainly
23 for backwards compatibility with older applications.
24
25 WlShell corresponds to the Wayland interface \c wl_shell.
26
27 \section2 Usage
28 To use this module, import it like this:
29 \qml
30 import QtWayland.Compositor.WlShell
31 \endqml
32*/
33
34class QWaylandCompositorWlShellPlugin : public QQmlExtensionPlugin
35{
36 Q_OBJECT
37 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
38public:
39 void registerTypes(const char *uri) override
40 {
41 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor.WlShell"));
42 defineModule(uri);
43 }
44
45 static void defineModule(const char *uri)
46 {
47 qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR);
48 qmlRegisterType<QWaylandWlShellQuickExtension>(uri, versionMajor: 1, versionMinor: 0, qmlName: "WlShell");
49 qmlRegisterType<QWaylandWlShellSurface>(uri, versionMajor: 1, versionMinor: 0, qmlName: "WlShellSurface");
50 }
51};
52
53QT_END_NAMESPACE
54
55#include "qwaylandcompositorwlshellplugin.moc"
56

source code of qtwayland/src/imports/compositor-extensions/wlshell/qwaylandcompositorwlshellplugin.cpp