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

Side by Side Diff: ppapi/c/dev/ppb_gamepad_dev.h

Issue 9085027: Pepper gamepad support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove hardcoded size assert in favour of matching webkit size assert Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/api/dev/ppb_gamepad_dev.idl ('k') | ppapi/examples/gamepad/gamepad.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 /* From dev/ppb_gamepad_dev.idl modified Mon Jan 9 13:16:43 2012. */
7
8 #ifndef PPAPI_C_DEV_PPB_GAMEPAD_DEV_H_
9 #define PPAPI_C_DEV_PPB_GAMEPAD_DEV_H_
10
11 #include "ppapi/c/pp_instance.h"
12 #include "ppapi/c/pp_macros.h"
13 #include "ppapi/c/pp_stdint.h"
14
15 #define PPB_GAMEPAD_DEV_INTERFACE_0_1 "PPB_Gamepad(Dev);0.1"
16 #define PPB_GAMEPAD_DEV_INTERFACE PPB_GAMEPAD_DEV_INTERFACE_0_1
17
18 /**
19 * @file
20 * This file defines the <code>PPB_Gamepad_Dev</code> interface, which
21 * provides access to gamepad devices.
22 */
23
24
25 /**
26 * @addtogroup Structs
27 * @{
28 */
29 /**
30 * The data for one gamepad device.
31 */
32 struct PP_GamepadData_Dev {
33 /**
34 * Is there a gamepad connected at this index? If this is false, no other
35 * data in this structure is valid.
36 */
37 char connected;
38 /**
39 * String identifier for the type of device/manufacturer.
40 */
41 uint16_t id[128];
42 /**
43 * Monotonically increasing value that is incremented when the data have
44 * been updated.
45 */
46 uint64_t timestamp;
47 /**
48 * Number of valid elements in the |axes| array.
49 */
50 uint32_t axes_length;
51 /**
52 * Normalized values for the axes, indices valid up to |axesLength|-1. Axis
53 * values range from -1..1, and are in order of "importance".
54 */
55 float axes[16];
56 /**
57 * Number of valid elements in the |buttons| array.
58 */
59 uint32_t buttons_length;
60 /**
61 * Normalized values for the buttons, indices valid up to |buttonsLength|
62 * - 1. Button values range from 0..1, and are in order of importance.
63 */
64 float buttons[32];
65 };
66
67 /**
68 * The data for all gamepads connected to the system.
69 */
70 struct PP_GamepadsData_Dev {
71 /**
72 * Number of valid elements in the |items| array.
73 */
74 uint32_t length;
75 /**
76 * Data for an individual gamepad device connected to the system.
77 */
78 struct PP_GamepadData_Dev items[4];
79 };
80 /**
81 * @}
82 */
83
84 /**
85 * @addtogroup Interfaces
86 * @{
87 */
88 /**
89 * The <code>PPB_Gamepad_Dev</code> interface allows retrieving data from
90 * gamepad/joystick devices that are connected to the system.
91 */
92 struct PPB_Gamepad_Dev_0_1 {
93 /**
94 * Samples the current state of the connected gamepads.
95 */
96 void (*SampleGamepads)(PP_Instance instance,
97 struct PP_GamepadsData_Dev* data);
98 };
99
100 typedef struct PPB_Gamepad_Dev_0_1 PPB_Gamepad_Dev;
101 /**
102 * @}
103 */
104
105 #endif /* PPAPI_C_DEV_PPB_GAMEPAD_DEV_H_ */
106
OLDNEW
« no previous file with comments | « ppapi/api/dev/ppb_gamepad_dev.idl ('k') | ppapi/examples/gamepad/gamepad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698