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

Side by Side Diff: third_party/wayland-protocols/include/protocol/stylus-unstable-v1-server-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_SERVER_PROTOCOL_H 3 #ifndef STYLUS_UNSTABLE_V1_SERVER_PROTOCOL_H
4 #define STYLUS_UNSTABLE_V1_SERVER_PROTOCOL_H 4 #define STYLUS_UNSTABLE_V1_SERVER_PROTOCOL_H
5 5
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <stddef.h> 7 #include <stddef.h>
8 #include "wayland-server.h" 8 #include "wayland-server.h"
9 9
10 #ifdef __cplusplus 10 #ifdef __cplusplus
11 extern "C" { 11 extern "C" {
12 #endif 12 #endif
13 13
14 struct wl_client; 14 struct wl_client;
15 struct wl_resource; 15 struct wl_resource;
16 16
17 /** 17 /**
18 * @page page_stylus_unstable_v1 The stylus_unstable_v1 protocol 18 * @page page_stylus_unstable_v1 The stylus_unstable_v1 protocol
19 * @section page_ifaces_stylus_unstable_v1 Interfaces 19 * @section page_ifaces_stylus_unstable_v1 Interfaces
20 * - @subpage page_iface_zwp_stylus_v1 - extends wl_pointer with events for on-s creen stylus 20 * - @subpage page_iface_zcr_stylus_v1 - extends wl_pointer with events for on-s creen stylus
21 * - @subpage page_iface_zwp_pointer_stylus_v1 - stylus extension for pointer 21 * - @subpage page_iface_zcr_pointer_stylus_v1 - stylus extension for pointer
22 * - @subpage page_iface_zwp_stylus_v1 - DEPRECATED
23 * - @subpage page_iface_zwp_pointer_stylus_v1 - DEPRECATED
22 * @section page_copyright_stylus_unstable_v1 Copyright 24 * @section page_copyright_stylus_unstable_v1 Copyright
23 * <pre> 25 * <pre>
24 * 26 *
25 * Copyright 2016 The Chromium Authors. 27 * Copyright 2016 The Chromium Authors.
26 * 28 *
27 * Permission is hereby granted, free of charge, to any person obtaining a 29 * Permission is hereby granted, free of charge, to any person obtaining a
28 * copy of this software and associated documentation files (the "Software"), 30 * copy of this software and associated documentation files (the "Software"),
29 * to deal in the Software without restriction, including without limitation 31 * to deal in the Software without restriction, including without limitation
30 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 32 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
31 * and/or sell copies of the Software, and to permit persons to whom the 33 * and/or sell copies of the Software, and to permit persons to whom the
32 * Software is furnished to do so, subject to the following conditions: 34 * Software is furnished to do so, subject to the following conditions:
33 * 35 *
34 * The above copyright notice and this permission notice (including the next 36 * The above copyright notice and this permission notice (including the next
35 * paragraph) shall be included in all copies or substantial portions of the 37 * paragraph) shall be included in all copies or substantial portions of the
36 * Software. 38 * Software.
37 * 39 *
38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 40 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 41 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 42 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
41 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 43 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 44 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 45 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
44 * DEALINGS IN THE SOFTWARE. 46 * DEALINGS IN THE SOFTWARE.
45 * </pre> 47 * </pre>
46 */ 48 */
47 struct wl_pointer; 49 struct wl_pointer;
50 struct zcr_pointer_stylus_v1;
51 struct zcr_stylus_v1;
48 struct zwp_pointer_stylus_v1; 52 struct zwp_pointer_stylus_v1;
49 struct zwp_stylus_v1; 53 struct zwp_stylus_v1;
50 54
51 /** 55 /**
56 * @page page_iface_zcr_stylus_v1 zcr_stylus_v1
57 * @section page_iface_zcr_stylus_v1_desc Description
58 *
59 * Allows a wl_pointer to represent an on-screen stylus. The client can
60 * interpret the on-screen stylus like any other mouse device, and use
61 * this protocol to obtain detail information about the type of stylus,
62 * as well as the force and tilt of the tool.
63 *
64 * These events are to be fired by the server within the same frame as other
65 * wl_pointer events.
66 *
67 * Warning! The protocol described in this file is experimental and
68 * backward incompatible changes may be made. Backward compatible changes
69 * may be added together with the corresponding uinterface version bump.
70 * Backward incompatible changes are done by bumping the version number in
71 * the protocol and uinterface names and resetting the interface version.
72 * Once the protocol is to be declared stable, the 'z' prefix and the
73 * version number in the protocol and interface names are removed and the
74 * interface version number is reset.
75 * @section page_iface_zcr_stylus_v1_api API
76 * See @ref iface_zcr_stylus_v1.
77 */
78 /**
79 * @defgroup iface_zcr_stylus_v1 The zcr_stylus_v1 interface
80 *
81 * Allows a wl_pointer to represent an on-screen stylus. The client can
82 * interpret the on-screen stylus like any other mouse device, and use
83 * this protocol to obtain detail information about the type of stylus,
84 * as well as the force and tilt of the tool.
85 *
86 * These events are to be fired by the server within the same frame as other
87 * wl_pointer events.
88 *
89 * Warning! The protocol described in this file is experimental and
90 * backward incompatible changes may be made. Backward compatible changes
91 * may be added together with the corresponding uinterface version bump.
92 * Backward incompatible changes are done by bumping the version number in
93 * the protocol and uinterface names and resetting the interface version.
94 * Once the protocol is to be declared stable, the 'z' prefix and the
95 * version number in the protocol and interface names are removed and the
96 * interface version number is reset.
97 */
98 extern const struct wl_interface zcr_stylus_v1_interface;
99 /**
100 * @page page_iface_zcr_pointer_stylus_v1 zcr_pointer_stylus_v1
101 * @section page_iface_zcr_pointer_stylus_v1_desc Description
102 *
103 * The zcr_pointer_stylus_v1 interface extends the wl_pointer interface with
104 * events to describe details about a stylus acting as a pointer.
105 * @section page_iface_zcr_pointer_stylus_v1_api API
106 * See @ref iface_zcr_pointer_stylus_v1.
107 */
108 /**
109 * @defgroup iface_zcr_pointer_stylus_v1 The zcr_pointer_stylus_v1 interface
110 *
111 * The zcr_pointer_stylus_v1 interface extends the wl_pointer interface with
112 * events to describe details about a stylus acting as a pointer.
113 */
114 extern const struct wl_interface zcr_pointer_stylus_v1_interface;
115 /**
52 * @page page_iface_zwp_stylus_v1 zwp_stylus_v1 116 * @page page_iface_zwp_stylus_v1 zwp_stylus_v1
53 * @section page_iface_zwp_stylus_v1_desc Description 117 * @section page_iface_zwp_stylus_v1_desc Description
54 * 118 *
55 * Allows a wl_pointer to represent an on-screen stylus. The client can 119 * Allows a wl_pointer to represent an on-screen stylus. The client can
56 * interpret the on-screen stylus like any other mouse device, and use 120 * interpret the on-screen stylus like any other mouse device, and use
57 * this protocol to obtain detail information about the type of stylus, 121 * this protocol to obtain detail information about the type of stylus,
58 * as well as the force and tilt of the tool. 122 * as well as the force and tilt of the tool.
59 * 123 *
60 * These events are to be fired by the server within the same frame as other 124 * These events are to be fired by the server within the same frame as other
61 * wl_pointer events. 125 * wl_pointer events.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 */ 167 */
104 /** 168 /**
105 * @defgroup iface_zwp_pointer_stylus_v1 The zwp_pointer_stylus_v1 interface 169 * @defgroup iface_zwp_pointer_stylus_v1 The zwp_pointer_stylus_v1 interface
106 * 170 *
107 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with 171 * The zwp_pointer_stylus_v1 interface extends the wl_pointer interface with
108 * events to describe details about a stylus acting as a pointer. 172 * events to describe details about a stylus acting as a pointer.
109 */ 173 */
110 extern const struct wl_interface zwp_pointer_stylus_v1_interface; 174 extern const struct wl_interface zwp_pointer_stylus_v1_interface;
111 175
112 /** 176 /**
177 * @ingroup iface_zcr_stylus_v1
178 * @struct zcr_stylus_v1_interface
179 */
180 struct zcr_stylus_v1_interface {
181 /**
182 * get stylus interface for pointer
183 *
184 * Create pointer_stylus object. See zcr_pointer_stylus_v1
185 * interface for details.
186 */
187 void (*get_pointer_stylus)(struct wl_client *client,
188 struct wl_resource *resource,
189 uint32_t id,
190 struct wl_resource *pointer);
191 };
192
193
194 #ifndef ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ENUM
195 #define ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ENUM
196 /**
197 * @ingroup iface_zcr_pointer_stylus_v1
198 * tool type of device.
199 */
200 enum zcr_pointer_stylus_v1_tool_type {
201 /**
202 * Mouse or touchpad, not a stylus.
203 */
204 ZCR_POINTER_STYLUS_V1_TOOL_TYPE_MOUSE = 0,
205 /**
206 * Pen
207 */
208 ZCR_POINTER_STYLUS_V1_TOOL_TYPE_PEN = 1,
209 /**
210 * Touch
211 */
212 ZCR_POINTER_STYLUS_V1_TOOL_TYPE_TOUCH = 2,
213 /**
214 * Eraser
215 */
216 ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ERASER = 3,
217 };
218 #endif /* ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ENUM */
219
220 /**
221 * @ingroup iface_zcr_pointer_stylus_v1
222 * @struct zcr_pointer_stylus_v1_interface
223 */
224 struct zcr_pointer_stylus_v1_interface {
225 /**
226 * destroy stylus object
227 *
228 *
229 */
230 void (*destroy)(struct wl_client *client,
231 struct wl_resource *resource);
232 };
233
234 #define ZCR_POINTER_STYLUS_V1_TOOL_CHANGE 0
235 #define ZCR_POINTER_STYLUS_V1_FORCE 1
236 #define ZCR_POINTER_STYLUS_V1_TILT 2
237
238 /**
239 * @ingroup iface_zcr_pointer_stylus_v1
240 */
241 #define ZCR_POINTER_STYLUS_V1_TOOL_CHANGE_SINCE_VERSION 1
242 /**
243 * @ingroup iface_zcr_pointer_stylus_v1
244 */
245 #define ZCR_POINTER_STYLUS_V1_FORCE_SINCE_VERSION 1
246 /**
247 * @ingroup iface_zcr_pointer_stylus_v1
248 */
249 #define ZCR_POINTER_STYLUS_V1_TILT_SINCE_VERSION 1
250
251 /**
252 * @ingroup iface_zcr_pointer_stylus_v1
253 * Sends an tool_change event to the client owning the resource.
254 * @param resource_ The client's resource
255 * @param type new device type
256 */
257 static inline void
258 zcr_pointer_stylus_v1_send_tool_change(struct wl_resource *resource_, uint32_t t ype)
259 {
260 wl_resource_post_event(resource_, ZCR_POINTER_STYLUS_V1_TOOL_CHANGE, typ e);
261 }
262
263 /**
264 * @ingroup iface_zcr_pointer_stylus_v1
265 * Sends an force event to the client owning the resource.
266 * @param resource_ The client's resource
267 * @param time timestamp with millisecond granularity
268 * @param force new value of force
269 */
270 static inline void
271 zcr_pointer_stylus_v1_send_force(struct wl_resource *resource_, uint32_t time, w l_fixed_t force)
272 {
273 wl_resource_post_event(resource_, ZCR_POINTER_STYLUS_V1_FORCE, time, for ce);
274 }
275
276 /**
277 * @ingroup iface_zcr_pointer_stylus_v1
278 * Sends an tilt event to the client owning the resource.
279 * @param resource_ The client's resource
280 * @param time timestamp with millisecond granularity
281 * @param tilt_x tilt in x direction
282 * @param tilt_y tilt in y direction
283 */
284 static inline void
285 zcr_pointer_stylus_v1_send_tilt(struct wl_resource *resource_, uint32_t time, wl _fixed_t tilt_x, wl_fixed_t tilt_y)
286 {
287 wl_resource_post_event(resource_, ZCR_POINTER_STYLUS_V1_TILT, time, tilt _x, tilt_y);
288 }
289
290 /**
113 * @ingroup iface_zwp_stylus_v1 291 * @ingroup iface_zwp_stylus_v1
114 * @struct zwp_stylus_v1_interface 292 * @struct zwp_stylus_v1_interface
115 */ 293 */
116 struct zwp_stylus_v1_interface { 294 struct zwp_stylus_v1_interface {
117 /** 295 /**
118 * get stylus interface for pointer 296 * get stylus interface for pointer
119 * 297 *
120 * Create pointer_stylus object. See zwp_pointer_stylus_v1 298 * Create pointer_stylus object. See zwp_pointer_stylus_v1
121 * interface for details. 299 * interface for details.
122 */ 300 */
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 zwp_pointer_stylus_v1_send_tilt(struct wl_resource *resource_, uint32_t time, wl _fixed_t tilt_x, wl_fixed_t tilt_y) 399 zwp_pointer_stylus_v1_send_tilt(struct wl_resource *resource_, uint32_t time, wl _fixed_t tilt_x, wl_fixed_t tilt_y)
222 { 400 {
223 wl_resource_post_event(resource_, ZWP_POINTER_STYLUS_V1_TILT, time, tilt _x, tilt_y); 401 wl_resource_post_event(resource_, ZWP_POINTER_STYLUS_V1_TILT, time, tilt _x, tilt_y);
224 } 402 }
225 403
226 #ifdef __cplusplus 404 #ifdef __cplusplus
227 } 405 }
228 #endif 406 #endif
229 407
230 #endif 408 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698