| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 ctrlKey, altKey, shiftKey, metaKey, 0, nullptr, nullptr, false) | 69 ctrlKey, altKey, shiftKey, metaKey, 0, nullptr, nullptr, false) |
| 70 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl
ier) | 70 , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultipl
ier) |
| 71 , m_deltaX(-rawDelta.x()) | 71 , m_deltaX(-rawDelta.x()) |
| 72 , m_deltaY(-rawDelta.y()) | 72 , m_deltaY(-rawDelta.y()) |
| 73 , m_deltaZ(0) | 73 , m_deltaZ(0) |
| 74 , m_deltaMode(deltaMode) | 74 , m_deltaMode(deltaMode) |
| 75 { | 75 { |
| 76 ScriptWrappable::init(this); | 76 ScriptWrappable::init(this); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtrWillBeRa
wPtr<AbstractView> view, |
| 80 int screenX, int screenY, int pageX, int pageY, |
| 81 bool ctrlKey, bool altKey, bool shiftKey, bool m
etaKey) |
| 82 { |
| 83 if (dispatched()) |
| 84 return; |
| 85 |
| 86 initUIEvent(EventTypeNames::wheel, true, true, view, 0); |
| 87 |
| 88 m_screenLocation = IntPoint(screenX, screenY); |
| 89 m_ctrlKey = ctrlKey; |
| 90 m_altKey = altKey; |
| 91 m_shiftKey = shiftKey; |
| 92 m_metaKey = metaKey; |
| 93 |
| 94 m_wheelDelta = IntPoint(rawDeltaX * TickMultiplier, rawDeltaY * TickMultipli
er); |
| 95 m_deltaX = -rawDeltaX; |
| 96 m_deltaY = -rawDeltaY; |
| 97 m_deltaMode = DOM_DELTA_PIXEL; |
| 98 |
| 99 initCoordinates(IntPoint(pageX, pageY)); |
| 100 } |
| 101 |
| 102 void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtrWi
llBeRawPtr<AbstractView> view, |
| 103 int screenX, int screenY, int pageX, int p
ageY, |
| 104 bool ctrlKey, bool altKey, bool shiftKey,
bool metaKey) |
| 105 { |
| 106 initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY, |
| 107 ctrlKey, altKey, shiftKey, metaKey); |
| 108 } |
| 109 |
| 79 const AtomicString& WheelEvent::interfaceName() const | 110 const AtomicString& WheelEvent::interfaceName() const |
| 80 { | 111 { |
| 81 return EventNames::WheelEvent; | 112 return EventNames::WheelEvent; |
| 82 } | 113 } |
| 83 | 114 |
| 84 bool WheelEvent::isMouseEvent() const | 115 bool WheelEvent::isMouseEvent() const |
| 85 { | 116 { |
| 86 return false; | 117 return false; |
| 87 } | 118 } |
| 88 | 119 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return toWheelEvent(EventDispatchMediator::event()); | 152 return toWheelEvent(EventDispatchMediator::event()); |
| 122 } | 153 } |
| 123 | 154 |
| 124 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t | 155 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t |
| 125 { | 156 { |
| 126 ASSERT(event()); | 157 ASSERT(event()); |
| 127 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default
Handled(); | 158 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default
Handled(); |
| 128 } | 159 } |
| 129 | 160 |
| 130 } // namespace blink | 161 } // namespace blink |
| OLD | NEW |