Commit 947a31b6 authored by darin's avatar darin

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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 05690148
This diff is collapsed.
...@@ -186,10 +186,6 @@ ...@@ -186,10 +186,6 @@
RelativePath="..\..\kwq\KWQEditCommand.h" RelativePath="..\..\kwq\KWQEditCommand.h"
> >
</File> </File>
<File
RelativePath="..\..\kwq\KWQEvent.h"
>
</File>
<File <File
RelativePath="..\..\kwq\KWQExceptions.h" RelativePath="..\..\kwq\KWQExceptions.h"
> >
...@@ -210,10 +206,6 @@ ...@@ -210,10 +206,6 @@
RelativePath="..\..\kwq\KWQFormData.h" RelativePath="..\..\kwq\KWQFormData.h"
> >
</File> </File>
<File
RelativePath="..\..\kwq\KWQFoundationExtras.h"
>
</File>
<File <File
RelativePath="..\..\kwq\KWQGuardedPtr.cpp" RelativePath="..\..\kwq\KWQGuardedPtr.cpp"
> >
...@@ -278,10 +270,6 @@ ...@@ -278,10 +270,6 @@
RelativePath="..\..\kwq\KWQKPartsBrowserInterface.h" RelativePath="..\..\kwq\KWQKPartsBrowserInterface.h"
> >
</File> </File>
<File
RelativePath="..\..\kwq\KWQKPartsHistoryProvider.h"
>
</File>
<File <File
RelativePath="..\..\kwq\KWQKPartsPart.h" RelativePath="..\..\kwq\KWQKPartsPart.h"
> >
...@@ -1293,10 +1281,6 @@ ...@@ -1293,10 +1281,6 @@
RelativePath="..\..\khtml\misc\helper.h" RelativePath="..\..\khtml\misc\helper.h"
> >
</File> </File>
<File
RelativePath="..\..\khtml\misc\khtmllayout.h"
>
</File>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter
...@@ -1330,6 +1314,10 @@ ...@@ -1330,6 +1314,10 @@
RelativePath="..\..\page\FrameView.h" RelativePath="..\..\page\FrameView.h"
> >
</File> </File>
<File
RelativePath="..\..\page\MouseEventWithHitTestResults.h"
>
</File>
<File <File
RelativePath="..\..\page\Page.cpp" RelativePath="..\..\page\Page.cpp"
> >
...@@ -1608,6 +1596,14 @@ ...@@ -1608,6 +1596,14 @@
RelativePath="..\..\platform\IntSize.h" RelativePath="..\..\platform\IntSize.h"
> >
</File> </File>
<File
RelativePath="..\..\platform\KeyEvent.h"
>
</File>
<File
RelativePath="..\..\platform\MouseEvent.h"
>
</File>
<File <File
RelativePath="..\..\platform\Pen.cpp" RelativePath="..\..\platform\Pen.cpp"
> >
...@@ -1684,6 +1680,10 @@ ...@@ -1684,6 +1680,10 @@
RelativePath="..\..\platform\Timer.h" RelativePath="..\..\platform\Timer.h"
> >
</File> </File>
<File
RelativePath="..\..\platform\WheelEvent.h"
>
</File>
<File <File
RelativePath="..\..\platform\Widget.cpp" RelativePath="..\..\platform\Widget.cpp"
> >
...@@ -2548,6 +2548,10 @@ ...@@ -2548,6 +2548,10 @@
RelativePath="..\..\css\tokenizer.flex" RelativePath="..\..\css\tokenizer.flex"
> >
</File> </File>
<File
RelativePath="..\..\css\Length.h"
>
</File>
<File <File
RelativePath="..\..\css\UserAgentStyleSheets.cpp" RelativePath="..\..\css\UserAgentStyleSheets.cpp"
> >
...@@ -2584,6 +2588,10 @@ ...@@ -2584,6 +2588,10 @@
RelativePath="..\..\rendering\font.h" RelativePath="..\..\rendering\font.h"
> >
</File> </File>
<File
RelativePath="..\..\rendering\GapRects.h"
>
</File>
<File <File
RelativePath="..\..\rendering\InlineTextBox.cpp" RelativePath="..\..\rendering\InlineTextBox.cpp"
> >
...@@ -2852,6 +2860,10 @@ ...@@ -2852,6 +2860,10 @@
RelativePath="..\..\bridge\BrowserExtension.h" RelativePath="..\..\bridge\BrowserExtension.h"
> >
</File> </File>
<File
RelativePath="..\..\bridge\History.h"
>
</File>
<Filter <Filter
Name="win" Name="win"
> >
......
This diff is collapsed.
#include "config.h" #include "config.h"
// These are generated files. // 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 "JSAttr.cpp"
#include "JSCharacterData.cpp" #include "JSCharacterData.cpp"
......
#include "config.h" #include "config.h"
// These are generated files. // 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 "JSMutationEvent.cpp"
#include "JSWheelEvent.cpp" #include "JSWheelEvent.cpp"
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
#import "DocumentFragmentImpl.h" #import "DocumentFragmentImpl.h"
#import "DocumentImpl.h" #import "DocumentImpl.h"
#import "DocumentTypeImpl.h" #import "DocumentTypeImpl.h"
#import "FoundationExtras.h"
#import "HTMLElementImpl.h" #import "HTMLElementImpl.h"
#import "KWQFoundationExtras.h"
#import "MacFrame.h" #import "MacFrame.h"
#import "NodeListImpl.h" #import "NodeListImpl.h"
#import "PlatformString.h" #import "PlatformString.h"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#import "DOMInternal.h" #import "DOMInternal.h"
#import "Color.h" #import "Color.h"
#import "KWQFoundationExtras.h" #import "FoundationExtras.h"
#import "css_base.h" #import "css_base.h"
#import "css_ruleimpl.h" #import "css_ruleimpl.h"
#import "css_stylesheetimpl.h" #import "css_stylesheetimpl.h"
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#import "DOMInternal.h" #import "DOMInternal.h"
#import "DOMHTMLInternal.h" #import "DOMHTMLInternal.h"
#import <kxmlcore/Assertions.h> #import <kxmlcore/Assertions.h>
#import "KWQFoundationExtras.h" #import "FoundationExtras.h"
using namespace DOM; using namespace DOM;
using namespace DOM::HTMLNames; using namespace DOM::HTMLNames;
......
/* /*
* 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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -23,19 +23,14 @@ ...@@ -23,19 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef HISTORYPROVIDER_H_ #ifndef HISTORY_H
#define HISTORYPROVIDER_H_ #define HISTORY_H
#include "KWQObject.h" class QString;
namespace KParts { namespace WebCore {
class HistoryProvider : public QObject { bool historyContains(const QString&);
public:
static HistoryProvider *self();
bool contains(const QString &) const;
};
} }
......
/* /*
* 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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -23,30 +23,20 @@ ...@@ -23,30 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "config.h" #import "config.h"
#import "KWQKPartsHistoryProvider.h" #import "History.h"
#import "KWQExceptions.h" #import "QString.h"
#import "KWQKURL.h"
#import "WebCoreHistory.h" #import "WebCoreHistory.h"
namespace KParts { namespace WebCore {
HistoryProvider *HistoryProvider::self() bool historyContains(const QString& s)
{
static HistoryProvider instance;
return &instance;
}
bool HistoryProvider::contains(const QString &s) const
{ {
// the other side of the bridge is careful not to throw exceptions here // 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()]; 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 }
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
virtual void setTitle(const DOMString &); virtual void setTitle(const DOMString &);
virtual void setStatusBarText(const String&); 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 ObjectContentType objectContentType(const KURL& url, const QString& mimeType);
virtual Plugin* createPlugin(const KURL& url, const QStringList& paramNames, const QStringList& paramValues, const QString& mimeType); virtual Plugin* createPlugin(const KURL& url, const QStringList& paramNames, const QStringList& paramValues, const QString& mimeType);
...@@ -233,7 +233,7 @@ public: ...@@ -233,7 +233,7 @@ public:
bool sendContextMenuEvent(NSEvent *); bool sendContextMenuEvent(NSEvent *);
bool passMouseDownEventToWidget(Widget *); bool passMouseDownEventToWidget(Widget *);
virtual bool passSubframeEventToSubframe(NodeImpl::MouseEvent &); virtual bool passSubframeEventToSubframe(MouseEventWithHitTestResults &);
virtual bool passWheelEventToChildWidget(NodeImpl *); virtual bool passWheelEventToChildWidget(NodeImpl *);
virtual void clearRecordedFormValues(); virtual void clearRecordedFormValues();
...@@ -318,9 +318,9 @@ protected: ...@@ -318,9 +318,9 @@ protected:
virtual void redirectionTimerFired(Timer<Frame>*); virtual void redirectionTimerFired(Timer<Frame>*);
private: private:
virtual void khtmlMousePressEvent(MousePressEvent *); virtual void khtmlMousePressEvent(MouseEventWithHitTestResults *);
virtual void khtmlMouseMoveEvent(MouseMoveEvent *); virtual void khtmlMouseMoveEvent(MouseEventWithHitTestResults *);
virtual void khtmlMouseReleaseEvent(MouseReleaseEvent *); virtual void khtmlMouseReleaseEvent(MouseEventWithHitTestResults *);
NSView *mouseDownViewIfStillGood(); NSView *mouseDownViewIfStillGood();
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#import "Cursor.h" #import "Cursor.h"
#import "DOMInternal.h" #import "DOMInternal.h"
#import "EventNames.h" #import "EventNames.h"
#import "FoundationExtras.h"
#import "FramePrivate.h" #import "FramePrivate.h"
#import "FrameView.h" #import "FrameView.h"
#import "HTMLFormElementImpl.h" #import "HTMLFormElementImpl.h"
...@@ -39,10 +40,8 @@ ...@@ -39,10 +40,8 @@
#import "KWQAccObjectCache.h" #import "KWQAccObjectCache.h"
#import "KWQClipboard.h" #import "KWQClipboard.h"
#import "KWQEditCommand.h" #import "KWQEditCommand.h"
#import "KWQEvent.h"
#import "KWQExceptions.h" #import "KWQExceptions.h"
#import "KWQFormData.h" #import "KWQFormData.h"
#import "KWQFoundationExtras.h"
#import "KWQKJobClasses.h" #import "KWQKJobClasses.h"
#import "KWQLogging.h" #import "KWQLogging.h"
#import "KWQPageState.h" #import "KWQPageState.h"
...@@ -51,6 +50,9 @@ ...@@ -51,6 +50,9 @@
#import "KWQScrollBar.h" #import "KWQScrollBar.h"
#import "KWQTextCodec.h" #import "KWQTextCodec.h"
#import "KWQWindowWidget.h" #import "KWQWindowWidget.h"
#import "KeyEvent.h"
#import "MouseEvent.h"
#import "MouseEventWithHitTestResults.h"
#import "Plugin.h" #import "Plugin.h"
#import "RenderTableCell.h" #import "RenderTableCell.h"
#import "SelectionController.h" #import "SelectionController.h"
...@@ -59,6 +61,7 @@ ...@@ -59,6 +61,7 @@
#import "WebCoreGraphicsBridge.h" #import "WebCoreGraphicsBridge.h"
#import "WebCoreViewFactory.h" #import "WebCoreViewFactory.h"
#import "WebDashboardRegion.h" #import "WebDashboardRegion.h"
#import "WheelEvent.h"
#import "css_computedstyle.h" #import "css_computedstyle.h"
#import "csshelper.h" #import "csshelper.h"
#import "dom2_eventsimpl.h" #import "dom2_eventsimpl.h"
...@@ -66,7 +69,6 @@ ...@@ -66,7 +69,6 @@
#import "dom_position.h" #import "dom_position.h"
#import "html_documentimpl.h" #import "html_documentimpl.h"
#import "html_tableimpl.h" #import "html_tableimpl.h"
#import "khtml_events.h"
#import "kjs_binding.h" #import "kjs_binding.h"
#import "kjs_window.h" #import "kjs_window.h"
#import "render_canvas.h" #import "render_canvas.h"
...@@ -542,11 +544,11 @@ void MacFrame::frameDetached() ...@@ -542,11 +544,11 @@ void MacFrame::frameDetached()
KWQ_UNBLOCK_EXCEPTIONS; 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; KWQ_BLOCK_EXCEPTIONS;
NSString *referrer; NSString* referrer;
DOMString argsReferrer = args.metaData().get("referrer"); DOMString argsReferrer = args.metaData().get("referrer");
if (!argsReferrer.isEmpty()) if (!argsReferrer.isEmpty())
referrer = argsReferrer; referrer = argsReferrer;
...@@ -796,7 +798,7 @@ bool MacFrame::wheelEvent(NSEvent *event) ...@@ -796,7 +798,7 @@ bool MacFrame::wheelEvent(NSEvent *event)
NSEvent *oldCurrentEvent = _currentEvent; NSEvent *oldCurrentEvent = _currentEvent;
_currentEvent = KWQRetain(event); _currentEvent = KWQRetain(event);
QWheelEvent qEvent(event); WheelEvent qEvent(event);
v->viewportWheelEvent(&qEvent); v->viewportWheelEvent(&qEvent);
ASSERT(_currentEvent == event); ASSERT(_currentEvent == event);
...@@ -1404,15 +1406,15 @@ bool MacFrame::keyEvent(NSEvent *event) ...@@ -1404,15 +1406,15 @@ bool MacFrame::keyEvent(NSEvent *event)
NSEvent *oldCurrentEvent = _currentEvent; NSEvent *oldCurrentEvent = _currentEvent;
_currentEvent = KWQRetain(event); _currentEvent = KWQRetain(event);
QKeyEvent qEvent(event); KeyEvent qEvent(event);
result = !node->dispatchKeyEvent(&qEvent); result = !node->dispatchKeyEvent(&qEvent);
// We want to send both a down and a press for the initial key event. // 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. // 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. // That's not a great hack; it would be good to do this in a better way.
if ([event type] == NSKeyDown && ![event isARepeat]) { if ([event type] == NSKeyDown && ![event isARepeat]) {
QKeyEvent repeatEvent(event, true); KeyEvent repeatEvent(event, true);
if (!node->dispatchKeyEvent(&repeatEvent)) { if (!node->dispatchKeyEvent(&repeatEvent)) {
result = true; result = true;
} }
...@@ -1429,7 +1431,7 @@ bool MacFrame::keyEvent(NSEvent *event) ...@@ -1429,7 +1431,7 @@ bool MacFrame::keyEvent(NSEvent *event)
return false; return false;
} }
void MacFrame::khtmlMousePressEvent(MousePressEvent *event) void MacFrame::khtmlMousePressEvent(MouseEventWithHitTestResults *event)
{ {
bool singleClick = [_currentEvent clickCount] <= 1; bool singleClick = [_currentEvent clickCount] <= 1;
...@@ -1641,7 +1643,7 @@ bool MacFrame::dragHysteresisExceeded(float dragLocationX, float dragLocationY) ...@@ -1641,7 +1643,7 @@ bool MacFrame::dragHysteresisExceeded(float dragLocationX, float dragLocationY)
return deltaX >= threshold || deltaY >= threshold; return deltaX >= threshold || deltaY >= threshold;
} }
void MacFrame::khtmlMouseMoveEvent(MouseMoveEvent *event) void MacFrame::khtmlMouseMoveEvent(MouseEventWithHitTestResults *event)
{ {
KWQ_BLOCK_EXCEPTIONS; KWQ_BLOCK_EXCEPTIONS;
...@@ -1860,7 +1862,7 @@ bool MacFrame::tryPaste() ...@@ -1860,7 +1862,7 @@ bool MacFrame::tryPaste()
return !dispatchCPPEvent(pasteEvent, KWQClipboard::Readable); return !dispatchCPPEvent(pasteEvent, KWQClipboard::Readable);
} }
void MacFrame::khtmlMouseReleaseEvent(MouseReleaseEvent *event) void MacFrame::khtmlMouseReleaseEvent(MouseEventWithHitTestResults *event)
{ {
NSView *view = mouseDownViewIfStillGood(); NSView *view = mouseDownViewIfStillGood();
if (!view) { if (!view) {
...@@ -1882,13 +1884,13 @@ void MacFrame::khtmlMouseReleaseEvent(MouseReleaseEvent *event) ...@@ -1882,13 +1884,13 @@ void MacFrame::khtmlMouseReleaseEvent(MouseReleaseEvent *event)
_sendingEventToSubview = false; _sendingEventToSubview = false;
} }
bool MacFrame::passSubframeEventToSubframe(NodeImpl::MouseEvent &event) bool MacFrame::passSubframeEventToSubframe(MouseEventWithHitTestResults &event)
{ {
KWQ_BLOCK_EXCEPTIONS; KWQ_BLOCK_EXCEPTIONS;
switch ([_currentEvent type]) { switch ([_currentEvent type]) {
case NSMouseMoved: { case NSMouseMoved: {
NodeImpl *node = event.innerNode.get(); NodeImpl *node = event.innerNode();
if (!node) if (!node)
return false; return false;
RenderObject *renderer = node->renderer(); RenderObject *renderer = node->renderer();
...@@ -1905,7 +1907,7 @@ bool MacFrame::passSubframeEventToSubframe(NodeImpl::MouseEvent &event) ...@@ -1905,7 +1907,7 @@ bool MacFrame::passSubframeEventToSubframe(NodeImpl::MouseEvent &event)
} }
case NSLeftMouseDown: { case NSLeftMouseDown: {
NodeImpl *node = event.innerNode.get(); NodeImpl *node = event.innerNode();
if (!node) { if (!node) {
return false; return false;
} }
...@@ -2013,7 +2015,7 @@ void MacFrame::mouseDown(NSEvent *event) ...@@ -2013,7 +2015,7 @@ void MacFrame::mouseDown(NSEvent *event)
_mouseDownMayStartDrag = false; _mouseDownMayStartDrag = false;
_mouseDownMayStartSelect = false; _mouseDownMayStartSelect = false;
QMouseEvent kEvent(QEvent::MouseButtonPress, event); MouseEvent kEvent(event);
v->viewportMousePressEvent(&kEvent); v->viewportMousePressEvent(&kEvent);
ASSERT(_currentEvent == event); ASSERT(_currentEvent == event);
...@@ -2035,7 +2037,7 @@ void MacFrame::mouseDragged(NSEvent *event) ...@@ -2035,7 +2037,7 @@ void MacFrame::mouseDragged(NSEvent *event)
NSEvent *oldCurrentEvent = _currentEvent; NSEvent *oldCurrentEvent = _currentEvent;
_currentEvent = KWQRetain(event); _currentEvent = KWQRetain(event);
QMouseEvent kEvent(QEvent::MouseMove, event); MouseEvent kEvent(event);
v->viewportMouseMoveEvent(&kEvent); v->viewportMouseMoveEvent(&kEvent);
ASSERT(_currentEvent == event); ASSERT(_currentEvent == event);
...@@ -2066,10 +2068,10 @@ void MacFrame::mouseUp(NSEvent *event) ...@@ -2066,10 +2068,10 @@ void MacFrame::mouseUp(NSEvent *event)
// treated as another double click. Hence the "% 2" below. // treated as another double click. Hence the "% 2" below.
int clickCount = [event clickCount]; int clickCount = [event clickCount];
if (clickCount > 0 && clickCount % 2 == 0) { if (clickCount > 0 && clickCount % 2 == 0) {
QMouseEvent doubleClickEvent(QEvent::MouseButtonDblClick, event); MouseEvent doubleClickEvent(event);
v->viewportMouseDoubleClickEvent(&doubleClickEvent); v->viewportMouseDoubleClickEvent(&doubleClickEvent);
} else { } else {
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, event); MouseEvent releaseEvent(event);
v->viewportMouseReleaseEvent(&releaseEvent); v->viewportMouseReleaseEvent(&releaseEvent);
} }
...@@ -2157,7 +2159,7 @@ void MacFrame::mouseMoved(NSEvent *event) ...@@ -2157,7 +2159,7 @@ void MacFrame::mouseMoved(NSEvent *event)
NSEvent *oldCurrentEvent = _currentEvent;