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
qwaylandcompositorquickextensions_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDCOMPOSITORQUICKEXTENSIONS_P_H
5#define QWAYLANDCOMPOSITORQUICKEXTENSIONS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQml/qqml.h>
19#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
20#include <QtWaylandCompositor/qwaylandquickextension.h>
21
22#include <QtWaylandCompositor/qwaylandcompositor.h>
23#include <QtWaylandCompositor/qwaylandquickcompositor.h>
24#include <QtWaylandCompositor/qwaylandqtwindowmanager.h>
25#include <QtWaylandCompositor/qwaylandtextinputmanager.h>
26#include <QtCore/private/qglobal_p.h>
27#include <QtWaylandCompositor/qwaylandtextinputmanagerv3.h>
28#include <QtWaylandCompositor/qwaylandqttextinputmethodmanager.h>
29#include <QtWaylandCompositor/qwaylandidleinhibitv1.h>
30
32
34{
36 Q_PROPERTY(QQmlListProperty<QWaylandCompositorExtension> extensions READ extensions)
38 Q_CLASSINFO("DefaultProperty", "data")
39 QML_NAMED_ELEMENT(WaylandCompositor)
41public:
43 {
44 return QQmlListProperty<QObject>(this, &m_objects);
45 }
46
47 QQmlListProperty<QWaylandCompositorExtension> extensions()
48 {
49 return QQmlListProperty<QWaylandCompositorExtension>(this, this,
50 &append_extension,
51 &countFunction,
52 &atFunction,
53 &clearFunction);
54 }
55
56 static qsizetype countFunction(QQmlListProperty<QWaylandCompositorExtension> *list)
57 {
58 return static_cast<QWaylandQuickCompositorQuickExtensionContainer *>(list->data)->extension_vector.size();
59 }
60
61 static QWaylandCompositorExtension *atFunction(QQmlListProperty<QWaylandCompositorExtension> *list, qsizetype index)
62 {
63 return static_cast<QWaylandQuickCompositorQuickExtensionContainer *>(list->data)->extension_vector.at(index);
64 }
65
66 static void append_extension(QQmlListProperty<QWaylandCompositorExtension> *list, QWaylandCompositorExtension *extension)
67 {
69 extension->setExtensionContainer(quickExtObj);
70 }
71
72 static void clearFunction(QQmlListProperty<QWaylandCompositorExtension> *list)
73 {
74 static_cast<QWaylandQuickCompositorQuickExtensionContainer *>(list->data)->extension_vector.clear();
75 }
76
77private:
78 QList<QObject *> m_objects;
79};
80
81
82// Note: These have to be in a header with a Q_OBJECT macro, otherwise we won't run moc on it
88
90
91#endif // QWAYLANDCOMPOSITORQUICKEXTENSIONS_P_H
pointer data()
Definition qlist.h:431
\inmodule QtCore
Definition qobject.h:103
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
\inmodule QtWaylandCompositor
\inmodule QtWaylandCompositor
\qmltype QtTextInputMethodManager \instantiates QWaylandQtTextInputMethodManager \inqmlmodule QtWayla...
QQmlListProperty< QWaylandCompositorExtension > extensions()
static void append_extension(QQmlListProperty< QWaylandCompositorExtension > *list, QWaylandCompositorExtension *extension)
static qsizetype countFunction(QQmlListProperty< QWaylandCompositorExtension > *list)
static void clearFunction(QQmlListProperty< QWaylandCompositorExtension > *list)
static QWaylandCompositorExtension * atFunction(QQmlListProperty< QWaylandCompositorExtension > *list, qsizetype index)
Provides access to input methods in the compositor.
\qmltype TextInputManager \instantiates QWaylandTextInputManager \inqmlmodule QtWayland....
void extension()
[6]
Definition dialogs.cpp:230
Combined button and popup list for selecting options.
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
ptrdiff_t qsizetype
Definition qtypes.h:165
#define Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_NAMED_CLASS(className, QmlType)
QList< int > list
[14]