1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef AURA_SHELL_CLIENT_PROTOCOL_H
4 #define AURA_SHELL_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_aura_shell The aura_shell protocol
16  * @section page_ifaces_aura_shell Interfaces
17  * - @subpage page_iface_zaura_shell - aura_shell
18  * - @subpage page_iface_zaura_surface - aura shell interface to a wl_surface
19  * - @subpage page_iface_zaura_output - aura shell interface to a wl_output
20  * - @subpage page_iface_zaura_toplevel - aura shell interface to the toplevel shell
21  * - @subpage page_iface_zaura_popup - aura shell interface to the popup shell
22  * - @subpage page_iface_zaura_output_manager - aura shell interface to the output manager
23  * @section page_copyright_aura_shell Copyright
24  * <pre>
25  *
26  * Copyright 2017 The Chromium Authors
27  *
28  * Permission is hereby granted, free of charge, to any person obtaining a
29  * copy of this software and associated documentation files (the "Software"),
30  * to deal in the Software without restriction, including without limitation
31  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
32  * and/or sell copies of the Software, and to permit persons to whom the
33  * Software is furnished to do so, subject to the following conditions:
34  *
35  * The above copyright notice and this permission notice (including the next
36  * paragraph) shall be included in all copies or substantial portions of the
37  * Software.
38  *
39  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
42  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
45  * DEALINGS IN THE SOFTWARE.
46  * </pre>
47  */
48 struct wl_output;
49 struct wl_region;
50 struct wl_surface;
51 struct xdg_popup;
52 struct xdg_toplevel;
53 struct zaura_output;
54 struct zaura_output_manager;
55 struct zaura_popup;
56 struct zaura_shell;
57 struct zaura_surface;
58 struct zaura_toplevel;
59 
60 #ifndef ZAURA_SHELL_INTERFACE
61 #define ZAURA_SHELL_INTERFACE
62 /**
63  * @page page_iface_zaura_shell zaura_shell
64  * @section page_iface_zaura_shell_desc Description
65  *
66  * The global interface exposing aura shell capabilities is used to
67  * instantiate an interface extension for a wl_surface object.
68  * This extended interface will then allow the client to use aura shell
69  * specific functionality.
70  * @section page_iface_zaura_shell_api API
71  * See @ref iface_zaura_shell.
72  */
73 /**
74  * @defgroup iface_zaura_shell The zaura_shell interface
75  *
76  * The global interface exposing aura shell capabilities is used to
77  * instantiate an interface extension for a wl_surface object.
78  * This extended interface will then allow the client to use aura shell
79  * specific functionality.
80  */
81 extern const struct wl_interface zaura_shell_interface;
82 #endif
83 #ifndef ZAURA_SURFACE_INTERFACE
84 #define ZAURA_SURFACE_INTERFACE
85 /**
86  * @page page_iface_zaura_surface zaura_surface
87  * @section page_iface_zaura_surface_desc Description
88  *
89  * An additional interface to a wl_surface object, which allows the
90  * client to access aura shell specific functionality for surface.
91  * @section page_iface_zaura_surface_api API
92  * See @ref iface_zaura_surface.
93  */
94 /**
95  * @defgroup iface_zaura_surface The zaura_surface interface
96  *
97  * An additional interface to a wl_surface object, which allows the
98  * client to access aura shell specific functionality for surface.
99  */
100 extern const struct wl_interface zaura_surface_interface;
101 #endif
102 #ifndef ZAURA_OUTPUT_INTERFACE
103 #define ZAURA_OUTPUT_INTERFACE
104 /**
105  * @page page_iface_zaura_output zaura_output
106  * @section page_iface_zaura_output_desc Description
107  *
108  * An additional interface to a wl_output object, which allows the
109  * client to access aura shell specific functionality for output.
110  * @section page_iface_zaura_output_api API
111  * See @ref iface_zaura_output.
112  */
113 /**
114  * @defgroup iface_zaura_output The zaura_output interface
115  *
116  * An additional interface to a wl_output object, which allows the
117  * client to access aura shell specific functionality for output.
118  */
119 extern const struct wl_interface zaura_output_interface;
120 #endif
121 #ifndef ZAURA_TOPLEVEL_INTERFACE
122 #define ZAURA_TOPLEVEL_INTERFACE
123 /**
124  * @page page_iface_zaura_toplevel zaura_toplevel
125  * @section page_iface_zaura_toplevel_desc Description
126  *
127  * An interface to the toplevel shell, which allows the
128  * client to access shell specific functionality.
129  * @section page_iface_zaura_toplevel_api API
130  * See @ref iface_zaura_toplevel.
131  */
132 /**
133  * @defgroup iface_zaura_toplevel The zaura_toplevel interface
134  *
135  * An interface to the toplevel shell, which allows the
136  * client to access shell specific functionality.
137  */
138 extern const struct wl_interface zaura_toplevel_interface;
139 #endif
140 #ifndef ZAURA_POPUP_INTERFACE
141 #define ZAURA_POPUP_INTERFACE
142 /**
143  * @page page_iface_zaura_popup zaura_popup
144  * @section page_iface_zaura_popup_desc Description
145  *
146  * An interface to the popup shell, which allows the
147  * client to access shell specific functionality.
148  * @section page_iface_zaura_popup_api API
149  * See @ref iface_zaura_popup.
150  */
151 /**
152  * @defgroup iface_zaura_popup The zaura_popup interface
153  *
154  * An interface to the popup shell, which allows the
155  * client to access shell specific functionality.
156  */
157 extern const struct wl_interface zaura_popup_interface;
158 #endif
159 #ifndef ZAURA_OUTPUT_MANAGER_INTERFACE
160 #define ZAURA_OUTPUT_MANAGER_INTERFACE
161 /**
162  * @page page_iface_zaura_output_manager zaura_output_manager
163  * @section page_iface_zaura_output_manager_desc Description
164  *
165  * [Deprecated] Deprecated since M122. See the zaura_output_manager_v2
166  * interface.
167  *
168  * A global responsible for ensuring clients have a complete view of a given
169  * output's state immediately following the bind of wl_output, and
170  * subsequently as needed.
171  *
172  * Clients can expect that all the manager's events for a given wl_output
173  * arrive before the associated wl_output.done event. Clients must bind to
174  * the manager global before any output globals.
175  * @section page_iface_zaura_output_manager_api API
176  * See @ref iface_zaura_output_manager.
177  */
178 /**
179  * @defgroup iface_zaura_output_manager The zaura_output_manager interface
180  *
181  * [Deprecated] Deprecated since M122. See the zaura_output_manager_v2
182  * interface.
183  *
184  * A global responsible for ensuring clients have a complete view of a given
185  * output's state immediately following the bind of wl_output, and
186  * subsequently as needed.
187  *
188  * Clients can expect that all the manager's events for a given wl_output
189  * arrive before the associated wl_output.done event. Clients must bind to
190  * the manager global before any output globals.
191  */
192 extern const struct wl_interface zaura_output_manager_interface;
193 #endif
194 
195 #ifndef ZAURA_SHELL_ERROR_ENUM
196 #define ZAURA_SHELL_ERROR_ENUM
197 enum zaura_shell_error {
198 	/**
199 	 * the surface already has an aura surface object associated
200 	 */
201 	ZAURA_SHELL_ERROR_AURA_SURFACE_EXISTS = 0,
202 	/**
203 	 * the output already has an aura output object associated
204 	 */
205 	ZAURA_SHELL_ERROR_AURA_OUTPUT_EXISTS = 1,
206 };
207 #endif /* ZAURA_SHELL_ERROR_ENUM */
208 
209 #ifndef ZAURA_SHELL_LAYOUT_MODE_ENUM
210 #define ZAURA_SHELL_LAYOUT_MODE_ENUM
211 /**
212  * @ingroup iface_zaura_shell
213  * the layout mode
214  *
215  * Specifies the server's window layout mode.
216  */
217 enum zaura_shell_layout_mode {
218 	/**
219 	 * multiple windows
220 	 */
221 	ZAURA_SHELL_LAYOUT_MODE_WINDOWED = 1,
222 	/**
223 	 * restricted mode for tablet
224 	 */
225 	ZAURA_SHELL_LAYOUT_MODE_TABLET = 2,
226 };
227 #endif /* ZAURA_SHELL_LAYOUT_MODE_ENUM */
228 
229 /**
230  * @ingroup iface_zaura_shell
231  * @struct zaura_shell_listener
232  */
233 struct zaura_shell_listener {
234 	/**
235 	 * sends the layout_mode
236 	 *
237 	 * Sends the layout_mode used by the server.
238 	 * @param layout_mode layout_mode enum
239 	 * @since 11
240 	 */
241 	void (*layout_mode)(void *data,
242 			    struct zaura_shell *zaura_shell,
243 			    uint32_t layout_mode);
244 	/**
245 	 * sends a bug fix ID
246 	 *
247 	 * Sends a monorail ID of a bug fixed on the exo server that
248 	 * clients can use to gate functionality.
249 	 * @param id ID of a single bug fix
250 	 * @since 14
251 	 */
252 	void (*bug_fix)(void *data,
253 			struct zaura_shell *zaura_shell,
254 			uint32_t id);
255 	/**
256 	 * sends names of desks
257 	 *
258 	 * Notifies when there is a change in global desks state. This is
259 	 * emitted on desk name changes, desk addition/removal or desks are
260 	 * reordered. "desk_names" argument contains the set of null
261 	 * terminated strings as names of desks.
262 	 * @param desk_names an array of existing desks' names
263 	 * @since 22
264 	 */
265 	void (*desks_changed)(void *data,
266 			      struct zaura_shell *zaura_shell,
267 			      struct wl_array *desk_names);
268 	/**
269 	 * sends the index of the active desk
270 	 *
271 	 * Notifies when there is a change of the active desk.
272 	 * @param active_desk_index index of the active desk
273 	 * @since 22
274 	 */
275 	void (*desk_activation_changed)(void *data,
276 					struct zaura_shell *zaura_shell,
277 					int32_t active_desk_index);
278 	/**
279 	 * activated surface changed
280 	 *
281 	 * Notifies client that the activated surface changed.
282 	 * @since 24
283 	 */
284 	void (*activated)(void *data,
285 			  struct zaura_shell *zaura_shell,
286 			  struct wl_surface *gained_active,
287 			  struct wl_surface *lost_active);
288 	/**
289 	 * entered overview mode
290 	 *
291 	 * Notifies client that the server has entered overview mode.
292 	 * Overview mode displays all app windows associated with the
293 	 * current desk for the user.
294 	 * @since 57
295 	 */
296 	void (*set_overview_mode)(void *data,
297 				  struct zaura_shell *zaura_shell);
298 	/**
299 	 * exited overview mode
300 	 *
301 	 * Notifies client that the server has exited overview mode.
302 	 * @since 57
303 	 */
304 	void (*unset_overview_mode)(void *data,
305 				    struct zaura_shell *zaura_shell);
306 	/**
307 	 * sends the server version
308 	 *
309 	 * Sends the Exo compositor version information.
310 	 * @param version_label version string label
311 	 * @since 58
312 	 */
313 	void (*compositor_version)(void *data,
314 				   struct zaura_shell *zaura_shell,
315 				   const char *version_label);
316 	/**
317 	 * completed sending all bug fix ids
318 	 *
319 	 * Notifies client that all the IDs of a bug fixed on the exo
320 	 * server is sent. Bug fix ids are sent via `bug_fix` events which
321 	 * sends ids one by one, not an array. This event is used to
322 	 * confirm all ids are sent.
323 	 * @since 60
324 	 */
325 	void (*all_bug_fixes_sent)(void *data,
326 				   struct zaura_shell *zaura_shell);
327 	/**
328 	 * sends the radius of each corner the window
329 	 *
330 	 * Sends the radius of each corner of the window to the clients
331 	 * in dips.
332 	 * @since 61
333 	 */
334 	void (*window_corners_radii)(void *data,
335 				     struct zaura_shell *zaura_shell,
336 				     uint32_t upper_left_radius,
337 				     uint32_t upper_right_radius,
338 				     uint32_t lower_right_radius,
339 				     uint32_t lower_left_radius);
340 };
341 
342 /**
343  * @ingroup iface_zaura_shell
344  */
345 static inline int
zaura_shell_add_listener(struct zaura_shell * zaura_shell,const struct zaura_shell_listener * listener,void * data)346 zaura_shell_add_listener(struct zaura_shell *zaura_shell,
347 			 const struct zaura_shell_listener *listener, void *data)
348 {
349 	return wl_proxy_add_listener((struct wl_proxy *) zaura_shell,
350 				     (void (**)(void)) listener, data);
351 }
352 
353 #define ZAURA_SHELL_GET_AURA_SURFACE 0
354 #define ZAURA_SHELL_GET_AURA_OUTPUT 1
355 #define ZAURA_SHELL_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES 2
356 #define ZAURA_SHELL_GET_AURA_TOPLEVEL_FOR_XDG_TOPLEVEL 3
357 #define ZAURA_SHELL_GET_AURA_POPUP_FOR_XDG_POPUP 4
358 #define ZAURA_SHELL_RELEASE 5
359 
360 /**
361  * @ingroup iface_zaura_shell
362  */
363 #define ZAURA_SHELL_LAYOUT_MODE_SINCE_VERSION 11
364 /**
365  * @ingroup iface_zaura_shell
366  */
367 #define ZAURA_SHELL_BUG_FIX_SINCE_VERSION 14
368 /**
369  * @ingroup iface_zaura_shell
370  */
371 #define ZAURA_SHELL_DESKS_CHANGED_SINCE_VERSION 22
372 /**
373  * @ingroup iface_zaura_shell
374  */
375 #define ZAURA_SHELL_DESK_ACTIVATION_CHANGED_SINCE_VERSION 22
376 /**
377  * @ingroup iface_zaura_shell
378  */
379 #define ZAURA_SHELL_ACTIVATED_SINCE_VERSION 24
380 /**
381  * @ingroup iface_zaura_shell
382  */
383 #define ZAURA_SHELL_SET_OVERVIEW_MODE_SINCE_VERSION 57
384 /**
385  * @ingroup iface_zaura_shell
386  */
387 #define ZAURA_SHELL_UNSET_OVERVIEW_MODE_SINCE_VERSION 57
388 /**
389  * @ingroup iface_zaura_shell
390  */
391 #define ZAURA_SHELL_COMPOSITOR_VERSION_SINCE_VERSION 58
392 /**
393  * @ingroup iface_zaura_shell
394  */
395 #define ZAURA_SHELL_ALL_BUG_FIXES_SENT_SINCE_VERSION 60
396 /**
397  * @ingroup iface_zaura_shell
398  */
399 #define ZAURA_SHELL_WINDOW_CORNERS_RADII_SINCE_VERSION 61
400 
401 /**
402  * @ingroup iface_zaura_shell
403  */
404 #define ZAURA_SHELL_GET_AURA_SURFACE_SINCE_VERSION 1
405 /**
406  * @ingroup iface_zaura_shell
407  */
408 #define ZAURA_SHELL_GET_AURA_OUTPUT_SINCE_VERSION 2
409 /**
410  * @ingroup iface_zaura_shell
411  */
412 #define ZAURA_SHELL_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES_SINCE_VERSION 26
413 /**
414  * @ingroup iface_zaura_shell
415  */
416 #define ZAURA_SHELL_GET_AURA_TOPLEVEL_FOR_XDG_TOPLEVEL_SINCE_VERSION 27
417 /**
418  * @ingroup iface_zaura_shell
419  */
420 #define ZAURA_SHELL_GET_AURA_POPUP_FOR_XDG_POPUP_SINCE_VERSION 28
421 /**
422  * @ingroup iface_zaura_shell
423  */
424 #define ZAURA_SHELL_RELEASE_SINCE_VERSION 38
425 
426 /** @ingroup iface_zaura_shell */
427 static inline void
zaura_shell_set_user_data(struct zaura_shell * zaura_shell,void * user_data)428 zaura_shell_set_user_data(struct zaura_shell *zaura_shell, void *user_data)
429 {
430 	wl_proxy_set_user_data((struct wl_proxy *) zaura_shell, user_data);
431 }
432 
433 /** @ingroup iface_zaura_shell */
434 static inline void *
zaura_shell_get_user_data(struct zaura_shell * zaura_shell)435 zaura_shell_get_user_data(struct zaura_shell *zaura_shell)
436 {
437 	return wl_proxy_get_user_data((struct wl_proxy *) zaura_shell);
438 }
439 
440 static inline uint32_t
zaura_shell_get_version(struct zaura_shell * zaura_shell)441 zaura_shell_get_version(struct zaura_shell *zaura_shell)
442 {
443 	return wl_proxy_get_version((struct wl_proxy *) zaura_shell);
444 }
445 
446 /** @ingroup iface_zaura_shell */
447 static inline void
zaura_shell_destroy(struct zaura_shell * zaura_shell)448 zaura_shell_destroy(struct zaura_shell *zaura_shell)
449 {
450 	wl_proxy_destroy((struct wl_proxy *) zaura_shell);
451 }
452 
453 /**
454  * @ingroup iface_zaura_shell
455  *
456  * Instantiate an interface extension for the given wl_surface to
457  * provide aura shell functionality. If the given wl_surface is not
458  * associated with a shell surface, the shell_surface_missing protocol
459  * error is raised.
460  */
461 static inline struct zaura_surface *
zaura_shell_get_aura_surface(struct zaura_shell * zaura_shell,struct wl_surface * surface)462 zaura_shell_get_aura_surface(struct zaura_shell *zaura_shell, struct wl_surface *surface)
463 {
464 	struct wl_proxy *id;
465 
466 	id = wl_proxy_marshal_flags((struct wl_proxy *) zaura_shell,
467 			 ZAURA_SHELL_GET_AURA_SURFACE, &zaura_surface_interface, wl_proxy_get_version((struct wl_proxy *) zaura_shell), 0, NULL, surface);
468 
469 	return (struct zaura_surface *) id;
470 }
471 
472 /**
473  * @ingroup iface_zaura_shell
474  *
475  * Instantiate an interface extension for the given wl_output to
476  * provide aura shell functionality.
477  */
478 static inline struct zaura_output *
zaura_shell_get_aura_output(struct zaura_shell * zaura_shell,struct wl_output * output)479 zaura_shell_get_aura_output(struct zaura_shell *zaura_shell, struct wl_output *output)
480 {
481 	struct wl_proxy *id;
482 
483 	id = wl_proxy_marshal_flags((struct wl_proxy *) zaura_shell,
484 			 ZAURA_SHELL_GET_AURA_OUTPUT, &zaura_output_interface, wl_proxy_get_version((struct wl_proxy *) zaura_shell), 0, NULL, output);
485 
486 	return (struct zaura_output *) id;
487 }
488 
489 /**
490  * @ingroup iface_zaura_shell
491  *
492  * [Deprecated] Informs the server that when submitting surfaces, this
493  * client will not use wl_surface_set_buffer_scale to report the scales,
494  * nor will it apply scale via vp_viewporter. Instead the server should
495  * apply an appropriate scale transform to have the submitted buffers
496  * composited correctly.
497  */
498 static inline void
zaura_shell_surface_submission_in_pixel_coordinates(struct zaura_shell * zaura_shell)499 zaura_shell_surface_submission_in_pixel_coordinates(struct zaura_shell *zaura_shell)
500 {
501 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_shell,
502 			 ZAURA_SHELL_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_shell), 0);
503 }
504 
505 /**
506  * @ingroup iface_zaura_shell
507  *
508  * Retrieve the aura toplevel interface for a given xdg toplevel interface
509  */
510 static inline struct zaura_toplevel *
zaura_shell_get_aura_toplevel_for_xdg_toplevel(struct zaura_shell * zaura_shell,struct xdg_toplevel * toplevel)511 zaura_shell_get_aura_toplevel_for_xdg_toplevel(struct zaura_shell *zaura_shell, struct xdg_toplevel *toplevel)
512 {
513 	struct wl_proxy *id;
514 
515 	id = wl_proxy_marshal_flags((struct wl_proxy *) zaura_shell,
516 			 ZAURA_SHELL_GET_AURA_TOPLEVEL_FOR_XDG_TOPLEVEL, &zaura_toplevel_interface, wl_proxy_get_version((struct wl_proxy *) zaura_shell), 0, NULL, toplevel);
517 
518 	return (struct zaura_toplevel *) id;
519 }
520 
521 /**
522  * @ingroup iface_zaura_shell
523  *
524  * Retrieve the aura popup interface for the given xdg popup interface
525  */
526 static inline struct zaura_popup *
zaura_shell_get_aura_popup_for_xdg_popup(struct zaura_shell * zaura_shell,struct xdg_popup * popup)527 zaura_shell_get_aura_popup_for_xdg_popup(struct zaura_shell *zaura_shell, struct xdg_popup *popup)
528 {
529 	struct wl_proxy *id;
530 
531 	id = wl_proxy_marshal_flags((struct wl_proxy *) zaura_shell,
532 			 ZAURA_SHELL_GET_AURA_POPUP_FOR_XDG_POPUP, &zaura_popup_interface, wl_proxy_get_version((struct wl_proxy *) zaura_shell), 0, NULL, popup);
533 
534 	return (struct zaura_popup *) id;
535 }
536 
537 /**
538  * @ingroup iface_zaura_shell
539  *
540  * Using this request a client can tell the server that it is not going to
541  * use the zaura_shell object anymore. This does not affect any other objects.
542  *
543  * This is named "release" because "destroy" is a special named function used for
544  * freeing wl_proxy objects. Naming it "destroy" will cause marshalling errors
545  * when running on lower versioned hosts. All "release" requests here should be
546  * renamed to "destroy" if we move to aura-shell v2.
547  */
548 static inline void
zaura_shell_release(struct zaura_shell * zaura_shell)549 zaura_shell_release(struct zaura_shell *zaura_shell)
550 {
551 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_shell,
552 			 ZAURA_SHELL_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_shell), WL_MARSHAL_FLAG_DESTROY);
553 }
554 
555 #ifndef ZAURA_SURFACE_FRAME_TYPE_ENUM
556 #define ZAURA_SURFACE_FRAME_TYPE_ENUM
557 /**
558  * @ingroup iface_zaura_surface
559  * different frame types
560  *
561  * Frame types that can be used to decorate a surface.
562  */
563 enum zaura_surface_frame_type {
564 	/**
565 	 * no frame
566 	 */
567 	ZAURA_SURFACE_FRAME_TYPE_NONE = 0,
568 	/**
569 	 * caption with shadow
570 	 */
571 	ZAURA_SURFACE_FRAME_TYPE_NORMAL = 1,
572 	/**
573 	 * shadow only
574 	 */
575 	ZAURA_SURFACE_FRAME_TYPE_SHADOW = 2,
576 };
577 #endif /* ZAURA_SURFACE_FRAME_TYPE_ENUM */
578 
579 #ifndef ZAURA_SURFACE_OCCLUSION_CHANGE_REASON_ENUM
580 #define ZAURA_SURFACE_OCCLUSION_CHANGE_REASON_ENUM
581 /**
582  * @ingroup iface_zaura_surface
583  * occlusion change reason
584  *
585  * Enum describing why an occlusion change happened. An occlusion change as a
586  * result of a user action could include things like the user moving a window,
587  * changing occlusion, or opening/closing a window, changing the occlusion.
588  */
589 enum zaura_surface_occlusion_change_reason {
590 	/**
591 	 * occlusion changed as a result of a user action
592 	 */
593 	ZAURA_SURFACE_OCCLUSION_CHANGE_REASON_USER_ACTION = 1,
594 };
595 #endif /* ZAURA_SURFACE_OCCLUSION_CHANGE_REASON_ENUM */
596 
597 #ifndef ZAURA_SURFACE_FULLSCREEN_MODE_ENUM
598 #define ZAURA_SURFACE_FULLSCREEN_MODE_ENUM
599 /**
600  * @ingroup iface_zaura_surface
601  * Specifies the behavior of the surface in fullscreen.
602  *
603  * [Deprecated] Possible windowing system behaviors if this surface were to go
604  * fullscreen.
605  */
606 enum zaura_surface_fullscreen_mode {
607 	/**
608 	 * user can access system UIs such as the shelf and window frame           by pointing to, or swiping over, the screen edge
609 	 */
610 	ZAURA_SURFACE_FULLSCREEN_MODE_IMMERSIVE = 0,
611 	/**
612 	 * user cannot access system UIs using mouse/touches
613 	 */
614 	ZAURA_SURFACE_FULLSCREEN_MODE_PLAIN = 1,
615 };
616 #endif /* ZAURA_SURFACE_FULLSCREEN_MODE_ENUM */
617 
618 #ifndef ZAURA_SURFACE_SNAP_DIRECTION_ENUM
619 #define ZAURA_SURFACE_SNAP_DIRECTION_ENUM
620 /**
621  * @ingroup iface_zaura_surface
622  * surface snap directions
623  *
624  * Surface snap directions.
625  */
626 enum zaura_surface_snap_direction {
627 	/**
628 	 *
629 	 */
630 	ZAURA_SURFACE_SNAP_DIRECTION_NONE = 0,
631 	/**
632 	 *
633 	 */
634 	ZAURA_SURFACE_SNAP_DIRECTION_LEFT = 1,
635 	/**
636 	 *
637 	 */
638 	ZAURA_SURFACE_SNAP_DIRECTION_RIGHT = 2,
639 };
640 #endif /* ZAURA_SURFACE_SNAP_DIRECTION_ENUM */
641 
642 #ifndef ZAURA_SURFACE_OCCLUSION_STATE_ENUM
643 #define ZAURA_SURFACE_OCCLUSION_STATE_ENUM
644 /**
645  * @ingroup iface_zaura_surface
646  * surface occlusion state
647  *
648  * Describes the occlusion state of a surface.
649  */
650 enum zaura_surface_occlusion_state {
651 	/**
652 	 * The surface's occlusion state isn't tracked
653 	 */
654 	ZAURA_SURFACE_OCCLUSION_STATE_UNKNOWN = 0,
655 	/**
656 	 * The surface is visible
657 	 */
658 	ZAURA_SURFACE_OCCLUSION_STATE_VISIBLE = 1,
659 	/**
660 	 * The surface is occluded
661 	 */
662 	ZAURA_SURFACE_OCCLUSION_STATE_OCCLUDED = 2,
663 	/**
664 	 * The surface is not visible
665 	 */
666 	ZAURA_SURFACE_OCCLUSION_STATE_HIDDEN = 3,
667 };
668 #endif /* ZAURA_SURFACE_OCCLUSION_STATE_ENUM */
669 
670 #ifndef ZAURA_SURFACE_TOOLTIP_TRIGGER_ENUM
671 #define ZAURA_SURFACE_TOOLTIP_TRIGGER_ENUM
672 /**
673  * @ingroup iface_zaura_surface
674  * type of tooltip trigger
675  *
676  * Describes what triggered tooltip
677  */
678 enum zaura_surface_tooltip_trigger {
679 	/**
680 	 * triggered by cursor
681 	 */
682 	ZAURA_SURFACE_TOOLTIP_TRIGGER_CURSOR = 0,
683 	/**
684 	 * triggered by keyboard
685 	 */
686 	ZAURA_SURFACE_TOOLTIP_TRIGGER_KEYBOARD = 1,
687 };
688 #endif /* ZAURA_SURFACE_TOOLTIP_TRIGGER_ENUM */
689 
690 /**
691  * @ingroup iface_zaura_surface
692  * @struct zaura_surface_listener
693  */
694 struct zaura_surface_listener {
695 	/**
696 	 * Notifies on an occlusion change
697 	 *
698 	 * Notifies when there is a change in the amount this surface is
699 	 * occluded. The occlusion update is sent as a fixed point number
700 	 * from 0 to 1, representing the proportion of occlusion.
701 	 * @since 8
702 	 */
703 	void (*occlusion_changed)(void *data,
704 				  struct zaura_surface *zaura_surface,
705 				  wl_fixed_t occlusion_fraction,
706 				  uint32_t occlusion_reason);
707 	/**
708 	 * Notify the client that server intent to lock window in normal or restore state
709 	 *
710 	 * Notifies the client to lock window in normal or restore state.
711 	 * When window is locked, the window frame should look like it is
712 	 * in restored state, but actually isn't. Locking happends while
713 	 * dragging a maximized window.
714 	 * @since 17
715 	 */
716 	void (*lock_frame_normal)(void *data,
717 				  struct zaura_surface *zaura_surface);
718 	/**
719 	 * Notify the client that server intent to unlock window's normal or restore state
720 	 *
721 	 * Notifies the client to unlock window if it is previously
722 	 * locked. Unlocking happends while dragging a maximized window.
723 	 * @since 17
724 	 */
725 	void (*unlock_frame_normal)(void *data,
726 				    struct zaura_surface *zaura_surface);
727 	/**
728 	 * Notify the client that the occlusion state changed
729 	 *
730 	 * Notifies the client that the occlusion state of a window has
731 	 * changed. Clients will only receive these messages if they
732 	 * previously request occlusion tracking via set_occlusion_tracking
733 	 * for a particular surface.
734 	 * @since 21
735 	 */
736 	void (*occlusion_state_changed)(void *data,
737 					struct zaura_surface *zaura_surface,
738 					uint32_t mode);
739 	/**
740 	 * window desk state changed
741 	 *
742 	 * Notifies when there is a change in the desk state of a window.
743 	 * This is emitted when a window is moved to another desk or when
744 	 * its assigned-to-all-desks state changes.
745 	 * @param state index of desk or -1 for a window assigned to all desks
746 	 * @since 22
747 	 */
748 	void (*desk_changed)(void *data,
749 			     struct zaura_surface *zaura_surface,
750 			     int32_t state);
751 	/**
752 	 * start throttling on the surface
753 	 *
754 	 * Informs the client to start throttling on the surface.
755 	 * @since 29
756 	 */
757 	void (*start_throttle)(void *data,
758 			       struct zaura_surface *zaura_surface);
759 	/**
760 	 * end throttling on the surface
761 	 *
762 	 * Informs the client to end throttling on the surface.
763 	 * @since 29
764 	 */
765 	void (*end_throttle)(void *data,
766 			     struct zaura_surface *zaura_surface);
767 	/**
768 	 * tooltip is shown by server side
769 	 *
770 	 * Informs the client that the tooltip is shown with states. `x`
771 	 * and `y` specifies the location of tooltip in surface local
772 	 * coordinates.
773 	 * @since 47
774 	 */
775 	void (*tooltip_shown)(void *data,
776 			      struct zaura_surface *zaura_surface,
777 			      const char *text,
778 			      int32_t x,
779 			      int32_t y,
780 			      int32_t width,
781 			      int32_t height);
782 	/**
783 	 * tooltip is hidden by server side
784 	 *
785 	 * Informs the client that the tooltip is hidden.
786 	 * @since 47
787 	 */
788 	void (*tooltip_hidden)(void *data,
789 			       struct zaura_surface *zaura_surface);
790 };
791 
792 /**
793  * @ingroup iface_zaura_surface
794  */
795 static inline int
zaura_surface_add_listener(struct zaura_surface * zaura_surface,const struct zaura_surface_listener * listener,void * data)796 zaura_surface_add_listener(struct zaura_surface *zaura_surface,
797 			   const struct zaura_surface_listener *listener, void *data)
798 {
799 	return wl_proxy_add_listener((struct wl_proxy *) zaura_surface,
800 				     (void (**)(void)) listener, data);
801 }
802 
803 #define ZAURA_SURFACE_SET_FRAME 0
804 #define ZAURA_SURFACE_SET_PARENT 1
805 #define ZAURA_SURFACE_SET_FRAME_COLORS 2
806 #define ZAURA_SURFACE_SET_STARTUP_ID 3
807 #define ZAURA_SURFACE_SET_APPLICATION_ID 4
808 #define ZAURA_SURFACE_SET_CLIENT_SURFACE_ID 5
809 #define ZAURA_SURFACE_SET_OCCLUSION_TRACKING 6
810 #define ZAURA_SURFACE_UNSET_OCCLUSION_TRACKING 7
811 #define ZAURA_SURFACE_ACTIVATE 8
812 #define ZAURA_SURFACE_DRAW_ATTENTION 9
813 #define ZAURA_SURFACE_SET_FULLSCREEN_MODE 10
814 #define ZAURA_SURFACE_SET_CLIENT_SURFACE_STR_ID 11
815 #define ZAURA_SURFACE_SET_SERVER_START_RESIZE 12
816 #define ZAURA_SURFACE_INTENT_TO_SNAP 13
817 #define ZAURA_SURFACE_SET_SNAP_LEFT 14
818 #define ZAURA_SURFACE_SET_SNAP_RIGHT 15
819 #define ZAURA_SURFACE_UNSET_SNAP 16
820 #define ZAURA_SURFACE_SET_WINDOW_SESSION_ID 17
821 #define ZAURA_SURFACE_SET_CAN_GO_BACK 18
822 #define ZAURA_SURFACE_UNSET_CAN_GO_BACK 19
823 #define ZAURA_SURFACE_SET_PIP 20
824 #define ZAURA_SURFACE_UNSET_PIP 21
825 #define ZAURA_SURFACE_SET_ASPECT_RATIO 22
826 #define ZAURA_SURFACE_MOVE_TO_DESK 23
827 #define ZAURA_SURFACE_SET_INITIAL_WORKSPACE 24
828 #define ZAURA_SURFACE_SET_PIN 25
829 #define ZAURA_SURFACE_UNSET_PIN 26
830 #define ZAURA_SURFACE_RELEASE 27
831 #define ZAURA_SURFACE_SHOW_TOOLTIP 28
832 #define ZAURA_SURFACE_HIDE_TOOLTIP 29
833 #define ZAURA_SURFACE_SET_ACCESSIBILITY_ID 30
834 
835 /**
836  * @ingroup iface_zaura_surface
837  */
838 #define ZAURA_SURFACE_OCCLUSION_CHANGED_SINCE_VERSION 8
839 /**
840  * @ingroup iface_zaura_surface
841  */
842 #define ZAURA_SURFACE_LOCK_FRAME_NORMAL_SINCE_VERSION 17
843 /**
844  * @ingroup iface_zaura_surface
845  */
846 #define ZAURA_SURFACE_UNLOCK_FRAME_NORMAL_SINCE_VERSION 17
847 /**
848  * @ingroup iface_zaura_surface
849  */
850 #define ZAURA_SURFACE_OCCLUSION_STATE_CHANGED_SINCE_VERSION 21
851 /**
852  * @ingroup iface_zaura_surface
853  */
854 #define ZAURA_SURFACE_DESK_CHANGED_SINCE_VERSION 22
855 /**
856  * @ingroup iface_zaura_surface
857  */
858 #define ZAURA_SURFACE_START_THROTTLE_SINCE_VERSION 29
859 /**
860  * @ingroup iface_zaura_surface
861  */
862 #define ZAURA_SURFACE_END_THROTTLE_SINCE_VERSION 29
863 /**
864  * @ingroup iface_zaura_surface
865  */
866 #define ZAURA_SURFACE_TOOLTIP_SHOWN_SINCE_VERSION 47
867 /**
868  * @ingroup iface_zaura_surface
869  */
870 #define ZAURA_SURFACE_TOOLTIP_HIDDEN_SINCE_VERSION 47
871 
872 /**
873  * @ingroup iface_zaura_surface
874  */
875 #define ZAURA_SURFACE_SET_FRAME_SINCE_VERSION 1
876 /**
877  * @ingroup iface_zaura_surface
878  */
879 #define ZAURA_SURFACE_SET_PARENT_SINCE_VERSION 2
880 /**
881  * @ingroup iface_zaura_surface
882  */
883 #define ZAURA_SURFACE_SET_FRAME_COLORS_SINCE_VERSION 3
884 /**
885  * @ingroup iface_zaura_surface
886  */
887 #define ZAURA_SURFACE_SET_STARTUP_ID_SINCE_VERSION 4
888 /**
889  * @ingroup iface_zaura_surface
890  */
891 #define ZAURA_SURFACE_SET_APPLICATION_ID_SINCE_VERSION 5
892 /**
893  * @ingroup iface_zaura_surface
894  */
895 #define ZAURA_SURFACE_SET_CLIENT_SURFACE_ID_SINCE_VERSION 7
896 /**
897  * @ingroup iface_zaura_surface
898  */
899 #define ZAURA_SURFACE_SET_OCCLUSION_TRACKING_SINCE_VERSION 8
900 /**
901  * @ingroup iface_zaura_surface
902  */
903 #define ZAURA_SURFACE_UNSET_OCCLUSION_TRACKING_SINCE_VERSION 8
904 /**
905  * @ingroup iface_zaura_surface
906  */
907 #define ZAURA_SURFACE_ACTIVATE_SINCE_VERSION 9
908 /**
909  * @ingroup iface_zaura_surface
910  */
911 #define ZAURA_SURFACE_DRAW_ATTENTION_SINCE_VERSION 9
912 /**
913  * @ingroup iface_zaura_surface
914  */
915 #define ZAURA_SURFACE_SET_FULLSCREEN_MODE_SINCE_VERSION 10
916 /**
917  * @ingroup iface_zaura_surface
918  */
919 #define ZAURA_SURFACE_SET_CLIENT_SURFACE_STR_ID_SINCE_VERSION 12
920 /**
921  * @ingroup iface_zaura_surface
922  */
923 #define ZAURA_SURFACE_SET_SERVER_START_RESIZE_SINCE_VERSION 15
924 /**
925  * @ingroup iface_zaura_surface
926  */
927 #define ZAURA_SURFACE_INTENT_TO_SNAP_SINCE_VERSION 16
928 /**
929  * @ingroup iface_zaura_surface
930  */
931 #define ZAURA_SURFACE_SET_SNAP_LEFT_SINCE_VERSION 16
932 /**
933  * @ingroup iface_zaura_surface
934  */
935 #define ZAURA_SURFACE_SET_SNAP_RIGHT_SINCE_VERSION 16
936 /**
937  * @ingroup iface_zaura_surface
938  */
939 #define ZAURA_SURFACE_UNSET_SNAP_SINCE_VERSION 16
940 /**
941  * @ingroup iface_zaura_surface
942  */
943 #define ZAURA_SURFACE_SET_WINDOW_SESSION_ID_SINCE_VERSION 18
944 /**
945  * @ingroup iface_zaura_surface
946  */
947 #define ZAURA_SURFACE_SET_CAN_GO_BACK_SINCE_VERSION 19
948 /**
949  * @ingroup iface_zaura_surface
950  */
951 #define ZAURA_SURFACE_UNSET_CAN_GO_BACK_SINCE_VERSION 19
952 /**
953  * @ingroup iface_zaura_surface
954  */
955 #define ZAURA_SURFACE_SET_PIP_SINCE_VERSION 20
956 /**
957  * @ingroup iface_zaura_surface
958  */
959 #define ZAURA_SURFACE_UNSET_PIP_SINCE_VERSION 20
960 /**
961  * @ingroup iface_zaura_surface
962  */
963 #define ZAURA_SURFACE_SET_ASPECT_RATIO_SINCE_VERSION 20
964 /**
965  * @ingroup iface_zaura_surface
966  */
967 #define ZAURA_SURFACE_MOVE_TO_DESK_SINCE_VERSION 22
968 /**
969  * @ingroup iface_zaura_surface
970  */
971 #define ZAURA_SURFACE_SET_INITIAL_WORKSPACE_SINCE_VERSION 23
972 /**
973  * @ingroup iface_zaura_surface
974  */
975 #define ZAURA_SURFACE_SET_PIN_SINCE_VERSION 25
976 /**
977  * @ingroup iface_zaura_surface
978  */
979 #define ZAURA_SURFACE_UNSET_PIN_SINCE_VERSION 25
980 /**
981  * @ingroup iface_zaura_surface
982  */
983 #define ZAURA_SURFACE_RELEASE_SINCE_VERSION 38
984 /**
985  * @ingroup iface_zaura_surface
986  */
987 #define ZAURA_SURFACE_SHOW_TOOLTIP_SINCE_VERSION 47
988 /**
989  * @ingroup iface_zaura_surface
990  */
991 #define ZAURA_SURFACE_HIDE_TOOLTIP_SINCE_VERSION 47
992 /**
993  * @ingroup iface_zaura_surface
994  */
995 #define ZAURA_SURFACE_SET_ACCESSIBILITY_ID_SINCE_VERSION 51
996 
997 /** @ingroup iface_zaura_surface */
998 static inline void
zaura_surface_set_user_data(struct zaura_surface * zaura_surface,void * user_data)999 zaura_surface_set_user_data(struct zaura_surface *zaura_surface, void *user_data)
1000 {
1001 	wl_proxy_set_user_data((struct wl_proxy *) zaura_surface, user_data);
1002 }
1003 
1004 /** @ingroup iface_zaura_surface */
1005 static inline void *
zaura_surface_get_user_data(struct zaura_surface * zaura_surface)1006 zaura_surface_get_user_data(struct zaura_surface *zaura_surface)
1007 {
1008 	return wl_proxy_get_user_data((struct wl_proxy *) zaura_surface);
1009 }
1010 
1011 static inline uint32_t
zaura_surface_get_version(struct zaura_surface * zaura_surface)1012 zaura_surface_get_version(struct zaura_surface *zaura_surface)
1013 {
1014 	return wl_proxy_get_version((struct wl_proxy *) zaura_surface);
1015 }
1016 
1017 /** @ingroup iface_zaura_surface */
1018 static inline void
zaura_surface_destroy(struct zaura_surface * zaura_surface)1019 zaura_surface_destroy(struct zaura_surface *zaura_surface)
1020 {
1021 	wl_proxy_destroy((struct wl_proxy *) zaura_surface);
1022 }
1023 
1024 /**
1025  * @ingroup iface_zaura_surface
1026  *
1027  * [Deprecated] Suggests a surface should use a specific frame. Deprecated
1028  * since M105. See the set_decoration method on zaura_toplevel and
1029  * zaura_popup.
1030  */
1031 static inline void
zaura_surface_set_frame(struct zaura_surface * zaura_surface,uint32_t type)1032 zaura_surface_set_frame(struct zaura_surface *zaura_surface, uint32_t type)
1033 {
1034 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1035 			 ZAURA_SURFACE_SET_FRAME, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, type);
1036 }
1037 
1038 /**
1039  * @ingroup iface_zaura_surface
1040  *
1041  * Set the "parent" of this surface. "x" and "y" arguments specify the
1042  * initial position for surface relative to parent.
1043  */
1044 static inline void
zaura_surface_set_parent(struct zaura_surface * zaura_surface,struct zaura_surface * parent,int32_t x,int32_t y)1045 zaura_surface_set_parent(struct zaura_surface *zaura_surface, struct zaura_surface *parent, int32_t x, int32_t y)
1046 {
1047 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1048 			 ZAURA_SURFACE_SET_PARENT, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, parent, x, y);
1049 }
1050 
1051 /**
1052  * @ingroup iface_zaura_surface
1053  *
1054  * Set the frame colors. This must be set before the initial
1055  * commit first, otherwise the subsequent request may not be
1056  * fulfilled.
1057  */
1058 static inline void
zaura_surface_set_frame_colors(struct zaura_surface * zaura_surface,uint32_t active_color,uint32_t inactive_color)1059 zaura_surface_set_frame_colors(struct zaura_surface *zaura_surface, uint32_t active_color, uint32_t inactive_color)
1060 {
1061 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1062 			 ZAURA_SURFACE_SET_FRAME_COLORS, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, active_color, inactive_color);
1063 }
1064 
1065 /**
1066  * @ingroup iface_zaura_surface
1067  *
1068  * Set the startup ID.
1069  */
1070 static inline void
zaura_surface_set_startup_id(struct zaura_surface * zaura_surface,const char * startup_id)1071 zaura_surface_set_startup_id(struct zaura_surface *zaura_surface, const char *startup_id)
1072 {
1073 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1074 			 ZAURA_SURFACE_SET_STARTUP_ID, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, startup_id);
1075 }
1076 
1077 /**
1078  * @ingroup iface_zaura_surface
1079  *
1080  * Set the application ID.
1081  */
1082 static inline void
zaura_surface_set_application_id(struct zaura_surface * zaura_surface,const char * application_id)1083 zaura_surface_set_application_id(struct zaura_surface *zaura_surface, const char *application_id)
1084 {
1085 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1086 			 ZAURA_SURFACE_SET_APPLICATION_ID, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, application_id);
1087 }
1088 
1089 /**
1090  * @ingroup iface_zaura_surface
1091  *
1092  * Deprecated. Please use set_client_surface_str_id instead.
1093  * Set the identifier of the surface assigned by the client.
1094  */
1095 static inline void
zaura_surface_set_client_surface_id(struct zaura_surface * zaura_surface,int32_t client_surface_id)1096 zaura_surface_set_client_surface_id(struct zaura_surface *zaura_surface, int32_t client_surface_id)
1097 {
1098 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1099 			 ZAURA_SURFACE_SET_CLIENT_SURFACE_ID, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, client_surface_id);
1100 }
1101 
1102 /**
1103  * @ingroup iface_zaura_surface
1104  *
1105  * Sets occlusion tracking on this surface. The client will be updated with a
1106  * new occlusion fraction when the amount of occlusion of this surface changes.
1107  */
1108 static inline void
zaura_surface_set_occlusion_tracking(struct zaura_surface * zaura_surface)1109 zaura_surface_set_occlusion_tracking(struct zaura_surface *zaura_surface)
1110 {
1111 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1112 			 ZAURA_SURFACE_SET_OCCLUSION_TRACKING, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1113 }
1114 
1115 /**
1116  * @ingroup iface_zaura_surface
1117  *
1118  * Unsets occlusion tracking for this surface.
1119  */
1120 static inline void
zaura_surface_unset_occlusion_tracking(struct zaura_surface * zaura_surface)1121 zaura_surface_unset_occlusion_tracking(struct zaura_surface *zaura_surface)
1122 {
1123 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1124 			 ZAURA_SURFACE_UNSET_OCCLUSION_TRACKING, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1125 }
1126 
1127 /**
1128  * @ingroup iface_zaura_surface
1129  *
1130  * [Deprecated] Make this the active window. This usually implies something
1131  * like restacking this surface to the foreground. The compositor is free
1132  * to ignore this request if it deems the client to be misbehaving.
1133  * Typically this request will only be honoured in response to some user
1134  * driven event, such as executing an application or opening a file in a
1135  * window that already exists.
1136  */
1137 static inline void
zaura_surface_activate(struct zaura_surface * zaura_surface)1138 zaura_surface_activate(struct zaura_surface *zaura_surface)
1139 {
1140 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1141 			 ZAURA_SURFACE_ACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1142 }
1143 
1144 /**
1145  * @ingroup iface_zaura_surface
1146  *
1147  * Draw attention to this surface in a way that does not change the user's
1148  * focus. This usually means animating window decorations or taskbar icons.
1149  * The compositor can still ignore this request if it deems fit, but unlike
1150  * draw_focus, these requests are expected to come from background tasks,
1151  * and are more likely to be honoured.
1152  */
1153 static inline void
zaura_surface_draw_attention(struct zaura_surface * zaura_surface)1154 zaura_surface_draw_attention(struct zaura_surface *zaura_surface)
1155 {
1156 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1157 			 ZAURA_SURFACE_DRAW_ATTENTION, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1158 }
1159 
1160 /**
1161  * @ingroup iface_zaura_surface
1162  *
1163  * [Deprecated] Use the set_fullscreen_mode in the toplevel interface.
1164  * Suggests how the windowing system should behave if this surface were
1165  * to go fullscreen. Does not make the surface fullscreen.
1166  *
1167  * Typically the default mode is "immersive".
1168  */
1169 static inline void
zaura_surface_set_fullscreen_mode(struct zaura_surface * zaura_surface,uint32_t mode)1170 zaura_surface_set_fullscreen_mode(struct zaura_surface *zaura_surface, uint32_t mode)
1171 {
1172 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1173 			 ZAURA_SURFACE_SET_FULLSCREEN_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, mode);
1174 }
1175 
1176 /**
1177  * @ingroup iface_zaura_surface
1178  *
1179  * Set the identifier of the surface assigned by the client.
1180  */
1181 static inline void
zaura_surface_set_client_surface_str_id(struct zaura_surface * zaura_surface,const char * client_surface_id)1182 zaura_surface_set_client_surface_str_id(struct zaura_surface *zaura_surface, const char *client_surface_id)
1183 {
1184 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1185 			 ZAURA_SURFACE_SET_CLIENT_SURFACE_STR_ID, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, client_surface_id);
1186 }
1187 
1188 /**
1189  * @ingroup iface_zaura_surface
1190  *
1191  * Suggests a surface to have client-side decoration, but
1192  * server-side decides when and where to start the resize. The server may also
1193  * apply visual effects to indicate that the resize operation is ongoing.
1194  */
1195 static inline void
zaura_surface_set_server_start_resize(struct zaura_surface * zaura_surface)1196 zaura_surface_set_server_start_resize(struct zaura_surface *zaura_surface)
1197 {
1198 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1199 			 ZAURA_SURFACE_SET_SERVER_START_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1200 }
1201 
1202 /**
1203  * @ingroup iface_zaura_surface
1204  *
1205  * [Deprecated] Use intent_to_snap on zaura_toplevel.
1206  * Notify (or inform) the server the client's intent to snap the window.
1207  * To inform it's no longer willing to snap, send 'none'.
1208  */
1209 static inline void
zaura_surface_intent_to_snap(struct zaura_surface * zaura_surface,uint32_t direction)1210 zaura_surface_intent_to_snap(struct zaura_surface *zaura_surface, uint32_t direction)
1211 {
1212 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1213 			 ZAURA_SURFACE_INTENT_TO_SNAP, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, direction);
1214 }
1215 
1216 /**
1217  * @ingroup iface_zaura_surface
1218  *
1219  * [Deprecated] Use set_snap_primary on zaura_toplevel.
1220  * Request that surface is snapped to the left.
1221  */
1222 static inline void
zaura_surface_set_snap_left(struct zaura_surface * zaura_surface)1223 zaura_surface_set_snap_left(struct zaura_surface *zaura_surface)
1224 {
1225 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1226 			 ZAURA_SURFACE_SET_SNAP_LEFT, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1227 }
1228 
1229 /**
1230  * @ingroup iface_zaura_surface
1231  *
1232  * [Deprecated] Use set_snap_secondary on zaura_toplevel.
1233  * Request that surface is snapped to the right.
1234  */
1235 static inline void
zaura_surface_set_snap_right(struct zaura_surface * zaura_surface)1236 zaura_surface_set_snap_right(struct zaura_surface *zaura_surface)
1237 {
1238 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1239 			 ZAURA_SURFACE_SET_SNAP_RIGHT, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1240 }
1241 
1242 /**
1243  * @ingroup iface_zaura_surface
1244  *
1245  * [Deprecated] Use unset_snap on zaura_toplevel.
1246  * Request that surface resets snapping.
1247  */
1248 static inline void
zaura_surface_unset_snap(struct zaura_surface * zaura_surface)1249 zaura_surface_unset_snap(struct zaura_surface *zaura_surface)
1250 {
1251 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1252 			 ZAURA_SURFACE_UNSET_SNAP, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1253 }
1254 
1255 /**
1256  * @ingroup iface_zaura_surface
1257  *
1258  * Set window session id to the surface.
1259  */
1260 static inline void
zaura_surface_set_window_session_id(struct zaura_surface * zaura_surface,int32_t id)1261 zaura_surface_set_window_session_id(struct zaura_surface *zaura_surface, int32_t id)
1262 {
1263 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1264 			 ZAURA_SURFACE_SET_WINDOW_SESSION_ID, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, id);
1265 }
1266 
1267 /**
1268  * @ingroup iface_zaura_surface
1269  *
1270  * Sets that the surface can go back as per its navigation list.
1271  * This allows the server to react to by minimizing the window upon a
1272  * system wide back gesture.
1273  */
1274 static inline void
zaura_surface_set_can_go_back(struct zaura_surface * zaura_surface)1275 zaura_surface_set_can_go_back(struct zaura_surface *zaura_surface)
1276 {
1277 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1278 			 ZAURA_SURFACE_SET_CAN_GO_BACK, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1279 }
1280 
1281 /**
1282  * @ingroup iface_zaura_surface
1283  *
1284  * Unsets that the surface can go back as per its navigation list.
1285  * See above.
1286  */
1287 static inline void
zaura_surface_unset_can_go_back(struct zaura_surface * zaura_surface)1288 zaura_surface_unset_can_go_back(struct zaura_surface *zaura_surface)
1289 {
1290 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1291 			 ZAURA_SURFACE_UNSET_CAN_GO_BACK, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1292 }
1293 
1294 /**
1295  * @ingroup iface_zaura_surface
1296  *
1297  * Requests that the surface is set to Picture-in-Picture (PIP).
1298  */
1299 static inline void
zaura_surface_set_pip(struct zaura_surface * zaura_surface)1300 zaura_surface_set_pip(struct zaura_surface *zaura_surface)
1301 {
1302 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1303 			 ZAURA_SURFACE_SET_PIP, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1304 }
1305 
1306 /**
1307  * @ingroup iface_zaura_surface
1308  *
1309  * Requests that the surface is unset from Picture-in-Picture (PIP).
1310  */
1311 static inline void
zaura_surface_unset_pip(struct zaura_surface * zaura_surface)1312 zaura_surface_unset_pip(struct zaura_surface *zaura_surface)
1313 {
1314 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1315 			 ZAURA_SURFACE_UNSET_PIP, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1316 }
1317 
1318 /**
1319  * @ingroup iface_zaura_surface
1320  *
1321  * Sets the aspect ratio of the surface.
1322  */
1323 static inline void
zaura_surface_set_aspect_ratio(struct zaura_surface * zaura_surface,int32_t width,int32_t height)1324 zaura_surface_set_aspect_ratio(struct zaura_surface *zaura_surface, int32_t width, int32_t height)
1325 {
1326 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1327 			 ZAURA_SURFACE_SET_ASPECT_RATIO, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, width, height);
1328 }
1329 
1330 /**
1331  * @ingroup iface_zaura_surface
1332  *
1333  * If |index| equals -1, requests that the server toggles whether client
1334  * is visible on all workspaces.
1335  * If |index| is not -1, requests that the server moves the client to the desk at
1336  * |index|.
1337  */
1338 static inline void
zaura_surface_move_to_desk(struct zaura_surface * zaura_surface,int32_t index)1339 zaura_surface_move_to_desk(struct zaura_surface *zaura_surface, int32_t index)
1340 {
1341 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1342 			 ZAURA_SURFACE_MOVE_TO_DESK, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, index);
1343 }
1344 
1345 /**
1346  * @ingroup iface_zaura_surface
1347  *
1348  * If |initial_workspace| equals '-1', a window is restored and visible on all workspaces,
1349  * Otherwise, set the initial workspace to restore the window to the corresponding workspace.
1350  * This is not double buffered and must be set before attaching a buffer.
1351  */
1352 static inline void
zaura_surface_set_initial_workspace(struct zaura_surface * zaura_surface,const char * initial_workspace)1353 zaura_surface_set_initial_workspace(struct zaura_surface *zaura_surface, const char *initial_workspace)
1354 {
1355 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1356 			 ZAURA_SURFACE_SET_INITIAL_WORKSPACE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, initial_workspace);
1357 }
1358 
1359 /**
1360  * @ingroup iface_zaura_surface
1361  *
1362  * Requests that a window is pinned which means that the system does not allow
1363  * the user to leave the window until an exit criteria is met.
1364  *
1365  * This is a request to get the window pinned so that the user cannot get to any
1366  * other window / application. There are two modes:
1367  * A. trusted is 0 - which is slightly less restrictive and allows the user to
1368  * get out of the window by a predefined way of authentication.
1369  * B. trusted is not 0 in which case a trusted application was locking down the
1370  * system and needs to unlock. This is used for e.g. School tests.
1371  */
1372 static inline void
zaura_surface_set_pin(struct zaura_surface * zaura_surface,int32_t trusted)1373 zaura_surface_set_pin(struct zaura_surface *zaura_surface, int32_t trusted)
1374 {
1375 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1376 			 ZAURA_SURFACE_SET_PIN, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, trusted);
1377 }
1378 
1379 /**
1380  * @ingroup iface_zaura_surface
1381  *
1382  * Requests that the user can leave a previously pinned window.
1383  *
1384  * This is a request to unpin a previously pinned window. It does not matter if
1385  * the window was locked with the trusted state or not.
1386  */
1387 static inline void
zaura_surface_unset_pin(struct zaura_surface * zaura_surface)1388 zaura_surface_unset_pin(struct zaura_surface *zaura_surface)
1389 {
1390 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1391 			 ZAURA_SURFACE_UNSET_PIN, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1392 }
1393 
1394 /**
1395  * @ingroup iface_zaura_surface
1396  *
1397  * Destroy the zaura_surface object. A client should destroy this object when the
1398  * role is unmapped from a wl_surface.
1399  *
1400  * See zaura_shell.release for destructor naming.
1401  */
1402 static inline void
zaura_surface_release(struct zaura_surface * zaura_surface)1403 zaura_surface_release(struct zaura_surface *zaura_surface)
1404 {
1405 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1406 			 ZAURA_SURFACE_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), WL_MARSHAL_FLAG_DESTROY);
1407 }
1408 
1409 /**
1410  * @ingroup iface_zaura_surface
1411  *
1412  * Show tooltip on server side.
1413  * `x` and `y` specifies the location of tooltip in surface local coordinates.
1414  * `hide_delay` and `show_delay` specify the time to wait until showing/hiding tooltip.
1415  * The unit is millisecond.
1416  */
1417 static inline void
zaura_surface_show_tooltip(struct zaura_surface * zaura_surface,const char * text,int32_t x,int32_t y,uint32_t tooltip_trigger,uint32_t show_delay,uint32_t hide_delay)1418 zaura_surface_show_tooltip(struct zaura_surface *zaura_surface, const char *text, int32_t x, int32_t y, uint32_t tooltip_trigger, uint32_t show_delay, uint32_t hide_delay)
1419 {
1420 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1421 			 ZAURA_SURFACE_SHOW_TOOLTIP, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, text, x, y, tooltip_trigger, show_delay, hide_delay);
1422 }
1423 
1424 /**
1425  * @ingroup iface_zaura_surface
1426  *
1427  * Hide tooltip created by the same client on server side.
1428  * This may be called even when there is no tooltip window to hide.
1429  */
1430 static inline void
zaura_surface_hide_tooltip(struct zaura_surface * zaura_surface)1431 zaura_surface_hide_tooltip(struct zaura_surface *zaura_surface)
1432 {
1433 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1434 			 ZAURA_SURFACE_HIDE_TOOLTIP, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0);
1435 }
1436 
1437 /**
1438  * @ingroup iface_zaura_surface
1439  *
1440  * Set accessibility window ID to the surface. A negative number removes
1441  * the existing accessibility ID from the surface.
1442  */
1443 static inline void
zaura_surface_set_accessibility_id(struct zaura_surface * zaura_surface,int32_t id)1444 zaura_surface_set_accessibility_id(struct zaura_surface *zaura_surface, int32_t id)
1445 {
1446 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_surface,
1447 			 ZAURA_SURFACE_SET_ACCESSIBILITY_ID, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_surface), 0, id);
1448 }
1449 
1450 #ifndef ZAURA_OUTPUT_SCALE_PROPERTY_ENUM
1451 #define ZAURA_OUTPUT_SCALE_PROPERTY_ENUM
1452 /**
1453  * @ingroup iface_zaura_output
1454  * scale information
1455  *
1456  * These flags describe properties of an output scale.
1457  * They are used in the flags bitfield of the scale event.
1458  */
1459 enum zaura_output_scale_property {
1460 	/**
1461 	 * indicates this is the current scale
1462 	 */
1463 	ZAURA_OUTPUT_SCALE_PROPERTY_CURRENT = 0x1,
1464 	/**
1465 	 * indicates this is the preferred scale
1466 	 */
1467 	ZAURA_OUTPUT_SCALE_PROPERTY_PREFERRED = 0x2,
1468 };
1469 #endif /* ZAURA_OUTPUT_SCALE_PROPERTY_ENUM */
1470 
1471 #ifndef ZAURA_OUTPUT_SCALE_FACTOR_ENUM
1472 #define ZAURA_OUTPUT_SCALE_FACTOR_ENUM
1473 enum zaura_output_scale_factor {
1474 	ZAURA_OUTPUT_SCALE_FACTOR_0400 = 400,
1475 	ZAURA_OUTPUT_SCALE_FACTOR_0500 = 500,
1476 	ZAURA_OUTPUT_SCALE_FACTOR_0550 = 550,
1477 	ZAURA_OUTPUT_SCALE_FACTOR_0600 = 600,
1478 	ZAURA_OUTPUT_SCALE_FACTOR_0625 = 625,
1479 	ZAURA_OUTPUT_SCALE_FACTOR_0650 = 650,
1480 	ZAURA_OUTPUT_SCALE_FACTOR_0700 = 700,
1481 	ZAURA_OUTPUT_SCALE_FACTOR_0750 = 750,
1482 	ZAURA_OUTPUT_SCALE_FACTOR_0800 = 800,
1483 	ZAURA_OUTPUT_SCALE_FACTOR_0850 = 850,
1484 	ZAURA_OUTPUT_SCALE_FACTOR_0900 = 900,
1485 	ZAURA_OUTPUT_SCALE_FACTOR_0950 = 950,
1486 	ZAURA_OUTPUT_SCALE_FACTOR_1000 = 1000,
1487 	ZAURA_OUTPUT_SCALE_FACTOR_1050 = 1050,
1488 	ZAURA_OUTPUT_SCALE_FACTOR_1100 = 1100,
1489 	ZAURA_OUTPUT_SCALE_FACTOR_1150 = 1150,
1490 	ZAURA_OUTPUT_SCALE_FACTOR_1125 = 1125,
1491 	ZAURA_OUTPUT_SCALE_FACTOR_1200 = 1200,
1492 	ZAURA_OUTPUT_SCALE_FACTOR_1250 = 1250,
1493 	ZAURA_OUTPUT_SCALE_FACTOR_1300 = 1300,
1494 	ZAURA_OUTPUT_SCALE_FACTOR_1400 = 1400,
1495 	ZAURA_OUTPUT_SCALE_FACTOR_1450 = 1450,
1496 	ZAURA_OUTPUT_SCALE_FACTOR_1500 = 1500,
1497 	ZAURA_OUTPUT_SCALE_FACTOR_1600 = 1600,
1498 	ZAURA_OUTPUT_SCALE_FACTOR_1750 = 1750,
1499 	ZAURA_OUTPUT_SCALE_FACTOR_1800 = 1800,
1500 	ZAURA_OUTPUT_SCALE_FACTOR_2000 = 2000,
1501 	ZAURA_OUTPUT_SCALE_FACTOR_2200 = 2200,
1502 	ZAURA_OUTPUT_SCALE_FACTOR_2250 = 2250,
1503 	ZAURA_OUTPUT_SCALE_FACTOR_2500 = 2500,
1504 	ZAURA_OUTPUT_SCALE_FACTOR_2750 = 2750,
1505 	ZAURA_OUTPUT_SCALE_FACTOR_3000 = 3000,
1506 	ZAURA_OUTPUT_SCALE_FACTOR_3500 = 3500,
1507 	ZAURA_OUTPUT_SCALE_FACTOR_4000 = 4000,
1508 	ZAURA_OUTPUT_SCALE_FACTOR_4500 = 4500,
1509 	ZAURA_OUTPUT_SCALE_FACTOR_5000 = 5000,
1510 };
1511 #endif /* ZAURA_OUTPUT_SCALE_FACTOR_ENUM */
1512 
1513 #ifndef ZAURA_OUTPUT_CONNECTION_TYPE_ENUM
1514 #define ZAURA_OUTPUT_CONNECTION_TYPE_ENUM
1515 enum zaura_output_connection_type {
1516 	ZAURA_OUTPUT_CONNECTION_TYPE_UNKNOWN = 0,
1517 	ZAURA_OUTPUT_CONNECTION_TYPE_INTERNAL = 1,
1518 };
1519 #endif /* ZAURA_OUTPUT_CONNECTION_TYPE_ENUM */
1520 
1521 /**
1522  * @ingroup iface_zaura_output
1523  * @struct zaura_output_listener
1524  */
1525 struct zaura_output_listener {
1526 	/**
1527 	 * advertise available scales for the output
1528 	 *
1529 	 * The scale event describes an available scale for the output.
1530 	 *
1531 	 * The event is sent when binding to the output object and there
1532 	 * will always be one scale, the current scale. The event is sent
1533 	 * again if an output changes scale, for the scale that is now
1534 	 * current. In other words, the current scale is always the last
1535 	 * scale that was received with the current flag set.
1536 	 * @param flags bitfield of scale flags
1537 	 * @param scale output scale
1538 	 * @since 2
1539 	 */
1540 	void (*scale)(void *data,
1541 		      struct zaura_output *zaura_output,
1542 		      uint32_t flags,
1543 		      uint32_t scale);
1544 	/**
1545 	 * advertise connection for the output
1546 	 *
1547 	 * The connection event describes how the output is connected.
1548 	 *
1549 	 * The event is sent when binding to the output object.
1550 	 * @param connection output connection
1551 	 * @since 5
1552 	 */
1553 	void (*connection)(void *data,
1554 			   struct zaura_output *zaura_output,
1555 			   uint32_t connection);
1556 	/**
1557 	 * advertise device scale factor for the output
1558 	 *
1559 	 * This event describes the device specific scale factor for the
1560 	 * output.
1561 	 *
1562 	 * The device specific scale factor is not expected the change
1563 	 * during the lifetime of the output. And it is not limited to an
1564 	 * integer value like the scale factor provided by wl_output
1565 	 * interface. The exact contents scale used by the compositor can
1566 	 * be determined by combining this device scale factor with the
1567 	 * current output scale.
1568 	 *
1569 	 * The event is sent when binding to the output object.
1570 	 * @param scale output device scale factor
1571 	 * @since 5
1572 	 */
1573 	void (*device_scale_factor)(void *data,
1574 				    struct zaura_output *zaura_output,
1575 				    uint32_t scale);
1576 	/**
1577 	 * advertise the work area insets for the output
1578 	 *
1579 	 * This event describes the insets for the output in logical
1580 	 * screen coordinates, from which the work area can be calculated.
1581 	 *
1582 	 * This event is sent before wl_output.done, after which the client
1583 	 * would apply the change.
1584 	 * @since 33
1585 	 */
1586 	void (*insets)(void *data,
1587 		       struct zaura_output *zaura_output,
1588 		       int32_t top,
1589 		       int32_t left,
1590 		       int32_t bottom,
1591 		       int32_t right);
1592 	/**
1593 	 * advertise the output's logical transform
1594 	 *
1595 	 * This event describes the logical transform for the output.
1596 	 * Whereas wl_output.geometry's transform corresponds to the
1597 	 * display's panel rotation, the logical transform corresponds to
1598 	 * the display's logical rotation.
1599 	 *
1600 	 * This event is sent before wl_output.done, after which the client
1601 	 * would apply the change.
1602 	 * @since 34
1603 	 */
1604 	void (*logical_transform)(void *data,
1605 				  struct zaura_output *zaura_output,
1606 				  int32_t transform);
1607 	/**
1608 	 * advertise the output's display id
1609 	 *
1610 	 * This event describes the 64bit display id assigned to each
1611 	 * display by ChromeOS. The value is opaque and should not be
1612 	 * interpreted.
1613 	 * @since 43
1614 	 */
1615 	void (*display_id)(void *data,
1616 			   struct zaura_output *zaura_output,
1617 			   uint32_t display_id_hi,
1618 			   uint32_t display_id_lo);
1619 	/**
1620 	 * target display for new windows
1621 	 *
1622 	 * Notifies that this output is now active output. It is
1623 	 * typically used as a target when a new window is created without
1624 	 * specific bounds.
1625 	 * @since 45
1626 	 */
1627 	void (*activated)(void *data,
1628 			  struct zaura_output *zaura_output);
1629 };
1630 
1631 /**
1632  * @ingroup iface_zaura_output
1633  */
1634 static inline int
zaura_output_add_listener(struct zaura_output * zaura_output,const struct zaura_output_listener * listener,void * data)1635 zaura_output_add_listener(struct zaura_output *zaura_output,
1636 			  const struct zaura_output_listener *listener, void *data)
1637 {
1638 	return wl_proxy_add_listener((struct wl_proxy *) zaura_output,
1639 				     (void (**)(void)) listener, data);
1640 }
1641 
1642 #define ZAURA_OUTPUT_RELEASE 0
1643 
1644 /**
1645  * @ingroup iface_zaura_output
1646  */
1647 #define ZAURA_OUTPUT_SCALE_SINCE_VERSION 2
1648 /**
1649  * @ingroup iface_zaura_output
1650  */
1651 #define ZAURA_OUTPUT_CONNECTION_SINCE_VERSION 5
1652 /**
1653  * @ingroup iface_zaura_output
1654  */
1655 #define ZAURA_OUTPUT_DEVICE_SCALE_FACTOR_SINCE_VERSION 5
1656 /**
1657  * @ingroup iface_zaura_output
1658  */
1659 #define ZAURA_OUTPUT_INSETS_SINCE_VERSION 33
1660 /**
1661  * @ingroup iface_zaura_output
1662  */
1663 #define ZAURA_OUTPUT_LOGICAL_TRANSFORM_SINCE_VERSION 34
1664 /**
1665  * @ingroup iface_zaura_output
1666  */
1667 #define ZAURA_OUTPUT_DISPLAY_ID_SINCE_VERSION 43
1668 /**
1669  * @ingroup iface_zaura_output
1670  */
1671 #define ZAURA_OUTPUT_ACTIVATED_SINCE_VERSION 45
1672 
1673 /**
1674  * @ingroup iface_zaura_output
1675  */
1676 #define ZAURA_OUTPUT_RELEASE_SINCE_VERSION 38
1677 
1678 /** @ingroup iface_zaura_output */
1679 static inline void
zaura_output_set_user_data(struct zaura_output * zaura_output,void * user_data)1680 zaura_output_set_user_data(struct zaura_output *zaura_output, void *user_data)
1681 {
1682 	wl_proxy_set_user_data((struct wl_proxy *) zaura_output, user_data);
1683 }
1684 
1685 /** @ingroup iface_zaura_output */
1686 static inline void *
zaura_output_get_user_data(struct zaura_output * zaura_output)1687 zaura_output_get_user_data(struct zaura_output *zaura_output)
1688 {
1689 	return wl_proxy_get_user_data((struct wl_proxy *) zaura_output);
1690 }
1691 
1692 static inline uint32_t
zaura_output_get_version(struct zaura_output * zaura_output)1693 zaura_output_get_version(struct zaura_output *zaura_output)
1694 {
1695 	return wl_proxy_get_version((struct wl_proxy *) zaura_output);
1696 }
1697 
1698 /** @ingroup iface_zaura_output */
1699 static inline void
zaura_output_destroy(struct zaura_output * zaura_output)1700 zaura_output_destroy(struct zaura_output *zaura_output)
1701 {
1702 	wl_proxy_destroy((struct wl_proxy *) zaura_output);
1703 }
1704 
1705 /**
1706  * @ingroup iface_zaura_output
1707  *
1708  * Destroy this zaura_shell object.
1709  *
1710  * Destroying a bound zaura_shell object while there are zaura_surfaces
1711  * still alive created by this zaura_shell object instance is illegal
1712  * and will result in a protocol error.
1713  *
1714  * See zaura_shell.release for destructor naming.
1715  */
1716 static inline void
zaura_output_release(struct zaura_output * zaura_output)1717 zaura_output_release(struct zaura_output *zaura_output)
1718 {
1719 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_output,
1720 			 ZAURA_OUTPUT_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_output), WL_MARSHAL_FLAG_DESTROY);
1721 }
1722 
1723 #ifndef ZAURA_TOPLEVEL_ORIENTATION_LOCK_ENUM
1724 #define ZAURA_TOPLEVEL_ORIENTATION_LOCK_ENUM
1725 /**
1726  * @ingroup iface_zaura_toplevel
1727  * orientation lock request
1728  *
1729  * Defines orientation request when a surface is in fullscreen.
1730  */
1731 enum zaura_toplevel_orientation_lock {
1732 	/**
1733 	 * no orientation lock
1734 	 */
1735 	ZAURA_TOPLEVEL_ORIENTATION_LOCK_NONE = 1,
1736 	/**
1737 	 * primary or secondary portrait
1738 	 */
1739 	ZAURA_TOPLEVEL_ORIENTATION_LOCK_PORTRAIT = 2,
1740 	/**
1741 	 * primary or secondary landscape
1742 	 */
1743 	ZAURA_TOPLEVEL_ORIENTATION_LOCK_LANDSCAPE = 3,
1744 	/**
1745 	 * keep current orientation
1746 	 */
1747 	ZAURA_TOPLEVEL_ORIENTATION_LOCK_CURRENT = 4,
1748 	/**
1749 	 * primary portrait
1750 	 */
1751 	ZAURA_TOPLEVEL_ORIENTATION_LOCK_PORTRAIT_PRIMARY = 5,
1752 	/**
1753 	 * primary landscape
1754 	 */
1755 	ZAURA_TOPLEVEL_ORIENTATION_LOCK_LANDSCAPE_PRIMARY = 6,
1756 	/**
1757 	 * secondary portrait
1758 	 */
1759 	ZAURA_TOPLEVEL_ORIENTATION_LOCK_PORTRAIT_SECONDARY = 7,
1760 	/**
1761 	 * secondary landscape
1762 	 */
1763 	ZAURA_TOPLEVEL_ORIENTATION_LOCK_LANDSCAPE_SECONDARY = 8,
1764 };
1765 #endif /* ZAURA_TOPLEVEL_ORIENTATION_LOCK_ENUM */
1766 
1767 #ifndef ZAURA_TOPLEVEL_STATE_ENUM
1768 #define ZAURA_TOPLEVEL_STATE_ENUM
1769 /**
1770  * @ingroup iface_zaura_toplevel
1771  * supplemental aura states to xdg states
1772  *
1773  * The states that are contained here are supplemental to the states
1774  * defined in the XDG shell and specific aura windows.
1775  */
1776 enum zaura_toplevel_state {
1777 	/**
1778 	 * immersive mode with hidden title bar and shelf
1779 	 *
1780 	 * User can access system UIs such as the shelf and window frame
1781 	 * by pointing to, or swiping over, the screen edge.
1782 	 * @since 36
1783 	 */
1784 	ZAURA_TOPLEVEL_STATE_IMMERSIVE = 100,
1785 	/**
1786 	 * surface is minimized
1787 	 *
1788 	 * The window has been minimized.
1789 	 * @since 36
1790 	 */
1791 	ZAURA_TOPLEVEL_STATE_MINIMIZED = 101,
1792 	/**
1793 	 * window is snapped in primary position
1794 	 *
1795 	 * The window is snapped to the left if the display is in
1796 	 * landscape mode and at the top in portrait mode.
1797 	 * @since 38
1798 	 */
1799 	ZAURA_TOPLEVEL_STATE_SNAPPED_PRIMARY = 102,
1800 	/**
1801 	 * window is snapped in secondary position
1802 	 *
1803 	 * The window is snapped to the right if the display is in
1804 	 * landscape mode and at the bottom in portrait mode.
1805 	 * @since 38
1806 	 */
1807 	ZAURA_TOPLEVEL_STATE_SNAPPED_SECONDARY = 103,
1808 	/**
1809 	 * window is floated on top
1810 	 *
1811 	 * The window is floated on top of other windows. One floated
1812 	 * window is allowed per desk. Floating a window when there is
1813 	 * already a floated window on the same desk will unfloat the
1814 	 * floated window.
1815 	 * @since 38
1816 	 */
1817 	ZAURA_TOPLEVEL_STATE_FLOATED = 104,
1818 	/**
1819 	 * window is PiP
1820 	 *
1821 	 * The window is in PiP mode.
1822 	 * @since 54
1823 	 */
1824 	ZAURA_TOPLEVEL_STATE_PIP = 105,
1825 	/**
1826 	 * window is pinned
1827 	 *
1828 	 * The window is pinned.
1829 	 * @since 64
1830 	 */
1831 	ZAURA_TOPLEVEL_STATE_PINNED = 106,
1832 	/**
1833 	 * window is trusted pinned
1834 	 *
1835 	 * The window is trusted pinned.
1836 	 * @since 64
1837 	 */
1838 	ZAURA_TOPLEVEL_STATE_TRUSTED_PINNED = 107,
1839 };
1840 /**
1841  * @ingroup iface_zaura_toplevel
1842  */
1843 #define ZAURA_TOPLEVEL_STATE_IMMERSIVE_SINCE_VERSION 36
1844 /**
1845  * @ingroup iface_zaura_toplevel
1846  */
1847 #define ZAURA_TOPLEVEL_STATE_MINIMIZED_SINCE_VERSION 36
1848 /**
1849  * @ingroup iface_zaura_toplevel
1850  */
1851 #define ZAURA_TOPLEVEL_STATE_SNAPPED_PRIMARY_SINCE_VERSION 38
1852 /**
1853  * @ingroup iface_zaura_toplevel
1854  */
1855 #define ZAURA_TOPLEVEL_STATE_SNAPPED_SECONDARY_SINCE_VERSION 38
1856 /**
1857  * @ingroup iface_zaura_toplevel
1858  */
1859 #define ZAURA_TOPLEVEL_STATE_FLOATED_SINCE_VERSION 38
1860 /**
1861  * @ingroup iface_zaura_toplevel
1862  */
1863 #define ZAURA_TOPLEVEL_STATE_PIP_SINCE_VERSION 54
1864 /**
1865  * @ingroup iface_zaura_toplevel
1866  */
1867 #define ZAURA_TOPLEVEL_STATE_PINNED_SINCE_VERSION 64
1868 /**
1869  * @ingroup iface_zaura_toplevel
1870  */
1871 #define ZAURA_TOPLEVEL_STATE_TRUSTED_PINNED_SINCE_VERSION 64
1872 #endif /* ZAURA_TOPLEVEL_STATE_ENUM */
1873 
1874 #ifndef ZAURA_TOPLEVEL_DECORATION_TYPE_ENUM
1875 #define ZAURA_TOPLEVEL_DECORATION_TYPE_ENUM
1876 /**
1877  * @ingroup iface_zaura_toplevel
1878  * different decoration types
1879  *
1880  * Decoration types are used to modify the surface (e.g. drop shadow).
1881  */
1882 enum zaura_toplevel_decoration_type {
1883 	/**
1884 	 * no frame
1885 	 */
1886 	ZAURA_TOPLEVEL_DECORATION_TYPE_NONE = 0,
1887 	/**
1888 	 * caption with shadow
1889 	 */
1890 	ZAURA_TOPLEVEL_DECORATION_TYPE_NORMAL = 1,
1891 	/**
1892 	 * shadow only
1893 	 */
1894 	ZAURA_TOPLEVEL_DECORATION_TYPE_SHADOW = 2,
1895 };
1896 #endif /* ZAURA_TOPLEVEL_DECORATION_TYPE_ENUM */
1897 
1898 #ifndef ZAURA_TOPLEVEL_Z_ORDER_LEVEL_ENUM
1899 #define ZAURA_TOPLEVEL_Z_ORDER_LEVEL_ENUM
1900 /**
1901  * @ingroup iface_zaura_toplevel
1902  * z order levels for windows
1903  *
1904  * Different z order levels that are used to set the z order for a toplevel surface.
1905  */
1906 enum zaura_toplevel_z_order_level {
1907 	/**
1908 	 * the default level for windows
1909 	 */
1910 	ZAURA_TOPLEVEL_Z_ORDER_LEVEL_NORMAL = 0,
1911 	/**
1912 	 * a floating window z-ordered above other normal windows
1913 	 */
1914 	ZAURA_TOPLEVEL_Z_ORDER_LEVEL_FLOATING_WINDOW = 1,
1915 	/**
1916 	 * used to show non-window style UIs that are shown above floating windows
1917 	 */
1918 	ZAURA_TOPLEVEL_Z_ORDER_LEVEL_FLOATING_UI_ELEMENT = 2,
1919 	/**
1920 	 * cannot be interfered with or covered up
1921 	 */
1922 	ZAURA_TOPLEVEL_Z_ORDER_LEVEL_SECURITY_SURFACE = 3,
1923 };
1924 #endif /* ZAURA_TOPLEVEL_Z_ORDER_LEVEL_ENUM */
1925 
1926 #ifndef ZAURA_TOPLEVEL_FULLSCREEN_MODE_ENUM
1927 #define ZAURA_TOPLEVEL_FULLSCREEN_MODE_ENUM
1928 /**
1929  * @ingroup iface_zaura_toplevel
1930  * Specifies the behavior of the surface in fullscreen.
1931  *
1932  * Possible windowing system behaviors if this surface were to go
1933  * fullscreen.
1934  */
1935 enum zaura_toplevel_fullscreen_mode {
1936 	/**
1937 	 * user cannot access system UIs using mouse/touches
1938 	 */
1939 	ZAURA_TOPLEVEL_FULLSCREEN_MODE_PLAIN = 0,
1940 	/**
1941 	 * user can access system UIs such as the shelf and window frame           by pointing to, or swiping over, the screen edge
1942 	 */
1943 	ZAURA_TOPLEVEL_FULLSCREEN_MODE_IMMERSIVE = 1,
1944 };
1945 #endif /* ZAURA_TOPLEVEL_FULLSCREEN_MODE_ENUM */
1946 
1947 #ifndef ZAURA_TOPLEVEL_SNAP_DIRECTION_ENUM
1948 #define ZAURA_TOPLEVEL_SNAP_DIRECTION_ENUM
1949 /**
1950  * @ingroup iface_zaura_toplevel
1951  * window snap directions
1952  *
1953  * Window snap directions.
1954  */
1955 enum zaura_toplevel_snap_direction {
1956 	/**
1957 	 * unsnap the window
1958 	 */
1959 	ZAURA_TOPLEVEL_SNAP_DIRECTION_NONE = 0,
1960 	/**
1961 	 * snap the window to the left or         top in primary layout, right or bottom in secondary layout
1962 	 */
1963 	ZAURA_TOPLEVEL_SNAP_DIRECTION_PRIMARY = 1,
1964 	/**
1965 	 * snap the window to the right         or bottom in primary layout, top or left in secondary layout
1966 	 */
1967 	ZAURA_TOPLEVEL_SNAP_DIRECTION_SECONDARY = 2,
1968 };
1969 #endif /* ZAURA_TOPLEVEL_SNAP_DIRECTION_ENUM */
1970 
1971 #ifndef ZAURA_TOPLEVEL_PERSISTABLE_ENUM
1972 #define ZAURA_TOPLEVEL_PERSISTABLE_ENUM
1973 /**
1974  * @ingroup iface_zaura_toplevel
1975  * Describes whether or not the value is persistable
1976  *
1977  * Binary enum maps to boolean, describes whether or not a value is
1978  * persistable.
1979  */
1980 enum zaura_toplevel_persistable {
1981 	/**
1982 	 * the value is not persistable
1983 	 */
1984 	ZAURA_TOPLEVEL_PERSISTABLE_NOT_PERSISTABLE = 0,
1985 	/**
1986 	 * the value is persistable
1987 	 */
1988 	ZAURA_TOPLEVEL_PERSISTABLE_PERSISTABLE = 1,
1989 };
1990 #endif /* ZAURA_TOPLEVEL_PERSISTABLE_ENUM */
1991 
1992 #ifndef ZAURA_TOPLEVEL_ROTATE_DIRECTION_ENUM
1993 #define ZAURA_TOPLEVEL_ROTATE_DIRECTION_ENUM
1994 enum zaura_toplevel_rotate_direction {
1995 	ZAURA_TOPLEVEL_ROTATE_DIRECTION_BACKWARD = 0,
1996 	ZAURA_TOPLEVEL_ROTATE_DIRECTION_FORWARD = 1,
1997 };
1998 #endif /* ZAURA_TOPLEVEL_ROTATE_DIRECTION_ENUM */
1999 
2000 #ifndef ZAURA_TOPLEVEL_ROTATE_RESTART_STATE_ENUM
2001 #define ZAURA_TOPLEVEL_ROTATE_RESTART_STATE_ENUM
2002 enum zaura_toplevel_rotate_restart_state {
2003 	ZAURA_TOPLEVEL_ROTATE_RESTART_STATE_NO_RESTART = 0,
2004 	ZAURA_TOPLEVEL_ROTATE_RESTART_STATE_RESTART = 1,
2005 };
2006 #endif /* ZAURA_TOPLEVEL_ROTATE_RESTART_STATE_ENUM */
2007 
2008 #ifndef ZAURA_TOPLEVEL_ROTATE_HANDLED_STATE_ENUM
2009 #define ZAURA_TOPLEVEL_ROTATE_HANDLED_STATE_ENUM
2010 enum zaura_toplevel_rotate_handled_state {
2011 	ZAURA_TOPLEVEL_ROTATE_HANDLED_STATE_NOT_HANDLED = 0,
2012 	ZAURA_TOPLEVEL_ROTATE_HANDLED_STATE_HANDLED = 1,
2013 };
2014 #endif /* ZAURA_TOPLEVEL_ROTATE_HANDLED_STATE_ENUM */
2015 
2016 #ifndef ZAURA_TOPLEVEL_FLOAT_START_LOCATION_ENUM
2017 #define ZAURA_TOPLEVEL_FLOAT_START_LOCATION_ENUM
2018 /**
2019  * @ingroup iface_zaura_toplevel
2020  * Specifies the location of a surface that just got floated.
2021  *
2022  * Possible start locations if a surface gets floated.
2023  */
2024 enum zaura_toplevel_float_start_location {
2025 	/**
2026 	 * On float, surface goes to the bottom right of the work area. This is the default.
2027 	 */
2028 	ZAURA_TOPLEVEL_FLOAT_START_LOCATION_BOTTOM_RIGHT = 0,
2029 	/**
2030 	 * On float, surface goes to the bottom left of the work area.
2031 	 */
2032 	ZAURA_TOPLEVEL_FLOAT_START_LOCATION_BOTTOM_LEFT = 1,
2033 };
2034 #endif /* ZAURA_TOPLEVEL_FLOAT_START_LOCATION_ENUM */
2035 
2036 #ifndef ZAURA_TOPLEVEL_IN_OVERVIEW_ENUM
2037 #define ZAURA_TOPLEVEL_IN_OVERVIEW_ENUM
2038 /**
2039  * @ingroup iface_zaura_toplevel
2040  * Describes whether or not the value is in overview
2041  *
2042  * Binary enum maps to boolean, describes whether or not a value is in
2043  * overview.
2044  */
2045 enum zaura_toplevel_in_overview {
2046 	/**
2047 	 * the value is not in overview
2048 	 */
2049 	ZAURA_TOPLEVEL_IN_OVERVIEW_NOT_IN_OVERVIEW = 0,
2050 	/**
2051 	 * the value is in overview
2052 	 */
2053 	ZAURA_TOPLEVEL_IN_OVERVIEW_IN_OVERVIEW = 1,
2054 };
2055 #endif /* ZAURA_TOPLEVEL_IN_OVERVIEW_ENUM */
2056 
2057 /**
2058  * @ingroup iface_zaura_toplevel
2059  * @struct zaura_toplevel_listener
2060  */
2061 struct zaura_toplevel_listener {
2062 	/**
2063 	 * suggest a surface change
2064 	 *
2065 	 * A configuration change that also includes the window origin in
2066 	 * screen coordinates.
2067 	 * @since 29
2068 	 */
2069 	void (*configure)(void *data,
2070 			  struct zaura_toplevel *zaura_toplevel,
2071 			  int32_t x,
2072 			  int32_t y,
2073 			  int32_t width,
2074 			  int32_t height,
2075 			  struct wl_array *states);
2076 	/**
2077 	 * window origin change
2078 	 *
2079 	 * A notification sent when the window origin has changed. Unlike
2080 	 * a configure, this does not imply the client needs to resize. The
2081 	 * values are in screen coordinates.
2082 	 * @since 29
2083 	 */
2084 	void (*origin_change)(void *data,
2085 			      struct zaura_toplevel *zaura_toplevel,
2086 			      int32_t x,
2087 			      int32_t y);
2088 	/**
2089 	 * set the raster scale during a configure
2090 	 *
2091 	 * Sets the raster scale of this window. This should be called
2092 	 * during a configure event sequence. To do so we reinterpret_cast
2093 	 * into a 32-bit uint and later cast back into a float. This is
2094 	 * because wayland does not support native transport of floats. As
2095 	 * different CPU architectures may use different endian
2096 	 * representations for IEEE 754 floats, this protocol implicitly
2097 	 * assumes that the caller and receiver are the same machine.
2098 	 * @param scale Raster scale, in float format
2099 	 * @since 50
2100 	 */
2101 	void (*configure_raster_scale)(void *data,
2102 				       struct zaura_toplevel *zaura_toplevel,
2103 				       uint32_t scale);
2104 	/**
2105 	 * rotate focus within window
2106 	 *
2107 	 * Rotates focus within the toplevel window. The window must sort
2108 	 * its focusable view into a stable and linearly traversable order.
2109 	 * Prior to rotating focus, the surface should already be activated
2110 	 * and have keyboard focus. If the surface has not been activated
2111 	 * or does not have keyboard focus, the server should first
2112 	 * activate and enter keyboard focus for the window. An example of
2113 	 * event order could be:
2114 	 *
2115 	 * 1. activate surface 2. enter keyboard focus 3. rotate focus
2116 	 *
2117 	 * If the window is not activated or does not have keyboard focus,
2118 	 * the client should respond with a "not handled" and not perform
2119 	 * any operation.
2120 	 *
2121 	 * To start a new series rotation, the server will set the
2122 	 * "restart" arg to true. If the "restart" arg is set to true, the
2123 	 * window should set the focus on the first UI element for the
2124 	 * given direction and not perform any rotation.
2125 	 *
2126 	 * The client should respond with whether the rotation was
2127 	 * successful via the "handled" field in the "ack_rotate_focus"
2128 	 * request. The client should pass on the event serial and
2129 	 * direction within the ack message.
2130 	 * @param serial serial for the rotation event
2131 	 * @param direction the direction for linear traversal
2132 	 * @param restart whether or not to restart traversal
2133 	 * @since 56
2134 	 */
2135 	void (*rotate_focus)(void *data,
2136 			     struct zaura_toplevel *zaura_toplevel,
2137 			     uint32_t serial,
2138 			     uint32_t direction,
2139 			     uint32_t restart);
2140 	/**
2141 	 * window is in overview
2142 	 *
2143 	 * The window is being shown in overview mode. Note that this is
2144 	 * different than shell overview state, as not all windows will be
2145 	 * part of the overview grid.
2146 	 * @param in_overview in overview or not
2147 	 * @since 62
2148 	 */
2149 	void (*overview_change)(void *data,
2150 				struct zaura_toplevel *zaura_toplevel,
2151 				uint32_t in_overview);
2152 	/**
2153 	 * set the occlusion state during a configure
2154 	 *
2155 	 * Sets the occlusion state of this window. This should be called
2156 	 * during a configure event sequence. This is used when the
2157 	 * occlusion state needs to be set as a synchronized operation,
2158 	 * compared to occlusion_state_changed, which is not synchronized.
2159 	 * For example, this can be used to mark a window as hidden so it
2160 	 * can discard resources. When making it visible again, it may need
2161 	 * some time to recreate its buffers, which is why this operation
2162 	 * needs to be synchronized.
2163 	 * @since 65
2164 	 */
2165 	void (*configure_occlusion_state)(void *data,
2166 					  struct zaura_toplevel *zaura_toplevel,
2167 					  uint32_t mode);
2168 };
2169 
2170 /**
2171  * @ingroup iface_zaura_toplevel
2172  */
2173 static inline int
zaura_toplevel_add_listener(struct zaura_toplevel * zaura_toplevel,const struct zaura_toplevel_listener * listener,void * data)2174 zaura_toplevel_add_listener(struct zaura_toplevel *zaura_toplevel,
2175 			    const struct zaura_toplevel_listener *listener, void *data)
2176 {
2177 	return wl_proxy_add_listener((struct wl_proxy *) zaura_toplevel,
2178 				     (void (**)(void)) listener, data);
2179 }
2180 
2181 #define ZAURA_TOPLEVEL_SET_ORIENTATION_LOCK 0
2182 #define ZAURA_TOPLEVEL_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES 1
2183 #define ZAURA_TOPLEVEL_SET_SUPPORTS_SCREEN_COORDINATES 2
2184 #define ZAURA_TOPLEVEL_SET_WINDOW_BOUNDS 3
2185 #define ZAURA_TOPLEVEL_SET_RESTORE_INFO 4
2186 #define ZAURA_TOPLEVEL_SET_SYSTEM_MODAL 5
2187 #define ZAURA_TOPLEVEL_UNSET_SYSTEM_MODAL 6
2188 #define ZAURA_TOPLEVEL_SET_RESTORE_INFO_WITH_WINDOW_ID_SOURCE 7
2189 #define ZAURA_TOPLEVEL_SET_DECORATION 8
2190 #define ZAURA_TOPLEVEL_RELEASE 9
2191 #define ZAURA_TOPLEVEL_SET_FLOAT 10
2192 #define ZAURA_TOPLEVEL_UNSET_FLOAT 11
2193 #define ZAURA_TOPLEVEL_SET_Z_ORDER 12
2194 #define ZAURA_TOPLEVEL_SET_ORIGIN 13
2195 #define ZAURA_TOPLEVEL_ACTIVATE 14
2196 #define ZAURA_TOPLEVEL_DEACTIVATE 15
2197 #define ZAURA_TOPLEVEL_SET_FULLSCREEN_MODE 16
2198 #define ZAURA_TOPLEVEL_SET_SCALE_FACTOR 17
2199 #define ZAURA_TOPLEVEL_SET_SNAP_PRIMARY 18
2200 #define ZAURA_TOPLEVEL_SET_SNAP_SECONDARY 19
2201 #define ZAURA_TOPLEVEL_INTENT_TO_SNAP 20
2202 #define ZAURA_TOPLEVEL_UNSET_SNAP 21
2203 #define ZAURA_TOPLEVEL_SET_PERSISTABLE 22
2204 #define ZAURA_TOPLEVEL_SET_SHAPE 23
2205 #define ZAURA_TOPLEVEL_SET_TOP_INSET 24
2206 #define ZAURA_TOPLEVEL_ACK_ROTATE_FOCUS 25
2207 #define ZAURA_TOPLEVEL_SET_CAN_MAXIMIZE 26
2208 #define ZAURA_TOPLEVEL_UNSET_CAN_MAXIMIZE 27
2209 #define ZAURA_TOPLEVEL_SET_CAN_FULLSCREEN 28
2210 #define ZAURA_TOPLEVEL_UNSET_CAN_FULLSCREEN 29
2211 #define ZAURA_TOPLEVEL_SET_FLOAT_TO_LOCATION 30
2212 #define ZAURA_TOPLEVEL_SET_WINDOW_CORNER_RADII 31
2213 #define ZAURA_TOPLEVEL_SET_SHADOW_CORNER_RADII 32
2214 
2215 /**
2216  * @ingroup iface_zaura_toplevel
2217  */
2218 #define ZAURA_TOPLEVEL_CONFIGURE_SINCE_VERSION 29
2219 /**
2220  * @ingroup iface_zaura_toplevel
2221  */
2222 #define ZAURA_TOPLEVEL_ORIGIN_CHANGE_SINCE_VERSION 29
2223 /**
2224  * @ingroup iface_zaura_toplevel
2225  */
2226 #define ZAURA_TOPLEVEL_CONFIGURE_RASTER_SCALE_SINCE_VERSION 50
2227 /**
2228  * @ingroup iface_zaura_toplevel
2229  */
2230 #define ZAURA_TOPLEVEL_ROTATE_FOCUS_SINCE_VERSION 56
2231 /**
2232  * @ingroup iface_zaura_toplevel
2233  */
2234 #define ZAURA_TOPLEVEL_OVERVIEW_CHANGE_SINCE_VERSION 62
2235 /**
2236  * @ingroup iface_zaura_toplevel
2237  */
2238 #define ZAURA_TOPLEVEL_CONFIGURE_OCCLUSION_STATE_SINCE_VERSION 65
2239 
2240 /**
2241  * @ingroup iface_zaura_toplevel
2242  */
2243 #define ZAURA_TOPLEVEL_SET_ORIENTATION_LOCK_SINCE_VERSION 26
2244 /**
2245  * @ingroup iface_zaura_toplevel
2246  */
2247 #define ZAURA_TOPLEVEL_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES_SINCE_VERSION 28
2248 /**
2249  * @ingroup iface_zaura_toplevel
2250  */
2251 #define ZAURA_TOPLEVEL_SET_SUPPORTS_SCREEN_COORDINATES_SINCE_VERSION 29
2252 /**
2253  * @ingroup iface_zaura_toplevel
2254  */
2255 #define ZAURA_TOPLEVEL_SET_WINDOW_BOUNDS_SINCE_VERSION 29
2256 /**
2257  * @ingroup iface_zaura_toplevel
2258  */
2259 #define ZAURA_TOPLEVEL_SET_RESTORE_INFO_SINCE_VERSION 30
2260 /**
2261  * @ingroup iface_zaura_toplevel
2262  */
2263 #define ZAURA_TOPLEVEL_SET_SYSTEM_MODAL_SINCE_VERSION 31
2264 /**
2265  * @ingroup iface_zaura_toplevel
2266  */
2267 #define ZAURA_TOPLEVEL_UNSET_SYSTEM_MODAL_SINCE_VERSION 31
2268 /**
2269  * @ingroup iface_zaura_toplevel
2270  */
2271 #define ZAURA_TOPLEVEL_SET_RESTORE_INFO_WITH_WINDOW_ID_SOURCE_SINCE_VERSION 32
2272 /**
2273  * @ingroup iface_zaura_toplevel
2274  */
2275 #define ZAURA_TOPLEVEL_SET_DECORATION_SINCE_VERSION 35
2276 /**
2277  * @ingroup iface_zaura_toplevel
2278  */
2279 #define ZAURA_TOPLEVEL_RELEASE_SINCE_VERSION 38
2280 /**
2281  * @ingroup iface_zaura_toplevel
2282  */
2283 #define ZAURA_TOPLEVEL_SET_FLOAT_SINCE_VERSION 39
2284 /**
2285  * @ingroup iface_zaura_toplevel
2286  */
2287 #define ZAURA_TOPLEVEL_UNSET_FLOAT_SINCE_VERSION 39
2288 /**
2289  * @ingroup iface_zaura_toplevel
2290  */
2291 #define ZAURA_TOPLEVEL_SET_Z_ORDER_SINCE_VERSION 40
2292 /**
2293  * @ingroup iface_zaura_toplevel
2294  */
2295 #define ZAURA_TOPLEVEL_SET_ORIGIN_SINCE_VERSION 41
2296 /**
2297  * @ingroup iface_zaura_toplevel
2298  */
2299 #define ZAURA_TOPLEVEL_ACTIVATE_SINCE_VERSION 42
2300 /**
2301  * @ingroup iface_zaura_toplevel
2302  */
2303 #define ZAURA_TOPLEVEL_DEACTIVATE_SINCE_VERSION 42
2304 /**
2305  * @ingroup iface_zaura_toplevel
2306  */
2307 #define ZAURA_TOPLEVEL_SET_FULLSCREEN_MODE_SINCE_VERSION 44
2308 /**
2309  * @ingroup iface_zaura_toplevel
2310  */
2311 #define ZAURA_TOPLEVEL_SET_SCALE_FACTOR_SINCE_VERSION 46
2312 /**
2313  * @ingroup iface_zaura_toplevel
2314  */
2315 #define ZAURA_TOPLEVEL_SET_SNAP_PRIMARY_SINCE_VERSION 48
2316 /**
2317  * @ingroup iface_zaura_toplevel
2318  */
2319 #define ZAURA_TOPLEVEL_SET_SNAP_SECONDARY_SINCE_VERSION 48
2320 /**
2321  * @ingroup iface_zaura_toplevel
2322  */
2323 #define ZAURA_TOPLEVEL_INTENT_TO_SNAP_SINCE_VERSION 49
2324 /**
2325  * @ingroup iface_zaura_toplevel
2326  */
2327 #define ZAURA_TOPLEVEL_UNSET_SNAP_SINCE_VERSION 49
2328 /**
2329  * @ingroup iface_zaura_toplevel
2330  */
2331 #define ZAURA_TOPLEVEL_SET_PERSISTABLE_SINCE_VERSION 52
2332 /**
2333  * @ingroup iface_zaura_toplevel
2334  */
2335 #define ZAURA_TOPLEVEL_SET_SHAPE_SINCE_VERSION 53
2336 /**
2337  * @ingroup iface_zaura_toplevel
2338  */
2339 #define ZAURA_TOPLEVEL_SET_TOP_INSET_SINCE_VERSION 55
2340 /**
2341  * @ingroup iface_zaura_toplevel
2342  */
2343 #define ZAURA_TOPLEVEL_ACK_ROTATE_FOCUS_SINCE_VERSION 56
2344 /**
2345  * @ingroup iface_zaura_toplevel
2346  */
2347 #define ZAURA_TOPLEVEL_SET_CAN_MAXIMIZE_SINCE_VERSION 58
2348 /**
2349  * @ingroup iface_zaura_toplevel
2350  */
2351 #define ZAURA_TOPLEVEL_UNSET_CAN_MAXIMIZE_SINCE_VERSION 58
2352 /**
2353  * @ingroup iface_zaura_toplevel
2354  */
2355 #define ZAURA_TOPLEVEL_SET_CAN_FULLSCREEN_SINCE_VERSION 58
2356 /**
2357  * @ingroup iface_zaura_toplevel
2358  */
2359 #define ZAURA_TOPLEVEL_UNSET_CAN_FULLSCREEN_SINCE_VERSION 58
2360 /**
2361  * @ingroup iface_zaura_toplevel
2362  */
2363 #define ZAURA_TOPLEVEL_SET_FLOAT_TO_LOCATION_SINCE_VERSION 59
2364 /**
2365  * @ingroup iface_zaura_toplevel
2366  */
2367 #define ZAURA_TOPLEVEL_SET_WINDOW_CORNER_RADII_SINCE_VERSION 60
2368 /**
2369  * @ingroup iface_zaura_toplevel
2370  */
2371 #define ZAURA_TOPLEVEL_SET_SHADOW_CORNER_RADII_SINCE_VERSION 63
2372 
2373 /** @ingroup iface_zaura_toplevel */
2374 static inline void
zaura_toplevel_set_user_data(struct zaura_toplevel * zaura_toplevel,void * user_data)2375 zaura_toplevel_set_user_data(struct zaura_toplevel *zaura_toplevel, void *user_data)
2376 {
2377 	wl_proxy_set_user_data((struct wl_proxy *) zaura_toplevel, user_data);
2378 }
2379 
2380 /** @ingroup iface_zaura_toplevel */
2381 static inline void *
zaura_toplevel_get_user_data(struct zaura_toplevel * zaura_toplevel)2382 zaura_toplevel_get_user_data(struct zaura_toplevel *zaura_toplevel)
2383 {
2384 	return wl_proxy_get_user_data((struct wl_proxy *) zaura_toplevel);
2385 }
2386 
2387 static inline uint32_t
zaura_toplevel_get_version(struct zaura_toplevel * zaura_toplevel)2388 zaura_toplevel_get_version(struct zaura_toplevel *zaura_toplevel)
2389 {
2390 	return wl_proxy_get_version((struct wl_proxy *) zaura_toplevel);
2391 }
2392 
2393 /** @ingroup iface_zaura_toplevel */
2394 static inline void
zaura_toplevel_destroy(struct zaura_toplevel * zaura_toplevel)2395 zaura_toplevel_destroy(struct zaura_toplevel *zaura_toplevel)
2396 {
2397 	wl_proxy_destroy((struct wl_proxy *) zaura_toplevel);
2398 }
2399 
2400 /**
2401  * @ingroup iface_zaura_toplevel
2402  *
2403  * Request a specific orientation behavior when this surface is in fullscreen.
2404  */
2405 static inline void
zaura_toplevel_set_orientation_lock(struct zaura_toplevel * zaura_toplevel,uint32_t orientation_lock)2406 zaura_toplevel_set_orientation_lock(struct zaura_toplevel *zaura_toplevel, uint32_t orientation_lock)
2407 {
2408 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2409 			 ZAURA_TOPLEVEL_SET_ORIENTATION_LOCK, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, orientation_lock);
2410 }
2411 
2412 /**
2413  * @ingroup iface_zaura_toplevel
2414  *
2415  * Informs the server that when submitting this surface, this client will not
2416  * use wl_surface_set_buffer_scale to report the scales, nor will it apply
2417  * scale via vp_viewporter. Instead the server should apply an appropriate
2418  * scale transform for the submitted buffers to be composited correctly.
2419  */
2420 static inline void
zaura_toplevel_surface_submission_in_pixel_coordinates(struct zaura_toplevel * zaura_toplevel)2421 zaura_toplevel_surface_submission_in_pixel_coordinates(struct zaura_toplevel *zaura_toplevel)
2422 {
2423 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2424 			 ZAURA_TOPLEVEL_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2425 }
2426 
2427 /**
2428  * @ingroup iface_zaura_toplevel
2429  *
2430  * Requesting this will enable screen coordinates in surfaces
2431  * associated with aura_toplevel including sub surfaces and popup
2432  * windows who added this toplevel as a parent. This should be
2433  * set before first commit.
2434  */
2435 static inline void
zaura_toplevel_set_supports_screen_coordinates(struct zaura_toplevel * zaura_toplevel)2436 zaura_toplevel_set_supports_screen_coordinates(struct zaura_toplevel *zaura_toplevel)
2437 {
2438 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2439 			 ZAURA_TOPLEVEL_SET_SUPPORTS_SCREEN_COORDINATES, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2440 }
2441 
2442 /**
2443  * @ingroup iface_zaura_toplevel
2444  *
2445  * Request a new location and bounds of the surface in DP screen
2446  * coordinates.  The size will be applied to visible bounds used
2447  * in set_geometry.  The output is a hint for the compositor to
2448  * determine which output the window should move to. If the
2449  * output is null, the compositor should make decision solely by
2450  * the given bounds. These parameters are just a request and the
2451  * compositor may ignore, adjust the size and position based on
2452  * the rule imposed by the window manager, or may preserve it for
2453  * future operations. For example, the compositor will not allow
2454  * a position outside of the output, or the compositor may just
2455  * store it if the toplevel surface is in maximiezd state, and
2456  * may use it upon unmaximized.
2457  */
2458 static inline void
zaura_toplevel_set_window_bounds(struct zaura_toplevel * zaura_toplevel,int32_t x,int32_t y,int32_t width,int32_t height,struct wl_output * output)2459 zaura_toplevel_set_window_bounds(struct zaura_toplevel *zaura_toplevel, int32_t x, int32_t y, int32_t width, int32_t height, struct wl_output *output)
2460 {
2461 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2462 			 ZAURA_TOPLEVEL_SET_WINDOW_BOUNDS, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, x, y, width, height, output);
2463 }
2464 
2465 /**
2466  * @ingroup iface_zaura_toplevel
2467  *
2468  * Request session id and restore id of a newly created browser window.
2469  * Set the information used by compositor to restore the toplevel
2470  * surface state, such as window position, window state, upon creation.
2471  * This is not double buffered and must be set before sending first commit.
2472  */
2473 static inline void
zaura_toplevel_set_restore_info(struct zaura_toplevel * zaura_toplevel,int32_t restore_session_id,int32_t restore_window_id)2474 zaura_toplevel_set_restore_info(struct zaura_toplevel *zaura_toplevel, int32_t restore_session_id, int32_t restore_window_id)
2475 {
2476 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2477 			 ZAURA_TOPLEVEL_SET_RESTORE_INFO, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, restore_session_id, restore_window_id);
2478 }
2479 
2480 /**
2481  * @ingroup iface_zaura_toplevel
2482  *
2483  * Requests that the toplevel surface should become a system modal. The
2484  * compositor will prevent other windows from receiving events. If there
2485  * are multiple system modal surfaces, the compositor will decide which
2486  * one to receive events.
2487  */
2488 static inline void
zaura_toplevel_set_system_modal(struct zaura_toplevel * zaura_toplevel)2489 zaura_toplevel_set_system_modal(struct zaura_toplevel *zaura_toplevel)
2490 {
2491 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2492 			 ZAURA_TOPLEVEL_SET_SYSTEM_MODAL, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2493 }
2494 
2495 /**
2496  * @ingroup iface_zaura_toplevel
2497  *
2498  * Requests that the system modal state of the toplevel surface will be
2499  * unset. The compositor will then allow other windows to recieve events.
2500  */
2501 static inline void
zaura_toplevel_unset_system_modal(struct zaura_toplevel * zaura_toplevel)2502 zaura_toplevel_unset_system_modal(struct zaura_toplevel *zaura_toplevel)
2503 {
2504 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2505 			 ZAURA_TOPLEVEL_UNSET_SYSTEM_MODAL, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2506 }
2507 
2508 /**
2509  * @ingroup iface_zaura_toplevel
2510  *
2511  * Request session id and restore id of the window. Set the information used by compositor to restore the toplevel surface state, such as window position, window state, upon creation. This is not double buffered and must be set before sending first commit. This is different from set_restore_info, used for clients that create multiple windows associated with restore_id_source.
2512  */
2513 static inline void
zaura_toplevel_set_restore_info_with_window_id_source(struct zaura_toplevel * zaura_toplevel,int32_t restore_session_id,const char * restore_window_id_source)2514 zaura_toplevel_set_restore_info_with_window_id_source(struct zaura_toplevel *zaura_toplevel, int32_t restore_session_id, const char *restore_window_id_source)
2515 {
2516 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2517 			 ZAURA_TOPLEVEL_SET_RESTORE_INFO_WITH_WINDOW_ID_SOURCE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, restore_session_id, restore_window_id_source);
2518 }
2519 
2520 /**
2521  * @ingroup iface_zaura_toplevel
2522  *
2523  * Clients are allowed to request a particular decoration for a
2524  * zaura_toplevel. The server is not required to honor this
2525  * request. See decoration_type for available options. This must
2526  * be set before the initial commit first, otherwise the
2527  * subsequent request may not be fulfilled. Available since M105.
2528  */
2529 static inline void
zaura_toplevel_set_decoration(struct zaura_toplevel * zaura_toplevel,uint32_t type)2530 zaura_toplevel_set_decoration(struct zaura_toplevel *zaura_toplevel, uint32_t type)
2531 {
2532 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2533 			 ZAURA_TOPLEVEL_SET_DECORATION, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, type);
2534 }
2535 
2536 /**
2537  * @ingroup iface_zaura_toplevel
2538  *
2539  * Destroy this zaura_toplevel object. A client should call destroy when the role
2540  * is unmapped from a wl_surface.
2541  *
2542  * See zaura_shell.release for destructor naming.
2543  */
2544 static inline void
zaura_toplevel_release(struct zaura_toplevel * zaura_toplevel)2545 zaura_toplevel_release(struct zaura_toplevel *zaura_toplevel)
2546 {
2547 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2548 			 ZAURA_TOPLEVEL_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), WL_MARSHAL_FLAG_DESTROY);
2549 }
2550 
2551 /**
2552  * @ingroup iface_zaura_toplevel
2553  *
2554  * [Deprecated] Use set_float_to_location.
2555  * This is a request to place the surface above others.
2556  */
2557 static inline void
zaura_toplevel_set_float(struct zaura_toplevel * zaura_toplevel)2558 zaura_toplevel_set_float(struct zaura_toplevel *zaura_toplevel)
2559 {
2560 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2561 			 ZAURA_TOPLEVEL_SET_FLOAT, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2562 }
2563 
2564 /**
2565  * @ingroup iface_zaura_toplevel
2566  *
2567  * Request that the surface resets floating.
2568  */
2569 static inline void
zaura_toplevel_unset_float(struct zaura_toplevel * zaura_toplevel)2570 zaura_toplevel_unset_float(struct zaura_toplevel *zaura_toplevel)
2571 {
2572 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2573 			 ZAURA_TOPLEVEL_UNSET_FLOAT, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2574 }
2575 
2576 /**
2577  * @ingroup iface_zaura_toplevel
2578  *
2579  * Sets the z order for a toplevel surface. See z_order_level for available options.
2580  */
2581 static inline void
zaura_toplevel_set_z_order(struct zaura_toplevel * zaura_toplevel,uint32_t z_order)2582 zaura_toplevel_set_z_order(struct zaura_toplevel *zaura_toplevel, uint32_t z_order)
2583 {
2584 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2585 			 ZAURA_TOPLEVEL_SET_Z_ORDER, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, z_order);
2586 }
2587 
2588 /**
2589  * @ingroup iface_zaura_toplevel
2590  *
2591  * Request a new location for the surface in device-independent pixels
2592  * (DPs), relative to the top-left corner of the given output.
2593  *
2594  * A null output means whichever output currently contains the surface.
2595  *
2596  * These parameters are just a request and the compositor may ignore
2597  * them, adjust them due to rules imposed by the window manager, or
2598  * preserve them for future operations. For example, the compositor will
2599  * not allow a position outside of the output; or the compositor may just
2600  * store it if the toplevel surface is in maximized state, and may use it
2601  * upon unmaximize.
2602  */
2603 static inline void
zaura_toplevel_set_origin(struct zaura_toplevel * zaura_toplevel,int32_t x,int32_t y,struct wl_output * output)2604 zaura_toplevel_set_origin(struct zaura_toplevel *zaura_toplevel, int32_t x, int32_t y, struct wl_output *output)
2605 {
2606 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2607 			 ZAURA_TOPLEVEL_SET_ORIGIN, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, x, y, output);
2608 }
2609 
2610 /**
2611  * @ingroup iface_zaura_toplevel
2612  *
2613  * Activates this window. This is equivalent to bringing the window to the
2614  * foreground. The compositor is free to ignore this request if it deems
2615  * the client to be misbehaving.
2616  */
2617 static inline void
zaura_toplevel_activate(struct zaura_toplevel * zaura_toplevel)2618 zaura_toplevel_activate(struct zaura_toplevel *zaura_toplevel)
2619 {
2620 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2621 			 ZAURA_TOPLEVEL_ACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2622 }
2623 
2624 /**
2625  * @ingroup iface_zaura_toplevel
2626  *
2627  * Deactivates this window. This is equivalent to requesting that the
2628  * window not be the foreground window. The exact behavior is
2629  * compositor-defined. The compositor is free to ignore this request
2630  * if it deems the client to be misbehaving.
2631  */
2632 static inline void
zaura_toplevel_deactivate(struct zaura_toplevel * zaura_toplevel)2633 zaura_toplevel_deactivate(struct zaura_toplevel *zaura_toplevel)
2634 {
2635 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2636 			 ZAURA_TOPLEVEL_DEACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2637 }
2638 
2639 /**
2640  * @ingroup iface_zaura_toplevel
2641  *
2642  * Suggests how the windowing manager should behave if this surface were
2643  * to go fullscreen. Does not make the surface fullscreen.
2644  *
2645  * In precise, if the surface is not in fullscreen yet, switching the mode
2646  * does not have immediate impact from the client side perspective, but
2647  * will change the behavior when making the surface fullscreen is
2648  * requested next time.
2649  * If the surface is already in fullscreen, then this request has an
2650  * immediate impact to switch the fullscreen mode between plan and
2651  * immersive.
2652  */
2653 static inline void
zaura_toplevel_set_fullscreen_mode(struct zaura_toplevel * zaura_toplevel,uint32_t mode)2654 zaura_toplevel_set_fullscreen_mode(struct zaura_toplevel *zaura_toplevel, uint32_t mode)
2655 {
2656 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2657 			 ZAURA_TOPLEVEL_SET_FULLSCREEN_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, mode);
2658 }
2659 
2660 /**
2661  * @ingroup iface_zaura_toplevel
2662  *
2663  * The client has a 32-bit float scale factor that is associated with each
2664  * zaura toplevel. This scale factor must be propagated exactly to exo. To
2665  * do so we reinterpret_cast into a 32-bit uint and later cast back into a
2666  * float. This is because wayland does not support native transport of
2667  * floats. As different CPU architectures may use different endian
2668  * representations for IEEE 754 floats, this protocol implicitly assumes
2669  * that the caller and receiver are the same machine. To avoid redundant
2670  * messages, this request needs to only be called once when the zaura
2671  * toplevel scale factor changes. This is double buffered state and will be
2672  * applied in the next commit.
2673  */
2674 static inline void
zaura_toplevel_set_scale_factor(struct zaura_toplevel * zaura_toplevel,uint32_t scale_factor_as_uint)2675 zaura_toplevel_set_scale_factor(struct zaura_toplevel *zaura_toplevel, uint32_t scale_factor_as_uint)
2676 {
2677 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2678 			 ZAURA_TOPLEVEL_SET_SCALE_FACTOR, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, scale_factor_as_uint);
2679 }
2680 
2681 /**
2682  * @ingroup iface_zaura_toplevel
2683  *
2684  * Request that surface is snapped to the left or top if primary layout,
2685  * right or bottom otherwise.
2686  */
2687 static inline void
zaura_toplevel_set_snap_primary(struct zaura_toplevel * zaura_toplevel,uint32_t snap_ratio_as_uint)2688 zaura_toplevel_set_snap_primary(struct zaura_toplevel *zaura_toplevel, uint32_t snap_ratio_as_uint)
2689 {
2690 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2691 			 ZAURA_TOPLEVEL_SET_SNAP_PRIMARY, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, snap_ratio_as_uint);
2692 }
2693 
2694 /**
2695  * @ingroup iface_zaura_toplevel
2696  *
2697  * Request that surface is snapped to the right or bottom if primary
2698  * layout, left or top otherwise.
2699  */
2700 static inline void
zaura_toplevel_set_snap_secondary(struct zaura_toplevel * zaura_toplevel,uint32_t snap_ratio_as_uint)2701 zaura_toplevel_set_snap_secondary(struct zaura_toplevel *zaura_toplevel, uint32_t snap_ratio_as_uint)
2702 {
2703 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2704 			 ZAURA_TOPLEVEL_SET_SNAP_SECONDARY, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, snap_ratio_as_uint);
2705 }
2706 
2707 /**
2708  * @ingroup iface_zaura_toplevel
2709  *
2710  * Notify (or inform) the server the client's intent to snap the window.
2711  * To inform it's no longer willing to snap, send 'none'.
2712  */
2713 static inline void
zaura_toplevel_intent_to_snap(struct zaura_toplevel * zaura_toplevel,uint32_t direction)2714 zaura_toplevel_intent_to_snap(struct zaura_toplevel *zaura_toplevel, uint32_t direction)
2715 {
2716 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2717 			 ZAURA_TOPLEVEL_INTENT_TO_SNAP, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, direction);
2718 }
2719 
2720 /**
2721  * @ingroup iface_zaura_toplevel
2722  *
2723  * Request that window unsets snapping.
2724  */
2725 static inline void
zaura_toplevel_unset_snap(struct zaura_toplevel * zaura_toplevel)2726 zaura_toplevel_unset_snap(struct zaura_toplevel *zaura_toplevel)
2727 {
2728 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2729 			 ZAURA_TOPLEVEL_UNSET_SNAP, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2730 }
2731 
2732 /**
2733  * @ingroup iface_zaura_toplevel
2734  *
2735  * Request the persistable status of a window.  Sets the persistable status
2736  * of the window in its window properties.  Should be called before first
2737  * commit.
2738  */
2739 static inline void
zaura_toplevel_set_persistable(struct zaura_toplevel * zaura_toplevel,uint32_t persistable)2740 zaura_toplevel_set_persistable(struct zaura_toplevel *zaura_toplevel, uint32_t persistable)
2741 {
2742 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2743 			 ZAURA_TOPLEVEL_SET_PERSISTABLE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, persistable);
2744 }
2745 
2746 /**
2747  * @ingroup iface_zaura_toplevel
2748  *
2749  * Sets the shape of the toplevel window in DP. Passing NULL will reset the
2750  * shape of the window.
2751  *
2752  * This should be used only in support of the existing (deprecated) Chrome
2753  * Apps SetShape API and not for any other purpose.
2754  */
2755 static inline void
zaura_toplevel_set_shape(struct zaura_toplevel * zaura_toplevel,struct wl_region * region)2756 zaura_toplevel_set_shape(struct zaura_toplevel *zaura_toplevel, struct wl_region *region)
2757 {
2758 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2759 			 ZAURA_TOPLEVEL_SET_SHAPE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, region);
2760 }
2761 
2762 /**
2763  * @ingroup iface_zaura_toplevel
2764  *
2765  * Sets the top inset to the surface. This represents the header height
2766  * and should be non negative.
2767  */
2768 static inline void
zaura_toplevel_set_top_inset(struct zaura_toplevel * zaura_toplevel,int32_t height)2769 zaura_toplevel_set_top_inset(struct zaura_toplevel *zaura_toplevel, int32_t height)
2770 {
2771 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2772 			 ZAURA_TOPLEVEL_SET_TOP_INSET, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, height);
2773 }
2774 
2775 /**
2776  * @ingroup iface_zaura_toplevel
2777  *
2778  * If the focus has been successfully rotated between UI elements inside
2779  * surface, client replies with 'handled'. If the focus didn't rotate, the
2780  * client reply with 'not_handled'. A server may use this to move the focus
2781  * to next focusable surface.
2782  *
2783  * Note that a delay in processing in the client could result in stale acks
2784  * received by the server.
2785  */
2786 static inline void
zaura_toplevel_ack_rotate_focus(struct zaura_toplevel * zaura_toplevel,uint32_t serial,uint32_t handled)2787 zaura_toplevel_ack_rotate_focus(struct zaura_toplevel *zaura_toplevel, uint32_t serial, uint32_t handled)
2788 {
2789 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2790 			 ZAURA_TOPLEVEL_ACK_ROTATE_FOCUS, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, serial, handled);
2791 }
2792 
2793 /**
2794  * @ingroup iface_zaura_toplevel
2795  *
2796  * Hints to the window manager that the toplevel surface can be maximized.
2797  */
2798 static inline void
zaura_toplevel_set_can_maximize(struct zaura_toplevel * zaura_toplevel)2799 zaura_toplevel_set_can_maximize(struct zaura_toplevel *zaura_toplevel)
2800 {
2801 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2802 			 ZAURA_TOPLEVEL_SET_CAN_MAXIMIZE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2803 }
2804 
2805 /**
2806  * @ingroup iface_zaura_toplevel
2807  *
2808  * Hints to the window manager that the toplevel surface should not be
2809  * maximized. Note that the window manager might still request the client
2810  * to be maximized. In such an event, the client should respect the
2811  * window manager's request and maximize. It may unset the maximized state
2812  * afterwards.
2813  */
2814 static inline void
zaura_toplevel_unset_can_maximize(struct zaura_toplevel * zaura_toplevel)2815 zaura_toplevel_unset_can_maximize(struct zaura_toplevel *zaura_toplevel)
2816 {
2817 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2818 			 ZAURA_TOPLEVEL_UNSET_CAN_MAXIMIZE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2819 }
2820 
2821 /**
2822  * @ingroup iface_zaura_toplevel
2823  *
2824  * Hints to the window manager that the toplevel surface can enter
2825  * fullscreen.
2826  */
2827 static inline void
zaura_toplevel_set_can_fullscreen(struct zaura_toplevel * zaura_toplevel)2828 zaura_toplevel_set_can_fullscreen(struct zaura_toplevel *zaura_toplevel)
2829 {
2830 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2831 			 ZAURA_TOPLEVEL_SET_CAN_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2832 }
2833 
2834 /**
2835  * @ingroup iface_zaura_toplevel
2836  *
2837  * Hints to the window manager that the toplevel surface should not be
2838  * enter fullscreen. Note that the window manager might still request the
2839  * client enter fullscreen. In such an event, the client should respect the
2840  * window manager's request and enter fullscreen. It may exit fullscreen
2841  * afterwards.
2842  */
2843 static inline void
zaura_toplevel_unset_can_fullscreen(struct zaura_toplevel * zaura_toplevel)2844 zaura_toplevel_unset_can_fullscreen(struct zaura_toplevel *zaura_toplevel)
2845 {
2846 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2847 			 ZAURA_TOPLEVEL_UNSET_CAN_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0);
2848 }
2849 
2850 /**
2851  * @ingroup iface_zaura_toplevel
2852  *
2853  * This is a request to place the surface above others.
2854  */
2855 static inline void
zaura_toplevel_set_float_to_location(struct zaura_toplevel * zaura_toplevel,uint32_t mode)2856 zaura_toplevel_set_float_to_location(struct zaura_toplevel *zaura_toplevel, uint32_t mode)
2857 {
2858 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2859 			 ZAURA_TOPLEVEL_SET_FLOAT_TO_LOCATION, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, mode);
2860 }
2861 
2862 /**
2863  * @ingroup iface_zaura_toplevel
2864  *
2865  * The client specifies the radius of each corner to be applied to the
2866  * window in DPs (device independent pixels).
2867  *
2868  * The window radius is double buffered, and will be applied at the
2869  * time wl_surface.commit of the corresponding wl_surface is called.
2870  *
2871  * Note: Rounded corner radii affects the wl_surface tree, including
2872  * subsurfaces. Once this protocol is called, surfaces cannot set
2873  * their own rounded corner bounds because rounded window bounds will be
2874  * applied to the whole surface tree.
2875  */
2876 static inline void
zaura_toplevel_set_window_corner_radii(struct zaura_toplevel * zaura_toplevel,uint32_t upper_left_radius,uint32_t upper_right_radius,uint32_t lower_right_radius,uint32_t lower_left_radius)2877 zaura_toplevel_set_window_corner_radii(struct zaura_toplevel *zaura_toplevel, uint32_t upper_left_radius, uint32_t upper_right_radius, uint32_t lower_right_radius, uint32_t lower_left_radius)
2878 {
2879 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2880 			 ZAURA_TOPLEVEL_SET_WINDOW_CORNER_RADII, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, upper_left_radius, upper_right_radius, lower_right_radius, lower_left_radius);
2881 }
2882 
2883 /**
2884  * @ingroup iface_zaura_toplevel
2885  *
2886  * The client specifies the radius of each corner to be applied to the shadow
2887  * associated with the aura toplevel surface in device independent pixels (DPs).
2888  *
2889  * The shadow radius is double buffered, and will be applied at the
2890  * time wl_surface.commit of the corresponding wl_surface is called.
2891  */
2892 static inline void
zaura_toplevel_set_shadow_corner_radii(struct zaura_toplevel * zaura_toplevel,uint32_t upper_left_radius,uint32_t upper_right_radius,uint32_t lower_right_radius,uint32_t lower_left_radius)2893 zaura_toplevel_set_shadow_corner_radii(struct zaura_toplevel *zaura_toplevel, uint32_t upper_left_radius, uint32_t upper_right_radius, uint32_t lower_right_radius, uint32_t lower_left_radius)
2894 {
2895 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_toplevel,
2896 			 ZAURA_TOPLEVEL_SET_SHADOW_CORNER_RADII, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_toplevel), 0, upper_left_radius, upper_right_radius, lower_right_radius, lower_left_radius);
2897 }
2898 
2899 #ifndef ZAURA_POPUP_DECORATION_TYPE_ENUM
2900 #define ZAURA_POPUP_DECORATION_TYPE_ENUM
2901 /**
2902  * @ingroup iface_zaura_popup
2903  * different decoration types
2904  *
2905  * Decoration types are used to modify the surface (e.g. drop shadow).
2906  */
2907 enum zaura_popup_decoration_type {
2908 	/**
2909 	 * no frame
2910 	 */
2911 	ZAURA_POPUP_DECORATION_TYPE_NONE = 0,
2912 	/**
2913 	 * caption with shadow
2914 	 */
2915 	ZAURA_POPUP_DECORATION_TYPE_NORMAL = 1,
2916 	/**
2917 	 * shadow only
2918 	 */
2919 	ZAURA_POPUP_DECORATION_TYPE_SHADOW = 2,
2920 };
2921 #endif /* ZAURA_POPUP_DECORATION_TYPE_ENUM */
2922 
2923 #define ZAURA_POPUP_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES 0
2924 #define ZAURA_POPUP_SET_DECORATION 1
2925 #define ZAURA_POPUP_SET_MENU 2
2926 #define ZAURA_POPUP_RELEASE 3
2927 #define ZAURA_POPUP_SET_SCALE_FACTOR 4
2928 
2929 
2930 /**
2931  * @ingroup iface_zaura_popup
2932  */
2933 #define ZAURA_POPUP_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES_SINCE_VERSION 28
2934 /**
2935  * @ingroup iface_zaura_popup
2936  */
2937 #define ZAURA_POPUP_SET_DECORATION_SINCE_VERSION 35
2938 /**
2939  * @ingroup iface_zaura_popup
2940  */
2941 #define ZAURA_POPUP_SET_MENU_SINCE_VERSION 37
2942 /**
2943  * @ingroup iface_zaura_popup
2944  */
2945 #define ZAURA_POPUP_RELEASE_SINCE_VERSION 38
2946 /**
2947  * @ingroup iface_zaura_popup
2948  */
2949 #define ZAURA_POPUP_SET_SCALE_FACTOR_SINCE_VERSION 46
2950 
2951 /** @ingroup iface_zaura_popup */
2952 static inline void
zaura_popup_set_user_data(struct zaura_popup * zaura_popup,void * user_data)2953 zaura_popup_set_user_data(struct zaura_popup *zaura_popup, void *user_data)
2954 {
2955 	wl_proxy_set_user_data((struct wl_proxy *) zaura_popup, user_data);
2956 }
2957 
2958 /** @ingroup iface_zaura_popup */
2959 static inline void *
zaura_popup_get_user_data(struct zaura_popup * zaura_popup)2960 zaura_popup_get_user_data(struct zaura_popup *zaura_popup)
2961 {
2962 	return wl_proxy_get_user_data((struct wl_proxy *) zaura_popup);
2963 }
2964 
2965 static inline uint32_t
zaura_popup_get_version(struct zaura_popup * zaura_popup)2966 zaura_popup_get_version(struct zaura_popup *zaura_popup)
2967 {
2968 	return wl_proxy_get_version((struct wl_proxy *) zaura_popup);
2969 }
2970 
2971 /** @ingroup iface_zaura_popup */
2972 static inline void
zaura_popup_destroy(struct zaura_popup * zaura_popup)2973 zaura_popup_destroy(struct zaura_popup *zaura_popup)
2974 {
2975 	wl_proxy_destroy((struct wl_proxy *) zaura_popup);
2976 }
2977 
2978 /**
2979  * @ingroup iface_zaura_popup
2980  *
2981  * Informs the server that when submitting this surface, this client will not
2982  * use wl_surface_set_buffer_scale to report the scales, nor will it apply
2983  * scale via vp_viewporter. Instead the server should apply an appropriate
2984  * scale transform for the submitted buffers to be composited correctly.
2985  */
2986 static inline void
zaura_popup_surface_submission_in_pixel_coordinates(struct zaura_popup * zaura_popup)2987 zaura_popup_surface_submission_in_pixel_coordinates(struct zaura_popup *zaura_popup)
2988 {
2989 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_popup,
2990 			 ZAURA_POPUP_SURFACE_SUBMISSION_IN_PIXEL_COORDINATES, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_popup), 0);
2991 }
2992 
2993 /**
2994  * @ingroup iface_zaura_popup
2995  *
2996  * Clients are allowed to request a particular decoration for a
2997  * zaura_toplevel. The server is not required to honor this request. See
2998  * decoration_type for available options. Available since M105.
2999  */
3000 static inline void
zaura_popup_set_decoration(struct zaura_popup * zaura_popup,uint32_t type)3001 zaura_popup_set_decoration(struct zaura_popup *zaura_popup, uint32_t type)
3002 {
3003 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_popup,
3004 			 ZAURA_POPUP_SET_DECORATION, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_popup), 0, type);
3005 }
3006 
3007 /**
3008  * @ingroup iface_zaura_popup
3009  *
3010  * Set popup type to menu
3011  */
3012 static inline void
zaura_popup_set_menu(struct zaura_popup * zaura_popup)3013 zaura_popup_set_menu(struct zaura_popup *zaura_popup)
3014 {
3015 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_popup,
3016 			 ZAURA_POPUP_SET_MENU, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_popup), 0);
3017 }
3018 
3019 /**
3020  * @ingroup iface_zaura_popup
3021  *
3022  * This request destroys the zaura_popup. A client should call destroy when the
3023  * role is unmapped from a wl_surface.
3024  *
3025  * See zaura_shell.release for destructor naming.
3026  */
3027 static inline void
zaura_popup_release(struct zaura_popup * zaura_popup)3028 zaura_popup_release(struct zaura_popup *zaura_popup)
3029 {
3030 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_popup,
3031 			 ZAURA_POPUP_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_popup), WL_MARSHAL_FLAG_DESTROY);
3032 }
3033 
3034 /**
3035  * @ingroup iface_zaura_popup
3036  *
3037  * The client has a 32-bit float scale factor that is associated with each
3038  * zaura popup. This scale factor must be propagated exactly to exo. To
3039  * do so we reinterpret_cast into a 32-bit uint and later cast back into a
3040  * float. This is because wayland does not support native transport of
3041  * floats. As different CPU architectures may use different endian
3042  * representations for IEEE 754 floats, this protocol implicitly assumes
3043  * that the caller and receiver are the same machine. To avoid redundant
3044  * messages, this request needs to only be called once when the zaura
3045  * popup's scale factor changes.
3046  */
3047 static inline void
zaura_popup_set_scale_factor(struct zaura_popup * zaura_popup,uint32_t scale_factor_as_uint)3048 zaura_popup_set_scale_factor(struct zaura_popup *zaura_popup, uint32_t scale_factor_as_uint)
3049 {
3050 	wl_proxy_marshal_flags((struct wl_proxy *) zaura_popup,
3051 			 ZAURA_POPUP_SET_SCALE_FACTOR, NULL, wl_proxy_get_version((struct wl_proxy *) zaura_popup), 0, scale_factor_as_uint);
3052 }
3053 
3054 /**
3055  * @ingroup iface_zaura_output_manager
3056  * @struct zaura_output_manager_listener
3057  */
3058 struct zaura_output_manager_listener {
3059 	/**
3060 	 * sent all information about output
3061 	 *
3062 	 * This event is sent after all relevant properties of a
3063 	 * zaura_output_manager for a given wl_output have been sent.
3064 	 */
3065 	void (*done)(void *data,
3066 		     struct zaura_output_manager *zaura_output_manager,
3067 		     struct wl_output *output);
3068 	/**
3069 	 * advertise the output's display id
3070 	 *
3071 	 * This event describes the 64bit display id assigned to each
3072 	 * display by ChromeOS. The value is opaque and should not be
3073 	 * interpreted.
3074 	 *
3075 	 * The event is sent when binding to the output object and
3076 	 * subsequently as output state changes.
3077 	 */
3078 	void (*display_id)(void *data,
3079 			   struct zaura_output_manager *zaura_output_manager,
3080 			   struct wl_output *output,
3081 			   uint32_t display_id_hi,
3082 			   uint32_t display_id_lo);
3083 	/**
3084 	 * position of the output within the global compositor space
3085 	 *
3086 	 * The position event describes the location of the wl_output
3087 	 * within the global compositor space.
3088 	 *
3089 	 * The event is sent when binding to the output object and
3090 	 * subsequently as output state changes.
3091 	 * @param x x position within the global compositor space
3092 	 * @param y y position within the global compositor space
3093 	 */
3094 	void (*logical_position)(void *data,
3095 				 struct zaura_output_manager *zaura_output_manager,
3096 				 struct wl_output *output,
3097 				 int32_t x,
3098 				 int32_t y);
3099 	/**
3100 	 * size of the output in the global compositor space
3101 	 *
3102 	 * The logical_size event describes the logical size of the
3103 	 * output in the global compositor space.
3104 	 *
3105 	 * The event is sent when binding to the output object and
3106 	 * subsequently as output state changes.
3107 	 * @param width width in global compositor space
3108 	 * @param height height in global compositor space
3109 	 */
3110 	void (*logical_size)(void *data,
3111 			     struct zaura_output_manager *zaura_output_manager,
3112 			     struct wl_output *output,
3113 			     int32_t width,
3114 			     int32_t height);
3115 	/**
3116 	 * size of the output in pixels
3117 	 *
3118 	 * The physical resolution of the display in pixels. The value
3119 	 * should not include any overscan insets or display rotation,
3120 	 * except for any panel orientation adjustment.
3121 	 *
3122 	 * The event is sent when binding to the output object and
3123 	 * subsequently as output state changes.
3124 	 * @param width width in global compositor space
3125 	 * @param height height in global compositor space
3126 	 */
3127 	void (*physical_size)(void *data,
3128 			      struct zaura_output_manager *zaura_output_manager,
3129 			      struct wl_output *output,
3130 			      int32_t width,
3131 			      int32_t height);
3132 	/**
3133 	 * advertise the work area insets for the output
3134 	 *
3135 	 * This event describes the insets for the output in logical
3136 	 * screen coordinates, from which the work area can be calculated.
3137 	 *
3138 	 * The event is sent when binding to the output object and
3139 	 * subsequently as output state changes.
3140 	 */
3141 	void (*insets)(void *data,
3142 		       struct zaura_output_manager *zaura_output_manager,
3143 		       struct wl_output *output,
3144 		       int32_t top,
3145 		       int32_t left,
3146 		       int32_t bottom,
3147 		       int32_t right);
3148 	/**
3149 	 * advertise device scale factor for the output
3150 	 *
3151 	 * The scale factor of the output device. We reinterpret_cast the
3152 	 * float scale factor into a 32-bit uint and later cast back into a
3153 	 * float. This is because wayland does not support native transport
3154 	 * of floats. As different CPU architectures may use different
3155 	 * endian representations for IEEE 754 floats, this protocol
3156 	 * implicitly assumes that the caller and receiver are the same
3157 	 * machine.
3158 	 *
3159 	 * The event is sent when binding to the output object and
3160 	 * subsequently as output state changes.
3161 	 * @param device_scale_factor display scale factor, in float format
3162 	 */
3163 	void (*device_scale_factor)(void *data,
3164 				    struct zaura_output_manager *zaura_output_manager,
3165 				    struct wl_output *output,
3166 				    uint32_t device_scale_factor);
3167 	/**
3168 	 * logical transform of the output
3169 	 *
3170 	 * This event describes the logical transform for the output.
3171 	 * Whereas panel transform corresponds to the display's panel
3172 	 * rotation, the logical transform corresponds to the display's
3173 	 * logical rotation.
3174 	 *
3175 	 * The event is sent when binding to the output object and
3176 	 * subsequently as output state changes.
3177 	 * @param transform transform that maps framebuffer to output
3178 	 */
3179 	void (*logical_transform)(void *data,
3180 				  struct zaura_output_manager *zaura_output_manager,
3181 				  struct wl_output *output,
3182 				  int32_t transform);
3183 	/**
3184 	 * panel transform of the output
3185 	 *
3186 	 * This event describes the panel transform for the output, which
3187 	 * is the associated display's panel rotation.
3188 	 *
3189 	 * The event is sent when binding to the output object and
3190 	 * subsequently as output state changes.
3191 	 * @param transform transform that maps framebuffer to output
3192 	 */
3193 	void (*panel_transform)(void *data,
3194 				struct zaura_output_manager *zaura_output_manager,
3195 				struct wl_output *output,
3196 				int32_t transform);
3197 	/**
3198 	 * human-readable name of this output
3199 	 *
3200 	 * The name is a UTF-8 string with no convention defined for its
3201 	 * contents.
3202 	 *
3203 	 * The event is sent when binding to the output object and
3204 	 * subsequently as output state changes.
3205 	 * @param name output name
3206 	 */
3207 	void (*name)(void *data,
3208 		     struct zaura_output_manager *zaura_output_manager,
3209 		     struct wl_output *output,
3210 		     const char *name);
3211 	/**
3212 	 * human-readable description of this output
3213 	 *
3214 	 * The description is a UTF-8 string with no convention defined
3215 	 * for its contents.
3216 	 *
3217 	 * The event is sent when binding to the output object and
3218 	 * subsequently as output state changes.
3219 	 * @param description output description
3220 	 */
3221 	void (*description)(void *data,
3222 			    struct zaura_output_manager *zaura_output_manager,
3223 			    struct wl_output *output,
3224 			    const char *description);
3225 	/**
3226 	 * target display for new windows
3227 	 *
3228 	 * Notifies that this output is now active output. It is
3229 	 * typically used as a target when a new window is created without
3230 	 * specific bounds.
3231 	 * @since 2
3232 	 */
3233 	void (*activated)(void *data,
3234 			  struct zaura_output_manager *zaura_output_manager,
3235 			  struct wl_output *output);
3236 	/**
3237 	 * advertise the overscan insets for the output
3238 	 *
3239 	 * This event describes the overscan insets for the output in
3240 	 * physical pixels.
3241 	 *
3242 	 * The event is sent when binding to the output object and
3243 	 * subsequently as output state changes.
3244 	 * @since 3
3245 	 */
3246 	void (*overscan_insets)(void *data,
3247 				struct zaura_output_manager *zaura_output_manager,
3248 				struct wl_output *output,
3249 				int32_t top,
3250 				int32_t left,
3251 				int32_t bottom,
3252 				int32_t right);
3253 };
3254 
3255 /**
3256  * @ingroup iface_zaura_output_manager
3257  */
3258 static inline int
zaura_output_manager_add_listener(struct zaura_output_manager * zaura_output_manager,const struct zaura_output_manager_listener * listener,void * data)3259 zaura_output_manager_add_listener(struct zaura_output_manager *zaura_output_manager,
3260 				  const struct zaura_output_manager_listener *listener, void *data)
3261 {
3262 	return wl_proxy_add_listener((struct wl_proxy *) zaura_output_manager,
3263 				     (void (**)(void)) listener, data);
3264 }
3265 
3266 /**
3267  * @ingroup iface_zaura_output_manager
3268  */
3269 #define ZAURA_OUTPUT_MANAGER_DONE_SINCE_VERSION 1
3270 /**
3271  * @ingroup iface_zaura_output_manager
3272  */
3273 #define ZAURA_OUTPUT_MANAGER_DISPLAY_ID_SINCE_VERSION 1
3274 /**
3275  * @ingroup iface_zaura_output_manager
3276  */
3277 #define ZAURA_OUTPUT_MANAGER_LOGICAL_POSITION_SINCE_VERSION 1
3278 /**
3279  * @ingroup iface_zaura_output_manager
3280  */
3281 #define ZAURA_OUTPUT_MANAGER_LOGICAL_SIZE_SINCE_VERSION 1
3282 /**
3283  * @ingroup iface_zaura_output_manager
3284  */
3285 #define ZAURA_OUTPUT_MANAGER_PHYSICAL_SIZE_SINCE_VERSION 1
3286 /**
3287  * @ingroup iface_zaura_output_manager
3288  */
3289 #define ZAURA_OUTPUT_MANAGER_INSETS_SINCE_VERSION 1
3290 /**
3291  * @ingroup iface_zaura_output_manager
3292  */
3293 #define ZAURA_OUTPUT_MANAGER_DEVICE_SCALE_FACTOR_SINCE_VERSION 1
3294 /**
3295  * @ingroup iface_zaura_output_manager
3296  */
3297 #define ZAURA_OUTPUT_MANAGER_LOGICAL_TRANSFORM_SINCE_VERSION 1
3298 /**
3299  * @ingroup iface_zaura_output_manager
3300  */
3301 #define ZAURA_OUTPUT_MANAGER_PANEL_TRANSFORM_SINCE_VERSION 1
3302 /**
3303  * @ingroup iface_zaura_output_manager
3304  */
3305 #define ZAURA_OUTPUT_MANAGER_NAME_SINCE_VERSION 1
3306 /**
3307  * @ingroup iface_zaura_output_manager
3308  */
3309 #define ZAURA_OUTPUT_MANAGER_DESCRIPTION_SINCE_VERSION 1
3310 /**
3311  * @ingroup iface_zaura_output_manager
3312  */
3313 #define ZAURA_OUTPUT_MANAGER_ACTIVATED_SINCE_VERSION 2
3314 /**
3315  * @ingroup iface_zaura_output_manager
3316  */
3317 #define ZAURA_OUTPUT_MANAGER_OVERSCAN_INSETS_SINCE_VERSION 3
3318 
3319 
3320 /** @ingroup iface_zaura_output_manager */
3321 static inline void
zaura_output_manager_set_user_data(struct zaura_output_manager * zaura_output_manager,void * user_data)3322 zaura_output_manager_set_user_data(struct zaura_output_manager *zaura_output_manager, void *user_data)
3323 {
3324 	wl_proxy_set_user_data((struct wl_proxy *) zaura_output_manager, user_data);
3325 }
3326 
3327 /** @ingroup iface_zaura_output_manager */
3328 static inline void *
zaura_output_manager_get_user_data(struct zaura_output_manager * zaura_output_manager)3329 zaura_output_manager_get_user_data(struct zaura_output_manager *zaura_output_manager)
3330 {
3331 	return wl_proxy_get_user_data((struct wl_proxy *) zaura_output_manager);
3332 }
3333 
3334 static inline uint32_t
zaura_output_manager_get_version(struct zaura_output_manager * zaura_output_manager)3335 zaura_output_manager_get_version(struct zaura_output_manager *zaura_output_manager)
3336 {
3337 	return wl_proxy_get_version((struct wl_proxy *) zaura_output_manager);
3338 }
3339 
3340 /** @ingroup iface_zaura_output_manager */
3341 static inline void
zaura_output_manager_destroy(struct zaura_output_manager * zaura_output_manager)3342 zaura_output_manager_destroy(struct zaura_output_manager *zaura_output_manager)
3343 {
3344 	wl_proxy_destroy((struct wl_proxy *) zaura_output_manager);
3345 }
3346 
3347 #ifdef  __cplusplus
3348 }
3349 #endif
3350 
3351 #endif
3352