Chromium Code Reviews| 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/event_types.h" | 8 #include "base/event_types.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 // Gets the location in native system coordinate space. | 63 // Gets the location in native system coordinate space. |
| 64 EVENTS_EXPORT gfx::Point EventSystemLocationFromNative( | 64 EVENTS_EXPORT gfx::Point EventSystemLocationFromNative( |
| 65 const base::NativeEvent& native_event); | 65 const base::NativeEvent& native_event); |
| 66 | 66 |
| 67 #if defined(USE_X11) | 67 #if defined(USE_X11) |
| 68 // Returns the 'real' button for an event. The button reported in slave events | 68 // Returns the 'real' button for an event. The button reported in slave events |
| 69 // does not take into account any remapping (e.g. using xmodmap), while the | 69 // does not take into account any remapping (e.g. using xmodmap), while the |
| 70 // button reported in master events do. This is a utility function to always | 70 // button reported in master events do. This is a utility function to always |
| 71 // return the mapped button. | 71 // return the mapped button. |
| 72 EVENTS_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); | 72 EVENTS_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); |
| 73 | |
| 74 // Returns the target for an event. | |
| 75 EVENTS_EXPORT gfx::AcceleratedWidget EventTargetFromNative( | |
| 76 const base::NativeEvent& native_event); | |
|
sadrul
2014/07/21 06:57:59
Can this live inside desktop_window_tree_host_x11.
| |
| 73 #endif | 77 #endif |
| 74 | 78 |
| 75 // Returns the KeyboardCode from a native event. | 79 // Returns the KeyboardCode from a native event. |
| 76 EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( | 80 EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( |
| 77 const base::NativeEvent& native_event); | 81 const base::NativeEvent& native_event); |
| 78 | 82 |
| 79 // Returns the DOM KeyboardEvent code (physical location in the | 83 // Returns the DOM KeyboardEvent code (physical location in the |
| 80 // keyboard) from a native event. The ownership of the return value | 84 // keyboard) from a native event. The ownership of the return value |
| 81 // is NOT trasferred to the caller. | 85 // is NOT trasferred to the caller. |
| 82 EVENTS_EXPORT const char* CodeFromNative( | 86 EVENTS_EXPORT const char* CodeFromNative( |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 171 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
| 168 | 172 |
| 169 #endif | 173 #endif |
| 170 | 174 |
| 171 // Registers a custom event type. | 175 // Registers a custom event type. |
| 172 EVENTS_EXPORT int RegisterCustomEventType(); | 176 EVENTS_EXPORT int RegisterCustomEventType(); |
| 173 | 177 |
| 174 } // namespace ui | 178 } // namespace ui |
| 175 | 179 |
| 176 #endif // UI_EVENTS_EVENT_UTILS_H_ | 180 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |