WebKit2PlatformWheelEvent(const WebWheelEvent& webEvent) { // PlatformEvent m_type = PlatformEvent::Wheel; m_modifiers = 0; if (webEvent.shiftKey()) m_modifiers |= ShiftKey; if (webEvent.controlKey()) m_modifiers |= CtrlKey; if (webEvent.altKey()) m_modifiers |= AltKey; if (webEvent.metaKey()) m_modifiers |= MetaKey; m_timestamp = webEvent.timestamp(); // PlatformWheelEvent m_position = webEvent.position(); m_globalPosition = webEvent.globalPosition(); m_deltaX = webEvent.delta().width(); m_deltaY = webEvent.delta().height(); m_wheelTicksX = webEvent.wheelTicks().width(); m_wheelTicksY = webEvent.wheelTicks().height(); m_granularity = (webEvent.granularity() == WebWheelEvent::ScrollByPageWheelEvent) ? WebCore::ScrollByPageWheelEvent : WebCore::ScrollByPixelWheelEvent; m_directionInvertedFromDevice = webEvent.directionInvertedFromDevice(); #if PLATFORM(COCOA) m_phase = static_cast<WebCore::PlatformWheelEventPhase>(webEvent.phase()); m_momentumPhase = static_cast<WebCore::PlatformWheelEventPhase>(webEvent.momentumPhase()); m_hasPreciseScrollingDeltas = webEvent.hasPreciseScrollingDeltas(); m_scrollCount = webEvent.scrollCount(); m_unacceleratedScrollingDeltaX = webEvent.unacceleratedScrollingDelta().width(); m_unacceleratedScrollingDeltaY = webEvent.unacceleratedScrollingDelta().height(); #endif }
WebKit2PlatformWheelEvent(const WebWheelEvent& webEvent) { m_position = WebCore::IntPoint(webEvent.positionX(), webEvent.positionY()); m_globalPosition = WebCore::IntPoint(webEvent.globalPositionX(), webEvent.globalPositionY()); m_deltaX = webEvent.deltaX(); m_deltaY = webEvent.deltaY(); m_wheelTicksX = webEvent.wheelTicksX(); m_wheelTicksY = webEvent.wheelTicksY(); m_granularity = (webEvent.granularity() == WebWheelEvent::ScrollByPageWheelEvent) ? WebCore::ScrollByPageWheelEvent : WebCore::ScrollByPixelWheelEvent; m_shiftKey = webEvent.shiftKey(); m_ctrlKey = webEvent.controlKey(); m_altKey = webEvent.altKey(); m_metaKey = webEvent.metaKey(); }