Commit 4824ed55 authored by weinig@apple.com's avatar weinig@apple.com

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: http://svn.webkit.org/repository/webkit/trunk@103112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8946a811
......@@ -1054,6 +1054,7 @@ SET(WebCore_SOURCES
platform/Logging.cpp
platform/MIMETypeRegistry.cpp
platform/MemoryPressureHandler.cpp
platform/PlatformEvent.cpp
platform/RuntimeApplicationChecks.cpp
platform/ScrollAnimator.cpp
platform/ScrollableArea.cpp
......
2011-12-16 Sam Weinig <sam@webkit.org>
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.
* 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.
2011-12-16 Adam Barth <abarth@webkit.org>
<!doctype html><div><body><frameset> doesn't parse correctly
......@@ -2880,6 +2880,8 @@ webcore_sources += \
Source/WebCore/platform/network/soup/SoupURIUtils.h \
Source/WebCore/platform/NotImplemented.h \
Source/WebCore/platform/Pasteboard.h \
Source/WebCore/platform/PlatformEvent.cpp \
Source/WebCore/platform/PlatformEvent.h \
Source/WebCore/platform/PlatformExportMacros.h \
Source/WebCore/platform/PlatformKeyboardEvent.h \
Source/WebCore/platform/PlatformMenuDescription.h \
......
......@@ -1118,6 +1118,7 @@ SOURCES += \
platform/network/ResourceRequestBase.cpp \
platform/network/ResourceResponseBase.cpp \
platform/text/RegularExpression.cpp \
platform/PlatformEvent.cpp \
platform/RuntimeApplicationChecks.cpp \
platform/SchemeRegistry.cpp \
platform/ScrollableArea.cpp \
......
......@@ -605,8 +605,8 @@ __ZN7WebCore20makeRGBA32FromFloatsEffff
__ZN7WebCore20protocolIsJavaScriptERKN3WTF6StringE
__ZN7WebCore21BackForwardController11itemAtIndexEi
__ZN7WebCore21MemoryPressureHandler7installEv
__ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS0_4TypeEb
__ZN7WebCore21PlatformKeyboardEventC1EP7NSEvent
__ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS_13PlatformEvent4TypeEb
__ZN7WebCore21ResourceLoadScheduler20servePendingRequestsENS_20ResourceLoadPriorityE
__ZN7WebCore21ResourceLoadScheduler24schedulePluginStreamLoadEPNS_5FrameEPNS_32NetscapePlugInStreamLoaderClientERKNS_15ResourceRequestE
__ZN7WebCore21SVGDocumentExtensions21sampleAnimationAtTimeERKN3WTF6StringEPNS_14SVGSMILElementEd
......
......@@ -695,6 +695,8 @@
'platform/MemoryPressureHandler.h',
'platform/MIMETypeRegistry.h',
'platform/NotImplemented.h',
'platform/PlatformEvent.cpp',
'platform/PlatformEvent.h',
'platform/PlatformGestureEvent.h',
'platform/PlatformGestureRecognizer.h',
'platform/PlatformKeyboardEvent.h',
......
......@@ -26629,6 +26629,14 @@
RelativePath="..\platform\Pasteboard.h"
>
</File>
<File
RelativePath="..\platform\PlatformEvent.cpp"
>
</File>
<File
RelativePath="..\platform\PlatformEvent.h"
>
</File>
<File
RelativePath="..\platform\PlatformKeyboardEvent.h"
>
......@@ -5074,6 +5074,8 @@
BC5A86850C33676000EEA649 /* DOMSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5A86820C33676000EEA649 /* DOMSelection.h */; };
BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */; };
BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */; };
BC5C762A1497FE1400BC4775 /* PlatformEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5C76281497FE1400BC4775 /* PlatformEvent.cpp */; };
BC5C762B1497FE1400BC4775 /* PlatformEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5C76291497FE1400BC4775 /* PlatformEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DA0E81B7EA00B25965 /* BorderValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC5EB5DD0E81B8DD00B25965 /* OutlineValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -12401,6 +12403,8 @@
BC5A86830C33676000EEA649 /* DOMSelection.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DOMSelection.idl; sourceTree = "<group>"; };
BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMSelection.cpp; sourceTree = "<group>"; };
BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMSelection.h; sourceTree = "<group>"; };
BC5C76281497FE1400BC4775 /* PlatformEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformEvent.cpp; sourceTree = "<group>"; };
BC5C76291497FE1400BC4775 /* PlatformEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformEvent.h; sourceTree = "<group>"; };
BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizationStrategy.h; sourceTree = "<group>"; };
BC5EB5DA0E81B7EA00B25965 /* BorderValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BorderValue.h; path = style/BorderValue.h; sourceTree = "<group>"; };
BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OutlineValue.h; path = style/OutlineValue.h; sourceTree = "<group>"; };
......@@ -20259,6 +20263,8 @@
1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */,
1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */,
935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */,
BC5C76281497FE1400BC4775 /* PlatformEvent.cpp */,
BC5C76291497FE1400BC4775 /* PlatformEvent.h */,
BCBB8AB413F1AFB000734DF0 /* PODArena.h */,
1F3F19521499CA7600A5AEA7 /* PODFreeListArena.h */,
BCBB8AB513F1AFB000734DF0 /* PODInterval.h */,
......@@ -24880,6 +24886,7 @@
F35AE5AC14925F5B004D5776 /* DOMWrapperVisitor.h in Headers */,
26C17A3E1491D2D400D12BA2 /* FileSystemIOS.h in Headers */,
0F580FA31496939100FB5BD8 /* WebTileCacheLayer.h in Headers */,
BC5C762B1497FE1400BC4775 /* PlatformEvent.h in Headers */,
0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */,
1F3F19531499CA7600A5AEA7 /* PODFreeListArena.h in Headers */,
49ECEB681499790D00CDD3A4 /* FECompositeArithmeticNEON.h in Headers */,
......@@ -27774,6 +27781,7 @@
8C1091981494FB1200B5D3FE /* CSSElementStyleDeclaration.cpp in Sources */,
4306E4E614955543007F17AC /* KillRingNone.cpp in Sources */,
0F580FA41496939100FB5BD8 /* WebTileCacheLayer.mm in Sources */,
BC5C762A1497FE1400BC4775 /* PlatformEvent.cpp in Sources */,
49ECEB671499790D00CDD3A4 /* FECompositeArithmeticNEON.cpp in Sources */,
49ECEB691499790D00CDD3A4 /* FEGaussianBlurNEON.cpp in Sources */,
49ECEB6B1499790D00CDD3A4 /* FELightingNEON.cpp in Sources */,
......@@ -2590,7 +2590,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
// Simulate a click in the middle of the object.
LayoutPoint clickPoint = m_object->clickPoint();
PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, MouseEventPressed, 1, false, false, false, false, currentTime());
PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime());
bool handled = frame->eventHandler()->sendContextMenuEvent(mouseEvent);
if (handled)
page->chrome()->showContextMenu();
......
......@@ -34,18 +34,20 @@
namespace WebCore {
static inline const AtomicString& eventTypeForKeyboardEventType(PlatformKeyboardEvent::Type type)
static inline const AtomicString& eventTypeForKeyboardEventType(PlatformEvent::Type type)
{
switch (type) {
case PlatformKeyboardEvent::KeyUp:
case PlatformEvent::KeyUp:
return eventNames().keyupEvent;
case PlatformKeyboardEvent::RawKeyDown:
case PlatformEvent::RawKeyDown:
return eventNames().keydownEvent;
case PlatformKeyboardEvent::Char:
case PlatformEvent::Char:
return eventNames().keypressEvent;
case PlatformKeyboardEvent::KeyDown:
case PlatformEvent::KeyDown:
// The caller should disambiguate the combined event into RawKeyDown or Char events.
break;
default:
break;
}
ASSERT_NOT_REACHED();
return eventNames().keydownEvent;
......
......@@ -33,7 +33,7 @@ namespace WebCore {
PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget)
{
ASSERT(event.eventType() == MouseEventMoved || event.button() != NoButton);
ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton);
bool isCancelable = eventType != eventNames().mousemoveEvent;
......
......@@ -79,7 +79,7 @@ static PlatformMouseEvent createMouseEvent(DragData* dragData)
shiftKey = ctrlKey = altKey = metaKey = false;
PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPosition(),
LeftButton, MouseEventMoved, 0, shiftKey, ctrlKey, altKey,
LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey,
metaKey, currentTime());
}
......
This diff is collapsed.
......@@ -76,7 +76,7 @@ bool EventHandler::tabsToAllFormControls(KeyboardEvent*) const
unsigned EventHandler::accessKeyModifiers()
{
return PlatformKeyboardEvent::AltKey;
return PlatformEvent::AltKey;
}
void EventHandler::focusDocumentView()
......
......@@ -148,9 +148,9 @@ bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
unsigned EventHandler::accessKeyModifiers()
{
#if OS(DARWIN)
return PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey;
return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
#else
return PlatformKeyboardEvent::AltKey;
return PlatformEvent::AltKey;
#endif
}
......
......@@ -120,6 +120,6 @@ bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&
unsigned EventHandler::accessKeyModifiers()
{
return PlatformKeyboardEvent::AltKey;
return PlatformEvent::AltKey;
}
}
......@@ -119,7 +119,7 @@ bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&
unsigned EventHandler::accessKeyModifiers()
{
return PlatformKeyboardEvent::AltKey;
return PlatformEvent::AltKey;
}
// GTK+ must scroll horizontally if the mouse pointer is on top of the
......
......@@ -719,9 +719,9 @@ unsigned EventHandler::accessKeyModifiers()
// So, we use Control in this case, even though it conflicts with Emacs-style key bindings.
// See <https://bugs.webkit.org/show_bug.cgi?id=21107> for more detail.
if (AXObjectCache::accessibilityEnhancedUserInterfaceEnabled())
return PlatformKeyboardEvent::CtrlKey;
return PlatformEvent::CtrlKey;
return PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey;
return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
}
}
......@@ -124,9 +124,9 @@ bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&
unsigned EventHandler::accessKeyModifiers()
{
#if OS(DARWIN)
return PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey;
return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
#else
return PlatformKeyboardEvent::AltKey;
return PlatformEvent::AltKey;
#endif
}
......
......@@ -118,7 +118,7 @@ bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestR
unsigned EventHandler::accessKeyModifiers()
{
return PlatformKeyboardEvent::AltKey;
return PlatformEvent::AltKey;
}
}
......@@ -121,7 +121,7 @@ PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
unsigned EventHandler::accessKeyModifiers()
{
return PlatformKeyboardEvent::AltKey;
return PlatformEvent::AltKey;
}
}
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "PlatformEvent.h"
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PlatformEvent_h
#define PlatformEvent_h
namespace WebCore {
class PlatformEvent {
public:
enum Type {
NoType = 0,
// PlatformKeyboardEvent
KeyDown,
KeyUp,
RawKeyDown,
Char,
// PlatformMouseEvent
MouseMoved,
MousePressed,
MouseReleased,
MouseScroll,
// PlatformWheelEvent
Wheel,
// PlatformGestureEvent
GestureScrollBegin,
GestureScrollEnd,
GestureScrollUpdate,
GestureTap,
GestureTapDown,
GestureDoubleTap,
};
Type type() const { return static_cast<Type>(m_type); }
// Event Modifiers
enum ModifierKey {
AltKey = 1 << 0,
CtrlKey = 1 << 1,
MetaKey = 1 << 2,
ShiftKey = 1 << 3
};
bool shiftKey() const { return m_shiftKey; }
bool ctrlKey() const { return m_ctrlKey; }
bool altKey() const { return m_altKey; }
bool metaKey() const { return m_metaKey; }
unsigned modifiers() const
{
return (altKey() ? AltKey : 0)
| (ctrlKey() ? CtrlKey : 0)
| (metaKey() ? MetaKey : 0)
| (shiftKey() ? ShiftKey : 0);
}
protected:
PlatformEvent()
: m_shiftKey(false)
, m_ctrlKey(false)
, m_altKey(false)
, m_metaKey(false)
, m_type(NoType)
{
}
PlatformEvent(Type type)
: m_shiftKey(false)
, m_ctrlKey(false)
, m_altKey(false)
, m_metaKey(false)
, m_type(type)
{
}
PlatformEvent(Type type, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
: m_shiftKey(shiftKey)
, m_ctrlKey(ctrlKey)
, m_altKey(altKey)
, m_metaKey(metaKey)
, m_type(type)
{
}
// Explicit protected destructor so that people don't accidentally
// delete a PlatformEvent.
~PlatformEvent()
{
}
bool m_shiftKey;
bool m_ctrlKey;
bool m_altKey;
bool m_metaKey;
unsigned m_type;
};
} // namespace WebCore
#endif // PlatformEvent_h
......@@ -29,42 +29,30 @@
#if ENABLE(GESTURE_EVENTS)
#include "IntPoint.h"
#include "PlatformEvent.h"
namespace WebCore {
class PlatformGestureEvent {
class PlatformGestureEvent : public PlatformEvent {
public:
enum Type {
ScrollBeginType,
ScrollEndType,
ScrollUpdateType,
TapType,
TapDownType,
DoubleTapType,
};
PlatformGestureEvent()
: m_type(ScrollBeginType)
: PlatformEvent(PlatformEvent::GestureScrollBegin)
, m_timestamp(0)
, m_deltaX(0)
, m_deltaY(0)
{
}
PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const double timestamp, const float deltaX, const float deltaY, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
: m_type(type)
PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, double timestamp, float deltaX, float deltaY, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
: PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey)
, m_position(position)
, m_globalPosition(globalPosition)
, m_timestamp(timestamp)
, m_deltaX(deltaX)
, m_deltaY(deltaY)
, m_shiftKey(shiftKey)
, m_ctrlKey(ctrlKey)
, m_altKey(altKey)
, m_metaKey(metaKey)
{
}