diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 16:20:48 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 16:20:48 -0600 |
commit | e63beeb5bdb82987b1e00bc35178667786fbad48 (patch) | |
tree | ab77b6ac830b7944d5d1eb9ce8f81feb8fdab948 /kjsembed/jsbinding.cpp | |
parent | 67557a2b56c0678c22ab1b00c4fd0224c5e9ed99 (diff) | |
download | tdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.tar.gz tdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.zip |
Fix incorrect conversion
Diffstat (limited to 'kjsembed/jsbinding.cpp')
-rw-r--r-- | kjsembed/jsbinding.cpp | 286 |
1 files changed, 143 insertions, 143 deletions
diff --git a/kjsembed/jsbinding.cpp b/kjsembed/jsbinding.cpp index 5d8e4a14..cb6316d7 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, TTQValueList<TTQVariant> + // Rect, Size, Point, Pixmap, Image, Brush, Pen, Size, Rect, Point, TQValueList<TQVariant> // // Opqaue // ====== @@ -51,7 +51,7 @@ namespace KJSEmbed { // ByteArray, BitArray // - KJS::Value convertToValue( KJS::ExecState *exec, const TTQVariant &val ) { + KJS::Value convertToValue( KJS::ExecState *exec, const TQVariant &val ) { if ( !val.isValid() ) return KJS::Undefined(); @@ -61,23 +61,23 @@ namespace KJSEmbed { switch( type ) { - case TTQVariant::String: - case TTQVariant::CString: + case TQVariant::String: + case TQVariant::CString: return KJS::String( val.toString() ); break; - case TTQVariant::Int: + case TQVariant::Int: return KJS::Number( val.toInt() ); break; - case TTQVariant::UInt: + case TQVariant::UInt: return KJS::Number( val.toUInt() ); break; - case TTQVariant::Double: + case TQVariant::Double: return KJS::Number( val.toDouble() ); break; - case TTQVariant::Bool: + case TQVariant::Bool: return KJS::Boolean( val.toBool() ); break; - case TTQVariant::Rect: + case TQVariant::Rect: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -86,14 +86,14 @@ namespace KJSEmbed { return proxyObj; break; } - case TTQVariant::Date: - case TTQVariant::DateTime: - case TTQVariant::Time: + case TQVariant::Date: + case TQVariant::DateTime: + case TQVariant::Time: { - TTQDateTime dt = TTQDateTime::currentDateTime(); - if ( type == TTQVariant::Date ) + TQDateTime dt = TQDateTime::currentDateTime(); + if ( type == TQVariant::Date ) dt.setDate( val.toDate() ); - else if ( type == TTQVariant::Time ) + else if ( type == TQVariant::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 TTQVariant::Point: + case TQVariant::Point: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -116,37 +116,37 @@ namespace KJSEmbed { return proxyObj; break; } - case TTQVariant::StringList: + case TQVariant::StringList: { - TTQStringList lst = val.toStringList(); - TTQStringList::Iterator idx = lst.begin(); + TQStringList lst = val.toStringList(); + TQStringList::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 TTQVariant::List: -// case TTQVariant::StringList: + case TQVariant::List: +// case TQVariant::StringList: // This will cause an extra conversion step for a TQStrinList so use the above case. { - TTQValueList<TTQVariant> lst = val.toList(); - TTQValueList<TTQVariant>::Iterator idx = lst.begin(); + TQValueList<TQVariant> lst = val.toList(); + TQValueList<TQVariant>::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 TTQVariant::Map: + case TQVariant::Map: { - TTQMap<TTQString,TTQVariant> map = val.toMap(); - TTQMap<TTQString,TTQVariant>::Iterator idx = map.begin(); + TQMap<TQString,TQVariant> map = val.toMap(); + TQMap<TQString,TQVariant>::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 TTQVariant::Pixmap: + case TQVariant::Pixmap: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -155,7 +155,7 @@ namespace KJSEmbed { return proxyObj; break; } - case TTQVariant::Brush: + case TQVariant::Brush: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -163,7 +163,7 @@ namespace KJSEmbed { Bindings::BrushImp::addBindings( exec, proxyObj ); return proxyObj; } - case TTQVariant::Image: + case TQVariant::Image: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -172,7 +172,7 @@ namespace KJSEmbed { return proxyObj; break; } - case TTQVariant::Pen: + case TQVariant::Pen: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -181,7 +181,7 @@ namespace KJSEmbed { return proxyObj; break; } - case TTQVariant::Size: + case TQVariant::Size: { JSValueProxy * prx = new JSValueProxy( ); prx->setValue( val ); @@ -192,7 +192,7 @@ namespace KJSEmbed { } default: { - if ( val.canCast( TTQVariant::String ) ) + if ( val.canCast( TQVariant::String ) ) return KJS::String( val.toString() ); else { @@ -209,8 +209,8 @@ namespace KJSEmbed { } } - TTQVariant convertToVariant( KJS::ExecState *exec, const KJS::Value &v ) { - TTQVariant val; + TQVariant convertToVariant( KJS::ExecState *exec, const KJS::Value &v ) { + TQVariant 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 ) { - TTQObject * o = prx->object(); - TTQCString cs( o ? o->className() : "" ); + TQObject * o = prx->object(); + TQCString cs( o ? o->className() : "" ); if ( obj.implementsConstruct() ) - val = TTQString( "new %1();" ).arg( obj.className().qstring() ); + val = TQString( "new %1();" ).arg( obj.className().qstring() ); else if ( obj.implementsCall() ) - val = TTQString( "%1(...);" ).arg( obj.className().qstring() ); + val = TQString( "%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 TTQMap<TTQString,TTQVariant> + } else { // Last resort map the object to a TQMap<TQString,TQVariant> kdDebug( 80001 ) << "convertToVariant() map to struct." << endl; val = convertArrayToMap(exec, v); } @@ -276,7 +276,7 @@ namespace KJSEmbed { } default: { - TTQString msg = i18n( "Unsupported KJS::Value, type %1" ).arg( ( int ) v.type() ); + TQString 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; } - TTQStringList dumpCompletion( KJS::ExecState *exec, KJS::Object &obj ) { - TTQStringList returnList; + TQStringList dumpCompletion( KJS::ExecState *exec, KJS::Object &obj ) { + TQStringList 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 ); - TTQString nm( name.ustring().qstring() ); - TTQString vl; + TQString nm( name.ustring().qstring() ); + TQString vl; if ( vobj.implementsConstruct() ) { if ( vobj.prototype().toString( exec ).qstring() == "[function]" ) - returnList << TTQString( "%1(...)" ).arg( nm ); + returnList << TQString( "%1(...)" ).arg( nm ); } else if ( vobj.implementsCall() ) { - returnList << TTQString( "%1(...)" ).arg( nm ); + returnList << TQString( "%1(...)" ).arg( nm ); } else { - TTQVariant val = convertToVariant( exec, v ); + TQVariant val = convertToVariant( exec, v ); vl = val.toString(); returnList << nm; } @@ -319,17 +319,17 @@ namespace KJSEmbed { } JSObjectProxy *proxy = JSProxy::toObjectProxy( obj.imp() ); - TTQObject *qo = proxy ? proxy->object() : 0; - TTQMetaObject *mo = qo ? qo->metaObject() : 0; + TQObject *qo = proxy ? proxy->object() : 0; + TQMetaObject *mo = qo ? qo->metaObject() : 0; // TQObject if ( proxy ) { // TQProperties - TTQStrList propList( mo->propertyNames( true ) ); - for ( TTQStrListIterator iter1( propList ); iter1.current(); ++iter1 ) { + TQStrList propList( mo->propertyNames( true ) ); + for ( TQStrListIterator iter1( propList ); iter1.current(); ++iter1 ) { - TTQCString name = iter1.current(); + TQCString name = iter1.current(); int propid = mo->findProperty( name.data(), true ); if ( propid == -1 ) continue; @@ -338,11 +338,11 @@ namespace KJSEmbed { // Slots KJS::List items; - TTQStrList slotList( mo->slotNames( true ) ); + TQStrList slotList( mo->slotNames( true ) ); - for ( TTQStrListIterator iter2( slotList ); iter2.current(); ++iter2 ) { - TTQCString name = iter2.current(); - TTQString nm( name ); + for ( TQStrListIterator iter2( slotList ); iter2.current(); ++iter2 ) { + TQCString name = iter2.current(); + TQString nm( name ); int slotid = mo->findSlot( name.data(), true ); if ( slotid != -1 ) { @@ -353,12 +353,12 @@ namespace KJSEmbed { return returnList; } - TTQString dumpObject( KJS::ExecState *exec, KJS::Object &obj ) { + TQString dumpObject( KJS::ExecState *exec, KJS::Object &obj ) { if ( !obj.isValid() ) - return TTQString( "Invalid object\n" ); + return TQString( "Invalid object\n" ); - TTQStringList properties; - TTQStringList methods; + TQStringList properties; + TQStringList 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 ); - TTQString nm( name.ustring().qstring() ); + TQString nm( name.ustring().qstring() ); kdDebug( 80001 ) << "Getting: " << name.ustring().qstring() << " " << vobj.prototype().toString( exec ).qstring() << endl; @@ -392,21 +392,21 @@ namespace KJSEmbed { propIt++; } - TTQString s; + TQString s; // JS properties - s += TTQString( "<h2>Properties</h2>\n" ); + s += TQString( "<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 ( TTQStringList::Iterator iter = properties.begin(); iter != properties.end(); ++iter ) { + for ( TQStringList::Iterator iter = properties.begin(); iter != properties.end(); ++iter ) { KJS::Value v = obj.get( exec, KJS::Identifier( KJS::UString( *iter ) ) ); - TTQVariant val = convertToVariant( exec, v ); + TQVariant val = convertToVariant( exec, v ); - s += TTQString( "<tr><td align=\"center\">%1</td><td><b>%2</b></td><td align=\"center\">%3</td></tr>\n" ) + s += TQString( "<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 += TTQString( "<h2>Methods</h2>\n" ); + s += TQString( "<h2>Methods</h2>\n" ); if ( !methods.isEmpty() ) { s += "<table width=\"90%\">"; methods.sort(); - for ( TTQStringList::Iterator iter = methods.begin(); iter != methods.end(); ++iter ) { + for ( TQStringList::Iterator iter = methods.begin(); iter != methods.end(); ++iter ) { s += "<tr><td><b>"; s += *iter; s += "(...)</b></td></tr>"; @@ -433,22 +433,22 @@ namespace KJSEmbed { return s; } - TTQString dumpTQObject( KJS::ExecState * /*exec*/, KJS::Object &obj ) { + TQString dumpTQObject( KJS::ExecState * /*exec*/, KJS::Object &obj ) { if ( !obj.isValid() ) - return TTQString( "Invalid object\n" ); + return TQString( "Invalid object\n" ); - TTQString s( "" ); + TQString s( "" ); JSObjectProxy *proxy = JSProxy::toObjectProxy( obj.imp() ); - TTQObject *qo = proxy ? proxy->object() : 0; - TTQMetaObject *mo = qo ? qo->metaObject() : 0; + TQObject *qo = proxy ? proxy->object() : 0; + TQMetaObject *mo = qo ? qo->metaObject() : 0; // TQObject if ( proxy ) { // TQProperties - s += TTQString( "<h2>Qt Properties</h2>\n" ); + s += TQString( "<h2>Qt Properties</h2>\n" ); - TTQStrList propList( mo->propertyNames( true ) ); + TQStrList 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 ( TTQStrListIterator iter( propList ); iter.current(); ++iter ) { + for ( TQStrListIterator iter( propList ); iter.current(); ++iter ) { - TTQCString name = iter.current(); + TQCString name = iter.current(); int propid = mo->findProperty( name.data(), true ); if ( propid == -1 ) continue; - 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" ) + 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" ) .arg( mo->property( propid, true ) ->type() ).arg( name ).arg( vl.toString() ); } @@ -474,20 +474,20 @@ namespace KJSEmbed { } // Signals - s += TTQString( "<h2>Qt Signals</h2>\n" ); + s += TQString( "<h2>Qt Signals</h2>\n" ); s += "<table width=\"90%\">"; - TTQStrList signalList( mo->signalNames( true ) ); + TQStrList signalList( mo->signalNames( true ) ); signalList.sort(); - for ( TTQStrListIterator iter1( signalList ); iter1.current(); ++iter1 ) { + for ( TQStrListIterator iter1( signalList ); iter1.current(); ++iter1 ) { - TTQCString name = iter1.current(); - TTQString nm( name ); + TQCString name = iter1.current(); + TQString nm( name ); int signalid = mo->findSignal( name.data(), true ); if ( signalid != -1 ) - s += TTQString( "<tr><td><b>%1</b></td></tr>\n" ).arg( nm ); + s += TQString( "<tr><td><b>%1</b></td></tr>\n" ).arg( nm ); } s += "</table>"; @@ -495,33 +495,33 @@ namespace KJSEmbed { s += "<i>None</i>"; // Slots - s += TTQString( "<h2>Qt Slots</h2>\n" ); + s += TQString( "<h2>Qt Slots</h2>\n" ); s += "<table width=\"90%\">"; KJS::List items; - TTQStrList slotList( mo->slotNames( true ) ); + TQStrList slotList( mo->slotNames( true ) ); slotList.sort(); - for ( TTQStrListIterator iter2( slotList ); iter2.current(); ++iter2 ) { + for ( TQStrListIterator iter2( slotList ); iter2.current(); ++iter2 ) { - TTQCString name = iter2.current(); - TTQString nm( name ); + TQCString name = iter2.current(); + TQString nm( name ); int slotid = mo->findSlot( name.data(), true ); if ( slotid != -1 ) { 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() ); + TQCString typenm( method->parameters->type->desc() ); if ( typenm == "ptr" ) { - s += TTQString( "<tr><td>%1</td><td><b>%2</b></td></tr>\n" ) + s += TQString( "<tr><td>%1</td><td><b>%2</b></td></tr>\n" ) .arg( ( const char * ) method->parameters->typeExtra ).arg( nm ); } else { - s += TTQString( "<tr><td>%1</td><td><b>%2</b></td></tr>\n" ) + s += TQString( "<tr><td>%1</td><td><b>%2</b></td></tr>\n" ) .arg( typenm.data() ).arg( nm ); } } else - s += TTQString( "<tr><td>void</td><td><b>%1</b></td></tr>\n" ).arg( nm ); + s += TQString( "<tr><td>void</td><td><b>%1</b></td></tr>\n" ).arg( nm ); } } @@ -535,44 +535,44 @@ namespace KJSEmbed { - TTQPen extractTQPen( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPen() : TTQPen(); + TQPen extractTQPen( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPen() : TQPen(); } - TTQBrush extractTQBrush( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toBrush() : TTQBrush(); + TQBrush extractTQBrush( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toBrush() : TQBrush(); } - TTQFont extractTQFont( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toFont() : TTQFont(); + TQFont extractTQFont( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toFont() : TQFont(); } - TTQPixmap extractTQPixmap( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPixmap() : TTQPixmap(); + TQPixmap extractTQPixmap( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPixmap() : TQPixmap(); } - TTQImage extractTQImage( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toImage() : TTQImage(); + TQImage extractTQImage( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toImage() : TQImage(); } - TTQPalette extractTQPalette( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPalette() : TTQPalette(); + TQPalette extractTQPalette( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPalette() : TQPalette(); } - TTQString extractTQString( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? args[ idx ].toString( exec ).qstring() : TTQString::null; + TQString extractTQString( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? args[ idx ].toString( exec ).qstring() : TQString::null; } int extractInt( KJS::ExecState *exec, const KJS::List &args, int idx ) { return ( args.size() > idx ) ? args[ idx ].toInteger( exec ) : 0; } - TTQColor extractTQColor( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toColor() : TTQColor(); + TQColor extractTQColor( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toColor() : TQColor(); } - TTQSize extractTQSize( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toSize() : TTQSize(); + TQSize extractTQSize( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toSize() : TQSize(); } 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; } - TTQStringList extractTQStringList( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertArrayToStringList( exec, args[ idx ] ) : TTQStringList(); + TQStringList extractTQStringList( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertArrayToStringList( exec, args[ idx ] ) : TQStringList(); } /** @@ -628,8 +628,8 @@ namespace KJSEmbed { return None; } - TTQMap<TTQString, TTQVariant> convertArrayToMap( KJS::ExecState *exec, const KJS::Value &value ) { - TTQMap<TTQString, TTQVariant> returnMap; + TQMap<TQString, TQVariant> convertArrayToMap( KJS::ExecState *exec, const KJS::Value &value ) { + TQMap<TQString, TQVariant> 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; } - TTQValueList<TTQVariant> convertArrayToList( KJS::ExecState *exec, const KJS::Value &value ) { - TTQValueList<TTQVariant> returnList; + TQValueList<TQVariant> convertArrayToList( KJS::ExecState *exec, const KJS::Value &value ) { + TQValueList<TQVariant> 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; } - TTQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value ) { - TTQStringList returnList; + TQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value ) { + TQStringList 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; } /* - TTQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value ) { - TTQStringList returnList; + TQStringList convertArrayToStringList( KJS::ExecState *exec, const KJS::Value &value ) { + TQStringList returnList; KJS::Object obj = value.toObject( exec ); if ( obj.className().qstring() == "Array" ) { @@ -693,9 +693,9 @@ namespace KJSEmbed { return returnList; } */ - TTQDateTime convertDateToDateTime( KJS::ExecState *exec, const KJS::Value &value ) { + TQDateTime convertDateToDateTime( KJS::ExecState *exec, const KJS::Value &value ) { KJS::List args; - TTQDateTime returnDateTime; + TQDateTime 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( TTQDate( year, month + 1, day ) ); - returnDateTime.setTime( TTQTime( hours, minutes, seconds ) ); + returnDateTime.setDate( TQDate( year, month + 1, day ) ); + returnDateTime.setTime( TQTime( hours, minutes, seconds ) ); } else { kdWarning() << "convertDateToDateTime() received a " << obj.className().qstring() << " instead of a Date" << endl; } @@ -715,32 +715,32 @@ namespace KJSEmbed { return returnDateTime; } - TTQDateTime extractTQDateTime( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ) : TTQDateTime(); + TQDateTime extractTQDateTime( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ) : TQDateTime(); } - TTQDate extractTQDate( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ).date() : TTQDate(); + TQDate extractTQDate( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ).date() : TQDate(); } - TTQTime extractTQTime( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ).time() : TTQTime(); + TQTime extractTQTime( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertDateToDateTime( exec, args[ idx ] ).time() : TQTime(); } - TTQRect extractTQRect( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toRect() : TTQRect(); + TQRect extractTQRect( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toRect() : TQRect(); } - TTQPoint extractTQPoint( KJS::ExecState * exec, const KJS::List & args, int idx ) { - return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPoint() : TTQPoint(); + TQPoint extractTQPoint( KJS::ExecState * exec, const KJS::List & args, int idx ) { + return ( args.size() > idx ) ? convertToVariant( exec, args[ idx ] ).toPoint() : TQPoint(); } - TTQStrList extractTQStrList( KJS::ExecState *exec, const KJS::List &args, int idx ) { - return ( args.size() > idx ) ? convertArrayToStrList( exec, args[ idx ] ) : TTQStrList(); + TQStrList extractTQStrList( KJS::ExecState *exec, const KJS::List &args, int idx ) { + return ( args.size() > idx ) ? convertArrayToStrList( exec, args[ idx ] ) : TQStrList(); } - TTQStrList convertArrayToStrList( KJS::ExecState *exec, const KJS::Value &value ) { - TTQStrList returnList; + TQStrList convertArrayToStrList( KJS::ExecState *exec, const KJS::Value &value ) { + TQStrList returnList; KJS::Object obj = value.toObject( exec ); if ( obj.className().qstring() == "Array" ) { @@ -753,7 +753,7 @@ namespace KJSEmbed { return returnList; } - TTQObject *extractTQObject( KJS::ExecState *exec, const KJS::List &args, int idx ) { + TQObject *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 { } - TTQWidget *extractTQWidget( KJS::ExecState *exec, const KJS::List &args, int idx ) { + TQWidget *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 TTQString &error, KJS::ErrorType type ) + KJS::Object throwError( KJS::ExecState *exec, const TQString &error, KJS::ErrorType type ) { int sourceId = exec->context().sourceId(); int startLine = exec->context().curStmtFirstLine(); |