2002-02-17 Mike Kestner <mkestner@speakeasy.net>

* generator/StructBase.cs (MangleName): add object and event.
	* parser/gapi2xml.pl : Handle embedded callback declarations in method
	  parameter lists.

svn path=/trunk/gtk-sharp/; revision=2462
This commit is contained in:
Mike Kestner 2002-02-17 20:54:54 +00:00
parent 486c867726
commit fe08134ba0
4 changed files with 45 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2002-02-17 Mike Kestner <mkestner@speakeasy.net>
* generator/StructBase.cs (MangleName): add object and event.
* parser/gapi2xml.pl : Handle embedded callback declarations in method
parameter lists.
2002-02-15 Mike Kestner <mkestner@speakeasy.net>
* generator/SignalHandler.cs : Create the SignalArgs.Args array and fix

View file

@ -190,7 +190,8 @@ namespace GtkSharp.Generation {
foreach (XmlNode parm in parms.ChildNodes) {
if (parm.Name != "parameter") {
continue;
Console.Write(parm.Name + " node ");
return false;
}
XmlElement elem = (XmlElement) parm;
@ -294,6 +295,10 @@ namespace GtkSharp.Generation {
{
if (name == "string") {
return "str1ng";
} else if (name == "event") {
return "evnt";
} else if (name == "object") {
return "objekt";
} else {
return name;
}

File diff suppressed because one or more lines are too long

View file

@ -383,8 +383,27 @@ sub addFuncElems
$mdef = delete $fdefs{$mname};
if (($mdef =~ /\((.*)\)/) && ($1 ne "void")) {
@parms = split(/,/, $1);
($dump, @parms) = @params if $drop_1st;
@parms = ();
$parm = "";
$pcnt = 0;
foreach $char (split(//, $1)) {
if ($char eq "(") {
$pcnt++;
} elsif ($char eq ")") {
$pcnt--;
} elsif (($pcnt == 0) && ($char eq ",")) {
@parms = (@parms, $parm);
$parm = "";
next;
}
$parm .= $char;
}
if ($parm) {
@parms = (@parms, $parm);
}
# @parms = split(/,/, $1);
($dump, @parms) = @parms if $drop_1st;
if (@parms > 0) {
addParamsElem($el, @parms);
}
@ -416,10 +435,19 @@ sub addParamsElem
my $parms_elem = $doc->createElement('parameters');
$parent->appendChild($parms_elem);
foreach $parm (@params) {
$parm_elem = $doc->createElement('parameter');
$parms_elem->appendChild($parm_elem);
$parm =~ s/\s+(\*+)/\1 /g;
$parm =~ s/const\s+/const-/g;
if ($parm =~ /(.*)\(\s*\**\s*(\w+)\)\s+\((.*)\)/) {
my $ret = $1; my $cbn = $2; my $params = $3;
$cb_elem = addNameElem($parms_elem, 'callback', $cbn);
addReturnElem($cb_elem, $ret);
if ($params && ($params ne "void")) {
addParamsElem($cb_elem, split(/,/, $params));
}
next;
}
$parm_elem = $doc->createElement('parameter');
$parms_elem->appendChild($parm_elem);
$parm =~ /(\S+)\s+(\S+)/;
$parm_elem->setAttribute('type', $1);
my $name = $2;