| 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/scoped_input_device.h" |
| 22 #include "ui/events/ozone/evdev/touch_evdev_debug_buffer.h" | 23 #include "ui/events/ozone/evdev/touch_evdev_debug_buffer.h" |
| 23 | 24 |
| 24 namespace ui { | 25 namespace ui { |
| 25 | 26 |
| 26 class DeviceEventDispatcherEvdev; | 27 class DeviceEventDispatcherEvdev; |
| 27 class TouchNoiseFinder; | 28 class TouchNoiseFinder; |
| 28 struct InProgressTouchEvdev; | 29 struct InProgressTouchEvdev; |
| 29 | 30 |
| 30 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev | 31 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev |
| 31 : public EventConverterEvdev { | 32 : public EventConverterEvdev { |
| 32 public: | 33 public: |
| 33 TouchEventConverterEvdev(int fd, | 34 TouchEventConverterEvdev(ScopedInputDevice fd, |
| 34 base::FilePath path, | 35 base::FilePath path, |
| 35 int id, | 36 int id, |
| 36 const EventDeviceInfo& devinfo, | 37 const EventDeviceInfo& devinfo, |
| 37 DeviceEventDispatcherEvdev* dispatcher); | 38 DeviceEventDispatcherEvdev* dispatcher); |
| 38 ~TouchEventConverterEvdev() override; | 39 ~TouchEventConverterEvdev() override; |
| 39 | 40 |
| 40 // EventConverterEvdev: | 41 // EventConverterEvdev: |
| 41 bool HasTouchscreen() const override; | 42 bool HasTouchscreen() const override; |
| 42 bool HasPen() const override; | 43 bool HasPen() const override; |
| 43 gfx::Size GetTouchscreenSize() const override; | 44 gfx::Size GetTouchscreenSize() const override; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 83 |
| 83 void UpdateTrackingId(int slot, int tracking_id); | 84 void UpdateTrackingId(int slot, int tracking_id); |
| 84 void ReleaseTouches(); | 85 void ReleaseTouches(); |
| 85 void ReleaseButtons(); | 86 void ReleaseButtons(); |
| 86 void CancelAllTouches(); | 87 void CancelAllTouches(); |
| 87 // Normalize pressure value to [0, 1]. | 88 // Normalize pressure value to [0, 1]. |
| 88 float ScalePressure(int32_t value); | 89 float ScalePressure(int32_t value); |
| 89 | 90 |
| 90 int NextTrackingId(); | 91 int NextTrackingId(); |
| 91 | 92 |
| 93 // Input device file descriptor. |
| 94 ScopedInputDevice input_device_fd_; |
| 95 |
| 92 // Dispatcher for events. | 96 // Dispatcher for events. |
| 93 DeviceEventDispatcherEvdev* dispatcher_; | 97 DeviceEventDispatcherEvdev* dispatcher_; |
| 94 | 98 |
| 95 // Set if we drop events in kernel (SYN_DROPPED) or in process. | 99 // Set if we drop events in kernel (SYN_DROPPED) or in process. |
| 96 bool dropped_events_ = false; | 100 bool dropped_events_ = false; |
| 97 | 101 |
| 98 // Device has multitouch capability. | 102 // Device has multitouch capability. |
| 99 bool has_mt_ = false; | 103 bool has_mt_ = false; |
| 100 | 104 |
| 101 // Device supports pen input. | 105 // Device supports pen input. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 146 |
| 143 // Callback to enable/disable palm suppression. | 147 // Callback to enable/disable palm suppression. |
| 144 base::Callback<void(bool)> enable_palm_suppression_callback_; | 148 base::Callback<void(bool)> enable_palm_suppression_callback_; |
| 145 | 149 |
| 146 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); | 150 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); |
| 147 }; | 151 }; |
| 148 | 152 |
| 149 } // namespace ui | 153 } // namespace ui |
| 150 | 154 |
| 151 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 155 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
| OLD | NEW |