Reviewed by Adele.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2006 23:09:48 +0000 (23:09 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2006 23:09:48 +0000 (23:09 +0000)
        - http://bugzilla.opendarwin.org/show_bug.cgi?id=7564
          remove QObject, QGuardedPtr, slots, and signals

        I had written a detailed change log entry, but I lost it!
        I'm too annoyed to write one all over again.

        * ForwardingHeaders/qguardedptr.h: Removed.
        * ForwardingHeaders/qobject.h: Removed.

        * kwq/KWQGuardedPtr.cpp: Removed.
        * kwq/KWQGuardedPtr.h: Removed.
        * kwq/KWQNamespace.h: Removed.
        * kwq/KWQObject.cpp: Removed.
        * kwq/KWQObject.h: Removed.
        * kwq/KWQSignal.cpp: Removed.
        * kwq/KWQSignal.h: Removed.
        * kwq/KWQSlot.cpp: Removed.
        * kwq/KWQSlot.h: Removed.

        * platform/WidgetClient.h: Added.

        * WebCore.xcodeproj/project.pbxproj: Updated for removed and added files.
        * WebCore.vcproj/WebCore/WebCore.vcproj: Ditto.

        * bindings/js/JSDOMCore.cpp: Touched.
        * bindings/js/JSDOMEvents.cpp: Ditto.

        * bridge/BrowserExtension.h:
        (WebCore::BrowserExtension::~BrowserExtension):
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge elementForView:]):
        * dom/CDATASectionImpl.cpp:
        (WebCore::CDATASectionImpl::cloneNode):
        * dom/DocumentImpl.cpp:
        (WebCore::DocumentImpl::~DocumentImpl):
        * dom/DocumentImpl.h:
        * kcanvas/device/KRenderingDevice.h:
        * khtml/ecma/kjs_css.cpp:
        (KJS::DOMCSSStyleDeclaration::put):
        * khtml/ecma/kjs_window.cpp:
        (KJS::FrameArray::indexGetter):
        (KJS::FrameArray::nameGetter):
        * khtml/html/html_documentimpl.cpp:
        (WebCore::HTMLDocumentImpl::createTokenizer):
        * khtml/html/htmlparser.cpp:
        (WebCore::HTMLParser::HTMLParser):
        (WebCore::HTMLParser::insertNode):
        (WebCore::HTMLParser::handleError):
        (WebCore::HTMLParser::commentCreateErrorCheck):
        (WebCore::HTMLParser::noscriptCreateErrorCheck):
        (WebCore::HTMLParser::isInline):
        (WebCore::HTMLParser::finished):
        * khtml/html/htmlparser.h:
        * khtml/html/htmltokenizer.cpp:
        (WebCore::HTMLTokenizer::HTMLTokenizer):
        (WebCore::HTMLTokenizer::scriptHandler):
        (WebCore::HTMLTokenizer::scriptExecution):
        (WebCore::HTMLTokenizer::parseComment):
        (WebCore::HTMLTokenizer::parseTag):
        (WebCore::HTMLTokenizer::stopParsing):
        (WebCore::HTMLTokenizer::timerFired):
        (WebCore::HTMLTokenizer::processToken):
        (WebCore::parseHTMLDocumentFragment):
        * khtml/html/htmltokenizer.h:
        * kwq/KWQComboBox.h:
        * kwq/KWQComboBox.mm:
        (-[KWQPopUpButton setPopulatingMenu:QComboBox:::]):
        (QComboBox::itemSelected):
        (-[KWQPopUpButton becomeFirstResponder]):
        (-[KWQPopUpButton resignFirstResponder]):
        * kwq/KWQFileButton.h:
        (KWQFileButton::filename):
        * kwq/KWQFileButton.mm:
        (KWQFileButton::KWQFileButton):
        (KWQFileButton::filenameChanged):
        (-[KWQFileButtonAdapter filenameChanged:]):
        (-[KWQFileButtonAdapter focusChanged:]):
        (-[KWQFileButtonAdapter clicked]):
        * kwq/KWQLineEdit.h:
        * kwq/KWQLineEdit.mm:
        (QLineEdit::QLineEdit):
        (QLineEdit::setAlignment):
        (KWQNSTextAlignment):
        * kwq/KWQListBox.h:
        (QListBox::changingSelection):
        * kwq/KWQListBox.mm:
        (QListBox::QListBox):
        (-[KWQTableView becomeFirstResponder]):
        (-[KWQTableView resignFirstResponder]):
        (-[KWQTableView tableViewSelectionDidChange:]):
        * kwq/KWQScrollBar.h:
        (WebCore::):
        (QScrollBar::orientation):
        * kwq/KWQScrollBar.mm:
        (-[KWQScrollBar initWithQScrollBar:]):
        (QScrollBar::QScrollBar):
        (QScrollBar::valueChanged):
        (QScrollBar::scroll):
        * kwq/KWQSlider.h:
        * kwq/KWQSlider.mm:
        (-[KWQSlider mouseDown:]):
        (-[KWQSlider slide:]):
        (-[KWQSlider becomeFirstResponder]):
        (-[KWQSlider resignFirstResponder]):
        (QSlider::QSlider):
        (QSlider::sliderValueChanged):
        (QSlider::dimensions):
        * kwq/KWQTextArea.mm:
        (-[KWQTextAreaTextView textViewDidChangeSelection:]):
        (-[KWQTextAreaTextView textDidChange:]):
        (-[KWQTextAreaTextView becomeFirstResponder]):
        (-[KWQTextAreaTextView resignFirstResponder]):
        (-[KWQTextAreaTextView mouseDown:]):
        (-[KWQTextAreaTextView dispatchHTMLEvent:]):
        * kwq/KWQTextEdit.h:
        * kwq/KWQTextEdit.mm:
        (QTextEdit::QTextEdit):
        (QTextEdit::setAlignment):
        * kwq/KWQTextField.mm:
        (-[KWQTextFieldController action:]):
        (-[KWQTextFieldController controlTextDidEndEditing:]):
        (-[KWQTextFieldController controlTextDidChange:]):
        (-[KWQTextFieldController textChanged]):
        (-[KWQTextFieldController textView:didHandleEvent:]):
        (-[KWQTextFieldController setHasFocus:]):
        (-[KWQTextFieldController textViewDidChangeSelection:]):
        * loader/CachedObject.h:
        * page/Frame.cpp:
        (WebCore::Frame::Frame):
        (WebCore::Frame::~Frame):
        (WebCore::Frame::setOpener):
        (WebCore::Frame::nodeForWidget):
        (WebCore::Frame::disconnectOwnerRenderer):
        * page/Frame.h:
        * page/FramePrivate.h:
        (WebCore::FramePrivate::FramePrivate):
        * page/FrameView.cpp:
        (WebCore::FrameView::~FrameView):
        * platform/Brush.h:
        * platform/Pen.h:
        * platform/Widget.cpp:
        (WebCore::Widget::isFrameView):
        * platform/Widget.h:
        (WebCore::):
        * platform/mac/GraphicsContextMac.mm:
        (WebCore::GraphicsContext::drawText):
        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::Widget):
        (WebCore::Widget::focusPolicy):
        (WebCore::Widget::sendConsumedMouseUp):
        (WebCore::Widget::setClient):
        (WebCore::Widget::client):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::operator delete):
        * rendering/render_applet.cpp:
        (WebCore::RenderApplet::createWidgetIfNecessary):
        * rendering/render_form.cpp:
        (WebCore::RenderFormElement::clicked):
        (WebCore::RenderFormElement::textAlignment):
        (WebCore::RenderLineEdit::RenderLineEdit):
        (WebCore::RenderLineEdit::selectionChanged):
        (WebCore::RenderLineEdit::returnPressed):
        (WebCore::RenderLineEdit::performSearch):
        (WebCore::RenderLineEdit::valueChanged):
        (WebCore::RenderFileButton::RenderFileButton):
        (WebCore::RenderFileButton::returnPressed):
        (WebCore::RenderFileButton::valueChanged):
        (WebCore::RenderLegend::RenderLegend):
        (WebCore::RenderSelect::RenderSelect):
        (WebCore::RenderSelect::updateFromElement):
        (WebCore::RenderSelect::valueChanged):
        (WebCore::RenderSelect::selectionChanged):
        (WebCore::RenderSelect::createListBox):
        (WebCore::RenderTextArea::RenderTextArea):
        (WebCore::RenderTextArea::valueChanged):
        (WebCore::RenderTextArea::selectionChanged):
        (WebCore::RenderSlider::RenderSlider):
        (WebCore::RenderSlider::valueChanged):
        * rendering/render_form.h:
        (WebCore::RenderFormElement::element):
        (WebCore::RenderLineEdit::element):
        (WebCore::RenderFileButton::element):
        (WebCore::RenderFileButton::isEditable):
        (WebCore::RenderSelect::element):
        (WebCore::RenderTextArea::element):
        (WebCore::RenderSlider::element):
        * rendering/render_frames.cpp:
        (WebCore::RenderPart::RenderPart):
        (WebCore::RenderPart::~RenderPart):
        (WebCore::RenderPart::setFrame):
        (WebCore::RenderPart::setWidget):
        (WebCore::RenderPart::deleteWidget):
        (WebCore::RenderFrame::RenderFrame):
        (WebCore::RenderPartObject::RenderPartObject):
        (WebCore::RenderPartObject::layout):
        * rendering/render_frames.h:
        * rendering/render_layer.cpp:
        (WebCore::RenderLayer::RenderLayer):
        (WebCore::RenderLayer::~RenderLayer):
        (WebCore::RenderLayer::valueChanged):
        (WebCore::RenderLayer::setHasHorizontalScrollbar):
        (WebCore::RenderLayer::setHasVerticalScrollbar):
        (WebCore::RenderLayer::hitTest):
        * rendering/render_layer.h:
        (WebCore::RenderLayer::parent):
        (WebCore::RenderLayer::previousSibling):
        (WebCore::RenderLayer::nextSibling):
        (WebCore::RenderLayer::firstChild):
        (WebCore::RenderLayer::lastChild):
        * rendering/render_list.cpp:
        (WebCore::RenderListMarker::paint):
        * rendering/render_replaced.cpp:
        (WebCore::RenderWidget::RenderWidget):
        (WebCore::RenderWidget::destroy):
        (WebCore::RenderWidget::~RenderWidget):
        (WebCore::RenderWidget::setWidget):
        (WebCore::RenderWidget::layout):
        (WebCore::RenderWidget::sendConsumedMouseUp):
        (WebCore::RenderWidget::focusIn):
        (WebCore::RenderWidget::focusOut):
        (WebCore::RenderWidget::scrollToVisible):
        (WebCore::RenderWidget::isVisible):
        (WebCore::RenderWidget::element):
        (WebCore::RenderWidget::deleteWidget):
        * rendering/render_replaced.h:
        * xml/xmlhttprequest.cpp:
        (WebCore::requestsByDocument):
        (WebCore::addToRequestsByDocument):
        (WebCore::removeFromRequestsByDocument):
        (WebCore::XMLHttpRequest::getResponseText):
        (WebCore::XMLHttpRequest::getResponseXML):
        (WebCore::XMLHttpRequest::XMLHttpRequest):
        (WebCore::XMLHttpRequest::~XMLHttpRequest):
        (WebCore::XMLHttpRequest::callReadyStateChangeListener):
        (WebCore::XMLHttpRequest::urlMatchesDocumentDomain):
        (WebCore::XMLHttpRequest::open):
        (WebCore::XMLHttpRequest::send):
        (WebCore::XMLHttpRequest::abort):
        (WebCore::XMLHttpRequest::overrideMIMEType):
        (WebCore::XMLHttpRequest::setRequestHeader):
        (WebCore::XMLHttpRequest::getRequestHeader):
        (WebCore::XMLHttpRequest::getAllResponseHeaders):
        (WebCore::XMLHttpRequest::getResponseHeader):
        (WebCore::XMLHttpRequest::getSpecificHeader):
        (WebCore::XMLHttpRequest::responseIsXML):
        (WebCore::XMLHttpRequest::getStatus):
        (WebCore::XMLHttpRequest::getStatusText):
        (WebCore::XMLHttpRequest::receivedAllData):
        (WebCore::XMLHttpRequest::receivedRedirect):
        (WebCore::XMLHttpRequest::receivedData):
        (WebCore::XMLHttpRequest::cancelRequests):
        (WebCore::XMLHttpRequest::detachRequests):
        * xml/xmlhttprequest.h:

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

69 files changed:
WebCore/ChangeLog
WebCore/ForwardingHeaders/qguardedptr.h [deleted file]
WebCore/ForwardingHeaders/qobject.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/bridge/BrowserExtension.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/dom/CDATASectionImpl.cpp
WebCore/dom/DocumentImpl.cpp
WebCore/dom/DocumentImpl.h
WebCore/kcanvas/device/KRenderingDevice.h
WebCore/khtml/ecma/kjs_css.cpp
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/html/html_documentimpl.cpp
WebCore/khtml/html/htmlparser.cpp
WebCore/khtml/html/htmlparser.h
WebCore/khtml/html/htmltokenizer.cpp
WebCore/khtml/html/htmltokenizer.h
WebCore/kwq/KWQComboBox.h
WebCore/kwq/KWQComboBox.mm
WebCore/kwq/KWQFileButton.h
WebCore/kwq/KWQFileButton.mm
WebCore/kwq/KWQGuardedPtr.cpp [deleted file]
WebCore/kwq/KWQGuardedPtr.h [deleted file]
WebCore/kwq/KWQLineEdit.h
WebCore/kwq/KWQLineEdit.mm
WebCore/kwq/KWQListBox.h
WebCore/kwq/KWQListBox.mm
WebCore/kwq/KWQObject.cpp [deleted file]
WebCore/kwq/KWQObject.h [deleted file]
WebCore/kwq/KWQScrollBar.h
WebCore/kwq/KWQScrollBar.mm
WebCore/kwq/KWQSignal.cpp [deleted file]
WebCore/kwq/KWQSignal.h [deleted file]
WebCore/kwq/KWQSlider.h
WebCore/kwq/KWQSlider.mm
WebCore/kwq/KWQSlot.cpp [deleted file]
WebCore/kwq/KWQSlot.h [deleted file]
WebCore/kwq/KWQTextArea.mm
WebCore/kwq/KWQTextEdit.h
WebCore/kwq/KWQTextEdit.mm
WebCore/kwq/KWQTextField.mm
WebCore/loader/CachedObject.h
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FramePrivate.h
WebCore/page/FrameView.cpp
WebCore/platform/Brush.h
WebCore/platform/Pen.h
WebCore/platform/Widget.cpp
WebCore/platform/Widget.h
WebCore/platform/WidgetClient.h [moved from WebCore/kwq/KWQNamespace.h with 62% similarity]
WebCore/platform/mac/GraphicsContextMac.mm
WebCore/platform/mac/WidgetMac.mm
WebCore/rendering/InlineTextBox.cpp
WebCore/rendering/render_applet.cpp
WebCore/rendering/render_form.cpp
WebCore/rendering/render_form.h
WebCore/rendering/render_frames.cpp
WebCore/rendering/render_frames.h
WebCore/rendering/render_layer.cpp
WebCore/rendering/render_layer.h
WebCore/rendering/render_list.cpp
WebCore/rendering/render_replaced.cpp
WebCore/rendering/render_replaced.h
WebCore/xml/xmlhttprequest.cpp
WebCore/xml/xmlhttprequest.h

index 3bdeb19e32b43a0c463e1fe3a9327a2531cf595b..ecb3ce6f555d78ad391a2bcaea231e127f2edba2 100644 (file)
@@ -1,3 +1,261 @@
+2006-03-06  Darin Adler  <darin@apple.com>
+
+        Reviewed by Adele.
+
+        - http://bugzilla.opendarwin.org/show_bug.cgi?id=7564
+          remove QObject, QGuardedPtr, slots, and signals
+
+        I had written a detailed change log entry, but I lost it!
+        I'm too annoyed to write one all over again.
+
+        * ForwardingHeaders/qguardedptr.h: Removed.
+        * ForwardingHeaders/qobject.h: Removed.
+
+        * kwq/KWQGuardedPtr.cpp: Removed.
+        * kwq/KWQGuardedPtr.h: Removed.
+        * kwq/KWQNamespace.h: Removed.
+        * kwq/KWQObject.cpp: Removed.
+        * kwq/KWQObject.h: Removed.
+        * kwq/KWQSignal.cpp: Removed.
+        * kwq/KWQSignal.h: Removed.
+        * kwq/KWQSlot.cpp: Removed.
+        * kwq/KWQSlot.h: Removed.
+
+        * platform/WidgetClient.h: Added.
+
+        * WebCore.xcodeproj/project.pbxproj: Updated for removed and added files.
+        * WebCore.vcproj/WebCore/WebCore.vcproj: Ditto.
+
+        * bindings/js/JSDOMCore.cpp: Touched.
+        * bindings/js/JSDOMEvents.cpp: Ditto.
+
+        * bridge/BrowserExtension.h:
+        (WebCore::BrowserExtension::~BrowserExtension):
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge elementForView:]):
+        * dom/CDATASectionImpl.cpp:
+        (WebCore::CDATASectionImpl::cloneNode):
+        * dom/DocumentImpl.cpp:
+        (WebCore::DocumentImpl::~DocumentImpl):
+        * dom/DocumentImpl.h:
+        * kcanvas/device/KRenderingDevice.h:
+        * khtml/ecma/kjs_css.cpp:
+        (KJS::DOMCSSStyleDeclaration::put):
+        * khtml/ecma/kjs_window.cpp:
+        (KJS::FrameArray::indexGetter):
+        (KJS::FrameArray::nameGetter):
+        * khtml/html/html_documentimpl.cpp:
+        (WebCore::HTMLDocumentImpl::createTokenizer):
+        * khtml/html/htmlparser.cpp:
+        (WebCore::HTMLParser::HTMLParser):
+        (WebCore::HTMLParser::insertNode):
+        (WebCore::HTMLParser::handleError):
+        (WebCore::HTMLParser::commentCreateErrorCheck):
+        (WebCore::HTMLParser::noscriptCreateErrorCheck):
+        (WebCore::HTMLParser::isInline):
+        (WebCore::HTMLParser::finished):
+        * khtml/html/htmlparser.h:
+        * khtml/html/htmltokenizer.cpp:
+        (WebCore::HTMLTokenizer::HTMLTokenizer):
+        (WebCore::HTMLTokenizer::scriptHandler):
+        (WebCore::HTMLTokenizer::scriptExecution):
+        (WebCore::HTMLTokenizer::parseComment):
+        (WebCore::HTMLTokenizer::parseTag):
+        (WebCore::HTMLTokenizer::stopParsing):
+        (WebCore::HTMLTokenizer::timerFired):
+        (WebCore::HTMLTokenizer::processToken):
+        (WebCore::parseHTMLDocumentFragment):
+        * khtml/html/htmltokenizer.h:
+        * kwq/KWQComboBox.h:
+        * kwq/KWQComboBox.mm:
+        (-[KWQPopUpButton setPopulatingMenu:QComboBox:::]):
+        (QComboBox::itemSelected):
+        (-[KWQPopUpButton becomeFirstResponder]):
+        (-[KWQPopUpButton resignFirstResponder]):
+        * kwq/KWQFileButton.h:
+        (KWQFileButton::filename):
+        * kwq/KWQFileButton.mm:
+        (KWQFileButton::KWQFileButton):
+        (KWQFileButton::filenameChanged):
+        (-[KWQFileButtonAdapter filenameChanged:]):
+        (-[KWQFileButtonAdapter focusChanged:]):
+        (-[KWQFileButtonAdapter clicked]):
+        * kwq/KWQLineEdit.h:
+        * kwq/KWQLineEdit.mm:
+        (QLineEdit::QLineEdit):
+        (QLineEdit::setAlignment):
+        (KWQNSTextAlignment):
+        * kwq/KWQListBox.h:
+        (QListBox::changingSelection):
+        * kwq/KWQListBox.mm:
+        (QListBox::QListBox):
+        (-[KWQTableView becomeFirstResponder]):
+        (-[KWQTableView resignFirstResponder]):
+        (-[KWQTableView tableViewSelectionDidChange:]):
+        * kwq/KWQScrollBar.h:
+        (WebCore::):
+        (QScrollBar::orientation):
+        * kwq/KWQScrollBar.mm:
+        (-[KWQScrollBar initWithQScrollBar:]):
+        (QScrollBar::QScrollBar):
+        (QScrollBar::valueChanged):
+        (QScrollBar::scroll):
+        * kwq/KWQSlider.h:
+        * kwq/KWQSlider.mm:
+        (-[KWQSlider mouseDown:]):
+        (-[KWQSlider slide:]):
+        (-[KWQSlider becomeFirstResponder]):
+        (-[KWQSlider resignFirstResponder]):
+        (QSlider::QSlider):
+        (QSlider::sliderValueChanged):
+        (QSlider::dimensions):
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextAreaTextView textViewDidChangeSelection:]):
+        (-[KWQTextAreaTextView textDidChange:]):
+        (-[KWQTextAreaTextView becomeFirstResponder]):
+        (-[KWQTextAreaTextView resignFirstResponder]):
+        (-[KWQTextAreaTextView mouseDown:]):
+        (-[KWQTextAreaTextView dispatchHTMLEvent:]):
+        * kwq/KWQTextEdit.h:
+        * kwq/KWQTextEdit.mm:
+        (QTextEdit::QTextEdit):
+        (QTextEdit::setAlignment):
+        * kwq/KWQTextField.mm:
+        (-[KWQTextFieldController action:]):
+        (-[KWQTextFieldController controlTextDidEndEditing:]):
+        (-[KWQTextFieldController controlTextDidChange:]):
+        (-[KWQTextFieldController textChanged]):
+        (-[KWQTextFieldController textView:didHandleEvent:]):
+        (-[KWQTextFieldController setHasFocus:]):
+        (-[KWQTextFieldController textViewDidChangeSelection:]):
+        * loader/CachedObject.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        (WebCore::Frame::~Frame):
+        (WebCore::Frame::setOpener):
+        (WebCore::Frame::nodeForWidget):
+        (WebCore::Frame::disconnectOwnerRenderer):
+        * page/Frame.h:
+        * page/FramePrivate.h:
+        (WebCore::FramePrivate::FramePrivate):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::~FrameView):
+        * platform/Brush.h:
+        * platform/Pen.h:
+        * platform/Widget.cpp:
+        (WebCore::Widget::isFrameView):
+        * platform/Widget.h:
+        (WebCore::):
+        * platform/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawText):
+        * platform/mac/WidgetMac.mm:
+        (WebCore::Widget::Widget):
+        (WebCore::Widget::focusPolicy):
+        (WebCore::Widget::sendConsumedMouseUp):
+        (WebCore::Widget::setClient):
+        (WebCore::Widget::client):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::operator delete):
+        * rendering/render_applet.cpp:
+        (WebCore::RenderApplet::createWidgetIfNecessary):
+        * rendering/render_form.cpp:
+        (WebCore::RenderFormElement::clicked):
+        (WebCore::RenderFormElement::textAlignment):
+        (WebCore::RenderLineEdit::RenderLineEdit):
+        (WebCore::RenderLineEdit::selectionChanged):
+        (WebCore::RenderLineEdit::returnPressed):
+        (WebCore::RenderLineEdit::performSearch):
+        (WebCore::RenderLineEdit::valueChanged):
+        (WebCore::RenderFileButton::RenderFileButton):
+        (WebCore::RenderFileButton::returnPressed):
+        (WebCore::RenderFileButton::valueChanged):
+        (WebCore::RenderLegend::RenderLegend):
+        (WebCore::RenderSelect::RenderSelect):
+        (WebCore::RenderSelect::updateFromElement):
+        (WebCore::RenderSelect::valueChanged):
+        (WebCore::RenderSelect::selectionChanged):
+        (WebCore::RenderSelect::createListBox):
+        (WebCore::RenderTextArea::RenderTextArea):
+        (WebCore::RenderTextArea::valueChanged):
+        (WebCore::RenderTextArea::selectionChanged):
+        (WebCore::RenderSlider::RenderSlider):
+        (WebCore::RenderSlider::valueChanged):
+        * rendering/render_form.h:
+        (WebCore::RenderFormElement::element):
+        (WebCore::RenderLineEdit::element):
+        (WebCore::RenderFileButton::element):
+        (WebCore::RenderFileButton::isEditable):
+        (WebCore::RenderSelect::element):
+        (WebCore::RenderTextArea::element):
+        (WebCore::RenderSlider::element):
+        * rendering/render_frames.cpp:
+        (WebCore::RenderPart::RenderPart):
+        (WebCore::RenderPart::~RenderPart):
+        (WebCore::RenderPart::setFrame):
+        (WebCore::RenderPart::setWidget):
+        (WebCore::RenderPart::deleteWidget):
+        (WebCore::RenderFrame::RenderFrame):
+        (WebCore::RenderPartObject::RenderPartObject):
+        (WebCore::RenderPartObject::layout):
+        * rendering/render_frames.h:
+        * rendering/render_layer.cpp:
+        (WebCore::RenderLayer::RenderLayer):
+        (WebCore::RenderLayer::~RenderLayer):
+        (WebCore::RenderLayer::valueChanged):
+        (WebCore::RenderLayer::setHasHorizontalScrollbar):
+        (WebCore::RenderLayer::setHasVerticalScrollbar):
+        (WebCore::RenderLayer::hitTest):
+        * rendering/render_layer.h:
+        (WebCore::RenderLayer::parent):
+        (WebCore::RenderLayer::previousSibling):
+        (WebCore::RenderLayer::nextSibling):
+        (WebCore::RenderLayer::firstChild):
+        (WebCore::RenderLayer::lastChild):
+        * rendering/render_list.cpp:
+        (WebCore::RenderListMarker::paint):
+        * rendering/render_replaced.cpp:
+        (WebCore::RenderWidget::RenderWidget):
+        (WebCore::RenderWidget::destroy):
+        (WebCore::RenderWidget::~RenderWidget):
+        (WebCore::RenderWidget::setWidget):
+        (WebCore::RenderWidget::layout):
+        (WebCore::RenderWidget::sendConsumedMouseUp):
+        (WebCore::RenderWidget::focusIn):
+        (WebCore::RenderWidget::focusOut):
+        (WebCore::RenderWidget::scrollToVisible):
+        (WebCore::RenderWidget::isVisible):
+        (WebCore::RenderWidget::element):
+        (WebCore::RenderWidget::deleteWidget):
+        * rendering/render_replaced.h:
+        * xml/xmlhttprequest.cpp:
+        (WebCore::requestsByDocument):
+        (WebCore::addToRequestsByDocument):
+        (WebCore::removeFromRequestsByDocument):
+        (WebCore::XMLHttpRequest::getResponseText):
+        (WebCore::XMLHttpRequest::getResponseXML):
+        (WebCore::XMLHttpRequest::XMLHttpRequest):
+        (WebCore::XMLHttpRequest::~XMLHttpRequest):
+        (WebCore::XMLHttpRequest::callReadyStateChangeListener):
+        (WebCore::XMLHttpRequest::urlMatchesDocumentDomain):
+        (WebCore::XMLHttpRequest::open):
+        (WebCore::XMLHttpRequest::send):
+        (WebCore::XMLHttpRequest::abort):
+        (WebCore::XMLHttpRequest::overrideMIMEType):
+        (WebCore::XMLHttpRequest::setRequestHeader):
+        (WebCore::XMLHttpRequest::getRequestHeader):
+        (WebCore::XMLHttpRequest::getAllResponseHeaders):
+        (WebCore::XMLHttpRequest::getResponseHeader):
+        (WebCore::XMLHttpRequest::getSpecificHeader):
+        (WebCore::XMLHttpRequest::responseIsXML):
+        (WebCore::XMLHttpRequest::getStatus):
+        (WebCore::XMLHttpRequest::getStatusText):
+        (WebCore::XMLHttpRequest::receivedAllData):
+        (WebCore::XMLHttpRequest::receivedRedirect):
+        (WebCore::XMLHttpRequest::receivedData):
+        (WebCore::XMLHttpRequest::cancelRequests):
+        (WebCore::XMLHttpRequest::detachRequests):
+        * xml/xmlhttprequest.h:
+
 2006-03-06  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by beth.
