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" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // this "root window" and how it maps to platform-specific drawing surfaces is | 61 // this "root window" and how it maps to platform-specific drawing surfaces is |
62 // defined in ui/aura/root_window.* and ui/aura/window_tree_host*. | 62 // defined in ui/aura/root_window.* and ui/aura/window_tree_host*. |
63 // TODO(tdresser): Return gfx::PointF here. See crbug.com/337827. | 63 // TODO(tdresser): Return gfx::PointF here. See crbug.com/337827. |
64 EVENTS_EXPORT gfx::Point EventLocationFromNative( | 64 EVENTS_EXPORT gfx::Point EventLocationFromNative( |
65 const base::NativeEvent& native_event); | 65 const base::NativeEvent& native_event); |
66 | 66 |
67 // Gets the location in native system coordinate space. | 67 // Gets the location in native system coordinate space. |
68 EVENTS_EXPORT gfx::Point EventSystemLocationFromNative( | 68 EVENTS_EXPORT gfx::Point EventSystemLocationFromNative( |
69 const base::NativeEvent& native_event); | 69 const base::NativeEvent& native_event); |
70 | 70 |
71 #if defined(USE_X11) | 71 #if defined(USE_X11) || defined(USE_OZONE) |
72 // Returns the 'real' button for an event. The button reported in slave events | 72 // Returns the 'real' button for an event. The button reported in slave events |
73 // does not take into account any remapping (e.g. using xmodmap), while the | 73 // does not take into account any remapping (e.g. using xmodmap), while the |
74 // button reported in master events do. This is a utility function to always | 74 // button reported in master events do. This is a utility function to always |
75 // return the mapped button. | 75 // return the mapped button. |
76 EVENTS_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); | 76 EVENTS_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); |
77 #endif | 77 #endif |
78 | 78 |
79 // Returns the KeyboardCode from a native event. | 79 // Returns the KeyboardCode from a native event. |
80 EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( | 80 EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( |
81 const base::NativeEvent& native_event); | 81 const base::NativeEvent& native_event); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Update the native X11 event to correspond to the new button flags. | 180 // Update the native X11 event to correspond to the new button flags. |
181 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 181 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
182 #endif | 182 #endif |
183 | 183 |
184 // Registers a custom event type. | 184 // Registers a custom event type. |
185 EVENTS_EXPORT int RegisterCustomEventType(); | 185 EVENTS_EXPORT int RegisterCustomEventType(); |
186 | 186 |
187 } // namespace ui | 187 } // namespace ui |
188 | 188 |
189 #endif // UI_EVENTS_EVENT_UTILS_H_ | 189 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |