[Kde-bindings] KDE/kdebindings/kalyptus
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Thu Apr 10 20:23:52 UTC 2008
SVN commit 795572 by rdale:
* Enums which were in classes in a namespace like Plasma weren't being found
* The Plasma classes are in just the Plasma namespace, and not nested within Kimono
* Added some of the Plasma list types as C# types
CCMAIL: kde-bindings at kde.org
M +54 -8 kalyptusCxxToKimono.pm
--- trunk/KDE/kdebindings/kalyptus/kalyptusCxxToKimono.pm #795571:795572
@@ -86,6 +86,24 @@
'qulonglong' => '$',
'WId' => '$',
'Q_PID' => '$',
+ 'KMimeType::Ptr' => '#',
+ 'KMimeType::Ptr&' => '#',
+ 'KServiceGroup::Ptr' => '#',
+ 'KServiceGroup::Ptr&' => '#',
+ 'KService::Ptr' => '#',
+ 'KService::Ptr&' => '#',
+ 'KServiceType::Ptr' => '#',
+ 'KServiceType::Ptr&' => '#',
+ 'KSharedConfig::Ptr' => '#',
+ 'KSharedConfig::Ptr&' => '#',
+ 'KSharedConfigPtr' => '#',
+ 'KSharedConfigPtr&' => '#',
+ 'KSharedPtr<KConfigBackend>' => '#',
+ 'KSharedPtr<KConfigBackend>&' => '#',
+ 'KSycocaEntry::Ptr' => '#',
+ 'KSycocaEntry::Ptr&' => '#',
+ 'Plasma::PackageStructure::Ptr' => '#',
+ 'Plasma::PackageStructure::Ptr&' => '#',
);
# Yes some of this is in kalyptusDataDict's ctypemap
@@ -229,6 +247,7 @@
'KFileItemList' => 'List<KFileItem>',
'KFileItemList*' => 'List<KFileItem>',
'KFileItemList&' => 'List<KFileItem>',
+ 'KPluginInfo::List' => 'List<KPluginInfo>',
'KService::List' => 'List<KService>',
'KServiceOfferList' => 'List<KServiceOffer>',
'KUrl::List' => 'List<KUrl>',
@@ -263,7 +282,8 @@
# 'QList<KParts::Plugin::PluginInfo>' => 'List<QXmlStreamNotationDeclaration>',
# 'QList<KParts::Plugin::PluginInfo>&' => 'List<QXmlStreamNotationDeclaration>',
'QList<KParts::ReadOnlyPart*>' => 'List<KParts.ReadOnlyPart>',
- 'QList<KPluginInfo*>&' => 'List<KPluginInfo>',
+ 'QList<KPluginInfo>' => 'List<KPluginInfo>',
+ 'QList<KPluginInfo>&' => 'List<KPluginInfo>',
'QList<KServiceOffer>&' => 'List<KServiceOffer>',
'QList<KSSLCertificate*>&' => 'List<KSSLCertificate>',
'QList<KToolBar*>' => 'List<KToolBar>',
@@ -272,6 +292,14 @@
'QList<KUser>&' => 'List<KUser>',
'QList<KXMLGUIClient*>' => 'List<KXMLGUIClient>',
'QList<KXMLGUIClient*>&' => 'List<KXMLGUIClient>',
+ 'QList<Plasma::Containment*>' => 'List<Plasma.Containment>',
+ 'QList<Plasma::Containment*>&' => 'List<Plasma.Containment>',
+ 'QList<Plasma::PlotColor>' => 'List<Plasma.PlotColor>',
+ 'QList<Plasma::PlotColor>&' => 'List<Plasma.PlotColor>',
+ 'QList<Plasma::SearchMatch*>' => 'List<Plasma.SearchMatch>',
+ 'QList<Plasma::SearchMatch*>&' => 'List<Plasma.SearchMatch>',
+ 'Plasma::Applet::List' => 'List<Plasma.Applet>',
+ 'Plasma::AbstractRunner::List' => 'List<Plasma.AbstractRunner>',
'QList<QAbstractButton*>' => 'List<QAbstractButton>',
'QList<QActionGroup*>' => 'List<QAction>',
'QList<QAction*>' => 'List<QAction>',
@@ -532,8 +560,21 @@
} else {
my $node;
my $item;
- if ($className =~ /^(\w+)::(\w+)$/) {
+ if ($className =~ /^(\w+)::(\w+)::(\w+)$/) {
$node = kdocAstUtil::findRef( $rootnode, $1 );
+ if (defined $node) {
+ $node = kdocAstUtil::findRef( $node, $2 );
+ $item = kdocAstUtil::findRef( $node, $3 ) if defined $node;
+ if (defined $item && $item->{NodeType} eq 'enum') {
+ if ($2 eq 'Type') {
+ return "$1.$2.TypeOf";
+ } else {
+ return "$1.$2.$3";
+ }
+ }
+ }
+ } elsif ($className =~ /^(\w+)::(\w+)$/) {
+ $node = kdocAstUtil::findRef( $rootnode, $1 );
$item = kdocAstUtil::findRef( $node, $2 ) if defined $node;
if (defined $item && $item->{NodeType} eq 'enum') {
if ($2 eq 'Type') {
@@ -1355,12 +1396,14 @@
$packagename = "Qwt";
} elsif ($className =~ /^Q/) {
$packagename = "Qyoto";
+ } elsif ($className =~ /^Plasma/) {
+ $packagename = "Plasma";
} else {
$packagename = "Kimono";
}
my $namespace;
- if ($className =~ /([^:]*)::.*/) {
+ if ($className =~ /([^:]*)::.*/ && $1 != $packagename) {
$namespace = $1;
}
@@ -2802,6 +2845,9 @@
}
$addImport->{"Qyoto"} = 1;
+ if ($className =~ /^Plasma::/) {
+ $addImport->{"Kimono"} = 1;
+ }
my %virtualMethods;
allVirtualMethods( $classNode, \%virtualMethods, $classNode );
@@ -2812,7 +2858,7 @@
Iter::MembersByType ( $classNode, undef,
sub { my ($classNode, $methodNode ) = @_;
- if ( $methodNode->{NodeType} eq 'enum' and $currentClassName eq $csharpClassName ) {
+ if ( $methodNode->{NodeType} eq 'enum' and $classNode->{astNodeName} eq $mainClassNode->{astNodeName} ) {
my ($code) = generateEnum( $classNode, $methodNode, 0 );
$extraCode .= $code;
}
@@ -2821,8 +2867,8 @@
# Do all enums first, anonymous ones and then named enums
Iter::MembersByType ( $classNode, undef,
sub { my ($classNode, $methodNode ) = @_;
-
- if ( $methodNode->{NodeType} eq 'enum' and $currentClassName eq $csharpClassName ) {
+
+ if ( $methodNode->{NodeType} eq 'enum' and $classNode->{astNodeName} eq $mainClassNode->{astNodeName} ) {
my ($code) = generateEnum( $classNode, $methodNode, 1 );
$extraCode .= $code;
}
@@ -2832,7 +2878,7 @@
Iter::MembersByType ( $classNode, undef,
sub { my ($classNode, $methodNode ) = @_;
- if ( $methodNode->{NodeType} eq 'var' and $currentClassName eq $csharpClassName ) {
+ if ( $methodNode->{NodeType} eq 'var' and $classNode->{astNodeName} eq $mainClassNode->{astNodeName} ) {
my ($code, $interface, $proxyInterface) = generateVar( $classNode, $methodNode, $addImport );
$extraCode .= $code;
$interfaceCode .= $interface;
@@ -2844,7 +2890,7 @@
Iter::MembersByType ( $classNode, undef,
sub { my ($classNode, $methodNode ) = @_;
- if ( $methodNode->{NodeType} eq 'property' and $currentClassName eq $csharpClassName ) {
+ if ( $methodNode->{NodeType} eq 'property' and $classNode->{astNodeName} eq $mainClassNode->{astNodeName} ) {
my ($code, $interface) = generateProperty( \%overridenMethods, $classNode, $methodNode, $addImport );
$extraCode .= $code;
}
More information about the Kde-bindings
mailing list