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

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 unnecessary include 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
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 Thu Jan 5 16:29:38 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 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_GamepadData_Dev, 472);
67
68 /**
69 * The data for all gamepads connected to the system.
70 */
71 struct PP_GamepadsData_Dev {
72 /**
73 * Number of valid elements in the |items| array.
74 */
75 uint32_t length;
76 /**
77 * Data for an individual gamepad device connected to the system.
78 */
79 struct PP_GamepadData_Dev items[4];
80 };
81 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_GamepadsData_Dev, 1896);
82 /**
83 * @}
84 */
85
86 /**
87 * @addtogroup Interfaces
88 * @{
89 */
90 /**
91 * The <code>PPB_Gamepad_Dev</code> interface allows retrieving data from
92 * gamepad/joystick devices that are connected to the system.
93 */
94 struct PPB_Gamepad_Dev {
95 /**
96 * Samples the current state of the connected gamepads.
97 */
98 void (*SampleGamepads)(PP_Instance instance,
99 struct PP_GamepadsData_Dev* data);
100 };
101 /**
102 * @}
103 */
104
105 #endif /* PPAPI_C_DEV_PPB_GAMEPAD_DEV_H_ */
106
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698