| 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 // Overridden from LocatedEvent. | 535 // Overridden from LocatedEvent. |
| 536 void UpdateForRootTransform( | 536 void UpdateForRootTransform( |
| 537 const gfx::Transform& inverted_root_transform) override; | 537 const gfx::Transform& inverted_root_transform) override; |
| 538 | 538 |
| 539 // Marks the event as not participating in synchronous gesture recognition. | 539 // Marks the event as not participating in synchronous gesture recognition. |
| 540 void DisableSynchronousHandling(); | 540 void DisableSynchronousHandling(); |
| 541 bool synchronous_handling_disabled() const { | 541 bool synchronous_handling_disabled() const { |
| 542 return !!(result() & ER_DISABLE_SYNC_HANDLING); | 542 return !!(result() & ER_DISABLE_SYNC_HANDLING); |
| 543 } | 543 } |
| 544 | 544 |
| 545 protected: | 545 private: |
| 546 void set_radius(float radius_x, float radius_y) { | 546 // Adjusts rotation_angle_ to within the acceptable range. |
| 547 radius_x_ = radius_x; | 547 void fixRotationAngle(); |
| 548 radius_y_ = radius_y; | |
| 549 } | |
| 550 | 548 |
| 551 void set_rotation_angle(float rotation_angle) { | |
| 552 rotation_angle_ = rotation_angle; | |
| 553 } | |
| 554 | |
| 555 void set_force(float force) { force_ = force; } | |
| 556 | |
| 557 private: | |
| 558 // The identity (typically finger) of the touch starting at 0 and incrementing | 549 // The identity (typically finger) of the touch starting at 0 and incrementing |
| 559 // for each separable additional touch that the hardware can detect. | 550 // for each separable additional touch that the hardware can detect. |
| 560 const int touch_id_; | 551 const int touch_id_; |
| 561 | 552 |
| 562 // A unique identifier for the touch event. | 553 // A unique identifier for the touch event. |
| 563 const uint64 unique_event_id_; | 554 const uint64 unique_event_id_; |
| 564 | 555 |
| 565 // Radius of the X (major) axis of the touch ellipse. 0.0 if unknown. | 556 // Radius of the X (major) axis of the touch ellipse. 0.0 if unknown. |
| 566 float radius_x_; | 557 float radius_x_; |
| 567 | 558 |
| 568 // Radius of the Y (minor) axis of the touch ellipse. 0.0 if unknown. | 559 // Radius of the Y (minor) axis of the touch ellipse. 0.0 if unknown. |
| 569 float radius_y_; | 560 float radius_y_; |
| 570 | 561 |
| 571 // Angle of the major axis away from the X axis. Default 0.0. | 562 // Clockwise angle (in degrees) of the major axis from the X axis. Must be |
| 563 // less than 180 and non-negative. |
| 572 float rotation_angle_; | 564 float rotation_angle_; |
| 573 | 565 |
| 574 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. | 566 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. |
| 575 float force_; | 567 float force_; |
| 576 | 568 |
| 577 // Whether the (unhandled) touch event will produce a scroll event (e.g., a | 569 // Whether the (unhandled) touch event will produce a scroll event (e.g., a |
| 578 // touchmove that exceeds the platform slop region, or a touchend that | 570 // touchmove that exceeds the platform slop region, or a touchend that |
| 579 // causes a fling). Defaults to false. | 571 // causes a fling). Defaults to false. |
| 580 bool may_cause_scrolling_; | 572 bool may_cause_scrolling_; |
| 581 }; | 573 }; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 | 865 |
| 874 const GestureEventDetails& details() const { return details_; } | 866 const GestureEventDetails& details() const { return details_; } |
| 875 | 867 |
| 876 private: | 868 private: |
| 877 GestureEventDetails details_; | 869 GestureEventDetails details_; |
| 878 }; | 870 }; |
| 879 | 871 |
| 880 } // namespace ui | 872 } // namespace ui |
| 881 | 873 |
| 882 #endif // UI_EVENTS_EVENT_H_ | 874 #endif // UI_EVENTS_EVENT_H_ |
| OLD | NEW |