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
qwaylandshell.h
Go to the documentation of this file.
1// Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDSHELL_H
5#define QWAYLANDSHELL_H
6
7#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
8#include <QtWaylandCompositor/qwaylandcompositorextension.h>
9
11
13
14class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandShell : public QWaylandCompositorExtension
15{
17 Q_DECLARE_PRIVATE(QWaylandShell)
18 Q_PROPERTY(FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy NOTIFY focusPolicyChanged)
19
23public:
26 ManualFocus
27 };
28 Q_ENUM(FocusPolicy)
29
31 QWaylandShell(QWaylandObject *waylandObject);
32
33 FocusPolicy focusPolicy() const;
34 void setFocusPolicy(FocusPolicy focusPolicy);
35
38
39protected:
41 explicit QWaylandShell(QWaylandObject *container, QWaylandShellPrivate &dd);
42};
43
44template <typename T>
45class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandShellTemplate : public QWaylandShell
46{
47public:
51
53 : QWaylandShell(container)
54 { }
55
56 const struct wl_interface *extensionInterface() const override
57 {
58 return T::interface();
59 }
60
61 static T *findIn(QWaylandObject *container)
62 {
63 if (!container) return nullptr;
64 return qobject_cast<T *>(container->extension(T::interfaceName()));
65 }
66
67protected:
71
73 : QWaylandShell(container,dd)
74 { }
75};
76
78
79#endif // QWAYLANDSHELL_H
\inmodule QtWaylandCompositor
\inmodule QtWaylandCompositor
QWaylandCompositorExtension * extension(const QByteArray &name)
Returns the compositor extension which matches name if one has been registered with the QWaylandObjec...
static T * findIn(QWaylandObject *container)
QWaylandShellTemplate(QWaylandObject *container, QWaylandShellPrivate &dd)
QWaylandShellTemplate(QWaylandShellPrivate &dd)
QWaylandShellTemplate(QWaylandObject *container)
const struct wl_interface * extensionInterface() const override
A pure virtual function which should be reimplemented to return the wl_interface which corresponds to...
void focusPolicyChanged()
FocusPolicy
This enum type is used to specify the focus policy for shell surfaces.
Combined button and popup list for selecting options.
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS