Skip to content
  • weinig@apple.com's avatar
    Give PlatformEvents a base class · 4824ed55
    weinig@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=74685
    
    Reviewed by Anders Carlsson.
    
    Add a base class for PlatformMouseEvent, PlatformKeyboardEvent, PlatformWheelEvent
    and PlatformGestureEvent and move Type enumeration and modifiers down to it.
    
    ../WebCore: 
    
    * CMakeLists.txt:
    * GNUmakefile.list.am:
    * Target.pri:
    * WebCore.exp.in:
    * WebCore.gypi:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    Add new files.
    
    * platform/PlatformEvent.cpp: Added.
    * platform/PlatformEvent.h: Added.
    (WebCore::PlatformEvent::type):
    (WebCore::PlatformEvent::shiftKey):
    (WebCore::PlatformEvent::ctrlKey):
    (WebCore::PlatformEvent::altKey):
    (WebCore::PlatformEvent::metaKey):
    (WebCore::PlatformEvent::modifiers):
    (WebCore::PlatformEvent::PlatformEvent):
    Add new class.
    
    * accessibility/mac/WebAccessibilityObjectWrapper.mm:
    (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
    * dom/KeyboardEvent.cpp:
    (WebCore::eventTypeForKeyboardEventType):
    * dom/MouseEvent.cpp:
    (WebCore::MouseEvent::create):
    * page/DragController.cpp:
    (WebCore::createMouseEvent):
    * page/EventHandler.cpp:
    (WebCore::EventHandler::handleGestureEvent):
    (WebCore::EventHandler::sendContextMenuEventForKey):
    (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
    (WebCore::EventHandler::handleAccessKey):
    (WebCore::EventHandler::keyEvent):
    (WebCore::EventHandler::handleDrag):
    * page/blackberry/EventHandlerBlackBerry.cpp:
    (WebCore::EventHandler::accessKeyModifiers):
    * page/chromium/EventHandlerChromium.cpp:
    (WebCore::EventHandler::accessKeyModifiers):
    * page/efl/EventHandlerEfl.cpp:
    (WebCore::EventHandler::accessKeyModifiers):
    * page/gtk/EventHandlerGtk.cpp:
    (WebCore::EventHandler::accessKeyModifiers):
    * page/mac/EventHandlerMac.mm:
    (WebCore::EventHandler::accessKeyModifiers):
    * page/qt/EventHandlerQt.cpp:
    (WebCore::EventHandler::accessKeyModifiers):
    * page/win/EventHandlerWin.cpp:
    (WebCore::EventHandler::accessKeyModifiers):
    * page/wx/EventHandlerWx.cpp:
    (WebCore::EventHandler::accessKeyModifiers):
    * platform/PlatformGestureEvent.h:
    (WebCore::PlatformGestureEvent::PlatformGestureEvent):
    * platform/PlatformKeyboardEvent.h:
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    (WebCore::PlatformKeyboardEvent::isKeypad):
    * platform/PlatformMouseEvent.h:
    (WebCore::PlatformMouseEvent::PlatformMouseEvent):
    (WebCore::PlatformMouseEvent::button):
    * platform/PlatformWheelEvent.h:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent):
    * platform/ScrollAnimatorNone.cpp:
    (WebCore::ScrollAnimatorNone::zoom):
    (WebCore::ScrollAnimatorNone::handleGestureEvent):
    * platform/blackberry/PlatformKeyboardEventBlackBerry.cpp:
    (WebCore::toWebCorePlatformKeyboardEventType):
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
    * platform/chromium/GestureRecognizerChromium.cpp:
    (WebCore::GestureRecognizerChromium::appendTapDownGestureEvent):
    (WebCore::GestureRecognizerChromium::appendClickGestureEvent):
    (WebCore::GestureRecognizerChromium::appendDoubleClickGestureEvent):
    (WebCore::GestureRecognizerChromium::appendScrollGestureBegin):
    (WebCore::GestureRecognizerChromium::appendScrollGestureEnd):
    (WebCore::GestureRecognizerChromium::appendScrollGestureUpdate):
    * platform/chromium/PlatformKeyboardEventChromium.cpp:
    (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
    * platform/chromium/PopupContainer.cpp:
    (WebCore::PopupContainer::handleGestureEvent):
    * platform/chromium/PopupListBox.cpp:
    (WebCore::isCharacterTypeEvent):
    (WebCore::PopupListBox::handleKeyEvent):
    * platform/chromium/ScrollAnimatorChromiumMac.mm:
    (WebCore::ScrollAnimatorChromiumMac::handleGestureEvent):
    * platform/efl/PlatformKeyboardEventEfl.cpp:
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
    * platform/efl/PlatformMouseEventEfl.cpp:
    (WebCore::PlatformMouseEvent::PlatformMouseEvent):
    * platform/efl/PlatformWheelEventEfl.cpp:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent):
    * platform/gtk/PlatformKeyboardEventGtk.cpp:
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
    * platform/gtk/PlatformMouseEventGtk.cpp:
    (WebCore::PlatformMouseEvent::PlatformMouseEvent):
    * platform/gtk/PlatformWheelEventGtk.cpp:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent):
    * platform/ios/KeyEventIOS.mm:
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
    * platform/mac/KeyEventMac.mm:
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    * platform/mac/PlatformMouseEventMac.mm:
    (WebCore::mouseEventForNSEvent):
    (WebCore::PlatformMouseEvent::PlatformMouseEvent):
    * platform/mac/ScrollAnimatorMac.mm:
    (WebCore::ScrollAnimatorMac::handleGestureEvent):
    * platform/mac/WheelEventMac.mm:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent):
    * platform/qt/PlatformKeyboardEventQt.cpp:
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
    * platform/qt/PlatformMouseEventQt.cpp:
    (WebCore::mouseEventTypeAndMouseButtonFromQEvent):
    (WebCore::PlatformMouseEvent::PlatformMouseEvent):
    * platform/qt/WheelEventQt.cpp:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent):
    * platform/win/KeyEventWin.cpp:
    (WebCore::isKeypadEvent):
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    * platform/win/PlatformMouseEventWin.cpp:
    (WebCore::messageToEventType):
    (WebCore::PlatformMouseEvent::PlatformMouseEvent):
    * platform/win/WheelEventWin.cpp:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent):
    * platform/wx/KeyboardEventWx.cpp:
    (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
    (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
    * platform/wx/MouseEventWx.cpp:
    (WebCore::typeFromMouseEvent):
    (WebCore::PlatformMouseEvent::PlatformMouseEvent):
    * platform/wx/MouseWheelEventWx.cpp:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent):
    * plugins/mac/PluginViewMac.mm:
    (WebCore::PluginView::handleKeyboardEvent):
    * testing/Internals.cpp:
    (WebCore::Internals::setZoomAnimatorTransform):
    Switch to using new names/class modifier as necessary.
    
    ../WebKit/chromium: 
    
    * src/EditorClientImpl.cpp:
    (WebKit::EditorClientImpl::interpretKeyEvent):
    (WebKit::EditorClientImpl::handleEditingKeyboardEvent):
    * src/WebAccessibilityObject.cpp:
    (WebKit::WebAccessibilityObject::keyboardShortcut):
    * src/WebInputEventConversion.cpp:
    (WebKit::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
    (WebKit::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
    (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder):
    (WebKit::toPlatformKeyboardEventType):
    * src/WebViewImpl.cpp:
    (WebKit::WebViewImpl::dragSourceEndedAt):
    * tests/InnerGestureRecognizerTest.cpp:
    (SimulateAndTestFirstClick):
    (TEST_F):
    * tests/KeyboardTest.cpp:
    (WebKit::KeyboardTest::interpretKeyEvent):
    (WebKit::KeyboardTest::interpretOSModifierKeyPress):
    (WebKit::KeyboardTest::interpretCtrlKeyPress):
    (WebKit::KeyboardTest::interpretTab):
    (WebKit::KeyboardTest::interpretNewLine):
    (WebKit::TEST_F):
    * tests/PopupMenuTest.cpp:
    (WebKit::SelectPopupMenuTest::simulateLeftMouseDownEvent):
    (WebKit::SelectPopupMenuTest::simulateLeftMouseUpEvent):
    (WebKit::TEST_F):
    
    ../WebKit/efl: 
    
    * WebCoreSupport/EditorClientEfl.cpp:
    (WebCore::EditorClientEfl::handleEditingKeyboardEvent):
    
    ../WebKit/gtk: 
    
    * WebCoreSupport/EditorClientGtk.cpp:
    (WebKit::EditorClient::handleKeyboardEvent):
    * webkit/webkitwebview.cpp:
    (webkit_web_view_popup_menu_handler):
    
    ../WebKit/mac: 
    
    * WebView/WebFrame.mm:
    (-[WebFrame _dragSourceEndedAt:operation:]):
    * WebView/WebHTMLView.mm:
    (currentKeyboardEvent):
    (-[WebHTMLView _interpretKeyEvent:savingCommands:]):
    * WebView/WebPDFView.mm:
    (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
    
    ../WebKit/qt: 
    
    * WebCoreSupport/DragClientQt.cpp:
    (WebCore::DragClientQt::startDrag):
    * WebCoreSupport/EditorClientQt.cpp:
    (WebCore::EditorClientQt::handleKeyboardEvent):
    
    ../WebKit/win: 
    
    * AccessibleBase.cpp:
    (AccessibleBase::get_accKeyboardShortcut):
    * WebDropSource.cpp:
    (generateMouseEvent):
    * WebView.cpp:
    (WebView::keyUp):
    (WebView::handleEditingKeyboardEvent):
    (WebView::keyDown):
    (WebView::keyPress):
    
    ../WebKit/wince: 
    
    * WebCoreSupport/EditorClientWinCE.cpp:
    (WebKit::EditorClientWinCE::handleEditingKeyboardEvent):
    * WebView.cpp:
    (WebView::handleKeyDown):
    (WebView::handleKeyPress):
    (WebView::handleKeyUp):
    
    ../WebKit/wx: 
    
    * WebKitSupport/EditorClientWx.cpp:
    (WebCore::EditorClientWx::handleEditingKeyboardEvent):
    (WebCore::EditorClientWx::interpretKeyEvent):
    
    ../WebKit2: 
    
    * Shared/WebEventConversion.cpp:
    (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
    (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
    (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
    (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
    * WebKit2.xcodeproj/project.pbxproj:
    * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
    (WebKit::WebEditorClient::handleKeyboardEvent):
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::handleMouseEvent):
    (WebKit::WebPage::setInitialFocus):
    (WebKit::WebPage::handleEditingKeyboardEvent):
    (WebKit::WebPage::dragEnded):
    * WebProcess/WebPage/mac/WebPageMac.mm:
    (WebKit::WebPage::executeKeypressCommandsInternal):
    (WebKit::WebPage::handleEditingKeyboardEvent):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    4824ed55