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_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/message_loop/message_pump_libevent.h" | 13 #include "base/message_loop/message_pump_libevent.h" |
13 #include "ui/events/event_constants.h" | 14 #include "ui/events/event_constants.h" |
14 #include "ui/events/ozone/evdev/event_converter_evdev.h" | 15 #include "ui/events/ozone/evdev/event_converter_evdev.h" |
15 #include "ui/events/ozone/evdev/event_device_info.h" | 16 #include "ui/events/ozone/evdev/event_device_info.h" |
16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 17 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
17 | 18 |
18 namespace ui { | 19 namespace ui { |
19 | 20 |
20 class TouchEvent; | 21 class TouchEvent; |
| 22 class TouchNoiseRemover; |
21 | 23 |
22 class DeviceEventDispatcherEvdev; | 24 class DeviceEventDispatcherEvdev; |
23 | 25 |
24 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev | 26 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev |
25 : public EventConverterEvdev { | 27 : public EventConverterEvdev { |
26 public: | 28 public: |
27 enum { MAX_FINGERS = 20 }; | 29 enum { MAX_FINGERS = 20 }; |
28 TouchEventConverterEvdev(int fd, | 30 TouchEventConverterEvdev(int fd, |
29 base::FilePath path, | 31 base::FilePath path, |
30 int id, | 32 int id, |
(...skipping 29 matching lines...) Expand all Loading... |
60 | 62 |
61 // Overidden from base::MessagePumpLibevent::Watcher. | 63 // Overidden from base::MessagePumpLibevent::Watcher. |
62 void OnFileCanReadWithoutBlocking(int fd) override; | 64 void OnFileCanReadWithoutBlocking(int fd) override; |
63 | 65 |
64 virtual bool Reinitialize(); | 66 virtual bool Reinitialize(); |
65 | 67 |
66 void ProcessInputEvent(const input_event& input); | 68 void ProcessInputEvent(const input_event& input); |
67 void ProcessAbs(const input_event& input); | 69 void ProcessAbs(const input_event& input); |
68 void ProcessSyn(const input_event& input); | 70 void ProcessSyn(const input_event& input); |
69 | 71 |
70 void ReportEvent(int touch_id, | |
71 const InProgressEvents& event, const base::TimeDelta& delta); | |
72 void ReportEvents(base::TimeDelta delta); | 72 void ReportEvents(base::TimeDelta delta); |
73 | 73 |
74 // Dispatcher for events. | 74 // Dispatcher for events. |
75 DeviceEventDispatcherEvdev* dispatcher_; | 75 DeviceEventDispatcherEvdev* dispatcher_; |
76 | 76 |
77 // Set if we have seen a SYN_DROPPED and not yet re-synced with the device. | 77 // Set if we have seen a SYN_DROPPED and not yet re-synced with the device. |
78 bool syn_dropped_; | 78 bool syn_dropped_; |
79 | 79 |
80 // Set if this is a type A device (uses SYN_MT_REPORT). | 80 // Set if this is a type A device (uses SYN_MT_REPORT). |
81 bool is_type_a_; | 81 bool is_type_a_; |
(...skipping 15 matching lines...) Expand all Loading... |
97 | 97 |
98 // Number of touch points reported by driver | 98 // Number of touch points reported by driver |
99 int touch_points_; | 99 int touch_points_; |
100 | 100 |
101 // Touch point currently being updated from the /dev/input/event* stream. | 101 // Touch point currently being updated from the /dev/input/event* stream. |
102 size_t current_slot_; | 102 size_t current_slot_; |
103 | 103 |
104 // In-progress touch points. | 104 // In-progress touch points. |
105 std::vector<InProgressEvents> events_; | 105 std::vector<InProgressEvents> events_; |
106 | 106 |
| 107 // Filters out touch noise. |
| 108 scoped_ptr<TouchNoiseRemover> touch_noise_remover_; |
| 109 |
107 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); | 110 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); |
108 }; | 111 }; |
109 | 112 |
110 } // namespace ui | 113 } // namespace ui |
111 | 114 |
112 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 115 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
OLD | NEW |