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_BASE_EVENTS_EVENT_H_ | 5 #ifndef UI_BASE_EVENTS_EVENT_H_ |
6 #define UI_BASE_EVENTS_EVENT_H_ | 6 #define UI_BASE_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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 // This is useful when touch event is in X Root Window coordinates, | 488 // This is useful when touch event is in X Root Window coordinates, |
489 // and it needs to be mapped into Aura Root Window coordinates. | 489 // and it needs to be mapped into Aura Root Window coordinates. |
490 void Relocate(const gfx::Point& origin); | 490 void Relocate(const gfx::Point& origin); |
491 | 491 |
492 // Used for unit tests. | 492 // Used for unit tests. |
493 void set_radius_x(const float r) { radius_x_ = r; } | 493 void set_radius_x(const float r) { radius_x_ = r; } |
494 void set_radius_y(const float r) { radius_y_ = r; } | 494 void set_radius_y(const float r) { radius_y_ = r; } |
495 | 495 |
496 // Overridden from LocatedEvent. | 496 // Overridden from LocatedEvent. |
497 virtual void UpdateForRootTransform( | 497 virtual void UpdateForRootTransform( |
498 const gfx::Transform& root_transform) OVERRIDE; | 498 const gfx::Transform& inverted_root_transform) OVERRIDE; |
499 | 499 |
500 protected: | 500 protected: |
501 void set_radius(float radius_x, float radius_y) { | 501 void set_radius(float radius_x, float radius_y) { |
502 radius_x_ = radius_x; | 502 radius_x_ = radius_x; |
503 radius_y_ = radius_y; | 503 radius_y_ = radius_y; |
504 } | 504 } |
505 | 505 |
506 void set_rotation_angle(float rotation_angle) { | 506 void set_rotation_angle(float rotation_angle) { |
507 rotation_angle_ = rotation_angle; | 507 rotation_angle_ = rotation_angle; |
508 } | 508 } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 void Scale(const float factor); | 654 void Scale(const float factor); |
655 | 655 |
656 float x_offset() const { return x_offset_; } | 656 float x_offset() const { return x_offset_; } |
657 float y_offset() const { return y_offset_; } | 657 float y_offset() const { return y_offset_; } |
658 float x_offset_ordinal() const { return x_offset_ordinal_; } | 658 float x_offset_ordinal() const { return x_offset_ordinal_; } |
659 float y_offset_ordinal() const { return y_offset_ordinal_; } | 659 float y_offset_ordinal() const { return y_offset_ordinal_; } |
660 int finger_count() const { return finger_count_; } | 660 int finger_count() const { return finger_count_; } |
661 | 661 |
662 // Overridden from LocatedEvent. | 662 // Overridden from LocatedEvent. |
663 virtual void UpdateForRootTransform( | 663 virtual void UpdateForRootTransform( |
664 const gfx::Transform& root_transform) OVERRIDE; | 664 const gfx::Transform& inverted_root_transform) OVERRIDE; |
665 | 665 |
666 private: | 666 private: |
667 // Potential accelerated offsets. | 667 // Potential accelerated offsets. |
668 float x_offset_; | 668 float x_offset_; |
669 float y_offset_; | 669 float y_offset_; |
670 // Unaccelerated offsets. | 670 // Unaccelerated offsets. |
671 float x_offset_ordinal_; | 671 float x_offset_ordinal_; |
672 float y_offset_ordinal_; | 672 float y_offset_ordinal_; |
673 // Number of fingers on the pad. | 673 // Number of fingers on the pad. |
674 int finger_count_; | 674 int finger_count_; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 // This value is stored as a bitfield because the number of touch ids varies, | 710 // This value is stored as a bitfield because the number of touch ids varies, |
711 // but we currently don't need more than 32 touches at a time. | 711 // but we currently don't need more than 32 touches at a time. |
712 const unsigned int touch_ids_bitfield_; | 712 const unsigned int touch_ids_bitfield_; |
713 | 713 |
714 DISALLOW_COPY_AND_ASSIGN(GestureEvent); | 714 DISALLOW_COPY_AND_ASSIGN(GestureEvent); |
715 }; | 715 }; |
716 | 716 |
717 } // namespace ui | 717 } // namespace ui |
718 | 718 |
719 #endif // UI_BASE_EVENTS_EVENT_H_ | 719 #endif // UI_BASE_EVENTS_EVENT_H_ |
OLD | NEW |