1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef OVERLAY_PRIORITIZER_CLIENT_PROTOCOL_H
4 #define OVERLAY_PRIORITIZER_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_overlay_prioritizer The overlay_prioritizer protocol
16  * @section page_ifaces_overlay_prioritizer Interfaces
17  * - @subpage page_iface_overlay_prioritizer - overlay hint prioritization
18  * - @subpage page_iface_overlay_prioritized_surface - delegate overlay prioritization hint of a wl_surface
19  * @section page_copyright_overlay_prioritizer Copyright
20  * <pre>
21  *
22  * Copyright 2021 The Chromium Authors
23  *
24  * Permission is hereby granted, free of charge, to any person obtaining a
25  * copy of this software and associated documentation files (the "Software"),
26  * to deal in the Software without restriction, including without limitation
27  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28  * and/or sell copies of the Software, and to permit persons to whom the
29  * Software is furnished to do so, subject to the following conditions:
30  *
31  * The above copyright notice and this permission notice (including the next
32  * paragraph) shall be included in all copies or substantial portions of the
33  * Software.
34  *
35  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
38  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
41  * DEALINGS IN THE SOFTWARE.
42  * </pre>
43  */
44 struct overlay_prioritized_surface;
45 struct overlay_prioritizer;
46 struct wl_surface;
47 
48 #ifndef OVERLAY_PRIORITIZER_INTERFACE
49 #define OVERLAY_PRIORITIZER_INTERFACE
50 /**
51  * @page page_iface_overlay_prioritizer overlay_prioritizer
52  * @section page_iface_overlay_prioritizer_desc Description
53  *
54  * The global interface exposing overlay delegated prioritization
55  * hint capabilities is used to instantiate an interface extension for a
56  * wl_surface object. This extended interface will then allow
57  * delegated overlay prioritization of the surface.
58  * @section page_iface_overlay_prioritizer_api API
59  * See @ref iface_overlay_prioritizer.
60  */
61 /**
62  * @defgroup iface_overlay_prioritizer The overlay_prioritizer interface
63  *
64  * The global interface exposing overlay delegated prioritization
65  * hint capabilities is used to instantiate an interface extension for a
66  * wl_surface object. This extended interface will then allow
67  * delegated overlay prioritization of the surface.
68  */
69 extern const struct wl_interface overlay_prioritizer_interface;
70 #endif
71 #ifndef OVERLAY_PRIORITIZED_SURFACE_INTERFACE
72 #define OVERLAY_PRIORITIZED_SURFACE_INTERFACE
73 /**
74  * @page page_iface_overlay_prioritized_surface overlay_prioritized_surface
75  * @section page_iface_overlay_prioritized_surface_desc Description
76  *
77  * An additional interface to a wl_surface object, which allows the
78  * client to specify hints for the overlay prioritization of the surface.
79  * @section page_iface_overlay_prioritized_surface_api API
80  * See @ref iface_overlay_prioritized_surface.
81  */
82 /**
83  * @defgroup iface_overlay_prioritized_surface The overlay_prioritized_surface interface
84  *
85  * An additional interface to a wl_surface object, which allows the
86  * client to specify hints for the overlay prioritization of the surface.
87  */
88 extern const struct wl_interface overlay_prioritized_surface_interface;
89 #endif
90 
91 #ifndef OVERLAY_PRIORITIZER_ERROR_ENUM
92 #define OVERLAY_PRIORITIZER_ERROR_ENUM
93 enum overlay_prioritizer_error {
94 	/**
95 	 * the surface already has a prioritizer object              associated
96 	 */
97 	OVERLAY_PRIORITIZER_ERROR_OVERLAY_HINTED_SURFACE_EXISTS = 0,
98 };
99 #endif /* OVERLAY_PRIORITIZER_ERROR_ENUM */
100 
101 #define OVERLAY_PRIORITIZER_DESTROY 0
102 #define OVERLAY_PRIORITIZER_GET_OVERLAY_PRIORITIZED_SURFACE 1
103 
104 
105 /**
106  * @ingroup iface_overlay_prioritizer
107  */
108 #define OVERLAY_PRIORITIZER_DESTROY_SINCE_VERSION 1
109 /**
110  * @ingroup iface_overlay_prioritizer
111  */
112 #define OVERLAY_PRIORITIZER_GET_OVERLAY_PRIORITIZED_SURFACE_SINCE_VERSION 1
113 
114 /** @ingroup iface_overlay_prioritizer */
115 static inline void
overlay_prioritizer_set_user_data(struct overlay_prioritizer * overlay_prioritizer,void * user_data)116 overlay_prioritizer_set_user_data(struct overlay_prioritizer *overlay_prioritizer, void *user_data)
117 {
118 	wl_proxy_set_user_data((struct wl_proxy *) overlay_prioritizer, user_data);
119 }
120 
121 /** @ingroup iface_overlay_prioritizer */
122 static inline void *
overlay_prioritizer_get_user_data(struct overlay_prioritizer * overlay_prioritizer)123 overlay_prioritizer_get_user_data(struct overlay_prioritizer *overlay_prioritizer)
124 {
125 	return wl_proxy_get_user_data((struct wl_proxy *) overlay_prioritizer);
126 }
127 
128 static inline uint32_t
overlay_prioritizer_get_version(struct overlay_prioritizer * overlay_prioritizer)129 overlay_prioritizer_get_version(struct overlay_prioritizer *overlay_prioritizer)
130 {
131 	return wl_proxy_get_version((struct wl_proxy *) overlay_prioritizer);
132 }
133 
134 /**
135  * @ingroup iface_overlay_prioritizer
136  *
137  * Informs the server that the client will not be using this
138  * protocol object anymore. This does not affect any other objects,
139  * prioritizer objects included.
140  */
141 static inline void
overlay_prioritizer_destroy(struct overlay_prioritizer * overlay_prioritizer)142 overlay_prioritizer_destroy(struct overlay_prioritizer *overlay_prioritizer)
143 {
144 	wl_proxy_marshal_flags((struct wl_proxy *) overlay_prioritizer,
145 			 OVERLAY_PRIORITIZER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) overlay_prioritizer), WL_MARSHAL_FLAG_DESTROY);
146 }
147 
148 /**
149  * @ingroup iface_overlay_prioritizer
150  *
151  * Instantiate an interface extension for the given wl_surface to
152  * add support for overlay prioritization hinting. If the given wl_surface already has
153  * a prioritization object associated, the delegate_exists protocol error is
154  * raised.
155  */
156 static inline struct overlay_prioritized_surface *
overlay_prioritizer_get_overlay_prioritized_surface(struct overlay_prioritizer * overlay_prioritizer,struct wl_surface * surface)157 overlay_prioritizer_get_overlay_prioritized_surface(struct overlay_prioritizer *overlay_prioritizer, struct wl_surface *surface)
158 {
159 	struct wl_proxy *id;
160 
161 	id = wl_proxy_marshal_flags((struct wl_proxy *) overlay_prioritizer,
162 			 OVERLAY_PRIORITIZER_GET_OVERLAY_PRIORITIZED_SURFACE, &overlay_prioritized_surface_interface, wl_proxy_get_version((struct wl_proxy *) overlay_prioritizer), 0, NULL, surface);
163 
164 	return (struct overlay_prioritized_surface *) id;
165 }
166 
167 #ifndef OVERLAY_PRIORITIZED_SURFACE_ERROR_ENUM
168 #define OVERLAY_PRIORITIZED_SURFACE_ERROR_ENUM
169 enum overlay_prioritized_surface_error {
170 	/**
171 	 * negative values in radius or size
172 	 */
173 	OVERLAY_PRIORITIZED_SURFACE_ERROR_BAD_VALUE = 0,
174 	/**
175 	 * the wl_surface was destroyed
176 	 */
177 	OVERLAY_PRIORITIZED_SURFACE_ERROR_NO_SURFACE = 1,
178 };
179 #endif /* OVERLAY_PRIORITIZED_SURFACE_ERROR_ENUM */
180 
181 #ifndef OVERLAY_PRIORITIZED_SURFACE_OVERLAY_PRIORITY_ENUM
182 #define OVERLAY_PRIORITIZED_SURFACE_OVERLAY_PRIORITY_ENUM
183 /**
184  * @ingroup iface_overlay_prioritized_surface
185  * hints for overlay prioritization
186  *
187  */
188 enum overlay_prioritized_surface_overlay_priority {
189 	/**
190 	 * overlay promotion is not necessary for this surface
191 	 */
192 	OVERLAY_PRIORITIZED_SURFACE_OVERLAY_PRIORITY_NONE = 0,
193 	/**
194 	 * surface could be considered as a candidate for promotion
195 	 */
196 	OVERLAY_PRIORITIZED_SURFACE_OVERLAY_PRIORITY_REGULAR = 1,
197 	/**
198 	 * the surface is a low latency canvas that works better if promoted to overlay
199 	 */
200 	OVERLAY_PRIORITIZED_SURFACE_OVERLAY_PRIORITY_PREFERRED_LOW_LATENCY_CANVAS = 2,
201 	/**
202 	 * the surface contains protected content and requires to be promoted to overlay
203 	 */
204 	OVERLAY_PRIORITIZED_SURFACE_OVERLAY_PRIORITY_REQUIRED_HARDWARE_PROTECTION = 3,
205 };
206 #endif /* OVERLAY_PRIORITIZED_SURFACE_OVERLAY_PRIORITY_ENUM */
207 
208 #define OVERLAY_PRIORITIZED_SURFACE_DESTROY 0
209 #define OVERLAY_PRIORITIZED_SURFACE_SET_OVERLAY_PRIORITY 1
210 
211 
212 /**
213  * @ingroup iface_overlay_prioritized_surface
214  */
215 #define OVERLAY_PRIORITIZED_SURFACE_DESTROY_SINCE_VERSION 1
216 /**
217  * @ingroup iface_overlay_prioritized_surface
218  */
219 #define OVERLAY_PRIORITIZED_SURFACE_SET_OVERLAY_PRIORITY_SINCE_VERSION 1
220 
221 /** @ingroup iface_overlay_prioritized_surface */
222 static inline void
overlay_prioritized_surface_set_user_data(struct overlay_prioritized_surface * overlay_prioritized_surface,void * user_data)223 overlay_prioritized_surface_set_user_data(struct overlay_prioritized_surface *overlay_prioritized_surface, void *user_data)
224 {
225 	wl_proxy_set_user_data((struct wl_proxy *) overlay_prioritized_surface, user_data);
226 }
227 
228 /** @ingroup iface_overlay_prioritized_surface */
229 static inline void *
overlay_prioritized_surface_get_user_data(struct overlay_prioritized_surface * overlay_prioritized_surface)230 overlay_prioritized_surface_get_user_data(struct overlay_prioritized_surface *overlay_prioritized_surface)
231 {
232 	return wl_proxy_get_user_data((struct wl_proxy *) overlay_prioritized_surface);
233 }
234 
235 static inline uint32_t
overlay_prioritized_surface_get_version(struct overlay_prioritized_surface * overlay_prioritized_surface)236 overlay_prioritized_surface_get_version(struct overlay_prioritized_surface *overlay_prioritized_surface)
237 {
238 	return wl_proxy_get_version((struct wl_proxy *) overlay_prioritized_surface);
239 }
240 
241 /**
242  * @ingroup iface_overlay_prioritized_surface
243  *
244  * The associated wl_surface's overlay prioritization is removed.
245  * The change is applied on the next wl_surface.commit.
246  */
247 static inline void
overlay_prioritized_surface_destroy(struct overlay_prioritized_surface * overlay_prioritized_surface)248 overlay_prioritized_surface_destroy(struct overlay_prioritized_surface *overlay_prioritized_surface)
249 {
250 	wl_proxy_marshal_flags((struct wl_proxy *) overlay_prioritized_surface,
251 			 OVERLAY_PRIORITIZED_SURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) overlay_prioritized_surface), WL_MARSHAL_FLAG_DESTROY);
252 }
253 
254 /**
255  * @ingroup iface_overlay_prioritized_surface
256  *
257  */
258 static inline void
overlay_prioritized_surface_set_overlay_priority(struct overlay_prioritized_surface * overlay_prioritized_surface,uint32_t priority)259 overlay_prioritized_surface_set_overlay_priority(struct overlay_prioritized_surface *overlay_prioritized_surface, uint32_t priority)
260 {
261 	wl_proxy_marshal_flags((struct wl_proxy *) overlay_prioritized_surface,
262 			 OVERLAY_PRIORITIZED_SURFACE_SET_OVERLAY_PRIORITY, NULL, wl_proxy_get_version((struct wl_proxy *) overlay_prioritized_surface), 0, priority);
263 }
264 
265 #ifdef  __cplusplus
266 }
267 #endif
268 
269 #endif
270