| 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 |
| 119 // Clear the touch id from bookkeeping if it is a release/cancel event. | 124 // Clear the touch id from bookkeeping if it is a release/cancel event. |
| 120 EVENTS_EXPORT void ClearTouchIdIfReleased( | 125 EVENTS_EXPORT void ClearTouchIdIfReleased( |
| 121 const base::NativeEvent& native_event); | 126 const base::NativeEvent& native_event); |
| 122 | 127 |
| 123 // Gets the radius along the X/Y axis from a native event. Default is 1.0. | 128 // Gets the radius along the X/Y axis from a native event. Default is 1.0. |
| 124 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); | 129 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); |
| 125 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); | 130 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); |
| 126 | 131 |
| 127 // Gets the angle of the major axis away from the X axis. Default is 0.0. | 132 // Gets the angle of the major axis away from the X axis. Default is 0.0. |
| 128 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); | 133 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Update the native X11 event to correspond to the new button flags. | 180 // Update the native X11 event to correspond to the new button flags. |
| 176 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 181 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
| 177 #endif | 182 #endif |
| 178 | 183 |
| 179 // Registers a custom event type. | 184 // Registers a custom event type. |
| 180 EVENTS_EXPORT int RegisterCustomEventType(); | 185 EVENTS_EXPORT int RegisterCustomEventType(); |
| 181 | 186 |
| 182 } // namespace ui | 187 } // namespace ui |
| 183 | 188 |
| 184 #endif // UI_EVENTS_EVENT_UTILS_H_ | 189 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |