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/jsfactory.cpp | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'kjsembed/jsfactory.cpp')
-rw-r--r-- | kjsembed/jsfactory.cpp | 552 |
1 files changed, 276 insertions, 276 deletions
diff --git a/kjsembed/jsfactory.cpp b/kjsembed/jsfactory.cpp index b33d9f81..8749481a 100644 --- a/kjsembed/jsfactory.cpp +++ b/kjsembed/jsfactory.cpp @@ -137,9 +137,9 @@ namespace KJSEmbed { class JSFactoryPrivate { public: - TQDict<KJSEmbed::Bindings::JSBindingPlugin> plugins; - TQDict<KJSEmbed::Bindings::JSBindingBase> opaqueTypes; - TQDict<KJSEmbed::Bindings::JSBindingBase> objectTypes; + TTQDict<KJSEmbed::Bindings::JSBindingPlugin> plugins; + TTQDict<KJSEmbed::Bindings::JSBindingBase> opaqueTypes; + TTQDict<KJSEmbed::Bindings::JSBindingBase> objectTypes; }; @@ -147,9 +147,9 @@ namespace KJSEmbed { : jspart( part ) { evmapper = new JSEventMapper(); d = new JSFactoryPrivate; - registerOpaqueType("TQDir", new Bindings::QDirLoader()); - registerOpaqueType("TQCheckListItem", new Bindings::QCheckListItemLoader()); - registerOpaqueType("TQListViewItem", new Bindings::QListViewItemLoader()); + registerOpaqueType("TTQDir", new Bindings::TQDirLoader()); + registerOpaqueType("TTQCheckListItem", new Bindings::TQCheckListItemLoader()); + registerOpaqueType("TTQListViewItem", new Bindings::TQListViewItemLoader()); registerOpaqueType("Painter", new Bindings::PainterLoader()); #ifndef QT_ONLY @@ -174,7 +174,7 @@ namespace KJSEmbed { KTrader::OfferListIterator itr = offers.begin(); while ( itr != offers.end() ) { - TQString classname = ( *itr ) ->name(); + TTQString 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 TQString &classname ) const { + bool JSFactory::isBindingPlugin( const TTQString &classname ) const { if ( !isSupported( classname ) ) return false; return ( objtypes[ classname ] & TypePlugin ); } - KJS::Object JSFactory::createBindingPlugin( KJS::ExecState *exec, const TQString &classname, const KJS::List &args ) { + KJS::Object JSFactory::createBindingPlugin( KJS::ExecState *exec, const TTQString &classname, const KJS::List &args ) { #ifndef QT_ONLY Bindings::JSBindingPlugin * plugin = d->plugins[ classname ]; if ( plugin == 0L ) { - TQString query = "JSBindingPlugin/Binding"; - TQString constraint = "[Name] == '" + classname + "'"; + TTQString query = "JSBindingPlugin/Binding"; + TTQString constraint = "[Name] == '" + classname + "'"; plugin = KParts::ComponentFactory::createInstanceFromQuery<Bindings::JSBindingPlugin>( query, constraint ); if ( plugin != 0L ) d->plugins.insert( classname, plugin ); @@ -219,28 +219,28 @@ namespace KJSEmbed { return KJS::Object(); } - KJS::Object JSFactory::create( KJS::ExecState *exec, const TQString &classname, const KJS::List &args ) { + KJS::Object JSFactory::create( KJS::ExecState *exec, const TTQString &classname, const KJS::List &args ) { KJS::Object returnObject; if ( !isSupported( classname ) ) { - TQString msg = i18n( "Object of type '%1' is not supported." ).arg( classname ); + TTQString msg = i18n( "Object of type '%1' is not supported." ).arg( classname ); return throwError(exec, msg,KJS::TypeError); } - if ( isQObject( classname ) ) { + if ( isTQObject( classname ) ) { // create via widget factory... Bindings::JSBindingBase *factory = d->objectTypes.find(classname); if( factory ) { returnObject = factory->createBinding( jspart, exec, args ); JSProxy::toProxy( returnObject.imp() ) ->setOwner( JSProxy::JavaScript ); } else { - TQObject *parent = extractQObject(exec, args, 0); - TQString name = extractQString(exec, args, 1); + TTQObject *parent = extractTQObject(exec, args, 0); + TTQString name = extractTQString(exec, args, 1); - TQObject *obj = create( classname, parent, name.latin1() ); + TTQObject *obj = create( classname, parent, name.latin1() ); if ( obj ) { returnObject = createProxy( exec, obj ); JSProxy::toProxy( returnObject.imp() ) ->setOwner( JSProxy::JavaScript ); } else { - TQString msg = i18n( "TQObject of type '%1' could not be created." ).arg( classname ); + TTQString msg = i18n( "TTQObject 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() ) { - TQString msg = i18n( "Opaque object of type '%1' could not be created." ).arg( classname ); + TTQString 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() ) { - TQString msg = i18n( "Value object of type '%1' could not be created." ).arg( classname ); + TTQString 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() ) { - TQString msg = i18n( "Plugin object of type '%1' could not be created." ).arg( classname ); + TTQString 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 { - TQString msg = i18n( "Could not create object of type '%1'." ).arg( classname ); + TTQString 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, TQObject *target, + KJS::Object JSFactory::createProxy( KJS::ExecState *exec, TTQObject *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, - TQTextStream *target, const JSObjectProxy *context ) const { + TTQTextStream *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, - TQEvent *target, const JSObjectProxy *context ) const { + TTQEvent *target, const JSObjectProxy *context ) const { switch ( target->type() ) { - case TQEvent::MouseButtonPress: - case TQEvent::MouseButtonRelease: - case TQEvent::MouseMove: - case TQEvent::MouseButtonDblClick: - return JSEventUtils::convertEvent( exec, ( TQMouseEvent * ) target, context ); + case TTQEvent::MouseButtonPress: + case TTQEvent::MouseButtonRelease: + case TTQEvent::MouseMove: + case TTQEvent::MouseButtonDblClick: + return JSEventUtils::convertEvent( exec, ( TTQMouseEvent * ) target, context ); break; - case TQEvent::KeyPress: - case TQEvent::KeyRelease: - case TQEvent::Accel: - case TQEvent::AccelOverride: - return JSEventUtils::convertEvent( exec, ( TQKeyEvent * ) target, context ); + case TTQEvent::KeyPress: + case TTQEvent::KeyRelease: + case TTQEvent::Accel: + case TTQEvent::AccelOverride: + return JSEventUtils::convertEvent( exec, ( TTQKeyEvent * ) target, context ); break; - case TQEvent::IMStart: - case TQEvent::IMCompose: - case TQEvent::IMEnd: - return JSEventUtils::convertEvent( exec, ( TQIMEvent * ) target, context ); + case TTQEvent::IMStart: + case TTQEvent::IMCompose: + case TTQEvent::IMEnd: + return JSEventUtils::convertEvent( exec, ( TTQIMEvent * ) target, context ); break; - case TQEvent::Paint: - return JSEventUtils::convertEvent( exec, ( TQPaintEvent * ) target, context ); + case TTQEvent::Paint: + return JSEventUtils::convertEvent( exec, ( TTQPaintEvent * ) target, context ); break; - case TQEvent::Resize: - return JSEventUtils::convertEvent( exec, ( TQResizeEvent * ) target, context ); + case TTQEvent::Resize: + return JSEventUtils::convertEvent( exec, ( TTQResizeEvent * ) target, context ); break; - case TQEvent::FocusIn: - case TQEvent::FocusOut: - return JSEventUtils::convertEvent( exec, ( TQFocusEvent * ) target, context ); + case TTQEvent::FocusIn: + case TTQEvent::FocusOut: + return JSEventUtils::convertEvent( exec, ( TTQFocusEvent * ) target, context ); break; - case TQEvent::Close: - return JSEventUtils::convertEvent( exec, ( TQCloseEvent * ) target, context ); + case TTQEvent::Close: + return JSEventUtils::convertEvent( exec, ( TTQCloseEvent * ) target, context ); break; - case TQEvent::ChildInserted: - case TQEvent::ChildRemoved: - return JSEventUtils::convertEvent( exec, ( TQChildEvent * ) target, context ); + case TTQEvent::ChildInserted: + case TTQEvent::ChildRemoved: + return JSEventUtils::convertEvent( exec, ( TTQChildEvent * ) target, context ); break; - case TQEvent::Move: - return JSEventUtils::convertEvent( exec, ( TQMoveEvent * ) target, context ); + case TTQEvent::Move: + return JSEventUtils::convertEvent( exec, ( TTQMoveEvent * ) target, context ); break; - case TQEvent::Wheel: - return JSEventUtils::convertEvent( exec, ( TQWheelEvent * ) target, context ); + case TTQEvent::Wheel: + return JSEventUtils::convertEvent( exec, ( TTQWheelEvent * ) target, context ); break; - case TQEvent::Timer: - return JSEventUtils::convertEvent( exec, ( TQTimerEvent * ) target, context ); + case TTQEvent::Timer: + return JSEventUtils::convertEvent( exec, ( TTQTimerEvent * ) target, context ); break; - case TQEvent::ContextMenu: - return JSEventUtils::convertEvent( exec, ( TQContextMenuEvent * ) target, context ); + case TTQEvent::ContextMenu: + return JSEventUtils::convertEvent( exec, ( TTQContextMenuEvent * ) target, context ); break; - case TQEvent::DragMove: - case TQEvent::DragEnter: - return JSEventUtils::convertEvent( exec, ( TQDragMoveEvent * ) target, context ); + case TTQEvent::DragMove: + case TTQEvent::DragEnter: + return JSEventUtils::convertEvent( exec, ( TTQDragMoveEvent * ) target, context ); break; - case TQEvent::Drop: - return JSEventUtils::convertEvent( exec, ( TQDropEvent * ) target, context ); + case TTQEvent::Drop: + return JSEventUtils::convertEvent( exec, ( TTQDropEvent * ) target, context ); break; - 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 ); + case TTQEvent::Enter: + case TTQEvent::Leave: + case TTQEvent::Clipboard: + case TTQEvent::DragLeave: + case TTQEvent::Show: + case TTQEvent::Hide: + return JSEventUtils::convertEvent( exec, ( TTQEvent * ) target, context ); break; default: break; } - return JSEventUtils::convertEvent( exec, ( TQEvent * ) target, context ); + return JSEventUtils::convertEvent( exec, ( TTQEvent * ) 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 ) { - TQString query = "JSBindingPlugin/Binding"; - TQString constraint = "[Name] == '" + TQString::fromUtf8( proxy->object() ->className() ) + "'"; + TTQString query = "JSBindingPlugin/Binding"; + TTQString constraint = "[Name] == '" + TTQString::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 { } - TQObject *JSFactory::createBinding( const TQString &cname, TQObject *parent, const char *name ) { + TTQObject *JSFactory::createBinding( const TTQString &cname, TTQObject *parent, const char *name ) { #ifndef QT_ONLY // Bindings @@ -446,38 +446,38 @@ namespace KJSEmbed { return 0; } - TQObject *JSFactory::createObject( const TQString &cname, TQObject *parent, const char *name ) { + TTQObject *JSFactory::createObject( const TTQString &cname, TTQObject *parent, const char *name ) { - // QObjects defined by Qt - 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 ); + // TQObjects defined by Qt + if ( cname == "TTQObject" ) + return new TTQObject( parent, name ); + else if ( cname == "TTQTimer" ) + return new TTQTimer( parent, name ); + else if ( cname == "TTQCanvas" ) + return new TTQCanvas( parent, name ); #ifndef QT_ONLY - // QObjects defined by KDE + // TQObjects defined by KDE else if ( cname == "KAction" ) return new KAction( parent, name ); else if ( cname == "KToggleAction" ) return new KToggleAction( parent, name ); #endif // QT_ONLY - TQWidget *w = dynamic_cast<TQWidget *>( parent ); + TTQWidget *w = dynamic_cast<TTQWidget *>( parent ); if ( !w ) return 0; - if ( cname == "TQHBoxLayout" ) - return new TQHBoxLayout( w, 0, -1, name ); - else if ( cname == "TQVBoxLayout" ) - return new TQVBoxLayout( w, 0, -1, name ); + if ( cname == "TTQHBoxLayout" ) + return new TTQHBoxLayout( w, 0, -1, name ); + else if ( cname == "TTQVBoxLayout" ) + return new TTQVBoxLayout( w, 0, -1, name ); return 0; } - KJS::Object JSFactory::createOpaque( KJS::ExecState *exec, const TQString &cname, const KJS::List &args ) { + KJS::Object JSFactory::createOpaque( KJS::ExecState *exec, const TTQString &cname, const KJS::List &args ) { - if ( cname == "TQCanvasText" ) { + if ( cname == "TTQCanvasText" ) { kdDebug( 80001 ) << "Creating canvas item, type is " << cname << endl; JSOpaqueProxy *prx = 0; @@ -490,15 +490,15 @@ namespace KJSEmbed { if ( arg0 ) { - TQObject * obj0 = arg0->object(); + TTQObject * obj0 = arg0->object(); - if ( obj0->inherits( "TQCanvas" ) ) { - TQCanvas * parent = ( TQCanvas * ) ( obj0 ); - prx = new JSOpaqueProxy( new TQCanvasText( parent ), "TQCanvasText" ); + if ( obj0->inherits( "TTQCanvas" ) ) { + TTQCanvas * parent = ( TTQCanvas * ) ( obj0 ); + prx = new JSOpaqueProxy( new TTQCanvasText( parent ), "TTQCanvasText" ); KJS::Object proxyObj( prx ); - QCanvasItemImp::addBindings( exec, proxyObj ); - QCanvasTextImp::addBindings( exec, proxyObj ); + TQCanvasItemImp::addBindings( exec, proxyObj ); + TQCanvasTextImp::addBindings( exec, proxyObj ); return proxyObj; } else { kdDebug( 80001 ) << " canvas item create failed, arg0 is " << obj0->className() << endl; @@ -511,21 +511,21 @@ namespace KJSEmbed { } else if ( args.size() == 2 ) { - TQString arg0 = args[ 0 ].toString( exec ).qstring(); + TTQString arg0 = args[ 0 ].toString( exec ).qstring(); JSObjectProxy *arg1 = JSProxy::toObjectProxy( args[ 1 ].imp() ); if ( arg1 ) { - TQString arg0 = args[ 0 ].toString( exec ).qstring(); - TQObject *obj1 = arg1->object(); + TTQString arg0 = args[ 0 ].toString( exec ).qstring(); + TTQObject *obj1 = arg1->object(); - if ( obj1->inherits( "TQCanvas" ) ) { - TQCanvas * parent = ( TQCanvas * ) ( obj1 ); - prx = new JSOpaqueProxy( new TQCanvasText( parent ), "TQCanvasText" ); + if ( obj1->inherits( "TTQCanvas" ) ) { + TTQCanvas * parent = ( TTQCanvas * ) ( obj1 ); + prx = new JSOpaqueProxy( new TTQCanvasText( parent ), "TTQCanvasText" ); KJS::Object proxyObj( prx ); - QCanvasItemImp::addBindings( exec, proxyObj ); - QCanvasTextImp::addBindings( exec, proxyObj ); + TQCanvasItemImp::addBindings( exec, proxyObj ); + TQCanvasTextImp::addBindings( exec, proxyObj ); return proxyObj; } else { kdDebug( 80001 ) << " canvas item create failed, arg0 is " << obj1->className() << endl; @@ -542,9 +542,9 @@ namespace KJSEmbed { return KJS::Object(); } - KJS::Object JSFactory::createValue( KJS::ExecState *exec, const TQString &cname, const KJS::List & args ) { + KJS::Object JSFactory::createValue( KJS::ExecState *exec, const TTQString &cname, const KJS::List & args ) { if ( cname == "Image" ) { - TQImage img = TQImage(); + TTQImage img = TTQImage(); JSValueProxy *prx = new JSValueProxy( ); prx->setValue( img ); KJS::Object proxyObj( prx ); @@ -552,7 +552,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Pixmap" ) { - TQPixmap pix = TQPixmap(); + TTQPixmap pix = TTQPixmap(); JSValueProxy *prx = new JSValueProxy( ); prx->setValue( pix ); KJS::Object proxyObj( prx ); @@ -560,7 +560,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Brush" ) { - TQBrush brsh; + TTQBrush brsh; JSValueProxy *prx = new JSValueProxy( ); prx->setValue( brsh ); KJS::Object proxyObj( prx ); @@ -568,7 +568,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Pen" ) { - TQPen pen; + TTQPen pen; JSValueProxy *prx = new JSValueProxy( ); prx->setValue( pen ); KJS::Object proxyObj( prx ); @@ -576,7 +576,7 @@ namespace KJSEmbed { return proxyObj; } if ( cname == "Rect" ) { - TQRect rect; + TTQRect 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" ) { - TQPoint point; + TTQPoint 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" ) { - TQSize size; + TTQSize 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(); } - 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 ); + TTQWidget *JSFactory::createWidget( const TTQString &cname, TTQWidget *pw, const char *name ) { + if ( cname == "TTQSplitter" ) + return new TTQSplitter( pw, name ); + else if ( cname == "TTQMainWindow" ) + return new TTQMainWindow( pw, name ); + else if ( cname == "TTQProgressDialog" ) + return new TTQProgressDialog( pw, name ); + else if ( cname == "TTQScrollView" ) + return new TTQScrollView( pw, name ); + else if ( cname == "TTQCanvasView" ) + return new TTQCanvasView( pw, name ); + else if ( cname == "TTQSplashScreen" ) { + TTQPixmap pix( 16, 16 ); pix.fill(); - return new TQSplashScreen( pix ); + return new TTQSplashScreen( pix ); } #ifndef QT_ONLY else if ( cname == "KMainWindow" ) @@ -646,22 +646,22 @@ namespace KJSEmbed { return 0; } - TQObject *JSFactory::create( const TQString &cname, TQObject *parent, const char *name ) { + TTQObject *JSFactory::create( const TTQString &cname, TTQObject *parent, const char *name ) { kdDebug( 80001 ) << "KJSEmbedPart::create() name " << name << " class " << cname << endl; // Factory widgets - TQWidgetFactory wf; - TQWidget *pw = ( parent && parent->isWidgetType() ) ? static_cast<TQWidget *>( parent ) : 0; - TQWidget *w = wf.createWidget( cname, pw, name ); + TTQWidgetFactory wf; + TTQWidget *pw = ( parent && parent->isWidgetType() ) ? static_cast<TTQWidget *>( parent ) : 0; + TTQWidget *w = wf.createWidget( cname, pw, name ); if ( w ) { kdDebug( 80001 ) << "Created from factory" << endl; return w; } // Custom widgets - TQObject *obj; + TTQObject *obj; obj = createWidget( cname, pw, name ); if ( obj ) { - if ( !isQObject( obj->className() ) ) + if ( !isTQObject( obj->className() ) ) addType( obj->className() ); kdDebug( 80001 ) << "Created from createWidget" << endl; return obj; @@ -670,7 +670,7 @@ namespace KJSEmbed { // Custom objects obj = JSFactory::createObject( cname, parent, name ); if ( obj ) { - if ( !isQObject( obj->className() ) ) + if ( !isTQObject( obj->className() ) ) addType( obj->className() ); kdDebug( 80001 ) << "Created from createObject" << endl; return obj; @@ -679,7 +679,7 @@ namespace KJSEmbed { // Binding objects obj = JSFactory::createBinding( cname, parent, name ); if ( obj ) { - if ( !isQObject( obj->className() ) ) + if ( !isTQObject( obj->className() ) ) addType( obj->className() ); kdDebug( 80001 ) << "Created from bindings" << endl; return obj; @@ -689,22 +689,22 @@ namespace KJSEmbed { return 0; } - KParts::ReadOnlyPart *JSFactory::createROPart( const TQString &svc, TQObject *parent, const char *name ) { + KParts::ReadOnlyPart *JSFactory::createROPart( const TTQString &svc, TTQObject *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 TQString &svc, const TQString &con, - TQObject *parent, const char *name ) { + KParts::ReadOnlyPart *JSFactory::createROPart( const TTQString &svc, const TTQString &con, + TTQObject *parent, const char *name ) { kdDebug( 80001 ) << "JSFactory::createROPart svc " << svc << " constraint " << con << " parent " << ( long ) parent << endl; - return createROPart( svc, con, parent, name, TQStringList() ); + return createROPart( svc, con, parent, name, TTQStringList() ); } - KParts::ReadOnlyPart *JSFactory::createROPart( const TQString &svc, const TQString &con, - TQObject *parent, const char *name, - const TQStringList &args ) { + KParts::ReadOnlyPart *JSFactory::createROPart( const TTQString &svc, const TTQString &con, + TTQObject *parent, const char *name, + const TTQStringList &args ) { #ifndef QT_ONLY kdDebug( 80001 ) << "JSFactory::createROPart svc " << svc << " constraint " << con << " parent " << ( long ) parent @@ -721,7 +721,7 @@ namespace KJSEmbed { return 0; } - TQObject *obj = fact->create( parent, name, "KParts::ReadOnlyPart", args ); + TTQObject *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 TQString &svc, TQObject *parent, const char *name ) { + KParts::ReadWritePart *JSFactory::createRWPart( const TTQString &svc, TTQObject *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 TQString &svc, const TQString &con, - TQObject *parent, const char *name ) { + KParts::ReadWritePart *JSFactory::createRWPart( const TTQString &svc, const TTQString &con, + TTQObject *parent, const char *name ) { kdDebug( 80001 ) << "JSFactory::createRWPart svc " << svc << " constraint " << con << " parent " << ( long ) parent << endl; - return createRWPart( svc, con, parent, name, TQStringList() ); + return createRWPart( svc, con, parent, name, TTQStringList() ); } - KParts::ReadWritePart *JSFactory::createRWPart( const TQString &svc, const TQString &con, - TQObject *parent, const char *name, - const TQStringList &args ) { + KParts::ReadWritePart *JSFactory::createRWPart( const TTQString &svc, const TTQString &con, + TTQObject *parent, const char *name, + const TTQStringList &args ) { #ifndef QT_ONLY kdDebug( 80001 ) << "JSFactory::createRWPart svc " << svc << " constraint " << con << " parent " << ( long ) parent @@ -768,7 +768,7 @@ namespace KJSEmbed { return 0; } - TQObject *obj = fact->create( parent, name, "KParts::ReadWritePart", args ); + TTQObject *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 { } - TQWidget *JSFactory::loadUI( const TQString &uiFile, TQObject *connector, TQWidget *parent, const char *name ) { - return TQWidgetFactory::create( uiFile, connector, parent, name ); + TTQWidget *JSFactory::loadUI( const TTQString &uiFile, TTQObject *connector, TTQWidget *parent, const char *name ) { + return TTQWidgetFactory::create( uiFile, connector, parent, name ); } - TQStringList JSFactory::listBindingPlugins( KJS::ExecState *exec, KJS::Object &self ) { + TTQStringList JSFactory::listBindingPlugins( KJS::ExecState *exec, KJS::Object &self ) { Q_UNUSED( exec ) Q_UNUSED( self ) - TQStringList pluginList; - TQStringList allTypes = objtypes.keys(); + TTQStringList pluginList; + TTQStringList 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 TQString &clazz ) const { + bool JSFactory::isTQObject( const TTQString &clazz ) const { if ( !isSupported( clazz ) ) return false; - return ( objtypes[ clazz ] & TypeQObject ); + return ( objtypes[ clazz ] & TypeTQObject ); } - bool JSFactory::isValue( const TQString &clazz ) const { + bool JSFactory::isValue( const TTQString &clazz ) const { if ( !isSupported( clazz ) ) return false; return objtypes[ clazz ] == TypeValue; } - bool JSFactory::isOpaque( const TQString &clazz ) const { + bool JSFactory::isOpaque( const TTQString &clazz ) const { if ( !isSupported( clazz ) ) return false; return objtypes[ clazz ] == TypeOpaque; } - void JSFactory::addQObjectPlugin( const TQString &classname, KJSEmbed::Bindings::JSBindingPlugin* plugin ) { + void JSFactory::addTQObjectPlugin( const TTQString &classname, KJSEmbed::Bindings::JSBindingPlugin* plugin ) { if ( plugin ) { - addType( classname, TypeQObjectPlugin ); + addType( classname, TypeTQObjectPlugin ); d->plugins.insert( classname, plugin ); } } - void JSFactory::addType( const TQString &clazz, uint prxtype ) { + void JSFactory::addType( const TTQString &clazz, uint prxtype ) { if ( prxtype == TypeInvalid ) { objtypes.remove( clazz ); return ; @@ -835,12 +835,12 @@ namespace KJSEmbed { objtypes[ clazz ] = prxtype; } - bool JSFactory::isSupported( const TQString &clazz ) const { + bool JSFactory::isSupported( const TTQString &clazz ) const { kdDebug() << "Checking " << clazz << endl; return objtypes.contains( clazz ); } - uint JSFactory::proxyType( const TQString &clazz ) const { + uint JSFactory::proxyType( const TTQString &clazz ) const { if ( !isSupported( clazz ) ) return TypeInvalid; return objtypes[ clazz ]; @@ -856,14 +856,14 @@ namespace KJSEmbed { addBindingPluginTypes( exec, parent ); } - TQStringList JSFactory::types() const { + TTQStringList JSFactory::types() const { return objtypes.keys(); } void JSFactory::addWidgetFactoryTypes( KJS::ExecState *exec, KJS::Object &parent ) { - TQStringList sl = TQWidgetFactory::widgets(); + TTQStringList sl = TTQWidgetFactory::widgets(); - for ( TQStringList::Iterator it = sl.begin(); it != sl.end(); ++it ) { + for ( TTQStringList::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[] = { - "TQSplitter", "TQScrollView", "TQCanvasView", "TQCanvas", - "TQObject", "TQTimer", "TQSplashScreen", "TQProgressDialog", - "TQLayout", "TQBoxLayout", "TQHBoxLayout", "TQVBoxLayout", + "TTQSplitter", "TTQScrollView", "TTQCanvasView", "TTQCanvas", + "TTQObject", "TTQTimer", "TTQSplashScreen", "TTQProgressDialog", + "TTQLayout", "TTQBoxLayout", "TTQHBoxLayout", "TTQVBoxLayout", #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[] = { - "TQTextStream", + "TTQTextStream", "TextStream", - "TQCanvasItem", - "TQCanvasText", + "TTQCanvasItem", + "TTQCanvasText", 0 }; @@ -934,7 +934,7 @@ namespace KJSEmbed { } // Create the custom added types. - TQDictIterator<KJSEmbed::Bindings::JSBindingBase> idx( d->opaqueTypes ); + TTQDictIterator<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,101 +964,101 @@ namespace KJSEmbed { void JSFactory::addObjectTypes( KJS::ExecState *exec, KJS::Object & parent ) { const char * classes[] = { - "TQAccel", - "TQAccessibleObject", - "TQAction", - "TQActionGroup", - "TQApplication", - "QAquaStyle", - "QAssistantClient", - "QAxObject", - "QAxWidget", - "TQButton", - "QCDEStyle", - "QClipboard", - "QColorDialog", - "TQColorDrag", - "TQComboBox", - "TQCommonStyle", - "QCopChannel", - "TQDataPump", - "TQDateTimeEditBase", - "TQDesktopWidget", - "TQDns", - "TQDockArea", - "TQDockWindow", - "TQDoubleValidator", - "TQDragObject", - "TQEditorFactory", - "TQErrorMessage", - "TQEventLoop", - "TQFileDialog", - "TQFileIconProvider", - "QFontDialog", - "TQFtp", - "QGLWidget", - "TQGridLayout", - "TQGridView", - "TQHButtonGroup", - "TQHGroupBox", - "TQHeader", - "TQHttp", - "TQIconDrag", - "TQImageDrag", - "QInputDialog", - "TQIntValidator", - "TQLocalFs", - "QMacStyle", - "TQMenuBar", - "TQMessageBox", - "QMotif", - "QMotifDialog", - "TQMotifPlusStyle", - "TQMotifStyle", - "QMotifWidget", - "QNPInstance", - "QNPWidget", - "TQNetworkOperation", - "TQNetworkProtocol", - "TQObjectCleanupHandler", - "TQPlatinumStyle", - "TQProcess", - "TQPopupMenu", - "TQProgressDialog", - "TQRegExpValidator", - "QSGIStyle", - "TQServerSocket", - "QSessionManager", - "TQSignal", - "TQSignalMapper", - "TQSizeGrip", - "TQSocket", - "TQSocketNotifier", - "TQSound", - "TQSqlDatabase", - "TQSqlDriver", - "TQSqlEditorFactory", - "TQSqlForm", - "TQStatusBar", - "TQStoredDrag", - "TQStyle", - "TQStyleSheet", - "TQTabBar", - "TQTabDialog", - "TQTextDrag", - "TQToolBar", - "TQToolTipGroup", - "QTranslator", - "TQUriDrag", - "TQUrlOperator", - "TQVButtonGroup", - "TQVGroupBox", - "TQValidator", - "QWSKeyboardHandler", - "TQWindowsStyle", - "QWindowsXPStyle", - "TQWorkspace", - "QXtWidget", + "TTQAccel", + "TTQAccessibleObject", + "TTQAction", + "TTQActionGroup", + "TTQApplication", + "TQAquaStyle", + "TQAssistantClient", + "TQAxObject", + "TQAxWidget", + "TTQButton", + "TQCDEStyle", + "TQClipboard", + "TQColorDialog", + "TTQColorDrag", + "TTQComboBox", + "TTQCommonStyle", + "TQCopChannel", + "TTQDataPump", + "TTQDateTimeEditBase", + "TTQDesktopWidget", + "TTQDns", + "TTQDockArea", + "TTQDockWindow", + "TTQDoubleValidator", + "TTQDragObject", + "TTQEditorFactory", + "TTQErrorMessage", + "TTQEventLoop", + "TTQFileDialog", + "TTQFileIconProvider", + "TQFontDialog", + "TTQFtp", + "TQGLWidget", + "TTQGridLayout", + "TTQGridView", + "TTQHButtonGroup", + "TTQHGroupBox", + "TTQHeader", + "TTQHttp", + "TTQIconDrag", + "TTQImageDrag", + "TQInputDialog", + "TTQIntValidator", + "TTQLocalFs", + "TQMacStyle", + "TTQMenuBar", + "TTQMessageBox", + "TQMotif", + "TQMotifDialog", + "TTQMotifPlusStyle", + "TTQMotifStyle", + "TQMotifWidget", + "TQNPInstance", + "TQNPWidget", + "TTQNetworkOperation", + "TTQNetworkProtocol", + "TTQObjectCleanupHandler", + "TTQPlatinumStyle", + "TTQProcess", + "TTQPopupMenu", + "TTQProgressDialog", + "TTQRegExpValidator", + "TQSGIStyle", + "TTQServerSocket", + "TQSessionManager", + "TTQSignal", + "TTQSignalMapper", + "TTQSizeGrip", + "TTQSocket", + "TTQSocketNotifier", + "TTQSound", + "TTQSqlDatabase", + "TTQSqlDriver", + "TTQSqlEditorFactory", + "TTQSqlForm", + "TTQStatusBar", + "TTQStoredDrag", + "TTQStyle", + "TTQStyleSheet", + "TTQTabBar", + "TTQTabDialog", + "TTQTextDrag", + "TTQToolBar", + "TTQToolTipGroup", + "TQTranslator", + "TTQUriDrag", + "TTQUrlOperator", + "TTQVButtonGroup", + "TTQVGroupBox", + "TTQValidator", + "TQWSKeyboardHandler", + "TTQWindowsStyle", + "TQWindowsXPStyle", + "TTQWorkspace", + "TQXtWidget", 0 }; @@ -1068,20 +1068,20 @@ namespace KJSEmbed { addType( classes[ i ] ); } // Create the custom added types. - TQDictIterator<KJSEmbed::Bindings::JSBindingBase> idx( d->objectTypes ); + TTQDictIterator<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 ) ); - addType( idx.currentKey(), TypeQObject ); + addType( idx.currentKey(), TypeTQObject ); } } - void JSFactory::registerOpaqueType( const TQString & className, KJSEmbed::Bindings::JSBindingBase * bindingFactory ) + void JSFactory::registerOpaqueType( const TTQString & className, KJSEmbed::Bindings::JSBindingBase * bindingFactory ) { d->opaqueTypes.insert(className,bindingFactory); } - void JSFactory::unregisterOpaqueType( const TQString & className ) + void JSFactory::unregisterOpaqueType( const TTQString & className ) { d->opaqueTypes.remove(className); } @@ -1100,12 +1100,12 @@ namespace KJSEmbed { } } } - void JSFactory::registerObjectType( const TQString & className, KJSEmbed::Bindings::JSBindingBase * bindingFactory ) + void JSFactory::registerObjectType( const TTQString & className, KJSEmbed::Bindings::JSBindingBase * bindingFactory ) { d->objectTypes.insert(className,bindingFactory); } - void JSFactory::unregisterObjectType( const TQString & className ) + void JSFactory::unregisterObjectType( const TTQString & className ) { d->objectTypes.remove(className); } |