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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 static PassRefPtrWillBeRawPtr<WheelEvent> create(const AtomicString& type, c
onst WheelEventInit& initializer) | 53 static PassRefPtrWillBeRawPtr<WheelEvent> create(const AtomicString& type, c
onst WheelEventInit& initializer) |
54 { | 54 { |
55 return adoptRefWillBeNoop(new WheelEvent(type, initializer)); | 55 return adoptRefWillBeNoop(new WheelEvent(type, initializer)); |
56 } | 56 } |
57 | 57 |
58 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick
s, | 58 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick
s, |
59 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A
bstractView> view, | 59 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A
bstractView> view, |
60 const IntPoint& screenLocation, const IntPoint& windowLocation, | 60 const IntPoint& screenLocation, const IntPoint& windowLocation, |
61 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll) | 61 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll, bool hasPreciseScrollingDeltas) |
62 { | 62 { |
63 return adoptRefWillBeNoop(new WheelEvent(wheelTicks, rawDelta, deltaMode
, view, | 63 return adoptRefWillBeNoop(new WheelEvent(wheelTicks, rawDelta, deltaMode
, view, |
64 screenLocation, windowLocation, ctrlKey, altKey, shiftKey, metaKey, butt
ons, canScroll)); | 64 screenLocation, windowLocation, ctrlKey, altKey, shiftKey, metaKey,
buttons, canScroll, hasPreciseScrollingDeltas)); |
65 } | 65 } |
66 | 66 |
67 double deltaX() const { return m_deltaX; } // Positive when scrolling right. | 67 double deltaX() const { return m_deltaX; } // Positive when scrolling right. |
68 double deltaY() const { return m_deltaY; } // Positive when scrolling down. | 68 double deltaY() const { return m_deltaY; } // Positive when scrolling down. |
69 double deltaZ() const { return m_deltaZ; } | 69 double deltaZ() const { return m_deltaZ; } |
70 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. | 70 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. |
71 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. | 71 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. |
72 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. | 72 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. |
73 unsigned deltaMode() const { return m_deltaMode; } | 73 unsigned deltaMode() const { return m_deltaMode; } |
74 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } | 74 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } |
75 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } | 75 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } |
76 bool canScroll() const { return m_canScroll; } | 76 bool canScroll() const { return m_canScroll; } |
| 77 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} |
77 | 78 |
78 virtual const AtomicString& interfaceName() const override; | 79 virtual const AtomicString& interfaceName() const override; |
79 virtual bool isMouseEvent() const override; | 80 virtual bool isMouseEvent() const override; |
80 virtual bool isWheelEvent() const override; | 81 virtual bool isWheelEvent() const override; |
81 | 82 |
82 virtual void trace(Visitor*) override; | 83 virtual void trace(Visitor*) override; |
83 | 84 |
84 private: | 85 private: |
85 WheelEvent(); | 86 WheelEvent(); |
86 WheelEvent(const AtomicString&, const WheelEventInit&); | 87 WheelEvent(const AtomicString&, const WheelEventInit&); |
87 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, | 88 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, |
88 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo
cation, const IntPoint& windowLocation, | 89 unsigned, PassRefPtrWillBeRawPtr<AbstractView>, const IntPoint& screenLo
cation, const IntPoint& windowLocation, |
89 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll); | 90 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
uttons, bool canScroll, bool hasPreciseScrollingDeltas); |
90 | 91 |
91 IntPoint m_wheelDelta; | 92 IntPoint m_wheelDelta; |
92 double m_deltaX; | 93 double m_deltaX; |
93 double m_deltaY; | 94 double m_deltaY; |
94 double m_deltaZ; | 95 double m_deltaZ; |
95 unsigned m_deltaMode; | 96 unsigned m_deltaMode; |
96 bool m_canScroll; | 97 bool m_canScroll; |
| 98 bool m_hasPreciseScrollingDeltas; |
97 }; | 99 }; |
98 | 100 |
99 DEFINE_EVENT_TYPE_CASTS(WheelEvent); | 101 DEFINE_EVENT_TYPE_CASTS(WheelEvent); |
100 | 102 |
101 class WheelEventDispatchMediator final : public EventDispatchMediator { | 103 class WheelEventDispatchMediator final : public EventDispatchMediator { |
102 public: | 104 public: |
103 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf
ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>); | 105 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf
ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>); |
104 private: | 106 private: |
105 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr
<AbstractView>); | 107 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr
<AbstractView>); |
106 WheelEvent& event() const; | 108 WheelEvent& event() const; |
107 virtual bool dispatchEvent(EventDispatcher&) const override; | 109 virtual bool dispatchEvent(EventDispatcher&) const override; |
108 }; | 110 }; |
109 | 111 |
110 } // namespace blink | 112 } // namespace blink |
111 | 113 |
112 #endif // WheelEvent_h | 114 #endif // WheelEvent_h |
OLD | NEW |