| 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_EVENT_CONVERTER_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "ui/events/ozone/evdev/event_dispatch_callback.h" |
| 11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 12 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
| 12 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 13 | 14 |
| 14 namespace ui { | 15 namespace ui { |
| 15 | 16 |
| 16 class Event; | |
| 17 | |
| 18 typedef base::Callback<void(Event*)> EventDispatchCallback; | |
| 19 | |
| 20 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev | 17 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev |
| 21 : public base::MessagePumpLibevent::Watcher { | 18 : public base::MessagePumpLibevent::Watcher { |
| 22 public: | 19 public: |
| 23 EventConverterEvdev(int fd, const base::FilePath& path, int id); | 20 EventConverterEvdev(int fd, const base::FilePath& path, int id); |
| 24 virtual ~EventConverterEvdev(); | 21 virtual ~EventConverterEvdev(); |
| 25 | 22 |
| 26 int id() const { return id_; } | 23 int id() const { return id_; } |
| 27 | 24 |
| 25 const base::FilePath& path() { return path_; } |
| 26 |
| 28 // Start reading events. | 27 // Start reading events. |
| 29 void Start(); | 28 void Start(); |
| 30 | 29 |
| 31 // Stop reading events. | 30 // Stop reading events. |
| 32 void Stop(); | 31 void Stop(); |
| 33 | 32 |
| 34 // Returns true of the converter is used for a touchscreen device. | 33 // Returns true of the converter is used for a touchscreen device. |
| 35 virtual bool HasTouchscreen() const; | 34 virtual bool HasTouchscreen() const; |
| 36 | 35 |
| 37 // Returns the size of the touchscreen device if the converter is used for a | 36 // Returns the size of the touchscreen device if the converter is used for a |
| (...skipping 16 matching lines...) Expand all Loading... |
| 54 // Controller for watching the input fd. | 53 // Controller for watching the input fd. |
| 55 base::MessagePumpLibevent::FileDescriptorWatcher controller_; | 54 base::MessagePumpLibevent::FileDescriptorWatcher controller_; |
| 56 | 55 |
| 57 private: | 56 private: |
| 58 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev); | 57 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev); |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 } // namespace ui | 60 } // namespace ui |
| 62 | 61 |
| 63 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ | 62 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ |
| OLD | NEW |