tools/pdbgen/pdbgen.pl some simplistic code to add a $deprecated flag to
2004-06-15 Manish Singh <yosh@gimp.org> * tools/pdbgen/pdbgen.pl * tools/pdbgen/lib.pl: some simplistic code to add a $deprecated flag to pdb definitions, which translates into GIMP_DISABLE_DEPRECATED guards in lib headers.
This commit is contained in:

committed by
Manish Singh

parent
8ab1ae98a3
commit
58dc763b63
@ -1,3 +1,10 @@
|
||||
2004-06-15 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* tools/pdbgen/pdbgen.pl
|
||||
* tools/pdbgen/lib.pl: some simplistic code to add a $deprecated
|
||||
flag to pdb definitions, which translates into GIMP_DISABLE_DEPRECATED
|
||||
guards in lib headers.
|
||||
|
||||
2004-06-15 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/actions/Makefile.am
|
||||
|
@ -432,7 +432,13 @@ CODE
|
||||
|
||||
my $proto = "$hrettype $wrapped$funcname ($arglist);\n";
|
||||
$proto =~ s/ +/ /g;
|
||||
if ($proc->{deprecated}) {
|
||||
push @{$out->{protos}}, "#ifndef GIMP_DISABLE_DEPRECATED\n";
|
||||
}
|
||||
push @{$out->{protos}}, $proto;
|
||||
if ($proc->{deprecated}) {
|
||||
push @{$out->{protos}}, "#endif /* GIMP_DISABLE_DEPRECATED */\n";
|
||||
}
|
||||
|
||||
my $clist = $arglist;
|
||||
my $padlen = length($wrapped) + length($funcname) + 2;
|
||||
@ -535,7 +541,12 @@ LGPL
|
||||
|
||||
my @longest = (0, 0, 0); my @arglist = (); my $seen = 0;
|
||||
foreach (@{$out->{protos}}) {
|
||||
my $len; my $arglist = [ split(' ', $_, 3) ];
|
||||
my $arglist;
|
||||
|
||||
if (!/^#/) {
|
||||
my $len;
|
||||
|
||||
$arglist = [ split(' ', $_, 3) ];
|
||||
|
||||
for (0..1) {
|
||||
$len = length($arglist->[$_]);
|
||||
@ -549,6 +560,10 @@ LGPL
|
||||
$seen = $num if $seen < $num;
|
||||
$longest[2] = $len if $longest[2] < $len;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$arglist = $_;
|
||||
}
|
||||
|
||||
push @arglist, $arglist;
|
||||
}
|
||||
@ -557,23 +572,38 @@ LGPL
|
||||
|
||||
@{$out->{protos}} = ();
|
||||
foreach (@arglist) {
|
||||
my $arg;
|
||||
|
||||
if (ref) {
|
||||
my ($type, $func, $arglist) = @$_;
|
||||
|
||||
my @args = split(/,/, $arglist); $arglist = "";
|
||||
|
||||
foreach (@args) {
|
||||
$space = rindex($_, ' ');
|
||||
my $len = $longest[2] - $space + 1;
|
||||
|
||||
$len -= scalar @{[ /\*/g ]};
|
||||
$len++ if /\t/;
|
||||
substr($_, $space, 1) = ' ' x $len if $space != -1 && $len > 1;
|
||||
|
||||
if ($space != -1 && $len > 1) {
|
||||
substr($_, $space, 1) = ' ' x $len;
|
||||
}
|
||||
|
||||
$arglist .= $_;
|
||||
$arglist .= "," if !/;\n$/;
|
||||
}
|
||||
my $arg = $type;
|
||||
|
||||
$arg = $type;
|
||||
$arg .= ' ' x ($longest[0] - length($type) + 1) . $func;
|
||||
$arg .= ' ' x ($longest[1] - length($func) + 1) . $arglist;
|
||||
$arg =~ s/\t/' ' x ($longest[0] + $longest[1] + 3)/eg;
|
||||
|
||||
while ($arg =~ /^\t* {8}/m) { $arg =~ s/^(\t*) {8}/$1\t/mg }
|
||||
}
|
||||
else {
|
||||
$arg = $_;
|
||||
}
|
||||
push @{$out->{protos}}, $arg;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ $evalcode = <<'CODE';
|
||||
|
||||
# Variables to evaluate and insert into the PDB structure
|
||||
my @procvars = qw($name $group $blurb $help $author $copyright $date $since
|
||||
@inargs @outargs %invoke);
|
||||
$deprecated @inargs @outargs %invoke);
|
||||
|
||||
# These are attached to the group structure
|
||||
my @groupvars = qw($desc @headers %extra);
|
||||
|
Reference in New Issue
Block a user