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

Side by Side Diff: third_party/wayland-protocols/include/protocol/gaming-input-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 GAMING_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H 3 #ifndef GAMING_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define GAMING_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H 4 #define GAMING_INPUT_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_gaming_input_unstable_v1 The gaming_input_unstable_v1 protocol 15 * @page page_gaming_input_unstable_v1 The gaming_input_unstable_v1 protocol
16 * @section page_ifaces_gaming_input_unstable_v1 Interfaces 16 * @section page_ifaces_gaming_input_unstable_v1 Interfaces
17 * - @subpage page_iface_zwp_gaming_input_v1 - extends wl_seat with gaming input devices 17 * - @subpage page_iface_zcr_gaming_input_v1 - extends wl_seat with gaming input devices
18 * - @subpage page_iface_zwp_gamepad_v1 - gamepad input device 18 * - @subpage page_iface_zcr_gamepad_v1 - gamepad input device
19 * - @subpage page_iface_zwp_gaming_input_v1 - DEPRECATED
20 * - @subpage page_iface_zwp_gamepad_v1 - DEPRECATED
19 * @section page_copyright_gaming_input_unstable_v1 Copyright 21 * @section page_copyright_gaming_input_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_seat; 46 struct wl_seat;
47 struct zcr_gamepad_v1;
48 struct zcr_gaming_input_v1;
45 struct zwp_gamepad_v1; 49 struct zwp_gamepad_v1;
46 struct zwp_gaming_input_v1; 50 struct zwp_gaming_input_v1;
47 51
48 /** 52 /**
53 * @page page_iface_zcr_gaming_input_v1 zcr_gaming_input_v1
54 * @section page_iface_zcr_gaming_input_v1_desc Description
55 *
56 * A global interface to provide gaming input devices for a given seat.
57 *
58 * Currently only gamepad devices are supported.
59 *
60 * Warning! The protocol described in this file is experimental and
61 * backward incompatible changes may be made. Backward compatible changes
62 * may be added together with the corresponding uinterface version bump.
63 * Backward incompatible changes are done by bumping the version number in
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_zcr_gaming_input_v1_api API
69 * See @ref iface_zcr_gaming_input_v1.
70 */
71 /**
72 * @defgroup iface_zcr_gaming_input_v1 The zcr_gaming_input_v1 interface
73 *
74 * A global interface to provide gaming input devices for a given seat.
75 *
76 * Currently only gamepad devices are supported.
77 *
78 * Warning! The protocol described in this file is experimental and
79 * backward incompatible changes may be made. Backward compatible changes
80 * may be added together with the corresponding uinterface version bump.
81 * Backward incompatible changes are done by bumping the version number in
82 * the protocol and uinterface names and resetting the interface version.
83 * Once the protocol is to be declared stable, the 'z' prefix and the
84 * version number in the protocol and interface names are removed and the
85 * interface version number is reset.
86 */
87 extern const struct wl_interface zcr_gaming_input_v1_interface;
88 /**
89 * @page page_iface_zcr_gamepad_v1 zcr_gamepad_v1
90 * @section page_iface_zcr_gamepad_v1_desc Description
91 *
92 * The zwp_gamepad_v1 interface represents one or more gamepad input devices,
93 * which are reported as a normalized 'Standard Gamepad' as it is specified
94 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
95 * @section page_iface_zcr_gamepad_v1_api API
96 * See @ref iface_zcr_gamepad_v1.
97 */
98 /**
99 * @defgroup iface_zcr_gamepad_v1 The zcr_gamepad_v1 interface
100 *
101 * The zwp_gamepad_v1 interface represents one or more gamepad input devices,
102 * which are reported as a normalized 'Standard Gamepad' as it is specified
103 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
104 */
105 extern const struct wl_interface zcr_gamepad_v1_interface;
106 /**
49 * @page page_iface_zwp_gaming_input_v1 zwp_gaming_input_v1 107 * @page page_iface_zwp_gaming_input_v1 zwp_gaming_input_v1
50 * @section page_iface_zwp_gaming_input_v1_desc Description 108 * @section page_iface_zwp_gaming_input_v1_desc Description
51 * 109 *
52 * A global interface to provide gaming input devices for a given seat. 110 * A global interface to provide gaming input devices for a given seat.
53 * 111 *
54 * Currently only gamepad devices are supported. 112 * Currently only gamepad devices are supported.
55 * 113 *
56 * Warning! The protocol described in this file is experimental and 114 * Warning! The protocol described in this file is experimental and
57 * backward incompatible changes may be made. Backward compatible changes 115 * backward incompatible changes may be made. Backward compatible changes
58 * may be added together with the corresponding uinterface version bump. 116 * may be added together with the corresponding uinterface version bump.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 */ 151 */
94 /** 152 /**
95 * @defgroup iface_zwp_gamepad_v1 The zwp_gamepad_v1 interface 153 * @defgroup iface_zwp_gamepad_v1 The zwp_gamepad_v1 interface
96 * 154 *
97 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, 155 * The zwp_gamepad_v1 interface represents one or more gamepad input devices,
98 * which are reported as a normalized 'Standard Gamepad' as it is specified 156 * which are reported as a normalized 'Standard Gamepad' as it is specified
99 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping 157 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
100 */ 158 */
101 extern const struct wl_interface zwp_gamepad_v1_interface; 159 extern const struct wl_interface zwp_gamepad_v1_interface;
102 160
161 #define ZCR_GAMING_INPUT_V1_GET_GAMEPAD 0
162
163 /**
164 * @ingroup iface_zcr_gaming_input_v1
165 */
166 #define ZCR_GAMING_INPUT_V1_GET_GAMEPAD_SINCE_VERSION 1
167
168 /** @ingroup iface_zcr_gaming_input_v1 */
169 static inline void
170 zcr_gaming_input_v1_set_user_data(struct zcr_gaming_input_v1 *zcr_gaming_input_v 1, void *user_data)
171 {
172 wl_proxy_set_user_data((struct wl_proxy *) zcr_gaming_input_v1, user_dat a);
173 }
174
175 /** @ingroup iface_zcr_gaming_input_v1 */
176 static inline void *
177 zcr_gaming_input_v1_get_user_data(struct zcr_gaming_input_v1 *zcr_gaming_input_v 1)
178 {
179 return wl_proxy_get_user_data((struct wl_proxy *) zcr_gaming_input_v1);
180 }
181
182 static inline uint32_t
183 zcr_gaming_input_v1_get_version(struct zcr_gaming_input_v1 *zcr_gaming_input_v1)
184 {
185 return wl_proxy_get_version((struct wl_proxy *) zcr_gaming_input_v1);
186 }
187
188 /** @ingroup iface_zcr_gaming_input_v1 */
189 static inline void
190 zcr_gaming_input_v1_destroy(struct zcr_gaming_input_v1 *zcr_gaming_input_v1)
191 {
192 wl_proxy_destroy((struct wl_proxy *) zcr_gaming_input_v1);
193 }
194
195 /**
196 * @ingroup iface_zcr_gaming_input_v1
197 *
198 * Create gamepad object. See zwp_gamepad_v1 interface for details.
199 */
200 static inline struct zcr_gamepad_v1 *
201 zcr_gaming_input_v1_get_gamepad(struct zcr_gaming_input_v1 *zcr_gaming_input_v1, struct wl_seat *seat)
202 {
203 struct wl_proxy *id;
204
205 id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_gaming_input_v 1,
206 ZCR_GAMING_INPUT_V1_GET_GAMEPAD, &zcr_gamepad_v1_interf ace, NULL, seat);
207
208 return (struct zcr_gamepad_v1 *) id;
209 }
210
211 #ifndef ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM
212 #define ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM
213 /**
214 * @ingroup iface_zcr_gamepad_v1
215 * connection state
216 */
217 enum zcr_gamepad_v1_gamepad_state {
218 /**
219 * no gamepads are connected or on.
220 */
221 ZCR_GAMEPAD_V1_GAMEPAD_STATE_OFF = 0,
222 /**
223 * at least one gamepad is connected.
224 */
225 ZCR_GAMEPAD_V1_GAMEPAD_STATE_ON = 1,
226 };
227 #endif /* ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM */
228
229 #ifndef ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM
230 #define ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM
231 /**
232 * @ingroup iface_zcr_gamepad_v1
233 * physical button state
234 *
235 * Describes the physical state of a button that produced the button
236 * event.
237 */
238 enum zcr_gamepad_v1_button_state {
239 /**
240 * the button is not pressed
241 */
242 ZCR_GAMEPAD_V1_BUTTON_STATE_RELEASED = 0,
243 /**
244 * the button is pressed
245 */
246 ZCR_GAMEPAD_V1_BUTTON_STATE_PRESSED = 1,
247 };
248 #endif /* ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM */
249
250 /**
251 * @ingroup iface_zcr_gamepad_v1
252 * @struct zcr_gamepad_v1_listener
253 */
254 struct zcr_gamepad_v1_listener {
255 /**
256 * state change event
257 *
258 * Notification that this seat's connection state has changed.
259 * @param state new state
260 */
261 void (*state_change)(void *data,
262 struct zcr_gamepad_v1 *zcr_gamepad_v1,
263 uint32_t state);
264 /**
265 * axis change event
266 *
267 * Notification of axis change.
268 *
269 * The axis id specifies which axis has changed as defined by the
270 * W3C 'Standard Gamepad'.
271 *
272 * The value is calibrated and normalized to the -1 to 1 range.
273 * @param time timestamp with millisecond granularity
274 * @param axis axis that produced this event
275 * @param value new value of axis
276 */
277 void (*axis)(void *data,
278 struct zcr_gamepad_v1 *zcr_gamepad_v1,
279 uint32_t time,
280 uint32_t axis,
281 wl_fixed_t value);
282 /**
283 * Gamepad button changed
284 *
285 * Notification of button change.
286 *
287 * The button id specifies which button has changed as defined by
288 * the W3C 'Standard Gamepad'.
289 *
290 * A button can have a digital and an analog value. The analog
291 * value is normalized to a 0 to 1 range. If a button does not
292 * provide an analog value, it will be derived from the digital
293 * state.
294 * @param time timestamp with millisecond granularity
295 * @param button id of button
296 * @param state digital state of the button
297 * @param analog analog value of the button
298 */
299 void (*button)(void *data,
300 struct zcr_gamepad_v1 *zcr_gamepad_v1,
301 uint32_t time,
302 uint32_t button,
303 uint32_t state,
304 wl_fixed_t analog);
305 /**
306 * Notifies end of a series of gamepad changes.
307 *
308 * Indicates the end of a set of events that logically belong
309 * together. A client is expected to accumulate the data in all
310 * events within the frame before proceeding.
311 * @param time timestamp with millisecond granularity
312 */
313 void (*frame)(void *data,
314 struct zcr_gamepad_v1 *zcr_gamepad_v1,
315 uint32_t time);
316 };
317
318 /**
319 * @ingroup zcr_gamepad_v1_iface
320 */
321 static inline int
322 zcr_gamepad_v1_add_listener(struct zcr_gamepad_v1 *zcr_gamepad_v1,
323 const struct zcr_gamepad_v1_listener *listener, void *data)
324 {
325 return wl_proxy_add_listener((struct wl_proxy *) zcr_gamepad_v1,
326 (void (**)(void)) listener, data);
327 }
328
329 #define ZCR_GAMEPAD_V1_DESTROY 0
330
331 /**
332 * @ingroup iface_zcr_gamepad_v1
333 */
334 #define ZCR_GAMEPAD_V1_DESTROY_SINCE_VERSION 1
335
336 /** @ingroup iface_zcr_gamepad_v1 */
337 static inline void
338 zcr_gamepad_v1_set_user_data(struct zcr_gamepad_v1 *zcr_gamepad_v1, void *user_d ata)
339 {
340 wl_proxy_set_user_data((struct wl_proxy *) zcr_gamepad_v1, user_data);
341 }
342
343 /** @ingroup iface_zcr_gamepad_v1 */
344 static inline void *
345 zcr_gamepad_v1_get_user_data(struct zcr_gamepad_v1 *zcr_gamepad_v1)
346 {
347 return wl_proxy_get_user_data((struct wl_proxy *) zcr_gamepad_v1);
348 }
349
350 static inline uint32_t
351 zcr_gamepad_v1_get_version(struct zcr_gamepad_v1 *zcr_gamepad_v1)
352 {
353 return wl_proxy_get_version((struct wl_proxy *) zcr_gamepad_v1);
354 }
355
356 /**
357 * @ingroup iface_zcr_gamepad_v1
358 */
359 static inline void
360 zcr_gamepad_v1_destroy(struct zcr_gamepad_v1 *zcr_gamepad_v1)
361 {
362 wl_proxy_marshal((struct wl_proxy *) zcr_gamepad_v1,
363 ZCR_GAMEPAD_V1_DESTROY);
364
365 wl_proxy_destroy((struct wl_proxy *) zcr_gamepad_v1);
366 }
367
103 #define ZWP_GAMING_INPUT_V1_GET_GAMEPAD 0 368 #define ZWP_GAMING_INPUT_V1_GET_GAMEPAD 0
104 369
105 /** 370 /**
106 * @ingroup iface_zwp_gaming_input_v1 371 * @ingroup iface_zwp_gaming_input_v1
107 */ 372 */
108 #define ZWP_GAMING_INPUT_V1_GET_GAMEPAD_SINCE_VERSION 1 373 #define ZWP_GAMING_INPUT_V1_GET_GAMEPAD_SINCE_VERSION 1
109 374
110 /** @ingroup iface_zwp_gaming_input_v1 */ 375 /** @ingroup iface_zwp_gaming_input_v1 */
111 static inline void 376 static inline void
112 zwp_gaming_input_v1_set_user_data(struct zwp_gaming_input_v1 *zwp_gaming_input_v 1, void *user_data) 377 zwp_gaming_input_v1_set_user_data(struct zwp_gaming_input_v1 *zwp_gaming_input_v 1, void *user_data)
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 ZWP_GAMEPAD_V1_DESTROY); 570 ZWP_GAMEPAD_V1_DESTROY);
306 571
307 wl_proxy_destroy((struct wl_proxy *) zwp_gamepad_v1); 572 wl_proxy_destroy((struct wl_proxy *) zwp_gamepad_v1);
308 } 573 }
309 574
310 #ifdef __cplusplus 575 #ifdef __cplusplus
311 } 576 }
312 #endif 577 #endif
313 578
314 #endif 579 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698