tools/pdbgen/pdb/display.pdb (diplay_is_valid)

2007-04-26  Michael Natterer  <mitch@gimp.org>

	* 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.


svn path=/trunk/; revision=22349
This commit is contained in:
Michael Natterer 2007-04-26 17:54:23 +00:00 committed by Michael Natterer
parent e8215c6d38
commit 37a3f95d16
9 changed files with 40 additions and 47 deletions

View File

@ -1,3 +1,20 @@
2007-04-26 Michael Natterer <mitch@gimp.org>
* 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 <mitch@gimp.org>
* tools/pdbgen/pdb/pattern.pdb

View File

@ -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",

View File

@ -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",

View File

@ -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;
}

View File

@ -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",

View File

@ -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' }
);

View File

@ -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
);

View File

@ -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' }
);

View File

@ -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
);