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