diff --git a/WebCore/ForwardingHeaders/qguardedptr.h b/WebCore/ForwardingHeaders/qguardedptr.h
deleted file mode 100644 (file)
index 53a6255..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "KWQGuardedPtr.h"
diff --git a/WebCore/ForwardingHeaders/qobject.h b/WebCore/ForwardingHeaders/qobject.h
deleted file mode 100644 (file)
index 7751241..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "KWQObject.h"
index 395923a50e472a1cadd941505da39f5a7be85e6e..8486358bf85ccf2833a792b3fecd560a18e65cc9 100644 (file)
                                RelativePath="..\..\kwq\KWQFormData.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQGuardedPtr.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQGuardedPtr.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\kwq\KWQKCookieJar.h"\r
                                >\r
                                RelativePath="..\..\kwq\KWQLoader.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQNamespace.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQObject.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQObject.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\kwq\KWQPageState.h"\r
                                >\r
                                RelativePath="..\..\kwq\KWQScrollBar.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQSignal.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQSignal.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\kwq\KWQSlider.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQSlot.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\kwq\KWQSlot.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\kwq\KWQTextArea.h"\r
                                >\r
                                RelativePath="..\..\platform\Widget.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\platform\WidgetClient.h"\r
+                               >\r
+                       </File>\r
                        <Filter\r
                                Name="win"\r
                                >\r
index 7588471946a3712e9b310200e64e3132c96e2ccb..aa81af6e2f3a7b38958d632029469477539f34b5 100644 (file)
                9385F762098D9C3100D90D24 /* Screen.h in Headers */ = {isa = PBXBuildFile; fileRef = 9385F761098D9C3100D90D24 /* Screen.h */; };
                939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939885C108B7E3D100E707C4 /* EventNames.cpp */; };
                939885C408B7E3D100E707C4 /* EventNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 939885C208B7E3D100E707C4 /* EventNames.h */; };
+               93B780CA09B3B7FE00690162 /* WidgetClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B780C909B3B7FE00690162 /* WidgetClient.h */; };
                93CD4FDE0995F9EA007ECC97 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93CD4FD70995F9EA007ECC97 /* AtomicString.cpp */; };
                93CD4FDF0995F9EA007ECC97 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CD4FD80995F9EA007ECC97 /* AtomicString.h */; };
                93CD4FE00995F9EA007ECC97 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CD4FD90995F9EA007ECC97 /* AtomicStringImpl.h */; };
                93F1992F08245E59001E9ABC /* Cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868402DE3B8601EA4122 /* Cursor.h */; };
                93F1993308245E59001E9ABC /* KWQDef.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784DA02DE375901EA4122 /* KWQDef.h */; };
                93F1993908245E59001E9ABC /* KWQFileButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CCF7D4033BD43C008635CE /* KWQFileButton.h */; };
-               93F1993E08245E59001E9ABC /* KWQGuardedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869002DE3B8601EA4122 /* KWQGuardedPtr.h */; };
                93F1994508245E59001E9ABC /* KWQKCookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784EE02DE375901EA4122 /* KWQKCookieJar.h */; };
                93F1994F08245E59001E9ABC /* KWQKHTMLSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = F587863A02DE3A1401EA4122 /* KWQKHTMLSettings.h */; };
                93F1995008245E59001E9ABC /* KWQKIOGlobal.h in Headers */ = {isa = PBXBuildFile; fileRef = F587864902DE3A9A01EA4122 /* KWQKIOGlobal.h */; };
                93F1996C08245E59001E9ABC /* KWQListBox.h in Headers */ = {isa = PBXBuildFile; fileRef = F587851302DE375901EA4122 /* KWQListBox.h */; };
                93F1996D08245E59001E9ABC /* KWQListImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F587851502DE375901EA4122 /* KWQListImpl.h */; };
                93F1996E08245E59001E9ABC /* KWQLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = F587851702DE375901EA4122 /* KWQLoader.h */; };
-               93F1997508245E59001E9ABC /* KWQNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869E02DE3B8601EA4122 /* KWQNamespace.h */; };
-               93F1997608245E59001E9ABC /* KWQObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869F02DE3B8601EA4122 /* KWQObject.h */; };
                93F1997708245E59001E9ABC /* KWQPageState.h in Headers */ = {isa = PBXBuildFile; fileRef = 9394E0A403AA5BBE008635CE /* KWQPageState.h */; };
                93F1998208245E59001E9ABC /* KWQPtrList.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869902DE3B8601EA4122 /* KWQPtrList.h */; };
                93F1998308245E59001E9ABC /* KWQPtrQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786AD02DE3B8601EA4122 /* KWQPtrQueue.h */; };
                93F1998A08245E59001E9ABC /* KWQRegExp.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786B302DE3B8601EA4122 /* KWQRegExp.h */; };
                93F1998C08245E59001E9ABC /* KWQRenderTreeDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 93955A4103D72932008635CE /* KWQRenderTreeDebug.h */; };
                93F1998D08245E59001E9ABC /* KWQResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 93386B90037045B3008635CE /* KWQResourceLoader.h */; };
-               93F1998F08245E59001E9ABC /* KWQSignal.h in Headers */ = {isa = PBXBuildFile; fileRef = F5117BC902F9FFEF018635CE /* KWQSignal.h */; };
-               93F1999108245E59001E9ABC /* KWQSlot.h in Headers */ = {isa = PBXBuildFile; fileRef = F5117BCB02F9FFEF018635CE /* KWQSlot.h */; };
                93F1999708245E59001E9ABC /* KWQTextArea.h in Headers */ = {isa = PBXBuildFile; fileRef = F587853502DE375901EA4122 /* KWQTextArea.h */; };
                93F1999908245E59001E9ABC /* KWQTextEdit.h in Headers */ = {isa = PBXBuildFile; fileRef = F58786BE02DE3B8601EA4122 /* KWQTextEdit.h */; };
                93F1999A08245E59001E9ABC /* KWQTextField.h in Headers */ = {isa = PBXBuildFile; fileRef = F587851B02DE375901EA4122 /* KWQTextField.h */; };
                93F19A0B08245E59001E9ABC /* westResizeCursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 84C0FA2E052B966D000440A1 /* westResizeCursor.tiff */; };
                93F19A1708245E59001E9ABC /* KWQComboBox.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784D202DE375901EA4122 /* KWQComboBox.mm */; };
                93F19A1808245E59001E9ABC /* KWQCString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F58784D502DE375901EA4122 /* KWQCString.cpp */; };
-               93F19A2208245E59001E9ABC /* KWQGuardedPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F58784E602DE375901EA4122 /* KWQGuardedPtr.cpp */; };
                93F19A2508245E59001E9ABC /* KWQKCookieJar.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784EF02DE375901EA4122 /* KWQKCookieJar.mm */; };
                93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784F002DE375901EA4122 /* CursorMac.mm */; };
                93F19A2E08245E59001E9ABC /* KWQKJavaAppletWidget.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784FF02DE375901EA4122 /* KWQKJavaAppletWidget.mm */; };
                93F19A3B08245E59001E9ABC /* KWQListBox.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587851402DE375901EA4122 /* KWQListBox.mm */; };
                93F19A3C08245E59001E9ABC /* KWQListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587851602DE375901EA4122 /* KWQListImpl.cpp */; };
                93F19A3F08245E59001E9ABC /* KWQTextField.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587851C02DE375901EA4122 /* KWQTextField.mm */; };
-               93F19A4008245E59001E9ABC /* KWQObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587851D02DE375901EA4122 /* KWQObject.cpp */; };
                93F19A4A08245E59001E9ABC /* KWQRegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F587852B02DE375901EA4122 /* KWQRegExp.cpp */; };
                93F19A5108245E59001E9ABC /* KWQTextArea.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587853602DE375901EA4122 /* KWQTextArea.mm */; };
                93F19A5308245E59001E9ABC /* KWQTextEdit.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587853802DE375901EA4122 /* KWQTextEdit.mm */; };
                93F19ABE08245E59001E9ABC /* WebCoreCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A4FD02E2220F018635CB /* WebCoreCache.mm */; };
                93F19ABF08245E59001E9ABC /* WebCoreJavaScript.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A52C02E22573018635CB /* WebCoreJavaScript.mm */; };
                93F19AC208245E59001E9ABC /* WebCoreSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = F565AE8602ECA583018635CA /* WebCoreSettings.mm */; };
-               93F19AC408245E59001E9ABC /* KWQSignal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5117BCA02F9FFEF018635CE /* KWQSignal.cpp */; };
-               93F19AC508245E59001E9ABC /* KWQSlot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5117BCC02F9FFEF018635CE /* KWQSlot.cpp */; };
                93F19AC608245E59001E9ABC /* WebCoreEncodings.mm in Sources */ = {isa = PBXBuildFile; fileRef = F56234E003026D7301629B47 /* WebCoreEncodings.mm */; };
                93F19AC808245E59001E9ABC /* WebCoreHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = F5517DC3031AB56301A80180 /* WebCoreHistory.m */; };
                93F19ACC08245E59001E9ABC /* KWQFileButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93CCF7D5033BD43C008635CE /* KWQFileButton.mm */; };
                93ABCE5E06E1A42E0085925B /* formdata.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = formdata.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93B641F106E28C5C0055F610 /* KWQFormData.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQFormData.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93B641F206E28C5C0055F610 /* KWQFormData.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQFormData.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               93B780C909B3B7FE00690162 /* WidgetClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = WidgetClient.h; path = platform/WidgetClient.h; sourceTree = "<group>"; };
                93CCF7D4033BD43C008635CE /* KWQFileButton.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQFileButton.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93CCF7D5033BD43C008635CE /* KWQFileButton.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQFileButton.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93CD4FD70995F9EA007ECC97 /* AtomicString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicString.cpp; path = platform/AtomicString.cpp; sourceTree = "<group>"; };
                E1F7F55F0981AF570073BE6A /* JSXMLHttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequest.h; sourceTree = "<group>"; };
                ED048ABB0833F132006E1E67 /* textAreaResizeCorner.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = textAreaResizeCorner.tiff; path = Resources/textAreaResizeCorner.tiff; sourceTree = "<group>"; };
                ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarker.h; sourceTree = "<group>"; };
-               F5117BC902F9FFEF018635CE /* KWQSignal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = KWQSignal.h; path = kwq/KWQSignal.h; sourceTree = SOURCE_ROOT; };
-               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; };
                F523D1F402DE4369018635CA /* kjs_binding.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_binding.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D1F502DE4369018635CA /* kjs_binding.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = kjs_binding.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D1F602DE4369018635CA /* kjs_css.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_css.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; };
-               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; };
                F587851702DE375901EA4122 /* KWQLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQLoader.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587851B02DE375901EA4122 /* KWQTextField.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQTextField.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587851C02DE375901EA4122 /* KWQTextField.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQTextField.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587851D02DE375901EA4122 /* KWQObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQObject.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587852B02DE375901EA4122 /* KWQRegExp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQRegExp.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587853502DE375901EA4122 /* KWQTextArea.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQTextArea.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587853602DE375901EA4122 /* KWQTextArea.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQTextArea.mm; 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; };
-               F587869002DE3B8601EA4122 /* KWQGuardedPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQGuardedPtr.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587869802DE3B8601EA4122 /* KWQLineEdit.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQLineEdit.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587869902DE3B8601EA4122 /* KWQPtrList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQPtrList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587869E02DE3B8601EA4122 /* KWQNamespace.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQNamespace.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F587869F02DE3B8601EA4122 /* KWQObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQObject.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58786AC02DE3B8601EA4122 /* KWQPtrList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQPtrList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58786AD02DE3B8601EA4122 /* KWQPtrQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQPtrQueue.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F58786B302DE3B8601EA4122 /* KWQRegExp.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQRegExp.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                935C476A09AC4D4F00A6AAB4 /* WheelEvent.h */,
                                9380F47109A11AB4001FDB34 /* Widget.cpp */,
                                9380F47209A11AB4001FDB34 /* Widget.h */,
+                               93B780C909B3B7FE00690162 /* WidgetClient.h */,
                        );
                        name = platform;
                        sourceTree = "<group>";
                                F58784D202DE375901EA4122 /* KWQComboBox.mm */,
                                F58784D502DE375901EA4122 /* KWQCString.cpp */,
                                F587868302DE3B8601EA4122 /* KWQCString.h */,
-                               F58784E602DE375901EA4122 /* KWQGuardedPtr.cpp */,
-                               F587869002DE3B8601EA4122 /* KWQGuardedPtr.h */,
                                F587869802DE3B8601EA4122 /* KWQLineEdit.h */,
                                F587851202DE375901EA4122 /* KWQLineEdit.mm */,
                                F587851302DE375901EA4122 /* KWQListBox.h */,
                                F587851402DE375901EA4122 /* KWQListBox.mm */,
                                F587851602DE375901EA4122 /* KWQListImpl.cpp */,
                                F587851502DE375901EA4122 /* KWQListImpl.h */,
-                               F587869E02DE3B8601EA4122 /* KWQNamespace.h */,
-                               F587851D02DE375901EA4122 /* KWQObject.cpp */,
-                               F587869F02DE3B8601EA4122 /* KWQObject.h */,
                                F587869902DE3B8601EA4122 /* KWQPtrList.h */,
                                F58786AD02DE3B8601EA4122 /* KWQPtrQueue.h */,
                                F587852B02DE375901EA4122 /* KWQRegExp.cpp */,
                                F58786B302DE3B8601EA4122 /* KWQRegExp.h */,
-                               F5117BCA02F9FFEF018635CE /* KWQSignal.cpp */,
-                               F5117BC902F9FFEF018635CE /* KWQSignal.h */,
                                BC86FB8D061F5C23006BB822 /* KWQSlider.h */,
                                BC86FB8E061F5C23006BB822 /* KWQSlider.mm */,
-                               F5117BCC02F9FFEF018635CE /* KWQSlot.cpp */,
-                               F5117BCB02F9FFEF018635CE /* KWQSlot.h */,
                                F58786BE02DE3B8601EA4122 /* KWQTextEdit.h */,
                                F587853802DE375901EA4122 /* KWQTextEdit.mm */,
                                F587853902DE375901EA4122 /* KWQTextStream.cpp */,
                                93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
                                93F1993308245E59001E9ABC /* KWQDef.h in Headers */,
                                93F1993908245E59001E9ABC /* KWQFileButton.h in Headers */,
-                               93F1993E08245E59001E9ABC /* KWQGuardedPtr.h in Headers */,
                                93F1994508245E59001E9ABC /* KWQKCookieJar.h in Headers */,
                                93F1994F08245E59001E9ABC /* KWQKHTMLSettings.h in Headers */,
                                93F1995008245E59001E9ABC /* KWQKIOGlobal.h in Headers */,
                                93F1996C08245E59001E9ABC /* KWQListBox.h in Headers */,
                                93F1996D08245E59001E9ABC /* KWQListImpl.h in Headers */,
                                93F1996E08245E59001E9ABC /* KWQLoader.h in Headers */,
-                               93F1997508245E59001E9ABC /* KWQNamespace.h in Headers */,
-                               93F1997608245E59001E9ABC /* KWQObject.h in Headers */,
                                93F1997708245E59001E9ABC /* KWQPageState.h in Headers */,
                                93F1998208245E59001E9ABC /* KWQPtrList.h in Headers */,
                                93F1998308245E59001E9ABC /* KWQPtrQueue.h in Headers */,
                                93F1998A08245E59001E9ABC /* KWQRegExp.h in Headers */,
                                93F1998C08245E59001E9ABC /* KWQRenderTreeDebug.h in Headers */,
                                93F1998D08245E59001E9ABC /* KWQResourceLoader.h in Headers */,
-                               93F1998F08245E59001E9ABC /* KWQSignal.h in Headers */,
-                               93F1999108245E59001E9ABC /* KWQSlot.h in Headers */,
                                93F1999708245E59001E9ABC /* KWQTextArea.h in Headers */,
                                93F1999908245E59001E9ABC /* KWQTextEdit.h in Headers */,
                                93F1999A08245E59001E9ABC /* KWQTextField.h in Headers */,
                                BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
                                65F537D909B2B20F00F3DC4A /* CharsetNames.h in Headers */,
                                65F5386909B2BFDA00F3DC4A /* ExtraCFEncodings.h in Headers */,
