diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:31:00 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-11 14:42:12 +0100 |
commit | dcc8cf2e65d1aa555cce12431a16547e66b469ee (patch) | |
tree | 92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/dom/WheelEvent.cpp | |
parent | ccac38a6b48843126402088a309597e682f40fe6 (diff) | |
download | external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2 |
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/dom/WheelEvent.cpp')
-rw-r--r-- | WebCore/dom/WheelEvent.cpp | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/WebCore/dom/WheelEvent.cpp b/WebCore/dom/WheelEvent.cpp index 2039541..0981a57 100644 --- a/WebCore/dom/WheelEvent.cpp +++ b/WebCore/dom/WheelEvent.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2001 Peter Kelly (pmk@post.com) * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) - * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -31,21 +31,28 @@ namespace WebCore { WheelEvent::WheelEvent() : m_wheelDeltaX(0) , m_wheelDeltaY(0) + , m_rawDeltaX(0) + , m_rawDeltaY(0) + , m_granularity(Pixel) { } -WheelEvent::WheelEvent(float wheelTicksX, float wheelTicksY, PassRefPtr<AbstractView> view, +WheelEvent::WheelEvent(float wheelTicksX, float wheelTicksY, float rawDeltaX, float rawDeltaY, + Granularity granularity, PassRefPtr<AbstractView> view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) : MouseRelatedEvent(eventNames().mousewheelEvent, - true, true, view, 0, screenX, screenY, pageX, pageY, + true, true, view, 0, screenX, screenY, pageX, pageY, ctrlKey, altKey, shiftKey, metaKey) , m_wheelDeltaX(lroundf(wheelTicksX * 120)) , m_wheelDeltaY(lroundf(wheelTicksY * 120)) // Normalize to the Windows 120 multiple + , m_rawDeltaX(rawDeltaX) + , m_rawDeltaY(rawDeltaY) + , m_granularity(granularity) { } -void WheelEvent::initWheelEvent(int wheelDeltaX, int wheelDeltaY, PassRefPtr<AbstractView> view, +void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) { @@ -60,12 +67,25 @@ void WheelEvent::initWheelEvent(int wheelDeltaX, int wheelDeltaY, PassRefPtr<Abs m_altKey = altKey; m_shiftKey = shiftKey; m_metaKey = metaKey; - m_wheelDeltaX = wheelDeltaX; - m_wheelDeltaY = wheelDeltaY; + + // Normalize to the Windows 120 multiple + m_wheelDeltaX = rawDeltaX * 120; + m_wheelDeltaY = rawDeltaY * 120; + + m_rawDeltaX = rawDeltaX; + m_rawDeltaY = rawDeltaY; + m_granularity = Pixel; initCoordinates(pageX, pageY); } +void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view, + int screenX, int screenY, int pageX, int pageY, + bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) +{ + initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY, + ctrlKey, altKey, shiftKey, metaKey); +} bool WheelEvent::isWheelEvent() const { |