| 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 // Return a copy of |native_event|. Depending on the platform, this copy may |
| 88 // need to be deleted with ReleaseCopiedNativeEvent(). |
| 89 EVENTS_EXPORT base::NativeEvent CopyNativeEvent( |
| 90 const base::NativeEvent& native_event); |
| 91 |
| 92 // Delete a |native_event| previously created by CopyNativeEvent(). |
| 93 EVENTS_EXPORT 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); | 162 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); |
| 154 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 163 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
| 155 #endif | 164 #endif |
| 156 | 165 |
| 157 // Registers a custom event type. | 166 // Registers a custom event type. |
| 158 EVENTS_EXPORT int RegisterCustomEventType(); | 167 EVENTS_EXPORT int RegisterCustomEventType(); |
| 159 | 168 |
| 160 } // namespace ui | 169 } // namespace ui |
| 161 | 170 |
| 162 #endif // UI_EVENTS_EVENT_UTILS_H_ | 171 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |