1 /* Generated by wayland-scanner 1.18.0 */
2 
3 #ifndef POINTER_CONSTRAINTS_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define POINTER_CONSTRAINTS_UNSTABLE_V1_CLIENT_PROTOCOL_H
5 
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 /**
15  * @page page_pointer_constraints_unstable_v1 The
16  * pointer_constraints_unstable_v1 protocol protocol for constraining pointer
17  * motions
18  *
19  * @section page_desc_pointer_constraints_unstable_v1 Description
20  *
21  * This protocol specifies a set of interfaces used for adding constraints to
22  * the motion of a pointer. Possible constraints include confining pointer
23  * motions to a given region, or locking it to its current position.
24  *
25  * In order to constrain the pointer, a client must first bind the global
26  * interface "wp_pointer_constraints" which, if a compositor supports pointer
27  * constraints, is exposed by the registry. Using the bound global object, the
28  * client uses the request that corresponds to the type of constraint it wants
29  * to make. See wp_pointer_constraints for more details.
30  *
31  * Warning! The protocol described in this file is experimental and backward
32  * incompatible changes may be made. Backward compatible changes may be added
33  * together with the corresponding interface version bump. Backward
34  * incompatible changes are done by bumping the version number in the protocol
35  * and interface names and resetting the interface version. Once the protocol
36  * is to be declared stable, the 'z' prefix and the version number in the
37  * protocol and interface names are removed and the interface version number is
38  * reset.
39  *
40  * @section page_ifaces_pointer_constraints_unstable_v1 Interfaces
41  * - @subpage page_iface_zwp_pointer_constraints_v1 - constrain the movement of
42  * a pointer
43  * - @subpage page_iface_zwp_locked_pointer_v1 - receive relative pointer motion
44  * events
45  * - @subpage page_iface_zwp_confined_pointer_v1 - confined pointer object
46  * @section page_copyright_pointer_constraints_unstable_v1 Copyright
47  * <pre>
48  *
49  * Copyright © 2014      Jonas Ådahl
50  * Copyright © 2015      Red Hat Inc.
51  *
52  * Permission is hereby granted, free of charge, to any person obtaining a
53  * copy of this software and associated documentation files (the "Software"),
54  * to deal in the Software without restriction, including without limitation
55  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
56  * and/or sell copies of the Software, and to permit persons to whom the
57  * Software is furnished to do so, subject to the following conditions:
58  *
59  * The above copyright notice and this permission notice (including the next
60  * paragraph) shall be included in all copies or substantial portions of the
61  * Software.
62  *
63  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
66  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
68  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
69  * DEALINGS IN THE SOFTWARE.
70  * </pre>
71  */
72 struct wl_pointer;
73 struct wl_region;
74 struct wl_surface;
75 struct zwp_confined_pointer_v1;
76 struct zwp_locked_pointer_v1;
77 struct zwp_pointer_constraints_v1;
78 
79 /**
80  * @page page_iface_zwp_pointer_constraints_v1 zwp_pointer_constraints_v1
81  * @section page_iface_zwp_pointer_constraints_v1_desc Description
82  *
83  * The global interface exposing pointer constraining functionality. It
84  * exposes two requests: lock_pointer for locking the pointer to its
85  * position, and confine_pointer for locking the pointer to a region.
86  *
87  * The lock_pointer and confine_pointer requests create the objects
88  * wp_locked_pointer and wp_confined_pointer respectively, and the client can
89  * use these objects to interact with the lock.
90  *
91  * For any surface, only one lock or confinement may be active across all
92  * wl_pointer objects of the same seat. If a lock or confinement is requested
93  * when another lock or confinement is active or requested on the same surface
94  * and with any of the wl_pointer objects of the same seat, an
95  * 'already_constrained' error will be raised.
96  * @section page_iface_zwp_pointer_constraints_v1_api API
97  * See @ref iface_zwp_pointer_constraints_v1.
98  */
99 /**
100  * @defgroup iface_zwp_pointer_constraints_v1 The zwp_pointer_constraints_v1
101  * interface
102  *
103  * The global interface exposing pointer constraining functionality. It
104  * exposes two requests: lock_pointer for locking the pointer to its
105  * position, and confine_pointer for locking the pointer to a region.
106  *
107  * The lock_pointer and confine_pointer requests create the objects
108  * wp_locked_pointer and wp_confined_pointer respectively, and the client can
109  * use these objects to interact with the lock.
110  *
111  * For any surface, only one lock or confinement may be active across all
112  * wl_pointer objects of the same seat. If a lock or confinement is requested
113  * when another lock or confinement is active or requested on the same surface
114  * and with any of the wl_pointer objects of the same seat, an
115  * 'already_constrained' error will be raised.
116  */
117 extern const struct wl_interface zwp_pointer_constraints_v1_interface;
118 /**
119  * @page page_iface_zwp_locked_pointer_v1 zwp_locked_pointer_v1
120  * @section page_iface_zwp_locked_pointer_v1_desc Description
121  *
122  * The wp_locked_pointer interface represents a locked pointer state.
123  *
124  * While the lock of this object is active, the wl_pointer objects of the
125  * associated seat will not emit any wl_pointer.motion events.
126  *
127  * This object will send the event 'locked' when the lock is activated.
128  * Whenever the lock is activated, it is guaranteed that the locked surface
129  * will already have received pointer focus and that the pointer will be
130  * within the region passed to the request creating this object.
131  *
132  * To unlock the pointer, send the destroy request. This will also destroy
133  * the wp_locked_pointer object.
134  *
135  * If the compositor decides to unlock the pointer the unlocked event is
136  * sent. See wp_locked_pointer.unlock for details.
137  *
138  * When unlocking, the compositor may warp the cursor position to the set
139  * cursor position hint. If it does, it will not result in any relative
140  * motion events emitted via wp_relative_pointer.
141  *
142  * If the surface the lock was requested on is destroyed and the lock is not
143  * yet activated, the wp_locked_pointer object is now defunct and must be
144  * destroyed.
145  * @section page_iface_zwp_locked_pointer_v1_api API
146  * See @ref iface_zwp_locked_pointer_v1.
147  */
148 /**
149  * @defgroup iface_zwp_locked_pointer_v1 The zwp_locked_pointer_v1 interface
150  *
151  * The wp_locked_pointer interface represents a locked pointer state.
152  *
153  * While the lock of this object is active, the wl_pointer objects of the
154  * associated seat will not emit any wl_pointer.motion events.
155  *
156  * This object will send the event 'locked' when the lock is activated.
157  * Whenever the lock is activated, it is guaranteed that the locked surface
158  * will already have received pointer focus and that the pointer will be
159  * within the region passed to the request creating this object.
160  *
161  * To unlock the pointer, send the destroy request. This will also destroy
162  * the wp_locked_pointer object.
163  *
164  * If the compositor decides to unlock the pointer the unlocked event is
165  * sent. See wp_locked_pointer.unlock for details.
166  *
167  * When unlocking, the compositor may warp the cursor position to the set
168  * cursor position hint. If it does, it will not result in any relative
169  * motion events emitted via wp_relative_pointer.
170  *
171  * If the surface the lock was requested on is destroyed and the lock is not
172  * yet activated, the wp_locked_pointer object is now defunct and must be
173  * destroyed.
174  */
175 extern const struct wl_interface zwp_locked_pointer_v1_interface;
176 /**
177  * @page page_iface_zwp_confined_pointer_v1 zwp_confined_pointer_v1
178  * @section page_iface_zwp_confined_pointer_v1_desc Description
179  *
180  * The wp_confined_pointer interface represents a confined pointer state.
181  *
182  * This object will send the event 'confined' when the confinement is
183  * activated. Whenever the confinement is activated, it is guaranteed that
184  * the surface the pointer is confined to will already have received pointer
185  * focus and that the pointer will be within the region passed to the request
186  * creating this object. It is up to the compositor to decide whether this
187  * requires some user interaction and if the pointer will warp to within the
188  * passed region if outside.
189  *
190  * To unconfine the pointer, send the destroy request. This will also destroy
191  * the wp_confined_pointer object.
192  *
193  * If the compositor decides to unconfine the pointer the unconfined event is
194  * sent. The wp_confined_pointer object is at this point defunct and should
195  * be destroyed.
196  * @section page_iface_zwp_confined_pointer_v1_api API
197  * See @ref iface_zwp_confined_pointer_v1.
198  */
199 /**
200  * @defgroup iface_zwp_confined_pointer_v1 The zwp_confined_pointer_v1 interface
201  *
202  * The wp_confined_pointer interface represents a confined pointer state.
203  *
204  * This object will send the event 'confined' when the confinement is
205  * activated. Whenever the confinement is activated, it is guaranteed that
206  * the surface the pointer is confined to will already have received pointer
207  * focus and that the pointer will be within the region passed to the request
208  * creating this object. It is up to the compositor to decide whether this
209  * requires some user interaction and if the pointer will warp to within the
210  * passed region if outside.
211  *
212  * To unconfine the pointer, send the destroy request. This will also destroy
213  * the wp_confined_pointer object.
214  *
215  * If the compositor decides to unconfine the pointer the unconfined event is
216  * sent. The wp_confined_pointer object is at this point defunct and should
217  * be destroyed.
218  */
219 extern const struct wl_interface zwp_confined_pointer_v1_interface;
220 
221 #ifndef ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM
222 #  define ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM
223 /**
224  * @ingroup iface_zwp_pointer_constraints_v1
225  * wp_pointer_constraints error values
226  *
227  * These errors can be emitted in response to wp_pointer_constraints
228  * requests.
229  */
230 enum zwp_pointer_constraints_v1_error {
231   /**
232    * pointer constraint already requested on that surface
233    */
234   ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED = 1,
235 };
236 #endif /* ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM */
237 
238 #ifndef ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM
239 #  define ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM
240 /**
241  * @ingroup iface_zwp_pointer_constraints_v1
242  * the pointer constraint may reactivate
243  *
244  * A persistent pointer constraint may again reactivate once it has
245  * been deactivated. See the corresponding deactivation event
246  * (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for
247  * details.
248  */
249 enum zwp_pointer_constraints_v1_lifetime {
250   ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT = 1,
251   ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT = 2,
252 };
253 #endif /* ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM */
254 
255 #define ZWP_POINTER_CONSTRAINTS_V1_DESTROY 0
256 #define ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER 1
257 #define ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER 2
258 
259 /**
260  * @ingroup iface_zwp_pointer_constraints_v1
261  */
262 #define ZWP_POINTER_CONSTRAINTS_V1_DESTROY_SINCE_VERSION 1
263 /**
264  * @ingroup iface_zwp_pointer_constraints_v1
265  */
266 #define ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER_SINCE_VERSION 1
267 /**
268  * @ingroup iface_zwp_pointer_constraints_v1
269  */
270 #define ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER_SINCE_VERSION 1
271 
272 /** @ingroup iface_zwp_pointer_constraints_v1 */
zwp_pointer_constraints_v1_set_user_data(struct zwp_pointer_constraints_v1 * zwp_pointer_constraints_v1,void * user_data)273 static inline void zwp_pointer_constraints_v1_set_user_data(
274     struct zwp_pointer_constraints_v1* zwp_pointer_constraints_v1,
275     void* user_data) {
276   wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_constraints_v1,
277                          user_data);
278 }
279 
280 /** @ingroup iface_zwp_pointer_constraints_v1 */
zwp_pointer_constraints_v1_get_user_data(struct zwp_pointer_constraints_v1 * zwp_pointer_constraints_v1)281 static inline void* zwp_pointer_constraints_v1_get_user_data(
282     struct zwp_pointer_constraints_v1* zwp_pointer_constraints_v1) {
283   return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_constraints_v1);
284 }
285 
zwp_pointer_constraints_v1_get_version(struct zwp_pointer_constraints_v1 * zwp_pointer_constraints_v1)286 static inline uint32_t zwp_pointer_constraints_v1_get_version(
287     struct zwp_pointer_constraints_v1* zwp_pointer_constraints_v1) {
288   return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_constraints_v1);
289 }
290 
291 /**
292  * @ingroup iface_zwp_pointer_constraints_v1
293  *
294  * Used by the client to notify the server that it will no longer use this
295  * pointer constraints object.
296  */
zwp_pointer_constraints_v1_destroy(struct zwp_pointer_constraints_v1 * zwp_pointer_constraints_v1)297 static inline void zwp_pointer_constraints_v1_destroy(
298     struct zwp_pointer_constraints_v1* zwp_pointer_constraints_v1) {
299   wl_proxy_marshal((struct wl_proxy*)zwp_pointer_constraints_v1,
300                    ZWP_POINTER_CONSTRAINTS_V1_DESTROY);
301 
302   wl_proxy_destroy((struct wl_proxy*)zwp_pointer_constraints_v1);
303 }
304 
305 /**
306  * @ingroup iface_zwp_pointer_constraints_v1
307  *
308  * The lock_pointer request lets the client request to disable movements of
309  * the virtual pointer (i.e. the cursor), effectively locking the pointer
310  * to a position. This request may not take effect immediately; in the
311  * future, when the compositor deems implementation-specific constraints
312  * are satisfied, the pointer lock will be activated and the compositor
313  * sends a locked event.
314  *
315  * The protocol provides no guarantee that the constraints are ever
316  * satisfied, and does not require the compositor to send an error if the
317  * constraints cannot ever be satisfied. It is thus possible to request a
318  * lock that will never activate.
319  *
320  * There may not be another pointer constraint of any kind requested or
321  * active on the surface for any of the wl_pointer objects of the seat of
322  * the passed pointer when requesting a lock. If there is, an error will be
323  * raised. See general pointer lock documentation for more details.
324  *
325  * The intersection of the region passed with this request and the input
326  * region of the surface is used to determine where the pointer must be
327  * in order for the lock to activate. It is up to the compositor whether to
328  * warp the pointer or require some kind of user interaction for the lock
329  * to activate. If the region is null the surface input region is used.
330  *
331  * A surface may receive pointer focus without the lock being activated.
332  *
333  * The request creates a new object wp_locked_pointer which is used to
334  * interact with the lock as well as receive updates about its state. See
335  * the the description of wp_locked_pointer for further information.
336  *
337  * Note that while a pointer is locked, the wl_pointer objects of the
338  * corresponding seat will not emit any wl_pointer.motion events, but
339  * relative motion events will still be emitted via wp_relative_pointer
340  * objects of the same seat. wl_pointer.axis and wl_pointer.button events
341  * are unaffected.
342  */
343 static inline struct zwp_locked_pointer_v1*
zwp_pointer_constraints_v1_lock_pointer(struct zwp_pointer_constraints_v1 * zwp_pointer_constraints_v1,struct wl_surface * surface,struct wl_pointer * pointer,struct wl_region * region,uint32_t lifetime)344 zwp_pointer_constraints_v1_lock_pointer(
345     struct zwp_pointer_constraints_v1* zwp_pointer_constraints_v1,
346     struct wl_surface* surface, struct wl_pointer* pointer,
347     struct wl_region* region, uint32_t lifetime) {
348   struct wl_proxy* id;
349 
350   id = wl_proxy_marshal_constructor(
351       (struct wl_proxy*)zwp_pointer_constraints_v1,
352       ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER, &zwp_locked_pointer_v1_interface,
353       NULL, surface, pointer, region, lifetime);
354 
355   return (struct zwp_locked_pointer_v1*)id;
356 }
357 
358 /**
359  * @ingroup iface_zwp_pointer_constraints_v1
360  *
361  * The confine_pointer request lets the client request to confine the
362  * pointer cursor to a given region. This request may not take effect
363  * immediately; in the future, when the compositor deems implementation-
364  * specific constraints are satisfied, the pointer confinement will be
365  * activated and the compositor sends a confined event.
366  *
367  * The intersection of the region passed with this request and the input
368  * region of the surface is used to determine where the pointer must be
369  * in order for the confinement to activate. It is up to the compositor
370  * whether to warp the pointer or require some kind of user interaction for
371  * the confinement to activate. If the region is null the surface input
372  * region is used.
373  *
374  * The request will create a new object wp_confined_pointer which is used
375  * to interact with the confinement as well as receive updates about its
376  * state. See the the description of wp_confined_pointer for further
377  * information.
378  */
379 static inline struct zwp_confined_pointer_v1*
zwp_pointer_constraints_v1_confine_pointer(struct zwp_pointer_constraints_v1 * zwp_pointer_constraints_v1,struct wl_surface * surface,struct wl_pointer * pointer,struct wl_region * region,uint32_t lifetime)380 zwp_pointer_constraints_v1_confine_pointer(
381     struct zwp_pointer_constraints_v1* zwp_pointer_constraints_v1,
382     struct wl_surface* surface, struct wl_pointer* pointer,
383     struct wl_region* region, uint32_t lifetime) {
384   struct wl_proxy* id;
385 
386   id =
387       wl_proxy_marshal_constructor((struct wl_proxy*)zwp_pointer_constraints_v1,
388                                    ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER,
389                                    &zwp_confined_pointer_v1_interface, NULL,
390                                    surface, pointer, region, lifetime);
391 
392   return (struct zwp_confined_pointer_v1*)id;
393 }
394 
395 /**
396  * @ingroup iface_zwp_locked_pointer_v1
397  * @struct zwp_locked_pointer_v1_listener
398  */
399 struct zwp_locked_pointer_v1_listener {
400   /**
401    * lock activation event
402    *
403    * Notification that the pointer lock of the seat's pointer is
404    * activated.
405    */
406   void (*locked)(void* data,
407                  struct zwp_locked_pointer_v1* zwp_locked_pointer_v1);
408   /**
409    * lock deactivation event
410    *
411    * Notification that the pointer lock of the seat's pointer is no
412    * longer active. If this is a oneshot pointer lock (see
413    * wp_pointer_constraints.lifetime) this object is now defunct and
414    * should be destroyed. If this is a persistent pointer lock (see
415    * wp_pointer_constraints.lifetime) this pointer lock may again
416    * reactivate in the future.
417    */
418   void (*unlocked)(void* data,
419                    struct zwp_locked_pointer_v1* zwp_locked_pointer_v1);
420 };
421 
422 /**
423  * @ingroup iface_zwp_locked_pointer_v1
424  */
zwp_locked_pointer_v1_add_listener(struct zwp_locked_pointer_v1 * zwp_locked_pointer_v1,const struct zwp_locked_pointer_v1_listener * listener,void * data)425 static inline int zwp_locked_pointer_v1_add_listener(
426     struct zwp_locked_pointer_v1* zwp_locked_pointer_v1,
427     const struct zwp_locked_pointer_v1_listener* listener, void* data) {
428   return wl_proxy_add_listener((struct wl_proxy*)zwp_locked_pointer_v1,
429                                (void (**)(void))listener, data);
430 }
431 
432 #define ZWP_LOCKED_POINTER_V1_DESTROY 0
433 #define ZWP_LOCKED_POINTER_V1_SET_CURSOR_POSITION_HINT 1
434 #define ZWP_LOCKED_POINTER_V1_SET_REGION 2
435 
436 /**
437  * @ingroup iface_zwp_locked_pointer_v1
438  */
439 #define ZWP_LOCKED_POINTER_V1_LOCKED_SINCE_VERSION 1
440 /**
441  * @ingroup iface_zwp_locked_pointer_v1
442  */
443 #define ZWP_LOCKED_POINTER_V1_UNLOCKED_SINCE_VERSION 1
444 
445 /**
446  * @ingroup iface_zwp_locked_pointer_v1
447  */
448 #define ZWP_LOCKED_POINTER_V1_DESTROY_SINCE_VERSION 1
449 /**
450  * @ingroup iface_zwp_locked_pointer_v1
451  */
452 #define ZWP_LOCKED_POINTER_V1_SET_CURSOR_POSITION_HINT_SINCE_VERSION 1
453 /**
454  * @ingroup iface_zwp_locked_pointer_v1
455  */
456 #define ZWP_LOCKED_POINTER_V1_SET_REGION_SINCE_VERSION 1
457 
458 /** @ingroup iface_zwp_locked_pointer_v1 */
zwp_locked_pointer_v1_set_user_data(struct zwp_locked_pointer_v1 * zwp_locked_pointer_v1,void * user_data)459 static inline void zwp_locked_pointer_v1_set_user_data(
460     struct zwp_locked_pointer_v1* zwp_locked_pointer_v1, void* user_data) {
461   wl_proxy_set_user_data((struct wl_proxy*)zwp_locked_pointer_v1, user_data);
462 }
463 
464 /** @ingroup iface_zwp_locked_pointer_v1 */
zwp_locked_pointer_v1_get_user_data(struct zwp_locked_pointer_v1 * zwp_locked_pointer_v1)465 static inline void* zwp_locked_pointer_v1_get_user_data(
466     struct zwp_locked_pointer_v1* zwp_locked_pointer_v1) {
467   return wl_proxy_get_user_data((struct wl_proxy*)zwp_locked_pointer_v1);
468 }
469 
zwp_locked_pointer_v1_get_version(struct zwp_locked_pointer_v1 * zwp_locked_pointer_v1)470 static inline uint32_t zwp_locked_pointer_v1_get_version(
471     struct zwp_locked_pointer_v1* zwp_locked_pointer_v1) {
472   return wl_proxy_get_version((struct wl_proxy*)zwp_locked_pointer_v1);
473 }
474 
475 /**
476  * @ingroup iface_zwp_locked_pointer_v1
477  *
478  * Destroy the locked pointer object. If applicable, the compositor will
479  * unlock the pointer.
480  */
zwp_locked_pointer_v1_destroy(struct zwp_locked_pointer_v1 * zwp_locked_pointer_v1)481 static inline void zwp_locked_pointer_v1_destroy(
482     struct zwp_locked_pointer_v1* zwp_locked_pointer_v1) {
483   wl_proxy_marshal((struct wl_proxy*)zwp_locked_pointer_v1,
484                    ZWP_LOCKED_POINTER_V1_DESTROY);
485 
486   wl_proxy_destroy((struct wl_proxy*)zwp_locked_pointer_v1);
487 }
488 
489 /**
490  * @ingroup iface_zwp_locked_pointer_v1
491  *
492  * Set the cursor position hint relative to the top left corner of the
493  * surface.
494  *
495  * If the client is drawing its own cursor, it should update the position
496  * hint to the position of its own cursor. A compositor may use this
497  * information to warp the pointer upon unlock in order to avoid pointer
498  * jumps.
499  *
500  * The cursor position hint is double buffered. The new hint will only take
501  * effect when the associated surface gets it pending state applied. See
502  * wl_surface.commit for details.
503  */
zwp_locked_pointer_v1_set_cursor_position_hint(struct zwp_locked_pointer_v1 * zwp_locked_pointer_v1,wl_fixed_t surface_x,wl_fixed_t surface_y)504 static inline void zwp_locked_pointer_v1_set_cursor_position_hint(
505     struct zwp_locked_pointer_v1* zwp_locked_pointer_v1, wl_fixed_t surface_x,
506     wl_fixed_t surface_y) {
507   wl_proxy_marshal((struct wl_proxy*)zwp_locked_pointer_v1,
508                    ZWP_LOCKED_POINTER_V1_SET_CURSOR_POSITION_HINT, surface_x,
509                    surface_y);
510 }
511 
512 /**
513  * @ingroup iface_zwp_locked_pointer_v1
514  *
515  * Set a new region used to lock the pointer.
516  *
517  * The new lock region is double-buffered. The new lock region will
518  * only take effect when the associated surface gets its pending state
519  * applied. See wl_surface.commit for details.
520  *
521  * For details about the lock region, see wp_locked_pointer.
522  */
zwp_locked_pointer_v1_set_region(struct zwp_locked_pointer_v1 * zwp_locked_pointer_v1,struct wl_region * region)523 static inline void zwp_locked_pointer_v1_set_region(
524     struct zwp_locked_pointer_v1* zwp_locked_pointer_v1,
525     struct wl_region* region) {
526   wl_proxy_marshal((struct wl_proxy*)zwp_locked_pointer_v1,
527                    ZWP_LOCKED_POINTER_V1_SET_REGION, region);
528 }
529 
530 /**
531  * @ingroup iface_zwp_confined_pointer_v1
532  * @struct zwp_confined_pointer_v1_listener
533  */
534 struct zwp_confined_pointer_v1_listener {
535   /**
536    * pointer confined
537    *
538    * Notification that the pointer confinement of the seat's
539    * pointer is activated.
540    */
541   void (*confined)(void* data,
542                    struct zwp_confined_pointer_v1* zwp_confined_pointer_v1);
543   /**
544    * pointer unconfined
545    *
546    * Notification that the pointer confinement of the seat's
547    * pointer is no longer active. If this is a oneshot pointer
548    * confinement (see wp_pointer_constraints.lifetime) this object is
549    * now defunct and should be destroyed. If this is a persistent
550    * pointer confinement (see wp_pointer_constraints.lifetime) this
551    * pointer confinement may again reactivate in the future.
552    */
553   void (*unconfined)(void* data,
554                      struct zwp_confined_pointer_v1* zwp_confined_pointer_v1);
555 };
556 
557 /**
558  * @ingroup iface_zwp_confined_pointer_v1
559  */
zwp_confined_pointer_v1_add_listener(struct zwp_confined_pointer_v1 * zwp_confined_pointer_v1,const struct zwp_confined_pointer_v1_listener * listener,void * data)560 static inline int zwp_confined_pointer_v1_add_listener(
561     struct zwp_confined_pointer_v1* zwp_confined_pointer_v1,
562     const struct zwp_confined_pointer_v1_listener* listener, void* data) {
563   return wl_proxy_add_listener((struct wl_proxy*)zwp_confined_pointer_v1,
564                                (void (**)(void))listener, data);
565 }
566 
567 #define ZWP_CONFINED_POINTER_V1_DESTROY 0
568 #define ZWP_CONFINED_POINTER_V1_SET_REGION 1
569 
570 /**
571  * @ingroup iface_zwp_confined_pointer_v1
572  */
573 #define ZWP_CONFINED_POINTER_V1_CONFINED_SINCE_VERSION 1
574 /**
575  * @ingroup iface_zwp_confined_pointer_v1
576  */
577 #define ZWP_CONFINED_POINTER_V1_UNCONFINED_SINCE_VERSION 1
578 
579 /**
580  * @ingroup iface_zwp_confined_pointer_v1
581  */
582 #define ZWP_CONFINED_POINTER_V1_DESTROY_SINCE_VERSION 1
583 /**
584  * @ingroup iface_zwp_confined_pointer_v1
585  */
586 #define ZWP_CONFINED_POINTER_V1_SET_REGION_SINCE_VERSION 1
587 
588 /** @ingroup iface_zwp_confined_pointer_v1 */
zwp_confined_pointer_v1_set_user_data(struct zwp_confined_pointer_v1 * zwp_confined_pointer_v1,void * user_data)589 static inline void zwp_confined_pointer_v1_set_user_data(
590     struct zwp_confined_pointer_v1* zwp_confined_pointer_v1, void* user_data) {
591   wl_proxy_set_user_data((struct wl_proxy*)zwp_confined_pointer_v1, user_data);
592 }
593 
594 /** @ingroup iface_zwp_confined_pointer_v1 */
zwp_confined_pointer_v1_get_user_data(struct zwp_confined_pointer_v1 * zwp_confined_pointer_v1)595 static inline void* zwp_confined_pointer_v1_get_user_data(
596     struct zwp_confined_pointer_v1* zwp_confined_pointer_v1) {
597   return wl_proxy_get_user_data((struct wl_proxy*)zwp_confined_pointer_v1);
598 }
599 
zwp_confined_pointer_v1_get_version(struct zwp_confined_pointer_v1 * zwp_confined_pointer_v1)600 static inline uint32_t zwp_confined_pointer_v1_get_version(
601     struct zwp_confined_pointer_v1* zwp_confined_pointer_v1) {
602   return wl_proxy_get_version((struct wl_proxy*)zwp_confined_pointer_v1);
603 }
604 
605 /**
606  * @ingroup iface_zwp_confined_pointer_v1
607  *
608  * Destroy the confined pointer object. If applicable, the compositor will
609  * unconfine the pointer.
610  */
zwp_confined_pointer_v1_destroy(struct zwp_confined_pointer_v1 * zwp_confined_pointer_v1)611 static inline void zwp_confined_pointer_v1_destroy(
612     struct zwp_confined_pointer_v1* zwp_confined_pointer_v1) {
613   wl_proxy_marshal((struct wl_proxy*)zwp_confined_pointer_v1,
614                    ZWP_CONFINED_POINTER_V1_DESTROY);
615 
616   wl_proxy_destroy((struct wl_proxy*)zwp_confined_pointer_v1);
617 }
618 
619 /**
620  * @ingroup iface_zwp_confined_pointer_v1
621  *
622  * Set a new region used to confine the pointer.
623  *
624  * The new confine region is double-buffered. The new confine region will
625  * only take effect when the associated surface gets its pending state
626  * applied. See wl_surface.commit for details.
627  *
628  * If the confinement is active when the new confinement region is applied
629  * and the pointer ends up outside of newly applied region, the pointer may
630  * warped to a position within the new confinement region. If warped, a
631  * wl_pointer.motion event will be emitted, but no
632  * wp_relative_pointer.relative_motion event.
633  *
634  * The compositor may also, instead of using the new region, unconfine the
635  * pointer.
636  *
637  * For details about the confine region, see wp_confined_pointer.
638  */
zwp_confined_pointer_v1_set_region(struct zwp_confined_pointer_v1 * zwp_confined_pointer_v1,struct wl_region * region)639 static inline void zwp_confined_pointer_v1_set_region(
640     struct zwp_confined_pointer_v1* zwp_confined_pointer_v1,
641     struct wl_region* region) {
642   wl_proxy_marshal((struct wl_proxy*)zwp_confined_pointer_v1,
643                    ZWP_CONFINED_POINTER_V1_SET_REGION, region);
644 }
645 
646 #ifdef __cplusplus
647 }
648 #endif
649 
650 #endif
651