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

Side by Side Diff: ui/events/devices/x11/device_data_manager_x11.h

Issue 2077163003: Reduced number of UpdateDeviceList calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed DCHECK_EQ to else if, added ALL_DEVICES enum Created 4 years, 5 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_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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 DT_TOUCH_TRACKING_ID, // ID of the touch point. 102 DT_TOUCH_TRACKING_ID, // ID of the touch point.
103 103
104 // Kernel timestamp from touch screen (if available). 104 // Kernel timestamp from touch screen (if available).
105 DT_TOUCH_RAW_TIMESTAMP, 105 DT_TOUCH_RAW_TIMESTAMP,
106 106
107 // End of touch data types. 107 // End of touch data types.
108 108
109 DT_LAST_ENTRY // This must come last. 109 DT_LAST_ENTRY // This must come last.
110 }; 110 };
111 111
112 // Device ID numbers that can be passed to InvalidateScrollClasses. Other
113 // valid values are 0 to kMaxDeviceNum.
114 enum DeviceID {
115 ALL_DEVICES = -1,
116 };
sadrul 2016/07/19 15:03:24 Use "static const int kAllDevices = -1;" instead?
117
112 // Data struct to store extracted data from an input event. 118 // Data struct to store extracted data from an input event.
113 typedef std::map<int, double> EventData; 119 typedef std::map<int, double> EventData;
114 120
115 static void CreateInstance(); 121 static void CreateInstance();
116 122
117 // We use int because enums can be casted to ints but not vice versa. 123 // We use int because enums can be casted to ints but not vice versa.
118 static bool IsCMTDataType(const int type); 124 static bool IsCMTDataType(const int type);
119 static bool IsTouchDataType(const int type); 125 static bool IsTouchDataType(const int type);
120 126
121 // Returns the DeviceDataManagerX11 singleton. 127 // Returns the DeviceDataManagerX11 singleton.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 int* finger_count); 199 int* finger_count);
194 200
195 // Extract data from a scroll class event (smooth scrolling). User must 201 // Extract data from a scroll class event (smooth scrolling). User must
196 // first verify the event type with GetScrollClassEventDetail. 202 // first verify the event type with GetScrollClassEventDetail.
197 // Pointers shouldn't be NULL. 203 // Pointers shouldn't be NULL.
198 void GetScrollClassOffsets(const XEvent& xev, 204 void GetScrollClassOffsets(const XEvent& xev,
199 double* x_offset, 205 double* x_offset,
200 double* y_offset); 206 double* y_offset);
201 207
202 // Invalidate stored scroll class counters, since they can change when 208 // Invalidate stored scroll class counters, since they can change when
203 // pointing at other windows. 209 // pointing at other windows. If ALL_DEVICES is specified, all devices are
204 void InvalidateScrollClasses(); 210 // invalidated.
211 void InvalidateScrollClasses(int device_id);
205 212
206 // Extract data from a fling event. User must first verify the event type 213 // Extract data from a fling event. User must first verify the event type
207 // with IsFlingEvent. Pointers shouldn't be NULL. 214 // with IsFlingEvent. Pointers shouldn't be NULL.
208 void GetFlingData(const XEvent& xev, 215 void GetFlingData(const XEvent& xev,
209 float* vx, 216 float* vx,
210 float* vy, 217 float* vy,
211 float* vx_ordinal, 218 float* vx_ordinal,
212 float* vy_ordinal, 219 float* vy_ordinal,
213 bool* is_cancel); 220 bool* is_cancel);
214 221
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 397
391 unsigned char button_map_[256]; 398 unsigned char button_map_[256];
392 int button_map_count_; 399 int button_map_count_;
393 400
394 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11); 401 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11);
395 }; 402 };
396 403
397 } // namespace ui 404 } // namespace ui
398 405
399 #endif // UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ 406 #endif // UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/devices/x11/device_data_manager_x11.cc » ('j') | ui/events/platform/x11/x11_event_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698