fordon_greeman / moosicpalyer

Branch: 277f22f
Switch branches/tags
main
theidioticdev fix raylib running under xwayland rather than uh being wayland native, styled the program 277f22f 12d ago
378 lines · 13.9 KB Raw Blame History
1 /* Generated by wayland-scanner 1.26.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
11 extern "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 */
44 struct xdg_toplevel;
45 struct zxdg_decoration_manager_v1;
46 struct 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 */
105 extern 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 */
132 extern 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 */
149 static inline void
150 zxdg_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 */
156 static inline void *
157 zxdg_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
162 static inline uint32_t
163 zxdg_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 */
174 static inline void
175 zxdg_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 */
192 static inline struct zxdg_toplevel_decoration_v1 *
193 zxdg_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
205 enum 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 #endif /* ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM */
220
221 #ifndef ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM
222 #define ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM
223 /**
224 * @ingroup iface_zxdg_toplevel_decoration_v1
225 * window decoration modes
226 *
227 * These values describe window decoration modes.
228 */
229 enum zxdg_toplevel_decoration_v1_mode {
230 /**
231 * no server-side window decoration
232 */
233 ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE = 1,
234 /**
235 * server-side window decoration
236 */
237 ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE = 2,
238 };
239 #endif /* ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM */
240
241 /**
242 * @ingroup iface_zxdg_toplevel_decoration_v1
243 * @struct zxdg_toplevel_decoration_v1_listener
244 */
245 struct zxdg_toplevel_decoration_v1_listener {
246 /**
247 * suggest a surface change
248 *
249 * The configure event asks the client to change its decoration
250 * mode. The configured state should not be applied immediately.
251 * Clients must send an ack_configure in response to this event.
252 * See xdg_surface.configure and xdg_surface.ack_configure for
253 * details.
254 *
255 * A configure event can be sent at any time. The specified mode
256 * must be obeyed by the client.
257 * @param mode the decoration mode
258 */
259 void (*configure)(void *data,
260 struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
261 uint32_t mode);
262 };
263
264 /**
265 * @ingroup iface_zxdg_toplevel_decoration_v1
266 */
267 static inline int
268 zxdg_toplevel_decoration_v1_add_listener(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
269 const struct zxdg_toplevel_decoration_v1_listener *listener, void *data)
270 {
271 return wl_proxy_add_listener((struct wl_proxy *) zxdg_toplevel_decoration_v1,
272 (void (**)(void)) listener, data);
273 }
274
275 #define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY 0
276 #define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE 1
277 #define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE 2
278
279 /**
280 * @ingroup iface_zxdg_toplevel_decoration_v1
281 */
282 #define ZXDG_TOPLEVEL_DECORATION_V1_CONFIGURE_SINCE_VERSION 1
283
284 /**
285 * @ingroup iface_zxdg_toplevel_decoration_v1
286 */
287 #define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY_SINCE_VERSION 1
288 /**
289 * @ingroup iface_zxdg_toplevel_decoration_v1
290 */
291 #define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE_SINCE_VERSION 1
292 /**
293 * @ingroup iface_zxdg_toplevel_decoration_v1
294 */
295 #define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE_SINCE_VERSION 1
296
297 /** @ingroup iface_zxdg_toplevel_decoration_v1 */
298 static inline void
299 zxdg_toplevel_decoration_v1_set_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, void *user_data)
300 {
301 wl_proxy_set_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1, user_data);
302 }
303
304 /** @ingroup iface_zxdg_toplevel_decoration_v1 */
305 static inline void *
306 zxdg_toplevel_decoration_v1_get_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
307 {
308 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1);
309 }
310
311 static inline uint32_t
312 zxdg_toplevel_decoration_v1_get_version(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
313 {
314 return wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1);
315 }
316
317 /**
318 * @ingroup iface_zxdg_toplevel_decoration_v1
319 *
320 * Switch back to a mode without any server-side decorations at the next
321 * commit.
322 */
323 static inline void
324 zxdg_toplevel_decoration_v1_destroy(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
325 {
326 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
327 ZXDG_TOPLEVEL_DECORATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), WL_MARSHAL_FLAG_DESTROY);
328 }
329
330 /**
331 * @ingroup iface_zxdg_toplevel_decoration_v1
332 *
333 * Set the toplevel surface decoration mode. This informs the compositor
334 * that the client prefers the provided decoration mode.
335 *
336 * After requesting a decoration mode, the compositor will respond by
337 * emitting an xdg_surface.configure event. The client should then update
338 * its content, drawing it without decorations if the received mode is
339 * server-side decorations. The client must also acknowledge the configure
340 * when committing the new content (see xdg_surface.ack_configure).
341 *
342 * The compositor can decide not to use the client's mode and enforce a
343 * different mode instead.
344 *
345 * Clients whose decoration mode depend on the xdg_toplevel state may send
346 * a set_mode request in response to an xdg_surface.configure event and wait
347 * for the next xdg_surface.configure event to prevent unwanted state.
348 * Such clients are responsible for preventing configure loops and must
349 * make sure not to send multiple successive set_mode requests with the
350 * same decoration mode.
351 */
352 static inline void
353 zxdg_toplevel_decoration_v1_set_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, uint32_t mode)
354 {
355 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
356 ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0, mode);
357 }
358
359 /**
360 * @ingroup iface_zxdg_toplevel_decoration_v1
361 *
362 * Unset the toplevel surface decoration mode. This informs the compositor
363 * that the client doesn't prefer a particular decoration mode.
364 *
365 * This request has the same semantics as set_mode.
366 */
367 static inline void
368 zxdg_toplevel_decoration_v1_unset_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)
369 {
370 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,
371 ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0);
372 }
373
374 #ifdef __cplusplus
375 }
376 #endif
377
378 #endif