Commit 36915ad9 authored by gramps's avatar gramps

Added APPLE_CHANGES define for compiling our changes to kdelibs.

	Cleaned up all our changes to kdelibs, removed bitrot, and replaced use
	of _KWQ_ with new APPLE_CHANGES define.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0c1c874f
2002-03-06 Don Melton <gramps@apple.com>
Cleaned up all our changes to kdelibs, removed bitrot, and replaced use
of _KWQ_ with new APPLE_CHANGES define.
* src/kdelibs/khtml/css/csshelper.cpp: (khtml::computeLengthFloat),
(khtml::setFontSize):
* src/kdelibs/khtml/css/cssstyleselector.cpp:
(CSSStyleSelector::CSSStyleSelector), (khtml::applyRule):
* src/kdelibs/khtml/dom/dom_misc.cpp:
* src/kdelibs/khtml/dom/dom_misc.h:
* src/kdelibs/khtml/dom/html_document.cpp: (HTMLDocument::cookie),
(HTMLDocument::setCookie):
* src/kdelibs/khtml/dom/html_element.cpp:
* src/kdelibs/khtml/ecma/kjs_binding.h:
* src/kdelibs/khtml/ecma/kjs_css.cpp: (DOMCSSStyleDeclarationFunc::tryExecute),
(DOMStyleSheetListFunc::tryExecute), (DOMMediaListFunc::tryExecute),
(DOMCSSStyleSheetFunc::tryExecute), (DOMCSSRuleListFunc::tryExecute),
(DOMCSSRuleFunc::tryExecute), (DOMCSSPrimitiveValueFunc::tryExecute),
(DOMCSSValueListFunc::tryExecute):
* src/kdelibs/khtml/ecma/kjs_css.h:
* src/kdelibs/khtml/ecma/kjs_dom.cpp: (DOMNodeFunc::tryExecute),
(DOMNodeListFunc::tryExecute), (DOMDocFunction::DOMDocFunction),
(DOMDocFunction::tryExecute), (DOMElementFunction::DOMElementFunction),
(DOMElementFunction::tryExecute),
(DOMDOMImplementationFunction::DOMDOMImplementationFunction),
(DOMDOMImplementationFunction::tryExecute),
(DOMNamedNodeMapFunction::DOMNamedNodeMapFunction),
(DOMNamedNodeMapFunction::tryExecute):
* src/kdelibs/khtml/ecma/kjs_dom.h:
* src/kdelibs/khtml/ecma/kjs_window.cpp: (Window::isSafeScript):
* src/kdelibs/khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::formData),
(HTMLSelectElementImpl::state), (HTMLSelectElementImpl::restoreState):
* src/kdelibs/khtml/html/html_headimpl.cpp: (HTMLLinkElementImpl::detach),
(HTMLStyleElementImpl::detach), (HTMLTitleElementImpl::setTitle):
* src/kdelibs/khtml/html/html_objectimpl.cpp:
(HTMLEmbedElementImpl::parseAttribute):
* src/kdelibs/khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::parseAttribute),
(HTMLTablePartElementImpl::parseAttribute):
* src/kdelibs/khtml/html/htmlparser.cpp: (KHTMLParser::parseToken),
(KHTMLParser::insertNode), (KHTMLParser::getElement),
(KHTMLParser::processCloseTag), (KHTMLParser::popBlock),
(KHTMLParser::popOneBlock):
* src/kdelibs/khtml/html/htmltokenizer.cpp: (HTMLTokenizer::parseSpecial),
(HTMLTokenizer::scriptHandler), (HTMLTokenizer::parseComment),
(HTMLTokenizer::parseTag), (HTMLTokenizer::processToken):
* src/kdelibs/khtml/html/htmltokenizer.h:
* src/kdelibs/khtml/java/kjavaprocess.h:
* src/kdelibs/khtml/khtml_part.h:
* src/kdelibs/khtml/khtmlview.cpp: (KHTMLView::~KHTMLView), (KHTMLView::init),
(printRenderTree), (KHTMLView::drawContents), (KHTMLView::layout),
(KHTMLView::viewportMousePressEvent), (KHTMLView::viewportMouseDoubleClickEvent),
(KHTMLView::viewportMouseMoveEvent), (KHTMLView::viewportMouseReleaseEvent),
(KHTMLView::addFormCompletionItem):
* src/kdelibs/khtml/khtmlview.h:
* src/kdelibs/khtml/misc/decoder.cpp: (Decoder::setEncoding), (Decoder::decode):
* src/kdelibs/khtml/misc/helper.cpp: (khtml::setNamedColor):
* src/kdelibs/khtml/misc/loader.h:
* src/kdelibs/khtml/rendering/bidi.cpp: (RenderFlow::layoutInlineChildren):
* src/kdelibs/khtml/rendering/render_applet.cpp: (RenderApplet::RenderApplet):
* src/kdelibs/khtml/rendering/render_body.cpp: (RenderBody::layout):
* src/kdelibs/khtml/rendering/render_box.cpp: (RenderBox::printBackground):
* src/kdelibs/khtml/rendering/render_flow.cpp: (RenderFlow::print):
* src/kdelibs/khtml/rendering/render_form.cpp:
(RenderFormElement::baselinePosition), (RenderFormElement::slotClicked),
(RenderCheckBox::RenderCheckBox), (RenderCheckBox::performAction),
(RenderRadioButton::RenderRadioButton), (RenderRadioButton::slotClicked),
(RenderSubmitButton::RenderSubmitButton), (RenderSubmitButton::baselinePosition),
(RenderLineEdit::RenderLineEdit), (RenderLineEdit::calcMinMaxWidth),
(RenderLineEdit::performAction), (RenderFileButton::RenderFileButton),
(RenderSelect::RenderSelect), (RenderSelect::layout),
(RenderSelect::createListBox), (RenderSelect::createComboBox),
(RenderTextArea::RenderTextArea), (RenderTextArea::calcMinMaxWidth),
(RenderTextArea::layout):
* src/kdelibs/khtml/rendering/render_form.h:
* src/kdelibs/khtml/rendering/render_frames.cpp:
(RenderPartObject::updateWidget):
* src/kdelibs/khtml/rendering/render_hr.cpp: (RenderHR::print):
* src/kdelibs/khtml/rendering/render_image.cpp: (RenderImage::printObject):
* src/kdelibs/khtml/rendering/render_list.cpp: (RenderListMarker::printObject):
* src/kdelibs/khtml/rendering/render_style.h:
* src/kdelibs/khtml/rendering/render_table.cpp: (RenderTable::calcFinalColMax),
(RenderTable::layoutRows):
* src/kdelibs/khtml/rendering/render_text.cpp: (TextSlave::printDecoration),
(TextSlaveArray::findFirstMatching), (RenderText::print):
* src/kdelibs/khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle):
* src/kdelibs/khtml/xml/dom_nodeimpl.cpp: (NodeImpl::renderer):
* src/kdelibs/khtml/xml/dom_nodeimpl.h:
* src/kdelibs/khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::toLengthList):
2002-03-06 Maciej Stachowiak <mjs@apple.com>
* src/kwq/KWQKURL.mm: (KURL::KURL): If resolving a relative URL
......
2002-03-06 Don Melton <gramps@apple.com>
Cleaned up all our changes to kdelibs, removed bitrot, and replaced use
of _KWQ_ with new APPLE_CHANGES define.
* src/kdelibs/khtml/css/csshelper.cpp: (khtml::computeLengthFloat),
(khtml::setFontSize):
* src/kdelibs/khtml/css/cssstyleselector.cpp:
(CSSStyleSelector::CSSStyleSelector), (khtml::applyRule):
* src/kdelibs/khtml/dom/dom_misc.cpp:
* src/kdelibs/khtml/dom/dom_misc.h:
* src/kdelibs/khtml/dom/html_document.cpp: (HTMLDocument::cookie),
(HTMLDocument::setCookie):
* src/kdelibs/khtml/dom/html_element.cpp:
* src/kdelibs/khtml/ecma/kjs_binding.h:
* src/kdelibs/khtml/ecma/kjs_css.cpp: (DOMCSSStyleDeclarationFunc::tryExecute),
(DOMStyleSheetListFunc::tryExecute), (DOMMediaListFunc::tryExecute),
(DOMCSSStyleSheetFunc::tryExecute), (DOMCSSRuleListFunc::tryExecute),
(DOMCSSRuleFunc::tryExecute), (DOMCSSPrimitiveValueFunc::tryExecute),
(DOMCSSValueListFunc::tryExecute):
* src/kdelibs/khtml/ecma/kjs_css.h:
* src/kdelibs/khtml/ecma/kjs_dom.cpp: (DOMNodeFunc::tryExecute),
(DOMNodeListFunc::tryExecute), (DOMDocFunction::DOMDocFunction),
(DOMDocFunction::tryExecute), (DOMElementFunction::DOMElementFunction),
(DOMElementFunction::tryExecute),
(DOMDOMImplementationFunction::DOMDOMImplementationFunction),
(DOMDOMImplementationFunction::tryExecute),
(DOMNamedNodeMapFunction::DOMNamedNodeMapFunction),
(DOMNamedNodeMapFunction::tryExecute):
* src/kdelibs/khtml/ecma/kjs_dom.h:
* src/kdelibs/khtml/ecma/kjs_window.cpp: (Window::isSafeScript):
* src/kdelibs/khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::formData),
(HTMLSelectElementImpl::state), (HTMLSelectElementImpl::restoreState):
* src/kdelibs/khtml/html/html_headimpl.cpp: (HTMLLinkElementImpl::detach),
(HTMLStyleElementImpl::detach), (HTMLTitleElementImpl::setTitle):
* src/kdelibs/khtml/html/html_objectimpl.cpp:
(HTMLEmbedElementImpl::parseAttribute):
* src/kdelibs/khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::parseAttribute),
(HTMLTablePartElementImpl::parseAttribute):
* src/kdelibs/khtml/html/htmlparser.cpp: (KHTMLParser::parseToken),
(KHTMLParser::insertNode), (KHTMLParser::getElement),
(KHTMLParser::processCloseTag), (KHTMLParser::popBlock),
(KHTMLParser::popOneBlock):
* src/kdelibs/khtml/html/htmltokenizer.cpp: (HTMLTokenizer::parseSpecial),
(HTMLTokenizer::scriptHandler), (HTMLTokenizer::parseComment),
(HTMLTokenizer::parseTag), (HTMLTokenizer::processToken):
* src/kdelibs/khtml/html/htmltokenizer.h:
* src/kdelibs/khtml/java/kjavaprocess.h:
* src/kdelibs/khtml/khtml_part.h:
* src/kdelibs/khtml/khtmlview.cpp: (KHTMLView::~KHTMLView), (KHTMLView::init),
(printRenderTree), (KHTMLView::drawContents), (KHTMLView::layout),
(KHTMLView::viewportMousePressEvent), (KHTMLView::viewportMouseDoubleClickEvent),
(KHTMLView::viewportMouseMoveEvent), (KHTMLView::viewportMouseReleaseEvent),
(KHTMLView::addFormCompletionItem):
* src/kdelibs/khtml/khtmlview.h:
* src/kdelibs/khtml/misc/decoder.cpp: (Decoder::setEncoding), (Decoder::decode):
* src/kdelibs/khtml/misc/helper.cpp: (khtml::setNamedColor):
* src/kdelibs/khtml/misc/loader.h:
* src/kdelibs/khtml/rendering/bidi.cpp: (RenderFlow::layoutInlineChildren):
* src/kdelibs/khtml/rendering/render_applet.cpp: (RenderApplet::RenderApplet):
* src/kdelibs/khtml/rendering/render_body.cpp: (RenderBody::layout):
* src/kdelibs/khtml/rendering/render_box.cpp: (RenderBox::printBackground):
* src/kdelibs/khtml/rendering/render_flow.cpp: (RenderFlow::print):
* src/kdelibs/khtml/rendering/render_form.cpp:
(RenderFormElement::baselinePosition), (RenderFormElement::slotClicked),
(RenderCheckBox::RenderCheckBox), (RenderCheckBox::performAction),
(RenderRadioButton::RenderRadioButton), (RenderRadioButton::slotClicked),
(RenderSubmitButton::RenderSubmitButton), (RenderSubmitButton::baselinePosition),
(RenderLineEdit::RenderLineEdit), (RenderLineEdit::calcMinMaxWidth),
(RenderLineEdit::performAction), (RenderFileButton::RenderFileButton),
(RenderSelect::RenderSelect), (RenderSelect::layout),
(RenderSelect::createListBox), (RenderSelect::createComboBox),
(RenderTextArea::RenderTextArea), (RenderTextArea::calcMinMaxWidth),
(RenderTextArea::layout):
* src/kdelibs/khtml/rendering/render_form.h:
* src/kdelibs/khtml/rendering/render_frames.cpp:
(RenderPartObject::updateWidget):
* src/kdelibs/khtml/rendering/render_hr.cpp: (RenderHR::print):
* src/kdelibs/khtml/rendering/render_image.cpp: (RenderImage::printObject):
* src/kdelibs/khtml/rendering/render_list.cpp: (RenderListMarker::printObject):
* src/kdelibs/khtml/rendering/render_style.h:
* src/kdelibs/khtml/rendering/render_table.cpp: (RenderTable::calcFinalColMax),
(RenderTable::layoutRows):
* src/kdelibs/khtml/rendering/render_text.cpp: (TextSlave::printDecoration),
(TextSlaveArray::findFirstMatching), (RenderText::print):
* src/kdelibs/khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle):
* src/kdelibs/khtml/xml/dom_nodeimpl.cpp: (NodeImpl::renderer):
* src/kdelibs/khtml/xml/dom_nodeimpl.h:
* src/kdelibs/khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::toLengthList):
2002-03-06 Maciej Stachowiak <mjs@apple.com>
* src/kwq/KWQKURL.mm: (KURL::KURL): If resolving a relative URL
......
2002-03-06 Don Melton <gramps@apple.com>
Cleaned up all our changes to kdelibs, removed bitrot, and replaced use
of _KWQ_ with new APPLE_CHANGES define.
* src/kdelibs/khtml/css/csshelper.cpp: (khtml::computeLengthFloat),
(khtml::setFontSize):
* src/kdelibs/khtml/css/cssstyleselector.cpp:
(CSSStyleSelector::CSSStyleSelector), (khtml::applyRule):
* src/kdelibs/khtml/dom/dom_misc.cpp:
* src/kdelibs/khtml/dom/dom_misc.h:
* src/kdelibs/khtml/dom/html_document.cpp: (HTMLDocument::cookie),
(HTMLDocument::setCookie):
* src/kdelibs/khtml/dom/html_element.cpp:
* src/kdelibs/khtml/ecma/kjs_binding.h:
* src/kdelibs/khtml/ecma/kjs_css.cpp: (DOMCSSStyleDeclarationFunc::tryExecute),
(DOMStyleSheetListFunc::tryExecute), (DOMMediaListFunc::tryExecute),
(DOMCSSStyleSheetFunc::tryExecute), (DOMCSSRuleListFunc::tryExecute),
(DOMCSSRuleFunc::tryExecute), (DOMCSSPrimitiveValueFunc::tryExecute),
(DOMCSSValueListFunc::tryExecute):
* src/kdelibs/khtml/ecma/kjs_css.h:
* src/kdelibs/khtml/ecma/kjs_dom.cpp: (DOMNodeFunc::tryExecute),
(DOMNodeListFunc::tryExecute), (DOMDocFunction::DOMDocFunction),
(DOMDocFunction::tryExecute), (DOMElementFunction::DOMElementFunction),
(DOMElementFunction::tryExecute),
(DOMDOMImplementationFunction::DOMDOMImplementationFunction),
(DOMDOMImplementationFunction::tryExecute),
(DOMNamedNodeMapFunction::DOMNamedNodeMapFunction),
(DOMNamedNodeMapFunction::tryExecute):
* src/kdelibs/khtml/ecma/kjs_dom.h:
* src/kdelibs/khtml/ecma/kjs_window.cpp: (Window::isSafeScript):
* src/kdelibs/khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::formData),
(HTMLSelectElementImpl::state), (HTMLSelectElementImpl::restoreState):
* src/kdelibs/khtml/html/html_headimpl.cpp: (HTMLLinkElementImpl::detach),
(HTMLStyleElementImpl::detach), (HTMLTitleElementImpl::setTitle):
* src/kdelibs/khtml/html/html_objectimpl.cpp:
(HTMLEmbedElementImpl::parseAttribute):
* src/kdelibs/khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::parseAttribute),
(HTMLTablePartElementImpl::parseAttribute):
* src/kdelibs/khtml/html/htmlparser.cpp: (KHTMLParser::parseToken),
(KHTMLParser::insertNode), (KHTMLParser::getElement),
(KHTMLParser::processCloseTag), (KHTMLParser::popBlock),
(KHTMLParser::popOneBlock):
* src/kdelibs/khtml/html/htmltokenizer.cpp: (HTMLTokenizer::parseSpecial),
(HTMLTokenizer::scriptHandler), (HTMLTokenizer::parseComment),
(HTMLTokenizer::parseTag), (HTMLTokenizer::processToken):
* src/kdelibs/khtml/html/htmltokenizer.h:
* src/kdelibs/khtml/java/kjavaprocess.h:
* src/kdelibs/khtml/khtml_part.h:
* src/kdelibs/khtml/khtmlview.cpp: (KHTMLView::~KHTMLView), (KHTMLView::init),
(printRenderTree), (KHTMLView::drawContents), (KHTMLView::layout),
(KHTMLView::viewportMousePressEvent), (KHTMLView::viewportMouseDoubleClickEvent),
(KHTMLView::viewportMouseMoveEvent), (KHTMLView::viewportMouseReleaseEvent),
(KHTMLView::addFormCompletionItem):
* src/kdelibs/khtml/khtmlview.h:
* src/kdelibs/khtml/misc/decoder.cpp: (Decoder::setEncoding), (Decoder::decode):
* src/kdelibs/khtml/misc/helper.cpp: (khtml::setNamedColor):
* src/kdelibs/khtml/misc/loader.h:
* src/kdelibs/khtml/rendering/bidi.cpp: (RenderFlow::layoutInlineChildren):
* src/kdelibs/khtml/rendering/render_applet.cpp: (RenderApplet::RenderApplet):
* src/kdelibs/khtml/rendering/render_body.cpp: (RenderBody::layout):
* src/kdelibs/khtml/rendering/render_box.cpp: (RenderBox::printBackground):
* src/kdelibs/khtml/rendering/render_flow.cpp: (RenderFlow::print):
* src/kdelibs/khtml/rendering/render_form.cpp:
(RenderFormElement::baselinePosition), (RenderFormElement::slotClicked),
(RenderCheckBox::RenderCheckBox), (RenderCheckBox::performAction),
(RenderRadioButton::RenderRadioButton), (RenderRadioButton::slotClicked),
(RenderSubmitButton::RenderSubmitButton), (RenderSubmitButton::baselinePosition),
(RenderLineEdit::RenderLineEdit), (RenderLineEdit::calcMinMaxWidth),
(RenderLineEdit::performAction), (RenderFileButton::RenderFileButton),
(RenderSelect::RenderSelect), (RenderSelect::layout),
(RenderSelect::createListBox), (RenderSelect::createComboBox),
(RenderTextArea::RenderTextArea), (RenderTextArea::calcMinMaxWidth),
(RenderTextArea::layout):
* src/kdelibs/khtml/rendering/render_form.h:
* src/kdelibs/khtml/rendering/render_frames.cpp:
(RenderPartObject::updateWidget):
* src/kdelibs/khtml/rendering/render_hr.cpp: (RenderHR::print):
* src/kdelibs/khtml/rendering/render_image.cpp: (RenderImage::printObject):
* src/kdelibs/khtml/rendering/render_list.cpp: (RenderListMarker::printObject):
* src/kdelibs/khtml/rendering/render_style.h:
* src/kdelibs/khtml/rendering/render_table.cpp: (RenderTable::calcFinalColMax),
(RenderTable::layoutRows):
* src/kdelibs/khtml/rendering/render_text.cpp: (TextSlave::printDecoration),
(TextSlaveArray::findFirstMatching), (RenderText::print):
* src/kdelibs/khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle):
* src/kdelibs/khtml/xml/dom_nodeimpl.cpp: (NodeImpl::renderer):
* src/kdelibs/khtml/xml/dom_nodeimpl.h:
* src/kdelibs/khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::toLengthList):
2002-03-06 Maciej Stachowiak <mjs@apple.com>
* src/kwq/KWQKURL.mm: (KURL::KURL): If resolving a relative URL
......
......@@ -54,10 +54,14 @@ float khtml::computeLengthFloat(DOM::CSSPrimitiveValueImpl *val, RenderStyle *st
float dpiY = 72.; // fallback
if ( devMetrics )
dpiY = devMetrics->logicalDpiY();
#ifdef APPLE_CHANGES
// FIXME: SCREEN_RESOLUTION hack good enough to keep?
if ( !khtml::printpainter && dpiY < SCREEN_RESOLUTION )
dpiY = SCREEN_RESOLUTION;
#else /* APPLE_CHANGES not defined */
if ( !khtml::printpainter && dpiY < 96 )
dpiY = 96.;
#endif /* APPLE_CHANGES not defined */
float factor = 1.;
switch(type)
......@@ -143,11 +147,13 @@ DOMString khtml::parseURL(const DOMString &url)
void khtml::setFontSize( QFont &f, int pixelsize, const KHTMLSettings *s, QPaintDeviceMetrics *devMetrics )
{
float size = pixelsize;
#ifndef _KWQ_
#ifndef APPLE_CHANGES
QFontDatabase db;
#endif /* APPLE_CHANGES not defined */
float size = pixelsize;
#ifndef APPLE_CHANGES
float toPix = 1.;
if ( !khtml::printpainter )
toPix = devMetrics->logicalDpiY()/72.;
......@@ -185,7 +191,8 @@ void khtml::setFontSize( QFont &f, int pixelsize, const KHTMLSettings *s, QPai
// else if ( size > 4 && size < 16 )
// size = float( int( ( size + 1 ) / 2 )*2 );
}
#endif
#endif /* APPLE_CHANGES not defined */
//qDebug(" -->>> using %f pixel font", size);
f.setPixelSizeFloat( size );
......
......@@ -73,12 +73,11 @@ static int usedDynamicStates;
static int selectorDynamicState;
static CSSStyleSelector::Encodedurl *encodedurl;
CSSStyleSelector::CSSStyleSelector(DocumentImpl * doc)
{
strictParsing = doc->parseMode() == DocumentImpl::Strict;
if(!defaultStyle){
loadDefaultStyle(doc->view()?doc->view()->part()->settings():0);
}
if(!defaultStyle) loadDefaultStyle(doc->view()?doc->view()->part()->settings():0);
selectors = 0;
selectorCache = 0;
......@@ -1941,9 +1940,14 @@ void khtml::applyRule(khtml::RenderStyle *style, DOM::CSSProperty *prop, DOM::El
float toPix = 1.; // fallback
if ( !khtml::printpainter )
toPix = paintDeviceMetrics->logicalDpiY()/72.;
#ifdef APPLE_CHANGES
// FIXME: SCREEN_RESOLUTION hack good enough to keep?
if ( !khtml::printpainter && toPix < SCREEN_RESOLUTION/72 )
toPix = SCREEN_RESOLUTION/72;
#else /* APPLE_CHANGES not defined */
if ( !khtml::printpainter && toPix < 96./72. )
toPix = 96./72.;
#endif /* APPLE_CHANGES not defined */
QValueList<int> standardSizes = e->ownerDocument()->view()->part()->fontSizes();
if(e->parentNode()) {
......
......@@ -23,8 +23,9 @@
#include "dom_misc.h"
using namespace DOM;
#ifdef APPLE_CHANGES
#include <stdio.h>
#endif /* APPLE_CHANGES */
DomShared::~DomShared()
{
......@@ -38,7 +39,8 @@ bool DomShared::deleteMe()
return false;
}
#ifdef _KWQ_
#ifdef APPLE_CHANGES
void *DomShared::instanceToCheck;
void DomShared::ref()
......@@ -59,4 +61,4 @@ void DomShared::deref()
if(!_ref && deleteMe())
delete this;
}
#endif
#endif /* APPLE_CHANGES */
......@@ -32,7 +32,6 @@ namespace DOM {
* Other objects should overload deleteMe() to fit their needs. The default
* implementation deletes the object if the ref count drops to 0.
*/
class DomShared
{
public:
......@@ -43,16 +42,15 @@ public:
*/
virtual bool deleteMe();
#ifndef _KWQ_
void ref() { _ref++; }
void deref() { if(_ref) _ref--; if(!_ref && deleteMe()) delete this; }
#else
#ifdef APPLE_CHANGES
static void *instanceToCheck;
void ref();
void deref();
#endif
#else /* APPLE_CHANGES not defined */
void ref() { _ref++; }
void deref() { if(_ref) _ref--; if(!_ref && deleteMe()) delete this; }
#endif /* APPLE_CHANGES not defined */
// ### KDE 3.0: add const
bool hasOneRef() { return _ref == 1; }
unsigned int refCount() const { return _ref; }
......
......@@ -41,6 +41,7 @@
#include "khtmlview.h"
using namespace DOM;
HTMLDocument::HTMLDocument() : Document(false) // create the impl here
{
impl = new HTMLDocumentImpl();
......@@ -178,11 +179,11 @@ HTMLCollection HTMLDocument::all() const
DOMString HTMLDocument::cookie() const
{
#ifdef APPLE_CHANGES
// FIXME: implement cookies
#ifdef _KWQ_
fprintf(stderr, "ERROR %s:%d %s (NOT YET IMPLEMENTED)\n", __FILE__, __LINE__, __FUNCTION__);
return DOMString("");
#else
#else /* APPLE_CHANGES not defined */
QCString replyType;
QByteArray params, reply;
QDataStream stream(params, IO_WriteOnly);
......@@ -203,14 +204,14 @@ DOMString HTMLDocument::cookie() const
QString result;
stream2 >> result;
return DOMString(result);
#endif
#endif /* APPLE_CHANGES not defined */
}
void HTMLDocument::setCookie( const DOMString & value )
{
#ifdef _KWQ_
#ifdef APPLE_CHANGES
fprintf(stderr, "ERROR %s:%d %s (NOT YET IMPLEMENTED)\n", __FILE__, __LINE__, __FUNCTION__);
#else
#else /* APPLE_CHANGES not defined */
long windowId = view()->winId();
QByteArray params;
QDataStream stream(params, IO_WriteOnly);
......@@ -223,7 +224,7 @@ void HTMLDocument::setCookie( const DOMString & value )
{
kdWarning(6010) << "Can't communicate with cookiejar!" << endl;
}
#endif
#endif /* APPLE_CHANGES not defined */
}
void HTMLDocument::open( )
......
/**
/**
* This file is part of the DOM implementation for KDE.
*
* (C) 1999 Lars Knoll (knoll@kde.org)
......
......@@ -26,7 +26,9 @@
#include <dom/dom_doc.h>
#include <kurl.h>
#include <qguardedptr.h>
#ifdef APPLE_CHANGES
#include <qvariant.h>
#endif /* APPLE_CHANGES */
namespace KJS {
......
......@@ -150,7 +150,7 @@ Completion DOMCSSStyleDeclarationFunc::tryExecute(const List &args)
String str = args[0].toString();
DOM::DOMString s = str.value().string();
switch (_id) {
switch (id) {
case GetPropertyValue:
result = getString(styleDecl.getPropertyValue(s));
break;
......@@ -294,7 +294,7 @@ Completion DOMStyleSheetListFunc::tryExecute(const List &args)
{
KJSO result;
if (_id == Item)
if (id == Item)
result = getDOMStyleSheet(styleSheetList.item(args[0].toNumber().intValue()));
return Completion(ReturnValue, result);
}
......@@ -357,7 +357,7 @@ Completion DOMMediaListFunc::tryExecute(const List &args)
{
KJSO result;
switch (_id) {
switch (id) {
case Item:
result = getString(mediaList.item(args[0].toNumber().intValue()));
break;
......@@ -408,7 +408,7 @@ Completion DOMCSSStyleSheetFunc::tryExecute(const List &args)
String str = args[0].toString();
DOM::DOMString s = str.value().string();
switch (_id) {
switch (id) {
case InsertRule:
result = Number(styleSheet.insertRule(args[0].toString().value().string(),(long unsigned int)args[1].toNumber().intValue()));
break;
......@@ -452,7 +452,7 @@ Completion DOMCSSRuleListFunc::tryExecute(const List &args)
{
KJSO result;
switch (_id) {
switch (id) {
case Item:
result = getDOMCSSRule(cssRuleList.item(args[0].toNumber().intValue()));
break;
......@@ -586,9 +586,9 @@ Completion DOMCSSRuleFunc::tryExecute(const List &args)
if (cssRule.type() == DOM::CSSRule::MEDIA_RULE) {
DOM::CSSMediaRule rule = static_cast<DOM::CSSMediaRule>(cssRule);
if (_id == InsertRule)
if (id == InsertRule)
result = Number(rule.insertRule(args[0].toString().value().string(),args[1].toNumber().intValue()));
else if (_id == DeleteRule)
else if (id == DeleteRule)
rule.deleteRule(args[0].toNumber().intValue());
}
......@@ -773,7 +773,7 @@ Completion DOMCSSPrimitiveValueFunc::tryExecute(const List &args)
{
KJSO result;
switch (_id) {
switch (id) {
case SetFloatValue:
val.setFloatValue(args[0].toNumber().intValue(),args[1].toNumber().value());
result = Undefined();
......@@ -879,7 +879,7 @@ Completion DOMCSSValueListFunc::tryExecute(const List &args)
{
KJSO result;
switch (_id) {
switch (id) {
case Item:
result = getDOMCSSValue(valueList.item(args[0].toNumber().intValue()));
break;
......
......@@ -28,6 +28,9 @@
#include <dom/css_rule.h>
#include "kjs_binding.h"
#if defined(APPLE_CHANGES) && defined(__OBJC__)
#define id id_
#endif /* APPLE_CHANGES, __OBJC__ */
namespace KJS {
class DOMCSSStyleDeclaration : public DOMObject {
......@@ -46,13 +49,13 @@ namespace KJS {
class DOMCSSStyleDeclarationFunc : public DOMFunction {
friend class DOMNode;
public:
DOMCSSStyleDeclarationFunc(DOM::CSSStyleDeclaration s, int i) : styleDecl(s), _id(i) { }
DOMCSSStyleDeclarationFunc(DOM::CSSStyleDeclaration s, int i) : styleDecl(s), id(i) { }
Completion tryExecute(const List &);
enum { GetPropertyValue, GetPropertyCSSValue, RemoveProperty, GetPropertyPriority,
SetProperty, Item };
private:
DOM::CSSStyleDeclaration styleDecl;
int _id;
int id;
};
KJSO getDOMCSSStyleDeclaration(DOM::CSSStyleDeclaration n);
......@@ -90,12 +93,12 @@ namespace KJS {
class DOMStyleSheetListFunc : public DOMFunction {
friend class DOMStyleSheetList;
public:
DOMStyleSheetListFunc(DOM::StyleSheetList ssl, int i) : styleSheetList(ssl), _id(i) { }
DOMStyleSheetListFunc(DOM::StyleSheetList ssl, int i) : styleSheetList(ssl), id(i) { }
Completion tryExecute(const List &);
enum { Item };
private:
DOM::StyleSheetList styleSheetList;
int _id;
int id;
};
class DOMMediaList : public DOMObject {
......@@ -116,12 +119,12 @@ namespace KJS {
class DOMMediaListFunc : public DOMFunction {
friend class DOMMediaList;
public:
DOMMediaListFunc(DOM::MediaList ml, int i) : mediaList(ml), _id(i) { }
DOMMediaListFunc(DOM::MediaList ml, int i) : mediaList(ml), id(i) { }
Completion tryExecute(const List &);
enum { Item, DeleteMedium, AppendMedium };
private:
DOM::MediaList mediaList;
int _id;
int id;
};
class DOMCSSStyleSheet : public DOMStyleSheet {
......@@ -137,12 +140,12 @@ namespace KJS {
class DOMCSSStyleSheetFunc : public DOMFunction {
friend class DOMNode;
public:
DOMCSSStyleSheetFunc(DOM::CSSStyleSheet ss, int i) : styleSheet(ss), _id(i) { }
DOMCSSStyleSheetFunc(DOM::CSSStyleSheet ss, int i) : styleSheet(ss), id(i) { }
Completion tryExecute(const List &);
enum { InsertRule, DeleteRule };
private:
DOM::CSSStyleSheet styleSheet;
int _id;
int id;