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

Unified Diff: device/gamepad/public/interfaces/gamepad.mojom

Issue 2492183002: Add struct_traits and typemap for blink::WebGamepad (Closed)
Patch Set: fixed "un-aligned warning" in windows x64 build Created 4 years, 1 month 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
« no previous file with comments | « device/gamepad/public/interfaces/OWNERS ('k') | device/gamepad/public/interfaces/typemaps.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+};
« no previous file with comments | « device/gamepad/public/interfaces/OWNERS ('k') | device/gamepad/public/interfaces/typemaps.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698