| 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 | 54 |
| 55 static WheelEvent* create(const AtomicString& type, const WheelEventInit& in
itializer) | 55 static WheelEvent* create(const AtomicString& type, const WheelEventInit& in
itializer) |
| 56 { | 56 { |
| 57 return new WheelEvent(type, initializer); | 57 return new WheelEvent(type, initializer); |
| 58 } | 58 } |
| 59 | 59 |
| 60 static WheelEvent* create(const FloatPoint& wheelTicks, | 60 static WheelEvent* create(const FloatPoint& wheelTicks, |
| 61 const FloatPoint& rawDelta, unsigned deltaMode, AbstractView* view, | 61 const FloatPoint& rawDelta, unsigned deltaMode, AbstractView* view, |
| 62 const IntPoint& screenLocation, const IntPoint& windowLocation, | 62 const IntPoint& screenLocation, const IntPoint& windowLocation, |
| 63 PlatformEvent::Modifiers modifiers, unsigned short buttons, double platf
ormTimeStamp, | 63 PlatformEvent::Modifiers modifiers, unsigned short buttons, double platf
ormTimeStamp, |
| 64 bool canScroll, int resendingPluginId, bool hasPreciseScrollingDeltas, R
ailsMode railsMode, bool cancelable) | 64 int resendingPluginId, bool hasPreciseScrollingDeltas, RailsMode railsMo
de, bool cancelable) |
| 65 { | 65 { |
| 66 return new WheelEvent(wheelTicks, rawDelta, deltaMode, view, | 66 return new WheelEvent(wheelTicks, rawDelta, deltaMode, view, |
| 67 screenLocation, windowLocation, modifiers, buttons, platformTimeStam
p, | 67 screenLocation, windowLocation, modifiers, buttons, platformTimeStam
p, |
| 68 canScroll, resendingPluginId, hasPreciseScrollingDeltas, railsMode,
cancelable); | 68 resendingPluginId, hasPreciseScrollingDeltas, railsMode, cancelable)
; |
| 69 } | 69 } |
| 70 | 70 |
| 71 double deltaX() const { return m_deltaX; } // Positive when scrolling right. | 71 double deltaX() const { return m_deltaX; } // Positive when scrolling right. |
| 72 double deltaY() const { return m_deltaY; } // Positive when scrolling down. | 72 double deltaY() const { return m_deltaY; } // Positive when scrolling down. |
| 73 double deltaZ() const { return m_deltaZ; } | 73 double deltaZ() const { return m_deltaZ; } |
| 74 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. | 74 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. |
| 75 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. | 75 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. |
| 76 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. | 76 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. |
| 77 unsigned deltaMode() const { return m_deltaMode; } | 77 unsigned deltaMode() const { return m_deltaMode; } |
| 78 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } | 78 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } |
| 79 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } | 79 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } |
| 80 bool canScroll() const { return m_canScroll; } | |
| 81 int resendingPluginId() const { return m_resendingPluginId; } | 80 int resendingPluginId() const { return m_resendingPluginId; } |
| 82 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} | 81 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} |
| 83 RailsMode getRailsMode() const { return m_railsMode; } | 82 RailsMode getRailsMode() const { return m_railsMode; } |
| 84 | 83 |
| 85 const AtomicString& interfaceName() const override; | 84 const AtomicString& interfaceName() const override; |
| 86 bool isMouseEvent() const override; | 85 bool isMouseEvent() const override; |
| 87 bool isWheelEvent() const override; | 86 bool isWheelEvent() const override; |
| 88 | 87 |
| 89 EventDispatchMediator* createMediator() override; | 88 EventDispatchMediator* createMediator() override; |
| 90 | 89 |
| 91 DECLARE_VIRTUAL_TRACE(); | 90 DECLARE_VIRTUAL_TRACE(); |
| 92 | 91 |
| 93 private: | 92 private: |
| 94 WheelEvent(); | 93 WheelEvent(); |
| 95 WheelEvent(const AtomicString&, const WheelEventInit&); | 94 WheelEvent(const AtomicString&, const WheelEventInit&); |
| 96 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, | 95 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, |
| 97 unsigned, AbstractView*, const IntPoint& screenLocation, const IntPoint&
windowLocation, | 96 unsigned, AbstractView*, const IntPoint& screenLocation, const IntPoint&
windowLocation, |
| 98 PlatformEvent::Modifiers, unsigned short buttons, double platformTimeSta
mp, | 97 PlatformEvent::Modifiers, unsigned short buttons, double platformTimeSta
mp, |
| 99 bool canScroll, int resendingPluginId, bool hasPreciseScrollingDeltas, R
ailsMode, bool cancelable); | 98 int resendingPluginId, bool hasPreciseScrollingDeltas, RailsMode, bool c
ancelable); |
| 100 | 99 |
| 101 IntPoint m_wheelDelta; | 100 IntPoint m_wheelDelta; |
| 102 double m_deltaX; | 101 double m_deltaX; |
| 103 double m_deltaY; | 102 double m_deltaY; |
| 104 double m_deltaZ; | 103 double m_deltaZ; |
| 105 unsigned m_deltaMode; | 104 unsigned m_deltaMode; |
| 106 bool m_canScroll; | |
| 107 int m_resendingPluginId; | 105 int m_resendingPluginId; |
| 108 bool m_hasPreciseScrollingDeltas; | 106 bool m_hasPreciseScrollingDeltas; |
| 109 RailsMode m_railsMode; | 107 RailsMode m_railsMode; |
| 110 }; | 108 }; |
| 111 | 109 |
| 112 DEFINE_EVENT_TYPE_CASTS(WheelEvent); | 110 DEFINE_EVENT_TYPE_CASTS(WheelEvent); |
| 113 | 111 |
| 114 } // namespace blink | 112 } // namespace blink |
| 115 | 113 |
| 116 #endif // WheelEvent_h | 114 #endif // WheelEvent_h |
| OLD | NEW |