OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ |
6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 float pressure; | 62 float pressure; |
63 int source_device_id; | 63 int source_device_id; |
64 float major_radius; | 64 float major_radius; |
65 }; | 65 }; |
66 | 66 |
67 MotionEventAura( | 67 MotionEventAura( |
68 size_t pointer_count, | 68 size_t pointer_count, |
69 const base::TimeTicks& last_touch_time, | 69 const base::TimeTicks& last_touch_time, |
70 Action cached_action, | 70 Action cached_action, |
71 int cached_action_index, | 71 int cached_action_index, |
72 const PointData (&active_touches)[10/*TODO*/]); | 72 const PointData (&active_touches)[MotionEvent::MAX_TOUCH_POINT_COUNT]); |
73 | 73 |
74 static PointData GetPointDataFromTouchEvent(const TouchEvent& touch); | 74 static PointData GetPointDataFromTouchEvent(const TouchEvent& touch); |
75 void AddTouch(const TouchEvent& touch); | 75 void AddTouch(const TouchEvent& touch); |
76 void UpdateTouch(const TouchEvent& touch); | 76 void UpdateTouch(const TouchEvent& touch); |
77 void UpdateCachedAction(const TouchEvent& touch); | 77 void UpdateCachedAction(const TouchEvent& touch); |
78 size_t GetIndexFromId(int id) const; | 78 size_t GetIndexFromId(int id) const; |
79 | 79 |
80 size_t pointer_count_; | 80 size_t pointer_count_; |
81 base::TimeTicks last_touch_time_; | 81 base::TimeTicks last_touch_time_; |
82 Action cached_action_; | 82 Action cached_action_; |
83 // The index of the touch responsible for last ACTION_POINTER_DOWN or | 83 // The index of the touch responsible for last ACTION_POINTER_DOWN or |
84 // ACTION_POINTER_UP. -1 if no such action has occurred. | 84 // ACTION_POINTER_UP. -1 if no such action has occurred. |
85 int cached_action_index_; | 85 int cached_action_index_; |
86 | 86 |
87 // We want constant time indexing by pointer_index, and fast indexing by id. | 87 // We want constant time indexing by pointer_index, and fast indexing by id. |
88 PointData active_touches_[10/*TODO*/]; | 88 PointData active_touches_[MotionEvent::MAX_TOUCH_POINT_COUNT]; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(MotionEventAura); | 90 DISALLOW_COPY_AND_ASSIGN(MotionEventAura); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace ui | 93 } // namespace ui |
94 | 94 |
95 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ | 95 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ |
OLD | NEW |