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

Side by Side Diff: third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h

Issue 2352563002: third_party: Remove deprecated zwp wayland interfaces. (Closed)
Patch Set: rebase Created 4 years, 2 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_zcr_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_zcr_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
21 * @section page_copyright_gaming_input_unstable_v1 Copyright 19 * @section page_copyright_gaming_input_unstable_v1 Copyright
22 * <pre> 20 * <pre>
23 * 21 *
24 * Copyright 2016 The Chromium Authors. 22 * Copyright 2016 The Chromium Authors.
25 * 23 *
26 * Permission is hereby granted, free of charge, to any person obtaining a 24 * Permission is hereby granted, free of charge, to any person obtaining a
27 * copy of this software and associated documentation files (the "Software"), 25 * copy of this software and associated documentation files (the "Software"),
28 * to deal in the Software without restriction, including without limitation 26 * to deal in the Software without restriction, including without limitation
29 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 27 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
30 * and/or sell copies of the Software, and to permit persons to whom the 28 * and/or sell copies of the Software, and to permit persons to whom the
31 * Software is furnished to do so, subject to the following conditions: 29 * Software is furnished to do so, subject to the following conditions:
32 * 30 *
33 * The above copyright notice and this permission notice (including the next 31 * The above copyright notice and this permission notice (including the next
34 * paragraph) shall be included in all copies or substantial portions of the 32 * paragraph) shall be included in all copies or substantial portions of the
35 * Software. 33 * Software.
36 * 34 *
37 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
40 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
43 * DEALINGS IN THE SOFTWARE. 41 * DEALINGS IN THE SOFTWARE.
44 * </pre> 42 * </pre>
45 */ 43 */
46 struct wl_seat; 44 struct wl_seat;
47 struct zcr_gamepad_v1; 45 struct zcr_gamepad_v1;
48 struct zcr_gaming_input_v1; 46 struct zcr_gaming_input_v1;
49 struct zwp_gamepad_v1;
50 struct zwp_gaming_input_v1;
51 47
52 /** 48 /**
53 * @page page_iface_zcr_gaming_input_v1 zcr_gaming_input_v1 49 * @page page_iface_zcr_gaming_input_v1 zcr_gaming_input_v1
54 * @section page_iface_zcr_gaming_input_v1_desc Description 50 * @section page_iface_zcr_gaming_input_v1_desc Description
55 * 51 *
56 * A global interface to provide gaming input devices for a given seat. 52 * A global interface to provide gaming input devices for a given seat.
57 * 53 *
58 * Currently only gamepad devices are supported. 54 * Currently only gamepad devices are supported.
59 * 55 *
60 * Warning! The protocol described in this file is experimental and 56 * Warning! The protocol described in this file is experimental and
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 * See @ref iface_zcr_gamepad_v1. 92 * See @ref iface_zcr_gamepad_v1.
97 */ 93 */
98 /** 94 /**
99 * @defgroup iface_zcr_gamepad_v1 The zcr_gamepad_v1 interface 95 * @defgroup iface_zcr_gamepad_v1 The zcr_gamepad_v1 interface
100 * 96 *
101 * The zwp_gamepad_v1 interface represents one or more gamepad input devices, 97 * 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 98 * 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 99 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
104 */ 100 */
105 extern const struct wl_interface zcr_gamepad_v1_interface; 101 extern const struct wl_interface zcr_gamepad_v1_interface;
106 /**
107 * @page page_iface_zwp_gaming_input_v1 zwp_gaming_input_v1
108 * @section page_iface_zwp_gaming_input_v1_desc Description
109 *
110 * A global interface to provide gaming input devices for a given seat.
111 *
112 * Currently only gamepad devices are supported.
113 *
114 * Warning! The protocol described in this file is experimental and
115 * backward incompatible changes may be made. Backward compatible changes
116 * may be added together with the corresponding uinterface version bump.
117 * Backward incompatible changes are done by bumping the version number in
118 * the protocol and uinterface names and resetting the interface version.
119 * Once the protocol is to be declared stable, the 'z' prefix and the
120 * version number in the protocol and interface names are removed and the
121 * interface version number is reset.
122 * @section page_iface_zwp_gaming_input_v1_api API
123 * See @ref iface_zwp_gaming_input_v1.
124 */
125 /**
126 * @defgroup iface_zwp_gaming_input_v1 The zwp_gaming_input_v1 interface
127 *
128 * A global interface to provide gaming input devices for a given seat.
129 *
130 * Currently only gamepad devices are supported.
131 *
132 * Warning! The protocol described in this file is experimental and
133 * backward incompatible changes may be made. Backward compatible changes
134 * may be added together with the corresponding uinterface version bump.
135 * Backward incompatible changes are done by bumping the version number in
136 * the protocol and uinterface names and resetting the interface version.
137 * Once the protocol is to be declared stable, the 'z' prefix and the
138 * version number in the protocol and interface names are removed and the
139 * interface version number is reset.
140 */
141 extern const struct wl_interface zwp_gaming_input_v1_interface;
142 /**
143 * @page page_iface_zwp_gamepad_v1 zwp_gamepad_v1
144 * @section page_iface_zwp_gamepad_v1_desc Description
145 *
146 * The zwp_gamepad_v1 interface represents one or more gamepad input devices,
147 * which are reported as a normalized 'Standard Gamepad' as it is specified
148 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
149 * @section page_iface_zwp_gamepad_v1_api API
150 * See @ref iface_zwp_gamepad_v1.
151 */
152 /**
153 * @defgroup iface_zwp_gamepad_v1 The zwp_gamepad_v1 interface
154 *
155 * The zwp_gamepad_v1 interface represents one or more gamepad input devices,
156 * which are reported as a normalized 'Standard Gamepad' as it is specified
157 * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
158 */
159 extern const struct wl_interface zwp_gamepad_v1_interface;
160 102
161 #define ZCR_GAMING_INPUT_V1_GET_GAMEPAD 0 103 #define ZCR_GAMING_INPUT_V1_GET_GAMEPAD 0
162 104
163 /** 105 /**
164 * @ingroup iface_zcr_gaming_input_v1 106 * @ingroup iface_zcr_gaming_input_v1
165 */ 107 */
166 #define ZCR_GAMING_INPUT_V1_GET_GAMEPAD_SINCE_VERSION 1 108 #define ZCR_GAMING_INPUT_V1_GET_GAMEPAD_SINCE_VERSION 1
167 109
168 /** @ingroup iface_zcr_gaming_input_v1 */ 110 /** @ingroup iface_zcr_gaming_input_v1 */
169 static inline void 111 static inline void
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 */ 300 */
359 static inline void 301 static inline void
360 zcr_gamepad_v1_destroy(struct zcr_gamepad_v1 *zcr_gamepad_v1) 302 zcr_gamepad_v1_destroy(struct zcr_gamepad_v1 *zcr_gamepad_v1)
361 { 303 {
362 wl_proxy_marshal((struct wl_proxy *) zcr_gamepad_v1, 304 wl_proxy_marshal((struct wl_proxy *) zcr_gamepad_v1,
363 ZCR_GAMEPAD_V1_DESTROY); 305 ZCR_GAMEPAD_V1_DESTROY);
364 306
365 wl_proxy_destroy((struct wl_proxy *) zcr_gamepad_v1); 307 wl_proxy_destroy((struct wl_proxy *) zcr_gamepad_v1);
366 } 308 }
367 309
368 #define ZWP_GAMING_INPUT_V1_GET_GAMEPAD 0
369
370 /**
371 * @ingroup iface_zwp_gaming_input_v1
372 */
373 #define ZWP_GAMING_INPUT_V1_GET_GAMEPAD_SINCE_VERSION 1
374
375 /** @ingroup iface_zwp_gaming_input_v1 */
376 static inline void
377 zwp_gaming_input_v1_set_user_data(struct zwp_gaming_input_v1 *zwp_gaming_input_v 1, void *user_data)
378 {
379 wl_proxy_set_user_data((struct wl_proxy *) zwp_gaming_input_v1, user_dat a);
380 }
381
382 /** @ingroup iface_zwp_gaming_input_v1 */
383 static inline void *
384 zwp_gaming_input_v1_get_user_data(struct zwp_gaming_input_v1 *zwp_gaming_input_v 1)
385 {
386 return wl_proxy_get_user_data((struct wl_proxy *) zwp_gaming_input_v1);
387 }
388
389 static inline uint32_t
390 zwp_gaming_input_v1_get_version(struct zwp_gaming_input_v1 *zwp_gaming_input_v1)
391 {
392 return wl_proxy_get_version((struct wl_proxy *) zwp_gaming_input_v1);
393 }
394
395 /** @ingroup iface_zwp_gaming_input_v1 */
396 static inline void
397 zwp_gaming_input_v1_destroy(struct zwp_gaming_input_v1 *zwp_gaming_input_v1)
398 {
399 wl_proxy_destroy((struct wl_proxy *) zwp_gaming_input_v1);
400 }
401
402 /**
403 * @ingroup iface_zwp_gaming_input_v1
404 *
405 * Create gamepad object. See zwp_gamepad_v1 interface for details.
406 */
407 static inline struct zwp_gamepad_v1 *
408 zwp_gaming_input_v1_get_gamepad(struct zwp_gaming_input_v1 *zwp_gaming_input_v1, struct wl_seat *seat)
409 {
410 struct wl_proxy *id;
411
412 id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_gaming_input_v 1,
413 ZWP_GAMING_INPUT_V1_GET_GAMEPAD, &zwp_gamepad_v1_interf ace, NULL, seat);
414
415 return (struct zwp_gamepad_v1 *) id;
416 }
417
418 #ifndef ZWP_GAMEPAD_V1_GAMEPAD_STATE_ENUM
419 #define ZWP_GAMEPAD_V1_GAMEPAD_STATE_ENUM
420 /**
421 * @ingroup iface_zwp_gamepad_v1
422 * connection state
423 */
424 enum zwp_gamepad_v1_gamepad_state {
425 /**
426 * no gamepads are connected or on.
427 */
428 ZWP_GAMEPAD_V1_GAMEPAD_STATE_OFF = 0,
429 /**
430 * at least one gamepad is connected.
431 */
432 ZWP_GAMEPAD_V1_GAMEPAD_STATE_ON = 1,
433 };
434 #endif /* ZWP_GAMEPAD_V1_GAMEPAD_STATE_ENUM */
435
436 #ifndef ZWP_GAMEPAD_V1_BUTTON_STATE_ENUM
437 #define ZWP_GAMEPAD_V1_BUTTON_STATE_ENUM
438 /**
439 * @ingroup iface_zwp_gamepad_v1
440 * physical button state
441 *
442 * Describes the physical state of a button that produced the button
443 * event.
444 */
445 enum zwp_gamepad_v1_button_state {
446 /**
447 * the button is not pressed
448 */
449 ZWP_GAMEPAD_V1_BUTTON_STATE_RELEASED = 0,
450 /**
451 * the button is pressed
452 */
453 ZWP_GAMEPAD_V1_BUTTON_STATE_PRESSED = 1,
454 };
455 #endif /* ZWP_GAMEPAD_V1_BUTTON_STATE_ENUM */
456
457 /**
458 * @ingroup iface_zwp_gamepad_v1
459 * @struct zwp_gamepad_v1_listener
460 */
461 struct zwp_gamepad_v1_listener {
462 /**
463 * state change event
464 *
465 * Notification that this seat's connection state has changed.
466 * @param state new state
467 */
468 void (*state_change)(void *data,
469 struct zwp_gamepad_v1 *zwp_gamepad_v1,
470 uint32_t state);
471 /**
472 * axis change event
473 *
474 * Notification of axis change.
475 *
476 * The axis id specifies which axis has changed as defined by the
477 * W3C 'Standard Gamepad'.
478 *
479 * The value is calibrated and normalized to the -1 to 1 range.
480 * @param time timestamp with millisecond granularity
481 * @param axis axis that produced this event
482 * @param value new value of axis
483 */
484 void (*axis)(void *data,
485 struct zwp_gamepad_v1 *zwp_gamepad_v1,
486 uint32_t time,
487 uint32_t axis,
488 wl_fixed_t value);
489 /**
490 * Gamepad button changed
491 *
492 * Notification of button change.
493 *
494 * The button id specifies which button has changed as defined by
495 * the W3C 'Standard Gamepad'.
496 *
497 * A button can have a digital and an analog value. The analog
498 * value is normalized to a 0 to 1 range. If a button does not
499 * provide an analog value, it will be derived from the digital
500 * state.
501 * @param time timestamp with millisecond granularity
502 * @param button id of button
503 * @param state digital state of the button
504 * @param analog analog value of the button
505 */
506 void (*button)(void *data,
507 struct zwp_gamepad_v1 *zwp_gamepad_v1,
508 uint32_t time,
509 uint32_t button,
510 uint32_t state,
511 wl_fixed_t analog);
512 /**
513 * Notifies end of a series of gamepad changes.
514 *
515 * Indicates the end of a set of events that logically belong
516 * together. A client is expected to accumulate the data in all
517 * events within the frame before proceeding.
518 * @param time timestamp with millisecond granularity
519 */
520 void (*frame)(void *data,
521 struct zwp_gamepad_v1 *zwp_gamepad_v1,
522 uint32_t time);
523 };
524
525 /**
526 * @ingroup zwp_gamepad_v1_iface
527 */
528 static inline int
529 zwp_gamepad_v1_add_listener(struct zwp_gamepad_v1 *zwp_gamepad_v1,
530 const struct zwp_gamepad_v1_listener *listener, void *data)
531 {
532 return wl_proxy_add_listener((struct wl_proxy *) zwp_gamepad_v1,
533 (void (**)(void)) listener, data);
534 }
535
536 #define ZWP_GAMEPAD_V1_DESTROY 0
537
538 /**
539 * @ingroup iface_zwp_gamepad_v1
540 */
541 #define ZWP_GAMEPAD_V1_DESTROY_SINCE_VERSION 1
542
543 /** @ingroup iface_zwp_gamepad_v1 */
544 static inline void
545 zwp_gamepad_v1_set_user_data(struct zwp_gamepad_v1 *zwp_gamepad_v1, void *user_d ata)
546 {
547 wl_proxy_set_user_data((struct wl_proxy *) zwp_gamepad_v1, user_data);
548 }
549
550 /** @ingroup iface_zwp_gamepad_v1 */
551 static inline void *
552 zwp_gamepad_v1_get_user_data(struct zwp_gamepad_v1 *zwp_gamepad_v1)
553 {
554 return wl_proxy_get_user_data((struct wl_proxy *) zwp_gamepad_v1);
555 }
556
557 static inline uint32_t
558 zwp_gamepad_v1_get_version(struct zwp_gamepad_v1 *zwp_gamepad_v1)
559 {
560 return wl_proxy_get_version((struct wl_proxy *) zwp_gamepad_v1);
561 }
562
563 /**
564 * @ingroup iface_zwp_gamepad_v1
565 */
566 static inline void
567 zwp_gamepad_v1_destroy(struct zwp_gamepad_v1 *zwp_gamepad_v1)
568 {
569 wl_proxy_marshal((struct wl_proxy *) zwp_gamepad_v1,
570 ZWP_GAMEPAD_V1_DESTROY);
571
572 wl_proxy_destroy((struct wl_proxy *) zwp_gamepad_v1);
573 }
574
575 #ifdef __cplusplus 310 #ifdef __cplusplus
576 } 311 }
577 #endif 312 #endif
578 313
579 #endif 314 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698