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 #include "ui/base/events/event.h" | 5 #include "ui/base/events/event.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 int flags) | 277 int flags) |
278 : Event(type, time_stamp, flags), | 278 : Event(type, time_stamp, flags), |
279 location_(location), | 279 location_(location), |
280 root_location_(root_location) { | 280 root_location_(root_location) { |
281 } | 281 } |
282 | 282 |
283 void LocatedEvent::UpdateForRootTransform( | 283 void LocatedEvent::UpdateForRootTransform( |
284 const gfx::Transform& reversed_root_transform) { | 284 const gfx::Transform& reversed_root_transform) { |
285 // Transform has to be done at root level. | 285 // Transform has to be done at root level. |
286 gfx::Point3F p(location_); | 286 gfx::Point3F p(location_); |
287 reversed_root_transform.TransformPoint(p); | 287 reversed_root_transform.TransformPoint(&p); |
288 root_location_ = location_ = gfx::ToFlooredPoint(p.AsPointF()); | 288 root_location_ = location_ = gfx::ToFlooredPoint(p.AsPointF()); |
289 } | 289 } |
290 | 290 |
291 //////////////////////////////////////////////////////////////////////////////// | 291 //////////////////////////////////////////////////////////////////////////////// |
292 // MouseEvent | 292 // MouseEvent |
293 | 293 |
294 MouseEvent::MouseEvent(const base::NativeEvent& native_event) | 294 MouseEvent::MouseEvent(const base::NativeEvent& native_event) |
295 : LocatedEvent(native_event), | 295 : LocatedEvent(native_event), |
296 changed_button_flags_( | 296 changed_button_flags_( |
297 GetChangedMouseButtonFlagsFromNative(native_event)) { | 297 GetChangedMouseButtonFlagsFromNative(native_event)) { |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 int GestureEvent::GetLowestTouchId() const { | 772 int GestureEvent::GetLowestTouchId() const { |
773 if (touch_ids_bitfield_ == 0) | 773 if (touch_ids_bitfield_ == 0) |
774 return -1; | 774 return -1; |
775 int i = -1; | 775 int i = -1; |
776 // Find the index of the least significant 1 bit | 776 // Find the index of the least significant 1 bit |
777 while (!(1 << ++i & touch_ids_bitfield_)); | 777 while (!(1 << ++i & touch_ids_bitfield_)); |
778 return i; | 778 return i; |
779 } | 779 } |
780 | 780 |
781 } // namespace ui | 781 } // namespace ui |
OLD | NEW |