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