| 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_BASE_GESTURES_GESTURE_SEQUENCE_H_ | 5 #ifndef UI_BASE_GESTURES_GESTURE_SEQUENCE_H_ |
| 6 #define UI_BASE_GESTURES_GESTURE_SEQUENCE_H_ | 6 #define UI_BASE_GESTURES_GESTURE_SEQUENCE_H_ |
| 7 | 7 |
| 8 #include "base/timer.h" | 8 #include "base/timer.h" |
| 9 #include "ui/base/events/event_constants.h" | 9 #include "ui/base/events/event_constants.h" |
| 10 #include "ui/base/gestures/gesture_point.h" | 10 #include "ui/base/gestures/gesture_point.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Pinch gestures. | 113 // Pinch gestures. |
| 114 void AppendPinchGestureBegin(const GesturePoint& p1, | 114 void AppendPinchGestureBegin(const GesturePoint& p1, |
| 115 const GesturePoint& p2, | 115 const GesturePoint& p2, |
| 116 Gestures* gestures); | 116 Gestures* gestures); |
| 117 void AppendPinchGestureEnd(const GesturePoint& p1, | 117 void AppendPinchGestureEnd(const GesturePoint& p1, |
| 118 const GesturePoint& p2, | 118 const GesturePoint& p2, |
| 119 float scale, | 119 float scale, |
| 120 Gestures* gestures); | 120 Gestures* gestures); |
| 121 void AppendPinchGestureUpdate(const GesturePoint& point, | 121 void AppendPinchGestureUpdate(const GesturePoint& point, |
| 122 float scale, | 122 float scale, |
| 123 float rotation, |
| 123 Gestures* gestures); | 124 Gestures* gestures); |
| 124 void AppendSwipeGesture(const GesturePoint& point, | 125 void AppendSwipeGesture(const GesturePoint& point, |
| 125 int swipe_x, | 126 int swipe_x, |
| 126 int swipe_y, | 127 int swipe_y, |
| 127 Gestures* gestures); | 128 Gestures* gestures); |
| 128 void AppendTwoFingerTapGestureEvent(Gestures* gestures); | 129 void AppendTwoFingerTapGestureEvent(Gestures* gestures); |
| 129 | 130 |
| 130 void set_state(const GestureState state) { state_ = state; } | 131 void set_state(const GestureState state) { state_ = state; } |
| 131 | 132 |
| 132 // Various GestureTransitionFunctions for a signature. | 133 // Various GestureTransitionFunctions for a signature. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 180 |
| 180 // ui::EventFlags. | 181 // ui::EventFlags. |
| 181 int flags_; | 182 int flags_; |
| 182 | 183 |
| 183 // We maintain the smallest axis-aligned rectangle that contains all the | 184 // We maintain the smallest axis-aligned rectangle that contains all the |
| 184 // current touch-points. The 'distance' represents the diagonal distance. | 185 // current touch-points. The 'distance' represents the diagonal distance. |
| 185 // This box is updated after every touch-event. | 186 // This box is updated after every touch-event. |
| 186 gfx::Rect bounding_box_; | 187 gfx::Rect bounding_box_; |
| 187 gfx::Point bounding_box_last_center_; | 188 gfx::Point bounding_box_last_center_; |
| 188 | 189 |
| 190 // The angle of the diagonal of the bounding box with the X axis (in radians). |
| 191 float bounding_box_diagonal_angle_; |
| 192 |
| 189 // For pinch, the 'distance' represents the diagonal distance of | 193 // For pinch, the 'distance' represents the diagonal distance of |
| 190 // |bounding_box_|. | 194 // |bounding_box_|. |
| 191 | 195 |
| 192 // The distance between the two points at PINCH_START. | 196 // The distance between the two points at PINCH_START. |
| 193 float pinch_distance_start_; | 197 float pinch_distance_start_; |
| 194 | 198 |
| 195 // This distance is updated after each PINCH_UPDATE. | 199 // This distance is updated after each PINCH_UPDATE. |
| 196 float pinch_distance_current_; | 200 float pinch_distance_current_; |
| 197 | 201 |
| 198 // This is the time when second touch down was received. Used for determining | 202 // This is the time when second touch down was received. Used for determining |
| (...skipping 10 matching lines...) Expand all Loading... |
| 209 gfx::Point last_touch_location_; | 213 gfx::Point last_touch_location_; |
| 210 | 214 |
| 211 GestureEventHelper* helper_; | 215 GestureEventHelper* helper_; |
| 212 | 216 |
| 213 DISALLOW_COPY_AND_ASSIGN(GestureSequence); | 217 DISALLOW_COPY_AND_ASSIGN(GestureSequence); |
| 214 }; | 218 }; |
| 215 | 219 |
| 216 } // namespace ui | 220 } // namespace ui |
| 217 | 221 |
| 218 #endif // UI_BASE_GESTURES_GESTURE_SEQUENCE_H_ | 222 #endif // UI_BASE_GESTURES_GESTURE_SEQUENCE_H_ |
| OLD | NEW |