OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TOUCH_FACTORY_X11_H_ | 5 #ifndef UI_EVENTS_X_TOUCH_FACTORY_X11_H_ |
6 #define UI_EVENTS_X_TOUCH_FACTORY_X11_H_ | 6 #define UI_EVENTS_X_TOUCH_FACTORY_X11_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 // Tries to find an existing slot ID mapping to tracking ID. If there | 65 // Tries to find an existing slot ID mapping to tracking ID. If there |
66 // isn't one already, allocates a new slot ID and sets up the mapping. | 66 // isn't one already, allocates a new slot ID and sets up the mapping. |
67 int GetSlotForTrackingID(uint32 tracking_id); | 67 int GetSlotForTrackingID(uint32 tracking_id); |
68 | 68 |
69 // Releases the slot ID mapping to tracking ID. | 69 // Releases the slot ID mapping to tracking ID. |
70 void ReleaseSlotForTrackingID(uint32 tracking_id); | 70 void ReleaseSlotForTrackingID(uint32 tracking_id); |
71 | 71 |
72 // Whether any touch device is currently present and enabled. | 72 // Whether any touch device is currently present and enabled. |
73 bool IsTouchDevicePresent(); | 73 bool IsTouchDevicePresent(); |
74 | 74 |
75 // Return maximum simultaneous touch points supported by device. | |
76 int MaxTouchPoints(); | |
sadrul
2013/11/15 19:48:53
GetMaxTouchPoints() const
Yufeng Shen (Slow to review)
2013/11/15 19:57:56
Done.
| |
77 | |
75 // Sets up the device id in the list |devices| as multi-touch capable | 78 // Sets up the device id in the list |devices| as multi-touch capable |
76 // devices and enables touch events processing. This function is only | 79 // devices and enables touch events processing. This function is only |
77 // for test purpose, and it does not query from X server. | 80 // for test purpose, and it does not query from X server. |
78 void SetTouchDeviceForTest(const std::vector<unsigned int>& devices); | 81 void SetTouchDeviceForTest(const std::vector<unsigned int>& devices); |
79 | 82 |
80 private: | 83 private: |
81 // Requirement for Singleton | 84 // Requirement for Singleton |
82 friend struct DefaultSingletonTraits<TouchFactory>; | 85 friend struct DefaultSingletonTraits<TouchFactory>; |
83 | 86 |
84 // NOTE: To keep track of touch devices, we currently maintain a lookup table | 87 // NOTE: To keep track of touch devices, we currently maintain a lookup table |
(...skipping 18 matching lines...) Expand all Loading... | |
103 // Indicates whether touch events are explicitly disabled. | 106 // Indicates whether touch events are explicitly disabled. |
104 bool touch_events_disabled_; | 107 bool touch_events_disabled_; |
105 | 108 |
106 // The list of touch devices. For testing/debugging purposes, a single-pointer | 109 // The list of touch devices. For testing/debugging purposes, a single-pointer |
107 // device (mouse or touch screen without sufficient X/driver support for MT) | 110 // device (mouse or touch screen without sufficient X/driver support for MT) |
108 // can sometimes be treated as a touch device. The key in the map represents | 111 // can sometimes be treated as a touch device. The key in the map represents |
109 // the device id, and the value represents if the device is multi-touch | 112 // the device id, and the value represents if the device is multi-touch |
110 // capable. | 113 // capable. |
111 std::map<int, bool> touch_device_list_; | 114 std::map<int, bool> touch_device_list_; |
112 | 115 |
113 // Maximum simultaneous touch points. | 116 // Maximum simultaneous touch points supported by device. In the case of |
114 static const int kMaxTouchPoints = 32; | 117 // devices with multiple digitizers (e.g. multiple touchscreens), the value |
118 // is the maximum of the set of maximum supported contacts by each individual | |
119 // digitizer. | |
120 int max_touch_points_; | |
115 | 121 |
116 SequentialIDGenerator id_generator_; | 122 SequentialIDGenerator id_generator_; |
117 | 123 |
118 DISALLOW_COPY_AND_ASSIGN(TouchFactory); | 124 DISALLOW_COPY_AND_ASSIGN(TouchFactory); |
119 }; | 125 }; |
120 | 126 |
121 } // namespace ui | 127 } // namespace ui |
122 | 128 |
123 #endif // UI_EVENTS_X_TOUCH_FACTORY_X11_H_ | 129 #endif // UI_EVENTS_X_TOUCH_FACTORY_X11_H_ |
OLD | NEW |