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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 base::NativeEvent CopyNativeEvent( | 109 base::NativeEvent CopyNativeEvent( |
110 const base::NativeEvent& native_event); | 110 const base::NativeEvent& native_event); |
111 | 111 |
112 // Delete a |native_event| previously created by CopyNativeEvent(). | 112 // Delete a |native_event| previously created by CopyNativeEvent(). |
113 void ReleaseCopiedNativeEvent( | 113 void ReleaseCopiedNativeEvent( |
114 const base::NativeEvent& native_event); | 114 const base::NativeEvent& native_event); |
115 | 115 |
116 // Gets the touch id from a native event. | 116 // Gets the touch id from a native event. |
117 EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); | 117 EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); |
118 | 118 |
119 // Increases the number of times |ClearTouchIdIfReleased| needs to be called on | |
120 // an event with a given touch id before it will actually be cleared. | |
121 EVENTS_EXPORT void IncrementTouchIdRefCount( | |
122 const base::NativeEvent& native_event); | |
123 | |
124 // Clear the touch id from bookkeeping if it is a release/cancel event. | 119 // Clear the touch id from bookkeeping if it is a release/cancel event. |
125 EVENTS_EXPORT void ClearTouchIdIfReleased( | 120 EVENTS_EXPORT void ClearTouchIdIfReleased( |
126 const base::NativeEvent& native_event); | 121 const base::NativeEvent& native_event); |
127 | 122 |
128 // Gets the radius along the X/Y axis from a native event. Default is 1.0. | 123 // Gets the radius along the X/Y axis from a native event. Default is 1.0. |
129 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); | 124 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); |
130 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); | 125 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); |
131 | 126 |
132 // Gets the angle of the major axis away from the X axis. Default is 0.0. | 127 // Gets the angle of the major axis away from the X axis. Default is 0.0. |
133 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); | 128 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Update the native X11 event to correspond to the new button flags. | 175 // Update the native X11 event to correspond to the new button flags. |
181 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 176 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
182 #endif | 177 #endif |
183 | 178 |
184 // Registers a custom event type. | 179 // Registers a custom event type. |
185 EVENTS_EXPORT int RegisterCustomEventType(); | 180 EVENTS_EXPORT int RegisterCustomEventType(); |
186 | 181 |
187 } // namespace ui | 182 } // namespace ui |
188 | 183 |
189 #endif // UI_EVENTS_EVENT_UTILS_H_ | 184 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |