Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: ui/events/event_utils.h

Issue 2648583003: Handle floating point coordinates from ozone to exosphere (Closed)
Patch Set: extended X/mac tests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/events_default.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 // Ensures that the event timestamp values are coming from the same underlying 61 // Ensures that the event timestamp values are coming from the same underlying
62 // monotonic clock as base::TimeTicks::Now() and if it is not then falls 62 // monotonic clock as base::TimeTicks::Now() and if it is not then falls
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.
oshima 2017/01/23 16:34:32 We should be able to remove old one (we may want t
sky 2017/01/23 17:04:06 If the only caller is from the constructor that wa
71 EVENTS_EXPORT gfx::Point EventLocationFromNative( 71 EVENTS_EXPORT gfx::Point EventLocationFromNative(
sky 2017/01/23 16:08:00 Do we still call the non-floating point version?
denniskempin 2017/01/23 20:36:41 The method is called in a couple of locations besi
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
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_
OLDNEW
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/events_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698