| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 EVENTS_EXPORT void ClearTouchIdIfReleased( | 126 EVENTS_EXPORT void ClearTouchIdIfReleased( |
| 127 const base::NativeEvent& native_event); | 127 const base::NativeEvent& native_event); |
| 128 | 128 |
| 129 // Gets the radius along the X/Y axis from a native event. Default is 1.0. | 129 // Gets the radius along the X/Y axis from a native event. Default is 1.0. |
| 130 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); | 130 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); |
| 131 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); | 131 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); |
| 132 | 132 |
| 133 // Gets the angle of the major axis away from the X axis. Default is 0.0. | 133 // Gets the angle of the major axis away from the X axis. Default is 0.0. |
| 134 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); | 134 EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); |
| 135 | 135 |
| 136 // Gets the tilt angle of the stylus away from the perpendicular to the screen |
| 137 // Default is 0.0. |
| 138 EVENTS_EXPORT float GetTouchTilt(const base::NativeEvent& native_event); |
| 139 |
| 136 // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0. | 140 // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0. |
| 137 EVENTS_EXPORT float GetTouchForce(const base::NativeEvent& native_event); | 141 EVENTS_EXPORT float GetTouchForce(const base::NativeEvent& native_event); |
| 138 | 142 |
| 139 // Gets the fling velocity from a native event. is_cancel is set to true if | 143 // Gets the fling velocity from a native event. is_cancel is set to true if |
| 140 // this was a tap down, intended to stop an ongoing fling. | 144 // this was a tap down, intended to stop an ongoing fling. |
| 141 EVENTS_EXPORT bool GetFlingData(const base::NativeEvent& native_event, | 145 EVENTS_EXPORT bool GetFlingData(const base::NativeEvent& native_event, |
| 142 float* vx, | 146 float* vx, |
| 143 float* vy, | 147 float* vy, |
| 144 float* vx_ordinal, | 148 float* vx_ordinal, |
| 145 float* vy_ordinal, | 149 float* vy_ordinal, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // Update the native X11 event to correspond to the new button flags. | 185 // Update the native X11 event to correspond to the new button flags. |
| 182 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 186 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
| 183 #endif | 187 #endif |
| 184 | 188 |
| 185 // Registers a custom event type. | 189 // Registers a custom event type. |
| 186 EVENTS_EXPORT int RegisterCustomEventType(); | 190 EVENTS_EXPORT int RegisterCustomEventType(); |
| 187 | 191 |
| 188 } // namespace ui | 192 } // namespace ui |
| 189 | 193 |
| 190 #endif // UI_EVENTS_EVENT_UTILS_H_ | 194 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |