1 | // Copyright (C) 2019 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QWAYLANDIDLEINHIBITV1_P_H |
5 | #define QWAYLANDIDLEINHIBITV1_P_H |
6 | |
7 | #include <QtWaylandCompositor/QWaylandSurface> |
8 | #include <QtWaylandCompositor/QWaylandIdleInhibitManagerV1> |
9 | #include <QtWaylandCompositor/private/qwaylandcompositorextension_p.h> |
10 | #include <QtWaylandCompositor/private/qwayland-server-idle-inhibit-unstable-v1.h> |
11 | |
12 | #include <QtCore/qpointer.h> |
13 | |
14 | // |
15 | // W A R N I N G |
16 | // ------------- |
17 | // |
18 | // This file is not part of the Qt API. It exists purely as an |
19 | // implementation detail. This header file may change from version to |
20 | // version without notice, or even be removed. |
21 | // |
22 | // We mean it. |
23 | // |
24 | |
25 | QT_BEGIN_NAMESPACE |
26 | |
27 | class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandIdleInhibitManagerV1Private |
28 | : public QWaylandCompositorExtensionPrivate |
29 | , public QtWaylandServer::zwp_idle_inhibit_manager_v1 |
30 | { |
31 | Q_DECLARE_PUBLIC(QWaylandIdleInhibitManagerV1) |
32 | public: |
33 | explicit QWaylandIdleInhibitManagerV1Private() = default; |
34 | |
35 | class Q_WAYLANDCOMPOSITOR_EXPORT Inhibitor |
36 | : public QtWaylandServer::zwp_idle_inhibitor_v1 |
37 | { |
38 | public: |
39 | explicit Inhibitor(QWaylandSurface *surface, wl_client *client, quint32 id, quint32 version); |
40 | |
41 | protected: |
42 | void zwp_idle_inhibitor_v1_destroy_resource(Resource *resource) override; |
43 | void zwp_idle_inhibitor_v1_destroy(Resource *resource) override; |
44 | |
45 | private: |
46 | QPointer<QWaylandSurface> m_surface; |
47 | }; |
48 | |
49 | static QWaylandIdleInhibitManagerV1Private *get(QWaylandIdleInhibitManagerV1 *manager) { return manager ? manager->d_func() : nullptr; } |
50 | |
51 | protected: |
52 | void zwp_idle_inhibit_manager_v1_create_inhibitor(Resource *resource, uint32_t id, wl_resource *surfaceResource) override; |
53 | }; |
54 | |
55 | QT_END_NAMESPACE |
56 | |
57 | #endif // QWAYLANDIDLEINHIBITV1_P_H |
58 |