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_TOUCH_DISPOSITION_GESTURE_FILTER_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_TOUCH_DISPOSITION_GESTURE_FILTER_H_ |
6 #define UI_EVENTS_GESTURE_DETECTION_TOUCH_DISPOSITION_GESTURE_FILTER_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_TOUCH_DISPOSITION_GESTURE_FILTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
(...skipping 28 matching lines...) Expand all Loading... |
39 // *each* touch event, even those that did not produce a gesture. | 39 // *each* touch event, even those that did not produce a gesture. |
40 enum PacketResult { | 40 enum PacketResult { |
41 SUCCESS, // Packet successfully queued. | 41 SUCCESS, // Packet successfully queued. |
42 INVALID_PACKET_ORDER, // Packets were received in the wrong order, i.e., | 42 INVALID_PACKET_ORDER, // Packets were received in the wrong order, i.e., |
43 // TOUCH_BEGIN should always precede other packets. | 43 // TOUCH_BEGIN should always precede other packets. |
44 INVALID_PACKET_TYPE, // Packet had an invalid type. | 44 INVALID_PACKET_TYPE, // Packet had an invalid type. |
45 }; | 45 }; |
46 PacketResult OnGesturePacket(const GestureEventDataPacket& packet); | 46 PacketResult OnGesturePacket(const GestureEventDataPacket& packet); |
47 | 47 |
48 // OnTouchEventAck must be called upon receipt of every touch event ack. | 48 // OnTouchEventAck must be called upon receipt of every touch event ack. |
49 void OnTouchEventAck(uint32_t unique_event_id, bool event_consumed); | 49 void OnTouchEventAck(uint32_t unique_touch_event_id, bool event_consumed); |
50 | 50 |
51 // Whether there are any active gesture sequences still queued in the filter. | 51 // Whether there are any active gesture sequences still queued in the filter. |
52 bool IsEmpty() const; | 52 bool IsEmpty() const; |
53 | 53 |
54 private: | 54 private: |
55 // A single GestureSequence corresponds to all gestures created | 55 // A single GestureSequence corresponds to all gestures created |
56 // between the first finger down and the last finger up, including gestures | 56 // between the first finger down and the last finger up, including gestures |
57 // generated by timeouts from a statinoary finger. | 57 // generated by timeouts from a statinoary finger. |
58 typedef std::queue<GestureEventDataPacket> GestureSequence; | 58 typedef std::queue<GestureEventDataPacket> GestureSequence; |
59 | 59 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 bool needs_show_press_event_; | 108 bool needs_show_press_event_; |
109 bool needs_fling_ending_event_; | 109 bool needs_fling_ending_event_; |
110 bool needs_scroll_ending_event_; | 110 bool needs_scroll_ending_event_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(TouchDispositionGestureFilter); | 112 DISALLOW_COPY_AND_ASSIGN(TouchDispositionGestureFilter); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace ui | 115 } // namespace ui |
116 | 116 |
117 #endif // UI_EVENTS_GESTURE_DETECTION_TOUCH_DISPOSITION_GESTURE_FILTER_H_ | 117 #endif // UI_EVENTS_GESTURE_DETECTION_TOUCH_DISPOSITION_GESTURE_FILTER_H_ |
OLD | NEW |