Chromium Code Reviews| Index: device/gamepad/public/interfaces/gamepad.mojom |
| diff --git a/device/gamepad/public/interfaces/gamepad.mojom b/device/gamepad/public/interfaces/gamepad.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..dc12aab9de905127ce94c1ca66468dc87a77eeef |
| --- /dev/null |
| +++ b/device/gamepad/public/interfaces/gamepad.mojom |
| @@ -0,0 +1,54 @@ |
| +module device.mojom; |
|
yzshen1
2016/11/14 21:13:17
Please add the copyright boilerplate.
ke.he
2016/11/15 10:55:18
Done.
|
| + |
| +struct WebGamepadQuaternion{ |
|
blundell
2016/11/14 12:33:16
nit: "Web" is a Blink-ism that shouldn't be part o
ke.he
2016/11/15 10:55:18
I changed all the "WebGamepadxxx" into "Gamepadxxx
|
| + bool notNull; |
|
yzshen1
2016/11/14 21:13:17
please use naming format like this: not_null. (Her
yzshen1
2016/11/14 21:13:17
Could we use the nullable feature instead of an ex
ke.he
2016/11/15 10:55:18
Done.
ke.he
2016/11/15 10:55:18
Oh, it is not correct to just copy those webxxx st
|
| + float x; |
| + float y; |
| + float z; |
| + float w; |
| +}; |
| + |
| +struct WebGamepadVector{ |
| + bool notNull; |
| + float x; |
| + float y; |
| + float z; |
| +}; |
| + |
| +struct WebGamepadButton{ |
| + bool pressed; |
| + bool touched; |
| + double value; |
| +}; |
| + |
| +struct WebGamepadPose{ |
| + bool notNull; |
| + bool hasOrientation; |
| + bool hasPosition; |
| + WebGamepadQuaternion orientation; |
| + WebGamepadVector position; |
| + WebGamepadVector angularVelocity; |
| + WebGamepadVector linearVelocity; |
| + WebGamepadVector angularAcceleration; |
| + WebGamepadVector linearAcceleration; |
| +}; |
| + |
| +enum WebGamepadHand { |
| + GamepadHandNone = 0, |
| + GamepadHandLeft = 1, |
| + GamepadHandRight = 2 |
| +}; |
| + |
| +struct WebGamepad { |
| + bool connected; |
| + array<uint16, 128> id; //blink::WebGamepad::idLengthCap = 128 |
| + uint64 timestamp; |
| + uint32 axesLength; |
| + array<double, 16> axes; //blink::WebGamepad::axesLengthCap = 16 |
| + uint32 buttonsLength; |
| + array<WebGamepadButton, 32> buttons; //blink::WebGamepad::buttonLengthCap = 32 |
| + array<uint16, 16> mapping; //blink::WebGamepad::mappingLengthCap = 16 |
| + WebGamepadPose pose; |
| + WebGamepadHand hand; |
| + uint32 displayId; |
| +}; |