| 1 | /* Generated by wayland-scanner 1.24.0 */ |
| 2 | |
| 3 | #ifndef TABLET_UNSTABLE_V2_CLIENT_PROTOCOL_H |
| 4 | #define TABLET_UNSTABLE_V2_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_tablet_unstable_v2 The tablet_unstable_v2 protocol |
| 16 | * Wayland protocol for graphics tablets |
| 17 | * |
| 18 | * @section page_desc_tablet_unstable_v2 Description |
| 19 | * |
| 20 | * This description provides a high-level overview of the interplay between |
| 21 | * the interfaces defined this protocol. For details, see the protocol |
| 22 | * specification. |
| 23 | * |
| 24 | * More than one tablet may exist, and device-specifics matter. Tablets are |
| 25 | * not represented by a single virtual device like wl_pointer. A client |
| 26 | * binds to the tablet manager object which is just a proxy object. From |
| 27 | * that, the client requests wp_tablet_manager.get_tablet_seat(wl_seat) |
| 28 | * and that returns the actual interface that has all the tablets. With |
| 29 | * this indirection, we can avoid merging wp_tablet into the actual Wayland |
| 30 | * protocol, a long-term benefit. |
| 31 | * |
| 32 | * The wp_tablet_seat sends a "tablet added" event for each tablet |
| 33 | * connected. That event is followed by descriptive events about the |
| 34 | * hardware; currently that includes events for name, vid/pid and |
| 35 | * a wp_tablet.path event that describes a local path. This path can be |
| 36 | * used to uniquely identify a tablet or get more information through |
| 37 | * libwacom. Emulated or nested tablets can skip any of those, e.g. a |
| 38 | * virtual tablet may not have a vid/pid. The sequence of descriptive |
| 39 | * events is terminated by a wp_tablet.done event to signal that a client |
| 40 | * may now finalize any initialization for that tablet. |
| 41 | * |
| 42 | * Events from tablets require a tool in proximity. Tools are also managed |
| 43 | * by the tablet seat; a "tool added" event is sent whenever a tool is new |
| 44 | * to the compositor. That event is followed by a number of descriptive |
| 45 | * events about the hardware; currently that includes capabilities, |
| 46 | * hardware id and serial number, and tool type. Similar to the tablet |
| 47 | * interface, a wp_tablet_tool.done event is sent to terminate that initial |
| 48 | * sequence. |
| 49 | * |
| 50 | * Any event from a tool happens on the wp_tablet_tool interface. When the |
| 51 | * tool gets into proximity of the tablet, a proximity_in event is sent on |
| 52 | * the wp_tablet_tool interface, listing the tablet and the surface. That |
| 53 | * event is followed by a motion event with the coordinates. After that, |
| 54 | * it's the usual motion, axis, button, etc. events. The protocol's |
| 55 | * serialisation means events are grouped by wp_tablet_tool.frame events. |
| 56 | * |
| 57 | * Two special events (that don't exist in X) are down and up. They signal |
| 58 | * "tip touching the surface". For tablets without real proximity |
| 59 | * detection, the sequence is: proximity_in, motion, down, frame. |
| 60 | * |
| 61 | * When the tool leaves proximity, a proximity_out event is sent. If any |
| 62 | * button is still down, a button release event is sent before this |
| 63 | * proximity event. These button events are sent in the same frame as the |
| 64 | * proximity event to signal to the client that the buttons were held when |
| 65 | * the tool left proximity. |
| 66 | * |
| 67 | * If the tool moves out of the surface but stays in proximity (i.e. |
| 68 | * between windows), compositor-specific grab policies apply. This usually |
| 69 | * means that the proximity-out is delayed until all buttons are released. |
| 70 | * |
| 71 | * Moving a tool physically from one tablet to the other has no real effect |
| 72 | * on the protocol, since we already have the tool object from the "tool |
| 73 | * added" event. All the information is already there and the proximity |
| 74 | * events on both tablets are all a client needs to reconstruct what |
| 75 | * happened. |
| 76 | * |
| 77 | * Some extra axes are normalized, i.e. the client knows the range as |
| 78 | * specified in the protocol (e.g. [0, 65535]), the granularity however is |
| 79 | * unknown. The current normalized axes are pressure, distance, and slider. |
| 80 | * |
| 81 | * Other extra axes are in physical units as specified in the protocol. |
| 82 | * The current extra axes with physical units are tilt, rotation and |
| 83 | * wheel rotation. |
| 84 | * |
| 85 | * Since tablets work independently of the pointer controlled by the mouse, |
| 86 | * the focus handling is independent too and controlled by proximity. |
| 87 | * The wp_tablet_tool.set_cursor request sets a tool-specific cursor. |
| 88 | * This cursor surface may be the same as the mouse cursor, and it may be |
| 89 | * the same across tools but it is possible to be more fine-grained. For |
| 90 | * example, a client may set different cursors for the pen and eraser. |
| 91 | * |
| 92 | * Tools are generally independent of tablets and it is |
| 93 | * compositor-specific policy when a tool can be removed. Common approaches |
| 94 | * will likely include some form of removing a tool when all tablets the |
| 95 | * tool was used on are removed. |
| 96 | * |
| 97 | * Disclaimer: This protocol extension has been marked stable. This copy is |
| 98 | * no longer used and only retained for backwards compatibility. The |
| 99 | * canonical version can be found in the stable/ directory. |
| 100 | * |
| 101 | * @section page_ifaces_tablet_unstable_v2 Interfaces |
| 102 | * - @subpage page_iface_zwp_tablet_manager_v2 - controller object for graphic tablet devices |
| 103 | * - @subpage page_iface_zwp_tablet_seat_v2 - controller object for graphic tablet devices of a seat |
| 104 | * - @subpage page_iface_zwp_tablet_tool_v2 - a physical tablet tool |
| 105 | * - @subpage page_iface_zwp_tablet_v2 - graphics tablet device |
| 106 | * - @subpage page_iface_zwp_tablet_pad_ring_v2 - pad ring |
| 107 | * - @subpage page_iface_zwp_tablet_pad_strip_v2 - pad strip |
| 108 | * - @subpage page_iface_zwp_tablet_pad_group_v2 - a set of buttons, rings and strips |
| 109 | * - @subpage page_iface_zwp_tablet_pad_v2 - a set of buttons, rings and strips |
| 110 | * @section page_copyright_tablet_unstable_v2 Copyright |
| 111 | * <pre> |
| 112 | * |
| 113 | * Copyright 2014 © Stephen "Lyude" Chandler Paul |
| 114 | * Copyright 2015-2016 © Red Hat, Inc. |
| 115 | * |
| 116 | * Permission is hereby granted, free of charge, to any person |
| 117 | * obtaining a copy of this software and associated documentation files |
| 118 | * (the "Software"), to deal in the Software without restriction, |
| 119 | * including without limitation the rights to use, copy, modify, merge, |
| 120 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 121 | * and to permit persons to whom the Software is furnished to do so, |
| 122 | * subject to the following conditions: |
| 123 | * |
| 124 | * The above copyright notice and this permission notice (including the |
| 125 | * next paragraph) shall be included in all copies or substantial |
| 126 | * portions of the Software. |
| 127 | * |
| 128 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 129 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 130 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 131 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 132 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 133 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 134 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 135 | * SOFTWARE. |
| 136 | * </pre> |
| 137 | */ |
| 138 | struct wl_seat; |
| 139 | struct wl_surface; |
| 140 | struct zwp_tablet_manager_v2; |
| 141 | struct zwp_tablet_pad_group_v2; |
| 142 | struct zwp_tablet_pad_ring_v2; |
| 143 | struct zwp_tablet_pad_strip_v2; |
| 144 | struct zwp_tablet_pad_v2; |
| 145 | struct zwp_tablet_seat_v2; |
| 146 | struct zwp_tablet_tool_v2; |
| 147 | struct zwp_tablet_v2; |
| 148 | |
| 149 | #ifndef ZWP_TABLET_MANAGER_V2_INTERFACE |
| 150 | #define ZWP_TABLET_MANAGER_V2_INTERFACE |
| 151 | /** |
| 152 | * @page page_iface_zwp_tablet_manager_v2 zwp_tablet_manager_v2 |
| 153 | * @section page_iface_zwp_tablet_manager_v2_desc Description |
| 154 | * |
| 155 | * An object that provides access to the graphics tablets available on this |
| 156 | * system. All tablets are associated with a seat, to get access to the |
| 157 | * actual tablets, use wp_tablet_manager.get_tablet_seat. |
| 158 | * @section page_iface_zwp_tablet_manager_v2_api API |
| 159 | * See @ref iface_zwp_tablet_manager_v2. |
| 160 | */ |
| 161 | /** |
| 162 | * @defgroup iface_zwp_tablet_manager_v2 The zwp_tablet_manager_v2 interface |
| 163 | * |
| 164 | * An object that provides access to the graphics tablets available on this |
| 165 | * system. All tablets are associated with a seat, to get access to the |
| 166 | * actual tablets, use wp_tablet_manager.get_tablet_seat. |
| 167 | */ |
| 168 | extern const struct wl_interface zwp_tablet_manager_v2_interface; |
| 169 | #endif |
| 170 | #ifndef ZWP_TABLET_SEAT_V2_INTERFACE |
| 171 | #define ZWP_TABLET_SEAT_V2_INTERFACE |
| 172 | /** |
| 173 | * @page page_iface_zwp_tablet_seat_v2 zwp_tablet_seat_v2 |
| 174 | * @section page_iface_zwp_tablet_seat_v2_desc Description |
| 175 | * |
| 176 | * An object that provides access to the graphics tablets available on this |
| 177 | * seat. After binding to this interface, the compositor sends a set of |
| 178 | * wp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events. |
| 179 | * @section page_iface_zwp_tablet_seat_v2_api API |
| 180 | * See @ref iface_zwp_tablet_seat_v2. |
| 181 | */ |
| 182 | /** |
| 183 | * @defgroup iface_zwp_tablet_seat_v2 The zwp_tablet_seat_v2 interface |
| 184 | * |
| 185 | * An object that provides access to the graphics tablets available on this |
| 186 | * seat. After binding to this interface, the compositor sends a set of |
| 187 | * wp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events. |
| 188 | */ |
| 189 | extern const struct wl_interface zwp_tablet_seat_v2_interface; |
| 190 | #endif |
| 191 | #ifndef ZWP_TABLET_TOOL_V2_INTERFACE |
| 192 | #define ZWP_TABLET_TOOL_V2_INTERFACE |
| 193 | /** |
| 194 | * @page page_iface_zwp_tablet_tool_v2 zwp_tablet_tool_v2 |
| 195 | * @section page_iface_zwp_tablet_tool_v2_desc Description |
| 196 | * |
| 197 | * An object that represents a physical tool that has been, or is |
| 198 | * currently in use with a tablet in this seat. Each wp_tablet_tool |
| 199 | * object stays valid until the client destroys it; the compositor |
| 200 | * reuses the wp_tablet_tool object to indicate that the object's |
| 201 | * respective physical tool has come into proximity of a tablet again. |
| 202 | * |
| 203 | * A wp_tablet_tool object's relation to a physical tool depends on the |
| 204 | * tablet's ability to report serial numbers. If the tablet supports |
| 205 | * this capability, then the object represents a specific physical tool |
| 206 | * and can be identified even when used on multiple tablets. |
| 207 | * |
| 208 | * A tablet tool has a number of static characteristics, e.g. tool type, |
| 209 | * hardware_serial and capabilities. These capabilities are sent in an |
| 210 | * event sequence after the wp_tablet_seat.tool_added event before any |
| 211 | * actual events from this tool. This initial event sequence is |
| 212 | * terminated by a wp_tablet_tool.done event. |
| 213 | * |
| 214 | * Tablet tool events are grouped by wp_tablet_tool.frame events. |
| 215 | * Any events received before a wp_tablet_tool.frame event should be |
| 216 | * considered part of the same hardware state change. |
| 217 | * @section page_iface_zwp_tablet_tool_v2_api API |
| 218 | * See @ref iface_zwp_tablet_tool_v2. |
| 219 | */ |
| 220 | /** |
| 221 | * @defgroup iface_zwp_tablet_tool_v2 The zwp_tablet_tool_v2 interface |
| 222 | * |
| 223 | * An object that represents a physical tool that has been, or is |
| 224 | * currently in use with a tablet in this seat. Each wp_tablet_tool |
| 225 | * object stays valid until the client destroys it; the compositor |
| 226 | * reuses the wp_tablet_tool object to indicate that the object's |
| 227 | * respective physical tool has come into proximity of a tablet again. |
| 228 | * |
| 229 | * A wp_tablet_tool object's relation to a physical tool depends on the |
| 230 | * tablet's ability to report serial numbers. If the tablet supports |
| 231 | * this capability, then the object represents a specific physical tool |
| 232 | * and can be identified even when used on multiple tablets. |
| 233 | * |
| 234 | * A tablet tool has a number of static characteristics, e.g. tool type, |
| 235 | * hardware_serial and capabilities. These capabilities are sent in an |
| 236 | * event sequence after the wp_tablet_seat.tool_added event before any |
| 237 | * actual events from this tool. This initial event sequence is |
| 238 | * terminated by a wp_tablet_tool.done event. |
| 239 | * |
| 240 | * Tablet tool events are grouped by wp_tablet_tool.frame events. |
| 241 | * Any events received before a wp_tablet_tool.frame event should be |
| 242 | * considered part of the same hardware state change. |
| 243 | */ |
| 244 | extern const struct wl_interface zwp_tablet_tool_v2_interface; |
| 245 | #endif |
| 246 | #ifndef ZWP_TABLET_V2_INTERFACE |
| 247 | #define ZWP_TABLET_V2_INTERFACE |
| 248 | /** |
| 249 | * @page page_iface_zwp_tablet_v2 zwp_tablet_v2 |
| 250 | * @section page_iface_zwp_tablet_v2_desc Description |
| 251 | * |
| 252 | * The wp_tablet interface represents one graphics tablet device. The |
| 253 | * tablet interface itself does not generate events; all events are |
| 254 | * generated by wp_tablet_tool objects when in proximity above a tablet. |
| 255 | * |
| 256 | * A tablet has a number of static characteristics, e.g. device name and |
| 257 | * pid/vid. These capabilities are sent in an event sequence after the |
| 258 | * wp_tablet_seat.tablet_added event. This initial event sequence is |
| 259 | * terminated by a wp_tablet.done event. |
| 260 | * @section page_iface_zwp_tablet_v2_api API |
| 261 | * See @ref iface_zwp_tablet_v2. |
| 262 | */ |
| 263 | /** |
| 264 | * @defgroup iface_zwp_tablet_v2 The zwp_tablet_v2 interface |
| 265 | * |
| 266 | * The wp_tablet interface represents one graphics tablet device. The |
| 267 | * tablet interface itself does not generate events; all events are |
| 268 | * generated by wp_tablet_tool objects when in proximity above a tablet. |
| 269 | * |
| 270 | * A tablet has a number of static characteristics, e.g. device name and |
| 271 | * pid/vid. These capabilities are sent in an event sequence after the |
| 272 | * wp_tablet_seat.tablet_added event. This initial event sequence is |
| 273 | * terminated by a wp_tablet.done event. |
| 274 | */ |
| 275 | extern const struct wl_interface zwp_tablet_v2_interface; |
| 276 | #endif |
| 277 | #ifndef ZWP_TABLET_PAD_RING_V2_INTERFACE |
| 278 | #define ZWP_TABLET_PAD_RING_V2_INTERFACE |
| 279 | /** |
| 280 | * @page page_iface_zwp_tablet_pad_ring_v2 zwp_tablet_pad_ring_v2 |
| 281 | * @section page_iface_zwp_tablet_pad_ring_v2_desc Description |
| 282 | * |
| 283 | * A circular interaction area, such as the touch ring on the Wacom Intuos |
| 284 | * Pro series tablets. |
| 285 | * |
| 286 | * Events on a ring are logically grouped by the wl_tablet_pad_ring.frame |
| 287 | * event. |
| 288 | * @section page_iface_zwp_tablet_pad_ring_v2_api API |
| 289 | * See @ref iface_zwp_tablet_pad_ring_v2. |
| 290 | */ |
| 291 | /** |
| 292 | * @defgroup iface_zwp_tablet_pad_ring_v2 The zwp_tablet_pad_ring_v2 interface |
| 293 | * |
| 294 | * A circular interaction area, such as the touch ring on the Wacom Intuos |
| 295 | * Pro series tablets. |
| 296 | * |
| 297 | * Events on a ring are logically grouped by the wl_tablet_pad_ring.frame |
| 298 | * event. |
| 299 | */ |
| 300 | extern const struct wl_interface zwp_tablet_pad_ring_v2_interface; |
| 301 | #endif |
| 302 | #ifndef ZWP_TABLET_PAD_STRIP_V2_INTERFACE |
| 303 | #define ZWP_TABLET_PAD_STRIP_V2_INTERFACE |
| 304 | /** |
| 305 | * @page page_iface_zwp_tablet_pad_strip_v2 zwp_tablet_pad_strip_v2 |
| 306 | * @section page_iface_zwp_tablet_pad_strip_v2_desc Description |
| 307 | * |
| 308 | * A linear interaction area, such as the strips found in Wacom Cintiq |
| 309 | * models. |
| 310 | * |
| 311 | * Events on a strip are logically grouped by the wl_tablet_pad_strip.frame |
| 312 | * event. |
| 313 | * @section page_iface_zwp_tablet_pad_strip_v2_api API |
| 314 | * See @ref iface_zwp_tablet_pad_strip_v2. |
| 315 | */ |
| 316 | /** |
| 317 | * @defgroup iface_zwp_tablet_pad_strip_v2 The zwp_tablet_pad_strip_v2 interface |
| 318 | * |
| 319 | * A linear interaction area, such as the strips found in Wacom Cintiq |
| 320 | * models. |
| 321 | * |
| 322 | * Events on a strip are logically grouped by the wl_tablet_pad_strip.frame |
| 323 | * event. |
| 324 | */ |
| 325 | extern const struct wl_interface zwp_tablet_pad_strip_v2_interface; |
| 326 | #endif |
| 327 | #ifndef ZWP_TABLET_PAD_GROUP_V2_INTERFACE |
| 328 | #define ZWP_TABLET_PAD_GROUP_V2_INTERFACE |
| 329 | /** |
| 330 | * @page page_iface_zwp_tablet_pad_group_v2 zwp_tablet_pad_group_v2 |
| 331 | * @section page_iface_zwp_tablet_pad_group_v2_desc Description |
| 332 | * |
| 333 | * A pad group describes a distinct (sub)set of buttons, rings and strips |
| 334 | * present in the tablet. The criteria of this grouping is usually positional, |
| 335 | * eg. if a tablet has buttons on the left and right side, 2 groups will be |
| 336 | * presented. The physical arrangement of groups is undisclosed and may |
| 337 | * change on the fly. |
| 338 | * |
| 339 | * Pad groups will announce their features during pad initialization. Between |
| 340 | * the corresponding wp_tablet_pad.group event and wp_tablet_pad_group.done, the |
| 341 | * pad group will announce the buttons, rings and strips contained in it, |
| 342 | * plus the number of supported modes. |
| 343 | * |
| 344 | * Modes are a mechanism to allow multiple groups of actions for every element |
| 345 | * in the pad group. The number of groups and available modes in each is |
| 346 | * persistent across device plugs. The current mode is user-switchable, it |
| 347 | * will be announced through the wp_tablet_pad_group.mode_switch event both |
| 348 | * whenever it is switched, and after wp_tablet_pad.enter. |
| 349 | * |
| 350 | * The current mode logically applies to all elements in the pad group, |
| 351 | * although it is at clients' discretion whether to actually perform different |
| 352 | * actions, and/or issue the respective .set_feedback requests to notify the |
| 353 | * compositor. See the wp_tablet_pad_group.mode_switch event for more details. |
| 354 | * @section page_iface_zwp_tablet_pad_group_v2_api API |
| 355 | * See @ref iface_zwp_tablet_pad_group_v2. |
| 356 | */ |
| 357 | /** |
| 358 | * @defgroup iface_zwp_tablet_pad_group_v2 The zwp_tablet_pad_group_v2 interface |
| 359 | * |
| 360 | * A pad group describes a distinct (sub)set of buttons, rings and strips |
| 361 | * present in the tablet. The criteria of this grouping is usually positional, |
| 362 | * eg. if a tablet has buttons on the left and right side, 2 groups will be |
| 363 | * presented. The physical arrangement of groups is undisclosed and may |
| 364 | * change on the fly. |
| 365 | * |
| 366 | * Pad groups will announce their features during pad initialization. Between |
| 367 | * the corresponding wp_tablet_pad.group event and wp_tablet_pad_group.done, the |
| 368 | * pad group will announce the buttons, rings and strips contained in it, |
| 369 | * plus the number of supported modes. |
| 370 | * |
| 371 | * Modes are a mechanism to allow multiple groups of actions for every element |
| 372 | * in the pad group. The number of groups and available modes in each is |
| 373 | * persistent across device plugs. The current mode is user-switchable, it |
| 374 | * will be announced through the wp_tablet_pad_group.mode_switch event both |
| 375 | * whenever it is switched, and after wp_tablet_pad.enter. |
| 376 | * |
| 377 | * The current mode logically applies to all elements in the pad group, |
| 378 | * although it is at clients' discretion whether to actually perform different |
| 379 | * actions, and/or issue the respective .set_feedback requests to notify the |
| 380 | * compositor. See the wp_tablet_pad_group.mode_switch event for more details. |
| 381 | */ |
| 382 | extern const struct wl_interface zwp_tablet_pad_group_v2_interface; |
| 383 | #endif |
| 384 | #ifndef ZWP_TABLET_PAD_V2_INTERFACE |
| 385 | #define ZWP_TABLET_PAD_V2_INTERFACE |
| 386 | /** |
| 387 | * @page page_iface_zwp_tablet_pad_v2 zwp_tablet_pad_v2 |
| 388 | * @section page_iface_zwp_tablet_pad_v2_desc Description |
| 389 | * |
| 390 | * A pad device is a set of buttons, rings and strips |
| 391 | * usually physically present on the tablet device itself. Some |
| 392 | * exceptions exist where the pad device is physically detached, e.g. the |
| 393 | * Wacom ExpressKey Remote. |
| 394 | * |
| 395 | * Pad devices have no axes that control the cursor and are generally |
| 396 | * auxiliary devices to the tool devices used on the tablet surface. |
| 397 | * |
| 398 | * A pad device has a number of static characteristics, e.g. the number |
| 399 | * of rings. These capabilities are sent in an event sequence after the |
| 400 | * wp_tablet_seat.pad_added event before any actual events from this pad. |
| 401 | * This initial event sequence is terminated by a wp_tablet_pad.done |
| 402 | * event. |
| 403 | * |
| 404 | * All pad features (buttons, rings and strips) are logically divided into |
| 405 | * groups and all pads have at least one group. The available groups are |
| 406 | * notified through the wp_tablet_pad.group event; the compositor will |
| 407 | * emit one event per group before emitting wp_tablet_pad.done. |
| 408 | * |
| 409 | * Groups may have multiple modes. Modes allow clients to map multiple |
| 410 | * actions to a single pad feature. Only one mode can be active per group, |
| 411 | * although different groups may have different active modes. |
| 412 | * @section page_iface_zwp_tablet_pad_v2_api API |
| 413 | * See @ref iface_zwp_tablet_pad_v2. |
| 414 | */ |
| 415 | /** |
| 416 | * @defgroup iface_zwp_tablet_pad_v2 The zwp_tablet_pad_v2 interface |
| 417 | * |
| 418 | * A pad device is a set of buttons, rings and strips |
| 419 | * usually physically present on the tablet device itself. Some |
| 420 | * exceptions exist where the pad device is physically detached, e.g. the |
| 421 | * Wacom ExpressKey Remote. |
| 422 | * |
| 423 | * Pad devices have no axes that control the cursor and are generally |
| 424 | * auxiliary devices to the tool devices used on the tablet surface. |
| 425 | * |
| 426 | * A pad device has a number of static characteristics, e.g. the number |
| 427 | * of rings. These capabilities are sent in an event sequence after the |
| 428 | * wp_tablet_seat.pad_added event before any actual events from this pad. |
| 429 | * This initial event sequence is terminated by a wp_tablet_pad.done |
| 430 | * event. |
| 431 | * |
| 432 | * All pad features (buttons, rings and strips) are logically divided into |
| 433 | * groups and all pads have at least one group. The available groups are |
| 434 | * notified through the wp_tablet_pad.group event; the compositor will |
| 435 | * emit one event per group before emitting wp_tablet_pad.done. |
| 436 | * |
| 437 | * Groups may have multiple modes. Modes allow clients to map multiple |
| 438 | * actions to a single pad feature. Only one mode can be active per group, |
| 439 | * although different groups may have different active modes. |
| 440 | */ |
| 441 | extern const struct wl_interface zwp_tablet_pad_v2_interface; |
| 442 | #endif |
| 443 | |
| 444 | #define ZWP_TABLET_MANAGER_V2_GET_TABLET_SEAT 0 |
| 445 | #define ZWP_TABLET_MANAGER_V2_DESTROY 1 |
| 446 | |
| 447 | |
| 448 | /** |
| 449 | * @ingroup iface_zwp_tablet_manager_v2 |
| 450 | */ |
| 451 | #define ZWP_TABLET_MANAGER_V2_GET_TABLET_SEAT_SINCE_VERSION 1 |
| 452 | /** |
| 453 | * @ingroup iface_zwp_tablet_manager_v2 |
| 454 | */ |
| 455 | #define ZWP_TABLET_MANAGER_V2_DESTROY_SINCE_VERSION 1 |
| 456 | |
| 457 | /** @ingroup iface_zwp_tablet_manager_v2 */ |
| 458 | static inline void |
| 459 | zwp_tablet_manager_v2_set_user_data(struct zwp_tablet_manager_v2 *zwp_tablet_manager_v2, void *user_data) |
| 460 | { |
| 461 | wl_proxy_set_user_data((struct wl_proxy *) zwp_tablet_manager_v2, user_data); |
| 462 | } |
| 463 | |
| 464 | /** @ingroup iface_zwp_tablet_manager_v2 */ |
| 465 | static inline void * |
| 466 | zwp_tablet_manager_v2_get_user_data(struct zwp_tablet_manager_v2 *zwp_tablet_manager_v2) |
| 467 | { |
| 468 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_tablet_manager_v2); |
| 469 | } |
| 470 | |
| 471 | static inline uint32_t |
| 472 | zwp_tablet_manager_v2_get_version(struct zwp_tablet_manager_v2 *zwp_tablet_manager_v2) |
| 473 | { |
| 474 | return wl_proxy_get_version((struct wl_proxy *) zwp_tablet_manager_v2); |
| 475 | } |
| 476 | |
| 477 | /** |
| 478 | * @ingroup iface_zwp_tablet_manager_v2 |
| 479 | * |
| 480 | * Get the wp_tablet_seat object for the given seat. This object |
| 481 | * provides access to all graphics tablets in this seat. |
| 482 | */ |
| 483 | static inline struct zwp_tablet_seat_v2 * |
| 484 | zwp_tablet_manager_v2_get_tablet_seat(struct zwp_tablet_manager_v2 *zwp_tablet_manager_v2, struct wl_seat *seat) |
| 485 | { |
| 486 | struct wl_proxy *tablet_seat; |
| 487 | |
| 488 | tablet_seat = wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_manager_v2, |
| 489 | ZWP_TABLET_MANAGER_V2_GET_TABLET_SEAT, &zwp_tablet_seat_v2_interface, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_manager_v2), 0, NULL, seat); |
| 490 | |
| 491 | return (struct zwp_tablet_seat_v2 *) tablet_seat; |
| 492 | } |
| 493 | |
| 494 | /** |
| 495 | * @ingroup iface_zwp_tablet_manager_v2 |
| 496 | * |
| 497 | * Destroy the wp_tablet_manager object. Objects created from this |
| 498 | * object are unaffected and should be destroyed separately. |
| 499 | */ |
| 500 | static inline void |
| 501 | zwp_tablet_manager_v2_destroy(struct zwp_tablet_manager_v2 *zwp_tablet_manager_v2) |
| 502 | { |
| 503 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_manager_v2, |
| 504 | ZWP_TABLET_MANAGER_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_manager_v2), WL_MARSHAL_FLAG_DESTROY); |
| 505 | } |
| 506 | |
| 507 | /** |
| 508 | * @ingroup iface_zwp_tablet_seat_v2 |
| 509 | * @struct zwp_tablet_seat_v2_listener |
| 510 | */ |
| 511 | struct zwp_tablet_seat_v2_listener { |
| 512 | /** |
| 513 | * new device notification |
| 514 | * |
| 515 | * This event is sent whenever a new tablet becomes available on |
| 516 | * this seat. This event only provides the object id of the tablet, |
| 517 | * any static information about the tablet (device name, vid/pid, |
| 518 | * etc.) is sent through the wp_tablet interface. |
| 519 | * @param id the newly added graphics tablet |
| 520 | */ |
| 521 | void (*tablet_added)(void *data, |
| 522 | struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2, |
| 523 | struct zwp_tablet_v2 *id); |
| 524 | /** |
| 525 | * a new tool has been used with a tablet |
| 526 | * |
| 527 | * This event is sent whenever a tool that has not previously |
| 528 | * been used with a tablet comes into use. This event only provides |
| 529 | * the object id of the tool; any static information about the tool |
| 530 | * (capabilities, type, etc.) is sent through the wp_tablet_tool |
| 531 | * interface. |
| 532 | * @param id the newly added tablet tool |
| 533 | */ |
| 534 | void (*tool_added)(void *data, |
| 535 | struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2, |
| 536 | struct zwp_tablet_tool_v2 *id); |
| 537 | /** |
| 538 | * new pad notification |
| 539 | * |
| 540 | * This event is sent whenever a new pad is known to the system. |
| 541 | * Typically, pads are physically attached to tablets and a |
| 542 | * pad_added event is sent immediately after the |
| 543 | * wp_tablet_seat.tablet_added. However, some standalone pad |
| 544 | * devices logically attach to tablets at runtime, and the client |
| 545 | * must wait for wp_tablet_pad.enter to know the tablet a pad is |
| 546 | * attached to. |
| 547 | * |
| 548 | * This event only provides the object id of the pad. All further |
| 549 | * features (buttons, strips, rings) are sent through the |
| 550 | * wp_tablet_pad interface. |
| 551 | * @param id the newly added pad |
| 552 | */ |
| 553 | void (*pad_added)(void *data, |
| 554 | struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2, |
| 555 | struct zwp_tablet_pad_v2 *id); |
| 556 | }; |
| 557 | |
| 558 | /** |
| 559 | * @ingroup iface_zwp_tablet_seat_v2 |
| 560 | */ |
| 561 | static inline int |
| 562 | zwp_tablet_seat_v2_add_listener(struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2, |
| 563 | const struct zwp_tablet_seat_v2_listener *listener, void *data) |
| 564 | { |
| 565 | return wl_proxy_add_listener((struct wl_proxy *) zwp_tablet_seat_v2, |
| 566 | (void (**)(void)) listener, data); |
| 567 | } |
| 568 | |
| 569 | #define ZWP_TABLET_SEAT_V2_DESTROY 0 |
| 570 | |
| 571 | /** |
| 572 | * @ingroup iface_zwp_tablet_seat_v2 |
| 573 | */ |
| 574 | #define ZWP_TABLET_SEAT_V2_TABLET_ADDED_SINCE_VERSION 1 |
| 575 | /** |
| 576 | * @ingroup iface_zwp_tablet_seat_v2 |
| 577 | */ |
| 578 | #define ZWP_TABLET_SEAT_V2_TOOL_ADDED_SINCE_VERSION 1 |
| 579 | /** |
| 580 | * @ingroup iface_zwp_tablet_seat_v2 |
| 581 | */ |
| 582 | #define ZWP_TABLET_SEAT_V2_PAD_ADDED_SINCE_VERSION 1 |
| 583 | |
| 584 | /** |
| 585 | * @ingroup iface_zwp_tablet_seat_v2 |
| 586 | */ |
| 587 | #define ZWP_TABLET_SEAT_V2_DESTROY_SINCE_VERSION 1 |
| 588 | |
| 589 | /** @ingroup iface_zwp_tablet_seat_v2 */ |
| 590 | static inline void |
| 591 | zwp_tablet_seat_v2_set_user_data(struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2, void *user_data) |
| 592 | { |
| 593 | wl_proxy_set_user_data((struct wl_proxy *) zwp_tablet_seat_v2, user_data); |
| 594 | } |
| 595 | |
| 596 | /** @ingroup iface_zwp_tablet_seat_v2 */ |
| 597 | static inline void * |
| 598 | zwp_tablet_seat_v2_get_user_data(struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2) |
| 599 | { |
| 600 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_tablet_seat_v2); |
| 601 | } |
| 602 | |
| 603 | static inline uint32_t |
| 604 | zwp_tablet_seat_v2_get_version(struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2) |
| 605 | { |
| 606 | return wl_proxy_get_version((struct wl_proxy *) zwp_tablet_seat_v2); |
| 607 | } |
| 608 | |
| 609 | /** |
| 610 | * @ingroup iface_zwp_tablet_seat_v2 |
| 611 | * |
| 612 | * Destroy the wp_tablet_seat object. Objects created from this |
| 613 | * object are unaffected and should be destroyed separately. |
| 614 | */ |
| 615 | static inline void |
| 616 | zwp_tablet_seat_v2_destroy(struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2) |
| 617 | { |
| 618 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_seat_v2, |
| 619 | ZWP_TABLET_SEAT_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_seat_v2), WL_MARSHAL_FLAG_DESTROY); |
| 620 | } |
| 621 | |
| 622 | #ifndef ZWP_TABLET_TOOL_V2_TYPE_ENUM |
| 623 | #define ZWP_TABLET_TOOL_V2_TYPE_ENUM |
| 624 | /** |
| 625 | * @ingroup iface_zwp_tablet_tool_v2 |
| 626 | * a physical tool type |
| 627 | * |
| 628 | * Describes the physical type of a tool. The physical type of a tool |
| 629 | * generally defines its base usage. |
| 630 | * |
| 631 | * The mouse tool represents a mouse-shaped tool that is not a relative |
| 632 | * device but bound to the tablet's surface, providing absolute |
| 633 | * coordinates. |
| 634 | * |
| 635 | * The lens tool is a mouse-shaped tool with an attached lens to |
| 636 | * provide precision focus. |
| 637 | */ |
| 638 | enum zwp_tablet_tool_v2_type { |
| 639 | /** |
| 640 | * Pen |
| 641 | */ |
| 642 | ZWP_TABLET_TOOL_V2_TYPE_PEN = 0x140, |
| 643 | /** |
| 644 | * Eraser |
| 645 | */ |
| 646 | ZWP_TABLET_TOOL_V2_TYPE_ERASER = 0x141, |
| 647 | /** |
| 648 | * Brush |
| 649 | */ |
| 650 | ZWP_TABLET_TOOL_V2_TYPE_BRUSH = 0x142, |
| 651 | /** |
| 652 | * Pencil |
| 653 | */ |
| 654 | ZWP_TABLET_TOOL_V2_TYPE_PENCIL = 0x143, |
| 655 | /** |
| 656 | * Airbrush |
| 657 | */ |
| 658 | ZWP_TABLET_TOOL_V2_TYPE_AIRBRUSH = 0x144, |
| 659 | /** |
| 660 | * Finger |
| 661 | */ |
| 662 | ZWP_TABLET_TOOL_V2_TYPE_FINGER = 0x145, |
| 663 | /** |
| 664 | * Mouse |
| 665 | */ |
| 666 | ZWP_TABLET_TOOL_V2_TYPE_MOUSE = 0x146, |
| 667 | /** |
| 668 | * Lens |
| 669 | */ |
| 670 | ZWP_TABLET_TOOL_V2_TYPE_LENS = 0x147, |
| 671 | }; |
| 672 | #endif /* ZWP_TABLET_TOOL_V2_TYPE_ENUM */ |
| 673 | |
| 674 | #ifndef ZWP_TABLET_TOOL_V2_CAPABILITY_ENUM |
| 675 | #define ZWP_TABLET_TOOL_V2_CAPABILITY_ENUM |
| 676 | /** |
| 677 | * @ingroup iface_zwp_tablet_tool_v2 |
| 678 | * capability flags for a tool |
| 679 | * |
| 680 | * Describes extra capabilities on a tablet. |
| 681 | * |
| 682 | * Any tool must provide x and y values, extra axes are |
| 683 | * device-specific. |
| 684 | */ |
| 685 | enum zwp_tablet_tool_v2_capability { |
| 686 | /** |
| 687 | * Tilt axes |
| 688 | */ |
| 689 | ZWP_TABLET_TOOL_V2_CAPABILITY_TILT = 1, |
| 690 | /** |
| 691 | * Pressure axis |
| 692 | */ |
| 693 | ZWP_TABLET_TOOL_V2_CAPABILITY_PRESSURE = 2, |
| 694 | /** |
| 695 | * Distance axis |
| 696 | */ |
| 697 | ZWP_TABLET_TOOL_V2_CAPABILITY_DISTANCE = 3, |
| 698 | /** |
| 699 | * Z-rotation axis |
| 700 | */ |
| 701 | ZWP_TABLET_TOOL_V2_CAPABILITY_ROTATION = 4, |
| 702 | /** |
| 703 | * Slider axis |
| 704 | */ |
| 705 | ZWP_TABLET_TOOL_V2_CAPABILITY_SLIDER = 5, |
| 706 | /** |
| 707 | * Wheel axis |
| 708 | */ |
| 709 | ZWP_TABLET_TOOL_V2_CAPABILITY_WHEEL = 6, |
| 710 | }; |
| 711 | #endif /* ZWP_TABLET_TOOL_V2_CAPABILITY_ENUM */ |
| 712 | |
| 713 | #ifndef ZWP_TABLET_TOOL_V2_BUTTON_STATE_ENUM |
| 714 | #define ZWP_TABLET_TOOL_V2_BUTTON_STATE_ENUM |
| 715 | /** |
| 716 | * @ingroup iface_zwp_tablet_tool_v2 |
| 717 | * physical button state |
| 718 | * |
| 719 | * Describes the physical state of a button that produced the button event. |
| 720 | */ |
| 721 | enum zwp_tablet_tool_v2_button_state { |
| 722 | /** |
| 723 | * button is not pressed |
| 724 | */ |
| 725 | ZWP_TABLET_TOOL_V2_BUTTON_STATE_RELEASED = 0, |
| 726 | /** |
| 727 | * button is pressed |
| 728 | */ |
| 729 | ZWP_TABLET_TOOL_V2_BUTTON_STATE_PRESSED = 1, |
| 730 | }; |
| 731 | #endif /* ZWP_TABLET_TOOL_V2_BUTTON_STATE_ENUM */ |
| 732 | |
| 733 | #ifndef ZWP_TABLET_TOOL_V2_ERROR_ENUM |
| 734 | #define ZWP_TABLET_TOOL_V2_ERROR_ENUM |
| 735 | enum zwp_tablet_tool_v2_error { |
| 736 | /** |
| 737 | * given wl_surface has another role |
| 738 | */ |
| 739 | ZWP_TABLET_TOOL_V2_ERROR_ROLE = 0, |
| 740 | }; |
| 741 | #endif /* ZWP_TABLET_TOOL_V2_ERROR_ENUM */ |
| 742 | |
| 743 | /** |
| 744 | * @ingroup iface_zwp_tablet_tool_v2 |
| 745 | * @struct zwp_tablet_tool_v2_listener |
| 746 | */ |
| 747 | struct zwp_tablet_tool_v2_listener { |
| 748 | /** |
| 749 | * tool type |
| 750 | * |
| 751 | * The tool type is the high-level type of the tool and usually |
| 752 | * decides the interaction expected from this tool. |
| 753 | * |
| 754 | * This event is sent in the initial burst of events before the |
| 755 | * wp_tablet_tool.done event. |
| 756 | * @param tool_type the physical tool type |
| 757 | */ |
| 758 | void (*type)(void *data, |
| 759 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 760 | uint32_t tool_type); |
| 761 | /** |
| 762 | * unique hardware serial number of the tool |
| 763 | * |
| 764 | * If the physical tool can be identified by a unique 64-bit |
| 765 | * serial number, this event notifies the client of this serial |
| 766 | * number. |
| 767 | * |
| 768 | * If multiple tablets are available in the same seat and the tool |
| 769 | * is uniquely identifiable by the serial number, that tool may |
| 770 | * move between tablets. |
| 771 | * |
| 772 | * Otherwise, if the tool has no serial number and this event is |
| 773 | * missing, the tool is tied to the tablet it first comes into |
| 774 | * proximity with. Even if the physical tool is used on multiple |
| 775 | * tablets, separate wp_tablet_tool objects will be created, one |
| 776 | * per tablet. |
| 777 | * |
| 778 | * This event is sent in the initial burst of events before the |
| 779 | * wp_tablet_tool.done event. |
| 780 | * @param hardware_serial_hi the unique serial number of the tool, most significant bits |
| 781 | * @param hardware_serial_lo the unique serial number of the tool, least significant bits |
| 782 | */ |
| 783 | void (*hardware_serial)(void *data, |
| 784 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 785 | uint32_t hardware_serial_hi, |
| 786 | uint32_t hardware_serial_lo); |
| 787 | /** |
| 788 | * hardware id notification in Wacom's format |
| 789 | * |
| 790 | * This event notifies the client of a hardware id available on |
| 791 | * this tool. |
| 792 | * |
| 793 | * The hardware id is a device-specific 64-bit id that provides |
| 794 | * extra information about the tool in use, beyond the wl_tool.type |
| 795 | * enumeration. The format of the id is specific to tablets made by |
| 796 | * Wacom Inc. For example, the hardware id of a Wacom Grip Pen (a |
| 797 | * stylus) is 0x802. |
| 798 | * |
| 799 | * This event is sent in the initial burst of events before the |
| 800 | * wp_tablet_tool.done event. |
| 801 | * @param hardware_id_hi the hardware id, most significant bits |
| 802 | * @param hardware_id_lo the hardware id, least significant bits |
| 803 | */ |
| 804 | void (*hardware_id_wacom)(void *data, |
| 805 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 806 | uint32_t hardware_id_hi, |
| 807 | uint32_t hardware_id_lo); |
| 808 | /** |
| 809 | * tool capability notification |
| 810 | * |
| 811 | * This event notifies the client of any capabilities of this |
| 812 | * tool, beyond the main set of x/y axes and tip up/down detection. |
| 813 | * |
| 814 | * One event is sent for each extra capability available on this |
| 815 | * tool. |
| 816 | * |
| 817 | * This event is sent in the initial burst of events before the |
| 818 | * wp_tablet_tool.done event. |
| 819 | * @param capability the capability |
| 820 | */ |
| 821 | void (*capability)(void *data, |
| 822 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 823 | uint32_t capability); |
| 824 | /** |
| 825 | * tool description events sequence complete |
| 826 | * |
| 827 | * This event signals the end of the initial burst of descriptive |
| 828 | * events. A client may consider the static description of the tool |
| 829 | * to be complete and finalize initialization of the tool. |
| 830 | */ |
| 831 | void (*done)(void *data, |
| 832 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2); |
| 833 | /** |
| 834 | * tool removed |
| 835 | * |
| 836 | * This event is sent when the tool is removed from the system |
| 837 | * and will send no further events. Should the physical tool come |
| 838 | * back into proximity later, a new wp_tablet_tool object will be |
| 839 | * created. |
| 840 | * |
| 841 | * It is compositor-dependent when a tool is removed. A compositor |
| 842 | * may remove a tool on proximity out, tablet removal or any other |
| 843 | * reason. A compositor may also keep a tool alive until shutdown. |
| 844 | * |
| 845 | * If the tool is currently in proximity, a proximity_out event |
| 846 | * will be sent before the removed event. See |
| 847 | * wp_tablet_tool.proximity_out for the handling of any buttons |
| 848 | * logically down. |
| 849 | * |
| 850 | * When this event is received, the client must |
| 851 | * wp_tablet_tool.destroy the object. |
| 852 | */ |
| 853 | void (*removed)(void *data, |
| 854 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2); |
| 855 | /** |
| 856 | * proximity in event |
| 857 | * |
| 858 | * Notification that this tool is focused on a certain surface. |
| 859 | * |
| 860 | * This event can be received when the tool has moved from one |
| 861 | * surface to another, or when the tool has come back into |
| 862 | * proximity above the surface. |
| 863 | * |
| 864 | * If any button is logically down when the tool comes into |
| 865 | * proximity, the respective button event is sent after the |
| 866 | * proximity_in event but within the same frame as the proximity_in |
| 867 | * event. |
| 868 | * @param tablet The tablet the tool is in proximity of |
| 869 | * @param surface The current surface the tablet tool is over |
| 870 | */ |
| 871 | void (*proximity_in)(void *data, |
| 872 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 873 | uint32_t serial, |
| 874 | struct zwp_tablet_v2 *tablet, |
| 875 | struct wl_surface *surface); |
| 876 | /** |
| 877 | * proximity out event |
| 878 | * |
| 879 | * Notification that this tool has either left proximity, or is |
| 880 | * no longer focused on a certain surface. |
| 881 | * |
| 882 | * When the tablet tool leaves proximity of the tablet, button |
| 883 | * release events are sent for each button that was held down at |
| 884 | * the time of leaving proximity. These events are sent before the |
| 885 | * proximity_out event but within the same wp_tablet.frame. |
| 886 | * |
| 887 | * If the tool stays within proximity of the tablet, but the focus |
| 888 | * changes from one surface to another, a button release event may |
| 889 | * not be sent until the button is actually released or the tool |
| 890 | * leaves the proximity of the tablet. |
| 891 | */ |
| 892 | void (*proximity_out)(void *data, |
| 893 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2); |
| 894 | /** |
| 895 | * tablet tool is making contact |
| 896 | * |
| 897 | * Sent whenever the tablet tool comes in contact with the |
| 898 | * surface of the tablet. |
| 899 | * |
| 900 | * If the tool is already in contact with the tablet when entering |
| 901 | * the input region, the client owning said region will receive a |
| 902 | * wp_tablet.proximity_in event, followed by a wp_tablet.down event |
| 903 | * and a wp_tablet.frame event. |
| 904 | * |
| 905 | * Note that this event describes logical contact, not physical |
| 906 | * contact. On some devices, a compositor may not consider a tool |
| 907 | * in logical contact until a minimum physical pressure threshold |
| 908 | * is exceeded. |
| 909 | */ |
| 910 | void (*down)(void *data, |
| 911 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 912 | uint32_t serial); |
| 913 | /** |
| 914 | * tablet tool is no longer making contact |
| 915 | * |
| 916 | * Sent whenever the tablet tool stops making contact with the |
| 917 | * surface of the tablet, or when the tablet tool moves out of the |
| 918 | * input region and the compositor grab (if any) is dismissed. |
| 919 | * |
| 920 | * If the tablet tool moves out of the input region while in |
| 921 | * contact with the surface of the tablet and the compositor does |
| 922 | * not have an ongoing grab on the surface, the client owning said |
| 923 | * region will receive a wp_tablet.up event, followed by a |
| 924 | * wp_tablet.proximity_out event and a wp_tablet.frame event. If |
| 925 | * the compositor has an ongoing grab on this device, this event |
| 926 | * sequence is sent whenever the grab is dismissed in the future. |
| 927 | * |
| 928 | * Note that this event describes logical contact, not physical |
| 929 | * contact. On some devices, a compositor may not consider a tool |
| 930 | * out of logical contact until physical pressure falls below a |
| 931 | * specific threshold. |
| 932 | */ |
| 933 | void (*up)(void *data, |
| 934 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2); |
| 935 | /** |
| 936 | * motion event |
| 937 | * |
| 938 | * Sent whenever a tablet tool moves. |
| 939 | * @param x surface-local x coordinate |
| 940 | * @param y surface-local y coordinate |
| 941 | */ |
| 942 | void (*motion)(void *data, |
| 943 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 944 | wl_fixed_t x, |
| 945 | wl_fixed_t y); |
| 946 | /** |
| 947 | * pressure change event |
| 948 | * |
| 949 | * Sent whenever the pressure axis on a tool changes. The value |
| 950 | * of this event is normalized to a value between 0 and 65535. |
| 951 | * |
| 952 | * Note that pressure may be nonzero even when a tool is not in |
| 953 | * logical contact. See the down and up events for more details. |
| 954 | * @param pressure The current pressure value |
| 955 | */ |
| 956 | void (*pressure)(void *data, |
| 957 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 958 | uint32_t pressure); |
| 959 | /** |
| 960 | * distance change event |
| 961 | * |
| 962 | * Sent whenever the distance axis on a tool changes. The value |
| 963 | * of this event is normalized to a value between 0 and 65535. |
| 964 | * |
| 965 | * Note that distance may be nonzero even when a tool is not in |
| 966 | * logical contact. See the down and up events for more details. |
| 967 | * @param distance The current distance value |
| 968 | */ |
| 969 | void (*distance)(void *data, |
| 970 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 971 | uint32_t distance); |
| 972 | /** |
| 973 | * tilt change event |
| 974 | * |
| 975 | * Sent whenever one or both of the tilt axes on a tool change. |
| 976 | * Each tilt value is in degrees, relative to the z-axis of the |
| 977 | * tablet. The angle is positive when the top of a tool tilts along |
| 978 | * the positive x or y axis. |
| 979 | * @param tilt_x The current value of the X tilt axis |
| 980 | * @param tilt_y The current value of the Y tilt axis |
| 981 | */ |
| 982 | void (*tilt)(void *data, |
| 983 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 984 | wl_fixed_t tilt_x, |
| 985 | wl_fixed_t tilt_y); |
| 986 | /** |
| 987 | * z-rotation change event |
| 988 | * |
| 989 | * Sent whenever the z-rotation axis on the tool changes. The |
| 990 | * rotation value is in degrees clockwise from the tool's logical |
| 991 | * neutral position. |
| 992 | * @param degrees The current rotation of the Z axis |
| 993 | */ |
| 994 | void (*rotation)(void *data, |
| 995 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 996 | wl_fixed_t degrees); |
| 997 | /** |
| 998 | * Slider position change event |
| 999 | * |
| 1000 | * Sent whenever the slider position on the tool changes. The |
| 1001 | * value is normalized between -65535 and 65535, with 0 as the |
| 1002 | * logical neutral position of the slider. |
| 1003 | * |
| 1004 | * The slider is available on e.g. the Wacom Airbrush tool. |
| 1005 | * @param position The current position of slider |
| 1006 | */ |
| 1007 | void (*slider)(void *data, |
| 1008 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 1009 | int32_t position); |
| 1010 | /** |
| 1011 | * Wheel delta event |
| 1012 | * |
| 1013 | * Sent whenever the wheel on the tool emits an event. This event |
| 1014 | * contains two values for the same axis change. The degrees value |
| 1015 | * is in the same orientation as the wl_pointer.vertical_scroll |
| 1016 | * axis. The clicks value is in discrete logical clicks of the |
| 1017 | * mouse wheel. This value may be zero if the movement of the wheel |
| 1018 | * was less than one logical click. |
| 1019 | * |
| 1020 | * Clients should choose either value and avoid mixing degrees and |
| 1021 | * clicks. The compositor may accumulate values smaller than a |
| 1022 | * logical click and emulate click events when a certain threshold |
| 1023 | * is met. Thus, wl_tablet_tool.wheel events with non-zero clicks |
| 1024 | * values may have different degrees values. |
| 1025 | * @param degrees The wheel delta in degrees |
| 1026 | * @param clicks The wheel delta in discrete clicks |
| 1027 | */ |
| 1028 | void (*wheel)(void *data, |
| 1029 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 1030 | wl_fixed_t degrees, |
| 1031 | int32_t clicks); |
| 1032 | /** |
| 1033 | * button event |
| 1034 | * |
| 1035 | * Sent whenever a button on the tool is pressed or released. |
| 1036 | * |
| 1037 | * If a button is held down when the tool moves in or out of |
| 1038 | * proximity, button events are generated by the compositor. See |
| 1039 | * wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for |
| 1040 | * details. |
| 1041 | * @param button The button whose state has changed |
| 1042 | * @param state Whether the button was pressed or released |
| 1043 | */ |
| 1044 | void (*button)(void *data, |
| 1045 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 1046 | uint32_t serial, |
| 1047 | uint32_t button, |
| 1048 | uint32_t state); |
| 1049 | /** |
| 1050 | * frame event |
| 1051 | * |
| 1052 | * Marks the end of a series of axis and/or button updates from |
| 1053 | * the tablet. The Wayland protocol requires axis updates to be |
| 1054 | * sent sequentially, however all events within a frame should be |
| 1055 | * considered one hardware event. |
| 1056 | * @param time The time of the event with millisecond granularity |
| 1057 | */ |
| 1058 | void (*frame)(void *data, |
| 1059 | struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 1060 | uint32_t time); |
| 1061 | }; |
| 1062 | |
| 1063 | /** |
| 1064 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1065 | */ |
| 1066 | static inline int |
| 1067 | zwp_tablet_tool_v2_add_listener(struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, |
| 1068 | const struct zwp_tablet_tool_v2_listener *listener, void *data) |
| 1069 | { |
| 1070 | return wl_proxy_add_listener((struct wl_proxy *) zwp_tablet_tool_v2, |
| 1071 | (void (**)(void)) listener, data); |
| 1072 | } |
| 1073 | |
| 1074 | #define ZWP_TABLET_TOOL_V2_SET_CURSOR 0 |
| 1075 | #define ZWP_TABLET_TOOL_V2_DESTROY 1 |
| 1076 | |
| 1077 | /** |
| 1078 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1079 | */ |
| 1080 | #define ZWP_TABLET_TOOL_V2_TYPE_SINCE_VERSION 1 |
| 1081 | /** |
| 1082 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1083 | */ |
| 1084 | #define ZWP_TABLET_TOOL_V2_HARDWARE_SERIAL_SINCE_VERSION 1 |
| 1085 | /** |
| 1086 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1087 | */ |
| 1088 | #define ZWP_TABLET_TOOL_V2_HARDWARE_ID_WACOM_SINCE_VERSION 1 |
| 1089 | /** |
| 1090 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1091 | */ |
| 1092 | #define ZWP_TABLET_TOOL_V2_CAPABILITY_SINCE_VERSION 1 |
| 1093 | /** |
| 1094 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1095 | */ |
| 1096 | #define ZWP_TABLET_TOOL_V2_DONE_SINCE_VERSION 1 |
| 1097 | /** |
| 1098 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1099 | */ |
| 1100 | #define ZWP_TABLET_TOOL_V2_REMOVED_SINCE_VERSION 1 |
| 1101 | /** |
| 1102 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1103 | */ |
| 1104 | #define ZWP_TABLET_TOOL_V2_PROXIMITY_IN_SINCE_VERSION 1 |
| 1105 | /** |
| 1106 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1107 | */ |
| 1108 | #define ZWP_TABLET_TOOL_V2_PROXIMITY_OUT_SINCE_VERSION 1 |
| 1109 | /** |
| 1110 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1111 | */ |
| 1112 | #define ZWP_TABLET_TOOL_V2_DOWN_SINCE_VERSION 1 |
| 1113 | /** |
| 1114 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1115 | */ |
| 1116 | #define ZWP_TABLET_TOOL_V2_UP_SINCE_VERSION 1 |
| 1117 | /** |
| 1118 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1119 | */ |
| 1120 | #define ZWP_TABLET_TOOL_V2_MOTION_SINCE_VERSION 1 |
| 1121 | /** |
| 1122 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1123 | */ |
| 1124 | #define ZWP_TABLET_TOOL_V2_PRESSURE_SINCE_VERSION 1 |
| 1125 | /** |
| 1126 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1127 | */ |
| 1128 | #define ZWP_TABLET_TOOL_V2_DISTANCE_SINCE_VERSION 1 |
| 1129 | /** |
| 1130 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1131 | */ |
| 1132 | #define ZWP_TABLET_TOOL_V2_TILT_SINCE_VERSION 1 |
| 1133 | /** |
| 1134 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1135 | */ |
| 1136 | #define ZWP_TABLET_TOOL_V2_ROTATION_SINCE_VERSION 1 |
| 1137 | /** |
| 1138 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1139 | */ |
| 1140 | #define ZWP_TABLET_TOOL_V2_SLIDER_SINCE_VERSION 1 |
| 1141 | /** |
| 1142 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1143 | */ |
| 1144 | #define ZWP_TABLET_TOOL_V2_WHEEL_SINCE_VERSION 1 |
| 1145 | /** |
| 1146 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1147 | */ |
| 1148 | #define ZWP_TABLET_TOOL_V2_BUTTON_SINCE_VERSION 1 |
| 1149 | /** |
| 1150 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1151 | */ |
| 1152 | #define ZWP_TABLET_TOOL_V2_FRAME_SINCE_VERSION 1 |
| 1153 | |
| 1154 | /** |
| 1155 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1156 | */ |
| 1157 | #define ZWP_TABLET_TOOL_V2_SET_CURSOR_SINCE_VERSION 1 |
| 1158 | /** |
| 1159 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1160 | */ |
| 1161 | #define ZWP_TABLET_TOOL_V2_DESTROY_SINCE_VERSION 1 |
| 1162 | |
| 1163 | /** @ingroup iface_zwp_tablet_tool_v2 */ |
| 1164 | static inline void |
| 1165 | zwp_tablet_tool_v2_set_user_data(struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, void *user_data) |
| 1166 | { |
| 1167 | wl_proxy_set_user_data((struct wl_proxy *) zwp_tablet_tool_v2, user_data); |
| 1168 | } |
| 1169 | |
| 1170 | /** @ingroup iface_zwp_tablet_tool_v2 */ |
| 1171 | static inline void * |
| 1172 | zwp_tablet_tool_v2_get_user_data(struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2) |
| 1173 | { |
| 1174 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_tablet_tool_v2); |
| 1175 | } |
| 1176 | |
| 1177 | static inline uint32_t |
| 1178 | zwp_tablet_tool_v2_get_version(struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2) |
| 1179 | { |
| 1180 | return wl_proxy_get_version((struct wl_proxy *) zwp_tablet_tool_v2); |
| 1181 | } |
| 1182 | |
| 1183 | /** |
| 1184 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1185 | * |
| 1186 | * Sets the surface of the cursor used for this tool on the given |
| 1187 | * tablet. This request only takes effect if the tool is in proximity |
| 1188 | * of one of the requesting client's surfaces or the surface parameter |
| 1189 | * is the current pointer surface. If there was a previous surface set |
| 1190 | * with this request it is replaced. If surface is NULL, the cursor |
| 1191 | * image is hidden. |
| 1192 | * |
| 1193 | * The parameters hotspot_x and hotspot_y define the position of the |
| 1194 | * pointer surface relative to the pointer location. Its top-left corner |
| 1195 | * is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the |
| 1196 | * coordinates of the pointer location, in surface-local coordinates. |
| 1197 | * |
| 1198 | * On surface.attach requests to the pointer surface, hotspot_x and |
| 1199 | * hotspot_y are decremented by the x and y parameters passed to the |
| 1200 | * request. Attach must be confirmed by wl_surface.commit as usual. |
| 1201 | * |
| 1202 | * The hotspot can also be updated by passing the currently set pointer |
| 1203 | * surface to this request with new values for hotspot_x and hotspot_y. |
| 1204 | * |
| 1205 | * The current and pending input regions of the wl_surface are cleared, |
| 1206 | * and wl_surface.set_input_region is ignored until the wl_surface is no |
| 1207 | * longer used as the cursor. When the use as a cursor ends, the current |
| 1208 | * and pending input regions become undefined, and the wl_surface is |
| 1209 | * unmapped. |
| 1210 | * |
| 1211 | * This request gives the surface the role of a wp_tablet_tool cursor. A |
| 1212 | * surface may only ever be used as the cursor surface for one |
| 1213 | * wp_tablet_tool. If the surface already has another role or has |
| 1214 | * previously been used as cursor surface for a different tool, a |
| 1215 | * protocol error is raised. |
| 1216 | */ |
| 1217 | static inline void |
| 1218 | zwp_tablet_tool_v2_set_cursor(struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y) |
| 1219 | { |
| 1220 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_tool_v2, |
| 1221 | ZWP_TABLET_TOOL_V2_SET_CURSOR, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_tool_v2), 0, serial, surface, hotspot_x, hotspot_y); |
| 1222 | } |
| 1223 | |
| 1224 | /** |
| 1225 | * @ingroup iface_zwp_tablet_tool_v2 |
| 1226 | * |
| 1227 | * This destroys the client's resource for this tool object. |
| 1228 | */ |
| 1229 | static inline void |
| 1230 | zwp_tablet_tool_v2_destroy(struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2) |
| 1231 | { |
| 1232 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_tool_v2, |
| 1233 | ZWP_TABLET_TOOL_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_tool_v2), WL_MARSHAL_FLAG_DESTROY); |
| 1234 | } |
| 1235 | |
| 1236 | /** |
| 1237 | * @ingroup iface_zwp_tablet_v2 |
| 1238 | * @struct zwp_tablet_v2_listener |
| 1239 | */ |
| 1240 | struct zwp_tablet_v2_listener { |
| 1241 | /** |
| 1242 | * tablet device name |
| 1243 | * |
| 1244 | * A descriptive name for the tablet device. |
| 1245 | * |
| 1246 | * If the device has no descriptive name, this event is not sent. |
| 1247 | * |
| 1248 | * This event is sent in the initial burst of events before the |
| 1249 | * wp_tablet.done event. |
| 1250 | * @param name the device name |
| 1251 | */ |
| 1252 | void (*name)(void *data, |
| 1253 | struct zwp_tablet_v2 *zwp_tablet_v2, |
| 1254 | const char *name); |
| 1255 | /** |
| 1256 | * tablet device USB vendor/product id |
| 1257 | * |
| 1258 | * The USB vendor and product IDs for the tablet device. |
| 1259 | * |
| 1260 | * If the device has no USB vendor/product ID, this event is not |
| 1261 | * sent. This can happen for virtual devices or non-USB devices, |
| 1262 | * for instance. |
| 1263 | * |
| 1264 | * This event is sent in the initial burst of events before the |
| 1265 | * wp_tablet.done event. |
| 1266 | * @param vid USB vendor id |
| 1267 | * @param pid USB product id |
| 1268 | */ |
| 1269 | void (*id)(void *data, |
| 1270 | struct zwp_tablet_v2 *zwp_tablet_v2, |
| 1271 | uint32_t vid, |
| 1272 | uint32_t pid); |
| 1273 | /** |
| 1274 | * path to the device |
| 1275 | * |
| 1276 | * A system-specific device path that indicates which device is |
| 1277 | * behind this wp_tablet. This information may be used to gather |
| 1278 | * additional information about the device, e.g. through libwacom. |
| 1279 | * |
| 1280 | * A device may have more than one device path. If so, multiple |
| 1281 | * wp_tablet.path events are sent. A device may be emulated and not |
| 1282 | * have a device path, and in that case this event will not be |
| 1283 | * sent. |
| 1284 | * |
| 1285 | * The format of the path is unspecified, it may be a device node, |
| 1286 | * a sysfs path, or some other identifier. It is up to the client |
| 1287 | * to identify the string provided. |
| 1288 | * |
| 1289 | * This event is sent in the initial burst of events before the |
| 1290 | * wp_tablet.done event. |
| 1291 | * @param path path to local device |
| 1292 | */ |
| 1293 | void (*path)(void *data, |
| 1294 | struct zwp_tablet_v2 *zwp_tablet_v2, |
| 1295 | const char *path); |
| 1296 | /** |
| 1297 | * tablet description events sequence complete |
| 1298 | * |
| 1299 | * This event is sent immediately to signal the end of the |
| 1300 | * initial burst of descriptive events. A client may consider the |
| 1301 | * static description of the tablet to be complete and finalize |
| 1302 | * initialization of the tablet. |
| 1303 | */ |
| 1304 | void (*done)(void *data, |
| 1305 | struct zwp_tablet_v2 *zwp_tablet_v2); |
| 1306 | /** |
| 1307 | * tablet removed event |
| 1308 | * |
| 1309 | * Sent when the tablet has been removed from the system. When a |
| 1310 | * tablet is removed, some tools may be removed. |
| 1311 | * |
| 1312 | * When this event is received, the client must wp_tablet.destroy |
| 1313 | * the object. |
| 1314 | */ |
| 1315 | void (*removed)(void *data, |
| 1316 | struct zwp_tablet_v2 *zwp_tablet_v2); |
| 1317 | }; |
| 1318 | |
| 1319 | /** |
| 1320 | * @ingroup iface_zwp_tablet_v2 |
| 1321 | */ |
| 1322 | static inline int |
| 1323 | zwp_tablet_v2_add_listener(struct zwp_tablet_v2 *zwp_tablet_v2, |
| 1324 | const struct zwp_tablet_v2_listener *listener, void *data) |
| 1325 | { |
| 1326 | return wl_proxy_add_listener((struct wl_proxy *) zwp_tablet_v2, |
| 1327 | (void (**)(void)) listener, data); |
| 1328 | } |
| 1329 | |
| 1330 | #define ZWP_TABLET_V2_DESTROY 0 |
| 1331 | |
| 1332 | /** |
| 1333 | * @ingroup iface_zwp_tablet_v2 |
| 1334 | */ |
| 1335 | #define ZWP_TABLET_V2_NAME_SINCE_VERSION 1 |
| 1336 | /** |
| 1337 | * @ingroup iface_zwp_tablet_v2 |
| 1338 | */ |
| 1339 | #define ZWP_TABLET_V2_ID_SINCE_VERSION 1 |
| 1340 | /** |
| 1341 | * @ingroup iface_zwp_tablet_v2 |
| 1342 | */ |
| 1343 | #define ZWP_TABLET_V2_PATH_SINCE_VERSION 1 |
| 1344 | /** |
| 1345 | * @ingroup iface_zwp_tablet_v2 |
| 1346 | */ |
| 1347 | #define ZWP_TABLET_V2_DONE_SINCE_VERSION 1 |
| 1348 | /** |
| 1349 | * @ingroup iface_zwp_tablet_v2 |
| 1350 | */ |
| 1351 | #define ZWP_TABLET_V2_REMOVED_SINCE_VERSION 1 |
| 1352 | |
| 1353 | /** |
| 1354 | * @ingroup iface_zwp_tablet_v2 |
| 1355 | */ |
| 1356 | #define ZWP_TABLET_V2_DESTROY_SINCE_VERSION 1 |
| 1357 | |
| 1358 | /** @ingroup iface_zwp_tablet_v2 */ |
| 1359 | static inline void |
| 1360 | zwp_tablet_v2_set_user_data(struct zwp_tablet_v2 *zwp_tablet_v2, void *user_data) |
| 1361 | { |
| 1362 | wl_proxy_set_user_data((struct wl_proxy *) zwp_tablet_v2, user_data); |
| 1363 | } |
| 1364 | |
| 1365 | /** @ingroup iface_zwp_tablet_v2 */ |
| 1366 | static inline void * |
| 1367 | zwp_tablet_v2_get_user_data(struct zwp_tablet_v2 *zwp_tablet_v2) |
| 1368 | { |
| 1369 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_tablet_v2); |
| 1370 | } |
| 1371 | |
| 1372 | static inline uint32_t |
| 1373 | zwp_tablet_v2_get_version(struct zwp_tablet_v2 *zwp_tablet_v2) |
| 1374 | { |
| 1375 | return wl_proxy_get_version((struct wl_proxy *) zwp_tablet_v2); |
| 1376 | } |
| 1377 | |
| 1378 | /** |
| 1379 | * @ingroup iface_zwp_tablet_v2 |
| 1380 | * |
| 1381 | * This destroys the client's resource for this tablet object. |
| 1382 | */ |
| 1383 | static inline void |
| 1384 | zwp_tablet_v2_destroy(struct zwp_tablet_v2 *zwp_tablet_v2) |
| 1385 | { |
| 1386 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_v2, |
| 1387 | ZWP_TABLET_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_v2), WL_MARSHAL_FLAG_DESTROY); |
| 1388 | } |
| 1389 | |
| 1390 | #ifndef ZWP_TABLET_PAD_RING_V2_SOURCE_ENUM |
| 1391 | #define ZWP_TABLET_PAD_RING_V2_SOURCE_ENUM |
| 1392 | /** |
| 1393 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1394 | * ring axis source |
| 1395 | * |
| 1396 | * Describes the source types for ring events. This indicates to the |
| 1397 | * client how a ring event was physically generated; a client may |
| 1398 | * adjust the user interface accordingly. For example, events |
| 1399 | * from a "finger" source may trigger kinetic scrolling. |
| 1400 | */ |
| 1401 | enum zwp_tablet_pad_ring_v2_source { |
| 1402 | /** |
| 1403 | * finger |
| 1404 | */ |
| 1405 | ZWP_TABLET_PAD_RING_V2_SOURCE_FINGER = 1, |
| 1406 | }; |
| 1407 | #endif /* ZWP_TABLET_PAD_RING_V2_SOURCE_ENUM */ |
| 1408 | |
| 1409 | /** |
| 1410 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1411 | * @struct zwp_tablet_pad_ring_v2_listener |
| 1412 | */ |
| 1413 | struct zwp_tablet_pad_ring_v2_listener { |
| 1414 | /** |
| 1415 | * ring event source |
| 1416 | * |
| 1417 | * Source information for ring events. |
| 1418 | * |
| 1419 | * This event does not occur on its own. It is sent before a |
| 1420 | * wp_tablet_pad_ring.frame event and carries the source |
| 1421 | * information for all events within that frame. |
| 1422 | * |
| 1423 | * The source specifies how this event was generated. If the source |
| 1424 | * is wp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop |
| 1425 | * event will be sent when the user lifts the finger off the |
| 1426 | * device. |
| 1427 | * |
| 1428 | * This event is optional. If the source is unknown for an |
| 1429 | * interaction, no event is sent. |
| 1430 | * @param source the event source |
| 1431 | */ |
| 1432 | void (*source)(void *data, |
| 1433 | struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, |
| 1434 | uint32_t source); |
| 1435 | /** |
| 1436 | * angle changed |
| 1437 | * |
| 1438 | * Sent whenever the angle on a ring changes. |
| 1439 | * |
| 1440 | * The angle is provided in degrees clockwise from the logical |
| 1441 | * north of the ring in the pad's current rotation. |
| 1442 | * @param degrees the current angle in degrees |
| 1443 | */ |
| 1444 | void (*angle)(void *data, |
| 1445 | struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, |
| 1446 | wl_fixed_t degrees); |
| 1447 | /** |
| 1448 | * interaction stopped |
| 1449 | * |
| 1450 | * Stop notification for ring events. |
| 1451 | * |
| 1452 | * For some wp_tablet_pad_ring.source types, a |
| 1453 | * wp_tablet_pad_ring.stop event is sent to notify a client that |
| 1454 | * the interaction with the ring has terminated. This enables the |
| 1455 | * client to implement kinetic scrolling. See the |
| 1456 | * wp_tablet_pad_ring.source documentation for information on when |
| 1457 | * this event may be generated. |
| 1458 | * |
| 1459 | * Any wp_tablet_pad_ring.angle events with the same source after |
| 1460 | * this event should be considered as the start of a new |
| 1461 | * interaction. |
| 1462 | */ |
| 1463 | void (*stop)(void *data, |
| 1464 | struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2); |
| 1465 | /** |
| 1466 | * end of a ring event sequence |
| 1467 | * |
| 1468 | * Indicates the end of a set of ring events that logically |
| 1469 | * belong together. A client is expected to accumulate the data in |
| 1470 | * all events within the frame before proceeding. |
| 1471 | * |
| 1472 | * All wp_tablet_pad_ring events before a wp_tablet_pad_ring.frame |
| 1473 | * event belong logically together. For example, on termination of |
| 1474 | * a finger interaction on a ring the compositor will send a |
| 1475 | * wp_tablet_pad_ring.source event, a wp_tablet_pad_ring.stop event |
| 1476 | * and a wp_tablet_pad_ring.frame event. |
| 1477 | * |
| 1478 | * A wp_tablet_pad_ring.frame event is sent for every logical event |
| 1479 | * group, even if the group only contains a single |
| 1480 | * wp_tablet_pad_ring event. Specifically, a client may get a |
| 1481 | * sequence: angle, frame, angle, frame, etc. |
| 1482 | * @param time timestamp with millisecond granularity |
| 1483 | */ |
| 1484 | void (*frame)(void *data, |
| 1485 | struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, |
| 1486 | uint32_t time); |
| 1487 | }; |
| 1488 | |
| 1489 | /** |
| 1490 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1491 | */ |
| 1492 | static inline int |
| 1493 | zwp_tablet_pad_ring_v2_add_listener(struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, |
| 1494 | const struct zwp_tablet_pad_ring_v2_listener *listener, void *data) |
| 1495 | { |
| 1496 | return wl_proxy_add_listener((struct wl_proxy *) zwp_tablet_pad_ring_v2, |
| 1497 | (void (**)(void)) listener, data); |
| 1498 | } |
| 1499 | |
| 1500 | #define ZWP_TABLET_PAD_RING_V2_SET_FEEDBACK 0 |
| 1501 | #define ZWP_TABLET_PAD_RING_V2_DESTROY 1 |
| 1502 | |
| 1503 | /** |
| 1504 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1505 | */ |
| 1506 | #define ZWP_TABLET_PAD_RING_V2_SOURCE_SINCE_VERSION 1 |
| 1507 | /** |
| 1508 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1509 | */ |
| 1510 | #define ZWP_TABLET_PAD_RING_V2_ANGLE_SINCE_VERSION 1 |
| 1511 | /** |
| 1512 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1513 | */ |
| 1514 | #define ZWP_TABLET_PAD_RING_V2_STOP_SINCE_VERSION 1 |
| 1515 | /** |
| 1516 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1517 | */ |
| 1518 | #define ZWP_TABLET_PAD_RING_V2_FRAME_SINCE_VERSION 1 |
| 1519 | |
| 1520 | /** |
| 1521 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1522 | */ |
| 1523 | #define ZWP_TABLET_PAD_RING_V2_SET_FEEDBACK_SINCE_VERSION 1 |
| 1524 | /** |
| 1525 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1526 | */ |
| 1527 | #define ZWP_TABLET_PAD_RING_V2_DESTROY_SINCE_VERSION 1 |
| 1528 | |
| 1529 | /** @ingroup iface_zwp_tablet_pad_ring_v2 */ |
| 1530 | static inline void |
| 1531 | zwp_tablet_pad_ring_v2_set_user_data(struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, void *user_data) |
| 1532 | { |
| 1533 | wl_proxy_set_user_data((struct wl_proxy *) zwp_tablet_pad_ring_v2, user_data); |
| 1534 | } |
| 1535 | |
| 1536 | /** @ingroup iface_zwp_tablet_pad_ring_v2 */ |
| 1537 | static inline void * |
| 1538 | zwp_tablet_pad_ring_v2_get_user_data(struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2) |
| 1539 | { |
| 1540 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_tablet_pad_ring_v2); |
| 1541 | } |
| 1542 | |
| 1543 | static inline uint32_t |
| 1544 | zwp_tablet_pad_ring_v2_get_version(struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2) |
| 1545 | { |
| 1546 | return wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_ring_v2); |
| 1547 | } |
| 1548 | |
| 1549 | /** |
| 1550 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1551 | * |
| 1552 | * Request that the compositor use the provided feedback string |
| 1553 | * associated with this ring. This request should be issued immediately |
| 1554 | * after a wp_tablet_pad_group.mode_switch event from the corresponding |
| 1555 | * group is received, or whenever the ring is mapped to a different |
| 1556 | * action. See wp_tablet_pad_group.mode_switch for more details. |
| 1557 | * |
| 1558 | * Clients are encouraged to provide context-aware descriptions for |
| 1559 | * the actions associated with the ring; compositors may use this |
| 1560 | * information to offer visual feedback about the button layout |
| 1561 | * (eg. on-screen displays). |
| 1562 | * |
| 1563 | * The provided string 'description' is a UTF-8 encoded string to be |
| 1564 | * associated with this ring, and is considered user-visible; general |
| 1565 | * internationalization rules apply. |
| 1566 | * |
| 1567 | * The serial argument will be that of the last |
| 1568 | * wp_tablet_pad_group.mode_switch event received for the group of this |
| 1569 | * ring. Requests providing other serials than the most recent one will be |
| 1570 | * ignored. |
| 1571 | */ |
| 1572 | static inline void |
| 1573 | zwp_tablet_pad_ring_v2_set_feedback(struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, const char *description, uint32_t serial) |
| 1574 | { |
| 1575 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_pad_ring_v2, |
| 1576 | ZWP_TABLET_PAD_RING_V2_SET_FEEDBACK, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_ring_v2), 0, description, serial); |
| 1577 | } |
| 1578 | |
| 1579 | /** |
| 1580 | * @ingroup iface_zwp_tablet_pad_ring_v2 |
| 1581 | * |
| 1582 | * This destroys the client's resource for this ring object. |
| 1583 | */ |
| 1584 | static inline void |
| 1585 | zwp_tablet_pad_ring_v2_destroy(struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2) |
| 1586 | { |
| 1587 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_pad_ring_v2, |
| 1588 | ZWP_TABLET_PAD_RING_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_ring_v2), WL_MARSHAL_FLAG_DESTROY); |
| 1589 | } |
| 1590 | |
| 1591 | #ifndef ZWP_TABLET_PAD_STRIP_V2_SOURCE_ENUM |
| 1592 | #define ZWP_TABLET_PAD_STRIP_V2_SOURCE_ENUM |
| 1593 | /** |
| 1594 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1595 | * strip axis source |
| 1596 | * |
| 1597 | * Describes the source types for strip events. This indicates to the |
| 1598 | * client how a strip event was physically generated; a client may |
| 1599 | * adjust the user interface accordingly. For example, events |
| 1600 | * from a "finger" source may trigger kinetic scrolling. |
| 1601 | */ |
| 1602 | enum zwp_tablet_pad_strip_v2_source { |
| 1603 | /** |
| 1604 | * finger |
| 1605 | */ |
| 1606 | ZWP_TABLET_PAD_STRIP_V2_SOURCE_FINGER = 1, |
| 1607 | }; |
| 1608 | #endif /* ZWP_TABLET_PAD_STRIP_V2_SOURCE_ENUM */ |
| 1609 | |
| 1610 | /** |
| 1611 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1612 | * @struct zwp_tablet_pad_strip_v2_listener |
| 1613 | */ |
| 1614 | struct zwp_tablet_pad_strip_v2_listener { |
| 1615 | /** |
| 1616 | * strip event source |
| 1617 | * |
| 1618 | * Source information for strip events. |
| 1619 | * |
| 1620 | * This event does not occur on its own. It is sent before a |
| 1621 | * wp_tablet_pad_strip.frame event and carries the source |
| 1622 | * information for all events within that frame. |
| 1623 | * |
| 1624 | * The source specifies how this event was generated. If the source |
| 1625 | * is wp_tablet_pad_strip.source.finger, a wp_tablet_pad_strip.stop |
| 1626 | * event will be sent when the user lifts their finger off the |
| 1627 | * device. |
| 1628 | * |
| 1629 | * This event is optional. If the source is unknown for an |
| 1630 | * interaction, no event is sent. |
| 1631 | * @param source the event source |
| 1632 | */ |
| 1633 | void (*source)(void *data, |
| 1634 | struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, |
| 1635 | uint32_t source); |
| 1636 | /** |
| 1637 | * position changed |
| 1638 | * |
| 1639 | * Sent whenever the position on a strip changes. |
| 1640 | * |
| 1641 | * The position is normalized to a range of [0, 65535], the 0-value |
| 1642 | * represents the top-most and/or left-most position of the strip |
| 1643 | * in the pad's current rotation. |
| 1644 | * @param position the current position |
| 1645 | */ |
| 1646 | void (*position)(void *data, |
| 1647 | struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, |
| 1648 | uint32_t position); |
| 1649 | /** |
| 1650 | * interaction stopped |
| 1651 | * |
| 1652 | * Stop notification for strip events. |
| 1653 | * |
| 1654 | * For some wp_tablet_pad_strip.source types, a |
| 1655 | * wp_tablet_pad_strip.stop event is sent to notify a client that |
| 1656 | * the interaction with the strip has terminated. This enables the |
| 1657 | * client to implement kinetic scrolling. See the |
| 1658 | * wp_tablet_pad_strip.source documentation for information on when |
| 1659 | * this event may be generated. |
| 1660 | * |
| 1661 | * Any wp_tablet_pad_strip.position events with the same source |
| 1662 | * after this event should be considered as the start of a new |
| 1663 | * interaction. |
| 1664 | */ |
| 1665 | void (*stop)(void *data, |
| 1666 | struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2); |
| 1667 | /** |
| 1668 | * end of a strip event sequence |
| 1669 | * |
| 1670 | * Indicates the end of a set of events that represent one |
| 1671 | * logical hardware strip event. A client is expected to accumulate |
| 1672 | * the data in all events within the frame before proceeding. |
| 1673 | * |
| 1674 | * All wp_tablet_pad_strip events before a |
| 1675 | * wp_tablet_pad_strip.frame event belong logically together. For |
| 1676 | * example, on termination of a finger interaction on a strip the |
| 1677 | * compositor will send a wp_tablet_pad_strip.source event, a |
| 1678 | * wp_tablet_pad_strip.stop event and a wp_tablet_pad_strip.frame |
| 1679 | * event. |
| 1680 | * |
| 1681 | * A wp_tablet_pad_strip.frame event is sent for every logical |
| 1682 | * event group, even if the group only contains a single |
| 1683 | * wp_tablet_pad_strip event. Specifically, a client may get a |
| 1684 | * sequence: position, frame, position, frame, etc. |
| 1685 | * @param time timestamp with millisecond granularity |
| 1686 | */ |
| 1687 | void (*frame)(void *data, |
| 1688 | struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, |
| 1689 | uint32_t time); |
| 1690 | }; |
| 1691 | |
| 1692 | /** |
| 1693 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1694 | */ |
| 1695 | static inline int |
| 1696 | zwp_tablet_pad_strip_v2_add_listener(struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, |
| 1697 | const struct zwp_tablet_pad_strip_v2_listener *listener, void *data) |
| 1698 | { |
| 1699 | return wl_proxy_add_listener((struct wl_proxy *) zwp_tablet_pad_strip_v2, |
| 1700 | (void (**)(void)) listener, data); |
| 1701 | } |
| 1702 | |
| 1703 | #define ZWP_TABLET_PAD_STRIP_V2_SET_FEEDBACK 0 |
| 1704 | #define ZWP_TABLET_PAD_STRIP_V2_DESTROY 1 |
| 1705 | |
| 1706 | /** |
| 1707 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1708 | */ |
| 1709 | #define ZWP_TABLET_PAD_STRIP_V2_SOURCE_SINCE_VERSION 1 |
| 1710 | /** |
| 1711 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1712 | */ |
| 1713 | #define ZWP_TABLET_PAD_STRIP_V2_POSITION_SINCE_VERSION 1 |
| 1714 | /** |
| 1715 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1716 | */ |
| 1717 | #define ZWP_TABLET_PAD_STRIP_V2_STOP_SINCE_VERSION 1 |
| 1718 | /** |
| 1719 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1720 | */ |
| 1721 | #define ZWP_TABLET_PAD_STRIP_V2_FRAME_SINCE_VERSION 1 |
| 1722 | |
| 1723 | /** |
| 1724 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1725 | */ |
| 1726 | #define ZWP_TABLET_PAD_STRIP_V2_SET_FEEDBACK_SINCE_VERSION 1 |
| 1727 | /** |
| 1728 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1729 | */ |
| 1730 | #define ZWP_TABLET_PAD_STRIP_V2_DESTROY_SINCE_VERSION 1 |
| 1731 | |
| 1732 | /** @ingroup iface_zwp_tablet_pad_strip_v2 */ |
| 1733 | static inline void |
| 1734 | zwp_tablet_pad_strip_v2_set_user_data(struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, void *user_data) |
| 1735 | { |
| 1736 | wl_proxy_set_user_data((struct wl_proxy *) zwp_tablet_pad_strip_v2, user_data); |
| 1737 | } |
| 1738 | |
| 1739 | /** @ingroup iface_zwp_tablet_pad_strip_v2 */ |
| 1740 | static inline void * |
| 1741 | zwp_tablet_pad_strip_v2_get_user_data(struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2) |
| 1742 | { |
| 1743 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_tablet_pad_strip_v2); |
| 1744 | } |
| 1745 | |
| 1746 | static inline uint32_t |
| 1747 | zwp_tablet_pad_strip_v2_get_version(struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2) |
| 1748 | { |
| 1749 | return wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_strip_v2); |
| 1750 | } |
| 1751 | |
| 1752 | /** |
| 1753 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1754 | * |
| 1755 | * Requests the compositor to use the provided feedback string |
| 1756 | * associated with this strip. This request should be issued immediately |
| 1757 | * after a wp_tablet_pad_group.mode_switch event from the corresponding |
| 1758 | * group is received, or whenever the strip is mapped to a different |
| 1759 | * action. See wp_tablet_pad_group.mode_switch for more details. |
| 1760 | * |
| 1761 | * Clients are encouraged to provide context-aware descriptions for |
| 1762 | * the actions associated with the strip, and compositors may use this |
| 1763 | * information to offer visual feedback about the button layout |
| 1764 | * (eg. on-screen displays). |
| 1765 | * |
| 1766 | * The provided string 'description' is a UTF-8 encoded string to be |
| 1767 | * associated with this ring, and is considered user-visible; general |
| 1768 | * internationalization rules apply. |
| 1769 | * |
| 1770 | * The serial argument will be that of the last |
| 1771 | * wp_tablet_pad_group.mode_switch event received for the group of this |
| 1772 | * strip. Requests providing other serials than the most recent one will be |
| 1773 | * ignored. |
| 1774 | */ |
| 1775 | static inline void |
| 1776 | zwp_tablet_pad_strip_v2_set_feedback(struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, const char *description, uint32_t serial) |
| 1777 | { |
| 1778 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_pad_strip_v2, |
| 1779 | ZWP_TABLET_PAD_STRIP_V2_SET_FEEDBACK, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_strip_v2), 0, description, serial); |
| 1780 | } |
| 1781 | |
| 1782 | /** |
| 1783 | * @ingroup iface_zwp_tablet_pad_strip_v2 |
| 1784 | * |
| 1785 | * This destroys the client's resource for this strip object. |
| 1786 | */ |
| 1787 | static inline void |
| 1788 | zwp_tablet_pad_strip_v2_destroy(struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2) |
| 1789 | { |
| 1790 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_pad_strip_v2, |
| 1791 | ZWP_TABLET_PAD_STRIP_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_strip_v2), WL_MARSHAL_FLAG_DESTROY); |
| 1792 | } |
| 1793 | |
| 1794 | /** |
| 1795 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1796 | * @struct zwp_tablet_pad_group_v2_listener |
| 1797 | */ |
| 1798 | struct zwp_tablet_pad_group_v2_listener { |
| 1799 | /** |
| 1800 | * buttons announced |
| 1801 | * |
| 1802 | * Sent on wp_tablet_pad_group initialization to announce the |
| 1803 | * available buttons in the group. Button indices start at 0, a |
| 1804 | * button may only be in one group at a time. |
| 1805 | * |
| 1806 | * This event is first sent in the initial burst of events before |
| 1807 | * the wp_tablet_pad_group.done event. |
| 1808 | * |
| 1809 | * Some buttons are reserved by the compositor. These buttons may |
| 1810 | * not be assigned to any wp_tablet_pad_group. Compositors may |
| 1811 | * broadcast this event in the case of changes to the mapping of |
| 1812 | * these reserved buttons. If the compositor happens to reserve all |
| 1813 | * buttons in a group, this event will be sent with an empty array. |
| 1814 | * @param buttons buttons in this group |
| 1815 | */ |
| 1816 | void (*buttons)(void *data, |
| 1817 | struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, |
| 1818 | struct wl_array *buttons); |
| 1819 | /** |
| 1820 | * ring announced |
| 1821 | * |
| 1822 | * Sent on wp_tablet_pad_group initialization to announce |
| 1823 | * available rings. One event is sent for each ring available on |
| 1824 | * this pad group. |
| 1825 | * |
| 1826 | * This event is sent in the initial burst of events before the |
| 1827 | * wp_tablet_pad_group.done event. |
| 1828 | */ |
| 1829 | void (*ring)(void *data, |
| 1830 | struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, |
| 1831 | struct zwp_tablet_pad_ring_v2 *ring); |
| 1832 | /** |
| 1833 | * strip announced |
| 1834 | * |
| 1835 | * Sent on wp_tablet_pad initialization to announce available |
| 1836 | * strips. One event is sent for each strip available on this pad |
| 1837 | * group. |
| 1838 | * |
| 1839 | * This event is sent in the initial burst of events before the |
| 1840 | * wp_tablet_pad_group.done event. |
| 1841 | */ |
| 1842 | void (*strip)(void *data, |
| 1843 | struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, |
| 1844 | struct zwp_tablet_pad_strip_v2 *strip); |
| 1845 | /** |
| 1846 | * mode-switch ability announced |
| 1847 | * |
| 1848 | * Sent on wp_tablet_pad_group initialization to announce that |
| 1849 | * the pad group may switch between modes. A client may use a mode |
| 1850 | * to store a specific configuration for buttons, rings and strips |
| 1851 | * and use the wl_tablet_pad_group.mode_switch event to toggle |
| 1852 | * between these configurations. Mode indices start at 0. |
| 1853 | * |
| 1854 | * Switching modes is compositor-dependent. See the |
| 1855 | * wp_tablet_pad_group.mode_switch event for more details. |
| 1856 | * |
| 1857 | * This event is sent in the initial burst of events before the |
| 1858 | * wp_tablet_pad_group.done event. This event is only sent when |
| 1859 | * more than more than one mode is available. |
| 1860 | * @param modes the number of modes |
| 1861 | */ |
| 1862 | void (*modes)(void *data, |
| 1863 | struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, |
| 1864 | uint32_t modes); |
| 1865 | /** |
| 1866 | * tablet group description events sequence complete |
| 1867 | * |
| 1868 | * This event is sent immediately to signal the end of the |
| 1869 | * initial burst of descriptive events. A client may consider the |
| 1870 | * static description of the tablet to be complete and finalize |
| 1871 | * initialization of the tablet group. |
| 1872 | */ |
| 1873 | void (*done)(void *data, |
| 1874 | struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2); |
| 1875 | /** |
| 1876 | * mode switch event |
| 1877 | * |
| 1878 | * Notification that the mode was switched. |
| 1879 | * |
| 1880 | * A mode applies to all buttons, rings and strips in a group |
| 1881 | * simultaneously, but a client is not required to assign different |
| 1882 | * actions for each mode. For example, a client may have |
| 1883 | * mode-specific button mappings but map the ring to vertical |
| 1884 | * scrolling in all modes. Mode indices start at 0. |
| 1885 | * |
| 1886 | * Switching modes is compositor-dependent. The compositor may |
| 1887 | * provide visual cues to the client about the mode, e.g. by |
| 1888 | * toggling LEDs on the tablet device. Mode-switching may be |
| 1889 | * software-controlled or controlled by one or more physical |
| 1890 | * buttons. For example, on a Wacom Intuos Pro, the button inside |
| 1891 | * the ring may be assigned to switch between modes. |
| 1892 | * |
| 1893 | * The compositor will also send this event after |
| 1894 | * wp_tablet_pad.enter on each group in order to notify of the |
| 1895 | * current mode. Groups that only feature one mode will use mode=0 |
| 1896 | * when emitting this event. |
| 1897 | * |
| 1898 | * If a button action in the new mode differs from the action in |
| 1899 | * the previous mode, the client should immediately issue a |
| 1900 | * wp_tablet_pad.set_feedback request for each changed button. |
| 1901 | * |
| 1902 | * If a ring or strip action in the new mode differs from the |
| 1903 | * action in the previous mode, the client should immediately issue |
| 1904 | * a wp_tablet_ring.set_feedback or wp_tablet_strip.set_feedback |
| 1905 | * request for each changed ring or strip. |
| 1906 | * @param time the time of the event with millisecond granularity |
| 1907 | * @param mode the new mode of the pad |
| 1908 | */ |
| 1909 | void (*mode_switch)(void *data, |
| 1910 | struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, |
| 1911 | uint32_t time, |
| 1912 | uint32_t serial, |
| 1913 | uint32_t mode); |
| 1914 | }; |
| 1915 | |
| 1916 | /** |
| 1917 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1918 | */ |
| 1919 | static inline int |
| 1920 | zwp_tablet_pad_group_v2_add_listener(struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, |
| 1921 | const struct zwp_tablet_pad_group_v2_listener *listener, void *data) |
| 1922 | { |
| 1923 | return wl_proxy_add_listener((struct wl_proxy *) zwp_tablet_pad_group_v2, |
| 1924 | (void (**)(void)) listener, data); |
| 1925 | } |
| 1926 | |
| 1927 | #define ZWP_TABLET_PAD_GROUP_V2_DESTROY 0 |
| 1928 | |
| 1929 | /** |
| 1930 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1931 | */ |
| 1932 | #define ZWP_TABLET_PAD_GROUP_V2_BUTTONS_SINCE_VERSION 1 |
| 1933 | /** |
| 1934 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1935 | */ |
| 1936 | #define ZWP_TABLET_PAD_GROUP_V2_RING_SINCE_VERSION 1 |
| 1937 | /** |
| 1938 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1939 | */ |
| 1940 | #define ZWP_TABLET_PAD_GROUP_V2_STRIP_SINCE_VERSION 1 |
| 1941 | /** |
| 1942 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1943 | */ |
| 1944 | #define ZWP_TABLET_PAD_GROUP_V2_MODES_SINCE_VERSION 1 |
| 1945 | /** |
| 1946 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1947 | */ |
| 1948 | #define ZWP_TABLET_PAD_GROUP_V2_DONE_SINCE_VERSION 1 |
| 1949 | /** |
| 1950 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1951 | */ |
| 1952 | #define ZWP_TABLET_PAD_GROUP_V2_MODE_SWITCH_SINCE_VERSION 1 |
| 1953 | |
| 1954 | /** |
| 1955 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1956 | */ |
| 1957 | #define ZWP_TABLET_PAD_GROUP_V2_DESTROY_SINCE_VERSION 1 |
| 1958 | |
| 1959 | /** @ingroup iface_zwp_tablet_pad_group_v2 */ |
| 1960 | static inline void |
| 1961 | zwp_tablet_pad_group_v2_set_user_data(struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, void *user_data) |
| 1962 | { |
| 1963 | wl_proxy_set_user_data((struct wl_proxy *) zwp_tablet_pad_group_v2, user_data); |
| 1964 | } |
| 1965 | |
| 1966 | /** @ingroup iface_zwp_tablet_pad_group_v2 */ |
| 1967 | static inline void * |
| 1968 | zwp_tablet_pad_group_v2_get_user_data(struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2) |
| 1969 | { |
| 1970 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_tablet_pad_group_v2); |
| 1971 | } |
| 1972 | |
| 1973 | static inline uint32_t |
| 1974 | zwp_tablet_pad_group_v2_get_version(struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2) |
| 1975 | { |
| 1976 | return wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_group_v2); |
| 1977 | } |
| 1978 | |
| 1979 | /** |
| 1980 | * @ingroup iface_zwp_tablet_pad_group_v2 |
| 1981 | * |
| 1982 | * Destroy the wp_tablet_pad_group object. Objects created from this object |
| 1983 | * are unaffected and should be destroyed separately. |
| 1984 | */ |
| 1985 | static inline void |
| 1986 | zwp_tablet_pad_group_v2_destroy(struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2) |
| 1987 | { |
| 1988 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_pad_group_v2, |
| 1989 | ZWP_TABLET_PAD_GROUP_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_group_v2), WL_MARSHAL_FLAG_DESTROY); |
| 1990 | } |
| 1991 | |
| 1992 | #ifndef ZWP_TABLET_PAD_V2_BUTTON_STATE_ENUM |
| 1993 | #define ZWP_TABLET_PAD_V2_BUTTON_STATE_ENUM |
| 1994 | /** |
| 1995 | * @ingroup iface_zwp_tablet_pad_v2 |
| 1996 | * physical button state |
| 1997 | * |
| 1998 | * Describes the physical state of a button that caused the button |
| 1999 | * event. |
| 2000 | */ |
| 2001 | enum zwp_tablet_pad_v2_button_state { |
| 2002 | /** |
| 2003 | * the button is not pressed |
| 2004 | */ |
| 2005 | ZWP_TABLET_PAD_V2_BUTTON_STATE_RELEASED = 0, |
| 2006 | /** |
| 2007 | * the button is pressed |
| 2008 | */ |
| 2009 | ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED = 1, |
| 2010 | }; |
| 2011 | #endif /* ZWP_TABLET_PAD_V2_BUTTON_STATE_ENUM */ |
| 2012 | |
| 2013 | /** |
| 2014 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2015 | * @struct zwp_tablet_pad_v2_listener |
| 2016 | */ |
| 2017 | struct zwp_tablet_pad_v2_listener { |
| 2018 | /** |
| 2019 | * group announced |
| 2020 | * |
| 2021 | * Sent on wp_tablet_pad initialization to announce available |
| 2022 | * groups. One event is sent for each pad group available. |
| 2023 | * |
| 2024 | * This event is sent in the initial burst of events before the |
| 2025 | * wp_tablet_pad.done event. At least one group will be announced. |
| 2026 | */ |
| 2027 | void (*group)(void *data, |
| 2028 | struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, |
| 2029 | struct zwp_tablet_pad_group_v2 *pad_group); |
| 2030 | /** |
| 2031 | * path to the device |
| 2032 | * |
| 2033 | * A system-specific device path that indicates which device is |
| 2034 | * behind this wp_tablet_pad. This information may be used to |
| 2035 | * gather additional information about the device, e.g. through |
| 2036 | * libwacom. |
| 2037 | * |
| 2038 | * The format of the path is unspecified, it may be a device node, |
| 2039 | * a sysfs path, or some other identifier. It is up to the client |
| 2040 | * to identify the string provided. |
| 2041 | * |
| 2042 | * This event is sent in the initial burst of events before the |
| 2043 | * wp_tablet_pad.done event. |
| 2044 | * @param path path to local device |
| 2045 | */ |
| 2046 | void (*path)(void *data, |
| 2047 | struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, |
| 2048 | const char *path); |
| 2049 | /** |
| 2050 | * buttons announced |
| 2051 | * |
| 2052 | * Sent on wp_tablet_pad initialization to announce the available |
| 2053 | * buttons. |
| 2054 | * |
| 2055 | * This event is sent in the initial burst of events before the |
| 2056 | * wp_tablet_pad.done event. This event is only sent when at least |
| 2057 | * one button is available. |
| 2058 | * @param buttons the number of buttons |
| 2059 | */ |
| 2060 | void (*buttons)(void *data, |
| 2061 | struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, |
| 2062 | uint32_t buttons); |
| 2063 | /** |
| 2064 | * pad description event sequence complete |
| 2065 | * |
| 2066 | * This event signals the end of the initial burst of descriptive |
| 2067 | * events. A client may consider the static description of the pad |
| 2068 | * to be complete and finalize initialization of the pad. |
| 2069 | */ |
| 2070 | void (*done)(void *data, |
| 2071 | struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2); |
| 2072 | /** |
| 2073 | * physical button state |
| 2074 | * |
| 2075 | * Sent whenever the physical state of a button changes. |
| 2076 | * @param time the time of the event with millisecond granularity |
| 2077 | * @param button the index of the button that changed state |
| 2078 | */ |
| 2079 | void (*button)(void *data, |
| 2080 | struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, |
| 2081 | uint32_t time, |
| 2082 | uint32_t button, |
| 2083 | uint32_t state); |
| 2084 | /** |
| 2085 | * enter event |
| 2086 | * |
| 2087 | * Notification that this pad is focused on the specified |
| 2088 | * surface. |
| 2089 | * @param serial serial number of the enter event |
| 2090 | * @param tablet the tablet the pad is attached to |
| 2091 | * @param surface surface the pad is focused on |
| 2092 | */ |
| 2093 | void (*enter)(void *data, |
| 2094 | struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, |
| 2095 | uint32_t serial, |
| 2096 | struct zwp_tablet_v2 *tablet, |
| 2097 | struct wl_surface *surface); |
| 2098 | /** |
| 2099 | * leave event |
| 2100 | * |
| 2101 | * Notification that this pad is no longer focused on the |
| 2102 | * specified surface. |
| 2103 | * @param serial serial number of the leave event |
| 2104 | * @param surface surface the pad is no longer focused on |
| 2105 | */ |
| 2106 | void (*leave)(void *data, |
| 2107 | struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, |
| 2108 | uint32_t serial, |
| 2109 | struct wl_surface *surface); |
| 2110 | /** |
| 2111 | * pad removed event |
| 2112 | * |
| 2113 | * Sent when the pad has been removed from the system. When a |
| 2114 | * tablet is removed its pad(s) will be removed too. |
| 2115 | * |
| 2116 | * When this event is received, the client must destroy all rings, |
| 2117 | * strips and groups that were offered by this pad, and issue |
| 2118 | * wp_tablet_pad.destroy the pad itself. |
| 2119 | */ |
| 2120 | void (*removed)(void *data, |
| 2121 | struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2); |
| 2122 | }; |
| 2123 | |
| 2124 | /** |
| 2125 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2126 | */ |
| 2127 | static inline int |
| 2128 | zwp_tablet_pad_v2_add_listener(struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, |
| 2129 | const struct zwp_tablet_pad_v2_listener *listener, void *data) |
| 2130 | { |
| 2131 | return wl_proxy_add_listener((struct wl_proxy *) zwp_tablet_pad_v2, |
| 2132 | (void (**)(void)) listener, data); |
| 2133 | } |
| 2134 | |
| 2135 | #define ZWP_TABLET_PAD_V2_SET_FEEDBACK 0 |
| 2136 | #define ZWP_TABLET_PAD_V2_DESTROY 1 |
| 2137 | |
| 2138 | /** |
| 2139 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2140 | */ |
| 2141 | #define ZWP_TABLET_PAD_V2_GROUP_SINCE_VERSION 1 |
| 2142 | /** |
| 2143 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2144 | */ |
| 2145 | #define ZWP_TABLET_PAD_V2_PATH_SINCE_VERSION 1 |
| 2146 | /** |
| 2147 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2148 | */ |
| 2149 | #define ZWP_TABLET_PAD_V2_BUTTONS_SINCE_VERSION 1 |
| 2150 | /** |
| 2151 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2152 | */ |
| 2153 | #define ZWP_TABLET_PAD_V2_DONE_SINCE_VERSION 1 |
| 2154 | /** |
| 2155 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2156 | */ |
| 2157 | #define ZWP_TABLET_PAD_V2_BUTTON_SINCE_VERSION 1 |
| 2158 | /** |
| 2159 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2160 | */ |
| 2161 | #define ZWP_TABLET_PAD_V2_ENTER_SINCE_VERSION 1 |
| 2162 | /** |
| 2163 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2164 | */ |
| 2165 | #define ZWP_TABLET_PAD_V2_LEAVE_SINCE_VERSION 1 |
| 2166 | /** |
| 2167 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2168 | */ |
| 2169 | #define ZWP_TABLET_PAD_V2_REMOVED_SINCE_VERSION 1 |
| 2170 | |
| 2171 | /** |
| 2172 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2173 | */ |
| 2174 | #define ZWP_TABLET_PAD_V2_SET_FEEDBACK_SINCE_VERSION 1 |
| 2175 | /** |
| 2176 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2177 | */ |
| 2178 | #define ZWP_TABLET_PAD_V2_DESTROY_SINCE_VERSION 1 |
| 2179 | |
| 2180 | /** @ingroup iface_zwp_tablet_pad_v2 */ |
| 2181 | static inline void |
| 2182 | zwp_tablet_pad_v2_set_user_data(struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, void *user_data) |
| 2183 | { |
| 2184 | wl_proxy_set_user_data((struct wl_proxy *) zwp_tablet_pad_v2, user_data); |
| 2185 | } |
| 2186 | |
| 2187 | /** @ingroup iface_zwp_tablet_pad_v2 */ |
| 2188 | static inline void * |
| 2189 | zwp_tablet_pad_v2_get_user_data(struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) |
| 2190 | { |
| 2191 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_tablet_pad_v2); |
| 2192 | } |
| 2193 | |
| 2194 | static inline uint32_t |
| 2195 | zwp_tablet_pad_v2_get_version(struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) |
| 2196 | { |
| 2197 | return wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_v2); |
| 2198 | } |
| 2199 | |
| 2200 | /** |
| 2201 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2202 | * |
| 2203 | * Requests the compositor to use the provided feedback string |
| 2204 | * associated with this button. This request should be issued immediately |
| 2205 | * after a wp_tablet_pad_group.mode_switch event from the corresponding |
| 2206 | * group is received, or whenever a button is mapped to a different |
| 2207 | * action. See wp_tablet_pad_group.mode_switch for more details. |
| 2208 | * |
| 2209 | * Clients are encouraged to provide context-aware descriptions for |
| 2210 | * the actions associated with each button, and compositors may use |
| 2211 | * this information to offer visual feedback on the button layout |
| 2212 | * (e.g. on-screen displays). |
| 2213 | * |
| 2214 | * Button indices start at 0. Setting the feedback string on a button |
| 2215 | * that is reserved by the compositor (i.e. not belonging to any |
| 2216 | * wp_tablet_pad_group) does not generate an error but the compositor |
| 2217 | * is free to ignore the request. |
| 2218 | * |
| 2219 | * The provided string 'description' is a UTF-8 encoded string to be |
| 2220 | * associated with this ring, and is considered user-visible; general |
| 2221 | * internationalization rules apply. |
| 2222 | * |
| 2223 | * The serial argument will be that of the last |
| 2224 | * wp_tablet_pad_group.mode_switch event received for the group of this |
| 2225 | * button. Requests providing other serials than the most recent one will |
| 2226 | * be ignored. |
| 2227 | */ |
| 2228 | static inline void |
| 2229 | zwp_tablet_pad_v2_set_feedback(struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, uint32_t button, const char *description, uint32_t serial) |
| 2230 | { |
| 2231 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_pad_v2, |
| 2232 | ZWP_TABLET_PAD_V2_SET_FEEDBACK, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_v2), 0, button, description, serial); |
| 2233 | } |
| 2234 | |
| 2235 | /** |
| 2236 | * @ingroup iface_zwp_tablet_pad_v2 |
| 2237 | * |
| 2238 | * Destroy the wp_tablet_pad object. Objects created from this object |
| 2239 | * are unaffected and should be destroyed separately. |
| 2240 | */ |
| 2241 | static inline void |
| 2242 | zwp_tablet_pad_v2_destroy(struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) |
| 2243 | { |
| 2244 | wl_proxy_marshal_flags((struct wl_proxy *) zwp_tablet_pad_v2, |
| 2245 | ZWP_TABLET_PAD_V2_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_tablet_pad_v2), WL_MARSHAL_FLAG_DESTROY); |
| 2246 | } |
| 2247 | |
| 2248 | #ifdef __cplusplus |
| 2249 | } |
| 2250 | #endif |
| 2251 | |
| 2252 | #endif |
| 2253 | |