Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: ui/events/ozone/evdev/input_device_factory_evdev.h

Issue 2805793002: ozone: evdev: Add gamepad support (Closed)
Patch Set: Support Gamepad in Ozone. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_DEVICE_FACTORY_EVDEV_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ 6 #define UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // Policy for device enablement. 83 // Policy for device enablement.
84 bool IsDeviceEnabled(const EventConverterEvdev* converter); 84 bool IsDeviceEnabled(const EventConverterEvdev* converter);
85 85
86 // Update observers on device changes. 86 // Update observers on device changes.
87 void UpdateDirtyFlags(const EventConverterEvdev* converter); 87 void UpdateDirtyFlags(const EventConverterEvdev* converter);
88 void NotifyDevicesUpdated(); 88 void NotifyDevicesUpdated();
89 void NotifyKeyboardsUpdated(); 89 void NotifyKeyboardsUpdated();
90 void NotifyTouchscreensUpdated(); 90 void NotifyTouchscreensUpdated();
91 void NotifyMouseDevicesUpdated(); 91 void NotifyMouseDevicesUpdated();
92 void NotifyTouchpadDevicesUpdated(); 92 void NotifyTouchpadDevicesUpdated();
93 void NotifyGamepadDevicesUpdated();
93 94
94 void SetIntPropertyForOneType(const EventDeviceType type, 95 void SetIntPropertyForOneType(const EventDeviceType type,
95 const std::string& name, 96 const std::string& name,
96 int value); 97 int value);
97 void SetBoolPropertyForOneType(const EventDeviceType type, 98 void SetBoolPropertyForOneType(const EventDeviceType type,
98 const std::string& name, 99 const std::string& name,
99 bool value); 100 bool value);
100 101
101 // Task runner for our thread. 102 // Task runner for our thread.
102 scoped_refptr<base::TaskRunner> task_runner_; 103 scoped_refptr<base::TaskRunner> task_runner_;
103 104
104 // Cursor movement. 105 // Cursor movement.
105 CursorDelegateEvdev* cursor_; 106 CursorDelegateEvdev* cursor_;
106 107
107 #if defined(USE_EVDEV_GESTURES) 108 #if defined(USE_EVDEV_GESTURES)
108 // Gesture library property provider (used by touchpads/mice). 109 // Gesture library property provider (used by touchpads/mice).
109 std::unique_ptr<GesturePropertyProvider> gesture_property_provider_; 110 std::unique_ptr<GesturePropertyProvider> gesture_property_provider_;
110 #endif 111 #endif
111 112
112 // Dispatcher for events. 113 // Dispatcher for events.
113 std::unique_ptr<DeviceEventDispatcherEvdev> dispatcher_; 114 std::unique_ptr<DeviceEventDispatcherEvdev> dispatcher_;
114 115
115 // Number of pending device additions & device classes. 116 // Number of pending device additions & device classes.
116 int pending_device_changes_ = 0; 117 int pending_device_changes_ = 0;
117 bool touchscreen_list_dirty_ = true; 118 bool touchscreen_list_dirty_ = true;
118 bool keyboard_list_dirty_ = true; 119 bool keyboard_list_dirty_ = true;
119 bool mouse_list_dirty_ = true; 120 bool mouse_list_dirty_ = true;
120 bool touchpad_list_dirty_ = true; 121 bool touchpad_list_dirty_ = true;
122 bool gamepad_list_dirty_ = true;
121 123
122 // Whether we have a list of devices that were present at startup. 124 // Whether we have a list of devices that were present at startup.
123 bool startup_devices_enumerated_ = false; 125 bool startup_devices_enumerated_ = false;
124 126
125 // Whether devices that were present at startup are open. 127 // Whether devices that were present at startup are open.
126 bool startup_devices_opened_ = false; 128 bool startup_devices_opened_ = false;
127 129
128 // LEDs. 130 // LEDs.
129 bool caps_lock_led_enabled_ = false; 131 bool caps_lock_led_enabled_ = false;
130 132
131 // Whether touch palm suppression is enabled. 133 // Whether touch palm suppression is enabled.
132 bool palm_suppression_enabled_ = false; 134 bool palm_suppression_enabled_ = false;
133 135
134 // Device settings. These primarily affect libgestures behavior. 136 // Device settings. These primarily affect libgestures behavior.
135 InputDeviceSettingsEvdev input_device_settings_; 137 InputDeviceSettingsEvdev input_device_settings_;
136 138
137 // Owned per-device event converters (by path). 139 // Owned per-device event converters (by path).
138 // NB: This should be destroyed early, before any shared state. 140 // NB: This should be destroyed early, before any shared state.
139 std::map<base::FilePath, std::unique_ptr<EventConverterEvdev>> converters_; 141 std::map<base::FilePath, std::unique_ptr<EventConverterEvdev>> converters_;
140 142
141 // Support weak pointers for attach & detach callbacks. 143 // Support weak pointers for attach & detach callbacks.
142 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_; 144 base::WeakPtrFactory<InputDeviceFactoryEvdev> weak_ptr_factory_;
143 145
144 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev); 146 DISALLOW_COPY_AND_ASSIGN(InputDeviceFactoryEvdev);
145 }; 147 };
146 148
147 } // namespace ui 149 } // namespace ui
148 150
149 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_ 151 #endif // UI_EVENTS_OZONE_EVDEV_INPUT_DEVICE_FACTORY_EVDEV_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/gamepad_event_converter_evdev_unittest.cc ('k') | ui/events/ozone/evdev/input_device_factory_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698