| 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/aura/event.h" | 5 #include "ui/aura/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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 bool is_cancel; | 441 bool is_cancel; |
| 442 ui::GetFlingData(native_event, &x_offset_, &y_offset_, &is_cancel); | 442 ui::GetFlingData(native_event, &x_offset_, &y_offset_, &is_cancel); |
| 443 } | 443 } |
| 444 } | 444 } |
| 445 | 445 |
| 446 GestureEvent::GestureEvent(ui::EventType type, | 446 GestureEvent::GestureEvent(ui::EventType type, |
| 447 int x, | 447 int x, |
| 448 int y, | 448 int y, |
| 449 int flags, | 449 int flags, |
| 450 base::Time time_stamp, | 450 base::Time time_stamp, |
| 451 float delta_x, | 451 const ui::GestureEventDetails& details, |
| 452 float delta_y, | |
| 453 unsigned int touch_ids_bitfield) | 452 unsigned int touch_ids_bitfield) |
| 454 : LocatedEvent(type, gfx::Point(x, y), gfx::Point(x, y), flags), | 453 : LocatedEvent(type, gfx::Point(x, y), gfx::Point(x, y), flags), |
| 455 details_(type, delta_x, delta_y), | 454 details_(details), |
| 456 touch_ids_bitfield_(touch_ids_bitfield) { | 455 touch_ids_bitfield_(touch_ids_bitfield) { |
| 457 set_time_stamp(base::TimeDelta::FromSeconds(time_stamp.ToDoubleT())); | 456 set_time_stamp(base::TimeDelta::FromSeconds(time_stamp.ToDoubleT())); |
| 458 } | 457 } |
| 459 | 458 |
| 460 GestureEvent::GestureEvent(const GestureEvent& model, | 459 GestureEvent::GestureEvent(const GestureEvent& model, |
| 461 Window* source, | 460 Window* source, |
| 462 Window* target) | 461 Window* target) |
| 463 : LocatedEvent(model, source, target), | 462 : LocatedEvent(model, source, target), |
| 464 details_(model.details_), | 463 details_(model.details_), |
| 465 touch_ids_bitfield_(model.touch_ids_bitfield_) { | 464 touch_ids_bitfield_(model.touch_ids_bitfield_) { |
| 466 } | 465 } |
| 467 | 466 |
| 468 GestureEvent::~GestureEvent() { | 467 GestureEvent::~GestureEvent() { |
| 469 } | 468 } |
| 470 | 469 |
| 471 int GestureEvent::GetLowestTouchId() const { | 470 int GestureEvent::GetLowestTouchId() const { |
| 472 if (touch_ids_bitfield_ == 0) | 471 if (touch_ids_bitfield_ == 0) |
| 473 return -1; | 472 return -1; |
| 474 int i = -1; | 473 int i = -1; |
| 475 // Find the index of the least significant 1 bit | 474 // Find the index of the least significant 1 bit |
| 476 while (!(1 << ++i & touch_ids_bitfield_)); | 475 while (!(1 << ++i & touch_ids_bitfield_)); |
| 477 return i; | 476 return i; |
| 478 } | 477 } |
| 479 | 478 |
| 480 } // namespace aura | 479 } // namespace aura |
| OLD | NEW |