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

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

Issue 2492183002: Add struct_traits and typemap for blink::WebGamepad (Closed)
Patch Set: code rebase 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/gamepad.typemap » ('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..5fbd79f824f7edeb38b6a30801bdaad273c8f7e7
--- /dev/null
+++ b/device/gamepad/public/interfaces/gamepad.mojom
@@ -0,0 +1,51 @@
+// 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> id;
+ uint64 timestamp;
+ array<double> axes;
+ array<GamepadButton> buttons;
+ array<uint16> mapping;
+ GamepadPose? pose;
+ GamepadHand hand;
+ uint32 display_id;
+};
« no previous file with comments | « device/gamepad/public/interfaces/OWNERS ('k') | device/gamepad/public/interfaces/gamepad.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698