| 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/message_loop/message_pump_libevent.h" | 12 #include "base/message_loop/message_pump_libevent.h" |
| 13 #include "ui/events/event_constants.h" | 13 #include "ui/events/event_constants.h" |
| 14 #include "ui/events/ozone/evdev/event_converter_evdev.h" | 14 #include "ui/events/ozone/evdev/event_converter_evdev.h" |
| 15 #include "ui/events/ozone/evdev/event_device_info.h" | 15 #include "ui/events/ozone/evdev/event_device_info.h" |
| 16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
| 17 | 17 |
| 18 namespace ui { | 18 namespace ui { |
| 19 | 19 |
| 20 class TouchEvent; | 20 class TouchEvent; |
| 21 | 21 |
| 22 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev | 22 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev |
| 23 : public EventConverterEvdev { | 23 : public EventConverterEvdev { |
| 24 public: | 24 public: |
| 25 enum { | 25 enum { |
| 26 MAX_FINGERS = 11 | 26 MAX_FINGERS = 11 |
| 27 }; | 27 }; |
| 28 TouchEventConverterEvdev(int fd, | 28 TouchEventConverterEvdev(int fd, |
| 29 base::FilePath path, | 29 base::FilePath path, |
| 30 const EventDeviceInfo& info, | 30 scoped_ptr<EventDeviceInfo> device_info, |
| 31 const EventDispatchCallback& dispatch); | 31 const EventDispatchCallback& dispatch); |
| 32 virtual ~TouchEventConverterEvdev(); | 32 virtual ~TouchEventConverterEvdev(); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 friend class MockTouchEventConverterEvdev; | 35 friend class MockTouchEventConverterEvdev; |
| 36 | 36 |
| 37 // Unsafe part of initialization. | 37 // Unsafe part of initialization. |
| 38 void Init(const EventDeviceInfo& info); | 38 void Init(); |
| 39 | 39 |
| 40 // Overidden from base::MessagePumpLibevent::Watcher. | 40 // Overidden from base::MessagePumpLibevent::Watcher. |
| 41 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 41 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; |
| 42 | 42 |
| 43 virtual bool Reinitialize(); | 43 virtual bool Reinitialize(); |
| 44 | 44 |
| 45 void ProcessInputEvent(const input_event& input); | 45 void ProcessInputEvent(const input_event& input); |
| 46 void ProcessAbs(const input_event& input); | 46 void ProcessAbs(const input_event& input); |
| 47 void ProcessSyn(const input_event& input); | 47 void ProcessSyn(const input_event& input); |
| 48 | 48 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // In-progress touch points. | 99 // In-progress touch points. |
| 100 InProgressEvents events_[MAX_FINGERS]; | 100 InProgressEvents events_[MAX_FINGERS]; |
| 101 | 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); | 102 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace ui | 105 } // namespace ui |
| 106 | 106 |
| 107 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 107 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
| OLD | NEW |