Reviewed by John Sullivan.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2006 03:08:41 +0000 (03:08 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2006 03:08:41 +0000 (03:08 +0000)
        - moved QMouseEvent, QKeyEvent, QWheelEvent, and "Foundation extras"
          from kwq to platform directory
        - moved history function from kwq to bridge directory
        - eliminated QEvent, MousePressEvent, MouseDoubleClickEvent, MouseMoveEvent,
          MoveReleaseEvent, and DrawContents classes
        - merged NodeImpl::MouseEvent and the MouseEvent from khtml_events.h into
          a single class in the page directory
        - broke khtmllayout.h out into a file for the Length structure in the css
          directory and a file for the GapRects structure in the rendering directory
        - redid the Length structure to work more portably by not relying on bitfield
          layout and improve the names to no longer explicitly mention "width"
        - reduced use of QGuardedPtr and other uses of the QObject "destroyed" signal

        * ForwardingHeaders/kparts: Removed.
        * ForwardingHeaders/qevent.h: Removed.
        * khtml/khtml_events.cpp: Removed.
        * khtml/khtml_events.h: Removed.
        * khtml/misc/khtmllayout.h: Removed.
        * kwq/KWQEvent.h: Removed.
        * kwq/KWQEvent.mm: Removed.
        * kwq/KWQFoundationExtras.h: Removed.
        * kwq/KWQKHistoryProvider.mm: Removed.
        * kwq/KWQKPartsHistoryProvider.h: Removed.

        * bridge/History.h: Added.
        * bridge/mac/HistoryMac.mm: Added.
        * css/Length.h: Added.
        * page/MouseEventWithHitTestResults.h: Added.
        * platform/KeyEvent.h: Added.
        * platform/MouseEvent.h: Added.
        * platform/WheelEvent.h: Added.
        * platform/mac/FoundationExtras.h: Added.
        * platform/mac/KeyEventMac.mm: Added.
        * platform/mac/MouseEventMac.mm: Added.
        * platform/mac/WheelEventMac.mm: Added.
        * rendering/GapRects.h: Added.

        * WebCore.xcodeproj/project.pbxproj: Updated for above changes.
        * WebCore.vcproj/WebCore/WebCore.vcproj: Updated for above changes.

        * bridge/mac/MacFrame.h: Removed unused parameters from urlSelected functions.
        Replaced MouseEvent, MousePressEvent, MouseMoveEvent, and MouseReleaseEvent
        with MouseEventWithHitTestResults.
        * bridge/mac/MacFrame.mm:
        (WebCore::MacFrame::urlSelected): Removed unused parameters.
        (WebCore::MacFrame::wheelEvent): Changed to use WheelEvent.
        (WebCore::MacFrame::keyEvent): Changed to use KeyEvent.
        (WebCore::MacFrame::khtmlMousePressEvent): Changed parameter type.
        (WebCore::MacFrame::khtmlMouseMoveEvent): Ditto.
        (WebCore::MacFrame::khtmlMouseReleaseEvent): Ditto.
        (WebCore::MacFrame::passSubframeEventToSubframe): Ditto.
        (WebCore::MacFrame::mouseDown): Changed to use MouseEvent.
        (WebCore::MacFrame::mouseDragged): Ditto.
        (WebCore::MacFrame::mouseUp): Ditto.
        (WebCore::MacFrame::mouseMoved): Ditto.
        (WebCore::MacFrame::sendContextMenuEvent): Ditto.

        * css/csshelper.h: Removed a bunch of unused declarations.

        * dom/DocumentImpl.h:
        * dom/DocumentImpl.cpp:
        (WebCore::DocumentImpl::prepareMouseEvent): Changed to take a MouseEvent
        and return a MouseEventWithHitTestResults.
        (WebCore::DocumentImpl::defaultEventHandler): Changed to use KeyEvent.

        * dom/NodeImpl.h: Removed NodeImpl::MouseEvent and NodeImpl::MouseEventType.
        * dom/NodeImpl.cpp:
        (WebCore::NodeImpl::dispatchMouseEvent): Changed to always get the type and
        detail values from the caller, never from the event. Changed to use MouseEvent.
        (WebCore::NodeImpl::dispatchKeyEvent): Changed to use KeyEvent.
        (WebCore::NodeImpl::dispatchWheelEvent): Changed to use WheelEvent.

        * dom/dom2_eventsimpl.h:
        * dom/dom2_eventsimpl.cpp:
        (WebCore::KeyboardEventImpl::KeyboardEventImpl): Changed to use KeyEvent.
        (WebCore::KeyboardEventImpl::charCode): Ditto.

        * dom/dom_elementimpl.h: Removed unused mouseEventHandler function.

        * khtml/ecma/domparser.h: Use RefPtr instead of QGuardedPtr to hold the reference
        to the document.

        * khtml/ecma/kjs_proxy.h: (WebCore::KJSProxyImpl::haveInterpreter): Added. For
        use in the Frame destructor so we can get an existing KJS::Window object without
        creating a new interpreter and window object.

        * khtml/ecma/kjs_window.h: Merged WindowQObject into Window. Changed all the
        guarded pointers to Frame to use plain old pointers that are cleared by the
        Frame explicitly (by the function disconnectFrame). Made the pointers to all
        the sub-objects of KJS::Window be mutable so we don't have to const_cast in
        the functions to get (and lazily create) them.
        * khtml/ecma/kjs_window.cpp:
        (KJS::DOMWindowTimer::DOMWindowTimer): Use Window* instead of WindowQObject*.
        (KJS::History::disconnectFrame): Added. Clears m_frame.
        (KJS::FrameArray::disconnectFrame): Added. Clears m_frame.
        (KJS::Window::Window): Removed code to create a WindowQObject.
        (KJS::Window::~Window): Removed code to delete a WindowQObject.
        (KJS::Window::location): Remove now-unneeded const_cast.
        (KJS::Window::selection): Ditto.
        (KJS::Window::locationbar): Ditto.
        (KJS::Window::menubar): Ditto.
        (KJS::Window::personalbar): Ditto.
        (KJS::Window::statusbar): Ditto.
        (KJS::Window::toolbar): Ditto.
        (KJS::Window::scrollbars): Ditto.
        (KJS::Window::getValueProperty): Update since m_frame is now a raw pointer.
        (KJS::Window::getOwnPropertySlot): Ditto.
        (KJS::Window::toBoolean): Ditto.
        (KJS::Window::scheduleClose): Remove assert that WindowQObject* is not null.
        (KJS::Window::isSafeScript): Update since m_frame is now a raw pointer.
        (KJS::Window::clear): Remove code to delete a WindowQObject. Added a call
        to clearAllTimeouts instead.
        (KJS::Window::clearAllTimeouts): Added. Does equivalent of the WindowQObject
        destructor.
        (KJS::Window::installTimeout): Moved to Window from WindowQObject.
        (KJS::Window::pauseTimeouts): Ditto.
        (KJS::Window::resumeTimeouts): Ditto.
        (KJS::Window::clearTimeout): Ditto.
        (KJS::Window::timerFired): Ditto.
        (KJS::Window::disconnectFrame): Added. Sets all the frame pointers to 0.
        (KJS::FrameArray::getOwnPropertySlot): Update since m_frame is now a raw pointer.
        (KJS::Location::getOwnPropertySlot): Ditto.
        (KJS::Location::put): Ditto.
        (KJS::Selection::getOwnPropertySlot): Ditto.
        (KJS::BarInfo::getOwnPropertySlot): Ditto.

        * khtml/html/html_baseimpl.h: Forward-declare Length instead of including khtmllayout.h.
        * khtml/html/html_imageimpl.h: Ditto.

        * khtml/html/html_inlineimpl.cpp: (WebCore::HTMLAnchorElementImpl::defaultEventHandler):
        Changed to use KeyEvent and removed the code to extract the button and state from the
        DOM even to pass to urlSelected.
        * ksvg2/svg/SVGAElementImpl.cpp: (SVGAElementImpl::defaultEventHandler): Ditto.

        * khtml/html/htmltokenizer.cpp: (WebCore::HTMLTokenizer::timerFired): Change to use
        a RefPtr instead of a QGuardedPtr.

        * khtml/misc/helper.h:
        * khtml/misc/helper.cpp: Removed printpainter and setPrintPainter.

        * ksvg2/svg/SVGDocumentImpl.h:
        * ksvg2/svg/SVGDocumentImpl.cpp: (WebCore::SVGDocumentImpl::dispatchKeyEvent):
        Change to use KeyEvent.

        * kwq/KWQComboBox.mm:
        (-[KWQPopUpButton becomeFirstResponder]):
        (-[KWQPopUpButton resignFirstResponder]):
        * kwq/KWQFileButton.mm:
        (KWQFileButton::focusChanged):
        * kwq/KWQListBox.mm:
        (-[KWQTableView becomeFirstResponder]):
        (-[KWQTableView resignFirstResponder]):
        * kwq/KWQSlider.mm:
        (-[KWQSlider becomeFirstResponder]):
        (-[KWQSlider resignFirstResponder]):
        * kwq/KWQTextArea.mm:
        (-[KWQTextAreaTextView becomeFirstResponder]):
        (-[KWQTextAreaTextView resignFirstResponder]):
        * kwq/KWQTextField.mm:
        (-[KWQTextFieldController setHasFocus:]):
        Updated to use new eventFilterFocusIn/Out instead of the general purpose
        eventFilter function. This allows us to remove QEvent and the focus events.

        * kwq/KWQNamespace.h: Removed ButtonState.

        * kwq/KWQObject.h:
        * kwq/KWQObject.cpp: Replaced eventFilter function with eventFilterFocusIn and
        eventFilterFocusOut, allowing us to remove QEvent. Removed event function.

        * kwq/KWQSlot.cpp:
        (KWQSlot::KWQSlot): Removed the parentDestroyed slot.
        (KWQSlot::call): Ditto.

        * page/Frame.h:
        * page/Frame.cpp:
        (WebCore::UserStyleSheetLoader::UserStyleSheetLoader): Renamed from
        PartStyleSheetLoader. Removed a lot of unneeded null checks. Use a
        raw Frame pointer instead of a QGuardedPtr, and count on the Frame
        to delete us when it's being deleted.
        (WebCore::UserStyleSheetLoader::~UserStyleSheetLoader): No longer
        a virtual function. This is not a polymorphic class.
        (WebCore::UserStyleSheetLoader::setStyleSheet): Remove code to delete
        ourselves -- that's now the frame's responsibility.
        (WebCore::Frame::~Frame): Call disconnectFrame on the KJS::Window and
        delete m_userStyleSheetLoader.
        (WebCore::Frame::changeLocation): Update since urlSelected no longer takes
        button and state parameters.
        (WebCore::Frame::setUserStyleSheet): Delete existing loader to stop a load
        in progress before starting a new load. Store reference to loader.
        (WebCore::Frame::urlSelected): Remove button and state parameters and unused
        local variable hasTarget.
        (WebCore::Frame::selectClosestWordFromMouseEvent): Change from QMouseEvent
        to MouseEvent.
        (WebCore::Frame::handleMousePressEventDoubleClick): Change from MousePressEvent
        to MouseEventWithHitTestResults.
        (WebCore::Frame::handleMousePressEventTripleClick): Ditto.
        (WebCore::Frame::handleMousePressEventSingleClick): Ditto.
        (WebCore::Frame::khtmlMousePressEvent): Ditto.
        (WebCore::Frame::handleMouseMoveEventSelection): Change from MouseMoveEvent
        to MouseEventWithHitTestResults.
        (WebCore::Frame::khtmlMouseMoveEvent): Ditto.
        (WebCore::Frame::khtmlMouseReleaseEvent): Change from MouseReleaseEvent
        to MouseEventWithHitTestResults.
        (WebCore::Frame::khtmlMouseDoubleClickEvent): Change from
        MouseReleaseDoubleClickEvent to MouseEventWithHitTestResults.
        (WebCore::Frame::passWidgetMouseDownEventToWidget): Change from
        NodeImpl::MouseEvent to MouseEventWithHitTestResults.

        * page/FramePrivate.h: Added m_userStyleSheetLoader.

        * page/FrameView.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::viewportMousePressEvent): Change from QMouseEvent to
        MouseEvent and from NodeImpl::MouseEvent to MouseEventWithHitTestResults.
        (WebCore::FrameView::viewportMouseDoubleClickEvent): Ditto.
        (WebCore::selectCursor): Ditto.
        (WebCore::FrameView::viewportMouseMoveEvent): Ditto.
        (WebCore::FrameView::viewportMouseReleaseEvent): Ditto.
        (WebCore::FrameView::keyPressEvent): Change from QKeyEvent to KeyEvent.
        (WebCore::FrameView::dispatchMouseEvent): Change from QMouseEvent to
        MouseEvent and from NodeImpl::MouseEvent to MouseEventWithHitTestResults.
        (WebCore::FrameView::viewportWheelEvent): Change from QWheelEvent to
        WheelEvent.
        (WebCore::FrameView::hoverTimerFired): Update for change to prepareMouseEvent
        parameters.

        * platform/Widget.h:
        * platform/Widget.cpp: Removed event function.

        * rendering/render_form.h: Removed LineEditWidget, ComboBoxWidget, TextAreaWidget.
        * rendering/render_form.cpp:
        (WebCore::RenderFormElement::slotClicked): Changed from QMouseEvent to MouseEvent.
        (WebCore::RenderFormElement::addIntrinsicMarginsIfAllowed): Updated for changes
        to the Length class.
        (WebCore::RenderSelect::setWidgetWritingDirection): Updated for removal of
        ComboBoxWidget.
        (WebCore::RenderSelect::slotSelected): Ditto.
        (WebCore::RenderSelect::createComboBox): Ditto.

        * rendering/render_replaced.h:
        * rendering/render_replaced.cpp:
        (WebCore::RenderWidget::destroy): Updated since removeEventFilter no longer takes
        a parameter.
        (WebCore::RenderWidget::setQWidget): Ditto.
        (WebCore::RenderWidget::eventFilterFocusIn): Added. Replaces eventFilter.
        (WebCore::RenderWidget::eventFilterFocusOut): Ditto.

        * css/css_computedstyle.cpp:
        (WebCore::valueForLength):
        (WebCore::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
        * css/cssstyleselector.cpp:
        (WebCore::checkPseudoState):
        (WebCore::CSSStyleSelector::applyProperty):
        (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
        * khtml/html/html_imageimpl.cpp:
        (WebCore::HTMLAreaElementImpl::getRegion):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::MarginInfo::MarginInfo):
        (WebCore::RenderBlock::isSelfCollapsingBlock):
        (WebCore::RenderBlock::layoutBlock):
        (WebCore::RenderBlock::determineHorizontalPosition):
        (WebCore::RenderBlock::leftRelOffset):
        (WebCore::RenderBlock::rightRelOffset):
        (WebCore::RenderBlock::calcMinMaxWidth):
        (WebCore::getBPMWidth):
        (WebCore::RenderBlock::calcInlineMinMaxWidth):
        (WebCore::RenderBlock::calcBlockMinMaxWidth):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::calcWidth):
        (WebCore::RenderTable::layout):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::calcMinMaxWidth):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addChild):
        (WebCore::RenderTableSection::addCell):
        (WebCore::RenderTableSection::calcRowHeight):
        (WebCore::RenderTableSection::layoutRows):
        * rendering/RenderText.h:
        (khtml::RenderText::marginLeft):
        (khtml::RenderText::marginRight):
        * rendering/bidi.cpp:
        (khtml::getBPMWidth):
        * rendering/render_applet.cpp:
        (WebCore::RenderApplet::createWidgetIfNecessary):
        * rendering/render_box.cpp:
        (WebCore::RenderBox::paintBackgroundExtended):
        (WebCore::RenderBox::getClipRect):
        (WebCore::RenderBox::relativePositionOffset):
        (WebCore::RenderBox::calcWidth):
        (WebCore::RenderBox::calcWidthUsing):
        (WebCore::RenderBox::sizesToIntrinsicWidth):
        (WebCore::RenderBox::calcHorizontalMargins):
        (WebCore::RenderBox::calcHeight):
        (WebCore::RenderBox::calcHeightUsing):
        (WebCore::RenderBox::calcPercentageHeight):
        (WebCore::RenderBox::calcReplacedWidth):
        (WebCore::RenderBox::calcReplacedWidthUsing):
        (WebCore::RenderBox::calcReplacedHeight):
        (WebCore::RenderBox::calcReplacedHeightUsing):
        (WebCore::RenderBox::availableHeightUsing):
        (WebCore::RenderBox::calcVerticalMargins):
        (WebCore::RenderBox::calcAbsoluteHorizontal):
        (WebCore::RenderBox::calcAbsoluteHorizontalValues):
        (WebCore::RenderBox::calcAbsoluteVertical):
        (WebCore::RenderBox::calcAbsoluteVerticalValues):
        * rendering/render_br.cpp:
        (WebCore::RenderBR::lineHeight):
        * rendering/render_flexbox.cpp:
        (khtml::RenderFlexibleBox::calcHorizontalMinMaxWidth):
        (khtml::RenderFlexibleBox::calcVerticalMinMaxWidth):
        (khtml::RenderFlexibleBox::calcMinMaxWidth):
        (khtml::RenderFlexibleBox::allowedChildFlex):
        * rendering/render_flow.cpp:
        (WebCore::RenderFlow::lineHeight):
        * rendering/render_frames.cpp:
        (WebCore::RenderFrameSet::layout):
        * rendering/render_image.cpp:
        (WebCore::RenderImage::isWidthSpecified):
        (WebCore::RenderImage::isHeightSpecified):
        * rendering/render_layer.cpp:
        (WebCore::Marquee::direction):
        (WebCore::Marquee::start):
        (WebCore::Marquee::updateMarqueeStyle):
        (WebCore::Marquee::timerFired):
        * rendering/render_line.cpp:
        (WebCore::InlineFlowBox::marginLeft):
        (WebCore::InlineFlowBox::marginRight):
        * rendering/render_object.cpp:
        (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
        (WebCore::RenderObject::paintBorderImage):
        (WebCore::RenderObject::paddingTop):
        (WebCore::RenderObject::paddingBottom):
        (WebCore::RenderObject::paddingLeft):
        (WebCore::RenderObject::paddingRight):
        (WebCore::RenderObject::getVerticalPosition):
        (WebCore::RenderObject::lineHeight):
        (WebCore::RenderObject::addDashboardRegions):
        * rendering/render_style.h:
        * rendering/render_theme_mac.mm:
        (WebCore::RenderThemeMac::addIntrinsicMargins):
        * rendering/table_layout.cpp:
        (WebCore::FixedTableLayout::calcWidthArray):
        (WebCore::FixedTableLayout::calcMinMaxWidth):
        (WebCore::FixedTableLayout::layout):
        (WebCore::AutoTableLayout::recalcColumn):
        (WebCore::AutoTableLayout::fullRecalc):
        (WebCore::AutoTableLayout::calcMinMaxWidth):
        (WebCore::AutoTableLayout::calcEffectiveWidth):
        (WebCore::AutoTableLayout::layout):
        (WebCore::AutoTableLayout::calcPercentages):
        Updated for changes to the Length class.
        Also removed a check of the printpainter global, never used in WebCore.

        * bindings/objc/DOM.mm:
        * bindings/objc/DOMCSS.mm:
        * bindings/objc/DOMHTML.mm:
        * bridge/mac/WebCoreFrameBridge.mm:
        * css/csshelper.cpp:
        * editing/SelectionController.cpp:
        * khtml/ecma/kjs_html.h:
        * kwq/KWQAccObject.mm:
        * kwq/KWQAccObjectCache.mm:
        * kwq/KWQClipboard.mm:
        * kwq/KWQFont.mm:
        * kwq/KWQFontMetrics.mm:
        * kwq/KWQKJobClasses.mm:
        * kwq/KWQKURL.mm:
        * kwq/KWQLoader.mm:
        * kwq/KWQPageState.mm:
        * kwq/KWQPainter.mm:
        * kwq/WebCoreSettings.mm:
        * platform/StringImpl.cpp:
        * platform/mac/CursorMac.mm:
        * platform/mac/WidgetMac.mm:
        * rendering/RenderBlock.h:
        * rendering/render_canvas.cpp:
        * rendering/render_line.h:
        * rendering/render_style.cpp:
        * rendering/table_layout.h:
        Updated includes.

        * bindings/js/JSDOMCore.cpp: Touched, because I got strange failures if this
        didn't rebuild.
        * bindings/js/JSDOMEvents.cpp: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12953 268f45cc-cd09-0410-ab3c-d52691b4dbfc

114 files changed:
WebCore/ChangeLog
WebCore/ForwardingHeaders/qevent.h [deleted file]
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSDOMCore.cpp
WebCore/bindings/js/JSDOMEvents.cpp
WebCore/bindings/objc/DOM.mm
WebCore/bindings/objc/DOMCSS.mm
WebCore/bindings/objc/DOMHTML.mm
WebCore/bridge/History.h [moved from WebCore/kwq/KWQKPartsHistoryProvider.h with 81% similarity]
WebCore/bridge/mac/HistoryMac.mm [moved from WebCore/kwq/KWQKHistoryProvider.mm with 74% similarity]
WebCore/bridge/mac/MacFrame.h
WebCore/bridge/mac/MacFrame.mm
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/css/Length.h [new file with mode: 0644]
WebCore/css/css_computedstyle.cpp
WebCore/css/csshelper.cpp
WebCore/css/csshelper.h
WebCore/css/cssstyleselector.cpp
WebCore/dom/DocumentImpl.cpp
WebCore/dom/DocumentImpl.h
WebCore/dom/NodeImpl.cpp
WebCore/dom/NodeImpl.h
WebCore/dom/dom2_eventsimpl.cpp
WebCore/dom/dom2_eventsimpl.h
WebCore/dom/dom_elementimpl.h
WebCore/editing/SelectionController.cpp
WebCore/khtml/ecma/domparser.h
WebCore/khtml/ecma/kjs_html.h
WebCore/khtml/ecma/kjs_proxy.h
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/ecma/kjs_window.h
WebCore/khtml/html/html_baseimpl.h
WebCore/khtml/html/html_imageimpl.cpp
WebCore/khtml/html/html_imageimpl.h
WebCore/khtml/html/html_inlineimpl.cpp
WebCore/khtml/html/htmltokenizer.cpp
WebCore/khtml/khtml_events.cpp [deleted file]
WebCore/khtml/khtml_events.h [deleted file]
WebCore/khtml/misc/helper.cpp
WebCore/khtml/misc/helper.h
WebCore/khtml/misc/khtmllayout.h [deleted file]
WebCore/ksvg2/svg/SVGAElementImpl.cpp
WebCore/ksvg2/svg/SVGDocumentImpl.cpp
WebCore/ksvg2/svg/SVGDocumentImpl.h
WebCore/kwq/KWQAccObject.mm
WebCore/kwq/KWQAccObjectCache.mm
WebCore/kwq/KWQClipboard.mm
WebCore/kwq/KWQComboBox.mm
WebCore/kwq/KWQEvent.h [deleted file]
WebCore/kwq/KWQFileButton.mm
WebCore/kwq/KWQFont.mm
WebCore/kwq/KWQFontMetrics.mm
WebCore/kwq/KWQKJobClasses.mm
WebCore/kwq/KWQKURL.mm
WebCore/kwq/KWQListBox.mm
WebCore/kwq/KWQLoader.mm
WebCore/kwq/KWQNamespace.h
WebCore/kwq/KWQObject.cpp
WebCore/kwq/KWQObject.h
WebCore/kwq/KWQPageState.mm
WebCore/kwq/KWQPainter.mm
WebCore/kwq/KWQSlider.mm
WebCore/kwq/KWQSlot.cpp
WebCore/kwq/KWQTextArea.mm
WebCore/kwq/KWQTextField.mm
WebCore/kwq/WebCoreSettings.mm
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FramePrivate.h
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebCore/page/MouseEventWithHitTestResults.h [new file with mode: 0644]
WebCore/platform/KeyEvent.h [new file with mode: 0644]
WebCore/platform/MouseEvent.h [new file with mode: 0644]
WebCore/platform/StringImpl.cpp
WebCore/platform/WheelEvent.h [new file with mode: 0644]
WebCore/platform/Widget.cpp
WebCore/platform/Widget.h
WebCore/platform/mac/CursorMac.mm
WebCore/platform/mac/FoundationExtras.h [moved from WebCore/kwq/KWQFoundationExtras.h with 100% similarity]
WebCore/platform/mac/KeyEventMac.mm [moved from WebCore/kwq/KWQEvent.mm with 77% similarity]
WebCore/platform/mac/MouseEventMac.mm [new file with mode: 0644]
WebCore/platform/mac/WheelEventMac.mm [new file with mode: 0644]
WebCore/platform/mac/WidgetMac.mm
WebCore/rendering/GapRects.h [new file with mode: 0644]
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderBlock.h
WebCore/rendering/RenderTable.cpp
WebCore/rendering/RenderTableCell.cpp
WebCore/rendering/RenderTableSection.cpp
WebCore/rendering/RenderText.h
WebCore/rendering/bidi.cpp
WebCore/rendering/render_applet.cpp
WebCore/rendering/render_box.cpp
WebCore/rendering/render_br.cpp
WebCore/rendering/render_canvas.cpp
WebCore/rendering/render_flexbox.cpp
WebCore/rendering/render_flow.cpp
WebCore/rendering/render_form.cpp
WebCore/rendering/render_form.h
WebCore/rendering/render_frames.cpp
WebCore/rendering/render_image.cpp
WebCore/rendering/render_layer.cpp
WebCore/rendering/render_line.cpp
WebCore/rendering/render_line.h
WebCore/rendering/render_object.cpp
WebCore/rendering/render_replaced.cpp
WebCore/rendering/render_replaced.h
WebCore/rendering/render_style.cpp
WebCore/rendering/render_style.h
WebCore/rendering/render_theme_mac.mm
WebCore/rendering/table_layout.cpp
WebCore/rendering/table_layout.h

index 2bc6317..6a01beb 100644 (file)
@@ -1,3 +1,392 @@
+2006-02-23  Darin Adler  <darin@apple.com>
+
+        Reviewed by John Sullivan.
+
+        - moved QMouseEvent, QKeyEvent, QWheelEvent, and "Foundation extras"
+          from kwq to platform directory
+        - moved history function from kwq to bridge directory
+        - eliminated QEvent, MousePressEvent, MouseDoubleClickEvent, MouseMoveEvent,
+          MoveReleaseEvent, and DrawContents classes
+        - merged NodeImpl::MouseEvent and the MouseEvent from khtml_events.h into
+          a single class in the page directory
+        - broke khtmllayout.h out into a file for the Length structure in the css
+          directory and a file for the GapRects structure in the rendering directory
+        - redid the Length structure to work more portably by not relying on bitfield
+          layout and improve the names to no longer explicitly mention "width"
+        - reduced use of QGuardedPtr and other uses of the QObject "destroyed" signal
+
+        * ForwardingHeaders/kparts: Removed.
+        * ForwardingHeaders/qevent.h: Removed.
+        * khtml/khtml_events.cpp: Removed.
+        * khtml/khtml_events.h: Removed.
+        * khtml/misc/khtmllayout.h: Removed.
+        * kwq/KWQEvent.h: Removed.
+        * kwq/KWQEvent.mm: Removed.
+        * kwq/KWQFoundationExtras.h: Removed.
+        * kwq/KWQKHistoryProvider.mm: Removed.
+        * kwq/KWQKPartsHistoryProvider.h: Removed.
+
+        * bridge/History.h: Added.
+        * bridge/mac/HistoryMac.mm: Added.
+        * css/Length.h: Added.
+        * page/MouseEventWithHitTestResults.h: Added.
+        * platform/KeyEvent.h: Added.
+        * platform/MouseEvent.h: Added.
+        * platform/WheelEvent.h: Added.
+        * platform/mac/FoundationExtras.h: Added.
+        * platform/mac/KeyEventMac.mm: Added.
+        * platform/mac/MouseEventMac.mm: Added.
+        * platform/mac/WheelEventMac.mm: Added.
+        * rendering/GapRects.h: Added.
+
+        * WebCore.xcodeproj/project.pbxproj: Updated for above changes.
+        * WebCore.vcproj/WebCore/WebCore.vcproj: Updated for above changes.
+
+        * bridge/mac/MacFrame.h: Removed unused parameters from urlSelected functions.
+        Replaced MouseEvent, MousePressEvent, MouseMoveEvent, and MouseReleaseEvent
+        with MouseEventWithHitTestResults.
+        * bridge/mac/MacFrame.mm:
+        (WebCore::MacFrame::urlSelected): Removed unused parameters.
+        (WebCore::MacFrame::wheelEvent): Changed to use WheelEvent.
+        (WebCore::MacFrame::keyEvent): Changed to use KeyEvent.
+        (WebCore::MacFrame::khtmlMousePressEvent): Changed parameter type.
+        (WebCore::MacFrame::khtmlMouseMoveEvent): Ditto.
+        (WebCore::MacFrame::khtmlMouseReleaseEvent): Ditto.
+        (WebCore::MacFrame::passSubframeEventToSubframe): Ditto.
+        (WebCore::MacFrame::mouseDown): Changed to use MouseEvent.
+        (WebCore::MacFrame::mouseDragged): Ditto.
+        (WebCore::MacFrame::mouseUp): Ditto.
+        (WebCore::MacFrame::mouseMoved): Ditto.
+        (WebCore::MacFrame::sendContextMenuEvent): Ditto.
+
+        * css/csshelper.h: Removed a bunch of unused declarations.
+
+        * dom/DocumentImpl.h:
+        * dom/DocumentImpl.cpp:
+        (WebCore::DocumentImpl::prepareMouseEvent): Changed to take a MouseEvent
+        and return a MouseEventWithHitTestResults.
+        (WebCore::DocumentImpl::defaultEventHandler): Changed to use KeyEvent.
+
+        * dom/NodeImpl.h: Removed NodeImpl::MouseEvent and NodeImpl::MouseEventType.
+        * dom/NodeImpl.cpp:
+        (WebCore::NodeImpl::dispatchMouseEvent): Changed to always get the type and
+        detail values from the caller, never from the event. Changed to use MouseEvent.
+        (WebCore::NodeImpl::dispatchKeyEvent): Changed to use KeyEvent.
+        (WebCore::NodeImpl::dispatchWheelEvent): Changed to use WheelEvent.
+
+        * dom/dom2_eventsimpl.h:
+        * dom/dom2_eventsimpl.cpp:
+        (WebCore::KeyboardEventImpl::KeyboardEventImpl): Changed to use KeyEvent.
+        (WebCore::KeyboardEventImpl::charCode): Ditto.
+
+        * dom/dom_elementimpl.h: Removed unused mouseEventHandler function.
+
+        * khtml/ecma/domparser.h: Use RefPtr instead of QGuardedPtr to hold the reference
+        to the document.
+
+        * khtml/ecma/kjs_proxy.h: (WebCore::KJSProxyImpl::haveInterpreter): Added. For
+        use in the Frame destructor so we can get an existing KJS::Window object without
+        creating a new interpreter and window object.
+
+        * khtml/ecma/kjs_window.h: Merged WindowQObject into Window. Changed all the
+        guarded pointers to Frame to use plain old pointers that are cleared by the
+        Frame explicitly (by the function disconnectFrame). Made the pointers to all
+        the sub-objects of KJS::Window be mutable so we don't have to const_cast in
+        the functions to get (and lazily create) them.
+        * khtml/ecma/kjs_window.cpp:
+        (KJS::DOMWindowTimer::DOMWindowTimer): Use Window* instead of WindowQObject*.
+        (KJS::History::disconnectFrame): Added. Clears m_frame.
+        (KJS::FrameArray::disconnectFrame): Added. Clears m_frame.
+        (KJS::Window::Window): Removed code to create a WindowQObject.
+        (KJS::Window::~Window): Removed code to delete a WindowQObject.
+        (KJS::Window::location): Remove now-unneeded const_cast.
+        (KJS::Window::selection): Ditto.
+        (KJS::Window::locationbar): Ditto.
+        (KJS::Window::menubar): Ditto.
+        (KJS::Window::personalbar): Ditto.
+        (KJS::Window::statusbar): Ditto.
+        (KJS::Window::toolbar): Ditto.
+        (KJS::Window::scrollbars): Ditto.
+        (KJS::Window::getValueProperty): Update since m_frame is now a raw pointer.
+        (KJS::Window::getOwnPropertySlot): Ditto.
+        (KJS::Window::toBoolean): Ditto.
+        (KJS::Window::scheduleClose): Remove assert that WindowQObject* is not null.
+        (KJS::Window::isSafeScript): Update since m_frame is now a raw pointer.
+        (KJS::Window::clear): Remove code to delete a WindowQObject. Added a call
+        to clearAllTimeouts instead.
+        (KJS::Window::clearAllTimeouts): Added. Does equivalent of the WindowQObject
+        destructor.
+        (KJS::Window::installTimeout): Moved to Window from WindowQObject.
+        (KJS::Window::pauseTimeouts): Ditto.
+        (KJS::Window::resumeTimeouts): Ditto.
+        (KJS::Window::clearTimeout): Ditto.
+        (KJS::Window::timerFired): Ditto.
+        (KJS::Window::disconnectFrame): Added. Sets all the frame pointers to 0.
+        (KJS::FrameArray::getOwnPropertySlot): Update since m_frame is now a raw pointer.
+        (KJS::Location::getOwnPropertySlot): Ditto.
+        (KJS::Location::put): Ditto.
+        (KJS::Selection::getOwnPropertySlot): Ditto.
+        (KJS::BarInfo::getOwnPropertySlot): Ditto.
+
+        * khtml/html/html_baseimpl.h: Forward-declare Length instead of including khtmllayout.h.
+        * khtml/html/html_imageimpl.h: Ditto.
+
+        * khtml/html/html_inlineimpl.cpp: (WebCore::HTMLAnchorElementImpl::defaultEventHandler):
+        Changed to use KeyEvent and removed the code to extract the button and state from the
+        DOM even to pass to urlSelected.
+        * ksvg2/svg/SVGAElementImpl.cpp: (SVGAElementImpl::defaultEventHandler): Ditto.
+
+        * khtml/html/htmltokenizer.cpp: (WebCore::HTMLTokenizer::timerFired): Change to use
+        a RefPtr instead of a QGuardedPtr.
+
+        * khtml/misc/helper.h:
+        * khtml/misc/helper.cpp: Removed printpainter and setPrintPainter.
+
+        * ksvg2/svg/SVGDocumentImpl.h:
+        * ksvg2/svg/SVGDocumentImpl.cpp: (WebCore::SVGDocumentImpl::dispatchKeyEvent):
+        Change to use KeyEvent.
+
+        * kwq/KWQComboBox.mm:
+        (-[KWQPopUpButton becomeFirstResponder]):
+        (-[KWQPopUpButton resignFirstResponder]):
+        * kwq/KWQFileButton.mm:
+        (KWQFileButton::focusChanged):
+        * kwq/KWQListBox.mm:
+        (-[KWQTableView becomeFirstResponder]):
+        (-[KWQTableView resignFirstResponder]):
+        * kwq/KWQSlider.mm:
+        (-[KWQSlider becomeFirstResponder]):
+        (-[KWQSlider resignFirstResponder]):
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextAreaTextView becomeFirstResponder]):
+        (-[KWQTextAreaTextView resignFirstResponder]):
+        * kwq/KWQTextField.mm:
+        (-[KWQTextFieldController setHasFocus:]):
+        Updated to use new eventFilterFocusIn/Out instead of the general purpose
+        eventFilter function. This allows us to remove QEvent and the focus events.
+
+        * kwq/KWQNamespace.h: Removed ButtonState.
+
+        * kwq/KWQObject.h:
+        * kwq/KWQObject.cpp: Replaced eventFilter function with eventFilterFocusIn and
+        eventFilterFocusOut, allowing us to remove QEvent. Removed event function.
+
+        * kwq/KWQSlot.cpp:
+        (KWQSlot::KWQSlot): Removed the parentDestroyed slot.
+        (KWQSlot::call): Ditto.
+
+        * page/Frame.h:
+        * page/Frame.cpp:
+        (WebCore::UserStyleSheetLoader::UserStyleSheetLoader): Renamed from
+        PartStyleSheetLoader. Removed a lot of unneeded null checks. Use a
+        raw Frame pointer instead of a QGuardedPtr, and count on the Frame
+        to delete us when it's being deleted.
+        (WebCore::UserStyleSheetLoader::~UserStyleSheetLoader): No longer
+        a virtual function. This is not a polymorphic class.
+        (WebCore::UserStyleSheetLoader::setStyleSheet): Remove code to delete
+        ourselves -- that's now the frame's responsibility.
+        (WebCore::Frame::~Frame): Call disconnectFrame on the KJS::Window and
+        delete m_userStyleSheetLoader.
+        (WebCore::Frame::changeLocation): Update since urlSelected no longer takes
+        button and state parameters.
+        (WebCore::Frame::setUserStyleSheet): Delete existing loader to stop a load
+        in progress before starting a new load. Store reference to loader.
+        (WebCore::Frame::urlSelected): Remove button and state parameters and unused
+        local variable hasTarget.
+        (WebCore::Frame::selectClosestWordFromMouseEvent): Change from QMouseEvent
+        to MouseEvent.
+        (WebCore::Frame::handleMousePressEventDoubleClick): Change from MousePressEvent
+        to MouseEventWithHitTestResults.
+        (WebCore::Frame::handleMousePressEventTripleClick): Ditto.
+        (WebCore::Frame::handleMousePressEventSingleClick): Ditto.
+        (WebCore::Frame::khtmlMousePressEvent): Ditto.
+        (WebCore::Frame::handleMouseMoveEventSelection): Change from MouseMoveEvent
+        to MouseEventWithHitTestResults.
+        (WebCore::Frame::khtmlMouseMoveEvent): Ditto.
+        (WebCore::Frame::khtmlMouseReleaseEvent): Change from MouseReleaseEvent
+        to MouseEventWithHitTestResults.
+        (WebCore::Frame::khtmlMouseDoubleClickEvent): Change from
+        MouseReleaseDoubleClickEvent to MouseEventWithHitTestResults.
+        (WebCore::Frame::passWidgetMouseDownEventToWidget): Change from
+        NodeImpl::MouseEvent to MouseEventWithHitTestResults.
+
+        * page/FramePrivate.h: Added m_userStyleSheetLoader.
+
+        * page/FrameView.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::viewportMousePressEvent): Change from QMouseEvent to
+        MouseEvent and from NodeImpl::MouseEvent to MouseEventWithHitTestResults.
+        (WebCore::FrameView::viewportMouseDoubleClickEvent): Ditto.
+        (WebCore::selectCursor): Ditto.
+        (WebCore::FrameView::viewportMouseMoveEvent): Ditto.
+        (WebCore::FrameView::viewportMouseReleaseEvent): Ditto.
+        (WebCore::FrameView::keyPressEvent): Change from QKeyEvent to KeyEvent.
+        (WebCore::FrameView::dispatchMouseEvent): Change from QMouseEvent to
+        MouseEvent and from NodeImpl::MouseEvent to MouseEventWithHitTestResults.
+        (WebCore::FrameView::viewportWheelEvent): Change from QWheelEvent to
+        WheelEvent.
+        (WebCore::FrameView::hoverTimerFired): Update for change to prepareMouseEvent
+        parameters.
+
+        * platform/Widget.h:
+        * platform/Widget.cpp: Removed event function.
+
+        * rendering/render_form.h: Removed LineEditWidget, ComboBoxWidget, TextAreaWidget.
+        * rendering/render_form.cpp:
+        (WebCore::RenderFormElement::slotClicked): Changed from QMouseEvent to MouseEvent.
+        (WebCore::RenderFormElement::addIntrinsicMarginsIfAllowed): Updated for changes
+        to the Length class.
+        (WebCore::RenderSelect::setWidgetWritingDirection): Updated for removal of
+        ComboBoxWidget.
+        (WebCore::RenderSelect::slotSelected): Ditto.
+        (WebCore::RenderSelect::createComboBox): Ditto.
+
+        * rendering/render_replaced.h:
+        * rendering/render_replaced.cpp:
+        (WebCore::RenderWidget::destroy): Updated since removeEventFilter no longer takes
+        a parameter.
+        (WebCore::RenderWidget::setQWidget): Ditto.
+        (WebCore::RenderWidget::eventFilterFocusIn): Added. Replaces eventFilter.
+        (WebCore::RenderWidget::eventFilterFocusOut): Ditto.
+
+        * css/css_computedstyle.cpp:
+        (WebCore::valueForLength):
+        (WebCore::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
+        * css/cssstyleselector.cpp:
+        (WebCore::checkPseudoState):
+        (WebCore::CSSStyleSelector::applyProperty):
+        (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
+        * khtml/html/html_imageimpl.cpp:
+        (WebCore::HTMLAreaElementImpl::getRegion):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::MarginInfo::MarginInfo):
+        (WebCore::RenderBlock::isSelfCollapsingBlock):
+        (WebCore::RenderBlock::layoutBlock):
+        (WebCore::RenderBlock::determineHorizontalPosition):
+        (WebCore::RenderBlock::leftRelOffset):
+        (WebCore::RenderBlock::rightRelOffset):
+        (WebCore::RenderBlock::calcMinMaxWidth):
+        (WebCore::getBPMWidth):
+        (WebCore::RenderBlock::calcInlineMinMaxWidth):
+        (WebCore::RenderBlock::calcBlockMinMaxWidth):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::calcWidth):
+        (WebCore::RenderTable::layout):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::calcMinMaxWidth):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::addChild):
+        (WebCore::RenderTableSection::addCell):
+        (WebCore::RenderTableSection::calcRowHeight):
+        (WebCore::RenderTableSection::layoutRows):
+        * rendering/RenderText.h:
+        (khtml::RenderText::marginLeft):
+        (khtml::RenderText::marginRight):
+        * rendering/bidi.cpp:
+        (khtml::getBPMWidth):
+        * rendering/render_applet.cpp:
+        (WebCore::RenderApplet::createWidgetIfNecessary):
+        * rendering/render_box.cpp:
+        (WebCore::RenderBox::paintBackgroundExtended):
+        (WebCore::RenderBox::getClipRect):
+        (WebCore::RenderBox::relativePositionOffset):
+        (WebCore::RenderBox::calcWidth):
+        (WebCore::RenderBox::calcWidthUsing):
+        (WebCore::RenderBox::sizesToIntrinsicWidth):
+        (WebCore::RenderBox::calcHorizontalMargins):
+        (WebCore::RenderBox::calcHeight):
+        (WebCore::RenderBox::calcHeightUsing):
+        (WebCore::RenderBox::calcPercentageHeight):
+        (WebCore::RenderBox::calcReplacedWidth):
+        (WebCore::RenderBox::calcReplacedWidthUsing):
+        (WebCore::RenderBox::calcReplacedHeight):
+        (WebCore::RenderBox::calcReplacedHeightUsing):
+        (WebCore::RenderBox::availableHeightUsing):
+        (WebCore::RenderBox::calcVerticalMargins):
+        (WebCore::RenderBox::calcAbsoluteHorizontal):
+        (WebCore::RenderBox::calcAbsoluteHorizontalValues):
+        (WebCore::RenderBox::calcAbsoluteVertical):
+        (WebCore::RenderBox::calcAbsoluteVerticalValues):
+        * rendering/render_br.cpp:
+        (WebCore::RenderBR::lineHeight):
+        * rendering/render_flexbox.cpp:
+        (khtml::RenderFlexibleBox::calcHorizontalMinMaxWidth):
+        (khtml::RenderFlexibleBox::calcVerticalMinMaxWidth):
+        (khtml::RenderFlexibleBox::calcMinMaxWidth):
+        (khtml::RenderFlexibleBox::allowedChildFlex):
+        * rendering/render_flow.cpp:
+        (WebCore::RenderFlow::lineHeight):
+        * rendering/render_frames.cpp:
+        (WebCore::RenderFrameSet::layout):
+        * rendering/render_image.cpp:
+        (WebCore::RenderImage::isWidthSpecified):
+        (WebCore::RenderImage::isHeightSpecified):
+        * rendering/render_layer.cpp:
+        (WebCore::Marquee::direction):
+        (WebCore::Marquee::start):
+        (WebCore::Marquee::updateMarqueeStyle):
+        (WebCore::Marquee::timerFired):
+        * rendering/render_line.cpp:
+        (WebCore::InlineFlowBox::marginLeft):
+        (WebCore::InlineFlowBox::marginRight):
+        * rendering/render_object.cpp:
+        (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
+        (WebCore::RenderObject::paintBorderImage):
+        (WebCore::RenderObject::paddingTop):
+        (WebCore::RenderObject::paddingBottom):
+        (WebCore::RenderObject::paddingLeft):
+        (WebCore::RenderObject::paddingRight):
+        (WebCore::RenderObject::getVerticalPosition):
+        (WebCore::RenderObject::lineHeight):
+        (WebCore::RenderObject::addDashboardRegions):
+        * rendering/render_style.h:
+        * rendering/render_theme_mac.mm:
+        (WebCore::RenderThemeMac::addIntrinsicMargins):
+        * rendering/table_layout.cpp:
+        (WebCore::FixedTableLayout::calcWidthArray):
+        (WebCore::FixedTableLayout::calcMinMaxWidth):
+        (WebCore::FixedTableLayout::layout):
+        (WebCore::AutoTableLayout::recalcColumn):
+        (WebCore::AutoTableLayout::fullRecalc):
+        (WebCore::AutoTableLayout::calcMinMaxWidth):
+        (WebCore::AutoTableLayout::calcEffectiveWidth):
+        (WebCore::AutoTableLayout::layout):
+        (WebCore::AutoTableLayout::calcPercentages):
+        Updated for changes to the Length class.
+        Also removed a check of the printpainter global, never used in WebCore.
+
+        * bindings/objc/DOM.mm:
+        * bindings/objc/DOMCSS.mm:
+        * bindings/objc/DOMHTML.mm:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        * css/csshelper.cpp:
+        * editing/SelectionController.cpp:
+        * khtml/ecma/kjs_html.h:
+        * kwq/KWQAccObject.mm:
+        * kwq/KWQAccObjectCache.mm:
+        * kwq/KWQClipboard.mm:
+        * kwq/KWQFont.mm:
+        * kwq/KWQFontMetrics.mm:
+        * kwq/KWQKJobClasses.mm:
+        * kwq/KWQKURL.mm:
+        * kwq/KWQLoader.mm:
+        * kwq/KWQPageState.mm:
+        * kwq/KWQPainter.mm:
+        * kwq/WebCoreSettings.mm:
+        * platform/StringImpl.cpp:
+        * platform/mac/CursorMac.mm:
+        * platform/mac/WidgetMac.mm:
+        * rendering/RenderBlock.h:
+        * rendering/render_canvas.cpp:
+        * rendering/render_line.h:
+        * rendering/render_style.cpp:
+        * rendering/table_layout.h:
+        Updated includes.
+
+        * bindings/js/JSDOMCore.cpp: Touched, because I got strange failures if this
+        didn't rebuild.
+        * bindings/js/JSDOMEvents.cpp: Ditto.
+
 2006-02-23  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by darin.
diff --git a/WebCore/ForwardingHeaders/qevent.h b/WebCore/ForwardingHeaders/qevent.h
deleted file mode 100644 (file)
index 1bbc63e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "KWQEvent.h"
index 1398268..2977c39 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\kwq\KWQEvent.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath="..\..\kwq\KWQExceptions.h"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\kwq\KWQFoundationExtras.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath="..\..\kwq\KWQGuardedPtr.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\kwq\KWQKPartsHistoryProvider.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath="..\..\kwq\KWQKPartsPart.h"\r
                                >\r
                        </File>\r
                                        RelativePath="..\..\khtml\misc\helper.h"\r
                                        >\r
                                </File>\r
-                               <File\r
-                                       RelativePath="..\..\khtml\misc\khtmllayout.h"\r
-                                       >\r
-                               </File>\r
                        </Filter>\r
                </Filter>\r
                <Filter\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\page\MouseEventWithHitTestResults.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\page\Page.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\platform\KeyEvent.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\platform\MouseEvent.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\platform\Pen.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\platform\WheelEvent.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\platform\Widget.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\css\Length.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\css\UserAgentStyleSheets.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\rendering\GapRects.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\rendering\InlineTextBox.cpp"\r
                                >\r
                        </File>\r
                                RelativePath="..\..\bridge\BrowserExtension.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\bridge\History.h"\r
+                               >\r
+                       </File>\r
                        <Filter\r
                                Name="win"\r
                                >\r
index a4b10a6..d7a4be8 100644 (file)
                93309EA2099EB78C0056E581 /* SharedTimerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309E9F099EB78C0056E581 /* SharedTimerMac.cpp */; };
                93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309EA0099EB78C0056E581 /* SharedTimer.h */; };
                93309EA4099EB78C0056E581 /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309EA1099EB78C0056E581 /* Timer.cpp */; };
