Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev_impl.h

Issue 869613003: [PATCH 5/11] ozone: evdev: Replace dispatch callbacks with an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: namespace ui Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_IMPL_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/message_loop/message_pump_libevent.h" 11 #include "base/message_loop/message_pump_libevent.h"
12 #include "ui/events/devices/input_device.h" 12 #include "ui/events/devices/input_device.h"
13 #include "ui/events/event.h" 13 #include "ui/events/event.h"
14 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" 14 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
15 #include "ui/events/ozone/evdev/event_converter_evdev.h" 15 #include "ui/events/ozone/evdev/event_converter_evdev.h"
16 #include "ui/events/ozone/evdev/event_device_info.h" 16 #include "ui/events/ozone/evdev/event_device_info.h"
17 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" 17 #include "ui/events/ozone/evdev/event_modifiers_evdev.h"
18 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" 18 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
19 #include "ui/events/ozone/evdev/keyboard_evdev.h" 19 #include "ui/events/ozone/evdev/keyboard_evdev.h"
20 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h" 20 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h"
21 21
22 struct input_event; 22 struct input_event;
23 23
24 namespace ui { 24 namespace ui {
25 25
26 class DeviceEventDispatcherEvdev;
27
26 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdevImpl 28 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdevImpl
27 : public EventConverterEvdev { 29 : public EventConverterEvdev {
28 public: 30 public:
29 EventConverterEvdevImpl( 31 EventConverterEvdevImpl(int fd,
30 int fd, 32 base::FilePath path,
31 base::FilePath path, 33 int id,
32 int id, 34 InputDeviceType type,
33 InputDeviceType type, 35 const EventDeviceInfo& info,
34 const EventDeviceInfo& info, 36 CursorDelegateEvdev* cursor,
35 CursorDelegateEvdev* cursor, 37 DeviceEventDispatcherEvdev* dispatcher);
36 const KeyEventDispatchCallback& key_callback,
37 const MouseMoveEventDispatchCallback& mouse_move_callback,
38 const MouseButtonEventDispatchCallback& mouse_button_callback);
39 ~EventConverterEvdevImpl() override; 38 ~EventConverterEvdevImpl() override;
40 39
41 // EventConverterEvdev: 40 // EventConverterEvdev:
42 void OnFileCanReadWithoutBlocking(int fd) override; 41 void OnFileCanReadWithoutBlocking(int fd) override;
43 bool HasKeyboard() const override; 42 bool HasKeyboard() const override;
44 bool HasTouchpad() const override; 43 bool HasTouchpad() const override;
45 void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) override; 44 void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) override;
46 void AllowAllKeys() override; 45 void AllowAllKeys() override;
47 46
48 void ProcessEvents(const struct input_event* inputs, int count); 47 void ProcessEvents(const struct input_event* inputs, int count);
(...skipping 23 matching lines...) Expand all
72 base::MessagePumpLibevent::FileDescriptorWatcher controller_; 71 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
73 72
74 // The keys which should be processed. nullptr if all keys should be 73 // The keys which should be processed. nullptr if all keys should be
75 // processed. 74 // processed.
76 scoped_ptr<std::set<DomCode>> allowed_keys_; 75 scoped_ptr<std::set<DomCode>> allowed_keys_;
77 76
78 // Shared cursor state. 77 // Shared cursor state.
79 CursorDelegateEvdev* cursor_; 78 CursorDelegateEvdev* cursor_;
80 79
81 // Callbacks for dispatching events. 80 // Callbacks for dispatching events.
82 KeyEventDispatchCallback key_callback_; 81 DeviceEventDispatcherEvdev* dispatcher_;
83 MouseMoveEventDispatchCallback mouse_move_callback_;
84 MouseButtonEventDispatchCallback mouse_button_callback_;
85 82
86 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl); 83 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl);
87 }; 84 };
88 85
89 } // namespace ui 86 } // namespace ui
90 87
91 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ 88 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
92 89
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/device_event_dispatcher_evdev.cc ('k') | ui/events/ozone/evdev/event_converter_evdev_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698