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:
parent
486c867726
commit
fe08134ba0
4 changed files with 45 additions and 6 deletions
|
@ -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>
|
2002-02-15 Mike Kestner <mkestner@speakeasy.net>
|
||||||
|
|
||||||
* generator/SignalHandler.cs : Create the SignalArgs.Args array and fix
|
* generator/SignalHandler.cs : Create the SignalArgs.Args array and fix
|
||||||
|
|
|
@ -190,7 +190,8 @@ namespace GtkSharp.Generation {
|
||||||
|
|
||||||
foreach (XmlNode parm in parms.ChildNodes) {
|
foreach (XmlNode parm in parms.ChildNodes) {
|
||||||
if (parm.Name != "parameter") {
|
if (parm.Name != "parameter") {
|
||||||
continue;
|
Console.Write(parm.Name + " node ");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
XmlElement elem = (XmlElement) parm;
|
XmlElement elem = (XmlElement) parm;
|
||||||
|
@ -294,6 +295,10 @@ namespace GtkSharp.Generation {
|
||||||
{
|
{
|
||||||
if (name == "string") {
|
if (name == "string") {
|
||||||
return "str1ng";
|
return "str1ng";
|
||||||
|
} else if (name == "event") {
|
||||||
|
return "evnt";
|
||||||
|
} else if (name == "object") {
|
||||||
|
return "objekt";
|
||||||
} else {
|
} else {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -383,8 +383,27 @@ sub addFuncElems
|
||||||
$mdef = delete $fdefs{$mname};
|
$mdef = delete $fdefs{$mname};
|
||||||
|
|
||||||
if (($mdef =~ /\((.*)\)/) && ($1 ne "void")) {
|
if (($mdef =~ /\((.*)\)/) && ($1 ne "void")) {
|
||||||
@parms = split(/,/, $1);
|
@parms = ();
|
||||||
($dump, @parms) = @params if $drop_1st;
|
$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) {
|
if (@parms > 0) {
|
||||||
addParamsElem($el, @parms);
|
addParamsElem($el, @parms);
|
||||||
}
|
}
|
||||||
|
@ -416,10 +435,19 @@ sub addParamsElem
|
||||||
my $parms_elem = $doc->createElement('parameters');
|
my $parms_elem = $doc->createElement('parameters');
|
||||||
$parent->appendChild($parms_elem);
|
$parent->appendChild($parms_elem);
|
||||||
foreach $parm (@params) {
|
foreach $parm (@params) {
|
||||||
$parm_elem = $doc->createElement('parameter');
|
|
||||||
$parms_elem->appendChild($parm_elem);
|
|
||||||
$parm =~ s/\s+(\*+)/\1 /g;
|
$parm =~ s/\s+(\*+)/\1 /g;
|
||||||
$parm =~ s/const\s+/const-/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 =~ /(\S+)\s+(\S+)/;
|
||||||
$parm_elem->setAttribute('type', $1);
|
$parm_elem->setAttribute('type', $1);
|
||||||
my $name = $2;
|
my $name = $2;
|
||||||
|
|
Loading…
Reference in a new issue