+               935C475D09AC4CA000A6AAB4 /* History.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C475C09AC4CA000A6AAB4 /* History.h */; };
+               935C475F09AC4CAE00A6AAB4 /* HistoryMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */; };
+               935C476109AC4CD100A6AAB4 /* Length.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476009AC4CD100A6AAB4 /* Length.h */; };
+               935C476309AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476209AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h */; };
+               935C476809AC4D4300A6AAB4 /* KeyEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476609AC4D4300A6AAB4 /* KeyEvent.h */; };
+               935C476909AC4D4300A6AAB4 /* MouseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476709AC4D4300A6AAB4 /* MouseEvent.h */; };
+               935C476B09AC4D4F00A6AAB4 /* WheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476A09AC4D4F00A6AAB4 /* WheelEvent.h */; };
+               935C476D09AC4D6300A6AAB4 /* FoundationExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476C09AC4D6300A6AAB4 /* FoundationExtras.h */; };
+               935C477009AC4D7300A6AAB4 /* KeyEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */; };
+               935C477109AC4D7300A6AAB4 /* MouseEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C476F09AC4D7300A6AAB4 /* MouseEventMac.mm */; };
+               935C477309AC4D7700A6AAB4 /* WheelEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C477209AC4D7700A6AAB4 /* WheelEventMac.mm */; };
+               935C477509AC4D8E00A6AAB4 /* GapRects.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C477409AC4D8D00A6AAB4 /* GapRects.h */; };
                936B424E09A436CD00BAA820 /* KSVGCSSParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F6F6089701F100BA5114 /* KSVGCSSParser.cpp */; };
                937A36A7097E2E3200E4EE2F /* UserAgentStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 937A36A6097E2E3200E4EE2F /* UserAgentStyleSheets.cpp */; };
                937D809A09A063330092A01E /* PageMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 937D809909A063330092A01E /* PageMac.h */; };
                93F198EE08245E59001E9ABC /* html_tableimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D24F02DE4396018635CA /* html_tableimpl.h */; };
                93F198EF08245E59001E9ABC /* htmlparser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25102DE4396018635CA /* htmlparser.h */; };
                93F198F008245E59001E9ABC /* htmltokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25302DE4396018635CA /* htmltokenizer.h */; };
-               93F198F108245E59001E9ABC /* khtml_events.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D15202DE42AD018635CA /* khtml_events.h */; };
                93F198F608245E59001E9ABC /* decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D27902DE43D7018635CA /* decoder.h */; };
                93F198F708245E59001E9ABC /* helper.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D27B02DE43D7018635CA /* helper.h */; };
-               93F198FC08245E59001E9ABC /* khtmllayout.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D28302DE43D7018635CA /* khtmllayout.h */; };
                93F1991708245E59001E9ABC /* dom2_eventsimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30202DE4476018635CA /* dom2_eventsimpl.h */; };
                93F1991808245E59001E9ABC /* dom2_rangeimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30402DE4476018635CA /* dom2_rangeimpl.h */; };
                93F1991908245E59001E9ABC /* dom2_traversalimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30602DE4476018635CA /* dom2_traversalimpl.h */; };
                93F1992E08245E59001E9ABC /* KWQComboBox.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868202DE3B8601EA4122 /* KWQComboBox.h */; };
                93F1992F08245E59001E9ABC /* Cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868402DE3B8601EA4122 /* Cursor.h */; };
                93F1993308245E59001E9ABC /* KWQDef.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784DA02DE375901EA4122 /* KWQDef.h */; };
-               93F1993708245E59001E9ABC /* KWQEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868802DE3B8601EA4122 /* KWQEvent.h */; };
                93F1993908245E59001E9ABC /* KWQFileButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CCF7D4033BD43C008635CE /* KWQFileButton.h */; };
                93F1993A08245E59001E9ABC /* KWQFont.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868A02DE3B8601EA4122 /* KWQFont.h */; };
                93F1993C08245E59001E9ABC /* KWQFontMetrics.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868D02DE3B8601EA4122 /* KWQFontMetrics.h */; };
                93F1995508245E59001E9ABC /* KWQKJob.h in Headers */ = {isa = PBXBuildFile; fileRef = F587864A02DE3A9A01EA4122 /* KWQKJob.h */; };
                93F1995608245E59001E9ABC /* KWQKJobClasses.h in Headers */ = {isa = PBXBuildFile; fileRef = F587864B02DE3A9A01EA4122 /* KWQKJobClasses.h */; };
                93F1995B08245E59001E9ABC /* KWQKLocale.h in Headers */ = {isa = PBXBuildFile; fileRef = F58785FA02DE382001EA4122 /* KWQKLocale.h */; };
-               93F1996008245E59001E9ABC /* KWQKPartsHistoryProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = F587866B02DE3B3201EA4122 /* KWQKPartsHistoryProvider.h */; };
                93F1996308245E59001E9ABC /* KWQKSSLKeyGen.h in Headers */ = {isa = PBXBuildFile; fileRef = F587866202DE3B1101EA4122 /* KWQKSSLKeyGen.h */; };
                93F1996708245E59001E9ABC /* KWQKURL.h in Headers */ = {isa = PBXBuildFile; fileRef = F587860202DE382001EA4122 /* KWQKURL.h */; };
                93F1996B08245E59001E9ABC /* KWQLineEdit.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869802DE3B8601EA4122 /* KWQLineEdit.h */; };
                93F199E108245E59001E9ABC /* KWQTextUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = BE8BD8F306359F6000D3F20B /* KWQTextUtilities.h */; };
                93F199E508245E59001E9ABC /* html_canvasimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F6A3D60663BF04004D2919 /* html_canvasimpl.h */; };
                93F199E708245E59001E9ABC /* KWQClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D90660B0665D937006B6F1A /* KWQClipboard.h */; };
-               93F199EA08245E59001E9ABC /* KWQFoundationExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D1FEF6067EBF89009CE68A /* KWQFoundationExtras.h */; };
                93F199EC08245E59001E9ABC /* xsl_stylesheetimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = BC06F24A06D18A7E004A6FA3 /* xsl_stylesheetimpl.h */; };
                93F199ED08245E59001E9ABC /* xslt_processorimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = BC06F24C06D18A7E004A6FA3 /* xslt_processorimpl.h */; };
                93F199EE08245E59001E9ABC /* formdata.h in Headers */ = {isa = PBXBuildFile; fileRef = 93ABCE5E06E1A42E0085925B /* formdata.h */; };
                93F19A1308245E59001E9ABC /* KWQCharsets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F58784CD02DE375901EA4122 /* KWQCharsets.cpp */; };
                93F19A1708245E59001E9ABC /* KWQComboBox.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784D202DE375901EA4122 /* KWQComboBox.mm */; };
                93F19A1808245E59001E9ABC /* KWQCString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F58784D502DE375901EA4122 /* KWQCString.cpp */; };
-               93F19A1C08245E59001E9ABC /* KWQEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784DE02DE375901EA4122 /* KWQEvent.mm */; };
                93F19A1E08245E59001E9ABC /* KWQFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784E002DE375901EA4122 /* KWQFont.mm */; };
                93F19A1F08245E59001E9ABC /* KWQFontMetrics.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784E202DE375901EA4122 /* KWQFontMetrics.mm */; };
                93F19A2208245E59001E9ABC /* KWQGuardedPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F58784E602DE375901EA4122 /* KWQGuardedPtr.cpp */; };
                93F19A2408245E59001E9ABC /* KWQKConfigBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784ED02DE375901EA4122 /* KWQKConfigBase.mm */; };
                93F19A2508245E59001E9ABC /* KWQKCookieJar.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784EF02DE375901EA4122 /* KWQKCookieJar.mm */; };
                93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784F002DE375901EA4122 /* CursorMac.mm */; };
-               93F19A2908245E59001E9ABC /* KWQKHistoryProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784F602DE375901EA4122 /* KWQKHistoryProvider.mm */; };
                93F19A2E08245E59001E9ABC /* KWQKJavaAppletWidget.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784FF02DE375901EA4122 /* KWQKJavaAppletWidget.mm */; };
                93F19A3008245E59001E9ABC /* KWQKJobClasses.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587850102DE375901EA4122 /* KWQKJobClasses.mm */; };
                93F19A3108245E59001E9ABC /* KWQLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587850302DE375901EA4122 /* KWQLoader.mm */; };
                93F19A5D08245E59001E9ABC /* WebCoreImageRendererFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587854F02DE375901EA4122 /* WebCoreImageRendererFactory.m */; };
                93F19A5E08245E59001E9ABC /* WebCoreTextRendererFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587855302DE375901EA4122 /* WebCoreTextRendererFactory.mm */; };
                93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587855502DE375901EA4122 /* WebCoreViewFactory.m */; };
-               93F19A6008245E59001E9ABC /* khtml_events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D15102DE42AD018635CA /* khtml_events.cpp */; };
                93F19A7308245E59001E9ABC /* dom2_events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D19C02DE4322018635CA /* dom2_events.cpp */; };
                93F19A7508245E59001E9ABC /* dom2_traversal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D1A002DE4322018635CA /* dom2_traversal.cpp */; };
                93F19A8308245E59001E9ABC /* kjs_binding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D1F402DE4369018635CA /* kjs_binding.cpp */; };
                93309EA1099EB78C0056E581 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Timer.cpp; path = platform/Timer.cpp; sourceTree = "<group>"; };
                93386B90037045B3008635CE /* KWQResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQResourceLoader.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93386B91037045B3008635CE /* KWQResourceLoader.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQResourceLoader.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               935C475C09AC4CA000A6AAB4 /* History.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = History.h; sourceTree = "<group>"; };
+               935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HistoryMac.mm; sourceTree = "<group>"; };
+               935C476009AC4CD100A6AAB4 /* Length.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Length.h; sourceTree = "<group>"; };
+               935C476209AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MouseEventWithHitTestResults.h; sourceTree = "<group>"; };
+               935C476609AC4D4300A6AAB4 /* KeyEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEvent.h; path = platform/KeyEvent.h; sourceTree = "<group>"; };
+               935C476709AC4D4300A6AAB4 /* MouseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MouseEvent.h; path = platform/MouseEvent.h; sourceTree = "<group>"; };
+               935C476A09AC4D4F00A6AAB4 /* WheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WheelEvent.h; path = platform/WheelEvent.h; sourceTree = "<group>"; };
+               935C476C09AC4D6300A6AAB4 /* FoundationExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoundationExtras.h; sourceTree = "<group>"; };
+               935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KeyEventMac.mm; sourceTree = "<group>"; };
+               935C476F09AC4D7300A6AAB4 /* MouseEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MouseEventMac.mm; sourceTree = "<group>"; };
+               935C477209AC4D7700A6AAB4 /* WheelEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WheelEventMac.mm; sourceTree = "<group>"; };
+               935C477409AC4D8D00A6AAB4 /* GapRects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GapRects.h; sourceTree = "<group>"; };
                937A36A6097E2E3200E4EE2F /* UserAgentStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserAgentStyleSheets.cpp; sourceTree = "<group>"; };
                937D809909A063330092A01E /* PageMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageMac.h; sourceTree = "<group>"; };
                9380F47109A11AB4001FDB34 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Widget.cpp; path = platform/Widget.cpp; sourceTree = "<group>"; };
                93CD4FDC0995F9EA007ECC97 /* StringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringImpl.cpp; path = platform/StringImpl.cpp; sourceTree = "<group>"; };
                93CD4FDD0995F9EA007ECC97 /* StringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringImpl.h; path = platform/StringImpl.h; sourceTree = "<group>"; };
                93CD4FEB0995FD2A007ECC97 /* PlatformString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformString.h; path = platform/PlatformString.h; sourceTree = "<group>"; };
-               93D1FEF6067EBF89009CE68A /* KWQFoundationExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQFoundationExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93E62D990985F41600E1B5E3 /* SystemTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SystemTime.h; path = platform/SystemTime.h; sourceTree = "<group>"; };
                93F19B1908245E59001E9ABC /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93F19B1A08245E5A001E9ABC /* WebCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                F5117BCA02F9FFEF018635CE /* KWQSignal.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = KWQSignal.cpp; path = kwq/KWQSignal.cpp; sourceTree = SOURCE_ROOT; };
                F5117BCB02F9FFEF018635CE /* KWQSlot.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = KWQSlot.h; path = kwq/KWQSlot.h; sourceTree = SOURCE_ROOT; };
                F5117BCC02F9FFEF018635CE /* KWQSlot.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = KWQSlot.cpp; path = kwq/KWQSlot.cpp; sourceTree = SOURCE_ROOT; };
-               F523D15102DE42AD018635CA /* khtml_events.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = khtml_events.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F523D15202DE42AD018635CA /* khtml_events.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = khtml_events.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D18602DE4322018635CA /* css_rule.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = css_rule.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D18802DE4322018635CA /* css_stylesheet.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = css_stylesheet.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D18A02DE4322018635CA /* css_value.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = css_value.h; 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; };
                F523D27A02DE43D7018635CA /* helper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = helper.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D27B02DE43D7018635CA /* helper.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = helper.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F523D28302DE43D7018635CA /* khtmllayout.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = khtmllayout.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D2F702DE4476018635CA /* dom_elementimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dom_elementimpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D2F802DE4476018635CA /* dom_elementimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = dom_elementimpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D2FF02DE4476018635CA /* dom_xmlimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dom_xmlimpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784D202DE375901EA4122 /* KWQComboBox.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQComboBox.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784D502DE375901EA4122 /* KWQCString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQCString.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784DA02DE375901EA4122 /* KWQDef.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQDef.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F58784DE02DE375901EA4122 /* KWQEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQEvent.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784E002DE375901EA4122 /* KWQFont.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQFont.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784E202DE375901EA4122 /* KWQFontMetrics.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQFontMetrics.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784E602DE375901EA4122 /* KWQGuardedPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQGuardedPtr.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784EE02DE375901EA4122 /* KWQKCookieJar.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKCookieJar.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784EF02DE375901EA4122 /* KWQKCookieJar.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKCookieJar.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784F002DE375901EA4122 /* CursorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CursorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F58784F602DE375901EA4122 /* KWQKHistoryProvider.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKHistoryProvider.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58784FF02DE375901EA4122 /* KWQKJavaAppletWidget.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKJavaAppletWidget.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587850102DE375901EA4122 /* KWQKJobClasses.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKJobClasses.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587850302DE375901EA4122 /* KWQLoader.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQLoader.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587864A02DE3A9A01EA4122 /* KWQKJob.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKJob.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587864B02DE3A9A01EA4122 /* KWQKJobClasses.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKJobClasses.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587866202DE3B1101EA4122 /* KWQKSSLKeyGen.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKSSLKeyGen.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587866B02DE3B3201EA4122 /* KWQKPartsHistoryProvider.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKPartsHistoryProvider.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587868002DE3B8601EA4122 /* KWQCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQCollection.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587868202DE3B8601EA4122 /* KWQComboBox.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQComboBox.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587868302DE3B8601EA4122 /* KWQCString.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQCString.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587868402DE3B8601EA4122 /* Cursor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = Cursor.h; path = platform/Cursor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587868802DE3B8601EA4122 /* KWQEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQEvent.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587868A02DE3B8601EA4122 /* KWQFont.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQFont.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587868D02DE3B8601EA4122 /* KWQFontMetrics.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQFontMetrics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587869002DE3B8601EA4122 /* KWQGuardedPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQGuardedPtr.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                6582A14B09999D6C00BEEB6D /* FloatRectMac.mm */,
                                6582A14C09999D6C00BEEB6D /* FloatSizeMac.mm */,
                                BCC47E2209A3D6B300ADB771 /* FontFamilyMac.mm */,
+                               935C476C09AC4D6300A6AAB4 /* FoundationExtras.h */,
                                6582A14D09999D6C00BEEB6D /* ImageMac.mm */,
                                6582A14E09999D6D00BEEB6D /* ImageSourceMac.cpp */,
                                6582A14F09999D6D00BEEB6D /* IntPointMac.mm */,
                                6582A15009999D6D00BEEB6D /* IntRectMac.mm */,
                                6582A15109999D6D00BEEB6D /* IntSizeMac.mm */,
+                               935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */,
+                               935C476F09AC4D7300A6AAB4 /* MouseEventMac.mm */,
                                6582A15209999D6D00BEEB6D /* PDFDocumentImage.h */,
                                6582A15309999D6D00BEEB6D /* PDFDocumentImage.mm */,
-                               6582A17709999EA000BEEB6D /* QStringMac.mm */,
                                651B4D8E09AC859F0029F1EF /* QStringListMac.mm */,
+                               6582A17709999EA000BEEB6D /* QStringMac.mm */,
                                6582A15409999D6D00BEEB6D /* ScreenMac.mm */,
                                93309E9F099EB78C0056E581 /* SharedTimerMac.cpp */,
                                6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */,
+                               935C477209AC4D7700A6AAB4 /* WheelEventMac.mm */,
                                9380F47709A11ACC001FDB34 /* WidgetMac.mm */,
                        );
                        name = mac;
                                65A21483097A3F5300B9050A /* FrameTree.h */,
                                65CBFEF70974F607001DAC25 /* FrameView.cpp */,
                                65CBFEF80974F607001DAC25 /* FrameView.h */,
