Give PlatformEvents a base class
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Dec 2011 22:46:17 +0000 (22:46 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Dec 2011 22:46:17 +0000 (22:46 +0000)
commitfa89575078961939f419ff601d47c5b74e0588fa
treef80009e675698f4d44285e244bf240a6255638a9
parent92ebe50d64b454538d53b9d3afbf49b1f0c3a12e
Give PlatformEvents a base class
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: https://svn.webkit.org/repository/webkit/trunk@103112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
91 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
Source/WebCore/dom/KeyboardEvent.cpp
Source/WebCore/dom/MouseEvent.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/blackberry/EventHandlerBlackBerry.cpp
Source/WebCore/page/chromium/EventHandlerChromium.cpp
Source/WebCore/page/efl/EventHandlerEfl.cpp
Source/WebCore/page/gtk/EventHandlerGtk.cpp
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/page/qt/EventHandlerQt.cpp
Source/WebCore/page/win/EventHandlerWin.cpp
Source/WebCore/page/wx/EventHandlerWx.cpp
Source/WebCore/platform/PlatformEvent.cpp [new file with mode: 0644]
Source/WebCore/platform/PlatformEvent.h [new file with mode: 0644]
Source/WebCore/platform/PlatformGestureEvent.h
Source/WebCore/platform/PlatformKeyboardEvent.h
Source/WebCore/platform/PlatformMouseEvent.h
Source/WebCore/platform/PlatformWheelEvent.h
Source/WebCore/platform/ScrollAnimatorNone.cpp
Source/WebCore/platform/blackberry/PlatformKeyboardEventBlackBerry.cpp
Source/WebCore/platform/chromium/GestureRecognizerChromium.cpp
Source/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp
Source/WebCore/platform/chromium/PopupContainer.cpp
Source/WebCore/platform/chromium/PopupListBox.cpp
Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm
Source/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
Source/WebCore/platform/efl/PlatformMouseEventEfl.cpp
Source/WebCore/platform/efl/PlatformWheelEventEfl.cpp
Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp
Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp
Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp
Source/WebCore/platform/ios/KeyEventIOS.mm
Source/WebCore/platform/mac/KeyEventMac.mm
Source/WebCore/platform/mac/PlatformMouseEventMac.mm
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mac/WheelEventMac.mm
Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
Source/WebCore/platform/qt/PlatformMouseEventQt.cpp
Source/WebCore/platform/qt/WheelEventQt.cpp
Source/WebCore/platform/win/KeyEventWin.cpp
Source/WebCore/platform/win/PlatformMouseEventWin.cpp
Source/WebCore/platform/win/WheelEventWin.cpp
Source/WebCore/platform/wx/KeyboardEventWx.cpp
Source/WebCore/platform/wx/MouseEventWx.cpp
Source/WebCore/platform/wx/MouseWheelEventWx.cpp
Source/WebCore/plugins/mac/PluginViewMac.mm
Source/WebCore/testing/Internals.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/EditorClientImpl.cpp
Source/WebKit/chromium/src/WebAccessibilityObject.cpp
Source/WebKit/chromium/src/WebInputEventConversion.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/tests/InnerGestureRecognizerTest.cpp
Source/WebKit/chromium/tests/KeyboardTest.cpp
Source/WebKit/chromium/tests/PopupMenuTest.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebPDFView.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp
Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
Source/WebKit/win/AccessibleBase.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebDropSource.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
Source/WebKit/wince/WebView.cpp
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/EditorClientWx.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebEventConversion.cpp
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm