OLD | NEW |
1 /* Generated by wayland-scanner 1.11.0 */ | 1 /* Generated by wayland-scanner 1.11.0 */ |
2 | 2 |
3 #ifndef STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H | 3 #ifndef STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H |
4 #define STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H | 4 #define STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H |
5 | 5 |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include "wayland-client.h" | 8 #include "wayland-client.h" |
9 | 9 |
10 #ifdef __cplusplus | 10 #ifdef __cplusplus |
11 extern "C" { | 11 extern "C" { |
12 #endif | 12 #endif |
13 | 13 |
14 /** | 14 /** |
15 * @page page_stylus_unstable_v1 The stylus_unstable_v1 protocol | 15 * @page page_stylus_unstable_v1 The stylus_unstable_v1 protocol |
16 * @section page_ifaces_stylus_unstable_v1 Interfaces | 16 * @section page_ifaces_stylus_unstable_v1 Interfaces |
17 * - @subpage page_iface_zcr_stylus_v1 - extends wl_pointer with events for on-s
creen stylus | 17 * - @subpage page_iface_zcr_stylus_v1 - extends wl_pointer with events for on-s
creen stylus |
18 * - @subpage page_iface_zcr_pointer_stylus_v1 - stylus extension for pointer | 18 * - @subpage page_iface_zcr_pointer_stylus_v1 - stylus extension for pointer |
19 * - @subpage page_iface_zwp_stylus_v1 - DEPRECATED | |
20 * - @subpage page_iface_zwp_pointer_stylus_v1 - DEPRECATED | |
21 * @section page_copyright_stylus_unstable_v1 Copyright | 19 * @section page_copyright_stylus_unstable_v1 Copyright |
22 * <pre> | 20 * <pre> |
23 * | 21 * |
24 * Copyright 2016 The Chromium Authors. | 22 * Copyright 2016 The Chromium Authors. |
25 * | 23 * |
26 * Permission is hereby granted, free of charge, to any person obtaining a | 24 * Permission is hereby granted, free of charge, to any person obtaining a |
27 * copy of this software and associated documentation files (the "Software"), | 25 * copy of this software and associated documentation files (the "Software"), |
28 * to deal in the Software without restriction, including without limitation | 26 * to deal in the Software without restriction, including without limitation |
29 * the rights to use, copy, modify, merge, publish, distribute, sublicense, | 27 * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
30 * and/or sell copies of the Software, and to permit persons to whom the | 28 * and/or sell copies of the Software, and to permit persons to whom the |
31 * Software is furnished to do so, subject to the following conditions: | 29 * Software is furnished to do so, subject to the following conditions: |
32 * | 30 * |
33 * The above copyright notice and this permission notice (including the next | 31 * The above copyright notice and this permission notice (including the next |
34 * paragraph) shall be included in all copies or substantial portions of the | 32 * paragraph) shall be included in all copies or substantial portions of the |
35 * Software. | 33 * Software. |
36 * | 34 * |
37 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
38 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 36 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
39 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | 37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
40 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 38 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
41 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
42 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
43 * DEALINGS IN THE SOFTWARE. | 41 * DEALINGS IN THE SOFTWARE. |
44 * </pre> | 42 * </pre> |
45 */ | 43 */ |
46 struct wl_pointer; | 44 struct wl_pointer; |
47 struct zcr_pointer_stylus_v1; | 45 struct zcr_pointer_stylus_v1; |
48 struct zcr_stylus_v1; | 46 struct zcr_stylus_v1; |
49 struct zwp_pointer_stylus_v1; | |
50 struct zwp_stylus_v1; | |
51 | 47 |
52 /** | 48 /** |
53 * @page page_iface_zcr_stylus_v1 zcr_stylus_v1 | 49 * @page page_iface_zcr_stylus_v1 zcr_stylus_v1 |
54 * @section page_iface_zcr_stylus_v1_desc Description | 50 * @section page_iface_zcr_stylus_v1_desc Description |
55 * | 51 * |
56 * Allows a wl_pointer to represent an on-screen stylus. The client can | 52 * Allows a wl_pointer to represent an on-screen stylus. The client can |
57 * interpret the on-screen stylus like any other mouse device, and use | 53 * interpret the on-screen stylus like any other mouse device, and use |
58 * this protocol to obtain detail information about the type of stylus, | 54 * this protocol to obtain detail information about the type of stylus, |
59 * as well as the force and tilt of the tool. | 55 * as well as the force and tilt of the tool. |
60 * | 56 * |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 * @section page_iface_zcr_pointer_stylus_v1_api API | 98 * @section page_iface_zcr_pointer_stylus_v1_api API |
103 * See @ref iface_zcr_pointer_stylus_v1. | 99 * See @ref iface_zcr_pointer_stylus_v1. |
104 */ | 100 */ |
105 /** | 101 /** |
106 * @defgroup iface_zcr_pointer_stylus_v1 The zcr_pointer_stylus_v1 interface | 102 * @defgroup iface_zcr_pointer_stylus_v1 The zcr_pointer_stylus_v1 interface |
107 * | 103 * |
108 * The zcr_pointer_stylus_v1 interface extends the wl_pointer interface with | 104 * The zcr_pointer_stylus_v1 interface extends the wl_pointer interface with |
109 * events to describe details about a stylus acting as a pointer. | 105 * events to describe details about a stylus acting as a pointer. |
110 */ | 106 */ |
111 extern const struct wl_interface zcr_pointer_stylus_v1_interface; | 107 extern const struct wl_interface zcr_pointer_stylus_v1_interface; |
112 /** | |
113 * @page page_iface_zwp_stylus_v1 zwp_stylus_v1 | |
114 * @section page_iface_zwp_stylus_v1_desc Description | |
115 * | |
116 * Allows a wl_pointer to represent an on-screen stylus. The client can | |
117 * interpret the on-screen stylus like any other mouse device, and use | |
118 * this protocol to obtain detail information about the type of stylus, | |
119 * as well as the force and tilt of the tool. | |
120 * | |
121 * These events are to be fired by the server within the same frame as other | |
122 * wl_pointer events. | |
123 * | |
124 * Warning! The protocol described in this file is experimental and | |
125 * backward incompatible changes may be made. Backward compatible changes | |
126 * may be added together with the corresponding uinterface version bump. | |
127 * Backward incompatible changes are done by bumping the version number in | |
128 * the protocol and uinterface names and resetting the interface version. | |
129 * Once the protocol is to be declared stable, the 'z' prefix and the | |
130 * version number in the protocol and interface names are removed and the | |
131 * interface version number is reset. | |
132 * @section page_iface_zwp_stylus_v1_api API | |
133 * See @ref iface_zwp_stylus_v1. | |
134 */ | |
135 /** | |
136 * @defgroup iface_zwp_stylus_v1 The zwp_stylus_v1 interface | |
137 * | |
138 * Allows a wl_pointer to represent an on-screen stylus. The client can | |
139 * interpret the on-screen stylus like any other mouse device, and use | |
140 * this protocol to obtain detail information about the type of stylus, | |
141 * as well as the force and tilt of the tool. | |
142 * | |
143 * These events are to be fired by the server within the same frame as other | |
144 * wl_pointer events. | |
145 * | |
146 * Warning! The protocol described in this file is experimental and | |
147 * backward incompatible changes may be made. Backward compatible changes | |
148 * may be added together with the corresponding uinterface version bump. | |
149 * Backward incompatible changes are done by bumping the version number in | |
150 * the protocol and uinterface names and resetting the interface version. | |
151 * Once the protocol is to be declared stable, the 'z' prefix and the | |
152 * version number in the protocol and interface names are removed and the | |
153 * interface version number is reset. | |
154 */ | |
155 extern const struct wl_interface zwp_stylus_v1_interface; | |
156 /** | |
157 * @page page_iface_zwp_pointer_stylus_v1 zwp_pointer_stylus_v1 | |
158 * @section page_iface_zwp_pointer_stylus_v1_desc Description | |
159 * | |
160 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with | |
161 * events to describe details about a stylus acting as a pointer. | |
162 * @section page_iface_zwp_pointer_stylus_v1_api API | |
163 * See @ref iface_zwp_pointer_stylus_v1. | |
164 */ | |
165 /** | |
166 * @defgroup iface_zwp_pointer_stylus_v1 The zwp_pointer_stylus_v1 interface | |
167 * | |
168 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with | |
169 * events to describe details about a stylus acting as a pointer. | |
170 */ | |
171 extern const struct wl_interface zwp_pointer_stylus_v1_interface; | |
172 | 108 |
173 #define ZCR_STYLUS_V1_GET_POINTER_STYLUS 0 | 109 #define ZCR_STYLUS_V1_GET_POINTER_STYLUS 0 |
174 | 110 |
175 /** | 111 /** |
176 * @ingroup iface_zcr_stylus_v1 | 112 * @ingroup iface_zcr_stylus_v1 |
177 */ | 113 */ |
178 #define ZCR_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1 | 114 #define ZCR_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1 |
179 | 115 |
180 /** @ingroup iface_zcr_stylus_v1 */ | 116 /** @ingroup iface_zcr_stylus_v1 */ |
181 static inline void | 117 static inline void |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 */ | 287 */ |
352 static inline void | 288 static inline void |
353 zcr_pointer_stylus_v1_destroy(struct zcr_pointer_stylus_v1 *zcr_pointer_stylus_v
1) | 289 zcr_pointer_stylus_v1_destroy(struct zcr_pointer_stylus_v1 *zcr_pointer_stylus_v
1) |
354 { | 290 { |
355 wl_proxy_marshal((struct wl_proxy *) zcr_pointer_stylus_v1, | 291 wl_proxy_marshal((struct wl_proxy *) zcr_pointer_stylus_v1, |
356 ZCR_POINTER_STYLUS_V1_DESTROY); | 292 ZCR_POINTER_STYLUS_V1_DESTROY); |
357 | 293 |
358 wl_proxy_destroy((struct wl_proxy *) zcr_pointer_stylus_v1); | 294 wl_proxy_destroy((struct wl_proxy *) zcr_pointer_stylus_v1); |
359 } | 295 } |
360 | 296 |
361 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS 0 | |
362 | |
363 /** | |
364 * @ingroup iface_zwp_stylus_v1 | |
365 */ | |
366 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1 | |
367 | |
368 /** @ingroup iface_zwp_stylus_v1 */ | |
369 static inline void | |
370 zwp_stylus_v1_set_user_data(struct zwp_stylus_v1 *zwp_stylus_v1, void *user_data
) | |
371 { | |
372 wl_proxy_set_user_data((struct wl_proxy *) zwp_stylus_v1, user_data); | |
373 } | |
374 | |
375 /** @ingroup iface_zwp_stylus_v1 */ | |
376 static inline void * | |
377 zwp_stylus_v1_get_user_data(struct zwp_stylus_v1 *zwp_stylus_v1) | |
378 { | |
379 return wl_proxy_get_user_data((struct wl_proxy *) zwp_stylus_v1); | |
380 } | |
381 | |
382 static inline uint32_t | |
383 zwp_stylus_v1_get_version(struct zwp_stylus_v1 *zwp_stylus_v1) | |
384 { | |
385 return wl_proxy_get_version((struct wl_proxy *) zwp_stylus_v1); | |
386 } | |
387 | |
388 /** @ingroup iface_zwp_stylus_v1 */ | |
389 static inline void | |
390 zwp_stylus_v1_destroy(struct zwp_stylus_v1 *zwp_stylus_v1) | |
391 { | |
392 wl_proxy_destroy((struct wl_proxy *) zwp_stylus_v1); | |
393 } | |
394 | |
395 /** | |
396 * @ingroup iface_zwp_stylus_v1 | |
397 * | |
398 * Create pointer_stylus object. See zwp_pointer_stylus_v1 interface for | |
399 * details. | |
400 */ | |
401 static inline struct zwp_pointer_stylus_v1 * | |
402 zwp_stylus_v1_get_pointer_stylus(struct zwp_stylus_v1 *zwp_stylus_v1, struct wl_
pointer *pointer) | |
403 { | |
404 struct wl_proxy *id; | |
405 | |
406 id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_stylus_v1, | |
407 ZWP_STYLUS_V1_GET_POINTER_STYLUS, &zwp_pointer_stylus_v
1_interface, NULL, pointer); | |
408 | |
409 return (struct zwp_pointer_stylus_v1 *) id; | |
410 } | |
411 | |
412 #ifndef ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM | |
413 #define ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM | |
414 /** | |
415 * @ingroup iface_zwp_pointer_stylus_v1 | |
416 * tool type of device. | |
417 */ | |
418 enum zwp_pointer_stylus_v1_tool_type { | |
419 /** | |
420 * Mouse or touchpad, not a stylus. | |
421 */ | |
422 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE = 0, | |
423 /** | |
424 * Pen | |
425 */ | |
426 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN = 1, | |
427 /** | |
428 * Touch | |
429 */ | |
430 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH = 2, | |
431 /** | |
432 * Eraser | |
433 */ | |
434 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ERASER = 3, | |
435 }; | |
436 #endif /* ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM */ | |
437 | |
438 /** | |
439 * @ingroup iface_zwp_pointer_stylus_v1 | |
440 * @struct zwp_pointer_stylus_v1_listener | |
441 */ | |
442 struct zwp_pointer_stylus_v1_listener { | |
443 /** | |
444 * pointing device tool type changed | |
445 * | |
446 * Notification that the user is using a new tool type. There can | |
447 * only be one tool in use at a time. If the pointer enters a | |
448 * client surface, with a tool type other than mouse, this event | |
449 * will also be generated. | |
450 * | |
451 * If this event is not received, the client has to assume a mouse | |
452 * is in use. The remaining events of this protocol are only being | |
453 * generated after this event has been fired with a tool type other | |
454 * than mouse. | |
455 * @param type new device type | |
456 */ | |
457 void (*tool_change)(void *data, | |
458 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, | |
459 uint32_t type); | |
460 /** | |
461 * force change event | |
462 * | |
463 * Notification of a change in physical force on the surface of | |
464 * the screen. | |
465 * | |
466 * If the pointer enters a client surface, with a tool type other | |
467 * than mouse, this event will also be generated. | |
468 * | |
469 * The force is calibrated and normalized to the 0 to 1 range. | |
470 * @param time timestamp with millisecond granularity | |
471 * @param force new value of force | |
472 */ | |
473 void (*force)(void *data, | |
474 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, | |
475 uint32_t time, | |
476 wl_fixed_t force); | |
477 /** | |
478 * force change event | |
479 * | |
480 * Notification of a change in tilt of the pointing tool. | |
481 * | |
482 * If the pointer enters a client surface, with a tool type other | |
483 * than mouse, this event will also be generated. | |
484 * | |
485 * Measured from surface normal as plane angle in degrees, values | |
486 * lie in [-90,90]. A positive x is to the right and a positive y | |
487 * is towards the user. | |
488 * @param time timestamp with millisecond granularity | |
489 * @param tilt_x tilt in x direction | |
490 * @param tilt_y tilt in y direction | |
491 */ | |
492 void (*tilt)(void *data, | |
493 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, | |
494 uint32_t time, | |
495 wl_fixed_t tilt_x, | |
496 wl_fixed_t tilt_y); | |
497 }; | |
498 | |
499 /** | |
500 * @ingroup zwp_pointer_stylus_v1_iface | |
501 */ | |
502 static inline int | |
503 zwp_pointer_stylus_v1_add_listener(struct zwp_pointer_stylus_v1 *zwp_pointer_sty
lus_v1, | |
504 const struct zwp_pointer_stylus_v1_listener *
listener, void *data) | |
505 { | |
506 return wl_proxy_add_listener((struct wl_proxy *) zwp_pointer_stylus_v1, | |
507 (void (**)(void)) listener, data); | |
508 } | |
509 | |
510 #define ZWP_POINTER_STYLUS_V1_DESTROY 0 | |
511 | |
512 /** | |
513 * @ingroup iface_zwp_pointer_stylus_v1 | |
514 */ | |
515 #define ZWP_POINTER_STYLUS_V1_DESTROY_SINCE_VERSION 1 | |
516 | |
517 /** @ingroup iface_zwp_pointer_stylus_v1 */ | |
518 static inline void | |
519 zwp_pointer_stylus_v1_set_user_data(struct zwp_pointer_stylus_v1 *zwp_pointer_st
ylus_v1, void *user_data) | |
520 { | |
521 wl_proxy_set_user_data((struct wl_proxy *) zwp_pointer_stylus_v1, user_d
ata); | |
522 } | |
523 | |
524 /** @ingroup iface_zwp_pointer_stylus_v1 */ | |
525 static inline void * | |
526 zwp_pointer_stylus_v1_get_user_data(struct zwp_pointer_stylus_v1 *zwp_pointer_st
ylus_v1) | |
527 { | |
528 return wl_proxy_get_user_data((struct wl_proxy *) zwp_pointer_stylus_v1)
; | |
529 } | |
530 | |
531 static inline uint32_t | |
532 zwp_pointer_stylus_v1_get_version(struct zwp_pointer_stylus_v1 *zwp_pointer_styl
us_v1) | |
533 { | |
534 return wl_proxy_get_version((struct wl_proxy *) zwp_pointer_stylus_v1); | |
535 } | |
536 | |
537 /** | |
538 * @ingroup iface_zwp_pointer_stylus_v1 | |
539 */ | |
540 static inline void | |
541 zwp_pointer_stylus_v1_destroy(struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v
1) | |
542 { | |
543 wl_proxy_marshal((struct wl_proxy *) zwp_pointer_stylus_v1, | |
544 ZWP_POINTER_STYLUS_V1_DESTROY); | |
545 | |
546 wl_proxy_destroy((struct wl_proxy *) zwp_pointer_stylus_v1); | |
547 } | |
548 | |
549 #ifdef __cplusplus | 297 #ifdef __cplusplus |
550 } | 298 } |
551 #endif | 299 #endif |
552 | 300 |
553 #endif | 301 #endif |
OLD | NEW |