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