OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GESTURES_GESTURE_POINT_H_ | 5 #ifndef UI_EVENTS_GESTURES_GESTURE_POINT_H_ |
6 #define UI_EVENTS_GESTURES_GESTURE_POINT_H_ | 6 #define UI_EVENTS_GESTURES_GESTURE_POINT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/events/gestures/velocity_calculator.h" | 9 #include "ui/events/gestures/velocity_calculator.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 bool in_use() const { return point_id_ >= 0; } | 73 bool in_use() const { return point_id_ >= 0; } |
74 | 74 |
75 gfx::Vector2d ScrollDelta() const; | 75 gfx::Vector2d ScrollDelta() const; |
76 | 76 |
77 float XVelocity() { return velocity_calculator_.XVelocity(); } | 77 float XVelocity() { return velocity_calculator_.XVelocity(); } |
78 float YVelocity() { return velocity_calculator_.YVelocity(); } | 78 float YVelocity() { return velocity_calculator_.YVelocity(); } |
79 | 79 |
80 const gfx::Rect& enclosing_rectangle() const { return enclosing_rect_; } | 80 const gfx::Rect& enclosing_rectangle() const { return enclosing_rect_; } |
81 | 81 |
82 void set_source_device_id(int source_device_id) { | |
83 source_device_id_ = source_device_id; | |
84 } | |
85 int source_device_id() const { return source_device_id_; } | |
86 | |
87 private: | 82 private: |
88 // Various statistical functions to manipulate gestures. | 83 // Various statistical functions to manipulate gestures. |
89 | 84 |
90 // Tests if the point has a consistent scroll vector across a window of touch | 85 // Tests if the point has a consistent scroll vector across a window of touch |
91 // move events. | 86 // move events. |
92 bool IsConsistentScrollingActionUnderway() const; | 87 bool IsConsistentScrollingActionUnderway() const; |
93 bool IsInClickTimeWindow() const; | 88 bool IsInClickTimeWindow() const; |
94 bool IsInClickAggregateTimeWindow(double before, double after) const; | 89 bool IsInClickAggregateTimeWindow(double before, double after) const; |
95 bool IsPointInsideManhattanSquare(gfx::Point p1, gfx::Point p2) const; | 90 bool IsPointInsideManhattanSquare(gfx::Point p1, gfx::Point p2) const; |
96 bool IsOverMinFlickSpeed(); | 91 bool IsOverMinFlickSpeed(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 int point_id_; | 124 int point_id_; |
130 int touch_id_; | 125 int touch_id_; |
131 | 126 |
132 // Represents the rectangle that encloses the circles/ellipses | 127 // Represents the rectangle that encloses the circles/ellipses |
133 // generated by a sequence of touch events | 128 // generated by a sequence of touch events |
134 gfx::Rect enclosing_rect_; | 129 gfx::Rect enclosing_rect_; |
135 | 130 |
136 // Count of the number of events with same direction. | 131 // Count of the number of events with same direction. |
137 gfx::Vector2d same_direction_count_; | 132 gfx::Vector2d same_direction_count_; |
138 | 133 |
139 int source_device_id_; | |
140 | |
141 DISALLOW_COPY_AND_ASSIGN(GesturePoint); | 134 DISALLOW_COPY_AND_ASSIGN(GesturePoint); |
142 }; | 135 }; |
143 | 136 |
144 } // namespace ui | 137 } // namespace ui |
145 | 138 |
146 #endif // UI_EVENTS_GESTURES_GESTURE_POINT_H_ | 139 #endif // UI_EVENTS_GESTURES_GESTURE_POINT_H_ |
OLD | NEW |