-Yosh
This commit is contained in:
Manish Singh 1999-04-10 21:41:26 +00:00
parent 784ecce7bf
commit 43f63f9fcd
19 changed files with 336 additions and 93 deletions

View file

@ -12,7 +12,8 @@ enum_headers = \
../../app/convolve.h \ ../../app/convolve.h \
../../app/channel.h \ ../../app/channel.h \
../../app/eraser.h \ ../../app/eraser.h \
../../app/paint_core.h ../../app/paint_core.h \
../../app/lut_funcs.h
enums.pl: enumgen.pl $(enum_headers) enums.pl: enumgen.pl $(enum_headers)
cd $(srcdir) \ cd $(srcdir) \

View file

@ -261,13 +261,15 @@ CODE
} }
$okvals .= &format_switch_frag($_, 'on_success'); $okvals .= &format_switch_frag($_, 'on_success');
chomp $okvals;
$failvals .= "default:\n"; $failvals .= "default:\n";
if (!exists $_->{no_success}) { if (!exists $_->{no_success}) {
$success = 1; $success = 1;
$failvals .= ' ' x 6 . "success = FALSE\n" $failvals .= ' ' x 6 . "success = FALSE;\n"
} }
$failvals .= &format_switch_frag($_, 'on_fail'); $failvals .= &format_switch_frag($_, 'on_fail');
chomp $failvals;
$result .= <<CODE; $result .= <<CODE;
switch ($var) switch ($var)

View file

@ -266,6 +266,18 @@ package Gimp::CodeGen::enums;
mapping => { CONSTANT => '0', mapping => { CONSTANT => '0',
INCREMENTAL => '1' }, INCREMENTAL => '1' },
nicks => { CONSTANT => 'CONTINUOUS' } nicks => { CONSTANT => 'CONTINUOUS' }
},
ChannelLutType =>
{ contig => 1,
symbols => [ qw(VALUE_LUT RED_LUT GREEN_LUT BLUE_LUT) ],
mapping => { VALUE_LUT => '0',
RED_LUT => '1',
GREEN_LUT => '2',
BLUE_LUT => '3' },
nicks => { VALUE_LUT => 'VALUE/GRAY',
RED_LUT => 'RED',
GREEN_LUT => 'GREEN',
BLUE_LUT => 'BLUE' }
} }
); );

View file

@ -18,4 +18,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 convert @groups = qw(gdisplay edit floating_sel undo palette gradient convert
channel_ops gimprc drawable parasite paths gradient_select channel_ops gimprc drawable parasite paths gradient_select
unit procedural_db brushes text_tool brush_select); unit procedural_db brushes text_tool brush_select color);

View file

