diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:44:01 +0000 |
commit | 479f5f799523bffbcc83dff581a2299c047c6fff (patch) | |
tree | 186aae707ed02aac6c7cab2fb14e97f72aca5e36 /kjsembed/jsobjectproxy_imp.cpp | |
parent | f1dbff6145c98324ff82e34448b7483727e8ace4 (diff) | |
download | tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.tar.gz tdebindings-479f5f799523bffbcc83dff581a2299c047c6fff.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kjsembed/jsobjectproxy_imp.cpp')
-rw-r--r-- | kjsembed/jsobjectproxy_imp.cpp | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/kjsembed/jsobjectproxy_imp.cpp b/kjsembed/jsobjectproxy_imp.cpp index a17190b5..dc94aa73 100644 --- a/kjsembed/jsobjectproxy_imp.cpp +++ b/kjsembed/jsobjectproxy_imp.cpp @@ -17,18 +17,18 @@ * Boston, MA 02110-1301, USA. */ -#include <qobject.h> -#include <qobjectlist.h> -#include <qdialog.h> -#include <qlistbox.h> -#include <qlistview.h> -#include <qmetaobject.h> -#include <qregexp.h> -#include <qsignal.h> -#include <qstrlist.h> -#include <qtabwidget.h> -#include <qtimer.h> -#include <qvariant.h> +#include <tqobject.h> +#include <tqobjectlist.h> +#include <tqdialog.h> +#include <tqlistbox.h> +#include <tqlistview.h> +#include <tqmetaobject.h> +#include <tqregexp.h> +#include <tqsignal.h> +#include <tqstrlist.h> +#include <tqtabwidget.h> +#include <tqtimer.h> +#include <tqvariant.h> #include <private/qucom_p.h> #include <private/qucomextra_p.h> @@ -129,19 +129,19 @@ JSObjectProxyImp::JSObjectProxyImp( KJS::ExecState *exec, int mid, JSObjectProxy } JSObjectProxyImp::JSObjectProxyImp( KJS::ExecState *exec, - int mid, const QCString &name, JSObjectProxy *parent ) + int mid, const TQCString &name, JSObjectProxy *parent ) : JSProxyImp(exec), id(mid), slotname(name), proxy(parent), obj(parent->obj) { } JSObjectProxyImp::JSObjectProxyImp( KJS::ExecState *exec, - int mid, int sid, const QCString &name, JSObjectProxy *parent ) + int mid, int sid, const TQCString &name, JSObjectProxy *parent ) : JSProxyImp(exec), id(mid), sigid(sid), slotname(name), proxy(parent), obj(parent->obj) { } JSObjectProxyImp::JSObjectProxyImp( KJS::ExecState *exec, - int mid, const char *ret, int sid, const QCString &name, + int mid, const char *ret, int sid, const TQCString &name, JSObjectProxy *parent ) : JSProxyImp(exec), id(mid), rettype(ret), sigid(sid), slotname(name), proxy(parent), obj(parent->obj) { @@ -154,14 +154,14 @@ JSObjectProxyImp::JSObjectProxyImp( KJS::ExecState *exec, KJS::Value JSObjectProxyImp::children( KJS::ExecState *exec, KJS::Object &, const KJS::List & ) { KJS::List items; - const QObjectList *kids = obj->children(); + const TQObjectList *kids = obj->children(); if ( kids ) { - QObjectList l( *kids ); + TQObjectList l( *kids ); for ( uint i = 0 ; i < l.count() ; i++ ) { - QObject *child = l.at( i ); - QCString nm = ( child ? child->name() : "<null>" ); - items.append( KJS::String( QString(nm) ) ); + TQObject *child = l.at( i ); + TQCString nm = ( child ? child->name() : "<null>" ); + items.append( KJS::String( TQString(nm) ) ); } } @@ -171,15 +171,15 @@ KJS::Value JSObjectProxyImp::children( KJS::ExecState *exec, KJS::Object &, cons KJS::Value JSObjectProxyImp::properties( KJS::ExecState *exec, KJS::Object &, const KJS::List & ) { KJS::List items; - QMetaObject *mo = obj->metaObject(); - QStrList propList( mo->propertyNames( true ) ); + TQMetaObject *mo = obj->metaObject(); + TQStrList propList( mo->propertyNames( true ) ); - for ( QStrListIterator iter(propList); iter.current(); ++iter ) { + for ( TQStrListIterator iter(propList); iter.current(); ++iter ) { - QCString name = iter.current(); + TQCString name = iter.current(); int propid = mo->findProperty( name.data(), true ); if ( propid != -1 ) { - items.append( KJS::String( QString(name) ) ); + items.append( KJS::String( TQString(name) ) ); } } @@ -215,7 +215,7 @@ KJS::Value JSObjectProxyImp::call( KJS::ExecState *exec, KJS::Object &self, cons switch( id ) { case MethodParent: { - QObject *po = obj->parent(); + TQObject *po = obj->parent(); if ( po && proxy->securityPolicy()->isObjectAllowed( proxy, po ) ) return proxy->part()->factory()->createProxy( exec, po, proxy ); @@ -224,7 +224,7 @@ KJS::Value JSObjectProxyImp::call( KJS::ExecState *exec, KJS::Object &self, cons break; case MethodChildCount: { - const QObjectList *kids = obj->children(); + const TQObjectList *kids = obj->children(); return kids ? KJS::Number( kids->count() ) : KJS::Number(0); } break; @@ -295,13 +295,13 @@ KJS::Value JSObjectProxyImp::call( KJS::ExecState *exec, KJS::Object &self, cons KJS::Value JSObjectProxyImp::signalz( KJS::ExecState *exec, KJS::Object &, const KJS::List & ) { KJS::List items; - QMetaObject *mo = obj->metaObject(); - QStrList signalList( mo->signalNames( true ) ); + TQMetaObject *mo = obj->metaObject(); + TQStrList signalList( mo->signalNames( true ) ); - for ( QStrListIterator iter(signalList); iter.current(); ++iter ) { + for ( TQStrListIterator iter(signalList); iter.current(); ++iter ) { - QCString name = iter.current(); - QString nm( name ); + TQCString name = iter.current(); + TQString nm( name ); int signalid = mo->findSignal( name.data(), true ); if ( (signalid != -1) && (mo->signal( signalid, true )->access == QMetaData::Public) ) @@ -314,13 +314,13 @@ KJS::Value JSObjectProxyImp::signalz( KJS::ExecState *exec, KJS::Object &, const KJS::Value JSObjectProxyImp::slotz( KJS::ExecState *exec, KJS::Object &, const KJS::List & ) { KJS::List items; - QMetaObject *mo = obj->metaObject(); - QStrList slotList( mo->slotNames( true ) ); + TQMetaObject *mo = obj->metaObject(); + TQStrList slotList( mo->slotNames( true ) ); - for ( QStrListIterator iter(slotList); iter.current(); ++iter ) { + for ( TQStrListIterator iter(slotList); iter.current(); ++iter ) { - QCString name = iter.current(); - QString nm( name ); + TQCString name = iter.current(); + TQString nm( name ); int slotid = mo->findSlot( name.data(), true ); if ( (slotid != -1) && (mo->slot( slotid, true )->access == QMetaData::Public) ) @@ -341,12 +341,12 @@ KJS::Boolean JSObjectProxyImp::connect( KJS::ExecState *exec, // Source object and signal JSObjectProxy *sendproxy = JSProxy::toObjectProxy( args[0].imp() ); - QObject *sender = sendproxy ? sendproxy->object() : 0; - QString sig = args[1].toString(exec).qstring(); + TQObject *sender = sendproxy ? sendproxy->object() : 0; + TQString sig = args[1].toString(exec).qstring(); kdDebug( 80001 ) << "connecting C++ signal" << sig << endl; // Receiver and slot/signal KJS::Object recvObj; - QString dest; + TQString dest; if ( args.size() == 3 ) { recvObj = self.toObject(exec); dest = args[2].toString(exec).qstring(); @@ -359,7 +359,7 @@ KJS::Boolean JSObjectProxyImp::connect( KJS::ExecState *exec, // Try to connect to C++ slot JSObjectProxy *recvproxy = JSProxy::toObjectProxy( recvObj.imp() ); if ( recvproxy ) { - QObject *recv = recvproxy ? recvproxy->object() : 0; + TQObject *recv = recvproxy ? recvproxy->object() : 0; bool ok = JSSlotUtils::connect( sender, sig.ascii(), recv, dest.ascii() ); if ( ok ) return KJS::Boolean(true); @@ -368,8 +368,8 @@ KJS::Boolean JSObjectProxyImp::connect( KJS::ExecState *exec, return connect( sender, sig.ascii(), recvObj, dest ); } -KJS::Boolean JSObjectProxyImp::connect( QObject *sender, const char *sig, - const KJS::Object &recv, const QString &dest ) +KJS::Boolean JSObjectProxyImp::connect( TQObject *sender, const char *sig, + const KJS::Object &recv, const TQString &dest ) { kdDebug(80001) << "Trying signature '" << sig << "'." << endl; // Try to connect to JS method @@ -409,28 +409,28 @@ KJS::Boolean JSObjectProxyImp::connect( QObject *sender, const char *sig, ok = JSSlotUtils::connect( sender, sig, slotp, "slot_double(double)" ); break; case JSSlotUtils::SignatureString: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_string(const QString&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_string(const TQString&)" ); break; case JSSlotUtils::SignatureCString: ok = JSSlotUtils::connect( sender, sig, slotp, "slot_charstar(const char*)" ); break; case JSSlotUtils::SignatureColor: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_color(const QColor&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_color(const TQColor&)" ); break; case JSSlotUtils::SignatureFont: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_font(const QFont&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_font(const TQFont&)" ); break; case JSSlotUtils::SignaturePoint: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_point(const QPoint&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_point(const TQPoint&)" ); break; case JSSlotUtils::SignatureRect: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_rect(const QRect&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_rect(const TQRect&)" ); break; case JSSlotUtils::SignatureSize: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_size(const QSize&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_size(const TQSize&)" ); break; case JSSlotUtils::SignaturePixmap: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_pixmap(const QPixmap&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_pixmap(const TQPixmap&)" ); break; case JSSlotUtils::SignatureURL: ok = JSSlotUtils::connect( sender, sig, slotp, "slot_url(const KURL&)" ); @@ -446,29 +446,29 @@ KJS::Boolean JSObjectProxyImp::connect( QObject *sender, const char *sig, break; case JSSlotUtils::SignatureDate: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_date(const QDate&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_date(const TQDate&)" ); break; case JSSlotUtils::SignatureTime: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_time(const QTime&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_time(const TQTime&)" ); break; case JSSlotUtils::SignatureDateTime: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_datetime(const QDateTime&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_datetime(const TQDateTime&)" ); break; case JSSlotUtils::SignatureImage: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_image(const QImage&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_image(const TQImage&)" ); break; case JSSlotUtils::SignatureQWidget: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_widget(QWidget*)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_widget(TQWidget*)" ); break; case JSSlotUtils::SignatureDateDate: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_datedate(const QDate&, const QDate& )" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_datedate(const TQDate&, const TQDate& )" ); break; case JSSlotUtils::SignatureColorString: - ok = JSSlotUtils::connect( sender, sig, slotp, "slot_colorstring(const QColor&, const QString&)" ); + ok = JSSlotUtils::connect( sender, sig, slotp, "slot_colorstring(const TQColor&, const TQString&)" ); break; case JSSlotUtils::SignatureCustom: { - QString mangledSig = sig; + TQString mangledSig = sig; mangledSig.remove(' ') .remove("const") .remove('&') @@ -501,12 +501,12 @@ KJS::Boolean JSObjectProxyImp::disconnect( KJS::ExecState *exec, KJS::Object &se // Source object and signal JSObjectProxy *sendproxy = JSProxy::toObjectProxy( args[0].imp() ); - QObject *sender = sendproxy ? sendproxy->object() : 0; - QString sig = args[1].toString(exec).qstring(); + TQObject *sender = sendproxy ? sendproxy->object() : 0; + TQString sig = args[1].toString(exec).qstring(); // Receiver and slot/signal - QObject *recv=0; - QString dest; + TQObject *recv=0; + TQString dest; if ( args.size() == 3 ) { JSObjectProxy *recvproxy = JSProxy::toObjectProxy( self.imp() ); recv = recvproxy ? recvproxy->object() : 0; @@ -530,7 +530,7 @@ KJS::Value JSObjectProxyImp::getParentNode( KJS::ExecState *exec, KJS::Object &, if ( args.size()) return KJS::Null(); - QObject *parent = obj->parent(); + TQObject *parent = obj->parent(); if ( parent && proxy->securityPolicy()->isObjectAllowed( proxy, parent ) ) return proxy->part()->factory()->createProxy( exec, parent, proxy ); @@ -542,12 +542,12 @@ KJS::Value JSObjectProxyImp::getElementById( KJS::ExecState *exec, KJS::Object & if ( !args.size() ) return KJS::Null(); - const QObjectList *kids = obj->children(); + const TQObjectList *kids = obj->children(); if ( !kids ) return KJS::Null(); - QObjectList l( *kids ); - QObject *child = 0; + TQObjectList l( *kids ); + TQObject *child = 0; if ( args[0].isA( KJS::NumberType ) ) { uint i = args[0].toUInt32( exec ); @@ -558,7 +558,7 @@ KJS::Value JSObjectProxyImp::getElementById( KJS::ExecState *exec, KJS::Object & child = l.at( i ); } else { - QString s = args[0].toString( exec ).qstring(); + TQString s = args[0].toString( exec ).qstring(); child = obj->child( s.ascii() ); } @@ -580,8 +580,8 @@ KJS::Value JSObjectProxyImp::hasAttribute( KJS::ExecState *exec, KJS::Object &, if ( !args.size() ) return KJS::Null(); - QMetaObject *meta = obj->metaObject(); - QString s = args[0].toString(exec).qstring(); + TQMetaObject *meta = obj->metaObject(); + TQString s = args[0].toString(exec).qstring(); if ( meta->findProperty( s.ascii(), true ) != -1 ) return KJS::Boolean(true); else @@ -592,20 +592,20 @@ KJS::Value JSObjectProxyImp::getAttribute( KJS::ExecState *exec, KJS::Object &, { if ( !args.size() ) { - QString msg = i18n( "No property was defined." ); + TQString msg = i18n( "No property was defined." ); return throwError(exec, msg); } - QMetaObject *meta = obj->metaObject(); - QString s = args[0].toString(exec).qstring(); + TQMetaObject *meta = obj->metaObject(); + TQString s = args[0].toString(exec).qstring(); kdDebug(80001) << "Get property " << s << " from " << obj->name() << endl; if ( meta->findProperty( s.ascii(), true ) == -1 ) { - QString msg = i18n( "Property '%1' could not be found." ).arg( s ); + TQString msg = i18n( "Property '%1' could not be found." ).arg( s ); return throwError(exec, msg,KJS::ReferenceError); } - QVariant val = obj->property( s.ascii() ); + TQVariant val = obj->property( s.ascii() ); return convertToValue( exec, val ); } @@ -614,16 +614,16 @@ KJS::Value JSObjectProxyImp::setAttribute( KJS::ExecState *exec, KJS::Object &, if ( args.size() != 2 ) return KJS::Boolean(false); - QMetaObject *meta = obj->metaObject(); - QString s = args[0].toString(exec).qstring(); + TQMetaObject *meta = obj->metaObject(); + TQString s = args[0].toString(exec).qstring(); if ( meta->findProperty( s.ascii(), true ) == -1 ) { - QString msg = i18n( "Property '%1' could not be found." ).arg( s ); + TQString msg = i18n( "Property '%1' could not be found." ).arg( s ); return throwError(exec, msg,KJS::GeneralError); } kdDebug(80001) << "Set property " << s << " from " << obj->name() << endl; - QVariant val = convertToVariant( exec, args[1] ); + TQVariant val = convertToVariant( exec, args[1] ); bool ok = obj->setProperty( s.ascii(), val ); return KJS::Boolean(ok); |