1 /* Generated by wayland-scanner 1.18.0 */
3 #ifndef XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
8 #include "wayland-client.h"
15 * @page page_xdg_output_unstable_v1 The xdg_output_unstable_v1 protocol
16 * Protocol to describe output regions
18 * @section page_desc_xdg_output_unstable_v1 Description
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.
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.
27 * Typically, the global compositor space on a desktop system is made of
28 * a contiguous or overlapping set of rectangular regions.
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.
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
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
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
54 * Copyright © 2017 Red Hat Inc.
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:
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
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.
77 struct zxdg_output_manager_v1
;
78 struct zxdg_output_v1
;
81 * @page page_iface_zxdg_output_manager_v1 zxdg_output_manager_v1
82 * @section page_iface_zxdg_output_manager_v1_desc Description
84 * A global factory interface for xdg_output objects.
85 * @section page_iface_zxdg_output_manager_v1_api API
86 * See @ref iface_zxdg_output_manager_v1.
89 * @defgroup iface_zxdg_output_manager_v1 The zxdg_output_manager_v1 interface
91 * A global factory interface for xdg_output objects.
93 extern const struct wl_interface zxdg_output_manager_v1_interface
;
95 * @page page_iface_zxdg_output_v1 zxdg_output_v1
96 * @section page_iface_zxdg_output_v1_desc Description
98 * An xdg_output describes part of the compositor geometry.
100 * This typically corresponds to a monitor that displays part of the
103 * For objects version 3 onwards, after all xdg_output properties have been
104 * sent (when the object is created and when properties are updated), a
105 * wl_output.done event is sent. This allows changes to the output
106 * properties to be seen as atomic, even if they happen via multiple events.
107 * @section page_iface_zxdg_output_v1_api API
108 * See @ref iface_zxdg_output_v1.
111 * @defgroup iface_zxdg_output_v1 The zxdg_output_v1 interface
113 * An xdg_output describes part of the compositor geometry.
115 * This typically corresponds to a monitor that displays part of the
118 * For objects version 3 onwards, after all xdg_output properties have been
119 * sent (when the object is created and when properties are updated), a
120 * wl_output.done event is sent. This allows changes to the output
121 * properties to be seen as atomic, even if they happen via multiple events.
123 extern const struct wl_interface zxdg_output_v1_interface
;
125 #define ZXDG_OUTPUT_MANAGER_V1_DESTROY 0
126 #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT 1
129 * @ingroup iface_zxdg_output_manager_v1
131 #define ZXDG_OUTPUT_MANAGER_V1_DESTROY_SINCE_VERSION 1
133 * @ingroup iface_zxdg_output_manager_v1
135 #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT_SINCE_VERSION 1
137 /** @ingroup iface_zxdg_output_manager_v1 */
138 static inline void zxdg_output_manager_v1_set_user_data(
139 struct zxdg_output_manager_v1
* zxdg_output_manager_v1
, void* user_data
) {
140 wl_proxy_set_user_data((struct wl_proxy
*)zxdg_output_manager_v1
, user_data
);
143 /** @ingroup iface_zxdg_output_manager_v1 */
144 static inline void* zxdg_output_manager_v1_get_user_data(
145 struct zxdg_output_manager_v1
* zxdg_output_manager_v1
) {
146 return wl_proxy_get_user_data((struct wl_proxy
*)zxdg_output_manager_v1
);
149 static inline uint32_t zxdg_output_manager_v1_get_version(
150 struct zxdg_output_manager_v1
* zxdg_output_manager_v1
) {
151 return wl_proxy_get_version((struct wl_proxy
*)zxdg_output_manager_v1
);
155 * @ingroup iface_zxdg_output_manager_v1
157 * Using this request a client can tell the server that it is not
158 * going to use the xdg_output_manager object anymore.
160 * Any objects already created through this instance are not affected.
162 static inline void zxdg_output_manager_v1_destroy(
163 struct zxdg_output_manager_v1
* zxdg_output_manager_v1
) {
164 wl_proxy_marshal((struct wl_proxy
*)zxdg_output_manager_v1
,
165 ZXDG_OUTPUT_MANAGER_V1_DESTROY
);
167 wl_proxy_destroy((struct wl_proxy
*)zxdg_output_manager_v1
);
171 * @ingroup iface_zxdg_output_manager_v1
173 * This creates a new xdg_output object for the given wl_output.
175 static inline struct zxdg_output_v1
* zxdg_output_manager_v1_get_xdg_output(
176 struct zxdg_output_manager_v1
* zxdg_output_manager_v1
,
177 struct wl_output
* output
) {
180 id
= wl_proxy_marshal_constructor((struct wl_proxy
*)zxdg_output_manager_v1
,
181 ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT
,
182 &zxdg_output_v1_interface
, NULL
, output
);
184 return (struct zxdg_output_v1
*)id
;
188 * @ingroup iface_zxdg_output_v1
189 * @struct zxdg_output_v1_listener
191 struct zxdg_output_v1_listener
{
193 * position of the output within the global compositor space
195 * The position event describes the location of the wl_output
196 * within the global compositor space.
198 * The logical_position event is sent after creating an xdg_output
199 * (see xdg_output_manager.get_xdg_output) and whenever the
200 * location of the output changes within the global compositor
202 * @param x x position within the global compositor space
203 * @param y y position within the global compositor space
205 void (*logical_position
)(void* data
, struct zxdg_output_v1
* zxdg_output_v1
,
206 int32_t x
, int32_t y
);
208 * size of the output in the global compositor space
210 * The logical_size event describes the size of the output in the
211 * global compositor space.
213 * For example, a surface without any buffer scale, transformation
214 * nor rotation set, with the size matching the logical_size will
215 * have the same size as the corresponding output when displayed.
217 * Most regular Wayland clients should not pay attention to the
218 * logical size and would rather rely on xdg_shell interfaces.
220 * Some clients such as Xwayland, however, need this to configure
221 * their surfaces in the global compositor space as the compositor
222 * may apply a different scale from what is advertised by the
223 * output scaling property (to achieve fractional scaling, for
226 * For example, for a wl_output mode 3840×2160 and a scale factor
229 * - A compositor not scaling the surface buffers will advertise a
230 * logical size of 3840×2160,
232 * - A compositor automatically scaling the surface buffers will
233 * advertise a logical size of 1920×1080,
235 * - A compositor using a fractional scale of 1.5 will advertise a
236 * logical size to 2560×1620.
238 * For example, for a wl_output mode 1920×1080 and a 90 degree
239 * rotation, the compositor will advertise a logical size of
242 * The logical_size event is sent after creating an xdg_output (see
243 * xdg_output_manager.get_xdg_output) and whenever the logical size
244 * of the output changes, either as a result of a change in the
245 * applied scale or because of a change in the corresponding output
246 * mode(see wl_output.mode) or transform (see wl_output.transform).
247 * @param width width in global compositor space
248 * @param height height in global compositor space
250 void (*logical_size
)(void* data
, struct zxdg_output_v1
* zxdg_output_v1
,
251 int32_t width
, int32_t height
);
253 * all information about the output have been sent
255 * This event is sent after all other properties of an xdg_output
258 * This allows changes to the xdg_output properties to be seen as
259 * atomic, even if they happen via multiple events.
261 * For objects version 3 onwards, this event is deprecated.
262 * Compositors are not required to send it anymore and must send
263 * wl_output.done instead.
265 void (*done
)(void* data
, struct zxdg_output_v1
* zxdg_output_v1
);
267 * name of this output
269 * Many compositors will assign names to their outputs, show them
270 * to the user, allow them to be configured by name, etc. The
271 * client may wish to know this name as well to offer the user
274 * The naming convention is compositor defined, but limited to
275 * alphanumeric characters and dashes (-). Each name is unique
276 * among all wl_output globals, but if a wl_output global is
277 * destroyed the same name may be reused later. The names will also
278 * remain consistent across sessions with the same hardware and
279 * software configuration.
281 * Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc.
282 * However, do not assume that the name is a reflection of an
283 * underlying DRM connector, X11 connection, etc.
285 * The name event is sent after creating an xdg_output (see
286 * xdg_output_manager.get_xdg_output). This event is only sent once
287 * per xdg_output, and the name does not change over the lifetime
288 * of the wl_output global.
289 * @param name output name
292 void (*name
)(void* data
, struct zxdg_output_v1
* zxdg_output_v1
,
295 * human-readable description of this output
297 * Many compositors can produce human-readable descriptions of
298 * their outputs. The client may wish to know this description as
299 * well, to communicate the user for various purposes.
301 * The description is a UTF-8 string with no convention defined for
302 * its contents. Examples might include 'Foocorp 11" Display' or
303 * 'Virtual X11 output via :1'.
305 * The description event is sent after creating an xdg_output (see
306 * xdg_output_manager.get_xdg_output) and whenever the description
307 * changes. The description is optional, and may not be sent at
310 * For objects of version 2 and lower, this event is only sent once
311 * per xdg_output, and the description does not change over the
312 * lifetime of the wl_output global.
313 * @param description output description
316 void (*description
)(void* data
, struct zxdg_output_v1
* zxdg_output_v1
,
317 const char* description
);
321 * @ingroup iface_zxdg_output_v1
323 static inline int zxdg_output_v1_add_listener(
324 struct zxdg_output_v1
* zxdg_output_v1
,
325 const struct zxdg_output_v1_listener
* listener
, void* data
) {
326 return wl_proxy_add_listener((struct wl_proxy
*)zxdg_output_v1
,
327 (void (**)(void))listener
, data
);
330 #define ZXDG_OUTPUT_V1_DESTROY 0
333 * @ingroup iface_zxdg_output_v1
335 #define ZXDG_OUTPUT_V1_LOGICAL_POSITION_SINCE_VERSION 1
337 * @ingroup iface_zxdg_output_v1
339 #define ZXDG_OUTPUT_V1_LOGICAL_SIZE_SINCE_VERSION 1
341 * @ingroup iface_zxdg_output_v1
343 #define ZXDG_OUTPUT_V1_DONE_SINCE_VERSION 1
345 * @ingroup iface_zxdg_output_v1
347 #define ZXDG_OUTPUT_V1_NAME_SINCE_VERSION 2
349 * @ingroup iface_zxdg_output_v1
351 #define ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION 2
354 * @ingroup iface_zxdg_output_v1
356 #define ZXDG_OUTPUT_V1_DESTROY_SINCE_VERSION 1
358 /** @ingroup iface_zxdg_output_v1 */
359 static inline void zxdg_output_v1_set_user_data(
360 struct zxdg_output_v1
* zxdg_output_v1
, void* user_data
) {
361 wl_proxy_set_user_data((struct wl_proxy
*)zxdg_output_v1
, user_data
);
364 /** @ingroup iface_zxdg_output_v1 */
365 static inline void* zxdg_output_v1_get_user_data(
366 struct zxdg_output_v1
* zxdg_output_v1
) {
367 return wl_proxy_get_user_data((struct wl_proxy
*)zxdg_output_v1
);
370 static inline uint32_t zxdg_output_v1_get_version(
371 struct zxdg_output_v1
* zxdg_output_v1
) {
372 return wl_proxy_get_version((struct wl_proxy
*)zxdg_output_v1
);
376 * @ingroup iface_zxdg_output_v1
378 * Using this request a client can tell the server that it is not
379 * going to use the xdg_output object anymore.
381 static inline void zxdg_output_v1_destroy(
382 struct zxdg_output_v1
* zxdg_output_v1
) {
383 wl_proxy_marshal((struct wl_proxy
*)zxdg_output_v1
, ZXDG_OUTPUT_V1_DESTROY
);
385 wl_proxy_destroy((struct wl_proxy
*)zxdg_output_v1
);