| 1 | /* Generated by wayland-scanner 1.24.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 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 | */ |
| 69 | struct wl_pointer; |
| 70 | struct wl_region; |
| 71 | struct wl_surface; |
| 72 | struct zwp_confined_pointer_v1; |
| 73 | struct zwp_locked_pointer_v1; |
| 74 | struct 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 | */ |
| 115 | extern 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 | */ |
| 176 | extern 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 | */ |
| 223 | extern 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 | */ |
| 235 | enum zwp_pointer_constraints_v1_error { |
| 236 | /** |
| 237 | * pointer constraint already requested on that surface |
| 238 | */ |
| 239 | ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED = 1, |
| 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 | */ |
| 253 | enum zwp_pointer_constraints_v1_lifetime { |
| 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 | */ |
| 262 | ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT = 1, |
| 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 | */ |
| 271 | ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT = 2, |
| 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 */ |
| 294 | static inline void |
| 295 | zwp_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 */ |
| 301 | static inline void * |
| 302 | zwp_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 | |
| 307 | static inline uint32_t |
| 308 | zwp_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 | */ |
| 319 | static inline void |
| 320 | zwp_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 | */ |
| 364 | static inline struct zwp_locked_pointer_v1 * |
| 365 | 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) |
| 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 | */ |
| 396 | static inline struct zwp_confined_pointer_v1 * |
| 397 | 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) |
| 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 | */ |
| 411 | struct zwp_locked_pointer_v1_listener { |
| 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 | */ |
| 430 | void (*unlocked)(void *data, |
| 431 | struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1); |
| 432 | }; |
| 433 | |
| 434 | /** |
| 435 | * @ingroup iface_zwp_locked_pointer_v1 |
| 436 | */ |
| 437 | static inline int |
| 438 | zwp_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 */ |
| 472 | static inline void |
| 473 | zwp_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 */ |
| 479 | static inline void * |
| 480 | zwp_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 | |
| 485 | static inline uint32_t |
| 486 | zwp_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 | */ |
| 497 | static inline void |
| 498 | zwp_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 state, see |
| 516 | * wl_surface.commit. |
| 517 | */ |
| 518 | static inline void |
| 519 | 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) |
| 520 | { |
| 521 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_locked_pointer_v1, |
| 522 | 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); |
| 523 | } |
| 524 | |
| 525 | /** |
| 526 | * @ingroup iface_zwp_locked_pointer_v1 |
| 527 | * |
| 528 | * Set a new region used to lock the pointer. |
| 529 | * |
| 530 | * The new lock region is double-buffered, see wl_surface.commit. |
| 531 | * |
| 532 | * For details about the lock region, see wp_locked_pointer. |
| 533 | */ |
| 534 | static inline void |
| 535 | zwp_locked_pointer_v1_set_region(struct zwp_locked_pointer_v1 *zwp_locked_pointer_v1, struct wl_region *region) |
| 536 | { |
| 537 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_locked_pointer_v1, |
| 538 | ZWP_LOCKED_POINTER_V1_SET_REGION, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_locked_pointer_v1), 0, region); |
| 539 | } |
| 540 | |
| 541 | /** |
| 542 | * @ingroup iface_zwp_confined_pointer_v1 |
| 543 | * @struct zwp_confined_pointer_v1_listener |
| 544 | */ |
| 545 | struct zwp_confined_pointer_v1_listener { |
| 546 | /** |
| 547 | * pointer confined |
| 548 | * |
| 549 | * Notification that the pointer confinement of the seat's |
| 550 | * pointer is activated. |
| 551 | */ |
| 552 | void (*confined)(void *data, |
| 553 | struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1); |
| 554 | /** |
| 555 | * pointer unconfined |
| 556 | * |
| 557 | * Notification that the pointer confinement of the seat's |
| 558 | * pointer is no longer active. If this is a oneshot pointer |
| 559 | * confinement (see wp_pointer_constraints.lifetime) this object is |
| 560 | * now defunct and should be destroyed. If this is a persistent |
| 561 | * pointer confinement (see wp_pointer_constraints.lifetime) this |
| 562 | * pointer confinement may again reactivate in the future. |
| 563 | */ |
| 564 | void (*unconfined)(void *data, |
| 565 | struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1); |
| 566 | }; |
| 567 | |
| 568 | /** |
| 569 | * @ingroup iface_zwp_confined_pointer_v1 |
| 570 | */ |
| 571 | static inline int |
| 572 | zwp_confined_pointer_v1_add_listener(struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1, |
| 573 | const struct zwp_confined_pointer_v1_listener *listener, void *data) |
| 574 | { |
| 575 | return wl_proxy_add_listener((struct wl_proxy *) zwp_confined_pointer_v1, |
| 576 | (void (**)(void)) listener, data); |
| 577 | } |
| 578 | |
| 579 | #define ZWP_CONFINED_POINTER_V1_DESTROY 0 |
| 580 | #define ZWP_CONFINED_POINTER_V1_SET_REGION 1 |
| 581 | |
| 582 | /** |
| 583 | * @ingroup iface_zwp_confined_pointer_v1 |
| 584 | */ |
| 585 | #define ZWP_CONFINED_POINTER_V1_CONFINED_SINCE_VERSION 1 |
| 586 | /** |
| 587 | * @ingroup iface_zwp_confined_pointer_v1 |
| 588 | */ |
| 589 | #define ZWP_CONFINED_POINTER_V1_UNCONFINED_SINCE_VERSION 1 |
| 590 | |
| 591 | /** |
| 592 | * @ingroup iface_zwp_confined_pointer_v1 |
| 593 | */ |
| 594 | #define ZWP_CONFINED_POINTER_V1_DESTROY_SINCE_VERSION 1 |
| 595 | /** |
| 596 | * @ingroup iface_zwp_confined_pointer_v1 |
| 597 | */ |
| 598 | #define ZWP_CONFINED_POINTER_V1_SET_REGION_SINCE_VERSION 1 |
| 599 | |
| 600 | /** @ingroup iface_zwp_confined_pointer_v1 */ |
| 601 | static inline void |
| 602 | zwp_confined_pointer_v1_set_user_data(struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1, void *user_data) |
| 603 | { |
| 604 | wl_proxy_set_user_data((struct wl_proxy *) zwp_confined_pointer_v1, user_data); |
| 605 | } |
| 606 | |
| 607 | /** @ingroup iface_zwp_confined_pointer_v1 */ |
| 608 | static inline void * |
| 609 | zwp_confined_pointer_v1_get_user_data(struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1) |
| 610 | { |
| 611 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_confined_pointer_v1); |
| 612 | } |
| 613 | |
| 614 | static inline uint32_t |
| 615 | zwp_confined_pointer_v1_get_version(struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1) |
| 616 | { |
| 617 | return wl_proxy_get_version((struct wl_proxy *) zwp_confined_pointer_v1); |
| 618 | } |
| 619 | |
| 620 | /** |
| 621 | * @ingroup iface_zwp_confined_pointer_v1 |
| 622 | * |
| 623 | * Destroy the confined pointer object. If applicable, the compositor will |
| 624 | * unconfine the pointer. |
| 625 | */ |
| 626 | static inline void |
| 627 | zwp_confined_pointer_v1_destroy(struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1) |
| 628 | { |
| 629 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_confined_pointer_v1, |
| 630 | ZWP_CONFINED_POINTER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_confined_pointer_v1), WL_MARSHAL_FLAG_DESTROY); |
| 631 | } |
| 632 | |
| 633 | /** |
| 634 | * @ingroup iface_zwp_confined_pointer_v1 |
| 635 | * |
| 636 | * Set a new region used to confine the pointer. |
| 637 | * |
| 638 | * The new confine region is double-buffered, see wl_surface.commit. |
| 639 | * |
| 640 | * If the confinement is active when the new confinement region is applied |
| 641 | * and the pointer ends up outside of newly applied region, the pointer may |
| 642 | * warped to a position within the new confinement region. If warped, a |
| 643 | * wl_pointer.motion event will be emitted, but no |
| 644 | * wp_relative_pointer.relative_motion event. |
| 645 | * |
| 646 | * The compositor may also, instead of using the new region, unconfine the |
| 647 | * pointer. |
| 648 | * |
| 649 | * For details about the confine region, see wp_confined_pointer. |
| 650 | */ |
| 651 | static inline void |
| 652 | zwp_confined_pointer_v1_set_region(struct zwp_confined_pointer_v1 *zwp_confined_pointer_v1, struct wl_region *region) |
| 653 | { |
| 654 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_confined_pointer_v1, |
| 655 | ZWP_CONFINED_POINTER_V1_SET_REGION, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_confined_pointer_v1), 0, region); |
| 656 | } |
| 657 | |
| 658 | #ifdef __cplusplus |
| 659 | } |
| 660 | #endif |
| 661 | |
| 662 | #endif |
| 663 | |