1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef AURA_OUTPUT_MANAGEMENT_CLIENT_PROTOCOL_H
4 #define AURA_OUTPUT_MANAGEMENT_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_output_management The aura_output_management protocol
16 * @section page_ifaces_aura_output_management Interfaces
17 * - @subpage page_iface_zaura_output_manager_v2 - aura output manager singleton
18 * @section page_copyright_aura_output_management Copyright
19 * <pre>
20 *
21 * Copyright 2024 The Chromium Authors
22 *
23 * Permission is hereby granted, free of charge, to any person obtaining a
24 * copy of this software and associated documentation files (the "Software"),
25 * to deal in the Software without restriction, including without limitation
26 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
27 * and/or sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following conditions:
29 *
30 * The above copyright notice and this permission notice (including the next
31 * paragraph) shall be included in all copies or substantial portions of the
32 * Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
37 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
40 * DEALINGS IN THE SOFTWARE.
41 * </pre>
42 */
43 struct zaura_output_manager_v2;
44
45 #ifndef ZAURA_OUTPUT_MANAGER_V2_INTERFACE
46 #define ZAURA_OUTPUT_MANAGER_V2_INTERFACE
47 /**
48 * @page page_iface_zaura_output_manager_v2 zaura_output_manager_v2
49 * @section page_iface_zaura_output_manager_v2_desc Description
50 *
51 * A global responsible for propagating atomic output configuration changes
52 * to clients. An output configuration is a union of added / removed outputs
53 * and updated output metrics.
54 *
55 * Added outputs arrive at the client as wl_registry.global events, removed
56 * outputs as wl_registry.global_remove events and updated output metrics as
57 * a sequence of events defined on the zaura_output_manager_v2 interface.
58 * This is followed by the manager's done event which signals the end of the
59 * transaction.
60 *
61 * The change should be processed by clients in a way that transitions from
62 * one output configuration state to another without exposing the
63 * intermediate output state to the rest of the application.
64 *
65 * Participating servers should emit the zaura_output_manager_v2 global
66 * before any wl_output globals in the sequence of wl_registry.global events.
67 *
68 * Participating clients should bind the zaura_output_manager_v2 before any
69 * wl_output globals. This ordering is required to ensure clients receive all
70 * necessary output configuration information before receiving any further
71 * server events that may reference bound wl_outputs.
72 *
73 * Clients can expect that all events comprising a configuration change are
74 * sent synchronously, one after the other, before any other server events
75 * that leverage the output as an event param.
76 * @section page_iface_zaura_output_manager_v2_api API
77 * See @ref iface_zaura_output_manager_v2.
78 */
79 /**
80 * @defgroup iface_zaura_output_manager_v2 The zaura_output_manager_v2 interface
81 *
82 * A global responsible for propagating atomic output configuration changes
83 * to clients. An output configuration is a union of added / removed outputs
84 * and updated output metrics.
85 *
86 * Added outputs arrive at the client as wl_registry.global events, removed
87 * outputs as wl_registry.global_remove events and updated output metrics as
88 * a sequence of events defined on the zaura_output_manager_v2 interface.
89 * This is followed by the manager's done event which signals the end of the
90 * transaction.
91 *
92 * The change should be processed by clients in a way that transitions from
93 * one output configuration state to another without exposing the
94 * intermediate output state to the rest of the application.
95 *
96 * Participating servers should emit the zaura_output_manager_v2 global
97 * before any wl_output globals in the sequence of wl_registry.global events.
98 *
99 * Participating clients should bind the zaura_output_manager_v2 before any
100 * wl_output globals. This ordering is required to ensure clients receive all
101 * necessary output configuration information before receiving any further
102 * server events that may reference bound wl_outputs.
103 *
104 * Clients can expect that all events comprising a configuration change are
105 * sent synchronously, one after the other, before any other server events
106 * that leverage the output as an event param.
107 */
108 extern const struct wl_interface zaura_output_manager_v2_interface;
109 #endif
110
111 /**
112 * @ingroup iface_zaura_output_manager_v2
113 * @struct zaura_output_manager_v2_listener
114 */
115 struct zaura_output_manager_v2_listener {
116 /**
117 * sent all information about the output configuration change
118 *
119 * This event is sent after all added, changed and removed output
120 * events for a given wl_output have been dispatched to the client.
121 */
122 void (*done)(void *data,
123 struct zaura_output_manager_v2 *zaura_output_manager_v2);
124 /**
125 * advertise the output's display id
126 *
127 * This event describes the 64bit display id assigned to each
128 * display by ChromeOS. The value is opaque and should not be
129 * interpreted.
130 *
131 * The event is sent immediately after the wl_registry.global event
132 * for the output and subsequently in latter display configuration
133 * changes.
134 */
135 void (*display_id)(void *data,
136 struct zaura_output_manager_v2 *zaura_output_manager_v2,
137 uint32_t output_name,
138 uint32_t display_id_hi,
139 uint32_t display_id_lo);
140 /**
141 * position of the output within the global compositor space
142 *
143 * The position event describes the location of the wl_output
144 * within the global compositor space.
145 *
146 * The event is sent immediately after the wl_registry.global event
147 * for the output and subsequently in latter display configuration
148 * changes.
149 * @param x x position within the global compositor space
150 * @param y y position within the global compositor space
151 */
152 void (*logical_position)(void *data,
153 struct zaura_output_manager_v2 *zaura_output_manager_v2,
154 uint32_t output_name,
155 int32_t x,
156 int32_t y);
157 /**
158 * size of the output in the global compositor space
159 *
160 * The logical_size event describes the logical size of the
161 * output in the global compositor space.
162 *
163 * The event is sent immediately after the wl_registry.global event
164 * for the output and subsequently in latter display configuration
165 * changes.
166 * @param width width in global compositor space
167 * @param height height in global compositor space
168 */
169 void (*logical_size)(void *data,
170 struct zaura_output_manager_v2 *zaura_output_manager_v2,
171 uint32_t output_name,
172 int32_t width,
173 int32_t height);
174 /**
175 * size of the output in pixels
176 *
177 * The physical resolution of the display in pixels. The value
178 * should not include any overscan insets or display rotation,
179 * except for any panel orientation adjustment.
180 *
181 * The event is sent immediately after the wl_registry.global event
182 * for the output and subsequently in latter display configuration
183 * changes.
184 * @param width width in global compositor space
185 * @param height height in global compositor space
186 */
187 void (*physical_size)(void *data,
188 struct zaura_output_manager_v2 *zaura_output_manager_v2,
189 uint32_t output_name,
190 int32_t width,
191 int32_t height);
192 /**
193 * advertise the work area insets for the output
194 *
195 * This event describes the work area insets for the output in
196 * logical screen coordinates, from which the work area can be
197 * calculated.
198 *
199 * The event is sent when binding to the output object and
200 * subsequently as output state changes.
201 */
202 void (*work_area_insets)(void *data,
203 struct zaura_output_manager_v2 *zaura_output_manager_v2,
204 uint32_t output_name,
205 int32_t top,
206 int32_t left,
207 int32_t bottom,
208 int32_t right);
209 /**
210 * advertise device scale factor for the output
211 *
212 * The scale factor of the output device. We reinterpret_cast the
213 * float scale factor into a 32-bit uint and later cast back into a
214 * float. This is because wayland does not support native transport
215 * of floats. As different CPU architectures may use different
216 * endian representations for IEEE 754 floats, this protocol
217 * implicitly assumes that the caller and receiver are the same
218 * machine.
219 *
220 * The event is sent immediately after the wl_registry.global event
221 * for the output and subsequently in latter display configuration
222 * changes.
223 * @param device_scale_factor display scale factor, in float format
224 */
225 void (*device_scale_factor)(void *data,
226 struct zaura_output_manager_v2 *zaura_output_manager_v2,
227 uint32_t output_name,
228 uint32_t device_scale_factor);
229 /**
230 * logical transform of the output
231 *
232 * This event describes the logical transform for the output.
233 * Whereas panel transform corresponds to the display's panel
234 * rotation, the logical transform corresponds to the display's
235 * logical rotation.
236 *
237 * The event is sent immediately after the wl_registry.global event
238 * for the output and subsequently in latter display configuration
239 * changes.
240 * @param transform transform that maps framebuffer to output
241 */
242 void (*logical_transform)(void *data,
243 struct zaura_output_manager_v2 *zaura_output_manager_v2,
244 uint32_t output_name,
245 int32_t transform);
246 /**
247 * panel transform of the output
248 *
249 * This event describes the panel transform for the output, which
250 * is the associated display's panel rotation.
251 *
252 * The event is sent immediately after the wl_registry.global event
253 * for the output and subsequently in latter display configuration
254 * changes.
255 * @param transform transform that maps framebuffer to output
256 */
257 void (*panel_transform)(void *data,
258 struct zaura_output_manager_v2 *zaura_output_manager_v2,
259 uint32_t output_name,
260 int32_t transform);
261 /**
262 * human-readable name of this output
263 *
264 * The name is a UTF-8 string with no convention defined for its
265 * contents.
266 *
267 * The event is sent immediately after the wl_registry.global event
268 * for the output and subsequently in latter display configuration
269 * changes.
270 * @param name output name
271 */
272 void (*name)(void *data,
273 struct zaura_output_manager_v2 *zaura_output_manager_v2,
274 uint32_t output_name,
275 const char *name);
276 /**
277 * human-readable description of this output
278 *
279 * The description is a UTF-8 string with no convention defined
280 * for its contents.
281 *
282 * The event is sent immediately after the wl_registry.global event
283 * for the output and subsequently in latter display configuration
284 * changes.
285 * @param description output description
286 */
287 void (*description)(void *data,
288 struct zaura_output_manager_v2 *zaura_output_manager_v2,
289 uint32_t output_name,
290 const char *description);
291 /**
292 * advertise the overscan insets for the output
293 *
294 * This event describes the overscan insets for the output in
295 * physical pixels.
296 *
297 * The event is sent immediately after the wl_registry.global event
298 * for the output and subsequently in latter display configuration
299 * changes.
300 */
301 void (*overscan_insets)(void *data,
302 struct zaura_output_manager_v2 *zaura_output_manager_v2,
303 uint32_t output_name,
304 int32_t top,
305 int32_t left,
306 int32_t bottom,
307 int32_t right);
308 /**
309 * target display for new windows
310 *
311 * Notifies that this output is now active output. It is
312 * typically used as a target when a new window is created without
313 * specific bounds.
314 */
315 void (*activated)(void *data,
316 struct zaura_output_manager_v2 *zaura_output_manager_v2,
317 uint32_t output_name);
318 };
319
320 /**
321 * @ingroup iface_zaura_output_manager_v2
322 */
323 static inline int
zaura_output_manager_v2_add_listener(struct zaura_output_manager_v2 * zaura_output_manager_v2,const struct zaura_output_manager_v2_listener * listener,void * data)324 zaura_output_manager_v2_add_listener(struct zaura_output_manager_v2 *zaura_output_manager_v2,
325 const struct zaura_output_manager_v2_listener *listener, void *data)
326 {
327 return wl_proxy_add_listener((struct wl_proxy *) zaura_output_manager_v2,
328 (void (**)(void)) listener, data);
329 }
330
331 /**
332 * @ingroup iface_zaura_output_manager_v2
333 */
334 #define ZAURA_OUTPUT_MANAGER_V2_DONE_SINCE_VERSION 1
335 /**
336 * @ingroup iface_zaura_output_manager_v2
337 */
338 #define ZAURA_OUTPUT_MANAGER_V2_DISPLAY_ID_SINCE_VERSION 1
339 /**
340 * @ingroup iface_zaura_output_manager_v2
341 */
342 #define ZAURA_OUTPUT_MANAGER_V2_LOGICAL_POSITION_SINCE_VERSION 1
343 /**
344 * @ingroup iface_zaura_output_manager_v2
345 */
346 #define ZAURA_OUTPUT_MANAGER_V2_LOGICAL_SIZE_SINCE_VERSION 1
347 /**
348 * @ingroup iface_zaura_output_manager_v2
349 */
350 #define ZAURA_OUTPUT_MANAGER_V2_PHYSICAL_SIZE_SINCE_VERSION 1
351 /**
352 * @ingroup iface_zaura_output_manager_v2
353 */
354 #define ZAURA_OUTPUT_MANAGER_V2_WORK_AREA_INSETS_SINCE_VERSION 1
355 /**
356 * @ingroup iface_zaura_output_manager_v2
357 */
358 #define ZAURA_OUTPUT_MANAGER_V2_DEVICE_SCALE_FACTOR_SINCE_VERSION 1
359 /**
360 * @ingroup iface_zaura_output_manager_v2
361 */
362 #define ZAURA_OUTPUT_MANAGER_V2_LOGICAL_TRANSFORM_SINCE_VERSION 1
363 /**
364 * @ingroup iface_zaura_output_manager_v2
365 */
366 #define ZAURA_OUTPUT_MANAGER_V2_PANEL_TRANSFORM_SINCE_VERSION 1
367 /**
368 * @ingroup iface_zaura_output_manager_v2
369 */
370 #define ZAURA_OUTPUT_MANAGER_V2_NAME_SINCE_VERSION 1
371 /**
372 * @ingroup iface_zaura_output_manager_v2
373 */
374 #define ZAURA_OUTPUT_MANAGER_V2_DESCRIPTION_SINCE_VERSION 1
375 /**
376 * @ingroup iface_zaura_output_manager_v2
377 */
378 #define ZAURA_OUTPUT_MANAGER_V2_OVERSCAN_INSETS_SINCE_VERSION 1
379 /**
380 * @ingroup iface_zaura_output_manager_v2
381 */
382 #define ZAURA_OUTPUT_MANAGER_V2_ACTIVATED_SINCE_VERSION 1
383
384
385 /** @ingroup iface_zaura_output_manager_v2 */
386 static inline void
zaura_output_manager_v2_set_user_data(struct zaura_output_manager_v2 * zaura_output_manager_v2,void * user_data)387 zaura_output_manager_v2_set_user_data(struct zaura_output_manager_v2 *zaura_output_manager_v2, void *user_data)
388 {
389 wl_proxy_set_user_data((struct wl_proxy *) zaura_output_manager_v2, user_data);
390 }
391
392 /** @ingroup iface_zaura_output_manager_v2 */
393 static inline void *
zaura_output_manager_v2_get_user_data(struct zaura_output_manager_v2 * zaura_output_manager_v2)394 zaura_output_manager_v2_get_user_data(struct zaura_output_manager_v2 *zaura_output_manager_v2)
395 {
396 return wl_proxy_get_user_data((struct wl_proxy *) zaura_output_manager_v2);
397 }
398
399 static inline uint32_t
zaura_output_manager_v2_get_version(struct zaura_output_manager_v2 * zaura_output_manager_v2)400 zaura_output_manager_v2_get_version(struct zaura_output_manager_v2 *zaura_output_manager_v2)
401 {
402 return wl_proxy_get_version((struct wl_proxy *) zaura_output_manager_v2);
403 }
404
405 /** @ingroup iface_zaura_output_manager_v2 */
406 static inline void
zaura_output_manager_v2_destroy(struct zaura_output_manager_v2 * zaura_output_manager_v2)407 zaura_output_manager_v2_destroy(struct zaura_output_manager_v2 *zaura_output_manager_v2)
408 {
409 wl_proxy_destroy((struct wl_proxy *) zaura_output_manager_v2);
410 }
411
412 #ifdef __cplusplus
413 }
414 #endif
415
416 #endif
417