summaryrefslogtreecommitdiffstats
path: root/examples/wayland/custom-shell/client-plugin/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/wayland/custom-shell/client-plugin/main.cpp')
-rw-r--r--examples/wayland/custom-shell/client-plugin/main.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/wayland/custom-shell/client-plugin/main.cpp b/examples/wayland/custom-shell/client-plugin/main.cpp
new file mode 100644
index 000000000..4ae488880
--- /dev/null
+++ b/examples/wayland/custom-shell/client-plugin/main.cpp
@@ -0,0 +1,32 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "exampleshellintegration.h"
+
+//! [include]
+#include <QtWaylandClient/private/qwaylandclientshellapi_p.h>
+//! [include]
+
+#include "qwayland-example-shell.h"
+
+using namespace QtWaylandClient;
+
+//! [plugin]
+class QWaylandExampleShellIntegrationPlugin : public QWaylandShellIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "example-shell.json")
+
+public:
+ QWaylandShellIntegration *create(const QString &key, const QStringList &paramList) override;
+};
+
+QWaylandShellIntegration *QWaylandExampleShellIntegrationPlugin::create(const QString &key, const QStringList &paramList)
+{
+ Q_UNUSED(key);
+ Q_UNUSED(paramList);
+ return new ExampleShellIntegration();
+}
+//! [plugin]
+
+#include "main.moc"