From 9ba04742771370f59740e32e11c5f3a1e6a1b70a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Dec 2011 15:55:57 -0600 Subject: Initial TQt conversion --- kalyptus/kalyptusCxxToDcopIDL.pm | 168 +++++++++++++++++++-------------------- 1 file changed, 84 insertions(+), 84 deletions(-) (limited to 'kalyptus/kalyptusCxxToDcopIDL.pm') diff --git a/kalyptus/kalyptusCxxToDcopIDL.pm b/kalyptus/kalyptusCxxToDcopIDL.pm index 1e6540a4..ad7e3eee 100644 --- a/kalyptus/kalyptusCxxToDcopIDL.pm +++ b/kalyptus/kalyptusCxxToDcopIDL.pm @@ -61,18 +61,18 @@ BEGIN # Mapping for iterproto, when making up the munged method names %mungedTypeMap = ( - 'QString' => '$', - 'QString*' => '$', - 'QString&' => '$', - 'QCString' => '$', - 'QCString*' => '$', - 'QCString&' => '$', - 'QByteArray' => '$', - 'QByteArray&' => '$', - 'QByteArray*' => '$', + 'TQString' => '$', + 'TQString*' => '$', + 'TQString&' => '$', + 'TQCString' => '$', + 'TQCString*' => '$', + 'TQCString&' => '$', + 'TQByteArray' => '$', + 'TQByteArray&' => '$', + 'TQByteArray*' => '$', 'char*' => '$', - 'QCOORD*' => '?', - 'QRgb*' => '?', + 'TQCOORD*' => '?', + 'TQRgb*' => '?', ); # Yes some of this is in kalyptusDataDict's ctypemap @@ -91,46 +91,46 @@ BEGIN 'unsigned long' => 'ulong', # Anything that is not known is mapped to void*, so no need for those here anymore -# 'QWSEvent*' => 'void*', -# 'QDiskFont*' => 'void*', +# 'TQWSEvent*' => 'void*', +# 'TQDiskFont*' => 'void*', # 'XEvent*' => 'void*', -# 'QStyleHintReturn*' => 'void*', +# 'TQStyleHintReturn*' => 'void*', # 'FILE*' => 'void*', -# 'QUnknownInterface*' => 'void*', +# 'TQUnknownInterface*' => 'void*', # 'GDHandle' => 'void*', # '_NPStream*' => 'void*', -# 'QTextFormat*' => 'void*', -# 'QTextDocument*' => 'void*', -# 'QTextCursor*' => 'void*', -# 'QTextParag**' => 'void*', -# 'QTextParag*' => 'void*', -# 'QRemoteInterface*' => 'void*', -# 'QSqlRecordPrivate*' => 'void*', -# 'QTSMFI' => 'void*', # QTextStream's QTSManip +# 'TQTextFormat*' => 'void*', +# 'TQTextDocument*' => 'void*', +# 'TQTextCursor*' => 'void*', +# 'TQTextParag**' => 'void*', +# 'TQTextParag*' => 'void*', +# 'TQRemoteInterface*' => 'void*', +# 'TQSqlRecordPrivate*' => 'void*', +# 'TQTSMFI' => 'void*', # TQTextStream's TQTSManip # 'const GUID&' => 'void*', -# 'QWidgetMapper*' => 'void*', +# 'TQWidgetMapper*' => 'void*', # 'MSG*' => 'void*', -# 'const QSqlFieldInfoList&' => 'void*', # QSqlRecordInfo - TODO (templates) +# 'const TQSqlFieldInfoList&' => 'void*', # TQSqlRecordInfo - TODO (templates) - 'QPtrCollection::Item' => 'void*', # to avoid a warning + 'TQPtrCollection::Item' => 'void*', # to avoid a warning 'mode_t' => 'long', - 'QProcess::PID' => 'long', - 'size_type' => 'int', # QSqlRecordInfo - 'Qt::ComparisonFlags' => 'uint', - 'Qt::ToolBarDock' => 'int', # compat thing, Qt shouldn't use it - 'QIODevice::Offset' => 'ulong', + 'TQProcess::PID' => 'long', + 'size_type' => 'int', # TQSqlRecordInfo + 'TQt::ComparisonFlags' => 'uint', + 'TQt::ToolBarDock' => 'int', # compat thing, Qt shouldn't use it + 'TQIODevice::Offset' => 'ulong', 'WState' => 'int', 'WId' => 'ulong', - 'QRgb' => 'uint', - 'QCOORD' => 'int', - 'QTSMFI' => 'int', - 'Qt::WState' => 'int', - 'Qt::WFlags' => 'int', - 'Qt::HANDLE' => 'uint', - 'QEventLoop::ProcessEventsFlags' => 'uint', - 'QStyle::SCFlags' => 'int', - 'QStyle::SFlags' => 'int', + 'TQRgb' => 'uint', + 'TQCOORD' => 'int', + 'TQTSMFI' => 'int', + 'TQt::WState' => 'int', + 'TQt::WFlags' => 'int', + 'TQt::HANDLE' => 'uint', + 'TQEventLoop::ProcessEventsFlags' => 'uint', + 'TQStyle::SCFlags' => 'int', + 'TQStyle::SFlags' => 'int', 'Q_INT16' => 'short', 'Q_INT32' => 'int', 'Q_INT8' => 'char', @@ -151,10 +151,10 @@ sub writeDoc $debug = $main::debuggen; - # Define QPtrCollection::Item, for resolveType - unless ( kdocAstUtil::findRef( $rootnode, "QPtrCollection::Item" ) ) { - my $cNode = kdocAstUtil::findRef( $rootnode, "QPtrCollection" ); - warn "QPtrCollection not found" if (!$cNode); + # Define TQPtrCollection::Item, for resolveType + unless ( kdocAstUtil::findRef( $rootnode, "TQPtrCollection::Item" ) ) { + my $cNode = kdocAstUtil::findRef( $rootnode, "TQPtrCollection" ); + warn "TQPtrCollection not found" if (!$cNode); my $node = Ast::New( 'Item' ); $node->AddProp( "NodeType", "Forward" ); $node->AddProp( "Source", $cNode->{Source} ) if ($cNode); @@ -232,28 +232,28 @@ sub preParseClass if( $#{$classNode->{Kids}} < 0 || $classNode->{Access} eq "private" || - $classNode->{Access} eq "protected" || # e.g. QPixmap::QPixmapData + $classNode->{Access} eq "protected" || # e.g. TQPixmap::TQPixmapData exists $classNode->{Tmpl} || - # Don't generate standard bindings for QString, this class is handled as a native type - $className eq 'QString' || - $className eq 'QConstString' || - $className eq 'QCString' || + # Don't generate standard bindings for TQString, this class is handled as a native type + $className eq 'TQString' || + $className eq 'TQConstString' || + $className eq 'TQCString' || # Don't map classes which are really arrays - $className eq 'QStringList' || - $className eq 'QCanvasItemList' || - $className eq 'QWidgetList' || - $className eq 'QObjectList' || - $className eq 'QStrList' || + $className eq 'TQStringList' || + $className eq 'TQCanvasItemList' || + $className eq 'TQWidgetList' || + $className eq 'TQObjectList' || + $className eq 'TQStrList' || # Those are template related - $className eq 'QTSManip' || # cause compiler errors with several gcc versions - $className eq 'QGDict' || - $className eq 'QGList' || - $className eq 'QGVector' || - $className eq 'QStrIList' || - $className eq 'QStrIVec' || - $className eq 'QByteArray' || - $className eq 'QBitArray' || - $classNode->{NodeType} eq 'union' # Skip unions for now, e.g. QPDevCmdParam + $className eq 'TQTSManip' || # cause compiler errors with several gcc versions + $className eq 'TQGDict' || + $className eq 'TQGList' || + $className eq 'TQGVector' || + $className eq 'TQStrIList' || + $className eq 'TQStrIVec' || + $className eq 'TQByteArray' || + $className eq 'TQBitArray' || + $classNode->{NodeType} eq 'union' # Skip unions for now, e.g. TQPDevCmdParam ) { print STDERR "Skipping $className\n" if ($debug); print STDERR "Skipping union $className\n" if ( $classNode->{NodeType} eq 'union'); @@ -286,7 +286,7 @@ sub preParseClass my $name = $m->{astNodeName}; if( $m->{NodeType} eq "method" ) { - if ( $m->{ReturnType} eq 'typedef' # QFile's EncoderFn/DecoderFn callback, very badly parsed + if ( $m->{ReturnType} eq 'typedef' # TQFile's EncoderFn/DecoderFn callback, very badly parsed ) { $m->{NodeType} = 'deleted'; next; @@ -339,20 +339,20 @@ sub preParseClass } if ( $arg->{ArgType} eq '...' # refuse a method with variable arguments - or $arg->{ArgType} eq 'image_io_handler' # QImage's callback - or $arg->{ArgType} eq 'DecoderFn' # QFile's callback - or $arg->{ArgType} eq 'EncoderFn' # QFile's callback - or $arg->{ArgType} =~ /bool \(\*\)\(QObject/ # QMetaObject's ctor - or $arg->{ArgType} eq 'QtStaticMetaObjectFunction' # QMetaObjectCleanUp's ctor with func pointer - or $arg->{ArgType} eq 'const QTextItem&' # ref to a private class in 3.2.0b1 + or $arg->{ArgType} eq 'image_io_handler' # TQImage's callback + or $arg->{ArgType} eq 'DecoderFn' # TQFile's callback + or $arg->{ArgType} eq 'EncoderFn' # TQFile's callback + or $arg->{ArgType} =~ /bool \(\*\)\(TQObject/ # TQMetaObject's ctor + or $arg->{ArgType} eq 'QtStaticMetaObjectFunction' # TQMetaObjectCleanUp's ctor with func pointer + or $arg->{ArgType} eq 'const TQTextItem&' # ref to a private class in 3.2.0b1 or $arg->{ArgType} eq 'FILE*' # won't be able to handle that I think ) { $m->{NodeType} = 'deleted'; } else { - # Resolve type in full, e.g. for QSessionManager::RestartHint - # (x_QSessionManager doesn't inherit QSessionManager) + # Resolve type in full, e.g. for TQSessionManager::RestartHint + # (x_QSessionManager doesn't inherit TQSessionManager) $arg->{ArgType} = kalyptusDataDict::resolveType($arg->{ArgType}, $classNode, $rootnode); registerType( $arg->{ArgType} ); $argId++; @@ -377,7 +377,7 @@ sub preParseClass } elsif( $m->{NodeType} eq 'var' ) { my $varType = $m->{Type}; - # We are interested in public static vars, like QColor::blue + # We are interested in public static vars, like TQColor::blue if ( $varType =~ s/static\s+// && $m->{Access} ne 'private' ) { $varType =~ s/const\s+(.*)\s*&/$1/; @@ -513,7 +513,7 @@ sub coerce_type($$$$) { } else { if ( $unionfield eq 's_class' or ( $unionfield eq 's_voidp' and $type ne 'void*' ) - or $type eq 'QString' ) { # hack + or $type eq 'TQString' ) { # hack $type =~ s/^const\s+//; if($new) { $code .= "(void*)new $type($var);\n"; @@ -529,7 +529,7 @@ sub coerce_type($$$$) { } # Generate the list of args casted to their real type, e.g. -# (QObject*)x[1].s_class,(QEvent*)x[2].s_class,x[3].s_int +# (TQObject*)x[1].s_class,(TQEvent*)x[2].s_class,x[3].s_int sub makeCastedArgList { my @castedList; @@ -557,7 +557,7 @@ sub makeCastedArgList } else { if ( $unionfield eq 's_class' or ( $unionfield eq 's_voidp' and $type ne 'void*' ) - or $type eq 'QString' ) { # hack + or $type eq 'TQString' ) { # hack $cast = "{*($type *)}"; } else { $cast = "$type"; @@ -645,18 +645,18 @@ sub generateMethod($$$) # # Skip internal methods, which return unknown types # # Hmm, the C# bindings have a list of those too. -# return if ( $returnType =~ m/QGfx\s*\*/ ); +# return if ( $returnType =~ m/TQGfx\s*\*/ ); # return if ( $returnType eq 'CGContextRef' ); -# return if ( $returnType eq 'QWSDisplay *' ); +# return if ( $returnType eq 'TQWSDisplay *' ); # # This stuff needs callback, or ** # return if ( $name eq 'defineIOHandler' or $name eq 'qt_init_internal' ); # # Skip casting operators, but not == < etc. # return if ( $name =~ /operator \w+/ ); -# # QFile's EncoderFn/DecoderFn +# # TQFile's EncoderFn/DecoderFn # return if ( $name =~ /set[ED][ne]codingFunction/ ); -# # How to implement this? (QXmlDefaultHandler/QXmlEntityResolver::resolveEntity, needs A*&) -# return if ( $name eq 'resolveEntity' and $className =~ /^QXml/ ); -# return if ( $className eq 'QBitArray' && $m->{Access} eq 'protected' ); +# # How to implement this? (TQXmlDefaultHandler/TQXmlEntityResolver::resolveEntity, needs A*&) +# return if ( $name eq 'resolveEntity' and $className =~ /^TQXml/ ); +# return if ( $className eq 'TQBitArray' && $m->{Access} eq 'protected' ); #print STDERR "Tests passed, generating.\n"; @@ -814,7 +814,7 @@ sub registerType($$) { return; } - die if $type eq 'QTextEdit::UndoRedoInfo::Type'; + die if $type eq 'TQTextEdit::UndoRedoInfo::Type'; die if $type eq ''; my $realType = $type; @@ -1071,7 +1071,7 @@ sub writeSmokeDataFile($) { # First write the name print OUT "\t{ \"$type\", "; # Then write the classId (and find out the typeid at the same time) - if(exists $classidx{$realType}) { # this one first, we want t_class for QBlah* + if(exists $classidx{$realType}) { # this one first, we want t_class for TQBlah* $typeId = 't_class'; print OUT "$classidx{$realType}, "; } -- cgit v1.2.1