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_AURA_GESTURES_GESTURE_POINT_H_ | 5 #ifndef UI_AURA_GESTURES_GESTURE_POINT_H_ |
6 #define UI_AURA_GESTURES_GESTURE_POINT_H_ | 6 #define UI_AURA_GESTURES_GESTURE_POINT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/aura/gestures/velocity_calculator.h" | 10 #include "ui/aura/gestures/velocity_calculator.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 bool BreaksVerticalRail(); | 46 bool BreaksVerticalRail(); |
47 bool DidScroll(const TouchEvent& event, int distance) const; | 47 bool DidScroll(const TouchEvent& event, int distance) const; |
48 | 48 |
49 const gfx::Point& first_touch_position() const { | 49 const gfx::Point& first_touch_position() const { |
50 return first_touch_position_; | 50 return first_touch_position_; |
51 } | 51 } |
52 | 52 |
53 double last_touch_time() const { return last_touch_time_; } | 53 double last_touch_time() const { return last_touch_time_; } |
54 const gfx::Point& last_touch_position() const { return last_touch_position_; } | 54 const gfx::Point& last_touch_position() const { return last_touch_position_; } |
55 | 55 |
56 void set_touch_id(unsigned int touch_id) { touch_id_ = touch_id; } | 56 void set_point_id(int point_id) { point_id_ = point_id; } |
rjkroege
2012/02/23 19:39:45
can you add some comments saying what these are fo
tdresser
2012/02/23 20:13:07
Done.
| |
57 const unsigned int touch_id() const { return touch_id_; } | 57 const int point_id() const { return point_id_; } |
58 | |
59 void use() { in_use_ = true; } | |
60 const bool in_use() const { return in_use_; } | |
58 | 61 |
59 double x_delta() const { | 62 double x_delta() const { |
60 return last_touch_position_.x() - first_touch_position_.x(); | 63 return last_touch_position_.x() - first_touch_position_.x(); |
61 } | 64 } |
62 | 65 |
63 double y_delta() const { | 66 double y_delta() const { |
64 return last_touch_position_.y() - first_touch_position_.y(); | 67 return last_touch_position_.y() - first_touch_position_.y(); |
65 } | 68 } |
66 | 69 |
67 float XVelocity() { return velocity_calculator_.XVelocity(); } | 70 float XVelocity() { return velocity_calculator_.XVelocity(); } |
(...skipping 12 matching lines...) Expand all Loading... | |
80 gfx::Point first_touch_position_; | 83 gfx::Point first_touch_position_; |
81 double first_touch_time_; | 84 double first_touch_time_; |
82 gfx::Point last_touch_position_; | 85 gfx::Point last_touch_position_; |
83 double last_touch_time_; | 86 double last_touch_time_; |
84 | 87 |
85 double last_tap_time_; | 88 double last_tap_time_; |
86 gfx::Point last_tap_position_; | 89 gfx::Point last_tap_position_; |
87 | 90 |
88 VelocityCalculator velocity_calculator_; | 91 VelocityCalculator velocity_calculator_; |
89 | 92 |
90 unsigned int touch_id_; | 93 bool in_use_; |
rjkroege
2012/02/23 19:39:45
do we need both the bool and the point_id? positiv
tdresser
2012/02/23 20:13:07
Done.
| |
94 int point_id_; | |
91 DISALLOW_COPY_AND_ASSIGN(GesturePoint); | 95 DISALLOW_COPY_AND_ASSIGN(GesturePoint); |
92 }; | 96 }; |
93 | 97 |
94 } // namespace aura | 98 } // namespace aura |
95 | 99 |
96 #endif // UI_AURA_GESTURES_GESTURE_POINT_H_ | 100 #endif // UI_AURA_GESTURES_GESTURE_POINT_H_ |
OLD | NEW |