| 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" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "ui/events/event.h" |
| 12 #include "ui/events/event_constants.h" | 13 #include "ui/events/event_constants.h" |
| 13 #include "ui/events/keycodes/keyboard_codes.h" | 14 #include "ui/events/keycodes/keyboard_codes.h" |
| 14 #include "ui/gfx/display.h" | 15 #include "ui/gfx/display.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 16 #include "ui/events/events_export.h" | 17 #include "ui/events/events_export.h" |
| 17 | 18 |
| 18 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 19 #include <windows.h> | 20 #include <windows.h> |
| 20 #endif | 21 #endif |
| 21 | 22 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 EVENTS_EXPORT DomCode CodeFromNative(const base::NativeEvent& native_event); | 87 EVENTS_EXPORT DomCode CodeFromNative(const base::NativeEvent& native_event); |
| 87 | 88 |
| 88 // Returns true if the keyboard event is a character event rather than | 89 // Returns true if the keyboard event is a character event rather than |
| 89 // a keystroke event. | 90 // a keystroke event. |
| 90 EVENTS_EXPORT bool IsCharFromNative(const base::NativeEvent& native_event); | 91 EVENTS_EXPORT bool IsCharFromNative(const base::NativeEvent& native_event); |
| 91 | 92 |
| 92 // Returns the flags of the button that changed during a press/release. | 93 // Returns the flags of the button that changed during a press/release. |
| 93 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( | 94 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( |
| 94 const base::NativeEvent& native_event); | 95 const base::NativeEvent& native_event); |
| 95 | 96 |
| 97 // Returns the detailed pointer information for mouse events. |
| 98 EVENTS_EXPORT PointerDetails GetMousePointerDetailsFromNative( |
| 99 const base::NativeEvent& native_event); |
| 100 |
| 96 // Gets the mouse wheel offsets from a native event. | 101 // Gets the mouse wheel offsets from a native event. |
| 97 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( | 102 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( |
| 98 const base::NativeEvent& native_event); | 103 const base::NativeEvent& native_event); |
| 99 | 104 |
| 100 // Returns a copy of |native_event|. Depending on the platform, this copy may | 105 // Returns a copy of |native_event|. Depending on the platform, this copy may |
| 101 // need to be deleted with ReleaseCopiedNativeEvent(). | 106 // need to be deleted with ReleaseCopiedNativeEvent(). |
| 102 base::NativeEvent CopyNativeEvent( | 107 base::NativeEvent CopyNativeEvent( |
| 103 const base::NativeEvent& native_event); | 108 const base::NativeEvent& native_event); |
| 104 | 109 |
| 105 // Delete a |native_event| previously created by CopyNativeEvent(). | 110 // Delete a |native_event| previously created by CopyNativeEvent(). |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // Update the native X11 event to correspond to the new button flags. | 173 // Update the native X11 event to correspond to the new button flags. |
| 169 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 174 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
| 170 #endif | 175 #endif |
| 171 | 176 |
| 172 // Registers a custom event type. | 177 // Registers a custom event type. |
| 173 EVENTS_EXPORT int RegisterCustomEventType(); | 178 EVENTS_EXPORT int RegisterCustomEventType(); |
| 174 | 179 |
| 175 } // namespace ui | 180 } // namespace ui |
| 176 | 181 |
| 177 #endif // UI_EVENTS_EVENT_UTILS_H_ | 182 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |