ohmu
·
2026-10-15
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
11extern "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 * The logical_position and logical_size events defined in this protocol
31 * might provide information identical to their counterparts already
32 * available from wl_output, in which case the information provided by this
33 * protocol should be preferred to their equivalent in wl_output. The goal is
34 * to move the desktop specific concepts (such as output location within the
35 * global compositor space, 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 */
76struct wl_output;
77struct zxdg_output_manager_v1;
78struct 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 */
95extern 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 */
128extern 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 * @ingroup iface_zxdg_output_manager_v1
136 */
137#define ZXDG_OUTPUT_MANAGER_V1_DESTROY_SINCE_VERSION 1
138/**
139 * @ingroup iface_zxdg_output_manager_v1
140 */
141#define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT_SINCE_VERSION 1
142
143// /** @ingroup iface_zxdg_output_manager_v1 */
144// static inline void
145// zxdg_output_manager_v1_set_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, void *user_data)
146// {
147// wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_manager_v1, user_data);
148// }
149
150// /** @ingroup iface_zxdg_output_manager_v1 */
151// static inline void *
152// zxdg_output_manager_v1_get_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1)
153// {
154// return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_manager_v1);
155// }
156
157// static inline uint32_t
158// zxdg_output_manager_v1_get_version(struct zxdg_output_manager_v1 *zxdg_output_manager_v1)
159// {
160// return wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1);
161// }
162
163// /**
164// * @ingroup iface_zxdg_output_manager_v1
165// *
166// * Using this request a client can tell the server that it is not
167// * going to use the xdg_output_manager object anymore.
168// *
169// * Any objects already created through this instance are not affected.
170// */
171// static inline void
172// zxdg_output_manager_v1_destroy(struct zxdg_output_manager_v1 *zxdg_output_manager_v1)
173// {
174// wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_manager_v1,
175// ZXDG_OUTPUT_MANAGER_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1), WL_MARSHAL_FLAG_DESTROY);
176// }
177
178// /**
179// * @ingroup iface_zxdg_output_manager_v1
180// *
181// * This creates a new xdg_output object for the given wl_output.
182// */
183// static inline struct zxdg_output_v1 *
184// zxdg_output_manager_v1_get_xdg_output(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, struct wl_output *output)
185// {
186// struct wl_proxy *id;
187
188// id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_manager_v1,
189// ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1), 0, nullptr, output);
190
191// return (struct zxdg_output_v1 *) id;
192// }
193
194/**
195 * @ingroup iface_zxdg_output_v1
196 * @struct zxdg_output_v1_listener
197 */
198struct zxdg_output_v1_listener {
199 /**
200 * position of the output within the global compositor space
201 *
202 * The position event describes the location of the wl_output
203 * within the global compositor space.
204 *
205 * The logical_position event is sent after creating an xdg_output
206 * (see xdg_output_manager.get_xdg_output) and whenever the
207 * location of the output changes within the global compositor
208 * space.
209 * @param x x position within the global compositor space
210 * @param y y position within the global compositor space
211 */
212 void (*logical_position)(void* data,
213 struct zxdg_output_v1* zxdg_output_v1,
214 int32_t x,
215 int32_t y);
216 /**
217 * size of the output in the global compositor space
218 *
219 * The logical_size event describes the size of the output in the
220 * global compositor space.
221 *
222 * Most regular Wayland clients should not pay attention to the
223 * logical size and would rather rely on xdg_shell interfaces.
224 *
225 * Some clients such as Xwayland, however, need this to configure
226 * their surfaces in the global compositor space as the compositor
227 * may apply a different scale from what is advertised by the
228 * output scaling property (to achieve fractional scaling, for
229 * example).
230 *
231 * For example, for a wl_output mode 3840×2160 and a scale factor
232 * 2:
233 *
234 * - A compositor not scaling the monitor viewport in its
235 * compositing space will advertise a logical size of 3840×2160,
236 *
237 * - A compositor scaling the monitor viewport with scale factor 2
238 * will advertise a logical size of 1920×1080,
239 *
240 * - A compositor scaling the monitor viewport using a fractional
241 * scale of 1.5 will advertise a logical size of 2560×1440.
242 *
243 * For example, for a wl_output mode 1920×1080 and a 90 degree
244 * rotation, the compositor will advertise a logical size of
245 * 1080x1920.
246 *
247 * The logical_size event is sent after creating an xdg_output (see
248 * xdg_output_manager.get_xdg_output) and whenever the logical size
249 * of the output changes, either as a result of a change in the
250 * applied scale or because of a change in the corresponding output
251 * mode(see wl_output.mode) or transform (see wl_output.transform).
252 * @param width width in global compositor space
253 * @param height height in global compositor space
254 */
255 void (*logical_size)(void* data,
256 struct zxdg_output_v1* zxdg_output_v1,
257 int32_t width,
258 int32_t height);
259 /**
260 * all information about the output have been sent
261 *
262 * This event is sent after all other properties of an xdg_output
263 * have been sent.
264 *
265 * This allows changes to the xdg_output properties to be seen as
266 * atomic, even if they happen via multiple events.
267 *
268 * For objects version 3 onwards, this event is deprecated.
269 * Compositors are not required to send it anymore and must send
270 * wl_output.done instead.
271 */
272 void (*done)(void* data,
273 struct zxdg_output_v1* zxdg_output_v1);
274 /**
275 * name of this output
276 *
277 * Many compositors will assign names to their outputs, show them
278 * to the user, allow them to be configured by name, etc. The
279 * client may wish to know this name as well to offer the user
280 * similar behaviors.
281 *
282 * The naming convention is compositor defined, but limited to
283 * alphanumeric characters and dashes (-). Each name is unique
284 * among all wl_output globals, but if a wl_output global is
285 * destroyed the same name may be reused later. The names will also
286 * remain consistent across sessions with the same hardware and
287 * software configuration.
288 *
289 * Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc.
290 * However, do not assume that the name is a reflection of an
291 * underlying DRM connector, X11 connection, etc.
292 *
293 * The name event is sent after creating an xdg_output (see
294 * xdg_output_manager.get_xdg_output). This event is only sent once
295 * per xdg_output, and the name does not change over the lifetime
296 * of the wl_output global.
297 *
298 * This event is deprecated, instead clients should use
299 * wl_output.name. Compositors must still support this event.
300 * @param name output name
301 * @since 2
302 */
303 void (*name)(void* data,
304 struct zxdg_output_v1* zxdg_output_v1,
305 const char* name);
306 /**
307 * human-readable description of this output
308 *
309 * Many compositors can produce human-readable descriptions of
310 * their outputs. The client may wish to know this description as
311 * well, to communicate the user for various purposes.
312 *
313 * The description is a UTF-8 string with no convention defined for
314 * its contents. Examples might include 'Foocorp 11" Display' or
315 * 'Virtual X11 output via :1'.
316 *
317 * The description event is sent after creating an xdg_output (see
318 * xdg_output_manager.get_xdg_output) and whenever the description
319 * changes. The description is optional, and may not be sent at
320 * all.
321 *
322 * For objects of version 2 and lower, this event is only sent once
323 * per xdg_output, and the description does not change over the
324 * lifetime of the wl_output global.
325 *
326 * This event is deprecated, instead clients should use
327 * wl_output.description. Compositors must still support this
328 * event.
329 * @param description output description
330 * @since 2
331 */
332 void (*description)(void* data,
333 struct zxdg_output_v1* zxdg_output_v1,
334 const char* description);
335};
336
337/**
338 * @ingroup iface_zxdg_output_v1
339 */
340static inline int
341zxdg_output_v1_add_listener(struct zxdg_output_v1* zxdg_output_v1,
342 const struct zxdg_output_v1_listener* listener,
343 void* data) {
344 return wl_proxy_add_listener((struct wl_proxy*) zxdg_output_v1,
345 (void (**)(void)) listener,
346 data);
347}
348
349#define ZXDG_OUTPUT_V1_DESTROY 0
350
351/**
352 * @ingroup iface_zxdg_output_v1
353 */
354#define ZXDG_OUTPUT_V1_LOGICAL_POSITION_SINCE_VERSION 1
355/**
356 * @ingroup iface_zxdg_output_v1
357 */
358#define ZXDG_OUTPUT_V1_LOGICAL_SIZE_SINCE_VERSION 1
359/**
360 * @ingroup iface_zxdg_output_v1
361 */
362#define ZXDG_OUTPUT_V1_DONE_SINCE_VERSION 1
363/**
364 * @ingroup iface_zxdg_output_v1
365 */
366#define ZXDG_OUTPUT_V1_NAME_SINCE_VERSION 2
367/**
368 * @ingroup iface_zxdg_output_v1
369 */
370#define ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION 2
371
372/**
373 * @ingroup iface_zxdg_output_v1
374 */
375#define ZXDG_OUTPUT_V1_DESTROY_SINCE_VERSION 1
376
377// /** @ingroup iface_zxdg_output_v1 */
378// static inline void
379// zxdg_output_v1_set_user_data(struct zxdg_output_v1 *zxdg_output_v1, void *user_data)
380// {
381// wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_v1, user_data);
382// }
383
384// /** @ingroup iface_zxdg_output_v1 */
385// static inline void *
386// zxdg_output_v1_get_user_data(struct zxdg_output_v1 *zxdg_output_v1)
387// {
388// return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_v1);
389// }
390
391// static inline uint32_t
392// zxdg_output_v1_get_version(struct zxdg_output_v1 *zxdg_output_v1)
393// {
394// return wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1);
395// }
396
397// /**
398// * @ingroup iface_zxdg_output_v1
399// *
400// * Using this request a client can tell the server that it is not
401// * going to use the xdg_output object anymore.
402// */
403// static inline void
404// zxdg_output_v1_destroy(struct zxdg_output_v1 *zxdg_output_v1)
405// {
406// wl_proxy_marshal_flags((struct wl_proxy *) zxdg_output_v1,
407// ZXDG_OUTPUT_V1_DESTROY, nullptr, wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1), WL_MARSHAL_FLAG_DESTROY);
408// }
409
410#ifdef __cplusplus
411}
412#endif
413
414#endif