| 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 class 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 19 matching lines...) Expand all Loading... |
| 59 // Overidden from base::MessagePumpLibevent::Watcher. | 64 // Overidden from base::MessagePumpLibevent::Watcher. |
| 60 void OnFileCanReadWithoutBlocking(int fd) override; | 65 void OnFileCanReadWithoutBlocking(int fd) override; |
| 61 | 66 |
| 62 virtual void Reinitialize(); | 67 virtual void Reinitialize(); |
| 63 | 68 |
| 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); |
| 74 void ProcessButton(unsigned int button, const input_event& input); |
| 69 | 75 |
| 70 // Returns an EventType to dispatch for |touch|. Returns ET_UNKNOWN if an | 76 // Returns an EventType to dispatch for |touch|. Returns ET_UNKNOWN if an |
| 71 // event should not be dispatched. | 77 // event should not be dispatched. |
| 72 EventType GetEventTypeForTouch(const InProgressTouchEvdev& touch); | 78 EventType GetEventTypeForTouch(const InProgressTouchEvdev& touch); |
| 73 | 79 |
| 74 void ReportEvent(const InProgressTouchEvdev& event, | 80 void ReportTouchEvent(const InProgressTouchEvdev& event, |
| 75 EventType event_type, | 81 EventType event_type, |
| 76 base::TimeTicks timestamp); | 82 base::TimeTicks timestamp); |
| 83 void ReportStylusEvent(const InProgressTouchEvdev& event, |
| 84 base::TimeTicks timestamp); |
| 77 void ReportEvents(base::TimeTicks timestamp); | 85 void ReportEvents(base::TimeTicks timestamp); |
| 78 | 86 |
| 79 void UpdateTrackingId(int slot, int tracking_id); | 87 void UpdateTrackingId(int slot, int tracking_id); |
| 80 void ReleaseTouches(); | 88 void ReleaseTouches(); |
| 81 | 89 |
| 82 // Normalize pressure value to [0, 1]. | 90 // Normalize pressure value to [0, 1]. |
| 83 float ScalePressure(int32_t value); | 91 float ScalePressure(int32_t value); |
| 84 | 92 |
| 85 int NextTrackingId(); | 93 int NextTrackingId(); |
| 86 | 94 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 136 |
| 129 // Records the recent touch events. It is used to fill the feedback reports | 137 // Records the recent touch events. It is used to fill the feedback reports |
| 130 TouchEventLogEvdev touch_evdev_debug_buffer_; | 138 TouchEventLogEvdev touch_evdev_debug_buffer_; |
| 131 | 139 |
| 132 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); | 140 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); |
| 133 }; | 141 }; |
| 134 | 142 |
| 135 } // namespace ui | 143 } // namespace ui |
| 136 | 144 |
| 137 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 145 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
| OLD | NEW |