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..ff3cd12c538eb0627cd91f1fc66a74a6b7c1c595 |
| --- /dev/null |
| +++ b/device/gamepad/public/interfaces/gamepad.mojom |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +module device.mojom; |
| + |
| +struct GamepadQuaternion { |
| + float x; |
| + float y; |
| + float z; |
| + float w; |
| +}; |
| + |
| +struct GamepadVector { |
| + float x; |
| + float y; |
| + float z; |
| +}; |
| + |
| +struct GamepadButton { |
| + bool pressed; |
| + bool touched; |
| + double value; |
| +}; |
| + |
| +struct GamepadPose { |
| + GamepadQuaternion? orientation; |
| + GamepadVector? position; |
| + GamepadVector? angular_velocity; |
| + GamepadVector? linear_velocity; |
| + GamepadVector? angular_acceleration; |
| + GamepadVector? linear_acceleration; |
| +}; |
| + |
| +enum GamepadHand { |
| + GamepadHandNone = 0, |
| + GamepadHandLeft = 1, |
| + GamepadHandRight = 2 |
| +}; |
| + |
| +struct Gamepad { |
| + bool connected; |
| + array<uint16, 128> id; //blink::WebGamepad::idLengthCap = 128 |
| + uint64 timestamp; |
| + uint32 axes_length; |
|
yzshen1
2016/11/15 19:17:33
If axes length is variable, how about making |axes
ke.he
2016/11/16 09:51:40
Yes, to avoid passing unnecessary bytes, |axes_len
|
| + array<double, 16> axes; //blink::WebGamepad::axesLengthCap = 16 |
| + uint32 buttons_length; |
| + array<GamepadButton, 32> buttons; //blink::WebGamepad::buttonLengthCap = 32 |
| + array<uint16, 16> mapping; //blink::WebGamepad::mappingLengthCap = 16 |
| + GamepadPose? pose; |
| + GamepadHand hand; |
| + uint32 display_id; |
| +}; |