| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 static const int kWheelDelta; | 409 static const int kWheelDelta; |
| 410 | 410 |
| 411 explicit MouseWheelEvent(const base::NativeEvent& native_event); | 411 explicit MouseWheelEvent(const base::NativeEvent& native_event); |
| 412 explicit MouseWheelEvent(const ScrollEvent& scroll_event); | 412 explicit MouseWheelEvent(const ScrollEvent& scroll_event); |
| 413 MouseWheelEvent(const MouseEvent& mouse_event, int x_offset, int y_offset); | 413 MouseWheelEvent(const MouseEvent& mouse_event, int x_offset, int y_offset); |
| 414 MouseWheelEvent(const MouseWheelEvent& mouse_wheel_event); | 414 MouseWheelEvent(const MouseWheelEvent& mouse_wheel_event); |
| 415 | 415 |
| 416 template <class T> | 416 template <class T> |
| 417 MouseWheelEvent(const MouseWheelEvent& model, | 417 MouseWheelEvent(const MouseWheelEvent& model, |
| 418 T* source, | 418 T* source, |
| 419 T* target, | 419 T* target) |
| 420 EventType type, | 420 : MouseEvent(model, source, target, model.type(), model.flags()), |
| 421 int flags) | 421 offset_(model.x_offset(), model.y_offset()) { |
| 422 : MouseEvent(model, source, target, type, flags), | |
| 423 offset_(model.x_offset(), model.y_offset()){ | |
| 424 } | 422 } |
| 425 | 423 |
| 426 // The amount to scroll. This is in multiples of kWheelDelta. | 424 // The amount to scroll. This is in multiples of kWheelDelta. |
| 427 // Note: x_offset() > 0/y_offset() > 0 means scroll left/up. | 425 // Note: x_offset() > 0/y_offset() > 0 means scroll left/up. |
| 428 int x_offset() const { return offset_.x(); } | 426 int x_offset() const { return offset_.x(); } |
| 429 int y_offset() const { return offset_.y(); } | 427 int y_offset() const { return offset_.y(); } |
| 430 const gfx::Vector2d& offset() const { return offset_; } | 428 const gfx::Vector2d& offset() const { return offset_; } |
| 431 | 429 |
| 432 // Overridden from LocatedEvent. | 430 // Overridden from LocatedEvent. |
| 433 virtual void UpdateForRootTransform( | 431 virtual void UpdateForRootTransform( |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 // The set of indices of ones in the binary representation of | 692 // The set of indices of ones in the binary representation of |
| 695 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. | 693 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. |
| 696 // This value is stored as a bitfield because the number of touch ids varies, | 694 // This value is stored as a bitfield because the number of touch ids varies, |
| 697 // but we currently don't need more than 32 touches at a time. | 695 // but we currently don't need more than 32 touches at a time. |
| 698 const unsigned int touch_ids_bitfield_; | 696 const unsigned int touch_ids_bitfield_; |
| 699 }; | 697 }; |
| 700 | 698 |
| 701 } // namespace ui | 699 } // namespace ui |
| 702 | 700 |
| 703 #endif // UI_EVENTS_EVENT_H_ | 701 #endif // UI_EVENTS_EVENT_H_ |
| OLD | NEW |