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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 module device.mojom;
yzshen1 2016/11/14 21:13:17 Please add the copyright boilerplate.
ke.he 2016/11/15 10:55:18 Done.
2
3 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
4 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
5 float x;
6 float y;
7 float z;
8 float w;
9 };
10
11 struct WebGamepadVector{
12 bool notNull;
13 float x;
14 float y;
15 float z;
16 };
17
18 struct WebGamepadButton{
19 bool pressed;
20 bool touched;
21 double value;
22 };
23
24 struct WebGamepadPose{
25 bool notNull;
26 bool hasOrientation;
27 bool hasPosition;
28 WebGamepadQuaternion orientation;
29 WebGamepadVector position;
30 WebGamepadVector angularVelocity;
31 WebGamepadVector linearVelocity;
32 WebGamepadVector angularAcceleration;
33 WebGamepadVector linearAcceleration;
34 };
35
36 enum WebGamepadHand {
37 GamepadHandNone = 0,
38 GamepadHandLeft = 1,
39 GamepadHandRight = 2
40 };
41
42 struct WebGamepad {
43 bool connected;
44 array<uint16, 128> id; //blink::WebGamepad::idLengthCap = 128
45 uint64 timestamp;
46 uint32 axesLength;
47 array<double, 16> axes; //blink::WebGamepad::axesLengthCap = 16
48 uint32 buttonsLength;
49 array<WebGamepadButton, 32> buttons; //blink::WebGamepad::buttonLengthCap = 32
50 array<uint16, 16> mapping; //blink::WebGamepad::mappingLengthCap = 16
51 WebGamepadPose pose;
52 WebGamepadHand hand;
53 uint32 displayId;
54 };
OLDNEW
« 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