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/event_types.h" | 8 #include "base/event_types.h" |
9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const base::NativeEvent& native_event); | 77 const base::NativeEvent& native_event); |
78 | 78 |
79 // Returns the flags of the button that changed during a press/release. | 79 // Returns the flags of the button that changed during a press/release. |
80 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( | 80 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( |
81 const base::NativeEvent& native_event); | 81 const base::NativeEvent& native_event); |
82 | 82 |
83 // Gets the mouse wheel offsets from a native event. | 83 // Gets the mouse wheel offsets from a native event. |
84 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( | 84 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( |
85 const base::NativeEvent& native_event); | 85 const base::NativeEvent& native_event); |
86 | 86 |
| 87 // Returns a copy of |native_event|. Depending on the platform, this copy may |
| 88 // need to be deleted with ReleaseCopiedNativeEvent(). |
| 89 base::NativeEvent CopyNativeEvent( |
| 90 const base::NativeEvent& native_event); |
| 91 |
| 92 // Delete a |native_event| previously created by CopyNativeEvent(). |
| 93 void ReleaseCopiedNativeEvent( |
| 94 const base::NativeEvent& native_event); |
| 95 |
87 // Gets the touch id from a native event. | 96 // Gets the touch id from a native event. |
88 EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); | 97 EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); |
89 | 98 |
90 // Clear the touch id from bookkeeping if it is a release/cancel event. | 99 // Clear the touch id from bookkeeping if it is a release/cancel event. |
91 EVENTS_EXPORT void ClearTouchIdIfReleased( | 100 EVENTS_EXPORT void ClearTouchIdIfReleased( |
92 const base::NativeEvent& native_event); | 101 const base::NativeEvent& native_event); |
93 | 102 |
94 // Gets the radius along the X/Y axis from a native event. Default is 1.0. | 103 // Gets the radius along the X/Y axis from a native event. Default is 1.0. |
95 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); | 104 EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); |
96 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); | 105 EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); | 156 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); |
148 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 157 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
149 #endif | 158 #endif |
150 | 159 |
151 // Registers a custom event type. | 160 // Registers a custom event type. |
152 EVENTS_EXPORT int RegisterCustomEventType(); | 161 EVENTS_EXPORT int RegisterCustomEventType(); |
153 | 162 |
154 } // namespace ui | 163 } // namespace ui |
155 | 164 |
156 #endif // UI_EVENTS_EVENT_UTILS_H_ | 165 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |