OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module sky; | 5 module sky; |
6 | 6 |
7 enum EventType { | 7 enum EventType { |
8 UNKNOWN, | 8 UNKNOWN, |
9 POINTER_DOWN, | 9 POINTER_DOWN, |
10 POINTER_UP, | 10 POINTER_UP, |
11 POINTER_MOVE, | 11 POINTER_MOVE, |
12 POINTER_CANCEL, | 12 POINTER_CANCEL, |
| 13 GESTURE_SCROLL_BEGIN, |
| 14 GESTURE_SCROLL_UPDATE, |
| 15 GESTURE_SCROLL_END, |
| 16 GESTURE_FLING_START, |
| 17 GESTURE_FLING_CANCEL, |
13 }; | 18 }; |
14 | 19 |
15 enum PointerKind { | 20 enum PointerKind { |
16 TOUCH, | 21 TOUCH, |
17 }; | 22 }; |
18 | 23 |
19 struct PointerData { | 24 struct PointerData { |
20 int32 pointer; | 25 int32 pointer; |
21 PointerKind kind; | 26 PointerKind kind; |
22 float x; | 27 float x; |
23 float y; | 28 float y; |
24 int32 buttons; | 29 int32 buttons; |
25 float pressure; | 30 float pressure; |
26 float pressure_min; | 31 float pressure_min; |
27 float pressure_max; | 32 float pressure_max; |
28 float distance; | 33 float distance; |
29 float distance_min; | 34 float distance_min; |
30 float distance_max; | 35 float distance_max; |
31 float radius_major; | 36 float radius_major; |
32 float radius_minor; | 37 float radius_minor; |
33 float radius_min; | 38 float radius_min; |
34 float radius_max; | 39 float radius_max; |
35 float orientation; | 40 float orientation; |
36 float tilt; | 41 float tilt; |
37 }; | 42 }; |
38 | 43 |
| 44 struct GestureData { |
| 45 float x; |
| 46 float y; |
| 47 float dx; |
| 48 float dy; |
| 49 float velocityX; |
| 50 float velocityY; |
| 51 }; |
| 52 |
39 struct InputEvent { | 53 struct InputEvent { |
40 EventType type; | 54 EventType type; |
41 int64 time_stamp; | 55 int64 time_stamp; |
42 PointerData? pointer_data; | 56 PointerData? pointer_data; |
| 57 GestureData? gesture_data; |
43 }; | 58 }; |
OLD | NEW |