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

Side by Side Diff: third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h

Issue 2560493003: wayland-protocols: Add zcr_stylus_v2 protocol for touch based stylus (Closed)
Patch Set: apply v1 update to v2. Created 4 years 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
(Empty)
1 /* Generated by wayland-scanner 1.11.0 */
2
3 #ifndef STYLUS_UNSTABLE_V2_SERVER_PROTOCOL_H
4 #define STYLUS_UNSTABLE_V2_SERVER_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-server.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 struct wl_client;
15 struct wl_resource;
16
17 /**
18 * @page page_stylus_unstable_v2 The stylus_unstable_v2 protocol
19 * @section page_ifaces_stylus_unstable_v2 Interfaces
20 * - @subpage page_iface_zcr_stylus_v2 - extends wl_touch with events for on-scr een stylus
21 * - @subpage page_iface_zcr_touch_stylus_v2 - stylus extension for touch
22 * @section page_copyright_stylus_unstable_v2 Copyright
23 * <pre>
24 *
25 * Copyright 2016 The Chromium Authors.
26 *
27 * Permission is hereby granted, free of charge, to any person obtaining a
28 * copy of this software and associated documentation files (the "Software"),
29 * to deal in the Software without restriction, including without limitation
30 * 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
32 * Software is furnished to do so, subject to the following conditions:
33 *
34 * The above copyright notice and this permission notice (including the next
35 * paragraph) shall be included in all copies or substantial portions of the
36 * Software.
37 *
38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40 * 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
42 * 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
44 * DEALINGS IN THE SOFTWARE.
45 * </pre>
46 */
47 struct wl_touch;
48 struct zcr_stylus_v2;
49 struct zcr_touch_stylus_v2;
50
51 /**
52 * @page page_iface_zcr_stylus_v2 zcr_stylus_v2
53 * @section page_iface_zcr_stylus_v2_desc Description
54 *
55 * Allows a wl_touch to report stylus specific information. The client can
56 * interpret the on-screen stylus like any other touch event, and use
57 * this protocol to obtain detail information about the type of stylus,
58 * as well as the force and tilt of the tool.
59 *
60 * These events are to be fired by the server within the same frame as other
61 * wl_touch events.
62 *
63 * Warning! The protocol described in this file is experimental and
64 * backward incompatible changes may be made. Backward compatible changes
65 * may be added together with the corresponding uinterface version bump.
66 * Backward incompatible changes are done by bumping the version number in
67 * the protocol and uinterface names and resetting the interface version.
68 * Once the protocol is to be declared stable, the 'z' prefix and the
69 * version number in the protocol and interface names are removed and the
70 * interface version number is reset.
71 * @section page_iface_zcr_stylus_v2_api API
72 * See @ref iface_zcr_stylus_v2.
73 */
74 /**
75 * @defgroup iface_zcr_stylus_v2 The zcr_stylus_v2 interface
76 *
77 * Allows a wl_touch to report stylus specific information. The client can
78 * interpret the on-screen stylus like any other touch event, and use
79 * this protocol to obtain detail information about the type of stylus,
80 * as well as the force and tilt of the tool.
81 *
82 * These events are to be fired by the server within the same frame as other
83 * wl_touch events.
84 *
85 * Warning! The protocol described in this file is experimental and
86 * backward incompatible changes may be made. Backward compatible changes
87 * may be added together with the corresponding uinterface version bump.
88 * Backward incompatible changes are done by bumping the version number in
89 * the protocol and uinterface names and resetting the interface version.
90 * Once the protocol is to be declared stable, the 'z' prefix and the
91 * version number in the protocol and interface names are removed and the
92 * interface version number is reset.
93 */
94 extern const struct wl_interface zcr_stylus_v2_interface;
95 /**
96 * @page page_iface_zcr_touch_stylus_v2 zcr_touch_stylus_v2
97 * @section page_iface_zcr_touch_stylus_v2_desc Description
98 *
99 * The zcr_touch_stylus_v1 interface extends the wl_touch interface with
100 * events to describe details about a stylus.
101 * @section page_iface_zcr_touch_stylus_v2_api API
102 * See @ref iface_zcr_touch_stylus_v2.
103 */
104 /**
105 * @defgroup iface_zcr_touch_stylus_v2 The zcr_touch_stylus_v2 interface
106 *
107 * The zcr_touch_stylus_v1 interface extends the wl_touch interface with
108 * events to describe details about a stylus.
109 */
110 extern const struct wl_interface zcr_touch_stylus_v2_interface;
111
112 #ifndef ZCR_STYLUS_V2_ERROR_ENUM
113 #define ZCR_STYLUS_V2_ERROR_ENUM
114 enum zcr_stylus_v2_error {
115 /**
116 * the touch already has a touch_stylus object associated
117 */
118 ZCR_STYLUS_V2_ERROR_TOUCH_STYLUS_EXISTS = 0,
119 };
120 #endif /* ZCR_STYLUS_V2_ERROR_ENUM */
121
122 /**
123 * @ingroup iface_zcr_stylus_v2
124 * @struct zcr_stylus_v2_interface
125 */
126 struct zcr_stylus_v2_interface {
127 /**
128 * get stylus interface for touch
129 *
130 * Create touch_stylus object. See zcr_touch_stylus_v1 interface
131 * for details. If the given wl_touch already has a touch_stylus
132 * object associated, the touch_stylus_exists protocol error is
133 * raised.
134 */
135 void (*get_touch_stylus)(struct wl_client *client,
136 struct wl_resource *resource,
137 uint32_t id,
138 struct wl_resource *touch);
139 };
140
141
142 #ifndef ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM
143 #define ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM
144 /**
145 * @ingroup iface_zcr_touch_stylus_v2
146 * tool type of device.
147 */
148 enum zcr_touch_stylus_v2_tool_type {
149 /**
150 * Touch
151 */
152 ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_TOUCH = 1,
153 /**
154 * Pen
155 */
156 ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_PEN = 2,
157 /**
158 * Eraser
159 */
160 ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ERASER = 3,
161 };
162 #endif /* ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM */
163
164 /**
165 * @ingroup iface_zcr_touch_stylus_v2
166 * @struct zcr_touch_stylus_v2_interface
167 */
168 struct zcr_touch_stylus_v2_interface {
169 /**
170 * destroy stylus object
171 *
172 *
173 */
174 void (*destroy)(struct wl_client *client,
175 struct wl_resource *resource);
176 };
177
178 #define ZCR_TOUCH_STYLUS_V2_TOOL 0
179 #define ZCR_TOUCH_STYLUS_V2_FORCE 1
180 #define ZCR_TOUCH_STYLUS_V2_TILT 2
181
182 /**
183 * @ingroup iface_zcr_touch_stylus_v2
184 */
185 #define ZCR_TOUCH_STYLUS_V2_TOOL_SINCE_VERSION 1
186 /**
187 * @ingroup iface_zcr_touch_stylus_v2
188 */
189 #define ZCR_TOUCH_STYLUS_V2_FORCE_SINCE_VERSION 1
190 /**
191 * @ingroup iface_zcr_touch_stylus_v2
192 */
193 #define ZCR_TOUCH_STYLUS_V2_TILT_SINCE_VERSION 1
194
195 /**
196 * @ingroup iface_zcr_touch_stylus_v2
197 * Sends an tool event to the client owning the resource.
198 * @param resource_ The client's resource
199 * @param id touch id
200 * @param type type of tool in use
201 */
202 static inline void
203 zcr_touch_stylus_v2_send_tool(struct wl_resource *resource_, uint32_t id, uint32 _t type)
204 {
205 wl_resource_post_event(resource_, ZCR_TOUCH_STYLUS_V2_TOOL, id, type);
206 }
207
208 /**
209 * @ingroup iface_zcr_touch_stylus_v2
210 * Sends an force event to the client owning the resource.
211 * @param resource_ The client's resource
212 * @param time timestamp with millisecond granularity
213 * @param id touch id
214 * @param force new value of force
215 */
216 static inline void
217 zcr_touch_stylus_v2_send_force(struct wl_resource *resource_, uint32_t time, uin t32_t id, wl_fixed_t force)
218 {
219 wl_resource_post_event(resource_, ZCR_TOUCH_STYLUS_V2_FORCE, time, id, f orce);
220 }
221
222 /**
223 * @ingroup iface_zcr_touch_stylus_v2
224 * Sends an tilt event to the client owning the resource.
225 * @param resource_ The client's resource
226 * @param time timestamp with millisecond granularity
227 * @param id touch id
228 * @param tilt_x tilt in x direction
229 * @param tilt_y tilt in y direction
230 */
231 static inline void
232 zcr_touch_stylus_v2_send_tilt(struct wl_resource *resource_, uint32_t time, uint 32_t id, wl_fixed_t tilt_x, wl_fixed_t tilt_y)
233 {
234 wl_resource_post_event(resource_, ZCR_TOUCH_STYLUS_V2_TILT, time, id, ti lt_x, tilt_y);
235 }
236
237 #ifdef __cplusplus
238 }
239 #endif
240
241 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698