[Kde-bindings] KDE/kdebindings/kalyptus
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Mon Dec 12 16:29:31 UTC 2005
SVN commit 487933 by rdale:
* Applied patch from Thomas Moenicke (thanks Thomas!) to parse Q_PROPERTY macros,
and add the info to the kalyptus AST.
CCMAIL: kde-bindings at kde.org
M +40 -2 kalyptus
--- trunk/KDE/kdebindings/kalyptus/kalyptus #487932:487933
@@ -109,7 +109,7 @@
# Supported formats
%formats = ( "java" => "kalyptusCxxToJava", "jni" => "kalyptusCxxToJNI",
"dcopidl" => "kalyptusCxxToDcopIDL",
- "smoke" => "kalyptusCxxToSmoke", "csharp" => "kalyptusCxxToCSharp", "kimono" => "kalyptusCxxToKimono",
+ "smoke" => "kalyptusCxxToSmoke", "csharp" => "kalyptusCxxToCSharp", "php" => "kalyptusCxxToPHP", "kimono" => "kalyptusCxxToKimono",
"ECMA" => "kalyptusCxxToECMA", "swig" => "kalyptusCxxToSwig",
"KDOMECMA" => "kalyptusKDOMEcma");
@@ -535,7 +535,7 @@
next if ( $p =~ /^\s*Q_ENUMS/ # ignore Q_ENUMS
|| $p =~ /^\s*Q_FLAGS/ # and Q_FLAGS
|| $p =~ /^\s*Q_DECLARE_FLAGS/ # and Q_DECLARE_FLAGS
- || $p =~ /^\s*Q_PROPERTY/ # and Q_PROPERTY
+# || $p =~ /^\s*Q_PROPERTY/ # and Q_PROPERTY
|| $p =~ /^\s*QDOC_PROPERTY/
|| $p =~ /^\s*Q_GADGET/
|| $p =~ /^\s*Q_OVERRIDE/ # and Q_OVERRIDE
@@ -722,6 +722,9 @@
$declNodeType = "c";
return $l;
}
+ elsif ( $l =~ /Q_PROPERTY/ ) { # property
+ return $l;
+ }
do {
$decl .= $l;
@@ -801,7 +804,12 @@
elsif ( $declNodeType eq "k" ) {
$cNode->AddProp( "DcopExported", 1 );
}
+ # properties
+ elsif ( $decl =~ s/Q_PROPERTY// ) {
+ print "Property: <$1>\n" if $debug;
+ $newNode = newProperty( $decl );
+ }
# Typedef struct/class
elsif ( $decl =~ /^\s*typedef
\s+(struct|union|class|enum)
@@ -1753,8 +1761,38 @@
return $node;
}
+=head2 newProperty
+ Parameters: property
+ Handles a property
+
+=cut
+
+sub newProperty
+{
+ my ( $property ) = @_;
+
+ $property =~ s/^\s+|\s+$//g;
+ my @items = split(/ /,$property);
+
+ do {
+ my ( $node ) = Ast::New( $items[1] );
+
+ $node->AddProp( "NodeType", "property" );
+ $node->AddProp( "type", $items[0] );
+ $node->AddProp( "READ", $items[3] );
+ $node->AddProp( "WRITE", $items[5] );
+ $node->AddProp( "NOTIFY", $items[7] );
+
+ $cNode->{KidAccess} = "public";
+ kdocAstUtil::attachChild( $cNode, $node );
+ return $node;
+
+ } if defined $items[1];
+}
+
+
=head2 show_usage
Display usage information and quit.
More information about the Kde-bindings
mailing list