+2006-06-19 Sam Weinig <sam.weinig@gmail.com>
+
+ Reviewed by Darin.
+
+ - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9500
+ Split dom2_eventsimpl.* into separate files (one class per file).
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/kjs_binding.cpp:
+ * bindings/js/kjs_dom.cpp:
+ * bindings/js/kjs_events.cpp:
+ * bindings/js/kjs_html.cpp:
+ * bindings/js/kjs_window.cpp:
+ * bindings/objc/DOM.mm:
+ * bindings/objc/DOMEvents.mm:
+ * bindings/objc/DOMInternal.mm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bridge/mac/FrameMac.mm:
+ * dom/BeforeTextInsertedEvent.h:
+ * dom/BeforeUnloadEvent.cpp: Added.
+ * dom/BeforeUnloadEvent.h: Added.
+ (WebCore::BeforeUnloadEvent::result):
+ * dom/CharacterData.cpp:
+ * dom/Clipboard.h: Added.
+ (WebCore::Clipboard::~Clipboard):
+ * dom/ClipboardEvent.cpp: Added.
+ (WebCore::ClipboardEvent::ClipboardEvent):
+ * dom/ClipboardEvent.h: Added.
+ (WebCore::ClipboardEvent::clipboard):
+ * dom/ContainerNode.cpp:
+ * dom/Document.cpp:
+ * dom/Event.cpp: Added.
+ (WebCore::Event::Event):
+ (WebCore::Event::initEvent):
+ * dom/Event.h: Added.
+ (WebCore::):
+ (WebCore::Event::):
+ (WebCore::Event::type):
+ (WebCore::Event::target):
+ (WebCore::Event::currentTarget):
+ (WebCore::Event::setCurrentTarget):
+ (WebCore::Event::eventPhase):
+ (WebCore::Event::setEventPhase):
+ (WebCore::Event::bubbles):
+ (WebCore::Event::cancelable):
+ (WebCore::Event::timeStamp):
+ (WebCore::Event::stopPropagation):
+ (WebCore::Event::propagationStopped):
+ (WebCore::Event::defaultPrevented):
+ (WebCore::Event::setDefaultHandled):
+ (WebCore::Event::defaultHandled):
+ (WebCore::Event::preventDefault):
+ (WebCore::Event::setDefaultPrevented):
+ (WebCore::Event::setCancelBubble):
+ (WebCore::Event::getCancelBubble):
+ (WebCore::Event::dispatched):
+ * dom/EventTargetNode.cpp:
+ * dom/KeyboardEvent.cpp: Added.
+ (WebCore::KeyboardEvent::KeyboardEvent):
+ (WebCore::KeyboardEvent::initKeyboardEvent):
+ * dom/KeyboardEvent.h: Added.
+ (WebCore::KeyboardEvent::):
+ (WebCore::KeyboardEvent::keyIdentifier):
+ (WebCore::KeyboardEvent::keyLocation):
+ (WebCore::KeyboardEvent::altGraphKey):
+ (WebCore::KeyboardEvent::keyEvent):
+ * dom/MouseEvent.cpp: Added.
+ (WebCore::MouseEvent::MouseEvent):
+ (WebCore::MouseEvent::initMouseEvent):
+ (WebCore::MouseEvent::isDragEvent):
+ (WebCore::MouseEvent::toElement):
+ (WebCore::MouseEvent::fromElement):
+ * dom/MouseEvent.h: Added.
+ (WebCore::MouseEvent::button):
+ (WebCore::MouseEvent::relatedTarget):
+ (WebCore::MouseEvent::clipboard):
+ * dom/MouseRelatedEvent.cpp: Added.
+ (WebCore::MouseRelatedEvent::MouseRelatedEvent):
+ * dom/MouseRelatedEvent.h: Added.
+ (WebCore::MouseRelatedEvent::screenX):
+ (WebCore::MouseRelatedEvent::screenY):
+ (WebCore::MouseRelatedEvent::clientX):
+ (WebCore::MouseRelatedEvent::clientY):
+ (WebCore::MouseRelatedEvent::layerX):
+ (WebCore::MouseRelatedEvent::layerY):
+ (WebCore::MouseRelatedEvent::offsetX):
+ (WebCore::MouseRelatedEvent::offsetY):
+ (WebCore::MouseRelatedEvent::isSimulated):
+ * dom/MutationEvent.cpp: Added.
+ (WebCore::MutationEvent::MutationEvent):
+ (WebCore::MutationEvent::initMutationEvent):
+ * dom/MutationEvent.h: Added.
+ (WebCore::MutationEvent::):
+ (WebCore::MutationEvent::relatedNode):
+ (WebCore::MutationEvent::prevValue):
+ (WebCore::MutationEvent::newValue):
+ (WebCore::MutationEvent::attrName):
+ (WebCore::MutationEvent::attrChange):
+ * dom/RegisteredEventListener.cpp: Added.
+ (WebCore::RegisteredEventListener::RegisteredEventListener):
+ (WebCore::operator==):
+ * dom/RegisteredEventListener.h: Added.
+ (WebCore::RegisteredEventListener::eventType):
+ (WebCore::RegisteredEventListener::listener):
+ (WebCore::RegisteredEventListener::useCapture):
+ (WebCore::RegisteredEventListener::removed):
+ (WebCore::RegisteredEventListener::setRemoved):
+ (WebCore::operator!=):
+ * dom/UIEvent.cpp: Added.
+ (WebCore::UIEvent::UIEvent):
+ (WebCore::UIEvent::initUIEvent):
+ * dom/UIEvent.h: Added.
+ (WebCore::UIEvent::view):
+ (WebCore::UIEvent::detail):
+ * dom/UIEventWithKeyState.h: Added.
+ (WebCore::UIEventWithKeyState::UIEventWithKeyState):
+ (WebCore::UIEventWithKeyState::ctrlKey):
+ (WebCore::UIEventWithKeyState::shiftKey):
+ (WebCore::UIEventWithKeyState::altKey):
+ (WebCore::UIEventWithKeyState::metaKey):
+ * dom/WheelEvent.cpp: Added.
+ (WebCore::WheelEvent::WheelEvent):
+ * dom/WheelEvent.h: Added.
+ (WebCore::WheelEvent::isHorizontal):
+ (WebCore::WheelEvent::wheelDelta):
+ * dom/dom2_eventsimpl.cpp: Removed.
+ * dom/dom2_eventsimpl.h: Removed.
+ * editing/EditCommand.cpp:
+ * editing/SelectionController.cpp:
+ * html/HTMLAnchorElement.cpp:
+ * html/HTMLButtonElement.cpp:
+ * html/HTMLDocument.cpp:
+ * html/HTMLElement.cpp:
+ * html/HTMLFrameSetElement.cpp:
+ * html/HTMLInputElement.cpp:
+ * html/HTMLSelectElement.cpp:
+ * html/HTMLTextAreaElement.cpp:
+ * ksvg2/events/SVGZoomEvent.h:
+ * ksvg2/svg/SVGAElement.cpp:
+ * page/Frame.cpp:
+ * page/FrameView.cpp:
+ * platform/PlatformKeyboardEvent.h:
+ * platform/PlatformMouseEvent.h:
+ (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+ * platform/PlatformWheelEvent.h:
+ * platform/mac/ClipboardMac.h:
+ * rendering/RenderFrameSet.cpp:
+ * rendering/RenderLayer.cpp:
+ * rendering/RenderObject.cpp:
+ * rendering/RenderTextField.cpp:
+ * xml/xmlhttprequest.cpp:
+
2006-06-19 Darin Adler <darin@apple.com>
Reviewed by Brady.
7E6FEED90898582300C44C3F /* WebCoreScriptDebugger.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FEED70898582300C44C3F /* WebCoreScriptDebugger.mm */; };
8116895F09F2A4A000772CA0 /* SVGTRefElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8116895D09F2A4A000772CA0 /* SVGTRefElement.cpp */; };
8116896009F2A4A000772CA0 /* SVGTRefElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 8116895E09F2A4A000772CA0 /* SVGTRefElement.h */; };
+ 85031B3C0A44EFC700F992E0 /* BeforeUnloadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B260A44EFC700F992E0 /* BeforeUnloadEvent.cpp */; };
+ 85031B3D0A44EFC700F992E0 /* BeforeUnloadEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B270A44EFC700F992E0 /* BeforeUnloadEvent.h */; };
+ 85031B3E0A44EFC700F992E0 /* Clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B280A44EFC700F992E0 /* Clipboard.h */; };
+ 85031B3F0A44EFC700F992E0 /* ClipboardEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B290A44EFC700F992E0 /* ClipboardEvent.cpp */; };
+ 85031B400A44EFC700F992E0 /* ClipboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B2A0A44EFC700F992E0 /* ClipboardEvent.h */; };
+ 85031B410A44EFC700F992E0 /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B2B0A44EFC700F992E0 /* Event.cpp */; };
+ 85031B420A44EFC700F992E0 /* Event.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B2C0A44EFC700F992E0 /* Event.h */; };
+ 85031B430A44EFC700F992E0 /* KeyboardEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */; };
+ 85031B440A44EFC700F992E0 /* KeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */; };
+ 85031B450A44EFC700F992E0 /* MouseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */; };
+ 85031B460A44EFC700F992E0 /* MouseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B300A44EFC700F992E0 /* MouseEvent.h */; };
+ 85031B470A44EFC700F992E0 /* MouseRelatedEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B310A44EFC700F992E0 /* MouseRelatedEvent.cpp */; };
+ 85031B480A44EFC700F992E0 /* MouseRelatedEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B320A44EFC700F992E0 /* MouseRelatedEvent.h */; };
+ 85031B490A44EFC700F992E0 /* MutationEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B330A44EFC700F992E0 /* MutationEvent.cpp */; };
+ 85031B4A0A44EFC700F992E0 /* MutationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B340A44EFC700F992E0 /* MutationEvent.h */; };
+ 85031B4B0A44EFC700F992E0 /* RegisteredEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B350A44EFC700F992E0 /* RegisteredEventListener.cpp */; };
+ 85031B4C0A44EFC700F992E0 /* RegisteredEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B360A44EFC700F992E0 /* RegisteredEventListener.h */; };
+ 85031B4D0A44EFC700F992E0 /* UIEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B370A44EFC700F992E0 /* UIEvent.cpp */; };
+ 85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B380A44EFC700F992E0 /* UIEvent.h */; };
+ 85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */; };
+ 85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B3A0A44EFC700F992E0 /* WheelEvent.cpp */; };
+ 85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B3B0A44EFC700F992E0 /* WheelEvent.h */; };
854FE7300A2297BE0058D7AD /* NodeFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 854FE7260A2297BE0058D7AD /* NodeFilter.cpp */; };
854FE7310A2297BE0058D7AD /* NodeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 854FE7270A2297BE0058D7AD /* NodeFilter.h */; };
854FE7320A2297BE0058D7AD /* NodeFilterCondition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 854FE7280A2297BE0058D7AD /* NodeFilterCondition.cpp */; };
93F198EF08245E59001E9ABC /* HTMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25102DE4396018635CA /* HTMLParser.h */; };
93F198F008245E59001E9ABC /* HTMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25302DE4396018635CA /* HTMLTokenizer.h */; };
93F198F608245E59001E9ABC /* Decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D27902DE43D7018635CA /* Decoder.h */; };
- 93F1991708245E59001E9ABC /* dom2_eventsimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30202DE4476018635CA /* dom2_eventsimpl.h */; };
93F1991808245E59001E9ABC /* Range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30402DE4476018635CA /* Range.h */; };
93F1992108245E59001E9ABC /* xml_tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30A02DE4476018635CA /* xml_tokenizer.h */; };
93F1992908245E59001E9ABC /* KWQCString.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868302DE3B8601EA4122 /* KWQCString.h */; };
93F19A9B08245E59001E9ABC /* HTMLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25002DE4396018635CA /* HTMLParser.cpp */; };
93F19A9C08245E59001E9ABC /* HTMLTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25202DE4396018635CA /* HTMLTokenizer.cpp */; };
93F19A9D08245E59001E9ABC /* Decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D27802DE43D7018635CA /* Decoder.cpp */; };
- 93F19AB808245E59001E9ABC /* dom2_eventsimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30102DE4476018635CA /* dom2_eventsimpl.cpp */; };
93F19AB908245E59001E9ABC /* Range.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30302DE4476018635CA /* Range.cpp */; };
93F19ABC08245E59001E9ABC /* xml_tokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30902DE4476018635CA /* xml_tokenizer.cpp */; };
93F19ABE08245E59001E9ABC /* WebCoreCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A4FD02E2220F018635CB /* WebCoreCache.mm */; };
84C0FA2C052B966D000440A1 /* southWestResizeCursor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = southWestResizeCursor.tiff; sourceTree = "<group>"; };
84C0FA2D052B966D000440A1 /* waitCursor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = waitCursor.tiff; sourceTree = "<group>"; };
84C0FA2E052B966D000440A1 /* westResizeCursor.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = westResizeCursor.tiff; sourceTree = "<group>"; };
+ 85031B260A44EFC700F992E0 /* BeforeUnloadEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeUnloadEvent.cpp; sourceTree = "<group>"; };
+ 85031B270A44EFC700F992E0 /* BeforeUnloadEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BeforeUnloadEvent.h; sourceTree = "<group>"; };
+ 85031B280A44EFC700F992E0 /* Clipboard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Clipboard.h; sourceTree = "<group>"; };
+ 85031B290A44EFC700F992E0 /* ClipboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ClipboardEvent.cpp; sourceTree = "<group>"; };
+ 85031B2A0A44EFC700F992E0 /* ClipboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ClipboardEvent.h; sourceTree = "<group>"; };
+ 85031B2B0A44EFC700F992E0 /* Event.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Event.cpp; sourceTree = "<group>"; };
+ 85031B2C0A44EFC700F992E0 /* Event.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Event.h; sourceTree = "<group>"; };
+ 85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardEvent.cpp; sourceTree = "<group>"; };
+ 85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KeyboardEvent.h; sourceTree = "<group>"; };
+ 85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MouseEvent.cpp; sourceTree = "<group>"; };
+ 85031B300A44EFC700F992E0 /* MouseEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MouseEvent.h; sourceTree = "<group>"; };
+ 85031B310A44EFC700F992E0 /* MouseRelatedEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MouseRelatedEvent.cpp; sourceTree = "<group>"; };
+ 85031B320A44EFC700F992E0 /* MouseRelatedEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MouseRelatedEvent.h; sourceTree = "<group>"; };
+ 85031B330A44EFC700F992E0 /* MutationEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MutationEvent.cpp; sourceTree = "<group>"; };
+ 85031B340A44EFC700F992E0 /* MutationEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MutationEvent.h; sourceTree = "<group>"; };
+ 85031B350A44EFC700F992E0 /* RegisteredEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RegisteredEventListener.cpp; sourceTree = "<group>"; };
+ 85031B360A44EFC700F992E0 /* RegisteredEventListener.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RegisteredEventListener.h; sourceTree = "<group>"; };
+ 85031B370A44EFC700F992E0 /* UIEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = UIEvent.cpp; sourceTree = "<group>"; };
+ 85031B380A44EFC700F992E0 /* UIEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UIEvent.h; sourceTree = "<group>"; };
+ 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UIEventWithKeyState.h; sourceTree = "<group>"; };
+ 85031B3A0A44EFC700F992E0 /* WheelEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = WheelEvent.cpp; sourceTree = "<group>"; };
+ 85031B3B0A44EFC700F992E0 /* WheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WheelEvent.h; sourceTree = "<group>"; };
854FE7260A2297BE0058D7AD /* NodeFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = NodeFilter.cpp; sourceTree = "<group>"; };
854FE7270A2297BE0058D7AD /* NodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NodeFilter.h; sourceTree = "<group>"; };
854FE7280A2297BE0058D7AD /* NodeFilterCondition.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = NodeFilterCondition.cpp; sourceTree = "<group>"; };
F523D25302DE4396018635CA /* HTMLTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTokenizer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D27802DE43D7018635CA /* Decoder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Decoder.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D27902DE43D7018635CA /* Decoder.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Decoder.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D30102DE4476018635CA /* dom2_eventsimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dom2_eventsimpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D30202DE4476018635CA /* dom2_eventsimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = dom2_eventsimpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30302DE4476018635CA /* Range.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Range.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30402DE4476018635CA /* Range.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30902DE4476018635CA /* xml_tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xml_tokenizer.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8C4A7F909D563270003AC8D /* Attribute.h */,
AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */,
AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */,
+ 85031B260A44EFC700F992E0 /* BeforeUnloadEvent.cpp */,
+ 85031B270A44EFC700F992E0 /* BeforeUnloadEvent.h */,
6550B693099DF0270090D781 /* CDATASection.cpp */,
6550B694099DF0270090D781 /* CDATASection.h */,
6550B695099DF0270090D781 /* CharacterData.cpp */,
93EEC1E609C2877700C515D1 /* CharacterData.idl */,
A818721A0977D3C0005826D9 /* ChildNodeList.cpp */,
A81872150977D3C0005826D9 /* ChildNodeList.h */,
+ 85031B280A44EFC700F992E0 /* Clipboard.h */,
+ 85031B290A44EFC700F992E0 /* ClipboardEvent.cpp */,
+ 85031B2A0A44EFC700F992E0 /* ClipboardEvent.h */,
6550B697099DF0270090D781 /* Comment.cpp */,
6550B698099DF0270090D781 /* Comment.h */,
A81872140977D3C0005826D9 /* ContainerNode.cpp */,
A8185F3209765765005826D9 /* DocumentType.cpp */,
A8185F3109765765005826D9 /* DocumentType.h */,
93EEC1E809C2877700C515D1 /* DocumentType.idl */,
- F523D30102DE4476018635CA /* dom2_eventsimpl.cpp */,
- F523D30202DE4476018635CA /* dom2_eventsimpl.h */,
A8185F3609765765005826D9 /* DOMImplementation.cpp */,
A8185F3309765765005826D9 /* DOMImplementation.h */,
93EEC1E909C2877700C515D1 /* DOMImplementation.idl */,
93EEC1EB09C2877700C515D1 /* Entity.idl */,
A8EA7EB90A1945D000A8EF5F /* EntityReference.cpp */,
A8EA7EB80A1945D000A8EF5F /* EntityReference.h */,
+ 85031B2B0A44EFC700F992E0 /* Event.cpp */,
+ 85031B2C0A44EFC700F992E0 /* Event.h */,
14E836D209F8512000B85AE4 /* Event.idl */,
935FBC4409BA00B900E230B1 /* EventListener.h */,
939885C108B7E3D100E707C4 /* EventNames.cpp */,
14EC267E09CA07E000E1EEEC /* EventTargetNode.cpp */,
14EC267D09CA07E000E1EEEC /* EventTargetNode.h */,
935FBCF109BA143B00E230B1 /* ExceptionCode.h */,
+ 85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */,
+ 85031B2E0A44EFC700F992E0 /* KeyboardEvent.h */,
14CF7C2009F7110600EB3665 /* KeyboardEvent.idl */,
A8C4A7F409D563270003AC8D /* MappedAttribute.cpp */,
A8C4A7F309D563270003AC8D /* MappedAttribute.h */,
A8C4A84B09D5649D0003AC8D /* MappedAttributeEntry.h */,
+ 85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */,
+ 85031B300A44EFC700F992E0 /* MouseEvent.h */,
141B94E509EC4223000E9413 /* MouseEvent.idl */,
+ 85031B310A44EFC700F992E0 /* MouseRelatedEvent.cpp */,
+ 85031B320A44EFC700F992E0 /* MouseRelatedEvent.h */,
+ 85031B330A44EFC700F992E0 /* MutationEvent.cpp */,
+ 85031B340A44EFC700F992E0 /* MutationEvent.h */,
93EEC1F309C2877700C515D1 /* MutationEvent.idl */,
A8C4A7F209D563270003AC8D /* NamedAttrMap.cpp */,
A8C4A7F109D563270003AC8D /* NamedAttrMap.h */,
F523D30302DE4476018635CA /* Range.cpp */,
F523D30402DE4476018635CA /* Range.h */,
936DD03A09CEAC270056AE8C /* Range.idl */,
+ 85031B350A44EFC700F992E0 /* RegisteredEventListener.cpp */,
+ 85031B360A44EFC700F992E0 /* RegisteredEventListener.h */,
A8C4A7EC09D563270003AC8D /* StyledElement.cpp */,
A8C4A7EB09D563270003AC8D /* StyledElement.h */,
6550B69B099DF0270090D781 /* Text.cpp */,
854FE72D0A2297BE0058D7AD /* Traversal.h */,
854FE72E0A2297BE0058D7AD /* TreeWalker.cpp */,
854FE72F0A2297BE0058D7AD /* TreeWalker.h */,
+ 85031B370A44EFC700F992E0 /* UIEvent.cpp */,
+ 85031B380A44EFC700F992E0 /* UIEvent.h */,
+ 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */,
141B94EE09EC425A000E9413 /* UIEvent.idl */,
+ 85031B3A0A44EFC700F992E0 /* WheelEvent.cpp */,
+ 85031B3B0A44EFC700F992E0 /* WheelEvent.h */,
93EEC1F709C2877700C515D1 /* WheelEvent.idl */,
F523D30902DE4476018635CA /* xml_tokenizer.cpp */,
F523D30A02DE4476018635CA /* xml_tokenizer.h */,
93F198EF08245E59001E9ABC /* HTMLParser.h in Headers */,
93F198F008245E59001E9ABC /* HTMLTokenizer.h in Headers */,
93F198F608245E59001E9ABC /* Decoder.h in Headers */,
- 93F1991708245E59001E9ABC /* dom2_eventsimpl.h in Headers */,
93F1991808245E59001E9ABC /* Range.h in Headers */,
93F1992108245E59001E9ABC /* xml_tokenizer.h in Headers */,
93F1992908245E59001E9ABC /* KWQCString.h in Headers */,
51D3EA170A3D24D300BADA35 /* SQLDatabase.h in Headers */,
BC92F1DE0A40AEA300AC0746 /* DeprecatedSlider.h in Headers */,
D05CED2A0A40BB2C00C5AF38 /* FormatBlockCommand.h in Headers */,
+ 85031B3D0A44EFC700F992E0 /* BeforeUnloadEvent.h in Headers */,
+ 85031B3E0A44EFC700F992E0 /* Clipboard.h in Headers */,
+ 85031B400A44EFC700F992E0 /* ClipboardEvent.h in Headers */,
+ 85031B420A44EFC700F992E0 /* Event.h in Headers */,
+ 85031B440A44EFC700F992E0 /* KeyboardEvent.h in Headers */,
+ 85031B460A44EFC700F992E0 /* MouseEvent.h in Headers */,
+ 85031B480A44EFC700F992E0 /* MouseRelatedEvent.h in Headers */,
+ 85031B4A0A44EFC700F992E0 /* MutationEvent.h in Headers */,
+ 85031B4C0A44EFC700F992E0 /* RegisteredEventListener.h in Headers */,
+ 85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */,
+ 85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */,
+ 85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
93F19A9B08245E59001E9ABC /* HTMLParser.cpp in Sources */,
93F19A9C08245E59001E9ABC /* HTMLTokenizer.cpp in Sources */,
93F19A9D08245E59001E9ABC /* Decoder.cpp in Sources */,
- 93F19AB808245E59001E9ABC /* dom2_eventsimpl.cpp in Sources */,
93F19AB908245E59001E9ABC /* Range.cpp in Sources */,
93F19ABC08245E59001E9ABC /* xml_tokenizer.cpp in Sources */,
93F19ABE08245E59001E9ABC /* WebCoreCache.mm in Sources */,
51D3EA180A3D24D300BADA35 /* SQLStatement.cpp in Sources */,
BC92F1DD0A40AEA300AC0746 /* DeprecatedSlider.cpp in Sources */,
D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */,
+ 85031B3C0A44EFC700F992E0 /* BeforeUnloadEvent.cpp in Sources */,
+ 85031B3F0A44EFC700F992E0 /* ClipboardEvent.cpp in Sources */,
+ 85031B410A44EFC700F992E0 /* Event.cpp in Sources */,
+ 85031B430A44EFC700F992E0 /* KeyboardEvent.cpp in Sources */,
+ 85031B450A44EFC700F992E0 /* MouseEvent.cpp in Sources */,
+ 85031B470A44EFC700F992E0 /* MouseRelatedEvent.cpp in Sources */,
+ 85031B490A44EFC700F992E0 /* MutationEvent.cpp in Sources */,
+ 85031B4B0A44EFC700F992E0 /* RegisteredEventListener.cpp in Sources */,
+ 85031B4D0A44EFC700F992E0 /* UIEvent.cpp in Sources */,
+ 85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#include "config.h"
#include "kjs_binding.h"
+#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
#include "PlatformString.h"
#include "Range.h"
-#include "dom2_eventsimpl.h"
#include "XPathEvaluator.h"
#include "kjs_dom.h"
#include "kjs_window.h"
#include "DocumentType.h"
#include "Element.h"
#include "Entity.h"
+#include "Event.h"
+#include "EventListener.h"
#include "EventNames.h"
#include "ExceptionCode.h"
#include "Frame.h"
#include "ProcessingInstruction.h"
#include "Range.h"
#include "RenderView.h"
-#include "dom2_eventsimpl.h"
#include "kjs_css.h"
#include "kjs_events.h"
#include "kjs_traversal.h"
#include "config.h"
#include "kjs_events.h"
+#include "Clipboard.h"
+#include "ClipboardEvent.h"
#include "Document.h"
+#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
+#include "HTMLImageElement.h"
+#include "HTMLNames.h"
#include "JSEvent.h"
+#include "JSKeyboardEvent.h"
+#include "JSMouseEvent.h"
#include "JSMutationEvent.h"
#include "JSWheelEvent.h"
-#include "JSMouseEvent.h"
-#include "JSKeyboardEvent.h"
-#include "dom2_eventsimpl.h"
-#include "HTMLNames.h"
-#include "HTMLImageElement.h"
+#include "KeyboardEvent.h"
+#include "MouseEvent.h"
+#include "MutationEvent.h"
+#include "UIEvent.h"
+#include "WheelEvent.h"
#include "kjs_proxy.h"
#include "kjs_window.h"
#include "Frame.h"
#include "HTMLAppletElement.h"
#include "HTMLAreaElement.h"
+#include "HTMLBRElement.h"
#include "HTMLBaseFontElement.h"
#include "HTMLBlockquoteElement.h"
#include "HTMLBodyElement.h"
-#include "HTMLBRElement.h"
#include "HTMLDocument.h"
#include "HTMLEmbedElement.h"
#include "HTMLFieldSetElement.h"
#include "HTMLFontElement.h"
#include "HTMLFormElement.h"
#include "HTMLFrameSetElement.h"
-#include "HTMLHeadingElement.h"
#include "HTMLHRElement.h"
+#include "HTMLHeadingElement.h"
#include "HTMLHtmlElement.h"
#include "HTMLIFrameElement.h"
#include "HTMLImageElement.h"
#include "HTMLIsIndexElement.h"
+#include "HTMLLIElement.h"
#include "HTMLLabelElement.h"
#include "HTMLLegendElement.h"
-#include "HTMLLIElement.h"
#include "HTMLMapElement.h"
#include "HTMLMenuElement.h"
#include "HTMLModElement.h"
#include "HTMLParagraphElement.h"
#include "HTMLParamElement.h"
#include "HTMLPreElement.h"
+#include "HTMLQuoteElement.h"
#include "HTMLScriptElement.h"
#include "HTMLSelectElement.h"
#include "HTMLTableCaptionElement.h"
#include "HTMLTableElement.h"
#include "HTMLTableRowElement.h"
#include "HTMLTableSectionElement.h"
-#include "HTMLQuoteElement.h"
#include "JSHTMLImageElement.h"
#include "NameNodeList.h"
#include "RenderLayer.h"
#include "Text.h"
-#include "dom2_eventsimpl.h"
#include "kjs_css.h"
#include "kjs_events.h"
#include "kjs_proxy.h"
#include "DOMWindow.h"
#include "Element.h"
+#include "EventListener.h"
#include "EventNames.h"
#include "FloatRect.h"
#include "Frame.h"
#include "RenderView.h"
#include "Screen.h"
#include "SelectionController.h"
-#include "dom2_eventsimpl.h"
#include "htmlediting.h"
#include "kjs_css.h"
#include "kjs_events.h"
#import "DocumentType.h"
#import "Entity.h"
#import "EntityReference.h"
+#import "Event.h"
#import "EventListener.h"
#import "FoundationExtras.h"
#import "FrameMac.h"
#import "DOMInternal.h"
#import "DOMViewsInternal.h"
#import "Document.h"
-#import "dom2_eventsimpl.h"
+#import "Event.h"
+#import "MouseEvent.h"
+#import "MutationEvent.h"
+#import "UIEvent.h"
using namespace WebCore;
#import "DOMInternal.h"
#import "Document.h"
+#import "Event.h"
#import "FrameMac.h"
#import "Range.h"
#import "kjs_dom.h"
# When we're finished with the one-file-per-class
# reorganization, we won't need these special cases.
- if ($type eq "MutationEvent" or
- $type eq "KeyboardEvent" or
- $type eq "MouseEvent" or
- $type eq "Event" or
- $type eq "UIEvent" or
- $type eq "WheelEvent") {
- $implIncludes{"dom2_eventsimpl.h"} = 1;
- } elsif ($codeGenerator->IsPrimitiveType($type)
+ if ($codeGenerator->IsPrimitiveType($type)
or $type eq "DOMString" or $type eq "DOMObject" or $type eq "RGBColor" or $type eq "Rect") {
} else {
# default, include the same named file
return "toJS(exec, $value)";
} elsif ($type eq "Event") {
$implIncludes{"kjs_events.h"} = 1;
- $implIncludes{"dom2_eventsimpl.h"} = 1;
+ $implIncludes{"Event.h"} = 1;
return "toJS(exec, $value)";
} elsif ($type eq "NodeList" or $type eq "NamedNodeMap") {
$implIncludes{"kjs_dom.h"} = 1;
#import "FrameMac.h"
#import "AccessibilityObjectCache.h"
+#import "BeforeUnloadEvent.h"
#import "BlockExceptions.h"
#import "BrowserExtensionMac.h"
#import "CSSComputedStyleDeclaration.h"
#import "Cache.h"
+#import "ClipboardEvent.h"
#import "Cursor.h"
#import "DOMInternal.h"
#import "DOMWindow.h"
#import "Decoder.h"
+#import "Event.h"
#import "EventNames.h"
#import "FloatRect.h"
#import "FoundationExtras.h"
#import "PlatformWheelEvent.h"
#import "Plugin.h"
#import "RegularExpression.h"
-#import "RenderView.h"
#import "RenderImage.h"
#import "RenderListItem.h"
#import "RenderPart.h"
#import "RenderTableCell.h"
#import "RenderTheme.h"
+#import "RenderView.h"
#import "TextIterator.h"
#import "TransferJob.h"
#import "WebCoreFrameBridge.h"
#import <JavaScriptCore/WebScriptObjectPrivate.h>
#import <JavaScriptCore/npruntime_impl.h>
-
#undef _KWQ_TIMING
@interface NSObject (WebPlugIn)
#ifndef BEFORETEXTINSERTEDEVENTIMPL_H
#define BEFORETEXTINSERTEDEVENTIMPL_H
-#include "dom2_eventsimpl.h"
+#include "Event.h"
namespace WebCore {
-class BeforeTextInsertedEvent : public Event
-{
+class BeforeTextInsertedEvent : public Event {
public:
BeforeTextInsertedEvent(const String&);
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "BeforeUnloadEvent.h"
+
+#include "EventNames.h"
+
+namespace WebCore {
+
+using namespace EventNames;
+
+BeforeUnloadEvent::BeforeUnloadEvent()
+ : Event(beforeunloadEvent, false, true)
+{
+}
+
+bool BeforeUnloadEvent::storesResultAsString() const
+{
+ return true;
+}
+
+void BeforeUnloadEvent::storeResult(const String& s)
+{
+ m_result = s.impl();
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef BeforeUnloadEvent_h
+#define BeforeUnloadEvent_h
+
+#include "Event.h"
+
+namespace WebCore {
+
+ class BeforeUnloadEvent : public Event {
+ public:
+ BeforeUnloadEvent();
+
+ virtual bool storesResultAsString() const;
+ virtual void storeResult(const String&);
+
+ String result() const { return m_result.get(); }
+
+ private:
+ RefPtr<StringImpl> m_result;
+ };
+
+} // namespace WebCore
+
+#endif // BeforeUnloadEvent_h
#include "Document.h"
#include "EventNames.h"
#include "ExceptionCode.h"
-#include "RenderText.h"
-#include "dom2_eventsimpl.h"
#include "KWQTextStream.h"
+#include "MutationEvent.h"
+#include "RenderText.h"
namespace WebCore {
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef Clipboard_h
+#define Clipboard_h
+
+#include "AtomicString.h"
+#include "Node.h"
+#include "Shared.h"
+
+class DeprecatedStringList;
+
+namespace WebCore {
+
+ class CachedImage;
+ class IntPoint;
+
+ // State available during IE's events for drag and drop and copy/paste
+ class Clipboard : public Shared<Clipboard> {
+ public:
+ virtual ~Clipboard() { }
+
+ // Is this operation a drag-drop or a copy-paste?
+ virtual bool isForDragging() const = 0;
+
+ virtual String dropEffect() const = 0;
+ virtual void setDropEffect(const String&) = 0;
+ virtual String effectAllowed() const = 0;
+ virtual void setEffectAllowed(const String&) = 0;
+
+ virtual void clearData(const String& type) = 0;
+ virtual void clearAllData() = 0;
+ virtual String getData(const String& type, bool& success) const = 0;
+ virtual bool setData(const String& type, const String& data) = 0;
+
+ // extensions beyond IE's API
+ virtual DeprecatedStringList types() const = 0;
+
+ virtual IntPoint dragLocation() const = 0;
+ virtual CachedImage* dragImage() const = 0;
+ virtual void setDragImage(CachedImage*, const IntPoint&) = 0;
+ virtual Node* dragImageElement() = 0;
+ virtual void setDragImageElement(Node*, const IntPoint&) = 0;
+ };
+
+} // namespace WebCore
+
+#endif // Clipboard_h
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "ClipboardEvent.h"
+
+namespace WebCore {
+
+ClipboardEvent::ClipboardEvent()
+{
+}
+
+ClipboardEvent::ClipboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, Clipboard* clipboard)
+ : Event(eventType, canBubble, cancelable), m_clipboard(clipboard)
+{
+}
+
+bool ClipboardEvent::isClipboardEvent() const
+{
+ return true;
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef ClipboardEvent_h
+#define ClipboardEvent_h
+
+#include "Clipboard.h"
+#include "Event.h"
+
+namespace WebCore {
+
+ class ClipboardEvent : public Event {
+ public:
+ ClipboardEvent();
+ ClipboardEvent(const AtomicString& type, bool canBubbleArg, bool cancelableArg, Clipboard* clipboardArg);
+
+ Clipboard* clipboard() const { return m_clipboard.get(); }
+ virtual bool isClipboardEvent() const;
+ private:
+ RefPtr<Clipboard> m_clipboard;
+ };
+
+} // namespace WebCore
+
+#endif // ClipboardEvent_h
#include "ExceptionCode.h"
#include "FrameView.h"
#include "InlineTextBox.h"
-#include "SystemTime.h"
-#include "dom2_eventsimpl.h"
+#include "MutationEvent.h"
#include "RenderTheme.h"
#include "RootInlineBox.h"
+#include "SystemTime.h"
namespace WebCore {
#include "DocumentType.h"
#include "EditingText.h"
#include "EntityReference.h"
+#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
#include "ExceptionCode.h"
#include "HTMLNames.h"
#include "HTMLStyleElement.h"
#include "JSEditor.h"
+#include "KeyboardEvent.h"
#include "Logging.h"
+#include "MouseEvent.h"
#include "MouseEventWithHitTestResults.h"
+#include "MutationEvent.h"
#include "NameNodeList.h"
#include "NodeFilter.h"
#include "NodeIterator.h"
#include "PlatformKeyboardEvent.h"
#include "ProcessingInstruction.h"
+#include "RegisteredEventListener.h"
#include "RegularExpression.h"
#include "RenderArena.h"
#include "RenderView.h"
#include "SystemTime.h"
#include "TextIterator.h"
#include "TreeWalker.h"
+#include "UIEvent.h"
#include "csshelper.h"
#include "cssstyleselector.h"
-#include "dom2_eventsimpl.h"
#include "kjs_binding.h"
#include "kjs_proxy.h"
#include "xml_tokenizer.h"
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "Event.h"
+
+#include "AtomicString.h"
+#include "Node.h"
+#include "SystemTime.h"
+
+namespace WebCore {
+
+Event::Event()
+ : m_canBubble(false)
+ , m_cancelable(false)
+ , m_propagationStopped(false)
+ , m_defaultPrevented(false)
+ , m_defaultHandled(false)
+ , m_cancelBubble(false)
+ , m_currentTarget(0)
+ , m_eventPhase(0)
+ , m_createTime(static_cast<DOMTimeStamp>(currentTime() * 1000.0))
+{
+}
+
+Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg)
+ : m_type(eventType)
+ , m_canBubble(canBubbleArg)
+ , m_cancelable(cancelableArg)
+ , m_propagationStopped(false)
+ , m_defaultPrevented(false)
+ , m_defaultHandled(false)
+ , m_cancelBubble(false)
+ , m_currentTarget(0)
+ , m_eventPhase(0)
+ , m_createTime(static_cast<DOMTimeStamp>(currentTime() * 1000.0))
+{
+}
+
+Event::~Event()
+{
+}
+
+void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg)
+{
+ if (dispatched())
+ return;
+
+ m_type = eventTypeArg;
+ m_canBubble = canBubbleArg;
+ m_cancelable = cancelableArg;
+}
+
+bool Event::isUIEvent() const
+{
+ return false;
+}
+
+bool Event::isMouseEvent() const
+{
+ return false;
+}
+
+bool Event::isMutationEvent() const
+{
+ return false;
+}
+
+bool Event::isKeyboardEvent() const
+{
+ return false;
+}
+
+bool Event::isDragEvent() const
+{
+ return false;
+}
+
+bool Event::isClipboardEvent() const
+{
+ return false;
+}
+
+bool Event::isWheelEvent() const
+{
+ return false;
+}
+
+bool Event::isBeforeTextInsertedEvent() const
+{
+ return false;
+}
+
+bool Event::storesResultAsString() const
+{
+ return false;
+}
+
+void Event::storeResult(const String&)
+{
+}
+
+void Event::setTarget(Node* target)
+{
+ m_target = target;
+ if (target)
+ receivedTarget();
+}
+
+void Event::receivedTarget()
+{
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef Event_h
+#define Event_h
+
+#include "AtomicString.h"
+#include "Node.h"
+#include "Shared.h"
+
+namespace WebCore {
+
+ // FIXME: this should probably defined elsewhere.
+ typedef unsigned long long DOMTimeStamp;
+
+ // FIXME: these too should probably defined elsewhere.
+ const int EventExceptionOffset = 100;
+ const int EventExceptionMax = 199;
+ enum EventExceptionCode { UNSPECIFIED_EVENT_TYPE_ERR = EventExceptionOffset };
+
+ class Event : public Shared<Event> {
+ public:
+ enum PhaseType {
+ CAPTURING_PHASE = 1,
+ AT_TARGET = 2,
+ BUBBLING_PHASE = 3
+ };
+
+ // Reverse-engineered from Netscape
+ enum EventType {
+ MOUSEDOWN = 1,
+ MOUSEUP = 2,
+ MOUSEOVER = 4,
+ MOUSEOUT = 8,
+ MOUSEMOVE = 16,
+ MOUSEDRAG = 32,
+ CLICK = 64,
+ DBLCLICK = 128,
+ KEYDOWN = 256,
+ KEYUP = 512,
+ KEYPRESS = 1024,
+ DRAGDROP = 2048,
+ FOCUS = 4096,
+ BLUR = 8192,
+ SELECT = 16384,
+ CHANGE = 32768
+ };
+
+ Event();
+ Event(const AtomicString& typeArg, bool canBubbleArg, bool cancelableArg);
+ virtual ~Event();
+
+ void initEvent(const AtomicString &eventTypeArg, bool canBubbleArg, bool cancelableArg);
+
+ const AtomicString& type() const { return m_type; }
+
+ Node* target() const { return m_target.get(); }
+ void setTarget(Node*);
+
+ Node* currentTarget() const { return m_currentTarget; }
+ void setCurrentTarget(Node* currentTarget) { m_currentTarget = currentTarget; }
+
+ unsigned short eventPhase() const { return m_eventPhase; }
+ void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; }
+
+ bool bubbles() const { return m_canBubble; }
+ bool cancelable() const { return m_cancelable; }
+ DOMTimeStamp timeStamp() { return m_createTime; }
+ void stopPropagation() { m_propagationStopped = true; }
+
+ virtual bool isUIEvent() const;
+ virtual bool isMouseEvent() const;
+ virtual bool isMutationEvent() const;
+ virtual bool isKeyboardEvent() const;
+ virtual bool isDragEvent() const; // a subset of mouse events
+ virtual bool isClipboardEvent() const;
+ virtual bool isWheelEvent() const;
+ virtual bool isBeforeTextInsertedEvent() const;
+
+ bool propagationStopped() const { return m_propagationStopped; }
+ bool defaultPrevented() const { return m_defaultPrevented; }
+
+ void setDefaultHandled() { m_defaultHandled = true; }
+ bool defaultHandled() const { return m_defaultHandled; }
+
+ void preventDefault() { if (m_cancelable) m_defaultPrevented = true; }
+ void setDefaultPrevented(bool defaultPrevented) { m_defaultPrevented = defaultPrevented; }
+
+ void setCancelBubble(bool cancel) { m_cancelBubble = cancel; }
+ bool getCancelBubble() const { return m_cancelBubble; }
+
+ virtual bool storesResultAsString() const;
+ virtual void storeResult(const String&);
+
+ protected:
+ virtual void receivedTarget();
+ bool dispatched() const { return m_target; }
+
+ private:
+ AtomicString m_type;
+ bool m_canBubble;
+ bool m_cancelable;
+
+ bool m_propagationStopped;
+ bool m_defaultPrevented;
+ bool m_defaultHandled;
+ bool m_cancelBubble;
+
+ Node* m_currentTarget; // ref > 0 maintained externally
+ unsigned short m_eventPhase;
+ RefPtr<Node> m_target;
+ DOMTimeStamp m_createTime;
+ };
+
+} // namespace WebCore
+
+#endif // Event_h
#include "Document.h"
#include "Element.h"
+#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
#include "Frame.h"
+#include "HTMLNames.h"
+#include "KWQTextStream.h"
+#include "KeyboardEvent.h"
+#include "MouseEvent.h"
+#include "MutationEvent.h"
#include "PlatformMouseEvent.h"
#include "PlatformWheelEvent.h"
-#include "dom2_eventsimpl.h"
+#include "RegisteredEventListener.h"
+#include "UIEvent.h"
+#include "WheelEvent.h"
#include "kjs_proxy.h"
-#include "HTMLNames.h"
-#include "KWQTextStream.h"
namespace WebCore {
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "KeyboardEvent.h"
+
+#include "EventNames.h"
+#include "PlatformKeyboardEvent.h"
+
+namespace WebCore {
+
+using namespace EventNames;
+
+KeyboardEvent::KeyboardEvent()
+ : m_keyEvent(0)
+ , m_keyLocation(DOM_KEY_LOCATION_STANDARD)
+ , m_altGraphKey(false)
+{
+}
+
+KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view)
+ : UIEventWithKeyState(key.isKeyUp() ? keyupEvent : key.isAutoRepeat() ? keypressEvent : keydownEvent,
+ true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
+ , m_keyEvent(new PlatformKeyboardEvent(key))
+ , m_keyIdentifier(String(key.keyIdentifier()).impl())
+ , m_keyLocation(key.isKeypad() ? DOM_KEY_LOCATION_NUMPAD : DOM_KEY_LOCATION_STANDARD)
+ , m_altGraphKey(false)
+{
+}
+
+KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView *view,
+ const String &keyIdentifier, unsigned keyLocation,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey)
+ : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, altKey, shiftKey, metaKey)
+ , m_keyEvent(0)
+ , m_keyIdentifier(keyIdentifier.impl())
+ , m_keyLocation(keyLocation)
+ , m_altGraphKey(altGraphKey)
+{
+}
+
+KeyboardEvent::~KeyboardEvent()
+{
+ delete m_keyEvent;
+}
+
+void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
+ const String &keyIdentifier, unsigned keyLocation,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey)
+{
+ if (dispatched())
+ return;
+
+ initUIEvent(type, canBubble, cancelable, view, 0);
+
+ m_keyIdentifier = keyIdentifier.impl();
+ m_keyLocation = keyLocation;
+ m_ctrlKey = ctrlKey;
+ m_shiftKey = shiftKey;
+ m_altKey = altKey;
+ m_metaKey = metaKey;
+ m_altGraphKey = altGraphKey;
+}
+
+int KeyboardEvent::keyCode() const
+{
+ if (!m_keyEvent)
+ return 0;
+ if (type() == keydownEvent || type() == keyupEvent)
+ return m_keyEvent->WindowsKeyCode();
+ return charCode();
+}
+
+int KeyboardEvent::charCode() const
+{
+ if (!m_keyEvent)
+ return 0;
+ String text = m_keyEvent->text();
+ if (text.length() != 1)
+ return 0;
+ return text[0];
+}
+
+bool KeyboardEvent::isKeyboardEvent() const
+{
+ return true;
+}
+
+int KeyboardEvent::which() const
+{
+ // Netscape's "which" returns a virtual key code for keydown and keyup, and a character code for keypress.
+ // That's exactly what IE's "keyCode" returns. So they are the same for keyboard events.
+ return keyCode();
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef KeyboardEvent_h
+#define KeyboardEvent_h
+
+#include "UIEventWithKeyState.h"
+
+namespace WebCore {
+
+ class PlatformKeyboardEvent;
+
+ // Introduced in DOM Level 3
+ class KeyboardEvent : public UIEventWithKeyState {
+ public:
+ enum KeyLocationCode {
+ DOM_KEY_LOCATION_STANDARD = 0x00,
+ DOM_KEY_LOCATION_LEFT = 0x01,
+ DOM_KEY_LOCATION_RIGHT = 0x02,
+ DOM_KEY_LOCATION_NUMPAD = 0x03,
+ };
+
+ KeyboardEvent();
+ KeyboardEvent(const PlatformKeyboardEvent&, AbstractView*);
+ KeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
+ const String& keyIdentifier, unsigned keyLocation,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey);
+ virtual ~KeyboardEvent();
+
+ void initKeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
+ const String& keyIdentifier, unsigned keyLocation,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey);
+
+ String keyIdentifier() const { return m_keyIdentifier.get(); }
+ unsigned keyLocation() const { return m_keyLocation; }
+
+ bool altGraphKey() const { return m_altGraphKey; }
+
+ const PlatformKeyboardEvent* keyEvent() const { return m_keyEvent; }
+
+ int keyCode() const; // key code for keydown and keyup, character for other events
+ int charCode() const;
+
+ virtual bool isKeyboardEvent() const;
+ virtual int which() const;
+
+ private:
+ PlatformKeyboardEvent* m_keyEvent;
+ RefPtr<StringImpl> m_keyIdentifier;
+ unsigned m_keyLocation;
+ bool m_altGraphKey : 1;
+ };
+
+} // namespace WebCore
+
+#endif // KeyboardEvent_h
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "MouseEvent.h"
+
+#include "EventNames.h"
+
+namespace WebCore {
+
+using namespace EventNames;
+
+MouseEvent::MouseEvent()
+ : m_button(0)
+{
+}
+
+MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView* view,
+ int detail, int screenX, int screenY, int clientX, int clientY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
+ EventTargetNode* relatedTarget, Clipboard* clipboard, bool isSimulated)
+ : MouseRelatedEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY,
+ clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, isSimulated)
+ , m_button(button)
+ , m_relatedTarget(relatedTarget)
+ , m_clipboard(clipboard)
+{
+}
+
+MouseEvent::~MouseEvent()
+{
+}
+
+void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
+ int detail, int screenX, int screenY, int clientX, int clientY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
+ unsigned short button, EventTargetNode* relatedTarget)
+{
+ if (dispatched())
+ return;
+
+ initUIEvent(type, canBubble, cancelable, view, detail);
+
+ m_screenX = screenX;
+ m_screenY = screenY;
+ m_clientX = clientX;
+ m_clientY = clientY;
+ m_ctrlKey = ctrlKey;
+ m_altKey = altKey;
+ m_shiftKey = shiftKey;
+ m_metaKey = metaKey;
+ m_button = button;
+ m_relatedTarget = relatedTarget;
+
+ initCoordinates();
+}
+
+bool MouseEvent::isMouseEvent() const
+{
+ return true;
+}
+
+bool MouseEvent::isDragEvent() const
+{
+ const AtomicString& t = type();
+ return t == dragenterEvent || t == dragoverEvent || t == dragleaveEvent || t == dropEvent
+ || t == dragstartEvent|| t == dragEvent || t == dragendEvent;
+}
+
+int MouseEvent::which() const
+{
+ // For KHTML, the return values for left, middle and right mouse buttons are 0, 1, 2, respectively.
+ // For the Netscape "which" property, the return values for left, middle and right mouse buttons are 1, 2, 3, respectively.
+ // So we must add 1.
+ return m_button + 1;
+}
+
+Node* MouseEvent::toElement() const
+{
+ // MSIE extension - "the object toward which the user is moving the mouse pointer"
+ return (type() == mouseoutEvent) ? relatedTarget() : target();
+}
+
+Node* MouseEvent::fromElement() const
+{
+ // MSIE extension - "object from which activation or the mouse pointer is exiting during the event" (huh?)
+ return (type() == mouseoutEvent) ? target() : relatedTarget();
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef MouseEvent_h
+#define MouseEvent_h
+
+#include "Clipboard.h"
+#include "EventTargetNode.h"
+#include "MouseRelatedEvent.h"
+
+namespace WebCore {
+
+ // Introduced in DOM Level 2
+ class MouseEvent : public MouseRelatedEvent {
+ public:
+ MouseEvent();
+ MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
+ int detail, int screenX, int screenY, int clientX, int clientY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
+ EventTargetNode* relatedTarget, Clipboard* clipboard = 0, bool isSimulated = false);
+ virtual ~MouseEvent();
+
+ void initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
+ int detail, int screenX, int screenY, int clientX, int clientY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
+ unsigned short button, EventTargetNode* relatedTarget);
+
+ // WinIE uses 1,4,2 for left/middle/right but not for click (just for mousedown/up, maybe others),
+ // but we will match the standard DOM.
+ unsigned short button() const { return m_button; }
+ EventTargetNode* relatedTarget() const { return m_relatedTarget.get(); }
+ Clipboard* clipboard() const { return m_clipboard.get(); }
+
+ Node* toElement() const;
+ Node* fromElement() const;
+
+ virtual bool isMouseEvent() const;
+ virtual bool isDragEvent() const;
+ virtual int which() const;
+
+ private:
+ unsigned short m_button;
+ RefPtr<EventTargetNode> m_relatedTarget;
+ RefPtr<Clipboard> m_clipboard;
+ };
+
+} // namespace WebCore
+
+#endif // MouseEvent_h
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "MouseRelatedEvent.h"
+
+#include "AtomicString.h"
+#include "Document.h"
+#include "Node.h"
+#include "RenderLayer.h"
+#include "RenderObject.h"
+
+namespace WebCore {
+
+MouseRelatedEvent::MouseRelatedEvent()
+ : m_screenX(0)
+ , m_screenY(0)
+ , m_clientX(0)
+ , m_clientY(0)
+ , m_pageX(0)
+ , m_pageY(0)
+ , m_layerX(0)
+ , m_layerY(0)
+ , m_offsetX(0)
+ , m_offsetY(0)
+ , m_isSimulated(false)
+{
+}
+
+MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView* view,
+ int detail, int screenX, int screenY, int clientX, int clientY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated)
+ : UIEventWithKeyState(eventType, canBubble, cancelable, view, detail, ctrlKey, altKey, shiftKey, metaKey)
+ , m_screenX(screenX)
+ , m_screenY(screenY)
+ , m_clientX(clientX)
+ , m_clientY(clientY)
+ , m_isSimulated(isSimulated)
+{
+ initCoordinates();
+}
+
+void MouseRelatedEvent::initCoordinates()
+{
+ // Set up initial values for coordinates.
+ // Correct values can't be computed until we have at target, so receivedTarget
+ // does the "real" computation.
+ m_pageX = m_clientX;
+ m_pageY = m_clientY;
+ m_layerX = m_pageX;
+ m_layerY = m_pageY;
+ m_offsetX = m_pageX;
+ m_offsetY = m_pageY;
+}
+
+void MouseRelatedEvent::receivedTarget()
+{
+ // Compute coordinates that are based on the target.
+ m_offsetX = m_pageX;
+ m_offsetY = m_pageY;
+ m_layerX = m_pageX;
+ m_layerY = m_pageY;
+
+ Node* targ = target();
+ ASSERT(targ);
+
+ // Must have an updated render tree for this math to work correctly.
+ targ->document()->updateRendering();
+
+ // FIXME: clientX/Y should not be the same as pageX/Y!
+ // Currently the passed-in clientX and clientY are incorrectly actually
+ // pageX and pageY values, so we don't have any work to do here, but if
+ // we started passing in correct clientX and clientY, we'd want to compute
+ // pageX and pageY here.
+
+ // Adjust offsetX/Y to be relative to the target's position.
+ if (!isSimulated()) {
+ if (RenderObject* r = targ->renderer()) {
+ int rx, ry;
+ if (r->absolutePosition(rx, ry)) {
+ m_offsetX -= rx;
+ m_offsetY -= ry;
+ }
+ }
+ }
+
+ // Adjust layerX/Y to be relative to the layer.
+ // FIXME: We're pretty sure this is the wrong defintion of "layer."
+ // Our RenderLayer is a more modern concept, and layerX/Y is some
+ // other notion about groups of elements; we should test and fix this.
+ Node* n = targ;
+ while (n && !n->renderer())
+ n = n->parent();
+ if (n) {
+ RenderLayer* layer = n->renderer()->enclosingLayer();
+ layer->updateLayerPosition();
+ for (; layer; layer = layer->parent()) {
+ m_layerX -= layer->xPos();
+ m_layerY -= layer->yPos();
+ }
+ }
+}
+
+int MouseRelatedEvent::pageX() const
+{
+ return m_pageX;
+}
+
+int MouseRelatedEvent::pageY() const
+{
+ return m_pageY;
+}
+
+int MouseRelatedEvent::x() const
+{
+ // FIXME: This is not correct.
+ // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events.html>.
+ return m_clientX;
+}
+
+int MouseRelatedEvent::y() const
+{
+ // FIXME: This is not correct.
+ // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events.html>.
+ return m_clientY;
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef MouseRelatedEvent_h
+#define MouseRelatedEvent_h
+
+#include "AtomicString.h"
+#include "DOMWindow.h"
+#include "UIEventWithKeyState.h"
+
+namespace WebCore {
+
+ typedef DOMWindow AbstractView;
+
+ // Internal only: Helper class for what's common between mouse and wheel events.
+ class MouseRelatedEvent : public UIEventWithKeyState {
+ public:
+ MouseRelatedEvent();
+ MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
+ int detail, int screenX, int screenY, int clientX, int clientY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false);
+
+ int screenX() const { return m_screenX; }
+ int screenY() const { return m_screenY; }
+ int clientX() const { return m_clientX; }
+ int clientY() const { return m_clientY; }
+ int layerX() const { return m_layerX; }
+ int layerY() const { return m_layerY; }
+ int offsetX() const { return m_offsetX; }
+ int offsetY() const { return m_offsetY; }
+ bool isSimulated() const { return m_isSimulated; }
+ virtual int pageX() const;
+ virtual int pageY() const;
+ int x() const;
+ int y() const;
+
+ protected:
+ void initCoordinates();
+ virtual void receivedTarget();
+
+ // Expose these so MouseEvent::initMouseEvent can set them.
+ int m_screenX;
+ int m_screenY;
+ int m_clientX;
+ int m_clientY;
+
+ private:
+ int m_pageX;
+ int m_pageY;
+ int m_layerX;
+ int m_layerY;
+ int m_offsetX;
+ int m_offsetY;
+ bool m_isSimulated;
+ };
+
+} // namespace WebCore
+
+#endif // MouseRelatedEvent_h
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "MutationEvent.h"
+
+namespace WebCore {
+
+MutationEvent::MutationEvent()
+ : m_attrChange(0)
+{
+}
+
+MutationEvent::MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode,
+ const String& prevValue, const String& newValue,
+ const String& attrName, unsigned short attrChange)
+ : Event(type, canBubble, cancelable)
+ , m_relatedNode(relatedNode)
+ , m_prevValue(prevValue.impl())
+ , m_newValue(newValue.impl())
+ , m_attrName(attrName.impl())
+ , m_attrChange(attrChange)
+{
+}
+
+void MutationEvent::initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode,
+ const String& prevValue, const String& newValue,
+ const String& attrName, unsigned short attrChange)
+{
+ if (dispatched())
+ return;
+
+ initEvent(type, canBubble, cancelable);
+
+ m_relatedNode = relatedNode;
+ m_prevValue = prevValue.impl();
+ m_newValue = newValue.impl();
+ m_attrName = attrName.impl();
+ m_attrChange = attrChange;
+}
+
+bool MutationEvent::isMutationEvent() const
+{
+ return true;
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef MutationEvent_h
+#define MutationEvent_h
+
+#include "Event.h"
+#include "Node.h"
+
+namespace WebCore {
+
+ class MutationEvent : public Event {
+ public:
+ enum attrChangeType {
+ MODIFICATION = 1,
+ ADDITION = 2,
+ REMOVAL = 3
+ };
+
+ MutationEvent();
+ MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode,
+ const String& prevValue, const String& newValue,
+ const String& attrName, unsigned short attrChange);
+
+ void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode,
+ const String& prevValue, const String& newValue,
+ const String& attrName, unsigned short attrChange);
+
+ Node* relatedNode() const { return m_relatedNode.get(); }
+ String prevValue() const { return m_prevValue.get(); }
+ String newValue() const { return m_newValue.get(); }
+ String attrName() const { return m_attrName.get(); }
+ unsigned short attrChange() const { return m_attrChange; }
+
+ virtual bool isMutationEvent() const;
+
+ private:
+ RefPtr<Node> m_relatedNode;
+ RefPtr<StringImpl> m_prevValue;
+ RefPtr<StringImpl> m_newValue;
+ RefPtr<StringImpl> m_attrName;
+ unsigned short m_attrChange;
+ };
+
+} // namespace WebCore
+
+#endif // MutationEvent_h
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "RegisteredEventListener.h"
+
+#include "EventListener.h"
+
+namespace WebCore {
+
+RegisteredEventListener::RegisteredEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
+ : m_eventType(eventType)
+ , m_listener(listener)
+ , m_useCapture(useCapture)
+ , m_removed(false)
+{
+}
+
+bool operator==(const RegisteredEventListener& a, const RegisteredEventListener& b)
+{
+ return a.eventType() == b.eventType() && a.listener() == b.listener() && a.useCapture() == b.useCapture();
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef RegisteredEventListener_h
+#define RegisteredEventListener_h
+
+#include "AtomicString.h"
+#include "Shared.h"
+
+namespace WebCore {
+
+ class EventListener;
+
+ class RegisteredEventListener : public Shared<RegisteredEventListener> {
+ public:
+ RegisteredEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
+
+ const AtomicString& eventType() const { return m_eventType; }
+ EventListener* listener() const { return m_listener.get(); }
+ bool useCapture() const { return m_useCapture; }
+
+ bool removed() const { return m_removed; }
+ void setRemoved(bool removed) { m_removed = removed; }
+
+ private:
+ AtomicString m_eventType;
+ RefPtr<EventListener> m_listener;
+ bool m_useCapture;
+ bool m_removed;
+ };
+
+
+ bool operator==(const RegisteredEventListener&, const RegisteredEventListener&);
+ inline bool operator!=(const RegisteredEventListener& a, const RegisteredEventListener& b) { return !(a == b); }
+
+} // namespace WebCore
+
+#endif // RegisteredEventListener_h
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "UIEvent.h"
+
+#include "AtomicString.h"
+
+namespace WebCore {
+
+UIEvent::UIEvent()
+ : m_detail(0)
+{
+}
+
+UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, AbstractView* viewArg, int detailArg)
+ : Event(eventType, canBubbleArg, cancelableArg)
+ , m_view(viewArg)
+ , m_detail(detailArg)
+{
+}
+
+void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool cancelableArg, AbstractView* viewArg, int detailArg)
+{
+ if (dispatched())
+ return;
+
+ initEvent(typeArg, canBubbleArg, cancelableArg);
+
+ m_view = viewArg;
+ m_detail = detailArg;
+}
+
+bool UIEvent::isUIEvent() const
+{
+ return true;
+}
+
+int UIEvent::keyCode() const
+{
+ return 0;
+}
+
+int UIEvent::charCode() const
+{
+ return 0;
+}
+
+int UIEvent::layerX() const
+{
+ return 0;
+}
+
+int UIEvent::layerY() const
+{
+ return 0;
+}
+
+int UIEvent::pageX() const
+{
+ return 0;
+}
+
+int UIEvent::pageY() const
+{
+ return 0;
+}
+
+int UIEvent::which() const
+{
+ return 0;
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef UIEvent_h
+#define UIEvent_h
+
+#include "AtomicString.h"
+#include "DOMWindow.h"
+#include "Event.h"
+
+namespace WebCore {
+
+ typedef DOMWindow AbstractView;
+
+ class UIEvent : public Event {
+ public:
+ UIEvent();
+ UIEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail);
+
+ void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail);
+
+ AbstractView* view() const { return m_view.get(); }
+ int detail() const { return m_detail; }
+
+ virtual bool isUIEvent() const;
+
+ virtual int keyCode() const;
+ virtual int charCode() const;
+
+ virtual int layerX() const;
+ virtual int layerY() const;
+
+ virtual int pageX() const;
+ virtual int pageY() const;
+
+ virtual int which() const;
+
+ private:
+ RefPtr<AbstractView> m_view;
+ int m_detail;
+ };
+
+} // namespace WebCore
+
+#endif // UIEvent_h
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef UIEventWithKeyState_h
+#define UIEventWithKeyState_h
+
+#include "AtomicString.h"
+#include "DOMWindow.h"
+#include "UIEvent.h"
+
+namespace WebCore {
+
+ typedef DOMWindow AbstractView;
+
+ class UIEventWithKeyState : public UIEvent {
+ public:
+ UIEventWithKeyState()
+ : m_ctrlKey(false)
+ , m_altKey(false)
+ , m_shiftKey(false)
+ , m_metaKey(false)
+ {
+ }
+
+ UIEventWithKeyState(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view,
+ int detail, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+ : UIEvent(type, canBubble, cancelable, view, detail)
+ , m_ctrlKey(ctrlKey)
+ , m_altKey(altKey)
+ , m_shiftKey(shiftKey)
+ , m_metaKey(metaKey)
+ {
+ }
+
+ bool ctrlKey() const { return m_ctrlKey; }
+ bool shiftKey() const { return m_shiftKey; }
+ bool altKey() const { return m_altKey; }
+ bool metaKey() const { return m_metaKey; }
+
+ protected:
+ // Expose these so init functions can set them.
+ bool m_ctrlKey : 1;
+ bool m_altKey : 1;
+ bool m_shiftKey : 1;
+ bool m_metaKey : 1;
+ };
+
+} // namespace WebCore
+
+#endif // UIEventWithKeyState_h
--- /dev/null
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include "WheelEvent.h"
+
+#include "EventNames.h"
+
+namespace WebCore {
+
+using namespace EventNames;
+
+WheelEvent::WheelEvent()
+ : m_horizontal(false)
+ , m_wheelDelta(0)
+{
+}
+
+WheelEvent::WheelEvent(bool horizontal, int wheelDelta, AbstractView* view,
+ int screenX, int screenY, int clientX, int clientY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+ : MouseRelatedEvent(horizontal ? khtmlHorizontalmousewheelEvent : mousewheelEvent,
+ true, true, view, 0, screenX, screenY, clientX, clientY,
+ ctrlKey, altKey, shiftKey, metaKey)
+ , m_horizontal(horizontal)
+ , m_wheelDelta(wheelDelta)
+{
+}
+
+bool WheelEvent::isWheelEvent() const
+{
+ return true;
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * 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, 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef WheelEvent_h
+#define WheelEvent_h
+
+#include "MouseRelatedEvent.h"
+
+namespace WebCore {
+
+ // extension: mouse wheel event
+ class WheelEvent : public MouseRelatedEvent {
+ public:
+ WheelEvent();
+ WheelEvent(bool horizontal, int wheelDelta, AbstractView*,
+ int screenX, int screenY, int clientX, int clientY,
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
+
+ bool isHorizontal() const { return m_horizontal; }
+ int wheelDelta() const { return m_wheelDelta; }
+
+ private:
+ virtual bool isWheelEvent() const;
+
+ bool m_horizontal;
+ int m_wheelDelta;
+ };
+
+} // namespace WebCore
+
+#endif // WheelEvent_h
+++ /dev/null
-/**
- * This file is part of the DOM implementation for KDE.
- *
- * (C) 2001 Peter Kelly (pmk@post.com)
- * (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
- * Copyright (C) 2003, 2005, 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-#include "dom2_eventsimpl.h"
-
-#include "Document.h"
-#include "EventListener.h"
-#include "EventNames.h"
-#include "FrameView.h"
-#include "SystemTime.h"
-#include "PlatformKeyboardEvent.h"
-#include "SystemTime.h"
-#include "RenderLayer.h"
-
-namespace WebCore {
-
-using namespace EventNames;
-
-Event::Event()
- : m_canBubble(false)
- , m_cancelable(false)
- , m_propagationStopped(false)
- , m_defaultPrevented(false)
- , m_defaultHandled(false)
- , m_cancelBubble(false)
- , m_currentTarget(0)
- , m_eventPhase(0)
- , m_createTime(static_cast<DOMTimeStamp>(currentTime() * 1000.0))
-{
-}
-
-Event::Event(const AtomicString &eventType, bool canBubbleArg, bool cancelableArg)
- : m_type(eventType)
- , m_canBubble(canBubbleArg)
- , m_cancelable(cancelableArg)
- , m_propagationStopped(false)
- , m_defaultPrevented(false)
- , m_defaultHandled(false)
- , m_cancelBubble(false)
- , m_currentTarget(0)
- , m_eventPhase(0)
- , m_createTime(static_cast<DOMTimeStamp>(currentTime() * 1000.0))
-{
-}
-
-Event::~Event()
-{
-}
-
-void Event::initEvent(const AtomicString &eventTypeArg, bool canBubbleArg, bool cancelableArg)
-{
- if (dispatched())
- return;
-
- m_type = eventTypeArg;
- m_canBubble = canBubbleArg;
- m_cancelable = cancelableArg;
-}
-
-bool Event::isUIEvent() const
-{
- return false;
-}
-
-bool Event::isMouseEvent() const
-{
- return false;
-}
-
-bool Event::isMutationEvent() const
-{
- return false;
-}
-
-bool Event::isKeyboardEvent() const
-{
- return false;
-}
-
-bool Event::isDragEvent() const
-{
- return false;
-}
-
-bool Event::isClipboardEvent() const
-{
- return false;
-}
-
-bool Event::isWheelEvent() const
-{
- return false;
-}
-
-bool Event::isBeforeTextInsertedEvent() const
-{
- return false;
-}
-
-bool Event::storesResultAsString() const
-{
- return false;
-}
-
-void Event::storeResult(const String&)
-{
-}
-
-void Event::setTarget(Node* target)
-{
- m_target = target;
- if (target)
- receivedTarget();
-}
-
-void Event::receivedTarget()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-UIEvent::UIEvent()
- : m_detail(0)
-{
-}
-
-UIEvent::UIEvent(const AtomicString &eventType, bool canBubbleArg, bool cancelableArg, AbstractView *viewArg, int detailArg)
- : Event(eventType, canBubbleArg, cancelableArg)
- , m_view(viewArg)
- , m_detail(detailArg)
-{
-}
-
-void UIEvent::initUIEvent(const AtomicString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- int detailArg)
-{
- if (dispatched())
- return;
-
- initEvent(typeArg, canBubbleArg, cancelableArg);
-
- m_view = viewArg;
- m_detail = detailArg;
-}
-
-bool UIEvent::isUIEvent() const
-{
- return true;
-}
-
-int UIEvent::keyCode() const
-{
- return 0;
-}
-
-int UIEvent::charCode() const
-{
- return 0;
-}
-
-int UIEvent::layerX() const
-{
- return 0;
-}
-
-int UIEvent::layerY() const
-{
- return 0;
-}
-
-int UIEvent::pageX() const
-{
- return 0;
-}
-
-int UIEvent::pageY() const
-{
- return 0;
-}
-
-int UIEvent::which() const
-{
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-MouseRelatedEvent::MouseRelatedEvent()
- : m_screenX(0), m_screenY(0), m_clientX(0), m_clientY(0)
- , m_pageX(0), m_pageY(0), m_layerX(0), m_layerY(0), m_offsetX(0), m_offsetY(0), m_isSimulated(false)
-{
-}
-
-MouseRelatedEvent::MouseRelatedEvent(const AtomicString &eventType,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- bool isSimulated)
- : UIEventWithKeyState(eventType, canBubbleArg, cancelableArg, viewArg, detailArg,
- ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg)
- , m_screenX(screenXArg), m_screenY(screenYArg)
- , m_clientX(clientXArg), m_clientY(clientYArg)
- , m_isSimulated(isSimulated)
-{
- initCoordinates();
-}
-
-void MouseRelatedEvent::initCoordinates()
-{
- // Set up initial values for coordinates.
- // Correct values can't be computed until we have at target, so receivedTarget
- // does the "real" computation.
- m_pageX = m_clientX;
- m_pageY = m_clientY;
- m_layerX = m_pageX;
- m_layerY = m_pageY;
- m_offsetX = m_pageX;
- m_offsetY = m_pageY;
-}
-
-void MouseRelatedEvent::receivedTarget()
-{
- // Compute coordinates that are based on the target.
- m_offsetX = m_pageX;
- m_offsetY = m_pageY;
- m_layerX = m_pageX;
- m_layerY = m_pageY;
-
- Node* targ = target();
- ASSERT(targ);
-
- // Must have an updated render tree for this math to work correctly.
- targ->document()->updateRendering();
-
- // FIXME: clientX/Y should not be the same as pageX/Y!
- // Currently the passed-in clientX and clientY are incorrectly actually
- // pageX and pageY values, so we don't have any work to do here, but if
- // we started passing in correct clientX and clientY, we'd want to compute
- // pageX and pageY here.
-
- // Adjust offsetX/Y to be relative to the target's position.
- if (!isSimulated()) {
- if (RenderObject* r = targ->renderer()) {
- int rx, ry;
- if (r->absolutePosition(rx, ry)) {
- m_offsetX -= rx;
- m_offsetY -= ry;
- }
- }
- }
-
- // Adjust layerX/Y to be relative to the layer.
- // FIXME: We're pretty sure this is the wrong defintion of "layer."
- // Our RenderLayer is a more modern concept, and layerX/Y is some
- // other notion about groups of elements; we should test and fix this.
- Node* n = targ;
- while (n && !n->renderer())
- n = n->parent();
- if (n) {
- RenderLayer* layer = n->renderer()->enclosingLayer();
- layer->updateLayerPosition();
- for (; layer; layer = layer->parent()) {
- m_layerX -= layer->xPos();
- m_layerY -= layer->yPos();
- }
- }
-}
-
-int MouseRelatedEvent::pageX() const
-{
- return m_pageX;
-}
-
-int MouseRelatedEvent::pageY() const
-{
- return m_pageY;
-}
-
-int MouseRelatedEvent::x() const
-{
- // FIXME: This is not correct.
- // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events.html>.
- return m_clientX;
-}
-
-int MouseRelatedEvent::y() const
-{
- // FIXME: This is not correct.
- // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events.html>.
- return m_clientY;
-}
-
-// -----------------------------------------------------------------------------
-
-MouseEvent::MouseEvent()
- : m_button(0)
-{
-}
-
-MouseEvent::MouseEvent(const AtomicString& eventType,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- unsigned short buttonArg,
- EventTargetNode* relatedTargetArg,
- Clipboard* clipboardArg,
- bool isSimulated)
- : MouseRelatedEvent(eventType, canBubbleArg, cancelableArg, viewArg, detailArg,
- screenXArg, screenYArg, clientXArg, clientYArg,
- ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, isSimulated)
- , m_button(buttonArg)
- , m_relatedTarget(relatedTargetArg)
- , m_clipboard(clipboardArg)
-{
-}
-
-MouseEvent::~MouseEvent()
-{
-}
-
-void MouseEvent::initMouseEvent(const AtomicString& typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView* viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- unsigned short buttonArg,
- EventTargetNode* relatedTargetArg)
-{
- if (dispatched())
- return;
-
- initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
-
- m_screenX = screenXArg;
- m_screenY = screenYArg;
- m_clientX = clientXArg;
- m_clientY = clientYArg;
- m_ctrlKey = ctrlKeyArg;
- m_altKey = altKeyArg;
- m_shiftKey = shiftKeyArg;
- m_metaKey = metaKeyArg;
- m_button = buttonArg;
- m_relatedTarget = relatedTargetArg;
-
- initCoordinates();
-}
-
-bool MouseEvent::isMouseEvent() const
-{
- return true;
-}
-
-bool MouseEvent::isDragEvent() const
-{
- const AtomicString &t = type();
- return t == dragenterEvent || t == dragoverEvent || t == dragleaveEvent
- || t == dropEvent
- || t == dragstartEvent || t == dragEvent || t == dragendEvent;
-}
-
-int MouseEvent::which() const
-{
- // For KHTML, the return values for left, middle and right mouse buttons are 0, 1, 2, respectively.
- // For the Netscape "which" property, the return values for left, middle and right mouse buttons are 1, 2, 3, respectively.
- // So we must add 1.
- return m_button + 1;
-}
-
-Node* MouseEvent::toElement() const
-{
- // MSIE extension - "the object toward which the user is moving the mouse pointer"
- return type() == mouseoutEvent ? relatedTarget() : target();
-}
-
-Node* MouseEvent::fromElement() const
-{
- // MSIE extension - "object from which activation or the mouse pointer is exiting during the event" (huh?)
- return type() == mouseoutEvent ? target() : relatedTarget();
-}
-
-//---------------------------------------------------------------------------------------------
-
-KeyboardEvent::KeyboardEvent()
- : m_keyEvent(0)
- , m_keyLocation(DOM_KEY_LOCATION_STANDARD)
- , m_altGraphKey(false)
-{
-}
-
-KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView *view)
- : UIEventWithKeyState(key.isKeyUp() ? keyupEvent : key.isAutoRepeat() ? keypressEvent : keydownEvent,
- true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
- , m_keyEvent(new PlatformKeyboardEvent(key))
- , m_keyIdentifier(String(key.keyIdentifier()).impl())
- , m_keyLocation(key.isKeypad() ? DOM_KEY_LOCATION_NUMPAD : DOM_KEY_LOCATION_STANDARD)
- , m_altGraphKey(false)
-{
-}
-
-KeyboardEvent::KeyboardEvent(const AtomicString &eventType,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- const String &keyIdentifierArg,
- unsigned keyLocationArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- bool altGraphKeyArg)
- : UIEventWithKeyState(eventType, canBubbleArg, cancelableArg, viewArg, 0, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg)
- , m_keyEvent(0)
- , m_keyIdentifier(keyIdentifierArg.impl())
- , m_keyLocation(keyLocationArg)
- , m_altGraphKey(altGraphKeyArg)
-{
-}
-
-KeyboardEvent::~KeyboardEvent()
-{
- delete m_keyEvent;
-}
-
-void KeyboardEvent::initKeyboardEvent(const AtomicString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- const String &keyIdentifierArg,
- unsigned keyLocationArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- bool altGraphKeyArg)
-{
- if (dispatched())
- return;
-
- initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, 0);
-
- m_keyIdentifier = keyIdentifierArg.impl();
- m_keyLocation = keyLocationArg;
- m_ctrlKey = ctrlKeyArg;
- m_shiftKey = shiftKeyArg;
- m_altKey = altKeyArg;
- m_metaKey = metaKeyArg;
- m_altGraphKey = altGraphKeyArg;
-}
-
-int KeyboardEvent::keyCode() const
-{
- if (!m_keyEvent)
- return 0;
- if (type() == keydownEvent || type() == keyupEvent)
- return m_keyEvent->WindowsKeyCode();
- return charCode();
-}
-
-int KeyboardEvent::charCode() const
-{
- if (!m_keyEvent)
- return 0;
- String text = m_keyEvent->text();
- if (text.length() != 1)
- return 0;
- return text[0];
-}
-
-bool KeyboardEvent::isKeyboardEvent() const
-{
- return true;
-}
-
-int KeyboardEvent::which() const
-{
- // Netscape's "which" returns a virtual key code for keydown and keyup, and a character code for keypress.
- // That's exactly what IE's "keyCode" returns. So they are the same for keyboard events.
- return keyCode();
-}
-
-// -----------------------------------------------------------------------------
-
-MutationEvent::MutationEvent()
- : m_attrChange(0)
-{
-}
-
-MutationEvent::MutationEvent(const AtomicString &eventType,
- bool canBubbleArg,
- bool cancelableArg,
- Node *relatedNodeArg,
- const String &prevValueArg,
- const String &newValueArg,
- const String &attrNameArg,
- unsigned short attrChangeArg)
- : Event(eventType, canBubbleArg, cancelableArg)
- , m_relatedNode(relatedNodeArg)
- , m_prevValue(prevValueArg.impl())
- , m_newValue(newValueArg.impl())
- , m_attrName(attrNameArg.impl())
- , m_attrChange(attrChangeArg)
-{
-}
-
-void MutationEvent::initMutationEvent(const AtomicString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- Node *relatedNodeArg,
- const String &prevValueArg,
- const String &newValueArg,
- const String &attrNameArg,
- unsigned short attrChangeArg)
-{
- if (dispatched())
- return;
-
- initEvent(typeArg, canBubbleArg, cancelableArg);
-
- m_relatedNode = relatedNodeArg;
- m_prevValue = prevValueArg.impl();
- m_newValue = newValueArg.impl();
- m_attrName = attrNameArg.impl();
- m_attrChange = attrChangeArg;
-}
-
-bool MutationEvent::isMutationEvent() const
-{
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-ClipboardEvent::ClipboardEvent()
-{
-}
-
-ClipboardEvent::ClipboardEvent(const AtomicString &eventType, bool canBubbleArg, bool cancelableArg, Clipboard *clipboardArg)
- : Event(eventType, canBubbleArg, cancelableArg), m_clipboard(clipboardArg)
-{
-}
-
-bool ClipboardEvent::isClipboardEvent() const
-{
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-WheelEvent::WheelEvent() : m_horizontal(false), m_wheelDelta(0)
-{
-}
-
-WheelEvent::WheelEvent(bool h, int d, AbstractView *v,
- int sx, int sy, int cx, int cy, bool ctrl, bool alt, bool shift, bool meta)
- : MouseRelatedEvent(h ? khtmlHorizontalmousewheelEvent : mousewheelEvent,
- true, true, v, 0, sx, sy, cx, cy, ctrl, alt, shift, meta)
- , m_horizontal(h), m_wheelDelta(d)
-{
-}
-
-bool WheelEvent::isWheelEvent() const
-{
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-RegisteredEventListener::RegisteredEventListener(const AtomicString &eventType, PassRefPtr<EventListener> listener, bool useCapture)
- : m_eventType(eventType)
- , m_listener(listener)
- , m_useCapture(useCapture)
- , m_removed(false)
-{
-}
-
-bool operator==(const RegisteredEventListener &a, const RegisteredEventListener &b)
-{
- return a.eventType() == b.eventType() && a.listener() == b.listener() && a.useCapture() == b.useCapture();
-}
-
-// -----------------------------------------------------------------------------
-
-Clipboard::~Clipboard()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-BeforeUnloadEvent::BeforeUnloadEvent()
- : Event(beforeunloadEvent, false, true)
-{
-}
-
-bool BeforeUnloadEvent::storesResultAsString() const
-{
- return true;
-}
-
-void BeforeUnloadEvent::storeResult(const String& s)
-{
- m_result = s.impl();
-}
-
-}
+++ /dev/null
-/*
- * This file is part of the DOM implementation for KDE.
- *
- * Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
- * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef DOM_EVENTSIMPL_H
-#define DOM_EVENTSIMPL_H
-
-#include "AtomicString.h"
-#include "DOMWindow.h"
-#include "Node.h"
-
-class DeprecatedStringList;
-
-namespace WebCore {
-
-class CachedImage;
-class Clipboard;
-class EventListener;
-class EventTargetNode;
-class Image;
-class IntPoint;
-class PlatformKeyboardEvent;
-
-typedef unsigned long long DOMTimeStamp;
-typedef DOMWindow AbstractView;
-
-const int EventExceptionOffset = 100;
-const int EventExceptionMax = 199;
-enum EventExceptionCode { UNSPECIFIED_EVENT_TYPE_ERR = EventExceptionOffset };
-
-class Event : public Shared<Event>
-{
-public:
- enum PhaseType {
- CAPTURING_PHASE = 1,
- AT_TARGET = 2,
- BUBBLING_PHASE = 3
- };
-
- // Reverse-engineered from Netscape
- enum EventType {
- MOUSEDOWN = 1,
- MOUSEUP = 2,
- MOUSEOVER = 4,
- MOUSEOUT = 8,
- MOUSEMOVE = 16,
- MOUSEDRAG = 32,
- CLICK = 64,
- DBLCLICK = 128,
- KEYDOWN = 256,
- KEYUP = 512,
- KEYPRESS = 1024,
- DRAGDROP = 2048,
- FOCUS = 4096,
- BLUR = 8192,
- SELECT = 16384,
- CHANGE = 32768
- };
-
- Event();
- Event(const AtomicString& type, bool canBubbleArg, bool cancelableArg);
- virtual ~Event();
-
- const AtomicString &type() const { return m_type; }
- Node* target() const { return m_target.get(); }
- void setTarget(Node*);
- Node* currentTarget() const { return m_currentTarget; }
- void setCurrentTarget(Node* currentTarget) { m_currentTarget = currentTarget; }
- unsigned short eventPhase() const { return m_eventPhase; }
- void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; }
- bool bubbles() const { return m_canBubble; }
- bool cancelable() const { return m_cancelable; }
- DOMTimeStamp timeStamp() { return m_createTime; }
- void stopPropagation() { m_propagationStopped = true; }
- void preventDefault() { if (m_cancelable) m_defaultPrevented = true; }
- void initEvent(const AtomicString &eventTypeArg, bool canBubbleArg, bool cancelableArg);
-
- virtual bool isUIEvent() const;
- virtual bool isMouseEvent() const;
- virtual bool isMutationEvent() const;
- virtual bool isKeyboardEvent() const;
- virtual bool isDragEvent() const; // a subset of mouse events
- virtual bool isClipboardEvent() const;
- virtual bool isWheelEvent() const;
- virtual bool isBeforeTextInsertedEvent() const;
-
- bool propagationStopped() const { return m_propagationStopped; }
- bool defaultPrevented() const { return m_defaultPrevented; }
-
- void setDefaultHandled() { m_defaultHandled = true; }
- bool defaultHandled() const { return m_defaultHandled; }
-
- void setCancelBubble(bool cancel) { m_cancelBubble = cancel; }
- void setDefaultPrevented(bool defaultPrevented) { m_defaultPrevented = defaultPrevented; }
- bool getCancelBubble() const { return m_cancelBubble; }
-
- virtual bool storesResultAsString() const;
- virtual void storeResult(const String&);
-
-protected:
- virtual void receivedTarget();
- bool dispatched() const { return m_target; }
-
-private:
- AtomicString m_type;
- bool m_canBubble;
- bool m_cancelable;
-
- bool m_propagationStopped;
- bool m_defaultPrevented;
- bool m_defaultHandled;
- bool m_cancelBubble;
-
- Node* m_currentTarget; // ref > 0 maintained externally
- unsigned short m_eventPhase;
- RefPtr<Node> m_target;
- DOMTimeStamp m_createTime;
-};
-
-class UIEvent : public Event
-{
-public:
- UIEvent();
- UIEvent(const AtomicString &type,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- int detailArg);
- AbstractView *view() const { return m_view.get(); }
- int detail() const { return m_detail; }
- void initUIEvent(const AtomicString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- int detailArg);
- virtual bool isUIEvent() const;
-
- virtual int keyCode() const;
- virtual int charCode() const;
-
- virtual int layerX() const;
- virtual int layerY() const;
-
- virtual int pageX() const;
- virtual int pageY() const;
-
- virtual int which() const;
-
-private:
- RefPtr<AbstractView> m_view;
- int m_detail;
-};
-
-class UIEventWithKeyState : public UIEvent {
-public:
- UIEventWithKeyState() : m_ctrlKey(false), m_altKey(false), m_shiftKey(false), m_metaKey(false) { }
- UIEventWithKeyState(const AtomicString &type, bool canBubbleArg, bool cancelableArg, AbstractView *viewArg,
- int detailArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg)
- : UIEvent(type, canBubbleArg, cancelableArg, viewArg, detailArg)
- , m_ctrlKey(ctrlKeyArg), m_altKey(altKeyArg), m_shiftKey(shiftKeyArg), m_metaKey(metaKeyArg) { }
-
- bool ctrlKey() const { return m_ctrlKey; }
- bool shiftKey() const { return m_shiftKey; }
- bool altKey() const { return m_altKey; }
- bool metaKey() const { return m_metaKey; }
-
-protected: // expose these so init functions can set them
- bool m_ctrlKey : 1;
- bool m_altKey : 1;
- bool m_shiftKey : 1;
- bool m_metaKey : 1;
-};
-
-// Internal only: Helper class for what's common between mouse and wheel events.
-class MouseRelatedEvent : public UIEventWithKeyState {
-public:
- MouseRelatedEvent();
- MouseRelatedEvent(const AtomicString &type,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- bool isSimulated = false);
- int screenX() const { return m_screenX; }
- int screenY() const { return m_screenY; }
- int clientX() const { return m_clientX; }
- int clientY() const { return m_clientY; }
- int layerX() const { return m_layerX; }
- int layerY() const { return m_layerY; }
- int offsetX() const { return m_offsetX; }
- int offsetY() const { return m_offsetY; }
- bool isSimulated() const { return m_isSimulated; }
- virtual int pageX() const;
- virtual int pageY() const;
- int x() const;
- int y() const;
-protected: // expose these so MouseEvent::initMouseEvent can set them
- int m_screenX;
- int m_screenY;
- int m_clientX;
- int m_clientY;
- void initCoordinates();
- virtual void receivedTarget();
-private:
- int m_pageX;
- int m_pageY;
- int m_layerX;
- int m_layerY;
- int m_offsetX;
- int m_offsetY;
- bool m_isSimulated;
-};
-
-// Introduced in DOM Level 2
-class MouseEvent : public MouseRelatedEvent {
-public:
- MouseEvent();
- MouseEvent(const AtomicString& type,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView* viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- unsigned short buttonArg,
- EventTargetNode* relatedTargetArg,
- Clipboard* clipboardArg = 0,
- bool isSimulated = false);
- virtual ~MouseEvent();
- // WinIE uses 1,4,2 for left/middle/right but not for click (just for mousedown/up, maybe others), but we will match the standard DOM.
- unsigned short button() const { return m_button; }
- EventTargetNode* relatedTarget() const { return m_relatedTarget.get(); }
- Clipboard* clipboard() const { return m_clipboard.get(); }
- Node* toElement() const;
- Node* fromElement() const;
- void initMouseEvent(const AtomicString& typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView* viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- unsigned short buttonArg,
- EventTargetNode* relatedTargetArg);
- virtual bool isMouseEvent() const;
- virtual bool isDragEvent() const;
- virtual int which() const;
-private:
- unsigned short m_button;
- RefPtr<EventTargetNode> m_relatedTarget;
- RefPtr<Clipboard> m_clipboard;
-};
-
-
-// Introduced in DOM Level 3
-class KeyboardEvent : public UIEventWithKeyState {
-public:
- enum KeyLocationCode {
- DOM_KEY_LOCATION_STANDARD = 0x00,
- DOM_KEY_LOCATION_LEFT = 0x01,
- DOM_KEY_LOCATION_RIGHT = 0x02,
- DOM_KEY_LOCATION_NUMPAD = 0x03,
- };
- KeyboardEvent();
- KeyboardEvent(const PlatformKeyboardEvent&, AbstractView*);
- KeyboardEvent(const AtomicString &type,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- const String &keyIdentifierArg,
- unsigned keyLocationArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- bool altGraphKeyArg);
- virtual ~KeyboardEvent();
-
- void initKeyboardEvent(const AtomicString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- AbstractView *viewArg,
- const String &keyIdentifierArg,
- unsigned keyLocationArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- bool altGraphKeyArg);
-
- String keyIdentifier() const { return m_keyIdentifier.get(); }
- unsigned keyLocation() const { return m_keyLocation; }
-
- bool altGraphKey() const { return m_altGraphKey; }
-
- const PlatformKeyboardEvent* keyEvent() const { return m_keyEvent; }
-
- int keyCode() const; // key code for keydown and keyup, character for other events
- int charCode() const;
-
- virtual bool isKeyboardEvent() const;
- virtual int which() const;
-
-private:
- PlatformKeyboardEvent* m_keyEvent;
- RefPtr<StringImpl> m_keyIdentifier;
- unsigned m_keyLocation;
- bool m_altGraphKey : 1;
-};
-
-class MutationEvent : public Event {
-public:
- enum attrChangeType { MODIFICATION = 1, ADDITION = 2, REMOVAL = 3 };
- MutationEvent();
- MutationEvent(const AtomicString &type,
- bool canBubbleArg,
- bool cancelableArg,
- Node *relatedNodeArg,
- const String &prevValueArg,
- const String &newValueArg,
- const String &attrNameArg,
- unsigned short attrChangeArg);
- Node *relatedNode() const { return m_relatedNode.get(); }
- String prevValue() const { return m_prevValue.get(); }
- String newValue() const { return m_newValue.get(); }
- String attrName() const { return m_attrName.get(); }
- unsigned short attrChange() const { return m_attrChange; }
- void initMutationEvent(const AtomicString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- Node *relatedNodeArg,
- const String &prevValueArg,
- const String &newValueArg,
- const String &attrNameArg,
- unsigned short attrChangeArg);
- virtual bool isMutationEvent() const;
-private:
- RefPtr<Node> m_relatedNode;
- RefPtr<StringImpl> m_prevValue;
- RefPtr<StringImpl> m_newValue;
- RefPtr<StringImpl> m_attrName;
- unsigned short m_attrChange;
-};
-
-class ClipboardEvent : public Event {
-public:
- ClipboardEvent();
- ClipboardEvent(const AtomicString &type, bool canBubbleArg, bool cancelableArg, Clipboard *clipboardArg);
-
- Clipboard *clipboard() const { return m_clipboard.get(); }
- virtual bool isClipboardEvent() const;
-private:
- RefPtr<Clipboard> m_clipboard;
-};
-
-// extension: mouse wheel event
-class WheelEvent : public MouseRelatedEvent
-{
-public:
- WheelEvent();
- WheelEvent(bool horizontal, int wheelDelta, AbstractView *,
- int screenXArg, int screenYArg,
- int clientXArg, int clientYArg,
- bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg);
- bool isHorizontal() const { return m_horizontal; }
- int wheelDelta() const { return m_wheelDelta; }
-
-private:
- virtual bool isWheelEvent() const;
-
- bool m_horizontal;
- int m_wheelDelta;
-};
-
-class RegisteredEventListener : public Shared<RegisteredEventListener> {
-public:
- RegisteredEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
-
- const AtomicString &eventType() const { return m_eventType; }
- EventListener *listener() const { return m_listener.get(); }
- bool useCapture() const { return m_useCapture; }
- bool removed() const { return m_removed; }
- void setRemoved(bool removed) { m_removed = removed; }
-
-private:
- AtomicString m_eventType;
- RefPtr<EventListener> m_listener;
- bool m_useCapture;
- bool m_removed;
-};
-
-bool operator==(const RegisteredEventListener&, const RegisteredEventListener&);
-inline bool operator!=(const RegisteredEventListener& a, const RegisteredEventListener& b) { return !(a == b); }
-
-// State available during IE's events for drag and drop and copy/paste
-class Clipboard : public Shared<Clipboard> {
-public:
- virtual ~Clipboard();
-
- // Is this operation a drag-drop or a copy-paste?
- virtual bool isForDragging() const = 0;
-
- virtual String dropEffect() const = 0;
- virtual void setDropEffect(const String &s) = 0;
- virtual String effectAllowed() const = 0;
- virtual void setEffectAllowed(const String &s) = 0;
-
- virtual void clearData(const String &type) = 0;
- virtual void clearAllData() = 0;
- virtual String getData(const String &type, bool &success) const = 0;
- virtual bool setData(const String &type, const String &data) = 0;
-
- // extensions beyond IE's API
- virtual DeprecatedStringList types() const = 0;
-
- virtual WebCore::IntPoint dragLocation() const = 0;
- virtual CachedImage* dragImage() const = 0;
- virtual void setDragImage(CachedImage*, const WebCore::IntPoint &) = 0;
- virtual Node *dragImageElement() = 0;
- virtual void setDragImageElement(Node *, const WebCore::IntPoint &) = 0;
-};
-
-class BeforeUnloadEvent : public Event
-{
-public:
- BeforeUnloadEvent();
-
- virtual bool storesResultAsString() const;
- virtual void storeResult(const String&);
-
- String result() const { return m_result.get(); }
-
-private:
- RefPtr<StringImpl> m_result;
-};
-
-} // namespace
-
-#endif
#include "VisiblePosition.h"
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
-#include "dom2_eventsimpl.h"
#include "EventNames.h"
#include "htmlediting.h"
#include "GraphicsContext.h"
#include "RenderView.h"
#include "TextIterator.h"
-#include "dom2_eventsimpl.h"
#include "htmlediting.h"
#include "visible_units.h"
#include "config.h"
#include "HTMLAnchorElement.h"
-#include "csshelper.h"
#include "Document.h"
-#include "dom2_eventsimpl.h"
+#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
#include "HTMLImageElement.h"
#include "HTMLNames.h"
+#include "KeyboardEvent.h"
+#include "MouseEvent.h"
+#include "MutationEvent.h"
#include "RenderFlow.h"
#include "RenderImage.h"
+#include "UIEvent.h"
+#include "csshelper.h"
namespace WebCore {
#include "config.h"
#include "HTMLButtonElement.h"
-#include "HTMLFormElement.h"
-#include "dom2_eventsimpl.h"
-#include "FormDataList.h"
-
-#include "RenderButton.h"
+#include "Event.h"
#include "EventNames.h"
+#include "FormDataList.h"
+#include "HTMLFormElement.h"
#include "HTMLNames.h"
+#include "RenderButton.h"
namespace WebCore {
#include "config.h"
#include "HTMLDocument.h"
+#include "CSSPropertyNames.h"
#include "CookieJar.h"
#include "DocumentType.h"
#include "ExceptionCode.h"
#include "Frame.h"
-#include "cssstyleselector.h"
-#include "CSSPropertyNames.h"
-#include "HTMLTokenizer.h"
#include "HTMLElement.h"
#include "HTMLElementFactory.h"
#include "HTMLNames.h"
-#include "dom2_eventsimpl.h"
+#include "HTMLTokenizer.h"
+#include "cssstyleselector.h"
#include "DocTypeStrings.cpp"
#include "config.h"
#include "HTMLElement.h"
+#include "CSSPropertyNames.h"
+#include "CSSValueKeywords.h"
#include "DocumentFragment.h"
#include "EventListener.h"
#include "EventNames.h"
#include "ExceptionCode.h"
#include "Frame.h"
-#include "CSSPropertyNames.h"
-#include "CSSValueKeywords.h"
-#include "dom2_eventsimpl.h"
#include "HTMLDocument.h"
#include "HTMLElementFactory.h"
#include "HTMLNames.h"
#include "HTMLTokenizer.h"
-#include "markup.h"
#include "TextIterator.h"
+#include "markup.h"
namespace WebCore {
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+
#include "config.h"
#include "HTMLFrameSetElement.h"
#include "Document.h"
+#include "Event.h"
#include "EventNames.h"
#include "HTMLNames.h"
#include "Length.h"
-#include "dom2_eventsimpl.h"
+#include "MouseEvent.h"
#include "RenderFrameSet.h"
namespace WebCore {
#include "BeforeTextInsertedEvent.h"
#include "CSSPropertyNames.h"
+#include "DeprecatedSlider.h"
#include "Document.h"
+#include "Event.h"
#include "EventNames.h"
#include "FormDataList.h"
#include "Frame.h"
#include "HTMLFormElement.h"
#include "HTMLImageLoader.h"
#include "HTMLNames.h"
+#include "KeyboardEvent.h"
#include "LocalizedStrings.h"
+#include "MouseEvent.h"
+#include "RenderButton.h"
#include "RenderFileButton.h"
#include "RenderImageButton.h"
#include "RenderLineEdit.h"
#include "RenderText.h"
#include "RenderTextField.h"
#include "RenderTheme.h"
-#include "DeprecatedSlider.h"
#include "SelectionController.h"
-#include "RenderButton.h"
#include <unicode/ubrk.h>
using namespace std;
#include "config.h"
#include "HTMLSelectElement.h"
+#include "CSSPropertyNames.h"
#include "Document.h"
+#include "Event.h"
#include "EventNames.h"
#include "FormDataList.h"
#include "HTMLFormElement.h"
#include "HTMLNames.h"
#include "HTMLOptionElement.h"
#include "HTMLOptionsCollection.h"
+#include "KeyboardEvent.h"
#include "RenderSelect.h"
-#include "CSSPropertyNames.h"
#include "cssstyleselector.h"
-#include "dom2_eventsimpl.h"
#include <wtf/Vector.h>
namespace WebCore {
*/
#include "config.h"
-#include "dom2_eventsimpl.h"
#include "HTMLTextAreaElement.h"
+
#include "Document.h"
+#include "Event.h"
#include "EventNames.h"
#include "FormDataList.h"
#include "Frame.h"
#include "HTMLNames.h"
#include "RenderTextArea.h"
#include "RenderTextField.h"
-#include "render_style.h"
#include "Text.h"
+#include "render_style.h"
namespace WebCore {
#define SVGZoomEvent_H
#if SVG_SUPPORT
-#include "dom2_eventsimpl.h"
#include "FloatRect.h"
+#include "UIEvent.h"
namespace WebCore {
#include "Attr.h"
#include "Document.h"
+#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
+#include "MouseEvent.h"
+#include "MouseEvent.h"
#include "SVGAnimatedString.h"
#include "SVGHelper.h"
#include "SVGNames.h"
#include "csshelper.h"
-#include "dom2_eventsimpl.h"
#include <kcanvas/KCanvasContainer.h>
#include <kcanvas/KCanvasCreator.h>
#include <kcanvas/device/KRenderingDevice.h>
#include "DocLoader.h"
#include "DocumentType.h"
#include "EditingText.h"
+#include "Event.h"
#include "EventNames.h"
#include "FloatRect.h"
#include "Frame.h"
#include "HTMLFrameElement.h"
#include "HTMLGenericFormElement.h"
#include "HTMLNames.h"
-#include "MediaFeatureNames.h"
#include "HTMLObjectElement.h"
#include "ImageDocument.h"
+#include "MediaFeatureNames.h"
#include "MouseEventWithHitTestResults.h"
#include "NodeList.h"
#include "Page.h"
+#include "PlugInInfoStore.h"
#include "Plugin.h"
#include "PluginDocument.h"
-#include "PlugInInfoStore.h"
#include "RenderPart.h"
#include "RenderTheme.h"
#include "RenderView.h"
#include "TransferJob.h"
#include "TypingCommand.h"
#include "cssstyleselector.h"
-#include "dom2_eventsimpl.h"
#include "htmlediting.h"
#include "kjs_window.h"
#include "markup.h"
#include "config.h"
#include "FrameView.h"
+#include "AccessibilityObjectCache.h"
#include "CachedImage.h"
#include "Cursor.h"
#include "EventNames.h"
#include "Frame.h"
+#include "HTMLDocument.h"
#include "HTMLFrameSetElement.h"
#include "HTMLInputElement.h"
+#include "HTMLNames.h"
#include "Image.h"
-#include "AccessibilityObjectCache.h"
-#include "PlatformKeyboardEvent.h"
+#include "MouseEvent.h"
#include "MouseEventWithHitTestResults.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformWheelEvent.h"
+#include "RenderArena.h"
#include "RenderPart.h"
#include "RenderText.h"
+#include "RenderView.h"
#include "SelectionController.h"
-#include "PlatformWheelEvent.h"
#include "cssstyleselector.h"
-#include "dom2_eventsimpl.h"
-#include "HTMLDocument.h"
-#include "HTMLNames.h"
-#include "RenderArena.h"
-#include "RenderView.h"
namespace WebCore {
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef KeyEvent_H
-#define KeyEvent_H
+#ifndef PlatformKeyboardEvent_h
+#define PlatformKeyboardEvent_h
#include "PlatformString.h"
bool m_metaKey;
};
-}
+} // namespace WebCore
-#endif
+#endif // PlatformKeyboardEvent_h
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MouseEvent_h
-#define MouseEvent_h
+#ifndef PlatformMouseEvent_h
+#define PlatformMouseEvent_h
#include "IntPoint.h"
public:
PlatformMouseEvent(); // "current event"
PlatformMouseEvent(const IntPoint& pos, const IntPoint& globalPos, MouseButton button,
- int clickCount, bool shift, bool ctrl, bool alt, bool meta)
+ int clickCount, bool shift, bool ctrl, bool alt, bool meta)
: m_position(pos), m_globalPosition(globalPos), m_button(button)
, m_clickCount(clickCount)
- , m_shiftKey(shift), m_ctrlKey(ctrl), m_altKey(alt), m_metaKey(meta)
- { }
+ , m_shiftKey(shift)
+ , m_ctrlKey(ctrl)
+ , m_altKey(alt)
+ , m_metaKey(meta)
+ {
+ }
const IntPoint& pos() const { return m_position; }
int x() const { return m_position.x(); }
bool m_metaKey;
};
-}
+} // namespace WebCore
-#endif
+#endif // PlatformMouseEvent_h
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WheelEvent_h
-#define WheelEvent_h
+#ifndef PlatformWheelEvent_h
+#define PlatformWheelEvent_h
#include "IntPoint.h"
bool m_metaKey;
};
-}
+} // namespace WebCore
-#endif
+#endif // PlatformWheelEvent_h
#include "Image.h"
#include "IntPoint.h"
-#include "dom2_eventsimpl.h"
+#include "Clipboard.h"
#include "CachedObjectClient.h"
#ifdef __OBJC__
#include "EventNames.h"
#include "FrameView.h"
#include "GraphicsContext.h"
-#include "HTMLNames.h"
#include "HTMLFrameSetElement.h"
-#include "dom2_eventsimpl.h"
-#include "RenderView.h"
-#include "RenderFrame.h"
+#include "HTMLNames.h"
#include "KWQTextStream.h"
+#include "MouseEvent.h"
+#include "RenderFrame.h"
+#include "RenderView.h"
namespace WebCore {
#include "config.h"
#include "RenderLayer.h"
-#include "Document.h"
#include "CSSPropertyNames.h"
+#include "Document.h"
#include "EventNames.h"
#include "FloatRect.h"
#include "Frame.h"
#include "FrameTree.h"
#include "GraphicsContext.h"
-#include "dom2_eventsimpl.h"
#include "HTMLMarqueeElement.h"
#include "HTMLNames.h"
#include "PlatformMouseEvent.h"
#include "RenderArena.h"
-#include "RenderView.h"
#include "RenderInline.h"
#include "RenderTheme.h"
+#include "RenderView.h"
#include "SelectionController.h"
#if SVG_SUPPORT
#include "KWQWMatrix.h"
#include "Position.h"
#include "RenderArena.h"
-#include "RenderView.h"
#include "RenderFlexibleBox.h"
#include "RenderInline.h"
#include "RenderListItem.h"
#include "RenderTableRow.h"
#include "RenderText.h"
#include "RenderTheme.h"
+#include "RenderView.h"
#include "cssstyleselector.h"
-#include "dom2_eventsimpl.h"
#include <algorithm>
-
using namespace std;
namespace WebCore {
#include "RenderTextField.h"
#include "Document.h"
+#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
-#include "htmlediting.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "HTMLTextAreaElement.h"
#include "HTMLTextFieldInnerElement.h"
+#include "RenderTheme.h"
#include "SelectionController.h"
#include "TextIterator.h"
-#include "dom2_eventsimpl.h"
-#include <math.h>
-#include "RenderTheme.h"
+#include "htmlediting.h"
#include "visible_units.h"
+#include <math.h>
namespace WebCore {
#include "Cache.h"
#include "DOMImplementation.h"
#include "Decoder.h"
+#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
#include "FormData.h"
#include "RegularExpression.h"
#include "TextEncoding.h"
#include "TransferJob.h"
-#include "dom2_eventsimpl.h"
#include "kjs_binding.h"
#include <kjs/protect.h>
#include <wtf/Vector.h>