Changeset View
Changeset View
Standalone View
Standalone View
src/server/xdgdecoration_interface.h
- This file was added.
1 | /**************************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright 2018 David Edmundson <kde@davidedmundson.co.uk> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Lesser General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | later version accepted by the membership of KDE e.V. (or its | ||||
9 | successor approved by the membership of KDE e.V.), which shall | ||||
10 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | Lesser General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Lesser General Public | ||||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | ****************************************************************************/ | ||||
20 | #ifndef KWAYLAND_SERVER_XDG_DECORATION_UNSTABLE_V1_H | ||||
21 | #define KWAYLAND_SERVER_XDG_DECORATION_UNSTABLE_V1_H | ||||
22 | | ||||
23 | #include "global.h" | ||||
24 | #include "resource.h" | ||||
25 | | ||||
26 | #include <KWayland/Server/kwaylandserver_export.h> | ||||
27 | | ||||
28 | namespace KWayland | ||||
29 | { | ||||
30 | namespace Server | ||||
31 | { | ||||
32 | | ||||
33 | class Display; | ||||
34 | class XdgDecorationInterface; | ||||
35 | class XdgShellInterface; | ||||
36 | class XdgShellSurfaceInterface; | ||||
37 | | ||||
38 | /** | ||||
39 | * @brief The XdgDecorationManagerInterface class | ||||
40 | * @since 5.DECO_VERSION | ||||
41 | */ | ||||
42 | class KWAYLANDSERVER_EXPORT XdgDecorationManagerInterface : public Global | ||||
43 | { | ||||
44 | Q_OBJECT | ||||
45 | public: | ||||
46 | ~XdgDecorationManagerInterface() override; | ||||
47 | Q_SIGNALS: | ||||
48 | void xdgDecorationInterfaceCreated(XdgDecorationInterface *iface); | ||||
49 | private: | ||||
50 | explicit XdgDecorationManagerInterface(Display *display, XdgShellInterface *shellInterface, QObject *parent = nullptr); | ||||
51 | friend class Display; | ||||
52 | class Private; | ||||
53 | }; | ||||
54 | | ||||
55 | /** | ||||
56 | * @brief The XdgDecorationInterface class | ||||
57 | * @since 5.DECO_VERSION | ||||
58 | */ | ||||
59 | class KWAYLANDSERVER_EXPORT XdgDecorationInterface : public Resource | ||||
60 | { | ||||
61 | Q_OBJECT | ||||
62 | public: | ||||
63 | enum class Mode { | ||||
64 | Undefined, | ||||
65 | ClientSide, | ||||
66 | ServerSide | ||||
67 | }; | ||||
68 | | ||||
69 | Q_ENUM(Mode); | ||||
70 | | ||||
71 | ~XdgDecorationInterface() override; | ||||
72 | | ||||
73 | /** | ||||
74 | * Sets the mode the client should be using. | ||||
75 | * It should be followed by a call to XDGShellSurface::configure() | ||||
76 | * Once acked, it can relied upon to be applied in the next surface | ||||
77 | */ | ||||
78 | void configure(Mode requestedMode); | ||||
79 | | ||||
80 | /** | ||||
81 | * The last mode requested by the client | ||||
82 | */ | ||||
83 | Mode requestedMode() const; | ||||
84 | | ||||
85 | /** | ||||
86 | * The surface this decoration is attached to | ||||
87 | */ | ||||
88 | XdgShellSurfaceInterface *surface() const; | ||||
89 | | ||||
90 | Q_SIGNALS: | ||||
91 | /** | ||||
92 | * New mode requested by the client | ||||
93 | */ | ||||
94 | void modeRequested(KWayland::Server::XdgDecorationInterface::Mode requestedMode); | ||||
95 | | ||||
96 | private: | ||||
97 | explicit XdgDecorationInterface(XdgDecorationManagerInterface *parent, XdgShellSurfaceInterface *surface, wl_resource *parentResource); | ||||
98 | friend class XdgDecorationManagerInterface; | ||||
99 | | ||||
100 | class Private; | ||||
101 | Private *d_func() const; | ||||
102 | }; | ||||
103 | | ||||
104 | | ||||
105 | } | ||||
106 | } | ||||
107 | | ||||
108 | | ||||
109 | #endif |