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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 // Returns true if |native_event| should be blocked. | 270 // Returns true if |native_event| should be blocked. |
271 bool IsEventBlocked(const XEvent& xev); | 271 bool IsEventBlocked(const XEvent& xev); |
272 | 272 |
273 const std::vector<int>& master_pointers() const { | 273 const std::vector<int>& master_pointers() const { |
274 return master_pointers_; | 274 return master_pointers_; |
275 } | 275 } |
276 | 276 |
277 protected: | 277 protected: |
278 // DeviceHotplugEventObserver: | 278 // DeviceHotplugEventObserver: |
279 void OnKeyboardDevicesUpdated( | 279 void OnKeyboardDevicesUpdated( |
280 const std::vector<KeyboardDevice>& devices) override; | 280 const std::vector<InputDevice>& devices) override; |
281 | 281 |
282 private: | 282 private: |
283 // Information about scroll valuators | 283 // Information about scroll valuators |
284 struct ScrollInfo { | 284 struct ScrollInfo { |
285 struct AxisInfo { | 285 struct AxisInfo { |
286 // The scroll valuator number of this scroll axis. | 286 // The scroll valuator number of this scroll axis. |
287 int number; | 287 int number; |
288 // The scroll increment; a value of n indicates n movement equals one | 288 // The scroll increment; a value of n indicates n movement equals one |
289 // traditional scroll unit. | 289 // traditional scroll unit. |
290 double increment; | 290 double increment; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 // a specified slot of a device. Defaults to 0 if the valuator for that slot | 376 // a specified slot of a device. Defaults to 0 if the valuator for that slot |
377 // was not specified in an earlier event. With MT-B/XI2.2, valuators in an | 377 // was not specified in an earlier event. With MT-B/XI2.2, valuators in an |
378 // XEvent are not reported if the values haven't changed from the previous | 378 // XEvent are not reported if the values haven't changed from the previous |
379 // event. So it is necessary to remember these valuators so that chrome | 379 // event. So it is necessary to remember these valuators so that chrome |
380 // doesn't think X/device doesn't know about the valuators. We currently | 380 // doesn't think X/device doesn't know about the valuators. We currently |
381 // use this only on touchscreen devices. | 381 // use this only on touchscreen devices. |
382 std::vector<double> last_seen_valuator_[kMaxDeviceNum][kMaxSlotNum]; | 382 std::vector<double> last_seen_valuator_[kMaxDeviceNum][kMaxSlotNum]; |
383 | 383 |
384 // Map that stores meta-data for blocked keyboards. This is needed to restore | 384 // Map that stores meta-data for blocked keyboards. This is needed to restore |
385 // devices when they are re-enabled. | 385 // devices when they are re-enabled. |
386 std::map<int, ui::KeyboardDevice> blocked_keyboards_; | 386 std::map<int, ui::InputDevice> blocked_keyboards_; |
sky
2016/05/31 18:13:45
blocked_keyboard_devices?
kylechar
2016/05/31 19:31:12
Done.
| |
387 | 387 |
388 // X11 atoms cache. | 388 // X11 atoms cache. |
389 X11AtomCache atom_cache_; | 389 X11AtomCache atom_cache_; |
390 | 390 |
391 unsigned char button_map_[256]; | 391 unsigned char button_map_[256]; |
392 int button_map_count_; | 392 int button_map_count_; |
393 | 393 |
394 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11); | 394 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11); |
395 }; | 395 }; |
396 | 396 |
397 } // namespace ui | 397 } // namespace ui |
398 | 398 |
399 #endif // UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ | 399 #endif // UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ |
OLD | NEW |