OLD | NEW |
1 /* | 1 /* Generated by wayland-scanner 1.11.0 */ |
| 2 |
| 3 #ifndef STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H |
| 4 #define STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H |
| 5 |
| 6 #include <stdint.h> |
| 7 #include <stddef.h> |
| 8 #include "wayland-client.h" |
| 9 |
| 10 #ifdef __cplusplus |
| 11 extern "C" { |
| 12 #endif |
| 13 |
| 14 /** |
| 15 * @page page_stylus_unstable_v1 The stylus_unstable_v1 protocol |
| 16 * @section page_ifaces_stylus_unstable_v1 Interfaces |
| 17 * - @subpage page_iface_zwp_stylus_v1 - extends wl_pointer with events for on-s
creen stylus |
| 18 * - @subpage page_iface_zwp_pointer_stylus_v1 - stylus extension for pointer |
| 19 * @section page_copyright_stylus_unstable_v1 Copyright |
| 20 * <pre> |
| 21 * |
2 * Copyright 2016 The Chromium Authors. | 22 * Copyright 2016 The Chromium Authors. |
3 * | 23 * |
4 * 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 |
5 * copy of this software and associated documentation files (the "Software"), | 25 * copy of this software and associated documentation files (the "Software"), |
6 * to deal in the Software without restriction, including without limitation | 26 * to deal in the Software without restriction, including without limitation |
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, | 27 * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
8 * 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 |
9 * Software is furnished to do so, subject to the following conditions: | 29 * Software is furnished to do so, subject to the following conditions: |
10 * | 30 * |
11 * The above copyright notice and this permission notice (including the next | 31 * The above copyright notice and this permission notice (including the next |
12 * 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 |
13 * Software. | 33 * Software. |
14 * | 34 * |
15 * 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 |
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 36 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | 37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18 * 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 |
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
20 * 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 |
21 * DEALINGS IN THE SOFTWARE. | 41 * DEALINGS IN THE SOFTWARE. |
| 42 * </pre> |
22 */ | 43 */ |
| 44 struct wl_pointer; |
| 45 struct zwp_pointer_stylus_v1; |
| 46 struct zwp_stylus_v1; |
23 | 47 |
24 #ifndef STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H | 48 /** |
25 #define STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H | 49 * @page page_iface_zwp_stylus_v1 zwp_stylus_v1 |
26 | 50 * @section page_iface_zwp_stylus_v1_desc Description |
27 #ifdef __cplusplus | 51 * |
28 extern "C" { | 52 * Allows a wl_pointer to represent an on-screen stylus. The client can |
29 #endif | 53 * interpret the on-screen stylus like any other mouse device, and use |
30 | 54 * this protocol to obtain detail information about the type of stylus, |
31 #include <stdint.h> | 55 * as well as the force and tilt of the tool. |
32 #include <stddef.h> | 56 * |
33 #include "wayland-client.h" | 57 * These events are to be fired by the server within the same frame as other |
34 | 58 * wl_pointer events. |
35 struct wl_client; | 59 * |
36 struct wl_resource; | 60 * Warning! The protocol described in this file is experimental and |
37 | 61 * backward incompatible changes may be made. Backward compatible changes |
38 struct zwp_stylus_v1; | 62 * may be added together with the corresponding uinterface version bump. |
39 struct zwp_pointer_stylus_v1; | 63 * Backward incompatible changes are done by bumping the version number in |
40 | 64 * the protocol and uinterface names and resetting the interface version. |
| 65 * Once the protocol is to be declared stable, the 'z' prefix and the |
| 66 * version number in the protocol and interface names are removed and the |
| 67 * interface version number is reset. |
| 68 * @section page_iface_zwp_stylus_v1_api API |
| 69 * See @ref iface_zwp_stylus_v1. |
| 70 */ |
| 71 /** |
| 72 * @defgroup iface_zwp_stylus_v1 The zwp_stylus_v1 interface |
| 73 * |
| 74 * Allows a wl_pointer to represent an on-screen stylus. The client can |
| 75 * interpret the on-screen stylus like any other mouse device, and use |
| 76 * this protocol to obtain detail information about the type of stylus, |
| 77 * as well as the force and tilt of the tool. |
| 78 * |
| 79 * These events are to be fired by the server within the same frame as other |
| 80 * wl_pointer events. |
| 81 * |
| 82 * Warning! The protocol described in this file is experimental and |
| 83 * backward incompatible changes may be made. Backward compatible changes |
| 84 * may be added together with the corresponding uinterface version bump. |
| 85 * Backward incompatible changes are done by bumping the version number in |
| 86 * the protocol and uinterface names and resetting the interface version. |
| 87 * Once the protocol is to be declared stable, the 'z' prefix and the |
| 88 * version number in the protocol and interface names are removed and the |
| 89 * interface version number is reset. |
| 90 */ |
41 extern const struct wl_interface zwp_stylus_v1_interface; | 91 extern const struct wl_interface zwp_stylus_v1_interface; |
| 92 /** |
| 93 * @page page_iface_zwp_pointer_stylus_v1 zwp_pointer_stylus_v1 |
| 94 * @section page_iface_zwp_pointer_stylus_v1_desc Description |
| 95 * |
| 96 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with |
| 97 * events to describe details about a stylus acting as a pointer. |
| 98 * @section page_iface_zwp_pointer_stylus_v1_api API |
| 99 * See @ref iface_zwp_pointer_stylus_v1. |
| 100 */ |
| 101 /** |
| 102 * @defgroup iface_zwp_pointer_stylus_v1 The zwp_pointer_stylus_v1 interface |
| 103 * |
| 104 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with |
| 105 * events to describe details about a stylus acting as a pointer. |
| 106 */ |
42 extern const struct wl_interface zwp_pointer_stylus_v1_interface; | 107 extern const struct wl_interface zwp_pointer_stylus_v1_interface; |
43 | 108 |
44 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS 0 | 109 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS 0 |
45 | 110 |
| 111 /** |
| 112 * @ingroup iface_zwp_stylus_v1 |
| 113 */ |
| 114 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1 |
| 115 |
| 116 /** @ingroup iface_zwp_stylus_v1 */ |
46 static inline void | 117 static inline void |
47 zwp_stylus_v1_set_user_data(struct zwp_stylus_v1 *zwp_stylus_v1, void *user_data
) | 118 zwp_stylus_v1_set_user_data(struct zwp_stylus_v1 *zwp_stylus_v1, void *user_data
) |
48 { | 119 { |
49 wl_proxy_set_user_data((struct wl_proxy *) zwp_stylus_v1, user_data); | 120 wl_proxy_set_user_data((struct wl_proxy *) zwp_stylus_v1, user_data); |
50 } | 121 } |
51 | 122 |
| 123 /** @ingroup iface_zwp_stylus_v1 */ |
52 static inline void * | 124 static inline void * |
53 zwp_stylus_v1_get_user_data(struct zwp_stylus_v1 *zwp_stylus_v1) | 125 zwp_stylus_v1_get_user_data(struct zwp_stylus_v1 *zwp_stylus_v1) |
54 { | 126 { |
55 return wl_proxy_get_user_data((struct wl_proxy *) zwp_stylus_v1); | 127 return wl_proxy_get_user_data((struct wl_proxy *) zwp_stylus_v1); |
56 } | 128 } |
57 | 129 |
| 130 static inline uint32_t |
| 131 zwp_stylus_v1_get_version(struct zwp_stylus_v1 *zwp_stylus_v1) |
| 132 { |
| 133 return wl_proxy_get_version((struct wl_proxy *) zwp_stylus_v1); |
| 134 } |
| 135 |
| 136 /** @ingroup iface_zwp_stylus_v1 */ |
58 static inline void | 137 static inline void |
59 zwp_stylus_v1_destroy(struct zwp_stylus_v1 *zwp_stylus_v1) | 138 zwp_stylus_v1_destroy(struct zwp_stylus_v1 *zwp_stylus_v1) |
60 { | 139 { |
61 wl_proxy_destroy((struct wl_proxy *) zwp_stylus_v1); | 140 wl_proxy_destroy((struct wl_proxy *) zwp_stylus_v1); |
62 } | 141 } |
63 | 142 |
| 143 /** |
| 144 * @ingroup iface_zwp_stylus_v1 |
| 145 * |
| 146 * Create pointer_stylus object. See zwp_pointer_stylus_v1 interface for |
| 147 * details. |
| 148 */ |
64 static inline struct zwp_pointer_stylus_v1 * | 149 static inline struct zwp_pointer_stylus_v1 * |
65 zwp_stylus_v1_get_pointer_stylus(struct zwp_stylus_v1 *zwp_stylus_v1, struct wl_
pointer *pointer) | 150 zwp_stylus_v1_get_pointer_stylus(struct zwp_stylus_v1 *zwp_stylus_v1, struct wl_
pointer *pointer) |
66 { | 151 { |
67 struct wl_proxy *id; | 152 struct wl_proxy *id; |
68 | 153 |
69 id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_stylus_v1, | 154 id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_stylus_v1, |
70 ZWP_STYLUS_V1_GET_POINTER_STYLUS, &zwp_pointer_stylus_v
1_interface, NULL, pointer); | 155 ZWP_STYLUS_V1_GET_POINTER_STYLUS, &zwp_pointer_stylus_v
1_interface, NULL, pointer); |
71 | 156 |
72 return (struct zwp_pointer_stylus_v1 *) id; | 157 return (struct zwp_pointer_stylus_v1 *) id; |
73 } | 158 } |
74 | 159 |
75 #ifndef ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM | 160 #ifndef ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM |
76 #define ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM | 161 #define ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM |
77 /** | 162 /** |
78 * zwp_pointer_stylus_v1_tool_type - tool type of device. | 163 * @ingroup iface_zwp_pointer_stylus_v1 |
79 * @ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE: Mouse or touchpad, not a | 164 * tool type of device. |
80 *» stylus. | |
81 * @ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN: Pen | |
82 * @ZWP_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH: Touch | |
83 * @ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ERASER: Eraser | |
84 * | |
85 * | |
86 */ | 165 */ |
87 enum zwp_pointer_stylus_v1_tool_type { | 166 enum zwp_pointer_stylus_v1_tool_type { |
| 167 /** |
| 168 * Mouse or touchpad, not a stylus. |
| 169 */ |
88 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE = 0, | 170 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE = 0, |
| 171 /** |
| 172 * Pen |
| 173 */ |
89 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN = 1, | 174 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_PEN = 1, |
| 175 /** |
| 176 * Touch |
| 177 */ |
90 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH = 2, | 178 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH = 2, |
| 179 /** |
| 180 * Eraser |
| 181 */ |
91 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ERASER = 3, | 182 ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ERASER = 3, |
92 }; | 183 }; |
93 #endif /* ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM */ | 184 #endif /* ZWP_POINTER_STYLUS_V1_TOOL_TYPE_ENUM */ |
94 | 185 |
95 /** | 186 /** |
96 * zwp_pointer_stylus_v1 - stylus extension for pointer | 187 * @ingroup iface_zwp_pointer_stylus_v1 |
97 * @tool_change: pointing device tool type changed | 188 * @struct zwp_pointer_stylus_v1_listener |
98 * @force: force change event | |
99 * @tilt: force change event | |
100 * | |
101 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface | |
102 * with events to describe details about a stylus acting as a pointer. | |
103 */ | 189 */ |
104 struct zwp_pointer_stylus_v1_listener { | 190 struct zwp_pointer_stylus_v1_listener { |
105 /** | 191 /** |
106 » * tool_change - pointing device tool type changed | 192 » * pointing device tool type changed |
107 » * @type: new device type | |
108 * | 193 * |
109 * Notification that the user is using a new tool type. There can | 194 * Notification that the user is using a new tool type. There can |
110 * only be one tool in use at a time. If the pointer enters a | 195 * only be one tool in use at a time. If the pointer enters a |
111 * client surface, with a tool type other than mouse, this event | 196 * client surface, with a tool type other than mouse, this event |
112 * will also be generated. | 197 * will also be generated. |
113 * | 198 * |
114 * If this event is not received, the client has to assume a mouse | 199 * If this event is not received, the client has to assume a mouse |
115 * is in use. The remaining events of this protocol are only being | 200 * is in use. The remaining events of this protocol are only being |
116 * generated after this event has been fired with a tool type other | 201 * generated after this event has been fired with a tool type other |
117 * than mouse. | 202 * than mouse. |
| 203 * @param type new device type |
118 */ | 204 */ |
119 void (*tool_change)(void *data, | 205 void (*tool_change)(void *data, |
120 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, | 206 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, |
121 uint32_t type); | 207 uint32_t type); |
122 /** | 208 /** |
123 » * force - force change event | 209 » * force change event |
124 » * @time: timestamp with millisecond granularity | |
125 » * @force: new value of force | |
126 * | 210 * |
127 * Notification of a change in physical force on the surface of | 211 * Notification of a change in physical force on the surface of |
128 * the screen. | 212 * the screen. |
129 * | 213 * |
130 * If the pointer enters a client surface, with a tool type other | 214 * If the pointer enters a client surface, with a tool type other |
131 * than mouse, this event will also be generated. | 215 * than mouse, this event will also be generated. |
132 * | 216 * |
133 * The force is calibrated and normalized to the 0 to 1 range. | 217 * The force is calibrated and normalized to the 0 to 1 range. |
| 218 * @param time timestamp with millisecond granularity |
| 219 * @param force new value of force |
134 */ | 220 */ |
135 void (*force)(void *data, | 221 void (*force)(void *data, |
136 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, | 222 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, |
137 uint32_t time, | 223 uint32_t time, |
138 wl_fixed_t force); | 224 wl_fixed_t force); |
139 /** | 225 /** |
140 » * tilt - force change event | 226 » * force change event |
141 » * @time: timestamp with millisecond granularity | |
142 » * @tilt_x: tilt in x direction | |
143 » * @tilt_y: tilt in y direction | |
144 * | 227 * |
145 * Notification of a change in tilt of the pointing tool. | 228 * Notification of a change in tilt of the pointing tool. |
146 * | 229 * |
147 * If the pointer enters a client surface, with a tool type other | 230 * If the pointer enters a client surface, with a tool type other |
148 * than mouse, this event will also be generated. | 231 * than mouse, this event will also be generated. |
149 * | 232 * |
150 * Measured from surface normal as plane angle in degrees, values | 233 * Measured from surface normal as plane angle in degrees, values |
151 * lie in [-90,90]. A positive x is to the right and a positive y | 234 * lie in [-90,90]. A positive x is to the right and a positive y |
152 * is towards the user. | 235 * is towards the user. |
| 236 * @param time timestamp with millisecond granularity |
| 237 * @param tilt_x tilt in x direction |
| 238 * @param tilt_y tilt in y direction |
153 */ | 239 */ |
154 void (*tilt)(void *data, | 240 void (*tilt)(void *data, |
155 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, | 241 struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v1, |
156 uint32_t time, | 242 uint32_t time, |
157 wl_fixed_t tilt_x, | 243 wl_fixed_t tilt_x, |
158 wl_fixed_t tilt_y); | 244 wl_fixed_t tilt_y); |
159 }; | 245 }; |
160 | 246 |
| 247 /** |
| 248 * @ingroup zwp_pointer_stylus_v1_iface |
| 249 */ |
161 static inline int | 250 static inline int |
162 zwp_pointer_stylus_v1_add_listener(struct zwp_pointer_stylus_v1 *zwp_pointer_sty
lus_v1, | 251 zwp_pointer_stylus_v1_add_listener(struct zwp_pointer_stylus_v1 *zwp_pointer_sty
lus_v1, |
163 const struct zwp_pointer_stylus_v1_listener *
listener, void *data) | 252 const struct zwp_pointer_stylus_v1_listener *
listener, void *data) |
164 { | 253 { |
165 return wl_proxy_add_listener((struct wl_proxy *) zwp_pointer_stylus_v1, | 254 return wl_proxy_add_listener((struct wl_proxy *) zwp_pointer_stylus_v1, |
166 (void (**)(void)) listener, data); | 255 (void (**)(void)) listener, data); |
167 } | 256 } |
168 | 257 |
169 #define ZWP_POINTER_STYLUS_V1_DESTROY 0 | 258 #define ZWP_POINTER_STYLUS_V1_DESTROY 0 |
170 | 259 |
| 260 /** |
| 261 * @ingroup iface_zwp_pointer_stylus_v1 |
| 262 */ |
| 263 #define ZWP_POINTER_STYLUS_V1_DESTROY_SINCE_VERSION 1 |
| 264 |
| 265 /** @ingroup iface_zwp_pointer_stylus_v1 */ |
171 static inline void | 266 static inline void |
172 zwp_pointer_stylus_v1_set_user_data(struct zwp_pointer_stylus_v1 *zwp_pointer_st
ylus_v1, void *user_data) | 267 zwp_pointer_stylus_v1_set_user_data(struct zwp_pointer_stylus_v1 *zwp_pointer_st
ylus_v1, void *user_data) |
173 { | 268 { |
174 wl_proxy_set_user_data((struct wl_proxy *) zwp_pointer_stylus_v1, user_d
ata); | 269 wl_proxy_set_user_data((struct wl_proxy *) zwp_pointer_stylus_v1, user_d
ata); |
175 } | 270 } |
176 | 271 |
| 272 /** @ingroup iface_zwp_pointer_stylus_v1 */ |
177 static inline void * | 273 static inline void * |
178 zwp_pointer_stylus_v1_get_user_data(struct zwp_pointer_stylus_v1 *zwp_pointer_st
ylus_v1) | 274 zwp_pointer_stylus_v1_get_user_data(struct zwp_pointer_stylus_v1 *zwp_pointer_st
ylus_v1) |
179 { | 275 { |
180 return wl_proxy_get_user_data((struct wl_proxy *) zwp_pointer_stylus_v1)
; | 276 return wl_proxy_get_user_data((struct wl_proxy *) zwp_pointer_stylus_v1)
; |
181 } | 277 } |
182 | 278 |
| 279 static inline uint32_t |
| 280 zwp_pointer_stylus_v1_get_version(struct zwp_pointer_stylus_v1 *zwp_pointer_styl
us_v1) |
| 281 { |
| 282 return wl_proxy_get_version((struct wl_proxy *) zwp_pointer_stylus_v1); |
| 283 } |
| 284 |
| 285 /** |
| 286 * @ingroup iface_zwp_pointer_stylus_v1 |
| 287 */ |
183 static inline void | 288 static inline void |
184 zwp_pointer_stylus_v1_destroy(struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v
1) | 289 zwp_pointer_stylus_v1_destroy(struct zwp_pointer_stylus_v1 *zwp_pointer_stylus_v
1) |
185 { | 290 { |
186 wl_proxy_marshal((struct wl_proxy *) zwp_pointer_stylus_v1, | 291 wl_proxy_marshal((struct wl_proxy *) zwp_pointer_stylus_v1, |
187 ZWP_POINTER_STYLUS_V1_DESTROY); | 292 ZWP_POINTER_STYLUS_V1_DESTROY); |
188 | 293 |
189 wl_proxy_destroy((struct wl_proxy *) zwp_pointer_stylus_v1); | 294 wl_proxy_destroy((struct wl_proxy *) zwp_pointer_stylus_v1); |
190 } | 295 } |
191 | 296 |
192 #ifdef __cplusplus | 297 #ifdef __cplusplus |
193 } | 298 } |
194 #endif | 299 #endif |
195 | 300 |
196 #endif | 301 #endif |
OLD | NEW |