summaryrefslogtreecommitdiffstats
path: root/examples/wayland/custom-shell/client-plugin/exampleshellintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/wayland/custom-shell/client-plugin/exampleshellintegration.cpp')
-rw-r--r--examples/wayland/custom-shell/client-plugin/exampleshellintegration.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/wayland/custom-shell/client-plugin/exampleshellintegration.cpp b/examples/wayland/custom-shell/client-plugin/exampleshellintegration.cpp
new file mode 100644
index 000000000..b979640a7
--- /dev/null
+++ b/examples/wayland/custom-shell/client-plugin/exampleshellintegration.cpp
@@ -0,0 +1,22 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "exampleshellintegration.h"
+#include "examplesurface.h"
+
+//! [constructor]
+ExampleShellIntegration::ExampleShellIntegration()
+ : QWaylandShellIntegrationTemplate(/* Supported protocol version */ 1)
+{
+}
+//! [constructor]
+
+//! [createShellSurface]
+QWaylandShellSurface *ExampleShellIntegration::createShellSurface(QWaylandWindow *window)
+{
+ if (!isActive())
+ return nullptr;
+ auto *surface = surface_create(wlSurfaceForWindow(window));
+ return new ExampleShellSurface(surface, window);
+}
+//! [createShellSurface]