AtlatestRepositorysigil-ui

sigil-ui / tree / native / wayland / includewayland-client-protocol.h

1/* Generated by wayland-scanner 1.24.0 */
2
3#ifndef WAYLAND_CLIENT_PROTOCOL_H
4#define WAYLAND_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
14/**
15 * @page page_wayland The wayland protocol
16 * @section page_ifaces_wayland Interfaces
17 * - @subpage page_iface_wl_display - core global object
18 * - @subpage page_iface_wl_registry - global registry object
19 * - @subpage page_iface_wl_callback - callback object
20 * - @subpage page_iface_wl_compositor - the compositor singleton
21 * - @subpage page_iface_wl_shm_pool - a shared memory pool
22 * - @subpage page_iface_wl_shm - shared memory support
23 * - @subpage page_iface_wl_buffer - content for a wl_surface
24 * - @subpage page_iface_wl_data_offer - offer to transfer data
25 * - @subpage page_iface_wl_data_source - offer to transfer data
26 * - @subpage page_iface_wl_data_device - data transfer device
27 * - @subpage page_iface_wl_data_device_manager - data transfer interface
28 * - @subpage page_iface_wl_shell - create desktop-style surfaces
29 * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface
30 * - @subpage page_iface_wl_surface - an onscreen surface
31 * - @subpage page_iface_wl_seat - group of input devices
32 * - @subpage page_iface_wl_pointer - pointer input device
33 * - @subpage page_iface_wl_keyboard - keyboard input device
34 * - @subpage page_iface_wl_touch - touchscreen input device
35 * - @subpage page_iface_wl_output - compositor output region
36 * - @subpage page_iface_wl_region - region interface
37 * - @subpage page_iface_wl_subcompositor - sub-surface compositing
38 * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface
39 * - @subpage page_iface_wl_fixes - wayland protocol fixes
40 * @section page_copyright_wayland Copyright
41 * <pre>
42 *
43 * Copyright © 2008-2011 Kristian Høgsberg
44 * Copyright © 2010-2011 Intel Corporation
45 * Copyright © 2012-2013 Collabora, Ltd.
46 *
47 * Permission is hereby granted, free of charge, to any person
48 * obtaining a copy of this software and associated documentation files
49 * (the "Software"), to deal in the Software without restriction,
50 * including without limitation the rights to use, copy, modify, merge,
51 * publish, distribute, sublicense, and/or sell copies of the Software,
52 * and to permit persons to whom the Software is furnished to do so,
53 * subject to the following conditions:
54 *
55 * The above copyright notice and this permission notice (including the
56 * next paragraph) shall be included in all copies or substantial
57 * portions of the Software.
58 *
59 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
60 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
61 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
62 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
63 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
64 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
65 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
66 * SOFTWARE.
67 * </pre>
68 */
69struct wl_buffer;
70struct wl_callback;
71struct wl_compositor;
72struct wl_data_device;
73struct wl_data_device_manager;
74struct wl_data_offer;
75struct wl_data_source;
76struct wl_display;
77struct wl_fixes;
78struct wl_keyboard;
79struct wl_output;
80struct wl_pointer;
81struct wl_region;
82struct wl_registry;
83struct wl_seat;
84struct wl_shell;
85struct wl_shell_surface;
86struct wl_shm;
87struct wl_shm_pool;
88struct wl_subcompositor;
89struct wl_subsurface;
90struct wl_surface;
91struct wl_touch;
93#ifndef WL_DISPLAY_INTERFACE
94#define WL_DISPLAY_INTERFACE
95/**
96 * @page page_iface_wl_display wl_display
97 * @section page_iface_wl_display_desc Description
98 *
99 * The core global object. This is a special singleton object. It
100 * is used for internal Wayland protocol features.
101 * @section page_iface_wl_display_api API
102 * See @ref iface_wl_display.
103 */
104/**
105 * @defgroup iface_wl_display The wl_display interface
106 *
107 * The core global object. This is a special singleton object. It
108 * is used for internal Wayland protocol features.
109 */
110extern const struct wl_interface wl_display_interface;
111#endif
112#ifndef WL_REGISTRY_INTERFACE
113#define WL_REGISTRY_INTERFACE
114/**
115 * @page page_iface_wl_registry wl_registry
116 * @section page_iface_wl_registry_desc Description
117 *
118 * The singleton global registry object. The server has a number of
119 * global objects that are available to all clients. These objects
120 * typically represent an actual object in the server (for example,
121 * an input device) or they are singleton objects that provide
122 * extension functionality.
123 *
124 * When a client creates a registry object, the registry object
125 * will emit a global event for each global currently in the
126 * registry. Globals come and go as a result of device or
127 * monitor hotplugs, reconfiguration or other events, and the
128 * registry will send out global and global_remove events to
129 * keep the client up to date with the changes. To mark the end
130 * of the initial burst of events, the client can use the
131 * wl_display.sync request immediately after calling
132 * wl_display.get_registry.
133 *
134 * A client can bind to a global object by using the bind
135 * request. This creates a client-side handle that lets the object
136 * emit events to the client and lets the client invoke requests on
137 * the object.
138 * @section page_iface_wl_registry_api API
139 * See @ref iface_wl_registry.
140 */
141/**
142 * @defgroup iface_wl_registry The wl_registry interface
143 *
144 * The singleton global registry object. The server has a number of
145 * global objects that are available to all clients. These objects
146 * typically represent an actual object in the server (for example,
147 * an input device) or they are singleton objects that provide
148 * extension functionality.
149 *
150 * When a client creates a registry object, the registry object
151 * will emit a global event for each global currently in the
152 * registry. Globals come and go as a result of device or
153 * monitor hotplugs, reconfiguration or other events, and the
154 * registry will send out global and global_remove events to
155 * keep the client up to date with the changes. To mark the end
156 * of the initial burst of events, the client can use the
157 * wl_display.sync request immediately after calling
158 * wl_display.get_registry.
159 *
160 * A client can bind to a global object by using the bind
161 * request. This creates a client-side handle that lets the object
162 * emit events to the client and lets the client invoke requests on
163 * the object.
164 */
165extern const struct wl_interface wl_registry_interface;
166#endif
167#ifndef WL_CALLBACK_INTERFACE
168#define WL_CALLBACK_INTERFACE
169/**
170 * @page page_iface_wl_callback wl_callback
171 * @section page_iface_wl_callback_desc Description
172 *
173 * Clients can handle the 'done' event to get notified when
174 * the related request is done.
175 *
176 * Note, because wl_callback objects are created from multiple independent
177 * factory interfaces, the wl_callback interface is frozen at version 1.
178 * @section page_iface_wl_callback_api API
179 * See @ref iface_wl_callback.
180 */
181/**
182 * @defgroup iface_wl_callback The wl_callback interface
183 *
184 * Clients can handle the 'done' event to get notified when
185 * the related request is done.
186 *
187 * Note, because wl_callback objects are created from multiple independent
188 * factory interfaces, the wl_callback interface is frozen at version 1.
189 */
190extern const struct wl_interface wl_callback_interface;
191#endif
192#ifndef WL_COMPOSITOR_INTERFACE
193#define WL_COMPOSITOR_INTERFACE
194/**
195 * @page page_iface_wl_compositor wl_compositor
196 * @section page_iface_wl_compositor_desc Description
197 *
198 * A compositor. This object is a singleton global. The
199 * compositor is in charge of combining the contents of multiple
200 * surfaces into one displayable output.
201 * @section page_iface_wl_compositor_api API
202 * See @ref iface_wl_compositor.
203 */
204/**
205 * @defgroup iface_wl_compositor The wl_compositor interface
206 *
207 * A compositor. This object is a singleton global. The
208 * compositor is in charge of combining the contents of multiple
209 * surfaces into one displayable output.
210 */
211extern const struct wl_interface wl_compositor_interface;
212#endif
213#ifndef WL_SHM_POOL_INTERFACE
214#define WL_SHM_POOL_INTERFACE
215/**
216 * @page page_iface_wl_shm_pool wl_shm_pool
217 * @section page_iface_wl_shm_pool_desc Description
218 *
219 * The wl_shm_pool object encapsulates a piece of memory shared
220 * between the compositor and client. Through the wl_shm_pool
221 * object, the client can allocate shared memory wl_buffer objects.
222 * All objects created through the same pool share the same
223 * underlying mapped memory. Reusing the mapped memory avoids the
224 * setup/teardown overhead and is useful when interactively resizing
225 * a surface or for many small buffers.
226 * @section page_iface_wl_shm_pool_api API
227 * See @ref iface_wl_shm_pool.
228 */
229/**
230 * @defgroup iface_wl_shm_pool The wl_shm_pool interface
231 *
232 * The wl_shm_pool object encapsulates a piece of memory shared
233 * between the compositor and client. Through the wl_shm_pool
234 * object, the client can allocate shared memory wl_buffer objects.
235 * All objects created through the same pool share the same
236 * underlying mapped memory. Reusing the mapped memory avoids the
237 * setup/teardown overhead and is useful when interactively resizing
238 * a surface or for many small buffers.
239 */
240extern const struct wl_interface wl_shm_pool_interface;
241#endif
242#ifndef WL_SHM_INTERFACE
243#define WL_SHM_INTERFACE
244/**
245 * @page page_iface_wl_shm wl_shm
246 * @section page_iface_wl_shm_desc Description
247 *
248 * A singleton global object that provides support for shared
249 * memory.
250 *
251 * Clients can create wl_shm_pool objects using the create_pool
252 * request.
253 *
254 * On binding the wl_shm object one or more format events
255 * are emitted to inform clients about the valid pixel formats
256 * that can be used for buffers.
257 * @section page_iface_wl_shm_api API
258 * See @ref iface_wl_shm.
259 */
260/**
261 * @defgroup iface_wl_shm The wl_shm interface
262 *
263 * A singleton global object that provides support for shared
264 * memory.
265 *
266 * Clients can create wl_shm_pool objects using the create_pool
267 * request.
268 *
269 * On binding the wl_shm object one or more format events
270 * are emitted to inform clients about the valid pixel formats
271 * that can be used for buffers.
272 */
273extern const struct wl_interface wl_shm_interface;
274#endif
275#ifndef WL_BUFFER_INTERFACE
276#define WL_BUFFER_INTERFACE
277/**
278 * @page page_iface_wl_buffer wl_buffer
279 * @section page_iface_wl_buffer_desc Description
280 *
281 * A buffer provides the content for a wl_surface. Buffers are
282 * created through factory interfaces such as wl_shm, wp_linux_buffer_params
283 * (from the linux-dmabuf protocol extension) or similar. It has a width and
284 * a height and can be attached to a wl_surface, but the mechanism by which a
285 * client provides and updates the contents is defined by the buffer factory
286 * interface.
287 *
288 * Color channels are assumed to be electrical rather than optical (in other
289 * words, encoded with a transfer function) unless otherwise specified. If
290 * the buffer uses a format that has an alpha channel, the alpha channel is
291 * assumed to be premultiplied into the electrical color channel values
292 * (after transfer function encoding) unless otherwise specified.
293 *
294 * Note, because wl_buffer objects are created from multiple independent
295 * factory interfaces, the wl_buffer interface is frozen at version 1.
296 * @section page_iface_wl_buffer_api API
297 * See @ref iface_wl_buffer.
298 */
299/**
300 * @defgroup iface_wl_buffer The wl_buffer interface
301 *
302 * A buffer provides the content for a wl_surface. Buffers are
303 * created through factory interfaces such as wl_shm, wp_linux_buffer_params
304 * (from the linux-dmabuf protocol extension) or similar. It has a width and
305 * a height and can be attached to a wl_surface, but the mechanism by which a
306 * client provides and updates the contents is defined by the buffer factory
307 * interface.
308 *
309 * Color channels are assumed to be electrical rather than optical (in other
310 * words, encoded with a transfer function) unless otherwise specified. If
311 * the buffer uses a format that has an alpha channel, the alpha channel is
312 * assumed to be premultiplied into the electrical color channel values
313 * (after transfer function encoding) unless otherwise specified.
314 *
315 * Note, because wl_buffer objects are created from multiple independent
316 * factory interfaces, the wl_buffer interface is frozen at version 1.
317 */
318extern const struct wl_interface wl_buffer_interface;
319#endif
320#ifndef WL_DATA_OFFER_INTERFACE
321#define WL_DATA_OFFER_INTERFACE
322/**
323 * @page page_iface_wl_data_offer wl_data_offer
324 * @section page_iface_wl_data_offer_desc Description
325 *
326 * A wl_data_offer represents a piece of data offered for transfer
327 * by another client (the source client). It is used by the
328 * copy-and-paste and drag-and-drop mechanisms. The offer
329 * describes the different mime types that the data can be
330 * converted to and provides the mechanism for transferring the
331 * data directly from the source client.
332 * @section page_iface_wl_data_offer_api API
333 * See @ref iface_wl_data_offer.
334 */
335/**
336 * @defgroup iface_wl_data_offer The wl_data_offer interface
337 *
338 * A wl_data_offer represents a piece of data offered for transfer
339 * by another client (the source client). It is used by the
340 * copy-and-paste and drag-and-drop mechanisms. The offer
341 * describes the different mime types that the data can be
342 * converted to and provides the mechanism for transferring the
343 * data directly from the source client.
344 */
345extern const struct wl_interface wl_data_offer_interface;
346#endif
347#ifndef WL_DATA_SOURCE_INTERFACE
348#define WL_DATA_SOURCE_INTERFACE
349/**
350 * @page page_iface_wl_data_source wl_data_source
351 * @section page_iface_wl_data_source_desc Description
352 *
353 * The wl_data_source object is the source side of a wl_data_offer.
354 * It is created by the source client in a data transfer and
355 * provides a way to describe the offered data and a way to respond
356 * to requests to transfer the data.
357 * @section page_iface_wl_data_source_api API
358 * See @ref iface_wl_data_source.
359 */
360/**
361 * @defgroup iface_wl_data_source The wl_data_source interface
362 *
363 * The wl_data_source object is the source side of a wl_data_offer.
364 * It is created by the source client in a data transfer and
365 * provides a way to describe the offered data and a way to respond
366 * to requests to transfer the data.
367 */
368extern const struct wl_interface wl_data_source_interface;
369#endif
370#ifndef WL_DATA_DEVICE_INTERFACE
371#define WL_DATA_DEVICE_INTERFACE
372/**
373 * @page page_iface_wl_data_device wl_data_device
374 * @section page_iface_wl_data_device_desc Description
375 *
376 * There is one wl_data_device per seat which can be obtained
377 * from the global wl_data_device_manager singleton.
378 *
379 * A wl_data_device provides access to inter-client data transfer
380 * mechanisms such as copy-and-paste and drag-and-drop.
381 * @section page_iface_wl_data_device_api API
382 * See @ref iface_wl_data_device.
383 */
384/**
385 * @defgroup iface_wl_data_device The wl_data_device interface
386 *
387 * There is one wl_data_device per seat which can be obtained
388 * from the global wl_data_device_manager singleton.
389 *
390 * A wl_data_device provides access to inter-client data transfer
391 * mechanisms such as copy-and-paste and drag-and-drop.
392 */
393extern const struct wl_interface wl_data_device_interface;
394#endif
395#ifndef WL_DATA_DEVICE_MANAGER_INTERFACE
396#define WL_DATA_DEVICE_MANAGER_INTERFACE
397/**
398 * @page page_iface_wl_data_device_manager wl_data_device_manager
399 * @section page_iface_wl_data_device_manager_desc Description
400 *
401 * The wl_data_device_manager is a singleton global object that
402 * provides access to inter-client data transfer mechanisms such as
403 * copy-and-paste and drag-and-drop. These mechanisms are tied to
404 * a wl_seat and this interface lets a client get a wl_data_device
405 * corresponding to a wl_seat.
406 *
407 * Depending on the version bound, the objects created from the bound
408 * wl_data_device_manager object will have different requirements for
409 * functioning properly. See wl_data_source.set_actions,
410 * wl_data_offer.accept and wl_data_offer.finish for details.
411 * @section page_iface_wl_data_device_manager_api API
412 * See @ref iface_wl_data_device_manager.
413 */
414/**
415 * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface
416 *
417 * The wl_data_device_manager is a singleton global object that
418 * provides access to inter-client data transfer mechanisms such as
419 * copy-and-paste and drag-and-drop. These mechanisms are tied to
420 * a wl_seat and this interface lets a client get a wl_data_device
421 * corresponding to a wl_seat.
422 *
423 * Depending on the version bound, the objects created from the bound
424 * wl_data_device_manager object will have different requirements for
425 * functioning properly. See wl_data_source.set_actions,
426 * wl_data_offer.accept and wl_data_offer.finish for details.
427 */
428extern const struct wl_interface wl_data_device_manager_interface;
429#endif
430#ifndef WL_SHELL_INTERFACE
431#define WL_SHELL_INTERFACE
432/**
433 * @page page_iface_wl_shell wl_shell
434 * @section page_iface_wl_shell_desc Description
435 *
436 * This interface is implemented by servers that provide
437 * desktop-style user interfaces.
438 *
439 * It allows clients to associate a wl_shell_surface with
440 * a basic surface.
441 *
442 * Note! This protocol is deprecated and not intended for production use.
443 * For desktop-style user interfaces, use xdg_shell. Compositors and clients
444 * should not implement this interface.
445 * @section page_iface_wl_shell_api API
446 * See @ref iface_wl_shell.
447 */
448/**
449 * @defgroup iface_wl_shell The wl_shell interface
450 *
451 * This interface is implemented by servers that provide
452 * desktop-style user interfaces.
453 *
454 * It allows clients to associate a wl_shell_surface with
455 * a basic surface.
456 *
457 * Note! This protocol is deprecated and not intended for production use.
458 * For desktop-style user interfaces, use xdg_shell. Compositors and clients
459 * should not implement this interface.
460 */
461extern const struct wl_interface wl_shell_interface;
462#endif
463#ifndef WL_SHELL_SURFACE_INTERFACE
464#define WL_SHELL_SURFACE_INTERFACE
465/**
466 * @page page_iface_wl_shell_surface wl_shell_surface
467 * @section page_iface_wl_shell_surface_desc Description
468 *
469 * An interface that may be implemented by a wl_surface, for
470 * implementations that provide a desktop-style user interface.
471 *
472 * It provides requests to treat surfaces like toplevel, fullscreen
473 * or popup windows, move, resize or maximize them, associate
474 * metadata like title and class, etc.
475 *
476 * On the server side the object is automatically destroyed when
477 * the related wl_surface is destroyed. On the client side,
478 * wl_shell_surface_destroy() must be called before destroying
479 * the wl_surface object.
480 * @section page_iface_wl_shell_surface_api API
481 * See @ref iface_wl_shell_surface.
482 */
483/**
484 * @defgroup iface_wl_shell_surface The wl_shell_surface interface
485 *
486 * An interface that may be implemented by a wl_surface, for
487 * implementations that provide a desktop-style user interface.
488 *
489 * It provides requests to treat surfaces like toplevel, fullscreen
490 * or popup windows, move, resize or maximize them, associate
491 * metadata like title and class, etc.
492 *
493 * On the server side the object is automatically destroyed when
494 * the related wl_surface is destroyed. On the client side,
495 * wl_shell_surface_destroy() must be called before destroying
496 * the wl_surface object.
497 */
498extern const struct wl_interface wl_shell_surface_interface;
499#endif
500#ifndef WL_SURFACE_INTERFACE
501#define WL_SURFACE_INTERFACE
502/**
503 * @page page_iface_wl_surface wl_surface
504 * @section page_iface_wl_surface_desc Description
505 *
506 * A surface is a rectangular area that may be displayed on zero
507 * or more outputs, and shown any number of times at the compositor's
508 * discretion. They can present wl_buffers, receive user input, and
509 * define a local coordinate system.
510 *
511 * The size of a surface (and relative positions on it) is described
512 * in surface-local coordinates, which may differ from the buffer
513 * coordinates of the pixel content, in case a buffer_transform
514 * or a buffer_scale is used.
515 *
516 * A surface without a "role" is fairly useless: a compositor does
517 * not know where, when or how to present it. The role is the
518 * purpose of a wl_surface. Examples of roles are a cursor for a
519 * pointer (as set by wl_pointer.set_cursor), a drag icon
520 * (wl_data_device.start_drag), a sub-surface
521 * (wl_subcompositor.get_subsurface), and a window as defined by a
522 * shell protocol (e.g. wl_shell.get_shell_surface).
523 *
524 * A surface can have only one role at a time. Initially a
525 * wl_surface does not have a role. Once a wl_surface is given a
526 * role, it is set permanently for the whole lifetime of the
527 * wl_surface object. Giving the current role again is allowed,
528 * unless explicitly forbidden by the relevant interface
529 * specification.
530 *
531 * Surface roles are given by requests in other interfaces such as
532 * wl_pointer.set_cursor. The request should explicitly mention
533 * that this request gives a role to a wl_surface. Often, this
534 * request also creates a new protocol object that represents the
535 * role and adds additional functionality to wl_surface. When a
536 * client wants to destroy a wl_surface, they must destroy this role
537 * object before the wl_surface, otherwise a defunct_role_object error is
538 * sent.
539 *
540 * Destroying the role object does not remove the role from the
541 * wl_surface, but it may stop the wl_surface from "playing the role".
542 * For instance, if a wl_subsurface object is destroyed, the wl_surface
543 * it was created for will be unmapped and forget its position and
544 * z-order. It is allowed to create a wl_subsurface for the same
545 * wl_surface again, but it is not allowed to use the wl_surface as
546 * a cursor (cursor is a different role than sub-surface, and role
547 * switching is not allowed).
548 * @section page_iface_wl_surface_api API
549 * See @ref iface_wl_surface.
550 */
551/**
552 * @defgroup iface_wl_surface The wl_surface interface
553 *
554 * A surface is a rectangular area that may be displayed on zero
555 * or more outputs, and shown any number of times at the compositor's
556 * discretion. They can present wl_buffers, receive user input, and
557 * define a local coordinate system.
558 *
559 * The size of a surface (and relative positions on it) is described
560 * in surface-local coordinates, which may differ from the buffer
561 * coordinates of the pixel content, in case a buffer_transform
562 * or a buffer_scale is used.
563 *
564 * A surface without a "role" is fairly useless: a compositor does
565 * not know where, when or how to present it. The role is the
566 * purpose of a wl_surface. Examples of roles are a cursor for a
567 * pointer (as set by wl_pointer.set_cursor), a drag icon
568 * (wl_data_device.start_drag), a sub-surface
569 * (wl_subcompositor.get_subsurface), and a window as defined by a
570 * shell protocol (e.g. wl_shell.get_shell_surface).
571 *
572 * A surface can have only one role at a time. Initially a
573 * wl_surface does not have a role. Once a wl_surface is given a
574 * role, it is set permanently for the whole lifetime of the
575 * wl_surface object. Giving the current role again is allowed,
576 * unless explicitly forbidden by the relevant interface
577 * specification.
578 *
579 * Surface roles are given by requests in other interfaces such as
580 * wl_pointer.set_cursor. The request should explicitly mention
581 * that this request gives a role to a wl_surface. Often, this
582 * request also creates a new protocol object that represents the
583 * role and adds additional functionality to wl_surface. When a
584 * client wants to destroy a wl_surface, they must destroy this role
585 * object before the wl_surface, otherwise a defunct_role_object error is
586 * sent.
587 *
588 * Destroying the role object does not remove the role from the
589 * wl_surface, but it may stop the wl_surface from "playing the role".
590 * For instance, if a wl_subsurface object is destroyed, the wl_surface
591 * it was created for will be unmapped and forget its position and
592 * z-order. It is allowed to create a wl_subsurface for the same
593 * wl_surface again, but it is not allowed to use the wl_surface as
594 * a cursor (cursor is a different role than sub-surface, and role
595 * switching is not allowed).
596 */
597extern const struct wl_interface wl_surface_interface;
598#endif
599#ifndef WL_SEAT_INTERFACE
600#define WL_SEAT_INTERFACE
601/**
602 * @page page_iface_wl_seat wl_seat
603 * @section page_iface_wl_seat_desc Description
604 *
605 * A seat is a group of keyboards, pointer and touch devices. This
606 * object is published as a global during start up, or when such a
607 * device is hot plugged. A seat typically has a pointer and
608 * maintains a keyboard focus and a pointer focus.
609 * @section page_iface_wl_seat_api API
610 * See @ref iface_wl_seat.
611 */
612/**
613 * @defgroup iface_wl_seat The wl_seat interface
614 *
615 * A seat is a group of keyboards, pointer and touch devices. This
616 * object is published as a global during start up, or when such a
617 * device is hot plugged. A seat typically has a pointer and
618 * maintains a keyboard focus and a pointer focus.
619 */
620extern const struct wl_interface wl_seat_interface;
621#endif
622#ifndef WL_POINTER_INTERFACE
623#define WL_POINTER_INTERFACE
624/**
625 * @page page_iface_wl_pointer wl_pointer
626 * @section page_iface_wl_pointer_desc Description
627 *
628 * The wl_pointer interface represents one or more input devices,
629 * such as mice, which control the pointer location and pointer_focus
630 * of a seat.
631 *
632 * The wl_pointer interface generates motion, enter and leave
633 * events for the surfaces that the pointer is located over,
634 * and button and axis events for button presses, button releases
635 * and scrolling.
636 * @section page_iface_wl_pointer_api API
637 * See @ref iface_wl_pointer.
638 */
639/**
640 * @defgroup iface_wl_pointer The wl_pointer interface
641 *
642 * The wl_pointer interface represents one or more input devices,
643 * such as mice, which control the pointer location and pointer_focus
644 * of a seat.
645 *
646 * The wl_pointer interface generates motion, enter and leave
647 * events for the surfaces that the pointer is located over,
648 * and button and axis events for button presses, button releases
649 * and scrolling.
650 */
651extern const struct wl_interface wl_pointer_interface;
652#endif
653#ifndef WL_KEYBOARD_INTERFACE
654#define WL_KEYBOARD_INTERFACE
655/**
656 * @page page_iface_wl_keyboard wl_keyboard
657 * @section page_iface_wl_keyboard_desc Description
658 *
659 * The wl_keyboard interface represents one or more keyboards
660 * associated with a seat.
661 *
662 * Each wl_keyboard has the following logical state:
663 *
664 * - an active surface (possibly null),
665 * - the keys currently logically down,
666 * - the active modifiers,
667 * - the active group.
668 *
669 * By default, the active surface is null, the keys currently logically down
670 * are empty, the active modifiers and the active group are 0.
671 * @section page_iface_wl_keyboard_api API
672 * See @ref iface_wl_keyboard.
673 */
674/**
675 * @defgroup iface_wl_keyboard The wl_keyboard interface
676 *
677 * The wl_keyboard interface represents one or more keyboards
678 * associated with a seat.
679 *
680 * Each wl_keyboard has the following logical state:
681 *
682 * - an active surface (possibly null),
683 * - the keys currently logically down,
684 * - the active modifiers,
685 * - the active group.
686 *
687 * By default, the active surface is null, the keys currently logically down
688 * are empty, the active modifiers and the active group are 0.
689 */
690extern const struct wl_interface wl_keyboard_interface;
691#endif
692#ifndef WL_TOUCH_INTERFACE
693#define WL_TOUCH_INTERFACE
694/**
695 * @page page_iface_wl_touch wl_touch
696 * @section page_iface_wl_touch_desc Description
697 *
698 * The wl_touch interface represents a touchscreen
699 * associated with a seat.
700 *
701 * Touch interactions can consist of one or more contacts.
702 * For each contact, a series of events is generated, starting
703 * with a down event, followed by zero or more motion events,
704 * and ending with an up event. Events relating to the same
705 * contact point can be identified by the ID of the sequence.
706 * @section page_iface_wl_touch_api API
707 * See @ref iface_wl_touch.
708 */
709/**
710 * @defgroup iface_wl_touch The wl_touch interface
711 *
712 * The wl_touch interface represents a touchscreen
713 * associated with a seat.
714 *
715 * Touch interactions can consist of one or more contacts.
716 * For each contact, a series of events is generated, starting
717 * with a down event, followed by zero or more motion events,
718 * and ending with an up event. Events relating to the same
719 * contact point can be identified by the ID of the sequence.
720 */
721extern const struct wl_interface wl_touch_interface;
722#endif
723#ifndef WL_OUTPUT_INTERFACE
724#define WL_OUTPUT_INTERFACE
725/**
726 * @page page_iface_wl_output wl_output
727 * @section page_iface_wl_output_desc Description
728 *
729 * An output describes part of the compositor geometry. The
730 * compositor works in the 'compositor coordinate system' and an
731 * output corresponds to a rectangular area in that space that is
732 * actually visible. This typically corresponds to a monitor that
733 * displays part of the compositor space. This object is published
734 * as global during start up, or when a monitor is hotplugged.
735 * @section page_iface_wl_output_api API
736 * See @ref iface_wl_output.
737 */
738/**
739 * @defgroup iface_wl_output The wl_output interface
740 *
741 * An output describes part of the compositor geometry. The
742 * compositor works in the 'compositor coordinate system' and an
743 * output corresponds to a rectangular area in that space that is
744 * actually visible. This typically corresponds to a monitor that
745 * displays part of the compositor space. This object is published
746 * as global during start up, or when a monitor is hotplugged.
747 */
748extern const struct wl_interface wl_output_interface;
749#endif
750#ifndef WL_REGION_INTERFACE
751#define WL_REGION_INTERFACE
752/**
753 * @page page_iface_wl_region wl_region
754 * @section page_iface_wl_region_desc Description
755 *
756 * A region object describes an area.
757 *
758 * Region objects are used to describe the opaque and input
759 * regions of a surface.
760 * @section page_iface_wl_region_api API
761 * See @ref iface_wl_region.
762 */
763/**
764 * @defgroup iface_wl_region The wl_region interface
765 *
766 * A region object describes an area.
767 *
768 * Region objects are used to describe the opaque and input
769 * regions of a surface.
770 */
771extern const struct wl_interface wl_region_interface;
772#endif
773#ifndef WL_SUBCOMPOSITOR_INTERFACE
774#define WL_SUBCOMPOSITOR_INTERFACE
775/**
776 * @page page_iface_wl_subcompositor wl_subcompositor
777 * @section page_iface_wl_subcompositor_desc Description
778 *
779 * The global interface exposing sub-surface compositing capabilities.
780 * A wl_surface, that has sub-surfaces associated, is called the
781 * parent surface. Sub-surfaces can be arbitrarily nested and create
782 * a tree of sub-surfaces.
783 *
784 * The root surface in a tree of sub-surfaces is the main
785 * surface. The main surface cannot be a sub-surface, because
786 * sub-surfaces must always have a parent.
787 *
788 * A main surface with its sub-surfaces forms a (compound) window.
789 * For window management purposes, this set of wl_surface objects is
790 * to be considered as a single window, and it should also behave as
791 * such.
792 *
793 * The aim of sub-surfaces is to offload some of the compositing work
794 * within a window from clients to the compositor. A prime example is
795 * a video player with decorations and video in separate wl_surface
796 * objects. This should allow the compositor to pass YUV video buffer
797 * processing to dedicated overlay hardware when possible.
798 * @section page_iface_wl_subcompositor_api API
799 * See @ref iface_wl_subcompositor.
800 */
801/**
802 * @defgroup iface_wl_subcompositor The wl_subcompositor interface
803 *
804 * The global interface exposing sub-surface compositing capabilities.
805 * A wl_surface, that has sub-surfaces associated, is called the
806 * parent surface. Sub-surfaces can be arbitrarily nested and create
807 * a tree of sub-surfaces.
808 *
809 * The root surface in a tree of sub-surfaces is the main
810 * surface. The main surface cannot be a sub-surface, because
811 * sub-surfaces must always have a parent.
812 *
813 * A main surface with its sub-surfaces forms a (compound) window.
814 * For window management purposes, this set of wl_surface objects is
815 * to be considered as a single window, and it should also behave as
816 * such.
817 *
818 * The aim of sub-surfaces is to offload some of the compositing work
819 * within a window from clients to the compositor. A prime example is
820 * a video player with decorations and video in separate wl_surface
821 * objects. This should allow the compositor to pass YUV video buffer
822 * processing to dedicated overlay hardware when possible.
823 */
824extern const struct wl_interface wl_subcompositor_interface;
825#endif
826#ifndef WL_SUBSURFACE_INTERFACE
827#define WL_SUBSURFACE_INTERFACE
828/**
829 * @page page_iface_wl_subsurface wl_subsurface
830 * @section page_iface_wl_subsurface_desc Description
831 *
832 * An additional interface to a wl_surface object, which has been
833 * made a sub-surface. A sub-surface has one parent surface. A
834 * sub-surface's size and position are not limited to that of the parent.
835 * Particularly, a sub-surface is not automatically clipped to its
836 * parent's area.
837 *
838 * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
839 * and the parent surface is mapped. The order of which one happens
840 * first is irrelevant. A sub-surface is hidden if the parent becomes
841 * hidden, or if a NULL wl_buffer is applied. These rules apply
842 * recursively through the tree of surfaces.
843 *
844 * The behaviour of a wl_surface.commit request on a sub-surface
845 * depends on the sub-surface's mode. The possible modes are
846 * synchronized and desynchronized, see methods
847 * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
848 * mode caches the wl_surface state to be applied when the parent's
849 * state gets applied, and desynchronized mode applies the pending
850 * wl_surface state directly. A sub-surface is initially in the
851 * synchronized mode.
852 *
853 * Sub-surfaces also have another kind of state, which is managed by
854 * wl_subsurface requests, as opposed to wl_surface requests. This
855 * state includes the sub-surface position relative to the parent
856 * surface (wl_subsurface.set_position), and the stacking order of
857 * the parent and its sub-surfaces (wl_subsurface.place_above and
858 * .place_below). This state is applied when the parent surface's
859 * wl_surface state is applied, regardless of the sub-surface's mode.
860 * As the exception, set_sync and set_desync are effective immediately.
861 *
862 * The main surface can be thought to be always in desynchronized mode,
863 * since it does not have a parent in the sub-surfaces sense.
864 *
865 * Even if a sub-surface is in desynchronized mode, it will behave as
866 * in synchronized mode, if its parent surface behaves as in
867 * synchronized mode. This rule is applied recursively throughout the
868 * tree of surfaces. This means, that one can set a sub-surface into
869 * synchronized mode, and then assume that all its child and grand-child
870 * sub-surfaces are synchronized, too, without explicitly setting them.
871 *
872 * Destroying a sub-surface takes effect immediately. If you need to
873 * synchronize the removal of a sub-surface to the parent surface update,
874 * unmap the sub-surface first by attaching a NULL wl_buffer, update parent,
875 * and then destroy the sub-surface.
876 *
877 * If the parent wl_surface object is destroyed, the sub-surface is
878 * unmapped.
879 *
880 * A sub-surface never has the keyboard focus of any seat.
881 *
882 * The wl_surface.offset request is ignored: clients must use set_position
883 * instead to move the sub-surface.
884 * @section page_iface_wl_subsurface_api API
885 * See @ref iface_wl_subsurface.
886 */
887/**
888 * @defgroup iface_wl_subsurface The wl_subsurface interface
889 *
890 * An additional interface to a wl_surface object, which has been
891 * made a sub-surface. A sub-surface has one parent surface. A
892 * sub-surface's size and position are not limited to that of the parent.
893 * Particularly, a sub-surface is not automatically clipped to its
894 * parent's area.
895 *
896 * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
897 * and the parent surface is mapped. The order of which one happens
898 * first is irrelevant. A sub-surface is hidden if the parent becomes
899 * hidden, or if a NULL wl_buffer is applied. These rules apply
900 * recursively through the tree of surfaces.
901 *
902 * The behaviour of a wl_surface.commit request on a sub-surface
903 * depends on the sub-surface's mode. The possible modes are
904 * synchronized and desynchronized, see methods
905 * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
906 * mode caches the wl_surface state to be applied when the parent's
907 * state gets applied, and desynchronized mode applies the pending
908 * wl_surface state directly. A sub-surface is initially in the
909 * synchronized mode.
910 *
911 * Sub-surfaces also have another kind of state, which is managed by
912 * wl_subsurface requests, as opposed to wl_surface requests. This
913 * state includes the sub-surface position relative to the parent
914 * surface (wl_subsurface.set_position), and the stacking order of
915 * the parent and its sub-surfaces (wl_subsurface.place_above and
916 * .place_below). This state is applied when the parent surface's
917 * wl_surface state is applied, regardless of the sub-surface's mode.
918 * As the exception, set_sync and set_desync are effective immediately.
919 *
920 * The main surface can be thought to be always in desynchronized mode,
921 * since it does not have a parent in the sub-surfaces sense.
922 *
923 * Even if a sub-surface is in desynchronized mode, it will behave as
924 * in synchronized mode, if its parent surface behaves as in
925 * synchronized mode. This rule is applied recursively throughout the
926 * tree of surfaces. This means, that one can set a sub-surface into
927 * synchronized mode, and then assume that all its child and grand-child
928 * sub-surfaces are synchronized, too, without explicitly setting them.
929 *
930 * Destroying a sub-surface takes effect immediately. If you need to
931 * synchronize the removal of a sub-surface to the parent surface update,
932 * unmap the sub-surface first by attaching a NULL wl_buffer, update parent,
933 * and then destroy the sub-surface.
934 *
935 * If the parent wl_surface object is destroyed, the sub-surface is
936 * unmapped.
937 *
938 * A sub-surface never has the keyboard focus of any seat.
939 *
940 * The wl_surface.offset request is ignored: clients must use set_position
941 * instead to move the sub-surface.
942 */
943extern const struct wl_interface wl_subsurface_interface;
944#endif
945#ifndef WL_FIXES_INTERFACE
946#define WL_FIXES_INTERFACE
947/**
948 * @page page_iface_wl_fixes wl_fixes
949 * @section page_iface_wl_fixes_desc Description
950 *
951 * This global fixes problems with other core-protocol interfaces that
952 * cannot be fixed in these interfaces themselves.
953 * @section page_iface_wl_fixes_api API
954 * See @ref iface_wl_fixes.
955 */
956/**
957 * @defgroup iface_wl_fixes The wl_fixes interface
958 *
959 * This global fixes problems with other core-protocol interfaces that
960 * cannot be fixed in these interfaces themselves.
961 */
962extern const struct wl_interface wl_fixes_interface;
963#endif
965#ifndef WL_DISPLAY_ERROR_ENUM
966#define WL_DISPLAY_ERROR_ENUM
967/**
968 * @ingroup iface_wl_display
969 * global error values
970 *
971 * These errors are global and can be emitted in response to any
972 * server request.
973 */
974enum wl_display_error {
975 /**
976 * server couldn't find object
977 */
978 WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
979 /**
980 * method doesn't exist on the specified interface or malformed request
981 */
982 WL_DISPLAY_ERROR_INVALID_METHOD = 1,
983 /**
984 * server is out of memory
985 */
986 WL_DISPLAY_ERROR_NO_MEMORY = 2,
987 /**
988 * implementation error in compositor
989 */
990 WL_DISPLAY_ERROR_IMPLEMENTATION = 3,
991};
992#endif /* WL_DISPLAY_ERROR_ENUM */
994/**
995 * @ingroup iface_wl_display
996 * @struct wl_display_listener
997 */
998struct wl_display_listener {
999 /**
1000 * fatal error event
1002 * The error event is sent out when a fatal (non-recoverable)
1003 * error has occurred. The object_id argument is the object where
1004 * the error occurred, most often in response to a request to that
1005 * object. The code identifies the error and is defined by the
1006 * object interface. As such, each interface defines its own set of
1007 * error codes. The message is a brief description of the error,
1008 * for (debugging) convenience.
1009 * @param object_id object where the error occurred
1010 * @param code error code
1011 * @param message error description
1012 */
1013 void (*error)(void *data,
1014 struct wl_display *wl_display,
1015 void *object_id,
1016 uint32_t code,
1017 const char *message);
1018 /**
1019 * acknowledge object ID deletion
1021 * This event is used internally by the object ID management
1022 * logic. When a client deletes an object that it had created, the
1023 * server will send this event to acknowledge that it has seen the
1024 * delete request. When the client receives this event, it will
1025 * know that it can safely reuse the object ID.
1026 * @param id deleted object ID
1027 */
1028 void (*delete_id)(void *data,
1029 struct wl_display *wl_display,
1030 uint32_t id);
1033/**
1034 * @ingroup iface_wl_display
1035 */
1036static inline int
1037wl_display_add_listener(struct wl_display *wl_display,
1038 const struct wl_display_listener *listener, void *data)
1040 return wl_proxy_add_listener((struct wl_proxy *) wl_display,
1041 (void (**)(void)) listener, data);
1044#define WL_DISPLAY_SYNC 0
1045#define WL_DISPLAY_GET_REGISTRY 1
1047/**
1048 * @ingroup iface_wl_display
1049 */
1050#define WL_DISPLAY_ERROR_SINCE_VERSION 1
1051/**
1052 * @ingroup iface_wl_display
1053 */
1054#define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1
1056/**
1057 * @ingroup iface_wl_display
1058 */
1059#define WL_DISPLAY_SYNC_SINCE_VERSION 1
1060/**
1061 * @ingroup iface_wl_display
1062 */
1063#define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1
1065/** @ingroup iface_wl_display */
1066static inline void
1067wl_display_set_user_data(struct wl_display *wl_display, void *user_data)
1069 wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data);
1072/** @ingroup iface_wl_display */
1073static inline void *
1074wl_display_get_user_data(struct wl_display *wl_display)
1076 return wl_proxy_get_user_data((struct wl_proxy *) wl_display);
1079static inline uint32_t
1080wl_display_get_version(struct wl_display *wl_display)
1082 return wl_proxy_get_version((struct wl_proxy *) wl_display);
1085/**
1086 * @ingroup iface_wl_display
1088 * The sync request asks the server to emit the 'done' event
1089 * on the returned wl_callback object. Since requests are
1090 * handled in-order and events are delivered in-order, this can
1091 * be used as a barrier to ensure all previous requests and the
1092 * resulting events have been handled.
1094 * The object returned by this request will be destroyed by the
1095 * compositor after the callback is fired and as such the client must not
1096 * attempt to use it after that point.
1098 * The callback_data passed in the callback is undefined and should be ignored.
1099 */
1100static inline struct wl_callback *
1101wl_display_sync(struct wl_display *wl_display)
1103 struct wl_proxy *callback;
1105 callback = wl_proxy_marshal_flags((struct wl_proxy *) wl_display,
1106 WL_DISPLAY_SYNC, &wl_callback_interface, wl_proxy_get_version((struct wl_proxy *) wl_display), 0, NULL);
1108 return (struct wl_callback *) callback;
1111/**
1112 * @ingroup iface_wl_display
1114 * This request creates a registry object that allows the client
1115 * to list and bind the global objects available from the
1116 * compositor.
1118 * It should be noted that the server side resources consumed in
1119 * response to a get_registry request can only be released when the
1120 * client disconnects, not when the client side proxy is destroyed.
1121 * Therefore, clients should invoke get_registry as infrequently as
1122 * possible to avoid wasting memory.
1123 */
1124static inline struct wl_registry *
1125wl_display_get_registry(struct wl_display *wl_display)
1127 struct wl_proxy *registry;
1129 registry = wl_proxy_marshal_flags((struct wl_proxy *) wl_display,
1130 WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, wl_proxy_get_version((struct wl_proxy *) wl_display), 0, NULL);
1132 return (struct wl_registry *) registry;
1135/**
1136 * @ingroup iface_wl_registry
1137 * @struct wl_registry_listener
1138 */
1139struct wl_registry_listener {
1140 /**
1141 * announce global object
1143 * Notify the client of global objects.
1145 * The event notifies the client that a global object with the
1146 * given name is now available, and it implements the given version
1147 * of the given interface.
1148 * @param name numeric name of the global object
1149 * @param interface interface implemented by the object
1150 * @param version interface version
1151 */
1152 void (*global)(void *data,
1153 struct wl_registry *wl_registry,
1154 uint32_t name,
1155 const char *interface,
1156 uint32_t version);
1157 /**
1158 * announce removal of global object
1160 * Notify the client of removed global objects.
1162 * This event notifies the client that the global identified by
1163 * name is no longer available. If the client bound to the global
1164 * using the bind request, the client should now destroy that
1165 * object.
1167 * The object remains valid and requests to the object will be
1168 * ignored until the client destroys it, to avoid races between the
1169 * global going away and a client sending a request to it.
1170 * @param name numeric name of the global object
1171 */
1172 void (*global_remove)(void *data,
1173 struct wl_registry *wl_registry,
1174 uint32_t name);
1177/**
1178 * @ingroup iface_wl_registry
1179 */
1180static inline int
1181wl_registry_add_listener(struct wl_registry *wl_registry,
1182 const struct wl_registry_listener *listener, void *data)
1184 return wl_proxy_add_listener((struct wl_proxy *) wl_registry,
1185 (void (**)(void)) listener, data);
1188#define WL_REGISTRY_BIND 0
1190/**
1191 * @ingroup iface_wl_registry
1192 */
1193#define WL_REGISTRY_GLOBAL_SINCE_VERSION 1
1194/**
1195 * @ingroup iface_wl_registry
1196 */
1197#define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1
1199/**
1200 * @ingroup iface_wl_registry
1201 */
1202#define WL_REGISTRY_BIND_SINCE_VERSION 1
1204/** @ingroup iface_wl_registry */
1205static inline void
1206wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data)
1208 wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data);
1211/** @ingroup iface_wl_registry */
1212static inline void *
1213wl_registry_get_user_data(struct wl_registry *wl_registry)
1215 return wl_proxy_get_user_data((struct wl_proxy *) wl_registry);
1218static inline uint32_t
1219wl_registry_get_version(struct wl_registry *wl_registry)
1221 return wl_proxy_get_version((struct wl_proxy *) wl_registry);
1224/** @ingroup iface_wl_registry */
1225static inline void
1226wl_registry_destroy(struct wl_registry *wl_registry)
1228 wl_proxy_destroy((struct wl_proxy *) wl_registry);
1231/**
1232 * @ingroup iface_wl_registry
1234 * Binds a new, client-created object to the server using the
1235 * specified name as the identifier.
1236 */
1237static inline void *
1238wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version)
1240 struct wl_proxy *id;
1242 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_registry,
1243 WL_REGISTRY_BIND, interface, version, 0, name, interface->name, version, NULL);
1245 return (void *) id;
1248/**
1249 * @ingroup iface_wl_callback
1250 * @struct wl_callback_listener
1251 */
1252struct wl_callback_listener {
1253 /**
1254 * done event
1256 * Notify the client when the related request is done.
1257 * @param callback_data request-specific data for the callback
1258 */
1259 void (*done)(void *data,
1260 struct wl_callback *wl_callback,
1261 uint32_t callback_data);
1264/**
1265 * @ingroup iface_wl_callback
1266 */
1267static inline int
1268wl_callback_add_listener(struct wl_callback *wl_callback,
1269 const struct wl_callback_listener *listener, void *data)
1271 return wl_proxy_add_listener((struct wl_proxy *) wl_callback,
1272 (void (**)(void)) listener, data);
1275/**
1276 * @ingroup iface_wl_callback
1277 */
1278#define WL_CALLBACK_DONE_SINCE_VERSION 1
1281/** @ingroup iface_wl_callback */
1282static inline void
1283wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data)
1285 wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data);
1288/** @ingroup iface_wl_callback */
1289static inline void *
1290wl_callback_get_user_data(struct wl_callback *wl_callback)
1292 return wl_proxy_get_user_data((struct wl_proxy *) wl_callback);
1295static inline uint32_t
1296wl_callback_get_version(struct wl_callback *wl_callback)
1298 return wl_proxy_get_version((struct wl_proxy *) wl_callback);
1301/** @ingroup iface_wl_callback */
1302static inline void
1303wl_callback_destroy(struct wl_callback *wl_callback)
1305 wl_proxy_destroy((struct wl_proxy *) wl_callback);
1308#define WL_COMPOSITOR_CREATE_SURFACE 0
1309#define WL_COMPOSITOR_CREATE_REGION 1
1312/**
1313 * @ingroup iface_wl_compositor
1314 */
1315#define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1
1316/**
1317 * @ingroup iface_wl_compositor
1318 */
1319#define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1
1321/** @ingroup iface_wl_compositor */
1322static inline void
1323wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data)
1325 wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data);
1328/** @ingroup iface_wl_compositor */
1329static inline void *
1330wl_compositor_get_user_data(struct wl_compositor *wl_compositor)
1332 return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor);
1335static inline uint32_t
1336wl_compositor_get_version(struct wl_compositor *wl_compositor)
1338 return wl_proxy_get_version((struct wl_proxy *) wl_compositor);
1341/** @ingroup iface_wl_compositor */
1342static inline void
1343wl_compositor_destroy(struct wl_compositor *wl_compositor)
1345 wl_proxy_destroy((struct wl_proxy *) wl_compositor);
1348/**
1349 * @ingroup iface_wl_compositor
1351 * Ask the compositor to create a new surface.
1352 */
1353static inline struct wl_surface *
1354wl_compositor_create_surface(struct wl_compositor *wl_compositor)
1356 struct wl_proxy *id;
1358 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_compositor,
1359 WL_COMPOSITOR_CREATE_SURFACE, &wl_surface_interface, wl_proxy_get_version((struct wl_proxy *) wl_compositor), 0, NULL);
1361 return (struct wl_surface *) id;
1364/**
1365 * @ingroup iface_wl_compositor
1367 * Ask the compositor to create a new region.
1368 */
1369static inline struct wl_region *
1370wl_compositor_create_region(struct wl_compositor *wl_compositor)
1372 struct wl_proxy *id;
1374 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_compositor,
1375 WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, wl_proxy_get_version((struct wl_proxy *) wl_compositor), 0, NULL);
1377 return (struct wl_region *) id;
1380#define WL_SHM_POOL_CREATE_BUFFER 0
1381#define WL_SHM_POOL_DESTROY 1
1382#define WL_SHM_POOL_RESIZE 2
1385/**
1386 * @ingroup iface_wl_shm_pool
1387 */
1388#define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1
1389/**
1390 * @ingroup iface_wl_shm_pool
1391 */
1392#define WL_SHM_POOL_DESTROY_SINCE_VERSION 1
1393/**
1394 * @ingroup iface_wl_shm_pool
1395 */
1396#define WL_SHM_POOL_RESIZE_SINCE_VERSION 1
1398/** @ingroup iface_wl_shm_pool */
1399static inline void
1400wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data)
1402 wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data);
1405/** @ingroup iface_wl_shm_pool */
1406static inline void *
1407wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool)
1409 return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool);
1412static inline uint32_t
1413wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool)
1415 return wl_proxy_get_version((struct wl_proxy *) wl_shm_pool);
1418/**
1419 * @ingroup iface_wl_shm_pool
1421 * Create a wl_buffer object from the pool.
1423 * The buffer is created offset bytes into the pool and has
1424 * width and height as specified. The stride argument specifies
1425 * the number of bytes from the beginning of one row to the beginning
1426 * of the next. The format is the pixel format of the buffer and
1427 * must be one of those advertised through the wl_shm.format event.
1429 * A buffer will keep a reference to the pool it was created from
1430 * so it is valid to destroy the pool immediately after creating
1431 * a buffer from it.
1432 */
1433static inline struct wl_buffer *
1434wl_shm_pool_create_buffer(struct wl_shm_pool *wl_shm_pool, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format)
1436 struct wl_proxy *id;
1438 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,
1439 WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), 0, NULL, offset, width, height, stride, format);
1441 return (struct wl_buffer *) id;
1444/**
1445 * @ingroup iface_wl_shm_pool
1447 * Destroy the shared memory pool.
1449 * The mmapped memory will be released when all
1450 * buffers that have been created from this pool
1451 * are gone.
1452 */
1453static inline void
1454wl_shm_pool_destroy(struct wl_shm_pool *wl_shm_pool)
1456 wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,
1457 WL_SHM_POOL_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), WL_MARSHAL_FLAG_DESTROY);
1460/**
1461 * @ingroup iface_wl_shm_pool
1463 * This request will cause the server to remap the backing memory
1464 * for the pool from the file descriptor passed when the pool was
1465 * created, but using the new size. This request can only be
1466 * used to make the pool bigger.
1468 * This request only changes the amount of bytes that are mmapped
1469 * by the server and does not touch the file corresponding to the
1470 * file descriptor passed at creation time. It is the client's
1471 * responsibility to ensure that the file is at least as big as
1472 * the new pool size.
1473 */
1474static inline void
1475wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size)
1477 wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,
1478 WL_SHM_POOL_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), 0, size);
1481#ifndef WL_SHM_ERROR_ENUM
1482#define WL_SHM_ERROR_ENUM
1483/**
1484 * @ingroup iface_wl_shm
1485 * wl_shm error values
1487 * These errors can be emitted in response to wl_shm requests.
1488 */
1489enum wl_shm_error {
1490 /**
1491 * buffer format is not known
1492 */
1493 WL_SHM_ERROR_INVALID_FORMAT = 0,
1494 /**
1495 * invalid size or stride during pool or buffer creation
1496 */
1497 WL_SHM_ERROR_INVALID_STRIDE = 1,
1498 /**
1499 * mmapping the file descriptor failed
1500 */
1501 WL_SHM_ERROR_INVALID_FD = 2,
1503#endif /* WL_SHM_ERROR_ENUM */
1505#ifndef WL_SHM_FORMAT_ENUM
1506#define WL_SHM_FORMAT_ENUM
1507/**
1508 * @ingroup iface_wl_shm
1509 * pixel formats
1511 * This describes the memory layout of an individual pixel.
1513 * All renderers should support argb8888 and xrgb8888 but any other
1514 * formats are optional and may not be supported by the particular
1515 * renderer in use.
1517 * The drm format codes match the macros defined in drm_fourcc.h, except
1518 * argb8888 and xrgb8888. The formats actually supported by the compositor
1519 * will be reported by the format event.
1521 * For all wl_shm formats and unless specified in another protocol
1522 * extension, pre-multiplied alpha is used for pixel values.
1523 */
1524enum wl_shm_format {
1525 /**
1526 * 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian
1527 */
1528 WL_SHM_FORMAT_ARGB8888 = 0,
1529 /**
1530 * 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian
1531 */
1532 WL_SHM_FORMAT_XRGB8888 = 1,
1533 /**
1534 * 8-bit color index format, [7:0] C
1535 */
1536 WL_SHM_FORMAT_C8 = 0x20203843,
1537 /**
1538 * 8-bit RGB format, [7:0] R:G:B 3:3:2
1539 */
1540 WL_SHM_FORMAT_RGB332 = 0x38424752,
1541 /**
1542 * 8-bit BGR format, [7:0] B:G:R 2:3:3
1543 */
1544 WL_SHM_FORMAT_BGR233 = 0x38524742,
1545 /**
1546 * 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian
1547 */
1548 WL_SHM_FORMAT_XRGB4444 = 0x32315258,
1549 /**
1550 * 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian
1551 */
1552 WL_SHM_FORMAT_XBGR4444 = 0x32314258,
1553 /**
1554 * 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian
1555 */
1556 WL_SHM_FORMAT_RGBX4444 = 0x32315852,
1557 /**
1558 * 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian
1559 */
1560 WL_SHM_FORMAT_BGRX4444 = 0x32315842,
1561 /**
1562 * 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian
1563 */
1564 WL_SHM_FORMAT_ARGB4444 = 0x32315241,
1565 /**
1566 * 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian
1567 */
1568 WL_SHM_FORMAT_ABGR4444 = 0x32314241,
1569 /**
1570 * 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian
1571 */
1572 WL_SHM_FORMAT_RGBA4444 = 0x32314152,
1573 /**
1574 * 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian
1575 */
1576 WL_SHM_FORMAT_BGRA4444 = 0x32314142,
1577 /**
1578 * 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian
1579 */
1580 WL_SHM_FORMAT_XRGB1555 = 0x35315258,
1581 /**
1582 * 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian
1583 */
1584 WL_SHM_FORMAT_XBGR1555 = 0x35314258,
1585 /**
1586 * 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian
1587 */
1588 WL_SHM_FORMAT_RGBX5551 = 0x35315852,
1589 /**
1590 * 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian
1591 */
1592 WL_SHM_FORMAT_BGRX5551 = 0x35315842,
1593 /**
1594 * 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian
1595 */
1596 WL_SHM_FORMAT_ARGB1555 = 0x35315241,
1597 /**
1598 * 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian
1599 */
1600 WL_SHM_FORMAT_ABGR1555 = 0x35314241,
1601 /**
1602 * 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian
1603 */
1604 WL_SHM_FORMAT_RGBA5551 = 0x35314152,
1605 /**
1606 * 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian
1607 */
1608 WL_SHM_FORMAT_BGRA5551 = 0x35314142,
1609 /**
1610 * 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian
1611 */
1612 WL_SHM_FORMAT_RGB565 = 0x36314752,
1613 /**
1614 * 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian
1615 */
1616 WL_SHM_FORMAT_BGR565 = 0x36314742,
1617 /**
1618 * 24-bit RGB format, [23:0] R:G:B little endian
1619 */
1620 WL_SHM_FORMAT_RGB888 = 0x34324752,
1621 /**
1622 * 24-bit BGR format, [23:0] B:G:R little endian
1623 */
1624 WL_SHM_FORMAT_BGR888 = 0x34324742,
1625 /**
1626 * 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian
1627 */
1628 WL_SHM_FORMAT_XBGR8888 = 0x34324258,
1629 /**
1630 * 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian
1631 */
1632 WL_SHM_FORMAT_RGBX8888 = 0x34325852,
1633 /**
1634 * 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian
1635 */
1636 WL_SHM_FORMAT_BGRX8888 = 0x34325842,
1637 /**
1638 * 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian
1639 */
1640 WL_SHM_FORMAT_ABGR8888 = 0x34324241,
1641 /**
1642 * 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian
1643 */
1644 WL_SHM_FORMAT_RGBA8888 = 0x34324152,
1645 /**
1646 * 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian
1647 */
1648 WL_SHM_FORMAT_BGRA8888 = 0x34324142,
1649 /**
1650 * 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian
1651 */
1652 WL_SHM_FORMAT_XRGB2101010 = 0x30335258,
1653 /**
1654 * 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian
1655 */
1656 WL_SHM_FORMAT_XBGR2101010 = 0x30334258,
1657 /**
1658 * 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian
1659 */
1660 WL_SHM_FORMAT_RGBX1010102 = 0x30335852,
1661 /**
1662 * 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian
1663 */
1664 WL_SHM_FORMAT_BGRX1010102 = 0x30335842,
1665 /**
1666 * 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian
1667 */
1668 WL_SHM_FORMAT_ARGB2101010 = 0x30335241,
1669 /**
1670 * 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian
1671 */
1672 WL_SHM_FORMAT_ABGR2101010 = 0x30334241,
1673 /**
1674 * 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian
1675 */
1676 WL_SHM_FORMAT_RGBA1010102 = 0x30334152,
1677 /**
1678 * 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian
1679 */
1680 WL_SHM_FORMAT_BGRA1010102 = 0x30334142,
1681 /**
1682 * packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian
1683 */
1684 WL_SHM_FORMAT_YUYV = 0x56595559,
1685 /**
1686 * packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian
1687 */
1688 WL_SHM_FORMAT_YVYU = 0x55595659,
1689 /**
1690 * packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian
1691 */
1692 WL_SHM_FORMAT_UYVY = 0x59565955,
1693 /**
1694 * packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian
1695 */
1696 WL_SHM_FORMAT_VYUY = 0x59555956,
1697 /**
1698 * packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian
1699 */
1700 WL_SHM_FORMAT_AYUV = 0x56555941,
1701 /**
1702 * 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane
1703 */
1704 WL_SHM_FORMAT_NV12 = 0x3231564e,
1705 /**
1706 * 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane
1707 */
1708 WL_SHM_FORMAT_NV21 = 0x3132564e,
1709 /**
1710 * 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane
1711 */
1712 WL_SHM_FORMAT_NV16 = 0x3631564e,
1713 /**
1714 * 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane
1715 */
1716 WL_SHM_FORMAT_NV61 = 0x3136564e,
1717 /**
1718 * 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes
1719 */
1720 WL_SHM_FORMAT_YUV410 = 0x39565559,
1721 /**
1722 * 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes
1723 */
1724 WL_SHM_FORMAT_YVU410 = 0x39555659,
1725 /**
1726 * 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes
1727 */
1728 WL_SHM_FORMAT_YUV411 = 0x31315559,
1729 /**
1730 * 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes
1731 */
1732 WL_SHM_FORMAT_YVU411 = 0x31315659,
1733 /**
1734 * 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes
1735 */
1736 WL_SHM_FORMAT_YUV420 = 0x32315559,
1737 /**
1738 * 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes
1739 */
1740 WL_SHM_FORMAT_YVU420 = 0x32315659,
1741 /**
1742 * 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes
1743 */
1744 WL_SHM_FORMAT_YUV422 = 0x36315559,
1745 /**
1746 * 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes
1747 */
1748 WL_SHM_FORMAT_YVU422 = 0x36315659,
1749 /**
1750 * 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes
1751 */
1752 WL_SHM_FORMAT_YUV444 = 0x34325559,
1753 /**
1754 * 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes
1755 */
1756 WL_SHM_FORMAT_YVU444 = 0x34325659,
1757 /**
1758 * [7:0] R
1759 */
1760 WL_SHM_FORMAT_R8 = 0x20203852,
1761 /**
1762 * [15:0] R little endian
1763 */
1764 WL_SHM_FORMAT_R16 = 0x20363152,
1765 /**
1766 * [15:0] R:G 8:8 little endian
1767 */
1768 WL_SHM_FORMAT_RG88 = 0x38384752,
1769 /**
1770 * [15:0] G:R 8:8 little endian
1771 */
1772 WL_SHM_FORMAT_GR88 = 0x38385247,
1773 /**
1774 * [31:0] R:G 16:16 little endian
1775 */
1776 WL_SHM_FORMAT_RG1616 = 0x32334752,
1777 /**
1778 * [31:0] G:R 16:16 little endian
1779 */
1780 WL_SHM_FORMAT_GR1616 = 0x32335247,
1781 /**
1782 * [63:0] x:R:G:B 16:16:16:16 little endian
1783 */
1784 WL_SHM_FORMAT_XRGB16161616F = 0x48345258,
1785 /**
1786 * [63:0] x:B:G:R 16:16:16:16 little endian
1787 */
1788 WL_SHM_FORMAT_XBGR16161616F = 0x48344258,
1789 /**
1790 * [63:0] A:R:G:B 16:16:16:16 little endian
1791 */
1792 WL_SHM_FORMAT_ARGB16161616F = 0x48345241,
1793 /**
1794 * [63:0] A:B:G:R 16:16:16:16 little endian
1795 */
1796 WL_SHM_FORMAT_ABGR16161616F = 0x48344241,
1797 /**
1798 * [31:0] X:Y:Cb:Cr 8:8:8:8 little endian
1799 */
1800 WL_SHM_FORMAT_XYUV8888 = 0x56555958,
1801 /**
1802 * [23:0] Cr:Cb:Y 8:8:8 little endian
1803 */
1804 WL_SHM_FORMAT_VUY888 = 0x34325556,
1805 /**
1806 * Y followed by U then V, 10:10:10. Non-linear modifier only
1807 */
1808 WL_SHM_FORMAT_VUY101010 = 0x30335556,
1809 /**
1810 * [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels
1811 */
1812 WL_SHM_FORMAT_Y210 = 0x30313259,
1813 /**
1814 * [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels
1815 */
1816 WL_SHM_FORMAT_Y212 = 0x32313259,
1817 /**
1818 * [63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels
1819 */
1820 WL_SHM_FORMAT_Y216 = 0x36313259,
1821 /**
1822 * [31:0] A:Cr:Y:Cb 2:10:10:10 little endian
1823 */
1824 WL_SHM_FORMAT_Y410 = 0x30313459,
1825 /**
1826 * [63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian
1827 */
1828 WL_SHM_FORMAT_Y412 = 0x32313459,
1829 /**
1830 * [63:0] A:Cr:Y:Cb 16:16:16:16 little endian
1831 */
1832 WL_SHM_FORMAT_Y416 = 0x36313459,
1833 /**
1834 * [31:0] X:Cr:Y:Cb 2:10:10:10 little endian
1835 */
1836 WL_SHM_FORMAT_XVYU2101010 = 0x30335658,
1837 /**
1838 * [63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian
1839 */
1840 WL_SHM_FORMAT_XVYU12_16161616 = 0x36335658,
1841 /**
1842 * [63:0] X:Cr:Y:Cb 16:16:16:16 little endian
1843 */
1844 WL_SHM_FORMAT_XVYU16161616 = 0x38345658,
1845 /**
1846 * [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian
1847 */
1848 WL_SHM_FORMAT_Y0L0 = 0x304c3059,
1849 /**
1850 * [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian
1851 */
1852 WL_SHM_FORMAT_X0L0 = 0x304c3058,
1853 /**
1854 * [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian
1855 */
1856 WL_SHM_FORMAT_Y0L2 = 0x324c3059,
1857 /**
1858 * [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian
1859 */
1860 WL_SHM_FORMAT_X0L2 = 0x324c3058,
1861 WL_SHM_FORMAT_YUV420_8BIT = 0x38305559,
1862 WL_SHM_FORMAT_YUV420_10BIT = 0x30315559,
1863 WL_SHM_FORMAT_XRGB8888_A8 = 0x38415258,
1864 WL_SHM_FORMAT_XBGR8888_A8 = 0x38414258,
1865 WL_SHM_FORMAT_RGBX8888_A8 = 0x38415852,
1866 WL_SHM_FORMAT_BGRX8888_A8 = 0x38415842,
1867 WL_SHM_FORMAT_RGB888_A8 = 0x38413852,
1868 WL_SHM_FORMAT_BGR888_A8 = 0x38413842,
1869 WL_SHM_FORMAT_RGB565_A8 = 0x38413552,
1870 WL_SHM_FORMAT_BGR565_A8 = 0x38413542,
1871 /**
1872 * non-subsampled Cr:Cb plane
1873 */
1874 WL_SHM_FORMAT_NV24 = 0x3432564e,
1875 /**
1876 * non-subsampled Cb:Cr plane
1877 */
1878 WL_SHM_FORMAT_NV42 = 0x3234564e,
1879 /**
1880 * 2x1 subsampled Cr:Cb plane, 10 bit per channel
1881 */
1882 WL_SHM_FORMAT_P210 = 0x30313250,
1883 /**
1884 * 2x2 subsampled Cr:Cb plane 10 bits per channel
1885 */
1886 WL_SHM_FORMAT_P010 = 0x30313050,
1887 /**
1888 * 2x2 subsampled Cr:Cb plane 12 bits per channel
1889 */
1890 WL_SHM_FORMAT_P012 = 0x32313050,
1891 /**
1892 * 2x2 subsampled Cr:Cb plane 16 bits per channel
1893 */
1894 WL_SHM_FORMAT_P016 = 0x36313050,
1895 /**
1896 * [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian
1897 */
1898 WL_SHM_FORMAT_AXBXGXRX106106106106 = 0x30314241,
1899 /**
1900 * 2x2 subsampled Cr:Cb plane
1901 */
1902 WL_SHM_FORMAT_NV15 = 0x3531564e,
1903 WL_SHM_FORMAT_Q410 = 0x30313451,
1904 WL_SHM_FORMAT_Q401 = 0x31303451,
1905 /**
1906 * [63:0] x:R:G:B 16:16:16:16 little endian
1907 */
1908 WL_SHM_FORMAT_XRGB16161616 = 0x38345258,
1909 /**
1910 * [63:0] x:B:G:R 16:16:16:16 little endian
1911 */
1912 WL_SHM_FORMAT_XBGR16161616 = 0x38344258,
1913 /**
1914 * [63:0] A:R:G:B 16:16:16:16 little endian
1915 */
1916 WL_SHM_FORMAT_ARGB16161616 = 0x38345241,
1917 /**
1918 * [63:0] A:B:G:R 16:16:16:16 little endian
1919 */
1920 WL_SHM_FORMAT_ABGR16161616 = 0x38344241,
1921 /**
1922 * [7:0] C0:C1:C2:C3:C4:C5:C6:C7 1:1:1:1:1:1:1:1 eight pixels/byte
1923 */
1924 WL_SHM_FORMAT_C1 = 0x20203143,
1925 /**
1926 * [7:0] C0:C1:C2:C3 2:2:2:2 four pixels/byte
1927 */
1928 WL_SHM_FORMAT_C2 = 0x20203243,
1929 /**
1930 * [7:0] C0:C1 4:4 two pixels/byte
1931 */
1932 WL_SHM_FORMAT_C4 = 0x20203443,
1933 /**
1934 * [7:0] D0:D1:D2:D3:D4:D5:D6:D7 1:1:1:1:1:1:1:1 eight pixels/byte
1935 */
1936 WL_SHM_FORMAT_D1 = 0x20203144,
1937 /**
1938 * [7:0] D0:D1:D2:D3 2:2:2:2 four pixels/byte
1939 */
1940 WL_SHM_FORMAT_D2 = 0x20203244,
1941 /**
1942 * [7:0] D0:D1 4:4 two pixels/byte
1943 */
1944 WL_SHM_FORMAT_D4 = 0x20203444,
1945 /**
1946 * [7:0] D
1947 */
1948 WL_SHM_FORMAT_D8 = 0x20203844,
1949 /**
1950 * [7:0] R0:R1:R2:R3:R4:R5:R6:R7 1:1:1:1:1:1:1:1 eight pixels/byte
1951 */
1952 WL_SHM_FORMAT_R1 = 0x20203152,
1953 /**
1954 * [7:0] R0:R1:R2:R3 2:2:2:2 four pixels/byte
1955 */
1956 WL_SHM_FORMAT_R2 = 0x20203252,
1957 /**
1958 * [7:0] R0:R1 4:4 two pixels/byte
1959 */
1960 WL_SHM_FORMAT_R4 = 0x20203452,
1961 /**
1962 * [15:0] x:R 6:10 little endian
1963 */
1964 WL_SHM_FORMAT_R10 = 0x20303152,
1965 /**
1966 * [15:0] x:R 4:12 little endian
1967 */
1968 WL_SHM_FORMAT_R12 = 0x20323152,
1969 /**
1970 * [31:0] A:Cr:Cb:Y 8:8:8:8 little endian
1971 */
1972 WL_SHM_FORMAT_AVUY8888 = 0x59555641,
1973 /**
1974 * [31:0] X:Cr:Cb:Y 8:8:8:8 little endian
1975 */
1976 WL_SHM_FORMAT_XVUY8888 = 0x59555658,
1977 /**
1978 * 2x2 subsampled Cr:Cb plane 10 bits per channel packed
1979 */
1980 WL_SHM_FORMAT_P030 = 0x30333050,
1982#endif /* WL_SHM_FORMAT_ENUM */
1984/**
1985 * @ingroup iface_wl_shm
1986 * @struct wl_shm_listener
1987 */
1988struct wl_shm_listener {
1989 /**
1990 * pixel format description
1992 * Informs the client about a valid pixel format that can be used
1993 * for buffers. Known formats include argb8888 and xrgb8888.
1994 * @param format buffer pixel format
1995 */
1996 void (*format)(void *data,
1997 struct wl_shm *wl_shm,
1998 uint32_t format);
2001/**
2002 * @ingroup iface_wl_shm
2003 */
2004static inline int
2005wl_shm_add_listener(struct wl_shm *wl_shm,
2006 const struct wl_shm_listener *listener, void *data)
2008 return wl_proxy_add_listener((struct wl_proxy *) wl_shm,
2009 (void (**)(void)) listener, data);
2012#define WL_SHM_CREATE_POOL 0
2013#define WL_SHM_RELEASE 1
2015/**
2016 * @ingroup iface_wl_shm
2017 */
2018#define WL_SHM_FORMAT_SINCE_VERSION 1
2020/**
2021 * @ingroup iface_wl_shm
2022 */
2023#define WL_SHM_CREATE_POOL_SINCE_VERSION 1
2024/**
2025 * @ingroup iface_wl_shm
2026 */
2027#define WL_SHM_RELEASE_SINCE_VERSION 2
2029/** @ingroup iface_wl_shm */
2030static inline void
2031wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data)
2033 wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data);
2036/** @ingroup iface_wl_shm */
2037static inline void *
2038wl_shm_get_user_data(struct wl_shm *wl_shm)
2040 return wl_proxy_get_user_data((struct wl_proxy *) wl_shm);
2043static inline uint32_t
2044wl_shm_get_version(struct wl_shm *wl_shm)
2046 return wl_proxy_get_version((struct wl_proxy *) wl_shm);
2049/** @ingroup iface_wl_shm */
2050static inline void
2051wl_shm_destroy(struct wl_shm *wl_shm)
2053 wl_proxy_destroy((struct wl_proxy *) wl_shm);
2056/**
2057 * @ingroup iface_wl_shm
2059 * Create a new wl_shm_pool object.
2061 * The pool can be used to create shared memory based buffer
2062 * objects. The server will mmap size bytes of the passed file
2063 * descriptor, to use as backing memory for the pool.
2064 */
2065static inline struct wl_shm_pool *
2066wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size)
2068 struct wl_proxy *id;
2070 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shm,
2071 WL_SHM_CREATE_POOL, &wl_shm_pool_interface, wl_proxy_get_version((struct wl_proxy *) wl_shm), 0, NULL, fd, size);
2073 return (struct wl_shm_pool *) id;
2076/**
2077 * @ingroup iface_wl_shm
2079 * Using this request a client can tell the server that it is not going to
2080 * use the shm object anymore.
2082 * Objects created via this interface remain unaffected.
2083 */
2084static inline void
2085wl_shm_release(struct wl_shm *wl_shm)
2087 wl_proxy_marshal_flags((struct wl_proxy *) wl_shm,
2088 WL_SHM_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm), WL_MARSHAL_FLAG_DESTROY);
2091/**
2092 * @ingroup iface_wl_buffer
2093 * @struct wl_buffer_listener
2094 */
2095struct wl_buffer_listener {
2096 /**
2097 * compositor releases buffer
2099 * Sent when this wl_buffer is no longer used by the compositor.
2101 * For more information on when release events may or may not be
2102 * sent, and what consequences it has, please see the description
2103 * of wl_surface.attach.
2105 * If a client receives a release event before the frame callback
2106 * requested in the same wl_surface.commit that attaches this
2107 * wl_buffer to a surface, then the client is immediately free to
2108 * reuse the buffer and its backing storage, and does not need a
2109 * second buffer for the next surface content update. Typically
2110 * this is possible, when the compositor maintains a copy of the
2111 * wl_surface contents, e.g. as a GL texture. This is an important
2112 * optimization for GL(ES) compositors with wl_shm clients.
2113 */
2114 void (*release)(void *data,
2115 struct wl_buffer *wl_buffer);
2118/**
2119 * @ingroup iface_wl_buffer
2120 */
2121static inline int
2122wl_buffer_add_listener(struct wl_buffer *wl_buffer,
2123 const struct wl_buffer_listener *listener, void *data)
2125 return wl_proxy_add_listener((struct wl_proxy *) wl_buffer,
2126 (void (**)(void)) listener, data);
2129#define WL_BUFFER_DESTROY 0
2131/**
2132 * @ingroup iface_wl_buffer
2133 */
2134#define WL_BUFFER_RELEASE_SINCE_VERSION 1
2136/**
2137 * @ingroup iface_wl_buffer
2138 */
2139#define WL_BUFFER_DESTROY_SINCE_VERSION 1
2141/** @ingroup iface_wl_buffer */
2142static inline void
2143wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data)
2145 wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data);
2148/** @ingroup iface_wl_buffer */
2149static inline void *
2150wl_buffer_get_user_data(struct wl_buffer *wl_buffer)
2152 return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer);
2155static inline uint32_t
2156wl_buffer_get_version(struct wl_buffer *wl_buffer)
2158 return wl_proxy_get_version((struct wl_proxy *) wl_buffer);
2161/**
2162 * @ingroup iface_wl_buffer
2164 * Destroy a buffer. If and how you need to release the backing
2165 * storage is defined by the buffer factory interface.
2167 * For possible side-effects to a surface, see wl_surface.attach.
2168 */
2169static inline void
2170wl_buffer_destroy(struct wl_buffer *wl_buffer)
2172 wl_proxy_marshal_flags((struct wl_proxy *) wl_buffer,
2173 WL_BUFFER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_buffer), WL_MARSHAL_FLAG_DESTROY);
2176#ifndef WL_DATA_OFFER_ERROR_ENUM
2177#define WL_DATA_OFFER_ERROR_ENUM
2178enum wl_data_offer_error {
2179 /**
2180 * finish request was called untimely
2181 */
2182 WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,
2183 /**
2184 * action mask contains invalid values
2185 */
2186 WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,
2187 /**
2188 * action argument has an invalid value
2189 */
2190 WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,
2191 /**
2192 * offer doesn't accept this request
2193 */
2194 WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,
2196#endif /* WL_DATA_OFFER_ERROR_ENUM */
2198/**
2199 * @ingroup iface_wl_data_offer
2200 * @struct wl_data_offer_listener
2201 */
2202struct wl_data_offer_listener {
2203 /**
2204 * advertise offered mime type
2206 * Sent immediately after creating the wl_data_offer object. One
2207 * event per offered mime type.
2208 * @param mime_type offered mime type
2209 */
2210 void (*offer)(void *data,
2211 struct wl_data_offer *wl_data_offer,
2212 const char *mime_type);
2213 /**
2214 * notify the source-side available actions
2216 * This event indicates the actions offered by the data source.
2217 * It will be sent immediately after creating the wl_data_offer
2218 * object, or anytime the source side changes its offered actions
2219 * through wl_data_source.set_actions.
2220 * @param source_actions actions offered by the data source
2221 * @since 3
2222 */
2223 void (*source_actions)(void *data,
2224 struct wl_data_offer *wl_data_offer,
2225 uint32_t source_actions);
2226 /**
2227 * notify the selected action
2229 * This event indicates the action selected by the compositor
2230 * after matching the source/destination side actions. Only one
2231 * action (or none) will be offered here.
2233 * This event can be emitted multiple times during the
2234 * drag-and-drop operation in response to destination side action
2235 * changes through wl_data_offer.set_actions.
2237 * This event will no longer be emitted after wl_data_device.drop
2238 * happened on the drag-and-drop destination, the client must honor
2239 * the last action received, or the last preferred one set through
2240 * wl_data_offer.set_actions when handling an "ask" action.
2242 * Compositors may also change the selected action on the fly,
2243 * mainly in response to keyboard modifier changes during the
2244 * drag-and-drop operation.
2246 * The most recent action received is always the valid one. Prior
2247 * to receiving wl_data_device.drop, the chosen action may change
2248 * (e.g. due to keyboard modifiers being pressed). At the time of
2249 * receiving wl_data_device.drop the drag-and-drop destination must
2250 * honor the last action received.
2252 * Action changes may still happen after wl_data_device.drop,
2253 * especially on "ask" actions, where the drag-and-drop destination
2254 * may choose another action afterwards. Action changes happening
2255 * at this stage are always the result of inter-client negotiation,
2256 * the compositor shall no longer be able to induce a different
2257 * action.
2259 * Upon "ask" actions, it is expected that the drag-and-drop
2260 * destination may potentially choose a different action and/or
2261 * mime type, based on wl_data_offer.source_actions and finally
2262 * chosen by the user (e.g. popping up a menu with the available
2263 * options). The final wl_data_offer.set_actions and
2264 * wl_data_offer.accept requests must happen before the call to
2265 * wl_data_offer.finish.
2266 * @param dnd_action action selected by the compositor
2267 * @since 3
2268 */
2269 void (*action)(void *data,
2270 struct wl_data_offer *wl_data_offer,
2271 uint32_t dnd_action);
2274/**
2275 * @ingroup iface_wl_data_offer
2276 */
2277static inline int
2278wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer,
2279 const struct wl_data_offer_listener *listener, void *data)
2281 return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer,
2282 (void (**)(void)) listener, data);
2285#define WL_DATA_OFFER_ACCEPT 0
2286#define WL_DATA_OFFER_RECEIVE 1
2287#define WL_DATA_OFFER_DESTROY 2
2288#define WL_DATA_OFFER_FINISH 3
2289#define WL_DATA_OFFER_SET_ACTIONS 4
2291/**
2292 * @ingroup iface_wl_data_offer
2293 */
2294#define WL_DATA_OFFER_OFFER_SINCE_VERSION 1
2295/**
2296 * @ingroup iface_wl_data_offer
2297 */
2298#define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 3
2299/**
2300 * @ingroup iface_wl_data_offer
2301 */
2302#define WL_DATA_OFFER_ACTION_SINCE_VERSION 3
2304/**
2305 * @ingroup iface_wl_data_offer
2306 */
2307#define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1
2308/**
2309 * @ingroup iface_wl_data_offer
2310 */
2311#define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1
2312/**
2313 * @ingroup iface_wl_data_offer
2314 */
2315#define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1
2316/**
2317 * @ingroup iface_wl_data_offer
2318 */
2319#define WL_DATA_OFFER_FINISH_SINCE_VERSION 3
2320/**
2321 * @ingroup iface_wl_data_offer
2322 */
2323#define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 3
2325/** @ingroup iface_wl_data_offer */
2326static inline void
2327wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data)
2329 wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data);
2332/** @ingroup iface_wl_data_offer */
2333static inline void *
2334wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer)
2336 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer);
2339static inline uint32_t
2340wl_data_offer_get_version(struct wl_data_offer *wl_data_offer)
2342 return wl_proxy_get_version((struct wl_proxy *) wl_data_offer);
2345/**
2346 * @ingroup iface_wl_data_offer
2348 * Indicate that the client can accept the given mime type, or
2349 * NULL for not accepted.
2351 * For objects of version 2 or older, this request is used by the
2352 * client to give feedback whether the client can receive the given
2353 * mime type, or NULL if none is accepted; the feedback does not
2354 * determine whether the drag-and-drop operation succeeds or not.
2356 * For objects of version 3 or newer, this request determines the
2357 * final result of the drag-and-drop operation. If the end result
2358 * is that no mime types were accepted, the drag-and-drop operation
2359 * will be cancelled and the corresponding drag source will receive
2360 * wl_data_source.cancelled. Clients may still use this event in
2361 * conjunction with wl_data_source.action for feedback.
2362 */
2363static inline void
2364wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type)
2366 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,
2367 WL_DATA_OFFER_ACCEPT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, serial, mime_type);
2370/**
2371 * @ingroup iface_wl_data_offer
2373 * To transfer the offered data, the client issues this request
2374 * and indicates the mime type it wants to receive. The transfer
2375 * happens through the passed file descriptor (typically created
2376 * with the pipe system call). The source client writes the data
2377 * in the mime type representation requested and then closes the
2378 * file descriptor.
2380 * The receiving client reads from the read end of the pipe until
2381 * EOF and then closes its end, at which point the transfer is
2382 * complete.
2384 * This request may happen multiple times for different mime types,
2385 * both before and after wl_data_device.drop. Drag-and-drop destination
2386 * clients may preemptively fetch data or examine it more closely to
2387 * determine acceptance.
2388 */
2389static inline void
2390wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type, int32_t fd)
2392 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,
2393 WL_DATA_OFFER_RECEIVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, mime_type, fd);
2396/**
2397 * @ingroup iface_wl_data_offer
2399 * Destroy the data offer.
2400 */
2401static inline void
2402wl_data_offer_destroy(struct wl_data_offer *wl_data_offer)
2404 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,
2405 WL_DATA_OFFER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), WL_MARSHAL_FLAG_DESTROY);
2408/**
2409 * @ingroup iface_wl_data_offer
2411 * Notifies the compositor that the drag destination successfully
2412 * finished the drag-and-drop operation.
2414 * Upon receiving this request, the compositor will emit
2415 * wl_data_source.dnd_finished on the drag source client.
2417 * It is a client error to perform other requests than
2418 * wl_data_offer.destroy after this one. It is also an error to perform
2419 * this request after a NULL mime type has been set in
2420 * wl_data_offer.accept or no action was received through
2421 * wl_data_offer.action.
2423 * If wl_data_offer.finish request is received for a non drag and drop
2424 * operation, the invalid_finish protocol error is raised.
2425 */
2426static inline void
2427wl_data_offer_finish(struct wl_data_offer *wl_data_offer)
2429 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,
2430 WL_DATA_OFFER_FINISH, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0);
2433/**
2434 * @ingroup iface_wl_data_offer
2436 * Sets the actions that the destination side client supports for
2437 * this operation. This request may trigger the emission of
2438 * wl_data_source.action and wl_data_offer.action events if the compositor
2439 * needs to change the selected action.
2441 * This request can be called multiple times throughout the
2442 * drag-and-drop operation, typically in response to wl_data_device.enter
2443 * or wl_data_device.motion events.
2445 * This request determines the final result of the drag-and-drop
2446 * operation. If the end result is that no action is accepted,
2447 * the drag source will receive wl_data_source.cancelled.
2449 * The dnd_actions argument must contain only values expressed in the
2450 * wl_data_device_manager.dnd_actions enum, and the preferred_action
2451 * argument must only contain one of those values set, otherwise it
2452 * will result in a protocol error.
2454 * While managing an "ask" action, the destination drag-and-drop client
2455 * may perform further wl_data_offer.receive requests, and is expected
2456 * to perform one last wl_data_offer.set_actions request with a preferred
2457 * action other than "ask" (and optionally wl_data_offer.accept) before
2458 * requesting wl_data_offer.finish, in order to convey the action selected
2459 * by the user. If the preferred action is not in the
2460 * wl_data_offer.source_actions mask, an error will be raised.
2462 * If the "ask" action is dismissed (e.g. user cancellation), the client
2463 * is expected to perform wl_data_offer.destroy right away.
2465 * This request can only be made on drag-and-drop offers, a protocol error
2466 * will be raised otherwise.
2467 */
2468static inline void
2469wl_data_offer_set_actions(struct wl_data_offer *wl_data_offer, uint32_t dnd_actions, uint32_t preferred_action)
2471 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,
2472 WL_DATA_OFFER_SET_ACTIONS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, dnd_actions, preferred_action);
2475#ifndef WL_DATA_SOURCE_ERROR_ENUM
2476#define WL_DATA_SOURCE_ERROR_ENUM
2477enum wl_data_source_error {
2478 /**
2479 * action mask contains invalid values
2480 */
2481 WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,
2482 /**
2483 * source doesn't accept this request
2484 */
2485 WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,
2487#endif /* WL_DATA_SOURCE_ERROR_ENUM */
2489/**
2490 * @ingroup iface_wl_data_source
2491 * @struct wl_data_source_listener
2492 */
2493struct wl_data_source_listener {
2494 /**
2495 * a target accepts an offered mime type
2497 * Sent when a target accepts pointer_focus or motion events. If
2498 * a target does not accept any of the offered types, type is NULL.
2500 * Used for feedback during drag-and-drop.
2501 * @param mime_type mime type accepted by the target
2502 */
2503 void (*target)(void *data,
2504 struct wl_data_source *wl_data_source,
2505 const char *mime_type);
2506 /**
2507 * send the data
2509 * Request for data from the client. Send the data as the
2510 * specified mime type over the passed file descriptor, then close
2511 * it.
2512 * @param mime_type mime type for the data
2513 * @param fd file descriptor for the data
2514 */
2515 void (*send)(void *data,
2516 struct wl_data_source *wl_data_source,
2517 const char *mime_type,
2518 int32_t fd);
2519 /**
2520 * selection was cancelled
2522 * This data source is no longer valid. There are several reasons
2523 * why this could happen:
2525 * - The data source has been replaced by another data source. -
2526 * The drag-and-drop operation was performed, but the drop
2527 * destination did not accept any of the mime types offered through
2528 * wl_data_source.target. - The drag-and-drop operation was
2529 * performed, but the drop destination did not select any of the
2530 * actions present in the mask offered through
2531 * wl_data_source.action. - The drag-and-drop operation was
2532 * performed but didn't happen over a surface. - The compositor
2533 * cancelled the drag-and-drop operation (e.g. compositor dependent
2534 * timeouts to avoid stale drag-and-drop transfers).
2536 * The client should clean up and destroy this data source.
2538 * For objects of version 2 or older, wl_data_source.cancelled will
2539 * only be emitted if the data source was replaced by another data
2540 * source.
2541 */
2542 void (*cancelled)(void *data,
2543 struct wl_data_source *wl_data_source);
2544 /**
2545 * the drag-and-drop operation physically finished
2547 * The user performed the drop action. This event does not
2548 * indicate acceptance, wl_data_source.cancelled may still be
2549 * emitted afterwards if the drop destination does not accept any
2550 * mime type.
2552 * However, this event might however not be received if the
2553 * compositor cancelled the drag-and-drop operation before this
2554 * event could happen.
2556 * Note that the data_source may still be used in the future and
2557 * should not be destroyed here.
2558 * @since 3
2559 */
2560 void (*dnd_drop_performed)(void *data,
2561 struct wl_data_source *wl_data_source);
2562 /**
2563 * the drag-and-drop operation concluded
2565 * The drop destination finished interoperating with this data
2566 * source, so the client is now free to destroy this data source
2567 * and free all associated data.
2569 * If the action used to perform the operation was "move", the
2570 * source can now delete the transferred data.
2571 * @since 3
2572 */
2573 void (*dnd_finished)(void *data,
2574 struct wl_data_source *wl_data_source);
2575 /**
2576 * notify the selected action
2578 * This event indicates the action selected by the compositor
2579 * after matching the source/destination side actions. Only one
2580 * action (or none) will be offered here.
2582 * This event can be emitted multiple times during the
2583 * drag-and-drop operation, mainly in response to destination side
2584 * changes through wl_data_offer.set_actions, and as the data
2585 * device enters/leaves surfaces.
2587 * It is only possible to receive this event after
2588 * wl_data_source.dnd_drop_performed if the drag-and-drop operation
2589 * ended in an "ask" action, in which case the final
2590 * wl_data_source.action event will happen immediately before
2591 * wl_data_source.dnd_finished.
2593 * Compositors may also change the selected action on the fly,
2594 * mainly in response to keyboard modifier changes during the
2595 * drag-and-drop operation.
2597 * The most recent action received is always the valid one. The
2598 * chosen action may change alongside negotiation (e.g. an "ask"
2599 * action can turn into a "move" operation), so the effects of the
2600 * final action must always be applied in
2601 * wl_data_offer.dnd_finished.
2603 * Clients can trigger cursor surface changes from this point, so
2604 * they reflect the current action.
2605 * @param dnd_action action selected by the compositor
2606 * @since 3
2607 */
2608 void (*action)(void *data,
2609 struct wl_data_source *wl_data_source,
2610 uint32_t dnd_action);
2613/**
2614 * @ingroup iface_wl_data_source
2615 */
2616static inline int
2617wl_data_source_add_listener(struct wl_data_source *wl_data_source,
2618 const struct wl_data_source_listener *listener, void *data)
2620 return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,
2621 (void (**)(void)) listener, data);
2624#define WL_DATA_SOURCE_OFFER 0
2625#define WL_DATA_SOURCE_DESTROY 1
2626#define WL_DATA_SOURCE_SET_ACTIONS 2
2628/**
2629 * @ingroup iface_wl_data_source
2630 */
2631#define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1
2632/**
2633 * @ingroup iface_wl_data_source
2634 */
2635#define WL_DATA_SOURCE_SEND_SINCE_VERSION 1
2636/**
2637 * @ingroup iface_wl_data_source
2638 */
2639#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1
2640/**
2641 * @ingroup iface_wl_data_source
2642 */
2643#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 3
2644/**
2645 * @ingroup iface_wl_data_source
2646 */
2647#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 3
2648/**
2649 * @ingroup iface_wl_data_source
2650 */
2651#define WL_DATA_SOURCE_ACTION_SINCE_VERSION 3
2653/**
2654 * @ingroup iface_wl_data_source
2655 */
2656#define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1
2657/**
2658 * @ingroup iface_wl_data_source
2659 */
2660#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1
2661/**
2662 * @ingroup iface_wl_data_source
2663 */
2664#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 3
2666/** @ingroup iface_wl_data_source */
2667static inline void
2668wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_data)
2670 wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data);
2673/** @ingroup iface_wl_data_source */
2674static inline void *
2675wl_data_source_get_user_data(struct wl_data_source *wl_data_source)
2677 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);
2680static inline uint32_t
2681wl_data_source_get_version(struct wl_data_source *wl_data_source)
2683 return wl_proxy_get_version((struct wl_proxy *) wl_data_source);
2686/**
2687 * @ingroup iface_wl_data_source
2689 * This request adds a mime type to the set of mime types
2690 * advertised to targets. Can be called several times to offer
2691 * multiple types.
2692 */
2693static inline void
2694wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_type)
2696 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,
2697 WL_DATA_SOURCE_OFFER, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), 0, mime_type);
2700/**
2701 * @ingroup iface_wl_data_source
2703 * Destroy the data source.
2704 */
2705static inline void
2706wl_data_source_destroy(struct wl_data_source *wl_data_source)
2708 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,
2709 WL_DATA_SOURCE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), WL_MARSHAL_FLAG_DESTROY);
2712/**
2713 * @ingroup iface_wl_data_source
2715 * Sets the actions that the source side client supports for this
2716 * operation. This request may trigger wl_data_source.action and
2717 * wl_data_offer.action events if the compositor needs to change the
2718 * selected action.
2720 * The dnd_actions argument must contain only values expressed in the
2721 * wl_data_device_manager.dnd_actions enum, otherwise it will result
2722 * in a protocol error.
2724 * This request must be made once only, and can only be made on sources
2725 * used in drag-and-drop, so it must be performed before
2726 * wl_data_device.start_drag. Attempting to use the source other than
2727 * for drag-and-drop will raise a protocol error.
2728 */
2729static inline void
2730wl_data_source_set_actions(struct wl_data_source *wl_data_source, uint32_t dnd_actions)
2732 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,
2733 WL_DATA_SOURCE_SET_ACTIONS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), 0, dnd_actions);
2736#ifndef WL_DATA_DEVICE_ERROR_ENUM
2737#define WL_DATA_DEVICE_ERROR_ENUM
2738enum wl_data_device_error {
2739 /**
2740 * given wl_surface has another role
2741 */
2742 WL_DATA_DEVICE_ERROR_ROLE = 0,
2743 /**
2744 * source has already been used
2745 */
2746 WL_DATA_DEVICE_ERROR_USED_SOURCE = 1,
2748#endif /* WL_DATA_DEVICE_ERROR_ENUM */
2750/**
2751 * @ingroup iface_wl_data_device
2752 * @struct wl_data_device_listener
2753 */
2754struct wl_data_device_listener {
2755 /**
2756 * introduce a new wl_data_offer
2758 * The data_offer event introduces a new wl_data_offer object,
2759 * which will subsequently be used in either the data_device.enter
2760 * event (for drag-and-drop) or the data_device.selection event
2761 * (for selections). Immediately following the
2762 * data_device.data_offer event, the new data_offer object will
2763 * send out data_offer.offer events to describe the mime types it
2764 * offers.
2765 * @param id the new data_offer object
2766 */
2767 void (*data_offer)(void *data,
2768 struct wl_data_device *wl_data_device,
2769 struct wl_data_offer *id);
2770 /**
2771 * initiate drag-and-drop session
2773 * This event is sent when an active drag-and-drop pointer enters
2774 * a surface owned by the client. The position of the pointer at
2775 * enter time is provided by the x and y arguments, in
2776 * surface-local coordinates.
2777 * @param serial serial number of the enter event
2778 * @param surface client surface entered
2779 * @param x surface-local x coordinate
2780 * @param y surface-local y coordinate
2781 * @param id source data_offer object
2782 */
2783 void (*enter)(void *data,
2784 struct wl_data_device *wl_data_device,
2785 uint32_t serial,
2786 struct wl_surface *surface,
2787 wl_fixed_t x,
2788 wl_fixed_t y,
2789 struct wl_data_offer *id);
2790 /**
2791 * end drag-and-drop session
2793 * This event is sent when the drag-and-drop pointer leaves the
2794 * surface and the session ends. The client must destroy the
2795 * wl_data_offer introduced at enter time at this point.
2796 */
2797 void (*leave)(void *data,
2798 struct wl_data_device *wl_data_device);
2799 /**
2800 * drag-and-drop session motion
2802 * This event is sent when the drag-and-drop pointer moves within
2803 * the currently focused surface. The new position of the pointer
2804 * is provided by the x and y arguments, in surface-local
2805 * coordinates.
2806 * @param time timestamp with millisecond granularity
2807 * @param x surface-local x coordinate
2808 * @param y surface-local y coordinate
2809 */
2810 void (*motion)(void *data,
2811 struct wl_data_device *wl_data_device,
2812 uint32_t time,
2813 wl_fixed_t x,
2814 wl_fixed_t y);
2815 /**
2816 * end drag-and-drop session successfully
2818 * The event is sent when a drag-and-drop operation is ended
2819 * because the implicit grab is removed.
2821 * The drag-and-drop destination is expected to honor the last
2822 * action received through wl_data_offer.action, if the resulting
2823 * action is "copy" or "move", the destination can still perform
2824 * wl_data_offer.receive requests, and is expected to end all
2825 * transfers with a wl_data_offer.finish request.
2827 * If the resulting action is "ask", the action will not be
2828 * considered final. The drag-and-drop destination is expected to
2829 * perform one last wl_data_offer.set_actions request, or
2830 * wl_data_offer.destroy in order to cancel the operation.
2831 */
2832 void (*drop)(void *data,
2833 struct wl_data_device *wl_data_device);
2834 /**
2835 * advertise new selection
2837 * The selection event is sent out to notify the client of a new
2838 * wl_data_offer for the selection for this device. The
2839 * data_device.data_offer and the data_offer.offer events are sent
2840 * out immediately before this event to introduce the data offer
2841 * object. The selection event is sent to a client immediately
2842 * before receiving keyboard focus and when a new selection is set
2843 * while the client has keyboard focus. The data_offer is valid
2844 * until a new data_offer or NULL is received or until the client
2845 * loses keyboard focus. Switching surface with keyboard focus
2846 * within the same client doesn't mean a new selection will be
2847 * sent. The client must destroy the previous selection data_offer,
2848 * if any, upon receiving this event.
2849 * @param id selection data_offer object
2850 */
2851 void (*selection)(void *data,
2852 struct wl_data_device *wl_data_device,
2853 struct wl_data_offer *id);
2856/**
2857 * @ingroup iface_wl_data_device
2858 */
2859static inline int
2860wl_data_device_add_listener(struct wl_data_device *wl_data_device,
2861 const struct wl_data_device_listener *listener, void *data)
2863 return wl_proxy_add_listener((struct wl_proxy *) wl_data_device,
2864 (void (**)(void)) listener, data);
2867#define WL_DATA_DEVICE_START_DRAG 0
2868#define WL_DATA_DEVICE_SET_SELECTION 1
2869#define WL_DATA_DEVICE_RELEASE 2
2871/**
2872 * @ingroup iface_wl_data_device
2873 */
2874#define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1
2875/**
2876 * @ingroup iface_wl_data_device
2877 */
2878#define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1
2879/**
2880 * @ingroup iface_wl_data_device
2881 */
2882#define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1
2883/**
2884 * @ingroup iface_wl_data_device
2885 */
2886#define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1
2887/**
2888 * @ingroup iface_wl_data_device
2889 */
2890#define WL_DATA_DEVICE_DROP_SINCE_VERSION 1
2891/**
2892 * @ingroup iface_wl_data_device
2893 */
2894#define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1
2896/**
2897 * @ingroup iface_wl_data_device
2898 */
2899#define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1
2900/**
2901 * @ingroup iface_wl_data_device
2902 */
2903#define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1
2904/**
2905 * @ingroup iface_wl_data_device
2906 */
2907#define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 2
2909/** @ingroup iface_wl_data_device */
2910static inline void
2911wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_data)
2913 wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data);
2916/** @ingroup iface_wl_data_device */
2917static inline void *
2918wl_data_device_get_user_data(struct wl_data_device *wl_data_device)
2920 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device);
2923static inline uint32_t
2924wl_data_device_get_version(struct wl_data_device *wl_data_device)
2926 return wl_proxy_get_version((struct wl_proxy *) wl_data_device);
2929/** @ingroup iface_wl_data_device */
2930static inline void
2931wl_data_device_destroy(struct wl_data_device *wl_data_device)
2933 wl_proxy_destroy((struct wl_proxy *) wl_data_device);
2936/**
2937 * @ingroup iface_wl_data_device
2939 * This request asks the compositor to start a drag-and-drop
2940 * operation on behalf of the client.
2942 * The source argument is the data source that provides the data
2943 * for the eventual data transfer. If source is NULL, enter, leave
2944 * and motion events are sent only to the client that initiated the
2945 * drag and the client is expected to handle the data passing
2946 * internally. If source is destroyed, the drag-and-drop session will be
2947 * cancelled.
2949 * The origin surface is the surface where the drag originates and
2950 * the client must have an active implicit grab that matches the
2951 * serial.
2953 * The icon surface is an optional (can be NULL) surface that
2954 * provides an icon to be moved around with the cursor. Initially,
2955 * the top-left corner of the icon surface is placed at the cursor
2956 * hotspot, but subsequent wl_surface.offset requests can move the
2957 * relative position. Attach requests must be confirmed with
2958 * wl_surface.commit as usual. The icon surface is given the role of
2959 * a drag-and-drop icon. If the icon surface already has another role,
2960 * it raises a protocol error.
2962 * The input region is ignored for wl_surfaces with the role of a
2963 * drag-and-drop icon.
2965 * The given source may not be used in any further set_selection or
2966 * start_drag requests. Attempting to reuse a previously-used source
2967 * may send a used_source error.
2968 */
2969static inline void
2970wl_data_device_start_drag(struct wl_data_device *wl_data_device, struct wl_data_source *source, struct wl_surface *origin, struct wl_surface *icon, uint32_t serial)
2972 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,
2973 WL_DATA_DEVICE_START_DRAG, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), 0, source, origin, icon, serial);
2976/**
2977 * @ingroup iface_wl_data_device
2979 * This request asks the compositor to set the selection
2980 * to the data from the source on behalf of the client.
2982 * To unset the selection, set the source to NULL.
2984 * The given source may not be used in any further set_selection or
2985 * start_drag requests. Attempting to reuse a previously-used source
2986 * may send a used_source error.
2987 */
2988static inline void
2989wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_data_source *source, uint32_t serial)
2991 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,
2992 WL_DATA_DEVICE_SET_SELECTION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), 0, source, serial);
2995/**
2996 * @ingroup iface_wl_data_device
2998 * This request destroys the data device.
2999 */
3000static inline void
3001wl_data_device_release(struct wl_data_device *wl_data_device)
3003 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,
3004 WL_DATA_DEVICE_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), WL_MARSHAL_FLAG_DESTROY);
3007#ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
3008#define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
3009/**
3010 * @ingroup iface_wl_data_device_manager
3011 * drag and drop actions
3013 * This is a bitmask of the available/preferred actions in a
3014 * drag-and-drop operation.
3016 * In the compositor, the selected action is a result of matching the
3017 * actions offered by the source and destination sides. "action" events
3018 * with a "none" action will be sent to both source and destination if
3019 * there is no match. All further checks will effectively happen on
3020 * (source actions ∩ destination actions).
3022 * In addition, compositors may also pick different actions in
3023 * reaction to key modifiers being pressed. One common design that
3024 * is used in major toolkits (and the behavior recommended for
3025 * compositors) is:
3027 * - If no modifiers are pressed, the first match (in bit order)
3028 * will be used.
3029 * - Pressing Shift selects "move", if enabled in the mask.
3030 * - Pressing Control selects "copy", if enabled in the mask.
3032 * Behavior beyond that is considered implementation-dependent.
3033 * Compositors may for example bind other modifiers (like Alt/Meta)
3034 * or drags initiated with other buttons than BTN_LEFT to specific
3035 * actions (e.g. "ask").
3036 */
3037enum wl_data_device_manager_dnd_action {
3038 /**
3039 * no action
3040 */
3041 WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,
3042 /**
3043 * copy action
3044 */
3045 WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,
3046 /**
3047 * move action
3048 */
3049 WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,
3050 /**
3051 * ask action
3052 */
3053 WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,
3055#endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */
3057#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 0
3058#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 1
3061/**
3062 * @ingroup iface_wl_data_device_manager
3063 */
3064#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1
3065/**
3066 * @ingroup iface_wl_data_device_manager
3067 */
3068#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1
3070/** @ingroup iface_wl_data_device_manager */
3071static inline void
3072wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_device_manager, void *user_data)
3074 wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_data);
3077/** @ingroup iface_wl_data_device_manager */
3078static inline void *
3079wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_device_manager)
3081 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager);
3084static inline uint32_t
3085wl_data_device_manager_get_version(struct wl_data_device_manager *wl_data_device_manager)
3087 return wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager);
3090/** @ingroup iface_wl_data_device_manager */
3091static inline void
3092wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_manager)
3094 wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager);
3097/**
3098 * @ingroup iface_wl_data_device_manager
3100 * Create a new data source.
3101 */
3102static inline struct wl_data_source *
3103wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data_device_manager)
3105 struct wl_proxy *id;
3107 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device_manager,
3108 WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, &wl_data_source_interface, wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager), 0, NULL);
3110 return (struct wl_data_source *) id;
3113/**
3114 * @ingroup iface_wl_data_device_manager
3116 * Create a new data device for a given seat.
3117 */
3118static inline struct wl_data_device *
3119wl_data_device_manager_get_data_device(struct wl_data_device_manager *wl_data_device_manager, struct wl_seat *seat)
3121 struct wl_proxy *id;
3123 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device_manager,
3124 WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, &wl_data_device_interface, wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager), 0, NULL, seat);
3126 return (struct wl_data_device *) id;
3129#ifndef WL_SHELL_ERROR_ENUM
3130#define WL_SHELL_ERROR_ENUM
3131enum wl_shell_error {
3132 /**
3133 * given wl_surface has another role
3134 */
3135 WL_SHELL_ERROR_ROLE = 0,
3137#endif /* WL_SHELL_ERROR_ENUM */
3139#define WL_SHELL_GET_SHELL_SURFACE 0
3142/**
3143 * @ingroup iface_wl_shell
3144 */
3145#define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1
3147/** @ingroup iface_wl_shell */
3148static inline void
3149wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data)
3151 wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data);
3154/** @ingroup iface_wl_shell */
3155static inline void *
3156wl_shell_get_user_data(struct wl_shell *wl_shell)
3158 return wl_proxy_get_user_data((struct wl_proxy *) wl_shell);
3161static inline uint32_t
3162wl_shell_get_version(struct wl_shell *wl_shell)
3164 return wl_proxy_get_version((struct wl_proxy *) wl_shell);
3167/** @ingroup iface_wl_shell */
3168static inline void
3169wl_shell_destroy(struct wl_shell *wl_shell)
3171 wl_proxy_destroy((struct wl_proxy *) wl_shell);
3174/**
3175 * @ingroup iface_wl_shell
3177 * Create a shell surface for an existing surface. This gives
3178 * the wl_surface the role of a shell surface. If the wl_surface
3179 * already has another role, it raises a protocol error.
3181 * Only one shell surface can be associated with a given surface.
3182 */
3183static inline struct wl_shell_surface *
3184wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface)
3186 struct wl_proxy *id;
3188 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shell,
3189 WL_SHELL_GET_SHELL_SURFACE, &wl_shell_surface_interface, wl_proxy_get_version((struct wl_proxy *) wl_shell), 0, NULL, surface);
3191 return (struct wl_shell_surface *) id;
3194#ifndef WL_SHELL_SURFACE_RESIZE_ENUM
3195#define WL_SHELL_SURFACE_RESIZE_ENUM
3196/**
3197 * @ingroup iface_wl_shell_surface
3198 * edge values for resizing
3200 * These values are used to indicate which edge of a surface
3201 * is being dragged in a resize operation. The server may
3202 * use this information to adapt its behavior, e.g. choose
3203 * an appropriate cursor image.
3204 */
3205enum wl_shell_surface_resize {
3206 /**
3207 * no edge
3208 */
3209 WL_SHELL_SURFACE_RESIZE_NONE = 0,
3210 /**
3211 * top edge
3212 */
3213 WL_SHELL_SURFACE_RESIZE_TOP = 1,
3214 /**
3215 * bottom edge
3216 */
3217 WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,
3218 /**
3219 * left edge
3220 */
3221 WL_SHELL_SURFACE_RESIZE_LEFT = 4,
3222 /**
3223 * top and left edges
3224 */
3225 WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,
3226 /**
3227 * bottom and left edges
3228 */
3229 WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,
3230 /**
3231 * right edge
3232 */
3233 WL_SHELL_SURFACE_RESIZE_RIGHT = 8,
3234 /**
3235 * top and right edges
3236 */
3237 WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,
3238 /**
3239 * bottom and right edges
3240 */
3241 WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10,
3243#endif /* WL_SHELL_SURFACE_RESIZE_ENUM */
3245#ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM
3246#define WL_SHELL_SURFACE_TRANSIENT_ENUM
3247/**
3248 * @ingroup iface_wl_shell_surface
3249 * details of transient behaviour
3251 * These flags specify details of the expected behaviour
3252 * of transient surfaces. Used in the set_transient request.
3253 */
3254enum wl_shell_surface_transient {
3255 /**
3256 * do not set keyboard focus
3257 */
3258 WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1,
3260#endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */
3262#ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
3263#define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
3264/**
3265 * @ingroup iface_wl_shell_surface
3266 * different method to set the surface fullscreen
3268 * Hints to indicate to the compositor how to deal with a conflict
3269 * between the dimensions of the surface and the dimensions of the
3270 * output. The compositor is free to ignore this parameter.
3271 */
3272enum wl_shell_surface_fullscreen_method {
3273 /**
3274 * no preference, apply default policy
3275 */
3276 WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,
3277 /**
3278 * scale, preserve the surface's aspect ratio and center on output
3279 */
3280 WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,
3281 /**
3282 * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch
3283 */
3284 WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,
3285 /**
3286 * no upscaling, center on output and add black borders to compensate size mismatch
3287 */
3288 WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3,
3290#endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */
3292/**
3293 * @ingroup iface_wl_shell_surface
3294 * @struct wl_shell_surface_listener
3295 */
3296struct wl_shell_surface_listener {
3297 /**
3298 * ping client
3300 * Ping a client to check if it is receiving events and sending
3301 * requests. A client is expected to reply with a pong request.
3302 * @param serial serial number of the ping
3303 */
3304 void (*ping)(void *data,
3305 struct wl_shell_surface *wl_shell_surface,
3306 uint32_t serial);
3307 /**
3308 * suggest resize
3310 * The configure event asks the client to resize its surface.
3312 * The size is a hint, in the sense that the client is free to
3313 * ignore it if it doesn't resize, pick a smaller size (to satisfy
3314 * aspect ratio or resize in steps of NxM pixels).
3316 * The edges parameter provides a hint about how the surface was
3317 * resized. The client may use this information to decide how to
3318 * adjust its content to the new size (e.g. a scrolling area might
3319 * adjust its content position to leave the viewable content
3320 * unmoved).
3322 * The client is free to dismiss all but the last configure event
3323 * it received.
3325 * The width and height arguments specify the size of the window in
3326 * surface-local coordinates.
3327 * @param edges how the surface was resized
3328 * @param width new width of the surface
3329 * @param height new height of the surface
3330 */
3331 void (*configure)(void *data,
3332 struct wl_shell_surface *wl_shell_surface,
3333 uint32_t edges,
3334 int32_t width,
3335 int32_t height);
3336 /**
3337 * popup interaction is done
3339 * The popup_done event is sent out when a popup grab is broken,
3340 * that is, when the user clicks a surface that doesn't belong to
3341 * the client owning the popup surface.
3342 */
3343 void (*popup_done)(void *data,
3344 struct wl_shell_surface *wl_shell_surface);
3347/**
3348 * @ingroup iface_wl_shell_surface
3349 */
3350static inline int
3351wl_shell_surface_add_listener(struct wl_shell_surface *wl_shell_surface,
3352 const struct wl_shell_surface_listener *listener, void *data)
3354 return wl_proxy_add_listener((struct wl_proxy *) wl_shell_surface,
3355 (void (**)(void)) listener, data);
3358#define WL_SHELL_SURFACE_PONG 0
3359#define WL_SHELL_SURFACE_MOVE 1
3360#define WL_SHELL_SURFACE_RESIZE 2
3361#define WL_SHELL_SURFACE_SET_TOPLEVEL 3
3362#define WL_SHELL_SURFACE_SET_TRANSIENT 4
3363#define WL_SHELL_SURFACE_SET_FULLSCREEN 5
3364#define WL_SHELL_SURFACE_SET_POPUP 6
3365#define WL_SHELL_SURFACE_SET_MAXIMIZED 7
3366#define WL_SHELL_SURFACE_SET_TITLE 8
3367#define WL_SHELL_SURFACE_SET_CLASS 9
3369/**
3370 * @ingroup iface_wl_shell_surface
3371 */
3372#define WL_SHELL_SURFACE_PING_SINCE_VERSION 1
3373/**
3374 * @ingroup iface_wl_shell_surface
3375 */
3376#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1
3377/**
3378 * @ingroup iface_wl_shell_surface
3379 */
3380#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 1
3382/**
3383 * @ingroup iface_wl_shell_surface
3384 */
3385#define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1
3386/**
3387 * @ingroup iface_wl_shell_surface
3388 */
3389#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1
3390/**
3391 * @ingroup iface_wl_shell_surface
3392 */
3393#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1
3394/**
3395 * @ingroup iface_wl_shell_surface
3396 */
3397#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1
3398/**
3399 * @ingroup iface_wl_shell_surface
3400 */
3401#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1
3402/**
3403 * @ingroup iface_wl_shell_surface
3404 */
3405#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
3406/**
3407 * @ingroup iface_wl_shell_surface
3408 */
3409#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1
3410/**
3411 * @ingroup iface_wl_shell_surface
3412 */
3413#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
3414/**
3415 * @ingroup iface_wl_shell_surface
3416 */
3417#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1
3418/**
3419 * @ingroup iface_wl_shell_surface
3420 */
3421#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1
3423/** @ingroup iface_wl_shell_surface */
3424static inline void
3425wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void *user_data)
3427 wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data);
3430/** @ingroup iface_wl_shell_surface */
3431static inline void *
3432wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface)
3434 return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface);
3437static inline uint32_t
3438wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface)
3440 return wl_proxy_get_version((struct wl_proxy *) wl_shell_surface);
3443/** @ingroup iface_wl_shell_surface */
3444static inline void
3445wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface)
3447 wl_proxy_destroy((struct wl_proxy *) wl_shell_surface);
3450/**
3451 * @ingroup iface_wl_shell_surface
3453 * A client must respond to a ping event with a pong request or
3454 * the client may be deemed unresponsive.
3455 */
3456static inline void
3457wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial)
3459 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3460 WL_SHELL_SURFACE_PONG, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, serial);
3463/**
3464 * @ingroup iface_wl_shell_surface
3466 * Start a pointer-driven move of the surface.
3468 * This request must be used in response to a button press event.
3469 * The server may ignore move requests depending on the state of
3470 * the surface (e.g. fullscreen or maximized).
3471 */
3472static inline void
3473wl_shell_surface_move(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial)
3475 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3476 WL_SHELL_SURFACE_MOVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial);
3479/**
3480 * @ingroup iface_wl_shell_surface
3482 * Start a pointer-driven resizing of the surface.
3484 * This request must be used in response to a button press event.
3485 * The server may ignore resize requests depending on the state of
3486 * the surface (e.g. fullscreen or maximized).
3487 */
3488static inline void
3489wl_shell_surface_resize(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
3491 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3492 WL_SHELL_SURFACE_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial, edges);
3495/**
3496 * @ingroup iface_wl_shell_surface
3498 * Map the surface as a toplevel surface.
3500 * A toplevel surface is not fullscreen, maximized or transient.
3501 */
3502static inline void
3503wl_shell_surface_set_toplevel(struct wl_shell_surface *wl_shell_surface)
3505 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3506 WL_SHELL_SURFACE_SET_TOPLEVEL, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0);
3509/**
3510 * @ingroup iface_wl_shell_surface
3512 * Map the surface relative to an existing surface.
3514 * The x and y arguments specify the location of the upper left
3515 * corner of the surface relative to the upper left corner of the
3516 * parent surface, in surface-local coordinates.
3518 * The flags argument controls details of the transient behaviour.
3519 */
3520static inline void
3521wl_shell_surface_set_transient(struct wl_shell_surface *wl_shell_surface, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)
3523 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3524 WL_SHELL_SURFACE_SET_TRANSIENT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, parent, x, y, flags);
3527/**
3528 * @ingroup iface_wl_shell_surface
3530 * Map the surface as a fullscreen surface.
3532 * If an output parameter is given then the surface will be made
3533 * fullscreen on that output. If the client does not specify the
3534 * output then the compositor will apply its policy - usually
3535 * choosing the output on which the surface has the biggest surface
3536 * area.
3538 * The client may specify a method to resolve a size conflict
3539 * between the output size and the surface size - this is provided
3540 * through the method parameter.
3542 * The framerate parameter is used only when the method is set
3543 * to "driver", to indicate the preferred framerate. A value of 0
3544 * indicates that the client does not care about framerate. The
3545 * framerate is specified in mHz, that is framerate of 60000 is 60Hz.
3547 * A method of "scale" or "driver" implies a scaling operation of
3548 * the surface, either via a direct scaling operation or a change of
3549 * the output mode. This will override any kind of output scaling, so
3550 * that mapping a surface with a buffer size equal to the mode can
3551 * fill the screen independent of buffer_scale.
3553 * A method of "fill" means we don't scale up the buffer, however
3554 * any output scale is applied. This means that you may run into
3555 * an edge case where the application maps a buffer with the same
3556 * size of the output mode but buffer_scale 1 (thus making a
3557 * surface larger than the output). In this case it is allowed to
3558 * downscale the results to fit the screen.
3560 * The compositor must reply to this request with a configure event
3561 * with the dimensions for the output on which the surface will
3562 * be made fullscreen.
3563 */
3564static inline void
3565wl_shell_surface_set_fullscreen(struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output)
3567 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3568 WL_SHELL_SURFACE_SET_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, method, framerate, output);
3571/**
3572 * @ingroup iface_wl_shell_surface
3574 * Map the surface as a popup.
3576 * A popup surface is a transient surface with an added pointer
3577 * grab.
3579 * An existing implicit grab will be changed to owner-events mode,
3580 * and the popup grab will continue after the implicit grab ends
3581 * (i.e. releasing the mouse button does not cause the popup to
3582 * be unmapped).
3584 * The popup grab continues until the window is destroyed or a
3585 * mouse button is pressed in any other client's window. A click
3586 * in any of the client's surfaces is reported as normal, however,
3587 * clicks in other clients' surfaces will be discarded and trigger
3588 * the callback.
3590 * The x and y arguments specify the location of the upper left
3591 * corner of the surface relative to the upper left corner of the
3592 * parent surface, in surface-local coordinates.
3593 */
3594static inline void
3595wl_shell_surface_set_popup(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)
3597 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3598 WL_SHELL_SURFACE_SET_POPUP, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial, parent, x, y, flags);
3601/**
3602 * @ingroup iface_wl_shell_surface
3604 * Map the surface as a maximized surface.
3606 * If an output parameter is given then the surface will be
3607 * maximized on that output. If the client does not specify the
3608 * output then the compositor will apply its policy - usually
3609 * choosing the output on which the surface has the biggest surface
3610 * area.
3612 * The compositor will reply with a configure event telling
3613 * the expected new surface size. The operation is completed
3614 * on the next buffer attach to this surface.
3616 * A maximized surface typically fills the entire output it is
3617 * bound to, except for desktop elements such as panels. This is
3618 * the main difference between a maximized shell surface and a
3619 * fullscreen shell surface.
3621 * The details depend on the compositor implementation.
3622 */
3623static inline void
3624wl_shell_surface_set_maximized(struct wl_shell_surface *wl_shell_surface, struct wl_output *output)
3626 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3627 WL_SHELL_SURFACE_SET_MAXIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, output);
3630/**
3631 * @ingroup iface_wl_shell_surface
3633 * Set a short title for the surface.
3635 * This string may be used to identify the surface in a task bar,
3636 * window list, or other user interface elements provided by the
3637 * compositor.
3639 * The string must be encoded in UTF-8.
3640 */
3641static inline void
3642wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface, const char *title)
3644 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3645 WL_SHELL_SURFACE_SET_TITLE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, title);
3648/**
3649 * @ingroup iface_wl_shell_surface
3651 * Set a class for the surface.
3653 * The surface class identifies the general class of applications
3654 * to which the surface belongs. A common convention is to use the
3655 * file name (or the full path if it is a non-standard location) of
3656 * the application's .desktop file as the class.
3657 */
3658static inline void
3659wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface, const char *class_)
3661 wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,
3662 WL_SHELL_SURFACE_SET_CLASS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, class_);
3665#ifndef WL_SURFACE_ERROR_ENUM
3666#define WL_SURFACE_ERROR_ENUM
3667/**
3668 * @ingroup iface_wl_surface
3669 * wl_surface error values
3671 * These errors can be emitted in response to wl_surface requests.
3672 */
3673enum wl_surface_error {
3674 /**
3675 * buffer scale value is invalid
3676 */
3677 WL_SURFACE_ERROR_INVALID_SCALE = 0,
3678 /**
3679 * buffer transform value is invalid
3680 */
3681 WL_SURFACE_ERROR_INVALID_TRANSFORM = 1,
3682 /**
3683 * buffer size is invalid
3684 */
3685 WL_SURFACE_ERROR_INVALID_SIZE = 2,
3686 /**
3687 * buffer offset is invalid
3688 */
3689 WL_SURFACE_ERROR_INVALID_OFFSET = 3,
3690 /**
3691 * surface was destroyed before its role object
3692 */
3693 WL_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT = 4,
3695#endif /* WL_SURFACE_ERROR_ENUM */
3697/**
3698 * @ingroup iface_wl_surface
3699 * @struct wl_surface_listener
3700 */
3701struct wl_surface_listener {
3702 /**
3703 * surface enters an output
3705 * This is emitted whenever a surface's creation, movement, or
3706 * resizing results in some part of it being within the scanout
3707 * region of an output.
3709 * Note that a surface may be overlapping with zero or more
3710 * outputs.
3711 * @param output output entered by the surface
3712 */
3713 void (*enter)(void *data,
3714 struct wl_surface *wl_surface,
3715 struct wl_output *output);
3716 /**
3717 * surface leaves an output
3719 * This is emitted whenever a surface's creation, movement, or
3720 * resizing results in it no longer having any part of it within
3721 * the scanout region of an output.
3723 * Clients should not use the number of outputs the surface is on
3724 * for frame throttling purposes. The surface might be hidden even
3725 * if no leave event has been sent, and the compositor might expect
3726 * new surface content updates even if no enter event has been
3727 * sent. The frame event should be used instead.
3728 * @param output output left by the surface
3729 */
3730 void (*leave)(void *data,
3731 struct wl_surface *wl_surface,
3732 struct wl_output *output);
3733 /**
3734 * preferred buffer scale for the surface
3736 * This event indicates the preferred buffer scale for this
3737 * surface. It is sent whenever the compositor's preference
3738 * changes.
3740 * Before receiving this event the preferred buffer scale for this
3741 * surface is 1.
3743 * It is intended that scaling aware clients use this event to
3744 * scale their content and use wl_surface.set_buffer_scale to
3745 * indicate the scale they have rendered with. This allows clients
3746 * to supply a higher detail buffer.
3748 * The compositor shall emit a scale value greater than 0.
3749 * @param factor preferred scaling factor
3750 * @since 6
3751 */
3752 void (*preferred_buffer_scale)(void *data,
3753 struct wl_surface *wl_surface,
3754 int32_t factor);
3755 /**
3756 * preferred buffer transform for the surface
3758 * This event indicates the preferred buffer transform for this
3759 * surface. It is sent whenever the compositor's preference
3760 * changes.
3762 * Before receiving this event the preferred buffer transform for
3763 * this surface is normal.
3765 * Applying this transformation to the surface buffer contents and
3766 * using wl_surface.set_buffer_transform might allow the compositor
3767 * to use the surface buffer more efficiently.
3768 * @param transform preferred transform
3769 * @since 6
3770 */
3771 void (*preferred_buffer_transform)(void *data,
3772 struct wl_surface *wl_surface,
3773 uint32_t transform);
3776/**
3777 * @ingroup iface_wl_surface
3778 */
3779static inline int
3780wl_surface_add_listener(struct wl_surface *wl_surface,
3781 const struct wl_surface_listener *listener, void *data)
3783 return wl_proxy_add_listener((struct wl_proxy *) wl_surface,
3784 (void (**)(void)) listener, data);
3787#define WL_SURFACE_DESTROY 0
3788#define WL_SURFACE_ATTACH 1
3789#define WL_SURFACE_DAMAGE 2
3790#define WL_SURFACE_FRAME 3
3791#define WL_SURFACE_SET_OPAQUE_REGION 4
3792#define WL_SURFACE_SET_INPUT_REGION 5
3793#define WL_SURFACE_COMMIT 6
3794#define WL_SURFACE_SET_BUFFER_TRANSFORM 7
3795#define WL_SURFACE_SET_BUFFER_SCALE 8
3796#define WL_SURFACE_DAMAGE_BUFFER 9
3797#define WL_SURFACE_OFFSET 10
3799/**
3800 * @ingroup iface_wl_surface
3801 */
3802#define WL_SURFACE_ENTER_SINCE_VERSION 1
3803/**
3804 * @ingroup iface_wl_surface
3805 */
3806#define WL_SURFACE_LEAVE_SINCE_VERSION 1
3807/**
3808 * @ingroup iface_wl_surface
3809 */
3810#define WL_SURFACE_PREFERRED_BUFFER_SCALE_SINCE_VERSION 6
3811/**
3812 * @ingroup iface_wl_surface
3813 */
3814#define WL_SURFACE_PREFERRED_BUFFER_TRANSFORM_SINCE_VERSION 6
3816/**
3817 * @ingroup iface_wl_surface
3818 */
3819#define WL_SURFACE_DESTROY_SINCE_VERSION 1
3820/**
3821 * @ingroup iface_wl_surface
3822 */
3823#define WL_SURFACE_ATTACH_SINCE_VERSION 1
3824/**
3825 * @ingroup iface_wl_surface
3826 */
3827#define WL_SURFACE_DAMAGE_SINCE_VERSION 1
3828/**
3829 * @ingroup iface_wl_surface
3830 */
3831#define WL_SURFACE_FRAME_SINCE_VERSION 1
3832/**
3833 * @ingroup iface_wl_surface
3834 */
3835#define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1
3836/**
3837 * @ingroup iface_wl_surface
3838 */
3839#define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1
3840/**
3841 * @ingroup iface_wl_surface
3842 */
3843#define WL_SURFACE_COMMIT_SINCE_VERSION 1
3844/**
3845 * @ingroup iface_wl_surface
3846 */
3847#define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2
3848/**
3849 * @ingroup iface_wl_surface
3850 */
3851#define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3
3852/**
3853 * @ingroup iface_wl_surface
3854 */
3855#define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4
3856/**
3857 * @ingroup iface_wl_surface
3858 */
3859#define WL_SURFACE_OFFSET_SINCE_VERSION 5
3861/** @ingroup iface_wl_surface */
3862static inline void
3863wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data)
3865 wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data);
3868/** @ingroup iface_wl_surface */
3869static inline void *
3870wl_surface_get_user_data(struct wl_surface *wl_surface)
3872 return wl_proxy_get_user_data((struct wl_proxy *) wl_surface);
3875static inline uint32_t
3876wl_surface_get_version(struct wl_surface *wl_surface)
3878 return wl_proxy_get_version((struct wl_proxy *) wl_surface);
3881/**
3882 * @ingroup iface_wl_surface
3884 * Deletes the surface and invalidates its object ID.
3885 */
3886static inline void
3887wl_surface_destroy(struct wl_surface *wl_surface)
3889 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
3890 WL_SURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), WL_MARSHAL_FLAG_DESTROY);
3893/**
3894 * @ingroup iface_wl_surface
3896 * Set a buffer as the content of this surface.
3898 * The new size of the surface is calculated based on the buffer
3899 * size transformed by the inverse buffer_transform and the
3900 * inverse buffer_scale. This means that at commit time the supplied
3901 * buffer size must be an integer multiple of the buffer_scale. If
3902 * that's not the case, an invalid_size error is sent.
3904 * The x and y arguments specify the location of the new pending
3905 * buffer's upper left corner, relative to the current buffer's upper
3906 * left corner, in surface-local coordinates. In other words, the
3907 * x and y, combined with the new surface size define in which
3908 * directions the surface's size changes. Setting anything other than 0
3909 * as x and y arguments is discouraged, and should instead be replaced
3910 * with using the separate wl_surface.offset request.
3912 * When the bound wl_surface version is 5 or higher, passing any
3913 * non-zero x or y is a protocol violation, and will result in an
3914 * 'invalid_offset' error being raised. The x and y arguments are ignored
3915 * and do not change the pending state. To achieve equivalent semantics,
3916 * use wl_surface.offset.
3918 * Surface contents are double-buffered state, see wl_surface.commit.
3920 * The initial surface contents are void; there is no content.
3921 * wl_surface.attach assigns the given wl_buffer as the pending
3922 * wl_buffer. wl_surface.commit makes the pending wl_buffer the new
3923 * surface contents, and the size of the surface becomes the size
3924 * calculated from the wl_buffer, as described above. After commit,
3925 * there is no pending buffer until the next attach.
3927 * Committing a pending wl_buffer allows the compositor to read the
3928 * pixels in the wl_buffer. The compositor may access the pixels at
3929 * any time after the wl_surface.commit request. When the compositor
3930 * will not access the pixels anymore, it will send the
3931 * wl_buffer.release event. Only after receiving wl_buffer.release,
3932 * the client may reuse the wl_buffer. A wl_buffer that has been
3933 * attached and then replaced by another attach instead of committed
3934 * will not receive a release event, and is not used by the
3935 * compositor.
3937 * If a pending wl_buffer has been committed to more than one wl_surface,
3938 * the delivery of wl_buffer.release events becomes undefined. A well
3939 * behaved client should not rely on wl_buffer.release events in this
3940 * case. Alternatively, a client could create multiple wl_buffer objects
3941 * from the same backing storage or use a protocol extension providing
3942 * per-commit release notifications.
3944 * Destroying the wl_buffer after wl_buffer.release does not change
3945 * the surface contents. Destroying the wl_buffer before wl_buffer.release
3946 * is allowed as long as the underlying buffer storage isn't re-used (this
3947 * can happen e.g. on client process termination). However, if the client
3948 * destroys the wl_buffer before receiving the wl_buffer.release event and
3949 * mutates the underlying buffer storage, the surface contents become
3950 * undefined immediately.
3952 * If wl_surface.attach is sent with a NULL wl_buffer, the
3953 * following wl_surface.commit will remove the surface content.
3955 * If a pending wl_buffer has been destroyed, the result is not specified.
3956 * Many compositors are known to remove the surface content on the following
3957 * wl_surface.commit, but this behaviour is not universal. Clients seeking to
3958 * maximise compatibility should not destroy pending buffers and should
3959 * ensure that they explicitly remove content from surfaces, even after
3960 * destroying buffers.
3961 */
3962static inline void
3963wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y)
3965 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
3966 WL_SURFACE_ATTACH, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, buffer, x, y);
3969/**
3970 * @ingroup iface_wl_surface
3972 * This request is used to describe the regions where the pending
3973 * buffer is different from the current surface contents, and where
3974 * the surface therefore needs to be repainted. The compositor
3975 * ignores the parts of the damage that fall outside of the surface.
3977 * Damage is double-buffered state, see wl_surface.commit.
3979 * The damage rectangle is specified in surface-local coordinates,
3980 * where x and y specify the upper left corner of the damage rectangle.
3982 * The initial value for pending damage is empty: no damage.
3983 * wl_surface.damage adds pending damage: the new pending damage
3984 * is the union of old pending damage and the given rectangle.
3986 * wl_surface.commit assigns pending damage as the current damage,
3987 * and clears pending damage. The server will clear the current
3988 * damage as it repaints the surface.
3990 * Note! New clients should not use this request. Instead damage can be
3991 * posted with wl_surface.damage_buffer which uses buffer coordinates
3992 * instead of surface coordinates.
3993 */
3994static inline void
3995wl_surface_damage(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)
3997 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
3998 WL_SURFACE_DAMAGE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y, width, height);
4001/**
4002 * @ingroup iface_wl_surface
4004 * Request a notification when it is a good time to start drawing a new
4005 * frame, by creating a frame callback. This is useful for throttling
4006 * redrawing operations, and driving animations.
4008 * When a client is animating on a wl_surface, it can use the 'frame'
4009 * request to get notified when it is a good time to draw and commit the
4010 * next frame of animation. If the client commits an update earlier than
4011 * that, it is likely that some updates will not make it to the display,
4012 * and the client is wasting resources by drawing too often.
4014 * The frame request will take effect on the next wl_surface.commit.
4015 * The notification will only be posted for one frame unless
4016 * requested again. For a wl_surface, the notifications are posted in
4017 * the order the frame requests were committed.
4019 * The server must send the notifications so that a client
4020 * will not send excessive updates, while still allowing
4021 * the highest possible update rate for clients that wait for the reply
4022 * before drawing again. The server should give some time for the client
4023 * to draw and commit after sending the frame callback events to let it
4024 * hit the next output refresh.
4026 * A server should avoid signaling the frame callbacks if the
4027 * surface is not visible in any way, e.g. the surface is off-screen,
4028 * or completely obscured by other opaque surfaces.
4030 * The object returned by this request will be destroyed by the
4031 * compositor after the callback is fired and as such the client must not
4032 * attempt to use it after that point.
4034 * The callback_data passed in the callback is the current time, in
4035 * milliseconds, with an undefined base.
4036 */
4037static inline struct wl_callback *
4038wl_surface_frame(struct wl_surface *wl_surface)
4040 struct wl_proxy *callback;
4042 callback = wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
4043 WL_SURFACE_FRAME, &wl_callback_interface, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, NULL);
4045 return (struct wl_callback *) callback;
4048/**
4049 * @ingroup iface_wl_surface
4051 * This request sets the region of the surface that contains
4052 * opaque content.
4054 * The opaque region is an optimization hint for the compositor
4055 * that lets it optimize the redrawing of content behind opaque
4056 * regions. Setting an opaque region is not required for correct
4057 * behaviour, but marking transparent content as opaque will result
4058 * in repaint artifacts.
4060 * The opaque region is specified in surface-local coordinates.
4062 * The compositor ignores the parts of the opaque region that fall
4063 * outside of the surface.
4065 * Opaque region is double-buffered state, see wl_surface.commit.
4067 * wl_surface.set_opaque_region changes the pending opaque region.
4068 * wl_surface.commit copies the pending region to the current region.
4069 * Otherwise, the pending and current regions are never changed.
4071 * The initial value for an opaque region is empty. Setting the pending
4072 * opaque region has copy semantics, and the wl_region object can be
4073 * destroyed immediately. A NULL wl_region causes the pending opaque
4074 * region to be set to empty.
4075 */
4076static inline void
4077wl_surface_set_opaque_region(struct wl_surface *wl_surface, struct wl_region *region)
4079 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
4080 WL_SURFACE_SET_OPAQUE_REGION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, region);
4083/**
4084 * @ingroup iface_wl_surface
4086 * This request sets the region of the surface that can receive
4087 * pointer and touch events.
4089 * Input events happening outside of this region will try the next
4090 * surface in the server surface stack. The compositor ignores the
4091 * parts of the input region that fall outside of the surface.
4093 * The input region is specified in surface-local coordinates.
4095 * Input region is double-buffered state, see wl_surface.commit.
4097 * wl_surface.set_input_region changes the pending input region.
4098 * wl_surface.commit copies the pending region to the current region.
4099 * Otherwise the pending and current regions are never changed,
4100 * except cursor and icon surfaces are special cases, see
4101 * wl_pointer.set_cursor and wl_data_device.start_drag.
4103 * The initial value for an input region is infinite. That means the
4104 * whole surface will accept input. Setting the pending input region
4105 * has copy semantics, and the wl_region object can be destroyed
4106 * immediately. A NULL wl_region causes the input region to be set
4107 * to infinite.
4108 */
4109static inline void
4110wl_surface_set_input_region(struct wl_surface *wl_surface, struct wl_region *region)
4112 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
4113 WL_SURFACE_SET_INPUT_REGION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, region);
4116/**
4117 * @ingroup iface_wl_surface
4119 * Surface state (input, opaque, and damage regions, attached buffers,
4120 * etc.) is double-buffered. Protocol requests modify the pending state,
4121 * as opposed to the active state in use by the compositor.
4123 * A commit request atomically creates a content update from the pending
4124 * state, even if the pending state has not been touched. The content
4125 * update is placed in a queue until it becomes active. After commit, the
4126 * new pending state is as documented for each related request.
4128 * When the content update is applied, the wl_buffer is applied before all
4129 * other state. This means that all coordinates in double-buffered state
4130 * are relative to the newly attached wl_buffers, except for
4131 * wl_surface.attach itself. If there is no newly attached wl_buffer, the
4132 * coordinates are relative to the previous content update.
4134 * All requests that need a commit to become effective are documented
4135 * to affect double-buffered state.
4137 * Other interfaces may add further double-buffered surface state.
4138 */
4139static inline void
4140wl_surface_commit(struct wl_surface *wl_surface)
4142 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
4143 WL_SURFACE_COMMIT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0);
4146/**
4147 * @ingroup iface_wl_surface
4149 * This request sets the transformation that the client has already applied
4150 * to the content of the buffer. The accepted values for the transform
4151 * parameter are the values for wl_output.transform.
4153 * The compositor applies the inverse of this transformation whenever it
4154 * uses the buffer contents.
4156 * Buffer transform is double-buffered state, see wl_surface.commit.
4158 * A newly created surface has its buffer transformation set to normal.
4160 * wl_surface.set_buffer_transform changes the pending buffer
4161 * transformation. wl_surface.commit copies the pending buffer
4162 * transformation to the current one. Otherwise, the pending and current
4163 * values are never changed.
4165 * The purpose of this request is to allow clients to render content
4166 * according to the output transform, thus permitting the compositor to
4167 * use certain optimizations even if the display is rotated. Using
4168 * hardware overlays and scanning out a client buffer for fullscreen
4169 * surfaces are examples of such optimizations. Those optimizations are
4170 * highly dependent on the compositor implementation, so the use of this
4171 * request should be considered on a case-by-case basis.
4173 * Note that if the transform value includes 90 or 270 degree rotation,
4174 * the width of the buffer will become the surface height and the height
4175 * of the buffer will become the surface width.
4177 * If transform is not one of the values from the
4178 * wl_output.transform enum the invalid_transform protocol error
4179 * is raised.
4180 */
4181static inline void
4182wl_surface_set_buffer_transform(struct wl_surface *wl_surface, int32_t transform)
4184 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
4185 WL_SURFACE_SET_BUFFER_TRANSFORM, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, transform);
4188/**
4189 * @ingroup iface_wl_surface
4191 * This request sets an optional scaling factor on how the compositor
4192 * interprets the contents of the buffer attached to the window.
4194 * Buffer scale is double-buffered state, see wl_surface.commit.
4196 * A newly created surface has its buffer scale set to 1.
4198 * wl_surface.set_buffer_scale changes the pending buffer scale.
4199 * wl_surface.commit copies the pending buffer scale to the current one.
4200 * Otherwise, the pending and current values are never changed.
4202 * The purpose of this request is to allow clients to supply higher
4203 * resolution buffer data for use on high resolution outputs. It is
4204 * intended that you pick the same buffer scale as the scale of the
4205 * output that the surface is displayed on. This means the compositor
4206 * can avoid scaling when rendering the surface on that output.
4208 * Note that if the scale is larger than 1, then you have to attach
4209 * a buffer that is larger (by a factor of scale in each dimension)
4210 * than the desired surface size.
4212 * If scale is not greater than 0 the invalid_scale protocol error is
4213 * raised.
4214 */
4215static inline void
4216wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale)
4218 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
4219 WL_SURFACE_SET_BUFFER_SCALE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, scale);
4222/**
4223 * @ingroup iface_wl_surface
4225 * This request is used to describe the regions where the pending
4226 * buffer is different from the current surface contents, and where
4227 * the surface therefore needs to be repainted. The compositor
4228 * ignores the parts of the damage that fall outside of the surface.
4230 * Damage is double-buffered state, see wl_surface.commit.
4232 * The damage rectangle is specified in buffer coordinates,
4233 * where x and y specify the upper left corner of the damage rectangle.
4235 * The initial value for pending damage is empty: no damage.
4236 * wl_surface.damage_buffer adds pending damage: the new pending
4237 * damage is the union of old pending damage and the given rectangle.
4239 * wl_surface.commit assigns pending damage as the current damage,
4240 * and clears pending damage. The server will clear the current
4241 * damage as it repaints the surface.
4243 * This request differs from wl_surface.damage in only one way - it
4244 * takes damage in buffer coordinates instead of surface-local
4245 * coordinates. While this generally is more intuitive than surface
4246 * coordinates, it is especially desirable when using wp_viewport
4247 * or when a drawing library (like EGL) is unaware of buffer scale
4248 * and buffer transform.
4250 * Note: Because buffer transformation changes and damage requests may
4251 * be interleaved in the protocol stream, it is impossible to determine
4252 * the actual mapping between surface and buffer damage until
4253 * wl_surface.commit time. Therefore, compositors wishing to take both
4254 * kinds of damage into account will have to accumulate damage from the
4255 * two requests separately and only transform from one to the other
4256 * after receiving the wl_surface.commit.
4257 */
4258static inline void
4259wl_surface_damage_buffer(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)
4261 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
4262 WL_SURFACE_DAMAGE_BUFFER, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y, width, height);
4265/**
4266 * @ingroup iface_wl_surface
4268 * The x and y arguments specify the location of the new pending
4269 * buffer's upper left corner, relative to the current buffer's upper
4270 * left corner, in surface-local coordinates. In other words, the
4271 * x and y, combined with the new surface size define in which
4272 * directions the surface's size changes.
4274 * The exact semantics of wl_surface.offset are role-specific. Refer to
4275 * the documentation of specific roles for more information.
4277 * Surface location offset is double-buffered state, see
4278 * wl_surface.commit.
4280 * This request is semantically equivalent to and the replaces the x and y
4281 * arguments in the wl_surface.attach request in wl_surface versions prior
4282 * to 5. See wl_surface.attach for details.
4283 */
4284static inline void
4285wl_surface_offset(struct wl_surface *wl_surface, int32_t x, int32_t y)
4287 wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,
4288 WL_SURFACE_OFFSET, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y);
4291#ifndef WL_SEAT_CAPABILITY_ENUM
4292#define WL_SEAT_CAPABILITY_ENUM
4293/**
4294 * @ingroup iface_wl_seat
4295 * seat capability bitmask
4297 * This is a bitmask of capabilities this seat has; if a member is
4298 * set, then it is present on the seat.
4299 */
4300enum wl_seat_capability {
4301 /**
4302 * the seat has pointer devices
4303 */
4304 WL_SEAT_CAPABILITY_POINTER = 1,
4305 /**
4306 * the seat has one or more keyboards
4307 */
4308 WL_SEAT_CAPABILITY_KEYBOARD = 2,
4309 /**
4310 * the seat has touch devices
4311 */
4312 WL_SEAT_CAPABILITY_TOUCH = 4,
4314#endif /* WL_SEAT_CAPABILITY_ENUM */
4316#ifndef WL_SEAT_ERROR_ENUM
4317#define WL_SEAT_ERROR_ENUM
4318/**
4319 * @ingroup iface_wl_seat
4320 * wl_seat error values
4322 * These errors can be emitted in response to wl_seat requests.
4323 */
4324enum wl_seat_error {
4325 /**
4326 * get_pointer, get_keyboard or get_touch called on seat without the matching capability
4327 */
4328 WL_SEAT_ERROR_MISSING_CAPABILITY = 0,
4330#endif /* WL_SEAT_ERROR_ENUM */
4332/**
4333 * @ingroup iface_wl_seat
4334 * @struct wl_seat_listener
4335 */
4336struct wl_seat_listener {
4337 /**
4338 * seat capabilities changed
4340 * This is sent on binding to the seat global or whenever a seat
4341 * gains or loses the pointer, keyboard or touch capabilities. The
4342 * argument is a capability enum containing the complete set of
4343 * capabilities this seat has.
4345 * When the pointer capability is added, a client may create a
4346 * wl_pointer object using the wl_seat.get_pointer request. This
4347 * object will receive pointer events until the capability is
4348 * removed in the future.
4350 * When the pointer capability is removed, a client should destroy
4351 * the wl_pointer objects associated with the seat where the
4352 * capability was removed, using the wl_pointer.release request. No
4353 * further pointer events will be received on these objects.
4355 * In some compositors, if a seat regains the pointer capability
4356 * and a client has a previously obtained wl_pointer object of
4357 * version 4 or less, that object may start sending pointer events
4358 * again. This behavior is considered a misinterpretation of the
4359 * intended behavior and must not be relied upon by the client.
4360 * wl_pointer objects of version 5 or later must not send events if
4361 * created before the most recent event notifying the client of an
4362 * added pointer capability.
4364 * The above behavior also applies to wl_keyboard and wl_touch with
4365 * the keyboard and touch capabilities, respectively.
4366 * @param capabilities capabilities of the seat
4367 */
4368 void (*capabilities)(void *data,
4369 struct wl_seat *wl_seat,
4370 uint32_t capabilities);
4371 /**
4372 * unique identifier for this seat
4374 * In a multi-seat configuration the seat name can be used by
4375 * clients to help identify which physical devices the seat
4376 * represents.
4378 * The seat name is a UTF-8 string with no convention defined for
4379 * its contents. Each name is unique among all wl_seat globals. The
4380 * name is only guaranteed to be unique for the current compositor
4381 * instance.
4383 * The same seat names are used for all clients. Thus, the name can
4384 * be shared across processes to refer to a specific wl_seat
4385 * global.
4387 * The name event is sent after binding to the seat global, and
4388 * should be sent before announcing capabilities. This event only
4389 * sent once per seat object, and the name does not change over the
4390 * lifetime of the wl_seat global.
4392 * Compositors may re-use the same seat name if the wl_seat global
4393 * is destroyed and re-created later.
4394 * @param name seat identifier
4395 * @since 2
4396 */
4397 void (*name)(void *data,
4398 struct wl_seat *wl_seat,
4399 const char *name);
4402/**
4403 * @ingroup iface_wl_seat
4404 */
4405static inline int
4406wl_seat_add_listener(struct wl_seat *wl_seat,
4407 const struct wl_seat_listener *listener, void *data)
4409 return wl_proxy_add_listener((struct wl_proxy *) wl_seat,
4410 (void (**)(void)) listener, data);
4413#define WL_SEAT_GET_POINTER 0
4414#define WL_SEAT_GET_KEYBOARD 1
4415#define WL_SEAT_GET_TOUCH 2
4416#define WL_SEAT_RELEASE 3
4418/**
4419 * @ingroup iface_wl_seat
4420 */
4421#define WL_SEAT_CAPABILITIES_SINCE_VERSION 1
4422/**
4423 * @ingroup iface_wl_seat
4424 */
4425#define WL_SEAT_NAME_SINCE_VERSION 2
4427/**
4428 * @ingroup iface_wl_seat
4429 */
4430#define WL_SEAT_GET_POINTER_SINCE_VERSION 1
4431/**
4432 * @ingroup iface_wl_seat
4433 */
4434#define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1
4435/**
4436 * @ingroup iface_wl_seat
4437 */
4438#define WL_SEAT_GET_TOUCH_SINCE_VERSION 1
4439/**
4440 * @ingroup iface_wl_seat
4441 */
4442#define WL_SEAT_RELEASE_SINCE_VERSION 5
4444/** @ingroup iface_wl_seat */
4445static inline void
4446wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data)
4448 wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data);
4451/** @ingroup iface_wl_seat */
4452static inline void *
4453wl_seat_get_user_data(struct wl_seat *wl_seat)
4455 return wl_proxy_get_user_data((struct wl_proxy *) wl_seat);
4458static inline uint32_t
4459wl_seat_get_version(struct wl_seat *wl_seat)
4461 return wl_proxy_get_version((struct wl_proxy *) wl_seat);
4464/** @ingroup iface_wl_seat */
4465static inline void
4466wl_seat_destroy(struct wl_seat *wl_seat)
4468 wl_proxy_destroy((struct wl_proxy *) wl_seat);
4471/**
4472 * @ingroup iface_wl_seat
4474 * The ID provided will be initialized to the wl_pointer interface
4475 * for this seat.
4477 * This request only takes effect if the seat has the pointer
4478 * capability, or has had the pointer capability in the past.
4479 * It is a protocol violation to issue this request on a seat that has
4480 * never had the pointer capability. The missing_capability error will
4481 * be sent in this case.
4482 */
4483static inline struct wl_pointer *
4484wl_seat_get_pointer(struct wl_seat *wl_seat)
4486 struct wl_proxy *id;
4488 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,
4489 WL_SEAT_GET_POINTER, &wl_pointer_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);
4491 return (struct wl_pointer *) id;
4494/**
4495 * @ingroup iface_wl_seat
4497 * The ID provided will be initialized to the wl_keyboard interface
4498 * for this seat.
4500 * This request only takes effect if the seat has the keyboard
4501 * capability, or has had the keyboard capability in the past.
4502 * It is a protocol violation to issue this request on a seat that has
4503 * never had the keyboard capability. The missing_capability error will
4504 * be sent in this case.
4505 */
4506static inline struct wl_keyboard *
4507wl_seat_get_keyboard(struct wl_seat *wl_seat)
4509 struct wl_proxy *id;
4511 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,
4512 WL_SEAT_GET_KEYBOARD, &wl_keyboard_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);
4514 return (struct wl_keyboard *) id;
4517/**
4518 * @ingroup iface_wl_seat
4520 * The ID provided will be initialized to the wl_touch interface
4521 * for this seat.
4523 * This request only takes effect if the seat has the touch
4524 * capability, or has had the touch capability in the past.
4525 * It is a protocol violation to issue this request on a seat that has
4526 * never had the touch capability. The missing_capability error will
4527 * be sent in this case.
4528 */
4529static inline struct wl_touch *
4530wl_seat_get_touch(struct wl_seat *wl_seat)
4532 struct wl_proxy *id;
4534 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,
4535 WL_SEAT_GET_TOUCH, &wl_touch_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);
4537 return (struct wl_touch *) id;
4540/**
4541 * @ingroup iface_wl_seat
4543 * Using this request a client can tell the server that it is not going to
4544 * use the seat object anymore.
4545 */
4546static inline void
4547wl_seat_release(struct wl_seat *wl_seat)
4549 wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,
4550 WL_SEAT_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_seat), WL_MARSHAL_FLAG_DESTROY);
4553#ifndef WL_POINTER_ERROR_ENUM
4554#define WL_POINTER_ERROR_ENUM
4555enum wl_pointer_error {
4556 /**
4557 * given wl_surface has another role
4558 */
4559 WL_POINTER_ERROR_ROLE = 0,
4561#endif /* WL_POINTER_ERROR_ENUM */
4563#ifndef WL_POINTER_BUTTON_STATE_ENUM
4564#define WL_POINTER_BUTTON_STATE_ENUM
4565/**
4566 * @ingroup iface_wl_pointer
4567 * physical button state
4569 * Describes the physical state of a button that produced the button
4570 * event.
4571 */
4572enum wl_pointer_button_state {
4573 /**
4574 * the button is not pressed
4575 */
4576 WL_POINTER_BUTTON_STATE_RELEASED = 0,
4577 /**
4578 * the button is pressed
4579 */
4580 WL_POINTER_BUTTON_STATE_PRESSED = 1,
4582#endif /* WL_POINTER_BUTTON_STATE_ENUM */
4584#ifndef WL_POINTER_AXIS_ENUM
4585#define WL_POINTER_AXIS_ENUM
4586/**
4587 * @ingroup iface_wl_pointer
4588 * axis types
4590 * Describes the axis types of scroll events.
4591 */
4592enum wl_pointer_axis {
4593 /**
4594 * vertical axis
4595 */
4596 WL_POINTER_AXIS_VERTICAL_SCROLL = 0,
4597 /**
4598 * horizontal axis
4599 */
4600 WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,
4602#endif /* WL_POINTER_AXIS_ENUM */
4604#ifndef WL_POINTER_AXIS_SOURCE_ENUM
4605#define WL_POINTER_AXIS_SOURCE_ENUM
4606/**
4607 * @ingroup iface_wl_pointer
4608 * axis source types
4610 * Describes the source types for axis events. This indicates to the
4611 * client how an axis event was physically generated; a client may
4612 * adjust the user interface accordingly. For example, scroll events
4613 * from a "finger" source may be in a smooth coordinate space with
4614 * kinetic scrolling whereas a "wheel" source may be in discrete steps
4615 * of a number of lines.
4617 * The "continuous" axis source is a device generating events in a
4618 * continuous coordinate space, but using something other than a
4619 * finger. One example for this source is button-based scrolling where
4620 * the vertical motion of a device is converted to scroll events while
4621 * a button is held down.
4623 * The "wheel tilt" axis source indicates that the actual device is a
4624 * wheel but the scroll event is not caused by a rotation but a
4625 * (usually sideways) tilt of the wheel.
4626 */
4627enum wl_pointer_axis_source {
4628 /**
4629 * a physical wheel rotation
4630 */
4631 WL_POINTER_AXIS_SOURCE_WHEEL = 0,
4632 /**
4633 * finger on a touch surface
4634 */
4635 WL_POINTER_AXIS_SOURCE_FINGER = 1,
4636 /**
4637 * continuous coordinate space
4638 */
4639 WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
4640 /**
4641 * a physical wheel tilt
4642 * @since 6
4643 */
4644 WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
4646/**
4647 * @ingroup iface_wl_pointer
4648 */
4649#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
4650#endif /* WL_POINTER_AXIS_SOURCE_ENUM */
4652#ifndef WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM
4653#define WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM
4654/**
4655 * @ingroup iface_wl_pointer
4656 * axis relative direction
4658 * This specifies the direction of the physical motion that caused a
4659 * wl_pointer.axis event, relative to the wl_pointer.axis direction.
4660 */
4661enum wl_pointer_axis_relative_direction {
4662 /**
4663 * physical motion matches axis direction
4664 */
4665 WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL = 0,
4666 /**
4667 * physical motion is the inverse of the axis direction
4668 */
4669 WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1,
4671#endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */
4673/**
4674 * @ingroup iface_wl_pointer
4675 * @struct wl_pointer_listener
4676 */
4677struct wl_pointer_listener {
4678 /**
4679 * enter event
4681 * Notification that this seat's pointer is focused on a certain
4682 * surface.
4684 * When a seat's focus enters a surface, the pointer image is
4685 * undefined and a client should respond to this event by setting
4686 * an appropriate pointer image with the set_cursor request.
4687 * @param serial serial number of the enter event
4688 * @param surface surface entered by the pointer
4689 * @param surface_x surface-local x coordinate
4690 * @param surface_y surface-local y coordinate
4691 */
4692 void (*enter)(void *data,
4693 struct wl_pointer *wl_pointer,
4694 uint32_t serial,
4695 struct wl_surface *surface,
4696 wl_fixed_t surface_x,
4697 wl_fixed_t surface_y);
4698 /**
4699 * leave event
4701 * Notification that this seat's pointer is no longer focused on
4702 * a certain surface.
4704 * The leave notification is sent before the enter notification for
4705 * the new focus.
4706 * @param serial serial number of the leave event
4707 * @param surface surface left by the pointer
4708 */
4709 void (*leave)(void *data,
4710 struct wl_pointer *wl_pointer,
4711 uint32_t serial,
4712 struct wl_surface *surface);
4713 /**
4714 * pointer motion event
4716 * Notification of pointer location change. The arguments
4717 * surface_x and surface_y are the location relative to the focused
4718 * surface.
4719 * @param time timestamp with millisecond granularity
4720 * @param surface_x surface-local x coordinate
4721 * @param surface_y surface-local y coordinate
4722 */
4723 void (*motion)(void *data,
4724 struct wl_pointer *wl_pointer,
4725 uint32_t time,
4726 wl_fixed_t surface_x,
4727 wl_fixed_t surface_y);
4728 /**
4729 * pointer button event
4731 * Mouse button click and release notifications.
4733 * The location of the click is given by the last motion or enter
4734 * event. The time argument is a timestamp with millisecond
4735 * granularity, with an undefined base.
4737 * The button is a button code as defined in the Linux kernel's
4738 * linux/input-event-codes.h header file, e.g. BTN_LEFT.
4740 * Any 16-bit button code value is reserved for future additions to
4741 * the kernel's event code list. All other button codes above
4742 * 0xFFFF are currently undefined but may be used in future
4743 * versions of this protocol.
4744 * @param serial serial number of the button event
4745 * @param time timestamp with millisecond granularity
4746 * @param button button that produced the event
4747 * @param state physical state of the button
4748 */
4749 void (*button)(void *data,
4750 struct wl_pointer *wl_pointer,
4751 uint32_t serial,
4752 uint32_t time,
4753 uint32_t button,
4754 uint32_t state);
4755 /**
4756 * axis event
4758 * Scroll and other axis notifications.
4760 * For scroll events (vertical and horizontal scroll axes), the
4761 * value parameter is the length of a vector along the specified
4762 * axis in a coordinate space identical to those of motion events,
4763 * representing a relative movement along the specified axis.
4765 * For devices that support movements non-parallel to axes multiple
4766 * axis events will be emitted.
4768 * When applicable, for example for touch pads, the server can
4769 * choose to emit scroll events where the motion vector is
4770 * equivalent to a motion event vector.
4772 * When applicable, a client can transform its content relative to
4773 * the scroll distance.
4774 * @param time timestamp with millisecond granularity
4775 * @param axis axis type
4776 * @param value length of vector in surface-local coordinate space
4777 */
4778 void (*axis)(void *data,
4779 struct wl_pointer *wl_pointer,
4780 uint32_t time,
4781 uint32_t axis,
4782 wl_fixed_t value);
4783 /**
4784 * end of a pointer event sequence
4786 * Indicates the end of a set of events that logically belong
4787 * together. A client is expected to accumulate the data in all
4788 * events within the frame before proceeding.
4790 * All wl_pointer events before a wl_pointer.frame event belong
4791 * logically together. For example, in a diagonal scroll motion the
4792 * compositor will send an optional wl_pointer.axis_source event,
4793 * two wl_pointer.axis events (horizontal and vertical) and finally
4794 * a wl_pointer.frame event. The client may use this information to
4795 * calculate a diagonal vector for scrolling.
4797 * When multiple wl_pointer.axis events occur within the same
4798 * frame, the motion vector is the combined motion of all events.
4799 * When a wl_pointer.axis and a wl_pointer.axis_stop event occur
4800 * within the same frame, this indicates that axis movement in one
4801 * axis has stopped but continues in the other axis. When multiple
4802 * wl_pointer.axis_stop events occur within the same frame, this
4803 * indicates that these axes stopped in the same instance.
4805 * A wl_pointer.frame event is sent for every logical event group,
4806 * even if the group only contains a single wl_pointer event.
4807 * Specifically, a client may get a sequence: motion, frame,
4808 * button, frame, axis, frame, axis_stop, frame.
4810 * The wl_pointer.enter and wl_pointer.leave events are logical
4811 * events generated by the compositor and not the hardware. These
4812 * events are also grouped by a wl_pointer.frame. When a pointer
4813 * moves from one surface to another, a compositor should group the
4814 * wl_pointer.leave event within the same wl_pointer.frame.
4815 * However, a client must not rely on wl_pointer.leave and
4816 * wl_pointer.enter being in the same wl_pointer.frame.
4817 * Compositor-specific policies may require the wl_pointer.leave
4818 * and wl_pointer.enter event being split across multiple
4819 * wl_pointer.frame groups.
4820 * @since 5
4821 */
4822 void (*frame)(void *data,
4823 struct wl_pointer *wl_pointer);
4824 /**
4825 * axis source event
4827 * Source information for scroll and other axes.
4829 * This event does not occur on its own. It is sent before a
4830 * wl_pointer.frame event and carries the source information for
4831 * all events within that frame.
4833 * The source specifies how this event was generated. If the source
4834 * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event
4835 * will be sent when the user lifts the finger off the device.
4837 * If the source is wl_pointer.axis_source.wheel,
4838 * wl_pointer.axis_source.wheel_tilt or
4839 * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event
4840 * may or may not be sent. Whether a compositor sends an axis_stop
4841 * event for these sources is hardware-specific and
4842 * implementation-dependent; clients must not rely on receiving an
4843 * axis_stop event for these scroll sources and should treat scroll
4844 * sequences from these scroll sources as unterminated by default.
4846 * This event is optional. If the source is unknown for a
4847 * particular axis event sequence, no event is sent. Only one
4848 * wl_pointer.axis_source event is permitted per frame.
4850 * The order of wl_pointer.axis_discrete and wl_pointer.axis_source
4851 * is not guaranteed.
4852 * @param axis_source source of the axis event
4853 * @since 5
4854 */
4855 void (*axis_source)(void *data,
4856 struct wl_pointer *wl_pointer,
4857 uint32_t axis_source);
4858 /**
4859 * axis stop event
4861 * Stop notification for scroll and other axes.
4863 * For some wl_pointer.axis_source types, a wl_pointer.axis_stop
4864 * event is sent to notify a client that the axis sequence has
4865 * terminated. This enables the client to implement kinetic
4866 * scrolling. See the wl_pointer.axis_source documentation for
4867 * information on when this event may be generated.
4869 * Any wl_pointer.axis events with the same axis_source after this
4870 * event should be considered as the start of a new axis motion.
4872 * The timestamp is to be interpreted identical to the timestamp in
4873 * the wl_pointer.axis event. The timestamp value may be the same
4874 * as a preceding wl_pointer.axis event.
4875 * @param time timestamp with millisecond granularity
4876 * @param axis the axis stopped with this event
4877 * @since 5
4878 */
4879 void (*axis_stop)(void *data,
4880 struct wl_pointer *wl_pointer,
4881 uint32_t time,
4882 uint32_t axis);
4883 /**
4884 * axis click event
4886 * Discrete step information for scroll and other axes.
4888 * This event carries the axis value of the wl_pointer.axis event
4889 * in discrete steps (e.g. mouse wheel clicks).
4891 * This event is deprecated with wl_pointer version 8 - this event
4892 * is not sent to clients supporting version 8 or later.
4894 * This event does not occur on its own, it is coupled with a
4895 * wl_pointer.axis event that represents this axis value on a
4896 * continuous scale. The protocol guarantees that each
4897 * axis_discrete event is always followed by exactly one axis event
4898 * with the same axis number within the same wl_pointer.frame. Note
4899 * that the protocol allows for other events to occur between the
4900 * axis_discrete and its coupled axis event, including other
4901 * axis_discrete or axis events. A wl_pointer.frame must not
4902 * contain more than one axis_discrete event per axis type.
4904 * This event is optional; continuous scrolling devices like
4905 * two-finger scrolling on touchpads do not have discrete steps and
4906 * do not generate this event.
4908 * The discrete value carries the directional information. e.g. a
4909 * value of -2 is two steps towards the negative direction of this
4910 * axis.
4912 * The axis number is identical to the axis number in the
4913 * associated axis event.
4915 * The order of wl_pointer.axis_discrete and wl_pointer.axis_source
4916 * is not guaranteed.
4917 * @param axis axis type
4918 * @param discrete number of steps
4919 * @since 5
4920 * @deprecated Deprecated since version 8
4921 */
4922 void (*axis_discrete)(void *data,
4923 struct wl_pointer *wl_pointer,
4924 uint32_t axis,
4925 int32_t discrete);
4926 /**
4927 * axis high-resolution scroll event
4929 * Discrete high-resolution scroll information.
4931 * This event carries high-resolution wheel scroll information,
4932 * with each multiple of 120 representing one logical scroll step
4933 * (a wheel detent). For example, an axis_value120 of 30 is one
4934 * quarter of a logical scroll step in the positive direction, a
4935 * value120 of -240 are two logical scroll steps in the negative
4936 * direction within the same hardware event. Clients that rely on
4937 * discrete scrolling should accumulate the value120 to multiples
4938 * of 120 before processing the event.
4940 * The value120 must not be zero.
4942 * This event replaces the wl_pointer.axis_discrete event in
4943 * clients supporting wl_pointer version 8 or later.
4945 * Where a wl_pointer.axis_source event occurs in the same
4946 * wl_pointer.frame, the axis source applies to this event.
4948 * The order of wl_pointer.axis_value120 and wl_pointer.axis_source
4949 * is not guaranteed.
4950 * @param axis axis type
4951 * @param value120 scroll distance as fraction of 120
4952 * @since 8
4953 */
4954 void (*axis_value120)(void *data,
4955 struct wl_pointer *wl_pointer,
4956 uint32_t axis,
4957 int32_t value120);
4958 /**
4959 * axis relative physical direction event
4961 * Relative directional information of the entity causing the
4962 * axis motion.
4964 * For a wl_pointer.axis event, the
4965 * wl_pointer.axis_relative_direction event specifies the movement
4966 * direction of the entity causing the wl_pointer.axis event. For
4967 * example: - if a user's fingers on a touchpad move down and this
4968 * causes a wl_pointer.axis vertical_scroll down event, the
4969 * physical direction is 'identical' - if a user's fingers on a
4970 * touchpad move down and this causes a wl_pointer.axis
4971 * vertical_scroll up scroll up event ('natural scrolling'), the
4972 * physical direction is 'inverted'.
4974 * A client may use this information to adjust scroll motion of
4975 * components. Specifically, enabling natural scrolling causes the
4976 * content to change direction compared to traditional scrolling.
4977 * Some widgets like volume control sliders should usually match
4978 * the physical direction regardless of whether natural scrolling
4979 * is active. This event enables clients to match the scroll
4980 * direction of a widget to the physical direction.
4982 * This event does not occur on its own, it is coupled with a
4983 * wl_pointer.axis event that represents this axis value. The
4984 * protocol guarantees that each axis_relative_direction event is
4985 * always followed by exactly one axis event with the same axis
4986 * number within the same wl_pointer.frame. Note that the protocol
4987 * allows for other events to occur between the
4988 * axis_relative_direction and its coupled axis event.
4990 * The axis number is identical to the axis number in the
4991 * associated axis event.
4993 * The order of wl_pointer.axis_relative_direction,
4994 * wl_pointer.axis_discrete and wl_pointer.axis_source is not
4995 * guaranteed.
4996 * @param axis axis type
4997 * @param direction physical direction relative to axis motion
4998 * @since 9
4999 */
5000 void (*axis_relative_direction)(void *data,
5001 struct wl_pointer *wl_pointer,
5002 uint32_t axis,
5003 uint32_t direction);
5006/**
5007 * @ingroup iface_wl_pointer
5008 */
5009static inline int
5010wl_pointer_add_listener(struct wl_pointer *wl_pointer,
5011 const struct wl_pointer_listener *listener, void *data)
5013 return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,
5014 (void (**)(void)) listener, data);
5017#define WL_POINTER_SET_CURSOR 0
5018#define WL_POINTER_RELEASE 1
5020/**
5021 * @ingroup iface_wl_pointer
5022 */
5023#define WL_POINTER_ENTER_SINCE_VERSION 1
5024/**
5025 * @ingroup iface_wl_pointer
5026 */
5027#define WL_POINTER_LEAVE_SINCE_VERSION 1
5028/**
5029 * @ingroup iface_wl_pointer
5030 */
5031#define WL_POINTER_MOTION_SINCE_VERSION 1
5032/**
5033 * @ingroup iface_wl_pointer
5034 */
5035#define WL_POINTER_BUTTON_SINCE_VERSION 1
5036/**
5037 * @ingroup iface_wl_pointer
5038 */
5039#define WL_POINTER_AXIS_SINCE_VERSION 1
5040/**
5041 * @ingroup iface_wl_pointer
5042 */
5043#define WL_POINTER_FRAME_SINCE_VERSION 5
5044/**
5045 * @ingroup iface_wl_pointer
5046 */
5047#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5
5048/**
5049 * @ingroup iface_wl_pointer
5050 */
5051#define WL_POINTER_AXIS_STOP_SINCE_VERSION 5
5052/**
5053 * @ingroup iface_wl_pointer
5054 */
5055#define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5
5056/**
5057 * @ingroup iface_wl_pointer
5058 */
5059#define WL_POINTER_AXIS_VALUE120_SINCE_VERSION 8
5060/**
5061 * @ingroup iface_wl_pointer
5062 */
5063#define WL_POINTER_AXIS_RELATIVE_DIRECTION_SINCE_VERSION 9
5065/**
5066 * @ingroup iface_wl_pointer
5067 */
5068#define WL_POINTER_SET_CURSOR_SINCE_VERSION 1
5069/**
5070 * @ingroup iface_wl_pointer
5071 */
5072#define WL_POINTER_RELEASE_SINCE_VERSION 3
5074/** @ingroup iface_wl_pointer */
5075static inline void
5076wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data)
5078 wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data);
5081/** @ingroup iface_wl_pointer */
5082static inline void *
5083wl_pointer_get_user_data(struct wl_pointer *wl_pointer)
5085 return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);
5088static inline uint32_t
5089wl_pointer_get_version(struct wl_pointer *wl_pointer)
5091 return wl_proxy_get_version((struct wl_proxy *) wl_pointer);
5094/** @ingroup iface_wl_pointer */
5095static inline void
5096wl_pointer_destroy(struct wl_pointer *wl_pointer)
5098 wl_proxy_destroy((struct wl_proxy *) wl_pointer);
5101/**
5102 * @ingroup iface_wl_pointer
5104 * Set the pointer surface, i.e., the surface that contains the
5105 * pointer image (cursor). This request gives the surface the role
5106 * of a cursor. If the surface already has another role, it raises
5107 * a protocol error.
5109 * The cursor actually changes only if the pointer
5110 * focus for this device is one of the requesting client's surfaces
5111 * or the surface parameter is the current pointer surface. If
5112 * there was a previous surface set with this request it is
5113 * replaced. If surface is NULL, the pointer image is hidden.
5115 * The parameters hotspot_x and hotspot_y define the position of
5116 * the pointer surface relative to the pointer location. Its
5117 * top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
5118 * where (x, y) are the coordinates of the pointer location, in
5119 * surface-local coordinates.
5121 * On wl_surface.offset requests to the pointer surface, hotspot_x
5122 * and hotspot_y are decremented by the x and y parameters
5123 * passed to the request. The offset must be applied by
5124 * wl_surface.commit as usual.
5126 * The hotspot can also be updated by passing the currently set
5127 * pointer surface to this request with new values for hotspot_x
5128 * and hotspot_y.
5130 * The input region is ignored for wl_surfaces with the role of
5131 * a cursor. When the use as a cursor ends, the wl_surface is
5132 * unmapped.
5134 * The serial parameter must match the latest wl_pointer.enter
5135 * serial number sent to the client. Otherwise the request will be
5136 * ignored.
5137 */
5138static inline void
5139wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y)
5141 wl_proxy_marshal_flags((struct wl_proxy *) wl_pointer,
5142 WL_POINTER_SET_CURSOR, NULL, wl_proxy_get_version((struct wl_proxy *) wl_pointer), 0, serial, surface, hotspot_x, hotspot_y);
5145/**
5146 * @ingroup iface_wl_pointer
5148 * Using this request a client can tell the server that it is not going to
5149 * use the pointer object anymore.
5151 * This request destroys the pointer proxy object, so clients must not call
5152 * wl_pointer_destroy() after using this request.
5153 */
5154static inline void
5155wl_pointer_release(struct wl_pointer *wl_pointer)
5157 wl_proxy_marshal_flags((struct wl_proxy *) wl_pointer,
5158 WL_POINTER_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_pointer), WL_MARSHAL_FLAG_DESTROY);
5161#ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM
5162#define WL_KEYBOARD_KEYMAP_FORMAT_ENUM
5163/**
5164 * @ingroup iface_wl_keyboard
5165 * keyboard mapping format
5167 * This specifies the format of the keymap provided to the
5168 * client with the wl_keyboard.keymap event.
5169 */
5170enum wl_keyboard_keymap_format {
5171 /**
5172 * no keymap; client must understand how to interpret the raw keycode
5173 */
5174 WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0,
5175 /**
5176 * libxkbcommon compatible, null-terminated string; to determine the xkb keycode, clients must add 8 to the key event keycode
5177 */
5178 WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1,
5180#endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */
5182#ifndef WL_KEYBOARD_KEY_STATE_ENUM
5183#define WL_KEYBOARD_KEY_STATE_ENUM
5184/**
5185 * @ingroup iface_wl_keyboard
5186 * physical key state
5188 * Describes the physical state of a key that produced the key event.
5190 * Since version 10, the key can be in a "repeated" pseudo-state which
5191 * means the same as "pressed", but is used to signal repetition in the
5192 * key event.
5194 * The key may only enter the repeated state after entering the pressed
5195 * state and before entering the released state. This event may be
5196 * generated multiple times while the key is down.
5197 */
5198enum wl_keyboard_key_state {
5199 /**
5200 * key is not pressed
5201 */
5202 WL_KEYBOARD_KEY_STATE_RELEASED = 0,
5203 /**
5204 * key is pressed
5205 */
5206 WL_KEYBOARD_KEY_STATE_PRESSED = 1,
5207 /**
5208 * key was repeated
5209 * @since 10
5210 */
5211 WL_KEYBOARD_KEY_STATE_REPEATED = 2,
5213/**
5214 * @ingroup iface_wl_keyboard
5215 */
5216#define WL_KEYBOARD_KEY_STATE_REPEATED_SINCE_VERSION 10
5217#endif /* WL_KEYBOARD_KEY_STATE_ENUM */
5219/**
5220 * @ingroup iface_wl_keyboard
5221 * @struct wl_keyboard_listener
5222 */
5223struct wl_keyboard_listener {
5224 /**
5225 * keyboard mapping
5227 * This event provides a file descriptor to the client which can
5228 * be memory-mapped in read-only mode to provide a keyboard mapping
5229 * description.
5231 * From version 7 onwards, the fd must be mapped with MAP_PRIVATE
5232 * by the recipient, as MAP_SHARED may fail.
5233 * @param format keymap format
5234 * @param fd keymap file descriptor
5235 * @param size keymap size, in bytes
5236 */
5237 void (*keymap)(void *data,
5238 struct wl_keyboard *wl_keyboard,
5239 uint32_t format,
5240 int32_t fd,
5241 uint32_t size);
5242 /**
5243 * enter event
5245 * Notification that this seat's keyboard focus is on a certain
5246 * surface.
5248 * The compositor must send the wl_keyboard.modifiers event after
5249 * this event.
5251 * In the wl_keyboard logical state, this event sets the active
5252 * surface to the surface argument and the keys currently logically
5253 * down to the keys in the keys argument. The compositor must not
5254 * send this event if the wl_keyboard already had an active surface
5255 * immediately before this event.
5257 * Clients should not use the list of pressed keys to emulate
5258 * key-press events. The order of keys in the list is unspecified.
5259 * @param serial serial number of the enter event
5260 * @param surface surface gaining keyboard focus
5261 * @param keys the keys currently logically down
5262 */
5263 void (*enter)(void *data,
5264 struct wl_keyboard *wl_keyboard,
5265 uint32_t serial,
5266 struct wl_surface *surface,
5267 struct wl_array *keys);
5268 /**
5269 * leave event
5271 * Notification that this seat's keyboard focus is no longer on a
5272 * certain surface.
5274 * The leave notification is sent before the enter notification for
5275 * the new focus.
5277 * In the wl_keyboard logical state, this event resets all values
5278 * to their defaults. The compositor must not send this event if
5279 * the active surface of the wl_keyboard was not equal to the
5280 * surface argument immediately before this event.
5281 * @param serial serial number of the leave event
5282 * @param surface surface that lost keyboard focus
5283 */
5284 void (*leave)(void *data,
5285 struct wl_keyboard *wl_keyboard,
5286 uint32_t serial,
5287 struct wl_surface *surface);
5288 /**
5289 * key event
5291 * A key was pressed or released. The time argument is a
5292 * timestamp with millisecond granularity, with an undefined base.
5294 * The key is a platform-specific key code that can be interpreted
5295 * by feeding it to the keyboard mapping (see the keymap event).
5297 * If this event produces a change in modifiers, then the resulting
5298 * wl_keyboard.modifiers event must be sent after this event.
5300 * In the wl_keyboard logical state, this event adds the key to the
5301 * keys currently logically down (if the state argument is pressed)
5302 * or removes the key from the keys currently logically down (if
5303 * the state argument is released). The compositor must not send
5304 * this event if the wl_keyboard did not have an active surface
5305 * immediately before this event. The compositor must not send this
5306 * event if state is pressed (resp. released) and the key was
5307 * already logically down (resp. was not logically down)
5308 * immediately before this event.
5310 * Since version 10, compositors may send key events with the
5311 * "repeated" key state when a wl_keyboard.repeat_info event with a
5312 * rate argument of 0 has been received. This allows the compositor
5313 * to take over the responsibility of key repetition.
5314 * @param serial serial number of the key event
5315 * @param time timestamp with millisecond granularity
5316 * @param key key that produced the event
5317 * @param state physical state of the key
5318 */
5319 void (*key)(void *data,
5320 struct wl_keyboard *wl_keyboard,
5321 uint32_t serial,
5322 uint32_t time,
5323 uint32_t key,
5324 uint32_t state);
5325 /**
5326 * modifier and group state
5328 * Notifies clients that the modifier and/or group state has
5329 * changed, and it should update its local state.
5331 * The compositor may send this event without a surface of the
5332 * client having keyboard focus, for example to tie modifier
5333 * information to pointer focus instead. If a modifier event with
5334 * pressed modifiers is sent without a prior enter event, the
5335 * client can assume the modifier state is valid until it receives
5336 * the next wl_keyboard.modifiers event. In order to reset the
5337 * modifier state again, the compositor can send a
5338 * wl_keyboard.modifiers event with no pressed modifiers.
5340 * In the wl_keyboard logical state, this event updates the
5341 * modifiers and group.
5342 * @param serial serial number of the modifiers event
5343 * @param mods_depressed depressed modifiers
5344 * @param mods_latched latched modifiers
5345 * @param mods_locked locked modifiers
5346 * @param group keyboard layout
5347 */
5348 void (*modifiers)(void *data,
5349 struct wl_keyboard *wl_keyboard,
5350 uint32_t serial,
5351 uint32_t mods_depressed,
5352 uint32_t mods_latched,
5353 uint32_t mods_locked,
5354 uint32_t group);
5355 /**
5356 * repeat rate and delay
5358 * Informs the client about the keyboard's repeat rate and delay.
5360 * This event is sent as soon as the wl_keyboard object has been
5361 * created, and is guaranteed to be received by the client before
5362 * any key press event.
5364 * Negative values for either rate or delay are illegal. A rate of
5365 * zero will disable any repeating (regardless of the value of
5366 * delay).
5368 * This event can be sent later on as well with a new value if
5369 * necessary, so clients should continue listening for the event
5370 * past the creation of wl_keyboard.
5371 * @param rate the rate of repeating keys in characters per second
5372 * @param delay delay in milliseconds since key down until repeating starts
5373 * @since 4
5374 */
5375 void (*repeat_info)(void *data,
5376 struct wl_keyboard *wl_keyboard,
5377 int32_t rate,
5378 int32_t delay);
5381/**
5382 * @ingroup iface_wl_keyboard
5383 */
5384static inline int
5385wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard,
5386 const struct wl_keyboard_listener *listener, void *data)
5388 return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard,
5389 (void (**)(void)) listener, data);
5392#define WL_KEYBOARD_RELEASE 0
5394/**
5395 * @ingroup iface_wl_keyboard
5396 */
5397#define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1
5398/**
5399 * @ingroup iface_wl_keyboard
5400 */
5401#define WL_KEYBOARD_ENTER_SINCE_VERSION 1
5402/**
5403 * @ingroup iface_wl_keyboard
5404 */
5405#define WL_KEYBOARD_LEAVE_SINCE_VERSION 1
5406/**
5407 * @ingroup iface_wl_keyboard
5408 */
5409#define WL_KEYBOARD_KEY_SINCE_VERSION 1
5410/**
5411 * @ingroup iface_wl_keyboard
5412 */
5413#define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1
5414/**
5415 * @ingroup iface_wl_keyboard
5416 */
5417#define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4
5419/**
5420 * @ingroup iface_wl_keyboard
5421 */
5422#define WL_KEYBOARD_RELEASE_SINCE_VERSION 3
5424/** @ingroup iface_wl_keyboard */
5425static inline void
5426wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data)
5428 wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data);
5431/** @ingroup iface_wl_keyboard */
5432static inline void *
5433wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard)
5435 return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard);
5438static inline uint32_t
5439wl_keyboard_get_version(struct wl_keyboard *wl_keyboard)
5441 return wl_proxy_get_version((struct wl_proxy *) wl_keyboard);
5444/** @ingroup iface_wl_keyboard */
5445static inline void
5446wl_keyboard_destroy(struct wl_keyboard *wl_keyboard)
5448 wl_proxy_destroy((struct wl_proxy *) wl_keyboard);
5451/**
5452 * @ingroup iface_wl_keyboard
5453 */
5454static inline void
5455wl_keyboard_release(struct wl_keyboard *wl_keyboard)
5457 wl_proxy_marshal_flags((struct wl_proxy *) wl_keyboard,
5458 WL_KEYBOARD_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_keyboard), WL_MARSHAL_FLAG_DESTROY);
5461/**
5462 * @ingroup iface_wl_touch
5463 * @struct wl_touch_listener
5464 */
5465struct wl_touch_listener {
5466 /**
5467 * touch down event and beginning of a touch sequence
5469 * A new touch point has appeared on the surface. This touch
5470 * point is assigned a unique ID. Future events from this touch
5471 * point reference this ID. The ID ceases to be valid after a touch
5472 * up event and may be reused in the future.
5473 * @param serial serial number of the touch down event
5474 * @param time timestamp with millisecond granularity
5475 * @param surface surface touched
5476 * @param id the unique ID of this touch point
5477 * @param x surface-local x coordinate
5478 * @param y surface-local y coordinate
5479 */
5480 void (*down)(void *data,
5481 struct wl_touch *wl_touch,
5482 uint32_t serial,
5483 uint32_t time,
5484 struct wl_surface *surface,
5485 int32_t id,
5486 wl_fixed_t x,
5487 wl_fixed_t y);
5488 /**
5489 * end of a touch event sequence
5491 * The touch point has disappeared. No further events will be
5492 * sent for this touch point and the touch point's ID is released
5493 * and may be reused in a future touch down event.
5494 * @param serial serial number of the touch up event
5495 * @param time timestamp with millisecond granularity
5496 * @param id the unique ID of this touch point
5497 */
5498 void (*up)(void *data,
5499 struct wl_touch *wl_touch,
5500 uint32_t serial,
5501 uint32_t time,
5502 int32_t id);
5503 /**
5504 * update of touch point coordinates
5506 * A touch point has changed coordinates.
5507 * @param time timestamp with millisecond granularity
5508 * @param id the unique ID of this touch point
5509 * @param x surface-local x coordinate
5510 * @param y surface-local y coordinate
5511 */
5512 void (*motion)(void *data,
5513 struct wl_touch *wl_touch,
5514 uint32_t time,
5515 int32_t id,
5516 wl_fixed_t x,
5517 wl_fixed_t y);
5518 /**
5519 * end of touch frame event
5521 * Indicates the end of a set of events that logically belong
5522 * together. A client is expected to accumulate the data in all
5523 * events within the frame before proceeding.
5525 * A wl_touch.frame terminates at least one event but otherwise no
5526 * guarantee is provided about the set of events within a frame. A
5527 * client must assume that any state not updated in a frame is
5528 * unchanged from the previously known state.
5529 */
5530 void (*frame)(void *data,
5531 struct wl_touch *wl_touch);
5532 /**
5533 * touch session cancelled
5535 * Sent if the compositor decides the touch stream is a global
5536 * gesture. No further events are sent to the clients from that
5537 * particular gesture. Touch cancellation applies to all touch
5538 * points currently active on this client's surface. The client is
5539 * responsible for finalizing the touch points, future touch points
5540 * on this surface may reuse the touch point ID.
5542 * No frame event is required after the cancel event.
5543 */
5544 void (*cancel)(void *data,
5545 struct wl_touch *wl_touch);
5546 /**
5547 * update shape of touch point
5549 * Sent when a touchpoint has changed its shape.
5551 * This event does not occur on its own. It is sent before a
5552 * wl_touch.frame event and carries the new shape information for
5553 * any previously reported, or new touch points of that frame.
5555 * Other events describing the touch point such as wl_touch.down,
5556 * wl_touch.motion or wl_touch.orientation may be sent within the
5557 * same wl_touch.frame. A client should treat these events as a
5558 * single logical touch point update. The order of wl_touch.shape,
5559 * wl_touch.orientation and wl_touch.motion is not guaranteed. A
5560 * wl_touch.down event is guaranteed to occur before the first
5561 * wl_touch.shape event for this touch ID but both events may occur
5562 * within the same wl_touch.frame.
5564 * A touchpoint shape is approximated by an ellipse through the
5565 * major and minor axis length. The major axis length describes the
5566 * longer diameter of the ellipse, while the minor axis length
5567 * describes the shorter diameter. Major and minor are orthogonal
5568 * and both are specified in surface-local coordinates. The center
5569 * of the ellipse is always at the touchpoint location as reported
5570 * by wl_touch.down or wl_touch.move.
5572 * This event is only sent by the compositor if the touch device
5573 * supports shape reports. The client has to make reasonable
5574 * assumptions about the shape if it did not receive this event.
5575 * @param id the unique ID of this touch point
5576 * @param major length of the major axis in surface-local coordinates
5577 * @param minor length of the minor axis in surface-local coordinates
5578 * @since 6
5579 */
5580 void (*shape)(void *data,
5581 struct wl_touch *wl_touch,
5582 int32_t id,
5583 wl_fixed_t major,
5584 wl_fixed_t minor);
5585 /**
5586 * update orientation of touch point
5588 * Sent when a touchpoint has changed its orientation.
5590 * This event does not occur on its own. It is sent before a
5591 * wl_touch.frame event and carries the new shape information for
5592 * any previously reported, or new touch points of that frame.
5594 * Other events describing the touch point such as wl_touch.down,
5595 * wl_touch.motion or wl_touch.shape may be sent within the same
5596 * wl_touch.frame. A client should treat these events as a single
5597 * logical touch point update. The order of wl_touch.shape,
5598 * wl_touch.orientation and wl_touch.motion is not guaranteed. A
5599 * wl_touch.down event is guaranteed to occur before the first
5600 * wl_touch.orientation event for this touch ID but both events may
5601 * occur within the same wl_touch.frame.
5603 * The orientation describes the clockwise angle of a touchpoint's
5604 * major axis to the positive surface y-axis and is normalized to
5605 * the -180 to +180 degree range. The granularity of orientation
5606 * depends on the touch device, some devices only support binary
5607 * rotation values between 0 and 90 degrees.
5609 * This event is only sent by the compositor if the touch device
5610 * supports orientation reports.
5611 * @param id the unique ID of this touch point
5612 * @param orientation angle between major axis and positive surface y-axis in degrees
5613 * @since 6
5614 */
5615 void (*orientation)(void *data,
5616 struct wl_touch *wl_touch,
5617 int32_t id,
5618 wl_fixed_t orientation);
5621/**
5622 * @ingroup iface_wl_touch
5623 */
5624static inline int
5625wl_touch_add_listener(struct wl_touch *wl_touch,
5626 const struct wl_touch_listener *listener, void *data)
5628 return wl_proxy_add_listener((struct wl_proxy *) wl_touch,
5629 (void (**)(void)) listener, data);
5632#define WL_TOUCH_RELEASE 0
5634/**
5635 * @ingroup iface_wl_touch
5636 */
5637#define WL_TOUCH_DOWN_SINCE_VERSION 1
5638/**
5639 * @ingroup iface_wl_touch
5640 */
5641#define WL_TOUCH_UP_SINCE_VERSION 1
5642/**
5643 * @ingroup iface_wl_touch
5644 */
5645#define WL_TOUCH_MOTION_SINCE_VERSION 1
5646/**
5647 * @ingroup iface_wl_touch
5648 */
5649#define WL_TOUCH_FRAME_SINCE_VERSION 1
5650/**
5651 * @ingroup iface_wl_touch
5652 */
5653#define WL_TOUCH_CANCEL_SINCE_VERSION 1
5654/**
5655 * @ingroup iface_wl_touch
5656 */
5657#define WL_TOUCH_SHAPE_SINCE_VERSION 6
5658/**
5659 * @ingroup iface_wl_touch
5660 */
5661#define WL_TOUCH_ORIENTATION_SINCE_VERSION 6
5663/**
5664 * @ingroup iface_wl_touch
5665 */
5666#define WL_TOUCH_RELEASE_SINCE_VERSION 3
5668/** @ingroup iface_wl_touch */
5669static inline void
5670wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data)
5672 wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data);
5675/** @ingroup iface_wl_touch */
5676static inline void *
5677wl_touch_get_user_data(struct wl_touch *wl_touch)
5679 return wl_proxy_get_user_data((struct wl_proxy *) wl_touch);
5682static inline uint32_t
5683wl_touch_get_version(struct wl_touch *wl_touch)
5685 return wl_proxy_get_version((struct wl_proxy *) wl_touch);
5688/** @ingroup iface_wl_touch */
5689static inline void
5690wl_touch_destroy(struct wl_touch *wl_touch)
5692 wl_proxy_destroy((struct wl_proxy *) wl_touch);
5695/**
5696 * @ingroup iface_wl_touch
5697 */
5698static inline void
5699wl_touch_release(struct wl_touch *wl_touch)
5701 wl_proxy_marshal_flags((struct wl_proxy *) wl_touch,
5702 WL_TOUCH_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_touch), WL_MARSHAL_FLAG_DESTROY);
5705#ifndef WL_OUTPUT_SUBPIXEL_ENUM
5706#define WL_OUTPUT_SUBPIXEL_ENUM
5707/**
5708 * @ingroup iface_wl_output
5709 * subpixel geometry information
5711 * This enumeration describes how the physical
5712 * pixels on an output are laid out.
5713 */
5714enum wl_output_subpixel {
5715 /**
5716 * unknown geometry
5717 */
5718 WL_OUTPUT_SUBPIXEL_UNKNOWN = 0,
5719 /**
5720 * no geometry
5721 */
5722 WL_OUTPUT_SUBPIXEL_NONE = 1,
5723 /**
5724 * horizontal RGB
5725 */
5726 WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2,
5727 /**
5728 * horizontal BGR
5729 */
5730 WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3,
5731 /**
5732 * vertical RGB
5733 */
5734 WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4,
5735 /**
5736 * vertical BGR
5737 */
5738 WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5,
5740#endif /* WL_OUTPUT_SUBPIXEL_ENUM */
5742#ifndef WL_OUTPUT_TRANSFORM_ENUM
5743#define WL_OUTPUT_TRANSFORM_ENUM
5744/**
5745 * @ingroup iface_wl_output
5746 * transformation applied to buffer contents
5748 * This describes transformations that clients and compositors apply to
5749 * buffer contents.
5751 * The flipped values correspond to an initial flip around a
5752 * vertical axis followed by rotation.
5754 * The purpose is mainly to allow clients to render accordingly and
5755 * tell the compositor, so that for fullscreen surfaces, the
5756 * compositor will still be able to scan out directly from client
5757 * surfaces.
5758 */
5759enum wl_output_transform {
5760 /**
5761 * no transform
5762 */
5763 WL_OUTPUT_TRANSFORM_NORMAL = 0,
5764 /**
5765 * 90 degrees counter-clockwise
5766 */
5767 WL_OUTPUT_TRANSFORM_90 = 1,
5768 /**
5769 * 180 degrees counter-clockwise
5770 */
5771 WL_OUTPUT_TRANSFORM_180 = 2,
5772 /**
5773 * 270 degrees counter-clockwise
5774 */
5775 WL_OUTPUT_TRANSFORM_270 = 3,
5776 /**
5777 * 180 degree flip around a vertical axis
5778 */
5779 WL_OUTPUT_TRANSFORM_FLIPPED = 4,
5780 /**
5781 * flip and rotate 90 degrees counter-clockwise
5782 */
5783 WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,
5784 /**
5785 * flip and rotate 180 degrees counter-clockwise
5786 */
5787 WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,
5788 /**
5789 * flip and rotate 270 degrees counter-clockwise
5790 */
5791 WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,
5793#endif /* WL_OUTPUT_TRANSFORM_ENUM */
5795#ifndef WL_OUTPUT_MODE_ENUM
5796#define WL_OUTPUT_MODE_ENUM
5797/**
5798 * @ingroup iface_wl_output
5799 * mode information
5801 * These flags describe properties of an output mode.
5802 * They are used in the flags bitfield of the mode event.
5803 */
5804enum wl_output_mode {
5805 /**
5806 * indicates this is the current mode
5807 */
5808 WL_OUTPUT_MODE_CURRENT = 0x1,
5809 /**
5810 * indicates this is the preferred mode
5811 */
5812 WL_OUTPUT_MODE_PREFERRED = 0x2,
5814#endif /* WL_OUTPUT_MODE_ENUM */
5816/**
5817 * @ingroup iface_wl_output
5818 * @struct wl_output_listener
5819 */
5820struct wl_output_listener {
5821 /**
5822 * properties of the output
5824 * The geometry event describes geometric properties of the
5825 * output. The event is sent when binding to the output object and
5826 * whenever any of the properties change.
5828 * The physical size can be set to zero if it doesn't make sense
5829 * for this output (e.g. for projectors or virtual outputs).
5831 * The geometry event will be followed by a done event (starting
5832 * from version 2).
5834 * Clients should use wl_surface.preferred_buffer_transform instead
5835 * of the transform advertised by this event to find the preferred
5836 * buffer transform to use for a surface.
5838 * Note: wl_output only advertises partial information about the
5839 * output position and identification. Some compositors, for
5840 * instance those not implementing a desktop-style output layout or
5841 * those exposing virtual outputs, might fake this information.
5842 * Instead of using x and y, clients should use
5843 * xdg_output.logical_position. Instead of using make and model,
5844 * clients should use name and description.
5845 * @param x x position within the global compositor space
5846 * @param y y position within the global compositor space
5847 * @param physical_width width in millimeters of the output
5848 * @param physical_height height in millimeters of the output
5849 * @param subpixel subpixel orientation of the output
5850 * @param make textual description of the manufacturer
5851 * @param model textual description of the model
5852 * @param transform additional transformation applied to buffer contents during presentation
5853 */
5854 void (*geometry)(void *data,
5855 struct wl_output *wl_output,
5856 int32_t x,
5857 int32_t y,
5858 int32_t physical_width,
5859 int32_t physical_height,
5860 int32_t subpixel,
5861 const char *make,
5862 const char *model,
5863 int32_t transform);
5864 /**
5865 * advertise available modes for the output
5867 * The mode event describes an available mode for the output.
5869 * The event is sent when binding to the output object and there
5870 * will always be one mode, the current mode. The event is sent
5871 * again if an output changes mode, for the mode that is now
5872 * current. In other words, the current mode is always the last
5873 * mode that was received with the current flag set.
5875 * Non-current modes are deprecated. A compositor can decide to
5876 * only advertise the current mode and never send other modes.
5877 * Clients should not rely on non-current modes.
5879 * The size of a mode is given in physical hardware units of the
5880 * output device. This is not necessarily the same as the output
5881 * size in the global compositor space. For instance, the output
5882 * may be scaled, as described in wl_output.scale, or transformed,
5883 * as described in wl_output.transform. Clients willing to retrieve
5884 * the output size in the global compositor space should use
5885 * xdg_output.logical_size instead.
5887 * The vertical refresh rate can be set to zero if it doesn't make
5888 * sense for this output (e.g. for virtual outputs).
5890 * The mode event will be followed by a done event (starting from
5891 * version 2).
5893 * Clients should not use the refresh rate to schedule frames.
5894 * Instead, they should use the wl_surface.frame event or the
5895 * presentation-time protocol.
5897 * Note: this information is not always meaningful for all outputs.
5898 * Some compositors, such as those exposing virtual outputs, might
5899 * fake the refresh rate or the size.
5900 * @param flags bitfield of mode flags
5901 * @param width width of the mode in hardware units
5902 * @param height height of the mode in hardware units
5903 * @param refresh vertical refresh rate in mHz
5904 */
5905 void (*mode)(void *data,
5906 struct wl_output *wl_output,
5907 uint32_t flags,
5908 int32_t width,
5909 int32_t height,
5910 int32_t refresh);
5911 /**
5912 * sent all information about output
5914 * This event is sent after all other properties have been sent
5915 * after binding to the output object and after any other property
5916 * changes done after that. This allows changes to the output
5917 * properties to be seen as atomic, even if they happen via
5918 * multiple events.
5919 * @since 2
5920 */
5921 void (*done)(void *data,
5922 struct wl_output *wl_output);
5923 /**
5924 * output scaling properties
5926 * This event contains scaling geometry information that is not
5927 * in the geometry event. It may be sent after binding the output
5928 * object or if the output scale changes later. The compositor will
5929 * emit a non-zero, positive value for scale. If it is not sent,
5930 * the client should assume a scale of 1.
5932 * A scale larger than 1 means that the compositor will
5933 * automatically scale surface buffers by this amount when
5934 * rendering. This is used for very high resolution displays where
5935 * applications rendering at the native resolution would be too
5936 * small to be legible.
5938 * Clients should use wl_surface.preferred_buffer_scale instead of
5939 * this event to find the preferred buffer scale to use for a
5940 * surface.
5942 * The scale event will be followed by a done event.
5943 * @param factor scaling factor of output
5944 * @since 2
5945 */
5946 void (*scale)(void *data,
5947 struct wl_output *wl_output,
5948 int32_t factor);
5949 /**
5950 * name of this output
5952 * Many compositors will assign user-friendly names to their
5953 * outputs, show them to the user, allow the user to refer to an
5954 * output, etc. The client may wish to know this name as well to
5955 * offer the user similar behaviors.
5957 * The name is a UTF-8 string with no convention defined for its
5958 * contents. Each name is unique among all wl_output globals. The
5959 * name is only guaranteed to be unique for the compositor
5960 * instance.
5962 * The same output name is used for all clients for a given
5963 * wl_output global. Thus, the name can be shared across processes
5964 * to refer to a specific wl_output global.
5966 * The name is not guaranteed to be persistent across sessions,
5967 * thus cannot be used to reliably identify an output in e.g.
5968 * configuration files.
5970 * Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc.
5971 * However, do not assume that the name is a reflection of an
5972 * underlying DRM connector, X11 connection, etc.
5974 * The name event is sent after binding the output object. This
5975 * event is only sent once per output object, and the name does not
5976 * change over the lifetime of the wl_output global.
5978 * Compositors may re-use the same output name if the wl_output
5979 * global is destroyed and re-created later. Compositors should
5980 * avoid re-using the same name if possible.
5982 * The name event will be followed by a done event.
5983 * @param name output name
5984 * @since 4
5985 */
5986 void (*name)(void *data,
5987 struct wl_output *wl_output,
5988 const char *name);
5989 /**
5990 * human-readable description of this output
5992 * Many compositors can produce human-readable descriptions of
5993 * their outputs. The client may wish to know this description as
5994 * well, e.g. for output selection purposes.
5996 * The description is a UTF-8 string with no convention defined for
5997 * its contents. The description is not guaranteed to be unique
5998 * among all wl_output globals. Examples might include 'Foocorp 11"
5999 * Display' or 'Virtual X11 output via :1'.
6001 * The description event is sent after binding the output object
6002 * and whenever the description changes. The description is
6003 * optional, and may not be sent at all.
6005 * The description event will be followed by a done event.
6006 * @param description output description
6007 * @since 4
6008 */
6009 void (*description)(void *data,
6010 struct wl_output *wl_output,
6011 const char *description);
6014/**
6015 * @ingroup iface_wl_output
6016 */
6017static inline int
6018wl_output_add_listener(struct wl_output *wl_output,
6019 const struct wl_output_listener *listener, void *data)
6021 return wl_proxy_add_listener((struct wl_proxy *) wl_output,
6022 (void (**)(void)) listener, data);
6025#define WL_OUTPUT_RELEASE 0
6027/**
6028 * @ingroup iface_wl_output
6029 */
6030#define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1
6031/**
6032 * @ingroup iface_wl_output
6033 */
6034#define WL_OUTPUT_MODE_SINCE_VERSION 1
6035/**
6036 * @ingroup iface_wl_output
6037 */
6038#define WL_OUTPUT_DONE_SINCE_VERSION 2
6039/**
6040 * @ingroup iface_wl_output
6041 */
6042#define WL_OUTPUT_SCALE_SINCE_VERSION 2
6043/**
6044 * @ingroup iface_wl_output
6045 */
6046#define WL_OUTPUT_NAME_SINCE_VERSION 4
6047/**
6048 * @ingroup iface_wl_output
6049 */
6050#define WL_OUTPUT_DESCRIPTION_SINCE_VERSION 4
6052/**
6053 * @ingroup iface_wl_output
6054 */
6055#define WL_OUTPUT_RELEASE_SINCE_VERSION 3
6057/** @ingroup iface_wl_output */
6058static inline void
6059wl_output_set_user_data(struct wl_output *wl_output, void *user_data)
6061 wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data);
6064/** @ingroup iface_wl_output */
6065static inline void *
6066wl_output_get_user_data(struct wl_output *wl_output)
6068 return wl_proxy_get_user_data((struct wl_proxy *) wl_output);
6071static inline uint32_t
6072wl_output_get_version(struct wl_output *wl_output)
6074 return wl_proxy_get_version((struct wl_proxy *) wl_output);
6077/** @ingroup iface_wl_output */
6078static inline void
6079wl_output_destroy(struct wl_output *wl_output)
6081 wl_proxy_destroy((struct wl_proxy *) wl_output);
6084/**
6085 * @ingroup iface_wl_output
6087 * Using this request a client can tell the server that it is not going to
6088 * use the output object anymore.
6089 */
6090static inline void
6091wl_output_release(struct wl_output *wl_output)
6093 wl_proxy_marshal_flags((struct wl_proxy *) wl_output,
6094 WL_OUTPUT_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_output), WL_MARSHAL_FLAG_DESTROY);
6097#define WL_REGION_DESTROY 0
6098#define WL_REGION_ADD 1
6099#define WL_REGION_SUBTRACT 2
6102/**
6103 * @ingroup iface_wl_region
6104 */
6105#define WL_REGION_DESTROY_SINCE_VERSION 1
6106/**
6107 * @ingroup iface_wl_region
6108 */
6109#define WL_REGION_ADD_SINCE_VERSION 1
6110/**
6111 * @ingroup iface_wl_region
6112 */
6113#define WL_REGION_SUBTRACT_SINCE_VERSION 1
6115/** @ingroup iface_wl_region */
6116static inline void
6117wl_region_set_user_data(struct wl_region *wl_region, void *user_data)
6119 wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data);
6122/** @ingroup iface_wl_region */
6123static inline void *
6124wl_region_get_user_data(struct wl_region *wl_region)
6126 return wl_proxy_get_user_data((struct wl_proxy *) wl_region);
6129static inline uint32_t
6130wl_region_get_version(struct wl_region *wl_region)
6132 return wl_proxy_get_version((struct wl_proxy *) wl_region);
6135/**
6136 * @ingroup iface_wl_region
6138 * Destroy the region. This will invalidate the object ID.
6139 */
6140static inline void
6141wl_region_destroy(struct wl_region *wl_region)
6143 wl_proxy_marshal_flags((struct wl_proxy *) wl_region,
6144 WL_REGION_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), WL_MARSHAL_FLAG_DESTROY);
6147/**
6148 * @ingroup iface_wl_region
6150 * Add the specified rectangle to the region.
6151 */
6152static inline void
6153wl_region_add(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)
6155 wl_proxy_marshal_flags((struct wl_proxy *) wl_region,
6156 WL_REGION_ADD, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), 0, x, y, width, height);
6159/**
6160 * @ingroup iface_wl_region
6162 * Subtract the specified rectangle from the region.
6163 */
6164static inline void
6165wl_region_subtract(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)
6167 wl_proxy_marshal_flags((struct wl_proxy *) wl_region,
6168 WL_REGION_SUBTRACT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), 0, x, y, width, height);
6171#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
6172#define WL_SUBCOMPOSITOR_ERROR_ENUM
6173enum wl_subcompositor_error {
6174 /**
6175 * the to-be sub-surface is invalid
6176 */
6177 WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
6178 /**
6179 * the to-be sub-surface parent is invalid
6180 */
6181 WL_SUBCOMPOSITOR_ERROR_BAD_PARENT = 1,
6183#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
6185#define WL_SUBCOMPOSITOR_DESTROY 0
6186#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1
6189/**
6190 * @ingroup iface_wl_subcompositor
6191 */
6192#define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1
6193/**
6194 * @ingroup iface_wl_subcompositor
6195 */
6196#define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1
6198/** @ingroup iface_wl_subcompositor */
6199static inline void
6200wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data)
6202 wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);
6205/** @ingroup iface_wl_subcompositor */
6206static inline void *
6207wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)
6209 return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);
6212static inline uint32_t
6213wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor)
6215 return wl_proxy_get_version((struct wl_proxy *) wl_subcompositor);
6218/**
6219 * @ingroup iface_wl_subcompositor
6221 * Informs the server that the client will not be using this
6222 * protocol object anymore. This does not affect any other
6223 * objects, wl_subsurface objects included.
6224 */
6225static inline void
6226wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)
6228 wl_proxy_marshal_flags((struct wl_proxy *) wl_subcompositor,
6229 WL_SUBCOMPOSITOR_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subcompositor), WL_MARSHAL_FLAG_DESTROY);
6232/**
6233 * @ingroup iface_wl_subcompositor
6235 * Create a sub-surface interface for the given surface, and
6236 * associate it with the given parent surface. This turns a
6237 * plain wl_surface into a sub-surface.
6239 * The to-be sub-surface must not already have another role, and it
6240 * must not have an existing wl_subsurface object. Otherwise the
6241 * bad_surface protocol error is raised.
6243 * Adding sub-surfaces to a parent is a double-buffered operation on the
6244 * parent (see wl_surface.commit). The effect of adding a sub-surface
6245 * becomes visible on the next time the state of the parent surface is
6246 * applied.
6248 * The parent surface must not be one of the child surface's descendants,
6249 * and the parent must be different from the child surface, otherwise the
6250 * bad_parent protocol error is raised.
6252 * This request modifies the behaviour of wl_surface.commit request on
6253 * the sub-surface, see the documentation on wl_subsurface interface.
6254 */
6255static inline struct wl_subsurface *
6256wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent)
6258 struct wl_proxy *id;
6260 id = wl_proxy_marshal_flags((struct wl_proxy *) wl_subcompositor,
6261 WL_SUBCOMPOSITOR_GET_SUBSURFACE, &wl_subsurface_interface, wl_proxy_get_version((struct wl_proxy *) wl_subcompositor), 0, NULL, surface, parent);
6263 return (struct wl_subsurface *) id;
6266#ifndef WL_SUBSURFACE_ERROR_ENUM
6267#define WL_SUBSURFACE_ERROR_ENUM
6268enum wl_subsurface_error {
6269 /**
6270 * wl_surface is not a sibling or the parent
6271 */
6272 WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
6274#endif /* WL_SUBSURFACE_ERROR_ENUM */
6276#define WL_SUBSURFACE_DESTROY 0
6277#define WL_SUBSURFACE_SET_POSITION 1
6278#define WL_SUBSURFACE_PLACE_ABOVE 2
6279#define WL_SUBSURFACE_PLACE_BELOW 3
6280#define WL_SUBSURFACE_SET_SYNC 4
6281#define WL_SUBSURFACE_SET_DESYNC 5
6284/**
6285 * @ingroup iface_wl_subsurface
6286 */
6287#define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1
6288/**
6289 * @ingroup iface_wl_subsurface
6290 */
6291#define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1
6292/**
6293 * @ingroup iface_wl_subsurface
6294 */
6295#define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1
6296/**
6297 * @ingroup iface_wl_subsurface
6298 */
6299#define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1
6300/**
6301 * @ingroup iface_wl_subsurface
6302 */
6303#define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1
6304/**
6305 * @ingroup iface_wl_subsurface
6306 */
6307#define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1
6309/** @ingroup iface_wl_subsurface */
6310static inline void
6311wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data)
6313 wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);
6316/** @ingroup iface_wl_subsurface */
6317static inline void *
6318wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)
6320 return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);
6323static inline uint32_t
6324wl_subsurface_get_version(struct wl_subsurface *wl_subsurface)
6326 return wl_proxy_get_version((struct wl_proxy *) wl_subsurface);
6329/**
6330 * @ingroup iface_wl_subsurface
6332 * The sub-surface interface is removed from the wl_surface object
6333 * that was turned into a sub-surface with a
6334 * wl_subcompositor.get_subsurface request. The wl_surface's association
6335 * to the parent is deleted. The wl_surface is unmapped immediately.
6336 */
6337static inline void
6338wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)
6340 wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,
6341 WL_SUBSURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), WL_MARSHAL_FLAG_DESTROY);
6344/**
6345 * @ingroup iface_wl_subsurface
6347 * This schedules a sub-surface position change.
6348 * The sub-surface will be moved so that its origin (top left
6349 * corner pixel) will be at the location x, y of the parent surface
6350 * coordinate system. The coordinates are not restricted to the parent
6351 * surface area. Negative values are allowed.
6353 * The scheduled coordinates will take effect whenever the state of the
6354 * parent surface is applied.
6356 * If more than one set_position request is invoked by the client before
6357 * the commit of the parent surface, the position of a new request always
6358 * replaces the scheduled position from any previous request.
6360 * The initial position is 0, 0.
6361 */
6362static inline void
6363wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y)
6365 wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,
6366 WL_SUBSURFACE_SET_POSITION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, x, y);
6369/**
6370 * @ingroup iface_wl_subsurface
6372 * This sub-surface is taken from the stack, and put back just
6373 * above the reference surface, changing the z-order of the sub-surfaces.
6374 * The reference surface must be one of the sibling surfaces, or the
6375 * parent surface. Using any other surface, including this sub-surface,
6376 * will cause a protocol error.
6378 * The z-order is double-buffered. Requests are handled in order and
6379 * applied immediately to a pending state. The final pending state is
6380 * copied to the active state the next time the state of the parent
6381 * surface is applied.
6383 * A new sub-surface is initially added as the top-most in the stack
6384 * of its siblings and parent.
6385 */
6386static inline void
6387wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
6389 wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,
6390 WL_SUBSURFACE_PLACE_ABOVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, sibling);
6393/**
6394 * @ingroup iface_wl_subsurface
6396 * The sub-surface is placed just below the reference surface.
6397 * See wl_subsurface.place_above.
6398 */
6399static inline void
6400wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
6402 wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,
6403 WL_SUBSURFACE_PLACE_BELOW, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, sibling);
6406/**
6407 * @ingroup iface_wl_subsurface
6409 * Change the commit behaviour of the sub-surface to synchronized
6410 * mode, also described as the parent dependent mode.
6412 * In synchronized mode, wl_surface.commit on a sub-surface will
6413 * accumulate the committed state in a cache, but the state will
6414 * not be applied and hence will not change the compositor output.
6415 * The cached state is applied to the sub-surface immediately after
6416 * the parent surface's state is applied. This ensures atomic
6417 * updates of the parent and all its synchronized sub-surfaces.
6418 * Applying the cached state will invalidate the cache, so further
6419 * parent surface commits do not (re-)apply old state.
6421 * See wl_subsurface for the recursive effect of this mode.
6422 */
6423static inline void
6424wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface)
6426 wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,
6427 WL_SUBSURFACE_SET_SYNC, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0);
6430/**
6431 * @ingroup iface_wl_subsurface
6433 * Change the commit behaviour of the sub-surface to desynchronized
6434 * mode, also described as independent or freely running mode.
6436 * In desynchronized mode, wl_surface.commit on a sub-surface will
6437 * apply the pending state directly, without caching, as happens
6438 * normally with a wl_surface. Calling wl_surface.commit on the
6439 * parent surface has no effect on the sub-surface's wl_surface
6440 * state. This mode allows a sub-surface to be updated on its own.
6442 * If cached state exists when wl_surface.commit is called in
6443 * desynchronized mode, the pending state is added to the cached
6444 * state, and applied as a whole. This invalidates the cache.
6446 * Note: even if a sub-surface is set to desynchronized, a parent
6447 * sub-surface may override it to behave as synchronized. For details,
6448 * see wl_subsurface.
6450 * If a surface's parent surface behaves as desynchronized, then
6451 * the cached state is applied on set_desync.
6452 */
6453static inline void
6454wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface)
6456 wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,
6457 WL_SUBSURFACE_SET_DESYNC, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0);
6460#define WL_FIXES_DESTROY 0
6461#define WL_FIXES_DESTROY_REGISTRY 1
6464/**
6465 * @ingroup iface_wl_fixes
6466 */
6467#define WL_FIXES_DESTROY_SINCE_VERSION 1
6468/**
6469 * @ingroup iface_wl_fixes
6470 */
6471#define WL_FIXES_DESTROY_REGISTRY_SINCE_VERSION 1
6473/** @ingroup iface_wl_fixes */
6474static inline void
6475wl_fixes_set_user_data(struct wl_fixes *wl_fixes, void *user_data)
6477 wl_proxy_set_user_data((struct wl_proxy *) wl_fixes, user_data);
6480/** @ingroup iface_wl_fixes */
6481static inline void *
6482wl_fixes_get_user_data(struct wl_fixes *wl_fixes)
6484 return wl_proxy_get_user_data((struct wl_proxy *) wl_fixes);
6487static inline uint32_t
6488wl_fixes_get_version(struct wl_fixes *wl_fixes)
6490 return wl_proxy_get_version((struct wl_proxy *) wl_fixes);
6493/**
6494 * @ingroup iface_wl_fixes
6495 */
6496static inline void
6497wl_fixes_destroy(struct wl_fixes *wl_fixes)
6499 wl_proxy_marshal_flags((struct wl_proxy *) wl_fixes,
6500 WL_FIXES_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_fixes), WL_MARSHAL_FLAG_DESTROY);
6503/**
6504 * @ingroup iface_wl_fixes
6506 * This request destroys a wl_registry object.
6508 * The client should no longer use the wl_registry after making this
6509 * request.
6511 * The compositor will emit a wl_display.delete_id event with the object ID
6512 * of the registry and will no longer emit any events on the registry. The
6513 * client should re-use the object ID once it receives the
6514 * wl_display.delete_id event.
6515 */
6516static inline void
6517wl_fixes_destroy_registry(struct wl_fixes *wl_fixes, struct wl_registry *registry)
6519 wl_proxy_marshal_flags((struct wl_proxy *) wl_fixes,
6520 WL_FIXES_DESTROY_REGISTRY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_fixes), 0, registry);
6523#ifdef __cplusplus
6525#endif
6527#endif