OLD | NEW |
1 /* Generated by wayland-scanner 1.11.0 */ | 1 /* Generated by wayland-scanner 1.11.0 */ |
2 | 2 |
3 #ifndef GAMING_INPUT_UNSTABLE_V1_SERVER_PROTOCOL_H | 3 #ifndef GAMING_INPUT_UNSTABLE_V1_SERVER_PROTOCOL_H |
4 #define GAMING_INPUT_UNSTABLE_V1_SERVER_PROTOCOL_H | 4 #define GAMING_INPUT_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_gaming_input_unstable_v1 The gaming_input_unstable_v1 protocol | 18 * @page page_gaming_input_unstable_v1 The gaming_input_unstable_v1 protocol |
19 * @section page_ifaces_gaming_input_unstable_v1 Interfaces | 19 * @section page_ifaces_gaming_input_unstable_v1 Interfaces |
20 * - @subpage page_iface_zcr_gaming_input_v1 - extends wl_seat with gaming input
devices | 20 * - @subpage page_iface_zcr_gaming_input_v1 - extends wl_seat with gaming input
devices |
21 * - @subpage page_iface_zcr_gamepad_v1 - gamepad input device | 21 * - @subpage page_iface_zcr_gamepad_v1 - gamepad input device |
22 * - @subpage page_iface_zwp_gaming_input_v1 - DEPRECATED | |
23 * - @subpage page_iface_zwp_gamepad_v1 - DEPRECATED | |
24 * @section page_copyright_gaming_input_unstable_v1 Copyright | 22 * @section page_copyright_gaming_input_unstable_v1 Copyright |
25 * <pre> | 23 * <pre> |
26 * | 24 * |
27 * Copyright 2016 The Chromium Authors. | 25 * Copyright 2016 The Chromium Authors. |
28 * | 26 * |
29 * Permission is hereby granted, free of charge, to any person obtaining a | 27 * Permission is hereby granted, free of charge, to any person obtaining a |
30 * copy of this software and associated documentation files (the "Software"), | 28 * copy of this software and associated documentation files (the "Software"), |
31 * to deal in the Software without restriction, including without limitation | 29 * to deal in the Software without restriction, including without limitation |
32 * the rights to use, copy, modify, merge, publish, distribute, sublicense, | 30 * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
33 * and/or sell copies of the Software, and to permit persons to whom the | 31 * and/or sell copies of the Software, and to permit persons to whom the |
34 * Software is furnished to do so, subject to the following conditions: | 32 * Software is furnished to do so, subject to the following conditions: |
35 * | 33 * |
36 * The above copyright notice and this permission notice (including the next | 34 * The above copyright notice and this permission notice (including the next |
37 * paragraph) shall be included in all copies or substantial portions of the | 35 * paragraph) shall be included in all copies or substantial portions of the |
38 * Software. | 36 * Software. |
39 * | 37 * |
40 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
41 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 39 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
42 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | 40 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
43 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 41 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
44 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 42 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
45 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 43 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
46 * DEALINGS IN THE SOFTWARE. | 44 * DEALINGS IN THE SOFTWARE. |
47 * </pre> | 45 * </pre> |
48 */ | 46 */ |
49 struct wl_seat; | 47 struct wl_seat; |
50 struct zcr_gamepad_v1; | 48 struct zcr_gamepad_v1; |
51 struct zcr_gaming_input_v1; | 49 struct zcr_gaming_input_v1; |
52 struct zwp_gamepad_v1; | |
53 struct zwp_gaming_input_v1; | |
54 | 50 |
55 /** | 51 /** |
56 * @page page_iface_zcr_gaming_input_v1 zcr_gaming_input_v1 | 52 * @page page_iface_zcr_gaming_input_v1 zcr_gaming_input_v1 |
57 * @section page_iface_zcr_gaming_input_v1_desc Description | 53 * @section page_iface_zcr_gaming_input_v1_desc Description |
58 * | 54 * |
59 * A global interface to provide gaming input devices for a given seat. | 55 * A global interface to provide gaming input devices for a given seat. |
60 * | 56 * |
61 * Currently only gamepad devices are supported. | 57 * Currently only gamepad devices are supported. |
62 * | 58 * |
63 * Warning! The protocol described in this file is experimental and | 59 * Warning! The protocol described in this file is experimental and |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 * See @ref iface_zcr_gamepad_v1. | 95 * See @ref iface_zcr_gamepad_v1. |
100 */ | 96 */ |
101 /** | 97 /** |
102 * @defgroup iface_zcr_gamepad_v1 The zcr_gamepad_v1 interface | 98 * @defgroup iface_zcr_gamepad_v1 The zcr_gamepad_v1 interface |
103 * | 99 * |
104 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, | 100 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, |
105 * which are reported as a normalized 'Standard Gamepad' as it is specified | 101 * which are reported as a normalized 'Standard Gamepad' as it is specified |
106 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping | 102 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping |
107 */ | 103 */ |
108 extern const struct wl_interface zcr_gamepad_v1_interface; | 104 extern const struct wl_interface zcr_gamepad_v1_interface; |
109 /** | |
110 * @page page_iface_zwp_gaming_input_v1 zwp_gaming_input_v1 | |
111 * @section page_iface_zwp_gaming_input_v1_desc Description | |
112 * | |
113 * A global interface to provide gaming input devices for a given seat. | |
114 * | |
115 * Currently only gamepad devices are supported. | |
116 * | |
117 * Warning! The protocol described in this file is experimental and | |
118 * backward incompatible changes may be made. Backward compatible changes | |
119 * may be added together with the corresponding uinterface version bump. | |
120 * Backward incompatible changes are done by bumping the version number in | |
121 * the protocol and uinterface names and resetting the interface version. | |
122 * Once the protocol is to be declared stable, the 'z' prefix and the | |
123 * version number in the protocol and interface names are removed and the | |
124 * interface version number is reset. | |
125 * @section page_iface_zwp_gaming_input_v1_api API | |
126 * See @ref iface_zwp_gaming_input_v1. | |
127 */ | |
128 /** | |
129 * @defgroup iface_zwp_gaming_input_v1 The zwp_gaming_input_v1 interface | |
130 * | |
131 * A global interface to provide gaming input devices for a given seat. | |
132 * | |
133 * Currently only gamepad devices are supported. | |
134 * | |
135 * Warning! The protocol described in this file is experimental and | |
136 * backward incompatible changes may be made. Backward compatible changes | |
137 * may be added together with the corresponding uinterface version bump. | |
138 * Backward incompatible changes are done by bumping the version number in | |
139 * the protocol and uinterface names and resetting the interface version. | |
140 * Once the protocol is to be declared stable, the 'z' prefix and the | |
141 * version number in the protocol and interface names are removed and the | |
142 * interface version number is reset. | |
143 */ | |
144 extern const struct wl_interface zwp_gaming_input_v1_interface; | |
145 /** | |
146 * @page page_iface_zwp_gamepad_v1 zwp_gamepad_v1 | |
147 * @section page_iface_zwp_gamepad_v1_desc Description | |
148 * | |
149 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, | |
150 * which are reported as a normalized 'Standard Gamepad' as it is specified | |
151 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping | |
152 * @section page_iface_zwp_gamepad_v1_api API | |
153 * See @ref iface_zwp_gamepad_v1. | |
154 */ | |
155 /** | |
156 * @defgroup iface_zwp_gamepad_v1 The zwp_gamepad_v1 interface | |
157 * | |
158 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, | |
159 * which are reported as a normalized 'Standard Gamepad' as it is specified | |
160 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping | |
161 */ | |
162 extern const struct wl_interface zwp_gamepad_v1_interface; | |
163 | 105 |
164 /** | 106 /** |
165 * @ingroup iface_zcr_gaming_input_v1 | 107 * @ingroup iface_zcr_gaming_input_v1 |
166 * @struct zcr_gaming_input_v1_interface | 108 * @struct zcr_gaming_input_v1_interface |
167 */ | 109 */ |
168 struct zcr_gaming_input_v1_interface { | 110 struct zcr_gaming_input_v1_interface { |
169 /** | 111 /** |
170 * get gamepad device assigned to seat | 112 * get gamepad device assigned to seat |
171 * | 113 * |
172 * Create gamepad object. See zwp_gamepad_v1 interface for | 114 * Create gamepad object. See zwp_gamepad_v1 interface for |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 * Sends an frame event to the client owning the resource. | 242 * Sends an frame event to the client owning the resource. |
301 * @param resource_ The client's resource | 243 * @param resource_ The client's resource |
302 * @param time timestamp with millisecond granularity | 244 * @param time timestamp with millisecond granularity |
303 */ | 245 */ |
304 static inline void | 246 static inline void |
305 zcr_gamepad_v1_send_frame(struct wl_resource *resource_, uint32_t time) | 247 zcr_gamepad_v1_send_frame(struct wl_resource *resource_, uint32_t time) |
306 { | 248 { |
307 wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_FRAME, time); | 249 wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_FRAME, time); |
308 } | 250 } |
309 | 251 |
310 /** | |
311 * @ingroup iface_zwp_gaming_input_v1 | |
312 * @struct zwp_gaming_input_v1_interface | |
313 */ | |
314 struct zwp_gaming_input_v1_interface { | |
315 /** | |
316 * get gamepad device assigned to seat | |
317 * | |
318 * Create gamepad object. See zwp_gamepad_v1 interface for | |
319 * details. | |
320 */ | |
321 void (*get_gamepad)(struct wl_client *client, | |
322 struct wl_resource *resource, | |
323 uint32_t id, | |
324 struct wl_resource *seat); | |
325 }; | |
326 | |
327 | |
328 #ifndef ZWP_GAMEPAD_V1_GAMEPAD_STATE_ENUM | |
329 #define ZWP_GAMEPAD_V1_GAMEPAD_STATE_ENUM | |
330 /** | |
331 * @ingroup iface_zwp_gamepad_v1 | |
332 * connection state | |
333 */ | |
334 enum zwp_gamepad_v1_gamepad_state { | |
335 /** | |
336 * no gamepads are connected or on. | |
337 */ | |
338 ZWP_GAMEPAD_V1_GAMEPAD_STATE_OFF = 0, | |
339 /** | |
340 * at least one gamepad is connected. | |
341 */ | |
342 ZWP_GAMEPAD_V1_GAMEPAD_STATE_ON = 1, | |
343 }; | |
344 #endif /* ZWP_GAMEPAD_V1_GAMEPAD_STATE_ENUM */ | |
345 | |
346 #ifndef ZWP_GAMEPAD_V1_BUTTON_STATE_ENUM | |
347 #define ZWP_GAMEPAD_V1_BUTTON_STATE_ENUM | |
348 /** | |
349 * @ingroup iface_zwp_gamepad_v1 | |
350 * physical button state | |
351 * | |
352 * Describes the physical state of a button that produced the button | |
353 * event. | |
354 */ | |
355 enum zwp_gamepad_v1_button_state { | |
356 /** | |
357 * the button is not pressed | |
358 */ | |
359 ZWP_GAMEPAD_V1_BUTTON_STATE_RELEASED = 0, | |
360 /** | |
361 * the button is pressed | |
362 */ | |
363 ZWP_GAMEPAD_V1_BUTTON_STATE_PRESSED = 1, | |
364 }; | |
365 #endif /* ZWP_GAMEPAD_V1_BUTTON_STATE_ENUM */ | |
366 | |
367 /** | |
368 * @ingroup iface_zwp_gamepad_v1 | |
369 * @struct zwp_gamepad_v1_interface | |
370 */ | |
371 struct zwp_gamepad_v1_interface { | |
372 /** | |
373 * destroy gamepad object | |
374 * | |
375 * | |
376 */ | |
377 void (*destroy)(struct wl_client *client, | |
378 struct wl_resource *resource); | |
379 }; | |
380 | |
381 #define ZWP_GAMEPAD_V1_STATE_CHANGE 0 | |
382 #define ZWP_GAMEPAD_V1_AXIS 1 | |
383 #define ZWP_GAMEPAD_V1_BUTTON 2 | |
384 #define ZWP_GAMEPAD_V1_FRAME 3 | |
385 | |
386 /** | |
387 * @ingroup iface_zwp_gamepad_v1 | |
388 */ | |
389 #define ZWP_GAMEPAD_V1_STATE_CHANGE_SINCE_VERSION 1 | |
390 /** | |
391 * @ingroup iface_zwp_gamepad_v1 | |
392 */ | |
393 #define ZWP_GAMEPAD_V1_AXIS_SINCE_VERSION 1 | |
394 /** | |
395 * @ingroup iface_zwp_gamepad_v1 | |
396 */ | |
397 #define ZWP_GAMEPAD_V1_BUTTON_SINCE_VERSION 1 | |
398 /** | |
399 * @ingroup iface_zwp_gamepad_v1 | |
400 */ | |
401 #define ZWP_GAMEPAD_V1_FRAME_SINCE_VERSION 1 | |
402 | |
403 /** | |
404 * @ingroup iface_zwp_gamepad_v1 | |
405 * Sends an state_change event to the client owning the resource. | |
406 * @param resource_ The client's resource | |
407 * @param state new state | |
408 */ | |
409 static inline void | |
410 zwp_gamepad_v1_send_state_change(struct wl_resource *resource_, uint32_t state) | |
411 { | |
412 wl_resource_post_event(resource_, ZWP_GAMEPAD_V1_STATE_CHANGE, state); | |
413 } | |
414 | |
415 /** | |
416 * @ingroup iface_zwp_gamepad_v1 | |
417 * Sends an axis event to the client owning the resource. | |
418 * @param resource_ The client's resource | |
419 * @param time timestamp with millisecond granularity | |
420 * @param axis axis that produced this event | |
421 * @param value new value of axis | |
422 */ | |
423 static inline void | |
424 zwp_gamepad_v1_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t
axis, wl_fixed_t value) | |
425 { | |
426 wl_resource_post_event(resource_, ZWP_GAMEPAD_V1_AXIS, time, axis, value
); | |
427 } | |
428 | |
429 /** | |
430 * @ingroup iface_zwp_gamepad_v1 | |
431 * Sends an button event to the client owning the resource. | |
432 * @param resource_ The client's resource | |
433 * @param time timestamp with millisecond granularity | |
434 * @param button id of button | |
435 * @param state digital state of the button | |
436 * @param analog analog value of the button | |
437 */ | |
438 static inline void | |
439 zwp_gamepad_v1_send_button(struct wl_resource *resource_, uint32_t time, uint32_
t button, uint32_t state, wl_fixed_t analog) | |
440 { | |
441 wl_resource_post_event(resource_, ZWP_GAMEPAD_V1_BUTTON, time, button, s
tate, analog); | |
442 } | |
443 | |
444 /** | |
445 * @ingroup iface_zwp_gamepad_v1 | |
446 * Sends an frame event to the client owning the resource. | |
447 * @param resource_ The client's resource | |
448 * @param time timestamp with millisecond granularity | |
449 */ | |
450 static inline void | |
451 zwp_gamepad_v1_send_frame(struct wl_resource *resource_, uint32_t time) | |
452 { | |
453 wl_resource_post_event(resource_, ZWP_GAMEPAD_V1_FRAME, time); | |
454 } | |
455 | |
456 #ifdef __cplusplus | 252 #ifdef __cplusplus |
457 } | 253 } |
458 #endif | 254 #endif |
459 | 255 |
460 #endif | 256 #endif |
OLD | NEW |