1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /**
15 * @page page_xdg_output_unstable_v1 The xdg_output_unstable_v1 protocol
16 * Protocol to describe output regions
17 *
18 * @section page_desc_xdg_output_unstable_v1 Description
19 *
20 * This protocol aims at describing outputs in a way which is more in line
21 * with the concept of an output on desktop oriented systems.
22 *
23 * Some information are more specific to the concept of an output for
24 * a desktop oriented system and may not make sense in other applications,
25 * such as IVI systems for example.
26 *
27 * Typically, the global compositor space on a desktop system is made of
28 * a contiguous or overlapping set of rectangular regions.
29 *
30 * Some of the information provided in this protocol might be identical
31 * to their counterparts already available from wl_output, in which case
32 * the information provided by this protocol should be preferred to their
33 * equivalent in wl_output. The goal is to move the desktop specific
34 * concepts (such as output location within the global compositor space,
35 * the connector name and types, etc.) out of the core wl_output protocol.
36 *
37 * Warning! The protocol described in this file is experimental and
38 * backward incompatible changes may be made. Backward compatible
39 * changes may be added together with the corresponding interface
40 * version bump.
41 * Backward incompatible changes are done by bumping the version
42 * number in the protocol and interface names and resetting the
43 * interface version. Once the protocol is to be declared stable,
44 * the 'z' prefix and the version number in the protocol and
45 * interface names are removed and the interface version number is
46 * reset.
47 *
48 * @section page_ifaces_xdg_output_unstable_v1 Interfaces
49 * - @subpage page_iface_zxdg_output_manager_v1 - manage xdg_output objects
50 * - @subpage page_iface_zxdg_output_v1 - compositor logical output region
51 * @section page_copyright_xdg_output_unstable_v1 Copyright
52 * <pre>
53 *
54 * Copyright © 2017 Red Hat Inc.
55 *
56 * Permission is hereby granted, free of charge, to any person obtaining a
57 * copy of this software and associated documentation files (the "Software"),
58 * to deal in the Software without restriction, including without limitation
59 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
60 * and/or sell copies of the Software, and to permit persons to whom the
61 * Software is furnished to do so, subject to the following conditions:
62 *
63 * The above copyright notice and this permission notice (including the next
64 * paragraph) shall be included in all copies or substantial portions of the
65 * Software.
66 *
67 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
68 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
69 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
70 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
71 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
72 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
73 * DEALINGS IN THE SOFTWARE.
74 * </pre>
75 */
76 struct wl_output;
77 struct zxdg_output_manager_v1;
78 struct zxdg_output_v1;
79
80 #ifndef ZXDG_OUTPUT_MANAGER_V1_INTERFACE
81 #define ZXDG_OUTPUT_MANAGER_V1_INTERFACE
82 /**
83 * @page page_iface_zxdg_output_manager_v1 zxdg_output_manager_v1
84 * @section page_iface_zxdg_output_manager_v1_desc Description
85 *
86 * A global factory interface for xdg_output objects.
87 * @section page_iface_zxdg_output_manager_v1_api API
88 * See @ref iface_zxdg_output_manager_v1.
89 */
90 /**
91 * @defgroup iface_zxdg_output_manager_v1 The zxdg_output_manager_v1 interface
92 *
93 * A global factory interface for xdg_output objects.
94 */
95 extern const struct wl_interface zxdg_output_manager_v1_interface;
96 #endif
97 #ifndef ZXDG_OUTPUT_V1_INTERFACE
98 #define ZXDG_OUTPUT_V1_INTERFACE
99 /**
100 * @page page_iface_zxdg_output_v1 zxdg_output_v1
101 * @section page_iface_zxdg_output_v1_desc Description
102 *
103 * An xdg_output describes part of the compositor geometry.
104 *
105 * This typically corresponds to a monitor that displays part of the
106 * compositor space.
107 *
108 * For objects version 3 onwards, after all xdg_output properties have been
109 * sent (when the object is created and when properties are updated), a
110 * wl_output.done event is sent. This allows changes to the output
111 * properties to be seen as atomic, even if they happen via multiple events.
112 * @section page_iface_zxdg_output_v1_api API
113 * See @ref iface_zxdg_output_v1.
114 */
115 /**
116 * @defgroup iface_zxdg_output_v1 The zxdg_output_v1 interface
117 *
118 * An xdg_output describes part of the compositor geometry.
119 *
120 * This typically corresponds to a monitor that displays part of the
121 * compositor space.
122 *
123 * For objects version 3 onwards, after all xdg_output properties have been
124 * sent (when the object is created and when properties are updated), a
125 * wl_output.done event is sent. This allows changes to the output
126 * properties to be seen as atomic, even if they happen via multiple events.
127 */
128 extern const struct wl_interface zxdg_output_v1_interface;
129 #endif
130
131 #define ZXDG_OUTPUT_MANAGER_V1_DESTROY 0
132 #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT 1
133
134
135 /**
136 * @ingroup iface_zxdg_output_manager_v1
137 */
138 #define ZXDG_OUTPUT_MANAGER_V1_DESTROY_SINCE_VERSION 1
139 /**
140 * @ingroup iface_zxdg_output_manager_v1
141 */
142 #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT_SINCE_VERSION 1
143
144 /** @ingroup iface_zxdg_output_manager_v1 */
145 static inline void
zxdg_output_manager_v1_set_user_data(struct zxdg_output_manager_v1 * zxdg_output_manager_v1,void * user_data)146 zxdg_output_manager_v1_set_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, void *user_data)
147 {
148 wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_manager_v1, user_data);
149 }
150
151 /** @ingroup iface_zxdg_output_manager_v1 */
152 static inline void *
zxdg_output_manager_v1_get_user_data(struct zxdg_output_manager_v1 * zxdg_output_manager_v1)153 zxdg_output_manager_v1_get_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1)
154 {
155 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_manager_v1);
156 }
157
158 static inline uint32_t
zxdg_output_manager_v1_get_version(struct zxdg_output_manager_v1 * zxdg_output_manager_v1)159 zxdg_output_manager_v1_get_version(struct zxdg_output_manager_v1 *zxdg_output_manager_v1)
160 {
161 return wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1);
162 }
163
164 /**
165 * @ingroup iface_zxdg_output_manager_v1
166 *
167 * Using this request a client can tell the server that it is not
168 * going to use the xdg_output_manager object anymore.
169 *
170 * Any objects already created through this instance are not affected.
171 */
172 static inline void
zxdg_output_manager_v1_destroy(struct zxdg_output_manager_v1 * zxdg_output_manager_v1)173 zxdg_output_manager_v1_destroy(struct zxdg_output_manager_v1 *zxdg_output_manager_v1)
174 {
175 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_manager_v1,
176 ZXDG_OUTPUT_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1), WL_MARSHAL_FLAG_DESTROY);
177 }
178
179 /**
180 * @ingroup iface_zxdg_output_manager_v1
181 *
182 * This creates a new xdg_output object for the given wl_output.
183 */
184 static inline struct zxdg_output_v1 *
zxdg_output_manager_v1_get_xdg_output(struct zxdg_output_manager_v1 * zxdg_output_manager_v1,struct wl_output * output)185 zxdg_output_manager_v1_get_xdg_output(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, struct wl_output *output)
186 {
187 struct wl_proxy *id;
188
189 id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_manager_v1,
190 ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1), 0, NULL, output);
191
192 return (struct zxdg_output_v1 *) id;
193 }
194
195 /**
196 * @ingroup iface_zxdg_output_v1
197 * @struct zxdg_output_v1_listener
198 */
199 struct zxdg_output_v1_listener {
200 /**
201 * position of the output within the global compositor space
202 *
203 * The position event describes the location of the wl_output
204 * within the global compositor space.
205 *
206 * The logical_position event is sent after creating an xdg_output
207 * (see xdg_output_manager.get_xdg_output) and whenever the
208 * location of the output changes within the global compositor
209 * space.
210 * @param x x position within the global compositor space
211 * @param y y position within the global compositor space
212 */
213 void (*logical_position)(void *data,
214 struct zxdg_output_v1 *zxdg_output_v1,
215 int32_t x,
216 int32_t y);
217 /**
218 * size of the output in the global compositor space
219 *
220 * The logical_size event describes the size of the output in the
221 * global compositor space.
222 *
223 * For example, a surface without any buffer scale, transformation
224 * nor rotation set, with the size matching the logical_size will
225 * have the same size as the corresponding output when displayed.
226 *
227 * Most regular Wayland clients should not pay attention to the
228 * logical size and would rather rely on xdg_shell interfaces.
229 *
230 * Some clients such as Xwayland, however, need this to configure
231 * their surfaces in the global compositor space as the compositor
232 * may apply a different scale from what is advertised by the
233 * output scaling property (to achieve fractional scaling, for
234 * example).
235 *
236 * For example, for a wl_output mode 3840×2160 and a scale factor
237 * 2:
238 *
239 * - A compositor not scaling the surface buffers will advertise a
240 * logical size of 3840×2160,
241 *
242 * - A compositor automatically scaling the surface buffers will
243 * advertise a logical size of 1920×1080,
244 *
245 * - A compositor using a fractional scale of 1.5 will advertise a
246 * logical size of 2560×1440.
247 *
248 * For example, for a wl_output mode 1920×1080 and a 90 degree
249 * rotation, the compositor will advertise a logical size of
250 * 1080x1920.
251 *
252 * The logical_size event is sent after creating an xdg_output (see
253 * xdg_output_manager.get_xdg_output) and whenever the logical size
254 * of the output changes, either as a result of a change in the
255 * applied scale or because of a change in the corresponding output
256 * mode(see wl_output.mode) or transform (see wl_output.transform).
257 * @param width width in global compositor space
258 * @param height height in global compositor space
259 */
260 void (*logical_size)(void *data,
261 struct zxdg_output_v1 *zxdg_output_v1,
262 int32_t width,
263 int32_t height);
264 /**
265 * all information about the output have been sent
266 *
267 * This event is sent after all other properties of an xdg_output
268 * have been sent.
269 *
270 * This allows changes to the xdg_output properties to be seen as
271 * atomic, even if they happen via multiple events.
272 *
273 * For objects version 3 onwards, this event is deprecated.
274 * Compositors are not required to send it anymore and must send
275 * wl_output.done instead.
276 */
277 void (*done)(void *data,
278 struct zxdg_output_v1 *zxdg_output_v1);
279 /**
280 * name of this output
281 *
282 * Many compositors will assign names to their outputs, show them
283 * to the user, allow them to be configured by name, etc. The
284 * client may wish to know this name as well to offer the user
285 * similar behaviors.
286 *
287 * The naming convention is compositor defined, but limited to
288 * alphanumeric characters and dashes (-). Each name is unique
289 * among all wl_output globals, but if a wl_output global is
290 * destroyed the same name may be reused later. The names will also
291 * remain consistent across sessions with the same hardware and
292 * software configuration.
293 *
294 * Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc.
295 * However, do not assume that the name is a reflection of an
296 * underlying DRM connector, X11 connection, etc.
297 *
298 * The name event is sent after creating an xdg_output (see
299 * xdg_output_manager.get_xdg_output). This event is only sent once
300 * per xdg_output, and the name does not change over the lifetime
301 * of the wl_output global.
302 * @param name output name
303 * @since 2
304 */
305 void (*name)(void *data,
306 struct zxdg_output_v1 *zxdg_output_v1,
307 const char *name);
308 /**
309 * human-readable description of this output
310 *
311 * Many compositors can produce human-readable descriptions of
312 * their outputs. The client may wish to know this description as
313 * well, to communicate the user for various purposes.
314 *
315 * The description is a UTF-8 string with no convention defined for
316 * its contents. Examples might include 'Foocorp 11" Display' or
317 * 'Virtual X11 output via :1'.
318 *
319 * The description event is sent after creating an xdg_output (see
320 * xdg_output_manager.get_xdg_output) and whenever the description
321 * changes. The description is optional, and may not be sent at
322 * all.
323 *
324 * For objects of version 2 and lower, this event is only sent once
325 * per xdg_output, and the description does not change over the
326 * lifetime of the wl_output global.
327 * @param description output description
328 * @since 2
329 */
330 void (*description)(void *data,
331 struct zxdg_output_v1 *zxdg_output_v1,
332 const char *description);
333 };
334
335 /**
336 * @ingroup iface_zxdg_output_v1
337 */
338 static inline int
zxdg_output_v1_add_listener(struct zxdg_output_v1 * zxdg_output_v1,const struct zxdg_output_v1_listener * listener,void * data)339 zxdg_output_v1_add_listener(struct zxdg_output_v1 *zxdg_output_v1,
340 const struct zxdg_output_v1_listener *listener, void *data)
341 {
342 return wl_proxy_add_listener((struct wl_proxy *) zxdg_output_v1,
343 (void (**)(void)) listener, data);
344 }
345
346 #define ZXDG_OUTPUT_V1_DESTROY 0
347
348 /**
349 * @ingroup iface_zxdg_output_v1
350 */
351 #define ZXDG_OUTPUT_V1_LOGICAL_POSITION_SINCE_VERSION 1
352 /**
353 * @ingroup iface_zxdg_output_v1
354 */
355 #define ZXDG_OUTPUT_V1_LOGICAL_SIZE_SINCE_VERSION 1
356 /**
357 * @ingroup iface_zxdg_output_v1
358 */
359 #define ZXDG_OUTPUT_V1_DONE_SINCE_VERSION 1
360 /**
361 * @ingroup iface_zxdg_output_v1
362 */
363 #define ZXDG_OUTPUT_V1_NAME_SINCE_VERSION 2
364 /**
365 * @ingroup iface_zxdg_output_v1
366 */
367 #define ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION 2
368
369 /**
370 * @ingroup iface_zxdg_output_v1
371 */
372 #define ZXDG_OUTPUT_V1_DESTROY_SINCE_VERSION 1
373
374 /** @ingroup iface_zxdg_output_v1 */
375 static inline void
zxdg_output_v1_set_user_data(struct zxdg_output_v1 * zxdg_output_v1,void * user_data)376 zxdg_output_v1_set_user_data(struct zxdg_output_v1 *zxdg_output_v1, void *user_data)
377 {
378 wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_v1, user_data);
379 }
380
381 /** @ingroup iface_zxdg_output_v1 */
382 static inline void *
zxdg_output_v1_get_user_data(struct zxdg_output_v1 * zxdg_output_v1)383 zxdg_output_v1_get_user_data(struct zxdg_output_v1 *zxdg_output_v1)
384 {
385 return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_v1);
386 }
387
388 static inline uint32_t
zxdg_output_v1_get_version(struct zxdg_output_v1 * zxdg_output_v1)389 zxdg_output_v1_get_version(struct zxdg_output_v1 *zxdg_output_v1)
390 {
391 return wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1);
392 }
393
394 /**
395 * @ingroup iface_zxdg_output_v1
396 *
397 * Using this request a client can tell the server that it is not
398 * going to use the xdg_output object anymore.
399 */
400 static inline void
zxdg_output_v1_destroy(struct zxdg_output_v1 * zxdg_output_v1)401 zxdg_output_v1_destroy(struct zxdg_output_v1 *zxdg_output_v1)
402 {
403 wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_v1,
404 ZXDG_OUTPUT_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1), WL_MARSHAL_FLAG_DESTROY);
405 }
406
407 #ifdef __cplusplus
408 }
409 #endif
410
411 #endif
412