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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. | 71 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. |
72 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. | 72 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. |
73 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. | 73 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. |
74 unsigned deltaMode() const { return m_deltaMode; } | 74 unsigned deltaMode() const { return m_deltaMode; } |
75 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } | 75 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } |
76 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } | 76 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } |
77 bool canScroll() const { return m_canScroll; } | 77 bool canScroll() const { return m_canScroll; } |
78 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} | 78 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} |
79 RailsMode railsMode() const { return m_railsMode; } | 79 RailsMode railsMode() const { return m_railsMode; } |
80 | 80 |
81 virtual const AtomicString& interfaceName() const override; | 81 const AtomicString& interfaceName() const override; |
82 virtual bool isMouseEvent() const override; | 82 bool isMouseEvent() const override; |
83 virtual bool isWheelEvent() const override; | 83 bool isWheelEvent() const override; |
84 | 84 |
85 DECLARE_VIRTUAL_TRACE(); | 85 DECLARE_VIRTUAL_TRACE(); |
86 | 86 |
87 private: | 87 private: |
88 WheelEvent(); | 88 WheelEvent(); |
89 WheelEvent(const AtomicString&, const WheelEventInit&); | 89 WheelEvent(const AtomicString&, const WheelEventInit&); |
90 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, | 90 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, |
91 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo
cation, const IntPoint& windowLocation, | 91 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo
cation, const IntPoint& windowLocation, |
92 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode); | 92 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll, bool hasPreciseScrollingDeltas, RailsMode); |
93 | 93 |
94 IntPoint m_wheelDelta; | 94 IntPoint m_wheelDelta; |
95 double m_deltaX; | 95 double m_deltaX; |
96 double m_deltaY; | 96 double m_deltaY; |
97 double m_deltaZ; | 97 double m_deltaZ; |
98 unsigned m_deltaMode; | 98 unsigned m_deltaMode; |
99 bool m_canScroll; | 99 bool m_canScroll; |
100 bool m_hasPreciseScrollingDeltas; | 100 bool m_hasPreciseScrollingDeltas; |
101 RailsMode m_railsMode; | 101 RailsMode m_railsMode; |
102 }; | 102 }; |
103 | 103 |
104 DEFINE_EVENT_TYPE_CASTS(WheelEvent); | 104 DEFINE_EVENT_TYPE_CASTS(WheelEvent); |
105 | 105 |
106 class WheelEventDispatchMediator final : public EventDispatchMediator { | 106 class WheelEventDispatchMediator final : public EventDispatchMediator { |
107 public: | 107 public: |
108 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf
ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>); | 108 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf
ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>); |
109 private: | 109 private: |
110 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr
<AbstractView>); | 110 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr
<AbstractView>); |
111 WheelEvent& event() const; | 111 WheelEvent& event() const; |
112 virtual bool dispatchEvent(EventDispatcher&) const override; | 112 bool dispatchEvent(EventDispatcher&) const override; |
113 }; | 113 }; |
114 | 114 |
115 } // namespace blink | 115 } // namespace blink |
116 | 116 |
117 #endif // WheelEvent_h | 117 #endif // WheelEvent_h |
OLD | NEW |