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 | |
110 const AtomicString& WheelEvent::interfaceName() const | 79 const AtomicString& WheelEvent::interfaceName() const |
111 { | 80 { |
112 return EventNames::WheelEvent; | 81 return EventNames::WheelEvent; |
113 } | 82 } |
114 | 83 |
115 bool WheelEvent::isMouseEvent() const | 84 bool WheelEvent::isMouseEvent() const |
116 { | 85 { |
117 return false; | 86 return false; |
118 } | 87 } |
119 | 88 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 return toWheelEvent(EventDispatchMediator::event()); | 121 return toWheelEvent(EventDispatchMediator::event()); |
153 } | 122 } |
154 | 123 |
155 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t | 124 bool WheelEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t |
156 { | 125 { |
157 ASSERT(event()); | 126 ASSERT(event()); |
158 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default
Handled(); | 127 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default
Handled(); |
159 } | 128 } |
160 | 129 |
161 } // namespace blink | 130 } // namespace blink |
OLD | NEW |