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 | // |
13 | // W A R N I N G |
14 | // ------------- |
15 | // |
16 | // This file is not part of the Qt API. It exists purely as an |
17 | // implementation detail. This header file may change from version to |
18 | // version without notice, or even be removed. |
19 | // |
20 | // We mean it. |
21 | // |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandIdleInhibitManagerV1Private |
26 | : public QWaylandCompositorExtensionPrivate |
27 | , public QtWaylandServer::zwp_idle_inhibit_manager_v1 |
28 | { |
29 | Q_DECLARE_PUBLIC(QWaylandIdleInhibitManagerV1) |
30 | public: |
31 | explicit QWaylandIdleInhibitManagerV1Private() = default; |
32 | |
33 | class Q_WAYLANDCOMPOSITOR_EXPORT Inhibitor |
34 | : public QtWaylandServer::zwp_idle_inhibitor_v1 |
35 | { |
36 | public: |
37 | explicit Inhibitor(QWaylandSurface *surface, wl_client *client, quint32 id, quint32 version); |
38 | |
39 | protected: |
40 | void zwp_idle_inhibitor_v1_destroy_resource(Resource *resource) override; |
41 | void zwp_idle_inhibitor_v1_destroy(Resource *resource) override; |
42 | |
43 | private: |
44 | QPointer<QWaylandSurface> m_surface; |
45 | }; |
46 | |
47 | static QWaylandIdleInhibitManagerV1Private *get(QWaylandIdleInhibitManagerV1 *manager) { return manager ? manager->d_func() : nullptr; } |
48 | |
49 | protected: |
50 | void zwp_idle_inhibit_manager_v1_create_inhibitor(Resource *resource, uint32_t id, wl_resource *surfaceResource) override; |
51 | }; |
52 | |
53 | QT_END_NAMESPACE |
54 | |
55 | #endif // QWAYLANDIDLEINHIBITV1_P_H |
56 | |