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