| 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 UI_BASE_TOUCH_TOUCH_FACTORY_H_ | 5 #ifndef UI_BASE_TOUCH_TOUCH_FACTORY_H_ |
| 6 #define UI_BASE_TOUCH_TOUCH_FACTORY_H_ | 6 #define UI_BASE_TOUCH_TOUCH_FACTORY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <bitset> | 9 #include <bitset> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // successful. Returns false and |value| is unchanged otherwise. | 127 // successful. Returns false and |value| is unchanged otherwise. |
| 128 bool NormalizeTouchParam(unsigned int deviceid, TouchParam tp, float* value); | 128 bool NormalizeTouchParam(unsigned int deviceid, TouchParam tp, float* value); |
| 129 | 129 |
| 130 // Extract the range of the TouchParam. Return true if the range is available | 130 // Extract the range of the TouchParam. Return true if the range is available |
| 131 // and written into min & max, false if the range is not available. | 131 // and written into min & max, false if the range is not available. |
| 132 bool GetTouchParamRange(unsigned int deviceid, | 132 bool GetTouchParamRange(unsigned int deviceid, |
| 133 TouchParam tp, | 133 TouchParam tp, |
| 134 float* min, | 134 float* min, |
| 135 float* max); | 135 float* max); |
| 136 | 136 |
| 137 void set_keep_mouse_cursor(bool keep) { keep_mouse_cursor_ = keep; } | |
| 138 bool keep_mouse_cursor() const { return keep_mouse_cursor_; } | |
| 139 | |
| 140 private: | 137 private: |
| 141 TouchFactory(); | 138 TouchFactory(); |
| 142 | 139 |
| 143 ~TouchFactory(); | 140 ~TouchFactory(); |
| 144 | 141 |
| 145 void HideCursorForInactivity() { | 142 void HideCursorForInactivity() { |
| 146 SetCursorVisible(false, false); | 143 SetCursorVisible(false, false); |
| 147 } | 144 } |
| 148 | 145 |
| 149 // Setup the internal bookkeeping of the touch params valuator information for | 146 // Setup the internal bookkeeping of the touch params valuator information for |
| 150 // touch devices | 147 // touch devices |
| 151 void SetupValuator(); | 148 void SetupValuator(); |
| 152 | 149 |
| 153 // Requirement for Signleton | 150 // Requirement for Signleton |
| 154 friend struct DefaultSingletonTraits<TouchFactory>; | 151 friend struct DefaultSingletonTraits<TouchFactory>; |
| 155 | 152 |
| 156 // The default cursor is hidden after startup, and when the mouse pointer is | 153 // The default cursor is hidden after startup, and when the mouse pointer is |
| 157 // idle for a while. Once there is some event from a mouse device, the cursor | 154 // idle for a while. Once there is some event from a mouse device, the cursor |
| 158 // is immediately displayed. | 155 // is immediately displayed. |
| 159 bool is_cursor_visible_; | 156 bool is_cursor_visible_; |
| 160 | 157 |
| 161 // Whether to turn off automatic hiding of mouse cursor. This is useful for | |
| 162 // debugging touch build on the desktop. | |
| 163 bool keep_mouse_cursor_; | |
| 164 | |
| 165 // The cursor is hidden if it is idle for a certain amount time. This timer | 158 // The cursor is hidden if it is idle for a certain amount time. This timer |
| 166 // is used to keep track of the idleness. | 159 // is used to keep track of the idleness. |
| 167 base::OneShotTimer<TouchFactory> cursor_timer_; | 160 base::OneShotTimer<TouchFactory> cursor_timer_; |
| 168 | 161 |
| 169 // The default cursor. | 162 // The default cursor. |
| 170 Cursor arrow_cursor_; | 163 Cursor arrow_cursor_; |
| 171 | 164 |
| 172 // The invisible cursor. | 165 // The invisible cursor. |
| 173 Cursor invisible_cursor_; | 166 Cursor invisible_cursor_; |
| 174 | 167 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 218 |
| 226 // A lookup table for slots in use for a touch event. | 219 // A lookup table for slots in use for a touch event. |
| 227 std::bitset<kMaxTouchPoints> slots_used_; | 220 std::bitset<kMaxTouchPoints> slots_used_; |
| 228 | 221 |
| 229 DISALLOW_COPY_AND_ASSIGN(TouchFactory); | 222 DISALLOW_COPY_AND_ASSIGN(TouchFactory); |
| 230 }; | 223 }; |
| 231 | 224 |
| 232 } // namespace ui | 225 } // namespace ui |
| 233 | 226 |
| 234 #endif // UI_BASE_TOUCH_TOUCH_FACTORY_H_ | 227 #endif // UI_BASE_TOUCH_TOUCH_FACTORY_H_ |
| OLD | NEW |