1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef SURFACE_AUGMENTER_CLIENT_PROTOCOL_H
4 #define SURFACE_AUGMENTER_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_surface_augmenter The surface_augmenter protocol
16  * @section page_ifaces_surface_augmenter Interfaces
17  * - @subpage page_iface_surface_augmenter - surface composition delegation
18  * - @subpage page_iface_augmented_surface - delegate composition of a wl_surface
19  * - @subpage page_iface_augmented_sub_surface - delegate composition of a wl_subsurface
20  * @section page_copyright_surface_augmenter Copyright
21  * <pre>
22  *
23  * Copyright 2021 The Chromium Authors
24  *
25  * Permission is hereby granted, free of charge, to any person obtaining a
26  * copy of this software and associated documentation files (the "Software"),
27  * to deal in the Software without restriction, including without limitation
28  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
29  * and/or sell copies of the Software, and to permit persons to whom the
30  * Software is furnished to do so, subject to the following conditions:
31  *
32  * The above copyright notice and this permission notice (including the next
33  * paragraph) shall be included in all copies or substantial portions of the
34  * Software.
35  *
36  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
39  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
42  * DEALINGS IN THE SOFTWARE.
43  * </pre>
44  */
45 struct augmented_sub_surface;
46 struct augmented_surface;
47 struct surface_augmenter;
48 struct wl_buffer;
49 struct wl_subsurface;
50 struct wl_surface;
51 
52 #ifndef SURFACE_AUGMENTER_INTERFACE
53 #define SURFACE_AUGMENTER_INTERFACE
54 /**
55  * @page page_iface_surface_augmenter surface_augmenter
56  * @section page_iface_surface_augmenter_desc Description
57  *
58  * The global interface exposing surface delegated composition
59  * capabilities is used to instantiate an interface extension for a
60  * wl_surface object. This extended interface will then allow
61  * delegated compostion of the surface contents, effectively
62  * disconnecting the direct relationship between the buffer and the
63  * surface content (adding support for solid quads and rounded corner
64  * for instance).
65  * @section page_iface_surface_augmenter_api API
66  * See @ref iface_surface_augmenter.
67  */
68 /**
69  * @defgroup iface_surface_augmenter The surface_augmenter interface
70  *
71  * The global interface exposing surface delegated composition
72  * capabilities is used to instantiate an interface extension for a
73  * wl_surface object. This extended interface will then allow
74  * delegated compostion of the surface contents, effectively
75  * disconnecting the direct relationship between the buffer and the
76  * surface content (adding support for solid quads and rounded corner
77  * for instance).
78  */
79 extern const struct wl_interface surface_augmenter_interface;
80 #endif
81 #ifndef AUGMENTED_SURFACE_INTERFACE
82 #define AUGMENTED_SURFACE_INTERFACE
83 /**
84  * @page page_iface_augmented_surface augmented_surface
85  * @section page_iface_augmented_surface_desc Description
86  *
87  * An additional interface to a wl_surface object, which allows the
88  * client to specify the delegated composition of the surface
89  * contents.
90  *
91  *
92  * This makes the surface an object only used to composite its parent
93  * surface. This means the surface will be clipped to the parent bounds, will
94  * not receive input events or display enter/leave events, etc.
95  *
96  * Use wl_subsurface role objects to express which parent surface this will
97  * perform delegate composition for.
98  *
99  * The commits to this surface is assumed to behave synchronized with its
100  * parent commits, as a synchronized wl_subsurface would.
101  *
102  * The compositor does not perform fine-grained damage extension calculation
103  * that is introduced by an augmented_surface moving, resizing, changing
104  * stacking, or disappearing. A client performing such operations should
105  * account for it and damage the parent non-augmented wl_surface accordingly.
106  *
107  * Various changes like adding or removing an augmented sub-surface, changing
108  * its position or stacking order, will not introduce extra damage on the
109  * compositor side. The parent wl_surface should account for the extra damage
110  * introduced.
111  *
112  * This surface, using a wl_subsurface role of its parent, cannot be stacked
113  * relative to non-augmented sub-surfaces of the parent, but can be stacked
114  * relative to other augmented children. Nor can this surface have
115  * non-augmented sub-surface children.
116  *
117  * A mixed tree structure of using augmented_surfaces to delegate composite
118  * wl_surfaces would look like this:
119  *
120  * wl_surface@1:{ augmented_surface@1,2,3 }
121  * /           \_____
122  * /                   \
123  * wl_surface@2:               wl_surface@3:
124  * { augmented_surface@4,5 }   { augmented_surface@6 }
125  *
126  * Every wl_surface has a list of augmented_surfaces. Assuming the
127  * wl_surface stacking order, from bottom to top, is:
128  * wl_surface@1, wl_surface@2, wl_surface@3
129  *
130  * Then the final composition order, from bottom to top, is:
131  * wl_surface@1, augmented_surface@1,2,3, wl_surface@2, augmented_surface@4,5,
132  * wl_surface@3, augmented_surface@6
133  * @section page_iface_augmented_surface_api API
134  * See @ref iface_augmented_surface.
135  */
136 /**
137  * @defgroup iface_augmented_surface The augmented_surface interface
138  *
139  * An additional interface to a wl_surface object, which allows the
140  * client to specify the delegated composition of the surface
141  * contents.
142  *
143  *
144  * This makes the surface an object only used to composite its parent
145  * surface. This means the surface will be clipped to the parent bounds, will
146  * not receive input events or display enter/leave events, etc.
147  *
148  * Use wl_subsurface role objects to express which parent surface this will
149  * perform delegate composition for.
150  *
151  * The commits to this surface is assumed to behave synchronized with its
152  * parent commits, as a synchronized wl_subsurface would.
153  *
154  * The compositor does not perform fine-grained damage extension calculation
155  * that is introduced by an augmented_surface moving, resizing, changing
156  * stacking, or disappearing. A client performing such operations should
157  * account for it and damage the parent non-augmented wl_surface accordingly.
158  *
159  * Various changes like adding or removing an augmented sub-surface, changing
160  * its position or stacking order, will not introduce extra damage on the
161  * compositor side. The parent wl_surface should account for the extra damage
162  * introduced.
163  *
164  * This surface, using a wl_subsurface role of its parent, cannot be stacked
165  * relative to non-augmented sub-surfaces of the parent, but can be stacked
166  * relative to other augmented children. Nor can this surface have
167  * non-augmented sub-surface children.
168  *
169  * A mixed tree structure of using augmented_surfaces to delegate composite
170  * wl_surfaces would look like this:
171  *
172  * wl_surface@1:{ augmented_surface@1,2,3 }
173  * /           \_____
174  * /                   \
175  * wl_surface@2:               wl_surface@3:
176  * { augmented_surface@4,5 }   { augmented_surface@6 }
177  *
178  * Every wl_surface has a list of augmented_surfaces. Assuming the
179  * wl_surface stacking order, from bottom to top, is:
180  * wl_surface@1, wl_surface@2, wl_surface@3
181  *
182  * Then the final composition order, from bottom to top, is:
183  * wl_surface@1, augmented_surface@1,2,3, wl_surface@2, augmented_surface@4,5,
184  * wl_surface@3, augmented_surface@6
185  */
186 extern const struct wl_interface augmented_surface_interface;
187 #endif
188 #ifndef AUGMENTED_SUB_SURFACE_INTERFACE
189 #define AUGMENTED_SUB_SURFACE_INTERFACE
190 /**
191  * @page page_iface_augmented_sub_surface augmented_sub_surface
192  * @section page_iface_augmented_sub_surface_desc Description
193  *
194  * An additional interface to a wl_subsurface object, which allows the
195  * client to specify the delegated composition of the surface
196  * contents.
197  * @section page_iface_augmented_sub_surface_api API
198  * See @ref iface_augmented_sub_surface.
199  */
200 /**
201  * @defgroup iface_augmented_sub_surface The augmented_sub_surface interface
202  *
203  * An additional interface to a wl_subsurface object, which allows the
204  * client to specify the delegated composition of the surface
205  * contents.
206  */
207 extern const struct wl_interface augmented_sub_surface_interface;
208 #endif
209 
210 #ifndef SURFACE_AUGMENTER_ERROR_ENUM
211 #define SURFACE_AUGMENTER_ERROR_ENUM
212 enum surface_augmenter_error {
213 	/**
214 	 * the surface already has a augmenter object              associated
215 	 */
216 	SURFACE_AUGMENTER_ERROR_AUGMENTED_SURFACE_EXISTS = 0,
217 };
218 #endif /* SURFACE_AUGMENTER_ERROR_ENUM */
219 
220 #define SURFACE_AUGMENTER_DESTROY 0
221 #define SURFACE_AUGMENTER_CREATE_SOLID_COLOR_BUFFER 1
222 #define SURFACE_AUGMENTER_GET_AUGMENTED_SURFACE 2
223 #define SURFACE_AUGMENTER_GET_AUGMENTED_SUBSURFACE 3
224 
225 
226 /**
227  * @ingroup iface_surface_augmenter
228  */
229 #define SURFACE_AUGMENTER_DESTROY_SINCE_VERSION 1
230 /**
231  * @ingroup iface_surface_augmenter
232  */
233 #define SURFACE_AUGMENTER_CREATE_SOLID_COLOR_BUFFER_SINCE_VERSION 1
234 /**
235  * @ingroup iface_surface_augmenter
236  */
237 #define SURFACE_AUGMENTER_GET_AUGMENTED_SURFACE_SINCE_VERSION 1
238 /**
239  * @ingroup iface_surface_augmenter
240  */
241 #define SURFACE_AUGMENTER_GET_AUGMENTED_SUBSURFACE_SINCE_VERSION 2
242 
243 /** @ingroup iface_surface_augmenter */
244 static inline void
surface_augmenter_set_user_data(struct surface_augmenter * surface_augmenter,void * user_data)245 surface_augmenter_set_user_data(struct surface_augmenter *surface_augmenter, void *user_data)
246 {
247 	wl_proxy_set_user_data((struct wl_proxy *) surface_augmenter, user_data);
248 }
249 
250 /** @ingroup iface_surface_augmenter */
251 static inline void *
surface_augmenter_get_user_data(struct surface_augmenter * surface_augmenter)252 surface_augmenter_get_user_data(struct surface_augmenter *surface_augmenter)
253 {
254 	return wl_proxy_get_user_data((struct wl_proxy *) surface_augmenter);
255 }
256 
257 static inline uint32_t
surface_augmenter_get_version(struct surface_augmenter * surface_augmenter)258 surface_augmenter_get_version(struct surface_augmenter *surface_augmenter)
259 {
260 	return wl_proxy_get_version((struct wl_proxy *) surface_augmenter);
261 }
262 
263 /**
264  * @ingroup iface_surface_augmenter
265  *
266  * Informs the server that the client will not be using this
267  * protocol object anymore. This does not affect any other objects,
268  * augmenter objects included.
269  */
270 static inline void
surface_augmenter_destroy(struct surface_augmenter * surface_augmenter)271 surface_augmenter_destroy(struct surface_augmenter *surface_augmenter)
272 {
273 	wl_proxy_marshal_flags((struct wl_proxy *) surface_augmenter,
274 			 SURFACE_AUGMENTER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) surface_augmenter), WL_MARSHAL_FLAG_DESTROY);
275 }
276 
277 /**
278  * @ingroup iface_surface_augmenter
279  *
280  * Instantiate a buffer of the given size for the purpose of a solid color
281  * quad of a given color.
282  *
283  *
284  * This buffer does not require resources in the compositor, so it is immediately
285  * reusable and shareable. So it is not responsible for sending wl_buffer.release
286  * or zwp_linux_buffer_release_v1.*_release events.
287  */
288 static inline struct wl_buffer *
surface_augmenter_create_solid_color_buffer(struct surface_augmenter * surface_augmenter,struct wl_array * color,int32_t width,int32_t height)289 surface_augmenter_create_solid_color_buffer(struct surface_augmenter *surface_augmenter, struct wl_array *color, int32_t width, int32_t height)
290 {
291 	struct wl_proxy *id;
292 
293 	id = wl_proxy_marshal_flags((struct wl_proxy *) surface_augmenter,
294 			 SURFACE_AUGMENTER_CREATE_SOLID_COLOR_BUFFER, &wl_buffer_interface, wl_proxy_get_version((struct wl_proxy *) surface_augmenter), 0, NULL, color, width, height);
295 
296 	return (struct wl_buffer *) id;
297 }
298 
299 /**
300  * @ingroup iface_surface_augmenter
301  *
302  * Instantiate an interface extension for the given wl_surface to
303  * extend composition of its content. If the given wl_surface already has
304  * a augmentation object associated, the delegate_exists protocol error is
305  * raised.
306  *
307  *
308  * If needs to be called, this must be called before a surface role object is
309  * created.
310  */
311 static inline struct augmented_surface *
surface_augmenter_get_augmented_surface(struct surface_augmenter * surface_augmenter,struct wl_surface * surface)312 surface_augmenter_get_augmented_surface(struct surface_augmenter *surface_augmenter, struct wl_surface *surface)
313 {
314 	struct wl_proxy *id;
315 
316 	id = wl_proxy_marshal_flags((struct wl_proxy *) surface_augmenter,
317 			 SURFACE_AUGMENTER_GET_AUGMENTED_SURFACE, &augmented_surface_interface, wl_proxy_get_version((struct wl_proxy *) surface_augmenter), 0, NULL, surface);
318 
319 	return (struct augmented_surface *) id;
320 }
321 
322 /**
323  * @ingroup iface_surface_augmenter
324  *
325  * Instantiate an interface extension for the given wl_subsurface to
326  * extend composition of its content. If the given wl_subsurface already has
327  * a augmentation object associated, the delegate_exists protocol error is
328  * raised.
329  */
330 static inline struct augmented_sub_surface *
surface_augmenter_get_augmented_subsurface(struct surface_augmenter * surface_augmenter,struct wl_subsurface * subsurface)331 surface_augmenter_get_augmented_subsurface(struct surface_augmenter *surface_augmenter, struct wl_subsurface *subsurface)
332 {
333 	struct wl_proxy *id;
334 
335 	id = wl_proxy_marshal_flags((struct wl_proxy *) surface_augmenter,
336 			 SURFACE_AUGMENTER_GET_AUGMENTED_SUBSURFACE, &augmented_sub_surface_interface, wl_proxy_get_version((struct wl_proxy *) surface_augmenter), 0, NULL, subsurface);
337 
338 	return (struct augmented_sub_surface *) id;
339 }
340 
341 #ifndef AUGMENTED_SURFACE_ERROR_ENUM
342 #define AUGMENTED_SURFACE_ERROR_ENUM
343 enum augmented_surface_error {
344 	/**
345 	 * negative values in radius or size
346 	 */
347 	AUGMENTED_SURFACE_ERROR_BAD_VALUE = 0,
348 	/**
349 	 * the wl_surface was destroyed
350 	 */
351 	AUGMENTED_SURFACE_ERROR_NO_SURFACE = 1,
352 	/**
353 	 * incompatible surface
354 	 */
355 	AUGMENTED_SURFACE_ERROR_BAD_SURFACE = 2,
356 };
357 #endif /* AUGMENTED_SURFACE_ERROR_ENUM */
358 
359 #define AUGMENTED_SURFACE_DESTROY 0
360 #define AUGMENTED_SURFACE_SET_ROUNDED_CORNERS 1
361 #define AUGMENTED_SURFACE_SET_DESTINATION_SIZE 2
362 #define AUGMENTED_SURFACE_SET_ROUNDED_CLIP_BOUNDS 3
363 #define AUGMENTED_SURFACE_SET_BACKGROUND_COLOR 4
364 #define AUGMENTED_SURFACE_SET_TRUSTED_DAMAGE 5
365 #define AUGMENTED_SURFACE_SET_ROUNDED_CORNERS_CLIP_BOUNDS 6
366 #define AUGMENTED_SURFACE_SET_CLIP_RECT 7
367 #define AUGMENTED_SURFACE_SET_FRAME_TRACE_ID 8
368 
369 
370 /**
371  * @ingroup iface_augmented_surface
372  */
373 #define AUGMENTED_SURFACE_DESTROY_SINCE_VERSION 1
374 /**
375  * @ingroup iface_augmented_surface
376  */
377 #define AUGMENTED_SURFACE_SET_ROUNDED_CORNERS_SINCE_VERSION 1
378 /**
379  * @ingroup iface_augmented_surface
380  */
381 #define AUGMENTED_SURFACE_SET_DESTINATION_SIZE_SINCE_VERSION 2
382 /**
383  * @ingroup iface_augmented_surface
384  */
385 #define AUGMENTED_SURFACE_SET_ROUNDED_CLIP_BOUNDS_SINCE_VERSION 2
386 /**
387  * @ingroup iface_augmented_surface
388  */
389 #define AUGMENTED_SURFACE_SET_BACKGROUND_COLOR_SINCE_VERSION 3
390 /**
391  * @ingroup iface_augmented_surface
392  */
393 #define AUGMENTED_SURFACE_SET_TRUSTED_DAMAGE_SINCE_VERSION 6
394 /**
395  * @ingroup iface_augmented_surface
396  */
397 #define AUGMENTED_SURFACE_SET_ROUNDED_CORNERS_CLIP_BOUNDS_SINCE_VERSION 7
398 /**
399  * @ingroup iface_augmented_surface
400  */
401 #define AUGMENTED_SURFACE_SET_CLIP_RECT_SINCE_VERSION 8
402 /**
403  * @ingroup iface_augmented_surface
404  */
405 #define AUGMENTED_SURFACE_SET_FRAME_TRACE_ID_SINCE_VERSION 11
406 
407 /** @ingroup iface_augmented_surface */
408 static inline void
augmented_surface_set_user_data(struct augmented_surface * augmented_surface,void * user_data)409 augmented_surface_set_user_data(struct augmented_surface *augmented_surface, void *user_data)
410 {
411 	wl_proxy_set_user_data((struct wl_proxy *) augmented_surface, user_data);
412 }
413 
414 /** @ingroup iface_augmented_surface */
415 static inline void *
augmented_surface_get_user_data(struct augmented_surface * augmented_surface)416 augmented_surface_get_user_data(struct augmented_surface *augmented_surface)
417 {
418 	return wl_proxy_get_user_data((struct wl_proxy *) augmented_surface);
419 }
420 
421 static inline uint32_t
augmented_surface_get_version(struct augmented_surface * augmented_surface)422 augmented_surface_get_version(struct augmented_surface *augmented_surface)
423 {
424 	return wl_proxy_get_version((struct wl_proxy *) augmented_surface);
425 }
426 
427 /**
428  * @ingroup iface_augmented_surface
429  *
430  * Client will no longer be able to control the delegated composition properties
431  * of this surface. This does not change the existing delegated composition
432  * behavior.
433  */
434 static inline void
augmented_surface_destroy(struct augmented_surface * augmented_surface)435 augmented_surface_destroy(struct augmented_surface *augmented_surface)
436 {
437 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
438 			 AUGMENTED_SURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), WL_MARSHAL_FLAG_DESTROY);
439 }
440 
441 /**
442  * @ingroup iface_augmented_surface
443  *
444  * [Deprecated]. Use set_rounded_corners_clip_bounds request below.
445  *
446  * Informs the server that it must apply the rounded corners
447  * mask filter that shall be applied on next commit. Use
448  * set_rounded_corners_bounds instead.
449  */
450 static inline void
augmented_surface_set_rounded_corners(struct augmented_surface * augmented_surface,wl_fixed_t top_left,wl_fixed_t top_right,wl_fixed_t bottom_right,wl_fixed_t bottom_left)451 augmented_surface_set_rounded_corners(struct augmented_surface *augmented_surface, wl_fixed_t top_left, wl_fixed_t top_right, wl_fixed_t bottom_right, wl_fixed_t bottom_left)
452 {
453 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
454 			 AUGMENTED_SURFACE_SET_ROUNDED_CORNERS, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), 0, top_left, top_right, bottom_right, bottom_left);
455 }
456 
457 /**
458  * @ingroup iface_augmented_surface
459  *
460  * Sets the surface destination viewport size, with subpixel accuracy.
461  * This state is double-buffered, and is applied on the next wl_surface.commit.
462  */
463 static inline void
augmented_surface_set_destination_size(struct augmented_surface * augmented_surface,wl_fixed_t width,wl_fixed_t height)464 augmented_surface_set_destination_size(struct augmented_surface *augmented_surface, wl_fixed_t width, wl_fixed_t height)
465 {
466 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
467 			 AUGMENTED_SURFACE_SET_DESTINATION_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), 0, width, height);
468 }
469 
470 /**
471  * @ingroup iface_augmented_surface
472  *
473  * [Deprecated]. Use set_rounded_corners_clip_bounds request below.
474  *
475  * Informs the server that it must apply the rounded clipping mask filter
476  * that shall be applied on next commit. The mask can be uniform for
477  * several surfaces and applied uniformally so that two or more
478  * surfaces visually look as a single surface with rounded corners.
479  * Please note this is can only be used on surfaces that are used as
480  * overlays, which must not have any subtrees. The rounding will be
481  * ignored if the bounds are outside of the surface.
482  */
483 static inline void
augmented_surface_set_rounded_clip_bounds(struct augmented_surface * augmented_surface,int32_t x,int32_t y,int32_t width,int32_t height,wl_fixed_t top_left,wl_fixed_t top_right,wl_fixed_t bottom_right,wl_fixed_t bottom_left)484 augmented_surface_set_rounded_clip_bounds(struct augmented_surface *augmented_surface, int32_t x, int32_t y, int32_t width, int32_t height, wl_fixed_t top_left, wl_fixed_t top_right, wl_fixed_t bottom_right, wl_fixed_t bottom_left)
485 {
486 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
487 			 AUGMENTED_SURFACE_SET_ROUNDED_CLIP_BOUNDS, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), 0, x, y, width, height, top_left, top_right, bottom_right, bottom_left);
488 }
489 
490 /**
491  * @ingroup iface_augmented_surface
492  *
493  * Sets a background color of a this surface. This information will be
494  * associated with the next buffer commit. Please note this is different
495  * from solid color buffers, which creates a new buffer instance, and
496  * rather provides additional information how the buffer should be
497  * composited. Passing empty array means the background color is reset.
498  * The default value is determined by the Wayland compositor then.
499  */
500 static inline void
augmented_surface_set_background_color(struct augmented_surface * augmented_surface,struct wl_array * color)501 augmented_surface_set_background_color(struct augmented_surface *augmented_surface, struct wl_array *color)
502 {
503 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
504 			 AUGMENTED_SURFACE_SET_BACKGROUND_COLOR, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), 0, color);
505 }
506 
507 /**
508  * @ingroup iface_augmented_surface
509  *
510  * [Deprecated] When set, this surface trusts all damage reported to this
511  * surface and descendant sub-surfaces is accurate, and will not try to
512  * recompute it. If not set, various changes like adding or removing a
513  * sub-surface, changing its position or stacking order, can cause full
514  * damage on this surface.
515  *
516  * The initial state is disabled.
517  */
518 static inline void
augmented_surface_set_trusted_damage(struct augmented_surface * augmented_surface,int32_t enabled)519 augmented_surface_set_trusted_damage(struct augmented_surface *augmented_surface, int32_t enabled)
520 {
521 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
522 			 AUGMENTED_SURFACE_SET_TRUSTED_DAMAGE, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), 0, enabled);
523 }
524 
525 /**
526  * @ingroup iface_augmented_surface
527  *
528  * Informs the server that it must apply the rounded clipping mask filter
529  * that shall be applied on next commit. The mask can be uniform for
530  * several surfaces and applied uniformally so that two or more
531  * surfaces visually look as a single surface with rounded corners.
532  *
533  * Since version 9, the bounds will be placed with its origin (top left
534  * corner pixel) at the location x, y of the surface local coordinate
535  * system. On version 8 or before, it is placed with its root surface
536  * coordinates, but this is deperecated.
537  *
538  * Please note this is can only be used on surfaces that are used as
539  * overlays, which must not have any subtrees. The rounding will be
540  * ignored if the bounds are outside of the surface.
541  */
542 static inline void
augmented_surface_set_rounded_corners_clip_bounds(struct augmented_surface * augmented_surface,wl_fixed_t x,wl_fixed_t y,wl_fixed_t width,wl_fixed_t height,wl_fixed_t top_left,wl_fixed_t top_right,wl_fixed_t bottom_right,wl_fixed_t bottom_left)543 augmented_surface_set_rounded_corners_clip_bounds(struct augmented_surface *augmented_surface, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height, wl_fixed_t top_left, wl_fixed_t top_right, wl_fixed_t bottom_right, wl_fixed_t bottom_left)
544 {
545 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
546 			 AUGMENTED_SURFACE_SET_ROUNDED_CORNERS_CLIP_BOUNDS, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), 0, x, y, width, height, top_left, top_right, bottom_right, bottom_left);
547 }
548 
549 /**
550  * @ingroup iface_augmented_surface
551  *
552  * This schedules a clip rect to be applied when drawing this sub-surface.
553  * The clip will be placed with its origin (top left corner pixel) at the
554  * location x, y of the surface local coordinate system. The coordinates are not
555  * restricted to the surface area. Negative x and y values are allowed.
556  *
557  * If all of x, y, width and height are -1.0, the clip rect is unset instead.
558  *
559  * Initially, surfaces have no clip set.
560  * This state is double-buffered, and is applied on the next wl_surface.commit.
561  */
562 static inline void
augmented_surface_set_clip_rect(struct augmented_surface * augmented_surface,wl_fixed_t x,wl_fixed_t y,wl_fixed_t width,wl_fixed_t height)563 augmented_surface_set_clip_rect(struct augmented_surface *augmented_surface, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height)
564 {
565 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
566 			 AUGMENTED_SURFACE_SET_CLIP_RECT, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), 0, x, y, width, height);
567 }
568 
569 /**
570  * @ingroup iface_augmented_surface
571  *
572  * This sets a trace ID to connect the frame submission trace event flow at
573  * the client and the server side.
574  * This state is double-buffered, and is applied on the next
575  * wl_surface.commit.
576  */
577 static inline void
augmented_surface_set_frame_trace_id(struct augmented_surface * augmented_surface,uint32_t id_hi,uint32_t id_lo)578 augmented_surface_set_frame_trace_id(struct augmented_surface *augmented_surface, uint32_t id_hi, uint32_t id_lo)
579 {
580 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_surface,
581 			 AUGMENTED_SURFACE_SET_FRAME_TRACE_ID, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_surface), 0, id_hi, id_lo);
582 }
583 
584 #ifndef AUGMENTED_SUB_SURFACE_ERROR_ENUM
585 #define AUGMENTED_SUB_SURFACE_ERROR_ENUM
586 enum augmented_sub_surface_error {
587 	/**
588 	 * array sent with invalid dimensions
589 	 */
590 	AUGMENTED_SUB_SURFACE_ERROR_INVALID_SIZE = 0,
591 };
592 #endif /* AUGMENTED_SUB_SURFACE_ERROR_ENUM */
593 
594 #define AUGMENTED_SUB_SURFACE_DESTROY 0
595 #define AUGMENTED_SUB_SURFACE_SET_POSITION 1
596 #define AUGMENTED_SUB_SURFACE_SET_CLIP_RECT 2
597 #define AUGMENTED_SUB_SURFACE_SET_TRANSFORM 3
598 
599 
600 /**
601  * @ingroup iface_augmented_sub_surface
602  */
603 #define AUGMENTED_SUB_SURFACE_DESTROY_SINCE_VERSION 1
604 /**
605  * @ingroup iface_augmented_sub_surface
606  */
607 #define AUGMENTED_SUB_SURFACE_SET_POSITION_SINCE_VERSION 1
608 /**
609  * @ingroup iface_augmented_sub_surface
610  */
611 #define AUGMENTED_SUB_SURFACE_SET_CLIP_RECT_SINCE_VERSION 4
612 /**
613  * @ingroup iface_augmented_sub_surface
614  */
615 #define AUGMENTED_SUB_SURFACE_SET_TRANSFORM_SINCE_VERSION 5
616 
617 /** @ingroup iface_augmented_sub_surface */
618 static inline void
augmented_sub_surface_set_user_data(struct augmented_sub_surface * augmented_sub_surface,void * user_data)619 augmented_sub_surface_set_user_data(struct augmented_sub_surface *augmented_sub_surface, void *user_data)
620 {
621 	wl_proxy_set_user_data((struct wl_proxy *) augmented_sub_surface, user_data);
622 }
623 
624 /** @ingroup iface_augmented_sub_surface */
625 static inline void *
augmented_sub_surface_get_user_data(struct augmented_sub_surface * augmented_sub_surface)626 augmented_sub_surface_get_user_data(struct augmented_sub_surface *augmented_sub_surface)
627 {
628 	return wl_proxy_get_user_data((struct wl_proxy *) augmented_sub_surface);
629 }
630 
631 static inline uint32_t
augmented_sub_surface_get_version(struct augmented_sub_surface * augmented_sub_surface)632 augmented_sub_surface_get_version(struct augmented_sub_surface *augmented_sub_surface)
633 {
634 	return wl_proxy_get_version((struct wl_proxy *) augmented_sub_surface);
635 }
636 
637 /**
638  * @ingroup iface_augmented_sub_surface
639  *
640  * The associated wl_surface's augmenter is removed.
641  * The change is applied on the next wl_surface.commit.
642  */
643 static inline void
augmented_sub_surface_destroy(struct augmented_sub_surface * augmented_sub_surface)644 augmented_sub_surface_destroy(struct augmented_sub_surface *augmented_sub_surface)
645 {
646 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_sub_surface,
647 			 AUGMENTED_SUB_SURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_sub_surface), WL_MARSHAL_FLAG_DESTROY);
648 }
649 
650 /**
651  * @ingroup iface_augmented_sub_surface
652  *
653  * This schedules a sub-surface position change.
654  * The sub-surface will be moved so that its origin (top left
655  * corner pixel) will be at the location x, y of the parent surface
656  * coordinate system. The coordinates are not restricted to the parent
657  * surface area. Negative values are allowed.
658  *
659  * The scheduled coordinates will take effect whenever the state of the
660  * parent surface is applied. When this happens depends on whether the
661  * parent surface is in synchronized mode or not. See
662  * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
663  *
664  * If more than one set_position request is invoked by the client before
665  * the commit of the parent surface, the position of a new request always
666  * replaces the scheduled position from any previous request.
667  *
668  * The initial position is 0, 0.
669  * This state is double-buffered, and is applied on the next wl_surface.commit.
670  */
671 static inline void
augmented_sub_surface_set_position(struct augmented_sub_surface * augmented_sub_surface,wl_fixed_t x,wl_fixed_t y)672 augmented_sub_surface_set_position(struct augmented_sub_surface *augmented_sub_surface, wl_fixed_t x, wl_fixed_t y)
673 {
674 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_sub_surface,
675 			 AUGMENTED_SUB_SURFACE_SET_POSITION, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_sub_surface), 0, x, y);
676 }
677 
678 /**
679  * @ingroup iface_augmented_sub_surface
680  *
681  * [Deprecated] Use set_clip_rect on augmented_surface instead.
682  * This schedules a clip rect to be applied when drawing this sub-surface.
683  * The clip will be placed with its origin (top left corner pixel) at the
684  * location x, y of the parent surface coordinate system. The coordinates are not
685  * restricted to the parent surface area. Negative x and y values are allowed.
686  *
687  * If all of x, y, width and height are -1.0, the clip rect is unset instead.
688  *
689  * Initially, surfaces have no clip set.
690  * This state is double-buffered, and is applied on the next wl_surface.commit.
691  */
692 static inline void
augmented_sub_surface_set_clip_rect(struct augmented_sub_surface * augmented_sub_surface,wl_fixed_t x,wl_fixed_t y,wl_fixed_t width,wl_fixed_t height)693 augmented_sub_surface_set_clip_rect(struct augmented_sub_surface *augmented_sub_surface, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height)
694 {
695 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_sub_surface,
696 			 AUGMENTED_SUB_SURFACE_SET_CLIP_RECT, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_sub_surface), 0, x, y, width, height);
697 }
698 
699 /**
700  * @ingroup iface_augmented_sub_surface
701  *
702  * This schedules a transform to be applied when drawing this sub-surface.
703  * This transform does not apply to any child surfaces of this sub-surface.
704  *
705  * The matrix should be passed as an array of 6 floats in column major
706  * order. An empty array can be sent to set the transform to the identity
707  * matrix.
708  *
709  * The initial transform is identity.
710  * This state is double-buffered, and is applied on the next
711  * wl_surface.commit.
712  */
713 static inline void
augmented_sub_surface_set_transform(struct augmented_sub_surface * augmented_sub_surface,struct wl_array * matrix)714 augmented_sub_surface_set_transform(struct augmented_sub_surface *augmented_sub_surface, struct wl_array *matrix)
715 {
716 	wl_proxy_marshal_flags((struct wl_proxy *) augmented_sub_surface,
717 			 AUGMENTED_SUB_SURFACE_SET_TRANSFORM, NULL, wl_proxy_get_version((struct wl_proxy *) augmented_sub_surface), 0, matrix);
718 }
719 
720 #ifdef  __cplusplus
721 }
722 #endif
723 
724 #endif
725