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

Side by Side Diff: third_party/wayland-protocols/include/protocol/gamepads-unstable-v1-server-protocol.h

Issue 2093803002: wayland-protocols: Add gaming-input-unstable-v1 protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migration
Patch Set: Created 4 years, 5 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
(Empty)
1 /*
2 * Copyright 2016 The Chromium Authors.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24 #ifndef GAMEPADS_UNSTABLE_V1_SERVER_PROTOCOL_H
25 #define GAMEPADS_UNSTABLE_V1_SERVER_PROTOCOL_H
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #include <stdint.h>
32 #include <stddef.h>
33 #include "wayland-util.h"
34
35 struct wl_client;
36 struct wl_resource;
37
38 struct zwp_gamepads_v1;
39
40 extern const struct wl_interface zwp_gamepads_v1_interface;
41
42 /**
43 * zwp_gamepads_v1 - gamepad support
44 * @destroy: destroy gamepads object
45 *
46 * A global interface to notify the client of any gamepads connected to
47 * the server. All gamepads axes and buttons follow the W3C definition of a
48 * 'Standard Gamepad' as specified in:
49 * https://w3c.github.io/gamepad/#remapping
50 */
51 struct zwp_gamepads_v1_interface {
52 /**
53 * destroy - destroy gamepads object
54 *
55 *
56 */
57 void (*destroy)(struct wl_client *client,
58 struct wl_resource *resource);
59 };
60
61 #define ZWP_GAMEPADS_V1_CONNECTED 0
62 #define ZWP_GAMEPADS_V1_DISCONNECTED 1
63 #define ZWP_GAMEPADS_V1_AXIS 2
64 #define ZWP_GAMEPADS_V1_BUTTON 3
65 #define ZWP_GAMEPADS_V1_FRAME 4
66
67 static inline void
68 zwp_gamepads_v1_send_connected(struct wl_resource *resource_, int32_t id)
69 {
70 wl_resource_post_event(resource_, ZWP_GAMEPADS_V1_CONNECTED, id);
71 }
72
73 static inline void
74 zwp_gamepads_v1_send_disconnected(struct wl_resource *resource_, int32_t id)
75 {
76 wl_resource_post_event(resource_, ZWP_GAMEPADS_V1_DISCONNECTED, id);
77 }
78
79 static inline void
80 zwp_gamepads_v1_send_axis(struct wl_resource *resource_, int32_t id, int32_t axi s, wl_fixed_t value)
81 {
82 wl_resource_post_event(resource_, ZWP_GAMEPADS_V1_AXIS, id, axis, value) ;
83 }
84
85 static inline void
86 zwp_gamepads_v1_send_button(struct wl_resource *resource_, int32_t id, int32_t b utton, int32_t pressed, wl_fixed_t value)
87 {
88 wl_resource_post_event(resource_, ZWP_GAMEPADS_V1_BUTTON, id, button, pr essed, value);
89 }
90
91 static inline void
92 zwp_gamepads_v1_send_frame(struct wl_resource *resource_, uint32_t time)
93 {
94 wl_resource_post_event(resource_, ZWP_GAMEPADS_V1_FRAME, time);
95 }
96
97 #ifdef __cplusplus
98 }
99 #endif
100
101 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698