+                               93B780CA09B3B7FE00690162 /* WidgetClient.h in Headers */,
                                A82398A609B3ACDB00B60641 /* PlugInInfoStore.h in Headers */,
                                A8239E0109B3CF8A00B60641 /* Logging.h in Headers */,
                                BCEB377609B7BB0D00CB38B1 /* FontRenderer.h in Headers */,
                        files = (
                                93F19A1708245E59001E9ABC /* KWQComboBox.mm in Sources */,
                                93F19A1808245E59001E9ABC /* KWQCString.cpp in Sources */,
-                               93F19A2208245E59001E9ABC /* KWQGuardedPtr.cpp in Sources */,
                                93F19A2508245E59001E9ABC /* KWQKCookieJar.mm in Sources */,
                                93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */,
                                93F19A2E08245E59001E9ABC /* KWQKJavaAppletWidget.mm in Sources */,
                                93F19A3B08245E59001E9ABC /* KWQListBox.mm in Sources */,
                                93F19A3C08245E59001E9ABC /* KWQListImpl.cpp in Sources */,
                                93F19A3F08245E59001E9ABC /* KWQTextField.mm in Sources */,
-                               93F19A4008245E59001E9ABC /* KWQObject.cpp in Sources */,
                                93F19A4A08245E59001E9ABC /* KWQRegExp.cpp in Sources */,
                                93F19A5108245E59001E9ABC /* KWQTextArea.mm in Sources */,
                                93F19A5308245E59001E9ABC /* KWQTextEdit.mm in Sources */,
                                93F19ABE08245E59001E9ABC /* WebCoreCache.mm in Sources */,
                                93F19ABF08245E59001E9ABC /* WebCoreJavaScript.mm in Sources */,
                                93F19AC208245E59001E9ABC /* WebCoreSettings.mm in Sources */,
-                               93F19AC408245E59001E9ABC /* KWQSignal.cpp in Sources */,
-                               93F19AC508245E59001E9ABC /* KWQSlot.cpp in Sources */,
                                93F19AC608245E59001E9ABC /* WebCoreEncodings.mm in Sources */,
                                93F19AC808245E59001E9ABC /* WebCoreHistory.m in Sources */,
                                93F19ACC08245E59001E9ABC /* KWQFileButton.mm in Sources */,
index 6895212c2d5117f1ddcac296f7d9d874c75b6e8b..c3d5b197fd64d49c666ee51cdbfb59ca9254784e 100644 (file)
@@ -1,6 +1,6 @@
 #include "config.h"
 
-// These are generated files.
+// The files named below are generated by a script.
 
 #include "JSAttr.cpp"
 #include "JSCharacterData.cpp"
index 616214d80bfe5dfdbb8bbe5033f6f58c7c901c88..806d54ea541d17c525f80b0385cbadea7fb43cc6 100644 (file)
@@ -1,6 +1,6 @@
 #include "config.h"
 
-// These are generated files.
+// The files named below are generated by a script.
 
 #include "JSMutationEvent.cpp"
 #include "JSWheelEvent.cpp"
index 2950b2cbf251f299ec9542d729a795541fbe9e51..a354a4ec29f14657e3ec6b7da754f11cc337ca4f 100644 (file)
@@ -29,7 +29,6 @@
 #include "PlatformString.h"
 #include "formdata.h"
 #include <kxmlcore/HashMap.h>
-#include <qobject.h>
 
 class KURL;
 
@@ -88,8 +87,10 @@ struct WindowArgs {
     bool dialog;
 };
 
-class BrowserExtension : public QObject {
+class BrowserExtension {
 public:
+    virtual ~BrowserExtension() { }
+
     virtual void openURLRequest(const KURL &, const URLArgs &args = URLArgs()) = 0;
     virtual void openURLNotify() = 0;
     
index 098345801aa25e3c54288b194feea440f771ec31..fe6fe0ad68b2cddf541738ef71ab4a1387559e8b 100644 (file)
@@ -1152,11 +1152,9 @@ static BOOL nowPrinting(WebCoreFrameBridge *self)
     // FIXME: implemented currently for only a subset of the KWQ widgets
     if ([view conformsToProtocol:@protocol(KWQWidgetHolder)]) {
         NSView <KWQWidgetHolder> *widgetHolder = view;
-        Widget *widget = [widgetHolder widget];
-        if (widget != nil && widget->eventFilterObject() != nil) {
-            NodeImpl *node = static_cast<const RenderWidget *>(widget->eventFilterObject())->element();
-            return [DOMElement _elementWithImpl:static_cast<ElementImpl *>(node)];
-        }
+        Widget* widget = [widgetHolder widget];
+        if (widget && widget->client())
+            return [DOMElement _elementWithImpl:widget->client()->element(widget)];
     }
     return nil;
 }
index c204fd11c417f6604aa5f577d09afdd9d60f6096..a52950651463b8a3fa87ee91c41e997dce5bb2f7 100644 (file)
@@ -52,8 +52,8 @@ NodeImpl::NodeType CDATASectionImpl::nodeType() const
 
 PassRefPtr<NodeImpl> CDATASectionImpl::cloneNode(bool /*deep*/)
 {
-    int ignoreException = 0;
-    return getDocument()->createCDATASection(str, ignoreException);
+    ExceptionCode ec = 0;
+    return getDocument()->createCDATASection(str, ec);
 }
 
 // DOM Section 1.1.1
index 4c9aef74cb8c4ef95c83f263c18410c535474f22..0ac50a92217fcd75ce6abae37c65d20c2d0392a2 100644 (file)
@@ -74,6 +74,7 @@
 #include "render_frames.h"
 #include "visible_text.h"
 #include "xml_tokenizer.h"
+#include "xmlhttprequest.h"
 #include <qregexp.h>
 
 #ifdef KHTML_XSLT
@@ -305,6 +306,7 @@ DocumentImpl::~DocumentImpl()
     delete m_svgExtensions;
 #endif
 
+    XMLHttpRequest::detachRequests(this);
     KJS::ScriptInterpreter::forgetAllDOMNodesForDocument(this);
 
     if (m_docChanged && changedDocuments)
index 0ccb52499ffbab982083f26f1bd53b0f96e99cbd..e92f3e20af8d023e627cacc34f9b163f622abf09 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "Color.h"
 #include "DocumentMarker.h"
-#include "KWQSignal.h"
 #include "Shared.h"
 #include "Timer.h"
 #include "decoder.h"
@@ -37,7 +36,6 @@
 #include <KURL.h>
 #include <kxmlcore/HashCountedSet.h>
 #include <kxmlcore/HashMap.h>
-#include <qobject.h>
 #include <qptrlist.h>
 #include <QStringList.h>
 
@@ -100,7 +98,7 @@ namespace WebCore {
     class SVGDocumentExtensions;
 #endif
 
-class DocumentImpl : public QObject, public ContainerNodeImpl
+class DocumentImpl : public ContainerNodeImpl
 {
 public:
     DocumentImpl(DOMImplementationImpl*, FrameView*);
index 3d60b4557800a2520e3bd35ba5298e1cece0a69a..0232fd871d254b116a3fcf5b07a42a97a9f34858 100644 (file)
@@ -25,7 +25,6 @@
 #if SVG_SUPPORT
 
 #include "Color.h"
-#include <qobject.h>
 #include <kxmlcore/Vector.h>
 
 #include <kcanvas/KCanvasFilters.h>
@@ -51,12 +50,10 @@ public:
     virtual void addPath(const KCanvasPath*) = 0;
 };
 
-// Must be a QObject to be able to be loaded by KLibLoader...
 class KCanvasImage;
 class KCanvasFilterEffect;
-class KRenderingDevice : public QObject
+class KRenderingDevice
 {
-Q_OBJECT
 public:
     KRenderingDevice();
     virtual ~KRenderingDevice();
index e1382acd496b9d250afb76cb842a105927a94d92..ca8aa3ce7e64c3a28dc61b6436ee91a11a177162 100644 (file)
@@ -207,8 +207,8 @@ void DOMCSSStyleDeclaration::put(ExecState *exec, const Identifier &propertyName
         //   3) At least some Dashboard widgets are depending on this behavior.
         // It would be nice to fix this some day, perhaps with some kind of "quirks mode",
         // but it's likely that the Dashboard widgets are already using a strict mode DOCTYPE.
-        int ignoreException = 0;
-        styleDecl.setProperty(prop, propvalue, "", ignoreException);
+        ExceptionCode ec = 0;
+        styleDecl.setProperty(prop, propvalue, "", ec);
       }
     } else {
       DOMObject::put(exec, propertyName, value, attr);
index d8f26b90c1d61e4d9c8701831716ce72d720bca8..5e7065691d595f1028bef4089cdcf83747ad8e6f 100644 (file)
@@ -2045,8 +2045,8 @@ JSValue *FrameArray::indexGetter(ExecState *exec, JSObject *originalObject, cons
   FrameArray *thisObj = static_cast<FrameArray *>(slot.slotBase());
   Frame* frame = thisObj->m_frame->frames().at(slot.index());
 
-  if (frame && frame->isFrame())
-    return Window::retrieve(static_cast<Frame*>(frame));
+  if (frame)
+    return Window::retrieve(frame);
 
   return jsUndefined();
 }
@@ -2056,8 +2056,8 @@ JSValue *FrameArray::nameGetter(ExecState *exec, JSObject *originalObject, const
   FrameArray *thisObj = static_cast<FrameArray *>(slot.slotBase());
   Frame* frame = thisObj->m_frame->findFrame(propertyName.qstring());
 
-  if (frame && frame->isFrame())
-    return Window::retrieve(static_cast<Frame*>(frame));
+  if (frame)
+    return Window::retrieve(frame);
 
   return jsUndefined();
 }
index 246f9fa852bb60743737e888374d5bd9b61c0722..40be21d288a0d9ff21709d2ad3cdbd19dbbe26a0 100644 (file)
@@ -130,7 +130,7 @@ void HTMLDocumentImpl::setBody(HTMLElementImpl *_body, ExceptionCode& ec)
 
 Tokenizer *HTMLDocumentImpl::createTokenizer()
 {
-    return new HTMLTokenizer(this, m_view);
+    return new HTMLTokenizer(this);
 }
 
 // --------------------------------------------------------------------------
index 4a6939329cb284513b314983707685cd36086f6d..8be920a91ecfb3e7325b8648258fe05f71aa5d08 100644 (file)
@@ -108,27 +108,25 @@ public:
  *    element or ignore the tag.
  *
  */
-HTMLParser::HTMLParser(FrameView *_parent, DocumentImpl *doc, bool includesComments) 
-    : current(0), currentIsReferenced(false), includesCommentsInDOM(includesComments)
+HTMLParser::HTMLParser(DocumentImpl* doc) 
+    : document(doc)
+    , current(0)
+    , currentIsReferenced(false)
+    , blockStack(0)
+    , m_fragment(false)
 {
-    HTMLWidget    = _parent;
-    document      = doc;
-
-    blockStack = 0;
-
     reset();
 }
 
-HTMLParser::HTMLParser(DocumentFragmentImpl *i, DocumentImpl *doc, bool includesComments)
-    : current(0), currentIsReferenced(false), includesCommentsInDOM(includesComments)
+HTMLParser::HTMLParser(DocumentFragmentImpl* frag)
+    : document(frag->getDocument())
+    , current(0)
+    , currentIsReferenced(false)
+    , blockStack(0)
+    , m_fragment(true)
 {
-    HTMLWidget = 0;
-    document = doc;
-
-    blockStack = 0;
-
     reset();
-    setCurrent(i);
+    setCurrent(frag);
     inBody = true;
 }
 
@@ -274,10 +272,10 @@ bool HTMLParser::insertNode(NodeImpl *n, bool flat)
                 popBlock(localName);
             else
                 setCurrent(newNode);
-            if (parentAttached && !n->attached() && HTMLWidget)
+            if (parentAttached && !n->attached() && !m_fragment)
                 n->attach();
         } else {
-            if (parentAttached && !n->attached() && HTMLWidget)
+            if (parentAttached && !n->attached() && !m_fragment)
                 n->attach();
             if (n->maintainsState()) {
                 doc()->registerMaintainsState(n);
@@ -320,7 +318,7 @@ bool HTMLParser::handleError(NodeImpl* n, bool flat, const AtomicString& localNa
                 createHead();
             if (head) {
                 if (head->addChild(n)) {
-                    if (!n->attached() && HTMLWidget)
+                    if (!n->attached() && !m_fragment)
                         n->attach();
                     return true;
                 } else
@@ -350,7 +348,7 @@ bool HTMLParser::handleError(NodeImpl* n, bool flat, const AtomicString& localNa
                 if (newNode) {
                     pushBlock(localName, tagPriority);
                     setCurrent(newNode);
-                    if (!n->attached() && HTMLWidget)
+                    if (!n->attached() && !m_fragment)
                         n->attach();
                 } else {
                     setSkipMode(styleTag);
@@ -381,7 +379,7 @@ bool HTMLParser::handleError(NodeImpl* n, bool flat, const AtomicString& localNa
         } else if (h->hasLocalName(inputTag)) {
             if (equalIgnoringCase(h->getAttribute(typeAttr), "hidden") && form) {
                 form->addChild(n);
-                if (!n->attached() && HTMLWidget)
+                if (!n->attached() && !m_fragment)
                     n->attach();
                 return true;
             }
@@ -394,7 +392,7 @@ bool HTMLParser::handleError(NodeImpl* n, bool flat, const AtomicString& localNa
         } else if (h->hasLocalName(areaTag)) {
             if (map) {
                 map->addChild(n);
-                if (!n->attached() && HTMLWidget)
+                if (!n->attached() && !m_fragment)
                     n->attach();
                 handled = true;
                 return true;
@@ -602,8 +600,7 @@ bool HTMLParser::textCreateErrorCheck(Token* t, RefPtr<NodeImpl>& result)
 
 bool HTMLParser::commentCreateErrorCheck(Token* t, RefPtr<NodeImpl>& result)
 {
-    if (includesCommentsInDOM)
-        result = new CommentImpl(document, t->text.get());
+    result = new CommentImpl(document, t->text.get());
     return false;
 }
 
@@ -736,7 +733,7 @@ bool HTMLParser::noframesCreateErrorCheck(Token* t, RefPtr<NodeImpl>& result)
 
 bool HTMLParser::noscriptCreateErrorCheck(Token* t, RefPtr<NodeImpl>& result)
 {
-    if (HTMLWidget && HTMLWidget->frame()->jScriptEnabled())
+    if (!m_fragment && document->frame()->jScriptEnabled())
         setSkipMode(noscriptTag);
     return true;
 }
@@ -885,7 +882,7 @@ bool HTMLParser::isInline(NodeImpl* node) const
             e->hasLocalName(abbrTag) || e->hasLocalName(acronymTag) || e->hasLocalName(subTag) ||
             e->hasLocalName(supTag) || e->hasLocalName(spanTag) || e->hasLocalName(nobrTag) ||
             e->hasLocalName(wbrTag) || e->hasLocalName(noframesTag) || e->hasLocalName(nolayerTag) ||
-            e->hasLocalName(noembedTag) || (e->hasLocalName(noscriptTag) && HTMLWidget && HTMLWidget->frame()->jScriptEnabled()))
+            e->hasLocalName(noembedTag) || (e->hasLocalName(noscriptTag) && !m_fragment && document->frame()->jScriptEnabled()))
             return true;
     }
     
@@ -1346,7 +1343,7 @@ void HTMLParser::finished()
     setCurrent(0);
 
     // Warning, this may delete the tokenizer and parser, so don't try to do anything else after this.
-    if (HTMLWidget)
+    if (!m_fragment)
         document->finishedParsing();
 }
 
index 1572c52501cbaa23df2c5da704b279f3679bcc17..540ff053c3afecbb306861d8ed472cc1919a80db 100644 (file)
@@ -49,8 +49,8 @@ class Token;
 class HTMLParser
 {
 public:
-    HTMLParser(FrameView *w, DocumentImpl *i, bool includesComments=false);
-    HTMLParser(DocumentFragmentImpl *frag, DocumentImpl *doc, bool includesComments=false);
+    HTMLParser(DocumentImpl*);
+    HTMLParser(DocumentFragmentImpl*);
     virtual ~HTMLParser();
 
     /**
@@ -74,12 +74,11 @@ public:
 
     HTMLDocumentImpl *doc() const { return static_cast<HTMLDocumentImpl *>(document); }
 
-protected:
+private:
     void setCurrent(NodeImpl* newCurrent);
     void setSkipMode(const QualifiedName& qName) { discard_until = qName.localName(); }
 
-    FrameView *HTMLWidget;
-    DocumentImpl *document;
+    DocumentImpl* document;
 
     /*
      * generate a node from the token
@@ -179,9 +178,8 @@ protected:
     AtomicString discard_until;
 
     bool headLoaded;
+    bool m_fragment;
     int inStrayTableContent;
-
-    bool includesCommentsInDOM;
 };
 
 }
index aaae1ed73abae2ca9c2477de27c4a3a5d1551097..0e07c49673ed3984b35d0a1822daf070a36c7636 100644 (file)
@@ -129,31 +129,35 @@ void Token::addAttribute(DocumentImpl* doc, const AtomicString& attrName, const
 
 // ----------------------------------------------------------------------------
 
-HTMLTokenizer::HTMLTokenizer(DocumentImpl* _doc, FrameView* _view, bool includesComments)
-    : m_timer(this, &HTMLTokenizer::timerFired), inWrite(false)
+HTMLTokenizer::HTMLTokenizer(DocumentImpl* doc)
+    : buffer(0)
+    , scriptCode(0)
+    , scriptCodeSize(0)
+    , scriptCodeMaxSize(0)
+    , scriptCodeResync(0)
+    , m_executingScript(0)
+    , m_timer(this, &HTMLTokenizer::timerFired)
+    , m_doc(doc)
+    , inWrite(false)
+    , m_fragment(false)
 {
-    view = _view;
-    buffer = 0;
-    scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
-    parser = new HTMLParser(_view, _doc, includesComments);
-    m_executingScript = 0;
-    includesCommentsInDOM = includesComments;
-    
+    parser = new HTMLParser(doc);
     begin();
 }
 
-HTMLTokenizer::HTMLTokenizer(DocumentImpl *_doc, DocumentFragmentImpl *i, bool includesComments)
-    : m_timer(this, &HTMLTokenizer::timerFired), inWrite(false)
+HTMLTokenizer::HTMLTokenizer(DocumentFragmentImpl* frag)
+    : buffer(0)
+    , scriptCode(0)
+    , scriptCodeSize(0)
+    , scriptCodeMaxSize(0)
+    , scriptCodeResync(0)
+    , m_executingScript(0)
+    , m_timer(this, &HTMLTokenizer::timerFired)
+    , m_doc(frag->getDocument())
+    , inWrite(false)
+    , m_fragment(true)
 {
-    view = 0;
-    buffer = 0;
-    scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
-    parser = new HTMLParser(i, _doc, includesComments);
-    m_executingScript = 0;
-    includesCommentsInDOM = includesComments;
-
+    parser = new HTMLParser(frag);
     begin();
 }
 
@@ -399,7 +403,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
             if (!pendingScripts.isEmpty())
                 state.setLoadingExtScript(true);
         }
-        else if (view && doScriptExec && javascript ) {
+        else if (!m_fragment && doScriptExec && javascript ) {
             if (!m_executingScript)
                 pendingSrc.prepend(src);
             else
@@ -442,19 +446,14 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
     return state;
 }
 
-HTMLTokenizer::State HTMLTokenizer::scriptExecution(const QString& str, State state, 
-                                                    QString scriptURL, int baseLine)
+HTMLTokenizer::State HTMLTokenizer::scriptExecution(const QString& str, State state, QString scriptURL, int baseLine)
 {
-    if (!view || !view->frame())
+    if (m_fragment || !m_doc->frame())
         return state;
     bool oldscript = state.inScript();
     m_executingScript++;
     state.setInScript(false);
-    QString url;    
-    if (scriptURL.isNull())
-      url = view->frame()->document()->URL();
-    else
-      url = scriptURL;
+    QString url = scriptURL.isNull() ? m_doc->frame()->document()->URL() : scriptURL;
 
     SegmentedString *savedPrependingSrc = currentPrependingSrc;
     SegmentedString prependingSrc;
@@ -466,7 +465,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptExecution(const QString& str, State st
 #endif
 
     m_state = state;
-    view->frame()->executeScript(url,baseLine,0,str);
+    m_doc->frame()->executeScript(url,baseLine,0,str);
     state = m_state;
 
     state.setAllowYield(true);
@@ -552,18 +551,18 @@ HTMLTokenizer::State HTMLTokenizer::parseComment(SegmentedString &src, State sta
             if (canClose || handleBrokenComments || endCharsCount > 1) {
                 ++src;
                 if (!(state.inScript() || state.inXmp() || state.inTextArea() || state.inStyle())) {
-                    if (includesCommentsInDOM) {
-                        checkScriptBuffer();
-                        scriptCode[ scriptCodeSize ] = 0;
-                        scriptCode[ scriptCodeSize + 1 ] = 0;
-                        currToken.tagName = commentAtom;
-                        currToken.beginTag = true;
-                        state = processListing(SegmentedString(scriptCode, scriptCodeSize - endCharsCount), state);
-                        processToken();
-                        currToken.tagName = commentAtom;
-                        currToken.beginTag = false;
-                        processToken();
-                    }
+#ifdef INCLUDE_COMMENTS_IN_DOM // FIXME: Turn this on soon.
+                    checkScriptBuffer();
+                    scriptCode[scriptCodeSize] = 0;
+                    scriptCode[scriptCodeSize + 1] = 0;
+                    currToken.tagName = commentAtom;
+                    currToken.beginTag = true;
+                    state = processListing(SegmentedString(scriptCode, scriptCodeSize - endCharsCount), state);
+                    processToken();
+                    currToken.tagName = commentAtom;
+                    currToken.beginTag = false;
+                    processToken();
+#endif
                     scriptCodeSize = 0;
                 }
                 state.setInComment(false);
@@ -1168,7 +1167,7 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString &src, State state)
                 if ( currToken.attrs && /* potentially have a ATTR_SRC ? */
                      parser->doc()->frame() &&
                      parser->doc()->frame()->jScriptEnabled() && /* jscript allowed at all? */
-                     view /* are we a regular tokenizer or just for innerHTML ? */
+                     !m_fragment /* are we a regular tokenizer or just for innerHTML ? */
                     ) {
                     if ((a = currToken.attrs->getAttributeItem(srcAttr)))
                         scriptSrc = parser->doc()->completeURL(parseURL(a->value()).qstring());
@@ -1498,8 +1497,8 @@ void HTMLTokenizer::stopParsing()
 
     // The part needs to know that the tokenizer has finished with its data,
     // regardless of whether it happened naturally or due to manual intervention.
-    if (view && view->frame())
-        view->frame()->tokenizerProcessedData();
+    if (!m_fragment && m_doc->frame())
+        m_doc->frame()->tokenizerProcessedData();
 }
 
 bool HTMLTokenizer::processingData() const
@@ -1521,7 +1520,7 @@ void HTMLTokenizer::timerFired(Timer<HTMLTokenizer>*)
         return;
     }
     
-    RefPtr<Frame> frame = view ? view->frame() : 0;
+    RefPtr<Frame> frame = m_fragment ? 0 : m_doc->frame();
 
     // Invoke write() as though more data came in.
     bool didCallEnd = write(SegmentedString(), true);
@@ -1593,11 +1592,10 @@ void HTMLTokenizer::finish()
 
 PassRefPtr<NodeImpl> HTMLTokenizer::processToken()
 {
-    KJSProxyImpl *jsProxy = (view && view->frame()) ? view->frame()->jScript() : 0L;    
+    KJSProxyImpl* jsProxy = (!m_fragment && m_doc->frame()) ? m_doc->frame()->jScript() : 0;
     if (jsProxy)
         jsProxy->setEventHandlerLineno(tagStartLineno);
-    if ( dest > buffer )
-    {
+    if (dest > buffer) {
 #ifdef TOKEN_DEBUG
         if(currToken.tagName.length()) {
             qDebug( "unexpected token: %s, str: *%s*", currToken.tagName.qstring().latin1(),QConstString( buffer,dest-buffer ).qstring().latin1() );
@@ -1608,8 +1606,7 @@ PassRefPtr<NodeImpl> HTMLTokenizer::processToken()
         currToken.text = new DOMStringImpl( buffer, dest - buffer );
         if (currToken.tagName != commentAtom)
             currToken.tagName = textAtom;
-    }
-    else if (currToken.tagName == nullAtom) {
+    } else if (currToken.tagName == nullAtom) {
         currToken.reset();
         if (jsProxy)
             jsProxy->setEventHandlerLineno(lineno+src.lineCount());
@@ -1759,7 +1756,7 @@ void HTMLTokenizer::setSrc(const SegmentedString &source)
 
 void parseHTMLDocumentFragment(const DOMString &source, DocumentFragmentImpl *fragment)
 {
-    HTMLTokenizer tok(fragment->getDocument(), fragment);
+    HTMLTokenizer tok(fragment);
     tok.setForceSynchronous(true);
     tok.write(source.qstring(), true);
     tok.finish();
index 9416403d04802f4b7dc6ea957bc7edf995344837..93ee98fbf544ed11079c6f4c81478de15e06025a 100644 (file)
@@ -27,7 +27,6 @@
 #define HTMLTOKENIZER_H
 
 #include "CachedObjectClient.h"
-#include "KWQGuardedPtr.h"
 #include "SegmentedString.h"
 #include "Timer.h"
 #include "QualifiedName.h"
@@ -86,8 +85,8 @@ public:
 class HTMLTokenizer : public Tokenizer, public CachedObjectClient
 {
 public:
-    HTMLTokenizer(DocumentImpl*, FrameView* = 0, bool includesComments = false);
-    HTMLTokenizer(DocumentImpl*, DocumentFragmentImpl*, bool includesComments = false);
+    HTMLTokenizer(DocumentImpl*);
+    HTMLTokenizer(DocumentFragmentImpl*);
     virtual ~HTMLTokenizer();
 
     virtual bool write(const SegmentedString &str, bool appendData);
@@ -330,8 +329,6 @@ private:
     // The timer for continued processing.
     Timer<HTMLTokenizer> m_timer;
 
-    bool includesCommentsInDOM;
-
 // This buffer can hold arbitrarily long user-defined attribute names, such as in EMBED tags.
 // So any fixed number might be too small, but rather than rewriting all usage of this buffer
 // we'll just make it large enough to handle all imaginable cases.
@@ -340,9 +337,10 @@ private:
     unsigned int m_cBufferPos;
     
     SegmentedString src;
+    DocumentImpl* m_doc;
     HTMLParser* parser;
-    QGuardedPtr<FrameView> view;    
     bool inWrite;
+    bool m_fragment;
 };
 
 void parseHTMLDocumentFragment(const String&, DocumentFragmentImpl*);
index 6e812332761ff3b919b6cd8ace305010bbe00e1f..bf05be2e73bc5d3bb5f27bf868b58f973b15ccb6 100644 (file)
@@ -80,8 +80,6 @@ private:
     mutable bool _menuPopulated;
 
     mutable NSFont *_labelFont;
-
-    KWQSignal _activated;
 };
 
 #endif
index 4c646ab413cac6db3adc7de8c84bbbd4c6bf3903..1e141def94accea3111ea0053709a27e91602232 100644 (file)
@@ -78,7 +78,6 @@ QComboBox::QComboBox()
     , _currentItem(0)
     , _menuPopulated(true)
     , _labelFont(nil)
-    , _activated(this, SIGNAL(activated(int)))
 {
     KWQ_BLOCK_EXCEPTIONS;
 
@@ -283,7 +282,8 @@ void QComboBox::itemSelected()
 
     KWQ_UNBLOCK_EXCEPTIONS;
 
-    _activated.call(_currentItem);
+    if (client())
+        client()->valueChanged(this);
 }
 
 void QComboBox::setFont(const Font& f)
@@ -487,17 +487,11 @@ void QComboBox::populate()
 {
     BOOL become = [super becomeFirstResponder];
     if (become) {
-        Widget *widget = [self widget];
-        if (widget) {
-            if (!MacFrame::currentEventIsMouseDownInWidget(widget)) {
-                RenderWidget *w = const_cast<RenderWidget *> (static_cast<const RenderWidget *>(widget->eventFilterObject()));
-                RenderLayer *layer = w->enclosingLayer();
-                if (layer)
-                    layer->scrollRectToVisible(w->absoluteBoundingBoxRect());
-            }
-            if (widget->eventFilterObject())
-                widget->eventFilterObject()->eventFilterFocusIn();
-        }
+        Widget* widget = [self widget];
+        if (widget && widget->client() && !MacFrame::currentEventIsMouseDownInWidget(widget))
+            widget->client()->scrollToVisible(widget);
+        if (widget && widget->client())
+            widget->client()->focusIn(widget);
     }
     return become;
 }
@@ -506,9 +500,9 @@ void QComboBox::populate()
 {
     BOOL resign = [super resignFirstResponder];
     if (resign) {
-        Widget *widget = [self widget];
-        if (widget && widget->eventFilterObject()) {
-            widget->eventFilterObject()->eventFilterFocusOut();
+        Widgetwidget = [self widget];
+        if (widget && widget->client()) {
+            widget->client()->focusOut(widget);
             if (widget)
                 [MacFrame::bridgeForWidget(widget) formControlIsResigningFirstResponder:self];
         }
index 55d9a998d235f246ae49ba507591ad10dae7216e..0fe1a3e5a1f893806ea33925febb7ddeb7477e79 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef KWQFILEBUTTON_H
 #define KWQFILEBUTTON_H
 
+#include "PlatformString.h"
 #include "Widget.h"
 
 #ifdef __OBJC__
@@ -54,13 +55,12 @@ public:
     virtual FocusPolicy focusPolicy() const;
     
     void filenameChanged(const QString &);
-    void focusChanged(bool);
-    void clicked();
+
+    const WebCore::String& filename() const { return m_name; }
 
 private:
-    KWQSignal _clicked;
-    KWQSignal _textChanged;
-    KWQFileButtonAdapter *_adapter;
+    KWQFileButtonAdapter* _adapter;
+    WebCore::String m_name;
 };
 
 #endif
index 713acce67f068ee4b3f9303b2a5d83f578253d87..9f438a89ae0978f19f54f408637723701966e2d8 100644 (file)
@@ -50,9 +50,7 @@ using namespace WebCore;
 @end
 
 KWQFileButton::KWQFileButton(Frame *frame)
-    : _clicked(this, SIGNAL(clicked()))
-    , _textChanged(this, SIGNAL(textChanged(const QString &)))
-    , _adapter(0)
+    : _adapter(0)
 {
     KWQ_BLOCK_EXCEPTIONS;
 
@@ -145,32 +143,13 @@ Widget::FocusPolicy KWQFileButton::focusPolicy() const
     return Widget::focusPolicy();
 }
 
-void KWQFileButton::filenameChanged(const QString &filename)
+void KWQFileButton::filenameChanged(const QStringfilename)
 {
-    _textChanged.call(filename);
+    m_name = filename;
+    if (client())
+        client()->valueChanged(this);
 }
 
-void KWQFileButton::focusChanged(bool nowHasFocus)
-{
-    if (nowHasFocus) {
-        if (!MacFrame::currentEventIsMouseDownInWidget(this)) {
-            RenderWidget *widget = const_cast<RenderWidget *> (static_cast<const RenderWidget *>(eventFilterObject()));
-            RenderLayer *layer = widget->enclosingLayer();
-            layer = layer->renderer()->enclosingLayer();
-            if (layer)
-                layer->scrollRectToVisible(widget->absoluteBoundingBoxRect());
-        }        
-        eventFilterObject()->eventFilterFocusIn();
-    } else
-        eventFilterObject()->eventFilterFocusOut();
-}
-
-void KWQFileButton::clicked()
-{
-    _clicked.call();
-}
-
-
 @implementation KWQFileButtonAdapter
 
 - initWithKWQFileButton:(KWQFileButton *)b
@@ -182,24 +161,29 @@ void KWQFileButton::clicked()
 
 - (void)filenameChanged:(NSString *)filename
 {
-    if (button) {
+    if (button)
         button->filenameChanged(QString::fromNSString(filename));
-    }
 }
 
 - (void)focusChanged:(BOOL)nowHasFocus
 {
-    if (button) {
-        button->focusChanged(nowHasFocus);
+    if (nowHasFocus) {
+        if (button && button->client() && !MacFrame::currentEventIsMouseDownInWidget(button))
+            button->client()->scrollToVisible(button);
+        if (button && button->client())
+            button->client()->focusIn(button);
+    } else {
+        if (button && button->client())
+            button->client()->focusOut(button);
     }
 }
 
 -(void)clicked
 {
-    if (button) {
+    if (button)
         button->sendConsumedMouseUp();
-        button->clicked();
-    }
+    if (button && button->client())
+        button->client()->clicked(button);
 }
 
 @end
diff --git a/WebCore/kwq/KWQGuardedPtr.cpp b/WebCore/kwq/KWQGuardedPtr.cpp
deleted file mode 100644 (file)
index 371c365..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2003 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. 
- */
-
-#include "config.h"
-#include "KWQGuardedPtr.h"
-
-#include "KWQObject.h"
-
-KWQGuardedPtrBase::KWQGuardedPtrBase(QObject *o)
-{
-    if (o) {
-        iterator = QPtrListIterator<QObject>(o->_guardedPtrDummyList);
-    }
-}
diff --git a/WebCore/kwq/KWQGuardedPtr.h b/WebCore/kwq/KWQGuardedPtr.h
deleted file mode 100644 (file)
index c7bd5a1..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2003 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 QGUARDEDPTR_H_
-#define QGUARDEDPTR_H_
-
-#include "KWQPtrList.h"
-
-class QObject;
-
-class KWQGuardedPtrBase {
-public:
-    KWQGuardedPtrBase(QObject* = 0);
-    
-    QObject* pointer() const { return iterator.current(); }
-    bool isNull() const { return pointer() == 0; }
-    
-private:
-    QPtrListIterator<QObject> iterator;
-};
-
-template <class T> class QGuardedPtr : public KWQGuardedPtrBase {
-public:
-    QGuardedPtr() { }
-    QGuardedPtr(T* p) : KWQGuardedPtrBase(p) { }
-
-    T& operator*() const { return *(T*)pointer(); }
-    operator T*() const { return (T*)pointer(); }
-    T* operator->() const { return (T*)pointer(); }
-};
-
-#endif
index 54a98c42b8f848abe9236d2d992b523647362dd6..7813e13280f2c010e394e377dde88a437aa4e1de 100644 (file)
@@ -51,7 +51,7 @@ public:
 
     void setColors(const WebCore::Color& background, const WebCore::Color& foreground);
 
-    void setAlignment(AlignmentFlags);
+    void setAlignment(WebCore::HorizontalAlignment);
 
     void setCursorPosition(int);
     int cursorPosition() const;
@@ -82,13 +82,6 @@ public:
     IntSize sizeForCharacterWidth(int numCharacters) const;
     int baselinePosition(int height) const;
     
-    void returnPressed() { m_returnPressed.call(); }
-    void textChanged() { m_textChanged.call(text()); }
-    void performSearch() { m_performSearch.call(); }
-    void selectionChanged() { m_selectionChanged.call(); }
-        
-    void clicked();
-    
     virtual FocusPolicy focusPolicy() const;
     virtual bool checksDescendantsForFocus() const;
 
@@ -101,18 +94,12 @@ public:
     void addSearchResult();
 
 private:
-    KWQSignal m_returnPressed;
-    KWQSignal m_textChanged;
-    KWQSignal m_clicked;
-    KWQSignal m_performSearch;
-    KWQSignal m_selectionChanged;
-    
     Type m_type;
     KWQTextFieldController *m_controller;
 };
 
 #ifdef __OBJC__
-NSTextAlignment KWQNSTextAlignmentForAlignmentFlags(Qt::AlignmentFlags);
+NSTextAlignment KWQNSTextAlignment(WebCore::HorizontalAlignment);
 #endif
 
 #endif
index 803236878eea88d40416e48acf15befb8bb898ee..bddca28d3e386575721b0740efb2276089947456 100644 (file)
@@ -36,9 +36,9 @@
 #import "WebCoreTextRenderer.h"
 #import "WebCoreTextRendererFactory.h"
 #import "WebCoreViewFactory.h"
+#import "WidgetClient.h"
 
 using namespace WebCore;
-using WebCore::Font;
 
 @interface NSSearchField (SearchFieldSecrets)
 - (void)_addStringToRecentSearches:(NSString *)string;
@@ -55,12 +55,7 @@ NSControlSize KWQNSControlSizeForFont(const Font& f)
 }
 
 QLineEdit::QLineEdit(Type type)
-    : m_returnPressed(this, SIGNAL(returnPressed()))
-    , m_textChanged(this, SIGNAL(textChanged(const QString &)))
-    , m_clicked(this, SIGNAL(clicked()))
-    , m_performSearch(this, SIGNAL(performSearch()))
-    , m_selectionChanged(this, SIGNAL(selectionChanged()))
-    , m_type(type)
+    : m_type(type)
 {
     KWQ_BLOCK_EXCEPTIONS;
     id view = nil;
@@ -309,17 +304,12 @@ int QLineEdit::baselinePosition(int height) const
     return 0;
 }
 
-void QLineEdit::clicked()
-{
-    m_clicked.call();
-}
-
-void QLineEdit::setAlignment(AlignmentFlags alignment)
+void QLineEdit::setAlignment(HorizontalAlignment alignment)
 {
     KWQ_BLOCK_EXCEPTIONS;
 
     NSTextField *textField = (NSTextField *)getView();
-    [textField setAlignment:KWQNSTextAlignmentForAlignmentFlags(alignment)];
+    [textField setAlignment:KWQNSTextAlignment(alignment)];
 
     KWQ_UNBLOCK_EXCEPTIONS;
 }
@@ -342,18 +332,18 @@ bool QLineEdit::checksDescendantsForFocus() const
     return true;
 }
 
-NSTextAlignment KWQNSTextAlignmentForAlignmentFlags(Qt::AlignmentFlags a)
+NSTextAlignment KWQNSTextAlignment(HorizontalAlignment a)
 {
     switch (a) {
-        default:
-            LOG_ERROR("unsupported alignment");
-        case Qt::AlignLeft:
+        case AlignLeft:
             return NSLeftTextAlignment;
-        case Qt::AlignRight:
+        case AlignRight:
             return NSRightTextAlignment;
-        case Qt::AlignHCenter:
+        case AlignHCenter:
             return NSCenterTextAlignment;
     }
+    LOG_ERROR("unsupported alignment");
+    return NSLeftTextAlignment;
 }
 
 void QLineEdit::setLiveSearch(bool liveSearch)
index 9d13050d6df9d886503d4ba5bd823a001c755e57..8bc9875e046ef7bd8a18b46aa95139510083cd79 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
@@ -26,6 +26,7 @@
 #ifndef KWQLISTBOX_H_
 #define KWQLISTBOX_H_
 
+#include "KWQValueList.h"
 #include "QString.h"
 #include "ScrollView.h"
 #include "TextDirection.h"
@@ -74,8 +75,6 @@ public:
     void setWritingDirection(WebCore::TextDirection);
     
     bool changingSelection() { return _changingSelection; }
-    void clicked() { _clicked.call(); }
-    void selectionChanged() { _selectionChanged.call(); }
 
     virtual FocusPolicy focusPolicy() const;
     virtual bool checksDescendantsForFocus() const;
@@ -94,9 +93,6 @@ private:
 
     mutable float _width;
     mutable bool _widthGood;
-    
-    KWQSignal _clicked;
-    KWQSignal _selectionChanged;
 };
 
 #endif
index b88f505a1e475ee33a2a215ab2c6ada25e3af014..653a0e11f1002f8a477c0e1d6b8dadb30bc5c22d 100644 (file)
@@ -125,8 +125,6 @@ QListBox::QListBox()
     : _changingSelection(false)
     , _enabled(true)
     , _widthGood(false)
-    , _clicked(this, SIGNAL(clicked(QListBoxItem *)))
-    , _selectionChanged(this, SIGNAL(selectionChanged()))
 {
     KWQ_BLOCK_EXCEPTIONS;
 
@@ -569,16 +567,11 @@ static Boolean KWQTableViewTypeSelectCallback(UInt32 index, void *listDataPtr, v
     BOOL become = [super becomeFirstResponder];
     
     if (become) {
-        if (_box && !MacFrame::currentEventIsMouseDownInWidget(_box)) {
-            RenderWidget *widget = const_cast<RenderWidget *> (static_cast<const RenderWidget *>(_box->eventFilterObject()));
-            RenderLayer *layer = widget->enclosingLayer();
-            if (layer)
-                layer->scrollRectToVisible(widget->absoluteBoundingBoxRect());
-        }        
+        if (_box && _box->client() && !MacFrame::currentEventIsMouseDownInWidget(_box))
+            _box->client()->scrollToVisible(_box);
         [self _KWQ_setKeyboardFocusRingNeedsDisplay];
-
-        if (_box && _box->eventFilterObject())
-            _box->eventFilterObject()->eventFilterFocusIn();
+        if (_box && _box->client())
+            _box->client()->focusIn(_box);
     }
 
     return become;
@@ -587,8 +580,8 @@ static Boolean KWQTableViewTypeSelectCallback(UInt32 index, void *listDataPtr, v
 - (BOOL)resignFirstResponder
 {
     BOOL resign = [super resignFirstResponder];
-    if (resign && _box && _box->eventFilterObject()) {
-        _box->eventFilterObject()->eventFilterFocusOut();
+    if (resign && _box && _box->client()) {
+        _box->client()->focusOut(_box);
         if (_box)
             [MacFrame::bridgeForWidget(_box) formControlIsResigningFirstResponder:self];
     }
@@ -644,17 +637,15 @@ static Boolean KWQTableViewTypeSelectCallback(UInt32 index, void *listDataPtr, v
 
 - (void)tableViewSelectionDidChange:(NSNotification *)notification
 {
-    if (_box) {
-        _box->selectionChanged();
-    }
+    if (_box && _box->client())
+        _box->client()->selectionChanged(_box);
     if (_box && !_box->changingSelection()) {
-    if (processingMouseEvent) {
-        clickedDuringMouseEvent = true;
-        _box->sendConsumedMouseUp();
-    }
-        if (_box) {
-            _box->clicked();
+        if (processingMouseEvent) {
+            clickedDuringMouseEvent = true;
+            _box->sendConsumedMouseUp();
         }
+        if (_box && _box->client())
+            _box->client()->clicked(_box);
     }
 }
 
diff --git a/WebCore/kwq/KWQObject.cpp b/WebCore/kwq/KWQObject.cpp
deleted file mode 100644 (file)
index 154d0f4..0000000
+++ /dev/null
@@ -1,90 +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. 
- */
-
-#include "config.h"
-#include "KWQObject.h"
-
-#include <kxmlcore/Assertions.h>
-#include <kxmlcore/HashMap.h>
-
-QObject::QObject()
-    : _signalListHead(0)
-    , _destroyed(this, SIGNAL(destroyed()))
-    , _eventFilterObject(0)
-{
-    _guardedPtrDummyList.append(this);
-}
-
-QObject::~QObject()
-{
-    _destroyed.call();
-    ASSERT(_signalListHead == &_destroyed);
-}
-
-KWQSignal *QObject::findSignal(const char *signalName) const
-{
-    for (KWQSignal *signal = _signalListHead; signal; signal = signal->_next)
-        if (KWQNamesMatch(signalName, signal->_name))
-            return signal;
-    return 0;
-}
-
-void QObject::connect(const QObject *sender, const char *signalName, const QObject *receiver, const char *member)
-{
-    // FIXME: Assert that sender is not 0 rather than doing the if statement, then fix callers who call with 0.
-    if (!sender)
-        return;
-    
-    KWQSignal *signal = sender->findSignal(signalName);
-    if (!signal) {
-        LOG_ERROR("connecting member %s to signal %s, but that signal was not found", member, signalName);
-        return;
-    }
-    signal->connect(KWQSlot(const_cast<QObject *>(receiver), member));
-}
-
-void QObject::disconnect(const QObject *sender, const char *signalName, const QObject *receiver, const char *member)
-{
-    // FIXME: Assert that sender is not 0 rather than doing the if statement, then fix callers who call with 0.
-    if (!sender)
-        return;
-    
-    KWQSignal *signal = sender->findSignal(signalName);
-    if (!signal) {
-        // FIXME: Put a call to ERROR here and clean up callers who do this.
-        return;
-    }
-    signal->disconnect(KWQSlot(const_cast<QObject *>(receiver), member));
-}
-
-bool QObject::isFrame() const
-{
-    return false;
-}
-
-bool QObject::isFrameView() const
-{
-    return false;
-}
diff --git a/WebCore/kwq/KWQObject.h b/WebCore/kwq/KWQObject.h
deleted file mode 100644 (file)
index 55500a1..0000000
+++ /dev/null
@@ -1,81 +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 QOBJECT_H_
-#define QOBJECT_H_
-
-#include "KWQNamespace.h"
-#include "KWQPtrList.h"
-#include "KWQSignal.h"
-
-#define slots : public
-#define SLOT(x) "SLOT:" #x
-#define signals protected
-#define SIGNAL(x) "SIGNAL:" #x
-#define emit
-#define Q_OBJECT
-
-class KWQGuardedPtrBase;
-
-class QObject : public Qt {
-public:
-    QObject();
-    virtual ~QObject();
-
-    static void connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member);
-    static void disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member);
-    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() { _eventFilterObject = 0; }
-    const QObject* eventFilterObject() const { return _eventFilterObject; }
-
-    virtual void eventFilterFocusIn() const { }
-    virtual void eventFilterFocusOut() const { }
-
-    virtual bool isFrame() const;
-    virtual bool isFrameView() const;
-
-private:
-    // no copying or assignment
-    QObject(const QObject &);
-    QObject &operator=(const QObject &);
-    
-    KWQSignal *findSignal(const char *signalName) const;
-    
-    QPtrList<QObject> _guardedPtrDummyList;
-    
-    mutable KWQSignal *_signalListHead;
-
-    KWQSignal _destroyed;
-    
-    const QObject *_eventFilterObject;
-    
-    friend class KWQGuardedPtrBase;
-    friend class KWQSignal;
-};
-
-#endif
index 36956f809f25fefa25e833589c0e124a07ebedfa..02fc95ccddf3dc07d7734f14bc09992f4ad4ebb3 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
@@ -27,7 +27,6 @@
 #define KWQSCROLLBAR_H_
 
 #include "Widget.h"
-#include "KWQNamespace.h"
 
 #ifdef __OBJC__
 @class NSScroller;
@@ -50,12 +49,16 @@ typedef enum {
     KWQScrollWheel
 } KWQScrollGranularity;
 
+namespace WebCore {
+    enum ScrollBarOrientation { HorizontalScrollBar, VerticalScrollBar };
+}
+
 class QScrollBar : public Widget {
 public:
-    QScrollBar(Orientation orientation, Widget* parent);
-    ~QScrollBar();
+    QScrollBar(WebCore::ScrollBarOrientation);
+    virtual ~QScrollBar();
 
-    Orientation orientation() { return m_orientation; }
+    WebCore::ScrollBarOrientation orientation() { return m_orientation; }
 
     int value() { return m_currentPos; }
     bool setValue(int v);
@@ -69,13 +72,12 @@ public:
     bool scroll(KWQScrollDirection, KWQScrollGranularity, float multiplier = 1.0);
     
 private:
-    Orientation m_orientation;
+    WebCore::ScrollBarOrientation m_orientation;
     int m_visibleSize;
     int m_totalSize;
     int m_currentPos;
     int m_lineStep;
     int m_pageStep;
-    KWQSignal m_valueChanged;
 };
 
 #endif
index 2da75b57be9a72915a20c4658ec56421ec483688..03269ec6367dec1878d48beb11faf08912f81200 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 "config.h"
 #import "KWQScrollBar.h"
 
 #import "KWQExceptions.h"
 #import "KWQView.h"
+#import "WidgetClient.h"
+
+using namespace WebCore;
 
 @interface KWQScrollBar : NSScroller <KWQWidgetHolder>
 {
     // dimensions, so we have to do this unsavory hack.
     NSRect orientation;
     orientation.origin.x = orientation.origin.y = 0;
-    if ( s->orientation() == Qt::Vertical ) {
+    if (s->orientation() == VerticalScrollBar) {
         orientation.size.width = [NSScroller scrollerWidth];
         orientation.size.height = 100;
-    }
-    else {
+    } else {
         orientation.size.width = 100;
         orientation.size.height = [NSScroller scrollerWidth];
     }
 
 @end
 
-QScrollBar::QScrollBar(Orientation orientation, Widget* parent)
+QScrollBar::QScrollBar(ScrollBarOrientation orientation)
     : m_orientation(orientation)
     , m_visibleSize(0)
     , m_totalSize(0)
     , m_currentPos(0)
     , m_lineStep(0)
     , m_pageStep(0)
-    , m_valueChanged(this, SIGNAL(valueChanged(int)))
 {
     KWQ_BLOCK_EXCEPTIONS;
 
@@ -200,13 +201,14 @@ bool QScrollBar::scrollbarHit(NSScrollerPart hitPart)
 
 void QScrollBar::valueChanged()
 {
-    m_valueChanged.call(m_currentPos);
+    if (client())
+        client()->valueChanged(this);
 }
 
 bool QScrollBar::scroll(KWQScrollDirection direction, KWQScrollGranularity granularity, float multiplier)
 {
     float delta = 0.0;
-    if ((direction == KWQScrollUp && m_orientation == Vertical) || (direction == KWQScrollLeft && m_orientation == Horizontal)) {
+    if ((direction == KWQScrollUp && m_orientation == VerticalScrollBar) || (direction == KWQScrollLeft && m_orientation == HorizontalScrollBar)) {
         if (granularity == KWQScrollLine) {
             delta = -m_lineStep;
         } else if (granularity == KWQScrollPage) {
@@ -216,7 +218,7 @@ bool QScrollBar::scroll(KWQScrollDirection direction, KWQScrollGranularity granu
         } else if (granularity == KWQScrollWheel) {
             delta = -m_lineStep;
         }
-    } else if ((direction == KWQScrollDown && m_orientation == Vertical) || (direction == KWQScrollRight && m_orientation == Horizontal)) {
+    } else if ((direction == KWQScrollDown && m_orientation == VerticalScrollBar) || (direction == KWQScrollRight && m_orientation == HorizontalScrollBar)) {
         if (granularity == KWQScrollLine) {
             delta = m_lineStep;
         } else if (granularity == KWQScrollPage) {
diff --git a/WebCore/kwq/KWQSignal.cpp b/WebCore/kwq/KWQSignal.cpp
deleted file mode 100644 (file)
index 7f1abde..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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. 
- */
-
-#include "config.h"
-#include "KWQSignal.h"
-
-#include "KWQObject.h"
-#include <kxmlcore/Assertions.h>
-
-KWQSignal::KWQSignal(QObject *object, const char *name)
-    : _object(object), _next(object->_signalListHead), _name(name)
-{
-    object->_signalListHead = this;
-}
-
-KWQSignal::~KWQSignal()
-{
-    KWQSignal **prev = &_object->_signalListHead;
-    KWQSignal *signal;
-    while ((signal = *prev)) {
-        if (signal == this) {
-            *prev = _next;
-            break;
-        }
-        prev = &signal->_next;
-    }
-}
-
-void KWQSignal::connect(const KWQSlot &slot)
-{
-#if !ERROR_DISABLED
-    if (_slots.contains(slot))
-        LOG_ERROR("connecting the same slot to a signal twice, %s", _name);
-#endif
-    _slots.append(slot);
-}
-
-void KWQSignal::disconnect(const KWQSlot &slot)
-{
-#if !ERROR_DISABLED
-    if (!_slots.contains(slot))
-        LOG_ERROR("disconnecting a signal that wasn't connected, %s", _name);
-#endif
-    _slots.remove(slot);
-}
-
-void KWQSignal::call() const
-{
-    QValueList<KWQSlot> copiedSlots(_slots);
-    QValueListConstIterator<KWQSlot> end = copiedSlots.end();
-    for (QValueListConstIterator<KWQSlot> it = copiedSlots.begin(); it != end; ++it)
-        (*it).call();
-}
-
-void KWQSignal::call(int i) const
-{
-    QValueList<KWQSlot> copiedSlots(_slots);
-    QValueListConstIterator<KWQSlot> end = copiedSlots.end();
-    for (QValueListConstIterator<KWQSlot> it = copiedSlots.begin(); it != end; ++it)
-        (*it).call(i);
-}
-
-void KWQSignal::call(const DOM::DOMString &s) const
-{
-    QValueList<KWQSlot> copiedSlots(_slots);
-    QValueListConstIterator<KWQSlot> end = copiedSlots.end();
-    for (QValueListConstIterator<KWQSlot> it = copiedSlots.begin(); it != end; ++it)
-        (*it).call(s);
-}
diff --git a/WebCore/kwq/KWQSignal.h b/WebCore/kwq/KWQSignal.h
deleted file mode 100644 (file)
index 4086392..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2004 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 KWQSIGNAL_H
-#define KWQSIGNAL_H
-
-#include "KWQSlot.h"
-#include "KWQValueList.h"
-
-class KWQSignal {
-public:
-    KWQSignal(QObject *, const char *name);
-#ifdef WIN32_COMPILE_HACK
-    KWQSignal() {}
-#endif
-    ~KWQSignal();
-    
-    void connect(const KWQSlot &);
-    void disconnect(const KWQSlot &);
-    
-    void call() const; // should be "emit"; can't be due to define in qobject.h
-    void call(int) const;
-    void call(const DOM::DOMString&) const;
-    
-private:
-    // forbid copying and assignment
-    KWQSignal(const KWQSignal &);
-    KWQSignal &operator=(const KWQSignal &);
-    
-    QObject *_object;
-    KWQSignal *_next;
-    const char *_name;
-    QValueList<KWQSlot> _slots;
-    
-    friend class QObject;
-};
-
-#endif
index 7164a45c4e0e475a33ec8a6f8fdf5485ede56f7b..431a52e4c3e2e74e350b37307dd87b3bd1873ce6 100644 (file)
@@ -27,7 +27,6 @@
 #define KWQSLIDER_H_
 
 #include "Widget.h"
-#include "KWQNamespace.h"
 
 class QSlider : public Widget {
 public:
@@ -44,19 +43,14 @@ public:
     double value() const;
     double minValue() const;
     double maxValue() const;
-    
+
     void sliderValueChanged();
 
     const int* dimensions() const;
 
-    void clicked();
-    
     virtual FocusPolicy focusPolicy() const;
 
-
 private:
-    KWQSignal m_sliderValueChanged;
-    KWQSignal m_clicked;
     double m_minVal;
     double m_maxVal;
     double m_val;
index 86a99000142cc54f7ee0e1765a29191132e665e6..365c393d6a505396ecd4c70cc31005cfd528b621 100644 (file)
@@ -75,19 +75,16 @@ using namespace WebCore;
     Widget::beforeMouseDown(self);
     [super mouseDown:event];
     Widget::afterMouseDown(self);
-    if (slider) {
+    if (slider)
         slider->sendConsumedMouseUp();
-    }
-    if (slider) {
-        slider->clicked();
-    }
+    if (slider && slider->client())
+        slider->client()->clicked(slider);
 }
 
 - (IBAction)slide:(NSSlider*)sender
 {
-    if (slider) {
+    if (slider)
         slider->sliderValueChanged();
-    }
 }
 
 - (Widget *)widget
@@ -101,15 +98,10 @@ using namespace WebCore;
 {
     BOOL become = [super becomeFirstResponder];
     if (become && slider) {
-        if (!MacFrame::currentEventIsMouseDownInWidget(slider)) {
-            RenderWidget *widget = const_cast<RenderWidget *> (static_cast<const RenderWidget *>(slider->eventFilterObject()));
-            RenderLayer *layer = widget->enclosingLayer();
-            if (layer)
-                layer->scrollRectToVisible(widget->absoluteBoundingBoxRect());
-        }
-
-        if (slider && slider->eventFilterObject())
-            slider->eventFilterObject()->eventFilterFocusIn();
+        if (slider && slider->client() && !MacFrame::currentEventIsMouseDownInWidget(slider))
+            slider->client()->scrollToVisible(slider);
+        if (slider && slider->client())
+            slider->client()->focusIn(slider);
     }
     return become;
 }
@@ -117,8 +109,8 @@ using namespace WebCore;
 - (BOOL)resignFirstResponder
 {
     BOOL resign = [super resignFirstResponder];
-    if (resign && slider && slider->eventFilterObject()) {
-        slider->eventFilterObject()->eventFilterFocusOut();
+    if (resign && slider && slider->client()) {
+        slider->client()->focusOut(slider);
         if (slider)
             [MacFrame::bridgeForWidget(slider) formControlIsResigningFirstResponder:self];
     }
@@ -199,9 +191,7 @@ enum {
 };
 
 QSlider::QSlider()
-: m_sliderValueChanged(this, SIGNAL(sliderValueChanged())), 
-  m_clicked(this, SIGNAL(clicked())),
-  m_minVal(0.0), m_maxVal(100.0), m_val(50.0)
+    : m_minVal(0.0), m_maxVal(100.0), m_val(50.0)
 {
     KWQ_BLOCK_EXCEPTIONS;
     KWQSlider* slider = [[KWQSlider alloc] initWithQSlider:this];
@@ -298,7 +288,8 @@ void QSlider::sliderValueChanged()
     double v = [slider doubleValue];
     if (m_val != v) {
         m_val = v;
-        m_sliderValueChanged.call();
+        if (client())
+            client()->valueChanged(this);
     }
 }
 
@@ -319,8 +310,3 @@ const int* QSlider::dimensions() const
     
     return w[NSSmallControlSize];
 }
-
-void QSlider::clicked()
-{
-    m_clicked.call();
-}
diff --git a/WebCore/kwq/KWQSlot.cpp b/WebCore/kwq/KWQSlot.cpp
deleted file mode 100644 (file)
index c1e9e58..0000000
+++ /dev/null
@@ -1,160 +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. 
- */
-
-#include "config.h"
-#include "KWQSlot.h"
-
-#include "DocumentImpl.h"
-#include "Frame.h"
-#include "render_form.h"
-#include <kxmlcore/Assertions.h>
-
-using namespace WebCore;
-
-enum FunctionNumber {
-    slotClicked,
-    slotPerformSearch,
-    slotReturnPressed,
-    slotSelected,
-    slotSelectionChanged,
-    slotSliderValueChanged,
-    slotStateChanged,
-    slotTextChanged,
-    slotTextChangedWithString,
-    slotValueChanged,
-};
-
-KWQSlot::KWQSlot(QObject *object, const char *member)
-{
-    #define CASE(function, parameters, type) \
-        if (KWQNamesMatch(member, "SLOT:" #function #parameters)) { \
-            m_function = function; \
-        } else
-    
-    CASE(slotClicked, (), RenderFormElement)
-    CASE(slotPerformSearch, (), RenderLineEdit)
-    CASE(slotReturnPressed, (), RenderLineEdit)
-    CASE(slotSelected, (int), RenderSelect)
-    CASE(slotSelectionChanged, (), RenderFormElement)
-    CASE(slotSliderValueChanged, (), RenderSlider)
-    CASE(slotTextChanged, (), RenderTextArea)
-    CASE(slotValueChanged, (int), RenderScrollMediator)
-       
-    #undef CASE
-
-    if (KWQNamesMatch(member, SLOT(slotTextChanged(const DOMString &)))) {
-        m_function = slotTextChangedWithString;
-    } else {
-        LOG_ERROR("trying to create a slot for unknown member %s", member);
-        return;
-    }
-    
-    m_object = object;
-}
-    
-void KWQSlot::call() const
-{
-    if (m_object.isNull()) {
-        return;
-    }
-    
-    #define CASE(member, type, function) \
-        case member: \
-            static_cast<type *>(m_object.pointer())->function(); \
-            return;
-    
-    switch (m_function) {
-        CASE(slotClicked, RenderFormElement, slotClicked)
-        CASE(slotPerformSearch, RenderLineEdit, slotPerformSearch)
-        CASE(slotReturnPressed, RenderLineEdit, slotReturnPressed)
-        CASE(slotSelectionChanged, RenderFormElement, slotSelectionChanged)
-        CASE(slotSliderValueChanged, RenderSlider, slotSliderValueChanged)
-        CASE(slotTextChanged, RenderTextArea, slotTextChanged)
-    }
-    
-    #undef CASE
-}
-
-void KWQSlot::call(int i) const
-{
-    if (m_object.isNull()) {
-        return;
-    }
-    
-    switch (m_function) {
-        case slotSelected:
-            static_cast<RenderSelect *>(m_object.pointer())->slotSelected(i);
-            return;
-        case slotValueChanged:
-            static_cast<RenderScrollMediator *>(m_object.pointer())->slotValueChanged(i);
-            return;
-    }
-    
-    call();
-}
-
-void KWQSlot::call(const DOM::DOMString &string) const
-{
-    if (m_object.isNull())
-        return;
-    
-    switch (m_function) {
-        case slotTextChangedWithString:
-            static_cast<RenderFormElement *>(m_object.pointer())->slotTextChanged(string);
-            return;
-    }
-    
-    call();
-}
-
-bool operator==(const KWQSlot &a, const KWQSlot &b)
-{
-    return a.m_object == b.m_object && (a.m_object == 0 || a.m_function == b.m_function);
-}
-
-bool KWQNamesMatch(const char *a, const char *b)
-{
-    char ca = *a;
-    char cb = *b;
-    
-    for (;;) {
-        while (ca == ' ') {
-            ca = *++a;
-        }
-        while (cb == ' ') {
-            cb = *++b;
-        }
-        
-        if (ca != cb) {
-            return false;
-        }
-        if (ca == 0) {
-            return true;
-        }
-        
-        ca = *++a;
-        cb = *++b;
-    }
-}
diff --git a/WebCore/kwq/KWQSlot.h b/WebCore/kwq/KWQSlot.h
deleted file mode 100644 (file)
index b3e8351..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2004 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 KWQSLOT_H
-#define KWQSLOT_H
-
-#include "KWQGuardedPtr.h"
-
-#if __OBJC__
-@class NSData;
-@class NSURLResponse;
-#else
-class NSData;
-class NSURLResponse;
-#endif
-
-class QString;
-class KURL;
-
-namespace DOM {
-    class DOMString;
-}
-
-// Like strcmp, but ignores spaces.
-bool KWQNamesMatch(const char *a, const char *b);
-
-class KWQSlot {
-public:
-    KWQSlot() : m_object(0) { }
-    KWQSlot(QObject *, const char *member);
-    
-    bool isEmpty() const { return !m_object; }
-    void clear() { m_object = 0; }
-    
-    void call() const;
-    void call(int) const;
-    void call(const DOM::DOMString&) const;
-
-    friend bool operator==(const KWQSlot &, const KWQSlot &);
-
-private:
-    QGuardedPtr<QObject> m_object;
-    int m_function;
-};
-
-inline bool operator!=(const KWQSlot &a, const KWQSlot &b) { return !(a == b); }
-
-#endif
index e2c2681998e3843ff2b74ab4fb6e1e53bb410774..e764c9a58f231eb217ca0c6ca17c4ec99fbff484 100644 (file)
@@ -33,6 +33,7 @@
 #import "KWQTextEdit.h"
 #import "MacFrame.h"
 #import "WebCoreFrameBridge.h"
+#import "dom_elementimpl.h"
 #import "render_replaced.h"
 #import <kxmlcore/Assertions.h>
 
@@ -209,8 +210,8 @@ const float LargeNumberForText = 1.0e7;
 
 - (void)textViewDidChangeSelection:(NSNotification *)notification
 {
-    if (widget && ![textView inResponderChange])
-        widget->selectionChanged();
+    if (widget && widget->client() && ![textView inResponderChange])
+        widget->client()->selectionChanged(widget);
 }
 
 - (void)textDidChange:(NSNotification *)notification
@@ -227,8 +228,8 @@ const float LargeNumberForText = 1.0e7;
         normalizeLineEndings = NO;
     }
 
-    if (widget)
-        widget->textChanged();
+    if (widget && widget->client())
+        widget->client()->valueChanged(widget);
     
     WebCoreFrameBridge *bridge = MacFrame::bridgeForWidget(widget);
     [bridge textDidChangeInTextArea:(DOMHTMLTextAreaElement *)[bridge elementForView:self]];
@@ -913,15 +914,11 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
     --inResponderChange;
 
     if (become) {
-        if (!MacFrame::currentEventIsMouseDownInWidget(widget)) {
-            RenderWidget *w = const_cast<RenderWidget *> (static_cast<const RenderWidget *>(widget->eventFilterObject()));
-            RenderLayer *layer = w->enclosingLayer();
-            if (layer)
-                layer->scrollRectToVisible(w->absoluteBoundingBoxRect());
-        }
+        if (widget && widget->client() && !MacFrame::currentEventIsMouseDownInWidget(widget))
+            widget->client()->scrollToVisible(widget);
         [self _KWQ_setKeyboardFocusRingNeedsDisplay];
-        if (widget && widget->eventFilterObject())
-            widget->eventFilterObject()->eventFilterFocusIn();
+        if (widget && widget->client())
+            widget->client()->focusIn(widget);
     }
 
     return become;
@@ -938,11 +935,11 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
     if (resign) {
         [self _KWQ_setKeyboardFocusRingNeedsDisplay];
 
-        if (widget && widget->eventFilterObject()) {
-            widget->eventFilterObject()->eventFilterFocusOut();
+        if (widget && widget->client()) {
+            widget->client()->focusOut(widget);
             if (widget)
                 [MacFrame::bridgeForWidget(widget) formControlIsResigningFirstResponder:self];
-        }        
+        }
     }
 
     return resign;
@@ -1047,12 +1044,10 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
     }
     
     [super mouseDown:event];
-    if (widget) {
+    if (widget)
         widget->sendConsumedMouseUp();
-    }
-    if (widget) {
-        widget->clicked();
-    }
+    if (widget && widget->client())
+        widget->client()->clicked(widget);
 }
 
 - (void)keyDown:(NSEvent *)event
@@ -1141,8 +1136,8 @@ static NSString *WebContinuousSpellCheckingEnabled = @"WebContinuousSpellCheckin
 - (void)dispatchHTMLEvent:(const AtomicString &)eventType
 {
     if (widget)
-        if (const RenderWidget *rw = static_cast<const RenderWidget *>(widget->eventFilterObject()))
-            if (NodeImpl *node = rw->element())
+        if (WidgetClient* c = widget->client())
+            if (NodeImpl* node = c->element(widget))
                 node->dispatchHTMLEvent(eventType, false, false);
 }
 
index e865aef46101e42cd4281ec6dfe7c99e33f654d4..660b8ed1a6b802af0636a111baf4079bd4eaed16 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
 #ifndef QTEXTEDIT_H_
 #define QTEXTEDIT_H_
 
-#include "KWQSignal.h"
 #include "ScrollView.h"
 #include "TextDirection.h"
 
 namespace WebCore {
     class Color;
+    class String;
 }
 
 class QTextEdit : public WebCore::ScrollView {
@@ -50,7 +50,7 @@ class QTextEdit : public WebCore::ScrollView {
 
     void setColors(const WebCore::Color& background, const WebCore::Color& foreground);
 
-    void setAlignment(AlignmentFlags);
+    void setAlignment(WebCore::HorizontalAlignment);
     void setLineHeight(int lineHeight);
 
     void setCursorPosition(int, int);
@@ -89,18 +89,8 @@ class QTextEdit : public WebCore::ScrollView {
 
     IntSize sizeWithColumnsAndRows(int numColumns, int numRows) const;
 
-    void textChanged() { _textChanged.call(); }
-
-    void selectionChanged() { _selectionChanged.call(); }
-    void clicked();
-
     virtual FocusPolicy focusPolicy() const;
     virtual bool checksDescendantsForFocus() const;
-
-  private:
-    KWQSignal _clicked;
-    KWQSignal _textChanged;
-    KWQSignal _selectionChanged;
 };
 
 #endif /* QTEXTEDIT_H_ */
index 4c7f2a7a4e3b515dcea0fc8796adc365da63c9bf..d41e7840184056e101e92962783b5ea45081baf1 100644 (file)
 #import "KWQTextEdit.h"
 
 #import "Color.h"
+#import "Font.h"
 #import "IntSize.h"
 #import "KWQExceptions.h"
-#import "Font.h"
 #import "KWQLineEdit.h"
 #import "KWQTextArea.h"
+#import "WidgetClient.h"
 #import <kxmlcore/Assertions.h>
 
 using namespace WebCore;
 
 QTextEdit::QTextEdit(Widget *parent)
-    : _clicked(this, SIGNAL(clicked()))
-    , _textChanged(this, SIGNAL(textChanged()))
-    , _selectionChanged(this, SIGNAL(selectionChanged()))
 {
     KWQ_BLOCK_EXCEPTIONS;
     KWQTextArea *textView = [[KWQTextArea alloc] initWithQTextEdit:this];
@@ -334,17 +332,12 @@ void QTextEdit::setFont(const Font& font)
     KWQ_UNBLOCK_EXCEPTIONS;
 }
 
-void QTextEdit::clicked()
-{
-    _clicked.call();
-}
-
-void QTextEdit::setAlignment(AlignmentFlags alignment)
+void QTextEdit::setAlignment(HorizontalAlignment alignment)
 {
     KWQ_BLOCK_EXCEPTIONS;
 
     KWQTextArea *textArea = static_cast<KWQTextArea *>(getView());
-    [textArea setAlignment:KWQNSTextAlignmentForAlignmentFlags(alignment)];
+    [textArea setAlignment:KWQNSTextAlignment(alignment)];
 
     KWQ_UNBLOCK_EXCEPTIONS;
 }
index 8cd97aadf0056865cab0e868dd415a146d1e04b6..7582ea4c2a58aaec33163c21ef13b86777292ccc 100644 (file)
@@ -117,12 +117,10 @@ using namespace WebCore;
 
 - (void)action:(id)sender
 {
-    if (!widget)
-        return;
-    widget->textChanged();
-    if (!widget)
-        return;
-    widget->performSearch();
+    if (widget && widget->client())
+        widget->client()->valueChanged(widget);
+    if (widget && widget->client())
+        widget->client()->performSearch(widget);
 }
 
 - (void)dealloc
@@ -179,8 +177,8 @@ using namespace WebCore;
     WebCoreFrameBridge *bridge = MacFrame::bridgeForWidget(widget);
     [bridge textFieldDidEndEditing:(DOMHTMLInputElement *)[bridge elementForView:field]];
     
-    if (widget && [[[notification userInfo] objectForKey:@"NSTextMovement"] intValue] == NSReturnTextMovement)
-        widget->returnPressed();
+    if (widget && widget->client() && [[[notification userInfo] objectForKey:@"NSTextMovement"] intValue] == NSReturnTextMovement)
+        widget->client()->returnPressed(widget);
 }
 
 - (void)controlTextDidChange:(NSNotification *)notification
@@ -197,8 +195,7 @@ using namespace WebCore;
     }
     
     edited = YES;
-    if (widget)
-        widget->textChanged();
+    [self textChanged];
 }
 
 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
@@ -240,8 +237,8 @@ using namespace WebCore;
 
 - (void)textChanged
 {
-    if (widget)
-        widget->textChanged();
+    if (widget && widget->client())
+        widget->client()->valueChanged(widget);
 }
 
 - (void)setInDrawingMachinery:(BOOL)inDrawing
@@ -315,9 +312,8 @@ using namespace WebCore;
 
     if ([event type] == NSLeftMouseUp) {
         widget->sendConsumedMouseUp();
-        if (widget) {
-            widget->clicked();
-        }
+        if (widget && widget->client())
+            widget->client()->clicked(widget);
     }
 }
 
@@ -396,15 +392,10 @@ using namespace WebCore;
         
         hasFocusAndSelectionSet = YES;
 
-        if (!MacFrame::currentEventIsMouseDownInWidget(widget) && widget) {
-            RenderWidget *w = const_cast<RenderWidget *> (static_cast<const RenderWidget *>(widget->eventFilterObject()));
-            RenderLayer *layer = w->enclosingLayer();
-            if (layer)
-                layer->scrollRectToVisible(w->absoluteBoundingBoxRect());
-        }
-        
-        if (widget && widget->eventFilterObject())
-            widget->eventFilterObject()->eventFilterFocusIn();
+        if (widget && widget->client() && !MacFrame::currentEventIsMouseDownInWidget(widget))
+            widget->client()->scrollToVisible(widget);
+        if (widget && widget->client())
+            widget->client()->focusIn(widget);
         
         // Sending the onFocus event above, may have resulted in a blur() - if this
         // happens when tabbing from another text field, then endEditing: and
@@ -420,8 +411,8 @@ using namespace WebCore;
     } else {
         lastSelectedRange = [self selectedRange];
         
-        if (widget && widget->eventFilterObject()) {
-            widget->eventFilterObject()->eventFilterFocusOut();
+        if (widget && widget->client()) {
+            widget->client()->focusOut(widget);
             if (widget)
                 [MacFrame::bridgeForWidget(widget) formControlIsResigningFirstResponder:field];
         }
@@ -478,8 +469,8 @@ using namespace WebCore;
 
 - (void)textViewDidChangeSelection:(NSNotification *)notification
 {
-    if (widget && hasFocusAndSelectionSet)
-        widget->selectionChanged();
+    if (widget && widget->client() && hasFocusAndSelectionSet)
+        widget->client()->selectionChanged(widget);
 }
 
 @end
index 95bed123c1baca5a5be68f635c4837615867c34c..51d528f6a5863cc7c2fd21e0225e747f9f5cea49 100644 (file)
@@ -30,7 +30,6 @@
 #include "PlatformString.h"
 #include <kio/global.h>
 #include <kxmlcore/HashSet.h>
-#include <qobject.h>
 #include <stdlib.h>
 #include <time.h>
 
index 053ee3a39ac51faabfc866bd6dc86754fb370f4d..955e67e221a957bf6f9140e2d268559b79eae21b 100644 (file)
@@ -165,6 +165,9 @@ Frame::Frame(Page* page, RenderPart* ownerRenderer)
 #if !NDEBUG
     ++FrameCounter::count;
 #endif
+
+    if (ownerRenderer)
+        ownerRenderer->setFrame(this);
 }
 
 Frame::~Frame()
@@ -183,8 +186,23 @@ Frame::~Frame()
     clear(false);
 
     if (d->m_jscript && d->m_jscript->haveInterpreter())
-        if (Window* w = Window::retrieveWindow(this))
+        if (Window* w = Window::retrieveWindow(this)) {
             w->disconnectFrame();
+            // Must clear the window pointer, otherwise we will not
+            // garbage-collect collect the window (inside the call to
+            // delete d below).
+            w = 0;
+        }
+
+    setOpener(0);
+    HashSet<Frame*> openedBy = d->m_openedFrames;
+    HashSet<Frame*>::iterator end = openedBy.end();
+    for (HashSet<Frame*>::iterator it = openedBy.begin(); it != end; ++it)
+        (*it)->setOpener(0);
+
+    if (d->m_ownerRenderer)
+        d->m_ownerRenderer->setFrame(0);
+    ASSERT(!d->m_ownerRenderer);
 
     if (d->m_view) {
         d->m_view->hide();
@@ -2087,9 +2105,13 @@ Frame *Frame::opener()
     return d->m_opener;
 }
 
-void Frame::setOpener(Frame *_opener)
+void Frame::setOpener(Frameopener)
 {
-    d->m_opener = _opener;
+    if (d->m_opener)
+        d->m_opener->d->m_openedFrames.remove(this);
+    if (opener)
+        opener->d->m_openedFrames.add(this);
+    d->m_opener = opener;
 }
 
 bool Frame::openedByJS()
@@ -2902,11 +2924,13 @@ Frame *Frame::frameForNode(NodeImpl *node)
     return node->getDocument()->frame();
 }
 
-NodeImpl *Frame::nodeForWidget(const Widget *widget)
+NodeImpl* Frame::nodeForWidget(const Widget* widget)
 {
     ASSERT_ARG(widget, widget);
-    const QObject *o = widget->eventFilterObject();
-    return o ? static_cast<const RenderWidget *>(o)->element() : 0;
+    WidgetClient* client = widget->client();
+    if (!client)
+        return 0;
+    return client->element(const_cast<Widget*>(widget));
 }
 
 void Frame::setDocumentFocus(Widget *widget)
@@ -3270,11 +3294,6 @@ void Frame::prepareForUserAction()
     _submittedFormURL = KURL();
 }
 
-bool Frame::isFrame() const
-{
-    return true;
-}
-
 NodeImpl *Frame::mousePressNode()
 {
     return d->m_mousePressNode.get();
@@ -3347,4 +3366,9 @@ void Frame::started()
         frame->d->m_bComplete = false;
 }
 
+void Frame::disconnectOwnerRenderer()
+{
+    d->m_ownerRenderer = 0;
+}
+
 } // namespace WebCore
index 014694b3d514dad0c0d29588ee8c91161b24261a..bc41b1f3355bf5b84679f77b8d113c137dcff871 100644 (file)
@@ -91,7 +91,7 @@ enum ObjectContentType {
     ObjectContentPlugin,
 };
 
-class Frame : public Shared<Frame>, public QObject, Noncopyable, TransferJobClient {
+class Frame : public Shared<Frame>, Noncopyable, TransferJobClient {
 
 public:
   enum { NoXPosForVerticalArrowNavigation = INT_MIN };
@@ -601,7 +601,7 @@ public:
 
   static void endAllLifeSupport();
 
-signals:
+protected:
   /**
    * Emitted if the cursor is moved over an URL.
    */
@@ -863,13 +863,14 @@ private:
   // Call this method before handling a new user action, like on a mouse down or key down.
   // Currently, all this does is clear the "don't submit form twice" data member.
   void prepareForUserAction();
-  virtual bool isFrame() const;
   NodeImpl *mousePressNode();
 
   bool isComplete();
   
   void replaceContentsWithScriptResult(const KURL &url);
 
+    void disconnectOwnerRenderer();
+
 protected:
     virtual void startRedirectionTimer();
     virtual void stopRedirectionTimer();
index c7fa9db3486ab7e30773ad2b0ed38ce8a00148b0..78275d116b4d3f207dadfcf9de360e5d1571853c 100644 (file)
@@ -79,7 +79,7 @@ namespace WebCore {
             , m_redirectionTimer(thisFrame, &Frame::redirectionTimerFired)
             , m_scheduledRedirection(noRedirectionScheduled)
             , m_delayRedirect(0)
-            , m_zoomFactor(100)
+            , m_zoomFactor(parent ? parent->d->m_zoomFactor : 100)
             , m_submitForm(0)
             , m_bMousePressed(false)
             , m_caretBlinkTimer(thisFrame, &Frame::caretBlinkTimerFired)
@@ -103,12 +103,6 @@ namespace WebCore {
             , m_lifeSupportTimer(thisFrame, &Frame::lifeSupportTimerFired)
             , m_userStyleSheetLoader(0)
         {
-            // inherit settings from parent
-            if (parent && parent->isFrame()) {
-                Frame *frame = static_cast<Frame*>(parent);
-                if (frame->d)
-                    m_zoomFactor = frame->d->m_zoomFactor;
-            }
         }
 
         ~FramePrivate()
@@ -122,7 +116,7 @@ namespace WebCore {
 
         Vector<RefPtr<Plugin> > m_plugins;
 
-        QGuardedPtr<RenderPart> m_ownerRenderer;
+        RenderPart* m_ownerRenderer;
         RefPtr<FrameView> m_view;
         BrowserExtension* m_extension;
         RefPtr<DocumentImpl> m_doc;
@@ -215,7 +209,8 @@ namespace WebCore {
 
         IntPoint m_dragStartPos;
 
-        QGuardedPtr<Frame> m_opener;
+        Frame* m_opener;
+        HashSet<Frame*> m_openedFrames;
         bool m_openedByJS;
         bool m_newJSInterpreterExists; // set to 1 by setOpenedByJS, for window.open
         bool m_bPendingChildRedirection;
index 502bf2cae13bbfe534d28f0b90bc275569d4ee35..58bb16b3e1f2abd059046d012bd71fdbc48f7275 100644 (file)
@@ -170,7 +170,7 @@ FrameView::~FrameView()
         if (DocumentImpl* doc = m_frame->document())
             doc->detach();
         if (RenderPart* renderer = m_frame->ownerRenderer())
-            renderer->setQWidget(0);
+            renderer->setWidget(0);
     }
 
     delete d;
index b1e214a8fd60a1d6ae576e280e8ff76674cab6d3..aad2c7f4e1e7a425504e1f01be3f56fe90be727c 100644 (file)
@@ -27,7 +27,6 @@
 #define BRUSH_H_
 
 #include "Color.h"
-#include "KWQNamespace.h"
 
 namespace WebCore {
 
index 0e135571f2db287e6bc8c2c632466a1a2f53251f..453d58f468238717e2b67bb6ac2bbaf25191bc39 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef PEN_H_
 #define PEN_H_
 
-#include "KWQNamespace.h"
 #include "Color.h"
 
 namespace WebCore {
index cfd1c401974b4404aa7ddc63b9f962c80f8024d7..1de54827ab088c1a04463f9d46a7b4b457f92341 100644 (file)
@@ -95,4 +95,9 @@ bool Widget::checksDescendantsForFocus() const
     return false;
 }
 
+bool Widget::isFrameView() const
+{
+    return false;
+}
+
 }
index e23aa576cb1ad5ff786e987da7bbb450fb5ab88a..f23abef29ac07b693ae4eb11530a31d32ce9d572 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef WEBCORE_PLATFORM_WIDGET_H_
 #define WEBCORE_PLATFORM_WIDGET_H_
 
-#include "KWQObject.h"
-
 namespace WebCore {
     class Font;
 }
@@ -51,9 +49,12 @@ namespace WebCore {
     class IntPoint;
     class IntRect;
     class IntSize;
+    class WidgetClient;
     class WidgetPrivate;
 
-    class Widget : public QObject {
+    enum HorizontalAlignment { AlignLeft, AlignRight, AlignHCenter };
+
+    class Widget {
     public:
 
         enum FocusPolicy {
@@ -118,7 +119,12 @@ namespace WebCore {
         void disableFlushDrawing();
         void setDrawingAlpha(float alpha);
 
-        void setIsSelected(bool isSelected);
+        void setIsSelected(bool);
+
+        void setClient(WidgetClient*);
+        WidgetClient* client() const;
+
+        virtual bool isFrameView() const;
 
 #if WIN32
         Widget(HWND);
similarity index 62%
rename from WebCore/kwq/KWQNamespace.h
rename to WebCore/platform/WidgetClient.h
index 7fbc179c7838633f934cf478e8362cc357f8dece..7b451b4e4edfca8c779edb260faeecba2ed1e607 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2004, 2005, 2006 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 QNAMESPACE_H_
-#define QNAMESPACE_H_
+#ifndef WidgetClient_h
+#define WidgetClient_h
 
-#include "KWQDef.h"
+namespace WebCore {
 
-class Qt {
-public:
-    enum AlignmentFlags {
-        AlignAuto       = 0x0000,           // text alignment
-        AlignLeft       = 0x0001,
-        AlignRight      = 0x0002,
-        AlignHCenter    = 0x0004,
-        AlignVCenter    = 0x0020,
-        AlignCenter     = AlignVCenter | AlignHCenter,
-    };
+    class ElementImpl;
+    class Widget;
+
+    class WidgetClient {
+    public:
+        virtual ~WidgetClient() { }
+
+        virtual void scrollToVisible(Widget*) { }
+
+        virtual void focusIn(Widget*) { }
+        virtual void focusOut(Widget*) { }
 
-    enum Orientation {
-        Horizontal,
-        Vertical
+        virtual void clicked(Widget*) { }
+        virtual void valueChanged(Widget*) { }
+        virtual void selectionChanged(Widget*) { }
+
+        virtual void returnPressed(Widget*) { }
+        virtual void performSearch(Widget*) { }
+
+        virtual ElementImpl* element(Widget*) { return 0; }
+        virtual void sendConsumedMouseUp(Widget*) { }
+        virtual bool isVisible(Widget*) { return false; }
     };
-};
+
+}
 
 #endif
index bf01371117f9af08e64e77acbd167b7eb15f001e..f4c98c6ab932dc5be5cc1f3cb10d70dd5722cd56 100644 (file)
@@ -535,7 +535,7 @@ void GraphicsContext::drawText(int x, int y, int tabWidth, int xpos, int, int, i
     style.tabWidth = tabWidth;
     style.xpos = xpos;
     
-    if (alignmentFlags & Qt::AlignRight)
+    if (alignmentFlags == AlignRight)
         x -= lroundf([m_data->textRenderer floatWidthForRun:&run style:&style]);
 
     WebCoreTextGeometry geometry;
index 5f3182058b83851d1a746ba1383ab94b522bae3a..57925c2f742f79360e74f2b108f77570d80b5746 100644 (file)
@@ -27,6 +27,7 @@
 #import "Widget.h"
 
 #import "Cursor.h"
+#import "Font.h"
 #import "FoundationExtras.h"
 #import "GraphicsContext.h"
 #import "KWQExceptions.h"
@@ -35,7 +36,7 @@
 #import "WebCoreFrameBridge.h"
 #import "WebCoreFrameView.h"
 #import "WebCoreView.h"
-#import "render_replaced.h"
+#import "WidgetClient.h"
 
 namespace WebCore {
 
@@ -47,6 +48,7 @@ class WidgetPrivate
 public:
     Font font;
     NSView* view;
+    WidgetClient* client;
     bool visible;
     bool mustStayInWindow;
     bool removeFromSuperviewSoon;
@@ -55,6 +57,7 @@ public:
 Widget::Widget() : data(new WidgetPrivate)
 {
     data->view = nil;
+    data->client = 0;
     data->visible = true;
     data->mustStayInWindow = false;
     data->removeFromSuperviewSoon = false;
@@ -63,6 +66,7 @@ Widget::Widget() : data(new WidgetPrivate)
 Widget::Widget(NSView* view) : data(new WidgetPrivate)
 {
     data->view = KWQRetain(view);
+    data->client = 0;
     data->visible = true;
     data->mustStayInWindow = false;
     data->removeFromSuperviewSoon = false;
@@ -198,19 +202,18 @@ Widget::FocusPolicy Widget::focusPolicy() const
     // 2. be enabled
     // 3. accept first responder
 
-    RenderWidget *widget = const_cast<RenderWidget *>
-        (static_cast<const RenderWidget *>(eventFilterObject()));
-    if (widget->style()->visibility() != VISIBLE)
+    if (!client())
+        return NoFocus;
+    if (!client()->isVisible(const_cast<Widget*>(this)))
         return NoFocus;
-
     if (!isEnabled())
         return NoFocus;
-    
+
     KWQ_BLOCK_EXCEPTIONS;
     if (![getView() acceptsFirstResponder])
         return NoFocus;
     KWQ_UNBLOCK_EXCEPTIONS;
-    
+
     return TabFocus;
 }
 
@@ -369,12 +372,8 @@ void Widget::paint(GraphicsContext* p, const IntRect& r)
 
 void Widget::sendConsumedMouseUp()
 {
-    RenderWidget* widget = const_cast<RenderWidget *>
-        (static_cast<const RenderWidget *>(eventFilterObject()));
-
-    KWQ_BLOCK_EXCEPTIONS;
-    widget->sendConsumedMouseUp();
-    KWQ_UNBLOCK_EXCEPTIONS;
+    if (client())
+        client()->sendConsumedMouseUp(this);
 }
 
 void Widget::setIsSelected(bool isSelected)
@@ -447,4 +446,14 @@ void Widget::setDeferFirstResponderChanges(bool defer)
     }
 }
 
+void Widget::setClient(WidgetClient* c)
+{
+    data->client = c;
+}
+
+WidgetClient* Widget::client() const
+{
+    return data->client;
+}
+
 }
index 622b5f81b5c06f2927aa38ef55d5c59c765ce0bf..19fbcd552002996adae1ea6273afdcc3543d6c13 100644 (file)
@@ -64,7 +64,7 @@ void InlineTextBox::operator delete(void* ptr, size_t sz)
     assert(inInlineTextBoxDetach);
     
     // Stash size where destroy can find it.
-    *(size_t *)ptr = sz;
+    *static_cast<size_t*>(ptr) = sz;
 }
 
 bool InlineTextBox::checkVerticalPoint(int _y, int _ty, int _h)
index e9f3e2e22bf8898e8bc619ab988f47955f3cd776..eb31688fae06f2c2d7e14ec6891528bb25a34485 100644 (file)
@@ -84,7 +84,7 @@ void RenderApplet::createWidgetIfNecessary()
                     HTMLParamElementImpl* p = static_cast<HTMLParamElementImpl*>(child);
                     m_args.set(p->name(), p->value());
                 }
-            setQWidget(new KJavaAppletWidget(IntSize(width, height), element()->getDocument()->frame(), m_args));
+            setWidget(new KJavaAppletWidget(IntSize(width, height), element()->getDocument()->frame(), m_args));
         }
     }
 }
index c7d3a2911ba821dc9d4c3cdad1c5bb05cd18f16d..53ce82346dddd59bf4680be3ccfde62bbce8b109 100644 (file)
@@ -42,6 +42,7 @@
 #include "helper.h"
 #include <klocale.h>
 #include <qcombobox.h>
+#include <qtextedit.h>
 
 namespace WebCore {
 
@@ -95,16 +96,16 @@ void RenderFormElement::layout()
     setNeedsLayout(false);
 }
 
-void RenderFormElement::slotClicked()
+void RenderFormElement::clicked(Widget*)
 {
-    RenderArena *arena = ref();
+    RenderArenaarena = ref();
     MouseEvent event; // gets "current event"
     if (element())
         element()->dispatchMouseEvent(&event, clickEvent, event.clickCount());
     deref(arena);
 }
 
-Qt::AlignmentFlags RenderFormElement::textAlignment() const
+HorizontalAlignment RenderFormElement::textAlignment() const
 {
     switch (style()->textAlign()) {
         case LEFT:
@@ -149,17 +150,6 @@ void RenderFormElement::addIntrinsicMarginsIfAllowed(RenderStyle* _style)
     }
 }
 
-void RenderFormElement::slotTextChanged(const DOM::DOMString&)
-{
-    // do nothing
-}
-
-void RenderFormElement::slotSelectionChanged()
-{
-    // do nothing
-}
-
-
 // -------------------------------------------------------------------------------
 
 RenderImageButton::RenderImageButton(HTMLInputElementImpl *element)
@@ -187,34 +177,22 @@ RenderLineEdit::RenderLineEdit(HTMLInputElementImpl *element)
         default:
             type = QLineEdit::Normal;
     }
-    QLineEdit *edit = new QLineEdit(type);
+    QLineEditedit = new QLineEdit(type);
     if (type == QLineEdit::Search)
         edit->setLiveSearch(false);
-    connect(edit,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
-    connect(edit, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
-    connect(edit,SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const DOMString &)));
-    connect(edit,SIGNAL(clicked()),this,SLOT(slotClicked()));
-
-    connect(edit,SIGNAL(performSearch()), this, SLOT(slotPerformSearch()));
-
-
-    setQWidget(edit);
+    setWidget(edit);
 }
 
-void RenderLineEdit::slotSelectionChanged()
+void RenderLineEdit::selectionChanged(Widget*)
 {
-    QLineEdit* w = static_cast<QLineEdit*>(m_widget);
-    
     // We only want to call onselect if there actually is a selection
-    if (!w->hasSelectedText())
-        return;
-    
-    element()->onSelect();
+    QLineEdit* w = static_cast<QLineEdit*>(m_widget);
+    if (w->hasSelectedText())
+        element()->onSelect();
 }
 
-void RenderLineEdit::slotReturnPressed()
+void RenderLineEdit::returnPressed(Widget*)
 {
-
     // Emit onChange if necessary
     // Works but might not be enough, dirk said he had another solution at
     // hand (can't remember which) - David
@@ -223,12 +201,11 @@ void RenderLineEdit::slotReturnPressed()
         setEdited(false);
     }
 
-    HTMLFormElementImpl* fe = element()->form();
-    if ( fe )
+    if (HTMLFormElementImpl* fe = element()->form())
         fe->submitClick();
 }
 
-void RenderLineEdit::slotPerformSearch()
+void RenderLineEdit::performSearch(Widget*)
 {
     // Fire the "search" DOM event.
     element()->dispatchHTMLEvent(searchEvent, true, false);
@@ -309,16 +286,20 @@ void RenderLineEdit::updateFromElement()
     RenderFormElement::updateFromElement();
 }
 
-void RenderLineEdit::slotTextChanged(const DOMString &string)
+void RenderLineEdit::valueChanged(Widget*)
 {
     if (m_updating) // Don't alter the value if we are in the middle of initing the control, since
         return;     // we are getting the value from the DOM and it's not user input.
 
+    String newText = widget()->text();
+
     // A null string value is used to indicate that the form control has not altered the original
     // default value.  That means that we should never use the null string value when the user
     // empties a textfield, but should always force an empty textfield to use the empty string.
-    DOMString newText = string.isNull() ? "" : string;
-    newText.replace(backslashAsCurrencySymbol(), QChar('\\'));
+    if (newText.isNull())
+        newText = "";
+
+    newText.replace(backslashAsCurrencySymbol(), '\\');
     element()->setValueFromRenderer(newText);
 }
 
@@ -525,10 +506,7 @@ void RenderFieldset::setStyle(RenderStyle* _style)
 RenderFileButton::RenderFileButton(HTMLInputElementImpl *element)
     : RenderFormElement(element)
 {
-    KWQFileButton *w = new KWQFileButton(view()->frame());
-    connect(w, SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const DOMString &)));
-    connect(w, SIGNAL(clicked()), this, SLOT(slotClicked()));
-    setQWidget(w);
+    setWidget(new KWQFileButton(view()->frame()));
 }
 
 void RenderFileButton::calcMinMaxWidth()
@@ -545,12 +523,6 @@ void RenderFileButton::calcMinMaxWidth()
     RenderFormElement::calcMinMaxWidth();
 }
 
-
-void RenderFileButton::slotClicked()
-{
-    RenderFormElement::slotClicked();
-}
-
 void RenderFileButton::updateFromElement()
 {
     static_cast<KWQFileButton *>(widget())->setFilename(element()->value().qstring());
@@ -558,15 +530,15 @@ void RenderFileButton::updateFromElement()
     RenderFormElement::updateFromElement();
 }
 
-void RenderFileButton::slotReturnPressed()
+void RenderFileButton::returnPressed(Widget*)
 {
     if (element()->form())
         element()->form()->prepareSubmit();
 }
 
-void RenderFileButton::slotTextChanged(const DOMString &string)
+void RenderFileButton::valueChanged(Widget*)
 {
-    element()->m_value = string;
+    element()->m_value = static_cast<KWQFileButton*>(widget())->filename();
     element()->onChange();
 }
 
@@ -592,7 +564,7 @@ RenderLabel::RenderLabel(HTMLGenericFormElementImpl *element)
 // -------------------------------------------------------------------------
 
 RenderLegend::RenderLegend(HTMLGenericFormElementImpl *element)
-: RenderBlock(element)
+    : RenderBlock(element)
 {
 }
 
@@ -608,10 +580,10 @@ RenderSelect::RenderSelect(HTMLSelectElementImpl *element)
     m_selectionChanged = true;
     m_optionsChanged = true;
 
-    if(m_useListBox)
-        setQWidget(createListBox());
+    if (m_useListBox)
+        setWidget(createListBox());
     else
-        setQWidget(createComboBox());
+        setWidget(new QComboBox);
 }
 
 
@@ -649,10 +621,10 @@ void RenderSelect::updateFromElement()
             // type of select has changed
             delete m_widget;
 
-            if(m_useListBox)
-                setQWidget(createListBox());
+            if (m_useListBox)
+                setWidget(createListBox());
             else
-                setQWidget(createComboBox());
+                setWidget(new QComboBox);
             setWidgetWritingDirection();
         }
 
@@ -817,20 +789,21 @@ void RenderSelect::layout( )
     m_widget->setEnabled(foundOption && ! element()->disabled());
 }
 
-void RenderSelect::slotSelected(int index)
+void RenderSelect::valueChanged(Widget*)
 {
-    if ( m_ignoreSelectEvents ) return;
+    if (m_ignoreSelectEvents)
+        return;
 
-    KHTMLAssert( !m_useListBox );
+    KHTMLAssert(!m_useListBox);
 
-    Array<HTMLElementImpl*> listItems = element()->listItems();
-    if(index >= 0 && index < int(listItems.size()))
-    {
-        bool found = (listItems[index]->hasTagName(optionTag));
+    int index = static_cast<QComboBox*>(m_widget)->currentItem();
 
-        if ( !found ) {
+    Array<HTMLElementImpl*> listItems = element()->listItems();
+    if (index >= 0 && index < (int)listItems.size()) {
+        bool found = listItems[index]->hasTagName(optionTag);
+        if (!found) {
             // this one is not selectable,  we need to find an option element
-            while ( ( unsigned ) index < listItems.size() ) {
+            while ((unsigned) index < listItems.size()) {
                 if (listItems[index]->hasTagName(optionTag)) {
                     found = true;
                     break;
@@ -838,8 +811,8 @@ void RenderSelect::slotSelected(int index)
                 ++index;
             }
 
-            if ( !found ) {
-                while ( index >= 0 ) {
+            if (!found) {
+                while (index >= 0) {
                     if (listItems[index]->hasTagName(optionTag)) {
                         found = true;
                         break;
@@ -849,11 +822,11 @@ void RenderSelect::slotSelected(int index)
             }
         }
 
-        if ( found ) {
-            if ( index != static_cast<QComboBox*>( m_widget )->currentItem() )
-                static_cast<QComboBox*>( m_widget )->setCurrentItem( index );
+        if (found) {
+            if ( index != static_cast<QComboBox*>(m_widget)->currentItem() )
+                static_cast<QComboBox*>(m_widget)->setCurrentItem( index );
 
-            for ( unsigned int i = 0; i < listItems.size(); ++i )
+            for (unsigned i = 0; i < listItems.size(); ++i)
                 if (listItems[i]->hasTagName(optionTag) && i != (unsigned int) index)
                     static_cast<HTMLOptionElementImpl*>( listItems[i] )->m_selected = false;
 
@@ -865,15 +838,16 @@ void RenderSelect::slotSelected(int index)
 }
 
 
-void RenderSelect::slotSelectionChanged()
+void RenderSelect::selectionChanged(Widget*)
 {
-    if ( m_ignoreSelectEvents ) return;
+    if (m_ignoreSelectEvents)
+        return;
 
     // don't use listItems() here as we have to avoid recalculations - changing the
     // option list will make use update options not in the way the user expects them
     Array<HTMLElementImpl*> listItems = element()->m_listItems;
     int j = 0;
-    for ( unsigned i = 0; i < listItems.count(); i++ ) {
+    for (unsigned i = 0; i < listItems.count(); i++) {
         // don't use setSelected() here because it will cause us to be called
         // again with updateSelection.
         if (listItems[i]->hasTagName(optionTag))
@@ -895,20 +869,10 @@ QListBox* RenderSelect::createListBox()
 {
     QListBox *lb = new QListBox();
     lb->setSelectionMode(m_multiple ? QListBox::Extended : QListBox::Single);
-    connect( lb, SIGNAL( selectionChanged() ), this, SLOT( slotSelectionChanged() ) );
-    connect( lb, SIGNAL( clicked( QListBoxItem * ) ), this, SLOT( slotClicked() ) );
     m_ignoreSelectEvents = false;
-
     return lb;
 }
 
-QComboBox* RenderSelect::createComboBox()
-{
-    QComboBox* cb = new QComboBox;
-    connect(cb, SIGNAL(activated(int)), this, SLOT(slotSelected(int)));
-    return cb;
-}
-
 void RenderSelect::updateSelection()
 {
     Array<HTMLElementImpl*> listItems = element()->listItems();
@@ -962,12 +926,7 @@ RenderTextArea::RenderTextArea(HTMLTextAreaElementImpl *element)
     else
         edit->setWordWrap(QTextEdit::NoWrap);
 
-
-    setQWidget(edit);
-
-    connect(edit,SIGNAL(textChanged()),this,SLOT(slotTextChanged()));
-    connect(edit,SIGNAL(clicked()),this,SLOT(slotClicked()));
-    connect(edit,SIGNAL(selectionChanged()),this,SLOT(slotSelectionChanged()));
+    setWidget(edit);
 }
 
 void RenderTextArea::destroy()
@@ -1063,7 +1022,7 @@ String RenderTextArea::textWithHardLineBreaks()
     return txt.replace(backslashAsCurrencySymbol(), QChar('\\'));
 }
 
-void RenderTextArea::slotTextChanged()
+void RenderTextArea::valueChanged(Widget*)
 {
     if (m_updating)
         return;
@@ -1106,7 +1065,7 @@ void RenderTextArea::setSelectionRange(int start, int end)
     textEdit->setSelectionRange(start, end-start);
 }
 
-void RenderTextArea::slotSelectionChanged()
+void RenderTextArea::selectionChanged(Widget*)
 {
     QTextEdit* w = static_cast<QTextEdit*>(m_widget);
 
@@ -1120,12 +1079,9 @@ void RenderTextArea::slotSelectionChanged()
 // ---------------------------------------------------------------------------
 
 RenderSlider::RenderSlider(HTMLInputElementImpl* element)
-:RenderFormElement(element)
+    : RenderFormElement(element)
 {
-    QSlider* slider = new QSlider();
-    setQWidget(slider);
-    connect(slider, SIGNAL(sliderValueChanged()), this, SLOT(slotSliderValueChanged()));
-    connect(slider, SIGNAL(clicked()), this, SLOT(slotClicked()));
+    setWidget(new QSlider);
 }
 
 void RenderSlider::calcMinMaxWidth()
@@ -1176,9 +1132,9 @@ void RenderSlider::updateFromElement()
     RenderFormElement::updateFromElement();
 }
 
-void RenderSlider::slotSliderValueChanged()
+void RenderSlider::valueChanged(Widget*)
 {
-    QSlider* slider = (QSlider*)widget();
+    QSlider* slider = static_cast<QSlider*>(widget());
 
     double val = slider->value();
     const AtomicString& precision = element()->getAttribute(precisionAttr);
@@ -1193,10 +1149,4 @@ void RenderSlider::slotSliderValueChanged()
     element()->dispatchHTMLEvent(inputEvent, true, false);
 }
 
-void RenderSlider::slotClicked()
-{
-    // emit mouseClick event etc
-    RenderFormElement::slotClicked();
-}
-
 }
index e00418e7b3af1b9f0f3f842ed8798c5260a99994..219dd14b1ca0a8771510339dc7887cd7c39eea43 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
  *           (C) 2000 Dirk Mueller (mueller@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 RENDER_FORM_H
 #define RENDER_FORM_H
 
-#include "render_replaced.h"
-#include "render_image.h"
-#include "RenderBlock.h"
-
-#include <qtextedit.h>
-#include <qlineedit.h>
-
 #include "HTMLInputElementImpl.h"
 #include "HTMLSelectElementImpl.h"
 #include "HTMLTextAreaElementImpl.h"
+#include "RenderBlock.h"
+#include "render_image.h"
+#include "render_replaced.h"
+#include <qlineedit.h>
 
-class QComboBox;
 class QListBox;
 
 namespace WebCore {
@@ -50,7 +47,7 @@ class HTMLGenericFormElementImpl;
 class RenderFormElement : public khtml::RenderWidget
 {
 public:
-    RenderFormElement(DOM::HTMLGenericFormElementImpl* node);
+    RenderFormElement(HTMLGenericFormElementImpl* node);
     virtual ~RenderFormElement();
 
     virtual const char *renderName() const { return "RenderForm"; }
@@ -83,20 +80,16 @@ public:
     virtual void layout();
     virtual short baselinePosition( bool, bool ) const;
 
-    DOM::HTMLGenericFormElementImpl *element() const
-    { return static_cast<DOM::HTMLGenericFormElementImpl*>(RenderObject::element()); }
+    HTMLGenericFormElementImpl *element() const
+    { return static_cast<HTMLGenericFormElementImpl*>(RenderObject::element()); }
 
-public slots:
-    virtual void slotClicked();
-    virtual void slotSelectionChanged();
-    
-    // Hack to make KWQSlot code work.
-    virtual void slotTextChanged(const DOM::DOMString &string);
+private:
+    virtual void clicked(Widget*);
 
 protected:
     virtual bool isEditable() const { return false; }
 
-    AlignmentFlags textAlignment() const;
+    WebCore::HorizontalAlignment textAlignment() const;
 };
 
 // -------------------------------------------------------------------------
@@ -104,7 +97,7 @@ protected:
 class RenderImageButton : public RenderImage
 {
 public:
-    RenderImageButton(DOM::HTMLInputElementImpl *element);
+    RenderImageButton(HTMLInputElementImpl *element);
 
     virtual const char *renderName() const { return "RenderImageButton"; }
     virtual bool isImageButton() const { return true; }
@@ -115,7 +108,7 @@ public:
 class RenderLineEdit : public RenderFormElement
 {
 public:
-    RenderLineEdit(DOM::HTMLInputElementImpl *element);
+    RenderLineEdit(HTMLInputElementImpl *element);
 
     virtual void calcMinMaxWidth();
     int calcReplacedHeight() const { return intrinsicHeight(); }
@@ -137,18 +130,18 @@ public:
     void setSelectionRange(int, int);
 
     QLineEdit *widget() const { return static_cast<QLineEdit*>(m_widget); }
-    DOM::HTMLInputElementImpl* element() const
-    { return static_cast<DOM::HTMLInputElementImpl*>(RenderObject::element()); }
-
-public slots:
-    void slotReturnPressed();
-    void slotTextChanged(const DOM::DOMString &string);
-    void slotSelectionChanged();
-    void slotPerformSearch();
+    HTMLInputElementImpl* element() const
+    { return static_cast<HTMLInputElementImpl*>(RenderObject::element()); }
+
 public:
     void addSearchResult();
 
 private:
+    virtual void returnPressed(Widget*);
+    virtual void valueChanged(Widget*);
+    virtual void selectionChanged(Widget*);
+    virtual void performSearch(Widget*);
+
     virtual bool isEditable() const { return true; }
 
     bool m_updating;
@@ -178,7 +171,7 @@ private:
 class RenderFileButton : public RenderFormElement
 {
 public:
-    RenderFileButton(DOM::HTMLInputElementImpl *element);
+    RenderFileButton(HTMLInputElementImpl *element);
 
     virtual const char *renderName() const { return "RenderFileButton"; }
     virtual void calcMinMaxWidth();
@@ -187,27 +180,25 @@ public:
 
     int calcReplacedHeight() const { return intrinsicHeight(); }
 
-    DOM::HTMLInputElementImpl *element() const
-    { return static_cast<DOM::HTMLInputElementImpl*>(RenderObject::element()); }
+    HTMLInputElementImpl *element() const
+    { return static_cast<HTMLInputElementImpl*>(RenderObject::element()); }
 
     void click(bool sendMouseEvents);
 
-public slots:
-    virtual void slotClicked();
-    virtual void slotReturnPressed();
-    virtual void slotTextChanged(const DOM::DOMString &string);
-
 protected:
     virtual bool isEditable() const { return true; }
-};
 
+private:
+    virtual void returnPressed(Widget*);
+    virtual void valueChanged(Widget*);
+};
 
 // -------------------------------------------------------------------------
 
 class RenderLabel : public RenderFormElement
 {
 public:
-    RenderLabel(DOM::HTMLGenericFormElementImpl *element);
+    RenderLabel(HTMLGenericFormElementImpl *element);
 
     virtual const char *renderName() const { return "RenderLabel"; }
 };
@@ -218,7 +209,7 @@ public:
 class RenderLegend : public RenderBlock
 {
 public:
-    RenderLegend(DOM::HTMLGenericFormElementImpl *element);
+    RenderLegend(HTMLGenericFormElementImpl *element);
 
     virtual const char *renderName() const { return "RenderLegend"; }
 };
@@ -228,7 +219,7 @@ public:
 class RenderSelect : public RenderFormElement
 {
 public:
-    RenderSelect(DOM::HTMLSelectElementImpl *element);
+    RenderSelect(HTMLSelectElementImpl *element);
 
     virtual const char *renderName() const { return "RenderSelect"; }
 
@@ -248,12 +239,11 @@ public:
 
     void updateSelection();
 
-    DOM::HTMLSelectElementImpl *element() const
-    { return static_cast<DOM::HTMLSelectElementImpl*>(RenderObject::element()); }
+    HTMLSelectElementImpl *element() const
+    { return static_cast<HTMLSelectElementImpl*>(RenderObject::element()); }
 
 protected:
     QListBox *createListBox();
-    QComboBox *createComboBox();
     void setWidgetWritingDirection();
 
     unsigned  m_size;
@@ -263,9 +253,9 @@ protected:
     bool m_ignoreSelectEvents;
     bool m_optionsChanged;
 
-protected slots:
-    void slotSelected(int index);
-    void slotSelectionChanged();
+private:
+    virtual void valueChanged(Widget*);
+    virtual void selectionChanged(Widget*);
 };
 
 // -------------------------------------------------------------------------
@@ -273,7 +263,7 @@ protected slots:
 class RenderTextArea : public RenderFormElement
 {
 public:
-    RenderTextArea(DOM::HTMLTextAreaElementImpl *element);
+    RenderTextArea(HTMLTextAreaElementImpl *element);
 
     virtual void destroy();
 
@@ -287,8 +277,8 @@ public:
     void setEdited (bool);
     
     // don't even think about making this method virtual!
-    DOM::HTMLTextAreaElementImpl* element() const
-    { return static_cast<DOM::HTMLTextAreaElementImpl*>(RenderObject::element()); }
+    HTMLTextAreaElementImpl* element() const
+    { return static_cast<HTMLTextAreaElementImpl*>(RenderObject::element()); }
 
     String text();
     String textWithHardLineBreaks();
@@ -303,9 +293,9 @@ public:
     
     virtual bool canHaveIntrinsicMargins() const { return true; }
 
-protected slots:
-    void slotTextChanged();
-    void slotSelectionChanged();
+private:
+    virtual void valueChanged(Widget*);
+    virtual void selectionChanged(Widget*);
     
 protected:
     virtual bool isEditable() const { return true; }
@@ -319,21 +309,20 @@ protected:
 class RenderSlider : public RenderFormElement
 {
 public:
-    RenderSlider(DOM::HTMLInputElementImpl *element);
+    RenderSlider(HTMLInputElementImpl *element);
     
-    DOM::HTMLInputElementImpl* element() const
-    { return static_cast<DOM::HTMLInputElementImpl*>(RenderObject::element()); }
+    HTMLInputElementImpl* element() const
+    { return static_cast<HTMLInputElementImpl*>(RenderObject::element()); }
 
     virtual const char *renderName() const { return "RenderSlider"; }
     virtual bool canHaveIntrinsicMargins() const { return true; }
     virtual void calcMinMaxWidth();
     virtual void updateFromElement();
 
-protected slots:
-    void slotSliderValueChanged();
-    void slotClicked();
+private:
+    virtual void valueChanged(Widget*);
 };
 
-}; //namespace
+} //namespace
 
 #endif
index 8d4dac90e54932ed5ff6421723fefe32ed9d7eea..6dcf0b152657353ba708996122d6a2f421f2b62b 100644 (file)
@@ -585,8 +585,8 @@ void RenderFrameSet::dump(QTextStream *stream, QString ind) const
 
 /**************************************************************************************/
 
-RenderPart::RenderPart(DOM::HTMLElementImpl* node)
-    : RenderWidget(node)
+RenderPart::RenderPart(HTMLElementImpl* node)
+    : RenderWidget(node), m_frame(0)
 {
     // init RenderObject attributes
     setInline(false);
@@ -594,41 +594,57 @@ RenderPart::RenderPart(DOM::HTMLElementImpl* node)
 
 RenderPart::~RenderPart()
 {
-    if (m_widget && m_widget->isFrameView())
-        static_cast<FrameView*>(m_widget)->deref();
+    // Must call this here because by the time we get to ~RenderWidget,
+    // the RenderPart will be destroyed and it won't call our version
+    // of deleteWidget.
+    deleteWidget();
+    m_widget = 0;
+
+    setFrame(0);
 }
 
-void RenderPart::setWidget(Widget* widget)
+void RenderPart::setFrame(Frame* frame)
 {
-    if (widget == m_widget)
+    if (frame == m_frame)
         return;
+    if (m_frame)
+        m_frame->disconnectOwnerRenderer();
+    m_frame = frame;
+}
 
-    if (m_widget && m_widget->isFrameView())
-        static_cast<FrameView*>(m_widget)->deref();
-    
-    if (widget && widget->isFrameView()) {
-        static_cast<FrameView*>(widget)->ref();
-        setQWidget(widget, false);
-    } else {
-        setQWidget(widget);
+void RenderPart::setWidget(Widget* widget)
+{
+    if (widget != m_widget) {
+        if (widget && widget->isFrameView())
+            static_cast<FrameView*>(widget)->ref();
+        RenderWidget::setWidget(widget);
+
+        setNeedsLayoutAndMinMaxRecalc();
+
+        // make sure the scrollbars are set correctly for restore
+        // ### find better fix
+        viewCleared();
     }
-    setNeedsLayoutAndMinMaxRecalc();
-    
-    // make sure the scrollbars are set correctly for restore
-    // ### find better fix
-    viewCleared();
 }
 
 void RenderPart::viewCleared()
 {
 }
 
+void RenderPart::deleteWidget()
+{
+    if (m_widget && m_widget->isFrameView())
+        static_cast<FrameView*>(m_widget)->deref();
+    else
+        delete m_widget;
+}
+
 /***************************************************************************************/
 
-RenderFrame::RenderFrame( DOM::HTMLFrameElementImpl *frame )
+RenderFrame::RenderFrame(HTMLFrameElementImpl* frame)
     : RenderPart(frame)
 {
-    setInline( false );
+    setInline(false);
 }
 
 void RenderFrame::viewCleared()
@@ -650,8 +666,8 @@ void RenderFrame::viewCleared()
 
 /****************************************************************************************/
 
-RenderPartObject::RenderPartObject( DOM::HTMLElementImpl* element )
-    : RenderPart( element )
+RenderPartObject::RenderPartObject(HTMLElementImpl* element)
+    : RenderPart(element)
 {
     // init RenderObject attributes
     setInline(true);
@@ -865,11 +881,10 @@ void RenderPartObject::updateWidget()
   }
 }
 
-void RenderPartObject::layout( )
+void RenderPartObject::layout()
 {
-    KHTMLAssert( needsLayout() );
-    KHTMLAssert( minMaxKnown() );
-
+    KHTMLAssert(needsLayout());
+    KHTMLAssert(minMaxKnown());
 
     calcWidth();
     calcHeight();
index 9a80ebb02f5d3e98971b792cab0a851dbe60a3ef..ebbf99f857868149e063df0b77e8d1de1b864cfe 100644 (file)
@@ -85,15 +85,15 @@ private:
     bool m_clientResizing;
 };
 
-class RenderPart : public RenderWidget
-{
+class RenderPart : public RenderWidget {
 public:
     RenderPart(HTMLElementImpl*);
     virtual ~RenderPart();
     
     virtual const char* renderName() const { return "RenderPart"; }
 
-    virtual void setWidget(Widget*);
+    void setFrame(Frame*);
+    void setWidget(Widget*);
 
     // FIXME: This should not be necessary.
     // Remove this once WebKit knows to properly schedule layouts using WebCore when objects resize.
@@ -105,6 +105,11 @@ public:
 
 protected:
     bool m_hasFallbackContent;
+
+private:
+    virtual void deleteWidget();
+
+    Frame* m_frame;
 };
 
 class RenderFrame : public RenderPart
index 0f76bee169661528045dbbe6182f3b723aaa51bf..bc92e3b4215cd0674c4bda419e004c51d053a7df 100644 (file)
@@ -104,11 +104,6 @@ void ClipRects::destroy(RenderArena* renderArena)
     renderArena->free(*(size_t *)this, this);
 }
 
-void RenderScrollMediator::slotValueChanged(int val)
-{
-    m_layer->updateScrollPositionFromScrollbars();
-}
-
 RenderLayer::RenderLayer(RenderObject* object)
 : m_object( object ),
 m_parent( 0 ),
@@ -130,7 +125,6 @@ m_scrollWidth( 0 ),
 m_scrollHeight( 0 ),
 m_hBar( 0 ),
 m_vBar( 0 ),
-m_scrollMediator( 0 ),
 m_posZOrderList( 0 ),
 m_negZOrderList( 0 ),
 m_clipRects( 0 ) ,
@@ -147,7 +141,6 @@ RenderLayer::~RenderLayer()
     // our destructor doesn't have to do anything.
     delete m_hBar;
     delete m_vBar;
-    delete m_scrollMediator;
     delete m_posZOrderList;
     delete m_negZOrderList;
     delete m_marquee;
@@ -709,8 +702,10 @@ IntRect RenderLayer::getRectToExpose(const IntRect &visibleRect, const IntRect &
     return IntRect(IntPoint(x, y), visibleRect.size());
 }
 
-void RenderLayer::updateScrollPositionFromScrollbars()
+void RenderLayer::valueChanged(Widget*)
 {
+    // Update scroll position from scroll bars.
+
     bool needUpdate = false;
     int newX = scrollXOffset();
     int newY = m_scrollY;
@@ -736,18 +731,12 @@ RenderLayer::setHasHorizontalScrollbar(bool hasScrollbar)
 {
     if (hasScrollbar && !m_hBar) {
         FrameView* scrollView = m_object->element()->getDocument()->view();
-        m_hBar = new QScrollBar(Qt::Horizontal, 0);
+        m_hBar = new QScrollBar(HorizontalScrollBar);
+        m_hBar->setClient(this);
         scrollView->addChild(m_hBar, 0, -50000);
-        if (!m_scrollMediator)
-            m_scrollMediator = new RenderScrollMediator(this);
-        m_scrollMediator->connect(m_hBar, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
-    }
-    else if (!hasScrollbar && m_hBar) {
+    } else if (!hasScrollbar && m_hBar) {
         FrameView* scrollView = m_object->element()->getDocument()->view();
-        scrollView->removeChild (m_hBar);
-
-        m_scrollMediator->disconnect(m_hBar, SIGNAL(valueChanged(int)),
-                                     m_scrollMediator, SLOT(slotValueChanged(int)));
+        scrollView->removeChild(m_hBar);
         delete m_hBar;
         m_hBar = 0;
     }
@@ -758,18 +747,12 @@ RenderLayer::setHasVerticalScrollbar(bool hasScrollbar)
 {
     if (hasScrollbar && !m_vBar) {
         FrameView* scrollView = m_object->element()->getDocument()->view();
-        m_vBar = new QScrollBar(Qt::Vertical, 0);
+        m_vBar = new QScrollBar(VerticalScrollBar);
+        m_vBar->setClient(this);
         scrollView->addChild(m_vBar, 0, -50000);
-        if (!m_scrollMediator)
-            m_scrollMediator = new RenderScrollMediator(this);
-        m_scrollMediator->connect(m_vBar, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
-    }
-    else if (!hasScrollbar && m_vBar) {
+    } else if (!hasScrollbar && m_vBar) {
         FrameView* scrollView = m_object->element()->getDocument()->view();
-        scrollView->removeChild (m_vBar);
-
-        m_scrollMediator->disconnect(m_vBar, SIGNAL(valueChanged(int)),
-                                     m_scrollMediator, SLOT(slotValueChanged(int)));
+        scrollView->removeChild(m_vBar);
         delete m_vBar;
         m_vBar = 0;
     }
@@ -1107,9 +1090,8 @@ RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* p,
 bool
 RenderLayer::hitTest(RenderObject::NodeInfo& info, int x, int y)
 {
-    // Clear our our scrollbar variable
-    RenderLayer::gScrollBar = 0;
-    
+    gScrollBar = 0;
+
     renderer()->document()->updateLayout();
     
     IntRect damageRect(m_x, m_y, width(), height());
index 5eb359fb8302e9eadf53d5e2b5ef89df350e88d3..a8374cadaf06477bbe2250b386731c462fc6bdee 100644 (file)
@@ -47,6 +47,7 @@
 #include "Color.h"
 #include "IntRect.h"
 #include "Timer.h"
+#include "WidgetClient.h"
 #include "render_object.h"
 #include <assert.h>
 #include <kxmlcore/Vector.h>
@@ -63,17 +64,6 @@ class RenderStyle;
 class RenderTable;
 class RenderText;
 
-class RenderScrollMediator : public QObject
-{
-public:
-    RenderScrollMediator(RenderLayer* layer) : m_layer(layer) {}
-
-    void slotValueChanged(int);
-    
-private:
-    RenderLayer* m_layer;
-};
-
 class ClipRects
 {
 public:
@@ -154,8 +144,7 @@ private:
     EMarqueeDirection m_direction : 4;
 };
 
-class RenderLayer
-{
+class RenderLayer : WidgetClient {
 public:
     enum ScrollBehavior {
         noScroll,
@@ -185,19 +174,19 @@ public:
 
     static QScrollBar* gScrollBar;
     
-    RenderLayer(RenderObject* object);
+    RenderLayer(RenderObject*);
     ~RenderLayer();
     
     RenderObject* renderer() const { return m_object; }
-    RenderLayer *parent() const { return m_parent; }
-    RenderLayer *previousSibling() const { return m_previous; }
-    RenderLayer *nextSibling() const { return m_next; }
+    RenderLayerparent() const { return m_parent; }
+    RenderLayerpreviousSibling() const { return m_previous; }
+    RenderLayernextSibling() const { return m_next; }
 
-    RenderLayer *firstChild() const { return m_first; }
-    RenderLayer *lastChild() const { return m_last; }
+    RenderLayerfirstChild() const { return m_first; }
+    RenderLayerlastChild() const { return m_last; }
 
-    void addChild(RenderLayer *newChild, RenderLayer* beforeChild = 0);
-    RenderLayer* removeChild(RenderLayer *oldChild);
+    void addChild(RenderLayernewChild, RenderLayer* beforeChild = 0);
+    RenderLayer* removeChild(RenderLayer*);
 
     void removeOnlyThisLayer();
     void insertOnlyThisLayer();
@@ -256,7 +245,6 @@ public:
     void paintScrollbars(GraphicsContext*, const IntRect& damageRect);
     void updateScrollInfoAfterLayout();
     void slotValueChanged(int);
-    void updateScrollPositionFromScrollbars();
     bool scroll(KWQScrollDirection direction, KWQScrollGranularity granularity, float multiplier=1.0);
     
     void updateLayerPosition();
@@ -338,6 +326,8 @@ private:
         int x, int y, const IntRect& hitTestRect);
     void computeScrollDimensions(bool* needHBar = 0, bool* needVBar = 0);
 
+    virtual void valueChanged(Widget*);
+
 protected:   
     RenderObject* m_object;
     
@@ -378,7 +368,6 @@ protected:
     // For layers with overflow, we have a pair of scrollbars.
     QScrollBar* m_hBar;
     QScrollBar* m_vBar;
-    RenderScrollMediator* m_scrollMediator;
 
     // For layers that establish stacking contexts, m_posZOrderList holds a sorted list of all the
     // descendant layers within the stacking context that have z-indices of 0 or greater
index 011eedbf83540fc140cbe658b947093511cd26c9..73c73d4686821f715fa2cdef84e92ec402315554 100644 (file)
@@ -423,7 +423,7 @@ void RenderListMarker::paint(PaintInfo& i, int _tx, int _ty)
     }
 
 #ifdef BOX_DEBUG
-    p->setPen( Qt::red );
+    p->setPen( red );
     p->drawRect(box.x(), box.y(), box.width(), box.height());
 #endif
 
@@ -450,19 +450,19 @@ void RenderListMarker::paint(PaintInfo& i, int _tx, int _ty)
             const Font& font = style()->font();
             if (isInside()) {
                if( style()->direction() == LTR) {
-                    p->drawText(marker.x(), marker.y(), 0, 0, 0, 0, Qt::AlignLeft, m_item);
-                    p->drawText(marker.x() + font.width(m_item), marker.y(), 0, 0, 0, 0, Qt::AlignLeft, ". ");
+                    p->drawText(marker.x(), marker.y(), 0, 0, 0, 0, AlignLeft, m_item);
+                    p->drawText(marker.x() + font.width(m_item), marker.y(), 0, 0, 0, 0, AlignLeft, ". ");
                 } else {
-                    p->drawText(marker.x(), marker.y(), 0, 0, 0, 0, Qt::AlignLeft, " .");
-                   p->drawText(marker.x() + font.width(" ."), marker.y(), 0, 0, 0, 0, Qt::AlignLeft, m_item);
+                    p->drawText(marker.x(), marker.y(), 0, 0, 0, 0, AlignLeft, " .");
+                   p->drawText(marker.x() + font.width(" ."), marker.y(), 0, 0, 0, 0, AlignLeft, m_item);
                 }
             } else {
                 if (style()->direction() == LTR) {
-                    p->drawText(marker.x(), marker.y(), 0, 0, 0, 0, Qt::AlignRight, ". ");
-                    p->drawText(marker.x() - font.width(". "), marker.y(), 0, 0, 0, 0, Qt::AlignRight, m_item);
+                    p->drawText(marker.x(), marker.y(), 0, 0, 0, 0, AlignRight, ". ");
+                    p->drawText(marker.x() - font.width(". "), marker.y(), 0, 0, 0, 0, AlignRight, m_item);
                 } else {
-                   p->drawText(marker.x(), marker.y(), 0, 0, 0, 0, Qt::AlignLeft, " .");
-                    p->drawText(marker.x() + font.width(" ."), marker.y(), 0, 0, 0, 0, Qt::AlignLeft, m_item);
+                   p->drawText(marker.x(), marker.y(), 0, 0, 0, 0, AlignLeft, " .");
+                    p->drawText(marker.x() + font.width(" ."), marker.y(), 0, 0, 0, 0, AlignLeft, m_item);
                 }
             }
         }
index bde0c768096c82e6aab02a542ea8619503ac01f6..b85690a0b02e3d221f6d3422d8141cadc23af5a3 100644 (file)
@@ -237,9 +237,8 @@ Color RenderReplaced::selectionColor(GraphicsContext* p) const
 // -----------------------------------------------------------------------------
 
 RenderWidget::RenderWidget(DOM::NodeImpl* node)
-      : RenderReplaced(node),
-        m_deleteWidget(false),
-        m_refCount(0)
+      : RenderReplaced(node)
+      , m_refCount(0)
 {
     m_widget = 0;
     // a replaced element doesn't support being anonymous
@@ -270,8 +269,7 @@ void RenderWidget::destroy()
     if (m_widget) {
         if (m_view)
             m_view->removeChild(m_widget);
-
-        m_widget->removeEventFilter();
+        m_widget->setClient(0);
     }
 
     RenderLayer* layer = m_layer;
@@ -290,9 +288,7 @@ void RenderWidget::destroy()
 RenderWidget::~RenderWidget()
 {
     KHTMLAssert(m_refCount <= 0);
-
-    if (m_deleteWidget)
-        delete m_widget;
+    deleteWidget();
 }
 
 void RenderWidget::resizeWidget(Widget* widget, int w, int h)
@@ -306,17 +302,16 @@ void RenderWidget::resizeWidget(Widget* widget, int w, int h)
     }
 }
 
-void RenderWidget::setQWidget(Widget* widget, bool deleteWidget)
+void RenderWidget::setWidget(Widget* widget)
 {
     if (widget != m_widget) {
         if (m_widget) {
-            m_widget->removeEventFilter();
-            if (m_deleteWidget)
-                delete m_widget;
+            m_widget->setClient(0);
+            deleteWidget();
         }
         m_widget = widget;
         if (m_widget) {
-            m_widget->installEventFilter(this);
+            m_widget->setClient(this);
             // if we've already received a layout, apply the calculated space to the
             // widget immediately, but we have to have really been full constructed (with a non-null
             // style pointer).
@@ -335,21 +330,20 @@ void RenderWidget::setQWidget(Widget* widget, bool deleteWidget)
             m_view->addChild(m_widget, -500000, 0);
         }
     }
-    m_deleteWidget = deleteWidget;
 }
 
-void RenderWidget::layout( )
+void RenderWidget::layout()
 {
-    KHTMLAssert( needsLayout() );
-    KHTMLAssert( minMaxKnown() );
+    KHTMLAssert(needsLayout());
+    KHTMLAssert(minMaxKnown());
 
     setNeedsLayout(false);
 }
 
-void RenderWidget::sendConsumedMouseUp()
+void RenderWidget::sendConsumedMouseUp(Widget*)
 {
-    RenderArena *arena = ref();
-    element()->dispatchSimulatedMouseEvent(mouseupEvent);
+    RenderArenaarena = ref();
+    node()->dispatchSimulatedMouseEvent(mouseupEvent);
     deref(arena);
 }
 
@@ -393,22 +387,39 @@ void RenderWidget::paint(PaintInfo& i, int _tx, int _ty)
         i.p->fillRect(selectionRect(), selectionColor(i.p));
 }
 
-void RenderWidget::eventFilterFocusIn() const
+void RenderWidget::focusIn(Widget*)
 {
-    RenderArena* arena = const_cast<RenderWidget*>(this)->ref();
+    RenderArena* arena = ref();
     RefPtr<NodeImpl> elem = element();
     if (elem)
         elem->getDocument()->setFocusNode(elem);
-    const_cast<RenderWidget*>(this)->deref(arena);
+    deref(arena);
 }
 
-void RenderWidget::eventFilterFocusOut() const
+void RenderWidget::focusOut(Widget*)
 {
-    RenderArena* arena = const_cast<RenderWidget*>(this)->ref();
+    RenderArena* arena = ref();
     RefPtr<NodeImpl> elem = element();
     if (elem && elem == elem->getDocument()->focusNode())
         elem->getDocument()->setFocusNode(0);
-    const_cast<RenderWidget*>(this)->deref(arena);
+    deref(arena);
+}
+
+void RenderWidget::scrollToVisible(Widget* widget)
+{
+    if (RenderLayer* layer = enclosingLayer())
+        layer->scrollRectToVisible(absoluteBoundingBoxRect());
+}
+
+bool RenderWidget::isVisible(Widget* widget)
+{
+    return style()->visibility() == VISIBLE;
+}
+
+ElementImpl* RenderWidget::element(Widget* widget)
+{
+    NodeImpl* n = node();
+    return n->isElementNode() ? static_cast<ElementImpl*>(n) : 0;
 }
 
 void RenderWidget::deref(RenderArena *arena)
@@ -458,4 +469,9 @@ void RenderWidget::setSelectionState(SelectionState s)
     }
 }
 
+void RenderWidget::deleteWidget()
+{
+    delete m_widget;
+}
+
 }
index cce279056453f54a06128ddb9b7c82314c342265..2c7c5af30416f8ffeaa55ffd8645dc9f4b294180 100644 (file)
@@ -24,8 +24,8 @@
 #ifndef render_replaced_h
 #define render_replaced_h
 
+#include "WidgetClient.h"
 #include "render_box.h"
-#include <qobject.h>
 
 namespace WebCore {
 
@@ -74,7 +74,7 @@ protected:
 };
 
 
-class RenderWidget : public QObject, public RenderReplaced
+class RenderWidget : public RenderReplaced, public WidgetClient
 {
 public:
     RenderWidget(NodeImpl*);
@@ -97,20 +97,28 @@ public:
     
     virtual void setSelectionState(SelectionState);
 
-    void sendConsumedMouseUp();
     virtual void updateWidgetPosition();
 
-    void setQWidget(Widget*, bool deleteWidget = true);
+    virtual void setWidget(Widget*);
 
-protected:
-    virtual void eventFilterFocusIn() const;
-    virtual void eventFilterFocusOut() const;
+    using RenderReplaced::element;
+
+private:
+    virtual void focusIn(Widget*);
+    virtual void focusOut(Widget*);
+    virtual void scrollToVisible(Widget*);
+    virtual ElementImpl* element(Widget*);
+    virtual bool isVisible(Widget*);
+    virtual void sendConsumedMouseUp(Widget*);
 
     void resizeWidget(Widget*, int w, int h);
 
-    bool m_deleteWidget;
+    virtual void deleteWidget();
+
+protected:
     Widget* m_widget;
     FrameView* m_view;
+private:
     int m_refCount;
 };
 
index a6a0608d1b4d84da4024bd1afcc54e063ee956c2..cbb4c23426ed3360a8eafe9751a7a1f6a46dda68 100644 (file)
@@ -42,6 +42,44 @@ namespace WebCore {
 
 using namespace EventNames;
 
+typedef HashSet<XMLHttpRequest*> RequestsSet;
+
+static HashMap<DocumentImpl*, RequestsSet*>& requestsByDocument()
+{
+    static HashMap<DocumentImpl*, RequestsSet*> map;
+    return map;
+}
+
+static void addToRequestsByDocument(DocumentImpl* doc, XMLHttpRequest* req)
+{
+    ASSERT(doc);
+    ASSERT(req);
+
+    RequestsSet* requests = requestsByDocument().get(doc);
+    if (!requests) {
+        requests = new RequestsSet;
+        requestsByDocument().set(doc, requests);
+    }
+
+    ASSERT(!requests->contains(req));
+    requests->add(req);
+}
+
+static void removeFromRequestsByDocument(DocumentImpl* doc, XMLHttpRequest* req)
+{
+    ASSERT(doc);
+    ASSERT(req);
+
+    RequestsSet* requests = requestsByDocument().get(doc);
+    ASSERT(requests);
+    ASSERT(requests->contains(req));
+    requests->remove(req);
+    if (requests->isEmpty()) {
+        requestsByDocument().remove(doc);
+        delete requests;
+    }
+}
+
 static inline QString getMIMEType(const QString& contentTypeString)
 {
     return QStringList::split(";", contentTypeString, true)[0].stripWhiteSpace();
@@ -91,7 +129,7 @@ XMLHttpRequestState XMLHttpRequest::getReadyState() const
     return state;
 }
 
-DOMString XMLHttpRequest::getResponseText() const
+String XMLHttpRequest::getResponseText() const
 {
     return response;
 }
@@ -99,17 +137,17 @@ DOMString XMLHttpRequest::getResponseText() const
 DocumentImpl* XMLHttpRequest::getResponseXML() const
 {
     if (state != Completed)
-      return 0;
+        return 0;
 
     if (!createdDocument) {
-      if (responseIsXML()) {
-        responseXML = doc->implementation()->createDocument();
-        responseXML->open();
-        responseXML->write(response);
-        responseXML->finishParsing();
-        responseXML->close();
-      }
-      createdDocument = true;
+        if (responseIsXML()) {
+            responseXML = doc->implementation()->createDocument();
+            responseXML->open();
+            responseXML->write(response);
+            responseXML->finishParsing();
+            responseXML->close();
+        }
+        createdDocument = true;
     }
 
     return responseXML.get();
@@ -136,13 +174,21 @@ void XMLHttpRequest::setOnLoadListener(EventListener* eventListener)
 }
 
 XMLHttpRequest::XMLHttpRequest(DocumentImpl *d)
-  : doc(d),
-    async(true),
-    job(0),
-    state(Uninitialized),
-    createdDocument(false),
-    aborted(false)
+    : doc(d)
+    , async(true)
+    , job(0)
+    , state(Uninitialized)
+    , createdDocument(false)
+    , aborted(false)
+{
+    ASSERT(doc);
+    addToRequestsByDocument(doc, this);
+}
+
+XMLHttpRequest::~XMLHttpRequest()
 {
+    if (doc)
+        removeFromRequestsByDocument(doc, this);
 }
 
 void XMLHttpRequest::changeState(XMLHttpRequestState newState)
@@ -156,17 +202,17 @@ void XMLHttpRequest::changeState(XMLHttpRequestState newState)
 void XMLHttpRequest::callReadyStateChangeListener()
 {
     if (doc && doc->frame() && m_onReadyStateChangeListener) {
-      int ignoreException;
-      RefPtr<EventImpl> ev = doc->createEvent("HTMLEvents", ignoreException);
-      ev->initEvent(readystatechangeEvent, true, true);
-      m_onReadyStateChangeListener->handleEvent(ev.get(), true);
+        ExceptionCode ec;
+        RefPtr<EventImpl> ev = doc->createEvent("HTMLEvents", ec);
+        ev->initEvent(readystatechangeEvent, true, true);
+        m_onReadyStateChangeListener->handleEvent(ev.get(), true);
     }
     
     if (doc && doc->frame() && state == Completed && m_onLoadListener) {
-      int ignoreException;
-      RefPtr<EventImpl> ev = doc->createEvent("HTMLEvents", ignoreException);
-      ev->initEvent(loadEvent, true, true);
-      m_onLoadListener->handleEvent(ev.get(), true);
+        ExceptionCode ec;
+        RefPtr<EventImpl> ev = doc->createEvent("HTMLEvents", ec);
+        ev->initEvent(loadEvent, true, true);
+        m_onLoadListener->handleEvent(ev.get(), true);
     }
 }
 
@@ -174,210 +220,197 @@ bool XMLHttpRequest::urlMatchesDocumentDomain(const KURL& _url) const
 {
   KURL documentURL(doc->URL());
 
-  // a local file can load anything
-  if (documentURL.protocol().lower() == "file") {
-    return true;
-  }
+    // a local file can load anything
+    if (documentURL.protocol().lower() == "file")
+        return true;
 
-  // but a remote document can only load from the same port on the server
-  if (documentURL.protocol().lower() == _url.protocol().lower() &&
-      documentURL.host().lower() == _url.host().lower() &&
-      documentURL.port() == _url.port()) {
-    return true;
-  }
+    // but a remote document can only load from the same port on the server
+    if (documentURL.protocol().lower() == _url.protocol().lower()
+            && documentURL.host().lower() == _url.host().lower()
+            && documentURL.port() == _url.port())
+        return true;
 
-  return false;
+    return false;
 }
 
-void XMLHttpRequest::open(const DOMString& _method, const KURL& _url, bool _async, const DOMString& user, const DOMString& password)
+void XMLHttpRequest::open(const String& _method, const KURL& _url, bool _async, const String& user, const String& password)
 {
-  abort();
-  aborted = false;
+    abort();
+    aborted = false;
 
-  // clear stuff from possible previous load
-  requestHeaders = QString();
-  responseHeaders = QString();
-  response = QString();
-  createdDocument = false;
-  responseXML = 0;
+    // clear stuff from possible previous load
+    requestHeaders = QString();
+    responseHeaders = QString();
+    response = QString();
+    createdDocument = false;
+    responseXML = 0;
 
-  changeState(Uninitialized);
+    changeState(Uninitialized);
 
-  if (aborted) {
-    return;
-  }
+    if (aborted)
+        return;
 
-  if (!urlMatchesDocumentDomain(_url)) {
-    return;
-  }
+    if (!urlMatchesDocumentDomain(_url))
+        return;
 
-  url = _url;
+    url = _url;
 
-  if (!user.isNull())
-    url.setUser(user.qstring());
+    if (!user.isNull())
+        url.setUser(user.qstring());
 
-  if (!password.isNull())
-    url.setPass(password.qstring());
+    if (!password.isNull())
+        url.setPass(password.qstring());
 
-  method = _method.qstring();
-  async = _async;
+    method = _method.qstring();
+    async = _async;
 
-  changeState(Loading);
+    changeState(Loading);
 }
 
-void XMLHttpRequest::send(const DOMString& _body)
+void XMLHttpRequest::send(const String& _body)
 {
-  if (!doc)
-    return;
+    if (!doc)
+        return;
 
-  if (state != Loading)
-    return;
+    if (state != Loading)
+        return;
   
-  // FIXME: Should this abort instead if we already have a job going?
-  if (job)
-    return;
-
-  aborted = false;
-
-  if (!_body.isNull() && method.lower() != "get" && method.lower() != "head" && (url.protocol().lower() == "http" || url.protocol().lower() == "https")) {
-      QString contentType = getRequestHeader("Content-Type");
-      QString charset;
-      if (contentType.isEmpty())
-        setRequestHeader("Content-Type", "application/xml");
-      else
-        charset = getCharset(contentType);
+    // FIXME: Should this abort instead if we already have a job going?
+    if (job)
+        return;
+
+    aborted = false;
+
+    if (!_body.isNull() && method.lower() != "get" && method.lower() != "head" && (url.protocol().lower() == "http" || url.protocol().lower() == "https")) {
+        QString contentType = getRequestHeader("Content-Type");
+        QString charset;
+        if (contentType.isEmpty())
+            setRequestHeader("Content-Type", "application/xml");
+        else
+            charset = getCharset(contentType);
       
-      if (charset.isEmpty())
-        charset = "UTF-8";
+        if (charset.isEmpty())
+            charset = "UTF-8";
       
-      TextEncoding encoding = TextEncoding(charset.latin1());
-      if (!encoding.isValid())   // FIXME: report an error?
-        encoding = TextEncoding(UTF8Encoding);
-
-      job = new TransferJob(async ? this : 0, method, url, encoding.fromUnicode(_body.qstring()));
-  } else {
-     // HEAD requests just crash; see <rdar://4460899> and the commented out tests in http/tests/xmlhttprequest/methods.html.
-     if (method.lower() == "head")
-       method = "GET";
-
-     job = new TransferJob(async ? this : 0, method, url);
-  }
-
-  if (requestHeaders.length() > 0)
-    job->addMetaData("customHTTPHeader", requestHeaders);
+        TextEncoding encoding = TextEncoding(charset.latin1());
+        if (!encoding.isValid())   // FIXME: report an error?
+            encoding = TextEncoding(UTF8Encoding);
+
+        job = new TransferJob(async ? this : 0, method, url, encoding.fromUnicode(_body.qstring()));
+    } else {
+        // HEAD requests just crash; see <rdar://4460899> and the commented out tests in http/tests/xmlhttprequest/methods.html.
+        if (method.lower() == "head")
+            method = "GET";
+        job = new TransferJob(async ? this : 0, method, url);
+    }
 
-  if (!async) {
-    ByteArray data;
-    KURL finalURL;
-    QString headers;
+    if (requestHeaders.length())
+        job->addMetaData("customHTTPHeader", requestHeaders);
 
-    { // scope
-        // avoid deadlock in case the loader wants to use JS on a background thread
-        KJS::JSLock::DropAllLocks dropLocks;
+    if (!async) {
+        ByteArray data;
+        KURL finalURL;
+        QString headers;
 
-        data = KWQServeSynchronousRequest(Cache::loader(), doc->docLoader(), job, finalURL, headers);
-    }
+        {
+            // avoid deadlock in case the loader wants to use JS on a background thread
+            KJS::JSLock::DropAllLocks dropLocks;
+            data = KWQServeSynchronousRequest(Cache::loader(), doc->docLoader(), job, finalURL, headers);
+        }
 
-    job = 0;
-    processSyncLoadResults(data, finalURL, headers);
+        job = 0;
+        processSyncLoadResults(data, finalURL, headers);
     
-    return;
-  }
+        return;
+    }
 
-  // Neither this object nor the JavaScript wrapper should be deleted while
-  // a request is in progress because we need to keep the listeners alive,
-  // and they are referenced by the JavaScript wrapper.
-  ref();
-  {
-    KJS::JSLock lock;
-    gcProtectNullTolerant(KJS::ScriptInterpreter::getDOMObject(this));
-  }
+    // Neither this object nor the JavaScript wrapper should be deleted while
+    // a request is in progress because we need to keep the listeners alive,
+    // and they are referenced by the JavaScript wrapper.
+    ref();
+    {
+        KJS::JSLock lock;
+        gcProtectNullTolerant(KJS::ScriptInterpreter::getDOMObject(this));
+    }
   
-  addToRequestsByDocument();
-
-  job->start(doc->docLoader());
+    job->start(doc->docLoader());
 }
 
 void XMLHttpRequest::abort()
 {
-  bool hadJob = job;
+    bool hadJob = job;
 
-  if (hadJob) {
-    removeFromRequestsByDocument();
-    job->kill();
-    job = 0;
-  }
-  decoder = 0;
-  aborted = true;
+    if (hadJob) {
+        job->kill();
+        job = 0;
+    }
+    decoder = 0;
+    aborted = true;
 
-  if (hadJob) {
-    {
-      KJS::JSLock lock;
-      gcUnprotectNullTolerant(KJS::ScriptInterpreter::getDOMObject(this));
+    if (hadJob) {
+        {
+            KJS::JSLock lock;
+            gcUnprotectNullTolerant(KJS::ScriptInterpreter::getDOMObject(this));
+        }
+        deref();
     }
-    deref();
-  }
 }
 
-void XMLHttpRequest::overrideMIMEType(const DOMString& override)
+void XMLHttpRequest::overrideMIMEType(const String& override)
 {
-  MIMETypeOverride = override.qstring();
+    MIMETypeOverride = override.qstring();
 }
 
-void XMLHttpRequest::setRequestHeader(const DOMString& name, const DOMString &value)
+void XMLHttpRequest::setRequestHeader(const String& name, const String& value)
 {
-  if (requestHeaders.length() > 0)
-    requestHeaders += "\r\n";
-  requestHeaders += name.qstring();
-  requestHeaders += ": ";
-  requestHeaders += value.qstring();
+    if (requestHeaders.length() > 0)
+        requestHeaders += "\r\n";
+    requestHeaders += name.qstring();
+    requestHeaders += ": ";
+    requestHeaders += value.qstring();
 }
 
 QString XMLHttpRequest::getRequestHeader(const QString& name) const
 {
-  return getSpecificHeader(requestHeaders, name);
+    return getSpecificHeader(requestHeaders, name);
 }
 
-DOMString XMLHttpRequest::getAllResponseHeaders() const
+String XMLHttpRequest::getAllResponseHeaders() const
 {
-  if (responseHeaders.isEmpty())
-    return DOMString();
-
-  int endOfLine = responseHeaders.find("\n");
+    if (responseHeaders.isEmpty())
+        return String();
 
-  if (endOfLine == -1)
-    return DOMString();
+    int endOfLine = responseHeaders.find("\n");
+    if (endOfLine == -1)
+        return String();
 
-  return responseHeaders.mid(endOfLine + 1) + "\n";
+    return responseHeaders.mid(endOfLine + 1) + "\n";
 }
 
-DOMString XMLHttpRequest::getResponseHeader(const DOMString& name) const
+String XMLHttpRequest::getResponseHeader(const String& name) const
 {
-  return getSpecificHeader(responseHeaders, name.qstring());
+    return getSpecificHeader(responseHeaders, name.qstring());
 }
 
 QString XMLHttpRequest::getSpecificHeader(const QString& headers, const QString& name)
 {
-  if (headers.isEmpty())
-    return QString();
-
-  QRegExp headerLinePattern(name + ":", false);
+    if (headers.isEmpty())
+        return QString();
 
-  int matchLength;
-  int headerLinePos = headerLinePattern.match(headers, 0, &matchLength);
-  while (headerLinePos != -1) {
-    if (headerLinePos == 0 || headers[headerLinePos-1] == '\n')
-      break;
-    
-    headerLinePos = headerLinePattern.match(headers, headerLinePos + 1, &matchLength);
-  }
+    QRegExp headerLinePattern(name + ":", false);
 
-  if (headerLinePos == -1)
-    return QString();
+    int matchLength;
+    int headerLinePos = headerLinePattern.match(headers, 0, &matchLength);
+    while (headerLinePos != -1) {
+        if (headerLinePos == 0 || headers[headerLinePos-1] == '\n')
+            break;
+        headerLinePos = headerLinePattern.match(headers, headerLinePos + 1, &matchLength);
+    }
+    if (headerLinePos == -1)
+        return QString();
     
-  int endOfLine = headers.find("\n", headerLinePos + matchLength);
-  
-  return headers.mid(headerLinePos + matchLength, endOfLine - (headerLinePos + matchLength)).stripWhiteSpace();
+    int endOfLine = headers.find("\n", headerLinePos + matchLength);
+    return headers.mid(headerLinePos + matchLength, endOfLine - (headerLinePos + matchLength)).stripWhiteSpace();
 }
 
 bool XMLHttpRequest::responseIsXML() const
@@ -386,50 +419,44 @@ bool XMLHttpRequest::responseIsXML() const
     if (mimeType.isEmpty())
         mimeType = getMIMEType(getResponseHeader("Content-Type").qstring());
     if (mimeType.isEmpty())
-      mimeType = "text/xml";
-    
+        mimeType = "text/xml";
     return DOMImplementationImpl::isXMLMIMEType(mimeType);
 }
 
 int XMLHttpRequest::getStatus() const
 {
-  if (responseHeaders.isEmpty())
-    return -1;
-  
-  int endOfLine = responseHeaders.find("\n");
-  QString firstLine = endOfLine == -1 ? responseHeaders : responseHeaders.left(endOfLine);
-  int codeStart = firstLine.find(" ");
-  int codeEnd = firstLine.find(" ", codeStart + 1);
+    if (responseHeaders.isEmpty())
+        return -1;
   
-  if (codeStart == -1 || codeEnd == -1)
-    return -1;
+    int endOfLine = responseHeaders.find("\n");
+    QString firstLine = endOfLine == -1 ? responseHeaders : responseHeaders.left(endOfLine);
+    int codeStart = firstLine.find(" ");
+    int codeEnd = firstLine.find(" ", codeStart + 1);
+    if (codeStart == -1 || codeEnd == -1)
+        return -1;
   
-  QString number = firstLine.mid(codeStart + 1, codeEnd - (codeStart + 1));
-  
-  bool ok = false;
-  int code = number.toInt(&ok);
-  if (!ok)
-    return -1;
-
-  return code;
+    QString number = firstLine.mid(codeStart + 1, codeEnd - (codeStart + 1));
+    bool ok = false;
+    int code = number.toInt(&ok);
+    if (!ok)
+        return -1;
+    return code;
 }
 
-DOMString XMLHttpRequest::getStatusText() const
+String XMLHttpRequest::getStatusText() const
 {
-  if (responseHeaders.isEmpty())
-    return DOMString();
-  
-  int endOfLine = responseHeaders.find("\n");
-  QString firstLine = endOfLine == -1 ? responseHeaders : responseHeaders.left(endOfLine);
-  int codeStart = firstLine.find(" ");
-  int codeEnd = firstLine.find(" ", codeStart + 1);
-
-  if (codeStart == -1 || codeEnd == -1)
-    return DOMString();
+    if (responseHeaders.isEmpty())
+        return String();
   
-  QString statusText = firstLine.mid(codeEnd + 1, endOfLine - (codeEnd + 1)).stripWhiteSpace();
+    int endOfLine = responseHeaders.find("\n");
+    QString firstLine = endOfLine == -1 ? responseHeaders : responseHeaders.left(endOfLine);
+    int codeStart = firstLine.find(" ");
+    int codeEnd = firstLine.find(" ", codeStart + 1);
+    if (codeStart == -1 || codeEnd == -1)
+        return String();
   
-  return DOMString(statusText);
+    QString statusText = firstLine.mid(codeEnd + 1, endOfLine - (codeEnd + 1)).stripWhiteSpace();
+    return String(statusText);
 }
 
 void XMLHttpRequest::processSyncLoadResults(const ByteArray &data, const KURL &finalURL, const QString &headers)
@@ -456,120 +483,100 @@ void XMLHttpRequest::processSyncLoadResults(const ByteArray &data, const KURL &f
 
 void XMLHttpRequest::receivedAllData(TransferJob*)
 {
-  if (responseHeaders.isEmpty() && job)
-    responseHeaders = job->queryMetaData("HTTP-Headers");
+    if (responseHeaders.isEmpty() && job)
+        responseHeaders = job->queryMetaData("HTTP-Headers");
 
-  if (state < Loaded)
-    changeState(Loaded);
+    if (state < Loaded)
+        changeState(Loaded);
 
-  if (decoder)
-    response += decoder->flush();
+    if (decoder)
+        response += decoder->flush();
 
-  bool hadJob = job;
-  removeFromRequestsByDocument();
-  job = 0;
+    bool hadJob = job;
+    job = 0;
 
-  changeState(Completed);
-  decoder = 0;
+    changeState(Completed);
+    decoder = 0;
 
-  if (hadJob) {
-    {
-      KJS::JSLock lock;
-      gcUnprotectNullTolerant(KJS::ScriptInterpreter::getDOMObject(this));
+    if (hadJob) {
+        {
+            KJS::JSLock lock;
+            gcUnprotectNullTolerant(KJS::ScriptInterpreter::getDOMObject(this));
+        }
+        deref();
     }
-    deref();
-  }
 }
 
 void XMLHttpRequest::receivedRedirect(TransferJob*, const KURL& url)
 {
-  if (!urlMatchesDocumentDomain(url))
-    abort();
+    if (!urlMatchesDocumentDomain(url))
+        abort();
 }
 
 void XMLHttpRequest::receivedData(TransferJob*, const char *data, int len)
 {
-  if (responseHeaders.isEmpty() && job)
-    responseHeaders = job->queryMetaData("HTTP-Headers");
+    if (responseHeaders.isEmpty() && job)
+        responseHeaders = job->queryMetaData("HTTP-Headers");
 
-  if (state < Loaded)
-    changeState(Loaded);
+    if (state < Loaded)
+        changeState(Loaded);
   
-  if (!decoder) {
-    encoding = getCharset(MIMETypeOverride);
-    if (encoding.isEmpty())
-      encoding = getCharset(getResponseHeader("Content-Type").qstring());
-    if (encoding.isEmpty() && job)
-      encoding = job->queryMetaData("charset");
+    if (!decoder) {
+        encoding = getCharset(MIMETypeOverride);
+        if (encoding.isEmpty())
+            encoding = getCharset(getResponseHeader("Content-Type").qstring());
+        if (encoding.isEmpty() && job)
+            encoding = job->queryMetaData("charset");
     
-    decoder = new Decoder;
-    if (!encoding.isEmpty())
-      decoder->setEncodingName(encoding.latin1(), Decoder::EncodingFromHTTPHeader);
-    else
-      // only allow Decoder to look inside the response if it's XML
-      decoder->setEncodingName("UTF-8", responseIsXML() ? Decoder::DefaultEncoding : Decoder::EncodingFromHTTPHeader);
-  }
-  if (len == 0)
-    return;
+        decoder = new Decoder;
+        if (!encoding.isEmpty())
+            decoder->setEncodingName(encoding.latin1(), Decoder::EncodingFromHTTPHeader);
+        else
+            // only allow Decoder to look inside the response if it's XML
+            decoder->setEncodingName("UTF-8", responseIsXML() ? Decoder::DefaultEncoding : Decoder::EncodingFromHTTPHeader);
+    }
+    if (len == 0)
+        return;
 
-  if (len == -1)
-    len = strlen(data);
+    if (len == -1)
+        len = strlen(data);
 
-  QString decoded = decoder->decode(data, len);
+    QString decoded = decoder->decode(data, len);
 
-  response += decoded;
+    response += decoded;
 
-  if (!aborted) {
-    if (state != Interactive)
-        changeState(Interactive);
-    else
-        // Firefox calls readyStateChanged every time it receives data, 4449442
-        callReadyStateChangeListener();
-  }
+    if (!aborted) {
+        if (state != Interactive)
+            changeState(Interactive);
+        else
+            // Firefox calls readyStateChanged every time it receives data, 4449442
+            callReadyStateChangeListener();
+    }
 }
 
-XMLHttpRequest::RequestsMap& XMLHttpRequest::requestsByDocument()
+void XMLHttpRequest::cancelRequests(DocumentImpl* doc)
 {
-    static RequestsMap map;
-    return map;
+    RequestsSet* requests = requestsByDocument().get(doc);
+    if (!requests)
+        return;
+    RequestsSet copy = *requests;
+    RequestsSet::const_iterator end = copy.end();
+    for (RequestsSet::const_iterator it = copy.begin(); it != end; ++it)
+        (*it)->abort();
 }
 
-void XMLHttpRequest::addToRequestsByDocument()
+void XMLHttpRequest::detachRequests(DocumentImpl* doc)
 {
-  assert(doc);
-
-  RequestsSet* requests = requestsByDocument().get(doc);
-  if (!requests) {
-    requests = new RequestsSet;
-    requestsByDocument().set(doc, requests);
-  }
-
-  assert(!requests->contains(this));
-  requests->add(this);
-}
-
-void XMLHttpRequest::removeFromRequestsByDocument()
-{
-  assert(doc);
-
-  RequestsSet* requests = requestsByDocument().get(doc);
-
-  // Since synchronous loads are not added to requestsByDocument(), we need to make sure we found the request.
-  if (!requests || !requests->contains(this))
-    return;
-
-  requests->remove(this);
-
-  if (requests->isEmpty()) {
+    RequestsSet* requests = requestsByDocument().get(doc);
+    if (!requests)
+        return;
     requestsByDocument().remove(doc);
+    RequestsSet::const_iterator end = requests->end();
+    for (RequestsSet::const_iterator it = requests->begin(); it != end; ++it) {
+        (*it)->doc = 0;
+        (*it)->abort();
+    }
     delete requests;
-  }
-}
-
-void XMLHttpRequest::cancelRequests(DocumentImpl* d)
-{
-  while (RequestsSet* requests = requestsByDocument().get(d))
-    (*requests->begin())->abort();
 }
 
 } // end namespace
index af3efbb75117eab97318fa06427ddb9c3313ecd6..62ead0a280eb07d20d537ec1aa0af8bf641ed3db 100644 (file)
@@ -26,7 +26,6 @@
 #include "TransferJobClient.h"
 #include <kxmlcore/HashMap.h>
 #include <kxmlcore/HashSet.h>
-#include <qguardedptr.h>
 
 namespace WebCore {
 
@@ -47,7 +46,9 @@ namespace WebCore {
   class XMLHttpRequest : public Shared<XMLHttpRequest>, TransferJobClient {
   public:
     XMLHttpRequest(DocumentImpl*);
+    ~XMLHttpRequest();
 
+    static void detachRequests(DocumentImpl*);
     static void cancelRequests(DocumentImpl*);
 
     String getStatusText() const;
@@ -85,13 +86,7 @@ namespace WebCore {
     void changeState(XMLHttpRequestState newState);
     void callReadyStateChangeListener();
 
-    typedef HashSet<XMLHttpRequest*> RequestsSet;
-    typedef HashMap<DocumentImpl*, RequestsSet*> RequestsMap;
-    static RequestsMap &requestsByDocument();
-    void addToRequestsByDocument();
-    void removeFromRequestsByDocument();
-
-    QGuardedPtr<DocumentImpl> doc;
+    DocumentImpl* doc;
     RefPtr<EventListener> m_onReadyStateChangeListener;
     RefPtr<EventListener> m_onLoadListener;