| 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_INPUT_CONTROLLER_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "ui/events/ozone/evdev/event_device_info.h" | |
| 12 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
| 13 #include "ui/ozone/public/input_controller.h" | 12 #include "ui/ozone/public/input_controller.h" |
| 14 | 13 |
| 15 namespace ui { | 14 namespace ui { |
| 16 | 15 |
| 17 class InputDeviceFactoryEvdev; | 16 class InputDeviceFactoryEvdev; |
| 18 class KeyboardEvdev; | 17 class KeyboardEvdev; |
| 19 class MouseButtonMapEvdev; | 18 class MouseButtonMapEvdev; |
| 20 | 19 |
| 21 #if defined(USE_EVDEV_GESTURES) | |
| 22 class GesturePropertyProvider; | |
| 23 #endif | |
| 24 | |
| 25 // Ozone InputController implementation for the Linux input subsystem ("evdev"). | 20 // Ozone InputController implementation for the Linux input subsystem ("evdev"). |
| 26 class EVENTS_OZONE_EVDEV_EXPORT InputControllerEvdev : public InputController { | 21 class EVENTS_OZONE_EVDEV_EXPORT InputControllerEvdev : public InputController { |
| 27 public: | 22 public: |
| 28 InputControllerEvdev(KeyboardEvdev* keyboard, | 23 InputControllerEvdev(KeyboardEvdev* keyboard, |
| 29 MouseButtonMapEvdev* button_map | 24 MouseButtonMapEvdev* button_map); |
| 30 #if defined(USE_EVDEV_GESTURES) | |
| 31 , | |
| 32 GesturePropertyProvider* gesture_property_provider | |
| 33 #endif | |
| 34 ); | |
| 35 ~InputControllerEvdev() override; | 25 ~InputControllerEvdev() override; |
| 36 | 26 |
| 37 // Initialize device factory. This would be in the constructor if it was | 27 // Initialize device factory. This would be in the constructor if it was |
| 38 // built early enough for that to be possible. | 28 // built early enough for that to be possible. |
| 39 void SetInputDeviceFactory(InputDeviceFactoryEvdev* input_device_factory); | 29 void SetInputDeviceFactory(InputDeviceFactoryEvdev* input_device_factory); |
| 40 | 30 |
| 41 // InputController: | 31 // InputController: |
| 42 bool HasMouse() override; | 32 bool HasMouse() override; |
| 43 bool HasTouchpad() override; | 33 bool HasTouchpad() override; |
| 44 bool IsCapsLockEnabled() override; | 34 bool IsCapsLockEnabled() override; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 void SetPrimaryButtonRight(bool right) override; | 49 void SetPrimaryButtonRight(bool right) override; |
| 60 void SetTapToClickPaused(bool state) override; | 50 void SetTapToClickPaused(bool state) override; |
| 61 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply) override; | 51 void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply) override; |
| 62 void DisableInternalTouchpad() override; | 52 void DisableInternalTouchpad() override; |
| 63 void EnableInternalTouchpad() override; | 53 void EnableInternalTouchpad() override; |
| 64 void DisableInternalKeyboardExceptKeys( | 54 void DisableInternalKeyboardExceptKeys( |
| 65 scoped_ptr<std::set<DomCode>> excepted_keys) override; | 55 scoped_ptr<std::set<DomCode>> excepted_keys) override; |
| 66 void EnableInternalKeyboard() override; | 56 void EnableInternalKeyboard() override; |
| 67 | 57 |
| 68 private: | 58 private: |
| 69 // Set a property value for all devices of one type. | |
| 70 void SetIntPropertyForOneType(const EventDeviceType type, | |
| 71 const std::string& name, | |
| 72 int value); | |
| 73 void SetBoolPropertyForOneType(const EventDeviceType type, | |
| 74 const std::string& name, | |
| 75 bool value); | |
| 76 | |
| 77 // Factory for devices. Needed to update device config. | 59 // Factory for devices. Needed to update device config. |
| 78 InputDeviceFactoryEvdev* input_device_factory_; | 60 InputDeviceFactoryEvdev* input_device_factory_; |
| 79 | 61 |
| 80 // Keyboard state. | 62 // Keyboard state. |
| 81 KeyboardEvdev* keyboard_; | 63 KeyboardEvdev* keyboard_; |
| 82 | 64 |
| 83 // Mouse button map. | 65 // Mouse button map. |
| 84 MouseButtonMapEvdev* button_map_; | 66 MouseButtonMapEvdev* button_map_; |
| 85 | 67 |
| 86 #if defined(USE_EVDEV_GESTURES) | |
| 87 // Gesture library property provider. | |
| 88 GesturePropertyProvider* gesture_property_provider_; | |
| 89 #endif | |
| 90 | |
| 91 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev); | 68 DISALLOW_COPY_AND_ASSIGN(InputControllerEvdev); |
| 92 }; | 69 }; |
| 93 | 70 |
| 94 } // namespace ui | 71 } // namespace ui |
| 95 | 72 |
| 96 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ | 73 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_CONTROLLER_EVDEV_H_ |
| OLD | NEW |