wayland-relative-pointer-unstable-v1-client-protocol.h (11527B)
1 /* Generated by wayland-scanner */ 2 3 #ifndef RELATIVE_POINTER_UNSTABLE_V1_CLIENT_PROTOCOL_H 4 #define RELATIVE_POINTER_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_relative_pointer_unstable_v1 The relative_pointer_unstable_v1 protocol 16 * protocol for relative pointer motion events 17 * 18 * @section page_desc_relative_pointer_unstable_v1 Description 19 * 20 * This protocol specifies a set of interfaces used for making clients able to 21 * receive relative pointer events not obstructed by barriers (such as the 22 * monitor edge or other pointer barriers). 23 * 24 * To start receiving relative pointer events, a client must first bind the 25 * global interface "wp_relative_pointer_manager" which, if a compositor 26 * supports relative pointer motion events, is exposed by the registry. After 27 * having created the relative pointer manager proxy object, the client uses 28 * it to create the actual relative pointer object using the 29 * "get_relative_pointer" request given a wl_pointer. The relative pointer 30 * motion events will then, when applicable, be transmitted via the proxy of 31 * the newly created relative pointer object. See the documentation of the 32 * relative pointer interface for more details. 33 * 34 * Warning! The protocol described in this file is experimental and backward 35 * incompatible changes may be made. Backward compatible changes may be added 36 * together with the corresponding interface version bump. Backward 37 * incompatible changes are done by bumping the version number in the protocol 38 * and interface names and resetting the interface version. Once the protocol 39 * is to be declared stable, the 'z' prefix and the version number in the 40 * protocol and interface names are removed and the interface version number is 41 * reset. 42 * 43 * @section page_ifaces_relative_pointer_unstable_v1 Interfaces 44 * - @subpage page_iface_zwp_relative_pointer_manager_v1 - get relative pointer objects 45 * - @subpage page_iface_zwp_relative_pointer_v1 - relative pointer object 46 * @section page_copyright_relative_pointer_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 zwp_relative_pointer_manager_v1; 74 struct zwp_relative_pointer_v1; 75 76 /** 77 * @page page_iface_zwp_relative_pointer_manager_v1 zwp_relative_pointer_manager_v1 78 * @section page_iface_zwp_relative_pointer_manager_v1_desc Description 79 * 80 * A global interface used for getting the relative pointer object for a 81 * given pointer. 82 * @section page_iface_zwp_relative_pointer_manager_v1_api API 83 * See @ref iface_zwp_relative_pointer_manager_v1. 84 */ 85 /** 86 * @defgroup iface_zwp_relative_pointer_manager_v1 The zwp_relative_pointer_manager_v1 interface 87 * 88 * A global interface used for getting the relative pointer object for a 89 * given pointer. 90 */ 91 extern const struct wl_interface zwp_relative_pointer_manager_v1_interface; 92 /** 93 * @page page_iface_zwp_relative_pointer_v1 zwp_relative_pointer_v1 94 * @section page_iface_zwp_relative_pointer_v1_desc Description 95 * 96 * A wp_relative_pointer object is an extension to the wl_pointer interface 97 * used for emitting relative pointer events. It shares the same focus as 98 * wl_pointer objects of the same seat and will only emit events when it has 99 * focus. 100 * @section page_iface_zwp_relative_pointer_v1_api API 101 * See @ref iface_zwp_relative_pointer_v1. 102 */ 103 /** 104 * @defgroup iface_zwp_relative_pointer_v1 The zwp_relative_pointer_v1 interface 105 * 106 * A wp_relative_pointer object is an extension to the wl_pointer interface 107 * used for emitting relative pointer events. It shares the same focus as 108 * wl_pointer objects of the same seat and will only emit events when it has 109 * focus. 110 */ 111 extern const struct wl_interface zwp_relative_pointer_v1_interface; 112 113 #define ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY 0 114 #define ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER 1 115 116 117 /** 118 * @ingroup iface_zwp_relative_pointer_manager_v1 119 */ 120 #define ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY_SINCE_VERSION 1 121 /** 122 * @ingroup iface_zwp_relative_pointer_manager_v1 123 */ 124 #define ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER_SINCE_VERSION 1 125 126 /** @ingroup iface_zwp_relative_pointer_manager_v1 */ 127 static inline void 128 zwp_relative_pointer_manager_v1_set_user_data(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1, void *user_data) 129 { 130 wl_proxy_set_user_data((struct wl_proxy *) zwp_relative_pointer_manager_v1, user_data); 131 } 132 133 /** @ingroup iface_zwp_relative_pointer_manager_v1 */ 134 static inline void * 135 zwp_relative_pointer_manager_v1_get_user_data(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1) 136 { 137 return wl_proxy_get_user_data((struct wl_proxy *) zwp_relative_pointer_manager_v1); 138 } 139 140 static inline uint32_t 141 zwp_relative_pointer_manager_v1_get_version(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1) 142 { 143 return wl_proxy_get_version((struct wl_proxy *) zwp_relative_pointer_manager_v1); 144 } 145 146 /** 147 * @ingroup iface_zwp_relative_pointer_manager_v1 148 * 149 * Used by the client to notify the server that it will no longer use this 150 * relative pointer manager object. 151 */ 152 static inline void 153 zwp_relative_pointer_manager_v1_destroy(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1) 154 { 155 wl_proxy_marshal((struct wl_proxy *) zwp_relative_pointer_manager_v1, 156 ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY); 157 158 wl_proxy_destroy((struct wl_proxy *) zwp_relative_pointer_manager_v1); 159 } 160 161 /** 162 * @ingroup iface_zwp_relative_pointer_manager_v1 163 * 164 * Create a relative pointer interface given a wl_pointer object. See the 165 * wp_relative_pointer interface for more details. 166 */ 167 static inline struct zwp_relative_pointer_v1 * 168 zwp_relative_pointer_manager_v1_get_relative_pointer(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1, struct wl_pointer *pointer) 169 { 170 struct wl_proxy *id; 171 172 id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_relative_pointer_manager_v1, 173 ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER, &zwp_relative_pointer_v1_interface, NULL, pointer); 174 175 return (struct zwp_relative_pointer_v1 *) id; 176 } 177 178 /** 179 * @ingroup iface_zwp_relative_pointer_v1 180 * @struct zwp_relative_pointer_v1_listener 181 */ 182 struct zwp_relative_pointer_v1_listener { 183 /** 184 * relative pointer motion 185 * 186 * Relative x/y pointer motion from the pointer of the seat 187 * associated with this object. 188 * 189 * A relative motion is in the same dimension as regular wl_pointer 190 * motion events, except they do not represent an absolute 191 * position. For example, moving a pointer from (x, y) to (x', y') 192 * would have the equivalent relative motion (x' - x, y' - y). If a 193 * pointer motion caused the absolute pointer position to be 194 * clipped by for example the edge of the monitor, the relative 195 * motion is unaffected by the clipping and will represent the 196 * unclipped motion. 197 * 198 * This event also contains non-accelerated motion deltas. The 199 * non-accelerated delta is, when applicable, the regular pointer 200 * motion delta as it was before having applied motion acceleration 201 * and other transformations such as normalization. 202 * 203 * Note that the non-accelerated delta does not represent 'raw' 204 * events as they were read from some device. Pointer motion 205 * acceleration is device- and configuration-specific and 206 * non-accelerated deltas and accelerated deltas may have the same 207 * value on some devices. 208 * 209 * Relative motions are not coupled to wl_pointer.motion events, 210 * and can be sent in combination with such events, but also 211 * independently. There may also be scenarios where 212 * wl_pointer.motion is sent, but there is no relative motion. The 213 * order of an absolute and relative motion event originating from 214 * the same physical motion is not guaranteed. 215 * 216 * If the client needs button events or focus state, it can receive 217 * them from a wl_pointer object of the same seat that the 218 * wp_relative_pointer object is associated with. 219 * @param utime_hi high 32 bits of a 64 bit timestamp with microsecond granularity 220 * @param utime_lo low 32 bits of a 64 bit timestamp with microsecond granularity 221 * @param dx the x component of the motion vector 222 * @param dy the y component of the motion vector 223 * @param dx_unaccel the x component of the unaccelerated motion vector 224 * @param dy_unaccel the y component of the unaccelerated motion vector 225 */ 226 void (*relative_motion)(void *data, 227 struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1, 228 uint32_t utime_hi, 229 uint32_t utime_lo, 230 wl_fixed_t dx, 231 wl_fixed_t dy, 232 wl_fixed_t dx_unaccel, 233 wl_fixed_t dy_unaccel); 234 }; 235 236 /** 237 * @ingroup iface_zwp_relative_pointer_v1 238 */ 239 static inline int 240 zwp_relative_pointer_v1_add_listener(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1, 241 const struct zwp_relative_pointer_v1_listener *listener, void *data) 242 { 243 return wl_proxy_add_listener((struct wl_proxy *) zwp_relative_pointer_v1, 244 (void (**)(void)) listener, data); 245 } 246 247 #define ZWP_RELATIVE_POINTER_V1_DESTROY 0 248 249 /** 250 * @ingroup iface_zwp_relative_pointer_v1 251 */ 252 #define ZWP_RELATIVE_POINTER_V1_RELATIVE_MOTION_SINCE_VERSION 1 253 254 /** 255 * @ingroup iface_zwp_relative_pointer_v1 256 */ 257 #define ZWP_RELATIVE_POINTER_V1_DESTROY_SINCE_VERSION 1 258 259 /** @ingroup iface_zwp_relative_pointer_v1 */ 260 static inline void 261 zwp_relative_pointer_v1_set_user_data(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1, void *user_data) 262 { 263 wl_proxy_set_user_data((struct wl_proxy *) zwp_relative_pointer_v1, user_data); 264 } 265 266 /** @ingroup iface_zwp_relative_pointer_v1 */ 267 static inline void * 268 zwp_relative_pointer_v1_get_user_data(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1) 269 { 270 return wl_proxy_get_user_data((struct wl_proxy *) zwp_relative_pointer_v1); 271 } 272 273 static inline uint32_t 274 zwp_relative_pointer_v1_get_version(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1) 275 { 276 return wl_proxy_get_version((struct wl_proxy *) zwp_relative_pointer_v1); 277 } 278 279 /** 280 * @ingroup iface_zwp_relative_pointer_v1 281 */ 282 static inline void 283 zwp_relative_pointer_v1_destroy(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1) 284 { 285 wl_proxy_marshal((struct wl_proxy *) zwp_relative_pointer_v1, 286 ZWP_RELATIVE_POINTER_V1_DESTROY); 287 288 wl_proxy_destroy((struct wl_proxy *) zwp_relative_pointer_v1); 289 } 290 291 #ifdef __cplusplus 292 } 293 #endif 294 295 #endif