diff options
Diffstat (limited to 'kjsembed/jsfactory.cpp')
-rw-r--r-- | kjsembed/jsfactory.cpp | 528 |
1 files changed, 264 insertions, 264 deletions
diff --git a/kjsembed/jsfactory.cpp b/kjsembed/jsfactory.cpp index ff298b43..ebb4bf26 100644 --- a/kjsembed/jsfactory.cpp +++ b/kjsembed/jsfactory.cpp @@ -21,25 +21,25 @@ #include <string.h> #include <errno.h> -#include <qobject.h> -#include <qcombobox.h> -#include <qdialog.h> -#include <qdir.h> -#include <qfile.h> -#include <qimage.h> -#include <qlistview.h> -#include <qmainwindow.h> -//#include <qpainter.h> -#include <qprogressdialog.h> -#include <qtextstream.h> -#include <qtimer.h> -#include <qwidget.h> -#include <qwidgetfactory.h> -#include <qsplitter.h> -#include <qscrollview.h> -#include <qcanvas.h> -#include <qlayout.h> -#include <qsplashscreen.h> +#include <tqobject.h> +#include <tqcombobox.h> +#include <tqdialog.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqimage.h> +#include <tqlistview.h> +#include <tqmainwindow.h> +//#include <tqpainter.h> +#include <tqprogressdialog.h> +#include <tqtextstream.h> +#include <tqtimer.h> +#include <tqwidget.h> +#include <tqwidgetfactory.h> +#include <tqsplitter.h> +#include <tqscrollview.h> +#include <tqcanvas.h> +#include <tqlayout.h> +#include <tqsplashscreen.h> #ifndef QT_ONLY @@ -137,9 +137,9 @@ namespace KJSEmbed { class JSFactoryPrivate { public: - QDict<KJSEmbed::Bindings::JSBindingPlugin> plugins; - QDict<KJSEmbed::Bindings::JSBindingBase> opaqueTypes; - QDict<KJSEmbed::Bindings::JSBindingBase> objectTypes; + TQDict<KJSEmbed::Bindings::JSBindingPlugin> plugins; + TQDict<KJSEmbed::Bindings::JSBindingBase> opaqueTypes; + TQDict<KJSEmbed::Bindings::JSBindingBase> objectTypes; }; @@ -147,9 +147,9 @@ namespace KJSEmbed { : jspart( part ) { evmapper = new JSEventMapper(); d = new JSFactoryPrivate; - registerOpaqueType("QDir", new Bindings::QDirLoader()); - registerOpaqueType("QCheckListItem", new Bindings::QCheckListItemLoader()); - registerOpaqueType("QListViewItem", new Bindings::QListViewItemLoader()); + registerOpaqueType("TQDir", new Bindings::QDirLoader()); + registerOpaqueType("TQCheckListItem", new Bindings::QCheckListItemLoader()); + registerOpaqueType("TQListViewItem", new Bindings::QListViewItemLoader()); registerOpaqueType("Painter", new Bindings::PainterLoader()); #ifndef QT_ONLY @@ -174,7 +174,7 @@ namespace KJSEmbed { KTrader::OfferListIterator itr = offers.begin(); while ( itr != offers.end() ) { - QString classname = ( *itr ) ->name(); + TQString classname = ( *itr ) ->name(); JSFactoryImp *cons = new JSFactoryImp( exec, this, JSFactoryImp::NewInstance, classname ); parent.put( exec, KJS::Identifier( cons->parameter() ), KJS::Object( cons ) ); addType( classname, TypePlugin ); @@ -187,19 +187,19 @@ namespace KJSEmbed { } - bool JSFactory::isBindingPlugin( const QString &classname ) const { + bool JSFactory::isBindingPlugin( const TQString &classname ) const { if ( !isSupported( classname ) ) return false; return ( objtypes[ classname ] & TypePlugin ); } - KJS::Object JSFactory::createBindingPlugin( KJS::ExecState *exec, const QString &classname, const KJS::List &args ) { + KJS::Object JSFactory::createBindingPlugin( KJS::ExecState *exec, const TQString &classname, const KJS::List &args ) { #ifndef QT_ONLY Bindings::JSBindingPlugin * plugin = d->plugins[ classname ]; if ( plugin == 0L ) { - QString query = "JSBindingPlugin/Binding"; - QString constraint = "[Name] == '" + classname + "'"; + TQString query = "JSBindingPlugin/Binding"; + TQString constraint = "[Name] == '" + classname + "'"; plugin = KParts::ComponentFactory::createInstanceFromQuery<Bindings::JSBindingPlugin>( query, constraint ); if ( plugin != 0L ) d->plugins.insert( classname, plugin ); @@ -219,10 +219,10 @@ namespace KJSEmbed { return KJS::Object(); } - KJS::Object JSFactory::create( KJS::ExecState *exec, const QString &classname, const KJS::List &args ) { + KJS::Object JSFactory::create( KJS::ExecState *exec, const TQString &classname, const KJS::List &args ) { KJS::Object returnObject; if ( !isSupported( classname ) ) { - QString msg = i18n( "Object of type '%1' is not supported." ).arg( classname ); + TQString msg = i18n( "Object of type '%1' is not supported." ).arg( classname ); return throwError(exec, msg,KJS::TypeError); } if ( isQObject( classname ) ) { @@ -232,15 +232,15 @@ namespace KJSEmbed { returnObject = factory->createBinding( jspart, exec, args ); JSProxy::toProxy( returnObject.imp() ) ->setOwner( JSProxy::JavaScript ); } else { - QObject *parent = extractQObject(exec, args, 0); - QString name = extractQString(exec, args, 1); + TQObject *parent = extractQObject(exec, args, 0); + TQString name = extractQString(exec, args, 1); - QObject *obj = create( classname, parent, name.latin1() ); + TQObject *obj = create( classname, parent, name.latin1() ); if ( obj ) { returnObject = createProxy( exec, obj ); JSProxy::toProxy( returnObject.imp() ) ->setOwner( JSProxy::JavaScript ); } else { - QString msg = i18n( "QObject of type '%1' could not be created." ).arg( classname ); + TQString msg = i18n( "TQObject of type '%1' could not be created." ).arg( classname ); returnObject = throwError(exec, msg,KJS::TypeError); } } @@ -253,30 +253,30 @@ namespace KJSEmbed { returnObject = createOpaque( exec, classname, args ); if ( !returnObject.isValid() ) { - QString msg = i18n( "Opaque object of type '%1' could not be created." ).arg( classname ); + TQString msg = i18n( "Opaque object of type '%1' could not be created." ).arg( classname ); returnObject = throwError(exec, msg,KJS::TypeError); } } else if ( isValue( classname ) ) { returnObject = createValue( exec, classname, args ); if ( !returnObject.isValid() ) { - QString msg = i18n( "Value object of type '%1' could not be created." ).arg( classname ); + TQString msg = i18n( "Value object of type '%1' could not be created." ).arg( classname ); returnObject = throwError(exec, msg,KJS::TypeError); } } else if ( isBindingPlugin( classname ) ) { returnObject = createBindingPlugin( exec, classname, args ); if ( !returnObject.isValid() ) { - QString msg = i18n( "Plugin object of type '%1' could not be created." ).arg( classname ); + TQString msg = i18n( "Plugin object of type '%1' could not be created." ).arg( classname ); returnObject = throwError(exec, msg,KJS::TypeError); } else JSProxy::toProxy( returnObject.imp() ) ->setOwner( JSProxy::JavaScript ); } else { - QString msg = i18n( "Could not create object of type '%1'." ).arg( classname ); + TQString msg = i18n( "Could not create object of type '%1'." ).arg( classname ); returnObject = throwError(exec, msg,KJS::TypeError); } return returnObject; } - KJS::Object JSFactory::createProxy( KJS::ExecState *exec, QObject *target, + KJS::Object JSFactory::createProxy( KJS::ExecState *exec, TQObject *target, const JSObjectProxy *ctx ) const { kdDebug( 80001 ) << "JSFactory::createProxy: Target '" << target->name() << "' type " << target->className() << endl; @@ -301,7 +301,7 @@ namespace KJSEmbed { } KJS::Object JSFactory::createProxy( KJS::ExecState *exec, - QTextStream *target, const JSObjectProxy *context ) const { + TQTextStream *target, const JSObjectProxy *context ) const { Q_UNUSED( context ) kdDebug( 80001 ) << "TextStream proxy created" << endl; @@ -314,74 +314,74 @@ namespace KJSEmbed { } KJS::Object JSFactory::createProxy( KJS::ExecState *exec, - QEvent *target, const JSObjectProxy *context ) const { + TQEvent *target, const JSObjectProxy *context ) const { switch ( target->type() ) { - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - case QEvent::MouseMove: - case QEvent::MouseButtonDblClick: - return JSEventUtils::convertEvent( exec, ( QMouseEvent * ) target, context ); + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + case TQEvent::MouseMove: + case TQEvent::MouseButtonDblClick: + return JSEventUtils::convertEvent( exec, ( TQMouseEvent * ) target, context ); break; - case QEvent::KeyPress: - case QEvent::KeyRelease: - case QEvent::Accel: - case QEvent::AccelOverride: - return JSEventUtils::convertEvent( exec, ( QKeyEvent * ) target, context ); + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::Accel: + case TQEvent::AccelOverride: + return JSEventUtils::convertEvent( exec, ( TQKeyEvent * ) target, context ); break; - case QEvent::IMStart: - case QEvent::IMCompose: - case QEvent::IMEnd: - return JSEventUtils::convertEvent( exec, ( QIMEvent * ) target, context ); + case TQEvent::IMStart: + case TQEvent::IMCompose: + case TQEvent::IMEnd: + return JSEventUtils::convertEvent( exec, ( TQIMEvent * ) target, context ); break; - case QEvent::Paint: - return JSEventUtils::convertEvent( exec, ( QPaintEvent * ) target, context ); + case TQEvent::Paint: + return JSEventUtils::convertEvent( exec, ( TQPaintEvent * ) target, context ); break; - case QEvent::Resize: - return JSEventUtils::convertEvent( exec, ( QResizeEvent * ) target, context ); + case TQEvent::Resize: + return JSEventUtils::convertEvent( exec, ( TQResizeEvent * ) target, context ); break; - case QEvent::FocusIn: - case QEvent::FocusOut: - return JSEventUtils::convertEvent( exec, ( QFocusEvent * ) target, context ); + case TQEvent::FocusIn: + case TQEvent::FocusOut: + return JSEventUtils::convertEvent( exec, ( TQFocusEvent * ) target, context ); break; - case QEvent::Close: - return JSEventUtils::convertEvent( exec, ( QCloseEvent * ) target, context ); + case TQEvent::Close: + return JSEventUtils::convertEvent( exec, ( TQCloseEvent * ) target, context ); break; - case QEvent::ChildInserted: - case QEvent::ChildRemoved: - return JSEventUtils::convertEvent( exec, ( QChildEvent * ) target, context ); + case TQEvent::ChildInserted: + case TQEvent::ChildRemoved: + return JSEventUtils::convertEvent( exec, ( TQChildEvent * ) target, context ); break; - case QEvent::Move: - return JSEventUtils::convertEvent( exec, ( QMoveEvent * ) target, context ); + case TQEvent::Move: + return JSEventUtils::convertEvent( exec, ( TQMoveEvent * ) target, context ); break; - case QEvent::Wheel: - return JSEventUtils::convertEvent( exec, ( QWheelEvent * ) target, context ); + case TQEvent::Wheel: + return JSEventUtils::convertEvent( exec, ( TQWheelEvent * ) target, context ); break; - case QEvent::Timer: - return JSEventUtils::convertEvent( exec, ( QTimerEvent * ) target, context ); + case TQEvent::Timer: + return JSEventUtils::convertEvent( exec, ( TQTimerEvent * ) target, context ); break; - case QEvent::ContextMenu: - return JSEventUtils::convertEvent( exec, ( QContextMenuEvent * ) target, context ); + case TQEvent::ContextMenu: + return JSEventUtils::convertEvent( exec, ( TQContextMenuEvent * ) target, context ); break; - case QEvent::DragMove: - case QEvent::DragEnter: - return JSEventUtils::convertEvent( exec, ( QDragMoveEvent * ) target, context ); + case TQEvent::DragMove: + case TQEvent::DragEnter: + return JSEventUtils::convertEvent( exec, ( TQDragMoveEvent * ) target, context ); break; - case QEvent::Drop: - return JSEventUtils::convertEvent( exec, ( QDropEvent * ) target, context ); + case TQEvent::Drop: + return JSEventUtils::convertEvent( exec, ( TQDropEvent * ) target, context ); break; - case QEvent::Enter: - case QEvent::Leave: - case QEvent::Clipboard: - case QEvent::DragLeave: - case QEvent::Show: - case QEvent::Hide: - return JSEventUtils::convertEvent( exec, ( QEvent * ) target, context ); + case TQEvent::Enter: + case TQEvent::Leave: + case TQEvent::Clipboard: + case TQEvent::DragLeave: + case TQEvent::Show: + case TQEvent::Hide: + return JSEventUtils::convertEvent( exec, ( TQEvent * ) target, context ); break; default: break; } - return JSEventUtils::convertEvent( exec, ( QEvent * ) target, context ); + return JSEventUtils::convertEvent( exec, ( TQEvent * ) target, context ); } KJS::Object JSFactory::extendProxy( KJS::ExecState *exec, KJS::Object &target ) const { @@ -402,8 +402,8 @@ namespace KJSEmbed { Bindings::JSBindingPlugin *plugin = d->plugins[ proxy->object() ->className() ]; if ( plugin == 0L ) { - QString query = "JSBindingPlugin/Binding"; - QString constraint = "[Name] == '" + QString::fromUtf8( proxy->object() ->className() ) + "'"; + TQString query = "JSBindingPlugin/Binding"; + TQString constraint = "[Name] == '" + TQString::fromUtf8( proxy->object() ->className() ) + "'"; plugin = KParts::ComponentFactory::createInstanceFromQuery<Bindings::JSBindingPlugin>( query, constraint ); if ( plugin != 0L ) d->plugins.insert( proxy->object() ->className(), plugin ); @@ -424,7 +424,7 @@ namespace KJSEmbed { } - QObject *JSFactory::createBinding( const QString &cname, QObject *parent, const char *name ) { + TQObject *JSFactory::createBinding( const TQString &cname, TQObject *parent, const char *name ) { #ifndef QT_ONLY // Bindings @@ -446,15 +446,15 @@ namespace KJSEmbed { return 0; } - QObject *JSFactory::createObject( const QString &cname, QObject *parent, const char *name ) { + TQObject *JSFactory::createObject( const TQString &cname, TQObject *parent, const char *name ) { // QObjects defined by Qt - if ( cname == "QObject" ) - return new QObject( parent, name ); - else if ( cname == "QTimer" ) - return new QTimer( parent, name ); - else if ( cname == "QCanvas" ) - return new QCanvas( parent, name ); + if ( cname == "TQObject" ) + return new TQObject( parent, name ); + else if ( cname == "TQTimer" ) + return new TQTimer( parent, name ); + else if ( cname == "TQCanvas" ) + return new TQCanvas( parent, name ); #ifndef QT_ONLY // QObjects defined by KDE @@ -464,20 +464,20 @@ namespace KJSEmbed { return new KToggleAction( parent, name ); #endif // QT_ONLY - QWidget *w = dynamic_cast<QWidget *>( parent ); + TQWidget *w = dynamic_cast<TQWidget *>( parent ); if ( !w ) return 0; - if ( cname == "QHBoxLayout" ) - return new QHBoxLayout( w, 0, -1, name ); - else if ( cname == "QVBoxLayout" ) - return new QVBoxLayout( w, 0, -1, name ); + if ( cname == "TQHBoxLayout" ) + return new TQHBoxLayout( w, 0, -1, name ); + else if ( cname == "TQVBoxLayout" ) + return new TQVBoxLayout( w, 0, -1, name ); return 0; } - KJS::Object JSFactory::createOpaque( KJS::ExecState *exec, const QString &cname, const KJS::List &args ) { + KJS::Object JSFactory::createOpaque( KJS::ExecState *exec, const TQString &cname, const KJS::List &args ) { - if ( cname == "QCanvasText" ) { + if ( cname == "TQCanvasText" ) { kdDebug( 80001 ) << "Creating canvas item, type is " << cname << endl; JSOpaqueProxy *prx = 0; @@ -490,11 +490,11 @@ namespace KJSEmbed { if ( arg0 ) { - QObject * obj0 = arg0->object(); + TQObject * obj0 = arg0->object(); - if ( obj0->inherits( "QCanvas" ) ) { - QCanvas * parent = ( QCanvas * ) ( obj0 ); - prx = new JSOpaqueProxy( new QCanvasText( parent ), "QCanvasText" ); + if ( obj0->inherits( "TQCanvas" ) ) { + TQCanvas * parent = ( TQCanvas * ) ( obj0 ); + prx = new JSOpaqueProxy( new TQCanvasText( parent ), "TQCanvasText" ); KJS::Object proxyObj( prx ); QCanvasItemImp::addBindings( exec, proxyObj ); @@ -511,17 +511,17 @@ namespace KJSEmbed { } else if ( args.size() == 2 ) { - QString arg0 = args[ 0 ].toString( exec ).qstring(); + TQString arg0 = args[ 0 ].toString( exec ).qstring(); JSObjectProxy *arg1 = JSProxy::toObjectProxy( args[ 1 ].imp() ); if ( arg1 ) { - QString arg0 = args[ 0 ].toString( exec ).qstring(); - QObject *obj1 = arg1->object(); + TQString arg0 = args[ 0 ].toString( exec ).qstring(); + TQObject *obj1 = arg1->object(); - if ( obj1->inherits( "QCanvas" ) ) { - QCanvas * parent = ( QCanvas * ) ( obj1 ); - prx = new JSOpaqueProxy( new QCanvasText( parent ), "QCanvasText" ); + if ( obj1->inherits( "TQCanvas" ) ) { + TQCanvas * parent = ( TQCanvas * ) ( obj1 ); + prx = new JSOpaqueProxy( new TQCanvasText( parent ), "TQCanvasText" ); KJS::Object proxyObj( prx ); QCanvasItemImp::addBindings( exec, proxyObj ); @@ -542,9 +542,9 @@ namespace KJSEmbed { return KJS::Object(); } - KJS::Object JSFactory::createValue( KJS::ExecState *exec, const QString &cname, const KJS::List & args ) { + KJS::Object JSFactory::createValue( KJS::ExecState *exec, const TQString &cname, const KJS::List & args ) { if ( cname == "Image" ) { - QImage img = QImage(); + TQImage img = TQImage(); JSValueProxy *prx = new JSValueProxy( ); prx->setValue( img ); KJS::Object proxyObj( prx ); @@ -552,7 +552,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Pixmap" ) { - QPixmap pix = QPixmap(); + TQPixmap pix = TQPixmap(); JSValueProxy *prx = new JSValueProxy( ); prx->setValue( pix ); KJS::Object proxyObj( prx ); @@ -560,7 +560,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Brush" ) { - QBrush brsh; + TQBrush brsh; JSValueProxy *prx = new JSValueProxy( ); prx->setValue( brsh ); KJS::Object proxyObj( prx ); @@ -568,7 +568,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Pen" ) { - QPen pen; + TQPen pen; JSValueProxy *prx = new JSValueProxy( ); prx->setValue( pen ); KJS::Object proxyObj( prx ); @@ -576,7 +576,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Rect" ) { - QRect rect; + TQRect rect; if ( args.size() == 4 ) { rect.setX( extractInt( exec, args, 0 ) ); rect.setY( extractInt( exec, args, 1 ) ); @@ -590,7 +590,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Point" ) { - QPoint point; + TQPoint point; if ( args.size() == 2 ) { point.setX( extractInt( exec, args, 0 ) ); point.setY( extractInt( exec, args, 1 ) ); @@ -602,7 +602,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Size" ) { - QSize size; + TQSize size; if ( args.size() == 2 ) { size.setWidth( extractInt( exec, args, 0 ) ); size.setHeight( extractInt( exec, args, 1 ) ); @@ -618,21 +618,21 @@ namespace KJSEmbed { return KJS::Object(); } - QWidget *JSFactory::createWidget( const QString &cname, QWidget *pw, const char *name ) { - if ( cname == "QSplitter" ) - return new QSplitter( pw, name ); - else if ( cname == "QMainWindow" ) - return new QMainWindow( pw, name ); - else if ( cname == "QProgressDialog" ) - return new QProgressDialog( pw, name ); - else if ( cname == "QScrollView" ) - return new QScrollView( pw, name ); - else if ( cname == "QCanvasView" ) - return new QCanvasView( pw, name ); - else if ( cname == "QSplashScreen" ) { - QPixmap pix( 16, 16 ); + TQWidget *JSFactory::createWidget( const TQString &cname, TQWidget *pw, const char *name ) { + if ( cname == "TQSplitter" ) + return new TQSplitter( pw, name ); + else if ( cname == "TQMainWindow" ) + return new TQMainWindow( pw, name ); + else if ( cname == "TQProgressDialog" ) + return new TQProgressDialog( pw, name ); + else if ( cname == "TQScrollView" ) + return new TQScrollView( pw, name ); + else if ( cname == "TQCanvasView" ) + return new TQCanvasView( pw, name ); + else if ( cname == "TQSplashScreen" ) { + TQPixmap pix( 16, 16 ); pix.fill(); - return new QSplashScreen( pix ); + return new TQSplashScreen( pix ); } #ifndef QT_ONLY else if ( cname == "KMainWindow" ) @@ -646,19 +646,19 @@ namespace KJSEmbed { return 0; } - QObject *JSFactory::create( const QString &cname, QObject *parent, const char *name ) { + TQObject *JSFactory::create( const TQString &cname, TQObject *parent, const char *name ) { kdDebug( 80001 ) << "KJSEmbedPart::create() name " << name << " class " << cname << endl; // Factory widgets - QWidgetFactory wf; - QWidget *pw = ( parent && parent->isWidgetType() ) ? static_cast<QWidget *>( parent ) : 0; - QWidget *w = wf.createWidget( cname, pw, name ); + TQWidgetFactory wf; + TQWidget *pw = ( parent && parent->isWidgetType() ) ? static_cast<TQWidget *>( parent ) : 0; + TQWidget *w = wf.createWidget( cname, pw, name ); if ( w ) { kdDebug( 80001 ) << "Created from factory" << endl; return w; } // Custom widgets - QObject *obj; + TQObject *obj; obj = createWidget( cname, pw, name ); if ( obj ) { if ( !isQObject( obj->className() ) ) @@ -689,22 +689,22 @@ namespace KJSEmbed { return 0; } - KParts::ReadOnlyPart *JSFactory::createROPart( const QString &svc, QObject *parent, const char *name ) { + KParts::ReadOnlyPart *JSFactory::createROPart( const TQString &svc, TQObject *parent, const char *name ) { kdDebug( 80001 ) << "JSFactory::createROPart svc " << svc << " parent " << ( long ) parent << endl; return createROPart( svc, "'KParts/ReadOnlyPart' in ServiceTypes", parent, name ); } - KParts::ReadOnlyPart *JSFactory::createROPart( const QString &svc, const QString &con, - QObject *parent, const char *name ) { + KParts::ReadOnlyPart *JSFactory::createROPart( const TQString &svc, const TQString &con, + TQObject *parent, const char *name ) { kdDebug( 80001 ) << "JSFactory::createROPart svc " << svc << " constraint " << con << " parent " << ( long ) parent << endl; - return createROPart( svc, con, parent, name, QStringList() ); + return createROPart( svc, con, parent, name, TQStringList() ); } - KParts::ReadOnlyPart *JSFactory::createROPart( const QString &svc, const QString &con, - QObject *parent, const char *name, - const QStringList &args ) { + KParts::ReadOnlyPart *JSFactory::createROPart( const TQString &svc, const TQString &con, + TQObject *parent, const char *name, + const TQStringList &args ) { #ifndef QT_ONLY kdDebug( 80001 ) << "JSFactory::createROPart svc " << svc << " constraint " << con << " parent " << ( long ) parent @@ -721,7 +721,7 @@ namespace KJSEmbed { return 0; } - QObject *obj = fact->create( parent, name, "KParts::ReadOnlyPart", args ); + TQObject *obj = fact->create( parent, name, "KParts::ReadOnlyPart", args ); addType( obj->className() ); return static_cast<KParts::ReadOnlyPart *>( obj ); #else // QT_ONLY @@ -736,22 +736,22 @@ namespace KJSEmbed { } - KParts::ReadWritePart *JSFactory::createRWPart( const QString &svc, QObject *parent, const char *name ) { + KParts::ReadWritePart *JSFactory::createRWPart( const TQString &svc, TQObject *parent, const char *name ) { kdDebug( 80001 ) << "JSFactory::createRWPart svc " << svc << " parent " << ( long ) parent << endl; return createRWPart( svc, "'KParts/ReadWritePart' in ServiceTypes", parent, name ); } - KParts::ReadWritePart *JSFactory::createRWPart( const QString &svc, const QString &con, - QObject *parent, const char *name ) { + KParts::ReadWritePart *JSFactory::createRWPart( const TQString &svc, const TQString &con, + TQObject *parent, const char *name ) { kdDebug( 80001 ) << "JSFactory::createRWPart svc " << svc << " constraint " << con << " parent " << ( long ) parent << endl; - return createRWPart( svc, con, parent, name, QStringList() ); + return createRWPart( svc, con, parent, name, TQStringList() ); } - KParts::ReadWritePart *JSFactory::createRWPart( const QString &svc, const QString &con, - QObject *parent, const char *name, - const QStringList &args ) { + KParts::ReadWritePart *JSFactory::createRWPart( const TQString &svc, const TQString &con, + TQObject *parent, const char *name, + const TQStringList &args ) { #ifndef QT_ONLY kdDebug( 80001 ) << "JSFactory::createRWPart svc " << svc << " constraint " << con << " parent " << ( long ) parent @@ -768,7 +768,7 @@ namespace KJSEmbed { return 0; } - QObject *obj = fact->create( parent, name, "KParts::ReadWritePart", args ); + TQObject *obj = fact->create( parent, name, "KParts::ReadWritePart", args ); addType( obj->className() ); return static_cast<KParts::ReadWritePart *>( obj ); #else // QT_ONLY @@ -783,15 +783,15 @@ namespace KJSEmbed { } - QWidget *JSFactory::loadUI( const QString &uiFile, QObject *connector, QWidget *parent, const char *name ) { - return QWidgetFactory::create( uiFile, connector, parent, name ); + TQWidget *JSFactory::loadUI( const TQString &uiFile, TQObject *connector, TQWidget *parent, const char *name ) { + return TQWidgetFactory::create( uiFile, connector, parent, name ); } - QStringList JSFactory::listBindingPlugins( KJS::ExecState *exec, KJS::Object &self ) { + TQStringList JSFactory::listBindingPlugins( KJS::ExecState *exec, KJS::Object &self ) { Q_UNUSED( exec ) Q_UNUSED( self ) - QStringList pluginList; - QStringList allTypes = objtypes.keys(); + TQStringList pluginList; + TQStringList allTypes = objtypes.keys(); for ( uint idx = 0; idx < allTypes.count(); ++idx ) { if ( objtypes[ allTypes[ idx ] ] & TypePlugin ) pluginList.append( allTypes[ idx ] ); @@ -799,34 +799,34 @@ namespace KJSEmbed { return pluginList; } - bool JSFactory::isQObject( const QString &clazz ) const { + bool JSFactory::isQObject( const TQString &clazz ) const { if ( !isSupported( clazz ) ) return false; return ( objtypes[ clazz ] & TypeQObject ); } - bool JSFactory::isValue( const QString &clazz ) const { + bool JSFactory::isValue( const TQString &clazz ) const { if ( !isSupported( clazz ) ) return false; return objtypes[ clazz ] == TypeValue; } - bool JSFactory::isOpaque( const QString &clazz ) const { + bool JSFactory::isOpaque( const TQString &clazz ) const { if ( !isSupported( clazz ) ) return false; return objtypes[ clazz ] == TypeOpaque; } - void JSFactory::addQObjectPlugin( const QString &classname, KJSEmbed::Bindings::JSBindingPlugin* plugin ) { + void JSFactory::addQObjectPlugin( const TQString &classname, KJSEmbed::Bindings::JSBindingPlugin* plugin ) { if ( plugin ) { addType( classname, TypeQObjectPlugin ); d->plugins.insert( classname, plugin ); } } - void JSFactory::addType( const QString &clazz, uint prxtype ) { + void JSFactory::addType( const TQString &clazz, uint prxtype ) { if ( prxtype == TypeInvalid ) { objtypes.remove( clazz ); return ; @@ -835,12 +835,12 @@ namespace KJSEmbed { objtypes[ clazz ] = prxtype; } - bool JSFactory::isSupported( const QString &clazz ) const { + bool JSFactory::isSupported( const TQString &clazz ) const { kdDebug() << "Checking " << clazz << endl; return objtypes.contains( clazz ); } - uint JSFactory::proxyType( const QString &clazz ) const { + uint JSFactory::proxyType( const TQString &clazz ) const { if ( !isSupported( clazz ) ) return TypeInvalid; return objtypes[ clazz ]; @@ -856,14 +856,14 @@ namespace KJSEmbed { addBindingPluginTypes( exec, parent ); } - QStringList JSFactory::types() const { + TQStringList JSFactory::types() const { return objtypes.keys(); } void JSFactory::addWidgetFactoryTypes( KJS::ExecState *exec, KJS::Object &parent ) { - QStringList sl = QWidgetFactory::widgets(); + TQStringList sl = TQWidgetFactory::widgets(); - for ( QStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) { + for ( TQStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) { JSFactoryImp *cons = new JSFactoryImp( exec, this, JSFactoryImp::NewInstance, *it ); parent.put( exec, KJS::Identifier( KJS::UString( cons->parameter() ) ), KJS::Object( cons ) ); addType( *it ); @@ -873,9 +873,9 @@ namespace KJSEmbed { void JSFactory::addCustomTypes( KJS::ExecState *exec, KJS::Object &parent ) { const char * classes[] = { - "QSplitter", "QScrollView", "QCanvasView", "QCanvas", - "QObject", "QTimer", "QSplashScreen", "QProgressDialog", - "QLayout", "QBoxLayout", "QHBoxLayout", "QVBoxLayout", + "TQSplitter", "TQScrollView", "TQCanvasView", "TQCanvas", + "TQObject", "TQTimer", "TQSplashScreen", "TQProgressDialog", + "TQLayout", "TQBoxLayout", "TQHBoxLayout", "TQVBoxLayout", #ifndef QT_ONLY "KMainWindow", "KXMLGUIClient", "KSystemTray", "KAction", "KToggleAction", @@ -920,10 +920,10 @@ namespace KJSEmbed { void JSFactory::addOpaqueTypes( KJS::ExecState *exec, KJS::Object &parent ) { const char * classes[] = { - "QTextStream", + "TQTextStream", "TextStream", - "QCanvasItem", - "QCanvasText", + "TQCanvasItem", + "TQCanvasText", 0 }; @@ -934,7 +934,7 @@ namespace KJSEmbed { } // Create the custom added types. - QDictIterator<KJSEmbed::Bindings::JSBindingBase> idx( d->opaqueTypes ); + TQDictIterator<KJSEmbed::Bindings::JSBindingBase> idx( d->opaqueTypes ); for( ; idx.current(); ++idx){ JSFactoryImp *cons = new JSFactoryImp( exec, this, JSFactoryImp::NewInstance, idx.currentKey() ); parent.put( exec, KJS::Identifier( KJS::UString( cons->parameter() ) ), KJS::Object( cons ) ); @@ -964,100 +964,100 @@ namespace KJSEmbed { void JSFactory::addObjectTypes( KJS::ExecState *exec, KJS::Object & parent ) { const char * classes[] = { - "QAccel", - "QAccessibleObject", - "QAction", - "QActionGroup", - "QApplication", + "TQAccel", + "TQAccessibleObject", + "TQAction", + "TQActionGroup", + "TQApplication", "QAquaStyle", "QAssistantClient", "QAxObject", "QAxWidget", - "QButton", - "QCDEStyle", + "TQButton", + "TQCDEStyle", "QClipboard", "QColorDialog", - "QColorDrag", - "QComboBox", - "QCommonStyle", + "TQColorDrag", + "TQComboBox", + "TQCommonStyle", "QCopChannel", - "QDataPump", - "QDateTimeEditBase", - "QDesktopWidget", - "QDns", - "QDockArea", - "QDockWindow", - "QDoubleValidator", - "QDragObject", - "QEditorFactory", - "QErrorMessage", - "QEventLoop", - "QFileDialog", - "QFileIconProvider", + "TQDataPump", + "TQDateTimeEditBase", + "TQDesktopWidget", + "TQDns", + "TQDockArea", + "TQDockWindow", + "TQDoubleValidator", + "TQDragObject", + "TQEditorFactory", + "TQErrorMessage", + "TQEventLoop", + "TQFileDialog", + "TQFileIconProvider", "QFontDialog", - "QFtp", - "QGLWidget", - "QGridLayout", - "QGridView", - "QHButtonGroup", - "QHGroupBox", - "QHeader", - "QHttp", - "QIconDrag", - "QImageDrag", + "TQFtp", + "TQGLWidget", + "TQGridLayout", + "TQGridView", + "TQHButtonGroup", + "TQHGroupBox", + "TQHeader", + "TQHttp", + "TQIconDrag", + "TQImageDrag", "QInputDialog", - "QIntValidator", - "QLocalFs", + "TQIntValidator", + "TQLocalFs", "QMacStyle", - "QMenuBar", - "QMessageBox", + "TQMenuBar", + "TQMessageBox", "QMotif", "QMotifDialog", - "QMotifPlusStyle", - "QMotifStyle", + "TQMotifPlusStyle", + "TQMotifStyle", "QMotifWidget", - "QNPInstance", - "QNPWidget", - "QNetworkOperation", - "QNetworkProtocol", - "QObjectCleanupHandler", - "QPlatinumStyle", - "QProcess", - "QPopupMenu", - "QProgressDialog", - "QRegExpValidator", - "QSGIStyle", - "QServerSocket", + "TQNPInstance", + "TQNPWidget", + "TQNetworkOperation", + "TQNetworkProtocol", + "TQObjectCleanupHandler", + "TQPlatinumStyle", + "TQProcess", + "TQPopupMenu", + "TQProgressDialog", + "TQRegExpValidator", + "TQSGIStyle", + "TQServerSocket", "QSessionManager", - "QSignal", - "QSignalMapper", - "QSizeGrip", - "QSocket", - "QSocketNotifier", - "QSound", - "QSqlDatabase", - "QSqlDriver", - "QSqlEditorFactory", - "QSqlForm", - "QStatusBar", - "QStoredDrag", - "QStyle", - "QStyleSheet", - "QTabBar", - "QTabDialog", - "QTextDrag", - "QToolBar", - "QToolTipGroup", + "TQSignal", + "TQSignalMapper", + "TQSizeGrip", + "TQSocket", + "TQSocketNotifier", + "TQSound", + "TQSqlDatabase", + "TQSqlDriver", + "TQSqlEditorFactory", + "TQSqlForm", + "TQStatusBar", + "TQStoredDrag", + "TQStyle", + "TQStyleSheet", + "TQTabBar", + "TQTabDialog", + "TQTextDrag", + "TQToolBar", + "TQToolTipGroup", "QTranslator", - "QUriDrag", - "QUrlOperator", - "QVButtonGroup", - "QVGroupBox", - "QValidator", + "TQUriDrag", + "TQUrlOperator", + "TQVButtonGroup", + "TQVGroupBox", + "TQValidator", "QWSKeyboardHandler", - "QWindowsStyle", + "TQWindowsStyle", "QWindowsXPStyle", - "QWorkspace", + "TQWorkspace", "QXtWidget", 0 @@ -1068,7 +1068,7 @@ namespace KJSEmbed { addType( classes[ i ] ); } // Create the custom added types. - QDictIterator<KJSEmbed::Bindings::JSBindingBase> idx( d->objectTypes ); + TQDictIterator<KJSEmbed::Bindings::JSBindingBase> idx( d->objectTypes ); for( ; idx.current(); ++idx){ JSFactoryImp *cons = new JSFactoryImp( exec, this, JSFactoryImp::NewInstance, idx.currentKey() ); parent.put( exec, KJS::Identifier( KJS::UString( cons->parameter() ) ), KJS::Object( cons ) ); @@ -1076,12 +1076,12 @@ namespace KJSEmbed { } } - void JSFactory::registerOpaqueType( const QString & className, KJSEmbed::Bindings::JSBindingBase * bindingFactory ) + void JSFactory::registerOpaqueType( const TQString & className, KJSEmbed::Bindings::JSBindingBase * bindingFactory ) { d->opaqueTypes.insert(className,bindingFactory); } - void JSFactory::unregisterOpaqueType( const QString & className ) + void JSFactory::unregisterOpaqueType( const TQString & className ) { d->opaqueTypes.remove(className); } @@ -1100,12 +1100,12 @@ namespace KJSEmbed { } } } - void JSFactory::registerObjectType( const QString & className, KJSEmbed::Bindings::JSBindingBase * bindingFactory ) + void JSFactory::registerObjectType( const TQString & className, KJSEmbed::Bindings::JSBindingBase * bindingFactory ) { d->objectTypes.insert(className,bindingFactory); } - void JSFactory::unregisterObjectType( const QString & className ) + void JSFactory::unregisterObjectType( const TQString & className ) { d->objectTypes.remove(className); } |