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 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 25 matching lines...) Expand all Loading... |
36 : wheelDeltaX(0) | 36 : wheelDeltaX(0) |
37 , wheelDeltaY(0) | 37 , wheelDeltaY(0) |
38 , deltaMode(WheelEvent::DOM_DELTA_PIXEL) | 38 , deltaMode(WheelEvent::DOM_DELTA_PIXEL) |
39 { | 39 { |
40 } | 40 } |
41 | 41 |
42 WheelEvent::WheelEvent() | 42 WheelEvent::WheelEvent() |
43 : m_deltaMode(DOM_DELTA_PIXEL) | 43 : m_deltaMode(DOM_DELTA_PIXEL) |
44 , m_directionInvertedFromDevice(false) | 44 , m_directionInvertedFromDevice(false) |
45 { | 45 { |
| 46 ScriptWrappable::init(this); |
46 } | 47 } |
47 | 48 |
48 WheelEvent::WheelEvent(const AtomicString& type, const WheelEventInit& initializ
er) | 49 WheelEvent::WheelEvent(const AtomicString& type, const WheelEventInit& initializ
er) |
49 : MouseEvent(type, initializer) | 50 : MouseEvent(type, initializer) |
50 , m_wheelDelta(IntPoint(initializer.wheelDeltaX, initializer.wheelDeltaY)) | 51 , m_wheelDelta(IntPoint(initializer.wheelDeltaX, initializer.wheelDeltaY)) |
51 , m_deltaMode(initializer.deltaMode) | 52 , m_deltaMode(initializer.deltaMode) |
52 { | 53 { |
| 54 ScriptWrappable::init(this); |
53 } | 55 } |
54 | 56 |
55 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
unsigned deltaMode, | 57 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
unsigned deltaMode, |
56 PassRefPtr<AbstractView> view, const IntPoint& screenLocation, const IntPoin
t& pageLocation, | 58 PassRefPtr<AbstractView> view, const IntPoint& screenLocation, const IntPoin
t& pageLocation, |
57 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvert
edFromDevice) | 59 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvert
edFromDevice) |
58 : MouseEvent(eventNames().mousewheelEvent, | 60 : MouseEvent(eventNames().mousewheelEvent, |
59 true, true, view, 0, screenLocation.x(), screenLocation.y(), | 61 true, true, view, 0, screenLocation.x(), screenLocation.y(), |
60 pageLocation.x(), pageLocation.y(), | 62 pageLocation.x(), pageLocation.y(), |
61 #if ENABLE(POINTER_LOCK) | 63 #if ENABLE(POINTER_LOCK) |
62 0, 0, | 64 0, 0, |
63 #endif | 65 #endif |
64 ctrlKey, altKey, shiftKey, metaKey, 0, 0, 0, false) | 66 ctrlKey, altKey, shiftKey, metaKey, 0, 0, 0, false) |
65 , m_wheelDelta(IntPoint(static_cast<int>(wheelTicks.x() * TickMultiplier), s
tatic_cast<int>(wheelTicks.y() * TickMultiplier))) | 67 , m_wheelDelta(IntPoint(static_cast<int>(wheelTicks.x() * TickMultiplier), s
tatic_cast<int>(wheelTicks.y() * TickMultiplier))) |
66 , m_rawDelta(roundedIntPoint(rawDelta)) | 68 , m_rawDelta(roundedIntPoint(rawDelta)) |
67 , m_deltaMode(deltaMode) | 69 , m_deltaMode(deltaMode) |
68 , m_directionInvertedFromDevice(directionInvertedFromDevice) | 70 , m_directionInvertedFromDevice(directionInvertedFromDevice) |
69 { | 71 { |
| 72 ScriptWrappable::init(this); |
70 } | 73 } |
71 | 74 |
72 void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<Abstrac
tView> view, | 75 void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<Abstrac
tView> view, |
73 int screenX, int screenY, int pageX, int pageY, | 76 int screenX, int screenY, int pageX, int pageY, |
74 bool ctrlKey, bool altKey, bool shiftKey, bool m
etaKey) | 77 bool ctrlKey, bool altKey, bool shiftKey, bool m
etaKey) |
75 { | 78 { |
76 if (dispatched()) | 79 if (dispatched()) |
77 return; | 80 return; |
78 | 81 |
79 initUIEvent(eventNames().mousewheelEvent, true, true, view, 0); | 82 initUIEvent(eventNames().mousewheelEvent, true, true, view, 0); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return static_cast<WheelEvent*>(EventDispatchMediator::event()); | 140 return static_cast<WheelEvent*>(EventDispatchMediator::event()); |
138 } | 141 } |
139 | 142 |
140 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t | 143 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t |
141 { | 144 { |
142 ASSERT(event()); | 145 ASSERT(event()); |
143 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default
Handled(); | 146 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default
Handled(); |
144 } | 147 } |
145 | 148 |
146 } // namespace WebCore | 149 } // namespace WebCore |
OLD | NEW |