| 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_BASE_EVENTS_H_ | 5 #ifndef UI_BASE_EVENTS_H_ |
| 6 #define UI_BASE_EVENTS_H_ | 6 #define UI_BASE_EVENTS_H_ |
| 7 | 7 |
| 8 #include "base/event_types.h" | 8 #include "base/event_types.h" |
| 9 #include "ui/base/keycodes/keyboard_codes.h" | 9 #include "ui/base/keycodes/keyboard_codes.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 UI_EXPORT base::TimeDelta EventTimeFromNative( | 134 UI_EXPORT base::TimeDelta EventTimeFromNative( |
| 135 const base::NativeEvent& native_event); | 135 const base::NativeEvent& native_event); |
| 136 | 136 |
| 137 // Get the location from a native event. The coordinate system of the resultant | 137 // Get the location from a native event. The coordinate system of the resultant |
| 138 // |Point| has the origin at top-left of the "root window". The nature of | 138 // |Point| has the origin at top-left of the "root window". The nature of |
| 139 // this "root window" and how it maps to platform-specific drawing surfaces is | 139 // this "root window" and how it maps to platform-specific drawing surfaces is |
| 140 // defined in ui/aura/root_window.* and ui/aura/root_window_host*. | 140 // defined in ui/aura/root_window.* and ui/aura/root_window_host*. |
| 141 UI_EXPORT gfx::Point EventLocationFromNative( | 141 UI_EXPORT gfx::Point EventLocationFromNative( |
| 142 const base::NativeEvent& native_event); | 142 const base::NativeEvent& native_event); |
| 143 | 143 |
| 144 // Gets the location in native system coordinate space. |
| 145 UI_EXPORT gfx::Point EventSystemLocationFromNative( |
| 146 const base::NativeEvent& native_event); |
| 147 |
| 144 #if defined(USE_X11) | 148 #if defined(USE_X11) |
| 145 // Returns the 'real' button for an event. The button reported in slave events | 149 // Returns the 'real' button for an event. The button reported in slave events |
| 146 // does not take into account any remapping (e.g. using xmodmap), while the | 150 // does not take into account any remapping (e.g. using xmodmap), while the |
| 147 // button reported in master events do. This is a utility function to always | 151 // button reported in master events do. This is a utility function to always |
| 148 // return the mapped button. | 152 // return the mapped button. |
| 149 UI_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); | 153 UI_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); |
| 150 #endif | 154 #endif |
| 151 | 155 |
| 152 // Returns the KeyboardCode from a native event. | 156 // Returns the KeyboardCode from a native event. |
| 153 UI_EXPORT KeyboardCode KeyboardCodeFromNative( | 157 UI_EXPORT KeyboardCode KeyboardCodeFromNative( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 UI_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); | 218 UI_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); |
| 215 | 219 |
| 216 // Returns true if |message| identifies a mouse event that was generated as the | 220 // Returns true if |message| identifies a mouse event that was generated as the |
| 217 // result of a touch event. | 221 // result of a touch event. |
| 218 UI_EXPORT bool IsMouseEventFromTouch(UINT message); | 222 UI_EXPORT bool IsMouseEventFromTouch(UINT message); |
| 219 #endif | 223 #endif |
| 220 | 224 |
| 221 } // namespace ui | 225 } // namespace ui |
| 222 | 226 |
| 223 #endif // UI_BASE_EVENTS_H_ | 227 #endif // UI_BASE_EVENTS_H_ |
| OLD | NEW |