| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // back to using the current ticks for event timestamp. | 63 // back to using the current ticks for event timestamp. |
| 64 EVENTS_EXPORT void ValidateEventTimeClock(base::TimeTicks* timestamp); | 64 EVENTS_EXPORT void ValidateEventTimeClock(base::TimeTicks* timestamp); |
| 65 | 65 |
| 66 // Get the location from a native event. The coordinate system of the resultant | 66 // Get the location from a native event. The coordinate system of the resultant |
| 67 // |Point| has the origin at top-left of the "root window". The nature of | 67 // |Point| has the origin at top-left of the "root window". The nature of |
| 68 // this "root window" and how it maps to platform-specific drawing surfaces is | 68 // this "root window" and how it maps to platform-specific drawing surfaces is |
| 69 // defined in ui/aura/root_window.* and ui/aura/window_tree_host*. | 69 // defined in ui/aura/root_window.* and ui/aura/window_tree_host*. |
| 70 // TODO(tdresser): Return gfx::PointF here. See crbug.com/337827. | 70 // TODO(tdresser): Return gfx::PointF here. See crbug.com/337827. |
| 71 EVENTS_EXPORT gfx::Point EventLocationFromNative( | 71 EVENTS_EXPORT gfx::Point EventLocationFromNative( |
| 72 const base::NativeEvent& native_event); | 72 const base::NativeEvent& native_event); |
| 73 EVENTS_EXPORT gfx::PointF EventLocationFromNativeF( |
| 74 const base::NativeEvent& native_event); |
| 73 | 75 |
| 74 // Gets the location in native system coordinate space. | 76 // Gets the location in native system coordinate space. |
| 75 EVENTS_EXPORT gfx::Point EventSystemLocationFromNative( | 77 EVENTS_EXPORT gfx::Point EventSystemLocationFromNative( |
| 76 const base::NativeEvent& native_event); | 78 const base::NativeEvent& native_event); |
| 77 | 79 |
| 78 #if defined(USE_X11) | 80 #if defined(USE_X11) |
| 79 // Returns the 'real' button for an event. The button reported in slave events | 81 // Returns the 'real' button for an event. The button reported in slave events |
| 80 // does not take into account any remapping (e.g. using xmodmap), while the | 82 // does not take into account any remapping (e.g. using xmodmap), while the |
| 81 // button reported in master events do. This is a utility function to always | 83 // button reported in master events do. This is a utility function to always |
| 82 // return the mapped button. | 84 // return the mapped button. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // Update the native X11 event to correspond to the new button flags. | 179 // Update the native X11 event to correspond to the new button flags. |
| 178 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 180 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
| 179 #endif | 181 #endif |
| 180 | 182 |
| 181 // Registers a custom event type. | 183 // Registers a custom event type. |
| 182 EVENTS_EXPORT int RegisterCustomEventType(); | 184 EVENTS_EXPORT int RegisterCustomEventType(); |
| 183 | 185 |
| 184 } // namespace ui | 186 } // namespace ui |
| 185 | 187 |
| 186 #endif // UI_EVENTS_EVENT_UTILS_H_ | 188 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |