diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
commit | 9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch) | |
tree | c81c34dae2b3b1ea73801bf18a960265dc4207f7 /kjsembed/jsbinding.cpp | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'kjsembed/jsbinding.cpp')
-rw-r--r-- | kjsembed/jsbinding.cpp | 304 |
1 files changed, 152 insertions, 152 deletions
diff --git a/kjsembed/jsbinding.cpp b/kjsembed/jsbinding.cpp index 7abddf2c..5d8e4a14 100644 --- a/kjsembed/jsbinding.cpp +++ b/kjsembed/jsbinding.cpp @@ -41,7 +41,7 @@ namespace KJSEmbed { // ========= // // Bool, Double, CString, String, StringList, Int, UInt, Date, Time, DateTime, - // Rect, Size, Point, Pixmap, Image, Brush, Pen, Size, Rect, Point, TQValueList<TQVariant> + // Rect, Size, Point, Pixmap, Image, Brush, Pen, Size, Rect, Point, TTQValueList<TTQVariant> // // Opqaue // ====== @@ -51,7 +51,7 @@ namespace KJSEmbed { // ByteArray, BitArray // - KJS::Value convertToValue( KJS::ExecState *exec, const TQVariant &val ) { + KJS::Value convertToValue( KJS::ExecState *exec, const TTQVariant &val ) { if ( !val.isValid() ) return KJS::Undefined(); @@ -61,23 +61,23 @@ namespace KJSEmbed { switch( type ) { - case TQVariant::String: - case TQVariant::CString: + case TTQVariant::String: + case TTQVariant::CString: return KJS::String( val.toString() ); break; - case TQVariant::Int: + case TTQVariant::Int: return KJS::Number( val.toInt() ); break; - case TQVariant::UInt: + case TTQVariant::UInt: return KJS::Number( val.toUInt() ); break; - case TQVariant::Double: + case TTQVariant::Double: return KJS::Number( val.toDouble() ); break; - case TQVariant::Bool: + case TTQVariant::Bool: return KJS::Boolean( val.toBool() ); break; - case TQVariant::Rect: + case TTQVariant::Rect: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -86,14 +86,14 @@ namespace KJSEmbed { return proxyObj; break; } - case TQVariant::Date: - case TQVariant::DateTime: - case TQVariant::Time: + case TTQVariant::Date: + case TTQVariant::DateTime: + case TTQVariant::Time: { - TQDateTime dt = TQDateTime::currentDateTime(); - if ( type == TQVariant::Date ) + TTQDateTime dt = TTQDateTime::currentDateTime(); + if ( type == TTQVariant::Date ) dt.setDate( val.toDate() ); - else if ( type == TQVariant::Time ) + else if ( type == TTQVariant::Time ) dt.setTime( val.toTime() ); else dt = val.toDateTime(); @@ -107,7 +107,7 @@ namespace KJSEmbed { return KJS::Object( exec->interpreter() ->builtinDate().construct( exec, items ) ); break; } - case TQVariant::Point: + case TTQVariant::Point: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -116,37 +116,37 @@ namespace KJSEmbed { return proxyObj; break; } - case TQVariant::StringList: + case TTQVariant::StringList: { - TQStringList lst = val.toStringList(); - TQStringList::Iterator idx = lst.begin(); + TTQStringList lst = val.toStringList(); + TTQStringList::Iterator idx = lst.begin(); for ( ; idx != lst.end(); ++idx ) items.append( KJS::String( ( *idx ) ) ); return KJS::Object( exec->interpreter() ->builtinArray().construct( exec, items ) ); break; } - case TQVariant::List: -// case TQVariant::StringList: -// This will cause an extra conversion step for a QStrinList so use the above case. + case TTQVariant::List: +// case TTQVariant::StringList: +// This will cause an extra conversion step for a TQStrinList so use the above case. { - TQValueList<TQVariant> lst = val.toList(); - TQValueList<TQVariant>::Iterator idx = lst.begin(); + TTQValueList<TTQVariant> lst = val.toList(); + TTQValueList<TTQVariant>::Iterator idx = lst.begin(); for ( ; idx != lst.end(); ++idx ) items.append( convertToValue( exec, ( *idx ) ) ); return KJS::Object( exec->interpreter() ->builtinArray().construct( exec, items ) ); break; } - case TQVariant::Map: + case TTQVariant::Map: { - TQMap<TQString,TQVariant> map = val.toMap(); - TQMap<TQString,TQVariant>::Iterator idx = map.begin(); + TTQMap<TTQString,TTQVariant> map = val.toMap(); + TTQMap<TTQString,TTQVariant>::Iterator idx = map.begin(); KJS::Object array( exec->interpreter() ->builtinArray().construct( exec, 0 ) ); for ( ; idx != map.end(); ++idx ) array.put(exec, KJS::Identifier(idx.key().latin1()), convertToValue( exec, idx.data() ) ); return array; break; } - case TQVariant::Pixmap: + case TTQVariant::Pixmap: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -155,7 +155,7 @@ namespace KJSEmbed { return proxyObj; break; } - case TQVariant::Brush: + case TTQVariant::Brush: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -163,7 +163,7 @@ namespace KJSEmbed { Bindings::BrushImp::addBindings( exec, proxyObj ); return proxyObj; } - case TQVariant::Image: + case TTQVariant::Image: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -172,7 +172,7 @@ namespace KJSEmbed { return proxyObj; break; } - case TQVariant::Pen: + case TTQVariant::Pen: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -181,7 +181,7 @@ namespace KJSEmbed { return proxyObj; break; } - case TQVariant::Size: + case TTQVariant::Size: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -192,7 +192,7 @@ namespace KJSEmbed { } default: { - if ( val.canCast( TQVariant::String ) ) + if ( val.canCast( TTQVariant::String ) ) return KJS::String( val.toString() ); else { @@ -209,8 +209,8 @@ namespace KJSEmbed { } } - TQVariant convertToVariant( KJS::ExecState *exec, const KJS::Value &v ) { - TQVariant val; + TTQVariant convertToVariant( KJS::ExecState *exec, const KJS::Value &v ) { + TTQVariant val; KJS::Type type = v.type(); kdDebug( 80001 ) << "Convert a value of type " << type << " to a variant" << endl; switch( type ) @@ -253,12 +253,12 @@ namespace KJSEmbed { */ /*if ( prx ) { - TQObject * o = prx->object(); - TQCString cs( o ? o->className() : "" ); + TTQObject * o = prx->object(); + TTQCString cs( o ? o->className() : "" ); if ( obj.implementsConstruct() ) - val = TQString( "new %1();" ).arg( obj.className().qstring() ); + val = TTQString( "new %1();" ).arg( obj.className().qstring() ); else if ( obj.implementsCall() ) - val = TQString( "%1(...);" ).arg( obj.className().qstring() ); + val = TTQString( "%1(...);" ).arg( obj.className().qstring() ); kdDebug( 80001 ) << "convertToVariant() got a JSObjectProxy" << endl; } else */if ( vprx ) { kdDebug( 80001 ) << "convertToVariant() got a variant JSValueProxy" << endl; @@ -267,7 +267,7 @@ namespace KJSEmbed { /* kdDebug( 80001 ) << "convertToVariant() got a JSProxy" << endl; val = prxy->typeName(); */ - } else { // Last resort map the object to a TQMap<TQString,TQVariant> + } else { // Last resort map the object to a TTQMap<TTQString,TTQVariant> kdDebug( 80001 ) << "convertToVariant() map to struct." << endl; val = convertArrayToMap(exec, v); } @@ -276,7 +276,7 @@ namespace KJSEmbed { } default: { - TQString msg = i18n( "Unsupported KJS::Value, type %1" ).arg( ( int ) v.type() ); + TTQString msg = i18n( "Unsupported KJS::Value, type %1" ).arg( ( int ) v.type() ); throwError(exec, msg); val = msg; break; @@ -286,8 +286,8 @@ namespace KJSEmbed { return val; } - TQStringList dumpCompletion( KJS::ExecState *exec, KJS::Object &obj ) { - TQStringList returnList; + TTQStringList dumpCompletion( KJS::ExecState *exec, KJS::Object &obj ) { + TTQStringList returnList; if ( !obj.isValid() ) { return returnList; } @@ -300,16 +300,16 @@ namespace KJSEmbed { if ( obj.hasProperty( exec, name ) ) { KJS::Value v = obj.get( exec, name ); KJS::Object vobj = v.toObject( exec ); - TQString nm( name.ustring().qstring() ); - TQString vl; + TTQString nm( name.ustring().qstring() ); + TTQString vl; if ( vobj.implementsConstruct() ) { if ( vobj.prototype().toString( exec ).qstring() == "[function]" ) - returnList << TQString( "%1(...)" ).arg( nm ); + returnList << TTQString( "%1(...)" ).arg( nm ); } else if ( vobj.implementsCall() ) { - returnList << TQString( "%1(...)" ).arg( nm ); + returnList << TTQString( "%1(...)" ).arg( nm ); } else { - TQVariant val = convertToVariant( exec, v ); + TTQVariant val = convertToVariant( exec, v ); vl = val.toString(); returnList << nm; } @@ -319,17 +319,17 @@ namespace KJSEmbed { } JSObjectProxy *proxy = JSProxy::toObjectProxy( obj.imp() ); - TQObject *qo = proxy ? proxy->object() : 0; - TQMetaObject *mo = qo ? qo->metaObject() : 0; + TTQObject *qo = proxy ? proxy->object() : 0; + TTQMetaObject *mo = qo ? qo->metaObject() : 0; - // QObject + // TQObject if ( proxy ) { - // QProperties - TQStrList propList( mo->propertyNames( true ) ); - for ( TQStrListIterator iter1( propList ); iter1.current(); ++iter1 ) { + // TQProperties + TTQStrList propList( mo->propertyNames( true ) ); + for ( TTQStrListIterator iter1( propList ); iter1.current(); ++iter1 ) { - TQCString name = iter1.current(); + TTQCString name = iter1.current(); int propid = mo->findProperty( name.data(), true ); if ( propid == -1 ) continue; @@ -338,11 +338,11 @@ namespace KJSEmbed { // Slots KJS::List items; - TQStrList slotList( mo->slotNames( true ) ); + TTQStrList slotList( mo->slotNames( true ) ); - for ( TQStrListIterator iter2( slotList ); iter2.current(); ++iter2 ) { - TQCString name = iter2.current(); - TQString nm( name ); + for ( TTQStrListIterator iter2( slotList ); iter2.current(); ++iter2 ) { + TTQCString name = iter2.current(); + TTQString nm( name ); int slotid = mo->findSlot( name.data(), true ); if ( slotid != -1 ) { @@ -353,12 +353,12 @@ namespace KJSEmbed { return returnList; } - TQString dumpObject( KJS::ExecState *exec, KJS::Object &obj ) { + TTQString dumpObject( KJS::ExecState *exec, KJS::Object &obj ) { if ( !obj.isValid() ) - return TQString( "Invalid object\n" ); + return TTQString( "Invalid object\n" ); - TQStringList properties; - TQStringList methods; + TTQStringList properties; + TTQStringList methods; KJS::ReferenceList l = obj.propList( exec, true ); KJS::ReferenceListIterator propIt = l.begin(); @@ -371,7 +371,7 @@ namespace KJSEmbed { KJS::Value v = obj.get( exec, name ); KJS::Object vobj = v.toObject( exec ); - TQString nm( name.ustring().qstring() ); + TTQString nm( name.ustring().qstring() ); kdDebug( 80001 ) << "Getting: " << name.ustring().qstring() << " " << vobj.prototype().toString( exec ).qstring() << endl; @@ -392,21 +392,21 @@ namespace KJSEmbed { propIt++; } - TQString s; + TTQString s; // JS properties - s += TQString( "<h2>Properties</h2>\n" ); + s += TTQString( "<h2>Properties</h2>\n" ); if ( !properties.isEmpty() ) { s += "<table width=\"90%\">\n"; s += "<tr><th>Type</th><th>Name</th><th>Value</th></tr>\n"; properties.sort(); - for ( TQStringList::Iterator iter = properties.begin(); iter != properties.end(); ++iter ) { + for ( TTQStringList::Iterator iter = properties.begin(); iter != properties.end(); ++iter ) { KJS::Value v = obj.get( exec, KJS::Identifier( KJS::UString( *iter ) ) ); - TQVariant val = convertToVariant( exec, v ); + TTQVariant val = convertToVariant( exec, v ); - s += TQString( "<tr><td align=\"center\">%1</td><td><b>%2</b></td><td align=\"center\">%3</td></tr>\n" ) + s += TTQString( "<tr><td align=\"center\">%1</td><td><b>%2</b></td><td align=\"center\">%3</td></tr>\n" ) .arg( val.typeName() ).arg( *iter ).arg( val.toString() ); } @@ -415,12 +415,12 @@ namespace KJSEmbed { s += "<i>None</i>\n"; // Methods - s += TQString( "<h2>Methods</h2>\n" ); + s += TTQString( "<h2>Methods</h2>\n" ); if ( !methods.isEmpty() ) { s += "<table width=\"90%\">"; methods.sort(); - for ( TQStringList::Iterator iter = methods.begin(); iter != methods.end(); ++iter ) { + for ( TTQStringList::Iterator iter = methods.begin(); iter != methods.end(); ++iter ) { s += "<tr><td><b>"; s += *iter; s += "(...)</b></td></tr>"; @@ -429,26 +429,26 @@ namespace KJSEmbed { } else s += "<i>None</i>\n"; - s += dumpQObject( exec, obj ); + s += dumpTQObject( exec, obj ); return s; } - TQString dumpQObject( KJS::ExecState * /*exec*/, KJS::Object &obj ) { + TTQString dumpTQObject( KJS::ExecState * /*exec*/, KJS::Object &obj ) { if ( !obj.isValid() ) - return TQString( "Invalid object\n" ); + return TTQString( "Invalid object\n" ); - TQString s( "" ); + TTQString s( "" ); JSObjectProxy *proxy = JSProxy::toObjectProxy( obj.imp() ); - TQObject *qo = proxy ? proxy->object() : 0; - TQMetaObject *mo = qo ? qo->metaObject() : 0; + TTQObject *qo = proxy ? proxy->object() : 0; + TTQMetaObject *mo = qo ? qo->metaObject() : 0; - // QObject + // TQObject if ( proxy ) { - // QProperties - s += TQString( "<h2>Qt Properties</h2>\n" ); + // TQProperties + s += TTQString( "<h2>Qt Properties</h2>\n" ); - TQStrList propList( mo->propertyNames( true ) ); + TTQStrList propList( mo->propertyNames( true ) ); if ( !propList.isEmpty() ) { @@ -456,15 +456,15 @@ namespace KJSEmbed { s += "<tr><th>Type</th><th>Name</th><th>Value</th></tr>\n"; propList.sort(); - for ( TQStrListIterator iter( propList ); iter.current(); ++iter ) { + for ( TTQStrListIterator iter( propList ); iter.current(); ++iter ) { - TQCString name = iter.current(); + TTQCString name = iter.current(); int propid = mo->findProperty( name.data(), true ); if ( propid == -1 ) continue; - TQVariant vl = qo->property( name.data() ); - s += TQString( "<tr><td align=\"center\">%1</td><td><b>%2</b></td><td align=\"center\">%3</td></tr>\n" ) + TTQVariant vl = qo->property( name.data() ); + s += TTQString( "<tr><td align=\"center\">%1</td><td><b>%2</b></td><td align=\"center\">%3</td></tr>\n" ) .arg( mo->property( propid, true ) ->type() ).arg( name ).arg( vl.toString() ); } @@ -474,20 +474,20 @@ namespace KJSEmbed { } // Signals - s += TQString( "<h2>Qt Signals</h2>\n" ); + s += TTQString( "<h2>Qt Signals</h2>\n" ); s += "<table width=\"90%\">"; - TQStrList signalList( mo->signalNames( true ) ); + TTQStrList signalList( mo->signalNames( true ) ); signalList.sort(); - for ( TQStrListIterator iter1( signalList ); iter1.current(); ++iter1 ) { + for ( TTQStrListIterator iter1( signalList ); iter1.current(); ++iter1 ) { - TQCString name = iter1.current(); - TQString nm( name ); + TTQCString name = iter1.current(); + TTQString nm( name ); int signalid = mo->findSignal( name.data(), true ); if ( signalid != -1 ) - s += TQString( "<tr><td><b>%1</b></td></tr>\n" ).arg( nm ); + s += TTQString( "<tr><td><b>%1</b></td></tr>\n" ).arg( nm ); } s += "</table>"; @@ -495,33 +495,33 @@ namespace KJSEmbed { s += "<i>None</i>"; // Slots - s += TQString( "<h2>Qt Slots</h2>\n" ); + s += TTQString( "<h2>Qt Slots</h2>\n" ); s += "<table width=\"90%\">"; KJS::List items; - TQStrList slotList( mo->slotNames( true ) ); + TTQStrList slotList( mo->slotNames( true ) ); slotList.sort(); - for ( TQStrListIterator iter2( slotList ); iter2.current(); ++iter2 ) { + for ( TTQStrListIterator iter2( slotList ); iter2.current(); ++iter2 ) { - TQCString name = iter2.current(); - TQString nm( name ); + TTQCString name = iter2.current(); + TTQString nm( name ); int slotid = mo->findSlot( name.data(), true ); if ( slotid != -1 ) { - const QMetaData * md = mo->slot( slotid, true ); - const QUMethod *method = md->method; - if ( method->count && ( method->parameters->inOut == QUParameter::Out ) ) { - TQCString typenm( method->parameters->type->desc() ); + const TQMetaData * md = mo->slot( slotid, true ); + const TQUMethod *method = md->method; + if ( method->count && ( method->parameters->inOut == TQUParameter::Out ) ) { + TTQCString typenm( method->parameters->type->desc() ); if ( typenm == "ptr" ) { - s += TQString( "<tr><td>%1</td><td><b>%2</b></td></tr>\n" ) + s += TTQString( "<tr><td>%1</td><td><b>%2</b></td></tr>\n" ) .arg( ( const char * ) method->parameters->typeExtra ).arg( nm ); } else { - s += TQString( "<tr><td>%1</td><td><b>%2</b></td></tr>\n" ) + s += TTQString( "<tr><td>%1</td><td><b>%2</b></td></tr>\n" ) .arg( typenm.data() ).arg( nm ); } } else - s += TQString( "<tr><td>void</td><td><b>%1</b></td></tr>\n" ).arg( nm ); + s += TTQString( "<tr><td>void</td><td><b>%1</b></td></tr>\n" ).arg( nm ); } } @@ -535,44 +535,44 @@ namespace KJSEmbed { - TQPen extractQPen( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPen() : TQPen(); + TTQPen extractTQPen( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPen() : TTQPen(); } - TQBrush extractQBrush( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toBrush() : TQBrush(); + TTQBrush extractTQBrush( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toBrush() : TTQBrush(); } - TQFont extractQFont( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toFont() : TQFont(); + TTQFont extractTQFont( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toFont() : TTQFont(); } - TQPixmap extractQPixmap( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPixmap() : TQPixmap(); + TTQPixmap extractTQPixmap( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPixmap() : TTQPixmap(); } - TQImage extractQImage( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toImage() : TQImage(); + TTQImage extractTQImage( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toImage() : TTQImage(); } - TQPalette extractQPalette( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPalette() : TQPalette(); + TTQPalette extractTQPalette( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPalette() : TTQPalette(); } - TQString extractQString( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? args[ idx ].toString( exec ).qstring() : TQString::null; + TTQString extractTQString( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? args[ idx ].toString( exec ).qstring() : TTQString::null; } int extractInt( KJS::ExecState *exec, const KJS::List &args, int idx ) { return ( args.size() > idx ) ? args[ idx ].toInteger( exec ) : 0; } - TQColor extractQColor( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toColor() : TQColor(); + TTQColor extractTQColor( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toColor() : TTQColor(); } - TQSize extractQSize( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toSize() : TQSize(); + TTQSize extractTQSize( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toSize() : TTQSize(); } bool extractBool( KJS::ExecState *exec, const KJS::List &args, int idx ) { @@ -587,8 +587,8 @@ namespace KJSEmbed { return ( args.size() > idx ) ? args[ idx ].toUInt32( exec ) : 0; } - TQStringList extractQStringList( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertArrayToStringList( exec, args[ idx ] ) : TQStringList(); + TTQStringList extractTQStringList( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertArrayToStringList( exec, args[ idx ] ) : TTQStringList(); } /** @@ -628,8 +628,8 @@ namespace KJSEmbed { return None; } - TQMap<TQString, TQVariant> convertArrayToMap( KJS::ExecState *exec, const KJS::Value &value ) { - TQMap<TQString, TQVariant> returnMap; + TTQMap<TTQString, TTQVariant> convertArrayToMap( KJS::ExecState *exec, const KJS::Value &value ) { + TTQMap<TTQString, TTQVariant> returnMap; KJS::Object obj = value.toObject(exec); // if( obj.className().qstring() == "Array" ) { KJS::ReferenceList lst = obj.propList(exec,false); @@ -644,8 +644,8 @@ namespace KJSEmbed { return returnMap; } - TQValueList<TQVariant> convertArrayToList( KJS::ExecState *exec, const KJS::Value &value ) { - TQValueList<TQVariant> returnList; + TTQValueList<TTQVariant> convertArrayToList( KJS::ExecState *exec, const KJS::Value &value ) { + TTQValueList<TTQVariant> returnList; KJS::Object obj = value.toObject( exec ); if ( obj.className().qstring() == "Array" ) { int length = obj.get( exec, KJS::Identifier( "length" ) ).toInteger( exec ); @@ -661,8 +661,8 @@ namespace KJSEmbed { return returnList; } - TQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value ) { - TQStringList returnList; + TTQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value ) { + TTQStringList returnList; KJS::Object obj = value.toObject( exec ); if ( obj.className().qstring() == "Array" ) { int length = obj.get( exec, KJS::Identifier( "length" ) ).toInteger( exec ); @@ -679,8 +679,8 @@ namespace KJSEmbed { return returnList; } /* - TQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value ) { - TQStringList returnList; + TTQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value ) { + TTQStringList returnList; KJS::Object obj = value.toObject( exec ); if ( obj.className().qstring() == "Array" ) { @@ -693,9 +693,9 @@ namespace KJSEmbed { return returnList; } */ - TQDateTime convertDateToDateTime( KJS::ExecState *exec, const KJS::Value &value ) { + TTQDateTime convertDateToDateTime( KJS::ExecState *exec, const KJS::Value &value ) { KJS::List args; - TQDateTime returnDateTime; + TTQDateTime returnDateTime; KJS::Object obj = value.toObject( exec ); if ( obj.className().qstring() == "Date" ) { @@ -706,8 +706,8 @@ namespace KJSEmbed { int day = obj.get( exec, KJS::Identifier( "getDate" ) ).toObject( exec ).call( exec, obj, args ).toInteger( exec ); int year = obj.get( exec, KJS::Identifier( "getFullYear" ) ).toObject( exec ).call( exec, obj, args ).toInteger( exec ); - returnDateTime.setDate( TQDate( year, month + 1, day ) ); - returnDateTime.setTime( TQTime( hours, minutes, seconds ) ); + returnDateTime.setDate( TTQDate( year, month + 1, day ) ); + returnDateTime.setTime( TTQTime( hours, minutes, seconds ) ); } else { kdWarning() << "convertDateToDateTime() received a " << obj.className().qstring() << " instead of a Date" << endl; } @@ -715,32 +715,32 @@ namespace KJSEmbed { return returnDateTime; } - TQDateTime extractQDateTime( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ) : TQDateTime(); + TTQDateTime extractTQDateTime( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ) : TTQDateTime(); } - TQDate extractQDate( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ).date() : TQDate(); + TTQDate extractTQDate( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ).date() : TTQDate(); } - TQTime extractQTime( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ).time() : TQTime(); + TTQTime extractTQTime( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ).time() : TTQTime(); } - TQRect extractQRect( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toRect() : TQRect(); + TTQRect extractTQRect( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toRect() : TTQRect(); } - TQPoint extractQPoint( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPoint() : TQPoint(); + TTQPoint extractTQPoint( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPoint() : TTQPoint(); } - TQStrList extractQStrList( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertArrayToStrList( exec, args[ idx ] ) : TQStrList(); + TTQStrList extractTQStrList( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertArrayToStrList( exec, args[ idx ] ) : TTQStrList(); } - TQStrList convertArrayToStrList( KJS::ExecState *exec, const KJS::Value &value ) { - TQStrList returnList; + TTQStrList convertArrayToStrList( KJS::ExecState *exec, const KJS::Value &value ) { + TTQStrList returnList; KJS::Object obj = value.toObject( exec ); if ( obj.className().qstring() == "Array" ) { @@ -753,7 +753,7 @@ namespace KJSEmbed { return returnList; } - TQObject *extractQObject( KJS::ExecState *exec, const KJS::List &args, int idx ) { + TTQObject *extractTQObject( KJS::ExecState *exec, const KJS::List &args, int idx ) { KJS::Object obj = args[ idx ].toObject( exec ); JSObjectProxy *proxy = JSProxy::toObjectProxy( obj.imp() ); if ( !proxy ) @@ -762,7 +762,7 @@ namespace KJSEmbed { } - TQWidget *extractQWidget( KJS::ExecState *exec, const KJS::List &args, int idx ) { + TTQWidget *extractTQWidget( KJS::ExecState *exec, const KJS::List &args, int idx ) { KJS::Object obj = args[ idx ].toObject( exec ); JSObjectProxy *proxy = JSProxy::toObjectProxy( obj.imp() ); if ( !proxy ) @@ -775,7 +775,7 @@ namespace KJSEmbed { return JSProxy::toOpaqueProxy( obj.imp() ); } - KJS::Object throwError( KJS::ExecState *exec, const TQString &error, KJS::ErrorType type ) + KJS::Object throwError( KJS::ExecState *exec, const TTQString &error, KJS::ErrorType type ) { int sourceId = exec->context().sourceId(); int startLine = exec->context().curStmtFirstLine(); |