Index: views/touchui/touch_factory.h |
diff --git a/views/touchui/touch_factory.h b/views/touchui/touch_factory.h |
index ca281e420e64d42dc2fbd48e890fe8107358f6ff..8e9796e951e61f9fa5c93fc60413d1784f1f5974 100644 |
--- a/views/touchui/touch_factory.h |
+++ b/views/touchui/touch_factory.h |
@@ -10,6 +10,7 @@ |
#include <vector> |
#include "base/memory/singleton.h" |
+#include "base/hash_tables.h" |
#include "base/timer.h" |
#include "views/views_export.h" |
@@ -77,13 +78,19 @@ class VIEWS_EXPORT TouchFactory { |
// Is the device a touch-device? |
bool IsTouchDevice(unsigned int deviceid) const; |
-#if !defined(USE_XI2_MT) |
+#if defined(USE_XI2_MT) |
+ // Allocate a slot id according to tracking id. |
+ int AllocateSlotIdForTrackingId(uint32 tracking_id); |
sadrul
2011/09/19 16:13:36
Let's call this GetSlotIdForTracking, and update t
ningxin.hu
2011/09/20 16:08:49
Thanks for the comment. Will do that.
|
+ |
+ // Release the slot id according to tracking id. |
sadrul
2011/09/19 16:13:36
Releases
ningxin.hu
2011/09/20 16:08:49
Will correct. Thanks.
|
+ void ReleaseSlotIdForTrackingId(uint32 tracking_id); |
+#endif |
+ |
// Is the slot ID currently used? |
bool IsSlotUsed(int slot) const; |
// Marks a slot as being used/unused. |
void SetSlotUsed(int slot, bool used); |
-#endif |
// Grabs the touch devices for the specified window on the specified display. |
// Returns if grab was successful for all touch devices. |
@@ -190,14 +197,17 @@ class VIEWS_EXPORT TouchFactory { |
int touch_param_min_[kMaxDeviceNum][TP_LAST_ENTRY]; |
int touch_param_max_[kMaxDeviceNum][TP_LAST_ENTRY]; |
-#if !defined(USE_XI2_MT) |
// Maximum simultaneous touch points. |
static const int kMaxTouchPoints = 32; |
// A lookup table for slots in use for a touch event. |
std::bitset<kMaxTouchPoints> slots_used_; |
-#endif |
+#if defined(USE_XI2_MT) |
+ // A hash table for tracking id to slot id mapping |
+ typedef base::hash_map<uint32, int> TrackingIdMap; |
+ TrackingIdMap tracking_id_map_; |
+#endif |
DISALLOW_COPY_AND_ASSIGN(TouchFactory); |
}; |