2001-11-09 Mike Kestner <mkestner@speakeasy.net>

* codegen/defs-parse.pl : Now genning Window, AccelGroup, Bin, and
	GdkPixbuf classes to peel the csc error onion. Explicitly add GObject
	to the "exists ($objects{...})" branches, since GObject is a hard
	coded Class.

svn path=/trunk/gtk-sharp/; revision=1314
This commit is contained in:
Mike Kestner 2001-11-10 02:17:57 +00:00
parent 1351a509e6
commit 200f01ad2d
2 changed files with 12 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2001-11-09 Mike Kestner <mkestner@speakeasy.net>
* codegen/defs-parse.pl : Now genning Window, AccelGroup, Bin, and
GdkPixbuf classes to peel the csc error onion. Explicitly add GObject
to the "exists ($objects{...})" branches, since GObject is a hard
coded Class.
2001-11-08 Mike Kestner <mkestner@speakeasy.net> 2001-11-08 Mike Kestner <mkestner@speakeasy.net>
* codegen/defs-parse.pl : Build a structs hash and gen the structs * codegen/defs-parse.pl : Build a structs hash and gen the structs

View file

@ -70,7 +70,7 @@ foreach $key (keys (%structs)) {
} }
foreach $key (keys (%objects)) { foreach $key (keys (%objects)) {
next if ($key !~ /GtkWindow\b|GtkAccelGroup|GtkBin\b/); next if ($key !~ /GdkPixbuf\b|GtkWindow\b|GtkAccelGroup|GtkBin\b/);
gen_object (split (/\n/, $objects{$key})); gen_object (split (/\n/, $objects{$key}));
} }
@ -294,7 +294,7 @@ sub gen_prop ()
$cname = $1; $cname = $1;
$def =~ /prop-type "(\w+)/; $def =~ /prop-type "(\w+)/;
if (exists ($objects{$1})) { if (exists ($objects{$1}) || ($1 =~ /GObject/)) {
$sret = $maptypes{$1}; $sret = $maptypes{$1};
$mret = "GLib.Object"; $mret = "GLib.Object";
} elsif (exists ($maptypes{$1})) { } elsif (exists ($maptypes{$1})) {
@ -413,7 +413,7 @@ sub gen_method
$code .= "Marshal.PtrToStringAnsi($call)"; $code .= "Marshal.PtrToStringAnsi($call)";
} elsif ($mret eq "int") { } elsif ($mret eq "int") {
$code .= "($sret) $call"; $code .= "($sret) $call";
} elsif (exists ($objects{$ret})) { } elsif (exists ($objects{$ret}) || ($ret =~ /GObject/)) {
$code .= "($sret) GLib.Object.GetObject($call)"; $code .= "($sret) GLib.Object.GetObject($call)";
} else { } else {
die "Unexpected return type match $sret:$mret\n"; die "Unexpected return type match $sret:$mret\n";
@ -445,7 +445,8 @@ sub gen_param_strings
$sig .= "$maptypes{$ptype} $pname"; $sig .= "$maptypes{$ptype} $pname";
if ($maptypes{$ptype} eq $marshaltypes{$ptype}) { if ($maptypes{$ptype} eq $marshaltypes{$ptype}) {
$call .= "$pname"; $call .= "$pname";
} elsif (exists ($objects{$ptype})) { } elsif (exists ($objects{$ptype}) ||
($ptype =~ /GObject/)) {
$call .= "$pname.Handle"; $call .= "$pname.Handle";
} elsif ($ptype =~ /gchar/) { } elsif ($ptype =~ /gchar/) {
$call .= "Marshal.StringToHGlobalAnsi($pname)"; $call .= "Marshal.StringToHGlobalAnsi($pname)";