1*84e872a0SLloyd Pique /* SCANNER TEST */
2*84e872a0SLloyd Pique
3*84e872a0SLloyd Pique #ifndef WAYLAND_SERVER_PROTOCOL_H
4*84e872a0SLloyd Pique #define WAYLAND_SERVER_PROTOCOL_H
5*84e872a0SLloyd Pique
6*84e872a0SLloyd Pique #include <stdint.h>
7*84e872a0SLloyd Pique #include <stddef.h>
8*84e872a0SLloyd Pique #include "wayland-server.h"
9*84e872a0SLloyd Pique
10*84e872a0SLloyd Pique #ifdef __cplusplus
11*84e872a0SLloyd Pique extern "C" {
12*84e872a0SLloyd Pique #endif
13*84e872a0SLloyd Pique
14*84e872a0SLloyd Pique struct wl_client;
15*84e872a0SLloyd Pique struct wl_resource;
16*84e872a0SLloyd Pique
17*84e872a0SLloyd Pique /**
18*84e872a0SLloyd Pique * @page page_wayland The wayland protocol
19*84e872a0SLloyd Pique * @section page_ifaces_wayland Interfaces
20*84e872a0SLloyd Pique * - @subpage page_iface_wl_display - core global object
21*84e872a0SLloyd Pique * - @subpage page_iface_wl_registry - global registry object
22*84e872a0SLloyd Pique * - @subpage page_iface_wl_callback - callback object
23*84e872a0SLloyd Pique * - @subpage page_iface_wl_compositor - the compositor singleton
24*84e872a0SLloyd Pique * - @subpage page_iface_wl_shm_pool - a shared memory pool
25*84e872a0SLloyd Pique * - @subpage page_iface_wl_shm - shared memory support
26*84e872a0SLloyd Pique * - @subpage page_iface_wl_buffer - content for a wl_surface
27*84e872a0SLloyd Pique * - @subpage page_iface_wl_data_offer - offer to transfer data
28*84e872a0SLloyd Pique * - @subpage page_iface_wl_data_source - offer to transfer data
29*84e872a0SLloyd Pique * - @subpage page_iface_wl_data_device - data transfer device
30*84e872a0SLloyd Pique * - @subpage page_iface_wl_data_device_manager - data transfer interface
31*84e872a0SLloyd Pique * - @subpage page_iface_wl_shell - create desktop-style surfaces
32*84e872a0SLloyd Pique * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface
33*84e872a0SLloyd Pique * - @subpage page_iface_wl_surface - an onscreen surface
34*84e872a0SLloyd Pique * - @subpage page_iface_wl_seat - group of input devices
35*84e872a0SLloyd Pique * - @subpage page_iface_wl_pointer - pointer input device
36*84e872a0SLloyd Pique * - @subpage page_iface_wl_keyboard - keyboard input device
37*84e872a0SLloyd Pique * - @subpage page_iface_wl_touch - touchscreen input device
38*84e872a0SLloyd Pique * - @subpage page_iface_wl_output - compositor output region
39*84e872a0SLloyd Pique * - @subpage page_iface_wl_region - region interface
40*84e872a0SLloyd Pique * - @subpage page_iface_wl_subcompositor - sub-surface compositing
41*84e872a0SLloyd Pique * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface
42*84e872a0SLloyd Pique * @section page_copyright_wayland Copyright
43*84e872a0SLloyd Pique * <pre>
44*84e872a0SLloyd Pique *
45*84e872a0SLloyd Pique * Copyright © 2008-2011 Kristian Høgsberg
46*84e872a0SLloyd Pique * Copyright © 2010-2011 Intel Corporation
47*84e872a0SLloyd Pique * Copyright © 2012-2013 Collabora, Ltd.
48*84e872a0SLloyd Pique *
49*84e872a0SLloyd Pique * Permission is hereby granted, free of charge, to any person
50*84e872a0SLloyd Pique * obtaining a copy of this software and associated documentation files
51*84e872a0SLloyd Pique * (the "Software"), to deal in the Software without restriction,
52*84e872a0SLloyd Pique * including without limitation the rights to use, copy, modify, merge,
53*84e872a0SLloyd Pique * publish, distribute, sublicense, and/or sell copies of the Software,
54*84e872a0SLloyd Pique * and to permit persons to whom the Software is furnished to do so,
55*84e872a0SLloyd Pique * subject to the following conditions:
56*84e872a0SLloyd Pique *
57*84e872a0SLloyd Pique * The above copyright notice and this permission notice (including the
58*84e872a0SLloyd Pique * next paragraph) shall be included in all copies or substantial
59*84e872a0SLloyd Pique * portions of the Software.
60*84e872a0SLloyd Pique *
61*84e872a0SLloyd Pique * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
62*84e872a0SLloyd Pique * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
63*84e872a0SLloyd Pique * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
64*84e872a0SLloyd Pique * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
65*84e872a0SLloyd Pique * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
66*84e872a0SLloyd Pique * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
67*84e872a0SLloyd Pique * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
68*84e872a0SLloyd Pique * SOFTWARE.
69*84e872a0SLloyd Pique * </pre>
70*84e872a0SLloyd Pique */
71*84e872a0SLloyd Pique struct wl_buffer;
72*84e872a0SLloyd Pique struct wl_callback;
73*84e872a0SLloyd Pique struct wl_compositor;
74*84e872a0SLloyd Pique struct wl_data_device;
75*84e872a0SLloyd Pique struct wl_data_device_manager;
76*84e872a0SLloyd Pique struct wl_data_offer;
77*84e872a0SLloyd Pique struct wl_data_source;
78*84e872a0SLloyd Pique struct wl_display;
79*84e872a0SLloyd Pique struct wl_keyboard;
80*84e872a0SLloyd Pique struct wl_output;
81*84e872a0SLloyd Pique struct wl_pointer;
82*84e872a0SLloyd Pique struct wl_region;
83*84e872a0SLloyd Pique struct wl_registry;
84*84e872a0SLloyd Pique struct wl_seat;
85*84e872a0SLloyd Pique struct wl_shell;
86*84e872a0SLloyd Pique struct wl_shell_surface;
87*84e872a0SLloyd Pique struct wl_shm;
88*84e872a0SLloyd Pique struct wl_shm_pool;
89*84e872a0SLloyd Pique struct wl_subcompositor;
90*84e872a0SLloyd Pique struct wl_subsurface;
91*84e872a0SLloyd Pique struct wl_surface;
92*84e872a0SLloyd Pique struct wl_touch;
93*84e872a0SLloyd Pique
94*84e872a0SLloyd Pique #ifndef WL_DISPLAY_INTERFACE
95*84e872a0SLloyd Pique #define WL_DISPLAY_INTERFACE
96*84e872a0SLloyd Pique /**
97*84e872a0SLloyd Pique * @page page_iface_wl_display wl_display
98*84e872a0SLloyd Pique * @section page_iface_wl_display_desc Description
99*84e872a0SLloyd Pique *
100*84e872a0SLloyd Pique * The core global object. This is a special singleton object. It
101*84e872a0SLloyd Pique * is used for internal Wayland protocol features.
102*84e872a0SLloyd Pique * @section page_iface_wl_display_api API
103*84e872a0SLloyd Pique * See @ref iface_wl_display.
104*84e872a0SLloyd Pique */
105*84e872a0SLloyd Pique /**
106*84e872a0SLloyd Pique * @defgroup iface_wl_display The wl_display interface
107*84e872a0SLloyd Pique *
108*84e872a0SLloyd Pique * The core global object. This is a special singleton object. It
109*84e872a0SLloyd Pique * is used for internal Wayland protocol features.
110*84e872a0SLloyd Pique */
111*84e872a0SLloyd Pique extern const struct wl_interface wl_display_interface;
112*84e872a0SLloyd Pique #endif
113*84e872a0SLloyd Pique #ifndef WL_REGISTRY_INTERFACE
114*84e872a0SLloyd Pique #define WL_REGISTRY_INTERFACE
115*84e872a0SLloyd Pique /**
116*84e872a0SLloyd Pique * @page page_iface_wl_registry wl_registry
117*84e872a0SLloyd Pique * @section page_iface_wl_registry_desc Description
118*84e872a0SLloyd Pique *
119*84e872a0SLloyd Pique * The singleton global registry object. The server has a number of
120*84e872a0SLloyd Pique * global objects that are available to all clients. These objects
121*84e872a0SLloyd Pique * typically represent an actual object in the server (for example,
122*84e872a0SLloyd Pique * an input device) or they are singleton objects that provide
123*84e872a0SLloyd Pique * extension functionality.
124*84e872a0SLloyd Pique *
125*84e872a0SLloyd Pique * When a client creates a registry object, the registry object
126*84e872a0SLloyd Pique * will emit a global event for each global currently in the
127*84e872a0SLloyd Pique * registry. Globals come and go as a result of device or
128*84e872a0SLloyd Pique * monitor hotplugs, reconfiguration or other events, and the
129*84e872a0SLloyd Pique * registry will send out global and global_remove events to
130*84e872a0SLloyd Pique * keep the client up to date with the changes. To mark the end
131*84e872a0SLloyd Pique * of the initial burst of events, the client can use the
132*84e872a0SLloyd Pique * wl_display.sync request immediately after calling
133*84e872a0SLloyd Pique * wl_display.get_registry.
134*84e872a0SLloyd Pique *
135*84e872a0SLloyd Pique * A client can bind to a global object by using the bind
136*84e872a0SLloyd Pique * request. This creates a client-side handle that lets the object
137*84e872a0SLloyd Pique * emit events to the client and lets the client invoke requests on
138*84e872a0SLloyd Pique * the object.
139*84e872a0SLloyd Pique * @section page_iface_wl_registry_api API
140*84e872a0SLloyd Pique * See @ref iface_wl_registry.
141*84e872a0SLloyd Pique */
142*84e872a0SLloyd Pique /**
143*84e872a0SLloyd Pique * @defgroup iface_wl_registry The wl_registry interface
144*84e872a0SLloyd Pique *
145*84e872a0SLloyd Pique * The singleton global registry object. The server has a number of
146*84e872a0SLloyd Pique * global objects that are available to all clients. These objects
147*84e872a0SLloyd Pique * typically represent an actual object in the server (for example,
148*84e872a0SLloyd Pique * an input device) or they are singleton objects that provide
149*84e872a0SLloyd Pique * extension functionality.
150*84e872a0SLloyd Pique *
151*84e872a0SLloyd Pique * When a client creates a registry object, the registry object
152*84e872a0SLloyd Pique * will emit a global event for each global currently in the
153*84e872a0SLloyd Pique * registry. Globals come and go as a result of device or
154*84e872a0SLloyd Pique * monitor hotplugs, reconfiguration or other events, and the
155*84e872a0SLloyd Pique * registry will send out global and global_remove events to
156*84e872a0SLloyd Pique * keep the client up to date with the changes. To mark the end
157*84e872a0SLloyd Pique * of the initial burst of events, the client can use the
158*84e872a0SLloyd Pique * wl_display.sync request immediately after calling
159*84e872a0SLloyd Pique * wl_display.get_registry.
160*84e872a0SLloyd Pique *
161*84e872a0SLloyd Pique * A client can bind to a global object by using the bind
162*84e872a0SLloyd Pique * request. This creates a client-side handle that lets the object
163*84e872a0SLloyd Pique * emit events to the client and lets the client invoke requests on
164*84e872a0SLloyd Pique * the object.
165*84e872a0SLloyd Pique */
166*84e872a0SLloyd Pique extern const struct wl_interface wl_registry_interface;
167*84e872a0SLloyd Pique #endif
168*84e872a0SLloyd Pique #ifndef WL_CALLBACK_INTERFACE
169*84e872a0SLloyd Pique #define WL_CALLBACK_INTERFACE
170*84e872a0SLloyd Pique /**
171*84e872a0SLloyd Pique * @page page_iface_wl_callback wl_callback
172*84e872a0SLloyd Pique * @section page_iface_wl_callback_desc Description
173*84e872a0SLloyd Pique *
174*84e872a0SLloyd Pique * Clients can handle the 'done' event to get notified when
175*84e872a0SLloyd Pique * the related request is done.
176*84e872a0SLloyd Pique * @section page_iface_wl_callback_api API
177*84e872a0SLloyd Pique * See @ref iface_wl_callback.
178*84e872a0SLloyd Pique */
179*84e872a0SLloyd Pique /**
180*84e872a0SLloyd Pique * @defgroup iface_wl_callback The wl_callback interface
181*84e872a0SLloyd Pique *
182*84e872a0SLloyd Pique * Clients can handle the 'done' event to get notified when
183*84e872a0SLloyd Pique * the related request is done.
184*84e872a0SLloyd Pique */
185*84e872a0SLloyd Pique extern const struct wl_interface wl_callback_interface;
186*84e872a0SLloyd Pique #endif
187*84e872a0SLloyd Pique #ifndef WL_COMPOSITOR_INTERFACE
188*84e872a0SLloyd Pique #define WL_COMPOSITOR_INTERFACE
189*84e872a0SLloyd Pique /**
190*84e872a0SLloyd Pique * @page page_iface_wl_compositor wl_compositor
191*84e872a0SLloyd Pique * @section page_iface_wl_compositor_desc Description
192*84e872a0SLloyd Pique *
193*84e872a0SLloyd Pique * A compositor. This object is a singleton global. The
194*84e872a0SLloyd Pique * compositor is in charge of combining the contents of multiple
195*84e872a0SLloyd Pique * surfaces into one displayable output.
196*84e872a0SLloyd Pique * @section page_iface_wl_compositor_api API
197*84e872a0SLloyd Pique * See @ref iface_wl_compositor.
198*84e872a0SLloyd Pique */
199*84e872a0SLloyd Pique /**
200*84e872a0SLloyd Pique * @defgroup iface_wl_compositor The wl_compositor interface
201*84e872a0SLloyd Pique *
202*84e872a0SLloyd Pique * A compositor. This object is a singleton global. The
203*84e872a0SLloyd Pique * compositor is in charge of combining the contents of multiple
204*84e872a0SLloyd Pique * surfaces into one displayable output.
205*84e872a0SLloyd Pique */
206*84e872a0SLloyd Pique extern const struct wl_interface wl_compositor_interface;
207*84e872a0SLloyd Pique #endif
208*84e872a0SLloyd Pique #ifndef WL_SHM_POOL_INTERFACE
209*84e872a0SLloyd Pique #define WL_SHM_POOL_INTERFACE
210*84e872a0SLloyd Pique /**
211*84e872a0SLloyd Pique * @page page_iface_wl_shm_pool wl_shm_pool
212*84e872a0SLloyd Pique * @section page_iface_wl_shm_pool_desc Description
213*84e872a0SLloyd Pique *
214*84e872a0SLloyd Pique * The wl_shm_pool object encapsulates a piece of memory shared
215*84e872a0SLloyd Pique * between the compositor and client. Through the wl_shm_pool
216*84e872a0SLloyd Pique * object, the client can allocate shared memory wl_buffer objects.
217*84e872a0SLloyd Pique * All objects created through the same pool share the same
218*84e872a0SLloyd Pique * underlying mapped memory. Reusing the mapped memory avoids the
219*84e872a0SLloyd Pique * setup/teardown overhead and is useful when interactively resizing
220*84e872a0SLloyd Pique * a surface or for many small buffers.
221*84e872a0SLloyd Pique * @section page_iface_wl_shm_pool_api API
222*84e872a0SLloyd Pique * See @ref iface_wl_shm_pool.
223*84e872a0SLloyd Pique */
224*84e872a0SLloyd Pique /**
225*84e872a0SLloyd Pique * @defgroup iface_wl_shm_pool The wl_shm_pool interface
226*84e872a0SLloyd Pique *
227*84e872a0SLloyd Pique * The wl_shm_pool object encapsulates a piece of memory shared
228*84e872a0SLloyd Pique * between the compositor and client. Through the wl_shm_pool
229*84e872a0SLloyd Pique * object, the client can allocate shared memory wl_buffer objects.
230*84e872a0SLloyd Pique * All objects created through the same pool share the same
231*84e872a0SLloyd Pique * underlying mapped memory. Reusing the mapped memory avoids the
232*84e872a0SLloyd Pique * setup/teardown overhead and is useful when interactively resizing
233*84e872a0SLloyd Pique * a surface or for many small buffers.
234*84e872a0SLloyd Pique */
235*84e872a0SLloyd Pique extern const struct wl_interface wl_shm_pool_interface;
236*84e872a0SLloyd Pique #endif
237*84e872a0SLloyd Pique #ifndef WL_SHM_INTERFACE
238*84e872a0SLloyd Pique #define WL_SHM_INTERFACE
239*84e872a0SLloyd Pique /**
240*84e872a0SLloyd Pique * @page page_iface_wl_shm wl_shm
241*84e872a0SLloyd Pique * @section page_iface_wl_shm_desc Description
242*84e872a0SLloyd Pique *
243*84e872a0SLloyd Pique * A singleton global object that provides support for shared
244*84e872a0SLloyd Pique * memory.
245*84e872a0SLloyd Pique *
246*84e872a0SLloyd Pique * Clients can create wl_shm_pool objects using the create_pool
247*84e872a0SLloyd Pique * request.
248*84e872a0SLloyd Pique *
249*84e872a0SLloyd Pique * At connection setup time, the wl_shm object emits one or more
250*84e872a0SLloyd Pique * format events to inform clients about the valid pixel formats
251*84e872a0SLloyd Pique * that can be used for buffers.
252*84e872a0SLloyd Pique * @section page_iface_wl_shm_api API
253*84e872a0SLloyd Pique * See @ref iface_wl_shm.
254*84e872a0SLloyd Pique */
255*84e872a0SLloyd Pique /**
256*84e872a0SLloyd Pique * @defgroup iface_wl_shm The wl_shm interface
257*84e872a0SLloyd Pique *
258*84e872a0SLloyd Pique * A singleton global object that provides support for shared
259*84e872a0SLloyd Pique * memory.
260*84e872a0SLloyd Pique *
261*84e872a0SLloyd Pique * Clients can create wl_shm_pool objects using the create_pool
262*84e872a0SLloyd Pique * request.
263*84e872a0SLloyd Pique *
264*84e872a0SLloyd Pique * At connection setup time, the wl_shm object emits one or more
265*84e872a0SLloyd Pique * format events to inform clients about the valid pixel formats
266*84e872a0SLloyd Pique * that can be used for buffers.
267*84e872a0SLloyd Pique */
268*84e872a0SLloyd Pique extern const struct wl_interface wl_shm_interface;
269*84e872a0SLloyd Pique #endif
270*84e872a0SLloyd Pique #ifndef WL_BUFFER_INTERFACE
271*84e872a0SLloyd Pique #define WL_BUFFER_INTERFACE
272*84e872a0SLloyd Pique /**
273*84e872a0SLloyd Pique * @page page_iface_wl_buffer wl_buffer
274*84e872a0SLloyd Pique * @section page_iface_wl_buffer_desc Description
275*84e872a0SLloyd Pique *
276*84e872a0SLloyd Pique * A buffer provides the content for a wl_surface. Buffers are
277*84e872a0SLloyd Pique * created through factory interfaces such as wl_drm, wl_shm or
278*84e872a0SLloyd Pique * similar. It has a width and a height and can be attached to a
279*84e872a0SLloyd Pique * wl_surface, but the mechanism by which a client provides and
280*84e872a0SLloyd Pique * updates the contents is defined by the buffer factory interface.
281*84e872a0SLloyd Pique * @section page_iface_wl_buffer_api API
282*84e872a0SLloyd Pique * See @ref iface_wl_buffer.
283*84e872a0SLloyd Pique */
284*84e872a0SLloyd Pique /**
285*84e872a0SLloyd Pique * @defgroup iface_wl_buffer The wl_buffer interface
286*84e872a0SLloyd Pique *
287*84e872a0SLloyd Pique * A buffer provides the content for a wl_surface. Buffers are
288*84e872a0SLloyd Pique * created through factory interfaces such as wl_drm, wl_shm or
289*84e872a0SLloyd Pique * similar. It has a width and a height and can be attached to a
290*84e872a0SLloyd Pique * wl_surface, but the mechanism by which a client provides and
291*84e872a0SLloyd Pique * updates the contents is defined by the buffer factory interface.
292*84e872a0SLloyd Pique */
293*84e872a0SLloyd Pique extern const struct wl_interface wl_buffer_interface;
294*84e872a0SLloyd Pique #endif
295*84e872a0SLloyd Pique #ifndef WL_DATA_OFFER_INTERFACE
296*84e872a0SLloyd Pique #define WL_DATA_OFFER_INTERFACE
297*84e872a0SLloyd Pique /**
298*84e872a0SLloyd Pique * @page page_iface_wl_data_offer wl_data_offer
299*84e872a0SLloyd Pique * @section page_iface_wl_data_offer_desc Description
300*84e872a0SLloyd Pique *
301*84e872a0SLloyd Pique * A wl_data_offer represents a piece of data offered for transfer
302*84e872a0SLloyd Pique * by another client (the source client). It is used by the
303*84e872a0SLloyd Pique * copy-and-paste and drag-and-drop mechanisms. The offer
304*84e872a0SLloyd Pique * describes the different mime types that the data can be
305*84e872a0SLloyd Pique * converted to and provides the mechanism for transferring the
306*84e872a0SLloyd Pique * data directly from the source client.
307*84e872a0SLloyd Pique * @section page_iface_wl_data_offer_api API
308*84e872a0SLloyd Pique * See @ref iface_wl_data_offer.
309*84e872a0SLloyd Pique */
310*84e872a0SLloyd Pique /**
311*84e872a0SLloyd Pique * @defgroup iface_wl_data_offer The wl_data_offer interface
312*84e872a0SLloyd Pique *
313*84e872a0SLloyd Pique * A wl_data_offer represents a piece of data offered for transfer
314*84e872a0SLloyd Pique * by another client (the source client). It is used by the
315*84e872a0SLloyd Pique * copy-and-paste and drag-and-drop mechanisms. The offer
316*84e872a0SLloyd Pique * describes the different mime types that the data can be
317*84e872a0SLloyd Pique * converted to and provides the mechanism for transferring the
318*84e872a0SLloyd Pique * data directly from the source client.
319*84e872a0SLloyd Pique */
320*84e872a0SLloyd Pique extern const struct wl_interface wl_data_offer_interface;
321*84e872a0SLloyd Pique #endif
322*84e872a0SLloyd Pique #ifndef WL_DATA_SOURCE_INTERFACE
323*84e872a0SLloyd Pique #define WL_DATA_SOURCE_INTERFACE
324*84e872a0SLloyd Pique /**
325*84e872a0SLloyd Pique * @page page_iface_wl_data_source wl_data_source
326*84e872a0SLloyd Pique * @section page_iface_wl_data_source_desc Description
327*84e872a0SLloyd Pique *
328*84e872a0SLloyd Pique * The wl_data_source object is the source side of a wl_data_offer.
329*84e872a0SLloyd Pique * It is created by the source client in a data transfer and
330*84e872a0SLloyd Pique * provides a way to describe the offered data and a way to respond
331*84e872a0SLloyd Pique * to requests to transfer the data.
332*84e872a0SLloyd Pique * @section page_iface_wl_data_source_api API
333*84e872a0SLloyd Pique * See @ref iface_wl_data_source.
334*84e872a0SLloyd Pique */
335*84e872a0SLloyd Pique /**
336*84e872a0SLloyd Pique * @defgroup iface_wl_data_source The wl_data_source interface
337*84e872a0SLloyd Pique *
338*84e872a0SLloyd Pique * The wl_data_source object is the source side of a wl_data_offer.
339*84e872a0SLloyd Pique * It is created by the source client in a data transfer and
340*84e872a0SLloyd Pique * provides a way to describe the offered data and a way to respond
341*84e872a0SLloyd Pique * to requests to transfer the data.
342*84e872a0SLloyd Pique */
343*84e872a0SLloyd Pique extern const struct wl_interface wl_data_source_interface;
344*84e872a0SLloyd Pique #endif
345*84e872a0SLloyd Pique #ifndef WL_DATA_DEVICE_INTERFACE
346*84e872a0SLloyd Pique #define WL_DATA_DEVICE_INTERFACE
347*84e872a0SLloyd Pique /**
348*84e872a0SLloyd Pique * @page page_iface_wl_data_device wl_data_device
349*84e872a0SLloyd Pique * @section page_iface_wl_data_device_desc Description
350*84e872a0SLloyd Pique *
351*84e872a0SLloyd Pique * There is one wl_data_device per seat which can be obtained
352*84e872a0SLloyd Pique * from the global wl_data_device_manager singleton.
353*84e872a0SLloyd Pique *
354*84e872a0SLloyd Pique * A wl_data_device provides access to inter-client data transfer
355*84e872a0SLloyd Pique * mechanisms such as copy-and-paste and drag-and-drop.
356*84e872a0SLloyd Pique * @section page_iface_wl_data_device_api API
357*84e872a0SLloyd Pique * See @ref iface_wl_data_device.
358*84e872a0SLloyd Pique */
359*84e872a0SLloyd Pique /**
360*84e872a0SLloyd Pique * @defgroup iface_wl_data_device The wl_data_device interface
361*84e872a0SLloyd Pique *
362*84e872a0SLloyd Pique * There is one wl_data_device per seat which can be obtained
363*84e872a0SLloyd Pique * from the global wl_data_device_manager singleton.
364*84e872a0SLloyd Pique *
365*84e872a0SLloyd Pique * A wl_data_device provides access to inter-client data transfer
366*84e872a0SLloyd Pique * mechanisms such as copy-and-paste and drag-and-drop.
367*84e872a0SLloyd Pique */
368*84e872a0SLloyd Pique extern const struct wl_interface wl_data_device_interface;
369*84e872a0SLloyd Pique #endif
370*84e872a0SLloyd Pique #ifndef WL_DATA_DEVICE_MANAGER_INTERFACE
371*84e872a0SLloyd Pique #define WL_DATA_DEVICE_MANAGER_INTERFACE
372*84e872a0SLloyd Pique /**
373*84e872a0SLloyd Pique * @page page_iface_wl_data_device_manager wl_data_device_manager
374*84e872a0SLloyd Pique * @section page_iface_wl_data_device_manager_desc Description
375*84e872a0SLloyd Pique *
376*84e872a0SLloyd Pique * The wl_data_device_manager is a singleton global object that
377*84e872a0SLloyd Pique * provides access to inter-client data transfer mechanisms such as
378*84e872a0SLloyd Pique * copy-and-paste and drag-and-drop. These mechanisms are tied to
379*84e872a0SLloyd Pique * a wl_seat and this interface lets a client get a wl_data_device
380*84e872a0SLloyd Pique * corresponding to a wl_seat.
381*84e872a0SLloyd Pique *
382*84e872a0SLloyd Pique * Depending on the version bound, the objects created from the bound
383*84e872a0SLloyd Pique * wl_data_device_manager object will have different requirements for
384*84e872a0SLloyd Pique * functioning properly. See wl_data_source.set_actions,
385*84e872a0SLloyd Pique * wl_data_offer.accept and wl_data_offer.finish for details.
386*84e872a0SLloyd Pique * @section page_iface_wl_data_device_manager_api API
387*84e872a0SLloyd Pique * See @ref iface_wl_data_device_manager.
388*84e872a0SLloyd Pique */
389*84e872a0SLloyd Pique /**
390*84e872a0SLloyd Pique * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface
391*84e872a0SLloyd Pique *
392*84e872a0SLloyd Pique * The wl_data_device_manager is a singleton global object that
393*84e872a0SLloyd Pique * provides access to inter-client data transfer mechanisms such as
394*84e872a0SLloyd Pique * copy-and-paste and drag-and-drop. These mechanisms are tied to
395*84e872a0SLloyd Pique * a wl_seat and this interface lets a client get a wl_data_device
396*84e872a0SLloyd Pique * corresponding to a wl_seat.
397*84e872a0SLloyd Pique *
398*84e872a0SLloyd Pique * Depending on the version bound, the objects created from the bound
399*84e872a0SLloyd Pique * wl_data_device_manager object will have different requirements for
400*84e872a0SLloyd Pique * functioning properly. See wl_data_source.set_actions,
401*84e872a0SLloyd Pique * wl_data_offer.accept and wl_data_offer.finish for details.
402*84e872a0SLloyd Pique */
403*84e872a0SLloyd Pique extern const struct wl_interface wl_data_device_manager_interface;
404*84e872a0SLloyd Pique #endif
405*84e872a0SLloyd Pique #ifndef WL_SHELL_INTERFACE
406*84e872a0SLloyd Pique #define WL_SHELL_INTERFACE
407*84e872a0SLloyd Pique /**
408*84e872a0SLloyd Pique * @page page_iface_wl_shell wl_shell
409*84e872a0SLloyd Pique * @section page_iface_wl_shell_desc Description
410*84e872a0SLloyd Pique *
411*84e872a0SLloyd Pique * This interface is implemented by servers that provide
412*84e872a0SLloyd Pique * desktop-style user interfaces.
413*84e872a0SLloyd Pique *
414*84e872a0SLloyd Pique * It allows clients to associate a wl_shell_surface with
415*84e872a0SLloyd Pique * a basic surface.
416*84e872a0SLloyd Pique * @section page_iface_wl_shell_api API
417*84e872a0SLloyd Pique * See @ref iface_wl_shell.
418*84e872a0SLloyd Pique */
419*84e872a0SLloyd Pique /**
420*84e872a0SLloyd Pique * @defgroup iface_wl_shell The wl_shell interface
421*84e872a0SLloyd Pique *
422*84e872a0SLloyd Pique * This interface is implemented by servers that provide
423*84e872a0SLloyd Pique * desktop-style user interfaces.
424*84e872a0SLloyd Pique *
425*84e872a0SLloyd Pique * It allows clients to associate a wl_shell_surface with
426*84e872a0SLloyd Pique * a basic surface.
427*84e872a0SLloyd Pique */
428*84e872a0SLloyd Pique extern const struct wl_interface wl_shell_interface;
429*84e872a0SLloyd Pique #endif
430*84e872a0SLloyd Pique #ifndef WL_SHELL_SURFACE_INTERFACE
431*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_INTERFACE
432*84e872a0SLloyd Pique /**
433*84e872a0SLloyd Pique * @page page_iface_wl_shell_surface wl_shell_surface
434*84e872a0SLloyd Pique * @section page_iface_wl_shell_surface_desc Description
435*84e872a0SLloyd Pique *
436*84e872a0SLloyd Pique * An interface that may be implemented by a wl_surface, for
437*84e872a0SLloyd Pique * implementations that provide a desktop-style user interface.
438*84e872a0SLloyd Pique *
439*84e872a0SLloyd Pique * It provides requests to treat surfaces like toplevel, fullscreen
440*84e872a0SLloyd Pique * or popup windows, move, resize or maximize them, associate
441*84e872a0SLloyd Pique * metadata like title and class, etc.
442*84e872a0SLloyd Pique *
443*84e872a0SLloyd Pique * On the server side the object is automatically destroyed when
444*84e872a0SLloyd Pique * the related wl_surface is destroyed. On the client side,
445*84e872a0SLloyd Pique * wl_shell_surface_destroy() must be called before destroying
446*84e872a0SLloyd Pique * the wl_surface object.
447*84e872a0SLloyd Pique * @section page_iface_wl_shell_surface_api API
448*84e872a0SLloyd Pique * See @ref iface_wl_shell_surface.
449*84e872a0SLloyd Pique */
450*84e872a0SLloyd Pique /**
451*84e872a0SLloyd Pique * @defgroup iface_wl_shell_surface The wl_shell_surface interface
452*84e872a0SLloyd Pique *
453*84e872a0SLloyd Pique * An interface that may be implemented by a wl_surface, for
454*84e872a0SLloyd Pique * implementations that provide a desktop-style user interface.
455*84e872a0SLloyd Pique *
456*84e872a0SLloyd Pique * It provides requests to treat surfaces like toplevel, fullscreen
457*84e872a0SLloyd Pique * or popup windows, move, resize or maximize them, associate
458*84e872a0SLloyd Pique * metadata like title and class, etc.
459*84e872a0SLloyd Pique *
460*84e872a0SLloyd Pique * On the server side the object is automatically destroyed when
461*84e872a0SLloyd Pique * the related wl_surface is destroyed. On the client side,
462*84e872a0SLloyd Pique * wl_shell_surface_destroy() must be called before destroying
463*84e872a0SLloyd Pique * the wl_surface object.
464*84e872a0SLloyd Pique */
465*84e872a0SLloyd Pique extern const struct wl_interface wl_shell_surface_interface;
466*84e872a0SLloyd Pique #endif
467*84e872a0SLloyd Pique #ifndef WL_SURFACE_INTERFACE
468*84e872a0SLloyd Pique #define WL_SURFACE_INTERFACE
469*84e872a0SLloyd Pique /**
470*84e872a0SLloyd Pique * @page page_iface_wl_surface wl_surface
471*84e872a0SLloyd Pique * @section page_iface_wl_surface_desc Description
472*84e872a0SLloyd Pique *
473*84e872a0SLloyd Pique * A surface is a rectangular area that is displayed on the screen.
474*84e872a0SLloyd Pique * It has a location, size and pixel contents.
475*84e872a0SLloyd Pique *
476*84e872a0SLloyd Pique * The size of a surface (and relative positions on it) is described
477*84e872a0SLloyd Pique * in surface-local coordinates, which may differ from the buffer
478*84e872a0SLloyd Pique * coordinates of the pixel content, in case a buffer_transform
479*84e872a0SLloyd Pique * or a buffer_scale is used.
480*84e872a0SLloyd Pique *
481*84e872a0SLloyd Pique * A surface without a "role" is fairly useless: a compositor does
482*84e872a0SLloyd Pique * not know where, when or how to present it. The role is the
483*84e872a0SLloyd Pique * purpose of a wl_surface. Examples of roles are a cursor for a
484*84e872a0SLloyd Pique * pointer (as set by wl_pointer.set_cursor), a drag icon
485*84e872a0SLloyd Pique * (wl_data_device.start_drag), a sub-surface
486*84e872a0SLloyd Pique * (wl_subcompositor.get_subsurface), and a window as defined by a
487*84e872a0SLloyd Pique * shell protocol (e.g. wl_shell.get_shell_surface).
488*84e872a0SLloyd Pique *
489*84e872a0SLloyd Pique * A surface can have only one role at a time. Initially a
490*84e872a0SLloyd Pique * wl_surface does not have a role. Once a wl_surface is given a
491*84e872a0SLloyd Pique * role, it is set permanently for the whole lifetime of the
492*84e872a0SLloyd Pique * wl_surface object. Giving the current role again is allowed,
493*84e872a0SLloyd Pique * unless explicitly forbidden by the relevant interface
494*84e872a0SLloyd Pique * specification.
495*84e872a0SLloyd Pique *
496*84e872a0SLloyd Pique * Surface roles are given by requests in other interfaces such as
497*84e872a0SLloyd Pique * wl_pointer.set_cursor. The request should explicitly mention
498*84e872a0SLloyd Pique * that this request gives a role to a wl_surface. Often, this
499*84e872a0SLloyd Pique * request also creates a new protocol object that represents the
500*84e872a0SLloyd Pique * role and adds additional functionality to wl_surface. When a
501*84e872a0SLloyd Pique * client wants to destroy a wl_surface, they must destroy this 'role
502*84e872a0SLloyd Pique * object' before the wl_surface.
503*84e872a0SLloyd Pique *
504*84e872a0SLloyd Pique * Destroying the role object does not remove the role from the
505*84e872a0SLloyd Pique * wl_surface, but it may stop the wl_surface from "playing the role".
506*84e872a0SLloyd Pique * For instance, if a wl_subsurface object is destroyed, the wl_surface
507*84e872a0SLloyd Pique * it was created for will be unmapped and forget its position and
508*84e872a0SLloyd Pique * z-order. It is allowed to create a wl_subsurface for the same
509*84e872a0SLloyd Pique * wl_surface again, but it is not allowed to use the wl_surface as
510*84e872a0SLloyd Pique * a cursor (cursor is a different role than sub-surface, and role
511*84e872a0SLloyd Pique * switching is not allowed).
512*84e872a0SLloyd Pique * @section page_iface_wl_surface_api API
513*84e872a0SLloyd Pique * See @ref iface_wl_surface.
514*84e872a0SLloyd Pique */
515*84e872a0SLloyd Pique /**
516*84e872a0SLloyd Pique * @defgroup iface_wl_surface The wl_surface interface
517*84e872a0SLloyd Pique *
518*84e872a0SLloyd Pique * A surface is a rectangular area that is displayed on the screen.
519*84e872a0SLloyd Pique * It has a location, size and pixel contents.
520*84e872a0SLloyd Pique *
521*84e872a0SLloyd Pique * The size of a surface (and relative positions on it) is described
522*84e872a0SLloyd Pique * in surface-local coordinates, which may differ from the buffer
523*84e872a0SLloyd Pique * coordinates of the pixel content, in case a buffer_transform
524*84e872a0SLloyd Pique * or a buffer_scale is used.
525*84e872a0SLloyd Pique *
526*84e872a0SLloyd Pique * A surface without a "role" is fairly useless: a compositor does
527*84e872a0SLloyd Pique * not know where, when or how to present it. The role is the
528*84e872a0SLloyd Pique * purpose of a wl_surface. Examples of roles are a cursor for a
529*84e872a0SLloyd Pique * pointer (as set by wl_pointer.set_cursor), a drag icon
530*84e872a0SLloyd Pique * (wl_data_device.start_drag), a sub-surface
531*84e872a0SLloyd Pique * (wl_subcompositor.get_subsurface), and a window as defined by a
532*84e872a0SLloyd Pique * shell protocol (e.g. wl_shell.get_shell_surface).
533*84e872a0SLloyd Pique *
534*84e872a0SLloyd Pique * A surface can have only one role at a time. Initially a
535*84e872a0SLloyd Pique * wl_surface does not have a role. Once a wl_surface is given a
536*84e872a0SLloyd Pique * role, it is set permanently for the whole lifetime of the
537*84e872a0SLloyd Pique * wl_surface object. Giving the current role again is allowed,
538*84e872a0SLloyd Pique * unless explicitly forbidden by the relevant interface
539*84e872a0SLloyd Pique * specification.
540*84e872a0SLloyd Pique *
541*84e872a0SLloyd Pique * Surface roles are given by requests in other interfaces such as
542*84e872a0SLloyd Pique * wl_pointer.set_cursor. The request should explicitly mention
543*84e872a0SLloyd Pique * that this request gives a role to a wl_surface. Often, this
544*84e872a0SLloyd Pique * request also creates a new protocol object that represents the
545*84e872a0SLloyd Pique * role and adds additional functionality to wl_surface. When a
546*84e872a0SLloyd Pique * client wants to destroy a wl_surface, they must destroy this 'role
547*84e872a0SLloyd Pique * object' before the wl_surface.
548*84e872a0SLloyd Pique *
549*84e872a0SLloyd Pique * Destroying the role object does not remove the role from the
550*84e872a0SLloyd Pique * wl_surface, but it may stop the wl_surface from "playing the role".
551*84e872a0SLloyd Pique * For instance, if a wl_subsurface object is destroyed, the wl_surface
552*84e872a0SLloyd Pique * it was created for will be unmapped and forget its position and
553*84e872a0SLloyd Pique * z-order. It is allowed to create a wl_subsurface for the same
554*84e872a0SLloyd Pique * wl_surface again, but it is not allowed to use the wl_surface as
555*84e872a0SLloyd Pique * a cursor (cursor is a different role than sub-surface, and role
556*84e872a0SLloyd Pique * switching is not allowed).
557*84e872a0SLloyd Pique */
558*84e872a0SLloyd Pique extern const struct wl_interface wl_surface_interface;
559*84e872a0SLloyd Pique #endif
560*84e872a0SLloyd Pique #ifndef WL_SEAT_INTERFACE
561*84e872a0SLloyd Pique #define WL_SEAT_INTERFACE
562*84e872a0SLloyd Pique /**
563*84e872a0SLloyd Pique * @page page_iface_wl_seat wl_seat
564*84e872a0SLloyd Pique * @section page_iface_wl_seat_desc Description
565*84e872a0SLloyd Pique *
566*84e872a0SLloyd Pique * A seat is a group of keyboards, pointer and touch devices. This
567*84e872a0SLloyd Pique * object is published as a global during start up, or when such a
568*84e872a0SLloyd Pique * device is hot plugged. A seat typically has a pointer and
569*84e872a0SLloyd Pique * maintains a keyboard focus and a pointer focus.
570*84e872a0SLloyd Pique * @section page_iface_wl_seat_api API
571*84e872a0SLloyd Pique * See @ref iface_wl_seat.
572*84e872a0SLloyd Pique */
573*84e872a0SLloyd Pique /**
574*84e872a0SLloyd Pique * @defgroup iface_wl_seat The wl_seat interface
575*84e872a0SLloyd Pique *
576*84e872a0SLloyd Pique * A seat is a group of keyboards, pointer and touch devices. This
577*84e872a0SLloyd Pique * object is published as a global during start up, or when such a
578*84e872a0SLloyd Pique * device is hot plugged. A seat typically has a pointer and
579*84e872a0SLloyd Pique * maintains a keyboard focus and a pointer focus.
580*84e872a0SLloyd Pique */
581*84e872a0SLloyd Pique extern const struct wl_interface wl_seat_interface;
582*84e872a0SLloyd Pique #endif
583*84e872a0SLloyd Pique #ifndef WL_POINTER_INTERFACE
584*84e872a0SLloyd Pique #define WL_POINTER_INTERFACE
585*84e872a0SLloyd Pique /**
586*84e872a0SLloyd Pique * @page page_iface_wl_pointer wl_pointer
587*84e872a0SLloyd Pique * @section page_iface_wl_pointer_desc Description
588*84e872a0SLloyd Pique *
589*84e872a0SLloyd Pique * The wl_pointer interface represents one or more input devices,
590*84e872a0SLloyd Pique * such as mice, which control the pointer location and pointer_focus
591*84e872a0SLloyd Pique * of a seat.
592*84e872a0SLloyd Pique *
593*84e872a0SLloyd Pique * The wl_pointer interface generates motion, enter and leave
594*84e872a0SLloyd Pique * events for the surfaces that the pointer is located over,
595*84e872a0SLloyd Pique * and button and axis events for button presses, button releases
596*84e872a0SLloyd Pique * and scrolling.
597*84e872a0SLloyd Pique * @section page_iface_wl_pointer_api API
598*84e872a0SLloyd Pique * See @ref iface_wl_pointer.
599*84e872a0SLloyd Pique */
600*84e872a0SLloyd Pique /**
601*84e872a0SLloyd Pique * @defgroup iface_wl_pointer The wl_pointer interface
602*84e872a0SLloyd Pique *
603*84e872a0SLloyd Pique * The wl_pointer interface represents one or more input devices,
604*84e872a0SLloyd Pique * such as mice, which control the pointer location and pointer_focus
605*84e872a0SLloyd Pique * of a seat.
606*84e872a0SLloyd Pique *
607*84e872a0SLloyd Pique * The wl_pointer interface generates motion, enter and leave
608*84e872a0SLloyd Pique * events for the surfaces that the pointer is located over,
609*84e872a0SLloyd Pique * and button and axis events for button presses, button releases
610*84e872a0SLloyd Pique * and scrolling.
611*84e872a0SLloyd Pique */
612*84e872a0SLloyd Pique extern const struct wl_interface wl_pointer_interface;
613*84e872a0SLloyd Pique #endif
614*84e872a0SLloyd Pique #ifndef WL_KEYBOARD_INTERFACE
615*84e872a0SLloyd Pique #define WL_KEYBOARD_INTERFACE
616*84e872a0SLloyd Pique /**
617*84e872a0SLloyd Pique * @page page_iface_wl_keyboard wl_keyboard
618*84e872a0SLloyd Pique * @section page_iface_wl_keyboard_desc Description
619*84e872a0SLloyd Pique *
620*84e872a0SLloyd Pique * The wl_keyboard interface represents one or more keyboards
621*84e872a0SLloyd Pique * associated with a seat.
622*84e872a0SLloyd Pique * @section page_iface_wl_keyboard_api API
623*84e872a0SLloyd Pique * See @ref iface_wl_keyboard.
624*84e872a0SLloyd Pique */
625*84e872a0SLloyd Pique /**
626*84e872a0SLloyd Pique * @defgroup iface_wl_keyboard The wl_keyboard interface
627*84e872a0SLloyd Pique *
628*84e872a0SLloyd Pique * The wl_keyboard interface represents one or more keyboards
629*84e872a0SLloyd Pique * associated with a seat.
630*84e872a0SLloyd Pique */
631*84e872a0SLloyd Pique extern const struct wl_interface wl_keyboard_interface;
632*84e872a0SLloyd Pique #endif
633*84e872a0SLloyd Pique #ifndef WL_TOUCH_INTERFACE
634*84e872a0SLloyd Pique #define WL_TOUCH_INTERFACE
635*84e872a0SLloyd Pique /**
636*84e872a0SLloyd Pique * @page page_iface_wl_touch wl_touch
637*84e872a0SLloyd Pique * @section page_iface_wl_touch_desc Description
638*84e872a0SLloyd Pique *
639*84e872a0SLloyd Pique * The wl_touch interface represents a touchscreen
640*84e872a0SLloyd Pique * associated with a seat.
641*84e872a0SLloyd Pique *
642*84e872a0SLloyd Pique * Touch interactions can consist of one or more contacts.
643*84e872a0SLloyd Pique * For each contact, a series of events is generated, starting
644*84e872a0SLloyd Pique * with a down event, followed by zero or more motion events,
645*84e872a0SLloyd Pique * and ending with an up event. Events relating to the same
646*84e872a0SLloyd Pique * contact point can be identified by the ID of the sequence.
647*84e872a0SLloyd Pique * @section page_iface_wl_touch_api API
648*84e872a0SLloyd Pique * See @ref iface_wl_touch.
649*84e872a0SLloyd Pique */
650*84e872a0SLloyd Pique /**
651*84e872a0SLloyd Pique * @defgroup iface_wl_touch The wl_touch interface
652*84e872a0SLloyd Pique *
653*84e872a0SLloyd Pique * The wl_touch interface represents a touchscreen
654*84e872a0SLloyd Pique * associated with a seat.
655*84e872a0SLloyd Pique *
656*84e872a0SLloyd Pique * Touch interactions can consist of one or more contacts.
657*84e872a0SLloyd Pique * For each contact, a series of events is generated, starting
658*84e872a0SLloyd Pique * with a down event, followed by zero or more motion events,
659*84e872a0SLloyd Pique * and ending with an up event. Events relating to the same
660*84e872a0SLloyd Pique * contact point can be identified by the ID of the sequence.
661*84e872a0SLloyd Pique */
662*84e872a0SLloyd Pique extern const struct wl_interface wl_touch_interface;
663*84e872a0SLloyd Pique #endif
664*84e872a0SLloyd Pique #ifndef WL_OUTPUT_INTERFACE
665*84e872a0SLloyd Pique #define WL_OUTPUT_INTERFACE
666*84e872a0SLloyd Pique /**
667*84e872a0SLloyd Pique * @page page_iface_wl_output wl_output
668*84e872a0SLloyd Pique * @section page_iface_wl_output_desc Description
669*84e872a0SLloyd Pique *
670*84e872a0SLloyd Pique * An output describes part of the compositor geometry. The
671*84e872a0SLloyd Pique * compositor works in the 'compositor coordinate system' and an
672*84e872a0SLloyd Pique * output corresponds to a rectangular area in that space that is
673*84e872a0SLloyd Pique * actually visible. This typically corresponds to a monitor that
674*84e872a0SLloyd Pique * displays part of the compositor space. This object is published
675*84e872a0SLloyd Pique * as global during start up, or when a monitor is hotplugged.
676*84e872a0SLloyd Pique * @section page_iface_wl_output_api API
677*84e872a0SLloyd Pique * See @ref iface_wl_output.
678*84e872a0SLloyd Pique */
679*84e872a0SLloyd Pique /**
680*84e872a0SLloyd Pique * @defgroup iface_wl_output The wl_output interface
681*84e872a0SLloyd Pique *
682*84e872a0SLloyd Pique * An output describes part of the compositor geometry. The
683*84e872a0SLloyd Pique * compositor works in the 'compositor coordinate system' and an
684*84e872a0SLloyd Pique * output corresponds to a rectangular area in that space that is
685*84e872a0SLloyd Pique * actually visible. This typically corresponds to a monitor that
686*84e872a0SLloyd Pique * displays part of the compositor space. This object is published
687*84e872a0SLloyd Pique * as global during start up, or when a monitor is hotplugged.
688*84e872a0SLloyd Pique */
689*84e872a0SLloyd Pique extern const struct wl_interface wl_output_interface;
690*84e872a0SLloyd Pique #endif
691*84e872a0SLloyd Pique #ifndef WL_REGION_INTERFACE
692*84e872a0SLloyd Pique #define WL_REGION_INTERFACE
693*84e872a0SLloyd Pique /**
694*84e872a0SLloyd Pique * @page page_iface_wl_region wl_region
695*84e872a0SLloyd Pique * @section page_iface_wl_region_desc Description
696*84e872a0SLloyd Pique *
697*84e872a0SLloyd Pique * A region object describes an area.
698*84e872a0SLloyd Pique *
699*84e872a0SLloyd Pique * Region objects are used to describe the opaque and input
700*84e872a0SLloyd Pique * regions of a surface.
701*84e872a0SLloyd Pique * @section page_iface_wl_region_api API
702*84e872a0SLloyd Pique * See @ref iface_wl_region.
703*84e872a0SLloyd Pique */
704*84e872a0SLloyd Pique /**
705*84e872a0SLloyd Pique * @defgroup iface_wl_region The wl_region interface
706*84e872a0SLloyd Pique *
707*84e872a0SLloyd Pique * A region object describes an area.
708*84e872a0SLloyd Pique *
709*84e872a0SLloyd Pique * Region objects are used to describe the opaque and input
710*84e872a0SLloyd Pique * regions of a surface.
711*84e872a0SLloyd Pique */
712*84e872a0SLloyd Pique extern const struct wl_interface wl_region_interface;
713*84e872a0SLloyd Pique #endif
714*84e872a0SLloyd Pique #ifndef WL_SUBCOMPOSITOR_INTERFACE
715*84e872a0SLloyd Pique #define WL_SUBCOMPOSITOR_INTERFACE
716*84e872a0SLloyd Pique /**
717*84e872a0SLloyd Pique * @page page_iface_wl_subcompositor wl_subcompositor
718*84e872a0SLloyd Pique * @section page_iface_wl_subcompositor_desc Description
719*84e872a0SLloyd Pique *
720*84e872a0SLloyd Pique * The global interface exposing sub-surface compositing capabilities.
721*84e872a0SLloyd Pique * A wl_surface, that has sub-surfaces associated, is called the
722*84e872a0SLloyd Pique * parent surface. Sub-surfaces can be arbitrarily nested and create
723*84e872a0SLloyd Pique * a tree of sub-surfaces.
724*84e872a0SLloyd Pique *
725*84e872a0SLloyd Pique * The root surface in a tree of sub-surfaces is the main
726*84e872a0SLloyd Pique * surface. The main surface cannot be a sub-surface, because
727*84e872a0SLloyd Pique * sub-surfaces must always have a parent.
728*84e872a0SLloyd Pique *
729*84e872a0SLloyd Pique * A main surface with its sub-surfaces forms a (compound) window.
730*84e872a0SLloyd Pique * For window management purposes, this set of wl_surface objects is
731*84e872a0SLloyd Pique * to be considered as a single window, and it should also behave as
732*84e872a0SLloyd Pique * such.
733*84e872a0SLloyd Pique *
734*84e872a0SLloyd Pique * The aim of sub-surfaces is to offload some of the compositing work
735*84e872a0SLloyd Pique * within a window from clients to the compositor. A prime example is
736*84e872a0SLloyd Pique * a video player with decorations and video in separate wl_surface
737*84e872a0SLloyd Pique * objects. This should allow the compositor to pass YUV video buffer
738*84e872a0SLloyd Pique * processing to dedicated overlay hardware when possible.
739*84e872a0SLloyd Pique * @section page_iface_wl_subcompositor_api API
740*84e872a0SLloyd Pique * See @ref iface_wl_subcompositor.
741*84e872a0SLloyd Pique */
742*84e872a0SLloyd Pique /**
743*84e872a0SLloyd Pique * @defgroup iface_wl_subcompositor The wl_subcompositor interface
744*84e872a0SLloyd Pique *
745*84e872a0SLloyd Pique * The global interface exposing sub-surface compositing capabilities.
746*84e872a0SLloyd Pique * A wl_surface, that has sub-surfaces associated, is called the
747*84e872a0SLloyd Pique * parent surface. Sub-surfaces can be arbitrarily nested and create
748*84e872a0SLloyd Pique * a tree of sub-surfaces.
749*84e872a0SLloyd Pique *
750*84e872a0SLloyd Pique * The root surface in a tree of sub-surfaces is the main
751*84e872a0SLloyd Pique * surface. The main surface cannot be a sub-surface, because
752*84e872a0SLloyd Pique * sub-surfaces must always have a parent.
753*84e872a0SLloyd Pique *
754*84e872a0SLloyd Pique * A main surface with its sub-surfaces forms a (compound) window.
755*84e872a0SLloyd Pique * For window management purposes, this set of wl_surface objects is
756*84e872a0SLloyd Pique * to be considered as a single window, and it should also behave as
757*84e872a0SLloyd Pique * such.
758*84e872a0SLloyd Pique *
759*84e872a0SLloyd Pique * The aim of sub-surfaces is to offload some of the compositing work
760*84e872a0SLloyd Pique * within a window from clients to the compositor. A prime example is
761*84e872a0SLloyd Pique * a video player with decorations and video in separate wl_surface
762*84e872a0SLloyd Pique * objects. This should allow the compositor to pass YUV video buffer
763*84e872a0SLloyd Pique * processing to dedicated overlay hardware when possible.
764*84e872a0SLloyd Pique */
765*84e872a0SLloyd Pique extern const struct wl_interface wl_subcompositor_interface;
766*84e872a0SLloyd Pique #endif
767*84e872a0SLloyd Pique #ifndef WL_SUBSURFACE_INTERFACE
768*84e872a0SLloyd Pique #define WL_SUBSURFACE_INTERFACE
769*84e872a0SLloyd Pique /**
770*84e872a0SLloyd Pique * @page page_iface_wl_subsurface wl_subsurface
771*84e872a0SLloyd Pique * @section page_iface_wl_subsurface_desc Description
772*84e872a0SLloyd Pique *
773*84e872a0SLloyd Pique * An additional interface to a wl_surface object, which has been
774*84e872a0SLloyd Pique * made a sub-surface. A sub-surface has one parent surface. A
775*84e872a0SLloyd Pique * sub-surface's size and position are not limited to that of the parent.
776*84e872a0SLloyd Pique * Particularly, a sub-surface is not automatically clipped to its
777*84e872a0SLloyd Pique * parent's area.
778*84e872a0SLloyd Pique *
779*84e872a0SLloyd Pique * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
780*84e872a0SLloyd Pique * and the parent surface is mapped. The order of which one happens
781*84e872a0SLloyd Pique * first is irrelevant. A sub-surface is hidden if the parent becomes
782*84e872a0SLloyd Pique * hidden, or if a NULL wl_buffer is applied. These rules apply
783*84e872a0SLloyd Pique * recursively through the tree of surfaces.
784*84e872a0SLloyd Pique *
785*84e872a0SLloyd Pique * The behaviour of a wl_surface.commit request on a sub-surface
786*84e872a0SLloyd Pique * depends on the sub-surface's mode. The possible modes are
787*84e872a0SLloyd Pique * synchronized and desynchronized, see methods
788*84e872a0SLloyd Pique * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
789*84e872a0SLloyd Pique * mode caches the wl_surface state to be applied when the parent's
790*84e872a0SLloyd Pique * state gets applied, and desynchronized mode applies the pending
791*84e872a0SLloyd Pique * wl_surface state directly. A sub-surface is initially in the
792*84e872a0SLloyd Pique * synchronized mode.
793*84e872a0SLloyd Pique *
794*84e872a0SLloyd Pique * Sub-surfaces have also other kind of state, which is managed by
795*84e872a0SLloyd Pique * wl_subsurface requests, as opposed to wl_surface requests. This
796*84e872a0SLloyd Pique * state includes the sub-surface position relative to the parent
797*84e872a0SLloyd Pique * surface (wl_subsurface.set_position), and the stacking order of
798*84e872a0SLloyd Pique * the parent and its sub-surfaces (wl_subsurface.place_above and
799*84e872a0SLloyd Pique * .place_below). This state is applied when the parent surface's
800*84e872a0SLloyd Pique * wl_surface state is applied, regardless of the sub-surface's mode.
801*84e872a0SLloyd Pique * As the exception, set_sync and set_desync are effective immediately.
802*84e872a0SLloyd Pique *
803*84e872a0SLloyd Pique * The main surface can be thought to be always in desynchronized mode,
804*84e872a0SLloyd Pique * since it does not have a parent in the sub-surfaces sense.
805*84e872a0SLloyd Pique *
806*84e872a0SLloyd Pique * Even if a sub-surface is in desynchronized mode, it will behave as
807*84e872a0SLloyd Pique * in synchronized mode, if its parent surface behaves as in
808*84e872a0SLloyd Pique * synchronized mode. This rule is applied recursively throughout the
809*84e872a0SLloyd Pique * tree of surfaces. This means, that one can set a sub-surface into
810*84e872a0SLloyd Pique * synchronized mode, and then assume that all its child and grand-child
811*84e872a0SLloyd Pique * sub-surfaces are synchronized, too, without explicitly setting them.
812*84e872a0SLloyd Pique *
813*84e872a0SLloyd Pique * If the wl_surface associated with the wl_subsurface is destroyed, the
814*84e872a0SLloyd Pique * wl_subsurface object becomes inert. Note, that destroying either object
815*84e872a0SLloyd Pique * takes effect immediately. If you need to synchronize the removal
816*84e872a0SLloyd Pique * of a sub-surface to the parent surface update, unmap the sub-surface
817*84e872a0SLloyd Pique * first by attaching a NULL wl_buffer, update parent, and then destroy
818*84e872a0SLloyd Pique * the sub-surface.
819*84e872a0SLloyd Pique *
820*84e872a0SLloyd Pique * If the parent wl_surface object is destroyed, the sub-surface is
821*84e872a0SLloyd Pique * unmapped.
822*84e872a0SLloyd Pique * @section page_iface_wl_subsurface_api API
823*84e872a0SLloyd Pique * See @ref iface_wl_subsurface.
824*84e872a0SLloyd Pique */
825*84e872a0SLloyd Pique /**
826*84e872a0SLloyd Pique * @defgroup iface_wl_subsurface The wl_subsurface interface
827*84e872a0SLloyd Pique *
828*84e872a0SLloyd Pique * An additional interface to a wl_surface object, which has been
829*84e872a0SLloyd Pique * made a sub-surface. A sub-surface has one parent surface. A
830*84e872a0SLloyd Pique * sub-surface's size and position are not limited to that of the parent.
831*84e872a0SLloyd Pique * Particularly, a sub-surface is not automatically clipped to its
832*84e872a0SLloyd Pique * parent's area.
833*84e872a0SLloyd Pique *
834*84e872a0SLloyd Pique * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
835*84e872a0SLloyd Pique * and the parent surface is mapped. The order of which one happens
836*84e872a0SLloyd Pique * first is irrelevant. A sub-surface is hidden if the parent becomes
837*84e872a0SLloyd Pique * hidden, or if a NULL wl_buffer is applied. These rules apply
838*84e872a0SLloyd Pique * recursively through the tree of surfaces.
839*84e872a0SLloyd Pique *
840*84e872a0SLloyd Pique * The behaviour of a wl_surface.commit request on a sub-surface
841*84e872a0SLloyd Pique * depends on the sub-surface's mode. The possible modes are
842*84e872a0SLloyd Pique * synchronized and desynchronized, see methods
843*84e872a0SLloyd Pique * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
844*84e872a0SLloyd Pique * mode caches the wl_surface state to be applied when the parent's
845*84e872a0SLloyd Pique * state gets applied, and desynchronized mode applies the pending
846*84e872a0SLloyd Pique * wl_surface state directly. A sub-surface is initially in the
847*84e872a0SLloyd Pique * synchronized mode.
848*84e872a0SLloyd Pique *
849*84e872a0SLloyd Pique * Sub-surfaces have also other kind of state, which is managed by
850*84e872a0SLloyd Pique * wl_subsurface requests, as opposed to wl_surface requests. This
851*84e872a0SLloyd Pique * state includes the sub-surface position relative to the parent
852*84e872a0SLloyd Pique * surface (wl_subsurface.set_position), and the stacking order of
853*84e872a0SLloyd Pique * the parent and its sub-surfaces (wl_subsurface.place_above and
854*84e872a0SLloyd Pique * .place_below). This state is applied when the parent surface's
855*84e872a0SLloyd Pique * wl_surface state is applied, regardless of the sub-surface's mode.
856*84e872a0SLloyd Pique * As the exception, set_sync and set_desync are effective immediately.
857*84e872a0SLloyd Pique *
858*84e872a0SLloyd Pique * The main surface can be thought to be always in desynchronized mode,
859*84e872a0SLloyd Pique * since it does not have a parent in the sub-surfaces sense.
860*84e872a0SLloyd Pique *
861*84e872a0SLloyd Pique * Even if a sub-surface is in desynchronized mode, it will behave as
862*84e872a0SLloyd Pique * in synchronized mode, if its parent surface behaves as in
863*84e872a0SLloyd Pique * synchronized mode. This rule is applied recursively throughout the
864*84e872a0SLloyd Pique * tree of surfaces. This means, that one can set a sub-surface into
865*84e872a0SLloyd Pique * synchronized mode, and then assume that all its child and grand-child
866*84e872a0SLloyd Pique * sub-surfaces are synchronized, too, without explicitly setting them.
867*84e872a0SLloyd Pique *
868*84e872a0SLloyd Pique * If the wl_surface associated with the wl_subsurface is destroyed, the
869*84e872a0SLloyd Pique * wl_subsurface object becomes inert. Note, that destroying either object
870*84e872a0SLloyd Pique * takes effect immediately. If you need to synchronize the removal
871*84e872a0SLloyd Pique * of a sub-surface to the parent surface update, unmap the sub-surface
872*84e872a0SLloyd Pique * first by attaching a NULL wl_buffer, update parent, and then destroy
873*84e872a0SLloyd Pique * the sub-surface.
874*84e872a0SLloyd Pique *
875*84e872a0SLloyd Pique * If the parent wl_surface object is destroyed, the sub-surface is
876*84e872a0SLloyd Pique * unmapped.
877*84e872a0SLloyd Pique */
878*84e872a0SLloyd Pique extern const struct wl_interface wl_subsurface_interface;
879*84e872a0SLloyd Pique #endif
880*84e872a0SLloyd Pique
881*84e872a0SLloyd Pique #ifndef WL_DISPLAY_ERROR_ENUM
882*84e872a0SLloyd Pique #define WL_DISPLAY_ERROR_ENUM
883*84e872a0SLloyd Pique /**
884*84e872a0SLloyd Pique * @ingroup iface_wl_display
885*84e872a0SLloyd Pique * global error values
886*84e872a0SLloyd Pique *
887*84e872a0SLloyd Pique * These errors are global and can be emitted in response to any
888*84e872a0SLloyd Pique * server request.
889*84e872a0SLloyd Pique */
890*84e872a0SLloyd Pique enum wl_display_error {
891*84e872a0SLloyd Pique /**
892*84e872a0SLloyd Pique * server couldn't find object
893*84e872a0SLloyd Pique */
894*84e872a0SLloyd Pique WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
895*84e872a0SLloyd Pique /**
896*84e872a0SLloyd Pique * method doesn't exist on the specified interface
897*84e872a0SLloyd Pique */
898*84e872a0SLloyd Pique WL_DISPLAY_ERROR_INVALID_METHOD = 1,
899*84e872a0SLloyd Pique /**
900*84e872a0SLloyd Pique * server is out of memory
901*84e872a0SLloyd Pique */
902*84e872a0SLloyd Pique WL_DISPLAY_ERROR_NO_MEMORY = 2,
903*84e872a0SLloyd Pique };
904*84e872a0SLloyd Pique #endif /* WL_DISPLAY_ERROR_ENUM */
905*84e872a0SLloyd Pique
906*84e872a0SLloyd Pique /**
907*84e872a0SLloyd Pique * @ingroup iface_wl_display
908*84e872a0SLloyd Pique * @struct wl_display_interface
909*84e872a0SLloyd Pique */
910*84e872a0SLloyd Pique struct wl_display_interface {
911*84e872a0SLloyd Pique /**
912*84e872a0SLloyd Pique * asynchronous roundtrip
913*84e872a0SLloyd Pique *
914*84e872a0SLloyd Pique * The sync request asks the server to emit the 'done' event on
915*84e872a0SLloyd Pique * the returned wl_callback object. Since requests are handled
916*84e872a0SLloyd Pique * in-order and events are delivered in-order, this can be used as
917*84e872a0SLloyd Pique * a barrier to ensure all previous requests and the resulting
918*84e872a0SLloyd Pique * events have been handled.
919*84e872a0SLloyd Pique *
920*84e872a0SLloyd Pique * The object returned by this request will be destroyed by the
921*84e872a0SLloyd Pique * compositor after the callback is fired and as such the client
922*84e872a0SLloyd Pique * must not attempt to use it after that point.
923*84e872a0SLloyd Pique *
924*84e872a0SLloyd Pique * The callback_data passed in the callback is the event serial.
925*84e872a0SLloyd Pique * @param callback callback object for the sync request
926*84e872a0SLloyd Pique */
927*84e872a0SLloyd Pique void (*sync)(struct wl_client *client,
928*84e872a0SLloyd Pique struct wl_resource *resource,
929*84e872a0SLloyd Pique uint32_t callback);
930*84e872a0SLloyd Pique /**
931*84e872a0SLloyd Pique * get global registry object
932*84e872a0SLloyd Pique *
933*84e872a0SLloyd Pique * This request creates a registry object that allows the client
934*84e872a0SLloyd Pique * to list and bind the global objects available from the
935*84e872a0SLloyd Pique * compositor.
936*84e872a0SLloyd Pique * @param registry global registry object
937*84e872a0SLloyd Pique */
938*84e872a0SLloyd Pique void (*get_registry)(struct wl_client *client,
939*84e872a0SLloyd Pique struct wl_resource *resource,
940*84e872a0SLloyd Pique uint32_t registry);
941*84e872a0SLloyd Pique };
942*84e872a0SLloyd Pique
943*84e872a0SLloyd Pique #define WL_DISPLAY_ERROR 0
944*84e872a0SLloyd Pique #define WL_DISPLAY_DELETE_ID 1
945*84e872a0SLloyd Pique
946*84e872a0SLloyd Pique /**
947*84e872a0SLloyd Pique * @ingroup iface_wl_display
948*84e872a0SLloyd Pique */
949*84e872a0SLloyd Pique #define WL_DISPLAY_ERROR_SINCE_VERSION 1
950*84e872a0SLloyd Pique /**
951*84e872a0SLloyd Pique * @ingroup iface_wl_display
952*84e872a0SLloyd Pique */
953*84e872a0SLloyd Pique #define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1
954*84e872a0SLloyd Pique
955*84e872a0SLloyd Pique /**
956*84e872a0SLloyd Pique * @ingroup iface_wl_display
957*84e872a0SLloyd Pique */
958*84e872a0SLloyd Pique #define WL_DISPLAY_SYNC_SINCE_VERSION 1
959*84e872a0SLloyd Pique /**
960*84e872a0SLloyd Pique * @ingroup iface_wl_display
961*84e872a0SLloyd Pique */
962*84e872a0SLloyd Pique #define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1
963*84e872a0SLloyd Pique
964*84e872a0SLloyd Pique /**
965*84e872a0SLloyd Pique * @ingroup iface_wl_registry
966*84e872a0SLloyd Pique * @struct wl_registry_interface
967*84e872a0SLloyd Pique */
968*84e872a0SLloyd Pique struct wl_registry_interface {
969*84e872a0SLloyd Pique /**
970*84e872a0SLloyd Pique * bind an object to the display
971*84e872a0SLloyd Pique *
972*84e872a0SLloyd Pique * Binds a new, client-created object to the server using the
973*84e872a0SLloyd Pique * specified name as the identifier.
974*84e872a0SLloyd Pique * @param name unique numeric name of the object
975*84e872a0SLloyd Pique * @param interface name of the objects interface
976*84e872a0SLloyd Pique * @param version version of the objects interface
977*84e872a0SLloyd Pique * @param id bounded object
978*84e872a0SLloyd Pique */
979*84e872a0SLloyd Pique void (*bind)(struct wl_client *client,
980*84e872a0SLloyd Pique struct wl_resource *resource,
981*84e872a0SLloyd Pique uint32_t name,
982*84e872a0SLloyd Pique const char *interface, uint32_t version, uint32_t id);
983*84e872a0SLloyd Pique };
984*84e872a0SLloyd Pique
985*84e872a0SLloyd Pique #define WL_REGISTRY_GLOBAL 0
986*84e872a0SLloyd Pique #define WL_REGISTRY_GLOBAL_REMOVE 1
987*84e872a0SLloyd Pique
988*84e872a0SLloyd Pique /**
989*84e872a0SLloyd Pique * @ingroup iface_wl_registry
990*84e872a0SLloyd Pique */
991*84e872a0SLloyd Pique #define WL_REGISTRY_GLOBAL_SINCE_VERSION 1
992*84e872a0SLloyd Pique /**
993*84e872a0SLloyd Pique * @ingroup iface_wl_registry
994*84e872a0SLloyd Pique */
995*84e872a0SLloyd Pique #define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1
996*84e872a0SLloyd Pique
997*84e872a0SLloyd Pique /**
998*84e872a0SLloyd Pique * @ingroup iface_wl_registry
999*84e872a0SLloyd Pique */
1000*84e872a0SLloyd Pique #define WL_REGISTRY_BIND_SINCE_VERSION 1
1001*84e872a0SLloyd Pique
1002*84e872a0SLloyd Pique /**
1003*84e872a0SLloyd Pique * @ingroup iface_wl_registry
1004*84e872a0SLloyd Pique * Sends an global event to the client owning the resource.
1005*84e872a0SLloyd Pique * @param resource_ The client's resource
1006*84e872a0SLloyd Pique * @param name numeric name of the global object
1007*84e872a0SLloyd Pique * @param interface interface implemented by the object
1008*84e872a0SLloyd Pique * @param version interface version
1009*84e872a0SLloyd Pique */
1010*84e872a0SLloyd Pique static inline void
wl_registry_send_global(struct wl_resource * resource_,uint32_t name,const char * interface,uint32_t version)1011*84e872a0SLloyd Pique wl_registry_send_global(struct wl_resource *resource_, uint32_t name, const char *interface, uint32_t version)
1012*84e872a0SLloyd Pique {
1013*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL, name, interface, version);
1014*84e872a0SLloyd Pique }
1015*84e872a0SLloyd Pique
1016*84e872a0SLloyd Pique /**
1017*84e872a0SLloyd Pique * @ingroup iface_wl_registry
1018*84e872a0SLloyd Pique * Sends an global_remove event to the client owning the resource.
1019*84e872a0SLloyd Pique * @param resource_ The client's resource
1020*84e872a0SLloyd Pique * @param name numeric name of the global object
1021*84e872a0SLloyd Pique */
1022*84e872a0SLloyd Pique static inline void
wl_registry_send_global_remove(struct wl_resource * resource_,uint32_t name)1023*84e872a0SLloyd Pique wl_registry_send_global_remove(struct wl_resource *resource_, uint32_t name)
1024*84e872a0SLloyd Pique {
1025*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL_REMOVE, name);
1026*84e872a0SLloyd Pique }
1027*84e872a0SLloyd Pique
1028*84e872a0SLloyd Pique #define WL_CALLBACK_DONE 0
1029*84e872a0SLloyd Pique
1030*84e872a0SLloyd Pique /**
1031*84e872a0SLloyd Pique * @ingroup iface_wl_callback
1032*84e872a0SLloyd Pique */
1033*84e872a0SLloyd Pique #define WL_CALLBACK_DONE_SINCE_VERSION 1
1034*84e872a0SLloyd Pique
1035*84e872a0SLloyd Pique
1036*84e872a0SLloyd Pique /**
1037*84e872a0SLloyd Pique * @ingroup iface_wl_callback
1038*84e872a0SLloyd Pique * Sends an done event to the client owning the resource.
1039*84e872a0SLloyd Pique * @param resource_ The client's resource
1040*84e872a0SLloyd Pique * @param callback_data request-specific data for the callback
1041*84e872a0SLloyd Pique */
1042*84e872a0SLloyd Pique static inline void
wl_callback_send_done(struct wl_resource * resource_,uint32_t callback_data)1043*84e872a0SLloyd Pique wl_callback_send_done(struct wl_resource *resource_, uint32_t callback_data)
1044*84e872a0SLloyd Pique {
1045*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_CALLBACK_DONE, callback_data);
1046*84e872a0SLloyd Pique }
1047*84e872a0SLloyd Pique
1048*84e872a0SLloyd Pique /**
1049*84e872a0SLloyd Pique * @ingroup iface_wl_compositor
1050*84e872a0SLloyd Pique * @struct wl_compositor_interface
1051*84e872a0SLloyd Pique */
1052*84e872a0SLloyd Pique struct wl_compositor_interface {
1053*84e872a0SLloyd Pique /**
1054*84e872a0SLloyd Pique * create new surface
1055*84e872a0SLloyd Pique *
1056*84e872a0SLloyd Pique * Ask the compositor to create a new surface.
1057*84e872a0SLloyd Pique * @param id the new surface
1058*84e872a0SLloyd Pique */
1059*84e872a0SLloyd Pique void (*create_surface)(struct wl_client *client,
1060*84e872a0SLloyd Pique struct wl_resource *resource,
1061*84e872a0SLloyd Pique uint32_t id);
1062*84e872a0SLloyd Pique /**
1063*84e872a0SLloyd Pique * create new region
1064*84e872a0SLloyd Pique *
1065*84e872a0SLloyd Pique * Ask the compositor to create a new region.
1066*84e872a0SLloyd Pique * @param id the new region
1067*84e872a0SLloyd Pique */
1068*84e872a0SLloyd Pique void (*create_region)(struct wl_client *client,
1069*84e872a0SLloyd Pique struct wl_resource *resource,
1070*84e872a0SLloyd Pique uint32_t id);
1071*84e872a0SLloyd Pique };
1072*84e872a0SLloyd Pique
1073*84e872a0SLloyd Pique
1074*84e872a0SLloyd Pique /**
1075*84e872a0SLloyd Pique * @ingroup iface_wl_compositor
1076*84e872a0SLloyd Pique */
1077*84e872a0SLloyd Pique #define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1
1078*84e872a0SLloyd Pique /**
1079*84e872a0SLloyd Pique * @ingroup iface_wl_compositor
1080*84e872a0SLloyd Pique */
1081*84e872a0SLloyd Pique #define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1
1082*84e872a0SLloyd Pique
1083*84e872a0SLloyd Pique /**
1084*84e872a0SLloyd Pique * @ingroup iface_wl_shm_pool
1085*84e872a0SLloyd Pique * @struct wl_shm_pool_interface
1086*84e872a0SLloyd Pique */
1087*84e872a0SLloyd Pique struct wl_shm_pool_interface {
1088*84e872a0SLloyd Pique /**
1089*84e872a0SLloyd Pique * create a buffer from the pool
1090*84e872a0SLloyd Pique *
1091*84e872a0SLloyd Pique * Create a wl_buffer object from the pool.
1092*84e872a0SLloyd Pique *
1093*84e872a0SLloyd Pique * The buffer is created offset bytes into the pool and has width
1094*84e872a0SLloyd Pique * and height as specified. The stride argument specifies the
1095*84e872a0SLloyd Pique * number of bytes from the beginning of one row to the beginning
1096*84e872a0SLloyd Pique * of the next. The format is the pixel format of the buffer and
1097*84e872a0SLloyd Pique * must be one of those advertised through the wl_shm.format event.
1098*84e872a0SLloyd Pique *
1099*84e872a0SLloyd Pique * A buffer will keep a reference to the pool it was created from
1100*84e872a0SLloyd Pique * so it is valid to destroy the pool immediately after creating a
1101*84e872a0SLloyd Pique * buffer from it.
1102*84e872a0SLloyd Pique * @param id buffer to create
1103*84e872a0SLloyd Pique * @param offset buffer byte offset within the pool
1104*84e872a0SLloyd Pique * @param width buffer width, in pixels
1105*84e872a0SLloyd Pique * @param height buffer height, in pixels
1106*84e872a0SLloyd Pique * @param stride number of bytes from the beginning of one row to the beginning of the next row
1107*84e872a0SLloyd Pique * @param format buffer pixel format
1108*84e872a0SLloyd Pique */
1109*84e872a0SLloyd Pique void (*create_buffer)(struct wl_client *client,
1110*84e872a0SLloyd Pique struct wl_resource *resource,
1111*84e872a0SLloyd Pique uint32_t id,
1112*84e872a0SLloyd Pique int32_t offset,
1113*84e872a0SLloyd Pique int32_t width,
1114*84e872a0SLloyd Pique int32_t height,
1115*84e872a0SLloyd Pique int32_t stride,
1116*84e872a0SLloyd Pique uint32_t format);
1117*84e872a0SLloyd Pique /**
1118*84e872a0SLloyd Pique * destroy the pool
1119*84e872a0SLloyd Pique *
1120*84e872a0SLloyd Pique * Destroy the shared memory pool.
1121*84e872a0SLloyd Pique *
1122*84e872a0SLloyd Pique * The mmapped memory will be released when all buffers that have
1123*84e872a0SLloyd Pique * been created from this pool are gone.
1124*84e872a0SLloyd Pique */
1125*84e872a0SLloyd Pique void (*destroy)(struct wl_client *client,
1126*84e872a0SLloyd Pique struct wl_resource *resource);
1127*84e872a0SLloyd Pique /**
1128*84e872a0SLloyd Pique * change the size of the pool mapping
1129*84e872a0SLloyd Pique *
1130*84e872a0SLloyd Pique * This request will cause the server to remap the backing memory
1131*84e872a0SLloyd Pique * for the pool from the file descriptor passed when the pool was
1132*84e872a0SLloyd Pique * created, but using the new size. This request can only be used
1133*84e872a0SLloyd Pique * to make the pool bigger.
1134*84e872a0SLloyd Pique * @param size new size of the pool, in bytes
1135*84e872a0SLloyd Pique */
1136*84e872a0SLloyd Pique void (*resize)(struct wl_client *client,
1137*84e872a0SLloyd Pique struct wl_resource *resource,
1138*84e872a0SLloyd Pique int32_t size);
1139*84e872a0SLloyd Pique };
1140*84e872a0SLloyd Pique
1141*84e872a0SLloyd Pique
1142*84e872a0SLloyd Pique /**
1143*84e872a0SLloyd Pique * @ingroup iface_wl_shm_pool
1144*84e872a0SLloyd Pique */
1145*84e872a0SLloyd Pique #define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1
1146*84e872a0SLloyd Pique /**
1147*84e872a0SLloyd Pique * @ingroup iface_wl_shm_pool
1148*84e872a0SLloyd Pique */
1149*84e872a0SLloyd Pique #define WL_SHM_POOL_DESTROY_SINCE_VERSION 1
1150*84e872a0SLloyd Pique /**
1151*84e872a0SLloyd Pique * @ingroup iface_wl_shm_pool
1152*84e872a0SLloyd Pique */
1153*84e872a0SLloyd Pique #define WL_SHM_POOL_RESIZE_SINCE_VERSION 1
1154*84e872a0SLloyd Pique
1155*84e872a0SLloyd Pique #ifndef WL_SHM_ERROR_ENUM
1156*84e872a0SLloyd Pique #define WL_SHM_ERROR_ENUM
1157*84e872a0SLloyd Pique /**
1158*84e872a0SLloyd Pique * @ingroup iface_wl_shm
1159*84e872a0SLloyd Pique * wl_shm error values
1160*84e872a0SLloyd Pique *
1161*84e872a0SLloyd Pique * These errors can be emitted in response to wl_shm requests.
1162*84e872a0SLloyd Pique */
1163*84e872a0SLloyd Pique enum wl_shm_error {
1164*84e872a0SLloyd Pique /**
1165*84e872a0SLloyd Pique * buffer format is not known
1166*84e872a0SLloyd Pique */
1167*84e872a0SLloyd Pique WL_SHM_ERROR_INVALID_FORMAT = 0,
1168*84e872a0SLloyd Pique /**
1169*84e872a0SLloyd Pique * invalid size or stride during pool or buffer creation
1170*84e872a0SLloyd Pique */
1171*84e872a0SLloyd Pique WL_SHM_ERROR_INVALID_STRIDE = 1,
1172*84e872a0SLloyd Pique /**
1173*84e872a0SLloyd Pique * mmapping the file descriptor failed
1174*84e872a0SLloyd Pique */
1175*84e872a0SLloyd Pique WL_SHM_ERROR_INVALID_FD = 2,
1176*84e872a0SLloyd Pique };
1177*84e872a0SLloyd Pique #endif /* WL_SHM_ERROR_ENUM */
1178*84e872a0SLloyd Pique
1179*84e872a0SLloyd Pique #ifndef WL_SHM_FORMAT_ENUM
1180*84e872a0SLloyd Pique #define WL_SHM_FORMAT_ENUM
1181*84e872a0SLloyd Pique /**
1182*84e872a0SLloyd Pique * @ingroup iface_wl_shm
1183*84e872a0SLloyd Pique * pixel formats
1184*84e872a0SLloyd Pique *
1185*84e872a0SLloyd Pique * This describes the memory layout of an individual pixel.
1186*84e872a0SLloyd Pique *
1187*84e872a0SLloyd Pique * All renderers should support argb8888 and xrgb8888 but any other
1188*84e872a0SLloyd Pique * formats are optional and may not be supported by the particular
1189*84e872a0SLloyd Pique * renderer in use.
1190*84e872a0SLloyd Pique *
1191*84e872a0SLloyd Pique * The drm format codes match the macros defined in drm_fourcc.h.
1192*84e872a0SLloyd Pique * The formats actually supported by the compositor will be
1193*84e872a0SLloyd Pique * reported by the format event.
1194*84e872a0SLloyd Pique */
1195*84e872a0SLloyd Pique enum wl_shm_format {
1196*84e872a0SLloyd Pique /**
1197*84e872a0SLloyd Pique * 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian
1198*84e872a0SLloyd Pique */
1199*84e872a0SLloyd Pique WL_SHM_FORMAT_ARGB8888 = 0,
1200*84e872a0SLloyd Pique /**
1201*84e872a0SLloyd Pique * 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian
1202*84e872a0SLloyd Pique */
1203*84e872a0SLloyd Pique WL_SHM_FORMAT_XRGB8888 = 1,
1204*84e872a0SLloyd Pique /**
1205*84e872a0SLloyd Pique * 8-bit color index format, [7:0] C
1206*84e872a0SLloyd Pique */
1207*84e872a0SLloyd Pique WL_SHM_FORMAT_C8 = 0x20203843,
1208*84e872a0SLloyd Pique /**
1209*84e872a0SLloyd Pique * 8-bit RGB format, [7:0] R:G:B 3:3:2
1210*84e872a0SLloyd Pique */
1211*84e872a0SLloyd Pique WL_SHM_FORMAT_RGB332 = 0x38424752,
1212*84e872a0SLloyd Pique /**
1213*84e872a0SLloyd Pique * 8-bit BGR format, [7:0] B:G:R 2:3:3
1214*84e872a0SLloyd Pique */
1215*84e872a0SLloyd Pique WL_SHM_FORMAT_BGR233 = 0x38524742,
1216*84e872a0SLloyd Pique /**
1217*84e872a0SLloyd Pique * 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian
1218*84e872a0SLloyd Pique */
1219*84e872a0SLloyd Pique WL_SHM_FORMAT_XRGB4444 = 0x32315258,
1220*84e872a0SLloyd Pique /**
1221*84e872a0SLloyd Pique * 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian
1222*84e872a0SLloyd Pique */
1223*84e872a0SLloyd Pique WL_SHM_FORMAT_XBGR4444 = 0x32314258,
1224*84e872a0SLloyd Pique /**
1225*84e872a0SLloyd Pique * 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian
1226*84e872a0SLloyd Pique */
1227*84e872a0SLloyd Pique WL_SHM_FORMAT_RGBX4444 = 0x32315852,
1228*84e872a0SLloyd Pique /**
1229*84e872a0SLloyd Pique * 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian
1230*84e872a0SLloyd Pique */
1231*84e872a0SLloyd Pique WL_SHM_FORMAT_BGRX4444 = 0x32315842,
1232*84e872a0SLloyd Pique /**
1233*84e872a0SLloyd Pique * 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian
1234*84e872a0SLloyd Pique */
1235*84e872a0SLloyd Pique WL_SHM_FORMAT_ARGB4444 = 0x32315241,
1236*84e872a0SLloyd Pique /**
1237*84e872a0SLloyd Pique * 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian
1238*84e872a0SLloyd Pique */
1239*84e872a0SLloyd Pique WL_SHM_FORMAT_ABGR4444 = 0x32314241,
1240*84e872a0SLloyd Pique /**
1241*84e872a0SLloyd Pique * 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian
1242*84e872a0SLloyd Pique */
1243*84e872a0SLloyd Pique WL_SHM_FORMAT_RGBA4444 = 0x32314152,
1244*84e872a0SLloyd Pique /**
1245*84e872a0SLloyd Pique * 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian
1246*84e872a0SLloyd Pique */
1247*84e872a0SLloyd Pique WL_SHM_FORMAT_BGRA4444 = 0x32314142,
1248*84e872a0SLloyd Pique /**
1249*84e872a0SLloyd Pique * 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian
1250*84e872a0SLloyd Pique */
1251*84e872a0SLloyd Pique WL_SHM_FORMAT_XRGB1555 = 0x35315258,
1252*84e872a0SLloyd Pique /**
1253*84e872a0SLloyd Pique * 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian
1254*84e872a0SLloyd Pique */
1255*84e872a0SLloyd Pique WL_SHM_FORMAT_XBGR1555 = 0x35314258,
1256*84e872a0SLloyd Pique /**
1257*84e872a0SLloyd Pique * 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian
1258*84e872a0SLloyd Pique */
1259*84e872a0SLloyd Pique WL_SHM_FORMAT_RGBX5551 = 0x35315852,
1260*84e872a0SLloyd Pique /**
1261*84e872a0SLloyd Pique * 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian
1262*84e872a0SLloyd Pique */
1263*84e872a0SLloyd Pique WL_SHM_FORMAT_BGRX5551 = 0x35315842,
1264*84e872a0SLloyd Pique /**
1265*84e872a0SLloyd Pique * 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian
1266*84e872a0SLloyd Pique */
1267*84e872a0SLloyd Pique WL_SHM_FORMAT_ARGB1555 = 0x35315241,
1268*84e872a0SLloyd Pique /**
1269*84e872a0SLloyd Pique * 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian
1270*84e872a0SLloyd Pique */
1271*84e872a0SLloyd Pique WL_SHM_FORMAT_ABGR1555 = 0x35314241,
1272*84e872a0SLloyd Pique /**
1273*84e872a0SLloyd Pique * 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian
1274*84e872a0SLloyd Pique */
1275*84e872a0SLloyd Pique WL_SHM_FORMAT_RGBA5551 = 0x35314152,
1276*84e872a0SLloyd Pique /**
1277*84e872a0SLloyd Pique * 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian
1278*84e872a0SLloyd Pique */
1279*84e872a0SLloyd Pique WL_SHM_FORMAT_BGRA5551 = 0x35314142,
1280*84e872a0SLloyd Pique /**
1281*84e872a0SLloyd Pique * 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian
1282*84e872a0SLloyd Pique */
1283*84e872a0SLloyd Pique WL_SHM_FORMAT_RGB565 = 0x36314752,
1284*84e872a0SLloyd Pique /**
1285*84e872a0SLloyd Pique * 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian
1286*84e872a0SLloyd Pique */
1287*84e872a0SLloyd Pique WL_SHM_FORMAT_BGR565 = 0x36314742,
1288*84e872a0SLloyd Pique /**
1289*84e872a0SLloyd Pique * 24-bit RGB format, [23:0] R:G:B little endian
1290*84e872a0SLloyd Pique */
1291*84e872a0SLloyd Pique WL_SHM_FORMAT_RGB888 = 0x34324752,
1292*84e872a0SLloyd Pique /**
1293*84e872a0SLloyd Pique * 24-bit BGR format, [23:0] B:G:R little endian
1294*84e872a0SLloyd Pique */
1295*84e872a0SLloyd Pique WL_SHM_FORMAT_BGR888 = 0x34324742,
1296*84e872a0SLloyd Pique /**
1297*84e872a0SLloyd Pique * 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian
1298*84e872a0SLloyd Pique */
1299*84e872a0SLloyd Pique WL_SHM_FORMAT_XBGR8888 = 0x34324258,
1300*84e872a0SLloyd Pique /**
1301*84e872a0SLloyd Pique * 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian
1302*84e872a0SLloyd Pique */
1303*84e872a0SLloyd Pique WL_SHM_FORMAT_RGBX8888 = 0x34325852,
1304*84e872a0SLloyd Pique /**
1305*84e872a0SLloyd Pique * 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian
1306*84e872a0SLloyd Pique */
1307*84e872a0SLloyd Pique WL_SHM_FORMAT_BGRX8888 = 0x34325842,
1308*84e872a0SLloyd Pique /**
1309*84e872a0SLloyd Pique * 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian
1310*84e872a0SLloyd Pique */
1311*84e872a0SLloyd Pique WL_SHM_FORMAT_ABGR8888 = 0x34324241,
1312*84e872a0SLloyd Pique /**
1313*84e872a0SLloyd Pique * 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian
1314*84e872a0SLloyd Pique */
1315*84e872a0SLloyd Pique WL_SHM_FORMAT_RGBA8888 = 0x34324152,
1316*84e872a0SLloyd Pique /**
1317*84e872a0SLloyd Pique * 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian
1318*84e872a0SLloyd Pique */
1319*84e872a0SLloyd Pique WL_SHM_FORMAT_BGRA8888 = 0x34324142,
1320*84e872a0SLloyd Pique /**
1321*84e872a0SLloyd Pique * 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian
1322*84e872a0SLloyd Pique */
1323*84e872a0SLloyd Pique WL_SHM_FORMAT_XRGB2101010 = 0x30335258,
1324*84e872a0SLloyd Pique /**
1325*84e872a0SLloyd Pique * 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian
1326*84e872a0SLloyd Pique */
1327*84e872a0SLloyd Pique WL_SHM_FORMAT_XBGR2101010 = 0x30334258,
1328*84e872a0SLloyd Pique /**
1329*84e872a0SLloyd Pique * 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian
1330*84e872a0SLloyd Pique */
1331*84e872a0SLloyd Pique WL_SHM_FORMAT_RGBX1010102 = 0x30335852,
1332*84e872a0SLloyd Pique /**
1333*84e872a0SLloyd Pique * 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian
1334*84e872a0SLloyd Pique */
1335*84e872a0SLloyd Pique WL_SHM_FORMAT_BGRX1010102 = 0x30335842,
1336*84e872a0SLloyd Pique /**
1337*84e872a0SLloyd Pique * 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian
1338*84e872a0SLloyd Pique */
1339*84e872a0SLloyd Pique WL_SHM_FORMAT_ARGB2101010 = 0x30335241,
1340*84e872a0SLloyd Pique /**
1341*84e872a0SLloyd Pique * 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian
1342*84e872a0SLloyd Pique */
1343*84e872a0SLloyd Pique WL_SHM_FORMAT_ABGR2101010 = 0x30334241,
1344*84e872a0SLloyd Pique /**
1345*84e872a0SLloyd Pique * 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian
1346*84e872a0SLloyd Pique */
1347*84e872a0SLloyd Pique WL_SHM_FORMAT_RGBA1010102 = 0x30334152,
1348*84e872a0SLloyd Pique /**
1349*84e872a0SLloyd Pique * 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian
1350*84e872a0SLloyd Pique */
1351*84e872a0SLloyd Pique WL_SHM_FORMAT_BGRA1010102 = 0x30334142,
1352*84e872a0SLloyd Pique /**
1353*84e872a0SLloyd Pique * packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian
1354*84e872a0SLloyd Pique */
1355*84e872a0SLloyd Pique WL_SHM_FORMAT_YUYV = 0x56595559,
1356*84e872a0SLloyd Pique /**
1357*84e872a0SLloyd Pique * packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian
1358*84e872a0SLloyd Pique */
1359*84e872a0SLloyd Pique WL_SHM_FORMAT_YVYU = 0x55595659,
1360*84e872a0SLloyd Pique /**
1361*84e872a0SLloyd Pique * packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian
1362*84e872a0SLloyd Pique */
1363*84e872a0SLloyd Pique WL_SHM_FORMAT_UYVY = 0x59565955,
1364*84e872a0SLloyd Pique /**
1365*84e872a0SLloyd Pique * packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian
1366*84e872a0SLloyd Pique */
1367*84e872a0SLloyd Pique WL_SHM_FORMAT_VYUY = 0x59555956,
1368*84e872a0SLloyd Pique /**
1369*84e872a0SLloyd Pique * packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian
1370*84e872a0SLloyd Pique */
1371*84e872a0SLloyd Pique WL_SHM_FORMAT_AYUV = 0x56555941,
1372*84e872a0SLloyd Pique /**
1373*84e872a0SLloyd Pique * 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane
1374*84e872a0SLloyd Pique */
1375*84e872a0SLloyd Pique WL_SHM_FORMAT_NV12 = 0x3231564e,
1376*84e872a0SLloyd Pique /**
1377*84e872a0SLloyd Pique * 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane
1378*84e872a0SLloyd Pique */
1379*84e872a0SLloyd Pique WL_SHM_FORMAT_NV21 = 0x3132564e,
1380*84e872a0SLloyd Pique /**
1381*84e872a0SLloyd Pique * 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane
1382*84e872a0SLloyd Pique */
1383*84e872a0SLloyd Pique WL_SHM_FORMAT_NV16 = 0x3631564e,
1384*84e872a0SLloyd Pique /**
1385*84e872a0SLloyd Pique * 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane
1386*84e872a0SLloyd Pique */
1387*84e872a0SLloyd Pique WL_SHM_FORMAT_NV61 = 0x3136564e,
1388*84e872a0SLloyd Pique /**
1389*84e872a0SLloyd Pique * 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes
1390*84e872a0SLloyd Pique */
1391*84e872a0SLloyd Pique WL_SHM_FORMAT_YUV410 = 0x39565559,
1392*84e872a0SLloyd Pique /**
1393*84e872a0SLloyd Pique * 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes
1394*84e872a0SLloyd Pique */
1395*84e872a0SLloyd Pique WL_SHM_FORMAT_YVU410 = 0x39555659,
1396*84e872a0SLloyd Pique /**
1397*84e872a0SLloyd Pique * 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes
1398*84e872a0SLloyd Pique */
1399*84e872a0SLloyd Pique WL_SHM_FORMAT_YUV411 = 0x31315559,
1400*84e872a0SLloyd Pique /**
1401*84e872a0SLloyd Pique * 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes
1402*84e872a0SLloyd Pique */
1403*84e872a0SLloyd Pique WL_SHM_FORMAT_YVU411 = 0x31315659,
1404*84e872a0SLloyd Pique /**
1405*84e872a0SLloyd Pique * 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes
1406*84e872a0SLloyd Pique */
1407*84e872a0SLloyd Pique WL_SHM_FORMAT_YUV420 = 0x32315559,
1408*84e872a0SLloyd Pique /**
1409*84e872a0SLloyd Pique * 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes
1410*84e872a0SLloyd Pique */
1411*84e872a0SLloyd Pique WL_SHM_FORMAT_YVU420 = 0x32315659,
1412*84e872a0SLloyd Pique /**
1413*84e872a0SLloyd Pique * 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes
1414*84e872a0SLloyd Pique */
1415*84e872a0SLloyd Pique WL_SHM_FORMAT_YUV422 = 0x36315559,
1416*84e872a0SLloyd Pique /**
1417*84e872a0SLloyd Pique * 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes
1418*84e872a0SLloyd Pique */
1419*84e872a0SLloyd Pique WL_SHM_FORMAT_YVU422 = 0x36315659,
1420*84e872a0SLloyd Pique /**
1421*84e872a0SLloyd Pique * 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes
1422*84e872a0SLloyd Pique */
1423*84e872a0SLloyd Pique WL_SHM_FORMAT_YUV444 = 0x34325559,
1424*84e872a0SLloyd Pique /**
1425*84e872a0SLloyd Pique * 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes
1426*84e872a0SLloyd Pique */
1427*84e872a0SLloyd Pique WL_SHM_FORMAT_YVU444 = 0x34325659,
1428*84e872a0SLloyd Pique };
1429*84e872a0SLloyd Pique #endif /* WL_SHM_FORMAT_ENUM */
1430*84e872a0SLloyd Pique
1431*84e872a0SLloyd Pique /**
1432*84e872a0SLloyd Pique * @ingroup iface_wl_shm
1433*84e872a0SLloyd Pique * @struct wl_shm_interface
1434*84e872a0SLloyd Pique */
1435*84e872a0SLloyd Pique struct wl_shm_interface {
1436*84e872a0SLloyd Pique /**
1437*84e872a0SLloyd Pique * create a shm pool
1438*84e872a0SLloyd Pique *
1439*84e872a0SLloyd Pique * Create a new wl_shm_pool object.
1440*84e872a0SLloyd Pique *
1441*84e872a0SLloyd Pique * The pool can be used to create shared memory based buffer
1442*84e872a0SLloyd Pique * objects. The server will mmap size bytes of the passed file
1443*84e872a0SLloyd Pique * descriptor, to use as backing memory for the pool.
1444*84e872a0SLloyd Pique * @param id pool to create
1445*84e872a0SLloyd Pique * @param fd file descriptor for the pool
1446*84e872a0SLloyd Pique * @param size pool size, in bytes
1447*84e872a0SLloyd Pique */
1448*84e872a0SLloyd Pique void (*create_pool)(struct wl_client *client,
1449*84e872a0SLloyd Pique struct wl_resource *resource,
1450*84e872a0SLloyd Pique uint32_t id,
1451*84e872a0SLloyd Pique int32_t fd,
1452*84e872a0SLloyd Pique int32_t size);
1453*84e872a0SLloyd Pique };
1454*84e872a0SLloyd Pique
1455*84e872a0SLloyd Pique #define WL_SHM_FORMAT 0
1456*84e872a0SLloyd Pique
1457*84e872a0SLloyd Pique /**
1458*84e872a0SLloyd Pique * @ingroup iface_wl_shm
1459*84e872a0SLloyd Pique */
1460*84e872a0SLloyd Pique #define WL_SHM_FORMAT_SINCE_VERSION 1
1461*84e872a0SLloyd Pique
1462*84e872a0SLloyd Pique /**
1463*84e872a0SLloyd Pique * @ingroup iface_wl_shm
1464*84e872a0SLloyd Pique */
1465*84e872a0SLloyd Pique #define WL_SHM_CREATE_POOL_SINCE_VERSION 1
1466*84e872a0SLloyd Pique
1467*84e872a0SLloyd Pique /**
1468*84e872a0SLloyd Pique * @ingroup iface_wl_shm
1469*84e872a0SLloyd Pique * Sends an format event to the client owning the resource.
1470*84e872a0SLloyd Pique * @param resource_ The client's resource
1471*84e872a0SLloyd Pique * @param format buffer pixel format
1472*84e872a0SLloyd Pique */
1473*84e872a0SLloyd Pique static inline void
wl_shm_send_format(struct wl_resource * resource_,uint32_t format)1474*84e872a0SLloyd Pique wl_shm_send_format(struct wl_resource *resource_, uint32_t format)
1475*84e872a0SLloyd Pique {
1476*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_SHM_FORMAT, format);
1477*84e872a0SLloyd Pique }
1478*84e872a0SLloyd Pique
1479*84e872a0SLloyd Pique /**
1480*84e872a0SLloyd Pique * @ingroup iface_wl_buffer
1481*84e872a0SLloyd Pique * @struct wl_buffer_interface
1482*84e872a0SLloyd Pique */
1483*84e872a0SLloyd Pique struct wl_buffer_interface {
1484*84e872a0SLloyd Pique /**
1485*84e872a0SLloyd Pique * destroy a buffer
1486*84e872a0SLloyd Pique *
1487*84e872a0SLloyd Pique * Destroy a buffer. If and how you need to release the backing
1488*84e872a0SLloyd Pique * storage is defined by the buffer factory interface.
1489*84e872a0SLloyd Pique *
1490*84e872a0SLloyd Pique * For possible side-effects to a surface, see wl_surface.attach.
1491*84e872a0SLloyd Pique */
1492*84e872a0SLloyd Pique void (*destroy)(struct wl_client *client,
1493*84e872a0SLloyd Pique struct wl_resource *resource);
1494*84e872a0SLloyd Pique };
1495*84e872a0SLloyd Pique
1496*84e872a0SLloyd Pique #define WL_BUFFER_RELEASE 0
1497*84e872a0SLloyd Pique
1498*84e872a0SLloyd Pique /**
1499*84e872a0SLloyd Pique * @ingroup iface_wl_buffer
1500*84e872a0SLloyd Pique */
1501*84e872a0SLloyd Pique #define WL_BUFFER_RELEASE_SINCE_VERSION 1
1502*84e872a0SLloyd Pique
1503*84e872a0SLloyd Pique /**
1504*84e872a0SLloyd Pique * @ingroup iface_wl_buffer
1505*84e872a0SLloyd Pique */
1506*84e872a0SLloyd Pique #define WL_BUFFER_DESTROY_SINCE_VERSION 1
1507*84e872a0SLloyd Pique
1508*84e872a0SLloyd Pique /**
1509*84e872a0SLloyd Pique * @ingroup iface_wl_buffer
1510*84e872a0SLloyd Pique * Sends an release event to the client owning the resource.
1511*84e872a0SLloyd Pique * @param resource_ The client's resource
1512*84e872a0SLloyd Pique */
1513*84e872a0SLloyd Pique static inline void
wl_buffer_send_release(struct wl_resource * resource_)1514*84e872a0SLloyd Pique wl_buffer_send_release(struct wl_resource *resource_)
1515*84e872a0SLloyd Pique {
1516*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_BUFFER_RELEASE);
1517*84e872a0SLloyd Pique }
1518*84e872a0SLloyd Pique
1519*84e872a0SLloyd Pique #ifndef WL_DATA_OFFER_ERROR_ENUM
1520*84e872a0SLloyd Pique #define WL_DATA_OFFER_ERROR_ENUM
1521*84e872a0SLloyd Pique enum wl_data_offer_error {
1522*84e872a0SLloyd Pique /**
1523*84e872a0SLloyd Pique * finish request was called untimely
1524*84e872a0SLloyd Pique */
1525*84e872a0SLloyd Pique WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,
1526*84e872a0SLloyd Pique /**
1527*84e872a0SLloyd Pique * action mask contains invalid values
1528*84e872a0SLloyd Pique */
1529*84e872a0SLloyd Pique WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,
1530*84e872a0SLloyd Pique /**
1531*84e872a0SLloyd Pique * action argument has an invalid value
1532*84e872a0SLloyd Pique */
1533*84e872a0SLloyd Pique WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,
1534*84e872a0SLloyd Pique /**
1535*84e872a0SLloyd Pique * offer doesn't accept this request
1536*84e872a0SLloyd Pique */
1537*84e872a0SLloyd Pique WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,
1538*84e872a0SLloyd Pique };
1539*84e872a0SLloyd Pique #endif /* WL_DATA_OFFER_ERROR_ENUM */
1540*84e872a0SLloyd Pique
1541*84e872a0SLloyd Pique /**
1542*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1543*84e872a0SLloyd Pique * @struct wl_data_offer_interface
1544*84e872a0SLloyd Pique */
1545*84e872a0SLloyd Pique struct wl_data_offer_interface {
1546*84e872a0SLloyd Pique /**
1547*84e872a0SLloyd Pique * accept one of the offered mime types
1548*84e872a0SLloyd Pique *
1549*84e872a0SLloyd Pique * Indicate that the client can accept the given mime type, or
1550*84e872a0SLloyd Pique * NULL for not accepted.
1551*84e872a0SLloyd Pique *
1552*84e872a0SLloyd Pique * For objects of version 2 or older, this request is used by the
1553*84e872a0SLloyd Pique * client to give feedback whether the client can receive the given
1554*84e872a0SLloyd Pique * mime type, or NULL if none is accepted; the feedback does not
1555*84e872a0SLloyd Pique * determine whether the drag-and-drop operation succeeds or not.
1556*84e872a0SLloyd Pique *
1557*84e872a0SLloyd Pique * For objects of version 3 or newer, this request determines the
1558*84e872a0SLloyd Pique * final result of the drag-and-drop operation. If the end result
1559*84e872a0SLloyd Pique * is that no mime types were accepted, the drag-and-drop operation
1560*84e872a0SLloyd Pique * will be cancelled and the corresponding drag source will receive
1561*84e872a0SLloyd Pique * wl_data_source.cancelled. Clients may still use this event in
1562*84e872a0SLloyd Pique * conjunction with wl_data_source.action for feedback.
1563*84e872a0SLloyd Pique * @param serial serial number of the accept request
1564*84e872a0SLloyd Pique * @param mime_type mime type accepted by the client
1565*84e872a0SLloyd Pique */
1566*84e872a0SLloyd Pique void (*accept)(struct wl_client *client,
1567*84e872a0SLloyd Pique struct wl_resource *resource,
1568*84e872a0SLloyd Pique uint32_t serial,
1569*84e872a0SLloyd Pique const char *mime_type);
1570*84e872a0SLloyd Pique /**
1571*84e872a0SLloyd Pique * request that the data is transferred
1572*84e872a0SLloyd Pique *
1573*84e872a0SLloyd Pique * To transfer the offered data, the client issues this request
1574*84e872a0SLloyd Pique * and indicates the mime type it wants to receive. The transfer
1575*84e872a0SLloyd Pique * happens through the passed file descriptor (typically created
1576*84e872a0SLloyd Pique * with the pipe system call). The source client writes the data in
1577*84e872a0SLloyd Pique * the mime type representation requested and then closes the file
1578*84e872a0SLloyd Pique * descriptor.
1579*84e872a0SLloyd Pique *
1580*84e872a0SLloyd Pique * The receiving client reads from the read end of the pipe until
1581*84e872a0SLloyd Pique * EOF and then closes its end, at which point the transfer is
1582*84e872a0SLloyd Pique * complete.
1583*84e872a0SLloyd Pique *
1584*84e872a0SLloyd Pique * This request may happen multiple times for different mime types,
1585*84e872a0SLloyd Pique * both before and after wl_data_device.drop. Drag-and-drop
1586*84e872a0SLloyd Pique * destination clients may preemptively fetch data or examine it
1587*84e872a0SLloyd Pique * more closely to determine acceptance.
1588*84e872a0SLloyd Pique * @param mime_type mime type desired by receiver
1589*84e872a0SLloyd Pique * @param fd file descriptor for data transfer
1590*84e872a0SLloyd Pique */
1591*84e872a0SLloyd Pique void (*receive)(struct wl_client *client,
1592*84e872a0SLloyd Pique struct wl_resource *resource,
1593*84e872a0SLloyd Pique const char *mime_type,
1594*84e872a0SLloyd Pique int32_t fd);
1595*84e872a0SLloyd Pique /**
1596*84e872a0SLloyd Pique * destroy data offer
1597*84e872a0SLloyd Pique *
1598*84e872a0SLloyd Pique * Destroy the data offer.
1599*84e872a0SLloyd Pique */
1600*84e872a0SLloyd Pique void (*destroy)(struct wl_client *client,
1601*84e872a0SLloyd Pique struct wl_resource *resource);
1602*84e872a0SLloyd Pique /**
1603*84e872a0SLloyd Pique * the offer will no longer be used
1604*84e872a0SLloyd Pique *
1605*84e872a0SLloyd Pique * Notifies the compositor that the drag destination successfully
1606*84e872a0SLloyd Pique * finished the drag-and-drop operation.
1607*84e872a0SLloyd Pique *
1608*84e872a0SLloyd Pique * Upon receiving this request, the compositor will emit
1609*84e872a0SLloyd Pique * wl_data_source.dnd_finished on the drag source client.
1610*84e872a0SLloyd Pique *
1611*84e872a0SLloyd Pique * It is a client error to perform other requests than
1612*84e872a0SLloyd Pique * wl_data_offer.destroy after this one. It is also an error to
1613*84e872a0SLloyd Pique * perform this request after a NULL mime type has been set in
1614*84e872a0SLloyd Pique * wl_data_offer.accept or no action was received through
1615*84e872a0SLloyd Pique * wl_data_offer.action.
1616*84e872a0SLloyd Pique * @since 3
1617*84e872a0SLloyd Pique */
1618*84e872a0SLloyd Pique void (*finish)(struct wl_client *client,
1619*84e872a0SLloyd Pique struct wl_resource *resource);
1620*84e872a0SLloyd Pique /**
1621*84e872a0SLloyd Pique * set the available/preferred drag-and-drop actions
1622*84e872a0SLloyd Pique *
1623*84e872a0SLloyd Pique * Sets the actions that the destination side client supports for
1624*84e872a0SLloyd Pique * this operation. This request may trigger the emission of
1625*84e872a0SLloyd Pique * wl_data_source.action and wl_data_offer.action events if the
1626*84e872a0SLloyd Pique * compositor needs to change the selected action.
1627*84e872a0SLloyd Pique *
1628*84e872a0SLloyd Pique * This request can be called multiple times throughout the
1629*84e872a0SLloyd Pique * drag-and-drop operation, typically in response to
1630*84e872a0SLloyd Pique * wl_data_device.enter or wl_data_device.motion events.
1631*84e872a0SLloyd Pique *
1632*84e872a0SLloyd Pique * This request determines the final result of the drag-and-drop
1633*84e872a0SLloyd Pique * operation. If the end result is that no action is accepted, the
1634*84e872a0SLloyd Pique * drag source will receive wl_drag_source.cancelled.
1635*84e872a0SLloyd Pique *
1636*84e872a0SLloyd Pique * The dnd_actions argument must contain only values expressed in
1637*84e872a0SLloyd Pique * the wl_data_device_manager.dnd_actions enum, and the
1638*84e872a0SLloyd Pique * preferred_action argument must only contain one of those values
1639*84e872a0SLloyd Pique * set, otherwise it will result in a protocol error.
1640*84e872a0SLloyd Pique *
1641*84e872a0SLloyd Pique * While managing an "ask" action, the destination drag-and-drop
1642*84e872a0SLloyd Pique * client may perform further wl_data_offer.receive requests, and
1643*84e872a0SLloyd Pique * is expected to perform one last wl_data_offer.set_actions
1644*84e872a0SLloyd Pique * request with a preferred action other than "ask" (and optionally
1645*84e872a0SLloyd Pique * wl_data_offer.accept) before requesting wl_data_offer.finish, in
1646*84e872a0SLloyd Pique * order to convey the action selected by the user. If the
1647*84e872a0SLloyd Pique * preferred action is not in the wl_data_offer.source_actions
1648*84e872a0SLloyd Pique * mask, an error will be raised.
1649*84e872a0SLloyd Pique *
1650*84e872a0SLloyd Pique * If the "ask" action is dismissed (e.g. user cancellation), the
1651*84e872a0SLloyd Pique * client is expected to perform wl_data_offer.destroy right away.
1652*84e872a0SLloyd Pique *
1653*84e872a0SLloyd Pique * This request can only be made on drag-and-drop offers, a
1654*84e872a0SLloyd Pique * protocol error will be raised otherwise.
1655*84e872a0SLloyd Pique * @param dnd_actions actions supported by the destination client
1656*84e872a0SLloyd Pique * @param preferred_action action preferred by the destination client
1657*84e872a0SLloyd Pique * @since 3
1658*84e872a0SLloyd Pique */
1659*84e872a0SLloyd Pique void (*set_actions)(struct wl_client *client,
1660*84e872a0SLloyd Pique struct wl_resource *resource,
1661*84e872a0SLloyd Pique uint32_t dnd_actions,
1662*84e872a0SLloyd Pique uint32_t preferred_action);
1663*84e872a0SLloyd Pique };
1664*84e872a0SLloyd Pique
1665*84e872a0SLloyd Pique #define WL_DATA_OFFER_OFFER 0
1666*84e872a0SLloyd Pique #define WL_DATA_OFFER_SOURCE_ACTIONS 1
1667*84e872a0SLloyd Pique #define WL_DATA_OFFER_ACTION 2
1668*84e872a0SLloyd Pique
1669*84e872a0SLloyd Pique /**
1670*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1671*84e872a0SLloyd Pique */
1672*84e872a0SLloyd Pique #define WL_DATA_OFFER_OFFER_SINCE_VERSION 1
1673*84e872a0SLloyd Pique /**
1674*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1675*84e872a0SLloyd Pique */
1676*84e872a0SLloyd Pique #define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 3
1677*84e872a0SLloyd Pique /**
1678*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1679*84e872a0SLloyd Pique */
1680*84e872a0SLloyd Pique #define WL_DATA_OFFER_ACTION_SINCE_VERSION 3
1681*84e872a0SLloyd Pique
1682*84e872a0SLloyd Pique /**
1683*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1684*84e872a0SLloyd Pique */
1685*84e872a0SLloyd Pique #define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1
1686*84e872a0SLloyd Pique /**
1687*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1688*84e872a0SLloyd Pique */
1689*84e872a0SLloyd Pique #define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1
1690*84e872a0SLloyd Pique /**
1691*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1692*84e872a0SLloyd Pique */
1693*84e872a0SLloyd Pique #define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1
1694*84e872a0SLloyd Pique /**
1695*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1696*84e872a0SLloyd Pique */
1697*84e872a0SLloyd Pique #define WL_DATA_OFFER_FINISH_SINCE_VERSION 3
1698*84e872a0SLloyd Pique /**
1699*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1700*84e872a0SLloyd Pique */
1701*84e872a0SLloyd Pique #define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 3
1702*84e872a0SLloyd Pique
1703*84e872a0SLloyd Pique /**
1704*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1705*84e872a0SLloyd Pique * Sends an offer event to the client owning the resource.
1706*84e872a0SLloyd Pique * @param resource_ The client's resource
1707*84e872a0SLloyd Pique * @param mime_type offered mime type
1708*84e872a0SLloyd Pique */
1709*84e872a0SLloyd Pique static inline void
wl_data_offer_send_offer(struct wl_resource * resource_,const char * mime_type)1710*84e872a0SLloyd Pique wl_data_offer_send_offer(struct wl_resource *resource_, const char *mime_type)
1711*84e872a0SLloyd Pique {
1712*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_OFFER_OFFER, mime_type);
1713*84e872a0SLloyd Pique }
1714*84e872a0SLloyd Pique
1715*84e872a0SLloyd Pique /**
1716*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1717*84e872a0SLloyd Pique * Sends an source_actions event to the client owning the resource.
1718*84e872a0SLloyd Pique * @param resource_ The client's resource
1719*84e872a0SLloyd Pique * @param source_actions actions offered by the data source
1720*84e872a0SLloyd Pique */
1721*84e872a0SLloyd Pique static inline void
wl_data_offer_send_source_actions(struct wl_resource * resource_,uint32_t source_actions)1722*84e872a0SLloyd Pique wl_data_offer_send_source_actions(struct wl_resource *resource_, uint32_t source_actions)
1723*84e872a0SLloyd Pique {
1724*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_OFFER_SOURCE_ACTIONS, source_actions);
1725*84e872a0SLloyd Pique }
1726*84e872a0SLloyd Pique
1727*84e872a0SLloyd Pique /**
1728*84e872a0SLloyd Pique * @ingroup iface_wl_data_offer
1729*84e872a0SLloyd Pique * Sends an action event to the client owning the resource.
1730*84e872a0SLloyd Pique * @param resource_ The client's resource
1731*84e872a0SLloyd Pique * @param dnd_action action selected by the compositor
1732*84e872a0SLloyd Pique */
1733*84e872a0SLloyd Pique static inline void
wl_data_offer_send_action(struct wl_resource * resource_,uint32_t dnd_action)1734*84e872a0SLloyd Pique wl_data_offer_send_action(struct wl_resource *resource_, uint32_t dnd_action)
1735*84e872a0SLloyd Pique {
1736*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_OFFER_ACTION, dnd_action);
1737*84e872a0SLloyd Pique }
1738*84e872a0SLloyd Pique
1739*84e872a0SLloyd Pique #ifndef WL_DATA_SOURCE_ERROR_ENUM
1740*84e872a0SLloyd Pique #define WL_DATA_SOURCE_ERROR_ENUM
1741*84e872a0SLloyd Pique enum wl_data_source_error {
1742*84e872a0SLloyd Pique /**
1743*84e872a0SLloyd Pique * action mask contains invalid values
1744*84e872a0SLloyd Pique */
1745*84e872a0SLloyd Pique WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,
1746*84e872a0SLloyd Pique /**
1747*84e872a0SLloyd Pique * source doesn't accept this request
1748*84e872a0SLloyd Pique */
1749*84e872a0SLloyd Pique WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,
1750*84e872a0SLloyd Pique };
1751*84e872a0SLloyd Pique #endif /* WL_DATA_SOURCE_ERROR_ENUM */
1752*84e872a0SLloyd Pique
1753*84e872a0SLloyd Pique /**
1754*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1755*84e872a0SLloyd Pique * @struct wl_data_source_interface
1756*84e872a0SLloyd Pique */
1757*84e872a0SLloyd Pique struct wl_data_source_interface {
1758*84e872a0SLloyd Pique /**
1759*84e872a0SLloyd Pique * add an offered mime type
1760*84e872a0SLloyd Pique *
1761*84e872a0SLloyd Pique * This request adds a mime type to the set of mime types
1762*84e872a0SLloyd Pique * advertised to targets. Can be called several times to offer
1763*84e872a0SLloyd Pique * multiple types.
1764*84e872a0SLloyd Pique * @param mime_type mime type offered by the data source
1765*84e872a0SLloyd Pique */
1766*84e872a0SLloyd Pique void (*offer)(struct wl_client *client,
1767*84e872a0SLloyd Pique struct wl_resource *resource,
1768*84e872a0SLloyd Pique const char *mime_type);
1769*84e872a0SLloyd Pique /**
1770*84e872a0SLloyd Pique * destroy the data source
1771*84e872a0SLloyd Pique *
1772*84e872a0SLloyd Pique * Destroy the data source.
1773*84e872a0SLloyd Pique */
1774*84e872a0SLloyd Pique void (*destroy)(struct wl_client *client,
1775*84e872a0SLloyd Pique struct wl_resource *resource);
1776*84e872a0SLloyd Pique /**
1777*84e872a0SLloyd Pique * set the available drag-and-drop actions
1778*84e872a0SLloyd Pique *
1779*84e872a0SLloyd Pique * Sets the actions that the source side client supports for this
1780*84e872a0SLloyd Pique * operation. This request may trigger wl_data_source.action and
1781*84e872a0SLloyd Pique * wl_data_offer.action events if the compositor needs to change
1782*84e872a0SLloyd Pique * the selected action.
1783*84e872a0SLloyd Pique *
1784*84e872a0SLloyd Pique * The dnd_actions argument must contain only values expressed in
1785*84e872a0SLloyd Pique * the wl_data_device_manager.dnd_actions enum, otherwise it will
1786*84e872a0SLloyd Pique * result in a protocol error.
1787*84e872a0SLloyd Pique *
1788*84e872a0SLloyd Pique * This request must be made once only, and can only be made on
1789*84e872a0SLloyd Pique * sources used in drag-and-drop, so it must be performed before
1790*84e872a0SLloyd Pique * wl_data_device.start_drag. Attempting to use the source other
1791*84e872a0SLloyd Pique * than for drag-and-drop will raise a protocol error.
1792*84e872a0SLloyd Pique * @param dnd_actions actions supported by the data source
1793*84e872a0SLloyd Pique * @since 3
1794*84e872a0SLloyd Pique */
1795*84e872a0SLloyd Pique void (*set_actions)(struct wl_client *client,
1796*84e872a0SLloyd Pique struct wl_resource *resource,
1797*84e872a0SLloyd Pique uint32_t dnd_actions);
1798*84e872a0SLloyd Pique };
1799*84e872a0SLloyd Pique
1800*84e872a0SLloyd Pique #define WL_DATA_SOURCE_TARGET 0
1801*84e872a0SLloyd Pique #define WL_DATA_SOURCE_SEND 1
1802*84e872a0SLloyd Pique #define WL_DATA_SOURCE_CANCELLED 2
1803*84e872a0SLloyd Pique #define WL_DATA_SOURCE_DND_DROP_PERFORMED 3
1804*84e872a0SLloyd Pique #define WL_DATA_SOURCE_DND_FINISHED 4
1805*84e872a0SLloyd Pique #define WL_DATA_SOURCE_ACTION 5
1806*84e872a0SLloyd Pique
1807*84e872a0SLloyd Pique /**
1808*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1809*84e872a0SLloyd Pique */
1810*84e872a0SLloyd Pique #define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1
1811*84e872a0SLloyd Pique /**
1812*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1813*84e872a0SLloyd Pique */
1814*84e872a0SLloyd Pique #define WL_DATA_SOURCE_SEND_SINCE_VERSION 1
1815*84e872a0SLloyd Pique /**
1816*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1817*84e872a0SLloyd Pique */
1818*84e872a0SLloyd Pique #define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1
1819*84e872a0SLloyd Pique /**
1820*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1821*84e872a0SLloyd Pique */
1822*84e872a0SLloyd Pique #define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 3
1823*84e872a0SLloyd Pique /**
1824*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1825*84e872a0SLloyd Pique */
1826*84e872a0SLloyd Pique #define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 3
1827*84e872a0SLloyd Pique /**
1828*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1829*84e872a0SLloyd Pique */
1830*84e872a0SLloyd Pique #define WL_DATA_SOURCE_ACTION_SINCE_VERSION 3
1831*84e872a0SLloyd Pique
1832*84e872a0SLloyd Pique /**
1833*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1834*84e872a0SLloyd Pique */
1835*84e872a0SLloyd Pique #define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1
1836*84e872a0SLloyd Pique /**
1837*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1838*84e872a0SLloyd Pique */
1839*84e872a0SLloyd Pique #define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1
1840*84e872a0SLloyd Pique /**
1841*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1842*84e872a0SLloyd Pique */
1843*84e872a0SLloyd Pique #define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 3
1844*84e872a0SLloyd Pique
1845*84e872a0SLloyd Pique /**
1846*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1847*84e872a0SLloyd Pique * Sends an target event to the client owning the resource.
1848*84e872a0SLloyd Pique * @param resource_ The client's resource
1849*84e872a0SLloyd Pique * @param mime_type mime type accepted by the target
1850*84e872a0SLloyd Pique */
1851*84e872a0SLloyd Pique static inline void
wl_data_source_send_target(struct wl_resource * resource_,const char * mime_type)1852*84e872a0SLloyd Pique wl_data_source_send_target(struct wl_resource *resource_, const char *mime_type)
1853*84e872a0SLloyd Pique {
1854*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_SOURCE_TARGET, mime_type);
1855*84e872a0SLloyd Pique }
1856*84e872a0SLloyd Pique
1857*84e872a0SLloyd Pique /**
1858*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1859*84e872a0SLloyd Pique * Sends an send event to the client owning the resource.
1860*84e872a0SLloyd Pique * @param resource_ The client's resource
1861*84e872a0SLloyd Pique * @param mime_type mime type for the data
1862*84e872a0SLloyd Pique * @param fd file descriptor for the data
1863*84e872a0SLloyd Pique */
1864*84e872a0SLloyd Pique static inline void
wl_data_source_send_send(struct wl_resource * resource_,const char * mime_type,int32_t fd)1865*84e872a0SLloyd Pique wl_data_source_send_send(struct wl_resource *resource_, const char *mime_type, int32_t fd)
1866*84e872a0SLloyd Pique {
1867*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_SOURCE_SEND, mime_type, fd);
1868*84e872a0SLloyd Pique }
1869*84e872a0SLloyd Pique
1870*84e872a0SLloyd Pique /**
1871*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1872*84e872a0SLloyd Pique * Sends an cancelled event to the client owning the resource.
1873*84e872a0SLloyd Pique * @param resource_ The client's resource
1874*84e872a0SLloyd Pique */
1875*84e872a0SLloyd Pique static inline void
wl_data_source_send_cancelled(struct wl_resource * resource_)1876*84e872a0SLloyd Pique wl_data_source_send_cancelled(struct wl_resource *resource_)
1877*84e872a0SLloyd Pique {
1878*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_SOURCE_CANCELLED);
1879*84e872a0SLloyd Pique }
1880*84e872a0SLloyd Pique
1881*84e872a0SLloyd Pique /**
1882*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1883*84e872a0SLloyd Pique * Sends an dnd_drop_performed event to the client owning the resource.
1884*84e872a0SLloyd Pique * @param resource_ The client's resource
1885*84e872a0SLloyd Pique */
1886*84e872a0SLloyd Pique static inline void
wl_data_source_send_dnd_drop_performed(struct wl_resource * resource_)1887*84e872a0SLloyd Pique wl_data_source_send_dnd_drop_performed(struct wl_resource *resource_)
1888*84e872a0SLloyd Pique {
1889*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_DROP_PERFORMED);
1890*84e872a0SLloyd Pique }
1891*84e872a0SLloyd Pique
1892*84e872a0SLloyd Pique /**
1893*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1894*84e872a0SLloyd Pique * Sends an dnd_finished event to the client owning the resource.
1895*84e872a0SLloyd Pique * @param resource_ The client's resource
1896*84e872a0SLloyd Pique */
1897*84e872a0SLloyd Pique static inline void
wl_data_source_send_dnd_finished(struct wl_resource * resource_)1898*84e872a0SLloyd Pique wl_data_source_send_dnd_finished(struct wl_resource *resource_)
1899*84e872a0SLloyd Pique {
1900*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_FINISHED);
1901*84e872a0SLloyd Pique }
1902*84e872a0SLloyd Pique
1903*84e872a0SLloyd Pique /**
1904*84e872a0SLloyd Pique * @ingroup iface_wl_data_source
1905*84e872a0SLloyd Pique * Sends an action event to the client owning the resource.
1906*84e872a0SLloyd Pique * @param resource_ The client's resource
1907*84e872a0SLloyd Pique * @param dnd_action action selected by the compositor
1908*84e872a0SLloyd Pique */
1909*84e872a0SLloyd Pique static inline void
wl_data_source_send_action(struct wl_resource * resource_,uint32_t dnd_action)1910*84e872a0SLloyd Pique wl_data_source_send_action(struct wl_resource *resource_, uint32_t dnd_action)
1911*84e872a0SLloyd Pique {
1912*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_SOURCE_ACTION, dnd_action);
1913*84e872a0SLloyd Pique }
1914*84e872a0SLloyd Pique
1915*84e872a0SLloyd Pique #ifndef WL_DATA_DEVICE_ERROR_ENUM
1916*84e872a0SLloyd Pique #define WL_DATA_DEVICE_ERROR_ENUM
1917*84e872a0SLloyd Pique enum wl_data_device_error {
1918*84e872a0SLloyd Pique /**
1919*84e872a0SLloyd Pique * given wl_surface has another role
1920*84e872a0SLloyd Pique */
1921*84e872a0SLloyd Pique WL_DATA_DEVICE_ERROR_ROLE = 0,
1922*84e872a0SLloyd Pique };
1923*84e872a0SLloyd Pique #endif /* WL_DATA_DEVICE_ERROR_ENUM */
1924*84e872a0SLloyd Pique
1925*84e872a0SLloyd Pique /**
1926*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
1927*84e872a0SLloyd Pique * @struct wl_data_device_interface
1928*84e872a0SLloyd Pique */
1929*84e872a0SLloyd Pique struct wl_data_device_interface {
1930*84e872a0SLloyd Pique /**
1931*84e872a0SLloyd Pique * start drag-and-drop operation
1932*84e872a0SLloyd Pique *
1933*84e872a0SLloyd Pique * This request asks the compositor to start a drag-and-drop
1934*84e872a0SLloyd Pique * operation on behalf of the client.
1935*84e872a0SLloyd Pique *
1936*84e872a0SLloyd Pique * The source argument is the data source that provides the data
1937*84e872a0SLloyd Pique * for the eventual data transfer. If source is NULL, enter, leave
1938*84e872a0SLloyd Pique * and motion events are sent only to the client that initiated the
1939*84e872a0SLloyd Pique * drag and the client is expected to handle the data passing
1940*84e872a0SLloyd Pique * internally.
1941*84e872a0SLloyd Pique *
1942*84e872a0SLloyd Pique * The origin surface is the surface where the drag originates and
1943*84e872a0SLloyd Pique * the client must have an active implicit grab that matches the
1944*84e872a0SLloyd Pique * serial.
1945*84e872a0SLloyd Pique *
1946*84e872a0SLloyd Pique * The icon surface is an optional (can be NULL) surface that
1947*84e872a0SLloyd Pique * provides an icon to be moved around with the cursor. Initially,
1948*84e872a0SLloyd Pique * the top-left corner of the icon surface is placed at the cursor
1949*84e872a0SLloyd Pique * hotspot, but subsequent wl_surface.attach request can move the
1950*84e872a0SLloyd Pique * relative position. Attach requests must be confirmed with
1951*84e872a0SLloyd Pique * wl_surface.commit as usual. The icon surface is given the role
1952*84e872a0SLloyd Pique * of a drag-and-drop icon. If the icon surface already has another
1953*84e872a0SLloyd Pique * role, it raises a protocol error.
1954*84e872a0SLloyd Pique *
1955*84e872a0SLloyd Pique * The current and pending input regions of the icon wl_surface are
1956*84e872a0SLloyd Pique * cleared, and wl_surface.set_input_region is ignored until the
1957*84e872a0SLloyd Pique * wl_surface is no longer used as the icon surface. When the use
1958*84e872a0SLloyd Pique * as an icon ends, the current and pending input regions become
1959*84e872a0SLloyd Pique * undefined, and the wl_surface is unmapped.
1960*84e872a0SLloyd Pique * @param source data source for the eventual transfer
1961*84e872a0SLloyd Pique * @param origin surface where the drag originates
1962*84e872a0SLloyd Pique * @param icon drag-and-drop icon surface
1963*84e872a0SLloyd Pique * @param serial serial number of the implicit grab on the origin
1964*84e872a0SLloyd Pique */
1965*84e872a0SLloyd Pique void (*start_drag)(struct wl_client *client,
1966*84e872a0SLloyd Pique struct wl_resource *resource,
1967*84e872a0SLloyd Pique struct wl_resource *source,
1968*84e872a0SLloyd Pique struct wl_resource *origin,
1969*84e872a0SLloyd Pique struct wl_resource *icon,
1970*84e872a0SLloyd Pique uint32_t serial);
1971*84e872a0SLloyd Pique /**
1972*84e872a0SLloyd Pique * copy data to the selection
1973*84e872a0SLloyd Pique *
1974*84e872a0SLloyd Pique * This request asks the compositor to set the selection to the
1975*84e872a0SLloyd Pique * data from the source on behalf of the client.
1976*84e872a0SLloyd Pique *
1977*84e872a0SLloyd Pique * To unset the selection, set the source to NULL.
1978*84e872a0SLloyd Pique * @param source data source for the selection
1979*84e872a0SLloyd Pique * @param serial serial number of the event that triggered this request
1980*84e872a0SLloyd Pique */
1981*84e872a0SLloyd Pique void (*set_selection)(struct wl_client *client,
1982*84e872a0SLloyd Pique struct wl_resource *resource,
1983*84e872a0SLloyd Pique struct wl_resource *source,
1984*84e872a0SLloyd Pique uint32_t serial);
1985*84e872a0SLloyd Pique /**
1986*84e872a0SLloyd Pique * destroy data device
1987*84e872a0SLloyd Pique *
1988*84e872a0SLloyd Pique * This request destroys the data device.
1989*84e872a0SLloyd Pique * @since 2
1990*84e872a0SLloyd Pique */
1991*84e872a0SLloyd Pique void (*release)(struct wl_client *client,
1992*84e872a0SLloyd Pique struct wl_resource *resource);
1993*84e872a0SLloyd Pique };
1994*84e872a0SLloyd Pique
1995*84e872a0SLloyd Pique #define WL_DATA_DEVICE_DATA_OFFER 0
1996*84e872a0SLloyd Pique #define WL_DATA_DEVICE_ENTER 1
1997*84e872a0SLloyd Pique #define WL_DATA_DEVICE_LEAVE 2
1998*84e872a0SLloyd Pique #define WL_DATA_DEVICE_MOTION 3
1999*84e872a0SLloyd Pique #define WL_DATA_DEVICE_DROP 4
2000*84e872a0SLloyd Pique #define WL_DATA_DEVICE_SELECTION 5
2001*84e872a0SLloyd Pique
2002*84e872a0SLloyd Pique /**
2003*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2004*84e872a0SLloyd Pique */
2005*84e872a0SLloyd Pique #define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1
2006*84e872a0SLloyd Pique /**
2007*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2008*84e872a0SLloyd Pique */
2009*84e872a0SLloyd Pique #define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1
2010*84e872a0SLloyd Pique /**
2011*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2012*84e872a0SLloyd Pique */
2013*84e872a0SLloyd Pique #define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1
2014*84e872a0SLloyd Pique /**
2015*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2016*84e872a0SLloyd Pique */
2017*84e872a0SLloyd Pique #define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1
2018*84e872a0SLloyd Pique /**
2019*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2020*84e872a0SLloyd Pique */
2021*84e872a0SLloyd Pique #define WL_DATA_DEVICE_DROP_SINCE_VERSION 1
2022*84e872a0SLloyd Pique /**
2023*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2024*84e872a0SLloyd Pique */
2025*84e872a0SLloyd Pique #define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1
2026*84e872a0SLloyd Pique
2027*84e872a0SLloyd Pique /**
2028*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2029*84e872a0SLloyd Pique */
2030*84e872a0SLloyd Pique #define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1
2031*84e872a0SLloyd Pique /**
2032*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2033*84e872a0SLloyd Pique */
2034*84e872a0SLloyd Pique #define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1
2035*84e872a0SLloyd Pique /**
2036*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2037*84e872a0SLloyd Pique */
2038*84e872a0SLloyd Pique #define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 2
2039*84e872a0SLloyd Pique
2040*84e872a0SLloyd Pique /**
2041*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2042*84e872a0SLloyd Pique * Sends an data_offer event to the client owning the resource.
2043*84e872a0SLloyd Pique * @param resource_ The client's resource
2044*84e872a0SLloyd Pique * @param id the new data_offer object
2045*84e872a0SLloyd Pique */
2046*84e872a0SLloyd Pique static inline void
wl_data_device_send_data_offer(struct wl_resource * resource_,struct wl_resource * id)2047*84e872a0SLloyd Pique wl_data_device_send_data_offer(struct wl_resource *resource_, struct wl_resource *id)
2048*84e872a0SLloyd Pique {
2049*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_DEVICE_DATA_OFFER, id);
2050*84e872a0SLloyd Pique }
2051*84e872a0SLloyd Pique
2052*84e872a0SLloyd Pique /**
2053*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2054*84e872a0SLloyd Pique * Sends an enter event to the client owning the resource.
2055*84e872a0SLloyd Pique * @param resource_ The client's resource
2056*84e872a0SLloyd Pique * @param serial serial number of the enter event
2057*84e872a0SLloyd Pique * @param surface client surface entered
2058*84e872a0SLloyd Pique * @param x surface-local x coordinate
2059*84e872a0SLloyd Pique * @param y surface-local y coordinate
2060*84e872a0SLloyd Pique * @param id source data_offer object
2061*84e872a0SLloyd Pique */
2062*84e872a0SLloyd Pique static inline void
wl_data_device_send_enter(struct wl_resource * resource_,uint32_t serial,struct wl_resource * surface,wl_fixed_t x,wl_fixed_t y,struct wl_resource * id)2063*84e872a0SLloyd Pique wl_data_device_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, wl_fixed_t x, wl_fixed_t y, struct wl_resource *id)
2064*84e872a0SLloyd Pique {
2065*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_DEVICE_ENTER, serial, surface, x, y, id);
2066*84e872a0SLloyd Pique }
2067*84e872a0SLloyd Pique
2068*84e872a0SLloyd Pique /**
2069*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2070*84e872a0SLloyd Pique * Sends an leave event to the client owning the resource.
2071*84e872a0SLloyd Pique * @param resource_ The client's resource
2072*84e872a0SLloyd Pique */
2073*84e872a0SLloyd Pique static inline void
wl_data_device_send_leave(struct wl_resource * resource_)2074*84e872a0SLloyd Pique wl_data_device_send_leave(struct wl_resource *resource_)
2075*84e872a0SLloyd Pique {
2076*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_DEVICE_LEAVE);
2077*84e872a0SLloyd Pique }
2078*84e872a0SLloyd Pique
2079*84e872a0SLloyd Pique /**
2080*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2081*84e872a0SLloyd Pique * Sends an motion event to the client owning the resource.
2082*84e872a0SLloyd Pique * @param resource_ The client's resource
2083*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
2084*84e872a0SLloyd Pique * @param x surface-local x coordinate
2085*84e872a0SLloyd Pique * @param y surface-local y coordinate
2086*84e872a0SLloyd Pique */
2087*84e872a0SLloyd Pique static inline void
wl_data_device_send_motion(struct wl_resource * resource_,uint32_t time,wl_fixed_t x,wl_fixed_t y)2088*84e872a0SLloyd Pique wl_data_device_send_motion(struct wl_resource *resource_, uint32_t time, wl_fixed_t x, wl_fixed_t y)
2089*84e872a0SLloyd Pique {
2090*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_DEVICE_MOTION, time, x, y);
2091*84e872a0SLloyd Pique }
2092*84e872a0SLloyd Pique
2093*84e872a0SLloyd Pique /**
2094*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2095*84e872a0SLloyd Pique * Sends an drop event to the client owning the resource.
2096*84e872a0SLloyd Pique * @param resource_ The client's resource
2097*84e872a0SLloyd Pique */
2098*84e872a0SLloyd Pique static inline void
wl_data_device_send_drop(struct wl_resource * resource_)2099*84e872a0SLloyd Pique wl_data_device_send_drop(struct wl_resource *resource_)
2100*84e872a0SLloyd Pique {
2101*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_DEVICE_DROP);
2102*84e872a0SLloyd Pique }
2103*84e872a0SLloyd Pique
2104*84e872a0SLloyd Pique /**
2105*84e872a0SLloyd Pique * @ingroup iface_wl_data_device
2106*84e872a0SLloyd Pique * Sends an selection event to the client owning the resource.
2107*84e872a0SLloyd Pique * @param resource_ The client's resource
2108*84e872a0SLloyd Pique * @param id selection data_offer object
2109*84e872a0SLloyd Pique */
2110*84e872a0SLloyd Pique static inline void
wl_data_device_send_selection(struct wl_resource * resource_,struct wl_resource * id)2111*84e872a0SLloyd Pique wl_data_device_send_selection(struct wl_resource *resource_, struct wl_resource *id)
2112*84e872a0SLloyd Pique {
2113*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_DATA_DEVICE_SELECTION, id);
2114*84e872a0SLloyd Pique }
2115*84e872a0SLloyd Pique
2116*84e872a0SLloyd Pique #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
2117*84e872a0SLloyd Pique #define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
2118*84e872a0SLloyd Pique /**
2119*84e872a0SLloyd Pique * @ingroup iface_wl_data_device_manager
2120*84e872a0SLloyd Pique * drag and drop actions
2121*84e872a0SLloyd Pique *
2122*84e872a0SLloyd Pique * This is a bitmask of the available/preferred actions in a
2123*84e872a0SLloyd Pique * drag-and-drop operation.
2124*84e872a0SLloyd Pique *
2125*84e872a0SLloyd Pique * In the compositor, the selected action is a result of matching the
2126*84e872a0SLloyd Pique * actions offered by the source and destination sides. "action" events
2127*84e872a0SLloyd Pique * with a "none" action will be sent to both source and destination if
2128*84e872a0SLloyd Pique * there is no match. All further checks will effectively happen on
2129*84e872a0SLloyd Pique * (source actions ∩ destination actions).
2130*84e872a0SLloyd Pique *
2131*84e872a0SLloyd Pique * In addition, compositors may also pick different actions in
2132*84e872a0SLloyd Pique * reaction to key modifiers being pressed. One common design that
2133*84e872a0SLloyd Pique * is used in major toolkits (and the behavior recommended for
2134*84e872a0SLloyd Pique * compositors) is:
2135*84e872a0SLloyd Pique *
2136*84e872a0SLloyd Pique * - If no modifiers are pressed, the first match (in bit order)
2137*84e872a0SLloyd Pique * will be used.
2138*84e872a0SLloyd Pique * - Pressing Shift selects "move", if enabled in the mask.
2139*84e872a0SLloyd Pique * - Pressing Control selects "copy", if enabled in the mask.
2140*84e872a0SLloyd Pique *
2141*84e872a0SLloyd Pique * Behavior beyond that is considered implementation-dependent.
2142*84e872a0SLloyd Pique * Compositors may for example bind other modifiers (like Alt/Meta)
2143*84e872a0SLloyd Pique * or drags initiated with other buttons than BTN_LEFT to specific
2144*84e872a0SLloyd Pique * actions (e.g. "ask").
2145*84e872a0SLloyd Pique */
2146*84e872a0SLloyd Pique enum wl_data_device_manager_dnd_action {
2147*84e872a0SLloyd Pique /**
2148*84e872a0SLloyd Pique * no action
2149*84e872a0SLloyd Pique */
2150*84e872a0SLloyd Pique WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,
2151*84e872a0SLloyd Pique /**
2152*84e872a0SLloyd Pique * copy action
2153*84e872a0SLloyd Pique */
2154*84e872a0SLloyd Pique WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,
2155*84e872a0SLloyd Pique /**
2156*84e872a0SLloyd Pique * move action
2157*84e872a0SLloyd Pique */
2158*84e872a0SLloyd Pique WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,
2159*84e872a0SLloyd Pique /**
2160*84e872a0SLloyd Pique * ask action
2161*84e872a0SLloyd Pique */
2162*84e872a0SLloyd Pique WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,
2163*84e872a0SLloyd Pique };
2164*84e872a0SLloyd Pique #endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */
2165*84e872a0SLloyd Pique
2166*84e872a0SLloyd Pique /**
2167*84e872a0SLloyd Pique * @ingroup iface_wl_data_device_manager
2168*84e872a0SLloyd Pique * @struct wl_data_device_manager_interface
2169*84e872a0SLloyd Pique */
2170*84e872a0SLloyd Pique struct wl_data_device_manager_interface {
2171*84e872a0SLloyd Pique /**
2172*84e872a0SLloyd Pique * create a new data source
2173*84e872a0SLloyd Pique *
2174*84e872a0SLloyd Pique * Create a new data source.
2175*84e872a0SLloyd Pique * @param id data source to create
2176*84e872a0SLloyd Pique */
2177*84e872a0SLloyd Pique void (*create_data_source)(struct wl_client *client,
2178*84e872a0SLloyd Pique struct wl_resource *resource,
2179*84e872a0SLloyd Pique uint32_t id);
2180*84e872a0SLloyd Pique /**
2181*84e872a0SLloyd Pique * create a new data device
2182*84e872a0SLloyd Pique *
2183*84e872a0SLloyd Pique * Create a new data device for a given seat.
2184*84e872a0SLloyd Pique * @param id data device to create
2185*84e872a0SLloyd Pique * @param seat seat associated with the data device
2186*84e872a0SLloyd Pique */
2187*84e872a0SLloyd Pique void (*get_data_device)(struct wl_client *client,
2188*84e872a0SLloyd Pique struct wl_resource *resource,
2189*84e872a0SLloyd Pique uint32_t id,
2190*84e872a0SLloyd Pique struct wl_resource *seat);
2191*84e872a0SLloyd Pique };
2192*84e872a0SLloyd Pique
2193*84e872a0SLloyd Pique
2194*84e872a0SLloyd Pique /**
2195*84e872a0SLloyd Pique * @ingroup iface_wl_data_device_manager
2196*84e872a0SLloyd Pique */
2197*84e872a0SLloyd Pique #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1
2198*84e872a0SLloyd Pique /**
2199*84e872a0SLloyd Pique * @ingroup iface_wl_data_device_manager
2200*84e872a0SLloyd Pique */
2201*84e872a0SLloyd Pique #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1
2202*84e872a0SLloyd Pique
2203*84e872a0SLloyd Pique #ifndef WL_SHELL_ERROR_ENUM
2204*84e872a0SLloyd Pique #define WL_SHELL_ERROR_ENUM
2205*84e872a0SLloyd Pique enum wl_shell_error {
2206*84e872a0SLloyd Pique /**
2207*84e872a0SLloyd Pique * given wl_surface has another role
2208*84e872a0SLloyd Pique */
2209*84e872a0SLloyd Pique WL_SHELL_ERROR_ROLE = 0,
2210*84e872a0SLloyd Pique };
2211*84e872a0SLloyd Pique #endif /* WL_SHELL_ERROR_ENUM */
2212*84e872a0SLloyd Pique
2213*84e872a0SLloyd Pique /**
2214*84e872a0SLloyd Pique * @ingroup iface_wl_shell
2215*84e872a0SLloyd Pique * @struct wl_shell_interface
2216*84e872a0SLloyd Pique */
2217*84e872a0SLloyd Pique struct wl_shell_interface {
2218*84e872a0SLloyd Pique /**
2219*84e872a0SLloyd Pique * create a shell surface from a surface
2220*84e872a0SLloyd Pique *
2221*84e872a0SLloyd Pique * Create a shell surface for an existing surface. This gives the
2222*84e872a0SLloyd Pique * wl_surface the role of a shell surface. If the wl_surface
2223*84e872a0SLloyd Pique * already has another role, it raises a protocol error.
2224*84e872a0SLloyd Pique *
2225*84e872a0SLloyd Pique * Only one shell surface can be associated with a given surface.
2226*84e872a0SLloyd Pique * @param id shell surface to create
2227*84e872a0SLloyd Pique * @param surface surface to be given the shell surface role
2228*84e872a0SLloyd Pique */
2229*84e872a0SLloyd Pique void (*get_shell_surface)(struct wl_client *client,
2230*84e872a0SLloyd Pique struct wl_resource *resource,
2231*84e872a0SLloyd Pique uint32_t id,
2232*84e872a0SLloyd Pique struct wl_resource *surface);
2233*84e872a0SLloyd Pique };
2234*84e872a0SLloyd Pique
2235*84e872a0SLloyd Pique
2236*84e872a0SLloyd Pique /**
2237*84e872a0SLloyd Pique * @ingroup iface_wl_shell
2238*84e872a0SLloyd Pique */
2239*84e872a0SLloyd Pique #define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1
2240*84e872a0SLloyd Pique
2241*84e872a0SLloyd Pique #ifndef WL_SHELL_SURFACE_RESIZE_ENUM
2242*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_RESIZE_ENUM
2243*84e872a0SLloyd Pique /**
2244*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2245*84e872a0SLloyd Pique * edge values for resizing
2246*84e872a0SLloyd Pique *
2247*84e872a0SLloyd Pique * These values are used to indicate which edge of a surface
2248*84e872a0SLloyd Pique * is being dragged in a resize operation. The server may
2249*84e872a0SLloyd Pique * use this information to adapt its behavior, e.g. choose
2250*84e872a0SLloyd Pique * an appropriate cursor image.
2251*84e872a0SLloyd Pique */
2252*84e872a0SLloyd Pique enum wl_shell_surface_resize {
2253*84e872a0SLloyd Pique /**
2254*84e872a0SLloyd Pique * no edge
2255*84e872a0SLloyd Pique */
2256*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_NONE = 0,
2257*84e872a0SLloyd Pique /**
2258*84e872a0SLloyd Pique * top edge
2259*84e872a0SLloyd Pique */
2260*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_TOP = 1,
2261*84e872a0SLloyd Pique /**
2262*84e872a0SLloyd Pique * bottom edge
2263*84e872a0SLloyd Pique */
2264*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,
2265*84e872a0SLloyd Pique /**
2266*84e872a0SLloyd Pique * left edge
2267*84e872a0SLloyd Pique */
2268*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_LEFT = 4,
2269*84e872a0SLloyd Pique /**
2270*84e872a0SLloyd Pique * top and left edges
2271*84e872a0SLloyd Pique */
2272*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,
2273*84e872a0SLloyd Pique /**
2274*84e872a0SLloyd Pique * bottom and left edges
2275*84e872a0SLloyd Pique */
2276*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,
2277*84e872a0SLloyd Pique /**
2278*84e872a0SLloyd Pique * right edge
2279*84e872a0SLloyd Pique */
2280*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_RIGHT = 8,
2281*84e872a0SLloyd Pique /**
2282*84e872a0SLloyd Pique * top and right edges
2283*84e872a0SLloyd Pique */
2284*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,
2285*84e872a0SLloyd Pique /**
2286*84e872a0SLloyd Pique * bottom and right edges
2287*84e872a0SLloyd Pique */
2288*84e872a0SLloyd Pique WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10,
2289*84e872a0SLloyd Pique };
2290*84e872a0SLloyd Pique #endif /* WL_SHELL_SURFACE_RESIZE_ENUM */
2291*84e872a0SLloyd Pique
2292*84e872a0SLloyd Pique #ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM
2293*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_TRANSIENT_ENUM
2294*84e872a0SLloyd Pique /**
2295*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2296*84e872a0SLloyd Pique * details of transient behaviour
2297*84e872a0SLloyd Pique *
2298*84e872a0SLloyd Pique * These flags specify details of the expected behaviour
2299*84e872a0SLloyd Pique * of transient surfaces. Used in the set_transient request.
2300*84e872a0SLloyd Pique */
2301*84e872a0SLloyd Pique enum wl_shell_surface_transient {
2302*84e872a0SLloyd Pique /**
2303*84e872a0SLloyd Pique * do not set keyboard focus
2304*84e872a0SLloyd Pique */
2305*84e872a0SLloyd Pique WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1,
2306*84e872a0SLloyd Pique };
2307*84e872a0SLloyd Pique #endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */
2308*84e872a0SLloyd Pique
2309*84e872a0SLloyd Pique #ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
2310*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
2311*84e872a0SLloyd Pique /**
2312*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2313*84e872a0SLloyd Pique * different method to set the surface fullscreen
2314*84e872a0SLloyd Pique *
2315*84e872a0SLloyd Pique * Hints to indicate to the compositor how to deal with a conflict
2316*84e872a0SLloyd Pique * between the dimensions of the surface and the dimensions of the
2317*84e872a0SLloyd Pique * output. The compositor is free to ignore this parameter.
2318*84e872a0SLloyd Pique */
2319*84e872a0SLloyd Pique enum wl_shell_surface_fullscreen_method {
2320*84e872a0SLloyd Pique /**
2321*84e872a0SLloyd Pique * no preference, apply default policy
2322*84e872a0SLloyd Pique */
2323*84e872a0SLloyd Pique WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,
2324*84e872a0SLloyd Pique /**
2325*84e872a0SLloyd Pique * scale, preserve the surface's aspect ratio and center on output
2326*84e872a0SLloyd Pique */
2327*84e872a0SLloyd Pique WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,
2328*84e872a0SLloyd Pique /**
2329*84e872a0SLloyd Pique * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch
2330*84e872a0SLloyd Pique */
2331*84e872a0SLloyd Pique WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,
2332*84e872a0SLloyd Pique /**
2333*84e872a0SLloyd Pique * no upscaling, center on output and add black borders to compensate size mismatch
2334*84e872a0SLloyd Pique */
2335*84e872a0SLloyd Pique WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3,
2336*84e872a0SLloyd Pique };
2337*84e872a0SLloyd Pique #endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */
2338*84e872a0SLloyd Pique
2339*84e872a0SLloyd Pique /**
2340*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2341*84e872a0SLloyd Pique * @struct wl_shell_surface_interface
2342*84e872a0SLloyd Pique */
2343*84e872a0SLloyd Pique struct wl_shell_surface_interface {
2344*84e872a0SLloyd Pique /**
2345*84e872a0SLloyd Pique * respond to a ping event
2346*84e872a0SLloyd Pique *
2347*84e872a0SLloyd Pique * A client must respond to a ping event with a pong request or
2348*84e872a0SLloyd Pique * the client may be deemed unresponsive.
2349*84e872a0SLloyd Pique * @param serial serial number of the ping event
2350*84e872a0SLloyd Pique */
2351*84e872a0SLloyd Pique void (*pong)(struct wl_client *client,
2352*84e872a0SLloyd Pique struct wl_resource *resource,
2353*84e872a0SLloyd Pique uint32_t serial);
2354*84e872a0SLloyd Pique /**
2355*84e872a0SLloyd Pique * start an interactive move
2356*84e872a0SLloyd Pique *
2357*84e872a0SLloyd Pique * Start a pointer-driven move of the surface.
2358*84e872a0SLloyd Pique *
2359*84e872a0SLloyd Pique * This request must be used in response to a button press event.
2360*84e872a0SLloyd Pique * The server may ignore move requests depending on the state of
2361*84e872a0SLloyd Pique * the surface (e.g. fullscreen or maximized).
2362*84e872a0SLloyd Pique * @param seat seat whose pointer is used
2363*84e872a0SLloyd Pique * @param serial serial number of the implicit grab on the pointer
2364*84e872a0SLloyd Pique */
2365*84e872a0SLloyd Pique void (*move)(struct wl_client *client,
2366*84e872a0SLloyd Pique struct wl_resource *resource,
2367*84e872a0SLloyd Pique struct wl_resource *seat,
2368*84e872a0SLloyd Pique uint32_t serial);
2369*84e872a0SLloyd Pique /**
2370*84e872a0SLloyd Pique * start an interactive resize
2371*84e872a0SLloyd Pique *
2372*84e872a0SLloyd Pique * Start a pointer-driven resizing of the surface.
2373*84e872a0SLloyd Pique *
2374*84e872a0SLloyd Pique * This request must be used in response to a button press event.
2375*84e872a0SLloyd Pique * The server may ignore resize requests depending on the state of
2376*84e872a0SLloyd Pique * the surface (e.g. fullscreen or maximized).
2377*84e872a0SLloyd Pique * @param seat seat whose pointer is used
2378*84e872a0SLloyd Pique * @param serial serial number of the implicit grab on the pointer
2379*84e872a0SLloyd Pique * @param edges which edge or corner is being dragged
2380*84e872a0SLloyd Pique */
2381*84e872a0SLloyd Pique void (*resize)(struct wl_client *client,
2382*84e872a0SLloyd Pique struct wl_resource *resource,
2383*84e872a0SLloyd Pique struct wl_resource *seat,
2384*84e872a0SLloyd Pique uint32_t serial,
2385*84e872a0SLloyd Pique uint32_t edges);
2386*84e872a0SLloyd Pique /**
2387*84e872a0SLloyd Pique * make the surface a toplevel surface
2388*84e872a0SLloyd Pique *
2389*84e872a0SLloyd Pique * Map the surface as a toplevel surface.
2390*84e872a0SLloyd Pique *
2391*84e872a0SLloyd Pique * A toplevel surface is not fullscreen, maximized or transient.
2392*84e872a0SLloyd Pique */
2393*84e872a0SLloyd Pique void (*set_toplevel)(struct wl_client *client,
2394*84e872a0SLloyd Pique struct wl_resource *resource);
2395*84e872a0SLloyd Pique /**
2396*84e872a0SLloyd Pique * make the surface a transient surface
2397*84e872a0SLloyd Pique *
2398*84e872a0SLloyd Pique * Map the surface relative to an existing surface.
2399*84e872a0SLloyd Pique *
2400*84e872a0SLloyd Pique * The x and y arguments specify the location of the upper left
2401*84e872a0SLloyd Pique * corner of the surface relative to the upper left corner of the
2402*84e872a0SLloyd Pique * parent surface, in surface-local coordinates.
2403*84e872a0SLloyd Pique *
2404*84e872a0SLloyd Pique * The flags argument controls details of the transient behaviour.
2405*84e872a0SLloyd Pique * @param parent parent surface
2406*84e872a0SLloyd Pique * @param x surface-local x coordinate
2407*84e872a0SLloyd Pique * @param y surface-local y coordinate
2408*84e872a0SLloyd Pique * @param flags transient surface behavior
2409*84e872a0SLloyd Pique */
2410*84e872a0SLloyd Pique void (*set_transient)(struct wl_client *client,
2411*84e872a0SLloyd Pique struct wl_resource *resource,
2412*84e872a0SLloyd Pique struct wl_resource *parent,
2413*84e872a0SLloyd Pique int32_t x,
2414*84e872a0SLloyd Pique int32_t y,
2415*84e872a0SLloyd Pique uint32_t flags);
2416*84e872a0SLloyd Pique /**
2417*84e872a0SLloyd Pique * make the surface a fullscreen surface
2418*84e872a0SLloyd Pique *
2419*84e872a0SLloyd Pique * Map the surface as a fullscreen surface.
2420*84e872a0SLloyd Pique *
2421*84e872a0SLloyd Pique * If an output parameter is given then the surface will be made
2422*84e872a0SLloyd Pique * fullscreen on that output. If the client does not specify the
2423*84e872a0SLloyd Pique * output then the compositor will apply its policy - usually
2424*84e872a0SLloyd Pique * choosing the output on which the surface has the biggest surface
2425*84e872a0SLloyd Pique * area.
2426*84e872a0SLloyd Pique *
2427*84e872a0SLloyd Pique * The client may specify a method to resolve a size conflict
2428*84e872a0SLloyd Pique * between the output size and the surface size - this is provided
2429*84e872a0SLloyd Pique * through the method parameter.
2430*84e872a0SLloyd Pique *
2431*84e872a0SLloyd Pique * The framerate parameter is used only when the method is set to
2432*84e872a0SLloyd Pique * "driver", to indicate the preferred framerate. A value of 0
2433*84e872a0SLloyd Pique * indicates that the client does not care about framerate. The
2434*84e872a0SLloyd Pique * framerate is specified in mHz, that is framerate of 60000 is
2435*84e872a0SLloyd Pique * 60Hz.
2436*84e872a0SLloyd Pique *
2437*84e872a0SLloyd Pique * A method of "scale" or "driver" implies a scaling operation of
2438*84e872a0SLloyd Pique * the surface, either via a direct scaling operation or a change
2439*84e872a0SLloyd Pique * of the output mode. This will override any kind of output
2440*84e872a0SLloyd Pique * scaling, so that mapping a surface with a buffer size equal to
2441*84e872a0SLloyd Pique * the mode can fill the screen independent of buffer_scale.
2442*84e872a0SLloyd Pique *
2443*84e872a0SLloyd Pique * A method of "fill" means we don't scale up the buffer, however
2444*84e872a0SLloyd Pique * any output scale is applied. This means that you may run into an
2445*84e872a0SLloyd Pique * edge case where the application maps a buffer with the same size
2446*84e872a0SLloyd Pique * of the output mode but buffer_scale 1 (thus making a surface
2447*84e872a0SLloyd Pique * larger than the output). In this case it is allowed to downscale
2448*84e872a0SLloyd Pique * the results to fit the screen.
2449*84e872a0SLloyd Pique *
2450*84e872a0SLloyd Pique * The compositor must reply to this request with a configure event
2451*84e872a0SLloyd Pique * with the dimensions for the output on which the surface will be
2452*84e872a0SLloyd Pique * made fullscreen.
2453*84e872a0SLloyd Pique * @param method method for resolving size conflict
2454*84e872a0SLloyd Pique * @param framerate framerate in mHz
2455*84e872a0SLloyd Pique * @param output output on which the surface is to be fullscreen
2456*84e872a0SLloyd Pique */
2457*84e872a0SLloyd Pique void (*set_fullscreen)(struct wl_client *client,
2458*84e872a0SLloyd Pique struct wl_resource *resource,
2459*84e872a0SLloyd Pique uint32_t method,
2460*84e872a0SLloyd Pique uint32_t framerate,
2461*84e872a0SLloyd Pique struct wl_resource *output);
2462*84e872a0SLloyd Pique /**
2463*84e872a0SLloyd Pique * make the surface a popup surface
2464*84e872a0SLloyd Pique *
2465*84e872a0SLloyd Pique * Map the surface as a popup.
2466*84e872a0SLloyd Pique *
2467*84e872a0SLloyd Pique * A popup surface is a transient surface with an added pointer
2468*84e872a0SLloyd Pique * grab.
2469*84e872a0SLloyd Pique *
2470*84e872a0SLloyd Pique * An existing implicit grab will be changed to owner-events mode,
2471*84e872a0SLloyd Pique * and the popup grab will continue after the implicit grab ends
2472*84e872a0SLloyd Pique * (i.e. releasing the mouse button does not cause the popup to be
2473*84e872a0SLloyd Pique * unmapped).
2474*84e872a0SLloyd Pique *
2475*84e872a0SLloyd Pique * The popup grab continues until the window is destroyed or a
2476*84e872a0SLloyd Pique * mouse button is pressed in any other client's window. A click in
2477*84e872a0SLloyd Pique * any of the client's surfaces is reported as normal, however,
2478*84e872a0SLloyd Pique * clicks in other clients' surfaces will be discarded and trigger
2479*84e872a0SLloyd Pique * the callback.
2480*84e872a0SLloyd Pique *
2481*84e872a0SLloyd Pique * The x and y arguments specify the location of the upper left
2482*84e872a0SLloyd Pique * corner of the surface relative to the upper left corner of the
2483*84e872a0SLloyd Pique * parent surface, in surface-local coordinates.
2484*84e872a0SLloyd Pique * @param seat seat whose pointer is used
2485*84e872a0SLloyd Pique * @param serial serial number of the implicit grab on the pointer
2486*84e872a0SLloyd Pique * @param parent parent surface
2487*84e872a0SLloyd Pique * @param x surface-local x coordinate
2488*84e872a0SLloyd Pique * @param y surface-local y coordinate
2489*84e872a0SLloyd Pique * @param flags transient surface behavior
2490*84e872a0SLloyd Pique */
2491*84e872a0SLloyd Pique void (*set_popup)(struct wl_client *client,
2492*84e872a0SLloyd Pique struct wl_resource *resource,
2493*84e872a0SLloyd Pique struct wl_resource *seat,
2494*84e872a0SLloyd Pique uint32_t serial,
2495*84e872a0SLloyd Pique struct wl_resource *parent,
2496*84e872a0SLloyd Pique int32_t x,
2497*84e872a0SLloyd Pique int32_t y,
2498*84e872a0SLloyd Pique uint32_t flags);
2499*84e872a0SLloyd Pique /**
2500*84e872a0SLloyd Pique * make the surface a maximized surface
2501*84e872a0SLloyd Pique *
2502*84e872a0SLloyd Pique * Map the surface as a maximized surface.
2503*84e872a0SLloyd Pique *
2504*84e872a0SLloyd Pique * If an output parameter is given then the surface will be
2505*84e872a0SLloyd Pique * maximized on that output. If the client does not specify the
2506*84e872a0SLloyd Pique * output then the compositor will apply its policy - usually
2507*84e872a0SLloyd Pique * choosing the output on which the surface has the biggest surface
2508*84e872a0SLloyd Pique * area.
2509*84e872a0SLloyd Pique *
2510*84e872a0SLloyd Pique * The compositor will reply with a configure event telling the
2511*84e872a0SLloyd Pique * expected new surface size. The operation is completed on the
2512*84e872a0SLloyd Pique * next buffer attach to this surface.
2513*84e872a0SLloyd Pique *
2514*84e872a0SLloyd Pique * A maximized surface typically fills the entire output it is
2515*84e872a0SLloyd Pique * bound to, except for desktop elements such as panels. This is
2516*84e872a0SLloyd Pique * the main difference between a maximized shell surface and a
2517*84e872a0SLloyd Pique * fullscreen shell surface.
2518*84e872a0SLloyd Pique *
2519*84e872a0SLloyd Pique * The details depend on the compositor implementation.
2520*84e872a0SLloyd Pique * @param output output on which the surface is to be maximized
2521*84e872a0SLloyd Pique */
2522*84e872a0SLloyd Pique void (*set_maximized)(struct wl_client *client,
2523*84e872a0SLloyd Pique struct wl_resource *resource,
2524*84e872a0SLloyd Pique struct wl_resource *output);
2525*84e872a0SLloyd Pique /**
2526*84e872a0SLloyd Pique * set surface title
2527*84e872a0SLloyd Pique *
2528*84e872a0SLloyd Pique * Set a short title for the surface.
2529*84e872a0SLloyd Pique *
2530*84e872a0SLloyd Pique * This string may be used to identify the surface in a task bar,
2531*84e872a0SLloyd Pique * window list, or other user interface elements provided by the
2532*84e872a0SLloyd Pique * compositor.
2533*84e872a0SLloyd Pique *
2534*84e872a0SLloyd Pique * The string must be encoded in UTF-8.
2535*84e872a0SLloyd Pique * @param title surface title
2536*84e872a0SLloyd Pique */
2537*84e872a0SLloyd Pique void (*set_title)(struct wl_client *client,
2538*84e872a0SLloyd Pique struct wl_resource *resource,
2539*84e872a0SLloyd Pique const char *title);
2540*84e872a0SLloyd Pique /**
2541*84e872a0SLloyd Pique * set surface class
2542*84e872a0SLloyd Pique *
2543*84e872a0SLloyd Pique * Set a class for the surface.
2544*84e872a0SLloyd Pique *
2545*84e872a0SLloyd Pique * The surface class identifies the general class of applications
2546*84e872a0SLloyd Pique * to which the surface belongs. A common convention is to use the
2547*84e872a0SLloyd Pique * file name (or the full path if it is a non-standard location) of
2548*84e872a0SLloyd Pique * the application's .desktop file as the class.
2549*84e872a0SLloyd Pique * @param class_ surface class
2550*84e872a0SLloyd Pique */
2551*84e872a0SLloyd Pique void (*set_class)(struct wl_client *client,
2552*84e872a0SLloyd Pique struct wl_resource *resource,
2553*84e872a0SLloyd Pique const char *class_);
2554*84e872a0SLloyd Pique };
2555*84e872a0SLloyd Pique
2556*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_PING 0
2557*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_CONFIGURE 1
2558*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_POPUP_DONE 2
2559*84e872a0SLloyd Pique
2560*84e872a0SLloyd Pique /**
2561*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2562*84e872a0SLloyd Pique */
2563*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_PING_SINCE_VERSION 1
2564*84e872a0SLloyd Pique /**
2565*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2566*84e872a0SLloyd Pique */
2567*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1
2568*84e872a0SLloyd Pique /**
2569*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2570*84e872a0SLloyd Pique */
2571*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 1
2572*84e872a0SLloyd Pique
2573*84e872a0SLloyd Pique /**
2574*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2575*84e872a0SLloyd Pique */
2576*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1
2577*84e872a0SLloyd Pique /**
2578*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2579*84e872a0SLloyd Pique */
2580*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1
2581*84e872a0SLloyd Pique /**
2582*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2583*84e872a0SLloyd Pique */
2584*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1
2585*84e872a0SLloyd Pique /**
2586*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2587*84e872a0SLloyd Pique */
2588*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1
2589*84e872a0SLloyd Pique /**
2590*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2591*84e872a0SLloyd Pique */
2592*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1
2593*84e872a0SLloyd Pique /**
2594*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2595*84e872a0SLloyd Pique */
2596*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
2597*84e872a0SLloyd Pique /**
2598*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2599*84e872a0SLloyd Pique */
2600*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1
2601*84e872a0SLloyd Pique /**
2602*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2603*84e872a0SLloyd Pique */
2604*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
2605*84e872a0SLloyd Pique /**
2606*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2607*84e872a0SLloyd Pique */
2608*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1
2609*84e872a0SLloyd Pique /**
2610*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2611*84e872a0SLloyd Pique */
2612*84e872a0SLloyd Pique #define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1
2613*84e872a0SLloyd Pique
2614*84e872a0SLloyd Pique /**
2615*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2616*84e872a0SLloyd Pique * Sends an ping event to the client owning the resource.
2617*84e872a0SLloyd Pique * @param resource_ The client's resource
2618*84e872a0SLloyd Pique * @param serial serial number of the ping
2619*84e872a0SLloyd Pique */
2620*84e872a0SLloyd Pique static inline void
wl_shell_surface_send_ping(struct wl_resource * resource_,uint32_t serial)2621*84e872a0SLloyd Pique wl_shell_surface_send_ping(struct wl_resource *resource_, uint32_t serial)
2622*84e872a0SLloyd Pique {
2623*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_SHELL_SURFACE_PING, serial);
2624*84e872a0SLloyd Pique }
2625*84e872a0SLloyd Pique
2626*84e872a0SLloyd Pique /**
2627*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2628*84e872a0SLloyd Pique * Sends an configure event to the client owning the resource.
2629*84e872a0SLloyd Pique * @param resource_ The client's resource
2630*84e872a0SLloyd Pique * @param edges how the surface was resized
2631*84e872a0SLloyd Pique * @param width new width of the surface
2632*84e872a0SLloyd Pique * @param height new height of the surface
2633*84e872a0SLloyd Pique */
2634*84e872a0SLloyd Pique static inline void
wl_shell_surface_send_configure(struct wl_resource * resource_,uint32_t edges,int32_t width,int32_t height)2635*84e872a0SLloyd Pique wl_shell_surface_send_configure(struct wl_resource *resource_, uint32_t edges, int32_t width, int32_t height)
2636*84e872a0SLloyd Pique {
2637*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_SHELL_SURFACE_CONFIGURE, edges, width, height);
2638*84e872a0SLloyd Pique }
2639*84e872a0SLloyd Pique
2640*84e872a0SLloyd Pique /**
2641*84e872a0SLloyd Pique * @ingroup iface_wl_shell_surface
2642*84e872a0SLloyd Pique * Sends an popup_done event to the client owning the resource.
2643*84e872a0SLloyd Pique * @param resource_ The client's resource
2644*84e872a0SLloyd Pique */
2645*84e872a0SLloyd Pique static inline void
wl_shell_surface_send_popup_done(struct wl_resource * resource_)2646*84e872a0SLloyd Pique wl_shell_surface_send_popup_done(struct wl_resource *resource_)
2647*84e872a0SLloyd Pique {
2648*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_SHELL_SURFACE_POPUP_DONE);
2649*84e872a0SLloyd Pique }
2650*84e872a0SLloyd Pique
2651*84e872a0SLloyd Pique #ifndef WL_SURFACE_ERROR_ENUM
2652*84e872a0SLloyd Pique #define WL_SURFACE_ERROR_ENUM
2653*84e872a0SLloyd Pique /**
2654*84e872a0SLloyd Pique * @ingroup iface_wl_surface
2655*84e872a0SLloyd Pique * wl_surface error values
2656*84e872a0SLloyd Pique *
2657*84e872a0SLloyd Pique * These errors can be emitted in response to wl_surface requests.
2658*84e872a0SLloyd Pique */
2659*84e872a0SLloyd Pique enum wl_surface_error {
2660*84e872a0SLloyd Pique /**
2661*84e872a0SLloyd Pique * buffer scale value is invalid
2662*84e872a0SLloyd Pique */
2663*84e872a0SLloyd Pique WL_SURFACE_ERROR_INVALID_SCALE = 0,
2664*84e872a0SLloyd Pique /**
2665*84e872a0SLloyd Pique * buffer transform value is invalid
2666*84e872a0SLloyd Pique */
2667*84e872a0SLloyd Pique WL_SURFACE_ERROR_INVALID_TRANSFORM = 1,
2668*84e872a0SLloyd Pique };
2669*84e872a0SLloyd Pique #endif /* WL_SURFACE_ERROR_ENUM */
2670*84e872a0SLloyd Pique
2671*84e872a0SLloyd Pique /**
2672*84e872a0SLloyd Pique * @ingroup iface_wl_surface
2673*84e872a0SLloyd Pique * @struct wl_surface_interface
2674*84e872a0SLloyd Pique */
2675*84e872a0SLloyd Pique struct wl_surface_interface {
2676*84e872a0SLloyd Pique /**
2677*84e872a0SLloyd Pique * delete surface
2678*84e872a0SLloyd Pique *
2679*84e872a0SLloyd Pique * Deletes the surface and invalidates its object ID.
2680*84e872a0SLloyd Pique */
2681*84e872a0SLloyd Pique void (*destroy)(struct wl_client *client,
2682*84e872a0SLloyd Pique struct wl_resource *resource);
2683*84e872a0SLloyd Pique /**
2684*84e872a0SLloyd Pique * set the surface contents
2685*84e872a0SLloyd Pique *
2686*84e872a0SLloyd Pique * Set a buffer as the content of this surface.
2687*84e872a0SLloyd Pique *
2688*84e872a0SLloyd Pique * The new size of the surface is calculated based on the buffer
2689*84e872a0SLloyd Pique * size transformed by the inverse buffer_transform and the inverse
2690*84e872a0SLloyd Pique * buffer_scale. This means that the supplied buffer must be an
2691*84e872a0SLloyd Pique * integer multiple of the buffer_scale.
2692*84e872a0SLloyd Pique *
2693*84e872a0SLloyd Pique * The x and y arguments specify the location of the new pending
2694*84e872a0SLloyd Pique * buffer's upper left corner, relative to the current buffer's
2695*84e872a0SLloyd Pique * upper left corner, in surface-local coordinates. In other words,
2696*84e872a0SLloyd Pique * the x and y, combined with the new surface size define in which
2697*84e872a0SLloyd Pique * directions the surface's size changes.
2698*84e872a0SLloyd Pique *
2699*84e872a0SLloyd Pique * Surface contents are double-buffered state, see
2700*84e872a0SLloyd Pique * wl_surface.commit.
2701*84e872a0SLloyd Pique *
2702*84e872a0SLloyd Pique * The initial surface contents are void; there is no content.
2703*84e872a0SLloyd Pique * wl_surface.attach assigns the given wl_buffer as the pending
2704*84e872a0SLloyd Pique * wl_buffer. wl_surface.commit makes the pending wl_buffer the new
2705*84e872a0SLloyd Pique * surface contents, and the size of the surface becomes the size
2706*84e872a0SLloyd Pique * calculated from the wl_buffer, as described above. After commit,
2707*84e872a0SLloyd Pique * there is no pending buffer until the next attach.
2708*84e872a0SLloyd Pique *
2709*84e872a0SLloyd Pique * Committing a pending wl_buffer allows the compositor to read the
2710*84e872a0SLloyd Pique * pixels in the wl_buffer. The compositor may access the pixels at
2711*84e872a0SLloyd Pique * any time after the wl_surface.commit request. When the
2712*84e872a0SLloyd Pique * compositor will not access the pixels anymore, it will send the
2713*84e872a0SLloyd Pique * wl_buffer.release event. Only after receiving wl_buffer.release,
2714*84e872a0SLloyd Pique * the client may reuse the wl_buffer. A wl_buffer that has been
2715*84e872a0SLloyd Pique * attached and then replaced by another attach instead of
2716*84e872a0SLloyd Pique * committed will not receive a release event, and is not used by
2717*84e872a0SLloyd Pique * the compositor.
2718*84e872a0SLloyd Pique *
2719*84e872a0SLloyd Pique * Destroying the wl_buffer after wl_buffer.release does not change
2720*84e872a0SLloyd Pique * the surface contents. However, if the client destroys the
2721*84e872a0SLloyd Pique * wl_buffer before receiving the wl_buffer.release event, the
2722*84e872a0SLloyd Pique * surface contents become undefined immediately.
2723*84e872a0SLloyd Pique *
2724*84e872a0SLloyd Pique * If wl_surface.attach is sent with a NULL wl_buffer, the
2725*84e872a0SLloyd Pique * following wl_surface.commit will remove the surface content.
2726*84e872a0SLloyd Pique * @param buffer buffer of surface contents
2727*84e872a0SLloyd Pique * @param x surface-local x coordinate
2728*84e872a0SLloyd Pique * @param y surface-local y coordinate
2729*84e872a0SLloyd Pique */
2730*84e872a0SLloyd Pique void (*attach)(struct wl_client *client,
2731*84e872a0SLloyd Pique struct wl_resource *resource,
2732*84e872a0SLloyd Pique struct wl_resource *buffer,
2733*84e872a0SLloyd Pique int32_t x,
2734*84e872a0SLloyd Pique int32_t y);
2735*84e872a0SLloyd Pique /**
2736*84e872a0SLloyd Pique * mark part of the surface damaged
2737*84e872a0SLloyd Pique *
2738*84e872a0SLloyd Pique * This request is used to describe the regions where the pending
2739*84e872a0SLloyd Pique * buffer is different from the current surface contents, and where
2740*84e872a0SLloyd Pique * the surface therefore needs to be repainted. The compositor
2741*84e872a0SLloyd Pique * ignores the parts of the damage that fall outside of the
2742*84e872a0SLloyd Pique * surface.
2743*84e872a0SLloyd Pique *
2744*84e872a0SLloyd Pique * Damage is double-buffered state, see wl_surface.commit.
2745*84e872a0SLloyd Pique *
2746*84e872a0SLloyd Pique * The damage rectangle is specified in surface-local coordinates,
2747*84e872a0SLloyd Pique * where x and y specify the upper left corner of the damage
2748*84e872a0SLloyd Pique * rectangle.
2749*84e872a0SLloyd Pique *
2750*84e872a0SLloyd Pique * The initial value for pending damage is empty: no damage.
2751*84e872a0SLloyd Pique * wl_surface.damage adds pending damage: the new pending damage is
2752*84e872a0SLloyd Pique * the union of old pending damage and the given rectangle.
2753*84e872a0SLloyd Pique *
2754*84e872a0SLloyd Pique * wl_surface.commit assigns pending damage as the current damage,
2755*84e872a0SLloyd Pique * and clears pending damage. The server will clear the current
2756*84e872a0SLloyd Pique * damage as it repaints the surface.
2757*84e872a0SLloyd Pique *
2758*84e872a0SLloyd Pique * Alternatively, damage can be posted with
2759*84e872a0SLloyd Pique * wl_surface.damage_buffer which uses buffer coordinates instead
2760*84e872a0SLloyd Pique * of surface coordinates, and is probably the preferred and
2761*84e872a0SLloyd Pique * intuitive way of doing this.
2762*84e872a0SLloyd Pique * @param x surface-local x coordinate
2763*84e872a0SLloyd Pique * @param y surface-local y coordinate
2764*84e872a0SLloyd Pique * @param width width of damage rectangle
2765*84e872a0SLloyd Pique * @param height height of damage rectangle
2766*84e872a0SLloyd Pique */
2767*84e872a0SLloyd Pique void (*damage)(struct wl_client *client,
2768*84e872a0SLloyd Pique struct wl_resource *resource,
2769*84e872a0SLloyd Pique int32_t x,
2770*84e872a0SLloyd Pique int32_t y,
2771*84e872a0SLloyd Pique int32_t width,
2772*84e872a0SLloyd Pique int32_t height);
2773*84e872a0SLloyd Pique /**
2774*84e872a0SLloyd Pique * request a frame throttling hint
2775*84e872a0SLloyd Pique *
2776*84e872a0SLloyd Pique * Request a notification when it is a good time to start drawing
2777*84e872a0SLloyd Pique * a new frame, by creating a frame callback. This is useful for
2778*84e872a0SLloyd Pique * throttling redrawing operations, and driving animations.
2779*84e872a0SLloyd Pique *
2780*84e872a0SLloyd Pique * When a client is animating on a wl_surface, it can use the
2781*84e872a0SLloyd Pique * 'frame' request to get notified when it is a good time to draw
2782*84e872a0SLloyd Pique * and commit the next frame of animation. If the client commits an
2783*84e872a0SLloyd Pique * update earlier than that, it is likely that some updates will
2784*84e872a0SLloyd Pique * not make it to the display, and the client is wasting resources
2785*84e872a0SLloyd Pique * by drawing too often.
2786*84e872a0SLloyd Pique *
2787*84e872a0SLloyd Pique * The frame request will take effect on the next
2788*84e872a0SLloyd Pique * wl_surface.commit. The notification will only be posted for one
2789*84e872a0SLloyd Pique * frame unless requested again. For a wl_surface, the
2790*84e872a0SLloyd Pique * notifications are posted in the order the frame requests were
2791*84e872a0SLloyd Pique * committed.
2792*84e872a0SLloyd Pique *
2793*84e872a0SLloyd Pique * The server must send the notifications so that a client will not
2794*84e872a0SLloyd Pique * send excessive updates, while still allowing the highest
2795*84e872a0SLloyd Pique * possible update rate for clients that wait for the reply before
2796*84e872a0SLloyd Pique * drawing again. The server should give some time for the client
2797*84e872a0SLloyd Pique * to draw and commit after sending the frame callback events to
2798*84e872a0SLloyd Pique * let it hit the next output refresh.
2799*84e872a0SLloyd Pique *
2800*84e872a0SLloyd Pique * A server should avoid signaling the frame callbacks if the
2801*84e872a0SLloyd Pique * surface is not visible in any way, e.g. the surface is
2802*84e872a0SLloyd Pique * off-screen, or completely obscured by other opaque surfaces.
2803*84e872a0SLloyd Pique *
2804*84e872a0SLloyd Pique * The object returned by this request will be destroyed by the
2805*84e872a0SLloyd Pique * compositor after the callback is fired and as such the client
2806*84e872a0SLloyd Pique * must not attempt to use it after that point.
2807*84e872a0SLloyd Pique *
2808*84e872a0SLloyd Pique * The callback_data passed in the callback is the current time, in
2809*84e872a0SLloyd Pique * milliseconds, with an undefined base.
2810*84e872a0SLloyd Pique * @param callback callback object for the frame request
2811*84e872a0SLloyd Pique */
2812*84e872a0SLloyd Pique void (*frame)(struct wl_client *client,
2813*84e872a0SLloyd Pique struct wl_resource *resource,
2814*84e872a0SLloyd Pique uint32_t callback);
2815*84e872a0SLloyd Pique /**
2816*84e872a0SLloyd Pique * set opaque region
2817*84e872a0SLloyd Pique *
2818*84e872a0SLloyd Pique * This request sets the region of the surface that contains
2819*84e872a0SLloyd Pique * opaque content.
2820*84e872a0SLloyd Pique *
2821*84e872a0SLloyd Pique * The opaque region is an optimization hint for the compositor
2822*84e872a0SLloyd Pique * that lets it optimize the redrawing of content behind opaque
2823*84e872a0SLloyd Pique * regions. Setting an opaque region is not required for correct
2824*84e872a0SLloyd Pique * behaviour, but marking transparent content as opaque will result
2825*84e872a0SLloyd Pique * in repaint artifacts.
2826*84e872a0SLloyd Pique *
2827*84e872a0SLloyd Pique * The opaque region is specified in surface-local coordinates.
2828*84e872a0SLloyd Pique *
2829*84e872a0SLloyd Pique * The compositor ignores the parts of the opaque region that fall
2830*84e872a0SLloyd Pique * outside of the surface.
2831*84e872a0SLloyd Pique *
2832*84e872a0SLloyd Pique * Opaque region is double-buffered state, see wl_surface.commit.
2833*84e872a0SLloyd Pique *
2834*84e872a0SLloyd Pique * wl_surface.set_opaque_region changes the pending opaque region.
2835*84e872a0SLloyd Pique * wl_surface.commit copies the pending region to the current
2836*84e872a0SLloyd Pique * region. Otherwise, the pending and current regions are never
2837*84e872a0SLloyd Pique * changed.
2838*84e872a0SLloyd Pique *
2839*84e872a0SLloyd Pique * The initial value for an opaque region is empty. Setting the
2840*84e872a0SLloyd Pique * pending opaque region has copy semantics, and the wl_region
2841*84e872a0SLloyd Pique * object can be destroyed immediately. A NULL wl_region causes the
2842*84e872a0SLloyd Pique * pending opaque region to be set to empty.
2843*84e872a0SLloyd Pique * @param region opaque region of the surface
2844*84e872a0SLloyd Pique */
2845*84e872a0SLloyd Pique void (*set_opaque_region)(struct wl_client *client,
2846*84e872a0SLloyd Pique struct wl_resource *resource,
2847*84e872a0SLloyd Pique struct wl_resource *region);
2848*84e872a0SLloyd Pique /**
2849*84e872a0SLloyd Pique * set input region
2850*84e872a0SLloyd Pique *
2851*84e872a0SLloyd Pique * This request sets the region of the surface that can receive
2852*84e872a0SLloyd Pique * pointer and touch events.
2853*84e872a0SLloyd Pique *
2854*84e872a0SLloyd Pique * Input events happening outside of this region will try the next
2855*84e872a0SLloyd Pique * surface in the server surface stack. The compositor ignores the
2856*84e872a0SLloyd Pique * parts of the input region that fall outside of the surface.
2857*84e872a0SLloyd Pique *
2858*84e872a0SLloyd Pique * The input region is specified in surface-local coordinates.
2859*84e872a0SLloyd Pique *
2860*84e872a0SLloyd Pique * Input region is double-buffered state, see wl_surface.commit.
2861*84e872a0SLloyd Pique *
2862*84e872a0SLloyd Pique * wl_surface.set_input_region changes the pending input region.
2863*84e872a0SLloyd Pique * wl_surface.commit copies the pending region to the current
2864*84e872a0SLloyd Pique * region. Otherwise the pending and current regions are never
2865*84e872a0SLloyd Pique * changed, except cursor and icon surfaces are special cases, see
2866*84e872a0SLloyd Pique * wl_pointer.set_cursor and wl_data_device.start_drag.
2867*84e872a0SLloyd Pique *
2868*84e872a0SLloyd Pique * The initial value for an input region is infinite. That means
2869*84e872a0SLloyd Pique * the whole surface will accept input. Setting the pending input
2870*84e872a0SLloyd Pique * region has copy semantics, and the wl_region object can be
2871*84e872a0SLloyd Pique * destroyed immediately. A NULL wl_region causes the input region
2872*84e872a0SLloyd Pique * to be set to infinite.
2873*84e872a0SLloyd Pique * @param region input region of the surface
2874*84e872a0SLloyd Pique */
2875*84e872a0SLloyd Pique void (*set_input_region)(struct wl_client *client,
2876*84e872a0SLloyd Pique struct wl_resource *resource,
2877*84e872a0SLloyd Pique struct wl_resource *region);
2878*84e872a0SLloyd Pique /**
2879*84e872a0SLloyd Pique * commit pending surface state
2880*84e872a0SLloyd Pique *
2881*84e872a0SLloyd Pique * Surface state (input, opaque, and damage regions, attached
2882*84e872a0SLloyd Pique * buffers, etc.) is double-buffered. Protocol requests modify the
2883*84e872a0SLloyd Pique * pending state, as opposed to the current state in use by the
2884*84e872a0SLloyd Pique * compositor. A commit request atomically applies all pending
2885*84e872a0SLloyd Pique * state, replacing the current state. After commit, the new
2886*84e872a0SLloyd Pique * pending state is as documented for each related request.
2887*84e872a0SLloyd Pique *
2888*84e872a0SLloyd Pique * On commit, a pending wl_buffer is applied first, and all other
2889*84e872a0SLloyd Pique * state second. This means that all coordinates in double-buffered
2890*84e872a0SLloyd Pique * state are relative to the new wl_buffer coming into use, except
2891*84e872a0SLloyd Pique * for wl_surface.attach itself. If there is no pending wl_buffer,
2892*84e872a0SLloyd Pique * the coordinates are relative to the current surface contents.
2893*84e872a0SLloyd Pique *
2894*84e872a0SLloyd Pique * All requests that need a commit to become effective are
2895*84e872a0SLloyd Pique * documented to affect double-buffered state.
2896*84e872a0SLloyd Pique *
2897*84e872a0SLloyd Pique * Other interfaces may add further double-buffered surface state.
2898*84e872a0SLloyd Pique */
2899*84e872a0SLloyd Pique void (*commit)(struct wl_client *client,
2900*84e872a0SLloyd Pique struct wl_resource *resource);
2901*84e872a0SLloyd Pique /**
2902*84e872a0SLloyd Pique * sets the buffer transformation
2903*84e872a0SLloyd Pique *
2904*84e872a0SLloyd Pique * This request sets an optional transformation on how the
2905*84e872a0SLloyd Pique * compositor interprets the contents of the buffer attached to the
2906*84e872a0SLloyd Pique * surface. The accepted values for the transform parameter are the
2907*84e872a0SLloyd Pique * values for wl_output.transform.
2908*84e872a0SLloyd Pique *
2909*84e872a0SLloyd Pique * Buffer transform is double-buffered state, see
2910*84e872a0SLloyd Pique * wl_surface.commit.
2911*84e872a0SLloyd Pique *
2912*84e872a0SLloyd Pique * A newly created surface has its buffer transformation set to
2913*84e872a0SLloyd Pique * normal.
2914*84e872a0SLloyd Pique *
2915*84e872a0SLloyd Pique * wl_surface.set_buffer_transform changes the pending buffer
2916*84e872a0SLloyd Pique * transformation. wl_surface.commit copies the pending buffer
2917*84e872a0SLloyd Pique * transformation to the current one. Otherwise, the pending and
2918*84e872a0SLloyd Pique * current values are never changed.
2919*84e872a0SLloyd Pique *
2920*84e872a0SLloyd Pique * The purpose of this request is to allow clients to render
2921*84e872a0SLloyd Pique * content according to the output transform, thus permitting the
2922*84e872a0SLloyd Pique * compositor to use certain optimizations even if the display is
2923*84e872a0SLloyd Pique * rotated. Using hardware overlays and scanning out a client
2924*84e872a0SLloyd Pique * buffer for fullscreen surfaces are examples of such
2925*84e872a0SLloyd Pique * optimizations. Those optimizations are highly dependent on the
2926*84e872a0SLloyd Pique * compositor implementation, so the use of this request should be
2927*84e872a0SLloyd Pique * considered on a case-by-case basis.
2928*84e872a0SLloyd Pique *
2929*84e872a0SLloyd Pique * Note that if the transform value includes 90 or 270 degree
2930*84e872a0SLloyd Pique * rotation, the width of the buffer will become the surface height
2931*84e872a0SLloyd Pique * and the height of the buffer will become the surface width.
2932*84e872a0SLloyd Pique *
2933*84e872a0SLloyd Pique * If transform is not one of the values from the
2934*84e872a0SLloyd Pique * wl_output.transform enum the invalid_transform protocol error is
2935*84e872a0SLloyd Pique * raised.
2936*84e872a0SLloyd Pique * @param transform transform for interpreting buffer contents
2937*84e872a0SLloyd Pique * @since 2
2938*84e872a0SLloyd Pique */
2939*84e872a0SLloyd Pique void (*set_buffer_transform)(struct wl_client *client,
2940*84e872a0SLloyd Pique struct wl_resource *resource,
2941*84e872a0SLloyd Pique int32_t transform);
2942*84e872a0SLloyd Pique /**
2943*84e872a0SLloyd Pique * sets the buffer scaling factor
2944*84e872a0SLloyd Pique *
2945*84e872a0SLloyd Pique * This request sets an optional scaling factor on how the
2946*84e872a0SLloyd Pique * compositor interprets the contents of the buffer attached to the
2947*84e872a0SLloyd Pique * window.
2948*84e872a0SLloyd Pique *
2949*84e872a0SLloyd Pique * Buffer scale is double-buffered state, see wl_surface.commit.
2950*84e872a0SLloyd Pique *
2951*84e872a0SLloyd Pique * A newly created surface has its buffer scale set to 1.
2952*84e872a0SLloyd Pique *
2953*84e872a0SLloyd Pique * wl_surface.set_buffer_scale changes the pending buffer scale.
2954*84e872a0SLloyd Pique * wl_surface.commit copies the pending buffer scale to the current
2955*84e872a0SLloyd Pique * one. Otherwise, the pending and current values are never
2956*84e872a0SLloyd Pique * changed.
2957*84e872a0SLloyd Pique *
2958*84e872a0SLloyd Pique * The purpose of this request is to allow clients to supply higher
2959*84e872a0SLloyd Pique * resolution buffer data for use on high resolution outputs. It is
2960*84e872a0SLloyd Pique * intended that you pick the same buffer scale as the scale of the
2961*84e872a0SLloyd Pique * output that the surface is displayed on. This means the
2962*84e872a0SLloyd Pique * compositor can avoid scaling when rendering the surface on that
2963*84e872a0SLloyd Pique * output.
2964*84e872a0SLloyd Pique *
2965*84e872a0SLloyd Pique * Note that if the scale is larger than 1, then you have to attach
2966*84e872a0SLloyd Pique * a buffer that is larger (by a factor of scale in each dimension)
2967*84e872a0SLloyd Pique * than the desired surface size.
2968*84e872a0SLloyd Pique *
2969*84e872a0SLloyd Pique * If scale is not positive the invalid_scale protocol error is
2970*84e872a0SLloyd Pique * raised.
2971*84e872a0SLloyd Pique * @param scale positive scale for interpreting buffer contents
2972*84e872a0SLloyd Pique * @since 3
2973*84e872a0SLloyd Pique */
2974*84e872a0SLloyd Pique void (*set_buffer_scale)(struct wl_client *client,
2975*84e872a0SLloyd Pique struct wl_resource *resource,
2976*84e872a0SLloyd Pique int32_t scale);
2977*84e872a0SLloyd Pique /**
2978*84e872a0SLloyd Pique * mark part of the surface damaged using buffer coordinates
2979*84e872a0SLloyd Pique *
2980*84e872a0SLloyd Pique * This request is used to describe the regions where the pending
2981*84e872a0SLloyd Pique * buffer is different from the current surface contents, and where
2982*84e872a0SLloyd Pique * the surface therefore needs to be repainted. The compositor
2983*84e872a0SLloyd Pique * ignores the parts of the damage that fall outside of the
2984*84e872a0SLloyd Pique * surface.
2985*84e872a0SLloyd Pique *
2986*84e872a0SLloyd Pique * Damage is double-buffered state, see wl_surface.commit.
2987*84e872a0SLloyd Pique *
2988*84e872a0SLloyd Pique * The damage rectangle is specified in buffer coordinates, where x
2989*84e872a0SLloyd Pique * and y specify the upper left corner of the damage rectangle.
2990*84e872a0SLloyd Pique *
2991*84e872a0SLloyd Pique * The initial value for pending damage is empty: no damage.
2992*84e872a0SLloyd Pique * wl_surface.damage_buffer adds pending damage: the new pending
2993*84e872a0SLloyd Pique * damage is the union of old pending damage and the given
2994*84e872a0SLloyd Pique * rectangle.
2995*84e872a0SLloyd Pique *
2996*84e872a0SLloyd Pique * wl_surface.commit assigns pending damage as the current damage,
2997*84e872a0SLloyd Pique * and clears pending damage. The server will clear the current
2998*84e872a0SLloyd Pique * damage as it repaints the surface.
2999*84e872a0SLloyd Pique *
3000*84e872a0SLloyd Pique * This request differs from wl_surface.damage in only one way - it
3001*84e872a0SLloyd Pique * takes damage in buffer coordinates instead of surface-local
3002*84e872a0SLloyd Pique * coordinates. While this generally is more intuitive than surface
3003*84e872a0SLloyd Pique * coordinates, it is especially desirable when using wp_viewport
3004*84e872a0SLloyd Pique * or when a drawing library (like EGL) is unaware of buffer scale
3005*84e872a0SLloyd Pique * and buffer transform.
3006*84e872a0SLloyd Pique *
3007*84e872a0SLloyd Pique * Note: Because buffer transformation changes and damage requests
3008*84e872a0SLloyd Pique * may be interleaved in the protocol stream, it is impossible to
3009*84e872a0SLloyd Pique * determine the actual mapping between surface and buffer damage
3010*84e872a0SLloyd Pique * until wl_surface.commit time. Therefore, compositors wishing to
3011*84e872a0SLloyd Pique * take both kinds of damage into account will have to accumulate
3012*84e872a0SLloyd Pique * damage from the two requests separately and only transform from
3013*84e872a0SLloyd Pique * one to the other after receiving the wl_surface.commit.
3014*84e872a0SLloyd Pique * @param x buffer-local x coordinate
3015*84e872a0SLloyd Pique * @param y buffer-local y coordinate
3016*84e872a0SLloyd Pique * @param width width of damage rectangle
3017*84e872a0SLloyd Pique * @param height height of damage rectangle
3018*84e872a0SLloyd Pique * @since 4
3019*84e872a0SLloyd Pique */
3020*84e872a0SLloyd Pique void (*damage_buffer)(struct wl_client *client,
3021*84e872a0SLloyd Pique struct wl_resource *resource,
3022*84e872a0SLloyd Pique int32_t x,
3023*84e872a0SLloyd Pique int32_t y,
3024*84e872a0SLloyd Pique int32_t width,
3025*84e872a0SLloyd Pique int32_t height);
3026*84e872a0SLloyd Pique };
3027*84e872a0SLloyd Pique
3028*84e872a0SLloyd Pique #define WL_SURFACE_ENTER 0
3029*84e872a0SLloyd Pique #define WL_SURFACE_LEAVE 1
3030*84e872a0SLloyd Pique
3031*84e872a0SLloyd Pique /**
3032*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3033*84e872a0SLloyd Pique */
3034*84e872a0SLloyd Pique #define WL_SURFACE_ENTER_SINCE_VERSION 1
3035*84e872a0SLloyd Pique /**
3036*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3037*84e872a0SLloyd Pique */
3038*84e872a0SLloyd Pique #define WL_SURFACE_LEAVE_SINCE_VERSION 1
3039*84e872a0SLloyd Pique
3040*84e872a0SLloyd Pique /**
3041*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3042*84e872a0SLloyd Pique */
3043*84e872a0SLloyd Pique #define WL_SURFACE_DESTROY_SINCE_VERSION 1
3044*84e872a0SLloyd Pique /**
3045*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3046*84e872a0SLloyd Pique */
3047*84e872a0SLloyd Pique #define WL_SURFACE_ATTACH_SINCE_VERSION 1
3048*84e872a0SLloyd Pique /**
3049*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3050*84e872a0SLloyd Pique */
3051*84e872a0SLloyd Pique #define WL_SURFACE_DAMAGE_SINCE_VERSION 1
3052*84e872a0SLloyd Pique /**
3053*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3054*84e872a0SLloyd Pique */
3055*84e872a0SLloyd Pique #define WL_SURFACE_FRAME_SINCE_VERSION 1
3056*84e872a0SLloyd Pique /**
3057*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3058*84e872a0SLloyd Pique */
3059*84e872a0SLloyd Pique #define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1
3060*84e872a0SLloyd Pique /**
3061*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3062*84e872a0SLloyd Pique */
3063*84e872a0SLloyd Pique #define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1
3064*84e872a0SLloyd Pique /**
3065*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3066*84e872a0SLloyd Pique */
3067*84e872a0SLloyd Pique #define WL_SURFACE_COMMIT_SINCE_VERSION 1
3068*84e872a0SLloyd Pique /**
3069*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3070*84e872a0SLloyd Pique */
3071*84e872a0SLloyd Pique #define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2
3072*84e872a0SLloyd Pique /**
3073*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3074*84e872a0SLloyd Pique */
3075*84e872a0SLloyd Pique #define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3
3076*84e872a0SLloyd Pique /**
3077*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3078*84e872a0SLloyd Pique */
3079*84e872a0SLloyd Pique #define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4
3080*84e872a0SLloyd Pique
3081*84e872a0SLloyd Pique /**
3082*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3083*84e872a0SLloyd Pique * Sends an enter event to the client owning the resource.
3084*84e872a0SLloyd Pique * @param resource_ The client's resource
3085*84e872a0SLloyd Pique * @param output output entered by the surface
3086*84e872a0SLloyd Pique */
3087*84e872a0SLloyd Pique static inline void
wl_surface_send_enter(struct wl_resource * resource_,struct wl_resource * output)3088*84e872a0SLloyd Pique wl_surface_send_enter(struct wl_resource *resource_, struct wl_resource *output)
3089*84e872a0SLloyd Pique {
3090*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_SURFACE_ENTER, output);
3091*84e872a0SLloyd Pique }
3092*84e872a0SLloyd Pique
3093*84e872a0SLloyd Pique /**
3094*84e872a0SLloyd Pique * @ingroup iface_wl_surface
3095*84e872a0SLloyd Pique * Sends an leave event to the client owning the resource.
3096*84e872a0SLloyd Pique * @param resource_ The client's resource
3097*84e872a0SLloyd Pique * @param output output left by the surface
3098*84e872a0SLloyd Pique */
3099*84e872a0SLloyd Pique static inline void
wl_surface_send_leave(struct wl_resource * resource_,struct wl_resource * output)3100*84e872a0SLloyd Pique wl_surface_send_leave(struct wl_resource *resource_, struct wl_resource *output)
3101*84e872a0SLloyd Pique {
3102*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_SURFACE_LEAVE, output);
3103*84e872a0SLloyd Pique }
3104*84e872a0SLloyd Pique
3105*84e872a0SLloyd Pique #ifndef WL_SEAT_CAPABILITY_ENUM
3106*84e872a0SLloyd Pique #define WL_SEAT_CAPABILITY_ENUM
3107*84e872a0SLloyd Pique /**
3108*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3109*84e872a0SLloyd Pique * seat capability bitmask
3110*84e872a0SLloyd Pique *
3111*84e872a0SLloyd Pique * This is a bitmask of capabilities this seat has; if a member is
3112*84e872a0SLloyd Pique * set, then it is present on the seat.
3113*84e872a0SLloyd Pique */
3114*84e872a0SLloyd Pique enum wl_seat_capability {
3115*84e872a0SLloyd Pique /**
3116*84e872a0SLloyd Pique * the seat has pointer devices
3117*84e872a0SLloyd Pique */
3118*84e872a0SLloyd Pique WL_SEAT_CAPABILITY_POINTER = 1,
3119*84e872a0SLloyd Pique /**
3120*84e872a0SLloyd Pique * the seat has one or more keyboards
3121*84e872a0SLloyd Pique */
3122*84e872a0SLloyd Pique WL_SEAT_CAPABILITY_KEYBOARD = 2,
3123*84e872a0SLloyd Pique /**
3124*84e872a0SLloyd Pique * the seat has touch devices
3125*84e872a0SLloyd Pique */
3126*84e872a0SLloyd Pique WL_SEAT_CAPABILITY_TOUCH = 4,
3127*84e872a0SLloyd Pique };
3128*84e872a0SLloyd Pique #endif /* WL_SEAT_CAPABILITY_ENUM */
3129*84e872a0SLloyd Pique
3130*84e872a0SLloyd Pique /**
3131*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3132*84e872a0SLloyd Pique * @struct wl_seat_interface
3133*84e872a0SLloyd Pique */
3134*84e872a0SLloyd Pique struct wl_seat_interface {
3135*84e872a0SLloyd Pique /**
3136*84e872a0SLloyd Pique * return pointer object
3137*84e872a0SLloyd Pique *
3138*84e872a0SLloyd Pique * The ID provided will be initialized to the wl_pointer
3139*84e872a0SLloyd Pique * interface for this seat.
3140*84e872a0SLloyd Pique *
3141*84e872a0SLloyd Pique * This request only takes effect if the seat has the pointer
3142*84e872a0SLloyd Pique * capability, or has had the pointer capability in the past. It is
3143*84e872a0SLloyd Pique * a protocol violation to issue this request on a seat that has
3144*84e872a0SLloyd Pique * never had the pointer capability.
3145*84e872a0SLloyd Pique * @param id seat pointer
3146*84e872a0SLloyd Pique */
3147*84e872a0SLloyd Pique void (*get_pointer)(struct wl_client *client,
3148*84e872a0SLloyd Pique struct wl_resource *resource,
3149*84e872a0SLloyd Pique uint32_t id);
3150*84e872a0SLloyd Pique /**
3151*84e872a0SLloyd Pique * return keyboard object
3152*84e872a0SLloyd Pique *
3153*84e872a0SLloyd Pique * The ID provided will be initialized to the wl_keyboard
3154*84e872a0SLloyd Pique * interface for this seat.
3155*84e872a0SLloyd Pique *
3156*84e872a0SLloyd Pique * This request only takes effect if the seat has the keyboard
3157*84e872a0SLloyd Pique * capability, or has had the keyboard capability in the past. It
3158*84e872a0SLloyd Pique * is a protocol violation to issue this request on a seat that has
3159*84e872a0SLloyd Pique * never had the keyboard capability.
3160*84e872a0SLloyd Pique * @param id seat keyboard
3161*84e872a0SLloyd Pique */
3162*84e872a0SLloyd Pique void (*get_keyboard)(struct wl_client *client,
3163*84e872a0SLloyd Pique struct wl_resource *resource,
3164*84e872a0SLloyd Pique uint32_t id);
3165*84e872a0SLloyd Pique /**
3166*84e872a0SLloyd Pique * return touch object
3167*84e872a0SLloyd Pique *
3168*84e872a0SLloyd Pique * The ID provided will be initialized to the wl_touch interface
3169*84e872a0SLloyd Pique * for this seat.
3170*84e872a0SLloyd Pique *
3171*84e872a0SLloyd Pique * This request only takes effect if the seat has the touch
3172*84e872a0SLloyd Pique * capability, or has had the touch capability in the past. It is a
3173*84e872a0SLloyd Pique * protocol violation to issue this request on a seat that has
3174*84e872a0SLloyd Pique * never had the touch capability.
3175*84e872a0SLloyd Pique * @param id seat touch interface
3176*84e872a0SLloyd Pique */
3177*84e872a0SLloyd Pique void (*get_touch)(struct wl_client *client,
3178*84e872a0SLloyd Pique struct wl_resource *resource,
3179*84e872a0SLloyd Pique uint32_t id);
3180*84e872a0SLloyd Pique /**
3181*84e872a0SLloyd Pique * release the seat object
3182*84e872a0SLloyd Pique *
3183*84e872a0SLloyd Pique * Using this request a client can tell the server that it is not
3184*84e872a0SLloyd Pique * going to use the seat object anymore.
3185*84e872a0SLloyd Pique * @since 5
3186*84e872a0SLloyd Pique */
3187*84e872a0SLloyd Pique void (*release)(struct wl_client *client,
3188*84e872a0SLloyd Pique struct wl_resource *resource);
3189*84e872a0SLloyd Pique };
3190*84e872a0SLloyd Pique
3191*84e872a0SLloyd Pique #define WL_SEAT_CAPABILITIES 0
3192*84e872a0SLloyd Pique #define WL_SEAT_NAME 1
3193*84e872a0SLloyd Pique
3194*84e872a0SLloyd Pique /**
3195*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3196*84e872a0SLloyd Pique */
3197*84e872a0SLloyd Pique #define WL_SEAT_CAPABILITIES_SINCE_VERSION 1
3198*84e872a0SLloyd Pique /**
3199*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3200*84e872a0SLloyd Pique */
3201*84e872a0SLloyd Pique #define WL_SEAT_NAME_SINCE_VERSION 2
3202*84e872a0SLloyd Pique
3203*84e872a0SLloyd Pique /**
3204*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3205*84e872a0SLloyd Pique */
3206*84e872a0SLloyd Pique #define WL_SEAT_GET_POINTER_SINCE_VERSION 1
3207*84e872a0SLloyd Pique /**
3208*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3209*84e872a0SLloyd Pique */
3210*84e872a0SLloyd Pique #define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1
3211*84e872a0SLloyd Pique /**
3212*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3213*84e872a0SLloyd Pique */
3214*84e872a0SLloyd Pique #define WL_SEAT_GET_TOUCH_SINCE_VERSION 1
3215*84e872a0SLloyd Pique /**
3216*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3217*84e872a0SLloyd Pique */
3218*84e872a0SLloyd Pique #define WL_SEAT_RELEASE_SINCE_VERSION 5
3219*84e872a0SLloyd Pique
3220*84e872a0SLloyd Pique /**
3221*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3222*84e872a0SLloyd Pique * Sends an capabilities event to the client owning the resource.
3223*84e872a0SLloyd Pique * @param resource_ The client's resource
3224*84e872a0SLloyd Pique * @param capabilities capabilities of the seat
3225*84e872a0SLloyd Pique */
3226*84e872a0SLloyd Pique static inline void
wl_seat_send_capabilities(struct wl_resource * resource_,uint32_t capabilities)3227*84e872a0SLloyd Pique wl_seat_send_capabilities(struct wl_resource *resource_, uint32_t capabilities)
3228*84e872a0SLloyd Pique {
3229*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_SEAT_CAPABILITIES, capabilities);
3230*84e872a0SLloyd Pique }
3231*84e872a0SLloyd Pique
3232*84e872a0SLloyd Pique /**
3233*84e872a0SLloyd Pique * @ingroup iface_wl_seat
3234*84e872a0SLloyd Pique * Sends an name event to the client owning the resource.
3235*84e872a0SLloyd Pique * @param resource_ The client's resource
3236*84e872a0SLloyd Pique * @param name seat identifier
3237*84e872a0SLloyd Pique */
3238*84e872a0SLloyd Pique static inline void
wl_seat_send_name(struct wl_resource * resource_,const char * name)3239*84e872a0SLloyd Pique wl_seat_send_name(struct wl_resource *resource_, const char *name)
3240*84e872a0SLloyd Pique {
3241*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_SEAT_NAME, name);
3242*84e872a0SLloyd Pique }
3243*84e872a0SLloyd Pique
3244*84e872a0SLloyd Pique #ifndef WL_POINTER_ERROR_ENUM
3245*84e872a0SLloyd Pique #define WL_POINTER_ERROR_ENUM
3246*84e872a0SLloyd Pique enum wl_pointer_error {
3247*84e872a0SLloyd Pique /**
3248*84e872a0SLloyd Pique * given wl_surface has another role
3249*84e872a0SLloyd Pique */
3250*84e872a0SLloyd Pique WL_POINTER_ERROR_ROLE = 0,
3251*84e872a0SLloyd Pique };
3252*84e872a0SLloyd Pique #endif /* WL_POINTER_ERROR_ENUM */
3253*84e872a0SLloyd Pique
3254*84e872a0SLloyd Pique #ifndef WL_POINTER_BUTTON_STATE_ENUM
3255*84e872a0SLloyd Pique #define WL_POINTER_BUTTON_STATE_ENUM
3256*84e872a0SLloyd Pique /**
3257*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3258*84e872a0SLloyd Pique * physical button state
3259*84e872a0SLloyd Pique *
3260*84e872a0SLloyd Pique * Describes the physical state of a button that produced the button
3261*84e872a0SLloyd Pique * event.
3262*84e872a0SLloyd Pique */
3263*84e872a0SLloyd Pique enum wl_pointer_button_state {
3264*84e872a0SLloyd Pique /**
3265*84e872a0SLloyd Pique * the button is not pressed
3266*84e872a0SLloyd Pique */
3267*84e872a0SLloyd Pique WL_POINTER_BUTTON_STATE_RELEASED = 0,
3268*84e872a0SLloyd Pique /**
3269*84e872a0SLloyd Pique * the button is pressed
3270*84e872a0SLloyd Pique */
3271*84e872a0SLloyd Pique WL_POINTER_BUTTON_STATE_PRESSED = 1,
3272*84e872a0SLloyd Pique };
3273*84e872a0SLloyd Pique #endif /* WL_POINTER_BUTTON_STATE_ENUM */
3274*84e872a0SLloyd Pique
3275*84e872a0SLloyd Pique #ifndef WL_POINTER_AXIS_ENUM
3276*84e872a0SLloyd Pique #define WL_POINTER_AXIS_ENUM
3277*84e872a0SLloyd Pique /**
3278*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3279*84e872a0SLloyd Pique * axis types
3280*84e872a0SLloyd Pique *
3281*84e872a0SLloyd Pique * Describes the axis types of scroll events.
3282*84e872a0SLloyd Pique */
3283*84e872a0SLloyd Pique enum wl_pointer_axis {
3284*84e872a0SLloyd Pique /**
3285*84e872a0SLloyd Pique * vertical axis
3286*84e872a0SLloyd Pique */
3287*84e872a0SLloyd Pique WL_POINTER_AXIS_VERTICAL_SCROLL = 0,
3288*84e872a0SLloyd Pique /**
3289*84e872a0SLloyd Pique * horizontal axis
3290*84e872a0SLloyd Pique */
3291*84e872a0SLloyd Pique WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,
3292*84e872a0SLloyd Pique };
3293*84e872a0SLloyd Pique #endif /* WL_POINTER_AXIS_ENUM */
3294*84e872a0SLloyd Pique
3295*84e872a0SLloyd Pique #ifndef WL_POINTER_AXIS_SOURCE_ENUM
3296*84e872a0SLloyd Pique #define WL_POINTER_AXIS_SOURCE_ENUM
3297*84e872a0SLloyd Pique /**
3298*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3299*84e872a0SLloyd Pique * axis source types
3300*84e872a0SLloyd Pique *
3301*84e872a0SLloyd Pique * Describes the source types for axis events. This indicates to the
3302*84e872a0SLloyd Pique * client how an axis event was physically generated; a client may
3303*84e872a0SLloyd Pique * adjust the user interface accordingly. For example, scroll events
3304*84e872a0SLloyd Pique * from a "finger" source may be in a smooth coordinate space with
3305*84e872a0SLloyd Pique * kinetic scrolling whereas a "wheel" source may be in discrete steps
3306*84e872a0SLloyd Pique * of a number of lines.
3307*84e872a0SLloyd Pique */
3308*84e872a0SLloyd Pique enum wl_pointer_axis_source {
3309*84e872a0SLloyd Pique /**
3310*84e872a0SLloyd Pique * a physical wheel rotation
3311*84e872a0SLloyd Pique */
3312*84e872a0SLloyd Pique WL_POINTER_AXIS_SOURCE_WHEEL = 0,
3313*84e872a0SLloyd Pique /**
3314*84e872a0SLloyd Pique * finger on a touch surface
3315*84e872a0SLloyd Pique */
3316*84e872a0SLloyd Pique WL_POINTER_AXIS_SOURCE_FINGER = 1,
3317*84e872a0SLloyd Pique /**
3318*84e872a0SLloyd Pique * continuous coordinate space
3319*84e872a0SLloyd Pique *
3320*84e872a0SLloyd Pique * A device generating events in a continuous coordinate space,
3321*84e872a0SLloyd Pique * but using something other than a finger. One example for this
3322*84e872a0SLloyd Pique * source is button-based scrolling where the vertical motion of a
3323*84e872a0SLloyd Pique * device is converted to scroll events while a button is held
3324*84e872a0SLloyd Pique * down.
3325*84e872a0SLloyd Pique */
3326*84e872a0SLloyd Pique WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
3327*84e872a0SLloyd Pique /**
3328*84e872a0SLloyd Pique * a physical wheel tilt
3329*84e872a0SLloyd Pique *
3330*84e872a0SLloyd Pique * Indicates that the actual device is a wheel but the scroll
3331*84e872a0SLloyd Pique * event is not caused by a rotation but a (usually sideways) tilt
3332*84e872a0SLloyd Pique * of the wheel.
3333*84e872a0SLloyd Pique * @since 6
3334*84e872a0SLloyd Pique */
3335*84e872a0SLloyd Pique WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
3336*84e872a0SLloyd Pique };
3337*84e872a0SLloyd Pique /**
3338*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3339*84e872a0SLloyd Pique */
3340*84e872a0SLloyd Pique #define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
3341*84e872a0SLloyd Pique #endif /* WL_POINTER_AXIS_SOURCE_ENUM */
3342*84e872a0SLloyd Pique
3343*84e872a0SLloyd Pique /**
3344*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3345*84e872a0SLloyd Pique * @struct wl_pointer_interface
3346*84e872a0SLloyd Pique */
3347*84e872a0SLloyd Pique struct wl_pointer_interface {
3348*84e872a0SLloyd Pique /**
3349*84e872a0SLloyd Pique * set the pointer surface
3350*84e872a0SLloyd Pique *
3351*84e872a0SLloyd Pique * Set the pointer surface, i.e., the surface that contains the
3352*84e872a0SLloyd Pique * pointer image (cursor). This request gives the surface the role
3353*84e872a0SLloyd Pique * of a cursor. If the surface already has another role, it raises
3354*84e872a0SLloyd Pique * a protocol error.
3355*84e872a0SLloyd Pique *
3356*84e872a0SLloyd Pique * The cursor actually changes only if the pointer focus for this
3357*84e872a0SLloyd Pique * device is one of the requesting client's surfaces or the surface
3358*84e872a0SLloyd Pique * parameter is the current pointer surface. If there was a
3359*84e872a0SLloyd Pique * previous surface set with this request it is replaced. If
3360*84e872a0SLloyd Pique * surface is NULL, the pointer image is hidden.
3361*84e872a0SLloyd Pique *
3362*84e872a0SLloyd Pique * The parameters hotspot_x and hotspot_y define the position of
3363*84e872a0SLloyd Pique * the pointer surface relative to the pointer location. Its
3364*84e872a0SLloyd Pique * top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
3365*84e872a0SLloyd Pique * where (x, y) are the coordinates of the pointer location, in
3366*84e872a0SLloyd Pique * surface-local coordinates.
3367*84e872a0SLloyd Pique *
3368*84e872a0SLloyd Pique * On surface.attach requests to the pointer surface, hotspot_x and
3369*84e872a0SLloyd Pique * hotspot_y are decremented by the x and y parameters passed to
3370*84e872a0SLloyd Pique * the request. Attach must be confirmed by wl_surface.commit as
3371*84e872a0SLloyd Pique * usual.
3372*84e872a0SLloyd Pique *
3373*84e872a0SLloyd Pique * The hotspot can also be updated by passing the currently set
3374*84e872a0SLloyd Pique * pointer surface to this request with new values for hotspot_x
3375*84e872a0SLloyd Pique * and hotspot_y.
3376*84e872a0SLloyd Pique *
3377*84e872a0SLloyd Pique * The current and pending input regions of the wl_surface are
3378*84e872a0SLloyd Pique * cleared, and wl_surface.set_input_region is ignored until the
3379*84e872a0SLloyd Pique * wl_surface is no longer used as the cursor. When the use as a
3380*84e872a0SLloyd Pique * cursor ends, the current and pending input regions become
3381*84e872a0SLloyd Pique * undefined, and the wl_surface is unmapped.
3382*84e872a0SLloyd Pique * @param serial serial number of the enter event
3383*84e872a0SLloyd Pique * @param surface pointer surface
3384*84e872a0SLloyd Pique * @param hotspot_x surface-local x coordinate
3385*84e872a0SLloyd Pique * @param hotspot_y surface-local y coordinate
3386*84e872a0SLloyd Pique */
3387*84e872a0SLloyd Pique void (*set_cursor)(struct wl_client *client,
3388*84e872a0SLloyd Pique struct wl_resource *resource,
3389*84e872a0SLloyd Pique uint32_t serial,
3390*84e872a0SLloyd Pique struct wl_resource *surface,
3391*84e872a0SLloyd Pique int32_t hotspot_x,
3392*84e872a0SLloyd Pique int32_t hotspot_y);
3393*84e872a0SLloyd Pique /**
3394*84e872a0SLloyd Pique * release the pointer object
3395*84e872a0SLloyd Pique *
3396*84e872a0SLloyd Pique * Using this request a client can tell the server that it is not
3397*84e872a0SLloyd Pique * going to use the pointer object anymore.
3398*84e872a0SLloyd Pique *
3399*84e872a0SLloyd Pique * This request destroys the pointer proxy object, so clients must
3400*84e872a0SLloyd Pique * not call wl_pointer_destroy() after using this request.
3401*84e872a0SLloyd Pique * @since 3
3402*84e872a0SLloyd Pique */
3403*84e872a0SLloyd Pique void (*release)(struct wl_client *client,
3404*84e872a0SLloyd Pique struct wl_resource *resource);
3405*84e872a0SLloyd Pique };
3406*84e872a0SLloyd Pique
3407*84e872a0SLloyd Pique #define WL_POINTER_ENTER 0
3408*84e872a0SLloyd Pique #define WL_POINTER_LEAVE 1
3409*84e872a0SLloyd Pique #define WL_POINTER_MOTION 2
3410*84e872a0SLloyd Pique #define WL_POINTER_BUTTON 3
3411*84e872a0SLloyd Pique #define WL_POINTER_AXIS 4
3412*84e872a0SLloyd Pique #define WL_POINTER_FRAME 5
3413*84e872a0SLloyd Pique #define WL_POINTER_AXIS_SOURCE 6
3414*84e872a0SLloyd Pique #define WL_POINTER_AXIS_STOP 7
3415*84e872a0SLloyd Pique #define WL_POINTER_AXIS_DISCRETE 8
3416*84e872a0SLloyd Pique
3417*84e872a0SLloyd Pique /**
3418*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3419*84e872a0SLloyd Pique */
3420*84e872a0SLloyd Pique #define WL_POINTER_ENTER_SINCE_VERSION 1
3421*84e872a0SLloyd Pique /**
3422*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3423*84e872a0SLloyd Pique */
3424*84e872a0SLloyd Pique #define WL_POINTER_LEAVE_SINCE_VERSION 1
3425*84e872a0SLloyd Pique /**
3426*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3427*84e872a0SLloyd Pique */
3428*84e872a0SLloyd Pique #define WL_POINTER_MOTION_SINCE_VERSION 1
3429*84e872a0SLloyd Pique /**
3430*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3431*84e872a0SLloyd Pique */
3432*84e872a0SLloyd Pique #define WL_POINTER_BUTTON_SINCE_VERSION 1
3433*84e872a0SLloyd Pique /**
3434*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3435*84e872a0SLloyd Pique */
3436*84e872a0SLloyd Pique #define WL_POINTER_AXIS_SINCE_VERSION 1
3437*84e872a0SLloyd Pique /**
3438*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3439*84e872a0SLloyd Pique */
3440*84e872a0SLloyd Pique #define WL_POINTER_FRAME_SINCE_VERSION 5
3441*84e872a0SLloyd Pique /**
3442*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3443*84e872a0SLloyd Pique */
3444*84e872a0SLloyd Pique #define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5
3445*84e872a0SLloyd Pique /**
3446*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3447*84e872a0SLloyd Pique */
3448*84e872a0SLloyd Pique #define WL_POINTER_AXIS_STOP_SINCE_VERSION 5
3449*84e872a0SLloyd Pique /**
3450*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3451*84e872a0SLloyd Pique */
3452*84e872a0SLloyd Pique #define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5
3453*84e872a0SLloyd Pique
3454*84e872a0SLloyd Pique /**
3455*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3456*84e872a0SLloyd Pique */
3457*84e872a0SLloyd Pique #define WL_POINTER_SET_CURSOR_SINCE_VERSION 1
3458*84e872a0SLloyd Pique /**
3459*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3460*84e872a0SLloyd Pique */
3461*84e872a0SLloyd Pique #define WL_POINTER_RELEASE_SINCE_VERSION 3
3462*84e872a0SLloyd Pique
3463*84e872a0SLloyd Pique /**
3464*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3465*84e872a0SLloyd Pique * Sends an enter event to the client owning the resource.
3466*84e872a0SLloyd Pique * @param resource_ The client's resource
3467*84e872a0SLloyd Pique * @param serial serial number of the enter event
3468*84e872a0SLloyd Pique * @param surface surface entered by the pointer
3469*84e872a0SLloyd Pique * @param surface_x surface-local x coordinate
3470*84e872a0SLloyd Pique * @param surface_y surface-local y coordinate
3471*84e872a0SLloyd Pique */
3472*84e872a0SLloyd Pique static inline void
wl_pointer_send_enter(struct wl_resource * resource_,uint32_t serial,struct wl_resource * surface,wl_fixed_t surface_x,wl_fixed_t surface_y)3473*84e872a0SLloyd Pique wl_pointer_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, wl_fixed_t surface_x, wl_fixed_t surface_y)
3474*84e872a0SLloyd Pique {
3475*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_ENTER, serial, surface, surface_x, surface_y);
3476*84e872a0SLloyd Pique }
3477*84e872a0SLloyd Pique
3478*84e872a0SLloyd Pique /**
3479*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3480*84e872a0SLloyd Pique * Sends an leave event to the client owning the resource.
3481*84e872a0SLloyd Pique * @param resource_ The client's resource
3482*84e872a0SLloyd Pique * @param serial serial number of the leave event
3483*84e872a0SLloyd Pique * @param surface surface left by the pointer
3484*84e872a0SLloyd Pique */
3485*84e872a0SLloyd Pique static inline void
wl_pointer_send_leave(struct wl_resource * resource_,uint32_t serial,struct wl_resource * surface)3486*84e872a0SLloyd Pique wl_pointer_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface)
3487*84e872a0SLloyd Pique {
3488*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_LEAVE, serial, surface);
3489*84e872a0SLloyd Pique }
3490*84e872a0SLloyd Pique
3491*84e872a0SLloyd Pique /**
3492*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3493*84e872a0SLloyd Pique * Sends an motion event to the client owning the resource.
3494*84e872a0SLloyd Pique * @param resource_ The client's resource
3495*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
3496*84e872a0SLloyd Pique * @param surface_x surface-local x coordinate
3497*84e872a0SLloyd Pique * @param surface_y surface-local y coordinate
3498*84e872a0SLloyd Pique */
3499*84e872a0SLloyd Pique static inline void
wl_pointer_send_motion(struct wl_resource * resource_,uint32_t time,wl_fixed_t surface_x,wl_fixed_t surface_y)3500*84e872a0SLloyd Pique wl_pointer_send_motion(struct wl_resource *resource_, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y)
3501*84e872a0SLloyd Pique {
3502*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_MOTION, time, surface_x, surface_y);
3503*84e872a0SLloyd Pique }
3504*84e872a0SLloyd Pique
3505*84e872a0SLloyd Pique /**
3506*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3507*84e872a0SLloyd Pique * Sends an button event to the client owning the resource.
3508*84e872a0SLloyd Pique * @param resource_ The client's resource
3509*84e872a0SLloyd Pique * @param serial serial number of the button event
3510*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
3511*84e872a0SLloyd Pique * @param button button that produced the event
3512*84e872a0SLloyd Pique * @param state physical state of the button
3513*84e872a0SLloyd Pique */
3514*84e872a0SLloyd Pique static inline void
wl_pointer_send_button(struct wl_resource * resource_,uint32_t serial,uint32_t time,uint32_t button,uint32_t state)3515*84e872a0SLloyd Pique wl_pointer_send_button(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t button, uint32_t state)
3516*84e872a0SLloyd Pique {
3517*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_BUTTON, serial, time, button, state);
3518*84e872a0SLloyd Pique }
3519*84e872a0SLloyd Pique
3520*84e872a0SLloyd Pique /**
3521*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3522*84e872a0SLloyd Pique * Sends an axis event to the client owning the resource.
3523*84e872a0SLloyd Pique * @param resource_ The client's resource
3524*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
3525*84e872a0SLloyd Pique * @param axis axis type
3526*84e872a0SLloyd Pique * @param value length of vector in surface-local coordinate space
3527*84e872a0SLloyd Pique */
3528*84e872a0SLloyd Pique static inline void
wl_pointer_send_axis(struct wl_resource * resource_,uint32_t time,uint32_t axis,wl_fixed_t value)3529*84e872a0SLloyd Pique wl_pointer_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis, wl_fixed_t value)
3530*84e872a0SLloyd Pique {
3531*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_AXIS, time, axis, value);
3532*84e872a0SLloyd Pique }
3533*84e872a0SLloyd Pique
3534*84e872a0SLloyd Pique /**
3535*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3536*84e872a0SLloyd Pique * Sends an frame event to the client owning the resource.
3537*84e872a0SLloyd Pique * @param resource_ The client's resource
3538*84e872a0SLloyd Pique */
3539*84e872a0SLloyd Pique static inline void
wl_pointer_send_frame(struct wl_resource * resource_)3540*84e872a0SLloyd Pique wl_pointer_send_frame(struct wl_resource *resource_)
3541*84e872a0SLloyd Pique {
3542*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_FRAME);
3543*84e872a0SLloyd Pique }
3544*84e872a0SLloyd Pique
3545*84e872a0SLloyd Pique /**
3546*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3547*84e872a0SLloyd Pique * Sends an axis_source event to the client owning the resource.
3548*84e872a0SLloyd Pique * @param resource_ The client's resource
3549*84e872a0SLloyd Pique * @param axis_source source of the axis event
3550*84e872a0SLloyd Pique */
3551*84e872a0SLloyd Pique static inline void
wl_pointer_send_axis_source(struct wl_resource * resource_,uint32_t axis_source)3552*84e872a0SLloyd Pique wl_pointer_send_axis_source(struct wl_resource *resource_, uint32_t axis_source)
3553*84e872a0SLloyd Pique {
3554*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_AXIS_SOURCE, axis_source);
3555*84e872a0SLloyd Pique }
3556*84e872a0SLloyd Pique
3557*84e872a0SLloyd Pique /**
3558*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3559*84e872a0SLloyd Pique * Sends an axis_stop event to the client owning the resource.
3560*84e872a0SLloyd Pique * @param resource_ The client's resource
3561*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
3562*84e872a0SLloyd Pique * @param axis the axis stopped with this event
3563*84e872a0SLloyd Pique */
3564*84e872a0SLloyd Pique static inline void
wl_pointer_send_axis_stop(struct wl_resource * resource_,uint32_t time,uint32_t axis)3565*84e872a0SLloyd Pique wl_pointer_send_axis_stop(struct wl_resource *resource_, uint32_t time, uint32_t axis)
3566*84e872a0SLloyd Pique {
3567*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_AXIS_STOP, time, axis);
3568*84e872a0SLloyd Pique }
3569*84e872a0SLloyd Pique
3570*84e872a0SLloyd Pique /**
3571*84e872a0SLloyd Pique * @ingroup iface_wl_pointer
3572*84e872a0SLloyd Pique * Sends an axis_discrete event to the client owning the resource.
3573*84e872a0SLloyd Pique * @param resource_ The client's resource
3574*84e872a0SLloyd Pique * @param axis axis type
3575*84e872a0SLloyd Pique * @param discrete number of steps
3576*84e872a0SLloyd Pique */
3577*84e872a0SLloyd Pique static inline void
wl_pointer_send_axis_discrete(struct wl_resource * resource_,uint32_t axis,int32_t discrete)3578*84e872a0SLloyd Pique wl_pointer_send_axis_discrete(struct wl_resource *resource_, uint32_t axis, int32_t discrete)
3579*84e872a0SLloyd Pique {
3580*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_POINTER_AXIS_DISCRETE, axis, discrete);
3581*84e872a0SLloyd Pique }
3582*84e872a0SLloyd Pique
3583*84e872a0SLloyd Pique #ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM
3584*84e872a0SLloyd Pique #define WL_KEYBOARD_KEYMAP_FORMAT_ENUM
3585*84e872a0SLloyd Pique /**
3586*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3587*84e872a0SLloyd Pique * keyboard mapping format
3588*84e872a0SLloyd Pique *
3589*84e872a0SLloyd Pique * This specifies the format of the keymap provided to the
3590*84e872a0SLloyd Pique * client with the wl_keyboard.keymap event.
3591*84e872a0SLloyd Pique */
3592*84e872a0SLloyd Pique enum wl_keyboard_keymap_format {
3593*84e872a0SLloyd Pique /**
3594*84e872a0SLloyd Pique * no keymap; client must understand how to interpret the raw keycode
3595*84e872a0SLloyd Pique */
3596*84e872a0SLloyd Pique WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0,
3597*84e872a0SLloyd Pique /**
3598*84e872a0SLloyd Pique * libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode
3599*84e872a0SLloyd Pique */
3600*84e872a0SLloyd Pique WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1,
3601*84e872a0SLloyd Pique };
3602*84e872a0SLloyd Pique #endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */
3603*84e872a0SLloyd Pique
3604*84e872a0SLloyd Pique #ifndef WL_KEYBOARD_KEY_STATE_ENUM
3605*84e872a0SLloyd Pique #define WL_KEYBOARD_KEY_STATE_ENUM
3606*84e872a0SLloyd Pique /**
3607*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3608*84e872a0SLloyd Pique * physical key state
3609*84e872a0SLloyd Pique *
3610*84e872a0SLloyd Pique * Describes the physical state of a key that produced the key event.
3611*84e872a0SLloyd Pique */
3612*84e872a0SLloyd Pique enum wl_keyboard_key_state {
3613*84e872a0SLloyd Pique /**
3614*84e872a0SLloyd Pique * key is not pressed
3615*84e872a0SLloyd Pique */
3616*84e872a0SLloyd Pique WL_KEYBOARD_KEY_STATE_RELEASED = 0,
3617*84e872a0SLloyd Pique /**
3618*84e872a0SLloyd Pique * key is pressed
3619*84e872a0SLloyd Pique */
3620*84e872a0SLloyd Pique WL_KEYBOARD_KEY_STATE_PRESSED = 1,
3621*84e872a0SLloyd Pique };
3622*84e872a0SLloyd Pique #endif /* WL_KEYBOARD_KEY_STATE_ENUM */
3623*84e872a0SLloyd Pique
3624*84e872a0SLloyd Pique /**
3625*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3626*84e872a0SLloyd Pique * @struct wl_keyboard_interface
3627*84e872a0SLloyd Pique */
3628*84e872a0SLloyd Pique struct wl_keyboard_interface {
3629*84e872a0SLloyd Pique /**
3630*84e872a0SLloyd Pique * release the keyboard object
3631*84e872a0SLloyd Pique *
3632*84e872a0SLloyd Pique *
3633*84e872a0SLloyd Pique * @since 3
3634*84e872a0SLloyd Pique */
3635*84e872a0SLloyd Pique void (*release)(struct wl_client *client,
3636*84e872a0SLloyd Pique struct wl_resource *resource);
3637*84e872a0SLloyd Pique };
3638*84e872a0SLloyd Pique
3639*84e872a0SLloyd Pique #define WL_KEYBOARD_KEYMAP 0
3640*84e872a0SLloyd Pique #define WL_KEYBOARD_ENTER 1
3641*84e872a0SLloyd Pique #define WL_KEYBOARD_LEAVE 2
3642*84e872a0SLloyd Pique #define WL_KEYBOARD_KEY 3
3643*84e872a0SLloyd Pique #define WL_KEYBOARD_MODIFIERS 4
3644*84e872a0SLloyd Pique #define WL_KEYBOARD_REPEAT_INFO 5
3645*84e872a0SLloyd Pique
3646*84e872a0SLloyd Pique /**
3647*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3648*84e872a0SLloyd Pique */
3649*84e872a0SLloyd Pique #define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1
3650*84e872a0SLloyd Pique /**
3651*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3652*84e872a0SLloyd Pique */
3653*84e872a0SLloyd Pique #define WL_KEYBOARD_ENTER_SINCE_VERSION 1
3654*84e872a0SLloyd Pique /**
3655*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3656*84e872a0SLloyd Pique */
3657*84e872a0SLloyd Pique #define WL_KEYBOARD_LEAVE_SINCE_VERSION 1
3658*84e872a0SLloyd Pique /**
3659*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3660*84e872a0SLloyd Pique */
3661*84e872a0SLloyd Pique #define WL_KEYBOARD_KEY_SINCE_VERSION 1
3662*84e872a0SLloyd Pique /**
3663*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3664*84e872a0SLloyd Pique */
3665*84e872a0SLloyd Pique #define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1
3666*84e872a0SLloyd Pique /**
3667*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3668*84e872a0SLloyd Pique */
3669*84e872a0SLloyd Pique #define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4
3670*84e872a0SLloyd Pique
3671*84e872a0SLloyd Pique /**
3672*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3673*84e872a0SLloyd Pique */
3674*84e872a0SLloyd Pique #define WL_KEYBOARD_RELEASE_SINCE_VERSION 3
3675*84e872a0SLloyd Pique
3676*84e872a0SLloyd Pique /**
3677*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3678*84e872a0SLloyd Pique * Sends an keymap event to the client owning the resource.
3679*84e872a0SLloyd Pique * @param resource_ The client's resource
3680*84e872a0SLloyd Pique * @param format keymap format
3681*84e872a0SLloyd Pique * @param fd keymap file descriptor
3682*84e872a0SLloyd Pique * @param size keymap size, in bytes
3683*84e872a0SLloyd Pique */
3684*84e872a0SLloyd Pique static inline void
wl_keyboard_send_keymap(struct wl_resource * resource_,uint32_t format,int32_t fd,uint32_t size)3685*84e872a0SLloyd Pique wl_keyboard_send_keymap(struct wl_resource *resource_, uint32_t format, int32_t fd, uint32_t size)
3686*84e872a0SLloyd Pique {
3687*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_KEYBOARD_KEYMAP, format, fd, size);
3688*84e872a0SLloyd Pique }
3689*84e872a0SLloyd Pique
3690*84e872a0SLloyd Pique /**
3691*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3692*84e872a0SLloyd Pique * Sends an enter event to the client owning the resource.
3693*84e872a0SLloyd Pique * @param resource_ The client's resource
3694*84e872a0SLloyd Pique * @param serial serial number of the enter event
3695*84e872a0SLloyd Pique * @param surface surface gaining keyboard focus
3696*84e872a0SLloyd Pique * @param keys the currently pressed keys
3697*84e872a0SLloyd Pique */
3698*84e872a0SLloyd Pique static inline void
wl_keyboard_send_enter(struct wl_resource * resource_,uint32_t serial,struct wl_resource * surface,struct wl_array * keys)3699*84e872a0SLloyd Pique wl_keyboard_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, struct wl_array *keys)
3700*84e872a0SLloyd Pique {
3701*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_KEYBOARD_ENTER, serial, surface, keys);
3702*84e872a0SLloyd Pique }
3703*84e872a0SLloyd Pique
3704*84e872a0SLloyd Pique /**
3705*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3706*84e872a0SLloyd Pique * Sends an leave event to the client owning the resource.
3707*84e872a0SLloyd Pique * @param resource_ The client's resource
3708*84e872a0SLloyd Pique * @param serial serial number of the leave event
3709*84e872a0SLloyd Pique * @param surface surface that lost keyboard focus
3710*84e872a0SLloyd Pique */
3711*84e872a0SLloyd Pique static inline void
wl_keyboard_send_leave(struct wl_resource * resource_,uint32_t serial,struct wl_resource * surface)3712*84e872a0SLloyd Pique wl_keyboard_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface)
3713*84e872a0SLloyd Pique {
3714*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_KEYBOARD_LEAVE, serial, surface);
3715*84e872a0SLloyd Pique }
3716*84e872a0SLloyd Pique
3717*84e872a0SLloyd Pique /**
3718*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3719*84e872a0SLloyd Pique * Sends an key event to the client owning the resource.
3720*84e872a0SLloyd Pique * @param resource_ The client's resource
3721*84e872a0SLloyd Pique * @param serial serial number of the key event
3722*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
3723*84e872a0SLloyd Pique * @param key key that produced the event
3724*84e872a0SLloyd Pique * @param state physical state of the key
3725*84e872a0SLloyd Pique */
3726*84e872a0SLloyd Pique static inline void
wl_keyboard_send_key(struct wl_resource * resource_,uint32_t serial,uint32_t time,uint32_t key,uint32_t state)3727*84e872a0SLloyd Pique wl_keyboard_send_key(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t key, uint32_t state)
3728*84e872a0SLloyd Pique {
3729*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_KEYBOARD_KEY, serial, time, key, state);
3730*84e872a0SLloyd Pique }
3731*84e872a0SLloyd Pique
3732*84e872a0SLloyd Pique /**
3733*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3734*84e872a0SLloyd Pique * Sends an modifiers event to the client owning the resource.
3735*84e872a0SLloyd Pique * @param resource_ The client's resource
3736*84e872a0SLloyd Pique * @param serial serial number of the modifiers event
3737*84e872a0SLloyd Pique * @param mods_depressed depressed modifiers
3738*84e872a0SLloyd Pique * @param mods_latched latched modifiers
3739*84e872a0SLloyd Pique * @param mods_locked locked modifiers
3740*84e872a0SLloyd Pique * @param group keyboard layout
3741*84e872a0SLloyd Pique */
3742*84e872a0SLloyd Pique static inline void
wl_keyboard_send_modifiers(struct wl_resource * resource_,uint32_t serial,uint32_t mods_depressed,uint32_t mods_latched,uint32_t mods_locked,uint32_t group)3743*84e872a0SLloyd Pique wl_keyboard_send_modifiers(struct wl_resource *resource_, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
3744*84e872a0SLloyd Pique {
3745*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_KEYBOARD_MODIFIERS, serial, mods_depressed, mods_latched, mods_locked, group);
3746*84e872a0SLloyd Pique }
3747*84e872a0SLloyd Pique
3748*84e872a0SLloyd Pique /**
3749*84e872a0SLloyd Pique * @ingroup iface_wl_keyboard
3750*84e872a0SLloyd Pique * Sends an repeat_info event to the client owning the resource.
3751*84e872a0SLloyd Pique * @param resource_ The client's resource
3752*84e872a0SLloyd Pique * @param rate the rate of repeating keys in characters per second
3753*84e872a0SLloyd Pique * @param delay delay in milliseconds since key down until repeating starts
3754*84e872a0SLloyd Pique */
3755*84e872a0SLloyd Pique static inline void
wl_keyboard_send_repeat_info(struct wl_resource * resource_,int32_t rate,int32_t delay)3756*84e872a0SLloyd Pique wl_keyboard_send_repeat_info(struct wl_resource *resource_, int32_t rate, int32_t delay)
3757*84e872a0SLloyd Pique {
3758*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_KEYBOARD_REPEAT_INFO, rate, delay);
3759*84e872a0SLloyd Pique }
3760*84e872a0SLloyd Pique
3761*84e872a0SLloyd Pique /**
3762*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3763*84e872a0SLloyd Pique * @struct wl_touch_interface
3764*84e872a0SLloyd Pique */
3765*84e872a0SLloyd Pique struct wl_touch_interface {
3766*84e872a0SLloyd Pique /**
3767*84e872a0SLloyd Pique * release the touch object
3768*84e872a0SLloyd Pique *
3769*84e872a0SLloyd Pique *
3770*84e872a0SLloyd Pique * @since 3
3771*84e872a0SLloyd Pique */
3772*84e872a0SLloyd Pique void (*release)(struct wl_client *client,
3773*84e872a0SLloyd Pique struct wl_resource *resource);
3774*84e872a0SLloyd Pique };
3775*84e872a0SLloyd Pique
3776*84e872a0SLloyd Pique #define WL_TOUCH_DOWN 0
3777*84e872a0SLloyd Pique #define WL_TOUCH_UP 1
3778*84e872a0SLloyd Pique #define WL_TOUCH_MOTION 2
3779*84e872a0SLloyd Pique #define WL_TOUCH_FRAME 3
3780*84e872a0SLloyd Pique #define WL_TOUCH_CANCEL 4
3781*84e872a0SLloyd Pique #define WL_TOUCH_SHAPE 5
3782*84e872a0SLloyd Pique #define WL_TOUCH_ORIENTATION 6
3783*84e872a0SLloyd Pique
3784*84e872a0SLloyd Pique /**
3785*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3786*84e872a0SLloyd Pique */
3787*84e872a0SLloyd Pique #define WL_TOUCH_DOWN_SINCE_VERSION 1
3788*84e872a0SLloyd Pique /**
3789*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3790*84e872a0SLloyd Pique */
3791*84e872a0SLloyd Pique #define WL_TOUCH_UP_SINCE_VERSION 1
3792*84e872a0SLloyd Pique /**
3793*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3794*84e872a0SLloyd Pique */
3795*84e872a0SLloyd Pique #define WL_TOUCH_MOTION_SINCE_VERSION 1
3796*84e872a0SLloyd Pique /**
3797*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3798*84e872a0SLloyd Pique */
3799*84e872a0SLloyd Pique #define WL_TOUCH_FRAME_SINCE_VERSION 1
3800*84e872a0SLloyd Pique /**
3801*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3802*84e872a0SLloyd Pique */
3803*84e872a0SLloyd Pique #define WL_TOUCH_CANCEL_SINCE_VERSION 1
3804*84e872a0SLloyd Pique /**
3805*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3806*84e872a0SLloyd Pique */
3807*84e872a0SLloyd Pique #define WL_TOUCH_SHAPE_SINCE_VERSION 6
3808*84e872a0SLloyd Pique /**
3809*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3810*84e872a0SLloyd Pique */
3811*84e872a0SLloyd Pique #define WL_TOUCH_ORIENTATION_SINCE_VERSION 6
3812*84e872a0SLloyd Pique
3813*84e872a0SLloyd Pique /**
3814*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3815*84e872a0SLloyd Pique */
3816*84e872a0SLloyd Pique #define WL_TOUCH_RELEASE_SINCE_VERSION 3
3817*84e872a0SLloyd Pique
3818*84e872a0SLloyd Pique /**
3819*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3820*84e872a0SLloyd Pique * Sends an down event to the client owning the resource.
3821*84e872a0SLloyd Pique * @param resource_ The client's resource
3822*84e872a0SLloyd Pique * @param serial serial number of the touch down event
3823*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
3824*84e872a0SLloyd Pique * @param surface surface touched
3825*84e872a0SLloyd Pique * @param id the unique ID of this touch point
3826*84e872a0SLloyd Pique * @param x surface-local x coordinate
3827*84e872a0SLloyd Pique * @param y surface-local y coordinate
3828*84e872a0SLloyd Pique */
3829*84e872a0SLloyd Pique static inline void
wl_touch_send_down(struct wl_resource * resource_,uint32_t serial,uint32_t time,struct wl_resource * surface,int32_t id,wl_fixed_t x,wl_fixed_t y)3830*84e872a0SLloyd Pique wl_touch_send_down(struct wl_resource *resource_, uint32_t serial, uint32_t time, struct wl_resource *surface, int32_t id, wl_fixed_t x, wl_fixed_t y)
3831*84e872a0SLloyd Pique {
3832*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_TOUCH_DOWN, serial, time, surface, id, x, y);
3833*84e872a0SLloyd Pique }
3834*84e872a0SLloyd Pique
3835*84e872a0SLloyd Pique /**
3836*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3837*84e872a0SLloyd Pique * Sends an up event to the client owning the resource.
3838*84e872a0SLloyd Pique * @param resource_ The client's resource
3839*84e872a0SLloyd Pique * @param serial serial number of the touch up event
3840*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
3841*84e872a0SLloyd Pique * @param id the unique ID of this touch point
3842*84e872a0SLloyd Pique */
3843*84e872a0SLloyd Pique static inline void
wl_touch_send_up(struct wl_resource * resource_,uint32_t serial,uint32_t time,int32_t id)3844*84e872a0SLloyd Pique wl_touch_send_up(struct wl_resource *resource_, uint32_t serial, uint32_t time, int32_t id)
3845*84e872a0SLloyd Pique {
3846*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_TOUCH_UP, serial, time, id);
3847*84e872a0SLloyd Pique }
3848*84e872a0SLloyd Pique
3849*84e872a0SLloyd Pique /**
3850*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3851*84e872a0SLloyd Pique * Sends an motion event to the client owning the resource.
3852*84e872a0SLloyd Pique * @param resource_ The client's resource
3853*84e872a0SLloyd Pique * @param time timestamp with millisecond granularity
3854*84e872a0SLloyd Pique * @param id the unique ID of this touch point
3855*84e872a0SLloyd Pique * @param x surface-local x coordinate
3856*84e872a0SLloyd Pique * @param y surface-local y coordinate
3857*84e872a0SLloyd Pique */
3858*84e872a0SLloyd Pique static inline void
wl_touch_send_motion(struct wl_resource * resource_,uint32_t time,int32_t id,wl_fixed_t x,wl_fixed_t y)3859*84e872a0SLloyd Pique wl_touch_send_motion(struct wl_resource *resource_, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y)
3860*84e872a0SLloyd Pique {
3861*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_TOUCH_MOTION, time, id, x, y);
3862*84e872a0SLloyd Pique }
3863*84e872a0SLloyd Pique
3864*84e872a0SLloyd Pique /**
3865*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3866*84e872a0SLloyd Pique * Sends an frame event to the client owning the resource.
3867*84e872a0SLloyd Pique * @param resource_ The client's resource
3868*84e872a0SLloyd Pique */
3869*84e872a0SLloyd Pique static inline void
wl_touch_send_frame(struct wl_resource * resource_)3870*84e872a0SLloyd Pique wl_touch_send_frame(struct wl_resource *resource_)
3871*84e872a0SLloyd Pique {
3872*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_TOUCH_FRAME);
3873*84e872a0SLloyd Pique }
3874*84e872a0SLloyd Pique
3875*84e872a0SLloyd Pique /**
3876*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3877*84e872a0SLloyd Pique * Sends an cancel event to the client owning the resource.
3878*84e872a0SLloyd Pique * @param resource_ The client's resource
3879*84e872a0SLloyd Pique */
3880*84e872a0SLloyd Pique static inline void
wl_touch_send_cancel(struct wl_resource * resource_)3881*84e872a0SLloyd Pique wl_touch_send_cancel(struct wl_resource *resource_)
3882*84e872a0SLloyd Pique {
3883*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_TOUCH_CANCEL);
3884*84e872a0SLloyd Pique }
3885*84e872a0SLloyd Pique
3886*84e872a0SLloyd Pique /**
3887*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3888*84e872a0SLloyd Pique * Sends an shape event to the client owning the resource.
3889*84e872a0SLloyd Pique * @param resource_ The client's resource
3890*84e872a0SLloyd Pique * @param id the unique ID of this touch point
3891*84e872a0SLloyd Pique * @param major length of the major axis in surface-local coordinates
3892*84e872a0SLloyd Pique * @param minor length of the minor axis in surface-local coordinates
3893*84e872a0SLloyd Pique */
3894*84e872a0SLloyd Pique static inline void
wl_touch_send_shape(struct wl_resource * resource_,int32_t id,wl_fixed_t major,wl_fixed_t minor)3895*84e872a0SLloyd Pique wl_touch_send_shape(struct wl_resource *resource_, int32_t id, wl_fixed_t major, wl_fixed_t minor)
3896*84e872a0SLloyd Pique {
3897*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_TOUCH_SHAPE, id, major, minor);
3898*84e872a0SLloyd Pique }
3899*84e872a0SLloyd Pique
3900*84e872a0SLloyd Pique /**
3901*84e872a0SLloyd Pique * @ingroup iface_wl_touch
3902*84e872a0SLloyd Pique * Sends an orientation event to the client owning the resource.
3903*84e872a0SLloyd Pique * @param resource_ The client's resource
3904*84e872a0SLloyd Pique * @param id the unique ID of this touch point
3905*84e872a0SLloyd Pique * @param orientation angle between major axis and positive surface y-axis in degrees
3906*84e872a0SLloyd Pique */
3907*84e872a0SLloyd Pique static inline void
wl_touch_send_orientation(struct wl_resource * resource_,int32_t id,wl_fixed_t orientation)3908*84e872a0SLloyd Pique wl_touch_send_orientation(struct wl_resource *resource_, int32_t id, wl_fixed_t orientation)
3909*84e872a0SLloyd Pique {
3910*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_TOUCH_ORIENTATION, id, orientation);
3911*84e872a0SLloyd Pique }
3912*84e872a0SLloyd Pique
3913*84e872a0SLloyd Pique #ifndef WL_OUTPUT_SUBPIXEL_ENUM
3914*84e872a0SLloyd Pique #define WL_OUTPUT_SUBPIXEL_ENUM
3915*84e872a0SLloyd Pique /**
3916*84e872a0SLloyd Pique * @ingroup iface_wl_output
3917*84e872a0SLloyd Pique * subpixel geometry information
3918*84e872a0SLloyd Pique *
3919*84e872a0SLloyd Pique * This enumeration describes how the physical
3920*84e872a0SLloyd Pique * pixels on an output are laid out.
3921*84e872a0SLloyd Pique */
3922*84e872a0SLloyd Pique enum wl_output_subpixel {
3923*84e872a0SLloyd Pique /**
3924*84e872a0SLloyd Pique * unknown geometry
3925*84e872a0SLloyd Pique */
3926*84e872a0SLloyd Pique WL_OUTPUT_SUBPIXEL_UNKNOWN = 0,
3927*84e872a0SLloyd Pique /**
3928*84e872a0SLloyd Pique * no geometry
3929*84e872a0SLloyd Pique */
3930*84e872a0SLloyd Pique WL_OUTPUT_SUBPIXEL_NONE = 1,
3931*84e872a0SLloyd Pique /**
3932*84e872a0SLloyd Pique * horizontal RGB
3933*84e872a0SLloyd Pique */
3934*84e872a0SLloyd Pique WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2,
3935*84e872a0SLloyd Pique /**
3936*84e872a0SLloyd Pique * horizontal BGR
3937*84e872a0SLloyd Pique */
3938*84e872a0SLloyd Pique WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3,
3939*84e872a0SLloyd Pique /**
3940*84e872a0SLloyd Pique * vertical RGB
3941*84e872a0SLloyd Pique */
3942*84e872a0SLloyd Pique WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4,
3943*84e872a0SLloyd Pique /**
3944*84e872a0SLloyd Pique * vertical BGR
3945*84e872a0SLloyd Pique */
3946*84e872a0SLloyd Pique WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5,
3947*84e872a0SLloyd Pique };
3948*84e872a0SLloyd Pique #endif /* WL_OUTPUT_SUBPIXEL_ENUM */
3949*84e872a0SLloyd Pique
3950*84e872a0SLloyd Pique #ifndef WL_OUTPUT_TRANSFORM_ENUM
3951*84e872a0SLloyd Pique #define WL_OUTPUT_TRANSFORM_ENUM
3952*84e872a0SLloyd Pique /**
3953*84e872a0SLloyd Pique * @ingroup iface_wl_output
3954*84e872a0SLloyd Pique * transform from framebuffer to output
3955*84e872a0SLloyd Pique *
3956*84e872a0SLloyd Pique * This describes the transform that a compositor will apply to a
3957*84e872a0SLloyd Pique * surface to compensate for the rotation or mirroring of an
3958*84e872a0SLloyd Pique * output device.
3959*84e872a0SLloyd Pique *
3960*84e872a0SLloyd Pique * The flipped values correspond to an initial flip around a
3961*84e872a0SLloyd Pique * vertical axis followed by rotation.
3962*84e872a0SLloyd Pique *
3963*84e872a0SLloyd Pique * The purpose is mainly to allow clients to render accordingly and
3964*84e872a0SLloyd Pique * tell the compositor, so that for fullscreen surfaces, the
3965*84e872a0SLloyd Pique * compositor will still be able to scan out directly from client
3966*84e872a0SLloyd Pique * surfaces.
3967*84e872a0SLloyd Pique */
3968*84e872a0SLloyd Pique enum wl_output_transform {
3969*84e872a0SLloyd Pique /**
3970*84e872a0SLloyd Pique * no transform
3971*84e872a0SLloyd Pique */
3972*84e872a0SLloyd Pique WL_OUTPUT_TRANSFORM_NORMAL = 0,
3973*84e872a0SLloyd Pique /**
3974*84e872a0SLloyd Pique * 90 degrees counter-clockwise
3975*84e872a0SLloyd Pique */
3976*84e872a0SLloyd Pique WL_OUTPUT_TRANSFORM_90 = 1,
3977*84e872a0SLloyd Pique /**
3978*84e872a0SLloyd Pique * 180 degrees counter-clockwise
3979*84e872a0SLloyd Pique */
3980*84e872a0SLloyd Pique WL_OUTPUT_TRANSFORM_180 = 2,
3981*84e872a0SLloyd Pique /**
3982*84e872a0SLloyd Pique * 270 degrees counter-clockwise
3983*84e872a0SLloyd Pique */
3984*84e872a0SLloyd Pique WL_OUTPUT_TRANSFORM_270 = 3,
3985*84e872a0SLloyd Pique /**
3986*84e872a0SLloyd Pique * 180 degree flip around a vertical axis
3987*84e872a0SLloyd Pique */
3988*84e872a0SLloyd Pique WL_OUTPUT_TRANSFORM_FLIPPED = 4,
3989*84e872a0SLloyd Pique /**
3990*84e872a0SLloyd Pique * flip and rotate 90 degrees counter-clockwise
3991*84e872a0SLloyd Pique */
3992*84e872a0SLloyd Pique WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,
3993*84e872a0SLloyd Pique /**
3994*84e872a0SLloyd Pique * flip and rotate 180 degrees counter-clockwise
3995*84e872a0SLloyd Pique */
3996*84e872a0SLloyd Pique WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,
3997*84e872a0SLloyd Pique /**
3998*84e872a0SLloyd Pique * flip and rotate 270 degrees counter-clockwise
3999*84e872a0SLloyd Pique */
4000*84e872a0SLloyd Pique WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,
4001*84e872a0SLloyd Pique };
4002*84e872a0SLloyd Pique #endif /* WL_OUTPUT_TRANSFORM_ENUM */
4003*84e872a0SLloyd Pique
4004*84e872a0SLloyd Pique #ifndef WL_OUTPUT_MODE_ENUM
4005*84e872a0SLloyd Pique #define WL_OUTPUT_MODE_ENUM
4006*84e872a0SLloyd Pique /**
4007*84e872a0SLloyd Pique * @ingroup iface_wl_output
4008*84e872a0SLloyd Pique * mode information
4009*84e872a0SLloyd Pique *
4010*84e872a0SLloyd Pique * These flags describe properties of an output mode.
4011*84e872a0SLloyd Pique * They are used in the flags bitfield of the mode event.
4012*84e872a0SLloyd Pique */
4013*84e872a0SLloyd Pique enum wl_output_mode {
4014*84e872a0SLloyd Pique /**
4015*84e872a0SLloyd Pique * indicates this is the current mode
4016*84e872a0SLloyd Pique */
4017*84e872a0SLloyd Pique WL_OUTPUT_MODE_CURRENT = 0x1,
4018*84e872a0SLloyd Pique /**
4019*84e872a0SLloyd Pique * indicates this is the preferred mode
4020*84e872a0SLloyd Pique */
4021*84e872a0SLloyd Pique WL_OUTPUT_MODE_PREFERRED = 0x2,
4022*84e872a0SLloyd Pique };
4023*84e872a0SLloyd Pique #endif /* WL_OUTPUT_MODE_ENUM */
4024*84e872a0SLloyd Pique
4025*84e872a0SLloyd Pique /**
4026*84e872a0SLloyd Pique * @ingroup iface_wl_output
4027*84e872a0SLloyd Pique * @struct wl_output_interface
4028*84e872a0SLloyd Pique */
4029*84e872a0SLloyd Pique struct wl_output_interface {
4030*84e872a0SLloyd Pique /**
4031*84e872a0SLloyd Pique * release the output object
4032*84e872a0SLloyd Pique *
4033*84e872a0SLloyd Pique * Using this request a client can tell the server that it is not
4034*84e872a0SLloyd Pique * going to use the output object anymore.
4035*84e872a0SLloyd Pique * @since 3
4036*84e872a0SLloyd Pique */
4037*84e872a0SLloyd Pique void (*release)(struct wl_client *client,
4038*84e872a0SLloyd Pique struct wl_resource *resource);
4039*84e872a0SLloyd Pique };
4040*84e872a0SLloyd Pique
4041*84e872a0SLloyd Pique #define WL_OUTPUT_GEOMETRY 0
4042*84e872a0SLloyd Pique #define WL_OUTPUT_MODE 1
4043*84e872a0SLloyd Pique #define WL_OUTPUT_DONE 2
4044*84e872a0SLloyd Pique #define WL_OUTPUT_SCALE 3
4045*84e872a0SLloyd Pique
4046*84e872a0SLloyd Pique /**
4047*84e872a0SLloyd Pique * @ingroup iface_wl_output
4048*84e872a0SLloyd Pique */
4049*84e872a0SLloyd Pique #define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1
4050*84e872a0SLloyd Pique /**
4051*84e872a0SLloyd Pique * @ingroup iface_wl_output
4052*84e872a0SLloyd Pique */
4053*84e872a0SLloyd Pique #define WL_OUTPUT_MODE_SINCE_VERSION 1
4054*84e872a0SLloyd Pique /**
4055*84e872a0SLloyd Pique * @ingroup iface_wl_output
4056*84e872a0SLloyd Pique */
4057*84e872a0SLloyd Pique #define WL_OUTPUT_DONE_SINCE_VERSION 2
4058*84e872a0SLloyd Pique /**
4059*84e872a0SLloyd Pique * @ingroup iface_wl_output
4060*84e872a0SLloyd Pique */
4061*84e872a0SLloyd Pique #define WL_OUTPUT_SCALE_SINCE_VERSION 2
4062*84e872a0SLloyd Pique
4063*84e872a0SLloyd Pique /**
4064*84e872a0SLloyd Pique * @ingroup iface_wl_output
4065*84e872a0SLloyd Pique */
4066*84e872a0SLloyd Pique #define WL_OUTPUT_RELEASE_SINCE_VERSION 3
4067*84e872a0SLloyd Pique
4068*84e872a0SLloyd Pique /**
4069*84e872a0SLloyd Pique * @ingroup iface_wl_output
4070*84e872a0SLloyd Pique * Sends an geometry event to the client owning the resource.
4071*84e872a0SLloyd Pique * @param resource_ The client's resource
4072*84e872a0SLloyd Pique * @param x x position within the global compositor space
4073*84e872a0SLloyd Pique * @param y y position within the global compositor space
4074*84e872a0SLloyd Pique * @param physical_width width in millimeters of the output
4075*84e872a0SLloyd Pique * @param physical_height height in millimeters of the output
4076*84e872a0SLloyd Pique * @param subpixel subpixel orientation of the output
4077*84e872a0SLloyd Pique * @param make textual description of the manufacturer
4078*84e872a0SLloyd Pique * @param model textual description of the model
4079*84e872a0SLloyd Pique * @param transform transform that maps framebuffer to output
4080*84e872a0SLloyd Pique */
4081*84e872a0SLloyd Pique static inline void
wl_output_send_geometry(struct wl_resource * resource_,int32_t x,int32_t y,int32_t physical_width,int32_t physical_height,int32_t subpixel,const char * make,const char * model,int32_t transform)4082*84e872a0SLloyd Pique wl_output_send_geometry(struct wl_resource *resource_, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform)
4083*84e872a0SLloyd Pique {
4084*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_OUTPUT_GEOMETRY, x, y, physical_width, physical_height, subpixel, make, model, transform);
4085*84e872a0SLloyd Pique }
4086*84e872a0SLloyd Pique
4087*84e872a0SLloyd Pique /**
4088*84e872a0SLloyd Pique * @ingroup iface_wl_output
4089*84e872a0SLloyd Pique * Sends an mode event to the client owning the resource.
4090*84e872a0SLloyd Pique * @param resource_ The client's resource
4091*84e872a0SLloyd Pique * @param flags bitfield of mode flags
4092*84e872a0SLloyd Pique * @param width width of the mode in hardware units
4093*84e872a0SLloyd Pique * @param height height of the mode in hardware units
4094*84e872a0SLloyd Pique * @param refresh vertical refresh rate in mHz
4095*84e872a0SLloyd Pique */
4096*84e872a0SLloyd Pique static inline void
wl_output_send_mode(struct wl_resource * resource_,uint32_t flags,int32_t width,int32_t height,int32_t refresh)4097*84e872a0SLloyd Pique wl_output_send_mode(struct wl_resource *resource_, uint32_t flags, int32_t width, int32_t height, int32_t refresh)
4098*84e872a0SLloyd Pique {
4099*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_OUTPUT_MODE, flags, width, height, refresh);
4100*84e872a0SLloyd Pique }
4101*84e872a0SLloyd Pique
4102*84e872a0SLloyd Pique /**
4103*84e872a0SLloyd Pique * @ingroup iface_wl_output
4104*84e872a0SLloyd Pique * Sends an done event to the client owning the resource.
4105*84e872a0SLloyd Pique * @param resource_ The client's resource
4106*84e872a0SLloyd Pique */
4107*84e872a0SLloyd Pique static inline void
wl_output_send_done(struct wl_resource * resource_)4108*84e872a0SLloyd Pique wl_output_send_done(struct wl_resource *resource_)
4109*84e872a0SLloyd Pique {
4110*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_OUTPUT_DONE);
4111*84e872a0SLloyd Pique }
4112*84e872a0SLloyd Pique
4113*84e872a0SLloyd Pique /**
4114*84e872a0SLloyd Pique * @ingroup iface_wl_output
4115*84e872a0SLloyd Pique * Sends an scale event to the client owning the resource.
4116*84e872a0SLloyd Pique * @param resource_ The client's resource
4117*84e872a0SLloyd Pique * @param factor scaling factor of output
4118*84e872a0SLloyd Pique */
4119*84e872a0SLloyd Pique static inline void
wl_output_send_scale(struct wl_resource * resource_,int32_t factor)4120*84e872a0SLloyd Pique wl_output_send_scale(struct wl_resource *resource_, int32_t factor)
4121*84e872a0SLloyd Pique {
4122*84e872a0SLloyd Pique wl_resource_post_event(resource_, WL_OUTPUT_SCALE, factor);
4123*84e872a0SLloyd Pique }
4124*84e872a0SLloyd Pique
4125*84e872a0SLloyd Pique /**
4126*84e872a0SLloyd Pique * @ingroup iface_wl_region
4127*84e872a0SLloyd Pique * @struct wl_region_interface
4128*84e872a0SLloyd Pique */
4129*84e872a0SLloyd Pique struct wl_region_interface {
4130*84e872a0SLloyd Pique /**
4131*84e872a0SLloyd Pique * destroy region
4132*84e872a0SLloyd Pique *
4133*84e872a0SLloyd Pique * Destroy the region. This will invalidate the object ID.
4134*84e872a0SLloyd Pique */
4135*84e872a0SLloyd Pique void (*destroy)(struct wl_client *client,
4136*84e872a0SLloyd Pique struct wl_resource *resource);
4137*84e872a0SLloyd Pique /**
4138*84e872a0SLloyd Pique * add rectangle to region
4139*84e872a0SLloyd Pique *
4140*84e872a0SLloyd Pique * Add the specified rectangle to the region.
4141*84e872a0SLloyd Pique * @param x region-local x coordinate
4142*84e872a0SLloyd Pique * @param y region-local y coordinate
4143*84e872a0SLloyd Pique * @param width rectangle width
4144*84e872a0SLloyd Pique * @param height rectangle height
4145*84e872a0SLloyd Pique */
4146*84e872a0SLloyd Pique void (*add)(struct wl_client *client,
4147*84e872a0SLloyd Pique struct wl_resource *resource,
4148*84e872a0SLloyd Pique int32_t x,
4149*84e872a0SLloyd Pique int32_t y,
4150*84e872a0SLloyd Pique int32_t width,
4151*84e872a0SLloyd Pique int32_t height);
4152*84e872a0SLloyd Pique /**
4153*84e872a0SLloyd Pique * subtract rectangle from region
4154*84e872a0SLloyd Pique *
4155*84e872a0SLloyd Pique * Subtract the specified rectangle from the region.
4156*84e872a0SLloyd Pique * @param x region-local x coordinate
4157*84e872a0SLloyd Pique * @param y region-local y coordinate
4158*84e872a0SLloyd Pique * @param width rectangle width
4159*84e872a0SLloyd Pique * @param height rectangle height
4160*84e872a0SLloyd Pique */
4161*84e872a0SLloyd Pique void (*subtract)(struct wl_client *client,
4162*84e872a0SLloyd Pique struct wl_resource *resource,
4163*84e872a0SLloyd Pique int32_t x,
4164*84e872a0SLloyd Pique int32_t y,
4165*84e872a0SLloyd Pique int32_t width,
4166*84e872a0SLloyd Pique int32_t height);
4167*84e872a0SLloyd Pique };
4168*84e872a0SLloyd Pique
4169*84e872a0SLloyd Pique
4170*84e872a0SLloyd Pique /**
4171*84e872a0SLloyd Pique * @ingroup iface_wl_region
4172*84e872a0SLloyd Pique */
4173*84e872a0SLloyd Pique #define WL_REGION_DESTROY_SINCE_VERSION 1
4174*84e872a0SLloyd Pique /**
4175*84e872a0SLloyd Pique * @ingroup iface_wl_region
4176*84e872a0SLloyd Pique */
4177*84e872a0SLloyd Pique #define WL_REGION_ADD_SINCE_VERSION 1
4178*84e872a0SLloyd Pique /**
4179*84e872a0SLloyd Pique * @ingroup iface_wl_region
4180*84e872a0SLloyd Pique */
4181*84e872a0SLloyd Pique #define WL_REGION_SUBTRACT_SINCE_VERSION 1
4182*84e872a0SLloyd Pique
4183*84e872a0SLloyd Pique #ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
4184*84e872a0SLloyd Pique #define WL_SUBCOMPOSITOR_ERROR_ENUM
4185*84e872a0SLloyd Pique enum wl_subcompositor_error {
4186*84e872a0SLloyd Pique /**
4187*84e872a0SLloyd Pique * the to-be sub-surface is invalid
4188*84e872a0SLloyd Pique */
4189*84e872a0SLloyd Pique WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
4190*84e872a0SLloyd Pique };
4191*84e872a0SLloyd Pique #endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
4192*84e872a0SLloyd Pique
4193*84e872a0SLloyd Pique /**
4194*84e872a0SLloyd Pique * @ingroup iface_wl_subcompositor
4195*84e872a0SLloyd Pique * @struct wl_subcompositor_interface
4196*84e872a0SLloyd Pique */
4197*84e872a0SLloyd Pique struct wl_subcompositor_interface {
4198*84e872a0SLloyd Pique /**
4199*84e872a0SLloyd Pique * unbind from the subcompositor interface
4200*84e872a0SLloyd Pique *
4201*84e872a0SLloyd Pique * Informs the server that the client will not be using this
4202*84e872a0SLloyd Pique * protocol object anymore. This does not affect any other objects,
4203*84e872a0SLloyd Pique * wl_subsurface objects included.
4204*84e872a0SLloyd Pique */
4205*84e872a0SLloyd Pique void (*destroy)(struct wl_client *client,
4206*84e872a0SLloyd Pique struct wl_resource *resource);
4207*84e872a0SLloyd Pique /**
4208*84e872a0SLloyd Pique * give a surface the role sub-surface
4209*84e872a0SLloyd Pique *
4210*84e872a0SLloyd Pique * Create a sub-surface interface for the given surface, and
4211*84e872a0SLloyd Pique * associate it with the given parent surface. This turns a plain
4212*84e872a0SLloyd Pique * wl_surface into a sub-surface.
4213*84e872a0SLloyd Pique *
4214*84e872a0SLloyd Pique * The to-be sub-surface must not already have another role, and it
4215*84e872a0SLloyd Pique * must not have an existing wl_subsurface object. Otherwise a
4216*84e872a0SLloyd Pique * protocol error is raised.
4217*84e872a0SLloyd Pique * @param id the new sub-surface object ID
4218*84e872a0SLloyd Pique * @param surface the surface to be turned into a sub-surface
4219*84e872a0SLloyd Pique * @param parent the parent surface
4220*84e872a0SLloyd Pique */
4221*84e872a0SLloyd Pique void (*get_subsurface)(struct wl_client *client,
4222*84e872a0SLloyd Pique struct wl_resource *resource,
4223*84e872a0SLloyd Pique uint32_t id,
4224*84e872a0SLloyd Pique struct wl_resource *surface,
4225*84e872a0SLloyd Pique struct wl_resource *parent);
4226*84e872a0SLloyd Pique };
4227*84e872a0SLloyd Pique
4228*84e872a0SLloyd Pique
4229*84e872a0SLloyd Pique /**
4230*84e872a0SLloyd Pique * @ingroup iface_wl_subcompositor
4231*84e872a0SLloyd Pique */
4232*84e872a0SLloyd Pique #define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1
4233*84e872a0SLloyd Pique /**
4234*84e872a0SLloyd Pique * @ingroup iface_wl_subcompositor
4235*84e872a0SLloyd Pique */
4236*84e872a0SLloyd Pique #define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1
4237*84e872a0SLloyd Pique
4238*84e872a0SLloyd Pique #ifndef WL_SUBSURFACE_ERROR_ENUM
4239*84e872a0SLloyd Pique #define WL_SUBSURFACE_ERROR_ENUM
4240*84e872a0SLloyd Pique enum wl_subsurface_error {
4241*84e872a0SLloyd Pique /**
4242*84e872a0SLloyd Pique * wl_surface is not a sibling or the parent
4243*84e872a0SLloyd Pique */
4244*84e872a0SLloyd Pique WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
4245*84e872a0SLloyd Pique };
4246*84e872a0SLloyd Pique #endif /* WL_SUBSURFACE_ERROR_ENUM */
4247*84e872a0SLloyd Pique
4248*84e872a0SLloyd Pique /**
4249*84e872a0SLloyd Pique * @ingroup iface_wl_subsurface
4250*84e872a0SLloyd Pique * @struct wl_subsurface_interface
4251*84e872a0SLloyd Pique */
4252*84e872a0SLloyd Pique struct wl_subsurface_interface {
4253*84e872a0SLloyd Pique /**
4254*84e872a0SLloyd Pique * remove sub-surface interface
4255*84e872a0SLloyd Pique *
4256*84e872a0SLloyd Pique * The sub-surface interface is removed from the wl_surface
4257*84e872a0SLloyd Pique * object that was turned into a sub-surface with a
4258*84e872a0SLloyd Pique * wl_subcompositor.get_subsurface request. The wl_surface's
4259*84e872a0SLloyd Pique * association to the parent is deleted, and the wl_surface loses
4260*84e872a0SLloyd Pique * its role as a sub-surface. The wl_surface is unmapped.
4261*84e872a0SLloyd Pique */
4262*84e872a0SLloyd Pique void (*destroy)(struct wl_client *client,
4263*84e872a0SLloyd Pique struct wl_resource *resource);
4264*84e872a0SLloyd Pique /**
4265*84e872a0SLloyd Pique * reposition the sub-surface
4266*84e872a0SLloyd Pique *
4267*84e872a0SLloyd Pique * This schedules a sub-surface position change. The sub-surface
4268*84e872a0SLloyd Pique * will be moved so that its origin (top left corner pixel) will be
4269*84e872a0SLloyd Pique * at the location x, y of the parent surface coordinate system.
4270*84e872a0SLloyd Pique * The coordinates are not restricted to the parent surface area.
4271*84e872a0SLloyd Pique * Negative values are allowed.
4272*84e872a0SLloyd Pique *
4273*84e872a0SLloyd Pique * The scheduled coordinates will take effect whenever the state of
4274*84e872a0SLloyd Pique * the parent surface is applied. When this happens depends on
4275*84e872a0SLloyd Pique * whether the parent surface is in synchronized mode or not. See
4276*84e872a0SLloyd Pique * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
4277*84e872a0SLloyd Pique *
4278*84e872a0SLloyd Pique * If more than one set_position request is invoked by the client
4279*84e872a0SLloyd Pique * before the commit of the parent surface, the position of a new
4280*84e872a0SLloyd Pique * request always replaces the scheduled position from any previous
4281*84e872a0SLloyd Pique * request.
4282*84e872a0SLloyd Pique *
4283*84e872a0SLloyd Pique * The initial position is 0, 0.
4284*84e872a0SLloyd Pique * @param x x coordinate in the parent surface
4285*84e872a0SLloyd Pique * @param y y coordinate in the parent surface
4286*84e872a0SLloyd Pique */
4287*84e872a0SLloyd Pique void (*set_position)(struct wl_client *client,
4288*84e872a0SLloyd Pique struct wl_resource *resource,
4289*84e872a0SLloyd Pique int32_t x,
4290*84e872a0SLloyd Pique int32_t y);
4291*84e872a0SLloyd Pique /**
4292*84e872a0SLloyd Pique * restack the sub-surface
4293*84e872a0SLloyd Pique *
4294*84e872a0SLloyd Pique * This sub-surface is taken from the stack, and put back just
4295*84e872a0SLloyd Pique * above the reference surface, changing the z-order of the
4296*84e872a0SLloyd Pique * sub-surfaces. The reference surface must be one of the sibling
4297*84e872a0SLloyd Pique * surfaces, or the parent surface. Using any other surface,
4298*84e872a0SLloyd Pique * including this sub-surface, will cause a protocol error.
4299*84e872a0SLloyd Pique *
4300*84e872a0SLloyd Pique * The z-order is double-buffered. Requests are handled in order
4301*84e872a0SLloyd Pique * and applied immediately to a pending state. The final pending
4302*84e872a0SLloyd Pique * state is copied to the active state the next time the state of
4303*84e872a0SLloyd Pique * the parent surface is applied. When this happens depends on
4304*84e872a0SLloyd Pique * whether the parent surface is in synchronized mode or not. See
4305*84e872a0SLloyd Pique * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
4306*84e872a0SLloyd Pique *
4307*84e872a0SLloyd Pique * A new sub-surface is initially added as the top-most in the
4308*84e872a0SLloyd Pique * stack of its siblings and parent.
4309*84e872a0SLloyd Pique * @param sibling the reference surface
4310*84e872a0SLloyd Pique */
4311*84e872a0SLloyd Pique void (*place_above)(struct wl_client *client,
4312*84e872a0SLloyd Pique struct wl_resource *resource,
4313*84e872a0SLloyd Pique struct wl_resource *sibling);
4314*84e872a0SLloyd Pique /**
4315*84e872a0SLloyd Pique * restack the sub-surface
4316*84e872a0SLloyd Pique *
4317*84e872a0SLloyd Pique * The sub-surface is placed just below the reference surface.
4318*84e872a0SLloyd Pique * See wl_subsurface.place_above.
4319*84e872a0SLloyd Pique * @param sibling the reference surface
4320*84e872a0SLloyd Pique */
4321*84e872a0SLloyd Pique void (*place_below)(struct wl_client *client,
4322*84e872a0SLloyd Pique struct wl_resource *resource,
4323*84e872a0SLloyd Pique struct wl_resource *sibling);
4324*84e872a0SLloyd Pique /**
4325*84e872a0SLloyd Pique * set sub-surface to synchronized mode
4326*84e872a0SLloyd Pique *
4327*84e872a0SLloyd Pique * Change the commit behaviour of the sub-surface to synchronized
4328*84e872a0SLloyd Pique * mode, also described as the parent dependent mode.
4329*84e872a0SLloyd Pique *
4330*84e872a0SLloyd Pique * In synchronized mode, wl_surface.commit on a sub-surface will
4331*84e872a0SLloyd Pique * accumulate the committed state in a cache, but the state will
4332*84e872a0SLloyd Pique * not be applied and hence will not change the compositor output.
4333*84e872a0SLloyd Pique * The cached state is applied to the sub-surface immediately after
4334*84e872a0SLloyd Pique * the parent surface's state is applied. This ensures atomic
4335*84e872a0SLloyd Pique * updates of the parent and all its synchronized sub-surfaces.
4336*84e872a0SLloyd Pique * Applying the cached state will invalidate the cache, so further
4337*84e872a0SLloyd Pique * parent surface commits do not (re-)apply old state.
4338*84e872a0SLloyd Pique *
4339*84e872a0SLloyd Pique * See wl_subsurface for the recursive effect of this mode.
4340*84e872a0SLloyd Pique */
4341*84e872a0SLloyd Pique void (*set_sync)(struct wl_client *client,
4342*84e872a0SLloyd Pique struct wl_resource *resource);
4343*84e872a0SLloyd Pique /**
4344*84e872a0SLloyd Pique * set sub-surface to desynchronized mode
4345*84e872a0SLloyd Pique *
4346*84e872a0SLloyd Pique * Change the commit behaviour of the sub-surface to
4347*84e872a0SLloyd Pique * desynchronized mode, also described as independent or freely
4348*84e872a0SLloyd Pique * running mode.
4349*84e872a0SLloyd Pique *
4350*84e872a0SLloyd Pique * In desynchronized mode, wl_surface.commit on a sub-surface will
4351*84e872a0SLloyd Pique * apply the pending state directly, without caching, as happens
4352*84e872a0SLloyd Pique * normally with a wl_surface. Calling wl_surface.commit on the
4353*84e872a0SLloyd Pique * parent surface has no effect on the sub-surface's wl_surface
4354*84e872a0SLloyd Pique * state. This mode allows a sub-surface to be updated on its own.
4355*84e872a0SLloyd Pique *
4356*84e872a0SLloyd Pique * If cached state exists when wl_surface.commit is called in
4357*84e872a0SLloyd Pique * desynchronized mode, the pending state is added to the cached
4358*84e872a0SLloyd Pique * state, and applied as a whole. This invalidates the cache.
4359*84e872a0SLloyd Pique *
4360*84e872a0SLloyd Pique * Note: even if a sub-surface is set to desynchronized, a parent
4361*84e872a0SLloyd Pique * sub-surface may override it to behave as synchronized. For
4362*84e872a0SLloyd Pique * details, see wl_subsurface.
4363*84e872a0SLloyd Pique *
4364*84e872a0SLloyd Pique * If a surface's parent surface behaves as desynchronized, then
4365*84e872a0SLloyd Pique * the cached state is applied on set_desync.
4366*84e872a0SLloyd Pique */
4367*84e872a0SLloyd Pique void (*set_desync)(struct wl_client *client,
4368*84e872a0SLloyd Pique struct wl_resource *resource);
4369*84e872a0SLloyd Pique };
4370*84e872a0SLloyd Pique
4371*84e872a0SLloyd Pique
4372*84e872a0SLloyd Pique /**
4373*84e872a0SLloyd Pique * @ingroup iface_wl_subsurface
4374*84e872a0SLloyd Pique */
4375*84e872a0SLloyd Pique #define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1
4376*84e872a0SLloyd Pique /**
4377*84e872a0SLloyd Pique * @ingroup iface_wl_subsurface
4378*84e872a0SLloyd Pique */
4379*84e872a0SLloyd Pique #define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1
4380*84e872a0SLloyd Pique /**
4381*84e872a0SLloyd Pique * @ingroup iface_wl_subsurface
4382*84e872a0SLloyd Pique */
4383*84e872a0SLloyd Pique #define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1
4384*84e872a0SLloyd Pique /**
4385*84e872a0SLloyd Pique * @ingroup iface_wl_subsurface
4386*84e872a0SLloyd Pique */
4387*84e872a0SLloyd Pique #define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1
4388*84e872a0SLloyd Pique /**
4389*84e872a0SLloyd Pique * @ingroup iface_wl_subsurface
4390*84e872a0SLloyd Pique */
4391*84e872a0SLloyd Pique #define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1
4392*84e872a0SLloyd Pique /**
4393*84e872a0SLloyd Pique * @ingroup iface_wl_subsurface
4394*84e872a0SLloyd Pique */
4395*84e872a0SLloyd Pique #define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1
4396*84e872a0SLloyd Pique
4397*84e872a0SLloyd Pique #ifdef __cplusplus
4398*84e872a0SLloyd Pique }
4399*84e872a0SLloyd Pique #endif
4400*84e872a0SLloyd Pique
4401*84e872a0SLloyd Pique #endif
4402