1// Copyright (C) 2021 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 "qwaylandqtshell.h"
9#include "qwaylandqtshellchrome.h"
10
11QT_BEGIN_NAMESPACE
12
13Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandQtShell)
14
15/*!
16 \qmlmodule QtWayland.Compositor.QtShell
17 \title Qt Wayland Qt Shell Extension
18 \ingroup qmlmodules
19 \since 6.3
20 \brief Provides a shell extension for Qt applications running on a Qt Wayland Compositor.
21
22 \section2 Summary
23 The QtShell extension provides a way to associate an QtShellSurface with a regular Wayland
24 surface. The QtShell extension is written to support the window management features which are
25 supported by Qt. It may be suitable on a platform where both the compositor and client
26 applications are written with Qt, and where applications are trusted not to abuse features such
27 as manual window positioning and "bring-to-front".
28
29 For other use cases, consider using IviApplication or XdgShell instead.
30
31 \section2 Usage
32 To use this module, import it like this:
33 \qml
34 import QtWayland.Compositor.IviApplication
35 \endqml
36*/
37
38class QQtWaylandShellPlugin : public QQmlExtensionPlugin
39{
40 Q_OBJECT
41 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
42public:
43 void registerTypes(const char *uri) override
44 {
45 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor.QtShell"));
46 defineModule(uri);
47 }
48
49 static void defineModule(const char *uri)
50 {
51 qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR);
52 qmlRegisterType<QWaylandQtShellQuickExtension>(uri, versionMajor: 1, versionMinor: 0, qmlName: "QtShell");
53 qmlRegisterType<QWaylandQtShellSurface>(uri, versionMajor: 1, versionMinor: 0, qmlName: "QtShellSurface");
54 qmlRegisterType<QWaylandQtShellChrome>(uri, versionMajor: 1, versionMinor: 0, qmlName: "QtShellChrome");
55 }
56};
57
58QT_END_NAMESPACE
59
60#include "qwaylandqtshellplugin.moc"
61

source code of qtwayland/src/imports/compositor-extensions/qtshell/qwaylandqtshellplugin.cpp