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