Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylandcompositorextension.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDEXTENSION_H
5#define QWAYLANDEXTENSION_H
6
7#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
8#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
9
10#include <QtCore/QObject>
11
12struct wl_interface;
13
15
19
20class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandObject : public QObject
21{
23public:
24 ~QWaylandObject() override;
25
28 QList<QWaylandCompositorExtension *> extensions() const;
29 void addExtension(QWaylandCompositorExtension *extension);
30 void removeExtension(QWaylandCompositorExtension *extension);
31
32protected:
33 QWaylandObject(QObject *parent = nullptr);
34 QWaylandObject(QObjectPrivate &d, QObject *parent = nullptr);
35 QList<QWaylandCompositorExtension *> extension_vector;
36};
37
38class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandCompositorExtension : public QWaylandObject
39{
41 Q_DECLARE_PRIVATE(QWaylandCompositorExtension)
42 QML_NAMED_ELEMENT(WaylandExtension)
45public:
49
50 QWaylandObject *extensionContainer() const;
51 void setExtensionContainer(QWaylandObject *container);
52
53 virtual void initialize();
54 bool isInitialized() const;
55
56 virtual const struct wl_interface *extensionInterface() const = 0;
57
58protected:
61
62 bool event(QEvent *event) override;
63};
64
65template <typename T>
67{
68public:
72
76
77 const struct wl_interface *extensionInterface() const override
78 {
79 return T::interface();
80 }
81
82 static T *findIn(QWaylandObject *container)
83 {
84 if (!container) return nullptr;
85 return qobject_cast<T *>(container->extension(T::interfaceName()));
86 }
87
88protected:
92
96};
97
99
100#endif
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtCore
Definition qobject.h:103
QWaylandCompositorExtensionTemplate(QWaylandCompositorExtensionPrivate &dd)
QWaylandCompositorExtensionTemplate(QWaylandObject *container, QWaylandCompositorExtensionPrivate &dd)
const struct wl_interface * extensionInterface() const override
A pure virtual function which should be reimplemented to return the wl_interface which corresponds to...
static T * findIn(QWaylandObject *container)
If any instance of the interface has been registered with container, this is returned.
QWaylandCompositorExtensionTemplate(QWaylandObject *container)
\inmodule QtWaylandCompositor
virtual const struct wl_interface * extensionInterface() const =0
A pure virtual function which should be reimplemented to return the wl_interface which corresponds to...
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\inmodule QtWaylandCompositor
QWaylandCompositorExtension * extension(const QByteArray &name)
Returns the compositor extension which matches name if one has been registered with the QWaylandObjec...
QList< QWaylandCompositorExtension * > extension_vector
void extension()
[6]
Definition dialogs.cpp:230
Combined button and popup list for selecting options.
static bool initialize()
Definition qctf.cpp:94
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char * interface
GLuint name
struct _cl_event * event
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_OBJECT