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_EVENT_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1042 float y_offset_; | 1042 float y_offset_; |
1043 // Unaccelerated offsets. | 1043 // Unaccelerated offsets. |
1044 float x_offset_ordinal_; | 1044 float x_offset_ordinal_; |
1045 float y_offset_ordinal_; | 1045 float y_offset_ordinal_; |
1046 // Number of fingers on the pad. | 1046 // Number of fingers on the pad. |
1047 int finger_count_; | 1047 int finger_count_; |
1048 }; | 1048 }; |
1049 | 1049 |
1050 class EVENTS_EXPORT GestureEvent : public LocatedEvent { | 1050 class EVENTS_EXPORT GestureEvent : public LocatedEvent { |
1051 public: | 1051 public: |
1052 // The constructor takes a default unique_touch_id of zero because test | |
Rick Byers
2016/06/09 16:07:33
nit replace "because test" with "for tests."
mustaq
2016/06/09 16:41:03
Ooops, had dropped the long line accidentally.
| |
1052 GestureEvent(float x, | 1053 GestureEvent(float x, |
1053 float y, | 1054 float y, |
1054 int flags, | 1055 int flags, |
1055 base::TimeDelta time_stamp, | 1056 base::TimeDelta time_stamp, |
1056 const GestureEventDetails& details); | 1057 const GestureEventDetails& details, |
1058 uint32_t unique_touch_event_id = 0); | |
1057 | 1059 |
1058 // Create a new GestureEvent which is identical to the provided model. | 1060 // Create a new GestureEvent which is identical to the provided model. |
1059 // If source / target windows are provided, the model location will be | 1061 // If source / target windows are provided, the model location will be |
1060 // converted from |source| coordinate system to |target| coordinate system. | 1062 // converted from |source| coordinate system to |target| coordinate system. |
1061 template <typename T> | 1063 template <typename T> |
1062 GestureEvent(const GestureEvent& model, T* source, T* target) | 1064 GestureEvent(const GestureEvent& model, T* source, T* target) |
1063 : LocatedEvent(model, source, target), | 1065 : LocatedEvent(model, source, target), |
1064 details_(model.details_) { | 1066 details_(model.details_) { |
1065 } | 1067 } |
1066 | 1068 |
1067 ~GestureEvent() override; | 1069 ~GestureEvent() override; |
1068 | 1070 |
1069 const GestureEventDetails& details() const { return details_; } | 1071 const GestureEventDetails& details() const { return details_; } |
1070 | 1072 |
1073 uint32_t unique_touch_event_id() const { | |
1074 return unique_touch_event_id_; | |
1075 } | |
1076 | |
1071 private: | 1077 private: |
1072 // For (de)serialization. | 1078 // For (de)serialization. |
1073 GestureEvent(EventType type, base::TimeDelta time_stamp, int flags) | 1079 GestureEvent(EventType type, base::TimeDelta time_stamp, int flags) |
1074 : LocatedEvent(type, time_stamp, flags) {} | 1080 : LocatedEvent(type, time_stamp, flags) {} |
1075 friend struct IPC::ParamTraits<ui::ScopedEvent>; | 1081 friend struct IPC::ParamTraits<ui::ScopedEvent>; |
1076 friend struct IPC::ParamTraits<ui::GestureEvent>; | 1082 friend struct IPC::ParamTraits<ui::GestureEvent>; |
1077 | 1083 |
1078 GestureEventDetails details_; | 1084 GestureEventDetails details_; |
1085 | |
1086 // The unique id of the touch event that released the gesture event. This | |
1087 // field gets a non-zero value only for gestures that are released through | |
1088 // TouchDispositionGestureFilter::SendGesture. | |
1089 uint32_t unique_touch_event_id_; | |
sadrul
2016/06/09 16:49:15
"""The unique id of the touch event that released
mustaq
2016/06/09 17:17:27
Does it sound better?
| |
1079 }; | 1090 }; |
1080 | 1091 |
1081 } // namespace ui | 1092 } // namespace ui |
1082 | 1093 |
1083 #endif // UI_EVENTS_EVENT_H_ | 1094 #endif // UI_EVENTS_EVENT_H_ |
OLD | NEW |