2002-01-07 Mike Kestner <mkestner@speakeasy.net>

* generator/ObjectGen.cs : Make parent debug statement more helpful.
	* generator/Parser.cs : Add interface element case.
	* parser/gapi2xml.pl : Add interface types.
	* parser/gapi_pp.pl : Grab G_TYPE_INSTANCE_GET_INTERFACE defines. Grab
	  struct declarations out of private headers.

svn path=/trunk/gtk-sharp/; revision=1904
This commit is contained in:
Mike Kestner 2002-01-07 23:30:01 +00:00
parent 8648757e19
commit e33710f1c3
6 changed files with 39 additions and 5 deletions

View file

@ -1,3 +1,11 @@
2002-01-07 Mike Kestner <mkestner@speakeasy.net>
* generator/ObjectGen.cs : Make parent debug statement more helpful.
* generator/Parser.cs : Add interface element case.
* parser/gapi2xml.pl : Add interface types.
* parser/gapi_pp.pl : Grab G_TYPE_INSTANCE_GET_INTERFACE defines. Grab
struct declarations out of private headers.
2002-01-06 Mike Kestner <mkestner@speakeasy.net> 2002-01-06 Mike Kestner <mkestner@speakeasy.net>
* */makefile : Add atk to the build. * */makefile : Add atk to the build.

View file

@ -74,7 +74,7 @@ namespace GtkSharp.Generation {
sw.Write ("\tpublic class " + Name); sw.Write ("\tpublic class " + Name);
if (cs_parent == "") { if (cs_parent == "") {
sw.WriteLine (" {"); sw.WriteLine (" {");
Console.WriteLine ("Unknown type " + parent); Console.WriteLine ("Object " + Name + " Unknown parent " + parent);
} else { } else {
sw.WriteLine (" : " + cs_parent + " {"); sw.WriteLine (" : " + cs_parent + " {");
} }

View file

@ -80,6 +80,9 @@ namespace GtkSharp.Generation {
table.AddType (new EnumGen (ns_name, elem)); table.AddType (new EnumGen (ns_name, elem));
break; break;
case "interface":
break;
case "object": case "object":
table.AddType (new ObjectGen (ns_name, elem)); table.AddType (new ObjectGen (ns_name, elem));
break; break;

File diff suppressed because one or more lines are too long

View file

@ -108,6 +108,8 @@ while ($line = <STDIN>) {
$objects{$1} = $2 . $objects{$1}; $objects{$1} = $2 . $objects{$1};
} elsif ($line =~ /GTK_CHECK_CLASS_CAST.*,\s*(\w+),\s*(\w+)/) { } elsif ($line =~ /GTK_CHECK_CLASS_CAST.*,\s*(\w+),\s*(\w+)/) {
$objects{$1} .= ":$2"; $objects{$1} .= ":$2";
} elsif ($line =~ /INSTANCE_GET_INTERFACE.*,\s*(\w+),\s*(\w+)/) {
$ifaces{$1} = $2;
} else { } else {
print $line; print $line;
} }
@ -183,6 +185,23 @@ foreach $cbname (sort(keys(%fpdefs))) {
} }
##############################################################
# Parse the interfaces list.
##############################################################
foreach $type (sort(keys(%ifaces))) {
$iface = $ifaces{$type};
($inst, $dontcare) = split(/:/, delete $objects{$type});
$ifacetype = delete $types{$iface};
delete $types{$inst};
$ifacecnt++;
$iface_el = addNameElem($ns_elem, 'interface', $inst, $ns);
addFuncElems($iface_el, $inst);
}
############################################################## ##############################################################
# Parse the classes by walking the objects list. # Parse the classes by walking the objects list.
############################################################## ##############################################################

View file

@ -15,7 +15,11 @@ foreach $dir (@ARGV) {
} }
foreach $fname (@hdrs) { foreach $fname (@hdrs) {
next if ($fname =~ /test|private|internals|gtktextlayout/);
if ($fname =~ /test|private|internals|gtktextlayout/) {
@privhdrs = (@privhdrs, $fname);
next;
}
open(INFILE, $fname) || die "Could open $fname\n"; open(INFILE, $fname) || die "Could open $fname\n";
@ -27,7 +31,7 @@ foreach $fname (@hdrs) {
if ($line =~ /#\s*define\s+\w+\s*\D+/) { if ($line =~ /#\s*define\s+\w+\s*\D+/) {
$def = $line; $def = $line;
while ($line =~ /\\\n/) {$def .= ($line = <INFILE>);} while ($line =~ /\\\n/) {$def .= ($line = <INFILE>);}
if ($def =~ /_CHECK_\w*CAST/) { if ($def =~ /_CHECK_\w*CAST|INSTANCE_GET_INTERFACE/) {
$def =~ s/\\\n//g; $def =~ s/\\\n//g;
print $def; print $def;
} }
@ -49,7 +53,7 @@ foreach $fname (@hdrs) {
} }
} }
foreach $fname (`ls $ARGV[0]/*.c`) { foreach $fname (`ls $ARGV[0]/*.c`, @privhdrs) {
open(INFILE, $fname) || die "Could open $fname\n"; open(INFILE, $fname) || die "Could open $fname\n";