OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_TOUCHUI_TOUCH_FACTORY_H_ | 5 #ifndef VIEWS_TOUCHUI_TOUCH_FACTORY_H_ |
6 #define VIEWS_TOUCHUI_TOUCH_FACTORY_H_ | 6 #define VIEWS_TOUCHUI_TOUCH_FACTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <bitset> | 9 #include <bitset> |
10 #include <vector> | 10 #include <vector> |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 std::bitset<kMaxDeviceNum> touch_device_lookup_; | 167 std::bitset<kMaxDeviceNum> touch_device_lookup_; |
168 | 168 |
169 // The list of touch devices. | 169 // The list of touch devices. |
170 std::vector<int> touch_device_list_; | 170 std::vector<int> touch_device_list_; |
171 | 171 |
172 // Index table to find the valuator for the TouchParam on the specific device | 172 // Index table to find the valuator for the TouchParam on the specific device |
173 // by valuator_lookup_[device_id][touch_params]. Use 2-D array to get fast | 173 // by valuator_lookup_[device_id][touch_params]. Use 2-D array to get fast |
174 // index at the expense of space. If the kMaxDeviceNum grows larger that the | 174 // index at the expense of space. If the kMaxDeviceNum grows larger that the |
175 // space waste becomes a concern, the 2D lookup table can be replaced by a | 175 // space waste becomes a concern, the 2D lookup table can be replaced by a |
176 // hash map. | 176 // hash map. |
177 char valuator_lookup_[kMaxDeviceNum][TP_LAST_ENTRY]; | 177 signed char valuator_lookup_[kMaxDeviceNum][TP_LAST_ENTRY]; |
178 | 178 |
179 // Index table to find the min & max value of the TouchParam on a specific | 179 // Index table to find the min & max value of the TouchParam on a specific |
180 // device. | 180 // device. |
181 int touch_param_min_[kMaxDeviceNum][TP_LAST_ENTRY]; | 181 int touch_param_min_[kMaxDeviceNum][TP_LAST_ENTRY]; |
182 int touch_param_max_[kMaxDeviceNum][TP_LAST_ENTRY]; | 182 int touch_param_max_[kMaxDeviceNum][TP_LAST_ENTRY]; |
183 | 183 |
184 // Maximum simultaneous touch points. | 184 // Maximum simultaneous touch points. |
185 static const int kMaxTouchPoints = 32; | 185 static const int kMaxTouchPoints = 32; |
186 | 186 |
187 // A lookup table for slots in use for a touch event. | 187 // A lookup table for slots in use for a touch event. |
188 std::bitset<kMaxTouchPoints> slots_used_; | 188 std::bitset<kMaxTouchPoints> slots_used_; |
189 | 189 |
190 DISALLOW_COPY_AND_ASSIGN(TouchFactory); | 190 DISALLOW_COPY_AND_ASSIGN(TouchFactory); |
191 }; | 191 }; |
192 | 192 |
193 } // namespace views | 193 } // namespace views |
194 | 194 |
195 #endif // VIEWS_TOUCHUI_TOUCH_FACTORY_H_ | 195 #endif // VIEWS_TOUCHUI_TOUCH_FACTORY_H_ |
OLD | NEW |