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" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 protected: | 75 protected: |
76 // DeviceEventObserver overrides: | 76 // DeviceEventObserver overrides: |
77 // | 77 // |
78 // Callback for device add (on UI thread). | 78 // Callback for device add (on UI thread). |
79 void OnDeviceEvent(const DeviceEvent& event) override; | 79 void OnDeviceEvent(const DeviceEvent& event) override; |
80 | 80 |
81 // PlatformEventSource: | 81 // PlatformEventSource: |
82 void OnDispatcherListChanged() override; | 82 void OnDispatcherListChanged() override; |
83 | 83 |
84 private: | 84 private: |
85 // Post a task to dispatch an event. | |
86 virtual void PostUiEvent(scoped_ptr<Event> event); | |
87 | |
88 // Dispatch event via PlatformEventSource. | 85 // Dispatch event via PlatformEventSource. |
89 void DispatchUiEventTask(scoped_ptr<Event> event); | 86 void DispatchUiEvent(ui::Event* event); |
90 | 87 |
91 int NextDeviceId(); | 88 int NextDeviceId(); |
92 | 89 |
93 // Used to uniquely identify input devices. | 90 // Used to uniquely identify input devices. |
94 int last_device_id_; | 91 int last_device_id_; |
95 | 92 |
96 // Interface for scanning & monitoring input devices. | 93 // Interface for scanning & monitoring input devices. |
97 DeviceManager* device_manager_; // Not owned. | 94 DeviceManager* device_manager_; // Not owned. |
98 | 95 |
99 // Factory for per-device objects. | 96 // Factory for per-device objects. |
100 scoped_ptr<InputDeviceFactoryEvdev> input_device_factory_; | 97 scoped_ptr<InputDeviceFactoryEvdev> input_device_factory_; |
101 | 98 |
102 // Dispatch callback for events. | |
103 EventDispatchCallback dispatch_callback_; | |
104 | |
105 // Modifier key state (shift, ctrl, etc). | 99 // Modifier key state (shift, ctrl, etc). |
106 EventModifiersEvdev modifiers_; | 100 EventModifiersEvdev modifiers_; |
107 | 101 |
108 // Mouse button map. | 102 // Mouse button map. |
109 MouseButtonMapEvdev button_map_; | 103 MouseButtonMapEvdev button_map_; |
110 | 104 |
111 // Keyboard state. | 105 // Keyboard state. |
112 KeyboardEvdev keyboard_; | 106 KeyboardEvdev keyboard_; |
113 | 107 |
114 // Cursor movement. | 108 // Cursor movement. |
115 CursorDelegateEvdev* cursor_; | 109 CursorDelegateEvdev* cursor_; |
116 | 110 |
117 // Object for controlling input devices. | 111 // Object for controlling input devices. |
118 InputControllerEvdev input_controller_; | 112 InputControllerEvdev input_controller_; |
119 | 113 |
120 // Whether we've set up the device factory & done initial scan. | 114 // Whether we've set up the device factory & done initial scan. |
121 bool initialized_; | 115 bool initialized_; |
122 | 116 |
123 // Support weak pointers for attach & detach callbacks. | 117 // Support weak pointers for attach & detach callbacks. |
124 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; | 118 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; |
125 | 119 |
126 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); | 120 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); |
127 }; | 121 }; |
128 | 122 |
129 } // namespace ui | 123 } // namespace ui |
130 | 124 |
131 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 125 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
OLD | NEW |