+                               935C476209AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h */,
                                65FEA86809833ADE00BED4AB /* Page.cpp */,
                                65A21467097A329100B9050A /* Page.h */,
                                65D1C1C909932B22000CB324 /* Plugin.h */,
                        children = (
                                65BF02350974819000C43196 /* mac */,
                                BCEA4943097F0F5C0094C9E4 /* BrowserExtension.h */,
+                               935C475C09AC4CA000A6AAB4 /* History.h */,
                        );
                        path = bridge;
                        sourceTree = "<group>";
                                BCEA4945097F0F770094C9E4 /* BrowserExtensionMac.h */,
                                BCEA4946097F0F770094C9E4 /* BrowserExtensionMac.mm */,
                                9380F68609A143B2001FDB34 /* FrameViewMac.mm */,
+                               935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */,
                                65BF023B0974819000C43196 /* MacFrame.h */,
                                65BF023C0974819000C43196 /* MacFrame.mm */,
                                937D809909A063330092A01E /* PageMac.h */,
                                BCB16AF70979A08500467741 /* IntRect.cpp */,
                                BCB16AF80979A08500467741 /* IntRect.h */,
                                BCF1A5EF097839600061A123 /* IntSize.h */,
+                               935C476609AC4D4300A6AAB4 /* KeyEvent.h */,
+                               935C476709AC4D4300A6AAB4 /* MouseEvent.h */,
                                BC6B7BBB0993611A0052867B /* PDFDocumentImage.h */,
                                BCC8D1710988301200140BF2 /* Pen.cpp */,
                                BCC8D1720988301200140BF2 /* Pen.h */,
                                93E62D990985F41600E1B5E3 /* SystemTime.h */,
                                93309EA1099EB78C0056E581 /* Timer.cpp */,
                                9305B24C098F1B6B00C28855 /* Timer.h */,
+                               935C476A09AC4D4F00A6AAB4 /* WheelEvent.h */,
                                9380F47109A11AB4001FDB34 /* Widget.cpp */,
                                9380F47209A11AB4001FDB34 /* Widget.h */,
                        );
                                93CCF7D5033BD43C008635CE /* KWQFileButton.mm */,
                                93B641F206E28C5C0055F610 /* KWQFormData.h */,
                                93B641F106E28C5C0055F610 /* KWQFormData.mm */,
-                               93D1FEF6067EBF89009CE68A /* KWQFoundationExtras.h */,
                                F58784EE02DE375901EA4122 /* KWQKCookieJar.h */,
                                F58784EF02DE375901EA4122 /* KWQKCookieJar.mm */,
                                F587851702DE375901EA4122 /* KWQLoader.h */,
                                F523D29C02DE43D9018635CA /* misc */,
                                BC41978B059293BE0016347F /* xbl */,
                                BC06F24406D18A35004A6FA3 /* xsl */,
-                               F523D15202DE42AD018635CA /* khtml_events.h */,
-                               F523D15102DE42AD018635CA /* khtml_events.cpp */,
                        );
                        path = khtml;
                        sourceTree = "<group>";
                                BCEA478A097CAAC80094C9E4 /* cssstyleselector.cpp */,
                                BCEA478B097CAAC80094C9E4 /* cssstyleselector.h */,
                                BCEA478C097CAAC80094C9E4 /* cssvalues.in */,
+                               935C476009AC4CD100A6AAB4 /* Length.h */,
                                937A36A6097E2E3200E4EE2F /* UserAgentStyleSheets.cpp */,
                        );
                        path = css;
                                93ABCE5E06E1A42E0085925B /* formdata.h */,
                                F523D27A02DE43D7018635CA /* helper.cpp */,
                                F523D27B02DE43D7018635CA /* helper.h */,
-                               F523D28302DE43D7018635CA /* khtmllayout.h */,
                        );
                        path = misc;
                        sourceTree = "<group>";
                                BCEA4817097D93020094C9E4 /* DataRef.h */,
                                BCEA4818097D93020094C9E4 /* font.cpp */,
                                BCEA4819097D93020094C9E4 /* font.h */,
+                               935C477409AC4D8D00A6AAB4 /* GapRects.h */,
                                BCEA481A097D93020094C9E4 /* InlineTextBox.cpp */,
                                BCEA481B097D93020094C9E4 /* InlineTextBox.h */,
                                BCEA481C097D93020094C9E4 /* render_applet.cpp */,
                                F587871802DE3B8801EA4122 /* qt */,
                                F587861C02DE382201EA4122 /* kdecore */,
                                F587865F02DE3A9C01EA4122 /* kio */,
-                               F587867502DE3B3301EA4122 /* kparts */,
                                F587864302DE3A1601EA4122 /* khtml */,
                                F523D15002DE4271018635CA /* other */,
                        );
                        name = kio;
                        sourceTree = "<group>";
                };
