| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_EVENTS_H_ | 5 #ifndef UI_BASE_EVENTS_H_ |
| 6 #define UI_BASE_EVENTS_H_ | 6 #define UI_BASE_EVENTS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
| 10 #include "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 // Updates the list of devices for cached properties. | 74 // Updates the list of devices for cached properties. |
| 75 UI_EXPORT void UpdateDeviceList(); | 75 UI_EXPORT void UpdateDeviceList(); |
| 76 | 76 |
| 77 // Get the EventType from a native event. | 77 // Get the EventType from a native event. |
| 78 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); | 78 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); |
| 79 | 79 |
| 80 // Get the EventFlags from a native event. | 80 // Get the EventFlags from a native event. |
| 81 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); | 81 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); |
| 82 | 82 |
| 83 // Get the location from a native event. | 83 // Get the location from a native event. The coordinate system of the resultant |
| 84 // |Point| has the origin at top-left of the "root window". The nature of |
| 85 // this "root window" and how it maps to platform-specific drawing surfaces is |
| 86 // defined in ui/aura/root_window.* and ui/aura/root_window_host*. |
| 84 UI_EXPORT gfx::Point EventLocationFromNative( | 87 UI_EXPORT gfx::Point EventLocationFromNative( |
| 85 const base::NativeEvent& native_event); | 88 const base::NativeEvent& native_event); |
| 86 | 89 |
| 87 #if defined(USE_X11) | 90 #if defined(USE_X11) |
| 88 // Returns the 'real' button for an event. The button reported in slave events | 91 // Returns the 'real' button for an event. The button reported in slave events |
| 89 // does not take into account any remapping (e.g. using xmodmap), while the | 92 // does not take into account any remapping (e.g. using xmodmap), while the |
| 90 // button reported in master events do. This is a utility function to always | 93 // button reported in master events do. This is a utility function to always |
| 91 // return the mapped button. | 94 // return the mapped button. |
| 92 UI_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); | 95 UI_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); |
| 93 #endif | 96 #endif |
| (...skipping 26 matching lines...) Expand all Loading... |
| 120 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, | 123 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, |
| 121 float* x_offset, | 124 float* x_offset, |
| 122 float* y_offset); | 125 float* y_offset); |
| 123 | 126 |
| 124 // Creates and returns no-op event. | 127 // Creates and returns no-op event. |
| 125 UI_EXPORT base::NativeEvent CreateNoopEvent(); | 128 UI_EXPORT base::NativeEvent CreateNoopEvent(); |
| 126 | 129 |
| 127 } // namespace ui | 130 } // namespace ui |
| 128 | 131 |
| 129 #endif // UI_BASE_EVENTS_H_ | 132 #endif // UI_BASE_EVENTS_H_ |
| OLD | NEW |