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_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 466 |
467 virtual ~TouchEvent(); | 467 virtual ~TouchEvent(); |
468 | 468 |
469 int touch_id() const { return touch_id_; } | 469 int touch_id() const { return touch_id_; } |
470 float radius_x() const { return radius_x_; } | 470 float radius_x() const { return radius_x_; } |
471 float radius_y() const { return radius_y_; } | 471 float radius_y() const { return radius_y_; } |
472 float rotation_angle() const { return rotation_angle_; } | 472 float rotation_angle() const { return rotation_angle_; } |
473 float force() const { return force_; } | 473 float force() const { return force_; } |
474 int source_device_id() const { return source_device_id_; } | 474 int source_device_id() const { return source_device_id_; } |
475 | 475 |
476 // Relocate the touch-point to a new |origin|. | |
477 // This is useful when touch event is in X Root Window coordinates, | |
478 // and it needs to be mapped into Aura Root Window coordinates. | |
479 void Relocate(const gfx::Point& origin); | |
480 | |
481 // Used for unit tests. | 476 // Used for unit tests. |
482 void set_radius_x(const float r) { radius_x_ = r; } | 477 void set_radius_x(const float r) { radius_x_ = r; } |
483 void set_radius_y(const float r) { radius_y_ = r; } | 478 void set_radius_y(const float r) { radius_y_ = r; } |
484 void set_source_device_id(int source_device_id) { | 479 void set_source_device_id(int source_device_id) { |
485 source_device_id_ = source_device_id; | 480 source_device_id_ = source_device_id; |
486 } | 481 } |
487 | 482 |
488 // Overridden from LocatedEvent. | 483 // Overridden from LocatedEvent. |
489 virtual void UpdateForRootTransform( | 484 virtual void UpdateForRootTransform( |
490 const gfx::Transform& inverted_root_transform) OVERRIDE; | 485 const gfx::Transform& inverted_root_transform) OVERRIDE; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 // The set of indices of ones in the binary representation of | 683 // The set of indices of ones in the binary representation of |
689 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. | 684 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. |
690 // This value is stored as a bitfield because the number of touch ids varies, | 685 // This value is stored as a bitfield because the number of touch ids varies, |
691 // but we currently don't need more than 32 touches at a time. | 686 // but we currently don't need more than 32 touches at a time. |
692 const unsigned int touch_ids_bitfield_; | 687 const unsigned int touch_ids_bitfield_; |
693 }; | 688 }; |
694 | 689 |
695 } // namespace ui | 690 } // namespace ui |
696 | 691 |
697 #endif // UI_EVENTS_EVENT_H_ | 692 #endif // UI_EVENTS_EVENT_H_ |
OLD | NEW |