summaryrefslogtreecommitdiffstats
path: root/kalyptus/kalyptusCxxToDcopIDL.pm
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-06-18 02:38:19 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-06-18 02:38:19 +0200
commitee9b1e7dc5f8db9bb39ce95a8daf129efff39b53 (patch)
tree1e65ae9bbdf17546d8c290d2384d45abe8be95c0 /kalyptus/kalyptusCxxToDcopIDL.pm
parent256d241873a67c99d66c3ff52a64858678462a50 (diff)
downloadtdebindings-ee9b1e7dc5f8db9bb39ce95a8daf129efff39b53.tar.gz
tdebindings-ee9b1e7dc5f8db9bb39ce95a8daf129efff39b53.zip
Merge fixes for kalyptus that were made in tdelibs/dcopidlng:
+ includes may use quotation marks + argument types can contain multiple words + avoid use long, short, int or char type as the argument name + avoid use type as the argument name if the const qualifier is used + use long notation of int types + the arguments can be nameless + return types can have qualifiers + do not warn on inherit of the DCOPObject and TQObject classes + the documentation comment does not have to end on a separate line + do not skip an empty class if it is declared with K_DCOP Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kalyptus/kalyptusCxxToDcopIDL.pm')
-rw-r--r--kalyptus/kalyptusCxxToDcopIDL.pm23
1 files changed, 20 insertions, 3 deletions
diff --git a/kalyptus/kalyptusCxxToDcopIDL.pm b/kalyptus/kalyptusCxxToDcopIDL.pm
index 5ff17c02..3dd00fc2 100644
--- a/kalyptus/kalyptusCxxToDcopIDL.pm
+++ b/kalyptus/kalyptusCxxToDcopIDL.pm
@@ -230,7 +230,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. TQPixmap::TQPixmapData
exists $classNode->{Tmpl} ||
@@ -685,8 +685,14 @@ sub generateMethod($$$)
$argType =~ s/^\s*(.*?)\s*$/$1/;
$argType =~ s/</&lt;/g;
$argType =~ s/>/&gt;/g;
+ $argType =~ s/(\W)\s+/$1/g;
+ $argType =~ s/\s+(\W)/$1/g;
+ $argType =~ s/\b(signed|unsigned|long|short)$/$1 int/;
- $args .= " <ARG><TYPE$typeAttrs>$argType</TYPE><NAME>$arg->{ArgName}</NAME></ARG>\n";
+ $args .= " ";
+ $args .= "<ARG><TYPE$typeAttrs>$argType</TYPE>";
+ $args .= "<NAME>$arg->{ArgName}</NAME>" if $arg->{ArgName} !~ /^$/;
+ $args .= "</ARG>\n";
push @argTypeList, $argType;
@@ -703,6 +709,13 @@ sub generateMethod($$$)
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=\"&amp;\"" if $r_isRef;
+
my $this = $classNode->{BindingDerives} > 0 ? "this" : "xthis";
# We iterate as many times as we have default params
@@ -714,8 +727,12 @@ sub generateMethod($$$)
$xretCode .= coerce_type('x[0]', 'xret', $returnType, 1); }
$returnType = "void" unless $returnType;
+ $returnType =~ s/^\s*(.*?)\s*$/$1/;
$returnType =~ s/</&lt;/g;
$returnType =~ s/>/&gt;/g;
+ $returnType =~ s/(\W)\s+/$1/g;
+ $returnType =~ s/\s+(\W)/$1/g;
+ $returnType =~ s/\b(signed|unsigned|long|short)$/$1 int/;
my $methodCode = "";
@@ -739,7 +756,7 @@ sub generateMethod($$$)
$methodCode .= " <DOC>$doc</DOC>\n";
}
- $methodCode .= " <TYPE>$returnType</TYPE>\n";
+ $methodCode .= " <TYPE$retTypeAttrs>$returnType</TYPE>\n";
$methodCode .= " <NAME>$name</NAME>\n";
$methodCode .= "$args";
$methodCode .= " </$tagType>\n";