| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv
ed. |
| 6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 static PassRefPtrWillBeRawPtr<WheelEvent> create(const PlatformWheelEvent& p
latformEvent, PassRefPtrWillBeRawPtr<AbstractView>); | 54 static PassRefPtrWillBeRawPtr<WheelEvent> create(const PlatformWheelEvent& p
latformEvent, PassRefPtrWillBeRawPtr<AbstractView>); |
| 55 | 55 |
| 56 static PassRefPtrWillBeRawPtr<WheelEvent> create(const AtomicString& type, c
onst WheelEventInit& initializer) | 56 static PassRefPtrWillBeRawPtr<WheelEvent> create(const AtomicString& type, c
onst WheelEventInit& initializer) |
| 57 { | 57 { |
| 58 return adoptRefWillBeNoop(new WheelEvent(type, initializer)); | 58 return adoptRefWillBeNoop(new WheelEvent(type, initializer)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick
s, | 61 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick
s, |
| 62 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A
bstractView> view, | 62 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A
bstractView> view, |
| 63 const IntPoint& screenLocation, const IntPoint& windowLocation, | 63 const IntPoint& screenLocation, const IntPoint& windowLocation, |
| 64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode railsMode) | 64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll, int resendingPluginId, bool hasPreciseScrollingDeltas, R
ailsMode railsMode) |
| 65 { | 65 { |
| 66 return adoptRefWillBeNoop(new WheelEvent(wheelTicks, rawDelta, deltaMode
, view, | 66 return adoptRefWillBeNoop(new WheelEvent(wheelTicks, rawDelta, deltaMode
, view, |
| 67 screenLocation, windowLocation, ctrlKey, altKey, shiftKey, metaKey,
buttons, canScroll, hasPreciseScrollingDeltas, railsMode)); | 67 screenLocation, windowLocation, ctrlKey, altKey, shiftKey, metaKey,
buttons, canScroll, resendingPluginId, hasPreciseScrollingDeltas, railsMode)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 double deltaX() const { return m_deltaX; } // Positive when scrolling right. | 70 double deltaX() const { return m_deltaX; } // Positive when scrolling right. |
| 71 double deltaY() const { return m_deltaY; } // Positive when scrolling down. | 71 double deltaY() const { return m_deltaY; } // Positive when scrolling down. |
| 72 double deltaZ() const { return m_deltaZ; } | 72 double deltaZ() const { return m_deltaZ; } |
| 73 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. | 73 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. |
| 74 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. | 74 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. |
| 75 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. | 75 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. |
| 76 unsigned deltaMode() const { return m_deltaMode; } | 76 unsigned deltaMode() const { return m_deltaMode; } |
| 77 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } | 77 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } |
| 78 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } | 78 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } |
| 79 bool canScroll() const { return m_canScroll; } | 79 bool canScroll() const { return m_canScroll; } |
| 80 int resendingPluginId() const { return m_resendingPluginId; } |
| 80 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} | 81 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} |
| 81 RailsMode railsMode() const { return m_railsMode; } | 82 RailsMode railsMode() const { return m_railsMode; } |
| 82 | 83 |
| 83 const AtomicString& interfaceName() const override; | 84 const AtomicString& interfaceName() const override; |
| 84 bool isMouseEvent() const override; | 85 bool isMouseEvent() const override; |
| 85 bool isWheelEvent() const override; | 86 bool isWheelEvent() const override; |
| 86 | 87 |
| 87 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override; | 88 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override; |
| 88 | 89 |
| 89 DECLARE_VIRTUAL_TRACE(); | 90 DECLARE_VIRTUAL_TRACE(); |
| 90 | 91 |
| 91 private: | 92 private: |
| 92 WheelEvent(); | 93 WheelEvent(); |
| 93 WheelEvent(const AtomicString&, const WheelEventInit&); | 94 WheelEvent(const AtomicString&, const WheelEventInit&); |
| 94 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, | 95 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, |
| 95 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo
cation, const IntPoint& windowLocation, | 96 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo
cation, const IntPoint& windowLocation, |
| 96 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode); | 97 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll, int resendingPluginId, bool hasPreciseScrollingDeltas, R
ailsMode); |
| 97 | 98 |
| 98 IntPoint m_wheelDelta; | 99 IntPoint m_wheelDelta; |
| 99 double m_deltaX; | 100 double m_deltaX; |
| 100 double m_deltaY; | 101 double m_deltaY; |
| 101 double m_deltaZ; | 102 double m_deltaZ; |
| 102 unsigned m_deltaMode; | 103 unsigned m_deltaMode; |
| 103 bool m_canScroll; | 104 bool m_canScroll; |
| 105 int m_resendingPluginId; |
| 104 bool m_hasPreciseScrollingDeltas; | 106 bool m_hasPreciseScrollingDeltas; |
| 105 RailsMode m_railsMode; | 107 RailsMode m_railsMode; |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 DEFINE_EVENT_TYPE_CASTS(WheelEvent); | 110 DEFINE_EVENT_TYPE_CASTS(WheelEvent); |
| 109 | 111 |
| 110 class WheelEventDispatchMediator final : public EventDispatchMediator { | 112 class WheelEventDispatchMediator final : public EventDispatchMediator { |
| 111 public: | 113 public: |
| 112 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<WheelEvent>); | 114 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<WheelEvent>); |
| 113 | 115 |
| 114 private: | 116 private: |
| 115 explicit WheelEventDispatchMediator(PassRefPtrWillBeRawPtr<WheelEvent>); | 117 explicit WheelEventDispatchMediator(PassRefPtrWillBeRawPtr<WheelEvent>); |
| 116 WheelEvent& event() const; | 118 WheelEvent& event() const; |
| 117 bool dispatchEvent(EventDispatcher&) const override; | 119 bool dispatchEvent(EventDispatcher&) const override; |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace blink | 122 } // namespace blink |
| 121 | 123 |
| 122 #endif // WheelEvent_h | 124 #endif // WheelEvent_h |
| OLD | NEW |