-               F587867502DE3B3301EA4122 /* kparts */ = {
-                       isa = PBXGroup;
-                       children = (
-                               F58784F602DE375901EA4122 /* KWQKHistoryProvider.mm */,
-                               F587866B02DE3B3201EA4122 /* KWQKPartsHistoryProvider.h */,
-                       );
-                       name = kparts;
-                       sourceTree = "<group>";
-               };
                F587871802DE3B8801EA4122 /* qt */ = {
                        isa = PBXGroup;
                        children = (
                                F58784D202DE375901EA4122 /* KWQComboBox.mm */,
                                F58784D502DE375901EA4122 /* KWQCString.cpp */,
                                F587868302DE3B8601EA4122 /* KWQCString.h */,
-                               F587868802DE3B8601EA4122 /* KWQEvent.h */,
-                               F58784DE02DE375901EA4122 /* KWQEvent.mm */,
                                F587868A02DE3B8601EA4122 /* KWQFont.h */,
                                F58784E002DE375901EA4122 /* KWQFont.mm */,
                                F587868D02DE3B8601EA4122 /* KWQFontMetrics.h */,
                                93F198EE08245E59001E9ABC /* html_tableimpl.h in Headers */,
                                93F198EF08245E59001E9ABC /* htmlparser.h in Headers */,
                                93F198F008245E59001E9ABC /* htmltokenizer.h in Headers */,
-                               93F198F108245E59001E9ABC /* khtml_events.h in Headers */,
                                93F198F608245E59001E9ABC /* decoder.h in Headers */,
                                93F198F708245E59001E9ABC /* helper.h in Headers */,
-                               93F198FC08245E59001E9ABC /* khtmllayout.h in Headers */,
                                93F1991708245E59001E9ABC /* dom2_eventsimpl.h in Headers */,
                                93F1991808245E59001E9ABC /* dom2_rangeimpl.h in Headers */,
                                93F1991908245E59001E9ABC /* dom2_traversalimpl.h in Headers */,
                                93F1992E08245E59001E9ABC /* KWQComboBox.h in Headers */,
                                93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
                                93F1993308245E59001E9ABC /* KWQDef.h in Headers */,
-                               93F1993708245E59001E9ABC /* KWQEvent.h in Headers */,
                                93F1993908245E59001E9ABC /* KWQFileButton.h in Headers */,
                                93F1993A08245E59001E9ABC /* KWQFont.h in Headers */,
                                93F1993C08245E59001E9ABC /* KWQFontMetrics.h in Headers */,
                                93F1995508245E59001E9ABC /* KWQKJob.h in Headers */,
                                93F1995608245E59001E9ABC /* KWQKJobClasses.h in Headers */,
                                93F1995B08245E59001E9ABC /* KWQKLocale.h in Headers */,
-                               93F1996008245E59001E9ABC /* KWQKPartsHistoryProvider.h in Headers */,
                                93F1996308245E59001E9ABC /* KWQKSSLKeyGen.h in Headers */,
                                93F1996708245E59001E9ABC /* KWQKURL.h in Headers */,
                                93F1996B08245E59001E9ABC /* KWQLineEdit.h in Headers */,
                                93F199E108245E59001E9ABC /* KWQTextUtilities.h in Headers */,
                                93F199E508245E59001E9ABC /* html_canvasimpl.h in Headers */,
                                93F199E708245E59001E9ABC /* KWQClipboard.h in Headers */,
-                               93F199EA08245E59001E9ABC /* KWQFoundationExtras.h in Headers */,
                                93F199EC08245E59001E9ABC /* xsl_stylesheetimpl.h in Headers */,
                                93F199ED08245E59001E9ABC /* xslt_processorimpl.h in Headers */,
                                93F199EE08245E59001E9ABC /* formdata.h in Headers */,
                                9380F47409A11AB4001FDB34 /* Widget.h in Headers */,
                                ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */,
                                BCC47E2709A3D6F100ADB771 /* FontFamily.h in Headers */,
+                               935C475D09AC4CA000A6AAB4 /* History.h in Headers */,
+                               935C476109AC4CD100A6AAB4 /* Length.h in Headers */,
+                               935C476309AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h in Headers */,
+                               935C476809AC4D4300A6AAB4 /* KeyEvent.h in Headers */,
+                               935C476909AC4D4300A6AAB4 /* MouseEvent.h in Headers */,
+                               935C476B09AC4D4F00A6AAB4 /* WheelEvent.h in Headers */,
+                               935C476D09AC4D6300A6AAB4 /* FoundationExtras.h in Headers */,
+                               935C477509AC4D8E00A6AAB4 /* GapRects.h in Headers */,
                                651B4D8609AC83370029F1EF /* QStringList.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                                93F19A1308245E59001E9ABC /* KWQCharsets.cpp in Sources */,
                                93F19A1708245E59001E9ABC /* KWQComboBox.mm in Sources */,
                                93F19A1808245E59001E9ABC /* KWQCString.cpp in Sources */,
-                               93F19A1C08245E59001E9ABC /* KWQEvent.mm in Sources */,
                                93F19A1E08245E59001E9ABC /* KWQFont.mm in Sources */,
                                93F19A1F08245E59001E9ABC /* KWQFontMetrics.mm in Sources */,
                                93F19A2208245E59001E9ABC /* KWQGuardedPtr.cpp in Sources */,
                                93F19A2408245E59001E9ABC /* KWQKConfigBase.mm in Sources */,
                                93F19A2508245E59001E9ABC /* KWQKCookieJar.mm in Sources */,
                                93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */,
-                               93F19A2908245E59001E9ABC /* KWQKHistoryProvider.mm in Sources */,
                                93F19A2E08245E59001E9ABC /* KWQKJavaAppletWidget.mm in Sources */,
                                93F19A3008245E59001E9ABC /* KWQKJobClasses.mm in Sources */,
                                93F19A3108245E59001E9ABC /* KWQLoader.mm in Sources */,
                                93F19A5D08245E59001E9ABC /* WebCoreImageRendererFactory.m in Sources */,
                                93F19A5E08245E59001E9ABC /* WebCoreTextRendererFactory.mm in Sources */,
                                93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */,
-                               93F19A6008245E59001E9ABC /* khtml_events.cpp in Sources */,
                                93F19A7308245E59001E9ABC /* dom2_events.cpp in Sources */,
                                93F19A7508245E59001E9ABC /* dom2_traversal.cpp in Sources */,
                                93F19A8308245E59001E9ABC /* kjs_binding.cpp in Sources */,
                                9380F68709A143B2001FDB34 /* FrameViewMac.mm in Sources */,
                                BCC47E2309A3D6B300ADB771 /* FontFamilyMac.mm in Sources */,
                                BCC47E2609A3D6F100ADB771 /* FontFamily.cpp in Sources */,
+                               935C475F09AC4CAE00A6AAB4 /* HistoryMac.mm in Sources */,
+                               935C477009AC4D7300A6AAB4 /* KeyEventMac.mm in Sources */,
+                               935C477109AC4D7300A6AAB4 /* MouseEventMac.mm in Sources */,
+                               935C477309AC4D7700A6AAB4 /* WheelEventMac.mm in Sources */,
                                651B4D8509AC83370029F1EF /* QStringList.cpp in Sources */,
                                651B4D8F09AC859F0029F1EF /* QStringListMac.mm in Sources */,
                        );
index d20012c..139f785 100644 (file)
@@ -1,7 +1,7 @@
 #include "config.h"
 
 // These are generated files.
-// I keep modifying this line here to make the file rebuild.
+// I keep modifying this line to make the file rebuild.
 
 #include "JSAttr.cpp"
 #include "JSCharacterData.cpp"
index 07bb5c5..4f9bc02 100644 (file)
@@ -1,7 +1,7 @@
 #include "config.h"
 
 // These are generated files.
-// I keep modifying and rewording this line here to make the file rebuild.
+// I keep modifying this line to make the file rebuild.
 
 #include "JSMutationEvent.cpp"
 #include "JSWheelEvent.cpp"
index 3910063..78494a7 100644 (file)
@@ -37,8 +37,8 @@
 #import "DocumentFragmentImpl.h"
 #import "DocumentImpl.h"
 #import "DocumentTypeImpl.h"
+#import "FoundationExtras.h"
 #import "HTMLElementImpl.h"
-#import "KWQFoundationExtras.h"
 #import "MacFrame.h"
 #import "NodeListImpl.h"
 #import "PlatformString.h"
index 12d7d4a..83657be 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "DOMInternal.h"
 #import "Color.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "css_base.h"
 #import "css_ruleimpl.h"
 #import "css_stylesheetimpl.h"
index d4e933e..4bc972c 100644 (file)
@@ -60,7 +60,7 @@
 #import "DOMInternal.h"
 #import "DOMHTMLInternal.h"
 #import <kxmlcore/Assertions.h>
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 
 using namespace DOM;
 using namespace DOM::HTMLNames;
similarity index 81%
rename from WebCore/kwq/KWQKPartsHistoryProvider.h
rename to WebCore/bridge/History.h
index 6574116..d4ebce0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef HISTORYPROVIDER_H_
-#define HISTORYPROVIDER_H_
+#ifndef HISTORY_H
+#define HISTORY_H
 
-#include "KWQObject.h"
+class QString;
 
-namespace KParts {
+namespace WebCore {
 
-class HistoryProvider : public QObject {
-public:
-    static HistoryProvider *self();
-
-    bool contains(const QString &) const;
-};
+    bool historyContains(const QString&);
 
 }
 
similarity index 74%
rename from WebCore/kwq/KWQKHistoryProvider.mm
rename to WebCore/bridge/mac/HistoryMac.mm
index 9dc57e1..47f2342 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#include "config.h"
-#import "KWQKPartsHistoryProvider.h"
+#import "config.h"
+#import "History.h"
 
-#import "KWQExceptions.h"
-#import "KWQKURL.h"
+#import "QString.h"
 #import "WebCoreHistory.h"
 
-namespace KParts {
+namespace WebCore {
 
-HistoryProvider *HistoryProvider::self()
-{
-    static HistoryProvider instance;
-    return &instance;
-}
-
-bool HistoryProvider::contains(const QString &s) const
+bool historyContains(const QString& s)
 {
     // the other side of the bridge is careful not to throw exceptions here
-
-    if (s.hasFastLatin1()) {
+    if (s.hasFastLatin1())
         return [[WebCoreHistory historyProvider] containsItemForURLLatin1:s.latin1() length:s.length()];
-    } else {
-        return [[WebCoreHistory historyProvider] containsItemForURLUnicode:(UniChar *)s.unicode() length:s.length()];
-    }
+    return [[WebCoreHistory historyProvider] containsItemForURLUnicode:(UniChar *)s.unicode() length:s.length()];
 }
 
-} // namespace KParts
+}
index 3391b02..c19f81b 100644 (file)
@@ -139,7 +139,7 @@ public:
     virtual void setTitle(const DOMString &);
     virtual void setStatusBarText(const String&);
 
-    virtual void urlSelected(const KURL &url, int button, int state, const URLArgs &args);
+    virtual void urlSelected(const KURL&, const URLArgs&);
 
     virtual ObjectContentType objectContentType(const KURL& url, const QString& mimeType);
     virtual Plugin* createPlugin(const KURL& url, const QStringList& paramNames, const QStringList& paramValues, const QString& mimeType);
@@ -233,7 +233,7 @@ public:
     bool sendContextMenuEvent(NSEvent *);
 
     bool passMouseDownEventToWidget(Widget *);
-    virtual bool passSubframeEventToSubframe(NodeImpl::MouseEvent &);
+    virtual bool passSubframeEventToSubframe(MouseEventWithHitTestResults &);
     virtual bool passWheelEventToChildWidget(NodeImpl *);
     
     virtual void clearRecordedFormValues();
@@ -318,9 +318,9 @@ protected:
     virtual void redirectionTimerFired(Timer<Frame>*);
 
 private:
-    virtual void khtmlMousePressEvent(MousePressEvent *);
-    virtual void khtmlMouseMoveEvent(MouseMoveEvent *);
-    virtual void khtmlMouseReleaseEvent(MouseReleaseEvent *);
+    virtual void khtmlMousePressEvent(MouseEventWithHitTestResults *);
+    virtual void khtmlMouseMoveEvent(MouseEventWithHitTestResults *);
+    virtual void khtmlMouseReleaseEvent(MouseEventWithHitTestResults *);
     
     NSView *mouseDownViewIfStillGood();
 
index a5db605..e79a81d 100644 (file)
@@ -31,6 +31,7 @@
 #import "Cursor.h"
 #import "DOMInternal.h"
 #import "EventNames.h"
+#import "FoundationExtras.h"
 #import "FramePrivate.h"
 #import "FrameView.h"
 #import "HTMLFormElementImpl.h"
 #import "KWQAccObjectCache.h"
 #import "KWQClipboard.h"
 #import "KWQEditCommand.h"
-#import "KWQEvent.h"
 #import "KWQExceptions.h"
 #import "KWQFormData.h"
-#import "KWQFoundationExtras.h"
 #import "KWQKJobClasses.h"
 #import "KWQLogging.h"
 #import "KWQPageState.h"
@@ -51,6 +50,9 @@
 #import "KWQScrollBar.h"
 #import "KWQTextCodec.h"
 #import "KWQWindowWidget.h"
+#import "KeyEvent.h"
+#import "MouseEvent.h"
+#import "MouseEventWithHitTestResults.h"
 #import "Plugin.h"
 #import "RenderTableCell.h"
 #import "SelectionController.h"
@@ -59,6 +61,7 @@
 #import "WebCoreGraphicsBridge.h"
 #import "WebCoreViewFactory.h"
 #import "WebDashboardRegion.h"
+#import "WheelEvent.h"
 #import "css_computedstyle.h"
 #import "csshelper.h"
 #import "dom2_eventsimpl.h"
@@ -66,7 +69,6 @@
 #import "dom_position.h"
 #import "html_documentimpl.h"
 #import "html_tableimpl.h"
-#import "khtml_events.h"
 #import "kjs_binding.h"
 #import "kjs_window.h"
 #import "render_canvas.h"
@@ -542,11 +544,11 @@ void MacFrame::frameDetached()
     KWQ_UNBLOCK_EXCEPTIONS;
 }
 
-void MacFrame::urlSelected(const KURL &url, int button, int state, const URLArgs &args)
+void MacFrame::urlSelected(const KURL& url, const URLArgs& args)
 {
     KWQ_BLOCK_EXCEPTIONS;
 
-    NSString *referrer;
+    NSStringreferrer;
     DOMString argsReferrer = args.metaData().get("referrer");
     if (!argsReferrer.isEmpty())
         referrer = argsReferrer;
@@ -796,7 +798,7 @@ bool MacFrame::wheelEvent(NSEvent *event)
         NSEvent *oldCurrentEvent = _currentEvent;
         _currentEvent = KWQRetain(event);
 
-        QWheelEvent qEvent(event);
+        WheelEvent qEvent(event);
         v->viewportWheelEvent(&qEvent);
 
         ASSERT(_currentEvent == event);
@@ -1404,15 +1406,15 @@ bool MacFrame::keyEvent(NSEvent *event)
     NSEvent *oldCurrentEvent = _currentEvent;
     _currentEvent = KWQRetain(event);
 
-    QKeyEvent qEvent(event);
+    KeyEvent qEvent(event);
     result = !node->dispatchKeyEvent(&qEvent);
 
     // We want to send both a down and a press for the initial key event.
-    // To get KHTML to do this, we send a second KeyPress QKeyEvent with "is repeat" set to true,
+    // To get KHTML to do this, we send a second KeyPress with "is repeat" set to true,
     // which causes it to send a press to the DOM.
     // That's not a great hack; it would be good to do this in a better way.
     if ([event type] == NSKeyDown && ![event isARepeat]) {
-        QKeyEvent repeatEvent(event, true);
+        KeyEvent repeatEvent(event, true);
         if (!node->dispatchKeyEvent(&repeatEvent)) {
             result = true;
         }
@@ -1429,7 +1431,7 @@ bool MacFrame::keyEvent(NSEvent *event)
     return false;
 }
 
-void MacFrame::khtmlMousePressEvent(MousePressEvent *event)
+void MacFrame::khtmlMousePressEvent(MouseEventWithHitTestResults *event)
 {
     bool singleClick = [_currentEvent clickCount] <= 1;
 
@@ -1641,7 +1643,7 @@ bool MacFrame::dragHysteresisExceeded(float dragLocationX, float dragLocationY)
     return deltaX >= threshold || deltaY >= threshold;
 }
 
-void MacFrame::khtmlMouseMoveEvent(MouseMoveEvent *event)
+void MacFrame::khtmlMouseMoveEvent(MouseEventWithHitTestResults *event)
 {
     KWQ_BLOCK_EXCEPTIONS;
 
@@ -1860,7 +1862,7 @@ bool MacFrame::tryPaste()
     return !dispatchCPPEvent(pasteEvent, KWQClipboard::Readable);
 }
 
-void MacFrame::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
+void MacFrame::khtmlMouseReleaseEvent(MouseEventWithHitTestResults *event)
 {
     NSView *view = mouseDownViewIfStillGood();
     if (!view) {
@@ -1882,13 +1884,13 @@ void MacFrame::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
     _sendingEventToSubview = false;
 }
 
-bool MacFrame::passSubframeEventToSubframe(NodeImpl::MouseEvent &event)
+bool MacFrame::passSubframeEventToSubframe(MouseEventWithHitTestResults &event)
 {
     KWQ_BLOCK_EXCEPTIONS;
 
     switch ([_currentEvent type]) {
         case NSMouseMoved: {
-            NodeImpl *node = event.innerNode.get();
+            NodeImpl *node = event.innerNode();
             if (!node)
                 return false;
             RenderObject *renderer = node->renderer();
@@ -1905,7 +1907,7 @@ bool MacFrame::passSubframeEventToSubframe(NodeImpl::MouseEvent &event)
         }
         
         case NSLeftMouseDown: {
-            NodeImpl *node = event.innerNode.get();
+            NodeImpl *node = event.innerNode();
             if (!node) {
                 return false;
             }
@@ -2013,7 +2015,7 @@ void MacFrame::mouseDown(NSEvent *event)
     _mouseDownMayStartDrag = false;
     _mouseDownMayStartSelect = false;
 
-    QMouseEvent kEvent(QEvent::MouseButtonPress, event);
+    MouseEvent kEvent(event);
     v->viewportMousePressEvent(&kEvent);
     
     ASSERT(_currentEvent == event);
@@ -2035,7 +2037,7 @@ void MacFrame::mouseDragged(NSEvent *event)
     NSEvent *oldCurrentEvent = _currentEvent;
     _currentEvent = KWQRetain(event);
 
-    QMouseEvent kEvent(QEvent::MouseMove, event);
+    MouseEvent kEvent(event);
     v->viewportMouseMoveEvent(&kEvent);
     
     ASSERT(_currentEvent == event);
@@ -2066,10 +2068,10 @@ void MacFrame::mouseUp(NSEvent *event)
     // treated as another double click. Hence the "% 2" below.
     int clickCount = [event clickCount];
     if (clickCount > 0 && clickCount % 2 == 0) {
-        QMouseEvent doubleClickEvent(QEvent::MouseButtonDblClick, event);
+        MouseEvent doubleClickEvent(event);
         v->viewportMouseDoubleClickEvent(&doubleClickEvent);
     } else {
-        QMouseEvent releaseEvent(QEvent::MouseButtonRelease, event);
+        MouseEvent releaseEvent(event);
         v->viewportMouseReleaseEvent(&releaseEvent);
     }
     
@@ -2157,7 +2159,7 @@ void MacFrame::mouseMoved(NSEvent *event)
     NSEvent *oldCurrentEvent = _currentEvent;
     _currentEvent = KWQRetain(event);
     
-    QMouseEvent kEvent(QEvent::MouseMove, event);
+    MouseEvent kEvent(event);
     v->viewportMouseMoveEvent(&kEvent);
     
     ASSERT(_currentEvent == event);
@@ -2198,19 +2200,17 @@ bool MacFrame::sendContextMenuEvent(NSEvent *event)
     NSEvent *oldCurrentEvent = _currentEvent;
     _currentEvent = KWQRetain(event);
     
-    QMouseEvent qev(QEvent::MouseButtonPress, event);
+    MouseEvent qev(event);
 
     int xm, ym;
     v->viewportToContents(qev.x(), qev.y(), xm, ym);
 
-    NodeImpl::MouseEvent mev(qev.stateAfter(), NodeImpl::MousePress);
-    doc->prepareMouseEvent(false, xm, ym, &mev);
+    MouseEventWithHitTestResults mev = doc->prepareMouseEvent(false, true, false, xm, ym, &qev);
 
-    swallowEvent = v->dispatchMouseEvent(contextmenuEvent,
-        mev.innerNode.get(), true, 0, &qev, true, NodeImpl::MousePress);
+    swallowEvent = v->dispatchMouseEvent(contextmenuEvent, mev.innerNode(), true, 0, &qev, true);
     if (!swallowEvent && !isPointInsideSelection(xm, ym) &&
-        ([_bridge selectWordBeforeMenuEvent] || [_bridge isEditable] || mev.innerNode->isContentEditable())) {
-        selectClosestWordFromMouseEvent(&qev, mev.innerNode.get(), xm, ym);
+        ([_bridge selectWordBeforeMenuEvent] || [_bridge isEditable] || mev.innerNode()->isContentEditable())) {
+        selectClosestWordFromMouseEvent(&qev, mev.innerNode(), xm, ym);
     }
 
     ASSERT(_currentEvent == event);
index 19b638d..b8188e0 100644 (file)
@@ -39,7 +39,7 @@
 #import "KWQClipboard.h"
 #import "KWQEditCommand.h"
 #import "KWQFont.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "KWQLoader.h"
 #import "KWQPageState.h"
 #import "KWQPrinter.h"
diff --git a/WebCore/css/Length.h b/WebCore/css/Length.h
new file mode 100644 (file)
index 0000000..b60181e
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+    This file is part of the KDE libraries
+
+    Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+    Copyright (C) 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 LENGTH_H
+#define LENGTH_H
+
+namespace WebCore {
+
+    const int undefinedLength = -1;
+
+    enum LengthType { Auto, Relative, Percent, Fixed, Static, Intrinsic, MinIntrinsic };
+
+    struct Length {
+        Length() : m_value(0) { }
+        Length(LengthType t) : m_value(t) { }
+        Length(int v, LengthType t, bool q = false) : m_value((v * 16) | (q << 3) | t) { }
+            // FIXME: Doesn't work if the passed-in value is very large!
+
+        bool operator==(const Length& o) const { return m_value == o.m_value; }
+        bool operator!=(const Length& o) const { return m_value != o.m_value; }
+
+        int value() const { return (m_value & ~0xF) / 16; }
+        LengthType type() const { return static_cast<LengthType>(m_value & 7); }
+        bool quirk() const { return (m_value >> 3) & 1; }
+
+        void setValue(LengthType t, int value) { m_value = value * 16 | (m_value & 0x8) | t; }
+        void setValue(int value) { m_value = value * 16 | (m_value & 0xF); }
+
+        // note: works only for certain types, returns undefinedLength otherwise
+        int calcValue(int maxValue) const
+        {
+            switch (type()) {
+                case Fixed:
+                    return value();
+                case Percent:
+                    return maxValue * value() / 100;
+                case Auto:
+                    return maxValue;
+                default:
+                    return undefinedLength;
+            }
+        }
+
+        int calcMinValue(int maxValue) const
+        {
+            switch (type()) {
+                case Fixed:
+                    return value();
+                case Percent:
+                    return maxValue * value() / 100;
+                case Auto:
+                default:
+                    return 0;
+            }
+        }
+
+        bool isAuto() const { return type() == Auto; }
+        bool isRelative() const { return type() == Relative; }
+        bool isPercent() const { return type() == Percent; }
+        bool isFixed() const { return type() == Fixed; }
+        bool isStatic() const { return type() == Static; }
+        bool isIntrinsicOrAuto() const { return type() == Auto || type() == MinIntrinsic || type() == Intrinsic; }
+
+    private:
+        int m_value;
+    };
+
+}
+
+#endif
index c966068..43a53e7 100644 (file)
@@ -31,7 +31,6 @@
 #include "cssvalues.h"
 #include "dom_exception.h"
 #include "font.h"
-#include "khtmllayout.h"
 #include "render_object.h"
 #include "render_style.h"
 #include <kxmlcore/Assertions.h>
@@ -151,11 +150,11 @@ const unsigned numComputedProperties = sizeof(computedProperties) / sizeof(compu
 
 static CSSValueImpl* valueForLength(const Length &length)
 {
-    switch (length.type) {
+    switch (length.type()) {
         case Percent:
-            return new CSSPrimitiveValueImpl(length.length(), CSSPrimitiveValue::CSS_PERCENTAGE);
+            return new CSSPrimitiveValueImpl(length.value(), CSSPrimitiveValue::CSS_PERCENTAGE);
         case khtml::Fixed:
-            return new CSSPrimitiveValueImpl(length.length(), CSSPrimitiveValue::CSS_PX);
+            return new CSSPrimitiveValueImpl(length.value(), CSSPrimitiveValue::CSS_PX);
         default: // FIXME: Intrinsic and MinIntrinsic should probably return keywords.
             return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
     }
@@ -366,15 +365,15 @@ PassRefPtr<CSSValueImpl> CSSComputedStyleDeclarationImpl::getPropertyCSSValue(in
         String string;
         Length length(style->backgroundXPosition());
         if (length.isPercent())
-            string = numberAsString(length.length()) + "%";
+            string = numberAsString(length.value()) + "%";
         else
-            string = numberAsString(length.minWidth(renderer->contentWidth()));
+            string = numberAsString(length.calcMinValue(renderer->contentWidth()));
         string += " ";
         length = style->backgroundYPosition();
         if (length.isPercent())
-            string += numberAsString(length.length()) + "%";
+            string += numberAsString(length.value()) + "%";
         else
-            string += numberAsString(length.minWidth(renderer->contentWidth()));
+            string += numberAsString(length.calcMinValue(renderer->contentWidth()));
         return new CSSPrimitiveValueImpl(string, CSSPrimitiveValue::CSS_STRING);
     }
     case CSS_PROP_BACKGROUND_POSITION_X:
@@ -698,7 +697,7 @@ PassRefPtr<CSSValueImpl> CSSComputedStyleDeclarationImpl::getPropertyCSSValue(in
         return new CSSPrimitiveValueImpl(style->lineClamp(), CSSPrimitiveValue::CSS_PERCENTAGE);
     case CSS_PROP_LINE_HEIGHT: {
         Length length(style->lineHeight());
-        if (length.value < 0)
+        if (length.value() < 0)
             return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
         if (length.isPercent()) {
             // This is imperfect, because it doesn't include the zoom factor and the real computation
@@ -706,10 +705,10 @@ PassRefPtr<CSSValueImpl> CSSComputedStyleDeclarationImpl::getPropertyCSSValue(in
             // On the other hand, since font-size doesn't include the zoom factor, we really can't do
             // that here either.
             float fontSize = style->htmlFont().getFontDef().specifiedSize;
-            return new CSSPrimitiveValueImpl((int)(length.length() * fontSize) / 100, CSSPrimitiveValue::CSS_PX);
+            return new CSSPrimitiveValueImpl((int)(length.value() * fontSize) / 100, CSSPrimitiveValue::CSS_PX);
         }
         else {
-            return new CSSPrimitiveValueImpl(length.length(), CSSPrimitiveValue::CSS_PX);
+            return new CSSPrimitiveValueImpl(length.value(), CSSPrimitiveValue::CSS_PX);
         }
     }
     case CSS_PROP_LIST_STYLE_IMAGE:
@@ -1192,10 +1191,10 @@ PassRefPtr<CSSValueImpl> CSSComputedStyleDeclarationImpl::getPropertyCSSValue(in
 
                 region->m_label = styleRegion.label;
                 LengthBox offset = styleRegion.offset;
-                region->setTop(new CSSPrimitiveValueImpl(offset.top.value, CSSPrimitiveValue::CSS_PX));
-                region->setRight(new CSSPrimitiveValueImpl(offset.right.value, CSSPrimitiveValue::CSS_PX));
-                region->setBottom(new CSSPrimitiveValueImpl(offset.bottom.value, CSSPrimitiveValue::CSS_PX));
-                region->setLeft(new CSSPrimitiveValueImpl(offset.left.value, CSSPrimitiveValue::CSS_PX));
+                region->setTop(new CSSPrimitiveValueImpl(offset.top.value(), CSSPrimitiveValue::CSS_PX));
+                region->setRight(new CSSPrimitiveValueImpl(offset.right.value(), CSSPrimitiveValue::CSS_PX));
+                region->setBottom(new CSSPrimitiveValueImpl(offset.bottom.value(), CSSPrimitiveValue::CSS_PX));
+                region->setLeft(new CSSPrimitiveValueImpl(offset.left.value(), CSSPrimitiveValue::CSS_PX));
                 region->m_isRectangle = (styleRegion.type == StyleDashboardRegion::Rectangle); 
                 region->m_isCircle = (styleRegion.type == StyleDashboardRegion::Circle);
 
index 8c7e70b..a88bbf0 100644 (file)
@@ -2,6 +2,7 @@
  * This file is part of the CSS implementation for KDE.
  *
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 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
  * Boston, MA 02111-1307, USA.
  *
  */
+
 #include "config.h"
 #include "csshelper.h"
 
-#include <qfontmetrics.h>
-
-#include "rendering/render_style.h"
-#include "css_valueimpl.h"
-#include "dom/css_value.h"
-#include "helper.h"
-#include "StringImpl.h"
-#include "khtml_settings.h"
-
-using namespace DOM;
-using namespace khtml;
+#include "PlatformString.h"
 
+namespace WebCore {
 
-DOMString khtml::parseURL(const DOMString &url)
+String parseURL(const String& url)
 {
-    DOMStringImpl* i = url.impl();
-    if(!i) return DOMString();
+    StringImpl* i = url.impl();
+    if(!i) return String();
 
     int o = 0;
     int l = i->l;
@@ -67,7 +60,7 @@ DOMString khtml::parseURL(const DOMString &url)
     while(o < l && (i->s[o] <= ' ')) { o++; l--; }
     while(l > 0 && (i->s[o+l-1] <= ' ')) l--;
 
-    DOMStringImpl* j = new DOMStringImpl(i->s+o,l);
+    StringImpl* j = new StringImpl(i->s+o,l);
 
     int nl = 0;
     for(int k = o; k < o+l; k++)
@@ -78,3 +71,5 @@ DOMString khtml::parseURL(const DOMString &url)
 
     return j;
 }
+
+}
index b6ff086..6808412 100644 (file)
  * Boston, MA 02111-1307, USA.
  *
  */
+
 #ifndef css_helper_h
 #define css_helper_h
 
-#include "Color.h"
-#include <qfont.h>
-
-#include "PlatformString.h"
-
-class QPaintDeviceMetrics;
-class KHTMLSettings;
+namespace WebCore {
 
-namespace DOM
-{
-    class CSSPrimitiveValueImpl;
-};
-
-namespace khtml
-{
-    class RenderStyle;
+    class String;
 
     /*
      * mostly just removes the url("...") brace
      */
-    DOM::DOMString parseURL(const DOM::DOMString &url);
-
-};
-
+    String parseURL(const String &url);
 
+}
 
 #endif
index a197159..e846066 100644 (file)
 #include "Frame.h"
 #include "FrameView.h"
 #include "HTMLElementImpl.h"
-#include "KWQKPartsHistoryProvider.h"
+#include "History.h"
 #include "UserAgentStyleSheets.h"
 #include "css_rule.h"
 #include "css_ruleimpl.h"
 #include "css_stylesheetimpl.h"
 #include "css_value.h"
 #include "css_valueimpl.h"
-#include "csshelper.h"
 #include "cssproperties.h"
 #include "cssvalues.h"
 #include "font.h"
@@ -43,7 +42,6 @@
 #include "html_documentimpl.h"
 #include "htmlnames.h"
 #include "khtml_settings.h"
-#include "khtmllayout.h"
 #include "loader.h"
 #include "render_object.h"
 #include "render_style.h"
@@ -591,7 +589,7 @@ static void checkPseudoState( ElementImpl *e, bool checkVisited = true )
             u.prepend(currentEncodedURL->path);
         cleanpath( u );
     }
-    pseudoState = KParts::HistoryProvider::self()->contains(u) ? PseudoVisited : PseudoLink;
+    pseudoState = historyContains(u) ? PseudoVisited : PseudoLink;
 }
 
 #ifdef STYLE_SHARING_STATS
@@ -2672,7 +2670,7 @@ void CSSStyleSelector::applyProperty( int id, CSSValueImpl *value )
             if (id == CSS_PROP_PADDING_LEFT || id == CSS_PROP_PADDING_RIGHT ||
                 id == CSS_PROP_PADDING_TOP || id == CSS_PROP_PADDING_BOTTOM)
                 // Padding can't be negative
-                apply = !((l.isFixed() || l.isPercent()) && l.width(100) < 0);
+                apply = !((l.isFixed() || l.isPercent()) && l.calcValue(100) < 0);
             else
                 apply = true;
         }
@@ -4169,7 +4167,7 @@ float CSSStyleSelector::getComputedSizeFromSpecifiedSize(bool isAbsoluteSize, fl
     int minSize = settings->minFontSize();
     int minLogicalSize = settings->minLogicalFontSize();
 
-    float zoomPercent = (!printpainter && view) ? view->frame()->zoomFactor()/100.0f : 1.0f;
+    float zoomPercent = view ? view->frame()->zoomFactor()/100.0f : 1.0f;
     float zoomedSize = specifiedSize * zoomPercent;
 
     // Apply the hard minimum first.  We only apply the hard minimum if after zooming we're still too small.
index 66006e9..30503c2 100644 (file)
 #include "config.h"
 #include "DocumentImpl.h"
 
+#include "CDATASectionImpl.h"
+#include "CommentImpl.h"
 #include "DOMImplementationImpl.h"
 #include "DocLoader.h"
 #include "DocumentFragmentImpl.h"
 #include "DocumentTypeImpl.h"
+#include "EditingTextImpl.h"
 #include "EventNames.h"
 #include "Frame.h"
 #include "FrameTree.h"
 #include "FrameView.h"
-#include "SelectionController.h"
+#include "HTMLNameCollectionImpl.h"
 #include "KWQAccObjectCache.h"
-#include "KWQEvent.h"
 #include "KWQLogging.h"
+#include "KeyEvent.h"
+#include "MouseEventWithHitTestResults.h"
 #include "NameNodeListImpl.h"
 #include "SegmentedString.h"
+#include "SelectionController.h"
 #include "SystemTime.h"
+#include "VisiblePosition.h"
 #include "css_stylesheetimpl.h"
 #include "css_valueimpl.h"
 #include "csshelper.h"
@@ -50,9 +56,6 @@
 #include "dom2_rangeimpl.h"
 #include "dom2_viewsimpl.h"
 #include "dom_exception.h"
-#include "CDATASectionImpl.h"
-#include "CommentImpl.h"
-#include "EditingTextImpl.h"
 #include "dom_xmlimpl.h"
 #include "ecma/kjs_binding.h"
 #include "ecma/kjs_proxy.h"
 #include "render_arena.h"
 #include "render_canvas.h"
 #include "render_frames.h"
-#include "VisiblePosition.h"
 #include "visible_text.h"
 #include "xml_tokenizer.h"
 #include <qregexp.h>
-#include "HTMLNameCollectionImpl.h"
 
 // FIXME: We want to cut the remaining HTML dependencies so that we don't need to include these files.
 #include "HTMLInputElementImpl.h"
@@ -1633,41 +1634,30 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con
     }
 }
 
-bool DocumentImpl::prepareMouseEvent(bool readonly, int x, int y, MouseEvent* ev)
-{
-    return prepareMouseEvent(readonly, ev->type == MousePress, x, y, ev);
-}
-
-bool DocumentImpl::prepareMouseEvent(bool readonly, bool active, int _x, int _y, MouseEvent *ev)
+MouseEventWithHitTestResults DocumentImpl::prepareMouseEvent(bool readonly, bool active, bool mouseMove,
+    int x, int y, MouseEvent* event)
 {
-    if (renderer()) {
-        assert(renderer()->isCanvas());
-        RenderObject::NodeInfo renderInfo(readonly, active, ev->type == MouseMove);
-        bool isInside = renderer()->layer()->hitTest(renderInfo, _x, _y);
-        ev->innerNode = renderInfo.innerNode();
-
-        if (renderInfo.URLElement()) {
-            assert(renderInfo.URLElement()->isElementNode());
-            ElementImpl* e =  static_cast<ElementImpl*>(renderInfo.URLElement());
-            DOMString href = parseURL(e->getAttribute(hrefAttr));
-            DOMString target = e->getAttribute(targetAttr);
-
-            if (!target.isNull() && !href.isNull()) {
-                ev->target = target;
-                ev->url = href;
-            }
-            else
-                ev->url = href;
-        }
+    if (!renderer())
+        return MouseEventWithHitTestResults();
 
-        if (!readonly)
-            updateRendering();
+    assert(renderer()->isCanvas());
+    RenderObject::NodeInfo renderInfo(readonly, active, mouseMove);
+    renderer()->layer()->hitTest(renderInfo, x, y);
 
-        return isInside;
+    String href;
+    String target;
+    if (renderInfo.URLElement()) {
+        assert(renderInfo.URLElement()->isElementNode());
+        ElementImpl* e = static_cast<ElementImpl*>(renderInfo.URLElement());
+        href = parseURL(e->getAttribute(hrefAttr));
+        if (!href.isNull())
+            target = e->getAttribute(targetAttr);
     }
 
+    if (!readonly)
+        updateRendering();
 
-    return false;
+    return MouseEventWithHitTestResults(event, href, target, renderInfo.innerNode());
 }
 
 // DOM Section 1.1.1
@@ -2226,12 +2216,12 @@ void DocumentImpl::handleWindowEvent(EventImpl *evt, bool useCapture)
 void DocumentImpl::defaultEventHandler(EventImpl *evt)
 {
     // handle accesskey
-    if (evt->type()==keydownEvent) {
-        KeyboardEventImpl *kevt = static_cast<KeyboardEventImpl *>(evt);
+    if (evt->type() == keydownEvent) {
+        KeyboardEventImplkevt = static_cast<KeyboardEventImpl *>(evt);
         if (kevt->ctrlKey()) {
-            QKeyEvent *qevt = kevt->qKeyEvent();
-            DOMString key = (qevt ? qevt->unmodifiedText() : kevt->keyIdentifier()).lower();
-            ElementImpl *elem = getElementByAccessKey(key);
+            KeyEvent* ev = kevt->keyEvent();
+            String key = (ev ? ev->unmodifiedText() : kevt->keyIdentifier()).lower();
+            ElementImplelem = getElementByAccessKey(key);
             if (elem) {
                 elem->accessKeyAction(false);
                 evt->setDefaultHandled();
index c4e76f7..8e957e5 100644 (file)
@@ -81,6 +81,8 @@ namespace WebCore {
     class NodeFilterImpl;
     class NodeIteratorImpl;
     class NodeListImpl;
+    class MouseEvent;
+    class MouseEventWithHitTestResults;
     class ProcessingInstructionImpl;
     class RangeImpl;
     class RegisteredEventListener;
@@ -334,8 +336,7 @@ public:
     void resetVisitedLinkColor();
     void resetActiveLinkColor();
     
-    bool prepareMouseEvent(bool readonly, int x, int y, MouseEvent* ev);
-    bool prepareMouseEvent(bool readonly, bool active, int x, int y, MouseEvent *ev);
+    MouseEventWithHitTestResults prepareMouseEvent(bool readonly, bool active, bool mouseMove, int x, int y, MouseEvent*);
 
     virtual bool childAllowed(NodeImpl*);
     virtual bool childTypeAllowed(unsigned short nodeType);
index ffbbbcb..cbf31e8 100644 (file)
 #include "config.h"
 #include "NodeImpl.h"
 
+#include "AtomicString.h"
 #include "ChildNodeListImpl.h"
 #include "DOMImplementationImpl.h"
 #include "DocumentImpl.h"
 #include "EventNames.h"
 #include "Frame.h"
 #include "FrameView.h"
-#include "KWQEvent.h"
+#include "MouseEvent.h"
+#include "TextImpl.h"
+#include "WheelEvent.h"
 #include "dom2_events.h"
 #include "dom2_eventsimpl.h"
-#include "AtomicString.h"
 #include "dom_exception.h"
 #include "dom_node.h"
-#include "TextImpl.h"
 #include "htmlediting.h"
 #include "htmlnames.h"
 #include "kjs_binding.h"
@@ -638,64 +639,19 @@ void NodeImpl::dispatchWindowEvent(const AtomicString &eventType, bool canBubble
      }
 }
 
-bool NodeImpl::dispatchMouseEvent(QMouseEvent *_mouse, const AtomicString &overrideType,
-    int overrideDetail, NodeImpl* relatedTarget)
+bool NodeImpl::dispatchMouseEvent(MouseEvent* _mouse, const AtomicString& eventType,
+    int detail, NodeImpl* relatedTarget)
 {
     assert(!eventDispatchForbidden());
-    int detail = overrideDetail; // defaults to 0
-    AtomicString eventType;
-    if (!overrideType.isEmpty()) {
-        eventType = overrideType;
-    } else {
-        switch (_mouse->type()) {
-            case QEvent::MouseButtonPress:
-                eventType = mousedownEvent;
-                break;
-            case QEvent::MouseButtonRelease:
-                eventType = mouseupEvent;
-                break;
-            case QEvent::MouseButtonDblClick:
-                eventType = clickEvent;
-                detail = _mouse->clickCount();
-                break;
-            case QEvent::MouseMove:
-                eventType = mousemoveEvent;
-                break;
-            default:
-                break;
-        }
-    }
 
     int clientX = 0;
     int clientY = 0;
     if (FrameView *view = getDocument()->view())
         view->viewportToContents(_mouse->x(), _mouse->y(), clientX, clientY);
-    int screenX = _mouse->globalX();
-    int screenY = _mouse->globalY();
-
-    int button = -1;
-    switch (_mouse->button()) {
-        case Qt::LeftButton:
-            button = 0;
-            break;
-        case Qt::MidButton:
-            button = 1;
-            break;
-        case Qt::RightButton:
-            button = 2;
-            break;
-        default:
-            break;
-    }
 
-    bool ctrlKey = (_mouse->state() & Qt::ControlButton);
-    bool altKey = (_mouse->state() & Qt::AltButton);
-    bool shiftKey = (_mouse->state() & Qt::ShiftButton);
-    bool metaKey = (_mouse->state() & Qt::MetaButton);
-    
-    return dispatchMouseEvent(eventType, button, detail,
-        clientX, clientY, screenX, screenY,
-        ctrlKey, altKey, shiftKey, metaKey,
+    return dispatchMouseEvent(eventType, _mouse->button(), detail,
+        clientX, clientY, _mouse->globalX(), _mouse->globalY(),
+        _mouse->ctrlKey(), _mouse->altKey(), _mouse->shiftKey(), _mouse->metaKey(),
         false, relatedTarget);
 }
 
@@ -841,7 +797,7 @@ bool NodeImpl::dispatchSubtreeModifiedEvent(bool sendChildrenChanged)
                          true,false,0,DOMString(),DOMString(),DOMString(),0),exceptioncode,true);
 }
 
-bool NodeImpl::dispatchKeyEvent(QKeyEvent *key)
+bool NodeImpl::dispatchKeyEvent(KeyEvent* key)
 {
     assert(!eventDispatchForbidden());
     int exceptioncode = 0;
@@ -857,7 +813,7 @@ bool NodeImpl::dispatchKeyEvent(QKeyEvent *key)
     return r;
 }
 
-void NodeImpl::dispatchWheelEvent(QWheelEvent *e)
+void NodeImpl::dispatchWheelEvent(WheelEvent *e)
 {
     assert(!eventDispatchForbidden());
     if (e->delta() == 0)
@@ -875,11 +831,9 @@ void NodeImpl::dispatchWheelEvent(QWheelEvent *e)
     int y;
     view->viewportToContents(e->x(), e->y(), x, y);
 
-    int state = e->state();
-
-    RefPtr<WheelEventImpl> we = new WheelEventImpl(e->orientation() == Qt::Horizontal, e->delta(),
+    RefPtr<WheelEventImpl> we = new WheelEventImpl(e->isHorizontal(), e->delta(),
         getDocument()->defaultView(), e->globalX(), e->globalY(), x, y,
-        state & Qt::ControlButton, state & Qt::AltButton, state & Qt::ShiftButton, state & Qt::MetaButton);
+        e->ctrlKey(), e->altKey(), e->shiftKey(), e->metaKey());
 
     int exceptionCode = 0;
     if (!dispatchEvent(we, exceptionCode, true))
index 6bf2da2..0674783 100644 (file)
 #include <kxmlcore/HashSet.h>
 #include <kxmlcore/PassRefPtr.h>
 
-class QKeyEvent;
-class QMouseEvent;
 class QStringList;
 class QTextStream;
-class QWheelEvent;
 class RenderArena;
 
 template <typename T> class QPtrList;
@@ -50,12 +47,15 @@ class ElementImpl;
 class EventImpl;
 class EventListener;
 class IntRect;
+class KeyEvent;
+class MouseEvent;
 class NamedAttrMapImpl;
 class NodeListImpl;
 class QualifiedName;
 class RegisteredEventListener;
 class RenderObject;
 class RenderStyle;
+class WheelEvent;
 
 typedef int ExceptionCode;
 
@@ -180,29 +180,6 @@ public:
     // but making parsing a special case in this respect should be avoided if possible.
     virtual void closeRenderer() { }
 
-    // FIXME: Move this MouseEvent stuff somewhere else and reconcile with WebCore::MouseEvent.
-    // MouseEvent is not used in NodeImpl at all.
-    enum MouseEventType {
-        MousePress,
-        MouseRelease,
-        MouseClick,
-        MouseDblClick,
-        MouseMove
-    };
-    struct MouseEvent
-    {
-        MouseEvent(int b, MouseEventType t, const DOMString& u = DOMString(),
-            const DOMString& ta = DOMString(), PassRefPtr<NodeImpl> n = 0)
-            : button(b), type(t), url(u), target(ta), innerNode(n)
-        { }
-
-        int button;
-        MouseEventType type;
-        DOMString url; // url under mouse or empty
-        DOMString target;
-        RefPtr<NodeImpl> innerNode;
-    };
-
     // For <link> and <style> elements.
     virtual void sheetLoaded() { }
 
@@ -275,8 +252,8 @@ public:
     bool dispatchGenericEvent(PassRefPtr<EventImpl>, ExceptionCode&, bool tempEvent = false);
     bool dispatchHTMLEvent(const AtomicString& eventType, bool canBubble, bool cancelable);
     void dispatchWindowEvent(const AtomicString& eventType, bool canBubble, bool cancelable);
-    bool dispatchMouseEvent(QMouseEvent*, const AtomicString& overrideType,
-        int overrideDetail = 0, NodeImpl* relatedTarget = 0);
+    bool dispatchMouseEvent(MouseEvent*, const AtomicString& eventType,
+        int detail = 0, NodeImpl* relatedTarget = 0);
     bool dispatchSimulatedMouseEvent(const AtomicString& eventType);
     bool dispatchMouseEvent(const AtomicString& eventType, int button, int detail,
         int clientX, int clientY, int screenX, int screenY,
@@ -284,8 +261,8 @@ public:
         bool isSimulated = false, NodeImpl* relatedTarget = 0);
     bool dispatchUIEvent(const AtomicString& eventType, int detail = 0);
     bool dispatchSubtreeModifiedEvent(bool childrenChanged = true);
-    bool dispatchKeyEvent(QKeyEvent*);
-    void dispatchWheelEvent(QWheelEvent*);
+    bool dispatchKeyEvent(KeyEvent*);
+    void dispatchWheelEvent(WheelEvent*);
 
     void handleLocalEvents(EventImpl*, bool useCapture);
 
index a51987b..491b6b9 100644 (file)
@@ -27,7 +27,8 @@
 #include "DocumentImpl.h"
 #include "EventNames.h"
 #include "FrameView.h"
-#include "KWQEvent.h"
+#include "SystemTime.h"
+#include "KeyEvent.h"
 #include "SystemTime.h"
 #include "dom2_events.h"
 #include "dom2_viewsimpl.h"
@@ -436,16 +437,12 @@ KeyboardEventImpl::KeyboardEventImpl()
 {
 }
 
-KeyboardEventImpl::KeyboardEventImpl(QKeyEvent *key, AbstractViewImpl *view)
-  : UIEventWithKeyStateImpl(key->type() == QEvent::KeyRelease ? keyupEvent : key->isAutoRepeat() ? keypressEvent : keydownEvent,
-    true, true, view, 0,
-    key->state() & Qt::ControlButton,
-    key->state() & Qt::AltButton,
-    key->state() & Qt::ShiftButton,
-    key->state() & Qt::MetaButton)
-  , m_keyEvent(new QKeyEvent(*key))
+KeyboardEventImpl::KeyboardEventImpl(KeyEvent *key, AbstractViewImpl *view)
+  : UIEventWithKeyStateImpl(key->isKeyUp() ? keyupEvent : key->isAutoRepeat() ? keypressEvent : keydownEvent,
+    true, true, view, 0, key->ctrlKey(), key->altKey(), key->shiftKey(), key->metaKey())
+  , m_keyEvent(new KeyEvent(*key))
   , m_keyIdentifier(DOMString(key->keyIdentifier()).impl())
-  , m_keyLocation((key->state() & Qt::Keypad) ? KeyboardEvent::DOM_KEY_LOCATION_NUMPAD : KeyboardEvent::DOM_KEY_LOCATION_STANDARD)
+  , m_keyLocation(key->isKeypad() ? KeyboardEvent::DOM_KEY_LOCATION_NUMPAD : KeyboardEvent::DOM_KEY_LOCATION_STANDARD)
   , m_altGraphKey(false)
 {
 }
@@ -511,13 +508,11 @@ int KeyboardEventImpl::keyCode() const
 
 int KeyboardEventImpl::charCode() const
 {
-    if (!m_keyEvent) {
+    if (!m_keyEvent)
         return 0;
-    }
-    QString text = m_keyEvent->text();
-    if (text.length() != 1) {
+    String text = m_keyEvent->text();
+    if (text.length() != 1)
         return 0;
-    }
     return text[0].unicode();
 }
 
index 1e8e085..26fd331 100644 (file)
@@ -31,7 +31,6 @@
 #include "dom2_viewsimpl.h"
 #include "Shared.h"
 
-class QKeyEvent;
 class QStringList;
 
 namespace WebCore {
@@ -40,6 +39,7 @@ class ClipboardImpl;
 class EventListener;
 class Image;
 class IntPoint;
+class KeyEvent;
 
 class EventImpl : public Shared<EventImpl>
 {
@@ -264,7 +264,7 @@ private:
 class KeyboardEventImpl : public UIEventWithKeyStateImpl {
 public:
     KeyboardEventImpl();
-    KeyboardEventImpl(QKeyEvent *key, AbstractViewImpl *view);
+    KeyboardEventImpl(KeyEvent*, AbstractViewImpl*);
     KeyboardEventImpl(const AtomicString &type,
                 bool canBubbleArg,
                 bool cancelableArg,
@@ -295,7 +295,7 @@ public:
     
     bool altGraphKey() const { return m_altGraphKey; }
     
-    QKeyEvent *qKeyEvent() const { return m_keyEvent; }
+    KeyEvent* keyEvent() const { return m_keyEvent; }
 
     int keyCode() const; // key code for keydown and keyup, character for other events
     int charCode() const;
@@ -304,7 +304,7 @@ public:
     virtual int which() const;
 
 private:
-    QKeyEvent *m_keyEvent;
+    KeyEvent* m_keyEvent;
     RefPtr<DOMStringImpl> m_keyIdentifier;
     unsigned m_keyLocation;
     bool m_altGraphKey : 1;
index b9540b7..c90502f 100644 (file)
@@ -238,8 +238,7 @@ public:
     virtual RenderObject *createRenderer(RenderArena *, RenderStyle *);
     virtual void recalcStyle( StyleChange = NoChange );
 
-    virtual void mouseEventHandler( MouseEvent * /*ev*/, bool /*inside*/ ) {};
-    virtual bool childTypeAllowed( unsigned short type );
+    virtual bool childTypeAllowed(unsigned short type);
  
     virtual AttributeImpl* createAttribute(const QualifiedName& name, DOMStringImpl* value);
     
index d96e271..20c180c 100644 (file)
@@ -45,7 +45,6 @@
 #include "dom_elementimpl.h"
 #include "EventNames.h"
 #include <kxmlcore/Assertions.h>
-#include <qevent.h>
 #include <qpainter.h>
 
 #define EDIT_DEBUG 0
index 728fc37..27b44f4 100644 (file)
@@ -2,6 +2,7 @@
 /*
  *  This file is part of the KDE libraries
  *  Copyright (C) 2005 Anders Carlsson (andersca@mac.com)
+ *  Copyright (C) 2006 Apple Computer, Inc.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef _DOMPARSER_H
-#define _DOMPARSER_H_
-
-#include <qguardedptr.h>
+#ifndef DOMPARSER_H
+#define DOMPARSER_H_
 
 #include "kjs_dom.h"
 
@@ -29,24 +28,23 @@ namespace KJS {
 
   class DOMParserConstructorImp : public JSObject {
   public:
-    DOMParserConstructorImp(ExecState *, DOM::DocumentImpl *d);
+    DOMParserConstructorImp(ExecState*, WebCore::DocumentImpl*);
     virtual bool implementsConstruct() const;
-    virtual JSObject *construct(ExecState *exec, const List &args);
-private:
-    RefPtr<DOM::DocumentImpl> doc;
+    virtual JSObject* construct(ExecState*, const List &args);
+  private:
+    RefPtr<WebCore::DocumentImpl> doc;
   };
 
   class DOMParser : public DOMObject {
   public:
-    DOMParser(ExecState *, DOM::DocumentImpl *d);
-    virtual bool toBoolean(ExecState *) const { return true; }
+    DOMParser(ExecState*, WebCore::DocumentImpl*);
+    virtual bool toBoolean(ExecState*) const { return true; }
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
     enum { ParseFromString };
 
   private:
-    QGuardedPtr<DOM::DocumentImpl> doc;
-
+    RefPtr<WebCore::DocumentImpl> doc;
     friend class DOMParserProtoFunc;
   };
 
index 6267bce..1f36dfc 100644 (file)
 #define KJS_HTML_H_
 
 #include "CachedObjectClient.h"
-#include "kjs_dom.h"
-#include "JSElement.h"
 #include "Color.h"
-#include <qguardedptr.h>
 #include "Image.h"
+#include "JSElement.h"
+#include "kjs_dom.h"
+#include <qptrlist.h>
 
 #if __APPLE__
 #include <ApplicationServices/ApplicationServices.h>
index 177ead1..b6509d7 100644 (file)
@@ -52,6 +52,8 @@ public:
 
     void initScriptIfNeeded();
 
+    bool haveInterpreter() const { return m_script; }
+
 private:
     KJS::ScriptInterpreter* m_script;
     Frame *m_frame;
index 9acd36a..32ab938 100644 (file)
@@ -27,7 +27,6 @@
 #include "FrameView.h"
 #include "JSMutationEvent.h"
 #include "JSXMLHttpRequest.h"
-#include "KWQEvent.h"
 #include "KWQKConfigBase.h"
 #include "KWQLogging.h"
 #include "Screen.h"
@@ -71,7 +70,7 @@ static int lastUsedTimeoutId;
 
 class DOMWindowTimer : public TimerBase {
 public:
-    DOMWindowTimer(int timeoutId, WindowQObject* o, ScheduledAction* a)
+    DOMWindowTimer(int timeoutId, Window* o, ScheduledAction* a)
         : m_timeoutId(timeoutId), m_object(o), m_action(a) { }
     virtual ~DOMWindowTimer() { delete m_action; }
 
@@ -83,7 +82,7 @@ private:
     virtual void fired();
 
     int m_timeoutId;
-    WindowQObject* m_object;
+    Window* m_object;
     ScheduledAction* m_action;
 };
 
@@ -108,8 +107,9 @@ public:
     static const ClassInfo info;
     enum { Back, Forward, Go, Length };
     virtual UString toString(ExecState *exec) const;
+    void disconnectFrame() { m_frame = 0; }
   private:
-    QGuardedPtr<Frame> m_frame;
+    Frame* m_frame;
   };
 
   class FrameArray : public JSObject {
@@ -120,6 +120,7 @@ public:
     JSValue *getValueProperty(ExecState *exec, int token);
     virtual UString toString(ExecState *exec) const;
     enum { Length, Location };
+    void disconnectFrame() { m_frame = 0; }
   private:
     static JSValue *indexGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
     static JSValue *nameGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
@@ -127,7 +128,7 @@ public:
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
 
-    QGuardedPtr<Frame> m_frame;
+    Frame* m_frame;
   };
 
 }
@@ -323,11 +324,12 @@ Window::Window(Frame *p)
   , m_evt(0)
   , m_returnValueSlot(0)
 {
-  winq = new WindowQObject(this);
 }
 
 Window::~Window()
 {
+    clearAllTimeouts();
+
     // Clear any backpointers to the window
 
     UnprotectedListenersMap::iterator i1 = jsUnprotectedEventListeners.begin();
@@ -339,8 +341,6 @@ Window::~Window()
     ListenersMap::iterator e2 = jsEventListeners.end();
     for (; i2 != e2; ++i2)
         i2->second->clearWindowObj();
-    
-    delete winq;
 }
 
 ScriptInterpreter *Window::interpreter() const
@@ -375,56 +375,56 @@ JSValue *Window::retrieve(Frame *p)
 Location *Window::location() const
 {
   if (!loc)
-    const_cast<Window*>(this)->loc = new Location(m_frame);
+    loc = new Location(m_frame);
   return loc;
 }
 
 Selection *Window::selection() const
 {
   if (!m_selection)
-    const_cast<Window*>(this)->m_selection = new Selection(m_frame);
+    m_selection = new Selection(m_frame);
   return m_selection;
 }
 
 BarInfo *Window::locationbar(ExecState *exec) const
 {
   if (!m_locationbar)
-    const_cast<Window*>(this)->m_locationbar = new BarInfo(exec, m_frame, BarInfo::Locationbar);
+    m_locationbar = new BarInfo(exec, m_frame, BarInfo::Locationbar);
   return m_locationbar;
 }
 
 BarInfo *Window::menubar(ExecState *exec) const
 {
   if (!m_menubar)
-    const_cast<Window*>(this)->m_menubar = new BarInfo(exec, m_frame, BarInfo::Menubar);
+    m_menubar = new BarInfo(exec, m_frame, BarInfo::Menubar);
   return m_menubar;
 }
 
 BarInfo *Window::personalbar(ExecState *exec) const
 {
   if (!m_personalbar)
-    const_cast<Window*>(this)->m_personalbar = new BarInfo(exec, m_frame, BarInfo::Personalbar);
+    m_personalbar = new BarInfo(exec, m_frame, BarInfo::Personalbar);
   return m_personalbar;
 }
 
 BarInfo *Window::statusbar(ExecState *exec) const
 {
   if (!m_statusbar)
-    const_cast<Window*>(this)->m_statusbar = new BarInfo(exec, m_frame, BarInfo::Statusbar);
+    m_statusbar = new BarInfo(exec, m_frame, BarInfo::Statusbar);
   return m_statusbar;
 }
 
 BarInfo *Window::toolbar(ExecState *exec) const
 {
   if (!m_toolbar)
-    const_cast<Window*>(this)->m_toolbar = new BarInfo(exec, m_frame, BarInfo::Toolbar);
+    m_toolbar = new BarInfo(exec, m_frame, BarInfo::Toolbar);
   return m_toolbar;
 }
 
 BarInfo *Window::scrollbars(ExecState *exec) const
 {
   if (!m_scrollbars)
-    const_cast<Window*>(this)->m_scrollbars = new BarInfo(exec, m_frame, BarInfo::Scrollbars);
+    m_scrollbars = new BarInfo(exec, m_frame, BarInfo::Scrollbars);
   return m_scrollbars;
 }
 
@@ -438,7 +438,6 @@ void Window::mark()
     history->mark();
   if (frames && !frames->marked())
     frames->mark();
-  //kdDebug(6070) << "Window::mark " << this << " marking loc=" << loc << endl;
   if (loc && !loc->marked())
     loc->mark();
   if (m_selection && !m_selection->marked())
@@ -660,7 +659,7 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
 
    switch (token) {
    case Closed:
-      return jsBoolean(m_frame.isNull());
+      return jsBoolean(!m_frame);
    case Crypto:
       return jsUndefined(); // ###
    case DefaultStatus:
@@ -933,7 +932,7 @@ JSValue *Window::namedItemGetter(ExecState *exec, JSObject *originalObject, cons
 bool Window::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
   // we don't want any properties other than "closed" on a closed window
-  if (m_frame.isNull()) {
+  if (!m_frame) {
     if (propertyName == "closed") {
       slot.setStaticEntry(this, Lookup::findEntry(&WindowTable, "closed"), staticValueGetter<Window>);
       return true;
@@ -1190,12 +1189,11 @@ void Window::put(ExecState* exec, const Identifier &propertyName, JSValue *value
 
 bool Window::toBoolean(ExecState *) const
 {
-  return !m_frame.isNull();
+  return m_frame;
 }
 
 void Window::scheduleClose()
 {
-  ASSERT(winq);
   m_frame->scheduleClose();
 }
 
@@ -1263,7 +1261,7 @@ bool Window::isSafeScript(const ScriptInterpreter *origin, const ScriptInterpret
 
 bool Window::isSafeScript(ExecState *exec) const
 {
-  if (m_frame.isNull()) // frame deleted ? can't grant access
+  if (!m_frame) // frame deleted ? can't grant access
     return false;
   Frame *activePart = static_cast<ScriptInterpreter *>( exec->dynamicInterpreter() )->frame();
   if (!activePart)
@@ -1378,13 +1376,15 @@ JSUnprotectedEventListener *Window::getJSUnprotectedEventListener(JSValue *val,
 void Window::clear()
 {
   JSLock lock;
+
   if (m_returnValueSlot)
-    if (JSValue *returnValue = getDirect("returnValue"))
+    if (JSValuereturnValue = getDirect("returnValue"))
       *m_returnValueSlot = returnValue;
-  delete winq;
-  winq = new WindowQObject(this);
+
+  clearAllTimeouts();
 
   clearProperties();
+
   // there's likely to be lots of garbage now
   Collector::collect();
 
@@ -1395,7 +1395,6 @@ void Window::clear()
 void Window::setCurrentEvent(EventImpl *evt)
 {
   m_evt = evt;
-  //kdDebug(6070) << "Window " << this << " (frame=" << m_frame << ")::setCurrentEvent m_evt=" << evt << endl;
 }
 
 static void setWindowFeature(const DOMString& keyString, const DOMString& valueString, WindowArgs& windowArgs)
@@ -1887,21 +1886,15 @@ void ScheduledAction::execute(Window *window)
     interpreter->setProcessingTimerCallback(false);
 }
 
-////////////////////// WindowQObject ////////////////////////
+////////////////////// timeouts ////////////////////////
 
-WindowQObject::WindowQObject(Window *w)
-    : m_parent(w)
-{
-    connect(w->m_frame, SIGNAL(destroyed()), this, SLOT(parentDestroyed()));
-}
-
-void WindowQObject::parentDestroyed()
+void Window::clearAllTimeouts()
 {
     deleteAllValues(m_timeouts);
     m_timeouts.clear();
 }
 
-int WindowQObject::installTimeout(ScheduledAction* a, int t, bool singleShot)
+int Window::installTimeout(ScheduledAction* a, int t, bool singleShot)
 {
     int timeoutId = ++lastUsedTimeoutId;
     DOMWindowTimer* timer = new DOMWindowTimer(timeoutId, this, a);
@@ -1917,17 +1910,17 @@ int WindowQObject::installTimeout(ScheduledAction* a, int t, bool singleShot)
     return timeoutId;
 }
 
-int WindowQObject::installTimeout(const UString& handler, int t, bool singleShot)
+int Window::installTimeout(const UString& handler, int t, bool singleShot)
 {
     return installTimeout(new ScheduledAction(handler.qstring()), t, singleShot);
 }
 
-int WindowQObject::installTimeout(JSValue* func, const List& args, int t, bool singleShot)
+int Window::installTimeout(JSValue* func, const List& args, int t, bool singleShot)
 {
     return installTimeout(new ScheduledAction(func, args), t, singleShot);
 }
 
-PausedTimeouts *WindowQObject::pauseTimeouts()
+PausedTimeouts* Window::pauseTimeouts()
 {
     size_t count = m_timeouts.size();
     if (count == 0)
@@ -1953,12 +1946,12 @@ PausedTimeouts *WindowQObject::pauseTimeouts()
     return result;
 }
 
-void WindowQObject::resumeTimeouts(PausedTimeouts *timeouts)
+void Window::resumeTimeouts(PausedTimeouts* timeouts)
 {
     if (!timeouts)
         return;
     size_t count = timeouts->numTimeouts();
-    PausedTimeout *array = timeouts->takeTimeouts();
+    PausedTimeoutarray = timeouts->takeTimeouts();
     for (size_t i = 0; i != count; ++i) {
         int timeoutId = array[i].timeoutId;
         DOMWindowTimer* timer = new DOMWindowTimer(timeoutId, this, array[i].action);
@@ -1968,7 +1961,7 @@ void WindowQObject::resumeTimeouts(PausedTimeouts *timeouts)
     delete [] array;
 }
 
-void WindowQObject::clearTimeout(int timeoutId, bool delAction)
+void Window::clearTimeout(int timeoutId, bool delAction)
 {
     TimeoutsMap::iterator it = m_timeouts.find(timeoutId);
     if (it == m_timeouts.end())
@@ -1978,11 +1971,11 @@ void WindowQObject::clearTimeout(int timeoutId, bool delAction)
     delete timer;
 }
 
-void WindowQObject::timerFired(DOMWindowTimer* timer)
+void Window::timerFired(DOMWindowTimer* timer)
 {
     // Simple case for non-one-shot timers.
     if (timer->isActive()) {
-        timer->action()->execute(m_parent);
+        timer->action()->execute(this);
         return;
     }
 
@@ -1990,10 +1983,36 @@ void WindowQObject::timerFired(DOMWindowTimer* timer)
     ScheduledAction* action = timer->takeAction();
     m_timeouts.remove(timer->timeoutId());
     delete timer;
-    action->execute(m_parent);
+    action->execute(this);
     delete action;
 }
 
+void Window::disconnectFrame()
+{
+    clearAllTimeouts();
+    m_frame = 0;
+    if (loc)
+        loc->m_frame = 0;
+    if (m_selection)
+        m_selection->m_frame = 0;
+    if (m_locationbar)
+        m_locationbar->m_frame = 0;
+    if (m_menubar)
+        m_menubar->m_frame = 0;
+    if (m_personalbar)
+        m_personalbar->m_frame = 0;
+    if (m_statusbar)
+        m_statusbar->m_frame = 0;
+    if (m_toolbar)
+        m_toolbar->m_frame = 0;
+    if (m_scrollbars)
+        m_scrollbars->m_frame = 0;
+    if (frames)
+        frames->disconnectFrame();
+    if (history)
+        history->disconnectFrame();
+}
+
 const ClassInfo FrameArray::info = { "FrameArray", 0, &FrameArrayTable, 0 };
 
 /*
@@ -2046,7 +2065,7 @@ JSValue *FrameArray::nameGetter(ExecState *exec, JSObject *originalObject, const
 
 bool FrameArray::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
-  if (m_frame.isNull()) {
+  if (!m_frame) {
     slot.setUndefined(this);
     return true;
   }
@@ -2142,7 +2161,7 @@ JSValue *Location::getValueProperty(ExecState *exec, int token) const
 
 bool Location::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) 
 {
-  if (m_frame.isNull())
+  if (!m_frame)
     return false;
   
   const Window* window = Window::retrieveWindow(m_frame);
@@ -2156,7 +2175,7 @@ bool Location::getOwnPropertySlot(ExecState *exec, const Identifier& propertyNam
 
 void Location::put(ExecState *exec, const Identifier &p, JSValue *v, int attr)
 {
-  if (m_frame.isNull())
+  if (!m_frame)
     return;
 
   QString str = v->toString(exec).qstring();
@@ -2350,7 +2369,7 @@ JSValue *Selection::getValueProperty(ExecState *exec, int token) const
 
 bool Selection::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
-  if (m_frame.isNull())
+  if (!m_frame)
       return false;
 
   return getStaticPropertySlot<SelectionFunc, Selection, JSObject>(exec, &SelectionTable, this, propertyName, slot);
@@ -2447,7 +2466,7 @@ JSValue *BarInfo::getValueProperty(ExecState *exec, int token) const
 
 bool BarInfo::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
-  if (m_frame.isNull())
+  if (!m_frame)
     return false;
   
   return getStaticValueSlot<BarInfo, JSObject>(exec, &BarInfoTable, this, propertyName, slot);
index 6b8674a..88271c9 100644 (file)
 #ifndef KJS_WINDOW_H_
 #define KJS_WINDOW_H_
 
+#include "QString.h"
 #include "kjs_binding.h"
 #include <kjs/protect.h>
 #include <kxmlcore/HashMap.h>
-#include <qguardedptr.h>
-#include <qobject.h>
-#include <QString.h>
 
 namespace WebCore {
     class AtomicString;
@@ -69,31 +67,6 @@ namespace KJS {
 
     class DOMWindowTimer;
 
-    class WindowQObject : public QObject {
-        Q_OBJECT
-    public:
-        WindowQObject(Window *);
-        ~WindowQObject() { parentDestroyed(); }
-
-        int installTimeout(const UString &handler, int interval, bool singleShot);
-        int installTimeout(JSValue *function, const List &, int interval, bool singleShot);
-        void clearTimeout(int timerId, bool delAction = true);
-
-        PausedTimeouts *pauseTimeouts();
-        void resumeTimeouts(PausedTimeouts *);
-
-        void timerFired(DOMWindowTimer*);
-
-    private slots:
-        void parentDestroyed();
-    private:
-        int installTimeout(ScheduledAction*, int interval, bool singleShot);
-
-        Window* m_parent;
-        typedef HashMap<int, DOMWindowTimer*> TimeoutsMap;
-        TimeoutsMap m_timeouts;
-    };
-
   class Screen : public JSObject {
   public:
     enum { Height, Width, ColorDepth, PixelDepth, AvailLeft, AvailTop, AvailHeight, AvailWidth };
@@ -104,46 +77,47 @@ namespace KJS {
   private:
     friend class Window;
     Screen(ExecState*, WebCore::Frame*);
-    QGuardedPtr<WebCore::Frame> m_frame;
+    WebCore::Frame* m_frame;
   };
 
   class Window : public JSObject {
-    friend QGuardedPtr<WebCore::Frame> getInstance();
     friend class Location;
     friend class WindowFunc;
-    friend class WindowQObject;
     friend class ScheduledAction;
   public:
-    Window(WebCore::Frame *p);
+    Window(WebCore::Frame*);
   public:
     ~Window();
+    void disconnectFrame();
     /**
      * Returns and registers a window object. In case there's already a Window
      * for the specified frame p this will be returned in order to have unique
      * bindings.
      */
-    static JSValue* retrieve(WebCore::Frame *p);
+    static JSValue* retrieve(WebCore::Frame*);
     /**
      * Returns the Window object for a given HTML frame
      */
-    static Window* retrieveWindow(WebCore::Frame *p);
+    static Window* retrieveWindow(WebCore::Frame*);
     /**
      * returns a pointer to the Window object this javascript interpreting instance
      * was called from.
      */
-    static Window *retrieveActive(ExecState*);
-    QGuardedPtr<WebCore::Frame> frame() const { return m_frame; }
+    static WindowretrieveActive(ExecState*);
+    WebCore::Frame* frame() const { return m_frame; }
     virtual void mark();
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
     JSValue *getValueProperty(ExecState *exec, int token) const;
     virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
     virtual bool toBoolean(ExecState*) const;
 
-    int installTimeout(const UString& handler, int t, bool singleShot) { return winq->installTimeout(handler, t, singleShot); }
-    int installTimeout(JSValue* function, List& args, int t, bool singleShot) { return winq->installTimeout(function, args, t, singleShot); }
-    void clearTimeout(int timerId) { winq->clearTimeout(timerId); }
-    PausedTimeouts* pauseTimeouts() { return winq->pauseTimeouts(); }
-    void resumeTimeouts(PausedTimeouts* t) { winq->resumeTimeouts(t); }
+    int installTimeout(const UString& handler, int t, bool singleShot);
+    int installTimeout(JSValue* function, const List& args, int t, bool singleShot);
+    void clearTimeout(int timerId, bool delAction = true);
+    PausedTimeouts* pauseTimeouts();
+    void resumeTimeouts(PausedTimeouts*);
+
+    void timerFired(DOMWindowTimer*);
     
     KJS::ScriptInterpreter *interpreter() const;
 
@@ -165,7 +139,7 @@ namespace KJS {
     virtual UString toString(ExecState *) const;
 
     // Set the current "event" object
-    void setCurrentEvent(DOM::EventImpl *evt);
+    void setCurrentEvent(WebCore::EventImpl*);
 
     // Set a place to put a dialog return value when the window is cleared.
     void setReturnValueSlot(JSValue **slot) { m_returnValueSlot = slot; }
@@ -192,10 +166,11 @@ namespace KJS {
            Onmouseout, Onmouseover, Onmouseup, OnWindowMouseWheel, Onmove, Onreset, Onresize, Onscroll, Onsearch,
            Onselect, Onsubmit, Onunload, Onbeforeunload,
            Statusbar, Toolbar, FrameElement, ShowModalDialog };
-  protected:
-    JSValue *getListener(ExecState *exec, const DOM::AtomicString &eventType) const;
-    void setListener(ExecState *exec, const DOM::AtomicString &eventType, JSValue *func);
+
   private:
+    JSValue* getListener(ExecState*, const WebCore::AtomicString& eventType) const;
+    void setListener(ExecState*, const WebCore::AtomicString& eventType, JSValue* func);
+
     static JSValue *childFrameGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
     static JSValue *namedFrameGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
     static JSValue *indexGetter(ExecState *exec, JSObject *, const Identifier&, const PropertySlot& slot);
@@ -203,21 +178,25 @@ namespace KJS {
 
     void updateLayout() const;
 
-    QGuardedPtr<WebCore::Frame> m_frame;
-    mutable Screen *screen;
-    mutable History *history;
-    mutable FrameArray *frames;
-    Location *loc;
-    Selection *m_selection;
-    BarInfo *m_locationbar;
-    BarInfo *m_menubar;
-    BarInfo *m_personalbar;
-    BarInfo *m_scrollbars;
-    BarInfo *m_statusbar;
-    BarInfo *m_toolbar;
-    WindowQObject *winq;
-    DOM::EventImpl *m_evt;
+    void clearAllTimeouts();
+    int installTimeout(ScheduledAction*, int interval, bool singleShot);
+
+    WebCore::Frame* m_frame;
+    mutable Screen* screen;
+    mutable History* history;
+    mutable FrameArray* frames;
+    mutable Location* loc;
+    mutable Selection* m_selection;
+    mutable BarInfo* m_locationbar;
+    mutable BarInfo* m_menubar;
+    mutable BarInfo* m_personalbar;
+    mutable BarInfo* m_scrollbars;
+    mutable BarInfo* m_statusbar;
+    mutable BarInfo* m_toolbar;
+    WebCore::EventImpl *m_evt;
     JSValue **m_returnValueSlot;
+    typedef HashMap<int, DOMWindowTimer*> TimeoutsMap;
+    TimeoutsMap m_timeouts;
   };
 
   /**
@@ -248,13 +227,13 @@ namespace KJS {
     virtual UString toString(ExecState*) const;
     enum { Hash, Href, Hostname, Host, Pathname, Port, Protocol, Search, EqualEqual,
            Replace, Reload, ToString, Assign };
-    WebCore::Frame *frame() const { return m_frame; }
+    WebCore::Frameframe() const { return m_frame; }
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
   private:
     friend class Window;
-    Location(WebCore::Frame *p);
-    QGuardedPtr<WebCore::Frame> m_frame;
+    Location(WebCore::Frame*);
+    WebCore::Frame* m_frame;
   };
 
   class Selection : public JSObject {
@@ -266,13 +245,13 @@ namespace KJS {
     enum { AnchorNode, AnchorOffset, FocusNode, FocusOffset, BaseNode, BaseOffset, ExtentNode, ExtentOffset, 
            IsCollapsed, _Type, EqualEqual, Collapse, CollapseToEnd, CollapseToStart, Empty, ToString, 
            SetBaseAndExtent, SetPosition, Modify, GetRangeAt };
-    WebCore::Frame *frame() const { return m_frame; }
+    WebCore::Frameframe() const { return m_frame; }
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
   private:
     friend class Window;
-    Selection(WebCore::Frame *p);
-    QGuardedPtr<WebCore::Frame> m_frame;
+    Selection(WebCore::Frame*);
+    WebCore::Frame* m_frame;
   };
 
   class BarInfo : public JSObject {
@@ -281,13 +260,13 @@ namespace KJS {
     JSValue *getValueProperty(ExecState *exec, int token) const;
     enum { Visible };
     enum Type { Locationbar, Menubar, Personalbar, Scrollbars, Statusbar, Toolbar };
-    WebCore::Frame *frame() const { return m_frame; }
+    WebCore::Frameframe() const { return m_frame; }
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
   private:
     friend class Window;
-    BarInfo(ExecState *exec, WebCore::Frame *p, Type barType);
-    QGuardedPtr<WebCore::Frame> m_frame;
+    BarInfo(ExecState*, WebCore::Frame*, Type);
+    WebCore::Frame* m_frame;
     Type m_type;
   };
 
index 1bdcdf3..96a8a86 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2000 Simon Hausmann <hausmann@kde.org>
- * Copyright (C) 2004 Apple Computer, Inc.
+ * Copyright (C) 2004, 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
@@ -27,7 +27,6 @@
 #define HTML_BASEIMPL_H
 
 #include "HTMLElementImpl.h"
-#include "khtmllayout.h"
 
 #include <qscrollview.h>
 
@@ -44,6 +43,8 @@ class DOMString;
 class Frame;
 class HTMLFrameElement;
 
+struct Length;
+
 // -------------------------------------------------------------------------
 
 class HTMLBodyElementImpl : public HTMLElementImpl
@@ -200,8 +201,8 @@ public:
     void setRows(const DOMString &);
 
 protected:
-    khtml::Length* m_rows;
-    khtml::Length* m_cols;
+    Length* m_rows;
+    Length* m_cols;
 
     int m_totalRows;
     int m_totalCols;
index 1bf386e..a1f552e 100644 (file)
@@ -601,24 +601,24 @@ QRegion HTMLAreaElementImpl::getRegion(int width, int height) const
                 int numPoints = m_coordsLen / 2;
                 IntPointArray points(numPoints);
                 for (int i = 0; i < numPoints; ++i)
-                    points.setPoint(i, m_coords[i * 2].minWidth(width), m_coords[i * 2 + 1].minWidth(height));
+                    points.setPoint(i, m_coords[i * 2].calcMinValue(width), m_coords[i * 2 + 1].calcMinValue(height));
                 return QRegion(points);
             }
             break;
         case Circle:
             if (m_coordsLen >= 3) {
                 Length radius = m_coords[2];
-                int r = kMin(radius.minWidth(width), radius.minWidth(height));
-                return QRegion(m_coords[0].minWidth(width) - r, m_coords[1].minWidth(height) - r,
+                int r = kMin(radius.calcMinValue(width), radius.calcMinValue(height));
+                return QRegion(m_coords[0].calcMinValue(width) - r, m_coords[1].calcMinValue(height) - r,
                     2 * r, 2 * r, QRegion::Ellipse);
             }
             break;
         case Rect:
             if (m_coordsLen >= 4) {
-                int x0 = m_coords[0].minWidth(width);
-                int y0 = m_coords[1].minWidth(height);
-                int x1 = m_coords[2].minWidth(width);
-                int y1 = m_coords[3].minWidth(height);
+                int x0 = m_coords[0].calcMinValue(width);
+                int y0 = m_coords[1].calcMinValue(height);
+                int x1 = m_coords[2].calcMinValue(width);
+                int y1 = m_coords[3].calcMinValue(height);
                 return QRegion(x0, y0, x1 - x0, y1 - y0);
             }
             break;
index f5c954b..b9efa8e 100644 (file)
@@ -26,8 +26,7 @@
 #define HTML_IMAGEIMPL_H
 
 #include "CachedImage.h"
-#include "html/html_inlineimpl.h"
-#include "khtmllayout.h"
+#include "html_inlineimpl.h"
 #include "render_object.h"
 #include <qregion.h>
 
@@ -38,6 +37,8 @@ class HTMLCollectionImpl;
 class HTMLFormElementImpl;
 class Image;
 
+struct Length;
+
 class HTMLImageLoader : public CachedObjectClient {
 public:
     HTMLImageLoader(ElementImpl* elt);
@@ -153,10 +154,9 @@ protected:
 class HTMLAreaElementImpl : public HTMLAnchorElementImpl
 {
 public:
-
     enum Shape { Default, Poly, Rect, Circle, Unknown };
 
-    HTMLAreaElementImpl(DocumentImpl *doc);
+    HTMLAreaElementImpl(DocumentImpl*);
     ~HTMLAreaElementImpl();
 
     virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
index 97283ff..3ab6ed6 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "EventNames.h"
 #include "Frame.h"
-#include "KWQEvent.h"
+#include "KeyEvent.h"
 #include "csshelper.h"
 #include "cssproperties.h"
 #include "cssstyleselector.h"
@@ -134,8 +134,8 @@ void HTMLAnchorElementImpl::defaultEventHandler(EventImpl *evt)
                 HTMLElementImpl::defaultEventHandler(evt);
                 return;
             }
-            if (k->qKeyEvent()) {
-                k->qKeyEvent()->accept();
+            if (k->keyEvent()) {
+                k->keyEvent()->accept();
                 evt->setDefaultHandled();
                 click(false);
                 return;
@@ -168,41 +168,9 @@ void HTMLAnchorElementImpl::defaultEventHandler(EventImpl *evt)
                 }
             }
         }
-        if ( !evt->defaultPrevented() ) {
-            int state = 0;
-            int button = 0;
-
-            if ( e ) {
-                if ( e->ctrlKey() )
-                    state |= Qt::ControlButton;
-                if ( e->shiftKey() )
-                    state |= Qt::ShiftButton;
-                if ( e->altKey() )
-                    state |= Qt::AltButton;
-                if ( e->metaKey() )
-                    state |= Qt::MetaButton;
-
-                if ( e->button() == 0 )
-                    button = Qt::LeftButton;
-                else if ( e->button() == 1 )
-                    button = Qt::MidButton;
-                else if ( e->button() == 2 )
-                    button = Qt::RightButton;
-            }
-            else if ( k )
-            {
-              if ( k->shiftKey() )
-                state |= Qt::ShiftButton;
-              if ( k->altKey() )
-                state |= Qt::AltButton;
-              if ( k->ctrlKey() )
-                state |= Qt::ControlButton;
-            }
-
-            if (getDocument() && getDocument()->frame()) {
-                getDocument()->frame()->
-                    urlSelected( url, button, state, utarget );
-            }
+        if (!evt->defaultPrevented()) {
+            if (getDocument() && getDocument()->frame())
+                getDocument()->frame()->urlSelected(url, utarget);
         }
         evt->setDefaultHandled();
     }
index 2774876..900afd3 100644 (file)
@@ -35,7 +35,6 @@
 #include "Frame.h"
 #include "FrameView.h"
 #include "HTMLElementImpl.h"
-#include "KWQEvent.h"
 #include "SystemTime.h"
 #include "csshelper.h"
 #include "html_documentimpl.h"
@@ -1523,17 +1522,14 @@ void HTMLTokenizer::timerFired(Timer<HTMLTokenizer>*)
         return;
     }
     
+    RefPtr<Frame> frame = view ? view->frame() : 0;
+
     // Invoke write() as though more data came in.
-    QGuardedPtr<FrameView> savedView = view;
     bool didCallEnd = write(SegmentedString(), true);
   
     // If we called end() during the write,  we need to let WebKit know that we're done processing the data.
-    if (didCallEnd && savedView) {
-        Frame *frame = savedView->frame();
-        if (frame) {
-            frame->tokenizerProcessedData();
-        }
-    }
+    if (didCallEnd && frame)
+        frame->tokenizerProcessedData();
 }
 
 void HTMLTokenizer::end()
diff --git a/WebCore/khtml/khtml_events.cpp b/WebCore/khtml/khtml_events.cpp
deleted file mode 100644 (file)
index e184aaf..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/* This file is part of the KDE project
-   Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
-
-   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 "khtml_events.h"
-
-#include "render_object.h"
-#include "VisiblePosition.h"
-
-namespace WebCore {
-
-MouseEvent::MouseEvent(QMouseEvent *qmouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString& target, NodeImpl *innerNode )
-: m_qmouseEvent( qmouseEvent ), m_x( x ), m_y( y ),
-  m_url( url ), m_target(target), m_innerNode( innerNode )
-{
-  if (innerNode && innerNode->renderer()) {
-      // FIXME: For text nodes, for now, we get the absolute position from the parent.
-      NodeImpl *n = innerNode;
-      if (n->isTextNode())
-        n = n->parentNode();
-      n->renderer()->absolutePosition(m_nodeAbsX, m_nodeAbsY);
-  }
-}
-
-int MouseEvent::offset() const
-{
-    Position pos;
-    if (NodeImpl *inner = m_innerNode.get()) {
-        // FIXME: Shouldn't be necessary to skip text nodes.
-        if (inner->isTextNode())
-            inner = inner->parentNode();
-        if (inner->renderer())
-            pos = inner->renderer()->positionForCoordinates(m_x, m_y).deepEquivalent();
-    }
-    return pos.offset();
-}
-
-DrawContentsEvent::DrawContentsEvent( QPainter *painter, int clipx, int clipy, int clipw, int cliph )
-  : m_painter( painter ), m_clipx( clipx ), m_clipy( clipy ),
-    m_clipw( clipw ), m_cliph( cliph )
-{
-}
-
-}
diff --git a/WebCore/khtml/khtml_events.h b/WebCore/khtml/khtml_events.h
deleted file mode 100644 (file)
index ec84bc2..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/* This file is part of the KDE project
-   Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
-
-   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 __khtml_events_h__
-#define __khtml_events_h__
-
-#include "PlatformString.h"
-
-class QMouseEvent;
-
-namespace WebCore {
-
-class NodeImpl;
-class QPainter;
-
-class MouseEvent {
-public:
-  MouseEvent(QMouseEvent*, int x, int y, const DOMString& url, const DOMString& target, NodeImpl* innerNode);
-
-  QMouseEvent* qmouseEvent() const { return m_qmouseEvent; }
-  int x() const { return m_x; }
-  int y() const { return m_y; }
-  int absX() const { return m_nodeAbsX; }
-  int absY() const { return m_nodeAbsY; }
-
-  DOMString url() const { return m_url; }
-  DOMString target() const { return m_target; }
-  NodeImpl* innerNode() const { return m_innerNode.get(); }
-
-  // return the offset of innerNode
-  int offset() const;
-
-private:
-  QMouseEvent* m_qmouseEvent;
-  int m_x;
-  int m_y;
-  int m_nodeAbsX, m_nodeAbsY;
-  DOMString m_url;
-  DOMString m_target;
-  RefPtr<NodeImpl> m_innerNode;
-};
-
-class MousePressEvent : public MouseEvent
-{
-public:
-  MousePressEvent(QMouseEvent* e, int x, int y, const DOMString& url, const DOMString& target, NodeImpl* innerNode)
-    : MouseEvent(e, x, y, url, target, innerNode) { }
-};
-
-class MouseDoubleClickEvent : public MouseEvent
-{
-public:
-  MouseDoubleClickEvent(QMouseEvent* e, int x, int y, const DOMString& url, const DOMString& target, NodeImpl* innerNode)
-    : MouseEvent(e, x, y, url, target, innerNode) { }
-};
-
-
-class MouseMoveEvent : public MouseEvent
-{
-public:
-  MouseMoveEvent(QMouseEvent* e, int x, int y, const DOMString& url, const DOMString& target, NodeImpl* innerNode)
-   : MouseEvent(e, x, y, url, target, innerNode) { }
-};
-
-class MouseReleaseEvent : public MouseEvent
-{
-public:
-  MouseReleaseEvent( QMouseEvent *mouseEvent, int x, int y,
-                     const DOMString &url, const DOMString& target,
-                     NodeImpl *innerNode, int = 0 )
-  : MouseEvent( mouseEvent, x, y, url, target, innerNode )
-  { }
-};
-
-class DrawContentsEvent
-{
-public:
-  DrawContentsEvent(QPainter*, int clipx, int clipy, int clipw, int cliph);
-
-  QPainter *painter() const { return m_painter; }
-  int clipx() const { return m_clipx; }
-  int clipy() const { return m_clipy; }
-  int clipw() const { return m_clipw; }
-  int cliph() const { return m_cliph; }
-
-private:
-  QPainter *m_painter;
-  int m_clipx;
-  int m_clipy;
-  int m_clipw;
-  int m_cliph;
-};
-
-}
-
-#endif
index cec5db6..b55dc03 100644 (file)
 
 #include "KWQTextUtilities.h"
 
-namespace khtml {
-
-QPainter *printpainter = 0;
-
-void setPrintPainter( QPainter *printer )
-{
-    printpainter = printer;
-}
+namespace WebCore {
 
 void findWordBoundary(const QChar *chars, int len, int position, int *start, int *end)
 {
index efdc83a..53ec9d3 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the CSS implementation for KDE.
  *
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004 Apple Computer, Inc.
+ * Copyright (C) 2004, 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
  * Boston, MA 02111-1307, USA.
  *
  */
+
 #ifndef html_helper_h
 #define html_helper_h
 
 class QChar;
 
-#include "Color.h"
-#include <qfontmetrics.h>
-#include <qfont.h>
-
-namespace khtml
-{
-    class QPainter;
-
-    extern QPainter *printpainter;
-    void setPrintPainter(QPainter *printer);
-
-    void findWordBoundary(const QChar *chars, int len, int position, int *start, int *end);
-    int nextWordFromIndex(const QChar *chars, int len, int position, bool forward);
-    void findSentenceBoundary(const QChar *chars, int len, int position, int *start, int *end);
-    int nextSentenceFromIndex(const QChar *chars, int len, int position, bool forward);
-};
+namespace WebCore {
+    void findWordBoundary(const QChar*, int len, int position, int *start, int *end);
+    int nextWordFromIndex(const QChar*, int len, int position, bool forward);
+    void findSentenceBoundary(const QChar*, int len, int position, int *start, int *end);
+    int nextSentenceFromIndex(const QChar*, int len, int position, bool forward);
+}
 
 #endif
diff --git a/WebCore/khtml/misc/khtmllayout.h b/WebCore/khtml/misc/khtmllayout.h
deleted file mode 100644 (file)
index 3245016..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-    This file is part of the KDE libraries
-
-    Copyright (C) 1999 Lars Knoll (knoll@kde.org)
-    Copyright (C) 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.
-
-
-    This widget holds some useful definitions needed for layouting Elements
-*/
-
-#ifndef HTML_LAYOUT_H
-#define HTML_LAYOUT_H
-
-#include "IntRect.h"
-#include <stdint.h>
-
-namespace WebCore {
-
-    const int UNDEFINED = -1;
-
-    enum LengthType { Auto = 0, Relative, Percent, Fixed, Static, Intrinsic, MinIntrinsic };
-    struct Length
-    {
-        // FIXME: A more reliable and straightforward way of doing this is to just have
-        // an unsigned and extract the bits as needed, instead of relying on bit fields layout
-        // fitting in a 32-bit integer. Should fix this.
-
-        Length() { *((uint32_t *)this) = 0; }
-        Length(LengthType t) { type = t; value = 0; quirk = false; }
-        Length(int v, LengthType t, bool q=false) : value(v), type(t), quirk(q) {}
-        Length(const Length &o)
-            { *((uint32_t *)this) = *((uint32_t *)&o); }
-
-        Length& operator=(const Length& o)
-            { *((uint32_t *)this) = *((uint32_t *)&o); return *this; }
-        bool operator==(const Length& o) const
-            { return *((uint32_t *)this) == *((uint32_t *)&o); }
-        bool operator!=(const Length& o) const
-            { return *((uint32_t *)this) != *((uint32_t *)&o); }
-
-
-        int length() const { return value; }
-
-        // note: works only for certain types, returns -1 otherwise
-        int width(int maxWidth) const {
-            switch (type) {
-                case Fixed:
-                    return value;
-                case Percent:
-                    return maxWidth * value / 100;
-                case Auto:
-                    return maxWidth;
-                default:
-                    return -1;
-            }
-        }
-
-        int minWidth(int maxWidth) const {
-            switch (type) {
-                case Fixed:
-                    return value;
-                case Percent:
-                    return maxWidth * value / 100;
-                case Auto:
-                default:
-                    return 0;
-            }
-        }
-
-        bool isAuto() const { return type == Auto; }
-        bool isRelative() const { return type == Relative; }
-        bool isPercent() const { return type == Percent; }
-        bool isFixed() const { return type == Fixed; }
-        bool isStatic() const { return type == Static; }
-        bool isIntrinsicOrAuto() const { return type == Auto || type == MinIntrinsic || type == Intrinsic; }
-
-        int value : 28;
-        LengthType type : 3;
-        bool quirk : 1;
-    };
-
-    struct GapRects {
-        const IntRect& left() const { return m_left; }
-        const IntRect& center() const { return m_center; }
-        const IntRect& right() const { return m_right; }
-        
-        void uniteLeft(const IntRect& r) { m_left.unite(r); }
-        void uniteCenter(const IntRect& r) { m_center.unite(r); }
-        void uniteRight(const IntRect& r) { m_right.unite(r); }
-        void unite(const GapRects& o) { uniteLeft(o.left()); uniteCenter(o.center()); uniteRight(o.right()); }
-
-        operator IntRect() const {
-            IntRect result = m_left;
-            result.unite(m_center);
-            result.unite(m_right);
-            return result;
-        }
-        bool operator==(const GapRects& other) {
-            return m_left == other.left() && m_center == other.center() && m_right == other.right();
-        }
-        bool operator!=(const GapRects& other) { return !(*this == other); }
-
-    private:
-        IntRect m_left;
-        IntRect m_center;
-        IntRect m_right;
-    };
-
-}
-
-#endif
index 33d8ee2..49cea80 100644 (file)
@@ -100,31 +100,11 @@ void SVGAElementImpl::defaultEventHandler(EventImpl *evt)
         if(e && e->button() == 1)
             utarget = "_blank";
 
-        if(!evt->defaultPrevented())
-        {
-            int state = 0;
-            int button = 0;
-            if(e)
-            {
-                if(e->ctrlKey())
-                    state |= Qt::ControlButton;
-                if(e->shiftKey())
-                    state |= Qt::ShiftButton;
-                if(e->altKey())
-                    state |= Qt::AltButton;
-                if(e->metaKey())
-                    state |= Qt::MetaButton;
-                if(e->button() == 0)
-                    button = Qt::LeftButton;
-                else if(e->button() == 1)
-                    button = Qt::MidButton;
-                else if(e->button() == 2)
-                    button = Qt::RightButton;
-            }
+        if (!evt->defaultPrevented()) {
             if(ownerDocument() && ownerDocument()->view() && ownerDocument()->frame())
             {
                 //getDocument()->view()->resetCursor();
-                getDocument()->frame()->urlSelected(url, button, state, utarget);
+                getDocument()->frame()->urlSelected(url, utarget);
             }
         }
 
index ad157db..f26dcd2 100644 (file)
@@ -186,7 +186,7 @@ void SVGDocumentImpl::dispatchScrollEvent()
     rootElement()->dispatchEvent(event.get(), exceptioncode);
 }
 
-bool SVGDocumentImpl::dispatchKeyEvent(EventTargetImpl *target, QKeyEvent *key, bool keypress)
+bool SVGDocumentImpl::dispatchKeyEvent(EventTargetImpl* target, KeyEvent* key, bool keypress)
 {
     // dispatch key event
     int exceptioncode;
index 97df9ef..5f6f5f9 100644 (file)
@@ -62,7 +62,7 @@ namespace WebCore {
         void dispatchRecursiveEvent(EventImpl *event, NodeImpl *obj);
         void dispatchZoomEvent(float prevScale, float newScale);
         void dispatchScrollEvent();
-        bool dispatchKeyEvent(NodeImpl *target, QKeyEvent *key, bool keypress);
+        bool dispatchKeyEvent(NodeImpl* target, KeyEvent *key, bool keypress);
 
         virtual void recalcStyle(StyleChange = NoChange);
 
index 3f7c4a6..3e2c7f0 100644 (file)
@@ -33,7 +33,7 @@
 
 #import "KWQAccObjectCache.h"
 #import <kxmlcore/Assertions.h>
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "Widget.h"
 #import "WebCoreFrameBridge.h"
 #import "WebCoreFrameView.h"
index 8aabc0d..4d2f608 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "KWQAccObject.h"
 #import <kxmlcore/Assertions.h>
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "QString.h"
 #import "render_object.h"
 #import "WebCoreViewFactory.h"
index 14cae5c..9eee65f 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #import "KWQClipboard.h"
 #import <kxmlcore/Assertions.h>
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "MacFrame.h"
 #import "QStringList.h"
 #import "WebCoreGraphicsBridge.h"
index b605dcf..c3510a5 100644 (file)
@@ -26,9 +26,8 @@
 #import "config.h"
 #import "KWQComboBox.h"
 
-#import "KWQEvent.h"
 #import "KWQExceptions.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "KWQLineEdit.h"
 #import "KWQView.h"
 #import "MacFrame.h"
@@ -496,9 +495,8 @@ void QComboBox::populate()
                 if (layer)
                     layer->scrollRectToVisible(w->absoluteBoundingBoxRect());
             }
-            QEvent event(QEvent::FocusIn);
             if (widget->eventFilterObject())
-                const_cast<QObject *>(widget->eventFilterObject())->eventFilter(widget, &event);
+                widget->eventFilterObject()->eventFilterFocusIn();
         }
     }
     return become;
@@ -509,12 +507,10 @@ void QComboBox::populate()
     BOOL resign = [super resignFirstResponder];
     if (resign) {
         Widget *widget = [self widget];
-        if (widget) {
-            QEvent event(QEvent::FocusOut);
-            if (widget->eventFilterObject()) {
-                const_cast<QObject *>(widget->eventFilterObject())->eventFilter(widget, &event);
+        if (widget && widget->eventFilterObject()) {
+            widget->eventFilterObject()->eventFilterFocusOut();
+            if (widget)
                 [MacFrame::bridgeForWidget(widget) formControlIsResigningFirstResponder:self];
-            }
         }
     }
     return resign;
diff --git a/WebCore/kwq/KWQEvent.h b/WebCore/kwq/KWQEvent.h
deleted file mode 100644 (file)
index 7623851..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef QEVENT_H_
-#define QEVENT_H_
-
-#include "KWQNamespace.h"
-#include "IntPoint.h"
-#include "QString.h"
-
-#ifdef __OBJC__
-@class NSEvent;
-#else
-class NSEvent;
-#endif
-
-class QEvent {
-public:
-
-    enum Type {
-        MouseButtonPress,
-        MouseButtonRelease,
-        MouseButtonDblClick,
-        MouseMove,
-        FocusIn,
-        FocusOut,
-        KeyPress,
-        KeyRelease,
-        Wheel
-    };
-
-    QEvent(Type type) : _type(type) { }
-    virtual ~QEvent();
-
-    Type type() const { return _type; }
-
-private:
-    Type  _type;
-};
-
-class QMouseEvent : public QEvent {
-public:
-    QMouseEvent(Type, NSEvent *);
-    explicit QMouseEvent(Type); // uses AppKit's current event
-
-    const IntPoint &pos() const { return _position; }
-    int x() const { return _position.x(); }
-    int y() const { return _position.y(); }
-    int globalX() const { return _globalPosition.x(); }
-    int globalY() const { return _globalPosition.y(); }
-    Qt::ButtonState button() const { return static_cast<Qt::ButtonState>(_button); }
-    Qt::ButtonState state() const { return static_cast<Qt::ButtonState>(_state); }
-    Qt::ButtonState stateAfter() const { return static_cast<Qt::ButtonState>(_stateAfter); }
-
-    int clickCount() const { return _clickCount; }
-
-private:
-    void fixState();
-
-    IntPoint _position;
-    IntPoint _globalPosition;
-    int _button;
-    int _state;
-    int _stateAfter;
-    int _clickCount;
-};
-
-class QKeyEvent : public QEvent {
-public:
-    QKeyEvent(NSEvent *, bool forceAutoRepeat = false);
-
-    Qt::ButtonState state() const { return static_cast<Qt::ButtonState>(_state); }
-    bool isAccepted() const { return _isAccepted; }
-    QString text() const { return _text; }
-    bool isAutoRepeat() const { return _autoRepeat; }
-    void accept() { _isAccepted = true; }
-    void ignore() { _isAccepted = false; }
-
-    int WindowsKeyCode() const { return _WindowsKeyCode; }
-    QString unmodifiedText() const { return _unmodifiedText; }
-    QString keyIdentifier() const { return _keyIdentifier; }
-
-private:
-    int _state;
-    QString _text;
-    QString _unmodifiedText;
-    QString _keyIdentifier;
-    bool _autoRepeat;
-    bool _isAccepted;
-    int _WindowsKeyCode;
-};
-
-class QWheelEvent : public QEvent {
-public:
-    QWheelEvent(const IntPoint& position, const IntPoint& globalPosition, int delta, int state, Qt::Orientation orientation)
-        : QEvent(Wheel), _position(position), _globalPosition(globalPosition), _delta(delta), _state(state)
-        , _orientation(orientation), _isAccepted(false)
-        { }
-    QWheelEvent(NSEvent *);
-
-    const IntPoint &pos() const { return _position; }
-    const IntPoint &globalPos() const { return _globalPosition; }
-    int delta() const { return _delta; }
-    int state() const { return _state; }
-    Qt::Orientation orientation() const { return _orientation; }
-    bool isAccepted() const { return _isAccepted; }
-
-    int x() const { return _position.x(); }
-    int y() const { return _position.y(); }
-    int globalX() const { return _globalPosition.x(); }
-    int globalY() const { return _globalPosition.y(); }
-
-    void accept() { _isAccepted = true; }
-    void ignore() { _isAccepted = false; }
-
-private:
-    IntPoint _position;
-    IntPoint _globalPosition;
-    int _delta;
-    int _state;
-    Qt::Orientation _orientation;
-    bool _isAccepted;
-};
-
-#endif
index a78f910..713acce 100644 (file)
@@ -26,9 +26,8 @@
 #import "config.h"
 #import "KWQFileButton.h"
 
-#import "KWQEvent.h"
 #import "KWQExceptions.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "MacFrame.h"
 #import "WebCoreFrameBridge.h"
 #import "render_form.h"
@@ -161,13 +160,9 @@ void KWQFileButton::focusChanged(bool nowHasFocus)
             if (layer)
                 layer->scrollRectToVisible(widget->absoluteBoundingBoxRect());
         }        
-        QEvent event(QEvent::FocusIn);
-        const_cast<QObject *>(eventFilterObject())->eventFilter(this, &event);
-    }
-    else {
-        QEvent event(QEvent::FocusOut);
-        const_cast<QObject *>(eventFilterObject())->eventFilter(this, &event);
-    }
+        eventFilterObject()->eventFilterFocusIn();
+    } else
+        eventFilterObject()->eventFilterFocusOut();
 }
 
 void KWQFileButton::clicked()
index 9eacc0c..741a32e 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "KWQExceptions.h"
 #import "QString.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "WebCoreTextRendererFactory.h"
 
 QFont::QFont()
index c6d4e80..a7f7688 100644 (file)
@@ -30,7 +30,7 @@
 
 #import "KWQFont.h"
 #import "KWQLogging.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 
 #import "Shared.h"
 
index ad54540..5cbd137 100644 (file)
@@ -27,7 +27,7 @@
 #import "KWQKJobClasses.h"
 
 #import "KWQExceptions.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "KWQLoader.h"
 #import "KWQLogging.h"
 #import "KWQResourceLoader.h"
index eba57fa..b3d3578 100644 (file)
@@ -27,7 +27,7 @@
 #import "KWQKURL.h"
 
 #import <kxmlcore/Assertions.h>
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "KWQRegExp.h"
 #import "KWQTextCodec.h"
 #import <kxmlcore/Vector.h>
index 0e7ac69..9561ce0 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#include "config.h"
+#import "config.h"
 #import "KWQListBox.h"
 
-#import <kxmlcore/Assertions.h>
 #import "KWQExceptions.h"
-#import "MacFrame.h"
-#import "KWQEvent.h"
 #import "KWQView.h"
+#import "MacFrame.h"
 #import "WebCoreFrameBridge.h"
 #import "WebCoreScrollView.h"
 #import "WebCoreTextRenderer.h"
 #import "WebCoreTextRendererFactory.h"
+#import <kxmlcore/Assertions.h>
 
 #import "render_form.h"
 
@@ -575,11 +574,8 @@ static Boolean KWQTableViewTypeSelectCallback(UInt32 index, void *listDataPtr, v
         }        
         [self _KWQ_setKeyboardFocusRingNeedsDisplay];
 
-        if (_box) {
-            QEvent event(QEvent::FocusIn);
-            if (_box->eventFilterObject())
-                const_cast<QObject *>(_box->eventFilterObject())->eventFilter(_box, &event);
-        }
+        if (_box && _box->eventFilterObject())
+            _box->eventFilterObject()->eventFilterFocusIn();
     }
 
     return become;
@@ -588,13 +584,10 @@ static Boolean KWQTableViewTypeSelectCallback(UInt32 index, void *listDataPtr, v
 - (BOOL)resignFirstResponder
 {
     BOOL resign = [super resignFirstResponder];
-    if (resign && _box) {
-        QEvent event(QEvent::FocusOut);
-
-        if (_box->eventFilterObject()) {
-            const_cast<QObject *>(_box->eventFilterObject())->eventFilter(_box, &event);
+    if (resign && _box && _box->eventFilterObject()) {
+        _box->eventFilterObject()->eventFilterFocusOut();
+        if (_box)
             [MacFrame::bridgeForWidget(_box) formControlIsResigningFirstResponder:self];
-        }
     }
     return resign;
 }
index 4ace3e6..a72a053 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "KWQExceptions.h"
 #import "KWQFormData.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "KWQKJobClasses.h"
 #import "KWQLogging.h"
 #import "KWQResourceLoader.h"
index 7c4d227..7fbc179 100644 (file)
 
 class Qt {
 public:
-     enum ButtonState {
-        NoButton        = 0x0000,
-        LeftButton      = 0x0001,
-        RightButton     = 0x0002,
-        MidButton       = 0x0004,
-        MouseButtonMask = 0x0007,
-        ShiftButton     = 0x0008,
-        ControlButton   = 0x0010,
-        AltButton       = 0x0020,
-        MetaButton      = 0x0040,
-        KeyButtonMask   = 0x0078,
-        Keypad          = 0x4000
-    };
-
     enum AlignmentFlags {
         AlignAuto       = 0x0000,           // text alignment
         AlignLeft       = 0x0001,
index a6c4726..4dc2262 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "KWQObject.h"
 
-#include "KWQEvent.h"
 #include <kxmlcore/Assertions.h>
 #include <kxmlcore/HashMap.h>
 
@@ -80,11 +79,6 @@ void QObject::disconnect(const QObject *sender, const char *signalName, const QO
     signal->disconnect(KWQSlot(const_cast<QObject *>(receiver), member));
 }
 
-bool QObject::event(QEvent *)
-{
-    return false;
-}
-
 bool QObject::isKHTMLLoader() const
 {
     return false;
index d742270..9e42b39 100644 (file)
@@ -37,8 +37,6 @@
 #define emit
 #define Q_OBJECT
 
-class QEvent;
-
 class KWQGuardedPtrBase;
 
 class QObject : public Qt {
@@ -51,13 +49,12 @@ public:
     void connect(const QObject *sender, const char *signal, const char *member) const
         { connect(sender, signal, this, member); }
 
-    void installEventFilter(const QObject *o) { _eventFilterObject = o; }
-    void removeEventFilter(const QObject *) { _eventFilterObject = 0; }
-    const QObject *eventFilterObject() const { return _eventFilterObject; }
-
-    virtual bool eventFilter(QObject *object, QEvent *event) { return false; }
+    void installEventFilter(const QObject* o) { _eventFilterObject = o; }
+    void removeEventFilter() { _eventFilterObject = 0; }
+    const QObject* eventFilterObject() const { return _eventFilterObject; }
 
-    virtual bool event(QEvent *);
+    virtual void eventFilterFocusIn() const { }
+    virtual void eventFilterFocusOut() const { }
 
     virtual bool isKHTMLLoader() const;
     virtual bool isFrame() const;
index 049147a..fdfe52a 100644 (file)
@@ -34,7 +34,7 @@
 #import "kjs_window.h"
 
 #import <kxmlcore/Assertions.h>
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "MacFrame.h"
 
 using namespace WebCore;
index b3c239f..545b350 100644 (file)
@@ -31,7 +31,7 @@
 #import "Brush.h"
 #import "KWQExceptions.h"
 #import "KWQFont.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "Pen.h"
 #import "Image.h"
 #import "FloatRect.h"
index 23f86d3..902d10a 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
+#import "config.h"
 #import "KWQSlider.h"
 
-#import "KWQEvent.h"
 #import "KWQExceptions.h"
 #import "KWQLineEdit.h"
 #import "KWQView.h"
@@ -109,11 +108,8 @@ using namespace WebCore;
                 layer->scrollRectToVisible(widget->absoluteBoundingBoxRect());
         }
 
-        if (slider) {
-            QEvent event(QEvent::FocusIn);
-            if (slider->eventFilterObject())
-                const_cast<QObject *>(slider->eventFilterObject())->eventFilter(slider, &event);
-        }
+        if (slider && slider->eventFilterObject())
+            slider->eventFilterObject()->eventFilterFocusIn();
     }
     return become;
 }
@@ -121,12 +117,10 @@ using namespace WebCore;
 - (BOOL)resignFirstResponder
 {
     BOOL resign = [super resignFirstResponder];
-    if (resign && slider) {
-        QEvent event(QEvent::FocusOut);
-        if (slider->eventFilterObject()) {
-            const_cast<QObject *>(slider->eventFilterObject())->eventFilter(slider, &event);
+    if (resign && slider && slider->eventFilterObject()) {
+        slider->eventFilterObject()->eventFilterFocusOut();
+        if (slider)
             [MacFrame::bridgeForWidget(slider) formControlIsResigningFirstResponder:self];
-        }
     }
     return resign;
 }
index 35f30c7..fb02247 100644 (file)
 #include "config.h"
 #include "KWQSlot.h"
 
-#include <kxmlcore/Assertions.h>
-
 #include "DocumentImpl.h"
 #include "Frame.h"
-#include "kjs_window.h"
 #include "render_form.h"
-#include "render_layer.h"
 #include "xmlhttprequest.h"
+#include <kxmlcore/Assertions.h>
 
 using namespace WebCore;
 
 using KIO::Job;
-using KJS::WindowQObject;
 
 enum FunctionNumber {
     slotClicked,
-    slotParentDestroyed,
     slotPerformSearch,
     slotReturnPressed,
     slotSelected,
@@ -80,9 +75,7 @@ KWQSlot::KWQSlot(QObject *object, const char *member)
        
     #undef CASE
 
-    if (KWQNamesMatch(member, SLOT(parentDestroyed()))) {
-        m_function = slotParentDestroyed;
-    } else if (KWQNamesMatch(member, SLOT(slotTextChanged(const DOMString &)))) {
+    if (KWQNamesMatch(member, SLOT(slotTextChanged(const DOMString &)))) {
         m_function = slotTextChangedWithString;
     } else if (KWQNamesMatch(member, SLOT(slotData(KIO::Job *, const char *, int)))) {
         if (object->isKHTMLLoader()) {
@@ -127,7 +120,6 @@ void KWQSlot::call() const
     
     switch (m_function) {
         CASE(slotClicked, RenderFormElement, slotClicked)
-        CASE(slotParentDestroyed, WindowQObject, parentDestroyed)
         CASE(slotPerformSearch, RenderLineEdit, slotPerformSearch)
         CASE(slotReturnPressed, RenderLineEdit, slotReturnPressed)
         CASE(slotSelectionChanged, RenderFormElement, slotSelectionChanged)
index 3f28731..5ab4923 100644 (file)
 #import "DOMCSS.h"
 #import "DOMHTML.h"
 #import "EventNames.h"
-#import <kxmlcore/Assertions.h>
-#import "MacFrame.h"
-#import "KWQEvent.h"
+#import "KWQKHTMLSettings.h"
 #import "KWQTextEdit.h"
-#import "render_replaced.h"
+#import "MacFrame.h"
 #import "WebCoreFrameBridge.h"
-#import "KWQKHTMLSettings.h"
+#import "render_replaced.h"
+#import <kxmlcore/Assertions.h>
 
 using namespace WebCore;
 using namespace EventNames;
@@ -972,11 +971,8 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
                 layer->scrollRectToVisible(w->absoluteBoundingBoxRect());
         }
         [self _KWQ_setKeyboardFocusRingNeedsDisplay];
-        if (widget) {
-            QEvent event(QEvent::FocusIn);
-            if (widget->eventFilterObject())
-                const_cast<QObject *>(widget->eventFilterObject())->eventFilter(widget, &event);
-        }
+        if (widget && widget->eventFilterObject())
+            widget->eventFilterObject()->eventFilterFocusIn();
     }
 
     return become;
@@ -993,12 +989,10 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
     if (resign) {
         [self _KWQ_setKeyboardFocusRingNeedsDisplay];
 
-        if (widget) {
-            QEvent event(QEvent::FocusOut);
-            if (widget->eventFilterObject()) {
-                const_cast<QObject *>(widget->eventFilterObject())->eventFilter(widget, &event);
+        if (widget && widget->eventFilterObject()) {
+            widget->eventFilterObject()->eventFilterFocusOut();
+            if (widget)
                 [MacFrame::bridgeForWidget(widget) formControlIsResigningFirstResponder:self];
-            }
         }        
     }
 
index 5cadd82..8cd97aa 100644 (file)
 #import "config.h"
 #import "KWQTextField.h"
 
-#import <kxmlcore/Assertions.h>
-#import "MacFrame.h"
 #import "KWQLineEdit.h"
-#import "KWQEvent.h"
 #import "KWQView.h"
+#import "MacFrame.h"
 #import "WebCoreFrameBridge.h"
 #import "render_form.h"
+#import <kxmlcore/Assertions.h>
 
 using namespace WebCore;
 
@@ -404,11 +403,8 @@ using namespace WebCore;
                 layer->scrollRectToVisible(w->absoluteBoundingBoxRect());
         }
         
-        if (widget) {
-            QEvent event(QEvent::FocusIn);
-            if (widget->eventFilterObject())
-                const_cast<QObject *>(widget->eventFilterObject())->eventFilter(widget, &event);
-        }
+        if (widget && widget->eventFilterObject())
+            widget->eventFilterObject()->eventFilterFocusIn();
         
         // Sending the onFocus event above, may have resulted in a blur() - if this
         // happens when tabbing from another text field, then endEditing: and
@@ -424,13 +420,10 @@ using namespace WebCore;
     } else {
         lastSelectedRange = [self selectedRange];
         
-        if (widget) {
-            QEvent event(QEvent::FocusOut);
-            if (widget->eventFilterObject()) {
-                const_cast<QObject *>(widget->eventFilterObject())->eventFilter(widget, &event);
-                if (widget)
-                    [MacFrame::bridgeForWidget(widget) formControlIsResigningFirstResponder:field];
-            }
+        if (widget && widget->eventFilterObject()) {
+            widget->eventFilterObject()->eventFilterFocusOut();
+            if (widget)
+                [MacFrame::bridgeForWidget(widget) formControlIsResigningFirstResponder:field];
         }
     }
 }
index 1f62d1a..2a1d96a 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #import "WebCoreSettings.h"
 
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "MacFrame.h"
 #import "KWQKHTMLSettings.h"
 #import "WebCoreFrameBridge.h"
index 902179b..52795e8 100644 (file)
 #include "Frame.h"
 #include "FramePrivate.h"
 
+#include "ApplyStyleCommand.h"
 #include "Cache.h"
 #include "CachedCSSStyleSheet.h"
 #include "DOMImplementationImpl.h"
 #include "DocLoader.h"
+#include "EditingTextImpl.h"
 #include "EventNames.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "HTMLCollectionImpl.h"
 #include "HTMLFormElementImpl.h"
 #include "HTMLGenericFormElementImpl.h"
-#include "KWQEvent.h"
+#include "MouseEvent.h"
+#include "MouseEventWithHitTestResults.h"
 #include "NodeListImpl.h"
+#include "PlatformString.h"
+#include "Plugin.h"
 #include "RenderBlock.h"
 #include "RenderText.h"
 #include "SegmentedString.h"
-#include "ApplyStyleCommand.h"
+#include "TypingCommand.h"
+#include "VisiblePosition.h"
 #include "css_computedstyle.h"
 #include "css_valueimpl.h"
-#include "csshelper.h"
 #include "cssproperties.h"
 #include "cssstyleselector.h"
 #include "dom2_eventsimpl.h"
 #include "dom2_rangeimpl.h"
-#include "PlatformString.h"
 #include "html_baseimpl.h"
 #include "html_documentimpl.h"
 #include "html_imageimpl.h"
 #include "html_objectimpl.h"
 #include "htmlediting.h"
 #include "htmlnames.h"
-#include "khtml_events.h"
 #include "khtml_settings.h"
 #include "kjs_proxy.h"
 #include "kjs_window.h"
@@ -67,8 +70,6 @@
 #include "markup.h"
 #include "render_canvas.h"
 #include "render_frames.h"
-#include "TypingCommand.h"
-#include "VisiblePosition.h"
 #include "visible_text.h"
 #include "visible_units.h"
 #include "xml_tokenizer.h"
@@ -81,8 +82,6 @@
 #include <qptrlist.h>
 #include <qtextcodec.h>
 #include <sys/types.h>
-#include "Plugin.h"
-#include "EditingTextImpl.h"
 
 #if !WIN32
 #include <unistd.h>
@@ -103,29 +102,24 @@ using namespace HTMLNames;
 
 const double caretBlinkFrequency = 0.5;
 
-class PartStyleSheetLoader : public CachedObjectClient
-{
+class UserStyleSheetLoader : public CachedObjectClient {
 public:
-    PartStyleSheetLoader(Frame* frame, DOMString url, DocLoader* dl)
+    UserStyleSheetLoader(Frame* frame, const String& url, DocLoader* dl)
+        : m_frame(frame)
+        , m_cachedSheet(Cache::requestStyleSheet(dl, url))
     {
-        m_frame = frame;
-        m_cachedSheet = Cache::requestStyleSheet(dl, url);
-        if (m_cachedSheet)
-            m_cachedSheet->ref(this);
+        m_cachedSheet->ref(this);
     }
-    virtual ~PartStyleSheetLoader()
+    ~UserStyleSheetLoader()
     {
-        if (m_cachedSheet)
-            m_cachedSheet->deref(this);
+        m_cachedSheet->deref(this);
     }
-    virtual void setStyleSheet(const DOMString&, const DOMString &sheet)
+private:
+    virtual void setStyleSheet(const String&, const String &sheet)
     {
-        if (m_frame)
-            m_frame->setUserStyleSheet( sheet.qstring() );
-        delete this;
+        m_frame->setUserStyleSheet(sheet.qstring());
     }
-
-    QGuardedPtr<Frame> m_frame;
+    Frame* m_frame;
     CachedCSSStyleSheet* m_cachedSheet;
 };
 
@@ -179,22 +173,28 @@ Frame::~Frame()
     --FrameCounter::count;
 #endif
 
-  cancelRedirection();
+    cancelRedirection();
 
-  if (!d->m_bComplete)
-    closeURL();
+    if (!d->m_bComplete)
+        closeURL();
 
-  clear(false);
+    clear(false);
 
-  if (d->m_view) {
-    d->m_view->hide();
-    d->m_view->viewport()->hide();
-    d->m_view->m_frame = 0;
-  }
+    if (d->m_jscript && d->m_jscript->haveInterpreter())
+        if (Window* w = Window::retrieveWindow(this))
+            w->disconnectFrame();
+
+    if (d->m_view) {
+        d->m_view->hide();
+        d->m_view->viewport()->hide();
+        d->m_view->m_frame = 0;
+    }
   
-  ASSERT(!d->m_lifeSupportTimer.isActive());
+    ASSERT(!d->m_lifeSupportTimer.isActive());
 
-  delete d; d = 0;
+    delete d->m_userStyleSheetLoader;
+    delete d;
+    d = 0;
 }
 
 bool Frame::didOpenURL(const KURL &url)
@@ -984,7 +984,7 @@ void Frame::changeLocation(const QString &URL, const QString &referrer, bool loc
     if (!referrer.isEmpty())
         args.metaData().set("referrer", referrer);
 
-    urlSelected(URL, 0, 0, "_self", args);
+    urlSelected(URL, "_self", args);
 }
 
 void Frame::redirectionTimerFired(Timer<Frame>*)
@@ -1035,16 +1035,20 @@ QString Frame::encoding() const
     return(settings()->encoding());
 }
 
-void Frame::setUserStyleSheet(const KURL &url)
+void Frame::setUserStyleSheet(const KURLurl)
 {
-  if ( d->m_doc && d->m_doc->docLoader() )
-    (void) new PartStyleSheetLoader(this, url.url(), d->m_doc->docLoader());
+    delete d->m_userStyleSheetLoader;
+    d->m_userStyleSheetLoader = 0;
+    if (d->m_doc && d->m_doc->docLoader())
+        d->m_userStyleSheetLoader = new UserStyleSheetLoader(this, url.url(), d->m_doc->docLoader());
 }
 
-void Frame::setUserStyleSheet(const QString &styleSheet)
+void Frame::setUserStyleSheet(const QStringstyleSheet)
 {
-  if ( d->m_doc )
-    d->m_doc->setUserStyleSheet( styleSheet );
+    delete d->m_userStyleSheetLoader;
+    d->m_userStyleSheetLoader = 0;
+    if (d->m_doc)
+        d->m_doc->setUserStyleSheet(styleSheet);
 }
 
 bool Frame::gotoAnchor( const QString &name )
@@ -1311,16 +1315,11 @@ void Frame::paintDragCaret(QPainter *p, const IntRect &rect) const
     d->m_dragCaret.paintCaret(p, rect);
 }
 
-void Frame::urlSelected( const QString &url, int button, int state, const QString &_target,
-                             URLArgs args )
+void Frame::urlSelected(const QString &url, const QString& _target, const URLArgs& args )
 {
-  bool hasTarget = false;
-
   QString target = _target;
-  if ( target.isEmpty() && d->m_doc )
+  if (target.isEmpty() && d->m_doc)
     target = d->m_doc->baseTarget();
-  if ( !target.isEmpty() )
-      hasTarget = true;
 
   if (url.startsWith("javascript:", false)) {
     executeScript(0, KURL::decode_string(url.mid(11)), true);
@@ -1328,23 +1327,22 @@ void Frame::urlSelected( const QString &url, int button, int state, const QStrin
   }
 
   KURL cURL = completeURL(url);
-
-  if ( !cURL.isValid() )
+  if (!cURL.isValid())
     // ### ERROR HANDLING
     return;
 
-  args.frameName = target;
+  URLArgs argsCopy = args;
+  argsCopy.frameName = target;
 
-  if ( d->m_bHTTPRefresh )
-  {
+  if (d->m_bHTTPRefresh) {
     d->m_bHTTPRefresh = false;
-    args.metaData().set("cache", "refresh");
+    argsCopy.metaData().set("cache", "refresh");
   }
 
-
   if (!d->m_referrer.isEmpty())
-    args.metaData().set("referrer", d->m_referrer);
-  urlSelected(cURL, button, state, args);
+    argsCopy.metaData().set("referrer", d->m_referrer);
+
+  urlSelected(cURL, argsCopy);
 }
 
 DOMString Frame::requestFrameName()
@@ -1741,7 +1739,7 @@ bool Frame::isPointInsideSelection(int x, int y)
    return false;
 }
 
-void Frame::selectClosestWordFromMouseEvent(QMouseEvent *mouse, NodeImpl *innerNode, int x, int y)
+void Frame::selectClosestWordFromMouseEvent(MouseEvent *mouse, NodeImpl *innerNode, int x, int y)
 {
     SelectionController selection;
 
@@ -1762,31 +1760,35 @@ void Frame::selectClosestWordFromMouseEvent(QMouseEvent *mouse, NodeImpl *innerN
         setSelection(selection);
 }
 
-void Frame::handleMousePressEventDoubleClick(MousePressEvent *event)
+void Frame::handleMousePressEventDoubleClick(MouseEventWithHitTestResults* event)
 {
-    if (event->qmouseEvent()->button() == LeftButton) {
-        if (selection().isRange()) {
+    if (event->event()->button() == LeftButton) {
+        if (selection().isRange())
             // A double-click when range is already selected
             // should not change the selection.  So, do not call
             // selectClosestWordFromMouseEvent, but do set
             // m_beganSelectingText to prevent khtmlMouseReleaseEvent
             // from setting caret selection.
             d->m_beganSelectingText = true;
-        } else {
-            selectClosestWordFromMouseEvent(event->qmouseEvent(), event->innerNode(), event->x(), event->y());
+        else {
+            int x, y;
+            view()->viewportToContents(event->event()->x(), event->event()->y(), x, y);
+            selectClosestWordFromMouseEvent(event->event(), event->innerNode(), x, y);
         }
     }
 }
 
-void Frame::handleMousePressEventTripleClick(MousePressEvent *event)
+void Frame::handleMousePressEventTripleClick(MouseEventWithHitTestResults* event)
 {
-    QMouseEvent *mouse = event->qmouseEvent();
+    MouseEvent *mouse = event->event();
     NodeImpl *innerNode = event->innerNode();
     
     if (mouse->button() == LeftButton && innerNode && innerNode->renderer() &&
         mouseDownMayStartSelect() && innerNode->renderer()->shouldSelect()) {
         SelectionController selection;
-        VisiblePosition pos(innerNode->renderer()->positionForCoordinates(event->x(), event->y()));
+        int x, y;
+        view()->viewportToContents(event->event()->x(), event->event()->y(), x, y);
+        VisiblePosition pos(innerNode->renderer()->positionForCoordinates(x, y));
         if (pos.isNotNull()) {
             selection.moveTo(pos);
             selection.expandUsingGranularity(PARAGRAPH);
@@ -1801,9 +1803,9 @@ void Frame::handleMousePressEventTripleClick(MousePressEvent *event)
     }
 }
 
-void Frame::handleMousePressEventSingleClick(MousePressEvent *event)
+void Frame::handleMousePressEventSingleClick(MouseEventWithHitTestResults* event)
 {
-    QMouseEvent *mouse = event->qmouseEvent();
+    MouseEvent *mouse = event->event();
     NodeImpl *innerNode = event->innerNode();
     
     if (mouse->button() == LeftButton) {
@@ -1812,15 +1814,16 @@ void Frame::handleMousePressEventSingleClick(MousePressEvent *event)
             SelectionController sel;
             
             // Extend the selection if the Shift key is down, unless the click is in a link.
-            bool extendSelection = (mouse->state() & ShiftButton) && (event->url().isNull());
+            bool extendSelection = mouse->shiftKey() && event->url().isNull();
 
             // Don't restart the selection when the mouse is pressed on an
             // existing selection so we can allow for text dragging.
-            if (!extendSelection && isPointInsideSelection(event->x(), event->y())) {
+            int x, y;
+            view()->viewportToContents(event->event()->x(), event->event()->y(), x, y);
+            if (!extendSelection && isPointInsideSelection(x, y))
                 return;
-            }
 
-            VisiblePosition visiblePos(innerNode->renderer()->positionForCoordinates(event->x(), event->y()));
+            VisiblePosition visiblePos(innerNode->renderer()->positionForCoordinates(x, y));
             if (visiblePos.isNull())
                 visiblePos = VisiblePosition(innerNode, innerNode->caretMinOffset(), DOWNSTREAM);
             Position pos = visiblePos.deepEquivalent();
@@ -1854,10 +1857,10 @@ void Frame::handleMousePressEventSingleClick(MousePressEvent *event)
     }
 }
 
-void Frame::khtmlMousePressEvent(MousePressEvent *event)
+void Frame::khtmlMousePressEvent(MouseEventWithHitTestResults* event)
 {
     DOMString url = event->url();
-    QMouseEvent *mouse = event->qmouseEvent();
+    MouseEvent *mouse = event->event();
     NodeImpl *innerNode = event->innerNode();
 
     d->m_mousePressNode = innerNode;
@@ -1870,14 +1873,15 @@ void Frame::khtmlMousePressEvent(MousePressEvent *event)
         d->m_strSelectedURLTarget = event->target().qstring();
     }
 
-    if (mouse->button() == LeftButton || mouse->button() == MidButton) {
+    if (mouse->button() == LeftButton || mouse->button() == MiddleButton) {
         d->m_bMousePressed = true;
         d->m_beganSelectingText = false;
 
         if (mouse->clickCount() == 2) {
             handleMousePressEventDoubleClick(event);
             return;
-        } else if (mouse->clickCount() >= 3) {
+        }
+        if (mouse->clickCount() >= 3) {
             handleMousePressEventTripleClick(event);
             return;
         }
@@ -1885,21 +1889,22 @@ void Frame::khtmlMousePressEvent(MousePressEvent *event)
     }
 }
 
-void Frame::handleMouseMoveEventSelection(MouseMoveEvent *event)
+void Frame::handleMouseMoveEventSelection(MouseEventWithHitTestResults* event)
 {
     // Mouse not pressed. Do nothing.
     if (!d->m_bMousePressed)
         return;
 
-    QMouseEvent *mouse = event->qmouseEvent();
+    MouseEvent *mouse = event->event();
     NodeImpl *innerNode = event->innerNode();
 
-    if (mouse->state() != LeftButton || !innerNode || !innerNode->renderer() ||
-            !mouseDownMayStartSelect() || !innerNode->renderer()->shouldSelect())
+    if (mouse->button() != 0 || !innerNode || !innerNode->renderer() || !mouseDownMayStartSelect() || !innerNode->renderer()->shouldSelect())
         return;
 
     // handle making selection
-    VisiblePosition pos(innerNode->renderer()->positionForCoordinates(event->x(), event->y()));
+    int x, y;
+    view()->viewportToContents(event->event()->x(), event->event()->y(), x, y);
+    VisiblePosition pos(innerNode->renderer()->positionForCoordinates(x, y));
 
     // Don't modify the selection if we're not on a node.
     if (pos.isNull())
@@ -1923,12 +1928,12 @@ void Frame::handleMouseMoveEventSelection(MouseMoveEvent *event)
         setSelection(sel);
 }
 
-void Frame::khtmlMouseMoveEvent(MouseMoveEvent *event)
+void Frame::khtmlMouseMoveEvent(MouseEventWithHitTestResults* event)
 {
     handleMouseMoveEventSelection(event);
 }
 
-void Frame::khtmlMouseReleaseEvent( MouseReleaseEvent *event )
+void Frame::khtmlMouseReleaseEvent(MouseEventWithHitTestResults* event)
 {
     // Used to prevent mouseMoveEvent from initiating a drag before
     // the mouse is pressed again.
@@ -1938,13 +1943,14 @@ void Frame::khtmlMouseReleaseEvent( MouseReleaseEvent *event )
     // We do this so when clicking on the selection, the selection goes away.
     // However, if we are editing, place the caret.
     if (mouseDownMayStartSelect() && !d->m_beganSelectingText
-            && d->m_dragStartPos.x() == event->qmouseEvent()->x()
-            && d->m_dragStartPos.y() == event->qmouseEvent()->y()
+            && d->m_dragStartPos == event->event()->pos()
             && d->m_selection.isRange()) {
         SelectionController selection;
         NodeImpl *node = event->innerNode();
         if (node && node->isContentEditable() && node->renderer()) {
-            VisiblePosition pos = node->renderer()->positionForCoordinates(event->x(), event->y());
+            int x, y;
+            view()->viewportToContents(event->event()->x(), event->event()->y(), x, y);
+            VisiblePosition pos = node->renderer()->positionForCoordinates(x, y);
             selection.moveTo(pos);
         }
         if (shouldChangeSelection(selection))
@@ -3087,12 +3093,12 @@ bool Frame::canMouseDownStartSelect(NodeImpl* node)
     return true;
 }
 
-void Frame::khtmlMouseDoubleClickEvent(MouseDoubleClickEvent *event)
+void Frame::khtmlMouseDoubleClickEvent(MouseEventWithHitTestResults* event)
 {
     passWidgetMouseDownEventToWidget(event, true);
 }
 
-bool Frame::passWidgetMouseDownEventToWidget(MouseEvent *event, bool isDoubleClick)
+bool Frame::passWidgetMouseDownEventToWidget(MouseEventWithHitTestResults* event, bool isDoubleClick)
 {
     // Figure out which view to send the event to.
     RenderObject *target = event->innerNode() ? event->innerNode()->renderer() : 0;
index 8182fd6..030d36b 100644 (file)
@@ -64,13 +64,9 @@ class EditCommandPtr;
 class FramePrivate;
 class FrameTree;
 class KJSProxyImpl;
-class MouseDoubleClickEvent;
-class MouseEvent;
-class MouseMoveEvent;
-class MousePressEvent;
-class MouseReleaseEvent;
 class Page;
 class Plugin;
+class MouseEventWithHitTestResults;
 class RangeImpl;
 class Selection;
 class SelectionController;
@@ -641,18 +637,16 @@ public:
    */
   void htmlError(int errorCode, const QString& text, const KURL& reqUrl);
 
-  virtual void khtmlMouseDoubleClickEvent(MouseDoubleClickEvent *event);
-  virtual void khtmlMousePressEvent(MousePressEvent *event);
-  virtual void khtmlMouseMoveEvent(MouseMoveEvent *event);
-  virtual void khtmlMouseReleaseEvent(MouseReleaseEvent *event);
-  virtual void khtmlDrawContentsEvent(DrawContentsEvent*) { }
+  virtual void khtmlMouseDoubleClickEvent(MouseEventWithHitTestResults*);
+  virtual void khtmlMousePressEvent(MouseEventWithHitTestResults*);
+  virtual void khtmlMouseMoveEvent(MouseEventWithHitTestResults*);
+  virtual void khtmlMouseReleaseEvent(MouseEventWithHitTestResults*);
   
-  void selectClosestWordFromMouseEvent(QMouseEvent *mouse, NodeImpl *innerNode, int x, int y);
+  void selectClosestWordFromMouseEvent(MouseEvent*, NodeImpl* innerNode, int x, int y);
 
   virtual bool openFile();
 
-  virtual void urlSelected( const QString &url, int button, int state,
-                            const QString &_target, URLArgs args = URLArgs());
+  virtual void urlSelected(const QString& url, const QString& target, const URLArgs& args = URLArgs());
 
 
   // Methods with platform-specific overrides (and no base class implementation).
@@ -700,8 +694,8 @@ public:
   virtual bool canGoBackOrForward(int distance) const = 0;
   virtual void openURLRequest(const KURL &, const URLArgs &) = 0;
   virtual void submitForm(const KURL &, const URLArgs &) = 0;
-  virtual void urlSelected(const KURL &url, int button, int state, const URLArgs &args) = 0;
-  virtual bool passSubframeEventToSubframe(NodeImpl::MouseEvent &) = 0;
+  virtual void urlSelected(const KURL&, const URLArgs& args) = 0;
+  virtual bool passSubframeEventToSubframe(MouseEventWithHitTestResults &) = 0;
   virtual bool passWheelEventToChildWidget(NodeImpl *) = 0;
   virtual bool lastEventIsMouseUp() const = 0;
   virtual QString overrideMediaType() const = 0;
@@ -861,7 +855,7 @@ private:
   bool scrollbarsVisible();
   void scrollToAnchor(const KURL &);
   bool canMouseDownStartSelect(NodeImpl* node);
-  bool passWidgetMouseDownEventToWidget(MouseEvent *, bool isDoubleClick);
+  bool passWidgetMouseDownEventToWidget(MouseEventWithHitTestResults *, bool isDoubleClick);
   bool passWidgetMouseDownEventToWidget(RenderWidget *);
   virtual bool passMouseDownEventToWidget(Widget *) = 0;
 
@@ -899,18 +893,18 @@ protected:
   
   void receivedFirstData();
 
-  bool handleMouseMoveEventDrag(MouseMoveEvent *event);
-  bool handleMouseMoveEventOver(MouseMoveEvent *event);
-  void handleMouseMoveEventSelection(MouseMoveEvent *event);
+  bool handleMouseMoveEventDrag(MouseEventWithHitTestResults*);
+  bool handleMouseMoveEventOver(MouseEventWithHitTestResults*);
+  void handleMouseMoveEventSelection(MouseEventWithHitTestResults*);
 
   /**
    * @internal Extracts anchor and tries both encoded and decoded form.
    */
   void gotoAnchor();
 
-  void handleMousePressEventSingleClick(MousePressEvent *event);
-  void handleMousePressEventDoubleClick(MousePressEvent *event);
-  void handleMousePressEventTripleClick(MousePressEvent *event);
+  void handleMousePressEventSingleClick(MouseEventWithHitTestResults*);
+  void handleMousePressEventDoubleClick(MouseEventWithHitTestResults*);
+  void handleMousePressEventTripleClick(MouseEventWithHitTestResults*);
 
   CSSComputedStyleDeclarationImpl *selectionComputedStyle(NodeImpl *&nodeToRemove) const;
 
index 4b3c72d..18d5ce6 100644 (file)
 #ifndef khtmlpart_p_h
 #define khtmlpart_p_h
 
+#include "EditCommand.h"
 #include "Frame.h"
 #include "FrameTree.h"
 #include "SelectionController.h"
 #include "Timer.h"
 #include "css_valueimpl.h"
-#include "EditCommand.h"
 #include "kjs_proxy.h"
 #include <kio/global.h>
 #include <kxmlcore/Vector.h>
@@ -41,9 +41,10 @@ namespace KIO {
     class TransferJob;
 }
 
-namespace WebCore
-{
+namespace WebCore {
+
     class Decoder;
+    class UserStyleSheetLoader;
 
     enum RedirectionScheduled {
         noRedirectionScheduled,
@@ -105,6 +106,7 @@ namespace WebCore
             , m_executingJavaScriptFormAction(false)
             , m_cancelWithLoadInProgress(false)
             , m_lifeSupportTimer(thisFrame, &Frame::lifeSupportTimerFired)
+            , m_userStyleSheetLoader(0)
         {
             // inherit settings from parent
             if (parent && parent->isFrame()) {
@@ -226,6 +228,8 @@ namespace WebCore
         bool m_cancelWithLoadInProgress;
 
         Timer<Frame> m_lifeSupportTimer;
+
+        UserStyleSheetLoader* m_userStyleSheetLoader;
     };
 
 }
index a0d37e8..aa9a51e 100644 (file)
 #include "Frame.h"
 #include "HTMLInputElementImpl.h"
 #include "KWQAccObjectCache.h"
-#include "KWQEvent.h"
+#include "KeyEvent.h"
+#include "MouseEvent.h"
+#include "MouseEventWithHitTestResults.h"
 #include "RenderText.h"
 #include "SelectionController.h"
+#include "WheelEvent.h"
 #include "cssstyleselector.h"
 #include "dom2_eventsimpl.h"
 #include "helper.h"
 #include "html_documentimpl.h"
 #include "html_inlineimpl.h"
 #include "htmlnames.h"
-#include "khtml_events.h"
 #include "khtml_settings.h"
 #include "render_arena.h"
 #include "render_canvas.h"
@@ -461,7 +463,7 @@ void FrameView::layout()
 //
 /////////////////
 
-void FrameView::viewportMousePressEvent( QMouseEvent *_mouse )
+void FrameView::viewportMousePressEvent(MouseEvent* mouseEvent)
 {
     if (!m_frame->document())
         return;
@@ -469,27 +471,24 @@ void FrameView::viewportMousePressEvent( QMouseEvent *_mouse )
     RefPtr<FrameView> protector(this);
 
     int xm, ym;
-    viewportToContents(_mouse->x(), _mouse->y(), xm, ym);
+    viewportToContents(mouseEvent->x(), mouseEvent->y(), xm, ym);
 
     d->mousePressed = true;
 
-    NodeImpl::MouseEvent mev( _mouse->stateAfter(), NodeImpl::MousePress );
-    m_frame->document()->prepareMouseEvent( false, xm, ym, &mev );
+    MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(false, true, false, xm, ym, mouseEvent);
 
     if (m_frame->passSubframeEventToSubframe(mev)) {
         invalidateClick();
         return;
     }
 
-    d->clickCount = _mouse->clickCount();
-    d->clickNode = mev.innerNode;
+    d->clickCount = mouseEvent->clickCount();
+    d->clickNode = mev.innerNode();
 
-    bool swallowEvent = dispatchMouseEvent(mousedownEvent,mev.innerNode.get(),true,
-                                           d->clickCount,_mouse,true,NodeImpl::MousePress);
+    bool swallowEvent = dispatchMouseEvent(mousedownEvent, mev.innerNode(), true, d->clickCount, mouseEvent, true);
 
     if (!swallowEvent) {
-        MousePressEvent event(_mouse, xm, ym, mev.url, mev.target, mev.innerNode.get());
-        m_frame->khtmlMousePressEvent(&event);
+        m_frame->khtmlMousePressEvent(&mev);
         // Many AK widgets run their own event loops and consume events while the mouse is down.
         // When they finish, currentEvent is the mouseUp that they exited on.  We need to update
         // the khtml state with this mouseUp, which khtml never saw.
@@ -500,7 +499,7 @@ void FrameView::viewportMousePressEvent( QMouseEvent *_mouse )
     }
 }
 
-void FrameView::viewportMouseDoubleClickEvent( QMouseEvent *_mouse )
+void FrameView::viewportMouseDoubleClickEvent(MouseEvent* mouseEvent)
 {
     if (!m_frame->document())
         return;
@@ -508,32 +507,26 @@ void FrameView::viewportMouseDoubleClickEvent( QMouseEvent *_mouse )
     RefPtr<FrameView> protector(this);
 
     int xm, ym;
-    viewportToContents(_mouse->x(), _mouse->y(), xm, ym);
+    viewportToContents(mouseEvent->x(), mouseEvent->y(), xm, ym);
 
     // We get this instead of a second mouse-up 
     d->mousePressed = false;
 
-    NodeImpl::MouseEvent mev( _mouse->stateAfter(), NodeImpl::MouseDblClick );
-    m_frame->document()->prepareMouseEvent( false, xm, ym, &mev );
+    MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(false, true, false, xm, ym, mouseEvent);
 
     if (m_frame->passSubframeEventToSubframe(mev))
         return;
 
-    d->clickCount = _mouse->clickCount();
-    bool swallowEvent = dispatchMouseEvent(mouseupEvent,mev.innerNode.get(),true,
-                                           d->clickCount,_mouse,false,NodeImpl::MouseRelease);
+    d->clickCount = mouseEvent->clickCount();
+    bool swallowEvent = dispatchMouseEvent(mouseupEvent, mev.innerNode(), true, d->clickCount, mouseEvent, false);
 
-    if (mev.innerNode == d->clickNode)
-        dispatchMouseEvent(clickEvent,mev.innerNode.get(),true,
-                           d->clickCount,_mouse,true,NodeImpl::MouseRelease);
+    if (mev.innerNode() == d->clickNode)
+        dispatchMouseEvent(clickEvent, mev.innerNode(), true, d->clickCount, mouseEvent, true);
 
     // Qt delivers a release event AND a double click event.
     if (!swallowEvent) {
-        MouseReleaseEvent event1(_mouse, xm, ym, mev.url, mev.target, mev.innerNode.get());
-        m_frame->khtmlMouseReleaseEvent(&event1);
-
-        MouseDoubleClickEvent event2(_mouse, xm, ym, mev.url, mev.target, mev.innerNode.get());
-        m_frame->khtmlMouseDoubleClickEvent(&event2);
+        m_frame->khtmlMouseReleaseEvent(&mev);
+        m_frame->khtmlMouseDoubleClickEvent(&mev);
     }
 
     invalidateClick();
@@ -544,13 +537,13 @@ static bool isSubmitImage(NodeImpl *node)
     return node && node->hasTagName(inputTag) && static_cast<HTMLInputElementImpl*>(node)->inputType() == HTMLInputElementImpl::IMAGE;
 }
 
-static Cursor selectCursor(const NodeImpl::MouseEvent& event, Frame* frame, bool mousePressed)
+static Cursor selectCursor(const MouseEventWithHitTestResults& event, Frame* frame, bool mousePressed)
 {
     // During selection, use an I-beam no matter what we're over.
     if (mousePressed && frame->hasSelection())
         return iBeamCursor();
 
-    NodeImpl* node = event.innerNode.get();
+    NodeImpl* node = event.innerNode();
     RenderObject* renderer = node ? node->renderer() : 0;
     RenderStyle* style = renderer ? renderer->style() : 0;
 
@@ -559,7 +552,7 @@ static Cursor selectCursor(const NodeImpl::MouseEvent& event, Frame* frame, bool
 
     switch (style ? style->cursor() : CURSOR_AUTO) {
         case CURSOR_AUTO:
-            if (!event.url.isNull() || isSubmitImage(node))
+            if (!event.url().isNull() || isSubmitImage(node))
                 return handCursor();
             if ((node && node->isContentEditable()) || (renderer && renderer->isText() && renderer->canSelect()))
                 return iBeamCursor();
@@ -598,7 +591,7 @@ static Cursor selectCursor(const NodeImpl::MouseEvent& event, Frame* frame, bool
     return pointerCursor();
 }
 
-void FrameView::viewportMouseMoveEvent( QMouseEvent * _mouse )
+void FrameView::viewportMouseMoveEvent(MouseEvent* mouseEvent)
 {
     // in Radar 3703768 we saw frequent crashes apparently due to the
     // part being null here, which seems impossible, so check for nil
@@ -612,25 +605,21 @@ void FrameView::viewportMouseMoveEvent( QMouseEvent * _mouse )
         d->hoverTimer.stop();
 
     int xm, ym;
-    viewportToContents(_mouse->x(), _mouse->y(), xm, ym);
+    viewportToContents(mouseEvent->x(), mouseEvent->y(), xm, ym);
 
     // Treat mouse move events while the mouse is pressed as "read-only" in prepareMouseEvent
     // if we are allowed to select.
     // This means that :hover and :active freeze in the state they were in when the mouse
     // was pressed, rather than updating for nodes the mouse moves over as you hold the mouse down.
-    NodeImpl::MouseEvent mev( _mouse->stateAfter(), NodeImpl::MouseMove );
-    m_frame->document()->prepareMouseEvent(d->mousePressed && m_frame->mouseDownMayStartSelect(), d->mousePressed, xm, ym, &mev );
+    MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(d->mousePressed && m_frame->mouseDownMayStartSelect(),
+        d->mousePressed, true, xm, ym, mouseEvent);
 
     if (!m_frame->passSubframeEventToSubframe(mev))
         viewport()->setCursor(selectCursor(mev, m_frame.get(), d->mousePressed));
         
-    bool swallowEvent = dispatchMouseEvent(mousemoveEvent,mev.innerNode.get(),false,
-                                           0,_mouse,true,NodeImpl::MouseMove);
-
-    if (!swallowEvent) {
-        MouseMoveEvent event(_mouse, xm, ym, mev.url, mev.target, mev.innerNode.get());
-        m_frame->khtmlMouseMoveEvent(&event);
-    }
+    bool swallowEvent = dispatchMouseEvent(mousemoveEvent, mev.innerNode(), false, 0, mouseEvent, true);
+    if (!swallowEvent)
+        m_frame->khtmlMouseMoveEvent(&mev);
 }
 
 void FrameView::invalidateClick()
@@ -639,7 +628,7 @@ void FrameView::invalidateClick()
     d->clickNode = 0;
 }
 
-void FrameView::viewportMouseReleaseEvent( QMouseEvent * _mouse )
+void FrameView::viewportMouseReleaseEvent(MouseEvent* mouseEvent)
 {
     if (!m_frame->document())
         return;
@@ -647,32 +636,27 @@ void FrameView::viewportMouseReleaseEvent( QMouseEvent * _mouse )
     RefPtr<FrameView> protector(this);
 
     int xm, ym;
-    viewportToContents(_mouse->x(), _mouse->y(), xm, ym);
+    viewportToContents(mouseEvent->x(), mouseEvent->y(), xm, ym);
 
     d->mousePressed = false;
 
-    NodeImpl::MouseEvent mev( _mouse->stateAfter(), NodeImpl::MouseRelease );
-    m_frame->document()->prepareMouseEvent( false, xm, ym, &mev );
+    MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(false, false, false, xm, ym, mouseEvent);
 
     if (m_frame->passSubframeEventToSubframe(mev))
         return;
 
-    bool swallowEvent = dispatchMouseEvent(mouseupEvent,mev.innerNode.get(),true,
-                                           d->clickCount,_mouse,false,NodeImpl::MouseRelease);
+    bool swallowEvent = dispatchMouseEvent(mouseupEvent, mev.innerNode(), true, d->clickCount, mouseEvent, false);
 
-    if (d->clickCount > 0 && mev.innerNode == d->clickNode)
-        dispatchMouseEvent(clickEvent,mev.innerNode.get(),true,
-                           d->clickCount,_mouse,true,NodeImpl::MouseRelease);
+    if (d->clickCount > 0 && mev.innerNode() == d->clickNode)
+        dispatchMouseEvent(clickEvent, mev.innerNode(), true, d->clickCount, mouseEvent, true);
 
-    if (!swallowEvent) {
-        MouseReleaseEvent event(_mouse, xm, ym, mev.url, mev.target, mev.innerNode.get());
-        m_frame->khtmlMouseReleaseEvent(&event);
-    }
+    if (!swallowEvent)
+        m_frame->khtmlMouseReleaseEvent(&mev);
 
     invalidateClick();
 }
 
-void FrameView::keyPressEvent(QKeyEvent *ke)
+void FrameView::keyPressEvent(KeyEvent* ke)
 {
     if (m_frame->document() && m_frame->document()->focusNode()) {
         if (m_frame->document()->focusNode()->dispatchKeyEvent(ke))
@@ -708,25 +692,22 @@ bool FrameView::updateDragAndDrop(const IntPoint &loc, ClipboardImpl *clipboard)
     bool accept = false;
     int xm, ym;
     viewportToContents(loc.x(), loc.y(), xm, ym);
-    NodeImpl::MouseEvent mev(0, NodeImpl::MouseMove);
-    m_frame->document()->prepareMouseEvent(true, xm, ym, &mev);
-    NodeImpl *newTarget = mev.innerNode.get();
+    MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(true, false, false, xm, ym, 0);
 
     // Drag events should never go to text nodes (following IE, and proper mouseover/out dispatch)
-    if (newTarget && newTarget->isTextNode()) {
+    NodeImpl* newTarget = mev.innerNode();
+    if (newTarget && newTarget->isTextNode())
         newTarget = newTarget->parentNode();
-    }
 
     if (d->dragTarget != newTarget) {
         // note this ordering is explicitly chosen to match WinIE
-        if (newTarget) {
+        if (newTarget)
             accept = dispatchDragEvent(dragenterEvent, newTarget, loc, clipboard);
-        }
-        if (d->dragTarget) {
+        if (d->dragTarget)
             dispatchDragEvent(dragleaveEvent, d->dragTarget.get(), loc, clipboard);
-        }
-    } else if (newTarget) {
-        accept = dispatchDragEvent(dragoverEvent, newTarget, loc, clipboard);
+    } else {
+        if (newTarget)
+            accept = dispatchDragEvent(dragoverEvent, newTarget, loc, clipboard);
     }
     d->dragTarget = newTarget;
 
@@ -735,18 +716,16 @@ bool FrameView::updateDragAndDrop(const IntPoint &loc, ClipboardImpl *clipboard)
 
 void FrameView::cancelDragAndDrop(const IntPoint &loc, ClipboardImpl *clipboard)
 {
-    if (d->dragTarget) {
+    if (d->dragTarget)
         dispatchDragEvent(dragleaveEvent, d->dragTarget.get(), loc, clipboard);
-    }
     d->dragTarget = 0;
 }
 
 bool FrameView::performDragAndDrop(const IntPoint &loc, ClipboardImpl *clipboard)
 {
     bool accept = false;
-    if (d->dragTarget) {
+    if (d->dragTarget)
         accept = dispatchDragEvent(dropEvent, d->dragTarget.get(), loc, clipboard);
-    }
     d->dragTarget = 0;
     return accept;
 }
@@ -964,8 +943,8 @@ void FrameView::restoreScrollBar ( )
 }
 
 
-bool FrameView::dispatchMouseEvent(const AtomicString &eventType, NodeImpl* targetNode, bool cancelable,
-    int detail, QMouseEvent *_mouse, bool setUnder, int mouseEventType)
+bool FrameView::dispatchMouseEvent(const AtomicStringeventType, NodeImpl* targetNode, bool cancelable,
+    int detail, MouseEvent* mouseEvent, bool setUnder)
 {
     // if the target node is a text node, dispatch on the parent node - rdar://4196646
     if (targetNode && targetNode->isTextNode())
@@ -975,7 +954,7 @@ bool FrameView::dispatchMouseEvent(const AtomicString &eventType, NodeImpl* targ
     // mouseout/mouseover
     if (setUnder) {
         int clientX, clientY;
-        viewportToContents(_mouse->x(), _mouse->y(), clientX, clientY);
+        viewportToContents(mouseEvent->x(), mouseEvent->y(), clientX, clientY);
         if (d->prevMouseX != clientX || d->prevMouseY != clientY) {
             // ### this code sucks. we should save the oldUnder instead of calculating
             // it again. calculating is expensive! (Dirk)
@@ -983,9 +962,8 @@ bool FrameView::dispatchMouseEvent(const AtomicString &eventType, NodeImpl* targ
             // so we could be sending a mouseout to a node that never got a mouseover.
             RefPtr<NodeImpl> oldUnder;
             if (d->prevMouseX >= 0) {
-                NodeImpl::MouseEvent mev( _mouse->stateAfter(), static_cast<NodeImpl::MouseEventType>(mouseEventType));
-                m_frame->document()->prepareMouseEvent(true, d->prevMouseX, d->prevMouseY, &mev);
-                oldUnder = mev.innerNode;
+                oldUnder = m_frame->document()->prepareMouseEvent(true, false, true,
+                    d->prevMouseX, d->prevMouseY, mouseEvent).innerNode();
                 if (oldUnder && oldUnder->isTextNode())
                     oldUnder = oldUnder->parentNode();
             }
@@ -994,10 +972,10 @@ bool FrameView::dispatchMouseEvent(const AtomicString &eventType, NodeImpl* targ
             if (oldUnder != targetNode) {
                 // send mouseout event to the old node
                 if (oldUnder)
-                    oldUnder->dispatchMouseEvent(_mouse, mouseoutEvent, 0, targetNode);
+                    oldUnder->dispatchMouseEvent(mouseEvent, mouseoutEvent, 0, targetNode);
                 // send mouseover event to the new node
                 if (targetNode)
-                    targetNode->dispatchMouseEvent(_mouse, mouseoverEvent, 0, oldUnder.get());
+                    targetNode->dispatchMouseEvent(mouseEvent, mouseoverEvent, 0, oldUnder.get());
             }
         }
     }
@@ -1005,7 +983,7 @@ bool FrameView::dispatchMouseEvent(const AtomicString &eventType, NodeImpl* targ
     bool swallowEvent = false;
 
     if (targetNode)
-        swallowEvent = targetNode->dispatchMouseEvent(_mouse, eventType, detail);
+        swallowEvent = targetNode->dispatchMouseEvent(mouseEvent, eventType, detail);
     
     if (!swallowEvent && eventType == mousedownEvent) {
         // Focus should be shifted on mouse down, not on a click.  -dwh
@@ -1042,7 +1020,7 @@ void FrameView::setIgnoreWheelEvents( bool e )
     d->ignoreWheelEvents = e;
 }
 
-void FrameView::viewportWheelEvent(QWheelEvent* e)
+void FrameView::viewportWheelEvent(WheelEvent* e)
 {
     DocumentImpl *doc = m_frame->document();
     if (doc) {
@@ -1092,8 +1070,7 @@ void FrameView::layoutTimerFired(Timer<FrameView>*)
 void FrameView::hoverTimerFired(Timer<FrameView>*)
 {
     d->hoverTimer.stop();
-    NodeImpl::MouseEvent mev(false, NodeImpl::MouseMove);
-    m_frame->document()->prepareMouseEvent(false, false, d->prevMouseX, d->prevMouseY, &mev );
+    m_frame->document()->prepareMouseEvent(false, false, true, d->prevMouseX, d->prevMouseY, 0);
 }
 
 void FrameView::scheduleRelayout()
index 7c1d699..3214dcd 100644 (file)
 
 #include "QString.h"
 
-class QEvent;
-class QKeyEvent;
-class QMouseEvent;
 class QStringList;
-class QWheelEvent;
 
 namespace WebCore {
 
@@ -55,7 +51,9 @@ class HTMLGenericFormElementImpl;
 class HTMLTitleElementImpl;
 class InlineBox;
 class IntRect;
+class KeyEvent;
 class MacFrame;
+class MouseEvent;
 class NodeImpl;
 class QPainter;
 class RenderBox;
@@ -66,6 +64,7 @@ class RenderPart;
 class RenderPartObject;
 class RenderStyle;
 class RenderWidget;
+class WheelEvent;
 
 template <typename T> class Timer;
 
@@ -174,13 +173,13 @@ public:
 public:
     void clearPart();
 
-    virtual void viewportMousePressEvent( QMouseEvent * );
-    virtual void viewportMouseDoubleClickEvent( QMouseEvent * );
-    virtual void viewportMouseMoveEvent(QMouseEvent *);
-    virtual void viewportMouseReleaseEvent(QMouseEvent *);
-    virtual void viewportWheelEvent(QWheelEvent*);
+    void viewportMousePressEvent(MouseEvent*);
+    void viewportMouseDoubleClickEvent(MouseEvent*);
+    void viewportMouseMoveEvent(MouseEvent*);
+    void viewportMouseReleaseEvent(MouseEvent*);
+    void viewportWheelEvent(WheelEvent*);
+    void keyPressEvent(KeyEvent*);
 
-    void keyPressEvent( QKeyEvent *_ke );
     void doAutoScroll();
 
     bool updateDragAndDrop(const IntPoint &, ClipboardImpl *clipboard);
@@ -266,9 +265,10 @@ private:
     QStringList formCompletionItems(const QString &name) const;
     void addFormCompletionItem(const QString &name, const QString &value);
 
-    bool dispatchMouseEvent(const AtomicString& eventType, NodeImpl* targetNode, bool cancelable,
-        int detail, QMouseEvent*, bool setUnder, int mouseEventType);
-    bool dispatchDragEvent(const AtomicString& eventType, NodeImpl* dragTarget, const IntPoint& loc, ClipboardImpl*);
+    bool dispatchMouseEvent(const AtomicString& eventType, NodeImpl* target,
+        bool cancelable, int detail, MouseEvent*, bool setUnder);
+    bool dispatchDragEvent(const AtomicString& eventType, NodeImpl* target,
+        const IntPoint& loc, ClipboardImpl*);
 
     void applyOverflowToViewport(RenderObject* o, ScrollBarMode& hMode, ScrollBarMode& vMode);
 
diff --git a/WebCore/page/MouseEventWithHitTestResults.h b/WebCore/page/MouseEventWithHitTestResults.h
new file mode 100644 (file)
index 0000000..8b3523d
--- /dev/null
@@ -0,0 +1,48 @@
+/* This file is part of the KDE project
+   Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
+   Copyright (C) 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 MouseEventWithHitTestResults_h
+#define MouseEventWithHitTestResults_h
+
+#include "NodeImpl.h"
+
+namespace WebCore {
+
+class MouseEventWithHitTestResults {
+public:
+    MouseEventWithHitTestResults() : m_event(0) { }
+    MouseEventWithHitTestResults(MouseEvent* e, const String& u, const String& t, PassRefPtr<NodeImpl> n)
+        : m_event(e), m_url(u), m_target(t), m_innerNode(n) { }
+
+    MouseEvent* event() const { return m_event; }
+    String url() const { return m_url; }
+    String target() const { return m_target; }
+    NodeImpl* innerNode() const { return m_innerNode.get(); }
+
+private:
+    MouseEvent* m_event;
+    String m_url;
+    String m_target;
+    RefPtr<NodeImpl> m_innerNode;
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/KeyEvent.h b/WebCore/platform/KeyEvent.h
new file mode 100644 (file)
index 0000000..917a19f
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef QEVENT_H_
+#define QEVENT_H_
+
+#include "PlatformString.h"
+
+#ifdef __OBJC__
+@class NSEvent;
+#else
+class NSEvent;
+#endif
+
+namespace WebCore {
+
+    class KeyEvent {
+    public:
+#ifdef __APPLE__
+        KeyEvent(NSEvent*, bool forceAutoRepeat = false);
+#endif
+
+        String text() const { return m_text; }
+        String unmodifiedText() const { return m_unmodifiedText; }
+        String keyIdentifier() const { return m_keyIdentifier; }
+        bool isKeyUp() const { return m_isKeyUp; }
+        bool isAutoRepeat() const { return m_autoRepeat; }
+        bool isAccepted() const { return m_isAccepted; }
+        int WindowsKeyCode() const { return m_WindowsKeyCode; }
+        bool isKeypad() const { return m_isKeypad; }
+        bool shiftKey() const { return m_shiftKey; }
+        bool ctrlKey() const { return m_ctrlKey; }
+        bool altKey() const { return m_altKey; }
+        bool metaKey() const { return m_metaKey; }
+
+        void accept() { m_isAccepted = true; }
+        void ignore() { m_isAccepted = false; }
+
+    private:
+        String m_text;
+        String m_unmodifiedText;
+        String m_keyIdentifier;
+        bool m_isKeyUp;
+        bool m_autoRepeat;
+        bool m_isAccepted;
+        int m_WindowsKeyCode;
+        bool m_isKeypad;
+        bool m_shiftKey;
+        bool m_ctrlKey;
+        bool m_altKey;
+        bool m_metaKey;
+    };
+
+}
+
+#endif
diff --git a/WebCore/platform/MouseEvent.h b/WebCore/platform/MouseEvent.h
new file mode 100644 (file)
index 0000000..2b331c4
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef MouseEvent_h
+#define MouseEvent_h
+
+#include "IntPoint.h"
+
+#if __APPLE__
+#ifdef __OBJC__
+@class NSEvent;
+#else
+class NSEvent;
+#endif
+#endif
+
+namespace WebCore {
+
+    // These button numbers match the one used in the DOM API.
+    enum MouseButton { LeftButton, MiddleButton, RightButton };
+
+    class MouseEvent {
+    public:
+        MouseEvent(); // "current event"
+
+        const IntPoint& pos() const { return m_position; }
+        int x() const { return m_position.x(); }
+        int y() const { return m_position.y(); }
+        int globalX() const { return m_globalPosition.x(); }
+        int globalY() const { return m_globalPosition.y(); }
+        MouseButton button() const { return m_button; }
+        int clickCount() const { return m_clickCount; }
+        bool shiftKey() const { return m_shiftKey; }
+        bool ctrlKey() const { return m_ctrlKey; }
+        bool altKey() const { return m_altKey; }
+        bool metaKey() const { return m_metaKey; }
+
+#if __APPLE__
+        MouseEvent(NSEvent*);
+#endif
+
+    private:
+        IntPoint m_position;
+        IntPoint m_globalPosition;
+        MouseButton m_button;
+        int m_clickCount;
+        bool m_shiftKey;
+        bool m_ctrlKey;
+        bool m_altKey;
+        bool m_metaKey;
+    };
+
+}
+
+#endif
index 92656ef..94dc3b9 100644 (file)
@@ -27,7 +27,7 @@
 #include "StringImpl.h"
 
 #include "AtomicString.h"
-#include "khtmllayout.h"
+#include "Length.h"
 #include <kxmlcore/Assertions.h>
 #include <string.h>
 
diff --git a/WebCore/platform/WheelEvent.h b/WebCore/platform/WheelEvent.h
new file mode 100644 (file)
index 0000000..51229b1
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WheelEvent_h
+#define WheelEvent_h
+
+#include "IntPoint.h"
+
+#ifdef __APPLE__
+#ifdef __OBJC__
+@class NSEvent;
+#else
+class NSEvent;
+#endif
+#endif
+
+namespace WebCore {
+
+    class WheelEvent {
+    public:
+        const IntPoint& pos() const { return m_position; }
+        const IntPoint& globalPos() const { return m_globalPosition; }
+        int delta() const { return m_delta; }
+        bool isHorizontal() const { return m_isHorizontal; }
+        bool isAccepted() const { return m_isAccepted; }
+        bool shiftKey() const { return m_shiftKey; }
+        bool ctrlKey() const { return m_ctrlKey; }
+        bool altKey() const { return m_altKey; }
+        bool metaKey() const { return m_metaKey; }
+
+        int x() const { return m_position.x(); }
+        int y() const { return m_position.y(); }
+        int globalX() const { return m_globalPosition.x(); }
+        int globalY() const { return m_globalPosition.y(); }
+
+        void accept() { m_isAccepted = true; }
+        void ignore() { m_isAccepted = false; }
+
+#ifdef __APPLE__
+        WheelEvent(NSEvent*);
+#endif
+
+    private:
+        IntPoint m_position;
+        IntPoint m_globalPosition;
+        int m_delta;
+        bool m_isHorizontal;
+        bool m_isAccepted;
+        bool m_shiftKey;
+        bool m_ctrlKey;
+        bool m_altKey;
+        bool m_metaKey;
+    };
+
+}
+
+#endif
index c1b7735..cfd1c40 100644 (file)
@@ -95,9 +95,4 @@ bool Widget::checksDescendantsForFocus() const
     return false;
 }
 
-bool Widget::event(QEvent *)
-{
-    return false;
-}
-
 }
index 4bf6191..20d05da 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "KWQObject.h"
 
-class QEvent;
 class QFont;
 class QPalette;
 
@@ -106,8 +105,6 @@ namespace WebCore {
         void setCursor(const Cursor&);
         Cursor cursor();
 
-        bool event(QEvent*);
-
         void show();
         void hide();
 
index a947251..d7af0e9 100644 (file)
@@ -27,7 +27,7 @@
 #import "Cursor.h"
 
 #import "KWQExceptions.h"
-#import "KWQFoundationExtras.h"
+#import "FoundationExtras.h"
 #import "Image.h"
 
 @interface WebCoreCursorBundle : NSObject { }
similarity index 77%
rename from WebCore/kwq/KWQEvent.mm
rename to WebCore/platform/mac/KeyEventMac.mm
index c4bfd09..e248247 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#include "config.h"
-#import "KWQEvent.h"
+#import "config.h"
+#import "KeyEvent.h"
 
 #import "KWQLogging.h"
 
-static QString keyIdentifierForKeyEvent(NSEvent *event)
+namespace WebCore {
+
+static String keyIdentifierForKeyEvent(NSEvent* event)
 {
     NSString *s = [event charactersIgnoringModifiers];
     if ([s length] != 1) {
@@ -320,7 +322,7 @@ static QString keyIdentifierForKeyEvent(NSEvent *event)
     }
 }
 
-static bool isKeypadEvent(NSEvent *event)
+static bool isKeypadEvent(NSEventevent)
 {
     // Check that this is the type of event that has a keyCode.
     switch ([event type]) {
@@ -357,7 +359,7 @@ static bool isKeypadEvent(NSEvent *event)
      return false;
 }
 
-static int WindowsKeyCodeForKeyEvent(NSEvent *event)
+static int WindowsKeyCodeForKeyEvent(NSEventevent)
 {
     switch ([event keyCode]) {
         // VK_TAB (09) TAB key
@@ -399,10 +401,9 @@ static int WindowsKeyCodeForKeyEvent(NSEvent *event)
         case 75: return 0x6F;
      }
 
-    NSString *s = [event charactersIgnoringModifiers];
-    if ([s length] != 1) {
+    NSStrings = [event charactersIgnoringModifiers];
+    if ([s length] != 1)
         return 0;
-    }
 
     switch ([s characterAtIndex:0]) {
         // VK_LBUTTON (01) Left mouse button
@@ -699,228 +700,30 @@ static int WindowsKeyCodeForKeyEvent(NSEvent *event)
     return 0;
 }
 
-static int mouseButtonForEvent(NSEvent *event)
-{
-    switch ([event type]) {
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-            return Qt::LeftButton;
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-            return Qt::RightButton;
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-            return Qt::MidButton;
-        default:
-            return Qt::NoButton;
-    }
-}
-
-static int nonMouseButtonsForEvent(NSEvent *event)
-{
-    int buttons = 0;
-
-    unsigned modifiers = [event modifierFlags];
-
-    if (modifiers & NSControlKeyMask) {
-        buttons |= Qt::ControlButton;
-    }
-    if (modifiers & NSShiftKeyMask) {
-        buttons |= Qt::ShiftButton;
-    }
-    if (modifiers & NSAlternateKeyMask) {
-        buttons |= Qt::AltButton;
-    }
-    if (modifiers & NSCommandKeyMask) {
-        buttons |= Qt::MetaButton;
-    }
-
-    // I tried using NSNumericPadKeyMask, but it does not seem to work reliably.
-    // One possible explanation is that the documentation says "Set if any key in
-    // the numeric keypad is pressed." which may mean that it gets set if there
-    // is any key down on the numeric keypad. But it could just be some kind of bug
-    // or a mistake on my part. We could revisit this some day.
-    if (isKeypadEvent(event)) {
-        buttons |= Qt::Keypad;
-    }
-
-    return buttons;
-}
-
-static IntPoint positionForEvent(NSEvent *event)
-{
-    switch ([event type]) {
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-        case NSMouseMoved:
-        case NSScrollWheel:
-            // Note: This has its origin at the bottom left of the window.
-            // The Y coordinate gets flipped by QScrollView::viewportToContents.
-            // We should probably change both this and that to not use "bottom left origin" coordinates at all.
-            return IntPoint([event locationInWindow]);
-        default:
-            return IntPoint();
-    }
-}
-
-static IntPoint globalPositionForEvent(NSEvent *event)
-{
-    switch ([event type]) {
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-        case NSMouseMoved:
-        case NSScrollWheel: {
-            NSPoint point = [[event window] convertBaseToScreen:[event locationInWindow]];
-            point.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - point.y;
-            return IntPoint(point);
-        }
-        default:
-            return IntPoint();
-    }
-}
-
-static int clickCountForEvent(NSEvent *event)
-{
-    switch ([event type]) {
-        case NSLeftMouseDown:
-        case NSLeftMouseUp:
-        case NSLeftMouseDragged:
-        case NSRightMouseDown:
-        case NSRightMouseUp:
-        case NSRightMouseDragged:
-        case NSOtherMouseDown:
-        case NSOtherMouseUp:
-        case NSOtherMouseDragged:
-            return [event clickCount];
-        default:
-            return 0;
-    }
-}
-
-static Qt::Orientation orientationForEvent(NSEvent *event)
-{
-    switch ([event type]) {
-        case NSScrollWheel:
-            return [event deltaX] != 0 ? Qt::Horizontal : Qt::Vertical;
-        default:
-            return Qt::Vertical;
-    }
-}
-
-static int deltaForEvent(NSEvent *event)
-{
-    switch ([event type]) {
-        case NSScrollWheel:
-            return lrint((orientationForEvent(event) == Qt::Horizontal ? [event deltaX] : [event deltaY]) * 120);
-        default:
-            return 0;
-    }
-}
-
-// ======== 
-
-QEvent::~QEvent()
-{
-}
-
-// ======== 
-
-QMouseEvent::QMouseEvent(Type type, NSEvent *event)
-    : QEvent(type)
-    , _position(positionForEvent(event))
-    , _globalPosition(globalPositionForEvent(event))
-    , _button(mouseButtonForEvent(event))
-    , _state(nonMouseButtonsForEvent(event))
-    , _clickCount(clickCountForEvent(event))
-{
-    fixState();
-}
-
-QMouseEvent::QMouseEvent(Type type)
-    : QEvent(type), _button(0), _state(0), _clickCount(0)
-{
-    NSEvent *event = [NSApp currentEvent];
-    if (event) {
-        _position = positionForEvent(event);
-        _globalPosition = globalPositionForEvent(event);
-        _button = mouseButtonForEvent(event);
-        _state = nonMouseButtonsForEvent(event);
-        _clickCount = clickCountForEvent(event);
-    }
-    fixState();
-}
-
-void QMouseEvent::fixState()
-{
-    int button = _button;
-    int state = _state;
-    switch (type()) {
-        case MouseMove:
-            _clickCount = 0;
-            _state = state | button;
-            _stateAfter = state | button;
-            break;
-        case MouseButtonRelease:
-            _state = state | button;
-            _stateAfter = state & ~button;
-            break;
-        default:
-            _state = state & ~button;
-            _stateAfter = state | button;
-            break;
-    }
-}
-
-// ======== 
-
-QKeyEvent::QKeyEvent(NSEvent *event, bool forceAutoRepeat)
-    : QEvent([event type] == NSKeyDown ? KeyPress : KeyRelease),
-      _state(nonMouseButtonsForEvent(event)),
-      _text(QString::fromNSString([event characters])),
-      _unmodifiedText(QString::fromNSString([event charactersIgnoringModifiers])),
-      _keyIdentifier(keyIdentifierForKeyEvent(event)),
-      _autoRepeat(forceAutoRepeat || [event isARepeat]),
-      _isAccepted(false),
-      _WindowsKeyCode(WindowsKeyCodeForKeyEvent(event))
+KeyEvent::KeyEvent(NSEvent *event, bool forceAutoRepeat)
+    : m_text([event characters]),
+      m_unmodifiedText([event charactersIgnoringModifiers]),
+      m_keyIdentifier(keyIdentifierForKeyEvent(event)),
+      m_isKeyUp([event type] == NSKeyUp),
+      m_autoRepeat(forceAutoRepeat || [event isARepeat]),
+      m_isAccepted(false),
+      m_WindowsKeyCode(WindowsKeyCodeForKeyEvent(event)),
+      m_isKeypad(isKeypadEvent(event)),
+      m_shiftKey([event modifierFlags] & NSShiftKeyMask),
+      m_ctrlKey([event modifierFlags] & NSControlKeyMask),
+      m_altKey([event modifierFlags] & NSAlternateKeyMask),
+      m_metaKey([event modifierFlags] & NSCommandKeyMask)
 {
     // Turn 0x7F into 8, because backspace needs to always be 8.
-    if (_text == "\x7F")
-        _text = "\x8";
-    if (_unmodifiedText == "\x7F")
-        _unmodifiedText = "\x8";
+    if (m_text == "\x7F")
+        m_text = "\x8";
+    if (m_unmodifiedText == "\x7F")
+        m_unmodifiedText = "\x8";
     // Always use 9 for tab -- we don't want to use AppKit's different character for shift-tab.
-    if (_WindowsKeyCode == 9) {
-        _text = "\x9";
-        _unmodifiedText = "\x9";
+    if (m_WindowsKeyCode == 9) {
+        m_text = "\x9";
+        m_unmodifiedText = "\x9";
     }
 }
 
-// ======== 
-
-QWheelEvent::QWheelEvent(NSEvent *event)
-    : QEvent(Wheel)
-    , _position(positionForEvent(event))
-    , _globalPosition(globalPositionForEvent(event))
-    , _delta(deltaForEvent(event))
-    , _state(nonMouseButtonsForEvent(event))
-    , _orientation(orientationForEvent(event))
-    , _isAccepted(false)
-{
 }
diff --git a/WebCore/platform/mac/MouseEventMac.mm b/WebCore/platform/mac/MouseEventMac.mm
new file mode 100644 (file)
index 0000000..51a55b1
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "config.h"
+#import "MouseEvent.h"
+
+namespace WebCore {
+
+static MouseButton mouseButtonForEvent(NSEvent *event)
+{
+    switch ([event type]) {
+        case NSLeftMouseDown:
+        case NSLeftMouseUp:
+        case NSLeftMouseDragged:
+        default:
+            return LeftButton;
+        case NSRightMouseDown:
+        case NSRightMouseUp:
+        case NSRightMouseDragged:
+            return RightButton;
+        case NSOtherMouseDown:
+        case NSOtherMouseUp:
+        case NSOtherMouseDragged:
+            return MiddleButton;
+    }
+}
+
+static IntPoint positionForEvent(NSEvent *event)
+{
+    switch ([event type]) {
+        case NSLeftMouseDown:
+        case NSLeftMouseUp:
+        case NSLeftMouseDragged:
+        case NSRightMouseDown:
+        case NSRightMouseUp:
+        case NSRightMouseDragged:
+        case NSOtherMouseDown:
+        case NSOtherMouseUp:
+        case NSOtherMouseDragged:
+        case NSMouseMoved:
+        case NSScrollWheel:
+            // Note: This has its origin at the bottom left of the window.
+            // The Y coordinate gets flipped by QScrollView::viewportToContents.
+            // We should probably change both this and that to not use "bottom left origin" coordinates at all.
+            return IntPoint([event locationInWindow]);
+        default:
+            return IntPoint();
+    }
+}
+
+static IntPoint globalPositionForEvent(NSEvent *event)
+{
+    switch ([event type]) {
+        case NSLeftMouseDown:
+        case NSLeftMouseUp:
+        case NSLeftMouseDragged:
+        case NSRightMouseDown:
+        case NSRightMouseUp:
+        case NSRightMouseDragged:
+        case NSOtherMouseDown:
+        case NSOtherMouseUp:
+        case NSOtherMouseDragged:
+        case NSMouseMoved:
+        case NSScrollWheel: {
+            NSPoint point = [[event window] convertBaseToScreen:[event locationInWindow]];
+            point.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - point.y;
+            return IntPoint(point);
+        }
+        default:
+            return IntPoint();
+    }
+}
+
+static int clickCountForEvent(NSEvent *event)
+{
+    switch ([event type]) {
+        case NSLeftMouseDown:
+        case NSLeftMouseUp:
+        case NSLeftMouseDragged:
+        case NSRightMouseDown:
+        case NSRightMouseUp:
+        case NSRightMouseDragged:
+        case NSOtherMouseDown:
+        case NSOtherMouseUp:
+        case NSOtherMouseDragged:
+            return [event clickCount];
+        default:
+            return 0;
+    }
+}
+
+MouseEvent::MouseEvent(NSEvent* event)
+    : m_position(positionForEvent(event))
+    , m_globalPosition(globalPositionForEvent(event))
+    , m_button(mouseButtonForEvent(event))
+    , m_clickCount(clickCountForEvent(event))
+    , m_shiftKey([event modifierFlags] & NSShiftKeyMask)
+    , m_ctrlKey([event modifierFlags] & NSControlKeyMask)
+    , m_altKey([event modifierFlags] & NSAlternateKeyMask)
+    , m_metaKey([event modifierFlags] & NSCommandKeyMask)
+{
+}
+
+MouseEvent::MouseEvent()
+    : m_button(LeftButton), m_clickCount(0), m_shiftKey(false), m_ctrlKey(false), m_altKey(false), m_metaKey(false)
+{
+    NSEvent* event = [NSApp currentEvent];
+    if (event) {
+        m_position = positionForEvent(event);
+        m_globalPosition = globalPositionForEvent(event);
+        m_button = mouseButtonForEvent(event);
+        m_clickCount = clickCountForEvent(event);
+        m_shiftKey = [event modifierFlags] & NSShiftKeyMask;
+        m_ctrlKey = [event modifierFlags] & NSControlKeyMask;
+        m_altKey = [event modifierFlags] & NSAlternateKeyMask;
+        m_metaKey = [event modifierFlags] & NSCommandKeyMask;
+    }
+}
+
+}
diff --git a/WebCore/platform/mac/WheelEventMac.mm b/WebCore/platform/mac/WheelEventMac.mm
new file mode 100644 (file)
index 0000000..1f34603
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "config.h"
+#import "WheelEvent.h"
+
+namespace WebCore {
+
+static IntPoint positionForEvent(NSEvent *event)
+{
+    switch ([event type]) {
+        case NSScrollWheel:
+            // Note: This has its origin at the bottom left of the window.
+            // The Y coordinate gets flipped by QScrollView::viewportToContents.
+            // We should probably change both this and that to not use "bottom left origin" coordinates at all.
+            return IntPoint([event locationInWindow]);
+        default:
+            return IntPoint();
+    }
+}
+
+static IntPoint globalPositionForEvent(NSEvent *event)
+{
+    switch ([event type]) {
+        case NSScrollWheel: {
+            NSPoint point = [[event window] convertBaseToScreen:[event locationInWindow]];
+            point.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - point.y;
+            return IntPoint(point);
+        }
+        default:
+            return IntPoint();
+    }
+}
+
+static bool eventIsHorizontal(NSEvent *event)
+{
+    switch ([event type]) {
+        case NSScrollWheel:
+            return [event deltaX] != 0;
+        default:
+            return false;
+    }
+}
+
+static int deltaForEvent(NSEvent *event)
+{
+    switch ([event type]) {
+        case NSScrollWheel:
+            return lrint((eventIsHorizontal(event) ? [event deltaX] : [event deltaY]) * 120);
+        default:
+            return 0;
+    }
+}
+
+WheelEvent::WheelEvent(NSEvent* event)
+    : m_position(positionForEvent(event))
+    , m_globalPosition(globalPositionForEvent(event))
+    , m_delta(deltaForEvent(event))
+    , m_isHorizontal(eventIsHorizontal(event))
+    , m_isAccepted(false)
+    , m_shiftKey([event modifierFlags] & NSShiftKeyMask)
+    , m_ctrlKey([event modifierFlags] & NSControlKeyMask)
+    , m_altKey([event modifierFlags] & NSAlternateKeyMask)
+    , m_metaKey([event modifierFlags] & NSCommandKeyMask)
+{
+}
+
+}
index 858add2..3aea14c 100644 (file)
 #import "Widget.h"
 
 #import "Cursor.h"
+#import "FoundationExtras.h"
 #import "KWQExceptions.h"
-#import "KWQFoundationExtras.h"
 #import "KWQView.h"
 #import "MacFrame.h"
 #import "WebCoreFrameBridge.h"
 #import "WebCoreFrameView.h"
 #import "WebCoreView.h"
 #import "render_replaced.h"
+#import <qpalette.h>
 
 namespace WebCore {
 
diff --git a/WebCore/rendering/GapRects.h b/WebCore/rendering/GapRects.h
new file mode 100644 (file)
index 0000000..fb109ff
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+    This file is part of the KDE libraries
+
+    Copyright (C) 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.
+
+
+    Some useful definitions needed for laying out elements
+*/
+
+#ifndef GapRects_h
+#define GapRects_h
+
+#include "IntRect.h"
+
+namespace WebCore {
+
+    struct GapRects {
+        const IntRect& left() const { return m_left; }
+        const IntRect& center() const { return m_center; }
+        const IntRect& right() const { return m_right; }
+        
+        void uniteLeft(const IntRect& r) { m_left.unite(r); }
+        void uniteCenter(const IntRect& r) { m_center.unite(r); }
+        void uniteRight(const IntRect& r) { m_right.unite(r); }
+        void unite(const GapRects& o) { uniteLeft(o.left()); uniteCenter(o.center()); uniteRight(o.right()); }
+
+        operator IntRect() const
+        {
+            IntRect result = m_left;
+            result.unite(m_center);
+            result.unite(m_right);
+            return result;
+        }
+
+        bool operator==(const GapRects& other)
+        {
+            return m_left == other.left() && m_center == other.center() && m_right == other.right();
+        }
+        bool operator!=(const GapRects& other) { return !(*this == other); }
+
+    private:
+        IntRect m_left;
+        IntRect m_center;
+        IntRect m_right;
+    };
+
+}
+
+#endif
index 9bb3ae1..cb9a7bd 100644 (file)
@@ -57,7 +57,7 @@ RenderBlock::MarginInfo::MarginInfo(RenderBlock* block, int top, int bottom)
     // effects when the children overflow out of the parent block and yet still collapse
     // with it.  We also don't collapse if we have any bottom border/padding.
     m_canCollapseBottomWithChildren = m_canCollapseWithChildren && (bottom == 0) &&
-        (block->style()->height().isAuto() && block->style()->height().value == 0) && block->style()->marginBottomCollapse() != MSEPARATE;
+        (block->style()->height().isAuto() && block->style()->height().value() == 0) && block->style()->marginBottomCollapse() != MSEPARATE;
     
     m_quirkContainer = block->isTableCell() || block->isBody() || block->style()->marginTopCollapse() == MDISCARD || 
         block->style()->marginBottomCollapse() == MDISCARD;
@@ -374,7 +374,7 @@ bool RenderBlock::isSelfCollapsingBlock() const
     // (e) have specified that one of our margins can't collapse using a CSS extension
     if (m_height > 0 ||
         isTable() || (borderBottom() + paddingBottom() + borderTop() + paddingTop()) != 0 ||
-        style()->minHeight().value > 0 || 
+        style()->minHeight().value() > 0 || 
         style()->marginTopCollapse() == MSEPARATE || style()->marginBottomCollapse() == MSEPARATE)
         return false;
 
@@ -389,7 +389,7 @@ bool RenderBlock::isSelfCollapsingBlock() const
 
     // If the height is 0 or auto, then whether or not we are a self-collapsing block depends
     // on whether we have content that is all self-collapsing or not.
-    if (hasAutoHeight || ((style()->height().isFixed() || style()->height().isPercent()) && style()->height().value == 0)) {
+    if (hasAutoHeight || ((style()->height().isFixed() || style()->height().isPercent()) && style()->height().value() == 0)) {
         // If the block has inline children, see if we generated any line boxes.  If we have any
         // line boxes, then we can't be self-collapsing, since we have content.
         if (childrenInline())
@@ -465,8 +465,8 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
     if (!isTableCell()) {
         initMaxMarginValues();
 
-        m_topMarginQuirk = style()->marginTop().quirk;
-        m_bottomMarginQuirk = style()->marginBottom().quirk;
+        m_topMarginQuirk = style()->marginTop().quirk();
+        m_bottomMarginQuirk = style()->marginBottom().quirk();
 
         if (element() && element()->hasTagName(formTag) && element()->isMalformed())
             // See if this form is malformed (i.e., unclosed). If so, don't give the form
@@ -913,7 +913,7 @@ void RenderBlock::determineHorizontalPosition(RenderObject* child)
         // to shift over as necessary to dodge any floats that might get in the way.
         if (child->avoidsFloats()) {
             int leftOff = leftOffset(m_height);
-            if (style()->textAlign() != KHTML_CENTER && child->style()->marginLeft().type != Auto) {
+            if (style()->textAlign() != KHTML_CENTER && child->style()->marginLeft().type() != Auto) {
                 if (child->marginLeft() < 0)
                     leftOff += child->marginLeft();
                 chPos = kMax(chPos, leftOff); // Let the float sit in the child's margin if it can fit.
@@ -934,7 +934,7 @@ void RenderBlock::determineHorizontalPosition(RenderObject* child)
         int chPos = xPos - (child->width() + child->marginRight());
         if (child->avoidsFloats()) {
             int rightOff = rightOffset(m_height);
-            if (style()->textAlign() != KHTML_CENTER && child->style()->marginRight().type != Auto) {
+            if (style()->textAlign() != KHTML_CENTER && child->style()->marginRight().type() != Auto) {
                 if (child->marginRight() < 0)
                     rightOff -= child->marginRight();
                 chPos = kMin(chPos, rightOff - child->width()); // Let the float sit in the child's margin if it can fit.
@@ -1962,7 +1962,7 @@ RenderBlock::leftRelOffset(int y, int fixedOffset, bool applyTextIndent,
         int cw=0;
         if (style()->textIndent().isPercent())
             cw = containingBlock()->contentWidth();
-        left += style()->textIndent().minWidth(cw);
+        left += style()->textIndent().calcMinValue(cw);
     }
 
     //kdDebug( 6040 ) << "leftOffset(" << y << ") = " << left << endl;
@@ -2004,7 +2004,7 @@ RenderBlock::rightRelOffset(int y, int fixedOffset, bool applyTextIndent,
         int cw=0;
         if (style()->textIndent().isPercent())
             cw = containingBlock()->contentWidth();
-        right -= style()->textIndent().minWidth(cw);
+        right -= style()->textIndent().calcMinValue(cw);
     }
     
     //kdDebug( 6040 ) << "rightOffset(" << y << ") = " << right << endl;
@@ -2671,19 +2671,19 @@ void RenderBlock::calcMinMaxWidth()
 
     if (isTableCell()) {
         Length w = static_cast<RenderTableCell*>(this)->styleOrColWidth();
-        if (w.isFixed() && w.value > 0)
-            m_maxWidth = kMax(m_minWidth, calcContentBoxWidth(w.value));
-    } else if (style()->width().isFixed() && style()->width().value > 0)
-        m_minWidth = m_maxWidth = calcContentBoxWidth(style()->width().value);
+        if (w.isFixed() && w.value() > 0)
+            m_maxWidth = kMax(m_minWidth, calcContentBoxWidth(w.value()));
+    } else if (style()->width().isFixed() && style()->width().value() > 0)
+        m_minWidth = m_maxWidth = calcContentBoxWidth(style()->width().value());
     
-    if (style()->minWidth().isFixed() && style()->minWidth().value > 0) {
-        m_maxWidth = kMax(m_maxWidth, calcContentBoxWidth(style()->minWidth().value));
-        m_minWidth = kMax(m_minWidth, calcContentBoxWidth(style()->minWidth().value));
+    if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
+        m_maxWidth = kMax(m_maxWidth, calcContentBoxWidth(style()->minWidth().value()));
+        m_minWidth = kMax(m_minWidth, calcContentBoxWidth(style()->minWidth().value()));
     }
     
-    if (style()->maxWidth().isFixed() && style()->maxWidth().value != UNDEFINED) {
-        m_maxWidth = kMin(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value));
-        m_minWidth = kMin(m_minWidth, calcContentBoxWidth(style()->maxWidth().value));
+    if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
+        m_maxWidth = kMin(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value()));
+        m_minWidth = kMin(m_minWidth, calcContentBoxWidth(style()->maxWidth().value()));
     }
 
     int toAdd = 0;
@@ -2767,8 +2767,8 @@ RenderObject* InlineMinMaxIterator::next()
 
 static int getBPMWidth(int childValue, Length cssUnit)
 {
-    if (cssUnit.type != Auto)
-        return (cssUnit.type == Fixed ? cssUnit.value : childValue);
+    if (cssUnit.type() != Auto)
+        return (cssUnit.isFixed() ? cssUnit.value() : childValue);
     return 0;
 }
 
@@ -2879,12 +2879,12 @@ void RenderBlock::calcInlineMinMaxWidth()
                 else {
                     // Inline replaced elts add in their margins to their min/max values.
                     int margins = 0;
-                    LengthType type = cstyle->marginLeft().type;
+                    LengthType type = cstyle->marginLeft().type();
                     if ( type != Auto )
-                        margins += (type == Fixed ? cstyle->marginLeft().value : child->marginLeft());
-                    type = cstyle->marginRight().type;
+                        margins += (type == Fixed ? cstyle->marginLeft().value() : child->marginLeft());
+                    type = cstyle->marginRight().type