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_EVENT_UTILS_H_ | 5 #ifndef UI_EVENTS_EVENT_UTILS_H_ |
6 #define UI_EVENTS_EVENT_UTILS_H_ | 6 #define UI_EVENTS_EVENT_UTILS_H_ |
7 | 7 |
8 #include "base/event_types.h" | 8 #include "base/event_types.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 base::NativeEvent CopyNativeEvent( | 99 base::NativeEvent CopyNativeEvent( |
100 const base::NativeEvent& native_event); | 100 const base::NativeEvent& native_event); |
101 | 101 |
102 // Delete a |native_event| previously created by CopyNativeEvent(). | 102 // Delete a |native_event| previously created by CopyNativeEvent(). |
103 void ReleaseCopiedNativeEvent( | 103 void ReleaseCopiedNativeEvent( |
104 const base::NativeEvent& native_event); | 104 const base::NativeEvent& native_event); |
105 | 105 |
106 // Gets the touch id from a native event. | 106 // Gets the touch id from a native event. |
107 EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); | 107 EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); |
108 | 108 |
| 109 // Increases the number of times |ClearTouchIdIfReleased| needs to be called on |
| 110 // an event with a given touch id before it will actually be cleared. |
| 111 EVENTS_EXPORT void IncrementTouchIdRefCount( |
| 112 const base::NativeEvent& native_event); |
| 113 |
109 // Clear the touch id from bookkeeping if it is a release/cancel event. | 114 // Clear the touch id from bookkeeping if it is a release/cancel event. |
110 EVENTS_EXPORT void ClearTouchIdIfReleased( | 115 EVENTS_EXPORT void ClearTouchIdIfReleased( |
111 const base::NativeEvent& native_event); | 116 const base::NativeEvent& native_event); |
112 | 117 |
113 // Gets the radius along the X/Y axis from a native event. Default is 1.0. | 118 // Gets the radius along the X/Y axis from a native event. Default is 1.0. |
114 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); | 119 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); |
115 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); | 120 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); |
116 | 121 |
117 // Gets the angle of the major axis away from the X axis. Default is 0.0. | 122 // Gets the angle of the major axis away from the X axis. Default is 0.0. |
118 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); | 123 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 167 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
163 | 168 |
164 #endif | 169 #endif |
165 | 170 |
166 // Registers a custom event type. | 171 // Registers a custom event type. |
167 EVENTS_EXPORT int RegisterCustomEventType(); | 172 EVENTS_EXPORT int RegisterCustomEventType(); |
168 | 173 |
169 } // namespace ui | 174 } // namespace ui |
170 | 175 |
171 #endif // UI_EVENTS_EVENT_UTILS_H_ | 176 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |