[Kde-bindings] KDE/kdebindings/kalyptus
Arno Rehn
kde at arnorehn.de
Fri May 16 13:47:52 UTC 2008
SVN commit 808387 by arnorehn:
* Fixed enums being marked as t_voidp if the containing
classes weren't preparsed.
* Added the kalyptus module for generating lists of classes.
CCMAIL: kde-bindings at kde.org
A kalyptusCxxToClasslist.pm
M +21 -1 kalyptusCxxToSmoke.pm
--- trunk/KDE/kdebindings/kalyptus/kalyptusCxxToSmoke.pm #808386:808387
@@ -448,7 +448,8 @@
return;
}
# return if the class is not in the current module or an ancestor of a class in the module
- return if (defined($excludeClasses{$className}) && !isAncestorOfModuleClass($className) && $className ne 'QMetaObject'); # && $className ne 'Qt');
+ return if (defined($excludeClasses{$className}) && !isAncestorOfModuleClass($className)
+ && $className ne 'QMetaObject' && !defined($externClasses{$className})); # && $className ne 'Qt');
$externClasses{$className} = 1 if defined($excludeClasses{$className});
my $signalCount = 0;
@@ -1846,6 +1847,10 @@
# For instance, if $type was Q_UINT16&, realType will be ushort
$allTypes{$type}{realType} = applyTypeDef( $realType );
$realType = $allTypes{$type}{realType};
+ if ($realType =~ /(.*)::/) {
+ my $c = $1;
+ $externClasses{$c} = 1 if defined($excludeClasses{$c});
+ }
$externClasses{$realType} = 1 if defined($excludeClasses{$realType});
# In the first phase we only create entries into allTypes.
@@ -2247,6 +2252,8 @@
}
# First write the name
print OUT "\t{ \"$type\", ";
+ my $retried;
+retry:
# 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*
$typeId = 't_class';
@@ -2284,6 +2291,19 @@
if ( $skippedClasses{$realType} ) {
# print STDERR "$realType has been skipped, using t_voidp for it\n";
} else {
+ # If we have an enum in a class that has not been preparsed
+ # because it is not needed in any other way, try to find the node
+ # and preparse it now. Then jump to the beginning and test again.
+ if(!$retried && $realType =~ /(.*)::/) {
+ $retried = 1;
+ my $c = $1;
+ my $cnode = kdocAstUtil::findRef( $rootnode, "$c" );
+ if ($cnode) {
+ preParseClass($cnode);
+ # ugly, but the easiest way without copying all the code again
+ goto retry;
+ }
+ }
unless( $realType =~ /</ ) { # Don't warn for template stuff...
print STDERR "$realType isn't a known type (type=$type)\n";
}
More information about the Kde-bindings
mailing list