| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 base::TimeDelta time_stamp); | 395 base::TimeDelta time_stamp); |
| 396 | 396 |
| 397 virtual ~TouchEvent(); | 397 virtual ~TouchEvent(); |
| 398 | 398 |
| 399 int touch_id() const { return touch_id_; } | 399 int touch_id() const { return touch_id_; } |
| 400 float radius_x() const { return radius_x_; } | 400 float radius_x() const { return radius_x_; } |
| 401 float radius_y() const { return radius_y_; } | 401 float radius_y() const { return radius_y_; } |
| 402 float rotation_angle() const { return rotation_angle_; } | 402 float rotation_angle() const { return rotation_angle_; } |
| 403 float force() const { return force_; } | 403 float force() const { return force_; } |
| 404 | 404 |
| 405 // Calibrate the touch-point. This is useful when the touch-surface that |
| 406 // generates the events need to be remapped to a surface of a different |
| 407 // size. |from| is the size of the native surface, and |to| is the size |
| 408 // of the target surface. |
| 409 void CalibrateLocation(const gfx::Size& from, const gfx::Size& to); |
| 410 |
| 405 // Used for unit tests. | 411 // Used for unit tests. |
| 406 void set_radius_x(const float r) { radius_x_ = r; } | 412 void set_radius_x(const float r) { radius_x_ = r; } |
| 407 void set_radius_y(const float r) { radius_y_ = r; } | 413 void set_radius_y(const float r) { radius_y_ = r; } |
| 408 | 414 |
| 409 // Overridden from LocatedEvent. | 415 // Overridden from LocatedEvent. |
| 410 virtual void UpdateForRootTransform(const Transform& root_transform) OVERRIDE; | 416 virtual void UpdateForRootTransform(const Transform& root_transform) OVERRIDE; |
| 411 | 417 |
| 412 protected: | 418 protected: |
| 413 void set_radius(float radius_x, float radius_y) { | 419 void set_radius(float radius_x, float radius_y) { |
| 414 radius_x_ = radius_x; | 420 radius_x_ = radius_x; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 // This value is stored as a bitfield because the number of touch ids varies, | 620 // This value is stored as a bitfield because the number of touch ids varies, |
| 615 // but we currently don't need more than 32 touches at a time. | 621 // but we currently don't need more than 32 touches at a time. |
| 616 const unsigned int touch_ids_bitfield_; | 622 const unsigned int touch_ids_bitfield_; |
| 617 | 623 |
| 618 DISALLOW_COPY_AND_ASSIGN(GestureEvent); | 624 DISALLOW_COPY_AND_ASSIGN(GestureEvent); |
| 619 }; | 625 }; |
| 620 | 626 |
| 621 } // namespace ui | 627 } // namespace ui |
| 622 | 628 |
| 623 #endif // UI_BASE_EVENTS_EVENT_H_ | 629 #endif // UI_BASE_EVENTS_EVENT_H_ |
| OLD | NEW |