diff options
Diffstat (limited to 'khtml')
209 files changed, 6223 insertions, 6223 deletions
diff --git a/khtml/DESIGN.html b/khtml/DESIGN.html index a02e85a1b..00af13045 100644 --- a/khtml/DESIGN.html +++ b/khtml/DESIGN.html @@ -53,7 +53,7 @@ compatible to IE. <p> <a href="khtml_part.h">KHTMLPart</a> creates one instance of a -<a href="khtmlview.h">KHTMLView</a> (derived from QScrollView), +<a href="khtmlview.h">KHTMLView</a> (derived from TQScrollView), the widget showing the whole thing. At the same time a DOM tree is built up from the HTML or XML found in the specified file. <p> diff --git a/khtml/css/css_base.cpp b/khtml/css/css_base.cpp index 9cca21761..5af37b9b9 100644 --- a/khtml/css/css_base.cpp +++ b/khtml/css/css_base.cpp @@ -76,9 +76,9 @@ KURL StyleBaseImpl::baseURL() } void StyleBaseImpl::setParsedValue(int propId, const CSSValueImpl *parsedValue, - bool important, bool nonCSSHint, QPtrList<CSSProperty> *propList) + bool important, bool nonCSSHint, TQPtrList<CSSProperty> *propList) { - QPtrListIterator<CSSProperty> propIt(*propList); + TQPtrListIterator<CSSProperty> propIt(*propList); propIt.toLast(); // just remove the top one - not sure what should happen if we have multiple instances of the property while (propIt.current() && ( propIt.current()->m_id != propId || propIt.current()->nonCSSHint != nonCSSHint || @@ -122,7 +122,7 @@ StyleListImpl::~StyleListImpl() void CSSSelector::print(void) { - kdDebug( 6080 ) << "[Selector: tag = " << QString::number(tag,16) << ", attr = \"" << attr << "\", match = \"" << match + kdDebug( 6080 ) << "[Selector: tag = " << TQString::number(tag,16) << ", attr = \"" << attr << "\", match = \"" << match << "\" value = \"" << value.string().latin1() << "\" relation = " << (int)relation << "]" << endl; if ( tagHistory ) diff --git a/khtml/css/css_base.h b/khtml/css/css_base.h index f8b520423..9a8774107 100644 --- a/khtml/css/css_base.h +++ b/khtml/css/css_base.h @@ -30,8 +30,8 @@ #include "xml/dom_nodeimpl.h" #include "misc/shared.h" #include <kdemacros.h> -#include <qdatetime.h> -#include <qptrlist.h> +#include <tqdatetime.h> +#include <tqptrlist.h> namespace DOM { @@ -229,7 +229,7 @@ namespace DOM { void setParent(StyleBaseImpl *parent) { m_parent = parent; } static void setParsedValue(int propId, const CSSValueImpl *parsedValue, - bool important, bool nonCSSHint, QPtrList<CSSProperty> *propList); + bool important, bool nonCSSHint, TQPtrList<CSSProperty> *propList); virtual bool parseString(const DOMString &/*cssString*/, bool = false) { return false; } @@ -261,7 +261,7 @@ namespace DOM { void append(StyleBaseImpl *item) { m_lstChildren->append(item); } protected: - QPtrList<StyleBaseImpl> *m_lstChildren; + TQPtrList<StyleBaseImpl> *m_lstChildren; }; KDE_NO_EXPORT int getPropertyID(const char *tagStr, int len); diff --git a/khtml/css/css_renderstyledeclarationimpl.cpp b/khtml/css/css_renderstyledeclarationimpl.cpp index 25de55f4a..daf607a9e 100644 --- a/khtml/css/css_renderstyledeclarationimpl.cpp +++ b/khtml/css/css_renderstyledeclarationimpl.cpp @@ -267,7 +267,7 @@ DOMString khtml::stringForListStyleType(EListStyleType type) return ""; } -static CSSPrimitiveValueImpl* valueForColor(QColor color) +static CSSPrimitiveValueImpl* valueForColor(TQColor color) { if (color.isValid()) return new CSSPrimitiveValueImpl(color.rgb());//### KDE4: use rgba! @@ -412,15 +412,15 @@ CSSValueImpl *RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID ) DOMString string; Length length(style->backgroundXPosition()); if (length.isPercent()) - string = QString::number(length.value()) + "%"; + string = TQString::number(length.value()) + "%"; else - string = QString::number(length.minWidth(renderer->contentWidth())); + string = TQString::number(length.minWidth(renderer->contentWidth())); string += " "; length = style->backgroundYPosition(); if (length.isPercent()) - string += QString::number(length.value()) + "%"; + string += TQString::number(length.value()) + "%"; else - string += QString::number(length.minWidth(renderer->contentWidth())); + string += TQString::number(length.minWidth(renderer->contentWidth())); return new CSSPrimitiveValueImpl(string, CSSPrimitiveValue::CSS_STRING); } case CSS_PROP_BACKGROUND_POSITION_X: @@ -434,9 +434,9 @@ CSSValueImpl *RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID ) return new CSSPrimitiveValueImpl(CSS_VAL_SEPARATE); case CSS_PROP_BORDER_SPACING: { - QString string(QString::number(style->borderHorizontalSpacing()) + + TQString string(TQString::number(style->borderHorizontalSpacing()) + "px " + - QString::number(style->borderVerticalSpacing()) + + TQString::number(style->borderVerticalSpacing()) + "px"); return new CSSPrimitiveValueImpl(string, CSSPrimitiveValue::CSS_STRING); } @@ -651,7 +651,7 @@ CSSValueImpl *RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID ) // FIXME: this does not reflect the full range of weights // that can be expressed with CSS FontDef def = style->htmlFont().getFontDef(); - if (def.weight == QFont::Bold) + if (def.weight == TQFont::Bold) return new CSSPrimitiveValueImpl(CSS_VAL_BOLD); else return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL); @@ -888,7 +888,7 @@ CSSValueImpl *RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID ) return valueForTextAlign(style->textAlign()); case CSS_PROP_TEXT_DECORATION: { - QString string; + TQString string; if (style->textDecoration() & khtml::UNDERLINE) string += "underline"; if (style->textDecoration() & khtml::OVERLINE) { diff --git a/khtml/css/css_ruleimpl.cpp b/khtml/css/css_ruleimpl.cpp index ff927e061..0bf675484 100644 --- a/khtml/css/css_ruleimpl.cpp +++ b/khtml/css/css_ruleimpl.cpp @@ -148,7 +148,7 @@ void CSSImportRuleImpl::setStyleSheet(const DOM::DOMString &url, const DOM::DOMS checkLoaded(); } -void CSSImportRuleImpl::error(int /*err*/, const QString &/*text*/) +void CSSImportRuleImpl::error(int /*err*/, const TQString &/*text*/) { if ( m_styleSheet ) { m_styleSheet->setParent(0); diff --git a/khtml/css/css_ruleimpl.h b/khtml/css/css_ruleimpl.h index 0db6e97ba..2753fcf83 100644 --- a/khtml/css/css_ruleimpl.h +++ b/khtml/css/css_ruleimpl.h @@ -113,7 +113,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(); virtual void init(); @@ -146,7 +146,7 @@ public: void append( CSSRuleImpl *rule ) { m_lstCSSRules.append( rule ); } protected: - QPtrList<CSSRuleImpl> m_lstCSSRules; + TQPtrList<CSSRuleImpl> m_lstCSSRules; }; class CSSMediaRuleImpl : public CSSRuleImpl @@ -209,17 +209,17 @@ public: virtual bool parseString( const DOMString &string, bool = false ); - void setSelector( QPtrList<CSSSelector> *selector) { m_selector = selector; } + void setSelector( TQPtrList<CSSSelector> *selector) { m_selector = selector; } void setDeclaration( CSSStyleDeclarationImpl *style); - QPtrList<CSSSelector> *selector() { return m_selector; } + TQPtrList<CSSSelector> *selector() { return m_selector; } CSSStyleDeclarationImpl *declaration() { return m_style; } void setNonCSSHints(); protected: CSSStyleDeclarationImpl *m_style; - QPtrList<CSSSelector> *m_selector; + TQPtrList<CSSSelector> *m_selector; }; diff --git a/khtml/css/css_stylesheetimpl.cpp b/khtml/css/css_stylesheetimpl.cpp index 4743cd2e4..bf85c0d59 100644 --- a/khtml/css/css_stylesheetimpl.cpp +++ b/khtml/css/css_stylesheetimpl.cpp @@ -110,7 +110,7 @@ void StyleSheetImpl::setDisabled( bool disabled ) CSSStyleSheetImpl::CSSStyleSheetImpl(CSSStyleSheetImpl *parentSheet, DOMString href) : StyleSheetImpl(parentSheet, href) { - m_lstChildren = new QPtrList<StyleBaseImpl>; + m_lstChildren = new TQPtrList<StyleBaseImpl>; m_doc = parentSheet ? parentSheet->doc() : 0; m_implicit = false; m_namespaces = 0; @@ -120,7 +120,7 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(CSSStyleSheetImpl *parentSheet, DOMString h CSSStyleSheetImpl::CSSStyleSheetImpl(DOM::NodeImpl *parentNode, DOMString href, bool _implicit) : StyleSheetImpl(parentNode, href) { - m_lstChildren = new QPtrList<StyleBaseImpl>; + m_lstChildren = new TQPtrList<StyleBaseImpl>; m_doc = parentNode->getDocument(); m_implicit = _implicit; m_namespaces = 0; @@ -130,7 +130,7 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(DOM::NodeImpl *parentNode, DOMString href, CSSStyleSheetImpl::CSSStyleSheetImpl(CSSRuleImpl *ownerRule, DOMString href) : StyleSheetImpl(ownerRule, href) { - m_lstChildren = new QPtrList<StyleBaseImpl>; + m_lstChildren = new TQPtrList<StyleBaseImpl>; m_doc = static_cast<CSSStyleSheetImpl*>(ownerRule->stylesheet())->doc(); m_implicit = false; m_namespaces = 0; @@ -140,7 +140,7 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(CSSRuleImpl *ownerRule, DOMString href) CSSStyleSheetImpl::CSSStyleSheetImpl(DOM::NodeImpl *parentNode, CSSStyleSheetImpl *orig) : StyleSheetImpl(parentNode, orig->m_strHref) { - m_lstChildren = new QPtrList<StyleBaseImpl>; + m_lstChildren = new TQPtrList<StyleBaseImpl>; StyleBaseImpl *rule; for ( rule = orig->m_lstChildren->first(); rule != 0; rule = orig->m_lstChildren->next() ) { @@ -157,7 +157,7 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(CSSRuleImpl *ownerRule, CSSStyleSheetImpl * : StyleSheetImpl(ownerRule, orig->m_strHref) { // m_lstChildren is deleted in StyleListImpl - m_lstChildren = new QPtrList<StyleBaseImpl>; + m_lstChildren = new TQPtrList<StyleBaseImpl>; StyleBaseImpl *rule; for ( rule = orig->m_lstChildren->first(); rule != 0; rule = orig->m_lstChildren->next() ) { @@ -318,7 +318,7 @@ void CSSStyleSheetImpl::setNonCSSHints() StyleSheetListImpl::~StyleSheetListImpl() { - for ( QPtrListIterator<StyleSheetImpl> it ( styleSheets ); it.current(); ++it ) + for ( TQPtrListIterator<StyleSheetImpl> it ( styleSheets ); it.current(); ++it ) it.current()->deref(); } @@ -340,7 +340,7 @@ unsigned long StyleSheetListImpl::length() const { // hack so implicit BODY stylesheets don't get counted here unsigned long l = 0; - QPtrListIterator<StyleSheetImpl> it(styleSheets); + TQPtrListIterator<StyleSheetImpl> it(styleSheets); for (; it.current(); ++it) { if (!it.current()->isCSSStyleSheet() || !static_cast<CSSStyleSheetImpl*>(it.current())->implicit()) ++l; @@ -351,7 +351,7 @@ unsigned long StyleSheetListImpl::length() const StyleSheetImpl *StyleSheetListImpl::item ( unsigned long index ) { unsigned long l = 0; - QPtrListIterator<StyleSheetImpl> it(styleSheets); + TQPtrListIterator<StyleSheetImpl> it(styleSheets); for (; it.current(); ++it) { if (!it.current()->isCSSStyleSheet() || !static_cast<CSSStyleSheetImpl*>(it.current())->implicit()) { if (l == index) @@ -397,9 +397,9 @@ CSSRuleImpl *MediaListImpl::parentRule() const void MediaListImpl::deleteMedium( const DOMString &oldMedium ) { - const QValueList<DOMString>::Iterator itEnd = m_lstMedia.end(); + const TQValueList<DOMString>::Iterator itEnd = m_lstMedia.end(); - for ( QValueList<DOMString>::Iterator it = m_lstMedia.begin(); it != itEnd; ++it ) { + for ( TQValueList<DOMString>::Iterator it = m_lstMedia.begin(); it != itEnd; ++it ) { if( (*it) == oldMedium ) { m_lstMedia.remove( it ); return; @@ -410,9 +410,9 @@ void MediaListImpl::deleteMedium( const DOMString &oldMedium ) DOM::DOMString MediaListImpl::mediaText() const { DOMString text; - const QValueList<DOMString>::ConstIterator itEnd = m_lstMedia.end(); + const TQValueList<DOMString>::ConstIterator itEnd = m_lstMedia.end(); - for ( QValueList<DOMString>::ConstIterator it = m_lstMedia.begin(); it != itEnd; ++it ) { + for ( TQValueList<DOMString>::ConstIterator it = m_lstMedia.begin(); it != itEnd; ++it ) { text += *it; text += ", "; } @@ -422,12 +422,12 @@ DOM::DOMString MediaListImpl::mediaText() const void MediaListImpl::setMediaText(const DOM::DOMString &value) { m_lstMedia.clear(); - const QString val = value.string(); - const QStringList list = QStringList::split( ',', val ); + const TQString val = value.string(); + const TQStringList list = TQStringList::split( ',', val ); - const QStringList::ConstIterator itEnd = list.end(); + const TQStringList::ConstIterator itEnd = list.end(); - for ( QStringList::ConstIterator it = list.begin(); it != itEnd; ++it ) + for ( TQStringList::ConstIterator it = list.begin(); it != itEnd; ++it ) { const DOMString medium = (*it).stripWhiteSpace(); if( !medium.isEmpty() ) diff --git a/khtml/css/css_stylesheetimpl.h b/khtml/css/css_stylesheetimpl.h index 0b35c2104..e7a551947 100644 --- a/khtml/css/css_stylesheetimpl.h +++ b/khtml/css/css_stylesheetimpl.h @@ -23,8 +23,8 @@ #ifndef _CSS_css_stylesheetimpl_h_ #define _CSS_css_stylesheetimpl_h_ -#include <qvaluelist.h> -#include <qptrlist.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> #include "dom/dom_string.h" #include "css/css_base.h" @@ -143,7 +143,7 @@ public: void add(StyleSheetImpl* s); void remove(StyleSheetImpl* s); - QPtrList<StyleSheetImpl> styleSheets; + TQPtrList<StyleSheetImpl> styleSheets; }; // ---------------------------------------------------------------------------- @@ -182,7 +182,7 @@ public: bool contains( const DOM::DOMString &medium ) const; protected: - QValueList<DOM::DOMString> m_lstMedia; + TQValueList<DOM::DOMString> m_lstMedia; }; diff --git a/khtml/css/css_valueimpl.cpp b/khtml/css/css_valueimpl.cpp index 531cb88bf..73a53d5d2 100644 --- a/khtml/css/css_valueimpl.cpp +++ b/khtml/css/css_valueimpl.cpp @@ -41,9 +41,9 @@ #include "rendering/render_style.h" #include <kdebug.h> -#include <qregexp.h> -#include <qpaintdevice.h> -#include <qpaintdevicemetrics.h> +#include <tqregexp.h> +#include <tqpaintdevice.h> +#include <tqpaintdevicemetrics.h> // Hack for debugging purposes extern DOM::DOMString getPropertyName(unsigned short id); @@ -56,7 +56,7 @@ using namespace DOM; static DOMString quoteStringIfNeeded(const DOMString &string) { // FIXME: Also need to transform control characters into \ sequences. - QString s = string.string(); + TQString s = string.string(); s.replace('\\', "\\\\"); s.replace('\'', "\\'"); return '\'' + s + '\''; @@ -70,7 +70,7 @@ CSSStyleDeclarationImpl::CSSStyleDeclarationImpl(CSSRuleImpl *parent) m_node = 0; } -CSSStyleDeclarationImpl::CSSStyleDeclarationImpl(CSSRuleImpl *parent, QPtrList<CSSProperty> *lstValues) +CSSStyleDeclarationImpl::CSSStyleDeclarationImpl(CSSRuleImpl *parent, TQPtrList<CSSProperty> *lstValues) : StyleBaseImpl(parent) { m_lstValues = lstValues; @@ -83,10 +83,10 @@ CSSStyleDeclarationImpl& CSSStyleDeclarationImpl::operator= (const CSSStyleDecl delete m_lstValues; m_lstValues = 0; if (o.m_lstValues) { - m_lstValues = new QPtrList<CSSProperty>; + m_lstValues = new TQPtrList<CSSProperty>; m_lstValues->setAutoDelete( true ); - QPtrListIterator<CSSProperty> lstValuesIt(*o.m_lstValues); + TQPtrListIterator<CSSProperty> lstValuesIt(*o.m_lstValues); for (lstValuesIt.toFirst(); lstValuesIt.current(); ++lstValuesIt) m_lstValues->append(new CSSProperty(*lstValuesIt.current())); } @@ -233,7 +233,7 @@ DOMString CSSStyleDeclarationImpl::getShortHandValue( const int* properties, int { if(!m_lstValues) return 0; - QPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues); + TQPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues); CSSProperty *current; for ( lstValuesIt.toLast(); (current = lstValuesIt.current()); --lstValuesIt ) if (current->m_id == propertyID && !current->nonCSSHint) @@ -246,7 +246,7 @@ DOMString CSSStyleDeclarationImpl::removeProperty( int propertyID, bool NonCSSHi if(!m_lstValues) return DOMString(); DOMString value; - QPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues); + TQPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues); CSSProperty *current; for ( lstValuesIt.toLast(); (current = lstValuesIt.current()); --lstValuesIt ) { if (current->m_id == propertyID && NonCSSHint == current->nonCSSHint) { @@ -289,7 +289,7 @@ void CSSStyleDeclarationImpl::removeCSSHints() bool CSSStyleDeclarationImpl::getPropertyPriority( int propertyID ) const { if ( m_lstValues) { - QPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues); + TQPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues); CSSProperty *current; for ( lstValuesIt.toFirst(); (current = lstValuesIt.current()); ++lstValuesIt ) { if( propertyID == current->m_id ) @@ -302,7 +302,7 @@ bool CSSStyleDeclarationImpl::getPropertyPriority( int propertyID ) const bool CSSStyleDeclarationImpl::setProperty(int id, const DOMString &value, bool important, bool nonCSSHint) { if(!m_lstValues) { - m_lstValues = new QPtrList<CSSProperty>; + m_lstValues = new TQPtrList<CSSProperty>; m_lstValues->setAutoDelete(true); } @@ -319,7 +319,7 @@ bool CSSStyleDeclarationImpl::setProperty(int id, const DOMString &value, bool i void CSSStyleDeclarationImpl::setProperty(int id, int value, bool important, bool nonCSSHint) { if(!m_lstValues) { - m_lstValues = new QPtrList<CSSProperty>; + m_lstValues = new TQPtrList<CSSProperty>; m_lstValues->setAutoDelete(true); } removeProperty(id, nonCSSHint ); @@ -342,7 +342,7 @@ void CSSStyleDeclarationImpl::setLengthProperty(int id, const DOM::DOMString &va void CSSStyleDeclarationImpl::setProperty ( const DOMString &propertyString) { if(!m_lstValues) { - m_lstValues = new QPtrList<CSSProperty>; + m_lstValues = new TQPtrList<CSSProperty>; m_lstValues->setAutoDelete( true ); } @@ -374,7 +374,7 @@ DOM::DOMString CSSStyleDeclarationImpl::cssText() const DOMString result; if ( m_lstValues) { - QPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues); + TQPtrListIterator<CSSProperty> lstValuesIt(*m_lstValues); CSSProperty *current; for ( lstValuesIt.toFirst(); (current = lstValuesIt.current()); ++lstValuesIt ) { result += current->cssText(); @@ -389,7 +389,7 @@ void CSSStyleDeclarationImpl::setCssText(DOM::DOMString text) if (m_lstValues) { m_lstValues->clear(); } else { - m_lstValues = new QPtrList<CSSProperty>; + m_lstValues = new TQPtrList<CSSProperty>; m_lstValues->setAutoDelete( true ); } @@ -454,7 +454,7 @@ DOM::DOMString CSSValueListImpl::cssText() const { DOMString result = ""; - for (QPtrListIterator<CSSValueImpl> iterator(m_values); iterator.current(); ++iterator) { + for (TQPtrListIterator<CSSValueImpl> iterator(m_values); iterator.current(); ++iterator) { result += iterator.current()->cssText(); } @@ -549,7 +549,7 @@ void CSSPrimitiveValueImpl::cleanup() m_type = 0; } -int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics ) +int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, TQPaintDeviceMetrics *devMetrics ) { double result = computeLengthFloat( style, devMetrics ); // This conversion is imprecise, often resulting in values of, e.g., 44.99998. We @@ -558,7 +558,7 @@ int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDevic return intResult; } -double CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics ) +double CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, TQPaintDeviceMetrics *devMetrics ) { unsigned short type = primitiveType(); @@ -576,11 +576,11 @@ double CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, QPa break; case CSSPrimitiveValue::CSS_EXS: { - QFontMetrics fm = style->fontMetrics(); + TQFontMetrics fm = style->fontMetrics(); #ifdef APPLE_CHANGES factor = fm.xHeight(); #else - QRect b = fm.boundingRect('x'); + TQRect b = fm.boundingRect('x'); factor = b.height(); #endif break; @@ -671,55 +671,55 @@ DOM::DOMString CSSPrimitiveValueImpl::cssText() const // ### break; case CSSPrimitiveValue::CSS_NUMBER: - text = DOMString(QString::number( (int)m_value.num )); + text = DOMString(TQString::number( (int)m_value.num )); break; case CSSPrimitiveValue::CSS_PERCENTAGE: - text = DOMString(QString::number( m_value.num ) + "%"); + text = DOMString(TQString::number( m_value.num ) + "%"); break; case CSSPrimitiveValue::CSS_EMS: - text = DOMString(QString::number( m_value.num ) + "em"); + text = DOMString(TQString::number( m_value.num ) + "em"); break; case CSSPrimitiveValue::CSS_EXS: - text = DOMString(QString::number( m_value.num ) + "ex"); + text = DOMString(TQString::number( m_value.num ) + "ex"); break; case CSSPrimitiveValue::CSS_PX: - text = DOMString(QString::number( m_value.num ) + "px"); + text = DOMString(TQString::number( m_value.num ) + "px"); break; case CSSPrimitiveValue::CSS_CM: - text = DOMString(QString::number( m_value.num ) + "cm"); + text = DOMString(TQString::number( m_value.num ) + "cm"); break; case CSSPrimitiveValue::CSS_MM: - text = DOMString(QString::number( m_value.num ) + "mm"); + text = DOMString(TQString::number( m_value.num ) + "mm"); break; case CSSPrimitiveValue::CSS_IN: - text = DOMString(QString::number( m_value.num ) + "in"); + text = DOMString(TQString::number( m_value.num ) + "in"); break; case CSSPrimitiveValue::CSS_PT: - text = DOMString(QString::number( m_value.num ) + "pt"); + text = DOMString(TQString::number( m_value.num ) + "pt"); break; case CSSPrimitiveValue::CSS_PC: - text = DOMString(QString::number( m_value.num ) + "pc"); + text = DOMString(TQString::number( m_value.num ) + "pc"); break; case CSSPrimitiveValue::CSS_DEG: - text = DOMString(QString::number( m_value.num ) + "deg"); + text = DOMString(TQString::number( m_value.num ) + "deg"); break; case CSSPrimitiveValue::CSS_RAD: - text = DOMString(QString::number( m_value.num ) + "rad"); + text = DOMString(TQString::number( m_value.num ) + "rad"); break; case CSSPrimitiveValue::CSS_GRAD: - text = DOMString(QString::number( m_value.num ) + "grad"); + text = DOMString(TQString::number( m_value.num ) + "grad"); break; case CSSPrimitiveValue::CSS_MS: - text = DOMString(QString::number( m_value.num ) + "ms"); + text = DOMString(TQString::number( m_value.num ) + "ms"); break; case CSSPrimitiveValue::CSS_S: - text = DOMString(QString::number( m_value.num ) + "s"); + text = DOMString(TQString::number( m_value.num ) + "s"); break; case CSSPrimitiveValue::CSS_HZ: - text = DOMString(QString::number( m_value.num ) + "hz"); + text = DOMString(TQString::number( m_value.num ) + "hz"); break; case CSSPrimitiveValue::CSS_KHZ: - text = DOMString(QString::number( m_value.num ) + "khz"); + text = DOMString(TQString::number( m_value.num ) + "khz"); break; case CSSPrimitiveValue::CSS_DIMENSION: // ### @@ -759,12 +759,12 @@ DOM::DOMString CSSPrimitiveValueImpl::cssText() const if (m_value.rgbcolor == khtml::transparentColor) text = "transparent"; else - text = "rgba(" + QString::number(qRed (m_value.rgbcolor)) + "," - + QString::number(qBlue (m_value.rgbcolor)) + "," - + QString::number(qGreen(m_value.rgbcolor)) + "," - + QString::number(qAlpha(m_value.rgbcolor)/255.0) + ")"; + text = "rgba(" + TQString::number(qRed (m_value.rgbcolor)) + "," + + TQString::number(qBlue (m_value.rgbcolor)) + "," + + TQString::number(qGreen(m_value.rgbcolor)) + "," + + TQString::number(qAlpha(m_value.rgbcolor)/255.0) + ")"; } else { - text = QColor(m_value.rgbcolor).name(); + text = TQColor(m_value.rgbcolor).name(); } break; case CSSPrimitiveValue::CSS_PAIR: @@ -876,20 +876,20 @@ CSSImageValueImpl::~CSSImageValueImpl() // ------------------------------------------------------------------------ -FontFamilyValueImpl::FontFamilyValueImpl( const QString &string) +FontFamilyValueImpl::FontFamilyValueImpl( const TQString &string) : CSSPrimitiveValueImpl( DOMString(string), CSSPrimitiveValue::CSS_STRING) { - static const QRegExp parenReg(" \\(.*\\)$"); - static const QRegExp braceReg(" \\[.*\\]$"); + static const TQRegExp parenReg(" \\(.*\\)$"); + static const TQRegExp braceReg(" \\[.*\\]$"); parsedFontName = string; // a language tag is often added in braces at the end. Remove it. - parsedFontName.replace(parenReg, QString::null); + parsedFontName.replace(parenReg, TQString::null); // remove [Xft] qualifiers - parsedFontName.replace(braceReg, QString::null); + parsedFontName.replace(braceReg, TQString::null); #ifndef APPLE_CHANGES - const QString &available = KHTMLSettings::availableFamilies(); + const TQString &available = KHTMLSettings::availableFamilies(); parsedFontName = parsedFontName.lower(); // kdDebug(0) << "searching for face '" << parsedFontName << "'" << endl; @@ -913,7 +913,7 @@ FontFamilyValueImpl::FontFamilyValueImpl( const QString &string) parsedFontName = available.mid( pos, p - pos); // kdDebug(0) << "going for '" << parsedFontName << "'" << endl; } else - parsedFontName = QString::null; + parsedFontName = TQString::null; #endif // !APPLE_CHANGES } @@ -987,14 +987,14 @@ DOMString QuotesValueImpl::cssText() const return "\"" + data.join("\" \"") + "\""; } -void QuotesValueImpl::addLevel(const QString& open, const QString& close) +void QuotesValueImpl::addLevel(const TQString& open, const TQString& close) { data.append(open); data.append(close); levels++; } -QString QuotesValueImpl::openQuote(int level) const +TQString QuotesValueImpl::openQuote(int level) const { if (levels == 0) return ""; level--; // increments are calculated before openQuote is called @@ -1005,7 +1005,7 @@ QString QuotesValueImpl::openQuote(int level) const return data[level*2]; } -QString QuotesValueImpl::closeQuote(int level) const +TQString QuotesValueImpl::closeQuote(int level) const { if (levels == 0) return ""; // kdDebug( 6080 ) << "Close quote level:" << level << endl; @@ -1060,7 +1060,7 @@ DOMString ShadowValueImpl::cssText() const DOMString CounterActImpl::cssText() const { DOMString text(m_counter); - text += DOMString(QString::number(m_value)); + text += DOMString(TQString::number(m_value)); return text; } diff --git a/khtml/css/css_valueimpl.h b/khtml/css/css_valueimpl.h index 5b4207149..3566c00cb 100644 --- a/khtml/css/css_valueimpl.h +++ b/khtml/css/css_valueimpl.h @@ -30,7 +30,7 @@ #include "misc/loader_client.h" #include "misc/shared.h" -#include <qintdict.h> +#include <tqintdict.h> namespace khtml { class RenderStyle; @@ -51,7 +51,7 @@ class CSSStyleDeclarationImpl : public StyleBaseImpl { public: CSSStyleDeclarationImpl(CSSRuleImpl *parentRule); - CSSStyleDeclarationImpl(CSSRuleImpl *parentRule, QPtrList<CSSProperty> *lstValues); + CSSStyleDeclarationImpl(CSSRuleImpl *parentRule, TQPtrList<CSSProperty> *lstValues); virtual ~CSSStyleDeclarationImpl(); CSSStyleDeclarationImpl& operator=( const CSSStyleDeclarationImpl&); @@ -79,7 +79,7 @@ public: virtual DOMString getPropertyValue( int propertyID ) const; virtual bool getPropertyPriority( int propertyID ) const; - QPtrList<CSSProperty> *values() const { return m_lstValues; } + TQPtrList<CSSProperty> *values() const { return m_lstValues; } void setNode(NodeImpl *_node) { m_node = _node; } void setChanged(); @@ -90,7 +90,7 @@ protected: DOMString getShortHandValue( const int* properties, int number ) const; DOMString get4Values( const int* properties ) const; - QPtrList<CSSProperty> *m_lstValues; + TQPtrList<CSSProperty> *m_lstValues; NodeImpl *m_node; private: @@ -146,7 +146,7 @@ public: virtual DOM::DOMString cssText() const; protected: - QPtrList<CSSValueImpl> m_values; + TQPtrList<CSSValueImpl> m_values; }; @@ -182,9 +182,9 @@ public: * this is screen/printer dependent, so we probably need a config option for this, * and some tool to calibrate. */ - int computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics ); + int computeLength( khtml::RenderStyle *style, TQPaintDeviceMetrics *devMetrics ); - double computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics ); + double computeLengthFloat( khtml::RenderStyle *style, TQPaintDeviceMetrics *devMetrics ); // use with care!!! void setPrimitiveType(unsigned short type) { m_type = type; } @@ -323,11 +323,11 @@ protected: class FontFamilyValueImpl : public CSSPrimitiveValueImpl { public: - FontFamilyValueImpl( const QString &string); - const QString &fontName() const { return parsedFontName; } + FontFamilyValueImpl( const TQString &string); + const TQString &fontName() const { return parsedFontName; } int genericFamilyType() const { return _genericFamilyType; } protected: - QString parsedFontName; + TQString parsedFontName; private: int _genericFamilyType; }; @@ -362,12 +362,12 @@ public: virtual unsigned short cssValueType() const { return CSSValue::CSS_CUSTOM; } virtual DOM::DOMString cssText() const; - void addLevel(const QString& open, const QString& close); - QString openQuote(int level) const; - QString closeQuote(int level) const; + void addLevel(const TQString& open, const TQString& close); + TQString openQuote(int level) const; + TQString closeQuote(int level) const; unsigned int levels; - QStringList data; + TQStringList data; }; // Used for text-shadow and box-shadow diff --git a/khtml/css/csshelper.cpp b/khtml/css/csshelper.cpp index 7b7a464f4..73eff588c 100644 --- a/khtml/css/csshelper.cpp +++ b/khtml/css/csshelper.cpp @@ -21,11 +21,11 @@ */ #include "csshelper.h" -#include <qfontmetrics.h> -#include <qfontinfo.h> -#include <qpaintdevice.h> -#include <qpaintdevicemetrics.h> -#include <qfontdatabase.h> +#include <tqfontmetrics.h> +#include <tqfontinfo.h> +#include <tqpaintdevice.h> +#include <tqpaintdevicemetrics.h> +#include <tqfontdatabase.h> #include <kcharsets.h> #include <kglobal.h> diff --git a/khtml/css/csshelper.h b/khtml/css/csshelper.h index 68793421b..5a9142091 100644 --- a/khtml/css/csshelper.h +++ b/khtml/css/csshelper.h @@ -22,8 +22,8 @@ #ifndef css_helper_h #define css_helper_h -#include <qcolor.h> -#include <qfont.h> +#include <tqcolor.h> +#include <tqfont.h> #include "dom/dom_string.h" diff --git a/khtml/css/cssparser.cpp b/khtml/css/cssparser.cpp index 6ec9a4ec7..1bff45c51 100644 --- a/khtml/css/cssparser.cpp +++ b/khtml/css/cssparser.cpp @@ -191,7 +191,7 @@ CSSRuleImpl *CSSParser::parseRule( DOM::CSSStyleSheetImpl *sheet, const DOM::DOM for ( unsigned int i = 0; i < strlen(khtml_rule); i++ ) data[i] = khtml_rule[i]; memcpy( data + strlen( khtml_rule ), string.unicode(), string.length()*sizeof( unsigned short) ); - // qDebug("parse string = '%s'", QConstString( (const QChar *)data, length ).string().latin1() ); + // qDebug("parse string = '%s'", TQConstString( (const TQChar *)data, length ).string().latin1() ); data[length-4] = '}'; runParser(length); @@ -220,7 +220,7 @@ bool CSSParser::parseValue( DOM::CSSStyleDeclarationImpl *declaration, int _id, data[i] = khtml_value[i]; memcpy( data + strlen( khtml_value ), string.unicode(), string.length()*sizeof( unsigned short) ); data[length-4] = '}'; - // qDebug("parse string = '%s'", QConstString( (const QChar *)data, length ).string().latin1() ); + // qDebug("parse string = '%s'", TQConstString( (const TQChar *)data, length ).string().latin1() ); id = _id; important = _important; @@ -301,7 +301,7 @@ void CSSParser::addProperty( int propId, CSSValueImpl *value, bool important ) CSSStyleDeclarationImpl *CSSParser::createStyleDeclaration( CSSStyleRuleImpl *rule ) { - QPtrList<CSSProperty> *propList = new QPtrList<CSSProperty>; + TQPtrList<CSSProperty> *propList = new TQPtrList<CSSProperty>; propList->setAutoDelete( true ); for ( int i = 0; i < numParsedProperties; i++ ) propList->append( parsedProperties[i] ); @@ -477,7 +477,7 @@ bool CSSParser::parseValue( int propId, bool important ) } else { QuotesValueImpl *quotes = new QuotesValueImpl; bool is_valid = true; - QString open, close; + TQString open, close; Value *val=valueList->current(); while (val) { if (val->unit == CSSPrimitiveValue::CSS_STRING) @@ -1338,7 +1338,7 @@ bool CSSParser::parseContent( int propId, bool important ) } else if ( val->unit == Value::Function ) { // attr( X ) | counter( X [,Y] ) | counters( X, Y, [,Z] ) ValueList *args = val->function->args; - QString fname = qString( val->function->name ).lower(); + TQString fname = qString( val->function->name ).lower(); if (!args) return false; if (fname == "attr(") { if ( args->size() != 1) @@ -1693,7 +1693,7 @@ bool CSSParser::parseShape( int propId, bool important ) { Value *value = valueList->current(); ValueList *args = value->function->args; - QString fname = qString( value->function->name ).lower(); + TQString fname = qString( value->function->name ).lower(); //qDebug( "parseShape: fname: %d", fname.latin1() ); if ( fname != "rect(" || !args ) return false; @@ -1750,7 +1750,7 @@ bool CSSParser::parseFont( bool important ) // optional font-style, font-variant and font-weight while ( value ) { // kdDebug( 6080 ) << "got value " << value->id << " / " << (value->unit == CSSPrimitiveValue::CSS_STRING || - // value->unit == CSSPrimitiveValue::CSS_IDENT ? qString( value->string ) : QString::null ) + // value->unit == CSSPrimitiveValue::CSS_IDENT ? qString( value->string ) : TQString::null ) // << endl; int id = value->id; if ( id ) { @@ -1890,12 +1890,12 @@ CSSValueListImpl *CSSParser::parseFontFamily() // kdDebug( 6080 ) << "CSSParser::parseFontFamily current=" << valueList->currentValue << endl; CSSValueListImpl *list = new CSSValueListImpl; Value *value = valueList->current(); - QString currFace; + TQString currFace; while ( value ) { // kdDebug( 6080 ) << "got value " << value->id << " / " // << (value->unit == CSSPrimitiveValue::CSS_STRING || -// value->unit == CSSPrimitiveValue::CSS_IDENT ? qString( value->string ) : QString::null ) +// value->unit == CSSPrimitiveValue::CSS_IDENT ? qString( value->string ) : TQString::null ) // << endl; Value* nextValue = valueList->next(); bool nextValBreaksFont = !nextValue || @@ -1913,7 +1913,7 @@ CSSValueListImpl *CSSParser::parseFontFamily() else if (nextValBreaksFont || !nextValIsFontName) { if ( !currFace.isNull() ) { list->append( new FontFamilyValueImpl( currFace ) ); - currFace = QString::null; + currFace = TQString::null; } list->append(new CSSPrimitiveValueImpl(value->id)); } @@ -1923,7 +1923,7 @@ CSSValueListImpl *CSSParser::parseFontFamily() } else if (value->unit == CSSPrimitiveValue::CSS_STRING) { // Strings never share in a family name. - currFace = QString::null; + currFace = TQString::null; list->append(new FontFamilyValueImpl(qString( value->string) ) ); } else if (value->unit == CSSPrimitiveValue::CSS_IDENT) { @@ -1934,7 +1934,7 @@ CSSValueListImpl *CSSParser::parseFontFamily() else if (nextValBreaksFont || !nextValIsFontName) { if ( !currFace.isNull() ) { list->append( new FontFamilyValueImpl( currFace ) ); - currFace = QString::null; + currFace = TQString::null; } list->append(new FontFamilyValueImpl( qString( value->string ) ) ); } @@ -1954,7 +1954,7 @@ CSSValueListImpl *CSSParser::parseFontFamily() value = valueList->next(); if ( !currFace.isNull() ) list->append( new FontFamilyValueImpl( currFace ) ); - currFace = QString::null; + currFace = TQString::null; } else if (nextValIsFontName) value = nextValue; @@ -2037,7 +2037,7 @@ bool CSSParser::parseHSLParameters(Value* value, double* colorArray, bool parseA return true; } -static bool parseColor(int unit, const QString &name, QRgb& rgb) +static bool parseColor(int unit, const TQString &name, QRgb& rgb) { int len = name.length(); @@ -2067,7 +2067,7 @@ static bool parseColor(int unit, const QString &name, QRgb& rgb) if ( unit == CSSPrimitiveValue::CSS_IDENT ) { // try a little harder - QColor tc; + TQColor tc; tc.setNamedColor(name.lower()); if ( tc.isValid() ) { rgb = tc.rgb(); @@ -2088,7 +2088,7 @@ CSSPrimitiveValueImpl *CSSParser::parseColorFromValue(Value* value) QRgb c = khtml::transparentColor; if ( !strict && value->unit == CSSPrimitiveValue::CSS_NUMBER && value->fValue >= 0. && value->fValue < 1000000. ) { - QString str; + TQString str; str.sprintf( "%06d", (int)(value->fValue+.5) ); if ( !::parseColor( value->unit, str, c ) ) return 0; @@ -2357,7 +2357,7 @@ int DOM::CSSParser::lex( void *_yylval ) unsigned short *t = text( &length ); #ifdef TOKEN_DEBUG - qDebug("CSSTokenizer: got token %d: '%s'", token, token == END ? "" : QString( (QChar *)t, length ).latin1() ); + qDebug("CSSTokenizer: got token %d: '%s'", token, token == END ? "" : TQString( (TQChar *)t, length ).latin1() ); #endif switch( token ) { case '{': @@ -2426,8 +2426,8 @@ int DOM::CSSParser::lex( void *_yylval ) length--; case FLOAT: case INTEGER: - yylval->val = QString( (QChar *)t, length ).toDouble(); - //qDebug("value = %s, converted=%.2f", QString( (QChar *)t, length ).latin1(), yylval->val ); + yylval->val = TQString( (TQChar *)t, length ).toDouble(); + //qDebug("value = %s, converted=%.2f", TQString( (TQChar *)t, length ).latin1(), yylval->val ); break; default: @@ -2531,7 +2531,7 @@ unsigned short *DOM::CSSParser::text(int *length) uc += toHex( *escape ); escape++; } -// qDebug(" converting escape: string='%s', value=0x%x", QString( (QChar *)e, current-e ).latin1(), uc ); +// qDebug(" converting escape: string='%s', value=0x%x", TQString( (TQChar *)e, current-e ).latin1(), uc ); // can't handle chars outside ucs2 if ( uc > 0xffff ) uc = 0xfffd; @@ -2560,7 +2560,7 @@ unsigned short *DOM::CSSParser::text(int *length) uc += toHex( *escape ); escape++; } - // qDebug(" converting escape: string='%s', value=0x%x", QString( (QChar *)e, current-e ).latin1(), uc ); + // qDebug(" converting escape: string='%s', value=0x%x", TQString( (TQChar *)e, current-e ).latin1(), uc ); // can't handle chars outside ucs2 if ( uc > 0xffff ) uc = 0xfffd; @@ -2585,7 +2585,7 @@ typedef unsigned int YY_CHAR; *yy_cp = 0; \ yy_c_buf_p = yy_cp; #define YY_BREAK break; -#define ECHO qDebug( "%s", QString( (QChar *)yytext, yyleng ).latin1() ) +#define ECHO qDebug( "%s", TQString( (TQChar *)yytext, yyleng ).latin1() ) #define YY_RULE_SETUP #define INITIAL 0 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) diff --git a/khtml/css/cssparser.h b/khtml/css/cssparser.h index 1c055acd0..0e00ebc16 100644 --- a/khtml/css/cssparser.h +++ b/khtml/css/cssparser.h @@ -22,9 +22,9 @@ #ifndef _CSS_cssparser_h_ #define _CSS_cssparser_h_ -#include <qstring.h> -#include <qcolor.h> -#include <qvaluevector.h> +#include <tqstring.h> +#include <tqcolor.h> +#include <tqvaluevector.h> #include <dom/dom_string.h> namespace DOM { @@ -72,11 +72,11 @@ namespace DOM { int unit; }; - static inline QString qString( const ParseString &ps ) { - return QString( (QChar *)ps.string, ps.length ); + static inline TQString qString( const ParseString &ps ) { + return TQString( (TQChar *)ps.string, ps.length ); } static inline DOMString domString( const ParseString &ps ) { - return DOMString( (QChar *)ps.string, ps.length ); + return DOMString( (TQChar *)ps.string, ps.length ); } class ValueList { @@ -88,7 +88,7 @@ namespace DOM { Value* current() { return m_current < m_values.size() ? &m_values[m_current] : 0; } Value* next() { ++m_current; return current(); } private: - QValueVector<Value> m_values; + TQValueVector<Value> m_values; unsigned int m_current; }; @@ -148,7 +148,7 @@ namespace DOM { CSSPrimitiveValueImpl *parseColorFromValue(Value* val); CSSValueImpl* parseCounterContent(ValueList *args, bool counters); - static bool parseColor(const QString &name, QRgb& rgb); + static bool parseColor(const TQString &name, QRgb& rgb); // CSS3 Parsing Routines (for properties specific to CSS3) bool parseShadow(int propId, bool important); diff --git a/khtml/css/cssstyleselector.cpp b/khtml/css/cssstyleselector.cpp index 235a2cf20..8f6cc09a6 100644 --- a/khtml/css/cssstyleselector.cpp +++ b/khtml/css/cssstyleselector.cpp @@ -59,14 +59,14 @@ using namespace DOM; #include <kcharsets.h> #include <kglobal.h> #include <kconfig.h> -#include <qfile.h> -#include <qvaluelist.h> -#include <qstring.h> -#include <qtooltip.h> +#include <tqfile.h> +#include <tqvaluelist.h> +#include <tqstring.h> +#include <tqtooltip.h> #include <kdebug.h> #include <kurl.h> #include <assert.h> -#include <qpaintdevicemetrics.h> +#include <tqpaintdevicemetrics.h> #include <stdlib.h> #define HANDLE_INHERIT(prop, Prop) \ @@ -188,7 +188,7 @@ enum PseudoState { PseudoUnknown, PseudoNone, PseudoLink, PseudoVisited}; static PseudoState pseudoState; -CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, QString userStyleSheet, StyleSheetListImpl *styleSheets, +CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, TQString userStyleSheet, StyleSheetListImpl *styleSheets, const KURL &url, bool _strictParsing ) { KHTMLView* view = doc->view(); @@ -196,7 +196,7 @@ CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, QString userStyleSheet, S init(view ? view->part()->settings() : 0, doc); strictParsing = _strictParsing; - m_medium = view ? view->mediaType() : QString("all"); + m_medium = view ? view->mediaType() : TQString("all"); selectors = 0; selectorCache = 0; @@ -220,7 +220,7 @@ CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, QString userStyleSheet, S authorStyle = new CSSStyleSelectorList(); - QPtrListIterator<StyleSheetImpl> it( styleSheets->styleSheets ); + TQPtrListIterator<StyleSheetImpl> it( styleSheets->styleSheets ); for ( ; it.current(); ++it ) { if ( it.current()->isCSSStyleSheet() && !it.current()->disabled()) { authorStyle->append( static_cast<CSSStyleSheetImpl*>( it.current() ), m_medium ); @@ -234,8 +234,8 @@ CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, QString userStyleSheet, S KURL u = url; - u.setQuery( QString::null ); - u.setRef( QString::null ); + u.setQuery( TQString::null ); + u.setRef( TQString::null ); encodedurl.file = u.url(); int pos = encodedurl.file.findRev('/'); encodedurl.path = encodedurl.file; @@ -243,7 +243,7 @@ CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, QString userStyleSheet, S encodedurl.path.truncate( pos ); encodedurl.path += '/'; } - u.setPath( QString::null ); + u.setPath( TQString::null ); encodedurl.host = u.url(); //kdDebug() << "CSSStyleSelector::CSSStyleSelector encoded url " << encodedurl.path << endl; @@ -298,16 +298,16 @@ void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s, DocumentImpl *do if(s_defaultStyle) return; { - QFile f(locate( "data", "khtml/css/html4.css" ) ); + TQFile f(locate( "data", "khtml/css/html4.css" ) ); f.open(IO_ReadOnly); - QCString file( f.size()+1 ); + TQCString file( f.size()+1 ); int readbytes = f.readBlock( file.data(), f.size() ); f.close(); if ( readbytes >= 0 ) file[readbytes] = '\0'; - QString style = QString::fromLatin1( file.data() ); + TQString style = TQString::fromLatin1( file.data() ); if(s) style += s->settingsToCSS(); DOMString str(style); @@ -323,16 +323,16 @@ void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s, DocumentImpl *do s_defaultPrintStyle->append( s_defaultSheet, "print" ); } { - QFile f(locate( "data", "khtml/css/quirks.css" ) ); + TQFile f(locate( "data", "khtml/css/quirks.css" ) ); f.open(IO_ReadOnly); - QCString file( f.size()+1 ); + TQCString file( f.size()+1 ); int readbytes = f.readBlock( file.data(), f.size() ); f.close(); if ( readbytes >= 0 ) file[readbytes] = '\0'; - QString style = QString::fromLatin1( file.data() ); + TQString style = TQString::fromLatin1( file.data() ); DOMString str(style); s_quirksSheet = new DOM::CSSStyleSheetImpl(doc); @@ -371,13 +371,13 @@ void CSSStyleSelector::reparseConfiguration() #define MAXFONTSIZES 8 -void CSSStyleSelector::computeFontSizes(QPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor) +void CSSStyleSelector::computeFontSizes(TQPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor) { computeFontSizesFor(paintDeviceMetrics, zoomFactor, m_fontSizes, false); computeFontSizesFor(paintDeviceMetrics, zoomFactor, m_fixedFontSizes, true); } -void CSSStyleSelector::computeFontSizesFor(QPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor, QValueVector<int>& fontSizes, bool isFixed) +void CSSStyleSelector::computeFontSizesFor(TQPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor, TQValueVector<int>& fontSizes, bool isFixed) { #ifdef APPLE_CHANGES // We don't want to scale the settings by the dpi. @@ -743,8 +743,8 @@ unsigned int CSSStyleSelector::addInlineDeclarations(DOM::ElementImpl* e, if (!decl && !addDecls) return numProps; - QPtrList<CSSProperty>* values = decl ? decl->values() : 0; - QPtrList<CSSProperty>* addValues = addDecls ? addDecls->values() : 0; + TQPtrList<CSSProperty>* values = decl ? decl->values() : 0; + TQPtrList<CSSProperty>* addValues = addDecls ? addDecls->values() : 0; if (!values && !addValues) return numProps; @@ -805,7 +805,7 @@ unsigned int CSSStyleSelector::addInlineDeclarations(DOM::ElementImpl* e, } // modified version of the one in kurl.cpp -static void cleanpath(QString &path) +static void cleanpath(TQString &path) { int pos; while ( (pos = path.find( "/../" )) != -1 ) { @@ -851,8 +851,8 @@ static PseudoState checkPseudoState( const CSSStyleSelector::Encodedurl& encoded if( attr.isNull() ) { return PseudoNone; } - QConstString cu(attr.unicode(), attr.length()); - QString u = cu.string(); + TQConstString cu(attr.unicode(), attr.length()); + TQString u = cu.string(); if ( !u.contains("://") ) { if ( u[0] == '/' ) u = encodedurl.host + u; @@ -870,7 +870,7 @@ static PseudoState checkPseudoState( const CSSStyleSelector::Encodedurl& encoded } // a helper function for parsing nth-arguments -static bool matchNth(int count, const QString& nth) +static bool matchNth(int count, const TQString& nth) { if (nth.isEmpty()) return false; int a = 0; @@ -1145,11 +1145,11 @@ bool CSSStyleSelector::checkSimpleSelector(DOM::CSSSelector *sel, DOM::ElementIm // else the value is longer and can be a list if ( sel->match == CSSSelector::Class && !e->hasClassList() ) return false; - QChar* sel_uc = sel->value.unicode(); - QChar* val_uc = value->unicode(); + TQChar* sel_uc = sel->value.unicode(); + TQChar* val_uc = value->unicode(); - QConstString sel_str(sel_uc, sel_len); - QConstString val_str(val_uc, val_len); + TQConstString sel_str(sel_uc, sel_len); + TQConstString val_str(val_uc, val_len); int pos = 0; for ( ;; ) { @@ -1167,31 +1167,31 @@ bool CSSStyleSelector::checkSimpleSelector(DOM::CSSSelector *sel, DOM::ElementIm case CSSSelector::Contain: { //kdDebug( 6080 ) << "checking for contains match" << endl; - QConstString val_str(value->unicode(), value->length()); - QConstString sel_str(sel->value.unicode(), sel->value.length()); + TQConstString val_str(value->unicode(), value->length()); + TQConstString sel_str(sel->value.unicode(), sel->value.length()); return val_str.string().contains(sel_str.string(), caseSensitive); } case CSSSelector::Begin: { //kdDebug( 6080 ) << "checking for beginswith match" << endl; - QConstString val_str(value->unicode(), value->length()); - QConstString sel_str(sel->value.unicode(), sel->value.length()); + TQConstString val_str(value->unicode(), value->length()); + TQConstString sel_str(sel->value.unicode(), sel->value.length()); return val_str.string().startsWith(sel_str.string(), caseSensitive); } case CSSSelector::End: { //kdDebug( 6080 ) << "checking for endswith match" << endl; - QConstString val_str(value->unicode(), value->length()); - QConstString sel_str(sel->value.unicode(), sel->value.length()); + TQConstString val_str(value->unicode(), value->length()); + TQConstString sel_str(sel->value.unicode(), sel->value.length()); return val_str.string().endsWith(sel_str.string(), caseSensitive); } case CSSSelector::Hyphen: { //kdDebug( 6080 ) << "checking for hyphen match" << endl; - QConstString val_str(value->unicode(), value->length()); - QConstString sel_str(sel->value.unicode(), sel->value.length()); - const QString& str = val_str.string(); - const QString& selStr = sel_str.string(); + TQConstString val_str(value->unicode(), value->length()); + TQConstString sel_str(sel->value.unicode(), sel->value.length()); + const TQString& str = val_str.string(); + const TQString& selStr = sel_str.string(); if(str.length() < selStr.length()) return false; // Check if str begins with selStr: if(str.find(selStr, 0, caseSensitive) != 0) return false; @@ -1486,8 +1486,8 @@ bool CSSStyleSelector::checkSimpleSelector(DOM::CSSSelector *sel, DOM::ElementIm } if (value.isEmpty()) return false; - QString langAttr = value.string(); - QString langSel = sel->string_arg.string(); + TQString langAttr = value.string(); + TQString langSel = sel->string_arg.string(); if(langAttr.length() < langSel.length()) return false; @@ -1536,7 +1536,7 @@ bool CSSStyleSelector::checkSimpleSelector(DOM::CSSSelector *sel, DOM::ElementIm HTMLElementImpl *elem; elem = static_cast<HTMLElementImpl*>(e); DOMString s = elem->innerText(); - QString selStr = sel->string_arg.string(); + TQString selStr = sel->string_arg.string(); // kdDebug(6080) << ":contains(\"" << selStr << "\")" << " on \"" << s << "\"" << endl; return s.string().contains(selStr); } @@ -1642,7 +1642,7 @@ void CSSStyleSelector::buildLists() clearLists(); // collect all selectors and Properties in lists. Then transfer them to the array for faster lookup. - QPtrList<CSSSelector> selectorList; + TQPtrList<CSSSelector> selectorList; CSSOrderedPropertyList propertyList; if(m_medium == "print" && defaultPrintStyle) @@ -1733,7 +1733,7 @@ CSSOrderedRule::~CSSOrderedRule() // ----------------------------------------------------------------- CSSStyleSelectorList::CSSStyleSelectorList() - : QPtrList<CSSOrderedRule>() + : TQPtrList<CSSOrderedRule>() { setAutoDelete(true); } @@ -1759,11 +1759,11 @@ void CSSStyleSelectorList::append( CSSStyleSheetImpl *sheet, if(item->isStyleRule()) { CSSStyleRuleImpl *r = static_cast<CSSStyleRuleImpl *>(item); - QPtrList<CSSSelector> *s = r->selector(); + TQPtrList<CSSSelector> *s = r->selector(); for(int j = 0; j < (int)s->count(); j++) { CSSOrderedRule *rule = new CSSOrderedRule(r, s->at(j), count()); - QPtrList<CSSOrderedRule>::append(rule); + TQPtrList<CSSOrderedRule>::append(rule); //kdDebug( 6080 ) << "appending StyleRule!" << endl; } } @@ -1805,12 +1805,12 @@ void CSSStyleSelectorList::append( CSSStyleSheetImpl *sheet, CSSStyleRuleImpl *styleRule = static_cast<CSSStyleRuleImpl *>( childItem ); - QPtrList<CSSSelector> *s = styleRule->selector(); + TQPtrList<CSSSelector> *s = styleRule->selector(); for( int j = 0; j < ( int ) s->count(); j++ ) { CSSOrderedRule *orderedRule = new CSSOrderedRule( styleRule, s->at( j ), count() ); - QPtrList<CSSOrderedRule>::append( orderedRule ); + TQPtrList<CSSOrderedRule>::append( orderedRule ); } } else @@ -1831,7 +1831,7 @@ void CSSStyleSelectorList::append( CSSStyleSheetImpl *sheet, } -void CSSStyleSelectorList::collect( QPtrList<CSSSelector> *selectorList, CSSOrderedPropertyList *propList, +void CSSStyleSelectorList::collect( TQPtrList<CSSSelector> *selectorList, CSSOrderedPropertyList *propList, Source regular, Source important ) { CSSOrderedRule *r = first(); @@ -1855,7 +1855,7 @@ void CSSStyleSelectorList::collect( QPtrList<CSSSelector> *selectorList, CSSOrde // ------------------------------------------------------------------------- -int CSSOrderedPropertyList::compareItems(QPtrCollection::Item i1, QPtrCollection::Item i2) +int CSSOrderedPropertyList::compareItems(TQPtrCollection::Item i1, TQPtrCollection::Item i2) { int diff = static_cast<CSSOrderedProperty *>(i1)->priority - static_cast<CSSOrderedProperty *>(i2)->priority; @@ -1866,7 +1866,7 @@ int CSSOrderedPropertyList::compareItems(QPtrCollection::Item i1, QPtrCollection void CSSOrderedPropertyList::append(DOM::CSSStyleDeclarationImpl *decl, uint selector, uint specificity, Source regular, Source important ) { - QPtrList<CSSProperty> *values = decl->values(); + TQPtrList<CSSProperty> *values = decl->values(); if(!values) return; int len = values->count(); for(int i = 0; i < len; i++) @@ -1898,7 +1898,7 @@ void CSSOrderedPropertyList::append(DOM::CSSStyleDeclarationImpl *decl, uint sel break; } - QPtrList<CSSOrderedProperty>::append(new CSSOrderedProperty(prop, selector, + TQPtrList<CSSOrderedProperty>::append(new CSSOrderedProperty(prop, selector, first, source, specificity, count() )); } @@ -1907,7 +1907,7 @@ void CSSOrderedPropertyList::append(DOM::CSSStyleDeclarationImpl *decl, uint sel // ------------------------------------------------------------------------------------- // this is mostly boring stuff on how to apply a certain rule to the renderstyle... -static Length convertToLength( CSSPrimitiveValueImpl *primitiveValue, RenderStyle *style, QPaintDeviceMetrics *paintDeviceMetrics, bool *ok = 0 ) +static Length convertToLength( CSSPrimitiveValueImpl *primitiveValue, RenderStyle *style, TQPaintDeviceMetrics *paintDeviceMetrics, bool *ok = 0 ) { Length l; if ( !primitiveValue ) { @@ -1966,8 +1966,8 @@ struct uiColors { int css_value; const char * configGroup; const char * configEntry; -QPalette::ColorGroup group; -QColorGroup::ColorRole role; +TQPalette::ColorGroup group; +TQColorGroup::ColorRole role; }; const char * const wmgroup = "WM"; @@ -1978,66 +1978,66 @@ const char * const generalgroup = "General"; */ static const uiColors uimap[] = { // Active window border. - { CSS_VAL_ACTIVEBORDER, wmgroup, "background", QPalette::Active, QColorGroup::Light }, + { CSS_VAL_ACTIVEBORDER, wmgroup, "background", TQPalette::Active, TQColorGroup::Light }, // Active window caption. - { CSS_VAL_ACTIVECAPTION, wmgroup, "background", QPalette::Active, QColorGroup::Text }, + { CSS_VAL_ACTIVECAPTION, wmgroup, "background", TQPalette::Active, TQColorGroup::Text }, // Text in caption, size box, and scrollbar arrow box. - { CSS_VAL_CAPTIONTEXT, wmgroup, "activeForeground", QPalette::Active, QColorGroup::Text }, + { CSS_VAL_CAPTIONTEXT, wmgroup, "activeForeground", TQPalette::Active, TQColorGroup::Text }, // Face color for three-dimensional display elements. - { CSS_VAL_BUTTONFACE, wmgroup, 0, QPalette::Inactive, QColorGroup::Button }, + { CSS_VAL_BUTTONFACE, wmgroup, 0, TQPalette::Inactive, TQColorGroup::Button }, // Dark shadow for three-dimensional display elements (for edges facing away from the light source). - { CSS_VAL_BUTTONHIGHLIGHT, wmgroup, 0, QPalette::Inactive, QColorGroup::Light }, + { CSS_VAL_BUTTONHIGHLIGHT, wmgroup, 0, TQPalette::Inactive, TQColorGroup::Light }, // Shadow color for three-dimensional display elements. - { CSS_VAL_BUTTONSHADOW, wmgroup, 0, QPalette::Inactive, QColorGroup::Shadow }, + { CSS_VAL_BUTTONSHADOW, wmgroup, 0, TQPalette::Inactive, TQColorGroup::Shadow }, // Text on push buttons. - { CSS_VAL_BUTTONTEXT, wmgroup, "buttonForeground", QPalette::Inactive, QColorGroup::ButtonText }, + { CSS_VAL_BUTTONTEXT, wmgroup, "buttonForeground", TQPalette::Inactive, TQColorGroup::ButtonText }, // Dark shadow for three-dimensional display elements. - { CSS_VAL_THREEDDARKSHADOW, wmgroup, 0, QPalette::Inactive, QColorGroup::Dark }, + { CSS_VAL_THREEDDARKSHADOW, wmgroup, 0, TQPalette::Inactive, TQColorGroup::Dark }, // Face color for three-dimensional display elements. - { CSS_VAL_THREEDFACE, wmgroup, 0, QPalette::Inactive, QColorGroup::Button }, + { CSS_VAL_THREEDFACE, wmgroup, 0, TQPalette::Inactive, TQColorGroup::Button }, // Highlight color for three-dimensional display elements. - { CSS_VAL_THREEDHIGHLIGHT, wmgroup, 0, QPalette::Inactive, QColorGroup::Light }, + { CSS_VAL_THREEDHIGHLIGHT, wmgroup, 0, TQPalette::Inactive, TQColorGroup::Light }, // Light color for three-dimensional display elements (for edges facing the light source). - { CSS_VAL_THREEDLIGHTSHADOW, wmgroup, 0, QPalette::Inactive, QColorGroup::Midlight }, + { CSS_VAL_THREEDLIGHTSHADOW, wmgroup, 0, TQPalette::Inactive, TQColorGroup::Midlight }, // Dark shadow for three-dimensional display elements. - { CSS_VAL_THREEDSHADOW, wmgroup, 0, QPalette::Inactive, QColorGroup::Shadow }, + { CSS_VAL_THREEDSHADOW, wmgroup, 0, TQPalette::Inactive, TQColorGroup::Shadow }, // Inactive window border. - { CSS_VAL_INACTIVEBORDER, wmgroup, "background", QPalette::Disabled, QColorGroup::Background }, + { CSS_VAL_INACTIVEBORDER, wmgroup, "background", TQPalette::Disabled, TQColorGroup::Background }, // Inactive window caption. - { CSS_VAL_INACTIVECAPTION, wmgroup, "inactiveBackground", QPalette::Disabled, QColorGroup::Background }, + { CSS_VAL_INACTIVECAPTION, wmgroup, "inactiveBackground", TQPalette::Disabled, TQColorGroup::Background }, // Color of text in an inactive caption. - { CSS_VAL_INACTIVECAPTIONTEXT, wmgroup, "inactiveForeground", QPalette::Disabled, QColorGroup::Text }, - { CSS_VAL_GRAYTEXT, wmgroup, 0, QPalette::Disabled, QColorGroup::Text }, + { CSS_VAL_INACTIVECAPTIONTEXT, wmgroup, "inactiveForeground", TQPalette::Disabled, TQColorGroup::Text }, + { CSS_VAL_GRAYTEXT, wmgroup, 0, TQPalette::Disabled, TQColorGroup::Text }, // Menu background - { CSS_VAL_MENU, generalgroup, "background", QPalette::Inactive, QColorGroup::Background }, + { CSS_VAL_MENU, generalgroup, "background", TQPalette::Inactive, TQColorGroup::Background }, // Text in menus - { CSS_VAL_MENUTEXT, generalgroup, "foreground", QPalette::Inactive, QColorGroup::Background }, + { CSS_VAL_MENUTEXT, generalgroup, "foreground", TQPalette::Inactive, TQColorGroup::Background }, // Text of item(s) selected in a control. - { CSS_VAL_HIGHLIGHT, generalgroup, "selectBackground", QPalette::Inactive, QColorGroup::Background }, + { CSS_VAL_HIGHLIGHT, generalgroup, "selectBackground", TQPalette::Inactive, TQColorGroup::Background }, // Text of item(s) selected in a control. - { CSS_VAL_HIGHLIGHTTEXT, generalgroup, "selectForeground", QPalette::Inactive, QColorGroup::Background }, + { CSS_VAL_HIGHLIGHTTEXT, generalgroup, "selectForeground", TQPalette::Inactive, TQColorGroup::Background }, // Background color of multiple document interface. - { CSS_VAL_APPWORKSPACE, generalgroup, "background", QPalette::Inactive, QColorGroup::Text }, + { CSS_VAL_APPWORKSPACE, generalgroup, "background", TQPalette::Inactive, TQColorGroup::Text }, // Scroll bar gray area. - { CSS_VAL_SCROLLBAR, generalgroup, "background", QPalette::Inactive, QColorGroup::Background }, + { CSS_VAL_SCROLLBAR, generalgroup, "background", TQPalette::Inactive, TQColorGroup::Background }, // Window background. - { CSS_VAL_WINDOW, generalgroup, "windowBackground", QPalette::Inactive, QColorGroup::Background }, + { CSS_VAL_WINDOW, generalgroup, "windowBackground", TQPalette::Inactive, TQColorGroup::Background }, // Window frame. - { CSS_VAL_WINDOWFRAME, generalgroup, "windowBackground", QPalette::Inactive, QColorGroup::Background }, + { CSS_VAL_WINDOWFRAME, generalgroup, "windowBackground", TQPalette::Inactive, TQColorGroup::Background }, // WindowText - { CSS_VAL_WINDOWTEXT, generalgroup, "windowForeground", QPalette::Inactive, QColorGroup::Text }, - { CSS_VAL_TEXT, generalgroup, 0, QPalette::Inactive, QColorGroup::Text }, - { 0, 0, 0, QPalette::NColorGroups, QColorGroup::NColorRoles } + { CSS_VAL_WINDOWTEXT, generalgroup, "windowForeground", TQPalette::Inactive, TQColorGroup::Text }, + { CSS_VAL_TEXT, generalgroup, 0, TQPalette::Inactive, TQColorGroup::Text }, + { 0, 0, 0, TQPalette::NColorGroups, TQColorGroup::NColorRoles } }; -static QColor colorForCSSValue( int css_value ) +static TQColor colorForCSSValue( int css_value ) { // try the regular ones first const colorMap *col = cmap; @@ -2052,21 +2052,21 @@ static QColor colorForCSSValue( int css_value ) #ifndef APPLE_CHANGES if ( !uicol->css_value ) { if ( css_value == CSS_VAL_INFOBACKGROUND ) - return QToolTip::palette().inactive().background(); + return TQToolTip::palette().inactive().background(); else if ( css_value == CSS_VAL_INFOTEXT ) - return QToolTip::palette().inactive().foreground(); + return TQToolTip::palette().inactive().foreground(); else if ( css_value == CSS_VAL_BACKGROUND ) { KConfig bckgrConfig("kdesktoprc", true, false); // No multi-screen support bckgrConfig.setGroup("Desktop0"); // Desktop background. return bckgrConfig.readColorEntry("Color1", &qApp->palette().disabled().background()); } - return QColor(); + return TQColor(); } #endif - const QPalette &pal = qApp->palette(); - QColor c = pal.color( uicol->group, uicol->role ); + const TQPalette &pal = qApp->palette(); + TQColor c = pal.color( uicol->group, uicol->role ); #ifndef APPLE_CHANGES if ( uicol->configEntry ) { KConfig *globalConfig = KGlobal::config(); @@ -2078,7 +2078,7 @@ static QColor colorForCSSValue( int css_value ) return c; } -static inline int nextFontSize(const QValueVector<int>& a, int v, bool smaller) +static inline int nextFontSize(const TQValueVector<int>& a, int v, bool smaller) { // return the nearest bigger/smaller value in scale a, when v is in range. // otherwise increase/decrease value using a 1.2 fixed ratio @@ -2334,7 +2334,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) if (isInherit) fontDef.weight = parentStyle->htmlFont().fontDef.weight; else if (isInitial) - fontDef.weight = QFont::Normal; + fontDef.weight = TQFont::Normal; else { if(!primitiveValue) return; if(primitiveValue->getIdent()) @@ -2348,7 +2348,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) case CSS_VAL_700: case CSS_VAL_800: case CSS_VAL_900: - fontDef.weight = QFont::Bold; + fontDef.weight = TQFont::Bold; break; case CSS_VAL_NORMAL: case CSS_VAL_LIGHTER: @@ -2357,7 +2357,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) case CSS_VAL_300: case CSS_VAL_400: case CSS_VAL_500: - fontDef.weight = QFont::Normal; + fontDef.weight = TQFont::Normal; break; default: return; @@ -2718,7 +2718,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) case CSS_PROP_SCROLLBAR_TRACK_COLOR: case CSS_PROP_SCROLLBAR_ARROW_COLOR: { - QColor col; + TQColor col; if (isInherit) { HANDLE_INHERIT_COND(CSS_PROP_BACKGROUND_COLOR, backgroundColor, BackgroundColor) HANDLE_INHERIT_COND(CSS_PROP_BORDER_TOP_COLOR, borderTopColor, BorderTopColor) @@ -2747,7 +2747,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) && id != CSS_PROP_BORDER_RIGHT_COLOR && id != CSS_PROP_BORDER_BOTTOM_COLOR && id != CSS_PROP_BORDER_LEFT_COLOR ) - col = QColor(); + col = TQColor(); else col = colorForCSSValue( ident ); } else if ( primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_RGBCOLOR ) { @@ -2778,36 +2778,36 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) style->setOutlineColor(col); break; #ifndef APPLE_CHANGES case CSS_PROP_SCROLLBAR_FACE_COLOR: - style->setPaletteColor(QPalette::Active, QColorGroup::Button, col); - style->setPaletteColor(QPalette::Inactive, QColorGroup::Button, col); + style->setPaletteColor(TQPalette::Active, TQColorGroup::Button, col); + style->setPaletteColor(TQPalette::Inactive, TQColorGroup::Button, col); break; case CSS_PROP_SCROLLBAR_SHADOW_COLOR: - style->setPaletteColor(QPalette::Active, QColorGroup::Shadow, col); - style->setPaletteColor(QPalette::Inactive, QColorGroup::Shadow, col); + style->setPaletteColor(TQPalette::Active, TQColorGroup::Shadow, col); + style->setPaletteColor(TQPalette::Inactive, TQColorGroup::Shadow, col); break; case CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR: - style->setPaletteColor(QPalette::Active, QColorGroup::Light, col); - style->setPaletteColor(QPalette::Inactive, QColorGroup::Light, col); + style->setPaletteColor(TQPalette::Active, TQColorGroup::Light, col); + style->setPaletteColor(TQPalette::Inactive, TQColorGroup::Light, col); break; case CSS_PROP_SCROLLBAR_3DLIGHT_COLOR: break; case CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR: - style->setPaletteColor(QPalette::Active, QColorGroup::Dark, col); - style->setPaletteColor(QPalette::Inactive, QColorGroup::Dark, col); + style->setPaletteColor(TQPalette::Active, TQColorGroup::Dark, col); + style->setPaletteColor(TQPalette::Inactive, TQColorGroup::Dark, col); break; case CSS_PROP_SCROLLBAR_TRACK_COLOR: - style->setPaletteColor(QPalette::Active, QColorGroup::Mid, col); - style->setPaletteColor(QPalette::Inactive, QColorGroup::Mid, col); - style->setPaletteColor(QPalette::Active, QColorGroup::Background, col); - style->setPaletteColor(QPalette::Inactive, QColorGroup::Background, col); + style->setPaletteColor(TQPalette::Active, TQColorGroup::Mid, col); + style->setPaletteColor(TQPalette::Inactive, TQColorGroup::Mid, col); + style->setPaletteColor(TQPalette::Active, TQColorGroup::Background, col); + style->setPaletteColor(TQPalette::Inactive, TQColorGroup::Background, col); // fall through case CSS_PROP_SCROLLBAR_BASE_COLOR: - style->setPaletteColor(QPalette::Active, QColorGroup::Base, col); - style->setPaletteColor(QPalette::Inactive, QColorGroup::Base, col); + style->setPaletteColor(TQPalette::Active, TQColorGroup::Base, col); + style->setPaletteColor(TQPalette::Inactive, TQColorGroup::Base, col); break; case CSS_PROP_SCROLLBAR_ARROW_COLOR: - style->setPaletteColor(QPalette::Active, QColorGroup::ButtonText, col); - style->setPaletteColor(QPalette::Inactive, QColorGroup::ButtonText, col); + style->setPaletteColor(TQPalette::Active, TQColorGroup::ButtonText, col); + style->setPaletteColor(TQPalette::Inactive, TQColorGroup::ButtonText, col); break; #endif default: @@ -3176,10 +3176,10 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) // keywords are being used. Pick the correct default // based off the font family. #ifdef APPLE_CHANGES - const QValueVector<int>& fontSizes = (fontDef.genericFamily == FontDef::eMonospace) ? + const TQValueVector<int>& fontSizes = (fontDef.genericFamily == FontDef::eMonospace) ? m_fixedFontSizes : m_fontSizes; #else - const QValueVector<int>& fontSizes = m_fontSizes; + const TQValueVector<int>& fontSizes = m_fontSizes; #endif switch(primitiveValue->getIdent()) { @@ -3464,7 +3464,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) #ifdef APPLE_CHANGES fontDef.family = initialDef.firstFamily(); #else - fontDef.family = QString::null; + fontDef.family = TQString::null; #endif if (style->setFontDef(fontDef)) fontDirty = true; @@ -3478,7 +3478,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) CSSValueImpl *item = list->item(i); if(!item->isPrimitiveValue()) continue; CSSPrimitiveValueImpl *val = static_cast<CSSPrimitiveValueImpl *>(item); - QString face; + TQString face; if( val->primitiveType() == CSSPrimitiveValue::CSS_STRING ) face = static_cast<FontFamilyValueImpl *>(val)->fontName(); else if ( val->primitiveType() == CSSPrimitiveValue::CSS_IDENT ) { @@ -3614,10 +3614,10 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) style->setBorderRightColor(parentStyle->borderRightColor()); } else if (isInitial) { - style->setBorderTopColor(QColor()); // Reset to invalid color so currentColor is used instead. - style->setBorderBottomColor(QColor()); - style->setBorderLeftColor(QColor()); - style->setBorderRightColor(QColor()); + style->setBorderTopColor(TQColor()); // Reset to invalid color so currentColor is used instead. + style->setBorderBottomColor(TQColor()); + style->setBorderLeftColor(TQColor()); + style->setBorderRightColor(TQColor()); } } if (id == CSS_PROP_BORDER || id == CSS_PROP_BORDER_STYLE) @@ -3801,7 +3801,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value ) int x = item->x->computeLength(style, paintDeviceMetrics); int y = item->y->computeLength(style, paintDeviceMetrics); int blur = item->blur ? item->blur->computeLength(style, paintDeviceMetrics) : 0; - QColor col = khtml::transparentColor; + TQColor col = khtml::transparentColor; if (item->color) { int ident = item->color->getIdent(); if (ident) diff --git a/khtml/css/cssstyleselector.h b/khtml/css/cssstyleselector.h index 235eb72a6..23d854bc0 100644 --- a/khtml/css/cssstyleselector.h +++ b/khtml/css/cssstyleselector.h @@ -23,8 +23,8 @@ #ifndef _CSS_cssstyleselector_h_ #define _CSS_cssstyleselector_h_ -#include <qptrlist.h> -#include <qvaluevector.h> +#include <tqptrlist.h> +#include <tqvaluevector.h> #include "rendering/render_style.h" #include "dom/dom_string.h" @@ -114,7 +114,7 @@ namespace khtml * Also takes into account special cases for HTML documents, * including the defaultStyle (which is html only) */ - CSSStyleSelector( DOM::DocumentImpl* doc, QString userStyleSheet, DOM::StyleSheetListImpl *styleSheets, const KURL &url, + CSSStyleSelector( DOM::DocumentImpl* doc, TQString userStyleSheet, DOM::StyleSheetListImpl *styleSheets, const KURL &url, bool _strictParsing ); /** * same as above but for a single stylesheet. @@ -131,18 +131,18 @@ namespace khtml RenderStyle *styleForElement(DOM::ElementImpl *e); - QValueVector<int> fontSizes() const { return m_fontSizes; } - QValueVector<int> fixedFontSizes() const { return m_fixedFontSizes; } + TQValueVector<int> fontSizes() const { return m_fontSizes; } + TQValueVector<int> fixedFontSizes() const { return m_fixedFontSizes; } bool strictParsing; struct Encodedurl { - QString host; //also contains protocol - QString path; - QString file; + TQString host; //also contains protocol + TQString path; + TQString file; } encodedurl; - void computeFontSizes(QPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor); - void computeFontSizesFor(QPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor, QValueVector<int>& fontSizes, bool isFixed); + void computeFontSizes(TQPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor); + void computeFontSizesFor(TQPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor, TQValueVector<int>& fontSizes, bool isFixed); static void precomputeAttributeDependencies(DOM::DocumentImpl* doc, DOM::CSSSelector* sel); protected: @@ -232,8 +232,8 @@ public: SelectorCache *selectorCache; unsigned int properties_size; CSSOrderedProperty **properties; - QMemArray<CSSOrderedProperty> inlineProps; - QString m_medium; + TQMemArray<CSSOrderedProperty> inlineProps; + TQString m_medium; CSSOrderedProperty **propsToApply; CSSOrderedProperty **pseudoProps; unsigned int propsToApplySize; @@ -249,9 +249,9 @@ public: KHTMLView *view; KHTMLPart *part; const KHTMLSettings *settings; - QPaintDeviceMetrics *paintDeviceMetrics; - QValueVector<int> m_fontSizes; - QValueVector<int> m_fixedFontSizes; + TQPaintDeviceMetrics *paintDeviceMetrics; + TQValueVector<int> m_fontSizes; + TQValueVector<int> m_fixedFontSizes; bool fontDirty; @@ -297,10 +297,10 @@ public: * This is the list we will collect all properties we need to apply in. * It will get sorted once before applying. */ - class CSSOrderedPropertyList : public QPtrList<CSSOrderedProperty> + class CSSOrderedPropertyList : public TQPtrList<CSSOrderedProperty> { public: - virtual int compareItems(QPtrCollection::Item i1, QPtrCollection::Item i2); + virtual int compareItems(TQPtrCollection::Item i1, TQPtrCollection::Item i2); void append(DOM::CSSStyleDeclarationImpl *decl, uint selector, uint specificity, Source regular, Source important ); }; @@ -316,7 +316,7 @@ public: int index; }; - class CSSStyleSelectorList : public QPtrList<CSSOrderedRule> + class CSSStyleSelectorList : public TQPtrList<CSSOrderedRule> { public: CSSStyleSelectorList(); @@ -325,7 +325,7 @@ public: void append( DOM::CSSStyleSheetImpl *sheet, const DOM::DOMString &medium = "screen" ); - void collect( QPtrList<DOM::CSSSelector> *selectorList, CSSOrderedPropertyList *propList, + void collect( TQPtrList<DOM::CSSSelector> *selectorList, CSSOrderedPropertyList *propList, Source regular, Source important ); }; diff --git a/khtml/css/parser.cpp b/khtml/css/parser.cpp index 57275190c..c0e6f5869 100644 --- a/khtml/css/parser.cpp +++ b/khtml/css/parser.cpp @@ -264,7 +264,7 @@ static inline int getValueID(const char *tagStr, int len) typedef union YYSTYPE { CSSRuleImpl *rule; CSSSelector *selector; - QPtrList<CSSSelector> *selectorList; + TQPtrList<CSSSelector> *selectorList; bool ok; MediaListImpl *mediaList; CSSMediaRuleImpl *mediaRule; @@ -1862,7 +1862,7 @@ yyreduce: { if ( yyvsp[0].selector ) { - yyval.selectorList = new QPtrList<CSSSelector>; + yyval.selectorList = new TQPtrList<CSSSelector>; yyval.selectorList->setAutoDelete( true ); #ifdef CSS_DEBUG kdDebug( 6080 ) << " got simple selector:" << endl; @@ -2019,7 +2019,7 @@ yyreduce: { CSSParser *p = static_cast<CSSParser *>(parser); DOM::DocumentImpl *doc = p->document(); - QString tag = qString(yyvsp[0].string); + TQString tag = qString(yyvsp[0].string); if ( doc ) { if (doc->isHTMLDocument()) tag = tag.lower(); @@ -2097,7 +2097,7 @@ yyreduce: CSSParser *p = static_cast<CSSParser *>(parser); DOM::DocumentImpl *doc = p->document(); - QString attr = qString(yyvsp[-1].string); + TQString attr = qString(yyvsp[-1].string); if ( doc ) { if (doc->isHTMLDocument()) attr = attr.lower(); @@ -2235,7 +2235,7 @@ yyreduce: { yyval.selector = new CSSSelector(); yyval.selector->match = CSSSelector::PseudoClass; - yyval.selector->string_arg = QString::number(yyvsp[-1].val); + yyval.selector->string_arg = TQString::number(yyvsp[-1].val); yyval.selector->value = domString(yyvsp[-2].string); ;} break; @@ -2373,7 +2373,7 @@ yyreduce: case 117: { - QString str = qString(yyvsp[-1].string); + TQString str = qString(yyvsp[-1].string); yyval.prop_id = getPropertyID( str.lower().latin1(), str.length() ); ;} break; @@ -2457,7 +2457,7 @@ yyreduce: case 129: { - QString str = qString( yyvsp[-1].string ); + TQString str = qString( yyvsp[-1].string ); yyval.value.id = getValueID( str.lower().latin1(), str.length() ); yyval.value.unit = CSSPrimitiveValue::CSS_IDENT; yyval.value.string = yyvsp[-1].string; diff --git a/khtml/css/parser.h b/khtml/css/parser.h index 497e3017f..e3375db66 100644 --- a/khtml/css/parser.h +++ b/khtml/css/parser.h @@ -133,7 +133,7 @@ typedef union YYSTYPE { CSSRuleImpl *rule; CSSSelector *selector; - QPtrList<CSSSelector> *selectorList; + TQPtrList<CSSSelector> *selectorList; bool ok; MediaListImpl *mediaList; CSSMediaRuleImpl *mediaRule; diff --git a/khtml/dom/css_value.cpp b/khtml/dom/css_value.cpp index 5a678768c..de450e861 100644 --- a/khtml/dom/css_value.cpp +++ b/khtml/dom/css_value.cpp @@ -125,7 +125,7 @@ void CSSStyleDeclaration::setProperty( const DOMString &propName, const DOMStrin int id = getPropertyID(propName.string().lower().ascii(), propName.length()); if (!id) return; bool important = false; - QString str = priority.string(); + TQString str = priority.string(); if (str.find("important", 0, false) != -1) important = true; diff --git a/khtml/dom/css_value.h b/khtml/dom/css_value.h index be8239d7e..5d4a043c7 100644 --- a/khtml/dom/css_value.h +++ b/khtml/dom/css_value.h @@ -29,7 +29,7 @@ #include <dom/dom_string.h> -#include <qcolor.h> +#include <tqcolor.h> #include <kdemacros.h> @@ -595,7 +595,7 @@ public: /** * @deprecated */ - RGBColor(const QColor& c) { m_color = c.rgb(); } + RGBColor(const TQColor& c) { m_color = c.rgb(); } RGBColor(QRgb color); RGBColor(const RGBColor &other); diff --git a/khtml/dom/dom2_events.cpp b/khtml/dom/dom2_events.cpp index 9da1d8a73..898a73bc3 100644 --- a/khtml/dom/dom2_events.cpp +++ b/khtml/dom/dom2_events.cpp @@ -542,9 +542,9 @@ void TextEvent::initTextEvent(const DOMString &typeArg, if (impl->isTextInputEvent()) { //Initialize based on the outputStringArg or virtKeyValArg. - QString text = outputStringArg.string(); + TQString text = outputStringArg.string(); if (outputStringArg.length() == 0 && virtKeyValArg) { - text += QChar((unsigned short)virtKeyValArg); + text += TQChar((unsigned short)virtKeyValArg); } TextEventImpl* tImpl = static_cast<TextEventImpl*>(impl); @@ -575,7 +575,7 @@ DOMString TextEvent::outputString() const return static_cast<TextEventImpl*>(ke)->data(); else { if (ke->keyVal()) - return QString(QChar((ushort)ke->keyVal())); + return TQString(TQChar((ushort)ke->keyVal())); else return DOMString(); } diff --git a/khtml/dom/dom_doc.cpp b/khtml/dom/dom_doc.cpp index e5ff84e3d..0ff123444 100644 --- a/khtml/dom/dom_doc.cpp +++ b/khtml/dom/dom_doc.cpp @@ -112,8 +112,8 @@ HTMLDocument DOMImplementation::createHTMLDocument( const DOMString& title ) r->open(); - r->write(QString::fromLatin1("<HTML><HEAD><TITLE>") + title.string() + - QString::fromLatin1("</TITLE></HEAD>")); + r->write(TQString::fromLatin1("<HTML><HEAD><TITLE>") + title.string() + + TQString::fromLatin1("</TITLE></HEAD>")); return r; } diff --git a/khtml/dom/dom_element.cpp b/khtml/dom/dom_element.cpp index 77a9b9e4b..54c322e25 100644 --- a/khtml/dom/dom_element.cpp +++ b/khtml/dom/dom_element.cpp @@ -369,7 +369,7 @@ bool Element::khtmlValidAttrName(const DOMString &name) // Check if name is valid // http://www.w3.org/TR/2000/REC-xml-20001006#NT-Name DOMStringImpl* _name = name.implementation(); - QChar ch = _name->s[0]; + TQChar ch = _name->s[0]; if ( !ch.isLetter() && ch != '_' && ch != ':' ) return false; // first char isn't valid for ( uint i = 0; i < _name->l; ++i ) @@ -377,7 +377,7 @@ bool Element::khtmlValidAttrName(const DOMString &name) ch = _name->s[i]; if ( !ch.isLetter() && !ch.isDigit() && ch != '.' && ch != '-' && ch != '_' && ch != ':' - && ch.category() != QChar::Mark_SpacingCombining + && ch.category() != TQChar::Mark_SpacingCombining /* no idea what "extender is" */ ) return false; } diff --git a/khtml/dom/dom_node.cpp b/khtml/dom/dom_node.cpp index 066a73adc..9971bdb00 100644 --- a/khtml/dom/dom_node.cpp +++ b/khtml/dom/dom_node.cpp @@ -27,7 +27,7 @@ #include "xml/dom_elementimpl.h" #include "xml/dom2_eventsimpl.h" -#include <qrect.h> +#include <tqrect.h> using namespace DOM; @@ -407,9 +407,9 @@ unsigned long Node::index() const return impl->nodeIndex(); } -QString Node::toHTML() +TQString Node::toHTML() { - if (!impl) return QString::null; + if (!impl) return TQString::null; return impl->toString().string(); } @@ -426,7 +426,7 @@ void Node::getCursor(int offset, int &_x, int &_y, int &height) impl->getCaret(offset, false, _x, _y, dummy, height); } -QRect Node::getRect() +TQRect Node::getRect() { if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); return impl->getRect(); diff --git a/khtml/dom/dom_node.h b/khtml/dom/dom_node.h index 666d89d4a..abdcd8d4d 100644 --- a/khtml/dom/dom_node.h +++ b/khtml/dom/dom_node.h @@ -33,7 +33,7 @@ #ifndef _DOM_Node_h_ #define _DOM_Node_h_ -#include <qstring.h> +#include <tqstring.h> #include <kdelibs_export.h> class QRect; @@ -900,7 +900,7 @@ public: * @internal returns the index of a node */ unsigned long index() const; - QString toHTML() KDE_DEPRECATED; + TQString toHTML() KDE_DEPRECATED; void applyChanges(); /** * @deprecated without substitution since 3.2 @@ -910,7 +910,7 @@ public: * not part of the DOM. * @returns the exact coordinates and size of this element. */ - QRect getRect(); + TQRect getRect(); protected: NodeImpl *impl; diff --git a/khtml/dom/dom_string.cpp b/khtml/dom/dom_string.cpp index 2319194e9..14bdc2613 100644 --- a/khtml/dom/dom_string.cpp +++ b/khtml/dom/dom_string.cpp @@ -26,13 +26,13 @@ using namespace DOM; -DOMString::DOMString(const QChar *str, uint len) +DOMString::DOMString(const TQChar *str, uint len) { impl = new DOMStringImpl( str, len ); impl->ref(); } -DOMString::DOMString(const QString &str) +DOMString::DOMString(const TQString &str) { if (str.isNull()) { impl = 0; @@ -127,16 +127,16 @@ void DOMString::insert(DOMString str, uint pos) } -const QChar &DOMString::operator [](unsigned int i) const +const TQChar &DOMString::operator [](unsigned int i) const { - static const QChar nullChar = 0; + static const TQChar nullChar = 0; if(!impl || i >= impl->l ) return nullChar; return *(impl->s+i); } -int DOMString::find(const QChar c, int start) const +int DOMString::find(const TQChar c, int start) const { unsigned int l = start; if(!impl || l >= impl->l ) return -1; @@ -186,22 +186,22 @@ bool DOMString::percentage(int &_percentage) const { if(!impl || !impl->l) return false; - if ( *(impl->s+impl->l-1) != QChar('%')) + if ( *(impl->s+impl->l-1) != TQChar('%')) return false; - _percentage = QConstString(impl->s, impl->l-1).string().toInt(); + _percentage = TQConstString(impl->s, impl->l-1).string().toInt(); return true; } -QChar *DOMString::unicode() const +TQChar *DOMString::unicode() const { if(!impl) return 0; return impl->unicode(); } -QString DOMString::string() const +TQString DOMString::string() const { - if(!impl) return QString::null; + if(!impl) return TQString::null; return impl->string(); } @@ -225,8 +225,8 @@ bool DOM::strcasecmp( const DOMString &as, const DOMString &bs ) { if ( as.length() != bs.length() ) return true; - const QChar *a = as.unicode(); - const QChar *b = bs.unicode(); + const TQChar *a = as.unicode(); + const TQChar *b = bs.unicode(); if ( a == b ) return false; if ( !( a && b ) ) return true; int l = as.length(); @@ -239,7 +239,7 @@ bool DOM::strcasecmp( const DOMString &as, const DOMString &bs ) bool DOM::strcasecmp( const DOMString &as, const char* bs ) { - const QChar *a = as.unicode(); + const TQChar *a = as.unicode(); int l = as.length(); if ( !bs ) return ( l != 0 ); while ( l-- ) { @@ -265,18 +265,18 @@ bool DOM::operator==( const DOMString &a, const DOMString &b ) if( l != b.length() ) return false; - if(!memcmp(a.unicode(), b.unicode(), l*sizeof(QChar))) + if(!memcmp(a.unicode(), b.unicode(), l*sizeof(TQChar))) return true; return false; } -bool DOM::operator==( const DOMString &a, const QString &b ) +bool DOM::operator==( const DOMString &a, const TQString &b ) { unsigned int l = a.length(); if( l != b.length() ) return false; - if(!memcmp(a.unicode(), b.unicode(), l*sizeof(QChar))) + if(!memcmp(a.unicode(), b.unicode(), l*sizeof(TQChar))) return true; return false; } @@ -288,7 +288,7 @@ bool DOM::operator==( const DOMString &a, const char *b ) if ( aimpl ) { int alen = aimpl->l; - const QChar *aptr = aimpl->s; + const TQChar *aptr = aimpl->s; while ( alen-- ) { unsigned char c = *b++; if ( !c || ( *aptr++ ).unicode() != c ) diff --git a/khtml/dom/dom_string.h b/khtml/dom/dom_string.h index f14a2aea9..3fe725f68 100644 --- a/khtml/dom/dom_string.h +++ b/khtml/dom/dom_string.h @@ -23,7 +23,7 @@ #define _DOM_DOMString_h_ #include <kdebug.h> -#include <qstring.h> +#include <tqstring.h> #include <kdelibs_export.h> @@ -33,7 +33,7 @@ class DOMStringImpl; /** * This class implements the basic string we use in the DOM. We do not use - * QString for 2 reasons: Memory overhead, and the missing explicit sharing + * TQString for 2 reasons: Memory overhead, and the missing explicit sharing * of strings we need for the DOM. * * All DOMStrings are explicitly shared (they behave like pointers), meaning @@ -50,8 +50,8 @@ public: */ DOMString() : impl(0) {} - DOMString(const QChar *str, uint len); - DOMString(const QString &); + DOMString(const TQChar *str, uint len); + DOMString(const TQString &); DOMString(const char *str); DOMString(DOMStringImpl *i); @@ -76,9 +76,9 @@ public: * The character at position i of the DOMString. If i >= length(), the * character returned will be 0. */ - const QChar &operator [](unsigned int i) const; + const TQChar &operator [](unsigned int i) const; - int find(const QChar c, int start = 0) const; + int find(const TQChar c, int start = 0) const; uint length() const; void truncate( unsigned int len ); @@ -97,8 +97,8 @@ public: */ DOMString upper() const; - QChar *unicode() const; - QString string() const; + TQChar *unicode() const; + TQString string() const; int toInt() const; bool percentage(int &_percentage) const; @@ -129,10 +129,10 @@ inline kndbgstream &operator<<(kndbgstream &stream, const DOMString &) { #endif KHTML_EXPORT bool operator==( const DOMString &a, const DOMString &b ); -KHTML_EXPORT bool operator==( const DOMString &a, const QString &b ); +KHTML_EXPORT bool operator==( const DOMString &a, const TQString &b ); KHTML_EXPORT bool operator==( const DOMString &a, const char *b ); inline bool operator!=( const DOMString &a, const DOMString &b ) { return !(a==b); } -inline bool operator!=( const DOMString &a, const QString &b ) { return !(a==b); } +inline bool operator!=( const DOMString &a, const TQString &b ) { return !(a==b); } inline bool operator!=( const DOMString &a, const char *b ) { return !(a==b); } inline bool strcmp( const DOMString &a, const DOMString &b ) { return a != b; } diff --git a/khtml/dom/html_block.cpp b/khtml/dom/html_block.cpp index 2dd9abe56..9e499adb0 100644 --- a/khtml/dom/html_block.cpp +++ b/khtml/dom/html_block.cpp @@ -342,7 +342,7 @@ void HTMLPreElement::setWidth( long _width ) { if(!impl) return; - QString aStr; + TQString aStr; aStr.sprintf("%ld", _width); DOMString value(aStr); ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value); @@ -391,7 +391,7 @@ void HTMLLayerElement::setTop( long _top ) { if(!impl) return; - QString aStr; + TQString aStr; aStr.sprintf("%ld", _top); DOMString value(aStr); ((ElementImpl *)impl)->setAttribute(ATTR_TOP, value); @@ -408,7 +408,7 @@ void HTMLLayerElement::setLeft( long _left ) { if(!impl) return; - QString aStr; + TQString aStr; aStr.sprintf("%ld", _left); DOMString value(aStr); ((ElementImpl *)impl)->setAttribute(ATTR_LEFT, value); diff --git a/khtml/dom/html_form.cpp b/khtml/dom/html_form.cpp index e1c94e6bf..5d9aec633 100644 --- a/khtml/dom/html_form.cpp +++ b/khtml/dom/html_form.cpp @@ -447,7 +447,7 @@ long HTMLInputElement::maxLength() const void HTMLInputElement::setMaxLength( long _maxLength ) { if(impl) { - DOMString value(QString::number(_maxLength)); + DOMString value(TQString::number(_maxLength)); ((ElementImpl *)impl)->setAttribute(ATTR_MAXLENGTH,value); } } @@ -495,7 +495,7 @@ long HTMLInputElement::getSize() const void HTMLInputElement::setSize( long value ) { - if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, QString::number(value)); + if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, TQString::number(value)); } DOMString HTMLInputElement::src() const @@ -897,7 +897,7 @@ void HTMLSelectElement::setSize( long _size ) { if(impl) { - DOMString value(QString::number(_size)); + DOMString value(TQString::number(_size)); static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE,value); } } @@ -1009,7 +1009,7 @@ void HTMLTextAreaElement::setCols( long _cols ) { if(impl) { - DOMString value(QString::number(_cols)); + DOMString value(TQString::number(_cols)); static_cast<ElementImpl*>(impl)->setAttribute(ATTR_COLS,value); } } @@ -1057,7 +1057,7 @@ void HTMLTextAreaElement::setRows( long _rows ) { if(impl) { - DOMString value(QString::number(_rows)); + DOMString value(TQString::number(_rows)); static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ROWS,value); } } diff --git a/khtml/dom/html_image.cpp b/khtml/dom/html_image.cpp index 75077e54b..f7c9dac26 100644 --- a/khtml/dom/html_image.cpp +++ b/khtml/dom/html_image.cpp @@ -142,7 +142,7 @@ long HTMLAreaElement::tabIndex() const void HTMLAreaElement::setTabIndex( long _tabIndex ) { if(impl) { - DOMString value(QString::number(_tabIndex)); + DOMString value(TQString::number(_tabIndex)); ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX,value); } } @@ -230,7 +230,7 @@ long HTMLImageElement::border() const void HTMLImageElement::setBorder( long value ) { - if (impl) static_cast<HTMLImageElementImpl*>(impl)->setAttribute(ATTR_BORDER, QString::number(value)); + if (impl) static_cast<HTMLImageElementImpl*>(impl)->setAttribute(ATTR_BORDER, TQString::number(value)); } DOMString HTMLImageElement::getBorder() const @@ -253,7 +253,7 @@ long HTMLImageElement::height() const void HTMLImageElement::setHeight( long value ) { - if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, QString::number(value)); + if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HEIGHT, TQString::number(value)); } long HTMLImageElement::hspace() const @@ -265,7 +265,7 @@ long HTMLImageElement::hspace() const void HTMLImageElement::setHspace( long value ) { - if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value)); + if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, TQString::number(value)); } bool HTMLImageElement::isMap() const @@ -328,7 +328,7 @@ long HTMLImageElement::vspace() const void HTMLImageElement::setVspace( long value ) { - if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_VSPACE, QString::number(value)); + if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_VSPACE, TQString::number(value)); } long HTMLImageElement::width() const @@ -339,7 +339,7 @@ long HTMLImageElement::width() const void HTMLImageElement::setWidth( long value ) { - if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, QString::number(value)); + if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, TQString::number(value)); } long HTMLImageElement::x() const diff --git a/khtml/dom/html_inline.cpp b/khtml/dom/html_inline.cpp index 1f3d0b47e..568761685 100644 --- a/khtml/dom/html_inline.cpp +++ b/khtml/dom/html_inline.cpp @@ -168,7 +168,7 @@ long HTMLAnchorElement::tabIndex() const void HTMLAnchorElement::setTabIndex( long _tabIndex ) { if(impl) { - DOMString value(QString::number(_tabIndex)); + DOMString value(TQString::number(_tabIndex)); ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX,value); } } diff --git a/khtml/dom/html_list.cpp b/khtml/dom/html_list.cpp index 4b6be0962..8d66fe3fc 100644 --- a/khtml/dom/html_list.cpp +++ b/khtml/dom/html_list.cpp @@ -169,7 +169,7 @@ long HTMLLIElement::value() const void HTMLLIElement::setValue( long _value ) { if(impl) { - DOMString value(QString::number(_value)); + DOMString value(TQString::number(_value)); ((ElementImpl *)impl)->setAttribute(ATTR_VALUE,value); } } @@ -278,7 +278,7 @@ void HTMLOListElement::setStart( long _start ) { if(impl) { - DOMString value(QString::number(_start)); + DOMString value(TQString::number(_start)); ((ElementImpl *)impl)->setAttribute(ATTR_START,value); } } diff --git a/khtml/dom/html_misc.cpp b/khtml/dom/html_misc.cpp index ff3ad9aa9..fb975b7cf 100644 --- a/khtml/dom/html_misc.cpp +++ b/khtml/dom/html_misc.cpp @@ -98,7 +98,7 @@ void HTMLBaseFontElement::setSize( long _value ) { if ( impl ) { - DOMString value( QString::number( _value ) ); + DOMString value( TQString::number( _value ) ); ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value); } } diff --git a/khtml/dom/html_object.cpp b/khtml/dom/html_object.cpp index 0648f081c..65ec2f34e 100644 --- a/khtml/dom/html_object.cpp +++ b/khtml/dom/html_object.cpp @@ -140,7 +140,7 @@ long HTMLAppletElement::getHspace() const void HTMLAppletElement::setHspace( long value ) { - if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value)); + if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, TQString::number(value)); } DOMString HTMLAppletElement::name() const @@ -184,7 +184,7 @@ long HTMLAppletElement::getVspace() const void HTMLAppletElement::setVspace( long value ) { - if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value)); + if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, TQString::number(value)); } @@ -359,7 +359,7 @@ long HTMLObjectElement::getHspace() const void HTMLObjectElement::setHspace( long value ) { - if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, QString::number(value)); + if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HSPACE, TQString::number(value)); } DOMString HTMLObjectElement::name() const @@ -393,7 +393,7 @@ long HTMLObjectElement::tabIndex() const void HTMLObjectElement::setTabIndex( long _tabIndex ) { if(impl) { - DOMString value(QString::number(_tabIndex)); + DOMString value(TQString::number(_tabIndex)); ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX,value); } } @@ -439,7 +439,7 @@ long HTMLObjectElement::getVspace() const void HTMLObjectElement::setVspace( long value ) { - if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, QString::number(value)); + if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VSPACE, TQString::number(value)); } DOMString HTMLObjectElement::width() const diff --git a/khtml/dom/html_table.cpp b/khtml/dom/html_table.cpp index f89c4a899..b42c4fcd1 100644 --- a/khtml/dom/html_table.cpp +++ b/khtml/dom/html_table.cpp @@ -193,7 +193,7 @@ long HTMLTableCellElement::colSpan() const void HTMLTableCellElement::setColSpan( long _colSpan ) { if(impl) { - DOMString value(QString::number(_colSpan)); + DOMString value(TQString::number(_colSpan)); ((ElementImpl *)impl)->setAttribute(ATTR_COLSPAN,value); } } @@ -241,7 +241,7 @@ long HTMLTableCellElement::rowSpan() const void HTMLTableCellElement::setRowSpan( long _rowSpan ) { if(impl) { - DOMString value(QString::number(_rowSpan)); + DOMString value(TQString::number(_rowSpan)); ((ElementImpl *)impl)->setAttribute(ATTR_ROWSPAN,value); } } @@ -358,7 +358,7 @@ long HTMLTableColElement::span() const void HTMLTableColElement::setSpan( long _span ) { if(impl) { - DOMString value(QString::number(_span)); + DOMString value(TQString::number(_span)); ((ElementImpl *)impl)->setAttribute(ATTR_SPAN,value); } } diff --git a/khtml/domtreeview.cpp b/khtml/domtreeview.cpp index e5516edfd..61697a9f3 100644 --- a/khtml/domtreeview.cpp +++ b/khtml/domtreeview.cpp @@ -19,7 +19,7 @@ #include "domtreeview.moc" #include "xml/dom_nodeimpl.h" -DOMTreeView::DOMTreeView(QWidget *parent, KHTMLPart *currentpart, const char * name) : KListView(parent, name) +DOMTreeView::DOMTreeView(TQWidget *parent, KHTMLPart *currentpart, const char * name) : KListView(parent, name) { setCaption(name); setRootIsDecorated(true); @@ -28,8 +28,8 @@ DOMTreeView::DOMTreeView(QWidget *parent, KHTMLPart *currentpart, const char * n addColumn("Renderer"); setSorting(-1); part = currentpart; - connect(part, SIGNAL(nodeActivated(const DOM::Node &)), this, SLOT(showTree(const DOM::Node &))); - connect(this, SIGNAL(clicked(QListViewItem *)), this, SLOT(slotItemClicked(QListViewItem *))); + connect(part, TQT_SIGNAL(nodeActivated(const DOM::Node &)), this, TQT_SLOT(showTree(const DOM::Node &))); + connect(this, TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(slotItemClicked(TQListViewItem *))); m_nodedict.setAutoDelete(true); } @@ -58,20 +58,20 @@ void DOMTreeView::showTree(const DOM::Node &pNode) void DOMTreeView::recursive(const DOM::Node &pNode, const DOM::Node &node) { - QListViewItem *cur_item; + TQListViewItem *cur_item; if(pNode.ownerDocument() != document) { - QString val = node.nodeValue().string(); + TQString val = node.nodeValue().string(); if ( val.length() > 20 ) val.truncate( 20 ); - cur_item = new QListViewItem(static_cast<QListView *>(this), node.nodeName().string(), val ); + cur_item = new TQListViewItem(static_cast<TQListView *>(this), node.nodeName().string(), val ); document = pNode.ownerDocument(); } else { - QString val = node.nodeValue().string(); + TQString val = node.nodeValue().string(); if ( val.length() > 20 ) val.truncate( 20 ); - cur_item = new QListViewItem(m_itemdict[pNode.handle()], node.nodeName().string(), val); + cur_item = new TQListViewItem(m_itemdict[pNode.handle()], node.nodeName().string(), val); } if(node.handle()) @@ -88,7 +88,7 @@ void DOMTreeView::recursive(const DOM::Node &pNode, const DOM::Node &node) } } -void DOMTreeView::slotItemClicked(QListViewItem *cur_item) +void DOMTreeView::slotItemClicked(TQListViewItem *cur_item) { DOM::Node *handle = m_nodedict[cur_item]; if(handle) { diff --git a/khtml/domtreeview.h b/khtml/domtreeview.h index 29a70e43d..ef3d45c44 100644 --- a/khtml/domtreeview.h +++ b/khtml/domtreeview.h @@ -20,15 +20,15 @@ #include <klistview.h> #include <kdebug.h> -#include <qlistview.h> -#include <qptrdict.h> +#include <tqlistview.h> +#include <tqptrdict.h> #include "dom/dom_core.h" class DOMTreeView : public KListView { Q_OBJECT public: - DOMTreeView(QWidget *parent, KHTMLPart *part, const char * name = 0); + DOMTreeView(TQWidget *parent, KHTMLPart *part, const char * name = 0); ~DOMTreeView(); void recursive(const DOM::Node &pNode, const DOM::Node &node); @@ -40,11 +40,11 @@ class DOMTreeView : public KListView void showTree(const DOM::Node &pNode); protected slots: - void slotItemClicked(QListViewItem *); + void slotItemClicked(TQListViewItem *); private: - QPtrDict<QListViewItem> m_itemdict; - QPtrDict<DOM::Node> m_nodedict; + TQPtrDict<TQListViewItem> m_itemdict; + TQPtrDict<DOM::Node> m_nodedict; DOM::Node document; KHTMLPart *part; diff --git a/khtml/ecma/domparser.cpp b/khtml/ecma/domparser.cpp index 63a9dce36..672754a45 100644 --- a/khtml/ecma/domparser.cpp +++ b/khtml/ecma/domparser.cpp @@ -88,8 +88,8 @@ Value DOMParserProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List & return Undefined(); } - QString str = args[0].toString(exec).qstring(); - QString contentType = args[1].toString(exec).qstring().stripWhiteSpace(); + TQString str = args[0].toString(exec).qstring(); + TQString contentType = args[1].toString(exec).qstring().stripWhiteSpace(); if (contentType == "text/xml" || contentType == "application/xml" || contentType == "application/xhtml+xml") { DocumentImpl *docImpl = parser->doc->implementation()->createDocument(); diff --git a/khtml/ecma/domparser.h b/khtml/ecma/domparser.h index 233872602..746514783 100644 --- a/khtml/ecma/domparser.h +++ b/khtml/ecma/domparser.h @@ -21,7 +21,7 @@ #ifndef DOMPARSER_H #define DOMPARSER_H -#include <qguardedptr.h> +#include <tqguardedptr.h> #include <kjs/object.h> #include <kjs/interpreter.h> #include <misc/shared.h> @@ -48,7 +48,7 @@ private: enum { ParseFromString }; private: - QGuardedPtr<DOM::DocumentImpl> doc; + TQGuardedPtr<DOM::DocumentImpl> doc; friend class DOMParserProtoFunc; }; diff --git a/khtml/ecma/kjs_binding.cpp b/khtml/ecma/kjs_binding.cpp index 295d8c5e9..f9dd291d7 100644 --- a/khtml/ecma/kjs_binding.cpp +++ b/khtml/ecma/kjs_binding.cpp @@ -53,7 +53,7 @@ Value DOMObject::get(ExecState *exec, const Identifier &p) const // ### translate code into readable string ? // ### oh, and s/QString/i18n or I18N_NOOP (the code in kjs uses I18N_NOOP... but where is it translated ?) // and where does it appear to the user ? - Object err = Error::create(exec, GeneralError, QString("DOM exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString("DOM exception %1").arg(e.code).local8Bit()); exec->setException( err ); result = Undefined(); } @@ -72,7 +72,7 @@ void DOMObject::put(ExecState *exec, const Identifier &propertyName, tryPut(exec, propertyName, value, attr); } catch (DOM::DOMException e) { - Object err = Error::create(exec, GeneralError, QString("DOM exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString("DOM exception %1").arg(e.code).local8Bit()); exec->setException(err); } catch (...) { @@ -120,7 +120,7 @@ Value DOMFunction::get(ExecState *exec, const Identifier &propertyName) const return tryGet(exec, propertyName); } catch (DOM::DOMException e) { - Object err = Error::create(exec, GeneralError, QString("DOM exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString("DOM exception %1").arg(e.code).local8Bit()); exec->setException(err); return Undefined(); } @@ -139,25 +139,25 @@ Value DOMFunction::call(ExecState *exec, Object &thisObj, const List &args) // ### Look into setting prototypes of these & the use of instanceof so the exception // type can be determined. See what other browsers do. catch (DOM::DOMException e) { - Object err = Error::create(exec, GeneralError, QString("DOM Exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString("DOM Exception %1").arg(e.code).local8Bit()); err.put(exec, "code", Number(e.code)); exec->setException(err); return Undefined(); } catch (DOM::RangeException e) { - Object err = Error::create(exec, GeneralError, QString("DOM Range Exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString("DOM Range Exception %1").arg(e.code).local8Bit()); err.put(exec, "code", Number(e.code)); exec->setException(err); return Undefined(); } catch (DOM::CSSException e) { - Object err = Error::create(exec, GeneralError, QString("CSS Exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString("CSS Exception %1").arg(e.code).local8Bit()); err.put(exec, "code", Number(e.code)); exec->setException(err); return Undefined(); } catch (DOM::EventException e) { - Object err = Error::create(exec, GeneralError, QString("DOM Event Exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString("DOM Event Exception %1").arg(e.code).local8Bit()); err.put(exec, "code", Number(e.code)); exec->setException(err); return Undefined(); @@ -170,7 +170,7 @@ Value DOMFunction::call(ExecState *exec, Object &thisObj, const List &args) } } -typedef QPtrList<ScriptInterpreter> InterpreterList; +typedef TQPtrList<ScriptInterpreter> InterpreterList; static InterpreterList *interpreterList; ScriptInterpreter::ScriptInterpreter( const Object &global, khtml::ChildFrame* frame ) @@ -202,7 +202,7 @@ void ScriptInterpreter::forgetDOMObject( void* objectHandle ) { if( !interpreterList ) return; - QPtrListIterator<ScriptInterpreter> it( *interpreterList ); + TQPtrListIterator<ScriptInterpreter> it( *interpreterList ); while ( it.current() ) { (*it)->deleteDOMObject( objectHandle ); ++it; @@ -215,7 +215,7 @@ void ScriptInterpreter::mark() #ifdef KJS_VERBOSE kdDebug(6070) << "ScriptInterpreter::mark " << this << " marking " << m_customizedDomObjects.count() << " DOM objects" << endl; #endif - QPtrDictIterator<void> it( m_customizedDomObjects ); + TQPtrDictIterator<void> it( m_customizedDomObjects ); for( ; it.current(); ++it ) static_cast<DOMObject*>(it.currentKey())->mark(); } @@ -257,7 +257,7 @@ bool ScriptInterpreter::isWindowOpenAllowed() const } -UString::UString(const QString &d) +UString::UString(const TQString &d) { unsigned int len = d.length(); UChar *dat = new UChar[len]; @@ -283,27 +283,27 @@ UString::UString(const DOM::DOMString &d) DOM::DOMString UString::string() const { - return DOM::DOMString((QChar*) data(), size()); + return DOM::DOMString((TQChar*) data(), size()); } -QString UString::qstring() const +TQString UString::qstring() const { - return QString((QChar*) data(), size()); + return TQString((TQChar*) data(), size()); } -QConstString UString::qconststring() const +TQConstString UString::qconststring() const { - return QConstString((QChar*) data(), size()); + return TQConstString((TQChar*) data(), size()); } DOM::DOMString Identifier::string() const { - return DOM::DOMString((QChar*) data(), size()); + return DOM::DOMString((TQChar*) data(), size()); } -QString Identifier::qstring() const +TQString Identifier::qstring() const { - return QString((QChar*) data(), size()); + return TQString((TQChar*) data(), size()); } DOM::Node KJS::toNode(const Value& val) @@ -324,17 +324,17 @@ Value KJS::getString(DOM::DOMString s) return String(s); } -QVariant KJS::ValueToVariant(ExecState* exec, const Value &val) { - QVariant res; +TQVariant KJS::ValueToVariant(ExecState* exec, const Value &val) { + TQVariant res; switch (val.type()) { case BooleanType: - res = QVariant(val.toBoolean(exec), 0); + res = TQVariant(val.toBoolean(exec), 0); break; case NumberType: - res = QVariant(val.toNumber(exec)); + res = TQVariant(val.toNumber(exec)); break; case StringType: - res = QVariant(val.toString(exec).qstring()); + res = TQVariant(val.toString(exec).qstring()); break; default: // everything else will be 'invalid' @@ -345,7 +345,7 @@ QVariant KJS::ValueToVariant(ExecState* exec, const Value &val) { class EmbedLiveConnect : public ObjectImp { - friend Value KJS::getLiveConnectValue(KParts::LiveConnectExtension *lc, const QString & name, const int type, const QString & value, int id); + friend Value KJS::getLiveConnectValue(KParts::LiveConnectExtension *lc, const TQString & name, const int type, const TQString & value, int id); EmbedLiveConnect(KParts::LiveConnectExtension *lc, UString n, KParts::LiveConnectExtension::Type t, int id); public: ~EmbedLiveConnect(); @@ -360,13 +360,13 @@ public: private: EmbedLiveConnect(const EmbedLiveConnect &); - QGuardedPtr<KParts::LiveConnectExtension> m_liveconnect; + TQGuardedPtr<KParts::LiveConnectExtension> m_liveconnect; UString name; KParts::LiveConnectExtension::Type objtype; unsigned long objid; }; -Value KJS::getLiveConnectValue(KParts::LiveConnectExtension *lc, const QString & name, const int type, const QString & value, int id) +Value KJS::getLiveConnectValue(KParts::LiveConnectExtension *lc, const TQString & name, const int type, const TQString & value, int id) { KParts::LiveConnectExtension::Type t=(KParts::LiveConnectExtension::Type)type; switch(t) { @@ -412,7 +412,7 @@ Value EmbedLiveConnect::get(ExecState *, const Identifier & prop) const { if (m_liveconnect) { KParts::LiveConnectExtension::Type rettype; - QString retval; + TQString retval; unsigned long retobjid; if (m_liveconnect->get(objid, prop.qstring(), rettype, retobjid, retval)) return getLiveConnectValue(m_liveconnect, prop.qstring(), rettype, retval, retobjid); @@ -436,11 +436,11 @@ KDE_NO_EXPORT Value EmbedLiveConnect::call(ExecState *exec, Object&, const List &args) { if (m_liveconnect) { - QStringList qargs; + TQStringList qargs; for (ListIterator i = args.begin(); i != args.end(); ++i) qargs.append((*i).toString(exec).qstring()); KParts::LiveConnectExtension::Type rtype; - QString rval; + TQString rval; unsigned long robjid; if (m_liveconnect->call(objid, name.qstring(), qargs, rtype, robjid, rval)) return getLiveConnectValue(m_liveconnect, name.qstring(), rtype, rval, robjid); @@ -460,7 +460,7 @@ Value EmbedLiveConnect::toPrimitive(ExecState *exec, Type) const { KDE_NO_EXPORT UString EmbedLiveConnect::toString(ExecState *) const { - QString str; + TQString str; const char *type = objtype == KParts::LiveConnectExtension::TypeFunction ? "Function" : "Object"; str.sprintf("[object %s ref=%d]", type, (int) objid); return UString(str); diff --git a/khtml/ecma/kjs_binding.h b/khtml/ecma/kjs_binding.h index 4b49e866b..c55da21ce 100644 --- a/khtml/ecma/kjs_binding.h +++ b/khtml/ecma/kjs_binding.h @@ -26,8 +26,8 @@ #include <kjs/function_object.h> /// for FunctionPrototypeImp #include <dom/dom_node.h> -#include <qvariant.h> -#include <qptrdict.h> +#include <tqvariant.h> +#include <tqptrdict.h> #include <kurl.h> #include <kjs/lookup.h> @@ -144,8 +144,8 @@ namespace KJS { private: khtml::ChildFrame* m_frame; - QPtrDict<DOMObject> m_domObjects; - QPtrDict<void> m_customizedDomObjects; //Objects which had custom properties set, + TQPtrDict<DOMObject> m_domObjects; + TQPtrDict<void> m_customizedDomObjects; //Objects which had custom properties set, //and should not be GC'd. key is DOMObject* DOM::Event *m_evt; bool m_inlineCode; @@ -182,7 +182,7 @@ namespace KJS { /** * Convery a KJS value into a QVariant */ - QVariant ValueToVariant(ExecState* exec, const Value& val); + TQVariant ValueToVariant(ExecState* exec, const Value& val); /** * We need a modified version of lookupGet because @@ -330,7 +330,7 @@ namespace KJS { int id; \ }; - Value getLiveConnectValue(KParts::LiveConnectExtension *lc, const QString & name, const int type, const QString & value, int id); + Value getLiveConnectValue(KParts::LiveConnectExtension *lc, const TQString & name, const int type, const TQString & value, int id); // This is used to create pseudo-constructor objects, like Mozillaish diff --git a/khtml/ecma/kjs_css.cpp b/khtml/ecma/kjs_css.cpp index 167809046..b42f9dd02 100644 --- a/khtml/ecma/kjs_css.cpp +++ b/khtml/ecma/kjs_css.cpp @@ -33,9 +33,9 @@ namespace KJS { -static QString cssPropertyName( const Identifier &p, bool& hadPixelPrefix ) +static TQString cssPropertyName( const Identifier &p, bool& hadPixelPrefix ) { - QString prop = p.qstring(); + TQString prop = p.qstring(); int i = prop.length(); while ( --i ) { char c = prop[i].latin1(); @@ -98,7 +98,7 @@ DOMCSSStyleDeclaration::~DOMCSSStyleDeclaration() bool DOMCSSStyleDeclaration::hasProperty(ExecState *exec, const Identifier &p) const { bool hadPixelPrefix; - QString cssprop = cssPropertyName(p, hadPixelPrefix); + TQString cssprop = cssPropertyName(p, hadPixelPrefix); if (DOM::getPropertyID(cssprop.latin1(), cssprop.length())) return true; @@ -138,7 +138,7 @@ Value DOMCSSStyleDeclaration::tryGet(ExecState *exec, const Identifier &property // positioned element. if it is not a positioned element, return 0 // from MSIE documentation ### IMPLEMENT THAT (Dirk) bool asNumber; - QString p = cssPropertyName(propertyName, asNumber); + TQString p = cssPropertyName(propertyName, asNumber); #ifdef KJS_VERBOSE kdDebug(6070) << "DOMCSSStyleDeclaration: converting to css property name: " << p << ( asNumber ? "px" : "" ) << endl; @@ -172,8 +172,8 @@ void DOMCSSStyleDeclaration::tryPut(ExecState *exec, const Identifier &propertyN } else { bool pxSuffix; - QString prop = cssPropertyName(propertyName, pxSuffix); - QString propvalue = value.toString(exec).qstring(); + TQString prop = cssPropertyName(propertyName, pxSuffix); + TQString propvalue = value.toString(exec).qstring(); if (pxSuffix) propvalue += "px"; @@ -360,7 +360,7 @@ Value DOMStyleSheetList::tryGet(ExecState *exec, const Identifier &p) const DOM::NameNodeListImpl namedList( m_doc.documentElement().handle(), p.string() ); int len = namedList.length(); if ( len ) { - QValueList<DOM::Node> styleSheets; + TQValueList<DOM::Node> styleSheets; for ( int i = 0 ; i < len ; ++i ) { DOM::HTMLStyleElement elem = DOM::Node(namedList.item(i)); if (!elem.isNull()) diff --git a/khtml/ecma/kjs_debugwin.cpp b/khtml/ecma/kjs_debugwin.cpp index 13a12ce5f..eeb126ebb 100644 --- a/khtml/ecma/kjs_debugwin.cpp +++ b/khtml/ecma/kjs_debugwin.cpp @@ -25,21 +25,21 @@ #include <assert.h> #include <stdlib.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qtextedit.h> -#include <qlistbox.h> -#include <qmultilineedit.h> -#include <qapplication.h> -#include <qsplitter.h> -#include <qcombobox.h> -#include <qbitmap.h> -#include <qwidgetlist.h> -#include <qlabel.h> -#include <qdatastream.h> -#include <qcstring.h> -#include <qpainter.h> -#include <qscrollbar.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqtextedit.h> +#include <tqlistbox.h> +#include <tqmultilineedit.h> +#include <tqapplication.h> +#include <tqsplitter.h> +#include <tqcombobox.h> +#include <tqbitmap.h> +#include <tqwidgetlist.h> +#include <tqlabel.h> +#include <tqdatastream.h> +#include <tqcstring.h> +#include <tqpainter.h> +#include <tqscrollbar.h> #include <klocale.h> #include <kdebug.h> @@ -75,11 +75,11 @@ using namespace KJS; using namespace khtml; -SourceDisplay::SourceDisplay(KJSDebugWin *debugWin, QWidget *parent, const char *name) - : QScrollView(parent,name), m_currentLine(-1), m_sourceFile(0), m_debugWin(debugWin), +SourceDisplay::SourceDisplay(KJSDebugWin *debugWin, TQWidget *parent, const char *name) + : TQScrollView(parent,name), m_currentLine(-1), m_sourceFile(0), m_debugWin(debugWin), m_font(KGlobalSettings::fixedFont()) { - verticalScrollBar()->setLineStep(QFontMetrics(m_font).height()); + verticalScrollBar()->setLineStep(TQFontMetrics(m_font).height()); viewport()->setBackgroundMode(Qt::NoBackground); m_breakpointIcon = KGlobal::iconLoader()->loadIcon("stop",KIcon::Small); } @@ -106,20 +106,20 @@ void SourceDisplay::setSource(SourceFile *sourceFile) return; } - QString code = sourceFile->getCode(); - const QChar *chars = code.unicode(); + TQString code = sourceFile->getCode(); + const TQChar *chars = code.unicode(); uint len = code.length(); - QChar newLine('\n'); - QChar cr('\r'); - QChar tab('\t'); - QString tabstr(" "); - QString line; + TQChar newLine('\n'); + TQChar cr('\r'); + TQChar tab('\t'); + TQString tabstr(" "); + TQString line; m_lines.clear(); int width = 0; - QFontMetrics metrics(m_font); + TQFontMetrics metrics(m_font); for (uint pos = 0; pos < len; pos++) { - QChar c = chars[pos]; + TQChar c = chars[pos]; if (c == cr) { if (pos < len-1 && chars[pos+1] == newLine) continue; @@ -158,7 +158,7 @@ void SourceDisplay::setCurrentLine(int lineno, bool doCenter) m_currentLine = lineno; if (doCenter && m_currentLine >= 0) { - QFontMetrics metrics(m_font); + TQFontMetrics metrics(m_font); int height = metrics.height(); center(0,height*m_currentLine+height/2); } @@ -166,27 +166,27 @@ void SourceDisplay::setCurrentLine(int lineno, bool doCenter) updateContents(); } -void SourceDisplay::contentsMousePressEvent(QMouseEvent *e) +void SourceDisplay::contentsMousePressEvent(TQMouseEvent *e) { - QScrollView::mouseDoubleClickEvent(e); - QFontMetrics metrics(m_font); + TQScrollView::mouseDoubleClickEvent(e); + TQFontMetrics metrics(m_font); int lineno = e->y()/metrics.height(); emit lineDoubleClicked(lineno+1); // line numbers start from 1 } -void SourceDisplay::showEvent(QShowEvent *) +void SourceDisplay::showEvent(TQShowEvent *) { setSource(m_sourceFile); } -void SourceDisplay::drawContents(QPainter *p, int clipx, int clipy, int clipw, int cliph) +void SourceDisplay::drawContents(TQPainter *p, int clipx, int clipy, int clipw, int cliph) { if (!m_sourceFile) { p->fillRect(clipx,clipy,clipw,cliph,palette().active().base()); return; } - QFontMetrics metrics(m_font); + TQFontMetrics metrics(m_font); int height = metrics.height(); int bottom = clipy + cliph; @@ -204,7 +204,7 @@ void SourceDisplay::drawContents(QPainter *p, int clipx, int clipy, int clipw, i int linenoWidth = metrics.width("888888"); for (int lineno = firstLine; lineno <= lastLine; lineno++) { - QString linenoStr = QString().sprintf("%d",lineno+1); + TQString linenoStr = TQString().sprintf("%d",lineno+1); p->fillRect(0,height*lineno,linenoWidth,height,palette().active().mid()); @@ -212,8 +212,8 @@ void SourceDisplay::drawContents(QPainter *p, int clipx, int clipy, int clipw, i p->setPen(palette().active().text()); p->drawText(0,height*lineno,linenoWidth,height,Qt::AlignRight,linenoStr); - QColor bgColor; - QColor textColor; + TQColor bgColor; + TQColor textColor; if (lineno == m_currentLine) { bgColor = palette().active().highlight(); @@ -246,16 +246,16 @@ void SourceDisplay::drawContents(QPainter *p, int clipx, int clipy, int clipw, i KJSDebugWin * KJSDebugWin::kjs_html_debugger = 0; -QString SourceFile::getCode() +TQString SourceFile::getCode() { if (interpreter) { KHTMLPart *part = ::qt_cast<KHTMLPart*>(static_cast<ScriptInterpreter*>(interpreter)->part()); if (part && url == part->url().url() && KHTMLPageCache::self()->isValid(part->cacheId())) { Decoder *decoder = part->createDecoder(); - QByteArray data; - QDataStream stream(data,IO_WriteOnly); + TQByteArray data; + TQDataStream stream(data,IO_WriteOnly); KHTMLPageCache::self()->saveData(part->cacheId(),&stream); - QString str; + TQString str; if (data.size() == 0) str = ""; else @@ -287,28 +287,28 @@ SourceFragment::~SourceFragment() //------------------------------------------------------------------------- -KJSErrorDialog::KJSErrorDialog(QWidget *parent, const QString& errorMessage, bool showDebug) +KJSErrorDialog::KJSErrorDialog(TQWidget *parent, const TQString& errorMessage, bool showDebug) : KDialogBase(parent,0,true,i18n("JavaScript Error"), showDebug ? KDialogBase::Ok|KDialogBase::User1 : KDialogBase::Ok, KDialogBase::Ok,false,KGuiItem("&Debug","gear")) { - QWidget *page = new QWidget(this); + TQWidget *page = new TQWidget(this); setMainWidget(page); - QLabel *iconLabel = new QLabel("",page); + TQLabel *iconLabel = new TQLabel("",page); iconLabel->setPixmap(KGlobal::iconLoader()->loadIcon("messagebox_critical", KIcon::NoGroup,KIcon::SizeMedium, KIcon::DefaultState,0,true)); - QWidget *contents = new QWidget(page); - QLabel *label = new QLabel(errorMessage,contents); - m_dontShowAgainCb = new QCheckBox(i18n("&Do not show this message again"),contents); + TQWidget *contents = new TQWidget(page); + TQLabel *label = new TQLabel(errorMessage,contents); + m_dontShowAgainCb = new TQCheckBox(i18n("&Do not show this message again"),contents); - QVBoxLayout *vl = new QVBoxLayout(contents,0,spacingHint()); + TQVBoxLayout *vl = new TQVBoxLayout(contents,0,spacingHint()); vl->addWidget(label); vl->addWidget(m_dontShowAgainCb); - QHBoxLayout *topLayout = new QHBoxLayout(page,0,spacingHint()); + TQHBoxLayout *topLayout = new TQHBoxLayout(page,0,spacingHint()); topLayout->addWidget(iconLabel); topLayout->addWidget(contents); topLayout->addStretch(10); @@ -327,11 +327,11 @@ void KJSErrorDialog::slotUser1() } //------------------------------------------------------------------------- -EvalMultiLineEdit::EvalMultiLineEdit(QWidget *parent) - : QMultiLineEdit(parent) { +EvalMultiLineEdit::EvalMultiLineEdit(TQWidget *parent) + : TQMultiLineEdit(parent) { } -void EvalMultiLineEdit::keyPressEvent(QKeyEvent * e) +void EvalMultiLineEdit::keyPressEvent(TQKeyEvent * e) { if (e->key() == Qt::Key_Return) { if (hasSelectedText()) { @@ -343,10 +343,10 @@ void EvalMultiLineEdit::keyPressEvent(QKeyEvent * e) } end(); } - QMultiLineEdit::keyPressEvent(e); + TQMultiLineEdit::keyPressEvent(e); } //------------------------------------------------------------------------- -KJSDebugWin::KJSDebugWin(QWidget *parent, const char *name) +KJSDebugWin::KJSDebugWin(TQWidget *parent, const char *name) : KMainWindow(parent, name, WType_TopLevel), KInstance("kjs_debugger") { m_breakpoints = 0; @@ -362,73 +362,73 @@ KJSDebugWin::KJSDebugWin(QWidget *parent, const char *name) m_steppingDepth = 0; m_stopIcon = KGlobal::iconLoader()->loadIcon("stop",KIcon::Small); - m_emptyIcon = QPixmap(m_stopIcon.width(),m_stopIcon.height()); - QBitmap emptyMask(m_stopIcon.width(),m_stopIcon.height(),true); + m_emptyIcon = TQPixmap(m_stopIcon.width(),m_stopIcon.height()); + TQBitmap emptyMask(m_stopIcon.width(),m_stopIcon.height(),true); m_emptyIcon.setMask(emptyMask); setCaption(i18n("JavaScript Debugger")); - QWidget *mainWidget = new QWidget(this); + TQWidget *mainWidget = new TQWidget(this); setCentralWidget(mainWidget); - QVBoxLayout *vl = new QVBoxLayout(mainWidget,5); + TQVBoxLayout *vl = new TQVBoxLayout(mainWidget,5); // frame list & code - QSplitter *hsplitter = new QSplitter(Qt::Vertical,mainWidget); - QSplitter *vsplitter = new QSplitter(hsplitter); - QFont font(KGlobalSettings::fixedFont()); + TQSplitter *hsplitter = new TQSplitter(Qt::Vertical,mainWidget); + TQSplitter *vsplitter = new TQSplitter(hsplitter); + TQFont font(KGlobalSettings::fixedFont()); - QWidget *contextContainer = new QWidget(vsplitter); + TQWidget *contextContainer = new TQWidget(vsplitter); - QLabel *contextLabel = new QLabel(i18n("Call stack"),contextContainer); - QWidget *contextListContainer = new QWidget(contextContainer); - m_contextList = new QListBox(contextListContainer); + TQLabel *contextLabel = new TQLabel(i18n("Call stack"),contextContainer); + TQWidget *contextListContainer = new TQWidget(contextContainer); + m_contextList = new TQListBox(contextListContainer); m_contextList->setMinimumSize(100,200); - connect(m_contextList,SIGNAL(highlighted(int)),this,SLOT(slotShowFrame(int))); + connect(m_contextList,TQT_SIGNAL(highlighted(int)),this,TQT_SLOT(slotShowFrame(int))); - QHBoxLayout *clistLayout = new QHBoxLayout(contextListContainer); + TQHBoxLayout *clistLayout = new TQHBoxLayout(contextListContainer); clistLayout->addWidget(m_contextList); clistLayout->addSpacing(KDialog::spacingHint()); - QVBoxLayout *contextLayout = new QVBoxLayout(contextContainer); + TQVBoxLayout *contextLayout = new TQVBoxLayout(contextContainer); contextLayout->addWidget(contextLabel); contextLayout->addSpacing(KDialog::spacingHint()); contextLayout->addWidget(contextListContainer); // source selection & display - QWidget *sourceSelDisplay = new QWidget(vsplitter); - QVBoxLayout *ssdvl = new QVBoxLayout(sourceSelDisplay); + TQWidget *sourceSelDisplay = new TQWidget(vsplitter); + TQVBoxLayout *ssdvl = new TQVBoxLayout(sourceSelDisplay); - m_sourceSel = new QComboBox(toolBar()); - connect(m_sourceSel,SIGNAL(activated(int)),this,SLOT(slotSourceSelected(int))); + m_sourceSel = new TQComboBox(toolBar()); + connect(m_sourceSel,TQT_SIGNAL(activated(int)),this,TQT_SLOT(slotSourceSelected(int))); m_sourceDisplay = new SourceDisplay(this,sourceSelDisplay); ssdvl->addWidget(m_sourceDisplay); - connect(m_sourceDisplay,SIGNAL(lineDoubleClicked(int)),SLOT(slotToggleBreakpoint(int))); + connect(m_sourceDisplay,TQT_SIGNAL(lineDoubleClicked(int)),TQT_SLOT(slotToggleBreakpoint(int))); - QValueList<int> vsplitSizes; + TQValueList<int> vsplitSizes; vsplitSizes.insert(vsplitSizes.end(),120); vsplitSizes.insert(vsplitSizes.end(),480); vsplitter->setSizes(vsplitSizes); // evaluate - QWidget *evalContainer = new QWidget(hsplitter); + TQWidget *evalContainer = new TQWidget(hsplitter); - QLabel *evalLabel = new QLabel(i18n("JavaScript console"),evalContainer); + TQLabel *evalLabel = new TQLabel(i18n("JavaScript console"),evalContainer); m_evalEdit = new EvalMultiLineEdit(evalContainer); - m_evalEdit->setWordWrap(QMultiLineEdit::NoWrap); + m_evalEdit->setWordWrap(TQMultiLineEdit::NoWrap); m_evalEdit->setFont(font); - connect(m_evalEdit,SIGNAL(returnPressed()),SLOT(slotEval())); + connect(m_evalEdit,TQT_SIGNAL(returnPressed()),TQT_SLOT(slotEval())); m_evalDepth = 0; - QVBoxLayout *evalLayout = new QVBoxLayout(evalContainer); + TQVBoxLayout *evalLayout = new TQVBoxLayout(evalContainer); evalLayout->addSpacing(KDialog::spacingHint()); evalLayout->addWidget(evalLabel); evalLayout->addSpacing(KDialog::spacingHint()); evalLayout->addWidget(m_evalEdit); - QValueList<int> hsplitSizes; + TQValueList<int> hsplitSizes; hsplitSizes.insert(hsplitSizes.end(),400); hsplitSizes.insert(hsplitSizes.end(),200); hsplitter->setSizes(hsplitSizes); @@ -445,18 +445,18 @@ KJSDebugWin::KJSDebugWin(QWidget *parent, const char *name) // Venkman use F12, KDevelop F10 KShortcut scNext = KShortcut(KKeySequence(KKey(Qt::Key_F12))); scNext.append(KKeySequence(KKey(Qt::Key_F10))); - m_nextAction = new KAction(i18n("Next breakpoint","&Next"),"dbgnext",scNext,this,SLOT(slotNext()), + m_nextAction = new KAction(i18n("Next breakpoint","&Next"),"dbgnext",scNext,this,TQT_SLOT(slotNext()), m_actionCollection,"next"); - m_stepAction = new KAction(i18n("&Step"),"dbgstep",KShortcut(Qt::Key_F11),this,SLOT(slotStep()), + m_stepAction = new KAction(i18n("&Step"),"dbgstep",KShortcut(Qt::Key_F11),this,TQT_SLOT(slotStep()), m_actionCollection,"step"); // Venkman use F5, Kdevelop F9 KShortcut scCont = KShortcut(KKeySequence(KKey(Qt::Key_F5))); scCont.append(KKeySequence(KKey(Qt::Key_F9))); - m_continueAction = new KAction(i18n("&Continue"),"dbgrun",scCont,this,SLOT(slotContinue()), + m_continueAction = new KAction(i18n("&Continue"),"dbgrun",scCont,this,TQT_SLOT(slotContinue()), m_actionCollection,"cont"); - m_stopAction = new KAction(i18n("St&op"),"stop",KShortcut(Qt::Key_F4),this,SLOT(slotStop()), + m_stopAction = new KAction(i18n("St&op"),"stop",KShortcut(Qt::Key_F4),this,TQT_SLOT(slotStop()), m_actionCollection,"stop"); - m_breakAction = new KAction(i18n("&Break at Next Statement"),"dbgrunto",KShortcut(Qt::Key_F8),this,SLOT(slotBreakNext()), + m_breakAction = new KAction(i18n("&Break at Next Statement"),"dbgrunto",KShortcut(Qt::Key_F8),this,TQT_SLOT(slotBreakNext()), m_actionCollection,"breaknext"); @@ -553,7 +553,7 @@ void KJSDebugWin::slotToggleBreakpoint(int lineno) // Find the source fragment containing the selected line (if any) int sourceId = -1; int highestBaseLine = -1; - QMap<int,SourceFragment*>::Iterator it; + TQMap<int,SourceFragment*>::Iterator it; for (it = m_sourceFragments.begin(); it != m_sourceFragments.end(); ++it) { SourceFragment *sourceFragment = it.data(); @@ -627,7 +627,7 @@ void KJSDebugWin::slotEval() // Evaluate the js code from m_evalEdit UString code(m_evalEdit->code()); - QString msg; + TQString msg; KJSCPUGuard guard; guard.start(); @@ -657,49 +657,49 @@ void KJSDebugWin::slotEval() updateContextList(); } -void KJSDebugWin::closeEvent(QCloseEvent *e) +void KJSDebugWin::closeEvent(TQCloseEvent *e) { while (!m_execStates.isEmpty()) // ### not sure if this will work leaveSession(); - return QWidget::closeEvent(e); + return TQWidget::closeEvent(e); } -bool KJSDebugWin::eventFilter(QObject *o, QEvent *e) +bool KJSDebugWin::eventFilter(TQObject *o, TQEvent *e) { switch (e->type()) { - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - case QEvent::MouseButtonDblClick: - case QEvent::MouseMove: - case QEvent::KeyPress: - case QEvent::KeyRelease: - case QEvent::Destroy: - case QEvent::Close: - case QEvent::Quit: + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + case TQEvent::MouseButtonDblClick: + case TQEvent::MouseMove: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::Destroy: + case TQEvent::Close: + case TQEvent::Quit: while (o->parent()) o = o->parent(); if (o == this) - return QWidget::eventFilter(o,e); + return TQWidget::eventFilter(o,e); else return true; break; default: - return QWidget::eventFilter(o,e); + return TQWidget::eventFilter(o,e); } } void KJSDebugWin::disableOtherWindows() { - QWidgetList *widgets = QApplication::allWidgets(); - QWidgetListIt it(*widgets); + TQWidgetList *widgets = TQApplication::allWidgets(); + TQWidgetListIt it(*widgets); for (; it.current(); ++it) it.current()->installEventFilter(this); } void KJSDebugWin::enableOtherWindows() { - QWidgetList *widgets = QApplication::allWidgets(); - QWidgetListIt it(*widgets); + TQWidgetList *widgets = TQApplication::allWidgets(); + TQWidgetListIt it(*widgets); for (; it.current(); ++it) it.current()->removeEventFilter(this); } @@ -717,12 +717,12 @@ bool KJSDebugWin::sourceParsed(KJS::ExecState *exec, int sourceId, index = m_sourceSel->count(); if (!m_nextSourceUrl.isEmpty()) { - QString code = source.qstring(); + TQString code = source.qstring(); KParts::ReadOnlyPart *part = static_cast<ScriptInterpreter*>(exec->interpreter())->part(); if (m_nextSourceUrl == part->url().url()) { // Only store the code here if it's not from the part's html page... in that // case we can get it from KHTMLPageCache - code = QString::null; + code = TQString::null; } sourceFile = new SourceFile(m_nextSourceUrl,code,exec->interpreter()); @@ -735,7 +735,7 @@ bool KJSDebugWin::sourceParsed(KJS::ExecState *exec, int sourceId, // but we still know the interpreter sourceFile = new SourceFile("(unknown)",source.qstring(),exec->interpreter()); m_sourceSelFiles.append(sourceFile); - m_sourceSel->insertItem(QString::number(index) += "-???"); + m_sourceSel->insertItem(TQString::number(index) += "-???"); } } else { @@ -809,9 +809,9 @@ bool KJSDebugWin::exception(ExecState *exec, const Value &value, bool inTryCatch if (khtmlpart && !khtmlpart->settings()->isJavaScriptErrorReportingEnabled()) return true; - QWidget *dlgParent = (m_evalDepth == 0) ? (QWidget*)part->widget() : (QWidget*)this; + TQWidget *dlgParent = (m_evalDepth == 0) ? (TQWidget*)part->widget() : (TQWidget*)this; - QString exceptionMsg = value.toString(exec).qstring(); + TQString exceptionMsg = value.toString(exec).qstring(); // Syntax errors are a special case. For these we want to display the url & lineno, // which isn't included in the exception messeage. So we work it out from the values @@ -834,7 +834,7 @@ bool KJSDebugWin::exception(ExecState *exec, const Value &value, bool inTryCatch // An exception occurred and we're not currently executing any code... this can // happen in some cases e.g. a parse error, or native code accessing funcitons like // Object::put() - QString msg = i18n("An error occurred while attempting to run a script on this page.\n\n%1") + TQString msg = i18n("An error occurred while attempting to run a script on this page.\n\n%1") .arg(exceptionMsg); KJSErrorDialog dlg(dlgParent,msg,false); dlg.exec(); @@ -843,9 +843,9 @@ bool KJSDebugWin::exception(ExecState *exec, const Value &value, bool inTryCatch else { Context ctx = m_execs[m_execsCount-1]->context(); SourceFragment *sourceFragment = m_sourceFragments[ctx.sourceId()]; - QString msg = i18n("An error occurred while attempting to run a script on this page.\n\n%1 line %2:\n%3") + TQString msg = i18n("An error occurred while attempting to run a script on this page.\n\n%1 line %2:\n%3") .arg(KStringHandler::rsqueeze( sourceFragment->sourceFile->url,80), - QString::number( sourceFragment->baseLine+ctx.curStmtFirstLine()-1), + TQString::number( sourceFragment->baseLine+ctx.curStmtFirstLine()-1), exceptionMsg); KJSErrorDialog dlg(dlgParent,msg,true); @@ -861,10 +861,10 @@ bool KJSDebugWin::exception(ExecState *exec, const Value &value, bool inTryCatch if (dontShowAgain) { KConfig *config = kapp->config(); - KConfigGroupSaver saver(config,QString::fromLatin1("Java/JavaScript Settings")); - config->writeEntry("ReportJavaScriptErrors",QVariant(false,0)); + KConfigGroupSaver saver(config,TQString::fromLatin1("Java/JavaScript Settings")); + config->writeEntry("ReportJavaScriptErrors",TQVariant(false,0)); config->sync(); - QByteArray data; + TQByteArray data; kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "reparseConfiguration()", data ); } @@ -937,13 +937,13 @@ void KJSDebugWin::setSourceLine(int sourceId, int lineno) m_sourceDisplay->setCurrentLine(source->baseLine+lineno-2); } -void KJSDebugWin::setNextSourceInfo(QString url, int baseLine) +void KJSDebugWin::setNextSourceInfo(TQString url, int baseLine) { m_nextSourceUrl = url; m_nextSourceBaseLine = baseLine; } -void KJSDebugWin::sourceChanged(Interpreter *interpreter, QString url) +void KJSDebugWin::sourceChanged(Interpreter *interpreter, TQString url) { SourceFile *sourceFile = getSourceFile(interpreter,url); if (sourceFile && m_curSourceFile == sourceFile) @@ -952,31 +952,31 @@ void KJSDebugWin::sourceChanged(Interpreter *interpreter, QString url) void KJSDebugWin::clearInterpreter(Interpreter *interpreter) { - QMap<int,SourceFragment*>::Iterator it; + TQMap<int,SourceFragment*>::Iterator it; for (it = m_sourceFragments.begin(); it != m_sourceFragments.end(); ++it) if (it.data() && it.data()->sourceFile->interpreter == interpreter) it.data()->sourceFile->interpreter = 0; } -SourceFile *KJSDebugWin::getSourceFile(Interpreter *interpreter, QString url) +SourceFile *KJSDebugWin::getSourceFile(Interpreter *interpreter, TQString url) { - QString key = QString("%1|%2").arg((long)interpreter).arg(url); + TQString key = TQString("%1|%2").arg((long)interpreter).arg(url); return m_sourceFiles[key]; } -void KJSDebugWin::setSourceFile(Interpreter *interpreter, QString url, SourceFile *sourceFile) +void KJSDebugWin::setSourceFile(Interpreter *interpreter, TQString url, SourceFile *sourceFile) { - QString key = QString("%1|%2").arg((long)interpreter).arg(url); + TQString key = TQString("%1|%2").arg((long)interpreter).arg(url); sourceFile->ref(); if (SourceFile* oldFile = m_sourceFiles[key]) oldFile->deref(); m_sourceFiles[key] = sourceFile; } -void KJSDebugWin::removeSourceFile(Interpreter *interpreter, QString url) +void KJSDebugWin::removeSourceFile(Interpreter *interpreter, TQString url) { - QString key = QString("%1|%2").arg((long)interpreter).arg(url); + TQString key = TQString("%1|%2").arg((long)interpreter).arg(url); if (SourceFile* oldFile = m_sourceFiles[key]) oldFile->deref(); m_sourceFiles.remove(key); @@ -1048,7 +1048,7 @@ void KJSDebugWin::leaveSession() void KJSDebugWin::updateContextList() { - disconnect(m_contextList,SIGNAL(highlighted(int)),this,SLOT(slotShowFrame(int))); + disconnect(m_contextList,TQT_SIGNAL(highlighted(int)),this,TQT_SLOT(slotShowFrame(int))); m_contextList->clear(); for (int i = 0; i < m_execsCount; i++) @@ -1060,28 +1060,28 @@ void KJSDebugWin::updateContextList() setSourceLine(ctx.sourceId(),ctx.curStmtFirstLine()); } - connect(m_contextList,SIGNAL(highlighted(int)),this,SLOT(slotShowFrame(int))); + connect(m_contextList,TQT_SIGNAL(highlighted(int)),this,TQT_SLOT(slotShowFrame(int))); } -QString KJSDebugWin::contextStr(const Context &ctx) +TQString KJSDebugWin::contextStr(const Context &ctx) { - QString str = ""; + TQString str = ""; SourceFragment *sourceFragment = m_sourceFragments[ctx.sourceId()]; - QString url = sourceFragment->sourceFile->url; + TQString url = sourceFragment->sourceFile->url; int fileLineno = sourceFragment->baseLine+ctx.curStmtFirstLine()-1; switch (ctx.codeType()) { case GlobalCode: - str = QString("Global code at %1:%2").arg(url).arg(fileLineno); + str = TQString("Global code at %1:%2").arg(url).arg(fileLineno); break; case EvalCode: - str = QString("Eval code at %1:%2").arg(url).arg(fileLineno); + str = TQString("Eval code at %1:%2").arg(url).arg(fileLineno); break; case FunctionCode: if (!ctx.functionName().isNull()) - str = QString("%1() at %2:%3").arg(ctx.functionName().qstring()).arg(url).arg(fileLineno); + str = TQString("%1() at %2:%3").arg(ctx.functionName().qstring()).arg(url).arg(fileLineno); else - str = QString("Anonymous function at %1:%2").arg(url).arg(fileLineno); + str = TQString("Anonymous function at %1:%2").arg(url).arg(fileLineno); break; } diff --git a/khtml/ecma/kjs_debugwin.h b/khtml/ecma/kjs_debugwin.h index 5a2ce2f1f..d48f8b040 100644 --- a/khtml/ecma/kjs_debugwin.h +++ b/khtml/ecma/kjs_debugwin.h @@ -21,21 +21,21 @@ #ifndef _KJS_DEBUGGER_H_ #define _KJS_DEBUGGER_H_ -#include <qglobal.h> +#include <tqglobal.h> #define KJS_DEBUGGER #ifdef KJS_DEBUGGER -#include <qwidget.h> -#include <qmultilineedit.h> -#include <qpixmap.h> -#include <qptrlist.h> -#include <qptrstack.h> -#include <qcheckbox.h> +#include <tqwidget.h> +#include <tqmultilineedit.h> +#include <tqpixmap.h> +#include <tqptrlist.h> +#include <tqptrstack.h> +#include <tqcheckbox.h> #include <kdialogbase.h> #include <kmainwindow.h> -#include <qscrollview.h> +#include <tqscrollview.h> #include <kjs/debugger.h> @@ -55,11 +55,11 @@ namespace KJS { class SourceFile : public DOM::DomShared { public: - SourceFile(QString u, QString c, Interpreter *interp) + SourceFile(TQString u, TQString c, Interpreter *interp) : url(u), code(c), interpreter(interp) {} - QString getCode(); - QString url; - QString code; + TQString getCode(); + TQString url; + TQString code; Interpreter *interpreter; }; @@ -96,7 +96,7 @@ namespace KJS { class KJSErrorDialog : public KDialogBase { Q_OBJECT public: - KJSErrorDialog(QWidget *parent, const QString& errorMessage, bool showDebug); + KJSErrorDialog(TQWidget *parent, const TQString& errorMessage, bool showDebug); virtual ~KJSErrorDialog(); bool debugSelected() const { return m_debugSelected; } @@ -106,25 +106,25 @@ namespace KJS { virtual void slotUser1(); private: - QCheckBox *m_dontShowAgainCb; + TQCheckBox *m_dontShowAgainCb; bool m_debugSelected; }; - class EvalMultiLineEdit : public QMultiLineEdit { + class EvalMultiLineEdit : public TQMultiLineEdit { Q_OBJECT public: - EvalMultiLineEdit(QWidget *parent); - const QString & code() const { return m_code; } + EvalMultiLineEdit(TQWidget *parent); + const TQString & code() const { return m_code; } protected: - void keyPressEvent(QKeyEvent * e); + void keyPressEvent(TQKeyEvent * e); private: - QString m_code; + TQString m_code; }; - class SourceDisplay : public QScrollView { + class SourceDisplay : public TQScrollView { Q_OBJECT public: - SourceDisplay(KJSDebugWin *debugWin, QWidget *parent, const char *name = 0); + SourceDisplay(KJSDebugWin *debugWin, TQWidget *parent, const char *name = 0); ~SourceDisplay(); void setSource(SourceFile *sourceFile); @@ -134,18 +134,18 @@ namespace KJS { void lineDoubleClicked(int lineno); protected: - virtual void contentsMousePressEvent(QMouseEvent *e); - virtual void showEvent(QShowEvent *); - virtual void drawContents(QPainter *p, int clipx, int clipy, int clipw, int cliph); + virtual void contentsMousePressEvent(TQMouseEvent *e); + virtual void showEvent(TQShowEvent *); + virtual void drawContents(TQPainter *p, int clipx, int clipy, int clipw, int cliph); - QString m_source; + TQString m_source; int m_currentLine; SourceFile *m_sourceFile; - QStringList m_lines; + TQStringList m_lines; KJSDebugWin *m_debugWin; - QFont m_font; - QPixmap m_breakpointIcon; + TQFont m_font; + TQPixmap m_breakpointIcon; }; /** @@ -162,7 +162,7 @@ namespace KJS { Q_OBJECT friend class SourceDisplay; public: - KJSDebugWin(QWidget *parent=0, const char *name=0); + KJSDebugWin(TQWidget *parent=0, const char *name=0); virtual ~KJSDebugWin(); static KJSDebugWin *createInstance(); @@ -178,8 +178,8 @@ namespace KJS { }; void setSourceLine(int sourceId, int lineno); - void setNextSourceInfo(QString url, int baseLine); - void sourceChanged(Interpreter *interpreter, QString url); + void setNextSourceInfo(TQString url, int baseLine); + void sourceChanged(Interpreter *interpreter, TQString url); bool inSession() const { return !m_execStates.isEmpty(); } void setMode(Mode m) { m_mode = m; } void clearInterpreter(Interpreter *interpreter); @@ -207,16 +207,16 @@ namespace KJS { protected: - void closeEvent(QCloseEvent *e); - bool eventFilter(QObject *obj, QEvent *evt); + void closeEvent(TQCloseEvent *e); + bool eventFilter(TQObject *obj, TQEvent *evt); void disableOtherWindows(); void enableOtherWindows(); private: - SourceFile *getSourceFile(Interpreter *interpreter, QString url); - void setSourceFile(Interpreter *interpreter, QString url, SourceFile *sourceFile); - void removeSourceFile(Interpreter *interpreter, QString url); + SourceFile *getSourceFile(Interpreter *interpreter, TQString url); + void setSourceFile(Interpreter *interpreter, TQString url, SourceFile *sourceFile); + void removeSourceFile(Interpreter *interpreter, TQString url); void checkBreak(ExecState *exec); void enterSession(ExecState *exec); @@ -224,7 +224,7 @@ namespace KJS { void displaySourceFile(SourceFile *sourceFile, bool forceRefresh); void updateContextList(); - QString contextStr(const Context &ctx); + TQString contextStr(const Context &ctx); struct Breakpoint { int sourceId; @@ -247,23 +247,23 @@ namespace KJS { SourceFile *m_curSourceFile; Mode m_mode; - QString m_nextSourceUrl; + TQString m_nextSourceUrl; int m_nextSourceBaseLine; - QPtrStack<ExecState> m_execStates; + TQPtrStack<ExecState> m_execStates; ExecState **m_execs; int m_execsCount; int m_execsAlloc; int m_steppingDepth; - QMap<QString,SourceFile*> m_sourceFiles; /* maps url->SourceFile */ - QMap<int,SourceFragment*> m_sourceFragments; /* maps SourceId->SourceFragment */ - QPtrList<SourceFile> m_sourceSelFiles; /* maps combobox index->SourceFile */ + TQMap<TQString,SourceFile*> m_sourceFiles; /* maps url->SourceFile */ + TQMap<int,SourceFragment*> m_sourceFragments; /* maps SourceId->SourceFragment */ + TQPtrList<SourceFile> m_sourceSelFiles; /* maps combobox index->SourceFile */ KActionCollection *m_actionCollection; - QPixmap m_stopIcon; - QPixmap m_emptyIcon; + TQPixmap m_stopIcon; + TQPixmap m_emptyIcon; SourceDisplay *m_sourceDisplay; - QListBox *m_contextList; + TQListBox *m_contextList; KAction *m_stepAction; KAction *m_nextAction; @@ -271,7 +271,7 @@ namespace KJS { KAction *m_stopAction; KAction *m_breakAction; - QComboBox *m_sourceSel; + TQComboBox *m_sourceSel; EvalMultiLineEdit *m_evalEdit; int m_evalDepth; diff --git a/khtml/ecma/kjs_dom.cpp b/khtml/ecma/kjs_dom.cpp index 74a90a9d2..c96e99939 100644 --- a/khtml/ecma/kjs_dom.cpp +++ b/khtml/ecma/kjs_dom.cpp @@ -485,7 +485,7 @@ void DOMNode::putValueProperty(ExecState *exec, int token, const Value& value, i if (rend->style()->hidesOverflow()) rend->layer()->scrollToXOffset(value.toInt32(exec)); else if (rend->isRoot()) { - QScrollView* sview = node.ownerDocument().view(); + TQScrollView* sview = node.ownerDocument().view(); if (sview) sview->setContentsPos(value.toInt32(exec), sview->contentsY()); } @@ -496,7 +496,7 @@ void DOMNode::putValueProperty(ExecState *exec, int token, const Value& value, i if (rend->style()->hidesOverflow()) rend->layer()->scrollToYOffset(value.toInt32(exec)); else if (rend->isRoot()) { - QScrollView* sview = node.ownerDocument().view(); + TQScrollView* sview = node.ownerDocument().view(); if (sview) sview->setContentsPos(sview->contentsX(), value.toInt32(exec)); } @@ -1091,7 +1091,7 @@ Value DOMDocumentProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List KHTMLPart *khtmlpart = ::qt_cast<KHTMLPart *>(active->part()); if (khtmlpart) { // Security: only allow documents to be loaded from the same host - QString dstUrl = khtmlpart->htmlDocument().completeURL(s).string(); + TQString dstUrl = khtmlpart->htmlDocument().completeURL(s).string(); KParts::ReadOnlyPart *part = static_cast<KJS::ScriptInterpreter*>(exec->interpreter())->part(); if (part->url().host() == KURL(dstUrl).host()) { kdDebug(6070) << "JavaScript: access granted for document.load() of " << dstUrl << endl; @@ -1702,7 +1702,7 @@ const ClassInfo KJS::DOMNamedNodesCollection::info = { "DOMNamedNodesCollection" // Such a collection is usually very short-lived, it only exists // for constructs like document.forms.<name>[1], // so it shouldn't be a problem that it's storing all the nodes (with the same name). (David) -DOMNamedNodesCollection::DOMNamedNodesCollection(ExecState *exec, const QValueList<DOM::Node>& nodes ) +DOMNamedNodesCollection::DOMNamedNodesCollection(ExecState *exec, const TQValueList<DOM::Node>& nodes ) : DOMObject(exec->interpreter()->builtinObjectPrototype()), m_nodes(nodes) { diff --git a/khtml/ecma/kjs_dom.h b/khtml/ecma/kjs_dom.h index e6b593fdb..b17488592 100644 --- a/khtml/ecma/kjs_dom.h +++ b/khtml/ecma/kjs_dom.h @@ -257,14 +257,14 @@ namespace KJS { // when multiple nodes have the same name. class DOMNamedNodesCollection : public DOMObject { public: - DOMNamedNodesCollection(ExecState *exec, const QValueList<DOM::Node>& nodes ); + DOMNamedNodesCollection(ExecState *exec, const TQValueList<DOM::Node>& nodes ); virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const; virtual const ClassInfo* classInfo() const { return &info; } static const ClassInfo info; - const QValueList<DOM::Node>& nodes() const { return m_nodes; } + const TQValueList<DOM::Node>& nodes() const { return m_nodes; } enum { Length }; private: - QValueList<DOM::Node> m_nodes; + TQValueList<DOM::Node> m_nodes; }; class DOMCharacterData : public DOMNode { diff --git a/khtml/ecma/kjs_events.cpp b/khtml/ecma/kjs_events.cpp index 8ebda7193..1144e723b 100644 --- a/khtml/ecma/kjs_events.cpp +++ b/khtml/ecma/kjs_events.cpp @@ -102,8 +102,8 @@ void JSEventListener::handleEvent(DOM::Event &evt) exec->clearException(); else if (html) { - QVariant ret = ValueToVariant(exec, retval); - if (ret.type() == QVariant::Bool && ret.toBool() == false) + TQVariant ret = ValueToVariant(exec, retval); + if (ret.type() == TQVariant::Bool && ret.toBool() == false) evt.preventDefault(); } window->afterScriptExecution(); @@ -124,7 +124,7 @@ Object JSEventListener::listenerObj() const return listener; } -JSLazyEventListener::JSLazyEventListener(const QString &_code, const QString &_name, const Object &_win, DOM::NodeImpl* _originalNode) +JSLazyEventListener::JSLazyEventListener(const TQString &_code, const TQString &_name, const Object &_win, DOM::NodeImpl* _originalNode) : JSEventListener(Object(), 0, _win, true), code(_code), name(_name), parsed(false) @@ -211,7 +211,7 @@ void JSLazyEventListener::parseCode() const } // no more need to keep the unparsed code around - code = QString(); + code = TQString(); if (listener.isValid()) { static_cast<Window*>(win.imp())->jsEventListeners.insert(listener.imp(), diff --git a/khtml/ecma/kjs_events.h b/khtml/ecma/kjs_events.h index 9fedfe594..e48276031 100644 --- a/khtml/ecma/kjs_events.h +++ b/khtml/ecma/kjs_events.h @@ -72,15 +72,15 @@ namespace KJS { class JSLazyEventListener : public JSEventListener { public: - JSLazyEventListener(const QString &_code, const QString &_name, const Object &_win, DOM::NodeImpl* node); + JSLazyEventListener(const TQString &_code, const TQString &_name, const Object &_win, DOM::NodeImpl* node); ~JSLazyEventListener(); virtual void handleEvent(DOM::Event &evt); Object listenerObj() const; private: void parseCode() const; - mutable QString code; - mutable QString name; + mutable TQString code; + mutable TQString name; mutable bool parsed; DOM::NodeImpl *originalNode; }; diff --git a/khtml/ecma/kjs_html.cpp b/khtml/ecma/kjs_html.cpp index 94f89079f..57762ffd3 100644 --- a/khtml/ecma/kjs_html.cpp +++ b/khtml/ecma/kjs_html.cpp @@ -1167,7 +1167,7 @@ Value KJS::HTMLElement::tryGet(ExecState *exec, const Identifier &propertyName) case ID_OBJECT: case ID_EMBED: { KParts::LiveConnectExtension *lc = getLiveConnectExtension(element); - QString rvalue; + TQString rvalue; KParts::LiveConnectExtension::Type rtype; unsigned long robjid; if (lc && lc->get(0, propertyName.qstring(), rtype, robjid, rvalue)) @@ -1586,13 +1586,13 @@ Value KJS::HTMLElement::getValueProperty(ExecState *exec, int token) const if (url.port()==0) return String(url.host()); else - return String(url.host() + ":" + QString::number(url.port())); + return String(url.host() + ":" + TQString::number(url.port())); } case AnchorPathName: return String(KURL(anchor.href().string()).path()); - case AnchorPort: return String(QString::number(KURL(anchor.href().string()).port())); + case AnchorPort: return String(TQString::number(KURL(anchor.href().string()).port())); case AnchorProtocol: return String(KURL(anchor.href().string()).protocol()+":"); case AnchorSearch: { KURL u(anchor.href().string()); - QString q = u.query(); + TQString q = u.query(); if (q.length() == 1) return String(); return String(q); } @@ -1713,7 +1713,7 @@ Value KJS::HTMLElement::getValueProperty(ExecState *exec, int token) const if ( !href.isNull() ) { url = doc.completeURL( href ).string(); if ( href.isEmpty() ) - url.setFileName( QString::null ); // href="" clears the filename (in IE) + url.setFileName( TQString::null ); // href="" clears the filename (in IE) } switch(token) { case AreaHref: @@ -1724,12 +1724,12 @@ Value KJS::HTMLElement::getValueProperty(ExecState *exec, int token) const if (url.port()==0) return String(url.host()); else - return String(url.host() + ":" + QString::number(url.port())); + return String(url.host() + ":" + TQString::number(url.port())); } case AreaPathName: { return String(url.path()); } - case AreaPort: return String(QString::number(url.port())); + case AreaPort: return String(TQString::number(url.port())); case AreaProtocol: return String(url.isEmpty() ? "" : url.protocol()+":"); case AreaSearch: return String(url.query()); } @@ -2002,13 +2002,13 @@ UString KJS::HTMLElement::toString(ExecState *exec) const return UString(static_cast<const DOM::HTMLAnchorElement&>(node).href()); else if (node.elementId() == ID_APPLET) { KParts::LiveConnectExtension *lc = getLiveConnectExtension(node); - QStringList qargs; - QString retvalue; + TQStringList qargs; + TQString retvalue; KParts::LiveConnectExtension::Type rettype; unsigned long retobjid; if (lc && lc->call(0, "hashCode", qargs, rettype, retobjid, retvalue)) { - QString str("[object APPLET ref="); - return UString(str + retvalue + QString("]")); + TQString str("[object APPLET ref="); + return UString(str + retvalue + TQString("]")); } } else if (node.elementId() == ID_IMG) { DOM::HTMLImageElement image(node); @@ -2134,12 +2134,12 @@ Value KJS::HTMLElementFunction::tryCall(ExecState *exec, Object &thisObj, const block = true; // if this is a form without a target, or a special target, don't block - QString trg = form.target().lower().string(); + TQString trg = form.target().lower().string(); if( trg.isEmpty() || trg == "_top" || trg == "_self" || trg == "_parent") block = false; - QString caption; + TQString caption; // if there is a frame with the target name, don't block if ( view && view->part() ) { @@ -2831,7 +2831,7 @@ void KJS::HTMLElement::putValueProperty(ExecState *exec, int token, const Value& case AnchorHref: { anchor.setHref(str); return; } case AnchorHrefLang: { anchor.setHreflang(str); return; } case AnchorSearch: { KURL href(anchor.href().string()); - QString q = str.isEmpty() ? QString() : str.string(); + TQString q = str.isEmpty() ? TQString() : str.string(); href.setQuery(q); anchor.setHref(href.url()); return; } case AnchorName: { anchor.setName(str); return; } @@ -3607,7 +3607,7 @@ Value KJS::HTMLCollection::getNamedItems(ExecState *exec, const Identifier &prop DOM::DOMString pstr = propertyName.string(); - QValueList<DOM::NodeImpl*> matches = collection.handle()->namedItems(pstr); + TQValueList<DOM::NodeImpl*> matches = collection.handle()->namedItems(pstr); if (!matches.isEmpty()) { if (matches.size() == 1) { @@ -3619,8 +3619,8 @@ Value KJS::HTMLCollection::getNamedItems(ExecState *exec, const Identifier &prop } else { // multiple items, return a collection - QValueList<DOM::Node> nodes; - for (QValueList<DOM::NodeImpl*>::const_iterator i = matches.begin(); + TQValueList<DOM::Node> nodes; + for (TQValueList<DOM::NodeImpl*>::const_iterator i = matches.begin(); i != matches.end(); ++i) nodes.append(DOM::Node(*i)); #ifdef KJS_VERBOSE @@ -3824,7 +3824,7 @@ Value KJS::HTMLSelectCollectionProtoFunc::tryCall(ExecState *exec, Object &thisO } else { //Find what to prepend before.. DOM::HTMLSelectElementImpl* impl = static_cast<HTMLSelectElementImpl*>(element.handle()); - QMemArray<HTMLGenericFormElementImpl*> items = impl->listItems(); + TQMemArray<HTMLGenericFormElementImpl*> items = impl->listItems(); int dummy; impl->insertBefore(option.handle(), items.at(pos), dummy); } diff --git a/khtml/ecma/kjs_mozilla.cpp b/khtml/ecma/kjs_mozilla.cpp index 4b1520b9a..1a5555c42 100644 --- a/khtml/ecma/kjs_mozilla.cpp +++ b/khtml/ecma/kjs_mozilla.cpp @@ -73,9 +73,9 @@ Value MozillaSidebarExtensionFunc::tryCall(ExecState *exec, Object &thisObj, con // addPanel() id == 0 KParts::BrowserExtension *ext = part->browserExtension(); if (ext) { - QString url, name; + TQString url, name; if (args.size() == 1) { // I've seen this, don't know if it's legal. - name = QString::null; + name = TQString::null; url = args[0].toString(exec).qstring(); } else if (args.size() == 2 || args.size() == 3) { name = args[0].toString(exec).qstring(); diff --git a/khtml/ecma/kjs_navigator.cpp b/khtml/ecma/kjs_navigator.cpp index d962cac36..a5c793357 100644 --- a/khtml/ecma/kjs_navigator.cpp +++ b/khtml/ecma/kjs_navigator.cpp @@ -53,21 +53,21 @@ namespace KJS { struct PluginInfo; struct MimeClassInfo { - QString type; - QString desc; - QString suffixes; + TQString type; + TQString desc; + TQString suffixes; PluginInfo *plugin; }; struct PluginInfo { - QString name; - QString file; - QString desc; - QPtrList<MimeClassInfo> mimes; + TQString name; + TQString file; + TQString desc; + TQPtrList<MimeClassInfo> mimes; }; - static QPtrList<PluginInfo> *plugins; - static QPtrList<MimeClassInfo> *mimes; + static TQPtrList<PluginInfo> *plugins; + static TQPtrList<MimeClassInfo> *mimes; private: static int m_refCount; @@ -83,7 +83,7 @@ namespace KJS { Value getValueProperty(ExecState *exec, int token) const; virtual const ClassInfo* classInfo() const { return &info; } static const ClassInfo info; - Value pluginByName( ExecState* exec, const QString& name ) const; + Value pluginByName( ExecState* exec, const TQString& name ) const; bool pluginsEnabled() const { return m_pluginsEnabled; }; private: bool m_pluginsEnabled; @@ -99,7 +99,7 @@ namespace KJS { virtual const ClassInfo* classInfo() const { return &info; } static const ClassInfo info; Value getValueProperty(ExecState *exec, int token) const; - Value mimeTypeByName( ExecState* exec, const QString& name ) const; + Value mimeTypeByName( ExecState* exec, const TQString& name ) const; bool pluginsEnabled() const { return m_pluginsEnabled; }; private: bool m_pluginsEnabled; @@ -114,7 +114,7 @@ namespace KJS { virtual Value get(ExecState *exec, const Identifier &propertyName) const; virtual const ClassInfo* classInfo() const { return &info; } static const ClassInfo info; - Value mimeByName(ExecState* exec, const QString& name ) const; + Value mimeByName(ExecState* exec, const TQString& name ) const; Value getValueProperty(ExecState *exec, int token) const; PluginBase::PluginInfo *pluginInfo() const { return m_info; } private: @@ -138,8 +138,8 @@ namespace KJS { } -QPtrList<PluginBase::PluginInfo> *KJS::PluginBase::plugins = 0; -QPtrList<PluginBase::MimeClassInfo> *KJS::PluginBase::mimes = 0; +TQPtrList<PluginBase::PluginInfo> *KJS::PluginBase::plugins = 0; +TQPtrList<PluginBase::MimeClassInfo> *KJS::PluginBase::mimes = 0; int KJS::PluginBase::m_refCount = 0; const ClassInfo Navigator::info = { "Navigator", 0, &NavigatorTable, 0 }; @@ -179,7 +179,7 @@ Value Navigator::get(ExecState *exec, const Identifier &propertyName) const Value Navigator::getValueProperty(ExecState *exec, int token) const { KURL url = m_part->url(); - QString userAgent = url.host(); + TQString userAgent = url.host(); if (userAgent.isEmpty()) userAgent = "localhost"; userAgent = KProtocolManager::userAgentForHost(userAgent); @@ -188,14 +188,14 @@ Value Navigator::getValueProperty(ExecState *exec, int token) const return String("Mozilla"); case AppName: // If we find "Mozilla" but not "(compatible, ...)" we are a real Netscape - if (userAgent.find(QString::fromLatin1("Mozilla")) >= 0 && - userAgent.find(QString::fromLatin1("compatible")) == -1) + if (userAgent.find(TQString::fromLatin1("Mozilla")) >= 0 && + userAgent.find(TQString::fromLatin1("compatible")) == -1) { //kdDebug() << "appName -> Mozilla" << endl; return String("Netscape"); } - if (userAgent.find(QString::fromLatin1("Microsoft")) >= 0 || - userAgent.find(QString::fromLatin1("MSIE")) >= 0) + if (userAgent.find(TQString::fromLatin1("Microsoft")) >= 0 || + userAgent.find(TQString::fromLatin1("MSIE")) >= 0) { //kdDebug() << "appName -> IE" << endl; return String("Microsoft Internet Explorer"); @@ -207,14 +207,14 @@ Value Navigator::getValueProperty(ExecState *exec, int token) const return String(userAgent.mid(userAgent.find('/') + 1)); case Product: // We are pretending to be Mozilla or Safari - if (userAgent.find(QString::fromLatin1("Mozilla")) >= 0 && - userAgent.find(QString::fromLatin1("compatible")) == -1) + if (userAgent.find(TQString::fromLatin1("Mozilla")) >= 0 && + userAgent.find(TQString::fromLatin1("compatible")) == -1) { return String("Gecko"); } // When spoofing as IE, we use Undefined(). - if (userAgent.find(QString::fromLatin1("Microsoft")) >= 0 || - userAgent.find(QString::fromLatin1("MSIE")) >= 0) + if (userAgent.find(TQString::fromLatin1("Microsoft")) >= 0 || + userAgent.find(TQString::fromLatin1("MSIE")) >= 0) { return Undefined(); } @@ -223,8 +223,8 @@ Value Navigator::getValueProperty(ExecState *exec, int token) const case ProductSub: { int ix = userAgent.find("Gecko"); - if (ix >= 0 && userAgent.length() >= (uint)ix+14 && userAgent.unicode()[ix+5] == QChar('/') && - userAgent.find(QRegExp("\\d{8}"), ix+6) == ix+6) + if (ix >= 0 && userAgent.length() >= (uint)ix+14 && userAgent.unicode()[ix+5] == TQChar('/') && + userAgent.find(TQRegExp("\\d{8}"), ix+6) == ix+6) { // We have Gecko/<productSub> in the UA string return String(userAgent.mid(ix+6, 8)); @@ -245,19 +245,19 @@ Value Navigator::getValueProperty(ExecState *exec, int token) const return String(userAgent); case Platform: // yet another evil hack, but necessary to spoof some sites... - if ( (userAgent.find(QString::fromLatin1("Win"),0,false)>=0) ) - return String(QString::fromLatin1("Win32")); - else if ( (userAgent.find(QString::fromLatin1("Macintosh"),0,false)>=0) || - (userAgent.find(QString::fromLatin1("Mac_PowerPC"),0,false)>=0) ) - return String(QString::fromLatin1("MacPPC")); + if ( (userAgent.find(TQString::fromLatin1("Win"),0,false)>=0) ) + return String(TQString::fromLatin1("Win32")); + else if ( (userAgent.find(TQString::fromLatin1("Macintosh"),0,false)>=0) || + (userAgent.find(TQString::fromLatin1("Mac_PowerPC"),0,false)>=0) ) + return String(TQString::fromLatin1("MacPPC")); else { struct utsname name; int ret = uname(&name); if ( ret >= 0 ) - return String(QString::fromLatin1("%1 %1 X11").arg(name.sysname).arg(name.machine)); + return String(TQString::fromLatin1("%1 %1 X11").arg(name.sysname).arg(name.machine)); else // can't happen - return String(QString::fromLatin1("Unix X11")); + return String(TQString::fromLatin1("Unix X11")); } case CpuClass: { @@ -286,8 +286,8 @@ PluginBase::PluginBase(ExecState *exec, bool loadPluginInfo) : ObjectImp(exec->interpreter()->builtinObjectPrototype() ) { if ( loadPluginInfo && !plugins ) { - plugins = new QPtrList<PluginInfo>; - mimes = new QPtrList<MimeClassInfo>; + plugins = new TQPtrList<PluginInfo>; + mimes = new TQPtrList<MimeClassInfo>; plugins->setAutoDelete( true ); mimes->setAutoDelete( true ); @@ -296,11 +296,11 @@ PluginBase::PluginBase(ExecState *exec, bool loadPluginInfo) KTrader::OfferList::iterator it; for ( it = offers.begin(); it != offers.end(); ++it ) { - QVariant pluginsinfo = (**it).property( "X-KDE-BrowserView-PluginsInfo" ); + TQVariant pluginsinfo = (**it).property( "X-KDE-BrowserView-PluginsInfo" ); if ( !pluginsinfo.isValid() ) { // <backwards compatible> - if ((**it).library() == QString("libnsplugin")) - pluginsinfo = QVariant("nsplugins/pluginsinfo"); + if ((**it).library() == TQString("libnsplugin")) + pluginsinfo = TQVariant("nsplugins/pluginsinfo"); else // </backwards compatible> continue; @@ -309,7 +309,7 @@ PluginBase::PluginBase(ExecState *exec, bool loadPluginInfo) KConfig kc( locate ("data", pluginsinfo.toString()) ); unsigned num = (unsigned int) kc.readNumEntry("number"); for ( unsigned n = 0; n < num; n++ ) { - kc.setGroup( QString::number(n) ); + kc.setGroup( TQString::number(n) ); PluginInfo *plugin = new PluginInfo; plugin->name = kc.readEntry("name"); @@ -319,17 +319,17 @@ PluginBase::PluginBase(ExecState *exec, bool loadPluginInfo) plugins->append( plugin ); // get mime types from string - QStringList types = QStringList::split( ';', kc.readEntry("mime") ); - QStringList::Iterator type; + TQStringList types = TQStringList::split( ';', kc.readEntry("mime") ); + TQStringList::Iterator type; for ( type=types.begin(); type!=types.end(); ++type ) { // get mime information - QStringList tokens = QStringList::split(':', *type, true); + TQStringList tokens = TQStringList::split(':', *type, true); if ( tokens.count() < 3 ) // we need 3 items continue; MimeClassInfo *mime = new MimeClassInfo; - QStringList::Iterator token = tokens.begin(); + TQStringList::Iterator token = tokens.begin(); mime->type = (*token).lower(); //kdDebug(6070) << "mime->type=" << mime->type << endl; ++token; @@ -405,7 +405,7 @@ Value Plugins::get(ExecState *exec, const Identifier &propertyName) const return lookupGet<PluginsFunc,Plugins,ObjectImp>(exec,propertyName,&PluginsTable,this); } -Value Plugins::pluginByName( ExecState* exec, const QString& name ) const +Value Plugins::pluginByName( ExecState* exec, const TQString& name ) const { Q_ASSERT(plugins); for ( PluginInfo *pl = plugins->first(); pl!=0; pl = plugins->next() ) { @@ -490,7 +490,7 @@ Value MimeTypes::get(ExecState *exec, const Identifier &propertyName) const return lookupGet<MimeTypesFunc,MimeTypes,ObjectImp>(exec,propertyName,&MimeTypesTable,this); } -Value MimeTypes::mimeTypeByName( ExecState* exec, const QString& name ) const +Value MimeTypes::mimeTypeByName( ExecState* exec, const TQString& name ) const { //kdDebug(6070) << "MimeTypes[" << name << "]" << endl; Q_ASSERT(mimes); @@ -574,7 +574,7 @@ Value Plugin::get(ExecState *exec, const Identifier &propertyName) const return lookupGet<PluginFunc,Plugin,ObjectImp>(exec, propertyName, &PluginTable, this ); } -Value Plugin::mimeByName(ExecState* exec, const QString& name) const +Value Plugin::mimeByName(ExecState* exec, const TQString& name) const { for ( PluginBase::MimeClassInfo *m = m_info->mimes.first(); m != 0; m = m_info->mimes.next() ) { diff --git a/khtml/ecma/kjs_proxy.cpp b/khtml/ecma/kjs_proxy.cpp index 789f99f38..ca26c5a0b 100644 --- a/khtml/ecma/kjs_proxy.cpp +++ b/khtml/ecma/kjs_proxy.cpp @@ -60,10 +60,10 @@ class KJSProxyImpl : public KJSProxy { public: KJSProxyImpl(khtml::ChildFrame *frame); virtual ~KJSProxyImpl(); - virtual QVariant evaluate(QString filename, int baseLine, const QString &, const DOM::Node &n, + virtual TQVariant evaluate(TQString filename, int baseLine, const TQString &, const DOM::Node &n, Completion *completion = 0); virtual void clear(); - virtual DOM::EventListener *createHTMLEventHandler(QString sourceUrl, QString name, QString code, DOM::NodeImpl *node); + virtual DOM::EventListener *createHTMLEventHandler(TQString sourceUrl, TQString name, TQString code, DOM::NodeImpl *node); virtual void finishedWithEvent(const DOM::Event &event); virtual KJS::Interpreter *interpreter(); @@ -128,8 +128,8 @@ KJSProxyImpl::~KJSProxyImpl() #endif } -QVariant KJSProxyImpl::evaluate(QString filename, int baseLine, - const QString&str, const DOM::Node &n, Completion *completion) { +TQVariant KJSProxyImpl::evaluate(TQString filename, int baseLine, + const TQString&str, const DOM::Node &n, Completion *completion) { // evaluate code. Returns the JS return value or an invalid QVariant // if there was none, an error occurred or the type couldn't be converted. @@ -170,7 +170,7 @@ QVariant KJSProxyImpl::evaluate(QString filename, int baseLine, *completion = comp; #ifdef KJS_DEBUGGER - // KJSDebugWin::debugWindow()->setCode(QString::null); + // KJSDebugWin::debugWindow()->setCode(TQString::null); #endif window->afterScriptExecution(); @@ -185,7 +185,7 @@ QVariant KJSProxyImpl::evaluate(QString filename, int baseLine, UString msg = comp.value().toString(m_script->globalExec()); kdDebug(6070) << "WARNING: Script threw exception: " << msg.qstring() << endl; } - return QVariant(); + return TQVariant(); } } @@ -237,7 +237,7 @@ void KJSProxyImpl::clear() { } } -DOM::EventListener *KJSProxyImpl::createHTMLEventHandler(QString sourceUrl, QString name, QString code, DOM::NodeImpl *node) +DOM::EventListener *KJSProxyImpl::createHTMLEventHandler(TQString sourceUrl, TQString name, TQString code, DOM::NodeImpl *node) { initScript(); @@ -341,10 +341,10 @@ void KJSProxyImpl::initScript() void KJSProxyImpl::applyUserAgent() { assert( m_script ); - QString host = m_frame->m_part->url().isLocalFile() ? "localhost" : m_frame->m_part->url().host(); - QString userAgent = KProtocolManager::userAgentForHost(host); - if (userAgent.find(QString::fromLatin1("Microsoft")) >= 0 || - userAgent.find(QString::fromLatin1("MSIE")) >= 0) + TQString host = m_frame->m_part->url().isLocalFile() ? "localhost" : m_frame->m_part->url().host(); + TQString userAgent = KProtocolManager::userAgentForHost(host); + if (userAgent.find(TQString::fromLatin1("Microsoft")) >= 0 || + userAgent.find(TQString::fromLatin1("MSIE")) >= 0) { m_script->setCompatMode(Interpreter::IECompat); #ifdef KJS_VERBOSE @@ -353,9 +353,9 @@ void KJSProxyImpl::applyUserAgent() } else // If we find "Mozilla" but not "(compatible, ...)" we are a real Netscape - if (userAgent.find(QString::fromLatin1("Mozilla")) >= 0 && - userAgent.find(QString::fromLatin1("compatible")) == -1 && - userAgent.find(QString::fromLatin1("KHTML")) == -1) + if (userAgent.find(TQString::fromLatin1("Mozilla")) >= 0 && + userAgent.find(TQString::fromLatin1("compatible")) == -1 && + userAgent.find(TQString::fromLatin1("KHTML")) == -1) { m_script->setCompatMode(Interpreter::NetscapeCompat); #ifdef KJS_VERBOSE diff --git a/khtml/ecma/kjs_proxy.h b/khtml/ecma/kjs_proxy.h index f76543451..dde30b070 100644 --- a/khtml/ecma/kjs_proxy.h +++ b/khtml/ecma/kjs_proxy.h @@ -22,8 +22,8 @@ #ifndef _KJS_PROXY_H_ #define _KJS_PROXY_H_ -#include <qvariant.h> -#include <qstring.h> +#include <tqvariant.h> +#include <tqstring.h> #include <sys/time.h> class KHTMLPart; @@ -55,10 +55,10 @@ class KJSProxy { public: KJSProxy() { m_handlerLineno = 0; } virtual ~KJSProxy() { } - virtual QVariant evaluate(QString filename, int baseLine, const QString &, const DOM::Node &n, + virtual TQVariant evaluate(TQString filename, int baseLine, const TQString &, const DOM::Node &n, KJS::Completion *completion = 0) = 0; virtual void clear() = 0; - virtual DOM::EventListener *createHTMLEventHandler(QString sourceUrl, QString name, QString code, DOM::NodeImpl* node) = 0; + virtual DOM::EventListener *createHTMLEventHandler(TQString sourceUrl, TQString name, TQString code, DOM::NodeImpl* node) = 0; virtual void finishedWithEvent(const DOM::Event &event) = 0; virtual KJS::Interpreter *interpreter() = 0; diff --git a/khtml/ecma/kjs_window.cpp b/khtml/ecma/kjs_window.cpp index bc5a85e19..90123aec6 100644 --- a/khtml/ecma/kjs_window.cpp +++ b/khtml/ecma/kjs_window.cpp @@ -31,10 +31,10 @@ #include "html/html_documentimpl.h" #include "rendering/render_frames.h" -#include <qstylesheet.h> -#include <qtimer.h> -#include <qpaintdevicemetrics.h> -#include <qapplication.h> +#include <tqstylesheet.h> +#include <tqtimer.h> +#include <tqpaintdevicemetrics.h> +#include <tqapplication.h> #include <kdebug.h> #include <kmessagebox.h> #include <kinputdialog.h> @@ -52,8 +52,8 @@ #endif #include <kglobalsettings.h> #include <assert.h> -#include <qstyle.h> -#include <qobjectlist.h> +#include <tqstyle.h> +#include <tqobjectlist.h> #include <kstringhandler.h> #include "kjs_proxy.h" @@ -85,7 +85,7 @@ namespace KJS { static const ClassInfo info; enum { Back, Forward, Go, Length }; private: - QGuardedPtr<KHTMLPart> part; + TQGuardedPtr<KHTMLPart> part; }; class External : public ObjectImp { @@ -98,7 +98,7 @@ namespace KJS { static const ClassInfo info; enum { AddFavorite }; private: - QGuardedPtr<KHTMLPart> part; + TQGuardedPtr<KHTMLPart> part; }; class FrameArray : public ObjectImp { @@ -109,7 +109,7 @@ namespace KJS { virtual Value call(ExecState *exec, Object &thisObj, const List &args); virtual bool implementsCall() const { return true; } private: - QGuardedPtr<KHTMLPart> part; + TQGuardedPtr<KHTMLPart> part; }; #ifdef Q_WS_QWS @@ -121,7 +121,7 @@ namespace KJS { private: const Konqueror* konqueror; - QCString m_name; + TQCString m_name; }; #endif } // namespace KJS @@ -164,8 +164,8 @@ Value Screen::getValueProperty(ExecState *exec, int token) const #if defined Q_WS_X11 && ! defined K_WS_QTONLY KWinModule info(0, KWinModule::INFO_DESKTOP); #endif - QWidget *thisWidget = Window::retrieveActive(exec)->part()->widget(); - QRect sg = KGlobalSettings::desktopGeometry(thisWidget); + TQWidget *thisWidget = Window::retrieveActive(exec)->part()->widget(); + TQRect sg = KGlobalSettings::desktopGeometry(thisWidget); switch( token ) { case Height: @@ -174,12 +174,12 @@ Value Screen::getValueProperty(ExecState *exec, int token) const return Number(sg.width()); case ColorDepth: case PixelDepth: { - QPaintDeviceMetrics m(QApplication::desktop()); + TQPaintDeviceMetrics m(TQApplication::desktop()); return Number(m.depth()); } case AvailLeft: { #if defined Q_WS_X11 && ! defined K_WS_QTONLY - QRect clipped = info.workArea().intersect(sg); + TQRect clipped = info.workArea().intersect(sg); return Number(clipped.x()-sg.x()); #else return Number(10); @@ -187,7 +187,7 @@ Value Screen::getValueProperty(ExecState *exec, int token) const } case AvailTop: { #if defined Q_WS_X11 && ! defined K_WS_QTONLY - QRect clipped = info.workArea().intersect(sg); + TQRect clipped = info.workArea().intersect(sg); return Number(clipped.y()-sg.y()); #else return Number(10); @@ -195,7 +195,7 @@ Value Screen::getValueProperty(ExecState *exec, int token) const } case AvailHeight: { #if defined Q_WS_X11 && ! defined K_WS_QTONLY - QRect clipped = info.workArea().intersect(sg); + TQRect clipped = info.workArea().intersect(sg); return Number(clipped.height()); #else return Number(100); @@ -203,7 +203,7 @@ Value Screen::getValueProperty(ExecState *exec, int token) const } case AvailWidth: { #if defined Q_WS_X11 && ! defined K_WS_QTONLY - QRect clipped = info.workArea().intersect(sg); + TQRect clipped = info.workArea().intersect(sg); return Number(clipped.width()); #else return Number(100); @@ -520,14 +520,14 @@ bool Window::hasProperty(ExecState *exec, const Identifier &p) const if (!part) return false; - QString q = p.qstring(); + TQString q = p.qstring(); if (part->findFramePart(p.qstring())) return true; // allow window[1] or parent[1] etc. (#56983) bool ok; unsigned int i = p.toArrayIndex(&ok); if (ok) { - QPtrList<KParts::ReadOnlyPart> frames = part->frames(); + TQPtrList<KParts::ReadOnlyPart> frames = part->frames(); unsigned int len = frames.count(); if (i < len) return true; @@ -639,7 +639,7 @@ Value Window::get(ExecState *exec, const Identifier &p) const } } else if (!part) { // not a KHTMLPart - QString rvalue; + TQString rvalue; KParts::LiveConnectExtension::Type rtype; unsigned long robjid; if (m_frame->m_liveconnect && @@ -882,15 +882,15 @@ Value Window::get(ExecState *exec, const Identifier &p) const case ScreenX: { if (!part->view()) return Undefined(); - QRect sg = KGlobalSettings::desktopGeometry(part->view()); - return Number(part->view()->mapToGlobal(QPoint(0,0)).x() + sg.x()); + TQRect sg = KGlobalSettings::desktopGeometry(part->view()); + return Number(part->view()->mapToGlobal(TQPoint(0,0)).x() + sg.x()); } case ScreenTop: case ScreenY: { if (!part->view()) return Undefined(); - QRect sg = KGlobalSettings::desktopGeometry(part->view()); - return Number(part->view()->mapToGlobal(QPoint(0,0)).y() + sg.y()); + TQRect sg = KGlobalSettings::desktopGeometry(part->view()); + return Number(part->view()->mapToGlobal(TQPoint(0,0)).y() + sg.y()); } case ScrollX: { if (!part->view()) @@ -1010,7 +1010,7 @@ Value Window::get(ExecState *exec, const Identifier &p) const bool ok; unsigned int i = p.toArrayIndex(&ok); if (ok) { - QPtrList<KParts::ReadOnlyPart> frames = part->frames(); + TQPtrList<KParts::ReadOnlyPart> frames = part->frames(); unsigned int len = frames.count(); if (i < len) { KParts::ReadOnlyPart* frame = frames.at(i); @@ -1232,7 +1232,7 @@ void Window::scheduleClose() { kdDebug(6070) << "Window::scheduleClose window.close() " << m_frame << endl; Q_ASSERT(winq); - QTimer::singleShot( 0, winq, SLOT( timeoutClose() ) ); + TQTimer::singleShot( 0, winq, TQT_SLOT( timeoutClose() ) ); } void Window::closeNow() @@ -1256,9 +1256,9 @@ void Window::closeNow() void Window::afterScriptExecution() { DOM::DocumentImpl::updateDocumentsRendering(); - QValueList<DelayedAction> delayedActions = m_delayed; + TQValueList<DelayedAction> delayedActions = m_delayed; m_delayed.clear(); - QValueList<DelayedAction>::Iterator it = delayedActions.begin(); + TQValueList<DelayedAction>::Iterator it = delayedActions.begin(); for ( ; it != delayedActions.end() ; ++it ) { switch ((*it).actionId) { @@ -1393,7 +1393,7 @@ JSEventListener *Window::getJSEventListener(const Value& val, bool html) return new JSEventListener(listenerObject, listenerObjectImp, Object(this), html); } -JSLazyEventListener *Window::getJSLazyEventListener(const QString& code, const QString& name, DOM::NodeImpl *node) +JSLazyEventListener *Window::getJSLazyEventListener(const TQString& code, const TQString& name, DOM::NodeImpl *node) { return new JSLazyEventListener(code, name, Object(this), node); } @@ -1406,7 +1406,7 @@ void Window::clear( ExecState *exec ) deleteAllProperties( exec ); // Break the dependency between the listeners and their object - QPtrDictIterator<JSEventListener> it(jsEventListeners); + TQPtrDictIterator<JSEventListener> it(jsEventListeners); for (; it.current(); ++it) it.current()->clear(); // Forget about the listeners (the DOM::NodeImpls will delete them) @@ -1430,23 +1430,23 @@ void Window::setCurrentEvent( DOM::Event *evt ) //kdDebug(6070) << "Window " << this << " (part=" << m_part << ")::setCurrentEvent m_evt=" << evt << endl; } -void Window::goURL(ExecState* exec, const QString& url, bool lockHistory) +void Window::goURL(ExecState* exec, const TQString& url, bool lockHistory) { Window* active = Window::retrieveActive(exec); KHTMLPart *part = ::qt_cast<KHTMLPart *>(m_frame->m_part); KHTMLPart *active_part = ::qt_cast<KHTMLPart *>(active->part()); // Complete the URL using the "active part" (running interpreter) if (active_part && part) { - if (url[0] == QChar('#')) { + if (url[0] == TQChar('#')) { part->gotoAnchor(url.mid(1)); } else { - QString dstUrl = active_part->htmlDocument().completeURL(url).string(); + TQString dstUrl = active_part->htmlDocument().completeURL(url).string(); kdDebug(6070) << "Window::goURL dstUrl=" << dstUrl << endl; // check if we're allowed to inject javascript // SYNC check with khtml_part.cpp::slotRedirect! if ( isSafeScript(exec) || - dstUrl.find(QString::fromLatin1("javascript:"), 0, false) != 0 ) + dstUrl.find(TQString::fromLatin1("javascript:"), 0, false) != 0 ) part->scheduleRedirection(-1, dstUrl, lockHistory); @@ -1486,7 +1486,7 @@ void Window::goHistory( int steps ) //emit ext->goHistory(steps); } -void KJS::Window::resizeTo(QWidget* tl, int width, int height) +void KJS::Window::resizeTo(TQWidget* tl, int width, int height) { KHTMLPart *part = ::qt_cast<KHTMLPart *>(m_frame->m_part); if(!part) @@ -1504,7 +1504,7 @@ void KJS::Window::resizeTo(QWidget* tl, int width, int height) return; } - QRect sg = KGlobalSettings::desktopGeometry(tl); + TQRect sg = KGlobalSettings::desktopGeometry(tl); if ( width > sg.width() || height > sg.height() ) { kdDebug(6070) << "Window::resizeTo refused, window would be too big ("<<width<<","<<height<<")" << endl; @@ -1536,7 +1536,7 @@ Value Window::openWindow(ExecState *exec, const List& args) return Undefined(); KHTMLView *widget = part->view(); Value v = args[0]; - QString str; + TQString str; if (v.isValid() && !v.isA(UndefinedType)) str = v.toString(exec).qstring(); @@ -1556,7 +1556,7 @@ Value Window::openWindow(ExecState *exec, const List& args) part->settings()->windowOpenPolicy(part->url().host()); if ( policy == KHTMLSettings::KJSWindowOpenAsk ) { emit part->browserExtension()->requestFocus(part); - QString caption; + TQString caption; if (!part->url().host().isEmpty()) caption = part->url().host() + " - "; caption += i18n( "Confirmation: JavaScript Popup" ); @@ -1576,10 +1576,10 @@ Value Window::openWindow(ExecState *exec, const List& args) policy = KHTMLSettings::KJSWindowOpenAllow; } - QString frameName = args.size() > 1 ? args[1].toString(exec).qstring() : QString("_blank"); + TQString frameName = args.size() > 1 ? args[1].toString(exec).qstring() : TQString("_blank"); v = args[2]; - QString features; + TQString features; if (!v.isNull() && v.type() != UndefinedType && v.toString(exec).size() > 0) { features = v.toString(exec).qstring(); // Buggy scripts have ' at beginning and end, cut those @@ -1600,7 +1600,7 @@ Value Window::openWindow(ExecState *exec, const List& args) } } -Value Window::executeOpenWindow(ExecState *exec, const KURL& url, const QString& frameName, const QString& features) +Value Window::executeOpenWindow(ExecState *exec, const KURL& url, const TQString& frameName, const TQString& features) { KHTMLPart *p = ::qt_cast<KHTMLPart *>(m_frame->m_part); KHTMLView *widget = p->view(); @@ -1613,16 +1613,16 @@ Value Window::executeOpenWindow(ExecState *exec, const KURL& url, const QString& winargs.toolBarsVisible = false; winargs.statusBarVisible = false; winargs.scrollBarsVisible = false; - QStringList flist = QStringList::split(',', features); - QStringList::ConstIterator it = flist.begin(); + TQStringList flist = TQStringList::split(',', features); + TQStringList::ConstIterator it = flist.begin(); while (it != flist.end()) { - QString s = *it++; - QString key, val; + TQString s = *it++; + TQString key, val; int pos = s.find('='); if (pos >= 0) { key = s.left(pos).stripWhiteSpace().lower(); val = s.mid(pos + 1).stripWhiteSpace().lower(); - QRect screen = KGlobalSettings::desktopGeometry(widget->topLevelWidget()); + TQRect screen = KGlobalSettings::desktopGeometry(widget->topLevelWidget()); if (key == "left" || key == "screenx") { winargs.x = (int)val.toFloat() + screen.x(); @@ -1633,13 +1633,13 @@ Value Window::executeOpenWindow(ExecState *exec, const KURL& url, const QString& if (winargs.y < screen.y() || winargs.y > screen.bottom()) winargs.y = screen.y(); // only safe choice until size is determined } else if (key == "height") { - winargs.height = (int)val.toFloat() + 2*qApp->style().pixelMetric( QStyle::PM_DefaultFrameWidth ) + 2; + winargs.height = (int)val.toFloat() + 2*qApp->style().pixelMetric( TQStyle::PM_DefaultFrameWidth ) + 2; if (winargs.height > screen.height()) // should actually check workspace winargs.height = screen.height(); if (winargs.height < 100) winargs.height = 100; } else if (key == "width") { - winargs.width = (int)val.toFloat() + 2*qApp->style().pixelMetric( QStyle::PM_DefaultFrameWidth ) + 2; + winargs.width = (int)val.toFloat() + 2*qApp->style().pixelMetric( TQStyle::PM_DefaultFrameWidth ) + 2; if (winargs.width > screen.width()) // should actually check workspace winargs.width = screen.width(); if (winargs.width < 100) @@ -1718,9 +1718,9 @@ Value Window::executeOpenWindow(ExecState *exec, const KURL& url, const QString& khtmlpart->docImpl()->setBaseURL( p->docImpl()->baseURL() ); } } - uargs.serviceType = QString::null; + uargs.serviceType = TQString::null; if (uargs.frameName.lower() == "_blank") - uargs.frameName = QString::null; + uargs.frameName = TQString::null; if (!url.isEmpty()) emit khtmlpart->browserExtension()->openURLRequest(url,uargs); return Window::retrieve(khtmlpart); // global object @@ -1739,9 +1739,9 @@ void Window::showSuppressedWindows() KJS::Interpreter *interpreter = part->jScript()->interpreter(); ExecState *exec = interpreter->globalExec(); - QValueList<SuppressedWindowInfo> suppressedWindowInfo = m_suppressedWindowInfo; + TQValueList<SuppressedWindowInfo> suppressedWindowInfo = m_suppressedWindowInfo; m_suppressedWindowInfo.clear(); - QValueList<SuppressedWindowInfo>::Iterator it = suppressedWindowInfo.begin(); + TQValueList<SuppressedWindowInfo>::Iterator it = suppressedWindowInfo.begin(); for ( ; it != suppressedWindowInfo.end() ; ++it ) { executeOpenWindow(exec, (*it).url, (*it).frameName, (*it).features); } @@ -1758,7 +1758,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) } Window *window = static_cast<Window *>(thisObj.imp()); - QString str, str2; + TQString str, str2; KHTMLPart *part = ::qt_cast<KHTMLPart *>(window->m_frame->m_part); if (!part) @@ -1772,7 +1772,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) str = s.qstring(); } - QString caption; + TQString caption; if (part && !part->url().host().isEmpty()) caption = part->url().host() + " - "; caption += "JavaScript"; // TODO: i18n @@ -1785,7 +1785,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) part->xmlDocImpl()->updateRendering(); if ( part ) emit part->browserExtension()->requestFocus(part); - KMessageBox::error(widget, QStyleSheet::convertFromPlainText(str, QStyleSheetItem::WhiteSpaceNormal), caption); + KMessageBox::error(widget, TQStyleSheet::convertFromPlainText(str, TQStyleSheetItem::WhiteSpaceNormal), caption); return Undefined(); case Window::Confirm: if (!widget->dialogsAllowed()) @@ -1794,7 +1794,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) part->xmlDocImpl()->updateRendering(); if ( part ) emit part->browserExtension()->requestFocus(part); - return Boolean((KMessageBox::warningYesNo(widget, QStyleSheet::convertFromPlainText(str), caption, + return Boolean((KMessageBox::warningYesNo(widget, TQStyleSheet::convertFromPlainText(str), caption, KStdGuiItem::ok(), KStdGuiItem::cancel()) == KMessageBox::Yes)); case Window::Prompt: #ifndef KONQ_EMBEDDED @@ -1807,12 +1807,12 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) bool ok; if (args.size() >= 2) str2 = KInputDialog::getText(caption, - QStyleSheet::convertFromPlainText(str), + TQStyleSheet::convertFromPlainText(str), args[1].toString(exec).qstring(), &ok, widget); else str2 = KInputDialog::getText(caption, - QStyleSheet::convertFromPlainText(str), - QString::null, &ok, widget); + TQStyleSheet::convertFromPlainText(str), + TQString::null, &ok, widget); if ( ok ) return String(str2); else @@ -1911,7 +1911,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) case Window::AToB: { if (!s.is8Bit()) return Undefined(); - QByteArray in, out; + TQByteArray in, out; char *binData = s.ascii(); in.setRawData( binData, s.size() ); if (id == Window::AToB) @@ -1950,10 +1950,10 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) { KParts::BrowserExtension *ext = part->browserExtension(); if (ext) { - QWidget * tl = widget->topLevelWidget(); - QRect sg = KGlobalSettings::desktopGeometry(tl); + TQWidget * tl = widget->topLevelWidget(); + TQRect sg = KGlobalSettings::desktopGeometry(tl); - QPoint dest = tl->pos() + QPoint( args[0].toInt32(exec), args[1].toInt32(exec) ); + TQPoint dest = tl->pos() + TQPoint( args[0].toInt32(exec), args[1].toInt32(exec) ); // Security check (the spec talks about UniversalBrowserWrite to disable this check...) if ( dest.x() >= sg.x() && dest.y() >= sg.x() && dest.x()+tl->width() <= sg.width()+sg.x() && @@ -1970,10 +1970,10 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) { KParts::BrowserExtension *ext = part->browserExtension(); if (ext) { - QWidget * tl = widget->topLevelWidget(); - QRect sg = KGlobalSettings::desktopGeometry(tl); + TQWidget * tl = widget->topLevelWidget(); + TQRect sg = KGlobalSettings::desktopGeometry(tl); - QPoint dest( args[0].toInt32(exec)+sg.x(), args[1].toInt32(exec)+sg.y() ); + TQPoint dest( args[0].toInt32(exec)+sg.x(), args[1].toInt32(exec)+sg.y() ); // Security check (the spec talks about UniversalBrowserWrite to disable this check...) if ( dest.x() >= sg.x() && dest.y() >= sg.y() && dest.x()+tl->width() <= sg.width()+sg.x() && @@ -1989,8 +1989,8 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) if(policy == KHTMLSettings::KJSWindowResizeAllow && args.size() == 2 && widget) { - QWidget * tl = widget->topLevelWidget(); - QRect geom = tl->frameGeometry(); + TQWidget * tl = widget->topLevelWidget(); + TQRect geom = tl->frameGeometry(); window->resizeTo( tl, geom.width() + args[0].toInt32(exec), geom.height() + args[1].toInt32(exec) ); @@ -2003,7 +2003,7 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) if(policy == KHTMLSettings::KJSWindowResizeAllow && args.size() == 2 && widget) { - QWidget * tl = widget->topLevelWidget(); + TQWidget * tl = widget->topLevelWidget(); window->resizeTo( tl, args[0].toInt32(exec), args[1].toInt32(exec) ); } return Undefined(); @@ -2096,8 +2096,8 @@ ScheduledAction::ScheduledAction(Object _func, List _args, DateTimeMS _nextTime, timerId = _timerId; } -// KDE 4: Make it const QString & -ScheduledAction::ScheduledAction(QString _code, DateTimeMS _nextTime, int _interval, bool _singleShot, int _timerId) +// KDE 4: Make it const TQString & +ScheduledAction::ScheduledAction(TQString _code, DateTimeMS _nextTime, int _interval, bool _singleShot, int _timerId) { //kdDebug(6070) << "ScheduledAction::ScheduledAction(!isFunction) " << this << endl; //func = 0; @@ -2170,8 +2170,8 @@ WindowQObject::WindowQObject(Window *w) if ( !parent->m_frame ) kdDebug(6070) << "WARNING: null part in " << k_funcinfo << endl; else - connect( parent->m_frame, SIGNAL( destroyed() ), - this, SLOT( parentDestroyed() ) ); + connect( parent->m_frame, TQT_SIGNAL( destroyed() ), + this, TQT_SLOT( parentDestroyed() ) ); pausedTime = 0; lastTimerId = 0; currentlyDispatching = false; @@ -2187,7 +2187,7 @@ void WindowQObject::parentDestroyed() { killTimers(); - QPtrListIterator<ScheduledAction> it(scheduledActions); + TQPtrListIterator<ScheduledAction> it(scheduledActions); for (; it.current(); ++it) delete it.current(); scheduledActions.clear(); @@ -2222,7 +2222,7 @@ int WindowQObject::installTimeout(const Value &func, List args, int t, bool sing void WindowQObject::clearTimeout(int timerId) { - QPtrListIterator<ScheduledAction> it(scheduledActions); + TQPtrListIterator<ScheduledAction> it(scheduledActions); for (; it.current(); ++it) { ScheduledAction *action = it.current(); if (action->timerId == timerId) { @@ -2241,12 +2241,12 @@ bool WindowQObject::hasTimers() const void WindowQObject::mark() { - QPtrListIterator<ScheduledAction> it(scheduledActions); + TQPtrListIterator<ScheduledAction> it(scheduledActions); for (; it.current(); ++it) it.current()->mark(); } -void WindowQObject::timerEvent(QTimerEvent *) +void WindowQObject::timerEvent(TQTimerEvent *) { killTimers(); @@ -2261,14 +2261,14 @@ void WindowQObject::timerEvent(QTimerEvent *) // Work out which actions are to be executed. We take a separate copy of // this list since the main one may be modified during action execution - QPtrList<ScheduledAction> toExecute; - QPtrListIterator<ScheduledAction> it(scheduledActions); + TQPtrList<ScheduledAction> toExecute; + TQPtrListIterator<ScheduledAction> it(scheduledActions); for (; it.current(); ++it) if (currentAdjusted >= it.current()->nextTime) toExecute.append(it.current()); // ### verify that the window can't be closed (and action deleted) during execution - it = QPtrListIterator<ScheduledAction>(toExecute); + it = TQPtrListIterator<ScheduledAction>(toExecute); for (; it.current(); ++it) { ScheduledAction *action = it.current(); if (!scheduledActions.containsRef(action)) // removed by clearTimeout() @@ -2352,11 +2352,11 @@ int DateTimeMS::msecsTo(const DateTimeMS &other) const DateTimeMS DateTimeMS::now() { DateTimeMS t; - QTime before = QTime::currentTime(); - t.mDate = QDate::currentDate(); - t.mTime = QTime::currentTime(); + TQTime before = TQTime::currentTime(); + t.mDate = TQDate::currentDate(); + t.mTime = TQTime::currentTime(); if (t.mTime < before) - t.mDate = QDate::currentDate(); // prevent race condition in hacky way :) + t.mDate = TQDate::currentDate(); // prevent race condition in hacky way :) return t; } @@ -2368,7 +2368,7 @@ void WindowQObject::setNextTimer() if (scheduledActions.isEmpty()) return; - QPtrListIterator<ScheduledAction> it(scheduledActions); + TQPtrListIterator<ScheduledAction> it(scheduledActions); DateTimeMS nextTime = it.current()->nextTime; for (++it; it.current(); ++it) if (nextTime > it.current()->nextTime) @@ -2394,7 +2394,7 @@ Value FrameArray::get(ExecState *exec, const Identifier &p) const if (part.isNull()) return Undefined(); - QPtrList<KParts::ReadOnlyPart> frames = part->frames(); + TQPtrList<KParts::ReadOnlyPart> frames = part->frames(); unsigned int len = frames.count(); if (p == lengthPropertyName) return Number(len); @@ -2521,11 +2521,11 @@ Value Location::get(ExecState *exec, const Identifier &p) const if (entry) switch (entry->value) { case Hash: - return String( url.ref().isNull() ? QString("") : "#" + url.ref() ); + return String( url.ref().isNull() ? TQString("") : "#" + url.ref() ); case Host: { UString str = url.host(); if (url.port()) - str += ":" + QString::number((int)url.port()); + str += ":" + TQString::number((int)url.port()); return String(str); // Note: this is the IE spec. The NS spec swaps the two, it says // "The hostname property is the concatenation of the host and port properties, separated by a colon." @@ -2543,9 +2543,9 @@ Value Location::get(ExecState *exec, const Identifier &p) const case Pathname: if (url.isEmpty()) return String(""); - return String( url.path().isEmpty() ? QString("/") : url.path() ); + return String( url.path().isEmpty() ? TQString("/") : url.path() ); case Port: - return String( url.port() ? QString::number((int)url.port()) : QString::fromLatin1("") ); + return String( url.port() ? TQString::number((int)url.port()) : TQString::fromLatin1("") ); case Protocol: return String( url.protocol()+":" ); case Search: @@ -2587,7 +2587,7 @@ void Location::put(ExecState *exec, const Identifier &p, const Value &v, int att if (entry->value != Href && !window->isSafeScript(exec)) return; - QString str = v.toString(exec).qstring(); + TQString str = v.toString(exec).qstring(); switch (entry->value) { case Href: { KHTMLPart* p =::qt_cast<KHTMLPart*>(Window::retrieveActive(exec)->part()); @@ -2603,8 +2603,8 @@ void Location::put(ExecState *exec, const Identifier &p, const Value &v, int att url.setRef(str); break; case Host: { - QString host = str.left(str.find(":")); - QString port = str.mid(str.find(":")+1); + TQString host = str.left(str.find(":")); + TQString port = str.mid(str.find(":")+1); url.setHost(host); url.setPort(port.toUInt()); break; @@ -2730,8 +2730,8 @@ Value ExternalFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) if (args.size() != 1 && args.size() != 2) return Undefined(); - QString url = args[0].toString(exec).qstring(); - QString title; + TQString url = args[0].toString(exec).qstring(); + TQString title; if (args.size() == 2) title = args[1].toString(exec).qstring(); @@ -2739,7 +2739,7 @@ Value ExternalFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) // just wanted the base js handling code in cvs return Undefined(); - QString question; + TQString question; if ( title.isEmpty() ) question = i18n("Do you want a bookmark pointing to the location \"%1\" to be added to your collection?") .arg(url); @@ -2749,7 +2749,7 @@ Value ExternalFunc::tryCall(ExecState *exec, Object &thisObj, const List &args) emit part->browserExtension()->requestFocus(part); - QString caption; + TQString caption; if (!part->url().host().isEmpty()) caption = part->url().host() + " - "; caption += i18n("JavaScript Attempted Bookmark Insert"); @@ -2809,9 +2809,9 @@ Value History::getValueProperty(ExecState *, int token) const if ( !iface ) return Number( 0 ); - QVariant length = iface->property( "historyLength" ); + TQVariant length = iface->property( "historyLength" ); - if ( length.type() != QVariant::UInt ) + if ( length.type() != TQVariant::UInt ) return Number( 0 ); return Number( length.toUInt() ); @@ -2886,13 +2886,13 @@ Value Konqueror::get(ExecState *exec, const Identifier &p) const if ( ext ) { KParts::BrowserInterface *iface = ext->browserInterface(); if ( iface ) { - QVariant prop = iface->property( p.qstring().latin1() ); + TQVariant prop = iface->property( p.qstring().latin1() ); if ( prop.isValid() ) { switch( prop.type() ) { - case QVariant::Int: + case TQVariant::Int: return Number( prop.toInt() ); - case QVariant::String: + case TQVariant::String: return String( prop.toString() ); default: break; @@ -2916,9 +2916,9 @@ Value KonquerorFunc::tryCall(ExecState *exec, Object &, const List &args) if ( !iface ) return Undefined(); - QCString n = m_name.data(); + TQCString n = m_name.data(); n += "()"; - iface->callMethod( n.data(), QVariant() ); + iface->callMethod( n.data(), TQVariant() ); return Undefined(); } diff --git a/khtml/ecma/kjs_window.h b/khtml/ecma/kjs_window.h index 1444110f4..433bf86ae 100644 --- a/khtml/ecma/kjs_window.h +++ b/khtml/ecma/kjs_window.h @@ -22,11 +22,11 @@ #ifndef _KJS_WINDOW_H_ #define _KJS_WINDOW_H_ -#include <qobject.h> -#include <qguardedptr.h> -#include <qmap.h> -#include <qptrlist.h> -#include <qdatetime.h> +#include <tqobject.h> +#include <tqguardedptr.h> +#include <tqmap.h> +#include <tqptrlist.h> +#include <tqdatetime.h> #include "kjs_binding.h" #include "kjs_views.h" @@ -70,7 +70,7 @@ namespace KJS { }; class KDE_EXPORT Window : public ObjectImp { - friend QGuardedPtr<KHTMLPart> getInstance(); + friend TQGuardedPtr<KHTMLPart> getInstance(); friend class Location; friend class WindowFunc; friend class WindowQObject; @@ -105,10 +105,10 @@ namespace KJS { void closeNow(); void delayedGoHistory(int steps); void goHistory(int steps); - void goURL(ExecState* exec, const QString& url, bool lockHistory); + void goURL(ExecState* exec, const TQString& url, bool lockHistory); Value openWindow(ExecState *exec, const List &args); - Value executeOpenWindow(ExecState *exec, const KURL& url, const QString& frameName, const QString& features); - void resizeTo(QWidget* tl, int width, int height); + Value executeOpenWindow(ExecState *exec, const KURL& url, const TQString& frameName, const TQString& features); + void resizeTo(TQWidget* tl, int width, int height); void afterScriptExecution(); bool isSafeScript(ExecState *exec) const { KParts::ReadOnlyPart *activePart = static_cast<KJS::ScriptInterpreter *>( exec->interpreter() )->part(); @@ -118,14 +118,14 @@ namespace KJS { Location *location() const; ObjectImp* frames( ExecState* exec ) const; JSEventListener *getJSEventListener(const Value &val, bool html = false); - JSLazyEventListener *getJSLazyEventListener(const QString &code, const QString &name, DOM::NodeImpl* node); + JSLazyEventListener *getJSLazyEventListener(const TQString &code, const TQString &name, DOM::NodeImpl* node); void clear( ExecState *exec ); virtual UString toString(ExecState *exec) const; // Set the current "event" object void setCurrentEvent( DOM::Event *evt ); - QPtrDict<JSEventListener> jsEventListeners; + TQPtrDict<JSEventListener> jsEventListeners; virtual const ClassInfo* classInfo() const { return &info; } static const ClassInfo info; enum { Closed, Crypto, DefaultStatus, Status, Document, Node, EventCtor, Range, @@ -178,7 +178,7 @@ namespace KJS { bool checkIsSafeScript( KParts::ReadOnlyPart* activePart ) const; - QGuardedPtr<khtml::ChildFrame> m_frame; + TQGuardedPtr<khtml::ChildFrame> m_frame; Screen *screen; History *history; External *external; @@ -188,29 +188,29 @@ namespace KJS { struct DelayedAction { DelayedAction() : actionId(NullAction) {} // for QValueList - DelayedAction( DelayedActionId id, QVariant p = QVariant() ) : actionId(id), param(p) {} + DelayedAction( DelayedActionId id, TQVariant p = TQVariant() ) : actionId(id), param(p) {} DelayedActionId actionId; - QVariant param; // just in case + TQVariant param; // just in case }; - QValueList<DelayedAction> m_delayed; + TQValueList<DelayedAction> m_delayed; struct SuppressedWindowInfo { SuppressedWindowInfo() {} // for QValueList - SuppressedWindowInfo( KURL u, QString fr, QString fe ) : url(u), frameName(fr), features(fe) {} + SuppressedWindowInfo( KURL u, TQString fr, TQString fe ) : url(u), frameName(fr), features(fe) {} KURL url; - QString frameName; - QString features; + TQString frameName; + TQString features; }; - QValueList<SuppressedWindowInfo> m_suppressedWindowInfo; + TQValueList<SuppressedWindowInfo> m_suppressedWindowInfo; }; /** - * like QDateTime, but properly handles milliseconds + * like TQDateTime, but properly handles milliseconds */ class DateTimeMS { - QDate mDate; - QTime mTime; + TQDate mDate; + TQTime mTime; public: DateTimeMS addMSecs(int s) const; bool operator >(const DateTimeMS &other) const; @@ -229,14 +229,14 @@ namespace KJS { class ScheduledAction { public: ScheduledAction(Object _func, List _args, DateTimeMS _nextTime, int _interval, bool _singleShot, int _timerId); - ScheduledAction(QString _code, DateTimeMS _nextTime, int _interval, bool _singleShot, int _timerId); + ScheduledAction(TQString _code, DateTimeMS _nextTime, int _interval, bool _singleShot, int _timerId); ~ScheduledAction(); bool execute(Window *window); void mark(); ObjectImp *func; List args; - QString code; + TQString code; bool isFunction; bool singleShot; @@ -246,7 +246,7 @@ namespace KJS { int timerId; }; - class KDE_EXPORT WindowQObject : public QObject { + class KDE_EXPORT WindowQObject : public TQObject { Q_OBJECT public: WindowQObject(Window *w); @@ -261,11 +261,11 @@ namespace KJS { protected slots: void parentDestroyed(); protected: - void timerEvent(QTimerEvent *e); + void timerEvent(TQTimerEvent *e); void setNextTimer(); private: Window *parent; - QPtrList<ScheduledAction> scheduledActions; + TQPtrList<ScheduledAction> scheduledActions; int pausedTime; int lastTimerId; bool currentlyDispatching; @@ -286,7 +286,7 @@ namespace KJS { private: friend class Window; Location(khtml::ChildFrame *f); - QGuardedPtr<khtml::ChildFrame> m_frame; + TQGuardedPtr<khtml::ChildFrame> m_frame; }; #ifdef Q_WS_QWS diff --git a/khtml/ecma/xmlhttprequest.cpp b/khtml/ecma/xmlhttprequest.cpp index de77f3d7e..d3ebebaec 100644 --- a/khtml/ecma/xmlhttprequest.cpp +++ b/khtml/ecma/xmlhttprequest.cpp @@ -35,7 +35,7 @@ #include <kio/scheduler.h> #include <kio/job.h> -#include <qobject.h> +#include <tqobject.h> #include <kdebug.h> #ifdef APPLE_CHANGES @@ -86,7 +86,7 @@ void XMLHttpRequestQObject::slotData( KIO::Job* job, const char *data, int size jsObject->slotData(job, data, size); } #else -void XMLHttpRequestQObject::slotData( KIO::Job* job, const QByteArray &data ) +void XMLHttpRequestQObject::slotData( KIO::Job* job, const TQByteArray &data ) { jsObject->slotData(job, data); } @@ -149,14 +149,14 @@ Value XMLHttpRequest::getValueProperty(ExecState *exec, int token) const return Null(); } if (!createdDocument) { - QString mimeType = "text/xml"; + TQString mimeType = "text/xml"; if (!m_mimeTypeOverride.isEmpty()) { mimeType = m_mimeTypeOverride; } else { Value header = getResponseHeader("Content-Type"); if (header.type() != UndefinedType) { - mimeType = QStringList::split(";", header.toString(exec).qstring())[0].stripWhiteSpace(); + mimeType = TQStringList::split(";", header.toString(exec).qstring())[0].stripWhiteSpace(); } } @@ -239,7 +239,7 @@ XMLHttpRequest::XMLHttpRequest(ExecState *exec, const DOM::Document &d) qObject(new XMLHttpRequestQObject(this)), doc(static_cast<DOM::DocumentImpl*>(d.handle())), async(true), - contentType(QString::null), + contentType(TQString::null), job(0), state(Uninitialized), onReadyStateChangeListener(0), @@ -308,15 +308,15 @@ bool XMLHttpRequest::urlMatchesDocumentDomain(const KURL& _url) const return false; } -void XMLHttpRequest::open(const QString& _method, const KURL& _url, bool _async) +void XMLHttpRequest::open(const TQString& _method, const KURL& _url, bool _async) { abort(); aborted = false; // clear stuff from possible previous load requestHeaders.clear(); - responseHeaders = QString(); - response = QString(); + responseHeaders = TQString(); + response = TQString(); createdDocument = false; responseXML = DOM::Document(); @@ -338,12 +338,12 @@ void XMLHttpRequest::open(const QString& _method, const KURL& _url, bool _async) changeState(Loading); } -void XMLHttpRequest::send(const QString& _body) +void XMLHttpRequest::send(const TQString& _body) { aborted = false; if (method == "post") { - QString protocol = url.protocol().lower(); + TQString protocol = url.protocol().lower(); // Abondon the request when the protocol is other than "http", // instead of blindly changing it to a "get" request. @@ -355,8 +355,8 @@ void XMLHttpRequest::send(const QString& _body) // FIXME: determine post encoding correctly by looking in headers // for charset. - QByteArray buf; - QCString str = _body.utf8(); + TQByteArray buf; + TQCString str = _body.utf8(); buf.duplicate(str.data(), str.size() - 1); job = KIO::http_post( url, buf, false ); @@ -370,12 +370,12 @@ void XMLHttpRequest::send(const QString& _body) } if (!requestHeaders.isEmpty()) { - QString rh; - QMap<QString, QString>::ConstIterator begin = requestHeaders.begin(); - QMap<QString, QString>::ConstIterator end = requestHeaders.end(); - for (QMap<QString, QString>::ConstIterator i = begin; i != end; ++i) { - QString key = i.key(); - QString value = i.data(); + TQString rh; + TQMap<TQString, TQString>::ConstIterator begin = requestHeaders.begin(); + TQMap<TQString, TQString>::ConstIterator end = requestHeaders.end(); + for (TQMap<TQString, TQString>::ConstIterator i = begin; i != end; ++i) { + TQString key = i.key(); + TQString value = i.data(); if (key == "accept") { // The HTTP KIO slave supports an override this way job->addMetaData("accept", value); @@ -397,21 +397,21 @@ void XMLHttpRequest::send(const QString& _body) // ### does find() ever succeed? the headers are stored in lower case! if (requestHeaders.find("Referer") == requestHeaders.end()) { KURL documentURL(doc->URL()); - documentURL.setPass(QString::null); - documentURL.setUser(QString::null); + documentURL.setPass(TQString::null); + documentURL.setUser(TQString::null); job->addMetaData("referrer", documentURL.url()); // kdDebug() << "Adding referrer: " << documentURL << endl; } if (!async) { - QByteArray data; + TQByteArray data; KURL finalURL; - QString headers; + TQString headers; #ifdef APPLE_CHANGES data = KWQServeSynchronousRequest(khtml::Cache::loader(), doc->docLoader(), job, finalURL, headers); #else - QMap<QString, QString> metaData; + TQMap<TQString, TQString> metaData; if ( NetAccess::synchronousRun( job, 0, &data, &finalURL, &metaData ) ) { headers = metaData[ "HTTP-Headers" ]; } @@ -421,17 +421,17 @@ void XMLHttpRequest::send(const QString& _body) return; } - qObject->connect( job, SIGNAL( result( KIO::Job* ) ), - SLOT( slotFinished( KIO::Job* ) ) ); + qObject->connect( job, TQT_SIGNAL( result( KIO::Job* ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); #ifdef APPLE_CHANGES - qObject->connect( job, SIGNAL( data( KIO::Job*, const char*, int ) ), - SLOT( slotData( KIO::Job*, const char*, int ) ) ); + qObject->connect( job, TQT_SIGNAL( data( KIO::Job*, const char*, int ) ), + TQT_SLOT( slotData( KIO::Job*, const char*, int ) ) ); #else - qObject->connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - SLOT( slotData( KIO::Job*, const QByteArray& ) ) ); + qObject->connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ), + TQT_SLOT( slotData( KIO::Job*, const TQByteArray& ) ) ); #endif - qObject->connect( job, SIGNAL(redirection(KIO::Job*, const KURL& ) ), - SLOT( slotRedirection(KIO::Job*, const KURL&) ) ); + qObject->connect( job, TQT_SIGNAL(redirection(KIO::Job*, const KURL& ) ), + TQT_SLOT( slotRedirection(KIO::Job*, const KURL&) ) ); #ifdef APPLE_CHANGES KWQServeRequest(khtml::Cache::loader(), doc->docLoader(), job); @@ -451,14 +451,14 @@ void XMLHttpRequest::abort() aborted = true; } -void XMLHttpRequest::overrideMIMEType(const QString& override) +void XMLHttpRequest::overrideMIMEType(const TQString& override) { m_mimeTypeOverride = override; } -void XMLHttpRequest::setRequestHeader(const QString& _name, const QString &value) +void XMLHttpRequest::setRequestHeader(const TQString& _name, const TQString &value) { - QString name = _name.lower().stripWhiteSpace(); + TQString name = _name.lower().stripWhiteSpace(); // Content-type needs to be set seperately from the other headers if(name == "content-type") { @@ -486,8 +486,8 @@ void XMLHttpRequest::setRequestHeader(const QString& _name, const QString &value // Reject all banned headers. See BANNED_HTTP_HEADERS above. // kdDebug() << "Banned HTTP Headers: " << BANNED_HTTP_HEADERS << endl; - QStringList bannedHeaders = QStringList::split(',', - QString::fromLatin1(BANNED_HTTP_HEADERS)); + TQStringList bannedHeaders = TQStringList::split(',', + TQString::fromLatin1(BANNED_HTTP_HEADERS)); if (bannedHeaders.contains(name)) return; // Denied @@ -510,13 +510,13 @@ Value XMLHttpRequest::getAllResponseHeaders() const return String(responseHeaders.mid(endOfLine + 1) + "\n"); } -Value XMLHttpRequest::getResponseHeader(const QString& name) const +Value XMLHttpRequest::getResponseHeader(const TQString& name) const { if (responseHeaders.isEmpty()) { return Undefined(); } - QRegExp headerLinePattern(name + ":", false); + TQRegExp headerLinePattern(name + ":", false); int matchLength; int headerLinePos = headerLinePattern.search(responseHeaders, 0); @@ -540,14 +540,14 @@ Value XMLHttpRequest::getResponseHeader(const QString& name) const return String(responseHeaders.mid(headerLinePos + matchLength, endOfLine - (headerLinePos + matchLength)).stripWhiteSpace()); } -static Value httpStatus(const QString& response, bool textStatus = false) +static Value httpStatus(const TQString& response, bool textStatus = false) { if (response.isEmpty()) { return Undefined(); } int endOfLine = response.find("\n"); - QString firstLine = (endOfLine == -1) ? response : response.left(endOfLine); + TQString firstLine = (endOfLine == -1) ? response : response.left(endOfLine); int codeStart = firstLine.find(" "); int codeEnd = firstLine.find(" ", codeStart + 1); @@ -556,11 +556,11 @@ static Value httpStatus(const QString& response, bool textStatus = false) } if (textStatus) { - QString statusText = firstLine.mid(codeEnd + 1, endOfLine - (codeEnd + 1)).stripWhiteSpace(); + TQString statusText = firstLine.mid(codeEnd + 1, endOfLine - (codeEnd + 1)).stripWhiteSpace(); return String(statusText); } - QString number = firstLine.mid(codeStart + 1, codeEnd - (codeStart + 1)); + TQString number = firstLine.mid(codeStart + 1, codeEnd - (codeStart + 1)); bool ok = false; int code = number.toInt(&ok); @@ -581,7 +581,7 @@ Value XMLHttpRequest::getStatusText() const return httpStatus(responseHeaders, true); } -void XMLHttpRequest::processSyncLoadResults(const QByteArray &data, const KURL &finalURL, const QString &headers) +void XMLHttpRequest::processSyncLoadResults(const TQByteArray &data, const KURL &finalURL, const TQString &headers) { if (!urlMatchesDocumentDomain(finalURL)) { abort(); @@ -635,7 +635,7 @@ void XMLHttpRequest::slotRedirection(KIO::Job*, const KURL& url) #ifdef APPLE_CHANGES void XMLHttpRequest::slotData( KIO::Job*, const char *data, int len ) #else -void XMLHttpRequest::slotData(KIO::Job*, const QByteArray &_data) +void XMLHttpRequest::slotData(KIO::Job*, const TQByteArray &_data) #endif { if (state < Loaded ) { @@ -664,10 +664,10 @@ void XMLHttpRequest::slotData(KIO::Job*, const QByteArray &_data) if ( pos > -1 ) { pos += 13; int index = responseHeaders.find('\n', pos); - QString type = responseHeaders.mid(pos, (index-pos)); + TQString type = responseHeaders.mid(pos, (index-pos)); index = type.find (';'); if (index > -1) - encoding = type.mid( index+1 ).remove(QRegExp("charset[ ]*=[ ]*", false)).stripWhiteSpace(); + encoding = type.mid( index+1 ).remove(TQRegExp("charset[ ]*=[ ]*", false)).stripWhiteSpace(); } decoder = new Decoder; @@ -684,7 +684,7 @@ void XMLHttpRequest::slotData(KIO::Job*, const QByteArray &_data) if (len == -1) len = strlen(data); - QString decoded = decoder->decode(data, len); + TQString decoded = decoder->decode(data, len); response += decoded; @@ -724,7 +724,7 @@ Value XMLHttpRequestProtoFunc::tryCall(ExecState *exec, Object &thisObj, const L return Undefined(); } - QString method = args[0].toString(exec).qstring(); + TQString method = args[0].toString(exec).qstring(); KHTMLPart *part = ::qt_cast<KHTMLPart *>(Window::retrieveActive(exec)->part()); if (!part) return Undefined(); @@ -757,7 +757,7 @@ Value XMLHttpRequestProtoFunc::tryCall(ExecState *exec, Object &thisObj, const L return Undefined(); } - QString body; + TQString body; if (args.size() >= 1) { Object obj = Object::dynamicCast(args[0]); if (obj.isValid() && obj.inherits(&DOMDocument::info)) { diff --git a/khtml/ecma/xmlhttprequest.h b/khtml/ecma/xmlhttprequest.h index 49582a905..2c646708e 100644 --- a/khtml/ecma/xmlhttprequest.h +++ b/khtml/ecma/xmlhttprequest.h @@ -77,31 +77,31 @@ namespace KJS { #ifdef APPLE_CHANGES void slotData( KIO::Job* job, const char *data, int size ); #else - void slotData( KIO::Job* job, const QByteArray &data ); + void slotData( KIO::Job* job, const TQByteArray &data ); #endif void slotFinished( KIO::Job* ); void slotRedirection( KIO::Job*, const KURL& ); - void processSyncLoadResults(const QByteArray &data, const KURL &finalURL, const QString &headers); + void processSyncLoadResults(const TQByteArray &data, const KURL &finalURL, const TQString &headers); - void open(const QString& _method, const KURL& _url, bool _async); - void send(const QString& _body); + void open(const TQString& _method, const KURL& _url, bool _async); + void send(const TQString& _body); void abort(); - void setRequestHeader(const QString& name, const QString &value); - void overrideMIMEType(const QString& override); + void setRequestHeader(const TQString& name, const TQString &value); + void overrideMIMEType(const TQString& override); Value getAllResponseHeaders() const; - Value getResponseHeader(const QString& name) const; + Value getResponseHeader(const TQString& name) const; void changeState(XMLHttpRequestState newState); - QGuardedPtr<DOM::DocumentImpl> doc; + TQGuardedPtr<DOM::DocumentImpl> doc; KURL url; - QString method; + TQString method; bool async; - QMap<QString,QString> requestHeaders; - QString m_mimeTypeOverride; - QString contentType; + TQMap<TQString,TQString> requestHeaders; + TQString m_mimeTypeOverride; + TQString contentType; KIO::TransferJob * job; @@ -110,10 +110,10 @@ namespace KJS { JSEventListener *onLoadListener; khtml::Decoder *decoder; - QString encoding; - QString responseHeaders; + TQString encoding; + TQString responseHeaders; - QString response; + TQString response; mutable bool createdDocument; mutable bool typeIsXML; mutable DOM::Document responseXML; @@ -122,14 +122,14 @@ namespace KJS { }; - class XMLHttpRequestQObject : public QObject { + class XMLHttpRequestQObject : public TQObject { Q_OBJECT public: XMLHttpRequestQObject(XMLHttpRequest *_jsObject); public slots: - void slotData( KIO::Job* job, const QByteArray &data ); + void slotData( KIO::Job* job, const TQByteArray &data ); void slotFinished( KIO::Job* job ); void slotRedirection( KIO::Job* job, const KURL& url); diff --git a/khtml/ecma/xmlserializer.cpp b/khtml/ecma/xmlserializer.cpp index 6abcfe77f..856f35e1f 100644 --- a/khtml/ecma/xmlserializer.cpp +++ b/khtml/ecma/xmlserializer.cpp @@ -89,7 +89,7 @@ Value XMLSerializerProtoFunc::tryCall(ExecState *exec, Object &thisObj, const Li return Undefined(); } - QString body; + TQString body; try { body = node->toString().string(); 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 diff --git a/khtml/java/kjavaapplet.cpp b/khtml/java/kjavaapplet.cpp index 2269bc756..879c8624e 100644 --- a/khtml/java/kjavaapplet.cpp +++ b/khtml/java/kjavaapplet.cpp @@ -32,13 +32,13 @@ class KJavaAppletPrivate { public: bool reallyExists; - QString className; - QString appName; - QString baseURL; - QString codeBase; - QString archives; - QSize size; - QString windowName; + TQString className; + TQString appName; + TQString baseURL; + TQString codeBase; + TQString archives; + TQSize size; + TQString windowName; KJavaApplet::AppletState state; bool failed; @@ -81,67 +81,67 @@ void KJavaApplet::setAppletContext( KJavaAppletContext* _context ) context->registerApplet( this ); } -void KJavaApplet::setAppletClass( const QString& _className ) +void KJavaApplet::setAppletClass( const TQString& _className ) { d->className = _className; } -QString& KJavaApplet::appletClass() +TQString& KJavaApplet::appletClass() { return d->className; } -QString& KJavaApplet::parameter( const QString& name ) +TQString& KJavaApplet::parameter( const TQString& name ) { return params[ name ]; } -void KJavaApplet::setParameter( const QString& name, const QString& value ) +void KJavaApplet::setParameter( const TQString& name, const TQString& value ) { params.insert( name, value ); } -QMap<QString,QString>& KJavaApplet::getParams() +TQMap<TQString,TQString>& KJavaApplet::getParams() { return params; } -void KJavaApplet::setBaseURL( const QString& baseURL ) +void KJavaApplet::setBaseURL( const TQString& baseURL ) { d->baseURL = baseURL; } -QString& KJavaApplet::baseURL() +TQString& KJavaApplet::baseURL() { return d->baseURL; } -void KJavaApplet::setCodeBase( const QString& codeBase ) +void KJavaApplet::setCodeBase( const TQString& codeBase ) { d->codeBase = codeBase; } -QString& KJavaApplet::codeBase() +TQString& KJavaApplet::codeBase() { return d->codeBase; } -void KJavaApplet::setSize( QSize size ) +void KJavaApplet::setSize( TQSize size ) { d->size = size; } -QSize KJavaApplet::size() +TQSize KJavaApplet::size() { return d->size; } -void KJavaApplet::setArchives( const QString& _archives ) +void KJavaApplet::setArchives( const TQString& _archives ) { d->archives = _archives; } -QString& KJavaApplet::archives() +TQString& KJavaApplet::archives() { return d->archives; } @@ -150,30 +150,30 @@ void KJavaApplet::resizeAppletWidget( int width, int height ) { kdDebug(6100) << "KJavaApplet, id = " << id << ", ::resizeAppletWidget to " << width << ", " << height << endl; - QStringList sl; - sl.push_back( QString::number( 0 ) ); // applet itself has id 0 - sl.push_back( QString( "eval" ) ); // evaluate next script - sl.push_back( QString::number( KParts::LiveConnectExtension::TypeString ) ); - sl.push_back( QString( "this.setAttribute('WIDTH',%1);this.setAttribute('HEIGHT',%2)" ).arg( width ).arg( height ) ); + TQStringList sl; + sl.push_back( TQString::number( 0 ) ); // applet itself has id 0 + sl.push_back( TQString( "eval" ) ); // evaluate next script + sl.push_back( TQString::number( KParts::LiveConnectExtension::TypeString ) ); + sl.push_back( TQString( "this.setAttribute('WIDTH',%1);this.setAttribute('HEIGHT',%2)" ).arg( width ).arg( height ) ); jsData( sl ); } -void KJavaApplet::setAppletName( const QString& name ) +void KJavaApplet::setAppletName( const TQString& name ) { d->appName = name; } -void KJavaApplet::setWindowName( const QString& title ) +void KJavaApplet::setWindowName( const TQString& title ) { d->windowName = title; } -QString& KJavaApplet::getWindowName() +TQString& KJavaApplet::getWindowName() { return d->windowName; } -QString& KJavaApplet::appletName() +TQString& KJavaApplet::appletName() { return d->appName; } @@ -259,8 +259,8 @@ void KJavaApplet::stateChange( const int newStateInt ) { } } -void KJavaApplet::showStatus(const QString &msg) { - QStringList args; +void KJavaApplet::showStatus(const TQString &msg) { + TQStringList args; args << msg; context->processCmd("showstatus", args); } diff --git a/khtml/java/kjavaapplet.h b/khtml/java/kjavaapplet.h index abde99927..6fe0f7709 100644 --- a/khtml/java/kjavaapplet.h +++ b/khtml/java/kjavaapplet.h @@ -26,9 +26,9 @@ #include <kurl.h> -#include <qobject.h> -#include <qstringlist.h> -#include <qmap.h> +#include <tqobject.h> +#include <tqstringlist.h> +#include <tqmap.h> /** * @short A Java applet @@ -74,90 +74,90 @@ public: /** * Specify the name of the class file to run. For example 'Lake.class'. */ - void setAppletClass( const QString& clazzName ); + void setAppletClass( const TQString& clazzName ); /** * Get the name of the Class file the applet should run */ - QString& appletClass(); + TQString& appletClass(); /** * Set the URL of the document embedding the applet. */ - void setBaseURL( const QString& base ); + void setBaseURL( const TQString& base ); /** * get the Base URL of the document embedding the applet */ - QString& baseURL(); + TQString& baseURL(); /** * Set the codebase of the applet classes. */ - void setCodeBase( const QString& codeBase ); + void setCodeBase( const TQString& codeBase ); /** * Get the codebase of the applet classes */ - QString& codeBase(); + TQString& codeBase(); /** * Set the list of archives at the Applet's codebase to search in for * class files and other resources */ - void setArchives( const QString& _archives ); + void setArchives( const TQString& _archives ); /** * Get the list of Archives that should be searched for class files * and other resources */ - QString& archives(); + TQString& archives(); /** * Set the name the applet should be called in its context */ - void setAppletName( const QString& name ); + void setAppletName( const TQString& name ); /** * Get the name the applet should be called in its context */ - QString& appletName(); + TQString& appletName(); /** * Set the size of the applet */ - void setSize( QSize size ); + void setSize( TQSize size ); /** * Get the size of the applet */ - QSize size(); + TQSize size(); /** * Specify a parameter to be passed to the applet. */ - void setParameter( const QString& name, const QString& value ); + void setParameter( const TQString& name, const TQString& value ); /** * Look up the parameter value for the given Parameter. Returns - * QString::null if the name has not been set. + * TQString::null if the name has not been set. */ - QString& parameter( const QString& name ); + TQString& parameter( const TQString& name ); /** * Get a reference to the Paramaters and their values */ - QMap<QString,QString>& getParams(); + TQMap<TQString,TQString>& getParams(); /** * Set the window title for swallowing */ - void setWindowName( const QString& title ); + void setWindowName( const TQString& title ); /** * Get the window title this applet should use */ - QString& getWindowName(); + TQString& getWindowName(); /** * Interface for applets to resize themselves @@ -206,20 +206,20 @@ public: /** * Get/Set the user name */ - void setUser(const QString & _user) { username = _user; } - const QString & user () const { return username; } + void setUser(const TQString & _user) { username = _user; } + const TQString & user () const { return username; } /** * Get/Set the user password */ - void setPassword(const QString & _password) { userpassword = _password; } - const QString & password () const { return userpassword; } + void setPassword(const TQString & _password) { userpassword = _password; } + const TQString & password () const { return userpassword; } /** * Get/Set the auth name */ - void setAuthName(const QString & _auth) { authname = _auth; } - const QString & authName () const { return authname; } + void setAuthName(const TQString & _auth) { authname = _auth; } + const TQString & authName () const { return authname; } /** * called from the protocol engine @@ -234,18 +234,18 @@ public: /** * JavaScript coming from Java **/ - void jsData (const QStringList & args) { emit jsEvent (args); } + void jsData (const TQStringList & args) { emit jsEvent (args); } signals: - void jsEvent (const QStringList & args); + void jsEvent (const TQStringList & args); private: - void showStatus( const QString &msg); + void showStatus( const TQString &msg); KJavaAppletPrivate* d; - QMap<QString, QString> params; + TQMap<TQString, TQString> params; KJavaAppletContext* context; int id; - QString username; - QString userpassword; - QString authname; + TQString username; + TQString userpassword; + TQString authname; }; #endif // KJAVAAPPLET_H diff --git a/khtml/java/kjavaappletcontext.cpp b/khtml/java/kjavaappletcontext.cpp index 94e17ff72..76914a5dc 100644 --- a/khtml/java/kjavaappletcontext.cpp +++ b/khtml/java/kjavaappletcontext.cpp @@ -26,15 +26,15 @@ #include <klocale.h> #include <kmessagebox.h> #include <kdebug.h> -#include <qmap.h> -#include <qguardedptr.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <tqmap.h> +#include <tqguardedptr.h> +#include <tqstringlist.h> +#include <tqregexp.h> // This file was using 6002, but kdebug.areas didn't know about that number #define DEBUGAREA 6100 -typedef QMap< int, QGuardedPtr<KJavaApplet> > AppletMap; +typedef TQMap< int, TQGuardedPtr<KJavaApplet> > AppletMap; // For future expansion class KJavaAppletContextPrivate @@ -50,11 +50,11 @@ int KJavaAppletContext::contextCount = 0; /* Class Implementation */ KJavaAppletContext::KJavaAppletContext() - : QObject() + : TQObject() { d = new KJavaAppletContextPrivate; server = KJavaAppletServer::allocateJavaServer(); - connect(server->javaProcess(), SIGNAL(exited(int)), this, SLOT(javaProcessExited(int))); + connect(server->javaProcess(), TQT_SIGNAL(exited(int)), this, TQT_SLOT(javaProcessExited(int))); id = contextCount; server->createContext( id, this ); @@ -128,37 +128,37 @@ void KJavaAppletContext::stop( KJavaApplet* applet ) server->stopApplet( id, applet->appletId() ); } -void KJavaAppletContext::processCmd( QString cmd, QStringList args ) +void KJavaAppletContext::processCmd( TQString cmd, TQStringList args ) { received( cmd, args ); } -void KJavaAppletContext::received( const QString& cmd, const QStringList& arg ) +void KJavaAppletContext::received( const TQString& cmd, const TQStringList& arg ) { kdDebug(6100) << "KJavaAppletContext::received, cmd = >>" << cmd << "<<" << endl; kdDebug(6100) << "arg count = " << arg.count() << endl; - if ( cmd == QString::fromLatin1("showstatus") + if ( cmd == TQString::fromLatin1("showstatus") && !arg.empty() ) { - QString tmp = arg.first(); - tmp.replace(QRegExp("[\n\r]"), ""); + TQString tmp = arg.first(); + tmp.replace(TQRegExp("[\n\r]"), ""); kdDebug(6100) << "status message = " << tmp << endl; emit showStatus( tmp ); } - else if ( cmd == QString::fromLatin1( "showurlinframe" ) + else if ( cmd == TQString::fromLatin1( "showurlinframe" ) && arg.count() > 1 ) { kdDebug(6100) << "url = " << arg[0] << ", frame = " << arg[1] << endl; emit showDocument( arg[0], arg[1] ); } - else if ( cmd == QString::fromLatin1( "showdocument" ) + else if ( cmd == TQString::fromLatin1( "showdocument" ) && !arg.empty() ) { kdDebug(6100) << "url = " << arg.first() << endl; emit showDocument( arg.first(), "_top" ); } - else if ( cmd == QString::fromLatin1( "resizeapplet" ) + else if ( cmd == TQString::fromLatin1( "resizeapplet" ) && arg.count() > 2 ) { //arg[1] should be appletID @@ -180,10 +180,10 @@ void KJavaAppletContext::received( const QString& cmd, const QStringList& arg ) tmp->resizeAppletWidget( width, height ); } } - else if (cmd.startsWith(QString::fromLatin1("audioclip_"))) { + else if (cmd.startsWith(TQString::fromLatin1("audioclip_"))) { kdDebug(DEBUGAREA) << "process Audio command (not yet implemented): " << cmd << " " << arg[0] << endl; } - else if ( cmd == QString::fromLatin1( "JS_Event" ) + else if ( cmd == TQString::fromLatin1( "JS_Event" ) && arg.count() > 2 ) { bool ok; @@ -191,14 +191,14 @@ void KJavaAppletContext::received( const QString& cmd, const QStringList& arg ) KJavaApplet * applet; if (ok && (applet = d->applets[appletID])) { - QStringList js_args(arg); + TQStringList js_args(arg); js_args.pop_front(); applet->jsData(js_args); } else kdError(DEBUGAREA) << "parse JS event " << arg[0] << " " << arg[1] << endl; } - else if ( cmd == QString::fromLatin1( "AppletStateNotification" ) ) + else if ( cmd == TQString::fromLatin1( "AppletStateNotification" ) ) { bool ok; const int appletID = arg.first().toInt(&ok); @@ -222,15 +222,15 @@ void KJavaAppletContext::received( const QString& cmd, const QStringList& arg ) } else kdError(DEBUGAREA) << "AppletStateNotification: Applet ID is not numerical" << endl; } - else if ( cmd == QString::fromLatin1( "AppletFailed" ) ) { + else if ( cmd == TQString::fromLatin1( "AppletFailed" ) ) { bool ok; const int appletID = arg.first().toInt(&ok); if (ok) { KJavaApplet* const applet = d->applets[appletID]; /* - QString errorDetail(arg[1]); - errorDetail.replace(QRegExp(":\\s*"), ":\n"); + TQString errorDetail(arg[1]); + errorDetail.replace(TQRegExp(":\\s*"), ":\n"); KMessageBox::detailedError(0L, i18n("Java error while loading applet."), errorDetail); */ if (applet) @@ -251,23 +251,23 @@ void KJavaAppletContext::javaProcessExited(int) { } } -bool KJavaAppletContext::getMember(QStringList & args, QStringList & ret_args) { - args.push_front( QString::number(id) ); +bool KJavaAppletContext::getMember(TQStringList & args, TQStringList & ret_args) { + args.push_front( TQString::number(id) ); return server->getMember( args, ret_args ); } -bool KJavaAppletContext::putMember( QStringList & args ) { - args.push_front( QString::number(id) ); +bool KJavaAppletContext::putMember( TQStringList & args ) { + args.push_front( TQString::number(id) ); return server->putMember( args ); } -bool KJavaAppletContext::callMember(QStringList & args, QStringList &ret_args) { - args.push_front( QString::number(id) ); +bool KJavaAppletContext::callMember(TQStringList & args, TQStringList &ret_args) { + args.push_front( TQString::number(id) ); return server->callMember( args, ret_args ); } -void KJavaAppletContext::derefObject( QStringList & args ) { - args.push_front( QString::number(id) ); +void KJavaAppletContext::derefObject( TQStringList & args ) { + args.push_front( TQString::number(id) ); server->derefObject( args ); } diff --git a/khtml/java/kjavaappletcontext.h b/khtml/java/kjavaappletcontext.h index 06e5aafc7..ca851a42e 100644 --- a/khtml/java/kjavaappletcontext.h +++ b/khtml/java/kjavaappletcontext.h @@ -24,7 +24,7 @@ #ifndef KJAVAAPPLETCONTEXT_H #define KJAVAAPPLETCONTEXT_H -#include <qobject.h> +#include <tqobject.h> /** * @short Provides a context for KJavaAppletWidgets @@ -94,27 +94,27 @@ public: * use this for applet call backs, the AppletServer * calls this directly. */ - void processCmd( QString cmd, QStringList args ); + void processCmd( TQString cmd, TQStringList args ); /** * LiveConnect functions */ - bool getMember(QStringList & args, QStringList & ret_args); - bool putMember(QStringList & args); - bool callMember(QStringList & args, QStringList & ret_args); - void derefObject(QStringList & args); + bool getMember(TQStringList & args, TQStringList & ret_args); + bool putMember(TQStringList & args); + bool callMember(TQStringList & args, TQStringList & ret_args); + void derefObject(TQStringList & args); KJavaAppletServer* getServer() const { return server; } signals: /** * Signals the KHMTL Part to show this as the status message. */ - void showStatus ( const QString& txt ); + void showStatus ( const TQString& txt ); /** * Signals the KHTML Part to show a url in a given target */ - void showDocument( const QString& url, const QString& target ); + void showDocument( const TQString& url, const TQString& target ); /** * Signals the KHTML Part an applet is loaded @@ -129,7 +129,7 @@ protected: KJavaAppletServer* server; protected slots: - void received( const QString& cmd, const QStringList& arg ); + void received( const TQString& cmd, const TQStringList& arg ); void javaProcessExited(int); private: diff --git a/khtml/java/kjavaappletserver.cpp b/khtml/java/kjavaappletserver.cpp index e766dcb5b..59d0517a2 100644 --- a/khtml/java/kjavaappletserver.cpp +++ b/khtml/java/kjavaappletserver.cpp @@ -38,18 +38,18 @@ #include <ksslcertchain.h> #include <kssl.h> -#include <qtimer.h> -#include <qguardedptr.h> -#include <qvaluelist.h> -#include <qptrlist.h> -#include <qdir.h> -#include <qeventloop.h> -#include <qapplication.h> -#include <qlabel.h> -#include <qdialog.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qregexp.h> +#include <tqtimer.h> +#include <tqguardedptr.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> +#include <tqdir.h> +#include <tqeventloop.h> +#include <tqapplication.h> +#include <tqlabel.h> +#include <tqdialog.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqregexp.h> #include <stdlib.h> #include <assert.h> @@ -87,12 +87,12 @@ class JSStackFrame; -typedef QMap< int, KJavaKIOJob* > KIOJobMap; -typedef QMap< int, JSStackFrame* > JSStack; +typedef TQMap< int, KJavaKIOJob* > KIOJobMap; +typedef TQMap< int, JSStackFrame* > JSStack; class JSStackFrame { public: - JSStackFrame(JSStack & stack, QStringList & a) + JSStackFrame(JSStack & stack, TQStringList & a) : jsstack(stack), args(a), ticket(counter++), ready(false), exit (false) { jsstack.insert( ticket, this ); } @@ -100,7 +100,7 @@ public: jsstack.erase( ticket ); } JSStack & jsstack; - QStringList & args; + TQStringList & args; int ticket; bool ready : 1; bool exit : 1; @@ -118,15 +118,15 @@ private: delete kssl; } int counter; - QMap< int, QGuardedPtr<KJavaAppletContext> > contexts; - QString appletLabel; + TQMap< int, TQGuardedPtr<KJavaAppletContext> > contexts; + TQString appletLabel; JSStack jsstack; KIOJobMap kiojobs; bool javaProcessFailed; bool useKIO; KSSL * kssl; //int locked_context; - //QValueList<QByteArray> java_requests; + //TQValueList<TQByteArray> java_requests; }; static KJavaAppletServer* self = 0; @@ -136,8 +136,8 @@ KJavaAppletServer::KJavaAppletServer() d = new KJavaAppletServerPrivate; process = new KJavaProcess(); - connect( process, SIGNAL(received(const QByteArray&)), - this, SLOT(slotJavaRequest(const QByteArray&)) ); + connect( process, TQT_SIGNAL(received(const TQByteArray&)), + this, TQT_SLOT(slotJavaRequest(const TQByteArray&)) ); setupJava( process ); @@ -159,15 +159,15 @@ KJavaAppletServer::~KJavaAppletServer() delete d; } -QString KJavaAppletServer::getAppletLabel() +TQString KJavaAppletServer::getAppletLabel() { if( self ) return self->appletLabel(); else - return QString::null; + return TQString::null; } -QString KJavaAppletServer::appletLabel() +TQString KJavaAppletServer::appletLabel() { return d->appletLabel; } @@ -198,7 +198,7 @@ void KJavaAppletServer::freeJavaServer() if( config.readBoolEntry( "ShutdownAppletServer", true ) ) { const int value = config.readNumEntry( "AppletServerTimeout", 60 ); - QTimer::singleShot( value*1000, self, SLOT( checkShutdown() ) ); + TQTimer::singleShot( value*1000, self, TQT_SLOT( checkShutdown() ) ); } } } @@ -217,16 +217,16 @@ void KJavaAppletServer::setupJava( KJavaProcess *p ) KConfig config ( "konquerorrc", true ); config.setGroup( "Java/JavaScript Settings" ); - QString jvm_path = "java"; + TQString jvm_path = "java"; - QString jPath = config.readPathEntry( "JavaPath" ); + TQString jPath = config.readPathEntry( "JavaPath" ); if ( !jPath.isEmpty() && jPath != "java" ) { // Cut off trailing slash if any if( jPath[jPath.length()-1] == '/' ) jPath.remove(jPath.length()-1, 1); - QDir dir( jPath ); + TQDir dir( jPath ); if( dir.exists( "bin/java" ) ) { jvm_path = jPath + "/bin/java"; @@ -235,7 +235,7 @@ void KJavaAppletServer::setupJava( KJavaProcess *p ) { jvm_path = jPath + "/jre/bin/java"; } - else if( QFile::exists(jPath) ) + else if( TQFile::exists(jPath) ) { //check here to see if they entered the whole path the java exe jvm_path = jPath; @@ -246,22 +246,22 @@ void KJavaAppletServer::setupJava( KJavaProcess *p ) p->setJVMPath( jvm_path ); // Prepare classpath variable - QString kjava_class = locate("data", "kjava/kjava.jar"); + TQString kjava_class = locate("data", "kjava/kjava.jar"); kdDebug(6100) << "kjava_class = " << kjava_class << endl; if( kjava_class.isNull() ) // Should not happen return; - QDir dir( kjava_class ); + TQDir dir( kjava_class ); dir.cdUp(); kdDebug(6100) << "dir = " << dir.absPath() << endl; - const QStringList entries = dir.entryList( "*.jar" ); + const TQStringList entries = dir.entryList( "*.jar" ); kdDebug(6100) << "entries = " << entries.join( ":" ) << endl; - QString classes; + TQString classes; { - QStringList::ConstIterator it = entries.begin(); - const QStringList::ConstIterator itEnd = entries.end(); + TQStringList::ConstIterator it = entries.begin(); + const TQStringList::ConstIterator itEnd = entries.end(); for( ; it != itEnd; ++it ) { if( !classes.isEmpty() ) @@ -272,12 +272,12 @@ void KJavaAppletServer::setupJava( KJavaProcess *p ) p->setClasspath( classes ); // Fix all the extra arguments - const QString extraArgs = config.readEntry( "JavaArgs" ); + const TQString extraArgs = config.readEntry( "JavaArgs" ); p->setExtraArgs( extraArgs ); if( config.readBoolEntry( "UseSecurityManager", true ) ) { - QString class_file = locate( "data", "kjava/kjava.policy" ); + TQString class_file = locate( "data", "kjava/kjava.policy" ); p->setSystemProperty( "java.security.policy", class_file ); p->setSystemProperty( "java.security.manager", @@ -287,7 +287,7 @@ void KJavaAppletServer::setupJava( KJavaProcess *p ) d->useKIO = config.readBoolEntry( "UseKio", false); if( d->useKIO ) { - p->setSystemProperty( "kjas.useKio", QString::null ); + p->setSystemProperty( "kjas.useKio", TQString::null ); } //check for http proxies... @@ -298,12 +298,12 @@ void KJavaAppletServer::setupJava( KJavaProcess *p ) // this is a workaround for now // FIXME const KURL dummyURL( "http://www.kde.org/" ); - const QString httpProxy = KProtocolManager::proxyForURL(dummyURL); + const TQString httpProxy = KProtocolManager::proxyForURL(dummyURL); kdDebug(6100) << "httpProxy is " << httpProxy << endl; const KURL url( httpProxy ); p->setSystemProperty( "http.proxyHost", url.host() ); - p->setSystemProperty( "http.proxyPort", QString::number( url.port() ) ); + p->setSystemProperty( "http.proxyPort", TQString::number( url.port() ) ); } //set the main class to run @@ -317,8 +317,8 @@ void KJavaAppletServer::createContext( int contextId, KJavaAppletContext* contex d->contexts.insert( contextId, context ); - QStringList args; - args.append( QString::number( contextId ) ); + TQStringList args; + args.append( TQString::number( contextId ) ); process->send( KJAS_CREATE_CONTEXT, args ); } @@ -328,18 +328,18 @@ void KJavaAppletServer::destroyContext( int contextId ) if ( d->javaProcessFailed ) return; d->contexts.remove( contextId ); - QStringList args; - args.append( QString::number( contextId ) ); + TQStringList args; + args.append( TQString::number( contextId ) ); process->send( KJAS_DESTROY_CONTEXT, args ); } bool KJavaAppletServer::createApplet( int contextId, int appletId, - const QString & name, const QString & clazzName, - const QString & baseURL, const QString & user, - const QString & password, const QString & authname, - const QString & codeBase, const QString & jarFile, - QSize size, const QMap<QString,QString>& params, - const QString & windowTitle ) + const TQString & name, const TQString & clazzName, + const TQString & baseURL, const TQString & user, + const TQString & password, const TQString & authname, + const TQString & codeBase, const TQString & jarFile, + TQSize size, const TQMap<TQString,TQString>& params, + const TQString & windowTitle ) { // kdDebug(6100) << "createApplet: contextId = " << contextId << endl // << " appletId = " << appletId << endl @@ -353,9 +353,9 @@ bool KJavaAppletServer::createApplet( int contextId, int appletId, if ( d->javaProcessFailed ) return false; - QStringList args; - args.append( QString::number( contextId ) ); - args.append( QString::number( appletId ) ); + TQStringList args; + args.append( TQString::number( contextId ) ); + args.append( TQString::number( appletId ) ); //it's ok if these are empty strings, I take care of it later... args.append( name ); @@ -367,18 +367,18 @@ bool KJavaAppletServer::createApplet( int contextId, int appletId, args.append( codeBase ); args.append( jarFile ); - args.append( QString::number( size.width() ) ); - args.append( QString::number( size.height() ) ); + args.append( TQString::number( size.width() ) ); + args.append( TQString::number( size.height() ) ); args.append( windowTitle ); //add on the number of parameter pairs... const int num = params.count(); - const QString num_params = QString("%1").arg( num, 8 ); + const TQString num_params = TQString("%1").arg( num, 8 ); args.append( num_params ); - QMap< QString, QString >::ConstIterator it = params.begin(); - const QMap< QString, QString >::ConstIterator itEnd = params.end(); + TQMap< TQString, TQString >::ConstIterator it = params.begin(); + const TQMap< TQString, TQString >::ConstIterator itEnd = params.end(); for( ; it != itEnd; ++it ) { @@ -394,9 +394,9 @@ bool KJavaAppletServer::createApplet( int contextId, int appletId, void KJavaAppletServer::initApplet( int contextId, int appletId ) { if ( d->javaProcessFailed ) return; - QStringList args; - args.append( QString::number( contextId ) ); - args.append( QString::number( appletId ) ); + TQStringList args; + args.append( TQString::number( contextId ) ); + args.append( TQString::number( appletId ) ); process->send( KJAS_INIT_APPLET, args ); } @@ -404,9 +404,9 @@ void KJavaAppletServer::initApplet( int contextId, int appletId ) void KJavaAppletServer::destroyApplet( int contextId, int appletId ) { if ( d->javaProcessFailed ) return; - QStringList args; - args.append( QString::number(contextId) ); - args.append( QString::number(appletId) ); + TQStringList args; + args.append( TQString::number(contextId) ); + args.append( TQString::number(appletId) ); process->send( KJAS_DESTROY_APPLET, args ); } @@ -414,9 +414,9 @@ void KJavaAppletServer::destroyApplet( int contextId, int appletId ) void KJavaAppletServer::startApplet( int contextId, int appletId ) { if ( d->javaProcessFailed ) return; - QStringList args; - args.append( QString::number(contextId) ); - args.append( QString::number(appletId) ); + TQStringList args; + args.append( TQString::number(contextId) ); + args.append( TQString::number(appletId) ); process->send( KJAS_START_APPLET, args ); } @@ -424,24 +424,24 @@ void KJavaAppletServer::startApplet( int contextId, int appletId ) void KJavaAppletServer::stopApplet( int contextId, int appletId ) { if ( d->javaProcessFailed ) return; - QStringList args; - args.append( QString::number(contextId) ); - args.append( QString::number(appletId) ); + TQStringList args; + args.append( TQString::number(contextId) ); + args.append( TQString::number(appletId) ); process->send( KJAS_STOP_APPLET, args ); } void KJavaAppletServer::showConsole() { if ( d->javaProcessFailed ) return; - QStringList args; + TQStringList args; process->send( KJAS_SHOW_CONSOLE, args ); } -void KJavaAppletServer::sendURLData( int loaderID, int code, const QByteArray& data ) +void KJavaAppletServer::sendURLData( int loaderID, int code, const TQByteArray& data ) { - QStringList args; - args.append( QString::number(loaderID) ); - args.append( QString::number(code) ); + TQStringList args; + args.append( TQString::number(loaderID) ); + args.append( TQString::number(code) ); process->send( KJAS_URLDATA, args, data ); } @@ -457,19 +457,19 @@ void KJavaAppletServer::removeDataJob( int loaderID ) void KJavaAppletServer::quit() { - const QStringList args; + const TQStringList args; process->send( KJAS_SHUTDOWN_SERVER, args ); process->flushBuffers(); process->wait( 10 ); } -void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) +void KJavaAppletServer::slotJavaRequest( const TQByteArray& qb ) { // qb should be one command only without the length string, // we parse out the command and it's meaning here... - QString cmd; - QStringList args; + TQString cmd; + TQStringList args; int index = 0; const int qb_size = qb.size(); @@ -478,7 +478,7 @@ void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) ++index; //skip the next sep //get contextID - QString contextID; + TQString contextID; while( qb[index] != 0 && index < qb_size ) { contextID += qb[ index++ ]; @@ -504,7 +504,7 @@ void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) if (ok) { KIOJobMap::iterator it = d->kiojobs.find( ID_num ); if (ok && it != d->kiojobs.end()) { - QByteArray qba; + TQByteArray qba; qba.setRawData(qb.data() + index, qb.size() - index - 1); it.data()->data(qba); qba.resetRawData(qb.data() + index, qb.size() - index - 1); @@ -522,8 +522,8 @@ void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) kdError(6100) << "Missing separation byte" << endl; sep_pos = qb_size; } - //kdDebug(6100) << "KJavaAppletServer::slotJavaRequest: "<< QString::fromLocal8Bit( qb.data() + index, sep_pos - index ) << endl; - args.append( QString::fromLocal8Bit( qb.data() + index, sep_pos - index ) ); + //kdDebug(6100) << "KJavaAppletServer::slotJavaRequest: "<< TQString::fromLocal8Bit( qb.data() + index, sep_pos - index ) << endl; + args.append( TQString::fromLocal8Bit( qb.data() + index, sep_pos - index ) ); index = sep_pos + 1; //skip the sep } //here I should find the context and call the method directly @@ -531,19 +531,19 @@ void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) switch( cmd_code ) { case KJAS_SHOW_DOCUMENT: - cmd = QString::fromLatin1( "showdocument" ); + cmd = TQString::fromLatin1( "showdocument" ); break; case KJAS_SHOW_URLINFRAME: - cmd = QString::fromLatin1( "showurlinframe" ); + cmd = TQString::fromLatin1( "showurlinframe" ); break; case KJAS_SHOW_STATUS: - cmd = QString::fromLatin1( "showstatus" ); + cmd = TQString::fromLatin1( "showstatus" ); break; case KJAS_RESIZE_APPLET: - cmd = QString::fromLatin1( "resizeapplet" ); + cmd = TQString::fromLatin1( "resizeapplet" ); break; case KJAS_GET_URLDATA: @@ -573,7 +573,7 @@ void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) kdError(6100) << "KIO Data command error " << ok << " args:" << args.size() << endl; return; case KJAS_JAVASCRIPT_EVENT: - cmd = QString::fromLatin1( "JS_Event" ); + cmd = TQString::fromLatin1( "JS_Event" ); kdDebug(6100) << "Javascript request: "<< contextID << " code: " << args[0] << endl; break; @@ -593,37 +593,37 @@ void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) return; } case KJAS_AUDIOCLIP_PLAY: - cmd = QString::fromLatin1( "audioclip_play" ); + cmd = TQString::fromLatin1( "audioclip_play" ); kdDebug(6100) << "Audio Play: url=" << args[0] << endl; break; case KJAS_AUDIOCLIP_LOOP: - cmd = QString::fromLatin1( "audioclip_loop" ); + cmd = TQString::fromLatin1( "audioclip_loop" ); kdDebug(6100) << "Audio Loop: url=" << args[0] << endl; break; case KJAS_AUDIOCLIP_STOP: - cmd = QString::fromLatin1( "audioclip_stop" ); + cmd = TQString::fromLatin1( "audioclip_stop" ); kdDebug(6100) << "Audio Stop: url=" << args[0] << endl; break; case KJAS_APPLET_STATE: kdDebug(6100) << "Applet State Notification for Applet " << args[0] << ". New state=" << args[1] << endl; - cmd = QString::fromLatin1( "AppletStateNotification" ); + cmd = TQString::fromLatin1( "AppletStateNotification" ); break; case KJAS_APPLET_FAILED: kdDebug(6100) << "Applet " << args[0] << " Failed: " << args[1] << endl; - cmd = QString::fromLatin1( "AppletFailed" ); + cmd = TQString::fromLatin1( "AppletFailed" ); break; case KJAS_SECURITY_CONFIRM: { if (KSSL::doesSSLWork() && !d->kssl) d->kssl = new KSSL; - QStringList sl; - QCString answer( "invalid" ); + TQStringList sl; + TQCString answer( "invalid" ); if (!d->kssl) { answer = "nossl"; } else if (args.size() > 2) { const int certsnr = args[1].toInt(); - QString text; - QPtrList<KSSLCertificate> certs; + TQString text; + TQPtrList<KSSLCertificate> certs; certs.setAutoDelete( true ); for (int i = certsnr; i >= 0; --i) { KSSLCertificate * cert = KSSLCertificate::fromString(args[i+2].ascii()); @@ -666,12 +666,12 @@ void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) default: text += i18n("Unknown"); break; } - text += QString(")\n"); - QString subject = cert->getSubject() + QChar('\n'); - QRegExp reg(QString("/[A-Z]+=")); + text += TQString(")\n"); + TQString subject = cert->getSubject() + TQChar('\n'); + TQRegExp reg(TQString("/[A-Z]+=")); int pos = 0; while ((pos = subject.find(reg, pos)) > -1) - subject.replace(pos, 1, QString("\n ")); + subject.replace(pos, 1, TQString("\n ")); text += subject.mid(1); } } @@ -683,8 +683,8 @@ void KJavaAppletServer::slotJavaRequest( const QByteArray& qb ) answer = PermissionDialog( qApp->activeWindow() ).exec( text, args[0] ); } } - sl.push_front( QString(answer) ); - sl.push_front( QString::number(ID_num) ); + sl.push_front( TQString(answer) ); + sl.push_front( TQString::number(ID_num) ); process->send( KJAS_SECURITY_CONFIRM, sl ); return; } @@ -716,7 +716,7 @@ void KJavaAppletServer::endWaitForReturnData() { it.data()->exit = true; } -void KJavaAppletServer::timerEvent(QTimerEvent *) { +void KJavaAppletServer::timerEvent(TQTimerEvent *) { endWaitForReturnData(); kdDebug(6100) << "KJavaAppletServer::timerEvent timeout" << endl; } @@ -726,15 +726,15 @@ void KJavaAppletServer::waitForReturnData(JSStackFrame * frame) { killTimers(); startTimer(15000); while (!frame->exit) - kapp->eventLoop()->processEvents (QEventLoop::AllEvents | QEventLoop::WaitForMore); + kapp->eventLoop()->processEvents (TQEventLoop::AllEvents | TQEventLoop::WaitForMore); if (d->jsstack.size() <= 1) killTimers(); kdDebug(6100) << "<KJavaAppletServer::waitForReturnData stacksize:" << d->jsstack.size() << endl; } -bool KJavaAppletServer::getMember(QStringList & args, QStringList & ret_args) { +bool KJavaAppletServer::getMember(TQStringList & args, TQStringList & ret_args) { JSStackFrame frame( d->jsstack, ret_args ); - args.push_front( QString::number(frame.ticket) ); + args.push_front( TQString::number(frame.ticket) ); process->send( KJAS_GET_MEMBER, args ); waitForReturnData( &frame ); @@ -742,10 +742,10 @@ bool KJavaAppletServer::getMember(QStringList & args, QStringList & ret_args) { return frame.ready; } -bool KJavaAppletServer::putMember( QStringList & args ) { - QStringList ret_args; +bool KJavaAppletServer::putMember( TQStringList & args ) { + TQStringList ret_args; JSStackFrame frame( d->jsstack, ret_args ); - args.push_front( QString::number(frame.ticket) ); + args.push_front( TQString::number(frame.ticket) ); process->send( KJAS_PUT_MEMBER, args ); waitForReturnData( &frame ); @@ -753,9 +753,9 @@ bool KJavaAppletServer::putMember( QStringList & args ) { return frame.ready && ret_args.count() > 0 && ret_args[0].toInt(); } -bool KJavaAppletServer::callMember(QStringList & args, QStringList & ret_args) { +bool KJavaAppletServer::callMember(TQStringList & args, TQStringList & ret_args) { JSStackFrame frame( d->jsstack, ret_args ); - args.push_front( QString::number(frame.ticket) ); + args.push_front( TQString::number(frame.ticket) ); process->send( KJAS_CALL_MEMBER, args ); waitForReturnData( &frame ); @@ -763,7 +763,7 @@ bool KJavaAppletServer::callMember(QStringList & args, QStringList & ret_args) { return frame.ready; } -void KJavaAppletServer::derefObject( QStringList & args ) { +void KJavaAppletServer::derefObject( TQStringList & args ) { process->send( KJAS_DEREF_OBJECT, args ); } @@ -772,48 +772,48 @@ bool KJavaAppletServer::usingKIO() { } -PermissionDialog::PermissionDialog( QWidget* parent ) - : QObject(parent), m_button("no") +PermissionDialog::PermissionDialog( TQWidget* parent ) + : TQObject(parent), m_button("no") {} -QCString PermissionDialog::exec( const QString & cert, const QString & perm ) { - QGuardedPtr<QDialog> dialog = new QDialog( static_cast<QWidget*>(parent()), "PermissionDialog"); +TQCString PermissionDialog::exec( const TQString & cert, const TQString & perm ) { + TQGuardedPtr<TQDialog> dialog = new TQDialog( static_cast<TQWidget*>(parent()), "PermissionDialog"); - dialog->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, dialog->sizePolicy().hasHeightForWidth() ) ); + dialog->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, dialog->sizePolicy().hasHeightForWidth() ) ); dialog->setModal( true ); dialog->setCaption( i18n("Security Alert") ); - QVBoxLayout* const dialogLayout = new QVBoxLayout( dialog, 11, 6, "dialogLayout"); + TQVBoxLayout* const dialogLayout = new TQVBoxLayout( dialog, 11, 6, "dialogLayout"); - dialogLayout->addWidget( new QLabel( i18n("Do you grant Java applet with certificate(s):"), dialog ) ); - dialogLayout->addWidget( new QLabel( cert, dialog, "message" ) ); - dialogLayout->addWidget( new QLabel( i18n("the following permission"), dialog, "message" ) ); - dialogLayout->addWidget( new QLabel( perm, dialog, "message" ) ); - QSpacerItem* const spacer2 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); + dialogLayout->addWidget( new TQLabel( i18n("Do you grant Java applet with certificate(s):"), dialog ) ); + dialogLayout->addWidget( new TQLabel( cert, dialog, "message" ) ); + dialogLayout->addWidget( new TQLabel( i18n("the following permission"), dialog, "message" ) ); + dialogLayout->addWidget( new TQLabel( perm, dialog, "message" ) ); + TQSpacerItem* const spacer2 = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); dialogLayout->addItem( spacer2 ); - QHBoxLayout* const buttonLayout = new QHBoxLayout( 0, 0, 6, "buttonLayout"); + TQHBoxLayout* const buttonLayout = new TQHBoxLayout( 0, 0, 6, "buttonLayout"); - QPushButton* const no = new QPushButton( i18n("&No"), dialog, "no" ); + TQPushButton* const no = new TQPushButton( i18n("&No"), dialog, "no" ); no->setDefault( true ); buttonLayout->addWidget( no ); - QPushButton* const reject = new QPushButton( i18n("&Reject All"), dialog, "reject" ); + TQPushButton* const reject = new TQPushButton( i18n("&Reject All"), dialog, "reject" ); buttonLayout->addWidget( reject ); - QPushButton* const yes = new QPushButton( i18n("&Yes"), dialog, "yes" ); + TQPushButton* const yes = new TQPushButton( i18n("&Yes"), dialog, "yes" ); buttonLayout->addWidget( yes ); - QPushButton* const grant = new QPushButton( i18n("&Grant All"), dialog, "grant" ); + TQPushButton* const grant = new TQPushButton( i18n("&Grant All"), dialog, "grant" ); buttonLayout->addWidget( grant ); dialogLayout->addLayout( buttonLayout ); dialog->resize( dialog->minimumSizeHint() ); //clearWState( WState_Polished ); - connect( no, SIGNAL( clicked() ), this, SLOT( clicked() ) ); - connect( reject, SIGNAL( clicked() ), this, SLOT( clicked() ) ); - connect( yes, SIGNAL( clicked() ), this, SLOT( clicked() ) ); - connect( grant, SIGNAL( clicked() ), this, SLOT( clicked() ) ); + connect( no, TQT_SIGNAL( clicked() ), this, TQT_SLOT( clicked() ) ); + connect( reject, TQT_SIGNAL( clicked() ), this, TQT_SLOT( clicked() ) ); + connect( yes, TQT_SIGNAL( clicked() ), this, TQT_SLOT( clicked() ) ); + connect( grant, TQT_SIGNAL( clicked() ), this, TQT_SLOT( clicked() ) ); dialog->exec(); delete dialog; @@ -827,7 +827,7 @@ PermissionDialog::~PermissionDialog() void PermissionDialog::clicked() { m_button = sender()->name(); - static_cast<const QWidget*>(sender())->parentWidget()->close(); + static_cast<const TQWidget*>(sender())->parentWidget()->close(); } #include "kjavaappletserver.moc" diff --git a/khtml/java/kjavaappletserver.h b/khtml/java/kjavaappletserver.h index 674afb4ad..08d0f2983 100644 --- a/khtml/java/kjavaappletserver.h +++ b/khtml/java/kjavaappletserver.h @@ -25,8 +25,8 @@ #define KJAVAAPPLETSERVER_H #include "kjavaprocess.h" -#include <qobject.h> -#include <qmap.h> +#include <tqobject.h> +#include <tqmap.h> /** @@ -68,7 +68,7 @@ public: * while the applet is being loaded. If the java process could not be * started, an error message is displayed instead. */ - static QString getAppletLabel(); + static TQString getAppletLabel(); /** * Create an applet context with the specified id. @@ -86,12 +86,12 @@ public: * name, class etc. are specified in the same way as in the HTML APPLET tag. */ bool createApplet( int contextId, int appletId, - const QString & name, const QString & clazzName, - const QString & baseURL, const QString & user, - const QString & password, const QString & authname, - const QString & codeBase, const QString & jarFile, - QSize size, const QMap<QString, QString>& params, - const QString & windowTitle ); + const TQString & name, const TQString & clazzName, + const TQString & baseURL, const TQString & user, + const TQString & password, const TQString & authname, + const TQString & codeBase, const TQString & jarFile, + TQSize size, const TQMap<TQString, TQString>& params, + const TQString & windowTitle ); /** * This should be called by the KJavaAppletWidget @@ -122,7 +122,7 @@ public: * Send data we got back from a KJavaDownloader back to the appropriate * class loader. */ - void sendURLData( int loaderID, int code, const QByteArray& data ); + void sendURLData( int loaderID, int code, const TQByteArray& data ); /** * Removes KJavaDownloader from the list (deletes it too). */ @@ -134,15 +134,15 @@ public: void quit(); KJavaProcess* javaProcess() { return process; } - QString appletLabel(); + TQString appletLabel(); void waitForReturnData(JSStackFrame *); void endWaitForReturnData(); - bool getMember(QStringList & args, QStringList & ret_args); - bool putMember(QStringList & args); - bool callMember(QStringList & args, QStringList & ret_args); - void derefObject(QStringList & args); + bool getMember(TQStringList & args, TQStringList & ret_args); + bool putMember(TQStringList & args); + bool callMember(TQStringList & args, TQStringList & ret_args); + void derefObject(TQStringList & args); bool usingKIO(); protected: @@ -151,9 +151,9 @@ protected: KJavaProcess* process; protected slots: - void slotJavaRequest( const QByteArray& qb ); + void slotJavaRequest( const TQByteArray& qb ); void checkShutdown(); - void timerEvent(QTimerEvent *); + void timerEvent(TQTimerEvent *); private: KJavaAppletServerPrivate* d; @@ -165,16 +165,16 @@ class PermissionDialog : public QObject { Q_OBJECT public: - PermissionDialog( QWidget* ); + PermissionDialog( TQWidget* ); ~PermissionDialog(); - QCString exec( const QString & cert, const QString & perm ); + TQCString exec( const TQString & cert, const TQString & perm ); private slots: void clicked(); private: - QCString m_button; + TQCString m_button; }; #endif // KJAVAAPPLETSERVER_H diff --git a/khtml/java/kjavaappletviewer.cpp b/khtml/java/kjavaappletviewer.cpp index 53e8b4512..d4c8e266f 100644 --- a/khtml/java/kjavaappletviewer.cpp +++ b/khtml/java/kjavaappletviewer.cpp @@ -22,12 +22,12 @@ #ifdef KDE_USE_FINAL #undef Always #endif -#include <qdir.h> -#include <qtable.h> -#include <qpair.h> -#include <qtimer.h> -#include <qguardedptr.h> -#include <qlabel.h> +#include <tqdir.h> +#include <tqtable.h> +#include <tqpair.h> +#include <tqtimer.h> +#include <tqguardedptr.h> +#include <tqlabel.h> #include <klibloader.h> #include <kaboutdata.h> @@ -59,8 +59,8 @@ KJavaAppletViewerFactory::~KJavaAppletViewerFactory () { } KParts::Part *KJavaAppletViewerFactory::createPartObject - (QWidget *wparent, const char *wname, - QObject *parent, const char * name, const char *, const QStringList & args) { + (TQWidget *wparent, const char *wname, + TQObject *parent, const char * name, const char *, const TQStringList & args) { return new KJavaAppletViewer (wparent, wname, parent, name, args); } @@ -74,12 +74,12 @@ public: KJavaServerMaintainer () { } ~KJavaServerMaintainer (); - KJavaAppletContext * getContext (QObject*, const QString &); - void releaseContext (QObject*, const QString &); + KJavaAppletContext * getContext (TQObject*, const TQString &); + void releaseContext (TQObject*, const TQString &); void setServer (KJavaAppletServer * s); - QGuardedPtr <KJavaAppletServer> server; + TQGuardedPtr <KJavaAppletServer> server; private: - typedef QMap <QPair <QObject*, QString>, QPair <KJavaAppletContext*, int> > + typedef TQMap <QPair <TQObject*, TQString>, QPair <KJavaAppletContext*, int> > ContextMap; ContextMap m_contextmap; }; @@ -88,7 +88,7 @@ KJavaServerMaintainer::~KJavaServerMaintainer () { delete server; } -KJavaAppletContext * KJavaServerMaintainer::getContext (QObject * w, const QString & doc) { +KJavaAppletContext * KJavaServerMaintainer::getContext (TQObject * w, const TQString & doc) { ContextMap::key_type key = qMakePair (w, doc); ContextMap::iterator it = m_contextmap.find (key); if (it != m_contextmap.end ()) { @@ -100,7 +100,7 @@ KJavaAppletContext * KJavaServerMaintainer::getContext (QObject * w, const QStri return context; } -void KJavaServerMaintainer::releaseContext (QObject * w, const QString & doc) { +void KJavaServerMaintainer::releaseContext (TQObject * w, const TQString & doc) { ContextMap::iterator it = m_contextmap.find (qMakePair (w, doc)); if (it != m_contextmap.end () && --(*it).second <= 0) { kdDebug(6100) << "KJavaServerMaintainer::releaseContext" << endl; @@ -123,31 +123,31 @@ AppletParameterDialog::AppletParameterDialog (KJavaAppletWidget * parent) KDialogBase::Close, KDialogBase::Close, true), m_appletWidget (parent) { KJavaApplet* const applet = parent->applet (); - table = new QTable (30, 2, this); - table->setMinimumSize (QSize (600, 400)); + table = new TQTable (30, 2, this); + table->setMinimumSize (TQSize (600, 400)); table->setColumnWidth (0, 200); table->setColumnWidth (1, 340); - QHeader* const header = table->horizontalHeader(); + TQHeader* const header = table->horizontalHeader(); header->setLabel (0, i18n ("Parameter")); header->setLabel (1, i18n ("Value")); - QTableItem * tit = new QTableItem (table, QTableItem::Never, i18n("Class")); + TQTableItem * tit = new TQTableItem (table, TQTableItem::Never, i18n("Class")); table->setItem (0, 0, tit); - tit = new QTableItem(table, QTableItem::Always, applet->appletClass()); + tit = new TQTableItem(table, TQTableItem::Always, applet->appletClass()); table->setItem (0, 1, tit); - tit = new QTableItem (table, QTableItem::Never, i18n ("Base URL")); + tit = new TQTableItem (table, TQTableItem::Never, i18n ("Base URL")); table->setItem (1, 0, tit); - tit = new QTableItem(table, QTableItem::Always, applet->baseURL()); + tit = new TQTableItem(table, TQTableItem::Always, applet->baseURL()); table->setItem (1, 1, tit); - tit = new QTableItem (table, QTableItem::Never, i18n ("Archives")); + tit = new TQTableItem (table, TQTableItem::Never, i18n ("Archives")); table->setItem (2, 0, tit); - tit = new QTableItem(table, QTableItem::Always, applet->archives()); + tit = new TQTableItem(table, TQTableItem::Always, applet->archives()); table->setItem (2, 1, tit); - QMap<QString,QString>::const_iterator it = applet->getParams().begin(); - const QMap<QString,QString>::const_iterator itEnd = applet->getParams().end(); + TQMap<TQString,TQString>::const_iterator it = applet->getParams().begin(); + const TQMap<TQString,TQString>::const_iterator itEnd = applet->getParams().end(); for (int count = 2; it != itEnd; ++it) { - tit = new QTableItem (table, QTableItem::Always, it.key ()); + tit = new TQTableItem (table, TQTableItem::Always, it.key ()); table->setItem (++count, 0, tit); - tit = new QTableItem(table, QTableItem::Always, it.data ()); + tit = new TQTableItem(table, TQTableItem::Always, it.data ()); table->setItem (count, 1, tit); } setMainWidget (table); @@ -169,18 +169,18 @@ void AppletParameterDialog::slotClose () { } //----------------------------------------------------------------------------- -class CoverWidget : public QWidget { +class CoverWidget : public TQWidget { KJavaAppletWidget * m_appletwidget; public: - CoverWidget (QWidget *); + CoverWidget (TQWidget *); ~CoverWidget () {} KJavaAppletWidget * appletWidget () const; protected: - void resizeEvent (QResizeEvent * e); + void resizeEvent (TQResizeEvent * e); }; -inline CoverWidget::CoverWidget (QWidget * parent) - : QWidget (parent, "KJavaAppletViewer Widget") +inline CoverWidget::CoverWidget (TQWidget * parent) + : TQWidget (parent, "KJavaAppletViewer Widget") { m_appletwidget = new KJavaAppletWidget (this); setFocusProxy (m_appletwidget); @@ -190,27 +190,27 @@ inline KJavaAppletWidget * CoverWidget::appletWidget () const { return m_appletwidget; } -void CoverWidget::resizeEvent (QResizeEvent * e) { +void CoverWidget::resizeEvent (TQResizeEvent * e) { m_appletwidget->resize (e->size().width(), e->size().height()); } //----------------------------------------------------------------------------- -class StatusBarIcon : public QLabel { +class StatusBarIcon : public TQLabel { public: - StatusBarIcon (QWidget * parent) : QLabel (parent) { - setPixmap (SmallIcon (QString ("java"), KJavaAppletViewerFactory::instance ())); + StatusBarIcon (TQWidget * parent) : TQLabel (parent) { + setPixmap (SmallIcon (TQString ("java"), KJavaAppletViewerFactory::instance ())); } protected: - void mousePressEvent (QMouseEvent *) { + void mousePressEvent (TQMouseEvent *) { serverMaintainer->server->showConsole (); } }; //----------------------------------------------------------------------------- -KJavaAppletViewer::KJavaAppletViewer (QWidget * wparent, const char *, - QObject * parent, const char * name, const QStringList & args) +KJavaAppletViewer::KJavaAppletViewer (TQWidget * wparent, const char *, + TQObject * parent, const char * name, const TQStringList & args) : KParts::ReadOnlyPart (parent, name), m_browserextension (new KJavaAppletViewerBrowserExtension (this)), m_liveconnect (new KJavaAppletViewerLiveConnectExtension (this)), @@ -223,49 +223,49 @@ KJavaAppletViewer::KJavaAppletViewer (QWidget * wparent, const char *, new KJavaServerMaintainer); } m_view = new CoverWidget (wparent); - QString classname, classid, codebase, khtml_codebase, src_param; + TQString classname, classid, codebase, khtml_codebase, src_param; int width = -1; int height = -1; KJavaApplet* const applet = m_view->appletWidget()->applet (); - QStringList::const_iterator it = args.begin(); - const QStringList::const_iterator itEnd = args.end(); + TQStringList::const_iterator it = args.begin(); + const TQStringList::const_iterator itEnd = args.end(); for ( ; it != itEnd; ++it) { const int equalPos = (*it).find("="); if (equalPos > 0) { - const QString name = (*it).left (equalPos).upper (); - QString value = (*it).right ((*it).length () - equalPos - 1); + const TQString name = (*it).left (equalPos).upper (); + TQString value = (*it).right ((*it).length () - equalPos - 1); if (value.at(0)=='\"') value = value.right (value.length () - 1); if (value.at (value.length () - 1) == '\"') value.truncate (value.length () - 1); kdDebug(6100) << "name=" << name << " value=" << value << endl; if (!name.isEmpty()) { - const QString name_lower = name.lower (); + const TQString name_lower = name.lower (); if (name == "__KHTML__PLUGINBASEURL") { - baseurl = KURL (KURL (value), QString (".")).url (); + baseurl = KURL (KURL (value), TQString (".")).url (); } else if (name == "__KHTML__CODEBASE") khtml_codebase = value; - else if (name_lower == QString::fromLatin1("codebase") || - name_lower == QString::fromLatin1("java_codebase")) { + else if (name_lower == TQString::fromLatin1("codebase") || + name_lower == TQString::fromLatin1("java_codebase")) { if (!value.isEmpty ()) codebase = value; } else if (name == "__KHTML__CLASSID") - //else if (name.lower()==QString::fromLatin1("classid")) + //else if (name.lower()==TQString::fromLatin1("classid")) classid = value; - else if (name_lower == QString::fromLatin1("code") || - name_lower == QString::fromLatin1("java_code")) + else if (name_lower == TQString::fromLatin1("code") || + name_lower == TQString::fromLatin1("java_code")) classname = value; - else if (name_lower == QString::fromLatin1("src")) + else if (name_lower == TQString::fromLatin1("src")) src_param = value; - else if (name_lower == QString::fromLatin1("archive") || - name_lower == QString::fromLatin1("java_archive") || + else if (name_lower == TQString::fromLatin1("archive") || + name_lower == TQString::fromLatin1("java_archive") || name_lower.startsWith ("cache_archive")) applet->setArchives (value); - else if (name_lower == QString::fromLatin1("name")) + else if (name_lower == TQString::fromLatin1("name")) applet->setAppletName (value); - else if (name_lower == QString::fromLatin1("width")) + else if (name_lower == TQString::fromLatin1("width")) width = value.toInt(); - else if (name_lower == QString::fromLatin1("height")) + else if (name_lower == TQString::fromLatin1("height")) height = value.toInt(); if (!name.startsWith ("__KHTML__")) { applet->setParameter (name, value); @@ -285,19 +285,19 @@ KJavaAppletViewer::KJavaAppletViewer (QWidget * wparent, const char *, if (classname.isEmpty ()) classname = src_param; else if (!src_param.isEmpty ()) - applet->setParameter (QString ("SRC"), src_param); + applet->setParameter (TQString ("SRC"), src_param); if (codebase.isEmpty ()) codebase = khtml_codebase; if (baseurl.isEmpty ()) { // not embeded in khtml - QString pwd = QDir().absPath (); - if (!pwd.endsWith (QChar (QDir::separator ()))) - pwd += QDir::separator (); + TQString pwd = TQDir().absPath (); + if (!pwd.endsWith (TQChar (TQDir::separator ()))) + pwd += TQDir::separator (); baseurl = KURL (KURL (pwd), codebase).url (); } if (width > 0 && height > 0) { m_view->resize (width, height); - applet->setSize( QSize( width, height ) ); + applet->setSize( TQSize( width, height ) ); } applet->setBaseURL (baseurl); // check codebase first @@ -316,23 +316,23 @@ KJavaAppletViewer::KJavaAppletViewer (QWidget * wparent, const char *, if (!server->usingKIO ()) { /* if this page needs authentication */ KIO::AuthInfo info; - QString errorMsg; - QCString replyType; - QByteArray params; - QByteArray reply; + TQString errorMsg; + TQCString replyType; + TQByteArray params; + TQByteArray reply; KIO::AuthInfo authResult; //(void) dcopClient(); // Make sure to have a dcop client. info.url = baseurl; info.verifyPath = true; - QDataStream stream(params, IO_WriteOnly); + TQDataStream stream(params, IO_WriteOnly); stream << info << m_view->topLevelWidget()->winId(); if (!kapp->dcopClient ()->call( "kded", "kpasswdserver", "checkAuthInfo(KIO::AuthInfo, long int)", params, replyType, reply ) ) { kdWarning() << "Can't communicate with kded_kpasswdserver!" << endl; } else if ( replyType == "KIO::AuthInfo" ) { - QDataStream stream2( reply, IO_ReadOnly ); + TQDataStream stream2( reply, IO_ReadOnly ); stream2 >> authResult; applet->setUser (authResult.username); applet->setPassword (authResult.password); @@ -347,18 +347,18 @@ KJavaAppletViewer::KJavaAppletViewer (QWidget * wparent, const char *, setInstance (KJavaAppletViewerFactory::instance ()); KParts::Part::setWidget (m_view); - connect (applet->getContext(), SIGNAL(appletLoaded()), this, SLOT(appletLoaded())); - connect (applet->getContext(), SIGNAL(showDocument(const QString&, const QString&)), m_browserextension, SLOT(showDocument(const QString&, const QString&))); - connect (applet->getContext(), SIGNAL(showStatus(const QString &)), this, SLOT(infoMessage(const QString &))); - connect (applet, SIGNAL(jsEvent (const QStringList &)), m_liveconnect, SLOT(jsEvent (const QStringList &))); + connect (applet->getContext(), TQT_SIGNAL(appletLoaded()), this, TQT_SLOT(appletLoaded())); + connect (applet->getContext(), TQT_SIGNAL(showDocument(const TQString&, const TQString&)), m_browserextension, TQT_SLOT(showDocument(const TQString&, const TQString&))); + connect (applet->getContext(), TQT_SIGNAL(showStatus(const TQString &)), this, TQT_SLOT(infoMessage(const TQString &))); + connect (applet, TQT_SIGNAL(jsEvent (const TQStringList &)), m_liveconnect, TQT_SLOT(jsEvent (const TQStringList &))); } -bool KJavaAppletViewer::eventFilter (QObject *o, QEvent *e) { +bool KJavaAppletViewer::eventFilter (TQObject *o, TQEvent *e) { if (m_liveconnect->jsSessions () > 0) { switch (e->type()) { - case QEvent::Destroy: - case QEvent::Close: - case QEvent::Quit: + case TQEvent::Destroy: + case TQEvent::Close: + case TQEvent::Quit: return true; default: break; @@ -404,7 +404,7 @@ bool KJavaAppletViewer::openURL (const KURL & url) { if (applet->size().width() > 0 || m_view->isVisible()) w->showApplet (); else - QTimer::singleShot (10, this, SLOT (delayedCreateTimeOut ())); + TQTimer::singleShot (10, this, TQT_SLOT (delayedCreateTimeOut ())); if (!applet->failed ()) emit started (0L); return url.isValid (); @@ -443,7 +443,7 @@ void KJavaAppletViewer::appletLoaded () { emit completed(); } -void KJavaAppletViewer::infoMessage (const QString & msg) { +void KJavaAppletViewer::infoMessage (const TQString & msg) { m_browserextension->infoMessage(msg); } @@ -457,7 +457,7 @@ KJavaAppletViewerBrowserExtension::KJavaAppletViewerBrowserExtension (KJavaApple : KParts::BrowserExtension (parent, "KJavaAppletViewer Browser Extension") { } -void KJavaAppletViewerBrowserExtension::urlChanged (const QString & url) { +void KJavaAppletViewerBrowserExtension::urlChanged (const TQString & url) { emit setLocationBarURL (url); } @@ -468,24 +468,24 @@ void KJavaAppletViewerBrowserExtension::setLoadingProgress (int percentage) { void KJavaAppletViewerBrowserExtension::setURLArgs (const KParts::URLArgs & /*args*/) { } -void KJavaAppletViewerBrowserExtension::saveState (QDataStream & stream) { +void KJavaAppletViewerBrowserExtension::saveState (TQDataStream & stream) { KJavaApplet* const applet = static_cast<KJavaAppletViewer*>(parent())->view()->appletWidget ()->applet (); stream << applet->appletClass(); stream << applet->baseURL(); stream << applet->archives(); stream << applet->getParams().size (); - QMap<QString,QString>::const_iterator it = applet->getParams().begin(); - const QMap<QString,QString>::const_iterator itEnd = applet->getParams().end(); + TQMap<TQString,TQString>::const_iterator it = applet->getParams().begin(); + const TQMap<TQString,TQString>::const_iterator itEnd = applet->getParams().end(); for ( ; it != itEnd; ++it) { stream << it.key (); stream << it.data (); } } -void KJavaAppletViewerBrowserExtension::restoreState (QDataStream & stream) { +void KJavaAppletViewerBrowserExtension::restoreState (TQDataStream & stream) { KJavaAppletWidget* const w = static_cast<KJavaAppletViewer*>(parent())->view()->appletWidget(); KJavaApplet* const applet = w->applet (); - QString key, val; + TQString key, val; int paramcount; stream >> val; applet->setAppletClass (val); @@ -505,8 +505,8 @@ void KJavaAppletViewerBrowserExtension::restoreState (QDataStream & stream) { w->showApplet (); } -void KJavaAppletViewerBrowserExtension::showDocument (const QString & doc, - const QString & frame) { +void KJavaAppletViewerBrowserExtension::showDocument (const TQString & doc, + const TQString & frame) { const KURL url (doc); KParts::URLArgs args; args.frameName = frame; @@ -520,16 +520,16 @@ KJavaAppletViewerLiveConnectExtension::KJavaAppletViewerLiveConnectExtension(KJa } bool KJavaAppletViewerLiveConnectExtension::get ( - const unsigned long objid, const QString & name, + const unsigned long objid, const TQString & name, KParts::LiveConnectExtension::Type & type, - unsigned long & rid, QString & value) + unsigned long & rid, TQString & value) { if (!m_viewer->appletAlive ()) return false; - QStringList args, ret_args; + TQStringList args, ret_args; KJavaApplet* const applet = m_viewer->view ()->appletWidget ()->applet (); - args.append (QString::number (applet->appletId ())); - args.append (QString::number ((int) objid)); + args.append (TQString::number (applet->appletId ())); + args.append (TQString::number ((int) objid)); args.append (name); m_jssessions++; const bool ret = applet->getContext()->getMember (args, ret_args); @@ -545,14 +545,14 @@ bool KJavaAppletViewerLiveConnectExtension::get ( return true; } -bool KJavaAppletViewerLiveConnectExtension::put(const unsigned long objid, const QString & name, const QString & value) +bool KJavaAppletViewerLiveConnectExtension::put(const unsigned long objid, const TQString & name, const TQString & value) { if (!m_viewer->appletAlive ()) return false; - QStringList args; + TQStringList args; KJavaApplet* const applet = m_viewer->view ()->appletWidget ()->applet (); - args.append (QString::number (applet->appletId ())); - args.append (QString::number ((int) objid)); + args.append (TQString::number (applet->appletId ())); + args.append (TQString::number ((int) objid)); args.append (name); args.append (value); ++m_jssessions; @@ -561,19 +561,19 @@ bool KJavaAppletViewerLiveConnectExtension::put(const unsigned long objid, const return ret; } -bool KJavaAppletViewerLiveConnectExtension::call( const unsigned long objid, const QString & func, const QStringList & fargs, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value ) +bool KJavaAppletViewerLiveConnectExtension::call( const unsigned long objid, const TQString & func, const TQStringList & fargs, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, TQString & value ) { if (!m_viewer->appletAlive ()) return false; KJavaApplet* const applet = m_viewer->view ()->appletWidget ()->applet (); - QStringList args, ret_args; - args.append (QString::number (applet->appletId ())); - args.append (QString::number ((int) objid)); + TQStringList args, ret_args; + args.append (TQString::number (applet->appletId ())); + args.append (TQString::number ((int) objid)); args.append (func); - args.append (QString::number ((int) fargs.size ())); + args.append (TQString::number ((int) fargs.size ())); { - QStringList::const_iterator it = fargs.begin(); - const QStringList::const_iterator itEnd = fargs.end(); + TQStringList::const_iterator it = fargs.begin(); + const TQStringList::const_iterator itEnd = fargs.end(); for ( ; it != itEnd; ++it) args.append(*it); } @@ -602,27 +602,27 @@ void KJavaAppletViewerLiveConnectExtension::unregister(const unsigned long objid // no need to send to the jvm return; } - QStringList args; - args.append (QString::number (applet->appletId ())); - args.append (QString::number ((int) objid)); + TQStringList args; + args.append (TQString::number (applet->appletId ())); + args.append (TQString::number ((int) objid)); applet->getContext()->derefObject (args); } -void KJavaAppletViewerLiveConnectExtension::jsEvent (const QStringList & args) { +void KJavaAppletViewerLiveConnectExtension::jsEvent (const TQStringList & args) { if (args.count () < 2 || !m_viewer->appletAlive ()) return; bool ok; - QStringList::ConstIterator it = args.begin(); - const QStringList::ConstIterator itEnd = args.end(); + TQStringList::ConstIterator it = args.begin(); + const TQStringList::ConstIterator itEnd = args.end(); const unsigned long objid = (*it).toInt(&ok); ++it; - const QString event = (*it); + const TQString event = (*it); ++it; KParts::LiveConnectExtension::ArgList arglist; for (; it != itEnd; ++it) { // take a deep breath here - const QStringList::ConstIterator prev = it++; + const TQStringList::ConstIterator prev = it++; arglist.push_back(KParts::LiveConnectExtension::ArgList::value_type((KParts::LiveConnectExtension::Type) (*prev).toInt(), (*it))); } emit partEvent (objid, event, arglist); diff --git a/khtml/java/kjavaappletviewer.h b/khtml/java/kjavaappletviewer.h index 4d8b676cd..16f837b45 100644 --- a/khtml/java/kjavaappletviewer.h +++ b/khtml/java/kjavaappletviewer.h @@ -29,9 +29,9 @@ #include <kparts/factory.h> #include <kdialogbase.h> #include <kurl.h> -#include <qobject.h> -#include <qstringlist.h> -#include <qguardedptr.h> +#include <tqobject.h> +#include <tqstringlist.h> +#include <tqguardedptr.h> #include "kjavaappletwidget.h" @@ -48,14 +48,14 @@ class KJavaAppletViewerBrowserExtension : public KParts::BrowserExtension { Q_OBJECT public: KJavaAppletViewerBrowserExtension (KJavaAppletViewer *parent); - void urlChanged (const QString & url); + void urlChanged (const TQString & url); void setLoadingProgress (int percentage); void setURLArgs (const KParts::URLArgs & args); - void saveState (QDataStream & stream); - void restoreState (QDataStream & stream); + void saveState (TQDataStream & stream); + void restoreState (TQDataStream & stream); public slots: - void showDocument (const QString & doc, const QString & frame); + void showDocument (const TQString & doc, const TQString & frame); }; class KJavaAppletViewerLiveConnectExtension : public KParts::LiveConnectExtension { @@ -63,16 +63,16 @@ class KJavaAppletViewerLiveConnectExtension : public KParts::LiveConnectExtensio public: KJavaAppletViewerLiveConnectExtension(KJavaAppletViewer * parent); - bool get (const unsigned long objid, const QString & field, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value); - bool put(const unsigned long, const QString & field, const QString & value); - bool call (const unsigned long , const QString & func, const QStringList & args, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value); + bool get (const unsigned long objid, const TQString & field, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, TQString & value); + bool put(const unsigned long, const TQString & field, const TQString & value); + bool call (const unsigned long , const TQString & func, const TQStringList & args, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, TQString & value); void unregister (const unsigned long objid); int jsSessions () const { return m_jssessions; } public slots: - void jsEvent (const QStringList & args); + void jsEvent (const TQStringList & args); signals: - virtual void partEvent (const unsigned long objid, const QString & event, const KParts::LiveConnectExtension::ArgList & args); + virtual void partEvent (const unsigned long objid, const TQString & event, const KParts::LiveConnectExtension::ArgList & args); private: KJavaAppletViewer * m_viewer; @@ -82,8 +82,8 @@ private: class KJavaAppletViewer : public KParts::ReadOnlyPart { Q_OBJECT public: - KJavaAppletViewer (QWidget * wparent, const char * wname, - QObject * parent, const char * name, const QStringList &args); + KJavaAppletViewer (TQWidget * wparent, const char * wname, + TQObject * parent, const char * name, const TQStringList &args); ~KJavaAppletViewer (); CoverWidget * view () const { return m_view; } static KAboutData* createAboutData (); @@ -93,27 +93,27 @@ public: KParts::LiveConnectExtension * liveConnectExtension () const { return m_liveconnect; } - bool eventFilter (QObject *o, QEvent *e); + bool eventFilter (TQObject *o, TQEvent *e); bool appletAlive () const; public slots: virtual bool openURL (const KURL & url); virtual bool closeURL (); void appletLoaded (); - void infoMessage (const QString &); + void infoMessage (const TQString &); protected: bool openFile(); private slots: void delayedCreateTimeOut (); private: - QGuardedPtr <CoverWidget> m_view; + TQGuardedPtr <CoverWidget> m_view; KConfig * m_config; KJavaProcess * process; KJavaAppletViewerBrowserExtension * m_browserextension; KJavaAppletViewerLiveConnectExtension * m_liveconnect; KParts::StatusBarExtension * m_statusbar; - QGuardedPtr <QLabel> m_statusbar_icon; - QString baseurl; + TQGuardedPtr <TQLabel> m_statusbar_icon; + TQString baseurl; bool m_closed; }; @@ -123,9 +123,9 @@ public: KJavaAppletViewerFactory (); virtual ~KJavaAppletViewerFactory (); virtual KParts::Part *createPartObject - (QWidget *wparent, const char *wname, - QObject *parent, const char *name, - const char *className, const QStringList &args); + (TQWidget *wparent, const char *wname, + TQObject *parent, const char *name, + const char *className, const TQStringList &args); static KInstance * instance () { return s_instance; } private: static KInstance * s_instance; @@ -139,7 +139,7 @@ protected slots: void slotClose (); private: KJavaAppletWidget * m_appletWidget; - QTable * table; + TQTable * table; }; #endif diff --git a/khtml/java/kjavaappletwidget.cpp b/khtml/java/kjavaappletwidget.cpp index 31ce8b5e6..1299ce7e8 100644 --- a/khtml/java/kjavaappletwidget.cpp +++ b/khtml/java/kjavaappletwidget.cpp @@ -26,7 +26,7 @@ #include <kdebug.h> #include <klocale.h> -#include <qlabel.h> +#include <tqlabel.h> // For future expansion @@ -34,12 +34,12 @@ class KJavaAppletWidgetPrivate { friend class KJavaAppletWidget; private: - QLabel* tmplabel; + TQLabel* tmplabel; }; int KJavaAppletWidget::appletCount = 0; -KJavaAppletWidget::KJavaAppletWidget( QWidget* parent, const char* name ) +KJavaAppletWidget::KJavaAppletWidget( TQWidget* parent, const char* name ) : QXEmbed ( parent, name) { setProtocol(QXEmbed::XPLAIN); @@ -48,10 +48,10 @@ KJavaAppletWidget::KJavaAppletWidget( QWidget* parent, const char* name ) d = new KJavaAppletWidgetPrivate; m_kwm = new KWinModule( this ); - d->tmplabel = new QLabel( this ); + d->tmplabel = new TQLabel( this ); d->tmplabel->setText( KJavaAppletServer::getAppletLabel() ); d->tmplabel->setAlignment( Qt::AlignCenter | Qt::WordBreak ); - d->tmplabel->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); + d->tmplabel->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken ); d->tmplabel->show(); m_swallowTitle.sprintf( "KJAS Applet - Ticket number %u", appletCount++ ); @@ -66,8 +66,8 @@ KJavaAppletWidget::~KJavaAppletWidget() void KJavaAppletWidget::showApplet() { - connect( m_kwm, SIGNAL( windowAdded( WId ) ), - this, SLOT( setWindow( WId ) ) ); + connect( m_kwm, TQT_SIGNAL( windowAdded( WId ) ), + this, TQT_SLOT( setWindow( WId ) ) ); m_kwm->doNotManage( m_swallowTitle ); @@ -89,8 +89,8 @@ void KJavaAppletWidget::setWindow( WId w ) d->tmplabel = 0; // disconnect from KWM events - disconnect( m_kwm, SIGNAL( windowAdded( WId ) ), - this, SLOT( setWindow( WId ) ) ); + disconnect( m_kwm, TQT_SIGNAL( windowAdded( WId ) ), + this, TQT_SLOT( setWindow( WId ) ) ); embed( w ); @@ -98,16 +98,16 @@ void KJavaAppletWidget::setWindow( WId w ) } } -QSize KJavaAppletWidget::sizeHint() const +TQSize KJavaAppletWidget::sizeHint() const { kdDebug(6100) << "KJavaAppletWidget::sizeHint()" << endl; - QSize rval = QXEmbed::sizeHint(); + TQSize rval = QXEmbed::sizeHint(); if( rval.width() == 0 || rval.height() == 0 ) { if( width() != 0 && height() != 0 ) { - rval = QSize( width(), height() ); + rval = TQSize( width(), height() ); } } @@ -121,13 +121,13 @@ void KJavaAppletWidget::resize( int w, int h ) if( d->tmplabel ) { d->tmplabel->resize( w, h ); - m_applet->setSize( QSize( w, h ) ); + m_applet->setSize( TQSize( w, h ) ); } QXEmbed::resize( w, h ); } -void KJavaAppletWidget::showEvent (QShowEvent * e) { +void KJavaAppletWidget::showEvent (TQShowEvent * e) { QXEmbed::showEvent(e); if (!applet()->isCreated() && !applet()->appletClass().isEmpty()) { // delayed showApplet diff --git a/khtml/java/kjavaappletwidget.h b/khtml/java/kjavaappletwidget.h index 24973c648..18f5be341 100644 --- a/khtml/java/kjavaappletwidget.h +++ b/khtml/java/kjavaappletwidget.h @@ -24,7 +24,7 @@ #ifndef KJAVAAPPLETWIDGET_H #define KJAVAAPPLETWIDGET_H -#include <qwidget.h> +#include <tqwidget.h> #ifndef Q_WS_QWS //FIXME(?) I don't think this is possible with Qt Embedded #include "java/kjavaappletcontext.h" #include "java/kjavaapplet.h" @@ -53,7 +53,7 @@ * This widget works by using the KJavaAppletServer, which fires off a * Java server process with which it communicates using the * KDE Java Applet Server (KJAS) protocol over stdin and stdout. - * The applet windows are swallowed and attached to the QWidget, but they are + * The applet windows are swallowed and attached to the TQWidget, but they are * actually running in a different process. This has the advantage of robustness * and reusability. The details of the communication are hidden from the user * in the KJASAppletServer class. Normally only a single server process is used for @@ -79,7 +79,7 @@ class KJavaAppletWidget : public QXEmbed { Q_OBJECT public: - KJavaAppletWidget( QWidget* parent=0, const char* name=0 ); + KJavaAppletWidget( TQWidget* parent=0, const char* name=0 ); ~KJavaAppletWidget(); @@ -96,7 +96,7 @@ public: */ void showApplet(); - QSize sizeHint() const; + TQSize sizeHint() const; void resize( int, int ); protected slots: @@ -109,14 +109,14 @@ protected slots: protected: //The counter to generate ID's for the applets static int appletCount; - void showEvent (QShowEvent *); + void showEvent (TQShowEvent *); private: KJavaAppletWidgetPrivate* d; KJavaApplet* m_applet; KWinModule* m_kwm; - QString m_swallowTitle; + TQString m_swallowTitle; }; diff --git a/khtml/java/kjavadownloader.cpp b/khtml/java/kjavadownloader.cpp index 8241fdea5..60334cbf0 100644 --- a/khtml/java/kjavadownloader.cpp +++ b/khtml/java/kjavadownloader.cpp @@ -26,7 +26,7 @@ #include <kio/job.h> #include <kio/jobclasses.h> #include <kdebug.h> -#include <qfile.h> +#include <tqfile.h> static const int DATA = 0; static const int FINISHED = 1; @@ -43,7 +43,7 @@ static const int KJAS_RESUME = 2; KJavaKIOJob::~KJavaKIOJob() {} -void KJavaKIOJob::data( const QByteArray& ) +void KJavaKIOJob::data( const TQByteArray& ) { kdError(6100) << "Job id mixup" << endl; } @@ -63,14 +63,14 @@ public: private: int loaderID; KURL* url; - QByteArray file; + TQByteArray file; KIO::TransferJob* job; int responseCode; bool isfirstdata; }; -KJavaDownloader::KJavaDownloader( int ID, const QString& url ) +KJavaDownloader::KJavaDownloader( int ID, const TQString& url ) { kdDebug(6100) << "KJavaDownloader(" << ID << ") = " << url << endl; @@ -81,14 +81,14 @@ KJavaDownloader::KJavaDownloader( int ID, const QString& url ) d->job = KIO::get( *d->url, false, false ); d->job->addMetaData("PropagateHttpHeader", "true"); - connect( d->job, SIGNAL(data( KIO::Job*, const QByteArray& )), - this, SLOT(slotData( KIO::Job*, const QByteArray& )) ); - connect( d->job, SIGNAL(connected(KIO::Job*)), - this, SLOT(slotConnected(KIO::Job*))); - connect( d->job, SIGNAL(mimetype(KIO::Job*, const QString&)), - this, SLOT(slotMimetype(KIO::Job*, const QString&))); - connect( d->job, SIGNAL(result(KIO::Job*)), - this, SLOT(slotResult(KIO::Job*)) ); + connect( d->job, TQT_SIGNAL(data( KIO::Job*, const TQByteArray& )), + this, TQT_SLOT(slotData( KIO::Job*, const TQByteArray& )) ); + connect( d->job, TQT_SIGNAL(connected(KIO::Job*)), + this, TQT_SLOT(slotConnected(KIO::Job*))); + connect( d->job, TQT_SIGNAL(mimetype(KIO::Job*, const TQString&)), + this, TQT_SLOT(slotMimetype(KIO::Job*, const TQString&))); + connect( d->job, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotResult(KIO::Job*)) ); } KJavaDownloader::~KJavaDownloader() @@ -96,13 +96,13 @@ KJavaDownloader::~KJavaDownloader() delete d; } -void KJavaDownloader::slotData( KIO::Job*, const QByteArray& qb ) +void KJavaDownloader::slotData( KIO::Job*, const TQByteArray& qb ) { //kdDebug(6100) << "slotData(" << d->loaderID << ")" << endl; KJavaAppletServer* server = KJavaAppletServer::allocateJavaServer(); if (d->isfirstdata) { - QString headers = d->job->queryMetaData("HTTP-Headers"); + TQString headers = d->job->queryMetaData("HTTP-Headers"); if (!headers.isEmpty()) { d->file.resize( headers.length() ); memcpy( d->file.data(), headers.ascii(), headers.length() ); @@ -122,7 +122,7 @@ void KJavaDownloader::slotConnected(KIO::Job*) d->responseCode = d->job->error(); } -void KJavaDownloader::slotMimetype(KIO::Job*, const QString & type) { +void KJavaDownloader::slotMimetype(KIO::Job*, const TQString & type) { kdDebug(6100) << "slave mimetype " << type << endl; } @@ -137,7 +137,7 @@ void KJavaDownloader::slotResult( KIO::Job* ) int code = d->job->error(); if (!code) code = 404; - QString codestr = QString::number(code); + TQString codestr = TQString::number(code); d->file.resize(codestr.length()); memcpy( d->file.data(), codestr.ascii(), codestr.length() ); kdDebug(6100) << "slave had an error = " << code << endl; @@ -191,12 +191,12 @@ public: } int loaderID; KURL* url; - QByteArray file; + TQByteArray file; KIO::TransferJob* job; bool finished; }; -KJavaUploader::KJavaUploader( int ID, const QString& url ) +KJavaUploader::KJavaUploader( int ID, const TQString& url ) { kdDebug(6100) << "KJavaUploader(" << ID << ") = " << url << endl; @@ -215,10 +215,10 @@ void KJavaUploader::start() // create a suspended job d->job = KIO::put( *d->url, -1, false, false, false ); d->job->suspend(); - connect( d->job, SIGNAL(dataReq( KIO::Job*, QByteArray& )), - this, SLOT(slotDataRequest( KIO::Job*, QByteArray& )) ); - connect( d->job, SIGNAL(result(KIO::Job*)), - this, SLOT(slotResult(KIO::Job*)) ); + connect( d->job, TQT_SIGNAL(dataReq( KIO::Job*, TQByteArray& )), + this, TQT_SLOT(slotDataRequest( KIO::Job*, TQByteArray& )) ); + connect( d->job, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotResult(KIO::Job*)) ); server->sendURLData( d->loaderID, CONNECTED, d->file ); KJavaAppletServer::freeJavaServer(); } @@ -228,7 +228,7 @@ KJavaUploader::~KJavaUploader() delete d; } -void KJavaUploader::slotDataRequest( KIO::Job*, QByteArray& qb ) +void KJavaUploader::slotDataRequest( KIO::Job*, TQByteArray& qb ) { // send our data and suspend kdDebug(6100) << "slotDataRequest(" << d->loaderID << ") finished:" << d->finished << endl; @@ -248,7 +248,7 @@ void KJavaUploader::slotDataRequest( KIO::Job*, QByteArray& qb ) KJavaAppletServer::freeJavaServer(); } -void KJavaUploader::data( const QByteArray& qb ) +void KJavaUploader::data( const TQByteArray& qb ) { kdDebug(6100) << "KJavaUploader::data(" << d->loaderID << ")" << endl; d->file.resize( qb.size() ); @@ -266,7 +266,7 @@ void KJavaUploader::slotResult( KIO::Job* ) if (d->job->error()) { int code = d->job->error(); - QString codestr = QString::number(code); + TQString codestr = TQString::number(code); d->file.resize(codestr.length()); memcpy( d->file.data(), codestr.ascii(), codestr.length() ); kdDebug(6100) << "slave had an error " << code << ": " << d->job->errorString() << endl; diff --git a/khtml/java/kjavadownloader.h b/khtml/java/kjavadownloader.h index f49d8fe0c..d3cf0de41 100644 --- a/khtml/java/kjavadownloader.h +++ b/khtml/java/kjavadownloader.h @@ -22,7 +22,7 @@ #ifndef KJAVADOWNLOADER_H #define KJAVADOWNLOADER_H -#include <qobject.h> +#include <tqobject.h> /** * @short A class for handling downloads from KIO @@ -46,7 +46,7 @@ Q_OBJECT public: virtual ~KJavaKIOJob(); virtual void jobCommand( int cmd ) = 0; - virtual void data( const QByteArray& qb ); + virtual void data( const TQByteArray& qb ); }; class KJavaDownloader : public KJavaKIOJob @@ -54,14 +54,14 @@ class KJavaDownloader : public KJavaKIOJob Q_OBJECT public: - KJavaDownloader( int ID, const QString& url ); + KJavaDownloader( int ID, const TQString& url ); ~KJavaDownloader(); virtual void jobCommand( int cmd ); protected slots: - void slotData( KIO::Job*, const QByteArray& ); + void slotData( KIO::Job*, const TQByteArray& ); void slotConnected( KIO::Job* ); - void slotMimetype( KIO::Job*, const QString& ); + void slotMimetype( KIO::Job*, const TQString& ); void slotResult( KIO::Job* ); private: @@ -74,14 +74,14 @@ class KJavaUploader : public KJavaKIOJob Q_OBJECT public: - KJavaUploader( int ID, const QString& url ); + KJavaUploader( int ID, const TQString& url ); ~KJavaUploader(); virtual void jobCommand( int cmd ); - virtual void data( const QByteArray& qb ); + virtual void data( const TQByteArray& qb ); void start(); protected slots: - void slotDataRequest( KIO::Job*, QByteArray& ); + void slotDataRequest( KIO::Job*, TQByteArray& ); void slotResult( KIO::Job* ); private: KJavaUploaderPrivate* d; diff --git a/khtml/java/kjavaprocess.cpp b/khtml/java/kjavaprocess.cpp index cdc69bcc0..1c9f1b346 100644 --- a/khtml/java/kjavaprocess.cpp +++ b/khtml/java/kjavaprocess.cpp @@ -24,25 +24,25 @@ #include <kdebug.h> #include <kio/kprotocolmanager.h> -#include <qtextstream.h> -#include <qmap.h> +#include <tqtextstream.h> +#include <tqmap.h> #include <config.h> #include <unistd.h> -#include <qptrlist.h> +#include <tqptrlist.h> class KJavaProcessPrivate { friend class KJavaProcess; private: - QString jvmPath; - QString classPath; - QString mainClass; - QString extraArgs; - QString classArgs; - QPtrList<QByteArray> BufferList; - QMap<QString, QString> systemProps; + TQString jvmPath; + TQString classPath; + TQString mainClass; + TQString extraArgs; + TQString classArgs; + TQPtrList<TQByteArray> BufferList; + TQMap<TQString, TQString> systemProps; bool processKilled; }; @@ -54,12 +54,12 @@ KJavaProcess::KJavaProcess() : KProcess() javaProcess = this; //new KProcess(); - connect( javaProcess, SIGNAL( wroteStdin( KProcess * ) ), - this, SLOT( slotWroteData() ) ); - connect( javaProcess, SIGNAL( receivedStdout( int, int& ) ), - this, SLOT( slotReceivedData(int, int&) ) ); - connect( javaProcess, SIGNAL( processExited (KProcess *) ), - this, SLOT( slotExited (KProcess *) ) ); + connect( javaProcess, TQT_SIGNAL( wroteStdin( KProcess * ) ), + this, TQT_SLOT( slotWroteData() ) ); + connect( javaProcess, TQT_SIGNAL( receivedStdout( int, int& ) ), + this, TQT_SLOT( slotReceivedData(int, int&) ) ); + connect( javaProcess, TQT_SIGNAL( processExited (KProcess *) ), + this, TQT_SLOT( slotExited (KProcess *) ) ); d->jvmPath = "java"; d->mainClass = "-help"; @@ -92,47 +92,47 @@ void KJavaProcess::stopJava() killJVM(); } -void KJavaProcess::setJVMPath( const QString& path ) +void KJavaProcess::setJVMPath( const TQString& path ) { d->jvmPath = path; } -void KJavaProcess::setClasspath( const QString& classpath ) +void KJavaProcess::setClasspath( const TQString& classpath ) { d->classPath = classpath; } -void KJavaProcess::setSystemProperty( const QString& name, - const QString& value ) +void KJavaProcess::setSystemProperty( const TQString& name, + const TQString& value ) { d->systemProps.insert( name, value ); } -void KJavaProcess::setMainClass( const QString& className ) +void KJavaProcess::setMainClass( const TQString& className ) { d->mainClass = className; } -void KJavaProcess::setExtraArgs( const QString& args ) +void KJavaProcess::setExtraArgs( const TQString& args ) { d->extraArgs = args; } -void KJavaProcess::setClassArgs( const QString& args ) +void KJavaProcess::setClassArgs( const TQString& args ) { d->classArgs = args; } //Private Utility Functions used by the two send() methods -QByteArray* KJavaProcess::addArgs( char cmd_code, const QStringList& args ) +TQByteArray* KJavaProcess::addArgs( char cmd_code, const TQStringList& args ) { //the buffer to store stuff, etc. - QByteArray* const buff = new QByteArray(); - QTextOStream output( *buff ); + TQByteArray* const buff = new TQByteArray(); + TQTextOStream output( *buff ); const char sep = 0; //make space for the command size: 8 characters... - const QCString space( " " ); + const TQCString space( " " ); output << space; //write command code @@ -145,8 +145,8 @@ QByteArray* KJavaProcess::addArgs( char cmd_code, const QStringList& args ) } else { - QStringList::ConstIterator it = args.begin(); - const QStringList::ConstIterator itEnd = args.end(); + TQStringList::ConstIterator it = args.begin(); + const TQStringList::ConstIterator itEnd = args.end(); for( ; it != itEnd; ++it ) { if( !(*it).isEmpty() ) @@ -160,10 +160,10 @@ QByteArray* KJavaProcess::addArgs( char cmd_code, const QStringList& args ) return buff; } -void KJavaProcess::storeSize( QByteArray* buff ) +void KJavaProcess::storeSize( TQByteArray* buff ) { const int size = buff->size() - 8; //subtract out the length of the size_str - const QString size_str = QString("%1").arg( size, 8 ); + const TQString size_str = TQString("%1").arg( size, 8 ); kdDebug(6100) << "KJavaProcess::storeSize, size = " << size_str << endl; const char* size_ptr = size_str.latin1(); @@ -171,7 +171,7 @@ void KJavaProcess::storeSize( QByteArray* buff ) buff->at(i) = size_ptr[i]; } -void KJavaProcess::sendBuffer( QByteArray* buff ) +void KJavaProcess::sendBuffer( TQByteArray* buff ) { d->BufferList.append( buff ); if( d->BufferList.count() == 1) @@ -180,25 +180,25 @@ void KJavaProcess::sendBuffer( QByteArray* buff ) } } -void KJavaProcess::send( char cmd_code, const QStringList& args ) +void KJavaProcess::send( char cmd_code, const TQStringList& args ) { if( isRunning() ) { - QByteArray* const buff = addArgs( cmd_code, args ); + TQByteArray* const buff = addArgs( cmd_code, args ); storeSize( buff ); kdDebug(6100) << "<KJavaProcess::send " << (int)cmd_code << endl; sendBuffer( buff ); } } -void KJavaProcess::send( char cmd_code, const QStringList& args, - const QByteArray& data ) +void KJavaProcess::send( char cmd_code, const TQStringList& args, + const TQByteArray& data ) { if( isRunning() ) { kdDebug(6100) << "KJavaProcess::send, qbytearray is size = " << data.size() << endl; - QByteArray* const buff = addArgs( cmd_code, args ); + TQByteArray* const buff = addArgs( cmd_code, args ); const int cur_size = buff->size(); const int data_size = data.size(); buff->resize( cur_size + data_size ); @@ -211,7 +211,7 @@ void KJavaProcess::send( char cmd_code, const QStringList& args, void KJavaProcess::popBuffer() { - QByteArray* const buf = d->BufferList.first(); + TQByteArray* const buf = d->BufferList.first(); if( buf ) { // DEBUG stuff... @@ -261,12 +261,12 @@ bool KJavaProcess::invokeJVM() } //set the system properties, iterate through the qmap of system properties - QMap<QString,QString>::ConstIterator it = d->systemProps.begin(); - const QMap<QString,QString>::ConstIterator itEnd = d->systemProps.end(); + TQMap<TQString,TQString>::ConstIterator it = d->systemProps.begin(); + const TQMap<TQString,TQString>::ConstIterator itEnd = d->systemProps.end(); for( ; it != itEnd; ++it ) { - QString currarg; + TQString currarg; if( !it.key().isEmpty() ) { @@ -284,9 +284,9 @@ bool KJavaProcess::invokeJVM() { // BUG HERE: if an argument contains space (-Dname="My name") // this parsing will fail. Need more sophisticated parsing -- use KShell? - const QStringList args = QStringList::split( " ", d->extraArgs ); - QStringList::ConstIterator it = args.begin(); - const QStringList::ConstIterator itEnd = args.end(); + const TQStringList args = TQStringList::split( " ", d->extraArgs ); + TQStringList::ConstIterator it = args.begin(); + const TQStringList::ConstIterator itEnd = args.end(); for ( ; it != itEnd; ++it ) *javaProcess << *it; } @@ -297,10 +297,10 @@ bool KJavaProcess::invokeJVM() *javaProcess << d->classArgs; kdDebug(6100) << "Invoking JVM now...with arguments = " << endl; - QString argStr; - QTextOStream stream( &argStr ); - const QValueList<QCString> args = javaProcess->args(); - qCopy( args.begin(), args.end(), QTextOStreamIterator<QCString>( stream, " " ) ); + TQString argStr; + TQTextOStream stream( &argStr ); + const TQValueList<TQCString> args = javaProcess->args(); + qCopy( args.begin(), args.end(), TQTextOStreamIterator<TQCString>( stream, " " ) ); kdDebug(6100) << argStr << endl; KProcess::Communication flags = (KProcess::Communication) @@ -319,8 +319,8 @@ bool KJavaProcess::invokeJVM() void KJavaProcess::killJVM() { d->processKilled = true; - disconnect( javaProcess, SIGNAL( receivedStdout( int, int& ) ), - this, SLOT( slotReceivedData(int, int&) ) ); + disconnect( javaProcess, TQT_SIGNAL( receivedStdout( int, int& ) ), + this, TQT_SLOT( slotReceivedData(int, int&) ) ); javaProcess->kill(); } @@ -355,7 +355,7 @@ void KJavaProcess::slotReceivedData( int fd, int& len ) return; } - const QString lengthstr( length ); + const TQString lengthstr( length ); bool ok; const int num_len = lengthstr.toInt( &ok ); if( !ok ) @@ -376,7 +376,7 @@ void KJavaProcess::slotReceivedData( int fd, int& len ) return; } - QByteArray qb; + TQByteArray qb; emit received( qb.duplicate( msg, num_len ) ); delete[] msg; len = num_bytes + num_bytes_msg; diff --git a/khtml/java/kjavaprocess.h b/khtml/java/kjavaprocess.h index 566e8fda5..3e877685a 100644 --- a/khtml/java/kjavaprocess.h +++ b/khtml/java/kjavaprocess.h @@ -25,7 +25,7 @@ #define KJAVAPROCESS_H #include <kprocess.h> -#include <qcstring.h> +#include <tqcstring.h> /** * @short A class for invoking a Java VM @@ -71,7 +71,7 @@ public: /** * Used to specify the path to the Java executable to be run. */ - void setJVMPath( const QString& path ); + void setJVMPath( const TQString& path ); /** * This will set the classpath the Java process will use. It's used as a the @@ -80,42 +80,42 @@ public: * users to simply drop the JSSE (Java Secure Sockets Extension classes into that directory * without having to modify the jvm configuration files. */ - void setClasspath( const QString& classpath ); + void setClasspath( const TQString& classpath ); /** - * Set a property on the java command line as -Dname=value, or -Dname if value is QString::null. + * Set a property on the java command line as -Dname=value, or -Dname if value is TQString::null. * For example, you could call setSystemProperty( "kjas.debug", "" ) to set the kjas.debug property. */ - void setSystemProperty( const QString& name, const QString& value ); + void setSystemProperty( const TQString& name, const TQString& value ); /** * The class to be called when startJava() is called. */ - void setMainClass( const QString& clazzName ); + void setMainClass( const TQString& clazzName ); /** * Extra flags passed to the JVM. */ - void setExtraArgs( const QString& args ); + void setExtraArgs( const TQString& args ); /** * Arguments passed to the main class. They will be very last in the java * command line, after the main class. */ - void setClassArgs( const QString& classArgs ); + void setClassArgs( const TQString& classArgs ); /** * Sends a command to the KJAS Applet Server by building a QByteArray * out of the data, and then writes it standard out. */ - void send( char cmd_code, const QStringList& args ); + void send( char cmd_code, const TQStringList& args ); /** * Sends a command to the KJAS Applet Server by building a QByteArray * out of the data, and then writes it standard out. It adds each QString * in the arg list, and then adds the data array. */ - void send( char cmd_code, const QStringList& args, const QByteArray& data ); + void send( char cmd_code, const TQStringList& args, const TQByteArray& data ); /** * Writes all pending data to JVM @@ -145,15 +145,15 @@ protected: virtual bool invokeJVM(); virtual void killJVM(); - QByteArray* addArgs( char cmd_code, const QStringList& args ); + TQByteArray* addArgs( char cmd_code, const TQStringList& args ); void popBuffer(); - void sendBuffer( QByteArray* buff ); - void storeSize( QByteArray* buff ); + void sendBuffer( TQByteArray* buff ); + void storeSize( TQByteArray* buff ); KProcess* javaProcess; signals: - void received( const QByteArray& ); + void received( const TQByteArray& ); void exited( int status ); private: diff --git a/khtml/java/kqeventutil.cpp b/khtml/java/kqeventutil.cpp index 588051617..ff15e97da 100644 --- a/khtml/java/kqeventutil.cpp +++ b/khtml/java/kqeventutil.cpp @@ -19,180 +19,180 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qevent.h> +#include <tqevent.h> #include "kqeventutil.h" -QString KQEventUtil::getQtEventName( QEvent* e ) +TQString KQEventUtil::getQtEventName( TQEvent* e ) { - QString s; + TQString s; switch( e->type() ) { - case QEvent::None: + case TQEvent::None: s = "None"; break; - case QEvent::Timer: + case TQEvent::Timer: s = "Timer"; break; - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: s = "MouseButtonPress"; break; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: s = "MouseButtonRelease"; break; - case QEvent::MouseButtonDblClick: + case TQEvent::MouseButtonDblClick: s = "MouseButtonClick"; break; - case QEvent::MouseMove: + case TQEvent::MouseMove: s = "MouseMove"; break; - case QEvent::KeyPress: + case TQEvent::KeyPress: s = "KeyPress"; break; - case QEvent::KeyRelease: + case TQEvent::KeyRelease: s = "KeyRelease"; break; - case QEvent::FocusIn: + case TQEvent::FocusIn: s = "FocusIn"; break; - case QEvent::FocusOut: + case TQEvent::FocusOut: s = "FocusOut"; break; - case QEvent::Enter: + case TQEvent::Enter: s = "Enter"; break; - case QEvent::Leave: + case TQEvent::Leave: s = "Leave"; break; - case QEvent::Paint: + case TQEvent::Paint: s = "Paint"; break; - case QEvent::Move: + case TQEvent::Move: s = "Move"; break; - case QEvent::Resize: + case TQEvent::Resize: s = "Resize"; break; - case QEvent::Create: + case TQEvent::Create: s = "Create"; break; - case QEvent::Destroy: + case TQEvent::Destroy: s = "Destroy"; break; - case QEvent::Show: + case TQEvent::Show: s = "Show"; break; - case QEvent::Hide: + case TQEvent::Hide: s = "Hide"; break; - case QEvent::Close: + case TQEvent::Close: s = "Close"; break; - case QEvent::Quit: + case TQEvent::Quit: s = "Quit"; break; - case QEvent::Reparent: + case TQEvent::Reparent: s = "Reparent"; break; - case QEvent::ShowMinimized: + case TQEvent::ShowMinimized: s = "ShowMinimized"; break; - case QEvent::ShowNormal: + case TQEvent::ShowNormal: s = "ShowNormal"; break; - case QEvent::WindowActivate: + case TQEvent::WindowActivate: s = "WindowActivate"; break; - case QEvent::WindowDeactivate: + case TQEvent::WindowDeactivate: s = "WindowDeactivate"; break; - case QEvent::ShowToParent: + case TQEvent::ShowToParent: s = "ShowToParent"; break; - case QEvent::HideToParent: + case TQEvent::HideToParent: s = "HideToParent"; break; - case QEvent::ShowMaximized: + case TQEvent::ShowMaximized: s = "ShowMaximized"; break; - case QEvent::Accel: + case TQEvent::Accel: s = "Accel"; break; - case QEvent::Wheel: + case TQEvent::Wheel: s = "Wheel"; break; - case QEvent::AccelAvailable: + case TQEvent::AccelAvailable: s = "AccelAvailable"; break; - case QEvent::CaptionChange: + case TQEvent::CaptionChange: s = "CaptionChange"; break; - case QEvent::IconChange: + case TQEvent::IconChange: s = "IconChange"; break; - case QEvent::ParentFontChange: + case TQEvent::ParentFontChange: s = "ParentFontChange"; break; - case QEvent::ApplicationFontChange: + case TQEvent::ApplicationFontChange: s = "ApplicationFontChange"; break; - case QEvent::ParentPaletteChange: + case TQEvent::ParentPaletteChange: s = "ParentPaletteChange"; break; - case QEvent::ApplicationPaletteChange: + case TQEvent::ApplicationPaletteChange: s = "ApplicationPaletteChange"; break; - case QEvent::Clipboard: + case TQEvent::Clipboard: s = "Clipboard"; break; - case QEvent::Speech: + case TQEvent::Speech: s = "Speech"; break; - case QEvent::SockAct: + case TQEvent::SockAct: s = "SockAct"; break; - case QEvent::AccelOverride: + case TQEvent::AccelOverride: s = "AccelOverride"; break; - case QEvent::DragEnter: + case TQEvent::DragEnter: s = "DragEnter"; break; - case QEvent::DragMove: + case TQEvent::DragMove: s = "DragMove"; break; - case QEvent::DragLeave: + case TQEvent::DragLeave: s = "DragLeave"; break; - case QEvent::Drop: + case TQEvent::Drop: s = "Drop"; break; - case QEvent::DragResponse: + case TQEvent::DragResponse: s = "DragResponse"; break; - case QEvent::ChildInserted: + case TQEvent::ChildInserted: s = "ChildInserted"; break; - case QEvent::ChildRemoved: + case TQEvent::ChildRemoved: s = "ChildRemoved"; break; - case QEvent::LayoutHint: + case TQEvent::LayoutHint: s = "LayoutHint"; break; - case QEvent::ShowWindowRequest: + case TQEvent::ShowWindowRequest: s = "ShowWindowRequest"; break; - case QEvent::ActivateControl: + case TQEvent::ActivateControl: s = "ActivateControl"; break; - case QEvent::DeactivateControl: + case TQEvent::DeactivateControl: s = "DeactivateControl"; break; - case QEvent::User: + case TQEvent::User: s = "User Event"; break; default: - s = "Undefined Event, value = " + QString::number( e->type() ); + s = "Undefined Event, value = " + TQString::number( e->type() ); break; } diff --git a/khtml/java/kqeventutil.h b/khtml/java/kqeventutil.h index fd199baa1..9f5194d90 100644 --- a/khtml/java/kqeventutil.h +++ b/khtml/java/kqeventutil.h @@ -23,12 +23,12 @@ #ifndef KQEVENTUTIL_H #define KQEVENTUTIL_H -#include <qstring.h> +#include <tqstring.h> class QEvent; class KQEventUtil { public: - static QString getQtEventName(QEvent *e); + static TQString getQtEventName(TQEvent *e); }; #endif diff --git a/khtml/java/kxeventutil.cpp b/khtml/java/kxeventutil.cpp index 0eea8a744..9afa5a5ac 100644 --- a/khtml/java/kxeventutil.cpp +++ b/khtml/java/kxeventutil.cpp @@ -23,14 +23,14 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xatom.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include "kxeventutil.h" -QString KXEventUtil::getXAnyEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXAnyEventInfo(XEvent *xevent) { XAnyEvent *e = &xevent->xany; - QString winname("window"); + TQString winname("window"); switch (e->type) { case GraphicsExpose: case NoExpose: @@ -49,7 +49,7 @@ QString KXEventUtil::getXAnyEventInfo(XEvent *xevent) { default: break; } - QString s("serial=%1 send_event=%2 display=0x%3 %4=%5"); + TQString s("serial=%1 send_event=%2 display=0x%3 %4=%5"); return s.arg(e->serial) .arg(e->send_event) @@ -57,10 +57,10 @@ QString KXEventUtil::getXAnyEventInfo(XEvent *xevent) { .arg(winname) .arg(e->window); } -QString KXEventUtil::getXButtonEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXButtonEventInfo(XEvent *xevent) { XButtonEvent *e = &xevent->xbutton; - QString s("root=%1 subwindow=%2 time=%3 x=%4 y=%5 x_root=%6 y_root=%7 state=%8 button=%9"); - QString t(" same_screen=%1"); + TQString s("root=%1 subwindow=%2 time=%3 x=%4 y=%5 x_root=%6 y_root=%7 state=%8 button=%9"); + TQString t(" same_screen=%1"); return s.arg(e->root) .arg(e->subwindow) @@ -74,10 +74,10 @@ QString KXEventUtil::getXButtonEventInfo(XEvent *xevent) { +t.arg(e->same_screen); } -QString KXEventUtil::getXKeyEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXKeyEventInfo(XEvent *xevent) { XKeyEvent *e = &xevent->xkey; - QString s("root=%1 subwindow=%2 time=%3 x=%4 y=%5 x_root=%6 y_root=%7 state=%8 keycode=%9"); - QString t(" same_screen=%1"); + TQString s("root=%1 subwindow=%2 time=%3 x=%4 y=%5 x_root=%6 y_root=%7 state=%8 keycode=%9"); + TQString t(" same_screen=%1"); return s.arg(e->root) .arg(e->subwindow) @@ -91,10 +91,10 @@ QString KXEventUtil::getXKeyEventInfo(XEvent *xevent) { +t.arg(e->same_screen); } -QString KXEventUtil::getXMotionEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXMotionEventInfo(XEvent *xevent) { XMotionEvent *e = &xevent->xmotion; - QString s("root=%1 subwindow=%2 time=%3 x=%4 y=%5 x_root=%6 y_root=%7 state=%8 is_hint=%9"); - QString t(" same_screen=%1"); + TQString s("root=%1 subwindow=%2 time=%3 x=%4 y=%5 x_root=%6 y_root=%7 state=%8 is_hint=%9"); + TQString t(" same_screen=%1"); return s.arg(e->root) .arg(e->subwindow) @@ -107,9 +107,9 @@ QString KXEventUtil::getXMotionEventInfo(XEvent *xevent) { .arg(e->is_hint) +t.arg(e->same_screen); } -QString KXEventUtil::getXCrossingEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXCrossingEventInfo(XEvent *xevent) { XCrossingEvent *e = &xevent->xcrossing; - QString ms, ds; + TQString ms, ds; switch (e->mode) { case NotifyNormal: ms = "NotifyNormal"; break; case NotifyGrab: ms = "NotifyGrab"; break; @@ -125,8 +125,8 @@ QString KXEventUtil::getXCrossingEventInfo(XEvent *xevent) { default: ds="?"; } - QString s("root=%1 subwindow=%2 time=%3 x=%4 y=%5 x_root=%6 y_root=%7 mode=%8=%9 "); - QString t("detail=%1=%2 same_screen=%3 focus=%4 state=%5"); + TQString s("root=%1 subwindow=%2 time=%3 x=%4 y=%5 x_root=%6 y_root=%7 mode=%8=%9 "); + TQString t("detail=%1=%2 same_screen=%3 focus=%4 state=%5"); return s.arg(e->root) .arg(e->subwindow) @@ -142,16 +142,16 @@ QString KXEventUtil::getXCrossingEventInfo(XEvent *xevent) { .arg(e->focus) .arg(e->state); } -QString KXEventUtil::getXFocusChangeEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXFocusChangeEventInfo(XEvent *xevent) { XFocusChangeEvent *e = &xevent->xfocus; - QString s("mode=%1 detail=%2"); + TQString s("mode=%1 detail=%2"); return s.arg(e->mode) .arg(e->detail); } -QString KXEventUtil::getXExposeEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXExposeEventInfo(XEvent *xevent) { XExposeEvent *e = &xevent->xexpose; - QString s("x=%1 y=%2 width=%3 height=%4 count=%5"); + TQString s("x=%1 y=%2 width=%3 height=%4 count=%5"); return s.arg(e->x) .arg(e->y) @@ -162,9 +162,9 @@ QString KXEventUtil::getXExposeEventInfo(XEvent *xevent) { -QString KXEventUtil::getXGraphicsExposeEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXGraphicsExposeEventInfo(XEvent *xevent) { XGraphicsExposeEvent *e = &xevent->xgraphicsexpose; - QString s("x=%1 y=%2 width=%3 height=%4 count=%5 major_code=%6 minor_code=%7"); + TQString s("x=%1 y=%2 width=%3 height=%4 count=%5 major_code=%6 minor_code=%7"); return s.arg(e->x) .arg(e->y) @@ -174,18 +174,18 @@ QString KXEventUtil::getXGraphicsExposeEventInfo(XEvent *xevent) { .arg(e->major_code) .arg(e->minor_code); } -QString KXEventUtil::getXNoExposeEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXNoExposeEventInfo(XEvent *xevent) { XNoExposeEvent *e = &xevent->xnoexpose; - QString s("major_code=%1 minor_code=%2"); + TQString s("major_code=%1 minor_code=%2"); return s.arg(e->major_code) .arg(e->minor_code); } -QString KXEventUtil::getXCreateWindowEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXCreateWindowEventInfo(XEvent *xevent) { XCreateWindowEvent *e = &xevent->xcreatewindow; - QString s("window=%1 x=%2 y=%3 width=%4 height=%5 border_width=%6 override_redirect=%7"); + TQString s("window=%1 x=%2 y=%3 width=%4 height=%5 border_width=%6 override_redirect=%7"); return s.arg(e->window) .arg(e->x) @@ -196,47 +196,47 @@ QString KXEventUtil::getXCreateWindowEventInfo(XEvent *xevent) { .arg(e->override_redirect); } -QString KXEventUtil::getXDestroyWindowEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXDestroyWindowEventInfo(XEvent *xevent) { XDestroyWindowEvent *e = &xevent->xdestroywindow; - QString s("window=%1"); + TQString s("window=%1"); return s.arg(e->window); } -QString KXEventUtil::getXMapEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXMapEventInfo(XEvent *xevent) { XMapEvent *e = &xevent->xmap; - QString s("window=%1 override_redirect=%2"); + TQString s("window=%1 override_redirect=%2"); return s.arg(e->window) .arg(e->override_redirect); } -QString KXEventUtil::getXMappingEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXMappingEventInfo(XEvent *xevent) { XMappingEvent *e = &xevent->xmapping; - QString s("request=%1 first_keycode=%2 count=%3"); + TQString s("request=%1 first_keycode=%2 count=%3"); return s.arg(e->request) .arg(e->first_keycode) .arg(e->count); } -QString KXEventUtil::getXReparentEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXReparentEventInfo(XEvent *xevent) { XReparentEvent *e = &xevent->xreparent; - QString s("window=%1 parent=%2 x=%3 y=%4"); + TQString s("window=%1 parent=%2 x=%3 y=%4"); return s.arg(e->window) .arg(e->parent) .arg(e->x) .arg(e->y); } -QString KXEventUtil::getXUnmapEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXUnmapEventInfo(XEvent *xevent) { XUnmapEvent *e = &xevent->xunmap; - QString s("window=%1 from_configure=%2"); + TQString s("window=%1 from_configure=%2"); return s.arg(e->window) .arg(e->from_configure); } -QString KXEventUtil::getXConfigureEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXConfigureEventInfo(XEvent *xevent) { XConfigureEvent *e = &xevent->xconfigure; - QString s("window=%1 x=%2 y=%2 width=%3 height=%4 border_width=%5 above=%6 override_redirect=%7"); + TQString s("window=%1 x=%2 y=%2 width=%3 height=%4 border_width=%5 above=%6 override_redirect=%7"); return s.arg(e->window) .arg(e->x).arg(e->y) @@ -246,10 +246,10 @@ QString KXEventUtil::getXConfigureEventInfo(XEvent *xevent) { .arg(e->override_redirect); } -QString KXEventUtil::getXConfigureRequestEventInfo(XEvent *xevent) { +TQString KXEventUtil::getXConfigureRequestEventInfo(XEvent *xevent) { XConfigureRequestEvent *e = &xevent->xconfigurerequest; unsigned vm = e->value_mask; - QStringList vml; + TQStringList vml; if (vm & CWX) vml.append("CWX"); if (vm & CWY) vml.append("CWY"); if (vm & CWWidth) vml.append("CWWidth"); @@ -257,8 +257,8 @@ QString KXEventUtil::getXConfigureRequestEventInfo(XEvent *xevent) { if (vm & CWBorderWidth) vml.append("CWBorderWidth"); if (vm & CWSibling) vml.append("CWSibling"); if (vm & CWStackMode) vml.append("CWStackMode"); - QString vms = vml.join("|"); - QString s("window=%1 x=%2 y=%2 width=%3 height=%4 border_width=%5 above=%6 detail=%7 value_mask=0x%8=%9"); + TQString vms = vml.join("|"); + TQString s("window=%1 x=%2 y=%2 width=%3 height=%4 border_width=%5 above=%6 detail=%7 value_mask=0x%8=%9"); return s.arg(e->window) .arg(e->x).arg(e->y) @@ -269,11 +269,11 @@ QString KXEventUtil::getXConfigureRequestEventInfo(XEvent *xevent) { .arg(e->value_mask, 0, 16) .arg(vms); } -QString KXEventUtil::getX11EventInfo( XEvent* e ) +TQString KXEventUtil::getX11EventInfo( XEvent* e ) { - QString anyInfo = getXAnyEventInfo(e); - QString info = ""; - QString s; + TQString anyInfo = getXAnyEventInfo(e); + TQString info = ""; + TQString s; switch( e->type ) { case KeyPress: diff --git a/khtml/java/kxeventutil.h b/khtml/java/kxeventutil.h index ea5a49bd1..6eb0bf14b 100644 --- a/khtml/java/kxeventutil.h +++ b/khtml/java/kxeventutil.h @@ -23,29 +23,29 @@ #include <X11/X.h> #include <X11/Xlib.h> -#include <qstring.h> +#include <tqstring.h> class KXEventUtil { public: - static QString getXEventName(XEvent *e); - static QString getXAnyEventInfo(XEvent *xevent); - static QString getXButtonEventInfo(XEvent *xevent); - static QString getXKeyEventInfo(XEvent *xevent); - static QString getXMotionEventInfo(XEvent *xevent); - static QString getXCrossingEventInfo(XEvent *xevent); - static QString getXFocusChangeEventInfo(XEvent *xevent); - static QString getXExposeEventInfo(XEvent *xevent); - static QString getXGraphicsExposeEventInfo(XEvent *xevent); - static QString getXNoExposeEventInfo(XEvent *xevent); - static QString getXCreateWindowEventInfo(XEvent *xevent); - static QString getXDestroyWindowEventInfo(XEvent *xevent); - static QString getXMapEventInfo(XEvent *xevent); - static QString getXMappingEventInfo(XEvent *xevent); - static QString getXReparentEventInfo(XEvent *xevent); - static QString getXUnmapEventInfo(XEvent *xevent); - static QString getXConfigureEventInfo(XEvent *xevent); - static QString getXConfigureRequestEventInfo(XEvent *xevent); - static QString getX11EventInfo( XEvent* e ); + static TQString getXEventName(XEvent *e); + static TQString getXAnyEventInfo(XEvent *xevent); + static TQString getXButtonEventInfo(XEvent *xevent); + static TQString getXKeyEventInfo(XEvent *xevent); + static TQString getXMotionEventInfo(XEvent *xevent); + static TQString getXCrossingEventInfo(XEvent *xevent); + static TQString getXFocusChangeEventInfo(XEvent *xevent); + static TQString getXExposeEventInfo(XEvent *xevent); + static TQString getXGraphicsExposeEventInfo(XEvent *xevent); + static TQString getXNoExposeEventInfo(XEvent *xevent); + static TQString getXCreateWindowEventInfo(XEvent *xevent); + static TQString getXDestroyWindowEventInfo(XEvent *xevent); + static TQString getXMapEventInfo(XEvent *xevent); + static TQString getXMappingEventInfo(XEvent *xevent); + static TQString getXReparentEventInfo(XEvent *xevent); + static TQString getXUnmapEventInfo(XEvent *xevent); + static TQString getXConfigureEventInfo(XEvent *xevent); + static TQString getXConfigureRequestEventInfo(XEvent *xevent); + static TQString getX11EventInfo( XEvent* e ); }; #endif diff --git a/khtml/java/tests/testkjavaappletserver.cpp b/khtml/java/tests/testkjavaappletserver.cpp index f0c5da19a..63ec3ba3e 100644 --- a/khtml/java/tests/testkjavaappletserver.cpp +++ b/khtml/java/tests/testkjavaappletserver.cpp @@ -1,7 +1,7 @@ #include <kapplication.h> #include <kcmdlineargs.h> #include <kdebug.h> -#include <qstring.h> +#include <tqstring.h> #include <stdio.h> #include <unistd.h> @@ -23,7 +23,7 @@ int main(int argc, char **argv) KApplication app; - QString path_to_kdelibs = "/build/wynnw/kde-src"; + TQString path_to_kdelibs = "/build/wynnw/kde-src"; KJavaAppletWidget *a = new KJavaAppletWidget; diff --git a/khtml/khtml_caret.cpp b/khtml/khtml_caret.cpp index 55050beaa..9b819ee6c 100644 --- a/khtml/khtml_caret.cpp +++ b/khtml/khtml_caret.cpp @@ -428,7 +428,7 @@ void /*KDE_NO_EXPORT*/ mapDOMPosToRenderPos(NodeImpl *node, long offset, // index was child count or out of bounds bool atEnd = !child; #if DEBUG_CARETMODE > 5 - kdDebug(6200) << "mapDTR: child " << child << "@" << (child ? child->nodeName().string() : QString::null) << " atEnd " << atEnd << endl; + kdDebug(6200) << "mapDTR: child " << child << "@" << (child ? child->nodeName().string() : TQString::null) << " atEnd " << atEnd << endl; #endif if (atEnd) child = node->lastChild(); @@ -486,7 +486,7 @@ void /*KDE_NO_EXPORT*/ mapRenderPosToDOMPos(RenderObject *r, long r_ofs, node = r->element(); Q_ASSERT(node); #if DEBUG_CARETMODE > 5 - kdDebug(6200) << "mapRTD: r " << r << "@" << (r ? r->renderName() : QString::null) << (r && r->element() ? QString(".node ") + QString::number((unsigned)r->element(),16) + "@" + r->element()->nodeName().string() : QString::null) << " outside " << outside << " outsideEnd " << outsideEnd << endl; + kdDebug(6200) << "mapRTD: r " << r << "@" << (r ? r->renderName() : TQString::null) << (r && r->element() ? TQString(".node ") + TQString::number((unsigned)r->element(),16) + "@" + r->element()->nodeName().string() : TQString::null) << " outside " << outside << " outsideEnd " << outsideEnd << endl; #endif if (node->nodeType() == Node::ELEMENT_NODE || node->nodeType() == Node::TEXT_NODE) { @@ -512,7 +512,7 @@ void /*KDE_NO_EXPORT*/ mapRenderPosToDOMPos(RenderObject *r, long r_ofs, offset = (long)node->nodeIndex() + outsideEnd; node = parent; #if DEBUG_CARETMODE > 5 - kdDebug(6200) << node << "@" << (node ? node->nodeName().string() : QString::null) << " offset " << offset << endl; + kdDebug(6200) << node << "@" << (node ? node->nodeName().string() : TQString::null) << " offset " << offset << endl; #endif } else { // !outside inside: @@ -589,7 +589,7 @@ static RenderObject* findRenderer(NodeImpl *&node, long offset, RenderObject *r; mapDOMPosToRenderPos(node, offset, r, r_ofs, outside, outsideEnd); #if DEBUG_CARETMODE > 2 - kdDebug(6200) << "findRenderer: node " << node << " " << (node ? node->nodeName().string() : QString::null) << " offset " << offset << " r " << r << "[" << (r ? r->renderName() : QString::null) << "] r_ofs " << r_ofs << " outside " << outside << " outsideEnd " << outsideEnd << endl; + kdDebug(6200) << "findRenderer: node " << node << " " << (node ? node->nodeName().string() : TQString::null) << " offset " << offset << " r " << r << "[" << (r ? r->renderName() : TQString::null) << "] r_ofs " << r_ofs << " outside " << outside << " outsideEnd " << outsideEnd << endl; #endif if (r) return r; NodeImpl *baseElem = base ? base->element() : 0; @@ -636,7 +636,7 @@ static ElementImpl *determineBaseElement(NodeImpl *caretNode) // == class CaretBox implementation #if DEBUG_CARETMODE > 0 -void CaretBox::dump(QTextStream &ts, const QString &ind) const +void CaretBox::dump(TQTextStream &ts, const TQString &ind) const { ts << ind << "b@" << _box; @@ -688,7 +688,7 @@ kdDebug(6200) << "isinlineflowbox " << box << endl; #endif InlineFlowBox *flowBox = static_cast<InlineFlowBox *>(box); bool rtl = ps->direction() == RTL; - const QFontMetrics &pfm = ps->fontMetrics(); + const TQFontMetrics &pfm = ps->fontMetrics(); if (flowBox->includeLeftEdge()) { // If this box is to be coalesced with the outside end box of its @@ -730,7 +730,7 @@ kdDebug(6200) << "== recursive invocation end" << endl; } else if (box->isInlineTextBox()) { #if DEBUG_ACIB -kdDebug(6200) << "isinlinetextbox " << box << (box->object() ? QString(" contains \"%1\"").arg(QConstString(static_cast<RenderText *>(box->object())->str->s+box->minOffset(), kMin(box->maxOffset() - box->minOffset(), 15L)).string()) : QString::null) << endl; +kdDebug(6200) << "isinlinetextbox " << box << (box->object() ? TQString(" contains \"%1\"").arg(TQConstString(static_cast<RenderText *>(box->object())->str->s+box->minOffset(), kMin(box->maxOffset() - box->minOffset(), 15L)).string()) : TQString::null) << endl; #endif caret_boxes.append(new CaretBox(box, false, false)); sbp.check(preEnd()); @@ -743,7 +743,7 @@ kdDebug(6200) << "some replaced or what " << box << endl; #endif // must be an inline-block, inline-table, or any RenderReplaced bool rtl = ps->direction() == RTL; - const QFontMetrics &pfm = ps->fontMetrics(); + const TQFontMetrics &pfm = ps->fontMetrics(); if (coalesceOutsideBoxes) { if (sbp.equalsBox(box, true, false)) { @@ -768,7 +768,7 @@ kdDebug(6200) << "some replaced or what " << box << endl; } #undef DEBUG_ACIB -void CaretBoxLine::addCreatedFlowBoxInside(InlineFlowBox *flowBox, const QFontMetrics &fm) /*KDE_NO_EXPORT*/ +void CaretBoxLine::addCreatedFlowBoxInside(InlineFlowBox *flowBox, const TQFontMetrics &fm) /*KDE_NO_EXPORT*/ { CaretBox *caretBox = new CaretBox(flowBox, false, false); @@ -782,7 +782,7 @@ void CaretBoxLine::addCreatedFlowBoxInside(InlineFlowBox *flowBox, const QFontMe caretBox->_h = fm.height(); } -void CaretBoxLine::addCreatedFlowBoxEdge(InlineFlowBox *flowBox, const QFontMetrics &fm, bool left, bool rtl) /*KDE_NO_EXPORT*/ +void CaretBoxLine::addCreatedFlowBoxEdge(InlineFlowBox *flowBox, const TQFontMetrics &fm, bool left, bool rtl) /*KDE_NO_EXPORT*/ { CaretBox *caretBox = new CaretBox(flowBox, true, !left); caret_boxes.append(caretBox); @@ -795,7 +795,7 @@ void CaretBoxLine::addCreatedFlowBoxEdge(InlineFlowBox *flowBox, const QFontMetr caretBox->_w = 1; } -void CaretBoxLine::addCreatedInlineBoxEdge(InlineBox *box, const QFontMetrics &fm, bool left, bool rtl) /*KDE_NO_EXPORT*/ +void CaretBoxLine::addCreatedInlineBoxEdge(InlineBox *box, const TQFontMetrics &fm, bool left, bool rtl) /*KDE_NO_EXPORT*/ { CaretBox *caretBox = new CaretBox(box, true, !left); caret_boxes.append(caretBox); @@ -852,7 +852,7 @@ CaretBoxLine *CaretBoxLine::constructCaretBoxLine(CaretBoxLineDeleter *deleter, : cb->style(); bool rtl = s->direction() == RTL; - const QFontMetrics &fm = s->fontMetrics(); + const TQFontMetrics &fm = s->fontMetrics(); height = fm.height(); if (!outsideEnd) { @@ -875,7 +875,7 @@ CaretBoxLine *CaretBoxLine::constructCaretBoxLine(CaretBoxLineDeleter *deleter, } else { // !outside RenderStyle *s = cb->style(); - const QFontMetrics &fm = s->fontMetrics(); + const TQFontMetrics &fm = s->fontMetrics(); height = fm.height(); _x += cb->borderLeft() + cb->paddingLeft(); @@ -908,10 +908,10 @@ CaretBoxLine *CaretBoxLine::constructCaretBoxLine(CaretBoxLineDeleter *deleter, } #if DEBUG_CARETMODE > 0 -void CaretBoxLine::dump(QTextStream &ts, const QString &ind) const +void CaretBoxLine::dump(TQTextStream &ts, const TQString &ind) const { ts << ind << "cbl: baseFlowBox@" << basefb << endl; - QString ind2 = ind + " "; + TQString ind2 = ind + " "; for (size_t i = 0; i < caret_boxes.size(); i++) { if (i > 0) ts << endl; caret_boxes[i]->dump(ts, ind2); @@ -1000,7 +1000,7 @@ static CaretBoxLine* findCaretBoxLine(DOM::NodeImpl *node, long offset, outside = false; // text boxes cannot have outside positions InlineFlowBox *baseFlowBox = seekBaseFlowBox(b, base); #if DEBUG_CARETMODE > 2 - kdDebug(6200) << "text-box b: " << b << " baseFlowBox: " << baseFlowBox << (b && b->object() ? QString(" contains \"%1\"").arg(QConstString(static_cast<RenderText *>(b->object())->str->s+b->minOffset(), kMin(b->maxOffset() - b->minOffset(), 15L)).string()) : QString::null) << endl; + kdDebug(6200) << "text-box b: " << b << " baseFlowBox: " << baseFlowBox << (b && b->object() ? TQString(" contains \"%1\"").arg(TQConstString(static_cast<RenderText *>(b->object())->str->s+b->minOffset(), kMin(b->maxOffset() - b->minOffset(), 15L)).string()) : TQString::null) << endl; #endif #if 0 if (t->containingBlock()->isListItem()) dumpLineBoxes(static_cast<RenderFlow *>(t->containingBlock())); @@ -1153,7 +1153,7 @@ static bool containsEditableElement(KHTMLPart *part, RenderBlock *cb, tempTable = findTableUpTo(r, cb); #if DEBUG_CARETMODE > 1 - kdDebug(6201) << "cee: r " << (r ? r->renderName() : QString::null) << "@" << r << " cb " << cb << " withinCb " << withinCb << " modWithinCb " << modWithinCb << " tempTable " << tempTable << endl; + kdDebug(6201) << "cee: r " << (r ? r->renderName() : TQString::null) << "@" << r << " cb " << cb << " withinCb " << withinCb << " modWithinCb " << modWithinCb << " tempTable " << tempTable << endl; #endif if (r && modWithinCb && r->element() && !isUnsuitable(r, trav) && (part->isCaretMode() || part->isEditable() @@ -1223,7 +1223,7 @@ static bool containsEditableChildElement(KHTMLPart *part, RenderBlock *cb, tempTable = findTableUpTo(r, cb); #if DEBUG_CARETMODE > 1 - kdDebug(6201) << "cece: r " << (r ? r->renderName() : QString::null) << "@" << r << " cb " << cb << " withinCb " << withinCb << " modWithinCb " << modWithinCb << " tempTable " << tempTable << endl; + kdDebug(6201) << "cece: r " << (r ? r->renderName() : TQString::null) << "@" << r << " cb " << cb << " withinCb " << withinCb << " modWithinCb " << modWithinCb << " tempTable " << tempTable << endl; #endif if (r && withinCb && r->element() && !isUnsuitable(r, trav) && (part->isCaretMode() || part->isEditable() @@ -1357,7 +1357,7 @@ void LineIterator::nextBlock() int state; // not used mapRenderPosToTraversalState(cb_outside, cb_outside_end, false, trav); #if DEBUG_CARETMODE > 1 - kdDebug(6200) << "nextBlock: before adv r" << r << " " << (r ? r->renderName() : QString::null) << (r && r->isText() ? " contains \"" + QString(((RenderText *)r)->str->s, QMIN(((RenderText *)r)->str->l,15)) + "\"" : QString::null) << " trav " << trav << " cb_outside " << cb_outside << " cb_outside_end " << cb_outside_end << endl; + kdDebug(6200) << "nextBlock: before adv r" << r << " " << (r ? r->renderName() : TQString::null) << (r && r->isText() ? " contains \"" + TQString(((RenderText *)r)->str->s, QMIN(((RenderText *)r)->str->l,15)) + "\"" : TQString::null) << " trav " << trav << " cb_outside " << cb_outside << " cb_outside_end " << cb_outside_end << endl; #endif r = advanceSuitableObject(r, trav, false, base, state); if (!r) { @@ -1370,7 +1370,7 @@ void LineIterator::nextBlock() kdDebug(6200) << "nextBlock: after r" << r << " trav " << trav << " cb_outside " << cb_outside << " cb_outside_end " << cb_outside_end << endl; #endif #if DEBUG_CARETMODE > 0 - kdDebug(6200) << "++: r " << r << "[" << (r?r->renderName():QString::null) << "]" << endl; + kdDebug(6200) << "++: r " << r << "[" << (r?r->renderName():TQString::null) << "]" << endl; #endif RenderBlock *cb; @@ -1393,7 +1393,7 @@ void LineIterator::nextBlock() }/*end if*/ InlineFlowBox *flowBox = cb->firstLineBox(); #if DEBUG_CARETMODE > 0 - kdDebug(6200) << "++: flowBox " << flowBox << " cb " << cb << "[" << (cb?cb->renderName()+QString(".node ")+QString::number((unsigned)cb->element(),16)+(cb->element()?"@"+cb->element()->nodeName().string():QString::null):QString::null) << "]" << endl; + kdDebug(6200) << "++: flowBox " << flowBox << " cb " << cb << "[" << (cb?cb->renderName()+TQString(".node ")+TQString::number((unsigned)cb->element(),16)+(cb->element()?"@"+cb->element()->nodeName().string():TQString::null):TQString::null) << "]" << endl; #endif Q_ASSERT(flowBox); if (!flowBox) { // ### utter emergency (why is this possible at all?) @@ -1426,7 +1426,7 @@ void LineIterator::prevBlock() int state; // not used mapRenderPosToTraversalState(cb_outside, cb_outside_end, true, trav); #if DEBUG_CARETMODE > 1 - kdDebug(6200) << "prevBlock: before adv r" << r << " " << (r ? r->renderName() : QString::null) << (r && r->isText() ? " contains \"" + QString(((RenderText *)r)->str->s, QMIN(((RenderText *)r)->str->l,15)) + "\"" : QString::null) << " trav " << trav << " cb_outside " << cb_outside << " cb_outside_end " << cb_outside_end << endl; + kdDebug(6200) << "prevBlock: before adv r" << r << " " << (r ? r->renderName() : TQString::null) << (r && r->isText() ? " contains \"" + TQString(((RenderText *)r)->str->s, QMIN(((RenderText *)r)->str->l,15)) + "\"" : TQString::null) << " trav " << trav << " cb_outside " << cb_outside << " cb_outside_end " << cb_outside_end << endl; #endif r = advanceSuitableObject(r, trav, true, base, state); if (!r) { @@ -1439,7 +1439,7 @@ void LineIterator::prevBlock() kdDebug(6200) << "prevBlock: after r" << r << " trav " << trav << " cb_outside " << cb_outside << " cb_outside_end " << cb_outside_end << endl; #endif #if DEBUG_CARETMODE > 0 - kdDebug(6200) << "--: r " << r << "[" << (r?r->renderName():QString::null) << "]" << endl; + kdDebug(6200) << "--: r " << r << "[" << (r?r->renderName():TQString::null) << "]" << endl; #endif RenderBlock *cb; @@ -1463,7 +1463,7 @@ void LineIterator::prevBlock() }/*end if*/ InlineFlowBox *flowBox = cb->lastLineBox(); #if DEBUG_CARETMODE > 0 - kdDebug(6200) << "--: flowBox " << flowBox << " cb " << cb << "[" << (cb?cb->renderName()+QString(".node ")+QString::number((unsigned)cb->element(),16)+(cb->element()?"@"+cb->element()->nodeName().string():QString::null):QString::null) << "]" << endl; + kdDebug(6200) << "--: flowBox " << flowBox << " cb " << cb << "[" << (cb?cb->renderName()+TQString(".node ")+TQString::number((unsigned)cb->element(),16)+(cb->element()?"@"+cb->element()->nodeName().string():TQString::null):TQString::null) << "]" << endl; #endif Q_ASSERT(flowBox); if (!flowBox) { // ### utter emergency (why is this possible at all?) @@ -1518,7 +1518,7 @@ void EditableCaretBoxIterator::advance(bool toBegin) adjacent = true; #if DEBUG_CARETMODE > 4 -// kdDebug(6200) << "ebit::advance: before: " << (**this)->object() << "@" << (**this)->object()->renderName() << ".node " << (**this)->object()->element() << "[" << ((**this)->object()->element() ? (**this)->object()->element()->nodeName().string() : QString::null) << "] inline " << (**this)->isInline() << " outside " << (**this)->isOutside() << " outsideEnd " << (**this)->isOutsideEnd() << endl; +// kdDebug(6200) << "ebit::advance: before: " << (**this)->object() << "@" << (**this)->object()->renderName() << ".node " << (**this)->object()->element() << "[" << ((**this)->object()->element() ? (**this)->object()->element()->nodeName().string() : TQString::null) << "] inline " << (**this)->isInline() << " outside " << (**this)->isOutside() << " outsideEnd " << (**this)->isOutsideEnd() << endl; #endif if (toBegin) CaretBoxIterator::operator --(); else CaretBoxIterator::operator ++(); @@ -1538,7 +1538,7 @@ void EditableCaretBoxIterator::advance(bool toBegin) if (!atEnd) iscominguseable = isEditable(*this, toBegin); if (iscuruseable) { #if DEBUG_CARETMODE > 3 - kdDebug(6200) << "ebit::advance: " << (*curbox)->object() << "@" << (*curbox)->object()->renderName() << ".node " << (*curbox)->object()->element() << "[" << ((*curbox)->object()->element() ? (*curbox)->object()->element()->nodeName().string() : QString::null) << "] inline " << (*curbox)->isInline() << " outside " << (*curbox)->isOutside() << " outsideEnd " << (*curbox)->isOutsideEnd() << endl; + kdDebug(6200) << "ebit::advance: " << (*curbox)->object() << "@" << (*curbox)->object()->renderName() << ".node " << (*curbox)->object()->element() << "[" << ((*curbox)->object()->element() ? (*curbox)->object()->element()->nodeName().string() : TQString::null) << "] inline " << (*curbox)->isInline() << " outside " << (*curbox)->isOutside() << " outsideEnd " << (*curbox)->isOutsideEnd() << endl; #endif CaretBox *box = *curbox; @@ -1647,7 +1647,7 @@ bool EditableCaretBoxIterator::isEditable(const CaretBoxIterator &boxit, bool fr RenderObject *r = b->object(); #if DEBUG_CARETMODE > 0 // if (b->isInlineFlowBox()) kdDebug(6200) << "b is inline flow box" << (outside ? " (outside)" : "") << endl; - kdDebug(6200) << "isEditable r" << r << ": " << (r ? r->renderName() : QString::null) << (r && r->isText() ? " contains \"" + QString(((RenderText *)r)->str->s, QMIN(((RenderText *)r)->str->l,15)) + "\"" : QString::null) << endl; + kdDebug(6200) << "isEditable r" << r << ": " << (r ? r->renderName() : TQString::null) << (r && r->isText() ? " contains \"" + TQString(((RenderText *)r)->str->s, QMIN(((RenderText *)r)->str->l,15)) + "\"" : TQString::null) << endl; #endif // Must check caret mode or design mode *after* r->element(), otherwise // lines without a backing DOM node get regarded, leading to a crash. @@ -1698,7 +1698,7 @@ void EditableLineIterator::advance(bool toBegin) while (cbl) { if (isEditable(*this)) { #if DEBUG_CARETMODE > 3 - kdDebug(6200) << "advance: " << cbl->enclosingObject() << "@" << cbl->enclosingObject()->renderName() << ".node " << cbl->enclosingObject()->element() << "[" << (cbl->enclosingObject()->element() ? cbl->enclosingObject()->element()->nodeName().string() : QString::null) << "]" << endl; + kdDebug(6200) << "advance: " << cbl->enclosingObject() << "@" << cbl->enclosingObject()->renderName() << ".node " << cbl->enclosingObject()->element() << "[" << (cbl->enclosingObject()->element() ? cbl->enclosingObject()->element()->nodeName().string() : TQString::null) << "]" << endl; #endif bool hasindicated = isIndicatedFlow(cbl->enclosingObject()); @@ -1861,7 +1861,7 @@ kdDebug(6200) << "_offset: " << _offset /*<< " _peekNext: " << _peekNext*/ << " if (!_end && ebit != (*_it)->end()) { CaretBox *box = *ebit; RenderObject *_r = box->object(); - kdDebug(6200) << "echit++(1): box " << box << (box && box->isInlineTextBox() ? QString(" contains \"%1\"").arg(QConstString(static_cast<RenderText *>(box->object())->str->s+box->minOffset(), box->maxOffset() - box->minOffset()).string()) : QString::null) << " _r " << (_r ? _r->element()->nodeName().string() : QString("<nil>")) << endl; + kdDebug(6200) << "echit++(1): box " << box << (box && box->isInlineTextBox() ? TQString(" contains \"%1\"").arg(TQConstString(static_cast<RenderText *>(box->object())->str->s+box->minOffset(), box->maxOffset() - box->minOffset()).string()) : TQString::null) << " _r " << (_r ? _r->element()->nodeName().string() : TQString("<nil>")) << endl; } #endif return *this; @@ -1934,7 +1934,7 @@ kdDebug(6200) << "box " << box << " b " << box->inlineBox() << " isText " << box // if (!_it.outside) _offset = r->isBR() ? (*ebit)->minOffset() : (*ebit)->maxOffset(); _char = -1; #if DEBUG_CARETMODE > 0 - kdDebug(6200) << "echit--(2): box " << box << " b " << box->inlineBox() << (box->isInlineTextBox() ? QString(" contains \"%1\"").arg(QConstString(static_cast<RenderText *>(box->object())->str->s+box->minOffset(), box->maxOffset() - box->minOffset()).string()) : QString::null) << endl; + kdDebug(6200) << "echit--(2): box " << box << " b " << box->inlineBox() << (box->isInlineTextBox() ? TQString(" contains \"%1\"").arg(TQConstString(static_cast<RenderText *>(box->object())->str->s+box->minOffset(), box->maxOffset() - box->minOffset()).string()) : TQString::null) << endl; #endif } else _end = true; @@ -2000,7 +2000,7 @@ kdDebug(6200) << "_offset: " << _offset << " _peekNext: " << _peekNext << endl; #if DEBUG_CARETMODE > 0 if (!_end && ebit != (*_it)->preBegin()) { CaretBox *box = *ebit; - kdDebug(6200) << "echit--(1): box " << box << " b " << box->inlineBox() << (box->isInlineTextBox() ? QString(" contains \"%1\"").arg(QConstString(static_cast<RenderText *>(box->object())->str->s+box->minOffset(), box->maxOffset() - box->minOffset()).string()) : QString::null) << endl; + kdDebug(6200) << "echit--(1): box " << box << " b " << box->inlineBox() << (box->isInlineTextBox() ? TQString(" contains \"%1\"").arg(TQConstString(static_cast<RenderText *>(box->object())->str->s+box->minOffset(), box->maxOffset() - box->minOffset()).string()) : TQString::null) << endl; } #endif return *this; @@ -2478,7 +2478,7 @@ static CaretBox *nearestCaretBox(LineIterator &it, CaretViewContext *cv, #if DEBUG_CARETMODE > 0 // RenderObject *r = b->object(); // if (b->isInlineFlowBox()) kdDebug(6200) << "b is inline flow box" << endl; -// kdDebug(6200) << "approximate r" << r << ": " << (r ? r->renderName() : QString::null) << (r && r->isText() ? " contains \"" + QString(((RenderText *)r)->str->s, ((RenderText *)r)->str->l) + "\"" : QString::null) << endl; +// kdDebug(6200) << "approximate r" << r << ": " << (r ? r->renderName() : TQString::null) << (r && r->isText() ? " contains \"" + TQString(((RenderText *)r)->str->s, ((RenderText *)r)->str->l) + "\"" : TQString::null) << endl; #endif xPos = b->xPos(); diff --git a/khtml/khtml_caret_p.h b/khtml/khtml_caret_p.h index c96ab965d..04508413a 100644 --- a/khtml/khtml_caret_p.h +++ b/khtml/khtml_caret_p.h @@ -23,7 +23,7 @@ #include "rendering/render_table.h" -#include <qvaluevector.h> +#include <tqvaluevector.h> #define DEBUG_CARETMODE 0 @@ -112,13 +112,13 @@ class LinearDocument; * @since 3.3 * @internal */ -template<class T> class MassDeleter : public QValueVector<T *> { +template<class T> class MassDeleter : public TQValueVector<T *> { public: MassDeleter(size_t reserved = 1) { this->reserve(reserved); } ~MassDeleter() { - typename QValueVector<T *>::Iterator nd = this->end(); - for (typename QValueVector<T *>::Iterator it = this->begin(); it != nd; ++it) + typename TQValueVector<T *>::Iterator nd = this->end(); + for (typename TQValueVector<T *>::Iterator it = this->begin(); it != nd; ++it) delete *it; } }; @@ -218,7 +218,7 @@ public: long maxOffset() const { return _box && !isLineBreak() ? _box->maxOffset() : 0; } #if DEBUG_CARETMODE > 0 - void dump(QTextStream &ts, const QString &ind) const; + void dump(TQTextStream &ts, const TQString &ind) const; #endif friend class CaretBoxLine; @@ -398,12 +398,12 @@ public: RenderBox *cb, bool outside, bool outsideEnd, CaretBoxIterator &iter) /*KDE_NO_EXPORT*/; #if DEBUG_CARETMODE > 0 - void dump(QTextStream &ts, const QString &ind) const; - QString information() const + void dump(TQTextStream &ts, const TQString &ind) const; + TQString information() const { - QString result; - QTextStream ts(&result, IO_WriteOnly); - dump(ts, QString::null); + TQString result; + TQTextStream ts(&result, IO_WriteOnly); + dump(ts, TQString::null); return result; } #endif @@ -464,7 +464,7 @@ protected: * @param left true to add left edge, false to add right edge * @param rtl true if direction is rtl */ - void addCreatedInlineBoxEdge(InlineBox *box, const QFontMetrics &fm, + void addCreatedInlineBoxEdge(InlineBox *box, const TQFontMetrics &fm, bool left, bool rtl) /*KDE_NO_EXPORT*/; /** creates and adds the edge of an inline flow box * @param flowBox inline flow box @@ -472,13 +472,13 @@ protected: * @param left true to add left edge, false to add right edge * @param rtl true if direction is rtl */ - void addCreatedFlowBoxEdge(InlineFlowBox *flowBox, const QFontMetrics &fm, + void addCreatedFlowBoxEdge(InlineFlowBox *flowBox, const TQFontMetrics &fm, bool left, bool rtl) /*KDE_NO_EXPORT*/; /** creates and adds the inside of an inline flow box * @param flowBox inline flow box * @param fm font metrics of inline flow box */ - void addCreatedFlowBoxInside(InlineFlowBox *flowBox, const QFontMetrics &fm) /*KDE_NO_EXPORT*/; + void addCreatedFlowBoxInside(InlineFlowBox *flowBox, const TQFontMetrics &fm) /*KDE_NO_EXPORT*/; friend class CaretBoxIterator; }; @@ -1037,7 +1037,7 @@ public: /** returns the current character as a unicode symbol, substituting * a blank for a non-text node. */ - QChar operator *() const { return QChar(_char >= 0 ? _char : ' '); } + TQChar operator *() const { return TQChar(_char >= 0 ? _char : ' '); } /** returns true when the end of the document has been reached. */ diff --git a/khtml/khtml_events.cpp b/khtml/khtml_events.cpp index c73d4a5e0..1045a018f 100644 --- a/khtml/khtml_events.cpp +++ b/khtml/khtml_events.cpp @@ -27,7 +27,7 @@ class khtml::MouseEvent::MouseEventPrivate { }; -khtml::MouseEvent::MouseEvent( const char *name, QMouseEvent *qmouseEvent, int x, int y, +khtml::MouseEvent::MouseEvent( const char *name, TQMouseEvent *qmouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString& target, const DOM::Node &innerNode ) : KParts::Event( name ), m_qmouseEvent( qmouseEvent ), m_x( x ), m_y( y ), @@ -78,7 +78,7 @@ public: } }; -khtml::DrawContentsEvent::DrawContentsEvent( QPainter *painter, int clipx, int clipy, int clipw, int cliph ) +khtml::DrawContentsEvent::DrawContentsEvent( TQPainter *painter, int clipx, int clipy, int clipw, int cliph ) : KParts::Event( s_strDrawContentsEvent ), m_painter( painter ), m_clipx( clipx ), m_clipy( clipy ), m_clipw( clipw ), m_cliph( cliph ) { diff --git a/khtml/khtml_events.h b/khtml/khtml_events.h index 446e5c6dd..223f2b47d 100644 --- a/khtml/khtml_events.h +++ b/khtml/khtml_events.h @@ -30,12 +30,12 @@ namespace khtml class MouseEvent : public KParts::Event { public: - MouseEvent( const char *name, QMouseEvent *qmouseEvent, int x, int y, + MouseEvent( const char *name, TQMouseEvent *qmouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString& target, const DOM::Node &innerNode); virtual ~MouseEvent(); - QMouseEvent *qmouseEvent() const { return m_qmouseEvent; } + TQMouseEvent *qmouseEvent() const { return m_qmouseEvent; } int x() const { return m_x; } int y() const { return m_y; } int absX() const { return m_nodeAbsX; } @@ -49,7 +49,7 @@ public: long offset() const; private: - QMouseEvent *m_qmouseEvent; + TQMouseEvent *m_qmouseEvent; int m_x; int m_y; int m_nodeAbsX, m_nodeAbsY; @@ -63,13 +63,13 @@ private: class MousePressEvent : public MouseEvent { public: - MousePressEvent( QMouseEvent *mouseEvent, int x, int y, + MousePressEvent( TQMouseEvent *mouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString& target, const DOM::Node &innerNode) : MouseEvent( s_strMousePressEvent, mouseEvent, x, y, url, target, innerNode ) {} - static bool test( const QEvent *event ) { return KParts::Event::test( event, s_strMousePressEvent ); } + static bool test( const TQEvent *event ) { return KParts::Event::test( event, s_strMousePressEvent ); } private: @@ -80,14 +80,14 @@ class MouseDoubleClickEvent : public MouseEvent { public: // clickCount is 3 for a triple-click event - MouseDoubleClickEvent( QMouseEvent *mouseEvent, int x, int y, + MouseDoubleClickEvent( TQMouseEvent *mouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString& target, const DOM::Node &innerNode, int clickCount = 2 ) : MouseEvent( s_strMouseDoubleClickEvent, mouseEvent, x, y, url, target, innerNode ), m_clickCount( clickCount ) {} - static bool test( const QEvent *event ) + static bool test( const TQEvent *event ) { return KParts::Event::test( event, s_strMouseDoubleClickEvent ); } int clickCount() const { return m_clickCount; } @@ -100,13 +100,13 @@ private: class MouseMoveEvent : public MouseEvent { public: - MouseMoveEvent( QMouseEvent *mouseEvent, int x, int y, + MouseMoveEvent( TQMouseEvent *mouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString& target, const DOM::Node &innerNode) : MouseEvent( s_strMouseMoveEvent, mouseEvent, x, y, url, target, innerNode ) {} - static bool test( const QEvent *event ) { return KParts::Event::test( event, s_strMouseMoveEvent ); } + static bool test( const TQEvent *event ) { return KParts::Event::test( event, s_strMouseMoveEvent ); } private: static const char *s_strMouseMoveEvent; @@ -115,13 +115,13 @@ private: class MouseReleaseEvent : public MouseEvent { public: - MouseReleaseEvent( QMouseEvent *mouseEvent, int x, int y, + MouseReleaseEvent( TQMouseEvent *mouseEvent, int x, int y, const DOM::DOMString &url, const DOM::DOMString& target, const DOM::Node &innerNode, long = 0 ) : MouseEvent( s_strMouseReleaseEvent, mouseEvent, x, y, url, target, innerNode ) {} - static bool test( const QEvent *event ) { return KParts::Event::test( event, s_strMouseReleaseEvent ); } + static bool test( const TQEvent *event ) { return KParts::Event::test( event, s_strMouseReleaseEvent ); } private: static const char *s_strMouseReleaseEvent; @@ -130,19 +130,19 @@ private: class DrawContentsEvent : public KParts::Event { public: - DrawContentsEvent( QPainter *painter, int clipx, int clipy, int clipw, int cliph ); + DrawContentsEvent( TQPainter *painter, int clipx, int clipy, int clipw, int cliph ); virtual ~DrawContentsEvent(); - QPainter *painter() const { return m_painter; } + TQPainter *painter() const { return m_painter; } int clipx() const { return m_clipx; } int clipy() const { return m_clipy; } int clipw() const { return m_clipw; } int cliph() const { return m_cliph; } - static bool test( const QEvent *event ) { return KParts::Event::test( event, s_strDrawContentsEvent ); } + static bool test( const TQEvent *event ) { return KParts::Event::test( event, s_strDrawContentsEvent ); } private: - QPainter *m_painter; + TQPainter *m_painter; int m_clipx; int m_clipy; int m_clipw; diff --git a/khtml/khtml_ext.cpp b/khtml/khtml_ext.cpp index 84f7279cf..7097e0b6d 100644 --- a/khtml/khtml_ext.cpp +++ b/khtml/khtml_ext.cpp @@ -35,13 +35,13 @@ #include "misc/loader.h" #include "dom/html_form.h" #include "dom/html_image.h" -#include <qclipboard.h> -#include <qfileinfo.h> -#include <qpopupmenu.h> -#include <qurl.h> -#include <qmetaobject.h> +#include <tqclipboard.h> +#include <tqfileinfo.h> +#include <tqpopupmenu.h> +#include <tqurl.h> +#include <tqmetaobject.h> #include <private/qucomextra_p.h> -#include <qdragobject.h> +#include <tqdragobject.h> #include <kdebug.h> #include <klocale.h> @@ -93,40 +93,40 @@ int KHTMLPartBrowserExtension::yOffset() return m_part->view()->contentsY(); } -void KHTMLPartBrowserExtension::saveState( QDataStream &stream ) +void KHTMLPartBrowserExtension::saveState( TQDataStream &stream ) { //kdDebug( 6050 ) << "saveState!" << endl; m_part->saveState( stream ); } -void KHTMLPartBrowserExtension::restoreState( QDataStream &stream ) +void KHTMLPartBrowserExtension::restoreState( TQDataStream &stream ) { //kdDebug( 6050 ) << "restoreState!" << endl; m_part->restoreState( stream ); } -void KHTMLPartBrowserExtension::editableWidgetFocused( QWidget *widget ) +void KHTMLPartBrowserExtension::editableWidgetFocused( TQWidget *widget ) { m_editableFormWidget = widget; updateEditActions(); if ( !m_connectedToClipboard && m_editableFormWidget ) { - connect( QApplication::clipboard(), SIGNAL( dataChanged() ), - this, SLOT( updateEditActions() ) ); + connect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ), + this, TQT_SLOT( updateEditActions() ) ); - if ( m_editableFormWidget->inherits( "QLineEdit" ) || m_editableFormWidget->inherits( "QTextEdit" ) ) - connect( m_editableFormWidget, SIGNAL( selectionChanged() ), - this, SLOT( updateEditActions() ) ); + if ( m_editableFormWidget->inherits( "TQLineEdit" ) || m_editableFormWidget->inherits( "TQTextEdit" ) ) + connect( m_editableFormWidget, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( updateEditActions() ) ); m_connectedToClipboard = true; } editableWidgetFocused(); } -void KHTMLPartBrowserExtension::editableWidgetBlurred( QWidget * /*widget*/ ) +void KHTMLPartBrowserExtension::editableWidgetBlurred( TQWidget * /*widget*/ ) { - QWidget *oldWidget = m_editableFormWidget; + TQWidget *oldWidget = m_editableFormWidget; m_editableFormWidget = 0; enableAction( "cut", false ); @@ -135,14 +135,14 @@ void KHTMLPartBrowserExtension::editableWidgetBlurred( QWidget * /*widget*/ ) if ( m_connectedToClipboard ) { - disconnect( QApplication::clipboard(), SIGNAL( dataChanged() ), - this, SLOT( updateEditActions() ) ); + disconnect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ), + this, TQT_SLOT( updateEditActions() ) ); if ( oldWidget ) { - if ( oldWidget->inherits( "QLineEdit" ) || oldWidget->inherits( "QTextEdit" ) ) - disconnect( oldWidget, SIGNAL( selectionChanged() ), - this, SLOT( updateEditActions() ) ); + if ( oldWidget->inherits( "TQLineEdit" ) || oldWidget->inherits( "TQTextEdit" ) ) + disconnect( oldWidget, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( updateEditActions() ) ); } m_connectedToClipboard = false; @@ -154,14 +154,14 @@ void KHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *pro { if ( m_extensionProxy ) { - disconnect( m_extensionProxy, SIGNAL( enableAction( const char *, bool ) ), - this, SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); + disconnect( m_extensionProxy, TQT_SIGNAL( enableAction( const char *, bool ) ), + this, TQT_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); if ( m_extensionProxy->inherits( "KHTMLPartBrowserExtension" ) ) { - disconnect( m_extensionProxy, SIGNAL( editableWidgetFocused() ), - this, SLOT( extensionProxyEditableWidgetFocused() ) ); - disconnect( m_extensionProxy, SIGNAL( editableWidgetBlurred() ), - this, SLOT( extensionProxyEditableWidgetBlurred() ) ); + disconnect( m_extensionProxy, TQT_SIGNAL( editableWidgetFocused() ), + this, TQT_SLOT( extensionProxyEditableWidgetFocused() ) ); + disconnect( m_extensionProxy, TQT_SIGNAL( editableWidgetBlurred() ), + this, TQT_SLOT( extensionProxyEditableWidgetBlurred() ) ); } } @@ -169,14 +169,14 @@ void KHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *pro if ( m_extensionProxy ) { - connect( m_extensionProxy, SIGNAL( enableAction( const char *, bool ) ), - this, SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); + connect( m_extensionProxy, TQT_SIGNAL( enableAction( const char *, bool ) ), + this, TQT_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); if ( m_extensionProxy->inherits( "KHTMLPartBrowserExtension" ) ) { - connect( m_extensionProxy, SIGNAL( editableWidgetFocused() ), - this, SLOT( extensionProxyEditableWidgetFocused() ) ); - connect( m_extensionProxy, SIGNAL( editableWidgetBlurred() ), - this, SLOT( extensionProxyEditableWidgetBlurred() ) ); + connect( m_extensionProxy, TQT_SIGNAL( editableWidgetFocused() ), + this, TQT_SLOT( extensionProxyEditableWidgetFocused() ) ); + connect( m_extensionProxy, TQT_SIGNAL( editableWidgetBlurred() ), + this, TQT_SLOT( extensionProxyEditableWidgetBlurred() ) ); } enableAction( "cut", m_extensionProxy->isActionEnabled( "cut" ) ); @@ -201,10 +201,10 @@ void KHTMLPartBrowserExtension::cut() if ( !m_editableFormWidget ) return; - if ( m_editableFormWidget->inherits( "QLineEdit" ) ) - static_cast<QLineEdit *>( &(*m_editableFormWidget) )->cut(); - else if ( m_editableFormWidget->inherits( "QTextEdit" ) ) - static_cast<QTextEdit *>( &(*m_editableFormWidget) )->cut(); + if ( m_editableFormWidget->inherits( "TQLineEdit" ) ) + static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->cut(); + else if ( m_editableFormWidget->inherits( "TQTextEdit" ) ) + static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->cut(); } void KHTMLPartBrowserExtension::copy() @@ -219,14 +219,14 @@ void KHTMLPartBrowserExtension::copy() if ( !m_editableFormWidget ) { // get selected text and paste to the clipboard - QString text= m_part->selectedText(); - text.replace( QChar( 0xa0 ), ' ' ); + TQString text= m_part->selectedText(); + text.replace( TQChar( 0xa0 ), ' ' ); - QClipboard *cb = QApplication::clipboard(); - disconnect( cb, SIGNAL( selectionChanged() ), m_part, SLOT( slotClearSelection() ) ); + QClipboard *cb = TQApplication::clipboard(); + disconnect( cb, TQT_SIGNAL( selectionChanged() ), m_part, TQT_SLOT( slotClearSelection() ) ); #ifndef QT_NO_MIMECLIPBOARD - QString htmltext; + TQString htmltext; /* * When selectionModeEnabled, that means the user has just selected * the text, not ctrl+c to copy it. The selection clipboard @@ -236,12 +236,12 @@ void KHTMLPartBrowserExtension::copy() */ //if(!cb->selectionModeEnabled()) htmltext = m_part->selectedTextAsHTML(); - QTextDrag *textdrag = new QTextDrag(text, 0L); + TQTextDrag *textdrag = new TQTextDrag(text, 0L); KMultipleDrag *drag = new KMultipleDrag( m_editableFormWidget ); drag->addDragObject( textdrag ); if(!htmltext.isEmpty()) { - htmltext.replace( QChar( 0xa0 ), ' ' ); - QTextDrag *htmltextdrag = new QTextDrag(htmltext, 0L); + htmltext.replace( TQChar( 0xa0 ), ' ' ); + TQTextDrag *htmltextdrag = new TQTextDrag(htmltext, 0L); htmltextdrag->setSubtype("html"); drag->addDragObject( htmltextdrag ); } @@ -250,32 +250,32 @@ void KHTMLPartBrowserExtension::copy() cb->setText(text); #endif - connect( cb, SIGNAL( selectionChanged() ), m_part, SLOT( slotClearSelection() ) ); + connect( cb, TQT_SIGNAL( selectionChanged() ), m_part, TQT_SLOT( slotClearSelection() ) ); } else { - if ( m_editableFormWidget->inherits( "QLineEdit" ) ) - static_cast<QLineEdit *>( &(*m_editableFormWidget) )->copy(); - else if ( m_editableFormWidget->inherits( "QTextEdit" ) ) - static_cast<QTextEdit *>( &(*m_editableFormWidget) )->copy(); + if ( m_editableFormWidget->inherits( "TQLineEdit" ) ) + static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->copy(); + else if ( m_editableFormWidget->inherits( "TQTextEdit" ) ) + static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->copy(); } } void KHTMLPartBrowserExtension::searchProvider() { // action name is of form "previewProvider[<searchproviderprefix>:]" - const QString searchProviderPrefix = QString( sender()->name() ).mid( 14 ); + const TQString searchProviderPrefix = TQString( sender()->name() ).mid( 14 ); KURIFilterData data; - QStringList list; + TQStringList list; data.setData( searchProviderPrefix + m_part->selectedText() ); list << "kurisearchfilter" << "kuriikwsfilter"; if( !KURIFilter::self()->filterURI(data, list) ) { KDesktopFile file("searchproviders/google.desktop", true, "services"); - QString encodedSearchTerm = m_part->selectedText(); - QUrl::encode(encodedSearchTerm); + TQString encodedSearchTerm = m_part->selectedText(); + TQUrl::encode(encodedSearchTerm); data.setData(file.readEntry("Query").replace("\\{@}", encodedSearchTerm)); } @@ -304,10 +304,10 @@ void KHTMLPartBrowserExtension::paste() if ( !m_editableFormWidget ) return; - if ( m_editableFormWidget->inherits( "QLineEdit" ) ) - static_cast<QLineEdit *>( &(*m_editableFormWidget) )->paste(); - else if ( m_editableFormWidget->inherits( "QTextEdit" ) ) - static_cast<QTextEdit *>( &(*m_editableFormWidget) )->paste(); + if ( m_editableFormWidget->inherits( "TQLineEdit" ) ) + static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->paste(); + else if ( m_editableFormWidget->inherits( "TQTextEdit" ) ) + static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->paste(); } void KHTMLPartBrowserExtension::callExtensionProxyMethod( const char *method ) @@ -335,19 +335,19 @@ void KHTMLPartBrowserExtension::updateEditActions() // ### duplicated from KonqMainWindow::slotClipboardDataChanged #ifndef QT_NO_MIMECLIPBOARD // Handle minimalized versions of Qt Embedded - QMimeSource *data = QApplication::clipboard()->data(); + TQMimeSource *data = TQApplication::clipboard()->data(); enableAction( "paste", data->provides( "text/plain" ) ); #else - QString data=QApplication::clipboard()->text(); + TQString data=TQApplication::clipboard()->text(); enableAction( "paste", data.contains("://")); #endif bool hasSelection = false; if( m_editableFormWidget) { - if ( ::qt_cast<QLineEdit*>(m_editableFormWidget)) - hasSelection = static_cast<QLineEdit *>( &(*m_editableFormWidget) )->hasSelectedText(); - else if(::qt_cast<QTextEdit*>(m_editableFormWidget)) - hasSelection = static_cast<QTextEdit *>( &(*m_editableFormWidget) )->hasSelectedText(); + if ( ::qt_cast<TQLineEdit*>(m_editableFormWidget)) + hasSelection = static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->hasSelectedText(); + else if(::qt_cast<TQTextEdit*>(m_editableFormWidget)) + hasSelection = static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->hasSelectedText(); } enableAction( "copy", hasSelection ); @@ -384,10 +384,10 @@ void KHTMLPartBrowserExtension::print() void KHTMLPartBrowserExtension::disableScrolling() { - QScrollView *scrollView = m_part->view(); + TQScrollView *scrollView = m_part->view(); if (scrollView) { - scrollView->setVScrollBarMode(QScrollView::AlwaysOff); - scrollView->setHScrollBarMode(QScrollView::AlwaysOff); + scrollView->setVScrollBarMode(TQScrollView::AlwaysOff); + scrollView->setHScrollBarMode(TQScrollView::AlwaysOff); } } @@ -397,13 +397,13 @@ public: KHTMLPart *m_khtml; KURL m_url; KURL m_imageURL; - QPixmap m_pixmap; - QString m_suggestedFilename; + TQPixmap m_pixmap; + TQString m_suggestedFilename; }; -KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, const KURL &url ) - : QObject( khtml ) +KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const TQString &doc, const KURL &url ) + : TQObject( khtml ) { d = new KHTMLPopupGUIClientPrivate; d->m_khtml = khtml; @@ -430,7 +430,7 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, if (hasSelection) { - KAction* copyAction = KStdAction::copy( d->m_khtml->browserExtension(), SLOT( copy() ), actionCollection(), "copy" ); + KAction* copyAction = KStdAction::copy( d->m_khtml->browserExtension(), TQT_SLOT( copy() ), actionCollection(), "copy" ); copyAction->setText(i18n("&Copy Text")); copyAction->setEnabled(d->m_khtml->browserExtension()->isActionEnabled( "copy" )); actionCollection()->insert( khtml->actionCollection()->action( "selectAll" ) ); @@ -439,11 +439,11 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, // Fill search provider entries KConfig config("kuriikwsfilterrc"); config.setGroup("General"); - const QString defaultEngine = config.readEntry("DefaultSearchEngine", "google"); + const TQString defaultEngine = config.readEntry("DefaultSearchEngine", "google"); const char keywordDelimiter = config.readNumEntry("KeywordDelimiter", ':'); // search text - QString selectedText = khtml->selectedText(); + TQString selectedText = khtml->selectedText(); selectedText.replace("&", "&&"); if ( selectedText.length()>18 ) { selectedText.truncate(15); @@ -451,23 +451,23 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, } // default search provider - KService::Ptr service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(defaultEngine)); + KService::Ptr service = KService::serviceByDesktopPath(TQString("searchproviders/%1.desktop").arg(defaultEngine)); // search provider icon - QPixmap icon; + TQPixmap icon; KURIFilterData data; - QStringList list; - data.setData( QString("some keyword") ); + TQStringList list; + data.setData( TQString("some keyword") ); list << "kurisearchfilter" << "kuriikwsfilter"; - QString name; + TQString name; if ( KURIFilter::self()->filterURI(data, list) ) { - QString iconPath = locate("cache", KMimeType::favIconForURL(data.uri()) + ".png"); + TQString iconPath = locate("cache", KMimeType::favIconForURL(data.uri()) + ".png"); if ( iconPath.isEmpty() ) icon = SmallIcon("find"); else - icon = QPixmap( iconPath ); + icon = TQPixmap( iconPath ); name = service->name(); } else @@ -478,37 +478,37 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, // using .arg(foo, bar) instead of .arg(foo).arg(bar), as foo can contain %x new KAction( i18n( "Search for '%1' with %2" ).arg( selectedText, name ), icon, 0, d->m_khtml->browserExtension(), - SLOT( searchProvider() ), actionCollection(), "searchProvider" ); + TQT_SLOT( searchProvider() ), actionCollection(), "searchProvider" ); // favorite search providers - QStringList favoriteEngines; + TQStringList favoriteEngines; favoriteEngines << "google" << "google_groups" << "google_news" << "webster" << "dmoz" << "wikipedia"; favoriteEngines = config.readListEntry("FavoriteSearchEngines", favoriteEngines); if ( !favoriteEngines.isEmpty()) { KActionMenu* providerList = new KActionMenu( i18n( "Search for '%1' with" ).arg( selectedText ), actionCollection(), "searchProviderList" ); - QStringList::ConstIterator it = favoriteEngines.begin(); + TQStringList::ConstIterator it = favoriteEngines.begin(); for ( ; it != favoriteEngines.end(); ++it ) { if (*it==defaultEngine) continue; - service = KService::serviceByDesktopPath(QString("searchproviders/%1.desktop").arg(*it)); + service = KService::serviceByDesktopPath(TQString("searchproviders/%1.desktop").arg(*it)); if (!service) continue; - const QString searchProviderPrefix = *(service->property("Keys").toStringList().begin()) + keywordDelimiter; + const TQString searchProviderPrefix = *(service->property("Keys").toStringList().begin()) + keywordDelimiter; data.setData( searchProviderPrefix + "some keyword" ); if ( KURIFilter::self()->filterURI(data, list) ) { - QString iconPath = locate("cache", KMimeType::favIconForURL(data.uri()) + ".png"); + TQString iconPath = locate("cache", KMimeType::favIconForURL(data.uri()) + ".png"); if ( iconPath.isEmpty() ) icon = SmallIcon("find"); else - icon = QPixmap( iconPath ); + icon = TQPixmap( iconPath ); name = service->name(); providerList->insert( new KAction( name, icon, 0, d->m_khtml->browserExtension(), - SLOT( searchProvider() ), actionCollection(), QString( "searchProvider" + searchProviderPrefix ).latin1() ) ); + TQT_SLOT( searchProvider() ), actionCollection(), TQString( "searchProvider" + searchProviderPrefix ).latin1() ) ); } } } @@ -516,13 +516,13 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, if ( selectedText.contains("://") && KURL(selectedText).isValid() ) new KAction( i18n( "Open '%1'" ).arg( selectedText ), "window_new", 0, - d->m_khtml->browserExtension(), SLOT( openSelection() ), actionCollection(), "openSelection" ); + d->m_khtml->browserExtension(), TQT_SLOT( openSelection() ), actionCollection(), "openSelection" ); } else if ( url.isEmpty() && !isImage ) { actionCollection()->insert( khtml->actionCollection()->action( "security" ) ); actionCollection()->insert( khtml->actionCollection()->action( "setEncoding" ) ); - new KAction( i18n( "Stop Animations" ), 0, this, SLOT( slotStopAnimations() ), + new KAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), actionCollection(), "stopanimations" ); } @@ -530,14 +530,14 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, { if (url.protocol() == "mailto") { - new KAction( i18n( "Copy Email Address" ), 0, this, SLOT( slotCopyLinkLocation() ), + new KAction( i18n( "Copy Email Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), actionCollection(), "copylinklocation" ); } else { - new KAction( i18n( "&Save Link As..." ), 0, this, SLOT( slotSaveLinkAs() ), + new KAction( i18n( "&Save Link As..." ), 0, this, TQT_SLOT( slotSaveLinkAs() ), actionCollection(), "savelinkas" ); - new KAction( i18n( "Copy &Link Address" ), 0, this, SLOT( slotCopyLinkLocation() ), + new KAction( i18n( "Copy &Link Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), actionCollection(), "copylinklocation" ); } } @@ -547,28 +547,28 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, { if ( khtml->parentPart() ) { - new KAction( i18n( "Open in New &Window" ), "window_new", 0, this, SLOT( slotFrameInWindow() ), + new KAction( i18n( "Open in New &Window" ), "window_new", 0, this, TQT_SLOT( slotFrameInWindow() ), actionCollection(), "frameinwindow" ); - new KAction( i18n( "Open in &This Window" ), 0, this, SLOT( slotFrameInTop() ), + new KAction( i18n( "Open in &This Window" ), 0, this, TQT_SLOT( slotFrameInTop() ), actionCollection(), "frameintop" ); - new KAction( i18n( "Open in &New Tab" ), "tab_new", 0, this, SLOT( slotFrameInTab() ), + new KAction( i18n( "Open in &New Tab" ), "tab_new", 0, this, TQT_SLOT( slotFrameInTab() ), actionCollection(), "frameintab" ); - new KAction( i18n( "Reload Frame" ), 0, this, SLOT( slotReloadFrame() ), + new KAction( i18n( "Reload Frame" ), 0, this, TQT_SLOT( slotReloadFrame() ), actionCollection(), "reloadframe" ); if ( KHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled() ) { if ( khtml->d->m_frame->m_type == khtml::ChildFrame::IFrame ) - new KAction( i18n( "Block IFrame..." ), 0, this, SLOT( slotBlockIFrame() ), actionCollection(), "blockiframe" ); + new KAction( i18n( "Block IFrame..." ), 0, this, TQT_SLOT( slotBlockIFrame() ), actionCollection(), "blockiframe" ); } - new KAction( i18n( "View Frame Source" ), 0, d->m_khtml, SLOT( slotViewDocumentSource() ), + new KAction( i18n( "View Frame Source" ), 0, d->m_khtml, TQT_SLOT( slotViewDocumentSource() ), actionCollection(), "viewFrameSource" ); - new KAction( i18n( "View Frame Information" ), 0, d->m_khtml, SLOT( slotViewPageInfo() ), actionCollection(), "viewFrameInfo" ); + new KAction( i18n( "View Frame Information" ), 0, d->m_khtml, TQT_SLOT( slotViewPageInfo() ), actionCollection(), "viewFrameInfo" ); // This one isn't in khtml_popupmenu.rc anymore, because Print isn't either, // and because print frame is already in the toolbar and the menu. // But leave this here, so that it's easy to read it. - new KAction( i18n( "Print Frame..." ), "frameprint", 0, d->m_khtml->browserExtension(), SLOT( print() ), actionCollection(), "printFrame" ); - new KAction( i18n( "Save &Frame As..." ), 0, d->m_khtml, SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); + new KAction( i18n( "Print Frame..." ), "frameprint", 0, d->m_khtml->browserExtension(), TQT_SLOT( print() ), actionCollection(), "printFrame" ); + new KAction( i18n( "Save &Frame As..." ), 0, d->m_khtml, TQT_SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); actionCollection()->insert( khtml->parentPart()->actionCollection()->action( "viewDocumentSource" ) ); actionCollection()->insert( khtml->parentPart()->actionCollection()->action( "viewPageInfo" ) ); @@ -579,7 +579,7 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, } else if (isImage || !url.isEmpty()) { actionCollection()->insert( khtml->actionCollection()->action( "viewDocumentSource" ) ); actionCollection()->insert( khtml->actionCollection()->action( "viewPageInfo" ) ); - new KAction( i18n( "Stop Animations" ), 0, this, SLOT( slotStopAnimations() ), + new KAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), actionCollection(), "stopanimations" ); } @@ -598,44 +598,44 @@ KHTMLPopupGUIClient::KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, } else d->m_imageURL = KURL( static_cast<DOM::HTMLInputElement>( e ).src().string() ); - new KAction( i18n( "Save Image As..." ), 0, this, SLOT( slotSaveImageAs() ), + new KAction( i18n( "Save Image As..." ), 0, this, TQT_SLOT( slotSaveImageAs() ), actionCollection(), "saveimageas" ); - new KAction( i18n( "Send Image..." ), 0, this, SLOT( slotSendImage() ), + new KAction( i18n( "Send Image..." ), 0, this, TQT_SLOT( slotSendImage() ), actionCollection(), "sendimage" ); #ifndef QT_NO_MIMECLIPBOARD - (new KAction( i18n( "Copy Image" ), 0, this, SLOT( slotCopyImage() ), + (new KAction( i18n( "Copy Image" ), 0, this, TQT_SLOT( slotCopyImage() ), actionCollection(), "copyimage" ))->setEnabled(!d->m_pixmap.isNull()); #endif if(d->m_pixmap.isNull()) { //fallback to image location if still loading the image. this will always be true if ifdef QT_NO_MIMECLIPBOARD - new KAction( i18n( "Copy Image Location" ), 0, this, SLOT( slotCopyImageLocation() ), + new KAction( i18n( "Copy Image Location" ), 0, this, TQT_SLOT( slotCopyImageLocation() ), actionCollection(), "copyimagelocation" ); } - QString name = KStringHandler::csqueeze(d->m_imageURL.fileName()+d->m_imageURL.query(), 25); - new KAction( i18n( "View Image (%1)" ).arg(d->m_suggestedFilename.isEmpty() ? name.replace("&", "&&") : d->m_suggestedFilename.replace("&", "&&")), 0, this, SLOT( slotViewImage() ), + TQString name = KStringHandler::csqueeze(d->m_imageURL.fileName()+d->m_imageURL.query(), 25); + new KAction( i18n( "View Image (%1)" ).arg(d->m_suggestedFilename.isEmpty() ? name.replace("&", "&&") : d->m_suggestedFilename.replace("&", "&&")), 0, this, TQT_SLOT( slotViewImage() ), actionCollection(), "viewimage" ); if (KHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled()) { - new KAction( i18n( "Block Image..." ), 0, this, SLOT( slotBlockImage() ), + new KAction( i18n( "Block Image..." ), 0, this, TQT_SLOT( slotBlockImage() ), actionCollection(), "blockimage" ); if (!d->m_imageURL.host().isEmpty() && !d->m_imageURL.protocol().isEmpty()) { - new KAction( i18n( "Block Images From %1" ).arg(d->m_imageURL.host()), 0, this, SLOT( slotBlockHost() ), + new KAction( i18n( "Block Images From %1" ).arg(d->m_imageURL.host()), 0, this, TQT_SLOT( slotBlockHost() ), actionCollection(), "blockhost" ); } } } setXML( doc ); - setDOMDocument( QDomDocument(), true ); // ### HACK + setDOMDocument( TQDomDocument(), true ); // ### HACK - QDomElement menu = domDocument().documentElement().namedItem( "Menu" ).toElement(); + TQDomElement menu = domDocument().documentElement().namedItem( "Menu" ).toElement(); if ( actionCollection()->count() > 0 ) menu.insertBefore( domDocument().createElement( "separator" ), menu.firstChild() ); @@ -655,12 +655,12 @@ void KHTMLPopupGUIClient::slotSaveLinkAs() void KHTMLPopupGUIClient::slotSendImage() { - QStringList urls; + TQStringList urls; urls.append( d->m_imageURL.url()); - QString subject = d->m_imageURL.url(); - kapp->invokeMailer(QString::null, QString::null, QString::null, subject, - QString::null, //body - QString::null, + TQString subject = d->m_imageURL.url(); + kapp->invokeMailer(TQString::null, TQString::null, TQString::null, subject, + TQString::null, //body + TQString::null, urls); // attachments @@ -670,12 +670,12 @@ void KHTMLPopupGUIClient::slotSaveImageAs() { KIO::MetaData metaData; metaData["referrer"] = d->m_khtml->referrer(); - saveURL( d->m_khtml->widget(), i18n( "Save Image As" ), d->m_imageURL, metaData, QString::null, 0, d->m_suggestedFilename ); + saveURL( d->m_khtml->widget(), i18n( "Save Image As" ), d->m_imageURL, metaData, TQString::null, 0, d->m_suggestedFilename ); } void KHTMLPopupGUIClient::slotBlockHost() { - QString name=d->m_imageURL.protocol()+"://"+d->m_imageURL.host()+"/*"; + TQString name=d->m_imageURL.protocol()+"://"+d->m_imageURL.host()+"/*"; KHTMLFactory::defaultHTMLSettings()->addAdFilter( name ); d->m_khtml->reparseConfiguration(); } @@ -684,7 +684,7 @@ void KHTMLPopupGUIClient::slotBlockImage() { bool ok = false; - QString url = KInputDialog::getText( i18n("Add URL to Filter"), + TQString url = KInputDialog::getText( i18n("Add URL to Filter"), i18n("Enter the URL:"), d->m_imageURL.url(), &ok); @@ -697,7 +697,7 @@ void KHTMLPopupGUIClient::slotBlockImage() void KHTMLPopupGUIClient::slotBlockIFrame() { bool ok = false; - QString url = KInputDialog::getText( i18n( "Add URL to Filter"), + TQString url = KInputDialog::getText( i18n( "Add URL to Filter"), i18n("Enter the URL:"), d->m_khtml->url().url(), &ok ); @@ -710,15 +710,15 @@ void KHTMLPopupGUIClient::slotBlockIFrame() void KHTMLPopupGUIClient::slotCopyLinkLocation() { KURL safeURL(d->m_url); - safeURL.setPass(QString::null); + safeURL.setPass(TQString::null); #ifndef QT_NO_MIMECLIPBOARD // Set it in both the mouse selection and in the clipboard KURL::List lst; lst.append( safeURL ); - QApplication::clipboard()->setData( new KURLDrag( lst ), QClipboard::Clipboard ); - QApplication::clipboard()->setData( new KURLDrag( lst ), QClipboard::Selection ); + TQApplication::clipboard()->setData( new KURLDrag( lst ), QClipboard::Clipboard ); + TQApplication::clipboard()->setData( new KURLDrag( lst ), QClipboard::Selection ); #else - QApplication::clipboard()->setText( safeURL.url() ); //FIXME(E): Handle multiple entries + TQApplication::clipboard()->setText( safeURL.url() ); //FIXME(E): Handle multiple entries #endif } @@ -731,18 +731,18 @@ void KHTMLPopupGUIClient::slotCopyImage() { #ifndef QT_NO_MIMECLIPBOARD KURL safeURL(d->m_imageURL); - safeURL.setPass(QString::null); + safeURL.setPass(TQString::null); KURL::List lst; lst.append( safeURL ); KMultipleDrag *drag = new KMultipleDrag(d->m_khtml->view(), "Image"); - drag->addDragObject( new QImageDrag(d->m_pixmap.convertToImage()) ); + drag->addDragObject( new TQImageDrag(d->m_pixmap.convertToImage()) ); drag->addDragObject( new KURLDrag(lst, d->m_khtml->view(), "Image URL") ); // Set it in both the mouse selection and in the clipboard - QApplication::clipboard()->setData( drag, QClipboard::Clipboard ); - QApplication::clipboard()->setData( new KURLDrag(lst), QClipboard::Selection ); + TQApplication::clipboard()->setData( drag, QClipboard::Clipboard ); + TQApplication::clipboard()->setData( new KURLDrag(lst), QClipboard::Selection ); #else kdDebug() << "slotCopyImage called when the clipboard does not support this. This should not be possible." << endl; #endif @@ -751,15 +751,15 @@ void KHTMLPopupGUIClient::slotCopyImage() void KHTMLPopupGUIClient::slotCopyImageLocation() { KURL safeURL(d->m_imageURL); - safeURL.setPass(QString::null); + safeURL.setPass(TQString::null); #ifndef QT_NO_MIMECLIPBOARD // Set it in both the mouse selection and in the clipboard KURL::List lst; lst.append( safeURL ); - QApplication::clipboard()->setData( new KURLDrag( lst ), QClipboard::Clipboard ); - QApplication::clipboard()->setData( new KURLDrag( lst ), QClipboard::Selection ); + TQApplication::clipboard()->setData( new KURLDrag( lst ), QClipboard::Clipboard ); + TQApplication::clipboard()->setData( new KURLDrag( lst ), QClipboard::Selection ); #else - QApplication::clipboard()->setText( safeURL.url() ); //FIXME(E): Handle multiple entries + TQApplication::clipboard()->setText( safeURL.url() ); //FIXME(E): Handle multiple entries #endif } @@ -803,13 +803,13 @@ void KHTMLPopupGUIClient::slotFrameInTab() emit d->m_khtml->browserExtension()->createNewWindow( d->m_khtml->url(), args ); } -void KHTMLPopupGUIClient::saveURL( QWidget *parent, const QString &caption, +void KHTMLPopupGUIClient::saveURL( TQWidget *parent, const TQString &caption, const KURL &url, - const QMap<QString, QString> &metadata, - const QString &filter, long cacheId, - const QString & suggestedFilename ) + const TQMap<TQString, TQString> &metadata, + const TQString &filter, long cacheId, + const TQString & suggestedFilename ) { - QString name = QString::fromLatin1( "index.html" ); + TQString name = TQString::fromLatin1( "index.html" ); if ( !suggestedFilename.isEmpty() ) name = suggestedFilename; else if ( !url.fileName().isEmpty() ) @@ -822,7 +822,7 @@ void KHTMLPopupGUIClient::saveURL( QWidget *parent, const QString &caption, destURL = KFileDialog::getSaveURL( name, filter, parent, caption ); if( destURL.isLocalFile() ) { - QFileInfo info( destURL.path() ); + TQFileInfo info( destURL.path() ); if( info.exists() ) { // TODO: use KIO::RenameDlg (shows more information) query = KMessageBox::warningContinueCancel( parent, i18n( "A file named \"%1\" already exists. " "Are you sure you want to overwrite it?" ).arg( info.fileName() ), i18n( "Overwrite File?" ), i18n( "Overwrite" ) ); @@ -835,7 +835,7 @@ void KHTMLPopupGUIClient::saveURL( QWidget *parent, const QString &caption, } void KHTMLPopupGUIClient::saveURL( const KURL &url, const KURL &destURL, - const QMap<QString, QString> &metadata, + const TQMap<TQString, TQString> &metadata, long cacheId ) { if ( destURL.isValid() ) @@ -878,25 +878,25 @@ void KHTMLPopupGUIClient::saveURL( const KURL &url, const KURL &destURL, { KConfig cfg("konquerorrc", false, false); cfg.setGroup("HTML Settings"); - QString downloadManger = cfg.readPathEntry("DownloadManager"); + TQString downloadManger = cfg.readPathEntry("DownloadManager"); if (!downloadManger.isEmpty()) { // then find the download manager location kdDebug(1000) << "Using: "<<downloadManger <<" as Download Manager" <<endl; - QString cmd = KStandardDirs::findExe(downloadManger); + TQString cmd = KStandardDirs::findExe(downloadManger); if (cmd.isEmpty()) { - QString errMsg=i18n("The Download Manager (%1) could not be found in your $PATH ").arg(downloadManger); - QString errMsgEx= i18n("Try to reinstall it \n\nThe integration with Konqueror will be disabled!"); + TQString errMsg=i18n("The Download Manager (%1) could not be found in your $PATH ").arg(downloadManger); + TQString errMsgEx= i18n("Try to reinstall it \n\nThe integration with Konqueror will be disabled!"); KMessageBox::detailedSorry(0,errMsg,errMsgEx); - cfg.writePathEntry("DownloadManager",QString::null); + cfg.writePathEntry("DownloadManager",TQString::null); cfg.sync (); } else { downloadViaKIO = false; KURL cleanDest = destURL; - cleanDest.setPass( QString::null ); // don't put password into commandline + cleanDest.setPass( TQString::null ); // don't put password into commandline cmd += " " + KProcess::quote(url.url()) + " " + KProcess::quote(cleanDest.url()); kdDebug(1000) << "Calling command "<<cmd<<endl; @@ -927,12 +927,12 @@ KHTMLPartBrowserHostExtension::~KHTMLPartBrowserHostExtension() { } -QStringList KHTMLPartBrowserHostExtension::frameNames() const +TQStringList KHTMLPartBrowserHostExtension::frameNames() const { return m_part->frameNames(); } -const QPtrList<KParts::ReadOnlyPart> KHTMLPartBrowserHostExtension::frames() const +const TQPtrList<KParts::ReadOnlyPart> KHTMLPartBrowserHostExtension::frames() const { return m_part->frames(); } @@ -961,13 +961,13 @@ extern const int KDE_NO_EXPORT fastZoomSizes[]; extern const int KDE_NO_EXPORT fastZoomSizeCount; // BCI: remove in KDE 4 -KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, const QString &icon, const QObject *receiver, const char *slot, QObject *parent, const char *name ) +KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) : KAction( text, icon, 0, receiver, slot, parent, name ) { init(part, direction); } -KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, const QString &icon, const KShortcut &cut, const QObject *receiver, const char *slot, QObject *parent, const char *name ) +KHTMLZoomFactorAction::KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const KShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) : KAction( text, icon, cut, receiver, slot, parent, name ) { init(part, direction); @@ -989,14 +989,14 @@ void KHTMLZoomFactorAction::init(KHTMLPart *part, bool direction) for ( int i = m; i != m*(ofs+1); i += m ) { int num = i * m; - QString numStr = QString::number( num ); + TQString numStr = TQString::number( num ); if ( num > 0 ) numStr.prepend( '+' ); // xgettext: no-c-format m_popup->insertItem( i18n( "%1%" ).arg( fastZoomSizes[ofs + i] ) ); } - connect( m_popup, SIGNAL( activated( int ) ), this, SLOT( slotActivated( int ) ) ); + connect( m_popup, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotActivated( int ) ) ); } KHTMLZoomFactorAction::~KHTMLZoomFactorAction() @@ -1004,7 +1004,7 @@ KHTMLZoomFactorAction::~KHTMLZoomFactorAction() delete m_popup; } -int KHTMLZoomFactorAction::plug( QWidget *w, int index ) +int KHTMLZoomFactorAction::plug( TQWidget *w, int index ) { int containerId = KAction::plug( w, index ); if ( containerId == -1 || !w->inherits( "KToolBar" ) ) diff --git a/khtml/khtml_ext.h b/khtml/khtml_ext.h index 4d118b9c8..47ab97228 100644 --- a/khtml/khtml_ext.h +++ b/khtml/khtml_ext.h @@ -29,7 +29,7 @@ #include "khtml_part.h" -#include <qguardedptr.h> +#include <tqguardedptr.h> #include <kaction.h> #include <kio/global.h> @@ -49,12 +49,12 @@ public: virtual int xOffset(); virtual int yOffset(); - virtual void saveState( QDataStream &stream ); - virtual void restoreState( QDataStream &stream ); + virtual void saveState( TQDataStream &stream ); + virtual void restoreState( TQDataStream &stream ); // internal - void editableWidgetFocused( QWidget *widget ); - void editableWidgetBlurred( QWidget *widget ); + void editableWidgetFocused( TQWidget *widget ); + void editableWidgetBlurred( TQWidget *widget ); void setExtensionProxy( KParts::BrowserExtension *proxyExtension ); @@ -85,8 +85,8 @@ private: void callExtensionProxyMethod( const char *method ); KHTMLPart *m_part; - QGuardedPtr<QWidget> m_editableFormWidget; - QGuardedPtr<KParts::BrowserExtension> m_extensionProxy; + TQGuardedPtr<TQWidget> m_editableFormWidget; + TQGuardedPtr<KParts::BrowserExtension> m_extensionProxy; bool m_connectedToClipboard; }; @@ -96,9 +96,9 @@ public: KHTMLPartBrowserHostExtension( KHTMLPart *part ); virtual ~KHTMLPartBrowserHostExtension(); - virtual QStringList frameNames() const; + virtual TQStringList frameNames() const; - virtual const QPtrList<KParts::ReadOnlyPart> frames() const; + virtual const TQPtrList<KParts::ReadOnlyPart> frames() const; virtual bool openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs ); @@ -112,20 +112,20 @@ private: * @internal * INTERNAL class. *NOT* part of the public API. */ -class KHTMLPopupGUIClient : public QObject, public KXMLGUIClient +class KHTMLPopupGUIClient : public TQObject, public KXMLGUIClient { Q_OBJECT public: - KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, const KURL &url ); + KHTMLPopupGUIClient( KHTMLPart *khtml, const TQString &doc, const KURL &url ); virtual ~KHTMLPopupGUIClient(); - static void saveURL( QWidget *parent, const QString &caption, const KURL &url, - const QMap<QString, QString> &metaData = KIO::MetaData(), - const QString &filter = QString::null, long cacheId = 0, - const QString &suggestedFilename = QString::null ); + static void saveURL( TQWidget *parent, const TQString &caption, const KURL &url, + const TQMap<TQString, TQString> &metaData = KIO::MetaData(), + const TQString &filter = TQString::null, long cacheId = 0, + const TQString &suggestedFilename = TQString::null ); static void saveURL( const KURL &url, const KURL &destination, - const QMap<QString, QString> &metaData = KIO::MetaData(), + const TQMap<TQString, TQString> &metaData = KIO::MetaData(), long cacheId = 0 ); private slots: void slotSaveLinkAs(); @@ -154,13 +154,13 @@ class KHTMLZoomFactorAction : public KAction Q_OBJECT public: //BCI: remove in KDE 4 - KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, const QString &icon, const QObject *receiver, const char *slot, QObject *parent, const char *name ); - KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, - const QString &icon, const KShortcut& cut, const QObject *receiver, - const char *slot, QObject *parent, const char *name ); + KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ); + KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const TQString &text, + const TQString &icon, const KShortcut& cut, const TQObject *receiver, + const char *slot, TQObject *parent, const char *name ); virtual ~KHTMLZoomFactorAction(); - virtual int plug( QWidget *widget, int index ); + virtual int plug( TQWidget *widget, int index ); private slots: void slotActivated( int ); @@ -169,7 +169,7 @@ protected slots: private: void init(KHTMLPart *part, bool direction); private: - QPopupMenu *m_popup; + TQPopupMenu *m_popup; bool m_direction; KHTMLPart *m_part; }; diff --git a/khtml/khtml_factory.cpp b/khtml/khtml_factory.cpp index e265073d3..7eedc6311 100644 --- a/khtml/khtml_factory.cpp +++ b/khtml/khtml_factory.cpp @@ -37,7 +37,7 @@ #include <kdebug.h> -template class QPtrList<KHTMLPart>; +template class TQPtrList<KHTMLPart>; extern "C" KDE_EXPORT void *init_libkhtml() { @@ -61,8 +61,8 @@ unsigned long int KHTMLFactory::s_refcnt = 0; KInstance *KHTMLFactory::s_instance = 0; KAboutData *KHTMLFactory::s_about = 0; KHTMLSettings *KHTMLFactory::s_settings = 0; -QPtrList<KHTMLPart> *KHTMLFactory::s_parts = 0; -QString *KHTMLSettings::avFamilies = 0; +TQPtrList<KHTMLPart> *KHTMLFactory::s_parts = 0; +TQString *KHTMLSettings::avFamilies = 0; KHTMLFactory::KHTMLFactory( bool clone ) { @@ -103,7 +103,7 @@ KHTMLFactory::~KHTMLFactory() deref(); } -KParts::Part *KHTMLFactory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const char *className, const QStringList & ) +KParts::Part *KHTMLFactory::createPartObject( TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const char *className, const TQStringList & ) { KHTMLPart::GUIProfile prof = KHTMLPart::DefaultGUI; if ( strcmp( className, "Browser/View" ) == 0 ) @@ -118,7 +118,7 @@ void KHTMLFactory::ref() { // we can't use a staticdeleter here, because that would mean // that the factory gets deleted from within a qPostRoutine, called - // from the QApplication destructor. That however is too late, because + // from the TQApplication destructor. That however is too late, because // we want to destruct a KInstance object, which involves destructing // a KConfig object, which might call KGlobal::dirs() (in sync()) which // probably is not going to work ;-) @@ -144,7 +144,7 @@ void KHTMLFactory::deref() void KHTMLFactory::registerPart( KHTMLPart *part ) { if ( !s_parts ) - s_parts = new QPtrList<KHTMLPart>; + s_parts = new TQPtrList<KHTMLPart>; if ( !s_parts->containsRef( part ) ) { diff --git a/khtml/khtml_factory.h b/khtml/khtml_factory.h index 1b7208c7a..e9d5c62a8 100644 --- a/khtml/khtml_factory.h +++ b/khtml/khtml_factory.h @@ -22,7 +22,7 @@ #include <kparts/factory.h> #include <kparts/historyprovider.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include <kurl.h> class KInstance; @@ -45,12 +45,12 @@ public: KHTMLFactory( bool clone = false ); virtual ~KHTMLFactory(); - virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const char *className, const QStringList &args ); + virtual KParts::Part *createPartObject( TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const char *className, const TQStringList &args ); static void registerPart( KHTMLPart *part ); static void deregisterPart( KHTMLPart *part ); - static QPtrList<KHTMLPart> *partList() { return s_parts; } + static TQPtrList<KHTMLPart> *partList() { return s_parts; } static KInstance *instance(); @@ -70,7 +70,7 @@ private: static KInstance *s_instance; static KAboutData *s_about; static KHTMLSettings *s_settings; - static QPtrList<KHTMLPart> *s_parts; + static TQPtrList<KHTMLPart> *s_parts; }; #endif diff --git a/khtml/khtml_iface.cc b/khtml/khtml_iface.cc index 4829624b9..2746ba0d2 100644 --- a/khtml/khtml_iface.cc +++ b/khtml/khtml_iface.cc @@ -23,8 +23,8 @@ #include "khtmlview.h" #include "khtml_ext.h" #include <kio/global.h> -#include <qapplication.h> -#include <qvariant.h> +#include <tqapplication.h> +#include <tqvariant.h> KHTMLPartIface::KHTMLPartIface( KHTMLPart *_part ) : DCOPObject( _part->dcopObjectId() ), part(_part) @@ -115,23 +115,23 @@ bool KHTMLPartIface::onlyLocalReferences() const return part->onlyLocalReferences(); } -bool KHTMLPartIface::setEncoding( const QString &name ) +bool KHTMLPartIface::setEncoding( const TQString &name ) { return part->setEncoding(name); } -QString KHTMLPartIface::encoding() const +TQString KHTMLPartIface::encoding() const { return part->encoding(); } -void KHTMLPartIface::setFixedFont( const QString &name ) +void KHTMLPartIface::setFixedFont( const TQString &name ) { part->setFixedFont(name); } -bool KHTMLPartIface::gotoAnchor( const QString &name ) +bool KHTMLPartIface::gotoAnchor( const TQString &name ) { return part->gotoAnchor(name); } @@ -150,8 +150,8 @@ void KHTMLPartIface::activateNode() { KParts::ReadOnlyPart* p = part->currentFrame(); if ( p && p->widget() ) { - QKeyEvent ev( QKeyEvent::KeyPress, Qt::Key_Return, '\n', 0, "\n" ); - QApplication::sendEvent( p->widget(), &ev ); + TQKeyEvent ev( TQKeyEvent::KeyPress, Qt::Key_Return, '\n', 0, "\n" ); + TQApplication::sendEvent( p->widget(), &ev ); } } @@ -160,7 +160,7 @@ void KHTMLPartIface::selectAll() part->selectAll(); } -QString KHTMLPartIface::lastModified() const +TQString KHTMLPartIface::lastModified() const { return part->lastModified(); } @@ -185,7 +185,7 @@ void KHTMLPartIface::viewDocumentSource() part->slotViewDocumentSource(); } -void KHTMLPartIface::saveBackground(const QString &destination) +void KHTMLPartIface::saveBackground(const TQString &destination) { KURL back = part->backgroundURL(); if (back.isEmpty()) @@ -196,7 +196,7 @@ void KHTMLPartIface::saveBackground(const QString &destination) KHTMLPopupGUIClient::saveURL( back, KURL( destination ), metaData ); } -void KHTMLPartIface::saveDocument(const QString &destination) +void KHTMLPartIface::saveDocument(const TQString &destination) { KURL srcURL( part->url() ); @@ -208,12 +208,12 @@ void KHTMLPartIface::saveDocument(const QString &destination) KHTMLPopupGUIClient::saveURL( srcURL, KURL( destination ), metaData, part->cacheId() ); } -void KHTMLPartIface::setUserStyleSheet(const QString &styleSheet) +void KHTMLPartIface::setUserStyleSheet(const TQString &styleSheet) { part->setUserStyleSheet(styleSheet); } -QString KHTMLPartIface::selectedText() const +TQString KHTMLPartIface::selectedText() const { return part->selectedText(); } @@ -223,7 +223,7 @@ void KHTMLPartIface::viewFrameSource() part->slotViewFrameSource(); } -QString KHTMLPartIface::evalJS(const QString &script) +TQString KHTMLPartIface::evalJS(const TQString &script) { return part->executeScript(DOM::Node(), script).toString(); } diff --git a/khtml/khtml_iface.h b/khtml/khtml_iface.h index 9719eb21b..8caade850 100644 --- a/khtml/khtml_iface.h +++ b/khtml/khtml_iface.h @@ -141,14 +141,14 @@ k_dcop: * This can be different from the charset. The widget will try to reload * the current page in the new encoding, if url() is not empty. */ - bool setEncoding( const QString &name ); + bool setEncoding( const TQString &name ); /** * Returns the encoding the page currently uses. * * Note that the encoding might be different from the charset. */ - QString encoding() const; + TQString encoding() const; /** * Sets a user defined style sheet to be used on top of the HTML 4 @@ -157,7 +157,7 @@ k_dcop: * This gives a wide range of possibilities to * change the layout of the page. */ - void setUserStyleSheet(const QString &styleSheet); + void setUserStyleSheet(const TQString &styleSheet); /** * Sets the fixed font style. @@ -165,7 +165,7 @@ k_dcop: * @param name The font name to use for fixed text, e.g. * the <tt><pre></tt> tag. */ - void setFixedFont( const QString &name ); + void setFixedFont( const TQString &name ); /** * Finds the anchor named @p name. @@ -174,7 +174,7 @@ k_dcop: * scrolls to the closest position. Returns @p true if the anchor has * been found. */ - bool gotoAnchor( const QString &name ); + bool gotoAnchor( const TQString &name ); /** * Go to next Anchor. @@ -199,7 +199,7 @@ k_dcop: /** * Returns the text the user has marked. */ - QString selectedText() const; + TQString selectedText() const; /** * Marks all text in the document as selected. @@ -209,7 +209,7 @@ k_dcop: /** * Last-modified date (in raw string format), if received in the [HTTP] headers. */ - QString lastModified() const; + TQString lastModified() const; /** * Print the contents of the current html view. @@ -221,13 +221,13 @@ k_dcop: void debugDOMTree(); void viewDocumentSource(); void viewFrameSource(); - void saveBackground(const QString &url); - void saveDocument(const QString &url); + void saveBackground(const TQString &url); + void saveDocument(const TQString &url); /** * Evaluate a given piece of Javascript code */ - QString evalJS(const QString &script); + TQString evalJS(const TQString &script); /** * Stops display of animated images diff --git a/khtml/khtml_pagecache.cpp b/khtml/khtml_pagecache.cpp index 88c523a2b..935f31cc0 100644 --- a/khtml/khtml_pagecache.cpp +++ b/khtml/khtml_pagecache.cpp @@ -24,8 +24,8 @@ #include <ktempfile.h> #include <kstandarddirs.h> -#include <qintdict.h> -#include <qtimer.h> +#include <tqintdict.h> +#include <tqtimer.h> #include <sys/types.h> #include <unistd.h> @@ -36,7 +36,7 @@ #define KHTML_PAGE_CACHE_SIZE 12 #endif -template class QPtrList<KHTMLPageCacheDelivery>; +template class TQPtrList<KHTMLPageCacheDelivery>; class KHTMLPageCacheEntry { friend class KHTMLPageCache; @@ -45,18 +45,18 @@ public: ~KHTMLPageCacheEntry(); - void addData(const QByteArray &data); + void addData(const TQByteArray &data); void endData(); bool isComplete() { return m_complete; } - KHTMLPageCacheDelivery *fetchData(QObject *recvObj, const char *recvSlot); + KHTMLPageCacheDelivery *fetchData(TQObject *recvObj, const char *recvSlot); private: long m_id; bool m_complete; - QValueList<QByteArray> m_data; + TQValueList<TQByteArray> m_data; KTempFile *m_file; }; @@ -64,15 +64,15 @@ class KHTMLPageCachePrivate { public: long newId; - QIntDict<KHTMLPageCacheEntry> dict; - QPtrList<KHTMLPageCacheDelivery> delivery; - QPtrList<KHTMLPageCacheEntry> expireQueue; + TQIntDict<KHTMLPageCacheEntry> dict; + TQPtrList<KHTMLPageCacheDelivery> delivery; + TQPtrList<KHTMLPageCacheEntry> expireQueue; bool deliveryActive; }; KHTMLPageCacheEntry::KHTMLPageCacheEntry(long id) : m_id(id), m_complete(false) { - QString path = locateLocal("tmp", "khtmlcache"); + TQString path = locateLocal("tmp", "khtmlcache"); m_file = new KTempFile(path); m_file->unlink(); } @@ -84,7 +84,7 @@ KHTMLPageCacheEntry::~KHTMLPageCacheEntry() void -KHTMLPageCacheEntry::addData(const QByteArray &data) +KHTMLPageCacheEntry::addData(const TQByteArray &data) { if (m_file->status() == 0) m_file->dataStream()->writeRawBytes(data.data(), data.size()); @@ -102,13 +102,13 @@ KHTMLPageCacheEntry::endData() KHTMLPageCacheDelivery * -KHTMLPageCacheEntry::fetchData(QObject *recvObj, const char *recvSlot) +KHTMLPageCacheEntry::fetchData(TQObject *recvObj, const char *recvSlot) { // Duplicate fd so that entry can be safely deleted while delivering the data. int fd = dup(m_file->handle()); lseek(fd, 0, SEEK_SET); KHTMLPageCacheDelivery *delivery = new KHTMLPageCacheDelivery(fd); - recvObj->connect(delivery, SIGNAL(emitData(const QByteArray&)), recvSlot); + recvObj->connect(delivery, TQT_SIGNAL(emitData(const TQByteArray&)), recvSlot); delivery->recvObj = recvObj; return delivery; } @@ -155,7 +155,7 @@ KHTMLPageCache::createCacheEntry() } void -KHTMLPageCache::addData(long id, const QByteArray &data) +KHTMLPageCache::addData(long id, const TQByteArray &data) { KHTMLPageCacheEntry *entry = d->dict.find(id); if (entry) @@ -197,7 +197,7 @@ KHTMLPageCache::isComplete(long id) } void -KHTMLPageCache::fetchData(long id, QObject *recvObj, const char *recvSlot) +KHTMLPageCache::fetchData(long id, TQObject *recvObj, const char *recvSlot) { KHTMLPageCacheEntry *entry = d->dict.find(id); if (!entry || !entry->isComplete()) return; @@ -210,12 +210,12 @@ KHTMLPageCache::fetchData(long id, QObject *recvObj, const char *recvSlot) if (!d->deliveryActive) { d->deliveryActive = true; - QTimer::singleShot(20, this, SLOT(sendData())); + TQTimer::singleShot(20, this, TQT_SLOT(sendData())); } } void -KHTMLPageCache::cancelFetch(QObject *recvObj) +KHTMLPageCache::cancelFetch(TQObject *recvObj) { KHTMLPageCacheDelivery *next; for(KHTMLPageCacheDelivery* delivery = d->delivery.first(); @@ -243,7 +243,7 @@ KHTMLPageCache::sendData() assert(delivery); char buf[8192]; - QByteArray byteArray; + TQByteArray byteArray; int n = read(delivery->fd, buf, 8192); @@ -265,11 +265,11 @@ KHTMLPageCache::sendData() byteArray.resetRawData(buf, n); d->delivery.append( delivery ); } - QTimer::singleShot(0, this, SLOT(sendData())); + TQTimer::singleShot(0, this, TQT_SLOT(sendData())); } void -KHTMLPageCache::saveData(long id, QDataStream *str) +KHTMLPageCache::saveData(long id, TQDataStream *str) { KHTMLPageCacheEntry *entry = d->dict.find(id); assert(entry); diff --git a/khtml/khtml_pagecache.h b/khtml/khtml_pagecache.h index ae53c0520..9b41950a7 100644 --- a/khtml/khtml_pagecache.h +++ b/khtml/khtml_pagecache.h @@ -20,10 +20,10 @@ #ifndef __khtml_pagecache_h__ #define __khtml_pagecache_h__ -#include <qobject.h> -#include <qcstring.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqcstring.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> class KHTMLPageCachePrivate; @@ -60,7 +60,7 @@ public: /** * Add @p data to the cache entry with id @p id. */ - void addData(long id, const QByteArray &data); + void addData(long id, const TQByteArray &data); /** * Signal end of data for the cache entry with id @p id. @@ -90,17 +90,17 @@ public: * Fetch data for cache entry @p id and send it to slot @p recvSlot * in the object @p recvObj */ - void fetchData(long id, QObject *recvObj, const char *recvSlot); + void fetchData(long id, TQObject *recvObj, const char *recvSlot); /** * Cancel sending data to @p recvObj */ - void cancelFetch(QObject *recvObj); + void cancelFetch(TQObject *recvObj); /** * Save the data of cache entry @p id to the datastream @p str */ - void saveData(long id, QDataStream *str); + void saveData(long id, TQDataStream *str); private slots: void sendData(); @@ -123,10 +123,10 @@ public: ~KHTMLPageCacheDelivery(); signals: - void emitData(const QByteArray &data); + void emitData(const TQByteArray &data); public: - QObject *recvObj; + TQObject *recvObj; int fd; }; diff --git a/khtml/khtml_part.cpp b/khtml/khtml_part.cpp index d5f776078..ddd5cd25e 100644 --- a/khtml/khtml_part.cpp +++ b/khtml/khtml_part.cpp @@ -107,10 +107,10 @@ using namespace DOM; #include <kstatusbar.h> #include <kurllabel.h> -#include <qclipboard.h> -#include <qfile.h> -#include <qtooltip.h> -#include <qmetaobject.h> +#include <tqclipboard.h> +#include <tqfile.h> +#include <tqtooltip.h> +#include <tqmetaobject.h> #include <private/qucomextra_p.h> #include "khtmlpart_p.h" @@ -128,7 +128,7 @@ namespace khtml { PartStyleSheetLoader(KHTMLPart *part, DOM::DOMString url, DocLoader* dl) { m_part = part; - m_cachedSheet = dl->requestStyleSheet(url, QString::null, "text/css", + m_cachedSheet = dl->requestStyleSheet(url, TQString::null, "text/css", true /* "user sheet" */); if (m_cachedSheet) m_cachedSheet->ref( this ); @@ -144,21 +144,21 @@ namespace khtml { delete this; } - virtual void error( int, const QString& ) { + virtual void error( int, const TQString& ) { delete this; } - QGuardedPtr<KHTMLPart> m_part; + TQGuardedPtr<KHTMLPart> m_part; khtml::CachedCSSStyleSheet *m_cachedSheet; }; } -void khtml::ChildFrame::liveConnectEvent(const unsigned long, const QString & event, const KParts::LiveConnectExtension::ArgList & args) +void khtml::ChildFrame::liveConnectEvent(const unsigned long, const TQString & event, const KParts::LiveConnectExtension::ArgList & args) { if (!m_part || !m_frame || !m_liveconnect) // hmmm return; - QString script; + TQString script; script.sprintf("%s(", event.latin1()); KParts::LiveConnectExtension::ArgList::const_iterator i = args.begin(); @@ -170,7 +170,7 @@ void khtml::ChildFrame::liveConnectEvent(const unsigned long, const QString & ev script += ","; if ((*i).first == KParts::LiveConnectExtension::TypeString) { script += "\""; - script += QString((*i).second).replace('\\', "\\\\").replace('"', "\\\""); + script += TQString((*i).second).replace('\\', "\\\\").replace('"', "\\\""); script += "\""; } else script += (*i).second; @@ -186,12 +186,12 @@ void khtml::ChildFrame::liveConnectEvent(const unsigned long, const QString & ev if (m_jscript) { // we have a jscript => a part in an iframe KJS::Completion cmp; - m_jscript->evaluate(QString::null, 1, script, 0L, &cmp); + m_jscript->evaluate(TQString::null, 1, script, 0L, &cmp); } else part->executeScript(m_frame->element(), script); } -KHTMLFrameList::Iterator KHTMLFrameList::find( const QString &name ) +KHTMLFrameList::Iterator KHTMLFrameList::find( const TQString &name ) { Iterator it = begin(); const Iterator e = end(); @@ -203,7 +203,7 @@ KHTMLFrameList::Iterator KHTMLFrameList::find( const QString &name ) return it; } -KHTMLPart::KHTMLPart( QWidget *parentWidget, const char *widgetname, QObject *parent, const char *name, GUIProfile prof ) +KHTMLPart::KHTMLPart( TQWidget *parentWidget, const char *widgetname, TQObject *parent, const char *name, GUIProfile prof ) : KParts::ReadOnlyPart( parent, name ) { d = 0; @@ -214,7 +214,7 @@ KHTMLPart::KHTMLPart( QWidget *parentWidget, const char *widgetname, QObject *pa init( new KHTMLView( this, parentWidget, widgetname ), prof ); } -KHTMLPart::KHTMLPart( KHTMLView *view, QObject *parent, const char *name, GUIProfile prof ) +KHTMLPart::KHTMLPart( KHTMLView *view, TQObject *parent, const char *name, GUIProfile prof ) : KParts::ReadOnlyPart( parent, name ) { d = 0; @@ -252,24 +252,24 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof ) d->m_bMousePressed = false; d->m_bRightMousePressed = false; d->m_bCleared = false; - d->m_paViewDocument = new KAction( i18n( "View Do&cument Source" ), CTRL + Key_U, this, SLOT( slotViewDocumentSource() ), actionCollection(), "viewDocumentSource" ); - d->m_paViewFrame = new KAction( i18n( "View Frame Source" ), 0, this, SLOT( slotViewFrameSource() ), actionCollection(), "viewFrameSource" ); - d->m_paViewInfo = new KAction( i18n( "View Document Information" ), CTRL+Key_I, this, SLOT( slotViewPageInfo() ), actionCollection(), "viewPageInfo" ); - d->m_paSaveBackground = new KAction( i18n( "Save &Background Image As..." ), 0, this, SLOT( slotSaveBackground() ), actionCollection(), "saveBackground" ); - d->m_paSaveDocument = KStdAction::saveAs( this, SLOT( slotSaveDocument() ), actionCollection(), "saveDocument" ); + d->m_paViewDocument = new KAction( i18n( "View Do&cument Source" ), CTRL + Key_U, this, TQT_SLOT( slotViewDocumentSource() ), actionCollection(), "viewDocumentSource" ); + d->m_paViewFrame = new KAction( i18n( "View Frame Source" ), 0, this, TQT_SLOT( slotViewFrameSource() ), actionCollection(), "viewFrameSource" ); + d->m_paViewInfo = new KAction( i18n( "View Document Information" ), CTRL+Key_I, this, TQT_SLOT( slotViewPageInfo() ), actionCollection(), "viewPageInfo" ); + d->m_paSaveBackground = new KAction( i18n( "Save &Background Image As..." ), 0, this, TQT_SLOT( slotSaveBackground() ), actionCollection(), "saveBackground" ); + d->m_paSaveDocument = KStdAction::saveAs( this, TQT_SLOT( slotSaveDocument() ), actionCollection(), "saveDocument" ); if ( parentPart() ) d->m_paSaveDocument->setShortcut( KShortcut() ); // avoid clashes - d->m_paSaveFrame = new KAction( i18n( "Save &Frame As..." ), 0, this, SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); - d->m_paSecurity = new KAction( i18n( "Security..." ), "decrypted", 0, this, SLOT( slotSecurity() ), actionCollection(), "security" ); + d->m_paSaveFrame = new KAction( i18n( "Save &Frame As..." ), 0, this, TQT_SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); + d->m_paSecurity = new KAction( i18n( "Security..." ), "decrypted", 0, this, TQT_SLOT( slotSecurity() ), actionCollection(), "security" ); d->m_paSecurity->setWhatsThis( i18n( "Security Settings<p>" "Shows the certificate of the displayed page. Only " "pages that have been transmitted using a secure, encrypted connection have a " "certificate.<p> " "Hint: If the image shows a closed lock, the page has been transmitted over a " "secure connection.") ); - d->m_paDebugRenderTree = new KAction( i18n( "Print Rendering Tree to STDOUT" ), ALT + CTRL + SHIFT + Key_A, this, SLOT( slotDebugRenderTree() ), actionCollection(), "debugRenderTree" ); - d->m_paDebugDOMTree = new KAction( i18n( "Print DOM Tree to STDOUT" ), ALT + CTRL + SHIFT + Key_D, this, SLOT( slotDebugDOMTree() ), actionCollection(), "debugDOMTree" ); - d->m_paStopAnimations = new KAction( i18n( "Stop Animated Images" ), 0, this, SLOT( slotStopAnimations() ), actionCollection(), "stopAnimations" ); + d->m_paDebugRenderTree = new KAction( i18n( "Print Rendering Tree to STDOUT" ), ALT + CTRL + SHIFT + Key_A, this, TQT_SLOT( slotDebugRenderTree() ), actionCollection(), "debugRenderTree" ); + d->m_paDebugDOMTree = new KAction( i18n( "Print DOM Tree to STDOUT" ), ALT + CTRL + SHIFT + Key_D, this, TQT_SLOT( slotDebugDOMTree() ), actionCollection(), "debugDOMTree" ); + d->m_paStopAnimations = new KAction( i18n( "Stop Animated Images" ), 0, this, TQT_SLOT( slotStopAnimations() ), actionCollection(), "stopAnimations" ); d->m_paSetEncoding = new KActionMenu( i18n( "Set &Encoding" ), "charset", actionCollection(), "setEncoding" ); d->m_paSetEncoding->setDelayed( false ); @@ -292,15 +292,15 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof ) //d->m_automaticDetection->insertItem( i18n( "Unicode" ), 13 ); d->m_automaticDetection->insertItem( i18n( "Western European" ), 14 ); - connect( d->m_automaticDetection, SIGNAL( activated( int ) ), this, SLOT( slotAutomaticDetectionLanguage( int ) ) ); + connect( d->m_automaticDetection, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotAutomaticDetectionLanguage( int ) ) ); d->m_paSetEncoding->popupMenu()->insertItem( i18n( "Automatic Detection" ), d->m_automaticDetection, 0 ); d->m_paSetEncoding->insert( new KActionSeparator( actionCollection() ) ); - d->m_manualDetection = new KSelectAction( i18n( "short for Manual Detection", "Manual" ), 0, this, SLOT( slotSetEncoding() ), actionCollection(), "manualDetection" ); - QStringList encodings = KGlobal::charsets()->descriptiveEncodingNames(); + d->m_manualDetection = new KSelectAction( i18n( "short for Manual Detection", "Manual" ), 0, this, TQT_SLOT( slotSetEncoding() ), actionCollection(), "manualDetection" ); + TQStringList encodings = KGlobal::charsets()->descriptiveEncodingNames(); d->m_manualDetection->setItems( encodings ); d->m_manualDetection->setCurrentItem( -1 ); d->m_paSetEncoding->insert( d->m_manualDetection ); @@ -310,7 +310,7 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof ) if ( config->hasGroup( "HTML Settings" ) ) { config->setGroup( "HTML Settings" ); khtml::Decoder::AutoDetectLanguage language; - QCString name = QTextCodec::codecForLocale()->name(); + TQCString name = TQTextCodec::codecForLocale()->name(); name = name.lower(); if ( name == "cp1256" || name == "iso-8859-6" ) { @@ -354,40 +354,40 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof ) } - d->m_paUseStylesheet = new KSelectAction( i18n( "Use S&tylesheet"), 0, this, SLOT( slotUseStylesheet() ), actionCollection(), "useStylesheet" ); + d->m_paUseStylesheet = new KSelectAction( i18n( "Use S&tylesheet"), 0, this, TQT_SLOT( slotUseStylesheet() ), actionCollection(), "useStylesheet" ); if ( prof == BrowserViewGUI ) { d->m_paIncZoomFactor = new KHTMLZoomFactorAction( this, true, i18n( "Enlarge Font" ), "viewmag+", "CTRL++;CTRL+=", this, - SLOT( slotIncZoomFast() ), actionCollection(), "incFontSizes" ); + TQT_SLOT( slotIncZoomFast() ), actionCollection(), "incFontSizes" ); d->m_paIncZoomFactor->setWhatsThis( i18n( "Enlarge Font<p>" "Make the font in this window bigger. " "Click and hold down the mouse button for a menu with all available font sizes." ) ); d->m_paDecZoomFactor = new KHTMLZoomFactorAction( this, false, i18n( "Shrink Font" ), "viewmag-", CTRL + Key_Minus, this, - SLOT( slotDecZoomFast() ), actionCollection(), "decFontSizes" ); + TQT_SLOT( slotDecZoomFast() ), actionCollection(), "decFontSizes" ); d->m_paDecZoomFactor->setWhatsThis( i18n( "Shrink Font<p>" "Make the font in this window smaller. " "Click and hold down the mouse button for a menu with all available font sizes." ) ); } - d->m_paFind = KStdAction::find( this, SLOT( slotFind() ), actionCollection(), "find" ); + d->m_paFind = KStdAction::find( this, TQT_SLOT( slotFind() ), actionCollection(), "find" ); d->m_paFind->setWhatsThis( i18n( "Find text<p>" "Shows a dialog that allows you to find text on the displayed page." ) ); - d->m_paFindNext = KStdAction::findNext( this, SLOT( slotFindNext() ), actionCollection(), "findNext" ); + d->m_paFindNext = KStdAction::findNext( this, TQT_SLOT( slotFindNext() ), actionCollection(), "findNext" ); d->m_paFindNext->setWhatsThis( i18n( "Find next<p>" "Find the next occurrence of the text that you " "have found using the <b>Find Text</b> function" ) ); - d->m_paFindPrev = KStdAction::findPrev( this, SLOT( slotFindPrev() ), actionCollection(), "findPrevious" ); + d->m_paFindPrev = KStdAction::findPrev( this, TQT_SLOT( slotFindPrev() ), actionCollection(), "findPrevious" ); d->m_paFindPrev->setWhatsThis( i18n( "Find previous<p>" "Find the previous occurrence of the text that you " "have found using the <b>Find Text</b> function" ) ); - d->m_paFindAheadText = new KAction( i18n("Find Text as You Type"), KShortcut( '/' ), this, SLOT( slotFindAheadText()), + d->m_paFindAheadText = new KAction( i18n("Find Text as You Type"), KShortcut( '/' ), this, TQT_SLOT( slotFindAheadText()), actionCollection(), "findAheadText"); - d->m_paFindAheadLinks = new KAction( i18n("Find Links as You Type"), KShortcut( '\'' ), this, SLOT( slotFindAheadLink()), + d->m_paFindAheadLinks = new KAction( i18n("Find Links as You Type"), KShortcut( '\'' ), this, TQT_SLOT( slotFindAheadLink()), actionCollection(), "findAheadLink"); d->m_paFindAheadText->setEnabled( false ); d->m_paFindAheadLinks->setEnabled( false ); @@ -401,17 +401,17 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof ) d->m_paFindAheadLinks->setShortcut( KShortcut()); } - d->m_paPrintFrame = new KAction( i18n( "Print Frame..." ), "frameprint", 0, this, SLOT( slotPrintFrame() ), actionCollection(), "printFrame" ); + d->m_paPrintFrame = new KAction( i18n( "Print Frame..." ), "frameprint", 0, this, TQT_SLOT( slotPrintFrame() ), actionCollection(), "printFrame" ); d->m_paPrintFrame->setWhatsThis( i18n( "Print Frame<p>" "Some pages have several frames. To print only a single frame, click " "on it and then use this function." ) ); - d->m_paSelectAll = KStdAction::selectAll( this, SLOT( slotSelectAll() ), actionCollection(), "selectAll" ); + d->m_paSelectAll = KStdAction::selectAll( this, TQT_SLOT( slotSelectAll() ), actionCollection(), "selectAll" ); if ( parentPart() ) d->m_paSelectAll->setShortcut( KShortcut() ); // avoid clashes d->m_paToggleCaretMode = new KToggleAction(i18n("Toggle Caret Mode"), - Key_F7, this, SLOT(slotToggleCaretMode()), + Key_F7, this, TQT_SLOT(slotToggleCaretMode()), actionCollection(), "caretMode"); d->m_paToggleCaretMode->setChecked(isCaretMode()); if (parentPart()) @@ -428,30 +428,30 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof ) // Set the meta-refresh flag... d->m_metaRefreshEnabled = d->m_settings->isAutoDelayedActionsEnabled (); - connect( view, SIGNAL( zoomView( int ) ), SLOT( slotZoomView( int ) ) ); + connect( view, TQT_SIGNAL( zoomView( int ) ), TQT_SLOT( slotZoomView( int ) ) ); - connect( this, SIGNAL( completed() ), - this, SLOT( updateActions() ) ); - connect( this, SIGNAL( completed( bool ) ), - this, SLOT( updateActions() ) ); - connect( this, SIGNAL( started( KIO::Job * ) ), - this, SLOT( updateActions() ) ); + connect( this, TQT_SIGNAL( completed() ), + this, TQT_SLOT( updateActions() ) ); + connect( this, TQT_SIGNAL( completed( bool ) ), + this, TQT_SLOT( updateActions() ) ); + connect( this, TQT_SIGNAL( started( KIO::Job * ) ), + this, TQT_SLOT( updateActions() ) ); d->m_popupMenuXML = KXMLGUIFactory::readConfigFile( locate( "data", "khtml/khtml_popupmenu.rc", KHTMLFactory::instance() ) ); - connect( khtml::Cache::loader(), SIGNAL( requestStarted( khtml::DocLoader*, khtml::CachedObject* ) ), - this, SLOT( slotLoaderRequestStarted( khtml::DocLoader*, khtml::CachedObject* ) ) ); - connect( khtml::Cache::loader(), SIGNAL( requestDone( khtml::DocLoader*, khtml::CachedObject *) ), - this, SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) ); - connect( khtml::Cache::loader(), SIGNAL( requestFailed( khtml::DocLoader*, khtml::CachedObject *) ), - this, SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) ); + connect( khtml::Cache::loader(), TQT_SIGNAL( requestStarted( khtml::DocLoader*, khtml::CachedObject* ) ), + this, TQT_SLOT( slotLoaderRequestStarted( khtml::DocLoader*, khtml::CachedObject* ) ) ); + connect( khtml::Cache::loader(), TQT_SIGNAL( requestDone( khtml::DocLoader*, khtml::CachedObject *) ), + this, TQT_SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) ); + connect( khtml::Cache::loader(), TQT_SIGNAL( requestFailed( khtml::DocLoader*, khtml::CachedObject *) ), + this, TQT_SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) ); - connect ( &d->m_progressUpdateTimer, SIGNAL( timeout() ), this, SLOT( slotProgressUpdate() ) ); + connect ( &d->m_progressUpdateTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotProgressUpdate() ) ); findTextBegin(); //reset find variables - connect( &d->m_redirectionTimer, SIGNAL( timeout() ), - this, SLOT( slotRedirect() ) ); + connect( &d->m_redirectionTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( slotRedirect() ) ); d->m_dcopobject = new KHTMLPartIface(this); @@ -496,12 +496,12 @@ KHTMLPart::~KHTMLPart() if (!d->m_bComplete) closeURL(); - disconnect( khtml::Cache::loader(), SIGNAL( requestStarted( khtml::DocLoader*, khtml::CachedObject* ) ), - this, SLOT( slotLoaderRequestStarted( khtml::DocLoader*, khtml::CachedObject* ) ) ); - disconnect( khtml::Cache::loader(), SIGNAL( requestDone( khtml::DocLoader*, khtml::CachedObject *) ), - this, SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) ); - disconnect( khtml::Cache::loader(), SIGNAL( requestFailed( khtml::DocLoader*, khtml::CachedObject *) ), - this, SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) ); + disconnect( khtml::Cache::loader(), TQT_SIGNAL( requestStarted( khtml::DocLoader*, khtml::CachedObject* ) ), + this, TQT_SLOT( slotLoaderRequestStarted( khtml::DocLoader*, khtml::CachedObject* ) ) ); + disconnect( khtml::Cache::loader(), TQT_SIGNAL( requestDone( khtml::DocLoader*, khtml::CachedObject *) ), + this, TQT_SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) ); + disconnect( khtml::Cache::loader(), TQT_SIGNAL( requestFailed( khtml::DocLoader*, khtml::CachedObject *) ), + this, TQT_SLOT( slotLoaderRequestDone( khtml::DocLoader*, khtml::CachedObject *) ) ); clear(); @@ -552,10 +552,10 @@ bool KHTMLPart::restoreURL( const KURL &url ) m_url = url; d->m_restoreScrollPosition = true; - disconnect(d->m_view, SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition())); - connect(d->m_view, SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition())); + disconnect(d->m_view, TQT_SIGNAL(finishedLayout()), this, TQT_SLOT(restoreScrollPosition())); + connect(d->m_view, TQT_SIGNAL(finishedLayout()), this, TQT_SLOT(restoreScrollPosition())); - KHTMLPageCache::self()->fetchData( d->m_cacheId, this, SLOT(slotRestoreData(const QByteArray &))); + KHTMLPageCache::self()->fetchData( d->m_cacheId, this, TQT_SLOT(slotRestoreData(const TQByteArray &))); emit started( 0L ); @@ -576,11 +576,11 @@ bool KHTMLPart::openURL( const KURL &url ) closeURL(); if( d->m_bJScriptEnabled ) - d->m_statusBarText[BarOverrideText] = d->m_statusBarText[BarDefaultText] = QString::null; + d->m_statusBarText[BarOverrideText] = d->m_statusBarText[BarDefaultText] = TQString::null; /** * The format of the error url is that two variables are passed in the query: - * error = int kio error code, errText = QString error text from kio + * error = int kio error code, errText = TQString error text from kio * and the URL where the error happened is passed as a sub URL. */ KURL::List urls = KURL::split( url ); @@ -591,7 +591,7 @@ bool KHTMLPart::openURL( const KURL &url ) int error = mainURL.queryItem( "error" ).toInt(); // error=0 isn't a valid error code, so 0 means it's missing from the URL if ( error == 0 ) error = KIO::ERR_UNKNOWN; - QString errorText = mainURL.queryItem( "errText", HINT_UTF8 ); + TQString errorText = mainURL.queryItem( "errText", HINT_UTF8 ); urls.pop_front(); d->m_workingURL = KURL::join( urls ); //kdDebug(6050) << "Emitting fixed URL " << d->m_workingURL.prettyURL() << endl; @@ -602,20 +602,20 @@ bool KHTMLPart::openURL( const KURL &url ) } if (!parentPart()) { // only do it for toplevel part - QString host = url.isLocalFile() ? "localhost" : url.host(); - QString userAgent = KProtocolManager::userAgentForHost(host); - if (userAgent != KProtocolManager::userAgentForHost(QString::null)) { + TQString host = url.isLocalFile() ? "localhost" : url.host(); + TQString userAgent = KProtocolManager::userAgentForHost(host); + if (userAgent != KProtocolManager::userAgentForHost(TQString::null)) { if (!d->m_statusBarUALabel) { d->m_statusBarUALabel = new KURLLabel(d->m_statusBarExtension->statusBar()); d->m_statusBarUALabel->setFixedHeight(instance()->iconLoader()->currentSize(KIcon::Small)); - d->m_statusBarUALabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + d->m_statusBarUALabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed)); d->m_statusBarUALabel->setUseCursor(false); d->m_statusBarExtension->addStatusBarItem(d->m_statusBarUALabel, 0, false); d->m_statusBarUALabel->setPixmap(SmallIcon("agent", instance())); } else { - QToolTip::remove(d->m_statusBarUALabel); + TQToolTip::remove(d->m_statusBarUALabel); } - QToolTip::add(d->m_statusBarUALabel, i18n("The fake user-agent '%1' is in use.").arg(userAgent)); + TQToolTip::add(d->m_statusBarUALabel, i18n("The fake user-agent '%1' is in use.").arg(userAgent)); } else if (d->m_statusBarUALabel) { d->m_statusBarExtension->removeStatusBarItem(d->m_statusBarUALabel); delete d->m_statusBarUALabel; @@ -673,8 +673,8 @@ bool KHTMLPart::openURL( const KURL &url ) closeURL(); d->m_restoreScrollPosition = d->m_restored; - disconnect(d->m_view, SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition())); - connect(d->m_view, SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition())); + disconnect(d->m_view, TQT_SIGNAL(finishedLayout()), this, TQT_SLOT(restoreScrollPosition())); + connect(d->m_view, TQT_SIGNAL(finishedLayout()), this, TQT_SLOT(restoreScrollPosition())); // initializing m_url to the new url breaks relative links when opening such a link after this call and _before_ begin() is called (when the first // data arrives) (Simon) @@ -720,21 +720,21 @@ bool KHTMLPart::openURL( const KURL &url ) d->m_job->setWindow(widget()->topLevelWidget()); d->m_job->addMetaData(args.metaData()); - connect( d->m_job, SIGNAL( result( KIO::Job* ) ), - SLOT( slotFinished( KIO::Job* ) ) ); - connect( d->m_job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), - SLOT( slotData( KIO::Job*, const QByteArray& ) ) ); - connect ( d->m_job, SIGNAL( infoMessage( KIO::Job*, const QString& ) ), - SLOT( slotInfoMessage(KIO::Job*, const QString& ) ) ); - connect( d->m_job, SIGNAL(redirection(KIO::Job*, const KURL& ) ), - SLOT( slotRedirection(KIO::Job*, const KURL&) ) ); + connect( d->m_job, TQT_SIGNAL( result( KIO::Job* ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); + connect( d->m_job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray& ) ), + TQT_SLOT( slotData( KIO::Job*, const TQByteArray& ) ) ); + connect ( d->m_job, TQT_SIGNAL( infoMessage( KIO::Job*, const TQString& ) ), + TQT_SLOT( slotInfoMessage(KIO::Job*, const TQString& ) ) ); + connect( d->m_job, TQT_SIGNAL(redirection(KIO::Job*, const KURL& ) ), + TQT_SLOT( slotRedirection(KIO::Job*, const KURL&) ) ); d->m_bComplete = false; d->m_bLoadEventEmitted = false; // delete old status bar msg's from kjs (if it _was_ activated on last URL) if( d->m_bJScriptEnabled ) - d->m_statusBarText[BarOverrideText] = d->m_statusBarText[BarDefaultText] = QString::null; + d->m_statusBarText[BarOverrideText] = d->m_statusBarText[BarDefaultText] = TQString::null; // set the javascript flags according to the current url d->m_bJScriptEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptEnabled(url.host()); @@ -743,14 +743,14 @@ bool KHTMLPart::openURL( const KURL &url ) d->m_bPluginsEnabled = KHTMLFactory::defaultHTMLSettings()->isPluginsEnabled(url.host()); - connect( d->m_job, SIGNAL( speed( KIO::Job*, unsigned long ) ), - this, SLOT( slotJobSpeed( KIO::Job*, unsigned long ) ) ); + connect( d->m_job, TQT_SIGNAL( speed( KIO::Job*, unsigned long ) ), + this, TQT_SLOT( slotJobSpeed( KIO::Job*, unsigned long ) ) ); - connect( d->m_job, SIGNAL( percent( KIO::Job*, unsigned long ) ), - this, SLOT( slotJobPercent( KIO::Job*, unsigned long ) ) ); + connect( d->m_job, TQT_SIGNAL( percent( KIO::Job*, unsigned long ) ), + this, TQT_SLOT( slotJobPercent( KIO::Job*, unsigned long ) ) ); - connect( d->m_job, SIGNAL( result( KIO::Job* ) ), - this, SLOT( slotJobDone( KIO::Job* ) ) ); + connect( d->m_job, TQT_SIGNAL( result( KIO::Job* ) ), + this, TQT_SLOT( slotJobDone( KIO::Job* ) ) ); d->m_jobspeed = 0; @@ -759,8 +759,8 @@ bool KHTMLPart::openURL( const KURL &url ) if ( args.reload && !settings()->userStyleSheet().isEmpty() ) { KURL url( settings()->userStyleSheet() ); KIO::StatJob *job = KIO::stat( url, false /* don't show progress */ ); - connect( job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( slotUserSheetStatDone( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( slotUserSheetStatDone( KIO::Job * ) ) ); } emit started( 0L ); @@ -791,7 +791,7 @@ bool KHTMLPart::closeURL() d->m_bLoadEventEmitted = true; // don't want that one either d->m_cachePolicy = KProtocolManager::cacheControl(); // reset cache policy - disconnect(d->m_view, SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition())); + disconnect(d->m_view, TQT_SIGNAL(finishedLayout()), this, TQT_SLOT(restoreScrollPosition())); KHTMLPageCache::self()->cancelFetch(this); if ( d->m_doc && d->m_doc->parsing() ) @@ -862,27 +862,27 @@ DOM::Document KHTMLPart::document() const return d->m_doc; } -QString KHTMLPart::documentSource() const +TQString KHTMLPart::documentSource() const { - QString sourceStr; + TQString sourceStr; if ( !( m_url.isLocalFile() ) && KHTMLPageCache::self()->isComplete( d->m_cacheId ) ) { - QByteArray sourceArray; - QDataStream dataStream( sourceArray, IO_WriteOnly ); + TQByteArray sourceArray; + TQDataStream dataStream( sourceArray, IO_WriteOnly ); KHTMLPageCache::self()->saveData( d->m_cacheId, &dataStream ); - QTextStream stream( sourceArray, IO_ReadOnly ); - stream.setCodec( QTextCodec::codecForName( encoding().latin1() ) ); + TQTextStream stream( sourceArray, IO_ReadOnly ); + stream.setCodec( TQTextCodec::codecForName( encoding().latin1() ) ); sourceStr = stream.read(); } else { - QString tmpFile; + TQString tmpFile; if( KIO::NetAccess::download( m_url, tmpFile, NULL ) ) { - QFile f( tmpFile ); + TQFile f( tmpFile ); if ( f.open( IO_ReadOnly ) ) { - QTextStream stream( &f ); - stream.setCodec( QTextCodec::codecForName( encoding().latin1() ) ); + TQTextStream stream( &f ); + stream.setCodec( TQTextCodec::codecForName( encoding().latin1() ) ); sourceStr = stream.read(); f.close(); } @@ -1025,11 +1025,11 @@ KJSProxy *KHTMLPart::jScript() return d->m_frame->m_jscript; } -QVariant KHTMLPart::crossFrameExecuteScript(const QString& target, const QString& script) +TQVariant KHTMLPart::crossFrameExecuteScript(const TQString& target, const TQString& script) { KHTMLPart* destpart = this; - QString trg = target.lower(); + TQString trg = target.lower(); if (target == "_top") { while (destpart->parentPart()) @@ -1075,13 +1075,13 @@ KJSErrorDlg *KHTMLPart::jsErrorExtension() { if (!d->m_statusBarJSErrorLabel) { d->m_statusBarJSErrorLabel = new KURLLabel(d->m_statusBarExtension->statusBar()); d->m_statusBarJSErrorLabel->setFixedHeight(instance()->iconLoader()->currentSize(KIcon::Small)); - d->m_statusBarJSErrorLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + d->m_statusBarJSErrorLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed)); d->m_statusBarJSErrorLabel->setUseCursor(false); d->m_statusBarExtension->addStatusBarItem(d->m_statusBarJSErrorLabel, 0, false); - QToolTip::add(d->m_statusBarJSErrorLabel, i18n("This web page contains coding errors.")); + TQToolTip::add(d->m_statusBarJSErrorLabel, i18n("This web page contains coding errors.")); d->m_statusBarJSErrorLabel->setPixmap(SmallIcon("bug", instance())); - connect(d->m_statusBarJSErrorLabel, SIGNAL(leftClickedURL()), SLOT(launchJSErrorDialog())); - connect(d->m_statusBarJSErrorLabel, SIGNAL(rightClickedURL()), SLOT(jsErrorDialogContextMenu())); + connect(d->m_statusBarJSErrorLabel, TQT_SIGNAL(leftClickedURL()), TQT_SLOT(launchJSErrorDialog())); + connect(d->m_statusBarJSErrorLabel, TQT_SIGNAL(rightClickedURL()), TQT_SLOT(jsErrorDialogContextMenu())); } if (!d->m_jsedlg) { d->m_jsedlg = new KJSErrorDlg; @@ -1115,14 +1115,14 @@ void KHTMLPart::disableJSErrorExtension() { // right now. It makes me wonder if there should be a more clean way to // contact all running "KHTML" instance as opposed to Konqueror instances too. d->m_settings->setJSErrorsEnabled(false); - DCOPClient::mainClient()->send("konqueror*", "KonquerorIface", "reparseConfiguration()", QByteArray()); + DCOPClient::mainClient()->send("konqueror*", "KonquerorIface", "reparseConfiguration()", TQByteArray()); } void KHTMLPart::jsErrorDialogContextMenu() { KPopupMenu *m = new KPopupMenu(0L); - m->insertItem(i18n("&Hide Errors"), this, SLOT(removeJSErrorExtension())); - m->insertItem(i18n("&Disable Error Reporting"), this, SLOT(disableJSErrorExtension())); - m->popup(QCursor::pos()); + m->insertItem(i18n("&Hide Errors"), this, TQT_SLOT(removeJSErrorExtension())); + m->insertItem(i18n("&Disable Error Reporting"), this, TQT_SLOT(disableJSErrorExtension())); + m->popup(TQCursor::pos()); } void KHTMLPart::launchJSErrorDialog() { @@ -1134,12 +1134,12 @@ void KHTMLPart::launchJSErrorDialog() { } void KHTMLPart::launchJSConfigDialog() { - QStringList args; + TQStringList args; args << "khtml_java_js"; KApplication::kdeinitExec( "kcmshell", args ); } -QVariant KHTMLPart::executeScript(const QString& filename, int baseLine, const DOM::Node& n, const QString& script) +TQVariant KHTMLPart::executeScript(const TQString& filename, int baseLine, const DOM::Node& n, const TQString& script) { #ifdef KJS_VERBOSE // The script is now printed by KJS's Parser::parse @@ -1148,11 +1148,11 @@ QVariant KHTMLPart::executeScript(const QString& filename, int baseLine, const D KJSProxy *proxy = jScript(); if (!proxy || proxy->paused()) - return QVariant(); + return TQVariant(); KJS::Completion comp; - QVariant ret = proxy->evaluate(filename, baseLine, script, n, &comp); + TQVariant ret = proxy->evaluate(filename, baseLine, script, n, &comp); /* * Error handling @@ -1179,12 +1179,12 @@ QVariant KHTMLPart::executeScript(const QString& filename, int baseLine, const D return ret; } -QVariant KHTMLPart::executeScript( const QString &script ) +TQVariant KHTMLPart::executeScript( const TQString &script ) { return executeScript( DOM::Node(), script ); } -QVariant KHTMLPart::executeScript( const DOM::Node &n, const QString &script ) +TQVariant KHTMLPart::executeScript( const DOM::Node &n, const TQString &script ) { #ifdef KJS_VERBOSE kdDebug(6070) << "KHTMLPart::executeScript caller='" << name() << "' node=" << n.nodeName().string().latin1() << "(" << (n.isNull() ? 0 : n.nodeType()) << ") " /* << script */ << endl; @@ -1192,10 +1192,10 @@ QVariant KHTMLPart::executeScript( const DOM::Node &n, const QString &script ) KJSProxy *proxy = jScript(); if (!proxy || proxy->paused()) - return QVariant(); + return TQVariant(); ++(d->m_runningScripts); KJS::Completion comp; - const QVariant ret = proxy->evaluate( QString::null, 1, script, n, &comp ); + const TQVariant ret = proxy->evaluate( TQString::null, 1, script, n, &comp ); --(d->m_runningScripts); /* @@ -1218,7 +1218,7 @@ QVariant KHTMLPart::executeScript( const DOM::Node &n, const QString &script ) return ret; } -bool KHTMLPart::scheduleScript(const DOM::Node &n, const QString& script) +bool KHTMLPart::scheduleScript(const DOM::Node &n, const TQString& script) { //kdDebug(6050) << "KHTMLPart::scheduleScript "<< script << endl; @@ -1228,15 +1228,15 @@ bool KHTMLPart::scheduleScript(const DOM::Node &n, const QString& script) return true; } -QVariant KHTMLPart::executeScheduledScript() +TQVariant KHTMLPart::executeScheduledScript() { if( d->scheduledScript.isEmpty() ) - return QVariant(); + return TQVariant(); //kdDebug(6050) << "executing delayed " << d->scheduledScript << endl; - QVariant ret = executeScript( d->scheduledScriptNode, d->scheduledScript ); - d->scheduledScript = QString(); + TQVariant ret = executeScript( d->scheduledScriptNode, d->scheduledScript ); + d->scheduledScript = TQString(); d->scheduledScriptNode = DOM::Node(); return ret; @@ -1302,7 +1302,7 @@ void KHTMLPart::slotDebugDOMTree() for (; it != end; ++it ) if ( !( *it )->m_part.isNull() && (*it)->m_part->inherits( "KHTMLPart" ) ) { KParts::ReadOnlyPart* const p = ( *it )->m_part; - kdDebug(6050) << QString().leftJustify(s_DOMTreeIndentLevel*4,' ') << "FRAME " << p->name() << " " << endl; + kdDebug(6050) << TQString().leftJustify(s_DOMTreeIndentLevel*4,' ') << "FRAME " << p->name() << " " << endl; static_cast<KHTMLPart*>( p )->slotDebugDOMTree(); } s_DOMTreeIndentLevel = indentLevel; @@ -1320,8 +1320,8 @@ void KHTMLPart::slotDebugRenderTree() if ( d->m_doc ) { d->m_doc->renderer()->printTree(); // dump out the contents of the rendering & DOM trees -// QString dumps; -// QTextStream outputStream(dumps,IO_WriteOnly); +// TQString dumps; +// TQTextStream outputStream(dumps,IO_WriteOnly); // d->m_doc->renderer()->layer()->dump( outputStream ); // kdDebug() << "dump output:" << "\n" + dumps; } @@ -1348,10 +1348,10 @@ void KHTMLPart::setAutoloadImages( bool enable ) d->m_paLoadImages = 0; } else if ( !d->m_paLoadImages ) - d->m_paLoadImages = new KAction( i18n( "Display Images on Page" ), "images_display", 0, this, SLOT( slotLoadImages() ), actionCollection(), "loadImages" ); + d->m_paLoadImages = new KAction( i18n( "Display Images on Page" ), "images_display", 0, this, TQT_SLOT( slotLoadImages() ), actionCollection(), "loadImages" ); if ( d->m_paLoadImages ) { - QPtrList<KAction> lst; + TQPtrList<KAction> lst; lst.append( d->m_paLoadImages ); plugActionList( "loadImages", lst ); } @@ -1429,8 +1429,8 @@ void KHTMLPart::clear() d->m_decoder = 0; // We don't want to change between parts if we are going to delete all of them anyway - disconnect( partManager(), SIGNAL( activePartChanged( KParts::Part * ) ), - this, SLOT( slotActiveFrameChanged( KParts::Part * ) ) ); + disconnect( partManager(), TQT_SIGNAL( activePartChanged( KParts::Part * ) ), + this, TQT_SLOT( slotActiveFrameChanged( KParts::Part * ) ) ); if (d->m_frames.count()) { @@ -1462,11 +1462,11 @@ void KHTMLPart::clear() } // Listen to part changes again - connect( partManager(), SIGNAL( activePartChanged( KParts::Part * ) ), - this, SLOT( slotActiveFrameChanged( KParts::Part * ) ) ); + connect( partManager(), TQT_SIGNAL( activePartChanged( KParts::Part * ) ), + this, TQT_SLOT( slotActiveFrameChanged( KParts::Part * ) ) ); d->m_delayRedirect = 0; - d->m_redirectURL = QString::null; + d->m_redirectURL = TQString::null; d->m_redirectionTimer.stop(); d->m_redirectLockHistory = true; d->m_bClearing = false; @@ -1480,13 +1480,13 @@ void KHTMLPart::clear() d->m_startOffset = 0; d->m_endOffset = 0; #ifndef QT_NO_CLIPBOARD - connect( kapp->clipboard(), SIGNAL( selectionChanged()), SLOT( slotClearSelection())); + connect( kapp->clipboard(), TQT_SIGNAL( selectionChanged()), TQT_SLOT( slotClearSelection())); #endif d->m_jobPercent = 0; if ( !d->m_haveEncoding ) - d->m_encoding = QString::null; + d->m_encoding = TQString::null; #ifdef SPEED_DEBUG d->m_parsetime.restart(); #endif @@ -1511,7 +1511,7 @@ DOM::DocumentImpl *KHTMLPart::xmlDocImpl() const return 0; } -void KHTMLPart::slotInfoMessage(KIO::Job* kio_job, const QString& msg) +void KHTMLPart::slotInfoMessage(KIO::Job* kio_job, const TQString& msg) { assert(d->m_job == kio_job); @@ -1525,22 +1525,22 @@ void KHTMLPart::setPageSecurity( PageSecurity sec ) if ( sec != NotCrypted && !d->m_statusBarIconLabel && !parentPart() ) { d->m_statusBarIconLabel = new KURLLabel( d->m_statusBarExtension->statusBar() ); d->m_statusBarIconLabel->setFixedHeight( instance()->iconLoader()->currentSize(KIcon::Small) ); - d->m_statusBarIconLabel->setSizePolicy(QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed )); + d->m_statusBarIconLabel->setSizePolicy(TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed )); d->m_statusBarIconLabel->setUseCursor( false ); d->m_statusBarExtension->addStatusBarItem( d->m_statusBarIconLabel, 0, false ); - connect( d->m_statusBarIconLabel, SIGNAL( leftClickedURL() ), SLOT( slotSecurity() ) ); + connect( d->m_statusBarIconLabel, TQT_SIGNAL( leftClickedURL() ), TQT_SLOT( slotSecurity() ) ); } else if (d->m_statusBarIconLabel) { - QToolTip::remove(d->m_statusBarIconLabel); + TQToolTip::remove(d->m_statusBarIconLabel); } if (d->m_statusBarIconLabel) { if (d->m_ssl_in_use) - QToolTip::add(d->m_statusBarIconLabel, + TQToolTip::add(d->m_statusBarIconLabel, i18n("Session is secured with %1 bit %2.").arg(d->m_ssl_cipher_used_bits).arg(d->m_ssl_cipher)); - else QToolTip::add(d->m_statusBarIconLabel, i18n("Session is not secured.")); + else TQToolTip::add(d->m_statusBarIconLabel, i18n("Session is not secured.")); } - QString iconName; + TQString iconName; switch (sec) { case NotCrypted: iconName = "decrypted"; @@ -1562,7 +1562,7 @@ void KHTMLPart::setPageSecurity( PageSecurity sec ) d->m_statusBarIconLabel->setPixmap( SmallIcon( iconName, instance() ) ); } -void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data ) +void KHTMLPart::slotData( KIO::Job* kio_job, const TQByteArray &data ) { assert ( d->m_job == kio_job ); @@ -1624,16 +1624,16 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data ) d->m_ssl_cert_state = d->m_job->queryMetaData("ssl_cert_state"); if (d->m_statusBarIconLabel) { - QToolTip::remove(d->m_statusBarIconLabel); + TQToolTip::remove(d->m_statusBarIconLabel); if (d->m_ssl_in_use) { - QToolTip::add(d->m_statusBarIconLabel, i18n("Session is secured with %1 bit %2.").arg(d->m_ssl_cipher_used_bits).arg(d->m_ssl_cipher)); + TQToolTip::add(d->m_statusBarIconLabel, i18n("Session is secured with %1 bit %2.").arg(d->m_ssl_cipher_used_bits).arg(d->m_ssl_cipher)); } else { - QToolTip::add(d->m_statusBarIconLabel, i18n("Session is not secured.")); + TQToolTip::add(d->m_statusBarIconLabel, i18n("Session is not secured.")); } } // Check for charset meta-data - QString qData = d->m_job->queryMetaData("charset"); + TQString qData = d->m_job->queryMetaData("charset"); if ( !qData.isEmpty() && !d->m_haveEncoding ) // only use information if the user didn't override the settings d->m_encoding = qData; @@ -1646,13 +1646,13 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data ) // DISABLED: Support Content-Location per section 14.14 of RFC 2616. // See BR# 51185,BR# 82747 /* - QString baseURL = d->m_job->queryMetaData ("content-location"); + TQString baseURL = d->m_job->queryMetaData ("content-location"); if (!baseURL.isEmpty()) d->m_doc->setBaseURL(KURL( d->m_doc->completeURL(baseURL) )); */ // Support for Content-Language - QString language = d->m_job->queryMetaData("content-language"); + TQString language = d->m_job->queryMetaData("content-language"); if (!language.isEmpty()) d->m_doc->setContentLanguage(language); @@ -1660,7 +1660,7 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data ) // Support for http last-modified d->m_lastModified = d->m_job->queryMetaData("modified"); } else - d->m_lastModified = QString::null; // done on-demand by lastModified() + d->m_lastModified = TQString::null; // done on-demand by lastModified() } KHTMLPageCache::self()->addData(d->m_cacheId, data); @@ -1669,14 +1669,14 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data ) d->m_frame->m_jscript->dataReceived(); } -void KHTMLPart::slotRestoreData(const QByteArray &data ) +void KHTMLPart::slotRestoreData(const TQByteArray &data ) { // The first data ? if ( !d->m_workingURL.isEmpty() ) { long saveCacheId = d->m_cacheId; - QString savePageReferrer = d->m_pageReferrer; - QString saveEncoding = d->m_encoding; + TQString savePageReferrer = d->m_pageReferrer; + TQString saveEncoding = d->m_encoding; begin( d->m_workingURL, d->m_extension->urlArgs().xOffset, d->m_extension->urlArgs().yOffset ); d->m_encoding = saveEncoding; d->m_pageReferrer = savePageReferrer; @@ -1713,7 +1713,7 @@ void KHTMLPart::showError( KIO::Job* job ) } // This is a protected method, placed here because of it's relevance to showError -void KHTMLPart::htmlError( int errorCode, const QString& text, const KURL& reqUrl ) +void KHTMLPart::htmlError( int errorCode, const TQString& text, const KURL& reqUrl ) { kdDebug(6050) << "KHTMLPart::htmlError errorCode=" << errorCode << " text=" << text << endl; // make sure we're not executing any embedded JS @@ -1722,14 +1722,14 @@ void KHTMLPart::htmlError( int errorCode, const QString& text, const KURL& reqUr d->m_bJScriptForce = false; d->m_bJScriptOverride = true; begin(); - QString errText = QString::fromLatin1( "<HTML dir=%1><HEAD><TITLE>" ) - .arg(QApplication::reverseLayout() ? "rtl" : "ltr"); + TQString errText = TQString::fromLatin1( "<HTML dir=%1><HEAD><TITLE>" ) + .arg(TQApplication::reverseLayout() ? "rtl" : "ltr"); errText += i18n( "Error while loading %1" ).arg( reqUrl.htmlURL() ); - errText += QString::fromLatin1( "</TITLE></HEAD><BODY><P>" ); + errText += TQString::fromLatin1( "</TITLE></HEAD><BODY><P>" ); errText += i18n( "An error occurred while loading <B>%1</B>:" ).arg( reqUrl.htmlURL() ); - errText += QString::fromLatin1( "</P>" ); - errText += QStyleSheet::convertFromPlainText( KIO::buildErrorString( errorCode, text ) ); - errText += QString::fromLatin1( "</BODY></HTML>" ); + errText += TQString::fromLatin1( "</P>" ); + errText += TQStyleSheet::convertFromPlainText( KIO::buildErrorString( errorCode, text ) ); + errText += TQString::fromLatin1( "</BODY></HTML>" ); write(errText); end(); @@ -1746,67 +1746,67 @@ void KHTMLPart::htmlError( int errorCode, const QString& text, const KURL& reqUr return; // following disabled until 3.1 - QString errorName, techName, description; - QStringList causes, solutions; + TQString errorName, techName, description; + TQStringList causes, solutions; - QByteArray raw = KIO::rawErrorDetail( errorCode, text, &reqUrl ); - QDataStream stream(raw, IO_ReadOnly); + TQByteArray raw = KIO::rawErrorDetail( errorCode, text, &reqUrl ); + TQDataStream stream(raw, IO_ReadOnly); stream >> errorName >> techName >> description >> causes >> solutions; - QString url, protocol, datetime; + TQString url, protocol, datetime; url = reqUrl.prettyURL(); protocol = reqUrl.protocol(); - datetime = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime(), + datetime = KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime(), false ); - QString doc = QString::fromLatin1( "<html><head><title>" ); + TQString doc = TQString::fromLatin1( "<html><head><title>" ); doc += i18n( "Error: " ); doc += errorName; - doc += QString::fromLatin1( " - %1</title></head><body><h1>" ).arg( url ); + doc += TQString::fromLatin1( " - %1</title></head><body><h1>" ).arg( url ); doc += i18n( "The requested operation could not be completed" ); - doc += QString::fromLatin1( "</h1><h2>" ); + doc += TQString::fromLatin1( "</h1><h2>" ); doc += errorName; - doc += QString::fromLatin1( "</h2>" ); + doc += TQString::fromLatin1( "</h2>" ); if ( !techName.isNull() ) { - doc += QString::fromLatin1( "<h2>" ); + doc += TQString::fromLatin1( "<h2>" ); doc += i18n( "Technical Reason: " ); doc += techName; - doc += QString::fromLatin1( "</h2>" ); + doc += TQString::fromLatin1( "</h2>" ); } - doc += QString::fromLatin1( "<h3>" ); + doc += TQString::fromLatin1( "<h3>" ); doc += i18n( "Details of the Request:" ); - doc += QString::fromLatin1( "</h3><ul><li>" ); + doc += TQString::fromLatin1( "</h3><ul><li>" ); doc += i18n( "URL: %1" ).arg( url ); - doc += QString::fromLatin1( "</li><li>" ); + doc += TQString::fromLatin1( "</li><li>" ); if ( !protocol.isNull() ) { // uncomment for 3.1... i18n change // doc += i18n( "Protocol: %1" ).arg( protocol ).arg( protocol ); - doc += QString::fromLatin1( "</li><li>" ); + doc += TQString::fromLatin1( "</li><li>" ); } doc += i18n( "Date and Time: %1" ).arg( datetime ); - doc += QString::fromLatin1( "</li><li>" ); + doc += TQString::fromLatin1( "</li><li>" ); doc += i18n( "Additional Information: %1" ).arg( text ); - doc += QString::fromLatin1( "</li></ul><h3>" ); + doc += TQString::fromLatin1( "</li></ul><h3>" ); doc += i18n( "Description:" ); - doc += QString::fromLatin1( "</h3><p>" ); + doc += TQString::fromLatin1( "</h3><p>" ); doc += description; - doc += QString::fromLatin1( "</p>" ); + doc += TQString::fromLatin1( "</p>" ); if ( causes.count() ) { - doc += QString::fromLatin1( "<h3>" ); + doc += TQString::fromLatin1( "<h3>" ); doc += i18n( "Possible Causes:" ); - doc += QString::fromLatin1( "</h3><ul><li>" ); + doc += TQString::fromLatin1( "</h3><ul><li>" ); doc += causes.join( "</li><li>" ); - doc += QString::fromLatin1( "</li></ul>" ); + doc += TQString::fromLatin1( "</li></ul>" ); } if ( solutions.count() ) { - doc += QString::fromLatin1( "<h3>" ); + doc += TQString::fromLatin1( "<h3>" ); doc += i18n( "Possible Solutions:" ); - doc += QString::fromLatin1( "</h3><ul><li>" ); + doc += TQString::fromLatin1( "</h3><ul><li>" ); doc += solutions.join( "</li><li>" ); - doc += QString::fromLatin1( "</li></ul>" ); + doc += TQString::fromLatin1( "</li></ul>" ); } - doc += QString::fromLatin1( "</body></html>" ); + doc += TQString::fromLatin1( "</body></html>" ); write( doc ); end(); @@ -1876,7 +1876,7 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset ) removeJSErrorExtension(); setSuppressedPopupIndicator( false ); d->m_openableSuppressedPopups = 0; - for ( QValueListIterator<QGuardedPtr<KHTMLPart> > i = d->m_suppressedPopupOriginParts.begin(); + for ( TQValueListIterator<TQGuardedPtr<KHTMLPart> > i = d->m_suppressedPopupOriginParts.begin(); i != d->m_suppressedPopupOriginParts.end(); ++i ) { if (KHTMLPart* part = *i) { @@ -1894,9 +1894,9 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset ) d->m_bLoadEventEmitted = false; if(url.isValid()) { - QString urlString = url.url(); + TQString urlString = url.url(); KHTMLFactory::vLinks()->insert( urlString ); - QString urlString2 = url.prettyURL(); + TQString urlString2 = url.prettyURL(); if ( urlString != urlString2 ) { KHTMLFactory::vLinks()->insert( urlString2 ); } @@ -1911,7 +1911,7 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset ) args.yOffset = yOffset; d->m_extension->setURLArgs( args ); - d->m_pageReferrer = QString::null; + d->m_pageReferrer = TQString::null; KURL ref(url); d->m_referrer = ref.protocol().startsWith("http") ? ref.url() : ""; @@ -1940,17 +1940,17 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset ) d->m_doc->docLoader()->setShowAnimations( KHTMLFactory::defaultHTMLSettings()->showAnimations() ); emit docCreated(); - d->m_paUseStylesheet->setItems(QStringList()); + d->m_paUseStylesheet->setItems(TQStringList()); d->m_paUseStylesheet->setEnabled( false ); setAutoloadImages( KHTMLFactory::defaultHTMLSettings()->autoLoadImages() ); - QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet(); + TQString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet(); if ( !userStyleSheet.isEmpty() ) setUserStyleSheet( KURL( userStyleSheet ) ); d->m_doc->setRestoreState(args.docState); d->m_doc->open(); - connect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing())); + connect(d->m_doc,TQT_SIGNAL(finishedParsing()),this,TQT_SLOT(slotFinishedParsing())); emit d->m_extension->enableAction( "print", true ); @@ -1968,7 +1968,7 @@ void KHTMLPart::write( const char *str, int len ) if ( len == 0 ) return; - QString decoded = d->m_decoder->decode( str, len ); + TQString decoded = d->m_decoder->decode( str, len ); if(decoded.isEmpty()) return; @@ -1989,7 +1989,7 @@ void KHTMLPart::write( const char *str, int len ) t->write( decoded, true ); } -void KHTMLPart::write( const QString &str ) +void KHTMLPart::write( const TQString &str ) { if ( str.isNull() ) return; @@ -2008,7 +2008,7 @@ void KHTMLPart::end() { if (d->m_doc) { if (d->m_decoder) { - QString decoded = d->m_decoder->flush(); + TQString decoded = d->m_decoder->flush(); if (d->m_bFirstData) { d->m_bFirstData = false; d->m_doc->determineParseMode(decoded); @@ -2019,7 +2019,7 @@ void KHTMLPart::end() } } -bool KHTMLPart::doOpenStream( const QString& mimeType ) +bool KHTMLPart::doOpenStream( const TQString& mimeType ) { KMimeType::Ptr mime = KMimeType::mimeType(mimeType); if ( mime->is( "text/html" ) || mime->is( "text/xml" ) ) @@ -2030,7 +2030,7 @@ bool KHTMLPart::doOpenStream( const QString& mimeType ) return false; } -bool KHTMLPart::doWriteStream( const QByteArray& data ) +bool KHTMLPart::doWriteStream( const TQByteArray& data ) { write( data.data(), data.size() ); return true; @@ -2043,7 +2043,7 @@ bool KHTMLPart::doCloseStream() } -void KHTMLPart::paint(QPainter *p, const QRect &rc, int yOff, bool *more) +void KHTMLPart::paint(TQPainter *p, const TQRect &rc, int yOff, bool *more) { if (!d->m_view) return; d->m_view->paint(p, rc, yOff, more); @@ -2068,8 +2068,8 @@ void KHTMLPart::resetFromScript() closeURL(); d->m_bComplete = false; d->m_bLoadEventEmitted = false; - disconnect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing())); - connect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing())); + disconnect(d->m_doc,TQT_SIGNAL(finishedParsing()),this,TQT_SLOT(slotFinishedParsing())); + connect(d->m_doc,TQT_SIGNAL(finishedParsing()),this,TQT_SLOT(slotFinishedParsing())); d->m_doc->setParsing(true); emit started( 0L ); @@ -2079,7 +2079,7 @@ void KHTMLPart::slotFinishedParsing() { d->m_doc->setParsing(false); checkEmitLoadEvent(); - disconnect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing())); + disconnect(d->m_doc,TQT_SIGNAL(finishedParsing()),this,TQT_SLOT(slotFinishedParsing())); if (!d->m_view) return; // We are probably being destructed. @@ -2292,7 +2292,7 @@ void KHTMLPart::checkCompleted() d->m_view->complete( pendingAction ); // find the alternate stylesheets - QStringList sheets; + TQStringList sheets; if (d->m_doc) sheets = d->m_doc->availableStyleSheets(); sheets.prepend( i18n( "Automatic Detection" ) ); @@ -2305,7 +2305,7 @@ void KHTMLPart::checkCompleted() slotUseStylesheet(); } - setJSDefaultStatusBarText(QString::null); + setJSDefaultStatusBarText(TQString::null); #ifdef SPEED_DEBUG kdDebug(6050) << "DONE: " <<d->m_parsetime.elapsed() << endl; @@ -2357,15 +2357,15 @@ KURL KHTMLPart::baseURL() const return d->m_doc->baseURL(); } -QString KHTMLPart::baseTarget() const +TQString KHTMLPart::baseTarget() const { - if ( !d->m_doc ) return QString::null; + if ( !d->m_doc ) return TQString::null; return d->m_doc->baseTarget(); } #endif -KURL KHTMLPart::completeURL( const QString &url ) +KURL KHTMLPart::completeURL( const TQString &url ) { if ( !d->m_doc ) return KURL( url ); @@ -2377,7 +2377,7 @@ KURL KHTMLPart::completeURL( const QString &url ) // Called by ecma/kjs_window in case of redirections from Javascript, // and by xml/dom_docimpl.cpp in case of http-equiv meta refresh. -void KHTMLPart::scheduleRedirection( int delay, const QString &url, bool doLockHistory ) +void KHTMLPart::scheduleRedirection( int delay, const TQString &url, bool doLockHistory ) { kdDebug(6050) << "KHTMLPart::scheduleRedirection delay=" << delay << " url=" << url << endl; kdDebug(6050) << "current redirectURL=" << d->m_redirectURL << " with delay " << d->m_delayRedirect << endl; @@ -2397,17 +2397,17 @@ void KHTMLPart::scheduleRedirection( int delay, const QString &url, bool doLockH void KHTMLPart::slotRedirect() { kdDebug(6050) << this << " slotRedirect()" << endl; - QString u = d->m_redirectURL; + TQString u = d->m_redirectURL; d->m_delayRedirect = 0; - d->m_redirectURL = QString::null; + d->m_redirectURL = TQString::null; // SYNC check with ecma/kjs_window.cpp::goURL ! - if ( u.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 ) + if ( u.find( TQString::fromLatin1( "javascript:" ), 0, false ) == 0 ) { - QString script = KURL::decode_string( u.right( u.length() - 11 ) ); + TQString script = KURL::decode_string( u.right( u.length() - 11 ) ); kdDebug( 6050 ) << "KHTMLPart::slotRedirect script=" << script << endl; - QVariant res = executeScript( DOM::Node(), script ); - if ( res.type() == QVariant::String ) { + TQVariant res = executeScript( DOM::Node(), script ); + if ( res.type() == TQVariant::String ) { begin( url() ); write( res.asString() ); end(); @@ -2461,7 +2461,7 @@ void KHTMLPart::slotRedirection(KIO::Job*, const KURL& url) d->m_workingURL = url; } -bool KHTMLPart::setEncoding( const QString &name, bool override ) +bool KHTMLPart::setEncoding( const TQString &name, bool override ) { d->m_encoding = name; d->m_haveEncoding = override; @@ -2479,20 +2479,20 @@ bool KHTMLPart::setEncoding( const QString &name, bool override ) return true; } -QString KHTMLPart::encoding() const +TQString KHTMLPart::encoding() const { if(d->m_haveEncoding && !d->m_encoding.isEmpty()) return d->m_encoding; if(d->m_decoder && d->m_decoder->encoding()) - return QString(d->m_decoder->encoding()); + return TQString(d->m_decoder->encoding()); return defaultEncoding(); } -QString KHTMLPart::defaultEncoding() const +TQString KHTMLPart::defaultEncoding() const { - QString encoding = settings()->encoding(); + TQString encoding = settings()->encoding(); if ( !encoding.isEmpty() ) return encoding; // HTTP requires the default encoding to be latin1, when neither @@ -2509,13 +2509,13 @@ void KHTMLPart::setUserStyleSheet(const KURL &url) (void) new khtml::PartStyleSheetLoader(this, url.url(), d->m_doc->docLoader()); } -void KHTMLPart::setUserStyleSheet(const QString &styleSheet) +void KHTMLPart::setUserStyleSheet(const TQString &styleSheet) { if ( d->m_doc ) d->m_doc->setUserStyleSheet( styleSheet ); } -bool KHTMLPart::gotoAnchor( const QString &name ) +bool KHTMLPart::gotoAnchor( const TQString &name ) { if (!d->m_doc) return false; @@ -2581,22 +2581,22 @@ bool KHTMLPart::prevAnchor() return true; } -void KHTMLPart::setStandardFont( const QString &name ) +void KHTMLPart::setStandardFont( const TQString &name ) { d->m_settings->setStdFontName(name); } -void KHTMLPart::setFixedFont( const QString &name ) +void KHTMLPart::setFixedFont( const TQString &name ) { d->m_settings->setFixedFontName(name); } -void KHTMLPart::setURLCursor( const QCursor &c ) +void KHTMLPart::setURLCursor( const TQCursor &c ) { d->m_linkCursor = c; } -QCursor KHTMLPart::urlCursor() const +TQCursor KHTMLPart::urlCursor() const { return d->m_linkCursor; } @@ -2619,8 +2619,8 @@ void KHTMLPartPrivate::setFlagRecursively( // descend into child frames recursively { - QValueList<khtml::ChildFrame*>::Iterator it = m_frames.begin(); - const QValueList<khtml::ChildFrame*>::Iterator itEnd = m_frames.end(); + TQValueList<khtml::ChildFrame*>::Iterator it = m_frames.begin(); + const TQValueList<khtml::ChildFrame*>::Iterator itEnd = m_frames.end(); for (; it != itEnd; ++it) { KHTMLPart* const part = static_cast<KHTMLPart *>((KParts::ReadOnlyPart *)(*it)->m_part); if (part->inherits("KHTMLPart")) @@ -2629,8 +2629,8 @@ void KHTMLPartPrivate::setFlagRecursively( } // do the same again for objects { - QValueList<khtml::ChildFrame*>::Iterator it = m_objects.begin(); - const QValueList<khtml::ChildFrame*>::Iterator itEnd = m_objects.end(); + TQValueList<khtml::ChildFrame*>::Iterator it = m_objects.begin(); + const TQValueList<khtml::ChildFrame*>::Iterator itEnd = m_objects.end(); for (; it != itEnd; ++it) { KHTMLPart* const part = static_cast<KHTMLPart *>((KParts::ReadOnlyPart *)(*it)->m_part); if (part->inherits("KHTMLPart")) @@ -2817,7 +2817,7 @@ bool KHTMLPart::initFindNode( bool selection, bool reverse, bool fromCursor ) } // Old method (its API limits the available features - remove in KDE-4) -bool KHTMLPart::findTextNext( const QString &str, bool forward, bool caseSensitive, bool isRegExp ) +bool KHTMLPart::findTextNext( const TQString &str, bool forward, bool caseSensitive, bool isRegExp ) { if ( !initFindNode( false, !forward, d->m_findNode ) ) return false; @@ -2827,11 +2827,11 @@ bool KHTMLPart::findTextNext( const QString &str, bool forward, bool caseSensiti { DOMString nodeText = d->m_findNode->nodeValue(); DOMStringImpl *t = nodeText.implementation(); - QConstString s(t->s, t->l); + TQConstString s(t->s, t->l); int matchLen = 0; if ( isRegExp ) { - QRegExp matcher( str ); + TQRegExp matcher( str ); matcher.setCaseSensitive( caseSensitive ); d->m_findPos = matcher.search(s.string(), d->m_findPos+1); if ( d->m_findPos != -1 ) @@ -3005,7 +3005,7 @@ void KHTMLPart::findText() // The lineedit of the dialog would make khtml lose its selection, otherwise #ifndef QT_NO_CLIPBOARD - disconnect( kapp->clipboard(), SIGNAL(selectionChanged()), this, SLOT(slotClearSelection()) ); + disconnect( kapp->clipboard(), TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotClearSelection()) ); #endif // Now show the dialog in which the user can choose options. @@ -3023,30 +3023,30 @@ void KHTMLPart::findText() d->m_lastFindState.last_dir = -1; d->m_findDialog->show(); - connect( d->m_findDialog, SIGNAL(okClicked()), this, SLOT(slotFindNext()) ); - connect( d->m_findDialog, SIGNAL(finished()), this, SLOT(slotFindDialogDestroyed()) ); + connect( d->m_findDialog, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotFindNext()) ); + connect( d->m_findDialog, TQT_SIGNAL(finished()), this, TQT_SLOT(slotFindDialogDestroyed()) ); findText( d->m_findDialog->pattern(), 0 /*options*/, widget(), d->m_findDialog ); } -void KHTMLPart::findText( const QString &str, long options, QWidget *parent, KFindDialog *findDialog ) +void KHTMLPart::findText( const TQString &str, long options, TQWidget *parent, KFindDialog *findDialog ) { // First do some init to make sure we can search in this frame if ( !d->m_doc ) return; #ifndef QT_NO_CLIPBOARD - connect( kapp->clipboard(), SIGNAL(selectionChanged()), SLOT(slotClearSelection()) ); + connect( kapp->clipboard(), TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotClearSelection()) ); #endif // Create the KFind object delete d->m_find; d->m_find = new KFind( str, options, parent, findDialog ); d->m_find->closeFindNextDialog(); // we use KFindDialog non-modal, so we don't want other dlg popping up - connect( d->m_find, SIGNAL( highlight( const QString &, int, int ) ), - this, SLOT( slotHighlight( const QString &, int, int ) ) ); - //connect(d->m_find, SIGNAL( findNext() ), - // this, SLOT( slotFindNext() ) ); + connect( d->m_find, TQT_SIGNAL( highlight( const TQString &, int, int ) ), + this, TQT_SLOT( slotHighlight( const TQString &, int, int ) ) ); + //connect(d->m_find, TQT_SIGNAL( findNext() ), + // this, TQT_SLOT( slotFindNext() ) ); if ( !findDialog ) { @@ -3146,20 +3146,20 @@ bool KHTMLPart::findTextNext( bool reverse ) break; // we're done } //kdDebug(6050) << k_funcinfo << " gathering data" << endl; - // First make up the QString for the current 'line' (i.e. up to \n) + // First make up the TQString for the current 'line' (i.e. up to \n) // We also want to remember the DOMNode for every portion of the string. // We store this in an index->node list. d->m_stringPortions.clear(); bool newLine = false; - QString str; + TQString str; DOM::NodeImpl* lastNode = d->m_findNode; while ( obj && !newLine ) { // Grab text from render object - QString s; - bool renderAreaText = obj->parent() && (QCString(obj->parent()->renderName())== "RenderTextArea"); - bool renderLineText = (QCString(obj->renderName())== "RenderLineEdit"); + TQString s; + bool renderAreaText = obj->parent() && (TQCString(obj->parent()->renderName())== "RenderTextArea"); + bool renderLineText = (TQCString(obj->renderName())== "RenderLineEdit"); if ( renderAreaText ) { khtml::RenderTextArea *parent= static_cast<khtml::RenderTextArea *>(obj->parent()); @@ -3170,7 +3170,7 @@ bool KHTMLPart::findTextNext( bool reverse ) else if ( renderLineText ) { khtml::RenderLineEdit *parentLine= static_cast<khtml::RenderLineEdit *>(obj); - if (parentLine->widget()->echoMode() == QLineEdit::Normal) + if (parentLine->widget()->echoMode() == TQLineEdit::Normal) s = parentLine->widget()->text(); s = s.replace(0xa0, ' '); } @@ -3221,7 +3221,7 @@ bool KHTMLPart::findTextNext( bool reverse ) } else // KFind itself can search backwards, so str must not be built backwards { - for( QValueList<KHTMLPartPrivate::StringPortion>::Iterator it = d->m_stringPortions.begin(); + for( TQValueList<KHTMLPartPrivate::StringPortion>::Iterator it = d->m_stringPortions.begin(); it != d->m_stringPortions.end(); ++it ) (*it).index += s.length(); @@ -3290,12 +3290,12 @@ bool KHTMLPart::findTextNext( bool reverse ) return res == KFind::Match; } -void KHTMLPart::slotHighlight( const QString& /*text*/, int index, int length ) +void KHTMLPart::slotHighlight( const TQString& /*text*/, int index, int length ) { //kdDebug(6050) << "slotHighlight index=" << index << " length=" << length << endl; - QValueList<KHTMLPartPrivate::StringPortion>::Iterator it = d->m_stringPortions.begin(); - const QValueList<KHTMLPartPrivate::StringPortion>::Iterator itEnd = d->m_stringPortions.end(); - QValueList<KHTMLPartPrivate::StringPortion>::Iterator prev = it; + TQValueList<KHTMLPartPrivate::StringPortion>::Iterator it = d->m_stringPortions.begin(); + const TQValueList<KHTMLPartPrivate::StringPortion>::Iterator itEnd = d->m_stringPortions.end(); + TQValueList<KHTMLPartPrivate::StringPortion>::Iterator prev = it; // We stop at the first portion whose index is 'greater than', and then use the previous one while ( it != itEnd && (*it).index <= index ) { @@ -3314,14 +3314,14 @@ void KHTMLPart::slotHighlight( const QString& /*text*/, int index, int length ) khtml::RenderLineEdit *parentLine = 0L; bool renderLineText =false; - QRect highlightedRect; + TQRect highlightedRect; bool renderAreaText =false; Q_ASSERT( obj ); if ( obj ) { int x = 0, y = 0; - renderAreaText = (QCString(obj->parent()->renderName())== "RenderTextArea"); - renderLineText = (QCString(obj->renderName())== "RenderLineEdit"); + renderAreaText = (TQCString(obj->parent()->renderName())== "RenderTextArea"); + renderLineText = (TQCString(obj->renderName())== "RenderLineEdit"); if( renderAreaText ) @@ -3345,7 +3345,7 @@ void KHTMLPart::slotHighlight( const QString& /*text*/, int index, int length ) gox = x - d->m_view->visibleWidth() - 10; if (gox < 0) gox = 0; d->m_view->setContentsPos(gox, y-50); - highlightedRect.setTopLeft( d->m_view->mapToGlobal(QPoint(x, y)) ); + highlightedRect.setTopLeft( d->m_view->mapToGlobal(TQPoint(x, y)) ); } } } @@ -3416,7 +3416,7 @@ void KHTMLPart::slotHighlight( const QString& /*text*/, int index, int length ) { // if ( static_cast<khtml::RenderText *>(d->m_selectionEnd.handle()->renderer()) // ->posOfChar(d->m_endOffset-1, x, y)) - highlightedRect.setBottomRight( d->m_view->mapToGlobal( QPoint(x, y+height) ) ); + highlightedRect.setBottomRight( d->m_view->mapToGlobal( TQPoint(x, y+height) ) ); } } } @@ -3431,33 +3431,33 @@ void KHTMLPart::slotHighlight( const QString& /*text*/, int index, int length ) } } -QString KHTMLPart::selectedTextAsHTML() const +TQString KHTMLPart::selectedTextAsHTML() const { if(!hasSelection()) { kdDebug() << "selectedTextAsHTML(): selection is not valid. Returning empty selection" << endl; - return QString::null; + return TQString::null; } if(d->m_startOffset < 0 || d->m_endOffset <0) { kdDebug() << "invalid values for end/startOffset " << d->m_startOffset << " " << d->m_endOffset << endl; - return QString::null; + return TQString::null; } DOM::Range r = selection(); if(r.isNull() || r.isDetached()) - return QString::null; + return TQString::null; int exceptioncode = 0; //ignore the result return r.handle()->toHTML(exceptioncode).string(); } -QString KHTMLPart::selectedText() const +TQString KHTMLPart::selectedText() const { bool hasNewLine = true; bool seenTDTag = false; - QString text; + TQString text; DOM::Node n = d->m_selectionStart; while(!n.isNull()) { if(n.nodeType() == DOM::Node::TEXT_NODE && n.handle()->renderer()) { DOM::DOMStringImpl *dstr = static_cast<DOM::TextImpl*>(n.handle())->renderString(); - QString str(dstr->s, dstr->l); + TQString str(dstr->s, dstr->l); if(!str.isEmpty()) { if(seenTDTag) { text += " "; @@ -3574,7 +3574,7 @@ QString KHTMLPart::selectedText() const } if(text.isEmpty()) - return QString::null; + return TQString::null; int start = 0; int end = text.length(); @@ -3708,15 +3708,15 @@ void KHTMLPart::resetHoverText() { if( !d->m_overURL.isEmpty() ) // Only if we were showing a link { - d->m_overURL = d->m_overURLTarget = QString::null; - emit onURL( QString::null ); + d->m_overURL = d->m_overURLTarget = TQString::null; + emit onURL( TQString::null ); // revert to default statusbar text - setStatusBarText(QString::null, BarHoverText); + setStatusBarText(TQString::null, BarHoverText); emit d->m_extension->mouseOverInfo(0); } } -void KHTMLPart::overURL( const QString &url, const QString &target, bool /*shiftPressed*/ ) +void KHTMLPart::overURL( const TQString &url, const TQString &target, bool /*shiftPressed*/ ) { KURL u = completeURL(url); @@ -3731,19 +3731,19 @@ void KHTMLPart::overURL( const QString &url, const QString &target, bool /*shift return; } - if (url.find( QString::fromLatin1( "javascript:" ),0, false ) == 0 ) { - QString jscode = KURL::decode_string( url.mid( url.find( "javascript:", 0, false ) ) ); + if (url.find( TQString::fromLatin1( "javascript:" ),0, false ) == 0 ) { + TQString jscode = KURL::decode_string( url.mid( url.find( "javascript:", 0, false ) ) ); jscode = KStringHandler::rsqueeze( jscode, 80 ); // truncate if too long if (url.startsWith("javascript:window.open")) jscode += i18n(" (In new window)"); - setStatusBarText( QStyleSheet::escape( jscode ), BarHoverText ); + setStatusBarText( TQStyleSheet::escape( jscode ), BarHoverText ); return; } - KFileItem item(u, QString::null, KFileItem::Unknown); + KFileItem item(u, TQString::null, KFileItem::Unknown); emit d->m_extension->mouseOverInfo(&item); - QString com; + TQString com; KMimeType::Ptr typ = KMimeType::findByURL( u ); @@ -3759,7 +3759,7 @@ void KHTMLPart::overURL( const QString &url, const QString &target, bool /*shift { // TODO : use KIO::stat() and create a KFileItem out of its result, // to use KFileItem::statusBarText() - QCString path = QFile::encodeName( u.path() ); + TQCString path = TQFile::encodeName( u.path() ); struct stat buff; bool ok = !stat( path.data(), &buff ); @@ -3767,12 +3767,12 @@ void KHTMLPart::overURL( const QString &url, const QString &target, bool /*shift struct stat lbuff; if (ok) ok = !lstat( path.data(), &lbuff ); - QString text = u.htmlURL(); - QString text2 = text; + TQString text = u.htmlURL(); + TQString text2 = text; if (ok && S_ISLNK( lbuff.st_mode ) ) { - QString tmp; + TQString tmp; if ( com.isNull() ) tmp = i18n( "Symbolic Link"); else @@ -3819,7 +3819,7 @@ void KHTMLPart::overURL( const QString &url, const QString &target, bool /*shift } else { - QString extra; + TQString extra; if (target.lower() == "_blank") { extra = i18n(" (In new window)"); @@ -3838,42 +3838,42 @@ void KHTMLPart::overURL( const QString &url, const QString &target, bool /*shift extra = i18n(" (In other frame)"); } - if (u.protocol() == QString::fromLatin1("mailto")) { - QString mailtoMsg /* = QString::fromLatin1("<img src=%1>").arg(locate("icon", QString::fromLatin1("locolor/16x16/actions/mail_send.png")))*/; + if (u.protocol() == TQString::fromLatin1("mailto")) { + TQString mailtoMsg /* = TQString::fromLatin1("<img src=%1>").arg(locate("icon", TQString::fromLatin1("locolor/16x16/actions/mail_send.png")))*/; mailtoMsg += i18n("Email to: ") + KURL::decode_string(u.path()); - QStringList queries = QStringList::split('&', u.query().mid(1)); - QStringList::Iterator it = queries.begin(); - const QStringList::Iterator itEnd = queries.end(); + TQStringList queries = TQStringList::split('&', u.query().mid(1)); + TQStringList::Iterator it = queries.begin(); + const TQStringList::Iterator itEnd = queries.end(); for (; it != itEnd; ++it) - if ((*it).startsWith(QString::fromLatin1("subject="))) + if ((*it).startsWith(TQString::fromLatin1("subject="))) mailtoMsg += i18n(" - Subject: ") + KURL::decode_string((*it).mid(8)); - else if ((*it).startsWith(QString::fromLatin1("cc="))) + else if ((*it).startsWith(TQString::fromLatin1("cc="))) mailtoMsg += i18n(" - CC: ") + KURL::decode_string((*it).mid(3)); - else if ((*it).startsWith(QString::fromLatin1("bcc="))) + else if ((*it).startsWith(TQString::fromLatin1("bcc="))) mailtoMsg += i18n(" - BCC: ") + KURL::decode_string((*it).mid(4)); - mailtoMsg = QStyleSheet::escape(mailtoMsg); - mailtoMsg.replace(QRegExp("([\n\r\t]|[ ]{10})"), QString::null); + mailtoMsg = TQStyleSheet::escape(mailtoMsg); + mailtoMsg.replace(TQRegExp("([\n\r\t]|[ ]{10})"), TQString::null); setStatusBarText("<qt>"+mailtoMsg, BarHoverText); return; } // Is this check necessary at all? (Frerich) #if 0 - else if (u.protocol() == QString::fromLatin1("http")) { + else if (u.protocol() == TQString::fromLatin1("http")) { DOM::Node hrefNode = nodeUnderMouse().parentNode(); - while (hrefNode.nodeName().string() != QString::fromLatin1("A") && !hrefNode.isNull()) + while (hrefNode.nodeName().string() != TQString::fromLatin1("A") && !hrefNode.isNull()) hrefNode = hrefNode.parentNode(); if (!hrefNode.isNull()) { DOM::Node hreflangNode = hrefNode.attributes().getNamedItem("HREFLANG"); if (!hreflangNode.isNull()) { - QString countryCode = hreflangNode.nodeValue().string().lower(); + TQString countryCode = hreflangNode.nodeValue().string().lower(); // Map the language code to an appropriate country code. - if (countryCode == QString::fromLatin1("en")) - countryCode = QString::fromLatin1("gb"); - QString flagImg = QString::fromLatin1("<img src=%1>").arg( - locate("locale", QString::fromLatin1("l10n/") + if (countryCode == TQString::fromLatin1("en")) + countryCode = TQString::fromLatin1("gb"); + TQString flagImg = TQString::fromLatin1("<img src=%1>").arg( + locate("locale", TQString::fromLatin1("l10n/") + countryCode - + QString::fromLatin1("/flag.png"))); + + TQString::fromLatin1("/flag.png"))); emit setStatusBarText(flagImg + u.prettyURL() + extra); } } @@ -3887,7 +3887,7 @@ void KHTMLPart::overURL( const QString &url, const QString &target, bool /*shift // This executes in the active part on a click or other url selection action in // that active part. // -void KHTMLPart::urlSelected( const QString &url, int button, int state, const QString &_target, KParts::URLArgs args ) +void KHTMLPart::urlSelected( const TQString &url, int button, int state, const TQString &_target, KParts::URLArgs args ) { // The member var is so that slotRedirection still calls the virtual urlSelected // but is able to know if is opened a url. KDE4: just make urlSelected return a bool @@ -3896,17 +3896,17 @@ void KHTMLPart::urlSelected( const QString &url, int button, int state, const QS } // Return value: true if an url was opened, false if not (e.g. error, or jumping to anchor) -bool KHTMLPart::urlSelectedIntern( const QString &url, int button, int state, const QString &_target, KParts::URLArgs args ) +bool KHTMLPart::urlSelectedIntern( const TQString &url, int button, int state, const TQString &_target, KParts::URLArgs args ) { bool hasTarget = false; - QString target = _target; + TQString target = _target; if ( target.isEmpty() && d->m_doc ) target = d->m_doc->baseTarget(); if ( !target.isEmpty() ) hasTarget = true; - if ( url.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 ) + if ( url.find( TQString::fromLatin1( "javascript:" ), 0, false ) == 0 ) { crossFrameExecuteScript( target, KURL::decode_string( url.mid( 11 ) ) ); return false; @@ -4017,7 +4017,7 @@ void KHTMLPart::slotViewDocumentSource() bool isTempFile = false; if (!(url.isLocalFile()) && KHTMLPageCache::self()->isComplete(d->m_cacheId)) { - KTempFile sourceFile(QString::null, defaultExtension()); + KTempFile sourceFile(TQString::null, defaultExtension()); if (sourceFile.status() == 0) { KHTMLPageCache::self()->saveData(d->m_cacheId, sourceFile.dataStream()); @@ -4027,7 +4027,7 @@ void KHTMLPart::slotViewDocumentSource() } } - (void) KRun::runURL( url, QString::fromLatin1("text/plain"), isTempFile ); + (void) KRun::runURL( url, TQString::fromLatin1("text/plain"), isTempFile ); } void KHTMLPart::slotViewPageInfo() @@ -4043,12 +4043,12 @@ void KHTMLPart::slotViewPageInfo() dlg->setCaption(i18n("Frame Information")); } - QString editStr = QString::null; + TQString editStr = TQString::null; if (!d->m_pageServices.isEmpty()) editStr = i18n(" <a href=\"%1\">[Properties]</a>").arg(d->m_pageServices); - QString squeezedURL = KStringHandler::csqueeze( url().prettyURL(), 80 ); + TQString squeezedURL = KStringHandler::csqueeze( url().prettyURL(), 80 ); dlg->_url->setText("<a href=\"" + url().url() + "\">" + squeezedURL + "</a>" + editStr); if (lastModified().isEmpty()) { @@ -4058,7 +4058,7 @@ void KHTMLPart::slotViewPageInfo() else dlg->_lastModified->setText(lastModified()); - const QString& enc = encoding(); + const TQString& enc = encoding(); if (enc.isEmpty()) { dlg->_eLabel->hide(); dlg->_encoding->hide(); @@ -4066,16 +4066,16 @@ void KHTMLPart::slotViewPageInfo() dlg->_encoding->setText(enc); } /* populate the list view now */ - const QStringList headers = QStringList::split("\n", d->m_httpHeaders); + const TQStringList headers = TQStringList::split("\n", d->m_httpHeaders); - QStringList::ConstIterator it = headers.begin(); - const QStringList::ConstIterator itEnd = headers.end(); + TQStringList::ConstIterator it = headers.begin(); + const TQStringList::ConstIterator itEnd = headers.end(); for (; it != itEnd; ++it) { - const QStringList header = QStringList::split(QRegExp(":[ ]+"), *it); + const TQStringList header = TQStringList::split(TQRegExp(":[ ]+"), *it); if (header.count() != 2) continue; - new QListViewItem(dlg->_headers, header[0], header[1]); + new TQListViewItem(dlg->_headers, header[0], header[1]); } dlg->show(); @@ -4097,7 +4097,7 @@ void KHTMLPart::slotViewFrameSource() if (KHTMLPageCache::self()->isComplete(cacheId)) { - KTempFile sourceFile(QString::null, defaultExtension()); + KTempFile sourceFile(TQString::null, defaultExtension()); if (sourceFile.status() == 0) { KHTMLPageCache::self()->saveData(cacheId, sourceFile.dataStream()); @@ -4108,7 +4108,7 @@ void KHTMLPart::slotViewFrameSource() } } - (void) KRun::runURL( url, QString::fromLatin1("text/plain"), isTempFile ); + (void) KRun::runURL( url, TQString::fromLatin1("text/plain"), isTempFile ); } KURL KHTMLPart::backgroundURL() const @@ -4117,7 +4117,7 @@ KURL KHTMLPart::backgroundURL() const if (!d->m_doc || !d->m_doc->isHTMLDocument()) return KURL(); - QString relURL = static_cast<HTMLDocumentImpl*>(d->m_doc)->body()->getAttribute( ATTR_BACKGROUND ).string(); + TQString relURL = static_cast<HTMLDocumentImpl*>(d->m_doc)->body()->getAttribute( ATTR_BACKGROUND ).string(); return KURL( m_url, relURL ); } @@ -4170,12 +4170,12 @@ void KHTMLPart::slotSecurity() KSSLCertificate *x = KSSLCertificate::fromString(d->m_ssl_peer_certificate.local8Bit()); if (x) { // Set the chain back onto the certificate - const QStringList cl = QStringList::split(QString("\n"), d->m_ssl_peer_chain); - QPtrList<KSSLCertificate> ncl; + const TQStringList cl = TQStringList::split(TQString("\n"), d->m_ssl_peer_chain); + TQPtrList<KSSLCertificate> ncl; ncl.setAutoDelete(true); - QStringList::ConstIterator it = cl.begin(); - const QStringList::ConstIterator itEnd = cl.end(); + TQStringList::ConstIterator it = cl.begin(); + const TQStringList::ConstIterator itEnd = cl.end(); for (; it != itEnd; ++it) { KSSLCertificate* const y = KSSLCertificate::fromString((*it).local8Bit()); if (y) ncl.append(y); @@ -4222,7 +4222,7 @@ void KHTMLPart::slotSetEncoding() d->m_paSetEncoding->popupMenu()->setItemChecked( 0, false ); d->m_paSetEncoding->popupMenu()->setItemChecked( d->m_paSetEncoding->popupMenu()->idAt( 2 ), true ); - QString enc = KGlobal::charsets()->encodingForName( d->m_manualDetection->currentText() ); + TQString enc = KGlobal::charsets()->encodingForName( d->m_manualDetection->currentText() ); setEncoding( enc, true ); } @@ -4231,7 +4231,7 @@ void KHTMLPart::slotUseStylesheet() if (d->m_doc) { bool autoselect = (d->m_paUseStylesheet->currentItem() == 0); - d->m_sheetUsed = autoselect ? QString() : d->m_paUseStylesheet->currentText(); + d->m_sheetUsed = autoselect ? TQString() : d->m_paUseStylesheet->currentText(); d->m_doc->updateStyleSelector(); } } @@ -4240,8 +4240,8 @@ void KHTMLPart::updateActions() { bool frames = false; - QValueList<khtml::ChildFrame*>::ConstIterator it = d->m_frames.begin(); - const QValueList<khtml::ChildFrame*>::ConstIterator end = d->m_frames.end(); + TQValueList<khtml::ChildFrame*>::ConstIterator it = d->m_frames.begin(); + const TQValueList<khtml::ChildFrame*>::ConstIterator end = d->m_frames.end(); for (; it != end; ++it ) if ( (*it)->m_type == khtml::ChildFrame::Frame ) { @@ -4274,14 +4274,14 @@ void KHTMLPart::updateActions() if ( frame ) { - QObject *ext = KParts::BrowserExtension::childObject( frame ); + TQObject *ext = KParts::BrowserExtension::childObject( frame ); if ( ext ) enablePrintFrame = ext->metaObject()->slotNames().contains( "print()" ); } d->m_paPrintFrame->setEnabled( enablePrintFrame ); - QString bgURL; + TQString bgURL; // ### frames if ( d->m_doc && d->m_doc->isHTMLDocument() && static_cast<HTMLDocumentImpl*>(d->m_doc)->body() && !d->m_bClearing ) @@ -4301,8 +4301,8 @@ KParts::LiveConnectExtension *KHTMLPart::liveConnectExtension( const khtml::Rend return 0L; } -bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, const QString &frameName, - const QStringList ¶ms, bool isIFrame ) +bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const TQString &url, const TQString &frameName, + const TQStringList ¶ms, bool isIFrame ) { //kdDebug( 6050 ) << this << " requestFrame( ..., " << url << ", " << frameName << " )" << endl; FrameIt it = d->m_frames.find( frameName ); @@ -4319,14 +4319,14 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons (*it)->m_params = params; // Support for <frame src="javascript:string"> - if ( url.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 ) + if ( url.find( TQString::fromLatin1( "javascript:" ), 0, false ) == 0 ) { - if ( processObjectRequest(*it, KURL("about:blank"), QString("text/html") ) ) { + if ( processObjectRequest(*it, KURL("about:blank"), TQString("text/html") ) ) { KHTMLPart* p = static_cast<KHTMLPart*>(static_cast<KParts::ReadOnlyPart *>((*it)->m_part)); // See if we want to replace content with javascript: output.. - QVariant res = p->executeScript( DOM::Node(), KURL::decode_string( url.right( url.length() - 11) ) ); - if ( res.type() == QVariant::String ) { + TQVariant res = p->executeScript( DOM::Node(), KURL::decode_string( url.right( url.length() - 11) ) ); + if ( res.type() == TQVariant::String ) { p->begin(); p->write( res.asString() ); p->end(); @@ -4339,13 +4339,13 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons return requestObject( *it, u ); } -QString KHTMLPart::requestFrameName() +TQString KHTMLPart::requestFrameName() { - return QString::fromLatin1("<!--frame %1-->").arg(d->m_frameNameId++); + return TQString::fromLatin1("<!--frame %1-->").arg(d->m_frameNameId++); } -bool KHTMLPart::requestObject( khtml::RenderPart *frame, const QString &url, const QString &serviceType, - const QStringList ¶ms ) +bool KHTMLPart::requestObject( khtml::RenderPart *frame, const TQString &url, const TQString &serviceType, + const TQStringList ¶ms ) { //kdDebug( 6005 ) << "KHTMLPart::requestObject " << this << " frame=" << frame << endl; khtml::ChildFrame *child = new khtml::ChildFrame; @@ -4392,7 +4392,7 @@ bool KHTMLPart::requestObject( khtml::ChildFrame *child, const KURL &url, const child->m_args = args; child->m_args.reload = (d->m_cachePolicy == KIO::CC_Reload); - child->m_serviceName = QString::null; + child->m_serviceName = TQString::null; if (!d->m_referrer.isEmpty() && !child->m_args.metaData().contains( "referrer" )) child->m_args.metaData()["referrer"] = d->m_referrer; @@ -4408,7 +4408,7 @@ bool KHTMLPart::requestObject( khtml::ChildFrame *child, const KURL &url, const // We want a KHTMLPart if the HTML says <frame src=""> or <frame src="about:blank"> if ((url.isEmpty() || url.url() == "about:blank") && args.serviceType.isEmpty()) - args.serviceType = QString::fromLatin1( "text/html" ); + args.serviceType = TQString::fromLatin1( "text/html" ); if ( args.serviceType.isEmpty() ) { kdDebug(6050) << "Running new KHTMLRun for " << this << " and child=" << child << endl; @@ -4420,7 +4420,7 @@ bool KHTMLPart::requestObject( khtml::ChildFrame *child, const KURL &url, const } } -bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url, const QString &mimetype ) +bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url, const TQString &mimetype ) { //kdDebug( 6050 ) << "KHTMLPart::processObjectRequest trying to create part for " << mimetype << endl; @@ -4451,7 +4451,7 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url // However we don't want to ask for flash and other plugin things.. if ( child->m_type != khtml::ChildFrame::Object ) { - QString suggestedFilename; + TQString suggestedFilename; if ( child->m_run ) suggestedFilename = child->m_run->suggestedFilename(); @@ -4459,7 +4459,7 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url url, mimetype, suggestedFilename ); switch( res ) { case KParts::BrowserRun::Save: - KHTMLPopupGUIClient::saveURL( widget(), i18n( "Save As" ), url, child->m_args.metaData(), QString::null, 0, suggestedFilename); + KHTMLPopupGUIClient::saveURL( widget(), i18n( "Save As" ), url, child->m_args.metaData(), TQString::null, 0, suggestedFilename); // fall-through case KParts::BrowserRun::Cancel: child->m_bCompleted = true; @@ -4470,7 +4470,7 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url } } - QStringList dummy; // the list of servicetypes handled by the part is now unused. + TQStringList dummy; // the list of servicetypes handled by the part is now unused. KParts::ReadOnlyPart *part = createPart( d->m_view->viewport(), child->m_name.ascii(), this, child->m_name.ascii(), mimetype, child->m_serviceName, dummy, child->m_params ); if ( !part ) @@ -4491,7 +4491,7 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url partManager()->removePart( (KParts::ReadOnlyPart *)child->m_part ); delete (KParts::ReadOnlyPart *)child->m_part; if (child->m_liveconnect) { - disconnect(child->m_liveconnect, SIGNAL(partEvent(const unsigned long, const QString &, const KParts::LiveConnectExtension::ArgList &)), child, SLOT(liveConnectEvent(const unsigned long, const QString&, const KParts::LiveConnectExtension::ArgList &))); + disconnect(child->m_liveconnect, TQT_SIGNAL(partEvent(const unsigned long, const TQString &, const KParts::LiveConnectExtension::ArgList &)), child, TQT_SLOT(liveConnectEvent(const unsigned long, const TQString&, const KParts::LiveConnectExtension::ArgList &))); child->m_liveconnect = 0L; } } @@ -4512,65 +4512,65 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url } else if (child->m_frame) { child->m_liveconnect = KParts::LiveConnectExtension::childObject(part); if (child->m_liveconnect) - connect(child->m_liveconnect, SIGNAL(partEvent(const unsigned long, const QString &, const KParts::LiveConnectExtension::ArgList &)), child, SLOT(liveConnectEvent(const unsigned long, const QString&, const KParts::LiveConnectExtension::ArgList &))); + connect(child->m_liveconnect, TQT_SIGNAL(partEvent(const unsigned long, const TQString &, const KParts::LiveConnectExtension::ArgList &)), child, TQT_SLOT(liveConnectEvent(const unsigned long, const TQString&, const KParts::LiveConnectExtension::ArgList &))); } KParts::StatusBarExtension *sb = KParts::StatusBarExtension::childObject(part); if (sb) sb->setStatusBar( d->m_statusBarExtension->statusBar() ); - connect( part, SIGNAL( started( KIO::Job *) ), - this, SLOT( slotChildStarted( KIO::Job *) ) ); - connect( part, SIGNAL( completed() ), - this, SLOT( slotChildCompleted() ) ); - connect( part, SIGNAL( completed(bool) ), - this, SLOT( slotChildCompleted(bool) ) ); - connect( part, SIGNAL( setStatusBarText( const QString & ) ), - this, SIGNAL( setStatusBarText( const QString & ) ) ); + connect( part, TQT_SIGNAL( started( KIO::Job *) ), + this, TQT_SLOT( slotChildStarted( KIO::Job *) ) ); + connect( part, TQT_SIGNAL( completed() ), + this, TQT_SLOT( slotChildCompleted() ) ); + connect( part, TQT_SIGNAL( completed(bool) ), + this, TQT_SLOT( slotChildCompleted(bool) ) ); + connect( part, TQT_SIGNAL( setStatusBarText( const TQString & ) ), + this, TQT_SIGNAL( setStatusBarText( const TQString & ) ) ); if ( part->inherits( "KHTMLPart" ) ) { - connect( this, SIGNAL( completed() ), - part, SLOT( slotParentCompleted() ) ); - connect( this, SIGNAL( completed(bool) ), - part, SLOT( slotParentCompleted() ) ); + connect( this, TQT_SIGNAL( completed() ), + part, TQT_SLOT( slotParentCompleted() ) ); + connect( this, TQT_SIGNAL( completed(bool) ), + part, TQT_SLOT( slotParentCompleted() ) ); // As soon as the child's document is created, we need to set its domain // (but we do so only once, so it can't be simply done in the child) - connect( part, SIGNAL( docCreated() ), - this, SLOT( slotChildDocCreated() ) ); + connect( part, TQT_SIGNAL( docCreated() ), + this, TQT_SLOT( slotChildDocCreated() ) ); } child->m_extension = KParts::BrowserExtension::childObject( part ); if ( child->m_extension ) { - connect( child->m_extension, SIGNAL( openURLNotify() ), - d->m_extension, SIGNAL( openURLNotify() ) ); - - connect( child->m_extension, SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), - this, SLOT( slotChildURLRequest( const KURL &, const KParts::URLArgs & ) ) ); - - connect( child->m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ), - d->m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ) ); - connect( child->m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs &, const KParts::WindowArgs &, KParts::ReadOnlyPart *& ) ), - d->m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & , const KParts::WindowArgs &, KParts::ReadOnlyPart *&) ) ); - - connect( child->m_extension, SIGNAL( popupMenu( const QPoint &, const KFileItemList & ) ), - d->m_extension, SIGNAL( popupMenu( const QPoint &, const KFileItemList & ) ) ); - connect( child->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList & ) ), - d->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList & ) ) ); - connect( child->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags ) ), - d->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags ) ) ); - connect( child->m_extension, SIGNAL( popupMenu( const QPoint &, const KURL &, const QString &, mode_t ) ), - d->m_extension, SIGNAL( popupMenu( const QPoint &, const KURL &, const QString &, mode_t ) ) ); - connect( child->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ), - d->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ) ); - connect( child->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t ) ), - d->m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t ) ) ); - - connect( child->m_extension, SIGNAL( infoMessage( const QString & ) ), - d->m_extension, SIGNAL( infoMessage( const QString & ) ) ); - - connect( child->m_extension, SIGNAL( requestFocus( KParts::ReadOnlyPart * ) ), - this, SLOT( slotRequestFocus( KParts::ReadOnlyPart * ) ) ); + connect( child->m_extension, TQT_SIGNAL( openURLNotify() ), + d->m_extension, TQT_SIGNAL( openURLNotify() ) ); + + connect( child->m_extension, TQT_SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), + this, TQT_SLOT( slotChildURLRequest( const KURL &, const KParts::URLArgs & ) ) ); + + connect( child->m_extension, TQT_SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ), + d->m_extension, TQT_SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ) ); + connect( child->m_extension, TQT_SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs &, const KParts::WindowArgs &, KParts::ReadOnlyPart *& ) ), + d->m_extension, TQT_SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & , const KParts::WindowArgs &, KParts::ReadOnlyPart *&) ) ); + + connect( child->m_extension, TQT_SIGNAL( popupMenu( const TQPoint &, const KFileItemList & ) ), + d->m_extension, TQT_SIGNAL( popupMenu( const TQPoint &, const KFileItemList & ) ) ); + connect( child->m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KFileItemList & ) ), + d->m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KFileItemList & ) ) ); + connect( child->m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KFileItemList &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags ) ), + d->m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KFileItemList &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags ) ) ); + connect( child->m_extension, TQT_SIGNAL( popupMenu( const TQPoint &, const KURL &, const TQString &, mode_t ) ), + d->m_extension, TQT_SIGNAL( popupMenu( const TQPoint &, const KURL &, const TQString &, mode_t ) ) ); + connect( child->m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const TQString &, mode_t ) ), + d->m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const TQString &, mode_t ) ) ); + connect( child->m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t ) ), + d->m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t ) ) ); + + connect( child->m_extension, TQT_SIGNAL( infoMessage( const TQString & ) ), + d->m_extension, TQT_SIGNAL( infoMessage( const TQString & ) ) ); + + connect( child->m_extension, TQT_SIGNAL( requestFocus( KParts::ReadOnlyPart * ) ), + this, TQT_SLOT( slotRequestFocus( KParts::ReadOnlyPart * ) ) ); child->m_extension->setBrowserInterface( d->m_extension->browserInterface() ); } @@ -4643,23 +4643,23 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url } } -KParts::ReadOnlyPart *KHTMLPart::createPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, const QString &mimetype, - QString &serviceName, QStringList &serviceTypes, - const QStringList ¶ms ) +KParts::ReadOnlyPart *KHTMLPart::createPart( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, const TQString &mimetype, + TQString &serviceName, TQStringList &serviceTypes, + const TQStringList ¶ms ) { - QString constr; + TQString constr; if ( !serviceName.isEmpty() ) - constr.append( QString::fromLatin1( "Name == '%1'" ).arg( serviceName ) ); + constr.append( TQString::fromLatin1( "Name == '%1'" ).arg( serviceName ) ); - KTrader::OfferList offers = KTrader::self()->query( mimetype, "KParts/ReadOnlyPart", constr, QString::null ); + KTrader::OfferList offers = KTrader::self()->query( mimetype, "KParts/ReadOnlyPart", constr, TQString::null ); if ( offers.isEmpty() ) { int pos = mimetype.find( "-plugin" ); if (pos < 0) return 0L; - QString stripped_mime = mimetype.left( pos ); - offers = KTrader::self()->query( stripped_mime, "KParts/ReadOnlyPart", constr, QString::null ); + TQString stripped_mime = mimetype.left( pos ); + offers = KTrader::self()->query( stripped_mime, "KParts/ReadOnlyPart", constr, TQString::null ); if ( offers.isEmpty() ) return 0L; } @@ -4670,7 +4670,7 @@ KParts::ReadOnlyPart *KHTMLPart::createPart( QWidget *parentWidget, const char * { KService::Ptr service = (*it); - KLibFactory* const factory = KLibLoader::self()->factory( QFile::encodeName(service->library()) ); + KLibFactory* const factory = KLibLoader::self()->factory( TQFile::encodeName(service->library()) ); if ( factory ) { KParts::ReadOnlyPart *res = 0L; @@ -4690,7 +4690,7 @@ KParts::ReadOnlyPart *KHTMLPart::createPart( QWidget *parentWidget, const char * } } else { // TODO KMessageBox::error and i18n, like in KonqFactory::createView? - kdWarning() << QString("There was an error loading the module %1.\nThe diagnostics is:\n%2") + kdWarning() << TQString("There was an error loading the module %1.\nThe diagnostics is:\n%2") .arg(service->name()).arg(KLibLoader::self()->lastErrorMessage()) << endl; } } @@ -4703,10 +4703,10 @@ KParts::PartManager *KHTMLPart::partManager() { d->m_manager = new KParts::PartManager( d->m_view->topLevelWidget(), this, "khtml part manager" ); d->m_manager->setAllowNestedParts( true ); - connect( d->m_manager, SIGNAL( activePartChanged( KParts::Part * ) ), - this, SLOT( slotActiveFrameChanged( KParts::Part * ) ) ); - connect( d->m_manager, SIGNAL( partRemoved( KParts::Part * ) ), - this, SLOT( slotPartRemoved( KParts::Part * ) ) ); + connect( d->m_manager, TQT_SIGNAL( activePartChanged( KParts::Part * ) ), + this, TQT_SLOT( slotActiveFrameChanged( KParts::Part * ) ) ); + connect( d->m_manager, TQT_SIGNAL( partRemoved( KParts::Part * ) ), + this, TQT_SLOT( slotPartRemoved( KParts::Part * ) ) ); } return d->m_manager; @@ -4714,7 +4714,7 @@ KParts::PartManager *KHTMLPart::partManager() void KHTMLPart::submitFormAgain() { - disconnect(this, SIGNAL(completed()), this, SLOT(submitFormAgain())); + disconnect(this, TQT_SIGNAL(completed()), this, TQT_SLOT(submitFormAgain())); if( d->m_doc && !d->m_doc->parsing() && d->m_submitForm) KHTMLPart::submitForm( d->m_submitForm->submitAction, d->m_submitForm->submitUrl, d->m_submitForm->submitFormData, d->m_submitForm->target, d->m_submitForm->submitContentType, d->m_submitForm->submitBoundary ); @@ -4722,12 +4722,12 @@ void KHTMLPart::submitFormAgain() d->m_submitForm = 0; } -void KHTMLPart::submitFormProxy( const char *action, const QString &url, const QByteArray &formData, const QString &_target, const QString& contentType, const QString& boundary ) +void KHTMLPart::submitFormProxy( const char *action, const TQString &url, const TQByteArray &formData, const TQString &_target, const TQString& contentType, const TQString& boundary ) { submitForm(action, url, formData, _target, contentType, boundary); } -void KHTMLPart::submitForm( const char *action, const QString &url, const QByteArray &formData, const QString &_target, const QString& contentType, const QString& boundary ) +void KHTMLPart::submitForm( const char *action, const TQString &url, const TQByteArray &formData, const TQString &_target, const TQString& contentType, const TQString& boundary ) { kdDebug(6000) << this << ": KHTMLPart::submitForm target=" << _target << " url=" << url << endl; if (d->m_formNotification == KHTMLPart::Only) { @@ -4777,7 +4777,7 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA "WarnOnUnencryptedForm"); // Move this setting into KSSL instead KConfig *config = kapp->config(); - QString grpNotifMsgs = QString::fromLatin1("Notification Messages"); + TQString grpNotifMsgs = TQString::fromLatin1("Notification Messages"); KConfigGroupSaver saver( config, grpNotifMsgs ); if (!config->readBoolEntry("WarnOnUnencryptedForm", true)) { @@ -4809,9 +4809,9 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA // End form security checks // - QString urlstring = u.url(); + TQString urlstring = u.url(); - if ( urlstring.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 ) { + if ( urlstring.find( TQString::fromLatin1( "javascript:" ), 0, false ) == 0 ) { urlstring = KURL::decode_string(urlstring); crossFrameExecuteScript( _target, urlstring.right( urlstring.length() - 11) ); return; @@ -4842,18 +4842,18 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA // Handle mailto: forms if (u.protocol() == "mailto") { // 1) Check for attach= and strip it - QString q = u.query().mid(1); - QStringList nvps = QStringList::split("&", q); + TQString q = u.query().mid(1); + TQStringList nvps = TQStringList::split("&", q); bool triedToAttach = false; - QStringList::Iterator nvp = nvps.begin(); - const QStringList::Iterator nvpEnd = nvps.end(); + TQStringList::Iterator nvp = nvps.begin(); + const TQStringList::Iterator nvpEnd = nvps.end(); // cannot be a for loop as if something is removed we don't want to do ++nvp, as // remove returns an iterator pointing to the next item while (nvp != nvpEnd) { - const QStringList pair = QStringList::split("=", *nvp); + const TQStringList pair = TQStringList::split("=", *nvp); if (pair.count() >= 2) { if (pair.first().lower() == "attach") { nvp = nvps.remove(nvp); @@ -4870,32 +4870,32 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA KMessageBox::information(NULL, i18n("This site attempted to attach a file from your computer in the form submission. The attachment was removed for your protection."), i18n("KDE"), "WarnTriedAttach"); // 2) Append body= - QString bodyEnc; + TQString bodyEnc; if (contentType.lower() == "multipart/form-data") { // FIXME: is this correct? I suspect not - bodyEnc = KURL::encode_string(QString::fromLatin1(formData.data(), + bodyEnc = KURL::encode_string(TQString::fromLatin1(formData.data(), formData.size())); } else if (contentType.lower() == "text/plain") { // Convention seems to be to decode, and s/&/\n/ - QString tmpbody = QString::fromLatin1(formData.data(), + TQString tmpbody = TQString::fromLatin1(formData.data(), formData.size()); - tmpbody.replace(QRegExp("[&]"), "\n"); - tmpbody.replace(QRegExp("[+]"), " "); + tmpbody.replace(TQRegExp("[&]"), "\n"); + tmpbody.replace(TQRegExp("[+]"), " "); tmpbody = KURL::decode_string(tmpbody); // Decode the rest of it bodyEnc = KURL::encode_string(tmpbody); // Recode for the URL } else { - bodyEnc = KURL::encode_string(QString::fromLatin1(formData.data(), + bodyEnc = KURL::encode_string(TQString::fromLatin1(formData.data(), formData.size())); } - nvps.append(QString("body=%1").arg(bodyEnc)); + nvps.append(TQString("body=%1").arg(bodyEnc)); q = nvps.join("&"); u.setQuery(q); } if ( strcmp( action, "get" ) == 0 ) { if (u.protocol() != "mailto") - u.setQuery( QString::fromLatin1( formData.data(), formData.size() ) ); + u.setQuery( TQString::fromLatin1( formData.data(), formData.size() ) ); args.setDoPost( false ); } else { @@ -4921,7 +4921,7 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA d->m_submitForm->target = _target; d->m_submitForm->submitContentType = contentType; d->m_submitForm->submitBoundary = boundary; - connect(this, SIGNAL(completed()), this, SLOT(submitFormAgain())); + connect(this, TQT_SIGNAL(completed()), this, TQT_SLOT(submitFormAgain())); } else { @@ -4929,12 +4929,12 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA } } -void KHTMLPart::popupMenu( const QString &linkUrl ) +void KHTMLPart::popupMenu( const TQString &linkUrl ) { KURL popupURL; KURL linkKURL; KParts::URLArgs args; - QString referrer; + TQString referrer; KParts::BrowserExtension::PopupFlags itemflags=KParts::BrowserExtension::ShowBookmark | KParts::BrowserExtension::ShowReload; if ( linkUrl.isEmpty() ) { // click on background @@ -4973,9 +4973,9 @@ void KHTMLPart::popupMenu( const QString &linkUrl ) // Danger, Will Robinson. The Popup might stay around for a much // longer time than KHTMLPart. Deal with it. KHTMLPopupGUIClient* client = new KHTMLPopupGUIClient( this, d->m_popupMenuXML, linkKURL ); - QGuardedPtr<QObject> guard( client ); + TQGuardedPtr<TQObject> guard( client ); - QString mimetype = QString::fromLatin1( "text/html" ); + TQString mimetype = TQString::fromLatin1( "text/html" ); args.metaData()["referrer"] = referrer; if (!linkUrl.isEmpty()) // over a link @@ -4986,7 +4986,7 @@ void KHTMLPart::popupMenu( const QString &linkUrl ) } else // look at "extension" of link { - const QString fname(popupURL.fileName(false)); + const TQString fname(popupURL.fileName(false)); if (!fname.isEmpty() && !popupURL.hasRef() && popupURL.query().isEmpty()) { KMimeType::Ptr pmt = KMimeType::findByPath(fname,0,true); @@ -5009,12 +5009,12 @@ void KHTMLPart::popupMenu( const QString &linkUrl ) args.serviceType = mimetype; - emit d->m_extension->popupMenu( client, QCursor::pos(), popupURL, args, itemflags, S_IFREG /*always a file*/); + emit d->m_extension->popupMenu( client, TQCursor::pos(), popupURL, args, itemflags, S_IFREG /*always a file*/); if ( !guard.isNull() ) { delete client; - emit popupMenu(linkUrl, QCursor::pos()); - d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null; + emit popupMenu(linkUrl, TQCursor::pos()); + d->m_strSelectedURL = d->m_strSelectedURLTarget = TQString::null; } } @@ -5085,7 +5085,7 @@ void KHTMLPart::slotChildDocCreated() } } // So it only happens once - disconnect( htmlFrame, SIGNAL( docCreated() ), this, SLOT( slotChildDocCreated() ) ); + disconnect( htmlFrame, TQT_SIGNAL( docCreated() ), this, TQT_SLOT( slotChildDocCreated() ) ); } void KHTMLPart::slotChildURLRequest( const KURL &url, const KParts::URLArgs &args ) @@ -5094,34 +5094,34 @@ void KHTMLPart::slotChildURLRequest( const KURL &url, const KParts::URLArgs &arg KHTMLPart *callingHtmlPart = const_cast<KHTMLPart *>(dynamic_cast<const KHTMLPart *>(sender()->parent())); // TODO: handle child target correctly! currently the script are always executed fur the parent - QString urlStr = url.url(); - if ( urlStr.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 ) { - QString script = KURL::decode_string( urlStr.right( urlStr.length() - 11 ) ); + TQString urlStr = url.url(); + if ( urlStr.find( TQString::fromLatin1( "javascript:" ), 0, false ) == 0 ) { + TQString script = KURL::decode_string( urlStr.right( urlStr.length() - 11 ) ); executeScript( DOM::Node(), script ); return; } - QString frameName = args.frameName.lower(); + TQString frameName = args.frameName.lower(); if ( !frameName.isEmpty() ) { - if ( frameName == QString::fromLatin1( "_top" ) ) + if ( frameName == TQString::fromLatin1( "_top" ) ) { emit d->m_extension->openURLRequest( url, args ); return; } - else if ( frameName == QString::fromLatin1( "_blank" ) ) + else if ( frameName == TQString::fromLatin1( "_blank" ) ) { emit d->m_extension->createNewWindow( url, args ); return; } - else if ( frameName == QString::fromLatin1( "_parent" ) ) + else if ( frameName == TQString::fromLatin1( "_parent" ) ) { KParts::URLArgs newArgs( args ); - newArgs.frameName = QString::null; + newArgs.frameName = TQString::null; emit d->m_extension->openURLRequest( url, newArgs ); return; } - else if ( frameName != QString::fromLatin1( "_self" ) ) + else if ( frameName != TQString::fromLatin1( "_self" ) ) { khtml::ChildFrame *_frame = recursiveFrameRequest( callingHtmlPart, url, args ); @@ -5142,7 +5142,7 @@ void KHTMLPart::slotChildURLRequest( const KURL &url, const KParts::URLArgs &arg } else if ( frameName== "_self" ) // this is for embedded objects (via <object>) which want to replace the current document { KParts::URLArgs newArgs( args ); - newArgs.frameName = QString::null; + newArgs.frameName = TQString::null; emit d->m_extension->openURLRequest( url, newArgs ); } } @@ -5152,7 +5152,7 @@ void KHTMLPart::slotRequestFocus( KParts::ReadOnlyPart * ) emit d->m_extension->requestFocus(this); } -khtml::ChildFrame *KHTMLPart::frame( const QObject *obj ) +khtml::ChildFrame *KHTMLPart::frame( const TQObject *obj ) { assert( obj->inherits( "KParts::ReadOnlyPart" ) ); const KParts::ReadOnlyPart* const part = static_cast<const KParts::ReadOnlyPart *>( obj ); @@ -5209,7 +5209,7 @@ bool KHTMLPart::checkFrameAccess(KHTMLPart *callingHtmlPart) } KHTMLPart * -KHTMLPart::findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame ) +KHTMLPart::findFrameParent( KParts::ReadOnlyPart *callingPart, const TQString &f, khtml::ChildFrame **childFrame ) { #ifdef DEBUG_FINDFRAME kdDebug(6050) << "KHTMLPart::findFrameParent: this = " << this << " URL = " << m_url << " name = " << name() << " findFrameParent( " << f << " )" << endl; @@ -5221,7 +5221,7 @@ KHTMLPart::findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, return 0; // match encoding used in KonqView::setViewName() - if (!childFrame && !parentPart() && (QString::fromLocal8Bit(name()) == f)) + if (!childFrame && !parentPart() && (TQString::fromLocal8Bit(name()) == f)) return this; FrameIt it = d->m_frames.find( f ); @@ -5251,7 +5251,7 @@ KHTMLPart::findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, } -KHTMLPart *KHTMLPart::findFrame( const QString &f ) +KHTMLPart *KHTMLPart::findFrame( const TQString &f ) { khtml::ChildFrame *childFrame; KHTMLPart *parentFrame = findFrameParent(this, f, &childFrame); @@ -5264,7 +5264,7 @@ KHTMLPart *KHTMLPart::findFrame( const QString &f ) return 0; } -KParts::ReadOnlyPart *KHTMLPart::findFramePart(const QString &f) +KParts::ReadOnlyPart *KHTMLPart::findFramePart(const TQString &f) { khtml::ChildFrame *childFrame; return findFrameParent(this, f, &childFrame) ? static_cast<KParts::ReadOnlyPart *>(childFrame->m_part) : 0L; @@ -5285,7 +5285,7 @@ KParts::ReadOnlyPart *KHTMLPart::currentFrame() const return part; } -bool KHTMLPart::frameExists( const QString &frameName ) +bool KHTMLPart::frameExists( const TQString &frameName ) { ConstFrameIt it = d->m_frames.find( frameName ); if ( it == d->m_frames.end() ) @@ -5352,10 +5352,10 @@ khtml::ChildFrame *KHTMLPart::recursiveFrameRequest( KHTMLPart *callingHtmlPart, static int s_saveStateIndentLevel = 0; #endif -void KHTMLPart::saveState( QDataStream &stream ) +void KHTMLPart::saveState( TQDataStream &stream ) { #ifndef NDEBUG - QString indent = QString().leftJustify( s_saveStateIndentLevel * 4, ' ' ); + TQString indent = TQString().leftJustify( s_saveStateIndentLevel * 4, ' ' ); const int indentLevel = s_saveStateIndentLevel++; kdDebug( 6050 ) << indent << "saveState this=" << this << " '" << name() << "' saving URL " << m_url.url() << endl; #endif @@ -5377,7 +5377,7 @@ void KHTMLPart::saveState( QDataStream &stream ) stream << d->m_cacheId; // Save the state of the document (Most notably the state of any forms) - QStringList docState; + TQStringList docState; if (d->m_doc) { docState = d->m_doc->docState(); @@ -5405,9 +5405,9 @@ void KHTMLPart::saveState( QDataStream &stream ) << d->m_ssl_parent_cert; - QStringList frameNameLst, frameServiceTypeLst, frameServiceNameLst; + TQStringList frameNameLst, frameServiceTypeLst, frameServiceNameLst; KURL::List frameURLLst; - QValueList<QByteArray> frameStateBufferLst; + TQValueList<TQByteArray> frameStateBufferLst; ConstFrameIt it = d->m_frames.begin(); const ConstFrameIt end = d->m_frames.end(); @@ -5421,8 +5421,8 @@ void KHTMLPart::saveState( QDataStream &stream ) frameServiceNameLst << (*it)->m_serviceName; frameURLLst << (*it)->m_part->url(); - QByteArray state; - QDataStream frameStream( state, IO_WriteOnly ); + TQByteArray state; + TQDataStream frameStream( state, IO_WriteOnly ); if ( (*it)->m_extension ) (*it)->m_extension->saveState( frameStream ); @@ -5438,16 +5438,16 @@ void KHTMLPart::saveState( QDataStream &stream ) #endif } -void KHTMLPart::restoreState( QDataStream &stream ) +void KHTMLPart::restoreState( TQDataStream &stream ) { KURL u; Q_INT32 xOffset, yOffset, wContents, hContents, mWidth, mHeight; Q_UINT32 frameCount; - QStringList frameNames, frameServiceTypes, docState, frameServiceNames; + TQStringList frameNames, frameServiceTypes, docState, frameServiceNames; KURL::List frameURLs; - QValueList<QByteArray> frameStateBuffers; - QValueList<int> fSizes; - QString encoding, sheetUsed; + TQValueList<TQByteArray> frameStateBuffers; + TQValueList<int> fSizes; + TQString encoding, sheetUsed; long old_cacheId = d->m_cacheId; stream >> u >> xOffset >> yOffset >> wContents >> hContents >> mWidth >> mHeight; @@ -5514,11 +5514,11 @@ void KHTMLPart::restoreState( QDataStream &stream ) fIt = d->m_frames.begin(); - QStringList::ConstIterator fNameIt = frameNames.begin(); - QStringList::ConstIterator fServiceTypeIt = frameServiceTypes.begin(); - QStringList::ConstIterator fServiceNameIt = frameServiceNames.begin(); + TQStringList::ConstIterator fNameIt = frameNames.begin(); + TQStringList::ConstIterator fServiceTypeIt = frameServiceTypes.begin(); + TQStringList::ConstIterator fServiceNameIt = frameServiceNames.begin(); KURL::List::ConstIterator fURLIt = frameURLs.begin(); - QValueList<QByteArray>::ConstIterator fBufferIt = frameStateBuffers.begin(); + TQValueList<TQByteArray>::ConstIterator fBufferIt = frameStateBuffers.begin(); for (; fIt != fEnd; ++fIt, ++fNameIt, ++fServiceTypeIt, ++fServiceNameIt, ++fURLIt, ++fBufferIt ) { @@ -5538,7 +5538,7 @@ void KHTMLPart::restoreState( QDataStream &stream ) child->m_bCompleted = false; if ( child->m_extension && !(*fBufferIt).isEmpty() ) { - QDataStream frameStream( *fBufferIt, IO_ReadOnly ); + TQDataStream frameStream( *fBufferIt, IO_ReadOnly ); child->m_extension->restoreState( frameStream ); } else @@ -5568,13 +5568,13 @@ void KHTMLPart::restoreState( QDataStream &stream ) d->m_encoding = encoding; d->m_sheetUsed = sheetUsed; - QStringList::ConstIterator fNameIt = frameNames.begin(); - const QStringList::ConstIterator fNameEnd = frameNames.end(); + TQStringList::ConstIterator fNameIt = frameNames.begin(); + const TQStringList::ConstIterator fNameEnd = frameNames.end(); - QStringList::ConstIterator fServiceTypeIt = frameServiceTypes.begin(); - QStringList::ConstIterator fServiceNameIt = frameServiceNames.begin(); + TQStringList::ConstIterator fServiceTypeIt = frameServiceTypes.begin(); + TQStringList::ConstIterator fServiceNameIt = frameServiceNames.begin(); KURL::List::ConstIterator fURLIt = frameURLs.begin(); - QValueList<QByteArray>::ConstIterator fBufferIt = frameStateBuffers.begin(); + TQValueList<TQByteArray>::ConstIterator fBufferIt = frameStateBuffers.begin(); for (; fNameIt != fNameEnd; ++fNameIt, ++fServiceTypeIt, ++fServiceNameIt, ++fURLIt, ++fBufferIt ) { @@ -5596,7 +5596,7 @@ void KHTMLPart::restoreState( QDataStream &stream ) if ( (*childFrame)->m_extension ) if ( (*childFrame)->m_extension && !(*fBufferIt).isEmpty() ) { - QDataStream frameStream( *fBufferIt, IO_ReadOnly ); + TQDataStream frameStream( *fBufferIt, IO_ReadOnly ); (*childFrame)->m_extension->restoreState( frameStream ); } else @@ -5728,11 +5728,11 @@ void KHTMLPart::setZoomFactor (int percent) d->m_zoomFactor = percent; if(d->m_doc) { - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); if (d->m_doc->styleSelector()) d->m_doc->styleSelector()->computeFontSizes(d->m_doc->paintDeviceMetrics(), d->m_zoomFactor); d->m_doc->recalcStyle( NodeImpl::Force ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } ConstFrameIt it = d->m_frames.begin(); @@ -5757,7 +5757,7 @@ void KHTMLPart::slotZoomView( int delta ) slotDecZoom(); } -void KHTMLPart::setStatusBarText( const QString& text, StatusBarPriority p) +void KHTMLPart::setStatusBarText( const TQString& text, StatusBarPriority p) { if (!d->m_statusMessagesEnabled) return; @@ -5765,7 +5765,7 @@ void KHTMLPart::setStatusBarText( const QString& text, StatusBarPriority p) d->m_statusBarText[p] = text; // shift handling ? - QString tobe = d->m_statusBarText[BarHoverText]; + TQString tobe = d->m_statusBarText[BarHoverText]; if (tobe.isEmpty()) tobe = d->m_statusBarText[BarOverrideText]; if (tobe.isEmpty()) { @@ -5781,59 +5781,59 @@ void KHTMLPart::setStatusBarText( const QString& text, StatusBarPriority p) } -void KHTMLPart::setJSStatusBarText( const QString &text ) +void KHTMLPart::setJSStatusBarText( const TQString &text ) { setStatusBarText(text, BarOverrideText); } -void KHTMLPart::setJSDefaultStatusBarText( const QString &text ) +void KHTMLPart::setJSDefaultStatusBarText( const TQString &text ) { setStatusBarText(text, BarDefaultText); } -QString KHTMLPart::jsStatusBarText() const +TQString KHTMLPart::jsStatusBarText() const { return d->m_statusBarText[BarOverrideText]; } -QString KHTMLPart::jsDefaultStatusBarText() const +TQString KHTMLPart::jsDefaultStatusBarText() const { return d->m_statusBarText[BarDefaultText]; } -QString KHTMLPart::referrer() const +TQString KHTMLPart::referrer() const { return d->m_referrer; } -QString KHTMLPart::pageReferrer() const +TQString KHTMLPart::pageReferrer() const { KURL referrerURL = KURL( d->m_pageReferrer ); if (referrerURL.isValid()) { - QString protocol = referrerURL.protocol(); + TQString protocol = referrerURL.protocol(); if ((protocol == "http") || ((protocol == "https") && (m_url.protocol() == "https"))) { - referrerURL.setRef(QString::null); - referrerURL.setUser(QString::null); - referrerURL.setPass(QString::null); + referrerURL.setRef(TQString::null); + referrerURL.setUser(TQString::null); + referrerURL.setPass(TQString::null); return referrerURL.url(); } } - return QString::null; + return TQString::null; } -QString KHTMLPart::lastModified() const +TQString KHTMLPart::lastModified() const { if ( d->m_lastModified.isEmpty() && m_url.isLocalFile() ) { // Local file: set last-modified from the file's mtime. // Done on demand to save time when this isn't needed - but can lead // to slightly wrong results if updating the file on disk w/o reloading. - QDateTime lastModif = QFileInfo( m_url.path() ).lastModified(); + TQDateTime lastModif = TQFileInfo( m_url.path() ).lastModified(); d->m_lastModified = lastModif.toString( Qt::LocalDate ); } //kdDebug(6050) << "KHTMLPart::lastModified: " << d->m_lastModified << endl; @@ -5874,18 +5874,18 @@ void KHTMLPart::reparseConfiguration() delete d->m_settings; d->m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings()); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); khtml::CSSStyleSelector::reparseConfiguration(); if(d->m_doc) d->m_doc->updateStyleSelector(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if (KHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled()) runAdFilter(); } -QStringList KHTMLPart::frameNames() const +TQStringList KHTMLPart::frameNames() const { - QStringList res; + TQStringList res; ConstFrameIt it = d->m_frames.begin(); const ConstFrameIt end = d->m_frames.end(); @@ -5896,9 +5896,9 @@ QStringList KHTMLPart::frameNames() const return res; } -QPtrList<KParts::ReadOnlyPart> KHTMLPart::frames() const +TQPtrList<KParts::ReadOnlyPart> KHTMLPart::frames() const { - QPtrList<KParts::ReadOnlyPart> res; + TQPtrList<KParts::ReadOnlyPart> res; ConstFrameIt it = d->m_frames.begin(); const ConstFrameIt end = d->m_frames.end(); @@ -5936,7 +5936,7 @@ bool KHTMLPart::dndEnabled() const return d->m_bDnd; } -void KHTMLPart::customEvent( QCustomEvent *event ) +void KHTMLPart::customEvent( TQCustomEvent *event ) { if ( khtml::MousePressEvent::test( event ) ) { @@ -6044,7 +6044,7 @@ static bool lastRunAt(khtml::RenderObject *renderNode, int y, NodeImpl *&endNode void KHTMLPart::khtmlMousePressEvent( khtml::MousePressEvent *event ) { DOM::DOMString url = event->url(); - QMouseEvent *_mouse = event->qmouseEvent(); + TQMouseEvent *_mouse = event->qmouseEvent(); DOM::Node innerNode = event->innerNode(); d->m_mousePressNode = innerNode; @@ -6055,7 +6055,7 @@ void KHTMLPart::khtmlMousePressEvent( khtml::MousePressEvent *event ) d->m_strSelectedURLTarget = event->target().string(); } else - d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null; + d->m_strSelectedURL = d->m_strSelectedURLTarget = TQString::null; if ( _mouse->button() == LeftButton || _mouse->button() == MidButton ) @@ -6123,7 +6123,7 @@ void KHTMLPart::khtmlMousePressEvent( khtml::MousePressEvent *event ) void KHTMLPart::khtmlMouseDoubleClickEvent( khtml::MouseDoubleClickEvent *event ) { - QMouseEvent *_mouse = event->qmouseEvent(); + TQMouseEvent *_mouse = event->qmouseEvent(); if ( _mouse->button() == LeftButton ) { d->m_bMousePressed = true; @@ -6226,14 +6226,14 @@ void KHTMLPart::extendSelection( DOM::NodeImpl* node, long offset, DOM::Node& se return; } - QString str; + TQString str; int len = 0; if ( obj->isText() ) { // can be false e.g. when double-clicking on a disabled submit button str = static_cast<khtml::RenderText *>(obj)->data().string(); len = str.length(); } //kdDebug() << "extendSelection right=" << right << " offset=" << offset << " len=" << len << " Starting at obj=" << obj << endl; - QChar ch; + TQChar ch; do { // Last char was ok, point to it if ( node ) { @@ -6248,7 +6248,7 @@ void KHTMLPart::extendSelection( DOM::NodeImpl* node, long offset, DOM::Node& se //kdDebug() << "obj=" << obj << endl; if ( obj ) { //kdDebug() << "isText=" << obj->isText() << endl; - str = QString::null; + str = TQString::null; if ( obj->isText() ) str = static_cast<khtml::RenderText *>(obj)->data().string(); else if ( obj->isBR() ) @@ -6282,7 +6282,7 @@ void KHTMLPart::extendSelection( DOM::NodeImpl* node, long offset, DOM::Node& se // Test that char ch = str[ (int)offset ]; - //kdDebug() << " offset=" << offset << " ch=" << QString(ch) << endl; + //kdDebug() << " offset=" << offset << " ch=" << TQString(ch) << endl; } while ( !ch.isSpace() && !ch.isPunct() ); // make offset point after last char @@ -6373,12 +6373,12 @@ bool KHTMLPart::isExtendingSelection() const void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event ) { - QMouseEvent *_mouse = event->qmouseEvent(); + TQMouseEvent *_mouse = event->qmouseEvent(); if( d->m_bRightMousePressed && parentPart() != 0 && d->m_bBackRightClick ) { popupMenu( d->m_strSelectedURL ); - d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null; + d->m_strSelectedURL = d->m_strSelectedURLTarget = TQString::null; d->m_bRightMousePressed = false; } @@ -6393,9 +6393,9 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event ) if ( ( d->m_dragStartPos - _mouse->pos() ).manhattanLength() <= KGlobalSettings::dndEventDelay() ) return; - QPixmap pix; + TQPixmap pix; HTMLImageElementImpl *img = 0L; - QDragObject *drag = 0; + TQDragObject *drag = 0; KURL u; // qDebug("****************** Event URL: %s", url.string().latin1()); @@ -6415,7 +6415,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event ) pix = KMimeType::pixmapForURL(u, 0, KIcon::Desktop, KIcon::SizeMedium); } - u.setPass(QString::null); + u.setPass(TQString::null); KURLDrag* urlDrag = new KURLDrag( u, img ? 0 : d->m_view->viewport() ); if ( !d->m_referrer.isEmpty() ) @@ -6423,7 +6423,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event ) if( img && img->complete()) { KMultipleDrag *mdrag = new KMultipleDrag( d->m_view->viewport() ); - mdrag->addDragObject( new QImageDrag( img->currentImage(), 0L ) ); + mdrag->addDragObject( new TQImageDrag( img->currentImage(), 0L ) ); mdrag->addDragObject( urlDrag ); drag = mdrag; } @@ -6439,7 +6439,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event ) // when we finish our drag, we need to undo our mouse press d->m_bMousePressed = false; - d->m_strSelectedURL = d->m_strSelectedURLTarget = QString::null; + d->m_strSelectedURL = d->m_strSelectedURLTarget = TQString::null; return; } #endif @@ -6467,7 +6467,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event ) int x(_mouse->x() - vx), y(_mouse->y() - vy); - d->m_overURL = url.string() + QString("?%1,%2").arg(x).arg(y); + d->m_overURL = url.string() + TQString("?%1,%2").arg(x).arg(y); d->m_overURLTarget = target.string(); overURL( d->m_overURL, target.string(), shiftPressed ); return; @@ -6498,7 +6498,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event ) event->absX(), event->absY(), innerNode); #else if ( d->m_doc && d->m_view ) { - QPoint diff( _mouse->globalPos() - d->m_dragLastPos ); + TQPoint diff( _mouse->globalPos() - d->m_dragLastPos ); if ( abs( diff.x() ) > 64 || abs( diff.y() ) > 64 ) { d->m_view->scrollBy( -diff.x(), -diff.y() ); @@ -6516,7 +6516,7 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event ) d->m_mousePressNode = DOM::Node(); if ( d->m_bMousePressed ) { - setStatusBarText(QString::null, BarHoverText); + setStatusBarText(TQString::null, BarHoverText); stopAutoScroll(); } @@ -6524,7 +6524,7 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event ) // the mouse is pressed again. d->m_bMousePressed = false; - QMouseEvent *_mouse = event->qmouseEvent(); + TQMouseEvent *_mouse = event->qmouseEvent(); if ( _mouse->button() == RightButton && parentPart() != 0 && d->m_bBackRightClick ) { d->m_bRightMousePressed = false; @@ -6608,11 +6608,11 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event ) #endif // get selected text and paste to the clipboard #ifndef QT_NO_CLIPBOARD - QString text = selectedText(); - text.replace(QChar(0xa0), ' '); - disconnect( kapp->clipboard(), SIGNAL( selectionChanged()), this, SLOT( slotClearSelection())); + TQString text = selectedText(); + text.replace(TQChar(0xa0), ' '); + disconnect( kapp->clipboard(), TQT_SIGNAL( selectionChanged()), this, TQT_SLOT( slotClearSelection())); kapp->clipboard()->setText(text,QClipboard::Selection); - connect( kapp->clipboard(), SIGNAL( selectionChanged()), SLOT( slotClearSelection())); + connect( kapp->clipboard(), TQT_SIGNAL( selectionChanged()), TQT_SLOT( slotClearSelection())); #endif //kdDebug( 6000 ) << "selectedText = " << text << endl; emitSelectionChanged(); @@ -6637,7 +6637,7 @@ void KHTMLPart::guiActivateEvent( KParts::GUIActivateEvent *event ) if ( !d->m_settings->autoLoadImages() && d->m_paLoadImages ) { - QPtrList<KAction> lst; + TQPtrList<KAction> lst; lst.append( d->m_paLoadImages ); plugActionList( "loadImages", lst ); } @@ -6658,7 +6658,7 @@ void KHTMLPart::slotPrintFrame() if ( !ext ) return; - QMetaObject *mo = ext->metaObject(); + TQMetaObject *mo = ext->metaObject(); int idx = mo->findSlot( "print()", true ); if ( idx >= 0 ) { @@ -6676,13 +6676,13 @@ void KHTMLPart::slotSelectAll() void KHTMLPart::startAutoScroll() { - connect(&d->m_scrollTimer, SIGNAL( timeout() ), this, SLOT( slotAutoScroll() )); + connect(&d->m_scrollTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoScroll() )); d->m_scrollTimer.start(100, false); } void KHTMLPart::stopAutoScroll() { - disconnect(&d->m_scrollTimer, SIGNAL( timeout() ), this, SLOT( slotAutoScroll() )); + disconnect(&d->m_scrollTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoScroll() )); if (d->m_scrollTimer.isActive()) d->m_scrollTimer.stop(); } @@ -6704,7 +6704,7 @@ void KHTMLPart::runAdFilter() if ( !d->m_doc ) return; - QPtrDictIterator<khtml::CachedObject> it( d->m_doc->docLoader()->m_docObjects ); + TQPtrDictIterator<khtml::CachedObject> it( d->m_doc->docLoader()->m_docObjects ); for ( ; it.current(); ++it ) if ( it.current()->type() == khtml::CachedObject::Image ) { khtml::CachedImage *image = static_cast<khtml::CachedImage *>(it.current()); @@ -6809,7 +6809,7 @@ void KHTMLPart::selectAll() emitSelectionChanged(); } -bool KHTMLPart::checkLinkSecurity(const KURL &linkURL,const QString &message, const QString &button) +bool KHTMLPart::checkLinkSecurity(const KURL &linkURL,const TQString &message, const TQString &button) { bool linkAllowed = true; @@ -6871,12 +6871,12 @@ void KHTMLPart::slotActiveFrameChanged( KParts::Part *part ) return; } // kdDebug(6050) << "KHTMLPart::slotActiveFrameChanged d->m_activeFrame=" << d->m_activeFrame << endl; - if ( d->m_activeFrame && d->m_activeFrame->widget() && d->m_activeFrame->widget()->inherits( "QFrame" ) ) + if ( d->m_activeFrame && d->m_activeFrame->widget() && d->m_activeFrame->widget()->inherits( "TQFrame" ) ) { - QFrame *frame = static_cast<QFrame *>( d->m_activeFrame->widget() ); - if (frame->frameStyle() != QFrame::NoFrame) + TQFrame *frame = static_cast<TQFrame *>( d->m_activeFrame->widget() ); + if (frame->frameStyle() != TQFrame::NoFrame) { - frame->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken); + frame->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken); frame->repaint(); } } @@ -6899,12 +6899,12 @@ void KHTMLPart::slotActiveFrameChanged( KParts::Part *part ) d->m_activeFrame = part; - if ( d->m_activeFrame && d->m_activeFrame->widget()->inherits( "QFrame" ) ) + if ( d->m_activeFrame && d->m_activeFrame->widget()->inherits( "TQFrame" ) ) { - QFrame *frame = static_cast<QFrame *>( d->m_activeFrame->widget() ); - if (frame->frameStyle() != QFrame::NoFrame) + TQFrame *frame = static_cast<TQFrame *>( d->m_activeFrame->widget() ); + if (frame->frameStyle() != TQFrame::NoFrame) { - frame->setFrameStyle( QFrame::StyledPanel | QFrame::Plain); + frame->setFrameStyle( TQFrame::StyledPanel | TQFrame::Plain); frame->repaint(); } kdDebug(6050) << "new active frame " << d->m_activeFrame << endl; @@ -6925,7 +6925,7 @@ void KHTMLPart::setActiveNode(const DOM::Node &node) d->m_doc->setFocusNode(node.handle()); // Scroll the view if necessary to ensure that the new focus node is visible - QRect rect = node.handle()->getRect(); + TQRect rect = node.handle()->getRect(); d->m_view->ensureVisible(rect.right(), rect.bottom()); d->m_view->ensureVisible(rect.left(), rect.top()); } @@ -6935,7 +6935,7 @@ DOM::Node KHTMLPart::activeNode() const return DOM::Node(d->m_doc?d->m_doc->focusNode():0); } -DOM::EventListener *KHTMLPart::createHTMLEventListener( QString code, QString name, NodeImpl* node ) +DOM::EventListener *KHTMLPart::createHTMLEventListener( TQString code, TQString name, NodeImpl* node ) { KJSProxy *proxy = jScript(); @@ -6965,19 +6965,19 @@ void KHTMLPart::setOpenedByJS(bool _openedByJS) d->m_openedByJS = _openedByJS; } -void KHTMLPart::preloadStyleSheet(const QString &url, const QString &stylesheet) +void KHTMLPart::preloadStyleSheet(const TQString &url, const TQString &stylesheet) { khtml::Cache::preloadStyleSheet(url, stylesheet); } -void KHTMLPart::preloadScript(const QString &url, const QString &script) +void KHTMLPart::preloadScript(const TQString &url, const TQString &script) { khtml::Cache::preloadScript(url, script); } -QCString KHTMLPart::dcopObjectId() const +TQCString KHTMLPart::dcopObjectId() const { - QCString id; + TQCString id; id.sprintf("html-widget%d", d->m_dcop_counter); return id; } @@ -6992,7 +6992,7 @@ bool KHTMLPart::restored() const return d->m_restored; } -bool KHTMLPart::pluginPageQuestionAsked(const QString& mimetype) const +bool KHTMLPart::pluginPageQuestionAsked(const TQString& mimetype) const { // parentPart() should be const! KHTMLPart* parent = const_cast<KHTMLPart *>(this)->parentPart(); @@ -7002,7 +7002,7 @@ bool KHTMLPart::pluginPageQuestionAsked(const QString& mimetype) const return d->m_pluginPageQuestionAsked.contains(mimetype); } -void KHTMLPart::setPluginPageQuestionAsked(const QString& mimetype) +void KHTMLPart::setPluginPageQuestionAsked(const TQString& mimetype) { if ( parentPart() ) parentPart()->setPluginPageQuestionAsked(mimetype); @@ -7072,7 +7072,7 @@ void KHTMLPart::slotAutomaticDetectionLanguage( int _id ) d->m_paSetEncoding->popupMenu()->setItemChecked( 0, true ); - setEncoding( QString::null, false ); + setEncoding( TQString::null, false ); if( d->m_manualDetection ) d->m_manualDetection->setCurrentItem( -1 ); @@ -7109,7 +7109,7 @@ void KHTMLPart::restoreScrollPosition() if ( m_url.hasRef() && !d->m_restoreScrollPosition && !args.reload) { if ( !d->m_doc || !d->m_doc->parsing() ) - disconnect(d->m_view, SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition())); + disconnect(d->m_view, TQT_SIGNAL(finishedLayout()), this, TQT_SLOT(restoreScrollPosition())); if ( !gotoAnchor(m_url.encodedHtmlRef()) ) gotoAnchor(m_url.htmlRef()); return; @@ -7122,7 +7122,7 @@ void KHTMLPart::restoreScrollPosition() if (d->m_view->contentsHeight() - d->m_view->visibleHeight() >= args.yOffset || d->m_bComplete) { d->m_view->setContentsPos(args.xOffset, args.yOffset); - disconnect(d->m_view, SIGNAL(finishedLayout()), this, SLOT(restoreScrollPosition())); + disconnect(d->m_view, TQT_SIGNAL(finishedLayout()), this, TQT_SLOT(restoreScrollPosition())); } } @@ -7160,8 +7160,8 @@ void KHTMLPart::openWallet(DOM::HTMLFormElementImpl *form) KWallet::Wallet *wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), widget() ? widget()->topLevelWidget()->winId() : 0, KWallet::Wallet::Asynchronous); d->m_wq = new KHTMLWalletQueue(this); d->m_wq->wallet = wallet; - connect(wallet, SIGNAL(walletOpened(bool)), d->m_wq, SLOT(walletOpened(bool))); - connect(d->m_wq, SIGNAL(walletOpened(KWallet::Wallet*)), this, SLOT(walletOpened(KWallet::Wallet*))); + connect(wallet, TQT_SIGNAL(walletOpened(bool)), d->m_wq, TQT_SLOT(walletOpened(bool))); + connect(d->m_wq, TQT_SIGNAL(walletOpened(KWallet::Wallet*)), this, TQT_SLOT(walletOpened(KWallet::Wallet*))); } assert(form); d->m_wq->callers.append(KHTMLWalletQueue::Caller(form, form->getDocument())); @@ -7169,7 +7169,7 @@ void KHTMLPart::openWallet(DOM::HTMLFormElementImpl *form) } -void KHTMLPart::saveToWallet(const QString& key, const QMap<QString,QString>& data) +void KHTMLPart::saveToWallet(const TQString& key, const TQMap<TQString,TQString>& data) { #ifndef KHTML_NO_WALLET KHTMLPart *p; @@ -7202,8 +7202,8 @@ void KHTMLPart::saveToWallet(const QString& key, const QMap<QString,QString>& da KWallet::Wallet *wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), widget() ? widget()->topLevelWidget()->winId() : 0, KWallet::Wallet::Asynchronous); d->m_wq = new KHTMLWalletQueue(this); d->m_wq->wallet = wallet; - connect(wallet, SIGNAL(walletOpened(bool)), d->m_wq, SLOT(walletOpened(bool))); - connect(d->m_wq, SIGNAL(walletOpened(KWallet::Wallet*)), this, SLOT(walletOpened(KWallet::Wallet*))); + connect(wallet, TQT_SIGNAL(walletOpened(bool)), d->m_wq, TQT_SLOT(walletOpened(bool))); + connect(d->m_wq, TQT_SIGNAL(walletOpened(KWallet::Wallet*)), this, TQT_SLOT(walletOpened(KWallet::Wallet*))); } d->m_wq->savers.append(qMakePair(key, data)); #endif // KHTML_NO_WALLET @@ -7244,21 +7244,21 @@ void KHTMLPart::walletOpened(KWallet::Wallet *wallet) { d->m_wallet = wallet; d->m_bWalletOpened = true; - connect(d->m_wallet, SIGNAL(walletClosed()), SLOT(slotWalletClosed())); + connect(d->m_wallet, TQT_SIGNAL(walletClosed()), TQT_SLOT(slotWalletClosed())); if (!d->m_statusBarWalletLabel) { d->m_statusBarWalletLabel = new KURLLabel(d->m_statusBarExtension->statusBar()); d->m_statusBarWalletLabel->setFixedHeight(instance()->iconLoader()->currentSize(KIcon::Small)); - d->m_statusBarWalletLabel->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + d->m_statusBarWalletLabel->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed)); d->m_statusBarWalletLabel->setUseCursor(false); d->m_statusBarExtension->addStatusBarItem(d->m_statusBarWalletLabel, 0, false); d->m_statusBarWalletLabel->setPixmap(SmallIcon("wallet_open", instance())); - connect(d->m_statusBarWalletLabel, SIGNAL(leftClickedURL()), SLOT(launchWalletManager())); - connect(d->m_statusBarWalletLabel, SIGNAL(rightClickedURL()), SLOT(walletMenu())); + connect(d->m_statusBarWalletLabel, TQT_SIGNAL(leftClickedURL()), TQT_SLOT(launchWalletManager())); + connect(d->m_statusBarWalletLabel, TQT_SIGNAL(rightClickedURL()), TQT_SLOT(walletMenu())); } else { - QToolTip::remove(d->m_statusBarWalletLabel); + TQToolTip::remove(d->m_statusBarWalletLabel); } - QToolTip::add(d->m_statusBarWalletLabel, i18n("The wallet '%1' is open and being used for form data and passwords.").arg(KWallet::Wallet::NetworkWallet())); + TQToolTip::add(d->m_statusBarWalletLabel, i18n("The wallet '%1' is open and being used for form data and passwords.").arg(KWallet::Wallet::NetworkWallet())); #endif // KHTML_NO_WALLET } @@ -7312,8 +7312,8 @@ void KHTMLPart::walletMenu() { #ifndef KHTML_NO_WALLET KPopupMenu *m = new KPopupMenu(0L); - m->insertItem(i18n("&Close Wallet"), this, SLOT(slotWalletClosed())); - m->popup(QCursor::pos()); + m->insertItem(i18n("&Close Wallet"), this, TQT_SLOT(slotWalletClosed())); + m->popup(TQCursor::pos()); #endif // KHTML_NO_WALLET } @@ -7355,10 +7355,10 @@ void KHTMLPart::setDebugScript( bool enable ) unplugActionList( "debugScriptList" ); if ( enable ) { if (!d->m_paDebugScript) { - d->m_paDebugScript = new KAction( i18n( "JavaScript &Debugger" ), 0, this, SLOT( slotDebugScript() ), actionCollection(), "debugScript" ); + d->m_paDebugScript = new KAction( i18n( "JavaScript &Debugger" ), 0, this, TQT_SLOT( slotDebugScript() ), actionCollection(), "debugScript" ); } d->m_paDebugScript->setEnabled( d->m_frame ? d->m_frame->m_jscript : 0L ); - QPtrList<KAction> lst; + TQPtrList<KAction> lst; lst.append( d->m_paDebugScript ); plugActionList( "debugScriptList", lst ); } @@ -7386,20 +7386,20 @@ void KHTMLPart::setSuppressedPopupIndicator( bool enable, KHTMLPart *originPart if ( enable && !d->m_statusBarPopupLabel ) { d->m_statusBarPopupLabel = new KURLLabel( d->m_statusBarExtension->statusBar() ); d->m_statusBarPopupLabel->setFixedHeight( instance()->iconLoader()->currentSize( KIcon::Small) ); - d->m_statusBarPopupLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed )); + d->m_statusBarPopupLabel->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed )); d->m_statusBarPopupLabel->setUseCursor( false ); d->m_statusBarExtension->addStatusBarItem( d->m_statusBarPopupLabel, 0, false ); d->m_statusBarPopupLabel->setPixmap( SmallIcon( "window_suppressed", instance() ) ); - QToolTip::add( d->m_statusBarPopupLabel, i18n("This page was prevented from opening a new window via JavaScript." ) ); + TQToolTip::add( d->m_statusBarPopupLabel, i18n("This page was prevented from opening a new window via JavaScript." ) ); - connect(d->m_statusBarPopupLabel, SIGNAL(leftClickedURL()), SLOT(suppressedPopupMenu())); + connect(d->m_statusBarPopupLabel, TQT_SIGNAL(leftClickedURL()), TQT_SLOT(suppressedPopupMenu())); if (d->m_settings->jsPopupBlockerPassivePopup()) { - QPixmap px; + TQPixmap px; px = MainBarIcon( "window_suppressed" ); KPassivePopup::message(i18n("Popup Window Blocked"),i18n("This page has attempted to open a popup window but was blocked.\nYou can click on this icon in the status bar to control this behavior\nor to open the popup."),px,d->m_statusBarPopupLabel); } } else if ( !enable && d->m_statusBarPopupLabel ) { - QToolTip::remove( d->m_statusBarPopupLabel ); + TQToolTip::remove( d->m_statusBarPopupLabel ); d->m_statusBarExtension->removeStatusBarItem( d->m_statusBarPopupLabel ); delete d->m_statusBarPopupLabel; d->m_statusBarPopupLabel = 0L; @@ -7410,21 +7410,21 @@ void KHTMLPart::suppressedPopupMenu() { KPopupMenu *m = new KPopupMenu(0L); m->setCheckable(true); if ( d->m_openableSuppressedPopups ) - m->insertItem(i18n("&Show Blocked Popup Window","Show %n Blocked Popup Windows", d->m_openableSuppressedPopups), this, SLOT(showSuppressedPopups())); - m->insertItem(i18n("Show Blocked Window Passive Popup &Notification"), this, SLOT(togglePopupPassivePopup()),0,57); + m->insertItem(i18n("&Show Blocked Popup Window","Show %n Blocked Popup Windows", d->m_openableSuppressedPopups), this, TQT_SLOT(showSuppressedPopups())); + m->insertItem(i18n("Show Blocked Window Passive Popup &Notification"), this, TQT_SLOT(togglePopupPassivePopup()),0,57); m->setItemChecked(57,d->m_settings->jsPopupBlockerPassivePopup()); - m->insertItem(i18n("&Configure JavaScript New Window Policies..."), this, SLOT(launchJSConfigDialog())); - m->popup(QCursor::pos()); + m->insertItem(i18n("&Configure JavaScript New Window Policies..."), this, TQT_SLOT(launchJSConfigDialog())); + m->popup(TQCursor::pos()); } void KHTMLPart::togglePopupPassivePopup() { // Same hack as in disableJSErrorExtension() d->m_settings->setJSPopupBlockerPassivePopup( !d->m_settings->jsPopupBlockerPassivePopup() ); - DCOPClient::mainClient()->send("konqueror*", "KonquerorIface", "reparseConfiguration()", QByteArray()); + DCOPClient::mainClient()->send("konqueror*", "KonquerorIface", "reparseConfiguration()", TQByteArray()); } void KHTMLPart::showSuppressedPopups() { - for ( QValueListIterator<QGuardedPtr<KHTMLPart> > i = d->m_suppressedPopupOriginParts.begin(); + for ( TQValueListIterator<TQGuardedPtr<KHTMLPart> > i = d->m_suppressedPopupOriginParts.begin(); i != d->m_suppressedPopupOriginParts.end(); ++i ) { if (KHTMLPart* part = *i) { KJS::Window *w = KJS::Window::retrieveWindow( part ); @@ -7441,7 +7441,7 @@ void KHTMLPart::showSuppressedPopups() { // Extension to use for "view document source", "save as" etc. // Using the right extension can help the viewer get into the right mode (#40496) -QString KHTMLPart::defaultExtension() const +TQString KHTMLPart::defaultExtension() const { if ( !d->m_doc ) return ".html"; diff --git a/khtml/khtml_part.h b/khtml/khtml_part.h index 194234af7..af8a1695d 100644 --- a/khtml/khtml_part.h +++ b/khtml/khtml_part.h @@ -34,7 +34,7 @@ #include <kdemacros.h> #include <kfinddialog.h> -#include <qregexp.h> +#include <tqregexp.h> class KHTMLPartPrivate; class KHTMLPartBrowserExtension; @@ -150,7 +150,7 @@ namespace KWallet * opening an url. You can do this in the following way: * * \code - * QString myHTMLCode = ...; + * TQString myHTMLCode = ...; * KHTMLPart *w = new KHTMLPart(); * w->begin(); * w->write(myHTMLCode); @@ -159,7 +159,7 @@ namespace KWallet * \endcode * * You can do as many calls to write() as you wish. There are two - * write() methods, one accepting a QString and one accepting a + * write() methods, one accepting a TQString and one accepting a * @p char @p * argument. You should use one or the other * (but not both) since the method using * the @p char @p * argument does an additional decoding step to convert the @@ -173,7 +173,7 @@ namespace KWallet * \code * KHTMLPart *doc = new KHTMLPart(); * doc->openStream( "text/html", KURL() ); - * doc->writeStream( QCString( "<html><body><p>KHTML Rocks!</p></body></html>" ) ); + * doc->writeStream( TQCString( "<html><body><p>KHTML Rocks!</p></body></html>" ) ); * doc->closeStream(); * \endcode * @@ -228,7 +228,7 @@ class KHTML_EXPORT KHTMLPart : public KParts::ReadOnlyPart * Don't add setOnlyLocalReferences here. It shouldn't be accessible via DCOP. * **/ - Q_PROPERTY( QCString dcopObjectId READ dcopObjectId ) + Q_PROPERTY( TQCString dcopObjectId READ dcopObjectId ) Q_PROPERTY( bool modified READ isModified ) public: @@ -239,17 +239,17 @@ public: * * KHTML basically consists of two objects: The KHTMLPart itself, * holding the document data (DOM document), and the KHTMLView, - * derived from QScrollView, in which the document content is + * derived from TQScrollView, in which the document content is * rendered in. You can specify two different parent objects for a * KHTMLPart, one parent for the KHTMLPart document and on parent * for the KHTMLView. If the second @p parent argument is 0L, then * @p parentWidget is used as parent for both objects, the part and * the view. */ - KHTMLPart( QWidget *parentWidget = 0, const char *widgetname = 0, - QObject *parent = 0, const char *name = 0, GUIProfile prof = DefaultGUI ); + KHTMLPart( TQWidget *parentWidget = 0, const char *widgetname = 0, + TQObject *parent = 0, const char *name = 0, GUIProfile prof = DefaultGUI ); - KHTMLPart( KHTMLView *view, QObject *parent = 0, const char *name = 0, GUIProfile prof = DefaultGUI ); + KHTMLPart( KHTMLView *view, TQObject *parent = 0, const char *name = 0, GUIProfile prof = DefaultGUI ); /** * Destructor. @@ -290,7 +290,7 @@ public: * Returns the content of the source document. * @since 3.4 */ - QString documentSource() const; + TQString documentSource() const; /** * Returns the node that has the keyboard focus. @@ -345,13 +345,13 @@ public: /** * Enable/disable statusbar messages. * When this class wants to set the statusbar text, it emits - * setStatusBarText(const QString & text) + * setStatusBarText(const TQString & text) * If you want to catch this for your own statusbar, note that it returns * back a rich text string, starting with "<qt>". This you need to - * either pass this into your own QLabel or to strip out the tags - * before passing it to QStatusBar::message(const QString & message) + * either pass this into your own TQLabel or to strip out the tags + * before passing it to TQStatusBar::message(const TQString & message) * - * @see KParts::Part::setStatusBarText( const QString & text ) + * @see KParts::Part::setStatusBarText( const TQString & text ) */ void setStatusMessagesEnabled( bool enable ); @@ -371,10 +371,10 @@ public: bool metaRefreshEnabled() const; /** - * Same as executeScript( const QString & ) except with the Node parameter + * Same as executeScript( const TQString & ) except with the Node parameter * specifying the 'this' value. */ - QVariant executeScript( const DOM::Node &n, const QString &script ); + TQVariant executeScript( const DOM::Node &n, const TQString &script ); /** * Enables or disables Drag'n'Drop support. A drag operation is started if @@ -521,10 +521,10 @@ public: void enablePlugins( bool e ) { setPluginsEnabled(e); } void autoloadImages( bool e ) { setAutoloadImages(e); } void enableMetaRefresh( bool e ) { setMetaRefreshEnabled(e); } - bool setCharset( const QString &, bool ) { return true; } + bool setCharset( const TQString &, bool ) { return true; } KURL baseURL() const; - QString baseTarget() const; + TQString baseTarget() const; #endif /** @@ -535,7 +535,7 @@ public: /** * Schedules a redirection after @p delay seconds. */ - void scheduleRedirection( int delay, const QString &url, bool lockHistory = true ); + void scheduleRedirection( int delay, const TQString &url, bool lockHistory = true ); /** * Clears the widget and prepares it for new content. @@ -577,7 +577,7 @@ public: * parameter. * * Attention: Don't mix calls to write( const char *) with calls - * to write( const QString & ). + * to write( const TQString & ). * * The result might not be what you want. */ @@ -590,7 +590,7 @@ public: * this function many times in sequence. But remember: The fewer calls * you make, the faster the widget will be. */ - virtual void write( const QString &str ); + virtual void write( const TQString &str ); /** * Call this after your last call to write(). @@ -602,12 +602,12 @@ public: * * (not implemented at the moment) */ - // void print(QPainter *, int pageHeight, int pageWidth); + // void print(TQPainter *, int pageHeight, int pageWidth); /** - * Paints the HTML page to a QPainter. See KHTMLView::paint for details + * Paints the HTML page to a TQPainter. See KHTMLView::paint for details */ - void paint( QPainter *, const QRect &, int = 0, bool * = 0 ); + void paint( TQPainter *, const TQRect &, int = 0, bool * = 0 ); /** * Sets the encoding the page uses. @@ -615,14 +615,14 @@ public: * This can be different from the charset. The widget will try to reload the current page in the new * encoding, if url() is not empty. */ - bool setEncoding( const QString &name, bool override = false ); + bool setEncoding( const TQString &name, bool override = false ); /** * Returns the encoding the page currently uses. * * Note that the encoding might be different from the charset. */ - QString encoding() const; + TQString encoding() const; /** * Sets a user defined style sheet to be used on top of the HTML 4 @@ -644,7 +644,7 @@ public: * * To have an effect this function has to be called after calling begin(). */ - void setUserStyleSheet( const QString &styleSheet ); + void setUserStyleSheet( const TQString &styleSheet ); public: @@ -653,7 +653,7 @@ public: * * @param name The font name to use for standard text. */ - void setStandardFont( const QString &name ); + void setStandardFont( const TQString &name ); /** * Sets the fixed font style. @@ -661,7 +661,7 @@ public: * @param name The font name to use for fixed text, e.g. * the <tt><pre></tt> tag. */ - void setFixedFont( const QString &name ); + void setFixedFont( const TQString &name ); /** * Finds the anchor named @p name. @@ -670,7 +670,7 @@ public: * scrolls to the closest position. Returns @p if the anchor has * been found. */ - bool gotoAnchor( const QString &name ); + bool gotoAnchor( const TQString &name ); /** * Go to the next anchor @@ -689,12 +689,12 @@ public: /** * Sets the cursor to use when the cursor is on a link. */ - void setURLCursor( const QCursor &c ); + void setURLCursor( const TQCursor &c ); /** * Returns the cursor which is used when the cursor is on a link. */ - QCursor urlCursor() const; + TQCursor urlCursor() const; /** * Extra Find options that can be used when calling the extended findText(). @@ -722,7 +722,7 @@ public: * @param findDialog Optionally, you can supply your own dialog. * @since 3.3 */ - void findText( const QString &str, long options, QWidget *parent = 0, + void findText( const TQString &str, long options, TQWidget *parent = 0, KFindDialog *findDialog = 0 ); /** @@ -732,10 +732,10 @@ public: /** * Finds the next occurrence of the string or expression. - * If isRegExp is true then str is converted to a QRegExp, and caseSensitive is ignored. + * If isRegExp is true then str is converted to a TQRegExp, and caseSensitive is ignored. * @deprecated, use findText( str, options, parent, findDialog ) */ - bool findTextNext( const QString &str, bool forward, bool caseSensitive, bool isRegExp ); + bool findTextNext( const TQString &str, bool forward, bool caseSensitive, bool isRegExp ); /** * Finds the next occurence of a string set by @ref findText() @@ -773,7 +773,7 @@ public: /** * Returns the text the user has marked. */ - virtual QString selectedText() const; + virtual TQString selectedText() const; /** * Return the text the user has marked. This is guaranteed to be valid xml, @@ -783,7 +783,7 @@ public: * * @since 3.4 */ - QString selectedTextAsHTML() const; + TQString selectedTextAsHTML() const; /** * Returns the selected part of the HTML. @@ -846,22 +846,22 @@ public: /** * Saves the KHTMLPart's complete state (including child frame - * objects) to the provided QDataStream. + * objects) to the provided TQDataStream. * * This is called from the saveState() method of the * browserExtension(). */ - virtual void saveState( QDataStream &stream ); + virtual void saveState( TQDataStream &stream ); /** * Restores the KHTMLPart's previously saved state (including - * child frame objects) from the provided QDataStream. + * child frame objects) from the provided TQDataStream. * * @see saveState() * * This is called from the restoreState() method of the * browserExtension() . **/ - virtual void restoreState( QDataStream &stream ); + virtual void restoreState( TQDataStream &stream ); /** * Returns the @p Node currently under the mouse. @@ -899,14 +899,14 @@ public: * the current document. Note that this method is not working recursively * for sub-frames. */ - QStringList frameNames() const; + TQStringList frameNames() const; - QPtrList<KParts::ReadOnlyPart> frames() const; + TQPtrList<KParts::ReadOnlyPart> frames() const; /** * Finds a frame by name. Returns 0L if frame can't be found. */ - KHTMLPart *findFrame( const QString &f ); + KHTMLPart *findFrame( const TQString &f ); /** * Recursively finds the part containing the frame with name @p f @@ -916,7 +916,7 @@ public: * frame info in @p *childFrame * @since 3.3 */ - KHTMLPart *findFrameParent( KParts::ReadOnlyPart *callingPart, const QString &f, khtml::ChildFrame **childFrame=0 ); + KHTMLPart *findFrameParent( KParts::ReadOnlyPart *callingPart, const TQString &f, khtml::ChildFrame **childFrame=0 ); /** * Return the current frame (the one that has focus) @@ -931,7 +931,7 @@ public: * if the frame is defined but no displaying component has been * found/loaded, yet. */ - bool frameExists( const QString &frameName ); + bool frameExists( const TQString &frameName ); /** * Returns child frame framePart its script interpreter @@ -941,59 +941,59 @@ public: /** * Finds a frame by name. Returns 0L if frame can't be found. */ - KParts::ReadOnlyPart *findFramePart( const QString &f ); + KParts::ReadOnlyPart *findFramePart( const TQString &f ); /** * Called by KJS. * Sets the StatusBarText assigned * via window.status */ - void setJSStatusBarText( const QString &text ); + void setJSStatusBarText( const TQString &text ); /** * Called by KJS. * Sets the DefaultStatusBarText assigned * via window.defaultStatus */ - void setJSDefaultStatusBarText( const QString &text ); + void setJSDefaultStatusBarText( const TQString &text ); /** * Called by KJS. * Returns the StatusBarText assigned * via window.status */ - QString jsStatusBarText() const; + TQString jsStatusBarText() const; /** * Called by KJS. * Returns the DefaultStatusBarText assigned * via window.defaultStatus */ - QString jsDefaultStatusBarText() const; + TQString jsDefaultStatusBarText() const; /** * Referrer used for links in this page. */ - QString referrer() const; + TQString referrer() const; /** * Referrer used to obtain this page. */ - QString pageReferrer() const; + TQString pageReferrer() const; /** * Last-modified date (in raw string format), if received in the [HTTP] headers. */ - QString lastModified() const; + TQString lastModified() const; /** * Loads a style sheet into the stylesheet cache. */ - void preloadStyleSheet( const QString &url, const QString &stylesheet ); + void preloadStyleSheet( const TQString &url, const TQString &stylesheet ); /** * Loads a script into the script cache. */ - void preloadScript( const QString &url, const QString &script ); + void preloadScript( const TQString &url, const TQString &script ); /** * @internal @@ -1058,12 +1058,12 @@ signals: /** * Emitted if the cursor is moved over an URL. */ - void onURL( const QString &url ); + void onURL( const TQString &url ); /** * Emitted when the user clicks the right mouse button on the document. */ - void popupMenu( const QString &url, const QPoint &point ); + void popupMenu( const TQString &url, const TQPoint &point ); /** * This signal is emitted when the selection changes. @@ -1103,9 +1103,9 @@ signals: * @since 3.2 * ### KDE4 remove me */ - void formSubmitNotification(const char *action, const QString& url, - const QByteArray& formData, const QString& target, - const QString& contentType, const QString& boundary); + void formSubmitNotification(const char *action, const TQString& url, + const TQByteArray& formData, const TQString& target, + const TQString& contentType, const TQString& boundary); protected: @@ -1114,7 +1114,7 @@ protected: * returns a KURL object for the given url. Use when * you know what you're doing. */ - KURL completeURL( const QString &url ); + KURL completeURL( const TQString &url ); /** * presents a detailed error message to the user. @@ -1122,9 +1122,9 @@ protected: * @p text kio additional information text. * @p url the url that triggered the error. */ - void htmlError( int errorCode, const QString& text, const KURL& reqUrl ); + void htmlError( int errorCode, const TQString& text, const KURL& reqUrl ); - virtual void customEvent( QCustomEvent *event ); + virtual void customEvent( TQCustomEvent *event ); /** * Eventhandler of the khtml::MousePressEvent. @@ -1157,8 +1157,8 @@ protected: */ virtual bool openFile(); - virtual void urlSelected( const QString &url, int button, int state, - const QString &_target, KParts::URLArgs args = KParts::URLArgs()); + virtual void urlSelected( const TQString &url, int button, int state, + const TQString &_target, KParts::URLArgs args = KParts::URLArgs()); /** * This method is called when a new embedded object (include html frames) is to be created. @@ -1168,15 +1168,15 @@ protected: * to be a object of your derived type, in which case you should return a new instance for * the mimetype 'text/html' . */ - virtual KParts::ReadOnlyPart *createPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const QString &mimetype, QString &serviceName, - QStringList &serviceTypes, const QStringList ¶ms); + virtual KParts::ReadOnlyPart *createPart( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const TQString &mimetype, TQString &serviceName, + TQStringList &serviceTypes, const TQStringList ¶ms); // This is for RenderPartObject. We want to ask the 'download plugin?' // question only once per mimetype - bool pluginPageQuestionAsked( const QString& mimetype ) const; - void setPluginPageQuestionAsked( const QString& mimetype ); + bool pluginPageQuestionAsked( const TQString& mimetype ) const; + void setPluginPageQuestionAsked( const TQString& mimetype ); enum PageSecurity { NotCrypted, Encrypted, Mixed }; void setPageSecurity( PageSecurity sec ); @@ -1184,12 +1184,12 @@ protected: /** * Implements the streaming API of KParts::ReadOnlyPart. */ - virtual bool doOpenStream( const QString& mimeType ); + virtual bool doOpenStream( const TQString& mimeType ); /** * Implements the streaming API of KParts::ReadOnlyPart. */ - virtual bool doWriteStream( const QByteArray& data ); + virtual bool doWriteStream( const TQByteArray& data ); /** * Implements the streaming API of KParts::ReadOnlyPart. @@ -1214,7 +1214,7 @@ public slots: */ void stopAnimations(); - QCString dcopObjectId() const; + TQCString dcopObjectId() const; /** * Execute the specified snippet of JavaScript code. @@ -1223,7 +1223,7 @@ public slots: * and the code returned true itself or @p false otherwise. * @deprecated, use executeString( DOM::Node(), script) */ - QVariant executeScript( const QString &script ); + TQVariant executeScript( const TQString &script ); /** * Enables/disables caret mode. @@ -1272,11 +1272,11 @@ public slots: // Remove this and make the one below protected+virtual slot. // Warning: this is effectively "internal". Be careful. // @since 3.2 - void submitFormProxy( const char *action, const QString &url, - const QByteArray &formData, - const QString &target, - const QString& contentType = QString::null, - const QString& boundary = QString::null ); + void submitFormProxy( const char *action, const TQString &url, + const TQByteArray &formData, + const TQString &target, + const TQString& contentType = TQString::null, + const TQString& boundary = TQString::null ); private slots: @@ -1288,15 +1288,15 @@ private slots: /** * @internal */ - void slotData( KIO::Job*, const QByteArray &data ); + void slotData( KIO::Job*, const TQByteArray &data ); /** * @internal */ - void slotInfoMessage( KIO::Job*, const QString& msg ); + void slotInfoMessage( KIO::Job*, const TQString& msg ); /** * @internal */ - void slotRestoreData( const QByteArray &data ); + void slotRestoreData( const TQByteArray &data ); /** * @internal */ @@ -1481,7 +1481,7 @@ private slots: /** * @internal */ - void slotHighlight( const QString &, int index, int length ); + void slotHighlight( const TQString &, int index, int length ); /** * @internal @@ -1547,7 +1547,7 @@ private: KJSErrorDlg *jsErrorExtension(); enum StatusBarPriority { BarDefaultText, BarHoverText, BarOverrideText }; - void setStatusBarText( const QString& text, StatusBarPriority p); + void setStatusBarText( const TQString& text, StatusBarPriority p); bool restoreURL( const KURL &url ); void resetFromScript(); @@ -1555,19 +1555,19 @@ private: // Returns whether callingHtmlPart may access this part bool checkFrameAccess(KHTMLPart *callingHtmlPart); bool openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs ); - bool urlSelectedIntern( const QString &url, int button, int state, - const QString &_target, KParts::URLArgs args = KParts::URLArgs()); + bool urlSelectedIntern( const TQString &url, int button, int state, + const TQString &_target, KParts::URLArgs args = KParts::URLArgs()); void startAutoScroll(); void stopAutoScroll(); - void overURL( const QString &url, const QString &target, bool shiftPressed = false ); + void overURL( const TQString &url, const TQString &target, bool shiftPressed = false ); void resetHoverText(); // Undo overURL and reset HoverText - bool processObjectRequest( khtml::ChildFrame *child, const KURL &url, const QString &mimetype ); + bool processObjectRequest( khtml::ChildFrame *child, const KURL &url, const TQString &mimetype ); KWallet::Wallet* wallet(); void openWallet(DOM::HTMLFormElementImpl*); - void saveToWallet(const QString& key, const QMap<QString,QString>& data); + void saveToWallet(const TQString& key, const TQMap<TQString,TQString>& data); void dequeueWallet(DOM::HTMLFormElementImpl*); void enableFindAheadActions(bool); @@ -1582,24 +1582,24 @@ private: // and virtual, or provide a better solution. // See the web_module for the sidebar for an example where this is // necessary. - void submitForm( const char *action, const QString &url, const QByteArray &formData, - const QString &target, const QString& contentType = QString::null, - const QString& boundary = QString::null ); + void submitForm( const char *action, const TQString &url, const TQByteArray &formData, + const TQString &target, const TQString& contentType = TQString::null, + const TQString& boundary = TQString::null ); - void popupMenu( const QString &url ); + void popupMenu( const TQString &url ); void init( KHTMLView *view, GUIProfile prof ); void clear(); - bool scheduleScript( const DOM::Node &n, const QString& script); + bool scheduleScript( const DOM::Node &n, const TQString& script); - QVariant crossFrameExecuteScript(const QString& target, const QString& script); - QVariant executeScheduledScript(); + TQVariant crossFrameExecuteScript(const TQString& target, const TQString& script); + TQVariant executeScheduledScript(); - bool requestFrame( khtml::RenderPart *frame, const QString &url, const QString &frameName, - const QStringList &args = QStringList(), bool isIFrame = false ); + bool requestFrame( khtml::RenderPart *frame, const TQString &url, const TQString &frameName, + const TQStringList &args = TQStringList(), bool isIFrame = false ); /** * @internal returns a name for a frame without a name. @@ -1608,23 +1608,23 @@ private: * always the same. * The sequence is reset in clear(). */ - QString requestFrameName(); + TQString requestFrameName(); - bool requestObject( khtml::RenderPart *frame, const QString &url, const QString &serviceType, - const QStringList &args = QStringList() ); + bool requestObject( khtml::RenderPart *frame, const TQString &url, const TQString &serviceType, + const TQStringList &args = TQStringList() ); bool requestObject( khtml::ChildFrame *child, const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() ); - DOM::EventListener *createHTMLEventListener( QString code, QString name, DOM::NodeImpl *node ); + DOM::EventListener *createHTMLEventListener( TQString code, TQString name, DOM::NodeImpl *node ); DOM::HTMLDocumentImpl *docImpl() const; DOM::DocumentImpl *xmlDocImpl() const; - khtml::ChildFrame *frame( const QObject *obj ); + khtml::ChildFrame *frame( const TQObject *obj ); khtml::ChildFrame *recursiveFrameRequest( KHTMLPart *callingHtmlPart, const KURL &url, const KParts::URLArgs &args, bool callParent = true ); - bool checkLinkSecurity( const KURL &linkURL,const QString &message = QString::null, const QString &button = QString::null ); - QVariant executeScript( const QString& filename, int baseLine, const DOM::Node &n, const QString& script ); + bool checkLinkSecurity( const KURL &linkURL,const TQString &message = TQString::null, const TQString &button = TQString::null ); + TQVariant executeScript( const TQString& filename, int baseLine, const DOM::Node &n, const TQString& script ); KJSProxy *jScript(); @@ -1655,10 +1655,10 @@ private: */ bool isExtendingSelection() const; khtml::Decoder *createDecoder(); - QString defaultEncoding() const; + TQString defaultEncoding() const; /** .html, .xhtml or .xml */ - QString defaultExtension() const; + TQString defaultExtension() const; /** @internal * generic zoom in diff --git a/khtml/khtml_printsettings.cpp b/khtml/khtml_printsettings.cpp index 61d94bbb9..1b3e9c245 100644 --- a/khtml/khtml_printsettings.cpp +++ b/khtml/khtml_printsettings.cpp @@ -20,15 +20,15 @@ #include "khtml_printsettings.h" #include <klocale.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qwhatsthis.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> -KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent, const char *name) +KHTMLPrintSettings::KHTMLPrintSettings(TQWidget *parent, const char *name) : KPrintDialogPage(parent, name) { //WhatsThis strings.... (added by pfeifle@kde.org) - QString whatsThisPrintImages = i18n( "<qt>" + TQString whatsThisPrintImages = i18n( "<qt>" "<p><strong>'Print images'</strong></p>" "<p>" "If this checkbox is enabled, images contained in the HTML page will " @@ -40,7 +40,7 @@ KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent, const char *name) "less ink or toner." "</p>" " </qt>" ); - QString whatsThisPrintHeader = i18n( "<qt>" + TQString whatsThisPrintHeader = i18n( "<qt>" "<p><strong>'Print header'</strong></p>" "<p>" "If this checkbox is enabled, the printout of the HTML document will " @@ -53,7 +53,7 @@ KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent, const char *name) "not contain such a header line." "</p>" " </qt>" ); - QString whatsThisPrinterFriendlyMode = i18n( "<qt>" + TQString whatsThisPrinterFriendlyMode = i18n( "<qt>" "<p><strong>'Printerfriendly mode'</strong></p>" "<p>" "If this checkbox is enabled, the printout of the HTML document will " @@ -70,17 +70,17 @@ KHTMLPrintSettings::KHTMLPrintSettings(QWidget *parent, const char *name) " </qt>" ); setTitle(i18n("HTML Settings")); - m_printfriendly = new QCheckBox(i18n("Printer friendly mode (black text, no background)"), this); - QWhatsThis::add(m_printfriendly, whatsThisPrinterFriendlyMode); + m_printfriendly = new TQCheckBox(i18n("Printer friendly mode (black text, no background)"), this); + TQWhatsThis::add(m_printfriendly, whatsThisPrinterFriendlyMode); m_printfriendly->setChecked(true); - m_printimages = new QCheckBox(i18n("Print images"), this); - QWhatsThis::add(m_printimages, whatsThisPrintImages); + m_printimages = new TQCheckBox(i18n("Print images"), this); + TQWhatsThis::add(m_printimages, whatsThisPrintImages); m_printimages->setChecked(true); - m_printheader = new QCheckBox(i18n("Print header"), this); - QWhatsThis::add(m_printheader, whatsThisPrintHeader); + m_printheader = new TQCheckBox(i18n("Print header"), this); + TQWhatsThis::add(m_printheader, whatsThisPrintHeader); m_printheader->setChecked(true); - QVBoxLayout *l0 = new QVBoxLayout(this, 0, 10); + QVBoxLayout *l0 = new TQVBoxLayout(this, 0, 10); l0->addWidget(m_printfriendly); l0->addWidget(m_printimages); l0->addWidget(m_printheader); @@ -91,14 +91,14 @@ KHTMLPrintSettings::~KHTMLPrintSettings() { } -void KHTMLPrintSettings::getOptions(QMap<QString,QString>& opts, bool /*incldef*/) +void KHTMLPrintSettings::getOptions(TQMap<TQString,TQString>& opts, bool /*incldef*/) { opts["app-khtml-printfriendly"] = (m_printfriendly->isChecked() ? "true" : "false"); opts["app-khtml-printimages"] = (m_printimages->isChecked() ? "true" : "false"); opts["app-khtml-printheader"] = (m_printheader->isChecked() ? "true" : "false"); } -void KHTMLPrintSettings::setOptions(const QMap<QString,QString>& opts) +void KHTMLPrintSettings::setOptions(const TQMap<TQString,TQString>& opts) { m_printfriendly->setChecked(opts["app-khtml-printfriendly"] != "false"); m_printimages->setChecked(opts["app-khtml-printimages"] != "false"); diff --git a/khtml/khtml_printsettings.h b/khtml/khtml_printsettings.h index efdeb61e8..b6d2d897b 100644 --- a/khtml/khtml_printsettings.h +++ b/khtml/khtml_printsettings.h @@ -28,11 +28,11 @@ class KHTMLPrintSettings : public KPrintDialogPage { Q_OBJECT public: - KHTMLPrintSettings(QWidget *parent = 0, const char *name = 0); + KHTMLPrintSettings(TQWidget *parent = 0, const char *name = 0); ~KHTMLPrintSettings(); - void getOptions(QMap<QString,QString>& opts, bool incldef = false); - void setOptions(const QMap<QString,QString>& opts); + void getOptions(TQMap<TQString,TQString>& opts, bool incldef = false); + void setOptions(const TQMap<TQString,TQString>& opts); private: QCheckBox *m_printfriendly; diff --git a/khtml/khtml_run.cpp b/khtml/khtml_run.cpp index 127873137..90770d38f 100644 --- a/khtml/khtml_run.cpp +++ b/khtml/khtml_run.cpp @@ -26,7 +26,7 @@ #include <kdebug.h> #include <klocale.h> #include "khtml_ext.h" -#include <qwidget.h> +#include <tqwidget.h> KHTMLRun::KHTMLRun( KHTMLPart *part, khtml::ChildFrame *child, const KURL &url, const KParts::URLArgs &args, bool hideErrorDialog ) @@ -44,10 +44,10 @@ KHTMLRun::KHTMLRun( KHTMLPart *part, khtml::ChildFrame *child, const KURL &url, //KHTMLPart *KHTMLRun::htmlPart() const //{ return static_cast<KHTMLPart *>(m_part); } -void KHTMLRun::foundMimeType( const QString &_type ) +void KHTMLRun::foundMimeType( const TQString &_type ) { Q_ASSERT(!m_bFinished); - QString mimeType = _type; // this ref comes from the job, we lose it when using KIO again + TQString mimeType = _type; // this ref comes from the job, we lose it when using KIO again if ( static_cast<KHTMLPart *>(m_part)->processObjectRequest( m_child, m_strURL, mimeType ) ) m_bFinished = true; else { @@ -78,9 +78,9 @@ void KHTMLRun::foundMimeType( const QString &_type ) static_cast<KHTMLPart *>(m_part)->checkCompleted(); } -void KHTMLRun::save( const KURL & url, const QString & suggestedFilename ) +void KHTMLRun::save( const KURL & url, const TQString & suggestedFilename ) { - KHTMLPopupGUIClient::saveURL( m_part->widget(), i18n( "Save As" ), url, m_args.metaData(), QString::null, 0, suggestedFilename ); + KHTMLPopupGUIClient::saveURL( m_part->widget(), i18n( "Save As" ), url, m_args.metaData(), TQString::null, 0, suggestedFilename ); } // KDE4: remove diff --git a/khtml/khtml_run.h b/khtml/khtml_run.h index 82006c377..e1be45fd1 100644 --- a/khtml/khtml_run.h +++ b/khtml/khtml_run.h @@ -42,15 +42,15 @@ public: KHTMLRun( KHTMLPart *part, khtml::ChildFrame *child, const KURL &url, const KParts::URLArgs &args, bool hideErrorDialog ); - virtual void foundMimeType( const QString &mimetype ); + virtual void foundMimeType( const TQString &mimetype ); //KHTMLPart *htmlPart() const; protected: virtual void handleError( KIO::Job * job ); - virtual void save( const KURL & url, const QString & suggestedFilename ); - bool askSave( const KURL & url, KService::Ptr offer, const QString & mimeType, const QString & suggestedFilename ); + virtual void save( const KURL & url, const TQString & suggestedFilename ); + bool askSave( const KURL & url, KService::Ptr offer, const TQString & mimeType, const TQString & suggestedFilename ); private: khtml::ChildFrame *m_child; diff --git a/khtml/khtml_settings.cc b/khtml/khtml_settings.cc index f2b8a27df..f5abe5ba9 100644 --- a/khtml/khtml_settings.cc +++ b/khtml/khtml_settings.cc @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include <qfontdatabase.h> +#include <tqfontdatabase.h> #include "khtml_settings.h" #include "khtmldefaults.h" @@ -26,8 +26,8 @@ #include <kglobal.h> #include <klocale.h> #include <kdebug.h> -#include <qregexp.h> -#include <qvaluevector.h> +#include <tqregexp.h> +#include <tqvaluevector.h> #include <kmessagebox.h> /** @@ -46,7 +46,7 @@ struct KPerDomainSettings { KHTMLSettings::KJSWindowResizePolicy m_windowResizePolicy : 1; #ifdef DEBUG_SETTINGS - void dump(const QString &infix = QString::null) const { + void dump(const TQString &infix = TQString::null) const { kdDebug() << "KPerDomainSettings " << infix << " @" << this << ":" << endl; kdDebug() << " m_bEnableJava: " << m_bEnableJava << endl; kdDebug() << " m_bEnableJavaScript: " << m_bEnableJavaScript << endl; @@ -60,7 +60,7 @@ struct KPerDomainSettings { #endif }; -typedef QMap<QString,KPerDomainSettings> PolicyMap; +typedef TQMap<TQString,KPerDomainSettings> PolicyMap; class KHTMLSettingsPrivate { @@ -94,20 +94,20 @@ public: int m_maxFormCompletionItems; KHTMLSettings::KAnimationAdvice m_showAnimations; - QString m_encoding; - QString m_userSheet; + TQString m_encoding; + TQString m_userSheet; - QColor m_textColor; - QColor m_baseColor; - QColor m_linkColor; - QColor m_vLinkColor; + TQColor m_textColor; + TQColor m_baseColor; + TQColor m_linkColor; + TQColor m_vLinkColor; PolicyMap domainPolicy; - QStringList fonts; - QStringList defaultFonts; + TQStringList fonts; + TQStringList defaultFonts; - QValueVector<QRegExp> adFilters; - QValueList< QPair< QString, QChar > > m_fallbackAccessKeysAssignments; + TQValueVector<TQRegExp> adFilters; + TQValueList< QPair< TQString, TQChar > > m_fallbackAccessKeysAssignments; }; @@ -116,11 +116,11 @@ public: */ static KPerDomainSettings &setup_per_domain_policy( KHTMLSettingsPrivate *d, - const QString &domain) { + const TQString &domain) { if (domain.isEmpty()) { kdWarning() << "setup_per_domain_policy: domain is empty" << endl; } - const QString ldomain = domain.lower(); + const TQString ldomain = domain.lower(); PolicyMap::iterator it = d->domainPolicy.find(ldomain); if (it == d->domainPolicy.end()) { // simply copy global domain settings (they should have been initialized @@ -131,16 +131,16 @@ static KPerDomainSettings &setup_per_domain_policy( } -KHTMLSettings::KJavaScriptAdvice KHTMLSettings::strToAdvice(const QString& _str) +KHTMLSettings::KJavaScriptAdvice KHTMLSettings::strToAdvice(const TQString& _str) { KJavaScriptAdvice ret = KJavaScriptDunno; if (!_str) ret = KJavaScriptDunno; - if (_str.lower() == QString::fromLatin1("accept")) + if (_str.lower() == TQString::fromLatin1("accept")) ret = KJavaScriptAccept; - else if (_str.lower() == QString::fromLatin1("reject")) + else if (_str.lower() == TQString::fromLatin1("reject")) ret = KJavaScriptReject; return ret; @@ -157,10 +157,10 @@ const char* KHTMLSettings::adviceToStr(KJavaScriptAdvice _advice) } -void KHTMLSettings::splitDomainAdvice(const QString& configStr, QString &domain, +void KHTMLSettings::splitDomainAdvice(const TQString& configStr, TQString &domain, KJavaScriptAdvice &javaAdvice, KJavaScriptAdvice& javaScriptAdvice) { - QString tmp(configStr); + TQString tmp(configStr); int splitIndex = tmp.find(':'); if ( splitIndex == -1) { @@ -171,7 +171,7 @@ void KHTMLSettings::splitDomainAdvice(const QString& configStr, QString &domain, else { domain = tmp.left(splitIndex).lower(); - QString adviceString = tmp.mid( splitIndex+1, tmp.length() ); + TQString adviceString = tmp.mid( splitIndex+1, tmp.length() ); int splitIndex2 = adviceString.find( ':' ); if( splitIndex2 == -1 ) { // Java advice only @@ -188,64 +188,64 @@ void KHTMLSettings::splitDomainAdvice(const QString& configStr, QString &domain, void KHTMLSettings::readDomainSettings(KConfig *config, bool reset, bool global, KPerDomainSettings &pd_settings) { - QString jsPrefix = global ? QString::null - : QString::fromLatin1("javascript."); - QString javaPrefix = global ? QString::null - : QString::fromLatin1("java."); - QString pluginsPrefix = global ? QString::null - : QString::fromLatin1("plugins."); + TQString jsPrefix = global ? TQString::null + : TQString::fromLatin1("javascript."); + TQString javaPrefix = global ? TQString::null + : TQString::fromLatin1("java."); + TQString pluginsPrefix = global ? TQString::null + : TQString::fromLatin1("plugins."); // The setting for Java - QString key = javaPrefix + QString::fromLatin1("EnableJava"); + TQString key = javaPrefix + TQString::fromLatin1("EnableJava"); if ( (global && reset) || config->hasKey( key ) ) pd_settings.m_bEnableJava = config->readBoolEntry( key, false ); else if ( !global ) pd_settings.m_bEnableJava = d->global.m_bEnableJava; // The setting for Plugins - key = pluginsPrefix + QString::fromLatin1("EnablePlugins"); + key = pluginsPrefix + TQString::fromLatin1("EnablePlugins"); if ( (global && reset) || config->hasKey( key ) ) pd_settings.m_bEnablePlugins = config->readBoolEntry( key, true ); else if ( !global ) pd_settings.m_bEnablePlugins = d->global.m_bEnablePlugins; // The setting for JavaScript - key = jsPrefix + QString::fromLatin1("EnableJavaScript"); + key = jsPrefix + TQString::fromLatin1("EnableJavaScript"); if ( (global && reset) || config->hasKey( key ) ) pd_settings.m_bEnableJavaScript = config->readBoolEntry( key, true ); else if ( !global ) pd_settings.m_bEnableJavaScript = d->global.m_bEnableJavaScript; // window property policies - key = jsPrefix + QString::fromLatin1("WindowOpenPolicy"); + key = jsPrefix + TQString::fromLatin1("WindowOpenPolicy"); if ( (global && reset) || config->hasKey( key ) ) pd_settings.m_windowOpenPolicy = (KJSWindowOpenPolicy) config->readUnsignedNumEntry( key, KJSWindowOpenSmart ); else if ( !global ) pd_settings.m_windowOpenPolicy = d->global.m_windowOpenPolicy; - key = jsPrefix + QString::fromLatin1("WindowMovePolicy"); + key = jsPrefix + TQString::fromLatin1("WindowMovePolicy"); if ( (global && reset) || config->hasKey( key ) ) pd_settings.m_windowMovePolicy = (KJSWindowMovePolicy) config->readUnsignedNumEntry( key, KJSWindowMoveAllow ); else if ( !global ) pd_settings.m_windowMovePolicy = d->global.m_windowMovePolicy; - key = jsPrefix + QString::fromLatin1("WindowResizePolicy"); + key = jsPrefix + TQString::fromLatin1("WindowResizePolicy"); if ( (global && reset) || config->hasKey( key ) ) pd_settings.m_windowResizePolicy = (KJSWindowResizePolicy) config->readUnsignedNumEntry( key, KJSWindowResizeAllow ); else if ( !global ) pd_settings.m_windowResizePolicy = d->global.m_windowResizePolicy; - key = jsPrefix + QString::fromLatin1("WindowStatusPolicy"); + key = jsPrefix + TQString::fromLatin1("WindowStatusPolicy"); if ( (global && reset) || config->hasKey( key ) ) pd_settings.m_windowStatusPolicy = (KJSWindowStatusPolicy) config->readUnsignedNumEntry( key, KJSWindowStatusAllow ); else if ( !global ) pd_settings.m_windowStatusPolicy = d->global.m_windowStatusPolicy; - key = jsPrefix + QString::fromLatin1("WindowFocusPolicy"); + key = jsPrefix + TQString::fromLatin1("WindowFocusPolicy"); if ( (global && reset) || config->hasKey( key ) ) pd_settings.m_windowFocusPolicy = (KJSWindowFocusPolicy) config->readUnsignedNumEntry( key, KJSWindowFocusAllow ); @@ -301,7 +301,7 @@ void KHTMLSettings::init() void KHTMLSettings::init( KConfig * config, bool reset ) { - QString group_save = config->group(); + TQString group_save = config->group(); if (reset || config->hasGroup("MainView Settings")) { config->setGroup( "MainView Settings" ); @@ -326,13 +326,13 @@ void KHTMLSettings::init( KConfig * config, bool reset ) d->adFilters.clear(); - QMap<QString,QString> entryMap = config->entryMap("Filter Settings"); - QMap<QString,QString>::ConstIterator it; + TQMap<TQString,TQString> entryMap = config->entryMap("Filter Settings"); + TQMap<TQString,TQString>::ConstIterator it; d->adFilters.reserve(entryMap.count()); for( it = entryMap.constBegin(); it != entryMap.constEnd(); ++it ) { - QString name = it.key(); - QString url = it.data(); + TQString name = it.key(); + TQString url = it.data(); if (url.startsWith("!")) continue; @@ -341,13 +341,13 @@ void KHTMLSettings::init( KConfig * config, bool reset ) { if (url.length()>2 && url[0]=='/' && url[url.length()-1] == '/') { - QString inside = url.mid(1, url.length()-2); - QRegExp rx(inside); + TQString inside = url.mid(1, url.length()-2); + TQRegExp rx(inside); d->adFilters.append(rx); } else { - QRegExp rx; + TQRegExp rx; int left,right; for (right=url.length(); right>0 && url[right-1]=='*' ; --right); @@ -368,14 +368,14 @@ void KHTMLSettings::init( KConfig * config, bool reset ) config->setGroup( "HTML Settings" ); // Fonts and colors if( reset ) { - d->defaultFonts = QStringList(); + d->defaultFonts = TQStringList(); d->defaultFonts.append( config->readEntry( "StandardFont", KGlobalSettings::generalFont().family() ) ); d->defaultFonts.append( config->readEntry( "FixedFont", KGlobalSettings::fixedFont().family() ) ); d->defaultFonts.append( config->readEntry( "SerifFont", HTML_DEFAULT_VIEW_SERIF_FONT ) ); d->defaultFonts.append( config->readEntry( "SansSerifFont", HTML_DEFAULT_VIEW_SANSSERIF_FONT ) ); d->defaultFonts.append( config->readEntry( "CursiveFont", HTML_DEFAULT_VIEW_CURSIVE_FONT ) ); d->defaultFonts.append( config->readEntry( "FantasyFont", HTML_DEFAULT_VIEW_FANTASY_FONT ) ); - d->defaultFonts.append( QString( "0" ) ); // font size adjustment + d->defaultFonts.append( TQString( "0" ) ); // font size adjustment } if ( reset || config->hasKey( "MinimumFontSize" ) ) @@ -420,7 +420,7 @@ void KHTMLSettings::init( KConfig * config, bool reset ) if ( reset || config->hasKey( "ShowAnimations" ) ) { - QString value = config->readEntry( "ShowAnimations").lower(); + TQString value = config->readEntry( "ShowAnimations").lower(); if (value == "disabled") d->m_showAnimations = KAnimationDisabled; else if (value == "looponce") @@ -438,9 +438,9 @@ void KHTMLSettings::init( KConfig * config, bool reset ) d->m_maxFormCompletionItems = config->readNumEntry("MaxFormCompletionItems", 10); d->m_autoDelayedActionsEnabled = config->readBoolEntry ("AutoDelayedActions", true); d->m_jsErrorsEnabled = config->readBoolEntry("ReportJSErrors", true); - QStringList accesskeys = config->readListEntry("FallbackAccessKeysAssignments"); + TQStringList accesskeys = config->readListEntry("FallbackAccessKeysAssignments"); d->m_fallbackAccessKeysAssignments.clear(); - for( QStringList::ConstIterator it = accesskeys.begin(); it != accesskeys.end(); ++it ) + for( TQStringList::ConstIterator it = accesskeys.begin(); it != accesskeys.end(); ++it ) if( (*it).length() > 2 && (*it)[ 1 ] == ':' ) d->m_fallbackAccessKeysAssignments.append( qMakePair( (*it).mid( 2 ), (*it)[ 0 ] )); } @@ -497,18 +497,18 @@ void KHTMLSettings::init( KConfig * config, bool reset ) bool check_old_ecma_settings = true; bool check_old_java_settings = true; // merge all domains into one list - QMap<QString,int> domainList; // why can't Qt have a QSet? + TQMap<TQString,int> domainList; // why can't Qt have a QSet? for (unsigned i = 0; i < sizeof domain_keys/sizeof domain_keys[0]; ++i) { if ( reset || config->hasKey(domain_keys[i]) ) { if (i == 0) check_old_ecma_settings = false; else if (i == 1) check_old_java_settings = false; - const QStringList dl = config->readListEntry( domain_keys[i] ); - const QMap<QString,int>::Iterator notfound = domainList.end(); - QStringList::ConstIterator it = dl.begin(); - const QStringList::ConstIterator itEnd = dl.end(); + const TQStringList dl = config->readListEntry( domain_keys[i] ); + const TQMap<TQString,int>::Iterator notfound = domainList.end(); + TQStringList::ConstIterator it = dl.begin(); + const TQStringList::ConstIterator itEnd = dl.end(); for (; it != itEnd; ++it) { - const QString domain = (*it).lower(); - QMap<QString,int>::Iterator pos = domainList.find(domain); + const TQString domain = (*it).lower(); + TQMap<TQString,int>::Iterator pos = domainList.find(domain); if (pos == notfound) domainList.insert(domain,0); }/*next it*/ } @@ -517,13 +517,13 @@ void KHTMLSettings::init( KConfig * config, bool reset ) if (reset) d->domainPolicy.clear(); - QString js_group_save = config->group(); + TQString js_group_save = config->group(); { - QMap<QString,int>::ConstIterator it = domainList.begin(); - const QMap<QString,int>::ConstIterator itEnd = domainList.end(); + TQMap<TQString,int>::ConstIterator it = domainList.begin(); + const TQMap<TQString,int>::ConstIterator itEnd = domainList.end(); for ( ; it != itEnd; ++it) { - const QString domain = it.key(); + const TQString domain = it.key(); config->setGroup(domain); readDomainSettings(config,reset,false,d->domainPolicy[domain]); #ifdef DEBUG_SETTINGS @@ -538,12 +538,12 @@ void KHTMLSettings::init( KConfig * config, bool reset ) && check_old_java_settings ) { check_old_java = false; - const QStringList domainList = config->readListEntry( "JavaDomainSettings" ); - QStringList::ConstIterator it = domainList.begin(); - const QStringList::ConstIterator itEnd = domainList.end(); + const TQStringList domainList = config->readListEntry( "JavaDomainSettings" ); + TQStringList::ConstIterator it = domainList.begin(); + const TQStringList::ConstIterator itEnd = domainList.end(); for ( ; it != itEnd; ++it) { - QString domain; + TQString domain; KJavaScriptAdvice javaAdvice; KJavaScriptAdvice javaScriptAdvice; splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice); @@ -560,12 +560,12 @@ void KHTMLSettings::init( KConfig * config, bool reset ) && check_old_ecma_settings ) { check_old_ecma = false; - const QStringList domainList = config->readListEntry( "ECMADomainSettings" ); - QStringList::ConstIterator it = domainList.begin(); - const QStringList::ConstIterator itEnd = domainList.end(); + const TQStringList domainList = config->readListEntry( "ECMADomainSettings" ); + TQStringList::ConstIterator it = domainList.begin(); + const TQStringList::ConstIterator itEnd = domainList.end(); for ( ; it != itEnd; ++it) { - QString domain; + TQString domain; KJavaScriptAdvice javaAdvice; KJavaScriptAdvice javaScriptAdvice; splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice); @@ -581,12 +581,12 @@ void KHTMLSettings::init( KConfig * config, bool reset ) && ( check_old_java || check_old_ecma ) && ( check_old_ecma_settings || check_old_java_settings ) ) { - const QStringList domainList = config->readListEntry( "JavaScriptDomainAdvice" ); - QStringList::ConstIterator it = domainList.begin(); - const QStringList::ConstIterator itEnd = domainList.end(); + const TQStringList domainList = config->readListEntry( "JavaScriptDomainAdvice" ); + TQStringList::ConstIterator it = domainList.begin(); + const TQStringList::ConstIterator itEnd = domainList.end(); for ( ; it != itEnd; ++it) { - QString domain; + TQString domain; KJavaScriptAdvice javaAdvice; KJavaScriptAdvice javaScriptAdvice; splitDomainAdvice(*it, domain, javaAdvice, javaScriptAdvice); @@ -605,26 +605,26 @@ void KHTMLSettings::init( KConfig * config, bool reset ) #if 0 if( check_old_java ) { - QStringList domainConfig; + TQStringList domainConfig; PolicyMap::Iterator it; for( it = d->javaDomainPolicy.begin(); it != d->javaDomainPolicy.end(); ++it ) { - QCString javaPolicy = adviceToStr( it.data() ); - QCString javaScriptPolicy = adviceToStr( KJavaScriptDunno ); - domainConfig.append(QString::fromLatin1("%1:%2:%3").arg(it.key()).arg(javaPolicy).arg(javaScriptPolicy)); + TQCString javaPolicy = adviceToStr( it.data() ); + TQCString javaScriptPolicy = adviceToStr( KJavaScriptDunno ); + domainConfig.append(TQString::fromLatin1("%1:%2:%3").arg(it.key()).arg(javaPolicy).arg(javaScriptPolicy)); } config->writeEntry( "JavaDomainSettings", domainConfig ); } if( check_old_ecma ) { - QStringList domainConfig; + TQStringList domainConfig; PolicyMap::Iterator it; for( it = d->javaScriptDomainPolicy.begin(); it != d->javaScriptDomainPolicy.end(); ++it ) { - QCString javaPolicy = adviceToStr( KJavaScriptDunno ); - QCString javaScriptPolicy = adviceToStr( it.data() ); - domainConfig.append(QString::fromLatin1("%1:%2:%3").arg(it.key()).arg(javaPolicy).arg(javaScriptPolicy)); + TQCString javaPolicy = adviceToStr( KJavaScriptDunno ); + TQCString javaScriptPolicy = adviceToStr( it.data() ); + domainConfig.append(TQString::fromLatin1("%1:%2:%3").arg(it.key()).arg(javaPolicy).arg(javaScriptPolicy)); } config->writeEntry( "ECMADomainSettings", domainConfig ); } @@ -641,7 +641,7 @@ void KHTMLSettings::init( KConfig * config, bool reset ) */ static const KPerDomainSettings &lookup_hostname_policy( const KHTMLSettingsPrivate *d, - const QString& hostname) + const TQString& hostname) { #ifdef DEBUG_SETTINGS kdDebug() << "lookup_hostname_policy(" << hostname << ")" << endl; @@ -668,9 +668,9 @@ static const KPerDomainSettings &lookup_hostname_policy( // Now, check for partial match. Chop host from the left until // there's no dots left. - QString host_part = hostname; + TQString host_part = hostname; int dot_idx = -1; - while( (dot_idx = host_part.find(QChar('.'))) >= 0 ) { + while( (dot_idx = host_part.find(TQChar('.'))) >= 0 ) { host_part.remove(0,dot_idx); it = d->domainPolicy.find(host_part); Q_ASSERT(notfound == d->domainPolicy.end()); @@ -681,7 +681,7 @@ static const KPerDomainSettings &lookup_hostname_policy( #endif return *it; } - // assert(host_part[0] == QChar('.')); + // assert(host_part[0] == TQChar('.')); host_part.remove(0,1); // Chop off the dot. } @@ -718,14 +718,14 @@ bool KHTMLSettings::isHideAdsEnabled() const return d->m_hideAdsEnabled; } -bool KHTMLSettings::isAdFiltered( const QString &url ) const +bool KHTMLSettings::isAdFiltered( const TQString &url ) const { if (d->m_adFilterEnabled) { if (!url.startsWith("data:")) { - QValueVector<QRegExp>::const_iterator it(d->adFilters.constBegin()); - QValueVector<QRegExp>::const_iterator end(d->adFilters.constEnd()); + TQValueVector<TQRegExp>::const_iterator it(d->adFilters.constBegin()); + TQValueVector<TQRegExp>::const_iterator end(d->adFilters.constEnd()); for (; it != end; ++it) { if ((*it).search(url) != -1) @@ -739,15 +739,15 @@ bool KHTMLSettings::isAdFiltered( const QString &url ) const return false; } -void KHTMLSettings::addAdFilter( const QString &url ) +void KHTMLSettings::addAdFilter( const TQString &url ) { KConfig config( "khtmlrc", false, false ); config.setGroup( "Filter Settings" ); - QRegExp rx; + TQRegExp rx; if (url.length()>2 && url[0]=='/' && url[url.length()-1] == '/') { - QString inside = url.mid(1, url.length()-2); + TQString inside = url.mid(1, url.length()-2); rx.setWildcard(false); rx.setPattern(inside); } @@ -765,7 +765,7 @@ void KHTMLSettings::addAdFilter( const QString &url ) if (rx.isValid()) { int last=config.readNumEntry("Count",0); - QString key = "Filter-" + QString::number(last); + TQString key = "Filter-" + TQString::number(last); config.writeEntry(key, url); config.writeEntry("Count",last+1); config.sync(); @@ -780,55 +780,55 @@ void KHTMLSettings::addAdFilter( const QString &url ) } } -bool KHTMLSettings::isJavaEnabled( const QString& hostname ) +bool KHTMLSettings::isJavaEnabled( const TQString& hostname ) { return lookup_hostname_policy(d,hostname.lower()).m_bEnableJava; } -bool KHTMLSettings::isJavaScriptEnabled( const QString& hostname ) +bool KHTMLSettings::isJavaScriptEnabled( const TQString& hostname ) { return lookup_hostname_policy(d,hostname.lower()).m_bEnableJavaScript; } -bool KHTMLSettings::isJavaScriptDebugEnabled( const QString& /*hostname*/ ) +bool KHTMLSettings::isJavaScriptDebugEnabled( const TQString& /*hostname*/ ) { // debug setting is global for now, but could change in the future return d->m_bEnableJavaScriptDebug; } -bool KHTMLSettings::isJavaScriptErrorReportingEnabled( const QString& /*hostname*/ ) const +bool KHTMLSettings::isJavaScriptErrorReportingEnabled( const TQString& /*hostname*/ ) const { // error reporting setting is global for now, but could change in the future return d->m_bEnableJavaScriptErrorReporting; } -bool KHTMLSettings::isPluginsEnabled( const QString& hostname ) +bool KHTMLSettings::isPluginsEnabled( const TQString& hostname ) { return lookup_hostname_policy(d,hostname.lower()).m_bEnablePlugins; } KHTMLSettings::KJSWindowOpenPolicy KHTMLSettings::windowOpenPolicy( - const QString& hostname) const { + const TQString& hostname) const { return lookup_hostname_policy(d,hostname.lower()).m_windowOpenPolicy; } KHTMLSettings::KJSWindowMovePolicy KHTMLSettings::windowMovePolicy( - const QString& hostname) const { + const TQString& hostname) const { return lookup_hostname_policy(d,hostname.lower()).m_windowMovePolicy; } KHTMLSettings::KJSWindowResizePolicy KHTMLSettings::windowResizePolicy( - const QString& hostname) const { + const TQString& hostname) const { return lookup_hostname_policy(d,hostname.lower()).m_windowResizePolicy; } KHTMLSettings::KJSWindowStatusPolicy KHTMLSettings::windowStatusPolicy( - const QString& hostname) const { + const TQString& hostname) const { return lookup_hostname_policy(d,hostname.lower()).m_windowStatusPolicy; } KHTMLSettings::KJSWindowFocusPolicy KHTMLSettings::windowFocusPolicy( - const QString& hostname) const { + const TQString& hostname) const { return lookup_hostname_policy(d,hostname.lower()).m_windowFocusPolicy; } @@ -842,10 +842,10 @@ int KHTMLSettings::minFontSize() const return d->m_minFontSize; } -QString KHTMLSettings::settingsToCSS() const +TQString KHTMLSettings::settingsToCSS() const { // lets start with the link properties - QString str = "a:link {\ncolor: "; + TQString str = "a:link {\ncolor: "; str += d->m_linkColor.name(); str += ";"; if(d->m_underlineLink) @@ -873,18 +873,18 @@ QString KHTMLSettings::settingsToCSS() const return str; } -const QString &KHTMLSettings::availableFamilies() +const TQString &KHTMLSettings::availableFamilies() { if ( !avFamilies ) { avFamilies = new QString; - QFontDatabase db; - QStringList families = db.families(); - QStringList s; - QRegExp foundryExp(" \\[.+\\]"); + TQFontDatabase db; + TQStringList families = db.families(); + TQStringList s; + TQRegExp foundryExp(" \\[.+\\]"); //remove foundry info - QStringList::Iterator f = families.begin(); - const QStringList::Iterator fEnd = families.end(); + TQStringList::Iterator f = families.begin(); + const TQStringList::Iterator fEnd = families.end(); for ( ; f != fEnd; ++f ) { (*f).replace( foundryExp, ""); @@ -899,9 +899,9 @@ const QString &KHTMLSettings::availableFamilies() return *avFamilies; } -QString KHTMLSettings::lookupFont(int i) const +TQString KHTMLSettings::lookupFont(int i) const { - QString font; + TQString font; if (d->fonts.count() > (uint) i) font = d->fonts[i]; if (font.isEmpty()) @@ -909,51 +909,51 @@ QString KHTMLSettings::lookupFont(int i) const return font; } -QString KHTMLSettings::stdFontName() const +TQString KHTMLSettings::stdFontName() const { return lookupFont(0); } -QString KHTMLSettings::fixedFontName() const +TQString KHTMLSettings::fixedFontName() const { return lookupFont(1); } -QString KHTMLSettings::serifFontName() const +TQString KHTMLSettings::serifFontName() const { return lookupFont(2); } -QString KHTMLSettings::sansSerifFontName() const +TQString KHTMLSettings::sansSerifFontName() const { return lookupFont(3); } -QString KHTMLSettings::cursiveFontName() const +TQString KHTMLSettings::cursiveFontName() const { return lookupFont(4); } -QString KHTMLSettings::fantasyFontName() const +TQString KHTMLSettings::fantasyFontName() const { return lookupFont(5); } -void KHTMLSettings::setStdFontName(const QString &n) +void KHTMLSettings::setStdFontName(const TQString &n) { while(d->fonts.count() <= 0) - d->fonts.append(QString::null); + d->fonts.append(TQString::null); d->fonts[0] = n; } -void KHTMLSettings::setFixedFontName(const QString &n) +void KHTMLSettings::setFixedFontName(const TQString &n) { while(d->fonts.count() <= 1) - d->fonts.append(QString::null); + d->fonts.append(TQString::null); d->fonts[1] = n; } -QString KHTMLSettings::userStyleSheet() const +TQString KHTMLSettings::userStyleSheet() const { return d->m_userSheet; } @@ -968,7 +968,7 @@ int KHTMLSettings::maxFormCompletionItems() const return d->m_maxFormCompletionItems; } -const QString &KHTMLSettings::encoding() const +const TQString &KHTMLSettings::encoding() const { return d->m_encoding; } @@ -978,22 +978,22 @@ bool KHTMLSettings::followSystemColors() const return d->m_follow_system_colors; } -const QColor& KHTMLSettings::textColor() const +const TQColor& KHTMLSettings::textColor() const { return d->m_textColor; } -const QColor& KHTMLSettings::baseColor() const +const TQColor& KHTMLSettings::baseColor() const { return d->m_baseColor; } -const QColor& KHTMLSettings::linkColor() const +const TQColor& KHTMLSettings::linkColor() const { return d->m_linkColor; } -const QColor& KHTMLSettings::vLinkColor() const +const TQColor& KHTMLSettings::vLinkColor() const { return d->m_vLinkColor; } @@ -1043,7 +1043,7 @@ bool KHTMLSettings::autoSpellCheck() const return d->m_autoSpellCheck; } -QValueList< QPair< QString, QChar > > KHTMLSettings::fallbackAccessKeysAssignments() const +TQValueList< QPair< TQString, TQChar > > KHTMLSettings::fallbackAccessKeysAssignments() const { return d->m_fallbackAccessKeysAssignments; } diff --git a/khtml/khtml_settings.h b/khtml/khtml_settings.h index 14684511d..d7ef32eab 100644 --- a/khtml/khtml_settings.h +++ b/khtml/khtml_settings.h @@ -21,11 +21,11 @@ #define __konq_htmlsettings_h__ class KConfig; -#include <qcolor.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qfont.h> -#include <qmap.h> +#include <tqcolor.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqfont.h> +#include <tqmap.h> #include <kdelibs_export.h> @@ -128,16 +128,16 @@ public: KAnimationAdvice showAnimations() const; // Font settings - QString stdFontName() const; - QString fixedFontName() const; - QString serifFontName() const; - QString sansSerifFontName() const; - QString cursiveFontName() const; - QString fantasyFontName() const; + TQString stdFontName() const; + TQString fixedFontName() const; + TQString serifFontName() const; + TQString sansSerifFontName() const; + TQString cursiveFontName() const; + TQString fantasyFontName() const; // these two can be set. Mainly for historical reasons (the method in KHTMLPart exists...) - void setStdFontName(const QString &n); - void setFixedFontName(const QString &n); + void setStdFontName(const TQString &n); + void setFixedFontName(const TQString &n); int minFontSize() const; int mediumFontSize() const; @@ -145,15 +145,15 @@ public: bool jsErrorsEnabled() const; void setJSErrorsEnabled(bool enabled); - const QString &encoding() const; + const TQString &encoding() const; bool followSystemColors() const; // Color settings - const QColor& textColor() const; - const QColor& baseColor() const; - const QColor& linkColor() const; - const QColor& vLinkColor() const; + const TQColor& textColor() const; + const TQColor& baseColor() const; + const TQColor& linkColor() const; + const TQColor& vLinkColor() const; // Autoload images bool autoLoadImages() const; @@ -164,30 +164,30 @@ public: // Java and JavaScript // ### BIC make these const - bool isJavaEnabled( const QString& hostname = QString::null ); - bool isJavaScriptEnabled( const QString& hostname = QString::null ); - bool isJavaScriptDebugEnabled( const QString& hostname = QString::null ); - bool isJavaScriptErrorReportingEnabled( const QString& hostname = QString::null ) const; - bool isPluginsEnabled( const QString& hostname = QString::null ); + bool isJavaEnabled( const TQString& hostname = TQString::null ); + bool isJavaScriptEnabled( const TQString& hostname = TQString::null ); + bool isJavaScriptDebugEnabled( const TQString& hostname = TQString::null ); + bool isJavaScriptErrorReportingEnabled( const TQString& hostname = TQString::null ) const; + bool isPluginsEnabled( const TQString& hostname = TQString::null ); // AdBlocK Filtering - bool isAdFiltered( const QString &url ) const; + bool isAdFiltered( const TQString &url ) const; bool isAdFilterEnabled() const; bool isHideAdsEnabled() const; - void addAdFilter( const QString &url ); + void addAdFilter( const TQString &url ); // Access Keys bool accessKeysEnabled() const; - KJSWindowOpenPolicy windowOpenPolicy( const QString& hostname = QString::null ) const; - KJSWindowMovePolicy windowMovePolicy( const QString& hostname = QString::null ) const; - KJSWindowResizePolicy windowResizePolicy( const QString& hostname = QString::null ) const; - KJSWindowStatusPolicy windowStatusPolicy( const QString& hostname = QString::null ) const; - KJSWindowFocusPolicy windowFocusPolicy( const QString& hostname = QString::null ) const; + KJSWindowOpenPolicy windowOpenPolicy( const TQString& hostname = TQString::null ) const; + KJSWindowMovePolicy windowMovePolicy( const TQString& hostname = TQString::null ) const; + KJSWindowResizePolicy windowResizePolicy( const TQString& hostname = TQString::null ) const; + KJSWindowStatusPolicy windowStatusPolicy( const TQString& hostname = TQString::null ) const; + KJSWindowFocusPolicy windowFocusPolicy( const TQString& hostname = TQString::null ) const; // helpers for parsing domain-specific configuration, used in KControl module as well - static KJavaScriptAdvice strToAdvice(const QString& _str); - static void splitDomainAdvice(const QString& configStr, QString &domain, + static KJavaScriptAdvice strToAdvice(const TQString& _str); + static void splitDomainAdvice(const TQString& configStr, TQString &domain, KJavaScriptAdvice &javaAdvice, KJavaScriptAdvice& javaScriptAdvice); static const char* adviceToStr(KJavaScriptAdvice _advice); @@ -202,10 +202,10 @@ public: void readDomainSettings(KConfig *config, bool reset, bool global, KPerDomainSettings &pd_settings); - QString settingsToCSS() const; - static const QString &availableFamilies(); + TQString settingsToCSS() const; + static const TQString &availableFamilies(); - QString userStyleSheet() const; + TQString userStyleSheet() const; // Form completion bool isFormCompletionEnabled() const; @@ -214,7 +214,7 @@ public: // Meta refresh/redirect (http-equiv) bool isAutoDelayedActionsEnabled () const; - QValueList< QPair< QString, QChar > > fallbackAccessKeysAssignments() const; + TQValueList< QPair< TQString, TQChar > > fallbackAccessKeysAssignments() const; // Whether to show passive popup when windows are blocked // @since 3.5 @@ -223,10 +223,10 @@ public: private: friend class KHTMLFactory; - QString lookupFont(int i) const; + TQString lookupFont(int i) const; KHTMLSettingsPrivate *d; - static QString *avFamilies; + static TQString *avFamilies; }; #endif diff --git a/khtml/khtmlimage.cpp b/khtml/khtmlimage.cpp index 4f48c2915..03279e968 100644 --- a/khtml/khtmlimage.cpp +++ b/khtml/khtmlimage.cpp @@ -26,8 +26,8 @@ #include "rendering/render_image.h" #include "misc/loader.h" -#include <qvbox.h> -#include <qtimer.h> +#include <tqvbox.h> +#include <tqtimer.h> #include <kio/job.h> #include <kinstance.h> @@ -48,9 +48,9 @@ KHTMLImageFactory::~KHTMLImageFactory() delete s_instance; } -KParts::Part *KHTMLImageFactory::createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *className, const QStringList & ) +KParts::Part *KHTMLImageFactory::createPartObject( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *className, const TQStringList & ) { KHTMLPart::GUIProfile prof = KHTMLPart::DefaultGUI; if ( strcmp( className, "Browser/View" ) == 0 ) @@ -58,19 +58,19 @@ KParts::Part *KHTMLImageFactory::createPartObject( QWidget *parentWidget, const return new KHTMLImage( parentWidget, widgetName, parent, name, prof ); } -KHTMLImage::KHTMLImage( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, KHTMLPart::GUIProfile prof ) +KHTMLImage::KHTMLImage( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, KHTMLPart::GUIProfile prof ) : KParts::ReadOnlyPart( parent, name ), m_image( 0 ) { KHTMLPart* parentPart = ::qt_cast<KHTMLPart *>( parent ); setInstance( KHTMLImageFactory::instance(), prof == KHTMLPart::BrowserViewGUI && !parentPart ); - QVBox *box = new QVBox( parentWidget, widgetName ); + TQVBox *box = new TQVBox( parentWidget, widgetName ); m_khtml = new KHTMLPart( box, widgetName, this, "htmlimagepart", prof ); m_khtml->setAutoloadImages( true ); m_khtml->widget()->installEventFilter(this); - connect( m_khtml->view(), SIGNAL( finishedLayout() ), this, SLOT( restoreScrollPosition() ) ); + connect( m_khtml->view(), TQT_SIGNAL( finishedLayout() ), this, TQT_SLOT( restoreScrollPosition() ) ); setWidget( box ); @@ -105,15 +105,15 @@ KHTMLImage::KHTMLImage( QWidget *parentWidget, const char *widgetName, // forward opening requests to parent frame (if existing) KHTMLPart *p = ::qt_cast<KHTMLPart *>(parent); KParts::BrowserExtension *be = p ? p->browserExtension() : m_ext; - connect(m_khtml->browserExtension(), SIGNAL(openURLRequestDelayed(const KURL &, const KParts::URLArgs &)), - be, SIGNAL(openURLRequestDelayed(const KURL &, const KParts::URLArgs &))); + connect(m_khtml->browserExtension(), TQT_SIGNAL(openURLRequestDelayed(const KURL &, const KParts::URLArgs &)), + be, TQT_SIGNAL(openURLRequestDelayed(const KURL &, const KParts::URLArgs &))); - connect( m_khtml->browserExtension(), SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, - const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t) ), m_ext, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, + connect( m_khtml->browserExtension(), TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, + const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t) ), m_ext, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t) ) ); - connect( m_khtml->browserExtension(), SIGNAL( enableAction( const char *, bool ) ), - m_ext, SIGNAL( enableAction( const char *, bool ) ) ); + connect( m_khtml->browserExtension(), TQT_SIGNAL( enableAction( const char *, bool ) ), + m_ext, TQT_SIGNAL( enableAction( const char *, bool ) ) ); m_ext->setURLDropHandlingEnabled( true ); } @@ -135,7 +135,7 @@ KHTMLImage::~KHTMLImage() bool KHTMLImage::openURL( const KURL &url ) { - static const QString &html = KGlobal::staticQString( "<html><body><img src=\"%1\"></body></html>" ); + static const TQString &html = KGlobal::staticQString( "<html><body><img src=\"%1\"></body></html>" ); disposeImage(); @@ -169,8 +169,8 @@ bool KHTMLImage::openURL( const KURL &url ) m_khtml->end(); /* - connect( khtml::Cache::loader(), SIGNAL( requestDone( khtml::DocLoader*, khtml::CachedObject *) ), - this, SLOT( updateWindowCaption() ) ); + connect( khtml::Cache::loader(), TQT_SIGNAL( requestDone( khtml::DocLoader*, khtml::CachedObject *) ), + this, TQT_SLOT( updateWindowCaption() ) ); */ return true; } @@ -187,8 +187,8 @@ void KHTMLImage::notifyFinished( khtml::CachedObject *o ) if ( !m_image || o != m_image ) return; - const QPixmap &pix = m_image->pixmap(); - QString caption; + const TQPixmap &pix = m_image->pixmap(); + TQString caption; KMimeType::Ptr mimeType; if ( !m_mimeType.isEmpty() ) @@ -242,7 +242,7 @@ void KHTMLImage::slotImageJobFinished( KIO::Job *job ) else { emit completed(); - QTimer::singleShot( 0, this, SLOT( updateWindowCaption() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( updateWindowCaption() ) ); } } @@ -267,9 +267,9 @@ void KHTMLImage::updateWindowCaption() if ( !renderImage ) return; - QPixmap pix = renderImage->pixmap(); + TQPixmap pix = renderImage->pixmap(); - QString caption; + TQString caption; KMimeType::Ptr mimeType; if ( !m_mimeType.isEmpty() ) @@ -296,20 +296,20 @@ void KHTMLImage::disposeImage() m_image = 0; } -bool KHTMLImage::eventFilter(QObject *, QEvent *e) { +bool KHTMLImage::eventFilter(TQObject *, TQEvent *e) { switch (e->type()) { - case QEvent::DragEnter: - case QEvent::DragMove: - case QEvent::DragLeave: - case QEvent::Drop: { + case TQEvent::DragEnter: + case TQEvent::DragMove: + case TQEvent::DragLeave: + case TQEvent::Drop: { // find out if this part is embedded in a frame, and send the // event to its outside widget KHTMLPart *p = ::qt_cast<KHTMLPart *>(parent()); if (p) - return QApplication::sendEvent(p->widget(), e); + return TQApplication::sendEvent(p->widget(), e); // otherwise simply forward all dnd events to the part widget, // konqueror will handle them properly there - return QApplication::sendEvent(widget(), e); + return TQApplication::sendEvent(widget(), e); } default: ; } diff --git a/khtml/khtmlimage.h b/khtml/khtmlimage.h index 9887c827a..dda918177 100644 --- a/khtml/khtmlimage.h +++ b/khtml/khtmlimage.h @@ -44,9 +44,9 @@ public: KHTMLImageFactory(); virtual ~KHTMLImageFactory(); - virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *className, const QStringList &args ); + virtual KParts::Part *createPartObject( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *className, const TQStringList &args ); static KInstance *instance() { return s_instance; } @@ -61,8 +61,8 @@ class KHTMLImage : public KParts::ReadOnlyPart, public khtml::CachedObjectClient { Q_OBJECT public: - KHTMLImage( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, KHTMLPart::GUIProfile prof ); + KHTMLImage( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, KHTMLPart::GUIProfile prof ); virtual ~KHTMLImage(); virtual bool openFile() { return true; } // grmbl, should be non-pure in part.h, IMHO @@ -77,7 +77,7 @@ public: protected: virtual void guiActivateEvent( KParts::GUIActivateEvent *e ); - virtual bool eventFilter( QObject *filterTarget, QEvent *e ); + virtual bool eventFilter( TQObject *filterTarget, TQEvent *e ); private slots: void restoreScrollPosition(); @@ -88,9 +88,9 @@ private slots: private: void disposeImage(); - QGuardedPtr<KHTMLPart> m_khtml; + TQGuardedPtr<KHTMLPart> m_khtml; KParts::BrowserExtension *m_ext; - QString m_mimeType; + TQString m_mimeType; khtml::CachedImage *m_image; int m_xOffset, m_yOffset; }; diff --git a/khtml/khtmlpart_p.h b/khtml/khtmlpart_p.h index ed507de89..0047dde54 100644 --- a/khtml/khtmlpart_p.h +++ b/khtml/khtmlpart_p.h @@ -37,10 +37,10 @@ #include <kwallet.h> #endif -#include <qguardedptr.h> -#include <qmap.h> -#include <qtimer.h> -#include <qvaluelist.h> +#include <tqguardedptr.h> +#include <tqmap.h> +#include <tqtimer.h> +#include <tqvaluelist.h> #include "html/html_formimpl.h" #include "khtml_run.h" @@ -78,7 +78,7 @@ namespace khtml public: enum Type { Frame, IFrame, Object }; - ChildFrame() : QObject (0L, "khtml_child_frame") { + ChildFrame() : TQObject (0L, "khtml_child_frame") { m_jscript = 0L; m_kjs_lib = 0; m_bCompleted = false; m_bPreloaded = false; m_type = Frame; m_bNotify = false; @@ -92,33 +92,33 @@ namespace khtml m_kjs_lib->unload(); } - QGuardedPtr<khtml::RenderPart> m_frame; - QGuardedPtr<KParts::ReadOnlyPart> m_part; - QGuardedPtr<KParts::BrowserExtension> m_extension; - QGuardedPtr<KParts::LiveConnectExtension> m_liveconnect; - QString m_serviceName; - QString m_serviceType; + TQGuardedPtr<khtml::RenderPart> m_frame; + TQGuardedPtr<KParts::ReadOnlyPart> m_part; + TQGuardedPtr<KParts::BrowserExtension> m_extension; + TQGuardedPtr<KParts::LiveConnectExtension> m_liveconnect; + TQString m_serviceName; + TQString m_serviceType; KJSProxy *m_jscript; KLibrary *m_kjs_lib; bool m_bCompleted; - QString m_name; + TQString m_name; KParts::URLArgs m_args; - QGuardedPtr<KHTMLRun> m_run; + TQGuardedPtr<KHTMLRun> m_run; bool m_bPreloaded; KURL m_workingURL; Type m_type; - QStringList m_params; + TQStringList m_params; bool m_bNotify; bool m_bPendingRedirection; protected slots: - void liveConnectEvent(const unsigned long, const QString&, const KParts::LiveConnectExtension::ArgList&); + void liveConnectEvent(const unsigned long, const TQString&, const KParts::LiveConnectExtension::ArgList&); }; } -struct KHTMLFrameList : public QValueList<khtml::ChildFrame*> +struct KHTMLFrameList : public TQValueList<khtml::ChildFrame*> { - Iterator find( const QString &name ) KDE_NO_EXPORT; + Iterator find( const TQString &name ) KDE_NO_EXPORT; }; typedef KHTMLFrameList::ConstIterator ConstFrameIt; @@ -131,7 +131,7 @@ class KHTMLWalletQueue : public QObject { Q_OBJECT public: - KHTMLWalletQueue(QObject *parent) : QObject(parent) { + KHTMLWalletQueue(TQObject *parent) : TQObject(parent) { #ifndef KHTML_NO_WALLET wallet = 0L; #endif // KHTML_NO_WALLET @@ -146,10 +146,10 @@ class KHTMLWalletQueue : public QObject #ifndef KHTML_NO_WALLET KWallet::Wallet *wallet; #endif // KHTML_NO_WALLET - typedef QPair<DOM::HTMLFormElementImpl*, QGuardedPtr<DOM::DocumentImpl> > Caller; - typedef QValueList<Caller> CallerList; + typedef QPair<DOM::HTMLFormElementImpl*, TQGuardedPtr<DOM::DocumentImpl> > Caller; + typedef TQValueList<Caller> CallerList; CallerList callers; - QValueList<QPair<QString, QMap<QString, QString> > > savers; + TQValueList<QPair<TQString, TQMap<TQString, TQString> > > savers; signals: void walletOpened(KWallet::Wallet*); @@ -172,7 +172,7 @@ class KHTMLWalletQueue : public QObject } } wallet->setFolder(KWallet::Wallet::FormDataFolder()); - for (QValueList<QPair<QString, QMap<QString, QString> > >::Iterator i = savers.begin(); i != savers.end(); ++i) { + for (TQValueList<QPair<TQString, TQMap<TQString, TQString> > >::Iterator i = savers.begin(); i != savers.end(); ++i) { wallet->writeMap((*i).first, (*i).second); } } @@ -188,7 +188,7 @@ class KHTMLPartPrivate KHTMLPartPrivate(const KHTMLPartPrivate & other); KHTMLPartPrivate& operator=(const KHTMLPartPrivate&); public: - KHTMLPartPrivate(QObject* parent) + KHTMLPartPrivate(TQObject* parent) { m_doc = 0L; m_decoder = 0L; @@ -303,11 +303,11 @@ public: #endif } - QGuardedPtr<khtml::ChildFrame> m_frame; + TQGuardedPtr<khtml::ChildFrame> m_frame; KHTMLFrameList m_frames; KHTMLFrameList m_objects; - QGuardedPtr<KHTMLView> m_view; + TQGuardedPtr<KHTMLView> m_view; KHTMLPartBrowserExtension *m_extension; KParts::StatusBarExtension *m_statusBarExtension; KHTMLPartBrowserHostExtension *m_hostExtension; @@ -316,14 +316,14 @@ public: KURLLabel* m_statusBarUALabel; KURLLabel* m_statusBarJSErrorLabel; KURLLabel* m_statusBarPopupLabel; - QValueList<QGuardedPtr<KHTMLPart> > m_suppressedPopupOriginParts; + TQValueList<TQGuardedPtr<KHTMLPart> > m_suppressedPopupOriginParts; int m_openableSuppressedPopups; DOM::DocumentImpl *m_doc; khtml::Decoder *m_decoder; - QString m_encoding; - QString m_sheetUsed; + TQString m_encoding; + TQString m_sheetUsed; long m_cacheId; - QString scheduledScript; + TQString scheduledScript; DOM::Node scheduledScriptNode; KWallet::Wallet* m_wallet; @@ -358,16 +358,16 @@ public: KIO::TransferJob * m_job; - QString m_statusBarText[3]; + TQString m_statusBarText[3]; unsigned long m_jobspeed; - QString m_lastModified; - QString m_httpHeaders; - QString m_pageServices; + TQString m_lastModified; + TQString m_httpHeaders; + TQString m_pageServices; // QStrings for SSL metadata // Note: When adding new variables don't forget to update ::saveState()/::restoreState()! bool m_ssl_in_use; - QString m_ssl_peer_certificate, + TQString m_ssl_peer_certificate, m_ssl_peer_chain, m_ssl_peer_ip, m_ssl_cipher, @@ -388,10 +388,10 @@ public: KURL m_workingURL; KIO::CacheControl m_cachePolicy; - QTimer m_redirectionTimer; - QTime m_parsetime; + TQTimer m_redirectionTimer; + TQTime m_parsetime; int m_delayRedirect; - QString m_redirectURL; + TQString m_redirectURL; KAction *m_paViewDocument; KAction *m_paViewFrame; @@ -420,24 +420,24 @@ public: KParts::PartManager *m_manager; - QString m_popupMenuXML; + TQString m_popupMenuXML; KHTMLPart::GUIProfile m_guiProfile; int m_zoomFactor; - QString m_strSelectedURL; - QString m_strSelectedURLTarget; - QString m_referrer; - QString m_pageReferrer; + TQString m_strSelectedURL; + TQString m_strSelectedURLTarget; + TQString m_referrer; + TQString m_pageReferrer; struct SubmitForm { const char *submitAction; - QString submitUrl; - QByteArray submitFormData; - QString target; - QString submitContentType; - QString submitBoundary; + TQString submitUrl; + TQByteArray submitFormData; + TQString target; + TQString submitContentType; + TQString submitBoundary; }; SubmitForm *m_submitForm; @@ -460,8 +460,8 @@ public: long m_endOffset; DOM::Node m_initialNode; // (Node, Offset) pair on which the long m_initialOffset; // selection has been initiated - QString m_overURL; - QString m_overURLTarget; + TQString m_overURL; + TQString m_overURLTarget; bool m_startBeforeEnd; bool m_extendAtEnd; // true if selection is to be extended at its end @@ -475,25 +475,25 @@ public: int m_focusNodeNumber; - QPoint m_dragStartPos; + TQPoint m_dragStartPos; #ifdef KHTML_NO_SELECTION - QPoint m_dragLastPos; + TQPoint m_dragLastPos; #endif bool m_designMode; bool m_caretMode; - QCursor m_linkCursor; - QTimer m_scrollTimer; + TQCursor m_linkCursor; + TQTimer m_scrollTimer; unsigned long m_loadedObjects; unsigned long m_totalObjectCount; unsigned int m_jobPercent; KHTMLPart::FormNotification m_formNotification; - QTimer m_progressUpdateTimer; + TQTimer m_progressUpdateTimer; - QStringList m_pluginPageQuestionAsked; + TQStringList m_pluginPageQuestionAsked; /////////// 'Find' feature struct StringPortion @@ -514,7 +514,7 @@ public: int index; DOM::NodeImpl *node; }; - QValueList<StringPortion> m_stringPortions; + TQValueList<StringPortion> m_stringPortions; KFind *m_find; KFindDialog *m_findDialog; @@ -522,8 +522,8 @@ public: struct findState { findState() : options( 0 ), last_dir( -1 ) {} - QStringList history; - QString text; + TQStringList history; + TQString text; int options; int last_dir; // -1=unknown,0=forward,1=backward }; @@ -541,9 +541,9 @@ public: int m_findPosStart; // pos in start node ///////// - //QGuardedPtr<KParts::Part> m_activeFrame; + //TQGuardedPtr<KParts::Part> m_activeFrame; KParts::Part * m_activeFrame; - QGuardedPtr<KHTMLPart> m_opener; + TQGuardedPtr<KHTMLPart> m_opener; bool m_openedByJS; bool m_newJSInterpreterExists; // set to 1 by setOpenedByJS, for window.open diff --git a/khtml/khtmlview.cpp b/khtml/khtmlview.cpp index 376b65cc3..1f6efd199 100644 --- a/khtml/khtmlview.cpp +++ b/khtml/khtmlview.cpp @@ -76,17 +76,17 @@ #include <kstringhandler.h> #include <kurldrag.h> -#include <qbitmap.h> -#include <qlabel.h> -#include <qobjectlist.h> -#include <qpaintdevicemetrics.h> -#include <qpainter.h> -#include <qptrdict.h> -#include <qtooltip.h> -#include <qstring.h> -#include <qstylesheet.h> -#include <qtimer.h> -#include <qvaluevector.h> +#include <tqbitmap.h> +#include <tqlabel.h> +#include <tqobjectlist.h> +#include <tqpaintdevicemetrics.h> +#include <tqpainter.h> +#include <tqptrdict.h> +#include <tqtooltip.h> +#include <tqstring.h> +#include <tqstylesheet.h> +#include <tqtimer.h> +#include <tqvaluevector.h> //#define DEBUG_NO_PAINT_BUFFER @@ -117,14 +117,14 @@ class KHTMLToolTip; class KHTMLToolTip : public QToolTip { public: - KHTMLToolTip(KHTMLView *view, KHTMLViewPrivate* vp) : QToolTip(view->viewport()) + KHTMLToolTip(KHTMLView *view, KHTMLViewPrivate* vp) : TQToolTip(view->viewport()) { m_view = view; m_viewprivate = vp; }; protected: - virtual void maybeTip(const QPoint &); + virtual void maybeTip(const TQPoint &); private: KHTMLView *m_view; @@ -158,8 +158,8 @@ public: #endif // KHTML_NO_CARET postponed_autorepeat = NULL; reset(); - vmode = QScrollView::Auto; - hmode = QScrollView::Auto; + vmode = TQScrollView::Auto; + hmode = TQScrollView::Auto; tp=0; paintBuffer=0; vertPaintBuffer=0; @@ -211,8 +211,8 @@ public: //off, then chances are they want them turned //off always - even after a reset. #else - vmode = QScrollView::AlwaysOff; - hmode = QScrollView::AlwaysOff; + vmode = TQScrollView::AlwaysOff; + hmode = TQScrollView::AlwaysOff; #endif #ifdef DEBUG_PIXEL timer.start(); @@ -245,7 +245,7 @@ public: dirtyLayout = false; layoutSchedulingEnabled = true; painting = false; - updateRegion = QRegion(); + updateRegion = TQRegion(); m_dialogsAllowed = true; #ifndef KHTML_NO_CARET if (m_caretViewContext) { @@ -266,7 +266,7 @@ public: emitCompletedAfterRepaint = CSNone; } - void newScrollTimer(QWidget *view, int tid) + void newScrollTimer(TQWidget *view, int tid) { //kdDebug(6000) << "newScrollTimer timer " << tid << endl; view->killTimer(scrollTimerId); @@ -275,7 +275,7 @@ public: } enum ScrollDirection { ScrollLeft, ScrollRight, ScrollUp, ScrollDown }; - void adjustScroller(QWidget *view, ScrollDirection direction, ScrollDirection oppositedir) + void adjustScroller(TQWidget *view, ScrollDirection direction, ScrollDirection oppositedir) { static const struct { int msec, pixels; } timings [] = { {320,1}, {224,1}, {160,1}, {112,1}, {80,1}, {56,1}, {40,1}, @@ -319,14 +319,14 @@ public: #endif // KHTML_NO_CARET #ifdef DEBUG_PIXEL - QTime timer; + TQTime timer; unsigned int pixelbooth; unsigned int repaintbooth; #endif - QPainter *tp; - QPixmap *paintBuffer; - QPixmap *vertPaintBuffer; + TQPainter *tp; + TQPixmap *paintBuffer; + TQPixmap *vertPaintBuffer; NodeImpl *underMouse; NodeImpl *underMouseNonShared; @@ -336,8 +336,8 @@ public: bool scrollBarMoved:1; bool contentsMoving:1; - QScrollView::ScrollBarMode vmode; - QScrollView::ScrollBarMode hmode; + TQScrollView::ScrollBarMode vmode; + TQScrollView::ScrollBarMode hmode; bool prevScrollbarVisible:1; bool linkPressed:1; bool useSlowRepaints:1; @@ -354,7 +354,7 @@ public: int prevMouseX, prevMouseY; bool scrollingSelf; int layoutTimerId; - QKeyEvent* postponed_autorepeat; + TQKeyEvent* postponed_autorepeat; int repaintTimerId; int scrollTimerId; @@ -371,16 +371,16 @@ public: bool possibleTripleClick :1; bool dirtyLayout :1; bool m_dialogsAllowed :1; - QRegion updateRegion; + TQRegion updateRegion; KHTMLToolTip *tooltip; - QPtrDict<QWidget> visibleWidgets; + TQPtrDict<TQWidget> visibleWidgets; #ifndef KHTML_NO_CARET CaretViewContext *m_caretViewContext; EditorContext *m_editorContext; #endif // KHTML_NO_CARET #ifndef KHTML_NO_TYPE_AHEAD_FIND - QString findString; - QTimer timer; + TQString findString; + TQTimer timer; bool findLinksOnly; bool typeAheadActivated; #endif // KHTML_NO_TYPE_AHEAD_FIND @@ -389,13 +389,13 @@ public: bool accessKeysPreActivate; CompletedState emitCompletedAfterRepaint; - QWidget* cursor_icon_widget; + TQWidget* cursor_icon_widget; // scrolling activated by MMB short m_mouseScroll_byX; short m_mouseScroll_byY; - QTimer *m_mouseScrollTimer; - QWidget *m_mouseScrollIndicator; + TQTimer *m_mouseScrollTimer; + TQWidget *m_mouseScrollIndicator; }; #ifndef QT_NO_TOOLTIP @@ -409,8 +409,8 @@ public: * @return true if an appropriate area was found -- only in this case r and * s are valid, false otherwise */ -static bool findImageMapRect(HTMLImageElementImpl *img, const QPoint &scrollOfs, - const QPoint &p, QRect &r, QString &s) +static bool findImageMapRect(HTMLImageElementImpl *img, const TQPoint &scrollOfs, + const TQPoint &p, TQRect &r, TQString &s) { HTMLMapElementImpl* map; if (img && img->getDocument()->isHTMLDocument() && @@ -428,7 +428,7 @@ static bool findImageMapRect(HTMLImageElementImpl *img, const QPoint &scrollOfs, HTMLAreaElementImpl *area = static_cast<HTMLAreaElementImpl *>(info.URLElement()); Q_ASSERT(area->id() == ID_AREA); s = area->getAttribute(ATTR_TITLE).string(); - QRegion reg = area->cachedRegion(); + TQRegion reg = area->cachedRegion(); if (!s.isEmpty() && !reg.isEmpty()) { r = reg.boundingRect(); r.moveBy(ax, ay); @@ -439,29 +439,29 @@ static bool findImageMapRect(HTMLImageElementImpl *img, const QPoint &scrollOfs, return false; } -void KHTMLToolTip::maybeTip(const QPoint& p) +void KHTMLToolTip::maybeTip(const TQPoint& p) { DOM::NodeImpl *node = m_viewprivate->underMouseNonShared; - QRect region; + TQRect region; while ( node ) { if ( node->isElementNode() ) { DOM::ElementImpl *e = static_cast<DOM::ElementImpl*>( node ); - QRect r; - QString s; + TQRect r; + TQString s; bool found = false; // for images, check if it is part of a client-side image map, // and query the <area>s' title attributes, too if (e->id() == ID_IMG && !e->getAttribute( ATTR_USEMAP ).isEmpty()) { found = findImageMapRect(static_cast<HTMLImageElementImpl *>(e), - m_view->viewportToContents(QPoint(0, 0)), p, r, s); + m_view->viewportToContents(TQPoint(0, 0)), p, r, s); } if (!found) { s = e->getAttribute( ATTR_TITLE ).string(); r = node->getRect(); } - region |= QRect( m_view->contentsToViewport( r.topLeft() ), r.size() ); + region |= TQRect( m_view->contentsToViewport( r.topLeft() ), r.size() ); if ( !s.isEmpty() ) { - tip( region, QStyleSheet::convertFromPlainText( s, QStyleSheetItem::WhiteSpaceNormal ) ); + tip( region, TQStyleSheet::convertFromPlainText( s, TQStyleSheetItem::WhiteSpaceNormal ) ); break; } } @@ -470,22 +470,22 @@ void KHTMLToolTip::maybeTip(const QPoint& p) } #endif -KHTMLView::KHTMLView( KHTMLPart *part, QWidget *parent, const char *name) - : QScrollView( parent, name, WResizeNoErase | WRepaintNoErase ) +KHTMLView::KHTMLView( KHTMLPart *part, TQWidget *parent, const char *name) + : TQScrollView( parent, name, WResizeNoErase | WRepaintNoErase ) { m_medium = "screen"; m_part = part; d = new KHTMLViewPrivate; - QScrollView::setVScrollBarMode(d->vmode); - QScrollView::setHScrollBarMode(d->hmode); - connect(kapp, SIGNAL(kdisplayPaletteChanged()), this, SLOT(slotPaletteChanged())); - connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(slotScrollBarMoved())); + TQScrollView::setVScrollBarMode(d->vmode); + TQScrollView::setHScrollBarMode(d->hmode); + connect(kapp, TQT_SIGNAL(kdisplayPaletteChanged()), this, TQT_SLOT(slotPaletteChanged())); + connect(this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(slotScrollBarMoved())); // initialize QScrollView enableClipper(true); // hack to get unclipped painting on the viewport. - static_cast<KHTMLView *>(static_cast<QWidget *>(viewport()))->setWFlags(WPaintUnclipped); + static_cast<KHTMLView *>(static_cast<TQWidget *>(viewport()))->setWFlags(WPaintUnclipped); setResizePolicy(Manual); viewport()->setMouseTracking(true); @@ -498,7 +498,7 @@ KHTMLView::KHTMLView( KHTMLPart *part, QWidget *parent, const char *name) #endif #ifndef KHTML_NO_TYPE_AHEAD_FIND - connect(&d->timer, SIGNAL(timeout()), this, SLOT(findTimeout())); + connect(&d->timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(findTimeout())); #endif // KHTML_NO_TYPE_AHEAD_FIND init(); @@ -522,12 +522,12 @@ KHTMLView::~KHTMLView() void KHTMLView::init() { - if(!d->paintBuffer) d->paintBuffer = new QPixmap(PAINT_BUFFER_HEIGHT, PAINT_BUFFER_HEIGHT); + if(!d->paintBuffer) d->paintBuffer = new TQPixmap(PAINT_BUFFER_HEIGHT, PAINT_BUFFER_HEIGHT); if(!d->vertPaintBuffer) - d->vertPaintBuffer = new QPixmap(10, PAINT_BUFFER_HEIGHT); - if(!d->tp) d->tp = new QPainter(); + d->vertPaintBuffer = new TQPixmap(10, PAINT_BUFFER_HEIGHT); + if(!d->tp) d->tp = new TQPainter(); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); viewport()->setFocusProxy(this); _marginWidth = -1; // undefined @@ -538,7 +538,7 @@ void KHTMLView::init() installEventFilter(this); setAcceptDrops(true); - QSize s = viewportSize(4095, 4095); + TQSize s = viewportSize(4095, 4095); resizeContents(s.width(), s.height()); } @@ -563,27 +563,27 @@ void KHTMLView::clear() killTimers(); emit cleared(); - QScrollView::setHScrollBarMode(d->hmode); - QScrollView::setVScrollBarMode(d->vmode); + TQScrollView::setHScrollBarMode(d->hmode); + TQScrollView::setVScrollBarMode(d->vmode); verticalScrollBar()->setEnabled( false ); horizontalScrollBar()->setEnabled( false ); } -void KHTMLView::hideEvent(QHideEvent* e) +void KHTMLView::hideEvent(TQHideEvent* e) { - QScrollView::hideEvent(e); + TQScrollView::hideEvent(e); if ( m_part && m_part->xmlDocImpl() ) m_part->xmlDocImpl()->docLoader()->pauseAnimations(); } -void KHTMLView::showEvent(QShowEvent* e) +void KHTMLView::showEvent(TQShowEvent* e) { - QScrollView::showEvent(e); + TQScrollView::showEvent(e); if ( m_part && m_part->xmlDocImpl() ) m_part->xmlDocImpl()->docLoader()->resumeAnimations(); } -void KHTMLView::resizeEvent (QResizeEvent* e) +void KHTMLView::resizeEvent (TQResizeEvent* e) { int dw = e->oldSize().width() - e->size().width(); int dh = e->oldSize().height() - e->size().height(); @@ -595,15 +595,15 @@ void KHTMLView::resizeEvent (QResizeEvent* e) resizeContents(dw, dh); - QScrollView::resizeEvent(e); + TQScrollView::resizeEvent(e); if ( m_part && m_part->xmlDocImpl() ) m_part->xmlDocImpl()->dispatchWindowEvent( EventImpl::RESIZE_EVENT, false, false ); } -void KHTMLView::viewportResizeEvent (QResizeEvent* e) +void KHTMLView::viewportResizeEvent (TQResizeEvent* e) { - QScrollView::viewportResizeEvent(e); + TQScrollView::viewportResizeEvent(e); //int w = visibleWidth(); //int h = visibleHeight(); @@ -618,15 +618,15 @@ void KHTMLView::viewportResizeEvent (QResizeEvent* e) }/*end if*/ #endif - KApplication::sendPostedEvents(viewport(), QEvent::Paint); + KApplication::sendPostedEvents(viewport(), TQEvent::Paint); } // this is to get rid of a compiler virtual overload mismatch warning. do not remove -void KHTMLView::drawContents( QPainter*) +void KHTMLView::drawContents( TQPainter*) { } -void KHTMLView::drawContents( QPainter *p, int ex, int ey, int ew, int eh ) +void KHTMLView::drawContents( TQPainter *p, int ex, int ey, int ew, int eh ) { #ifdef DEBUG_PIXEL @@ -643,7 +643,7 @@ void KHTMLView::drawContents( QPainter *p, int ex, int ey, int ew, int eh ) //kdDebug( 6000 ) << "drawContents this="<< this <<" x=" << ex << ",y=" << ey << ",w=" << ew << ",h=" << eh << endl; if(!m_part || !m_part->xmlDocImpl() || !m_part->xmlDocImpl()->renderer()) { - p->fillRect(ex, ey, ew, eh, palette().active().brush(QColorGroup::Base)); + p->fillRect(ex, ey, ew, eh, palette().active().brush(TQColorGroup::Base)); return; } else if ( d->complete && static_cast<RenderCanvas*>(m_part->xmlDocImpl()->renderer())->needsLayout() ) { // an external update request happens while we have a layout scheduled @@ -657,12 +657,12 @@ void KHTMLView::drawContents( QPainter *p, int ex, int ey, int ew, int eh ) } d->painting = true; - QPoint pt = contentsToViewport(QPoint(ex, ey)); - QRegion cr = QRect(pt.x(), pt.y(), ew, eh); + TQPoint pt = contentsToViewport(TQPoint(ex, ey)); + TQRegion cr = TQRect(pt.x(), pt.y(), ew, eh); - // kdDebug(6000) << "clip rect: " << QRect(pt.x(), pt.y(), ew, eh) << endl; - for (QPtrDictIterator<QWidget> it(d->visibleWidgets); it.current(); ++it) { - QWidget *w = it.current(); + // kdDebug(6000) << "clip rect: " << TQRect(pt.x(), pt.y(), ew, eh) << endl; + for (TQPtrDictIterator<TQWidget> it(d->visibleWidgets); it.current(); ++it) { + TQWidget *w = it.current(); RenderWidget* rw = static_cast<RenderWidget*>( it.currentKey() ); if (w && rw && !rw->isKHTMLWidget()) { int x, y; @@ -670,19 +670,19 @@ void KHTMLView::drawContents( QPainter *p, int ex, int ey, int ew, int eh ) contentsToViewport(x, y, x, y); int pbx = rw->borderLeft()+rw->paddingLeft(); int pby = rw->borderTop()+rw->paddingTop(); - QRect g = QRect(x+pbx, y+pby, + TQRect g = TQRect(x+pbx, y+pby, rw->width()-pbx-rw->borderRight()-rw->paddingRight(), rw->height()-pby-rw->borderBottom()-rw->paddingBottom()); if ( !rw->isFrame() && ((g.top() > pt.y()+eh) || (g.bottom() <= pt.y()) || (g.right() <= pt.x()) || (g.left() > pt.x()+ew) )) continue; RenderLayer* rl = rw->needsMask() ? rw->enclosingStackingContext() : 0; - QRegion mask = rl ? rl->getMask() : QRegion(); + TQRegion mask = rl ? rl->getMask() : TQRegion(); if (!mask.isNull()) { - QPoint o(0,0); + TQPoint o(0,0); o = contentsToViewport(o); mask.translate(o.x(),o.y()); - mask = mask.intersect( QRect(g.x(),g.y(),g.width(),g.height()) ); + mask = mask.intersect( TQRect(g.x(),g.y(),g.width(),g.height()) ); cr -= mask; } else { cr -= g; @@ -707,8 +707,8 @@ void KHTMLView::drawContents( QPainter *p, int ex, int ey, int ew, int eh ) d->vertPaintBuffer->resize(10, visibleHeight()); d->tp->begin(d->vertPaintBuffer); d->tp->translate(-ex, -ey); - d->tp->fillRect(ex, ey, ew, eh, palette().active().brush(QColorGroup::Base)); - m_part->xmlDocImpl()->renderer()->layer()->paint(d->tp, QRect(ex, ey, ew, eh)); + d->tp->fillRect(ex, ey, ew, eh, palette().active().brush(TQColorGroup::Base)); + m_part->xmlDocImpl()->renderer()->layer()->paint(d->tp, TQRect(ex, ey, ew, eh)); d->tp->end(); p->drawPixmap(ex, ey, *d->vertPaintBuffer, 0, 0, ew, eh); } @@ -721,8 +721,8 @@ void KHTMLView::drawContents( QPainter *p, int ex, int ey, int ew, int eh ) int ph = eh-py < PAINT_BUFFER_HEIGHT ? eh-py : PAINT_BUFFER_HEIGHT; d->tp->begin(d->paintBuffer); d->tp->translate(-ex, -ey-py); - d->tp->fillRect(ex, ey+py, ew, ph, palette().active().brush(QColorGroup::Base)); - m_part->xmlDocImpl()->renderer()->layer()->paint(d->tp, QRect(ex, ey+py, ew, ph)); + d->tp->fillRect(ex, ey+py, ew, ph, palette().active().brush(TQColorGroup::Base)); + m_part->xmlDocImpl()->renderer()->layer()->paint(d->tp, TQRect(ex, ey+py, ew, ph)); d->tp->end(); p->drawPixmap(ex, ey+py, *d->paintBuffer, 0, 0, ew, ph); @@ -733,19 +733,19 @@ void KHTMLView::drawContents( QPainter *p, int ex, int ey, int ew, int eh ) static int cnt=0; ex = contentsX(); ey = contentsY(); ew = visibleWidth(); eh = visibleHeight(); - QRect pr(ex,ey,ew,eh); + TQRect pr(ex,ey,ew,eh); kdDebug() << "[" << ++cnt << "]" << " clip region: " << pr << endl; -// p->setClipRegion(QRect(0,0,ew,eh)); +// p->setClipRegion(TQRect(0,0,ew,eh)); // p->translate(-ex, -ey); - p->fillRect(ex, ey, ew, eh, palette().active().brush(QColorGroup::Base)); + p->fillRect(ex, ey, ew, eh, palette().active().brush(TQColorGroup::Base)); m_part->xmlDocImpl()->renderer()->layer()->paint(p, pr); #endif // DEBUG_NO_PAINT_BUFFER #ifndef KHTML_NO_CARET if (d->m_caretViewContext && d->m_caretViewContext->visible) { - QRect pos(d->m_caretViewContext->x, d->m_caretViewContext->y, + TQRect pos(d->m_caretViewContext->x, d->m_caretViewContext->y, d->m_caretViewContext->width, d->m_caretViewContext->height); - if (pos.intersects(QRect(ex, ey, ew, eh))) { + if (pos.intersects(TQRect(ex, ey, ew, eh))) { p->setRasterOp(XorROP); p->setPen(white); if (pos.width() == 1) @@ -757,11 +757,11 @@ static int cnt=0; }/*end if*/ #endif // KHTML_NO_CARET -// p->setPen(QPen(magenta,0,DashDotDotLine)); +// p->setPen(TQPen(magenta,0,DashDotDotLine)); // p->drawRect(dbg_paint_rect); khtml::DrawContentsEvent event( p, ex, ey, ew, eh ); - QApplication::sendEvent( m_part, &event ); + TQApplication::sendEvent( m_part, &event ); d->painting = false; } @@ -795,8 +795,8 @@ void KHTMLView::layout() if (document->isHTMLDocument()) { NodeImpl *body = static_cast<HTMLDocumentImpl*>(document)->body(); if(body && body->renderer() && body->id() == ID_FRAMESET) { - QScrollView::setVScrollBarMode(AlwaysOff); - QScrollView::setHScrollBarMode(AlwaysOff); + TQScrollView::setVScrollBarMode(AlwaysOff); + TQScrollView::setHScrollBarMode(AlwaysOff); body->renderer()->setNeedsLayout(true); // if (d->tooltip) { // delete d->tooltip; @@ -815,17 +815,17 @@ void KHTMLView::layout() } if (ref) { if( ref->style()->overflowX() == OHIDDEN ) { - if (d->hmode == Auto) QScrollView::setHScrollBarMode(AlwaysOff); + if (d->hmode == Auto) TQScrollView::setHScrollBarMode(AlwaysOff); } else if (ref->style()->overflowX() == OSCROLL ) { - if (d->hmode == Auto) QScrollView::setHScrollBarMode(AlwaysOn); + if (d->hmode == Auto) TQScrollView::setHScrollBarMode(AlwaysOn); } else { - if (QScrollView::hScrollBarMode() == AlwaysOff) QScrollView::setHScrollBarMode(d->hmode); + if (TQScrollView::hScrollBarMode() == AlwaysOff) TQScrollView::setHScrollBarMode(d->hmode); } if ( ref->style()->overflowY() == OHIDDEN ) { - if (d->vmode == Auto) QScrollView::setVScrollBarMode(AlwaysOff); + if (d->vmode == Auto) TQScrollView::setVScrollBarMode(AlwaysOff); } else if (ref->style()->overflowY() == OSCROLL ) { - if (d->vmode == Auto) QScrollView::setVScrollBarMode(AlwaysOn); + if (d->vmode == Auto) TQScrollView::setVScrollBarMode(AlwaysOn); } else { - if (QScrollView::vScrollBarMode() == AlwaysOff) QScrollView::setVScrollBarMode(d->vmode); + if (TQScrollView::vScrollBarMode() == AlwaysOff) TQScrollView::setVScrollBarMode(d->vmode); } } d->needsFullRepaint = d->firstRelayout; @@ -834,7 +834,7 @@ void KHTMLView::layout() _height = visibleHeight(); _width = visibleWidth(); } - //QTime qt; + //TQTime qt; //qt.start(); canvas->layout(); @@ -878,22 +878,22 @@ void KHTMLView::layout() void KHTMLView::closeChildDialogs() { - QObjectList *dlgs = queryList("QDialog"); - for (QObject *dlg = dlgs->first(); dlg; dlg = dlgs->next()) + TQObjectList *dlgs = queryList("TQDialog"); + for (TQObject *dlg = dlgs->first(); dlg; dlg = dlgs->next()) { KDialogBase* dlgbase = dynamic_cast<KDialogBase *>( dlg ); if ( dlgbase ) { if ( dlgbase->testWFlags( WShowModal ) ) { kdDebug(6000) << "closeChildDialogs: closing dialog " << dlgbase << endl; - // close() ends up calling QButton::animateClick, which isn't immediate + // close() ends up calling TQButton::animateClick, which isn't immediate // we need something the exits the event loop immediately (#49068) dlgbase->cancel(); } } else { - kdWarning() << "closeChildDialogs: not a KDialogBase! Don't use QDialogs in KDE! " << static_cast<QWidget*>(dlg) << endl; - static_cast<QWidget*>(dlg)->hide(); + kdWarning() << "closeChildDialogs: not a KDialogBase! Don't use QDialogs in KDE! " << static_cast<TQWidget*>(dlg) << endl; + static_cast<TQWidget*>(dlg)->hide(); } } delete dlgs; @@ -908,10 +908,10 @@ bool KHTMLView::dialogsAllowed() { return allowed; } -void KHTMLView::closeEvent( QCloseEvent* ev ) +void KHTMLView::closeEvent( TQCloseEvent* ev ) { closeChildDialogs(); - QScrollView::closeEvent( ev ); + TQScrollView::closeEvent( ev ); } // @@ -919,7 +919,7 @@ void KHTMLView::closeEvent( QCloseEvent* ev ) // ///////////////// -void KHTMLView::viewportMousePressEvent( QMouseEvent *_mouse ) +void KHTMLView::viewportMousePressEvent( TQMouseEvent *_mouse ) { if (!m_part->xmlDocImpl()) return; if (d->possibleTripleClick && ( _mouse->button() & MouseButtonMask ) == LeftButton) @@ -942,20 +942,20 @@ void KHTMLView::viewportMousePressEvent( QMouseEvent *_mouse ) if ( (_mouse->button() == MidButton) && !m_part->d->m_bOpenMiddleClick && !d->m_mouseScrollTimer && mev.url.isNull() && (mev.innerNode.elementId() != ID_INPUT) ) { - QPoint point = mapFromGlobal( _mouse->globalPos() ); + TQPoint point = mapFromGlobal( _mouse->globalPos() ); d->m_mouseScroll_byX = 0; d->m_mouseScroll_byY = 0; - d->m_mouseScrollTimer = new QTimer( this ); - connect( d->m_mouseScrollTimer, SIGNAL(timeout()), this, SLOT(slotMouseScrollTimer()) ); + d->m_mouseScrollTimer = new TQTimer( this ); + connect( d->m_mouseScrollTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotMouseScrollTimer()) ); if ( !d->m_mouseScrollIndicator ) { - QPixmap pixmap, icon; + TQPixmap pixmap, icon; pixmap.resize( 48, 48 ); - pixmap.fill( QColor( qRgba( 127, 127, 127, 127 ) ) ); + pixmap.fill( TQColor( qRgba( 127, 127, 127, 127 ) ) ); - QPainter p( &pixmap ); + TQPainter p( &pixmap ); icon = KGlobal::iconLoader()->loadIcon( "1uparrow", KIcon::Small ); p.drawPixmap( 16, 0, icon ); icon = KGlobal::iconLoader()->loadIcon( "1leftarrow", KIcon::Small ); @@ -966,7 +966,7 @@ void KHTMLView::viewportMousePressEvent( QMouseEvent *_mouse ) p.drawPixmap( 32, 16, icon ); p.drawEllipse( 23, 23, 2, 2 ); - d->m_mouseScrollIndicator = new QWidget( this, 0 ); + d->m_mouseScrollIndicator = new TQWidget( this, 0 ); d->m_mouseScrollIndicator->setFixedSize( 48, 48 ); d->m_mouseScrollIndicator->setPaletteBackgroundPixmap( pixmap ); } @@ -981,16 +981,16 @@ void KHTMLView::viewportMousePressEvent( QMouseEvent *_mouse ) d->m_mouseScrollIndicator->show(); d->m_mouseScrollIndicator->unsetCursor(); - QBitmap mask = d->m_mouseScrollIndicator->paletteBackgroundPixmap()->createHeuristicMask( true ); + TQBitmap mask = d->m_mouseScrollIndicator->paletteBackgroundPixmap()->createHeuristicMask( true ); if ( hasHorBar && !hasVerBar ) { - QBitmap bm( 16, 16, true ); + TQBitmap bm( 16, 16, true ); bitBlt( &mask, 16, 0, &bm, 0, 0, -1, -1 ); bitBlt( &mask, 16, 32, &bm, 0, 0, -1, -1 ); d->m_mouseScrollIndicator->setCursor( KCursor::SizeHorCursor ); } else if ( !hasHorBar && hasVerBar ) { - QBitmap bm( 16, 16, true ); + TQBitmap bm( 16, 16, true ); bitBlt( &mask, 0, 16, &bm, 0, 0, -1, -1 ); bitBlt( &mask, 32, 16, &bm, 0, 0, -1, -1 ); d->m_mouseScrollIndicator->setCursor( KCursor::SizeVerCursor ); @@ -1034,12 +1034,12 @@ void KHTMLView::viewportMousePressEvent( QMouseEvent *_mouse ) emit m_part->nodeActivated(mev.innerNode); khtml::MousePressEvent event( _mouse, xm, ym, mev.url, mev.target, mev.innerNode ); - QApplication::sendEvent( m_part, &event ); + TQApplication::sendEvent( m_part, &event ); // we might be deleted after this } } -void KHTMLView::viewportMouseDoubleClickEvent( QMouseEvent *_mouse ) +void KHTMLView::viewportMouseDoubleClickEvent( TQMouseEvent *_mouse ) { if(!m_part->xmlDocImpl()) return; @@ -1056,7 +1056,7 @@ void KHTMLView::viewportMouseDoubleClickEvent( QMouseEvent *_mouse ) // We do the same thing as viewportMousePressEvent() here, since the DOM does not treat // single and double-click events as separate (only the detail, i.e. number of clicks differs) if (d->clickCount > 0 && - QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= QApplication::startDragDistance()) + TQPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= TQApplication::startDragDistance()) d->clickCount++; else { // shouldn't happen, if Qt has the same criterias for double clicks. d->clickCount = 1; @@ -1072,11 +1072,11 @@ void KHTMLView::viewportMouseDoubleClickEvent( QMouseEvent *_mouse ) if (!swallowEvent) { khtml::MouseDoubleClickEvent event( _mouse, xm, ym, mev.url, mev.target, mev.innerNode, d->clickCount ); - QApplication::sendEvent( m_part, &event ); + TQApplication::sendEvent( m_part, &event ); } d->possibleTripleClick=true; - QTimer::singleShot(QApplication::doubleClickInterval(),this,SLOT(tripleClickTimeout())); + TQTimer::singleShot(TQApplication::doubleClickInterval(),this,TQT_SLOT(tripleClickTimeout())); } void KHTMLView::tripleClickTimeout() @@ -1085,23 +1085,23 @@ void KHTMLView::tripleClickTimeout() d->clickCount = 0; } -static inline void forwardPeripheralEvent(khtml::RenderWidget* r, QMouseEvent* me, int x, int y) +static inline void forwardPeripheralEvent(khtml::RenderWidget* r, TQMouseEvent* me, int x, int y) { int absx = 0; int absy = 0; r->absolutePosition(absx, absy); - QPoint p(x-absx, y-absy); - QMouseEvent fw(me->type(), p, me->button(), me->state()); - QWidget* w = r->widget(); - QScrollView* sc = ::qt_cast<QScrollView*>(w); - if (sc && !::qt_cast<QListBox*>(w)) + TQPoint p(x-absx, y-absy); + TQMouseEvent fw(me->type(), p, me->button(), me->state()); + TQWidget* w = r->widget(); + TQScrollView* sc = ::qt_cast<TQScrollView*>(w); + if (sc && !::qt_cast<TQListBox*>(w)) static_cast<khtml::RenderWidget::ScrollViewEventPropagator*>(sc)->sendEvent(&fw); else if(w) static_cast<khtml::RenderWidget::EventPropagator*>(w)->sendEvent(&fw); } -static bool targetOpensNewWindow(KHTMLPart *part, QString target) +static bool targetOpensNewWindow(KHTMLPart *part, TQString target) { if (!target.isEmpty() && (target.lower() != "_top") && (target.lower() != "_self") && (target.lower() != "_parent")) { @@ -1117,10 +1117,10 @@ static bool targetOpensNewWindow(KHTMLPart *part, QString target) return false; } -void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse ) +void KHTMLView::viewportMouseMoveEvent( TQMouseEvent * _mouse ) { if ( d->m_mouseScrollTimer ) { - QPoint point = mapFromGlobal( _mouse->globalPos() ); + TQPoint point = mapFromGlobal( _mouse->globalPos() ); int deltaX = point.x() - d->m_mouseScrollIndicator->x() - 24; int deltaY = point.y() - d->m_mouseScrollIndicator->y() - 24; @@ -1159,7 +1159,7 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse ) 0,_mouse,true,DOM::NodeImpl::MouseMove); if (d->clickCount > 0 && - QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() > QApplication::startDragDistance()) { + TQPoint(d->clickX-xm,d->clickY-ym).manhattanLength() > TQApplication::startDragDistance()) { d->clickCount = 0; // moving the mouse outside the threshold invalidates the click } @@ -1174,7 +1174,7 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse ) khtml::RenderObject* r = mev.innerNode.handle() ? mev.innerNode.handle()->renderer() : 0; khtml::RenderStyle* style = (r && r->style()) ? r->style() : 0; - QCursor c; + TQCursor c; bool mailtoCursor = false; bool newWindowCursor = false; switch ( style ? style->cursor() : CURSOR_AUTO) { @@ -1190,7 +1190,7 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse ) } if (r && r->isFrameSet() && !static_cast<RenderFrameSet*>(r)->noResize()) - c = QCursor(static_cast<RenderFrameSet*>(r)->cursorShape()); + c = TQCursor(static_cast<RenderFrameSet*>(r)->cursorShape()); break; case CURSOR_CROSS: @@ -1250,10 +1250,10 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse ) if ( ( mailtoCursor || newWindowCursor ) && isVisible() && hasFocus() ) { #ifdef Q_WS_X11 - QPixmap icon_pixmap = KGlobal::iconLoader()->loadIcon( mailtoCursor ? "mail_generic" : "window_new", KIcon::Small, 0, KIcon::DefaultState, 0, true ); + TQPixmap icon_pixmap = KGlobal::iconLoader()->loadIcon( mailtoCursor ? "mail_generic" : "window_new", KIcon::Small, 0, KIcon::DefaultState, 0, true ); if (d->cursor_icon_widget) { - const QPixmap *pm = d->cursor_icon_widget->backgroundPixmap(); + const TQPixmap *pm = d->cursor_icon_widget->backgroundPixmap(); if (!pm || pm->serialNumber()!=icon_pixmap.serialNumber()) { delete d->cursor_icon_widget; d->cursor_icon_widget = 0; @@ -1261,7 +1261,7 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse ) } if( !d->cursor_icon_widget ) { - d->cursor_icon_widget = new QWidget( NULL, NULL, WX11BypassWM ); + d->cursor_icon_widget = new TQWidget( NULL, NULL, WX11BypassWM ); XSetWindowAttributes attr; attr.save_under = True; XChangeWindowAttributes( qt_xdisplay(), d->cursor_icon_widget->winId(), CWSaveUnder, &attr ); @@ -1273,10 +1273,10 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse ) d->cursor_icon_widget->setBackgroundPixmap( icon_pixmap ); d->cursor_icon_widget->erase(); } - QPoint c_pos = QCursor::pos(); + TQPoint c_pos = TQCursor::pos(); d->cursor_icon_widget->move( c_pos.x() + 15, c_pos.y() + 15 ); XRaiseWindow( qt_xdisplay(), d->cursor_icon_widget->winId()); - QApplication::flushX(); + TQApplication::flushX(); d->cursor_icon_widget->show(); #endif } @@ -1293,11 +1293,11 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse ) if (!swallowEvent) { khtml::MouseMoveEvent event( _mouse, xm, ym, mev.url, mev.target, mev.innerNode ); - QApplication::sendEvent( m_part, &event ); + TQApplication::sendEvent( m_part, &event ); } } -void KHTMLView::viewportMouseReleaseEvent( QMouseEvent * _mouse ) +void KHTMLView::viewportMouseReleaseEvent( TQMouseEvent * _mouse ) { bool swallowEvent = false; int xm, ym; @@ -1312,8 +1312,8 @@ void KHTMLView::viewportMouseReleaseEvent( QMouseEvent * _mouse ) d->clickCount,_mouse,false,DOM::NodeImpl::MouseRelease); if (d->clickCount > 0 && - QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= QApplication::startDragDistance()) { - QMouseEvent me(d->isDoubleClick ? QEvent::MouseButtonDblClick : QEvent::MouseButtonRelease, + TQPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= TQApplication::startDragDistance()) { + TQMouseEvent me(d->isDoubleClick ? TQEvent::MouseButtonDblClick : TQEvent::MouseButtonRelease, _mouse->pos(), _mouse->button(), _mouse->state()); dispatchMouseEvent(EventImpl::CLICK_EVENT, mev.innerNode.handle(),mev.innerNonSharedNode.handle(),true, d->clickCount, &me, true, DOM::NodeImpl::MouseRelease); @@ -1333,12 +1333,12 @@ void KHTMLView::viewportMouseReleaseEvent( QMouseEvent * _mouse ) if (!swallowEvent) { khtml::MouseReleaseEvent event( _mouse, xm, ym, mev.url, mev.target, mev.innerNode ); - QApplication::sendEvent( m_part, &event ); + TQApplication::sendEvent( m_part, &event ); } } // returns true if event should be swallowed -bool KHTMLView::dispatchKeyEvent( QKeyEvent *_ke ) +bool KHTMLView::dispatchKeyEvent( TQKeyEvent *_ke ) { if (!m_part->xmlDocImpl()) return false; @@ -1367,7 +1367,7 @@ bool KHTMLView::dispatchKeyEvent( QKeyEvent *_ke ) return false; } - if( _ke->type() == QEvent::KeyPress ) + if( _ke->type() == TQEvent::KeyPress ) { if( !_ke->isAutoRepeat()) { @@ -1387,10 +1387,10 @@ bool KHTMLView::dispatchKeyEvent( QKeyEvent *_ke ) return ret; } } - else // QEvent::KeyRelease + else // TQEvent::KeyRelease { // Discard postponed "autorepeat key-release" events that didn't see - // a keypress after them (e.g. due to QAccel) + // a keypress after them (e.g. due to TQAccel) if ( d->postponed_autorepeat ) { delete d->postponed_autorepeat; d->postponed_autorepeat = 0; @@ -1401,7 +1401,7 @@ bool KHTMLView::dispatchKeyEvent( QKeyEvent *_ke ) } else { - d->postponed_autorepeat = new QKeyEvent( _ke->type(), _ke->key(), _ke->ascii(), _ke->state(), + d->postponed_autorepeat = new TQKeyEvent( _ke->type(), _ke->key(), _ke->ascii(), _ke->state(), _ke->text(), _ke->isAutoRepeat(), _ke->count()); if( _ke->isAccepted()) d->postponed_autorepeat->accept(); @@ -1413,7 +1413,7 @@ bool KHTMLView::dispatchKeyEvent( QKeyEvent *_ke ) } // returns true if event should be swallowed -bool KHTMLView::dispatchKeyEventHelper( QKeyEvent *_ke, bool keypress ) +bool KHTMLView::dispatchKeyEventHelper( TQKeyEvent *_ke, bool keypress ) { DOM::NodeImpl* keyNode = m_part->xmlDocImpl()->focusNode(); if (keyNode) { @@ -1423,7 +1423,7 @@ bool KHTMLView::dispatchKeyEventHelper( QKeyEvent *_ke, bool keypress ) } } -void KHTMLView::keyPressEvent( QKeyEvent *_ke ) +void KHTMLView::keyPressEvent( TQKeyEvent *_ke ) { #ifndef KHTML_NO_TYPE_AHEAD_FIND if(d->typeAheadActivated) @@ -1652,7 +1652,7 @@ void KHTMLView::startFindAhead( bool linksOnly ) void KHTMLView::findAhead(bool increase) { - QString status; + TQString status; if(d->findLinksOnly) { @@ -1694,7 +1694,7 @@ void KHTMLView::updateFindAheadTimeout() #endif // KHTML_NO_TYPE_AHEAD_FIND -void KHTMLView::keyReleaseEvent(QKeyEvent *_ke) +void KHTMLView::keyReleaseEvent(TQKeyEvent *_ke) { #ifndef KHTML_NO_TYPE_AHEAD_FIND if(d->typeAheadActivated) { @@ -1743,10 +1743,10 @@ void KHTMLView::keyReleaseEvent(QKeyEvent *_ke) return; } - QScrollView::keyReleaseEvent(_ke); + TQScrollView::keyReleaseEvent(_ke); } -void KHTMLView::contentsContextMenuEvent ( QContextMenuEvent * /*ce*/ ) +void KHTMLView::contentsContextMenuEvent ( TQContextMenuEvent * /*ce*/ ) { // ### what kind of c*** is that ? #if 0 @@ -1762,12 +1762,12 @@ void KHTMLView::contentsContextMenuEvent ( QContextMenuEvent * /*ce*/ ) int absx = 0; int absy = 0; targetNode->renderer()->absolutePosition(absx,absy); - QPoint pos(xm-absx,ym-absy); + TQPoint pos(xm-absx,ym-absy); - QWidget *w = static_cast<RenderWidget*>(targetNode->renderer())->widget(); - QContextMenuEvent cme(_ce->reason(),pos,_ce->globalPos(),_ce->state()); + TQWidget *w = static_cast<RenderWidget*>(targetNode->renderer())->widget(); + TQContextMenuEvent cme(_ce->reason(),pos,_ce->globalPos(),_ce->state()); setIgnoreEvents(true); - QApplication::sendEvent(w,&cme); + TQApplication::sendEvent(w,&cme); setIgnoreEvents(false); } #endif @@ -1789,18 +1789,18 @@ bool KHTMLView::focusNextPrevChild( bool next ) if (m_part->parentPart() && m_part->parentPart()->view()) return m_part->parentPart()->view()->focusNextPrevChild(next); - return QWidget::focusNextPrevChild(next); + return TQWidget::focusNextPrevChild(next); } void KHTMLView::doAutoScroll() { - QPoint pos = QCursor::pos(); + TQPoint pos = TQCursor::pos(); pos = viewport()->mapFromGlobal( pos ); int xm, ym; viewportToContents(pos.x(), pos.y(), xm, ym); - pos = QPoint(pos.x() - viewport()->x(), pos.y() - viewport()->y()); + pos = TQPoint(pos.x() - viewport()->x(), pos.y() - viewport()->y()); if ( (pos.y() < 0) || (pos.y() > visibleHeight()) || (pos.x() < 0) || (pos.x() > visibleWidth()) ) { @@ -1833,11 +1833,11 @@ class HackWidget : public QWidget inline void setNoErase() { setWFlags(getWFlags()|WRepaintNoErase); } }; -bool KHTMLView::eventFilter(QObject *o, QEvent *e) +bool KHTMLView::eventFilter(TQObject *o, TQEvent *e) { - if ( e->type() == QEvent::AccelOverride ) { - QKeyEvent* ke = (QKeyEvent*) e; -//kdDebug(6200) << "QEvent::AccelOverride" << endl; + if ( e->type() == TQEvent::AccelOverride ) { + TQKeyEvent* ke = (TQKeyEvent*) e; +//kdDebug(6200) << "TQEvent::AccelOverride" << endl; if (m_part->isEditable() || m_part->isCaretMode() || (m_part->xmlDocImpl() && m_part->xmlDocImpl()->focusNode() && m_part->xmlDocImpl()->focusNode()->contentEditable())) { @@ -1860,36 +1860,36 @@ bool KHTMLView::eventFilter(QObject *o, QEvent *e) } } - if ( e->type() == QEvent::Leave ) { + if ( e->type() == TQEvent::Leave ) { if ( d->cursor_icon_widget ) d->cursor_icon_widget->hide(); m_part->resetHoverText(); } - QWidget *view = viewport(); + TQWidget *view = viewport(); if (o == view) { // we need to install an event filter on all children of the viewport to // be able to get correct stacking of children within the document. - if(e->type() == QEvent::ChildInserted) { - QObject *c = static_cast<QChildEvent *>(e)->child(); + if(e->type() == TQEvent::ChildInserted) { + TQObject *c = static_cast<TQChildEvent *>(e)->child(); if (c->isWidgetType()) { - QWidget *w = static_cast<QWidget *>(c); + TQWidget *w = static_cast<TQWidget *>(c); // don't install the event filter on toplevels if (w->parentWidget(true) == view) { if (!strcmp(w->name(), "__khtml")) { w->installEventFilter(this); w->unsetCursor(); - if (!::qt_cast<QFrame*>(w)) - w->setBackgroundMode( QWidget::NoBackground ); + if (!::qt_cast<TQFrame*>(w)) + w->setBackgroundMode( TQWidget::NoBackground ); static_cast<HackWidget *>(w)->setNoErase(); if (w->children()) { - QObjectListIterator it(*w->children()); + TQObjectListIterator it(*w->children()); for (; it.current(); ++it) { - QWidget *widget = ::qt_cast<QWidget *>(it.current()); + TQWidget *widget = ::qt_cast<TQWidget *>(it.current()); if (widget && !widget->isTopLevel()) { - if (!::qt_cast<QFrame*>(w)) - widget->setBackgroundMode( QWidget::NoBackground ); + if (!::qt_cast<TQFrame*>(w)) + widget->setBackgroundMode( TQWidget::NoBackground ); static_cast<HackWidget *>(widget)->setNoErase(); widget->installEventFilter(this); } @@ -1900,8 +1900,8 @@ bool KHTMLView::eventFilter(QObject *o, QEvent *e) } } } else if (o->isWidgetType()) { - QWidget *v = static_cast<QWidget *>(o); - QWidget *c = v; + TQWidget *v = static_cast<TQWidget *>(o); + TQWidget *c = v; while (v && v != view) { c = v; v = v->parentWidget(true); @@ -1909,25 +1909,25 @@ bool KHTMLView::eventFilter(QObject *o, QEvent *e) if (v && !strcmp(c->name(), "__khtml")) { bool block = false; - QWidget *w = static_cast<QWidget *>(o); + TQWidget *w = static_cast<TQWidget *>(o); switch(e->type()) { - case QEvent::Paint: + case TQEvent::Paint: if (!allowWidgetPaintEvents) { // eat the event. Like this we can control exactly when the widget // get's repainted. block = true; int x = 0, y = 0; - QWidget *v = w; + TQWidget *v = w; while (v && v != view) { x += v->x(); y += v->y(); v = v->parentWidget(); } viewportToContents( x, y, x, y ); - QPaintEvent *pe = static_cast<QPaintEvent *>(e); - bool asap = !d->contentsMoving && ::qt_cast<QScrollView *>(c); + TQPaintEvent *pe = static_cast<TQPaintEvent *>(e); + bool asap = !d->contentsMoving && ::qt_cast<TQScrollView *>(c); - // QScrollView needs fast repaints + // TQScrollView needs fast repaints if ( asap && !d->painting && m_part->xmlDocImpl() && m_part->xmlDocImpl()->renderer() && !static_cast<khtml::RenderCanvas *>(m_part->xmlDocImpl()->renderer())->needsLayout() ) { repaintContents(x + pe->rect().x(), y + pe->rect().y(), @@ -1938,20 +1938,20 @@ bool KHTMLView::eventFilter(QObject *o, QEvent *e) } } break; - case QEvent::MouseMove: - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - case QEvent::MouseButtonDblClick: { - if ( (w->parentWidget() == view || ::qt_cast<QScrollView*>(c)) && !::qt_cast<QScrollBar *>(w)) { - QMouseEvent *me = static_cast<QMouseEvent *>(e); - QPoint pt = w->mapTo( view, me->pos()); - QMouseEvent me2(me->type(), pt, me->button(), me->state()); - - if (e->type() == QEvent::MouseMove) + case TQEvent::MouseMove: + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + case TQEvent::MouseButtonDblClick: { + if ( (w->parentWidget() == view || ::qt_cast<TQScrollView*>(c)) && !::qt_cast<TQScrollBar *>(w)) { + TQMouseEvent *me = static_cast<TQMouseEvent *>(e); + TQPoint pt = w->mapTo( view, me->pos()); + TQMouseEvent me2(me->type(), pt, me->button(), me->state()); + + if (e->type() == TQEvent::MouseMove) viewportMouseMoveEvent(&me2); - else if(e->type() == QEvent::MouseButtonPress) + else if(e->type() == TQEvent::MouseButtonPress) viewportMousePressEvent(&me2); - else if(e->type() == QEvent::MouseButtonRelease) + else if(e->type() == TQEvent::MouseButtonRelease) viewportMouseReleaseEvent(&me2); else viewportMouseDoubleClickEvent(&me2); @@ -1959,11 +1959,11 @@ bool KHTMLView::eventFilter(QObject *o, QEvent *e) } break; } - case QEvent::KeyPress: - case QEvent::KeyRelease: - if (w->parentWidget() == view && !::qt_cast<QScrollBar *>(w)) { - QKeyEvent *ke = static_cast<QKeyEvent *>(e); - if (e->type() == QEvent::KeyPress) + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + if (w->parentWidget() == view && !::qt_cast<TQScrollBar *>(w)) { + TQKeyEvent *ke = static_cast<TQKeyEvent *>(e); + if (e->type() == TQEvent::KeyPress) keyPressEvent(ke); else keyReleaseEvent(ke); @@ -1980,7 +1980,7 @@ bool KHTMLView::eventFilter(QObject *o, QEvent *e) } // kdDebug(6000) <<"passing event on to sv event filter object=" << o->className() << " event=" << e->type() << endl; - return QScrollView::eventFilter(o, e); + return TQScrollView::eventFilter(o, e); } @@ -1994,7 +1994,7 @@ DOM::NodeImpl *KHTMLView::nonSharedNodeUnderMouse() const return d->underMouseNonShared; } -bool KHTMLView::scrollTo(const QRect &bounds) +bool KHTMLView::scrollTo(const TQRect &bounds) { d->scrollingSelf = true; // so scroll events get ignored @@ -2106,11 +2106,11 @@ bool KHTMLView::focusNextPrevNode(bool next) while (toFocus && toFocus != oldFocusNode) { - QRect focusNodeRect = toFocus->getRect(); + TQRect focusNodeRect = toFocus->getRect(); if ((focusNodeRect.left() > contentsX()) && (focusNodeRect.right() < contentsX() + visibleWidth()) && (focusNodeRect.top() > contentsY()) && (focusNodeRect.bottom() < contentsY() + visibleHeight())) { { - QRect r = toFocus->getRect(); + TQRect r = toFocus->getRect(); ensureVisible( r.right(), r.bottom()); ensureVisible( r.left(), r.top()); d->scrollBarMoved = false; @@ -2173,11 +2173,11 @@ bool KHTMLView::focusNextPrevNode(bool next) { if ( next ) { - targetVisible = scrollTo(QRect(contentsX()+visibleWidth()/2,contentsHeight()-d->borderY,0,0)); + targetVisible = scrollTo(TQRect(contentsX()+visibleWidth()/2,contentsHeight()-d->borderY,0,0)); } else { - targetVisible = scrollTo(QRect(contentsX()+visibleWidth()/2,d->borderY,0,0)); + targetVisible = scrollTo(TQRect(contentsX()+visibleWidth()/2,d->borderY,0,0)); } } else @@ -2228,39 +2228,39 @@ bool KHTMLView::focusNextPrevNode(bool next) void KHTMLView::displayAccessKeys() { - QValueVector< QChar > taken; + TQValueVector< TQChar > taken; displayAccessKeys( NULL, this, taken, false ); displayAccessKeys( NULL, this, taken, true ); } -void KHTMLView::displayAccessKeys( KHTMLView* caller, KHTMLView* origview, QValueVector< QChar >& taken, bool use_fallbacks ) +void KHTMLView::displayAccessKeys( KHTMLView* caller, KHTMLView* origview, TQValueVector< TQChar >& taken, bool use_fallbacks ) { - QMap< ElementImpl*, QChar > fallbacks; + TQMap< ElementImpl*, TQChar > fallbacks; if( use_fallbacks ) fallbacks = buildFallbackAccessKeys(); for( NodeImpl* n = m_part->xmlDocImpl(); n != NULL; n = n->traverseNextNode()) { if( n->isElementNode()) { ElementImpl* en = static_cast< ElementImpl* >( n ); DOMString s = en->getAttribute( ATTR_ACCESSKEY ); - QString accesskey; + TQString accesskey; if( s.length() == 1 ) { - QChar a = s.string()[ 0 ].upper(); + TQChar a = s.string()[ 0 ].upper(); if( qFind( taken.begin(), taken.end(), a ) == taken.end()) // !contains accesskey = a; } if( accesskey.isNull() && fallbacks.contains( en )) { - QChar a = fallbacks[ en ].upper(); + TQChar a = fallbacks[ en ].upper(); if( qFind( taken.begin(), taken.end(), a ) == taken.end()) // !contains - accesskey = QString( "<qt><i>" ) + a + "</i></qt>"; + accesskey = TQString( "<qt><i>" ) + a + "</i></qt>"; } if( !accesskey.isNull()) { - QRect rec=en->getRect(); - QLabel *lab=new QLabel(accesskey,viewport(),0,Qt::WDestructiveClose); - connect( origview, SIGNAL(hideAccessKeys()), lab, SLOT(close()) ); - connect( this, SIGNAL(repaintAccessKeys()), lab, SLOT(repaint())); - lab->setPalette(QToolTip::palette()); + TQRect rec=en->getRect(); + TQLabel *lab=new TQLabel(accesskey,viewport(),0,Qt::WDestructiveClose); + connect( origview, TQT_SIGNAL(hideAccessKeys()), lab, TQT_SLOT(close()) ); + connect( this, TQT_SIGNAL(repaintAccessKeys()), lab, TQT_SLOT(repaint())); + lab->setPalette(TQToolTip::palette()); lab->setLineWidth(2); - lab->setFrameStyle(QFrame::Box | QFrame::Plain); + lab->setFrameStyle(TQFrame::Box | TQFrame::Plain); lab->setMargin(3); lab->adjustSize(); addChild(lab, @@ -2273,8 +2273,8 @@ void KHTMLView::displayAccessKeys( KHTMLView* caller, KHTMLView* origview, QValu } if( use_fallbacks ) return; - QPtrList<KParts::ReadOnlyPart> frames = m_part->frames(); - for( QPtrListIterator<KParts::ReadOnlyPart> it( frames ); + TQPtrList<KParts::ReadOnlyPart> frames = m_part->frames(); + for( TQPtrListIterator<KParts::ReadOnlyPart> it( frames ); it != NULL; ++it ) { if( !(*it)->inherits( "KHTMLPart" )) @@ -2295,16 +2295,16 @@ void KHTMLView::accessKeysTimeout() { d->accessKeysActivated=false; d->accessKeysPreActivate = false; -m_part->setStatusBarText(QString::null, KHTMLPart::BarOverrideText); +m_part->setStatusBarText(TQString::null, KHTMLPart::BarOverrideText); emit hideAccessKeys(); } // Handling of the HTML accesskey attribute. -bool KHTMLView::handleAccessKey( const QKeyEvent* ev ) +bool KHTMLView::handleAccessKey( const TQKeyEvent* ev ) { // Qt interprets the keyevent also with the modifiers, and ev->text() matches that, // but this code must act as if the modifiers weren't pressed - QChar c; + TQChar c; if( ev->key() >= Key_A && ev->key() <= Key_Z ) c = 'A' + ev->key() - Key_A; else if( ev->key() >= Key_0 && ev->key() <= Key_9 ) @@ -2320,15 +2320,15 @@ bool KHTMLView::handleAccessKey( const QKeyEvent* ev ) return focusNodeWithAccessKey( c ); } -bool KHTMLView::focusNodeWithAccessKey( QChar c, KHTMLView* caller ) +bool KHTMLView::focusNodeWithAccessKey( TQChar c, KHTMLView* caller ) { DocumentImpl *doc = m_part->xmlDocImpl(); if( !doc ) return false; ElementImpl* node = doc->findAccessKeyElement( c ); if( !node ) { - QPtrList<KParts::ReadOnlyPart> frames = m_part->frames(); - for( QPtrListIterator<KParts::ReadOnlyPart> it( frames ); + TQPtrList<KParts::ReadOnlyPart> frames = m_part->frames(); + for( TQPtrListIterator<KParts::ReadOnlyPart> it( frames ); it != NULL; ++it ) { if( !(*it)->inherits( "KHTMLPart" )) @@ -2344,8 +2344,8 @@ bool KHTMLView::focusNodeWithAccessKey( QChar c, KHTMLView* caller ) && m_part->parentPart()->view()->focusNodeWithAccessKey( c, this )) return true; if( caller == NULL ) { // the active frame (where the accesskey was pressed) - QMap< ElementImpl*, QChar > fallbacks = buildFallbackAccessKeys(); - for( QMap< ElementImpl*, QChar >::ConstIterator it = fallbacks.begin(); + TQMap< ElementImpl*, TQChar > fallbacks = buildFallbackAccessKeys(); + for( TQMap< ElementImpl*, TQChar >::ConstIterator it = fallbacks.begin(); it != fallbacks.end(); ++it ) if( *it == c ) { @@ -2369,7 +2369,7 @@ bool KHTMLView::focusNodeWithAccessKey( QChar c, KHTMLView* caller ) } #endif // KHTML_NO_CARET - QRect r = node->getRect(); + TQRect r = node->getRect(); ensureVisible( r.right(), r.bottom()); ensureVisible( r.left(), r.top()); @@ -2382,9 +2382,9 @@ bool KHTMLView::focusNodeWithAccessKey( QChar c, KHTMLView* caller ) guard = node; } // Set focus node on the document - QFocusEvent::setReason( QFocusEvent::Shortcut ); + TQFocusEvent::setReason( TQFocusEvent::Shortcut ); m_part->xmlDocImpl()->setFocusNode(node); - QFocusEvent::resetReason(); + TQFocusEvent::resetReason(); if( node != NULL && node->hasOneRef()) // deleted, only held by guard return true; emit m_part->nodeActivated(Node(node)); @@ -2414,9 +2414,9 @@ bool KHTMLView::focusNodeWithAccessKey( QChar c, KHTMLView* caller ) return true; } -static QString getElementText( NodeImpl* start, bool after ) +static TQString getElementText( NodeImpl* start, bool after ) { - QString ret; // nextSibling(), to go after e.g. </select> + TQString ret; // nextSibling(), to go after e.g. </select> for( NodeImpl* n = after ? start->nextSibling() : start->traversePreviousNode(); n != NULL; n = after ? n->traverseNextNode() : n->traversePreviousNode()) { @@ -2465,9 +2465,9 @@ static QString getElementText( NodeImpl* start, bool after ) return ret.simplifyWhiteSpace(); } -static QMap< NodeImpl*, QString > buildLabels( NodeImpl* start ) +static TQMap< NodeImpl*, TQString > buildLabels( NodeImpl* start ) { - QMap< NodeImpl*, QString > ret; + TQMap< NodeImpl*, TQString > ret; for( NodeImpl* n = start; n != NULL; n = n->traverseNextNode()) { @@ -2484,17 +2484,17 @@ static QMap< NodeImpl*, QString > buildLabels( NodeImpl* start ) namespace khtml { struct AccessKeyData { ElementImpl* element; - QString text; - QString url; + TQString text; + TQString url; int priority; // 10(highest) - 0(lowest) }; } -QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const +TQMap< ElementImpl*, TQChar > KHTMLView::buildFallbackAccessKeys() const { // build a list of all possible candidate elements that could use an accesskey - QValueList< AccessKeyData > data; - QMap< NodeImpl*, QString > labels = buildLabels( m_part->xmlDocImpl()); + TQValueList< AccessKeyData > data; + TQMap< NodeImpl*, TQString > labels = buildLabels( m_part->xmlDocImpl()); for( NodeImpl* n = m_part->xmlDocImpl(); n != NULL; n = n->traverseNextNode()) { @@ -2504,8 +2504,8 @@ QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const continue; // has accesskey set, ignore if( element->renderer() == NULL ) continue; // not visible - QString text; - QString url; + TQString text; + TQString url; int priority = 0; bool ignore = false; bool text_after = false; @@ -2602,9 +2602,9 @@ QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const text = getElementText( element, true ); text = text.stripWhiteSpace(); // increase priority of items which have explicitly specified accesskeys in the config - QValueList< QPair< QString, QChar > > priorities + TQValueList< QPair< TQString, TQChar > > priorities = m_part->settings()->fallbackAccessKeysAssignments(); - for( QValueList< QPair< QString, QChar > >::ConstIterator it = priorities.begin(); + for( TQValueList< QPair< TQString, TQChar > >::ConstIterator it = priorities.begin(); it != priorities.end(); ++it ) { if( text == (*it).first ) @@ -2615,7 +2615,7 @@ QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const } } - QValueList< QChar > keys; + TQValueList< TQChar > keys; for( char c = 'A'; c <= 'Z'; ++c ) keys << c; for( char c = '0'; c <= '9'; ++c ) @@ -2627,17 +2627,17 @@ QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const ElementImpl* en = static_cast< ElementImpl* >( n ); DOMString s = en->getAttribute( ATTR_ACCESSKEY ); if( s.length() == 1 ) { - QChar c = s.string()[ 0 ].upper(); + TQChar c = s.string()[ 0 ].upper(); keys.remove( c ); // remove manually assigned accesskeys } } } - QMap< ElementImpl*, QChar > ret; + TQMap< ElementImpl*, TQChar > ret; for( int priority = 10; priority >= 0; --priority ) { - for( QValueList< AccessKeyData >::Iterator it = data.begin(); + for( TQValueList< AccessKeyData >::Iterator it = data.begin(); it != data.end(); ) { if( (*it).priority != priority ) { @@ -2646,12 +2646,12 @@ QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const } if( keys.isEmpty()) break; - QString text = (*it).text; - QChar key; + TQString text = (*it).text; + TQChar key; if( key.isNull() && !text.isEmpty()) { - QValueList< QPair< QString, QChar > > priorities + TQValueList< QPair< TQString, TQChar > > priorities = m_part->settings()->fallbackAccessKeysAssignments(); - for( QValueList< QPair< QString, QChar > >::ConstIterator it = priorities.begin(); + for( TQValueList< QPair< TQString, TQChar > >::ConstIterator it = priorities.begin(); it != priorities.end(); ++it ) if( text == (*it).first && keys.contains( (*it).second )) { @@ -2663,8 +2663,8 @@ QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const // then first character of the following words, // and then simply the first free character if( key.isNull() && !text.isEmpty()) { - QStringList words = QStringList::split( ' ', text ); - for( QStringList::ConstIterator it = words.begin(); + TQStringList words = TQStringList::split( ' ', text ); + for( TQStringList::ConstIterator it = words.begin(); it != words.end(); ++it ) { if( keys.contains( (*it)[ 0 ].upper())) { @@ -2687,11 +2687,11 @@ QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const key = keys.front(); ret[ (*it).element ] = key; keys.remove( key ); - QString url = (*it).url; + TQString url = (*it).url; it = data.remove( it ); // assign the same accesskey also to other elements pointing to the same url if( !url.isEmpty() && !url.startsWith( "javascript:", false )) { - for( QValueList< AccessKeyData >::Iterator it2 = data.begin(); + for( TQValueList< AccessKeyData >::Iterator it2 = data.begin(); it2 != data.end(); ) { if( (*it2).url == url ) { @@ -2708,12 +2708,12 @@ QMap< ElementImpl*, QChar > KHTMLView::buildFallbackAccessKeys() const return ret; } -void KHTMLView::setMediaType( const QString &medium ) +void KHTMLView::setMediaType( const TQString &medium ) { m_medium = medium; } -QString KHTMLView::mediaType() const +TQString KHTMLView::mediaType() const { return m_medium; } @@ -2748,24 +2748,24 @@ void KHTMLView::print(bool quick) khtml::RenderCanvas *root = static_cast<khtml::RenderCanvas *>(m_part->xmlDocImpl()->renderer()); if(!root) return; - KPrinter *printer = new KPrinter(true, QPrinter::ScreenResolution); + KPrinter *printer = new KPrinter(true, TQPrinter::ScreenResolution); printer->addDialogPage(new KHTMLPrintSettings()); - QString docname = m_part->xmlDocImpl()->URL().prettyURL(); + TQString docname = m_part->xmlDocImpl()->URL().prettyURL(); if ( !docname.isEmpty() ) docname = KStringHandler::csqueeze(docname, 80); if(quick || printer->setup(this, i18n("Print %1").arg(docname))) { - viewport()->setCursor( waitCursor ); // only viewport(), no QApplication::, otherwise we get the busy cursor in kdeprint's dialogs + viewport()->setCursor( waitCursor ); // only viewport(), no TQApplication::, otherwise we get the busy cursor in kdeprint's dialogs // set up KPrinter printer->setFullPage(false); - printer->setCreator(QString("KDE %1.%2.%3 HTML Library").arg(KDE_VERSION_MAJOR).arg(KDE_VERSION_MINOR).arg(KDE_VERSION_RELEASE)); + printer->setCreator(TQString("KDE %1.%2.%3 HTML Library").arg(KDE_VERSION_MAJOR).arg(KDE_VERSION_MINOR).arg(KDE_VERSION_RELEASE)); printer->setDocName(docname); - QPainter *p = new QPainter; + TQPainter *p = new QPainter; p->begin( printer ); khtml::setPrintPainter( p ); m_part->xmlDocImpl()->setPaintDevice( printer ); - QString oldMediaType = mediaType(); + TQString oldMediaType = mediaType(); setMediaType( "print" ); // We ignore margin settings for html and body when printing // and use the default margins from the print-system @@ -2780,7 +2780,7 @@ void KHTMLView::print(bool quick) "html { margin: 0px !important; }" ); - QPaintDeviceMetrics metrics( printer ); + TQPaintDeviceMetrics metrics( printer ); kdDebug(6000) << "printing: physical page width = " << metrics.width() << " height = " << metrics.height() << endl; @@ -2806,11 +2806,11 @@ void KHTMLView::print(bool quick) bool printHeader = (printer->option("app-khtml-printheader") == "true"); int headerHeight = 0; - QFont headerFont("Sans Serif", 8); + TQFont headerFont("Sans Serif", 8); - QString headerLeft = KGlobal::locale()->formatDate(QDate::currentDate(),true); - QString headerMid = docname; - QString headerRight; + TQString headerLeft = KGlobal::locale()->formatDate(TQDate::currentDate(),true); + TQString headerMid = docname; + TQString headerRight; if (printHeader) { @@ -2875,14 +2875,14 @@ void KHTMLView::print(bool quick) int page = 1; while(top < root->docHeight()) { if(top > 0) printer->newPage(); - p->setClipRect(0, 0, pageWidth, headerHeight, QPainter::CoordDevice); + p->setClipRect(0, 0, pageWidth, headerHeight, TQPainter::CoordDevice); if (printHeader) { int dy = p->fontMetrics().lineSpacing(); p->setPen(Qt::black); p->setFont(headerFont); - headerRight = QString("#%1").arg(page); + headerRight = TQString("#%1").arg(page); p->drawText(0, 0, metrics.width(), dy, Qt::AlignLeft, headerLeft); p->drawText(0, 0, metrics.width(), dy, Qt::AlignHCenter, headerMid); @@ -2895,7 +2895,7 @@ void KHTMLView::print(bool quick) p->scale(scale, scale); #endif - p->setClipRect(0, headerHeight, pageWidth, pageHeight, QPainter::CoordDevice); + p->setClipRect(0, headerHeight, pageWidth, pageHeight, TQPainter::CoordDevice); p->translate(0, headerHeight-top); bottom = top+pageHeight; @@ -2904,8 +2904,8 @@ void KHTMLView::print(bool quick) root->setPageBottom(bottom); root->setPageNumber(page); - root->layer()->paint(p, QRect(0, top, pageWidth, pageHeight)); -// m_part->xmlDocImpl()->renderer()->layer()->paint(p, QRect(0, top, pageWidth, pageHeight)); + root->layer()->paint(p, TQRect(0, top, pageWidth, pageHeight)); +// m_part->xmlDocImpl()->renderer()->layer()->paint(p, TQRect(0, top, pageWidth, pageHeight)); // root->repaint(); // p->flush(); kdDebug(6000) << "printed: page " << page <<" bottom At = " << bottom << endl; @@ -2946,7 +2946,7 @@ void KHTMLView::slotPaletteChanged() body->recalcStyle( NodeImpl::Force ); } -void KHTMLView::paint(QPainter *p, const QRect &rc, int yOff, bool *more) +void KHTMLView::paint(TQPainter *p, const TQRect &rc, int yOff, bool *more) { if(!m_part->xmlDocImpl()) return; khtml::RenderCanvas *root = static_cast<khtml::RenderCanvas *>(m_part->xmlDocImpl()->renderer()); @@ -2968,7 +2968,7 @@ void KHTMLView::paint(QPainter *p, const QRect &rc, int yOff, bool *more) root->setPageTop(yOff); root->setPageBottom(yOff+height); - root->layer()->paint(p, QRect(0, yOff, root->docWidth(), height)); + root->layer()->paint(p, TQRect(0, yOff, root->docWidth(), height)); if (more) *more = yOff + height < root->docHeight(); p->restore(); @@ -2990,7 +2990,7 @@ void KHTMLView::setVScrollBarMode ( ScrollBarMode mode ) { #ifndef KHTML_NO_SCROLLBARS d->vmode = mode; - QScrollView::setVScrollBarMode(mode); + TQScrollView::setVScrollBarMode(mode); #else Q_UNUSED( mode ); #endif @@ -3000,7 +3000,7 @@ void KHTMLView::setHScrollBarMode ( ScrollBarMode mode ) { #ifndef KHTML_NO_SCROLLBARS d->hmode = mode; - QScrollView::setHScrollBarMode(mode); + TQScrollView::setHScrollBarMode(mode); #else Q_UNUSED( mode ); #endif @@ -3009,22 +3009,22 @@ void KHTMLView::setHScrollBarMode ( ScrollBarMode mode ) void KHTMLView::restoreScrollBar() { int ow = visibleWidth(); - QScrollView::setVScrollBarMode(d->vmode); + TQScrollView::setVScrollBarMode(d->vmode); if (visibleWidth() != ow) layout(); d->prevScrollbarVisible = verticalScrollBar()->isVisible(); } -QStringList KHTMLView::formCompletionItems(const QString &name) const +TQStringList KHTMLView::formCompletionItems(const TQString &name) const { if (!m_part->settings()->isFormCompletionEnabled()) - return QStringList(); + return TQStringList(); if (!d->formCompletions) d->formCompletions = new KSimpleConfig(locateLocal("data", "khtml/formcompletions")); return d->formCompletions->readListEntry(name); } -void KHTMLView::clearCompletionHistory(const QString& name) +void KHTMLView::clearCompletionHistory(const TQString& name) { if (!d->formCompletions) { @@ -3034,7 +3034,7 @@ void KHTMLView::clearCompletionHistory(const QString& name) d->formCompletions->sync(); } -void KHTMLView::addFormCompletionItem(const QString &name, const QString &value) +void KHTMLView::addFormCompletionItem(const TQString &name, const TQString &value) { if (!m_part->settings()->isFormCompletionEnabled()) return; @@ -3044,7 +3044,7 @@ void KHTMLView::addFormCompletionItem(const QString &name, const QString &value) bool cc_number(true); for (unsigned int i = 0; i < value.length(); ++i) { - QChar c(value[i]); + TQChar c(value[i]); if (!c.isNumber() && c != '-' && !c.isSpace()) { cc_number = false; @@ -3053,7 +3053,7 @@ void KHTMLView::addFormCompletionItem(const QString &name, const QString &value) } if (cc_number) return; - QStringList items = formCompletionItems(name); + TQStringList items = formCompletionItems(name); if (!items.contains(value)) items.prepend(value); while ((int)items.count() > m_part->settings()->maxFormCompletionItems()) @@ -3061,28 +3061,28 @@ void KHTMLView::addFormCompletionItem(const QString &name, const QString &value) d->formCompletions->writeEntry(name, items); } -void KHTMLView::addNonPasswordStorableSite(const QString& host) +void KHTMLView::addNonPasswordStorableSite(const TQString& host) { if (!d->formCompletions) { d->formCompletions = new KSimpleConfig(locateLocal("data", "khtml/formcompletions")); } d->formCompletions->setGroup("NonPasswordStorableSites"); - QStringList sites = d->formCompletions->readListEntry("Sites"); + TQStringList sites = d->formCompletions->readListEntry("Sites"); sites.append(host); d->formCompletions->writeEntry("Sites", sites); d->formCompletions->sync(); - d->formCompletions->setGroup(QString::null);//reset + d->formCompletions->setGroup(TQString::null);//reset } -bool KHTMLView::nonPasswordStorableSite(const QString& host) const +bool KHTMLView::nonPasswordStorableSite(const TQString& host) const { if (!d->formCompletions) { d->formCompletions = new KSimpleConfig(locateLocal("data", "khtml/formcompletions")); } d->formCompletions->setGroup("NonPasswordStorableSites"); - QStringList sites = d->formCompletions->readListEntry("Sites"); - d->formCompletions->setGroup(QString::null);//reset + TQStringList sites = d->formCompletions->readListEntry("Sites"); + d->formCompletions->setGroup(TQString::null);//reset return (sites.find(host) != sites.end()); } @@ -3090,7 +3090,7 @@ bool KHTMLView::nonPasswordStorableSite(const QString& host) const // returns true if event should be swallowed bool KHTMLView::dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, DOM::NodeImpl *targetNodeNonShared, bool cancelable, - int detail,QMouseEvent *_mouse, bool setUnder, + int detail,TQMouseEvent *_mouse, bool setUnder, int mouseEventType) { // if the target node is a text node, dispatch on the parent node - rdar://4196646 (and #76948) @@ -3191,7 +3191,7 @@ bool KHTMLView::dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, if (targetNode) { // send the actual event bool dblclick = ( eventId == EventImpl::CLICK_EVENT && - _mouse->type() == QEvent::MouseButtonDblClick ); + _mouse->type() == TQEvent::MouseButtonDblClick ); MouseEventImpl *me = new MouseEventImpl(static_cast<EventImpl::EventId>(eventId), true,cancelable,m_part->xmlDocImpl()->defaultView(), detail,screenX,screenY,clientX,clientY,pageX, pageY, @@ -3228,7 +3228,7 @@ void KHTMLView::setIgnoreWheelEvents( bool e ) #ifndef QT_NO_WHEELEVENT -void KHTMLView::viewportWheelEvent(QWheelEvent* e) +void KHTMLView::viewportWheelEvent(TQWheelEvent* e) { if (d->accessKeysEnabled && d->accessKeysPreActivate) d->accessKeysPreActivate=false; @@ -3259,9 +3259,9 @@ void KHTMLView::viewportWheelEvent(QWheelEvent* e) else { d->scrollBarMoved = true; - QScrollView::viewportWheelEvent( e ); + TQScrollView::viewportWheelEvent( e ); - QMouseEvent *tempEvent = new QMouseEvent( QEvent::MouseMove, QPoint(-1,-1), QPoint(-1,-1), Qt::NoButton, e->state() ); + TQMouseEvent *tempEvent = new TQMouseEvent( TQEvent::MouseMove, TQPoint(-1,-1), TQPoint(-1,-1), Qt::NoButton, e->state() ); emit viewportMouseMoveEvent ( tempEvent ); delete tempEvent; } @@ -3269,40 +3269,40 @@ void KHTMLView::viewportWheelEvent(QWheelEvent* e) } #endif -void KHTMLView::dragEnterEvent( QDragEnterEvent* ev ) +void KHTMLView::dragEnterEvent( TQDragEnterEvent* ev ) { // Handle drops onto frames (#16820) // Drops on the main html part is handled by Konqueror (and shouldn't do anything // in e.g. kmail, so not handled here). if ( m_part->parentPart() ) { - QApplication::sendEvent(m_part->parentPart()->widget(), ev); + TQApplication::sendEvent(m_part->parentPart()->widget(), ev); return; } - QScrollView::dragEnterEvent( ev ); + TQScrollView::dragEnterEvent( ev ); } -void KHTMLView::dropEvent( QDropEvent *ev ) +void KHTMLView::dropEvent( TQDropEvent *ev ) { // Handle drops onto frames (#16820) // Drops on the main html part is handled by Konqueror (and shouldn't do anything // in e.g. kmail, so not handled here). if ( m_part->parentPart() ) { - QApplication::sendEvent(m_part->parentPart()->widget(), ev); + TQApplication::sendEvent(m_part->parentPart()->widget(), ev); return; } - QScrollView::dropEvent( ev ); + TQScrollView::dropEvent( ev ); } -void KHTMLView::focusInEvent( QFocusEvent *e ) +void KHTMLView::focusInEvent( TQFocusEvent *e ) { #ifndef KHTML_NO_TYPE_AHEAD_FIND m_part->enableFindAheadActions( true ); #endif DOM::NodeImpl* fn = m_part->xmlDocImpl() ? m_part->xmlDocImpl()->focusNode() : 0; if (fn && fn->renderer() && fn->renderer()->isWidget() && - (e->reason() != QFocusEvent::Mouse) && + (e->reason() != TQFocusEvent::Mouse) && static_cast<khtml::RenderWidget*>(fn->renderer())->widget()) static_cast<khtml::RenderWidget*>(fn->renderer())->widget()->setFocus(); #ifndef KHTML_NO_CARET @@ -3322,10 +3322,10 @@ void KHTMLView::focusInEvent( QFocusEvent *e ) }/*end if*/ showCaret(); #endif // KHTML_NO_CARET - QScrollView::focusInEvent( e ); + TQScrollView::focusInEvent( e ); } -void KHTMLView::focusOutEvent( QFocusEvent *e ) +void KHTMLView::focusOutEvent( TQFocusEvent *e ) { if(m_part) m_part->stopAutoScroll(); @@ -3367,7 +3367,7 @@ void KHTMLView::focusOutEvent( QFocusEvent *e ) if ( d->cursor_icon_widget ) d->cursor_icon_widget->hide(); - QScrollView::focusOutEvent( e ); + TQScrollView::focusOutEvent( e ); } void KHTMLView::slotScrollBarMoved() @@ -3392,7 +3392,7 @@ void KHTMLView::slotScrollBarMoved() m_part->xmlDocImpl()->documentElement()->dispatchHTMLEvent(EventImpl::SCROLL_EVENT, true, false); } -void KHTMLView::timerEvent ( QTimerEvent *e ) +void KHTMLView::timerEvent ( TQTimerEvent *e ) { // kdDebug() << "timer event " << e->timerId() << endl; if ( e->timerId() == d->scrollTimerId ) { @@ -3469,16 +3469,16 @@ void KHTMLView::timerEvent ( QTimerEvent *e ) killTimer(d->repaintTimerId); d->repaintTimerId = 0; - QRect updateRegion; - QMemArray<QRect> rects = d->updateRegion.rects(); + TQRect updateRegion; + TQMemArray<TQRect> rects = d->updateRegion.rects(); - d->updateRegion = QRegion(); + d->updateRegion = TQRegion(); if ( rects.size() ) updateRegion = rects[0]; for ( unsigned i = 1; i < rects.size(); ++i ) { - QRect newRegion = updateRegion.unite(rects[i]); + TQRect newRegion = updateRegion.unite(rects[i]); if (2*newRegion.height() > 3*updateRegion.height() ) { repaintContents( updateRegion ); @@ -3497,17 +3497,17 @@ void KHTMLView::timerEvent ( QTimerEvent *e ) // Thus we need to check each supposedly 'visible' widget at the end of each layout, and remove it in case it's no more in sight. if (d->dirtyLayout && !d->visibleWidgets.isEmpty()) { - QWidget* w; + TQWidget* w; d->dirtyLayout = false; - QRect visibleRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()); - QPtrList<RenderWidget> toRemove; - for (QPtrDictIterator<QWidget> it(d->visibleWidgets); it.current(); ++it) { + TQRect visibleRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()); + TQPtrList<RenderWidget> toRemove; + for (TQPtrDictIterator<TQWidget> it(d->visibleWidgets); it.current(); ++it) { int xp = 0, yp = 0; w = it.current(); RenderWidget* rw = static_cast<RenderWidget*>( it.currentKey() ); if (!rw->absolutePosition(xp, yp) || - !visibleRect.intersects(QRect(xp, yp, w->width(), w->height()))) + !visibleRect.intersects(TQRect(xp, yp, w->width(), w->height()))) toRemove.append(rw); } for (RenderWidget* r = toRemove.first(); r; r = toRemove.next()) @@ -3563,7 +3563,7 @@ void KHTMLView::scheduleRepaint(int x, int y, int w, int h, bool asap) int time = parsing ? 300 : (!asap ? ( !d->complete ? 100 : 20 ) : 0); #ifdef DEBUG_FLICKER - QPainter p; + TQPainter p; p.begin( viewport() ); int vx, vy; @@ -3572,7 +3572,7 @@ void KHTMLView::scheduleRepaint(int x, int y, int w, int h, bool asap) p.end(); #endif - d->updateRegion = d->updateRegion.unite(QRect(x,y,w,h)); + d->updateRegion = d->updateRegion.unite(TQRect(x,y,w,h)); if (asap && !parsing) unscheduleRepaint(); @@ -3703,7 +3703,7 @@ void KHTMLView::ensureNodeHasFocus(NodeImpl *node) // Set focus node on the document #if DEBUG_CARETMODE > 1 kdDebug(6200) << k_funcinfo << "firstAncestor " << firstAncestor << ": " - << (firstAncestor ? firstAncestor->nodeName().string() : QString::null) << endl; + << (firstAncestor ? firstAncestor->nodeName().string() : TQString::null) << endl; #endif doc->setFocusNode(firstAncestor); emit m_part->nodeActivated(Node(firstAncestor)); @@ -3715,7 +3715,7 @@ void KHTMLView::recalcAndStoreCaretPos(CaretBox *hintBox) d->caretViewContext(); NodeImpl *caretNode = m_part->d->caretNode().handle(); #if DEBUG_CARETMODE > 0 - kdDebug(6200) << "recalcAndStoreCaretPos: caretNode=" << caretNode << (caretNode ? " "+caretNode->nodeName().string() : QString::null) << " r@" << caretNode->renderer() << (caretNode->renderer() && caretNode->renderer()->isText() ? " \"" + QConstString(static_cast<RenderText *>(caretNode->renderer())->str->s, kMin(static_cast<RenderText *>(caretNode->renderer())->str->l, 15u)).string() + "\"" : QString::null) << endl; + kdDebug(6200) << "recalcAndStoreCaretPos: caretNode=" << caretNode << (caretNode ? " "+caretNode->nodeName().string() : TQString::null) << " r@" << caretNode->renderer() << (caretNode->renderer() && caretNode->renderer()->isText() ? " \"" + TQConstString(static_cast<RenderText *>(caretNode->renderer())->str->s, kMin(static_cast<RenderText *>(caretNode->renderer())->str->l, 15u)).string() + "\"" : TQString::null) << endl; #endif caretNode->getCaret(m_part->d->caretOffset(), caretOverrides(), d->m_caretViewContext->x, d->m_caretViewContext->y, @@ -3727,7 +3727,7 @@ void KHTMLView::recalcAndStoreCaretPos(CaretBox *hintBox) kdDebug(6200) << "using hint inline box coordinates" << endl; #endif RenderObject *r = caretNode->renderer(); - const QFontMetrics &fm = r->style()->fontMetrics(); + const TQFontMetrics &fm = r->style()->fontMetrics(); int absx, absy; r->containingBlock()->absolutePosition(absx, absy, false); // ### what about fixed? @@ -3990,7 +3990,7 @@ void KHTMLView::updateSelection(NodeImpl *oldStartSel, long oldStartOfs, }/*end if*/ } -void KHTMLView::caretKeyPressEvent(QKeyEvent *_ke) +void KHTMLView::caretKeyPressEvent(TQKeyEvent *_ke) { NodeImpl *oldStartSel = m_part->d->m_selectionStart.handle(); long oldStartOfs = m_part->d->m_startOffset; @@ -4185,7 +4185,7 @@ void KHTMLView::placeCaretOnLine(CaretBox *caretBox, int x, int absx, int absy) kdDebug(6200) << "xPos: " << caretBox->xPos() << " yPos: " << caretBox->yPos() << " width: " << caretBox->width() << " height: " << caretBox->height() << endl; InlineTextBox *tb = static_cast<InlineTextBox *>(caretBox->inlineBox()); - if (caretBox->isInlineTextBox()) { kdDebug(6200) << "contains \"" << QString(static_cast<RenderText *>(tb->object())->str->s + tb->m_start, tb->m_len) << "\"" << endl;} + if (caretBox->isInlineTextBox()) { kdDebug(6200) << "contains \"" << TQString(static_cast<RenderText *>(tb->object())->str->s + tb->m_start, tb->m_len) << "\"" << endl;} #endif // inquire height of caret int caretHeight = caretBox->height(); @@ -4194,7 +4194,7 @@ void KHTMLView::placeCaretOnLine(CaretBox *caretBox, int x, int absx, int absy) if (isText) { // text boxes need extrawurst RenderText *t = static_cast<RenderText *>(caretRender); - const QFontMetrics &fm = t->metrics(caretBox->inlineBox()->m_firstLine); + const TQFontMetrics &fm = t->metrics(caretBox->inlineBox()->m_firstLine); caretHeight = fm.height(); yOfs = caretBox->inlineBox()->baseline() - fm.ascent(); }/*end if*/ @@ -4365,7 +4365,7 @@ void KHTMLView::moveCaretBy(bool next, CaretMovement cmv, int count) //kdDebug(6200) << "mapRTD" << endl; caretNodeRef = node; #if DEBUG_CARETMODE > 2 - kdDebug(6200) << "set by valid node " << node << " " << (node?node->nodeName().string():QString::null) << " offset: " << offset << endl; + kdDebug(6200) << "set by valid node " << node << " " << (node?node->nodeName().string():TQString::null) << " offset: " << offset << endl; #endif } else { offset = next ? caretNode->maxOffset() : caretNode->minOffset(); diff --git a/khtml/khtmlview.h b/khtml/khtmlview.h index c44dba28a..fc9d1d7d6 100644 --- a/khtml/khtmlview.h +++ b/khtml/khtmlview.h @@ -26,7 +26,7 @@ #define KHTMLVIEW_H // qt includes and classes -#include <qscrollview.h> +#include <tqscrollview.h> #include <kdelibs_export.h> @@ -71,7 +71,7 @@ class KHTMLPart; class KHTMLViewPrivate; /** - * Renders and displays HTML in a QScrollView. + * Renders and displays HTML in a TQScrollView. * * Suitable for use as an application's main view. **/ @@ -103,7 +103,7 @@ public: /** * Constructs a KHTMLView. */ - KHTMLView( KHTMLPart *part, QWidget *parent, const char *name=0 ); + KHTMLView( KHTMLPart *part, TQWidget *parent, const char *name=0 ); virtual ~KHTMLView(); /** @@ -185,32 +185,32 @@ signals: protected: void clear(); - virtual void resizeEvent ( QResizeEvent * event ); - virtual void showEvent ( QShowEvent * ); - virtual void hideEvent ( QHideEvent *); + virtual void resizeEvent ( TQResizeEvent * event ); + virtual void showEvent ( TQShowEvent * ); + virtual void hideEvent ( TQHideEvent *); virtual bool focusNextPrevChild( bool next ); - virtual void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ); - virtual void drawContents( QPainter* ); - virtual void viewportMousePressEvent( QMouseEvent * ); - virtual void focusInEvent( QFocusEvent * ); - virtual void focusOutEvent( QFocusEvent * ); - virtual void viewportMouseDoubleClickEvent( QMouseEvent * ); - virtual void viewportMouseMoveEvent(QMouseEvent *); - virtual void viewportMouseReleaseEvent(QMouseEvent *); - virtual void viewportResizeEvent(QResizeEvent*); + virtual void drawContents ( TQPainter * p, int clipx, int clipy, int clipw, int cliph ); + virtual void drawContents( TQPainter* ); + virtual void viewportMousePressEvent( TQMouseEvent * ); + virtual void focusInEvent( TQFocusEvent * ); + virtual void focusOutEvent( TQFocusEvent * ); + virtual void viewportMouseDoubleClickEvent( TQMouseEvent * ); + virtual void viewportMouseMoveEvent(TQMouseEvent *); + virtual void viewportMouseReleaseEvent(TQMouseEvent *); + virtual void viewportResizeEvent(TQResizeEvent*); #ifndef QT_NO_WHEELEVENT - virtual void viewportWheelEvent(QWheelEvent*); + virtual void viewportWheelEvent(TQWheelEvent*); #endif - virtual void dragEnterEvent( QDragEnterEvent* ); - virtual void dropEvent( QDropEvent* ); - virtual void closeEvent ( QCloseEvent * ); - virtual bool eventFilter(QObject *, QEvent *); - - void keyPressEvent( QKeyEvent *_ke ); - void keyReleaseEvent ( QKeyEvent *_ke ); - void contentsContextMenuEvent ( QContextMenuEvent *_ce ); + virtual void dragEnterEvent( TQDragEnterEvent* ); + virtual void dropEvent( TQDropEvent* ); + virtual void closeEvent ( TQCloseEvent * ); + virtual bool eventFilter(TQObject *, TQEvent *); + + void keyPressEvent( TQKeyEvent *_ke ); + void keyReleaseEvent ( TQKeyEvent *_ke ); + void contentsContextMenuEvent ( TQContextMenuEvent *_ce ); void doAutoScroll(); - void timerEvent ( QTimerEvent * ); + void timerEvent ( TQTimerEvent * ); protected slots: void slotPaletteChanged(); void slotScrollBarMoved(); @@ -241,21 +241,21 @@ private: bool dialogsAllowed(); /** - * Paints the HTML document to a QPainter. + * Paints the HTML document to a TQPainter. * The document will be scaled to match the width of * rc and clipped to fit in the height. * yOff determines the vertical offset in the document to start with. * more, if nonzero will be set to true if the documents extends * beyond the rc or false if everything below yOff was painted. **/ - void paint(QPainter *p, const QRect &rc, int yOff = 0, bool *more = 0); + void paint(TQPainter *p, const TQRect &rc, int yOff = 0, bool *more = 0); #if 0 /** - * Paints the HTML document to a QPainter. + * Paints the HTML document to a TQPainter. * The document will be scaled to match the width. **/ - void paint(QPainter *p, int width); + void paint(TQPainter *p, int width); #endif /** @@ -268,18 +268,18 @@ private: * you only need to enable the media type in the view and if necessary * add the media type dependent changes to the renderer. */ - void setMediaType( const QString &medium ); - QString mediaType() const; + void setMediaType( const TQString &medium ); + TQString mediaType() const; bool pagedMode() const; - bool scrollTo(const QRect &); + bool scrollTo(const TQRect &); bool focusNextPrevNode(bool next); - bool handleAccessKey(const QKeyEvent* ev); - bool focusNodeWithAccessKey(QChar c, KHTMLView* caller = NULL); - QMap< DOM::ElementImpl*, QChar > buildFallbackAccessKeys() const; - void displayAccessKeys( KHTMLView* caller, KHTMLView* origview, QValueVector< QChar >& taken, bool use_fallbacks ); + bool handleAccessKey(const TQKeyEvent* ev); + bool focusNodeWithAccessKey(TQChar c, KHTMLView* caller = NULL); + TQMap< DOM::ElementImpl*, TQChar > buildFallbackAccessKeys() const; + void displayAccessKeys( KHTMLView* caller, KHTMLView* origview, TQValueVector< TQChar >& taken, bool use_fallbacks ); void useSlowRepaints(); @@ -292,19 +292,19 @@ private: void restoreScrollBar(); - QStringList formCompletionItems(const QString &name) const; - void clearCompletionHistory(const QString& name); - void addFormCompletionItem(const QString &name, const QString &value); + TQStringList formCompletionItems(const TQString &name) const; + void clearCompletionHistory(const TQString& name); + void addFormCompletionItem(const TQString &name, const TQString &value); - void addNonPasswordStorableSite( const QString& host ); - bool nonPasswordStorableSite( const QString& host ) const; + void addNonPasswordStorableSite( const TQString& host ); + bool nonPasswordStorableSite( const TQString& host ) const; bool dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, DOM::NodeImpl *targetNodeNonShared, bool cancelable, - int detail,QMouseEvent *_mouse, bool setUnder, + int detail,TQMouseEvent *_mouse, bool setUnder, int mouseEventType); - bool dispatchKeyEvent( QKeyEvent *_ke ); - bool dispatchKeyEventHelper( QKeyEvent *_ke, bool generate_keypress ); + bool dispatchKeyEvent( TQKeyEvent *_ke ); + bool dispatchKeyEventHelper( TQKeyEvent *_ke, bool generate_keypress ); void complete( bool pendingAction ); @@ -460,7 +460,7 @@ private: /** * Evaluates key presses on editable nodes. */ - void caretKeyPressEvent(QKeyEvent *); + void caretKeyPressEvent(TQKeyEvent *); // -- caret navigation member functions @@ -597,7 +597,7 @@ private: KHTMLPart *m_part; KHTMLViewPrivate *d; - QString m_medium; // media type + TQString m_medium; // media type }; #endif diff --git a/khtml/kjserrordlg.ui.h b/khtml/kjserrordlg.ui.h index 2513f6308..50b73568e 100644 --- a/khtml/kjserrordlg.ui.h +++ b/khtml/kjserrordlg.ui.h @@ -10,17 +10,17 @@ void KJSErrorDlg::init() { - _errorText->setTextFormat(QTextEdit::LogText); + _errorText->setTextFormat(TQTextEdit::LogText); _errorText->setMaxLogLines(2048);//Limit to about 2K errors so we don't use much CPU } -void KJSErrorDlg::addError( const QString & error ) +void KJSErrorDlg::addError( const TQString & error ) { _errorText->append(error); } -void KJSErrorDlg::setURL( const QString & url ) +void KJSErrorDlg::setURL( const TQString & url ) { _url->setText(url); } diff --git a/khtml/kmultipart/kmultipart.cpp b/khtml/kmultipart/kmultipart.cpp index 708bfc54f..17ea9d485 100644 --- a/khtml/kmultipart/kmultipart.cpp +++ b/khtml/kmultipart/kmultipart.cpp @@ -19,12 +19,12 @@ #include "kmultipart.h" -#include <qvbox.h> +#include <tqvbox.h> #include <kinstance.h> #include <kmimetype.h> #include <klocale.h> #include <kio/job.h> -#include <qfile.h> +#include <tqfile.h> #include <ktempfile.h> #include <kmessagebox.h> #include <kparts/componentfactory.h> @@ -32,7 +32,7 @@ #include <khtml_part.h> #include <unistd.h> #include <kxmlguifactory.h> -#include <qtimer.h> +#include <tqtimer.h> typedef KParts::GenericFactory<KMultiPart> KMultiPartFactory; // factory for the part K_EXPORT_COMPONENT_FACTORY( libkmultipart /*library name*/, KMultiPartFactory ) @@ -51,7 +51,7 @@ public: Q_ASSERT( !m_lineComplete ); if ( storeNewline || c != '\n' ) { int sz = m_currentLine.size(); - m_currentLine.resize( sz+1, QGArray::SpeedOptim ); + m_currentLine.resize( sz+1, TQGArray::SpeedOptim ); m_currentLine[sz] = c; } if ( c == '\n' ) @@ -60,7 +60,7 @@ public: bool isLineComplete() const { return m_lineComplete; } - QByteArray currentLine() const { + TQByteArray currentLine() const { return m_currentLine; } void clearLine() { @@ -68,11 +68,11 @@ public: reset(); } void reset() { - m_currentLine.resize( 0, QGArray::SpeedOptim ); + m_currentLine.resize( 0, TQGArray::SpeedOptim ); m_lineComplete = false; } private: - QByteArray m_currentLine; + TQByteArray m_currentLine; bool m_lineComplete; // true when ending with '\n' }; @@ -93,15 +93,15 @@ Data for the second and last object. */ -KMultiPart::KMultiPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, const QStringList& ) +KMultiPart::KMultiPart( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, const TQStringList& ) : KParts::ReadOnlyPart( parent, name ) { m_filter = 0L; setInstance( KMultiPartFactory::instance() ); - QVBox *box = new QVBox( parentWidget, widgetName ); + TQVBox *box = new TQVBox( parentWidget, widgetName ); setWidget( box ); m_extension = new KParts::BrowserExtension( this ); @@ -114,8 +114,8 @@ KMultiPart::KMultiPart( QWidget *parentWidget, const char *widgetName, m_lineParser = new KLineParser; m_tempFile = 0L; - m_timer = new QTimer( this ); - connect( m_timer, SIGNAL( timeout() ), this, SLOT( slotProgressInfo() ) ); + m_timer = new TQTimer( this ); + connect( m_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotProgressInfo() ) ); } KMultiPart::~KMultiPart() @@ -167,10 +167,10 @@ bool KMultiPart::openURL( const KURL &url ) emit started( 0 /*m_job*/ ); // don't pass the job, it would interfer with our own infoMessage - connect( m_job, SIGNAL( result( KIO::Job * ) ), - this, SLOT( slotJobFinished( KIO::Job * ) ) ); - connect( m_job, SIGNAL( data( KIO::Job *, const QByteArray & ) ), - this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) ); + connect( m_job, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( slotJobFinished( KIO::Job * ) ) ); + connect( m_job, TQT_SIGNAL( data( KIO::Job *, const TQByteArray & ) ), + this, TQT_SLOT( slotData( KIO::Job *, const TQByteArray & ) ) ); m_numberOfFrames = 0; m_numberOfFramesSkipped = 0; @@ -184,17 +184,17 @@ bool KMultiPart::openURL( const KURL &url ) // Yes, libkdenetwork's has such a parser already (MultiPart), // but it works on the complete string, expecting the whole data to be available.... // The version here is asynchronous. -void KMultiPart::slotData( KIO::Job *job, const QByteArray &data ) +void KMultiPart::slotData( KIO::Job *job, const TQByteArray &data ) { if (m_boundary.isNull()) { - QString tmp = job->queryMetaData("media-boundary"); + TQString tmp = job->queryMetaData("media-boundary"); kdDebug() << "Got Boundary from kio-http '" << tmp << "'" << endl; if ( !tmp.isEmpty() ) { if (tmp.startsWith("--")) m_boundary = tmp.latin1(); else - m_boundary = QCString("--")+tmp.latin1(); + m_boundary = TQCString("--")+tmp.latin1(); m_boundaryLength = m_boundary.length(); } } @@ -205,11 +205,11 @@ void KMultiPart::slotData( KIO::Job *job, const QByteArray &data ) m_lineParser->addChar( data[i], !m_bParsingHeader ); if ( m_lineParser->isLineComplete() ) { - QByteArray lineData = m_lineParser->currentLine(); + TQByteArray lineData = m_lineParser->currentLine(); #ifdef DEBUG_PARSING kdDebug() << "lineData.size()=" << lineData.size() << endl; #endif - QCString line( lineData.data(), lineData.size()+1 ); // deep copy + TQCString line( lineData.data(), lineData.size()+1 ); // deep copy // 0-terminate the data, but only for the line-based tests below // We want to keep the raw data in case it ends up in sendData() int sz = line.size(); @@ -234,7 +234,7 @@ void KMultiPart::slotData( KIO::Job *job, const QByteArray &data ) } else if ( !qstrnicmp( line.data(), "Content-Encoding:", 17 ) ) { - QString encoding = QString::fromLatin1(line.data()+17).stripWhiteSpace().lower(); + TQString encoding = TQString::fromLatin1(line.data()+17).stripWhiteSpace().lower(); if (encoding == "gzip" || encoding == "x-gzip") { m_gzip = true; } else { @@ -245,7 +245,7 @@ void KMultiPart::slotData( KIO::Job *job, const QByteArray &data ) else if ( !qstrnicmp( line.data(), "Content-Type:", 13 ) ) { Q_ASSERT( m_nextMimeType.isNull() ); - m_nextMimeType = QString::fromLatin1( line.data() + 14 ).stripWhiteSpace(); + m_nextMimeType = TQString::fromLatin1( line.data() + 14 ).stripWhiteSpace(); int semicolon = m_nextMimeType.find( ';' ); if ( semicolon != -1 ) m_nextMimeType = m_nextMimeType.left( semicolon ); @@ -305,7 +305,7 @@ void KMultiPart::slotData( KIO::Job *job, const QByteArray &data ) } } -void KMultiPart::setPart( const QString& mimeType ) +void KMultiPart::setPart( const TQString& mimeType ) { KXMLGUIFactory *guiFactory = factory(); if ( guiFactory ) // seems to be 0 when restoring from SM @@ -314,7 +314,7 @@ void KMultiPart::setPart( const QString& mimeType ) delete m_part; // Try to find an appropriate viewer component m_part = KParts::ComponentFactory::createPartInstanceFromQuery<KParts::ReadOnlyPart> - ( m_mimeType, QString::null, widget(), 0L, this, 0L ); + ( m_mimeType, TQString::null, widget(), 0L, this, 0L ); if ( !m_part ) { // TODO launch external app KMessageBox::error( widget(), i18n("No handler found for %1!").arg(m_mimeType) ); @@ -324,8 +324,8 @@ void KMultiPart::setPart( const QString& mimeType ) insertChildClient( m_part ); m_part->widget()->show(); - connect( m_part, SIGNAL( completed() ), - this, SLOT( slotPartCompleted() ) ); + connect( m_part, TQT_SIGNAL( completed() ), + this, TQT_SLOT( slotPartCompleted() ) ); m_isHTMLPart = ( mimeType == "text/html" ); KParts::BrowserExtension* childExtension = KParts::BrowserExtension::childObject( m_part ); @@ -336,62 +336,62 @@ void KMultiPart::setPart( const QString& mimeType ) // Forward signals from the part's browser extension // this is very related (but not exactly like) KHTMLPart::processObjectRequest - connect( childExtension, SIGNAL( openURLNotify() ), - m_extension, SIGNAL( openURLNotify() ) ); + connect( childExtension, TQT_SIGNAL( openURLNotify() ), + m_extension, TQT_SIGNAL( openURLNotify() ) ); - connect( childExtension, SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), - m_extension, SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ) ); + connect( childExtension, TQT_SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ), + m_extension, TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ) ); - connect( childExtension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ), - m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ) ); - connect( childExtension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs &, const KParts::WindowArgs &, KParts::ReadOnlyPart *& ) ), - m_extension, SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & , const KParts::WindowArgs &, KParts::ReadOnlyPart *&) ) ); + connect( childExtension, TQT_SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ), + m_extension, TQT_SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & ) ) ); + connect( childExtension, TQT_SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs &, const KParts::WindowArgs &, KParts::ReadOnlyPart *& ) ), + m_extension, TQT_SIGNAL( createNewWindow( const KURL &, const KParts::URLArgs & , const KParts::WindowArgs &, KParts::ReadOnlyPart *&) ) ); // Keep in sync with khtml_part.cpp - connect( childExtension, SIGNAL( popupMenu( const QPoint &, const KFileItemList & ) ), - m_extension, SIGNAL( popupMenu( const QPoint &, const KFileItemList & ) ) ); - connect( childExtension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList & ) ), - m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList & ) ) ); - connect( childExtension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags ) ), - m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KFileItemList &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags ) ) ); - connect( childExtension, SIGNAL( popupMenu( const QPoint &, const KURL &, const QString &, mode_t ) ), - m_extension, SIGNAL( popupMenu( const QPoint &, const KURL &, const QString &, mode_t ) ) ); - connect( childExtension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ), - m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const QString &, mode_t ) ) ); - connect( childExtension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t ) ), - m_extension, SIGNAL( popupMenu( KXMLGUIClient *, const QPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t ) ) ); + connect( childExtension, TQT_SIGNAL( popupMenu( const TQPoint &, const KFileItemList & ) ), + m_extension, TQT_SIGNAL( popupMenu( const TQPoint &, const KFileItemList & ) ) ); + connect( childExtension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KFileItemList & ) ), + m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KFileItemList & ) ) ); + connect( childExtension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KFileItemList &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags ) ), + m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KFileItemList &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags ) ) ); + connect( childExtension, TQT_SIGNAL( popupMenu( const TQPoint &, const KURL &, const TQString &, mode_t ) ), + m_extension, TQT_SIGNAL( popupMenu( const TQPoint &, const KURL &, const TQString &, mode_t ) ) ); + connect( childExtension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const TQString &, mode_t ) ), + m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const TQString &, mode_t ) ) ); + connect( childExtension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t ) ), + m_extension, TQT_SIGNAL( popupMenu( KXMLGUIClient *, const TQPoint &, const KURL &, const KParts::URLArgs &, KParts::BrowserExtension::PopupFlags, mode_t ) ) ); if ( m_isHTMLPart ) - connect( childExtension, SIGNAL( infoMessage( const QString & ) ), - m_extension, SIGNAL( infoMessage( const QString & ) ) ); + connect( childExtension, TQT_SIGNAL( infoMessage( const TQString & ) ), + m_extension, TQT_SIGNAL( infoMessage( const TQString & ) ) ); // For non-HTML we prefer to show our infoMessage ourselves. childExtension->setBrowserInterface( m_extension->browserInterface() ); - connect( childExtension, SIGNAL( enableAction( const char *, bool ) ), - m_extension, SIGNAL( enableAction( const char *, bool ) ) ); - connect( childExtension, SIGNAL( setLocationBarURL( const QString& ) ), - m_extension, SIGNAL( setLocationBarURL( const QString& ) ) ); - connect( childExtension, SIGNAL( setIconURL( const KURL& ) ), - m_extension, SIGNAL( setIconURL( const KURL& ) ) ); - connect( childExtension, SIGNAL( loadingProgress( int ) ), - m_extension, SIGNAL( loadingProgress( int ) ) ); + connect( childExtension, TQT_SIGNAL( enableAction( const char *, bool ) ), + m_extension, TQT_SIGNAL( enableAction( const char *, bool ) ) ); + connect( childExtension, TQT_SIGNAL( setLocationBarURL( const TQString& ) ), + m_extension, TQT_SIGNAL( setLocationBarURL( const TQString& ) ) ); + connect( childExtension, TQT_SIGNAL( setIconURL( const KURL& ) ), + m_extension, TQT_SIGNAL( setIconURL( const KURL& ) ) ); + connect( childExtension, TQT_SIGNAL( loadingProgress( int ) ), + m_extension, TQT_SIGNAL( loadingProgress( int ) ) ); if ( m_isHTMLPart ) // for non-HTML we have our own - connect( childExtension, SIGNAL( speedProgress( int ) ), - m_extension, SIGNAL( speedProgress( int ) ) ); - connect( childExtension, SIGNAL( selectionInfo( const KFileItemList& ) ), - m_extension, SIGNAL( selectionInfo( const KFileItemList& ) ) ); - connect( childExtension, SIGNAL( selectionInfo( const QString& ) ), - m_extension, SIGNAL( selectionInfo( const QString& ) ) ); - connect( childExtension, SIGNAL( selectionInfo( const KURL::List& ) ), - m_extension, SIGNAL( selectionInfo( const KURL::List& ) ) ); - connect( childExtension, SIGNAL( mouseOverInfo( const KFileItem* ) ), - m_extension, SIGNAL( mouseOverInfo( const KFileItem* ) ) ); - connect( childExtension, SIGNAL( moveTopLevelWidget( int, int ) ), - m_extension, SIGNAL( moveTopLevelWidget( int, int ) ) ); - connect( childExtension, SIGNAL( resizeTopLevelWidget( int, int ) ), - m_extension, SIGNAL( resizeTopLevelWidget( int, int ) ) ); + connect( childExtension, TQT_SIGNAL( speedProgress( int ) ), + m_extension, TQT_SIGNAL( speedProgress( int ) ) ); + connect( childExtension, TQT_SIGNAL( selectionInfo( const KFileItemList& ) ), + m_extension, TQT_SIGNAL( selectionInfo( const KFileItemList& ) ) ); + connect( childExtension, TQT_SIGNAL( selectionInfo( const TQString& ) ), + m_extension, TQT_SIGNAL( selectionInfo( const TQString& ) ) ); + connect( childExtension, TQT_SIGNAL( selectionInfo( const KURL::List& ) ), + m_extension, TQT_SIGNAL( selectionInfo( const KURL::List& ) ) ); + connect( childExtension, TQT_SIGNAL( mouseOverInfo( const KFileItem* ) ), + m_extension, TQT_SIGNAL( mouseOverInfo( const KFileItem* ) ) ); + connect( childExtension, TQT_SIGNAL( moveTopLevelWidget( int, int ) ), + m_extension, TQT_SIGNAL( moveTopLevelWidget( int, int ) ) ); + connect( childExtension, TQT_SIGNAL( resizeTopLevelWidget( int, int ) ), + m_extension, TQT_SIGNAL( resizeTopLevelWidget( int, int ) ) ); } m_partIsLoading = false; @@ -414,7 +414,7 @@ void KMultiPart::startOfData() if ( m_gzip ) { m_filter = new HTTPFilterGZip; - connect( m_filter, SIGNAL( output( const QByteArray& ) ), this, SLOT( reallySendData( const QByteArray& ) ) ); + connect( m_filter, TQT_SIGNAL( output( const TQByteArray& ) ), this, TQT_SLOT( reallySendData( const TQByteArray& ) ) ); } if ( m_mimeType != m_nextMimeType ) @@ -429,7 +429,7 @@ void KMultiPart::startOfData() if ( childExtension ) childExtension->setURLArgs( m_extension->urlArgs() ); - m_nextMimeType = QString::null; + m_nextMimeType = TQString::null; if ( m_tempFile ) { m_tempFile->setAutoDelete( true ); delete m_tempFile; @@ -442,12 +442,12 @@ void KMultiPart::startOfData() } else { - // ###### TODO use a QByteArray and a data: URL instead + // ###### TODO use a TQByteArray and a data: URL instead m_tempFile = new KTempFile; } } -void KMultiPart::sendData( const QByteArray& line ) +void KMultiPart::sendData( const TQByteArray& line ) { if ( m_filter ) { @@ -459,7 +459,7 @@ void KMultiPart::sendData( const QByteArray& line ) } } -void KMultiPart::reallySendData( const QByteArray& line ) +void KMultiPart::reallySendData( const TQByteArray& line ) { if ( m_isHTMLPart ) { @@ -511,7 +511,7 @@ void KMultiPart::slotPartCompleted() // Delete temp file used by the part Q_ASSERT( m_part->url().isLocalFile() ); kdDebug() << "slotPartCompleted deleting " << m_part->url().path() << endl; - (void) unlink( QFile::encodeName( m_part->url().path() ) ); + (void) unlink( TQFile::encodeName( m_part->url().path() ) ); m_partIsLoading = false; ++m_numberOfFrames; // Do not emit completed from here. @@ -551,7 +551,7 @@ void KMultiPart::slotJobFinished( KIO::Job *job ) emit completed(); - //QTimer::singleShot( 0, this, SLOT( updateWindowCaption() ) ); + //TQTimer::singleShot( 0, this, TQT_SLOT( updateWindowCaption() ) ); } m_job = 0L; } @@ -563,7 +563,7 @@ void KMultiPart::slotProgressInfo() if ( m_totalNumberOfFrames == m_numberOfFrames + m_numberOfFramesSkipped ) return; // No change, don't overwrite statusbar messages if any //kdDebug() << m_numberOfFrames << " in " << time << " milliseconds" << endl; - QString str( "%1 frames per second, %2 frames skipped per second" ); + TQString str( "%1 frames per second, %2 frames skipped per second" ); str = str.arg( 1000.0 * (double)m_numberOfFrames / (double)time ); str = str.arg( 1000.0 * (double)m_numberOfFramesSkipped / (double)time ); m_totalNumberOfFrames = m_numberOfFrames + m_numberOfFramesSkipped; diff --git a/khtml/kmultipart/kmultipart.h b/khtml/kmultipart/kmultipart.h index b0633a64d..f3bf95219 100644 --- a/khtml/kmultipart/kmultipart.h +++ b/khtml/kmultipart/kmultipart.h @@ -26,7 +26,7 @@ #include <kparts/factory.h> #include <kparts/browserextension.h> #include <kaboutdata.h> -#include <qdatetime.h> +#include <tqdatetime.h> class KHTMLPart; class KInstance; @@ -40,8 +40,8 @@ class KMultiPart : public KParts::ReadOnlyPart { Q_OBJECT public: - KMultiPart( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, const QStringList& ); + KMultiPart( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, const TQStringList& ); virtual ~KMultiPart(); virtual bool openFile() { return false; } @@ -53,17 +53,17 @@ public: protected: virtual void guiActivateEvent( KParts::GUIActivateEvent *e ); - void setPart( const QString& mimeType ); + void setPart( const TQString& mimeType ); void startOfData(); - void sendData( const QByteArray& line ); + void sendData( const TQByteArray& line ); void endOfData(); private slots: - void reallySendData( const QByteArray& line ); - //void slotPopupMenu( KXMLGUIClient *cl, const QPoint &pos, const KURL &u, const QString &mime, mode_t mode ); + void reallySendData( const TQByteArray& line ); + //void slotPopupMenu( KXMLGUIClient *cl, const TQPoint &pos, const KURL &u, const TQString &mime, mode_t mode ); void slotJobFinished( KIO::Job *job ); - void slotData( KIO::Job *, const QByteArray & ); + void slotData( KIO::Job *, const TQByteArray & ); //void updateWindowCaption(); void slotPartCompleted(); @@ -74,14 +74,14 @@ private slots: private: KParts::BrowserExtension* m_extension; - QGuardedPtr<KParts::ReadOnlyPart> m_part; + TQGuardedPtr<KParts::ReadOnlyPart> m_part; bool m_isHTMLPart; bool m_partIsLoading; KIO::Job* m_job; - QCString m_boundary; + TQCString m_boundary; int m_boundaryLength; - QString m_mimeType; // the one handled by m_part - store the kservice instead? - QString m_nextMimeType; // while parsing headers + TQString m_mimeType; // the one handled by m_part - store the kservice instead? + TQString m_nextMimeType; // while parsing headers KTempFile* m_tempFile; KLineParser* m_lineParser; bool m_bParsingHeader; @@ -92,8 +92,8 @@ private: long m_totalNumberOfFrames; long m_numberOfFrames; long m_numberOfFramesSkipped; - QTime m_qtime; - QTimer* m_timer; + TQTime m_qtime; + TQTimer* m_timer; }; #if 0 diff --git a/khtml/misc/decoder.cpp b/khtml/misc/decoder.cpp index 56f68b429..f227f4014 100644 --- a/khtml/misc/decoder.cpp +++ b/khtml/misc/decoder.cpp @@ -36,8 +36,8 @@ using namespace khtml; #include "htmlhashes.h" -#include <qregexp.h> -#include <qtextcodec.h> +#include <tqregexp.h> +#include <tqtextcodec.h> #include <kglobal.h> #include <kcharsets.h> @@ -51,7 +51,7 @@ using namespace khtml; Decoder::Decoder() { // latin1 - m_codec = QTextCodec::codecForMib(4); + m_codec = TQTextCodec::codecForMib(4); m_decoder = m_codec->makeDecoder(); enc = 0; m_type = DefaultEncoding; @@ -86,9 +86,9 @@ void Decoder::setEncoding(const char *_encoding, EncodingType type) return; #ifdef APPLE_CHANGES - QTextCodec *codec = (type == EncodingFromMetaTag || type == EncodingFromXMLHeader) - ? QTextCodec::codecForNameEightBitOnly(enc) - : QTextCodec::codecForName(enc); + TQTextCodec *codec = (type == EncodingFromMetaTag || type == EncodingFromXMLHeader) + ? TQTextCodec::codecForNameEightBitOnly(enc) + : TQTextCodec::codecForName(enc); if (codec) { enc = codec->name(); visualRTL = codec->usesVisualOrdering(); @@ -97,7 +97,7 @@ void Decoder::setEncoding(const char *_encoding, EncodingType type) if(enc == "visual") // hebrew visually ordered enc = "iso8859-8"; bool b; - QTextCodec *codec = KGlobal::charsets()->codecForName(enc, b); + TQTextCodec *codec = KGlobal::charsets()->codecForName(enc, b); if (!b) codec = 0; @@ -110,8 +110,8 @@ void Decoder::setEncoding(const char *_encoding, EncodingType type) } if (codec && codec->mibEnum() == 11) { - //We do NOT want to use Qt's QHebrewCodec, since it tries to reorder itself. - codec = QTextCodec::codecForName("iso8859-8-i"); + //We do NOT want to use Qt's TQHebrewCodec, since it tries to reorder itself. + codec = TQTextCodec::codecForName("iso8859-8-i"); // visually ordered unless one of the following if( !(enc == "iso-8859-8-i" || enc == "iso_8859-8-i" @@ -166,7 +166,7 @@ static void skipComment(const char *&ptr, const char *pEnd) } // Returns the position of the encoding string. -static int findXMLEncoding(const QCString &str, int &encodingLength) +static int findXMLEncoding(const TQCString &str, int &encodingLength) { int len = str.length(); @@ -214,7 +214,7 @@ static int findXMLEncoding(const QCString &str, int &encodingLength) return pos; } -QString Decoder::decode(const char *data, int len) +TQString Decoder::decode(const char *data, int len) { // Check for UTF-16 or UTF-8 BOM mark at the beginning, which is a sure sign of a Unicode encoding. int bufferLength = buffer.length(); @@ -257,7 +257,7 @@ QString Decoder::decode(const char *data, int len) // If we found a BOM, use the encoding it implies. if (autoDetectedEncoding != 0) { m_type = AutoDetectedEncoding; - m_codec = QTextCodec::codecForName(autoDetectedEncoding); + m_codec = TQTextCodec::codecForName(autoDetectedEncoding); assert(m_codec); enc = m_codec->name(); delete m_decoder; @@ -295,7 +295,7 @@ QString Decoder::decode(const char *data, int len) i--; } } - buffer += QCString(data, len+1); + buffer += TQCString(data, len+1); #endif // we still don't have an encoding, and are in the head // the following tags are allowed in <head>: @@ -327,7 +327,7 @@ QString Decoder::decode(const char *data, int len) while (*end != '>' && *end != '\0') end++; if (*end == '\0') break; - QCString str(ptr, end - ptr + 1); //+1 as it must include the \0 terminator + TQCString str(ptr, end - ptr + 1); //+1 as it must include the \0 terminator int len; int pos = findXMLEncoding(str, len); if (pos != -1) { @@ -362,7 +362,7 @@ QString Decoder::decode(const char *data, int len) const char * end = ptr; while(*end != '>' && *end != '\0') end++; if ( *end == '\0' ) break; - QCString str( ptr, (end-ptr)+1); + TQCString str( ptr, (end-ptr)+1); str = str.lower(); int pos = 0; //if( (pos = str.find("http-equiv", pos)) == -1) break; @@ -442,7 +442,7 @@ QString Decoder::decode(const char *data, int len) body = true; goto found; } - return QString::null; + return TQString::null; } } @@ -505,16 +505,16 @@ QString Decoder::decode(const char *data, int len) if (!m_codec) { if(enc.isEmpty()) enc = "iso8859-1"; - m_codec = QTextCodec::codecForName(enc); + m_codec = TQTextCodec::codecForName(enc); // be sure not to crash if(!m_codec) { - m_codec = QTextCodec::codecForMib(4); + m_codec = TQTextCodec::codecForMib(4); enc = "iso8859-1"; } delete m_decoder; m_decoder = m_codec->makeDecoder(); } - QString out; + TQString out; if(!buffer.isEmpty() && enc != "ISO-10646-UCS-2") { out = m_decoder->toUnicode(buffer, buffer.length()); @@ -522,7 +522,7 @@ QString Decoder::decode(const char *data, int len) } else { if(m_codec->mibEnum() != 1000) // utf16 { - // ### hack for a bug in QTextCodec. It cut's the input stream + // ### hack for a bug in TQTextCodec. It cut's the input stream // in case there are \0 in it. ZDNET has them inside... :-( char *d = const_cast<char *>(data); int i = len - 1; @@ -537,12 +537,12 @@ QString Decoder::decode(const char *data, int len) return out; } -QString Decoder::flush() const +TQString Decoder::flush() const { return m_decoder->toUnicode(buffer, buffer.length()); } -QCString Decoder::automaticDetectionForArabic( const unsigned char* ptr, int size ) +TQCString Decoder::automaticDetectionForArabic( const unsigned char* ptr, int size ) { for ( int i = 0; i < size; ++i ) { if ( ( ptr[ i ] >= 0x80 && ptr[ i ] <= 0x9F ) || ptr[ i ] == 0xA1 || ptr[ i ] == 0xA2 || ptr[ i ] == 0xA3 @@ -556,7 +556,7 @@ QCString Decoder::automaticDetectionForArabic( const unsigned char* ptr, int siz return "iso-8859-6"; } -QCString Decoder::automaticDetectionForBaltic( const unsigned char* ptr, int size ) +TQCString Decoder::automaticDetectionForBaltic( const unsigned char* ptr, int size ) { for ( int i = 0; i < size; ++i ) { if ( ( ptr[ i ] >= 0x80 && ptr[ i ] <= 0x9E ) ) @@ -569,9 +569,9 @@ QCString Decoder::automaticDetectionForBaltic( const unsigned char* ptr, int siz return "iso-8859-13"; } -QCString Decoder::automaticDetectionForCentralEuropean(const unsigned char* ptr, int size ) +TQCString Decoder::automaticDetectionForCentralEuropean(const unsigned char* ptr, int size ) { - QCString charset = QCString(); + TQCString charset = TQCString(); for ( int i = 0; i < size; ++i ) { if ( ptr[ i ] >= 0x80 && ptr[ i ] <= 0x9F ) { if ( ptr[ i ] == 0x81 || ptr[ i ] == 0x83 || ptr[ i ] == 0x90 || ptr[ i ] == 0x98 ) @@ -601,7 +601,7 @@ QCString Decoder::automaticDetectionForCentralEuropean(const unsigned char* ptr, return charset.data(); } -QCString Decoder::automaticDetectionForCyrillic( const unsigned char* ptr, int size, AutoDetectLanguage _language ) +TQCString Decoder::automaticDetectionForCyrillic( const unsigned char* ptr, int size, AutoDetectLanguage _language ) { int koi_st=0; int cp1251_st=0; @@ -680,8 +680,8 @@ QCString Decoder::automaticDetectionForCyrillic( const unsigned char* ptr, int s if (ibm866_small_range>cp1251_small_range+koi_small_range) return "ibm866"; //hehe this is a rare case :) - QCString koi_string = "koi8-u"; - QCString cp1251_string = "cp1251"; + TQCString koi_string = "koi8-u"; + TQCString cp1251_string = "cp1251"; if (cp1251_st==0 && koi_st>1) return koi_string; @@ -714,7 +714,7 @@ QCString Decoder::automaticDetectionForCyrillic( const unsigned char* ptr, int s } -QCString Decoder::automaticDetectionForGreek( const unsigned char* ptr, int size ) +TQCString Decoder::automaticDetectionForGreek( const unsigned char* ptr, int size ) { for ( int i = 0; i < size; ++i ) { if ( ptr[ i ] == 0x80 || ( ptr[ i ] >= 0x82 && ptr[ i ] <= 0x87 ) || ptr[ i ] == 0x89 || ptr[ i ] == 0x8B @@ -727,7 +727,7 @@ QCString Decoder::automaticDetectionForGreek( const unsigned char* ptr, int size return "iso-8859-7"; } -QCString Decoder::automaticDetectionForHebrew( const unsigned char* ptr, int size ) +TQCString Decoder::automaticDetectionForHebrew( const unsigned char* ptr, int size ) { for ( int i = 0; i < size; ++i ) { if ( ptr[ i ] == 0x80 || ( ptr[ i ] >= 0x82 && ptr[ i ] <= 0x89 ) || ptr[ i ] == 0x8B @@ -743,7 +743,7 @@ QCString Decoder::automaticDetectionForHebrew( const unsigned char* ptr, int siz return "iso-8859-8-i"; } -QCString Decoder::automaticDetectionForJapanese( const unsigned char* ptr, int size ) +TQCString Decoder::automaticDetectionForJapanese( const unsigned char* ptr, int size ) { if (!kc) kc = new JapaneseCode(); @@ -764,7 +764,7 @@ QCString Decoder::automaticDetectionForJapanese( const unsigned char* ptr, int s return ""; } -QCString Decoder::automaticDetectionForTurkish( const unsigned char* ptr, int size ) +TQCString Decoder::automaticDetectionForTurkish( const unsigned char* ptr, int size ) { for ( int i = 0; i < size; ++i ) { if ( ptr[ i ] == 0x80 || ( ptr[ i ] >= 0x82 && ptr[ i ] <= 0x8C ) || ( ptr[ i ] >= 0x91 && ptr[ i ] <= 0x9C ) || ptr[ i ] == 0x9F ) { @@ -775,7 +775,7 @@ QCString Decoder::automaticDetectionForTurkish( const unsigned char* ptr, int si return "iso-8859-9"; } -QCString Decoder::automaticDetectionForWesternEuropean( const unsigned char* ptr, int size ) +TQCString Decoder::automaticDetectionForWesternEuropean( const unsigned char* ptr, int size ) { for ( int i = 0; i < size; ++i ) { if ( ptr[ i ] >= 0x80 && ptr[ i ] <= 0x9F ) diff --git a/khtml/misc/decoder.h b/khtml/misc/decoder.h index 613b14043..49c3835fe 100644 --- a/khtml/misc/decoder.h +++ b/khtml/misc/decoder.h @@ -22,7 +22,7 @@ #ifndef KHTMLDECODER_H #define KHTMLDECODER_H -#include <qstring.h> +#include <tqstring.h> class QTextCodec; class QTextDecoder; @@ -51,13 +51,13 @@ public: void setEncoding(const char *encoding, EncodingType type); const char *encoding() const; - QString decode(const char *data, int len); + TQString decode(const char *data, int len); bool visuallyOrdered() const { return visualRTL; } - const QTextCodec *codec() const { return m_codec; } + const TQTextCodec *codec() const { return m_codec; } - QString flush() const; + TQString flush() const; enum AutoDetectLanguage { @@ -84,23 +84,23 @@ public: private: - QCString automaticDetectionForArabic( const unsigned char* str, int size ); - QCString automaticDetectionForBaltic( const unsigned char* str, int size ); - QCString automaticDetectionForCentralEuropean( const unsigned char* str, int size ); - QCString automaticDetectionForCyrillic( const unsigned char* str, int size, AutoDetectLanguage _language ); - QCString automaticDetectionForGreek( const unsigned char* str, int size ); - QCString automaticDetectionForHebrew( const unsigned char* str, int size ); - QCString automaticDetectionForJapanese( const unsigned char* str, int size ); - QCString automaticDetectionForTurkish( const unsigned char* str, int size ); - QCString automaticDetectionForWesternEuropean( const unsigned char* str, int size ); + TQCString automaticDetectionForArabic( const unsigned char* str, int size ); + TQCString automaticDetectionForBaltic( const unsigned char* str, int size ); + TQCString automaticDetectionForCentralEuropean( const unsigned char* str, int size ); + TQCString automaticDetectionForCyrillic( const unsigned char* str, int size, AutoDetectLanguage _language ); + TQCString automaticDetectionForGreek( const unsigned char* str, int size ); + TQCString automaticDetectionForHebrew( const unsigned char* str, int size ); + TQCString automaticDetectionForJapanese( const unsigned char* str, int size ); + TQCString automaticDetectionForTurkish( const unsigned char* str, int size ); + TQCString automaticDetectionForWesternEuropean( const unsigned char* str, int size ); // codec used for decoding. default is Latin1. - QTextCodec *m_codec; - QTextDecoder *m_decoder; // only used for utf16 - QCString enc; + TQTextCodec *m_codec; + TQTextDecoder *m_decoder; // only used for utf16 + TQCString enc; EncodingType m_type; - QCString buffer; + TQCString buffer; bool body; bool beginning; diff --git a/khtml/misc/guess_ja.cpp b/khtml/misc/guess_ja.cpp index 0846d15eb..62934445b 100644 --- a/khtml/misc/guess_ja.cpp +++ b/khtml/misc/guess_ja.cpp @@ -37,7 +37,7 @@ */ /* - * Maybe we should use QTextCodec::heuristicContentMatch() + * Maybe we should use TQTextCodec::heuristicContentMatch() * But it fails detection. It's not useful. */ #include "decoder.h" diff --git a/khtml/misc/helper.cpp b/khtml/misc/helper.cpp index eebba5015..f56a4ba92 100644 --- a/khtml/misc/helper.cpp +++ b/khtml/misc/helper.cpp @@ -22,25 +22,25 @@ */ #include "helper.h" #include "khtmllayout.h" -#include <qmap.h> -#include <qpainter.h> +#include <tqmap.h> +#include <tqpainter.h> #include <dom/dom_string.h> #include <xml/dom_stringimpl.h> #include <rendering/render_object.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include <kstaticdeleter.h> #include <kapplication.h> #include <kconfig.h> -#include <qtooltip.h> +#include <tqtooltip.h> using namespace DOM; using namespace khtml; namespace khtml { - QPainter *printpainter; + TQPainter *printpainter; } -void khtml::setPrintPainter( QPainter *printer ) +void khtml::setPrintPainter( TQPainter *printer ) { printpainter = printer; } @@ -78,9 +78,9 @@ QRgb khtml::qRgbaFromHsla(double h, double s, double l, double a) * @param obj render object * @return the background color. It is guaranteed that a valid color is returned. */ -QColor khtml::retrieveBackgroundColor(const RenderObject *obj) +TQColor khtml::retrieveBackgroundColor(const RenderObject *obj) { - QColor result; + TQColor result; while (!obj->isCanvas()) { result = obj->style()->backgroundColor(); if (result.isValid()) return result; @@ -95,7 +95,7 @@ QColor khtml::retrieveBackgroundColor(const RenderObject *obj) /** checks whether the given colors have enough contrast * @returns @p true if contrast is ok. */ -bool khtml::hasSufficientContrast(const QColor &c1, const QColor &c2) +bool khtml::hasSufficientContrast(const TQColor &c1, const TQColor &c2) { // New version from Germain Garand, better suited for contrast measurement #if 1 diff --git a/khtml/misc/helper.h b/khtml/misc/helper.h index 984ddfc11..4e5b0d7e8 100644 --- a/khtml/misc/helper.h +++ b/khtml/misc/helper.h @@ -22,10 +22,10 @@ #ifndef html_helper_h #define html_helper_h -#include <qcolor.h> +#include <tqcolor.h> class QPainter; -#include <qfontmetrics.h> -#include <qfont.h> +#include <tqfontmetrics.h> +#include <tqfont.h> @@ -35,11 +35,11 @@ namespace khtml const QRgb transparentColor = 0x00000000; const QRgb invertedColor = 0x00000002; - extern QPainter *printpainter; - void setPrintPainter( QPainter *printer ); + extern TQPainter *printpainter; + void setPrintPainter( TQPainter *printer ); - bool hasSufficientContrast(const QColor &c1, const QColor &c2); - QColor retrieveBackgroundColor(const RenderObject *obj); + bool hasSufficientContrast(const TQColor &c1, const TQColor &c2); + TQColor retrieveBackgroundColor(const RenderObject *obj); QRgb qRgbaFromHsla(double h, double s, double l, double a); //enumerator for findSelectionNode diff --git a/khtml/misc/knsplugininstaller.cpp b/khtml/misc/knsplugininstaller.cpp index 71f86f650..1a9bf62bb 100644 --- a/khtml/misc/knsplugininstaller.cpp +++ b/khtml/misc/knsplugininstaller.cpp @@ -31,15 +31,15 @@ #include <ktempfile.h> #include <netaccess.h> -#include <qbuttongroup.h> -#include <qdir.h> -#include <qiodevice.h> -#include <qfile.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qmap.h> -#include <qstringlist.h> -#include <qtextstream.h> +#include <tqbuttongroup.h> +#include <tqdir.h> +#include <tqiodevice.h> +#include <tqfile.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqmap.h> +#include <tqstringlist.h> +#include <tqtextstream.h> #include <sys/utsname.h> @@ -53,8 +53,8 @@ class PluginListItem : public QListViewItem { public: - PluginListItem(KNSPluginInfo pluginInfo, QListView *parent) - : QListViewItem(parent, pluginInfo.pluginName()) + PluginListItem(KNSPluginInfo pluginInfo, TQListView *parent) + : TQListViewItem(parent, pluginInfo.pluginName()) , m_pluginInfo(pluginInfo) {} KNSPluginInfo pluginInfo() const { return m_pluginInfo; } @@ -66,7 +66,7 @@ private: // public methods -KNSPluginInstallEngine::KNSPluginInstallEngine(KMimeType::Ptr mime) : QObject() +KNSPluginInstallEngine::KNSPluginInstallEngine(KMimeType::Ptr mime) : TQObject() { m_mime = mime; @@ -101,14 +101,14 @@ bool KNSPluginInstallEngine::pluginAvailable() bool KNSPluginInstallEngine::isActive() { // check if we have a configuration key in the kde registry - QString pluginsListFile; + TQString pluginsListFile; KConfig cfg("kcmnspluginrc", true); cfg.setGroup("Misc"); pluginsListFile = cfg.readPathEntry("PluginsListFile"); return !pluginsListFile.isEmpty(); } -const QValueList<KNSPluginInfo>& KNSPluginInstallEngine::pluginList() const +const TQValueList<KNSPluginInfo>& KNSPluginInstallEngine::pluginList() const { return m_pluginList; } @@ -116,7 +116,7 @@ const QValueList<KNSPluginInfo>& KNSPluginInstallEngine::pluginList() const // private methods bool KNSPluginInstallEngine::loadConfig() { - QString pluginsListFile; + TQString pluginsListFile; KConfig cfg("kcmnspluginrc", true); cfg.setGroup("Misc"); pluginsListFile = cfg.readPathEntry("PluginsListFile"); @@ -135,13 +135,13 @@ bool KNSPluginInstallEngine::loadXmlConfig() // load the Xml configuration file if(m_pluginsXmlConfig.isEmpty()) { - QString tmpFile; + TQString tmpFile; if(KIO::NetAccess::download(m_pluginsListFileURL, tmpFile, NULL)) { - QFile f(tmpFile); + TQFile f(tmpFile); if(!f.open(IO_ReadOnly)) return false; - QTextStream stream(&f); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::UnicodeUTF8); m_pluginsXmlConfig = stream.read(); f.close(); KIO::NetAccess::removeTempFile(tmpFile); @@ -160,16 +160,16 @@ bool KNSPluginInstallEngine::findPlugin() utsname sysinfo; if(uname(&sysinfo)) return false; - QString sysname(sysinfo.sysname); - QString machine(sysinfo.machine); - QString arch = m_archMap[machine]; + TQString sysname(sysinfo.sysname); + TQString machine(sysinfo.machine); + TQString arch = m_archMap[machine]; // Parse the document - QDomDocument doc("xmlConfig"); + TQDomDocument doc("xmlConfig"); doc.setContent(m_pluginsXmlConfig); - QDomNodeList archList = doc.elementsByTagName(QString("arch")); - QDomNode archNode, osNode , pluginNode, node; - QDomElement e; + TQDomNodeList archList = doc.elementsByTagName(TQString("arch")); + TQDomNode archNode, osNode , pluginNode, node; + TQDomElement e; // look for the correct architecture bool found = false; @@ -227,15 +227,15 @@ void KNSPluginInstallEngine::startInstall(KNSPluginInfo info) { m_toInstallPluginInfo = info; // create a temporary dowload file - KTempFile tempFile(locateLocal("tmp", "plugin") , QString(".tar.gz")); + KTempFile tempFile(locateLocal("tmp", "plugin") , TQString(".tar.gz")); m_tmpPluginFileName = tempFile.name(); tempFile.unlink(); tempFile.close(); // start the download job m_downloadJob = KIO::copy(info.pluginURL(), "file://"+m_tmpPluginFileName, false ); // connect signals - connect(m_downloadJob, SIGNAL(percent (KIO::Job *, unsigned long)), this , SLOT(slotDownLoadProgress(KIO::Job *, unsigned long))); - connect(m_downloadJob, SIGNAL(result(KIO::Job *)), this, SLOT(slotDownloadResult(KIO::Job *)) ); + connect(m_downloadJob, TQT_SIGNAL(percent (KIO::Job *, unsigned long)), this , TQT_SLOT(slotDownLoadProgress(KIO::Job *, unsigned long))); + connect(m_downloadJob, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotDownloadResult(KIO::Job *)) ); kdDebug(DEBUG_NUMBER) << "download plugin " << m_tmpPluginFileName << endl; } @@ -257,7 +257,7 @@ void KNSPluginInstallEngine::slotDownloadResult(KIO::Job *job) // the download succeed copy the plugins files // test the existance of the homedir - QDir dir(QDir::homeDirPath()); + TQDir dir(TQDir::homeDirPath()); if(!dir.exists()) { emit installFailed(); return; @@ -269,19 +269,19 @@ void KNSPluginInstallEngine::slotDownloadResult(KIO::Job *job) if(!dir.exists(".mozilla/plugins")) dir.mkdir(".mozilla/plugins"); // destination kurl - KURL destURL("file://"+QDir::homeDirPath()+"/.mozilla/plugins"); + KURL destURL("file://"+TQDir::homeDirPath()+"/.mozilla/plugins"); // construct the source kurlList KURL::List urlList; - QStringList pluginFileList = m_toInstallPluginInfo.pluginFileList(); + TQStringList pluginFileList = m_toInstallPluginInfo.pluginFileList(); - QStringList::iterator it; + TQStringList::iterator it; for( it = pluginFileList.begin(); it != pluginFileList.end(); ++it ) { urlList.append( KURL("tar://"+m_tmpPluginFileName+"/"+(*it)) ); } m_installFileJob = KIO::copy(urlList , destURL, false ); - connect(m_installFileJob, SIGNAL(percent (KIO::Job *, unsigned long)), this , SLOT(slotCopyProgress(KIO::Job *, unsigned long))); - connect(m_installFileJob, SIGNAL(result(KIO::Job *)), this, SLOT(slotCopyResult(KIO::Job *)) ); + connect(m_installFileJob, TQT_SIGNAL(percent (KIO::Job *, unsigned long)), this , TQT_SLOT(slotCopyProgress(KIO::Job *, unsigned long))); + connect(m_installFileJob, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotCopyResult(KIO::Job *)) ); } kdDebug(DEBUG_NUMBER) << "COPY FILE " << m_tmpPluginFileName << endl; @@ -304,14 +304,14 @@ void KNSPluginInstallEngine::slotCopyResult(KIO::Job *job) } else { // start the plugins scan - m_scanProc = new QProcess( this ); + m_scanProc = new TQProcess( this ); m_scanProc->addArgument( "nspluginscan" ); m_scanProc->addArgument( "--verbose" ); - connect( m_scanProc, SIGNAL(readyReadStdout()), - this, SLOT(readScanProcFromStdout()) ); - connect( m_scanProc, SIGNAL(processExited()), - this, SLOT(endScanProc()) ); + connect( m_scanProc, TQT_SIGNAL(readyReadStdout()), + this, TQT_SLOT(readScanProcFromStdout()) ); + connect( m_scanProc, TQT_SIGNAL(processExited()), + this, TQT_SLOT(endScanProc()) ); if ( !m_scanProc->start() ) { emit installFailed(); } @@ -321,7 +321,7 @@ void KNSPluginInstallEngine::slotCopyResult(KIO::Job *job) void KNSPluginInstallEngine::readScanProcFromStdout() { // Monitor the scan progress - QString progress = m_scanProc->readLineStdout(); + TQString progress = m_scanProc->readLineStdout(); int percent; bool ok; percent = progress.toInt(&ok); @@ -341,7 +341,7 @@ void KNSPluginInstallEngine::endScanProc() emit installFailed(); } -KNSPluginWizard::KNSPluginWizard(QWidget *parent, const char *name, KMimeType::Ptr mime) +KNSPluginWizard::KNSPluginWizard(TQWidget *parent, const char *name, KMimeType::Ptr mime) : KWizard(parent, name, true) , m_installEngine(mime) { @@ -374,19 +374,19 @@ KNSPluginWizard::~KNSPluginWizard() void KNSPluginWizard::initConfirmationPage() { - m_confirmationVBox = new QVBox(this); - new QLabel(i18n("The following plugins are available."), m_confirmationVBox); + m_confirmationVBox = new TQVBox(this); + new TQLabel(i18n("The following plugins are available."), m_confirmationVBox); m_pluginListView = new KListView(m_confirmationVBox); m_pluginListView->addColumn(i18n("Name")); - m_pluginListView->setSelectionMode(QListView::Single); - new QLabel(i18n("Click on next to install the selected plugin."), m_confirmationVBox); + m_pluginListView->setSelectionMode(TQListView::Single); + new TQLabel(i18n("Click on next to install the selected plugin."), m_confirmationVBox); addPage (m_confirmationVBox, i18n("Plugin installation confirmation")); bool selected = false; // Fill the plugin list - QValueList<KNSPluginInfo>::iterator it; - QValueList<KNSPluginInfo> pluginList = m_installEngine.pluginList(); + TQValueList<KNSPluginInfo>::iterator it; + TQValueList<KNSPluginInfo> pluginList = m_installEngine.pluginList(); for( it = pluginList.begin(); it != pluginList.end(); ++it ) { PluginListItem *item = new PluginListItem((*it) , m_pluginListView); if(!selected) { @@ -400,20 +400,20 @@ void KNSPluginWizard::initConfirmationPage() void KNSPluginWizard::initLicencePage() { - m_licenceVBox = new QVBox(this); - m_licencePageLabel = new QLabel(m_licenceVBox); + m_licenceVBox = new TQVBox(this); + m_licencePageLabel = new TQLabel(m_licenceVBox); m_licencePageText = new KTextEdit(m_licenceVBox); m_licencePageText->setReadOnly(true); // invisible buttonGroup - QButtonGroup *buttonGroup = new QButtonGroup(this); + TQButtonGroup *buttonGroup = new TQButtonGroup(this); m_agreementButtonGroup = buttonGroup; buttonGroup->hide(); buttonGroup->setExclusive(true); - m_licencePageAgree = new QRadioButton ( i18n("I agree."), m_licenceVBox); + m_licencePageAgree = new TQRadioButton ( i18n("I agree."), m_licenceVBox); - m_licencePageDisagree = new QRadioButton ( i18n("I do not agree (plugin will not be installed)."), m_licenceVBox); + m_licencePageDisagree = new TQRadioButton ( i18n("I do not agree (plugin will not be installed)."), m_licenceVBox); buttonGroup->insert(m_licencePageAgree); buttonGroup->insert(m_licencePageDisagree); @@ -422,15 +422,15 @@ void KNSPluginWizard::initLicencePage() addPage (m_licenceVBox, i18n("Plugin licence")); - connect(buttonGroup, SIGNAL(clicked(int)), this, SLOT(slotAgreementClicked(int))); + connect(buttonGroup, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(slotAgreementClicked(int))); } void KNSPluginWizard::initInstallationProgressPage() { - m_installationProgressWidget = new QWidget(this); - QVBoxLayout *layout = new QVBoxLayout(m_installationProgressWidget); - layout->addWidget(new QLabel(i18n("Installation in progress."), m_installationProgressWidget)); - layout->addItem(new QSpacerItem(40,20,QSizePolicy::Expanding,QSizePolicy::Expanding )); + m_installationProgressWidget = new TQWidget(this); + TQVBoxLayout *layout = new TQVBoxLayout(m_installationProgressWidget); + layout->addWidget(new TQLabel(i18n("Installation in progress."), m_installationProgressWidget)); + layout->addItem(new TQSpacerItem(40,20,TQSizePolicy::Expanding,TQSizePolicy::Expanding )); m_installationProgressBar = new KProgress(m_installationProgressWidget); m_installationProgressBar->setTotalSteps(100); layout->addWidget(m_installationProgressBar); @@ -441,12 +441,12 @@ void KNSPluginWizard::initInstallationProgressPage() { void KNSPluginWizard::initFinishPage() { - m_finishWidget = new QWidget(this); - QVBoxLayout *layout = new QVBoxLayout(m_finishWidget); - layout->addItem(new QSpacerItem(40,20,QSizePolicy::Expanding,QSizePolicy::Expanding )); - m_finishLabel = new QLabel(m_finishWidget); + m_finishWidget = new TQWidget(this); + TQVBoxLayout *layout = new TQVBoxLayout(m_finishWidget); + layout->addItem(new TQSpacerItem(40,20,TQSizePolicy::Expanding,TQSizePolicy::Expanding )); + m_finishLabel = new TQLabel(m_finishWidget); layout->addWidget(m_finishLabel); - layout->addItem(new QSpacerItem(40,20,QSizePolicy::Expanding,QSizePolicy::Expanding )); + layout->addItem(new TQSpacerItem(40,20,TQSizePolicy::Expanding,TQSizePolicy::Expanding )); addPage(m_finishWidget, i18n("Installation status")); @@ -482,30 +482,30 @@ void KNSPluginWizard::initPagesButtonStates() void KNSPluginWizard::connectSignals() { - connect(&m_installEngine, SIGNAL(installProgress(int)), m_installationProgressBar, SLOT(setProgress(int)) ); - connect(&m_installEngine, SIGNAL(installCompleted()), this, SLOT(slotInstallationCompleted()) ); - connect(&m_installEngine, SIGNAL(installFailed()), this, SLOT(slotInstallationFailed()) ); + connect(&m_installEngine, TQT_SIGNAL(installProgress(int)), m_installationProgressBar, TQT_SLOT(setProgress(int)) ); + connect(&m_installEngine, TQT_SIGNAL(installCompleted()), this, TQT_SLOT(slotInstallationCompleted()) ); + connect(&m_installEngine, TQT_SIGNAL(installFailed()), this, TQT_SLOT(slotInstallationFailed()) ); } -void KNSPluginWizard::showPage(QWidget *page) +void KNSPluginWizard::showPage(TQWidget *page) { // if the licence page is shown set the label and the licence content if(page == m_licenceVBox && m_licencePageLabel->text().isEmpty()) { KNSPluginInfo info = static_cast<PluginListItem *>(m_pluginListView->selectedItem())->pluginInfo(); m_licencePageLabel->setText(i18n("To install ")+info.pluginName()+i18n(" you need to agree to the following")); - QString licence; + TQString licence; licence = info.licence(); - QString tmpFile; + TQString tmpFile; if(info.licenceURL().isValid()) // retrieve the licence if we have an url if(KIO::NetAccess::download(info.licenceURL(), tmpFile, NULL)) { - QFile f(tmpFile); + TQFile f(tmpFile); if(f.open(IO_ReadOnly)) { - QTextStream stream(&f); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::UnicodeUTF8); licence = stream.read(); f.close(); KIO::NetAccess::removeTempFile(tmpFile); @@ -540,7 +540,7 @@ void KNSPluginWizard::showPage(QWidget *page) int KNSPluginWizard::exec() { if(!m_installEngine.pluginList().count()) - return QDialog::Rejected; + return TQDialog::Rejected; return KWizard::exec(); } @@ -584,10 +584,10 @@ KNSPluginInfo::KNSPluginInfo() } // KNSPlugin info constructor par an xml dom fragment -KNSPluginInfo::KNSPluginInfo(QDomNode pluginNode) +KNSPluginInfo::KNSPluginInfo(TQDomNode pluginNode) { - QDomElement e; - QDomNode node; + TQDomElement e; + TQDomNode node; // Read plugin informations node = pluginNode.firstChild(); @@ -645,12 +645,12 @@ bool KNSPluginInfo::isValid() const } // Accesors -QString KNSPluginInfo::pluginName() const +TQString KNSPluginInfo::pluginName() const { return m_pluginName; } -QString KNSPluginInfo::licence() const +TQString KNSPluginInfo::licence() const { return m_licence; } @@ -665,7 +665,7 @@ KURL KNSPluginInfo::pluginURL() const return m_pluginURL; } -const QStringList& KNSPluginInfo::pluginFileList() const +const TQStringList& KNSPluginInfo::pluginFileList() const { return m_pluginFileList; } diff --git a/khtml/misc/knsplugininstaller.h b/khtml/misc/knsplugininstaller.h index 903a584b2..f92378f10 100644 --- a/khtml/misc/knsplugininstaller.h +++ b/khtml/misc/knsplugininstaller.h @@ -30,21 +30,21 @@ #include <kurl.h> #include <kwizard.h> -#include <qbuttongroup.h> -#include <qdom.h> -#include <qlabel.h> -#include <qobject.h> -#include <qprocess.h> -#include <qradiobutton.h> -#include <qvaluelist.h> -#include <qvbox.h> -#include <qwidget.h> +#include <tqbuttongroup.h> +#include <tqdom.h> +#include <tqlabel.h> +#include <tqobject.h> +#include <tqprocess.h> +#include <tqradiobutton.h> +#include <tqvaluelist.h> +#include <tqvbox.h> +#include <tqwidget.h> class QStringList; /* * This class contains all the infos needed to install a given plugin - * Takes and parse a QDomNode in its constructor + * Takes and parse a TQDomNode in its constructor */ class KNSPluginInfo { @@ -55,7 +55,7 @@ public: * Construct the plugin info object */ KNSPluginInfo(); - KNSPluginInfo(QDomNode pluginNode); + KNSPluginInfo(TQDomNode pluginNode); ~KNSPluginInfo(); /* @@ -64,20 +64,20 @@ public: bool isValid() const; //Accessor methods - QString pluginName() const; - QString licence() const; + TQString pluginName() const; + TQString licence() const; KURL licenceURL() const; KURL pluginURL() const; - const QStringList& pluginFileList() const; + const TQStringList& pluginFileList() const; private: // plugin info - QString m_pluginName; - QString m_licence; + TQString m_pluginName; + TQString m_licence; KURL m_licenceURL; KURL m_pluginURL; - QStringList m_pluginFileList; + TQStringList m_pluginFileList; }; @@ -109,7 +109,7 @@ public: /* * Return the list of plugins Available */ - const QValueList<KNSPluginInfo>& pluginList() const; + const TQValueList<KNSPluginInfo>& pluginList() const; void startInstall(KNSPluginInfo info); @@ -132,16 +132,16 @@ private: bool findPlugin(); - QMap<QString, QString> m_archMap; - QString m_pluginsXmlConfig; - QValueList<KNSPluginInfo> m_pluginList; + TQMap<TQString, TQString> m_archMap; + TQString m_pluginsXmlConfig; + TQValueList<KNSPluginInfo> m_pluginList; KMimeType::Ptr m_mime; KURL m_pluginsListFileURL; - QString m_tmpPluginFileName; + TQString m_tmpPluginFileName; KIO::CopyJob *m_downloadJob; KIO::CopyJob *m_installFileJob; KNSPluginInfo m_toInstallPluginInfo; - QProcess *m_scanProc; + TQProcess *m_scanProc; signals: // Signals used to communicate with the wizzard @@ -177,7 +177,7 @@ public: /** * Construct a KNSpluginInstaller */ - KNSPluginWizard(QWidget *parent, const char *name, KMimeType::Ptr mime); + KNSPluginWizard(TQWidget *parent, const char *name, KMimeType::Ptr mime); ~KNSPluginWizard(); @@ -209,33 +209,33 @@ private: /* * Overiden method called when a page is shown */ - void showPage(QWidget *page); + void showPage(TQWidget *page); // Plugin installation engine KNSPluginInstallEngine m_installEngine; // pages widgets - QVBox *m_confirmationVBox; - QVBox *m_licenceVBox; - QWidget *m_installationProgressWidget; - QWidget *m_finishWidget; + TQVBox *m_confirmationVBox; + TQVBox *m_licenceVBox; + TQWidget *m_installationProgressWidget; + TQWidget *m_finishWidget; // plugin list KListView *m_pluginListView; // licence stuff - QLabel *m_licencePageLabel; + TQLabel *m_licencePageLabel; KTextEdit *m_licencePageText; - QRadioButton *m_licencePageAgree; - QRadioButton *m_licencePageDisagree; - QButtonGroup *m_agreementButtonGroup; + TQRadioButton *m_licencePageAgree; + TQRadioButton *m_licencePageDisagree; + TQButtonGroup *m_agreementButtonGroup; // installation progress bar KProgress *m_installationProgressBar; // Finish Label - QLabel *m_finishLabel; + TQLabel *m_finishLabel; // installation status bool m_installationComplete; diff --git a/khtml/misc/loader.cpp b/khtml/misc/loader.cpp index 8f7ae246f..090def1c5 100644 --- a/khtml/misc/loader.cpp +++ b/khtml/misc/loader.cpp @@ -49,12 +49,12 @@ #define DEFCACHESIZE 2096*1024 #define MAX_JOB_COUNT 32 -#include <qasyncio.h> -#include <qasyncimageio.h> -#include <qpainter.h> -#include <qbitmap.h> -#include <qmovie.h> -#include <qwidget.h> +#include <tqasyncio.h> +#include <tqasyncimageio.h> +#include <tqpainter.h> +#include <tqbitmap.h> +#include <tqmovie.h> +#include <tqwidget.h> #include <kapplication.h> #include <kio/job.h> @@ -69,7 +69,7 @@ #include "khtml_part.h" #ifdef IMAGE_TITLES -#include <qfile.h> +#include <tqfile.h> #include <kfilemetainfo.h> #include <ktempfile.h> #endif @@ -174,7 +174,7 @@ void CachedObject::setSize(int size) Cache::insertInLRUList(this); } -QTextCodec* CachedObject::codecForBuffer( const QString& charset, const QByteArray& buffer ) const +TQTextCodec* CachedObject::codecForBuffer( const TQString& charset, const TQByteArray& buffer ) const { // we don't use heuristicContentMatch here since it is a) far too slow and // b) having too much functionality for our case. @@ -185,25 +185,25 @@ QTextCodec* CachedObject::codecForBuffer( const QString& charset, const QByteArr // BOM if ( s >= 3 && d[0] == 0xef && d[1] == 0xbb && d[2] == 0xbf) - return QTextCodec::codecForMib( 106 ); // UTF-8 + return TQTextCodec::codecForMib( 106 ); // UTF-8 if ( s >= 2 && ((d[0] == 0xff && d[1] == 0xfe) || (d[0] == 0xfe && d[1] == 0xff))) - return QTextCodec::codecForMib( 1000 ); // UCS-2 + return TQTextCodec::codecForMib( 1000 ); // UCS-2 // Link or @charset if(!charset.isEmpty()) { - QTextCodec* c = KGlobal::charsets()->codecForName(charset); + TQTextCodec* c = KGlobal::charsets()->codecForName(charset); if(c->mibEnum() == 11) { // iso8859-8 (visually ordered) - c = QTextCodec::codecForName("iso8859-8-i"); + c = TQTextCodec::codecForName("iso8859-8-i"); } return c; } // Default - return QTextCodec::codecForMib( 4 ); // latin 1 + return TQTextCodec::codecForMib( 4 ); // latin 1 } // ------------------------------------------------------------------------------------------- @@ -213,7 +213,7 @@ CachedCSSStyleSheet::CachedCSSStyleSheet(DocLoader* dl, const DOMString &url, KI : CachedObject(url, CSSStyleSheet, _cachePolicy, 0) { // Set the type we want (probably css or xml) - QString ah = QString::fromLatin1( accept ); + TQString ah = TQString::fromLatin1( accept ); if ( !ah.isEmpty() ) ah += ","; ah += "*/*;q=0.1"; @@ -226,7 +226,7 @@ CachedCSSStyleSheet::CachedCSSStyleSheet(DocLoader* dl, const DOMString &url, KI m_loading = true; } -CachedCSSStyleSheet::CachedCSSStyleSheet(const DOMString &url, const QString &stylesheet_data) +CachedCSSStyleSheet::CachedCSSStyleSheet(const DOMString &url, const TQString &stylesheet_data) : CachedObject(url, CSSStyleSheet, KIO::CC_Verify, stylesheet_data.length()) { m_loading = false; @@ -247,25 +247,25 @@ void CachedCSSStyleSheet::ref(CachedObjectClient *c) } } -void CachedCSSStyleSheet::data( QBuffer &buffer, bool eof ) +void CachedCSSStyleSheet::data( TQBuffer &buffer, bool eof ) { if(!eof) return; buffer.close(); setSize(buffer.buffer().size()); -// QString charset = checkCharset( buffer.buffer() ); - QTextCodec* c = 0; +// TQString charset = checkCharset( buffer.buffer() ); + TQTextCodec* c = 0; if (!m_charset.isEmpty()) { c = KGlobal::charsets()->codecForName(m_charset); - if(c->mibEnum() == 11) c = QTextCodec::codecForName("iso8859-8-i"); + if(c->mibEnum() == 11) c = TQTextCodec::codecForName("iso8859-8-i"); } else { c = codecForBuffer( m_charsetHint, buffer.buffer() ); m_charset = c->name(); } - QString data = c->toUnicode( buffer.buffer().data(), m_size ); + TQString data = c->toUnicode( buffer.buffer().data(), m_size ); // workaround Qt bugs - m_sheet = static_cast<QChar>(data[0]) == QChar::byteOrderMark ? DOMString(data.mid( 1 ) ) : DOMString(data); + m_sheet = static_cast<TQChar>(data[0]) == TQChar::byteOrderMark ? DOMString(data.mid( 1 ) ) : DOMString(data); m_loading = false; checkNotify(); @@ -279,7 +279,7 @@ void CachedCSSStyleSheet::checkNotify() // it() first increments, then returnes the current item. // this avoids skipping an item when setStyleSheet deletes the "current" one. - for (QPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) + for (TQPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) it()->setStyleSheet( m_url, m_sheet, m_charset ); } @@ -293,12 +293,12 @@ void CachedCSSStyleSheet::error( int err, const char* text ) // it() first increments, then returnes the current item. // this avoids skipping an item when setStyleSheet deletes the "current" one. - for (QPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) + for (TQPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) it()->error( m_err, m_errText ); } #if 0 -QString CachedCSSStyleSheet::checkCharset(const QByteArray& buffer ) const +TQString CachedCSSStyleSheet::checkCharset(const TQByteArray& buffer ) const { int s = buffer.size(); if (s <= 12) return m_charset; @@ -312,7 +312,7 @@ QString CachedCSSStyleSheet::checkCharset(const QByteArray& buffer ) const // the string until "; is the charset name char *p = strchr(d+10, '"'); if (p == 0) return m_charset; - QString charset = QString::fromAscii(d+10, p-(d+10)); + TQString charset = TQString::fromAscii(d+10, p-(d+10)); return charset; } return m_charset; @@ -327,13 +327,13 @@ CachedScript::CachedScript(DocLoader* dl, const DOMString &url, KIO::CacheContro // It's javascript we want. // But some websites think their scripts are <some wrong mimetype here> // and refuse to serve them if we only accept application/x-javascript. - setAccept( QString::fromLatin1("*/*") ); + setAccept( TQString::fromLatin1("*/*") ); // load the file Cache::loader()->load(dl, this, false); m_loading = true; } -CachedScript::CachedScript(const DOMString &url, const QString &script_data) +CachedScript::CachedScript(const DOMString &url, const TQString &script_data) : CachedObject(url, Script, KIO::CC_Verify, script_data.length()) { m_loading = false; @@ -348,15 +348,15 @@ void CachedScript::ref(CachedObjectClient *c) if(!m_loading) c->notifyFinished(this); } -void CachedScript::data( QBuffer &buffer, bool eof ) +void CachedScript::data( TQBuffer &buffer, bool eof ) { if(!eof) return; buffer.close(); setSize(buffer.buffer().size()); - QTextCodec* c = codecForBuffer( m_charset, buffer.buffer() ); - QString data = c->toUnicode( buffer.buffer().data(), m_size ); - m_script = static_cast<QChar>(data[0]) == QChar::byteOrderMark ? DOMString(data.mid( 1 ) ) : DOMString(data); + TQTextCodec* c = codecForBuffer( m_charset, buffer.buffer() ); + TQString data = c->toUnicode( buffer.buffer().data(), m_size ); + m_script = static_cast<TQChar>(data[0]) == TQChar::byteOrderMark ? DOMString(data.mid( 1 ) ) : DOMString(data); m_loading = false; checkNotify(); } @@ -365,7 +365,7 @@ void CachedScript::checkNotify() { if(m_loading) return; - for (QPtrDictIterator<CachedObjectClient> it( m_clients); it.current();) + for (TQPtrDictIterator<CachedObjectClient> it( m_clients); it.current();) it()->notifyFinished(this); } @@ -383,7 +383,7 @@ namespace khtml class ImageSource : public QDataSource { public: - ImageSource(QByteArray buf) + ImageSource(TQByteArray buf) : buffer( buf ), pos( 0 ), eof( false ), rew(false ), rewable( true ) {} @@ -395,7 +395,7 @@ public: return buffer.size() - pos; } - void sendTo(QDataSink* sink, int n) + void sendTo(TQDataSink* sink, int n) { sink->receive((const uchar*)&buffer.at(pos), n); @@ -418,13 +418,13 @@ public: void enableRewind(bool on) { rew = on; } /* - Calls reset() on the QIODevice. + Calls reset() on the TQIODevice. */ void rewind() { pos = 0; if (!rew) { - QDataSource::rewind(); + TQDataSource::rewind(); } else ready(); } @@ -449,7 +449,7 @@ public: } } - QByteArray buffer; + TQByteArray buffer; unsigned int pos; private: bool eof : 1; @@ -459,7 +459,7 @@ private: } // end namespace -static QString buildAcceptHeader() +static TQString buildAcceptHeader() { return "image/png, image/jpeg, video/x-mng, image/jp2, image/gif;q=0.5,*/*;q=0.1"; } @@ -467,9 +467,9 @@ static QString buildAcceptHeader() // ------------------------------------------------------------------------------------- CachedImage::CachedImage(DocLoader* dl, const DOMString &url, KIO::CacheControl _cachePolicy, const char*) - : QObject(), CachedObject(url, Image, _cachePolicy, 0) + : TQObject(), CachedObject(url, Image, _cachePolicy, 0) { - static const QString &acceptHeader = KGlobal::staticQString( buildAcceptHeader() ); + static const TQString &acceptHeader = KGlobal::staticQString( buildAcceptHeader() ); m = 0; p = 0; @@ -524,18 +524,18 @@ void CachedImage::deref( CachedObjectClient *c ) #define BGMINWIDTH 32 #define BGMINHEIGHT 32 -const QPixmap &CachedImage::tiled_pixmap(const QColor& newc, int xWidth, int xHeight) +const TQPixmap &CachedImage::tiled_pixmap(const TQColor& newc, int xWidth, int xHeight) { static QRgb bgTransparent = qRgba( 0, 0, 0, 0xFF ); - QSize s(pixmap_size()); + TQSize s(pixmap_size()); int w = xWidth; int h = xHeight; if (w == -1) xWidth = w = s.width(); if (h == -1) xHeight = h = s.height(); if ( ( (bgColor != bgTransparent) && (bgColor != newc.rgb()) ) || - ( bgSize != QSize(xWidth, xHeight)) ) + ( bgSize != TQSize(xWidth, xHeight)) ) { delete bg; bg = 0; } @@ -543,7 +543,7 @@ const QPixmap &CachedImage::tiled_pixmap(const QColor& newc, int xWidth, int xHe if (bg) return *bg; - const QPixmap &r = pixmap(); + const TQPixmap &r = pixmap(); if (r.isNull()) return r; @@ -552,7 +552,7 @@ const QPixmap &CachedImage::tiled_pixmap(const QColor& newc, int xWidth, int xHe bool isvalid = newc.isValid(); - const QPixmap* src; //source for pretiling, if any + const TQPixmap* src; //source for pretiling, if any //See whether we should scale if (xWidth != s.width() || xHeight != s.height()) { @@ -561,11 +561,11 @@ const QPixmap &CachedImage::tiled_pixmap(const QColor& newc, int xWidth, int xHe src = &r; } - bgSize = QSize(xWidth, xHeight); + bgSize = TQSize(xWidth, xHeight); //See whether we can - and should - pre-blend if (isvalid && (r.hasAlphaChannel() || r.mask() )) { - bg = new QPixmap(xWidth, xHeight, r.depth()); + bg = new TQPixmap(xWidth, xHeight, r.depth()); bg->fill(newc); bitBlt(bg, 0, 0, src); bgColor = newc.rgb(); @@ -585,8 +585,8 @@ const QPixmap &CachedImage::tiled_pixmap(const QColor& newc, int xWidth, int xHe if ( w != xWidth || h != xHeight ) { // kdDebug() << "pre-tiling " << s.width() << "," << s.height() << " to " << w << "," << h << endl; - QPixmap* oldbg = bg; - bg = new QPixmap(w, h, r.depth()); + TQPixmap* oldbg = bg; + bg = new TQPixmap(w, h, r.depth()); //Tile horizontally on the first stripe for (int x = 0; x < w; x += xWidth) @@ -606,28 +606,28 @@ const QPixmap &CachedImage::tiled_pixmap(const QColor& newc, int xWidth, int xHe return *src; } -const QPixmap &CachedImage::scaled_pixmap( int xWidth, int xHeight ) +const TQPixmap &CachedImage::scaled_pixmap( int xWidth, int xHeight ) { if (scaled) { if (scaled->width() == xWidth && scaled->height() == xHeight) return *scaled; delete scaled; } - const QPixmap &r = pixmap(); + const TQPixmap &r = pixmap(); if (r.isNull()) return r; // kdDebug() << "scaling " << r.width() << "," << r.height() << " to " << xWidth << "," << xHeight << endl; - QImage image = r.convertToImage().smoothScale(xWidth, xHeight); + TQImage image = r.convertToImage().smoothScale(xWidth, xHeight); - scaled = new QPixmap(xWidth, xHeight, r.depth()); + scaled = new TQPixmap(xWidth, xHeight, r.depth()); scaled->convertFromImage(image); return *scaled; } -const QPixmap &CachedImage::pixmap( ) const +const TQPixmap &CachedImage::pixmap( ) const { if(m_hadError) return *Cache::brokenPixmap; @@ -642,7 +642,7 @@ const QPixmap &CachedImage::pixmap( ) const // pixmap is not yet completely loaded, so we // return a clipped version. asserting here // that the valid rect is always from 0/0 to fullwidth/ someheight - if(!pixPart) pixPart = new QPixmap(); + if(!pixPart) pixPart = new TQPixmap(); (*pixPart) = m->framePixmap(); if (m->getValidRect().size().isValid()) @@ -661,28 +661,28 @@ const QPixmap &CachedImage::pixmap( ) const } -QSize CachedImage::pixmap_size() const +TQSize CachedImage::pixmap_size() const { if (m_wasBlocked) return Cache::blockedPixmap->size(); - return (m_hadError ? Cache::brokenPixmap->size() : m ? m->framePixmap().size() : ( p ? p->size() : QSize())); + return (m_hadError ? Cache::brokenPixmap->size() : m ? m->framePixmap().size() : ( p ? p->size() : TQSize())); } -QRect CachedImage::valid_rect() const +TQRect CachedImage::valid_rect() const { if (m_wasBlocked) return Cache::blockedPixmap->rect(); - return (m_hadError ? Cache::brokenPixmap->rect() : m ? m->getValidRect() : ( p ? p->rect() : QRect()) ); + return (m_hadError ? Cache::brokenPixmap->rect() : m ? m->getValidRect() : ( p ? p->rect() : TQRect()) ); } -void CachedImage::do_notify(const QPixmap& p, const QRect& r) +void CachedImage::do_notify(const TQPixmap& p, const TQRect& r) { - for (QPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) + for (TQPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) it()->setPixmap( p, r, this); } -void CachedImage::movieUpdated( const QRect& r ) +void CachedImage::movieUpdated( const TQRect& r ) { #ifdef LOADER_DEBUG qDebug("movie updated %d/%d/%d/%d, pixmap size %d/%d", r.x(), r.y(), r.right(), r.bottom(), @@ -703,10 +703,10 @@ void CachedImage::movieStatus(int status) // which uses the same CachedImage, the one in the document is not supposed to be notified // just another Qt 2.2.0 bug. we cannot call - // QMovie::frameImage if we're after QMovie::EndOfMovie - if(status == QMovie::EndOfFrame) + // TQMovie::frameImage if we're after TQMovie::EndOfMovie + if(status == TQMovie::EndOfFrame) { - const QImage& im = m->frameImage(); + const TQImage& im = m->frameImage(); monochrome = ( ( im.depth() <= 8 ) && ( im.numColors() - int( im.hasAlphaBuffer() ) <= 2 ) ); for (int i = 0; monochrome && i < im.numColors(); ++i) if (im.colorTable()[i] != qRgb(0xff, 0xff, 0xff) && @@ -714,7 +714,7 @@ void CachedImage::movieStatus(int status) monochrome = false; if( (im.width() < 5 || im.height() < 5) && im.hasAlphaBuffer()) // only evaluate for small images { - QImage am = im.createAlphaMask(); + TQImage am = im.createAlphaMask(); if(am.depth() == 1) { bool solid = false; @@ -734,9 +734,9 @@ void CachedImage::movieStatus(int status) bg = 0; } - if((status == QMovie::EndOfMovie && (!m || m->frameNumber() <= 1)) || - ((status == QMovie::EndOfLoop) && (m_showAnimations == KHTMLSettings::KAnimationLoopOnce)) || - ((status == QMovie::EndOfFrame) && (m_showAnimations == KHTMLSettings::KAnimationDisabled)) + if((status == TQMovie::EndOfMovie && (!m || m->frameNumber() <= 1)) || + ((status == TQMovie::EndOfLoop) && (m_showAnimations == KHTMLSettings::KAnimationLoopOnce)) || + ((status == TQMovie::EndOfFrame) && (m_showAnimations == KHTMLSettings::KAnimationDisabled)) ) { if(imgSource) @@ -747,7 +747,7 @@ void CachedImage::movieStatus(int status) // faster to draw, so this is worth the hack if (p && monochrome && p->depth() > 1) { - QPixmap* pix = new QPixmap; + TQPixmap* pix = new QPixmap; pix->convertFromImage( p->convertToImage().convertDepth( 1 ), MonoOnly|AvoidDither ); if ( p->mask() ) pix->setMask( *p->mask() ); @@ -756,16 +756,16 @@ void CachedImage::movieStatus(int status) monochrome = false; } } - for (QPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) + for (TQPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) it()->notifyFinished( this ); m_status = Cached; //all done } #if 0 - if((status == QMovie::EndOfFrame) || (status == QMovie::EndOfMovie)) + if((status == TQMovie::EndOfFrame) || (status == TQMovie::EndOfMovie)) { #ifdef LOADER_DEBUG - QRect r(valid_rect()); + TQRect r(valid_rect()); qDebug("movie Status frame update %d/%d/%d/%d, pixmap size %d/%d", r.x(), r.y(), r.right(), r.bottom(), pixmap().size().width(), pixmap().size().height()); #endif @@ -774,9 +774,9 @@ void CachedImage::movieStatus(int status) #endif } -void CachedImage::movieResize(const QSize& /*s*/) +void CachedImage::movieResize(const TQSize& /*s*/) { - do_notify(m->framePixmap(), QRect()); + do_notify(m->framePixmap(), TQRect()); } void CachedImage::setShowAnimations( KHTMLSettings::KAnimationAdvice showAnimations ) @@ -785,11 +785,11 @@ void CachedImage::setShowAnimations( KHTMLSettings::KAnimationAdvice showAnimati if ( (m_showAnimations == KHTMLSettings::KAnimationDisabled) && imgSource ) { imgSource->cleanBuffer(); delete p; - p = new QPixmap(m->framePixmap()); - m->disconnectUpdate( this, SLOT( movieUpdated( const QRect &) )); - m->disconnectStatus( this, SLOT( movieStatus( int ) )); - m->disconnectResize( this, SLOT( movieResize( const QSize& ) ) ); - QTimer::singleShot(0, this, SLOT( deleteMovie())); + p = new TQPixmap(m->framePixmap()); + m->disconnectUpdate( this, TQT_SLOT( movieUpdated( const TQRect &) )); + m->disconnectStatus( this, TQT_SLOT( movieStatus( int ) )); + m->disconnectResize( this, TQT_SLOT( movieResize( const TQSize& ) ) ); + TQTimer::singleShot(0, this, TQT_SLOT( deleteMovie())); imgSource = 0; } } @@ -817,18 +817,18 @@ void CachedImage::clear() delete bg; bg = 0; delete scaled; scaled = 0; bgColor = qRgba( 0, 0, 0, 0xff ); - bgSize = QSize(-1,-1); + bgSize = TQSize(-1,-1); delete pixPart; pixPart = 0; formatType = 0; typeChecked = false; setSize(0); - // No need to delete imageSource - QMovie does it for us + // No need to delete imageSource - TQMovie does it for us imgSource = 0; } -void CachedImage::data ( QBuffer &_buffer, bool eof ) +void CachedImage::data ( TQBuffer &_buffer, bool eof ) { #ifdef LOADER_DEBUG kdDebug( 6060 ) << this << "in CachedImage::data(buffersize " << _buffer.buffer().size() <<", eof=" << eof << endl; @@ -838,7 +838,7 @@ void CachedImage::data ( QBuffer &_buffer, bool eof ) // don't attempt incremental loading if we have all the data already if (!eof) { - formatType = QImageDecoder::formatName( (const uchar*)_buffer.buffer().data(), _buffer.size()); + formatType = TQImageDecoder::formatName( (const uchar*)_buffer.buffer().data(), _buffer.size()); if ( formatType && strcmp( formatType, "PNG" ) == 0 ) formatType = 0; // Some png files contain multiple images, we want to show only the first one } @@ -848,10 +848,10 @@ void CachedImage::data ( QBuffer &_buffer, bool eof ) if ( formatType ) // movie format exists { imgSource = new ImageSource( _buffer.buffer()); - m = new QMovie( imgSource, 8192 ); - m->connectUpdate( this, SLOT( movieUpdated( const QRect &) )); - m->connectStatus( this, SLOT( movieStatus(int))); - m->connectResize( this, SLOT( movieResize( const QSize& ) ) ); + m = new TQMovie( imgSource, 8192 ); + m->connectUpdate( this, TQT_SLOT( movieUpdated( const TQRect &) )); + m->connectStatus( this, TQT_SLOT( movieStatus(int))); + m->connectResize( this, TQT_SLOT( movieResize( const TQSize& ) ) ); } } @@ -863,8 +863,8 @@ void CachedImage::data ( QBuffer &_buffer, bool eof ) if(eof) { - // QMovie currently doesn't support all kinds of image formats - // so we need to use a QPixmap here when we finished loading the complete + // TQMovie currently doesn't support all kinds of image formats + // so we need to use a TQPixmap here when we finished loading the complete // picture and display it then all at once. if(typeChecked && !formatType) { @@ -873,9 +873,9 @@ void CachedImage::data ( QBuffer &_buffer, bool eof ) #endif p = new QPixmap; { - QBuffer buffer(_buffer.buffer()); + TQBuffer buffer(_buffer.buffer()); buffer.open(IO_ReadOnly); - QImageIO io( &buffer, 0 ); + TQImageIO io( &buffer, 0 ); io.setGamma(2.2); // hardcoded "reasonable value" bool result = io.read(); if (result) p->convertFromImage(io.image(), 0); @@ -888,12 +888,12 @@ void CachedImage::data ( QBuffer &_buffer, bool eof ) if(p->isNull()) { m_hadError = true; - do_notify(pixmap(), QRect(0, 0, 16, 16)); // load "broken image" icon + do_notify(pixmap(), TQRect(0, 0, 16, 16)); // load "broken image" icon } else do_notify(*p, p->rect()); - for (QPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) + for (TQPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) it()->notifyFinished( this ); m_status = Cached; //all done } @@ -905,10 +905,10 @@ void CachedImage::finish() Status oldStatus = m_status; CachedObject::finish(); if ( oldStatus != m_status ) { - const QPixmap &pm = pixmap(); + const TQPixmap &pm = pixmap(); do_notify( pm, pm.rect() ); } - QSize s = pixmap_size(); + TQSize s = pixmap_size(); setSize( s.width() * s.height() * 2); } @@ -919,8 +919,8 @@ void CachedImage::error( int /*err*/, const char* /*text*/ ) typeChecked = true; m_hadError = true; m_loading = false; - do_notify(pixmap(), QRect(0, 0, 16, 16)); - for (QPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) + do_notify(pixmap(), TQRect(0, 0, 16, 16)); + for (TQPtrDictIterator<CachedObjectClient> it( m_clients ); it.current();) it()->notifyFinished(this); } @@ -988,7 +988,7 @@ void DocLoader::insertCachedObject( CachedObject* o ) const m_docObjects.resize(khtml::nextSeed( m_docObjects.size() ) ); } -bool DocLoader::needReload(CachedObject *existing, const QString& fullURL) +bool DocLoader::needReload(CachedObject *existing, const TQString& fullURL) { bool reload = false; if (m_cachePolicy == KIO::CC_Verify) @@ -1037,7 +1037,7 @@ CachedImage *DocLoader::requestImage( const DOM::DOMString &url) return i; } -CachedCSSStyleSheet *DocLoader::requestStyleSheet( const DOM::DOMString &url, const QString& charset, +CachedCSSStyleSheet *DocLoader::requestStyleSheet( const DOM::DOMString &url, const TQString& charset, const char *accept, bool userSheet ) { DOCLOADER_SECCHECK(!userSheet); @@ -1049,7 +1049,7 @@ CachedCSSStyleSheet *DocLoader::requestStyleSheet( const DOM::DOMString &url, co return s; } -CachedScript *DocLoader::requestScript( const DOM::DOMString &url, const QString& charset) +CachedScript *DocLoader::requestScript( const DOM::DOMString &url, const TQString& charset) { DOCLOADER_SECCHECK(true); if ( ! KHTMLFactory::defaultHTMLSettings()->isJavaScriptEnabled(fullURL.host()) || @@ -1073,7 +1073,7 @@ void DocLoader::setAutoloadImages( bool enable ) if ( !m_bautoloadImages ) return; - for ( QPtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it ) + for ( TQPtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it ) if ( it.current()->type() == CachedObject::Image ) { CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( it.current()) ); @@ -1091,7 +1091,7 @@ void DocLoader::setShowAnimations( KHTMLSettings::KAnimationAdvice showAnimation if ( showAnimations == m_showAnimations ) return; m_showAnimations = showAnimations; - for ( QPtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it ) + for ( TQPtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it ) if ( it.current()->type() == CachedObject::Image ) { CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( it.current() ) ); @@ -1102,7 +1102,7 @@ void DocLoader::setShowAnimations( KHTMLSettings::KAnimationAdvice showAnimation void DocLoader::pauseAnimations() { - for ( QPtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it ) + for ( TQPtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it ) if ( it.current()->type() == CachedObject::Image ) { CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( it.current() ) ); @@ -1113,7 +1113,7 @@ void DocLoader::pauseAnimations() void DocLoader::resumeAnimations() { - for ( QPtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it ) + for ( TQPtrDictIterator<CachedObject> it( m_docObjects ); it.current(); ++it ) if ( it.current()->type() == CachedObject::Image ) { CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( it.current() ) ); @@ -1124,11 +1124,11 @@ void DocLoader::resumeAnimations() // ------------------------------------------------------------------------------------------ -Loader::Loader() : QObject() +Loader::Loader() : TQObject() { m_requestsPending.setAutoDelete( true ); m_requestsLoading.setAutoDelete( true ); - connect(&m_timer, SIGNAL(timeout()), this, SLOT( servePendingRequests() ) ); + connect(&m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT( servePendingRequests() ) ); } void Loader::load(DocLoader* dl, CachedObject *object, bool incremental) @@ -1171,9 +1171,9 @@ void Loader::servePendingRequests() } } - connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotFinished( KIO::Job * ) ) ); - connect( job, SIGNAL( data( KIO::Job*, const QByteArray &)), - SLOT( slotData( KIO::Job*, const QByteArray &))); + connect( job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotFinished( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL( data( KIO::Job*, const TQByteArray &)), + TQT_SLOT( slotData( KIO::Job*, const TQByteArray &))); if ( req->object->schedule() ) KIO::Scheduler::scheduleJob( job ); @@ -1200,7 +1200,7 @@ void Loader::slotFinished( KIO::Job* job ) } else { - QString cs = j->queryMetaData("charset"); + TQString cs = j->queryMetaData("charset"); if (!cs.isEmpty()) r->object->setCharset(cs); r->object->data(r->m_buffer, true); emit requestDone( r->m_docLoader, r->object ); @@ -1211,7 +1211,7 @@ void Loader::slotFinished( KIO::Job* job ) r->object->setExpireDate( expireDate ); if ( r->object->type() == CachedObject::Image ) { - QString fn = j->queryMetaData("content-disposition"); + TQString fn = j->queryMetaData("content-disposition"); static_cast<CachedImage*>( r->object )->setSuggestedFilename(fn); #ifdef IMAGE_TITLES static_cast<CachedImage*>( r->object )->setSuggestedTitle(fn); @@ -1247,7 +1247,7 @@ void Loader::slotFinished( KIO::Job* job ) m_timer.start(0, true); } -void Loader::slotData( KIO::Job*job, const QByteArray &data ) +void Loader::slotData( KIO::Job*job, const TQByteArray &data ) { Request *r = m_requestsLoading[job]; if(!r) { @@ -1268,12 +1268,12 @@ int Loader::numRequests( DocLoader* dl ) const { int res = 0; - QPtrListIterator<Request> pIt( m_requestsPending ); + TQPtrListIterator<Request> pIt( m_requestsPending ); for (; pIt.current(); ++pIt ) if ( pIt.current()->m_docLoader == dl ) res++; - QPtrDictIterator<Request> lIt( m_requestsLoading ); + TQPtrDictIterator<Request> lIt( m_requestsLoading ); for (; lIt.current(); ++lIt ) if ( lIt.current()->m_docLoader == dl ) res++; @@ -1283,7 +1283,7 @@ int Loader::numRequests( DocLoader* dl ) const void Loader::cancelRequests( DocLoader* dl ) { - QPtrListIterator<Request> pIt( m_requestsPending ); + TQPtrListIterator<Request> pIt( m_requestsPending ); while ( pIt.current() ) { if ( pIt.current()->m_docLoader == dl ) { @@ -1297,7 +1297,7 @@ void Loader::cancelRequests( DocLoader* dl ) //kdDebug( 6060 ) << "got " << m_requestsLoading.count() << "loading requests" << endl; - QPtrDictIterator<Request> lIt( m_requestsLoading ); + TQPtrDictIterator<Request> lIt( m_requestsLoading ); while ( lIt.current() ) { if ( lIt.current()->m_docLoader == dl ) @@ -1316,7 +1316,7 @@ void Loader::cancelRequests( DocLoader* dl ) KIO::Job *Loader::jobForRequest( const DOM::DOMString &url ) const { - QPtrDictIterator<Request> it( m_requestsLoading ); + TQPtrDictIterator<Request> it( m_requestsLoading ); for (; it.current(); ++it ) { @@ -1332,34 +1332,34 @@ KIO::Job *Loader::jobForRequest( const DOM::DOMString &url ) const // ---------------------------------------------------------------------------- -QDict<CachedObject> *Cache::cache = 0; -QPtrList<DocLoader>* Cache::docloader = 0; -QPtrList<CachedObject> *Cache::freeList = 0; +TQDict<CachedObject> *Cache::cache = 0; +TQPtrList<DocLoader>* Cache::docloader = 0; +TQPtrList<CachedObject> *Cache::freeList = 0; Loader *Cache::m_loader = 0; int Cache::maxSize = DEFCACHESIZE; int Cache::totalSizeOfLRU; -QPixmap *Cache::nullPixmap = 0; -QPixmap *Cache::brokenPixmap = 0; -QPixmap *Cache::blockedPixmap = 0; +TQPixmap *Cache::nullPixmap = 0; +TQPixmap *Cache::brokenPixmap = 0; +TQPixmap *Cache::blockedPixmap = 0; void Cache::init() { if ( !cache ) - cache = new QDict<CachedObject>(401, true); + cache = new TQDict<CachedObject>(401, true); if ( !docloader ) - docloader = new QPtrList<DocLoader>; + docloader = new TQPtrList<DocLoader>; if ( !nullPixmap ) nullPixmap = new QPixmap; if ( !brokenPixmap ) - brokenPixmap = new QPixmap(KHTMLFactory::instance()->iconLoader()->loadIcon("file_broken", KIcon::Desktop, 16, KIcon::DisabledState)); + brokenPixmap = new TQPixmap(KHTMLFactory::instance()->iconLoader()->loadIcon("file_broken", KIcon::Desktop, 16, KIcon::DisabledState)); if ( !blockedPixmap ) { - blockedPixmap = new QPixmap(); + blockedPixmap = new TQPixmap(); blockedPixmap->loadFromData(blocked_icon_data, blocked_icon_len); } @@ -1367,7 +1367,7 @@ void Cache::init() m_loader = new Loader(); if ( !freeList ) { - freeList = new QPtrList<CachedObject>; + freeList = new TQPtrList<CachedObject>; freeList->setAutoDelete(true); } } @@ -1383,7 +1383,7 @@ void Cache::clear() #ifndef NDEBUG bool crash = false; - for (QDictIterator<CachedObject> it(*cache); it.current(); ++it) { + for (TQDictIterator<CachedObject> it(*cache); it.current(); ++it) { if (!it.current()->canDelete()) { kdDebug( 6060 ) << " Object in cache still linked to" << endl; kdDebug( 6060 ) << " -> URL: " << it.current()->url() << endl; @@ -1399,7 +1399,7 @@ void Cache::clear() kdDebug( 6060 ) << " -> #clients: " << freeList->current()->count() << endl; crash = true; /* - QPtrDictIterator<CachedObjectClient> it(freeList->current()->m_clients); + TQPtrDictIterator<CachedObjectClient> it(freeList->current()->m_clients); for(;it.current(); ++it) { if (dynamic_cast<RenderObject*>(it.current())) { kdDebug( 6060 ) << " --> RenderObject" << endl; @@ -1426,7 +1426,7 @@ CachedObjectType* Cache::requestObject( DocLoader* dl, const KURL& kurl, const c { KIO::CacheControl cachePolicy = dl ? dl->cachePolicy() : KIO::CC_Verify; - QString url = kurl.url(); + TQString url = kurl.url(); CachedObject* o = cache->find(url); if ( o && o->type() != CachedType ) { @@ -1462,7 +1462,7 @@ CachedObjectType* Cache::requestObject( DocLoader* dl, const KURL& kurl, const c return static_cast<CachedObjectType *>(o); } -void Cache::preloadStyleSheet( const QString &url, const QString &stylesheet_data) +void Cache::preloadStyleSheet( const TQString &url, const TQString &stylesheet_data) { CachedObject *o = cache->find(url); if(o) @@ -1472,7 +1472,7 @@ void Cache::preloadStyleSheet( const QString &url, const QString &stylesheet_dat cache->insert( url, stylesheet ); } -void Cache::preloadScript( const QString &url, const QString &script_data) +void Cache::preloadScript( const TQString &url, const TQString &script_data) { CachedObject *o = cache->find(url); if(o) @@ -1524,7 +1524,7 @@ void Cache::statistics() int images = 0; int scripts = 0; int stylesheets = 0; - QDictIterator<CachedObject> it(*cache); + TQDictIterator<CachedObject> it(*cache); for(it.toFirst(); it.current(); ++it) { o = it.current(); @@ -1564,7 +1564,7 @@ void Cache::statistics() void Cache::removeCacheEntry( CachedObject *object ) { - QString key = object->url().string(); + TQString key = object->url().string(); cache->remove( key ); removeFromLRUList( object ); @@ -1669,10 +1669,10 @@ void Cache::insertInLRUList(CachedObject *object) // -------------------------------------- -void CachedObjectClient::setPixmap(const QPixmap &, const QRect&, CachedImage *) {} +void CachedObjectClient::setPixmap(const TQPixmap &, const TQRect&, CachedImage *) {} void CachedObjectClient::setStyleSheet(const DOM::DOMString &/*url*/, const DOM::DOMString &/*sheet*/, const DOM::DOMString &/*charset*/) {} void CachedObjectClient::notifyFinished(CachedObject * /*finishedObj*/) {} -void CachedObjectClient::error(int /*err*/, const QString &/*text*/) {} +void CachedObjectClient::error(int /*err*/, const TQString &/*text*/) {} #undef CDEBUG diff --git a/khtml/misc/loader.h b/khtml/misc/loader.h index 346e85f12..05c297d79 100644 --- a/khtml/misc/loader.h +++ b/khtml/misc/loader.h @@ -38,15 +38,15 @@ #endif #include <stdlib.h> -#include <qptrlist.h> -#include <qobject.h> -#include <qptrdict.h> -#include <qdict.h> -#include <qpixmap.h> -#include <qbuffer.h> -#include <qstringlist.h> -#include <qtextcodec.h> -#include <qtimer.h> +#include <tqptrlist.h> +#include <tqobject.h> +#include <tqptrdict.h> +#include <tqdict.h> +#include <tqpixmap.h> +#include <tqbuffer.h> +#include <tqstringlist.h> +#include <tqtextcodec.h> +#include <tqtimer.h> #include <kurl.h> #include <kio/global.h> @@ -115,7 +115,7 @@ namespace khtml } virtual ~CachedObject(); - virtual void data( QBuffer &buffer, bool eof) = 0; + virtual void data( TQBuffer &buffer, bool eof) = 0; virtual void error( int err, const char *text ) = 0; const DOM::DOMString &url() const { return m_url; } @@ -130,9 +130,9 @@ namespace khtml void setStatus(Status s) { m_status = s; } Status status() const { return m_status; } - virtual void setCharset( const QString& /*charset*/ ) {} + virtual void setCharset( const TQString& /*charset*/ ) {} - QTextCodec* codecForBuffer( const QString& charset, const QByteArray& buffer ) const; + TQTextCodec* codecForBuffer( const TQString& charset, const TQByteArray& buffer ) const; int size() const { return m_size; } @@ -157,14 +157,14 @@ namespace khtml * List of acceptable mimetypes separated by ",". A mimetype may contain a wildcard. */ // e.g. "text/*" - QString accept() const { return m_accept; } - void setAccept(const QString &_accept) { m_accept = _accept; } + TQString accept() const { return m_accept; } + void setAccept(const TQString &_accept) { m_accept = _accept; } protected: void setSize(int size); - QPtrDict<CachedObjectClient> m_clients; + TQPtrDict<CachedObjectClient> m_clients; DOM::DOMString m_url; - QString m_accept; + TQString m_accept; Request *m_request; Type m_type; Status m_status; @@ -197,27 +197,27 @@ namespace khtml public: CachedCSSStyleSheet(DocLoader* dl, const DOM::DOMString &url, KIO::CacheControl cachePolicy, const char *accept); - CachedCSSStyleSheet(const DOM::DOMString &url, const QString &stylesheet_data); + CachedCSSStyleSheet(const DOM::DOMString &url, const TQString &stylesheet_data); const DOM::DOMString &sheet() const { return m_sheet; } virtual void ref(CachedObjectClient *consumer); - virtual void data( QBuffer &buffer, bool eof ); + virtual void data( TQBuffer &buffer, bool eof ); virtual void error( int err, const char *text ); virtual bool schedule() const { return true; } - void setCharsetHint( const QString& charset ) { m_charsetHint = charset; } - void setCharset( const QString& charset ) { m_charset = charset; } + void setCharsetHint( const TQString& charset ) { m_charsetHint = charset; } + void setCharset( const TQString& charset ) { m_charset = charset; } protected: void checkNotify(); DOM::DOMString m_sheet; - QString m_charset; - QString m_charsetHint; + TQString m_charset; + TQString m_charsetHint; int m_err; - QString m_errText; + TQString m_errText; }; /** @@ -227,13 +227,13 @@ namespace khtml { public: CachedScript(DocLoader* dl, const DOM::DOMString &url, KIO::CacheControl cachePolicy, const char* accept ); - CachedScript(const DOM::DOMString &url, const QString &script_data); + CachedScript(const DOM::DOMString &url, const TQString &script_data); const DOM::DOMString &script() const { return m_script; } virtual void ref(CachedObjectClient *consumer); - virtual void data( QBuffer &buffer, bool eof ); + virtual void data( TQBuffer &buffer, bool eof ); virtual void error( int err, const char *text ); virtual bool schedule() const { return false; } @@ -241,10 +241,10 @@ namespace khtml void checkNotify(); bool isLoaded() const { return !m_loading; } - void setCharset( const QString& charset ) { m_charset = charset; } + void setCharset( const TQString& charset ) { m_charset = charset; } protected: - QString m_charset; + TQString m_charset; DOM::DOMString m_script; }; @@ -253,37 +253,37 @@ namespace khtml /** * a cached image */ - class CachedImage : public QObject, public CachedObject + class CachedImage : public TQObject, public CachedObject { Q_OBJECT public: CachedImage(DocLoader* dl, const DOM::DOMString &url, KIO::CacheControl cachePolicy, const char* accept); virtual ~CachedImage(); - const QPixmap &pixmap() const; - const QPixmap &scaled_pixmap(int xWidth, int xHeight); - const QPixmap &tiled_pixmap(const QColor& bg, int xWidth = -1, int xHeight = -1); + const TQPixmap &pixmap() const; + const TQPixmap &scaled_pixmap(int xWidth, int xHeight); + const TQPixmap &tiled_pixmap(const TQColor& bg, int xWidth = -1, int xHeight = -1); - QSize pixmap_size() const; // returns the size of the complete (i.e. when finished) loading - QRect valid_rect() const; // returns the rectangle of pixmap that has been loaded already + TQSize pixmap_size() const; // returns the size of the complete (i.e. when finished) loading + TQRect valid_rect() const; // returns the rectangle of pixmap that has been loaded already bool canRender() const { return !isErrorImage() && pixmap_size().width() > 0 && pixmap_size().height() > 0; } void ref(CachedObjectClient *consumer); virtual void deref(CachedObjectClient *consumer); - virtual void data( QBuffer &buffer, bool eof ); + virtual void data( TQBuffer &buffer, bool eof ); virtual void error( int err, const char *text ); bool isTransparent() const { return isFullyTransparent; } bool isErrorImage() const { return m_hadError; } bool isBlockedImage() const { return m_wasBlocked; } - const QString& suggestedFilename() const { return m_suggestedFilename; } - void setSuggestedFilename( const QString& s ) { m_suggestedFilename = s; } + const TQString& suggestedFilename() const { return m_suggestedFilename; } + void setSuggestedFilename( const TQString& s ) { m_suggestedFilename = s; } #ifdef IMAGE_TITLES - const QString& suggestedTitle() const { return m_suggestedTitle; } - void setSuggestedTitle( const QString& s ) { m_suggestedTitle = s; } + const TQString& suggestedTitle() const { return m_suggestedTitle; } + void setSuggestedTitle( const TQString& s ) { m_suggestedTitle = s; } #else - const QString& suggestedTitle() const { return m_suggestedFilename; } + const TQString& suggestedTitle() const { return m_suggestedFilename; } #endif void setShowAnimations( KHTMLSettings::KAnimationAdvice ); @@ -299,27 +299,27 @@ namespace khtml private slots: /** - * gets called, whenever a QMovie changes frame + * gets called, whenever a TQMovie changes frame */ - void movieUpdated( const QRect &rect ); + void movieUpdated( const TQRect &rect ); void movieStatus(int); - void movieResize(const QSize&); + void movieResize(const TQSize&); void deleteMovie(); private: - void do_notify(const QPixmap& p, const QRect& r); + void do_notify(const TQPixmap& p, const TQRect& r); - QString m_suggestedFilename; + TQString m_suggestedFilename; #ifdef IMAGE_TITLES - QString m_suggestedTitle; + TQString m_suggestedTitle; #endif - QMovie* m; - QPixmap* p; - QPixmap* scaled; - QPixmap* bg; + TQMovie* m; + TQPixmap* p; + TQPixmap* scaled; + TQPixmap* bg; QRgb bgColor; - QSize bgSize; - mutable QPixmap* pixPart; + TQSize bgSize; + mutable TQPixmap* pixPart; ImageSource* imgSource; const char* formatType; // Is the name of the movie format type @@ -349,9 +349,9 @@ namespace khtml ~DocLoader(); CachedImage *requestImage( const DOM::DOMString &url); - CachedCSSStyleSheet *requestStyleSheet( const DOM::DOMString &url, const QString& charsetHint, + CachedCSSStyleSheet *requestStyleSheet( const DOM::DOMString &url, const TQString& charsetHint, const char *accept = "text/css", bool userSheet = false ); - CachedScript *requestScript( const DOM::DOMString &url, const QString& charset); + CachedScript *requestScript( const DOM::DOMString &url, const TQString& charset); bool autoloadImages() const { return m_bautoloadImages; } KIO::CacheControl cachePolicy() const { return m_cachePolicy; } @@ -371,14 +371,14 @@ namespace khtml void removeCachedObject( CachedObject* o) const { m_docObjects.remove( o ); } private: - bool needReload(CachedObject *existing, const QString &fullUrl); + bool needReload(CachedObject *existing, const TQString &fullUrl); friend class Cache; friend class DOM::DocumentImpl; friend class ::KHTMLPart; - QStringList m_reloadedURLs; - mutable QPtrDict<CachedObject> m_docObjects; + TQStringList m_reloadedURLs; + mutable TQPtrDict<CachedObject> m_docObjects; time_t m_expireDate; time_t m_creationDate; KIO::CacheControl m_cachePolicy; @@ -397,7 +397,7 @@ namespace khtml Request(DocLoader* dl, CachedObject *_object, bool _incremental); ~Request(); bool incremental; - QBuffer m_buffer; + TQBuffer m_buffer; CachedObject *object; DocLoader* m_docLoader; }; @@ -427,16 +427,16 @@ namespace khtml protected slots: void slotFinished( KIO::Job * ); - void slotData( KIO::Job *, const QByteArray & ); + void slotData( KIO::Job *, const TQByteArray & ); void servePendingRequests(); protected: - QPtrList<Request> m_requestsPending; - QPtrDict<Request> m_requestsLoading; + TQPtrList<Request> m_requestsPending; + TQPtrDict<Request> m_requestsLoading; #ifdef HAVE_LIBJPEG KJPEGFormatType m_jpegloader; #endif - QTimer m_timer; + TQTimer m_timer; }; /** @@ -471,12 +471,12 @@ namespace khtml /** * Pre-loads a stylesheet into the cache. */ - static void preloadStyleSheet(const QString &url, const QString &stylesheet_data); + static void preloadStyleSheet(const TQString &url, const TQString &stylesheet_data); /** * Pre-loads a script into the cache. */ - static void preloadScript(const QString &url, const QString &script_data); + static void preloadScript(const TQString &url, const TQString &script_data); static void setSize( int bytes ); static int size() { return maxSize; }; @@ -492,9 +492,9 @@ namespace khtml static Loader *loader() { return m_loader; } - static QPixmap *nullPixmap; - static QPixmap *brokenPixmap; - static QPixmap *blockedPixmap; + static TQPixmap *nullPixmap; + static TQPixmap *brokenPixmap; + static TQPixmap *blockedPixmap; static int cacheSize; static void removeCacheEntry( CachedObject *object ); @@ -505,9 +505,9 @@ namespace khtml friend class CachedObject; - static QDict<CachedObject> *cache; - static QPtrList<DocLoader>* docloader; - static QPtrList<CachedObject> *freeList; + static TQDict<CachedObject> *cache; + static TQPtrList<DocLoader>* docloader; + static TQPtrList<CachedObject> *freeList; static void insertInLRUList(CachedObject*); static void removeFromLRUList(CachedObject*); diff --git a/khtml/misc/loader_client.h b/khtml/misc/loader_client.h index 023f147c6..3e28f7e56 100644 --- a/khtml/misc/loader_client.h +++ b/khtml/misc/loader_client.h @@ -1,7 +1,7 @@ #ifndef LOADER_CLIENT_H #define LOADER_CLIENT_H -#include <qpixmap.h> +#include <tqpixmap.h> #include "dom/dom_string.h" namespace khtml { @@ -25,10 +25,10 @@ namespace khtml { // pointer to us // return whether we need manual update // don't ref() or deref() elements in setPixmap!! - virtual void setPixmap(const QPixmap &, const QRect&, CachedImage *); + virtual void setPixmap(const TQPixmap &, const TQRect&, CachedImage *); virtual void setStyleSheet(const DOM::DOMString &/*url*/, const DOM::DOMString &/*sheet*/, const DOM::DOMString &/*charset*/); virtual void notifyFinished(CachedObject * /*finishedObj*/); - virtual void error(int err, const QString &text); + virtual void error(int err, const TQString &text); }; } diff --git a/khtml/misc/loader_jpeg.cpp b/khtml/misc/loader_jpeg.cpp index 4c9c97465..57174fe1b 100644 --- a/khtml/misc/loader_jpeg.cpp +++ b/khtml/misc/loader_jpeg.cpp @@ -36,7 +36,7 @@ #include <stdio.h> #include <setjmp.h> -#include <qdatetime.h> +#include <tqdatetime.h> #include <kglobal.h> extern "C" { @@ -82,9 +82,9 @@ struct khtml_jpeg_source_mgr : public jpeg_source_mgr { int valid_buffer_len; size_t skip_input_bytes; int ateof; - QRect change_rect; - QRect old_change_rect; - QTime decoder_timestamp; + TQRect change_rect; + TQRect old_change_rect; + TQTime decoder_timestamp; bool final_pass; bool decoding_done; bool do_progressive; @@ -193,7 +193,7 @@ public: virtual ~KJPEGFormat(); - virtual int decode(QImage& img, QImageConsumer* consumer, + virtual int decode(TQImage& img, TQImageConsumer* consumer, const uchar* buffer, int length); private: @@ -241,7 +241,7 @@ KJPEGFormat::~KJPEGFormat() * return < 0 means "fatal error in image decoding, don't call me ever again" */ -int KJPEGFormat::decode(QImage& image, QImageConsumer* consumer, const uchar* buffer, int length) +int KJPEGFormat::decode(TQImage& image, TQImageConsumer* consumer, const uchar* buffer, int length) { #ifdef JPEG_DEBUG qDebug("KJPEGFormat::decode(%08lx, %08lx, %08lx, %d)", @@ -438,7 +438,7 @@ again: if(consumer && completed_scanlines) { - QRect r(0, oldoutput_scanline, cinfo.output_width, completed_scanlines); + TQRect r(0, oldoutput_scanline, cinfo.output_width, completed_scanlines); #ifdef JPEG_DEBUG qDebug("changing %d/%d %d/%d", r.x(), r.y(), r.width(), r.height()); #endif @@ -447,10 +447,10 @@ again: if ( jsrc.decoder_timestamp.elapsed() >= max_consumingtime ) { if( !jsrc.old_change_rect.isEmpty()) { consumer->changed(jsrc.old_change_rect); - jsrc.old_change_rect = QRect(); + jsrc.old_change_rect = TQRect(); } consumer->changed(jsrc.change_rect); - jsrc.change_rect = QRect(); + jsrc.change_rect = TQRect(); jsrc.decoder_timestamp.restart(); } } @@ -463,7 +463,7 @@ again: jsrc.decoding_done = jsrc.final_pass && cinfo.input_scan_number == cinfo.output_scan_number; if ( !jsrc.decoding_done ) { jsrc.old_change_rect |= jsrc.change_rect; - jsrc.change_rect = QRect(); + jsrc.change_rect = TQRect(); } } else @@ -521,7 +521,7 @@ again: // ----------------------------------------------------------------------------- // This is the factory that teaches Qt about progressive JPEG's -QImageFormat* khtml::KJPEGFormatType::decoderFor(const unsigned char* buffer, int length) +TQImageFormat* khtml::KJPEGFormatType::decoderFor(const unsigned char* buffer, int length) { if(length < 3) return 0; diff --git a/khtml/misc/loader_jpeg.h b/khtml/misc/loader_jpeg.h index f96d1f135..c97b2bcbf 100644 --- a/khtml/misc/loader_jpeg.h +++ b/khtml/misc/loader_jpeg.h @@ -26,7 +26,7 @@ #ifndef _khtml_loader_jpeg_h #define _khtml_loader_jpeg_h -#include <qasyncimageio.h> +#include <tqasyncimageio.h> namespace khtml { @@ -38,7 +38,7 @@ namespace khtml class KJPEGFormatType : public QImageFormatType { public: - QImageFormat* decoderFor(const uchar* buffer, int length); + TQImageFormat* decoderFor(const uchar* buffer, int length); const char* formatName() const; }; diff --git a/khtml/misc/multimap.h b/khtml/misc/multimap.h index 08cb11879..125e8e07d 100644 --- a/khtml/misc/multimap.h +++ b/khtml/misc/multimap.h @@ -23,16 +23,16 @@ #ifndef _MultiMap_h_ #define _MultiMap_h_ -#include <qptrdict.h> -#include <qptrlist.h> +#include <tqptrdict.h> +#include <tqptrlist.h> #include <assert.h> #include <stdlib.h> template<class T> class MultiMapPtrList; // KMultiMap is an implementaition of a Map with multiple entries per key. -// It is originally designed to work like a shell for QPtrDict<QPtrList>, but -// QPtrList have been replaced with a much faster hash set. +// It is originally designed to work like a shell for TQPtrDict<TQPtrList>, but +// TQPtrList have been replaced with a much faster hash set. template<class T> class KMultiMap { public: @@ -63,7 +63,7 @@ public: return dict.find(key); } private: - QPtrDict<List> dict; + TQPtrDict<List> dict; }; diff --git a/khtml/misc/stringit.cpp b/khtml/misc/stringit.cpp index 5dbe857be..9b8fc5899 100644 --- a/khtml/misc/stringit.cpp +++ b/khtml/misc/stringit.cpp @@ -32,8 +32,8 @@ uint TokenizerString::length() const ++length; } if (m_composite) { - QValueListConstIterator<TokenizerSubstring> i = m_substrings.begin(); - QValueListConstIterator<TokenizerSubstring> e = m_substrings.end(); + TQValueListConstIterator<TokenizerSubstring> i = m_substrings.begin(); + TQValueListConstIterator<TokenizerSubstring> e = m_substrings.end(); for (; i != e; ++i) length += (*i).m_length; } @@ -83,8 +83,8 @@ void TokenizerString::append(const TokenizerString &s) assert(!s.escaped()); append(s.m_currentString); if (s.m_composite) { - QValueListConstIterator<TokenizerSubstring> i = s.m_substrings.begin(); - QValueListConstIterator<TokenizerSubstring> e = s.m_substrings.end(); + TQValueListConstIterator<TokenizerSubstring> i = s.m_substrings.begin(); + TQValueListConstIterator<TokenizerSubstring> e = s.m_substrings.end(); for (; i != e; ++i) append(*i); } @@ -96,8 +96,8 @@ void TokenizerString::prepend(const TokenizerString &s) assert(!escaped()); assert(!s.escaped()); if (s.m_composite) { - QValueListConstIterator<TokenizerSubstring> i = s.m_substrings.fromLast(); - QValueListConstIterator<TokenizerSubstring> e = s.m_substrings.end(); + TQValueListConstIterator<TokenizerSubstring> i = s.m_substrings.fromLast(); + TQValueListConstIterator<TokenizerSubstring> e = s.m_substrings.end(); for (; i != e; --i) prepend(*i); } @@ -117,9 +117,9 @@ void TokenizerString::advanceSubstring() } } -QString TokenizerString::toString() const +TQString TokenizerString::toString() const { - QString result; + TQString result; if (!m_pushedChar1.isNull()) { result.append(m_pushedChar1); if (!m_pushedChar2.isNull()) @@ -127,8 +127,8 @@ QString TokenizerString::toString() const } m_currentString.appendTo(result); if (m_composite) { - QValueListConstIterator<TokenizerSubstring> i = m_substrings.begin(); - QValueListConstIterator<TokenizerSubstring> e = m_substrings.end(); + TQValueListConstIterator<TokenizerSubstring> i = m_substrings.begin(); + TQValueListConstIterator<TokenizerSubstring> e = m_substrings.end(); for (; i != e; ++i) (*i).appendTo(result); } diff --git a/khtml/misc/stringit.h b/khtml/misc/stringit.h index 9b6c3885d..789f22af8 100644 --- a/khtml/misc/stringit.h +++ b/khtml/misc/stringit.h @@ -28,8 +28,8 @@ #include "dom/dom_string.h" -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <assert.h> @@ -43,9 +43,9 @@ class DOMStringIt public: DOMStringIt() { s = 0, l = 0; lines = 0; } - DOMStringIt(QChar *str, uint len) + DOMStringIt(TQChar *str, uint len) { s = str, l = len; lines = 0; } - DOMStringIt(const QString &str) + DOMStringIt(const TQString &str) { s = str.unicode(); l = str.length(); lines = 0; } DOMStringIt *operator++() @@ -60,20 +60,20 @@ public: return this; } public: - void push(const QChar& c) { /* assert(pushedChar.isNull());*/ pushedChar = c; } + void push(const TQChar& c) { /* assert(pushedChar.isNull());*/ pushedChar = c; } - const QChar& operator*() const { return pushedChar.isNull() ? *s : pushedChar; } - const QChar* operator->() const { return pushedChar.isNull() ? s : &pushedChar; } + const TQChar& operator*() const { return pushedChar.isNull() ? *s : pushedChar; } + const TQChar* operator->() const { return pushedChar.isNull() ? s : &pushedChar; } bool escaped() const { return !pushedChar.isNull(); } uint length() const { return l+(!pushedChar.isNull()); } - const QChar *current() const { return pushedChar.isNull() ? s : &pushedChar; } + const TQChar *current() const { return pushedChar.isNull() ? s : &pushedChar; } int lineCount() const { return lines; } protected: - QChar pushedChar; - const QChar *s; + TQChar pushedChar; + const TQChar *s; int l; int lines; }; @@ -85,12 +85,12 @@ class TokenizerSubstring friend class TokenizerString; public: TokenizerSubstring() : m_length(0), m_current(0) {} - TokenizerSubstring(const QString &str) : m_string(str), m_length(str.length()), m_current(m_length == 0 ? 0 : str.unicode()) {} - TokenizerSubstring(const QChar *str, int length) : m_length(length), m_current(length == 0 ? 0 : str) {} + TokenizerSubstring(const TQString &str) : m_string(str), m_length(str.length()), m_current(m_length == 0 ? 0 : str.unicode()) {} + TokenizerSubstring(const TQChar *str, int length) : m_length(length), m_current(length == 0 ? 0 : str) {} void clear() { m_length = 0; m_current = 0; } - void appendTo(QString &str) const { + void appendTo(TQString &str) const { if (m_string.unicode() == m_current) { if (str.isEmpty()) str = m_string; @@ -101,9 +101,9 @@ public: } } private: - QString m_string; + TQString m_string; int m_length; - const QChar *m_current; + const TQChar *m_current; }; class TokenizerString @@ -111,8 +111,8 @@ class TokenizerString public: TokenizerString() : m_currentChar(0), m_lines(0), m_composite(false) {} - TokenizerString(const QChar *str, int length) : m_currentString(str, length), m_currentChar(m_currentString.m_current), m_lines(0), m_composite(false) {} - TokenizerString(const QString &str) : m_currentString(str), m_currentChar(m_currentString.m_current), m_lines(0), m_composite(false) {} + TokenizerString(const TQChar *str, int length) : m_currentString(str, length), m_currentChar(m_currentString.m_current), m_lines(0), m_composite(false) {} + TokenizerString(const TQString &str) : m_currentString(str), m_currentChar(m_currentString.m_current), m_lines(0), m_composite(false) {} TokenizerString(const TokenizerString &o) : m_pushedChar1(o.m_pushedChar1), m_pushedChar2(o.m_pushedChar2), m_currentString(o.m_currentString), m_substrings(o.m_substrings), m_lines(o.m_lines), m_composite(o.m_composite) { @@ -124,7 +124,7 @@ public: void append(const TokenizerString &); void prepend(const TokenizerString &); - void push(QChar c) { + void push(TQChar c) { if (m_pushedChar1.isNull()) { m_pushedChar1 = c; m_currentChar = m_pushedChar1.isNull() ? m_currentString.m_current : &m_pushedChar1; @@ -155,31 +155,31 @@ public: int lineCount() const { return m_lines; } void resetLineCount() { m_lines = 0; } - QString toString() const; + TQString toString() const; void operator++() { advance(); } - const QChar &operator*() const { return *current(); } - const QChar *operator->() const { return current(); } + const TQChar &operator*() const { return *current(); } + const TQChar *operator->() const { return current(); } private: void append(const TokenizerSubstring &); void prepend(const TokenizerSubstring &); void advanceSubstring(); - const QChar *current() const { return m_currentChar; } + const TQChar *current() const { return m_currentChar; } - QChar m_pushedChar1; - QChar m_pushedChar2; + TQChar m_pushedChar1; + TQChar m_pushedChar2; TokenizerSubstring m_currentString; - const QChar *m_currentChar; - QValueList<TokenizerSubstring> m_substrings; + const TQChar *m_currentChar; + TQValueList<TokenizerSubstring> m_substrings; int m_lines; bool m_composite; }; -class TokenizerQueue : public QValueList<TokenizerString> +class TokenizerQueue : public TQValueList<TokenizerString> { public: diff --git a/khtml/rendering/bidi.cpp b/khtml/rendering/bidi.cpp index a220641b2..19de828a0 100644 --- a/khtml/rendering/bidi.cpp +++ b/khtml/rendering/bidi.cpp @@ -31,8 +31,8 @@ #include "xml/dom_docimpl.h" #include "kdebug.h" -#include "qdatetime.h" -#include "qfontmetrics.h" +#include "tqdatetime.h" +#include "tqfontmetrics.h" #define BIDI_DEBUG 0 //#define DEBUG_LINEBREAKS @@ -51,8 +51,8 @@ struct BidiIterator bool atEnd() const; - const QChar ¤t() const; - QChar::Direction direction() const; + const TQChar ¤t() const; + TQChar::Direction direction() const; RenderBlock *par; RenderObject *obj; @@ -61,11 +61,11 @@ struct BidiIterator struct BidiStatus { - BidiStatus() : eor(QChar::DirON), lastStrong(QChar::DirON), last(QChar::DirON) {} + BidiStatus() : eor(TQChar::DirON), lastStrong(TQChar::DirON), last(TQChar::DirON) {} - QChar::Direction eor; - QChar::Direction lastStrong; - QChar::Direction last; + TQChar::Direction eor; + TQChar::Direction lastStrong; + TQChar::Direction last; }; struct BidiState { @@ -91,19 +91,19 @@ static bool sBuildingCompactRuns; // Midpoint globals. The goal is not to do any allocation when dealing with // these midpoints, so we just keep an array around and never clear it. We track // the number of items and position using the two other variables. -static QMemArray<BidiIterator> *smidpoints; +static TQMemArray<BidiIterator> *smidpoints; static uint sNumMidpoints; static uint sCurrMidpoint; static bool betweenMidpoints; static bool isLineEmpty = true; static bool previousLineBrokeAtBR = true; -static QChar::Direction dir; +static TQChar::Direction dir; static bool adjustEmbedding; static bool emptyRun = true; static int numSpaces; -static void embed( QChar::Direction d, BidiState &bidi ); +static void embed( TQChar::Direction d, BidiState &bidi ); static void appendRun( BidiState &bidi ); static int getBPMWidth(int childValue, Length cssUnit) @@ -197,7 +197,7 @@ static void deleteBidiRuns(RenderArena* arena) Each line of text caches the embedding level at the start of the line for faster relayouting */ -BidiContext::BidiContext(unsigned char l, QChar::Direction e, BidiContext *p, bool o) +BidiContext::BidiContext(unsigned char l, TQChar::Direction e, BidiContext *p, bool o) : level(l) , override(o), dir(e) { parent = p; @@ -255,8 +255,8 @@ static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, B EUnicodeBidi ub = next->style()->unicodeBidi(); if ( ub != UBNormal && !emptyRun ) { EDirection dir = next->style()->direction(); - QChar::Direction d = ( ub == Embed ? ( dir == RTL ? QChar::DirRLE : QChar::DirLRE ) - : ( dir == RTL ? QChar::DirRLO : QChar::DirLRO ) ); + TQChar::Direction d = ( ub == Embed ? ( dir == RTL ? TQChar::DirRLE : TQChar::DirLRE ) + : ( dir == RTL ? TQChar::DirRLO : TQChar::DirLRO ) ); embed( d, bidi ); } } @@ -266,7 +266,7 @@ static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, B next = current->nextSibling(); if (next) break; if ( adjustEmbedding && current->style()->unicodeBidi() != UBNormal && !emptyRun ) { - embed( QChar::DirPDF, bidi ); + embed( TQChar::DirPDF, bidi ); } current = current->parent(); } @@ -321,9 +321,9 @@ inline bool BidiIterator::atEnd() const return false; } -const QChar &BidiIterator::current() const +const TQChar &BidiIterator::current() const { - static QChar nonBreakingSpace(0xA0); + static TQChar nonBreakingSpace(0xA0); if (!obj || !obj->isText()) return nonBreakingSpace; @@ -335,13 +335,13 @@ const QChar &BidiIterator::current() const return text->text()[pos]; } -inline QChar::Direction BidiIterator::direction() const +inline TQChar::Direction BidiIterator::direction() const { - if(!obj || !obj->isText() ) return QChar::DirON; + if(!obj || !obj->isText() ) return TQChar::DirON; RenderText *renderTxt = static_cast<RenderText *>( obj ); if ( pos >= renderTxt->stringLength() ) - return QChar::DirON; + return TQChar::DirON; return renderTxt->text()[pos].direction(); } @@ -363,8 +363,8 @@ static void addRun(BidiRun* bidiRun) RenderText* text = static_cast<RenderText*>(bidiRun->obj); if (text->text()) { for (int i = bidiRun->start; i < bidiRun->stop; i++) { - const QChar c = text->text()[i]; - if (c.category() == QChar::Separator_Space || c == '\n') + const TQChar c = text->text()[i]; + if (c.category() == TQChar::Separator_Space || c == '\n') numSpaces++; } } @@ -539,19 +539,19 @@ static void appendRun( BidiState &bidi ) bidi.eor.increment( bidi ); bidi.sor = bidi.eor; - dir = QChar::DirON; - bidi.status.eor = QChar::DirON; + dir = TQChar::DirON; + bidi.status.eor = TQChar::DirON; adjustEmbedding = b; } -static void embed( QChar::Direction d, BidiState &bidi ) +static void embed( TQChar::Direction d, BidiState &bidi ) { #if BIDI_DEBUG > 1 qDebug("*** embed dir=%d emptyrun=%d", d, emptyRun ); #endif bool b = adjustEmbedding ; adjustEmbedding = false; - if ( d == QChar::DirPDF ) { + if ( d == TQChar::DirPDF ) { BidiContext *c = bidi.context->parent; if (c) { if ( bidi.eor != bidi.last ) { @@ -566,23 +566,23 @@ static void embed( QChar::Direction d, BidiState &bidi ) if(bidi.context->override) dir = bidi.context->dir; else - dir = QChar::DirON; + dir = TQChar::DirON; bidi.status.lastStrong = bidi.context->dir; } } else { - QChar::Direction runDir; - if( d == QChar::DirRLE || d == QChar::DirRLO ) - runDir = QChar::DirR; + TQChar::Direction runDir; + if( d == TQChar::DirRLE || d == TQChar::DirRLO ) + runDir = TQChar::DirR; else - runDir = QChar::DirL; + runDir = TQChar::DirL; bool override; - if( d == QChar::DirLRO || d == QChar::DirRLO ) + if( d == TQChar::DirLRO || d == TQChar::DirRLO ) override = true; else override = false; unsigned char level = bidi.context->level; - if ( runDir == QChar::DirR ) { + if ( runDir == TQChar::DirR ) { if(level%2) // we have an odd level level += 2; else @@ -728,7 +728,7 @@ void RenderBlock::computeHorizontalPositionsForLine(InlineFlowBox* lineBox, Bidi case TAAUTO: numSpaces = 0; // for right to left fall through to right aligned - if (bidi.context->basicDir == QChar::DirL) + if (bidi.context->basicDir == TQChar::DirL) break; case RIGHT: case KHTML_RIGHT: @@ -750,8 +750,8 @@ void RenderBlock::computeHorizontalPositionsForLine(InlineFlowBox* lineBox, Bidi // get the number of spaces in the run int spaces = 0; for ( int i = r->start; i < r->stop; i++ ) { - const QChar c = static_cast<RenderText *>(r->obj)->text()[i]; - if (c.category() == QChar::Separator_Space || c == '\n') + const TQChar c = static_cast<RenderText *>(r->obj)->text()[i]; + if (c.category() == TQChar::Separator_Space || c == '\n') spaces++; } @@ -904,7 +904,7 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator // context->ref(); - dir = QChar::DirON; + dir = TQChar::DirON; emptyRun = true; numSpaces = 0; @@ -914,7 +914,7 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator bool atEnd = false; while( 1 ) { - QChar::Direction dirCurrent; + TQChar::Direction dirCurrent; if (atEnd) { //kdDebug(6041) << "atEnd" << endl; BidiContext *c = bidi.context; @@ -935,105 +935,105 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator switch(dirCurrent) { // embedding and overrides (X1-X9 in the Bidi specs) - case QChar::DirRLE: - case QChar::DirLRE: - case QChar::DirRLO: - case QChar::DirLRO: - case QChar::DirPDF: + case TQChar::DirRLE: + case TQChar::DirLRE: + case TQChar::DirRLO: + case TQChar::DirLRO: + case TQChar::DirPDF: embed( dirCurrent, bidi ); break; // strong types - case QChar::DirL: - if(dir == QChar::DirON) - dir = QChar::DirL; + case TQChar::DirL: + if(dir == TQChar::DirON) + dir = TQChar::DirL; switch(bidi.status.last) { - case QChar::DirL: - bidi.eor = bidi.current; bidi.status.eor = QChar::DirL; break; - case QChar::DirR: - case QChar::DirAL: - case QChar::DirEN: - case QChar::DirAN: + case TQChar::DirL: + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirL; break; + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirEN: + case TQChar::DirAN: appendRun( bidi ); break; - case QChar::DirES: - case QChar::DirET: - case QChar::DirCS: - case QChar::DirBN: - case QChar::DirB: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: - if( bidi.status.eor != QChar::DirL ) { + case TQChar::DirES: + case TQChar::DirET: + case TQChar::DirCS: + case TQChar::DirBN: + case TQChar::DirB: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: + if( bidi.status.eor != TQChar::DirL ) { //last stuff takes embedding dir - if(bidi.context->dir == QChar::DirL || bidi.status.lastStrong == QChar::DirL) { - if ( bidi.status.eor != QChar::DirEN && bidi.status.eor != QChar::DirAN && bidi.status.eor != QChar::DirON ) + if(bidi.context->dir == TQChar::DirL || bidi.status.lastStrong == TQChar::DirL) { + if ( bidi.status.eor != TQChar::DirEN && bidi.status.eor != TQChar::DirAN && bidi.status.eor != TQChar::DirON ) appendRun( bidi ); - dir = QChar::DirL; + dir = TQChar::DirL; bidi.eor = bidi.current; - bidi.status.eor = QChar::DirL; + bidi.status.eor = TQChar::DirL; } else { - if ( bidi.status.eor == QChar::DirEN || bidi.status.eor == QChar::DirAN ) + if ( bidi.status.eor == TQChar::DirEN || bidi.status.eor == TQChar::DirAN ) { dir = bidi.status.eor; appendRun( bidi ); } - dir = QChar::DirR; + dir = TQChar::DirR; bidi.eor = bidi.last; appendRun( bidi ); - dir = QChar::DirL; - bidi.status.eor = QChar::DirL; + dir = TQChar::DirL; + bidi.status.eor = TQChar::DirL; } } else { - bidi.eor = bidi.current; bidi.status.eor = QChar::DirL; + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirL; } default: break; } - bidi.status.lastStrong = QChar::DirL; + bidi.status.lastStrong = TQChar::DirL; break; - case QChar::DirAL: - case QChar::DirR: - if(dir == QChar::DirON) dir = QChar::DirR; + case TQChar::DirAL: + case TQChar::DirR: + if(dir == TQChar::DirON) dir = TQChar::DirR; switch(bidi.status.last) { - case QChar::DirR: - case QChar::DirAL: - bidi.eor = bidi.current; bidi.status.eor = QChar::DirR; break; - case QChar::DirL: - case QChar::DirEN: - case QChar::DirAN: + case TQChar::DirR: + case TQChar::DirAL: + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirR; break; + case TQChar::DirL: + case TQChar::DirEN: + case TQChar::DirAN: appendRun( bidi ); - dir = QChar::DirR; + dir = TQChar::DirR; bidi.eor = bidi.current; - bidi.status.eor = QChar::DirR; + bidi.status.eor = TQChar::DirR; break; - case QChar::DirES: - case QChar::DirET: - case QChar::DirCS: - case QChar::DirBN: - case QChar::DirB: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: - if( !(bidi.status.eor == QChar::DirR) && !(bidi.status.eor == QChar::DirAL) ) { + case TQChar::DirES: + case TQChar::DirET: + case TQChar::DirCS: + case TQChar::DirBN: + case TQChar::DirB: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: + if( !(bidi.status.eor == TQChar::DirR) && !(bidi.status.eor == TQChar::DirAL) ) { //last stuff takes embedding dir - if(bidi.context->dir == QChar::DirR || bidi.status.lastStrong == QChar::DirR - || bidi.status.lastStrong == QChar::DirAL) { + if(bidi.context->dir == TQChar::DirR || bidi.status.lastStrong == TQChar::DirR + || bidi.status.lastStrong == TQChar::DirAL) { appendRun( bidi ); - dir = QChar::DirR; + dir = TQChar::DirR; bidi.eor = bidi.current; - bidi.status.eor = QChar::DirR; + bidi.status.eor = TQChar::DirR; } else { - dir = QChar::DirL; + dir = TQChar::DirL; bidi.eor = bidi.last; appendRun( bidi ); - dir = QChar::DirR; - bidi.status.eor = QChar::DirR; + dir = TQChar::DirR; + bidi.status.eor = TQChar::DirR; } } else { - bidi.eor = bidi.current; bidi.status.eor = QChar::DirR; + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirR; } default: break; @@ -1043,64 +1043,64 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator // weak types: - case QChar::DirNSM: + case TQChar::DirNSM: // ### if @sor, set dir to dirSor break; - case QChar::DirEN: - if(!(bidi.status.lastStrong == QChar::DirAL)) { + case TQChar::DirEN: + if(!(bidi.status.lastStrong == TQChar::DirAL)) { // if last strong was AL change EN to AN - if(dir == QChar::DirON) { - dir = QChar::DirL; + if(dir == TQChar::DirON) { + dir = TQChar::DirL; } switch(bidi.status.last) { - case QChar::DirET: - if ( bidi.status.lastStrong == QChar::DirR || bidi.status.lastStrong == QChar::DirAL ) { + case TQChar::DirET: + if ( bidi.status.lastStrong == TQChar::DirR || bidi.status.lastStrong == TQChar::DirAL ) { appendRun( bidi ); - dir = QChar::DirEN; - bidi.status.eor = QChar::DirEN; + dir = TQChar::DirEN; + bidi.status.eor = TQChar::DirEN; } // fall through - case QChar::DirEN: - case QChar::DirL: + case TQChar::DirEN: + case TQChar::DirL: bidi.eor = bidi.current; bidi.status.eor = dirCurrent; break; - case QChar::DirR: - case QChar::DirAL: - case QChar::DirAN: + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirAN: appendRun( bidi ); - bidi.status.eor = QChar::DirEN; - dir = QChar::DirEN; break; - case QChar::DirES: - case QChar::DirCS: - if(bidi.status.eor == QChar::DirEN) { + bidi.status.eor = TQChar::DirEN; + dir = TQChar::DirEN; break; + case TQChar::DirES: + case TQChar::DirCS: + if(bidi.status.eor == TQChar::DirEN) { bidi.eor = bidi.current; break; } - case QChar::DirBN: - case QChar::DirB: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: - if(bidi.status.eor == QChar::DirR) { + case TQChar::DirBN: + case TQChar::DirB: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: + if(bidi.status.eor == TQChar::DirR) { // neutrals go to R bidi.eor = bidi.last; appendRun( bidi ); - dir = QChar::DirEN; - bidi.status.eor = QChar::DirEN; + dir = TQChar::DirEN; + bidi.status.eor = TQChar::DirEN; } - else if( bidi.status.eor == QChar::DirL || - (bidi.status.eor == QChar::DirEN && bidi.status.lastStrong == QChar::DirL)) { + else if( bidi.status.eor == TQChar::DirL || + (bidi.status.eor == TQChar::DirEN && bidi.status.lastStrong == TQChar::DirL)) { bidi.eor = bidi.current; bidi.status.eor = dirCurrent; } else { // numbers on both sides, neutrals get right to left direction - if(dir != QChar::DirL) { + if(dir != TQChar::DirL) { appendRun( bidi ); bidi.eor = bidi.last; - dir = QChar::DirR; + dir = TQChar::DirR; appendRun( bidi ); - dir = QChar::DirEN; - bidi.status.eor = QChar::DirEN; + dir = TQChar::DirEN; + bidi.status.eor = TQChar::DirEN; } else { bidi.eor = bidi.current; bidi.status.eor = dirCurrent; } @@ -1110,49 +1110,49 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator } break; } - case QChar::DirAN: - dirCurrent = QChar::DirAN; - if(dir == QChar::DirON) dir = QChar::DirAN; + case TQChar::DirAN: + dirCurrent = TQChar::DirAN; + if(dir == TQChar::DirON) dir = TQChar::DirAN; switch(bidi.status.last) { - case QChar::DirL: - case QChar::DirAN: - bidi.eor = bidi.current; bidi.status.eor = QChar::DirAN; break; - case QChar::DirR: - case QChar::DirAL: - case QChar::DirEN: + case TQChar::DirL: + case TQChar::DirAN: + bidi.eor = bidi.current; bidi.status.eor = TQChar::DirAN; break; + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirEN: appendRun( bidi ); - dir = QChar::DirAN; bidi.status.eor = QChar::DirAN; + dir = TQChar::DirAN; bidi.status.eor = TQChar::DirAN; break; - case QChar::DirCS: - if(bidi.status.eor == QChar::DirAN) { + case TQChar::DirCS: + if(bidi.status.eor == TQChar::DirAN) { bidi.eor = bidi.current; break; } - case QChar::DirES: - case QChar::DirET: - case QChar::DirBN: - case QChar::DirB: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: - if(bidi.status.eor == QChar::DirR) { + case TQChar::DirES: + case TQChar::DirET: + case TQChar::DirBN: + case TQChar::DirB: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: + if(bidi.status.eor == TQChar::DirR) { // neutrals go to R bidi.eor = bidi.last; appendRun( bidi ); - dir = QChar::DirAN; - bidi.status.eor = QChar::DirAN; - } else if( bidi.status.eor == QChar::DirL || - (bidi.status.eor == QChar::DirEN && bidi.status.lastStrong == QChar::DirL)) { + dir = TQChar::DirAN; + bidi.status.eor = TQChar::DirAN; + } else if( bidi.status.eor == TQChar::DirL || + (bidi.status.eor == TQChar::DirEN && bidi.status.lastStrong == TQChar::DirL)) { bidi.eor = bidi.current; bidi.status.eor = dirCurrent; } else { // numbers on both sides, neutrals get right to left direction - if(dir != QChar::DirL) { + if(dir != TQChar::DirL) { appendRun( bidi ); bidi.eor = bidi.last; - dir = QChar::DirR; + dir = TQChar::DirR; appendRun( bidi ); - dir = QChar::DirAN; - bidi.status.eor = QChar::DirAN; + dir = TQChar::DirAN; + bidi.status.eor = TQChar::DirAN; } else { bidi.eor = bidi.current; bidi.status.eor = dirCurrent; } @@ -1161,30 +1161,30 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator break; } break; - case QChar::DirES: - case QChar::DirCS: + case TQChar::DirES: + case TQChar::DirCS: break; - case QChar::DirET: - if(bidi.status.last == QChar::DirEN) { - dirCurrent = QChar::DirEN; + case TQChar::DirET: + if(bidi.status.last == TQChar::DirEN) { + dirCurrent = TQChar::DirEN; bidi.eor = bidi.current; bidi.status.eor = dirCurrent; break; } break; // boundary neutrals should be ignored - case QChar::DirBN: + case TQChar::DirBN: break; // neutrals - case QChar::DirB: + case TQChar::DirB: // ### what do we do with newline and paragraph seperators that come to here? break; - case QChar::DirS: + case TQChar::DirS: // ### implement rule L1 break; - case QChar::DirWS: + case TQChar::DirWS: break; - case QChar::DirON: + case TQChar::DirON: break; default: break; @@ -1197,31 +1197,31 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator // set status.last as needed. switch(dirCurrent) { - case QChar::DirET: - case QChar::DirES: - case QChar::DirCS: - case QChar::DirS: - case QChar::DirWS: - case QChar::DirON: + case TQChar::DirET: + case TQChar::DirES: + case TQChar::DirCS: + case TQChar::DirS: + case TQChar::DirWS: + case TQChar::DirON: switch(bidi.status.last) { - case QChar::DirL: - case QChar::DirR: - case QChar::DirAL: - case QChar::DirEN: - case QChar::DirAN: + case TQChar::DirL: + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirEN: + case TQChar::DirAN: bidi.status.last = dirCurrent; break; default: - bidi.status.last = QChar::DirON; + bidi.status.last = TQChar::DirON; } break; - case QChar::DirNSM: - case QChar::DirBN: + case TQChar::DirNSM: + case TQChar::DirBN: // ignore these break; - case QChar::DirEN: - if ( bidi.status.last == QChar::DirL ) { + case TQChar::DirEN: + if ( bidi.status.last == TQChar::DirL ) { break; } // fall through @@ -1285,7 +1285,7 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator #if BIDI_DEBUG > 0 kdDebug(6041) << "lineLow = " << (uint)levelLow << ", lineHigh = " << (uint)levelHigh << endl; kdDebug(6041) << "logical order is:" << endl; - QPtrListIterator<BidiRun> it2(runs); + TQPtrListIterator<BidiRun> it2(runs); BidiRun *r2; for ( ; (r2 = it2.current()); ++it2 ) kdDebug(6041) << " " << r2 << " start=" << r2->start << " stop=" << r2->stop << " level=" << (uint)r2->level << endl; @@ -1369,7 +1369,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLin invalidateVerticalPositions(); #ifdef DEBUG_LAYOUT - QTime qt; + TQTime qt; qt.start(); kdDebug( 6040 ) << renderName() << " layoutInlineChildren( " << this <<" )" << endl; #endif @@ -1423,16 +1423,16 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLin BidiContext *startEmbed; if( style()->direction() == LTR ) { - startEmbed = new BidiContext( 0, QChar::DirL ); - bidi.status.eor = QChar::DirL; + startEmbed = new BidiContext( 0, TQChar::DirL ); + bidi.status.eor = TQChar::DirL; } else { - startEmbed = new BidiContext( 1, QChar::DirR ); - bidi.status.eor = QChar::DirR; + startEmbed = new BidiContext( 1, TQChar::DirR ); + bidi.status.eor = TQChar::DirR; } startEmbed->ref(); - bidi.status.lastStrong = QChar::DirON; - bidi.status.last = QChar::DirON; + bidi.status.lastStrong = TQChar::DirON; + bidi.status.last = TQChar::DirON; bidi.context = startEmbed; adjustEmbedding = true; @@ -1443,7 +1443,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLin m_firstLine = true; if (!smidpoints) - smidpoints = new QMemArray<BidiIterator>; + smidpoints = new TQMemArray<BidiIterator>; sNumMidpoints = 0; sCurrMidpoint = 0; @@ -1528,7 +1528,7 @@ redo_linebreak: adjustEmbedding = true; end.increment(bidi); adjustEmbedding = false; - } else if (end.obj && end.obj->style()->preserveLF() && end.current() == QChar('\n')) { + } else if (end.obj && end.obj->style()->preserveLF() && end.current() == TQChar('\n')) { adjustEmbedding = true; end.increment(bidi); adjustEmbedding = false; @@ -1836,7 +1836,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi // item, then this is all moot. -dwh RenderObject* next = Bidinext( start.par, o, bidi ); if (!style()->preserveWS() && next && next->isText() && static_cast<RenderText*>(next)->stringLength() > 0 && - (static_cast<RenderText*>(next)->text()[0].category() == QChar::Separator_Space || + (static_cast<RenderText*>(next)->text()[0].category() == TQChar::Separator_Space || static_cast<RenderText*>(next)->text()[0] == '\n')) { currentCharacterIsSpace = true; ignoringSpaces = true; @@ -1848,7 +1848,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi RenderText *t = static_cast<RenderText *>(o); int strlen = t->stringLength(); int len = strlen - pos; - QChar *str = t->text(); + TQChar *str = t->text(); const Font *f = t->htmlFont( m_firstLine ); // proportional font, needs a bit more work. @@ -1868,7 +1868,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi bool previousCharacterIsSpace = currentCharacterIsSpace; bool isSoftBreakable = nextIsSoftBreakable; nextIsSoftBreakable = false; - const QChar c = str[pos]; + const TQChar c = str[pos]; currentCharacterIsSpace = c == ' '; if (preserveWS || !currentCharacterIsSpace) @@ -1933,7 +1933,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi !t->containsOnlyWhitespace(pos+1, strlen-(pos+1))); #endif #ifdef DEBUG_LINEBREAKS - kdDebug(6041) << "found space at " << pos << " in string '" << QString( str, strlen ).latin1() << "' adding " << tmpW << " new width = " << w << endl; + kdDebug(6041) << "found space at " << pos << " in string '" << TQString( str, strlen ).latin1() << "' adding " << tmpW << " new width = " << w << endl; #endif if ( autoWrap && w + tmpW > width && w == 0 ) { int fb = nearestFloatBottom(m_height); @@ -2039,7 +2039,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi checkForBreak = false; RenderText* nextText = static_cast<RenderText*>(next); if (nextText->stringLength() != 0) { - QChar c = nextText->text()[0]; + TQChar c = nextText->text()[0]; if (c == ' ' || c == '\t' || (c == '\n' && !next->style()->preserveLF())) { // If the next item on the line is text, and if we did not end with // a space, then the next text run continues our word (and so it needs to @@ -2191,7 +2191,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi if (lBreak.obj && lBreak.pos >= 2 && lBreak.obj->isText()) { // For soft hyphens on line breaks, we have to chop out the midpoints that made us // ignore the hyphen so that it will render at the end of the line. - QChar c = static_cast<RenderText*>(lBreak.obj)->text()[lBreak.pos-1]; + TQChar c = static_cast<RenderText*>(lBreak.obj)->text()[lBreak.pos-1]; if (c.unicode() == SOFT_HYPHEN) chopMidpointsAt(lBreak.obj, lBreak.pos-2); } @@ -2218,8 +2218,8 @@ void RenderBlock::deleteEllipsisLineBoxes() void RenderBlock::checkLinesForTextOverflow() { // Determine the width of the ellipsis using the current font. - QChar ellipsis = 0x2026; // FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if 0x2026 not renderable - static QString ellipsisStr(ellipsis); + TQChar ellipsis = 0x2026; // FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if 0x2026 not renderable + static TQString ellipsisStr(ellipsis); const Font& firstLineFont = style(true)->htmlFont(); const Font& font = style()->htmlFont(); int firstLineEllipsisWidth = firstLineFont.width(&ellipsis, 1, 0); diff --git a/khtml/rendering/bidi.h b/khtml/rendering/bidi.h index 4d6b6aaf1..15a9ab906 100644 --- a/khtml/rendering/bidi.h +++ b/khtml/rendering/bidi.h @@ -23,7 +23,7 @@ #ifndef BIDI_H #define BIDI_H -#include <qstring.h> +#include <tqstring.h> namespace khtml { class RenderArena; @@ -33,7 +33,7 @@ namespace khtml { class BidiContext { public: - BidiContext(unsigned char level, QChar::Direction embedding, BidiContext *parent = 0, bool override = false); + BidiContext(unsigned char level, TQChar::Direction embedding, BidiContext *parent = 0, bool override = false); ~BidiContext(); void ref() const; @@ -41,8 +41,8 @@ namespace khtml { unsigned char level; bool override : 1; - QChar::Direction dir : 5; - QChar::Direction basicDir : 5; + TQChar::Direction dir : 5; + TQChar::Direction basicDir : 5; BidiContext *parent; @@ -52,21 +52,21 @@ namespace khtml { }; struct BidiRun { - BidiRun(int _start, int _stop, RenderObject *_obj, BidiContext *context, QChar::Direction dir) + BidiRun(int _start, int _stop, RenderObject *_obj, BidiContext *context, TQChar::Direction dir) : start( _start ), stop( _stop ), obj( _obj ), box(0), nextRun(0) { - if(dir == QChar::DirON) dir = context->dir; + if(dir == TQChar::DirON) dir = context->dir; level = context->level; // add level of run (cases I1 & I2) if( level % 2 ) { - if(dir == QChar::DirL || dir == QChar::DirAN || dir == QChar::DirEN) + if(dir == TQChar::DirL || dir == TQChar::DirAN || dir == TQChar::DirEN) level++; } else { - if( dir == QChar::DirR ) + if( dir == TQChar::DirR ) level++; - else if( dir == QChar::DirAN || dir == QChar::DirEN) + else if( dir == TQChar::DirAN || dir == TQChar::DirEN) level += 2; } } diff --git a/khtml/rendering/break_lines.cpp b/khtml/rendering/break_lines.cpp index 483455127..a0d314cee 100644 --- a/khtml/rendering/break_lines.cpp +++ b/khtml/rendering/break_lines.cpp @@ -1,8 +1,8 @@ #include <break_lines.h> #include <klibloader.h> -#include "qcstring.h" -#include <qtextcodec.h> -#include <qcleanuphandler.h> +#include "tqcstring.h" +#include <tqtextcodec.h> +#include <tqcleanuphandler.h> #include <config.h> @@ -38,7 +38,7 @@ namespace khtml { free(isbreakable); if (library) library->unload(); } - const QChar *string; + const TQChar *string; int *wbrpos; int *isbreakable; int allocated; @@ -56,9 +56,9 @@ namespace khtml { #endif } - bool isBreakableThai( const QChar *string, const int pos, const int len) + bool isBreakableThai( const TQChar *string, const int pos, const int len) { - static QTextCodec *thaiCodec = QTextCodec::codecForMib(2259); + static TQTextCodec *thaiCodec = TQTextCodec::codecForMib(2259); //printf("Entering isBreakableThai with pos = %d\n", pos); #ifndef HAVE_LIBTHAI @@ -96,7 +96,7 @@ namespace khtml { // build up string of thai chars if ( string != cache->string ) { //fprintf(stderr,"new string found (not in cache), calling libthai\n"); - QCString cstr = thaiCodec->fromUnicode( QConstString(string,len).string()); + TQCString cstr = thaiCodec->fromUnicode( TQConstString(string,len).string()); //printf("About to call libthai::th_brk with str: %s",cstr.data()); cache->numwbrpos = th_brk((const unsigned char*) cstr.data(), cache->wbrpos, cache->allocated); diff --git a/khtml/rendering/break_lines.h b/khtml/rendering/break_lines.h index e33fce247..5176e5fb0 100644 --- a/khtml/rendering/break_lines.h +++ b/khtml/rendering/break_lines.h @@ -1,7 +1,7 @@ #ifndef BREAK_LINES_H #define BREAK_LINES_H -#include <qstring.h> +#include <tqstring.h> namespace khtml { @@ -12,8 +12,8 @@ namespace khtml { Korean, Chinese ones should work as well */ /* - dontbreakbefore[] contains characters not covered by QChar::Punctuation_Close that shouldn't be broken before. - chars included in QChar::Punctuation_Close are listed below.(look at UAX #14) + dontbreakbefore[] contains characters not covered by TQChar::Punctuation_Close that shouldn't be broken before. + chars included in TQChar::Punctuation_Close are listed below.(look at UAX #14) - 3001 ideographic comma - 3002 ideographic full stop - FE50 small comma @@ -88,7 +88,7 @@ namespace khtml { 0xFF70 //halfwidth katakana-hiragana prolonged sound mark }; - // characters that aren't covered by QChar::Punctuation_Open + // characters that aren't covered by TQChar::Punctuation_Open const ushort dontbreakafter[] = { 0x3012, //postal mark 0xFF03, //full width pound mark @@ -116,12 +116,12 @@ namespace khtml { } } - bool isBreakableThai( const QChar *string, const int pos, const int len); + bool isBreakableThai( const TQChar *string, const int pos, const int len); void cleanup_thaibreaks(); - inline bool isBreakable( const QChar *str, const int pos, int len ) + inline bool isBreakable( const TQChar *str, const int pos, int len ) { - const QChar *c = str+pos; + const TQChar *c = str+pos; unsigned short ch = c->unicode(); if ( ch > 0xff ) { // not latin1, need to do more sophisticated checks for asian fonts @@ -140,10 +140,10 @@ namespace khtml { return false; // never break before first character // check for simple punctuation cases - QChar::Category cat = c->category(); - if ( cat == QChar::Punctuation_Close || - cat == QChar::Punctuation_Other || - (str+(pos-1))->category() == QChar::Punctuation_Open ) + TQChar::Category cat = c->category(); + if ( cat == TQChar::Punctuation_Close || + cat == TQChar::Punctuation_Other || + (str+(pos-1))->category() == TQChar::Punctuation_Open ) return false; // do binary search in dontbreak[] diff --git a/khtml/rendering/enumerate.cpp b/khtml/rendering/enumerate.cpp index 75af71465..9cfe149ad 100644 --- a/khtml/rendering/enumerate.cpp +++ b/khtml/rendering/enumerate.cpp @@ -25,20 +25,20 @@ #include "rendering/enumerate.h" -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> namespace khtml { namespace Enumerate { -QString toRoman( int number, bool upper ) +TQString toRoman( int number, bool upper ) { - if (number < 1 || number > 3999) return QString::number(number); - QString roman; - static const QChar ldigits[] = { 'i', 'v', 'x', 'l', 'c', 'd', 'm' }; - static const QChar udigits[] = { 'I', 'V', 'X', 'L', 'C', 'D', 'M' }; - const QChar *digits = upper ? udigits : ldigits; + if (number < 1 || number > 3999) return TQString::number(number); + TQString roman; + static const TQChar ldigits[] = { 'i', 'v', 'x', 'l', 'c', 'd', 'm' }; + static const TQChar udigits[] = { 'I', 'V', 'X', 'L', 'C', 'D', 'M' }; + const TQChar *digits = upper ? udigits : ldigits; int i, d = 0; do @@ -66,20 +66,20 @@ QString toRoman( int number, bool upper ) return roman; } -QString toGeorgian( int number ) +TQString toGeorgian( int number ) { - QString georgian; - const QChar tenthousand = 0x10ef; - static const QChar thousands[9] = {0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, + TQString georgian; + const TQChar tenthousand = 0x10ef; + static const TQChar thousands[9] = {0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10f4, 0x10f5 }; - static const QChar hundreds[9] = {0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10f3, + static const TQChar hundreds[9] = {0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10f3, 0x10e4, 0x10e5, 0x10e6, 0x10e7 }; - static const QChar tens[9] = {0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, + static const TQChar tens[9] = {0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10f2, 0x10dd, 0x10de, 0x10df }; - static const QChar units[9] = {0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, + static const TQChar units[9] = {0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10f1, 0x10d7 }; - if (number < 1 || number > 19999) return QString::number(number); + if (number < 1 || number > 19999) return TQString::number(number); if (number >= 10000) { georgian.append(tenthousand); number = number - 10000; @@ -103,54 +103,54 @@ QString toGeorgian( int number ) return georgian; } -QString toArmenian( int number ) +TQString toArmenian( int number ) { - QString armenian; + TQString armenian; int onethousand = 0x57c; int hundreds = 0x572; int tens = 0x569; int units = 0x560; // The standard defines values over 1999, but 7000 is very hard to render - if (number < 1 || number > 1999) return QString::number(number); + if (number < 1 || number > 1999) return TQString::number(number); if (number >= 1000) { - armenian.append(QChar(onethousand)); + armenian.append(TQChar(onethousand)); number = number - 1000; } if (number >= 100) { - armenian.append(QChar(hundreds+number/100)); + armenian.append(TQChar(hundreds+number/100)); number = number % 100; } if (number >= 10) { - armenian.append(QChar(tens+number/10)); + armenian.append(TQChar(tens+number/10)); number = number % 10; } if (number >= 1) { - armenian.append(QChar(units+number)); + armenian.append(TQChar(units+number)); } return armenian; } -QString toHebrew( int number ) { - static const QChar tenDigit[] = {1497, 1499, 1500, 1502, 1504, 1505, 1506, 1508, 1510}; +TQString toHebrew( int number ) { + static const TQChar tenDigit[] = {1497, 1499, 1500, 1502, 1504, 1505, 1506, 1508, 1510}; - QString letter; - if (number < 1) return QString::number(number); + TQString letter; + if (number < 1) return TQString::number(number); if (number>999) { - letter = toHebrew(number/1000) + QString::fromLatin1("'"); + letter = toHebrew(number/1000) + TQString::fromLatin1("'"); number = number%1000; } int hunderts = (number/400); if (hunderts > 0) { for(int i=0; i<hunderts; i++) { - letter += QChar(1511 + 3); + letter += TQChar(1511 + 3); } } number = number % 400; if ((number / 100) != 0) { - letter += QChar (1511 + (number / 100) -1); + letter += TQChar (1511 + (number / 100) -1); } number = number % 100; int tens = number/10; @@ -158,27 +158,27 @@ QString toHebrew( int number ) { letter += tenDigit[tens-1]; } if (number == 15 || number == 16) { // special because of religious - letter += QChar(1487 + 9); // reasons - letter += QChar(1487 + number - 9); + letter += TQChar(1487 + 9); // reasons + letter += TQChar(1487 + number - 9); } else { number = number % 10; if (number != 0) { - letter += QChar (1487 + number); + letter += TQChar (1487 + number); } } return letter; } -static inline QString toLatin( int number, int base ) { - if (number < 1) return QString::number(number); - QValueList<QChar> letters; +static inline TQString toLatin( int number, int base ) { + if (number < 1) return TQString::number(number); + TQValueList<TQChar> letters; while(number > 0) { number--; // number 0 is letter a - QChar letter = (QChar) (base + (number % 26)); + TQChar letter = (TQChar) (base + (number % 26)); letters.prepend(letter); number /= 26; } - QString str; + TQString str; str.setLength(letters.size()); int i=0; while(!letters.isEmpty()) { @@ -188,24 +188,24 @@ static inline QString toLatin( int number, int base ) { return str; } -QString toLowerLatin( int number ) { +TQString toLowerLatin( int number ) { return toLatin( number, 'a' ); } -QString toUpperLatin( int number ) { +TQString toUpperLatin( int number ) { return toLatin( number, 'A' ); } -static inline QString toAlphabetic( int number, int base, const QChar alphabet[] ) { - if (number < 1) return QString::number(number); - QValueList<QChar> letters; +static inline TQString toAlphabetic( int number, int base, const TQChar alphabet[] ) { + if (number < 1) return TQString::number(number); + TQValueList<TQChar> letters; while(number > 0) { number--; // number 0 is letter 1 - QChar letter = alphabet[number % base]; + TQChar letter = alphabet[number % base]; letters.prepend(letter); number /= base; } - QString str; + TQString str; str.setLength(letters.size()); int i=0; while(!letters.isEmpty()) { @@ -215,8 +215,8 @@ static inline QString toAlphabetic( int number, int base, const QChar alphabet[] return str; } -QString toHiragana( int number ) { - static const QChar hiragana[48] = {0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, +TQString toHiragana( int number ) { + static const TQChar hiragana[48] = {0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3072, 0x3075, 0x3078, @@ -226,8 +226,8 @@ QString toHiragana( int number ) { return toAlphabetic( number, 48, hiragana ); } -QString toHiraganaIroha( int number ) { - static const QChar hiragana[47] = {0x3044, 0x308D, 0x306F, 0x306B, 0x307B, 0x3078, 0x3068, +TQString toHiraganaIroha( int number ) { + static const TQChar hiragana[47] = {0x3044, 0x308D, 0x306F, 0x306B, 0x307B, 0x3078, 0x3068, 0x3061, 0x308A, 0x306C, 0x308B, 0x3092, 0x308F, 0x304B, 0x3088, 0x305F, 0x308C, 0x305D, 0x3064, 0x306D, 0x306A, 0x3089, 0x3080, 0x3046, 0x3090, 0x306E, 0x304A, 0x304F, 0x3084, @@ -237,8 +237,8 @@ QString toHiraganaIroha( int number ) { return toAlphabetic( number, 47, hiragana ); } -QString toKatakana( int number ) { - static const QChar katakana[48] = {0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, +TQString toKatakana( int number ) { + static const TQChar katakana[48] = {0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, @@ -248,8 +248,8 @@ QString toKatakana( int number ) { return toAlphabetic( number, 48, katakana ); } -QString toKatakanaIroha( int number ) { - static const QChar katakana[47] = {0x30A4, 0x30ED, 0x30CF, 0x30CB, 0x30DB, 0x30D8, 0x30C8, +TQString toKatakanaIroha( int number ) { + static const TQChar katakana[47] = {0x30A4, 0x30ED, 0x30CF, 0x30CB, 0x30DB, 0x30D8, 0x30C8, 0x30C1, 0x30EA, 0x30CC, 0x30EB, 0x30F2, 0x30EF, 0x30AB, 0x30E8, 0x30BF, 0x30EC, 0x30ED, 0x30C4, 0x30CD, 0x30CA, 0x30E9, 0x30E0, 0x30A6, 0x30F0, 0x30CE, 0x30AA, 0x30AF, @@ -259,8 +259,8 @@ QString toKatakanaIroha( int number ) { return toAlphabetic( number, 47, katakana ); } -QString toLowerGreek( int number ) { - static const QChar greek[24] = { 0x3B1, 0x3B2, 0x3B3, 0x3B4, 0x3B5, 0x3B6, 0x3B7, +TQString toLowerGreek( int number ) { + static const TQChar greek[24] = { 0x3B1, 0x3B2, 0x3B3, 0x3B4, 0x3B5, 0x3B6, 0x3B7, 0x3B8, 0x3B9, 0x3BA, 0x3BB, 0x3BC, 0x3BD, 0x3BE, 0x3BF, 0x3C0, 0x3C1, 0x3C3, 0x3C4, 0x3C5, 0x3C6, 0x3C7, 0x3C8, 0x3C0}; @@ -268,52 +268,52 @@ QString toLowerGreek( int number ) { return toAlphabetic( number, 24, greek ); } -QString toUpperGreek( int number ) { +TQString toUpperGreek( int number ) { // The standard claims to be base 24, but only lists 19 letters. - static const QChar greek[19] = { 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, + static const TQChar greek[19] = { 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, 0x399, 0x39A, 0x39B, 0x39C, 0x39D, 0x39E, 0x39F, 0x3A0, 0x3A1, 0x3A3, 0x3A9}; return toAlphabetic( number, 19, greek ); } -static inline QString toNumeric( int number, int base ) { - QString letter = QString::number(number); +static inline TQString toNumeric( int number, int base ) { + TQString letter = TQString::number(number); for(unsigned int i = 0; i < letter.length(); i++) { if (letter[i].isDigit()) - letter[i] = QChar(letter[i].digitValue()+base); + letter[i] = TQChar(letter[i].digitValue()+base); } return letter; } -QString toArabicIndic( int number ) { +TQString toArabicIndic( int number ) { return toNumeric(number, 0x660); } -QString toPersianUrdu( int number ) { +TQString toPersianUrdu( int number ) { return toNumeric(number, 0x6F0); } -QString toLao( int number ) { +TQString toLao( int number ) { return toNumeric(number, 0xED0); } -QString toThai( int number ) { +TQString toThai( int number ) { return toNumeric(number, 0xE50); } -QString toTibetan( int number ) { +TQString toTibetan( int number ) { return toNumeric(number, 0xF20); } -static inline QString toIdeographic(int number, const QChar digits[], const QChar digitmarkers[]) { - if (number < 0 || number > 9999) return QString::number(number); +static inline TQString toIdeographic(int number, const TQChar digits[], const TQChar digitmarkers[]) { + if (number < 0 || number > 9999) return TQString::number(number); - QString grp = QString::number(number); + TQString grp = TQString::number(number); // ### Append group markers to handle numbers > 9999 - QString str; + TQString str; // special case if (number < 20 && number >= 10) { @@ -342,10 +342,10 @@ static inline QString toIdeographic(int number, const QChar digits[], const QCha return str; } -QString toTradChineseFormal( int number ) { -// static const QChar groupMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; - static const QChar digitMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x4e00, +TQString toTradChineseFormal( int number ) { +// static const TQChar groupMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; + static const TQChar digitMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x4e00, 0x4ebc, 0x4e09, 0x56db, 0x4e94, 0x516d, 0x4e03, @@ -353,10 +353,10 @@ QString toTradChineseFormal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toTradChineseInformal( int number ) { -// static const QChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x4e00, +TQString toTradChineseInformal( int number ) { +// static const TQChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x4e00, 0x4ebc, 0x4e09, 0x56db, 0x4e94, 0x516d, 0x4e03, @@ -364,10 +364,10 @@ QString toTradChineseInformal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toSimpChineseFormal( int number ) { -// static const QChar groupMarkers[3] = {0x4e07, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x58f9, +TQString toSimpChineseFormal( int number ) { +// static const TQChar groupMarkers[3] = {0x4e07, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x4e07, 0x4ebf, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2, @@ -375,10 +375,10 @@ QString toSimpChineseFormal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toSimpChineseInformal( int number ) { -// static const QChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x58f9, +TQString toSimpChineseInformal( int number ) { +// static const TQChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2, @@ -386,10 +386,10 @@ QString toSimpChineseInformal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toJapaneseFormal( int number ) { -// static const QChar groupMarkers[3] = {0x4e07, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x62fe, 0x4f70, 0x4edf}; - static const QChar digits[10] = {0x96f6, 0x58f9, +TQString toJapaneseFormal( int number ) { +// static const TQChar groupMarkers[3] = {0x4e07, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x62fe, 0x4f70, 0x4edf}; + static const TQChar digits[10] = {0x96f6, 0x58f9, 0x8cb3, 0x53c3, 0x8086, 0x4f0d, 0x9678, 0x67d2, @@ -397,10 +397,10 @@ QString toJapaneseFormal( int number ) { return toIdeographic(number, digits, digitMarkers); } -QString toJapaneseInformal( int number ) { -// static const QChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; - static const QChar digits[10] = {0x96f6, 0x58f9, +TQString toJapaneseInformal( int number ) { +// static const TQChar groupMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digitMarkers[3] = {0x842c, 0x5104, 0x5146}; + static const TQChar digits[10] = {0x96f6, 0x58f9, 0x8d30, 0x53c1, 0x8086, 0x4f0d, 0x9646, 0x67d2, diff --git a/khtml/rendering/enumerate.h b/khtml/rendering/enumerate.h index 518a8e9d6..583a6171c 100644 --- a/khtml/rendering/enumerate.h +++ b/khtml/rendering/enumerate.h @@ -31,35 +31,35 @@ namespace khtml { namespace Enumerate { // Numeric - QString toArabicIndic( int number ); - QString toLao( int number ); - QString toPersianUrdu( int number ); - QString toThai( int number ); - QString toTibetan( int number ); + TQString toArabicIndic( int number ); + TQString toLao( int number ); + TQString toPersianUrdu( int number ); + TQString toThai( int number ); + TQString toTibetan( int number ); // Alphabetic - QString toLowerLatin( int number ); - QString toUpperLatin( int number ); - QString toLowerGreek( int number ); - QString toUpperGreek( int number ); - QString toHiragana( int number ); - QString toHiraganaIroha( int number ); - QString toKatakana( int number ); - QString toKatakanaIroha( int number ); + TQString toLowerLatin( int number ); + TQString toUpperLatin( int number ); + TQString toLowerGreek( int number ); + TQString toUpperGreek( int number ); + TQString toHiragana( int number ); + TQString toHiraganaIroha( int number ); + TQString toKatakana( int number ); + TQString toKatakanaIroha( int number ); // Algorithmic - QString toRoman( int number, bool upper ); - QString toHebrew( int number ); - QString toGeorgian( int number ); - QString toArmenian( int number ); + TQString toRoman( int number, bool upper ); + TQString toHebrew( int number ); + TQString toGeorgian( int number ); + TQString toArmenian( int number ); // Ideographic - QString toJapaneseFormal ( int number ); - QString toJapaneseInformal ( int number ); - QString toSimpChineseFormal ( int number ); - QString toSimpChineseInformal ( int number ); - QString toTradChineseFormal ( int number ); - QString toTradChineseInformal ( int number ); + TQString toJapaneseFormal ( int number ); + TQString toJapaneseInformal ( int number ); + TQString toSimpChineseFormal ( int number ); + TQString toSimpChineseInformal ( int number ); + TQString toTradChineseFormal ( int number ); + TQString toTradChineseInformal ( int number ); }} // namespaces diff --git a/khtml/rendering/font.cpp b/khtml/rendering/font.cpp index cdd580596..a33f0e082 100644 --- a/khtml/rendering/font.cpp +++ b/khtml/rendering/font.cpp @@ -35,9 +35,9 @@ #include <kdebug.h> #include <kglobal.h> -#include <qpainter.h> -#include <qfontdatabase.h> -#include <qpaintdevicemetrics.h> +#include <tqpainter.h> +#include <tqfontdatabase.h> +#include <tqpaintdevicemetrics.h> using namespace khtml; @@ -51,12 +51,12 @@ using namespace khtml; * @return the width in pixels. May be 0 if @p wordStart and @p wordEnd were * equal. */ -inline int closeWordAndGetWidth(const QFontMetrics &fm, const QChar *str, int pos, +inline int closeWordAndGetWidth(const TQFontMetrics &fm, const TQChar *str, int pos, int wordStart, int wordEnd) { if (wordEnd <= wordStart) return 0; - QConstString s(str + pos + wordStart, wordEnd - wordStart); + TQConstString s(str + pos + wordStart, wordEnd - wordStart); return fm.width(s.string()); } @@ -75,41 +75,41 @@ inline int closeWordAndGetWidth(const QFontMetrics &fm, const QChar *str, int po * will be set to wordEnd after function * @param wordEnd relative index pointing one position after the word ended */ -inline void closeAndDrawWord(QPainter *p, QPainter::TextDirection d, - int &x, int y, const short widths[], const QChar *str, int pos, +inline void closeAndDrawWord(TQPainter *p, TQPainter::TextDirection d, + int &x, int y, const short widths[], const TQChar *str, int pos, int &wordStart, int wordEnd) { if (wordEnd <= wordStart) return; int width = widths[wordStart]; - if (d == QPainter::RTL) + if (d == TQPainter::RTL) x -= width; - QConstString s(str + pos + wordStart, wordEnd - wordStart); + TQConstString s(str + pos + wordStart, wordEnd - wordStart); p->drawText(x, y, s.string(), -1, d); - if (d != QPainter::RTL) + if (d != TQPainter::RTL) x += width; wordStart = wordEnd; } -void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, - int toAdd, QPainter::TextDirection d, int from, int to, QColor bg, int uy, int h, int deco ) const +void Font::drawText( TQPainter *p, int x, int y, TQChar *str, int slen, int pos, int len, + int toAdd, TQPainter::TextDirection d, int from, int to, TQColor bg, int uy, int h, int deco ) const { if (!str) return; - QConstString cstr = QConstString(str, slen); - QString qstr = cstr.string(); + TQConstString cstr = TQConstString(str, slen); + TQString qstr = cstr.string(); // ### fixme for RTL if ( !scFont && !letterSpacing && !wordSpacing && !toAdd && from==-1 ) { // simply draw it - // Due to some unfounded cause QPainter::drawText traverses the + // Due to some unfounded cause TQPainter::drawText traverses the // *whole* string when painting, not only the specified // [pos, pos + len) segment. This makes painting *extremely* slow for // long render texts (in the order of several megabytes). // Hence, only hand over the piece of text of the actual inline text box - QConstString cstr = QConstString(str + pos, len); + TQConstString cstr = TQConstString(str + pos, len); p->drawText( x, y, cstr.string(), 0, len, d ); } else { if (from < 0) from = 0; @@ -118,20 +118,20 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i int numSpaces = 0; if ( toAdd ) { for( int i = 0; i < len; ++i ) - if ( str[i+pos].category() == QChar::Separator_Space ) + if ( str[i+pos].category() == TQChar::Separator_Space ) ++numSpaces; } const int totWidth = width( str, slen, pos, len ); - if ( d == QPainter::RTL ) { + if ( d == TQPainter::RTL ) { x += totWidth + toAdd; } - QString upper = qstr; - QFontMetrics sc_fm = fm; + TQString upper = qstr; + TQFontMetrics sc_fm = fm; if ( scFont ) { // draw in small caps upper = qstr.upper(); - sc_fm = QFontMetrics( *scFont ); + sc_fm = TQFontMetrics( *scFont ); } // ### sc could be optimized by only painting uppercase letters extra, @@ -150,11 +150,11 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i if (mode == Whole) { // most likely variant is treated extra if (to < 0) to = len; - const QConstString cstr(str + pos, len); - const QConstString segStr(str + pos + from, to - from); + const TQConstString cstr(str + pos, len); + const TQConstString segStr(str + pos + from, to - from); const int preSegmentWidth = fm.width(cstr.string(), from); const int segmentWidth = fm.width(segStr.string()); - const int eff_x = d == QPainter::RTL ? x - preSegmentWidth - segmentWidth + const int eff_x = d == TQPainter::RTL ? x - preSegmentWidth - segmentWidth : x + preSegmentWidth; // draw whole string segment, with optional background @@ -194,9 +194,9 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i onSegment = true; } - const QChar ch = str[pos+i]; - bool lowercase = (ch.category() == QChar::Letter_Lowercase); - bool is_space = (ch.category() == QChar::Separator_Space); + const TQChar ch = str[pos+i]; + bool lowercase = (ch.category() == TQChar::Letter_Lowercase); + bool is_space = (ch.category() == TQChar::Separator_Space); int chw = 0; if ( letterSpacing ) chw += letterSpacing; @@ -235,10 +235,10 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i widthList[lastWordBegin] = (short)width; } - if (d == QPainter::RTL) x -= preSegmentWidth; + if (d == TQPainter::RTL) x -= preSegmentWidth; else x += preSegmentWidth; - const int startx = d == QPainter::RTL ? x-segmentWidth : x; + const int startx = d == TQPainter::RTL ? x-segmentWidth : x; // optionally draw background if ( bg.isValid() ) @@ -247,9 +247,9 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i // second pass: do the actual drawing lastWordBegin = from; for( int i = from; i < to; ++i ) { - const QChar ch = str[pos+i]; - bool lowercase = (ch.category() == QChar::Letter_Lowercase); - bool is_space = ch.category() == QChar::Separator_Space; + const TQChar ch = str[pos+i]; + bool lowercase = (ch.category() == TQChar::Letter_Lowercase); + bool is_space = ch.category() == TQChar::Separator_Space; if ( is_space ) { if (mode == WordWise) { closeAndDrawWord(p, d, x, y, widthList, str, pos, lastWordBegin, i); @@ -258,14 +258,14 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i } if (is_space || mode == CharacterWise) { const int chw = widthList[i]; - if (d == QPainter::RTL) + if (d == TQPainter::RTL) x -= chw; if ( scFont ) p->setFont( lowercase ? *scFont : f ); p->drawText( x, y, (lowercase ? upper : qstr), pos+i, 1, d ); - if (d != QPainter::RTL) + if (d != TQPainter::RTL) x += chw; } @@ -285,18 +285,18 @@ void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, i } -int Font::width( QChar *chs, int, int pos, int len, int start, int end, int toAdd ) const +int Font::width( TQChar *chs, int, int pos, int len, int start, int end, int toAdd ) const { - const QConstString cstr(chs+pos, len); + const TQConstString cstr(chs+pos, len); int w = 0; - const QString qstr = cstr.string(); + const TQString qstr = cstr.string(); if ( scFont ) { - const QString upper = qstr.upper(); - const QChar *uc = qstr.unicode(); - const QFontMetrics sc_fm( *scFont ); + const TQString upper = qstr.upper(); + const TQChar *uc = qstr.unicode(); + const TQFontMetrics sc_fm( *scFont ); for ( int i = 0; i < len; ++i ) { - if ( (uc+i)->category() == QChar::Letter_Lowercase ) + if ( (uc+i)->category() == TQChar::Letter_Lowercase ) w += sc_fm.charWidth( upper, i ); else w += fm.charWidth( qstr, i ); @@ -312,7 +312,7 @@ int Font::width( QChar *chs, int, int pos, int len, int start, int end, int toAd if ( wordSpacing ) // add amount for( int i = 0; i < len; ++i ) { - if( chs[i+pos].category() == QChar::Separator_Space ) + if( chs[i+pos].category() == TQChar::Separator_Space ) w += wordSpacing; } @@ -320,12 +320,12 @@ int Font::width( QChar *chs, int, int pos, int len, int start, int end, int toAd // first gather count of spaces int numSpaces = 0; for( int i = start; i != end; ++i ) - if ( chs[i].category() == QChar::Separator_Space ) + if ( chs[i].category() == TQChar::Separator_Space ) ++numSpaces; // distribute pixels evenly among spaces, but count only those within // [pos, pos+len) for ( int i = start; numSpaces && i != pos + len; i++ ) - if ( chs[i].category() == QChar::Separator_Space ) { + if ( chs[i].category() == TQChar::Separator_Space ) { const int a = toAdd/numSpaces; if ( i >= pos ) w += a; toAdd -= a; @@ -336,21 +336,21 @@ int Font::width( QChar *chs, int, int pos, int len, int start, int end, int toAd return w; } -int Font::width( QChar *chs, int slen, int pos ) const +int Font::width( TQChar *chs, int slen, int pos ) const { int w; - if ( scFont && chs[pos].category() == QChar::Letter_Lowercase ) { - QString str( chs, slen ); + if ( scFont && chs[pos].category() == TQChar::Letter_Lowercase ) { + TQString str( chs, slen ); str[pos] = chs[pos].upper(); - w = QFontMetrics( *scFont ).charWidth( str, pos ); + w = TQFontMetrics( *scFont ).charWidth( str, pos ); } else { - const QConstString cstr( chs, slen ); + const TQConstString cstr( chs, slen ); w = fm.charWidth( cstr.string(), pos ); } if ( letterSpacing ) w += letterSpacing; - if ( wordSpacing && (chs+pos)->category() == QChar::Separator_Space ) + if ( wordSpacing && (chs+pos)->category() == TQChar::Separator_Space ) w += wordSpacing; return w; } @@ -358,11 +358,11 @@ int Font::width( QChar *chs, int slen, int pos ) const /** Querying QFontDB whether something is scalable is expensive, so we cache. */ struct Font::ScalKey { - QString family; + TQString family; int weight; int italic; - ScalKey(const QFont& font) : + ScalKey(const TQFont& font) : family(font.family()), weight(font.weight()), italic(font.italic()) {} @@ -389,13 +389,13 @@ struct Font::ScalKey } }; -QMap<Font::ScalKey, Font::ScalInfo>* Font::scalCache; -QMap<Font::ScalKey, QValueList<int> >* Font::scalSizesCache; +TQMap<Font::ScalKey, Font::ScalInfo>* Font::scalCache; +TQMap<Font::ScalKey, TQValueList<int> >* Font::scalSizesCache; -bool Font::isFontScalable(QFontDatabase& db, const QFont& font) +bool Font::isFontScalable(TQFontDatabase& db, const TQFont& font) { if (!scalCache) - scalCache = new QMap<ScalKey, ScalInfo>; + scalCache = new TQMap<ScalKey, ScalInfo>; ScalKey key(font); @@ -406,7 +406,7 @@ bool Font::isFontScalable(QFontDatabase& db, const QFont& font) if (s == No) { /* Cache size info */ if (!scalSizesCache) - scalSizesCache = new QMap<ScalKey, QValueList<int> >; + scalSizesCache = new TQMap<ScalKey, TQValueList<int> >; (*scalSizesCache)[key] = db.smoothSizes(font.family(), db.styleString(font)); } } @@ -415,13 +415,13 @@ bool Font::isFontScalable(QFontDatabase& db, const QFont& font) } -void Font::update( QPaintDeviceMetrics* devMetrics ) const +void Font::update( TQPaintDeviceMetrics* devMetrics ) const { f.setFamily( fontDef.family.isEmpty() ? KHTMLFactory::defaultHTMLSettings()->stdFontName() : fontDef.family ); f.setItalic( fontDef.italic ); f.setWeight( fontDef.weight ); - QFontDatabase db; + TQFontDatabase db; int size = fontDef.size; const int lDpiY = kMax(devMetrics->logicalDpiY(), 96); @@ -430,7 +430,7 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const // all other font properties should be set before this one!!!! if( !isFontScalable(db, f) ) { - const QValueList<int>& pointSizes = (*scalSizesCache)[ScalKey(f)]; + const TQValueList<int>& pointSizes = (*scalSizesCache)[ScalKey(f)]; // lets see if we find a nice looking font, which is not too far away // from the requested one. // kdDebug(6080) << "khtml::setFontSize family = " << f.family() << " size requested=" << size << endl; @@ -439,8 +439,8 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const float diff = 1; // ### 100% deviation float bestSize = 0; - QValueList<int>::ConstIterator it = pointSizes.begin(); - const QValueList<int>::ConstIterator itEnd = pointSizes.end(); + TQValueList<int>::ConstIterator it = pointSizes.begin(); + const TQValueList<int>::ConstIterator itEnd = pointSizes.end(); for( ; it != itEnd; ++it ) { @@ -459,7 +459,7 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const } // make sure we don't bust up X11 - // Also, Qt does not support sizing a QFont to zero. + // Also, Qt does not support sizing a TQFont to zero. size = kMax(1, kMin(255, size)); // qDebug("setting font to %s, italic=%d, weight=%d, size=%d", fontDef.family.latin1(), fontDef.italic, @@ -468,24 +468,24 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const f.setPixelSize( size ); - fm = QFontMetrics( f ); + fm = TQFontMetrics( f ); // small caps delete scFont; scFont = 0; if ( fontDef.smallCaps ) { - scFont = new QFont( f ); + scFont = new TQFont( f ); scFont->setPixelSize( kMax(1, f.pixelSize()*7/10) ); } } -void Font::drawDecoration(QPainter *pt, int _tx, int _ty, int baseline, int width, int height, int deco) const +void Font::drawDecoration(TQPainter *pt, int _tx, int _ty, int baseline, int width, int height, int deco) const { Q_UNUSED(height); // thick lines on small fonts look ugly const int thickness = fm.height() > 20 ? fm.lineWidth() : 1; - const QBrush brush = pt->pen().color(); + const TQBrush brush = pt->pen().color(); if (deco & UNDERLINE) { int underlineOffset = ( fm.height() + baseline ) / 2; if (underlineOffset <= baseline) underlineOffset = baseline+1; diff --git a/khtml/rendering/font.h b/khtml/rendering/font.h index c35ab53aa..248c07d15 100644 --- a/khtml/rendering/font.h +++ b/khtml/rendering/font.h @@ -25,10 +25,10 @@ #ifndef KHTMLFONT_H #define KHTMLFONT_H -#include <qfont.h> -#include <qfontmetrics.h> -#include <qmap.h> -#include <qpainter.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqmap.h> +#include <tqpainter.h> class QFontDatabase; class QPaintDeviceMetrics; @@ -51,7 +51,7 @@ public: weight == other.weight ); } - QString family; + TQString family; short int size; bool italic : 1; bool smallCaps : 1; @@ -70,7 +70,7 @@ public: : fontDef( fd ), f(), fm( f ), scFont( 0 ), letterSpacing( 0 ), wordSpacing( 0 ) {} Font(const Font& o) - : fontDef(o.fontDef), f(o.f), fm(o.fm), scFont(o.scFont), letterSpacing(o.letterSpacing), wordSpacing(o.wordSpacing) { if (o.scFont) scFont = new QFont(*o.scFont); } + : fontDef(o.fontDef), f(o.f), fm(o.fm), scFont(o.scFont), letterSpacing(o.letterSpacing), wordSpacing(o.wordSpacing) { if (o.scFont) scFont = new TQFont(*o.scFont); } ~Font() { delete scFont; } bool operator == ( const Font &other ) const { @@ -81,7 +81,7 @@ public: const FontDef& getFontDef() const { return fontDef; } - void update( QPaintDeviceMetrics *devMetrics ) const; + void update( TQPaintDeviceMetrics *devMetrics ) const; /** * Draws a piece from the given piece of text. @@ -107,8 +107,8 @@ public: * decoration painting * @param deco combined text decoration (see Decoration) */ - void drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, int width, - QPainter::TextDirection d, int from=-1, int to=-1, QColor bg=QColor(), + void drawText( TQPainter *p, int x, int y, TQChar *str, int slen, int pos, int len, int width, + TQPainter::TextDirection d, int from=-1, int to=-1, TQColor bg=TQColor(), int uy=-1, int h=-1, int deco=0 ) const; /** returns the width of the given string chunk in pixels. @@ -126,7 +126,7 @@ public: * str. Note that toAdd applies to all spaces within str, but only those * within [pos, pos+len) are counted towards the width. */ - int width( QChar *str, int slen, int pos, int len, int start = 0, int end = 0, int toAdd = 0 ) const; + int width( TQChar *str, int slen, int pos, int len, int start = 0, int end = 0, int toAdd = 0 ) const; /** return the width of the given char in pixels. * * The method also considers various styles like text-align and font-variant @@ -134,7 +134,7 @@ public: * @param slen total length of string * @param pos zero-based position of char in string */ - int width( QChar *str, int slen, int pos) const; + int width( TQChar *str, int slen, int pos) const; /** Text decoration constants. * @@ -154,7 +154,7 @@ public: * @param deco decoration to be drawn (see Decoration). The enumeration * constants may be combined. */ - void drawDecoration(QPainter *p, int x, int y, int baseline, int width, int height, int deco) const; + void drawDecoration(TQPainter *p, int x, int y, int baseline, int width, int height, int deco) const; /** returns letter spacing */ @@ -165,9 +165,9 @@ public: private: mutable FontDef fontDef; - mutable QFont f; - mutable QFontMetrics fm; - mutable QFont *scFont; + mutable TQFont f; + mutable TQFontMetrics fm; + mutable TQFont *scFont; short letterSpacing; short wordSpacing; @@ -178,9 +178,9 @@ private: Yes }; - static QMap<ScalKey, ScalInfo>* scalCache; - static QMap<ScalKey, QValueList<int> >* scalSizesCache; - static bool isFontScalable(QFontDatabase& db, const QFont& font); + static TQMap<ScalKey, ScalInfo>* scalCache; + static TQMap<ScalKey, TQValueList<int> >* scalSizesCache; + static bool isFontScalable(TQFontDatabase& db, const TQFont& font); }; } // namespace diff --git a/khtml/rendering/render_applet.cpp b/khtml/rendering/render_applet.cpp index f6ce1ebab..fce22f7c8 100644 --- a/khtml/rendering/render_applet.cpp +++ b/khtml/rendering/render_applet.cpp @@ -30,7 +30,7 @@ #include "khtmlview.h" #include "khtml_part.h" -#include <qlabel.h> +#include <tqlabel.h> #ifndef Q_WS_QWS // We don't have Java in Qt Embedded @@ -41,7 +41,7 @@ using namespace khtml; using namespace DOM; -RenderApplet::RenderApplet(HTMLElementImpl *applet, const QMap<QString, QString> &args ) +RenderApplet::RenderApplet(HTMLElementImpl *applet, const TQMap<TQString, TQString> &args ) : RenderWidget(applet) { // init RenderObject attributes @@ -55,7 +55,7 @@ RenderApplet::RenderApplet(HTMLElementImpl *applet, const QMap<QString, QString> } if ( context ) { - //kdDebug(6100) << "RenderApplet::RenderApplet, setting QWidget" << endl; + //kdDebug(6100) << "RenderApplet::RenderApplet, setting TQWidget" << endl; setQWidget( new KJavaAppletWidget(context, _view->viewport()) ); processArguments(args); } @@ -117,28 +117,28 @@ void RenderApplet::layout() setNeedsLayout(false); } -void RenderApplet::processArguments(const QMap<QString, QString> &args) +void RenderApplet::processArguments(const TQMap<TQString, TQString> &args) { KJavaAppletWidget *w = static_cast<KJavaAppletWidget*>(m_widget); KJavaApplet* applet = w ? w->applet() : 0; if ( applet ) { - applet->setBaseURL( args[QString::fromLatin1("baseURL") ] ); - applet->setAppletClass( args[QString::fromLatin1("code") ] ); + applet->setBaseURL( args[TQString::fromLatin1("baseURL") ] ); + applet->setAppletClass( args[TQString::fromLatin1("code") ] ); - QString str = args[QString::fromLatin1("codeBase") ]; + TQString str = args[TQString::fromLatin1("codeBase") ]; if( !str.isEmpty() ) applet->setCodeBase( str ); - str = args[QString::fromLatin1("name") ]; + str = args[TQString::fromLatin1("name") ]; if( !str.isNull() ) applet->setAppletName( str ); else - applet->setAppletName( args[QString::fromLatin1("code") ] ); + applet->setAppletName( args[TQString::fromLatin1("code") ] ); - str = args[QString::fromLatin1("archive") ]; + str = args[TQString::fromLatin1("archive") ]; if( !str.isEmpty() ) - applet->setArchives( args[QString::fromLatin1("archive") ] ); + applet->setArchives( args[TQString::fromLatin1("archive") ] ); } } diff --git a/khtml/rendering/render_applet.h b/khtml/rendering/render_applet.h index 54af6f280..184697a7c 100644 --- a/khtml/rendering/render_applet.h +++ b/khtml/rendering/render_applet.h @@ -25,8 +25,8 @@ #include "rendering/render_replaced.h" #include "html/html_objectimpl.h" -#include <qwidget.h> -#include <qmap.h> +#include <tqwidget.h> +#include <tqmap.h> class KHTMLView; @@ -39,7 +39,7 @@ namespace khtml { class RenderApplet : public RenderWidget { public: - RenderApplet(DOM::HTMLElementImpl* node, const QMap<QString, QString> &args); + RenderApplet(DOM::HTMLElementImpl* node, const TQMap<TQString, TQString> &args); virtual ~RenderApplet(); virtual const char *renderName() const { return "RenderApplet"; } @@ -53,7 +53,7 @@ public: { return static_cast<DOM::HTMLElementImpl*>(RenderObject::element()); } private: - void processArguments( const QMap<QString, QString> &args ); + void processArguments( const TQMap<TQString, TQString> &args ); }; } diff --git a/khtml/rendering/render_block.cpp b/khtml/rendering/render_block.cpp index ba9645a62..d036b9d09 100644 --- a/khtml/rendering/render_block.cpp +++ b/khtml/rendering/render_block.cpp @@ -494,7 +494,7 @@ void RenderBlock::makePageBreakAvoidBlocks() // recurse into positioned block children as well. if (m_positionedObjects) { - QPtrListIterator<RenderObject> it(*m_positionedObjects); + TQPtrListIterator<RenderObject> it(*m_positionedObjects); for ( ; it.current(); ++it ) { if (it.current()->isRenderBlock() && !it.current()->childrenInline()) { static_cast<RenderBlock*>(it.current())->makePageBreakAvoidBlocks(); @@ -504,7 +504,7 @@ void RenderBlock::makePageBreakAvoidBlocks() // recurse into floating block children. if (m_floatingObjects) { - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; it.current(); ++it ) { if (it.current()->node->isRenderBlock() && !it.current()->node->childrenInline()) { static_cast<RenderBlock*>(it.current()->node)->makePageBreakAvoidBlocks(); @@ -618,7 +618,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren) return; } // kdDebug( 6040 ) << renderName() << " " << this << "::layoutBlock() start" << endl; - // QTime t; + // TQTime t; // t.start(); KHTMLAssert( needsLayout() ); KHTMLAssert( minMaxKnown() ); @@ -1577,7 +1577,7 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren) if (m_positionedObjects) { //kdDebug( 6040 ) << renderName() << " " << this << "::layoutPositionedObjects() start" << endl; RenderObject* r; - QPtrListIterator<RenderObject> it(*m_positionedObjects); + TQPtrListIterator<RenderObject> it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { //kdDebug(6040) << " have a positioned object" << endl; if (r->markedForRepaint()) { @@ -1678,7 +1678,7 @@ void RenderBlock::paintFloats(PaintInfo& pI, int _tx, int _ty, bool paintSelecti return; FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it) { // Only paint the object if our noPaint flag isn't set. if (r->node->isFloating() && !r->noPaint && !r->node->layer()) { @@ -1719,12 +1719,12 @@ void RenderBlock::insertPositionedObject(RenderObject *o) { // Create the list of special objects if we don't aleady have one if (!m_positionedObjects) { - m_positionedObjects = new QPtrList<RenderObject>; + m_positionedObjects = new TQPtrList<RenderObject>; m_positionedObjects->setAutoDelete(false); } else { // Don't insert the object again if it's already in the list - QPtrListIterator<RenderObject> it(*m_positionedObjects); + TQPtrListIterator<RenderObject> it(*m_positionedObjects); RenderObject* f; while ( (f = it.current()) ) { if (f == o) return; @@ -1740,7 +1740,7 @@ void RenderBlock::insertPositionedObject(RenderObject *o) void RenderBlock::removePositionedObject(RenderObject *o) { if (m_positionedObjects) { - QPtrListIterator<RenderObject> it(*m_positionedObjects); + TQPtrListIterator<RenderObject> it(*m_positionedObjects); while (it.current()) { if (it.current() == o) m_positionedObjects->removeRef(it.current()); @@ -1757,12 +1757,12 @@ void RenderBlock::insertFloatingObject(RenderObject *o) { // Create the list of special objects if we don't aleady have one if (!m_floatingObjects) { - m_floatingObjects = new QPtrList<FloatingObject>; + m_floatingObjects = new TQPtrList<FloatingObject>; m_floatingObjects->setAutoDelete(true); } else { // Don't insert the object again if it's already in the list - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); FloatingObject* f; while ( (f = it.current()) ) { if (f->node == o) return; @@ -1801,7 +1801,7 @@ void RenderBlock::insertFloatingObject(RenderObject *o) void RenderBlock::removeFloatingObject(RenderObject *o) { if (m_floatingObjects) { - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); while (it.current()) { if (it.current()->node == o) m_floatingObjects->removeRef(it.current()); @@ -1986,7 +1986,7 @@ RenderBlock::leftRelOffset(int y, int fixedOffset, bool applyTextIndent, int *he if (m_floatingObjects) { if ( heightRemaining ) *heightRemaining = 1; FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { //kdDebug( 6040 ) <<(void *)this << " left: sy, ey, x, w " << r->startY << "," << r->endY << "," << r->left << "," << r->width << " " << endl; @@ -2029,7 +2029,7 @@ RenderBlock::rightRelOffset(int y, int fixedOffset, bool applyTextIndent, int *h if (m_floatingObjects) { if (heightRemaining) *heightRemaining = 1; FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { //kdDebug( 6040 ) << "right: sy, ey, x, w " << r->startY << "," << r->endY << "," << r->left << "," << r->width << " " << endl; @@ -2075,7 +2075,7 @@ RenderBlock::nearestFloatBottom(int height) const if (!m_floatingObjects) return 0; int bottom = 0; FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) if (r->endY>height && (r->endY<bottom || bottom==0)) bottom=r->endY; @@ -2087,7 +2087,7 @@ int RenderBlock::floatBottom() const if (!m_floatingObjects) return 0; int bottom=0; FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) if (r->endY>bottom) bottom=r->endY; @@ -2104,7 +2104,7 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf) if (m_floatingObjects) { FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { if (!r->noPaint) { int lp = r->startY + r->node->marginTop() + r->node->lowestPosition(false); @@ -2131,7 +2131,7 @@ int RenderBlock::lowestAbsolutePosition() const // part of the lowest position. int bottom = 0; RenderObject* r; - QPtrListIterator<RenderObject> it(*m_positionedObjects); + TQPtrListIterator<RenderObject> it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { if (r->style()->position() == FIXED) continue; @@ -2151,7 +2151,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel if (m_floatingObjects) { FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { if (!r->noPaint) { int rp = r->left + r->node->marginLeft() + r->node->rightmostPosition(false); @@ -2177,7 +2177,7 @@ int RenderBlock::rightmostAbsolutePosition() const return 0; int right = 0; RenderObject* r; - QPtrListIterator<RenderObject> it(*m_positionedObjects); + TQPtrListIterator<RenderObject> it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { if (r->style()->position() == FIXED) continue; @@ -2198,7 +2198,7 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf if (m_floatingObjects) { FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { if (!r->noPaint) { int lp = r->left + r->node->marginLeft() + r->node->leftmostPosition(false); @@ -2222,7 +2222,7 @@ int RenderBlock::leftmostAbsolutePosition() const return 0; int left = 0; RenderObject* r; - QPtrListIterator<RenderObject> it(*m_positionedObjects); + TQPtrListIterator<RenderObject> it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { if (r->style()->position() == FIXED) continue; @@ -2243,7 +2243,7 @@ int RenderBlock::highestPosition(bool includeOverflowInterior, bool includeSelf) if (m_floatingObjects) { FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) { if (!r->noPaint) { int hp = r->startY + r->node->marginTop() + r->node->highestPosition(false); @@ -2266,7 +2266,7 @@ int RenderBlock::highestAbsolutePosition() const return 0; int top = 0; RenderObject* r; - QPtrListIterator<RenderObject> it(*m_positionedObjects); + TQPtrListIterator<RenderObject> it(*m_positionedObjects); for ( ; (r = it.current()); ++it ) { if (r->style()->position() == FIXED) continue; @@ -2282,7 +2282,7 @@ RenderBlock::leftBottom() if (!m_floatingObjects) return 0; int bottom=0; FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) if (r->endY>bottom && r->type == FloatingObject::FloatLeft) bottom=r->endY; @@ -2296,7 +2296,7 @@ RenderBlock::rightBottom() if (!m_floatingObjects) return 0; int bottom=0; FloatingObject* r; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for ( ; (r = it.current()); ++it ) if (r->endY>bottom && r->type == FloatingObject::FloatRight) bottom=r->endY; @@ -2373,7 +2373,7 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset, return; } - QPtrListIterator<FloatingObject> it(*flow->m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*flow->m_floatingObjects); FloatingObject *r; for ( ; (r = it.current()); ++it ) { @@ -2396,7 +2396,7 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset, FloatingObject* f = 0; // don't insert it twice! if (m_floatingObjects) { - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); while ( (f = it.current()) ) { if (f->node == r->node) break; ++it; @@ -2426,7 +2426,7 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset, floatingObj->width = r->width; floatingObj->node = r->node; if (!m_floatingObjects) { - m_floatingObjects = new QPtrList<FloatingObject>; + m_floatingObjects = new TQPtrList<FloatingObject>; m_floatingObjects->setAutoDelete(true); } m_floatingObjects->append(floatingObj); @@ -2441,7 +2441,7 @@ void RenderBlock::addOverHangingFloats( RenderBlock *flow, int xoff, int offset, bool RenderBlock::containsFloat(RenderObject* o) const { if (m_floatingObjects) { - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); while (it.current()) { if (it.current()->node == o) return true; @@ -2514,7 +2514,7 @@ bool RenderBlock::isPointInScrollbar(int _x, int _y, int _tx, int _ty) return false; if (m_layer->verticalScrollbarWidth()) { - QRect vertRect(_tx + width() - borderRight() - m_layer->verticalScrollbarWidth(), + TQRect vertRect(_tx + width() - borderRight() - m_layer->verticalScrollbarWidth(), _ty + borderTop() - borderTopExtra(), m_layer->verticalScrollbarWidth(), height() + borderTopExtra() + borderBottomExtra()-borderTop()-borderBottom()); @@ -2527,7 +2527,7 @@ bool RenderBlock::isPointInScrollbar(int _x, int _y, int _tx, int _ty) } if (m_layer->horizontalScrollbarHeight()) { - QRect horizRect(_tx + borderLeft(), + TQRect horizRect(_tx + borderLeft(), _ty + height() + borderTop() + borderBottomExtra() - borderBottom() - m_layer->horizontalScrollbarHeight(), width()-borderLeft()-borderRight(), m_layer->horizontalScrollbarHeight()); @@ -2554,7 +2554,7 @@ bool RenderBlock::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, if (hasOverflowClip() && m_layer) m_layer->subtractScrollOffset(stx, sty); FloatingObject* o; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); for (it.toLast(); (o = it.current()); --it) if (!o->noPaint && !o->node->layer()) inBox |= o->node->nodeAtPoint(info, _x, _y, @@ -2727,7 +2727,7 @@ static void stripTrailingSpace(bool preserveWS, // Collapse away the trailing space at the end of a block. RenderText* t = static_cast<RenderText *>(trailingSpaceChild); const Font *f = t->htmlFont( false ); - QChar space[1]; space[0] = ' '; + TQChar space[1]; space[0] = ' '; int spaceWidth = f->width(space, 1, 0); inlineMax -= spaceWidth; if (inlineMin > inlineMax) @@ -3172,11 +3172,11 @@ void RenderBlock::printTree(int indent) const if (m_floatingObjects) { - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); FloatingObject *r; for ( ; (r = it.current()); ++it ) { - QString s; + TQString s; s.fill(' ', indent); kdDebug() << s << renderName() << ": " << (r->type == FloatingObject::FloatLeft ? "FloatLeft" : "FloatRight" ) << @@ -3186,7 +3186,7 @@ void RenderBlock::printTree(int indent) const } } -void RenderBlock::dump(QTextStream &stream, const QString &ind) const +void RenderBlock::dump(TQTextStream &stream, const TQString &ind) const { RenderFlow::dump(stream,ind); @@ -3198,7 +3198,7 @@ void RenderBlock::dump(QTextStream &stream, const QString &ind) const if (m_floatingObjects && !m_floatingObjects->isEmpty()) { stream << " special("; - QPtrListIterator<FloatingObject> it(*m_floatingObjects); + TQPtrListIterator<FloatingObject> it(*m_floatingObjects); FloatingObject *r; bool first = true; for ( ; (r = it.current()); ++it ) diff --git a/khtml/rendering/render_block.h b/khtml/rendering/render_block.h index 112d331ca..2b0e49398 100644 --- a/khtml/rendering/render_block.h +++ b/khtml/rendering/render_block.h @@ -26,7 +26,7 @@ #ifndef RENDER_BLOCK_H #define RENDER_BLOCK_H -#include <qptrlist.h> +#include <tqptrlist.h> #include "render_flow.h" @@ -188,7 +188,7 @@ public: #ifdef ENABLE_DUMP virtual void printTree(int indent=0) const; - virtual void dump(QTextStream &stream, const QString &ind) const; + virtual void dump(TQTextStream &stream, const TQString &ind) const; #endif protected: @@ -355,8 +355,8 @@ protected: int m_overflowLeft; private: - QPtrList<FloatingObject>* m_floatingObjects; - QPtrList<RenderObject>* m_positionedObjects; + TQPtrList<FloatingObject>* m_floatingObjects; + TQPtrList<RenderObject>* m_positionedObjects; bool m_childrenInline : 1; bool m_firstLine : 1; // used in inline layouting diff --git a/khtml/rendering/render_body.cpp b/khtml/rendering/render_body.cpp index e9da3c71c..930ec358c 100644 --- a/khtml/rendering/render_body.cpp +++ b/khtml/rendering/render_body.cpp @@ -56,7 +56,7 @@ void RenderBody::setStyle(RenderStyle* style) void RenderBody::paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty) { //kdDebug( 6040 ) << renderName() << "::paintDecorations()" << endl; - QColor bgColor; + TQColor bgColor; const BackgroundLayer *bgLayer = 0; if( parent()->style()->hasBackground() ) { diff --git a/khtml/rendering/render_box.cpp b/khtml/rendering/render_box.cpp index 56a3109d5..e6742d54e 100644 --- a/khtml/rendering/render_box.cpp +++ b/khtml/rendering/render_box.cpp @@ -28,7 +28,7 @@ //#define CLIP_DEBUG -#include <qpainter.h> +#include <tqpainter.h> #include "misc/loader.h" #include "rendering/render_replaced.h" @@ -330,7 +330,7 @@ void RenderBox::paintRootBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty) { //kdDebug( 6040 ) << renderName() << "::paintRootBoxDecorations()" << _tx << "/" << _ty << endl; const BackgroundLayer* bgLayer = style()->backgroundLayers(); - QColor bgColor = style()->backgroundColor(); + TQColor bgColor = style()->backgroundColor(); if (document()->isHTMLDocument() && !style()->hasBackground()) { // Locate the <body> element using the DOM. This is easier than trying // to crawl around a render tree with potential :before/:after content and @@ -346,7 +346,7 @@ void RenderBox::paintRootBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty) } if( !bgColor.isValid() && canvas()->view()) - bgColor = canvas()->view()->palette().active().color(QColorGroup::Base); + bgColor = canvas()->view()->palette().active().color(TQColorGroup::Base); int w = width(); int h = height(); @@ -408,14 +408,14 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty) } } -void RenderBox::paintBackgrounds(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height) +void RenderBox::paintBackgrounds(TQPainter *p, const TQColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height) { if (!bgLayer) return; paintBackgrounds(p, c, bgLayer->next(), clipy, cliph, _tx, _ty, w, height); paintBackground(p, c, bgLayer, clipy, cliph, _tx, _ty, w, height); } -void RenderBox::paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height) +void RenderBox::paintBackground(TQPainter *p, const TQColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int height) { paintBackgroundExtended(p, c, bgLayer, clipy, cliph, _tx, _ty, w, height, borderLeft(), borderRight(), paddingLeft(), paddingRight()); @@ -467,7 +467,7 @@ static void calculateBackgroundSize(const BackgroundLayer* bgLayer, int& scaledW } } -void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const BackgroundLayer* bgLayer, int clipy, int cliph, +void RenderBox::paintBackgroundExtended(TQPainter *p, const TQColor &c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h, int bleft, int bright, int pleft, int pright) { @@ -482,12 +482,12 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const Back int width = w - bleft - bright - (includePadding ? pleft + pright : 0); int height = h - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : 0); p->save(); - p->setClipRect(QRect(x, y, width, height), QPainter::CoordPainter); + p->setClipRect(TQRect(x, y, width, height), TQPainter::CoordPainter); } CachedImage* bg = bgLayer->backgroundImage(); bool shouldPaintBackgroundImage = bg && bg->pixmap_size() == bg->valid_rect().size() && !bg->isTransparent() && !bg->isErrorImage(); - QColor bgColor = c; + TQColor bgColor = c; // Paint the color first underneath all images. if (!bgLayer->next() && bgColor.isValid() && qAlpha(bgColor.rgb()) > 0) @@ -583,7 +583,7 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const Back else { //fixed - QRect vr = viewRect(); + TQRect vr = viewRect(); int pw = vr.width(); int ph = vr.height(); scaledImageWidth = pw; @@ -613,9 +613,9 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const Back sy = scaledImageHeight - yPosition % scaledImageHeight; } - QRect fix(cx, cy, cw, ch); - QRect ele(_tx, _ty, w, h); - QRect b = fix.intersect(ele); + TQRect fix(cx, cy, cw, ch); + TQRect ele(_tx, _ty, w, h); + TQRect b = fix.intersect(ele); //kdDebug() <<" ele is " << ele << " b is " << b << " fix is " << fix << endl; sx+=b.x()-cx; @@ -642,14 +642,14 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, const Back } -void RenderBox::outlineBox(QPainter *p, int _tx, int _ty, const char *color) +void RenderBox::outlineBox(TQPainter *p, int _tx, int _ty, const char *color) { - p->setPen(QPen(QColor(color), 1, Qt::DotLine)); + p->setPen(TQPen(TQColor(color), 1, Qt::DotLine)); p->setBrush( Qt::NoBrush ); p->drawRect(_tx, _ty, m_width, m_height); } -QRect RenderBox::getOverflowClipRect(int tx, int ty) +TQRect RenderBox::getOverflowClipRect(int tx, int ty) { // XXX When overflow-clip (CSS3) is implemented, we'll obtain the property // here. @@ -665,10 +665,10 @@ QRect RenderBox::getOverflowClipRect(int tx, int ty) cliph -= m_layer->horizontalScrollbarHeight(); } - return QRect(clipx,clipy,clipw,cliph); + return TQRect(clipx,clipy,clipw,cliph); } -QRect RenderBox::getClipRect(int tx, int ty) +TQRect RenderBox::getClipRect(int tx, int ty) { int bl=borderLeft(),bt=borderTop(),bb=borderBottom(),br=borderRight(); // ### what about paddings? @@ -711,7 +711,7 @@ QRect RenderBox::getClipRect(int tx, int ty) //kdDebug( 6040 ) << "setting clip("<<clipx<<","<<clipy<<","<<clipw<<","<<cliph<<")"<<endl; - return QRect(clipx,clipy,clipw,cliph); + return TQRect(clipx,clipy,clipw,cliph); } void RenderBox::close() @@ -2260,7 +2260,7 @@ void RenderBox::caretPos(int /*offset*/, int flags, int &_x, int &_y, int &width ? element()->parent()->renderer()->style() : cb->style(); - const QFontMetrics &fm = s->fontMetrics(); + const TQFontMetrics &fm = s->fontMetrics(); height = fm.height(); bool rtl = s->direction() == RTL; @@ -2284,7 +2284,7 @@ void RenderBox::caretPos(int /*offset*/, int flags, int &_x, int &_y, int &width // Place caret inside the element } else { - const QFontMetrics &fm = style()->fontMetrics(); + const TQFontMetrics &fm = style()->fontMetrics(); height = fm.height(); RenderStyle *s = style(); diff --git a/khtml/rendering/render_box.h b/khtml/rendering/render_box.h index ad0a5b9fb..c0c618d5c 100644 --- a/khtml/rendering/render_box.h +++ b/khtml/rendering/render_box.h @@ -142,14 +142,14 @@ protected: virtual void paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty); void paintRootBoxDecorations( PaintInfo& paintInfo, int _tx, int _ty); - void paintBackgrounds(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h); - void paintBackground(QPainter *p, const QColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h); + void paintBackgrounds(TQPainter *p, const TQColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h); + void paintBackground(TQPainter *p, const TQColor& c, const BackgroundLayer* bgLayer, int clipy, int cliph, int _tx, int _ty, int w, int h); - virtual void paintBackgroundExtended(QPainter* /*p*/, const QColor& /*c*/, const BackgroundLayer* /*bgLayer*/, + virtual void paintBackgroundExtended(TQPainter* /*p*/, const TQColor& /*c*/, const BackgroundLayer* /*bgLayer*/, int /*clipy*/, int /*cliph*/, int /*_tx*/, int /*_ty*/, int /*w*/, int /*height*/, int /*bleft*/, int /*bright*/, int /*pleft*/, int /*pright*/ ); - void outlineBox(QPainter *p, int _tx, int _ty, const char *color = "red"); + void outlineBox(TQPainter *p, int _tx, int _ty, const char *color = "red"); void calcAbsoluteHorizontal(); void calcAbsoluteVertical(); @@ -165,8 +165,8 @@ protected: void calcAbsoluteVerticalReplaced(); void calcAbsoluteHorizontalReplaced(); - QRect getOverflowClipRect(int tx, int ty); - QRect getClipRect(int tx, int ty); + TQRect getOverflowClipRect(int tx, int ty); + TQRect getClipRect(int tx, int ty); void restructureParentFlow(); diff --git a/khtml/rendering/render_br.cpp b/khtml/rendering/render_br.cpp index 42709839a..69984b760 100644 --- a/khtml/rendering/render_br.cpp +++ b/khtml/rendering/render_br.cpp @@ -25,7 +25,7 @@ using namespace khtml; RenderBR::RenderBR(DOM::NodeImpl* node) - : RenderText(node, new DOM::DOMStringImpl(QChar('\n'))) + : RenderText(node, new DOM::DOMStringImpl(TQChar('\n'))) { m_hasReturn = true; } diff --git a/khtml/rendering/render_canvas.cpp b/khtml/rendering/render_canvas.cpp index 50cad914a..e8540eba6 100644 --- a/khtml/rendering/render_canvas.cpp +++ b/khtml/rendering/render_canvas.cpp @@ -166,7 +166,7 @@ void RenderCanvas::layout() } #ifdef SPEED_DEBUG - QTime qt; + TQTime qt; qt.start(); #endif @@ -212,7 +212,7 @@ void RenderCanvas::updateDocumentSize() bool vss = m_view->verticalScrollBar()->isShown(); bool hss = m_view->horizontalScrollBar()->isShown(); - QSize s = m_view->viewportSize(m_cachedDocWidth, m_cachedDocHeight); + TQSize s = m_view->viewportSize(m_cachedDocWidth, m_cachedDocHeight); // if we are about to show a scrollbar, and the document is sized to the viewport w or h, // then reserve the scrollbar space so that it doesn't trigger the _other_ scrollbar @@ -329,7 +329,7 @@ void RenderCanvas::paintBoxDecorations(PaintInfo& paintInfo, int /*_tx*/, int /* if ((firstChild() && firstChild()->style()->visibility() == VISIBLE) || !view()) return; - paintInfo.p->fillRect(paintInfo.r, view()->palette().active().color(QColorGroup::Base)); + paintInfo.p->fillRect(paintInfo.r, view()->palette().active().color(TQColorGroup::Base)); } void RenderCanvas::repaintRectangle(int x, int y, int w, int h, Priority p, bool f) @@ -345,8 +345,8 @@ void RenderCanvas::repaintRectangle(int x, int y, int w, int h, Priority p, bool y += m_view->contentsY(); } - QRect vr = viewRect(); - QRect ur(x, y, w, h); + TQRect vr = viewRect(); + TQRect ur(x, y, w, h); if (m_view && ur.intersects(vr)) { @@ -370,7 +370,7 @@ void RenderCanvas::deferredRepaint( RenderObject* o ) void RenderCanvas::scheduleDeferredRepaints() { if (!needsFullRepaint()) { - QValueList<RenderObject*>::const_iterator it; + TQValueList<RenderObject*>::const_iterator it; for ( it = m_dirtyChildren.begin(); it != m_dirtyChildren.end(); ++it ) (*it)->repaint(); } @@ -401,10 +401,10 @@ void RenderCanvas::repaint(Priority p) } } -static QRect enclosingPositionedRect (RenderObject *n) +static TQRect enclosingPositionedRect (RenderObject *n) { RenderObject *enclosingParent = n->containingBlock(); - QRect rect(0,0,0,0); + TQRect rect(0,0,0,0); if (enclosingParent) { int ox, oy; enclosingParent->absolutePosition(ox, oy); @@ -421,13 +421,13 @@ static QRect enclosingPositionedRect (RenderObject *n) return rect; } -QRect RenderCanvas::selectionRect() const +TQRect RenderCanvas::selectionRect() const { RenderObject *r = m_selectionStart; if (!r) - return QRect(); + return TQRect(); - QRect selectionRect = enclosingPositionedRect(r); + TQRect selectionRect = enclosingPositionedRect(r); while (r && r != m_selectionEnd) { @@ -475,8 +475,8 @@ void RenderCanvas::setSelection(RenderObject *s, int sp, RenderObject *e, int ep int oldStartPos = m_selectionStartPos; RenderObject *oldEnd = m_selectionEnd; int oldEndPos = m_selectionEndPos; - QPtrList<RenderObject> oldSelectedInside; - QPtrList<RenderObject> newSelectedInside; + TQPtrList<RenderObject> oldSelectedInside; + TQPtrList<RenderObject> newSelectedInside; RenderObject *os = oldStart; while (os && os != oldEnd) @@ -565,7 +565,7 @@ void RenderCanvas::setSelection(RenderObject *s, int sp, RenderObject *e, int ep newSelectedInside.removeRef(s); newSelectedInside.removeRef(e); - QRect updateRect; + TQRect updateRect; // Don't use repaint() because it will cause all rects to // be united (see khtmlview::scheduleRepaint()). Instead @@ -578,7 +578,7 @@ void RenderCanvas::setSelection(RenderObject *s, int sp, RenderObject *e, int ep // If so we have to draw them. // Could be faster by building list of non-intersecting rectangles rather // than unioning rectangles. - QPtrListIterator<RenderObject> oldIterator(oldSelectedInside); + TQPtrListIterator<RenderObject> oldIterator(oldSelectedInside); bool firstRect = true; for (; oldIterator.current(); ++oldIterator){ if (!newSelectedInside.containsRef(oldIterator.current())){ @@ -598,7 +598,7 @@ void RenderCanvas::setSelection(RenderObject *s, int sp, RenderObject *e, int ep // If so we have to draw them. // Could be faster by building list of non-intersecting rectangles rather // than unioning rectangles. - QPtrListIterator<RenderObject> newIterator(newSelectedInside); + TQPtrListIterator<RenderObject> newIterator(newSelectedInside); firstRect = true; for (; newIterator.current(); ++newIterator){ if (!oldSelectedInside.containsRef(newIterator.current())){ @@ -690,24 +690,24 @@ void RenderCanvas::selectionStartEnd(int& spos, int& epos) epos = m_selectionEndPos; } -QRect RenderCanvas::viewRect() const +TQRect RenderCanvas::viewRect() const { if (m_pagedMode) if (m_pageTop == m_pageBottom) { - kdDebug(6040) << "viewRect: " << QRect(0, m_pageTop, m_width, m_height) << endl; - return QRect(0, m_pageTop, m_width, m_height); + kdDebug(6040) << "viewRect: " << TQRect(0, m_pageTop, m_width, m_height) << endl; + return TQRect(0, m_pageTop, m_width, m_height); } else { - kdDebug(6040) << "viewRect: " << QRect(0, m_pageTop, m_width, m_pageBottom - m_pageTop) << endl; - return QRect(0, m_pageTop, m_width, m_pageBottom - m_pageTop); + kdDebug(6040) << "viewRect: " << TQRect(0, m_pageTop, m_width, m_pageBottom - m_pageTop) << endl; + return TQRect(0, m_pageTop, m_width, m_pageBottom - m_pageTop); } else if (m_view) - return QRect(m_view->contentsX(), + return TQRect(m_view->contentsX(), m_view->contentsY(), m_view->visibleWidth(), m_view->visibleHeight()); else - return QRect(0,0,m_rootWidth,m_rootHeight); + return TQRect(0,0,m_rootWidth,m_rootHeight); } int RenderCanvas::docHeight() const diff --git a/khtml/rendering/render_canvas.h b/khtml/rendering/render_canvas.h index 017bd02b2..76196bd24 100644 --- a/khtml/rendering/render_canvas.h +++ b/khtml/rendering/render_canvas.h @@ -123,7 +123,7 @@ public: RenderPage* page(); - QRect selectionRect() const; + TQRect selectionRect() const; void setMaximalOutlineSize(int o) { m_maximalOutlineSize = o; } int maximalOutlineSize() const { return m_maximalOutlineSize; } @@ -143,7 +143,7 @@ protected: virtual void selectionStartEnd(int& spos, int& epos); - virtual QRect viewRect() const; + virtual TQRect viewRect() const; KHTMLView *m_view; @@ -181,7 +181,7 @@ protected: RenderPage* m_page; int m_maximalOutlineSize; // Used to apply a fudge factor to dirty-rect checks on blocks/tables. - QValueList<RenderObject*> m_dirtyChildren; + TQValueList<RenderObject*> m_dirtyChildren; }; inline RenderCanvas* RenderObject::canvas() const diff --git a/khtml/rendering/render_flow.cpp b/khtml/rendering/render_flow.cpp index 88e06aab9..ae579bd46 100644 --- a/khtml/rendering/render_flow.cpp +++ b/khtml/rendering/render_flow.cpp @@ -25,7 +25,7 @@ #include <kdebug.h> #include <assert.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kglobal.h> #include "rendering/render_flow.h" @@ -222,7 +222,7 @@ void RenderFlow::paintLines(PaintInfo& i, int _tx, int _ty) } if (i.phase == PaintActionOutline && i.outlineObjects) { - QValueList<RenderFlow *>::iterator it;; + TQValueList<RenderFlow *>::iterator it;; for( it = (*i.outlineObjects).begin(); it != (*i.outlineObjects).end(); ++it ) if ((*it)->isRenderInline()) static_cast<RenderInline*>(*it)->paintOutlines(i.p, _tx, _ty); diff --git a/khtml/rendering/render_form.cpp b/khtml/rendering/render_form.cpp index f8daba1e3..403295a8f 100644 --- a/khtml/rendering/render_form.cpp +++ b/khtml/rendering/render_form.cpp @@ -38,7 +38,7 @@ #include <kurlcompletion.h> #include <kwin.h> -#include <qstyle.h> +#include <tqstyle.h> #include "misc/helper.h" #include "xml/dom2_eventsimpl.h" @@ -52,8 +52,8 @@ #include "khtml_ext.h" #include "xml/dom_docimpl.h" -#include <qpopupmenu.h> -#include <qbitmap.h> +#include <tqpopupmenu.h> +#include <tqbitmap.h> using namespace khtml; @@ -138,7 +138,7 @@ short RenderButton::baselinePosition( bool f ) const RenderCheckBox::RenderCheckBox(HTMLInputElementImpl *element) : RenderButton(element) { - QCheckBox* b = new QCheckBox(view()->viewport(), "__khtml"); + TQCheckBox* b = new TQCheckBox(view()->viewport(), "__khtml"); b->setAutoMask(true); b->setMouseTracking(true); setQWidget(b); @@ -146,7 +146,7 @@ RenderCheckBox::RenderCheckBox(HTMLInputElementImpl *element) // prevent firing toggled() signals on initialization b->setChecked(element->checked()); - connect(b,SIGNAL(stateChanged(int)),this,SLOT(slotStateChanged(int))); + connect(b,TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(slotStateChanged(int))); } @@ -154,9 +154,9 @@ void RenderCheckBox::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - QCheckBox *cb = static_cast<QCheckBox *>( m_widget ); - QSize s( cb->style().pixelMetric( QStyle::PM_IndicatorWidth ), - cb->style().pixelMetric( QStyle::PM_IndicatorHeight ) ); + TQCheckBox *cb = static_cast<TQCheckBox *>( m_widget ); + TQSize s( cb->style().pixelMetric( TQStyle::PM_IndicatorWidth ), + cb->style().pixelMetric( TQStyle::PM_IndicatorHeight ) ); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); @@ -172,8 +172,8 @@ void RenderCheckBox::updateFromElement() void RenderCheckBox::slotStateChanged(int state) { - element()->setChecked(state == QButton::On); - element()->setIndeterminate(state == QButton::NoChange); + element()->setChecked(state == TQButton::On); + element()->setIndeterminate(state == TQButton::NoChange); ref(); element()->onChange(); @@ -185,14 +185,14 @@ void RenderCheckBox::slotStateChanged(int state) RenderRadioButton::RenderRadioButton(HTMLInputElementImpl *element) : RenderButton(element) { - QRadioButton* b = new QRadioButton(view()->viewport(), "__khtml"); + TQRadioButton* b = new TQRadioButton(view()->viewport(), "__khtml"); b->setMouseTracking(true); setQWidget(b); // prevent firing toggled() signals on initialization b->setChecked(element->checked()); - connect(b,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool))); + connect(b,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotToggled(bool))); } void RenderRadioButton::updateFromElement() @@ -206,9 +206,9 @@ void RenderRadioButton::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - QRadioButton *rb = static_cast<QRadioButton *>( m_widget ); - QSize s( rb->style().pixelMetric( QStyle::PM_ExclusiveIndicatorWidth ), - rb->style().pixelMetric( QStyle::PM_ExclusiveIndicatorHeight ) ); + TQRadioButton *rb = static_cast<TQRadioButton *>( m_widget ); + TQSize s( rb->style().pixelMetric( TQStyle::PM_ExclusiveIndicatorWidth ), + rb->style().pixelMetric( TQStyle::PM_ExclusiveIndicatorHeight ) ); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); @@ -230,17 +230,17 @@ void RenderRadioButton::slotToggled(bool activated) RenderSubmitButton::RenderSubmitButton(HTMLInputElementImpl *element) : RenderButton(element) { - QPushButton* p = new QPushButton(view()->viewport(), "__khtml"); + TQPushButton* p = new TQPushButton(view()->viewport(), "__khtml"); setQWidget(p); p->setAutoMask(true); p->setMouseTracking(true); } -QString RenderSubmitButton::rawText() +TQString RenderSubmitButton::rawText() { - QString value = element()->valueWithDefault().string(); + TQString value = element()->valueWithDefault().string(); value = value.stripWhiteSpace(); - QString raw; + TQString raw; for(unsigned int i = 0; i < value.length(); i++) { raw += value[i]; if(value[i] == '&') @@ -253,29 +253,29 @@ void RenderSubmitButton::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - QString raw = rawText(); - QPushButton* pb = static_cast<QPushButton*>(m_widget); + TQString raw = rawText(); + TQPushButton* pb = static_cast<TQPushButton*>(m_widget); pb->setText(raw); pb->setFont(style()->font()); bool empty = raw.isEmpty(); if ( empty ) - raw = QString::fromLatin1("X"); - QFontMetrics fm = pb->fontMetrics(); - QSize ts = fm.size( ShowPrefix, raw); - QSize s(pb->style().sizeFromContents( QStyle::CT_PushButton, pb, ts ) - .expandedTo(QApplication::globalStrut())); - int margin = pb->style().pixelMetric( QStyle::PM_ButtonMargin, pb) + - pb->style().pixelMetric( QStyle::PM_DefaultFrameWidth, pb ) * 2; + raw = TQString::fromLatin1("X"); + TQFontMetrics fm = pb->fontMetrics(); + TQSize ts = fm.size( ShowPrefix, raw); + TQSize s(pb->style().sizeFromContents( TQStyle::CT_PushButton, pb, ts ) + .expandedTo(TQApplication::globalStrut())); + int margin = pb->style().pixelMetric( TQStyle::PM_ButtonMargin, pb) + + pb->style().pixelMetric( TQStyle::PM_DefaultFrameWidth, pb ) * 2; int w = ts.width() + margin; int h = s.height(); if (pb->isDefault() || pb->autoDefault()) { - int dbw = pb->style().pixelMetric( QStyle::PM_ButtonDefaultIndicator, pb ) * 2; + int dbw = pb->style().pixelMetric( TQStyle::PM_ButtonDefaultIndicator, pb ) * 2; w += dbw; } // add 30% margins to the width (heuristics to make it look similar to IE) - s = QSize( w*13/10, h ).expandedTo(QApplication::globalStrut()); + s = TQSize( w*13/10, h ).expandedTo(TQApplication::globalStrut()); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); @@ -285,9 +285,9 @@ void RenderSubmitButton::calcMinMaxWidth() void RenderSubmitButton::updateFromElement() { - QString oldText = static_cast<QPushButton*>(m_widget)->text(); - QString newText = rawText(); - static_cast<QPushButton*>(m_widget)->setText(newText); + TQString oldText = static_cast<TQPushButton*>(m_widget)->text(); + TQString newText = rawText(); + static_cast<TQPushButton*>(m_widget)->setText(newText); if ( oldText != newText ) setNeedsLayoutAndMinMaxRecalc(); RenderFormElement::updateFromElement(); @@ -307,12 +307,12 @@ RenderResetButton::RenderResetButton(HTMLInputElementImpl *element) // ------------------------------------------------------------------------------- -LineEditWidget::LineEditWidget(DOM::HTMLInputElementImpl* input, KHTMLView* view, QWidget* parent) +LineEditWidget::LineEditWidget(DOM::HTMLInputElementImpl* input, KHTMLView* view, TQWidget* parent) : KLineEdit(parent, "__khtml"), m_input(input), m_view(view), m_spell(0) { setMouseTracking(true); KActionCollection *ac = new KActionCollection(this); - m_spellAction = KStdAction::spelling( this, SLOT( slotCheckSpelling() ), ac ); + m_spellAction = KStdAction::spelling( this, TQT_SLOT( slotCheckSpelling() ), ac ); } LineEditWidget::~LineEditWidget() @@ -328,14 +328,14 @@ void LineEditWidget::slotCheckSpelling() } delete m_spell; - m_spell = new KSpell( this, i18n( "Spell Checking" ), this, SLOT( slotSpellCheckReady( KSpell *) ), 0, true, true); + m_spell = new KSpell( this, i18n( "Spell Checking" ), this, TQT_SLOT( slotSpellCheckReady( KSpell *) ), 0, true, true); - connect( m_spell, SIGNAL( death() ),this, SLOT( spellCheckerFinished() ) ); - connect( m_spell, SIGNAL( misspelling( const QString &, const QStringList &, unsigned int ) ),this, SLOT( spellCheckerMisspelling( const QString &, const QStringList &, unsigned int ) ) ); - connect( m_spell, SIGNAL( corrected( const QString &, const QString &, unsigned int ) ),this, SLOT( spellCheckerCorrected( const QString &, const QString &, unsigned int ) ) ); + connect( m_spell, TQT_SIGNAL( death() ),this, TQT_SLOT( spellCheckerFinished() ) ); + connect( m_spell, TQT_SIGNAL( misspelling( const TQString &, const TQStringList &, unsigned int ) ),this, TQT_SLOT( spellCheckerMisspelling( const TQString &, const TQStringList &, unsigned int ) ) ); + connect( m_spell, TQT_SIGNAL( corrected( const TQString &, const TQString &, unsigned int ) ),this, TQT_SLOT( spellCheckerCorrected( const TQString &, const TQString &, unsigned int ) ) ); } -void LineEditWidget::spellCheckerMisspelling( const QString &_text, const QStringList &, unsigned int pos) +void LineEditWidget::spellCheckerMisspelling( const TQString &_text, const TQStringList &, unsigned int pos) { highLightWord( _text.length(),pos ); } @@ -345,7 +345,7 @@ void LineEditWidget::highLightWord( unsigned int length, unsigned int pos ) setSelection ( pos, length ); } -void LineEditWidget::spellCheckerCorrected( const QString &old, const QString &corr, unsigned int pos ) +void LineEditWidget::spellCheckerCorrected( const TQString &old, const TQString &corr, unsigned int pos ) { if( old!= corr ) { @@ -362,26 +362,26 @@ void LineEditWidget::spellCheckerFinished() void LineEditWidget::slotSpellCheckReady( KSpell *s ) { s->check( text() ); - connect( s, SIGNAL( done( const QString & ) ), this, SLOT( slotSpellCheckDone( const QString & ) ) ); + connect( s, TQT_SIGNAL( done( const TQString & ) ), this, TQT_SLOT( slotSpellCheckDone( const TQString & ) ) ); } -void LineEditWidget::slotSpellCheckDone( const QString &s ) +void LineEditWidget::slotSpellCheckDone( const TQString &s ) { if( s != text() ) setText( s ); } -QPopupMenu *LineEditWidget::createPopupMenu() +TQPopupMenu *LineEditWidget::createPopupMenu() { - QPopupMenu *popup = KLineEdit::createPopupMenu(); + TQPopupMenu *popup = KLineEdit::createPopupMenu(); if ( !popup ) { return 0L; } - connect( popup, SIGNAL( activated( int ) ), - this, SLOT( extendedMenuActivated( int ) ) ); + connect( popup, TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( extendedMenuActivated( int ) ) ); if (m_input->autoComplete()) { popup->insertSeparator(); @@ -389,7 +389,7 @@ QPopupMenu *LineEditWidget::createPopupMenu() popup->setItemEnabled( id, (compObj() && !compObj()->isEmpty()) ); } - if (echoMode() == QLineEdit::Normal && + if (echoMode() == TQLineEdit::Normal && !isReadOnly()) { popup->insertSeparator(); @@ -414,13 +414,13 @@ void LineEditWidget::extendedMenuActivated( int id) } } -bool LineEditWidget::event( QEvent *e ) +bool LineEditWidget::event( TQEvent *e ) { if (KLineEdit::event(e)) return true; - if ( e->type() == QEvent::AccelAvailable && isReadOnly() ) { - QKeyEvent* ke = (QKeyEvent*) e; + if ( e->type() == TQEvent::AccelAvailable && isReadOnly() ) { + TQKeyEvent* ke = (TQKeyEvent*) e; if ( ke->state() & ControlButton ) { switch ( ke->key() ) { case Key_Left: @@ -438,7 +438,7 @@ bool LineEditWidget::event( QEvent *e ) return false; } -void LineEditWidget::mouseMoveEvent(QMouseEvent *e) +void LineEditWidget::mouseMoveEvent(TQMouseEvent *e) { // hack to prevent Qt from calling setCursor on the widget setDragEnabled(false); @@ -453,14 +453,14 @@ RenderLineEdit::RenderLineEdit(HTMLInputElementImpl *element) : RenderFormElement(element) { LineEditWidget *edit = new LineEditWidget(element, view(), view()->viewport()); - connect(edit,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); - connect(edit,SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const QString &))); + connect(edit,TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotReturnPressed())); + connect(edit,TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(slotTextChanged(const TQString &))); if(element->inputType() == HTMLInputElementImpl::PASSWORD) - edit->setEchoMode( QLineEdit::Password ); + edit->setEchoMode( TQLineEdit::Password ); if ( element->autoComplete() ) { - QStringList completions = view()->formCompletionItems(element->name().string()); + TQStringList completions = view()->formCompletionItems(element->name().string()); if (completions.count()) { edit->completionObject()->setItems(completions); edit->setContextMenuEnabled(true); @@ -518,16 +518,16 @@ void RenderLineEdit::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - const QFontMetrics &fm = style()->fontMetrics(); - QSize s; + const TQFontMetrics &fm = style()->fontMetrics(); + TQSize s; int size = element()->size(); int h = fm.lineSpacing(); int w = fm.width( 'x' ) * (size > 0 ? size+1 : 17); // "some" - s = QSize(w + 2 + 2*widget()->frameWidth(), + s = TQSize(w + 2 + 2*widget()->frameWidth(), kMax(h, 14) + 2 + 2*widget()->frameWidth()) - .expandedTo(QApplication::globalStrut()); + .expandedTo(TQApplication::globalStrut()); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); @@ -560,7 +560,7 @@ void RenderLineEdit::updateFromElement() RenderFormElement::updateFromElement(); } -void RenderLineEdit::slotTextChanged(const QString &string) +void RenderLineEdit::slotTextChanged(const TQString &string) { // don't use setValue here! element()->m_value = string; @@ -679,12 +679,12 @@ void RenderFieldset::paintBoxDecorations(PaintInfo& pI, int _tx, int _ty) paintBorderMinusLegend(pI.p, _tx, _ty, w, h, style(), legend->xPos(), legend->width()); } -void RenderFieldset::paintBorderMinusLegend(QPainter *p, int _tx, int _ty, int w, int h, +void RenderFieldset::paintBorderMinusLegend(TQPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style, int lx, int lw) { - const QColor& tc = style->borderTopColor(); - const QColor& bc = style->borderBottomColor(); + const TQColor& tc = style->borderTopColor(); + const TQColor& bc = style->borderBottomColor(); EBorderStyle ts = style->borderTopStyle(); EBorderStyle bs = style->borderBottomStyle(); @@ -710,7 +710,7 @@ void RenderFieldset::paintBorderMinusLegend(QPainter *p, int _tx, int _ty, int w if(render_l) { - const QColor& lc = style->borderLeftColor(); + const TQColor& lc = style->borderLeftColor(); bool ignore_top = (tc == lc) && @@ -729,7 +729,7 @@ void RenderFieldset::paintBorderMinusLegend(QPainter *p, int _tx, int _ty, int w if(render_r) { - const QColor& rc = style->borderRightColor(); + const TQColor& rc = style->borderRightColor(); bool ignore_top = (tc == rc) && @@ -769,9 +769,9 @@ RenderFileButton::RenderFileButton(HTMLInputElementImpl *element) w->setMode(KFile::File | KFile::ExistingOnly); w->completionObject()->setDir(KGlobalSettings::documentPath()); - connect(w->lineEdit(), SIGNAL(returnPressed()), this, SLOT(slotReturnPressed())); - connect(w->lineEdit(), SIGNAL(textChanged(const QString &)),this,SLOT(slotTextChanged(const QString &))); - connect(w, SIGNAL(urlSelected(const QString &)),this,SLOT(slotUrlSelected(const QString &))); + connect(w->lineEdit(), TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotReturnPressed())); + connect(w->lineEdit(), TQT_SIGNAL(textChanged(const TQString &)),this,TQT_SLOT(slotTextChanged(const TQString &))); + connect(w, TQT_SIGNAL(urlSelected(const TQString &)),this,TQT_SLOT(slotUrlSelected(const TQString &))); setQWidget(w); m_haveFocus = false; @@ -783,17 +783,17 @@ void RenderFileButton::calcMinMaxWidth() { KHTMLAssert( !minMaxKnown() ); - const QFontMetrics &fm = style()->fontMetrics(); + const TQFontMetrics &fm = style()->fontMetrics(); int size = element()->size(); int h = fm.lineSpacing(); int w = fm.width( 'x' ) * (size > 0 ? size+1 : 17); // "some" KLineEdit* edit = static_cast<KURLRequester*>( m_widget )->lineEdit(); - QSize s = edit->style().sizeFromContents(QStyle::CT_LineEdit, + TQSize s = edit->style().sizeFromContents(TQStyle::CT_LineEdit, edit, - QSize(w + 2 + 2*edit->frameWidth(), kMax(h, 14) + 2 + 2*edit->frameWidth())) - .expandedTo(QApplication::globalStrut()); - QSize bs = static_cast<KURLRequester*>( m_widget )->minimumSizeHint() - edit->minimumSizeHint(); + TQSize(w + 2 + 2*edit->frameWidth(), kMax(h, 14) + 2 + 2*edit->frameWidth())) + .expandedTo(TQApplication::globalStrut()); + TQSize bs = static_cast<KURLRequester*>( m_widget )->minimumSizeHint() - edit->minimumSizeHint(); setIntrinsicWidth( s.width() + bs.width() ); setIntrinsicHeight( kMax(s.height(), bs.height()) ); @@ -828,12 +828,12 @@ void RenderFileButton::slotReturnPressed() element()->form()->submitFromKeyboard(); } -void RenderFileButton::slotTextChanged(const QString &/*string*/) +void RenderFileButton::slotTextChanged(const TQString &/*string*/) { element()->m_value = KURL( widget()->url() ).prettyURL( 0, KURL::StripFileProtocol ); } -void RenderFileButton::slotUrlSelected(const QString &) +void RenderFileButton::slotUrlSelected(const TQString &) { element()->onChange(); } @@ -860,7 +860,7 @@ RenderLegend::RenderLegend(HTMLGenericFormElementImpl *element) // ------------------------------------------------------------------------------- -ComboBoxWidget::ComboBoxWidget(QWidget *parent) +ComboBoxWidget::ComboBoxWidget(TQWidget *parent) : KComboBox(false, parent, "__khtml") { setAutoMask(true); @@ -868,13 +868,13 @@ ComboBoxWidget::ComboBoxWidget(QWidget *parent) setMouseTracking(true); } -bool ComboBoxWidget::event(QEvent *e) +bool ComboBoxWidget::event(TQEvent *e) { if (KComboBox::event(e)) return true; - if (e->type()==QEvent::KeyPress) + if (e->type()==TQEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent *>(e); + TQKeyEvent *ke = static_cast<TQKeyEvent *>(e); switch(ke->key()) { case Key_Return: @@ -889,21 +889,21 @@ bool ComboBoxWidget::event(QEvent *e) return false; } -bool ComboBoxWidget::eventFilter(QObject *dest, QEvent *e) +bool ComboBoxWidget::eventFilter(TQObject *dest, TQEvent *e) { - if (dest==listBox() && e->type()==QEvent::KeyPress) + if (dest==listBox() && e->type()==TQEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent *>(e); + TQKeyEvent *ke = static_cast<TQKeyEvent *>(e); bool forward = false; switch(ke->key()) { case Key_Tab: forward=true; case Key_BackTab: - // ugly hack. emulate popdownlistbox() (private in QComboBox) + // ugly hack. emulate popdownlistbox() (private in TQComboBox) // we re-use ke here to store the reference to the generated event. - ke = new QKeyEvent(QEvent::KeyPress, Key_Escape, 0, 0); - QApplication::sendEvent(dest,ke); + ke = new TQKeyEvent(TQEvent::KeyPress, Key_Escape, 0, 0); + TQApplication::sendEvent(dest,ke); focusNextPrevChild(forward); delete ke; return true; @@ -955,7 +955,7 @@ void RenderSelect::updateFromElement() } if (m_useListBox && oldMultiple != m_multiple) { - static_cast<KListBox*>(m_widget)->setSelectionMode(m_multiple ? QListBox::Extended : QListBox::Single); + static_cast<KListBox*>(m_widget)->setSelectionMode(m_multiple ? TQListBox::Extended : TQListBox::Single); } m_selectionChanged = true; m_optionsChanged = true; @@ -965,7 +965,7 @@ void RenderSelect::updateFromElement() if ( m_optionsChanged ) { if (element()->m_recalcListItems) element()->recalcListItems(); - QMemArray<HTMLGenericFormElementImpl*> listItems = element()->listItems(); + TQMemArray<HTMLGenericFormElementImpl*> listItems = element()->listItems(); int listIndex; if(m_useListBox) { @@ -982,27 +982,27 @@ void RenderSelect::updateFromElement() text = ""; if(m_useListBox) { - QListBoxText *item = new QListBoxText(QString(text.implementation()->s, text.implementation()->l)); + TQListBoxText *item = new TQListBoxText(TQString(text.implementation()->s, text.implementation()->l)); static_cast<KListBox*>(m_widget) ->insertItem(item, listIndex); item->setSelectable(false); } else { static_cast<KComboBox*>(m_widget) - ->insertItem(QString(text.implementation()->s, text.implementation()->l), listIndex); + ->insertItem(TQString(text.implementation()->s, text.implementation()->l), listIndex); static_cast<KComboBox*>(m_widget)->listBox()->item(listIndex)->setSelectable(false); } } else if (listItems[listIndex]->id() == ID_OPTION) { HTMLOptionElementImpl* optElem = static_cast<HTMLOptionElementImpl*>(listItems[listIndex]); - QString text = optElem->text().string(); + TQString text = optElem->text().string(); if (optElem->parentNode()->id() == ID_OPTGROUP) { // Prefer label if set DOMString label = optElem->getAttribute(ATTR_LABEL); if (!label.isEmpty()) text = label.string(); - text = QString::fromLatin1(" ")+text; + text = TQString::fromLatin1(" ")+text; } if(m_useListBox) { @@ -1020,7 +1020,7 @@ void RenderSelect::updateFromElement() m_selectionChanged = true; } - // QComboBox caches the size hint unless you call setFont (ref: TT docu) + // TQComboBox caches the size hint unless you call setFont (ref: TT docu) if(!m_useListBox) { KComboBox *that = static_cast<KComboBox*>(m_widget); that->setFont( that->font() ); @@ -1069,7 +1069,7 @@ void RenderSelect::layout( ) if(m_useListBox) { KListBox* w = static_cast<KListBox*>(m_widget); - QListBoxItem* p = w->firstItem(); + TQListBoxItem* p = w->firstItem(); int width = 0; int height = 0; while(p) { @@ -1098,7 +1098,7 @@ void RenderSelect::layout( ) setIntrinsicHeight( height ); } else { - QSize s(m_widget->sizeHint()); + TQSize s(m_widget->sizeHint()); setIntrinsicWidth( s.width() ); setIntrinsicHeight( s.height() ); } @@ -1108,7 +1108,7 @@ void RenderSelect::layout( ) RenderFormElement::layout(); // and now disable the widget in case there is no <option> given - QMemArray<HTMLGenericFormElementImpl*> listItems = element()->listItems(); + TQMemArray<HTMLGenericFormElementImpl*> listItems = element()->listItems(); bool foundOption = false; for (uint i = 0; i < listItems.size() && !foundOption; i++) @@ -1123,7 +1123,7 @@ void RenderSelect::slotSelected(int index) // emitted by the combobox only KHTMLAssert( !m_useListBox ); - QMemArray<HTMLGenericFormElementImpl*> listItems = element()->listItems(); + TQMemArray<HTMLGenericFormElementImpl*> listItems = element()->listItems(); if(index >= 0 && index < int(listItems.size())) { bool found = ( listItems[index]->id() == ID_OPTION ); @@ -1186,7 +1186,7 @@ void RenderSelect::slotSelectionChanged() // emitted by the listbox only // don't use listItems() here as we have to avoid recalculations - changing the // option list will make use update options not in the way the user expects them - QMemArray<HTMLGenericFormElementImpl*> listItems = element()->m_listItems; + TQMemArray<HTMLGenericFormElementImpl*> listItems = element()->m_listItems; for ( unsigned i = 0; i < listItems.count(); i++ ) // don't use setSelected() here because it will cause us to be called // again with updateSelection. @@ -1207,11 +1207,11 @@ void RenderSelect::setOptionsChanged(bool _optionsChanged) KListBox* RenderSelect::createListBox() { KListBox *lb = new KListBox(view()->viewport(), "__khtml"); - lb->setSelectionMode(m_multiple ? QListBox::Extended : QListBox::Single); + lb->setSelectionMode(m_multiple ? TQListBox::Extended : TQListBox::Single); // ### looks broken //lb->setAutoMask(true); - connect( lb, SIGNAL( selectionChanged() ), this, SLOT( slotSelectionChanged() ) ); -// connect( lb, SIGNAL( clicked( QListBoxItem * ) ), this, SLOT( slotClicked() ) ); + connect( lb, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotSelectionChanged() ) ); +// connect( lb, TQT_SIGNAL( clicked( TQListBoxItem * ) ), this, TQT_SLOT( slotClicked() ) ); m_ignoreSelectEvents = false; lb->setMouseTracking(true); @@ -1221,13 +1221,13 @@ KListBox* RenderSelect::createListBox() ComboBoxWidget *RenderSelect::createComboBox() { ComboBoxWidget *cb = new ComboBoxWidget(view()->viewport()); - connect(cb, SIGNAL(activated(int)), this, SLOT(slotSelected(int))); + connect(cb, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSelected(int))); return cb; } void RenderSelect::updateSelection() { - QMemArray<HTMLGenericFormElementImpl*> listItems = element()->listItems(); + TQMemArray<HTMLGenericFormElementImpl*> listItems = element()->listItems(); int i; if (m_useListBox) { // if multi-select, we select only the new selected index @@ -1260,28 +1260,28 @@ void RenderSelect::updateSelection() // ------------------------------------------------------------------------- -TextAreaWidget::TextAreaWidget(int wrap, QWidget* parent) +TextAreaWidget::TextAreaWidget(int wrap, TQWidget* parent) : KTextEdit(parent, "__khtml"), m_findDlg(0), m_find(0), m_repDlg(0), m_replace(0) { if(wrap != DOM::HTMLTextAreaElementImpl::ta_NoWrap) { - setWordWrap(QTextEdit::WidgetWidth); + setWordWrap(TQTextEdit::WidgetWidth); setHScrollBarMode( AlwaysOff ); setVScrollBarMode( AlwaysOn ); } else { - setWordWrap(QTextEdit::NoWrap); + setWordWrap(TQTextEdit::NoWrap); setHScrollBarMode( Auto ); setVScrollBarMode( Auto ); } KCursor::setAutoHideCursor(viewport(), true); - setTextFormat(QTextEdit::PlainText); + setTextFormat(TQTextEdit::PlainText); setAutoMask(true); setMouseTracking(true); KActionCollection *ac = new KActionCollection(this); - m_findAction = KStdAction::find( this, SLOT( slotFind() ), ac ); - m_findNextAction = KStdAction::findNext( this, SLOT( slotFindNext() ), ac ); - m_replaceAction = KStdAction::replace( this, SLOT( slotReplace() ), ac ); + m_findAction = KStdAction::find( this, TQT_SLOT( slotFind() ), ac ); + m_findNextAction = KStdAction::findNext( this, TQT_SLOT( slotFindNext() ), ac ); + m_replaceAction = KStdAction::replace( this, TQT_SLOT( slotReplace() ), ac ); } @@ -1298,9 +1298,9 @@ TextAreaWidget::~TextAreaWidget() } -QPopupMenu *TextAreaWidget::createPopupMenu(const QPoint& pos) +TQPopupMenu *TextAreaWidget::createPopupMenu(const TQPoint& pos) { - QPopupMenu *popup = KTextEdit::createPopupMenu(pos); + TQPopupMenu *popup = KTextEdit::createPopupMenu(pos); if ( !popup ) { return 0L; @@ -1323,7 +1323,7 @@ QPopupMenu *TextAreaWidget::createPopupMenu(const QPoint& pos) } -void TextAreaWidget::slotFindHighlight(const QString& text, int matchingIndex, int matchingLength) +void TextAreaWidget::slotFindHighlight(const TQString& text, int matchingIndex, int matchingLength) { Q_UNUSED(text) //kdDebug() << "Highlight: [" << text << "] mi:" << matchingIndex << " ml:" << matchingLength << endl; @@ -1338,7 +1338,7 @@ void TextAreaWidget::slotFindHighlight(const QString& text, int matchingIndex, i } -void TextAreaWidget::slotReplaceText(const QString &text, int replacementIndex, int /*replacedLength*/, int matchedLength) { +void TextAreaWidget::slotReplaceText(const TQString &text, int replacementIndex, int /*replacedLength*/, int matchedLength) { Q_UNUSED(text) //kdDebug() << "Replace: [" << text << "] ri:" << replacementIndex << " rl:" << replacedLength << " ml:" << matchedLength << endl; setSelection(m_repPara, replacementIndex, m_repPara, replacementIndex + matchedLength); @@ -1371,11 +1371,11 @@ void TextAreaWidget::slotDoReplace() // Connect highlight signal to code which handles highlighting // of found text. - connect(m_replace, SIGNAL(highlight(const QString &, int, int)), - this, SLOT(slotFindHighlight(const QString &, int, int))); - connect(m_replace, SIGNAL(findNext()), this, SLOT(slotReplaceNext())); - connect(m_replace, SIGNAL(replace(const QString &, int, int, int)), - this, SLOT(slotReplaceText(const QString &, int, int, int))); + connect(m_replace, TQT_SIGNAL(highlight(const TQString &, int, int)), + this, TQT_SLOT(slotFindHighlight(const TQString &, int, int))); + connect(m_replace, TQT_SIGNAL(findNext()), this, TQT_SLOT(slotReplaceNext())); + connect(m_replace, TQT_SIGNAL(replace(const TQString &, int, int, int)), + this, TQT_SLOT(slotReplaceText(const TQString &, int, int, int))); m_repDlg->close(); slotReplaceNext(); @@ -1470,9 +1470,9 @@ void TextAreaWidget::slotDoFind() // Connect highlight signal to code which handles highlighting // of found text. - connect(m_find, SIGNAL(highlight(const QString &, int, int)), - this, SLOT(slotFindHighlight(const QString &, int, int))); - connect(m_find, SIGNAL(findNext()), this, SLOT(slotFindNext())); + connect(m_find, TQT_SIGNAL(highlight(const TQString &, int, int)), + this, TQT_SLOT(slotFindHighlight(const TQString &, int, int))); + connect(m_find, TQT_SIGNAL(findNext()), this, TQT_SLOT(slotFindNext())); m_findDlg->close(); m_find->closeFindNextDialog(); @@ -1546,7 +1546,7 @@ void TextAreaWidget::slotFind() KWin::activateWindow( m_findDlg->winId() ); } else { m_findDlg = new KFindDialog(false, this, "KHTML Text Area Find Dialog"); - connect( m_findDlg, SIGNAL(okClicked()), this, SLOT(slotDoFind()) ); + connect( m_findDlg, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotDoFind()) ); } m_findDlg->show(); } @@ -1561,17 +1561,17 @@ void TextAreaWidget::slotReplace() KWin::activateWindow( m_repDlg->winId() ); } else { m_repDlg = new KReplaceDialog(this, "KHTMLText Area Replace Dialog", 0, - QStringList(), QStringList(), false); - connect( m_repDlg, SIGNAL(okClicked()), this, SLOT(slotDoReplace()) ); + TQStringList(), TQStringList(), false); + connect( m_repDlg, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotDoReplace()) ); } m_repDlg->show(); } -bool TextAreaWidget::event( QEvent *e ) +bool TextAreaWidget::event( TQEvent *e ) { - if ( e->type() == QEvent::AccelAvailable && isReadOnly() ) { - QKeyEvent* ke = (QKeyEvent*) e; + if ( e->type() == TQEvent::AccelAvailable && isReadOnly() ) { + TQKeyEvent* ke = (TQKeyEvent*) e; if ( ke->state() & ControlButton ) { switch ( ke->key() ) { case Key_Left: @@ -1602,7 +1602,7 @@ RenderTextArea::RenderTextArea(HTMLTextAreaElementImpl *element) edit->setCheckSpellingEnabled( settings->autoSpellCheck() ); edit->setTabChangesFocus( ! settings->allowTabulation() ); - connect(edit,SIGNAL(textChanged()),this,SLOT(slotTextChanged())); + connect(edit,TQT_SIGNAL(textChanged()),this,TQT_SLOT(slotTextChanged())); } RenderTextArea::~RenderTextArea() @@ -1632,12 +1632,12 @@ void RenderTextArea::calcMinMaxWidth() KHTMLAssert( !minMaxKnown() ); TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget); - const QFontMetrics &m = style()->fontMetrics(); + const TQFontMetrics &m = style()->fontMetrics(); w->setTabStopWidth(8 * m.width(" ")); - QSize size( kMax(element()->cols(), 1L)*m.width('x') + w->frameWidth() + + TQSize size( kMax(element()->cols(), 1L)*m.width('x') + w->frameWidth() + w->verticalScrollBar()->sizeHint().width(), kMax(element()->rows(), 1L)*m.lineSpacing() + w->frameWidth()*4 + - (w->wordWrap() == QTextEdit::NoWrap ? + (w->wordWrap() == TQTextEdit::NoWrap ? w->horizontalScrollBar()->sizeHint().height() : 0) ); @@ -1681,7 +1681,7 @@ void RenderTextArea::updateFromElement() { TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget); w->setReadOnly(element()->readOnly()); - QString elementText = element()->value().string(); + TQString elementText = element()->value().string(); if ( elementText != text() ) { w->blockSignals(true); @@ -1707,28 +1707,28 @@ void RenderTextArea::close( ) } -QString RenderTextArea::text() +TQString RenderTextArea::text() { - QString txt; + TQString txt; TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget); if(element()->wrap() == DOM::HTMLTextAreaElementImpl::ta_Physical) { - // yeah, QTextEdit has no accessor for getting the visually wrapped text + // yeah, TQTextEdit has no accessor for getting the visually wrapped text for (int p=0; p < w->paragraphs(); ++p) { int ll = 0; int lindex = w->lineOfChar(p, 0); - QString paragraphText = w->text(p); + TQString paragraphText = w->text(p); int pl = w->paragraphLength(p); paragraphText = paragraphText.left(pl); //Snip invented space. for (int l = 0; l < pl; ++l) { if (lindex != w->lineOfChar(p, l)) { - paragraphText.insert(l+ll++, QString::fromLatin1("\n")); + paragraphText.insert(l+ll++, TQString::fromLatin1("\n")); lindex = w->lineOfChar(p, l); } } txt += paragraphText; if (p < w->paragraphs() - 1) - txt += QString::fromLatin1("\n"); + txt += TQString::fromLatin1("\n"); } } else @@ -1745,7 +1745,7 @@ int RenderTextArea::queryParagraphInfo(int para, Mode m, int param) { bool physWrap = element()->wrap() == DOM::HTMLTextAreaElementImpl::ta_Physical; - QString paragraphText = w->text(para); + TQString paragraphText = w->text(para); int pl = w->paragraphLength(para); int physicalPL = pl; if (m == ParaPortionLength) diff --git a/khtml/rendering/render_form.h b/khtml/rendering/render_form.h index f4d35b927..e8340c93f 100644 --- a/khtml/rendering/render_form.h +++ b/khtml/rendering/render_form.h @@ -37,10 +37,10 @@ class QListboxItem; #include <ktextedit.h> #include <kurlrequester.h> #include <klineedit.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qpushbutton.h> -#include <qhbox.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqpushbutton.h> +#include <tqhbox.h> #include <klistbox.h> #include <kcombobox.h> #include "dom/dom_misc.h" @@ -97,7 +97,7 @@ protected: virtual bool isEditable() const { return false; } AlignmentFlags textAlignment() const; - QPoint m_mousePos; + TQPoint m_mousePos; int m_state; }; @@ -136,7 +136,7 @@ public: virtual bool handleEvent(const DOM::EventImpl&) { return false; } - QCheckBox *widget() const { return static_cast<QCheckBox*>(m_widget); } + TQCheckBox *widget() const { return static_cast<TQCheckBox*>(m_widget); } public slots: virtual void slotStateChanged(int state); @@ -157,7 +157,7 @@ public: virtual bool handleEvent(const DOM::EventImpl&) { return false; } - QRadioButton *widget() const { return static_cast<QRadioButton*>(m_widget); } + TQRadioButton *widget() const { return static_cast<TQRadioButton*>(m_widget); } public slots: virtual void slotToggled(bool); @@ -176,7 +176,7 @@ public: virtual void updateFromElement(); virtual short baselinePosition( bool ) const; private: - QString rawText(); + TQString rawText(); }; // ------------------------------------------------------------------------- @@ -240,7 +240,7 @@ public: void setSelectionRange(long start, long end); public slots: void slotReturnPressed(); - void slotTextChanged(const QString &string); + void slotTextChanged(const TQString &string); protected: virtual void handleFocusOut(); @@ -256,21 +256,21 @@ class LineEditWidget : public KLineEdit Q_OBJECT public: LineEditWidget(DOM::HTMLInputElementImpl* input, - KHTMLView* view, QWidget* parent); + KHTMLView* view, TQWidget* parent); ~LineEditWidget(); void highLightWord( unsigned int length, unsigned int pos ); protected: - virtual bool event( QEvent *e ); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual QPopupMenu *createPopupMenu(); + virtual bool event( TQEvent *e ); + virtual void mouseMoveEvent(TQMouseEvent *e); + virtual TQPopupMenu *createPopupMenu(); private slots: void extendedMenuActivated( int id); void slotCheckSpelling(); void slotSpellCheckReady( KSpell *s ); - void slotSpellCheckDone( const QString &s ); - void spellCheckerMisspelling( const QString &text, const QStringList &, unsigned int pos); - void spellCheckerCorrected( const QString &, const QString &, unsigned int ); + void slotSpellCheckDone( const TQString &s ); + void spellCheckerMisspelling( const TQString &text, const TQStringList &, unsigned int pos); + void spellCheckerCorrected( const TQString &, const TQString &, unsigned int ); void spellCheckerFinished(); private: @@ -296,7 +296,7 @@ public: protected: virtual void paintBoxDecorations(PaintInfo& pI, int _tx, int _ty); - void paintBorderMinusLegend(QPainter *p, int _tx, int _ty, int w, + void paintBorderMinusLegend(TQPainter *p, int _tx, int _ty, int w, int h, const RenderStyle *style, int lx, int lw); RenderObject* findLegend(); }; @@ -321,8 +321,8 @@ public: public slots: void slotReturnPressed(); - void slotTextChanged(const QString &string); - void slotUrlSelected(const QString &string); + void slotTextChanged(const TQString &string); + void slotUrlSelected(const TQString &string); protected: virtual void handleFocusOut(); @@ -365,11 +365,11 @@ public: class ComboBoxWidget : public KComboBox { public: - ComboBoxWidget(QWidget *parent); + ComboBoxWidget(TQWidget *parent); protected: - virtual bool event(QEvent *); - virtual bool eventFilter(QObject *dest, QEvent *e); + virtual bool event(TQEvent *); + virtual bool eventFilter(TQObject *dest, TQEvent *e); }; // ------------------------------------------------------------------------- @@ -417,13 +417,13 @@ class TextAreaWidget : public KTextEdit { Q_OBJECT public: - TextAreaWidget(int wrap, QWidget* parent); + TextAreaWidget(int wrap, TQWidget* parent); virtual ~TextAreaWidget(); protected: - virtual bool event (QEvent *e ); - virtual QPopupMenu *createPopupMenu(const QPoint& pos); - virtual QPopupMenu* createPopupMenu() { return KTextEdit::createPopupMenu(); } + virtual bool event (TQEvent *e ); + virtual TQPopupMenu *createPopupMenu(const TQPoint& pos); + virtual TQPopupMenu* createPopupMenu() { return KTextEdit::createPopupMenu(); } private slots: void slotFind(); void slotDoFind(); @@ -431,8 +431,8 @@ private slots: void slotReplace(); void slotDoReplace(); void slotReplaceNext(); - void slotReplaceText(const QString&, int, int, int); - void slotFindHighlight(const QString&, int, int); + void slotReplaceText(const TQString&, int, int, int); + void slotFindHighlight(const TQString&, int, int); private: KFindDialog *m_findDlg; KFind *m_find; @@ -468,7 +468,7 @@ public: DOM::HTMLTextAreaElementImpl* element() const { return static_cast<DOM::HTMLTextAreaElementImpl*>(RenderObject::element()); } - QString text(); + TQString text(); void highLightWord( unsigned int length, unsigned int pos ); void select(); diff --git a/khtml/rendering/render_frames.cpp b/khtml/rendering/render_frames.cpp index 4ee0f96bf..8f072dda6 100644 --- a/khtml/rendering/render_frames.cpp +++ b/khtml/rendering/render_frames.cpp @@ -43,9 +43,9 @@ #include <kmimetype.h> #include <klocale.h> #include <kdebug.h> -#include <qtimer.h> -#include <qpainter.h> -#include <qcursor.h> +#include <tqtimer.h> +#include <tqpainter.h> +#include <tqcursor.h> #include <assert.h> @@ -509,7 +509,7 @@ bool RenderFrameSet::userResize( MouseEventImpl *evt ) if(!m_resizing && evt->id() == EventImpl::MOUSEDOWN_EVENT) { setResizing(true); - KApplication::setOverrideCursor(QCursor(m_cursor)); + KApplication::setOverrideCursor(TQCursor(m_cursor)); m_vSplitPos = _x; m_hSplitPos = _y; m_oldpos = -1; @@ -547,11 +547,11 @@ bool RenderFrameSet::userResize( MouseEventImpl *evt ) KHTMLView *view = canvas()->view(); if ((m_resizing || evt->id() == EventImpl::MOUSEUP_EVENT) && view) { - QPainter paint( view ); + TQPainter paint( view ); paint.setPen( Qt::gray ); paint.setBrush( Qt::gray ); paint.setRasterOp( Qt::XorROP ); - QRect r(xPos(), yPos(), width(), height()); + TQRect r(xPos(), yPos(), width(), height()); const int rBord = 3; int sw = element()->border(); int p = m_resizing ? (m_vSplit > -1 ? _x : _y) : -1; @@ -601,7 +601,7 @@ bool RenderFrameSet::canResize( int _x, int _y ) } #ifdef ENABLE_DUMP -void RenderFrameSet::dump(QTextStream &stream, const QString &ind) const +void RenderFrameSet::dump(TQTextStream &stream, const TQString &ind) const { RenderBox::dump(stream,ind); stream << " totalrows=" << element()->totalRows(); @@ -627,16 +627,16 @@ RenderPart::RenderPart(DOM::HTMLElementImpl* node) setInline(false); } -void RenderPart::setWidget( QWidget *widget ) +void RenderPart::setWidget( TQWidget *widget ) { #ifdef DEBUG_LAYOUT kdDebug(6031) << "RenderPart::setWidget()" << endl; #endif setQWidget( widget ); - widget->setFocusPolicy(QWidget::WheelFocus); + widget->setFocusPolicy(TQWidget::WheelFocus); if(widget->inherits("KHTMLView")) - connect( widget, SIGNAL( cleared() ), this, SLOT( slotViewCleared() ) ); + connect( widget, TQT_SIGNAL( cleared() ), this, TQT_SLOT( slotViewCleared() ) ); setNeedsLayoutAndMinMaxRecalc(); @@ -645,7 +645,7 @@ void RenderPart::setWidget( QWidget *widget ) slotViewCleared(); } -bool RenderPart::partLoadingErrorNotify(khtml::ChildFrame *, const KURL& , const QString& ) +bool RenderPart::partLoadingErrorNotify(khtml::ChildFrame *, const KURL& , const TQString& ) { return false; } @@ -674,13 +674,13 @@ RenderFrame::RenderFrame( DOM::HTMLFrameElementImpl *frame ) void RenderFrame::slotViewCleared() { - if(m_widget->inherits("QScrollView")) { + if(m_widget->inherits("TQScrollView")) { #ifdef DEBUG_LAYOUT kdDebug(6031) << "frame is a scrollview!" << endl; #endif - QScrollView *view = static_cast<QScrollView *>(m_widget); + TQScrollView *view = static_cast<TQScrollView *>(m_widget); if(!element()->frameBorder || !((static_cast<HTMLFrameSetElementImpl *>(element()->parentNode()))->frameBorder())) - view->setFrameStyle(QFrame::NoFrame); + view->setFrameStyle(TQFrame::NoFrame); view->setVScrollBarMode(element()->scrolling ); view->setHScrollBarMode(element()->scrolling ); if(view->inherits("KHTMLView")) { @@ -705,7 +705,7 @@ RenderPartObject::RenderPartObject( DOM::HTMLElementImpl* element ) void RenderPartObject::updateWidget() { - QString url; + TQString url; KHTMLPart *part = m_view->part(); setNeedsLayoutAndMinMaxRecalc(); @@ -715,11 +715,11 @@ void RenderPartObject::updateWidget() HTMLIFrameElementImpl *o = static_cast<HTMLIFrameElementImpl *>(element()); url = o->url.string(); if (!o->getDocument()->isURLAllowed(url)) return; - part->requestFrame( this, url, o->name.string(), QStringList(), true ); + part->requestFrame( this, url, o->name.string(), TQStringList(), true ); // ### this should be constant true - move iframe to somewhere else } else { - QStringList params; + TQStringList params; HTMLObjectBaseElementImpl * objbase = static_cast<HTMLObjectBaseElementImpl *>(element()); url = objbase->url; @@ -727,17 +727,17 @@ void RenderPartObject::updateWidget() if ( child->id() == ID_PARAM ) { HTMLParamElementImpl *p = static_cast<HTMLParamElementImpl *>( child ); - QString aStr = p->name(); - aStr += QString::fromLatin1("=\""); + TQString aStr = p->name(); + aStr += TQString::fromLatin1("=\""); aStr += p->value(); - aStr += QString::fromLatin1("\""); - QString name_lower = p->name().lower(); - if (name_lower == QString::fromLatin1("type") && objbase->id() != ID_APPLET) { + aStr += TQString::fromLatin1("\""); + TQString name_lower = p->name().lower(); + if (name_lower == TQString::fromLatin1("type") && objbase->id() != ID_APPLET) { objbase->setServiceType(p->value()); } else if (url.isEmpty() && - (name_lower == QString::fromLatin1("src") || - name_lower == QString::fromLatin1("movie") || - name_lower == QString::fromLatin1("code"))) { + (name_lower == TQString::fromLatin1("src") || + name_lower == TQString::fromLatin1("movie") || + name_lower == TQString::fromLatin1("code"))) { url = p->value(); } params.append(aStr); @@ -754,12 +754,12 @@ void RenderPartObject::updateWidget() } } } - params.append( QString::fromLatin1("__KHTML__PLUGINEMBED=\"YES\"") ); - params.append( QString::fromLatin1("__KHTML__PLUGINBASEURL=\"%1\"").arg(element()->getDocument()->baseURL().url())); + params.append( TQString::fromLatin1("__KHTML__PLUGINEMBED=\"YES\"") ); + params.append( TQString::fromLatin1("__KHTML__PLUGINBASEURL=\"%1\"").arg(element()->getDocument()->baseURL().url())); HTMLEmbedElementImpl *embed = 0; - QString classId; - QString serviceType = objbase->serviceType; + TQString classId; + TQString serviceType = objbase->serviceType; if ( element()->id() == ID_EMBED ) { embed = static_cast<HTMLEmbedElementImpl *>( objbase ); @@ -775,18 +775,18 @@ void RenderPartObject::updateWidget() } classId = objbase->classId; - params.append( QString::fromLatin1("__KHTML__CLASSID=\"%1\"").arg( classId ) ); - params.append( QString::fromLatin1("__KHTML__CODEBASE=\"%1\"").arg( objbase->getAttribute(ATTR_CODEBASE).string() ) ); + params.append( TQString::fromLatin1("__KHTML__CLASSID=\"%1\"").arg( classId ) ); + params.append( TQString::fromLatin1("__KHTML__CODEBASE=\"%1\"").arg( objbase->getAttribute(ATTR_CODEBASE).string() ) ); if (!objbase->getAttribute(ATTR_WIDTH).isEmpty()) - params.append( QString::fromLatin1("WIDTH=\"%1\"").arg( objbase->getAttribute(ATTR_WIDTH).string() ) ); + params.append( TQString::fromLatin1("WIDTH=\"%1\"").arg( objbase->getAttribute(ATTR_WIDTH).string() ) ); else if (embed && !embed->getAttribute(ATTR_WIDTH).isEmpty()) { - params.append( QString::fromLatin1("WIDTH=\"%1\"").arg( embed->getAttribute(ATTR_WIDTH).string() ) ); + params.append( TQString::fromLatin1("WIDTH=\"%1\"").arg( embed->getAttribute(ATTR_WIDTH).string() ) ); objbase->setAttribute(ATTR_WIDTH, embed->getAttribute(ATTR_WIDTH)); } if (!objbase->getAttribute(ATTR_HEIGHT).isEmpty()) - params.append( QString::fromLatin1("HEIGHT=\"%1\"").arg( objbase->getAttribute(ATTR_HEIGHT).string() ) ); + params.append( TQString::fromLatin1("HEIGHT=\"%1\"").arg( objbase->getAttribute(ATTR_HEIGHT).string() ) ); else if (embed && !embed->getAttribute(ATTR_HEIGHT).isEmpty()) { - params.append( QString::fromLatin1("HEIGHT=\"%1\"").arg( embed->getAttribute(ATTR_HEIGHT).string() ) ); + params.append( TQString::fromLatin1("HEIGHT=\"%1\"").arg( embed->getAttribute(ATTR_HEIGHT).string() ) ); objbase->setAttribute(ATTR_HEIGHT, embed->getAttribute(ATTR_HEIGHT)); } @@ -808,7 +808,7 @@ void RenderPartObject::updateWidget() serviceType = "application/x-activex-handler"; #endif - if(classId.find(QString::fromLatin1("D27CDB6E-AE6D-11cf-96B8-444553540000")) >= 0) { + if(classId.find(TQString::fromLatin1("D27CDB6E-AE6D-11cf-96B8-444553540000")) >= 0) { // It is ActiveX, but the nsplugin system handling // should also work, that's why we don't override the // serviceType with application/x-activex-handler @@ -817,17 +817,17 @@ void RenderPartObject::updateWidget() // with nspluginviewer (Niko) serviceType = "application/x-shockwave-flash"; } - else if(classId.find(QString::fromLatin1("CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA")) >= 0) + else if(classId.find(TQString::fromLatin1("CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA")) >= 0) serviceType = "audio/x-pn-realaudio-plugin"; - else if(classId.find(QString::fromLatin1("8AD9C840-044E-11D1-B3E9-00805F499D93")) >= 0 || - objbase->classId.find(QString::fromLatin1("CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA")) >= 0) + else if(classId.find(TQString::fromLatin1("8AD9C840-044E-11D1-B3E9-00805F499D93")) >= 0 || + objbase->classId.find(TQString::fromLatin1("CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA")) >= 0) serviceType = "application/x-java-applet"; // http://www.apple.com/quicktime/tools_tips/tutorials/activex.html - else if(classId.find(QString::fromLatin1("02BF25D5-8C17-4B23-BC80-D3488ABDDC6B")) >= 0) + else if(classId.find(TQString::fromLatin1("02BF25D5-8C17-4B23-BC80-D3488ABDDC6B")) >= 0) serviceType = "video/quicktime"; // http://msdn.microsoft.com/library/en-us/dnwmt/html/adding_windows_media_to_web_pages__etse.asp?frame=true - else if(objbase->classId.find(QString::fromLatin1("6BF52A52-394A-11d3-B153-00C04F79FAA6")) >= 0 || - classId.find(QString::fromLatin1("22D6f312-B0F6-11D0-94AB-0080C74C7E95")) >= 0) + else if(objbase->classId.find(TQString::fromLatin1("6BF52A52-394A-11d3-B153-00C04F79FAA6")) >= 0 || + classId.find(TQString::fromLatin1("22D6f312-B0F6-11D0-94AB-0080C74C7E95")) >= 0) serviceType = "video/x-msvideo"; else @@ -855,7 +855,7 @@ void RenderPartObject::close() } -bool RenderPartObject::partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const QString& serviceType ) +bool RenderPartObject::partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const TQString& serviceType ) { KHTMLPart *part = static_cast<KHTMLView *>(m_view)->part(); kdDebug(6031) << "RenderPartObject::partLoadingErrorNotify serviceType=" << serviceType << endl; @@ -888,7 +888,7 @@ bool RenderPartObject::partLoadingErrorNotify( khtml::ChildFrame *childFrame, co } // Dissociate ourselves from the current event loop (to prevent crashes // due to the message box staying up) - QTimer::singleShot( 0, this, SLOT( slotPartLoadingErrorNotify() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotPartLoadingErrorNotify() ) ); #if 0 Tokenizer *tokenizer = static_cast<DOM::DocumentImpl *>(part->document().handle())->tokenizer(); if (tokenizer) tokenizer->setOnHold( true ); @@ -902,7 +902,7 @@ void RenderPartObject::slotPartLoadingErrorNotify() { // First we need to find out the servicetype - again - this code is too duplicated ! HTMLEmbedElementImpl *embed = 0; - QString serviceType; + TQString serviceType; if( element()->id()==ID_OBJECT ) { // check for embed child object @@ -929,7 +929,7 @@ void RenderPartObject::slotPartLoadingErrorNotify() KParts::BrowserExtension *ext = part->browserExtension(); if( embed && !embed->pluginPage.isEmpty() && ext ) { // Prepare the mimetype to show in the question (comment if available, name as fallback) - QString mimeName = serviceType; + TQString mimeName = serviceType; KMimeType::Ptr mime = KMimeType::mimeType(serviceType); if ( mime->name() != KMimeType::defaultMimeType() ) mimeName = mime->comment(); @@ -952,10 +952,10 @@ void RenderPartObject::slotPartLoadingErrorNotify() if(!pluginAvailable) { // Prepare the URL to show in the question (host only if http, to make it short) KURL pluginPageURL( embed->pluginPage ); - QString shortURL = pluginPageURL.protocol() == "http" ? pluginPageURL.host() : pluginPageURL.prettyURL(); + TQString shortURL = pluginPageURL.protocol() == "http" ? pluginPageURL.host() : pluginPageURL.prettyURL(); int res = KMessageBox::questionYesNo( m_view, i18n("No plugin found for '%1'.\nDo you want to download one from %2?").arg(mimeName).arg(shortURL), - i18n("Missing Plugin"), i18n("Download"), i18n("Do Not Download"), QString("plugin-")+serviceType); + i18n("Missing Plugin"), i18n("Download"), i18n("Do Not Download"), TQString("plugin-")+serviceType); if ( res == KMessageBox::Yes ) { // Display vendor download page @@ -989,19 +989,19 @@ void RenderPartObject::layout( ) void RenderPartObject::slotViewCleared() { - if(m_widget->inherits("QScrollView") ) { + if(m_widget->inherits("TQScrollView") ) { #ifdef DEBUG_LAYOUT kdDebug(6031) << "iframe is a scrollview!" << endl; #endif - QScrollView *view = static_cast<QScrollView *>(m_widget); - int frameStyle = QFrame::NoFrame; - QScrollView::ScrollBarMode scroll = QScrollView::Auto; + TQScrollView *view = static_cast<TQScrollView *>(m_widget); + int frameStyle = TQFrame::NoFrame; + TQScrollView::ScrollBarMode scroll = TQScrollView::Auto; int marginw = -1; int marginh = -1; if ( element()->id() == ID_IFRAME) { HTMLIFrameElementImpl *frame = static_cast<HTMLIFrameElementImpl *>(element()); if(frame->frameBorder) - frameStyle = QFrame::Box; + frameStyle = TQFrame::Box; scroll = frame->scrolling; marginw = frame->marginWidth; marginh = frame->marginHeight; diff --git a/khtml/rendering/render_frames.h b/khtml/rendering/render_frames.h index c6e050525..3dd7ed0d9 100644 --- a/khtml/rendering/render_frames.h +++ b/khtml/rendering/render_frames.h @@ -69,7 +69,7 @@ public: { return static_cast<DOM::HTMLFrameSetElementImpl*>(RenderObject::element()); } #ifdef ENABLE_DUMP - virtual void dump(QTextStream &stream, const QString &ind) const; + virtual void dump(TQTextStream &stream, const TQString &ind) const; #endif private: @@ -99,7 +99,7 @@ public: virtual const char *renderName() const { return "RenderPart"; } - virtual void setWidget( QWidget *widget ); + virtual void setWidget( TQWidget *widget ); /** * Called by KHTMLPart to notify the frame object that loading the @@ -112,7 +112,7 @@ public: * Return false in the normal case, return true if a fallback was found * and the url was successfully opened. */ - virtual bool partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const QString& serviceType ); + virtual bool partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const TQString& serviceType ); virtual short intrinsicWidth() const; virtual int intrinsicHeight() const; @@ -159,7 +159,7 @@ public: virtual bool canHaveBorder() const { return true; } - virtual bool partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const QString& serviceType ); + virtual bool partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const TQString& serviceType ); public slots: void slotViewCleared(); diff --git a/khtml/rendering/render_generated.cpp b/khtml/rendering/render_generated.cpp index aeab48630..17c65fc9c 100644 --- a/khtml/rendering/render_generated.cpp +++ b/khtml/rendering/render_generated.cpp @@ -72,28 +72,28 @@ RenderCounter::RenderCounter(DOM::NodeImpl* node, const DOM::CounterImpl* counte { } -QString RenderCounter::toListStyleType(int value, int total, EListStyleType type) +TQString RenderCounter::toListStyleType(int value, int total, EListStyleType type) { - QString item; + TQString item; switch(type) { case LNONE: break; // Glyphs: (these values are not really used and instead handled by RenderGlyph) case LDISC: - item = QChar(0x2022); + item = TQChar(0x2022); break; case LCIRCLE: - item = QChar(0x25e6); + item = TQChar(0x25e6); break; case LSQUARE: - item = QChar(0x25a0); + item = TQChar(0x25a0); break; case LBOX: - item = QChar(0x25a1); + item = TQChar(0x25a1); break; case LDIAMOND: - item = QChar(0x25c6); + item = TQChar(0x25c6); break; // Numeric: case LDECIMAL: @@ -107,7 +107,7 @@ QString RenderCounter::toListStyleType(int value, int total, EListStyleType type decimals++; } decimals = kMax(decimals, 2); - QString num = QString::number(value); + TQString num = TQString::number(value); item.fill('0',decimals-num.length()); item.append(num); break; @@ -273,7 +273,7 @@ void RenderQuote::generateContent() case NO_OPEN_QUOTE: case NO_CLOSE_QUOTE: case NO_QUOTE: - m_item = QString(); + m_item = TQString(); } } @@ -290,8 +290,8 @@ void RenderGlyph::setStyle(RenderStyle *_style) { RenderBox::setStyle(_style); - const QFontMetrics &fm = style()->fontMetrics(); - QRect xSize= fm.boundingRect('x'); + const TQFontMetrics &fm = style()->fontMetrics(); + TQRect xSize= fm.boundingRect('x'); m_height = xSize.height(); m_width = xSize.width();; @@ -342,15 +342,15 @@ void RenderGlyph::paint(PaintInfo& paintInfo, int _tx, int _ty) if((_ty > paintInfo.r.bottom()) || (_ty + m_height <= paintInfo.r.top())) return; - QPainter* p = paintInfo.p; + TQPainter* p = paintInfo.p; - const QColor color( style()->color() ); + const TQColor color( style()->color() ); p->setPen( color ); int xHeight = m_height; int bulletWidth = (xHeight+1)/2; int yoff = (xHeight - 1)/4; - QRect marker(_tx, _ty + yoff, bulletWidth, bulletWidth); + TQRect marker(_tx, _ty + yoff, bulletWidth, bulletWidth); switch(m_type) { case LDISC: @@ -370,14 +370,14 @@ void RenderGlyph::paint(PaintInfo& paintInfo, int _tx, int _ty) p->drawRect( marker ); return; case LDIAMOND: { - static QPointArray diamond(4); + static TQPointArray diamond(4); int x = marker.x(); int y = marker.y(); int s = bulletWidth/2; - diamond[0] = QPoint(x+s, y); - diamond[1] = QPoint(x+2*s, y+s); - diamond[2] = QPoint(x+s, y+2*s); - diamond[3] = QPoint(x, y+s); + diamond[0] = TQPoint(x+s, y); + diamond[1] = TQPoint(x+2*s, y+s); + diamond[2] = TQPoint(x+s, y+2*s); + diamond[3] = TQPoint(x, y+s); p->setBrush( color ); p->drawConvexPolygon( diamond, 0, 4 ); return; diff --git a/khtml/rendering/render_generated.h b/khtml/rendering/render_generated.h index 15b30b8c7..6fa20e7cd 100644 --- a/khtml/rendering/render_generated.h +++ b/khtml/rendering/render_generated.h @@ -49,7 +49,7 @@ public: void updateContent(); protected: - QString m_item; + TQString m_item; CounterNode *m_counterNode; // Cache of the counternode }; @@ -66,7 +66,7 @@ public: virtual void generateContent(); protected: - QString toListStyleType(int value, int total, EListStyleType type); + TQString toListStyleType(int value, int total, EListStyleType type); const DOM::CounterImpl* m_counter; }; diff --git a/khtml/rendering/render_image.cpp b/khtml/rendering/render_image.cpp index 5d33da2ab..120e75361 100644 --- a/khtml/rendering/render_image.cpp +++ b/khtml/rendering/render_image.cpp @@ -27,8 +27,8 @@ #include "render_image.h" #include "render_canvas.h" -#include <qdrawutil.h> -#include <qpainter.h> +#include <tqdrawutil.h> +#include <tqpainter.h> #include <kapplication.h> #include <kdebug.h> @@ -77,9 +77,9 @@ RenderImage::~RenderImage() if(m_oldImage) m_oldImage->deref( this ); } -QPixmap RenderImage::pixmap() const +TQPixmap RenderImage::pixmap() const { - return m_cachedImage ? m_cachedImage->pixmap() : QPixmap(); + return m_cachedImage ? m_cachedImage->pixmap() : TQPixmap(); } void RenderImage::setStyle(RenderStyle* _style) @@ -96,7 +96,7 @@ void RenderImage::setContentObject(CachedObject* co ) updateImage( static_cast<CachedImage*>( co ) ); } -void RenderImage::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o) +void RenderImage::setPixmap( const TQPixmap &p, const TQRect& r, CachedImage *o) { if ( o == m_oldImage ) return; @@ -114,8 +114,8 @@ void RenderImage::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o) // we have an alt and the user meant it (its not a text we invented) if ( element() && !alt.isEmpty() && !element()->getAttribute( ATTR_ALT ).isNull()) { - const QFontMetrics &fm = style()->fontMetrics(); - QRect br = fm.boundingRect ( 0, 0, 1024, 256, Qt::AlignAuto|Qt::WordBreak, alt.string() ); + const TQFontMetrics &fm = style()->fontMetrics(); + TQRect br = fm.boundingRect ( 0, 0, 1024, 256, Qt::AlignAuto|Qt::WordBreak, alt.string() ); if ( br.width() > iw ) iw = br.width(); if ( br.height() > ih ) @@ -193,7 +193,7 @@ void RenderImage::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o) (scaledHeight / (cHeight/5) == resizeCache.height() / (cHeight/5))) return; - resizeCache = QPixmap(); // for resized animations + resizeCache = TQPixmap(); // for resized animations if(completeRepaint) repaintRectangle(borderLeft()+paddingLeft(), borderTop()+paddingTop(), contentWidth(), contentHeight()); @@ -241,16 +241,16 @@ void RenderImage::paint(PaintInfo& paintInfo, int _tx, int _ty) // paint frame around image as long as it is not completely loaded from web. if (bUnfinishedImageFrame && paintInfo.phase == PaintActionForeground && cWidth > 2 && cHeight > 2 && !complete()) { - static QPixmap *loadingIcon; - QColor bg = khtml::retrieveBackgroundColor(this); - QColor fg = khtml::hasSufficientContrast(Qt::gray, bg) ? Qt::gray : + static TQPixmap *loadingIcon; + TQColor bg = khtml::retrieveBackgroundColor(this); + TQColor fg = khtml::hasSufficientContrast(Qt::gray, bg) ? Qt::gray : (hasSufficientContrast(Qt::white, bg) ? Qt::white : Qt::black); - paintInfo.p->setPen(QPen(fg, 1)); + paintInfo.p->setPen(TQPen(fg, 1)); paintInfo.p->setBrush( Qt::NoBrush ); paintInfo.p->drawRect(_tx, _ty, m_width, m_height); if (!(m_width <= 5 || m_height <= 5)) { if (!loadingIcon) { - loadingIcon = new QPixmap(); + loadingIcon = new TQPixmap(); loadingIcon->loadFromData(loading_icon_data, loading_icon_len); } paintInfo.p->drawPixmap(_tx + 4, _ty + 4, *loadingIcon, 0, 0, m_width - 5, m_height - 5); @@ -268,20 +268,20 @@ void RenderImage::paint(PaintInfo& paintInfo, int _tx, int _ty) qDrawShadePanel( paintInfo.p, _tx + leftBorder + leftPad, _ty + topBorder + topPad, cWidth, cHeight, KApplication::palette().inactive(), true, 1 ); } - QPixmap const* pix = i ? &i->pixmap() : 0; + TQPixmap const* pix = i ? &i->pixmap() : 0; if(berrorPic && pix && (cWidth >= pix->width()+4) && (cHeight >= pix->height()+4) ) { - QRect r(pix->rect()); - r = r.intersect(QRect(0, 0, cWidth-4, cHeight-4)); - paintInfo.p->drawPixmap( QPoint( _tx + leftBorder + leftPad+2, _ty + topBorder + topPad+2), *pix, r ); + TQRect r(pix->rect()); + r = r.intersect(TQRect(0, 0, cWidth-4, cHeight-4)); + paintInfo.p->drawPixmap( TQPoint( _tx + leftBorder + leftPad+2, _ty + topBorder + topPad+2), *pix, r ); } if(!alt.isEmpty()) { - QString text = alt.string(); + TQString text = alt.string(); paintInfo.p->setFont(style()->font()); paintInfo.p->setPen( style()->color() ); int ax = _tx + leftBorder + leftPad + 2; int ay = _ty + topBorder + topPad + 2; - const QFontMetrics &fm = style()->fontMetrics(); + const TQFontMetrics &fm = style()->fontMetrics(); if (cWidth>5 && cHeight>=fm.height()) paintInfo.p->drawText(ax, ay+1, cWidth - 4, cHeight - 4, Qt::WordBreak, text ); } @@ -290,18 +290,18 @@ void RenderImage::paint(PaintInfo& paintInfo, int _tx, int _ty) else if (i && !i->isTransparent()) { paintInfo.p->setPen( Qt::black ); // used for bitmaps - const QPixmap& pix = i->pixmap(); + const TQPixmap& pix = i->pixmap(); if ( (cWidth != intrinsicWidth() || cHeight != intrinsicHeight()) && pix.width() > 0 && pix.height() > 0 && i->valid_rect().isValid()) { if (resizeCache.isNull() && cWidth && cHeight && intrinsicWidth() && intrinsicHeight()) { - QRect scaledrect(i->valid_rect()); + TQRect scaledrect(i->valid_rect()); // kdDebug(6040) << "time elapsed: " << dt->elapsed() << endl; // kdDebug( 6040 ) << "have to scale: " << endl; // qDebug("cw=%d ch=%d pw=%d ph=%d rcw=%d, rch=%d", // cWidth, cHeight, intrinsicWidth(), intrinsicHeight(), resizeCache.width(), resizeCache.height()); - QWMatrix matrix; + TQWMatrix matrix; matrix.scale( (float)(cWidth)/intrinsicWidth(), (float)(cHeight)/intrinsicHeight() ); resizeCache = pix.xForm( matrix ); @@ -315,35 +315,35 @@ void RenderImage::paint(PaintInfo& paintInfo, int _tx, int _ty) // sometimes scaledrect.width/height are off by one because // of rounding errors. if the i is fully loaded, we // make sure that we don't do unnecessary resizes during painting - QSize s(scaledrect.size()); - if(i->valid_rect().size() == QSize( intrinsicWidth(), intrinsicHeight() )) // fully loaded - s = QSize(cWidth, cHeight); + TQSize s(scaledrect.size()); + if(i->valid_rect().size() == TQSize( intrinsicWidth(), intrinsicHeight() )) // fully loaded + s = TQSize(cWidth, cHeight); if(kAbs(s.width() - cWidth) < 2) // rounding errors s.setWidth(cWidth); if(resizeCache.size() != s) resizeCache.resize(s); - paintInfo.p->drawPixmap( QPoint( _tx + leftBorder + leftPad, _ty + topBorder + topPad), + paintInfo.p->drawPixmap( TQPoint( _tx + leftBorder + leftPad, _ty + topBorder + topPad), resizeCache, scaledrect ); } else - paintInfo.p->drawPixmap( QPoint( _tx + leftBorder + leftPad, _ty + topBorder + topPad), resizeCache ); + paintInfo.p->drawPixmap( TQPoint( _tx + leftBorder + leftPad, _ty + topBorder + topPad), resizeCache ); } else { // we might be just about switching images - QRect rect(i->valid_rect().isValid() ? i->valid_rect() - : QRect(0, 0, intrinsicWidth(), intrinsicHeight())); + TQRect rect(i->valid_rect().isValid() ? i->valid_rect() + : TQRect(0, 0, intrinsicWidth(), intrinsicHeight())); - QPoint offs( _tx + leftBorder + leftPad, _ty + topBorder + topPad); + TQPoint offs( _tx + leftBorder + leftPad, _ty + topBorder + topPad); // qDebug("normal paint rect %d/%d/%d/%d", rect.x(), rect.y(), rect.width(), rect.height()); -// rect = rect & QRect( 0 , y - offs.y() - 10, w, 10 + y + h - offs.y()); +// rect = rect & TQRect( 0 , y - offs.y() - 10, w, 10 + y + h - offs.y()); // qDebug("normal paint rect after %d/%d/%d/%d", rect.x(), rect.y(), rect.width(), rect.height()); // qDebug("normal paint: offs.y(): %d, y: %d, diff: %d", offs.y(), y, y - offs.y()); // qDebug(""); -// p->setClipRect(QRect(x,y,w,h)); +// p->setClipRect(TQRect(x,y,w,h)); // p->drawPixmap( offs.x(), y, pix, rect.x(), rect.y(), rect.width(), rect.height() ); @@ -370,7 +370,7 @@ void RenderImage::paint(PaintInfo& paintInfo, int _tx, int _ty) // don't touch it unless you know what you're doing paintInfo.p->setBrushOrigin(_tx, _ty - paintInfo.r.y()); paintInfo.p->fillRect(_tx, _ty, width(), height(), - QBrush(style()->palette().active().highlight(), + TQBrush(style()->palette().active().highlight(), Qt::Dense4Pattern)); } } @@ -406,7 +406,7 @@ void RenderImage::layout() } if ( m_width != oldwidth || m_height != oldheight ) - resizeCache = QPixmap(); + resizeCache = TQPixmap(); setNeedsLayout(false); } diff --git a/khtml/rendering/render_image.h b/khtml/rendering/render_image.h index bd887ddf5..8c8bb9bef 100644 --- a/khtml/rendering/render_image.h +++ b/khtml/rendering/render_image.h @@ -28,8 +28,8 @@ #include "rendering/render_replaced.h" #include "dom/dom_string.h" -#include <qmap.h> -#include <qpixmap.h> +#include <tqmap.h> +#include <tqpixmap.h> namespace khtml { @@ -47,10 +47,10 @@ public: virtual void layout(); - virtual void setPixmap( const QPixmap &, const QRect&, CachedImage *); + virtual void setPixmap( const TQPixmap &, const TQRect&, CachedImage *); // don't even think about making these methods virtual! - QPixmap pixmap() const; + TQPixmap pixmap() const; DOM::HTMLElementImpl* element() const { return static_cast<DOM::HTMLElementImpl*>(RenderObject::element()); } @@ -86,7 +86,7 @@ private: /* * Cache for images that need resizing */ - QPixmap resizeCache; + TQPixmap resizeCache; // text to display as long as the image isn't available DOM::DOMString alt; diff --git a/khtml/rendering/render_inline.cpp b/khtml/rendering/render_inline.cpp index 5848db47a..c3eb08d4b 100644 --- a/khtml/rendering/render_inline.cpp +++ b/khtml/rendering/render_inline.cpp @@ -30,7 +30,7 @@ #include "rendering/render_block.h" #include "xml/dom_docimpl.h" -#include <qvaluevector.h> +#include <tqvaluevector.h> using namespace khtml; @@ -260,7 +260,7 @@ void RenderInline::paint(PaintInfo& i, int _tx, int _ty) * @param pnt point to append * @return \c true if \c pnt has actually been appended */ -inline static bool appendIfNew(QValueVector<QPoint> &pointArray, const QPoint &pnt) +inline static bool appendIfNew(TQValueVector<TQPoint> &pointArray, const TQPoint &pnt) { // if (!pointArray.isEmpty()) kdDebug(6040) << "appifnew: " << pointArray.back() << " == " << pnt << ": " << (pointArray.back() == pnt) << endl; // else kdDebug(6040) << "appifnew: " << pnt << " (unconditional)" << endl; @@ -297,13 +297,13 @@ inline static bool appendIfNew(QValueVector<QPoint> &pointArray, const QPoint &p * If no spike is found, the point-array is left unchanged. * @return \c true if an actual reduction was done */ -inline static bool reduceSpike(QValueVector<QPoint> &pointArray) +inline static bool reduceSpike(TQValueVector<TQPoint> &pointArray) { if (pointArray.size() < 3) return false; - QValueVector<QPoint>::Iterator it = pointArray.end(); - QPoint p0 = *--it; - QPoint p1 = *--it; - QPoint p2 = *--it; + TQValueVector<TQPoint>::Iterator it = pointArray.end(); + TQPoint p0 = *--it; + TQPoint p1 = *--it; + TQPoint p2 = *--it; bool elide = false; @@ -363,13 +363,13 @@ inline static bool reduceSpike(QValueVector<QPoint> &pointArray) * left unchanged. * @return \c true if a segment separator was actually reduced. */ -inline static bool reduceSegmentSeparator(QValueVector<QPoint> &pointArray) +inline static bool reduceSegmentSeparator(TQValueVector<TQPoint> &pointArray) { if (pointArray.size() < 3) return false; - QValueVector<QPoint>::Iterator it = pointArray.end(); - QPoint p0 = *--it; - QPoint p1 = *--it; - QPoint p2 = *--it; + TQValueVector<TQPoint>::Iterator it = pointArray.end(); + TQPoint p0 = *--it; + TQPoint p1 = *--it; + TQPoint p2 = *--it; // kdDebug(6040) << "checking p2: " << p2 << " p1: " << p1 << " p0: " << p0 << endl; if (p0.x() == p1.x() && p1.x() == p2.x() @@ -391,7 +391,7 @@ inline static bool reduceSegmentSeparator(QValueVector<QPoint> &pointArray) * Appends the given point to the point-array, doing necessary reductions to * produce a path without spikes and segment separators. */ -static void appendPoint(QValueVector<QPoint> &pointArray, QPoint &pnt) +static void appendPoint(TQValueVector<TQPoint> &pointArray, TQPoint &pnt) { if (!appendIfNew(pointArray, pnt)) return; // kdDebug(6040) << "appendPoint: appended " << pnt << endl; @@ -411,7 +411,7 @@ static void appendPoint(QValueVector<QPoint> &pointArray, QPoint &pnt) * the lowest for !\c bottom. */ static void collectHorizontalBoxCoordinates(InlineBox *box, - QValueVector<QPoint> &pointArray, + TQValueVector<TQPoint> &pointArray, bool bottom, int offset, int limit = -500000) { // kdDebug(6000) << "collectHorizontalBoxCoordinates: " << endl; @@ -420,11 +420,11 @@ static void collectHorizontalBoxCoordinates(InlineBox *box, if (limit != -500000 && (bottom ? y < limit : y > limit)) y = limit; int x = box->xPos() + bottom*box->width() + offset; - QPoint newPnt(x, y); + TQPoint newPnt(x, y); // Add intersection point if point-array not empty. if (!pointArray.isEmpty()) { - QPoint lastPnt = pointArray.back(); - QPoint insPnt(newPnt.x(), lastPnt.y()); + TQPoint lastPnt = pointArray.back(); + TQPoint insPnt(newPnt.x(), lastPnt.y()); if (offset && ((bottom && lastPnt.y() > y) || (!bottom && lastPnt.y() < y))) { insPnt.rx() = lastPnt.x(); insPnt.ry() = y; @@ -453,8 +453,8 @@ static void collectHorizontalBoxCoordinates(InlineBox *box, // Add intersection point if flow box contained any children if (flowBox->firstChild()) { - QPoint lastPnt = pointArray.back(); - QPoint insPnt(lastPnt.x(), newPnt.y()); + TQPoint lastPnt = pointArray.back(); + TQPoint insPnt(lastPnt.x(), newPnt.y()); // kdDebug(6040) << "right: " << lastPnt << " == " << insPnt << ": " << (insPnt == lastPnt) << endl; appendPoint(pointArray, insPnt); } @@ -491,7 +491,7 @@ inline static bool lineBoxesDisjoint(InlineRunBox *line, int offset, bool toBegi * @param lastline if not 0, returns the pointer to the last line box traversed */ static void collectVerticalBoxCoordinates(InlineRunBox *line, - QValueVector<QPoint> &pointArray, + TQValueVector<TQPoint> &pointArray, bool left, int offset, InlineRunBox **lastline = 0) { InlineRunBox *last = 0; @@ -504,15 +504,15 @@ static void collectVerticalBoxCoordinates(InlineRunBox *line, if (root != line && !isLast) while (root->parent()) root = root->parent(); - QPoint newPnt(curr->xPos() + !left*curr->width() + offset, + TQPoint newPnt(curr->xPos() + !left*curr->width() + offset, (left ? root->topOverflow() : root->bottomOverflow()) + offset); if (!pointArray.isEmpty()) { - QPoint lastPnt = pointArray.back(); + TQPoint lastPnt = pointArray.back(); if (newPnt.x()>lastPnt.x() && !left) pointArray.back().setY( kMin(lastPnt.y(), root->topOverflow()-offset) ); else if (newPnt.x()<lastPnt.x() && left) pointArray.back().setY( kMax(lastPnt.y(), root->bottomOverflow()+offset) ); - QPoint insPnt(newPnt.x(), pointArray.back().y()); + TQPoint insPnt(newPnt.x(), pointArray.back().y()); // kdDebug(6040) << "left: " << lastPnt << " == " << insPnt << ": " << (insPnt == lastPnt) << endl; appendPoint(pointArray, insPnt); } @@ -532,23 +532,23 @@ static void collectVerticalBoxCoordinates(InlineRunBox *line, * @param pointArray point-array * @return actual begin of point array */ -static QPoint *linkEndToBegin(QValueVector<QPoint> &pointArray) +static TQPoint *linkEndToBegin(TQValueVector<TQPoint> &pointArray) { uint index = 0; assert(pointArray.size() >= 3); // if first and last points match, ignore the last one. - bool linkup = false; QPoint linkupPnt; + bool linkup = false; TQPoint linkupPnt; if (pointArray.front() == pointArray.back()) { linkupPnt = pointArray.back(); pointArray.pop_back(); linkup = true; } - const QPoint *it = pointArray.begin() + index; - QPoint pfirst = *it; - QPoint pnext = *++it; - QPoint plast = pointArray.back(); + const TQPoint *it = pointArray.begin() + index; + TQPoint pfirst = *it; + TQPoint pnext = *++it; + TQPoint plast = pointArray.back(); // kdDebug(6040) << "linkcheck plast: " << plast << " pfirst: " << pfirst << " pnext: " << pnext << endl; if (plast.x() == pfirst.x() && pfirst.x() == pnext.x() @@ -562,7 +562,7 @@ static QPoint *linkEndToBegin(QValueVector<QPoint> &pointArray) return pointArray.begin() + index; } -void RenderInline::paintOutlines(QPainter *p, int _tx, int _ty) +void RenderInline::paintOutlines(TQPainter *p, int _tx, int _ty) { if (style()->outlineWidth() == 0 || style()->outlineStyle() <= BHIDDEN) return; @@ -571,7 +571,7 @@ void RenderInline::paintOutlines(QPainter *p, int _tx, int _ty) // We may have to draw more than one outline path as they may be // disjoint. for (InlineRunBox *curr = firstLineBox(); curr; curr = curr->nextLineBox()) { - QValueVector<QPoint> path; + TQValueVector<TQPoint> path; // collect topmost outline collectHorizontalBoxCoordinates(curr, path, false, offset); @@ -584,7 +584,7 @@ void RenderInline::paintOutlines(QPainter *p, int _tx, int _ty) if (path.size() < 3) continue; - const QPoint *begin = linkEndToBegin(path); + const TQPoint *begin = linkEndToBegin(path); // paint the outline paintOutlinePath(p, _tx, _ty, begin, path.end(), BSLeft, -1, BSTop); @@ -623,7 +623,7 @@ inline BSOrientation bsOrientation(RenderObject::BorderSide bs) * The relative direction specifies whether the old border side meets with the * straight given by the coordinates from below (negative), or above (positive). */ -inline RenderObject::BorderSide newBorderSide(RenderObject::BorderSide oldBS, int direction, const QPoint &last, const QPoint &cur) +inline RenderObject::BorderSide newBorderSide(RenderObject::BorderSide oldBS, int direction, const TQPoint &last, const TQPoint &cur) { bool below = direction < 0; if (last.x() == cur.x()) { // new segment is vertical @@ -654,15 +654,15 @@ inline RenderObject::BorderSide newBorderSide(RenderObject::BorderSide oldBS, in * @param curBS border side of this segment * @param nextBS border side of next segment */ -static void paintOutlineSegment(RenderObject *o, QPainter *p, int tx, int ty, - const QPoint &p1, const QPoint &p2, +static void paintOutlineSegment(RenderObject *o, TQPainter *p, int tx, int ty, + const TQPoint &p1, const TQPoint &p2, RenderObject::BorderSide prevBS, RenderObject::BorderSide curBS, RenderObject::BorderSide nextBS) { int ow = o->style()->outlineWidth(); EBorderStyle os = o->style()->outlineStyle(); - QColor oc = o->style()->outlineColor(); + TQColor oc = o->style()->outlineColor(); int x1 = tx + p1.x(); int y1 = ty + p1.y(); @@ -683,7 +683,7 @@ static void paintOutlineSegment(RenderObject *o, QPainter *p, int tx, int ty, switch (curBS) { case RenderObject::BSLeft: case RenderObject::BSRight: -/* p->setPen(QColor("#ffe4dd")); +/* p->setPen(TQColor("#ffe4dd")); p->drawLine( x1 - (curBS == RenderObject::BSLeft ? ow : 0), y1 - (prevBS == RenderObject::BSTop ? ow : 0), @@ -720,13 +720,13 @@ static void paintOutlineSegment(RenderObject *o, QPainter *p, int tx, int ty, } } -void RenderInline::paintOutlinePath(QPainter *p, int tx, int ty, const QPoint *begin, const QPoint *end, BorderSide bs, int direction, BorderSide endingBS) +void RenderInline::paintOutlinePath(TQPainter *p, int tx, int ty, const TQPoint *begin, const TQPoint *end, BorderSide bs, int direction, BorderSide endingBS) { int ow = style()->outlineWidth(); if (ow == 0 || m_isContinuation) // Continuations get painted by the original inline. return; - QPoint last = *begin; + TQPoint last = *begin; BorderSide lastBS = bs; Q_ASSERT(begin != end); ++begin; @@ -736,12 +736,12 @@ void RenderInline::paintOutlinePath(QPainter *p, int tx, int ty, const QPoint *b bs = newBorderSide(bs, direction, last, *begin); // kdDebug(6040) << "newBorderSide: " << lastBS << " " << direction << "d " << last << " - " << *begin << " => " << bs << endl; - for (const QPoint *it = begin; it != end; ++it) { - QPoint cur = *it; + for (const TQPoint *it = begin; it != end; ++it) { + TQPoint cur = *it; // kdDebug(6040) << "cur: " << cur << endl; BorderSide nextBS; if (it + 1 != end) { - QPoint diff = cur - last; + TQPoint diff = cur - last; direction = diff.x() + diff.y(); nextBS = newBorderSide(bs, direction, cur, *(it + 1)); // kdDebug(6040) << "newBorderSide*: " << bs << " " << direction << "d " << cur << " - " << *(it + 1) << " => " << nextBS << endl; @@ -886,7 +886,7 @@ void RenderInline::caretPos(int offset, int flags, int &_x, int &_y, int &width, && element()->parent()->renderer() ? element()->parent()->renderer()->style() : style(); - const QFontMetrics &fm = s->fontMetrics(); + const TQFontMetrics &fm = s->fontMetrics(); _y = line->yPos() + line->baseline() - fm.ascent(); height = fm.height(); @@ -897,7 +897,7 @@ void RenderInline::caretPos(int offset, int flags, int &_x, int &_y, int &width, } } else { - const QFontMetrics &fm = style()->fontMetrics(); + const TQFontMetrics &fm = style()->fontMetrics(); _y = line->yPos() + line->baseline() - fm.ascent(); height = fm.height(); } diff --git a/khtml/rendering/render_inline.h b/khtml/rendering/render_inline.h index b87e53037..5f4bf7b29 100644 --- a/khtml/rendering/render_inline.h +++ b/khtml/rendering/render_inline.h @@ -77,11 +77,11 @@ public: virtual int offsetTop() const; virtual void caretPos(int offset, int flags, int &_x, int &_y, int &width, int &height); - void paintOutlines(QPainter *p, int tx, int ty); + void paintOutlines(TQPainter *p, int tx, int ty); protected: static RenderInline* cloneInline(RenderFlow* src); - void paintOutlinePath(QPainter *p, int tx, int ty, const QPoint *begin, const QPoint *end, BorderSide startingBS, int initialDirection, BorderSide endingBS); + void paintOutlinePath(TQPainter *p, int tx, int ty, const TQPoint *begin, const TQPoint *end, BorderSide startingBS, int initialDirection, BorderSide endingBS); private: bool m_isContinuation : 1; // Whether or not we're a continuation of an inline. diff --git a/khtml/rendering/render_layer.cpp b/khtml/rendering/render_layer.cpp index b4af3536c..2b7e93f1f 100644 --- a/khtml/rendering/render_layer.cpp +++ b/khtml/rendering/render_layer.cpp @@ -58,15 +58,15 @@ #include "html/html_blockimpl.h" #include "xml/dom_restyler.h" -#include <qscrollbar.h> -#include <qptrvector.h> -#include <qstyle.h> +#include <tqscrollbar.h> +#include <tqptrvector.h> +#include <tqstyle.h> using namespace DOM; using namespace khtml; #ifdef APPLE_CHANGES -QScrollBar* RenderLayer::gScrollBar = 0; +TQScrollBar* RenderLayer::gScrollBar = 0; #endif #ifndef NDEBUG @@ -161,10 +161,10 @@ void RenderLayer::updateLayerPosition() setPos(x,y); } -QRegion RenderLayer::paintedRegion(RenderLayer* rootLayer) +TQRegion RenderLayer::paintedRegion(RenderLayer* rootLayer) { updateZOrderLists(); - QRegion r; + TQRegion r; if (m_negZOrderList) { uint count = m_negZOrderList->count(); for (uint i = 0; i < count; i++) { @@ -176,7 +176,7 @@ QRegion RenderLayer::paintedRegion(RenderLayer* rootLayer) if (s->visibility() == VISIBLE) { int x = 0; int y = 0; convertToLayerCoords(rootLayer,x,y); - QRect cr(x,y,width(),height()); + TQRect cr(x,y,width(),height()); if ( s->backgroundImage() || s->backgroundColor().isValid() || s->hasBorder() || renderer()->scrollsOverflow() || renderer()->isReplaced() ) { r += cr; @@ -201,7 +201,7 @@ void RenderLayer::repaint( Priority p, bool markForRepaint ) return; for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) child->repaint( p, markForRepaint ); - QRect layerBounds, damageRect, fgrect; + TQRect layerBounds, damageRect, fgrect; calculateRects(renderer()->canvas()->layer(), renderer()->viewRect(), layerBounds, damageRect, fgrect); m_visibleRect = damageRect.intersect( layerBounds ); if (m_visibleRect.isValid()) @@ -226,7 +226,7 @@ void RenderLayer::updateLayerPositions(RenderLayer* rootLayer, bool doFullRepain int x = 0; int y = 0; convertToLayerCoords(rootLayer, x, y); - QRect layerBounds = QRect(x,y,width(),height()); + TQRect layerBounds = TQRect(x,y,width(),height()); positionScrollbars(layerBounds); } @@ -236,9 +236,9 @@ void RenderLayer::updateLayerPositions(RenderLayer* rootLayer, bool doFullRepain m_object->repaintAfterLayoutIfNeeded(m_repaintRect, m_fullRepaintRect); #else if (checkForRepaint && m_markedForRepaint) { - QRect layerBounds, damageRect, fgrect; + TQRect layerBounds, damageRect, fgrect; calculateRects(rootLayer, renderer()->viewRect(), layerBounds, damageRect, fgrect); - QRect vr = damageRect.intersect( layerBounds ); + TQRect vr = damageRect.intersect( layerBounds ); if (vr != m_visibleRect && vr.isValid()) { renderer()->canvas()->repaintViewRectangle( vr.x(), vr.y(), vr.width(), vr.height() ); m_visibleRect = vr; @@ -262,8 +262,8 @@ void RenderLayer::updateWidgetMasks(RenderLayer* rootLayer) uint count = m_posZOrderList ? m_posZOrderList->count() : 0; bool needUpdate = (count || !m_region.isNull()); if (count) { - QScrollView* sv = m_object->document()->view(); - m_region = QRect(0,0,sv->contentsWidth(),sv->contentsHeight()); + TQScrollView* sv = m_object->document()->view(); + m_region = TQRect(0,0,sv->contentsWidth(),sv->contentsHeight()); for (uint i = 0; i < count; i++) { RenderLayer* child = m_posZOrderList->at(i); @@ -272,7 +272,7 @@ void RenderLayer::updateWidgetMasks(RenderLayer* rootLayer) m_region -= child->paintedRegion(rootLayer); } } else { - m_region = QRegion(); + m_region = TQRegion(); } if (needUpdate) renderer()->updateWidgetMasks(); @@ -606,17 +606,17 @@ void RenderLayer::updateScrollPositionFromScrollbars() void RenderLayer::showScrollbar(Qt::Orientation o, bool show) { - QScrollBar *sb = (o == Qt::Horizontal) ? m_hBar : m_vBar; + TQScrollBar *sb = (o == Qt::Horizontal) ? m_hBar : m_vBar; if (show && !sb) { - QScrollView* scrollView = m_object->document()->view(); - sb = new QScrollBar(o, scrollView, "__khtml"); + TQScrollView* scrollView = m_object->document()->view(); + sb = new TQScrollBar(o, scrollView, "__khtml"); scrollView->addChild(sb, 0, -50000); - sb->setBackgroundMode(QWidget::NoBackground); + sb->setBackgroundMode(TQWidget::NoBackground); sb->show(); if (!m_scrollMediator) m_scrollMediator = new RenderScrollMediator(this); - m_scrollMediator->connect(sb, SIGNAL(valueChanged(int)), SLOT(slotValueChanged())); + m_scrollMediator->connect(sb, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotValueChanged())); } else if (!show && sb) { delete sb; @@ -637,7 +637,7 @@ int RenderLayer::verticalScrollbarWidth() #ifdef APPLE_CHANGES return m_vBar->width(); #else - return m_vBar->style().pixelMetric(QStyle::PM_ScrollBarExtent); + return m_vBar->style().pixelMetric(TQStyle::PM_ScrollBarExtent); #endif } @@ -650,12 +650,12 @@ int RenderLayer::horizontalScrollbarHeight() #ifdef APPLE_CHANGES return m_hBar->height(); #else - return m_hBar->style().pixelMetric(QStyle::PM_ScrollBarExtent); + return m_hBar->style().pixelMetric(TQStyle::PM_ScrollBarExtent); #endif } -void RenderLayer::positionScrollbars(const QRect& absBounds) +void RenderLayer::positionScrollbars(const TQRect& absBounds) { #ifdef APPLE_CHANGES if (m_vBar) { @@ -683,24 +683,24 @@ void RenderLayer::positionScrollbars(const QRect& absBounds) if (w <= 0 || h <= 0 || (!m_vBar && !m_hBar)) return; - QScrollView* scrollView = m_object->document()->view(); + TQScrollView* scrollView = m_object->document()->view(); tx += bl; ty += bt; - QScrollBar *b = m_hBar; + TQScrollBar *b = m_hBar; if (!m_hBar) b = m_vBar; - int sw = b->style().pixelMetric(QStyle::PM_ScrollBarExtent); + int sw = b->style().pixelMetric(TQStyle::PM_ScrollBarExtent); if (m_vBar) { - QRect vBarRect = QRect(tx + w - sw + 1, ty, sw, h - (m_hBar ? sw : 0) + 1); + TQRect vBarRect = TQRect(tx + w - sw + 1, ty, sw, h - (m_hBar ? sw : 0) + 1); m_vBar->resize(vBarRect.width(), vBarRect.height()); scrollView->addChild(m_vBar, vBarRect.x(), vBarRect.y()); } if (m_hBar) { - QRect hBarRect = QRect(tx, ty + h - sw + 1, w - (m_vBar ? sw : 0) + 1, sw); + TQRect hBarRect = TQRect(tx, ty + h - sw + 1, w - (m_vBar ? sw : 0) + 1, sw); m_hBar->resize(hBarRect.width(), hBarRect.height()); scrollView->addChild(m_hBar, hBarRect.x(), hBarRect.y()); } @@ -801,7 +801,7 @@ void RenderLayer::paintScrollbars(RenderObject::PaintInfo& pI) if (!m_object->element()) return; - QScrollView* scrollView = m_object->document()->view(); + TQScrollView* scrollView = m_object->document()->view(); if (m_hBar) { int x = m_hBar->x(); int y = m_hBar->y(); @@ -817,12 +817,12 @@ void RenderLayer::paintScrollbars(RenderObject::PaintInfo& pI) #endif } -void RenderLayer::paint(QPainter *p, const QRect& damageRect, bool selectionOnly) +void RenderLayer::paint(TQPainter *p, const TQRect& damageRect, bool selectionOnly) { paintLayer(this, p, damageRect, selectionOnly); } -static void setClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipRect) +static void setClip(TQPainter* p, const TQRect& paintDirtyRect, const TQRect& clipRect) { if (paintDirtyRect == clipRect) return; @@ -832,9 +832,9 @@ static void setClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipR p->addClip(clipRect); #else - QRect clippedRect = p->xForm(clipRect); - QRegion creg(clippedRect); - QRegion old = p->clipRegion(); + TQRect clippedRect = p->xForm(clipRect); + TQRegion creg(clippedRect); + TQRegion old = p->clipRegion(); if (!old.isNull()) creg = old.intersect(creg); p->setClipRegion(creg); @@ -842,18 +842,18 @@ static void setClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipR } -static void restoreClip(QPainter* p, const QRect& paintDirtyRect, const QRect& clipRect) +static void restoreClip(TQPainter* p, const TQRect& paintDirtyRect, const TQRect& clipRect) { if (paintDirtyRect == clipRect) return; p->restore(); } -void RenderLayer::paintLayer(RenderLayer* rootLayer, QPainter *p, - const QRect& paintDirtyRect, bool selectionOnly) +void RenderLayer::paintLayer(RenderLayer* rootLayer, TQPainter *p, + const TQRect& paintDirtyRect, bool selectionOnly) { // Calculate the clip rects we should use. - QRect layerBounds, damageRect, clipRectToApply; + TQRect layerBounds, damageRect, clipRectToApply; calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply); int x = layerBounds.x(); int y = layerBounds.y(); @@ -939,7 +939,7 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, QPainter *p, // Paint any child layers that have overflow. if (m_overflowList) - for (QValueList<RenderLayer*>::iterator it = m_overflowList->begin(); it != m_overflowList->end(); ++it) + for (TQValueList<RenderLayer*>::iterator it = m_overflowList->begin(); it != m_overflowList->end(); ++it) (*it)->paintLayer(rootLayer, p, paintDirtyRect, selectionOnly); // Now walk the sorted list of children with positive z-indices. @@ -956,7 +956,7 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, QPainter *p, int ax=0; int ay=0; renderer()->absolutePosition( ax, ay ); - p->setPen(QPen(QColor("yellow"), 1, Qt::DotLine)); + p->setPen(TQPen(TQColor("yellow"), 1, Qt::DotLine)); p->setBrush( Qt::NoBrush ); p->drawRect(ax, ay, width(), height()); } @@ -987,7 +987,7 @@ bool RenderLayer::nodeAtPoint(RenderObject::NodeInfo& info, int x, int y) sty += static_cast<RenderCanvas*>(renderer())->view()->contentsY(); } - QRect damageRect(stx,sty, width(), height()); + TQRect damageRect(stx,sty, width(), height()); RenderLayer* insideLayer = nodeAtPointForLayer(this, info, x, y, damageRect); // Now determine if the result is inside an anchor. @@ -1007,10 +1007,10 @@ bool RenderLayer::nodeAtPoint(RenderObject::NodeInfo& info, int x, int y) } RenderLayer* RenderLayer::nodeAtPointForLayer(RenderLayer* rootLayer, RenderObject::NodeInfo& info, - int xMousePos, int yMousePos, const QRect& hitTestRect) + int xMousePos, int yMousePos, const TQRect& hitTestRect) { // Calculate the clip rects we should use. - QRect layerBounds, bgRect, fgRect; + TQRect layerBounds, bgRect, fgRect; calculateRects(rootLayer, hitTestRect, layerBounds, bgRect, fgRect); // Ensure our lists are up-to-date. @@ -1035,7 +1035,7 @@ RenderLayer* RenderLayer::nodeAtPointForLayer(RenderLayer* rootLayer, RenderObje // Now check our overflow objects. if (m_overflowList) { - QValueList<RenderLayer*>::iterator it = m_overflowList->end(); + TQValueList<RenderLayer*>::iterator it = m_overflowList->end(); for (--it; it != m_overflowList->end(); --it) { insideLayer = (*it)->nodeAtPointForLayer(rootLayer, info, xMousePos, yMousePos, hitTestRect); if (insideLayer) @@ -1076,8 +1076,8 @@ RenderLayer* RenderLayer::nodeAtPointForLayer(RenderLayer* rootLayer, RenderObje return 0; } -void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, QRect& overflowClipRect, - QRect& posClipRect, QRect& fixedClipRect) +void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, TQRect& overflowClipRect, + TQRect& posClipRect, TQRect& fixedClipRect) { if (parent()) parent()->calculateClipRects(rootLayer, overflowClipRect, posClipRect, fixedClipRect); @@ -1107,13 +1107,13 @@ void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, QRect& overfl convertToLayerCoords(rootLayer, x, y); if (m_object->hasOverflowClip()) { - QRect newOverflowClip = m_object->getOverflowClipRect(x,y); + TQRect newOverflowClip = m_object->getOverflowClipRect(x,y); overflowClipRect = newOverflowClip.intersect(overflowClipRect); if (m_object->isPositioned() || m_object->isRelPositioned()) posClipRect = newOverflowClip.intersect(posClipRect); } if (m_object->hasClip()) { - QRect newPosClip = m_object->getClipRect(x,y); + TQRect newPosClip = m_object->getClipRect(x,y); posClipRect = posClipRect.intersect(newPosClip); overflowClipRect = overflowClipRect.intersect(newPosClip); fixedClipRect = fixedClipRect.intersect(newPosClip); @@ -1121,19 +1121,19 @@ void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, QRect& overfl } } -void RenderLayer::calculateRects(const RenderLayer* rootLayer, const QRect& paintDirtyRect, QRect& layerBounds, - QRect& backgroundRect, QRect& foregroundRect) +void RenderLayer::calculateRects(const RenderLayer* rootLayer, const TQRect& paintDirtyRect, TQRect& layerBounds, + TQRect& backgroundRect, TQRect& foregroundRect) { - QRect overflowClipRect = paintDirtyRect; - QRect posClipRect = paintDirtyRect; - QRect fixedClipRect = paintDirtyRect; + TQRect overflowClipRect = paintDirtyRect; + TQRect posClipRect = paintDirtyRect; + TQRect fixedClipRect = paintDirtyRect; if (parent()) parent()->calculateClipRects(rootLayer, overflowClipRect, posClipRect, fixedClipRect); int x = 0; int y = 0; convertToLayerCoords(rootLayer, x, y); - layerBounds = QRect(x,y,width(),height()); + layerBounds = TQRect(x,y,width(),height()); backgroundRect = m_object->style()->position() == FIXED ? fixedClipRect : (m_object->isPositioned() ? posClipRect : overflowClipRect); @@ -1147,7 +1147,7 @@ void RenderLayer::calculateRects(const RenderLayer* rootLayer, const QRect& pain if (m_object->hasClip()) { // Clip applies to *us* as well, so go ahead and update the damageRect. - QRect newPosClip = m_object->getClipRect(x,y); + TQRect newPosClip = m_object->getClipRect(x,y); backgroundRect = backgroundRect.intersect(newPosClip); foregroundRect = foregroundRect.intersect(newPosClip); } @@ -1158,7 +1158,7 @@ void RenderLayer::calculateRects(const RenderLayer* rootLayer, const QRect& pain } } -bool RenderLayer::intersectsDamageRect(const QRect& layerBounds, const QRect& damageRect) const +bool RenderLayer::intersectsDamageRect(const TQRect& layerBounds, const TQRect& damageRect) const { return (renderer()->isCanvas() || renderer()->isRoot() || renderer()->isBody() || (renderer()->hasOverhangingFloats() && !renderer()->hasOverflowClip()) || @@ -1166,7 +1166,7 @@ bool RenderLayer::intersectsDamageRect(const QRect& layerBounds, const QRect& da layerBounds.intersects(damageRect)); } -bool RenderLayer::containsPoint(int x, int y, const QRect& damageRect) const +bool RenderLayer::containsPoint(int x, int y, const TQRect& damageRect) const { return (renderer()->isCanvas() || renderer()->isRoot() || renderer()->isBody() || renderer()->hasOverhangingFloats() || @@ -1249,8 +1249,8 @@ void RenderLayer::updateHoverActiveState(RenderObject::NodeInfo& info) // Sort the buffer from lowest z-index to highest. The common scenario will have // most z-indices equal, so we optimize for that case (i.e., the list will be mostly // sorted already). -static void sortByZOrder(QPtrVector<RenderLayer>* buffer, - QPtrVector<RenderLayer>* mergeBuffer, +static void sortByZOrder(TQPtrVector<RenderLayer>* buffer, + TQPtrVector<RenderLayer>* mergeBuffer, uint start, uint end) { if (start >= end) @@ -1344,11 +1344,11 @@ void RenderLayer::updateZOrderLists() // Sort the two lists. if (m_posZOrderList) { - QPtrVector<RenderLayer> mergeBuffer; + TQPtrVector<RenderLayer> mergeBuffer; sortByZOrder(m_posZOrderList, &mergeBuffer, 0, m_posZOrderList->count()); } if (m_negZOrderList) { - QPtrVector<RenderLayer> mergeBuffer; + TQPtrVector<RenderLayer> mergeBuffer; sortByZOrder(m_negZOrderList, &mergeBuffer, 0, m_negZOrderList->count()); } @@ -1363,7 +1363,7 @@ void RenderLayer::updateOverflowList() for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) { if (child->isOverflowOnly()) { if (!m_overflowList) - m_overflowList = new QValueList<RenderLayer*>; + m_overflowList = new TQValueList<RenderLayer*>; m_overflowList->append(child); } } @@ -1371,7 +1371,7 @@ void RenderLayer::updateOverflowList() m_overflowListDirty = false; } -void RenderLayer::collectLayers(QPtrVector<RenderLayer>*& posBuffer, QPtrVector<RenderLayer>*& negBuffer) +void RenderLayer::collectLayers(TQPtrVector<RenderLayer>*& posBuffer, TQPtrVector<RenderLayer>*& negBuffer) { // FIXME: A child render object or layer could override visibility. Don't remove this // optimization though until RenderObject's nodeAtPoint is patched to understand what to do @@ -1383,11 +1383,11 @@ void RenderLayer::collectLayers(QPtrVector<RenderLayer>*& posBuffer, QPtrVector< if (!isOverflowOnly()) { // Determine which buffer the child should be in. - QPtrVector<RenderLayer>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; + TQPtrVector<RenderLayer>*& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; // Create the buffer if it doesn't exist yet. if (!buffer) - buffer = new QPtrVector<RenderLayer>(); + buffer = new TQPtrVector<RenderLayer>(); // Resize by a power of 2 when our buffer fills up. if (buffer->count() == buffer->size()) @@ -1407,13 +1407,13 @@ void RenderLayer::collectLayers(QPtrVector<RenderLayer>*& posBuffer, QPtrVector< #ifdef ENABLE_DUMP #ifndef KDE_USE_FINAL -static QTextStream &operator<<(QTextStream &ts, const QRect &r) +static TQTextStream &operator<<(TQTextStream &ts, const TQRect &r) { return ts << "at (" << r.x() << "," << r.y() << ") size " << r.width() << "x" << r.height(); } #endif -static void write(QTextStream &ts, RenderObject& o, const QString& indent ) +static void write(TQTextStream &ts, RenderObject& o, const TQString& indent ) { o.dump(ts, indent); @@ -1423,9 +1423,9 @@ static void write(QTextStream &ts, RenderObject& o, const QString& indent ) } } -static void write(QTextStream &ts, const RenderLayer &l, - const QRect& layerBounds, const QRect& backgroundClipRect, const QRect& clipRect, - int layerType = 0, const QString& indent = QString::null) +static void write(TQTextStream &ts, const RenderLayer &l, + const TQRect& layerBounds, const TQRect& backgroundClipRect, const TQRect& clipRect, + int layerType = 0, const TQString& indent = TQString::null) { ts << indent << "layer"; @@ -1452,11 +1452,11 @@ static void write(QTextStream &ts, const RenderLayer &l, ts << "\n"; } -static void writeLayers(QTextStream &ts, const RenderLayer* rootLayer, RenderLayer* l, - const QRect& paintDirtyRect, const QString& indent) +static void writeLayers(TQTextStream &ts, const RenderLayer* rootLayer, RenderLayer* l, + const TQRect& paintDirtyRect, const TQString& indent) { // Calculate the clip rects we should use. - QRect layerBounds, damageRect, clipRectToApply; + TQRect layerBounds, damageRect, clipRectToApply; l->calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply); // Ensure our lists are up-to-date. @@ -1464,8 +1464,8 @@ static void writeLayers(QTextStream &ts, const RenderLayer* rootLayer, RenderLay l->updateOverflowList(); bool shouldPaint = l->intersectsDamageRect(layerBounds, damageRect); - QPtrVector<RenderLayer>* negList = l->negZOrderList(); - QValueList<RenderLayer*>* ovfList = l->overflowList(); + TQPtrVector<RenderLayer>* negList = l->negZOrderList(); + TQValueList<RenderLayer*>* ovfList = l->overflowList(); if (shouldPaint && negList && negList->count() > 0) write(ts, *l, layerBounds, damageRect, clipRectToApply, -1, indent); @@ -1478,11 +1478,11 @@ static void writeLayers(QTextStream &ts, const RenderLayer* rootLayer, RenderLay write(ts, *l, layerBounds, damageRect, clipRectToApply, negList && negList->count() > 0, indent); if (ovfList) { - for (QValueList<RenderLayer*>::iterator it = ovfList->begin(); it != ovfList->end(); ++it) + for (TQValueList<RenderLayer*>::iterator it = ovfList->begin(); it != ovfList->end(); ++it) writeLayers(ts, rootLayer, *it, paintDirtyRect, indent); } - QPtrVector<RenderLayer>* posList = l->posZOrderList(); + TQPtrVector<RenderLayer>* posList = l->posZOrderList(); if (posList) { for (unsigned i = 0; i != posList->count(); ++i) writeLayers(ts, rootLayer, posList->at(i), paintDirtyRect, indent); @@ -1490,11 +1490,11 @@ static void writeLayers(QTextStream &ts, const RenderLayer* rootLayer, RenderLay } -void RenderLayer::dump(QTextStream &ts, const QString &ind) +void RenderLayer::dump(TQTextStream &ts, const TQString &ind) { assert( renderer()->isCanvas() ); - writeLayers(ts, this, this, QRect(xPos(), yPos(), width(), height()), ind); + writeLayers(ts, this, this, TQRect(xPos(), yPos(), width(), height()), ind); } @@ -1757,7 +1757,7 @@ void Marquee::updateMarqueeStyle() } } -void Marquee::timerEvent(QTimerEvent* /*evt*/) +void Marquee::timerEvent(TQTimerEvent* /*evt*/) { if (m_layer->renderer()->needsLayout()) return; diff --git a/khtml/rendering/render_layer.h b/khtml/rendering/render_layer.h index c7587ae39..1f94ac95c 100644 --- a/khtml/rendering/render_layer.h +++ b/khtml/rendering/render_layer.h @@ -44,8 +44,8 @@ #ifndef render_layer_h #define render_layer_h -#include <qcolor.h> -#include <qrect.h> +#include <tqcolor.h> +#include <tqrect.h> #include <assert.h> #include "render_object.h" @@ -85,7 +85,7 @@ class Marquee: public QObject public: Marquee(RenderLayer* l); - void timerEvent(QTimerEvent*); + void timerEvent(TQTimerEvent*); int speed() const { return m_speed; } int marqueeSpeed() const; @@ -128,7 +128,7 @@ class RenderLayer { public: #ifdef APPLE_CHANGES - static QScrollBar* gScrollBar; + static TQScrollBar* gScrollBar; #endif RenderLayer(RenderObject* object); @@ -194,11 +194,11 @@ public: void scrollToXOffset(int x) { scrollToOffset(x, m_scrollY); } void scrollToYOffset(int y) { scrollToOffset(m_scrollX, y); } void showScrollbar(Qt::Orientation, bool); - QScrollBar* horizontalScrollbar() { return m_hBar; } - QScrollBar* verticalScrollbar() { return m_vBar; } + TQScrollBar* horizontalScrollbar() { return m_hBar; } + TQScrollBar* verticalScrollbar() { return m_vBar; } int verticalScrollbarWidth(); int horizontalScrollbarHeight(); - void positionScrollbars(const QRect &damageRect); + void positionScrollbars(const TQRect &damageRect); void paintScrollbars(RenderObject::PaintInfo& pI); void checkScrollbarsAfterLayout(); void slotValueChanged(int); @@ -215,17 +215,17 @@ public: void dirtyZOrderLists(); void updateZOrderLists(); - QPtrVector<RenderLayer>* posZOrderList() const { return m_posZOrderList; } - QPtrVector<RenderLayer>* negZOrderList() const { return m_negZOrderList; } + TQPtrVector<RenderLayer>* posZOrderList() const { return m_posZOrderList; } + TQPtrVector<RenderLayer>* negZOrderList() const { return m_negZOrderList; } void dirtyOverflowList(); void updateOverflowList(); - QValueList<RenderLayer*>* overflowList() const { return m_overflowList; } + TQValueList<RenderLayer*>* overflowList() const { return m_overflowList; } void setHasOverlaidWidgets(bool b=true) { m_hasOverlaidWidgets = b; } bool hasOverlaidWidgets() const { return m_hasOverlaidWidgets; } - QRegion getMask() const { return m_region; } - QRegion paintedRegion(RenderLayer* rootLayer); + TQRegion getMask() const { return m_region; } + TQRegion paintedRegion(RenderLayer* rootLayer); void updateWidgetMasks(RenderLayer* rootLayer); // Gets the nearest enclosing positioned ancestor layer (also includes @@ -241,26 +241,26 @@ public: // paints the layers that intersect the damage rect from back to // front. The nodeAtPoint method looks for mouse events by walking // layers that intersect the point from front to back. - KDE_EXPORT void paint(QPainter *p, const QRect& damageRect, bool selectionOnly=false); + KDE_EXPORT void paint(TQPainter *p, const TQRect& damageRect, bool selectionOnly=false); bool nodeAtPoint(RenderObject::NodeInfo& info, int x, int y); // This method figures out our layerBounds in coordinates relative to // |rootLayer}. It also computes our background and foreground clip rects // for painting/event handling. - void calculateRects(const RenderLayer* rootLayer, const QRect& paintDirtyRect, QRect& layerBounds, - QRect& backgroundRect, QRect& foregroundRect); - void calculateClipRects(const RenderLayer* rootLayer, QRect& overflowClipRect, - QRect& posClipRect, QRect& fixedClipRect); + void calculateRects(const RenderLayer* rootLayer, const TQRect& paintDirtyRect, TQRect& layerBounds, + TQRect& backgroundRect, TQRect& foregroundRect); + void calculateClipRects(const RenderLayer* rootLayer, TQRect& overflowClipRect, + TQRect& posClipRect, TQRect& fixedClipRect); - bool intersectsDamageRect(const QRect& layerBounds, const QRect& damageRect) const; - bool containsPoint(int x, int y, const QRect& damageRect) const; + bool intersectsDamageRect(const TQRect& layerBounds, const TQRect& damageRect) const; + bool containsPoint(int x, int y, const TQRect& damageRect) const; void updateHoverActiveState(RenderObject::NodeInfo& info); void detach(RenderArena* renderArena); #ifdef ENABLE_DUMP - KDE_EXPORT void dump(QTextStream &stream, const QString &ind = QString::null); + KDE_EXPORT void dump(TQTextStream &stream, const TQString &ind = TQString::null); #endif // Overloaded new operator. Derived classes must override operator new @@ -281,11 +281,11 @@ private: void setFirstChild(RenderLayer* first) { m_first = first; } void setLastChild(RenderLayer* last) { m_last = last; } - void collectLayers(QPtrVector<RenderLayer>*&, QPtrVector<RenderLayer>*&); + void collectLayers(TQPtrVector<RenderLayer>*&, TQPtrVector<RenderLayer>*&); - KDE_EXPORT void paintLayer(RenderLayer* rootLayer, QPainter *p, const QRect& paintDirtyRect, bool selectionOnly=false); + KDE_EXPORT void paintLayer(RenderLayer* rootLayer, TQPainter *p, const TQRect& paintDirtyRect, bool selectionOnly=false); RenderLayer* nodeAtPointForLayer(RenderLayer* rootLayer, RenderObject::NodeInfo& info, - int x, int y, const QRect& hitTestRect); + int x, int y, const TQRect& hitTestRect); bool shouldBeOverflowOnly() const; protected: @@ -311,19 +311,19 @@ protected: int m_scrollHeight; // For layers with overflow, we have a pair of scrollbars. - QScrollBar* m_hBar; - QScrollBar* m_vBar; + TQScrollBar* m_hBar; + TQScrollBar* m_vBar; RenderScrollMediator* m_scrollMediator; // For layers that establish stacking contexts, m_posZOrderList holds a sorted list of all the // descendant layers within the stacking context that have z-indices of 0 or greater // (auto will count as 0). m_negZOrderList holds descendants within our stacking context with negative // z-indices. - QPtrVector<RenderLayer>* m_posZOrderList; - QPtrVector<RenderLayer>* m_negZOrderList; + TQPtrVector<RenderLayer>* m_posZOrderList; + TQPtrVector<RenderLayer>* m_negZOrderList; // This list contains our overflow child layers. - QValueList<RenderLayer*>* m_overflowList; + TQValueList<RenderLayer*>* m_overflowList; bool m_zOrderListsDirty: 1; bool m_overflowListDirty: 1; @@ -331,9 +331,9 @@ protected: bool m_markedForRepaint: 1; bool m_hasOverlaidWidgets: 1; - QRect m_visibleRect; + TQRect m_visibleRect; - QRegion m_region; // used by overlaid (non z-order aware) widgets + TQRegion m_region; // used by overlaid (non z-order aware) widgets Marquee* m_marquee; // Used by layers with overflow:marquee }; diff --git a/khtml/rendering/render_line.cpp b/khtml/rendering/render_line.cpp index 18a5f5101..f3b769e9c 100644 --- a/khtml/rendering/render_line.cpp +++ b/khtml/rendering/render_line.cpp @@ -23,7 +23,7 @@ #include <kdebug.h> #include <assert.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kglobal.h> #include "rendering/render_flow.h" @@ -102,7 +102,7 @@ void InlineBox::operator delete(void* ptr, size_t sz) static bool needsOutlinePhaseRepaint(RenderObject* o, RenderObject::PaintInfo& i, int tx, int ty) { if (o->style()->outlineWidth() <= 0) return false; - QRect r(tx+o->xPos(),ty+o->yPos(),o->width(),o->height()); + TQRect r(tx+o->xPos(),ty+o->yPos(),o->width(),o->height()); if (r.intersects(i.r)) return false; r.addCoords(-o->style()->outlineSize(), @@ -184,8 +184,8 @@ bool InlineBox::canAccommodateEllipsisBox(bool ltr, int blockEdge, int ellipsisW if (!m_object || !m_object->isReplaced()) return true; - QRect boxRect(m_x, 0, m_width, 10); - QRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, ellipsisWidth, 10); + TQRect boxRect(m_x, 0, m_width, 10); + TQRect ellipsisRect(ltr ? blockEdge - ellipsisWidth : blockEdge, 0, ellipsisWidth, 10); return !(boxRect.intersects(ellipsisRect)); } @@ -539,7 +539,7 @@ void InlineFlowBox::placeBoxesVertically(int y, int maxHeight, int maxAscent, bo int overflowTop = 0; int overflowBottom = 0; if (curr->isInlineTextBox() || curr->isInlineFlowBox()) { - const QFontMetrics &fm = curr->object()->fontMetrics( m_firstLine ); + const TQFontMetrics &fm = curr->object()->fontMetrics( m_firstLine ); #ifdef APPLE_CHANGES newBaseline = fm.ascent(); newY += curr->baseline() - newBaseline; @@ -580,7 +580,7 @@ void InlineFlowBox::placeBoxesVertically(int y, int maxHeight, int maxAscent, bo } if (isRootInlineBox()) { - const QFontMetrics &fm = object()->fontMetrics( m_firstLine ); + const TQFontMetrics &fm = object()->fontMetrics( m_firstLine ); #ifdef APPLE_CHANGES setHeight(fm.ascent()+fm.descent()); setYPos(yPos() + baseline() - fm.ascent()); @@ -635,7 +635,7 @@ bool InlineFlowBox::nodeAtPoint(RenderObject::NodeInfo& i, int x, int y, int tx, } // Now check ourselves. - QRect rect(tx + m_x, ty + m_y, m_width, m_height); + TQRect rect(tx + m_x, ty + m_y, m_width, m_height); if (object()->style()->visibility() == VISIBLE && rect.contains(x, y)) { object()->setInnerNode(i); return true; @@ -660,7 +660,7 @@ void InlineFlowBox::paint(RenderObject::PaintInfo& i, int tx, int ty) if (object()->style()->visibility() == VISIBLE && object()->style()->outlineWidth() > 0 && !object()->isInlineContinuation() && !isRootInlineBox()) { if (!i.outlineObjects) - i.outlineObjects = new QValueList<RenderFlow*>; + i.outlineObjects = new TQValueList<RenderFlow*>; i.outlineObjects->append(static_cast<RenderFlow*>(object())); } } @@ -685,7 +685,7 @@ void InlineFlowBox::paint(RenderObject::PaintInfo& i, int tx, int ty) } -void InlineFlowBox::paintBackgrounds(QPainter* p, const QColor& c, const BackgroundLayer* bgLayer, +void InlineFlowBox::paintBackgrounds(TQPainter* p, const TQColor& c, const BackgroundLayer* bgLayer, int my, int mh, int _tx, int _ty, int w, int h) { if (!bgLayer) @@ -694,7 +694,7 @@ void InlineFlowBox::paintBackgrounds(QPainter* p, const QColor& c, const Backgro paintBackground(p, c, bgLayer, my, mh, _tx, _ty, w, h); } -void InlineFlowBox::paintBackground(QPainter* p, const QColor& c, const BackgroundLayer* bgLayer, +void InlineFlowBox::paintBackground(TQPainter* p, const TQColor& c, const BackgroundLayer* bgLayer, int my, int mh, int _tx, int _ty, int w, int h) { CachedImage* bg = bgLayer->backgroundImage(); @@ -719,7 +719,7 @@ void InlineFlowBox::paintBackground(QPainter* p, const QColor& c, const Backgrou for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox()) totalWidth += curr->width(); p->save(); - p->setClipRect(QRect(_tx, _ty, width(), height()), QPainter::CoordPainter); + p->setClipRect(TQRect(_tx, _ty, width(), height()), TQPainter::CoordPainter); object()->paintBackgroundExtended(p, c, bgLayer, my, mh, startX, _ty, totalWidth, h, borderLeft(), borderRight(), paddingLeft(), paddingRight()); p->restore(); @@ -750,7 +750,7 @@ void InlineFlowBox::paintBackgroundAndBorder(RenderObject::PaintInfo& pI, int _t RenderStyle* styleToUse = object()->style(m_firstLine); if ((!parent() && m_firstLine && styleToUse != object()->style()) || (parent() && object()->shouldPaintBackgroundOrBorder())) { - QColor c = styleToUse->backgroundColor(); + TQColor c = styleToUse->backgroundColor(); paintBackgrounds(pI.p, c, styleToUse->backgroundLayers(), my, mh, _tx, _ty, w, h); // :first-line cannot be used to put borders on a line. Always paint borders with our @@ -797,10 +797,10 @@ void InlineFlowBox::paintDecorations(RenderObject::PaintInfo& pI, int _tx, int _ int w = m_width - (borderLeft() + paddingLeft() + borderRight() + paddingRight()); if ( !w ) return; - const QFontMetrics &fm = object()->fontMetrics( m_firstLine ); + const TQFontMetrics &fm = object()->fontMetrics( m_firstLine ); // thick lines on small fonts look ugly int thickness = fm.height() > 20 ? fm.lineWidth() : 1; - QColor underline, overline, linethrough; + TQColor underline, overline, linethrough; underline = overline = linethrough = styleToUse->color(); if (!parent()) object()->getTextDecorationColors(deco, underline, overline, linethrough); @@ -851,13 +851,13 @@ void InlineFlowBox::clearTruncation() void EllipsisBox::paint(RenderObject::PaintInfo& i, int _tx, int _ty) { - QPainter* p = i.p; + TQPainter* p = i.p; RenderStyle* _style = m_firstLine ? m_object->style(true) : m_object->style(); if (_style->font() != p->font()) p->setFont(_style->font()); const Font* font = &_style->htmlFont(); - QColor textColor = _style->color(); + TQColor textColor = _style->color(); if (textColor != p->pen().color()) p->setPen(textColor); /* @@ -874,7 +874,7 @@ void EllipsisBox::paint(RenderObject::PaintInfo& i, int _tx, int _ty) (str.implementation())->s, str.length(), 0, str.length(), 0, - QPainter::LTR, _style->visuallyOrdered()); + TQPainter::LTR, _style->visuallyOrdered()); /* if (setShadow) @@ -901,7 +901,7 @@ bool EllipsisBox::nodeAtPoint(RenderObject::NodeInfo& info, int _x, int _y, int } } - QRect rect(_tx + m_x, _ty + m_y, m_width, m_height); + TQRect rect(_tx + m_x, _ty + m_y, m_width, m_height); if (object()->style()->visibility() == VISIBLE && rect.contains(_x, _y)) { object()->setInnerNode(info); return true; diff --git a/khtml/rendering/render_line.h b/khtml/rendering/render_line.h index 43603d362..d42f2acb8 100644 --- a/khtml/rendering/render_line.h +++ b/khtml/rendering/render_line.h @@ -205,9 +205,9 @@ public: void removeFromLine(InlineBox* child); virtual void paintBackgroundAndBorder(RenderObject::PaintInfo&, int _tx, int _ty); - void paintBackgrounds(QPainter* p, const QColor& c, const BackgroundLayer* bgLayer, + void paintBackgrounds(TQPainter* p, const TQColor& c, const BackgroundLayer* bgLayer, int my, int mh, int _tx, int _ty, int w, int h); - void paintBackground(QPainter* p, const QColor& c, const BackgroundLayer* bgLayer, + void paintBackground(TQPainter* p, const TQColor& c, const BackgroundLayer* bgLayer, int my, int mh, int _tx, int _ty, int w, int h); virtual void paint(RenderObject::PaintInfo& i, int _tx, int _ty); virtual void paintDecorations(RenderObject::PaintInfo&, int _tx, int _ty, bool paintedChildren = false); diff --git a/khtml/rendering/render_list.cpp b/khtml/rendering/render_list.cpp index 139201e03..b08ec6eb9 100644 --- a/khtml/rendering/render_list.cpp +++ b/khtml/rendering/render_list.cpp @@ -36,7 +36,7 @@ #include <kdebug.h> #include <kglobal.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> //#define BOX_DEBUG @@ -238,12 +238,12 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int _tx, int _ty) if(shouldPaintBackgroundOrBorder()) paintBoxDecorations(paintInfo, _tx, _ty); - QPainter* p = paintInfo.p; + TQPainter* p = paintInfo.p; #ifdef DEBUG_LAYOUT kdDebug( 6040 ) << nodeName().string() << "(ListMarker)::paintObject(" << _tx << ", " << _ty << ")" << endl; #endif p->setFont(style()->font()); - const QFontMetrics fm = p->fontMetrics(); + const TQFontMetrics fm = p->fontMetrics(); // The marker needs to adjust its tx, for the case where it's an outside marker. @@ -294,7 +294,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int _tx, int _ty) xoff += haveImage ? cMarkerPadding : (m_width - bulletWidth); if ( m_listImage && !m_listImage->isErrorImage()) { - p->drawPixmap( QPoint( _tx + xoff, _ty ), m_listImage->pixmap()); + p->drawPixmap( TQPoint( _tx + xoff, _ty ), m_listImage->pixmap()); return; } @@ -303,7 +303,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int _tx, int _ty) p->drawRect( _tx + xoff, _ty + yoff, offset, offset ); #endif - const QColor color( style()->color() ); + const TQColor color( style()->color() ); p->setPen( color ); switch(style()->listStyleType()) { @@ -324,14 +324,14 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int _tx, int _ty) p->drawRect( _tx + xoff, _ty + (3 * yoff)/2, (offset>>1)+1, (offset>>1)+1 ); return; case LDIAMOND: { - static QPointArray diamond(4); + static TQPointArray diamond(4); int x = _tx + xoff; int y = _ty + (3 * yoff)/2 - 1; int s = (offset>>2)+1; - diamond[0] = QPoint(x+s, y); - diamond[1] = QPoint(x+2*s, y+s); - diamond[2] = QPoint(x+s, y+2*s); - diamond[3] = QPoint(x, y+s); + diamond[0] = TQPoint(x+s, y); + diamond[1] = TQPoint(x+2*s, y+s); + diamond[2] = TQPoint(x+s, y+2*s); + diamond[3] = TQPoint(x, y+s); p->setBrush( color ); p->drawConvexPolygon( diamond, 0, 4 ); return; @@ -344,21 +344,21 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int _tx, int _ty) if( style()->direction() == LTR) { p->drawText(_tx, _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item); p->drawText(_tx + fm.width(m_item), _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, - QString::fromLatin1(". ")); + TQString::fromLatin1(". ")); } else { - const QString& punct(QString::fromLatin1(" .")); + const TQString& punct(TQString::fromLatin1(" .")); p->drawText(_tx, _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, punct); p->drawText(_tx + fm.width(punct), _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item); } } else { if (style()->direction() == LTR) { - const QString& punct(QString::fromLatin1(". ")); + const TQString& punct(TQString::fromLatin1(". ")); p->drawText(_tx-offset/2, _ty, 0, 0, Qt::AlignRight|Qt::DontClip, punct); p->drawText(_tx-offset/2-fm.width(punct), _ty, 0, 0, Qt::AlignRight|Qt::DontClip, m_item); } else { - const QString& punct(QString::fromLatin1(" .")); + const TQString& punct(TQString::fromLatin1(" .")); p->drawText(_tx+offset/2, _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, punct); p->drawText(_tx+offset/2+fm.width(punct), _ty, 0, 0, Qt::AlignLeft|Qt::DontClip, m_item); } @@ -377,7 +377,7 @@ void RenderListMarker::layout() setNeedsLayout(false); } -void RenderListMarker::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o) +void RenderListMarker::setPixmap( const TQPixmap &p, const TQRect& r, CachedImage *o) { if(o != m_listImage) { RenderBox::setPixmap(p, r, o); @@ -406,7 +406,7 @@ void RenderListMarker::calcMinMaxWidth() return; } - const QFontMetrics &fm = style()->fontMetrics(); + const TQFontMetrics &fm = style()->fontMetrics(); m_height = fm.ascent(); // Skip uncounted elements @@ -452,7 +452,7 @@ void RenderListMarker::calcMinMaxWidth() decimals++; } decimals = kMax(decimals, 2); - QString num = QString::number(value); + TQString num = TQString::number(value); m_item.fill('0',decimals-num.length()); m_item.append(num); break; @@ -543,7 +543,7 @@ void RenderListMarker::calcMinMaxWidth() default: KHTMLAssert(false); } - m_markerWidth = fm.width(m_item) + fm.width(QString::fromLatin1(". ")); + m_markerWidth = fm.width(m_item) + fm.width(TQString::fromLatin1(". ")); } end: diff --git a/khtml/rendering/render_list.h b/khtml/rendering/render_list.h index ff4e24842..b70132671 100644 --- a/khtml/rendering/render_list.h +++ b/khtml/rendering/render_list.h @@ -99,7 +99,7 @@ public: virtual short lineHeight( bool firstLine ) const; virtual short baselinePosition( bool firstLine ) const; - virtual void setPixmap( const QPixmap &, const QRect&, CachedImage *); + virtual void setPixmap( const TQPixmap &, const TQRect&, CachedImage *); virtual void calcWidth(); @@ -116,7 +116,7 @@ public: protected: friend class RenderListItem; - QString m_item; + TQString m_item; CachedImage *m_listImage; short m_markerWidth; RenderListItem* m_listItem; diff --git a/khtml/rendering/render_object.cpp b/khtml/rendering/render_object.cpp index dfb2e06df..c1f7fd754 100644 --- a/khtml/rendering/render_object.cpp +++ b/khtml/rendering/render_object.cpp @@ -46,7 +46,7 @@ #include <kdebug.h> #include <kglobal.h> -#include <qpainter.h> +#include <tqpainter.h> #include "khtmlview.h" #include <khtml_part.h> @@ -528,7 +528,7 @@ bool RenderObject::hasStaticY() const return (style()->top().isVariable() && style()->bottom().isVariable()); } -void RenderObject::setPixmap(const QPixmap&, const QRect& /*r*/, CachedImage* image) +void RenderObject::setPixmap(const TQPixmap&, const TQRect& /*r*/, CachedImage* image) { //repaint bg when it finished loading if(image && parent() && style() && style()->backgroundLayers()->containsImage(image)) { @@ -688,7 +688,7 @@ static int brightness(int red, int green, int blue) (luminosity * LUMINOSITY_FACTOR)) / 100; } -static void calc3DColor(QColor &color, bool darken) +static void calc3DColor(TQColor &color, bool darken) { int rb = color.red(); int gb = color.green(); @@ -731,8 +731,8 @@ static void calc3DColor(QColor &color, bool darken) } } -void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2, - BorderSide s, QColor c, const QColor& textcolor, EBorderStyle style, +void RenderObject::drawBorder(TQPainter *p, int x1, int y1, int x2, int y2, + BorderSide s, TQColor c, const TQColor& textcolor, EBorderStyle style, int adjbw1, int adjbw2, bool invalidisInvert) { int width = (s==BSTop||s==BSBottom?y2-y1:x2-x1); @@ -768,7 +768,7 @@ void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2, case DOTTED: if ( width == 1 ) { // workaround Qt brokenness - p->setPen(QPen(c, width, Qt::SolidLine)); + p->setPen(TQPen(c, width, Qt::SolidLine)); switch(s) { case BSBottom: case BSTop: @@ -783,11 +783,11 @@ void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2, break; } - p->setPen(QPen(c, width, Qt::DotLine)); + p->setPen(TQPen(c, width, Qt::DotLine)); /* nobreak; */ case DASHED: if(style == DASHED) - p->setPen(QPen(c, width == 1 ? 0 : width, width == 1 ? Qt::DotLine : Qt::DashLine)); + p->setPen(TQPen(c, width == 1 ? 0 : width, width == 1 ? Qt::DotLine : Qt::DashLine)); if (width > 0) switch(s) { @@ -924,7 +924,7 @@ void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2, p->drawRect(x1,y1,x2-x1,y2-y1); return; } - QPointArray quad(4); + TQPointArray quad(4); switch(s) { case BSTop: quad.setPoints(4, @@ -963,12 +963,12 @@ void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2, p->setRasterOp(Qt::CopyROP); } -void RenderObject::paintBorder(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style, bool begin, bool end) +void RenderObject::paintBorder(TQPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style, bool begin, bool end) { - const QColor& tc = style->borderTopColor(); - const QColor& bc = style->borderBottomColor(); - const QColor& lc = style->borderLeftColor(); - const QColor& rc = style->borderRightColor(); + const TQColor& tc = style->borderTopColor(); + const TQColor& bc = style->borderBottomColor(); + const TQColor& lc = style->borderLeftColor(); + const TQColor& rc = style->borderRightColor(); bool tt = style->borderTopIsTransparent(); bool bt = style->borderBottomIsTransparent(); @@ -1052,12 +1052,12 @@ void RenderObject::paintBorder(QPainter *p, int _tx, int _ty, int w, int h, cons } } -void RenderObject::paintOutline(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style) +void RenderObject::paintOutline(TQPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style) { int ow = style->outlineWidth(); if(!ow) return; - const QColor& oc = style->outlineColor(); + const TQColor& oc = style->outlineColor(); EBorderStyle os = style->outlineStyle(); int offset = style->outlineOffset(); @@ -1077,19 +1077,19 @@ void RenderObject::paintOutline(QPainter *p, int _tx, int _ty, int w, int h, con h += 2*offset; drawBorder(p, _tx-ow, _ty-ow, _tx, _ty+h+ow, BSLeft, - QColor(oc), style->color(), + TQColor(oc), style->color(), os, ow, ow, true); drawBorder(p, _tx-ow, _ty-ow, _tx+w+ow, _ty, BSTop, - QColor(oc), style->color(), + TQColor(oc), style->color(), os, ow, ow, true); drawBorder(p, _tx+w, _ty-ow, _tx+w+ow, _ty+h+ow, BSRight, - QColor(oc), style->color(), + TQColor(oc), style->color(), os, ow, ow, true); drawBorder(p, _tx-ow, _ty+h, _tx+w+ow, _ty+h+ow, BSBottom, - QColor(oc), style->color(), + TQColor(oc), style->color(), os, ow, ow, true); } @@ -1105,14 +1105,14 @@ void RenderObject::repaintRectangle(int x, int y, int w, int h, Priority p, bool #ifdef ENABLE_DUMP -QString RenderObject::information() const +TQString RenderObject::information() const { - QString str; + TQString str; int x; int y; absolutePosition(x,y); x += inlineXPos(); y += inlineYPos(); - QTextStream ts( &str, IO_WriteOnly ); + TQTextStream ts( &str, IO_WriteOnly ); ts << renderName() << "(" << (style() ? style()->refCount() : 0) << ")" << ": " << (void*)this << " "; @@ -1139,7 +1139,7 @@ QString RenderObject::information() const } else if (isPseudoAnonymous() && style() && style()->styleType() != RenderStyle::NOPSEUDO) { ts << " <" << getTagName(node()->id()); - QString pseudo; + TQString pseudo; switch (style()->styleType()) { case RenderStyle::FIRST_LETTER: pseudo = ":first-letter"; break; @@ -1159,27 +1159,27 @@ QString RenderObject::information() const << " mB: " << marginBottom() << " qB: " << isBottomMarginQuirk() << "}" << (isTableCell() ? - ( QString::fromLatin1(" [r=") + - QString::number( static_cast<const RenderTableCell *>(this)->row() ) + - QString::fromLatin1(" c=") + - QString::number( static_cast<const RenderTableCell *>(this)->col() ) + - QString::fromLatin1(" rs=") + - QString::number( static_cast<const RenderTableCell *>(this)->rowSpan() ) + - QString::fromLatin1(" cs=") + - QString::number( static_cast<const RenderTableCell *>(this)->colSpan() ) + - QString::fromLatin1("]") ) : QString::null ); + ( TQString::fromLatin1(" [r=") + + TQString::number( static_cast<const RenderTableCell *>(this)->row() ) + + TQString::fromLatin1(" c=") + + TQString::number( static_cast<const RenderTableCell *>(this)->col() ) + + TQString::fromLatin1(" rs=") + + TQString::number( static_cast<const RenderTableCell *>(this)->rowSpan() ) + + TQString::fromLatin1(" cs=") + + TQString::number( static_cast<const RenderTableCell *>(this)->colSpan() ) + + TQString::fromLatin1("]") ) : TQString::null ); if ( layer() ) ts << " layer=" << layer(); if ( continuation() ) ts << " continuation=" << continuation(); if (isText()) - ts << " \"" << QConstString(static_cast<const RenderText *>(this)->text(), kMin(static_cast<const RenderText *>(this)->length(), 10u)).string() << "\""; + ts << " \"" << TQConstString(static_cast<const RenderText *>(this)->text(), kMin(static_cast<const RenderText *>(this)->length(), 10u)).string() << "\""; return str; } void RenderObject::printTree(int indent) const { - QString ind; + TQString ind; ind.fill(' ', indent); kdDebug() << ind << information() << endl; @@ -1192,17 +1192,17 @@ void RenderObject::printTree(int indent) const } } -static QTextStream &operator<<(QTextStream &ts, const QRect &r) +static TQTextStream &operator<<(TQTextStream &ts, const TQRect &r) { return ts << "at (" << r.x() << "," << r.y() << ") size " << r.width() << "x" << r.height(); } //A bit like getTagName, but handles XML, too. -static QString lookupTagName(NodeImpl* node) { +static TQString lookupTagName(NodeImpl* node) { return node->getDocument()->getName(NodeImpl::ElementId, node->id()).string(); } -void RenderObject::dump(QTextStream &ts, const QString &ind) const +void RenderObject::dump(TQTextStream &ts, const TQString &ind) const { if ( !layer() ) ts << endl; @@ -1214,13 +1214,13 @@ void RenderObject::dump(QTextStream &ts, const QString &ind) const } if (element()) { - QString tagName(lookupTagName(element())); + TQString tagName(lookupTagName(element())); if (!tagName.isEmpty()) { ts << " {" << tagName << "}"; } } else if (isPseudoAnonymous() && style() && style()->styleType() != RenderStyle::NOPSEUDO) { - QString pseudo; - QString tagName(lookupTagName(node())); + TQString pseudo; + TQString tagName(lookupTagName(node())); switch (style()->styleType()) { case RenderStyle::FIRST_LETTER: pseudo = ":first-letter"; break; @@ -1234,7 +1234,7 @@ void RenderObject::dump(QTextStream &ts, const QString &ind) const ts << " {" << tagName << pseudo << "}"; } - QRect r(xPos(), yPos(), width(), height()); + TQRect r(xPos(), yPos(), width(), height()); ts << " " << r; if ( parent() ) @@ -1481,7 +1481,7 @@ void RenderObject::updateBackgroundImages(RenderStyle* oldStyle) } } -QRect RenderObject::viewRect() const +TQRect RenderObject::viewRect() const { return containingBlock()->viewRect(); } @@ -1705,7 +1705,7 @@ FindSelectionResult RenderObject::checkSelectionPoint( int _x, int _y, int _tx, if (child->isText() && !static_cast<RenderText *>(child)->inlineTextBoxCount()) continue; -// kdDebug(6040) << "iterating " << (child ? child->renderName() : "") << "@" << child << (child->isText() ? " contains: \"" + QConstString(static_cast<RenderText *>(child)->text(), kMin(static_cast<RenderText *>(child)->length(), 10u)).string() + "\"" : QString::null) << endl; +// kdDebug(6040) << "iterating " << (child ? child->renderName() : "") << "@" << child << (child->isText() ? " contains: \"" + TQConstString(static_cast<RenderText *>(child)->text(), kMin(static_cast<RenderText *>(child)->length(), 10u)).string() + "\"" : TQString::null) << endl; // kdDebug(6040) << "---------- checkSelectionPoint recursive -----------" << endl; khtml::FindSelectionResult pos = child->checkSelectionPoint(_x, _y, _tx+xPos(), _ty+yPos(), nod, off, state); // kdDebug(6040) << "-------- end checkSelectionPoint recursive ---------" << endl; @@ -1773,7 +1773,7 @@ bool RenderObject::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, if ( !inOverflowRect ) { int ol = overflowLeft(); int ot = overflowTop(); - QRect overflowRect( tx+ol, ty+ot, overflowWidth()-ol, overflowHeight()-ot ); + TQRect overflowRect( tx+ol, ty+ot, overflowWidth()-ol, overflowHeight()-ot ); inOverflowRect = overflowRect.contains( _x, _y ); } @@ -1851,7 +1851,7 @@ short RenderObject::getVerticalPosition( bool firstLine, RenderObject* ref ) con else if ( va == LENGTH ) return vpos - style()->verticalAlignLength().width( lineHeight( firstLine ) ); - const QFont &f = ref->font( firstLine ); + const TQFont &f = ref->font( firstLine ); int fontsize = f.pixelSize(); if ( va == SUB ) @@ -1859,12 +1859,12 @@ short RenderObject::getVerticalPosition( bool firstLine, RenderObject* ref ) con else if ( va == SUPER ) vpos -= fontsize/3 + 1; else if ( va == TEXT_TOP ) { - vpos += baselinePosition( firstLine ) - (QFontMetrics(f).ascent() + QFontMetrics(f).leading()/2); + vpos += baselinePosition( firstLine ) - (TQFontMetrics(f).ascent() + TQFontMetrics(f).leading()/2); } else if ( va == MIDDLE ) { - QRect b = QFontMetrics(f).boundingRect('x'); + TQRect b = TQFontMetrics(f).boundingRect('x'); vpos += -b.height()/2 - lineHeight( firstLine )/2 + baselinePosition( firstLine ); } else if ( va == TEXT_BOTTOM ) { - vpos += QFontMetrics(f).descent() + QFontMetrics(f).leading()/2; + vpos += TQFontMetrics(f).descent() + TQFontMetrics(f).leading()/2; if ( !isReplaced() ) vpos -= fontMetrics(firstLine).descent(); } else if ( va == BASELINE_MIDDLE ) @@ -1914,7 +1914,7 @@ short RenderObject::baselinePosition( bool firstLine ) const if (isReplaced() && (!isInlineBlockOrInlineTable() || !needsLayout())) return height()+marginTop()+marginBottom(); - const QFontMetrics &fm = fontMetrics( firstLine ); + const TQFontMetrics &fm = fontMetrics( firstLine ); return fm.ascent() + ( lineHeight( firstLine) - fm.height() ) / 2; } @@ -1985,8 +1985,8 @@ InlineBox* RenderObject::createInlineBox(bool /*makePlaceHolderBox*/, bool /*isR return 0; } -void RenderObject::getTextDecorationColors(int decorations, QColor& underline, QColor& overline, - QColor& linethrough, bool quirksMode) +void RenderObject::getTextDecorationColors(int decorations, TQColor& underline, TQColor& overline, + TQColor& linethrough, bool quirksMode) { RenderObject* curr = this; do { @@ -2031,7 +2031,7 @@ int RenderObject::maximalOutlineSize(PaintAction p) const return static_cast<RenderCanvas*>(document()->renderer())->maximalOutlineSize(); } -void RenderObject::collectBorders(QValueList<CollapsedBorderValue>& borderStyles) +void RenderObject::collectBorders(TQValueList<CollapsedBorderValue>& borderStyles) { for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) curr->collectBorders(borderStyles); @@ -2052,7 +2052,7 @@ bool RenderObject::usesLineWidth() const return (flowAroundFloats() && (style()->width().isVariable() || isHR() || (style()->htmlHacks() && !isTable()))); } -bool RenderObject::hasCounter(const QString& counter) const +bool RenderObject::hasCounter(const TQString& counter) const { if (style() && (!isText() || isCounter())) { if (lookupCounter(counter)) return true; @@ -2078,7 +2078,7 @@ bool RenderObject::hasCounter(const QString& counter) const return false; } -CounterNode* RenderObject::getCounter(const QString& counter, bool view, bool counters) +CounterNode* RenderObject::getCounter(const TQString& counter, bool view, bool counters) { // kdDebug( 6040 ) << renderName() << " getCounter(" << counter << ")" << endl; @@ -2214,9 +2214,9 @@ CounterNode* RenderObject::getCounter(const QString& counter, bool view, bool co return i; } -CounterNode* RenderObject::lookupCounter(const QString& counter) const +CounterNode* RenderObject::lookupCounter(const TQString& counter) const { - QDict<khtml::CounterNode>* counters = document()->counters(this); + TQDict<khtml::CounterNode>* counters = document()->counters(this); if (counters) return counters->find(counter); else @@ -2225,10 +2225,10 @@ CounterNode* RenderObject::lookupCounter(const QString& counter) const void RenderObject::detachCounters() { - QDict<khtml::CounterNode>* counters = document()->counters(this); + TQDict<khtml::CounterNode>* counters = document()->counters(this); if (!counters) return; - QDictIterator<khtml::CounterNode> i(*counters); + TQDictIterator<khtml::CounterNode> i(*counters); while (i.current()) { (*i)->remove(); @@ -2238,12 +2238,12 @@ void RenderObject::detachCounters() document()->removeCounters(this); } -void RenderObject::insertCounter(const QString& counter, CounterNode* val) +void RenderObject::insertCounter(const TQString& counter, CounterNode* val) { - QDict<khtml::CounterNode>* counters = document()->counters(this); + TQDict<khtml::CounterNode>* counters = document()->counters(this); if (!counters) { - counters = new QDict<khtml::CounterNode>(11); + counters = new TQDict<khtml::CounterNode>(11); document()->setCounters(this, counters); } @@ -2253,22 +2253,22 @@ void RenderObject::insertCounter(const QString& counter, CounterNode* val) void RenderObject::updateWidgetMasks() { for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { if ( curr->isWidget() && static_cast<RenderWidget*>(curr)->needsMask() ) { - QWidget* w = static_cast<RenderWidget*>(curr)->widget(); + TQWidget* w = static_cast<RenderWidget*>(curr)->widget(); if (!w) return; RenderLayer* l = curr->enclosingStackingContext(); - QRegion r = l ? l->getMask() : QRegion(); + TQRegion r = l ? l->getMask() : TQRegion(); int x,y; if (!r.isNull() && curr->absolutePosition(x,y)) { int pbx = curr->borderLeft()+curr->paddingLeft(); int pby = curr->borderTop()+curr->paddingTop(); x+= pbx; y+= pby; - r = r.intersect(QRect(x,y, + r = r.intersect(TQRect(x,y, curr->width()-pbx-curr->borderRight()-curr->paddingRight(), curr->height()-pby-curr->borderBottom()-curr->paddingBottom())); #ifdef MASK_DEBUG - QMemArray<QRect> ar = r.rects(); + TQMemArray<TQRect> ar = r.rects(); kdDebug(6040) << "|| Setting widget mask for " << curr->information() << endl; for (int i = 0; i < ar.size() ; ++i) { kdDebug(6040) << " " << ar[i] << endl; @@ -2286,16 +2286,16 @@ void RenderObject::updateWidgetMasks() { } } -QRegion RenderObject::visibleFlowRegion(int x, int y) const +TQRegion RenderObject::visibleFlowRegion(int x, int y) const { - QRegion r; + TQRegion r; for (RenderObject* ro=firstChild();ro;ro=ro->nextSibling()) { if( !ro->layer() && !ro->isInlineFlow() && ro->style()->visibility() == VISIBLE) { const RenderStyle *s = ro->style(); if (ro->isRelPositioned()) static_cast<const RenderBox*>(ro)->relativePositionOffset(x,y); if ( s->backgroundImage() || s->backgroundColor().isValid() || s->hasBorder() ) - r += QRect(x + ro->effectiveXPos(),y + ro->effectiveYPos(), ro->effectiveWidth(), ro->effectiveHeight()); + r += TQRect(x + ro->effectiveXPos(),y + ro->effectiveYPos(), ro->effectiveWidth(), ro->effectiveHeight()); else r += ro->visibleFlowRegion(x+ro->xPos(), y+ro->yPos()); } diff --git a/khtml/rendering/render_object.h b/khtml/rendering/render_object.h index 6b98a5fa4..64cb581b3 100644 --- a/khtml/rendering/render_object.h +++ b/khtml/rendering/render_object.h @@ -26,10 +26,10 @@ #ifndef render_object_h #define render_object_h -#include <qcolor.h> -#include <qrect.h> +#include <tqcolor.h> +#include <tqrect.h> #include <assert.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> #include <kdebug.h> #include <kglobal.h> @@ -169,9 +169,9 @@ public: } // ### rename to overflowClipRect and clipRect - virtual QRect getOverflowClipRect(int /*tx*/, int /*ty*/) - { return QRect(0,0,0,0); } - virtual QRect getClipRect(int /*tx*/, int /*ty*/) { return QRect(0,0,0,0); } + virtual TQRect getOverflowClipRect(int /*tx*/, int /*ty*/) + { return TQRect(0,0,0,0); } + virtual TQRect getClipRect(int /*tx*/, int /*ty*/) { return TQRect(0,0,0,0); } bool hasClip() const { return isPositioned() && style()->hasClip(); } bool hasOverflowClip() const { return m_hasOverflowClip; } @@ -192,17 +192,17 @@ public: RenderObject *objectAbove() const; // Returns if an object has counter-increment or counter-reset - bool hasCounter(const QString& counter) const; + bool hasCounter(const TQString& counter) const; // Calculates the value of the counter - CounterNode* getCounter(const QString& counter, bool view = false, bool counters = false); + CounterNode* getCounter(const TQString& counter, bool view = false, bool counters = false); // Detaches all counterNodes void detachCounters(); protected: // Helper functions for counter-cache - void insertCounter(const QString& counter, CounterNode* value); - CounterNode* lookupCounter(const QString& counter) const; + void insertCounter(const TQString& counter, CounterNode* value); + CounterNode* lookupCounter(const TQString& counter) const; public: ////////////////////////////////////////// @@ -226,9 +226,9 @@ public: public: virtual const char *renderName() const { return "RenderObject"; } #ifdef ENABLE_DUMP - QString information() const; + TQString information() const; virtual void printTree(int indent=0) const; - virtual void dump(QTextStream &stream, const QString &ind = QString::null) const; + virtual void dump(TQTextStream &stream, const TQString &ind = TQString::null) const; #endif static RenderObject *createObject(DOM::NodeImpl* node, RenderStyle* style); @@ -372,22 +372,22 @@ public: * (tx|ty) is the calculated position of the parent */ struct PaintInfo { - PaintInfo(QPainter* _p, const QRect& _r, PaintAction _phase) + PaintInfo(TQPainter* _p, const TQRect& _r, PaintAction _phase) : p(_p), r(_r), phase(_phase), outlineObjects(0) {} ~PaintInfo() { delete outlineObjects; } - QPainter* p; - QRect r; + TQPainter* p; + TQRect r; PaintAction phase; - QValueList<RenderFlow *>* outlineObjects; // used to list which outlines should be painted by a block with inline children + TQValueList<RenderFlow *>* outlineObjects; // used to list which outlines should be painted by a block with inline children }; virtual void paint( PaintInfo& i, int tx, int ty); - void paintBorder(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style, bool begin=true, bool end=true); - void paintOutline(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style); + void paintBorder(TQPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style, bool begin=true, bool end=true); + void paintOutline(TQPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style); virtual void paintBoxDecorations(PaintInfo&, int /*_tx*/, int /*_ty*/) {} - virtual void paintBackgroundExtended(QPainter* /*p*/, const QColor& /*c*/, const BackgroundLayer */*bgLayer*/, + virtual void paintBackgroundExtended(TQPainter* /*p*/, const TQColor& /*c*/, const BackgroundLayer */*bgLayer*/, int /*clipy*/, int /*cliph*/, int /*_tx*/, int /*_ty*/, int /*w*/, int /*height*/, int /*bleft*/, int /*bright*/, int /*pleft*/, int /*pright*/ ) {} @@ -667,18 +667,18 @@ public: return s; } - void getTextDecorationColors(int decorations, QColor& underline, QColor& overline, - QColor& linethrough, bool quirksMode=false); + void getTextDecorationColors(int decorations, TQColor& underline, TQColor& overline, + TQColor& linethrough, bool quirksMode=false); enum BorderSide { BSTop, BSBottom, BSLeft, BSRight }; - void drawBorder(QPainter *p, int x1, int y1, int x2, int y2, BorderSide s, - QColor c, const QColor& textcolor, EBorderStyle style, + void drawBorder(TQPainter *p, int x1, int y1, int x2, int y2, BorderSide s, + TQColor c, const TQColor& textcolor, EBorderStyle style, int adjbw1, int adjbw2, bool invalidisInvert = false); // Used by collapsed border tables. - virtual void collectBorders(QValueList<CollapsedBorderValue>& borderStyles); + virtual void collectBorders(TQValueList<CollapsedBorderValue>& borderStyles); // force a complete repaint virtual void repaint(Priority p = NormalPriority) { if(m_parent) m_parent->repaint(p); } @@ -758,11 +758,11 @@ public: void setDoNotDelete(bool b) { m_doNotDelete = b; } bool doNotDelete() const { return m_doNotDelete; } - const QFont &font(bool firstLine) const { + const TQFont &font(bool firstLine) const { return style( firstLine )->font(); } - const QFontMetrics &fontMetrics(bool firstLine) const { + const TQFontMetrics &fontMetrics(bool firstLine) const { return style( firstLine )->fontMetrics(); } @@ -780,14 +780,14 @@ public: */ virtual long maxOffset() const { return 0; } - virtual void setPixmap(const QPixmap &, const QRect&, CachedImage *); + virtual void setPixmap(const TQPixmap &, const TQRect&, CachedImage *); - QRegion visibleFlowRegion(int x, int y) const; + TQRegion visibleFlowRegion(int x, int y) const; protected: virtual void selectionStartEnd(int& spos, int& epos); - virtual QRect viewRect() const; + virtual TQRect viewRect() const; void remove(); void invalidateVerticalPositions(); bool attemptDirectLayerTranslation(); diff --git a/khtml/rendering/render_replaced.cpp b/khtml/rendering/render_replaced.cpp index a74338e29..157d1b76d 100644 --- a/khtml/rendering/render_replaced.cpp +++ b/khtml/rendering/render_replaced.cpp @@ -30,14 +30,14 @@ #include "render_arena.h" #include <assert.h> -#include <qwidget.h> -#include <qpainter.h> -#include <qevent.h> -#include <qapplication.h> -#include <qlineedit.h> +#include <tqwidget.h> +#include <tqpainter.h> +#include <tqevent.h> +#include <tqapplication.h> +#include <tqlineedit.h> #include <kglobalsettings.h> -#include <qobjectlist.h> -#include <qvaluevector.h> +#include <tqobjectlist.h> +#include <tqvaluevector.h> #include "khtml_ext.h" #include "khtmlview.h" @@ -142,9 +142,9 @@ RenderWidget::~RenderWidget() class QWidgetResizeEvent : public QEvent { public: - enum { Type = QEvent::User + 0xbee }; + enum { Type = TQEvent::User + 0xbee }; QWidgetResizeEvent( int _w, int _h ) : - QEvent( ( QEvent::Type ) Type ), w( _w ), h( _h ) {} + TQEvent( ( TQEvent::Type ) Type ), w( _w ), h( _h ) {} int w; int h; }; @@ -160,7 +160,7 @@ void RenderWidget::resizeWidget( int w, int h ) m_resizePending = isKHTMLWidget(); ref(); element()->ref(); - QApplication::postEvent( this, new QWidgetResizeEvent( w, h ) ); + TQApplication::postEvent( this, new QWidgetResizeEvent( w, h ) ); element()->deref(); deref(); } @@ -171,13 +171,13 @@ void RenderWidget::cancelPendingResize() if (!m_widget) return; m_discardResizes = true; - QApplication::sendPostedEvents(this, QWidgetResizeEvent::Type); + TQApplication::sendPostedEvents(this, QWidgetResizeEvent::Type); m_discardResizes = false; } -bool RenderWidget::event( QEvent *e ) +bool RenderWidget::event( TQEvent *e ) { - if ( m_widget && (e->type() == (QEvent::Type)QWidgetResizeEvent::Type) ) { + if ( m_widget && (e->type() == (TQEvent::Type)QWidgetResizeEvent::Type) ) { m_resizePending = false; if (m_discardResizes) return true; @@ -187,36 +187,36 @@ bool RenderWidget::event( QEvent *e ) } // eat all events - except if this is a frame (in which case KHTMLView handles it all) if ( ::qt_cast<KHTMLView *>( m_widget ) ) - return QObject::event( e ); + return TQObject::event( e ); return true; } void RenderWidget::flushWidgetResizes() //static { - QApplication::sendPostedEvents( 0, QWidgetResizeEvent::Type ); + TQApplication::sendPostedEvents( 0, QWidgetResizeEvent::Type ); } -void RenderWidget::setQWidget(QWidget *widget) +void RenderWidget::setQWidget(TQWidget *widget) { if (widget != m_widget) { if (m_widget) { m_widget->removeEventFilter(this); - disconnect( m_widget, SIGNAL( destroyed()), this, SLOT( slotWidgetDestructed())); + disconnect( m_widget, TQT_SIGNAL( destroyed()), this, TQT_SLOT( slotWidgetDestructed())); m_widget->hide(); m_widget->deleteLater(); //Might happen due to event on the widget, so be careful m_widget = 0; } m_widget = widget; if (m_widget) { - connect( m_widget, SIGNAL( destroyed()), this, SLOT( slotWidgetDestructed())); + connect( m_widget, TQT_SIGNAL( destroyed()), this, TQT_SLOT( slotWidgetDestructed())); m_widget->installEventFilter(this); - if ( (m_isKHTMLWidget = !strcmp(m_widget->name(), "__khtml")) && !::qt_cast<QFrame*>(m_widget)) - m_widget->setBackgroundMode( QWidget::NoBackground ); + if ( (m_isKHTMLWidget = !strcmp(m_widget->name(), "__khtml")) && !::qt_cast<TQFrame*>(m_widget)) + m_widget->setBackgroundMode( TQWidget::NoBackground ); - if (m_widget->focusPolicy() > QWidget::StrongFocus) - m_widget->setFocusPolicy(QWidget::StrongFocus); + if (m_widget->focusPolicy() > TQWidget::StrongFocus) + m_widget->setFocusPolicy(TQWidget::StrongFocus); // if we've already received a layout, apply the calculated space to the // widget immediately, but we have to have really been full constructed (with a non-null // style pointer). @@ -266,11 +266,11 @@ void RenderWidget::updateFromElement() { if (m_widget) { // Color: - QColor color = style()->color(); - QColor backgroundColor = style()->backgroundColor(); + TQColor color = style()->color(); + TQColor backgroundColor = style()->backgroundColor(); if ( color.isValid() || backgroundColor.isValid() ) { - QPalette pal(QApplication::palette(m_widget)); + TQPalette pal(TQApplication::palette(m_widget)); int contrast_ = KGlobalSettings::contrast(); int highlightVal = 100 + (2*contrast_+4)*16/10; @@ -279,38 +279,38 @@ void RenderWidget::updateFromElement() if (backgroundColor.isValid()) { if (!isKHTMLWidget()) widget()->setEraseColor(backgroundColor ); - for ( int i = 0; i < QPalette::NColorGroups; ++i ) { - pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Background, backgroundColor ); - pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Light, backgroundColor.light(highlightVal) ); - pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Dark, backgroundColor.dark(lowlightVal) ); - pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Mid, backgroundColor.dark(120) ); - pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Midlight, backgroundColor.light(110) ); - pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Button, backgroundColor ); - pal.setColor( (QPalette::ColorGroup)i, QColorGroup::Base, backgroundColor ); + for ( int i = 0; i < TQPalette::NColorGroups; ++i ) { + pal.setColor( (TQPalette::ColorGroup)i, TQColorGroup::Background, backgroundColor ); + pal.setColor( (TQPalette::ColorGroup)i, TQColorGroup::Light, backgroundColor.light(highlightVal) ); + pal.setColor( (TQPalette::ColorGroup)i, TQColorGroup::Dark, backgroundColor.dark(lowlightVal) ); + pal.setColor( (TQPalette::ColorGroup)i, TQColorGroup::Mid, backgroundColor.dark(120) ); + pal.setColor( (TQPalette::ColorGroup)i, TQColorGroup::Midlight, backgroundColor.light(110) ); + pal.setColor( (TQPalette::ColorGroup)i, TQColorGroup::Button, backgroundColor ); + pal.setColor( (TQPalette::ColorGroup)i, TQColorGroup::Base, backgroundColor ); } } if ( color.isValid() ) { struct ColorSet { - QPalette::ColorGroup cg; - QColorGroup::ColorRole cr; + TQPalette::ColorGroup cg; + TQColorGroup::ColorRole cr; }; const struct ColorSet toSet [] = { - { QPalette::Active, QColorGroup::Foreground }, - { QPalette::Active, QColorGroup::ButtonText }, - { QPalette::Active, QColorGroup::Text }, - { QPalette::Inactive, QColorGroup::Foreground }, - { QPalette::Inactive, QColorGroup::ButtonText }, - { QPalette::Inactive, QColorGroup::Text }, - { QPalette::Disabled,QColorGroup::ButtonText }, - { QPalette::NColorGroups, QColorGroup::NColorRoles }, + { TQPalette::Active, TQColorGroup::Foreground }, + { TQPalette::Active, TQColorGroup::ButtonText }, + { TQPalette::Active, TQColorGroup::Text }, + { TQPalette::Inactive, TQColorGroup::Foreground }, + { TQPalette::Inactive, TQColorGroup::ButtonText }, + { TQPalette::Inactive, TQColorGroup::Text }, + { TQPalette::Disabled,TQColorGroup::ButtonText }, + { TQPalette::NColorGroups, TQColorGroup::NColorRoles }, }; const ColorSet *set = toSet; - while( set->cg != QPalette::NColorGroups ) { + while( set->cg != TQPalette::NColorGroups ) { pal.setColor( set->cg, set->cr, color ); ++set; } - QColor disfg = color; + TQColor disfg = color; int h, s, v; disfg.hsv( &h, &s, &v ); if (v > 128) @@ -322,7 +322,7 @@ void RenderWidget::updateFromElement() else // black fg - use darkgray disabled fg disfg = Qt::darkGray; - pal.setColor(QPalette::Disabled,QColorGroup::Foreground,disfg); + pal.setColor(TQPalette::Disabled,TQColorGroup::Foreground,disfg); } m_widget->setPalette(pal); @@ -330,11 +330,11 @@ void RenderWidget::updateFromElement() else m_widget->unsetPalette(); // Border: - QFrame* frame = ::qt_cast<QFrame*>(m_widget); + TQFrame* frame = ::qt_cast<TQFrame*>(m_widget); if (frame) { if (shouldPaintBackgroundOrBorder()) { - frame->setFrameShape(QFrame::NoFrame); + frame->setFrameShape(TQFrame::NoFrame); } } @@ -455,7 +455,7 @@ public: static const int maxPixelBuffering = 320*200; static const int leaseTime = 20*1000; - static QPixmap *grab( QSize s = QSize() ) { + static TQPixmap *grab( TQSize s = TQSize() ) { if (!m_inst) m_inst = new PaintBuffer; return m_inst->getBuf( s ); @@ -464,7 +464,7 @@ public: protected: PaintBuffer(): m_overflow(false), m_grabbed(false), m_timer(0), m_resetWidth(0), m_resetHeight(0) {}; - void timerEvent(QTimerEvent* e) { + void timerEvent(TQTimerEvent* e) { assert( m_timer == e->timerId() ); if (m_grabbed) return; @@ -474,7 +474,7 @@ protected: m_timer = 0; } - QPixmap *getBuf( QSize s ) { + TQPixmap *getBuf( TQSize s ) { assert( !m_grabbed ); if (s.isEmpty()) return 0; @@ -509,7 +509,7 @@ protected: } private: static PaintBuffer* m_inst; - QPixmap m_buf; + TQPixmap m_buf; bool m_overflow; bool m_grabbed; int m_timer; @@ -519,21 +519,21 @@ private: PaintBuffer *PaintBuffer::m_inst = 0; -static void copyWidget(const QRect& r, QPainter *p, QWidget *widget, int tx, int ty) +static void copyWidget(const TQRect& r, TQPainter *p, TQWidget *widget, int tx, int ty) { if (r.isNull() || r.isEmpty() ) return; - QRegion blit(r); - QValueVector<QWidget*> cw; - QValueVector<QRect> cr; + TQRegion blit(r); + TQValueVector<TQWidget*> cw; + TQValueVector<TQRect> cr; if (widget->children()) { // build region - QObjectListIterator it = *widget->children(); + TQObjectListIterator it = *widget->children(); for (; it.current(); ++it) { - QWidget* const w = ::qt_cast<QWidget *>(it.current()); + TQWidget* const w = ::qt_cast<TQWidget *>(it.current()); if ( w && !w->isTopLevel() && !w->isHidden()) { - QRect r2 = w->geometry(); + TQRect r2 = w->geometry(); blit -= r2; r2 = r2.intersect( r ); r2.moveBy(-w->x(), -w->y()); @@ -542,11 +542,11 @@ static void copyWidget(const QRect& r, QPainter *p, QWidget *widget, int tx, int } } } - QMemArray<QRect> br = blit.rects(); + TQMemArray<TQRect> br = blit.rects(); const int cnt = br.size(); const bool external = p->device()->isExtDev(); - QPixmap* const pm = PaintBuffer::grab( widget->size() ); + TQPixmap* const pm = PaintBuffer::grab( widget->size() ); if (!pm) { kdWarning(6040) << "Rendering widget [ " << widget->className() << " ] failed due to invalid size." << endl; @@ -556,12 +556,12 @@ static void copyWidget(const QRect& r, QPainter *p, QWidget *widget, int tx, int // fill background if ( external ) { // even hackier! - QPainter pt( pm ); - const QColor c = widget->colorGroup().base(); + TQPainter pt( pm ); + const TQColor c = widget->colorGroup().base(); for (int i = 0; i < cnt; ++i) pt.fillRect( br[i], c ); } else { - QRect dr; + TQRect dr; for (int i = 0; i < cnt; ++i ) { dr = br[i]; dr.moveBy( tx, ty ); @@ -571,45 +571,45 @@ static void copyWidget(const QRect& r, QPainter *p, QWidget *widget, int tx, int } // send paint event - QPainter::redirect(widget, pm); - QPaintEvent e( r, false ); - QApplication::sendEvent( widget, &e ); - QPainter::redirect(widget, 0); + TQPainter::redirect(widget, pm); + TQPaintEvent e( r, false ); + TQApplication::sendEvent( widget, &e ); + TQPainter::redirect(widget, 0); // transfer result if ( external ) for ( int i = 0; i < cnt; ++i ) - p->drawPixmap(QPoint(tx+br[i].x(), ty+br[i].y()), *pm, br[i]); + p->drawPixmap(TQPoint(tx+br[i].x(), ty+br[i].y()), *pm, br[i]); else for ( int i = 0; i < cnt; ++i ) - bitBlt(p->device(), p->xForm( QPoint(tx, ty) + br[i].topLeft() ), pm, br[i]); + bitBlt(p->device(), p->xForm( TQPoint(tx, ty) + br[i].topLeft() ), pm, br[i]); // cleanup and recurse PaintBuffer::release(); - QValueVector<QWidget*>::iterator cwit = cw.begin(); - QValueVector<QWidget*>::iterator cwitEnd = cw.end(); - QValueVector<QRect>::const_iterator crit = cr.begin(); + TQValueVector<TQWidget*>::iterator cwit = cw.begin(); + TQValueVector<TQWidget*>::iterator cwitEnd = cw.end(); + TQValueVector<TQRect>::const_iterator crit = cr.begin(); for (; cwit != cwitEnd; ++cwit, ++crit) copyWidget(*crit, p, *cwit, tx+(*cwit)->x(), ty+(*cwit)->y()); } -void RenderWidget::paintWidget(PaintInfo& pI, QWidget *widget, int tx, int ty) +void RenderWidget::paintWidget(PaintInfo& pI, TQWidget *widget, int tx, int ty) { - QPainter* const p = pI.p; + TQPainter* const p = pI.p; allowWidgetPaintEvents = true; const bool dsbld = QSharedDoubleBuffer::isDisabled(); QSharedDoubleBuffer::setDisabled(true); - QRect rr = pI.r; + TQRect rr = pI.r; rr.moveBy(-tx, -ty); - const QRect r = widget->rect().intersect( rr ); + const TQRect r = widget->rect().intersect( rr ); copyWidget(r, p, widget, tx, ty); QSharedDoubleBuffer::setDisabled(dsbld); allowWidgetPaintEvents = false; } -bool RenderWidget::eventFilter(QObject* /*o*/, QEvent* e) +bool RenderWidget::eventFilter(TQObject* /*o*/, TQEvent* e) { // no special event processing if this is a frame (in which case KHTMLView handles it all) if ( ::qt_cast<KHTMLView *>( m_widget ) ) @@ -631,23 +631,23 @@ bool RenderWidget::eventFilter(QObject* /*o*/, QEvent* e) //kdDebug() << "RenderWidget::eventFilter type=" << e->type() << endl; switch(e->type()) { - case QEvent::FocusOut: + case TQEvent::FocusOut: // First, forward it to the widget, so that Qt gets a precise // state of the focus before pesky JS can try changing it.. directToWidget = true; - QApplication::sendEvent(m_widget, e); + TQApplication::sendEvent(m_widget, e); directToWidget = false; filtered = true; //We already delivered it! // Don't count popup as a valid reason for losing the focus // (example: opening the options of a select combobox shouldn't emit onblur) - if ( QFocusEvent::reason() != QFocusEvent::Popup ) + if ( TQFocusEvent::reason() != TQFocusEvent::Popup ) handleFocusOut(); break; - case QEvent::FocusIn: + case TQEvent::FocusIn: //As above, forward to the widget first... directToWidget = true; - QApplication::sendEvent(m_widget, e); + TQApplication::sendEvent(m_widget, e); directToWidget = false; filtered = true; //We already delivered it! @@ -658,23 +658,23 @@ bool RenderWidget::eventFilter(QObject* /*o*/, QEvent* e) // if ( ext ) ext->editableWidgetFocused( m_widget ); // } break; - case QEvent::KeyPress: - case QEvent::KeyRelease: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: // TODO this seems wrong - Qt events are not correctly translated to DOM ones, // like in KHTMLView::dispatchKeyEvent() - if (element()->dispatchKeyEvent(static_cast<QKeyEvent*>(e),false)) + if (element()->dispatchKeyEvent(static_cast<TQKeyEvent*>(e),false)) filtered = true; break; - case QEvent::Wheel: + case TQEvent::Wheel: if (widget()->parentWidget() == view()->viewport()) { // don't allow the widget to react to wheel event unless its // currently focused. this avoids accidentally changing a select box // or something while wheeling a webpage. if (qApp->focusWidget() != widget() && - widget()->focusPolicy() <= QWidget::StrongFocus) { - static_cast<QWheelEvent*>(e)->ignore(); - QApplication::sendEvent(view(), e); + widget()->focusPolicy() <= TQWidget::StrongFocus) { + static_cast<TQWheelEvent*>(e)->ignore(); + TQApplication::sendEvent(view(), e); filtered = true; } } @@ -693,50 +693,50 @@ bool RenderWidget::eventFilter(QObject* /*o*/, QEvent* e) return filtered; } -void RenderWidget::EventPropagator::sendEvent(QEvent *e) { +void RenderWidget::EventPropagator::sendEvent(TQEvent *e) { switch(e->type()) { - case QEvent::MouseButtonPress: - mousePressEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonPress: + mousePressEvent(static_cast<TQMouseEvent *>(e)); break; - case QEvent::MouseButtonRelease: - mouseReleaseEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonRelease: + mouseReleaseEvent(static_cast<TQMouseEvent *>(e)); break; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast<TQMouseEvent *>(e)); break; - case QEvent::MouseMove: - mouseMoveEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseMove: + mouseMoveEvent(static_cast<TQMouseEvent *>(e)); break; - case QEvent::KeyPress: - keyPressEvent(static_cast<QKeyEvent *>(e)); + case TQEvent::KeyPress: + keyPressEvent(static_cast<TQKeyEvent *>(e)); break; - case QEvent::KeyRelease: - keyReleaseEvent(static_cast<QKeyEvent *>(e)); + case TQEvent::KeyRelease: + keyReleaseEvent(static_cast<TQKeyEvent *>(e)); break; default: break; } } -void RenderWidget::ScrollViewEventPropagator::sendEvent(QEvent *e) { +void RenderWidget::ScrollViewEventPropagator::sendEvent(TQEvent *e) { switch(e->type()) { - case QEvent::MouseButtonPress: - viewportMousePressEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonPress: + viewportMousePressEvent(static_cast<TQMouseEvent *>(e)); break; - case QEvent::MouseButtonRelease: - viewportMouseReleaseEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonRelease: + viewportMouseReleaseEvent(static_cast<TQMouseEvent *>(e)); break; - case QEvent::MouseButtonDblClick: - viewportMouseDoubleClickEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseButtonDblClick: + viewportMouseDoubleClickEvent(static_cast<TQMouseEvent *>(e)); break; - case QEvent::MouseMove: - viewportMouseMoveEvent(static_cast<QMouseEvent *>(e)); + case TQEvent::MouseMove: + viewportMouseMoveEvent(static_cast<TQMouseEvent *>(e)); break; - case QEvent::KeyPress: - keyPressEvent(static_cast<QKeyEvent *>(e)); + case TQEvent::KeyPress: + keyPressEvent(static_cast<TQKeyEvent *>(e)); break; - case QEvent::KeyRelease: - keyReleaseEvent(static_cast<QKeyEvent *>(e)); + case TQEvent::KeyRelease: + keyReleaseEvent(static_cast<TQKeyEvent *>(e)); break; default: break; @@ -752,15 +752,15 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev) case EventImpl::MOUSEMOVE_EVENT: { if (!ev.isMouseEvent()) break; const MouseEventImpl &me = static_cast<const MouseEventImpl &>(ev); - QMouseEvent* const qme = me.qEvent(); + TQMouseEvent* const qme = me.qEvent(); int absx = 0; int absy = 0; absolutePosition(absx, absy); - QPoint p(me.clientX() - absx + m_view->contentsX(), + TQPoint p(me.clientX() - absx + m_view->contentsX(), me.clientY() - absy + m_view->contentsY()); - QMouseEvent::Type type; + TQMouseEvent::Type type; int button = 0; int state = 0; @@ -771,14 +771,14 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev) } else { switch(me.id()) { case EventImpl::MOUSEDOWN_EVENT: - type = QMouseEvent::MouseButtonPress; + type = TQMouseEvent::MouseButtonPress; break; case EventImpl::MOUSEUP_EVENT: - type = QMouseEvent::MouseButtonRelease; + type = TQMouseEvent::MouseButtonRelease; break; case EventImpl::MOUSEMOVE_EVENT: default: - type = QMouseEvent::MouseMove; + type = TQMouseEvent::MouseMove; break; } switch (me.button()) { @@ -807,9 +807,9 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev) // kdDebug(6000) << "sending event to widget " // << " pos=" << p << " type=" << type // << " button=" << button << " state=" << state << endl; - QMouseEvent e(type, p, button, state); - QScrollView * sc = ::qt_cast<QScrollView*>(m_widget); - if (sc && !::qt_cast<QListBox*>(m_widget)) + TQMouseEvent e(type, p, button, state); + TQScrollView * sc = ::qt_cast<TQScrollView*>(m_widget); + if (sc && !::qt_cast<TQListBox*>(m_widget)) static_cast<ScrollViewEventPropagator *>(sc)->sendEvent(&e); else static_cast<EventPropagator *>(m_widget)->sendEvent(&e); @@ -825,7 +825,7 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev) const KeyEventBaseImpl& domKeyEv = static_cast<const KeyEventBaseImpl &>(ev); if (domKeyEv.isSynthetic() && !acceptsSyntheticEvents()) break; - QKeyEvent* const ke = domKeyEv.qKeyEvent(); + TQKeyEvent* const ke = domKeyEv.qKeyEvent(); static_cast<EventPropagator *>(m_widget)->sendEvent(ke); ret = ke->isAccepted(); break; @@ -849,9 +849,9 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev) // Qt::KeyPress is sent for DOM keypress and not DOM keydown to allow // sites to block a key with onkeypress, #99749 - QKeyEvent* const ke = domKeyEv.qKeyEvent(); + TQKeyEvent* const ke = domKeyEv.qKeyEvent(); if (ke->isAutoRepeat()) { - QKeyEvent releaseEv( QEvent::KeyRelease, ke->key(), ke->ascii(), ke->state(), + TQKeyEvent releaseEv( TQEvent::KeyRelease, ke->key(), ke->ascii(), ke->state(), ke->text(), ke->isAutoRepeat(), ke->count() ); static_cast<EventPropagator *>(m_widget)->sendEvent(&releaseEv); } @@ -860,13 +860,13 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev) break; } case EventImpl::MOUSEOUT_EVENT: { - QEvent moe( QEvent::Leave ); - QApplication::sendEvent(m_widget, &moe); + TQEvent moe( TQEvent::Leave ); + TQApplication::sendEvent(m_widget, &moe); break; } case EventImpl::MOUSEOVER_EVENT: { - QEvent moe( QEvent::Enter ); - QApplication::sendEvent(m_widget, &moe); + TQEvent moe( TQEvent::Enter ); + TQApplication::sendEvent(m_widget, &moe); view()->part()->resetHoverText(); break; } @@ -924,7 +924,7 @@ FindSelectionResult RenderReplaced::checkSelectionPoint(int _x, int _y, int _tx, } #ifdef ENABLE_DUMP -void RenderWidget::dump(QTextStream &stream, const QString &ind) const +void RenderWidget::dump(TQTextStream &stream, const TQString &ind) const { RenderReplaced::dump(stream,ind); if ( widget() ) diff --git a/khtml/rendering/render_replaced.h b/khtml/rendering/render_replaced.h index 97c14a0a8..cb147e3c0 100644 --- a/khtml/rendering/render_replaced.h +++ b/khtml/rendering/render_replaced.h @@ -23,8 +23,8 @@ #define render_replaced_h #include "rendering/render_block.h" -#include <qobject.h> -#include <qscrollview.h> +#include <tqobject.h> +#include <tqscrollview.h> class KHTMLView; class QWidget; @@ -81,7 +81,7 @@ protected: }; -class RenderWidget : public QObject, public RenderReplaced, public khtml::Shared<RenderWidget> +class RenderWidget : public TQObject, public RenderReplaced, public khtml::Shared<RenderWidget> { Q_OBJECT public: @@ -99,7 +99,7 @@ public: virtual void updateFromElement(); - QWidget *widget() const { return m_widget; } + TQWidget *widget() const { return m_widget; } KHTMLView* view() const { return m_view; } void deref(); @@ -107,11 +107,11 @@ public: void cancelPendingResize(); bool needsMask() const { return m_needsMask; } - static void paintWidget(PaintInfo& pI, QWidget *widget, int tx, int ty); + static void paintWidget(PaintInfo& pI, TQWidget *widget, int tx, int ty); virtual bool handleEvent(const DOM::EventImpl& ev); #ifdef ENABLE_DUMP - virtual void dump(QTextStream &stream, const QString &ind) const; + virtual void dump(TQTextStream &stream, const TQString &ind) const; #endif // for ECMA to flush all pending resizes @@ -127,13 +127,13 @@ protected: virtual bool acceptsSyntheticEvents() const { return true; } virtual void handleFocusOut() {} - bool event( QEvent *e ); + bool event( TQEvent *e ); - bool eventFilter(QObject* /*o*/, QEvent* e); - void setQWidget(QWidget *widget); + bool eventFilter(TQObject* /*o*/, TQEvent* e); + void setQWidget(TQWidget *widget); void resizeWidget( int w, int h ); - QWidget *m_widget; + TQWidget *m_widget; KHTMLView* m_view; //Because we mess with normal detach due to ref/deref, @@ -152,13 +152,13 @@ public: virtual int borderLeft() const { return canHaveBorder() ? RenderReplaced::borderLeft() : 0; } virtual int borderRight() const { return canHaveBorder() ? RenderReplaced::borderRight() : 0; } - class EventPropagator : public QWidget { + class EventPropagator : public TQWidget { public: - void sendEvent(QEvent *e); + void sendEvent(TQEvent *e); }; - class ScrollViewEventPropagator : public QScrollView { + class ScrollViewEventPropagator : public TQScrollView { public: - void sendEvent(QEvent *e); + void sendEvent(TQEvent *e); }; }; diff --git a/khtml/rendering/render_style.cpp b/khtml/rendering/render_style.cpp index 936964b98..18c520ad4 100644 --- a/khtml/rendering/render_style.cpp +++ b/khtml/rendering/render_style.cpp @@ -89,7 +89,7 @@ bool StyleBoxData::operator==(const StyleBoxData& o) const StyleVisualData::StyleVisualData() : textDecoration(RenderStyle::initialTextDecoration()), - palette( QApplication::palette() ) + palette( TQApplication::palette() ) { } @@ -879,7 +879,7 @@ void RenderStyle::cleanup() _default = 0; } -void RenderStyle::setPaletteColor(QPalette::ColorGroup g, QColorGroup::ColorRole r, const QColor& c) +void RenderStyle::setPaletteColor(TQPalette::ColorGroup g, TQColorGroup::ColorRole r, const TQColor& c) { visual.access()->palette.setColor(g,r,c); } @@ -912,7 +912,7 @@ void RenderStyle::setQuotes(DOM::QuotesValueImpl* q) if (t) t->deref(); } -QString RenderStyle::openQuote(int level) const +TQString RenderStyle::openQuote(int level) const { if (inherited->quotes) return inherited->quotes->openQuote(level); @@ -920,7 +920,7 @@ QString RenderStyle::openQuote(int level) const return "\""; // 0 is default quotes } -QString RenderStyle::closeQuote(int level) const +TQString RenderStyle::closeQuote(int level) const { if (inherited->quotes) return inherited->quotes->closeQuote(level); @@ -1213,14 +1213,14 @@ void RenderStyle::setCounterIncrement(CSSValueListImpl *l) #ifdef ENABLE_DUMP -static QString describeFont( const QFont &f) +static TQString describeFont( const TQFont &f) { - QString res = "'" + f.family() + "' "; + TQString res = "'" + f.family() + "' "; if ( f.pointSize() > 0) - res += QString::number( f.pointSize() ) + "pt"; + res += TQString::number( f.pointSize() ) + "pt"; else - res += QString::number( f.pixelSize() ) + "px"; + res += TQString::number( f.pixelSize() ) + "px"; if ( f.bold() ) res += " bold"; @@ -1235,9 +1235,9 @@ static QString describeFont( const QFont &f) return res; } -QString RenderStyle::createDiff( const RenderStyle &parent ) const +TQString RenderStyle::createDiff( const RenderStyle &parent ) const { - QString res; + TQString res; if ( color().isValid() && parent.color() != color() ) res += " [color=" + color().name() + "]"; if ( backgroundColor().isValid() && parent.backgroundColor() != backgroundColor() ) diff --git a/khtml/rendering/render_style.h b/khtml/rendering/render_style.h index f8c2affd7..b1c1e5306 100644 --- a/khtml/rendering/render_style.h +++ b/khtml/rendering/render_style.h @@ -35,12 +35,12 @@ * and produce invaliud results. */ -#include <qcolor.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qptrlist.h> -#include <qpalette.h> -#include <qapplication.h> +#include <tqcolor.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqptrlist.h> +#include <tqpalette.h> +#include <tqapplication.h> #include "dom/dom_misc.h" #include "dom/dom_string.h" @@ -208,7 +208,7 @@ class BorderValue public: BorderValue() : width( 3 ), style( BNONE ) {} - QColor color; + TQColor color; unsigned short width : 12; EBorderStyle style : 6; @@ -264,7 +264,7 @@ struct CollapsedBorderValue int width() const { return border && border->nonZero() ? border->width : 0; } EBorderStyle style() const { return border ? border->style : BHIDDEN; } bool exists() const { return border; } - QColor color() const { return border ? border->color : QColor(); } + TQColor color() const { return border ? border->color : TQColor(); } bool isTransparent() const { return border ? border->isTransparent() : true; } bool operator==(const CollapsedBorderValue& o) const @@ -428,7 +428,7 @@ public: LengthBox clip; unsigned textDecoration : 4; // Text decorations defined *only* by this element. - QPalette palette; //widget styling with IE attributes + TQPalette palette; //widget styling with IE attributes }; @@ -553,7 +553,7 @@ public: } BackgroundLayer m_background; - QColor m_color; + TQColor m_color; OutlineValue m_outline; }; @@ -641,7 +641,7 @@ public: // This struct holds information about shadows for the text-shadow and box-shadow properties. struct ShadowData { - ShadowData(int _x, int _y, int _blur, const QColor& _color) + ShadowData(int _x, int _y, int _blur, const TQColor& _color) :x(_x), y(_y), blur(_blur), color(_color), next(0) {} ShadowData(const ShadowData& o); @@ -655,7 +655,7 @@ struct ShadowData { int x; int y; int blur; - QColor color; + TQColor color; ShadowData* next; }; @@ -761,7 +761,7 @@ public: CachedImage *style_image; khtml::Font font; - QColor color; + TQColor color; short border_hspacing; short border_vspacing; @@ -1063,19 +1063,19 @@ public: unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); } EBorderStyle borderLeftStyle() const { return surround->border.left.style; } - const QColor& borderLeftColor() const { return surround->border.left.color; } + const TQColor& borderLeftColor() const { return surround->border.left.color; } bool borderLeftIsTransparent() const { return surround->border.left.isTransparent(); } unsigned short borderRightWidth() const { return surround->border.borderRightWidth(); } EBorderStyle borderRightStyle() const { return surround->border.right.style; } - const QColor& borderRightColor() const { return surround->border.right.color; } + const TQColor& borderRightColor() const { return surround->border.right.color; } bool borderRightIsTransparent() const { return surround->border.right.isTransparent(); } unsigned short borderTopWidth() const { return surround->border.borderTopWidth(); } EBorderStyle borderTopStyle() const { return surround->border.top.style; } - const QColor& borderTopColor() const { return surround->border.top.color; } + const TQColor& borderTopColor() const { return surround->border.top.color; } bool borderTopIsTransparent() const { return surround->border.top.isTransparent(); } unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); } EBorderStyle borderBottomStyle() const { return surround->border.bottom.style; } - const QColor& borderBottomColor() const { return surround->border.bottom.color; } + const TQColor& borderBottomColor() const { return surround->border.bottom.color; } bool borderBottomIsTransparent() const { return surround->border.bottom.isTransparent(); } unsigned short outlineSize() const { return outlineWidth() + outlineOffset(); } @@ -1084,7 +1084,7 @@ public: else return background->m_outline.width; } EBorderStyle outlineStyle() const { return background->m_outline.style; } bool outlineStyleIsAuto() const { return background->m_outline._auto; } - const QColor & outlineColor() const { return background->m_outline.color; } + const TQColor & outlineColor() const { return background->m_outline.color; } EOverflow overflowX() const { return noninherited_flags.f._overflowX; } EOverflow overflowY() const { return noninherited_flags.f._overflowY; } @@ -1109,12 +1109,12 @@ public: EClear clear() const { return noninherited_flags.f._clear; } ETableLayout tableLayout() const { return noninherited_flags.f._table_layout; } - const QFont & font() const { return inherited->font.f; } + const TQFont & font() const { return inherited->font.f; } // use with care. call font->update() after modifications const Font &htmlFont() { return inherited->font; } - const QFontMetrics & fontMetrics() const { return inherited->font.fm; } + const TQFontMetrics & fontMetrics() const { return inherited->font.fm; } - const QColor & color() const { return inherited->color; } + const TQColor & color() const { return inherited->color; } Length textIndent() const { return inherited->indent; } ETextAlign textAlign() const { return inherited_flags.f._text_align; } ETextTransform textTransform() const { return inherited_flags.f._text_transform; } @@ -1146,7 +1146,7 @@ public: return false; } - const QColor & backgroundColor() const { return background->m_color; } + const TQColor & backgroundColor() const { return background->m_color; } CachedImage *backgroundImage() const { return background->m_background.m_image; } EBackgroundRepeat backgroundRepeat() const { return background->m_background.m_bgRepeat; } bool backgroundAttachment() const { return background->m_background.m_bgAttachment; } @@ -1185,8 +1185,8 @@ public: EPageBreak pageBreakAfter() const { return noninherited_flags.f._page_break_after; } DOM::QuotesValueImpl* quotes() const { return inherited->quotes; } - QString openQuote(int level) const; - QString closeQuote(int level) const; + TQString openQuote(int level) const; + TQString closeQuote(int level) const; // CSS3 Getter Methods EBoxSizing boxSizing() const { return box->box_sizing; } @@ -1232,27 +1232,27 @@ public: void resetBorderLeft() { SET_VAR(surround, border.left, BorderValue()) } void resetOutline() { SET_VAR(background, m_outline, OutlineValue()) } - void setBackgroundColor(const QColor& v) { SET_VAR(background, m_color, v) } + void setBackgroundColor(const TQColor& v) { SET_VAR(background, m_color, v) } void setBorderLeftWidth(unsigned short v) { SET_VAR(surround,border.left.width,v) } void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround,border.left.style,v) } - void setBorderLeftColor(const QColor & v) { SET_VAR(surround,border.left.color,v) } + void setBorderLeftColor(const TQColor & v) { SET_VAR(surround,border.left.color,v) } void setBorderRightWidth(unsigned short v) { SET_VAR(surround,border.right.width,v) } void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround,border.right.style,v) } - void setBorderRightColor(const QColor & v) { SET_VAR(surround,border.right.color,v) } + void setBorderRightColor(const TQColor & v) { SET_VAR(surround,border.right.color,v) } void setBorderTopWidth(unsigned short v) { SET_VAR(surround,border.top.width,v) } void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround,border.top.style,v) } - void setBorderTopColor(const QColor & v) { SET_VAR(surround,border.top.color,v) } + void setBorderTopColor(const TQColor & v) { SET_VAR(surround,border.top.color,v) } void setBorderBottomWidth(unsigned short v) { SET_VAR(surround,border.bottom.width,v) } void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround,border.bottom.style,v) } - void setBorderBottomColor(const QColor & v) { SET_VAR(surround,border.bottom.color,v) } + void setBorderBottomColor(const TQColor & v) { SET_VAR(surround,border.bottom.color,v) } void setOutlineWidth(unsigned short v) { SET_VAR(background,m_outline.width,v) } void setOutlineStyle(EBorderStyle v, bool isAuto = false) { SET_VAR(background,m_outline.style,v) SET_VAR(background,m_outline._auto, isAuto) } - void setOutlineColor(const QColor & v) { SET_VAR(background,m_outline.color,v) } + void setOutlineColor(const TQColor & v) { SET_VAR(background,m_outline.color,v) } void setOverflowX(EOverflow v) { noninherited_flags.f._overflowX = v; } void setOverflowY(EOverflow v) { noninherited_flags.f._overflowY = v; } @@ -1280,7 +1280,7 @@ public: return false; } - void setColor(const QColor & v) { SET_VAR(inherited,color,v) } + void setColor(const TQColor & v) { SET_VAR(inherited,color,v) } void setTextIndent(Length v) { SET_VAR(inherited,indent,v) } void setTextAlign(ETextAlign v) { inherited_flags.f._text_align = v; } void setTextTransform(ETextTransform v) { inherited_flags.f._text_transform = v; } @@ -1358,11 +1358,11 @@ public: void setTextOverflow(bool b) { noninherited_flags.f._textOverflow = b; } // End CSS3 Setters - QPalette palette() const { return visual->palette; } - void setPaletteColor(QPalette::ColorGroup g, QColorGroup::ColorRole r, const QColor& c); + TQPalette palette() const { return visual->palette; } + void setPaletteColor(TQPalette::ColorGroup g, TQColorGroup::ColorRole r, const TQColor& c); void resetPalette() // Called when the desktop color scheme changes. { - const_cast<StyleVisualData *>(visual.get())->palette = QApplication::palette(); + const_cast<StyleVisualData *>(visual.get())->palette = TQApplication::palette(); } bool useNormalContent() const { return generated->content == 0; } @@ -1407,7 +1407,7 @@ public: #ifdef ENABLE_DUMP - QString createDiff( const RenderStyle &parent ) const; + TQString createDiff( const RenderStyle &parent ) const; #endif // Initial values for all the properties @@ -1443,7 +1443,7 @@ public: static short initialBorderHorizontalSpacing() { return 0; } static short initialBorderVerticalSpacing() { return 0; } static ECursor initialCursor() { return CURSOR_AUTO; } - static QColor initialColor() { return Qt::black; } + static TQColor initialColor() { return Qt::black; } static CachedImage* initialBackgroundImage() { return 0; } static CachedImage* initialListStyleImage() { return 0; } static unsigned short initialBorderWidth() { return 3; } diff --git a/khtml/rendering/render_table.cpp b/khtml/rendering/render_table.cpp index 592db9dbd..2cf1bf1f9 100644 --- a/khtml/rendering/render_table.cpp +++ b/khtml/rendering/render_table.cpp @@ -42,8 +42,8 @@ #include <kglobal.h> -#include <qapplication.h> -#include <qstyle.h> +#include <tqapplication.h> +#include <tqstyle.h> #include <kdebug.h> #include <assert.h> @@ -477,16 +477,16 @@ void RenderTable::paint( PaintInfo& pI, int _tx, int _ty) // have all the styles sorted, we then do individual passes, painting each style of border // from lowest precedence to highest precedence. pI.phase = PaintActionCollapsedTableBorders; - QValueList<CollapsedBorderValue> borderStyles; + TQValueList<CollapsedBorderValue> borderStyles; collectBorders(borderStyles); #if 0 - QString m; + TQString m; for (uint i = 0; i < borderStyles.count(); i++) - m += QString("%1 ").arg((*borderStyles.at(i)).width()); + m += TQString("%1 ").arg((*borderStyles.at(i)).width()); kdDebug(6040) << m << endl; #endif - QValueListIterator<CollapsedBorderValue> it = borderStyles.begin(); - QValueListIterator<CollapsedBorderValue> end = borderStyles.end(); + TQValueListIterator<CollapsedBorderValue> it = borderStyles.begin(); + TQValueListIterator<CollapsedBorderValue> end = borderStyles.end(); for (; it != end; ++it) { m_currentBorder = &*it; for (RenderObject *child = firstChild(); child; child = child->nextSibling()) { @@ -879,7 +879,7 @@ RenderTableCell* RenderTable::cellRight(const RenderTableCell* cell) const } #ifdef ENABLE_DUMP -void RenderTable::dump(QTextStream &stream, const QString &ind) const +void RenderTable::dump(TQTextStream &stream, const TQString &ind) const { RenderBlock::dump(stream, ind); @@ -1074,7 +1074,7 @@ void RenderTableSection::addCell( RenderTableCell *cell, RenderTableRow *row ) { int rSpan = cell->rowSpan(); int cSpan = cell->colSpan(); - QMemArray<RenderTable::ColumnStruct> &columns = table()->columns; + TQMemArray<RenderTable::ColumnStruct> &columns = table()->columns; int nCols = columns.size(); // ### mozilla still seems to do the old HTML way, even for strict DTD @@ -1161,7 +1161,7 @@ void RenderTableSection::setCellWidths() #ifdef DEBUG_LAYOUT kdDebug( 6040 ) << renderName() << "(Table, this=0x" << this << ")::setCellWidths()" << endl; #endif - QMemArray<int> &columnPos = table()->columnPos; + TQMemArray<int> &columnPos = table()->columnPos; int rows = grid.size(); for ( int i = 0; i < rows; i++ ) { @@ -1609,7 +1609,7 @@ int RenderTableSection::highestPosition(bool includeOverflowInterior, bool inclu // Search from first_row to last_row for the row containing y static unsigned int findRow(unsigned int first_row, unsigned int last_row, - const QMemArray<int> &rowPos, int y) + const TQMemArray<int> &rowPos, int y) { unsigned int under = first_row; unsigned int over = last_row; @@ -1629,7 +1629,7 @@ static unsigned int findRow(unsigned int first_row, unsigned int last_row, } static void findRowCover(unsigned int &startrow, unsigned int &endrow, - const QMemArray<int> &rowPos, + const TQMemArray<int> &rowPos, int min_y, int max_y) { assert(max_y >= min_y); @@ -1844,7 +1844,7 @@ void RenderTableSection::addSpaceAt(int pos, int dy) #ifdef ENABLE_DUMP -void RenderTableSection::dump(QTextStream &stream, const QString &ind) const +void RenderTableSection::dump(TQTextStream &stream, const TQString &ind) const { RenderContainer::dump(stream,ind); @@ -2693,11 +2693,11 @@ int RenderTableCell::borderBottom() const } #ifdef BOX_DEBUG -#include <qpainter.h> +#include <tqpainter.h> -static void outlineBox(QPainter *p, int _tx, int _ty, int w, int h) +static void outlineBox(TQPainter *p, int _tx, int _ty, int w, int h) { - p->setPen(QPen(QColor("yellow"), 3, Qt::DotLine)); + p->setPen(TQPen(TQColor("yellow"), 3, Qt::DotLine)); p->setBrush( Qt::NoBrush ); p->drawRect(_tx, _ty, w, h ); } @@ -2798,13 +2798,13 @@ public: int count; }; -static void addBorderStyle(QValueList<CollapsedBorderValue>& borderStyles, CollapsedBorderValue borderValue) +static void addBorderStyle(TQValueList<CollapsedBorderValue>& borderStyles, CollapsedBorderValue borderValue) { if (!borderValue.exists() || borderStyles.contains(borderValue)) return; - QValueListIterator<CollapsedBorderValue> it = borderStyles.begin(); - QValueListIterator<CollapsedBorderValue> end = borderStyles.end(); + TQValueListIterator<CollapsedBorderValue> it = borderStyles.begin(); + TQValueListIterator<CollapsedBorderValue> end = borderStyles.end(); for (; it != end; ++it) { CollapsedBorderValue result = compareBorders(*it, borderValue); if (result == *it) { @@ -2816,7 +2816,7 @@ static void addBorderStyle(QValueList<CollapsedBorderValue>& borderStyles, Colla borderStyles.append(borderValue); } -void RenderTableCell::collectBorders(QValueList<CollapsedBorderValue>& borderStyles) +void RenderTableCell::collectBorders(TQValueList<CollapsedBorderValue>& borderStyles) { addBorderStyle(borderStyles, collapsedLeftBorder()); addBorderStyle(borderStyles, collapsedRightBorder()); @@ -2824,7 +2824,7 @@ void RenderTableCell::collectBorders(QValueList<CollapsedBorderValue>& borderSty addBorderStyle(borderStyles, collapsedBottomBorder()); } -void RenderTableCell::paintCollapsedBorder(QPainter* p, int _tx, int _ty, int w, int h) +void RenderTableCell::paintCollapsedBorder(TQPainter* p, int _tx, int _ty, int w, int h) { if (!table()->currentBorderStyle()) return; @@ -2894,7 +2894,7 @@ void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& pI, int _tx, int _ty int end = kMin( pI.r.y() + pI.r.height(), _ty + h ); int mh = end - my; - QColor c = backgroundObject->style()->backgroundColor(); + TQColor c = backgroundObject->style()->backgroundColor(); const BackgroundLayer* bgLayer = backgroundObject->style()->backgroundLayers(); if (bgLayer->hasImage() || c.isValid()) { @@ -2903,10 +2903,10 @@ void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& pI, int _tx, int _ty bool hasLayer = backgroundObject->layer() && (backgroundObject == this || backgroundObject == parent()); if (hasLayer && tableElt->collapseBorders()) { pI.p->save(); - QRect clipRect(_tx + borderLeft(), _ty + borderTop(), w - borderLeft() - borderRight(), h - borderTop() - borderBottom()); + TQRect clipRect(_tx + borderLeft(), _ty + borderTop(), w - borderLeft() - borderRight(), h - borderTop() - borderBottom()); clipRect = pI.p->xForm(clipRect); - QRegion creg(clipRect); - QRegion old = pI.p->clipRegion(); + TQRegion creg(clipRect); + TQRegion old = pI.p->clipRegion(); if (!old.isNull()) creg = old.intersect(creg); pI.p->setClipRegion(creg); @@ -2940,7 +2940,7 @@ void RenderTableCell::paintBoxDecorations(PaintInfo& pI, int _tx, int _ty) #ifdef ENABLE_DUMP -void RenderTableCell::dump(QTextStream &stream, const QString &ind) const +void RenderTableCell::dump(TQTextStream &stream, const TQString &ind) const { RenderFlow::dump(stream,ind); stream << " row=" << _row; @@ -2972,7 +2972,7 @@ void RenderTableCol::updateFromElement() } #ifdef ENABLE_DUMP -void RenderTableCol::dump(QTextStream &stream, const QString &ind) const +void RenderTableCol::dump(TQTextStream &stream, const TQString &ind) const { RenderContainer::dump(stream,ind); stream << " _span=" << m_span; diff --git a/khtml/rendering/render_table.h b/khtml/rendering/render_table.h index 979b92187..a6de6cfaf 100644 --- a/khtml/rendering/render_table.h +++ b/khtml/rendering/render_table.h @@ -27,8 +27,8 @@ #ifndef RENDER_TABLE_H #define RENDER_TABLE_H -#include <qcolor.h> -#include <qptrvector.h> +#include <tqcolor.h> +#include <tqptrvector.h> #include "rendering/render_box.h" #include "rendering/render_block.h" @@ -78,7 +78,7 @@ public: int paddingTop() const { return collapseBorders() ? 0 : RenderBlock::paddingTop(); } int paddingBottom() const { return collapseBorders() ? 0 : RenderBlock::paddingBottom(); } - const QColor &bgColor() const { return style()->backgroundColor(); } + const TQColor &bgColor() const { return style()->backgroundColor(); } uint cellPadding() const { return padding; } void setCellPadding( uint p ) { padding = p; } @@ -103,7 +103,7 @@ public: SelPointState & ); #ifdef ENABLE_DUMP - virtual void dump(QTextStream &stream, const QString &ind) const; + virtual void dump(TQTextStream &stream, const TQString &ind) const; #endif struct ColumnStruct { enum { @@ -117,8 +117,8 @@ public: ushort width; // the calculated position of the column }; - QMemArray<int> columnPos; - QMemArray<ColumnStruct> columns; + TQMemArray<int> columnPos; + TQMemArray<ColumnStruct> columns; void splitColumn( int pos, int firstSpan ); void appendColumn( int span ); @@ -217,7 +217,7 @@ public: SelPointState & ); #ifdef ENABLE_DUMP - virtual void dump(QTextStream &stream, const QString &ind) const; + virtual void dump(TQTextStream &stream, const TQString &ind) const; #endif void addCell( RenderTableCell *cell, RenderTableRow *row ); @@ -228,7 +228,7 @@ public: RenderTable *table() const { return static_cast<RenderTable *>(parent()); } - typedef QMemArray<RenderTableCell *> Row; + typedef TQMemArray<RenderTableCell *> Row; struct RowStruct { Row *row; RenderTableRow* rowRenderer; @@ -273,8 +273,8 @@ public: // this gets a cell grid data structure. changing the number of // columns is done by the table - QMemArray<RowStruct> grid; - QMemArray<int> rowPos; + TQMemArray<RowStruct> grid; + TQMemArray<int> rowPos; signed short cRow; ushort cCol; @@ -375,7 +375,7 @@ public: CollapsedBorderValue collapsedRightBorder() const; CollapsedBorderValue collapsedTopBorder() const; CollapsedBorderValue collapsedBottomBorder() const; - virtual void collectBorders(QValueList<CollapsedBorderValue>& borderStyles); + virtual void collectBorders(TQValueList<CollapsedBorderValue>& borderStyles); virtual void updateFromElement(); @@ -388,7 +388,7 @@ public: virtual void paint( PaintInfo& i, int tx, int ty); - void paintCollapsedBorder(QPainter* p, int x, int y, int w, int h); + void paintCollapsedBorder(TQPainter* p, int x, int y, int w, int h); void paintBackgroundsBehindCell(PaintInfo& i, int _tx, int _ty, RenderObject* backgroundObject); virtual void close(); @@ -407,7 +407,7 @@ public: RenderTableSection *section() const { return static_cast<RenderTableSection *>(parent()->parent()); } #ifdef ENABLE_DUMP - virtual void dump(QTextStream &stream, const QString &ind) const; + virtual void dump(TQTextStream &stream, const TQString &ind) const; #endif bool widthChanged() { @@ -461,7 +461,7 @@ public: virtual void updateFromElement(); #ifdef ENABLE_DUMP - virtual void dump(QTextStream &stream, const QString& ind) const; + virtual void dump(TQTextStream &stream, const TQString& ind) const; #endif int span() const { return m_span; } diff --git a/khtml/rendering/render_text.cpp b/khtml/rendering/render_text.cpp index a862c3ad5..0bded06fc 100644 --- a/khtml/rendering/render_text.cpp +++ b/khtml/rendering/render_text.cpp @@ -39,9 +39,9 @@ #include "misc/loader.h" #include "misc/helper.h" -#include <qbitmap.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqbitmap.h> +#include <tqimage.h> +#include <tqpainter.h> #include <kdebug.h> #include <kglobal.h> #include <assert.h> @@ -173,7 +173,7 @@ void InlineTextBox::paint(RenderObject::PaintInfo& i, int tx, int ty) paintShadow(i.p, font, tx, ty, styleToUse->textShadow()); if (!haveSelection || sPos != 0 || ePos != m_len) { font->drawText(i.p, m_x + tx, m_y + ty + m_baseline, renderText()->string()->s, renderText()->string()->l, m_start, endPoint, - m_toAdd, m_reversed ? QPainter::RTL : QPainter::LTR); + m_toAdd, m_reversed ? TQPainter::RTL : TQPainter::LTR); } } @@ -206,13 +206,13 @@ inline const RenderStyle *retrieveSelectionPseudoStyle(const RenderObject *obj) return 0; } -void InlineTextBox::paintSelection(const Font *f, RenderText *text, QPainter *p, RenderStyle* style, int tx, int ty, int startPos, int endPos, int deco) +void InlineTextBox::paintSelection(const Font *f, RenderText *text, TQPainter *p, RenderStyle* style, int tx, int ty, int startPos, int endPos, int deco) { if(startPos > m_len) return; if(startPos < 0) startPos = 0; - QColor hc; - QColor hbg; + TQColor hc; + TQColor hbg; const RenderStyle* pseudoStyle = retrieveSelectionPseudoStyle(text); if (pseudoStyle) { // ### support outline (mandated by CSS3) @@ -221,11 +221,11 @@ void InlineTextBox::paintSelection(const Font *f, RenderText *text, QPainter *p, hbg = pseudoStyle->backgroundColor(); hc = pseudoStyle->color(); } else { - const QColorGroup &grp = style->palette().active(); + const TQColorGroup &grp = style->palette().active(); hc = grp.highlightedText(); hbg = grp.highlight(); // ### should be at most retrieved once per render text - QColor bg = khtml::retrieveBackgroundColor(text); + TQColor bg = khtml::retrieveBackgroundColor(text); // It may happen that the contrast is -- well -- virtually non existent. // In this case, simply swap the colors, thus in compliance with // NN4 (win32 only), IE, and Mozilla. @@ -235,7 +235,7 @@ void InlineTextBox::paintSelection(const Font *f, RenderText *text, QPainter *p, p->setPen(hc); - //kdDebug( 6040 ) << "textRun::painting(" << QConstString(text->str->s + m_start, m_len).string().left(30) << ") at(" << m_x+tx << "/" << m_y+ty << ")" << endl; + //kdDebug( 6040 ) << "textRun::painting(" << TQConstString(text->str->s + m_start, m_len).string().left(30) << ") at(" << m_x+tx << "/" << m_y+ty << ")" << endl; const bool needClipping = startPos != 0 || endPos != m_len; @@ -249,23 +249,23 @@ void InlineTextBox::paintSelection(const Font *f, RenderText *text, QPainter *p, visualSelectionStart = f->width(text->str->s, text->str->l, m_start, m_len) - visualSelectionEnd; } - QRect selectionRect(m_x + tx + visualSelectionStart, m_y + ty, visualSelectionWidth, height()); - QRegion r(selectionRect); + TQRect selectionRect(m_x + tx + visualSelectionStart, m_y + ty, visualSelectionWidth, height()); + TQRegion r(selectionRect); if (p->hasClipping()) - r &= p->clipRegion(QPainter::CoordPainter); - p->setClipRegion(r, QPainter::CoordPainter); + r &= p->clipRegion(TQPainter::CoordPainter); + p->setClipRegion(r, TQPainter::CoordPainter); } f->drawText(p, m_x + tx, m_y + ty + m_baseline, text->str->s, text->str->l, m_start, m_len, m_toAdd, - m_reversed ? QPainter::RTL : QPainter::LTR, + m_reversed ? TQPainter::RTL : TQPainter::LTR, needClipping ? 0 : startPos, needClipping ? m_len : endPos, hbg, m_y + ty, height(), deco); if (needClipping) p->restore(); } -void InlineTextBox::paintDecoration( QPainter *pt, const Font *f, int _tx, int _ty, int deco) +void InlineTextBox::paintDecoration( TQPainter *pt, const Font *f, int _tx, int _ty, int deco) { _tx += m_x; _ty += m_y; @@ -280,7 +280,7 @@ void InlineTextBox::paintDecoration( QPainter *pt, const Font *f, int _tx, int _ RenderObject *p = object(); - QColor underline, overline, linethrough; + TQColor underline, overline, linethrough; p->getTextDecorationColors(deco, underline, overline, linethrough, p->style()->htmlHacks()); if(deco & UNDERLINE){ @@ -299,18 +299,18 @@ void InlineTextBox::paintDecoration( QPainter *pt, const Font *f, int _tx, int _ // support it. Lars } -void InlineTextBox::paintShadow(QPainter *pt, const Font *f, int _tx, int _ty, const ShadowData *shadow ) +void InlineTextBox::paintShadow(TQPainter *pt, const Font *f, int _tx, int _ty, const ShadowData *shadow ) { int x = m_x + _tx + shadow->x; int y = m_y + _ty + shadow->y; const RenderText* text = renderText(); if (shadow->blur <= 0) { - QColor c = pt->pen().color(); + TQColor c = pt->pen().color(); pt->setPen(shadow->color); f->drawText(pt, x, y+m_baseline, text->str->s, text->str->l, m_start, m_len, m_toAdd, - m_reversed ? QPainter::RTL : QPainter::LTR); + m_reversed ? TQPainter::RTL : TQPainter::LTR); pt->setPen(c); } @@ -322,19 +322,19 @@ void InlineTextBox::paintShadow(QPainter *pt, const Font *f, int _tx, int _ty, c const int gray = qGray(color); const bool inverse = (gray < 100); const QRgb bgColor = (inverse) ? qRgb(255,255,255) : qRgb(0,0,0); - QPixmap pixmap(w, h); + TQPixmap pixmap(w, h); pixmap.fill(bgColor); - QPainter p; + TQPainter p; p.begin(&pixmap); p.setPen(shadow->color); p.setFont(pt->font()); f->drawText(&p, thickness, thickness+m_baseline, text->str->s, text->str->l, m_start, m_len, m_toAdd, - m_reversed ? QPainter::RTL : QPainter::LTR); + m_reversed ? TQPainter::RTL : TQPainter::LTR); p.end(); - QImage img = pixmap.convertToImage().convertDepth(32); + TQImage img = pixmap.convertToImage().convertDepth(32); int md = thickness*thickness; // max-dist^2 @@ -381,7 +381,7 @@ void InlineTextBox::paintShadow(QPainter *pt, const Font *f, int _tx, int _ty, c } } - QImage res(w,h,32); + TQImage res(w,h,32); res.setAlphaBuffer(true); int r = qRed(color); int g = qGreen(color); @@ -453,7 +453,7 @@ FindSelectionResult InlineTextBox::checkSelectionPoint(int _x, int _y, int _tx, if (justified) { for( int i = 0; i < m_len; i++ ) - if ( text->str->s[m_start+i].category() == QChar::Separator_Space ) + if ( text->str->s[m_start+i].category() == TQChar::Separator_Space ) numSpaces++; }/*end if*/ @@ -465,7 +465,7 @@ FindSelectionResult InlineTextBox::checkSelectionPoint(int _x, int _y, int _tx, delta -= m_width; while(pos < m_len) { int w = f->width( text->str->s, text->str->l, m_start + pos); - if (justified && text->str->s[m_start + pos].category() == QChar::Separator_Space) + if (justified && text->str->s[m_start + pos].category() == TQChar::Separator_Space) w += justifyWidth(numSpaces, toAdd); int w2 = w/2; w -= w2; @@ -477,7 +477,7 @@ FindSelectionResult InlineTextBox::checkSelectionPoint(int _x, int _y, int _tx, } else { while(pos < m_len) { int w = f->width( text->str->s, text->str->l, m_start + pos); - if (justified && text->str->s[m_start + pos].category() == QChar::Separator_Space) + if (justified && text->str->s[m_start + pos].category() == TQChar::Separator_Space) w += justifyWidth(numSpaces, toAdd); int w2 = w/2; w -= w2; @@ -522,7 +522,7 @@ int InlineTextBox::widthFromStart(int pos) const const RenderText *t = renderText(); Q_ASSERT(t->isText()); const Font *f = t->htmlFont(m_firstLine); - const QFontMetrics &fm = t->fontMetrics(m_firstLine); + const TQFontMetrics &fm = t->fontMetrics(m_firstLine); int numSpaces = 0; // consider spacing for justified text @@ -531,9 +531,9 @@ int InlineTextBox::widthFromStart(int pos) const if (justified && m_toAdd > 0) do { //kdDebug(6000) << "justify" << endl; -// QConstString cstr = QConstString(t->str->s + m_start, m_len); +// TQConstString cstr = TQConstString(t->str->s + m_start, m_len); for( int i = 0; i < m_len; i++ ) - if ( t->str->s[m_start+i].category() == QChar::Separator_Space ) + if ( t->str->s[m_start+i].category() == TQChar::Separator_Space ) numSpaces++; if (numSpaces == 0) break; @@ -543,7 +543,7 @@ int InlineTextBox::widthFromStart(int pos) const int current = 0; // current position while (current < pos) { // add spacing - while (current < pos && t->str->s[m_start + current].category() == QChar::Separator_Space) { + while (current < pos && t->str->s[m_start + current].category() == TQChar::Separator_Space) { w += f->getWordSpacing(); w += f->getLetterSpacing(); w += justifyWidth(numSpaces, toAdd); @@ -553,7 +553,7 @@ int InlineTextBox::widthFromStart(int pos) const if (current >= pos) break; // seek next space - while (current < pos && t->str->s[m_start + current].category() != QChar::Separator_Space) + while (current < pos && t->str->s[m_start + current].category() != TQChar::Separator_Space) current++; // check run without spaces @@ -661,7 +661,7 @@ int InlineTextBoxArray::findFirstMatching(Item d) const if ( (*this)[mid] == 0 ) // null item greater res = -1; else - res = ((QGVector*)this)->compareItems( d, (*this)[mid] ); + res = ((TQGVector*)this)->compareItems( d, (*this)[mid] ); if ( res < 0 ) n2 = mid - 1; else if ( res > 0 ) @@ -674,7 +674,7 @@ int InlineTextBoxArray::findFirstMatching(Item d) const /* if ( !found ) return -1; */ // search to first one equal or bigger - while ( found && (mid > 0) && !((QGVector*)this)->compareItems(d, (*this)[mid-1]) ) + while ( found && (mid > 0) && !((TQGVector*)this)->compareItems(d, (*this)[mid-1]) ) mid--; return mid; } @@ -697,7 +697,7 @@ RenderText::RenderText(DOM::NodeImpl* node, DOMStringImpl *_str) m_hasReturn = true; #ifdef DEBUG_LAYOUT - QConstString cstr(str->s, str->l); + TQConstString cstr(str->s, str->l); kdDebug( 6040 ) << "RenderText ctr( "<< cstr.string().length() << " ) '" << cstr.string() << "'" << endl; #endif } @@ -931,7 +931,7 @@ void RenderText::caretPos(int offset, int flags, int &_x, int &_y, int &width, i RenderText *t = s->renderText(); // kdDebug(6040) << "offset="<<offset << " pos="<<pos << endl; - const QFontMetrics &fm = t->metrics( s->m_firstLine ); + const TQFontMetrics &fm = t->metrics( s->m_firstLine ); height = fm.height(); // s->m_height; _x = s->m_x + s->widthFromStart(pos); @@ -1150,7 +1150,7 @@ int RenderText::inlineYPos() const return m_lines.isEmpty() ? 0 : m_lines[0]->yPos(); } -const QFont &RenderText::font() +const TQFont &RenderText::font() { return style()->font(); } @@ -1188,7 +1188,7 @@ void RenderText::setText(DOMStringImpl *text, bool force) if (prevStr->length() == 0) continue; - QChar c = (*prevStr)[prevStr->length() - 1]; + TQChar c = (*prevStr)[prevStr->length() - 1]; if (!c.isSpace()) runOnString = true; @@ -1218,7 +1218,7 @@ void RenderText::setText(DOMStringImpl *text, bool force) setNeedsLayoutAndMinMaxRecalc(); #ifdef BIDI_DEBUG - QConstString cstr(str->s, str->l); + TQConstString cstr(str->s, str->l); kdDebug( 6040 ) << "RenderText::setText( " << cstr.string().length() << " ) '" << cstr.string() << "'" << endl; #endif } @@ -1244,7 +1244,7 @@ short RenderText::lineHeight( bool firstLine ) const short RenderText::baselinePosition( bool firstLine ) const { - const QFontMetrics &fm = metrics( firstLine ); + const TQFontMetrics &fm = metrics( firstLine ); return fm.ascent() + ( lineHeight( firstLine ) - fm.height() ) / 2; } @@ -1268,8 +1268,8 @@ void RenderText::position(InlineBox* box, int from, int len, bool reverse) reverse = reverse && !style()->visuallyOrdered(); #ifdef DEBUG_LAYOUT - QChar *ch = str->s+from; - QConstString cstr(ch, len); + TQChar *ch = str->s+from; + TQConstString cstr(ch, len); #endif KHTMLAssert(box->isInlineTextBox()); @@ -1337,7 +1337,7 @@ void RenderText::repaint(Priority p) bool RenderText::isFixedWidthFont() const { - return QFontInfo(style()->font()).fixedPitch(); + return TQFontInfo(style()->font()).fixedPitch(); } short RenderText::verticalPositionHint( bool firstLine ) const @@ -1345,7 +1345,7 @@ short RenderText::verticalPositionHint( bool firstLine ) const return parent()->verticalPositionHint( firstLine ); } -const QFontMetrics &RenderText::metrics(bool firstLine) const +const TQFontMetrics &RenderText::metrics(bool firstLine) const { if( firstLine && hasFirstLine() ) { RenderStyle *pseudoStyle = style()->getPseudoStyle(RenderStyle::FIRST_LINE); @@ -1372,7 +1372,7 @@ bool RenderText::containsOnlyWhitespace(unsigned int from, unsigned int len) con { unsigned int currPos; for (currPos = from; - currPos < from+len && (str->s[currPos] == '\n' || str->s[currPos].direction() == QChar::DirWS); + currPos < from+len && (str->s[currPos] == '\n' || str->s[currPos].direction() == TQChar::DirWS); currPos++); return currPos >= (from+len); } @@ -1407,9 +1407,9 @@ void RenderText::trimmedMinMaxWidth(short& beginMinW, bool& beginWS, hasBreakableChar = m_hasBreakableChar; hasBreak = m_hasBreak; - if (stripFrontSpaces && (str->s[0].direction() == QChar::DirWS || (!preserveLF && str->s[0] == '\n'))) { + if (stripFrontSpaces && (str->s[0].direction() == TQChar::DirWS || (!preserveLF && str->s[0] == '\n'))) { const Font *f = htmlFont( false ); - QChar space[1]; space[0] = ' '; + TQChar space[1]; space[0] = ' '; int spaceWidth = f->width(space, 1, 0); maxW -= spaceWidth; } @@ -1459,12 +1459,12 @@ void RenderText::trimmedMinMaxWidth(short& beginMinW, bool& beginWS, #ifdef ENABLE_DUMP -static QString quoteAndEscapeNonPrintables(const QString &s) +static TQString quoteAndEscapeNonPrintables(const TQString &s) { - QString result; + TQString result; result += '"'; for (uint i = 0; i != s.length(); ++i) { - QChar c = s.at(i); + TQChar c = s.at(i); if (c == '\\') { result += "\\\\"; } else if (c == '"') { @@ -1474,7 +1474,7 @@ static QString quoteAndEscapeNonPrintables(const QString &s) if (u >= 0x20 && u < 0x7F) { result += c; } else { - QString hex; + TQString hex; hex.sprintf("\\x{%X}", u); result += hex; } @@ -1484,13 +1484,13 @@ static QString quoteAndEscapeNonPrintables(const QString &s) return result; } -static void writeTextRun(QTextStream &ts, const RenderText &o, const InlineTextBox &run) +static void writeTextRun(TQTextStream &ts, const RenderText &o, const InlineTextBox &run) { ts << "text run at (" << run.m_x << "," << run.m_y << ") width " << run.m_width << ": " << quoteAndEscapeNonPrintables(o.data().string().mid(run.m_start, run.m_len)); } -void RenderText::dump(QTextStream &stream, const QString &ind) const +void RenderText::dump(TQTextStream &stream, const TQString &ind) const { RenderObject::dump( stream, ind ); diff --git a/khtml/rendering/render_text.h b/khtml/rendering/render_text.h index c65973c99..2b75043a1 100644 --- a/khtml/rendering/render_text.h +++ b/khtml/rendering/render_text.h @@ -30,7 +30,7 @@ #include "rendering/render_object.h" #include "rendering/render_line.h" -#include <qptrvector.h> +#include <tqptrvector.h> #include <assert.h> class QPainter; @@ -80,9 +80,9 @@ public: virtual bool isInlineTextBox() const { return true; } void paint(RenderObject::PaintInfo& i, int tx, int ty); - void paintDecoration(QPainter *pt, const Font *f, int _tx, int _ty, int decoration); - void paintShadow(QPainter *pt, const Font* f, int _tx, int _ty, const ShadowData *shadow ); - void paintSelection(const Font *f, RenderText *text, QPainter *p, RenderStyle* style, int tx, int ty, int startPos, int endPos, int deco); + void paintDecoration(TQPainter *pt, const Font *f, int _tx, int _ty, int decoration); + void paintShadow(TQPainter *pt, const Font* f, int _tx, int _ty, const ShadowData *shadow ); + void paintSelection(const Font *f, RenderText *text, TQPainter *p, RenderStyle* style, int tx, int ty, int startPos, int endPos, int deco); void selectionStartEnd(int& sPos, int& ePos); RenderObject::SelectionState selectionState(); @@ -147,7 +147,7 @@ private: friend class RenderText; }; -class InlineTextBoxArray : public QPtrVector<InlineTextBox> +class InlineTextBoxArray : public TQPtrVector<InlineTextBox> { public: InlineTextBoxArray(); @@ -193,7 +193,7 @@ public: SelPointState & ); unsigned int length() const { if (str) return str->l; else return 0; } - QChar *text() const { if (str) return str->s; else return 0; } + TQChar *text() const { if (str) return str->s; else return 0; } unsigned int stringLength() const { return str->l; } // non virtual implementation of length() virtual void position(InlineBox* box, int from, int len, bool reverse); @@ -231,7 +231,7 @@ public: bool hasReturn() const { return m_hasReturn; } - virtual const QFont &font(); + virtual const TQFont &font(); virtual short verticalPositionHint( bool firstLine ) const; bool isFixedWidthFont() const; @@ -250,7 +250,7 @@ public: virtual void repaint(Priority p=NormalPriority); bool hasBreakableChar() const { return m_hasBreakableChar; } - const QFontMetrics &metrics(bool firstLine) const; + const TQFontMetrics &metrics(bool firstLine) const; const Font *htmlFont(bool firstLine) const; DOM::TextImpl *element() const @@ -274,7 +274,7 @@ public: const InlineTextBoxArray &inlineTextBoxes() const { return m_lines; } #ifdef ENABLE_DUMP - virtual void dump(QTextStream &stream, const QString &ind) const; + virtual void dump(TQTextStream &stream, const TQString &ind) const; #endif /** Find the text box that includes the character at @p offset diff --git a/khtml/rendering/table_layout.cpp b/khtml/rendering/table_layout.cpp index bf3daad3a..7b5215d02 100644 --- a/khtml/rendering/table_layout.cpp +++ b/khtml/rendering/table_layout.cpp @@ -268,7 +268,7 @@ void FixedTableLayout::layout() #endif - QMemArray<int> calcWidth; + TQMemArray<int> calcWidth; calcWidth.resize( nEffCols ); calcWidth.fill( -1 ); diff --git a/khtml/rendering/table_layout.h b/khtml/rendering/table_layout.h index bc28a91a5..cbaf6d3a7 100644 --- a/khtml/rendering/table_layout.h +++ b/khtml/rendering/table_layout.h @@ -23,7 +23,7 @@ #ifndef TABLE_LAYOUT_H #define TABLE_LAYOUT_H -#include <qmemarray.h> +#include <tqmemarray.h> #include <misc/khtmllayout.h> namespace khtml { @@ -60,7 +60,7 @@ public: protected: int calcWidthArray(); - QMemArray<Length> width; + TQMemArray<Length> width; }; // ------------------------------------------------------------------------- @@ -100,8 +100,8 @@ protected: short calcWidth; }; - QMemArray<Layout> layoutStruct; - QMemArray<RenderTableCell *>spanCells; + TQMemArray<Layout> layoutStruct; + TQMemArray<RenderTableCell *>spanCells; bool hasPercent : 1; mutable bool percentagesDirty : 1; mutable bool effWidthDirty : 1; diff --git a/khtml/test_regression.cpp b/khtml/test_regression.cpp index 2e67b614e..9c10083c3 100644 --- a/khtml/test_regression.cpp +++ b/khtml/test_regression.cpp @@ -32,8 +32,8 @@ #include <kapplication.h> #include <kstandarddirs.h> -#include <qimage.h> -#include <qfile.h> +#include <tqimage.h> +#include <tqfile.h> #include "test_regression.h" #include <unistd.h> #include <stdio.h> @@ -67,20 +67,20 @@ #include <ksimpleconfig.h> #include <kglobalsettings.h> -#include <qcolor.h> -#include <qcursor.h> -#include <qdir.h> -#include <qobject.h> -#include <qpushbutton.h> -#include <qscrollview.h> -#include <qstring.h> -#include <qtextstream.h> -#include <qvaluelist.h> -#include <qwidget.h> -#include <qfileinfo.h> -#include <qtimer.h> +#include <tqcolor.h> +#include <tqcursor.h> +#include <tqdir.h> +#include <tqobject.h> +#include <tqpushbutton.h> +#include <tqscrollview.h> +#include <tqstring.h> +#include <tqtextstream.h> +#include <tqvaluelist.h> +#include <tqwidget.h> +#include <tqfileinfo.h> +#include <tqtimer.h> #include <kstatusbar.h> -#include <qfileinfo.h> +#include <tqfileinfo.h> #include "misc/decoder.h" #include "dom/dom2_range.h" @@ -118,9 +118,9 @@ PartMonitor::PartMonitor(KHTMLPart *_part) { m_part = _part; m_completed = false; - connect(m_part,SIGNAL(completed()),this,SLOT(partCompleted())); + connect(m_part,TQT_SIGNAL(completed()),this,TQT_SLOT(partCompleted())); m_timer_waits = 200; - m_timeout_timer = new QTimer(this); + m_timeout_timer = new TQTimer(this); } PartMonitor::~PartMonitor() @@ -141,12 +141,12 @@ void PartMonitor::waitForCompletion() kapp->enter_loop(); - //connect(m_timeout_timer, SIGNAL(timeout()), this, SLOT( timeout() ) ); + //connect(m_timeout_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT( timeout() ) ); //m_timeout_timer->stop(); //m_timeout_timer->start( visual ? 100 : 2, true ); } - QTimer::singleShot( 0, this, SLOT( finishTimers() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( finishTimers() ) ); kapp->enter_loop(); } @@ -161,7 +161,7 @@ void PartMonitor::finishTimers() --m_timer_waits; if ( m_timer_waits && (w && w->winq->hasTimers()) || m_part->inProgress()) { // wait a bit - QTimer::singleShot( 10, this, SLOT(finishTimers() ) ); + TQTimer::singleShot( 10, this, TQT_SLOT(finishTimers() ) ); return; } kapp->exit_loop(); @@ -172,9 +172,9 @@ void PartMonitor::partCompleted() m_completed = true; RenderWidget::flushWidgetResizes(); m_timeout_timer->stop(); - connect(m_timeout_timer, SIGNAL(timeout()),this, SLOT( timeout() ) ); + connect(m_timeout_timer, TQT_SIGNAL(timeout()),this, TQT_SLOT( timeout() ) ); m_timeout_timer->start( visual ? 100 : 2, true ); - disconnect(m_part,SIGNAL(completed()),this,SLOT(partCompleted())); + disconnect(m_part,TQT_SIGNAL(completed()),this,TQT_SLOT(partCompleted())); } static void signal_handler( int ) @@ -217,15 +217,15 @@ Value RegTestFunction::call(ExecState *exec, Object &/*thisObj*/, const List &ar UString str = args[0].toString(exec); if ( str.qstring().lower().find( "failed!" ) >= 0 ) m_regTest->saw_failure = true; - QString res = str.qstring().replace('\007', ""); + TQString res = str.qstring().replace('\007', ""); m_regTest->m_currentOutput += res + "\n"; break; } case ReportResult: { bool passed = args[0].toBoolean(exec); - QString description = args[1].toString(exec).qstring(); + TQString description = args[1].toString(exec).qstring(); if (args[1].isA(UndefinedType) || args[1].isA(NullType)) - description = QString::null; + description = TQString::null; m_regTest->reportResult(passed,description); if ( !passed ) m_regTest->saw_failure = true; @@ -238,7 +238,7 @@ Value RegTestFunction::call(ExecState *exec, Object &/*thisObj*/, const List &ar docimpl->updateRendering(); docimpl->view()->layout(); } - QString filename = args[0].toString(exec).qstring(); + TQString filename = args[0].toString(exec).qstring(); filename = RegressionTest::curr->m_currentCategory+"/"+filename; int failures = RegressionTest::NoFailure; if ( m_regTest->m_genOutput ) { @@ -316,8 +316,8 @@ Value KHTMLPartFunction::call(ExecState *exec, Object &/*thisObj*/, const List & return Undefined(); } - QString filename = args[0].toString(exec).qstring(); - QString fullFilename = QFileInfo(RegressionTest::curr->m_currentBase+"/"+filename).absFilePath(); + TQString filename = args[0].toString(exec).qstring(); + TQString fullFilename = TQFileInfo(RegressionTest::curr->m_currentBase+"/"+filename).absFilePath(); KURL url; url.setProtocol("file"); url.setPath(fullFilename); @@ -337,16 +337,16 @@ Value KHTMLPartFunction::call(ExecState *exec, Object &/*thisObj*/, const List & return Undefined(); } - QString filename = args[0].toString(exec).qstring(); - QString url = args[1].toString(exec).qstring(); - QFile file(RegressionTest::curr->m_currentBase+"/"+filename); + TQString filename = args[0].toString(exec).qstring(); + TQString url = args[1].toString(exec).qstring(); + TQFile file(RegressionTest::curr->m_currentBase+"/"+filename); if (!file.open(IO_ReadOnly)) { exec->setException(Error::create(exec, GeneralError, - QString("Error reading " + filename).latin1())); + TQString("Error reading " + filename).latin1())); } else { - QByteArray fileData; - QDataStream stream(fileData,IO_WriteOnly); + TQByteArray fileData; + TQDataStream stream(fileData,IO_WriteOnly); char buf[1024]; int bytesread; while (!file.atEnd()) { @@ -354,7 +354,7 @@ Value KHTMLPartFunction::call(ExecState *exec, Object &/*thisObj*/, const List & stream.writeRawBytes(buf,bytesread); } file.close(); - QString contents(fileData); + TQString contents(fileData); PartMonitor pm(m_part); m_part->begin(KURL( url )); m_part->write(contents); @@ -365,12 +365,12 @@ Value KHTMLPartFunction::call(ExecState *exec, Object &/*thisObj*/, const List & break; } case Begin: { - QString url = args[0].toString(exec).qstring(); + TQString url = args[0].toString(exec).qstring(); m_part->begin(KURL( url )); break; } case Write: { - QString str = args[0].toString(exec).qstring(); + TQString str = args[0].toString(exec).qstring(); m_part->write(str); break; } @@ -380,7 +380,7 @@ Value KHTMLPartFunction::call(ExecState *exec, Object &/*thisObj*/, const List & break; } case ExecuteScript: { - QString code = args[0].toString(exec).qstring(); + TQString code = args[0].toString(exec).qstring(); Completion comp; KJSProxy *proxy = m_part->jScript(); proxy->evaluate("",0,code,0,&comp); @@ -422,7 +422,7 @@ static KCmdLineOptions options[] = KCmdLineLastOption }; -static bool existsDir(QCString dir) +static bool existsDir(TQCString dir) { struct stat st; @@ -438,7 +438,7 @@ int main(int argc, char *argv[]) exit(1); } - QString kh("/var/tmp/%1_non_existant"); + TQString kh("/var/tmp/%1_non_existant"); kh = kh.arg( pw->pw_name ); setenv( "KDEHOME", kh.latin1(), 1 ); setenv( "LC_ALL", "C", 1 ); @@ -447,7 +447,7 @@ int main(int argc, char *argv[]) signal( SIGALRM, signal_handler ); // workaround various Qt crashes by always enforcing a TrueColor visual - QApplication::setColorSpec( QApplication::ManyColor ); + TQApplication::setColorSpec( TQApplication::ManyColor ); KCmdLineArgs::init(argc, argv, "testregression", "TestRegression", "Regression tester for khtml", "1.0"); @@ -455,7 +455,7 @@ int main(int argc, char *argv[]) KCmdLineArgs *args = KCmdLineArgs::parsedArgs( ); - QCString baseDir = args->getOption("base"); + TQCString baseDir = args->getOption("base"); if ( args->count() < 1 && baseDir.isEmpty() ) { KCmdLineArgs::usage(); @@ -465,12 +465,12 @@ int main(int argc, char *argv[]) int testcase_index = 0; if (baseDir.isEmpty()) baseDir = args->arg(testcase_index++); - QFileInfo bdInfo(baseDir); - baseDir = QFile::encodeName(bdInfo.absFilePath()); + TQFileInfo bdInfo(baseDir); + baseDir = TQFile::encodeName(bdInfo.absFilePath()); const char *subdirs[] = {"tests", "baseline", "output", "resources"}; for ( int i = 0; i < 3; i++ ) { - QFileInfo sourceDir(QFile::encodeName( baseDir ) + "/" + subdirs[i]); + TQFileInfo sourceDir(TQFile::encodeName( baseDir ) + "/" + subdirs[i]); if ( !sourceDir.exists() || !sourceDir.isDir() ) { fprintf(stderr,"ERROR: Source directory \"%s/%s\": no such directory.\n", (const char *)baseDir, subdirs[i]); exit(1); @@ -479,14 +479,14 @@ int main(int argc, char *argv[]) if (args->isSet("xvfb")) { - QString xvfbPath = KStandardDirs::findExe("Xvfb"); + TQString xvfbPath = KStandardDirs::findExe("Xvfb"); if ( xvfbPath.isEmpty() ) { fprintf( stderr, "ERROR: We need Xvfb to be installed for reliable results\n" ); exit( 1 ); } - QCString xvfbPath8 = QFile::encodeName(xvfbPath); - QStringList fpaths; + TQCString xvfbPath8 = TQFile::encodeName(xvfbPath); + TQStringList fpaths; fpaths.append(baseDir+"/resources"); const char* const fontdirs[] = { "75dpi", "misc", "Type1" }; @@ -495,15 +495,15 @@ int main(int argc, char *argv[]) for (size_t fp=0; fp < sizeof(fontpaths)/sizeof(*fontpaths); ++fp) for (size_t fd=0; fd < sizeof(fontdirs)/sizeof(*fontdirs); ++fd) - if (existsDir(QCString(fontpaths[fp])+QCString(fontdirs[fd]))) + if (existsDir(TQCString(fontpaths[fp])+TQCString(fontdirs[fd]))) if (strcmp(fontdirs[fd] , "Type1")) - fpaths.append(QCString(fontpaths[fp])+QCString(fontdirs[fd])+":unscaled"); + fpaths.append(TQCString(fontpaths[fp])+TQCString(fontdirs[fd])+":unscaled"); else - fpaths.append(QCString(fontpaths[fp])+QCString(fontdirs[fd])); + fpaths.append(TQCString(fontpaths[fp])+TQCString(fontdirs[fd])); xvfb = fork(); if ( !xvfb ) { - QCString buffer = fpaths.join(",").latin1(); + TQCString buffer = fpaths.join(",").latin1(); execl( xvfbPath8.data(), xvfbPath8.data(), "-once", "-dpi", "100", "-screen", "0", "1024x768x16", "-ac", "-fp", buffer.data(), ":47", (char*)NULL ); } @@ -531,7 +531,7 @@ int main(int argc, char *argv[]) cfg.writeEntry( "FantasyFont", HTML_DEFAULT_VIEW_FANTASY_FONT ); cfg.writeEntry( "MinimumFontSize", HTML_DEFAULT_MIN_FONT_SIZE ); cfg.writeEntry( "MediumFontSize", 10 ); - cfg.writeEntry( "Fonts", QStringList() ); + cfg.writeEntry( "Fonts", TQStringList() ); cfg.writeEntry( "DefaultEncoding", "" ); cfg.setGroup("Java/JavaScript Settings"); cfg.writeEntry( "WindowOpenPolicy", KHTMLSettings::KJSWindowOpenAllow); @@ -548,7 +548,7 @@ int main(int argc, char *argv[]) 171, 7101, 7002, 7019, 7027, 7014, 7011, 6070, 6080, 6090, 0}; for ( int i = 0; areas[i]; ++i ) { - dc.setGroup( QString::number( areas[i] ) ); + dc.setGroup( TQString::number( areas[i] ) ); dc.writeEntry( "InfoOutput", 4 ); } dc.sync(); @@ -593,10 +593,10 @@ int main(int argc, char *argv[]) args->isSet("genoutput"), !args->isSet( "html" ), !args->isSet( "js" )); - QObject::connect(part->browserExtension(), SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)), - regressionTest, SLOT(slotOpenURL(const KURL&, const KParts::URLArgs &))); - QObject::connect(part->browserExtension(), SIGNAL(resizeTopLevelWidget( int, int )), - regressionTest, SLOT(resizeTopLevelWidget( int, int ))); + TQObject::connect(part->browserExtension(), TQT_SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)), + regressionTest, TQT_SLOT(slotOpenURL(const KURL&, const KParts::URLArgs &))); + TQObject::connect(part->browserExtension(), TQT_SIGNAL(resizeTopLevelWidget( int, int )), + regressionTest, TQT_SLOT(resizeTopLevelWidget( int, int ))); bool result = false; QCStringList tests = args->getOptionList("test"); @@ -604,7 +604,7 @@ int main(int argc, char *argv[]) for (; testcase_index < args->count(); testcase_index++) tests << args->arg(testcase_index); if (tests.count() > 0) - for (QValueListConstIterator<QCString> it = tests.begin(); it != tests.end(); ++it) { + for (TQValueListConstIterator<TQCString> it = tests.begin(); it != tests.end(); ++it) { result = regressionTest->runTests(*it,true); if (!result) break; } @@ -636,10 +636,10 @@ int main(int argc, char *argv[]) if ( regressionTest->m_errors ) printf("Errors: %d\n",regressionTest->m_errors); - QFile list( regressionTest->m_outputDir + "/links.html" ); + TQFile list( regressionTest->m_outputDir + "/links.html" ); list.open( IO_WriteOnly|IO_Append ); - QString link, cl; - link = QString( "<hr>%1 failures. (%2 expected failures)" ) + TQString link, cl; + link = TQString( "<hr>%1 failures. (%2 expected failures)" ) .arg(regressionTest->m_failures_work ) .arg( regressionTest->m_failures_fail ); list.writeBlock( link.latin1(), link.length() ); @@ -670,9 +670,9 @@ int main(int argc, char *argv[]) RegressionTest *RegressionTest::curr = 0; -RegressionTest::RegressionTest(KHTMLPart *part, const QString &baseDir, const QString &outputDir, +RegressionTest::RegressionTest(KHTMLPart *part, const TQString &baseDir, const TQString &outputDir, bool _genOutput, bool runJS, bool runHTML) - : QObject(part) + : TQObject(part) { m_part = part; m_baseDir = baseDir; @@ -692,9 +692,9 @@ RegressionTest::RegressionTest(KHTMLPart *part, const QString &baseDir, const QS m_failures_work = m_failures_fail = 0; m_errors = 0; - ::unlink( QFile::encodeName( m_outputDir + "/links.html" ) ); - QFile f( m_outputDir + "/empty.html" ); - QString s; + ::unlink( TQFile::encodeName( m_outputDir + "/links.html" ) ); + TQFile f( m_outputDir + "/empty.html" ); + TQString s; f.open( IO_WriteOnly | IO_Truncate ); s = "<html><body>Follow the white rabbit"; f.writeBlock( s.latin1(), s.length() ); @@ -710,22 +710,22 @@ RegressionTest::RegressionTest(KHTMLPart *part, const QString &baseDir, const QS curr = this; } -#include <qobjectlist.h> +#include <tqobjectlist.h> -static QStringList readListFile( const QString &filename ) +static TQStringList readListFile( const TQString &filename ) { // Read ignore file for this directory - QString ignoreFilename = filename; - QFileInfo ignoreInfo(ignoreFilename); - QStringList ignoreFiles; + TQString ignoreFilename = filename; + TQFileInfo ignoreInfo(ignoreFilename); + TQStringList ignoreFiles; if (ignoreInfo.exists()) { - QFile ignoreFile(ignoreFilename); + TQFile ignoreFile(ignoreFilename); if (!ignoreFile.open(IO_ReadOnly)) { fprintf(stderr,"Can't open %s\n",ignoreFilename.latin1()); exit(1); } - QTextStream ignoreStream(&ignoreFile); - QString line; + TQTextStream ignoreStream(&ignoreFile); + TQString line; while (!(line = ignoreStream.readLine()).isNull()) ignoreFiles.append(line); ignoreFile.close(); @@ -738,17 +738,17 @@ RegressionTest::~RegressionTest() delete m_paintBuffer; } -bool RegressionTest::runTests(QString relPath, bool mustExist, int known_failure) +bool RegressionTest::runTests(TQString relPath, bool mustExist, int known_failure) { - m_currentOutput = QString::null; + m_currentOutput = TQString::null; - if (!QFile(m_baseDir + "/tests/"+relPath).exists()) { + if (!TQFile(m_baseDir + "/tests/"+relPath).exists()) { fprintf(stderr,"%s: No such file or directory\n",relPath.latin1()); return false; } - QString fullPath = m_baseDir + "/tests/"+relPath; - QFileInfo info(fullPath); + TQString fullPath = m_baseDir + "/tests/"+relPath; + TQFileInfo info(fullPath); if (!info.exists() && mustExist) { fprintf(stderr,"%s: No such file or directory\n",relPath.latin1()); @@ -761,14 +761,14 @@ bool RegressionTest::runTests(QString relPath, bool mustExist, int known_failure } if (info.isDir()) { - QStringList ignoreFiles = readListFile( m_baseDir + "/tests/"+relPath+"/ignore" ); - QStringList failureFiles = readListFile( m_baseDir + "/tests/"+relPath+"/KNOWN_FAILURES" ); + TQStringList ignoreFiles = readListFile( m_baseDir + "/tests/"+relPath+"/ignore" ); + TQStringList failureFiles = readListFile( m_baseDir + "/tests/"+relPath+"/KNOWN_FAILURES" ); // Run each test in this directory, recusively - QDir sourceDir(m_baseDir + "/tests/"+relPath); + TQDir sourceDir(m_baseDir + "/tests/"+relPath); for (uint fileno = 0; fileno < sourceDir.count(); fileno++) { - QString filename = sourceDir[fileno]; - QString relFilename = relPath.isEmpty() ? filename : relPath+"/"+filename; + TQString filename = sourceDir[fileno]; + TQString relFilename = relPath.isEmpty() ? filename : relPath+"/"+filename; if (filename == "." || filename == ".." || ignoreFiles.contains(filename) ) continue; @@ -790,8 +790,8 @@ bool RegressionTest::runTests(QString relPath, bool mustExist, int known_failure khtml::Cache::init(); - QString relativeDir = QFileInfo(relPath).dirPath(); - QString filename = info.fileName(); + TQString relativeDir = TQFileInfo(relPath).dirPath(); + TQString filename = info.fileName(); m_currentBase = m_baseDir + "/tests/"+relativeDir; m_currentCategory = relativeDir; m_currentTest = filename; @@ -820,7 +820,7 @@ bool RegressionTest::runTests(QString relPath, bool mustExist, int known_failure return true; } -void RegressionTest::getPartDOMOutput( QTextStream &outputStream, KHTMLPart* part, uint indent ) +void RegressionTest::getPartDOMOutput( TQTextStream &outputStream, KHTMLPart* part, uint indent ) { Node node = part->document(); while (!node.isNull()) { @@ -833,22 +833,22 @@ void RegressionTest::getPartDOMOutput( QTextStream &outputStream, KHTMLPart* par switch (node.nodeType()) { case Node::ELEMENT_NODE: { // Sort strings to ensure consistent output - QStringList attrNames; + TQStringList attrNames; NamedNodeMap attrs = node.attributes(); for (uint a = 0; a < attrs.length(); a++) attrNames.append(attrs.item(a).nodeName().string()); attrNames.sort(); - QStringList::iterator it; + TQStringList::iterator it; Element elem(node); for (it = attrNames.begin(); it != attrNames.end(); ++it) { - QString name = *it; - QString value = elem.getAttribute(*it).string(); + TQString name = *it; + TQString value = elem.getAttribute(*it).string(); outputStream << " " << name << "=\"" << value << "\""; } if ( node.handle()->id() == ID_FRAME ) { outputStream << endl; - QString frameName = static_cast<DOM::HTMLFrameElementImpl *>( node.handle() )->name.string(); + TQString frameName = static_cast<DOM::HTMLFrameElementImpl *>( node.handle() )->name.string(); KHTMLPart* frame = part->findFrame( frameName ); Q_ASSERT( frame ); if ( frame ) @@ -910,7 +910,7 @@ void RegressionTest::getPartDOMOutput( QTextStream &outputStream, KHTMLPart* par } } -void RegressionTest::dumpRenderTree( QTextStream &outputStream, KHTMLPart* part ) +void RegressionTest::dumpRenderTree( TQTextStream &outputStream, KHTMLPart* part ) { DOM::DocumentImpl* doc = static_cast<DocumentImpl*>( part->document().handle() ); if ( !doc || !doc->renderer() ) @@ -919,9 +919,9 @@ void RegressionTest::dumpRenderTree( QTextStream &outputStream, KHTMLPart* part // Dump frames if any // Get list of names instead of frames() to sort the list alphabetically - QStringList names = part->frameNames(); + TQStringList names = part->frameNames(); names.sort(); - for ( QStringList::iterator it = names.begin(); it != names.end(); ++it ) { + for ( TQStringList::iterator it = names.begin(); it != names.end(); ++it ) { outputStream << "FRAME: " << (*it) << "\n"; KHTMLPart* frame = part->findFrame( (*it) ); Q_ASSERT( frame ); @@ -930,11 +930,11 @@ void RegressionTest::dumpRenderTree( QTextStream &outputStream, KHTMLPart* part } } -QString RegressionTest::getPartOutput( OutputType type) +TQString RegressionTest::getPartOutput( OutputType type) { // dump out the contents of the rendering & DOM trees - QString dump; - QTextStream outputStream(dump,IO_WriteOnly); + TQString dump; + TQTextStream outputStream(dump,IO_WriteOnly); if ( type == RenderTree ) { dumpRenderTree( outputStream, m_part ); @@ -943,35 +943,35 @@ QString RegressionTest::getPartOutput( OutputType type) getPartDOMOutput( outputStream, m_part, 0 ); } - dump.replace( m_baseDir + "/tests", QString::fromLatin1( "REGRESSION_SRCDIR" ) ); + dump.replace( m_baseDir + "/tests", TQString::fromLatin1( "REGRESSION_SRCDIR" ) ); return dump; } -QImage RegressionTest::renderToImage() +TQImage RegressionTest::renderToImage() { int ew = m_part->view()->contentsWidth(); int eh = m_part->view()->contentsHeight(); if (ew * eh > 4000 * 4000) // don't DoS us - return QImage(); + return TQImage(); - QImage img( ew, eh, 32 ); + TQImage img( ew, eh, 32 ); img.fill( 0xff0000 ); if (!m_paintBuffer ) - m_paintBuffer = new QPixmap( 512, 128, -1, QPixmap::MemoryOptim ); + m_paintBuffer = new TQPixmap( 512, 128, -1, TQPixmap::MemoryOptim ); for ( int py = 0; py < eh; py += 128 ) { for ( int px = 0; px < ew; px += 512 ) { - QPainter* tp = new QPainter; + TQPainter* tp = new QPainter; tp->begin( m_paintBuffer ); tp->translate( -px, -py ); tp->fillRect(px, py, 512, 128, Qt::magenta); - m_part->document().handle()->renderer()->layer()->paint( tp, QRect( px, py, 512, 128 ) ); + m_part->document().handle()->renderer()->layer()->paint( tp, TQRect( px, py, 512, 128 ) ); tp->end(); delete tp; // now fill the chunk into our image - QImage chunk = m_paintBuffer->convertToImage(); + TQImage chunk = m_paintBuffer->convertToImage(); assert( chunk.depth() == 32 ); for ( int y = 0; y < 128 && py + y < eh; ++y ) memcpy( img.scanLine( py+y ) + px*4, chunk.scanLine( y ), kMin( 512, ew-px )*4 ); @@ -982,7 +982,7 @@ QImage RegressionTest::renderToImage() return img; } -bool RegressionTest::imageEqual( const QImage &lhsi, const QImage &rhsi ) +bool RegressionTest::imageEqual( const TQImage &lhsi, const TQImage &rhsi ) { if ( lhsi.width() != rhsi.width() || lhsi.height() != rhsi.height() ) { kdDebug() << "dimensions different " << lhsi.size() << " " << rhsi.size() << endl; @@ -1004,7 +1004,7 @@ bool RegressionTest::imageEqual( const QImage &lhsi, const QImage &rhsi ) ( abs( qGreen( l ) - qGreen(r ) ) < 20 ) && ( abs( qBlue( l ) - qBlue(r ) ) < 20 ) ) continue; - kdDebug() << "pixel (" << x << ", " << y << ") is different " << QColor( lhsi.pixel ( x, y ) ) << " " << QColor( rhsi.pixel ( x, y ) ) << endl; + kdDebug() << "pixel (" << x << ", " << y << ") is different " << TQColor( lhsi.pixel ( x, y ) ) << " " << TQColor( rhsi.pixel ( x, y ) ) << endl; return false; } } @@ -1013,14 +1013,14 @@ bool RegressionTest::imageEqual( const QImage &lhsi, const QImage &rhsi ) return true; } -void RegressionTest::createLink( const QString& test, int failures ) +void RegressionTest::createLink( const TQString& test, int failures ) { createMissingDirs( m_outputDir + "/" + test + "-compare.html" ); - QFile list( m_outputDir + "/links.html" ); + TQFile list( m_outputDir + "/links.html" ); list.open( IO_WriteOnly|IO_Append ); - QString link; - link = QString( "<a href=\"%1\" target=\"content\" title=\"%2\">" ) + TQString link; + link = TQString( "<a href=\"%1\" target=\"content\" title=\"%2\">" ) .arg( test + "-compare.html" ) .arg( test ); link += m_currentTest; @@ -1036,21 +1036,21 @@ void RegressionTest::createLink( const QString& test, int failures ) list.close(); } -void RegressionTest::doJavascriptReport( const QString &test ) +void RegressionTest::doJavascriptReport( const TQString &test ) { - QFile compare( m_outputDir + "/" + test + "-compare.html" ); + TQFile compare( m_outputDir + "/" + test + "-compare.html" ); if ( !compare.open( IO_WriteOnly|IO_Truncate ) ) kdDebug() << "failed to open " << m_outputDir + "/" + test + "-compare.html" << endl; - QString cl; - cl = QString( "<html><head><title>%1</title>" ).arg( test ); + TQString cl; + cl = TQString( "<html><head><title>%1</title>" ).arg( test ); cl += "<body><tt>"; - QString text = "\n" + m_currentOutput; + TQString text = "\n" + m_currentOutput; text.replace( '<', "<" ); text.replace( '>', ">" ); - text.replace( QRegExp( "\nFAILED" ), "\n<span style='color: red'>FAILED</span>" ); - text.replace( QRegExp( "\nFAIL" ), "\n<span style='color: red'>FAIL</span>" ); - text.replace( QRegExp( "\nPASSED" ), "\n<span style='color: green'>PASSED</span>" ); - text.replace( QRegExp( "\nPASS" ), "\n<span style='color: green'>PASS</span>" ); + text.replace( TQRegExp( "\nFAILED" ), "\n<span style='color: red'>FAILED</span>" ); + text.replace( TQRegExp( "\nFAIL" ), "\n<span style='color: red'>FAIL</span>" ); + text.replace( TQRegExp( "\nPASSED" ), "\n<span style='color: green'>PASSED</span>" ); + text.replace( TQRegExp( "\nPASS" ), "\n<span style='color: green'>PASS</span>" ); if ( text.at( 0 ) == '\n' ) text = text.mid( 1, text.length() ); text.replace( '\n', "<br>\n" ); @@ -1066,10 +1066,10 @@ void RegressionTest::doJavascriptReport( const QString &test ) * @return path with all elements replaced by .. and concerning path elements * to be relatively reachable from base. */ -static QString makeRelativePath(const QString &base, const QString &path) +static TQString makeRelativePath(const TQString &base, const TQString &path) { - QString absBase = QFileInfo(base).absFilePath(); - QString absPath = QFileInfo(path).absFilePath(); + TQString absBase = TQFileInfo(base).absFilePath(); + TQString absPath = TQFileInfo(path).absFilePath(); // kdDebug() << "absPath: \"" << absPath << "\"" << endl; // kdDebug() << "absBase: \"" << absBase << "\"" << endl; @@ -1079,8 +1079,8 @@ static QString makeRelativePath(const QString &base, const QString &path) pos++; int newpos = absBase.find('/', pos); if (newpos == -1) newpos = absBase.length(); - QConstString cmpPathComp(absPath.unicode() + pos, newpos - pos); - QConstString cmpBaseComp(absBase.unicode() + pos, newpos - pos); + TQConstString cmpPathComp(absPath.unicode() + pos, newpos - pos); + TQConstString cmpBaseComp(absBase.unicode() + pos, newpos - pos); // kdDebug() << "cmpPathComp: \"" << cmpPathComp.string() << "\"" << endl; // kdDebug() << "cmpBaseComp: \"" << cmpBaseComp.string() << "\"" << endl; // kdDebug() << "pos: " << pos << " newpos: " << newpos << endl; @@ -1092,10 +1092,10 @@ static QString makeRelativePath(const QString &base, const QString &path) // kdDebug() << "basepos " << basepos << " pathpos " << pathpos << endl; - QString rel; + TQString rel; { - QConstString relBase(absBase.unicode() + basepos, absBase.length() - basepos); - QConstString relPath(absPath.unicode() + pathpos, absPath.length() - pathpos); + TQConstString relBase(absBase.unicode() + basepos, absBase.length() - basepos); + TQConstString relPath(absPath.unicode() + pathpos, absPath.length() - pathpos); // generate as many .. as there are path elements in relBase if (relBase.string().length() > 0) { for (int i = relBase.string().contains('/'); i > 0; --i) @@ -1108,10 +1108,10 @@ static QString makeRelativePath(const QString &base, const QString &path) return rel; } -void RegressionTest::doFailureReport( const QString& test, int failures ) +void RegressionTest::doFailureReport( const TQString& test, int failures ) { if ( failures == NoFailure ) { - ::unlink( QFile::encodeName( m_outputDir + "/" + test + "-compare.html" ) ); + ::unlink( TQFile::encodeName( m_outputDir + "/" + test + "-compare.html" ) ); return; } @@ -1122,27 +1122,27 @@ void RegressionTest::doFailureReport( const QString& test, int failures ) return; // no support for both kind } - QFile compare( m_outputDir + "/" + test + "-compare.html" ); + TQFile compare( m_outputDir + "/" + test + "-compare.html" ); - QString testFile = QFileInfo(test).fileName(); + TQString testFile = TQFileInfo(test).fileName(); - QString renderDiff; - QString domDiff; + TQString renderDiff; + TQString domDiff; - QString relOutputDir = makeRelativePath(m_baseDir, m_outputDir); + TQString relOutputDir = makeRelativePath(m_baseDir, m_outputDir); // are blocking reads possible with KProcess? char pwd[PATH_MAX]; (void) getcwd( pwd, PATH_MAX ); - chdir( QFile::encodeName( m_baseDir ) ); + chdir( TQFile::encodeName( m_baseDir ) ); if ( failures & RenderFailure ) { renderDiff += "<pre>"; - FILE *pipe = popen( QString::fromLatin1( "diff -u baseline/%1-render %3/%2-render" ) + FILE *pipe = popen( TQString::fromLatin1( "diff -u baseline/%1-render %3/%2-render" ) .arg ( test, test, relOutputDir ).latin1(), "r" ); - QTextIStream *is = new QTextIStream( pipe ); + TQTextIStream *is = new TQTextIStream( pipe ); for ( int line = 0; line < 100 && !is->eof(); ++line ) { - QString line = is->readLine(); + TQString line = is->readLine(); line = line.replace( '<', "<" ); line = line.replace( '>', ">" ); renderDiff += line + "\n"; @@ -1154,11 +1154,11 @@ void RegressionTest::doFailureReport( const QString& test, int failures ) if ( failures & DomFailure ) { domDiff += "<pre>"; - FILE *pipe = popen( QString::fromLatin1( "diff -u baseline/%1-dom %3/%2-dom" ) + FILE *pipe = popen( TQString::fromLatin1( "diff -u baseline/%1-dom %3/%2-dom" ) .arg ( test, test, relOutputDir ).latin1(), "r" ); - QTextIStream *is = new QTextIStream( pipe ); + TQTextIStream *is = new TQTextIStream( pipe ); for ( int line = 0; line < 100 && !is->eof(); ++line ) { - QString line = is->readLine(); + TQString line = is->readLine(); line = line.replace( '<', "<" ); line = line.replace( '>', ">" ); domDiff += line + "\n"; @@ -1171,13 +1171,13 @@ void RegressionTest::doFailureReport( const QString& test, int failures ) chdir( pwd ); // create a relative path so that it works via web as well. ugly - QString relpath = makeRelativePath(m_outputDir + "/" - + QFileInfo(test).dirPath(), m_baseDir); + TQString relpath = makeRelativePath(m_outputDir + "/" + + TQFileInfo(test).dirPath(), m_baseDir); compare.open( IO_WriteOnly|IO_Truncate ); - QString cl; - cl = QString( "<html><head><title>%1</title>" ).arg( test ); - cl += QString( "<script>\n" + TQString cl; + cl = TQString( "<html><head><title>%1</title>" ).arg( test ); + cl += TQString( "<script>\n" "var pics = new Array();\n" "pics[0]=new Image();\n" "pics[0].src = '%1';\n" @@ -1188,7 +1188,7 @@ void RegressionTest::doFailureReport( const QString& test, int failures ) "var lastb=0;\n" ) .arg( relpath+"/baseline/"+test+"-dump.png" ) .arg( testFile+"-dump.png" ); - cl += QString( "function toggleVisible(visible) {\n" + cl += TQString( "function toggleVisible(visible) {\n" " document.getElementById('render').style.visibility= visible == 'render' ? 'visible' : 'hidden';\n" " document.getElementById('image').style.visibility= visible == 'image' ? 'visible' : 'hidden';\n" " document.getElementById('dom').style.visibility= visible == 'dom' ? 'visible' : 'hidden';\n" @@ -1197,7 +1197,7 @@ void RegressionTest::doFailureReport( const QString& test, int failures ) "document.getElementById('image').style.borderColor = t && !doflicker ? 'red' : 'gray';\n" "toggleVisible('image');\n" "}" ); - cl += QString ( "function runSlideShow(){\n" + cl += TQString ( "function runSlideShow(){\n" " document.getElementById('image').src = pics[t].src;\n" " if (doflicker)\n" " t = 1 - t;\n" @@ -1214,21 +1214,21 @@ void RegressionTest::doFailureReport( const QString& test, int failures ) "}\n" "</script>\n"); - cl += QString ("<style>\n" + cl += TQString ("<style>\n" ".buttondown { cursor: pointer; padding: 0px 20px; color: white; background-color: blue; border: inset blue 2px;}\n" ".button { cursor: pointer; padding: 0px 20px; color: black; background-color: white; border: outset blue 2px;}\n" ".diff { position: absolute; left: 10px; top: 100px; visibility: hidden; border: 1px black solid; background-color: white; color: black; /* width: 800; height: 600; overflow: scroll; */ }\n" "</style>\n" ); if ( failures & PaintFailure ) - cl += QString( "<body onload=\"m(1); show(); runSlideShow();\"" ); + cl += TQString( "<body onload=\"m(1); show(); runSlideShow();\"" ); else if ( failures & RenderFailure ) - cl += QString( "<body onload=\"m(4); toggleVisible('render');\"" ); + cl += TQString( "<body onload=\"m(4); toggleVisible('render');\"" ); else - cl += QString( "<body onload=\"m(5); toggleVisible('dom');\"" ); - cl += QString(" text=black bgcolor=gray>\n<h1>%3</h1>\n" ).arg( test ); + cl += TQString( "<body onload=\"m(5); toggleVisible('dom');\"" ); + cl += TQString(" text=black bgcolor=gray>\n<h1>%3</h1>\n" ).arg( test ); if ( failures & PaintFailure ) - cl += QString ( "<span id='b1' class='buttondown' onclick=\"doflicker=1;show();m(1)\">FLICKER</span> \n" + cl += TQString ( "<span id='b1' class='buttondown' onclick=\"doflicker=1;show();m(1)\">FLICKER</span> \n" "<span id='b2' class='button' onclick=\"doflicker=0;t=0;show();m(2)\">BASE</span> \n" "<span id='b3' class='button' onclick=\"doflicker=0;t=1;show();m(3)\">OUT</span> \n" ); if ( renderDiff.length() ) @@ -1236,11 +1236,11 @@ void RegressionTest::doFailureReport( const QString& test, int failures ) if ( domDiff.length() ) cl += "<span id='b5' class='button' onclick='showDom();m(5);'>D-DIFF</span> \n"; // The test file always exists - except for checkOutput called from *.js files - if ( QFile::exists( m_baseDir + "/tests/"+ test ) ) - cl += QString( "<a class=button href=\"%1\">HTML</a> " ) + if ( TQFile::exists( m_baseDir + "/tests/"+ test ) ) + cl += TQString( "<a class=button href=\"%1\">HTML</a> " ) .arg( relpath+"/tests/"+test ); - cl += QString( "<hr>" + cl += TQString( "<hr>" "<img style='border: solid 5px gray' src=\"%1\" id='image'>" ) .arg( relpath+"/baseline/"+test+"-dump.png" ); @@ -1252,7 +1252,7 @@ void RegressionTest::doFailureReport( const QString& test, int failures ) compare.close(); } -void RegressionTest::testStaticFile(const QString & filename) +void RegressionTest::testStaticFile(const TQString & filename) { qApp->mainWidget()->resize( 800, 600); // restore size @@ -1265,14 +1265,14 @@ void RegressionTest::testStaticFile(const QString & filename) // load page KURL url; url.setProtocol("file"); - url.setPath(QFileInfo(m_baseDir + "/tests/"+filename).absFilePath()); + url.setPath(TQFileInfo(m_baseDir + "/tests/"+filename).absFilePath()); PartMonitor pm(m_part); m_part->openURL(url); pm.waitForCompletion(); m_part->closeURL(); if ( filename.startsWith( "domts/" ) ) { - QString functionname; + TQString functionname; KJS::Completion comp = m_part->jScriptInterpreter()->evaluate("exposeTestFunctionNames();"); /* @@ -1299,7 +1299,7 @@ void RegressionTest::testStaticFile(const QString & filename) KJS::Completion comp2 = m_part->jScriptInterpreter()->evaluate("setUpPage(); " + functionname + "();" ); bool success = ( comp2.complType() == ReturnValue || comp2.complType() == Normal ); - QString description = "DOMTS"; + TQString description = "DOMTS"; if ( comp2.complType() == Throw ) { KJS::Value val = comp2.value(); KJS::Object obj = Object::dynamicCast(val); @@ -1327,7 +1327,7 @@ void RegressionTest::testStaticFile(const QString & filename) if ( m_known_failures & PaintFailure ) m_known_failures = AllFailure; renderToImage().save(m_baseDir + "/baseline/" + filename + "-dump.png","PNG", 60); - printf("Generated %s\n", QString( m_baseDir + "/baseline/" + filename + "-dump.png" ).latin1() ); + printf("Generated %s\n", TQString( m_baseDir + "/baseline/" + filename + "-dump.png" ).latin1() ); reportResult( true, "PAINT" ); } else { int failures = NoFailure; @@ -1354,19 +1354,19 @@ void RegressionTest::testStaticFile(const QString & filename) m_known_failures = back_known_failures; } -void RegressionTest::evalJS( ScriptInterpreter &interp, const QString &filename, bool report_result ) +void RegressionTest::evalJS( ScriptInterpreter &interp, const TQString &filename, bool report_result ) { - QString fullSourceName = filename; - QFile sourceFile(fullSourceName); + TQString fullSourceName = filename; + TQFile sourceFile(fullSourceName); if (!sourceFile.open(IO_ReadOnly)) { fprintf(stderr,"Error reading file %s\n",fullSourceName.latin1()); exit(1); } - QTextStream stream ( &sourceFile ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); - QString code = stream.read(); + TQTextStream stream ( &sourceFile ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString code = stream.read(); sourceFile.close(); saw_failure = false; @@ -1376,12 +1376,12 @@ void RegressionTest::evalJS( ScriptInterpreter &interp, const QString &filename, if ( report_result && !ignore_errors) { bool expected_failure = filename.endsWith( "-n.js" ); if (c.complType() == Throw) { - QString errmsg = c.value().toString(interp.globalExec()).qstring(); + TQString errmsg = c.value().toString(interp.globalExec()).qstring(); if ( !expected_failure ) { printf( "ERROR: %s (%s)\n",filename.latin1(), errmsg.latin1()); m_errors++; } else { - reportResult( true, QString( "Expected Failure: %1" ).arg( errmsg ) ); + reportResult( true, TQString( "Expected Failure: %1" ).arg( errmsg ) ); } } else if ( saw_failure ) { if ( !expected_failure ) @@ -1398,7 +1398,7 @@ public: virtual UString className() const { return "global"; } }; -void RegressionTest::testJSFile(const QString & filename ) +void RegressionTest::testJSFile(const TQString & filename ) { qApp->mainWidget()->resize( 800, 600); // restore size @@ -1416,34 +1416,34 @@ void RegressionTest::testJSFile(const QString & filename ) global.put(exec, "debug", Object(new RegTestFunction(exec,this,RegTestFunction::Print,1) ) ); global.put(exec, "print", Object(new RegTestFunction(exec,this,RegTestFunction::Print,1) ) ); - QStringList dirs = QStringList::split( '/', filename ); + TQStringList dirs = TQStringList::split( '/', filename ); // NOTE: the basename is of little interest here, but the last basedir change // isn't taken in account - QString basedir = m_baseDir + "/tests/"; - for ( QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it ) + TQString basedir = m_baseDir + "/tests/"; + for ( TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it ) { - if ( ! ::access( QFile::encodeName( basedir + "shell.js" ), R_OK ) ) + if ( ! ::access( TQFile::encodeName( basedir + "shell.js" ), R_OK ) ) evalJS( interp, basedir + "shell.js", false ); basedir += *it + "/"; } evalJS( interp, m_baseDir + "/tests/"+ filename, true ); } -RegressionTest::CheckResult RegressionTest::checkPaintdump(const QString &filename) +RegressionTest::CheckResult RegressionTest::checkPaintdump(const TQString &filename) { - QString againstFilename( filename + "-dump.png" ); - QString absFilename = QFileInfo(m_baseDir + "/baseline/" + againstFilename).absFilePath(); + TQString againstFilename( filename + "-dump.png" ); + TQString absFilename = TQFileInfo(m_baseDir + "/baseline/" + againstFilename).absFilePath(); if ( svnIgnored( absFilename ) ) { m_known_failures = NoFailure; return Ignored; } CheckResult result = Failure; - QImage baseline; + TQImage baseline; baseline.load( absFilename, "PNG"); - QImage output = renderToImage(); + TQImage output = renderToImage(); if ( !imageEqual( baseline, output ) ) { - QString outputFilename = m_outputDir + "/" + againstFilename; + TQString outputFilename = m_outputDir + "/" + againstFilename; createMissingDirs(outputFilename ); bool kf = false; @@ -1457,28 +1457,28 @@ RegressionTest::CheckResult RegressionTest::checkPaintdump(const QString &filena output.save(outputFilename, "PNG", 60); } else { - ::unlink( QFile::encodeName( m_outputDir + "/" + againstFilename ) ); + ::unlink( TQFile::encodeName( m_outputDir + "/" + againstFilename ) ); result = Success; } return result; } -RegressionTest::CheckResult RegressionTest::checkOutput(const QString &againstFilename) +RegressionTest::CheckResult RegressionTest::checkOutput(const TQString &againstFilename) { - QString absFilename = QFileInfo(m_baseDir + "/baseline/" + againstFilename).absFilePath(); + TQString absFilename = TQFileInfo(m_baseDir + "/baseline/" + againstFilename).absFilePath(); if ( svnIgnored( absFilename ) ) { m_known_failures = NoFailure; return Ignored; } bool domOut = againstFilename.endsWith( "-dom" ); - QString data = getPartOutput( domOut ? DOMTree : RenderTree ); + TQString data = getPartOutput( domOut ? DOMTree : RenderTree ); data.remove( char( 13 ) ); CheckResult result = Success; // compare result to existing file - QString outputFilename = QFileInfo(m_outputDir + "/" + againstFilename).absFilePath(); + TQString outputFilename = TQFileInfo(m_outputDir + "/" + againstFilename).absFilePath(); bool kf = false; if ( m_known_failures & AllFailure ) kf = true; @@ -1492,30 +1492,30 @@ RegressionTest::CheckResult RegressionTest::checkOutput(const QString &againstFi if ( m_genOutput ) outputFilename = absFilename; - QFile file(absFilename); + TQFile file(absFilename); if (file.open(IO_ReadOnly)) { - QTextStream stream ( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream ( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); - QString fileData = stream.read(); + TQString fileData = stream.read(); result = ( fileData == data ) ? Success : Failure; if ( !m_genOutput && result == Success ) { - ::unlink( QFile::encodeName( outputFilename ) ); + ::unlink( TQFile::encodeName( outputFilename ) ); return Success; } } // generate result file createMissingDirs( outputFilename ); - QFile file2(outputFilename); + TQFile file2(outputFilename); if (!file2.open(IO_WriteOnly)) { fprintf(stderr,"Error writing to file %s\n",outputFilename.latin1()); exit(1); } - QTextStream stream2(&file2); - stream2.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream2(&file2); + stream2.setEncoding( TQTextStream::UnicodeUTF8 ); stream2 << data; if ( m_genOutput ) printf("Generated %s\n", outputFilename.latin1()); @@ -1523,7 +1523,7 @@ RegressionTest::CheckResult RegressionTest::checkOutput(const QString &againstFi return result; } -bool RegressionTest::reportResult(CheckResult result, const QString & description) +bool RegressionTest::reportResult(CheckResult result, const TQString & description) { if ( result == Ignored ) { //printf("IGNORED: "); @@ -1533,7 +1533,7 @@ bool RegressionTest::reportResult(CheckResult result, const QString & descriptio return reportResult( result == Success, description ); } -bool RegressionTest::reportResult(bool passed, const QString & description) +bool RegressionTest::reportResult(bool passed, const TQString & description) { if (m_genOutput) return true; @@ -1562,7 +1562,7 @@ bool RegressionTest::reportResult(bool passed, const QString & description) return passed; } -void RegressionTest::printDescription(const QString& description) +void RegressionTest::printDescription(const TQString& description) { if (!m_currentCategory.isEmpty()) printf("%s/", m_currentCategory.latin1()); @@ -1570,7 +1570,7 @@ void RegressionTest::printDescription(const QString& description) printf("%s", m_currentTest.latin1()); if (!description.isEmpty()) { - QString desc = description; + TQString desc = description; desc.replace( '\n', ' ' ); printf(" [%s]", desc.latin1()); } @@ -1579,28 +1579,28 @@ void RegressionTest::printDescription(const QString& description) fflush(stdout); } -void RegressionTest::createMissingDirs(const QString & filename) +void RegressionTest::createMissingDirs(const TQString & filename) { - QFileInfo dif(filename); - QFileInfo dirInfo( dif.dirPath() ); + TQFileInfo dif(filename); + TQFileInfo dirInfo( dif.dirPath() ); if (dirInfo.exists()) return; - QStringList pathComponents; - QFileInfo parentDir = dirInfo; + TQStringList pathComponents; + TQFileInfo parentDir = dirInfo; pathComponents.prepend(parentDir.absFilePath()); while (!parentDir.exists()) { - QString parentPath = parentDir.absFilePath(); + TQString parentPath = parentDir.absFilePath(); int slashPos = parentPath.findRev('/'); if (slashPos < 0) break; parentPath = parentPath.left(slashPos); pathComponents.prepend(parentPath); - parentDir = QFileInfo(parentPath); + parentDir = TQFileInfo(parentPath); } for (uint pathno = 1; pathno < pathComponents.count(); pathno++) { - if (!QFileInfo(pathComponents[pathno]).exists() && - !QDir(pathComponents[pathno-1]).mkdir(pathComponents[pathno])) { + if (!TQFileInfo(pathComponents[pathno]).exists() && + !TQDir(pathComponents[pathno-1]).mkdir(pathComponents[pathno])) { fprintf(stderr,"Error creating directory %s\n",pathComponents[pathno].latin1()); exit(1); } @@ -1616,16 +1616,16 @@ void RegressionTest::slotOpenURL(const KURL &url, const KParts::URLArgs &args) pm.waitForCompletion(); } -bool RegressionTest::svnIgnored( const QString &filename ) +bool RegressionTest::svnIgnored( const TQString &filename ) { - QFileInfo fi( filename ); - QString ignoreFilename = fi.dirPath() + "/svnignore"; - QFile ignoreFile(ignoreFilename); + TQFileInfo fi( filename ); + TQString ignoreFilename = fi.dirPath() + "/svnignore"; + TQFile ignoreFile(ignoreFilename); if (!ignoreFile.open(IO_ReadOnly)) return false; - QTextStream ignoreStream(&ignoreFile); - QString line; + TQTextStream ignoreStream(&ignoreFile); + TQString line; while (!(line = ignoreStream.readLine()).isNull()) { if ( line == fi.fileName() ) return true; @@ -1637,8 +1637,8 @@ bool RegressionTest::svnIgnored( const QString &filename ) void RegressionTest::resizeTopLevelWidget( int w, int h ) { qApp->mainWidget()->resize( w, h ); - // Since we're not visible, this doesn't have an immediate effect, QWidget posts the event - QApplication::sendPostedEvents( 0, QEvent::Resize ); + // Since we're not visible, this doesn't have an immediate effect, TQWidget posts the event + TQApplication::sendPostedEvents( 0, TQEvent::Resize ); } #include "test_regression.moc" diff --git a/khtml/test_regression.h b/khtml/test_regression.h index c75328a09..5ebfaed87 100644 --- a/khtml/test_regression.h +++ b/khtml/test_regression.h @@ -25,7 +25,7 @@ #include <khtml_part.h> #include <kurl.h> -#include <qobject.h> +#include <tqobject.h> #include <kjs/ustring.h> #include <kjs/object.h> #include <kjs/interpreter.h> @@ -47,7 +47,7 @@ public: bool m_completed; KHTMLPart *m_part; int m_timer_waits; - QTimer *m_timeout_timer; + TQTimer *m_timeout_timer; public slots: void partCompleted(); void timeout(); @@ -127,41 +127,41 @@ class RegressionTest : public QObject Q_OBJECT public: - RegressionTest(KHTMLPart *part, const QString &baseDir, const QString &outputDir, + RegressionTest(KHTMLPart *part, const TQString &baseDir, const TQString &outputDir, bool _genOutput, bool runJS, bool runHTML); ~RegressionTest(); enum OutputType { DOMTree, RenderTree }; - QString getPartOutput( OutputType type ); - void getPartDOMOutput( QTextStream &outputStream, KHTMLPart* part, uint indent ); - void dumpRenderTree( QTextStream &outputStream, KHTMLPart* part ); - void testStaticFile(const QString& filename); - void testJSFile(const QString& filename); + TQString getPartOutput( OutputType type ); + void getPartDOMOutput( TQTextStream &outputStream, KHTMLPart* part, uint indent ); + void dumpRenderTree( TQTextStream &outputStream, KHTMLPart* part ); + void testStaticFile(const TQString& filename); + void testJSFile(const TQString& filename); enum CheckResult { Failure = 0, Success = 1, Ignored = 2 }; - CheckResult checkOutput(const QString& againstFilename); - CheckResult checkPaintdump( const QString& againstFilename); + CheckResult checkOutput(const TQString& againstFilename); + CheckResult checkPaintdump( const TQString& againstFilename); enum FailureType { NoFailure = 0, AllFailure = 1, RenderFailure = 2, DomFailure = 4, PaintFailure = 8, JSFailure = 16}; - bool runTests(QString relPath = QString::null, bool mustExist = false, int known_failure = NoFailure); - bool reportResult( bool passed, const QString & description = QString::null ); - bool reportResult(CheckResult result, const QString & description = QString::null ); - void createMissingDirs(const QString &path); + bool runTests(TQString relPath = TQString::null, bool mustExist = false, int known_failure = NoFailure); + bool reportResult( bool passed, const TQString & description = TQString::null ); + bool reportResult(CheckResult result, const TQString & description = TQString::null ); + void createMissingDirs(const TQString &path); - QImage renderToImage(); - bool imageEqual( const QImage &lhs, const QImage &rhs ); - void createLink( const QString& test, int failures ); - void doJavascriptReport( const QString &test ); - void doFailureReport( const QString& test, int failures ); + TQImage renderToImage(); + bool imageEqual( const TQImage &lhs, const TQImage &rhs ); + void createLink( const TQString& test, int failures ); + void doJavascriptReport( const TQString &test ); + void doFailureReport( const TQString& test, int failures ); KHTMLPart *m_part; - QString m_baseDir; - QString m_outputDir; + TQString m_baseDir; + TQString m_outputDir; bool m_genOutput; - QString m_currentBase; + TQString m_currentBase; - QString m_currentOutput; - QString m_currentCategory; - QString m_currentTest; - QPixmap* m_paintBuffer; + TQString m_currentOutput; + TQString m_currentCategory; + TQString m_currentTest; + TQPixmap* m_paintBuffer; bool m_getOutput; bool m_runJS; @@ -178,12 +178,12 @@ public: static RegressionTest *curr; private: - void printDescription(const QString& description); + void printDescription(const TQString& description); - static bool svnIgnored( const QString &filename ); + static bool svnIgnored( const TQString &filename ); private: - void evalJS( KJS::ScriptInterpreter &interp, const QString &filename, bool report ); // used by testJS + void evalJS( KJS::ScriptInterpreter &interp, const TQString &filename, bool report ); // used by testJS private slots: void slotOpenURL(const KURL &url, const KParts::URLArgs &args); diff --git a/khtml/test_regression_fontoverload.cpp b/khtml/test_regression_fontoverload.cpp index 131a001be..8919f5f5a 100644 --- a/khtml/test_regression_fontoverload.cpp +++ b/khtml/test_regression_fontoverload.cpp @@ -24,11 +24,11 @@ #define QT_NO_XRANDR 1 #define QT_NO_XFTFREETYPE 1 #include <private/qfontengine_p.h> -#include <qfontdatabase.h> -#include <qfont.h> -#include <qpainter.h> +#include <tqfontdatabase.h> +#include <tqfont.h> +#include <tqpainter.h> #include "khtml_settings.h" -#include <qwidget.h> +#include <tqwidget.h> #include <assert.h> class QFakeFontEngine : public QFontEngineXLFD @@ -47,7 +47,7 @@ public: return QFontEngineXLFD::leading(); } - void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags ) + void draw( TQPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags ) { //Sometimes X misrounds stuff for larger ahem, so we have to do it ourselves. if (!ahem || (si->analysis.bidiLevel & 1) ) //We're fine if not ahem or bidi. @@ -81,7 +81,7 @@ public: const advance_t *advances, const qoffset_t *offsets, int numGlyphs ); glyph_metrics_t boundingBox( glyph_t glyph ); - QFontEngine::Error stringToCMap( const QChar *, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool ) const; + QFontEngine::Error stringToCMap( const TQChar *, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool ) const; int ascent() const; int descent() const; @@ -91,21 +91,21 @@ public: int minRightBearing() const { return 0; } int cmap() const; #endif - bool canRender( const QChar *string, int len ); + bool canRender( const TQChar *string, int len ); }; QFakeFontEngine::QFakeFontEngine( XFontStruct *fs, const char *name, int size ) : QFontEngineXLFD( fs, name, 0) { pixS = size; - ahem = QString::fromLatin1(name).contains("ahem"); + ahem = TQString::fromLatin1(name).contains("ahem"); } QFakeFontEngine::~QFakeFontEngine() { } #if 0 -QFontEngine::Error QFakeFontEngine::stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored) const +QFontEngine::Error QFakeFontEngine::stringToCMap( const TQChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored) const { QFontEngine::Error ret = QFontEngineXLFD::stringToCMap( str, len, glyphs, advances, nglyphs, mirrored ); @@ -167,12 +167,12 @@ int QFakeFontEngine::cmap() const } #endif -bool QFakeFontEngine::canRender( const QChar *, int ) +bool QFakeFontEngine::canRender( const TQChar *, int ) { return true; } -static QString courier_pickxlfd( int pixelsize, bool italic, bool bold ) +static TQString courier_pickxlfd( int pixelsize, bool italic, bool bold ) { if ( pixelsize >= 24 ) pixelsize = 24; @@ -183,15 +183,15 @@ static QString courier_pickxlfd( int pixelsize, bool italic, bool bold ) else pixelsize = 10; - return QString( "-adobe-courier-%1-%2-normal--%3-*-75-75-m-*-iso10646-1" ).arg( bold ? "bold" : "medium" ).arg( italic ? "o" : "r" ).arg( pixelsize ); + return TQString( "-adobe-courier-%1-%2-normal--%3-*-75-75-m-*-iso10646-1" ).arg( bold ? "bold" : "medium" ).arg( italic ? "o" : "r" ).arg( pixelsize ); } -static QString ahem_pickxlfd( int pixelsize ) +static TQString ahem_pickxlfd( int pixelsize ) { - return QString( "-misc-ahem-medium-r-normal--%1-*-100-100-c-*-iso10646-1" ).arg( pixelsize ); + return TQString( "-misc-ahem-medium-r-normal--%1-*-100-100-c-*-iso10646-1" ).arg( pixelsize ); } -static QString helv_pickxlfd( int pixelsize, bool italic, bool bold ) +static TQString helv_pickxlfd( int pixelsize, bool italic, bool bold ) { if ( pixelsize >= 24 ) pixelsize = 24; @@ -202,16 +202,16 @@ static QString helv_pickxlfd( int pixelsize, bool italic, bool bold ) else pixelsize = 10; - return QString( "-adobe-helvetica-%1-%2-normal--%3-*-75-75-p-*-iso10646-1" ).arg( bold ? "bold" : "medium" ).arg( italic ? "o" : "r" ).arg( pixelsize ); + return TQString( "-adobe-helvetica-%1-%2-normal--%3-*-75-75-p-*-iso10646-1" ).arg( bold ? "bold" : "medium" ).arg( italic ? "o" : "r" ).arg( pixelsize ); } KDE_EXPORT QFontEngine * -QFontDatabase::findFont( QFont::Script script, const QFontPrivate *fp, +TQFontDatabase::findFont( TQFont::Script script, const QFontPrivate *fp, const QFontDef &request, int ) { - QString xlfd; - QString family = request.family.lower(); + TQString xlfd; + TQString family = request.family.lower(); if ( family == "adobe courier" || family == "courier" || family == "fixed" ) { xlfd = courier_pickxlfd( request.pixelSize, request.italic, request.weight > 50 ); } @@ -225,7 +225,7 @@ QFontDatabase::findFont( QFont::Script script, const QFontPrivate *fp, QFontEngine *fe = 0; XFontStruct *xfs; - xfs = XLoadQueryFont(QPaintDevice::x11AppDisplay(), xlfd.latin1() ); + xfs = XLoadQueryFont(TQPaintDevice::x11AppDisplay(), xlfd.latin1() ); if (!xfs) // as long as you don't do screenshots, it's maybe fine qFatal("we need some fonts. So make sure you have %s installed.", xlfd.latin1()); @@ -233,7 +233,7 @@ QFontDatabase::findFont( QFont::Script script, const QFontPrivate *fp, if ( !XGetFontProperty( xfs, XA_FONT, &value ) ) return 0; - char *n = XGetAtomName( QPaintDevice::x11AppDisplay(), value ); + char *n = XGetAtomName( TQPaintDevice::x11AppDisplay(), value ); xlfd = n; if ( n ) XFree( n ); @@ -253,19 +253,19 @@ QFontDatabase::findFont( QFont::Script script, const QFontPrivate *fp, return fe; } -KDE_EXPORT bool QFontDatabase::isBitmapScalable( const QString &, - const QString &) const +KDE_EXPORT bool TQFontDatabase::isBitmapScalable( const TQString &, + const TQString &) const { return true; } -KDE_EXPORT bool QFontDatabase::isSmoothlyScalable( const QString &, - const QString &) const +KDE_EXPORT bool TQFontDatabase::isSmoothlyScalable( const TQString &, + const TQString &) const { return true; } -const QString &KHTMLSettings::availableFamilies() +const TQString &KHTMLSettings::availableFamilies() { if ( !avFamilies ) { avFamilies = new QString; @@ -280,42 +280,42 @@ bool KHTMLSettings::unfinishedImageFrame() const return false; } -KDE_EXPORT int QPaintDevice::x11AppDpiY( int ) +KDE_EXPORT int TQPaintDevice::x11AppDpiY( int ) { return 100; } -KDE_EXPORT int QPaintDevice::x11AppDpiX( int ) +KDE_EXPORT int TQPaintDevice::x11AppDpiX( int ) { return 100; } -KDE_EXPORT void QFont::insertSubstitution(const QString &, - const QString &) +KDE_EXPORT void TQFont::insertSubstitution(const TQString &, + const TQString &) { } -KDE_EXPORT void QFont::insertSubstitutions(const QString &, - const QStringList &) +KDE_EXPORT void TQFont::insertSubstitutions(const TQString &, + const TQStringList &) { } #include <kprotocolinfo.h> -bool KProtocolInfo::isKnownProtocol( const QString& _protocol ) +bool KProtocolInfo::isKnownProtocol( const TQString& _protocol ) { return ( _protocol == "file" ); } #include <kprotocolinfofactory.h> -QString KProtocolInfo::exec( const QString& _protocol ) +TQString KProtocolInfo::exec( const TQString& _protocol ) { if ( _protocol != "file" ) - return QString::null; + return TQString::null; KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol); if ( !prot ) - return QString::null; + return TQString::null; return prot->m_exec; } @@ -336,32 +336,32 @@ void DCOPClient::processSocketData( int ) { } -#include <qapplication.h> -#include <qpalette.h> +#include <tqapplication.h> +#include <tqpalette.h> -KDE_EXPORT void QApplication::setPalette( const QPalette &, bool , +KDE_EXPORT void TQApplication::setPalette( const TQPalette &, bool , const char* ) { static bool done = false; if (done) return; - QString xlfd = ahem_pickxlfd(40); + TQString xlfd = ahem_pickxlfd(40); XFontStruct *xfs; - xfs = XLoadQueryFont(QPaintDevice::x11AppDisplay(), xlfd.latin1() ); + xfs = XLoadQueryFont(TQPaintDevice::x11AppDisplay(), xlfd.latin1() ); if (!xfs) // as long as you don't do screenshots, it's maybe fine qFatal("We will need some fonts. So make sure you have %s installed.", xlfd.latin1()); - XFreeFont(QPaintDevice::x11AppDisplay(), xfs); + XFreeFont(TQPaintDevice::x11AppDisplay(), xfs); done = true; } #include <kapplication.h> -void KApplication::dcopFailure( const QString & ) +void KApplication::dcopFailure( const TQString & ) { qDebug( "KApplication::dcopFailure" ); } #include <kparts/historyprovider.h> -bool KParts::HistoryProvider::contains( const QString& t ) const +bool KParts::HistoryProvider::contains( const TQString& t ) const { return ( t == "http://www.kde.org/" || t == "http://www.google.com/"); } @@ -380,5 +380,5 @@ bool KSSLSettings::warnOnLeave() const { return false; } #include <kparts/plugin.h> -KParts::Plugin* KParts::Plugin::loadPlugin( QObject * parent, const char* libname ) { return 0; } +KParts::Plugin* KParts::Plugin::loadPlugin( TQObject * parent, const char* libname ) { return 0; } diff --git a/khtml/testkhtml.cpp b/khtml/testkhtml.cpp index 43573b6ff..7765cee8a 100644 --- a/khtml/testkhtml.cpp +++ b/khtml/testkhtml.cpp @@ -14,7 +14,7 @@ #include "testkhtml.h" #include "testkhtml.moc" #include "misc/loader.h" -#include <qcursor.h> +#include <tqcursor.h> #include <dom_string.h> #include "dom/dom2_range.h" #include "dom/html_document.h" @@ -56,10 +56,10 @@ int main(int argc, char *argv[]) KHTMLPart *doc = new KHTMLPart( toplevel, 0, toplevel, 0, KHTMLPart::BrowserViewGUI ); Dummy *dummy = new Dummy( doc ); - QObject::connect( doc->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), - dummy, SLOT( slotOpenURL( const KURL&, const KParts::URLArgs & ) ) ); + TQObject::connect( doc->browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), + dummy, TQT_SLOT( slotOpenURL( const KURL&, const KParts::URLArgs & ) ) ); - QObject::connect( doc, SIGNAL(completed()), dummy, SLOT(handleDone()) ); + TQObject::connect( doc, TQT_SIGNAL(completed()), dummy, TQT_SLOT(handleDone()) ); if (args->url(0).url().right(4).find(".xml", 0, false) == 0) { KParts::URLArgs ags(doc->browserExtension()->urlArgs()); @@ -77,9 +77,9 @@ int main(int argc, char *argv[]) // dtv->resize(toplevel->width()/2, toplevel->height()); - QDomDocument d = doc->domDocument(); - QDomElement viewMenu = d.documentElement().firstChild().childNodes().item( 2 ).toElement(); - QDomElement e = d.createElement( "action" ); + TQDomDocument d = doc->domDocument(); + TQDomElement viewMenu = d.documentElement().firstChild().childNodes().item( 2 ).toElement(); + TQDomElement e = d.createElement( "action" ); e.setAttribute( "name", "debugRenderTree" ); viewMenu.appendChild( e ); e = d.createElement( "action" ); @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) e.setAttribute( "name", "debugDoBenchmark" ); viewMenu.appendChild( e ); - QDomElement toolBar = d.documentElement().firstChild().nextSibling().toElement(); + TQDomElement toolBar = d.documentElement().firstChild().nextSibling().toElement(); e = d.createElement( "action" ); e.setAttribute( "name", "editable" ); toolBar.insertBefore( e, toolBar.firstChild() ); @@ -105,28 +105,28 @@ int main(int argc, char *argv[]) e.setAttribute( "name", "print" ); toolBar.insertBefore( e, toolBar.firstChild() ); - (void)new KAction( "Reload", "reload", Qt::Key_F5, dummy, SLOT( reload() ), doc->actionCollection(), "reload" ); - (void)new KAction( "Benchmark...", 0, 0, dummy, SLOT( doBenchmark() ), doc->actionCollection(), "debugDoBenchmark" ); - KAction* kprint = new KAction( "Print", "print", 0, doc->browserExtension(), SLOT( print() ), doc->actionCollection(), "print" ); + (void)new KAction( "Reload", "reload", Qt::Key_F5, dummy, TQT_SLOT( reload() ), doc->actionCollection(), "reload" ); + (void)new KAction( "Benchmark...", 0, 0, dummy, TQT_SLOT( doBenchmark() ), doc->actionCollection(), "debugDoBenchmark" ); + KAction* kprint = new KAction( "Print", "print", 0, doc->browserExtension(), TQT_SLOT( print() ), doc->actionCollection(), "print" ); kprint->setEnabled(true); KToggleAction *ta = new KToggleAction( "Navigable", "editclear", 0, doc->actionCollection(), "navigable" ); ta->setChecked(doc->isCaretMode()); - QWidget::connect(ta, SIGNAL(toggled(bool)), dummy, SLOT( toggleNavigable(bool) )); + TQWidget::connect(ta, TQT_SIGNAL(toggled(bool)), dummy, TQT_SLOT( toggleNavigable(bool) )); ta = new KToggleAction( "Editable", "edit", 0, doc->actionCollection(), "editable" ); ta->setChecked(doc->isEditable()); - QWidget::connect(ta, SIGNAL(toggled(bool)), dummy, SLOT( toggleEditable(bool) )); + TQWidget::connect(ta, TQT_SIGNAL(toggled(bool)), dummy, TQT_SLOT( toggleEditable(bool) )); toplevel->guiFactory()->addClient( doc ); doc->setJScriptEnabled(true); doc->setJavaEnabled(true); doc->setPluginsEnabled( true ); - doc->setURLCursor(QCursor(Qt::PointingHandCursor)); + doc->setURLCursor(TQCursor(Qt::PointingHandCursor)); a.setTopWidget(doc->widget()); - QWidget::connect(doc, SIGNAL(setWindowCaption(const QString &)), - doc->widget()->topLevelWidget(), SLOT(setCaption(const QString &))); + TQWidget::connect(doc, TQT_SIGNAL(setWindowCaption(const TQString &)), + doc->widget()->topLevelWidget(), TQT_SLOT(setCaption(const TQString &))); doc->widget()->show(); toplevel->show(); - ((QScrollView *)doc->widget())->viewport()->show(); + ((TQScrollView *)doc->widget())->viewport()->show(); int ret = a.exec(); @@ -141,13 +141,13 @@ void Dummy::doBenchmark() KConfigGroup settings(KGlobal::config(), "bench"); results.clear(); - QString directory = KFileDialog::getExistingDirectory(settings.readPathEntry("path"), m_part->view(), - QString::fromLatin1("Please select directory with tests")); + TQString directory = KFileDialog::getExistingDirectory(settings.readPathEntry("path"), m_part->view(), + TQString::fromLatin1("Please select directory with tests")); if (!directory.isEmpty()) { settings.writePathEntry("path", directory); - QDir dirListing(directory, "*.html"); + TQDir dirListing(directory, "*.html"); for (int i = 0; i < dirListing.count(); ++i) { filesToBenchmark.append(dirListing.absFilePath(dirListing[i])); } @@ -177,21 +177,21 @@ void Dummy::nextRun() m_part->begin(); m_part->write("<table border=1>"); - for (QMap<QString, QValueList<int> >::iterator i = results.begin(); i != results.end(); ++i) { + for (TQMap<TQString, TQValueList<int> >::iterator i = results.begin(); i != results.end(); ++i) { m_part->write("<tr><td>" + i.key() + "</td>"); - QValueList<int> timings = i.data(); + TQValueList<int> timings = i.data(); int total = 0; for (int pos = 0; pos < timings.size(); ++pos) { int t = timings[pos]; if (pos < COLD_RUNS) - m_part->write(QString::fromLatin1("<td>(Cold):") + QString::number(t) + "</td>"); + m_part->write(TQString::fromLatin1("<td>(Cold):") + TQString::number(t) + "</td>"); else { total += t; - m_part->write(QString::fromLatin1("<td><i>") + QString::number(t) + "</i></td>"); + m_part->write(TQString::fromLatin1("<td><i>") + TQString::number(t) + "</i></td>"); } } - m_part->write(QString::fromLatin1("<td>Average:<b>") + QString::number(double(total) / HOT_RUNS) + "</b></td>"); + m_part->write(TQString::fromLatin1("<td>Average:<b>") + TQString::number(double(total) / HOT_RUNS) + "</b></td>"); m_part->write("</tr>"); } diff --git a/khtml/testkhtml.h b/khtml/testkhtml.h index 09718fdba..b945ec942 100644 --- a/khtml/testkhtml.h +++ b/khtml/testkhtml.h @@ -2,8 +2,8 @@ #define TESTKHTML_H #include <kdebug.h> -#include <qvaluelist.h> -#include <qdatetime.h> +#include <tqvaluelist.h> +#include <tqdatetime.h> /** * @internal @@ -12,7 +12,7 @@ class Dummy : public QObject { Q_OBJECT public: - Dummy( KHTMLPart *part ) : QObject( part ) { m_part = part; }; + Dummy( KHTMLPart *part ) : TQObject( part ) { m_part = part; }; private slots: void slotOpenURL( const KURL &url, const KParts::URLArgs &args ) @@ -44,10 +44,10 @@ private slots: private: KHTMLPart *m_part; - QValueList<QString> filesToBenchmark; - QMap<QString, QValueList<int> > results; + TQValueList<TQString> filesToBenchmark; + TQMap<TQString, TQValueList<int> > results; int benchmarkRun; - QTime loadTimer; + TQTime loadTimer; void nextRun(); }; diff --git a/khtml/xml/dom2_eventsimpl.cpp b/khtml/xml/dom2_eventsimpl.cpp index db8b17b6f..bcc2fca3a 100644 --- a/khtml/xml/dom2_eventsimpl.cpp +++ b/khtml/xml/dom2_eventsimpl.cpp @@ -48,7 +48,7 @@ EventImpl::EventImpl() m_currentTarget = 0; m_eventPhase = 0; m_target = 0; - m_createTime = QDateTime::currentDateTime(); + m_createTime = TQDateTime::currentDateTime(); m_defaultHandled = false; } @@ -67,7 +67,7 @@ EventImpl::EventImpl(EventId _id, bool canBubbleArg, bool cancelableArg) m_currentTarget = 0; m_eventPhase = 0; m_target = 0; - m_createTime = QDateTime::currentDateTime(); + m_createTime = TQDateTime::currentDateTime(); m_defaultHandled = false; } @@ -90,7 +90,7 @@ void EventImpl::setTarget(NodeImpl *_target) DOMTimeStamp EventImpl::timeStamp() { - QDateTime epoch(QDate(1970,1,1),QTime(0,0)); + TQDateTime epoch(TQDate(1970,1,1),TQTime(0,0)); // ### kjs does not yet support long long (?) so the value wraps around return epoch.secsTo(m_createTime)*1000+m_createTime.time().msec(); } @@ -373,7 +373,7 @@ MouseEventImpl::MouseEventImpl(EventId _id, bool metaKeyArg, unsigned short buttonArg, NodeImpl *relatedTargetArg, - QMouseEvent *qe, + TQMouseEvent *qe, bool isDoubleClick) : UIEventImpl(_id,canBubbleArg,cancelableArg,viewArg,detailArg) { @@ -499,22 +499,22 @@ public: } L toLeft(R r) { - QMapIterator<R,L> i( m_rToL.find(r) ); + TQMapIterator<R,L> i( m_rToL.find(r) ); if (i != m_rToL.end()) return *i; return L(); } R toRight(L l) { - QMapIterator<L,R> i = m_lToR.find(l); + TQMapIterator<L,R> i = m_lToR.find(l); if (i != m_lToR.end()) return *i; return R(); } private: - QMap<L, R> m_lToR; - QMap<R, L> m_rToL; + TQMap<L, R> m_lToR; + TQMap<R, L> m_rToL; }; #define MAKE_TRANSLATOR(name,L,R,MR,table) static IDTranslator<L,R,MR>* s_##name; \ @@ -578,13 +578,13 @@ IDTranslator<unsigned, unsigned, unsigned>::Info virtKeyToQtKeyTable[] = MAKE_TRANSLATOR(virtKeyToQtKey, unsigned, unsigned, unsigned, virtKeyToQtKeyTable) KeyEventBaseImpl::KeyEventBaseImpl(EventId id, bool canBubbleArg, bool cancelableArg, AbstractViewImpl *viewArg, - QKeyEvent *key) : + TQKeyEvent *key) : UIEventImpl(id, canBubbleArg, cancelableArg, viewArg, 0) { m_synthetic = false; //Here, we need to map Qt's internal info to browser-style info. - m_keyEvent = new QKeyEvent(key->type(), key->key(), key->ascii(), key->state(), key->text(), key->isAutoRepeat(), key->count() ); + m_keyEvent = new TQKeyEvent(key->type(), key->key(), key->ascii(), key->state(), key->text(), key->isAutoRepeat(), key->count() ); m_detail = key->count(); m_keyVal = key->ascii(); @@ -647,27 +647,27 @@ void KeyEventBaseImpl::buildQKeyEvent() const int key = 0; int ascii = 0; - QString text; + TQString text; if (m_virtKeyVal) key = virtKeyToQtKey()->toRight(m_virtKeyVal); if (!key) { ascii = m_keyVal; //###? key = m_keyVal; - text = QChar(key); + text = TQChar(key); } //Neuter F keys as well. if (key >= Qt::Key_F1 && key <= Qt::Key_F35) key = Qt::Key_ScrollLock; - m_keyEvent = new QKeyEvent(id() == KEYUP_EVENT ? QEvent::KeyRelease : QEvent::KeyPress, + m_keyEvent = new TQKeyEvent(id() == KEYUP_EVENT ? TQEvent::KeyRelease : TQEvent::KeyPress, key, ascii, modifiers, text); } //------------------------------------------------------------------------------ -static const IDTranslator<QCString, unsigned, const char*>::Info keyIdentifiersToVirtKeysTable[] = { +static const IDTranslator<TQCString, unsigned, const char*>::Info keyIdentifiersToVirtKeysTable[] = { {"Alt", KeyEventBaseImpl::DOM_VK_LEFT_ALT}, {"Control", KeyEventBaseImpl::DOM_VK_LEFT_CONTROL}, {"Shift", KeyEventBaseImpl::DOM_VK_LEFT_SHIFT}, @@ -719,10 +719,10 @@ static const IDTranslator<QCString, unsigned, const char*>::Info keyIdentifiersT {0, 0} }; -MAKE_TRANSLATOR(keyIdentifiersToVirtKeys, QCString, unsigned, const char*, keyIdentifiersToVirtKeysTable) +MAKE_TRANSLATOR(keyIdentifiersToVirtKeys, TQCString, unsigned, const char*, keyIdentifiersToVirtKeysTable) /** These are the modifiers we currently support */ -static const IDTranslator<QCString, unsigned, const char*>::Info keyModifiersToCodeTable[] = { +static const IDTranslator<TQCString, unsigned, const char*>::Info keyModifiersToCodeTable[] = { {"Alt", Qt::AltButton}, {"Control", Qt::ControlButton}, {"Shift", Qt::ShiftButton}, @@ -730,7 +730,7 @@ static const IDTranslator<QCString, unsigned, const char*>::Info keyModifiersToC {0, 0} }; -MAKE_TRANSLATOR(keyModifiersToCode, QCString, unsigned, const char*, keyModifiersToCodeTable) +MAKE_TRANSLATOR(keyModifiersToCode, TQCString, unsigned, const char*, keyModifiersToCodeTable) KeyboardEventImpl::KeyboardEventImpl() : m_keyLocation(DOM_KEY_LOCATION_STANDARD) {} @@ -739,10 +739,10 @@ DOMString KeyboardEventImpl::keyIdentifier() const { if (unsigned special = virtKeyVal()) if (const char* id = keyIdentifiersToVirtKeys()->toLeft(special)) - return QString::fromLatin1(id); + return TQString::fromLatin1(id); if (unsigned unicode = keyVal()) - return QString(QChar(unicode)); + return TQString(TQChar(unicode)); return "Unidentified"; } @@ -784,12 +784,12 @@ void KeyboardEventImpl::initKeyboardEvent(const DOMString &typeArg, virtKeyVal = keyIdentifiersToVirtKeys()->toRight(keyIdentifierArg.string().latin1()); //Process modifier list. - QStringList mods = - QStringList::split(' ', + TQStringList mods = + TQStringList::split(' ', modifiersList.string().stripWhiteSpace().simplifyWhiteSpace()); unsigned modifiers = 0; - for (QStringList::Iterator i = mods.begin(); i != mods.end(); ++i) + for (TQStringList::Iterator i = mods.begin(); i != mods.end(); ++i) if (unsigned mask = keyModifiersToCode()->toRight((*i).latin1())) modifiers |= mask; @@ -797,8 +797,8 @@ void KeyboardEventImpl::initKeyboardEvent(const DOMString &typeArg, keyVal, virtKeyVal, modifiers); } -KeyboardEventImpl::KeyboardEventImpl(QKeyEvent* key, DOM::AbstractViewImpl* view) : - KeyEventBaseImpl(key->type() == QEvent::KeyRelease ? KEYUP_EVENT : KEYDOWN_EVENT, true, true, view, key) +KeyboardEventImpl::KeyboardEventImpl(TQKeyEvent* key, DOM::AbstractViewImpl* view) : + KeyEventBaseImpl(key->type() == TQEvent::KeyRelease ? KEYUP_EVENT : KEYDOWN_EVENT, true, true, view, key) { //Try to put something reasonable in location... //we don't know direction, so guess left @@ -819,7 +819,7 @@ int KeyboardEventImpl::keyCode() const if (m_virtKeyVal != DOM_VK_UNDEFINED) return m_virtKeyVal; else - return QChar((unsigned short)m_keyVal).upper().unicode(); + return TQChar((unsigned short)m_keyVal).upper().unicode(); } int KeyboardEventImpl::charCode() const @@ -839,7 +839,7 @@ bool TextEventImpl::isTextInputEvent() const return true; } -TextEventImpl::TextEventImpl(QKeyEvent* key, DOM::AbstractViewImpl* view) : +TextEventImpl::TextEventImpl(TQKeyEvent* key, DOM::AbstractViewImpl* view) : KeyEventBaseImpl(KEYPRESS_EVENT, true, true, view, key) { m_outputString = key->text(); diff --git a/khtml/xml/dom2_eventsimpl.h b/khtml/xml/dom2_eventsimpl.h index 2f2034088..7318035d2 100644 --- a/khtml/xml/dom2_eventsimpl.h +++ b/khtml/xml/dom2_eventsimpl.h @@ -141,7 +141,7 @@ protected: unsigned short m_eventPhase : 2; NodeImpl *m_currentTarget; // ref > 0 maintained externally NodeImpl *m_target; - QDateTime m_createTime; + TQDateTime m_createTime; DOMString m_message; }; @@ -193,7 +193,7 @@ public: bool metaKeyArg, unsigned short buttonArg, NodeImpl *relatedTargetArg, - QMouseEvent *qe = 0, + TQMouseEvent *qe = 0, bool isDoubleClick = false); virtual ~MouseEventImpl(); long screenX() const { return m_screenX; } @@ -231,7 +231,7 @@ public: const Node &relatedTargetArg); virtual bool isMouseEvent() const; - QMouseEvent *qEvent() const { return m_qevent; } + TQMouseEvent *qEvent() const { return m_qevent; } protected: long m_screenX; long m_screenY; @@ -248,7 +248,7 @@ protected: bool m_isDoubleClick : 1; unsigned short m_button; NodeImpl *m_relatedTarget; - QMouseEvent *m_qevent; + TQMouseEvent *m_qevent; }; @@ -326,7 +326,7 @@ public: unsigned long keyVal() const { return m_keyVal; } unsigned long virtKeyVal() const { return m_virtKeyVal; } - QKeyEvent *qKeyEvent() const { if (!m_keyEvent) buildQKeyEvent(); return m_keyEvent; } + TQKeyEvent *qKeyEvent() const { if (!m_keyEvent) buildQKeyEvent(); return m_keyEvent; } //Legacy key stuff... virtual int keyCode() const = 0; @@ -348,10 +348,10 @@ protected: bool canBubbleArg, bool cancelableArg, AbstractViewImpl *viewArg, - QKeyEvent *key); + TQKeyEvent *key); - mutable QKeyEvent *m_keyEvent; + mutable TQKeyEvent *m_keyEvent; unsigned long m_keyVal; //Unicode key value unsigned long m_virtKeyVal; //Virtual key value for keys like arrows, Fn, etc. @@ -367,7 +367,7 @@ class TextEventImpl : public KeyEventBaseImpl { public: TextEventImpl(); - TextEventImpl(QKeyEvent* key, DOM::AbstractViewImpl* view); + TextEventImpl(TQKeyEvent* key, DOM::AbstractViewImpl* view); void initTextEvent(const DOMString &typeArg, bool canBubbleArg, @@ -389,7 +389,7 @@ private: class KeyboardEventImpl : public KeyEventBaseImpl { public: KeyboardEventImpl(); - KeyboardEventImpl(QKeyEvent* key, DOM::AbstractViewImpl* view); + KeyboardEventImpl(TQKeyEvent* key, DOM::AbstractViewImpl* view); virtual bool isKeyboardEvent() const; diff --git a/khtml/xml/dom_docimpl.cpp b/khtml/xml/dom_docimpl.cpp index f6cc0fa64..36570d69a 100644 --- a/khtml/xml/dom_docimpl.cpp +++ b/khtml/xml/dom_docimpl.cpp @@ -43,8 +43,8 @@ #include "ecma/kjs_proxy.h" #include "ecma/kjs_binding.h" -#include <qptrstack.h> -#include <qpaintdevicemetrics.h> +#include <tqptrstack.h> +#include <tqpaintdevicemetrics.h> #include <kdebug.h> #include <klocale.h> #include <kstaticdeleter.h> @@ -101,7 +101,7 @@ DOMImplementationImpl::~DOMImplementationImpl() bool DOMImplementationImpl::hasFeature ( const DOMString &feature, const DOMString &version ) { // ### update when we (fully) support the relevant features - QString lower = feature.string().lower(); + TQString lower = feature.string().lower(); if ((lower == "html" || lower == "xml") && (version.isEmpty() || version == "1.0" || version == "2.0" || version == "null")) return true; @@ -228,7 +228,7 @@ ElementMappingCache::ElementMappingCache():m_dict(257) m_dict.setAutoDelete(true); } -void ElementMappingCache::add(const QString& id, ElementImpl* nd) +void ElementMappingCache::add(const TQString& id, ElementImpl* nd) { if (id.isEmpty()) return; @@ -247,7 +247,7 @@ void ElementMappingCache::add(const QString& id, ElementImpl* nd) } } -void ElementMappingCache::set(const QString& id, ElementImpl* nd) +void ElementMappingCache::set(const TQString& id, ElementImpl* nd) { if (id.isEmpty()) return; @@ -255,7 +255,7 @@ void ElementMappingCache::set(const QString& id, ElementImpl* nd) info->nd = nd; } -void ElementMappingCache::remove(const QString& id, ElementImpl* nd) +void ElementMappingCache::remove(const TQString& id, ElementImpl* nd) { if (id.isEmpty()) return; @@ -273,20 +273,20 @@ void ElementMappingCache::remove(const QString& id, ElementImpl* nd) } } -bool ElementMappingCache::contains(const QString& id) +bool ElementMappingCache::contains(const TQString& id) { if (id.isEmpty()) return false; return m_dict.find(id); } -ElementMappingCache::ItemInfo* ElementMappingCache::get(const QString& id) +ElementMappingCache::ItemInfo* ElementMappingCache::get(const TQString& id) { if (id.isEmpty()) return 0; return m_dict.find(id); } -static KStaticDeleter< QPtrList<DocumentImpl> > s_changedDocumentsDeleter; -QPtrList<DocumentImpl> * DocumentImpl::changedDocuments; +static KStaticDeleter< TQPtrList<DocumentImpl> > s_changedDocumentsDeleter; +TQPtrList<DocumentImpl> * DocumentImpl::changedDocuments; // KHTMLView might be 0 DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v) @@ -335,7 +335,7 @@ DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v) m_attrMap = new IdNameMapping(ATTR_LAST_ATTR+1); m_elementMap = new IdNameMapping(ID_LAST_TAG+1); m_namespaceMap = new IdNameMapping(1); - QString xhtml(XHTML_NAMESPACE); + TQString xhtml(XHTML_NAMESPACE); m_namespaceMap->names.insert(emptyNamespace, new DOMStringImpl("")); m_namespaceMap->names.insert(xhtmlNamespace, new DOMStringImpl(xhtml.unicode(), xhtml.length())); m_namespaceMap->names[emptyNamespace]->ref(); @@ -423,7 +423,7 @@ DocumentImpl::~DocumentImpl() //you may also have to fix removedLastRef() above - M.O. assert( !m_render ); - QIntDictIterator<NodeListImpl::Cache> it(m_nodeListCache); + TQIntDictIterator<NodeListImpl::Cache> it(m_nodeListCache); for (; it.current(); ++it) it.current()->deref(); @@ -674,7 +674,7 @@ AttrImpl *DocumentImpl::createAttributeNS( const DOMString &_namespaceURI, ElementImpl *DocumentImpl::getElementById( const DOMString &elementId ) const { - QString stringKey = elementId.string(); + TQString stringKey = elementId.string(); ElementMappingCache::ItemInfo* info = m_getElementByIdCache.get(stringKey); @@ -686,7 +686,7 @@ ElementImpl *DocumentImpl::getElementById( const DOMString &elementId ) const return info->nd; //Now we actually have to walk. - QPtrStack<NodeImpl> nodeStack; + TQPtrStack<NodeImpl> nodeStack; NodeImpl *current = _first; while(1) @@ -734,7 +734,7 @@ void DocumentImpl::setTitle(const DOMString& _title) m_title = _title; - QString titleStr = m_title.string(); + TQString titleStr = m_title.string(); for (unsigned int i = 0; i < titleStr.length(); ++i) if (titleStr[i] < ' ') titleStr[i] = ' '; @@ -744,8 +744,8 @@ void DocumentImpl::setTitle(const DOMString& _title) if (titleStr.isNull() || titleStr.isEmpty()) { // empty title... set window caption as the URL KURL url = m_url; - url.setRef(QString::null); - url.setQuery(QString::null); + url.setRef(TQString::null); + url.setQuery(TQString::null); titleStr = url.prettyURL(); } @@ -1037,9 +1037,9 @@ ElementImpl *DocumentImpl::createHTMLElement( const DOMString &name ) return n; } -QString DocumentImpl::nextState() +TQString DocumentImpl::nextState() { - QString state; + TQString state; if (!m_state.isEmpty()) { state = m_state.first(); @@ -1048,10 +1048,10 @@ QString DocumentImpl::nextState() return state; } -QStringList DocumentImpl::docState() +TQStringList DocumentImpl::docState() { - QStringList s; - for (QPtrListIterator<NodeImpl> it(m_maintainsState); it.current(); ++it) + TQStringList s; + for (TQPtrListIterator<NodeImpl> it(m_maintainsState); it.current(); ++it) s.append(it.current()->state()); return s; @@ -1059,7 +1059,7 @@ QStringList DocumentImpl::docState() bool DocumentImpl::unsubmittedFormChanges() { - for (QPtrListIterator<NodeImpl> it(m_maintainsState); it.current(); ++it) + for (TQPtrListIterator<NodeImpl> it(m_maintainsState); it.current(); ++it) if (it.current()->state().right(1)=="M") return true; @@ -1097,7 +1097,7 @@ TreeWalkerImpl *DocumentImpl::createTreeWalker(NodeImpl *root, unsigned long wha void DocumentImpl::setDocumentChanged(bool b) { if (!changedDocuments) - changedDocuments = s_changedDocumentsDeleter.setObject( changedDocuments, new QPtrList<DocumentImpl>() ); + changedDocuments = s_changedDocumentsDeleter.setObject( changedDocuments, new TQPtrList<DocumentImpl>() ); if (b && !m_docChanged) changedDocuments->append(this); @@ -1109,7 +1109,7 @@ void DocumentImpl::setDocumentChanged(bool b) void DocumentImpl::recalcStyle( StyleChange change ) { // qDebug("recalcStyle(%p)", this); -// QTime qt; +// TQTime qt; // qt.start(); if (m_inStyleRecalc) return; // Guard against re-entrancy. -dwh @@ -1127,13 +1127,13 @@ void DocumentImpl::recalcStyle( StyleChange change ) // ### make the font stuff _really_ work!!!! khtml::FontDef fontDef; - QFont f = KGlobalSettings::generalFont(); + TQFont f = KGlobalSettings::generalFont(); fontDef.family = f.family(); fontDef.italic = f.italic(); fontDef.weight = f.weight(); if (m_view) { const KHTMLSettings *settings = m_view->part()->settings(); - QString stdfont = settings->stdFontName(); + TQString stdfont = settings->stdFontName(); if ( !stdfont.isEmpty() ) fontDef.family = stdfont; @@ -1179,7 +1179,7 @@ void DocumentImpl::updateRendering() { if (!hasChangedChild()) return; -// QTime time; +// TQTime time; // time.start(); // kdDebug() << "UPDATERENDERING: "<<endl; @@ -1298,12 +1298,12 @@ khtml::Tokenizer *DocumentImpl::createTokenizer() return new khtml::XMLTokenizer(docPtr(),m_view); } -void DocumentImpl::setPaintDevice( QPaintDevice *dev ) +void DocumentImpl::setPaintDevice( TQPaintDevice *dev ) { if (m_paintDevice != dev) { m_paintDevice = dev; delete m_paintDeviceMetrics; - m_paintDeviceMetrics = new QPaintDeviceMetrics( dev ); + m_paintDeviceMetrics = new TQPaintDeviceMetrics( dev ); } } @@ -1334,7 +1334,7 @@ void DocumentImpl::open( bool clearEventListeners ) m_tokenizer = createTokenizer(); m_decoderMibEnum = 0; - connect(m_tokenizer,SIGNAL(finishedParsing()),this,SIGNAL(finishedParsing())); + connect(m_tokenizer,TQT_SIGNAL(finishedParsing()),this,TQT_SIGNAL(finishedParsing())); m_tokenizer->begin(); } @@ -1380,14 +1380,14 @@ void DocumentImpl::write( const DOMString &text ) write(text.string()); } -void DocumentImpl::write( const QString &text ) +void DocumentImpl::write( const TQString &text ) { if (!m_tokenizer) { open(); if (m_view) m_view->part()->resetFromScript(); m_tokenizer->setAutoClose(); - write(QString::fromLatin1("<html>")); + write(TQString::fromLatin1("<html>")); } m_tokenizer->write(text, false); } @@ -1404,7 +1404,7 @@ void DocumentImpl::finishParsing ( ) m_tokenizer->finish(); } -void DocumentImpl::setUserStyleSheet( const QString& sheet ) +void DocumentImpl::setUserStyleSheet( const TQString& sheet ) { if ( m_usersheet != sheet ) { m_usersheet = sheet; @@ -1421,7 +1421,7 @@ CSSStyleSheetImpl* DocumentImpl::elementSheet() return m_elemSheet; } -void DocumentImpl::determineParseMode( const QString &/*str*/ ) +void DocumentImpl::determineParseMode( const TQString &/*str*/ ) { // For XML documents, use strict parse mode pMode = Strict; @@ -1622,7 +1622,7 @@ NodeImpl *DocumentImpl::previousFocusNode(NodeImpl *fromNode) } } -ElementImpl* DocumentImpl::findAccessKeyElement(QChar c) +ElementImpl* DocumentImpl::findAccessKeyElement(TQChar c) { c = c.upper(); for( NodeImpl* n = this; @@ -1667,10 +1667,10 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con if(strcasecmp(equiv, "refresh") == 0 && v && v->part()->metaRefreshEnabled()) { // get delay and url - QString str = content.string().stripWhiteSpace(); - int pos = str.find(QRegExp("[;,]")); + TQString str = content.string().stripWhiteSpace(); + int pos = str.find(TQRegExp("[;,]")); if ( pos == -1 ) - pos = str.find(QRegExp("[ \t]")); + pos = str.find(TQRegExp("[ \t]")); bool ok = false; int delay = kMax( 0, content.implementation()->toInt(&ok) ); @@ -1692,7 +1692,7 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con (str[str.length()-1] == ';' || str[str.length()-1] == ',')) str.setLength(str.length()-1); str = parseURL( DOMString(str) ).string(); - QString newURL = getDocument()->completeURL( str ); + TQString newURL = getDocument()->completeURL( str ); if ( ok ) v->part()->scheduleRedirection(delay, getDocument()->completeURL( str ), delay < 2 || newURL == URL().url()); } @@ -1700,7 +1700,7 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con else if(strcasecmp(equiv, "expires") == 0) { bool relative = false; - QString str = content.string().stripWhiteSpace(); + TQString str = content.string().stripWhiteSpace(); time_t expire_date = KRFCDate::parseDate(str); if (!expire_date) { @@ -1714,7 +1714,7 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con } else if(v && (strcasecmp(equiv, "pragma") == 0 || strcasecmp(equiv, "cache-control") == 0)) { - QString str = content.string().lower().stripWhiteSpace(); + TQString str = content.string().lower().stripWhiteSpace(); KURL url = v->part()->url(); if ((str == "no-cache") && url.protocol().startsWith("http")) { @@ -1853,7 +1853,7 @@ NodeImpl::Id DocumentImpl::getId( NodeImpl::IdType _type, DOMStringImpl* _nsURI, if (_name->l == 0) return 0; NodeImpl::Id id, nsid = 0; - QConstString n(_name->s, _name->l); + TQConstString n(_name->s, _name->l); bool cs = true; // case sensitive if (_type != NodeImpl::NamespaceId) { if (_nsURI) @@ -1878,7 +1878,7 @@ NodeImpl::Id DocumentImpl::getId( NodeImpl::IdType _type, DOMStringImpl* _nsURI, // Look in the names array for the name // compatibility mode has to lookup upper case - QString name = cs ? n.string() : n.string().upper(); + TQString name = cs ? n.string() : n.string().upper(); if (!_nsURI) { id = (NodeImpl::Id)(long) map->ids.find( name ); @@ -1889,8 +1889,8 @@ NodeImpl::Id DocumentImpl::getId( NodeImpl::IdType _type, DOMStringImpl* _nsURI, id = (NodeImpl::Id)(long) map->ids.find( name ); if (!readonly && id && _prefix && _prefix->l) { // we were called in registration mode... check if the alias exists - QConstString px( _prefix->s, _prefix->l ); - QString qn("aliases: " + (cs ? px.string() : px.string().upper()) + ":" + name); + TQConstString px( _prefix->s, _prefix->l ); + TQString qn("aliases: " + (cs ? px.string() : px.string().upper()) + ":" + name); if (!map->ids.find( qn )) { map->ids.insert( qn, (void*)id ); } @@ -2065,9 +2065,9 @@ void DocumentImpl::recalcStyleSelector() assert(m_pendingStylesheets==0); - QPtrList<StyleSheetImpl> oldStyleSheets = m_styleSheets->styleSheets; + TQPtrList<StyleSheetImpl> oldStyleSheets = m_styleSheets->styleSheets; m_styleSheets->styleSheets.clear(); - QString sheetUsed = view() ? view()->part()->d->m_sheetUsed.replace("&&", "&") : QString(); + TQString sheetUsed = view() ? view()->part()->d->m_sheetUsed.replace("&&", "&") : TQString(); bool autoselect = sheetUsed.isEmpty(); if (autoselect && !m_preferredStylesheetSet.isEmpty()) sheetUsed = m_preferredStylesheetSet.string(); @@ -2109,7 +2109,7 @@ void DocumentImpl::recalcStyleSelector() } else if (n->isHTMLElement() && ( n->id() == ID_LINK || n->id() == ID_STYLE) ) { - QString title; + TQString title; if ( n->id() == ID_LINK ) { HTMLLinkElementImpl* l = static_cast<HTMLLinkElementImpl*>(n); if (l->isCSSStyleSheet()) { @@ -2177,17 +2177,17 @@ void DocumentImpl::recalcStyleSelector() // the alternative sheet we used doesn't exist anymore // so try from scratch again if (view()) - view()->part()->d->m_sheetUsed = QString::null; + view()->part()->d->m_sheetUsed = TQString::null; if (!m_preferredStylesheetSet.isEmpty() && !(sheetUsed == m_preferredStylesheetSet)) sheetUsed = m_preferredStylesheetSet.string(); else - sheetUsed = QString::null; + sheetUsed = TQString::null; autoselect = true; } // Include programmatically added style sheets if (m_addedStyleSheets) { - QPtrListIterator<StyleSheetImpl> it = m_addedStyleSheets->styleSheets; + TQPtrListIterator<StyleSheetImpl> it = m_addedStyleSheets->styleSheets; for (; *it; ++it) { if ((*it)->isCSSStyleSheet() && !(*it)->disabled()) m_styleSheets->add(*it); @@ -2195,7 +2195,7 @@ void DocumentImpl::recalcStyleSelector() } // De-reference all the stylesheets in the old list - QPtrListIterator<StyleSheetImpl> it(oldStyleSheets); + TQPtrListIterator<StyleSheetImpl> it(oldStyleSheets); for (; it.current(); ++it) it.current()->deref(); @@ -2206,7 +2206,7 @@ void DocumentImpl::rebuildStyleSelector() { // Create a new style selector delete m_styleSelector; - QString usersheet = m_usersheet; + TQString usersheet = m_usersheet; if ( m_view && m_view->mediaType() == "print" ) usersheet += m_printSheet; m_styleSelector = new CSSStyleSelector( this, usersheet, m_styleSheets, m_url, @@ -2329,17 +2329,17 @@ void DocumentImpl::detachNodeIterator(NodeIteratorImpl *ni) void DocumentImpl::notifyBeforeNodeRemoval(NodeImpl *n) { - QPtrListIterator<NodeIteratorImpl> it(m_nodeIterators); + TQPtrListIterator<NodeIteratorImpl> it(m_nodeIterators); for (; it.current(); ++it) it.current()->notifyBeforeNodeRemoval(n); } -bool DocumentImpl::isURLAllowed(const QString& url) const +bool DocumentImpl::isURLAllowed(const TQString& url) const { KHTMLPart *thisPart = part(); KURL newURL(completeURL(url)); - newURL.setRef(QString::null); + newURL.setRef(TQString::null); if (KHTMLFactory::defaultHTMLSettings()->isAdFiltered( newURL.url() )) return false; @@ -2357,7 +2357,7 @@ bool DocumentImpl::isURLAllowed(const QString& url) const bool foundSelfReference = false; for (KHTMLPart *part = thisPart; part; part = part->parentPart()) { KURL partURL = part->url(); - partURL.setRef(QString::null); + partURL.setRef(TQString::null); if (partURL == newURL) { if (foundSelfReference) return false; @@ -2436,7 +2436,7 @@ void DocumentImpl::load(const DOMString &uri) // of the data retrieved from the server based on the character set, as happens with // HTML files. Need to look into a way of using the decoder in CachedCSSStyleSheet. m_docLoading = true; - m_loadingXMLDoc = m_docLoader->requestStyleSheet(uri.string(),QString(),"text/xml"); + m_loadingXMLDoc = m_docLoader->requestStyleSheet(uri.string(),TQString(),"text/xml"); if (!m_loadingXMLDoc) { m_docLoading = false; @@ -2478,7 +2478,7 @@ void DocumentImpl::setStyleSheet(const DOM::DOMString &url, const DOM::DOMString m_loadingXMLDoc = 0; } -void DocumentImpl::error(int err, const QString &text) +void DocumentImpl::error(int err, const TQString &text) { m_docLoading = false; if (m_inSyncLoad) { @@ -2509,10 +2509,10 @@ void DocumentImpl::defaultEventHandler(EventImpl *evt) if (!m_windowEventListeners.listeners || evt->propagationStopped()) return; - QValueList<RegisteredEventListener>::iterator it; + TQValueList<RegisteredEventListener>::iterator it; //Grab a copy in case of clear - QValueList<RegisteredEventListener> listeners = *m_windowEventListeners.listeners; + TQValueList<RegisteredEventListener> listeners = *m_windowEventListeners.listeners; Event ev(evt); for (it = listeners.begin(); it != listeners.end(); ++it) { //Check to make sure it didn't get removed. KDE4: use Java-style iterators @@ -2554,7 +2554,7 @@ bool DocumentImpl::hasWindowEventListener(int id) return m_windowEventListeners.hasEventListener(id); } -EventListener *DocumentImpl::createHTMLEventListener(const QString& code, const QString& name, NodeImpl* node) +EventListener *DocumentImpl::createHTMLEventListener(const TQString& code, const TQString& name, NodeImpl* node) { return part() ? part()->createHTMLEventListener(code, name, node) : 0; } @@ -2595,7 +2595,7 @@ void DocumentImpl::dispatchImageLoadEventsNow() m_imageLoadEventDispatchingList = m_imageLoadEventDispatchSoonList; m_imageLoadEventDispatchSoonList.clear(); - for (QPtrListIterator<HTMLImageElementImpl> it(m_imageLoadEventDispatchingList); it.current(); ) { + for (TQPtrListIterator<HTMLImageElementImpl> it(m_imageLoadEventDispatchingList); it.current(); ) { HTMLImageElementImpl* image = it.current(); // Must advance iterator *before* dispatching call. // Otherwise, it might be advanced automatically if dispatching the call had a side effect @@ -2607,12 +2607,12 @@ void DocumentImpl::dispatchImageLoadEventsNow() m_imageLoadEventDispatchingList.clear(); } -void DocumentImpl::timerEvent(QTimerEvent *) +void DocumentImpl::timerEvent(TQTimerEvent *) { dispatchImageLoadEventsNow(); } -void DocumentImpl::setDecoderCodec(const QTextCodec *codec) +void DocumentImpl::setDecoderCodec(const TQTextCodec *codec) { m_decoderMibEnum = codec->mibEnum(); } diff --git a/khtml/xml/dom_docimpl.h b/khtml/xml/dom_docimpl.h index 51d762325..e32a88414 100644 --- a/khtml/xml/dom_docimpl.h +++ b/khtml/xml/dom_docimpl.h @@ -34,13 +34,13 @@ #include "misc/loader.h" #include "misc/seed.h" -#include <qstringlist.h> -#include <qptrlist.h> -#include <qobject.h> -#include <qintcache.h> -#include <qintdict.h> -#include <qdict.h> -#include <qmap.h> +#include <tqstringlist.h> +#include <tqptrlist.h> +#include <tqobject.h> +#include <tqintcache.h> +#include <tqintdict.h> +#include <tqdict.h> +#include <tqmap.h> #include <kurl.h> @@ -151,36 +151,36 @@ public: /** Add a pointer as just one of candidates, not neccesserily the proper one */ - void add(const QString& id, ElementImpl* nd); + void add(const TQString& id, ElementImpl* nd); /** Set the pointer as the definite mapping; it must have already been added */ - void set(const QString& id, ElementImpl* nd); + void set(const TQString& id, ElementImpl* nd); /** Remove the item; it must have already been added. */ - void remove(const QString& id, ElementImpl* nd); + void remove(const TQString& id, ElementImpl* nd); /** Returns true if the item exists */ - bool contains(const QString& id); + bool contains(const TQString& id); /** Returns the information for the given ID */ - ItemInfo* get(const QString& id); + ItemInfo* get(const TQString& id); private: - QDict<ItemInfo> m_dict; + TQDict<ItemInfo> m_dict; }; /** * @internal */ -class DocumentImpl : public QObject, private khtml::CachedObjectClient, public NodeBaseImpl +class DocumentImpl : public TQObject, private khtml::CachedObjectClient, public NodeBaseImpl { Q_OBJECT public: @@ -197,7 +197,7 @@ public: virtual AttrImpl *createAttribute( const DOMString &tagName, int* pExceptioncode = 0 ); DocumentFragmentImpl *createDocumentFragment (); TextImpl *createTextNode ( DOMStringImpl* data ) { return new TextImpl( docPtr(), data); } - TextImpl *createTextNode ( const QString& data ) + TextImpl *createTextNode ( const TQString& data ) { return createTextNode(new DOMStringImpl(data.unicode(), data.length())); } CommentImpl *createComment ( DOMStringImpl* data ); CDATASectionImpl *createCDATASection ( DOMStringImpl* data ); @@ -270,16 +270,16 @@ public: void recalcStyleSelector(); void rebuildStyleSelector(); - QString nextState(); + TQString nextState(); // Query all registered elements for their state - QStringList docState(); + TQStringList docState(); bool unsubmittedFormChanges(); void registerMaintainsState(NodeImpl* e) { m_maintainsState.append(e); } void deregisterMaintainsState(NodeImpl* e) { m_maintainsState.removeRef(e); } // Set the state the document should restore to - void setRestoreState( const QStringList &s) { m_state = s; } + void setRestoreState( const TQStringList &s) { m_state = s; } KHTMLView *view() const { return m_view; } KHTMLPart* part() const; @@ -293,7 +293,7 @@ public: bool entityReferenceExpansion, int &exceptioncode); virtual void recalcStyle( StyleChange = NoChange ); - static QPtrList<DocumentImpl> * changedDocuments; + static TQPtrList<DocumentImpl> * changedDocuments; virtual void updateRendering(); void updateLayout(); static void updateDocumentsRendering(); @@ -307,7 +307,7 @@ public: // to get visually ordered hebrew and arabic pages right void setVisuallyOrdered(); // to get URL decoding right - void setDecoderCodec(const QTextCodec *codec); + void setDecoderCodec(const TQTextCodec *codec); void setSelection(NodeImpl* s, int sp, NodeImpl* e, int ep); void clearSelection(); @@ -315,34 +315,34 @@ public: void open ( bool clearEventListeners = true ); virtual void close ( ); void write ( const DOMString &text ); - void write ( const QString &text ); + void write ( const TQString &text ); void writeln ( const DOMString &text ); void finishParsing ( ); KURL URL() const { return m_url; } - void setURL(const QString& url) { m_url = url; } + void setURL(const TQString& url) { m_url = url; } KURL baseURL() const { return m_baseURL.isEmpty() ? m_url : m_baseURL; } void setBaseURL(const KURL& baseURL) { m_baseURL = baseURL; } - QString baseTarget() const { return m_baseTarget; } - void setBaseTarget(const QString& baseTarget) { m_baseTarget = baseTarget; } + TQString baseTarget() const { return m_baseTarget; } + void setBaseTarget(const TQString& baseTarget) { m_baseTarget = baseTarget; } - QString completeURL(const QString& url) const { return KURL(baseURL(),url,m_decoderMibEnum).url(); }; + TQString completeURL(const TQString& url) const { return KURL(baseURL(),url,m_decoderMibEnum).url(); }; DOMString canonURL(const DOMString& url) const { return url.isEmpty() ? url : completeURL(url.string()); } - void setUserStyleSheet(const QString& sheet); - QString userStyleSheet() const { return m_usersheet; } - void setPrintStyleSheet(const QString& sheet) { m_printSheet = sheet; } - QString printStyleSheet() const { return m_printSheet; } + void setUserStyleSheet(const TQString& sheet); + TQString userStyleSheet() const { return m_usersheet; } + void setPrintStyleSheet(const TQString& sheet) { m_printSheet = sheet; } + TQString printStyleSheet() const { return m_printSheet; } CSSStyleSheetImpl* elementSheet(); virtual khtml::Tokenizer *createTokenizer(); khtml::Tokenizer *tokenizer() { return m_tokenizer; } - QPaintDeviceMetrics *paintDeviceMetrics() { return m_paintDeviceMetrics; } - QPaintDevice *paintDevice() const { return m_paintDevice; } - void setPaintDevice( QPaintDevice *dev ); + TQPaintDeviceMetrics *paintDeviceMetrics() { return m_paintDeviceMetrics; } + TQPaintDevice *paintDevice() const { return m_paintDevice; } + void setPaintDevice( TQPaintDevice *dev ); enum HTMLMode { Html3 = 0, @@ -356,7 +356,7 @@ public: Transitional, Strict }; - virtual void determineParseMode( const QString &str ); + virtual void determineParseMode( const TQString &str ); void setParseMode( ParseMode m ) { pMode = m; } ParseMode parseMode() const { return pMode; } @@ -370,8 +370,8 @@ public: void setParsing(bool b) { m_bParsing = b; } bool parsing() const { return m_bParsing; } - void setTextColor( QColor color ) { m_textColor = color; } - QColor textColor() const { return m_textColor; } + void setTextColor( TQColor color ) { m_textColor = color; } + TQColor textColor() const { return m_textColor; } void setDesignMode(bool b); bool designMode() const; @@ -398,7 +398,7 @@ public: void addStyleSheet(StyleSheetImpl *, int *exceptioncode = 0); void removeStyleSheet(StyleSheetImpl *, int *exceptioncode = 0); - QStringList availableStyleSheets() const { return m_availableSheets; } + TQStringList availableStyleSheets() const { return m_availableSheets; } NodeImpl* hoverNode() const { return m_hoverNode; } void setHoverNode(NodeImpl *newHoverNode); @@ -443,21 +443,21 @@ public: void loadXML(const DOMString &source); // from cachedObjectClient void setStyleSheet(const DOM::DOMString &url, const DOM::DOMString &sheet, const DOM::DOMString &charset); - void error(int err, const QString &text); + void error(int err, const TQString &text); - typedef QMap<QString, ProcessingInstructionImpl*> LocalStyleRefs; + typedef TQMap<TQString, ProcessingInstructionImpl*> LocalStyleRefs; LocalStyleRefs* localStyleRefs() { return &m_localStyleRefs; } virtual void defaultEventHandler(EventImpl *evt); virtual void setHTMLWindowEventListener(int id, EventListener *listener); EventListener *getHTMLWindowEventListener(int id); - EventListener *createHTMLEventListener(const QString& code, const QString& name, NodeImpl* node); + EventListener *createHTMLEventListener(const TQString& code, const TQString& name, NodeImpl* node); void addWindowEventListener(int id, EventListener *listener, const bool useCapture); void removeWindowEventListener(int id, EventListener *listener, bool useCapture); bool hasWindowEventListener(int id); - EventListener *createHTMLEventListener(QString code); + EventListener *createHTMLEventListener(TQString code); /** * Searches through the document, starting from fromNode, for the next selectable element that comes after fromNode. @@ -485,7 +485,7 @@ public: */ NodeImpl *previousFocusNode(NodeImpl *fromNode); - ElementImpl* findAccessKeyElement(QChar c); + ElementImpl* findAccessKeyElement(TQChar c); int nodeAbsIndex(NodeImpl *node); NodeImpl *nodeWithAbsIndex(int absIndex); @@ -504,7 +504,7 @@ public: void dispatchImageLoadEventSoon(HTMLImageElementImpl *); void dispatchImageLoadEventsNow(); void removeImage(HTMLImageElementImpl *); - virtual void timerEvent(QTimerEvent *); + virtual void timerEvent(TQTimerEvent *); // Returns the owning element in the parent document. // Returns 0 if this is the top level document. @@ -513,7 +513,7 @@ public: DOMString domain() const; void setDomain( const DOMString &newDomain ); // not part of the DOM - bool isURLAllowed(const QString& url) const; + bool isURLAllowed(const TQString& url) const; HTMLElementImpl* body(); @@ -522,8 +522,8 @@ public: void incDOMTreeVersion() { ++m_domtree_version; } unsigned int domTreeVersion() const { return m_domtree_version; } - QDict<khtml::CounterNode>* counters(const khtml::RenderObject* o) { return m_counterDict[(void*)o]; } - void setCounters(const khtml::RenderObject* o, QDict<khtml::CounterNode> *dict) { m_counterDict.insert((void*)o, dict);} + TQDict<khtml::CounterNode>* counters(const khtml::RenderObject* o) { return m_counterDict[(void*)o]; } + void setCounters(const khtml::RenderObject* o, TQDict<khtml::CounterNode> *dict) { m_counterDict.insert((void*)o, dict);} void removeCounters(const khtml::RenderObject* o) { m_counterDict.remove((void*)o); } @@ -539,8 +539,8 @@ public: return m_getElementByIdCache; } - QString contentLanguage() const { return m_contentLanguage; } - void setContentLanguage(const QString& cl) { m_contentLanguage = cl; } + TQString contentLanguage() const { return m_contentLanguage; } + void setContentLanguage(const TQString& cl) { m_contentLanguage = cl; } khtml::DynamicDomRestyler& dynamicDomRestyler() { return *m_dynamicDomRestyler; } const khtml::DynamicDomRestyler& dynamicDomRestyler() const { return *m_dynamicDomRestyler; } @@ -551,22 +551,22 @@ signals: protected: khtml::CSSStyleSelector *m_styleSelector; KHTMLView *m_view; - QStringList m_state; + TQStringList m_state; khtml::DocLoader *m_docLoader; khtml::Tokenizer *m_tokenizer; KURL m_url; KURL m_baseURL; - QString m_baseTarget; + TQString m_baseTarget; DocumentTypeImpl *m_doctype; DOMImplementationImpl *m_implementation; - QString m_usersheet; - QString m_printSheet; - QStringList m_availableSheets; + TQString m_usersheet; + TQString m_printSheet; + TQStringList m_availableSheets; - QString m_contentLanguage; + TQString m_contentLanguage; // Track the number of currently loading top-level stylesheets. Sheets // loaded using the @import directive are not included in this count. @@ -577,12 +577,12 @@ protected: CSSStyleSheetImpl *m_elemSheet; - QPaintDevice *m_paintDevice; - QPaintDeviceMetrics *m_paintDeviceMetrics; + TQPaintDevice *m_paintDevice; + TQPaintDeviceMetrics *m_paintDeviceMetrics; ParseMode pMode; HTMLMode hMode; - QColor m_textColor; + TQColor m_textColor; NodeImpl *m_hoverNode; NodeImpl *m_focusNode; NodeImpl *m_activeNode; @@ -594,14 +594,14 @@ protected: IdNameMapping(unsigned short _start) : idStart(_start), count(0) {} ~IdNameMapping() { - QIntDictIterator<DOM::DOMStringImpl> it(names); + TQIntDictIterator<DOM::DOMStringImpl> it(names); for (; it.current() ; ++it) it.current()->deref(); } unsigned short idStart; unsigned short count; - QIntDict<DOM::DOMStringImpl> names; - QDict<void> ids; + TQIntDict<DOM::DOMStringImpl> names; + TQDict<void> ids; void expandIfNeeded() { if (ids.size() <= ids.count() && ids.size() != khtml_MaxSeed) @@ -612,10 +612,10 @@ protected: void addAlias(DOMStringImpl* _prefix, DOMStringImpl* _name, bool cs, NodeImpl::Id id) { if(_prefix && _prefix->l) { - QConstString n(_name->s, _name->l); - QConstString px( _prefix->s, _prefix->l ); - QString name = cs ? n.string() : n.string().upper(); - QString qn("aliases: " + (cs ? px.string() : px.string().upper()) + ":" + name); + TQConstString n(_name->s, _name->l); + TQConstString px( _prefix->s, _prefix->l ); + TQString name = cs ? n.string() : n.string().upper(); + TQString qn("aliases: " + (cs ? px.string() : px.string().upper()) + ":" + name); if (!ids.find( qn )) { ids.insert( qn, (void*)id ); } @@ -629,7 +629,7 @@ protected: IdNameMapping *m_elementMap; IdNameMapping *m_namespaceMap; - QPtrList<NodeIteratorImpl> m_nodeIterators; + TQPtrList<NodeIteratorImpl> m_nodeIterators; AbstractViewImpl *m_defaultView; unsigned short m_listenerTypes; @@ -637,10 +637,10 @@ protected: StyleSheetListImpl *m_addedStyleSheets; // programmatically added style sheets LocalStyleRefs m_localStyleRefs; // references to inlined style elements RegisteredListenerList m_windowEventListeners; - QPtrList<NodeImpl> m_maintainsState; + TQPtrList<NodeImpl> m_maintainsState; // ### evaluate for placement in RenderStyle - QPtrDict<QDict<khtml::CounterNode> > m_counterDict; + TQPtrDict<TQDict<khtml::CounterNode> > m_counterDict; khtml::DynamicDomRestyler *m_dynamicDomRestyler; @@ -664,10 +664,10 @@ protected: ElementMappingCache m_underDocNamedCache; //Cache for nodelists and collections. - QIntDict<NodeListImpl::Cache> m_nodeListCache; + TQIntDict<NodeListImpl::Cache> m_nodeListCache; - QPtrList<HTMLImageElementImpl> m_imageLoadEventDispatchSoonList; - QPtrList<HTMLImageElementImpl> m_imageLoadEventDispatchingList; + TQPtrList<HTMLImageElementImpl> m_imageLoadEventDispatchSoonList; + TQPtrList<HTMLImageElementImpl> m_imageLoadEventDispatchingList; int m_imageLoadEventTimer; //Cache for getElementById diff --git a/khtml/xml/dom_elementimpl.cpp b/khtml/xml/dom_elementimpl.cpp index 5db497e7d..c41bef3dc 100644 --- a/khtml/xml/dom_elementimpl.cpp +++ b/khtml/xml/dom_elementimpl.cpp @@ -46,7 +46,7 @@ #include "css/cssproperties.h" #include "xml/dom_xmlimpl.h" -#include <qtextstream.h> +#include <tqtextstream.h> #include <kdebug.h> #include <stdlib.h> @@ -746,12 +746,12 @@ void ElementImpl::updateId(DOMStringImpl* oldId, DOMStringImpl* newId) addId(DOMString(newId).string()); } -void ElementImpl::removeId(const QString& id) +void ElementImpl::removeId(const TQString& id) { getDocument()->getElementByIdCache().remove(id, this); } -void ElementImpl::addId(const QString& id) +void ElementImpl::addId(const TQString& id) { getDocument()->getElementByIdCache().add(id, this); } @@ -805,7 +805,7 @@ DOMString ElementImpl::openTagStartToString(bool expandurls) const //We need to sanitize the urls - strip out the passwords. //FIXME: are src= and href= the only places that might have a password and need to be sanitized? KURL safeURL(getDocument()->completeURL(attribute->value().string())); - safeURL.setPass(QString::null); + safeURL.setPass(TQString::null); result += safeURL.htmlURL(); } else { @@ -848,14 +848,14 @@ DOMString ElementImpl::selectionToString(NodeImpl *selectionStart, NodeImpl *sel DOMString ElementImpl::toString() const { - QString result = openTagStartToString().string(); //Accumulate in QString, since DOMString can't append well. + TQString result = openTagStartToString().string(); //Accumulate in TQString, since DOMString can't append well. if (hasChildNodes()) { result += ">"; 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(); } result += "</"; diff --git a/khtml/xml/dom_elementimpl.h b/khtml/xml/dom_elementimpl.h index 1bc5148d5..ee1be3e4a 100644 --- a/khtml/xml/dom_elementimpl.h +++ b/khtml/xml/dom_elementimpl.h @@ -188,7 +188,7 @@ public: void setAttributeMap ( NamedAttrMapImpl* list ); // State of the element. - virtual QString state() { return QString::null; } + virtual TQString state() { return TQString::null; } virtual void attach(); virtual void close(); @@ -238,9 +238,9 @@ public: void updateId(DOMStringImpl* oldId, DOMStringImpl* newId); //Called when mapping from id to this node in document should be removed - virtual void removeId(const QString& id); + virtual void removeId(const TQString& id); //Called when mapping from id to this node in document should be added - virtual void addId (const QString& id); + virtual void addId (const TQString& id); protected: void createAttributeMap() const; diff --git a/khtml/xml/dom_nodeimpl.cpp b/khtml/xml/dom_nodeimpl.cpp index 692ba4394..137928c81 100644 --- a/khtml/xml/dom_nodeimpl.cpp +++ b/khtml/xml/dom_nodeimpl.cpp @@ -233,7 +233,7 @@ kdDebug(6200) << "getCaret: node " << this << " " << nodeName().string() << " of #endif mapDOMPosToRenderPos(this, offset, r, r_ofs, outside, outsideEnd); #if 0 -kdDebug(6200) << "getCaret: r " << r << " " << (r?r->renderName():QString::null) << " r_ofs: " << r_ofs << " outside " << outside << " outsideEnd " << outsideEnd << endl; +kdDebug(6200) << "getCaret: r " << r << " " << (r?r->renderName():TQString::null) << " r_ofs: " << r_ofs << " outside " << outside << " outsideEnd " << outsideEnd << endl; #endif if (r) { r->caretPos(r_ofs, override*RenderObject::CFOverride @@ -244,14 +244,14 @@ kdDebug(6200) << "getCaret: r " << r << " " << (r?r->renderName():QString::null) } else _x = _y = height = -1, width = 1; } -QRect NodeImpl::getRect() const +TQRect NodeImpl::getRect() const { int _x, _y; if(m_render && m_render->absolutePosition(_x, _y)) - return QRect( _x + m_render->inlineXPos(), _y + m_render->inlineYPos(), + return TQRect( _x + m_render->inlineXPos(), _y + m_render->inlineYPos(), m_render->width(), m_render->height() + renderer()->borderTopExtra() + renderer()->borderBottomExtra() ); - return QRect(); + return TQRect(); } void NodeImpl::setChanged(bool b) @@ -353,7 +353,7 @@ void NodeImpl::dispatchGenericEvent( EventImpl *evt, int &/*exceptioncode */) // ### check that type specified // work out what nodes to send event to - QPtrList<NodeImpl> nodeChain; + TQPtrList<NodeImpl> nodeChain; NodeImpl *n; for (n = this; n; n = n->parentNode()) { n->ref(); @@ -362,7 +362,7 @@ void NodeImpl::dispatchGenericEvent( EventImpl *evt, int &/*exceptioncode */) // trigger any capturing event handlers on our way down evt->setEventPhase(Event::CAPTURING_PHASE); - QPtrListIterator<NodeImpl> it(nodeChain); + TQPtrListIterator<NodeImpl> it(nodeChain); for (; it.current() && it.current() != this && !evt->propagationStopped(); ++it) { evt->setCurrentTarget(it.current()); it.current()->handleLocalEvents(evt,true); @@ -463,7 +463,7 @@ void NodeImpl::dispatchWindowEvent(int _id, bool canBubbleArg, bool cancelableAr evt->deref(); } -void NodeImpl::dispatchMouseEvent(QMouseEvent *_mouse, int overrideId, int overrideDetail) +void NodeImpl::dispatchMouseEvent(TQMouseEvent *_mouse, int overrideId, int overrideDetail) { bool cancelable = true; int detail = overrideDetail; // defaults to 0 @@ -473,17 +473,17 @@ void NodeImpl::dispatchMouseEvent(QMouseEvent *_mouse, int overrideId, int overr } else { switch (_mouse->type()) { - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: evtId = EventImpl::MOUSEDOWN_EVENT; break; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: evtId = EventImpl::MOUSEUP_EVENT; break; - case QEvent::MouseButtonDblClick: + case TQEvent::MouseButtonDblClick: evtId = EventImpl::CLICK_EVENT; detail = 1; // ### support for multiple double clicks break; - case QEvent::MouseMove: + case TQEvent::MouseMove: evtId = EventImpl::MOUSEMOVE_EVENT; cancelable = false; break; @@ -565,7 +565,7 @@ void NodeImpl::dispatchSubtreeModifiedEvent() evt->deref(); } -bool NodeImpl::dispatchKeyEvent(QKeyEvent *key, bool keypress) +bool NodeImpl::dispatchKeyEvent(TQKeyEvent *key, bool keypress) { int exceptioncode = 0; //kdDebug(6010) << "DOM::NodeImpl: dispatching keyboard event" << endl; @@ -590,8 +590,8 @@ void NodeImpl::handleLocalEvents(EventImpl *evt, bool useCapture) // removeEventListener (e.g. called from a JS event listener) might // invalidate the item after the current iterator (which "it" is pointing to). // So we make a copy of the list. - QValueList<RegisteredEventListener> listeners = *m_regdListeners.listeners; - QValueList<RegisteredEventListener>::iterator it; + TQValueList<RegisteredEventListener> listeners = *m_regdListeners.listeners; + TQValueList<RegisteredEventListener>::iterator it; for (it = listeners.begin(); it != listeners.end(); ++it) { //Check whether this got removed...KDE4: use Java-style iterators if (!m_regdListeners.stillContainsListener(*it)) @@ -860,12 +860,12 @@ bool NodeImpl::maintainsState() return false; } -QString NodeImpl::state() +TQString NodeImpl::state() { - return QString::null; + return TQString::null; } -void NodeImpl::restoreState(const QString &/*state*/) +void NodeImpl::restoreState(const TQString &/*state*/) { } @@ -979,13 +979,13 @@ long NodeImpl::maxOffset() const DOMStringImpl* NodeImpl::textContent() const { - QString out; + TQString out; for (NodeImpl *child = firstChild(); child != 0; child = child->nextSibling()) { short type = child->nodeType(); if (type != Node::COMMENT_NODE && type != Node::PROCESSING_INSTRUCTION_NODE) { DOMStringImpl* kidText = child->textContent(); if (kidText) - out += QConstString(kidText->s, kidText->l).string(); + out += TQConstString(kidText->s, kidText->l).string(); delete kidText; } } @@ -1883,7 +1883,7 @@ GenericRONamedNodeMapImpl::GenericRONamedNodeMapImpl(DocumentImpl* doc) : NamedNodeMapImpl() { m_doc = doc; - m_contents = new QPtrList<NodeImpl>; + m_contents = new TQPtrList<NodeImpl>; } GenericRONamedNodeMapImpl::~GenericRONamedNodeMapImpl() @@ -1897,7 +1897,7 @@ GenericRONamedNodeMapImpl::~GenericRONamedNodeMapImpl() NodeImpl *GenericRONamedNodeMapImpl::getNamedItem ( NodeImpl::Id id, bool /*nsAware*/, DOMStringImpl* /*qName*/ ) const { // ## do we need namespace support in this class? - QPtrListIterator<NodeImpl> it(*m_contents); + TQPtrListIterator<NodeImpl> it(*m_contents); for (; it.current(); ++it) if (it.current()->id() == id) return it.current(); @@ -1960,12 +1960,12 @@ void RegisteredListenerList::addEventListener(int id, EventListener *listener, c { RegisteredEventListener rl(static_cast<EventImpl::EventId>(id),listener,useCapture); if (!listeners) - listeners = new QValueList<RegisteredEventListener>; + listeners = new TQValueList<RegisteredEventListener>; // if this id/listener/useCapture combination is already registered, do nothing. // the DOM2 spec says that "duplicate instances are discarded", and this keeps // the listener order intact. - QValueList<RegisteredEventListener>::iterator it; + TQValueList<RegisteredEventListener>::iterator it; for (it = listeners->begin(); it != listeners->end(); ++it) if (*it == rl) return; @@ -1980,7 +1980,7 @@ void RegisteredListenerList::removeEventListener(int id, EventListener *listener RegisteredEventListener rl(static_cast<EventImpl::EventId>(id),listener,useCapture); - QValueList<RegisteredEventListener>::iterator it; + TQValueList<RegisteredEventListener>::iterator it; for (it = listeners->begin(); it != listeners->end(); ++it) if (*it == rl) { listeners->remove(it); @@ -1996,9 +1996,9 @@ bool RegisteredListenerList::isHTMLEventListener(EventListener* listener) void RegisteredListenerList::setHTMLEventListener(int id, EventListener *listener) { if (!listeners) - listeners = new QValueList<RegisteredEventListener>; + listeners = new TQValueList<RegisteredEventListener>; - QValueList<RegisteredEventListener>::iterator it; + TQValueList<RegisteredEventListener>::iterator it; if (!listener) { for (it = listeners->begin(); it != listeners->end(); ++it) { if ((*it).id == id && isHTMLEventListener((*it).listener)) { @@ -2029,7 +2029,7 @@ EventListener *RegisteredListenerList::getHTMLEventListener(int id) if (!listeners) return 0; - QValueList<RegisteredEventListener>::iterator it; + TQValueList<RegisteredEventListener>::iterator it; for (it = listeners->begin(); it != listeners->end(); ++it) if ((*it).id == id && isHTMLEventListener((*it).listener)) { return (*it).listener; @@ -2042,7 +2042,7 @@ bool RegisteredListenerList::hasEventListener(int id) if (!listeners) return false; - QValueList<RegisteredEventListener>::iterator it; + TQValueList<RegisteredEventListener>::iterator it; for (it = listeners->begin(); it != listeners->end(); ++it) if ((*it).id == id) return true; diff --git a/khtml/xml/dom_nodeimpl.h b/khtml/xml/dom_nodeimpl.h index 1ff150f6a..31bbceda0 100644 --- a/khtml/xml/dom_nodeimpl.h +++ b/khtml/xml/dom_nodeimpl.h @@ -76,7 +76,7 @@ struct RegisteredListenerList { //### KDE4: should disappear bool stillContainsListener(const RegisteredEventListener& listener); - QValueList<RegisteredEventListener>* listeners;//The actual listener list - may be 0 + TQValueList<RegisteredEventListener>* listeners;//The actual listener list - may be 0 private: bool isHTMLEventListener(EventListener* listener); }; @@ -257,7 +257,7 @@ public: virtual bool isInline() const; virtual void getCaret(int offset, bool override, int &_x, int &_y, int &width, int &height); - virtual QRect getRect() const; + virtual TQRect getRect() const; enum StyleChange { NoChange, NoInherit, Inherit, Detach, Force }; virtual void recalcStyle( StyleChange = NoChange ) {} @@ -279,12 +279,12 @@ public: // return true if event not prevented bool dispatchHTMLEvent(int _id, bool canBubbleArg, bool cancelableArg); void dispatchWindowEvent(int _id, bool canBubbleArg, bool cancelableArg); - void dispatchMouseEvent(QMouseEvent *e, int overrideId = 0, int overrideDetail = 0); + void dispatchMouseEvent(TQMouseEvent *e, int overrideId = 0, int overrideDetail = 0); void dispatchUIEvent(int _id, int detail = 0); void dispatchSubtreeModifiedEvent(); // return true if defaultPrevented (i.e. event should be swallowed) // this matches the logic in KHTMLView. - bool dispatchKeyEvent(QKeyEvent *key, bool keypress); + bool dispatchKeyEvent(TQKeyEvent *key, bool keypress); void handleLocalEvents(EventImpl *evt, bool useCapture); @@ -392,7 +392,7 @@ public: * * @return State information about the node represented as a string */ - virtual QString state(); + virtual TQString state(); /** * Sets the state of the element based on a string previosuly returned by state(). This is used to initialize form @@ -400,7 +400,7 @@ public: * * @param state A string representation of the node's previously-stored state */ - virtual void restoreState(const QString &state); + virtual void restoreState(const TQString &state); // ----------------------------------------------------------------------------- // Notification of document stucture changes @@ -584,7 +584,7 @@ public: { static Cache* make() { return new Cache; } - CacheKey key;//### We must store this in here due to QCache in Qt3 sucking + CacheKey key;//### We must store this in here due to TQCache in Qt3 sucking unsigned int version; union @@ -729,7 +729,7 @@ public: protected: DocumentImpl* m_doc; - QPtrList<NodeImpl> *m_contents; + TQPtrList<NodeImpl> *m_contents; }; } //namespace diff --git a/khtml/xml/dom_stringimpl.cpp b/khtml/xml/dom_stringimpl.cpp index cb32f5903..bb1a728e9 100644 --- a/khtml/xml/dom_stringimpl.cpp +++ b/khtml/xml/dom_stringimpl.cpp @@ -28,7 +28,7 @@ #include <kdebug.h> #include <string.h> -#include <qstringlist.h> +#include <tqstringlist.h> using namespace DOM; using namespace khtml; @@ -41,14 +41,14 @@ DOMStringImpl::DOMStringImpl(const char *str) l = strlen(str); s = QT_ALLOC_QCHAR_VEC( l ); int i = l; - QChar* ptr = s; + TQChar* ptr = s; while( i-- ) *ptr++ = *str++; } else { s = QT_ALLOC_QCHAR_VEC( 1 ); // crash protection - s[0] = 0x0; // == QChar::null; + s[0] = 0x0; // == TQChar::null; l = 0; } } @@ -60,12 +60,12 @@ bool DOMStringImpl::containsOnlyWhitespace() const return true; for (uint i = 0; i < l; i++) { - QChar c = s[i]; + TQChar c = s[i]; if (c.unicode() <= 0x7F) { if (c.unicode() > ' ') return false; } else { - if (c.direction() != QChar::DirWS) + if (c.direction() != TQChar::DirWS) return false; } } @@ -78,9 +78,9 @@ void DOMStringImpl::append(DOMStringImpl *str) if(str && str->l != 0) { int newlen = l+str->l; - QChar *c = QT_ALLOC_QCHAR_VEC(newlen); - memcpy(c, s, l*sizeof(QChar)); - memcpy(c+l, str->s, str->l*sizeof(QChar)); + TQChar *c = QT_ALLOC_QCHAR_VEC(newlen); + memcpy(c, s, l*sizeof(TQChar)); + memcpy(c+l, str->s, str->l*sizeof(TQChar)); if(s) QT_DELETE_QCHAR_VEC(s); s = c; l = newlen; @@ -97,10 +97,10 @@ void DOMStringImpl::insert(DOMStringImpl *str, unsigned int pos) if(str && str->l != 0) { int newlen = l+str->l; - QChar *c = QT_ALLOC_QCHAR_VEC(newlen); - memcpy(c, s, pos*sizeof(QChar)); - memcpy(c+pos, str->s, str->l*sizeof(QChar)); - memcpy(c+pos+str->l, s+pos, (l-pos)*sizeof(QChar)); + TQChar *c = QT_ALLOC_QCHAR_VEC(newlen); + memcpy(c, s, pos*sizeof(TQChar)); + memcpy(c+pos, str->s, str->l*sizeof(TQChar)); + memcpy(c+pos+str->l, s+pos, (l-pos)*sizeof(TQChar)); if(s) QT_DELETE_QCHAR_VEC(s); s = c; l = newlen; @@ -112,8 +112,8 @@ void DOMStringImpl::truncate(int len) if(len > (int)l) return; int nl = len < 1 ? 1 : len; - QChar *c = QT_ALLOC_QCHAR_VEC(nl); - memcpy(c, s, nl*sizeof(QChar)); + TQChar *c = QT_ALLOC_QCHAR_VEC(nl); + memcpy(c, s, nl*sizeof(TQChar)); if(s) QT_DELETE_QCHAR_VEC(s); s = c; l = len; @@ -126,9 +126,9 @@ void DOMStringImpl::remove(unsigned int pos, int len) len = l - pos; uint newLen = l-len; - QChar *c = QT_ALLOC_QCHAR_VEC(newLen); - memcpy(c, s, pos*sizeof(QChar)); - memcpy(c+pos, s+pos+len, (l-len-pos)*sizeof(QChar)); + TQChar *c = QT_ALLOC_QCHAR_VEC(newLen); + memcpy(c, s, pos*sizeof(TQChar)); + memcpy(c+pos, s+pos+len, (l-len-pos)*sizeof(TQChar)); if(s) QT_DELETE_QCHAR_VEC(s); s = c; l = newLen; @@ -159,14 +159,14 @@ DOMStringImpl *DOMStringImpl::collapseWhiteSpace(bool preserveLF, bool preserveW if (preserveLF && preserveWS) return this; // Notice we are likely allocating more space than needed (worst case) - QChar *n = QT_ALLOC_QCHAR_VEC(l); + TQChar *n = QT_ALLOC_QCHAR_VEC(l); unsigned int pos = 0; bool collapsing = false; // collapsing white-space bool collapsingLF = false; // collapsing around linefeed bool changedLF = false; for(unsigned int i=0; i<l; i++) { - QChar ch = s[i]; + TQChar ch = s[i]; // We act on \r as we would on \n because CSS uses it to indicate new-line if (ch == '\r') ch = '\n'; @@ -224,7 +224,7 @@ DOMStringImpl *DOMStringImpl::collapseWhiteSpace(bool preserveLF, bool preserveW } } -static Length parseLength(const QChar *s, unsigned int l) +static Length parseLength(const TQChar *s, unsigned int l) { if (l == 0) { return Length(1, Relative); @@ -239,7 +239,7 @@ static Length parseLength(const QChar *s, unsigned int l) ++i; bool ok; - int r = QConstString(s, i).string().toInt(&ok); + int r = TQConstString(s, i).string().toInt(&ok); /* Skip over any remaining digits, we are not that accurate (5.5% => 5%) */ while (i < l && (s[i].isDigit() || s[i] == '.')) @@ -253,7 +253,7 @@ static Length parseLength(const QChar *s, unsigned int l) if (i == l) { return Length(r, Fixed); } else { - const QChar* next = s+i; + const TQChar* next = s+i; if (*next == '%') return Length(r, Percent); @@ -264,7 +264,7 @@ static Length parseLength(const QChar *s, unsigned int l) return Length(r, Fixed); } else { if (i < l) { - const QChar* next = s+i; + const TQChar* next = s+i; if (*next == '*') return Length(1, Relative); @@ -278,9 +278,9 @@ static Length parseLength(const QChar *s, unsigned int l) khtml::Length* DOMStringImpl::toCoordsArray(int& len) const { - QString str(s, l); + TQString str(s, l); for(unsigned int i=0; i < l; i++) { - QChar cc = s[i]; + TQChar cc = s[i]; if (cc > '9' || (cc < '0' && cc != '-' && cc != '*' && cc != '.')) str[i] = ' '; } @@ -294,17 +294,17 @@ khtml::Length* DOMStringImpl::toCoordsArray(int& len) const int pos2; while((pos2 = str.find(' ', pos)) != -1) { - r[i++] = parseLength((QChar *) str.unicode()+pos, pos2-pos); + r[i++] = parseLength((TQChar *) str.unicode()+pos, pos2-pos); pos = pos2+1; } - r[i] = parseLength((QChar *) str.unicode()+pos, str.length()-pos); + r[i] = parseLength((TQChar *) str.unicode()+pos, str.length()-pos); return r; } khtml::Length* DOMStringImpl::toLengthArray(int& len) const { - QString str(s, l); + TQString str(s, l); str = str.simplifyWhiteSpace(); len = str.contains(',') + 1; @@ -320,13 +320,13 @@ khtml::Length* DOMStringImpl::toLengthArray(int& len) const int pos2; while((pos2 = str.find(',', pos)) != -1) { - r[i++] = parseLength((QChar *) str.unicode()+pos, pos2-pos); + r[i++] = parseLength((TQChar *) str.unicode()+pos, pos2-pos); pos = pos2+1; } /* IE Quirk: If the last comma is the last char skip it and reduce len by one */ if (str.length()-pos > 0) - r[i] = parseLength((QChar *) str.unicode()+pos, str.length()-pos); + r[i] = parseLength((TQChar *) str.unicode()+pos, str.length()-pos); else len--; @@ -397,9 +397,9 @@ DOMStringImpl *DOMStringImpl::capitalize(bool noFirstCap) const return c; } -QString DOMStringImpl::string() const +TQString DOMStringImpl::string() const { - return QString(s, l); + return TQString(s, l); } int DOMStringImpl::toInt(bool* ok) const @@ -413,7 +413,7 @@ int DOMStringImpl::toInt(bool* ok) const while (i < l && s[i].isDigit()) ++i; - return QConstString(s, i).string().toInt(ok); + return TQConstString(s, i).string().toInt(ok); } static const unsigned short amp[] = {'&', 'a', 'm', 'p', ';'}; diff --git a/khtml/xml/dom_stringimpl.h b/khtml/xml/dom_stringimpl.h index b1430bc89..cd7128967 100644 --- a/khtml/xml/dom_stringimpl.h +++ b/khtml/xml/dom_stringimpl.h @@ -23,13 +23,13 @@ #ifndef _DOM_DOMStringImpl_h_ #define _DOM_DOMStringImpl_h_ -#include <qstring.h> +#include <tqstring.h> #include "dom/dom_misc.h" #include "misc/khtmllayout.h" #include "misc/shared.h" -#define QT_ALLOC_QCHAR_VEC( N ) (QChar*) new char[ sizeof(QChar)*( N ) ] +#define QT_ALLOC_QCHAR_VEC( N ) (TQChar*) new char[ sizeof(TQChar)*( N ) ] #define QT_DELETE_QCHAR_VEC( P ) delete[] ((char*)( P )) namespace DOM { @@ -42,11 +42,11 @@ private: protected: DOMStringImpl() { s = 0, l = 0; } public: - DOMStringImpl(const QChar *str, unsigned int len) { + DOMStringImpl(const TQChar *str, unsigned int len) { bool havestr = str && len; s = QT_ALLOC_QCHAR_VEC( havestr ? len : 1 ); if(str && len) { - memcpy( s, str, len * sizeof(QChar) ); + memcpy( s, str, len * sizeof(TQChar) ); l = len; } else { // crash protection @@ -56,7 +56,7 @@ public: } explicit DOMStringImpl(const char *str); - explicit DOMStringImpl(const QChar &ch) { + explicit DOMStringImpl(const TQChar &ch) { s = QT_ALLOC_QCHAR_VEC( 1 ); s[0] = ch; l = 1; @@ -78,7 +78,7 @@ public: DOMStringImpl *substring(unsigned int pos, unsigned int len); DOMStringImpl *collapseWhiteSpace(bool preserveLF, bool preserveWS); - const QChar &operator [] (int pos) { return s[pos]; } + const TQChar &operator [] (int pos) { return s[pos]; } bool containsOnlyWhitespace() const; // ignores trailing garbage, unlike QString @@ -92,12 +92,12 @@ public: DOMStringImpl *capitalize(bool noFirstCap=false) const; DOMStringImpl *escapeHTML(); - QChar *unicode() const { return s; } + TQChar *unicode() const { return s; } uint length() const { return l; } - QString string() const; + TQString string() const; unsigned int l; - QChar *s; + TQChar *s; }; } diff --git a/khtml/xml/dom_xmlimpl.cpp b/khtml/xml/dom_xmlimpl.cpp index 90ec2b352..121ad436a 100644 --- a/khtml/xml/dom_xmlimpl.cpp +++ b/khtml/xml/dom_xmlimpl.cpp @@ -391,7 +391,7 @@ void ProcessingInstructionImpl::checkStyleSheet() // ### make sure this gets called when adding from javascript XMLAttributeReader attrReader(DOMString(m_data).string()); bool attrsOk; - QXmlAttributes attrs = attrReader.readAttrs(attrsOk); + TQXmlAttributes attrs = attrReader.readAttrs(attrsOk); if (!attrsOk) return; if (attrs.value("type") != "text/css" && !attrs.value("type").isEmpty()) @@ -414,7 +414,7 @@ void ProcessingInstructionImpl::checkStyleSheet() // ### some validation on the URL? // ### FIXME charset if (m_cachedSheet) m_cachedSheet->deref(this); - m_cachedSheet = getDocument()->docLoader()->requestStyleSheet(getDocument()->completeURL(href.string()), QString::null); + m_cachedSheet = getDocument()->docLoader()->requestStyleSheet(getDocument()->completeURL(href.string()), TQString::null); if (m_cachedSheet) { getDocument()->addPendingSheet(); //before ref, because during the ref it might load! m_cachedSheet->ref( this ); @@ -466,7 +466,7 @@ DOMString ProcessingInstructionImpl::toString() const // ------------------------------------------------------------------------- -XMLAttributeReader::XMLAttributeReader(const QString& _attrString) +XMLAttributeReader::XMLAttributeReader(const TQString& _attrString) { m_attrString = _attrString; } @@ -475,19 +475,19 @@ XMLAttributeReader::~XMLAttributeReader() { } -QXmlAttributes XMLAttributeReader::readAttrs(bool &ok) +TQXmlAttributes XMLAttributeReader::readAttrs(bool &ok) { // parse xml file - QXmlInputSource source; + TQXmlInputSource source; source.setData("<?xml version=\"1.0\"?><attrs "+m_attrString+" />"); - QXmlSimpleReader reader; + TQXmlSimpleReader reader; reader.setContentHandler( this ); ok = reader.parse( source ); return attrs; } -bool XMLAttributeReader::startElement(const QString& /*namespaceURI*/, const QString& localName, - const QString& /*qName*/, const QXmlAttributes& atts) +bool XMLAttributeReader::startElement(const TQString& /*namespaceURI*/, const TQString& localName, + const TQString& /*qName*/, const TQXmlAttributes& atts) { if (localName == "attrs") { attrs = atts; diff --git a/khtml/xml/dom_xmlimpl.h b/khtml/xml/dom_xmlimpl.h index 6fa125af7..a394579d2 100644 --- a/khtml/xml/dom_xmlimpl.h +++ b/khtml/xml/dom_xmlimpl.h @@ -26,7 +26,7 @@ #include "xml/dom_nodeimpl.h" #include "misc/loader_client.h" -#include <qxml.h> +#include <tqxml.h> namespace khtml { class CachedCSSStyleSheet; @@ -166,14 +166,14 @@ protected: class XMLAttributeReader : public QXmlDefaultHandler { public: - XMLAttributeReader(const QString& _attrString); + XMLAttributeReader(const TQString& _attrString); virtual ~XMLAttributeReader(); - QXmlAttributes readAttrs(bool &ok); - bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts); + TQXmlAttributes readAttrs(bool &ok); + bool startElement(const TQString& namespaceURI, const TQString& localName, const TQString& qName, const TQXmlAttributes& atts); protected: - QXmlAttributes attrs; - QString m_attrString; + TQXmlAttributes attrs; + TQString m_attrString; }; } //namespace diff --git a/khtml/xml/xml_tokenizer.cpp b/khtml/xml/xml_tokenizer.cpp index 5489b8c21..7c043815a 100644 --- a/khtml/xml/xml_tokenizer.cpp +++ b/khtml/xml/xml_tokenizer.cpp @@ -34,7 +34,7 @@ #include "khtmlview.h" #include "khtml_part.h" -#include <qvariant.h> +#include <tqvariant.h> #include <kdebug.h> #include <klocale.h> @@ -42,7 +42,7 @@ using namespace DOM; using namespace khtml; XMLIncrementalSource::XMLIncrementalSource() - : QXmlInputSource(), m_pos( 0 ), m_unicode( 0 ), + : TQXmlInputSource(), m_pos( 0 ), m_unicode( 0 ), m_finished( false ) { } @@ -52,17 +52,17 @@ void XMLIncrementalSource::fetchData() //just a dummy to overwrite default behavior } -QChar XMLIncrementalSource::next() +TQChar XMLIncrementalSource::next() { if ( m_finished ) - return QXmlInputSource::EndOfDocument; + return TQXmlInputSource::EndOfDocument; else if ( m_data.length() <= m_pos ) - return QXmlInputSource::EndOfData; + return TQXmlInputSource::EndOfData; else return m_unicode[m_pos++]; } -void XMLIncrementalSource::setData( const QString& str ) +void XMLIncrementalSource::setData( const TQString& str ) { m_data = str; m_unicode = m_data.unicode(); @@ -70,18 +70,18 @@ void XMLIncrementalSource::setData( const QString& str ) if ( !str.isEmpty() ) m_finished = false; } -void XMLIncrementalSource::setData( const QByteArray& data ) +void XMLIncrementalSource::setData( const TQByteArray& data ) { setData( fromRawData( data, true ) ); } -void XMLIncrementalSource::appendXML( const QString& str ) +void XMLIncrementalSource::appendXML( const TQString& str ) { m_data += str; m_unicode = m_data.unicode(); } -QString XMLIncrementalSource::data() +TQString XMLIncrementalSource::data() { return m_data; } @@ -118,7 +118,7 @@ NodeImpl *XMLHandler::currentNode() const return m_nodes.current(); } -QString XMLHandler::errorProtocol() +TQString XMLHandler::errorProtocol() { return errorProt; } @@ -133,28 +133,28 @@ bool XMLHandler::startDocument() return true; } -bool XMLHandler::startPrefixMapping(const QString& prefix, const QString& uri) +bool XMLHandler::startPrefixMapping(const TQString& prefix, const TQString& uri) { namespaceInfo[prefix].push(uri); return true; } -bool XMLHandler::endPrefixMapping(const QString& prefix) +bool XMLHandler::endPrefixMapping(const TQString& prefix) { - QValueStack<QString>& stack = namespaceInfo[prefix]; + TQValueStack<TQString>& stack = namespaceInfo[prefix]; stack.pop(); if (stack.isEmpty()) namespaceInfo.remove(prefix); return true; } -void XMLHandler::fixUpNSURI(QString& uri, const QString& qname) +void XMLHandler::fixUpNSURI(TQString& uri, const TQString& qname) { /* QXml does not resolve the namespaces of attributes in the same tag that preceed the xmlns declaration. This fixes up that case */ if (uri.isEmpty() && qname.find(':') != -1) { - QXmlNamespaceSupport ns; - QString localName, prefix; + TQXmlNamespaceSupport ns; + TQString localName, prefix; ns.splitName(qname, prefix, localName); if (namespaceInfo.contains(prefix)) { uri = namespaceInfo[prefix].top(); @@ -162,8 +162,8 @@ void XMLHandler::fixUpNSURI(QString& uri, const QString& qname) } } -bool XMLHandler::startElement( const QString& namespaceURI, const QString& /*localName*/, - const QString& qName, const QXmlAttributes& atts ) +bool XMLHandler::startElement( const TQString& namespaceURI, const TQString& /*localName*/, + const TQString& qName, const TQXmlAttributes& atts ) { if (currentNode()->nodeType() == Node::TEXT_NODE) exitText(); @@ -180,8 +180,8 @@ bool XMLHandler::startElement( const QString& namespaceURI, const QString& /*loc int i; for (i = 0; i < atts.length(); i++) { int exceptioncode = 0; - QString uriString = atts.uri(i); - QString qnString = atts.qName(i); + TQString uriString = atts.uri(i); + TQString qnString = atts.qName(i); fixUpNSURI(uriString, qnString); DOMString uri(uriString); DOMString qn(qnString); @@ -221,7 +221,7 @@ bool XMLHandler::startElement( const QString& namespaceURI, const QString& /*loc } -bool XMLHandler::endElement( const QString& /*namespaceURI*/, const QString& /*localName*/, const QString& /*qName*/ ) +bool XMLHandler::endElement( const TQString& /*namespaceURI*/, const TQString& /*localName*/, const TQString& /*qName*/ ) { if (currentNode()->nodeType() == Node::TEXT_NODE) exitText(); @@ -264,7 +264,7 @@ bool XMLHandler::endCDATA() return currentNode(); } -bool XMLHandler::characters( const QString& ch ) +bool XMLHandler::characters( const TQString& ch ) { if (currentNode()->nodeType() == Node::TEXT_NODE || currentNode()->nodeType() == Node::CDATA_SECTION_NODE || @@ -284,7 +284,7 @@ bool XMLHandler::characters( const QString& ch ) } -bool XMLHandler::comment(const QString & ch) +bool XMLHandler::comment(const TQString & ch) { if (currentNode()->nodeType() == Node::TEXT_NODE) exitText(); @@ -293,7 +293,7 @@ bool XMLHandler::comment(const QString & ch) return true; } -bool XMLHandler::processingInstruction(const QString &target, const QString &data) +bool XMLHandler::processingInstruction(const TQString &target, const TQString &data) { if (currentNode()->nodeType() == Node::TEXT_NODE) exitText(); @@ -306,14 +306,14 @@ bool XMLHandler::processingInstruction(const QString &target, const QString &dat } -QString XMLHandler::errorString() +TQString XMLHandler::errorString() { // ### Make better error-messages return i18n("the document is not in the correct file format"); } -bool XMLHandler::fatalError( const QXmlParseException& exception ) +bool XMLHandler::fatalError( const TQXmlParseException& exception ) { errorProt += i18n( "fatal parsing error: %1 in line %2, column %3" ) .arg( exception.message() ) @@ -346,21 +346,21 @@ void XMLHandler::exitText() popNode(); } -bool XMLHandler::attributeDecl(const QString &/*eName*/, const QString &/*aName*/, const QString &/*type*/, - const QString &/*valueDefault*/, const QString &/*value*/) +bool XMLHandler::attributeDecl(const TQString &/*eName*/, const TQString &/*aName*/, const TQString &/*type*/, + const TQString &/*valueDefault*/, const TQString &/*value*/) { // qt's xml parser (as of 2.2.3) does not currently give us values for type, valueDefault and // value. When it does, we can store these somewhere and have default attributes on elements return true; } -bool XMLHandler::externalEntityDecl(const QString &/*name*/, const QString &/*publicId*/, const QString &/*systemId*/) +bool XMLHandler::externalEntityDecl(const TQString &/*name*/, const TQString &/*publicId*/, const TQString &/*systemId*/) { // ### insert these too - is there anything special we have to do here? return true; } -bool XMLHandler::internalEntityDecl(const QString &name, const QString &value) +bool XMLHandler::internalEntityDecl(const TQString &name, const TQString &value) { EntityImpl *e = new EntityImpl(m_doc,name); // ### further parse entities inside the value and add them as separate nodes (or entityreferences)? @@ -370,7 +370,7 @@ bool XMLHandler::internalEntityDecl(const QString &name, const QString &value) return true; } -bool XMLHandler::notationDecl(const QString &/*name*/, const QString &/*publicId*/, const QString &/*systemId*/) +bool XMLHandler::notationDecl(const TQString &/*name*/, const TQString &/*publicId*/, const TQString &/*systemId*/) { // ### FIXME // if (m_doc->document()->doctype()) { @@ -380,8 +380,8 @@ bool XMLHandler::notationDecl(const QString &/*name*/, const QString &/*publicId return true; } -bool XMLHandler::unparsedEntityDecl(const QString &/*name*/, const QString &/*publicId*/, - const QString &/*systemId*/, const QString &/*notationName*/) +bool XMLHandler::unparsedEntityDecl(const TQString &/*name*/, const TQString &/*publicId*/, + const TQString &/*systemId*/, const TQString &/*notationName*/) { // ### return true; @@ -456,10 +456,10 @@ void XMLTokenizer::finish() while (m_doc->hasChildNodes()) static_cast<NodeImpl*>(m_doc)->removeChild(m_doc->firstChild(),exceptioncode); - QString line, errorLocPtr; + TQString line, errorLocPtr; if ( m_handler.errorLine ) { - QString xmlCode = m_source.data(); - QTextIStream stream(&xmlCode); + TQString xmlCode = m_source.data(); + TQTextIStream stream(&xmlCode); for (unsigned long lineno = 0; lineno < m_handler.errorLine-1; lineno++) stream.readLine(); line = stream.readLine(); @@ -517,7 +517,7 @@ void XMLTokenizer::finish() // Parsing was successful. Now locate all html <script> tags in the document and execute them // one by one addScripts(m_doc); - m_scriptsIt = new QPtrListIterator<HTMLScriptElementImpl>(m_scripts); + m_scriptsIt = new TQPtrListIterator<HTMLScriptElementImpl>(m_scripts); executeScripts(); } @@ -545,7 +545,7 @@ void XMLTokenizer::executeScripts() // inside the tag while (m_scriptsIt->current()) { DOMString scriptSrc = m_scriptsIt->current()->getAttribute(ATTR_SRC); - QString charset = m_scriptsIt->current()->getAttribute(ATTR_CHARSET).string(); + TQString charset = m_scriptsIt->current()->getAttribute(ATTR_CHARSET).string(); if (!scriptSrc.isEmpty()) { // we have a src attribute @@ -558,12 +558,12 @@ void XMLTokenizer::executeScripts() } else { // no src attribute - execute from contents of tag - QString scriptCode = ""; + TQString scriptCode = ""; NodeImpl *child; for (child = m_scriptsIt->current()->firstChild(); child; child = child->nextSibling()) { if ( ( child->nodeType() == Node::TEXT_NODE || child->nodeType() == Node::CDATA_SECTION_NODE) && static_cast<TextImpl*>(child)->string() ) - scriptCode += QConstString(static_cast<TextImpl*>(child)->string()->s, + scriptCode += TQConstString(static_cast<TextImpl*>(child)->string()->s, static_cast<TextImpl*>(child)->string()->l).string(); } // the script cannot do document.write until we support incremental parsing diff --git a/khtml/xml/xml_tokenizer.h b/khtml/xml/xml_tokenizer.h index 4042b905f..cbf5cd5dd 100644 --- a/khtml/xml/xml_tokenizer.h +++ b/khtml/xml/xml_tokenizer.h @@ -23,11 +23,11 @@ #ifndef _XML_Tokenizer_h_ #define _XML_Tokenizer_h_ -#include <qxml.h> -#include <qptrlist.h> -#include <qptrstack.h> -#include <qvaluestack.h> -#include <qobject.h> +#include <tqxml.h> +#include <tqptrlist.h> +#include <tqptrstack.h> +#include <tqvaluestack.h> +#include <tqobject.h> #include "misc/loader_client.h" #include "misc/stringit.h" @@ -55,41 +55,41 @@ public: virtual ~XMLHandler(); // return the error protocol if parsing failed - QString errorProtocol(); + TQString errorProtocol(); // overloaded handler functions bool startDocument(); - bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts); - bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName); + bool startElement(const TQString& namespaceURI, const TQString& localName, const TQString& qName, const TQXmlAttributes& atts); + bool endElement(const TQString& namespaceURI, const TQString& localName, const TQString& qName); bool startCDATA(); bool endCDATA(); - bool characters(const QString& ch); - bool comment(const QString & ch); - bool processingInstruction(const QString &target, const QString &data); + bool characters(const TQString& ch); + bool comment(const TQString & ch); + bool processingInstruction(const TQString &target, const TQString &data); // namespace handling, to workaround problem in QXML where some attributes // do not get the namespace resolved properly - bool startPrefixMapping(const QString& prefix, const QString& uri); - bool endPrefixMapping(const QString& prefix); - void fixUpNSURI(QString& uri, const QString& qname); - QMap<QString, QValueStack<QString> > namespaceInfo; + bool startPrefixMapping(const TQString& prefix, const TQString& uri); + bool endPrefixMapping(const TQString& prefix); + void fixUpNSURI(TQString& uri, const TQString& qname); + TQMap<TQString, TQValueStack<TQString> > namespaceInfo; // from QXmlDeclHandler - bool attributeDecl(const QString &eName, const QString &aName, const QString &type, const QString &valueDefault, const QString &value); - bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId); - bool internalEntityDecl(const QString &name, const QString &value); + bool attributeDecl(const TQString &eName, const TQString &aName, const TQString &type, const TQString &valueDefault, const TQString &value); + bool externalEntityDecl(const TQString &name, const TQString &publicId, const TQString &systemId); + bool internalEntityDecl(const TQString &name, const TQString &value); // from QXmlDTDHandler - bool notationDecl(const QString &name, const QString &publicId, const QString &systemId); - bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString ¬ationName); + bool notationDecl(const TQString &name, const TQString &publicId, const TQString &systemId); + bool unparsedEntityDecl(const TQString &name, const TQString &publicId, const TQString &systemId, const TQString ¬ationName); bool enterText(); void exitText(); - QString errorString(); + TQString errorString(); - bool fatalError( const QXmlParseException& exception ); + bool fatalError( const TQXmlParseException& exception ); unsigned long errorLine; unsigned long errorCol; @@ -99,10 +99,10 @@ private: DOM::NodeImpl *popNode(); DOM::NodeImpl *currentNode() const; private: - QString errorProt; + TQString errorProt; DOM::DocumentImpl *m_doc; KHTMLView *m_view; - QPtrStack<DOM::NodeImpl> m_nodes; + TQPtrStack<DOM::NodeImpl> m_nodes; DOM::NodeImpl *m_rootNode; enum State { @@ -144,18 +144,18 @@ class XMLIncrementalSource : public QXmlInputSource public: XMLIncrementalSource(); virtual void fetchData(); - virtual QChar next(); - virtual void setData( const QString& str ); - virtual void setData( const QByteArray& data ); - virtual QString data(); + virtual TQChar next(); + virtual void setData( const TQString& str ); + virtual void setData( const TQByteArray& data ); + virtual TQString data(); - void appendXML( const QString& str ); + void appendXML( const TQString& str ); void setFinished( bool ); private: - QString m_data; + TQString m_data; uint m_pos; - const QChar *m_unicode; + const TQChar *m_unicode; bool m_finished; }; @@ -183,12 +183,12 @@ protected: void executeScripts(); void addScripts(DOM::NodeImpl *n); - QPtrList<DOM::HTMLScriptElementImpl> m_scripts; - QPtrListIterator<DOM::HTMLScriptElementImpl> *m_scriptsIt; + TQPtrList<DOM::HTMLScriptElementImpl> m_scripts; + TQPtrListIterator<DOM::HTMLScriptElementImpl> *m_scriptsIt; khtml::CachedScript *m_cachedScript; XMLHandler m_handler; - QXmlSimpleReader m_reader; + TQXmlSimpleReader m_reader; XMLIncrementalSource m_source; bool m_noErrors; }; |