diff --git a/ChangeLog b/ChangeLog index fbec12ed42..72c7dd505f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-04-26 Michael Natterer + + * tools/pdbgen/pdb/display.pdb (diplay_is_valid) + * tools/pdbgen/pdb/drawable.pdb (drawable_is_valid) + * tools/pdbgen/pdb/image.pdb (image_is_valid) + * tools/pdbgen/pdb/vectors.pdb (vectors_is_valid): it's the + argument flag "no_success" which turns off validation, not + "no_validate" (how obvious). Also fixed drawable and vectors + procedures to check for !gimp_item_is_removed() instead of + gimp_item_is_attached() (a newly created item is unattached + but valid). + + * app/pdb/display_cmds.c + * app/pdb/drawable_cmds.c + * app/pdb/image_cmds.c + * app/pdb/vectors_cmds.c: regenerated. + 2007-04-26 Michael Natterer * tools/pdbgen/pdb/pattern.pdb diff --git a/app/pdb/display_cmds.c b/app/pdb/display_cmds.c index 1b2aed9d3b..2d83dc87d4 100644 --- a/app/pdb/display_cmds.c +++ b/app/pdb/display_cmds.c @@ -42,22 +42,16 @@ display_is_valid_invoker (GimpProcedure *procedure, GimpProgress *progress, const GValueArray *args) { - gboolean success = TRUE; GValueArray *return_vals; GimpObject *display; gboolean valid = FALSE; display = gimp_value_get_display (&args->values[0], gimp); - if (success) - { - valid = (display != NULL); - } + valid = (display != NULL); - return_vals = gimp_procedure_get_return_values (procedure, success); - - if (success) - g_value_set_boolean (&return_vals->values[1], valid); + return_vals = gimp_procedure_get_return_values (procedure, TRUE); + g_value_set_boolean (&return_vals->values[1], valid); return return_vals; } @@ -212,7 +206,7 @@ register_display_procs (GimpPDB *pdb) "display", "The display to check", pdb->gimp, FALSE, - GIMP_PARAM_READWRITE)); + GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE)); gimp_procedure_add_return_value (procedure, g_param_spec_boolean ("valid", "valid", diff --git a/app/pdb/drawable_cmds.c b/app/pdb/drawable_cmds.c index 0caacca1fd..6261464c3a 100644 --- a/app/pdb/drawable_cmds.c +++ b/app/pdb/drawable_cmds.c @@ -54,23 +54,17 @@ drawable_is_valid_invoker (GimpProcedure *procedure, GimpProgress *progress, const GValueArray *args) { - gboolean success = TRUE; GValueArray *return_vals; GimpDrawable *drawable; gboolean valid = FALSE; drawable = gimp_value_get_drawable (&args->values[0], gimp); - if (success) - { - valid = (GIMP_IS_DRAWABLE (drawable) && - gimp_item_is_attached (GIMP_ITEM (drawable))); - } + valid = (GIMP_IS_DRAWABLE (drawable) && + ! gimp_item_is_removed (GIMP_ITEM (drawable))); - return_vals = gimp_procedure_get_return_values (procedure, success); - - if (success) - g_value_set_boolean (&return_vals->values[1], valid); + return_vals = gimp_procedure_get_return_values (procedure, TRUE); + g_value_set_boolean (&return_vals->values[1], valid); return return_vals; } @@ -1207,7 +1201,7 @@ register_drawable_procs (GimpPDB *pdb) "drawable", "The drawable to check", pdb->gimp, FALSE, - GIMP_PARAM_READWRITE)); + GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE)); gimp_procedure_add_return_value (procedure, g_param_spec_boolean ("valid", "valid", diff --git a/app/pdb/image_cmds.c b/app/pdb/image_cmds.c index 261e32cc8a..f25c3a0104 100644 --- a/app/pdb/image_cmds.c +++ b/app/pdb/image_cmds.c @@ -76,22 +76,16 @@ image_is_valid_invoker (GimpProcedure *procedure, GimpProgress *progress, const GValueArray *args) { - gboolean success = TRUE; GValueArray *return_vals; GimpImage *image; gboolean valid = FALSE; image = gimp_value_get_image (&args->values[0], gimp); - if (success) - { - valid = GIMP_IS_IMAGE (image); - } + valid = GIMP_IS_IMAGE (image); - return_vals = gimp_procedure_get_return_values (procedure, success); - - if (success) - g_value_set_boolean (&return_vals->values[1], valid); + return_vals = gimp_procedure_get_return_values (procedure, TRUE); + g_value_set_boolean (&return_vals->values[1], valid); return return_vals; } diff --git a/app/pdb/vectors_cmds.c b/app/pdb/vectors_cmds.c index 8e8d9cf54f..2e626ea00c 100644 --- a/app/pdb/vectors_cmds.c +++ b/app/pdb/vectors_cmds.c @@ -50,23 +50,17 @@ vectors_is_valid_invoker (GimpProcedure *procedure, GimpProgress *progress, const GValueArray *args) { - gboolean success = TRUE; GValueArray *return_vals; GimpVectors *vectors; gboolean valid = FALSE; vectors = gimp_value_get_vectors (&args->values[0], gimp); - if (success) - { - valid = (GIMP_IS_VECTORS (vectors) && - gimp_item_is_attached (GIMP_ITEM (vectors))); - } + valid = (GIMP_IS_VECTORS (vectors) && + ! gimp_item_is_removed (GIMP_ITEM (vectors))); - return_vals = gimp_procedure_get_return_values (procedure, success); - - if (success) - g_value_set_boolean (&return_vals->values[1], valid); + return_vals = gimp_procedure_get_return_values (procedure, TRUE); + g_value_set_boolean (&return_vals->values[1], valid); return return_vals; } @@ -1274,7 +1268,7 @@ register_vectors_procs (GimpPDB *pdb) "vectors", "The vectors object to check", pdb->gimp, FALSE, - GIMP_PARAM_READWRITE)); + GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE)); gimp_procedure_add_return_value (procedure, g_param_spec_boolean ("valid", "valid", diff --git a/tools/pdbgen/pdb/display.pdb b/tools/pdbgen/pdb/display.pdb index 9e32f1ba25..a3314bcad4 100644 --- a/tools/pdbgen/pdb/display.pdb +++ b/tools/pdbgen/pdb/display.pdb @@ -28,7 +28,7 @@ HELP &neo_pdb_misc('2007', '2.4'); @inargs = ( - { name => 'display', type => 'display', no_validate => 1, + { name => 'display', type => 'display', no_success => 1, desc => 'The display to check' } ); diff --git a/tools/pdbgen/pdb/drawable.pdb b/tools/pdbgen/pdb/drawable.pdb index 444338212c..58a9a72c32 100644 --- a/tools/pdbgen/pdb/drawable.pdb +++ b/tools/pdbgen/pdb/drawable.pdb @@ -28,7 +28,7 @@ HELP &neo_pdb_misc('2007', '2.4'); @inargs = ( - { name => 'drawable', type => 'drawable', no_validate => 1, + { name => 'drawable', type => 'drawable', no_success => 1, desc => 'The drawable to check' } ); @@ -41,7 +41,7 @@ HELP code => <<'CODE' { valid = (GIMP_IS_DRAWABLE (drawable) && - gimp_item_is_attached (GIMP_ITEM (drawable))); + ! gimp_item_is_removed (GIMP_ITEM (drawable))); } CODE ); diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb index 3e98cfba10..d39184f507 100644 --- a/tools/pdbgen/pdb/image.pdb +++ b/tools/pdbgen/pdb/image.pdb @@ -28,7 +28,7 @@ HELP &neo_pdb_misc('2007', '2.4'); @inargs = ( - { name => 'image', type => 'image', no_validate => 1, + { name => 'image', type => 'image', no_success => 1, desc => 'The image to check' } ); diff --git a/tools/pdbgen/pdb/vectors.pdb b/tools/pdbgen/pdb/vectors.pdb index 20f3b22907..f43d28e715 100644 --- a/tools/pdbgen/pdb/vectors.pdb +++ b/tools/pdbgen/pdb/vectors.pdb @@ -26,7 +26,7 @@ HELP &neo_pdb_misc('2007', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', no_validate => 1, + { name => 'vectors', type => 'vectors', no_success => 1, desc => 'The vectors object to check' } ); @@ -39,7 +39,7 @@ HELP code => <<'CODE' { valid = (GIMP_IS_VECTORS (vectors) && - gimp_item_is_attached (GIMP_ITEM (vectors))); + ! gimp_item_is_removed (GIMP_ITEM (vectors))); } CODE );