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, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved. |
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 27 matching lines...) Expand all Loading... |
38 , wheelDeltaY(0) | 38 , wheelDeltaY(0) |
39 , deltaMode(WheelEvent::DOM_DELTA_PIXEL) | 39 , deltaMode(WheelEvent::DOM_DELTA_PIXEL) |
40 { | 40 { |
41 } | 41 } |
42 | 42 |
43 WheelEvent::WheelEvent() | 43 WheelEvent::WheelEvent() |
44 : m_deltaX(0) | 44 : m_deltaX(0) |
45 , m_deltaY(0) | 45 , m_deltaY(0) |
46 , m_deltaZ(0) | 46 , m_deltaZ(0) |
47 , m_deltaMode(DOM_DELTA_PIXEL) | 47 , m_deltaMode(DOM_DELTA_PIXEL) |
| 48 , m_canScroll(true) |
48 { | 49 { |
49 } | 50 } |
50 | 51 |
51 WheelEvent::WheelEvent(const AtomicString& type, const WheelEventInit& initializ
er) | 52 WheelEvent::WheelEvent(const AtomicString& type, const WheelEventInit& initializ
er) |
52 : MouseEvent(type, initializer) | 53 : MouseEvent(type, initializer) |
53 , m_wheelDelta(initializer.wheelDeltaX ? initializer.wheelDeltaX : -initiali
zer.deltaX, initializer.wheelDeltaY ? initializer.wheelDeltaY : -initializer.del
taY) | 54 , m_wheelDelta(initializer.wheelDeltaX ? initializer.wheelDeltaX : -initiali
zer.deltaX, initializer.wheelDeltaY ? initializer.wheelDeltaY : -initializer.del
taY) |
54 , m_deltaX(initializer.deltaX ? initializer.deltaX : -initializer.wheelDelta
X) | 55 , m_deltaX(initializer.deltaX ? initializer.deltaX : -initializer.wheelDelta
X) |
55 , m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDelta
Y) | 56 , m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDelta
Y) |
56 , m_deltaZ(initializer.deltaZ) | 57 , m_deltaZ(initializer.deltaZ) |
57 , m_deltaMode(initializer.deltaMode) | 58 , m_deltaMode(initializer.deltaMode) |
| 59 , m_canScroll(true) |
58 { | 60 { |
59 } | 61 } |
60 | 62 |
61 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
unsigned deltaMode, | 63 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
unsigned deltaMode, |
62 PassRefPtrWillBeRawPtr<AbstractView> view, const IntPoint& screenLocation, c
onst IntPoint& windowLocation, | 64 PassRefPtrWillBeRawPtr<AbstractView> view, const IntPoint& screenLocation, c
onst IntPoint& windowLocation, |
63 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short butto
ns) | 65 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short butto
ns, bool canScroll) |
64 : MouseEvent(EventTypeNames::wheel, true, true, view, 0, screenLocation.x(),
screenLocation.y(), | 66 : MouseEvent(EventTypeNames::wheel, true, true, view, 0, screenLocation.x(),
screenLocation.y(), |
65 windowLocation.x(), windowLocation.y(), 0, 0, ctrlKey, altKey, shiftKey,
metaKey, 0, buttons, | 67 windowLocation.x(), windowLocation.y(), 0, 0, ctrlKey, altKey, shiftKey,
metaKey, 0, buttons, |
66 nullptr, nullptr, false, PlatformMouseEvent::RealOrIndistinguishable) | 68 nullptr, nullptr, false, PlatformMouseEvent::RealOrIndistinguishable) |
67 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl
ier) | 69 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl
ier) |
68 , m_deltaX(-rawDelta.x()) | 70 , m_deltaX(-rawDelta.x()) |
69 , m_deltaY(-rawDelta.y()) | 71 , m_deltaY(-rawDelta.y()) |
70 , m_deltaZ(0) | 72 , m_deltaZ(0) |
71 , m_deltaMode(deltaMode) | 73 , m_deltaMode(deltaMode) |
| 74 , m_canScroll(canScroll) |
72 { | 75 { |
73 } | 76 } |
74 | 77 |
75 const AtomicString& WheelEvent::interfaceName() const | 78 const AtomicString& WheelEvent::interfaceName() const |
76 { | 79 { |
77 return EventNames::WheelEvent; | 80 return EventNames::WheelEvent; |
78 } | 81 } |
79 | 82 |
80 bool WheelEvent::isMouseEvent() const | 83 bool WheelEvent::isMouseEvent() const |
81 { | 84 { |
(...skipping 18 matching lines...) Expand all Loading... |
100 PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> WheelEventDispatchMediator::c
reate(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view
) | 103 PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> WheelEventDispatchMediator::c
reate(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view
) |
101 { | 104 { |
102 return adoptRefWillBeNoop(new WheelEventDispatchMediator(event, view)); | 105 return adoptRefWillBeNoop(new WheelEventDispatchMediator(event, view)); |
103 } | 106 } |
104 | 107 |
105 WheelEventDispatchMediator::WheelEventDispatchMediator(const PlatformWheelEvent&
event, PassRefPtrWillBeRawPtr<AbstractView> view) | 108 WheelEventDispatchMediator::WheelEventDispatchMediator(const PlatformWheelEvent&
event, PassRefPtrWillBeRawPtr<AbstractView> view) |
106 { | 109 { |
107 setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicks
Y()), FloatPoint(event.deltaX(), event.deltaY()), | 110 setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicks
Y()), FloatPoint(event.deltaX(), event.deltaY()), |
108 deltaMode(event), view, event.globalPosition(), event.position(), | 111 deltaMode(event), view, event.globalPosition(), event.position(), |
109 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), | 112 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), |
110 MouseEvent::platformModifiersToButtons(event.modifiers()))); | 113 MouseEvent::platformModifiersToButtons(event.modifiers()), |
| 114 event.canScroll())); |
111 } | 115 } |
112 | 116 |
113 WheelEvent& WheelEventDispatchMediator::event() const | 117 WheelEvent& WheelEventDispatchMediator::event() const |
114 { | 118 { |
115 return toWheelEvent(EventDispatchMediator::event()); | 119 return toWheelEvent(EventDispatchMediator::event()); |
116 } | 120 } |
117 | 121 |
118 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons
t | 122 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons
t |
119 { | 123 { |
120 if (!(event().deltaX() || event().deltaY())) | 124 if (!(event().deltaX() || event().deltaY())) |
121 return true; | 125 return true; |
122 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH
andled(); | 126 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH
andled(); |
123 } | 127 } |
124 | 128 |
125 } // namespace blink | 129 } // namespace blink |
OLD | NEW |