v / thirdparty / sokol / xdg-decoration-unstable-v1-client-protocol.h
384 lines · 354 sloc · 14.07 KB · 5d6de17f708abcf79877f70e677d60a4e23bb727
Raw
1/* Generated by wayland-scanner 1.24.0 */
2
3#ifndef XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
4#define XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
5
6#include <stdint.h>
7#include <stddef.h>
8#include "wayland-client.h"
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/**
15 * @page page_xdg_decoration_unstable_v1 The xdg_decoration_unstable_v1 protocol
16 * @section page_ifaces_xdg_decoration_unstable_v1 Interfaces
17 * - @subpage page_iface_zxdg_decoration_manager_v1 - window decoration manager
18 * - @subpage page_iface_zxdg_toplevel_decoration_v1 - decoration object for a toplevel surface
19 * @section page_copyright_xdg_decoration_unstable_v1 Copyright
20 * <pre>
21 *
22 * Copyright © 2018 Simon Ser
23 *
24 * Permission is hereby granted, free of charge, to any person obtaining a
25 * copy of this software and associated documentation files (the "Software"),
26 * to deal in the Software without restriction, including without limitation
27 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28 * and/or sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following conditions:
30 *
31 * The above copyright notice and this permission notice (including the next
32 * paragraph) shall be included in all copies or substantial portions of the
33 * Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
38 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
41 * DEALINGS IN THE SOFTWARE.
42 * </pre>
43 */
44struct xdg_toplevel;
45struct zxdg_decoration_manager_v1;
46struct zxdg_toplevel_decoration_v1;
47
48#ifndef ZXDG_DECORATION_MANAGER_V1_INTERFACE
49#define ZXDG_DECORATION_MANAGER_V1_INTERFACE
50/**
51 * @page page_iface_zxdg_decoration_manager_v1 zxdg_decoration_manager_v1
52 * @section page_iface_zxdg_decoration_manager_v1_desc Description
53 *
54 * This interface allows a compositor to announce support for server-side
55 * decorations.
56 *
57 * A window decoration is a set of window controls as deemed appropriate by
58 * the party managing them, such as user interface components used to move,
59 * resize and change a window's state.
60 *
61 * A client can use this protocol to request being decorated by a supporting
62 * compositor.
63 *
64 * If compositor and client do not negotiate the use of a server-side
65 * decoration using this protocol, clients continue to self-decorate as they
66 * see fit.
67 *
68 * Warning! The protocol described in this file is experimental and
69 * backward incompatible changes may be made. Backward compatible changes
70 * may be added together with the corresponding interface version bump.
71 * Backward incompatible changes are done by bumping the version number in
72 * the protocol and interface names and resetting the interface version.
73 * Once the protocol is to be declared stable, the 'z' prefix and the
74 * version number in the protocol and interface names are removed and the
75 * interface version number is reset.
76 * @section page_iface_zxdg_decoration_manager_v1_api API
77 * See @ref iface_zxdg_decoration_manager_v1.
78 */
79/**
80 * @defgroup iface_zxdg_decoration_manager_v1 The zxdg_decoration_manager_v1 interface
81 *
82 * This interface allows a compositor to announce support for server-side
83 * decorations.
84 *
85 * A window decoration is a set of window controls as deemed appropriate by
86 * the party managing them, such as user interface components used to move,
87 * resize and change a window's state.
88 *
89 * A client can use this protocol to request being decorated by a supporting
90 * compositor.
91 *
92 * If compositor and client do not negotiate the use of a server-side
93 * decoration using this protocol, clients continue to self-decorate as they
94 * see fit.
95 *
96 * Warning! The protocol described in this file is experimental and
97 * backward incompatible changes may be made. Backward compatible changes
98 * may be added together with the corresponding interface version bump.
99 * Backward incompatible changes are done by bumping the version number in
100 * the protocol and interface names and resetting the interface version.
101 * Once the protocol is to be declared stable, the 'z' prefix and the
102 * version number in the protocol and interface names are removed and the
103 * interface version number is reset.
104 */
105extern const struct wl_interface zxdg_decoration_manager_v1_interface;
106#endif
107#ifndef ZXDG_TOPLEVEL_DECORATION_V1_INTERFACE
108#define ZXDG_TOPLEVEL_DECORATION_V1_INTERFACE
109/**
110 * @page page_iface_zxdg_toplevel_decoration_v1 zxdg_toplevel_decoration_v1
111 * @section page_iface_zxdg_toplevel_decoration_v1_desc Description
112 *
113 * The decoration object allows the compositor to toggle server-side window
114 * decorations for a toplevel surface. The client can request to switch to
115 * another mode.
116 *
117 * The xdg_toplevel_decoration object must be destroyed before its
118 * xdg_toplevel.
119 * @section page_iface_zxdg_toplevel_decoration_v1_api API
120 * See @ref iface_zxdg_toplevel_decoration_v1.
121 */
122/**
123 * @defgroup iface_zxdg_toplevel_decoration_v1 The zxdg_toplevel_decoration_v1 interface
124 *
125 * The decoration object allows the compositor to toggle server-side window
126 * decorations for a toplevel surface. The client can request to switch to
127 * another mode.
128 *
129 * The xdg_toplevel_decoration object must be destroyed before its
130 * xdg_toplevel.
131 */
132extern const struct wl_interface zxdg_toplevel_decoration_v1_interface;
133#endif
134
135#define ZXDG_DECORATION_MANAGER_V1_DESTROY 0
136#define ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION 1
137
138
139/**
140 * @ingroup iface_zxdg_decoration_manager_v1
141 */
142#define ZXDG_DECORATION_MANAGER_V1_DESTROY_SINCE_VERSION 1
143/**
144 * @ingroup iface_zxdg_decoration_manager_v1
145 */
146#define ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION_SINCE_VERSION 1
147
148/** @ingroup iface_zxdg_decoration_manager_v1 */
149static inline void
150zxdg_decoration_manager_v1_set_user_data(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1, void *user_data)
151{
152 wl_proxy_set_user_data((struct wl_proxy *) zxdg_decoration_manager_v1, user_data);
153}
154
155/** @ingroup iface_zxdg_decoration_manager_v1 */
156static inline void *
157zxdg_decoration_manager_v1_get_user_data(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
158{
159 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_decoration_manager_v1);
160}
161
162static inline uint32_t
163zxdg_decoration_manager_v1_get_version(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
164{
165 return wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1);
166}
167
168/**
169 * @ingroup iface_zxdg_decoration_manager_v1
170 *
171 * Destroy the decoration manager. This doesn't destroy objects created
172 * with the manager.
173 */
174static inline void
175zxdg_decoration_manager_v1_destroy(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)
176{
177 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_decoration_manager_v1,
178 ZXDG_DECORATION_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1), WL_MARSHAL_FLAG_DESTROY);
179}
180
181/**
182 * @ingroup iface_zxdg_decoration_manager_v1
183 *
184 * Create a new decoration object associated with the given toplevel.
185 *
186 * Creating an xdg_toplevel_decoration from an xdg_toplevel which has a
187 * buffer attached or committed is a client error, and any attempts by a
188 * client to attach or manipulate a buffer prior to the first
189 * xdg_toplevel_decoration.configure event must also be treated as
190 * errors.
191 */
192static inline struct zxdg_toplevel_decoration_v1 *
193zxdg_decoration_manager_v1_get_toplevel_decoration(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1, struct xdg_toplevel *toplevel)
194{
195 struct wl_proxy *id;
196
197 id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_decoration_manager_v1,
198 ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION, &zxdg_toplevel_decoration_v1_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1), 0, NULL, toplevel);
199
200 return (struct zxdg_toplevel_decoration_v1 *) id;
201}
202
203#ifndef ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM
204#define ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM
205enum zxdg_toplevel_decoration_v1_error {
206 /**
207 * xdg_toplevel has a buffer attached before configure
208 */
209 ZXDG_TOPLEVEL_DECORATION_V1_ERROR_UNCONFIGURED_BUFFER = 0,
210 /**
211 * xdg_toplevel already has a decoration object
212 */
213 ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ALREADY_CONSTRUCTED = 1,
214 /**
215 * xdg_toplevel destroyed before the decoration object
216 */
217 ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ORPHANED = 2,
218 /**
219 * invalid mode
220 */
221 ZXDG_TOPLEVEL_DECORATION_V1_ERROR_INVALID_MODE = 3,
222};
223#endif /* ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM */
224
225#ifndef ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM
226#define ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM
227/**
228 * @ingroup iface_zxdg_toplevel_decoration_v1
229 * window decoration modes
230 *
231 * These values describe window decoration modes.
232 */
233enum zxdg_toplevel_decoration_v1_mode {
234 /**
235 * no server-side window decoration
236 */
237 ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE = 1,
238 /**
239 * server-side window decoration
240 */
241 ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE = 2,
242};
243#endif /* ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM */
244
245/**
246 * @ingroup iface_zxdg_toplevel_decoration_v1
247 * @struct zxdg_toplevel_decoration_v1_listener
248 */
249struct zxdg_toplevel_decoration_v1_listener {
250 /**
251 * notify a decoration mode change
252 *
253 * The configure event configures the effective decoration mode.
254 * The configured state should not be applied immediately. Clients
255 * must send an ack_configure in response to this event. See
256 * xdg_surface.configure and xdg_surface.ack_configure for details.
257 *
258 * A configure event can be sent at any time. The specified mode
259 * must be obeyed by the client.
260 * @param mode the decoration mode
261 */
262 void (*configure)(void *data,
263 struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
264 uint32_t mode);
265};
266
267/**
268 * @ingroup iface_zxdg_toplevel_decoration_v1
269 */
270static inline int
271zxdg_toplevel_decoration_v1_add_listener(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
272 const struct zxdg_toplevel_decoration_v1_listener *listener, void *data)
273{
274 return wl_proxy_add_listener((struct wl_proxy *) zxdg_toplevel_decoration_v1,
275 (void (**)(void)) listener, data);
276}
277
278#define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY 0
279#define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE 1
280#define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE 2
281
282/**
283 * @ingroup iface_zxdg_toplevel_decoration_v1
284 */
285#define ZXDG_TOPLEVEL_DECORATION_V1_CONFIGURE_SINCE_VERSION 1
286
287/**
288 * @ingroup iface_zxdg_toplevel_decoration_v1
289 */
290#define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY_SINCE_VERSION 1
291/**
292 * @ingroup iface_zxdg_toplevel_decoration_v1
293 */
294#define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE_SINCE_VERSION 1
295/**
296 * @ingroup iface_zxdg_toplevel_decoration_v1
297 */
298#define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE_SINCE_VERSION 1
299
300/** @ingroup iface_zxdg_toplevel_decoration_v1 */
301static inline void
302zxdg_toplevel_decoration_v1_set_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, void *user_data)
303{
304 wl_proxy_set_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1, user_data);
305}
306
307/** @ingroup iface_zxdg_toplevel_decoration_v1 */
308static inline void *
309zxdg_toplevel_decoration_v1_get_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
310{
311 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1);
312}
313
314static inline uint32_t
315zxdg_toplevel_decoration_v1_get_version(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
316{
317 return wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1);
318}
319
320/**
321 * @ingroup iface_zxdg_toplevel_decoration_v1
322 *
323 * Switch back to a mode without any server-side decorations at the next
324 * commit.
325 */
326static inline void
327zxdg_toplevel_decoration_v1_destroy(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
328{
329 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
330 ZXDG_TOPLEVEL_DECORATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), WL_MARSHAL_FLAG_DESTROY);
331}
332
333/**
334 * @ingroup iface_zxdg_toplevel_decoration_v1
335 *
336 * Set the toplevel surface decoration mode. This informs the compositor
337 * that the client prefers the provided decoration mode.
338 *
339 * After requesting a decoration mode, the compositor will respond by
340 * emitting an xdg_surface.configure event. The client should then update
341 * its content, drawing it without decorations if the received mode is
342 * server-side decorations. The client must also acknowledge the configure
343 * when committing the new content (see xdg_surface.ack_configure).
344 *
345 * The compositor can decide not to use the client's mode and enforce a
346 * different mode instead.
347 *
348 * Clients whose decoration mode depend on the xdg_toplevel state may send
349 * a set_mode request in response to an xdg_surface.configure event and wait
350 * for the next xdg_surface.configure event to prevent unwanted state.
351 * Such clients are responsible for preventing configure loops and must
352 * make sure not to send multiple successive set_mode requests with the
353 * same decoration mode.
354 *
355 * If an invalid mode is supplied by the client, the invalid_mode protocol
356 * error is raised by the compositor.
357 */
358static inline void
359zxdg_toplevel_decoration_v1_set_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, uint32_t mode)
360{
361 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
362 ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0, mode);
363}
364
365/**
366 * @ingroup iface_zxdg_toplevel_decoration_v1
367 *
368 * Unset the toplevel surface decoration mode. This informs the compositor
369 * that the client doesn't prefer a particular decoration mode.
370 *
371 * This request has the same semantics as set_mode.
372 */
373static inline void
374zxdg_toplevel_decoration_v1_unset_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
375{
376 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
377 ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0);
378}
379
380#ifdef __cplusplus
381}
382#endif
383
384#endif
385