@ -111,7 +111,7 @@ HELP
&brush_outargs; &brush_outargs;
%invoke = ( %invoke = (
vars => ['GimpBrush *brushp'], vars => [ 'GimpBrush *brushp' ],
code => 'success = (brushp = get_active_brush ()) != NULL;' code => 'success = (brushp = get_active_brush ()) != NULL;'
); );
} }
@ -132,7 +132,7 @@ HELP
@inargs = ( &brush_arg ); @inargs = ( &brush_arg );
%invoke = ( %invoke = (
vars => ['GimpBrush *brushp'], vars => [ 'GimpBrush *brushp' ],
code => <<'CODE' code => <<'CODE'
{ {
brushp = gimp_brush_list_get_brush (brush_list, name); brushp = gimp_brush_list_get_brush (brush_list, name);
@ -316,7 +316,7 @@ HELP
desc => 'Length of brush mask data' } }; desc => 'Length of brush mask data' } };
%invoke = ( %invoke = (
vars => ['GimpBrushP brushp = NULL'], vars => [ 'GimpBrushP brushp = NULL' ],
code => <<'CODE' code => <<'CODE'
{ {
if (strlen (name)) if (strlen (name))

View file

@ -49,7 +49,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("channel_ops.h") ], headers => [ qw("channel_ops.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));

228
tools/pdbgen/pdb/color.pdb Normal file
View file

@ -0,0 +1,228 @@
# 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>
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The drawable',
}}
sub brightness_contrast {
$blurb = 'Modify brightness/contrast in the specified drawable.';
$help = <<'HELP';
This procedures allows the brightness and contrast of the specified drawable to
be modified. Both 'brightness' and 'contrast' parameters are defined between
-127 and 127.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = ( &drawable_arg );
foreach (qw( brightness contrast)) {
push @inargs, { name => $_, type => '-127 <= int32 <= 127',
desc => "@{[ ucfirst $_ ]} adjustment: (%%desc%%)" }
}
%invoke = (
vars => [ 'GimpImage *gimage', 'GimpLut *lut',
'PixelRegion srcPR, destPR', 'int x1, y1, x2, y2' ],
code => <<'CODE'
{
if (gimp_drawable_indexed (drawable))
success = FALSE;
else
{
gimage = gimp_drawable_gimage (drawable);
lut = brightness_contrast_lut_new (brightness / 255.0,
contrast / 127.0,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
}
CODE
);
}
sub levels {
$blurb = 'Modifies intensity levels in the specified drawable.';
$help = <<'HELP';
This tool allows intensity levels in the specified drawable to be remapped
according to a set of parameters. The low/high input levels specify an initial
mapping from the source intensities. The gamma value determines how intensities
between the low and high input intensities are interpolated. A gamma value of
1.0 results in a linear interpolation. Higher gamma values result in more
high-level intensities. Lower gamma values result in more low-level
intensities. The low/high output levels constrain the final intensity
mapping--that is, no final intensity will be lower than the low output level
and no final intensity will be higher than the high output level. This tool is
only valid on RGB color and grayscale images. It will not operate on indexed
drawables.
HELP
&std_pdb_misc;
@inargs = (
&drawable_arg,
{ name => 'channel', type => 'enum ChannelLutType',
desc => 'The channel to modify: { %%desc%% }' }
);
foreach $arg (qw(input output)) {
foreach (qw(low high)) {
push @inargs, { name => "${_}_$arg", type => '0 <= int32 <= 255',
desc => "Intensity of ${_}est $arg: (%%desc%%)",
alias => "${_}_${arg}v" }
}
push @inargs, { name => 'gamma', type => '0.1 <= float <= 10',
desc => 'Gamma correction factor: (%%desc%%)',
alias => 'gammav' }
}
$#inargs--;
%invoke = (
vars => [ 'PixelRegion srcPR, destPR', 'int x1, y1, x2, y2',
'GimpLut *lut', 'int i' ],
code => <<'CODE'
{
if (gimp_drawable_indexed (drawable) ||
(gimp_drawable_gray (drawable) && channel != GRAY))
success = FALSE;
else
{
for (i = 0; i < 5; i++)
{
low_input[i] = 0;
high_input[i] = 255;
low_output[i] = 0;
high_output[i] = 255;
gamma[i] = 1.0;
}
low_input[channel] = low_inputv;
high_input[channel] = high_inputv;
gamma[channel] = gammav;
low_output[channel] = low_outputv;
high_output[channel] = high_outputv;
/* setup the lut */
lut = levels_lut_new (gamma, low_input, high_input,
low_output, high_output,
gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free(lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
}
CODE
);
foreach (@inargs[2..6]) {
my $type = $_->{type} =~ /float/ ? 'double' : 'int';
push @{$invoke{vars}}, "$type $_->{name}\[5]";
}
}
sub posterize {
$blurb = 'Posterize the specified drawable.';
$help = <<'HELP';
This procedures reduces the number of shades allows in each intensity channel
to the specified 'levels' parameter.
HELP
&std_pdb_misc;
$date = '1997';
@inargs = (
&drawable_arg,
{ name => 'levels', type => '2 <= int32 <= 255',
desc => 'Levels of posterization: (%%desc%%)' }
);
%invoke = (
vars => [ 'GimpImage *gimage', 'GimpLut *lut',
'PixelRegion srcPR, destPR', 'int x1, y1, x2, y2' ],
code => <<'CODE'
{
if (gimp_drawable_indexed (drawable))
success = FALSE;
else
{
gimage = gimp_drawable_gimage (drawable);
lut = posterize_lut_new (levels, gimp_drawable_bytes (drawable));
/* The application should occur only within selection bounds */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_regions_process_parallel ((p_func) gimp_lut_process, lut, 2,
&srcPR, &destPR);
gimp_lut_free (lut);
gimp_drawable_merge_shadow (drawable, TRUE);
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
}
}
CODE
);
}
@headers = qw("gimpimage.h" "gimpdrawable.h" "gimplut.h" "lut_funcs.h");
@procs = qw(brightness_contrast levels posterize);
%exports = (app => [@procs]);
$desc = 'Palette';
1;

View file

@ -29,7 +29,7 @@ sub inargs {
sub invoke { sub invoke {
%invoke = ( %invoke = (
headers => [ qw("global_edit.h") ], headers => [ qw("global_edit.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<CODE code => <<CODE
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));

View file

@ -51,7 +51,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("gimprc.h") ], headers => [ qw("gimprc.h") ],
vars => ['gchar *value'], vars => [ 'gchar *value' ],
code => 'success = (value = gimprc_find_token (token)) != NULL;' code => 'success = (value = gimprc_find_token (token)) != NULL;'
); );
} }

View file

@ -43,7 +43,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("gradient.h") ], headers => [ qw("gradient.h") ],
vars => ['gradient_t *grad', 'GSList *list', 'int i = 0'], vars => [ 'gradient_t *grad', 'GSList *list', 'int i = 0' ],
success => 'NONE', success => 'NONE',
code => <<'CODE' code => <<'CODE'
{ {
@ -141,7 +141,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("gradient.h") ], headers => [ qw("gradient.h") ],
vars => ['gdouble pos, delta', 'gdouble r, g, b, a', 'gdouble *pv'], vars => [ 'gdouble pos, delta', 'gdouble r, g, b, a', 'gdouble *pv' ],
code => <<'CODE' code => <<'CODE'
{ {
pos = 0.0; pos = 0.0;
@ -194,7 +194,7 @@ HELP
&sample_outargs; &sample_outargs;
%invoke = ( %invoke = (
vars => ['gdouble r, g, b, a', 'gdouble *pv'], vars => [ 'gdouble r, g, b, a', 'gdouble *pv' ],
code => <<'CODE' code => <<'CODE'
{ {
array_length = i * 4; array_length = i * 4;

View file

@ -197,7 +197,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("gradient_select.h") ], headers => [ qw("gradient_select.h") ],
vars => ['gradient_t *grad'], vars => [ 'gradient_t *grad' ],
code => <<'CODE' code => <<'CODE'
{ {
if (strlen (name)) if (strlen (name))

View file

@ -43,7 +43,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("gradient.h") ], headers => [ qw("gradient.h") ],
vars => ['gradient_t *grad', 'GSList *list', 'int i = 0'], vars => [ 'gradient_t *grad', 'GSList *list', 'int i = 0' ],
success => 'NONE', success => 'NONE',
code => <<'CODE' code => <<'CODE'
{ {
@ -141,7 +141,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("gradient.h") ], headers => [ qw("gradient.h") ],
vars => ['gdouble pos, delta', 'gdouble r, g, b, a', 'gdouble *pv'], vars => [ 'gdouble pos, delta', 'gdouble r, g, b, a', 'gdouble *pv' ],
code => <<'CODE' code => <<'CODE'
{ {
pos = 0.0; pos = 0.0;
@ -194,7 +194,7 @@ HELP
&sample_outargs; &sample_outargs;
%invoke = ( %invoke = (
vars => ['gdouble r, g, b, a', 'gdouble *pv'], vars => [ 'gdouble r, g, b, a', 'gdouble *pv' ],
code => <<'CODE' code => <<'CODE'
{ {
array_length = i * 4; array_length = i * 4;

View file

@ -144,7 +144,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("blend.h") ], headers => [ qw("blend.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -202,7 +202,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw ("bucket_fill.h") ], headers => [ qw ("bucket_fill.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -248,7 +248,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("by_color_select.h") ], headers => [ qw("by_color_select.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -339,7 +339,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("color_picker.h") ], headers => [ qw("color_picker.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -521,7 +521,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("flip_tool.h" "tranform_core.h") ], headers => [ qw("flip_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles'], vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -642,7 +642,7 @@ HELP
%invoke = ( %invoke = (
headers => qw("fuzzy_select.h"), headers => qw("fuzzy_select.h"),
vars => ['GimpImage *gimage', 'Channel *new, *old_fuzzy_mask'], vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -763,9 +763,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("perspective_tool.h" "tranform_core.h") ], headers => [ qw("perspective_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'int new_layer', 'double cx, cy', 'double scalex, scaley', 'int new_layer', 'double cx, cy', 'double scalex, scaley',
'double trans_info[8]', 'GimpMatrix matrix'], 'double trans_info[8]', 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -885,9 +885,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("rotate_tool.h" "tranform_core.h") ], headers => [ qw("rotate_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'Layer *layer', 'int new_layer', 'double cx, cy', 'Layer *layer', 'int new_layer', 'double cx, cy',
'GimpMatrix matrix'], 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -967,9 +967,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("scale_tool.h" "tranform_core.h") ], headers => [ qw("scale_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'int new_layer', 'double scalex, scaley', 'int new_layer', 'double scalex, scaley',
'double trans_info[4]', 'GimpMatrix matrix'], 'double trans_info[4]', 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
if (trans_info[X1] < trans_info[X2] && if (trans_info[X1] < trans_info[X2] &&
@ -1057,9 +1057,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("perspective_tool.h" "tranform_core.h") ], headers => [ qw("perspective_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'Layer *layer', 'int new_layer', 'double cx, cy', 'Layer *layer', 'int new_layer', 'double cx, cy',
'GimpMatrix matrix'], 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));

View file

@ -144,7 +144,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("blend.h") ], headers => [ qw("blend.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -202,7 +202,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw ("bucket_fill.h") ], headers => [ qw ("bucket_fill.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -248,7 +248,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("by_color_select.h") ], headers => [ qw("by_color_select.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -339,7 +339,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("color_picker.h") ], headers => [ qw("color_picker.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -521,7 +521,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("flip_tool.h" "tranform_core.h") ], headers => [ qw("flip_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles'], vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -642,7 +642,7 @@ HELP
%invoke = ( %invoke = (
headers => qw("fuzzy_select.h"), headers => qw("fuzzy_select.h"),
vars => ['GimpImage *gimage', 'Channel *new, *old_fuzzy_mask'], vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -763,9 +763,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("perspective_tool.h" "tranform_core.h") ], headers => [ qw("perspective_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'int new_layer', 'double cx, cy', 'double scalex, scaley', 'int new_layer', 'double cx, cy', 'double scalex, scaley',
'double trans_info[8]', 'GimpMatrix matrix'], 'double trans_info[8]', 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -885,9 +885,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("rotate_tool.h" "tranform_core.h") ], headers => [ qw("rotate_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'Layer *layer', 'int new_layer', 'double cx, cy', 'Layer *layer', 'int new_layer', 'double cx, cy',
'GimpMatrix matrix'], 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -967,9 +967,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("scale_tool.h" "tranform_core.h") ], headers => [ qw("scale_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'int new_layer', 'double scalex, scaley', 'int new_layer', 'double scalex, scaley',
'double trans_info[4]', 'GimpMatrix matrix'], 'double trans_info[4]', 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
if (trans_info[X1] < trans_info[X2] && if (trans_info[X1] < trans_info[X2] &&
@ -1057,9 +1057,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("perspective_tool.h" "tranform_core.h") ], headers => [ qw("perspective_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'Layer *layer', 'int new_layer', 'double cx, cy', 'Layer *layer', 'int new_layer', 'double cx, cy',
'GimpMatrix matrix'], 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));

View file

@ -34,7 +34,7 @@ sub color_arg {
sub invoke_get { sub invoke_get {
%invoke = ( %invoke = (
headers => [ qw("gimpimage.h" "palette.h") ], headers => [ qw("gimpimage.h" "palette.h") ],
vars => ['guchar r, g, b'], vars => [ 'guchar r, g, b' ],
code => <<CODE code => <<CODE
{ {
palette_get_@{[shift]}ground (&r, &g, &b); palette_get_@{[shift]}ground (&r, &g, &b);

View file

@ -276,7 +276,7 @@ HELP
$outargs[0]->{alias} = 'data_copy'; $outargs[0]->{alias} = 'data_copy';
%invoke = ( %invoke = (
vars => ['PDBData *data', 'char *data_copy', 'GList *list'], vars => [ 'PDBData *data', 'char *data_copy', 'GList *list' ],
code => <<'CODE' code => <<'CODE'
{ {
success = FALSE; success = FALSE;
@ -318,7 +318,7 @@ HELP
@outargs = ( &data_bytes_arg ); @outargs = ( &data_bytes_arg );
%invoke = ( %invoke = (
vars => ['PDBData *data', 'GList *list'], vars => [ 'PDBData *data', 'GList *list' ],
code => <<'CODE' code => <<'CODE'
{ {
success = FALSE; success = FALSE;
@ -357,7 +357,7 @@ HELP
$inargs[1]->{alias} = 'data_src'; $inargs[1]->{alias} = 'data_src';
%invoke = ( %invoke = (
vars => ['PDBData *data = NULL', 'GList *list'], vars => [ 'PDBData *data = NULL', 'GList *list' ],
code => <<'CODE' code => <<'CODE'
{ {
list = data_list; list = data_list;

View file

@ -264,7 +264,7 @@ text_xlfd_insert_size (gchar *fontname,
if (antialias) if (antialias)
size *= SUPERSAMPLE; size *= SUPERSAMPLE;
sprintf (buffer, "%d", (int) size); sprintf (buffer, "%d", (int) (metric == PIXELS ? size : size * 10));
newfont = workfont = g_new (char, strlen (fontname) + 16); newfont = workfont = g_new (char, strlen (fontname) + 16);

View file

@ -144,7 +144,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("blend.h") ], headers => [ qw("blend.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -202,7 +202,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw ("bucket_fill.h") ], headers => [ qw ("bucket_fill.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -248,7 +248,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("by_color_select.h") ], headers => [ qw("by_color_select.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -339,7 +339,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("color_picker.h") ], headers => [ qw("color_picker.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -521,7 +521,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("flip_tool.h" "tranform_core.h") ], headers => [ qw("flip_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles'], vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -642,7 +642,7 @@ HELP
%invoke = ( %invoke = (
headers => qw("fuzzy_select.h"), headers => qw("fuzzy_select.h"),
vars => ['GimpImage *gimage', 'Channel *new, *old_fuzzy_mask'], vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -763,9 +763,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("perspective_tool.h" "tranform_core.h") ], headers => [ qw("perspective_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'int new_layer', 'double cx, cy', 'double scalex, scaley', 'int new_layer', 'double cx, cy', 'double scalex, scaley',
'double trans_info[8]', 'GimpMatrix matrix'], 'double trans_info[8]', 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -885,9 +885,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("rotate_tool.h" "tranform_core.h") ], headers => [ qw("rotate_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'Layer *layer', 'int new_layer', 'double cx, cy', 'Layer *layer', 'int new_layer', 'double cx, cy',
'GimpMatrix matrix'], 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -967,9 +967,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("scale_tool.h" "tranform_core.h") ], headers => [ qw("scale_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'int new_layer', 'double scalex, scaley', 'int new_layer', 'double scalex, scaley',
'double trans_info[4]', 'GimpMatrix matrix'], 'double trans_info[4]', 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
if (trans_info[X1] < trans_info[X2] && if (trans_info[X1] < trans_info[X2] &&
@ -1057,9 +1057,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("perspective_tool.h" "tranform_core.h") ], headers => [ qw("perspective_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'Layer *layer', 'int new_layer', 'double cx, cy', 'Layer *layer', 'int new_layer', 'double cx, cy',
'GimpMatrix matrix'], 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));

View file

@ -144,7 +144,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("blend.h") ], headers => [ qw("blend.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -202,7 +202,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw ("bucket_fill.h") ], headers => [ qw ("bucket_fill.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -248,7 +248,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("by_color_select.h") ], headers => [ qw("by_color_select.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -339,7 +339,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("color_picker.h") ], headers => [ qw("color_picker.h") ],
vars => ['GimpImage *gimage'], vars => [ 'GimpImage *gimage' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -521,7 +521,7 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("flip_tool.h" "tranform_core.h") ], headers => [ qw("flip_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles'], vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -642,7 +642,7 @@ HELP
%invoke = ( %invoke = (
headers => qw("fuzzy_select.h"), headers => qw("fuzzy_select.h"),
vars => ['GimpImage *gimage', 'Channel *new, *old_fuzzy_mask'], vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -763,9 +763,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("perspective_tool.h" "tranform_core.h") ], headers => [ qw("perspective_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'int new_layer', 'double cx, cy', 'double scalex, scaley', 'int new_layer', 'double cx, cy', 'double scalex, scaley',
'double trans_info[8]', 'GimpMatrix matrix'], 'double trans_info[8]', 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -885,9 +885,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("rotate_tool.h" "tranform_core.h") ], headers => [ qw("rotate_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'Layer *layer', 'int new_layer', 'double cx, cy', 'Layer *layer', 'int new_layer', 'double cx, cy',
'GimpMatrix matrix'], 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));
@ -967,9 +967,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("scale_tool.h" "tranform_core.h") ], headers => [ qw("scale_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'int new_layer', 'double scalex, scaley', 'int new_layer', 'double scalex, scaley',
'double trans_info[4]', 'GimpMatrix matrix'], 'double trans_info[4]', 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
if (trans_info[X1] < trans_info[X2] && if (trans_info[X1] < trans_info[X2] &&
@ -1057,9 +1057,9 @@ HELP
%invoke = ( %invoke = (
headers => [ qw("perspective_tool.h" "tranform_core.h") ], headers => [ qw("perspective_tool.h" "tranform_core.h") ],
vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles',
'Layer *layer', 'int new_layer', 'double cx, cy', 'Layer *layer', 'int new_layer', 'double cx, cy',
'GimpMatrix matrix'], 'GimpMatrix matrix' ],
code => <<'CODE' code => <<'CODE'
{ {
gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); gimage = drawable_gimage (GIMP_DRAWABLE (drawable));