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_FACTORY_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/task_runner.h" | 12 #include "base/task_runner.h" |
13 #include "ui/events/ozone/device/device_event_observer.h" | 13 #include "ui/events/ozone/device/device_event_observer.h" |
14 #include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h" | 14 #include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h" |
15 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" | 15 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" |
| 16 #include "ui/events/ozone/evdev/event_thread_evdev.h" |
16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 17 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
17 #include "ui/events/ozone/evdev/input_controller_evdev.h" | 18 #include "ui/events/ozone/evdev/input_controller_evdev.h" |
18 #include "ui/events/ozone/evdev/keyboard_evdev.h" | 19 #include "ui/events/ozone/evdev/keyboard_evdev.h" |
19 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h" | 20 #include "ui/events/ozone/evdev/mouse_button_map_evdev.h" |
20 #include "ui/events/platform/platform_event_source.h" | 21 #include "ui/events/platform/platform_event_source.h" |
21 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
22 #include "ui/ozone/public/system_input_injector.h" | 23 #include "ui/ozone/public/system_input_injector.h" |
23 | 24 |
24 namespace gfx { | 25 namespace gfx { |
25 class PointF; | 26 class PointF; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 82 |
82 // PlatformEventSource: | 83 // PlatformEventSource: |
83 void OnDispatcherListChanged() override; | 84 void OnDispatcherListChanged() override; |
84 | 85 |
85 private: | 86 private: |
86 // Dispatch event via PlatformEventSource. | 87 // Dispatch event via PlatformEventSource. |
87 void DispatchUiEvent(ui::Event* event); | 88 void DispatchUiEvent(ui::Event* event); |
88 | 89 |
89 int NextDeviceId(); | 90 int NextDeviceId(); |
90 | 91 |
| 92 // Device thread initialization. |
| 93 void StartThread(); |
| 94 void OnThreadStarted( |
| 95 scoped_ptr<InputDeviceFactoryProxyEvdev> input_device_factory); |
| 96 |
91 // Used to uniquely identify input devices. | 97 // Used to uniquely identify input devices. |
92 int last_device_id_; | 98 int last_device_id_; |
93 | 99 |
94 // Interface for scanning & monitoring input devices. | 100 // Interface for scanning & monitoring input devices. |
95 DeviceManager* device_manager_; // Not owned. | 101 DeviceManager* device_manager_; // Not owned. |
96 | 102 |
97 // Factory for per-device objects. | 103 // Factory for per-device objects. |
98 scoped_ptr<InputDeviceFactoryEvdev> input_device_factory_; | |
99 scoped_ptr<InputDeviceFactoryProxyEvdev> input_device_factory_proxy_; | 104 scoped_ptr<InputDeviceFactoryProxyEvdev> input_device_factory_proxy_; |
100 | 105 |
101 // Modifier key state (shift, ctrl, etc). | 106 // Modifier key state (shift, ctrl, etc). |
102 EventModifiersEvdev modifiers_; | 107 EventModifiersEvdev modifiers_; |
103 | 108 |
104 // Mouse button map. | 109 // Mouse button map. |
105 MouseButtonMapEvdev button_map_; | 110 MouseButtonMapEvdev button_map_; |
106 | 111 |
107 // Keyboard state. | 112 // Keyboard state. |
108 KeyboardEvdev keyboard_; | 113 KeyboardEvdev keyboard_; |
109 | 114 |
110 // Cursor movement. | 115 // Cursor movement. |
111 CursorDelegateEvdev* cursor_; | 116 CursorDelegateEvdev* cursor_; |
112 | 117 |
113 // Object for controlling input devices. | 118 // Object for controlling input devices. |
114 InputControllerEvdev input_controller_; | 119 InputControllerEvdev input_controller_; |
115 | 120 |
116 // Whether we've set up the device factory & done initial scan. | 121 // Whether we've set up the device factory. |
117 bool initialized_; | 122 bool initialized_; |
118 | 123 |
| 124 // Thread for device I/O. |
| 125 EventThreadEvdev thread_; |
| 126 |
119 // Support weak pointers for attach & detach callbacks. | 127 // Support weak pointers for attach & detach callbacks. |
120 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; | 128 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; |
121 | 129 |
122 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); | 130 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); |
123 }; | 131 }; |
124 | 132 |
125 } // namespace ui | 133 } // namespace ui |
126 | 134 |
127 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 135 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
OLD | NEW |