diff options
Diffstat (limited to 'dcop/dcopidlng')
| -rw-r--r-- | dcop/dcopidlng/kalyptus | 69 | ||||
| -rw-r--r-- | dcop/dcopidlng/kalyptusCxxToDcopIDL.pm | 27 | ||||
| -rw-r--r-- | dcop/dcopidlng/kdocAstUtil.pm | 8 | ||||
| -rw-r--r-- | dcop/dcopidlng/kdocParseDoc.pm | 12 | ||||
| -rw-r--r-- | dcop/dcopidlng/kdocUtil.pm | 2 |
5 files changed, 66 insertions, 52 deletions
diff --git a/dcop/dcopidlng/kalyptus b/dcop/dcopidlng/kalyptus index bde755236..e3119b3dc 100644 --- a/dcop/dcopidlng/kalyptus +++ b/dcop/dcopidlng/kalyptus @@ -1,5 +1,4 @@ #!/usr/bin/perl -I/Users/duke/src/kde/tdebindings/kalyptus -# -*- indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- # KDOC -- C++ and CORBA IDL interface documentation tool. # Sirtaj Singh Kang <taj@kde.org>, Jan 1999. @@ -74,9 +73,9 @@ public: virtual bool tqt_emit( int, QUObject* ); virtual bool tqt_property( int, int, QVariant* ); static QMetaObject* staticMetaObject(); - QObject* qObject(); - static QString tr( const char *, const char * = 0 ); - static QString trUtf8( const char *, const char * = 0 ); + TQObject* qObject(); + static TQString tr( const char *, const char * = 0 ); + static TQString trUtf8( const char *, const char * = 0 ); private: CODE @@ -99,9 +98,8 @@ $allowed_k_dcop_accesors_re = join("|", @allowed_k_dcop_accesors); _STYLE_PLATINUM => '', _STYLE_SGI => '', _STYLE_WINDOWS => '', - QT_STATIC_CONST => 'static const', - Q_EXPORT => '', - Q_REFCOUNT => '', + TQ_EXPORT => '', + TQ_REFCOUNT => '', QM_EXPORT_CANVAS => '', QM_EXPORT_DNS => '', QM_EXPORT_ICONVIEW => '', @@ -110,19 +108,18 @@ $allowed_k_dcop_accesors_re = join("|", @allowed_k_dcop_accesors); QM_EXPORT_WORKSPACE => '', TQT_NO_REMOTE => 'TQT_NO_REMOTE', QT_ACCESSIBILITY_SUPPORT => 'QT_ACCESSIBILITY_SUPPORT', - Q_WS_X11 => 'Q_WS_X11', + TQ_WS_X11 => 'TQ_WS_X11', TQ_DISABLE_COPY => 'TQ_DISABLE_COPY', - Q_WS_QWS => 'undef', - Q_WS_MAC => 'undef', - Q_OBJECT => <<'CODE', + TQ_WS_QWS => 'undef', + TQ_WS_MAC => 'undef', TQ_OBJECT => <<'CODE', public: virtual QMetaObject *metaObject() const; virtual const char *className() const; virtual bool tqt_invoke( int, QUObject* ); virtual bool tqt_emit( int, QUObject* ); - static QString tr( const char *, const char * = 0 ); - static QString trUtf8( const char *, const char * = 0 ); + static TQString tr( const char *, const char * = 0 ); + static TQString trUtf8( const char *, const char * = 0 ); private: CODE }; @@ -374,7 +371,7 @@ sub readSourceLine =head2 readCxxLine Reads a C++ source line, skipping comments, blank lines, - preprocessor tokens and the Q_OBJECT/TQ_OBJECT macros + preprocessor tokens and the TQ_OBJECT macros =cut @@ -402,16 +399,11 @@ LOOP: } } - if ( $p =~ /^\s*Q_OBJECT/ ) { - push @inputqueue, @codeqobject; - next; - } if ( $p =~ /^\s*TQ_OBJECT/ ) { push @inputqueue, @codeqobject; next; } # Hack, waiting for real handling of preprocessor defines - $p =~ s/QT_STATIC_CONST/static const/; $p =~ s/KSVG_GET/KJS::Value get();/; $p =~ s/KSVG_BASECLASS_GET/KJS::Value get();/; $p =~ s/KSVG_BRIDGE/KJS::ObjectImp *bridge();/; @@ -424,7 +416,7 @@ LOOP: } next if ( $p =~ /^\s*$/s ); # blank lines -# || $p =~ /^\s*Q_OBJECT/ # QObject macro +# || $p =~ /^\s*TQ_OBJECT/ # TQObject macro # ); # @@ -432,14 +424,14 @@ LOOP: || $p =~ /^\s*TQ_PROPERTY/ # and TQ_PROPERTY || $p =~ /^\s*TQ_OVERRIDE/ # and TQ_OVERRIDE || $p =~ /^\s*TQ_SETS/ - || $p =~ /^\s*Q_DUMMY_COMPARISON_OPERATOR/ + || $p =~ /^\s*TQ_DUMMY_COMPARISON_OPERATOR/ || $p =~ /^\s*K_SYCOCATYPE/ # and K_SYCOCA stuff || $p =~ /^\s*K_SYCOCAFACTORY/ # || $p =~ /^\s*KSVG_/ # and KSVG stuff ;) || $p =~ /^\s*KDOM_/ ); - push @includes_list, $1 if $p =~ /^#include\s+<?(.*?)>?\s*$/; + push @includes_list, $1 if $p =~ /^#include\s+[<"]?(.*?)[>"]?\s*$/; # remove all preprocessor macros if( $p =~ /^\s*#\s*(\w+)/ ) { @@ -457,13 +449,13 @@ LOOP: else { # Skip platform-specific stuff, or #if 0 stuff # or #else of something we parsed (e.g. for QKeySequence) - if ( $p =~ m/^#\s*ifdef\s*Q_WS_/ or - $p =~ m/^#\s*if\s+defined\(Q_WS_/ or + if ( $p =~ m/^#\s*ifdef\s*TQ_WS_/ or + $p =~ m/^#\s*if\s+defined\(TQ_WS_/ or $p =~ m/^#\s*if\s+defined\(Q_OS_/ or $p =~ m/^#\s*if\s+defined\(Q_CC_/ or $p =~ m/^#\s*if\s+defined\(TQT_THREAD_SUPPORT/ or $p =~ m/^#\s*else/ or - $p =~ m/^#\s*if\s+defined\(Q_FULL_TEMPLATE_INSTANTIATION/ or + $p =~ m/^#\s*if\s+defined\(TQ_FULL_TEMPLATE_INSTANTIATION/ or $p =~ m/^#\s*ifdef\s+CONTAINER_CUSTOM_WIDGETS/ or &$match_qt_defines( $p ) or $p =~ m/^#\s*if\s+0\s+/ ) { @@ -714,7 +706,7 @@ sub identifyDecl \s*(class|struct|union|namespace) # 2 struct type \s*([A-Z_]*EXPORT[A-Z_]*)? # 3 export (?:\s*TQ_PACKED)? - (?:\s*Q_REFCOUNT)? + (?:\s*TQ_REFCOUNT)? \s+([\w_]+ # 4 name (?:<[\w_ :,]+?>)? # maybe explicit template # (eat chars between <> non-hungry) @@ -777,7 +769,10 @@ sub identifyDecl \( (.*?) \) # parameters \s*((?:const)?)\s* (?:throw\s*\(.*?\))? - \s*((?:=\s*0(?:L?))?)\s* # Pureness. is "0L" allowed? + \s*((?:=\s*(?: + 0(?:L?)| # Pureness. is "0L" allowed? + default # Default method + ))?) \s*[;{]+/xs ) { # rest my $tpn = $1; # type + name @@ -789,7 +784,7 @@ sub identifyDecl } my $const = $3 eq "" ? 0 : 1; - my $pure = $4 eq "" ? 0 : 1; + my $pure = $4 eq "" ? 0 : ($4 =~ "default" ? 0 : 1); $tpn =~ s/\s+/ /g; $params =~ s/\s+/ /g; @@ -1476,7 +1471,7 @@ sub newMethod This property contains a list of nodes, one for each parameter. Each parameter node has the following properties: - * ArgType the type of the argument, e.g. const QString& + * ArgType the type of the argument, e.g. const TQString& * ArgName the name of the argument - optionnal * DefaultValue the default value of the argument - optionnal @@ -1521,16 +1516,22 @@ sub makeParamList($$$) # Separate arg type from arg name, if the latter is specified if ( $arg =~ /(.*)\s+([\w_]+)\s*$/ || $arg =~ /(.*)\(\s*\*\s([\w_]+)\)\s*\((.*)\)\s*$/ ) { - if ( defined $3 ) { # function pointer - $argType = $1."(*)($3)"; - $argName = $2; + if ( $1 eq "const" || $2 eq "long" || $2 eq "short" || $2 eq "int" || $2 eq "char" ) { + # const qualifier or long notation of numeric type + # without argument name + $argType = "$1 $2"; } else { $argType = $1; $argName = $2; } - } else { # unnamed arg - or enum value + if ( defined $3 ) { + # function pointer + $argType .= "(*)($3)"; + } + } else { + # unnamed arg - or enum value $argType = $arg if (!$isEnum); - $argName = $arg if ($isEnum); + $argName = $arg if ($isEnum); } $argId++; diff --git a/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm b/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm index 8a2988f06..719f13e3b 100644 --- a/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm +++ b/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm @@ -95,7 +95,7 @@ sub preParseClass my( $classNode ) = @_; my $className = join( "::", kdocAstUtil::heritage($classNode) ); - if( $#{$classNode->{Kids}} < 0 || + if( ($#{$classNode->{Kids}} < 0 && !$classNode->{DcopExported}) || $classNode->{Access} eq "private" || $classNode->{Access} eq "protected" || # e.g. QPixmap::QPixmapData exists $classNode->{Tmpl} || @@ -161,18 +161,33 @@ sub generateMethod($$) $argType =~ s/^\s*(.*?)\s*$/$1/; $argType =~ s/</</g; $argType =~ s/>/>/g; - $argType =~ s/\s//g; - - $args .= " <ARG><TYPE$typeAttrs>$argType</TYPE><NAME>$arg->{ArgName}</NAME></ARG>\n"; + $argType =~ s/(\W)\s+/$1/g; + $argType =~ s/\s+(\W)/$1/g; + $argType =~ s/\b(signed|unsigned|long|short)$/$1 int/; + + $args .= " "; + $args .= "<ARG><TYPE$typeAttrs>$argType</TYPE>"; + $args .= "<NAME>$arg->{ArgName}</NAME>" if $arg->{ArgName} !~ /^$/; + $args .= "</ARG>\n"; } my $qual = ""; $qual .= " qual=\"const\"" if $flags =~ "c"; + my $r_isConst = ($returnType =~ s/^\s*const\s*//); + my $r_isRef = ($returnType =~ s/&//); + + my $retTypeAttrs = ""; + $retTypeAttrs .= " qleft=\"const\"" if $r_isConst; + $retTypeAttrs .= " qright=\"&\"" if $r_isRef; + $returnType = "void" unless $returnType; + $returnType =~ s/^\s*(.*?)\s*$/$1/; $returnType =~ s/</</g; $returnType =~ s/>/>/g; - $returnType =~ s/^\s*const\s*//; + $returnType =~ s/(\W)\s+/$1/g; + $returnType =~ s/\s+(\W)/$1/g; + $returnType =~ s/\b(signed|unsigned|long|short)$/$1 int/; my $methodCode = ""; @@ -182,7 +197,7 @@ sub generateMethod($$) if (!$isConstructor) { $methodCode .= " <$tagType$tagAttr$qual>\n"; - $methodCode .= " <TYPE>$returnType</TYPE>\n"; + $methodCode .= " <TYPE$retTypeAttrs>$returnType</TYPE>\n"; $methodCode .= " <NAME>$name</NAME>\n"; $methodCode .= "$args"; $methodCode .= " </$tagType>\n"; diff --git a/dcop/dcopidlng/kdocAstUtil.pm b/dcop/dcopidlng/kdocAstUtil.pm index f31f2b365..6abb59a25 100644 --- a/dcop/dcopidlng/kdocAstUtil.pm +++ b/dcop/dcopidlng/kdocAstUtil.pm @@ -152,10 +152,12 @@ ANITER: if( !defined $ref ) { # ancestor undefined - warn "warning: ", $node->{astNodeName}, - " inherits unknown class '", + if( $in->{astNodeName} ne "DCOPObject" + && $in->{astNodeName} ne "TQObject" ) { + warn "warning: ", $node->{astNodeName}, + " inherits unknown class '", $in->{astNodeName},"'\n"; - + } $parent->AddPropList( 'InBy', $node ); } else { diff --git a/dcop/dcopidlng/kdocParseDoc.pm b/dcop/dcopidlng/kdocParseDoc.pm index e5f19d50c..fa34f5f30 100644 --- a/dcop/dcopidlng/kdocParseDoc.pm +++ b/dcop/dcopidlng/kdocParseDoc.pm @@ -60,15 +60,15 @@ PARSELOOP: next if !defined $text; $text =~ s#^\s*\*(?!\/)##; + if ( $text =~ m#\*/# ) { + $finished = 1; + $text = $`; + } # if ( $text =~ /^\s*<\/pre>/i ) { # flushProp(); # $inbounded = 0; # } if( $inbounded ) { - if ( $text =~ m#\*/# ) { - $finished = 1; - $text = $`; - } $buffer .= $text; next PARSELOOP; } @@ -162,10 +162,6 @@ PARSELOOP: docProp( "LibDoc" ); } else { - if ( $text =~ m#\*/# ) { - $finished = 1; - $text = $`; - } $buffer .= $text; } } diff --git a/dcop/dcopidlng/kdocUtil.pm b/dcop/dcopidlng/kdocUtil.pm index 629147ac3..e045a6790 100644 --- a/dcop/dcopidlng/kdocUtil.pm +++ b/dcop/dcopidlng/kdocUtil.pm @@ -139,7 +139,7 @@ sub userName =head2 splitUnnested Helper to split a list using a delimiter, but looking for nesting with (), {}, [] and <>. - Example: splitting int a, QPair<c,b> d, e="," + Example: splitting int a, TQPair<c,b> d, e="," on ',' will give 3 items in the list. Parameter: delimiter, string |
