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_zwp_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_zwp_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 |
22 * @section page_copyright_gaming_input_unstable_v1 Copyright | 24 * @section page_copyright_gaming_input_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_seat; | 49 struct wl_seat; |
| 50 struct zcr_gamepad_v1; |
| 51 struct zcr_gaming_input_v1; |
48 struct zwp_gamepad_v1; | 52 struct zwp_gamepad_v1; |
49 struct zwp_gaming_input_v1; | 53 struct zwp_gaming_input_v1; |
50 | 54 |
51 /** | 55 /** |
| 56 * @page page_iface_zcr_gaming_input_v1 zcr_gaming_input_v1 |
| 57 * @section page_iface_zcr_gaming_input_v1_desc Description |
| 58 * |
| 59 * A global interface to provide gaming input devices for a given seat. |
| 60 * |
| 61 * Currently only gamepad devices are supported. |
| 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_gaming_input_v1_api API |
| 72 * See @ref iface_zcr_gaming_input_v1. |
| 73 */ |
| 74 /** |
| 75 * @defgroup iface_zcr_gaming_input_v1 The zcr_gaming_input_v1 interface |
| 76 * |
| 77 * A global interface to provide gaming input devices for a given seat. |
| 78 * |
| 79 * Currently only gamepad devices are supported. |
| 80 * |
| 81 * Warning! The protocol described in this file is experimental and |
| 82 * backward incompatible changes may be made. Backward compatible changes |
| 83 * may be added together with the corresponding uinterface version bump. |
| 84 * Backward incompatible changes are done by bumping the version number in |
| 85 * the protocol and uinterface names and resetting the interface version. |
| 86 * Once the protocol is to be declared stable, the 'z' prefix and the |
| 87 * version number in the protocol and interface names are removed and the |
| 88 * interface version number is reset. |
| 89 */ |
| 90 extern const struct wl_interface zcr_gaming_input_v1_interface; |
| 91 /** |
| 92 * @page page_iface_zcr_gamepad_v1 zcr_gamepad_v1 |
| 93 * @section page_iface_zcr_gamepad_v1_desc Description |
| 94 * |
| 95 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, |
| 96 * which are reported as a normalized 'Standard Gamepad' as it is specified |
| 97 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping |
| 98 * @section page_iface_zcr_gamepad_v1_api API |
| 99 * See @ref iface_zcr_gamepad_v1. |
| 100 */ |
| 101 /** |
| 102 * @defgroup iface_zcr_gamepad_v1 The zcr_gamepad_v1 interface |
| 103 * |
| 104 * 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 |
| 106 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping |
| 107 */ |
| 108 extern const struct wl_interface zcr_gamepad_v1_interface; |
| 109 /** |
52 * @page page_iface_zwp_gaming_input_v1 zwp_gaming_input_v1 | 110 * @page page_iface_zwp_gaming_input_v1 zwp_gaming_input_v1 |
53 * @section page_iface_zwp_gaming_input_v1_desc Description | 111 * @section page_iface_zwp_gaming_input_v1_desc Description |
54 * | 112 * |
55 * A global interface to provide gaming input devices for a given seat. | 113 * A global interface to provide gaming input devices for a given seat. |
56 * | 114 * |
57 * Currently only gamepad devices are supported. | 115 * Currently only gamepad devices are supported. |
58 * | 116 * |
59 * Warning! The protocol described in this file is experimental and | 117 * Warning! The protocol described in this file is experimental and |
60 * backward incompatible changes may be made. Backward compatible changes | 118 * backward incompatible changes may be made. Backward compatible changes |
61 * may be added together with the corresponding uinterface version bump. | 119 * may be added together with the corresponding uinterface version bump. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 /** | 155 /** |
98 * @defgroup iface_zwp_gamepad_v1 The zwp_gamepad_v1 interface | 156 * @defgroup iface_zwp_gamepad_v1 The zwp_gamepad_v1 interface |
99 * | 157 * |
100 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, | 158 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, |
101 * which are reported as a normalized 'Standard Gamepad' as it is specified | 159 * which are reported as a normalized 'Standard Gamepad' as it is specified |
102 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping | 160 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping |
103 */ | 161 */ |
104 extern const struct wl_interface zwp_gamepad_v1_interface; | 162 extern const struct wl_interface zwp_gamepad_v1_interface; |
105 | 163 |
106 /** | 164 /** |
| 165 * @ingroup iface_zcr_gaming_input_v1 |
| 166 * @struct zcr_gaming_input_v1_interface |
| 167 */ |
| 168 struct zcr_gaming_input_v1_interface { |
| 169 /** |
| 170 * get gamepad device assigned to seat |
| 171 * |
| 172 * Create gamepad object. See zwp_gamepad_v1 interface for |
| 173 * details. |
| 174 */ |
| 175 void (*get_gamepad)(struct wl_client *client, |
| 176 struct wl_resource *resource, |
| 177 uint32_t id, |
| 178 struct wl_resource *seat); |
| 179 }; |
| 180 |
| 181 |
| 182 #ifndef ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM |
| 183 #define ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM |
| 184 /** |
| 185 * @ingroup iface_zcr_gamepad_v1 |
| 186 * connection state |
| 187 */ |
| 188 enum zcr_gamepad_v1_gamepad_state { |
| 189 /** |
| 190 * no gamepads are connected or on. |
| 191 */ |
| 192 ZCR_GAMEPAD_V1_GAMEPAD_STATE_OFF = 0, |
| 193 /** |
| 194 * at least one gamepad is connected. |
| 195 */ |
| 196 ZCR_GAMEPAD_V1_GAMEPAD_STATE_ON = 1, |
| 197 }; |
| 198 #endif /* ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM */ |
| 199 |
| 200 #ifndef ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM |
| 201 #define ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM |
| 202 /** |
| 203 * @ingroup iface_zcr_gamepad_v1 |
| 204 * physical button state |
| 205 * |
| 206 * Describes the physical state of a button that produced the button |
| 207 * event. |
| 208 */ |
| 209 enum zcr_gamepad_v1_button_state { |
| 210 /** |
| 211 * the button is not pressed |
| 212 */ |
| 213 ZCR_GAMEPAD_V1_BUTTON_STATE_RELEASED = 0, |
| 214 /** |
| 215 * the button is pressed |
| 216 */ |
| 217 ZCR_GAMEPAD_V1_BUTTON_STATE_PRESSED = 1, |
| 218 }; |
| 219 #endif /* ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM */ |
| 220 |
| 221 /** |
| 222 * @ingroup iface_zcr_gamepad_v1 |
| 223 * @struct zcr_gamepad_v1_interface |
| 224 */ |
| 225 struct zcr_gamepad_v1_interface { |
| 226 /** |
| 227 * destroy gamepad object |
| 228 * |
| 229 * |
| 230 */ |
| 231 void (*destroy)(struct wl_client *client, |
| 232 struct wl_resource *resource); |
| 233 }; |
| 234 |
| 235 #define ZCR_GAMEPAD_V1_STATE_CHANGE 0 |
| 236 #define ZCR_GAMEPAD_V1_AXIS 1 |
| 237 #define ZCR_GAMEPAD_V1_BUTTON 2 |
| 238 #define ZCR_GAMEPAD_V1_FRAME 3 |
| 239 |
| 240 /** |
| 241 * @ingroup iface_zcr_gamepad_v1 |
| 242 */ |
| 243 #define ZCR_GAMEPAD_V1_STATE_CHANGE_SINCE_VERSION 1 |
| 244 /** |
| 245 * @ingroup iface_zcr_gamepad_v1 |
| 246 */ |
| 247 #define ZCR_GAMEPAD_V1_AXIS_SINCE_VERSION 1 |
| 248 /** |
| 249 * @ingroup iface_zcr_gamepad_v1 |
| 250 */ |
| 251 #define ZCR_GAMEPAD_V1_BUTTON_SINCE_VERSION 1 |
| 252 /** |
| 253 * @ingroup iface_zcr_gamepad_v1 |
| 254 */ |
| 255 #define ZCR_GAMEPAD_V1_FRAME_SINCE_VERSION 1 |
| 256 |
| 257 /** |
| 258 * @ingroup iface_zcr_gamepad_v1 |
| 259 * Sends an state_change event to the client owning the resource. |
| 260 * @param resource_ The client's resource |
| 261 * @param state new state |
| 262 */ |
| 263 static inline void |
| 264 zcr_gamepad_v1_send_state_change(struct wl_resource *resource_, uint32_t state) |
| 265 { |
| 266 wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_STATE_CHANGE, state); |
| 267 } |
| 268 |
| 269 /** |
| 270 * @ingroup iface_zcr_gamepad_v1 |
| 271 * Sends an axis event to the client owning the resource. |
| 272 * @param resource_ The client's resource |
| 273 * @param time timestamp with millisecond granularity |
| 274 * @param axis axis that produced this event |
| 275 * @param value new value of axis |
| 276 */ |
| 277 static inline void |
| 278 zcr_gamepad_v1_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t
axis, wl_fixed_t value) |
| 279 { |
| 280 wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_AXIS, time, axis, value
); |
| 281 } |
| 282 |
| 283 /** |
| 284 * @ingroup iface_zcr_gamepad_v1 |
| 285 * Sends an button event to the client owning the resource. |
| 286 * @param resource_ The client's resource |
| 287 * @param time timestamp with millisecond granularity |
| 288 * @param button id of button |
| 289 * @param state digital state of the button |
| 290 * @param analog analog value of the button |
| 291 */ |
| 292 static inline void |
| 293 zcr_gamepad_v1_send_button(struct wl_resource *resource_, uint32_t time, uint32_
t button, uint32_t state, wl_fixed_t analog) |
| 294 { |
| 295 wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_BUTTON, time, button, s
tate, analog); |
| 296 } |
| 297 |
| 298 /** |
| 299 * @ingroup iface_zcr_gamepad_v1 |
| 300 * Sends an frame event to the client owning the resource. |
| 301 * @param resource_ The client's resource |
| 302 * @param time timestamp with millisecond granularity |
| 303 */ |
| 304 static inline void |
| 305 zcr_gamepad_v1_send_frame(struct wl_resource *resource_, uint32_t time) |
| 306 { |
| 307 wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_FRAME, time); |
| 308 } |
| 309 |
| 310 /** |
107 * @ingroup iface_zwp_gaming_input_v1 | 311 * @ingroup iface_zwp_gaming_input_v1 |
108 * @struct zwp_gaming_input_v1_interface | 312 * @struct zwp_gaming_input_v1_interface |
109 */ | 313 */ |
110 struct zwp_gaming_input_v1_interface { | 314 struct zwp_gaming_input_v1_interface { |
111 /** | 315 /** |
112 * get gamepad device assigned to seat | 316 * get gamepad device assigned to seat |
113 * | 317 * |
114 * Create gamepad object. See zwp_gamepad_v1 interface for | 318 * Create gamepad object. See zwp_gamepad_v1 interface for |
115 * details. | 319 * details. |
116 */ | 320 */ |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 zwp_gamepad_v1_send_frame(struct wl_resource *resource_, uint32_t time) | 451 zwp_gamepad_v1_send_frame(struct wl_resource *resource_, uint32_t time) |
248 { | 452 { |
249 wl_resource_post_event(resource_, ZWP_GAMEPAD_V1_FRAME, time); | 453 wl_resource_post_event(resource_, ZWP_GAMEPAD_V1_FRAME, time); |
250 } | 454 } |
251 | 455 |
252 #ifdef __cplusplus | 456 #ifdef __cplusplus |
253 } | 457 } |
254 #endif | 458 #endif |
255 | 459 |
256 #endif | 460 #endif |
OLD | NEW |