Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: third_party/wayland-protocols/include/protocol/stylus-unstable-v1-client-protocol.h

Issue 2350633002: third_party: Switch to zcr prefix for downstream wayland interfaces. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_zwp_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_zwp_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
19 * @section page_copyright_stylus_unstable_v1 Copyright 21 * @section page_copyright_stylus_unstable_v1 Copyright
20 * <pre> 22 * <pre>
21 * 23 *
22 * Copyright 2016 The Chromium Authors. 24 * Copyright 2016 The Chromium Authors.
23 * 25 *
24 * Permission is hereby granted, free of charge, to any person obtaining a 26 * Permission is hereby granted, free of charge, to any person obtaining a
25 * copy of this software and associated documentation files (the "Software"), 27 * copy of this software and associated documentation files (the "Software"),
26 * to deal in the Software without restriction, including without limitation 28 * to deal in the Software without restriction, including without limitation
27 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 29 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28 * and/or sell copies of the Software, and to permit persons to whom the 30 * and/or sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following conditions: 31 * Software is furnished to do so, subject to the following conditions:
30 * 32 *
31 * The above copyright notice and this permission notice (including the next 33 * The above copyright notice and this permission notice (including the next
32 * paragraph) shall be included in all copies or substantial portions of the 34 * paragraph) shall be included in all copies or substantial portions of the
33 * Software. 35 * Software.
34 * 36 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 37 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 38 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 39 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
38 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 40 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 41 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 42 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
41 * DEALINGS IN THE SOFTWARE. 43 * DEALINGS IN THE SOFTWARE.
42 * </pre> 44 * </pre>
43 */ 45 */
44 struct wl_pointer; 46 struct wl_pointer;
47 struct zcr_pointer_stylus_v1;
48 struct zcr_stylus_v1;
45 struct zwp_pointer_stylus_v1; 49 struct zwp_pointer_stylus_v1;
46 struct zwp_stylus_v1; 50 struct zwp_stylus_v1;
47 51
48 /** 52 /**
53 * @page page_iface_zcr_stylus_v1 zcr_stylus_v1
54 * @section page_iface_zcr_stylus_v1_desc Description
55 *
56 * 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
58 * this protocol to obtain detail information about the type of stylus,
59 * as well as the force and tilt of the tool.
60 *
61 * These events are to be fired by the server within the same frame as other
62 * wl_pointer events.
63 *
64 * Warning! The protocol described in this file is experimental and
65 * backward incompatible changes may be made. Backward compatible changes
66 * may be added together with the corresponding uinterface version bump.
67 * Backward incompatible changes are done by bumping the version number in
68 * the protocol and uinterface names and resetting the interface version.
69 * Once the protocol is to be declared stable, the 'z' prefix and the
70 * version number in the protocol and interface names are removed and the
71 * interface version number is reset.
72 * @section page_iface_zcr_stylus_v1_api API
73 * See @ref iface_zcr_stylus_v1.
74 */
75 /**
76 * @defgroup iface_zcr_stylus_v1 The zcr_stylus_v1 interface
77 *
78 * Allows a wl_pointer to represent an on-screen stylus. The client can
79 * interpret the on-screen stylus like any other mouse device, and use
80 * this protocol to obtain detail information about the type of stylus,
81 * as well as the force and tilt of the tool.
82 *
83 * These events are to be fired by the server within the same frame as other
84 * wl_pointer events.
85 *
86 * Warning! The protocol described in this file is experimental and
87 * backward incompatible changes may be made. Backward compatible changes
88 * may be added together with the corresponding uinterface version bump.
89 * Backward incompatible changes are done by bumping the version number in
90 * the protocol and uinterface names and resetting the interface version.
91 * Once the protocol is to be declared stable, the 'z' prefix and the
92 * version number in the protocol and interface names are removed and the
93 * interface version number is reset.
94 */
95 extern const struct wl_interface zcr_stylus_v1_interface;
96 /**
97 * @page page_iface_zcr_pointer_stylus_v1 zcr_pointer_stylus_v1
98 * @section page_iface_zcr_pointer_stylus_v1_desc Description
99 *
100 * The zcr_pointer_stylus_v1 interface extends the wl_pointer interface with
101 * events to describe details about a stylus acting as a pointer.
102 * @section page_iface_zcr_pointer_stylus_v1_api API
103 * See @ref iface_zcr_pointer_stylus_v1.
104 */
105 /**
106 * @defgroup iface_zcr_pointer_stylus_v1 The zcr_pointer_stylus_v1 interface
107 *
108 * The zcr_pointer_stylus_v1 interface extends the wl_pointer interface with
109 * events to describe details about a stylus acting as a pointer.
110 */
111 extern const struct wl_interface zcr_pointer_stylus_v1_interface;
112 /**
49 * @page page_iface_zwp_stylus_v1 zwp_stylus_v1 113 * @page page_iface_zwp_stylus_v1 zwp_stylus_v1
50 * @section page_iface_zwp_stylus_v1_desc Description 114 * @section page_iface_zwp_stylus_v1_desc Description
51 * 115 *
52 * Allows a wl_pointer to represent an on-screen stylus. The client can 116 * Allows a wl_pointer to represent an on-screen stylus. The client can
53 * interpret the on-screen stylus like any other mouse device, and use 117 * interpret the on-screen stylus like any other mouse device, and use
54 * this protocol to obtain detail information about the type of stylus, 118 * this protocol to obtain detail information about the type of stylus,
55 * as well as the force and tilt of the tool. 119 * as well as the force and tilt of the tool.
56 * 120 *
57 * These events are to be fired by the server within the same frame as other 121 * These events are to be fired by the server within the same frame as other
58 * wl_pointer events. 122 * wl_pointer events.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 * See @ref iface_zwp_pointer_stylus_v1. 163 * See @ref iface_zwp_pointer_stylus_v1.
100 */ 164 */
101 /** 165 /**
102 * @defgroup iface_zwp_pointer_stylus_v1 The zwp_pointer_stylus_v1 interface 166 * @defgroup iface_zwp_pointer_stylus_v1 The zwp_pointer_stylus_v1 interface
103 * 167 *
104 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with 168 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with
105 * events to describe details about a stylus acting as a pointer. 169 * events to describe details about a stylus acting as a pointer.
106 */ 170 */
107 extern const struct wl_interface zwp_pointer_stylus_v1_interface; 171 extern const struct wl_interface zwp_pointer_stylus_v1_interface;
108 172
173 #define ZCR_STYLUS_V1_GET_POINTER_STYLUS 0
174
175 /**
176 * @ingroup iface_zcr_stylus_v1
177 */
178 #define ZCR_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1
179
180 /** @ingroup iface_zcr_stylus_v1 */
181 static inline void
182 zcr_stylus_v1_set_user_data(struct zcr_stylus_v1 *zcr_stylus_v1, void *user_data )
183 {
184 wl_proxy_set_user_data((struct wl_proxy *) zcr_stylus_v1, user_data);
185 }
186
187 /** @ingroup iface_zcr_stylus_v1 */
188 static inline void *
189 zcr_stylus_v1_get_user_data(struct zcr_stylus_v1 *zcr_stylus_v1)
190 {
191 return wl_proxy_get_user_data((struct wl_proxy *) zcr_stylus_v1);
192 }
193
194 static inline uint32_t
195 zcr_stylus_v1_get_version(struct zcr_stylus_v1 *zcr_stylus_v1)
196 {
197 return wl_proxy_get_version((struct wl_proxy *) zcr_stylus_v1);
198 }
199
200 /** @ingroup iface_zcr_stylus_v1 */
201 static inline void
202 zcr_stylus_v1_destroy(struct zcr_stylus_v1 *zcr_stylus_v1)
203 {
204 wl_proxy_destroy((struct wl_proxy *) zcr_stylus_v1);
205 }
206
207 /**
208 * @ingroup iface_zcr_stylus_v1
209 *
210 * Create pointer_stylus object. See zcr_pointer_stylus_v1 interface for
211 * details.
212 */
213 static inline struct zcr_pointer_stylus_v1 *
214 zcr_stylus_v1_get_pointer_stylus(struct zcr_stylus_v1 *zcr_stylus_v1, struct wl_ pointer *pointer)
215 {
216 struct wl_proxy *id;
217
218 id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_stylus_v1,
219 ZCR_STYLUS_V1_GET_POINTER_STYLUS, &zcr_pointer_stylus_v 1_interface, NULL, pointer);
220
221 return (struct zcr_pointer_stylus_v1 *) id;
222 }
223
224 #ifndef ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ENUM
225 #define ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ENUM
226 /**
227 * @ingroup iface_zcr_pointer_stylus_v1
228 * tool type of device.
229 */
230 enum zcr_pointer_stylus_v1_tool_type {
231 /**
232 * Mouse or touchpad, not a stylus.
233 */
234 ZCR_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE = 0,
235 /**
236 * Pen
237 */
238 ZCR_POINTER_STYLUS_V1_TOOL_TYPE_PEN = 1,
239 /**
240 * Touch
241 */
242 ZCR_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH = 2,
243 /**
244 * Eraser
245 */
246 ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ERASER = 3,
247 };
248 #endif /* ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ENUM */
249
250 /**
251 * @ingroup iface_zcr_pointer_stylus_v1
252 * @struct zcr_pointer_stylus_v1_listener
253 */
254 struct zcr_pointer_stylus_v1_listener {
255 /**
256 * pointing device tool type changed
257 *
258 * Notification that the user is using a new tool type. There can
259 * only be one tool in use at a time. If the pointer enters a
260 * client surface, with a tool type other than mouse, this event
261 * will also be generated.
262 *
263 * If this event is not received, the client has to assume a mouse
264 * is in use. The remaining events of this protocol are only being
265 * generated after this event has been fired with a tool type other
266 * than mouse.
267 * @param type new device type
268 */
269 void (*tool_change)(void *data,
270 struct zcr_pointer_stylus_v1 *zcr_pointer_stylus_v1,
271 uint32_t type);
272 /**
273 * force change event
274 *
275 * Notification of a change in physical force on the surface of
276 * the screen.
277 *
278 * If the pointer enters a client surface, with a tool type other
279 * than mouse, this event will also be generated.
280 *
281 * The force is calibrated and normalized to the 0 to 1 range.
282 * @param time timestamp with millisecond granularity
283 * @param force new value of force
284 */
285 void (*force)(void *data,
286 struct zcr_pointer_stylus_v1 *zcr_pointer_stylus_v1,
287 uint32_t time,
288 wl_fixed_t force);
289 /**
290 * force change event
291 *
292 * Notification of a change in tilt of the pointing tool.
293 *
294 * If the pointer enters a client surface, with a tool type other
295 * than mouse, this event will also be generated.
296 *
297 * Measured from surface normal as plane angle in degrees, values
298 * lie in [-90,90]. A positive x is to the right and a positive y
299 * is towards the user.
300 * @param time timestamp with millisecond granularity
301 * @param tilt_x tilt in x direction
302 * @param tilt_y tilt in y direction
303 */
304 void (*tilt)(void *data,
305 struct zcr_pointer_stylus_v1 *zcr_pointer_stylus_v1,
306 uint32_t time,
307 wl_fixed_t tilt_x,
308 wl_fixed_t tilt_y);
309 };
310
311 /**
312 * @ingroup zcr_pointer_stylus_v1_iface
313 */
314 static inline int
315 zcr_pointer_stylus_v1_add_listener(struct zcr_pointer_stylus_v1 *zcr_pointer_sty lus_v1,
316 const struct zcr_pointer_stylus_v1_listener * listener, void *data)
317 {
318 return wl_proxy_add_listener((struct wl_proxy *) zcr_pointer_stylus_v1,
319 (void (**)(void)) listener, data);
320 }
321
322 #define ZCR_POINTER_STYLUS_V1_DESTROY 0
323
324 /**
325 * @ingroup iface_zcr_pointer_stylus_v1
326 */
327 #define ZCR_POINTER_STYLUS_V1_DESTROY_SINCE_VERSION 1
328
329 /** @ingroup iface_zcr_pointer_stylus_v1 */
330 static inline void
331 zcr_pointer_stylus_v1_set_user_data(struct zcr_pointer_stylus_v1 *zcr_pointer_st ylus_v1, void *user_data)
332 {
333 wl_proxy_set_user_data((struct wl_proxy *) zcr_pointer_stylus_v1, user_d ata);
334 }
335
336 /** @ingroup iface_zcr_pointer_stylus_v1 */
337 static inline void *
338 zcr_pointer_stylus_v1_get_user_data(struct zcr_pointer_stylus_v1 *zcr_pointer_st ylus_v1)
339 {
340 return wl_proxy_get_user_data((struct wl_proxy *) zcr_pointer_stylus_v1) ;
341 }
342
343 static inline uint32_t
344 zcr_pointer_stylus_v1_get_version(struct zcr_pointer_stylus_v1 *zcr_pointer_styl us_v1)
345 {
346 return wl_proxy_get_version((struct wl_proxy *) zcr_pointer_stylus_v1);
347 }
348
349 /**
350 * @ingroup iface_zcr_pointer_stylus_v1
351 */
352 static inline void
353 zcr_pointer_stylus_v1_destroy(struct zcr_pointer_stylus_v1 *zcr_pointer_stylus_v 1)
354 {
355 wl_proxy_marshal((struct wl_proxy *) zcr_pointer_stylus_v1,
356 ZCR_POINTER_STYLUS_V1_DESTROY);
357
358 wl_proxy_destroy((struct wl_proxy *) zcr_pointer_stylus_v1);
359 }
360
109 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS 0 361 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS 0
110 362
111 /** 363 /**
112 * @ingroup iface_zwp_stylus_v1 364 * @ingroup iface_zwp_stylus_v1
113 */ 365 */
114 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1 366 #define ZWP_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1
115 367
116 /** @ingroup iface_zwp_stylus_v1 */ 368 /** @ingroup iface_zwp_stylus_v1 */
117 static inline void 369 static inline void
118 zwp_stylus_v1_set_user_data(struct zwp_stylus_v1 *zwp_stylus_v1, void *user_data ) 370 zwp_stylus_v1_set_user_data(struct zwp_stylus_v1 *zwp_stylus_v1, void *user_data )
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 ZWP_POINTER_STYLUS_V1_DESTROY); 544 ZWP_POINTER_STYLUS_V1_DESTROY);
293 545
294 wl_proxy_destroy((struct wl_proxy *) zwp_pointer_stylus_v1); 546 wl_proxy_destroy((struct wl_proxy *) zwp_pointer_stylus_v1);
295 } 547 }
296 548
297 #ifdef __cplusplus 549 #ifdef __cplusplus
298 } 550 }
299 #endif 551 #endif
300 552
301 #endif 553 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698