diff options
Diffstat (limited to 'khtml/html')
-rw-r--r-- | khtml/html/html_baseimpl.cpp | 16 | ||||
-rw-r--r-- | khtml/html/html_baseimpl.h | 4 | ||||
-rw-r--r-- | khtml/html/html_blockimpl.cpp | 8 | ||||
-rw-r--r-- | khtml/html/html_blockimpl.h | 4 | ||||
-rw-r--r-- | khtml/html/html_documentimpl.cpp | 84 | ||||
-rw-r--r-- | khtml/html/html_documentimpl.h | 6 | ||||
-rw-r--r-- | khtml/html/html_elementimpl.cpp | 22 | ||||
-rw-r--r-- | khtml/html/html_formimpl.cpp | 262 | ||||
-rw-r--r-- | khtml/html/html_formimpl.h | 58 | ||||
-rw-r--r-- | khtml/html/html_headimpl.cpp | 22 | ||||
-rw-r--r-- | khtml/html/html_headimpl.h | 8 | ||||
-rw-r--r-- | khtml/html/html_imageimpl.cpp | 60 | ||||
-rw-r--r-- | khtml/html/html_imageimpl.h | 20 | ||||
-rw-r--r-- | khtml/html/html_inlineimpl.cpp | 10 | ||||
-rw-r--r-- | khtml/html/html_miscimpl.cpp | 18 | ||||
-rw-r--r-- | khtml/html/html_miscimpl.h | 4 | ||||
-rw-r--r-- | khtml/html/html_objectimpl.cpp | 20 | ||||
-rw-r--r-- | khtml/html/html_objectimpl.h | 28 | ||||
-rw-r--r-- | khtml/html/html_tableimpl.cpp | 6 | ||||
-rw-r--r-- | khtml/html/htmlparser.cpp | 8 | ||||
-rw-r--r-- | khtml/html/htmlparser.h | 4 | ||||
-rw-r--r-- | khtml/html/htmltokenizer.cpp | 84 | ||||
-rw-r--r-- | khtml/html/htmltokenizer.h | 34 |
23 files changed, 395 insertions, 395 deletions
diff --git a/khtml/html/html_baseimpl.cpp b/khtml/html/html_baseimpl.cpp index babbac76d..9ebe26242 100644 --- a/khtml/html/html_baseimpl.cpp +++ b/khtml/html/html_baseimpl.cpp @@ -72,7 +72,7 @@ void HTMLBodyElementImpl::parseAttribute(AttributeImpl *attr) case ATTR_BACKGROUND: { - QString url = khtml::parseURL( attr->value() ).string(); + TQString url = khtml::parseURL( attr->value() ).string(); if (!url.isEmpty()) { url = getDocument()->completeURL( url ); addCSSProperty(CSS_PROP_BACKGROUND_IMAGE, "url('"+url+"')" ); @@ -124,7 +124,7 @@ void HTMLBodyElementImpl::parseAttribute(AttributeImpl *attr) m_styleSheet = new CSSStyleSheetImpl(this,DOMString(),true); m_styleSheet->ref(); } - QString aStr; + TQString aStr; if ( attr->id() == ATTR_LINK ) aStr = "a:link"; else if ( attr->id() == ATTR_VLINK ) @@ -187,13 +187,13 @@ void HTMLBodyElementImpl::insertedIntoDocument() KHTMLView* w = getDocument()->view(); if(w && w->marginWidth() != -1) { - QString s; + TQString s; s.sprintf( "%d", w->marginWidth() ); addCSSLength(CSS_PROP_MARGIN_LEFT, s); addCSSLength(CSS_PROP_MARGIN_RIGHT, s); } if(w && w->marginHeight() != -1) { - QString s; + TQString s; s.sprintf( "%d", w->marginHeight() ); addCSSLength(CSS_PROP_MARGIN_TOP, s); addCSSLength(CSS_PROP_MARGIN_BOTTOM, s); @@ -244,7 +244,7 @@ HTMLFrameElementImpl::HTMLFrameElementImpl(DocumentImpl *doc) frameBorderSet = false; marginWidth = -1; marginHeight = -1; - scrolling = QScrollView::Auto; + scrolling = TQScrollView::Auto; noresize = false; url = "about:blank"; } @@ -286,11 +286,11 @@ void HTMLFrameElementImpl::parseAttribute(AttributeImpl *attr) break; case ATTR_SCROLLING: if( strcasecmp( attr->value(), "auto" ) == 0 ) - scrolling = QScrollView::Auto; + scrolling = TQScrollView::Auto; else if( strcasecmp( attr->value(), "yes" ) == 0 ) - scrolling = QScrollView::AlwaysOn; + scrolling = TQScrollView::AlwaysOn; else if( strcasecmp( attr->value(), "no" ) == 0 ) - scrolling = QScrollView::AlwaysOff; + scrolling = TQScrollView::AlwaysOff; // when attached, has no effect break; case ATTR_ONLOAD: diff --git a/khtml/html/html_baseimpl.h b/khtml/html/html_baseimpl.h index f30dc81f6..b04afd749 100644 --- a/khtml/html/html_baseimpl.h +++ b/khtml/html/html_baseimpl.h @@ -31,7 +31,7 @@ #include "html/html_elementimpl.h" #include "misc/khtmllayout.h" -#include <qscrollview.h> +#include <tqscrollview.h> class KHTMLView; class KHTMLPart; @@ -103,7 +103,7 @@ public: int marginWidth; int marginHeight; - QScrollView::ScrollBarMode scrolling; + TQScrollView::ScrollBarMode scrolling; bool frameBorder : 1; bool frameBorderSet : 1; diff --git a/khtml/html/html_blockimpl.cpp b/khtml/html/html_blockimpl.cpp index ac6d6436c..41cdaccea 100644 --- a/khtml/html/html_blockimpl.cpp +++ b/khtml/html/html_blockimpl.cpp @@ -127,10 +127,10 @@ void HTMLHRElementImpl::attach() addCSSProperty(CSS_PROP_BORDER_TOP_WIDTH, n); addCSSProperty(CSS_PROP_BORDER_LEFT_WIDTH, n); addCSSProperty(CSS_PROP_BORDER_RIGHT_WIDTH, n); - addCSSLength(CSS_PROP_HEIGHT, DOMString(QString::number(_s-2))); + addCSSLength(CSS_PROP_HEIGHT, DOMString(TQString::number(_s-2))); } else if (_s >= 0) { - addCSSProperty(CSS_PROP_BORDER_TOP_WIDTH, DOMString(QString::number(_s))); + addCSSProperty(CSS_PROP_BORDER_TOP_WIDTH, DOMString(TQString::number(_s))); addCSSProperty(CSS_PROP_BORDER_BOTTOM_WIDTH, DOMString("0")); } } @@ -344,13 +344,13 @@ void HTMLLayerElementImpl::insertedIntoDocument() HTMLDivElementImpl::insertedIntoDocument(); } -void HTMLLayerElementImpl::removeId(const QString& id) +void HTMLLayerElementImpl::removeId(const TQString& id) { getDocument()->underDocNamedCache().remove(id, this); HTMLDivElementImpl::removeId(id); } -void HTMLLayerElementImpl::addId (const QString& id) +void HTMLLayerElementImpl::addId (const TQString& id) { getDocument()->underDocNamedCache().add(id, this); HTMLDivElementImpl::addId(id); diff --git a/khtml/html/html_blockimpl.h b/khtml/html/html_blockimpl.h index a3a1b8994..f560583db 100644 --- a/khtml/html/html_blockimpl.h +++ b/khtml/html/html_blockimpl.h @@ -95,8 +95,8 @@ public: virtual void removedFromDocument(); virtual void insertedIntoDocument(); - virtual void addId(const QString& id); - virtual void removeId(const QString& id); + virtual void addId(const TQString& id); + virtual void removeId(const TQString& id); private: DOMString m_name; bool fixed; diff --git a/khtml/html/html_documentimpl.cpp b/khtml/html/html_documentimpl.cpp index 59ec6859f..e2ee3ba57 100644 --- a/khtml/html/html_documentimpl.cpp +++ b/khtml/html/html_documentimpl.cpp @@ -55,7 +55,7 @@ #include "css/cssstyleselector.h" #include "css/css_stylesheetimpl.h" #include <stdlib.h> -#include <qptrstack.h> +#include <tqptrstack.h> // Turn off inlining to avoid warning with newer gcc. #undef __inline @@ -63,7 +63,7 @@ #include "doctypes.cpp" #undef __inline -template class QPtrStack<DOM::NodeImpl>; +template class TQPtrStack<DOM::NodeImpl>; using namespace DOM; using namespace khtml; @@ -78,13 +78,13 @@ HTMLDocumentImpl::HTMLDocumentImpl(DOMImplementationImpl *_implementation, KHTML m_doAutoFill = false; /* dynamic history stuff to be fixed later (pfeiffer) - connect( KHTMLFactory::vLinks(), SIGNAL( removed( const QString& )), - SLOT( slotHistoryChanged() )); + connect( KHTMLFactory::vLinks(), TQT_SIGNAL( removed( const TQString& )), + TQT_SLOT( slotHistoryChanged() )); */ - connect( KHTMLFactory::vLinks(), SIGNAL( inserted( const QString& ) ), - SLOT( slotHistoryChanged() )); - connect( KHTMLFactory::vLinks(), SIGNAL( cleared()), - SLOT( slotHistoryChanged() )); + connect( KHTMLFactory::vLinks(), TQT_SIGNAL( inserted( const TQString& ) ), + TQT_SLOT( slotHistoryChanged() )); + connect( KHTMLFactory::vLinks(), TQT_SIGNAL( cleared()), + TQT_SLOT( slotHistoryChanged() )); } HTMLDocumentImpl::~HTMLDocumentImpl() @@ -113,26 +113,26 @@ DOMString HTMLDocumentImpl::cookie() const if ( v && v->topLevelWidget() ) windowId = v->topLevelWidget()->winId(); - QCString replyType; - QByteArray params, reply; - QDataStream stream(params, IO_WriteOnly); + TQCString replyType; + TQByteArray params, reply; + TQDataStream stream(params, IO_WriteOnly); stream << URL().url() << windowId; if (!kapp->dcopClient()->call("kcookiejar", "kcookiejar", - "findDOMCookies(QString,long int)", params, + "findDOMCookies(TQString,long int)", params, replyType, reply)) { kdWarning(6010) << "Can't communicate with cookiejar!" << endl; return DOMString(); } - QDataStream stream2(reply, IO_ReadOnly); - if(replyType != "QString") { + TQDataStream stream2(reply, IO_ReadOnly); + if(replyType != "TQString") { kdError(6010) << "DCOP function findDOMCookies(...) returns " - << replyType << ", expected QString" << endl; + << replyType << ", expected TQString" << endl; return DOMString(); } - QString result; + TQString result; stream2 >> result; return DOMString(result); } @@ -145,19 +145,19 @@ void HTMLDocumentImpl::setCookie( const DOMString & value ) if ( v && v->topLevelWidget() ) windowId = v->topLevelWidget()->winId(); - QByteArray params; - QDataStream stream(params, IO_WriteOnly); - QCString fake_header("Set-Cookie: "); + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); + TQCString fake_header("Set-Cookie: "); fake_header.append(value.string().latin1()); fake_header.append("\n"); stream << URL().url() << fake_header << windowId; if (!kapp->dcopClient()->send("kcookiejar", "kcookiejar", - "addCookies(QString,QCString,long int)", params)) + "addCookies(TQString,TQCString,long int)", params)) { // Maybe it wasn't running (e.g. we're opening local html files) KApplication::startServiceByDesktopName( "kcookiejar"); if (!kapp->dcopClient()->send("kcookiejar", "kcookiejar", - "addCookies(QString,QCString,long int)", params)) + "addCookies(TQString,TQCString,long int)", params)) kdWarning(6010) << "Can't communicate with cookiejar!" << endl; } } @@ -231,13 +231,13 @@ void HTMLDocumentImpl::slotHistoryChanged() HTMLMapElementImpl* HTMLDocumentImpl::getMap(const DOMString& _url) { - QString url = _url.string(); - QString s; + TQString url = _url.string(); + TQString s; int pos = url.find('#'); //kdDebug(0) << "map pos of #:" << pos << endl; - s = QString(_url.unicode() + pos + 1, _url.length() - pos - 1); + s = TQString(_url.unicode() + pos + 1, _url.length() - pos - 1); - QMapConstIterator<QString,HTMLMapElementImpl*> it = mapMap.find(s); + TQMapConstIterator<TQString,HTMLMapElementImpl*> it = mapMap.find(s); if (it != mapMap.end()) return *it; @@ -288,10 +288,10 @@ const int PARSEMODE_HAVE_PUBLIC_ID = (1<<1); const int PARSEMODE_HAVE_SYSTEM_ID = (1<<2); const int PARSEMODE_HAVE_INTERNAL = (1<<3); -static int parseDocTypePart(const QString& buffer, int index) +static int parseDocTypePart(const TQString& buffer, int index) { while (true) { - QChar ch = buffer[index]; + TQChar ch = buffer[index]; if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') ++index; else if (ch == '-') { @@ -307,22 +307,22 @@ static int parseDocTypePart(const QString& buffer, int index) } } -static bool containsString(const char* str, const QString& buffer, int offset) +static bool containsString(const char* str, const TQString& buffer, int offset) { - QString startString(str); + TQString startString(str); if (offset + startString.length() > buffer.length()) return false; - QString bufferString = buffer.mid(offset, startString.length()).lower(); - QString lowerStart = startString.lower(); + TQString bufferString = buffer.mid(offset, startString.length()).lower(); + TQString lowerStart = startString.lower(); return bufferString.startsWith(lowerStart); } -static bool parseDocTypeDeclaration(const QString& buffer, +static bool parseDocTypeDeclaration(const TQString& buffer, int* resultFlags, - QString& publicID, - QString& systemID) + TQString& publicID, + TQString& systemID) { bool haveDocType = false; *resultFlags = 0; @@ -332,7 +332,7 @@ static bool parseDocTypeDeclaration(const QString& buffer, do { index = buffer.find('<', index); if (index == -1) break; - QChar nextChar = buffer[index+1]; + TQChar nextChar = buffer[index+1]; if (nextChar == '!') { if (containsString("doctype", buffer, index+2)) { haveDocType = true; @@ -364,7 +364,7 @@ static bool parseDocTypeDeclaration(const QString& buffer, // We've read <!DOCTYPE HTML PUBLIC (not case sensitive). // Now we find the beginning and end of the public identifers // and system identifiers (assuming they're even present). - QChar theChar = buffer[index]; + TQChar theChar = buffer[index]; if (theChar != '\"' && theChar != '\'') return false; @@ -375,7 +375,7 @@ static bool parseDocTypeDeclaration(const QString& buffer, if (publicIDEnd == -1) return false; index = parseDocTypePart(buffer, publicIDEnd+1); - QChar next = buffer[index]; + TQChar next = buffer[index]; if (next == '>') { // Public identifier present, but no system identifier. // Do nothing. Note that this is the most common @@ -406,7 +406,7 @@ static bool parseDocTypeDeclaration(const QString& buffer, // Doctype has a system ID but no public ID *resultFlags |= PARSEMODE_HAVE_SYSTEM_ID; index = parseDocTypePart(buffer, index+6); - QChar next = buffer[index]; + TQChar next = buffer[index]; if (next != '\"' && next != '\'') return false; int systemIDStart = index+1; @@ -417,7 +417,7 @@ static bool parseDocTypeDeclaration(const QString& buffer, index = parseDocTypePart(buffer, systemIDEnd+1); } - QChar nextChar = buffer[index]; + TQChar nextChar = buffer[index]; if (nextChar == '[') *resultFlags |= PARSEMODE_HAVE_INTERNAL; else if (nextChar != '>') @@ -427,7 +427,7 @@ static bool parseDocTypeDeclaration(const QString& buffer, return true; } -void HTMLDocumentImpl::determineParseMode( const QString &str ) +void HTMLDocumentImpl::determineParseMode( const TQString &str ) { //kdDebug() << "DocumentImpl::determineParseMode str=" << str<< endl; int oldPMode = pMode; @@ -446,7 +446,7 @@ void HTMLDocumentImpl::determineParseMode( const QString &str ) // STRICT - no quirks apply. Web pages will obey the specifications to // the letter. - QString systemID, publicID; + TQString systemID, publicID; int resultFlags = 0; if (parseDocTypeDeclaration(str, &resultFlags, publicID, systemID)) { if (resultFlags & PARSEMODE_HAVE_DOCTYPE) { @@ -469,7 +469,7 @@ void HTMLDocumentImpl::determineParseMode( const QString &str ) else { // We have to check a list of public IDs to see what we // should do. - QString lowerPubID = publicID.lower(); + TQString lowerPubID = publicID.lower(); const char* pubIDStr = lowerPubID.latin1(); // Look up the entry in our gperf-generated table. diff --git a/khtml/html/html_documentimpl.h b/khtml/html/html_documentimpl.h index 20f9ddb2f..b4eed345c 100644 --- a/khtml/html/html_documentimpl.h +++ b/khtml/html/html_documentimpl.h @@ -27,7 +27,7 @@ #include "xml/dom_docimpl.h" #include "html/html_miscimpl.h" -#include <qmap.h> +#include <tqmap.h> class KHTMLView; class QString; @@ -66,7 +66,7 @@ public: HTMLMapElementImpl* getMap(const DOMString& url_); - virtual void determineParseMode( const QString &str ); + virtual void determineParseMode( const TQString &str ); virtual void close(); void setAutoFill() { m_doAutoFill = true; } @@ -79,7 +79,7 @@ protected: HTMLElementImpl *htmlElement; friend class HTMLMapElementImpl; friend class HTMLImageElementImpl; - QMap<QString,HTMLMapElementImpl*> mapMap; + TQMap<TQString,HTMLMapElementImpl*> mapMap; bool m_doAutoFill; bool m_htmlRequested; diff --git a/khtml/html/html_elementimpl.cpp b/khtml/html/html_elementimpl.cpp index cd47ea728..e6269d8b5 100644 --- a/khtml/html/html_elementimpl.cpp +++ b/khtml/html/html_elementimpl.cpp @@ -176,7 +176,7 @@ void HTMLElementImpl::parseAttribute(AttributeImpl *attr) case ATTR_CLASS: if (attr->val()) { DOMString v = attr->value(); - const QChar* s = v.unicode(); + const TQChar* s = v.unicode(); int l = v.length(); while( l && !s->isSpace() ) l--,s++; @@ -305,7 +305,7 @@ void HTMLElementImpl::addCSSLength(int id, const DOMString &value, bool numOnly, if ( value.implementation() ) { // match \s*[+-]?\d*(\.\d*)?[%\*]? unsigned i = 0, j = 0; - QChar* s = value.implementation()->s; + TQChar* s = value.implementation()->s; unsigned l = value.implementation()->l; while (i < l && s[i].isSpace()) @@ -318,7 +318,7 @@ void HTMLElementImpl::addCSSLength(int id, const DOMString &value, bool numOnly, // no digits! if (j == 0) return; - int v = kClamp( QConstString(s, i).string().toInt(), -8192, 8191 ) ; + int v = kClamp( TQConstString(s, i).string().toInt(), -8192, 8191 ) ; const char* suffix = "px"; if (!numOnly || multiLength) { // look if we find a % or * @@ -336,7 +336,7 @@ void HTMLElementImpl::addCSSLength(int id, const DOMString &value, bool numOnly, } if (numOnly) suffix = ""; - QString ns = QString::number(v) + suffix; + TQString ns = TQString::number(v) + suffix; m_styleDecls->setLengthProperty( id, DOMString( ns ), false, true, multiLength ); setChanged(); return; @@ -346,13 +346,13 @@ void HTMLElementImpl::addCSSLength(int id, const DOMString &value, bool numOnly, setChanged(); } -static inline bool isHexDigit( const QChar &c ) { +static inline bool isHexDigit( const TQChar &c ) { return ( c >= '0' && c <= '9' ) || ( c >= 'a' && c <= 'f' ) || ( c >= 'A' && c <= 'F' ); } -static inline int toHex( const QChar &c ) { +static inline int toHex( const TQChar &c ) { return ( (c >= '0' && c <= '9') ? (c.unicode() - '0') : ( ( c >= 'a' && c <= 'f' ) @@ -376,7 +376,7 @@ void HTMLElementImpl::addHTMLColor( int id, const DOMString &c ) if ( m_styleDecls->setProperty(id, c, false, true) ) return; - QString color = c.string(); + TQString color = c.string(); // not something that fits the specs. // we're emulating IEs color parser here. It maps transparent to black, otherwise it tries to build a rgb value @@ -454,17 +454,17 @@ void HTMLElementImpl::removeCSSProperty(int id) DOMString HTMLElementImpl::innerHTML() const { - QString result; //Use QString to accumulate since DOMString is poor for appends + TQString result; //Use TQString to accumulate since DOMString is poor for appends for (NodeImpl *child = firstChild(); child != NULL; child = child->nextSibling()) { DOMString kid = child->toString(); - result += QConstString(kid.unicode(), kid.length()).string(); + result += TQConstString(kid.unicode(), kid.length()).string(); } return result; } DOMString HTMLElementImpl::innerText() const { - QString text = ""; + TQString text = ""; if(!firstChild()) return text; @@ -486,7 +486,7 @@ DOMString HTMLElementImpl::innerText() const } if(n->isTextNode() ) { DOMStringImpl* data = static_cast<const TextImpl *>(n)->string(); - text += QConstString(data->s, data->l).string(); + text += TQConstString(data->s, data->l).string(); } } end: diff --git a/khtml/html/html_formimpl.cpp b/khtml/html/html_formimpl.cpp index 1abaa606a..1d581d78b 100644 --- a/khtml/html/html_formimpl.cpp +++ b/khtml/html/html_formimpl.cpp @@ -58,12 +58,12 @@ #endif #include <netaccess.h> #include <kfileitem.h> -#include <qfile.h> -#include <qdir.h> -#include <qtextcodec.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqtextcodec.h> // for keygen -#include <qstring.h> +#include <tqstring.h> #include <ksslkeygen.h> #include <assert.h> @@ -93,10 +93,10 @@ HTMLFormElementImpl::~HTMLFormElementImpl() if (getDocument() && getDocument()->view() && getDocument()->view()->part()) { getDocument()->view()->part()->dequeueWallet(this); } - QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); + TQPtrListIterator<HTMLGenericFormElementImpl> it(formElements); for (; it.current(); ++it) it.current()->m_form = 0; - QPtrListIterator<HTMLImageElementImpl> it2(imgElements); + TQPtrListIterator<HTMLImageElementImpl> it2(imgElements); for (; it2.current(); ++it2) it2.current()->m_form = 0; } @@ -109,7 +109,7 @@ NodeImpl::Id HTMLFormElementImpl::id() const long HTMLFormElementImpl::length() const { int len = 0; - QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); + TQPtrListIterator<HTMLGenericFormElementImpl> it(formElements); for (; it.current(); ++it) if (it.current()->isEnumeratable()) ++len; @@ -117,19 +117,19 @@ long HTMLFormElementImpl::length() const return len; } -static QCString encodeCString(const QCString& e) +static TQCString encodeCString(const TQCString& e) { // http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1 // safe characters like NS handles them for compatibility static const char *safe = "-._*"; - QCString encoded(( e.length()+e.contains( '\n' ) )*3 + TQCString encoded(( e.length()+e.contains( '\n' ) )*3 +e.contains('\r') * 3 + 1); int enclen = 0; bool crmissing = false; unsigned char oldc; unsigned char c ='\0'; - //QCString orig(e.data(), e.size()); + //TQCString orig(e.data(), e.size()); unsigned len = e.length(); for(unsigned pos = 0; pos < len; pos++) { @@ -184,15 +184,15 @@ static QCString encodeCString(const QCString& e) // ### This function only encodes to numeric ampersand escapes, // ### we could use standard ampersand values as well. -inline static QString escapeUnencodeable(const QTextCodec* codec, const QString& s) { - QString enc_string; +inline static TQString escapeUnencodeable(const TQTextCodec* codec, const TQString& s) { + TQString enc_string; const int len = s.length(); for(int i=0; i <len; ++i) { - const QChar c = s[i]; + const TQChar c = s[i]; if (codec->canEncode(c)) enc_string.append(c); else { - QString ampersandEscape; + TQString ampersandEscape; ampersandEscape.sprintf("&#%u;", c.unicode()); enc_string.append(ampersandEscape); } @@ -200,37 +200,37 @@ inline static QString escapeUnencodeable(const QTextCodec* codec, const QString& return enc_string; } -inline static QCString fixUpfromUnicode(const QTextCodec* codec, const QString& s) +inline static TQCString fixUpfromUnicode(const TQTextCodec* codec, const TQString& s) { - QCString str = codec->fromUnicode(escapeUnencodeable(codec,s)); + TQCString str = codec->fromUnicode(escapeUnencodeable(codec,s)); str.truncate(str.length()); return str; } -QByteArray HTMLFormElementImpl::formData(bool& ok) +TQByteArray HTMLFormElementImpl::formData(bool& ok) { #ifdef FORMS_DEBUG kdDebug( 6030 ) << "form: formData()" << endl; #endif - QByteArray form_data(0); - QCString enc_string = ""; // used for non-multipart data + TQByteArray form_data(0); + TQCString enc_string = ""; // used for non-multipart data // find out the QTextcodec to use - const QString str = m_acceptcharset.string(); - const QChar space(' '); + const TQString str = m_acceptcharset.string(); + const TQChar space(' '); const unsigned int strLength = str.length(); for(unsigned int i=0; i < strLength; ++i) if(str[i].latin1() == ',') str[i] = space; - const QStringList charsets = QStringList::split(' ', str); - QTextCodec* codec = 0; + const TQStringList charsets = TQStringList::split(' ', str); + TQTextCodec* codec = 0; KHTMLView *view = getDocument()->view(); { - QStringList::ConstIterator it = charsets.begin(); - const QStringList::ConstIterator itEnd = charsets.end(); + TQStringList::ConstIterator it = charsets.begin(); + const TQStringList::ConstIterator itEnd = charsets.end(); for ( ; it != itEnd; ++it ) { - QString enc = (*it); + TQString enc = (*it); if(enc.contains("UNKNOWN")) { // use standard document encoding @@ -243,21 +243,21 @@ QByteArray HTMLFormElementImpl::formData(bool& ok) } } if(!codec) - codec = QTextCodec::codecForLocale(); + codec = TQTextCodec::codecForLocale(); // we need to map visual hebrew to logical hebrew, as the web // server alsways expects responses in logical ordering if ( codec->mibEnum() == 11 ) - codec = QTextCodec::codecForMib( 85 ); + codec = TQTextCodec::codecForMib( 85 ); m_encCharset = codec->name(); const unsigned int m_encCharsetLength = m_encCharset.length(); for(unsigned int i=0; i < m_encCharsetLength; ++i) - m_encCharset[i] = m_encCharset[i].latin1() == ' ' ? QChar('-') : m_encCharset[i].lower(); + m_encCharset[i] = m_encCharset[i].latin1() == ' ' ? TQChar('-') : m_encCharset[i].lower(); - QStringList fileUploads, fileNotUploads; + TQStringList fileUploads, fileNotUploads; - for (QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { + for (TQPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { HTMLGenericFormElementImpl* const current = it.current(); khtml::encodingList lst; @@ -288,7 +288,7 @@ QByteArray HTMLFormElementImpl::formData(bool& ok) } else { - QCString hstr("--"); + TQCString hstr("--"); hstr += m_boundary.latin1(); hstr += "\r\n"; hstr += "Content-Disposition: form-data; name=\""; @@ -302,10 +302,10 @@ QByteArray HTMLFormElementImpl::formData(bool& ok) current->renderer()) { KURL path; - QString val = static_cast<HTMLInputElementImpl*>(current)->value().string().stripWhiteSpace(); + TQString val = static_cast<HTMLInputElementImpl*>(current)->value().string().stripWhiteSpace(); if (!val.isEmpty() && - QDir::isRelativePath(val) && - QFile::exists(KGlobalSettings::documentPath() + val)) { + TQDir::isRelativePath(val) && + TQFile::exists(KGlobalSettings::documentPath() + val)) { path.setPath(KGlobalSettings::documentPath() + val); } else { path = KURL::fromPathOrURL(val); @@ -359,7 +359,7 @@ QByteArray HTMLFormElementImpl::formData(bool& ok) if (result == KMessageBox::Cancel) { ok = false; - return QByteArray(); + return TQByteArray(); } } @@ -374,7 +374,7 @@ QByteArray HTMLFormElementImpl::formData(bool& ok) if (result == KMessageBox::Cancel) { ok = false; - return QByteArray(); + return TQByteArray(); } } @@ -406,27 +406,27 @@ void HTMLFormElementImpl::setEnctype( const DOMString& type ) m_enctype = "application/x-www-form-urlencoded"; m_multipart = false; } - m_encCharset = QString::null; + m_encCharset = TQString::null; } -static QString calculateAutoFillKey(const HTMLFormElementImpl& e) +static TQString calculateAutoFillKey(const HTMLFormElementImpl& e) { KURL k(e.getDocument()->URL()); - k.setRef(QString::null); - k.setQuery(QString::null); + k.setRef(TQString::null); + k.setQuery(TQString::null); // ensure that we have the user / password inside the url // otherwise we might have a potential security problem // by saving passwords under wrong lookup key. - const QString name = e.getAttribute(ATTR_NAME).string().stripWhiteSpace(); - const QRegExp re("[;,!]"); - const QStringList url = QStringList::split(re, k.url()); + const TQString name = e.getAttribute(ATTR_NAME).string().stripWhiteSpace(); + const TQRegExp re("[;,!]"); + const TQStringList url = TQStringList::split(re, k.url()); return url[0] + '#' + name; } void HTMLFormElementImpl::doAutoFill() { #ifndef KHTML_NO_WALLET - const QString key = calculateAutoFillKey(*this); + const TQString key = calculateAutoFillKey(*this); if (KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(), KWallet::Wallet::FormDataFolder(), @@ -442,16 +442,16 @@ void HTMLFormElementImpl::doAutoFill() void HTMLFormElementImpl::walletOpened(KWallet::Wallet *w) { #ifndef KHTML_NO_WALLET assert(w); - const QString key = calculateAutoFillKey(*this); + const TQString key = calculateAutoFillKey(*this); if (!w->hasFolder(KWallet::Wallet::FormDataFolder())) { return; // failed } w->setFolder(KWallet::Wallet::FormDataFolder()); - QMap<QString, QString> map; + TQMap<TQString, TQString> map; if (w->readMap(key, map)) return; // failed, abort - for (QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { + for (TQPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { if (it.current()->id() == ID_INPUT) { HTMLInputElementImpl* const current = static_cast<HTMLInputElementImpl*>(it.current()); if ((current->inputType() == HTMLInputElementImpl::PASSWORD || @@ -472,7 +472,7 @@ void HTMLFormElementImpl::submitFromKeyboard() // if there is none, do a submit anyway if not more // than one <input type=text> or <input type=password> unsigned int inputtext = 0; - for (QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { + for (TQPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { if (it.current()->id() == ID_BUTTON) { HTMLButtonElementImpl* const current = static_cast<HTMLButtonElementImpl *>(it.current()); if (current->buttonType() == HTMLButtonElementImpl::SUBMIT && !current->disabled()) { @@ -513,7 +513,7 @@ void HTMLFormElementImpl::gatherWalletData() m_haveTextarea = false; const KURL formUrl(getDocument()->URL()); if (view && !view->nonPasswordStorableSite(formUrl.host())) { - for (QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { + for (TQPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { if (it.current()->id() == ID_INPUT) { HTMLInputElementImpl* const c = static_cast<HTMLInputElementImpl*> (it.current()); if ((c->inputType() == HTMLInputElementImpl::TEXT || @@ -570,7 +570,7 @@ void HTMLFormElementImpl::submit( ) bool ok; KHTMLView* const view = getDocument()->view(); - const QByteArray form_data = formData(ok); + const TQByteArray form_data = formData(ok); const KURL formUrl(getDocument()->URL()); if (ok && view) { @@ -579,7 +579,7 @@ void HTMLFormElementImpl::submit( ) } #ifndef KHTML_NO_WALLET if (m_havePassword && !m_haveTextarea && KWallet::Wallet::isEnabled()) { - const QString key = calculateAutoFillKey(*this); + const TQString key = calculateAutoFillKey(*this); const bool doesnotexist = KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(), KWallet::Wallet::FormDataFolder(), key); KWallet::Wallet* const w = view->part()->wallet(); bool login_changed = false; @@ -589,10 +589,10 @@ void HTMLFormElementImpl::submit( ) // we had so far. if (w->hasFolder(KWallet::Wallet::FormDataFolder())) { w->setFolder(KWallet::Wallet::FormDataFolder()); - QMap<QString, QString> map; + TQMap<TQString, TQString> map; if (!w->readMap(key, map)) { - QMapConstIterator<QString, QString> it = map.begin(); - const QMapConstIterator<QString, QString> itEnd = map.end(); + TQMapConstIterator<TQString, TQString> it = map.begin(); + const TQMapConstIterator<TQString, TQString> itEnd = map.end(); for ( ; it != itEnd; ++it ) if ( map[it.key()] != m_walletMap[it.key()] ) { login_changed = true; @@ -613,9 +613,9 @@ void HTMLFormElementImpl::submit( ) i18n("Store"), KGuiItem(i18n("Ne&ver for This Site")), i18n("Do Not Store")); bool checkboxResult = false; - const int savePassword = KMessageBox::createKMessageBox(dialog, QMessageBox::Information, + const int savePassword = KMessageBox::createKMessageBox(dialog, TQMessageBox::Information, i18n("Store passwords on this page?"), - QStringList(), QString::null, &checkboxResult, KMessageBox::Notify); + TQStringList(), TQString::null, &checkboxResult, KMessageBox::Notify); if ( savePassword == KDialogBase::Yes ) { // ensure that we have the user / password inside the url @@ -668,7 +668,7 @@ void HTMLFormElementImpl::reset( ) return; } - for (QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) + for (TQPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) it.current()->reset(); m_inreset = false; @@ -732,13 +732,13 @@ void HTMLFormElementImpl::insertedIntoDocument() HTMLElementImpl::insertedIntoDocument(); } -void HTMLFormElementImpl::removeId(const QString& id) +void HTMLFormElementImpl::removeId(const TQString& id) { getDocument()->underDocNamedCache().remove(id, this); HTMLElementImpl::removeId(id); } -void HTMLFormElementImpl::addId (const QString& id) +void HTMLFormElementImpl::addId (const TQString& id) { getDocument()->underDocNamedCache().add(id, this); HTMLElementImpl::addId(id); @@ -747,7 +747,7 @@ void HTMLFormElementImpl::addId (const QString& id) void HTMLFormElementImpl::radioClicked( HTMLGenericFormElementImpl *caller ) { - for (QPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { + for (TQPtrListIterator<HTMLGenericFormElementImpl> it(formElements); it.current(); ++it) { HTMLGenericFormElementImpl* const current = it.current(); if (current->id() == ID_INPUT && static_cast<HTMLInputElementImpl*>(current)->inputType() == HTMLInputElementImpl::RADIO && @@ -956,16 +956,16 @@ bool HTMLGenericFormElementImpl::isFocusable() const if (!m_render || !m_render->isWidget()) return false; - QWidget* widget = static_cast<RenderWidget*>(m_render)->widget(); - return widget && widget->focusPolicy() >= QWidget::TabFocus; + TQWidget* widget = static_cast<RenderWidget*>(m_render)->widget(); + return widget && widget->focusPolicy() >= TQWidget::TabFocus; } class FocusHandleWidget : public QWidget { public: void focusNextPrev(bool n) { - if (!focusNextPrevChild(n) && inherits("QTextEdit")) - QWidget::focusNextPrevChild(n); + if (!focusNextPrevChild(n) && inherits("TQTextEdit")) + TQWidget::focusNextPrevChild(n); } }; @@ -994,7 +994,7 @@ void HTMLGenericFormElementImpl::defaultEventHandler(EventImpl *evt) KHTMLView* const view = getDocument()->view(); if (view && evt->id() == EventImpl::DOMFOCUSIN_EVENT && isEditable() && m_render && m_render->isWidget()) { KHTMLPartBrowserExtension *ext = static_cast<KHTMLPartBrowserExtension *>(view->part()->browserExtension()); - QWidget* const widget = static_cast<RenderWidget*>(m_render)->widget(); + TQWidget* const widget = static_cast<RenderWidget*>(m_render)->widget(); if (ext) ext->editableWidgetFocused(widget); } @@ -1017,14 +1017,14 @@ void HTMLGenericFormElementImpl::defaultEventHandler(EventImpl *evt) if (!evt->defaultHandled() && m_render && m_render->isWidget()) { // handle tabbing out, either from a single or repeated key event. if ( evt->id() == EventImpl::KEYPRESS_EVENT && evt->isKeyRelatedEvent() ) { - QKeyEvent* const k = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent(); + TQKeyEvent* const k = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent(); if ( k && (k->key() == Qt::Key_Tab || k->key() == Qt::Key_BackTab) ) { - QWidget* const widget = static_cast<RenderWidget*>(m_render)->widget(); - QFocusEvent::setReason( k->key() == Qt::Key_Tab ? QFocusEvent::Tab : QFocusEvent::Backtab ); + TQWidget* const widget = static_cast<RenderWidget*>(m_render)->widget(); + TQFocusEvent::setReason( k->key() == Qt::Key_Tab ? TQFocusEvent::Tab : TQFocusEvent::Backtab ); if (widget) static_cast<FocusHandleWidget *>(widget) ->focusNextPrev(k->key() == Qt::Key_Tab); - QFocusEvent::resetReason(); + TQFocusEvent::resetReason(); evt->setDefaultHandled(); } } @@ -1033,7 +1033,7 @@ void HTMLGenericFormElementImpl::defaultEventHandler(EventImpl *evt) if (view && evt->id() == EventImpl::DOMFOCUSOUT_EVENT && isEditable() && m_render && m_render->isWidget()) { KHTMLPartBrowserExtension* const ext = static_cast<KHTMLPartBrowserExtension *>(view->part()->browserExtension()); - QWidget* const widget = static_cast<RenderWidget*>(m_render)->widget(); + TQWidget* const widget = static_cast<RenderWidget*>(m_render)->widget(); if (ext) ext->editableWidgetBlurred(widget); @@ -1118,7 +1118,7 @@ void HTMLButtonElementImpl::defaultEventHandler(EventImpl *evt) if (m_type != BUTTON && !m_disabled) { bool act = (evt->id() == EventImpl::DOMACTIVATE_EVENT); if (!act && evt->id()==EventImpl::KEYUP_EVENT && evt->isKeyRelatedEvent()) { - QKeyEvent* const ke = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent(); + TQKeyEvent* const ke = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent(); if (ke && active() && (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Space)) act = true; } @@ -1143,17 +1143,17 @@ void HTMLButtonElementImpl::activate() void HTMLButtonElementImpl::click() { - QMouseEvent me(QEvent::MouseButtonRelease, QPoint(0,0),Qt::LeftButton, 0); + TQMouseEvent me(TQEvent::MouseButtonRelease, TQPoint(0,0),Qt::LeftButton, 0); dispatchMouseEvent(&me,EventImpl::CLICK_EVENT, 1); } -bool HTMLButtonElementImpl::encoding(const QTextCodec* codec, khtml::encodingList& encoding, bool /*multipart*/) +bool HTMLButtonElementImpl::encoding(const TQTextCodec* codec, khtml::encodingList& encoding, bool /*multipart*/) { if (m_type != SUBMIT || name().isEmpty() || !m_activeSubmit) return false; encoding += fixUpfromUnicode(codec, name().string()); - const QString enc_str = m_currValue.isNull() ? QString("") : m_currValue; + const TQString enc_str = m_currValue.isNull() ? TQString("") : m_currValue; encoding += fixUpfromUnicode(codec, enc_str); return true; @@ -1312,14 +1312,14 @@ DOMString HTMLInputElementImpl::type() const } } -QString HTMLInputElementImpl::state( ) +TQString HTMLInputElementImpl::state( ) { switch (m_type) { case PASSWORD: - return QString::fromLatin1("."); // empty string, avoid restoring + return TQString::fromLatin1("."); // empty string, avoid restoring case CHECKBOX: case RADIO: - return QString::fromLatin1(checked() ? "on" : "off"); + return TQString::fromLatin1(checked() ? "on" : "off"); case TEXT: if (autoComplete() && value() != getAttribute(ATTR_VALUE) && getDocument()->view()) getDocument()->view()->addFormCompletionItem(name().string(), value().string()); @@ -1329,12 +1329,12 @@ QString HTMLInputElementImpl::state( ) } } -void HTMLInputElementImpl::restoreState(const QString &state) +void HTMLInputElementImpl::restoreState(const TQString &state) { switch (m_type) { case CHECKBOX: case RADIO: - setChecked((state == QString::fromLatin1("on"))); + setChecked((state == TQString::fromLatin1("on"))); break; case FILE: m_value = DOMString(state.left(state.length()-1)); @@ -1359,7 +1359,7 @@ void HTMLInputElementImpl::select( ) void HTMLInputElementImpl::click() { - QMouseEvent me(QEvent::MouseButtonRelease, QPoint(0,0),Qt::LeftButton, 0); + TQMouseEvent me(TQEvent::MouseButtonRelease, TQPoint(0,0),Qt::LeftButton, 0); dispatchMouseEvent(&me,0, 1); dispatchMouseEvent(&me,EventImpl::CLICK_EVENT, 1); } @@ -1447,9 +1447,9 @@ void HTMLInputElementImpl::attach() // FIXME: This needs to be dynamic, doesn't it, since someone could set this // after attachment? if ((uint) m_type <= ISINDEX && !m_value.isEmpty()) { - const QString value = m_value.string(); + const TQString value = m_value.string(); // remove newline stuff.. - QString nvalue; + TQString nvalue; unsigned int valueLength = value.length(); for (unsigned int i = 0; i < valueLength; ++i) if (value[i] >= ' ') @@ -1523,9 +1523,9 @@ DOMString HTMLInputElementImpl::altText() const return alt; } -bool HTMLInputElementImpl::encoding(const QTextCodec* codec, khtml::encodingList& encoding, bool multipart) +bool HTMLInputElementImpl::encoding(const TQTextCodec* codec, khtml::encodingList& encoding, bool multipart) { - const QString nme = name().string(); + const TQString nme = name().string(); // image generates its own name's if (nme.isEmpty() && m_type != IMAGE) return false; @@ -1560,12 +1560,12 @@ bool HTMLInputElementImpl::encoding(const QTextCodec* codec, khtml::encodingList if(m_clicked) { m_clicked = false; - QString astr(nme.isEmpty() ? QString::fromLatin1("x") : nme + ".x"); + TQString astr(nme.isEmpty() ? TQString::fromLatin1("x") : nme + ".x"); encoding += fixUpfromUnicode(codec, astr); astr.setNum(KMAX( clickX(), 0 )); encoding += fixUpfromUnicode(codec, astr); - astr = nme.isEmpty() ? QString::fromLatin1("y") : nme + ".y"; + astr = nme.isEmpty() ? TQString::fromLatin1("y") : nme + ".y"; encoding += fixUpfromUnicode(codec, astr); astr.setNum(KMAX( clickY(), 0 ) ); encoding += fixUpfromUnicode(codec, astr); @@ -1583,7 +1583,7 @@ bool HTMLInputElementImpl::encoding(const QTextCodec* codec, khtml::encodingList if (m_activeSubmit) { - QString enc_str = valueWithDefault().string(); + TQString enc_str = valueWithDefault().string(); if(!enc_str.isEmpty()) { encoding += fixUpfromUnicode(codec, enc_str); @@ -1598,12 +1598,12 @@ bool HTMLInputElementImpl::encoding(const QTextCodec* codec, khtml::encodingList if(!renderer() || renderer()->style()->visibility() != khtml::VISIBLE) return false; - QString local; + TQString local; KURL fileurl; - QString val = value().string(); + TQString val = value().string(); if (!val.isEmpty() && - QDir::isRelativePath(val) && - QFile::exists(KGlobalSettings::documentPath() + val)) { + TQDir::isRelativePath(val) && + TQFile::exists(KGlobalSettings::documentPath() + val)) { fileurl.setPath(KGlobalSettings::documentPath() + val); } else { fileurl = KURL::fromPathOrURL(val); @@ -1612,14 +1612,14 @@ bool HTMLInputElementImpl::encoding(const QTextCodec* codec, khtml::encodingList KIO::UDSEntry filestat; // can't submit file in www-url-form encoded - QWidget* const toplevel = static_cast<RenderSubmitButton*>(m_render)->widget()->topLevelWidget(); + TQWidget* const toplevel = static_cast<RenderSubmitButton*>(m_render)->widget()->topLevelWidget(); if (multipart) { - QCString filearray( "" ); + TQCString filearray( "" ); if ( KIO::NetAccess::stat(fileurl, filestat, toplevel)) { const KFileItem fileitem(filestat, fileurl, true, false); if ( fileitem.isFile() && KIO::NetAccess::download(fileurl, local, toplevel) ) { - QFile file(local); + TQFile file(local); filearray.resize(file.size()+1); if ( file.open( IO_ReadOnly ) ) { const int readbytes = file.readBlock( filearray.data(), file.size()); @@ -1800,7 +1800,7 @@ void HTMLInputElementImpl::defaultEventHandler(EventImpl *evt) if (m_type == IMAGE || m_type == SUBMIT || m_type == RESET) { bool act = (evt->id() == EventImpl::DOMACTIVATE_EVENT); if (!act && evt->id() == EventImpl::KEYUP_EVENT && evt->isKeyRelatedEvent()) { - QKeyEvent* const ke = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent(); + TQKeyEvent* const ke = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent(); if (ke && active() && (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Space)) act = true; } @@ -1916,7 +1916,7 @@ void HTMLLabelElementImpl::defaultEventHandler(EventImpl *evt) } else if ( evt->isKeyRelatedEvent() && ( evt->id() == EventImpl::KEYUP_EVENT || evt->id() == EventImpl::KEYPRESS_EVENT ) ) { - QKeyEvent* const ke = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent(); + TQKeyEvent* const ke = static_cast<KeyEventBaseImpl *>(evt)->qKeyEvent(); if (ke && active() && (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Space)) act = true; } @@ -2008,7 +2008,7 @@ long HTMLSelectElementImpl::selectedIndex() const { // return the number of the first option selected uint o = 0; - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); const unsigned int itemsSize = items.size(); for (unsigned int i = 0; i < itemsSize; ++i) { if (items[i]->id() == ID_OPTION) { @@ -2024,7 +2024,7 @@ long HTMLSelectElementImpl::selectedIndex() const void HTMLSelectElementImpl::setSelectedIndex( long index ) { // deselect all other options and select only the new one - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); int listIndex; const int itemsSize = int(items.size()); for (listIndex = 0; listIndex < itemsSize; ++listIndex) { @@ -2073,7 +2073,7 @@ void HTMLSelectElementImpl::remove( long index ) int exceptioncode = 0; const int listIndex = optionToListIndex(index); - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); if(listIndex < 0 || index >= int(items.size())) return; // ### what should we do ? remove the last item? @@ -2150,7 +2150,7 @@ DOMString HTMLInputElementImpl::valueWithDefault() const DOMString HTMLSelectElementImpl::value( ) const { uint i; - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); const uint itemsSize = items.size(); for (i = 0; i < itemsSize; ++i) { if ( items[i]->id() == ID_OPTION @@ -2164,7 +2164,7 @@ void HTMLSelectElementImpl::setValue(DOMStringImpl* value) { // find the option with value() matching the given parameter // and make it the current selection. - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); for (unsigned i = 0; i < items.size(); i++) if (items[i]->id() == ID_OPTION && static_cast<HTMLOptionElementImpl*>(items[i])->value() == value) { static_cast<HTMLOptionElementImpl*>(items[i])->setSelected(true); @@ -2172,10 +2172,10 @@ void HTMLSelectElementImpl::setValue(DOMStringImpl* value) } } -QString HTMLSelectElementImpl::state( ) +TQString HTMLSelectElementImpl::state( ) { - QString state; - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQString state; + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); const int l = items.count(); @@ -2187,17 +2187,17 @@ QString HTMLSelectElementImpl::state( ) return state; } -void HTMLSelectElementImpl::restoreState(const QString &_state) +void HTMLSelectElementImpl::restoreState(const TQString &_state) { recalcListItems(); - QString state = _state; + TQString state = _state; if(!state.isEmpty() && !state.contains('X') && !m_multiple && m_size <= 1) { qWarning("should not happen in restoreState!"); state[0] = 'X'; } - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); const int l = items.count(); for(int i = 0; i < l; ++i) { @@ -2291,11 +2291,11 @@ void HTMLSelectElementImpl::attach() _style->deref(); } -bool HTMLSelectElementImpl::encoding(const QTextCodec* codec, khtml::encodingList& encoded_values, bool) +bool HTMLSelectElementImpl::encoding(const TQTextCodec* codec, khtml::encodingList& encoded_values, bool) { bool successful = false; - const QCString enc_name = fixUpfromUnicode(codec, name().string()); - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + const TQCString enc_name = fixUpfromUnicode(codec, name().string()); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); uint i; const uint itemsSize = items.size(); @@ -2329,7 +2329,7 @@ bool HTMLSelectElementImpl::encoding(const QTextCodec* codec, khtml::encodingLis int HTMLSelectElementImpl::optionToListIndex(int optionIndex) const { - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); const int itemsSize = int(items.size()); if (optionIndex < 0 || optionIndex >= itemsSize) return -1; @@ -2353,7 +2353,7 @@ int HTMLSelectElementImpl::optionToListIndex(int optionIndex) const int HTMLSelectElementImpl::listToOptionIndex(int listIndex) const { - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); if (listIndex < 0 || listIndex >= int(items.size()) || items[listIndex]->id() != ID_OPTION) return -1; @@ -2419,7 +2419,7 @@ void HTMLSelectElementImpl::setRecalcListItems() void HTMLSelectElementImpl::reset() { - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); uint i; const uint itemsSize = items.size(); bool anySelected = false; @@ -2450,7 +2450,7 @@ void HTMLSelectElementImpl::notifyOptionSelected(HTMLOptionElementImpl *selected { if (selected && !m_multiple) { // deselect all other options - QMemArray<HTMLGenericFormElementImpl*> items = listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = listItems(); uint i; const uint itemsSize = items.size(); for (i = 0; i < itemsSize; ++i) { @@ -2469,9 +2469,9 @@ void HTMLSelectElementImpl::notifyOptionSelected(HTMLOptionElementImpl *selected HTMLKeygenElementImpl::HTMLKeygenElementImpl(DocumentImpl* doc, HTMLFormElementImpl* f) : HTMLSelectElementImpl(doc, f) { - const QStringList keys = KSSLKeyGen::supportedKeySizes(); - QStringList::ConstIterator i = keys.begin(); - const QStringList::ConstIterator iEnd = keys.end(); + const TQStringList keys = KSSLKeyGen::supportedKeySizes(); + TQStringList::ConstIterator i = keys.begin(); + const TQStringList::ConstIterator iEnd = keys.end(); for ( ; i != iEnd; ++i) { HTMLOptionElementImpl* const o = new HTMLOptionElementImpl(doc, form()); addChild(o); @@ -2496,10 +2496,10 @@ void HTMLKeygenElementImpl::parseAttribute(AttributeImpl* attr) } } -bool HTMLKeygenElementImpl::encoding(const QTextCodec* codec, khtml::encodingList& encoded_values, bool) +bool HTMLKeygenElementImpl::encoding(const TQTextCodec* codec, khtml::encodingList& encoded_values, bool) { bool successful = false; - const QCString enc_name = fixUpfromUnicode(codec, name().string()); + const TQCString enc_name = fixUpfromUnicode(codec, name().string()); encoded_values += enc_name; @@ -2507,7 +2507,7 @@ bool HTMLKeygenElementImpl::encoding(const QTextCodec* codec, khtml::encodingLis KSSLKeyGen* const kg = new KSSLKeyGen(getDocument()->view(), "Key Generator", true); kg->setKeySize(0); - successful = (QDialog::Accepted == kg->exec()); + successful = (TQDialog::Accepted == kg->exec()); delete kg; @@ -2559,7 +2559,7 @@ long HTMLOptionElementImpl::index() const { // Let's do this dynamically. Might be a bit slow, but we're sure // we won't forget to update a member variable in some cases... - QMemArray<HTMLGenericFormElementImpl*> items = getSelect()->listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = getSelect()->listItems(); const int l = items.count(); int optionIndex = 0; for(int i = 0; i < l; ++i) { @@ -2656,12 +2656,12 @@ DOMString HTMLTextAreaElementImpl::type() const return "textarea"; } -QString HTMLTextAreaElementImpl::state( ) +TQString HTMLTextAreaElementImpl::state( ) { return value().string() + (m_unsubmittedFormChange ? 'M' : '.'); } -void HTMLTextAreaElementImpl::restoreState(const QString &state) +void HTMLTextAreaElementImpl::restoreState(const TQString &state) { setDefaultValue(state.left(state.length()-1)); m_unsubmittedFormChange = state.endsWith("M"); @@ -2742,7 +2742,7 @@ void HTMLTextAreaElementImpl::attach() } -static QString expandLF(const QString& s) +static TQString expandLF(const TQString& s) { // LF -> CRLF unsigned crs = s.contains( '\n' ); @@ -2750,12 +2750,12 @@ static QString expandLF(const QString& s) return s; unsigned len = s.length(); - QString r; + TQString r; r.reserve(len + crs + 1); unsigned pos2 = 0; for(unsigned pos = 0; pos < len; pos++) { - QChar c = s.at(pos); + TQChar c = s.at(pos); switch(c.unicode()) { case '\n': @@ -2776,7 +2776,7 @@ static QString expandLF(const QString& s) } -bool HTMLTextAreaElementImpl::encoding(const QTextCodec* codec, encodingList& encoding, bool) +bool HTMLTextAreaElementImpl::encoding(const TQTextCodec* codec, encodingList& encoding, bool) { if (name().isEmpty()) return false; @@ -2814,7 +2814,7 @@ DOMString HTMLTextAreaElementImpl::value() void HTMLTextAreaElementImpl::setValue(DOMString _value) { // \r\n -> \n, \r -> \n - QString str = _value.string().replace( "\r\n", "\n" ); + TQString str = _value.string().replace( "\r\n", "\n" ); m_value = str.replace( '\r', '\n' ); m_dirtyvalue = false; m_initialized = true; @@ -2845,12 +2845,12 @@ DOMString HTMLTextAreaElementImpl::defaultValue() void HTMLTextAreaElementImpl::setDefaultValue(DOMString _defaultValue) { // there may be comments - remove all the text nodes and replace them with one - QPtrList<NodeImpl> toRemove; + TQPtrList<NodeImpl> toRemove; NodeImpl *n; for (n = firstChild(); n; n = n->nextSibling()) if (n->isTextNode()) toRemove.append(n); - QPtrListIterator<NodeImpl> it(toRemove); + TQPtrListIterator<NodeImpl> it(toRemove); int exceptioncode = 0; for (; it.current(); ++it) { removeChild(it.current(), exceptioncode); diff --git a/khtml/html/html_formimpl.h b/khtml/html/html_formimpl.h index f12821340..5fea3e221 100644 --- a/khtml/html/html_formimpl.h +++ b/khtml/html/html_formimpl.h @@ -29,10 +29,10 @@ #include "html/html_imageimpl.h" #include "dom/html_element.h" -#include <qvaluelist.h> -#include <qptrlist.h> -#include <qcstring.h> -#include <qmemarray.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> +#include <tqcstring.h> +#include <tqmemarray.h> class KHTMLView; class QTextCodec; @@ -46,7 +46,7 @@ namespace khtml class RenderRadioButton; class RenderFileButton; - typedef QValueList<QCString> encodingList; + typedef TQValueList<TQCString> encodingList; } namespace KWallet { @@ -72,13 +72,13 @@ public: virtual void insertedIntoDocument(); virtual void removedFromDocument(); - virtual void addId(const QString& id); - virtual void removeId(const QString& id); + virtual void addId(const TQString& id); + virtual void removeId(const TQString& id); long length() const; - QByteArray formData(bool& ok); + TQByteArray formData(bool& ok); DOMString enctype() const { return m_enctype; } void setEnctype( const DOMString & ); @@ -109,13 +109,13 @@ public: private: void gatherWalletData(); - QPtrList<HTMLGenericFormElementImpl> formElements; - QPtrList<HTMLImageElementImpl> imgElements; + TQPtrList<HTMLGenericFormElementImpl> formElements; + TQPtrList<HTMLImageElementImpl> imgElements; DOMString m_target; DOMString m_enctype; - QString m_boundary; + TQString m_boundary; DOMString m_acceptcharset; - QString m_encCharset; + TQString m_encCharset; bool m_post : 1; bool m_multipart : 1; bool m_autocomplete : 1; @@ -126,7 +126,7 @@ private: bool m_haveTextarea : 1; // for wallet storage bool m_havePassword : 1; // for wallet storage DOMString m_name; // our name - QMap<QString, QString> m_walletMap; // for wallet storage + TQMap<TQString, TQString> m_walletMap; // for wallet storage }; // ------------------------------------------------------------------------- @@ -171,7 +171,7 @@ public: * for submitting * return true for a successful control (see HTML4-17.13.2) */ - virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool) { return false; } + virtual bool encoding(const TQTextCodec*, khtml::encodingList&, bool) { return false; } virtual void defaultEventHandler(EventImpl *evt); virtual bool isEditable(); @@ -206,7 +206,7 @@ public: typeEnum buttonType() const { return m_type; } virtual void parseAttribute(AttributeImpl *attr); virtual void defaultEventHandler(EventImpl *evt); - virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool); + virtual bool encoding(const TQTextCodec*, khtml::encodingList&, bool); void activate(); virtual void attach(); void click(); @@ -215,7 +215,7 @@ public: protected: DOMString m_value; - QString m_currValue; + TQString m_currValue; typeEnum m_type : 2; bool m_dirty : 1; bool m_clicked : 1; @@ -288,8 +288,8 @@ public: void focus(); virtual bool maintainsState() { return true; } - virtual QString state(); - virtual void restoreState(const QString &state); + virtual TQString state(); + virtual void restoreState(const TQString &state); void select(); void click(); @@ -297,7 +297,7 @@ public: virtual void parseAttribute(AttributeImpl *attr); virtual void attach(); - virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool); + virtual bool encoding(const TQTextCodec*, khtml::encodingList&, bool); typeEnum inputType() const { return m_type; } virtual void reset(); @@ -411,8 +411,8 @@ public: void setValue(DOMStringImpl* value); virtual bool maintainsState() { return true; } - virtual QString state(); - virtual void restoreState(const QString &state); + virtual TQString state(); + virtual void restoreState(const TQString &state); virtual NodeImpl *insertBefore ( NodeImpl *newChild, NodeImpl *refChild, int &exceptioncode ); virtual void replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode ); @@ -425,7 +425,7 @@ public: virtual void parseAttribute(AttributeImpl *attr); virtual void attach(); - virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool); + virtual bool encoding(const TQTextCodec*, khtml::encodingList&, bool); // get the actual listbox index of the optionIndexth option int optionToListIndex(int optionIndex) const; @@ -434,7 +434,7 @@ public: void setRecalcListItems(); - QMemArray<HTMLGenericFormElementImpl*> listItems() const + TQMemArray<HTMLGenericFormElementImpl*> listItems() const { if (m_recalcListItems) const_cast<HTMLSelectElementImpl*>(this)->recalcListItems(); return m_listItems; @@ -446,7 +446,7 @@ private: void recalcListItems() const; protected: - mutable QMemArray<HTMLGenericFormElementImpl*> m_listItems; + mutable TQMemArray<HTMLGenericFormElementImpl*> m_listItems; short m_minwidth; signed short m_size : 15; bool m_multiple : 1; @@ -472,7 +472,7 @@ public: virtual bool isEnumeratable() const { return false; } virtual void parseAttribute(AttributeImpl *attr); - virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool); + virtual bool encoding(const TQTextCodec*, khtml::encodingList&, bool); }; @@ -548,14 +548,14 @@ public: DOMString type() const; virtual bool maintainsState() { return true; } - virtual QString state(); - virtual void restoreState(const QString &state); + virtual TQString state(); + virtual void restoreState(const TQString &state); void select ( ); virtual void parseAttribute(AttributeImpl *attr); virtual void attach(); - virtual bool encoding(const QTextCodec*, khtml::encodingList&, bool); + virtual bool encoding(const TQTextCodec*, khtml::encodingList&, bool); virtual void reset(); DOMString value(); void setValue(DOMString _value); @@ -578,7 +578,7 @@ protected: int m_rows; int m_cols; WrapMethod m_wrap; - QString m_value; + TQString m_value; bool m_changed: 1; //States whether the contents has been editted bool m_dirtyvalue: 1; //States whether m_value is out-of-date compared to the renderer or default bool m_unsubmittedFormChange: 1; diff --git a/khtml/html/html_headimpl.cpp b/khtml/html/html_headimpl.cpp index 6808f27bf..d7154e936 100644 --- a/khtml/html/html_headimpl.cpp +++ b/khtml/html/html_headimpl.cpp @@ -80,7 +80,7 @@ void HTMLBaseElementImpl::removedFromDocument() // Since the document doesn't have a base element... // (This will break in the case of multiple base elements, but that's not valid anyway (?)) getDocument()->setBaseURL( KURL() ); - getDocument()->setBaseTarget( QString::null ); + getDocument()->setBaseTarget( TQString::null ); } void HTMLBaseElementImpl::process() @@ -146,8 +146,8 @@ void HTMLLinkElementImpl::parseAttribute(AttributeImpl *attr) m_alternate = false; } else if (!m_alternate) { // disabling: recheck alternate status - QString rel = getAttribute(ATTR_REL).string().lower(); - QString type = getAttribute(ATTR_TYPE).string().lower(); + TQString rel = getAttribute(ATTR_REL).string().lower(); + TQString type = getAttribute(ATTR_TYPE).string().lower(); m_alternate = (type.contains("text/css") || rel.contains("stylesheet")) && rel.contains("alternate"); } if (isLoading()) @@ -172,8 +172,8 @@ void HTMLLinkElementImpl::process() if (!inDocument()) return; - QString type = getAttribute(ATTR_TYPE).string().lower(); - QString rel = getAttribute(ATTR_REL).string().lower(); + TQString type = getAttribute(ATTR_TYPE).string().lower(); + TQString rel = getAttribute(ATTR_REL).string().lower(); KHTMLPart* part = getDocument()->view() ? getDocument()->view()->part() : 0; @@ -195,7 +195,7 @@ void HTMLLinkElementImpl::process() if (!isAlternate()) getDocument()->addPendingSheet(); - QString chset = getAttribute( ATTR_CHARSET ).string(); + TQString chset = getAttribute( ATTR_CHARSET ).string(); // set chset to charset of referring document when attribute CHARSET is absent. // http://www.w3.org/TR/CSS21/syndata.html(4.4) if (chset.isEmpty() && part) chset = part->encoding(); @@ -263,7 +263,7 @@ void HTMLLinkElementImpl::finished() getDocument()->updateStyleSelector(); } -void HTMLLinkElementImpl::error( int, const QString& ) +void HTMLLinkElementImpl::error( int, const TQString& ) { finished(); } @@ -362,9 +362,9 @@ void HTMLScriptElementImpl::insertedIntoDocument() if (m_createdByParser) return; - QString url = getAttribute(ATTR_SRC).string(); + TQString url = getAttribute(ATTR_SRC).string(); if (!url.isEmpty()) { - QString charset = getAttribute(ATTR_CHARSET).string(); + TQString charset = getAttribute(ATTR_CHARSET).string(); m_cachedScript = getDocument()->docLoader()->requestScript(DOMString(url), charset); if (m_cachedScript) m_cachedScript->ref(this); @@ -395,7 +395,7 @@ void HTMLScriptElementImpl::notifyFinished(CachedObject* o) assert(cs == m_cachedScript); - QString URL = cs->url().string(); + TQString URL = cs->url().string(); DOMString script = cs->script(); cs->deref(this); m_cachedScript = 0; @@ -403,7 +403,7 @@ void HTMLScriptElementImpl::notifyFinished(CachedObject* o) evaluateScript(URL, script); } -void HTMLScriptElementImpl::evaluateScript(const QString &URL, const DOMString &script) +void HTMLScriptElementImpl::evaluateScript(const TQString &URL, const DOMString &script) { if (m_evaluated) return; diff --git a/khtml/html/html_headimpl.h b/khtml/html/html_headimpl.h index 3fa72c928..d22f64434 100644 --- a/khtml/html/html_headimpl.h +++ b/khtml/html/html_headimpl.h @@ -92,7 +92,7 @@ public: // from CachedObjectClient virtual void setStyleSheet(const DOM::DOMString &url, const DOM::DOMString &sheet, const DOM::DOMString &charset); - virtual void error(int err, const QString &text); + virtual void error(int err, const TQString &text); bool isLoading() const; void sheetLoaded(); @@ -107,7 +107,7 @@ protected: khtml::CachedCSSStyleSheet *m_cachedSheet; CSSStyleSheetImpl *m_sheet; DOMString m_url; - QString m_media; + TQString m_media; bool m_isDisabled : 1; bool m_loading : 1; bool m_alternate : 1; @@ -151,7 +151,7 @@ public: void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; } - void evaluateScript(const QString &, const DOMString &); + void evaluateScript(const TQString &, const DOMString &); DOMString text() const; void setText( const DOMString& str ); @@ -205,7 +205,7 @@ public: protected: CSSStyleSheetImpl *m_sheet; DOMString m_type; - QString m_media; + TQString m_media; bool m_loading; }; diff --git a/khtml/html/html_imageimpl.cpp b/khtml/html/html_imageimpl.cpp index 1c755920b..be13e93c2 100644 --- a/khtml/html/html_imageimpl.cpp +++ b/khtml/html/html_imageimpl.cpp @@ -40,12 +40,12 @@ #include "css/csshelper.h" #include "xml/dom2_eventsimpl.h" -#include <qstring.h> -#include <qpoint.h> -#include <qregion.h> -#include <qptrstack.h> -#include <qimage.h> -#include <qpointarray.h> +#include <tqstring.h> +#include <tqpoint.h> +#include <tqregion.h> +#include <tqptrstack.h> +#include <tqimage.h> +#include <tqpointarray.h> using namespace DOM; using namespace khtml; @@ -147,7 +147,7 @@ void HTMLImageElementImpl::parseAttribute(AttributeImpl *attr) if ( attr->value()[0] == '#' ) usemap = attr->value().lower(); else { - QString url = getDocument()->completeURL( khtml::parseURL( attr->value() ).string() ); + TQString url = getDocument()->completeURL( khtml::parseURL( attr->value() ).string() ); // ### we remove the part before the anchor and hope // the map is on the same html page.... usemap = url; @@ -212,7 +212,7 @@ DOMString HTMLImageElementImpl::altText() const alt = getAttribute( ATTR_TITLE ); #if 0 if ( alt.isNull() ) { - QString p = KURL( getDocument()->completeURL( getAttribute(ATTR_SRC).string() ) ).prettyURL(); + TQString p = KURL( getDocument()->completeURL( getAttribute(ATTR_SRC).string() ) ).prettyURL(); int pos; if ( ( pos = p.findRev( '.' ) ) > 0 ) p.truncate( pos ); @@ -257,13 +257,13 @@ void HTMLImageElementImpl::insertedIntoDocument() HTMLElementImpl::insertedIntoDocument(); } -void HTMLImageElementImpl::removeId(const QString& id) +void HTMLImageElementImpl::removeId(const TQString& id) { getDocument()->underDocNamedCache().remove(id, this); HTMLElementImpl::removeId(id); } -void HTMLImageElementImpl::addId (const QString& id) +void HTMLImageElementImpl::addId (const TQString& id) { getDocument()->underDocNamedCache().add(id, this); HTMLElementImpl::addId(id); @@ -316,24 +316,24 @@ long HTMLImageElementImpl::height() const getAttribute(ATTR_HEIGHT).toInt(); } -QImage HTMLImageElementImpl::currentImage() const +TQImage HTMLImageElementImpl::currentImage() const { RenderImage *r = static_cast<RenderImage*>(renderer()); if(r) return r->pixmap().convertToImage(); - return QImage(); + return TQImage(); } -QPixmap HTMLImageElementImpl::currentPixmap() const +TQPixmap HTMLImageElementImpl::currentPixmap() const { RenderImage *r = static_cast<RenderImage*>(renderer()); if(r) return r->pixmap(); - return QPixmap(); + return TQPixmap(); } bool HTMLImageElementImpl::complete() const @@ -365,7 +365,7 @@ HTMLMapElementImpl::mapMouseEvent(int x_, int y_, int width_, int height_, { //cout << "map:mapMouseEvent " << endl; //cout << x_ << " " << y_ <<" "<< width_ <<" "<< height_ << endl; - QPtrStack<NodeImpl> nodeStack; + TQPtrStack<NodeImpl> nodeStack; NodeImpl *current = firstChild(); while(1) @@ -410,7 +410,7 @@ void HTMLMapElementImpl::parseAttribute(AttributeImpl *attr) } else { // add name with full url: - QString url = getDocument()->completeURL( khtml::parseURL( attr->value() ).string() ); + TQString url = getDocument()->completeURL( khtml::parseURL( attr->value() ).string() ); if(getDocument()->isHTMLDocument()) static_cast<HTMLDocumentImpl*>(getDocument())->mapMap[url] = this; } @@ -419,7 +419,7 @@ void HTMLMapElementImpl::parseAttribute(AttributeImpl *attr) { DOMString s = attr->value(); if(*s.unicode() == '#') - name = QString(s.unicode()+1, s.length()-1).lower(); + name = TQString(s.unicode()+1, s.length()-1).lower(); else name = s.string().lower(); // ### make this work for XML documents, e.g. in case of <html:map...> @@ -497,7 +497,7 @@ bool HTMLAreaElementImpl::mapMouseEvent(int x_, int y_, int width_, int height_, region=getRegion(width_, height_); lastw=width_; lasth=height_; } - if (region.contains(QPoint(x_,y_))) + if (region.contains(TQPoint(x_,y_))) { inside = true; info.setInnerNode(this); @@ -507,21 +507,21 @@ bool HTMLAreaElementImpl::mapMouseEvent(int x_, int y_, int width_, int height_, return inside; } -QRect HTMLAreaElementImpl::getRect() const +TQRect HTMLAreaElementImpl::getRect() const { if (parentNode()->renderer()==0) - return QRect(); + return TQRect(); int dx, dy; if (!parentNode()->renderer()->absolutePosition(dx, dy)) - return QRect(); - QRegion region = getRegion(lastw,lasth); + return TQRect(); + TQRegion region = getRegion(lastw,lasth); region.translate(dx, dy); return region.boundingRect(); } -QRegion HTMLAreaElementImpl::getRegion(int width_, int height_) const +TQRegion HTMLAreaElementImpl::getRegion(int width_, int height_) const { - QRegion region; + TQRegion region; if (!m_coords) return region; @@ -533,26 +533,26 @@ QRegion HTMLAreaElementImpl::getRegion(int width_, int height_) const if ((shape==Poly || shape==Unknown) && m_coordsLen > 5) { // make sure its even int len = m_coordsLen >> 1; - QPointArray points(len); + TQPointArray points(len); for (int i = 0; i < len; ++i) points.setPoint(i, m_coords[(i<<1)].minWidth(width_), m_coords[(i<<1)+1].minWidth(height_)); - region = QRegion(points); + region = TQRegion(points); } else if (shape==Circle && m_coordsLen>=3 || shape==Unknown && m_coordsLen == 3) { int r = kMin(m_coords[2].minWidth(width_), m_coords[2].minWidth(height_)); - region = QRegion(m_coords[0].minWidth(width_)-r, - m_coords[1].minWidth(height_)-r, 2*r, 2*r,QRegion::Ellipse); + region = TQRegion(m_coords[0].minWidth(width_)-r, + m_coords[1].minWidth(height_)-r, 2*r, 2*r,TQRegion::Ellipse); } else if (shape==Rect && m_coordsLen>=4 || shape==Unknown && m_coordsLen == 4) { int x0 = m_coords[0].minWidth(width_); int y0 = m_coords[1].minWidth(height_); int x1 = m_coords[2].minWidth(width_); int y1 = m_coords[3].minWidth(height_); - region = QRegion(x0,y0,x1-x0,y1-y0); + region = TQRegion(x0,y0,x1-x0,y1-y0); } else if (shape==Default) - region = QRegion(0,0,width_,height_); + region = TQRegion(0,0,width_,height_); // else // return null region diff --git a/khtml/html/html_imageimpl.h b/khtml/html/html_imageimpl.h index 8fc00b027..6f26cd2df 100644 --- a/khtml/html/html_imageimpl.h +++ b/khtml/html/html_imageimpl.h @@ -28,7 +28,7 @@ #include "misc/loader_client.h" #include "rendering/render_object.h" -#include <qregion.h> +#include <tqregion.h> namespace DOM { @@ -50,8 +50,8 @@ public: virtual void attach(); virtual void removedFromDocument(); virtual void insertedIntoDocument(); - virtual void addId(const QString& id); - virtual void removeId(const QString& id); + virtual void addId(const TQString& id); + virtual void removeId(const TQString& id); long width() const; @@ -62,11 +62,11 @@ public: * This has to convert the pixmap into an image first. * This will return undefined results if complete() is not true. */ - QImage currentImage() const; + TQImage currentImage() const; /** Return the pixmap for this element. * This will return undefined results if complete() is not true. */ - QPixmap currentPixmap() const; + TQPixmap currentPixmap() const; DOMString altText() const; @@ -107,13 +107,13 @@ public: bool mapMouseEvent(int x_, int y_, int width_, int height_, khtml::RenderObject::NodeInfo& info); - virtual QRect getRect() const; + virtual TQRect getRect() const; - QRegion cachedRegion() const { return region; } + TQRegion cachedRegion() const { return region; } protected: - QRegion getRegion(int width_, int height) const; - QRegion region; + TQRegion getRegion(int width_, int height) const; + TQRegion region; khtml::Length* m_coords; int m_coordsLen; int lastw, lasth; @@ -141,7 +141,7 @@ public: khtml::RenderObject::NodeInfo& info); private: - QString name; + TQString name; }; diff --git a/khtml/html/html_inlineimpl.cpp b/khtml/html/html_inlineimpl.cpp index 08bbbb177..600c23d59 100644 --- a/khtml/html/html_inlineimpl.cpp +++ b/khtml/html/html_inlineimpl.cpp @@ -67,8 +67,8 @@ void HTMLAnchorElementImpl::defaultEventHandler(EventImpl *evt) if (keydown) k = static_cast<KeyEventBaseImpl *>( evt ); - QString utarget; - QString url; + TQString utarget; + TQString url; if ( e && e->button() == 2 ) { HTMLElementImpl::defaultEventHandler(evt); return; @@ -108,7 +108,7 @@ void HTMLAnchorElementImpl::defaultEventHandler(EventImpl *evt) y += v->contentsY(); } r->absolutePosition(absx, absy); - url += QString("?%1,%2").arg( x - absx ).arg( y - absy ); + url += TQString("?%1,%2").arg( x - absx ).arg( y - absy ); } else { evt->setDefaultHandled(); @@ -166,7 +166,7 @@ void HTMLAnchorElementImpl::defaultEventHandler(EventImpl *evt) void HTMLAnchorElementImpl::click() { - QMouseEvent me(QEvent::MouseButtonRelease, QPoint(0,0),Qt::LeftButton, 0); + TQMouseEvent me(TQEvent::MouseButtonRelease, TQPoint(0,0),Qt::LeftButton, 0); dispatchMouseEvent(&me,EventImpl::CLICK_EVENT, 1); } @@ -254,7 +254,7 @@ void HTMLFontElementImpl::parseAttribute(AttributeImpl *attr) { DOMStringImpl* v = attr->val(); if(v) { - const QChar* s = v->s; + const TQChar* s = v->s; int num = v->toInt(); int len = v->l; while( len && s->isSpace() ) diff --git a/khtml/html/html_miscimpl.cpp b/khtml/html/html_miscimpl.cpp index bf0c56e00..58804bff5 100644 --- a/khtml/html/html_miscimpl.cpp +++ b/khtml/html/html_miscimpl.cpp @@ -54,7 +54,7 @@ struct CollectionCache: public NodeListImpl::Cache { static Cache* make() { return new CollectionCache; } - QDict<QValueList<NodeImpl*> > nameCache; + TQDict<TQValueList<NodeImpl*> > nameCache; CollectionCache(): nameCache(127) { @@ -282,19 +282,19 @@ NodeImpl *HTMLCollectionImpl::nextNamedItem( const DOMString &name ) const return 0; } -QValueList<NodeImpl*> HTMLCollectionImpl::namedItems( const DOMString &name ) const +TQValueList<NodeImpl*> HTMLCollectionImpl::namedItems( const DOMString &name ) const { - QString key = name.string(); + TQString key = name.string(); //We use a work-conserving design for the name cache presently -- only //remember stuff about elements we were asked for. m_cache->updateNodeListInfo(m_refNode->getDocument()); CollectionCache* cache = static_cast<CollectionCache*>(m_cache); - if (QValueList<NodeImpl*>* info = cache->nameCache.find(key)) { + if (TQValueList<NodeImpl*>* info = cache->nameCache.find(key)) { return *info; } else { - QValueList<NodeImpl*>* newInfo = new QValueList<NodeImpl*>; + TQValueList<NodeImpl*>* newInfo = new TQValueList<NodeImpl*>; NodeImpl* match = namedItem(name); while (match) { @@ -325,7 +325,7 @@ NodeImpl *HTMLFormCollectionImpl::item( unsigned long index ) const strt = m_cache->current.index; } - QPtrList<HTMLGenericFormElementImpl>& l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements; + TQPtrList<HTMLGenericFormElementImpl>& l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements; for (unsigned i = strt; i < l.count(); i++) { if (l.at( i )->isEnumeratable()) @@ -347,7 +347,7 @@ NodeImpl *HTMLFormCollectionImpl::item( unsigned long index ) const unsigned long HTMLFormCollectionImpl::calcLength(NodeImpl *start) const { unsigned length = 0; - QPtrList<HTMLGenericFormElementImpl> l = static_cast<HTMLFormElementImpl*>( start )->formElements; + TQPtrList<HTMLGenericFormElementImpl> l = static_cast<HTMLFormElementImpl*>( start )->formElements; for ( unsigned i = 0; i < l.count(); i++ ) if ( l.at( i )->isEnumeratable() ) ++length; @@ -364,7 +364,7 @@ NodeImpl *HTMLFormCollectionImpl::namedItem( const DOMString &name ) const NodeImpl *HTMLFormCollectionImpl::nextNamedItem( const DOMString &name ) const { - QPtrList<HTMLGenericFormElementImpl>& l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements; + TQPtrList<HTMLGenericFormElementImpl>& l = static_cast<HTMLFormElementImpl*>( m_refNode )->formElements; //Go through the list, trying to find the appropriate named form element. for ( ; currentNamePos < l.count(); ++currentNamePos ) @@ -384,7 +384,7 @@ NodeImpl *HTMLFormCollectionImpl::nextNamedItem( const DOMString &name ) const //but only if no input tags were matched if (foundInput) return 0; - QPtrList<HTMLImageElementImpl>& il = static_cast<HTMLFormElementImpl*>( m_refNode )->imgElements; + TQPtrList<HTMLImageElementImpl>& il = static_cast<HTMLFormElementImpl*>( m_refNode )->imgElements; for ( ; currentNameImgPos < il.count(); ++currentNameImgPos ) { HTMLImageElementImpl* el = il.at(currentNameImgPos); diff --git a/khtml/html/html_miscimpl.h b/khtml/html/html_miscimpl.h index beff1fe7d..b28fef82a 100644 --- a/khtml/html/html_miscimpl.h +++ b/khtml/html/html_miscimpl.h @@ -23,7 +23,7 @@ #ifndef HTML_MISCIMPL_H #define HTML_MISCIMPL_H -#include <qvaluelist.h> +#include <tqvaluelist.h> #include "html_elementimpl.h" #include "misc/shared.h" @@ -87,7 +87,7 @@ public: // In case of multiple items named the same way virtual NodeImpl *nextNamedItem( const DOMString &name ) const; - QValueList<NodeImpl*> namedItems( const DOMString &name ) const; + TQValueList<NodeImpl*> namedItems( const DOMString &name ) const; int getType() const { return type; diff --git a/khtml/html/html_objectimpl.cpp b/khtml/html/html_objectimpl.cpp index 8a60ba41f..106a862e9 100644 --- a/khtml/html/html_objectimpl.cpp +++ b/khtml/html/html_objectimpl.cpp @@ -26,10 +26,10 @@ #include "dom/dom_string.h" #include "misc/htmlhashes.h" #include "khtmlview.h" -#include <qstring.h> -#include <qvariant.h> -#include <qmap.h> -#include <qtimer.h> +#include <tqstring.h> +#include <tqvariant.h> +#include <tqmap.h> +#include <tqtimer.h> #include <kdebug.h> #include <kimageio.h> @@ -55,7 +55,7 @@ HTMLObjectBaseElementImpl::HTMLObjectBaseElementImpl(DocumentImpl *doc) m_renderAlternative = false; } -void HTMLObjectBaseElementImpl::setServiceType(const QString & val) { +void HTMLObjectBaseElementImpl::setServiceType(const TQString & val) { serviceType = val.lower(); int pos = serviceType.find( ";" ); if ( pos!=-1 ) @@ -70,7 +70,7 @@ void HTMLObjectBaseElementImpl::parseAttribute(AttributeImpl *attr) case ATTR_CODETYPE: if (attr->val()) { DOM::DOMStringImpl *stringImpl = attr->val(); - QString val = QConstString( stringImpl->s, stringImpl->l ).string(); + TQString val = TQConstString( stringImpl->s, stringImpl->l ).string(); setServiceType( val ); needWidgetUpdate = true; } @@ -111,13 +111,13 @@ void HTMLObjectBaseElementImpl::insertedIntoDocument() HTMLElementImpl::insertedIntoDocument(); } -void HTMLObjectBaseElementImpl::removeId(const QString& id) +void HTMLObjectBaseElementImpl::removeId(const TQString& id) { getDocument()->underDocNamedCache().remove(id, this); HTMLElementImpl::removeId(id); } -void HTMLObjectBaseElementImpl::addId (const QString& id) +void HTMLObjectBaseElementImpl::addId (const TQString& id) { getDocument()->underDocNamedCache().add(id, this); HTMLElementImpl::addId(id); @@ -136,7 +136,7 @@ void HTMLObjectBaseElementImpl::recalcStyle( StyleChange ch ) void HTMLObjectBaseElementImpl::renderAlternative() { if ( m_renderAlternative ) return; - QTimer::singleShot( 0, this, SLOT( slotRenderAlternative() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotRenderAlternative() ) ); } void HTMLObjectBaseElementImpl::slotRenderAlternative() @@ -421,7 +421,7 @@ DocumentImpl* HTMLObjectElementImpl::contentDocument() const { if ( !m_render ) return 0; if ( !m_render->isWidget() ) return 0; - QWidget* widget = static_cast<RenderWidget*>( m_render )->widget(); + TQWidget* widget = static_cast<RenderWidget*>( m_render )->widget(); if( widget && ::qt_cast<KHTMLView*>( widget ) ) return static_cast<KHTMLView*>( widget )->part()->xmlDocImpl(); return 0; diff --git a/khtml/html/html_objectimpl.h b/khtml/html/html_objectimpl.h index a33786442..4204e6ef3 100644 --- a/khtml/html/html_objectimpl.h +++ b/khtml/html/html_objectimpl.h @@ -25,8 +25,8 @@ #include "html_elementimpl.h" #include "xml/dom_stringimpl.h" -#include <qobject.h> -#include <qstringlist.h> +#include <tqobject.h> +#include <tqstringlist.h> class KHTMLView; @@ -36,7 +36,7 @@ namespace DOM { class HTMLFormElementImpl; class DOMStringImpl; -class HTMLObjectBaseElementImpl : public QObject, public HTMLElementImpl +class HTMLObjectBaseElementImpl : public TQObject, public HTMLElementImpl { Q_OBJECT public: @@ -49,18 +49,18 @@ public: void renderAlternative(); - void setServiceType(const QString &); + void setServiceType(const TQString &); - QString url; - QString classId; - QString serviceType; + TQString url; + TQString classId; + TQString serviceType; bool needWidgetUpdate; bool m_renderAlternative; virtual void insertedIntoDocument(); virtual void removedFromDocument(); - virtual void addId(const QString& id); - virtual void removeId(const QString& id); + virtual void addId(const TQString& id); + virtual void removeId(const TQString& id); protected slots: void slotRenderAlternative(); protected: @@ -97,7 +97,7 @@ public: virtual void parseAttribute(AttributeImpl *attr); virtual void attach(); - QString pluginPage; + TQString pluginPage; bool hidden; }; @@ -133,12 +133,12 @@ public: virtual void parseAttribute(AttributeImpl *token); - QString name() const { return m_name; } - QString value() const { return m_value; } + TQString name() const { return m_name; } + TQString value() const { return m_value; } protected: - QString m_name; - QString m_value; + TQString m_name; + TQString m_value; }; } // namespace diff --git a/khtml/html/html_tableimpl.cpp b/khtml/html/html_tableimpl.cpp index 3d11c5e98..2c2e6567d 100644 --- a/khtml/html/html_tableimpl.cpp +++ b/khtml/html/html_tableimpl.cpp @@ -434,7 +434,7 @@ void HTMLTableElementImpl::parseAttribute(AttributeImpl *attr) #ifdef DEBUG_DRAW_BORDER border=1; #endif - DOMString v = QString::number( border ); + DOMString v = TQString::number( border ); addCSSLength(CSS_PROP_BORDER_WIDTH, v ); // wanted by HTML4 specs @@ -464,7 +464,7 @@ void HTMLTableElementImpl::parseAttribute(AttributeImpl *attr) case ATTR_BACKGROUND: { if (!attr->value().isEmpty()) { - QString url = khtml::parseURL( attr->value() ).string(); + TQString url = khtml::parseURL( attr->value() ).string(); url = getDocument()->completeURL( url ); addCSSProperty(CSS_PROP_BACKGROUND_IMAGE, "url('"+url+"')" ); } @@ -604,7 +604,7 @@ void HTMLTablePartElementImpl::parseAttribute(AttributeImpl *attr) case ATTR_BACKGROUND: { if (attr->val()) { - QString url = khtml::parseURL( attr->value() ).string(); + TQString url = khtml::parseURL( attr->value() ).string(); url = getDocument()->completeURL( url ); addCSSProperty(CSS_PROP_BACKGROUND_IMAGE, "url('"+url+"')" ); } diff --git a/khtml/html/htmlparser.cpp b/khtml/html/htmlparser.cpp index 1fe79f9e0..703186689 100644 --- a/khtml/html/htmlparser.cpp +++ b/khtml/html/htmlparser.cpp @@ -242,7 +242,7 @@ void KHTMLParser::parseToken(Token *t) current->id() != ID_SCRIPT && !t->text->containsOnlyWhitespace()) haveContent = true; #ifdef PARSER_DEBUG - kdDebug(6035) << "length="<< t->text->l << " text='" << QConstString(t->text->s, t->text->l).string() << "'" << endl; + kdDebug(6035) << "length="<< t->text->l << " text='" << TQConstString(t->text->s, t->text->l).string() << "'" << endl; #endif } @@ -346,7 +346,7 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat) n->attach(); if (n->maintainsState()) { document->registerMaintainsState(n); - QString state(document->nextState()); + TQString state(document->nextState()); if (!state.isNull()) n->restoreState(state); } n->close(); @@ -1043,7 +1043,7 @@ NodeImpl *KHTMLParser::getElement(Token* t) KHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled()&& KHTMLFactory::defaultHTMLSettings()->isHideAdsEnabled()) { - QString url = doc()->completeURL( khtml::parseURL(t->attrs->getValue(ATTR_SRC)).string() ); + TQString url = doc()->completeURL( khtml::parseURL(t->attrs->getValue(ATTR_SRC)).string() ); if (KHTMLFactory::defaultHTMLSettings()->isAdFiltered(url)) return 0; } @@ -1636,7 +1636,7 @@ void KHTMLParser::popOneBlock(bool delBlock) if((Elem->node != current)) { if (current->maintainsState() && document){ document->registerMaintainsState(current); - QString state(document->nextState()); + TQString state(document->nextState()); if (!state.isNull()) current->restoreState(state); } current->close(); diff --git a/khtml/html/htmlparser.h b/khtml/html/htmlparser.h index e09eefbae..ea1db2ee0 100644 --- a/khtml/html/htmlparser.h +++ b/khtml/html/htmlparser.h @@ -35,7 +35,7 @@ #define SPEED_DEBUG 0 #ifdef SPEED_DEBUG -#include <qdatetime.h> +#include <tqdatetime.h> #endif @@ -181,7 +181,7 @@ private: int inStrayTableContent; #if SPEED_DEBUG > 0 - QTime qt; + TQTime qt; #endif }; diff --git a/khtml/html/htmltokenizer.cpp b/khtml/html/htmltokenizer.cpp index e0983582a..5da6edd14 100644 --- a/khtml/html/htmltokenizer.cpp +++ b/khtml/html/htmltokenizer.cpp @@ -53,7 +53,7 @@ #include <kglobal.h> #include <ctype.h> #include <assert.h> -#include <qvariant.h> +#include <tqvariant.h> #include <kdebug.h> #include <stdlib.h> @@ -61,7 +61,7 @@ using namespace khtml; -static const QChar commentStart [] = { '<','!','-','-', QChar::null }; +static const TQChar commentStart [] = { '<','!','-','-', TQChar::null }; static const char scriptEnd [] = "</script"; static const char xmpEnd [] = "</xmp"; @@ -69,8 +69,8 @@ static const char styleEnd [] = "</style"; static const char textareaEnd [] = "</textarea"; static const char titleEnd [] = "</title"; -#define KHTML_ALLOC_QCHAR_VEC( N ) (QChar*) malloc( sizeof(QChar)*( N ) ) -#define KHTML_REALLOC_QCHAR_VEC(P, N ) (QChar*) realloc(P, sizeof(QChar)*( N )) +#define KHTML_ALLOC_QCHAR_VEC( N ) (TQChar*) malloc( sizeof(TQChar)*( N ) ) +#define KHTML_REALLOC_QCHAR_VEC(P, N ) (TQChar*) realloc(P, sizeof(TQChar)*( N )) #define KHTML_DELETE_QCHAR_VEC( P ) free((char*)( P )) // Full support for MS Windows extensions to Latin-1. @@ -316,7 +316,7 @@ void HTMLTokenizer::parseSpecial(TokenizerString &src) while ( !src.isEmpty() ) { checkScriptBuffer(); unsigned char ch = src->latin1(); - if ( !scriptCodeResync && !brokenComments && !textarea && !xmp && ch == '-' && scriptCodeSize >= 3 && !src.escaped() && QConstString( scriptCode+scriptCodeSize-3, 3 ).string() == "<!-" ) { + if ( !scriptCodeResync && !brokenComments && !textarea && !xmp && ch == '-' && scriptCodeSize >= 3 && !src.escaped() && TQConstString( scriptCode+scriptCodeSize-3, 3 ).string() == "<!-" ) { comment = true; scriptCode[ scriptCodeSize++ ] = ch; ++src; @@ -347,7 +347,7 @@ void HTMLTokenizer::parseSpecial(TokenizerString &src) // possible end of tagname, lets check. if ( !scriptCodeResync && !escaped && !src.escaped() && ( ch == '>' || ch == '/' || ch <= ' ' ) && ch && scriptCodeSize >= searchStopperLen && - !QConstString( scriptCode+scriptCodeSize-searchStopperLen, searchStopperLen ).string().find( searchStopper, 0, false )) { + !TQConstString( scriptCode+scriptCodeSize-searchStopperLen, searchStopperLen ).string().find( searchStopper, 0, false )) { scriptCodeResync = scriptCodeSize-searchStopperLen+1; tquote = NoQuote; continue; @@ -362,7 +362,7 @@ void HTMLTokenizer::parseSpecial(TokenizerString &src) } escaped = ( !escaped && ch == '\\' ); if (!scriptCodeResync && (textarea||title) && !src.escaped() && ch == '&') { - QChar *scriptCodeDest = scriptCode+scriptCodeSize; + TQChar *scriptCodeDest = scriptCode+scriptCodeSize; ++src; parseEntity(src,scriptCodeDest,true); scriptCodeSize = scriptCodeDest-scriptCode; @@ -376,11 +376,11 @@ void HTMLTokenizer::parseSpecial(TokenizerString &src) void HTMLTokenizer::scriptHandler() { - QString currentScriptSrc = scriptSrc; - scriptSrc = QString::null; + TQString currentScriptSrc = scriptSrc; + scriptSrc = TQString::null; processListing(TokenizerString(scriptCode, scriptCodeSize)); - QString exScript( buffer, dest-buffer ); + TQString exScript( buffer, dest-buffer ); processToken(); currToken.tid = ID_SCRIPT + ID_CLOSE_TAG; @@ -413,7 +413,7 @@ void HTMLTokenizer::scriptHandler() pendingQueue.push(src); setSrc(TokenizerString()); scriptCodeSize = scriptCodeResync = 0; - scriptExecution( exScript, QString::null, tagStartLineno /*scriptStartLineno*/ ); + scriptExecution( exScript, TQString::null, tagStartLineno /*scriptStartLineno*/ ); } else { // script was filtered or disallowed effectiveScript = false; @@ -436,13 +436,13 @@ void HTMLTokenizer::scriptHandler() } } -void HTMLTokenizer::scriptExecution( const QString& str, const QString& scriptURL, +void HTMLTokenizer::scriptExecution( const TQString& str, const TQString& scriptURL, int baseLine) { bool oldscript = script; m_executingScript++; script = false; - QString url; + TQString url; if (scriptURL.isNull() && view) url = static_cast<DocumentImpl*>(view->part()->document().handle())->URL().url(); else @@ -596,7 +596,7 @@ void HTMLTokenizer::parseText(TokenizerString &src) } -void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start) +void HTMLTokenizer::parseEntity(TokenizerString &src, TQChar *&dest, bool start) { if( start ) { @@ -642,7 +642,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start) int uc = EntityChar.unicode(); int ll = kMin<uint>(src.length(), 8); while(ll--) { - QChar csrc(src->lower()); + TQChar csrc(src->lower()); cc = csrc.cell(); if(csrc.row() || !((cc >= '0' && cc <= '9') || (cc >= 'a' && cc <= 'f'))) { @@ -652,7 +652,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start) cBuffer[cBufferPos++] = cc; ++src; } - EntityChar = QChar(uc); + EntityChar = TQChar(uc); Entity = SearchSemicolon; break; } @@ -672,7 +672,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start) cBuffer[cBufferPos++] = cc; ++src; } - EntityChar = QChar(uc); + EntityChar = TQChar(uc); if(cBufferPos == 9) Entity = SearchSemicolon; break; } @@ -680,7 +680,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start) { int ll = kMin(src.length(), 9-cBufferPos); while(ll--) { - QChar csrc = *src; + TQChar csrc = *src; cc = csrc.cell(); if(csrc.row() || !((cc >= 'a' && cc <= 'z') || @@ -729,7 +729,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start) checkBuffer(); if (entityLen > 0 && entityLen < cBufferPos) { int rem = cBufferPos - entityLen; - src.prepend( TokenizerString(QString::fromAscii(cBuffer+entityLen, rem)) ); + src.prepend( TokenizerString(TQString::fromAscii(cBuffer+entityLen, rem)) ); } src.push( EntityChar ); } else { @@ -747,7 +747,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start) } Entity = NoEntity; - EntityChar = QChar::null; + EntityChar = TQChar::null; return; }; } @@ -848,7 +848,7 @@ void HTMLTokenizer::parseTag(TokenizerString &src) uint tagID = khtml::getTagID(ptr, len); if (!tagID) { #ifdef TOKEN_DEBUG - QCString tmp(ptr, len+1); + TQCString tmp(ptr, len+1); kdDebug( 6036 ) << "Unknown tag: \"" << tmp.data() << "\"" << endl; #endif dest = buffer; @@ -856,7 +856,7 @@ void HTMLTokenizer::parseTag(TokenizerString &src) else { #ifdef TOKEN_DEBUG - QCString tmp(ptr, len+1); + TQCString tmp(ptr, len+1); kdDebug( 6036 ) << "found tag id=" << tagID << ": " << tmp.data() << endl; #endif currToken.tid = beginTag ? tagID : tagID + ID_CLOSE_TAG; @@ -883,7 +883,7 @@ void HTMLTokenizer::parseTag(TokenizerString &src) { tag = SearchValue; *dest++ = 0; - attrName = QString::null; + attrName = TQString::null; } else tag = AttributeName; @@ -919,16 +919,16 @@ void HTMLTokenizer::parseTag(TokenizerString &src) a = khtml::getAttrID(cBuffer, cBufferPos-1); } if (!a) - attrName = QString::fromLatin1(QCString(cBuffer, cBufferPos+1).data()); + attrName = TQString::fromLatin1(TQCString(cBuffer, cBufferPos+1).data()); } dest = buffer; *dest++ = a; #ifdef TOKEN_DEBUG if (!a || (cBufferPos && *cBuffer == '!')) - kdDebug( 6036 ) << "Unknown attribute: *" << QCString(cBuffer, cBufferPos+1).data() << "*" << endl; + kdDebug( 6036 ) << "Unknown attribute: *" << TQCString(cBuffer, cBufferPos+1).data() << "*" << endl; else - kdDebug( 6036 ) << "Known attribute: " << QCString(cBuffer, cBufferPos+1).data() << endl; + kdDebug( 6036 ) << "Known attribute: " << TQCString(cBuffer, cBufferPos+1).data() << endl; #endif tag = SearchEqual; @@ -941,7 +941,7 @@ void HTMLTokenizer::parseTag(TokenizerString &src) } if ( cBufferPos == CBUFLEN ) { cBuffer[cBufferPos] = '\0'; - attrName = QString::fromLatin1(QCString(cBuffer, cBufferPos+1).data()); + attrName = TQString::fromLatin1(TQCString(cBuffer, cBufferPos+1).data()); dest = buffer; *dest++ = 0; tag = SearchEqual; @@ -969,7 +969,7 @@ void HTMLTokenizer::parseTag(TokenizerString &src) { tag = SearchValue; *dest++ = 0; - attrName = QString::null; + attrName = TQString::null; } else { DOMString v(""); @@ -1120,7 +1120,7 @@ void HTMLTokenizer::parseTag(TokenizerString &src) else if ( !brokenScript && tagID == ID_SCRIPT ) { DOMStringImpl* a = 0; bool foundTypeAttribute = false; - scriptSrc = scriptSrcCharset = QString::null; + scriptSrc = scriptSrcCharset = TQString::null; if ( currToken.attrs && /* potentially have a ATTR_SRC ? */ view && /* are we a regular tokenizer or just for innerHTML ? */ parser->doc()->view()->part()->jScriptEnabled() /* jscript allowed at all? */ @@ -1148,7 +1148,7 @@ void HTMLTokenizer::parseTag(TokenizerString &src) Mozilla 1.5 and WinIE 6 both accept the empty string, but neither accept a whitespace-only string. We want to accept all the values that either of these browsers accept, but not other values. */ - QString type = DOMString(a).string().stripWhiteSpace().lower(); + TQString type = DOMString(a).string().stripWhiteSpace().lower(); if( type.compare("text/javascript") != 0 && type.compare("text/javascript1.0") != 0 && type.compare("text/javascript1.1") != 0 && @@ -1171,7 +1171,7 @@ void HTMLTokenizer::parseTag(TokenizerString &src) Neither Mozilla 1.5 nor WinIE 6 accept leading or trailing whitespace. We want to accept all the values that either of these browsers accept, but not other values. */ - QString lang = DOMString(a).string(); + TQString lang = DOMString(a).string(); lang = lang.lower(); if( lang.compare("") != 0 && lang.compare("javascript") != 0 && @@ -1284,7 +1284,7 @@ void HTMLTokenizer::addPending() { case SpacePending: // Insert a breaking space - *dest++ = QChar(' '); + *dest++ = TQChar(' '); prePos++; break; @@ -1297,7 +1297,7 @@ void HTMLTokenizer::addPending() case TabPending: p = TAB_SIZE - ( prePos % TAB_SIZE ); for ( int x = 0; x < p; x++ ) - *dest++ = QChar(' '); + *dest++ = TQChar(' '); prePos += p; break; @@ -1552,7 +1552,7 @@ void HTMLTokenizer::write( const TokenizerString &str, bool appendData ) end(); // this actually causes us to be deleted } -void HTMLTokenizer::timerEvent( QTimerEvent *e ) +void HTMLTokenizer::timerEvent( TQTimerEvent *e ) { if ( e->timerId() == m_autoCloseTimer && cachedScript.isEmpty() ) { finish(); @@ -1610,15 +1610,15 @@ void HTMLTokenizer::finish() scriptCode[ scriptCodeSize ] = 0; scriptCode[ scriptCodeSize + 1 ] = 0; int pos; - QString food; + TQString food; if (title || style || script) food.setUnicode(scriptCode, scriptCodeSize); else if (server) { food = "<"; - food += QString(scriptCode, scriptCodeSize); + food += TQString(scriptCode, scriptCodeSize); } else { - pos = QConstString(scriptCode, scriptCodeSize).string().find('>'); + pos = TQConstString(scriptCode, scriptCodeSize).string().find('>'); food.setUnicode(scriptCode+pos+1, scriptCodeSize-pos-1); // deep copy } KHTML_DELETE_QCHAR_VEC(scriptCode); @@ -1647,7 +1647,7 @@ void HTMLTokenizer::processToken() { #if 0 if(currToken.tid) { - qDebug( "unexpected token id: %d, str: *%s*", currToken.tid,QConstString( buffer,dest-buffer ).string().latin1() ); + qDebug( "unexpected token id: %d, str: *%s*", currToken.tid,TQConstString( buffer,dest-buffer ).string().latin1() ); assert(0); } @@ -1666,10 +1666,10 @@ void HTMLTokenizer::processToken() dest = buffer; #ifdef TOKEN_DEBUG - QString name = QString( getTagName(currToken.tid) ); - QString text; + TQString name = TQString( getTagName(currToken.tid) ); + TQString text; if(currToken.text) - text = QConstString(currToken.text->s, currToken.text->l).string(); + text = TQConstString(currToken.text->s, currToken.text->l).string(); kdDebug( 6036 ) << "Token --> " << name << " id = " << currToken.tid << endl; if (currToken.flat) @@ -1749,7 +1749,7 @@ void HTMLTokenizer::notifyFinished(CachedObject* /*finishedObj*/) // make sure we forget about the script before we execute the new one // infinite recursion might happen otherwise - QString cachedScriptUrl( cs->url().string() ); + TQString cachedScriptUrl( cs->url().string() ); cs->deref(this); scriptExecution( scriptSource.string(), cachedScriptUrl ); diff --git a/khtml/html/htmltokenizer.h b/khtml/html/htmltokenizer.h index 5e4186d58..8e36353b0 100644 --- a/khtml/html/htmltokenizer.h +++ b/khtml/html/htmltokenizer.h @@ -28,9 +28,9 @@ #ifndef HTMLTOKENIZER_H #define HTMLTOKENIZER_H -#include <qstring.h> -#include <qobject.h> -#include <qptrqueue.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqptrqueue.h> #include "misc/loader_client.h" #include "misc/htmltags.h" @@ -72,7 +72,7 @@ namespace khtml { if(attrs) attrs->deref(); if(text) text->deref(); } - void addAttribute(DocumentImpl* doc, QChar* buffer, const QString& attrName, const DOMString& v) + void addAttribute(DocumentImpl* doc, TQChar* buffer, const TQString& attrName, const DOMString& v) { DOMStringImpl *value = 0; NodeImpl::Id tid = 0; @@ -130,7 +130,7 @@ public: void write( const khtml::TokenizerString &str, bool appendData ); void end(); void finish(); - void timerEvent( QTimerEvent *e ); + void timerEvent( TQTimerEvent *e ); virtual void setOnHold(bool _onHold); void abort() { m_abort = true; } virtual void setAutoClose(bool b=true); @@ -149,10 +149,10 @@ protected: void parseListing(khtml::TokenizerString &str); void parseSpecial(khtml::TokenizerString &str); void parseTag(khtml::TokenizerString &str); - void parseEntity(khtml::TokenizerString &str, QChar *&dest, bool start = false); + void parseEntity(khtml::TokenizerString &str, TQChar *&dest, bool start = false); void parseProcessingInstruction(khtml::TokenizerString &str); void scriptHandler(); - void scriptExecution(const QString& script, const QString& scriptURL = QString::null, int baseLine = 0); + void scriptExecution(const TQString& script, const TQString& scriptURL = TQString::null, int baseLine = 0); void setSrc(const TokenizerString& source); // check if we have enough space in the buffer. @@ -177,8 +177,8 @@ protected: protected: // Internal buffers /////////////////// - QChar *buffer; - QChar *dest; + TQChar *buffer; + TQChar *dest; khtml::Token currToken; @@ -245,7 +245,7 @@ protected: // are we in a <script> ... </script> block bool script; - QChar EntityChar; + TQChar EntityChar; // Are we in a <pre> ... </pre> block bool pre; @@ -288,10 +288,10 @@ protected: bool brokenScript; // name of an unknown attribute - QString attrName; + TQString attrName; // Used to store the code of a srcipting sequence - QChar *scriptCode; + TQChar *scriptCode; // Size of the script sequenze stored in scriptCode int scriptCodeSize; // Maximal size that can be stored in scriptCode @@ -300,11 +300,11 @@ protected: int scriptCodeResync; // Stores characters if we are scanning for a string like "</script>" - QChar searchBuffer[ 10 ]; + TQChar searchBuffer[ 10 ]; // Counts where we are in the string we are scanning for int searchCount; // The string we are searching for - const QChar *searchFor; + const TQChar *searchFor; // the stopper string const char* searchStopper; // the stopper len @@ -313,15 +313,15 @@ protected: // may be still downloading) and finish bool noMoreData; // URL to get source code of script from - QString scriptSrc; - QString scriptSrcCharset; + TQString scriptSrc; + TQString scriptSrcCharset; bool javascript; // the HTML code we will parse after the external script we are waiting for has loaded TokenizerQueue pendingQueue; // true if we are executing a script while parsing a document. This causes the parsing of // the output of the script to be postponed until after the script has finished executing int m_executingScript; - QPtrQueue<khtml::CachedScript> cachedScript; + TQPtrQueue<khtml::CachedScript> cachedScript; // you can pause the tokenizer if you need to display a dialog or something bool onHold; // you can ask the tokenizer to abort the current write() call, e.g. to redirect somewhere else |