From 43f63f9fcdf3bc10f97294b085ea36bfd4921853 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Sat, 10 Apr 1999 21:41:26 +0000 Subject: [PATCH] Stuff -Yosh --- tools/pdbgen/Makefile.am | 3 +- tools/pdbgen/app.pl | 4 +- tools/pdbgen/enums.pl | 12 ++ tools/pdbgen/groups.pl | 2 +- tools/pdbgen/pdb/brushes.pdb | 6 +- tools/pdbgen/pdb/channel_ops.pdb | 2 +- tools/pdbgen/pdb/color.pdb | 228 +++++++++++++++++++++++++++ tools/pdbgen/pdb/edit.pdb | 2 +- tools/pdbgen/pdb/gimprc.pdb | 2 +- tools/pdbgen/pdb/gradient.pdb-21477 | 6 +- tools/pdbgen/pdb/gradient_select.pdb | 2 +- tools/pdbgen/pdb/gradients.pdb | 6 +- tools/pdbgen/pdb/misc_tools.pdb | 36 ++--- tools/pdbgen/pdb/paint_tools.pdb | 36 ++--- tools/pdbgen/pdb/palette.pdb | 2 +- tools/pdbgen/pdb/procedural_db.pdb | 6 +- tools/pdbgen/pdb/text_tool.pdb | 2 +- tools/pdbgen/pdb/tools.pdb | 36 ++--- tools/pdbgen/pdb/transform_tools.pdb | 36 ++--- 19 files changed, 336 insertions(+), 93 deletions(-) create mode 100644 tools/pdbgen/pdb/color.pdb diff --git a/tools/pdbgen/Makefile.am b/tools/pdbgen/Makefile.am index 365f78677a..abb7c19b5e 100644 --- a/tools/pdbgen/Makefile.am +++ b/tools/pdbgen/Makefile.am @@ -12,7 +12,8 @@ enum_headers = \ ../../app/convolve.h \ ../../app/channel.h \ ../../app/eraser.h \ - ../../app/paint_core.h + ../../app/paint_core.h \ + ../../app/lut_funcs.h enums.pl: enumgen.pl $(enum_headers) cd $(srcdir) \ diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl index b3e05d39f8..82b73bb4c5 100644 --- a/tools/pdbgen/app.pl +++ b/tools/pdbgen/app.pl @@ -261,13 +261,15 @@ CODE } $okvals .= &format_switch_frag($_, 'on_success'); + chomp $okvals; $failvals .= "default:\n"; if (!exists $_->{no_success}) { $success = 1; - $failvals .= ' ' x 6 . "success = FALSE\n" + $failvals .= ' ' x 6 . "success = FALSE;\n" } $failvals .= &format_switch_frag($_, 'on_fail'); + chomp $failvals; $result .= < { CONSTANT => '0', INCREMENTAL => '1' }, 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' } } ); diff --git a/tools/pdbgen/groups.pl b/tools/pdbgen/groups.pl index ee9988b811..41f00a6e54 100644 --- a/tools/pdbgen/groups.pl +++ b/tools/pdbgen/groups.pl @@ -18,4 +18,4 @@ # Modify this list for the groups to parse in the pdb directory @groups = qw(gdisplay edit floating_sel undo palette gradient convert 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); diff --git a/tools/pdbgen/pdb/brushes.pdb b/tools/pdbgen/pdb/brushes.pdb index c85ad2be6e..343a244a54 100644 --- a/tools/pdbgen/pdb/brushes.pdb +++ b/tools/pdbgen/pdb/brushes.pdb @@ -111,7 +111,7 @@ HELP &brush_outargs; %invoke = ( - vars => ['GimpBrush *brushp'], + vars => [ 'GimpBrush *brushp' ], code => 'success = (brushp = get_active_brush ()) != NULL;' ); } @@ -132,7 +132,7 @@ HELP @inargs = ( &brush_arg ); %invoke = ( - vars => ['GimpBrush *brushp'], + vars => [ 'GimpBrush *brushp' ], code => <<'CODE' { brushp = gimp_brush_list_get_brush (brush_list, name); @@ -316,7 +316,7 @@ HELP desc => 'Length of brush mask data' } }; %invoke = ( - vars => ['GimpBrushP brushp = NULL'], + vars => [ 'GimpBrushP brushp = NULL' ], code => <<'CODE' { if (strlen (name)) diff --git a/tools/pdbgen/pdb/channel_ops.pdb b/tools/pdbgen/pdb/channel_ops.pdb index e93ab513db..ce551921da 100644 --- a/tools/pdbgen/pdb/channel_ops.pdb +++ b/tools/pdbgen/pdb/channel_ops.pdb @@ -49,7 +49,7 @@ HELP %invoke = ( headers => [ qw("channel_ops.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb new file mode 100644 index 0000000000..22562391fb --- /dev/null +++ b/tools/pdbgen/pdb/color.pdb @@ -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 + +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; diff --git a/tools/pdbgen/pdb/edit.pdb b/tools/pdbgen/pdb/edit.pdb index 19339452bf..7c63658343 100644 --- a/tools/pdbgen/pdb/edit.pdb +++ b/tools/pdbgen/pdb/edit.pdb @@ -29,7 +29,7 @@ sub inargs { sub invoke { %invoke = ( headers => [ qw("global_edit.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => < [ qw("gimprc.h") ], - vars => ['gchar *value'], + vars => [ 'gchar *value' ], code => 'success = (value = gimprc_find_token (token)) != NULL;' ); } diff --git a/tools/pdbgen/pdb/gradient.pdb-21477 b/tools/pdbgen/pdb/gradient.pdb-21477 index fcbc2765c8..da7397309d 100644 --- a/tools/pdbgen/pdb/gradient.pdb-21477 +++ b/tools/pdbgen/pdb/gradient.pdb-21477 @@ -43,7 +43,7 @@ HELP %invoke = ( headers => [ qw("gradient.h") ], - vars => ['gradient_t *grad', 'GSList *list', 'int i = 0'], + vars => [ 'gradient_t *grad', 'GSList *list', 'int i = 0' ], success => 'NONE', code => <<'CODE' { @@ -141,7 +141,7 @@ HELP %invoke = ( 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' { pos = 0.0; @@ -194,7 +194,7 @@ HELP &sample_outargs; %invoke = ( - vars => ['gdouble r, g, b, a', 'gdouble *pv'], + vars => [ 'gdouble r, g, b, a', 'gdouble *pv' ], code => <<'CODE' { array_length = i * 4; diff --git a/tools/pdbgen/pdb/gradient_select.pdb b/tools/pdbgen/pdb/gradient_select.pdb index e7d1a36af4..ed5ce6c24f 100644 --- a/tools/pdbgen/pdb/gradient_select.pdb +++ b/tools/pdbgen/pdb/gradient_select.pdb @@ -197,7 +197,7 @@ HELP %invoke = ( headers => [ qw("gradient_select.h") ], - vars => ['gradient_t *grad'], + vars => [ 'gradient_t *grad' ], code => <<'CODE' { if (strlen (name)) diff --git a/tools/pdbgen/pdb/gradients.pdb b/tools/pdbgen/pdb/gradients.pdb index fcbc2765c8..da7397309d 100644 --- a/tools/pdbgen/pdb/gradients.pdb +++ b/tools/pdbgen/pdb/gradients.pdb @@ -43,7 +43,7 @@ HELP %invoke = ( headers => [ qw("gradient.h") ], - vars => ['gradient_t *grad', 'GSList *list', 'int i = 0'], + vars => [ 'gradient_t *grad', 'GSList *list', 'int i = 0' ], success => 'NONE', code => <<'CODE' { @@ -141,7 +141,7 @@ HELP %invoke = ( 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' { pos = 0.0; @@ -194,7 +194,7 @@ HELP &sample_outargs; %invoke = ( - vars => ['gdouble r, g, b, a', 'gdouble *pv'], + vars => [ 'gdouble r, g, b, a', 'gdouble *pv' ], code => <<'CODE' { array_length = i * 4; diff --git a/tools/pdbgen/pdb/misc_tools.pdb b/tools/pdbgen/pdb/misc_tools.pdb index ebb2744035..0d4b1d542f 100644 --- a/tools/pdbgen/pdb/misc_tools.pdb +++ b/tools/pdbgen/pdb/misc_tools.pdb @@ -144,7 +144,7 @@ HELP %invoke = ( headers => [ qw("blend.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -202,7 +202,7 @@ HELP %invoke = ( headers => [ qw ("bucket_fill.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -248,7 +248,7 @@ HELP %invoke = ( headers => [ qw("by_color_select.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -339,7 +339,7 @@ HELP %invoke = ( headers => [ qw("color_picker.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -521,7 +521,7 @@ HELP %invoke = ( 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' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -642,7 +642,7 @@ HELP %invoke = ( headers => qw("fuzzy_select.h"), - vars => ['GimpImage *gimage', 'Channel *new, *old_fuzzy_mask'], + vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -763,9 +763,9 @@ HELP %invoke = ( headers => [ qw("perspective_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'int new_layer', 'double cx, cy', 'double scalex, scaley', - 'double trans_info[8]', 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'int new_layer', 'double cx, cy', 'double scalex, scaley', + 'double trans_info[8]', 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -885,9 +885,9 @@ HELP %invoke = ( headers => [ qw("rotate_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'Layer *layer', 'int new_layer', 'double cx, cy', - 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'Layer *layer', 'int new_layer', 'double cx, cy', + 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -967,9 +967,9 @@ HELP %invoke = ( headers => [ qw("scale_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'int new_layer', 'double scalex, scaley', - 'double trans_info[4]', 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'int new_layer', 'double scalex, scaley', + 'double trans_info[4]', 'GimpMatrix matrix' ], code => <<'CODE' { if (trans_info[X1] < trans_info[X2] && @@ -1057,9 +1057,9 @@ HELP %invoke = ( headers => [ qw("perspective_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'Layer *layer', 'int new_layer', 'double cx, cy', - 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'Layer *layer', 'int new_layer', 'double cx, cy', + 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb index ebb2744035..0d4b1d542f 100644 --- a/tools/pdbgen/pdb/paint_tools.pdb +++ b/tools/pdbgen/pdb/paint_tools.pdb @@ -144,7 +144,7 @@ HELP %invoke = ( headers => [ qw("blend.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -202,7 +202,7 @@ HELP %invoke = ( headers => [ qw ("bucket_fill.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -248,7 +248,7 @@ HELP %invoke = ( headers => [ qw("by_color_select.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -339,7 +339,7 @@ HELP %invoke = ( headers => [ qw("color_picker.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -521,7 +521,7 @@ HELP %invoke = ( 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' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -642,7 +642,7 @@ HELP %invoke = ( headers => qw("fuzzy_select.h"), - vars => ['GimpImage *gimage', 'Channel *new, *old_fuzzy_mask'], + vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -763,9 +763,9 @@ HELP %invoke = ( headers => [ qw("perspective_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'int new_layer', 'double cx, cy', 'double scalex, scaley', - 'double trans_info[8]', 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'int new_layer', 'double cx, cy', 'double scalex, scaley', + 'double trans_info[8]', 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -885,9 +885,9 @@ HELP %invoke = ( headers => [ qw("rotate_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'Layer *layer', 'int new_layer', 'double cx, cy', - 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'Layer *layer', 'int new_layer', 'double cx, cy', + 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -967,9 +967,9 @@ HELP %invoke = ( headers => [ qw("scale_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'int new_layer', 'double scalex, scaley', - 'double trans_info[4]', 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'int new_layer', 'double scalex, scaley', + 'double trans_info[4]', 'GimpMatrix matrix' ], code => <<'CODE' { if (trans_info[X1] < trans_info[X2] && @@ -1057,9 +1057,9 @@ HELP %invoke = ( headers => [ qw("perspective_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'Layer *layer', 'int new_layer', 'double cx, cy', - 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'Layer *layer', 'int new_layer', 'double cx, cy', + 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); diff --git a/tools/pdbgen/pdb/palette.pdb b/tools/pdbgen/pdb/palette.pdb index 4e943a4e36..e320c2b0b9 100644 --- a/tools/pdbgen/pdb/palette.pdb +++ b/tools/pdbgen/pdb/palette.pdb @@ -34,7 +34,7 @@ sub color_arg { sub invoke_get { %invoke = ( headers => [ qw("gimpimage.h" "palette.h") ], - vars => ['guchar r, g, b'], + vars => [ 'guchar r, g, b' ], code => <{alias} = 'data_copy'; %invoke = ( - vars => ['PDBData *data', 'char *data_copy', 'GList *list'], + vars => [ 'PDBData *data', 'char *data_copy', 'GList *list' ], code => <<'CODE' { success = FALSE; @@ -318,7 +318,7 @@ HELP @outargs = ( &data_bytes_arg ); %invoke = ( - vars => ['PDBData *data', 'GList *list'], + vars => [ 'PDBData *data', 'GList *list' ], code => <<'CODE' { success = FALSE; @@ -357,7 +357,7 @@ HELP $inargs[1]->{alias} = 'data_src'; %invoke = ( - vars => ['PDBData *data = NULL', 'GList *list'], + vars => [ 'PDBData *data = NULL', 'GList *list' ], code => <<'CODE' { list = data_list; diff --git a/tools/pdbgen/pdb/text_tool.pdb b/tools/pdbgen/pdb/text_tool.pdb index 1dcfe72288..b3acb805dd 100644 --- a/tools/pdbgen/pdb/text_tool.pdb +++ b/tools/pdbgen/pdb/text_tool.pdb @@ -264,7 +264,7 @@ text_xlfd_insert_size (gchar *fontname, if (antialias) size *= SUPERSAMPLE; - sprintf (buffer, "%d", (int) size); + sprintf (buffer, "%d", (int) (metric == PIXELS ? size : size * 10)); newfont = workfont = g_new (char, strlen (fontname) + 16); diff --git a/tools/pdbgen/pdb/tools.pdb b/tools/pdbgen/pdb/tools.pdb index ebb2744035..0d4b1d542f 100644 --- a/tools/pdbgen/pdb/tools.pdb +++ b/tools/pdbgen/pdb/tools.pdb @@ -144,7 +144,7 @@ HELP %invoke = ( headers => [ qw("blend.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -202,7 +202,7 @@ HELP %invoke = ( headers => [ qw ("bucket_fill.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -248,7 +248,7 @@ HELP %invoke = ( headers => [ qw("by_color_select.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -339,7 +339,7 @@ HELP %invoke = ( headers => [ qw("color_picker.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -521,7 +521,7 @@ HELP %invoke = ( 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' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -642,7 +642,7 @@ HELP %invoke = ( headers => qw("fuzzy_select.h"), - vars => ['GimpImage *gimage', 'Channel *new, *old_fuzzy_mask'], + vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -763,9 +763,9 @@ HELP %invoke = ( headers => [ qw("perspective_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'int new_layer', 'double cx, cy', 'double scalex, scaley', - 'double trans_info[8]', 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'int new_layer', 'double cx, cy', 'double scalex, scaley', + 'double trans_info[8]', 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -885,9 +885,9 @@ HELP %invoke = ( headers => [ qw("rotate_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'Layer *layer', 'int new_layer', 'double cx, cy', - 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'Layer *layer', 'int new_layer', 'double cx, cy', + 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -967,9 +967,9 @@ HELP %invoke = ( headers => [ qw("scale_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'int new_layer', 'double scalex, scaley', - 'double trans_info[4]', 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'int new_layer', 'double scalex, scaley', + 'double trans_info[4]', 'GimpMatrix matrix' ], code => <<'CODE' { if (trans_info[X1] < trans_info[X2] && @@ -1057,9 +1057,9 @@ HELP %invoke = ( headers => [ qw("perspective_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'Layer *layer', 'int new_layer', 'double cx, cy', - 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'Layer *layer', 'int new_layer', 'double cx, cy', + 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); diff --git a/tools/pdbgen/pdb/transform_tools.pdb b/tools/pdbgen/pdb/transform_tools.pdb index ebb2744035..0d4b1d542f 100644 --- a/tools/pdbgen/pdb/transform_tools.pdb +++ b/tools/pdbgen/pdb/transform_tools.pdb @@ -144,7 +144,7 @@ HELP %invoke = ( headers => [ qw("blend.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -202,7 +202,7 @@ HELP %invoke = ( headers => [ qw ("bucket_fill.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -248,7 +248,7 @@ HELP %invoke = ( headers => [ qw("by_color_select.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -339,7 +339,7 @@ HELP %invoke = ( headers => [ qw("color_picker.h") ], - vars => ['GimpImage *gimage'], + vars => [ 'GimpImage *gimage' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -521,7 +521,7 @@ HELP %invoke = ( 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' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -642,7 +642,7 @@ HELP %invoke = ( headers => qw("fuzzy_select.h"), - vars => ['GimpImage *gimage', 'Channel *new, *old_fuzzy_mask'], + vars => [ 'GimpImage *gimage', 'Channel *new, *old_fuzzy_mask' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -763,9 +763,9 @@ HELP %invoke = ( headers => [ qw("perspective_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'int new_layer', 'double cx, cy', 'double scalex, scaley', - 'double trans_info[8]', 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'int new_layer', 'double cx, cy', 'double scalex, scaley', + 'double trans_info[8]', 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -885,9 +885,9 @@ HELP %invoke = ( headers => [ qw("rotate_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'Layer *layer', 'int new_layer', 'double cx, cy', - 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'Layer *layer', 'int new_layer', 'double cx, cy', + 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable)); @@ -967,9 +967,9 @@ HELP %invoke = ( headers => [ qw("scale_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'int new_layer', 'double scalex, scaley', - 'double trans_info[4]', 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'int new_layer', 'double scalex, scaley', + 'double trans_info[4]', 'GimpMatrix matrix' ], code => <<'CODE' { if (trans_info[X1] < trans_info[X2] && @@ -1057,9 +1057,9 @@ HELP %invoke = ( headers => [ qw("perspective_tool.h" "tranform_core.h") ], - vars => ['GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', - 'Layer *layer', 'int new_layer', 'double cx, cy', - 'GimpMatrix matrix'], + vars => [ 'GimpImage *gimage', 'TileManger *float_tiles, *new_tiles', + 'Layer *layer', 'int new_layer', 'double cx, cy', + 'GimpMatrix matrix' ], code => <<'CODE' { gimage = drawable_gimage (GIMP_DRAWABLE (drawable));