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

Unified Diff: ppapi/api/ppb_gamepad.idl

Issue 165983005: Updating Gamepad API to match latest spec (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ifdef-gaurds Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/api/ppb_gamepad.idl
diff --git a/ppapi/api/ppb_gamepad.idl b/ppapi/api/ppb_gamepad.idl
index 1552fd67d7101881800ae992b129e086b1aaa6e6..d3452b991bc38566604367a00e2da5e112ed6551 100644
--- a/ppapi/api/ppb_gamepad.idl
+++ b/ppapi/api/ppb_gamepad.idl
@@ -15,9 +15,25 @@ label Chrome {
};
/**
+ * The data for one gamepad button.
+ */
+[assert_size(8)]
+struct PP_GamepadButtonSampleData {
+ /**
+ * Is the button pressed?
+ */
+ PP_Bool pressed;
+
+ /**
+ * Normalized button value, in the range [0..1].
+ */
+ float_t value;
+};
+
+/**
* The data for one gamepad device.
*/
-[assert_size(472)]
+[assert_size(632)]
struct PP_GamepadSampleData {
/**
* Number of valid elements in the |axes| array.
@@ -39,7 +55,7 @@ struct PP_GamepadSampleData {
* Normalized values for the buttons, indices valid up to |buttons_length|
* - 1. Button values range from 0..1, and are in order of importance.
*/
- float_t[32] buttons;
+ PP_GamepadButtonSampleData[32] buttons;
/**
* Monotonically increasing value that is incremented when the data have
@@ -53,6 +69,11 @@ struct PP_GamepadSampleData {
uint16_t[128] id;
/**
+ * Mapping type (for example "standard")
+ */
+ uint16_t[16] mapping;
+
+ /**
* Is there a gamepad connected at this index? If this is false, no other
* data in this structure is valid.
*/
@@ -65,7 +86,7 @@ struct PP_GamepadSampleData {
/**
* The data for all gamepads connected to the system.
*/
-[assert_size(1896)]
+[assert_size(2536)]
struct PP_GamepadsSampleData {
/**
* Number of valid elements in the |items| array.

Powered by Google App Engine
This is Rietveld 408576698