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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <bitset> | 11 #include <bitset> |
12 #include <memory> | 12 #include <memory> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/message_loop/message_pump_libevent.h" | 17 #include "base/message_loop/message_pump_libevent.h" |
18 #include "ui/events/event_constants.h" | 18 #include "ui/events/event_constants.h" |
19 #include "ui/events/ozone/evdev/event_converter_evdev.h" | 19 #include "ui/events/ozone/evdev/event_converter_evdev.h" |
20 #include "ui/events/ozone/evdev/event_device_info.h" | 20 #include "ui/events/ozone/evdev/event_device_info.h" |
21 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 21 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
22 #include "ui/events/ozone/evdev/touch_evdev_debug_buffer.h" | 22 #include "ui/events/ozone/evdev/touch_evdev_debug_buffer.h" |
23 | 23 |
| 24 namespace gfx { |
| 25 class PointF; |
| 26 } |
| 27 |
24 namespace ui { | 28 namespace ui { |
25 | 29 |
26 class DeviceEventDispatcherEvdev; | 30 class DeviceEventDispatcherEvdev; |
27 class TouchEvent; | 31 class TouchEvent; |
28 class TouchNoiseFinder; | 32 class TouchNoiseFinder; |
29 struct InProgressTouchEvdev; | 33 struct InProgressTouchEvdev; |
| 34 struct PointerDetails; |
30 | 35 |
31 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev | 36 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev |
32 : public EventConverterEvdev { | 37 : public EventConverterEvdev { |
33 public: | 38 public: |
34 TouchEventConverterEvdev(int fd, | 39 TouchEventConverterEvdev(int fd, |
35 base::FilePath path, | 40 base::FilePath path, |
36 int id, | 41 int id, |
37 const EventDeviceInfo& devinfo, | 42 const EventDeviceInfo& devinfo, |
38 DeviceEventDispatcherEvdev* dispatcher); | 43 DeviceEventDispatcherEvdev* dispatcher); |
39 ~TouchEventConverterEvdev() override; | 44 ~TouchEventConverterEvdev() override; |
(...skipping 24 matching lines...) Expand all Loading... |
64 void ProcessMultitouchEvent(const input_event& input); | 69 void ProcessMultitouchEvent(const input_event& input); |
65 void EmulateMultitouchEvent(const input_event& input); | 70 void EmulateMultitouchEvent(const input_event& input); |
66 void ProcessKey(const input_event& input); | 71 void ProcessKey(const input_event& input); |
67 void ProcessAbs(const input_event& input); | 72 void ProcessAbs(const input_event& input); |
68 void ProcessSyn(const input_event& input); | 73 void ProcessSyn(const input_event& input); |
69 | 74 |
70 // Returns an EventType to dispatch for |touch|. Returns ET_UNKNOWN if an | 75 // Returns an EventType to dispatch for |touch|. Returns ET_UNKNOWN if an |
71 // event should not be dispatched. | 76 // event should not be dispatched. |
72 EventType GetEventTypeForTouch(const InProgressTouchEvdev& touch); | 77 EventType GetEventTypeForTouch(const InProgressTouchEvdev& touch); |
73 | 78 |
74 void ReportEvent(const InProgressTouchEvdev& event, | 79 void ReportTouchEvent(const InProgressTouchEvdev& event, |
75 EventType event_type, | 80 EventType event_type, |
76 base::TimeTicks timestamp); | 81 base::TimeTicks timestamp); |
| 82 void ReportStylusEvent(const InProgressTouchEvdev& event, |
| 83 base::TimeTicks timestamp); |
| 84 void ReportButton(unsigned int button, |
| 85 bool down, |
| 86 const InProgressTouchEvdev& event, |
| 87 base::TimeTicks timestamp); |
77 void ReportEvents(base::TimeTicks timestamp); | 88 void ReportEvents(base::TimeTicks timestamp); |
78 | 89 |
79 void UpdateTrackingId(int slot, int tracking_id); | 90 void UpdateTrackingId(int slot, int tracking_id); |
80 void ReleaseTouches(); | 91 void ReleaseTouches(); |
81 | 92 void ReleaseButtons(); |
82 // Normalize pressure value to [0, 1]. | 93 // Normalize pressure value to [0, 1]. |
83 float ScalePressure(int32_t value); | 94 float ScalePressure(int32_t value); |
84 | 95 |
85 int NextTrackingId(); | 96 int NextTrackingId(); |
86 | 97 |
87 // Dispatcher for events. | 98 // Dispatcher for events. |
88 DeviceEventDispatcherEvdev* dispatcher_; | 99 DeviceEventDispatcherEvdev* dispatcher_; |
89 | 100 |
90 // Set if we drop events in kernel (SYN_DROPPED) or in process. | 101 // Set if we drop events in kernel (SYN_DROPPED) or in process. |
91 bool dropped_events_ = false; | 102 bool dropped_events_ = false; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 139 |
129 // Records the recent touch events. It is used to fill the feedback reports | 140 // Records the recent touch events. It is used to fill the feedback reports |
130 TouchEventLogEvdev touch_evdev_debug_buffer_; | 141 TouchEventLogEvdev touch_evdev_debug_buffer_; |
131 | 142 |
132 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); | 143 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); |
133 }; | 144 }; |
134 | 145 |
135 } // namespace ui | 146 } // namespace ui |
136 | 147 |
137 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 148 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
OLD | NEW |