| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 DeviceManager* device_manager, | 52 DeviceManager* device_manager, |
| 53 KeyboardLayoutEngine* keyboard_layout_engine); | 53 KeyboardLayoutEngine* keyboard_layout_engine); |
| 54 ~EventFactoryEvdev() override; | 54 ~EventFactoryEvdev() override; |
| 55 | 55 |
| 56 // Initialize. Must be called with a valid message loop. | 56 // Initialize. Must be called with a valid message loop. |
| 57 void Init(); | 57 void Init(); |
| 58 | 58 |
| 59 void WarpCursorTo(gfx::AcceleratedWidget widget, | 59 void WarpCursorTo(gfx::AcceleratedWidget widget, |
| 60 const gfx::PointF& location); | 60 const gfx::PointF& location); |
| 61 | 61 |
| 62 scoped_ptr<SystemInputInjector> CreateSystemInputInjector(); | 62 std::unique_ptr<SystemInputInjector> CreateSystemInputInjector(); |
| 63 | 63 |
| 64 InputControllerEvdev* input_controller() { return &input_controller_; } | 64 InputControllerEvdev* input_controller() { return &input_controller_; } |
| 65 | 65 |
| 66 // User input events. | 66 // User input events. |
| 67 void DispatchKeyEvent(const KeyEventParams& params); | 67 void DispatchKeyEvent(const KeyEventParams& params); |
| 68 void DispatchMouseMoveEvent(const MouseMoveEventParams& params); | 68 void DispatchMouseMoveEvent(const MouseMoveEventParams& params); |
| 69 void DispatchMouseButtonEvent(const MouseButtonEventParams& params); | 69 void DispatchMouseButtonEvent(const MouseButtonEventParams& params); |
| 70 void DispatchMouseWheelEvent(const MouseWheelEventParams& params); | 70 void DispatchMouseWheelEvent(const MouseWheelEventParams& params); |
| 71 void DispatchPinchEvent(const PinchEventParams& params); | 71 void DispatchPinchEvent(const PinchEventParams& params); |
| 72 void DispatchScrollEvent(const ScrollEventParams& params); | 72 void DispatchScrollEvent(const ScrollEventParams& params); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 // Dispatch event via PlatformEventSource. | 94 // Dispatch event via PlatformEventSource. |
| 95 void DispatchUiEvent(ui::Event* event); | 95 void DispatchUiEvent(ui::Event* event); |
| 96 | 96 |
| 97 int NextDeviceId(); | 97 int NextDeviceId(); |
| 98 | 98 |
| 99 // Device thread initialization. | 99 // Device thread initialization. |
| 100 void StartThread(); | 100 void StartThread(); |
| 101 void OnThreadStarted( | 101 void OnThreadStarted( |
| 102 scoped_ptr<InputDeviceFactoryEvdevProxy> input_device_factory); | 102 std::unique_ptr<InputDeviceFactoryEvdevProxy> input_device_factory); |
| 103 | 103 |
| 104 // Used to uniquely identify input devices. | 104 // Used to uniquely identify input devices. |
| 105 int last_device_id_ = 0; | 105 int last_device_id_ = 0; |
| 106 | 106 |
| 107 // Interface for scanning & monitoring input devices. | 107 // Interface for scanning & monitoring input devices. |
| 108 DeviceManager* device_manager_; // Not owned. | 108 DeviceManager* device_manager_; // Not owned. |
| 109 | 109 |
| 110 // Proxy for input device factory (manages device I/O objects). | 110 // Proxy for input device factory (manages device I/O objects). |
| 111 // The real object lives on a different thread. | 111 // The real object lives on a different thread. |
| 112 scoped_ptr<InputDeviceFactoryEvdevProxy> input_device_factory_proxy_; | 112 std::unique_ptr<InputDeviceFactoryEvdevProxy> input_device_factory_proxy_; |
| 113 | 113 |
| 114 // Modifier key state (shift, ctrl, etc). | 114 // Modifier key state (shift, ctrl, etc). |
| 115 EventModifiersEvdev modifiers_; | 115 EventModifiersEvdev modifiers_; |
| 116 | 116 |
| 117 // Mouse button map. | 117 // Mouse button map. |
| 118 MouseButtonMapEvdev button_map_; | 118 MouseButtonMapEvdev button_map_; |
| 119 | 119 |
| 120 // Keyboard state. | 120 // Keyboard state. |
| 121 KeyboardEvdev keyboard_; | 121 KeyboardEvdev keyboard_; |
| 122 | 122 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 137 | 137 |
| 138 // Support weak pointers for attach & detach callbacks. | 138 // Support weak pointers for attach & detach callbacks. |
| 139 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; | 139 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; |
| 140 | 140 |
| 141 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); | 141 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace ui | 144 } // namespace ui |
| 145 | 145 |
| 146 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 146 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
| OLD | NEW |