Chromium Code Reviews| Index: views/touchui/touch_factory.h |
| diff --git a/views/touchui/touch_factory.h b/views/touchui/touch_factory.h |
| index b18d8c38edede77969c88d8c703ddddf2381e6dd..15d56cbfe2a1f6de9b68a0831b13805d7ecdd98f 100644 |
| --- a/views/touchui/touch_factory.h |
| +++ b/views/touchui/touch_factory.h |
| @@ -42,9 +42,15 @@ class VIEWS_EXPORT TouchFactory { |
| // 'Tracking ID' marks the removal of a touch point. During the lifetime of |
| // a touchpoint, we use the 'Slot ID' as its identifier. The XI_ButtonPress |
| // and XI_ButtonRelease events are ignored. |
| +#if !defined(USE_XI2_1) |
| TP_SLOT_ID, // ID of the finger that triggered a touch event |
| // (useful when tracking multiple simultaneous |
| // touches) |
| +#endif |
| + // NOTE for XInput 2.1: 'Tracking ID' is provided in every touch event to |
| + // track individual touch. 'Tracking ID' is a unsigned 32-bit value and |
|
Daniel Kurtz
2011/09/08 23:09:58
is an unsigned
ningxin.hu
2011/09/09 05:08:54
Thanks. Will correct.
|
| + // is increased for each new touch. It will wrap back to 0 when reaching |
| + // the numerical limit. |
| TP_TRACKING_ID, // ID of the touch point. |
| TP_LAST_ENTRY |
| @@ -71,11 +77,13 @@ class VIEWS_EXPORT TouchFactory { |
| // Is the device a touch-device? |
| bool IsTouchDevice(unsigned int deviceid) const; |
| +#if !defined(USE_XI2_1) |
| // 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. |
| @@ -151,6 +159,14 @@ class VIEWS_EXPORT TouchFactory { |
| // The invisible cursor. |
| Cursor invisible_cursor_; |
| +#if !defined(USE_XI2_1) |
|
Daniel Kurtz
2011/09/08 23:09:58
Was there a reason to move this up?
ningxin.hu
2011/09/09 05:08:54
The reason is member initialization sequence when
|
| + // 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 |
| + |
| // NOTE: To keep track of touch devices, we currently maintain a lookup table |
| // to quickly decide if a device is a touch device or not. We also maintain a |
| // list of the touch devices. Ideally, there will be only one touch device, |
| @@ -182,12 +198,6 @@ class VIEWS_EXPORT TouchFactory { |
| int touch_param_min_[kMaxDeviceNum][TP_LAST_ENTRY]; |
| int touch_param_max_[kMaxDeviceNum][TP_LAST_ENTRY]; |
| - // 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_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(TouchFactory); |
| }; |