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
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
8 #include "base/callback.h"
9 #include "base/files/file_path.h"
10 #include "base/message_loop/message_loop.h"
11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
17 typedef base::Callback<void(Event*)> EventDispatchCallback;
19 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev
20 : public base::MessagePumpLibevent::Watcher {
22 EventConverterEvdev(int fd, const base::FilePath& path);
23 virtual ~EventConverterEvdev();
25 // Start reading events.
28 // Stop reading events.
32 // base::MessagePumpLibevent::Watcher:
33 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
35 // File descriptor to read.
38 // Path to input device.
41 // Controller for watching the input fd.
42 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
45 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
50 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_