More stuff
-Yosh
This commit is contained in:
@ -41,6 +41,25 @@ sub quotewrap {
|
|||||||
$str;
|
$str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub format_code_frag {
|
||||||
|
my ($code, $indent) = @_;
|
||||||
|
|
||||||
|
chomp $code;
|
||||||
|
$code =~ s/\t/' ' x 8/eg;
|
||||||
|
|
||||||
|
if (!$indent && $code =~ /^\s*{\s*\n.*\n\s*}\s*$/s) {
|
||||||
|
$code =~ s/^\s*{\s*\n//s;
|
||||||
|
$code =~ s/\n\s*}\s*$//s;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$code =~ s/^/' ' x ($indent ? 4 : 2)/meg;
|
||||||
|
}
|
||||||
|
$code =~ s/^ {8}/\t/mg;
|
||||||
|
$code .= "\n";
|
||||||
|
|
||||||
|
$code;
|
||||||
|
}
|
||||||
|
|
||||||
sub declare_args {
|
sub declare_args {
|
||||||
my $proc = shift;
|
my $proc = shift;
|
||||||
my $out = shift;
|
my $out = shift;
|
||||||
@ -53,7 +72,7 @@ sub declare_args {
|
|||||||
foreach (@args) {
|
foreach (@args) {
|
||||||
my $arg = $arg_types{(&arg_parse($_->{type}))[0]};
|
my $arg = $arg_types{(&arg_parse($_->{type}))[0]};
|
||||||
|
|
||||||
if ($arg->{array} && (not exists $_->{array})) {
|
if ($arg->{array} && !exists $_->{array}) {
|
||||||
warn "Array without number of elements param in $proc->{name}";
|
warn "Array without number of elements param in $proc->{name}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,8 +83,8 @@ sub declare_args {
|
|||||||
}
|
}
|
||||||
$result .= ";\n";
|
$result .= ";\n";
|
||||||
|
|
||||||
if (exists $arg->{id_headers}) {
|
if (exists $arg->{headers}) {
|
||||||
foreach (@{$arg->{id_headers}}) {
|
foreach (@{$arg->{headers}}) {
|
||||||
$out->{headers}->{$_}++;
|
$out->{headers}->{$_}++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,7 +95,7 @@ sub declare_args {
|
|||||||
$result;
|
$result;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub make_args {
|
sub make_arg_recs {
|
||||||
my $proc = shift;
|
my $proc = shift;
|
||||||
|
|
||||||
my $result = "";
|
my $result = "";
|
||||||
@ -86,8 +105,7 @@ sub make_args {
|
|||||||
my @args = @{$proc->{$_}} if exists $proc->{$_};
|
my @args = @{$proc->{$_}} if exists $proc->{$_};
|
||||||
|
|
||||||
if (scalar @args) {
|
if (scalar @args) {
|
||||||
$result .= "\nstatic ProcArg $proc->{name}_${_}[] =";
|
$result .= "\nstatic ProcArg $proc->{name}_${_}[] =\n{\n";
|
||||||
$result .= "\n{\n";
|
|
||||||
|
|
||||||
foreach $arg (@{$proc->{$_}}) {
|
foreach $arg (@{$proc->{$_}}) {
|
||||||
my ($type, $name, @remove) = &arg_parse($arg->{type});
|
my ($type, $name, @remove) = &arg_parse($arg->{type});
|
||||||
@ -115,7 +133,7 @@ sub make_args {
|
|||||||
CODE
|
CODE
|
||||||
}
|
}
|
||||||
|
|
||||||
$result =~ s/,\n$/\n/;
|
$result =~ s/,\n$/\n/s;
|
||||||
$result .= "};\n";
|
$result .= "};\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,11 +142,10 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub marshal_inargs {
|
sub marshal_inargs {
|
||||||
my $proc = shift;
|
my ($proc, $argc) = @_;
|
||||||
|
|
||||||
my $result = "";
|
my $result = "";
|
||||||
my %decls;
|
my %decls;
|
||||||
my $argc = 0;
|
|
||||||
|
|
||||||
my @inargs = @{$proc->{inargs}} if exists $proc->{inargs};
|
my @inargs = @{$proc->{inargs}} if exists $proc->{inargs};
|
||||||
|
|
||||||
@ -139,19 +156,28 @@ sub marshal_inargs {
|
|||||||
my $var = &arg_vname($_);
|
my $var = &arg_vname($_);
|
||||||
|
|
||||||
if (exists $arg->{id_func}) {
|
if (exists $arg->{id_func}) {
|
||||||
my $test = exists $_->{on_success} ? '!=' : '==';
|
|
||||||
|
|
||||||
$result .= <<CODE;
|
$result .= <<CODE;
|
||||||
if (($var = $arg->{id_func} (args[$argc].value.pdb_$type)) $test NULL)
|
$var = $arg->{id_func} (args[$argc].value.pdb_$type);
|
||||||
CODE
|
CODE
|
||||||
|
|
||||||
$result .= <<CODE if exists $_->{on_success};
|
if (!exists $_->{no_success}) {
|
||||||
$_->{on_success}
|
$result .= ' ' x 2 . "if ($var ";
|
||||||
else
|
$result .= exists $_->{on_success} ? '!=' : '==';
|
||||||
CODE
|
$result .= " NULL)\n";
|
||||||
$result .= ' ' x 4 . "success = FALSE;\n";
|
|
||||||
|
|
||||||
$success = 1;
|
if (exists $_->{on_success}) {
|
||||||
|
$result .= &format_code_frag($_->{on_success}, 1);
|
||||||
|
$result .= ' ' x 2 . "else\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$result .= ' ' x 4 . "success = FALSE;\n";
|
||||||
|
|
||||||
|
if (exists $_->{on_fail}) {
|
||||||
|
$result .= &format_code_frag($_->{on_fail}, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$success = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my $code = ' ' x 2 . "$var =";
|
my $code = ' ' x 2 . "$var =";
|
||||||
@ -218,21 +244,35 @@ CODE
|
|||||||
|
|
||||||
$code .= "$extra;\n";
|
$code .= "$extra;\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($code =~ /success/) {
|
if ($code =~ /success/) {
|
||||||
if ($success) {
|
my $tests = 0;
|
||||||
$code =~ s/^/' ' x 4/meg;
|
|
||||||
$code =~ s/^ {8}/\t/mg;
|
|
||||||
|
|
||||||
$code .= ' ' x 4 . "}\n";
|
if (exists $_->{on_success}) {
|
||||||
$result .= ' ' x 2 . "if (success)\n" . ' ' x 4 . "{\n";
|
$code .= ' ' x 2 . "if (success)\n";
|
||||||
|
$code .= &format_code_frag($_->{on_success}, 1);
|
||||||
|
$tests++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exists $_->{on_fail}) {
|
||||||
|
$code .= ' ' x 2;
|
||||||
|
$code .= $tests ? "else\n" : "if (success)\n";
|
||||||
|
$code .= &format_code_frag($_->{on_fail}, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($success) {
|
||||||
|
$code =~ s/^/' ' x 4/meg;
|
||||||
|
$code =~ s/^ {8}/\t/mg;
|
||||||
|
|
||||||
|
$code .= ' ' x 4 . "}\n";
|
||||||
|
$result .= ' ' x 2 . "if (success)\n" . ' ' x 4 . "{\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$success_init = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$success = 1;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$success_init = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$success = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$result .= $code;
|
$result .= $code;
|
||||||
@ -324,51 +364,128 @@ CODE
|
|||||||
$out->{code} .= "\nstatic Argument *\n";
|
$out->{code} .= "\nstatic Argument *\n";
|
||||||
$out->{code} .= "${name}_invoker (Argument *args)\n{\n";
|
$out->{code} .= "${name}_invoker (Argument *args)\n{\n";
|
||||||
|
|
||||||
my $invoker = "";
|
my $code = "";
|
||||||
$invoker .= ' ' x 2 . "Argument *return_args;\n" if scalar @outargs;
|
|
||||||
$invoker .= &declare_args($proc, $out, qw(inargs outargs));
|
|
||||||
|
|
||||||
if (exists $proc->{invoke}->{vars}) {
|
if (exists $proc->{invoke}->{pass_through}) {
|
||||||
foreach (@{$proc->{invoke}->{vars}}) {
|
my $invoke = $proc->{invoke};
|
||||||
$invoker .= ' ' x 2 . $_ . ";\n";
|
|
||||||
|
my $argc = 0;
|
||||||
|
$argc += @{$invoke->{pass_args}} if exists $invoke->{pass_args};
|
||||||
|
$argc += @{$invoke->{make_args}} if exists $invoke->{make_args};
|
||||||
|
|
||||||
|
my %pass; my @passgroup;
|
||||||
|
my $before = 0; my $contig = 0; my $pos = -1;
|
||||||
|
if (exists $invoke->{pass_args}) {
|
||||||
|
foreach (@{$invoke->{pass_args}}) {
|
||||||
|
$pass{$_}++;
|
||||||
|
$_ - 1 == $before ? $contig = 1 : $pos++;
|
||||||
|
push @{$passgroup[$pos]}, $_;
|
||||||
|
$before = $_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$code .= ' ' x 2 . "int i;\n" if $contig;
|
||||||
|
|
||||||
|
$code .= ' ' x 2 . "Argument argv[$argc];\n";
|
||||||
|
|
||||||
|
my $tempproc; $pos = 0;
|
||||||
|
foreach (@{$proc->{inargs}}) {
|
||||||
|
$_->{argpos} = $pos++;
|
||||||
|
push @{$tempproc->{inargs}}, $_ if !exists $pass{$_->{argpos}};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$invoker.= &marshal_inargs($proc);
|
$code .= &declare_args($tempproc, $out, qw(inargs)) . "\n";
|
||||||
|
|
||||||
$invoker .= "\n" if $invoker && $invoker !~ /\n\n/s;
|
my $marshal = "";
|
||||||
|
foreach (@{$tempproc->{inargs}}) {
|
||||||
|
my $argproc; $argproc->{inargs} = [ $_ ];
|
||||||
|
$marshal .= &marshal_inargs($argproc, $_->{argpos});
|
||||||
|
}
|
||||||
|
|
||||||
my $code = $proc->{invoke}->{code};
|
if ($success) {
|
||||||
|
$marshal .= <<CODE;
|
||||||
|
if (!success)
|
||||||
|
return procedural_db_return_args (\&${name}_proc, FALSE);
|
||||||
|
|
||||||
chomp $code;
|
CODE
|
||||||
$code =~ s/\t/' ' x 8/eg;
|
}
|
||||||
|
|
||||||
if ($code =~ /^\s*\{\s*\n.*\n\s*\}\s*$/s && !$success) {
|
$marshal = substr($marshal, 1) if $marshal;
|
||||||
$code =~ s/^\s*\{\s*\n//s;
|
$code .= $marshal;
|
||||||
$code =~ s/\n\s*}\s*$//s;
|
|
||||||
|
foreach (@passgroup) {
|
||||||
|
$code .= ($#$_ ? <<LOOP : <<CODE) . "\n";
|
||||||
|
for (i = $_->[0]; i < @{[ $_->[$#$_] + 1 ]}; i++)
|
||||||
|
argv[i] = args[i];
|
||||||
|
LOOP
|
||||||
|
argv[$_->[0]] = args[$_->[0]];
|
||||||
|
CODE
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exists $invoke->{make_args}) {
|
||||||
|
$pos = 0;
|
||||||
|
foreach (@{$invoke->{make_args}}) {
|
||||||
|
while (exists $pass{$pos}) { $pos++ }
|
||||||
|
|
||||||
|
my $arg = $arg_types{(&arg_parse($_->{type}))[0]};
|
||||||
|
my $type = &arg_ptype($arg);
|
||||||
|
|
||||||
|
$code .= <<CODE;
|
||||||
|
argv[$pos].arg_type = PDB_$arg->{name};
|
||||||
|
CODE
|
||||||
|
|
||||||
|
my $frag = $_->{code};
|
||||||
|
$frag =~ s/%%arg%%/"argv[$pos].value.pdb_$type"/e;
|
||||||
|
$code .= &format_code_frag($frag, 0);
|
||||||
|
|
||||||
|
$pos++;
|
||||||
|
}
|
||||||
|
$code .= "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$code .= <<CODE;
|
||||||
|
return $invoke->{pass_through}_invoker (argv);
|
||||||
|
}
|
||||||
|
CODE
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$code =~ s/^/' ' x 2/meg;
|
my $invoker = "";
|
||||||
$code =~ s/^/' ' x 2/meg if $success;
|
|
||||||
}
|
$invoker .= ' ' x 2 . "Argument *return_args;\n" if scalar @outargs;
|
||||||
$code =~ s/^ {8}/\t/mg;
|
$invoker .= &declare_args($proc, $out, qw(inargs outargs));
|
||||||
|
|
||||||
$code = ' ' x 2 . "if (success)\n" . $code if $success;
|
if (exists $proc->{invoke}->{vars}) {
|
||||||
$success = ($code =~ /success =/) unless $success;
|
foreach (@{$proc->{invoke}->{vars}}) {
|
||||||
|
$invoker .= ' ' x 2 . $_ . ";\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$invoker .= &marshal_inargs($proc, 0);
|
||||||
|
|
||||||
|
$invoker .= "\n" if $invoker && $invoker !~ /\n\n/s;
|
||||||
|
|
||||||
|
my $frag = &format_code_frag($proc->{invoke}->{code}, $success);
|
||||||
|
|
||||||
|
$frag = ' ' x 2 . "if (success)\n" . $frag if $success;
|
||||||
|
$success = ($frag =~ /success =/) unless $success;
|
||||||
|
|
||||||
|
$code .= $invoker . $frag;
|
||||||
|
$code .= "\n" if $frag =~ /\n\n/s || $invoker;
|
||||||
|
$code .= &marshal_outargs($proc) . "}\n";
|
||||||
|
}
|
||||||
|
|
||||||
if ($success) {
|
if ($success) {
|
||||||
$success_init = 0 if $proc->{invoke}->{success} eq 'NONE';
|
$success_init = 0 if $proc->{invoke}->{success} eq 'NONE';
|
||||||
|
|
||||||
$out->{code} .= ' ' x 2 . "gboolean success";
|
my $header = ' ' x 2 . "gboolean success";
|
||||||
$out->{code} .= " = $proc->{invoke}->{success}" if $success_init;
|
$header .= " = $proc->{invoke}->{success}" if $success_init;
|
||||||
$out->{code} .= ";\n";
|
$header .= ";\n";
|
||||||
|
|
||||||
|
$out->{code} .= $header;
|
||||||
}
|
}
|
||||||
|
|
||||||
$out->{code} .= $invoker . $code . "\n";
|
$out->{code} .= $code;
|
||||||
$out->{code} .= "\n" if $code =~ /\n/s || $invoker;
|
|
||||||
$out->{code} .= &marshal_outargs($proc) . "}\n";
|
|
||||||
|
|
||||||
$out->{code} .= &make_args($proc, qw(inargs outargs));
|
$out->{code} .= &make_arg_recs($proc, qw(inargs outargs));
|
||||||
|
|
||||||
$out->{code} .= <<CODE;
|
$out->{code} .= <<CODE;
|
||||||
|
|
||||||
|
@ -18,12 +18,24 @@
|
|||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
$srcdir = '.';
|
||||||
$destdir = '.';
|
$destdir = '.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use lib $srcdir;
|
||||||
|
|
||||||
use Text::Wrap qw(wrap $columns);
|
use Text::Wrap qw(wrap $columns);
|
||||||
$columns = 79;
|
$columns = 79;
|
||||||
|
|
||||||
|
require 'util.pl';
|
||||||
|
|
||||||
|
eval <<'CODE';
|
||||||
|
*write_file = \&Gimp::CodeGen::util::write_file;
|
||||||
|
*FILE_EXT = \$Gimp::CodeGen::util::FILE_EXT;
|
||||||
|
CODE
|
||||||
|
|
||||||
|
$FILE_EXT = $FILE_EXT;
|
||||||
|
|
||||||
my $header = <<'HEADER';
|
my $header = <<'HEADER';
|
||||||
:# The GIMP -- an image manipulation program
|
:# The GIMP -- an image manipulation program
|
||||||
:# Copyright (C) 1999 Manish Singh <yosh@gimp.org>
|
:# Copyright (C) 1999 Manish Singh <yosh@gimp.org>
|
||||||
@ -188,6 +200,8 @@ ENTRY
|
|||||||
|
|
||||||
$code =~ s/,\n$/\n/s;
|
$code =~ s/,\n$/\n/s;
|
||||||
|
|
||||||
open OUTFILE, "> $destdir/enums.pl";
|
$outfile = "$destdir/enums.pl$FILE_EXT";
|
||||||
|
open OUTFILE, "> $outfile";
|
||||||
print OUTFILE $header, $code, $footer;
|
print OUTFILE $header, $code, $footer;
|
||||||
close OUTFILE;
|
close OUTFILE;
|
||||||
|
&write_file($outfile);
|
||||||
|
@ -29,6 +29,18 @@ package Gimp::CodeGen::enums;
|
|||||||
WEB_PALETTE => '2',
|
WEB_PALETTE => '2',
|
||||||
MONO_PALETTE => '3',
|
MONO_PALETTE => '3',
|
||||||
CUSTOM_PALETTE => '4' }
|
CUSTOM_PALETTE => '4' }
|
||||||
|
},
|
||||||
|
ChannelOffsetType =>
|
||||||
|
{ contig => 1,
|
||||||
|
symbols => [ qw(OFFSET_BACKGROUND OFFSET_TRANSPARENT) ],
|
||||||
|
mapping => { OFFSET_BACKGROUND => '0',
|
||||||
|
OFFSET_TRANSPARENT => '1' }
|
||||||
|
},
|
||||||
|
SizeType =>
|
||||||
|
{ contig => 1,
|
||||||
|
symbols => [ qw(PIXELS POINTS) ],
|
||||||
|
mapping => { PIXELS => '0',
|
||||||
|
POINTS => '1' }
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
|
|
||||||
# Modify this list for the groups to parse in the pdb directory
|
# Modify this list for the groups to parse in the pdb directory
|
||||||
@groups = qw(gdisplay edit floating_sel undo palette gradient
|
@groups = qw(gdisplay edit floating_sel undo palette gradient
|
||||||
convert);
|
convert channel_ops text gimprc parasite);
|
||||||
|
@ -138,7 +138,7 @@ CODE
|
|||||||
$return_marshal = "" unless $once++;
|
$return_marshal = "" unless $once++;
|
||||||
|
|
||||||
if (exists $_->{num}) {
|
if (exists $_->{num}) {
|
||||||
if (not exists $_->{no_lib}) {
|
if (!exists $_->{no_lib}) {
|
||||||
$arglist .= "gint \*$_->{name}, ";
|
$arglist .= "gint \*$_->{name}, ";
|
||||||
push @arraynums, $_;
|
push @arraynums, $_;
|
||||||
}
|
}
|
||||||
|
@ -35,34 +35,37 @@ package Gimp::CodeGen::pdb;
|
|||||||
|
|
||||||
display => { name => 'DISPLAY',
|
display => { name => 'DISPLAY',
|
||||||
type => 'GDisplay *',
|
type => 'GDisplay *',
|
||||||
|
headers => [ qw("gdisplay.h") ],
|
||||||
id_func => 'gdisplay_get_ID',
|
id_func => 'gdisplay_get_ID',
|
||||||
id_ret_func => '$var->ID',
|
id_ret_func => '$var->ID' },
|
||||||
id_headers => [ qw("gdisplay.h") ] },
|
|
||||||
image => { name => 'IMAGE',
|
image => { name => 'IMAGE',
|
||||||
type => 'GimpImage *',
|
type => 'GimpImage *',
|
||||||
|
headers => [ qw("procedural_db.h") ],
|
||||||
id_func => 'pdb_id_to_image',
|
id_func => 'pdb_id_to_image',
|
||||||
id_ret_func => 'pdb_image_to_id ($var)',
|
id_ret_func => 'pdb_image_to_id ($var)' },
|
||||||
id_headers => [ qw("procedural_db.h") ] },
|
|
||||||
layer => { name => 'LAYER',
|
layer => { name => 'LAYER',
|
||||||
type => 'GimpLayer *',
|
type => 'GimpLayer *',
|
||||||
|
headers => [ qw("drawable.h" "layer.h") ],
|
||||||
id_func => 'layer_get_ID',
|
id_func => 'layer_get_ID',
|
||||||
id_ret_func => 'drawable_ID (GIMP_DRAWABLE ($var))',
|
id_ret_func => 'drawable_ID (GIMP_DRAWABLE ($var))' },
|
||||||
id_headers => [ qw("drawable.h" "layer.h") ] },
|
|
||||||
channel => { name => 'CHANNEL',
|
channel => { name => 'CHANNEL',
|
||||||
type => 'Channel *',
|
type => 'Channel *',
|
||||||
|
headers => [ qw("drawable.h" "channel.h") ],
|
||||||
id_func => 'channel_get_ID',
|
id_func => 'channel_get_ID',
|
||||||
id_ret_func => 'drawable_ID (GIMP_DRAWABLE ($var))',
|
id_ret_func => 'drawable_ID (GIMP_DRAWABLE ($var))' },
|
||||||
id_headers => [ qw("drawable.h" "channel.h") ] },
|
|
||||||
drawable => { name => 'DRAWABLE',
|
drawable => { name => 'DRAWABLE',
|
||||||
type => 'GimpDrawable *',
|
type => 'GimpDrawable *',
|
||||||
|
headers => [ qw("drawable.h") ],
|
||||||
id_func => 'gimp_drawable_get_ID',
|
id_func => 'gimp_drawable_get_ID',
|
||||||
id_ret_func => 'drawable_ID (GIMP_DRAWABLE ($var))',
|
id_ret_func => 'drawable_ID (GIMP_DRAWABLE ($var))' },
|
||||||
id_headers => [ qw("drawable.h") ] },
|
|
||||||
selection => { name => 'SELECTION',
|
selection => { name => 'SELECTION',
|
||||||
type => 'Channel *',
|
type => 'Channel *',
|
||||||
|
headers => [ qw("drawable.h" "channel.h") ],
|
||||||
id_func => 'channel_get_ID',
|
id_func => 'channel_get_ID',
|
||||||
id_ret_func => 'drawable_ID (GIMP_DRAWABLE ($var))',
|
id_ret_func => 'drawable_ID (GIMP_DRAWABLE ($var))' },
|
||||||
id_headers => [ qw("drawable.h" "channel.h") ] },
|
|
||||||
|
parasite => { name => 'PARASITE', type => 'Parasite *',
|
||||||
|
headers => [ qw("libgimp/parasite.h") ] },
|
||||||
|
|
||||||
boundary => { name => 'BOUNDARY', type => 'gpointer ' }, # ??? FIXME
|
boundary => { name => 'BOUNDARY', type => 'gpointer ' }, # ??? FIXME
|
||||||
path => { name => 'PATH' , type => 'gpointer ' }, # ??? FIXME
|
path => { name => 'PATH' , type => 'gpointer ' }, # ??? FIXME
|
||||||
@ -97,11 +100,9 @@ sub arg_parse {
|
|||||||
|
|
||||||
return @retvals;
|
return @retvals;
|
||||||
}
|
}
|
||||||
elsif ($arg =~ /^([+-.\d].*?)? \s*
|
elsif ($arg =~ /^(?:([+-.\d].*?) \s* (<=|<))?
|
||||||
(<=|<)? \s*
|
\s* (\w+) \s*
|
||||||
(\w+) \s*
|
(?:(<=|<) \s* ([+-.\d].*?))?
|
||||||
(<=|<)? \s*
|
|
||||||
([\d\.-].*?)?
|
|
||||||
/x) {
|
/x) {
|
||||||
return ($3, $1, $2 ? $testmap{$2} : $2, $5, $4 ? $testmap{$4} : $4);
|
return ($3, $1, $2 ? $testmap{$2} : $2, $5, $4 ? $testmap{$4} : $4);
|
||||||
}
|
}
|
||||||
@ -115,7 +116,7 @@ sub arg_ptype {
|
|||||||
elsif ($arg->{type} =~ /\*/) { 'pointer' }
|
elsif ($arg->{type} =~ /\*/) { 'pointer' }
|
||||||
elsif ($arg->{type} =~ /boolean/) { 'int' }
|
elsif ($arg->{type} =~ /boolean/) { 'int' }
|
||||||
elsif ($arg->{type} =~ /int/) { 'int' }
|
elsif ($arg->{type} =~ /int/) { 'int' }
|
||||||
elsif ($arg->{type} =~ /float/) { 'float' }
|
elsif ($arg->{type} =~ /double/) { 'float' }
|
||||||
else { 'pointer' }
|
else { 'pointer' }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ HELP
|
|||||||
desc => 'The drawable to offset' },
|
desc => 'The drawable to offset' },
|
||||||
{ name => 'wrap_around', type => 'boolean',
|
{ name => 'wrap_around', type => 'boolean',
|
||||||
desc => 'wrap image around or fill vacated regions' },
|
desc => 'wrap image around or fill vacated regions' },
|
||||||
{ name => 'fill_type', type => 'enum GimpOffsetType',
|
{ name => 'fill_type', type => 'enum ChannelOffsetType',
|
||||||
desc => 'fill vacated regions of drawable with background or
|
desc => 'fill vacated regions of drawable with background or
|
||||||
transparent: %%desc%%' },
|
transparent: %%desc%%' },
|
||||||
{ name => 'offset_x', type => 'int32',
|
{ name => 'offset_x', type => 'int32',
|
||||||
@ -48,7 +48,7 @@ HELP
|
|||||||
);
|
);
|
||||||
|
|
||||||
%invoke = (
|
%invoke = (
|
||||||
headers => [ qw(channel_ops.h) ],
|
headers => [ qw("channel_ops.h") ],
|
||||||
vars => ['GimpImage *gimage'],
|
vars => ['GimpImage *gimage'],
|
||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ HELP
|
|||||||
if (gimage->layers == NULL)
|
if (gimage->layers == NULL)
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
else
|
else
|
||||||
success = ((gdisp = gdisplay_new (gimage, scale)) != NULL);
|
success = (gdisp = gdisplay_new (gimage, scale)) != NULL;
|
||||||
}
|
}
|
||||||
CODE
|
CODE
|
||||||
);
|
);
|
||||||
|
@ -47,7 +47,7 @@ HELP
|
|||||||
if (gimage->layers == NULL)
|
if (gimage->layers == NULL)
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
else
|
else
|
||||||
success = ((gdisp = gdisplay_new (gimage, scale)) != NULL);
|
success = (gdisp = gdisplay_new (gimage, scale)) != NULL;
|
||||||
}
|
}
|
||||||
CODE
|
CODE
|
||||||
);
|
);
|
||||||
|
64
tools/pdbgen/pdb/gimprc.pdb
Normal file
64
tools/pdbgen/pdb/gimprc.pdb
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# The GIMP -- an image manipulation program
|
||||||
|
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
|
# The defs
|
||||||
|
|
||||||
|
sub gimprc_query {
|
||||||
|
$blurb = <<'BLURB';
|
||||||
|
Queries the gimprc file parser for information on a specified token.
|
||||||
|
BLURB
|
||||||
|
|
||||||
|
$help = <<'HELP';
|
||||||
|
This procedure is used to locate additional information contained in the gimprc
|
||||||
|
file considered extraneous to the operation of the GIMP. Plug-ins that need
|
||||||
|
configuration information can expect it will be stored in the user's gimprc
|
||||||
|
file and can use this procedure to retrieve it. This query procedure will
|
||||||
|
return the value associated with the specified token. This corresponds _only_
|
||||||
|
to entries with the format: (<token> <value>). The value must be a string.
|
||||||
|
Entries not corresponding to this format will cause warnings to be issued on
|
||||||
|
gimprc parsing a nd will not be queryable.
|
||||||
|
HELP
|
||||||
|
|
||||||
|
&std_pdb_misc;
|
||||||
|
$date = '1997';
|
||||||
|
|
||||||
|
@inargs = (
|
||||||
|
{ name => 'token', type => 'string',
|
||||||
|
desc => 'The token to query for' }
|
||||||
|
);
|
||||||
|
|
||||||
|
@outargs = (
|
||||||
|
{ name => 'value', type => 'string',
|
||||||
|
desc => 'The value associated with the queried token',
|
||||||
|
alias => 'g_strdup (value)', no_declare => 1 }
|
||||||
|
);
|
||||||
|
|
||||||
|
%invoke = (
|
||||||
|
headers => [ qw("gimprc.h") ],
|
||||||
|
vars => ['gchar *value'],
|
||||||
|
code => 'success = (value = gimprc_find_token (token)) != NULL;'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@procs = qw(gimprc_query);
|
||||||
|
%exports = (app => [@procs]);
|
||||||
|
|
||||||
|
$desc = 'Gimprc procedures';
|
||||||
|
|
||||||
|
1;
|
@ -36,7 +36,7 @@ HELP
|
|||||||
|
|
||||||
@inargs = (
|
@inargs = (
|
||||||
{ name => 'name', type => 'string',
|
{ name => 'name', type => 'string',
|
||||||
desc => 'The gradient name ("" means current active gradient)' }
|
desc => 'The gradient name ("" means current active gradient)' },
|
||||||
{ name => 'sample_size', type => '0 < int32 < 10000',
|
{ name => 'sample_size', type => '0 < int32 < 10000',
|
||||||
desc => 'The size of the sample to return when the gradient is
|
desc => 'The size of the sample to return when the gradient is
|
||||||
changed $desc',
|
changed $desc',
|
||||||
|
@ -161,7 +161,7 @@ Fill the area specified either by the current selection if there is one, or by
|
|||||||
a seed fill starting at the specified coordinates.
|
a seed fill starting at the specified coordinates.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool requires information on the paint application mode, and the fill
|
This tool requires information on the paint application mode, and the fill
|
||||||
mode, which can either be in the foreground color, or in the currently active
|
mode, which can either be in the foreground color, or in the currently active
|
||||||
pattern. If there is no selection, a seed fill is executed at the specified
|
pattern. If there is no selection, a seed fill is executed at the specified
|
||||||
@ -172,12 +172,12 @@ the composite image will be used instead of that for the specified drawable.
|
|||||||
This is equivalent to sampling for colors after merging all visible layers. In
|
This is equivalent to sampling for colors after merging all visible layers. In
|
||||||
the case of merged sampling, the x,y coordinates are relative to the image's
|
the case of merged sampling, the x,y coordinates are relative to the image's
|
||||||
origin; otherwise, they are relative to the drawable's origin.
|
origin; otherwise, they are relative to the drawable's origin.
|
||||||
HELP;
|
HELP
|
||||||
|
|
||||||
&std_pdb_misc;
|
&std_pdb_misc;
|
||||||
|
|
||||||
my $validity = 'This parameter is only valid when there is no selection in
|
my $validity = 'This parameter is only valid when there is no selection in
|
||||||
the specified image.'
|
the specified image.';
|
||||||
my $coord = "The \$a coordinate of this bucket fill's application.
|
my $coord = "The \$a coordinate of this bucket fill's application.
|
||||||
$validity";
|
$validity";
|
||||||
|
|
||||||
@ -187,16 +187,16 @@ HELP;
|
|||||||
desc => 'The type of fill: %%desc%%' },
|
desc => 'The type of fill: %%desc%%' },
|
||||||
{ name => paint_mode, type => 'enum PaintMode',
|
{ name => paint_mode, type => 'enum PaintMode',
|
||||||
desc => 'The paint application mode: %%desc%%' },
|
desc => 'The paint application mode: %%desc%%' },
|
||||||
{ name => opacity, type => '0 <= float <= 100',
|
{ name => 'opacity', type => '0 <= float <= 100',
|
||||||
desc => 'The opacity of the final bucket fill %%desc%%' },
|
desc => 'The opacity of the final bucket fill %%desc%%' },
|
||||||
{ name => threshold, type => '0 <= float <= 255',
|
{ name => 'threshold', type => '0 <= float <= 255',
|
||||||
desc => "The threshold determines how extensive the seed fill will
|
desc => "The threshold determines how extensive the seed fill will
|
||||||
be. It's value is specified in terms of intensity levels
|
be. It's value is specified in terms of intensity levels
|
||||||
%%desc%%. $validity" },
|
%%desc%%. $validity" },
|
||||||
&sample_merged_arg,
|
&sample_merged_arg,
|
||||||
{ name => x, type => 'float',
|
{ name => 'x', type => 'float',
|
||||||
desc => eval qq/{\$a = 'x'; "$coord";}/ },
|
desc => eval qq/{\$a = 'x'; "$coord";}/ },
|
||||||
{ name => y, type => 'float',
|
{ name => 'y', type => 'float',
|
||||||
desc => eval qq/{\$a = 'y';"$coord";}/ }
|
desc => eval qq/{\$a = 'y';"$coord";}/ }
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -214,12 +214,12 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub by_color_select {
|
sub by_color_select {
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Create a selection by selecting all pixels (in the specified drawable) with the
|
Create a selection by selecting all pixels (in the specified drawable) with the
|
||||||
same (or similar) color to that specified.
|
same (or similar) color to that specified.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool creates a selection over the specified image. A by-color selection is
|
This tool creates a selection over the specified image. A by-color selection is
|
||||||
determined by the supplied color under the constraints of the specified
|
determined by the supplied color under the constraints of the specified
|
||||||
threshold. Essentially, all pixels (in the drawable) that have color
|
threshold. Essentially, all pixels (in the drawable) that have color
|
||||||
@ -260,11 +260,11 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub clone {
|
sub clone {
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Clone from the source to the dest drawable using the current brush
|
Clone from the source to the dest drawable using the current brush
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool clones (copies) from the source drawable starting at the specified
|
This tool clones (copies) from the source drawable starting at the specified
|
||||||
source coordinates to the dest drawable. If the "clone_type" argument is set
|
source coordinates to the dest drawable. If the "clone_type" argument is set
|
||||||
to PATTERN-CLONE, then the current pattern is used as the source and the
|
to PATTERN-CLONE, then the current pattern is used as the source and the
|
||||||
@ -373,7 +373,7 @@ HELP
|
|||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'pressure', type => '0 <= float <= 100',
|
{ name => 'pressure', type => '0 <= float <= 100',
|
||||||
desc => 'The pressure: %%desc%%' },
|
desc => 'The pressure: %%desc%%' },
|
||||||
{ name => 'convolve_type', type 'enum Convolve (no CUSTOM)',
|
{ name => 'convolve_type', type => 'enum Convolve (no CUSTOM)',
|
||||||
desc => 'Convolve type: %%desc%%' },
|
desc => 'Convolve type: %%desc%%' },
|
||||||
&stroke_arg
|
&stroke_arg
|
||||||
);
|
);
|
||||||
@ -479,7 +479,7 @@ HELP
|
|||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
&stroke_arg,
|
&stroke_arg,
|
||||||
{ name => 'hardness', type => 'enum EraserHardness',
|
{ name => 'hardness', type => 'enum EraserHardness',
|
||||||
desc => '%%desc%%' }
|
desc => '%%desc%%' },
|
||||||
{ name => 'method', type => 'enum EraserMethod',
|
{ name => 'method', type => 'enum EraserMethod',
|
||||||
desc => '%%desc%%' }
|
desc => '%%desc%%' }
|
||||||
);
|
);
|
||||||
@ -839,9 +839,9 @@ HELP
|
|||||||
{ name => 'y', type => 'float',
|
{ name => 'y', type => 'float',
|
||||||
desc => 'y coordinate of upper-left corner of rectangle' },
|
desc => 'y coordinate of upper-left corner of rectangle' },
|
||||||
{ name => 'width', type => '0 < float',
|
{ name => 'width', type => '0 < float',
|
||||||
desc => 'The width of the rectangle: %%desc%%' }
|
desc => 'The width of the rectangle: %%desc%%' },
|
||||||
{ name => 'height', type => '0 < float',
|
{ name => 'height', type => '0 < float',
|
||||||
desc => 'The height of the rectangle: %%desc%%' }
|
desc => 'The height of the rectangle: %%desc%%' },
|
||||||
&operation_arg,
|
&operation_arg,
|
||||||
&feather_select_args,
|
&feather_select_args,
|
||||||
);
|
);
|
||||||
@ -876,7 +876,7 @@ HELP
|
|||||||
@inargs = (
|
@inargs = (
|
||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'interpolation', type => 'boolean',
|
{ name => 'interpolation', type => 'boolean',
|
||||||
desc => 'Whether to use interpolation' }
|
desc => 'Whether to use interpolation' },
|
||||||
{ name => 'angle', type => 'float',
|
{ name => 'angle', type => 'float',
|
||||||
desc => 'The angle of rotation (radians)' }
|
desc => 'The angle of rotation (radians)' }
|
||||||
);
|
);
|
||||||
@ -1046,7 +1046,7 @@ HELP
|
|||||||
@inargs = (
|
@inargs = (
|
||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'interpolation', type => 'boolean',
|
{ name => 'interpolation', type => 'boolean',
|
||||||
desc => 'Whether to use interpolation' }
|
desc => 'Whether to use interpolation' },
|
||||||
{ name => 'shear_type', type => 'enum ShearType',
|
{ name => 'shear_type', type => 'enum ShearType',
|
||||||
desc => 'Type of shear: %%desc%%' },
|
desc => 'Type of shear: %%desc%%' },
|
||||||
{ name => 'magnitude', type => 'float',
|
{ name => 'magnitude', type => 'float',
|
||||||
|
@ -161,7 +161,7 @@ Fill the area specified either by the current selection if there is one, or by
|
|||||||
a seed fill starting at the specified coordinates.
|
a seed fill starting at the specified coordinates.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool requires information on the paint application mode, and the fill
|
This tool requires information on the paint application mode, and the fill
|
||||||
mode, which can either be in the foreground color, or in the currently active
|
mode, which can either be in the foreground color, or in the currently active
|
||||||
pattern. If there is no selection, a seed fill is executed at the specified
|
pattern. If there is no selection, a seed fill is executed at the specified
|
||||||
@ -172,12 +172,12 @@ the composite image will be used instead of that for the specified drawable.
|
|||||||
This is equivalent to sampling for colors after merging all visible layers. In
|
This is equivalent to sampling for colors after merging all visible layers. In
|
||||||
the case of merged sampling, the x,y coordinates are relative to the image's
|
the case of merged sampling, the x,y coordinates are relative to the image's
|
||||||
origin; otherwise, they are relative to the drawable's origin.
|
origin; otherwise, they are relative to the drawable's origin.
|
||||||
HELP;
|
HELP
|
||||||
|
|
||||||
&std_pdb_misc;
|
&std_pdb_misc;
|
||||||
|
|
||||||
my $validity = 'This parameter is only valid when there is no selection in
|
my $validity = 'This parameter is only valid when there is no selection in
|
||||||
the specified image.'
|
the specified image.';
|
||||||
my $coord = "The \$a coordinate of this bucket fill's application.
|
my $coord = "The \$a coordinate of this bucket fill's application.
|
||||||
$validity";
|
$validity";
|
||||||
|
|
||||||
@ -187,16 +187,16 @@ HELP;
|
|||||||
desc => 'The type of fill: %%desc%%' },
|
desc => 'The type of fill: %%desc%%' },
|
||||||
{ name => paint_mode, type => 'enum PaintMode',
|
{ name => paint_mode, type => 'enum PaintMode',
|
||||||
desc => 'The paint application mode: %%desc%%' },
|
desc => 'The paint application mode: %%desc%%' },
|
||||||
{ name => opacity, type => '0 <= float <= 100',
|
{ name => 'opacity', type => '0 <= float <= 100',
|
||||||
desc => 'The opacity of the final bucket fill %%desc%%' },
|
desc => 'The opacity of the final bucket fill %%desc%%' },
|
||||||
{ name => threshold, type => '0 <= float <= 255',
|
{ name => 'threshold', type => '0 <= float <= 255',
|
||||||
desc => "The threshold determines how extensive the seed fill will
|
desc => "The threshold determines how extensive the seed fill will
|
||||||
be. It's value is specified in terms of intensity levels
|
be. It's value is specified in terms of intensity levels
|
||||||
%%desc%%. $validity" },
|
%%desc%%. $validity" },
|
||||||
&sample_merged_arg,
|
&sample_merged_arg,
|
||||||
{ name => x, type => 'float',
|
{ name => 'x', type => 'float',
|
||||||
desc => eval qq/{\$a = 'x'; "$coord";}/ },
|
desc => eval qq/{\$a = 'x'; "$coord";}/ },
|
||||||
{ name => y, type => 'float',
|
{ name => 'y', type => 'float',
|
||||||
desc => eval qq/{\$a = 'y';"$coord";}/ }
|
desc => eval qq/{\$a = 'y';"$coord";}/ }
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -214,12 +214,12 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub by_color_select {
|
sub by_color_select {
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Create a selection by selecting all pixels (in the specified drawable) with the
|
Create a selection by selecting all pixels (in the specified drawable) with the
|
||||||
same (or similar) color to that specified.
|
same (or similar) color to that specified.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool creates a selection over the specified image. A by-color selection is
|
This tool creates a selection over the specified image. A by-color selection is
|
||||||
determined by the supplied color under the constraints of the specified
|
determined by the supplied color under the constraints of the specified
|
||||||
threshold. Essentially, all pixels (in the drawable) that have color
|
threshold. Essentially, all pixels (in the drawable) that have color
|
||||||
@ -260,11 +260,11 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub clone {
|
sub clone {
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Clone from the source to the dest drawable using the current brush
|
Clone from the source to the dest drawable using the current brush
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool clones (copies) from the source drawable starting at the specified
|
This tool clones (copies) from the source drawable starting at the specified
|
||||||
source coordinates to the dest drawable. If the "clone_type" argument is set
|
source coordinates to the dest drawable. If the "clone_type" argument is set
|
||||||
to PATTERN-CLONE, then the current pattern is used as the source and the
|
to PATTERN-CLONE, then the current pattern is used as the source and the
|
||||||
@ -373,7 +373,7 @@ HELP
|
|||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'pressure', type => '0 <= float <= 100',
|
{ name => 'pressure', type => '0 <= float <= 100',
|
||||||
desc => 'The pressure: %%desc%%' },
|
desc => 'The pressure: %%desc%%' },
|
||||||
{ name => 'convolve_type', type 'enum Convolve (no CUSTOM)',
|
{ name => 'convolve_type', type => 'enum Convolve (no CUSTOM)',
|
||||||
desc => 'Convolve type: %%desc%%' },
|
desc => 'Convolve type: %%desc%%' },
|
||||||
&stroke_arg
|
&stroke_arg
|
||||||
);
|
);
|
||||||
@ -479,7 +479,7 @@ HELP
|
|||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
&stroke_arg,
|
&stroke_arg,
|
||||||
{ name => 'hardness', type => 'enum EraserHardness',
|
{ name => 'hardness', type => 'enum EraserHardness',
|
||||||
desc => '%%desc%%' }
|
desc => '%%desc%%' },
|
||||||
{ name => 'method', type => 'enum EraserMethod',
|
{ name => 'method', type => 'enum EraserMethod',
|
||||||
desc => '%%desc%%' }
|
desc => '%%desc%%' }
|
||||||
);
|
);
|
||||||
@ -839,9 +839,9 @@ HELP
|
|||||||
{ name => 'y', type => 'float',
|
{ name => 'y', type => 'float',
|
||||||
desc => 'y coordinate of upper-left corner of rectangle' },
|
desc => 'y coordinate of upper-left corner of rectangle' },
|
||||||
{ name => 'width', type => '0 < float',
|
{ name => 'width', type => '0 < float',
|
||||||
desc => 'The width of the rectangle: %%desc%%' }
|
desc => 'The width of the rectangle: %%desc%%' },
|
||||||
{ name => 'height', type => '0 < float',
|
{ name => 'height', type => '0 < float',
|
||||||
desc => 'The height of the rectangle: %%desc%%' }
|
desc => 'The height of the rectangle: %%desc%%' },
|
||||||
&operation_arg,
|
&operation_arg,
|
||||||
&feather_select_args,
|
&feather_select_args,
|
||||||
);
|
);
|
||||||
@ -876,7 +876,7 @@ HELP
|
|||||||
@inargs = (
|
@inargs = (
|
||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'interpolation', type => 'boolean',
|
{ name => 'interpolation', type => 'boolean',
|
||||||
desc => 'Whether to use interpolation' }
|
desc => 'Whether to use interpolation' },
|
||||||
{ name => 'angle', type => 'float',
|
{ name => 'angle', type => 'float',
|
||||||
desc => 'The angle of rotation (radians)' }
|
desc => 'The angle of rotation (radians)' }
|
||||||
);
|
);
|
||||||
@ -1046,7 +1046,7 @@ HELP
|
|||||||
@inargs = (
|
@inargs = (
|
||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'interpolation', type => 'boolean',
|
{ name => 'interpolation', type => 'boolean',
|
||||||
desc => 'Whether to use interpolation' }
|
desc => 'Whether to use interpolation' },
|
||||||
{ name => 'shear_type', type => 'enum ShearType',
|
{ name => 'shear_type', type => 'enum ShearType',
|
||||||
desc => 'Type of shear: %%desc%%' },
|
desc => 'Type of shear: %%desc%%' },
|
||||||
{ name => 'magnitude', type => 'float',
|
{ name => 'magnitude', type => 'float',
|
||||||
|
68
tools/pdbgen/pdb/parasite.pdb
Normal file
68
tools/pdbgen/pdb/parasite.pdb
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# The GIMP -- an image manipulation program
|
||||||
|
# Copyright (C) 1998 Jay Cox <jaycox@earthlink.net>
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
|
# The defs
|
||||||
|
|
||||||
|
sub pdb_misc {
|
||||||
|
$author = $copyright = 'Jay Cox';
|
||||||
|
$date = 1998;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub parasite_new {
|
||||||
|
$blurb = 'Creates a new parasite.';
|
||||||
|
|
||||||
|
$help = 'Creates a new parasite unatached to to any image or drawable.';
|
||||||
|
|
||||||
|
&pdb_misc;
|
||||||
|
|
||||||
|
@inargs = (
|
||||||
|
{ name => 'name', type => 'string',
|
||||||
|
desc => 'The name of the parasite to create', no_success => 1 },
|
||||||
|
{ name => 'flags', type => 'int32',
|
||||||
|
desc => 'The flags (persistance == 1)' },
|
||||||
|
{ name => 'size', type => '0 <= int32',
|
||||||
|
desc => 'The size of the data in bytes' },
|
||||||
|
{ name => 'data', type => 'string',
|
||||||
|
desc => 'The data', no_success => 1 }
|
||||||
|
);
|
||||||
|
|
||||||
|
@outargs = (
|
||||||
|
{ name => 'parasite', type => 'parasite',
|
||||||
|
desc => 'The new parasite' }
|
||||||
|
);
|
||||||
|
|
||||||
|
%invoke = (
|
||||||
|
headers => [ qw("libgimp/parasite.h") ],
|
||||||
|
code => <<'CODE'
|
||||||
|
{
|
||||||
|
if (size > 0 && data == NULL)
|
||||||
|
success = FALSE;
|
||||||
|
else
|
||||||
|
success = (parasite = parasite_new (name, flags, size, data)) != NULL;
|
||||||
|
}
|
||||||
|
CODE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@procs = qw(parasite_new);
|
||||||
|
%exports = (app => [@procs]);
|
||||||
|
|
||||||
|
$desc = 'Parasite procedures';
|
||||||
|
|
||||||
|
1;
|
@ -141,7 +141,7 @@ HELP
|
|||||||
{
|
{
|
||||||
name => 'procedure_names',
|
name => 'procedure_names',
|
||||||
type => 'stringarray',
|
type => 'stringarray',
|
||||||
desc => 'The list of procedure names'
|
desc => 'The list of procedure names',
|
||||||
alias => 'pdb_query.list_or_procs'
|
alias => 'pdb_query.list_or_procs'
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -175,7 +175,7 @@ CODE
|
|||||||
sub procedural_db_proc_info {
|
sub procedural_db_proc_info {
|
||||||
$alias{lib} = 'query_procedure';
|
$alias{lib} = 'query_procedure';
|
||||||
|
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Queries the procedural database for information on the specified procedure.
|
Queries the procedural database for information on the specified procedure.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ HELP
|
|||||||
@globals = ('static GList *data_list = NULL');
|
@globals = ('static GList *data_list = NULL');
|
||||||
|
|
||||||
%invoke = (
|
%invoke = (
|
||||||
headers => [ qw("procedural.db.h" ],
|
headers => [ qw("procedural.db.h") ],
|
||||||
vars => ['PDBData *data', 'char *data_copy', 'GList *list'],
|
vars => ['PDBData *data', 'char *data_copy', 'GList *list'],
|
||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
@ -300,7 +300,7 @@ HELP
|
|||||||
$outargs[0]->{alias} = 'data->bytes';
|
$outargs[0]->{alias} = 'data->bytes';
|
||||||
|
|
||||||
%invoke = (
|
%invoke = (
|
||||||
headers => [ qw("procedural.db.h" ],
|
headers => [ qw("procedural.db.h") ],
|
||||||
vars => ['PDBData *data', 'GList *list'],
|
vars => ['PDBData *data', 'GList *list'],
|
||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
@ -340,7 +340,7 @@ HELP
|
|||||||
$inargs[2]->{alias} = 'data_src';
|
$inargs[2]->{alias} = 'data_src';
|
||||||
|
|
||||||
%invoke = (
|
%invoke = (
|
||||||
headers => [ qw("procedural.db.h" ],
|
headers => [ qw("procedural.db.h") ],
|
||||||
vars => ['PDBData *data = NULL', 'GList *list'],
|
vars => ['PDBData *data = NULL', 'GList *list'],
|
||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
|
@ -38,6 +38,13 @@ sub fontname_arg () {{
|
|||||||
Conventions)'
|
Conventions)'
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
sub size_args () {(
|
||||||
|
{ name => 'size', type => '0 < float',
|
||||||
|
desc => 'The size of text in either pixels or points' },
|
||||||
|
{ name => 'size_type', type => 'enum SizeType',
|
||||||
|
desc => 'The units of specified size: %%desc%%' }
|
||||||
|
)}
|
||||||
|
|
||||||
sub render_args () {(
|
sub render_args () {(
|
||||||
&std_image_arg,
|
&std_image_arg,
|
||||||
{ name => 'drawable', type => 'drawable',
|
{ name => 'drawable', type => 'drawable',
|
||||||
@ -49,21 +56,16 @@ sub render_args () {(
|
|||||||
desc => 'The y coordinate for the top of the text bounding box' },
|
desc => 'The y coordinate for the top of the text bounding box' },
|
||||||
&text_arg,
|
&text_arg,
|
||||||
{ name => 'border', type => '-1 <= int32',
|
{ name => 'border', type => '-1 <= int32',
|
||||||
desc => 'The size of the border: %%desc%%' }
|
desc => 'The size of the border: %%desc%%' },
|
||||||
&std_antialias_arg
|
&std_antialias_arg,
|
||||||
|
&size_args
|
||||||
)}
|
)}
|
||||||
|
|
||||||
sub size_args () {(
|
@props = qw(foundry family weight slant set-width spacing registry encoding);
|
||||||
{ name => 'size', type => '0 < float',
|
|
||||||
desc => 'The size of text in either pixels or points' },
|
|
||||||
{ name => 'size_type', type => 'enum SizeType',
|
|
||||||
desc => 'The units of specified size: %%desc%%' }
|
|
||||||
)}
|
|
||||||
|
|
||||||
sub font_prop_args {
|
sub font_prop_args {
|
||||||
my @result;
|
my @result;
|
||||||
foreach (qw(foundry family weight slant set-width spacing registry
|
foreach (@props) {
|
||||||
encoding)) {
|
|
||||||
my $var = $_;
|
my $var = $_;
|
||||||
$var =~ s/-/_/g;
|
$var =~ s/-/_/g;
|
||||||
|
|
||||||
@ -87,6 +89,15 @@ sub extents_outargs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub fontname_makeargs {
|
||||||
|
my @args;
|
||||||
|
foreach (map { s/-/_/; uc } @props) {
|
||||||
|
push @args, { type => 'string',
|
||||||
|
code => "%%arg%% = text_get_field (fontname, $_);" }
|
||||||
|
}
|
||||||
|
@args;
|
||||||
|
}
|
||||||
|
|
||||||
sub text {
|
sub text {
|
||||||
$blurb = <<'BLURB';
|
$blurb = <<'BLURB';
|
||||||
Add text at the specified location as a floating selection or a new layer.
|
Add text at the specified location as a floating selection or a new layer.
|
||||||
@ -109,19 +120,18 @@ appear as a new layer. Finally, a border can be specified around the final
|
|||||||
rendered text. The border is measured in pixels.
|
rendered text. The border is measured in pixels.
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
&pdb_misc;
|
&pdb_misc;
|
||||||
|
|
||||||
@inargs = (
|
@inargs = (
|
||||||
&render_args,
|
&render_args,
|
||||||
&size_args,
|
|
||||||
&font_prop_args
|
&font_prop_args
|
||||||
);
|
);
|
||||||
|
|
||||||
&render_outargs;
|
&render_outargs;
|
||||||
|
|
||||||
%invoke = (
|
%invoke = (
|
||||||
headers => [ qw("text_tool.h") ],
|
headers => [ qw("text_tool.h") ],
|
||||||
vars => ['GimpImage *gimage', 'gchar *fontname[2048]'],
|
vars => ['gchar *fontname[2048]'],
|
||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
if (antialias)
|
if (antialias)
|
||||||
@ -132,13 +142,13 @@ HELP
|
|||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
success = text_get_xlfd (size, size_type, foundry, family, weight,
|
success = text_get_xlfd (size, size_type, foundry, family, weight,
|
||||||
slant, set_width, spacing, registry, encoding,
|
slant, set_width, spacing, registry, encoding,
|
||||||
fontname);
|
fontname);
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
text_layer = text_render (gimage, drawable, x, y, fontname, text,
|
text_layer = text_render (gimage, drawable, x, y, fontname, text,
|
||||||
border, antialias);
|
border, antialias);
|
||||||
success = text_layer != NULL;
|
success = text_layer != NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,12 +180,13 @@ HELP
|
|||||||
code => <<'CODE'
|
code => <<'CODE'
|
||||||
{
|
{
|
||||||
success = text_get_xlfd (size, size_type, foundry, family, weight,
|
success = text_get_xlfd (size, size_type, foundry, family, weight,
|
||||||
slant, set_width, spacing, registry, encoding,
|
slant, set_width, spacing, registry, encoding,
|
||||||
fontname);
|
fontname);
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
success = text_get_extents (fontname, text, &width, &height, &ascent,
|
success = text_get_extents (fontname, text, &width, &height, &ascent,
|
||||||
&descent);
|
&descent);
|
||||||
|
}
|
||||||
CODE
|
CODE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -197,19 +208,59 @@ than non-antialiased text; the resulting floating selection or layer, however,
|
|||||||
will require the same amount of memory with or without antialiasing. If the
|
will require the same amount of memory with or without antialiasing. If the
|
||||||
specified drawable parameter is valid, the text will be created as a floating
|
specified drawable parameter is valid, the text will be created as a floating
|
||||||
selection attached to the drawable. If the drawable parameter is not valid
|
selection attached to the drawable. If the drawable parameter is not valid
|
||||||
(-1), the text will appear as a new layer. Finally, a border can be specified
|
(-1), the text will appear as a new layer. Finally, a border can be specified
|
||||||
around the final rendered text. The border is measured in pixels.
|
around the final rendered text. The border is measured in pixels.
|
||||||
HELP
|
HELP
|
||||||
|
|
||||||
&pdb_misc;
|
&pdb_misc;
|
||||||
$author .= ', Sven Neumann';
|
$author .= ' & Sven Neumann';
|
||||||
|
|
||||||
@inargs = (
|
@inargs = (
|
||||||
&render_args,
|
&render_args,
|
||||||
&fontname_arg
|
&fontname_arg
|
||||||
);
|
);
|
||||||
|
|
||||||
|
&render_outargs;
|
||||||
|
|
||||||
%invoke = (
|
%invoke = (
|
||||||
headers => [ qw("text_tool.h") ],
|
headers => [ qw("text_tool.h") ],
|
||||||
|
pass_through => 'text',
|
||||||
|
pass_args => [ 0..8 ],
|
||||||
|
make_args => [ &fontname_makeargs ]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub text_get_extents_fontname {
|
||||||
|
$blurb = 'Get extents of the bounding box for the specified text.';
|
||||||
|
|
||||||
|
$help = <<'HELP';
|
||||||
|
This tool returns the width and height of a bounding box for the specified text
|
||||||
|
string with the specified font information. Ascent and descent for the
|
||||||
|
specified font are returned as well.
|
||||||
|
HELP
|
||||||
|
|
||||||
|
&pdb_misc;
|
||||||
|
$author .= ' & Sven Neumann';
|
||||||
|
|
||||||
|
@inargs = (
|
||||||
|
&text_arg,
|
||||||
|
&size_args,
|
||||||
|
&fontname_arg
|
||||||
|
);
|
||||||
|
|
||||||
|
&extents_outargs;
|
||||||
|
|
||||||
|
%invoke = (
|
||||||
|
headers => [ qw("text_tool.h") ],
|
||||||
|
pass_through => 'text_get_extents',
|
||||||
|
pass_args => [ 0..2 ],
|
||||||
|
make_args => [ &fontname_makeargs ]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@procs = qw(text text_get_extents text_fontname text_get_extents_fontname);
|
||||||
|
%exports = (app => [@procs]);
|
||||||
|
|
||||||
|
$desc = 'Text procedures';
|
||||||
|
|
||||||
|
1;
|
||||||
|
@ -161,7 +161,7 @@ Fill the area specified either by the current selection if there is one, or by
|
|||||||
a seed fill starting at the specified coordinates.
|
a seed fill starting at the specified coordinates.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool requires information on the paint application mode, and the fill
|
This tool requires information on the paint application mode, and the fill
|
||||||
mode, which can either be in the foreground color, or in the currently active
|
mode, which can either be in the foreground color, or in the currently active
|
||||||
pattern. If there is no selection, a seed fill is executed at the specified
|
pattern. If there is no selection, a seed fill is executed at the specified
|
||||||
@ -172,12 +172,12 @@ the composite image will be used instead of that for the specified drawable.
|
|||||||
This is equivalent to sampling for colors after merging all visible layers. In
|
This is equivalent to sampling for colors after merging all visible layers. In
|
||||||
the case of merged sampling, the x,y coordinates are relative to the image's
|
the case of merged sampling, the x,y coordinates are relative to the image's
|
||||||
origin; otherwise, they are relative to the drawable's origin.
|
origin; otherwise, they are relative to the drawable's origin.
|
||||||
HELP;
|
HELP
|
||||||
|
|
||||||
&std_pdb_misc;
|
&std_pdb_misc;
|
||||||
|
|
||||||
my $validity = 'This parameter is only valid when there is no selection in
|
my $validity = 'This parameter is only valid when there is no selection in
|
||||||
the specified image.'
|
the specified image.';
|
||||||
my $coord = "The \$a coordinate of this bucket fill's application.
|
my $coord = "The \$a coordinate of this bucket fill's application.
|
||||||
$validity";
|
$validity";
|
||||||
|
|
||||||
@ -187,16 +187,16 @@ HELP;
|
|||||||
desc => 'The type of fill: %%desc%%' },
|
desc => 'The type of fill: %%desc%%' },
|
||||||
{ name => paint_mode, type => 'enum PaintMode',
|
{ name => paint_mode, type => 'enum PaintMode',
|
||||||
desc => 'The paint application mode: %%desc%%' },
|
desc => 'The paint application mode: %%desc%%' },
|
||||||
{ name => opacity, type => '0 <= float <= 100',
|
{ name => 'opacity', type => '0 <= float <= 100',
|
||||||
desc => 'The opacity of the final bucket fill %%desc%%' },
|
desc => 'The opacity of the final bucket fill %%desc%%' },
|
||||||
{ name => threshold, type => '0 <= float <= 255',
|
{ name => 'threshold', type => '0 <= float <= 255',
|
||||||
desc => "The threshold determines how extensive the seed fill will
|
desc => "The threshold determines how extensive the seed fill will
|
||||||
be. It's value is specified in terms of intensity levels
|
be. It's value is specified in terms of intensity levels
|
||||||
%%desc%%. $validity" },
|
%%desc%%. $validity" },
|
||||||
&sample_merged_arg,
|
&sample_merged_arg,
|
||||||
{ name => x, type => 'float',
|
{ name => 'x', type => 'float',
|
||||||
desc => eval qq/{\$a = 'x'; "$coord";}/ },
|
desc => eval qq/{\$a = 'x'; "$coord";}/ },
|
||||||
{ name => y, type => 'float',
|
{ name => 'y', type => 'float',
|
||||||
desc => eval qq/{\$a = 'y';"$coord";}/ }
|
desc => eval qq/{\$a = 'y';"$coord";}/ }
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -214,12 +214,12 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub by_color_select {
|
sub by_color_select {
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Create a selection by selecting all pixels (in the specified drawable) with the
|
Create a selection by selecting all pixels (in the specified drawable) with the
|
||||||
same (or similar) color to that specified.
|
same (or similar) color to that specified.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool creates a selection over the specified image. A by-color selection is
|
This tool creates a selection over the specified image. A by-color selection is
|
||||||
determined by the supplied color under the constraints of the specified
|
determined by the supplied color under the constraints of the specified
|
||||||
threshold. Essentially, all pixels (in the drawable) that have color
|
threshold. Essentially, all pixels (in the drawable) that have color
|
||||||
@ -260,11 +260,11 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub clone {
|
sub clone {
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Clone from the source to the dest drawable using the current brush
|
Clone from the source to the dest drawable using the current brush
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool clones (copies) from the source drawable starting at the specified
|
This tool clones (copies) from the source drawable starting at the specified
|
||||||
source coordinates to the dest drawable. If the "clone_type" argument is set
|
source coordinates to the dest drawable. If the "clone_type" argument is set
|
||||||
to PATTERN-CLONE, then the current pattern is used as the source and the
|
to PATTERN-CLONE, then the current pattern is used as the source and the
|
||||||
@ -373,7 +373,7 @@ HELP
|
|||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'pressure', type => '0 <= float <= 100',
|
{ name => 'pressure', type => '0 <= float <= 100',
|
||||||
desc => 'The pressure: %%desc%%' },
|
desc => 'The pressure: %%desc%%' },
|
||||||
{ name => 'convolve_type', type 'enum Convolve (no CUSTOM)',
|
{ name => 'convolve_type', type => 'enum Convolve (no CUSTOM)',
|
||||||
desc => 'Convolve type: %%desc%%' },
|
desc => 'Convolve type: %%desc%%' },
|
||||||
&stroke_arg
|
&stroke_arg
|
||||||
);
|
);
|
||||||
@ -479,7 +479,7 @@ HELP
|
|||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
&stroke_arg,
|
&stroke_arg,
|
||||||
{ name => 'hardness', type => 'enum EraserHardness',
|
{ name => 'hardness', type => 'enum EraserHardness',
|
||||||
desc => '%%desc%%' }
|
desc => '%%desc%%' },
|
||||||
{ name => 'method', type => 'enum EraserMethod',
|
{ name => 'method', type => 'enum EraserMethod',
|
||||||
desc => '%%desc%%' }
|
desc => '%%desc%%' }
|
||||||
);
|
);
|
||||||
@ -839,9 +839,9 @@ HELP
|
|||||||
{ name => 'y', type => 'float',
|
{ name => 'y', type => 'float',
|
||||||
desc => 'y coordinate of upper-left corner of rectangle' },
|
desc => 'y coordinate of upper-left corner of rectangle' },
|
||||||
{ name => 'width', type => '0 < float',
|
{ name => 'width', type => '0 < float',
|
||||||
desc => 'The width of the rectangle: %%desc%%' }
|
desc => 'The width of the rectangle: %%desc%%' },
|
||||||
{ name => 'height', type => '0 < float',
|
{ name => 'height', type => '0 < float',
|
||||||
desc => 'The height of the rectangle: %%desc%%' }
|
desc => 'The height of the rectangle: %%desc%%' },
|
||||||
&operation_arg,
|
&operation_arg,
|
||||||
&feather_select_args,
|
&feather_select_args,
|
||||||
);
|
);
|
||||||
@ -876,7 +876,7 @@ HELP
|
|||||||
@inargs = (
|
@inargs = (
|
||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'interpolation', type => 'boolean',
|
{ name => 'interpolation', type => 'boolean',
|
||||||
desc => 'Whether to use interpolation' }
|
desc => 'Whether to use interpolation' },
|
||||||
{ name => 'angle', type => 'float',
|
{ name => 'angle', type => 'float',
|
||||||
desc => 'The angle of rotation (radians)' }
|
desc => 'The angle of rotation (radians)' }
|
||||||
);
|
);
|
||||||
@ -1046,7 +1046,7 @@ HELP
|
|||||||
@inargs = (
|
@inargs = (
|
||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'interpolation', type => 'boolean',
|
{ name => 'interpolation', type => 'boolean',
|
||||||
desc => 'Whether to use interpolation' }
|
desc => 'Whether to use interpolation' },
|
||||||
{ name => 'shear_type', type => 'enum ShearType',
|
{ name => 'shear_type', type => 'enum ShearType',
|
||||||
desc => 'Type of shear: %%desc%%' },
|
desc => 'Type of shear: %%desc%%' },
|
||||||
{ name => 'magnitude', type => 'float',
|
{ name => 'magnitude', type => 'float',
|
||||||
|
@ -161,7 +161,7 @@ Fill the area specified either by the current selection if there is one, or by
|
|||||||
a seed fill starting at the specified coordinates.
|
a seed fill starting at the specified coordinates.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool requires information on the paint application mode, and the fill
|
This tool requires information on the paint application mode, and the fill
|
||||||
mode, which can either be in the foreground color, or in the currently active
|
mode, which can either be in the foreground color, or in the currently active
|
||||||
pattern. If there is no selection, a seed fill is executed at the specified
|
pattern. If there is no selection, a seed fill is executed at the specified
|
||||||
@ -172,12 +172,12 @@ the composite image will be used instead of that for the specified drawable.
|
|||||||
This is equivalent to sampling for colors after merging all visible layers. In
|
This is equivalent to sampling for colors after merging all visible layers. In
|
||||||
the case of merged sampling, the x,y coordinates are relative to the image's
|
the case of merged sampling, the x,y coordinates are relative to the image's
|
||||||
origin; otherwise, they are relative to the drawable's origin.
|
origin; otherwise, they are relative to the drawable's origin.
|
||||||
HELP;
|
HELP
|
||||||
|
|
||||||
&std_pdb_misc;
|
&std_pdb_misc;
|
||||||
|
|
||||||
my $validity = 'This parameter is only valid when there is no selection in
|
my $validity = 'This parameter is only valid when there is no selection in
|
||||||
the specified image.'
|
the specified image.';
|
||||||
my $coord = "The \$a coordinate of this bucket fill's application.
|
my $coord = "The \$a coordinate of this bucket fill's application.
|
||||||
$validity";
|
$validity";
|
||||||
|
|
||||||
@ -187,16 +187,16 @@ HELP;
|
|||||||
desc => 'The type of fill: %%desc%%' },
|
desc => 'The type of fill: %%desc%%' },
|
||||||
{ name => paint_mode, type => 'enum PaintMode',
|
{ name => paint_mode, type => 'enum PaintMode',
|
||||||
desc => 'The paint application mode: %%desc%%' },
|
desc => 'The paint application mode: %%desc%%' },
|
||||||
{ name => opacity, type => '0 <= float <= 100',
|
{ name => 'opacity', type => '0 <= float <= 100',
|
||||||
desc => 'The opacity of the final bucket fill %%desc%%' },
|
desc => 'The opacity of the final bucket fill %%desc%%' },
|
||||||
{ name => threshold, type => '0 <= float <= 255',
|
{ name => 'threshold', type => '0 <= float <= 255',
|
||||||
desc => "The threshold determines how extensive the seed fill will
|
desc => "The threshold determines how extensive the seed fill will
|
||||||
be. It's value is specified in terms of intensity levels
|
be. It's value is specified in terms of intensity levels
|
||||||
%%desc%%. $validity" },
|
%%desc%%. $validity" },
|
||||||
&sample_merged_arg,
|
&sample_merged_arg,
|
||||||
{ name => x, type => 'float',
|
{ name => 'x', type => 'float',
|
||||||
desc => eval qq/{\$a = 'x'; "$coord";}/ },
|
desc => eval qq/{\$a = 'x'; "$coord";}/ },
|
||||||
{ name => y, type => 'float',
|
{ name => 'y', type => 'float',
|
||||||
desc => eval qq/{\$a = 'y';"$coord";}/ }
|
desc => eval qq/{\$a = 'y';"$coord";}/ }
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -214,12 +214,12 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub by_color_select {
|
sub by_color_select {
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Create a selection by selecting all pixels (in the specified drawable) with the
|
Create a selection by selecting all pixels (in the specified drawable) with the
|
||||||
same (or similar) color to that specified.
|
same (or similar) color to that specified.
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool creates a selection over the specified image. A by-color selection is
|
This tool creates a selection over the specified image. A by-color selection is
|
||||||
determined by the supplied color under the constraints of the specified
|
determined by the supplied color under the constraints of the specified
|
||||||
threshold. Essentially, all pixels (in the drawable) that have color
|
threshold. Essentially, all pixels (in the drawable) that have color
|
||||||
@ -260,11 +260,11 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub clone {
|
sub clone {
|
||||||
$blurb = <<'BLURB'
|
$blurb = <<'BLURB';
|
||||||
Clone from the source to the dest drawable using the current brush
|
Clone from the source to the dest drawable using the current brush
|
||||||
BLURB
|
BLURB
|
||||||
|
|
||||||
$help = <<'HELP'
|
$help = <<'HELP';
|
||||||
This tool clones (copies) from the source drawable starting at the specified
|
This tool clones (copies) from the source drawable starting at the specified
|
||||||
source coordinates to the dest drawable. If the "clone_type" argument is set
|
source coordinates to the dest drawable. If the "clone_type" argument is set
|
||||||
to PATTERN-CLONE, then the current pattern is used as the source and the
|
to PATTERN-CLONE, then the current pattern is used as the source and the
|
||||||
@ -373,7 +373,7 @@ HELP
|
|||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'pressure', type => '0 <= float <= 100',
|
{ name => 'pressure', type => '0 <= float <= 100',
|
||||||
desc => 'The pressure: %%desc%%' },
|
desc => 'The pressure: %%desc%%' },
|
||||||
{ name => 'convolve_type', type 'enum Convolve (no CUSTOM)',
|
{ name => 'convolve_type', type => 'enum Convolve (no CUSTOM)',
|
||||||
desc => 'Convolve type: %%desc%%' },
|
desc => 'Convolve type: %%desc%%' },
|
||||||
&stroke_arg
|
&stroke_arg
|
||||||
);
|
);
|
||||||
@ -479,7 +479,7 @@ HELP
|
|||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
&stroke_arg,
|
&stroke_arg,
|
||||||
{ name => 'hardness', type => 'enum EraserHardness',
|
{ name => 'hardness', type => 'enum EraserHardness',
|
||||||
desc => '%%desc%%' }
|
desc => '%%desc%%' },
|
||||||
{ name => 'method', type => 'enum EraserMethod',
|
{ name => 'method', type => 'enum EraserMethod',
|
||||||
desc => '%%desc%%' }
|
desc => '%%desc%%' }
|
||||||
);
|
);
|
||||||
@ -839,9 +839,9 @@ HELP
|
|||||||
{ name => 'y', type => 'float',
|
{ name => 'y', type => 'float',
|
||||||
desc => 'y coordinate of upper-left corner of rectangle' },
|
desc => 'y coordinate of upper-left corner of rectangle' },
|
||||||
{ name => 'width', type => '0 < float',
|
{ name => 'width', type => '0 < float',
|
||||||
desc => 'The width of the rectangle: %%desc%%' }
|
desc => 'The width of the rectangle: %%desc%%' },
|
||||||
{ name => 'height', type => '0 < float',
|
{ name => 'height', type => '0 < float',
|
||||||
desc => 'The height of the rectangle: %%desc%%' }
|
desc => 'The height of the rectangle: %%desc%%' },
|
||||||
&operation_arg,
|
&operation_arg,
|
||||||
&feather_select_args,
|
&feather_select_args,
|
||||||
);
|
);
|
||||||
@ -876,7 +876,7 @@ HELP
|
|||||||
@inargs = (
|
@inargs = (
|
||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'interpolation', type => 'boolean',
|
{ name => 'interpolation', type => 'boolean',
|
||||||
desc => 'Whether to use interpolation' }
|
desc => 'Whether to use interpolation' },
|
||||||
{ name => 'angle', type => 'float',
|
{ name => 'angle', type => 'float',
|
||||||
desc => 'The angle of rotation (radians)' }
|
desc => 'The angle of rotation (radians)' }
|
||||||
);
|
);
|
||||||
@ -1046,7 +1046,7 @@ HELP
|
|||||||
@inargs = (
|
@inargs = (
|
||||||
&drawable_arg,
|
&drawable_arg,
|
||||||
{ name => 'interpolation', type => 'boolean',
|
{ name => 'interpolation', type => 'boolean',
|
||||||
desc => 'Whether to use interpolation' }
|
desc => 'Whether to use interpolation' },
|
||||||
{ name => 'shear_type', type => 'enum ShearType',
|
{ name => 'shear_type', type => 'enum ShearType',
|
||||||
desc => 'Type of shear: %%desc%%' },
|
desc => 'Type of shear: %%desc%%' },
|
||||||
{ name => 'magnitude', type => 'float',
|
{ name => 'magnitude', type => 'float',
|
||||||
|
Reference in New Issue
Block a user