Debian Codegraph @

src/compositor/extensions/qwaylandxdgdecorationv1_p.h

raw symbols SCIP
1 /****************************************************************************
2 **
3 ** Copyright (C) 2018 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the QtWaylandCompositor module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:GPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 3 or (at your option) any later version
20 ** approved by the KDE Free Qt Foundation. The licenses are as published by
21 ** the Free Software Foundation and appearing in the file LICENSE.GPL3
22 ** included in the packaging of this file. Please review the following
23 ** information to ensure the GNU General Public License requirements will
24 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
25 **
26 ** $QT_END_LICENSE$
27 **
28 ****************************************************************************/
29
30 #ifndef QWAYLANDXDGDECORATIONV1_P_H
31 #define QWAYLANDXDGDECORATIONV1_P_H
32
33 #include "qwaylandxdgdecorationv1.h"
34
35 #include <QtWaylandCompositor/private/qwaylandcompositorextension_p.h>
36 #include <QtWaylandCompositor/private/qwayland-server-xdg-decoration-unstable-v1.h>
37
38 #include <QtWaylandCompositor/QWaylandXdgToplevel>
39
40 //
41 // W A R N I N G
42 // -------------
43 //
44 // This file is not part of the Qt API. It exists purely as an
45 // implementation detail. This header file may change from version to
46 // version without notice, or even be removed.
47 //
48 // We mean it.
49 //
50
51 QT_BEGIN_NAMESPACE
52
53 class QWaylandXdgToplevel;
54
55 class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgDecorationManagerV1Private
56 : public QWaylandCompositorExtensionPrivate
57 , public QtWaylandServer::zxdg_decoration_manager_v1
58 {
59 Q_DECLARE_PUBLIC(QWaylandXdgDecorationManagerV1)
60 public:
61 using DecorationMode = QWaylandXdgToplevel::DecorationMode;
62 explicit QWaylandXdgDecorationManagerV1Private() {}
63
64 protected:
65 void zxdg_decoration_manager_v1_get_toplevel_decoration(Resource *resource, uint id, ::wl_resource *toplevelResource) override;
66
67 private:
68 DecorationMode m_preferredMode = DecorationMode::ClientSideDecoration;
69 };
70
71 class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgToplevelDecorationV1
72 : public QtWaylandServer::zxdg_toplevel_decoration_v1
73 {
74 public:
75 using DecorationMode = QWaylandXdgToplevel::DecorationMode;
76 explicit QWaylandXdgToplevelDecorationV1(QWaylandXdgToplevel *toplevel,
77 QWaylandXdgDecorationManagerV1 *manager,
78 wl_client *client, int id);
79 ~QWaylandXdgToplevelDecorationV1() override;
80
81 DecorationMode configuredMode() const { return DecorationMode(m_configuredMode); }
82 void sendConfigure(DecorationMode mode);
83
84 protected:
85 void zxdg_toplevel_decoration_v1_destroy_resource(Resource *resource) override;
86 void zxdg_toplevel_decoration_v1_destroy(Resource *resource) override;
87 void zxdg_toplevel_decoration_v1_set_mode(Resource *resource, uint32_t mode) override;
88 void zxdg_toplevel_decoration_v1_unset_mode(Resource *resource) override;
89
90 private:
91 void handleClientPreferredModeChanged();
92
93 QWaylandXdgToplevel *m_toplevel = nullptr;
94 QWaylandXdgDecorationManagerV1 *m_manager = nullptr;
95 uint m_configuredMode = 0;
96 uint m_clientPreferredMode = 0;
97 };
98
99 QT_END_NAMESPACE
100
101 #endif // QWAYLANDXDGDECORATIONV1_P_H