From 549df3a0df875f5b5713fdff78cebeab6b6abc67 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 6 May 2006 19:03:03 +0000 Subject: [PATCH] added "gboolean none_ok" members to GimpParamSpecImageID, 2006-05-06 Michael Natterer * app/core/gimpparamspecs.[ch]: added "gboolean none_ok" members to GimpParamSpecImageID, GimpParamSpecItemID and GimpParamSpecDisplayID. If none_ok is set, allow '0' and '-1' as valid IDs. Added "none_ok" parameter to all ID param spec constructors. * app/xcf/xcf.c: require real image IDs, but allow images without active drawable. * app/pdb/gimp-pdb-compat.c: set none_ok to TRUE in all compat param specs, so only IDs that are really random garbage don't pass validation. Fixes validation errors with 0 and -1 IDs. * tools/pdbgen/app.pl: set none_ok to FALSE by default. Added support for $arg->{none_ok} to control it. * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/progress.pdb * tools/pdbgen/pdb/text_tool.pdb: use none_ok instead of no_success (which disables validation entirely). * app/pdb/[many]_cmds.c: regenerated. --- ChangeLog | 3 +++ app/xcf/xcf.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index eaf74bbfdb..0fade88da7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ valid IDs. Added "none_ok" parameter to all ID param spec constructors. + * app/xcf/xcf.c: require real image IDs, but allow images without + active drawable. + * app/pdb/gimp-pdb-compat.c: set none_ok to TRUE in all compat param specs, so only IDs that are really random garbage don't pass validation. Fixes validation errors with 0 and -1 IDs. diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index b16b09c59c..c8613d6e61 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -174,13 +174,13 @@ xcf_init (Gimp *gimp) gimp_param_spec_image_id ("image", "Image", "Input image", - gimp, + gimp, FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, gimp_param_spec_drawable_id ("drawable", "Drawable", "Active drawable of input image", - gimp, + gimp, TRUE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, gimp_param_spec_string ("filename", @@ -258,7 +258,7 @@ xcf_init (Gimp *gimp) gimp_param_spec_image_id ("image", "Image", "Output image", - gimp, + gimp, FALSE, GIMP_PARAM_READWRITE)); gimp_plug_in_manager_add_procedure (gimp->plug_in_manager, proc); g_object_unref (procedure);