| 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 20 matching lines...) Expand all Loading... |
| 31 class DeviceManager; | 31 class DeviceManager; |
| 32 class InputDeviceFactoryEvdev; | 32 class InputDeviceFactoryEvdev; |
| 33 class SystemInputInjector; | 33 class SystemInputInjector; |
| 34 enum class DomCode; | 34 enum class DomCode; |
| 35 | 35 |
| 36 #if !defined(USE_EVDEV) | 36 #if !defined(USE_EVDEV) |
| 37 #error Missing dependency on ui/events/ozone:events_ozone_evdev | 37 #error Missing dependency on ui/events/ozone:events_ozone_evdev |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 // Ozone events implementation for the Linux input subsystem ("evdev"). | 40 // Ozone events implementation for the Linux input subsystem ("evdev"). |
| 41 class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev | 41 class EVENTS_OZONE_EVDEV_EXPORT EventFactoryEvdev : public DeviceEventObserver, |
| 42 : public DeviceEventObserver, | 42 public PlatformEventSource { |
| 43 public PlatformEventSource, | |
| 44 public DeviceEventDispatcherEvdev { | |
| 45 public: | 43 public: |
| 46 EventFactoryEvdev(CursorDelegateEvdev* cursor, | 44 EventFactoryEvdev(CursorDelegateEvdev* cursor, |
| 47 DeviceManager* device_manager, | 45 DeviceManager* device_manager, |
| 48 KeyboardLayoutEngine* keyboard_layout_engine); | 46 KeyboardLayoutEngine* keyboard_layout_engine); |
| 49 ~EventFactoryEvdev() override; | 47 ~EventFactoryEvdev() override; |
| 50 | 48 |
| 51 // Initialize. Must be called with a valid message loop. | 49 // Initialize. Must be called with a valid message loop. |
| 52 void Init(); | 50 void Init(); |
| 53 | 51 |
| 54 void WarpCursorTo(gfx::AcceleratedWidget widget, | 52 void WarpCursorTo(gfx::AcceleratedWidget widget, |
| 55 const gfx::PointF& location); | 53 const gfx::PointF& location); |
| 56 | 54 |
| 57 scoped_ptr<SystemInputInjector> CreateSystemInputInjector(); | 55 scoped_ptr<SystemInputInjector> CreateSystemInputInjector(); |
| 58 | 56 |
| 59 InputController* input_controller() { return &input_controller_; } | 57 InputController* input_controller() { return &input_controller_; } |
| 60 | 58 |
| 61 // DeviceEventDispatchEvdev: | 59 // User input events. |
| 62 void DispatchKeyEvent(const KeyEventParams& params) override; | 60 void DispatchKeyEvent(const KeyEventParams& params); |
| 63 void DispatchMouseMoveEvent(const MouseMoveEventParams& params) override; | 61 void DispatchMouseMoveEvent(const MouseMoveEventParams& params); |
| 64 void DispatchMouseButtonEvent(const MouseButtonEventParams& params) override; | 62 void DispatchMouseButtonEvent(const MouseButtonEventParams& params); |
| 65 void DispatchMouseWheelEvent(const MouseWheelEventParams& params) override; | 63 void DispatchMouseWheelEvent(const MouseWheelEventParams& params); |
| 66 void DispatchScrollEvent(const ScrollEventParams& params) override; | 64 void DispatchScrollEvent(const ScrollEventParams& params); |
| 67 void DispatchTouchEvent(const TouchEventParams& params) override; | 65 void DispatchTouchEvent(const TouchEventParams& params); |
| 66 |
| 67 // Device lifecycle events. |
| 68 void DispatchKeyboardDevicesUpdated( | 68 void DispatchKeyboardDevicesUpdated( |
| 69 const std::vector<KeyboardDevice>& devices) override; | 69 const std::vector<KeyboardDevice>& devices); |
| 70 void DispatchTouchscreenDevicesUpdated( | 70 void DispatchTouchscreenDevicesUpdated( |
| 71 const std::vector<TouchscreenDevice>& devices) override; | 71 const std::vector<TouchscreenDevice>& devices); |
| 72 void DispatchMouseDevicesUpdated( | 72 void DispatchMouseDevicesUpdated(const std::vector<InputDevice>& devices); |
| 73 const std::vector<InputDevice>& devices) override; | 73 void DispatchTouchpadDevicesUpdated(const std::vector<InputDevice>& devices); |
| 74 void DispatchTouchpadDevicesUpdated( | |
| 75 const std::vector<InputDevice>& devices) override; | |
| 76 | 74 |
| 77 protected: | 75 protected: |
| 78 // DeviceEventObserver overrides: | 76 // DeviceEventObserver overrides: |
| 79 // | 77 // |
| 80 // Callback for device add (on UI thread). | 78 // Callback for device add (on UI thread). |
| 81 void OnDeviceEvent(const DeviceEvent& event) override; | 79 void OnDeviceEvent(const DeviceEvent& event) override; |
| 82 | 80 |
| 83 // PlatformEventSource: | 81 // PlatformEventSource: |
| 84 void OnDispatcherListChanged() override; | 82 void OnDispatcherListChanged() override; |
| 85 | 83 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 122 |
| 125 // Support weak pointers for attach & detach callbacks. | 123 // Support weak pointers for attach & detach callbacks. |
| 126 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; | 124 base::WeakPtrFactory<EventFactoryEvdev> weak_ptr_factory_; |
| 127 | 125 |
| 128 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); | 126 DISALLOW_COPY_AND_ASSIGN(EventFactoryEvdev); |
| 129 }; | 127 }; |
| 130 | 128 |
| 131 } // namespace ui | 129 } // namespace ui |
| 132 | 130 |
| 133 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ | 131 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_FACTORY_EVDEV_H_ |
| OLD | NEW |