Chromium Code Reviews| 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_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ | 5 #ifndef UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ |
| 6 #define UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ | 6 #define UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ |
| 7 | 7 |
| 8 // Generically-named #defines from Xlib is conflicting with symbols in GTest. | 8 // Generically-named #defines from Xlib is conflicting with symbols in GTest. |
| 9 // So many tests .cc file #undef Bool before including device_data_manager.h, | 9 // So many tests .cc file #undef Bool before including device_data_manager.h, |
| 10 // which makes Bool unrecognized in XInput2.h. | 10 // which makes Bool unrecognized in XInput2.h. |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 void SetDisabledKeyboardAllowedKeys( | 232 void SetDisabledKeyboardAllowedKeys( |
| 233 scoped_ptr<std::set<KeyboardCode> > excepted_keys); | 233 scoped_ptr<std::set<KeyboardCode> > excepted_keys); |
| 234 | 234 |
| 235 // Disables and enables events from devices by device id. | 235 // Disables and enables events from devices by device id. |
| 236 void DisableDevice(unsigned int deviceid); | 236 void DisableDevice(unsigned int deviceid); |
| 237 void EnableDevice(unsigned int deviceid); | 237 void EnableDevice(unsigned int deviceid); |
| 238 | 238 |
| 239 // Returns true if |native_event| should be blocked. | 239 // Returns true if |native_event| should be blocked. |
| 240 bool IsEventBlocked(const base::NativeEvent& native_event); | 240 bool IsEventBlocked(const base::NativeEvent& native_event); |
| 241 | 241 |
| 242 const std::vector<int>& master_pointers() const { | |
| 243 return master_pointers_; | |
| 244 } | |
| 245 | |
| 242 protected: | 246 protected: |
| 243 // DeviceHotplugEventObserver: | 247 // DeviceHotplugEventObserver: |
| 244 void OnKeyboardDevicesUpdated( | 248 void OnKeyboardDevicesUpdated( |
| 245 const std::vector<KeyboardDevice>& devices) override; | 249 const std::vector<KeyboardDevice>& devices) override; |
| 246 | 250 |
| 247 private: | 251 private: |
| 248 DeviceDataManagerX11(); | 252 DeviceDataManagerX11(); |
| 249 ~DeviceDataManagerX11() override; | 253 ~DeviceDataManagerX11() override; |
| 250 | 254 |
| 251 // Initialize the XInput related system information. | 255 // Initialize the XInput related system information. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 267 int xi_opcode_; | 271 int xi_opcode_; |
| 268 | 272 |
| 269 // A quick lookup table for determining if the XI event is an XIDeviceEvent. | 273 // A quick lookup table for determining if the XI event is an XIDeviceEvent. |
| 270 std::bitset<kMaxXIEventType> xi_device_event_types_; | 274 std::bitset<kMaxXIEventType> xi_device_event_types_; |
| 271 | 275 |
| 272 // A quick lookup table for determining if events from the pointer device | 276 // A quick lookup table for determining if events from the pointer device |
| 273 // should be processed. | 277 // should be processed. |
| 274 std::bitset<kMaxDeviceNum> cmt_devices_; | 278 std::bitset<kMaxDeviceNum> cmt_devices_; |
| 275 std::bitset<kMaxDeviceNum> touchpads_; | 279 std::bitset<kMaxDeviceNum> touchpads_; |
| 276 | 280 |
| 281 // List of the master pointer devices. Used for grabbing mouse capture. | |
|
sadrul
2014/12/22 21:08:59
Remove the second sentence. (let's not require fut
pkotwicz
2014/12/23 00:29:49
Done.
| |
| 282 std::vector<int> master_pointers_; | |
| 283 | |
| 277 // A quick lookup table for determining if events from the XI device | 284 // A quick lookup table for determining if events from the XI device |
| 278 // should be blocked. | 285 // should be blocked. |
| 279 std::bitset<kMaxDeviceNum> blocked_devices_; | 286 std::bitset<kMaxDeviceNum> blocked_devices_; |
| 280 | 287 |
| 281 // The set of keys allowed while the keyboard is blocked. | 288 // The set of keys allowed while the keyboard is blocked. |
| 282 scoped_ptr<std::set<KeyboardCode> > blocked_keyboard_allowed_keys_; | 289 scoped_ptr<std::set<KeyboardCode> > blocked_keyboard_allowed_keys_; |
| 283 | 290 |
| 284 // Number of valuators on the specific device. | 291 // Number of valuators on the specific device. |
| 285 int valuator_count_[kMaxDeviceNum]; | 292 int valuator_count_[kMaxDeviceNum]; |
| 286 | 293 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 315 | 322 |
| 316 unsigned char button_map_[256]; | 323 unsigned char button_map_[256]; |
| 317 int button_map_count_; | 324 int button_map_count_; |
| 318 | 325 |
| 319 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11); | 326 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11); |
| 320 }; | 327 }; |
| 321 | 328 |
| 322 } // namespace ui | 329 } // namespace ui |
| 323 | 330 |
| 324 #endif // UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ | 331 #endif // UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ |
| OLD | NEW |