OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_X_DEVICE_DATA_MANAGER_H_ | 5 #ifndef UI_EVENTS_X_DEVICE_DATA_MANAGER_H_ |
6 #define UI_EVENTS_X_DEVICE_DATA_MANAGER_H_ | 6 #define UI_EVENTS_X_DEVICE_DATA_MANAGER_H_ |
7 | 7 |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 | 9 |
10 #include <bitset> | 10 #include <bitset> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 // Returns the DeviceDataManager singleton. | 97 // Returns the DeviceDataManager singleton. |
98 static DeviceDataManager* GetInstance(); | 98 static DeviceDataManager* GetInstance(); |
99 | 99 |
100 // Natural scroll setter/getter. | 100 // Natural scroll setter/getter. |
101 bool natural_scroll_enabled() const { return natural_scroll_enabled_; } | 101 bool natural_scroll_enabled() const { return natural_scroll_enabled_; } |
102 void set_natural_scroll_enabled(bool enabled) { | 102 void set_natural_scroll_enabled(bool enabled) { |
103 natural_scroll_enabled_ = enabled; | 103 natural_scroll_enabled_ = enabled; |
104 } | 104 } |
105 | 105 |
106 // Returns if XInput2 is available on the system. | |
107 bool IsXInput2Available() const; | |
108 | |
109 // Get the natural scroll direction multiplier (1.0f or -1.0f). | 106 // Get the natural scroll direction multiplier (1.0f or -1.0f). |
110 float GetNaturalScrollFactor(int sourceid) const; | 107 float GetNaturalScrollFactor(int sourceid) const; |
111 | 108 |
112 // Updates the list of devices. | 109 // Updates the list of devices. |
113 void UpdateDeviceList(Display* display); | 110 void UpdateDeviceList(Display* display); |
114 | 111 |
115 // For multitouch events we use slot number to distinguish touches from | 112 // For multitouch events we use slot number to distinguish touches from |
116 // different fingers. This function returns true if the associated slot | 113 // different fingers. This function returns true if the associated slot |
117 // for |xiev| can be found and it is saved in |slot|, returns false if | 114 // for |xiev| can be found and it is saved in |slot|, returns false if |
118 // no slot can be found. | 115 // no slot can be found. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 278 |
282 unsigned char button_map_[256]; | 279 unsigned char button_map_[256]; |
283 int button_map_count_; | 280 int button_map_count_; |
284 | 281 |
285 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); | 282 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); |
286 }; | 283 }; |
287 | 284 |
288 } // namespace ui | 285 } // namespace ui |
289 | 286 |
290 #endif // UI_EVENTS_X_DEVICE_DATA_MANAGER_H_ | 287 #endif // UI_EVENTS_X_DEVICE_DATA_MANAGER_H_ |
OLD | NEW |