From 42e2c63ce5b60cb68bfeca935ef086789121ea15 Mon Sep 17 00:00:00 2001 From: Marc Lehmann Date: Fri, 13 Nov 1998 20:40:00 +0000 Subject: [PATCH] API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE * airbrush.c, blend.c, brightness_contrast.c, bucket_fill.c by_color_select.c, channel_ops.c, clone.c, color_balance.c color_picker.c, convolve.c, curves.c, desaturate.c, edit_cmds.c equalize.c, eraser.c, flip_tool.c, fuzzy_select.c, gimage_mask_cmds.c histogram_tool.c, hue_saturation.c, invert.c, levels.c, pencil.c paintbrush.c, perspective_tool.c, posterize.c, rotate_tool.c scale_tool.c, shear_tool.c, text_tool.c, threshold.c: API-mega-break-it-all patch part one: removed the unnecessary PDB_IMAGE argument from many functions. Affected functions: gimp_airbrush gimp_blend gimp_brightness_contrast gimp_bucket_fill gimp_by_color_select gimp_channel_ops_offset gimp_clone gimp_color_balance gimp_color_picker gimp_convolve gimp_curves_explicit gimp_curves_spline gimp_desaturate gimp_edit_clear gimp_edit_copy gimp_edit_cut gimp_edit_fill gimp_edit_paste gimp_edit_stroke gimp_equalize gimp_eraser gimp_eraser_extended gimp_flip gimp_fuzzy_select gimp_histogram gimp_hue_saturation gimp_invert gimp_levels gimp_paintbrush gimp_paintbrush_extended gimp_pencil gimp_perspective gimp_posterize gimp_rotate gimp_scale gimp_selection_float gimp_selection_layer_alpha gimp_selection_load gimp_shear gimp_threshold --- ChangeLog | 19 ++++- app/airbrush.c | 25 ++---- app/base/color-balance.c | 31 +++---- app/base/curves.c | 54 ++++-------- app/base/hue-saturation.c | 29 +++---- app/base/threshold.c | 25 ++---- app/blend.c | 46 ++++------- app/brightness_contrast.c | 23 ++---- app/bucket_fill.c | 31 +++---- app/by_color_select.c | 35 +++----- app/channel_ops.c | 27 ++---- app/clone.c | 33 +++----- app/color_balance.c | 31 +++---- app/color_picker.c | 27 +++--- app/convolve.c | 29 +++---- app/core/gimpdrawable-blend.c | 46 ++++------- app/core/gimpdrawable-desaturate.c | 21 ++--- app/core/gimpdrawable-equalize.c | 23 ++---- app/core/gimpdrawable-invert.c | 28 ++----- app/core/gimpdrawable-offset.c | 27 ++---- app/core/gimpimage-duplicate.c | 27 ++---- app/curves.c | 54 ++++-------- app/desaturate.c | 21 ++--- app/edit_cmds.c | 110 +++++++------------------ app/equalize.c | 23 ++---- app/eraser.c | 54 ++++-------- app/flip_tool.c | 23 ++---- app/fuzzy_select.c | 37 ++++----- app/gimage_mask_cmds.c | 56 ++++--------- app/gimpdrawable-desaturate.c | 21 ++--- app/gimpdrawable-equalize.c | 23 ++---- app/gimpdrawable-invert.c | 28 ++----- app/gimpdrawable-offset.c | 27 ++---- app/gimpimage-duplicate.c | 27 ++---- app/histogram_tool.c | 27 ++---- app/hue_saturation.c | 29 +++---- app/invert.c | 28 ++----- app/levels.c | 33 +++----- app/paint/gimpairbrush.c | 25 ++---- app/paint/gimpclone.c | 33 +++----- app/paint/gimpconvolve.c | 29 +++---- app/paint/gimperaser.c | 54 ++++-------- app/paint/gimppencil.c | 25 ++---- app/paint/gimpsourcecore.c | 33 +++----- app/paintbrush.c | 56 +++++-------- app/pencil.c | 25 ++---- app/perspective_tool.c | 39 ++++----- app/posterize.c | 23 ++---- app/rotate_tool.c | 25 ++---- app/scale_tool.c | 31 +++---- app/shear_tool.c | 27 ++---- app/threshold.c | 25 ++---- app/tools/airbrush.c | 25 ++---- app/tools/blend.c | 46 ++++------- app/tools/brightness_contrast.c | 23 ++---- app/tools/bucket_fill.c | 31 +++---- app/tools/by_color_select.c | 35 +++----- app/tools/clone.c | 33 +++----- app/tools/color_balance.c | 31 +++---- app/tools/color_picker.c | 27 +++--- app/tools/convolve.c | 29 +++---- app/tools/curves.c | 54 ++++-------- app/tools/eraser.c | 54 ++++-------- app/tools/flip_tool.c | 23 ++---- app/tools/fuzzy_select.c | 37 ++++----- app/tools/gimpairbrushtool.c | 25 ++---- app/tools/gimpblendtool.c | 46 ++++------- app/tools/gimpbrightnesscontrasttool.c | 23 ++---- app/tools/gimpbucketfilltool.c | 31 +++---- app/tools/gimpbycolorselecttool.c | 35 +++----- app/tools/gimpclonetool.c | 33 +++----- app/tools/gimpcolorbalancetool.c | 31 +++---- app/tools/gimpconvolvetool.c | 29 +++---- app/tools/gimpcurvestool.c | 54 ++++-------- app/tools/gimperasertool.c | 54 ++++-------- app/tools/gimpfliptool.c | 23 ++---- app/tools/gimpfuzzyselecttool.c | 37 ++++----- app/tools/gimphistogramtool.c | 27 ++---- app/tools/gimphuesaturationtool.c | 29 +++---- app/tools/gimplevelstool.c | 33 +++----- app/tools/gimppenciltool.c | 25 ++---- app/tools/gimpperspectivetool.c | 39 ++++----- app/tools/gimpposterizetool.c | 23 ++---- app/tools/gimpregionselecttool.c | 37 ++++----- app/tools/gimprotatetool.c | 25 ++---- app/tools/gimpscaletool.c | 31 +++---- app/tools/gimpsheartool.c | 27 ++---- app/tools/gimpsourcetool.c | 33 +++----- app/tools/gimpthresholdtool.c | 25 ++---- app/tools/histogram_tool.c | 27 ++---- app/tools/hue_saturation.c | 29 +++---- app/tools/levels.c | 33 +++----- app/tools/paintbrush.c | 56 +++++-------- app/tools/pencil.c | 25 ++---- app/tools/perspective_tool.c | 39 ++++----- app/tools/posterize.c | 23 ++---- app/tools/rotate_tool.c | 25 ++---- app/tools/scale_tool.c | 31 +++---- app/tools/shear_tool.c | 27 ++---- app/tools/threshold.c | 25 ++---- 100 files changed, 1113 insertions(+), 2158 deletions(-) diff --git a/ChangeLog b/ChangeLog index 348f9de952..0d76769477 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Fri Nov 13 16:48:10 CET 1998 Marc Lehmann + + * app/airbrush.c, app/blend.c, app/brightness_contrast.c, + app/bucket_fill.c by_color_select.c, app/channel_ops.c, app/clone.c, + app/color_balance.c color_picker.c, app/convolve.c, app/curves.c, + app/desaturate.c, app/edit_cmds.c equalize.c, app/eraser.c, + app/flip_tool.c, app/fuzzy_select.c, gimage_mask_cmds.c + app/histogram_tool.c, app/hue_saturation.c, app/invert.c, levels.c, + app/pencil.c app/paintbrush.c, app/perspective_tool.c, + app/posterize.c, rotate_tool.c app/scale_tool.c, app/shear_tool.c, + app/text_tool.c, app/threshold.c: + + API-mega-break-it-all patch part one: removed the unnecessary + PDB_IMAGE argument from many functions. + 1998-11-12 Jay Cox * app/drawable_cmds.c, app/gimage_cmds.c @@ -17,7 +32,7 @@ Wed Nov 11 02:27:46 CET 1998 Marc Lehmann * libgimp/gimp.c (gimp_run_procedure2): fixed a memory leak, (gimp_destroy_paramdefs) new function. - * libgimp/gimp.h (gimp_destroy_paramdefs): added header. + * libgimp/gimp.h (gimp_destroy_paramdefs): added prototype. * libgimp/gimpfeatures.h.in (GIMP_HAVE_DESTROY_PARAMDEFS): new macro. * plug-ins/script-fu/script-fu.c (init_procedures): fixed a big memory leak (this also applied to perl!) @@ -64,7 +79,7 @@ Sun Nov 8 17:51:52 PST 1998 Manish Singh * libgimp/{gimp.h, gimpchannel.c, gimpdrawable.c, gimplayer.c}: export the tattoo functions to the plug-ins - * libimp/gserialize.c, libimp/gserialize.h: new files for + * libgimp/gserialize.c, libgimp/gserialize.h: new files for serializing structures * main.c: test the gserialize functions diff --git a/app/airbrush.c b/app/airbrush.c index 2b724ef682..99a73e1c7a 100644 --- a/app/airbrush.c +++ b/app/airbrush.c @@ -295,10 +295,6 @@ airbrush_non_gui_paint_func (PaintCore *paint_core, /* The airbrush procedure definition */ ProcArg airbrush_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -329,7 +325,7 @@ ProcRecord airbrush_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, airbrush_args, /* Output arguments */ @@ -356,25 +352,20 @@ airbrush_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* pressure */ if (success) { - fp_value = args[2].value.pdb_float; + fp_value = args[1].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) non_gui_pressure = fp_value; else @@ -383,7 +374,7 @@ airbrush_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -392,7 +383,7 @@ airbrush_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[4].value.pdb_pointer; + stroke_array = (double *) args[3].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/base/color-balance.c b/app/base/color-balance.c index 240e478815..07ea6d7257 100644 --- a/app/base/color-balance.c +++ b/app/base/color-balance.c @@ -877,10 +877,6 @@ color_balance_yb_text_update (GtkWidget *w, /* The color_balance procedure definition */ ProcArg color_balance_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -918,7 +914,7 @@ ProcRecord color_balance_proc = PDB_INTERNAL, /* Input arguments */ - 7, + 6, color_balance_args, /* Output arguments */ @@ -955,20 +951,15 @@ color_balance_invoker (Argument *args) magenta_green = 0; yellow_blue = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -977,7 +968,7 @@ color_balance_invoker (Argument *args) /* transfer_mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: transfer_mode = SHADOWS; break; @@ -989,13 +980,13 @@ color_balance_invoker (Argument *args) /* preserve_lum */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; preserve_lum = (int_value) ? TRUE : FALSE; } /* cyan_red */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) cyan_red = fp_value; else @@ -1004,7 +995,7 @@ color_balance_invoker (Argument *args) /* magenta_green */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) magenta_green = fp_value; else @@ -1013,7 +1004,7 @@ color_balance_invoker (Argument *args) /* yellow_blue */ if (success) { - fp_value = args[6].value.pdb_float; + fp_value = args[5].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) yellow_blue = fp_value; else diff --git a/app/base/curves.c b/app/base/curves.c index 92ef076bbf..668ad24427 100644 --- a/app/base/curves.c +++ b/app/base/curves.c @@ -1298,10 +1298,6 @@ curves_CR_compose (CRMatrix a, /* Procedure for defining the curve with a spline */ ProcArg curves_spline_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1331,7 +1327,7 @@ ProcRecord curves_spline_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, curves_spline_args, /* Output arguments */ @@ -1359,20 +1355,15 @@ curves_spline_invoker (Argument *args) void *pr; GimpDrawable *drawable; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1382,7 +1373,7 @@ curves_spline_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1402,14 +1393,14 @@ curves_spline_invoker (Argument *args) } if (success) { - num_cp = args[3].value.pdb_int; + num_cp = args[2].value.pdb_int; if (num_cp < 4 || num_cp > 32 || (num_cp & 0x1)) success = FALSE; } /* control points */ if (success) { - control_pts = (unsigned char *) args[4].value.pdb_pointer; + control_pts = (unsigned char *) args[3].value.pdb_pointer; } /* arrange to modify the curves */ @@ -1456,10 +1447,6 @@ curves_spline_invoker (Argument *args) /* Procedure for explicitly defining the curve */ ProcArg curves_explicit_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1489,7 +1476,7 @@ ProcRecord curves_explicit_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, curves_explicit_args, /* Output arguments */ @@ -1516,20 +1503,15 @@ curves_explicit_invoker (Argument *args) void *pr; GimpDrawable *drawable; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1538,7 +1520,7 @@ curves_explicit_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1559,14 +1541,14 @@ curves_explicit_invoker (Argument *args) /* the number of bytes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value != 256) success = FALSE; } /* the curve */ if (success) { - curve = (unsigned char *) args[4].value.pdb_pointer; + curve = (unsigned char *) args[3].value.pdb_pointer; } /* arrange to modify the curves */ diff --git a/app/base/hue-saturation.c b/app/base/hue-saturation.c index 9b37b8b4b0..5a98039e2d 100644 --- a/app/base/hue-saturation.c +++ b/app/base/hue-saturation.c @@ -1027,10 +1027,6 @@ hue_saturation_hue_partition_events (GtkWidget *widget, /* The hue_saturation procedure definition */ ProcArg hue_saturation_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -1064,7 +1060,7 @@ ProcRecord hue_saturation_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, hue_saturation_args, /* Output arguments */ @@ -1100,20 +1096,15 @@ hue_saturation_invoker (Argument *args) lightness = 0.0; saturation = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1122,7 +1113,7 @@ hue_saturation_invoker (Argument *args) /* hue_range */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value < 0 || int_value > 6) success = FALSE; else @@ -1131,7 +1122,7 @@ hue_saturation_invoker (Argument *args) /* hue_offset */ if (success) { - fp_value = args[3].value.pdb_float; + fp_value = args[2].value.pdb_float; if (fp_value < -180 || fp_value > 180) success = FALSE; else @@ -1140,7 +1131,7 @@ hue_saturation_invoker (Argument *args) /* lightness */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value < -100 || fp_value > 100) success = FALSE; else @@ -1149,7 +1140,7 @@ hue_saturation_invoker (Argument *args) /* saturation */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value < -100 || fp_value > 100) success = FALSE; else diff --git a/app/base/threshold.c b/app/base/threshold.c index 0286f06c43..c4949c92d7 100644 --- a/app/base/threshold.c +++ b/app/base/threshold.c @@ -611,10 +611,6 @@ threshold_high_threshold_text_update (GtkWidget *w, /* The threshold procedure definition */ ProcArg threshold_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -640,7 +636,7 @@ ProcRecord threshold_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, threshold_args, /* Output arguments */ @@ -671,20 +667,15 @@ threshold_invoker (args) low_threshold = 0; high_threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -693,7 +684,7 @@ threshold_invoker (args) /* low threhsold */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value >= 0 && int_value < 256) low_threshold = int_value; else @@ -702,7 +693,7 @@ threshold_invoker (args) /* high threhsold */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) high_threshold = int_value; else diff --git a/app/blend.c b/app/blend.c index 95b7c9c9b9..9d0ddd4a86 100644 --- a/app/blend.c +++ b/app/blend.c @@ -618,7 +618,6 @@ blend_button_release (Tool *tool, { return_vals = procedural_db_run_proc ("gimp_blend", &nreturn_vals, - PDB_IMAGE, pdb_image_to_id(gimage), PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)), PDB_INT32, (gint32) blend_options->blend_mode, PDB_INT32, (gint32) blend_options->paint_mode, @@ -1711,10 +1710,6 @@ tools_free_blend (Tool *tool) /* The blend procedure definition */ ProcArg blend_args[] = { - { PDB_IMAGE, - "image", - N_("The image") - }, { PDB_DRAWABLE, "drawable", N_("The affected drawable") @@ -1784,7 +1779,7 @@ ProcRecord blend_proc = PDB_INTERNAL, /* Input arguments */ - 15, + 14, blend_args, /* Output arguments */ @@ -1826,25 +1821,20 @@ blend_invoker (Argument *args) max_depth = 0; threshold = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* blend mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: blend_mode = FG_BG_RGB_MODE; break; @@ -1857,7 +1847,7 @@ blend_invoker (Argument *args) /* paint mode */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= NORMAL_MODE && int_value <= VALUE_MODE) paint_mode = int_value; else @@ -1866,7 +1856,7 @@ blend_invoker (Argument *args) /* gradient type */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; switch (int_value) { case 0: gradient_type = Linear; break; @@ -1884,7 +1874,7 @@ blend_invoker (Argument *args) /* opacity */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) opacity = fp_value; else @@ -1893,7 +1883,7 @@ blend_invoker (Argument *args) /* offset */ if (success) { - fp_value = args[6].value.pdb_float; + fp_value = args[5].value.pdb_float; if (fp_value >= 0.0) offset = fp_value; else @@ -1902,7 +1892,7 @@ blend_invoker (Argument *args) /* repeat */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; switch (int_value) { case 0: repeat = REPEAT_NONE; break; @@ -1914,14 +1904,14 @@ blend_invoker (Argument *args) /* supersampling */ if (success) { - int_value = args[8].value.pdb_int; + int_value = args[7].value.pdb_int; supersample = (int_value ? TRUE : FALSE); } /* max_depth */ if (success) { - int_value = args[9].value.pdb_int; + int_value = args[8].value.pdb_int; if (((int_value >= 1) && (int_value <= 9)) || !supersample) max_depth = int_value; @@ -1931,7 +1921,7 @@ blend_invoker (Argument *args) /* threshold */ if (success) { - fp_value = args[10].value.pdb_float; + fp_value = args[9].value.pdb_float; if (((fp_value >= 0.0) && (fp_value <= 4.0)) || !supersample) threshold = fp_value; @@ -1941,10 +1931,10 @@ blend_invoker (Argument *args) /* x1, y1, x2, y2 */ if (success) { - x1 = args[11].value.pdb_float; - y1 = args[12].value.pdb_float; - x2 = args[13].value.pdb_float; - y2 = args[14].value.pdb_float; + x1 = args[10].value.pdb_float; + y1 = args[11].value.pdb_float; + x2 = args[12].value.pdb_float; + y2 = args[13].value.pdb_float; } /* call the blend procedure */ diff --git a/app/brightness_contrast.c b/app/brightness_contrast.c index 17f6d2afd0..b38acd8fea 100644 --- a/app/brightness_contrast.c +++ b/app/brightness_contrast.c @@ -643,10 +643,6 @@ brightness_contrast_contrast_text_update (GtkWidget *w, /* The brightness_contrast procedure definition */ ProcArg brightness_contrast_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -672,7 +668,7 @@ ProcRecord brightness_contrast_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, brightness_contrast_args, /* Output arguments */ @@ -702,20 +698,15 @@ brightness_contrast_invoker (Argument *args) brightness = 0; contrast = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -724,7 +715,7 @@ brightness_contrast_invoker (Argument *args) /* brightness */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value < -127 || int_value > 127) success = FALSE; else @@ -733,7 +724,7 @@ brightness_contrast_invoker (Argument *args) /* contrast */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value < -127 || int_value > 127) success = FALSE; else diff --git a/app/bucket_fill.c b/app/bucket_fill.c index efaf158ed4..1869ee237a 100644 --- a/app/bucket_fill.c +++ b/app/bucket_fill.c @@ -315,8 +315,6 @@ bucket_fill_button_release (tool, bevent, gdisp_ptr) return_vals = procedural_db_run_proc ("gimp_bucket_fill", &nreturn_vals, - PDB_IMAGE, - pdb_image_to_id(gdisp->gimage), PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gdisp->gimage)), PDB_INT32, (gint32) fill_mode, PDB_INT32, (gint32) bucket_options->paint_mode, @@ -698,10 +696,6 @@ tools_free_bucket_fill (tool) /* The bucket fill procedure definition */ ProcArg bucket_fill_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -747,7 +741,7 @@ ProcRecord bucket_fill_proc = PDB_INTERNAL, /* Input arguments */ - 9, + 8, bucket_fill_args, /* Output arguments */ @@ -781,25 +775,20 @@ bucket_fill_invoker (args) opacity = 100.0; threshold = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* fill mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: fill_mode = FgColorFill; break; @@ -811,7 +800,7 @@ bucket_fill_invoker (args) /* paint mode */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= NORMAL_MODE && int_value <= VALUE_MODE) paint_mode = int_value; else @@ -820,7 +809,7 @@ bucket_fill_invoker (args) /* opacity */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) opacity = fp_value; else @@ -829,7 +818,7 @@ bucket_fill_invoker (args) /* threshold */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 255.0) threshold = fp_value; else @@ -838,7 +827,7 @@ bucket_fill_invoker (args) /* sample_merged */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } /* x, y */ diff --git a/app/by_color_select.c b/app/by_color_select.c index 8dcb7b3893..1c337262fa 100644 --- a/app/by_color_select.c +++ b/app/by_color_select.c @@ -971,10 +971,6 @@ by_color_select_preview_button_press (ByColorDialog *bcd, /* The by_color_select procedure definition */ ProcArg by_color_select_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1020,7 +1016,7 @@ ProcRecord by_color_select_proc = PDB_INTERNAL, /* Input arguments */ - 9, + 8, by_color_select_args, /* Output arguments */ @@ -1051,20 +1047,15 @@ by_color_select_invoker (Argument *args) op = REPLACE; threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* color */ if (success) @@ -1072,14 +1063,14 @@ by_color_select_invoker (Argument *args) int i; unsigned char *color_array; - color_array = (unsigned char *) args[2].value.pdb_pointer; + color_array = (unsigned char *) args[1].value.pdb_pointer; for (i = 0; i < 3; i++) color[i] = color_array[i]; } /* threshold */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value <= 255) threshold = int_value; else @@ -1088,7 +1079,7 @@ by_color_select_invoker (Argument *args) /* operation */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; switch (int_value) { case 0: op = ADD; break; @@ -1101,24 +1092,24 @@ by_color_select_invoker (Argument *args) /* antialiasing? */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; antialias = (int_value) ? TRUE : FALSE; } /* feathering */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; feather = (int_value) ? TRUE : FALSE; } /* feather radius */ if (success) { - feather_radius = args[7].value.pdb_float; + feather_radius = args[6].value.pdb_float; } /* sample merged */ if (success) { - int_value = args[8].value.pdb_int; + int_value = args[7].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } diff --git a/app/channel_ops.c b/app/channel_ops.c index abacd3d778..2a8308510d 100644 --- a/app/channel_ops.c +++ b/app/channel_ops.c @@ -561,10 +561,6 @@ offset_halfheight_update (GtkWidget *widget, /* The offset procedure definition */ ProcArg channel_ops_offset_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable to offset" @@ -598,7 +594,7 @@ ProcRecord channel_ops_offset_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, channel_ops_offset_args, /* Output arguments */ @@ -622,34 +618,29 @@ channel_ops_offset_invoker (Argument *args) int offset_x; int offset_y; - /* the gimage */ if (success) { int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } if (success) { - wrap_around = (args[2].value.pdb_int) ? TRUE : FALSE; + wrap_around = (args[1].value.pdb_int) ? TRUE : FALSE; } if (success) { - fill_type = args[3].value.pdb_int; + fill_type = args[2].value.pdb_int; if (fill_type < OFFSET_BACKGROUND || fill_type > OFFSET_TRANSPARENT) success = FALSE; } if (success) { - offset_x = args[4].value.pdb_int; - offset_y = args[5].value.pdb_int; + offset_x = args[3].value.pdb_int; + offset_y = args[4].value.pdb_int; } if (success) diff --git a/app/clone.c b/app/clone.c index 787aee2c63..6e99135f3a 100644 --- a/app/clone.c +++ b/app/clone.c @@ -547,10 +547,6 @@ clone_non_gui_paint_func (PaintCore *paint_core, /* The clone procedure definition */ ProcArg clone_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -593,7 +589,7 @@ ProcRecord clone_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, clone_args, /* Output arguments */ @@ -621,25 +617,20 @@ clone_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the src drawable */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; src_drawable = drawable_get_ID (int_value); if (src_drawable == NULL || gimage != drawable_gimage (src_drawable)) success = FALSE; @@ -649,7 +640,7 @@ clone_invoker (Argument *args) /* the clone type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: non_gui_type = ImageClone; break; @@ -660,13 +651,13 @@ clone_invoker (Argument *args) /* x, y offsets */ if (success) { - src_x = args[4].value.pdb_float; - src_y = args[5].value.pdb_float; + src_x = args[3].value.pdb_float; + src_y = args[4].value.pdb_float; } /* num strokes */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -675,7 +666,7 @@ clone_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[7].value.pdb_pointer; + stroke_array = (double *) args[6].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/color_balance.c b/app/color_balance.c index 240e478815..07ea6d7257 100644 --- a/app/color_balance.c +++ b/app/color_balance.c @@ -877,10 +877,6 @@ color_balance_yb_text_update (GtkWidget *w, /* The color_balance procedure definition */ ProcArg color_balance_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -918,7 +914,7 @@ ProcRecord color_balance_proc = PDB_INTERNAL, /* Input arguments */ - 7, + 6, color_balance_args, /* Output arguments */ @@ -955,20 +951,15 @@ color_balance_invoker (Argument *args) magenta_green = 0; yellow_blue = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -977,7 +968,7 @@ color_balance_invoker (Argument *args) /* transfer_mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: transfer_mode = SHADOWS; break; @@ -989,13 +980,13 @@ color_balance_invoker (Argument *args) /* preserve_lum */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; preserve_lum = (int_value) ? TRUE : FALSE; } /* cyan_red */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) cyan_red = fp_value; else @@ -1004,7 +995,7 @@ color_balance_invoker (Argument *args) /* magenta_green */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) magenta_green = fp_value; else @@ -1013,7 +1004,7 @@ color_balance_invoker (Argument *args) /* yellow_blue */ if (success) { - fp_value = args[6].value.pdb_float; + fp_value = args[5].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) yellow_blue = fp_value; else diff --git a/app/color_picker.c b/app/color_picker.c index 2fede4fae7..3c00e97606 100644 --- a/app/color_picker.c +++ b/app/color_picker.c @@ -475,10 +475,6 @@ tools_free_color_picker (Tool *tool) /* The color_picker procedure definition */ ProcArg color_picker_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -520,7 +516,7 @@ ProcRecord color_picker_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, color_picker_args, /* Output arguments */ @@ -551,35 +547,32 @@ color_picker_invoker (Argument *args) sample_merged = FALSE; save_color = COLOR_UPDATE; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* x, y */ if (success) { - x = args[2].value.pdb_float; - y = args[3].value.pdb_float; + x = args[1].value.pdb_float; + y = args[2].value.pdb_float; } /* sample_merged */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } /* save_color */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; save_color = (int_value) ? COLOR_NEW : COLOR_UPDATE; } diff --git a/app/convolve.c b/app/convolve.c index 4440ce8242..4faa2bf71e 100644 --- a/app/convolve.c +++ b/app/convolve.c @@ -424,10 +424,6 @@ convolve_non_gui_paint_func (PaintCore *paint_core, /* The convolve procedure definition */ ProcArg convolve_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -462,7 +458,7 @@ ProcRecord convolve_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, convolve_args, /* Output arguments */ @@ -493,25 +489,20 @@ convolve_invoker (Argument *args) type = Blur; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the pressure */ if (success) { - fp_value = args[2].value.pdb_int; + fp_value = args[1].value.pdb_int; if (fp_value >= 0.0 && fp_value <= 100.0) pressure = fp_value; else @@ -520,7 +511,7 @@ convolve_invoker (Argument *args) /* the convolve type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: type = Blur; break; @@ -532,7 +523,7 @@ convolve_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -541,7 +532,7 @@ convolve_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[5].value.pdb_pointer; + stroke_array = (double *) args[4].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index 95b7c9c9b9..9d0ddd4a86 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -618,7 +618,6 @@ blend_button_release (Tool *tool, { return_vals = procedural_db_run_proc ("gimp_blend", &nreturn_vals, - PDB_IMAGE, pdb_image_to_id(gimage), PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)), PDB_INT32, (gint32) blend_options->blend_mode, PDB_INT32, (gint32) blend_options->paint_mode, @@ -1711,10 +1710,6 @@ tools_free_blend (Tool *tool) /* The blend procedure definition */ ProcArg blend_args[] = { - { PDB_IMAGE, - "image", - N_("The image") - }, { PDB_DRAWABLE, "drawable", N_("The affected drawable") @@ -1784,7 +1779,7 @@ ProcRecord blend_proc = PDB_INTERNAL, /* Input arguments */ - 15, + 14, blend_args, /* Output arguments */ @@ -1826,25 +1821,20 @@ blend_invoker (Argument *args) max_depth = 0; threshold = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* blend mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: blend_mode = FG_BG_RGB_MODE; break; @@ -1857,7 +1847,7 @@ blend_invoker (Argument *args) /* paint mode */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= NORMAL_MODE && int_value <= VALUE_MODE) paint_mode = int_value; else @@ -1866,7 +1856,7 @@ blend_invoker (Argument *args) /* gradient type */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; switch (int_value) { case 0: gradient_type = Linear; break; @@ -1884,7 +1874,7 @@ blend_invoker (Argument *args) /* opacity */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) opacity = fp_value; else @@ -1893,7 +1883,7 @@ blend_invoker (Argument *args) /* offset */ if (success) { - fp_value = args[6].value.pdb_float; + fp_value = args[5].value.pdb_float; if (fp_value >= 0.0) offset = fp_value; else @@ -1902,7 +1892,7 @@ blend_invoker (Argument *args) /* repeat */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; switch (int_value) { case 0: repeat = REPEAT_NONE; break; @@ -1914,14 +1904,14 @@ blend_invoker (Argument *args) /* supersampling */ if (success) { - int_value = args[8].value.pdb_int; + int_value = args[7].value.pdb_int; supersample = (int_value ? TRUE : FALSE); } /* max_depth */ if (success) { - int_value = args[9].value.pdb_int; + int_value = args[8].value.pdb_int; if (((int_value >= 1) && (int_value <= 9)) || !supersample) max_depth = int_value; @@ -1931,7 +1921,7 @@ blend_invoker (Argument *args) /* threshold */ if (success) { - fp_value = args[10].value.pdb_float; + fp_value = args[9].value.pdb_float; if (((fp_value >= 0.0) && (fp_value <= 4.0)) || !supersample) threshold = fp_value; @@ -1941,10 +1931,10 @@ blend_invoker (Argument *args) /* x1, y1, x2, y2 */ if (success) { - x1 = args[11].value.pdb_float; - y1 = args[12].value.pdb_float; - x2 = args[13].value.pdb_float; - y2 = args[14].value.pdb_float; + x1 = args[10].value.pdb_float; + y1 = args[11].value.pdb_float; + x2 = args[12].value.pdb_float; + y2 = args[13].value.pdb_float; } /* call the blend procedure */ diff --git a/app/core/gimpdrawable-desaturate.c b/app/core/gimpdrawable-desaturate.c index 224c67ddcc..ac83a3c265 100644 --- a/app/core/gimpdrawable-desaturate.c +++ b/app/core/gimpdrawable-desaturate.c @@ -116,10 +116,6 @@ desaturate (GimpDrawable *drawable) /* The desaturate procedure definition */ ProcArg desaturate_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -137,7 +133,7 @@ ProcRecord desaturate_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, desaturate_args, /* Output arguments */ @@ -160,20 +156,15 @@ desaturate_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* check to make sure the drawable is color */ diff --git a/app/core/gimpdrawable-equalize.c b/app/core/gimpdrawable-equalize.c index 3426d34fe3..46041d54e1 100644 --- a/app/core/gimpdrawable-equalize.c +++ b/app/core/gimpdrawable-equalize.c @@ -234,10 +234,6 @@ eq_histogram (hist, lut, bytes, count) /* The equalize procedure definition */ ProcArg equalize_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -259,7 +255,7 @@ ProcRecord equalize_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, equalize_args, /* Output arguments */ @@ -283,25 +279,20 @@ equalize_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the mask only option */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; mask_only = (int_value) ? TRUE : FALSE; } /* make sure the drawable is not indexed color */ diff --git a/app/core/gimpdrawable-invert.c b/app/core/gimpdrawable-invert.c index fa6b853494..5ad348a723 100644 --- a/app/core/gimpdrawable-invert.c +++ b/app/core/gimpdrawable-invert.c @@ -48,7 +48,6 @@ image_invert (gimage_ptr) return_vals = procedural_db_run_proc ("gimp_invert", &nreturn_vals, - PDB_IMAGE, pdb_image_to_id(gimage), PDB_DRAWABLE, drawable_ID (drawable), PDB_END); @@ -117,10 +116,6 @@ invert (drawable) /* The invert procedure definition */ ProcArg invert_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -138,7 +133,7 @@ ProcRecord invert_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, invert_args, /* Output arguments */ @@ -161,26 +156,15 @@ invert_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - { - g_warning ("bleep1\n"); - success = FALSE; - } - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - { - g_warning ("bleep2\n"); - success = FALSE; - } + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c index abacd3d778..2a8308510d 100644 --- a/app/core/gimpdrawable-offset.c +++ b/app/core/gimpdrawable-offset.c @@ -561,10 +561,6 @@ offset_halfheight_update (GtkWidget *widget, /* The offset procedure definition */ ProcArg channel_ops_offset_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable to offset" @@ -598,7 +594,7 @@ ProcRecord channel_ops_offset_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, channel_ops_offset_args, /* Output arguments */ @@ -622,34 +618,29 @@ channel_ops_offset_invoker (Argument *args) int offset_x; int offset_y; - /* the gimage */ if (success) { int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } if (success) { - wrap_around = (args[2].value.pdb_int) ? TRUE : FALSE; + wrap_around = (args[1].value.pdb_int) ? TRUE : FALSE; } if (success) { - fill_type = args[3].value.pdb_int; + fill_type = args[2].value.pdb_int; if (fill_type < OFFSET_BACKGROUND || fill_type > OFFSET_TRANSPARENT) success = FALSE; } if (success) { - offset_x = args[4].value.pdb_int; - offset_y = args[5].value.pdb_int; + offset_x = args[3].value.pdb_int; + offset_y = args[4].value.pdb_int; } if (success) diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index abacd3d778..2a8308510d 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -561,10 +561,6 @@ offset_halfheight_update (GtkWidget *widget, /* The offset procedure definition */ ProcArg channel_ops_offset_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable to offset" @@ -598,7 +594,7 @@ ProcRecord channel_ops_offset_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, channel_ops_offset_args, /* Output arguments */ @@ -622,34 +618,29 @@ channel_ops_offset_invoker (Argument *args) int offset_x; int offset_y; - /* the gimage */ if (success) { int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } if (success) { - wrap_around = (args[2].value.pdb_int) ? TRUE : FALSE; + wrap_around = (args[1].value.pdb_int) ? TRUE : FALSE; } if (success) { - fill_type = args[3].value.pdb_int; + fill_type = args[2].value.pdb_int; if (fill_type < OFFSET_BACKGROUND || fill_type > OFFSET_TRANSPARENT) success = FALSE; } if (success) { - offset_x = args[4].value.pdb_int; - offset_y = args[5].value.pdb_int; + offset_x = args[3].value.pdb_int; + offset_y = args[4].value.pdb_int; } if (success) diff --git a/app/curves.c b/app/curves.c index 92ef076bbf..668ad24427 100644 --- a/app/curves.c +++ b/app/curves.c @@ -1298,10 +1298,6 @@ curves_CR_compose (CRMatrix a, /* Procedure for defining the curve with a spline */ ProcArg curves_spline_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1331,7 +1327,7 @@ ProcRecord curves_spline_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, curves_spline_args, /* Output arguments */ @@ -1359,20 +1355,15 @@ curves_spline_invoker (Argument *args) void *pr; GimpDrawable *drawable; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1382,7 +1373,7 @@ curves_spline_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1402,14 +1393,14 @@ curves_spline_invoker (Argument *args) } if (success) { - num_cp = args[3].value.pdb_int; + num_cp = args[2].value.pdb_int; if (num_cp < 4 || num_cp > 32 || (num_cp & 0x1)) success = FALSE; } /* control points */ if (success) { - control_pts = (unsigned char *) args[4].value.pdb_pointer; + control_pts = (unsigned char *) args[3].value.pdb_pointer; } /* arrange to modify the curves */ @@ -1456,10 +1447,6 @@ curves_spline_invoker (Argument *args) /* Procedure for explicitly defining the curve */ ProcArg curves_explicit_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1489,7 +1476,7 @@ ProcRecord curves_explicit_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, curves_explicit_args, /* Output arguments */ @@ -1516,20 +1503,15 @@ curves_explicit_invoker (Argument *args) void *pr; GimpDrawable *drawable; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1538,7 +1520,7 @@ curves_explicit_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1559,14 +1541,14 @@ curves_explicit_invoker (Argument *args) /* the number of bytes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value != 256) success = FALSE; } /* the curve */ if (success) { - curve = (unsigned char *) args[4].value.pdb_pointer; + curve = (unsigned char *) args[3].value.pdb_pointer; } /* arrange to modify the curves */ diff --git a/app/desaturate.c b/app/desaturate.c index 224c67ddcc..ac83a3c265 100644 --- a/app/desaturate.c +++ b/app/desaturate.c @@ -116,10 +116,6 @@ desaturate (GimpDrawable *drawable) /* The desaturate procedure definition */ ProcArg desaturate_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -137,7 +133,7 @@ ProcRecord desaturate_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, desaturate_args, /* Output arguments */ @@ -160,20 +156,15 @@ desaturate_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* check to make sure the drawable is color */ diff --git a/app/edit_cmds.c b/app/edit_cmds.c index 53461ec303..2b5aefb2b8 100644 --- a/app/edit_cmds.c +++ b/app/edit_cmds.c @@ -50,15 +50,11 @@ edit_cut_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* create the new image */ if (success) @@ -70,10 +66,6 @@ edit_cut_invoker (Argument *args) /* The procedure definition */ ProcArg edit_cut_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable to cut from") @@ -91,7 +83,7 @@ ProcRecord edit_cut_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, edit_cut_args, /* Output arguments */ @@ -119,15 +111,11 @@ edit_copy_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* create the new image */ @@ -140,10 +128,6 @@ edit_copy_invoker (Argument *args) /* The procedure definition */ ProcArg edit_copy_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable to copy from") @@ -161,7 +145,7 @@ ProcRecord edit_copy_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, edit_copy_args, /* Output arguments */ @@ -191,19 +175,15 @@ edit_paste_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; + drawable = drawable_get_ID (int_value); + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } if (success) { int_value = args[1].value.pdb_int; - drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; - } - if (success) - { - int_value = args[2].value.pdb_int; paste_into = (int_value) ? TRUE : FALSE; } @@ -222,10 +202,6 @@ edit_paste_invoker (Argument *args) /* The procedure definition */ ProcArg edit_paste_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable to paste from") @@ -255,7 +231,7 @@ ProcRecord edit_paste_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, edit_paste_args, /* Output arguments */ @@ -283,15 +259,11 @@ edit_clear_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* create the new image */ @@ -304,10 +276,6 @@ edit_clear_invoker (Argument *args) /* The procedure definition */ ProcArg edit_clear_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("The drawable to clear from") @@ -325,7 +293,7 @@ ProcRecord edit_clear_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, edit_clear_args, /* Output arguments */ @@ -352,15 +320,11 @@ edit_fill_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* create the new image */ @@ -373,10 +337,6 @@ edit_fill_invoker (Argument *args) /* The procedure definition */ ProcArg edit_fill_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable to fill from") @@ -394,7 +354,7 @@ ProcRecord edit_fill_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, edit_fill_args, /* Output arguments */ @@ -422,15 +382,11 @@ edit_stroke_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* create the new image */ @@ -443,10 +399,6 @@ edit_stroke_invoker (Argument *args) /* The procedure definition */ ProcArg edit_stroke_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable to stroke to") @@ -464,7 +416,7 @@ ProcRecord edit_stroke_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, edit_stroke_args, /* Output arguments */ diff --git a/app/equalize.c b/app/equalize.c index 3426d34fe3..46041d54e1 100644 --- a/app/equalize.c +++ b/app/equalize.c @@ -234,10 +234,6 @@ eq_histogram (hist, lut, bytes, count) /* The equalize procedure definition */ ProcArg equalize_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -259,7 +255,7 @@ ProcRecord equalize_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, equalize_args, /* Output arguments */ @@ -283,25 +279,20 @@ equalize_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the mask only option */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; mask_only = (int_value) ? TRUE : FALSE; } /* make sure the drawable is not indexed color */ diff --git a/app/eraser.c b/app/eraser.c index 33a3fc0d21..5c2e3df74f 100644 --- a/app/eraser.c +++ b/app/eraser.c @@ -202,10 +202,6 @@ eraser_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int st /* The eraser procedure definition */ ProcArg eraser_extended_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -230,10 +226,6 @@ ProcArg eraser_extended_args[] = ProcArg eraser_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -260,7 +252,7 @@ ProcRecord eraser_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, eraser_args, /* Output arguments */ @@ -282,7 +274,7 @@ ProcRecord eraser_extended_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, eraser_extended_args, /* Output arguments */ @@ -308,25 +300,20 @@ eraser_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -335,7 +322,7 @@ eraser_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ @@ -390,25 +377,20 @@ eraser_extended_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -417,7 +399,7 @@ eraser_extended_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ @@ -426,8 +408,8 @@ eraser_extended_invoker (args) if (success) { - non_gui_hard = args[4].value.pdb_int; - non_gui_incremental = args[5].value.pdb_int; + non_gui_hard = args[3].value.pdb_int; + non_gui_incremental = args[4].value.pdb_int; } if (success) diff --git a/app/flip_tool.c b/app/flip_tool.c index a694983e16..977746cf1d 100644 --- a/app/flip_tool.c +++ b/app/flip_tool.c @@ -332,10 +332,6 @@ flip_change_type (int new_type) /* The flip procedure definition */ ProcArg flip_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -365,7 +361,7 @@ ProcRecord flip_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, flip_args, /* Output arguments */ @@ -395,25 +391,20 @@ flip_invoker (Argument *args) new_tiles = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* flip type */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: flip_type = 0; break; diff --git a/app/fuzzy_select.c b/app/fuzzy_select.c index 7eac4dd0a9..f345cdc00c 100644 --- a/app/fuzzy_select.c +++ b/app/fuzzy_select.c @@ -579,10 +579,6 @@ tools_free_fuzzy_select (Tool *tool) /* The fuzzy_select procedure definition */ ProcArg fuzzy_select_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -632,7 +628,7 @@ ProcRecord fuzzy_select_proc = PDB_INTERNAL, /* Input arguments */ - 10, + 9, fuzzy_select_args, /* Output arguments */ @@ -663,31 +659,26 @@ fuzzy_select_invoker (Argument *args) op = REPLACE; threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* x, y */ if (success) { - x = args[2].value.pdb_float; - y = args[3].value.pdb_float; + x = args[1].value.pdb_float; + y = args[2].value.pdb_float; } /* threshold */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value <= 255) threshold = int_value; else @@ -696,7 +687,7 @@ fuzzy_select_invoker (Argument *args) /* operation */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; switch (int_value) { case 0: op = ADD; break; @@ -709,24 +700,24 @@ fuzzy_select_invoker (Argument *args) /* antialiasing? */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; antialias = (int_value) ? TRUE : FALSE; } /* feathering */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; feather = (int_value) ? TRUE : FALSE; } /* feather radius */ if (success) { - feather_radius = args[8].value.pdb_float; + feather_radius = args[7].value.pdb_float; } /* sample merged */ if (success) { - int_value = args[9].value.pdb_int; + int_value = args[8].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } diff --git a/app/gimage_mask_cmds.c b/app/gimage_mask_cmds.c index 7649a678d5..bec4f195cd 100644 --- a/app/gimage_mask_cmds.c +++ b/app/gimage_mask_cmds.c @@ -359,18 +359,15 @@ gimage_mask_float_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } if (success) { - int_value = args[1].value.pdb_int; - drawable = drawable_get_ID (int_value); - } - if (success) - { - offx = args[2].value.pdb_int; - offy = args[3].value.pdb_int; + offx = args[1].value.pdb_int; + offy = args[2].value.pdb_int; } if (success) success = ((layer = gimage_mask_float (gimage, drawable, offx, offy)) != NULL); @@ -386,10 +383,6 @@ gimage_mask_float_invoker (Argument *args) /* The procedure definition */ ProcArg gimage_mask_float_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable from which to float selection" @@ -423,7 +416,7 @@ ProcRecord gimage_mask_float_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, gimage_mask_float_args, /* Output arguments */ @@ -975,14 +968,10 @@ gimage_mask_layer_alpha_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; if ((layer = layer_get_ID (int_value)) == NULL) - success = FALSE; + success = FALSE; + else + gimage = drawable_gimage (GIMP_DRAWABLE(layer)); } if (success) gimage_mask_layer_alpha (gimage, layer); @@ -993,10 +982,6 @@ gimage_mask_layer_alpha_invoker (Argument *args) /* The procedure definition */ ProcArg gimage_mask_layer_alpha_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_LAYER, "layer", "layer with alpha" @@ -1014,7 +999,7 @@ ProcRecord gimage_mask_layer_alpha_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, gimage_mask_layer_alpha_args, /* Output arguments */ @@ -1039,17 +1024,14 @@ gimage_mask_load_invoker (Argument *args) if (success) { int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; if ((channel = channel_get_ID (int_value)) == NULL) success = FALSE; else - success = (drawable_width (GIMP_DRAWABLE(channel)) == gimage->width && - drawable_height (GIMP_DRAWABLE(channel)) == gimage->height); + { + success = (drawable_width (GIMP_DRAWABLE(channel)) == gimage->width && + drawable_height (GIMP_DRAWABLE(channel)) == gimage->height); + gimage = drawable_gimage (GIMP_DRAWABLE(channel)); + } } if (success) @@ -1061,10 +1043,6 @@ gimage_mask_load_invoker (Argument *args) /* The procedure definition */ ProcArg gimage_mask_load_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_CHANNEL, "channel", "the channel" @@ -1082,7 +1060,7 @@ ProcRecord gimage_mask_load_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, gimage_mask_load_args, /* Output arguments */ diff --git a/app/gimpdrawable-desaturate.c b/app/gimpdrawable-desaturate.c index 224c67ddcc..ac83a3c265 100644 --- a/app/gimpdrawable-desaturate.c +++ b/app/gimpdrawable-desaturate.c @@ -116,10 +116,6 @@ desaturate (GimpDrawable *drawable) /* The desaturate procedure definition */ ProcArg desaturate_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -137,7 +133,7 @@ ProcRecord desaturate_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, desaturate_args, /* Output arguments */ @@ -160,20 +156,15 @@ desaturate_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* check to make sure the drawable is color */ diff --git a/app/gimpdrawable-equalize.c b/app/gimpdrawable-equalize.c index 3426d34fe3..46041d54e1 100644 --- a/app/gimpdrawable-equalize.c +++ b/app/gimpdrawable-equalize.c @@ -234,10 +234,6 @@ eq_histogram (hist, lut, bytes, count) /* The equalize procedure definition */ ProcArg equalize_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -259,7 +255,7 @@ ProcRecord equalize_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, equalize_args, /* Output arguments */ @@ -283,25 +279,20 @@ equalize_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the mask only option */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; mask_only = (int_value) ? TRUE : FALSE; } /* make sure the drawable is not indexed color */ diff --git a/app/gimpdrawable-invert.c b/app/gimpdrawable-invert.c index fa6b853494..5ad348a723 100644 --- a/app/gimpdrawable-invert.c +++ b/app/gimpdrawable-invert.c @@ -48,7 +48,6 @@ image_invert (gimage_ptr) return_vals = procedural_db_run_proc ("gimp_invert", &nreturn_vals, - PDB_IMAGE, pdb_image_to_id(gimage), PDB_DRAWABLE, drawable_ID (drawable), PDB_END); @@ -117,10 +116,6 @@ invert (drawable) /* The invert procedure definition */ ProcArg invert_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -138,7 +133,7 @@ ProcRecord invert_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, invert_args, /* Output arguments */ @@ -161,26 +156,15 @@ invert_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - { - g_warning ("bleep1\n"); - success = FALSE; - } - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - { - g_warning ("bleep2\n"); - success = FALSE; - } + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) diff --git a/app/gimpdrawable-offset.c b/app/gimpdrawable-offset.c index abacd3d778..2a8308510d 100644 --- a/app/gimpdrawable-offset.c +++ b/app/gimpdrawable-offset.c @@ -561,10 +561,6 @@ offset_halfheight_update (GtkWidget *widget, /* The offset procedure definition */ ProcArg channel_ops_offset_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable to offset" @@ -598,7 +594,7 @@ ProcRecord channel_ops_offset_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, channel_ops_offset_args, /* Output arguments */ @@ -622,34 +618,29 @@ channel_ops_offset_invoker (Argument *args) int offset_x; int offset_y; - /* the gimage */ if (success) { int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } if (success) { - wrap_around = (args[2].value.pdb_int) ? TRUE : FALSE; + wrap_around = (args[1].value.pdb_int) ? TRUE : FALSE; } if (success) { - fill_type = args[3].value.pdb_int; + fill_type = args[2].value.pdb_int; if (fill_type < OFFSET_BACKGROUND || fill_type > OFFSET_TRANSPARENT) success = FALSE; } if (success) { - offset_x = args[4].value.pdb_int; - offset_y = args[5].value.pdb_int; + offset_x = args[3].value.pdb_int; + offset_y = args[4].value.pdb_int; } if (success) diff --git a/app/gimpimage-duplicate.c b/app/gimpimage-duplicate.c index abacd3d778..2a8308510d 100644 --- a/app/gimpimage-duplicate.c +++ b/app/gimpimage-duplicate.c @@ -561,10 +561,6 @@ offset_halfheight_update (GtkWidget *widget, /* The offset procedure definition */ ProcArg channel_ops_offset_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable to offset" @@ -598,7 +594,7 @@ ProcRecord channel_ops_offset_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, channel_ops_offset_args, /* Output arguments */ @@ -622,34 +618,29 @@ channel_ops_offset_invoker (Argument *args) int offset_x; int offset_y; - /* the gimage */ if (success) { int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } - if (success) - { - int_value = args[1].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } if (success) { - wrap_around = (args[2].value.pdb_int) ? TRUE : FALSE; + wrap_around = (args[1].value.pdb_int) ? TRUE : FALSE; } if (success) { - fill_type = args[3].value.pdb_int; + fill_type = args[2].value.pdb_int; if (fill_type < OFFSET_BACKGROUND || fill_type > OFFSET_TRANSPARENT) success = FALSE; } if (success) { - offset_x = args[4].value.pdb_int; - offset_y = args[5].value.pdb_int; + offset_x = args[3].value.pdb_int; + offset_y = args[4].value.pdb_int; } if (success) diff --git a/app/histogram_tool.c b/app/histogram_tool.c index a08a5f00ed..075c5689e0 100644 --- a/app/histogram_tool.c +++ b/app/histogram_tool.c @@ -613,10 +613,6 @@ histogram_tool_blue_callback (GtkWidget *w, /* The histogram procedure definition */ ProcArg histogram_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -674,7 +670,7 @@ ProcRecord histogram_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, histogram_args, /* Output arguments */ @@ -709,25 +705,20 @@ histogram_invoker (Argument *args) low_range = 0; high_range = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -748,7 +739,7 @@ histogram_invoker (Argument *args) /* low range */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) low_range = int_value; else @@ -757,7 +748,7 @@ histogram_invoker (Argument *args) /* high range */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value < 256) high_range = int_value; else diff --git a/app/hue_saturation.c b/app/hue_saturation.c index 9b37b8b4b0..5a98039e2d 100644 --- a/app/hue_saturation.c +++ b/app/hue_saturation.c @@ -1027,10 +1027,6 @@ hue_saturation_hue_partition_events (GtkWidget *widget, /* The hue_saturation procedure definition */ ProcArg hue_saturation_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -1064,7 +1060,7 @@ ProcRecord hue_saturation_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, hue_saturation_args, /* Output arguments */ @@ -1100,20 +1096,15 @@ hue_saturation_invoker (Argument *args) lightness = 0.0; saturation = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1122,7 +1113,7 @@ hue_saturation_invoker (Argument *args) /* hue_range */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value < 0 || int_value > 6) success = FALSE; else @@ -1131,7 +1122,7 @@ hue_saturation_invoker (Argument *args) /* hue_offset */ if (success) { - fp_value = args[3].value.pdb_float; + fp_value = args[2].value.pdb_float; if (fp_value < -180 || fp_value > 180) success = FALSE; else @@ -1140,7 +1131,7 @@ hue_saturation_invoker (Argument *args) /* lightness */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value < -100 || fp_value > 100) success = FALSE; else @@ -1149,7 +1140,7 @@ hue_saturation_invoker (Argument *args) /* saturation */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value < -100 || fp_value > 100) success = FALSE; else diff --git a/app/invert.c b/app/invert.c index fa6b853494..5ad348a723 100644 --- a/app/invert.c +++ b/app/invert.c @@ -48,7 +48,6 @@ image_invert (gimage_ptr) return_vals = procedural_db_run_proc ("gimp_invert", &nreturn_vals, - PDB_IMAGE, pdb_image_to_id(gimage), PDB_DRAWABLE, drawable_ID (drawable), PDB_END); @@ -117,10 +116,6 @@ invert (drawable) /* The invert procedure definition */ ProcArg invert_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -138,7 +133,7 @@ ProcRecord invert_proc = PDB_INTERNAL, /* Input arguments */ - 2, + 1, invert_args, /* Output arguments */ @@ -161,26 +156,15 @@ invert_invoker (args) drawable = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - { - g_warning ("bleep1\n"); - success = FALSE; - } - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - { - g_warning ("bleep2\n"); - success = FALSE; - } + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) diff --git a/app/levels.c b/app/levels.c index 3cb41bf2e6..cfab7c3b8a 100644 --- a/app/levels.c +++ b/app/levels.c @@ -1440,10 +1440,6 @@ levels_output_da_events (GtkWidget *widget, /* The levels procedure definition */ ProcArg levels_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -1485,7 +1481,7 @@ ProcRecord levels_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, levels_args, /* Output arguments */ @@ -1524,20 +1520,15 @@ levels_invoker (Argument *args) low_output = 0; high_output = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1546,7 +1537,7 @@ levels_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1567,7 +1558,7 @@ levels_invoker (Argument *args) /* low input */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) low_input = int_value; else @@ -1576,7 +1567,7 @@ levels_invoker (Argument *args) /* high input */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value < 256) high_input = int_value; else @@ -1585,7 +1576,7 @@ levels_invoker (Argument *args) /* gamma */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.1 && fp_value <= 10.0) gamma = fp_value; else @@ -1594,7 +1585,7 @@ levels_invoker (Argument *args) /* low output */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value >= 0 && int_value < 256) low_output = int_value; else @@ -1603,7 +1594,7 @@ levels_invoker (Argument *args) /* high output */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; if (int_value >= 0 && int_value < 256) high_output = int_value; else diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c index 2b724ef682..99a73e1c7a 100644 --- a/app/paint/gimpairbrush.c +++ b/app/paint/gimpairbrush.c @@ -295,10 +295,6 @@ airbrush_non_gui_paint_func (PaintCore *paint_core, /* The airbrush procedure definition */ ProcArg airbrush_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -329,7 +325,7 @@ ProcRecord airbrush_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, airbrush_args, /* Output arguments */ @@ -356,25 +352,20 @@ airbrush_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* pressure */ if (success) { - fp_value = args[2].value.pdb_float; + fp_value = args[1].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) non_gui_pressure = fp_value; else @@ -383,7 +374,7 @@ airbrush_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -392,7 +383,7 @@ airbrush_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[4].value.pdb_pointer; + stroke_array = (double *) args[3].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c index 787aee2c63..6e99135f3a 100644 --- a/app/paint/gimpclone.c +++ b/app/paint/gimpclone.c @@ -547,10 +547,6 @@ clone_non_gui_paint_func (PaintCore *paint_core, /* The clone procedure definition */ ProcArg clone_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -593,7 +589,7 @@ ProcRecord clone_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, clone_args, /* Output arguments */ @@ -621,25 +617,20 @@ clone_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the src drawable */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; src_drawable = drawable_get_ID (int_value); if (src_drawable == NULL || gimage != drawable_gimage (src_drawable)) success = FALSE; @@ -649,7 +640,7 @@ clone_invoker (Argument *args) /* the clone type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: non_gui_type = ImageClone; break; @@ -660,13 +651,13 @@ clone_invoker (Argument *args) /* x, y offsets */ if (success) { - src_x = args[4].value.pdb_float; - src_y = args[5].value.pdb_float; + src_x = args[3].value.pdb_float; + src_y = args[4].value.pdb_float; } /* num strokes */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -675,7 +666,7 @@ clone_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[7].value.pdb_pointer; + stroke_array = (double *) args[6].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c index 4440ce8242..4faa2bf71e 100644 --- a/app/paint/gimpconvolve.c +++ b/app/paint/gimpconvolve.c @@ -424,10 +424,6 @@ convolve_non_gui_paint_func (PaintCore *paint_core, /* The convolve procedure definition */ ProcArg convolve_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -462,7 +458,7 @@ ProcRecord convolve_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, convolve_args, /* Output arguments */ @@ -493,25 +489,20 @@ convolve_invoker (Argument *args) type = Blur; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the pressure */ if (success) { - fp_value = args[2].value.pdb_int; + fp_value = args[1].value.pdb_int; if (fp_value >= 0.0 && fp_value <= 100.0) pressure = fp_value; else @@ -520,7 +511,7 @@ convolve_invoker (Argument *args) /* the convolve type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: type = Blur; break; @@ -532,7 +523,7 @@ convolve_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -541,7 +532,7 @@ convolve_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[5].value.pdb_pointer; + stroke_array = (double *) args[4].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c index 33a3fc0d21..5c2e3df74f 100644 --- a/app/paint/gimperaser.c +++ b/app/paint/gimperaser.c @@ -202,10 +202,6 @@ eraser_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int st /* The eraser procedure definition */ ProcArg eraser_extended_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -230,10 +226,6 @@ ProcArg eraser_extended_args[] = ProcArg eraser_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -260,7 +252,7 @@ ProcRecord eraser_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, eraser_args, /* Output arguments */ @@ -282,7 +274,7 @@ ProcRecord eraser_extended_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, eraser_extended_args, /* Output arguments */ @@ -308,25 +300,20 @@ eraser_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -335,7 +322,7 @@ eraser_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ @@ -390,25 +377,20 @@ eraser_extended_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -417,7 +399,7 @@ eraser_extended_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ @@ -426,8 +408,8 @@ eraser_extended_invoker (args) if (success) { - non_gui_hard = args[4].value.pdb_int; - non_gui_incremental = args[5].value.pdb_int; + non_gui_hard = args[3].value.pdb_int; + non_gui_incremental = args[4].value.pdb_int; } if (success) diff --git a/app/paint/gimppencil.c b/app/paint/gimppencil.c index 3e4cd39889..2306063fa8 100644 --- a/app/paint/gimppencil.c +++ b/app/paint/gimppencil.c @@ -131,10 +131,6 @@ pencil_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int st /* The pencil procedure definition */ ProcArg pencil_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -161,7 +157,7 @@ ProcRecord pencil_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, pencil_args, /* Output arguments */ @@ -187,25 +183,20 @@ pencil_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -214,7 +205,7 @@ pencil_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/paint/gimpsourcecore.c b/app/paint/gimpsourcecore.c index 787aee2c63..6e99135f3a 100644 --- a/app/paint/gimpsourcecore.c +++ b/app/paint/gimpsourcecore.c @@ -547,10 +547,6 @@ clone_non_gui_paint_func (PaintCore *paint_core, /* The clone procedure definition */ ProcArg clone_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -593,7 +589,7 @@ ProcRecord clone_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, clone_args, /* Output arguments */ @@ -621,25 +617,20 @@ clone_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the src drawable */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; src_drawable = drawable_get_ID (int_value); if (src_drawable == NULL || gimage != drawable_gimage (src_drawable)) success = FALSE; @@ -649,7 +640,7 @@ clone_invoker (Argument *args) /* the clone type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: non_gui_type = ImageClone; break; @@ -660,13 +651,13 @@ clone_invoker (Argument *args) /* x, y offsets */ if (success) { - src_x = args[4].value.pdb_float; - src_y = args[5].value.pdb_float; + src_x = args[3].value.pdb_float; + src_y = args[4].value.pdb_float; } /* num strokes */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -675,7 +666,7 @@ clone_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[7].value.pdb_pointer; + stroke_array = (double *) args[6].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/paintbrush.c b/app/paintbrush.c index 0927048f9c..d443446029 100644 --- a/app/paintbrush.c +++ b/app/paintbrush.c @@ -244,10 +244,6 @@ paintbrush_non_gui_paint_func (PaintCore *paint_core, /* The paintbrush procedure definition */ ProcArg paintbrush_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -268,10 +264,6 @@ ProcArg paintbrush_args[] = ProcArg paintbrush_extended_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -306,7 +298,7 @@ ProcRecord paintbrush_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, paintbrush_args, /* Output arguments */ @@ -328,7 +320,7 @@ ProcRecord paintbrush_extended_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, paintbrush_extended_args, /* Output arguments */ @@ -354,25 +346,20 @@ paintbrush_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* fade out */ if (success) { - fp_value = args[2].value.pdb_float; + fp_value = args[1].value.pdb_float; if (fp_value >= 0.0) non_gui_fade_out = fp_value; else @@ -381,7 +368,7 @@ paintbrush_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -390,7 +377,7 @@ paintbrush_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[4].value.pdb_pointer; + stroke_array = (double *) args[3].value.pdb_pointer; if (success) /* init the paint core */ @@ -444,25 +431,20 @@ paintbrush_extended_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* fade out */ if (success) { - fp_value = args[2].value.pdb_float; + fp_value = args[1].value.pdb_float; if (fp_value >= 0.0) non_gui_fade_out = fp_value; else @@ -471,7 +453,7 @@ paintbrush_extended_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -480,7 +462,7 @@ paintbrush_extended_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[4].value.pdb_pointer; + stroke_array = (double *) args[3].value.pdb_pointer; if (success) /* init the paint core */ @@ -489,7 +471,7 @@ paintbrush_extended_invoker (Argument *args) if (success) { - non_gui_incremental = args[5].value.pdb_int; + non_gui_incremental = args[4].value.pdb_int; /* set the paint core's paint func */ non_gui_paint_core.paint_func = paintbrush_non_gui_paint_func; diff --git a/app/pencil.c b/app/pencil.c index 3e4cd39889..2306063fa8 100644 --- a/app/pencil.c +++ b/app/pencil.c @@ -131,10 +131,6 @@ pencil_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int st /* The pencil procedure definition */ ProcArg pencil_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -161,7 +157,7 @@ ProcRecord pencil_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, pencil_args, /* Output arguments */ @@ -187,25 +183,20 @@ pencil_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -214,7 +205,7 @@ pencil_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/perspective_tool.c b/app/perspective_tool.c index 4fbb268f1a..b735f560a7 100644 --- a/app/perspective_tool.c +++ b/app/perspective_tool.c @@ -321,10 +321,6 @@ perspective_tool_perspective (gimage, drawable, float_tiles, interpolation, matr /* The perspective procedure definition */ ProcArg perspective_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the affected drawable" @@ -386,7 +382,7 @@ ProcRecord perspective_proc = PDB_INTERNAL, /* Input arguments */ - 11, + 10, perspective_args, /* Output arguments */ @@ -418,38 +414,33 @@ perspective_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* perspective extents */ if (success) { - trans_info[X0] = args[3].value.pdb_float; - trans_info[Y0] = args[4].value.pdb_float; - trans_info[X1] = args[5].value.pdb_float; - trans_info[Y1] = args[6].value.pdb_float; - trans_info[X2] = args[7].value.pdb_float; - trans_info[Y2] = args[8].value.pdb_float; - trans_info[X3] = args[9].value.pdb_float; - trans_info[Y3] = args[10].value.pdb_float; + trans_info[X0] = args[2].value.pdb_float; + trans_info[Y0] = args[3].value.pdb_float; + trans_info[X1] = args[4].value.pdb_float; + trans_info[Y1] = args[5].value.pdb_float; + trans_info[X2] = args[6].value.pdb_float; + trans_info[Y2] = args[7].value.pdb_float; + trans_info[X3] = args[8].value.pdb_float; + trans_info[Y3] = args[9].value.pdb_float; } /* call the perspective procedure */ diff --git a/app/posterize.c b/app/posterize.c index 6d886e3480..ac27d94893 100644 --- a/app/posterize.c +++ b/app/posterize.c @@ -452,10 +452,6 @@ posterize_levels_text_update (GtkWidget *w, /* The posterize procedure definition */ ProcArg posterize_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -477,7 +473,7 @@ ProcRecord posterize_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, posterize_args, /* Output arguments */ @@ -505,20 +501,15 @@ posterize_invoker (Argument *args) drawable = NULL; levels = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -527,7 +518,7 @@ posterize_invoker (Argument *args) /* levels */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value >= 2 && int_value < 256) levels = int_value; else diff --git a/app/rotate_tool.c b/app/rotate_tool.c index 3521858aac..9bfbecb0ec 100644 --- a/app/rotate_tool.c +++ b/app/rotate_tool.c @@ -376,10 +376,6 @@ rotate_tool_rotate (gimage, drawable, angle, float_tiles, interpolation, matrix) /* The rotate procedure definition */ ProcArg rotate_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -413,7 +409,7 @@ ProcRecord rotate_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, rotate_args, /* Output arguments */ @@ -445,30 +441,25 @@ rotate_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* angle of rotation */ if (success) - angle = args[3].value.pdb_float; + angle = args[2].value.pdb_float; /* call the rotate procedure */ if (success) diff --git a/app/scale_tool.c b/app/scale_tool.c index c17cd02176..a0e49876b9 100644 --- a/app/scale_tool.c +++ b/app/scale_tool.c @@ -438,10 +438,6 @@ scale_tool_scale (gimage, drawable, trans_info, float_tiles, interpolation, matr /* The scale procedure definition */ ProcArg scale_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -487,7 +483,7 @@ ProcRecord scale_proc = PDB_INTERNAL, /* Input arguments */ - 7, + 6, scale_args, /* Output arguments */ @@ -519,34 +515,29 @@ scale_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* scale extents */ if (success) { - trans_info[X1] = args[3].value.pdb_float; - trans_info[Y1] = args[4].value.pdb_float; - trans_info[X2] = args[5].value.pdb_float; - trans_info[Y2] = args[6].value.pdb_float; + trans_info[X1] = args[2].value.pdb_float; + trans_info[Y1] = args[3].value.pdb_float; + trans_info[X2] = args[4].value.pdb_float; + trans_info[Y2] = args[5].value.pdb_float; if (trans_info[X1] >= trans_info[X2] || trans_info[Y1] >= trans_info[Y2]) diff --git a/app/shear_tool.c b/app/shear_tool.c index cd86593906..5ea59b6662 100644 --- a/app/shear_tool.c +++ b/app/shear_tool.c @@ -363,10 +363,6 @@ shear_tool_shear (gimage, drawable, float_tiles, interpolation, matrix) /* The shear procedure definition */ ProcArg shear_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -404,7 +400,7 @@ ProcRecord shear_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, shear_args, /* Output arguments */ @@ -438,31 +434,26 @@ shear_invoker (args) shear_type = HORZ; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* shear type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: shear_type = HORZ; break; @@ -473,7 +464,7 @@ shear_invoker (args) /* shear extents */ if (success) { - shear_magnitude = args[4].value.pdb_float; + shear_magnitude = args[3].value.pdb_float; } /* call the shear procedure */ diff --git a/app/threshold.c b/app/threshold.c index 0286f06c43..c4949c92d7 100644 --- a/app/threshold.c +++ b/app/threshold.c @@ -611,10 +611,6 @@ threshold_high_threshold_text_update (GtkWidget *w, /* The threshold procedure definition */ ProcArg threshold_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -640,7 +636,7 @@ ProcRecord threshold_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, threshold_args, /* Output arguments */ @@ -671,20 +667,15 @@ threshold_invoker (args) low_threshold = 0; high_threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -693,7 +684,7 @@ threshold_invoker (args) /* low threhsold */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value >= 0 && int_value < 256) low_threshold = int_value; else @@ -702,7 +693,7 @@ threshold_invoker (args) /* high threhsold */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) high_threshold = int_value; else diff --git a/app/tools/airbrush.c b/app/tools/airbrush.c index 2b724ef682..99a73e1c7a 100644 --- a/app/tools/airbrush.c +++ b/app/tools/airbrush.c @@ -295,10 +295,6 @@ airbrush_non_gui_paint_func (PaintCore *paint_core, /* The airbrush procedure definition */ ProcArg airbrush_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -329,7 +325,7 @@ ProcRecord airbrush_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, airbrush_args, /* Output arguments */ @@ -356,25 +352,20 @@ airbrush_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* pressure */ if (success) { - fp_value = args[2].value.pdb_float; + fp_value = args[1].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) non_gui_pressure = fp_value; else @@ -383,7 +374,7 @@ airbrush_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -392,7 +383,7 @@ airbrush_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[4].value.pdb_pointer; + stroke_array = (double *) args[3].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/blend.c b/app/tools/blend.c index 95b7c9c9b9..9d0ddd4a86 100644 --- a/app/tools/blend.c +++ b/app/tools/blend.c @@ -618,7 +618,6 @@ blend_button_release (Tool *tool, { return_vals = procedural_db_run_proc ("gimp_blend", &nreturn_vals, - PDB_IMAGE, pdb_image_to_id(gimage), PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)), PDB_INT32, (gint32) blend_options->blend_mode, PDB_INT32, (gint32) blend_options->paint_mode, @@ -1711,10 +1710,6 @@ tools_free_blend (Tool *tool) /* The blend procedure definition */ ProcArg blend_args[] = { - { PDB_IMAGE, - "image", - N_("The image") - }, { PDB_DRAWABLE, "drawable", N_("The affected drawable") @@ -1784,7 +1779,7 @@ ProcRecord blend_proc = PDB_INTERNAL, /* Input arguments */ - 15, + 14, blend_args, /* Output arguments */ @@ -1826,25 +1821,20 @@ blend_invoker (Argument *args) max_depth = 0; threshold = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* blend mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: blend_mode = FG_BG_RGB_MODE; break; @@ -1857,7 +1847,7 @@ blend_invoker (Argument *args) /* paint mode */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= NORMAL_MODE && int_value <= VALUE_MODE) paint_mode = int_value; else @@ -1866,7 +1856,7 @@ blend_invoker (Argument *args) /* gradient type */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; switch (int_value) { case 0: gradient_type = Linear; break; @@ -1884,7 +1874,7 @@ blend_invoker (Argument *args) /* opacity */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) opacity = fp_value; else @@ -1893,7 +1883,7 @@ blend_invoker (Argument *args) /* offset */ if (success) { - fp_value = args[6].value.pdb_float; + fp_value = args[5].value.pdb_float; if (fp_value >= 0.0) offset = fp_value; else @@ -1902,7 +1892,7 @@ blend_invoker (Argument *args) /* repeat */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; switch (int_value) { case 0: repeat = REPEAT_NONE; break; @@ -1914,14 +1904,14 @@ blend_invoker (Argument *args) /* supersampling */ if (success) { - int_value = args[8].value.pdb_int; + int_value = args[7].value.pdb_int; supersample = (int_value ? TRUE : FALSE); } /* max_depth */ if (success) { - int_value = args[9].value.pdb_int; + int_value = args[8].value.pdb_int; if (((int_value >= 1) && (int_value <= 9)) || !supersample) max_depth = int_value; @@ -1931,7 +1921,7 @@ blend_invoker (Argument *args) /* threshold */ if (success) { - fp_value = args[10].value.pdb_float; + fp_value = args[9].value.pdb_float; if (((fp_value >= 0.0) && (fp_value <= 4.0)) || !supersample) threshold = fp_value; @@ -1941,10 +1931,10 @@ blend_invoker (Argument *args) /* x1, y1, x2, y2 */ if (success) { - x1 = args[11].value.pdb_float; - y1 = args[12].value.pdb_float; - x2 = args[13].value.pdb_float; - y2 = args[14].value.pdb_float; + x1 = args[10].value.pdb_float; + y1 = args[11].value.pdb_float; + x2 = args[12].value.pdb_float; + y2 = args[13].value.pdb_float; } /* call the blend procedure */ diff --git a/app/tools/brightness_contrast.c b/app/tools/brightness_contrast.c index 17f6d2afd0..b38acd8fea 100644 --- a/app/tools/brightness_contrast.c +++ b/app/tools/brightness_contrast.c @@ -643,10 +643,6 @@ brightness_contrast_contrast_text_update (GtkWidget *w, /* The brightness_contrast procedure definition */ ProcArg brightness_contrast_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -672,7 +668,7 @@ ProcRecord brightness_contrast_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, brightness_contrast_args, /* Output arguments */ @@ -702,20 +698,15 @@ brightness_contrast_invoker (Argument *args) brightness = 0; contrast = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -724,7 +715,7 @@ brightness_contrast_invoker (Argument *args) /* brightness */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value < -127 || int_value > 127) success = FALSE; else @@ -733,7 +724,7 @@ brightness_contrast_invoker (Argument *args) /* contrast */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value < -127 || int_value > 127) success = FALSE; else diff --git a/app/tools/bucket_fill.c b/app/tools/bucket_fill.c index efaf158ed4..1869ee237a 100644 --- a/app/tools/bucket_fill.c +++ b/app/tools/bucket_fill.c @@ -315,8 +315,6 @@ bucket_fill_button_release (tool, bevent, gdisp_ptr) return_vals = procedural_db_run_proc ("gimp_bucket_fill", &nreturn_vals, - PDB_IMAGE, - pdb_image_to_id(gdisp->gimage), PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gdisp->gimage)), PDB_INT32, (gint32) fill_mode, PDB_INT32, (gint32) bucket_options->paint_mode, @@ -698,10 +696,6 @@ tools_free_bucket_fill (tool) /* The bucket fill procedure definition */ ProcArg bucket_fill_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -747,7 +741,7 @@ ProcRecord bucket_fill_proc = PDB_INTERNAL, /* Input arguments */ - 9, + 8, bucket_fill_args, /* Output arguments */ @@ -781,25 +775,20 @@ bucket_fill_invoker (args) opacity = 100.0; threshold = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* fill mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: fill_mode = FgColorFill; break; @@ -811,7 +800,7 @@ bucket_fill_invoker (args) /* paint mode */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= NORMAL_MODE && int_value <= VALUE_MODE) paint_mode = int_value; else @@ -820,7 +809,7 @@ bucket_fill_invoker (args) /* opacity */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) opacity = fp_value; else @@ -829,7 +818,7 @@ bucket_fill_invoker (args) /* threshold */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 255.0) threshold = fp_value; else @@ -838,7 +827,7 @@ bucket_fill_invoker (args) /* sample_merged */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } /* x, y */ diff --git a/app/tools/by_color_select.c b/app/tools/by_color_select.c index 8dcb7b3893..1c337262fa 100644 --- a/app/tools/by_color_select.c +++ b/app/tools/by_color_select.c @@ -971,10 +971,6 @@ by_color_select_preview_button_press (ByColorDialog *bcd, /* The by_color_select procedure definition */ ProcArg by_color_select_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1020,7 +1016,7 @@ ProcRecord by_color_select_proc = PDB_INTERNAL, /* Input arguments */ - 9, + 8, by_color_select_args, /* Output arguments */ @@ -1051,20 +1047,15 @@ by_color_select_invoker (Argument *args) op = REPLACE; threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* color */ if (success) @@ -1072,14 +1063,14 @@ by_color_select_invoker (Argument *args) int i; unsigned char *color_array; - color_array = (unsigned char *) args[2].value.pdb_pointer; + color_array = (unsigned char *) args[1].value.pdb_pointer; for (i = 0; i < 3; i++) color[i] = color_array[i]; } /* threshold */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value <= 255) threshold = int_value; else @@ -1088,7 +1079,7 @@ by_color_select_invoker (Argument *args) /* operation */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; switch (int_value) { case 0: op = ADD; break; @@ -1101,24 +1092,24 @@ by_color_select_invoker (Argument *args) /* antialiasing? */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; antialias = (int_value) ? TRUE : FALSE; } /* feathering */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; feather = (int_value) ? TRUE : FALSE; } /* feather radius */ if (success) { - feather_radius = args[7].value.pdb_float; + feather_radius = args[6].value.pdb_float; } /* sample merged */ if (success) { - int_value = args[8].value.pdb_int; + int_value = args[7].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } diff --git a/app/tools/clone.c b/app/tools/clone.c index 787aee2c63..6e99135f3a 100644 --- a/app/tools/clone.c +++ b/app/tools/clone.c @@ -547,10 +547,6 @@ clone_non_gui_paint_func (PaintCore *paint_core, /* The clone procedure definition */ ProcArg clone_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -593,7 +589,7 @@ ProcRecord clone_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, clone_args, /* Output arguments */ @@ -621,25 +617,20 @@ clone_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the src drawable */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; src_drawable = drawable_get_ID (int_value); if (src_drawable == NULL || gimage != drawable_gimage (src_drawable)) success = FALSE; @@ -649,7 +640,7 @@ clone_invoker (Argument *args) /* the clone type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: non_gui_type = ImageClone; break; @@ -660,13 +651,13 @@ clone_invoker (Argument *args) /* x, y offsets */ if (success) { - src_x = args[4].value.pdb_float; - src_y = args[5].value.pdb_float; + src_x = args[3].value.pdb_float; + src_y = args[4].value.pdb_float; } /* num strokes */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -675,7 +666,7 @@ clone_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[7].value.pdb_pointer; + stroke_array = (double *) args[6].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/color_balance.c b/app/tools/color_balance.c index 240e478815..07ea6d7257 100644 --- a/app/tools/color_balance.c +++ b/app/tools/color_balance.c @@ -877,10 +877,6 @@ color_balance_yb_text_update (GtkWidget *w, /* The color_balance procedure definition */ ProcArg color_balance_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -918,7 +914,7 @@ ProcRecord color_balance_proc = PDB_INTERNAL, /* Input arguments */ - 7, + 6, color_balance_args, /* Output arguments */ @@ -955,20 +951,15 @@ color_balance_invoker (Argument *args) magenta_green = 0; yellow_blue = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -977,7 +968,7 @@ color_balance_invoker (Argument *args) /* transfer_mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: transfer_mode = SHADOWS; break; @@ -989,13 +980,13 @@ color_balance_invoker (Argument *args) /* preserve_lum */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; preserve_lum = (int_value) ? TRUE : FALSE; } /* cyan_red */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) cyan_red = fp_value; else @@ -1004,7 +995,7 @@ color_balance_invoker (Argument *args) /* magenta_green */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) magenta_green = fp_value; else @@ -1013,7 +1004,7 @@ color_balance_invoker (Argument *args) /* yellow_blue */ if (success) { - fp_value = args[6].value.pdb_float; + fp_value = args[5].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) yellow_blue = fp_value; else diff --git a/app/tools/color_picker.c b/app/tools/color_picker.c index 2fede4fae7..3c00e97606 100644 --- a/app/tools/color_picker.c +++ b/app/tools/color_picker.c @@ -475,10 +475,6 @@ tools_free_color_picker (Tool *tool) /* The color_picker procedure definition */ ProcArg color_picker_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -520,7 +516,7 @@ ProcRecord color_picker_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, color_picker_args, /* Output arguments */ @@ -551,35 +547,32 @@ color_picker_invoker (Argument *args) sample_merged = FALSE; save_color = COLOR_UPDATE; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if ((gimage = gimage_get_ID (int_value)) == NULL) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* x, y */ if (success) { - x = args[2].value.pdb_float; - y = args[3].value.pdb_float; + x = args[1].value.pdb_float; + y = args[2].value.pdb_float; } /* sample_merged */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } /* save_color */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; save_color = (int_value) ? COLOR_NEW : COLOR_UPDATE; } diff --git a/app/tools/convolve.c b/app/tools/convolve.c index 4440ce8242..4faa2bf71e 100644 --- a/app/tools/convolve.c +++ b/app/tools/convolve.c @@ -424,10 +424,6 @@ convolve_non_gui_paint_func (PaintCore *paint_core, /* The convolve procedure definition */ ProcArg convolve_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -462,7 +458,7 @@ ProcRecord convolve_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, convolve_args, /* Output arguments */ @@ -493,25 +489,20 @@ convolve_invoker (Argument *args) type = Blur; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the pressure */ if (success) { - fp_value = args[2].value.pdb_int; + fp_value = args[1].value.pdb_int; if (fp_value >= 0.0 && fp_value <= 100.0) pressure = fp_value; else @@ -520,7 +511,7 @@ convolve_invoker (Argument *args) /* the convolve type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: type = Blur; break; @@ -532,7 +523,7 @@ convolve_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -541,7 +532,7 @@ convolve_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[5].value.pdb_pointer; + stroke_array = (double *) args[4].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/curves.c b/app/tools/curves.c index 92ef076bbf..668ad24427 100644 --- a/app/tools/curves.c +++ b/app/tools/curves.c @@ -1298,10 +1298,6 @@ curves_CR_compose (CRMatrix a, /* Procedure for defining the curve with a spline */ ProcArg curves_spline_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1331,7 +1327,7 @@ ProcRecord curves_spline_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, curves_spline_args, /* Output arguments */ @@ -1359,20 +1355,15 @@ curves_spline_invoker (Argument *args) void *pr; GimpDrawable *drawable; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1382,7 +1373,7 @@ curves_spline_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1402,14 +1393,14 @@ curves_spline_invoker (Argument *args) } if (success) { - num_cp = args[3].value.pdb_int; + num_cp = args[2].value.pdb_int; if (num_cp < 4 || num_cp > 32 || (num_cp & 0x1)) success = FALSE; } /* control points */ if (success) { - control_pts = (unsigned char *) args[4].value.pdb_pointer; + control_pts = (unsigned char *) args[3].value.pdb_pointer; } /* arrange to modify the curves */ @@ -1456,10 +1447,6 @@ curves_spline_invoker (Argument *args) /* Procedure for explicitly defining the curve */ ProcArg curves_explicit_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1489,7 +1476,7 @@ ProcRecord curves_explicit_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, curves_explicit_args, /* Output arguments */ @@ -1516,20 +1503,15 @@ curves_explicit_invoker (Argument *args) void *pr; GimpDrawable *drawable; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1538,7 +1520,7 @@ curves_explicit_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1559,14 +1541,14 @@ curves_explicit_invoker (Argument *args) /* the number of bytes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value != 256) success = FALSE; } /* the curve */ if (success) { - curve = (unsigned char *) args[4].value.pdb_pointer; + curve = (unsigned char *) args[3].value.pdb_pointer; } /* arrange to modify the curves */ diff --git a/app/tools/eraser.c b/app/tools/eraser.c index 33a3fc0d21..5c2e3df74f 100644 --- a/app/tools/eraser.c +++ b/app/tools/eraser.c @@ -202,10 +202,6 @@ eraser_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int st /* The eraser procedure definition */ ProcArg eraser_extended_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -230,10 +226,6 @@ ProcArg eraser_extended_args[] = ProcArg eraser_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -260,7 +252,7 @@ ProcRecord eraser_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, eraser_args, /* Output arguments */ @@ -282,7 +274,7 @@ ProcRecord eraser_extended_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, eraser_extended_args, /* Output arguments */ @@ -308,25 +300,20 @@ eraser_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -335,7 +322,7 @@ eraser_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ @@ -390,25 +377,20 @@ eraser_extended_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -417,7 +399,7 @@ eraser_extended_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ @@ -426,8 +408,8 @@ eraser_extended_invoker (args) if (success) { - non_gui_hard = args[4].value.pdb_int; - non_gui_incremental = args[5].value.pdb_int; + non_gui_hard = args[3].value.pdb_int; + non_gui_incremental = args[4].value.pdb_int; } if (success) diff --git a/app/tools/flip_tool.c b/app/tools/flip_tool.c index a694983e16..977746cf1d 100644 --- a/app/tools/flip_tool.c +++ b/app/tools/flip_tool.c @@ -332,10 +332,6 @@ flip_change_type (int new_type) /* The flip procedure definition */ ProcArg flip_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -365,7 +361,7 @@ ProcRecord flip_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, flip_args, /* Output arguments */ @@ -395,25 +391,20 @@ flip_invoker (Argument *args) new_tiles = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* flip type */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: flip_type = 0; break; diff --git a/app/tools/fuzzy_select.c b/app/tools/fuzzy_select.c index 7eac4dd0a9..f345cdc00c 100644 --- a/app/tools/fuzzy_select.c +++ b/app/tools/fuzzy_select.c @@ -579,10 +579,6 @@ tools_free_fuzzy_select (Tool *tool) /* The fuzzy_select procedure definition */ ProcArg fuzzy_select_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -632,7 +628,7 @@ ProcRecord fuzzy_select_proc = PDB_INTERNAL, /* Input arguments */ - 10, + 9, fuzzy_select_args, /* Output arguments */ @@ -663,31 +659,26 @@ fuzzy_select_invoker (Argument *args) op = REPLACE; threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* x, y */ if (success) { - x = args[2].value.pdb_float; - y = args[3].value.pdb_float; + x = args[1].value.pdb_float; + y = args[2].value.pdb_float; } /* threshold */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value <= 255) threshold = int_value; else @@ -696,7 +687,7 @@ fuzzy_select_invoker (Argument *args) /* operation */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; switch (int_value) { case 0: op = ADD; break; @@ -709,24 +700,24 @@ fuzzy_select_invoker (Argument *args) /* antialiasing? */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; antialias = (int_value) ? TRUE : FALSE; } /* feathering */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; feather = (int_value) ? TRUE : FALSE; } /* feather radius */ if (success) { - feather_radius = args[8].value.pdb_float; + feather_radius = args[7].value.pdb_float; } /* sample merged */ if (success) { - int_value = args[9].value.pdb_int; + int_value = args[8].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } diff --git a/app/tools/gimpairbrushtool.c b/app/tools/gimpairbrushtool.c index 2b724ef682..99a73e1c7a 100644 --- a/app/tools/gimpairbrushtool.c +++ b/app/tools/gimpairbrushtool.c @@ -295,10 +295,6 @@ airbrush_non_gui_paint_func (PaintCore *paint_core, /* The airbrush procedure definition */ ProcArg airbrush_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -329,7 +325,7 @@ ProcRecord airbrush_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, airbrush_args, /* Output arguments */ @@ -356,25 +352,20 @@ airbrush_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* pressure */ if (success) { - fp_value = args[2].value.pdb_float; + fp_value = args[1].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) non_gui_pressure = fp_value; else @@ -383,7 +374,7 @@ airbrush_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -392,7 +383,7 @@ airbrush_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[4].value.pdb_pointer; + stroke_array = (double *) args[3].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c index 95b7c9c9b9..9d0ddd4a86 100644 --- a/app/tools/gimpblendtool.c +++ b/app/tools/gimpblendtool.c @@ -618,7 +618,6 @@ blend_button_release (Tool *tool, { return_vals = procedural_db_run_proc ("gimp_blend", &nreturn_vals, - PDB_IMAGE, pdb_image_to_id(gimage), PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)), PDB_INT32, (gint32) blend_options->blend_mode, PDB_INT32, (gint32) blend_options->paint_mode, @@ -1711,10 +1710,6 @@ tools_free_blend (Tool *tool) /* The blend procedure definition */ ProcArg blend_args[] = { - { PDB_IMAGE, - "image", - N_("The image") - }, { PDB_DRAWABLE, "drawable", N_("The affected drawable") @@ -1784,7 +1779,7 @@ ProcRecord blend_proc = PDB_INTERNAL, /* Input arguments */ - 15, + 14, blend_args, /* Output arguments */ @@ -1826,25 +1821,20 @@ blend_invoker (Argument *args) max_depth = 0; threshold = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* blend mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: blend_mode = FG_BG_RGB_MODE; break; @@ -1857,7 +1847,7 @@ blend_invoker (Argument *args) /* paint mode */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= NORMAL_MODE && int_value <= VALUE_MODE) paint_mode = int_value; else @@ -1866,7 +1856,7 @@ blend_invoker (Argument *args) /* gradient type */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; switch (int_value) { case 0: gradient_type = Linear; break; @@ -1884,7 +1874,7 @@ blend_invoker (Argument *args) /* opacity */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) opacity = fp_value; else @@ -1893,7 +1883,7 @@ blend_invoker (Argument *args) /* offset */ if (success) { - fp_value = args[6].value.pdb_float; + fp_value = args[5].value.pdb_float; if (fp_value >= 0.0) offset = fp_value; else @@ -1902,7 +1892,7 @@ blend_invoker (Argument *args) /* repeat */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; switch (int_value) { case 0: repeat = REPEAT_NONE; break; @@ -1914,14 +1904,14 @@ blend_invoker (Argument *args) /* supersampling */ if (success) { - int_value = args[8].value.pdb_int; + int_value = args[7].value.pdb_int; supersample = (int_value ? TRUE : FALSE); } /* max_depth */ if (success) { - int_value = args[9].value.pdb_int; + int_value = args[8].value.pdb_int; if (((int_value >= 1) && (int_value <= 9)) || !supersample) max_depth = int_value; @@ -1931,7 +1921,7 @@ blend_invoker (Argument *args) /* threshold */ if (success) { - fp_value = args[10].value.pdb_float; + fp_value = args[9].value.pdb_float; if (((fp_value >= 0.0) && (fp_value <= 4.0)) || !supersample) threshold = fp_value; @@ -1941,10 +1931,10 @@ blend_invoker (Argument *args) /* x1, y1, x2, y2 */ if (success) { - x1 = args[11].value.pdb_float; - y1 = args[12].value.pdb_float; - x2 = args[13].value.pdb_float; - y2 = args[14].value.pdb_float; + x1 = args[10].value.pdb_float; + y1 = args[11].value.pdb_float; + x2 = args[12].value.pdb_float; + y2 = args[13].value.pdb_float; } /* call the blend procedure */ diff --git a/app/tools/gimpbrightnesscontrasttool.c b/app/tools/gimpbrightnesscontrasttool.c index 17f6d2afd0..b38acd8fea 100644 --- a/app/tools/gimpbrightnesscontrasttool.c +++ b/app/tools/gimpbrightnesscontrasttool.c @@ -643,10 +643,6 @@ brightness_contrast_contrast_text_update (GtkWidget *w, /* The brightness_contrast procedure definition */ ProcArg brightness_contrast_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -672,7 +668,7 @@ ProcRecord brightness_contrast_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, brightness_contrast_args, /* Output arguments */ @@ -702,20 +698,15 @@ brightness_contrast_invoker (Argument *args) brightness = 0; contrast = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -724,7 +715,7 @@ brightness_contrast_invoker (Argument *args) /* brightness */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value < -127 || int_value > 127) success = FALSE; else @@ -733,7 +724,7 @@ brightness_contrast_invoker (Argument *args) /* contrast */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value < -127 || int_value > 127) success = FALSE; else diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c index efaf158ed4..1869ee237a 100644 --- a/app/tools/gimpbucketfilltool.c +++ b/app/tools/gimpbucketfilltool.c @@ -315,8 +315,6 @@ bucket_fill_button_release (tool, bevent, gdisp_ptr) return_vals = procedural_db_run_proc ("gimp_bucket_fill", &nreturn_vals, - PDB_IMAGE, - pdb_image_to_id(gdisp->gimage), PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gdisp->gimage)), PDB_INT32, (gint32) fill_mode, PDB_INT32, (gint32) bucket_options->paint_mode, @@ -698,10 +696,6 @@ tools_free_bucket_fill (tool) /* The bucket fill procedure definition */ ProcArg bucket_fill_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -747,7 +741,7 @@ ProcRecord bucket_fill_proc = PDB_INTERNAL, /* Input arguments */ - 9, + 8, bucket_fill_args, /* Output arguments */ @@ -781,25 +775,20 @@ bucket_fill_invoker (args) opacity = 100.0; threshold = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) + if (drawable == NULL) success = FALSE; + else + gimage = drawable_gimage (drawable); } /* fill mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: fill_mode = FgColorFill; break; @@ -811,7 +800,7 @@ bucket_fill_invoker (args) /* paint mode */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= NORMAL_MODE && int_value <= VALUE_MODE) paint_mode = int_value; else @@ -820,7 +809,7 @@ bucket_fill_invoker (args) /* opacity */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 100.0) opacity = fp_value; else @@ -829,7 +818,7 @@ bucket_fill_invoker (args) /* threshold */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.0 && fp_value <= 255.0) threshold = fp_value; else @@ -838,7 +827,7 @@ bucket_fill_invoker (args) /* sample_merged */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } /* x, y */ diff --git a/app/tools/gimpbycolorselecttool.c b/app/tools/gimpbycolorselecttool.c index 8dcb7b3893..1c337262fa 100644 --- a/app/tools/gimpbycolorselecttool.c +++ b/app/tools/gimpbycolorselecttool.c @@ -971,10 +971,6 @@ by_color_select_preview_button_press (ByColorDialog *bcd, /* The by_color_select procedure definition */ ProcArg by_color_select_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1020,7 +1016,7 @@ ProcRecord by_color_select_proc = PDB_INTERNAL, /* Input arguments */ - 9, + 8, by_color_select_args, /* Output arguments */ @@ -1051,20 +1047,15 @@ by_color_select_invoker (Argument *args) op = REPLACE; threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* color */ if (success) @@ -1072,14 +1063,14 @@ by_color_select_invoker (Argument *args) int i; unsigned char *color_array; - color_array = (unsigned char *) args[2].value.pdb_pointer; + color_array = (unsigned char *) args[1].value.pdb_pointer; for (i = 0; i < 3; i++) color[i] = color_array[i]; } /* threshold */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value <= 255) threshold = int_value; else @@ -1088,7 +1079,7 @@ by_color_select_invoker (Argument *args) /* operation */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; switch (int_value) { case 0: op = ADD; break; @@ -1101,24 +1092,24 @@ by_color_select_invoker (Argument *args) /* antialiasing? */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; antialias = (int_value) ? TRUE : FALSE; } /* feathering */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; feather = (int_value) ? TRUE : FALSE; } /* feather radius */ if (success) { - feather_radius = args[7].value.pdb_float; + feather_radius = args[6].value.pdb_float; } /* sample merged */ if (success) { - int_value = args[8].value.pdb_int; + int_value = args[7].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } diff --git a/app/tools/gimpclonetool.c b/app/tools/gimpclonetool.c index 787aee2c63..6e99135f3a 100644 --- a/app/tools/gimpclonetool.c +++ b/app/tools/gimpclonetool.c @@ -547,10 +547,6 @@ clone_non_gui_paint_func (PaintCore *paint_core, /* The clone procedure definition */ ProcArg clone_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -593,7 +589,7 @@ ProcRecord clone_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, clone_args, /* Output arguments */ @@ -621,25 +617,20 @@ clone_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the src drawable */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; src_drawable = drawable_get_ID (int_value); if (src_drawable == NULL || gimage != drawable_gimage (src_drawable)) success = FALSE; @@ -649,7 +640,7 @@ clone_invoker (Argument *args) /* the clone type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: non_gui_type = ImageClone; break; @@ -660,13 +651,13 @@ clone_invoker (Argument *args) /* x, y offsets */ if (success) { - src_x = args[4].value.pdb_float; - src_y = args[5].value.pdb_float; + src_x = args[3].value.pdb_float; + src_y = args[4].value.pdb_float; } /* num strokes */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -675,7 +666,7 @@ clone_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[7].value.pdb_pointer; + stroke_array = (double *) args[6].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c index 240e478815..07ea6d7257 100644 --- a/app/tools/gimpcolorbalancetool.c +++ b/app/tools/gimpcolorbalancetool.c @@ -877,10 +877,6 @@ color_balance_yb_text_update (GtkWidget *w, /* The color_balance procedure definition */ ProcArg color_balance_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -918,7 +914,7 @@ ProcRecord color_balance_proc = PDB_INTERNAL, /* Input arguments */ - 7, + 6, color_balance_args, /* Output arguments */ @@ -955,20 +951,15 @@ color_balance_invoker (Argument *args) magenta_green = 0; yellow_blue = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -977,7 +968,7 @@ color_balance_invoker (Argument *args) /* transfer_mode */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: transfer_mode = SHADOWS; break; @@ -989,13 +980,13 @@ color_balance_invoker (Argument *args) /* preserve_lum */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; preserve_lum = (int_value) ? TRUE : FALSE; } /* cyan_red */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) cyan_red = fp_value; else @@ -1004,7 +995,7 @@ color_balance_invoker (Argument *args) /* magenta_green */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) magenta_green = fp_value; else @@ -1013,7 +1004,7 @@ color_balance_invoker (Argument *args) /* yellow_blue */ if (success) { - fp_value = args[6].value.pdb_float; + fp_value = args[5].value.pdb_float; if (fp_value >= -100 && fp_value <= 100) yellow_blue = fp_value; else diff --git a/app/tools/gimpconvolvetool.c b/app/tools/gimpconvolvetool.c index 4440ce8242..4faa2bf71e 100644 --- a/app/tools/gimpconvolvetool.c +++ b/app/tools/gimpconvolvetool.c @@ -424,10 +424,6 @@ convolve_non_gui_paint_func (PaintCore *paint_core, /* The convolve procedure definition */ ProcArg convolve_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -462,7 +458,7 @@ ProcRecord convolve_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, convolve_args, /* Output arguments */ @@ -493,25 +489,20 @@ convolve_invoker (Argument *args) type = Blur; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the pressure */ if (success) { - fp_value = args[2].value.pdb_int; + fp_value = args[1].value.pdb_int; if (fp_value >= 0.0 && fp_value <= 100.0) pressure = fp_value; else @@ -520,7 +511,7 @@ convolve_invoker (Argument *args) /* the convolve type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: type = Blur; break; @@ -532,7 +523,7 @@ convolve_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -541,7 +532,7 @@ convolve_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[5].value.pdb_pointer; + stroke_array = (double *) args[4].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index 92ef076bbf..668ad24427 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -1298,10 +1298,6 @@ curves_CR_compose (CRMatrix a, /* Procedure for defining the curve with a spline */ ProcArg curves_spline_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1331,7 +1327,7 @@ ProcRecord curves_spline_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, curves_spline_args, /* Output arguments */ @@ -1359,20 +1355,15 @@ curves_spline_invoker (Argument *args) void *pr; GimpDrawable *drawable; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1382,7 +1373,7 @@ curves_spline_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1402,14 +1393,14 @@ curves_spline_invoker (Argument *args) } if (success) { - num_cp = args[3].value.pdb_int; + num_cp = args[2].value.pdb_int; if (num_cp < 4 || num_cp > 32 || (num_cp & 0x1)) success = FALSE; } /* control points */ if (success) { - control_pts = (unsigned char *) args[4].value.pdb_pointer; + control_pts = (unsigned char *) args[3].value.pdb_pointer; } /* arrange to modify the curves */ @@ -1456,10 +1447,6 @@ curves_spline_invoker (Argument *args) /* Procedure for explicitly defining the curve */ ProcArg curves_explicit_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -1489,7 +1476,7 @@ ProcRecord curves_explicit_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, curves_explicit_args, /* Output arguments */ @@ -1516,20 +1503,15 @@ curves_explicit_invoker (Argument *args) void *pr; GimpDrawable *drawable; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1538,7 +1520,7 @@ curves_explicit_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1559,14 +1541,14 @@ curves_explicit_invoker (Argument *args) /* the number of bytes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value != 256) success = FALSE; } /* the curve */ if (success) { - curve = (unsigned char *) args[4].value.pdb_pointer; + curve = (unsigned char *) args[3].value.pdb_pointer; } /* arrange to modify the curves */ diff --git a/app/tools/gimperasertool.c b/app/tools/gimperasertool.c index 33a3fc0d21..5c2e3df74f 100644 --- a/app/tools/gimperasertool.c +++ b/app/tools/gimperasertool.c @@ -202,10 +202,6 @@ eraser_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int st /* The eraser procedure definition */ ProcArg eraser_extended_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -230,10 +226,6 @@ ProcArg eraser_extended_args[] = ProcArg eraser_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -260,7 +252,7 @@ ProcRecord eraser_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, eraser_args, /* Output arguments */ @@ -282,7 +274,7 @@ ProcRecord eraser_extended_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, eraser_extended_args, /* Output arguments */ @@ -308,25 +300,20 @@ eraser_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -335,7 +322,7 @@ eraser_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ @@ -390,25 +377,20 @@ eraser_extended_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -417,7 +399,7 @@ eraser_extended_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ @@ -426,8 +408,8 @@ eraser_extended_invoker (args) if (success) { - non_gui_hard = args[4].value.pdb_int; - non_gui_incremental = args[5].value.pdb_int; + non_gui_hard = args[3].value.pdb_int; + non_gui_incremental = args[4].value.pdb_int; } if (success) diff --git a/app/tools/gimpfliptool.c b/app/tools/gimpfliptool.c index a694983e16..977746cf1d 100644 --- a/app/tools/gimpfliptool.c +++ b/app/tools/gimpfliptool.c @@ -332,10 +332,6 @@ flip_change_type (int new_type) /* The flip procedure definition */ ProcArg flip_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -365,7 +361,7 @@ ProcRecord flip_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, flip_args, /* Output arguments */ @@ -395,25 +391,20 @@ flip_invoker (Argument *args) new_tiles = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* flip type */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; switch (int_value) { case 0: flip_type = 0; break; diff --git a/app/tools/gimpfuzzyselecttool.c b/app/tools/gimpfuzzyselecttool.c index 7eac4dd0a9..f345cdc00c 100644 --- a/app/tools/gimpfuzzyselecttool.c +++ b/app/tools/gimpfuzzyselecttool.c @@ -579,10 +579,6 @@ tools_free_fuzzy_select (Tool *tool) /* The fuzzy_select procedure definition */ ProcArg fuzzy_select_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -632,7 +628,7 @@ ProcRecord fuzzy_select_proc = PDB_INTERNAL, /* Input arguments */ - 10, + 9, fuzzy_select_args, /* Output arguments */ @@ -663,31 +659,26 @@ fuzzy_select_invoker (Argument *args) op = REPLACE; threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* x, y */ if (success) { - x = args[2].value.pdb_float; - y = args[3].value.pdb_float; + x = args[1].value.pdb_float; + y = args[2].value.pdb_float; } /* threshold */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value <= 255) threshold = int_value; else @@ -696,7 +687,7 @@ fuzzy_select_invoker (Argument *args) /* operation */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; switch (int_value) { case 0: op = ADD; break; @@ -709,24 +700,24 @@ fuzzy_select_invoker (Argument *args) /* antialiasing? */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; antialias = (int_value) ? TRUE : FALSE; } /* feathering */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; feather = (int_value) ? TRUE : FALSE; } /* feather radius */ if (success) { - feather_radius = args[8].value.pdb_float; + feather_radius = args[7].value.pdb_float; } /* sample merged */ if (success) { - int_value = args[9].value.pdb_int; + int_value = args[8].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } diff --git a/app/tools/gimphistogramtool.c b/app/tools/gimphistogramtool.c index a08a5f00ed..075c5689e0 100644 --- a/app/tools/gimphistogramtool.c +++ b/app/tools/gimphistogramtool.c @@ -613,10 +613,6 @@ histogram_tool_blue_callback (GtkWidget *w, /* The histogram procedure definition */ ProcArg histogram_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -674,7 +670,7 @@ ProcRecord histogram_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, histogram_args, /* Output arguments */ @@ -709,25 +705,20 @@ histogram_invoker (Argument *args) low_range = 0; high_range = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -748,7 +739,7 @@ histogram_invoker (Argument *args) /* low range */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) low_range = int_value; else @@ -757,7 +748,7 @@ histogram_invoker (Argument *args) /* high range */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value < 256) high_range = int_value; else diff --git a/app/tools/gimphuesaturationtool.c b/app/tools/gimphuesaturationtool.c index 9b37b8b4b0..5a98039e2d 100644 --- a/app/tools/gimphuesaturationtool.c +++ b/app/tools/gimphuesaturationtool.c @@ -1027,10 +1027,6 @@ hue_saturation_hue_partition_events (GtkWidget *widget, /* The hue_saturation procedure definition */ ProcArg hue_saturation_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -1064,7 +1060,7 @@ ProcRecord hue_saturation_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, hue_saturation_args, /* Output arguments */ @@ -1100,20 +1096,15 @@ hue_saturation_invoker (Argument *args) lightness = 0.0; saturation = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1122,7 +1113,7 @@ hue_saturation_invoker (Argument *args) /* hue_range */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value < 0 || int_value > 6) success = FALSE; else @@ -1131,7 +1122,7 @@ hue_saturation_invoker (Argument *args) /* hue_offset */ if (success) { - fp_value = args[3].value.pdb_float; + fp_value = args[2].value.pdb_float; if (fp_value < -180 || fp_value > 180) success = FALSE; else @@ -1140,7 +1131,7 @@ hue_saturation_invoker (Argument *args) /* lightness */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value < -100 || fp_value > 100) success = FALSE; else @@ -1149,7 +1140,7 @@ hue_saturation_invoker (Argument *args) /* saturation */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value < -100 || fp_value > 100) success = FALSE; else diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c index 3cb41bf2e6..cfab7c3b8a 100644 --- a/app/tools/gimplevelstool.c +++ b/app/tools/gimplevelstool.c @@ -1440,10 +1440,6 @@ levels_output_da_events (GtkWidget *widget, /* The levels procedure definition */ ProcArg levels_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -1485,7 +1481,7 @@ ProcRecord levels_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, levels_args, /* Output arguments */ @@ -1524,20 +1520,15 @@ levels_invoker (Argument *args) low_output = 0; high_output = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1546,7 +1537,7 @@ levels_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1567,7 +1558,7 @@ levels_invoker (Argument *args) /* low input */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) low_input = int_value; else @@ -1576,7 +1567,7 @@ levels_invoker (Argument *args) /* high input */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value < 256) high_input = int_value; else @@ -1585,7 +1576,7 @@ levels_invoker (Argument *args) /* gamma */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.1 && fp_value <= 10.0) gamma = fp_value; else @@ -1594,7 +1585,7 @@ levels_invoker (Argument *args) /* low output */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value >= 0 && int_value < 256) low_output = int_value; else @@ -1603,7 +1594,7 @@ levels_invoker (Argument *args) /* high output */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; if (int_value >= 0 && int_value < 256) high_output = int_value; else diff --git a/app/tools/gimppenciltool.c b/app/tools/gimppenciltool.c index 3e4cd39889..2306063fa8 100644 --- a/app/tools/gimppenciltool.c +++ b/app/tools/gimppenciltool.c @@ -131,10 +131,6 @@ pencil_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int st /* The pencil procedure definition */ ProcArg pencil_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -161,7 +157,7 @@ ProcRecord pencil_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, pencil_args, /* Output arguments */ @@ -187,25 +183,20 @@ pencil_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -214,7 +205,7 @@ pencil_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/gimpperspectivetool.c b/app/tools/gimpperspectivetool.c index 4fbb268f1a..b735f560a7 100644 --- a/app/tools/gimpperspectivetool.c +++ b/app/tools/gimpperspectivetool.c @@ -321,10 +321,6 @@ perspective_tool_perspective (gimage, drawable, float_tiles, interpolation, matr /* The perspective procedure definition */ ProcArg perspective_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the affected drawable" @@ -386,7 +382,7 @@ ProcRecord perspective_proc = PDB_INTERNAL, /* Input arguments */ - 11, + 10, perspective_args, /* Output arguments */ @@ -418,38 +414,33 @@ perspective_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* perspective extents */ if (success) { - trans_info[X0] = args[3].value.pdb_float; - trans_info[Y0] = args[4].value.pdb_float; - trans_info[X1] = args[5].value.pdb_float; - trans_info[Y1] = args[6].value.pdb_float; - trans_info[X2] = args[7].value.pdb_float; - trans_info[Y2] = args[8].value.pdb_float; - trans_info[X3] = args[9].value.pdb_float; - trans_info[Y3] = args[10].value.pdb_float; + trans_info[X0] = args[2].value.pdb_float; + trans_info[Y0] = args[3].value.pdb_float; + trans_info[X1] = args[4].value.pdb_float; + trans_info[Y1] = args[5].value.pdb_float; + trans_info[X2] = args[6].value.pdb_float; + trans_info[Y2] = args[7].value.pdb_float; + trans_info[X3] = args[8].value.pdb_float; + trans_info[Y3] = args[9].value.pdb_float; } /* call the perspective procedure */ diff --git a/app/tools/gimpposterizetool.c b/app/tools/gimpposterizetool.c index 6d886e3480..ac27d94893 100644 --- a/app/tools/gimpposterizetool.c +++ b/app/tools/gimpposterizetool.c @@ -452,10 +452,6 @@ posterize_levels_text_update (GtkWidget *w, /* The posterize procedure definition */ ProcArg posterize_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -477,7 +473,7 @@ ProcRecord posterize_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, posterize_args, /* Output arguments */ @@ -505,20 +501,15 @@ posterize_invoker (Argument *args) drawable = NULL; levels = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -527,7 +518,7 @@ posterize_invoker (Argument *args) /* levels */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value >= 2 && int_value < 256) levels = int_value; else diff --git a/app/tools/gimpregionselecttool.c b/app/tools/gimpregionselecttool.c index 7eac4dd0a9..f345cdc00c 100644 --- a/app/tools/gimpregionselecttool.c +++ b/app/tools/gimpregionselecttool.c @@ -579,10 +579,6 @@ tools_free_fuzzy_select (Tool *tool) /* The fuzzy_select procedure definition */ ProcArg fuzzy_select_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -632,7 +628,7 @@ ProcRecord fuzzy_select_proc = PDB_INTERNAL, /* Input arguments */ - 10, + 9, fuzzy_select_args, /* Output arguments */ @@ -663,31 +659,26 @@ fuzzy_select_invoker (Argument *args) op = REPLACE; threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* x, y */ if (success) { - x = args[2].value.pdb_float; - y = args[3].value.pdb_float; + x = args[1].value.pdb_float; + y = args[2].value.pdb_float; } /* threshold */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value <= 255) threshold = int_value; else @@ -696,7 +687,7 @@ fuzzy_select_invoker (Argument *args) /* operation */ if (success) { - int_value = args[5].value.pdb_int; + int_value = args[4].value.pdb_int; switch (int_value) { case 0: op = ADD; break; @@ -709,24 +700,24 @@ fuzzy_select_invoker (Argument *args) /* antialiasing? */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; antialias = (int_value) ? TRUE : FALSE; } /* feathering */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; feather = (int_value) ? TRUE : FALSE; } /* feather radius */ if (success) { - feather_radius = args[8].value.pdb_float; + feather_radius = args[7].value.pdb_float; } /* sample merged */ if (success) { - int_value = args[9].value.pdb_int; + int_value = args[8].value.pdb_int; sample_merged = (int_value) ? TRUE : FALSE; } diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c index 3521858aac..9bfbecb0ec 100644 --- a/app/tools/gimprotatetool.c +++ b/app/tools/gimprotatetool.c @@ -376,10 +376,6 @@ rotate_tool_rotate (gimage, drawable, angle, float_tiles, interpolation, matrix) /* The rotate procedure definition */ ProcArg rotate_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -413,7 +409,7 @@ ProcRecord rotate_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, rotate_args, /* Output arguments */ @@ -445,30 +441,25 @@ rotate_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* angle of rotation */ if (success) - angle = args[3].value.pdb_float; + angle = args[2].value.pdb_float; /* call the rotate procedure */ if (success) diff --git a/app/tools/gimpscaletool.c b/app/tools/gimpscaletool.c index c17cd02176..a0e49876b9 100644 --- a/app/tools/gimpscaletool.c +++ b/app/tools/gimpscaletool.c @@ -438,10 +438,6 @@ scale_tool_scale (gimage, drawable, trans_info, float_tiles, interpolation, matr /* The scale procedure definition */ ProcArg scale_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -487,7 +483,7 @@ ProcRecord scale_proc = PDB_INTERNAL, /* Input arguments */ - 7, + 6, scale_args, /* Output arguments */ @@ -519,34 +515,29 @@ scale_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* scale extents */ if (success) { - trans_info[X1] = args[3].value.pdb_float; - trans_info[Y1] = args[4].value.pdb_float; - trans_info[X2] = args[5].value.pdb_float; - trans_info[Y2] = args[6].value.pdb_float; + trans_info[X1] = args[2].value.pdb_float; + trans_info[Y1] = args[3].value.pdb_float; + trans_info[X2] = args[4].value.pdb_float; + trans_info[Y2] = args[5].value.pdb_float; if (trans_info[X1] >= trans_info[X2] || trans_info[Y1] >= trans_info[Y2]) diff --git a/app/tools/gimpsheartool.c b/app/tools/gimpsheartool.c index cd86593906..5ea59b6662 100644 --- a/app/tools/gimpsheartool.c +++ b/app/tools/gimpsheartool.c @@ -363,10 +363,6 @@ shear_tool_shear (gimage, drawable, float_tiles, interpolation, matrix) /* The shear procedure definition */ ProcArg shear_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -404,7 +400,7 @@ ProcRecord shear_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, shear_args, /* Output arguments */ @@ -438,31 +434,26 @@ shear_invoker (args) shear_type = HORZ; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* shear type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: shear_type = HORZ; break; @@ -473,7 +464,7 @@ shear_invoker (args) /* shear extents */ if (success) { - shear_magnitude = args[4].value.pdb_float; + shear_magnitude = args[3].value.pdb_float; } /* call the shear procedure */ diff --git a/app/tools/gimpsourcetool.c b/app/tools/gimpsourcetool.c index 787aee2c63..6e99135f3a 100644 --- a/app/tools/gimpsourcetool.c +++ b/app/tools/gimpsourcetool.c @@ -547,10 +547,6 @@ clone_non_gui_paint_func (PaintCore *paint_core, /* The clone procedure definition */ ProcArg clone_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -593,7 +589,7 @@ ProcRecord clone_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, clone_args, /* Output arguments */ @@ -621,25 +617,20 @@ clone_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* the src drawable */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; src_drawable = drawable_get_ID (int_value); if (src_drawable == NULL || gimage != drawable_gimage (src_drawable)) success = FALSE; @@ -649,7 +640,7 @@ clone_invoker (Argument *args) /* the clone type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: non_gui_type = ImageClone; break; @@ -660,13 +651,13 @@ clone_invoker (Argument *args) /* x, y offsets */ if (success) { - src_x = args[4].value.pdb_float; - src_y = args[5].value.pdb_float; + src_x = args[3].value.pdb_float; + src_y = args[4].value.pdb_float; } /* num strokes */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -675,7 +666,7 @@ clone_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[7].value.pdb_pointer; + stroke_array = (double *) args[6].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/gimpthresholdtool.c b/app/tools/gimpthresholdtool.c index 0286f06c43..c4949c92d7 100644 --- a/app/tools/gimpthresholdtool.c +++ b/app/tools/gimpthresholdtool.c @@ -611,10 +611,6 @@ threshold_high_threshold_text_update (GtkWidget *w, /* The threshold procedure definition */ ProcArg threshold_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -640,7 +636,7 @@ ProcRecord threshold_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, threshold_args, /* Output arguments */ @@ -671,20 +667,15 @@ threshold_invoker (args) low_threshold = 0; high_threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -693,7 +684,7 @@ threshold_invoker (args) /* low threhsold */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value >= 0 && int_value < 256) low_threshold = int_value; else @@ -702,7 +693,7 @@ threshold_invoker (args) /* high threhsold */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) high_threshold = int_value; else diff --git a/app/tools/histogram_tool.c b/app/tools/histogram_tool.c index a08a5f00ed..075c5689e0 100644 --- a/app/tools/histogram_tool.c +++ b/app/tools/histogram_tool.c @@ -613,10 +613,6 @@ histogram_tool_blue_callback (GtkWidget *w, /* The histogram procedure definition */ ProcArg histogram_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -674,7 +670,7 @@ ProcRecord histogram_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, histogram_args, /* Output arguments */ @@ -709,25 +705,20 @@ histogram_invoker (Argument *args) low_range = 0; high_range = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -748,7 +739,7 @@ histogram_invoker (Argument *args) /* low range */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) low_range = int_value; else @@ -757,7 +748,7 @@ histogram_invoker (Argument *args) /* high range */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value < 256) high_range = int_value; else diff --git a/app/tools/hue_saturation.c b/app/tools/hue_saturation.c index 9b37b8b4b0..5a98039e2d 100644 --- a/app/tools/hue_saturation.c +++ b/app/tools/hue_saturation.c @@ -1027,10 +1027,6 @@ hue_saturation_hue_partition_events (GtkWidget *widget, /* The hue_saturation procedure definition */ ProcArg hue_saturation_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -1064,7 +1060,7 @@ ProcRecord hue_saturation_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, hue_saturation_args, /* Output arguments */ @@ -1100,20 +1096,15 @@ hue_saturation_invoker (Argument *args) lightness = 0.0; saturation = 0.0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1122,7 +1113,7 @@ hue_saturation_invoker (Argument *args) /* hue_range */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value < 0 || int_value > 6) success = FALSE; else @@ -1131,7 +1122,7 @@ hue_saturation_invoker (Argument *args) /* hue_offset */ if (success) { - fp_value = args[3].value.pdb_float; + fp_value = args[2].value.pdb_float; if (fp_value < -180 || fp_value > 180) success = FALSE; else @@ -1140,7 +1131,7 @@ hue_saturation_invoker (Argument *args) /* lightness */ if (success) { - fp_value = args[4].value.pdb_float; + fp_value = args[3].value.pdb_float; if (fp_value < -100 || fp_value > 100) success = FALSE; else @@ -1149,7 +1140,7 @@ hue_saturation_invoker (Argument *args) /* saturation */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value < -100 || fp_value > 100) success = FALSE; else diff --git a/app/tools/levels.c b/app/tools/levels.c index 3cb41bf2e6..cfab7c3b8a 100644 --- a/app/tools/levels.c +++ b/app/tools/levels.c @@ -1440,10 +1440,6 @@ levels_output_da_events (GtkWidget *widget, /* The levels procedure definition */ ProcArg levels_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -1485,7 +1481,7 @@ ProcRecord levels_proc = PDB_INTERNAL, /* Input arguments */ - 8, + 7, levels_args, /* Output arguments */ @@ -1524,20 +1520,15 @@ levels_invoker (Argument *args) low_output = 0; high_output = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -1546,7 +1537,7 @@ levels_invoker (Argument *args) /* channel */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (success) { if (drawable_gray (drawable)) @@ -1567,7 +1558,7 @@ levels_invoker (Argument *args) /* low input */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) low_input = int_value; else @@ -1576,7 +1567,7 @@ levels_invoker (Argument *args) /* high input */ if (success) { - int_value = args[4].value.pdb_int; + int_value = args[3].value.pdb_int; if (int_value >= 0 && int_value < 256) high_input = int_value; else @@ -1585,7 +1576,7 @@ levels_invoker (Argument *args) /* gamma */ if (success) { - fp_value = args[5].value.pdb_float; + fp_value = args[4].value.pdb_float; if (fp_value >= 0.1 && fp_value <= 10.0) gamma = fp_value; else @@ -1594,7 +1585,7 @@ levels_invoker (Argument *args) /* low output */ if (success) { - int_value = args[6].value.pdb_int; + int_value = args[5].value.pdb_int; if (int_value >= 0 && int_value < 256) low_output = int_value; else @@ -1603,7 +1594,7 @@ levels_invoker (Argument *args) /* high output */ if (success) { - int_value = args[7].value.pdb_int; + int_value = args[6].value.pdb_int; if (int_value >= 0 && int_value < 256) high_output = int_value; else diff --git a/app/tools/paintbrush.c b/app/tools/paintbrush.c index 0927048f9c..d443446029 100644 --- a/app/tools/paintbrush.c +++ b/app/tools/paintbrush.c @@ -244,10 +244,6 @@ paintbrush_non_gui_paint_func (PaintCore *paint_core, /* The paintbrush procedure definition */ ProcArg paintbrush_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -268,10 +264,6 @@ ProcArg paintbrush_args[] = ProcArg paintbrush_extended_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -306,7 +298,7 @@ ProcRecord paintbrush_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, paintbrush_args, /* Output arguments */ @@ -328,7 +320,7 @@ ProcRecord paintbrush_extended_proc = PDB_INTERNAL, /* Input arguments */ - 6, + 5, paintbrush_extended_args, /* Output arguments */ @@ -354,25 +346,20 @@ paintbrush_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* fade out */ if (success) { - fp_value = args[2].value.pdb_float; + fp_value = args[1].value.pdb_float; if (fp_value >= 0.0) non_gui_fade_out = fp_value; else @@ -381,7 +368,7 @@ paintbrush_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -390,7 +377,7 @@ paintbrush_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[4].value.pdb_pointer; + stroke_array = (double *) args[3].value.pdb_pointer; if (success) /* init the paint core */ @@ -444,25 +431,20 @@ paintbrush_extended_invoker (Argument *args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* fade out */ if (success) { - fp_value = args[2].value.pdb_float; + fp_value = args[1].value.pdb_float; if (fp_value >= 0.0) non_gui_fade_out = fp_value; else @@ -471,7 +453,7 @@ paintbrush_extended_invoker (Argument *args) /* num strokes */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -480,7 +462,7 @@ paintbrush_extended_invoker (Argument *args) /* point array */ if (success) - stroke_array = (double *) args[4].value.pdb_pointer; + stroke_array = (double *) args[3].value.pdb_pointer; if (success) /* init the paint core */ @@ -489,7 +471,7 @@ paintbrush_extended_invoker (Argument *args) if (success) { - non_gui_incremental = args[5].value.pdb_int; + non_gui_incremental = args[4].value.pdb_int; /* set the paint core's paint func */ non_gui_paint_core.paint_func = paintbrush_non_gui_paint_func; diff --git a/app/tools/pencil.c b/app/tools/pencil.c index 3e4cd39889..2306063fa8 100644 --- a/app/tools/pencil.c +++ b/app/tools/pencil.c @@ -131,10 +131,6 @@ pencil_non_gui_paint_func (PaintCore *paint_core, GimpDrawable *drawable, int st /* The pencil procedure definition */ ProcArg pencil_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -161,7 +157,7 @@ ProcRecord pencil_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, pencil_args, /* Output arguments */ @@ -187,25 +183,20 @@ pencil_invoker (args) drawable = NULL; num_strokes = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* num strokes */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value > 0) num_strokes = int_value / 2; else @@ -214,7 +205,7 @@ pencil_invoker (args) /* point array */ if (success) - stroke_array = (double *) args[3].value.pdb_pointer; + stroke_array = (double *) args[2].value.pdb_pointer; if (success) /* init the paint core */ diff --git a/app/tools/perspective_tool.c b/app/tools/perspective_tool.c index 4fbb268f1a..b735f560a7 100644 --- a/app/tools/perspective_tool.c +++ b/app/tools/perspective_tool.c @@ -321,10 +321,6 @@ perspective_tool_perspective (gimage, drawable, float_tiles, interpolation, matr /* The perspective procedure definition */ ProcArg perspective_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the affected drawable" @@ -386,7 +382,7 @@ ProcRecord perspective_proc = PDB_INTERNAL, /* Input arguments */ - 11, + 10, perspective_args, /* Output arguments */ @@ -418,38 +414,33 @@ perspective_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* perspective extents */ if (success) { - trans_info[X0] = args[3].value.pdb_float; - trans_info[Y0] = args[4].value.pdb_float; - trans_info[X1] = args[5].value.pdb_float; - trans_info[Y1] = args[6].value.pdb_float; - trans_info[X2] = args[7].value.pdb_float; - trans_info[Y2] = args[8].value.pdb_float; - trans_info[X3] = args[9].value.pdb_float; - trans_info[Y3] = args[10].value.pdb_float; + trans_info[X0] = args[2].value.pdb_float; + trans_info[Y0] = args[3].value.pdb_float; + trans_info[X1] = args[4].value.pdb_float; + trans_info[Y1] = args[5].value.pdb_float; + trans_info[X2] = args[6].value.pdb_float; + trans_info[Y2] = args[7].value.pdb_float; + trans_info[X3] = args[8].value.pdb_float; + trans_info[Y3] = args[9].value.pdb_float; } /* call the perspective procedure */ diff --git a/app/tools/posterize.c b/app/tools/posterize.c index 6d886e3480..ac27d94893 100644 --- a/app/tools/posterize.c +++ b/app/tools/posterize.c @@ -452,10 +452,6 @@ posterize_levels_text_update (GtkWidget *w, /* The posterize procedure definition */ ProcArg posterize_args[] = { - { PDB_IMAGE, - "image", - "the image" - }, { PDB_DRAWABLE, "drawable", "the drawable" @@ -477,7 +473,7 @@ ProcRecord posterize_proc = PDB_INTERNAL, /* Input arguments */ - 3, + 2, posterize_args, /* Output arguments */ @@ -505,20 +501,15 @@ posterize_invoker (Argument *args) drawable = NULL; levels = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -527,7 +518,7 @@ posterize_invoker (Argument *args) /* levels */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value >= 2 && int_value < 256) levels = int_value; else diff --git a/app/tools/rotate_tool.c b/app/tools/rotate_tool.c index 3521858aac..9bfbecb0ec 100644 --- a/app/tools/rotate_tool.c +++ b/app/tools/rotate_tool.c @@ -376,10 +376,6 @@ rotate_tool_rotate (gimage, drawable, angle, float_tiles, interpolation, matrix) /* The rotate procedure definition */ ProcArg rotate_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -413,7 +409,7 @@ ProcRecord rotate_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, rotate_args, /* Output arguments */ @@ -445,30 +441,25 @@ rotate_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* angle of rotation */ if (success) - angle = args[3].value.pdb_float; + angle = args[2].value.pdb_float; /* call the rotate procedure */ if (success) diff --git a/app/tools/scale_tool.c b/app/tools/scale_tool.c index c17cd02176..a0e49876b9 100644 --- a/app/tools/scale_tool.c +++ b/app/tools/scale_tool.c @@ -438,10 +438,6 @@ scale_tool_scale (gimage, drawable, trans_info, float_tiles, interpolation, matr /* The scale procedure definition */ ProcArg scale_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -487,7 +483,7 @@ ProcRecord scale_proc = PDB_INTERNAL, /* Input arguments */ - 7, + 6, scale_args, /* Output arguments */ @@ -519,34 +515,29 @@ scale_invoker (args) drawable = NULL; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* scale extents */ if (success) { - trans_info[X1] = args[3].value.pdb_float; - trans_info[Y1] = args[4].value.pdb_float; - trans_info[X2] = args[5].value.pdb_float; - trans_info[Y2] = args[6].value.pdb_float; + trans_info[X1] = args[2].value.pdb_float; + trans_info[Y1] = args[3].value.pdb_float; + trans_info[X2] = args[4].value.pdb_float; + trans_info[Y2] = args[5].value.pdb_float; if (trans_info[X1] >= trans_info[X2] || trans_info[Y1] >= trans_info[Y2]) diff --git a/app/tools/shear_tool.c b/app/tools/shear_tool.c index cd86593906..5ea59b6662 100644 --- a/app/tools/shear_tool.c +++ b/app/tools/shear_tool.c @@ -363,10 +363,6 @@ shear_tool_shear (gimage, drawable, float_tiles, interpolation, matrix) /* The shear procedure definition */ ProcArg shear_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the affected drawable") @@ -404,7 +400,7 @@ ProcRecord shear_proc = PDB_INTERNAL, /* Input arguments */ - 5, + 4, shear_args, /* Output arguments */ @@ -438,31 +434,26 @@ shear_invoker (args) shear_type = HORZ; layer = NULL; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* interpolation */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; interpolation = (int_value) ? TRUE : FALSE; } /* shear type */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; switch (int_value) { case 0: shear_type = HORZ; break; @@ -473,7 +464,7 @@ shear_invoker (args) /* shear extents */ if (success) { - shear_magnitude = args[4].value.pdb_float; + shear_magnitude = args[3].value.pdb_float; } /* call the shear procedure */ diff --git a/app/tools/threshold.c b/app/tools/threshold.c index 0286f06c43..c4949c92d7 100644 --- a/app/tools/threshold.c +++ b/app/tools/threshold.c @@ -611,10 +611,6 @@ threshold_high_threshold_text_update (GtkWidget *w, /* The threshold procedure definition */ ProcArg threshold_args[] = { - { PDB_IMAGE, - "image", - N_("the image") - }, { PDB_DRAWABLE, "drawable", N_("the drawable") @@ -640,7 +636,7 @@ ProcRecord threshold_proc = PDB_INTERNAL, /* Input arguments */ - 4, + 3, threshold_args, /* Output arguments */ @@ -671,20 +667,15 @@ threshold_invoker (args) low_threshold = 0; high_threshold = 0; - /* the gimage */ - if (success) - { - int_value = args[0].value.pdb_int; - if (! (gimage = gimage_get_ID (int_value))) - success = FALSE; - } /* the drawable */ if (success) { - int_value = args[1].value.pdb_int; + int_value = args[0].value.pdb_int; drawable = drawable_get_ID (int_value); - if (drawable == NULL || gimage != drawable_gimage (drawable)) - success = FALSE; + if (drawable == NULL) + success = FALSE; + else + gimage = drawable_gimage (drawable); } /* make sure the drawable is not indexed color */ if (success) @@ -693,7 +684,7 @@ threshold_invoker (args) /* low threhsold */ if (success) { - int_value = args[2].value.pdb_int; + int_value = args[1].value.pdb_int; if (int_value >= 0 && int_value < 256) low_threshold = int_value; else @@ -702,7 +693,7 @@ threshold_invoker (args) /* high threhsold */ if (success) { - int_value = args[3].value.pdb_int; + int_value = args[2].value.pdb_int; if (int_value >= 0 && int_value < 256) high_threshold = int_value; else