tools/pdbgen/pdb/display.pdb tools/pdbgen/pdb/drawable.pdb

2007-01-12  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb/display.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/vectors.pdb: added PDB functions to validate
	display, drawable, image and vectors IDs.

	* app/pdb/image_cmds.c
	* app/pdb/vectors_cmds.c
	* app/pdb/display_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/drawable_cmds.c
	* libgimp/gimpimage_pdb.[ch]
	* libgimp/gimpdisplay_pdb.[ch]
	* libgimp/gimpdrawable_pdb.[ch]
	* libgimp/gimpvectors_pdb.[ch]: regenerated.

	* libgimp/gimp.def: updated.


svn path=/trunk/; revision=21697
This commit is contained in:
Sven Neumann 2007-01-12 19:59:36 +00:00 committed by Sven Neumann
parent 1018f0b02f
commit 517b0c35ab
29 changed files with 626 additions and 45 deletions

View File

@ -1,3 +1,23 @@
2007-01-12 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb/display.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/vectors.pdb: added PDB functions to validate
display, drawable, image and vectors IDs.
* app/pdb/image_cmds.c
* app/pdb/vectors_cmds.c
* app/pdb/display_cmds.c
* app/pdb/internal_procs.c
* app/pdb/drawable_cmds.c
* libgimp/gimpimage_pdb.[ch]
* libgimp/gimpdisplay_pdb.[ch]
* libgimp/gimpdrawable_pdb.[ch]
* libgimp/gimpvectors_pdb.[ch]: regenerated.
* libgimp/gimp.def: updated.
2007-01-12 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpenumstore.c: added a construct-only property

View File

@ -35,6 +35,33 @@
#include "internal_procs.h"
static GValueArray *
display_is_valid_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
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);
}
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
g_value_set_boolean (&return_vals->values[1], valid);
return return_vals;
}
static GValueArray *
display_new_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -167,6 +194,34 @@ register_display_procs (GimpPDB *pdb)
{
GimpProcedure *procedure;
/*
* gimp-display-is-valid
*/
procedure = gimp_procedure_new (display_is_valid_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-display-is-valid");
gimp_procedure_set_static_strings (procedure,
"gimp-display-is-valid",
"Returns TRUE if the display is valid.",
"This procedure checks if the given display ID is valid and refers to an existing display.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2007",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_display_id ("display",
"display",
"The display to check",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("valid",
"valid",
"Whether the display ID is valid",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-display-new
*/

View File

@ -48,29 +48,31 @@
static GValueArray *
drawable_delete_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args)
drawable_is_valid_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
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)
{
if (g_object_is_floating (drawable))
{
g_object_ref_sink (drawable);
g_object_unref (drawable);
}
else
success = FALSE;
valid = (GIMP_IS_DRAWABLE (drawable) &&
gimp_item_is_attached (GIMP_ITEM (drawable)));
}
return gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
g_value_set_boolean (&return_vals->values[1], valid);
return return_vals;
}
static GValueArray *
@ -428,6 +430,32 @@ drawable_offsets_invoker (GimpProcedure *procedure,
return return_vals;
}
static GValueArray *
drawable_delete_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GValueArray *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
drawable = gimp_value_get_drawable (&args->values[0], gimp);
if (success)
{
if (g_object_is_floating (drawable))
{
g_object_ref_sink (drawable);
g_object_unref (drawable);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
}
static GValueArray *
drawable_get_image_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -1167,24 +1195,30 @@ register_drawable_procs (GimpPDB *pdb)
GimpProcedure *procedure;
/*
* gimp-drawable-delete
* gimp-drawable-is-valid
*/
procedure = gimp_procedure_new (drawable_delete_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-delete");
procedure = gimp_procedure_new (drawable_is_valid_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-is-valid");
gimp_procedure_set_static_strings (procedure,
"gimp-drawable-delete",
"Delete a drawable.",
"This procedure deletes the specified drawable. This must not be done if the image containing this drawable was already deleted or if the drawable was already removed from the image. The only case in which this procedure is useful is if you want to get rid of a drawable which has not yet been added to an image.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
"gimp-drawable-is-valid",
"Returns TRUE if the drawable is valid.",
"This procedure checks if the given drawable ID is valid and refers to an existing drawable.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2007",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The drawable to delete",
"The drawable to check",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("valid",
"valid",
"Whether the drawable ID is valid",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
@ -1566,6 +1600,28 @@ register_drawable_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-drawable-delete
*/
procedure = gimp_procedure_new (drawable_delete_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-drawable-delete");
gimp_procedure_set_static_strings (procedure,
"gimp-drawable-delete",
"Delete a drawable.",
"This procedure deletes the specified drawable. This must not be done if the image containing this drawable was already deleted or if the drawable was already removed from the image. The only case in which this procedure is useful is if you want to get rid of a drawable which has not yet been added to an image.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The drawable to delete",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-drawable-get-image
*/

View File

@ -69,6 +69,33 @@
#error "no FINITE() implementation available?!"
#endif
static GValueArray *
image_is_valid_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
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);
}
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
g_value_set_boolean (&return_vals->values[1], valid);
return return_vals;
}
static GValueArray *
image_list_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -2244,6 +2271,34 @@ register_image_procs (GimpPDB *pdb)
{
GimpProcedure *procedure;
/*
* gimp-image-is-valid
*/
procedure = gimp_procedure_new (image_is_valid_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-image-is-valid");
gimp_procedure_set_static_strings (procedure,
"gimp-image-is-valid",
"Returns TRUE if the image is valid.",
"This procedure checks if the given image ID is valid and refers to an existing image.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2007",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_image_id ("image",
"image",
"The image to check",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("valid",
"valid",
"Whether the image ID is valid",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-image-list
*/

View File

@ -29,7 +29,7 @@
#include "internal_procs.h"
/* 545 procedures registered total */
/* 549 procedures registered total */
void
internal_procs_init (GimpPDB *pdb)

View File

@ -43,6 +43,34 @@
#include "internal_procs.h"
static GValueArray *
vectors_is_valid_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
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)));
}
return_vals = gimp_procedure_get_return_values (procedure, success);
if (success)
g_value_set_boolean (&return_vals->values[1], valid);
return return_vals;
}
static GValueArray *
vectors_new_invoker (GimpProcedure *procedure,
Gimp *gimp,
@ -1228,6 +1256,34 @@ register_vectors_procs (GimpPDB *pdb)
{
GimpProcedure *procedure;
/*
* gimp-vectors-is-valid
*/
procedure = gimp_procedure_new (vectors_is_valid_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-vectors-is-valid");
gimp_procedure_set_static_strings (procedure,
"gimp-vectors-is-valid",
"Returns TRUE if the vectors object is valid.",
"This procedure checks if the given vectors ID is valid and refers to an existing vectors object.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2007",
NULL);
gimp_procedure_add_argument (procedure,
gimp_param_spec_vectors_id ("vectors",
"vectors",
"The vectors object to check",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
g_param_spec_boolean ("valid",
"valid",
"Whether the vectors ID is valid",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-vectors-new
*/

View File

@ -1,3 +1,16 @@
2007-01-12 Sven Neumann <sven@gimp.org>
* libgimp/libgimp-sections.txt
* libgimpbase/libgimpbase-sections.txt: added new symbols.
* libgimp/tmpl/gimpdisplay.sgml
* libgimp/tmpl/gimpdrawable.sgml
* libgimp/tmpl/gimpimage.sgml
* libgimp/tmpl/gimpvectors.sgml
* libgimpbase/tmpl/gimpbaseenums.sgml
* libgimpwidgets/tmpl/gimpintstore.sgml
* libgimpwidgets/tmpl/gimpenumstore.sgml: regenerated.
2007-01-12 Sven Neumann <sven@gimp.org>
* libgimpwidgets/libgimpwidgets-sections.txt: added new symbols.

View File

@ -263,6 +263,7 @@ gimp_image_convert_set_dither_matrix
<FILE>gimpdisplay</FILE>
gimp_display_new
gimp_display_delete
gimp_display_is_valid
gimp_display_get_window_handle
gimp_displays_flush
gimp_displays_reconnect
@ -275,6 +276,7 @@ gimp_drawable_get
gimp_drawable_detach
gimp_drawable_flush
gimp_drawable_delete
gimp_drawable_is_valid
gimp_drawable_get_name
gimp_drawable_set_name
gimp_drawable_get_visible
@ -501,6 +503,7 @@ gimp_image_list
gimp_image_new
gimp_image_duplicate
gimp_image_delete
gimp_image_is_valid
gimp_image_base_type
gimp_image_width
gimp_image_height
@ -887,6 +890,7 @@ gimp_image_undo_thaw
gimp_vectors_new
gimp_vectors_import_from_file
gimp_vectors_import_from_string
gimp_vectors_is_valid
gimp_vectors_get_strokes
gimp_vectors_get_image
gimp_vectors_get_linked

View File

@ -36,6 +36,15 @@ Functions to create, delete and flush new displays (views) on an image.
@Returns:
<!-- ##### FUNCTION gimp_display_is_valid ##### -->
<para>
</para>
@display_ID:
@Returns:
<!-- ##### FUNCTION gimp_display_get_window_handle ##### -->
<para>

View File

@ -66,6 +66,15 @@ Functions to manipulate drawables.
@Returns:
<!-- ##### FUNCTION gimp_drawable_is_valid ##### -->
<para>
</para>
@drawable_ID:
@Returns:
<!-- ##### FUNCTION gimp_drawable_get_name ##### -->
<para>

View File

@ -57,6 +57,15 @@ and operations involving multiple layers.
@Returns:
<!-- ##### FUNCTION gimp_image_is_valid ##### -->
<para>
</para>
@image_ID:
@Returns:
<!-- ##### FUNCTION gimp_image_base_type ##### -->
<para>

View File

@ -56,6 +56,15 @@ gimpvectors
@Returns:
<!-- ##### FUNCTION gimp_vectors_is_valid ##### -->
<para>
</para>
@vectors_ID:
@Returns:
<!-- ##### FUNCTION gimp_vectors_get_strokes ##### -->
<para>

View File

@ -41,6 +41,7 @@ GimpSizeType
GimpStackTraceMode
GimpTransferMode
GimpTransformDirection
GimpTransformResize
GimpVectorsStrokeType
<SUBSECTION Standard>
GIMP_TYPE_ADD_MASK_TYPE
@ -72,6 +73,7 @@ GIMP_TYPE_SIZE_TYPE
GIMP_TYPE_STACK_TRACE_MODE
GIMP_TYPE_TRANSFER_MODE
GIMP_TYPE_TRANSFORM_DIRECTION
GIMP_TYPE_TRANSFORM_RESIZE
GIMP_TYPE_VECTORS_STROKE_TYPE
gimp_add_mask_type_get_type
gimp_blend_mode_get_type
@ -102,6 +104,7 @@ gimp_size_type_get_type
gimp_stack_trace_mode_get_type
gimp_transfer_mode_get_type
gimp_transform_direction_get_type
gimp_transform_resize_get_type
gimp_vectors_stroke_type_get_type
</SECTION>

View File

@ -324,6 +324,16 @@ Basic GIMP enumeration data types.
@GIMP_TRANSFORM_FORWARD:
@GIMP_TRANSFORM_BACKWARD:
<!-- ##### ENUM GimpTransformResize ##### -->
<para>
</para>
@GIMP_TRANSFORM_RESIZE_ADJUST:
@GIMP_TRANSFORM_RESIZE_CLIP:
@GIMP_TRANSFORM_RESIZE_CROP:
@GIMP_TRANSFORM_RESIZE_CROP_WITH_ASPECT:
<!-- ##### ENUM GimpVectorsStrokeType ##### -->
<para>

View File

@ -23,6 +23,11 @@ GimpEnumStore
</para>
<!-- ##### ARG GimpEnumStore:enum-type ##### -->
<para>
</para>
<!-- ##### FUNCTION gimp_enum_store_new ##### -->
<para>

View File

@ -23,6 +23,11 @@ A model for integer based name-value pairs (e.g. enums)
</para>
<!-- ##### ARG GimpIntStore:user-data-type ##### -->
<para>
</para>
<!-- ##### ENUM GimpIntStoreColumns ##### -->
<para>

View File

@ -107,6 +107,7 @@ EXPORTS
gimp_destroy_params
gimp_display_delete
gimp_display_get_window_handle
gimp_display_is_valid
gimp_display_name
gimp_display_new
gimp_displays_flush
@ -140,6 +141,7 @@ EXPORTS
gimp_drawable_is_layer
gimp_drawable_is_layer_mask
gimp_drawable_is_rgb
gimp_drawable_is_valid
gimp_drawable_mask_bounds
gimp_drawable_mask_intersect
gimp_drawable_merge_shadow
@ -346,6 +348,7 @@ EXPORTS
gimp_image_grid_set_style
gimp_image_height
gimp_image_is_dirty
gimp_image_is_valid
gimp_image_list
gimp_image_lower_channel
gimp_image_lower_layer
@ -625,6 +628,7 @@ EXPORTS
gimp_vectors_get_visible
gimp_vectors_import_from_file
gimp_vectors_import_from_string
gimp_vectors_is_valid
gimp_vectors_new
gimp_vectors_parasite_attach
gimp_vectors_parasite_detach

View File

@ -25,6 +25,39 @@
#include "gimp.h"
/**
* gimp_display_is_valid:
* @display_ID: The display to check.
*
* Returns TRUE if the display is valid.
*
* This procedure checks if the given display ID is valid and refers to
* an existing display.
*
* Returns: Whether the display ID is valid.
*
* Since: GIMP 2.4
*/
gboolean
gimp_display_is_valid (gint32 display_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean valid = FALSE;
return_vals = gimp_run_procedure ("gimp-display-is-valid",
&nreturn_vals,
GIMP_PDB_DISPLAY, display_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
valid = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return valid;
}
/**
* gimp_display_new:
* @image_ID: The image.

View File

@ -29,6 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_display_is_valid (gint32 display_ID);
gint32 gimp_display_new (gint32 image_ID);
gboolean gimp_display_delete (gint32 display_ID);
gint gimp_display_get_window_handle (gint32 display_ID);

View File

@ -31,36 +31,36 @@
#include "gimpdrawable_pdb.h"
/**
* gimp_drawable_delete:
* @drawable_ID: The drawable to delete.
* gimp_drawable_is_valid:
* @drawable_ID: The drawable to check.
*
* Delete a drawable.
* Returns TRUE if the drawable is valid.
*
* This procedure deletes the specified drawable. This must not be done
* if the image containing this drawable was already deleted or if the
* drawable was already removed from the image. The only case in which
* this procedure is useful is if you want to get rid of a drawable
* which has not yet been added to an image.
* This procedure checks if the given drawable ID is valid and refers
* to an existing drawable.
*
* Returns: TRUE on success.
* Returns: Whether the drawable ID is valid.
*
* Since: GIMP 2.4
*/
gboolean
gimp_drawable_delete (gint32 drawable_ID)
gimp_drawable_is_valid (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
gboolean valid = FALSE;
return_vals = gimp_run_procedure ("gimp-drawable-delete",
return_vals = gimp_run_procedure ("gimp-drawable-is-valid",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
valid = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
return valid;
}
/**
@ -477,6 +477,39 @@ gimp_drawable_offsets (gint32 drawable_ID,
return success;
}
/**
* gimp_drawable_delete:
* @drawable_ID: The drawable to delete.
*
* Delete a drawable.
*
* This procedure deletes the specified drawable. This must not be done
* if the image containing this drawable was already deleted or if the
* drawable was already removed from the image. The only case in which
* this procedure is useful is if you want to get rid of a drawable
* which has not yet been added to an image.
*
* Returns: TRUE on success.
*/
gboolean
gimp_drawable_delete (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-drawable-delete",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_get_image:
* @drawable_ID: The drawable.

View File

@ -29,7 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_drawable_delete (gint32 drawable_ID);
gboolean gimp_drawable_is_valid (gint32 drawable_ID);
gboolean gimp_drawable_is_layer (gint32 drawable_ID);
gboolean gimp_drawable_is_layer_mask (gint32 drawable_ID);
gboolean gimp_drawable_is_channel (gint32 drawable_ID);
@ -45,6 +45,7 @@ gint gimp_drawable_height (gint32
gboolean gimp_drawable_offsets (gint32 drawable_ID,
gint *offset_x,
gint *offset_y);
gboolean gimp_drawable_delete (gint32 drawable_ID);
gint32 gimp_drawable_get_image (gint32 drawable_ID);
#ifndef GIMP_DISABLE_DEPRECATED
gboolean gimp_drawable_set_image (gint32 drawable_ID,

View File

@ -27,6 +27,39 @@
#include "gimp.h"
/**
* gimp_image_is_valid:
* @image_ID: The image to check.
*
* Returns TRUE if the image is valid.
*
* This procedure checks if the given image ID is valid and refers to
* an existing image.
*
* Returns: Whether the image ID is valid.
*
* Since: GIMP 2.4
*/
gboolean
gimp_image_is_valid (gint32 image_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean valid = FALSE;
return_vals = gimp_run_procedure ("gimp-image-is-valid",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
valid = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return valid;
}
/**
* gimp_image_list:
* @num_images: The number of images currently open.

View File

@ -29,6 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_image_is_valid (gint32 image_ID);
gint* gimp_image_list (gint *num_images);
gint32 gimp_image_new (gint width,
gint height,

View File

@ -27,6 +27,39 @@
#include "gimp.h"
/**
* gimp_vectors_is_valid:
* @vectors_ID: The vectors object to check.
*
* Returns TRUE if the vectors object is valid.
*
* This procedure checks if the given vectors ID is valid and refers to
* an existing vectors object.
*
* Returns: Whether the vectors ID is valid.
*
* Since: GIMP 2.4
*/
gboolean
gimp_vectors_is_valid (gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean valid = FALSE;
return_vals = gimp_run_procedure ("gimp-vectors-is-valid",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
valid = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return valid;
}
/**
* gimp_vectors_new:
* @image_ID: The image.

View File

@ -29,6 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_vectors_is_valid (gint32 vectors_ID);
gint32 gimp_vectors_new (gint32 image_ID,
const gchar *name);
gint32 gimp_vectors_get_image (gint32 vectors_ID);

View File

@ -17,6 +17,35 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub display_is_valid {
$blurb = 'Returns TRUE if the display is valid.';
$help = <<'HELP';
This procedure checks if the given display ID is valid and refers to an
existing display.
HELP
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'display', type => 'display', no_validate => 1,
desc => 'The display to check' }
);
@outargs = (
{ name => 'valid', type => 'boolean',
desc => 'Whether the display ID is valid' }
);
%invoke = (
code => <<'CODE'
{
valid = (display != NULL);
}
CODE
);
}
sub display_new {
$blurb = 'Create a new display for the specified image.';
@ -177,8 +206,9 @@ CODE
@headers = qw("core/gimp.h");
@procs = qw(display_new display_delete display_get_window_handle
displays_flush displays_reconnect);
@procs = qw(display_is_valid display_new display_delete
display_get_window_handle
displays_flush displays_reconnect);
%exports = (app => [@procs], lib => [@procs]);

View File

@ -17,6 +17,36 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub drawable_is_valid {
$blurb = 'Returns TRUE if the drawable is valid.';
$help = <<'HELP';
This procedure checks if the given drawable ID is valid and refers to an
existing drawable.
HELP
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'drawable', type => 'drawable', no_validate => 1,
desc => 'The drawable to check' }
);
@outargs = (
{ name => 'valid', type => 'boolean',
desc => 'Whether the drawable ID is valid' }
);
%invoke = (
code => <<'CODE'
{
valid = (GIMP_IS_DRAWABLE (drawable) &&
gimp_item_is_attached (GIMP_ITEM (drawable)));
}
CODE
);
}
sub drawable_merge_shadow {
$blurb = 'Merge the shadow buffer with the specified drawable.';
@ -1251,11 +1281,12 @@ CODE
"core/gimplayermask.h"
"gimp-intl.h");
@procs = qw(drawable_delete
@procs = qw(drawable_is_valid
drawable_is_layer drawable_is_layer_mask drawable_is_channel
drawable_type drawable_type_with_alpha drawable_has_alpha
drawable_is_rgb drawable_is_gray drawable_is_indexed
drawable_bpp drawable_width drawable_height drawable_offsets
drawable_delete
drawable_get_image drawable_set_image
drawable_get_name drawable_set_name
drawable_get_visible drawable_set_visible

View File

@ -17,6 +17,35 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub image_is_valid {
$blurb = 'Returns TRUE if the image is valid.';
$help = <<'HELP';
This procedure checks if the given image ID is valid and refers to an
existing image.
HELP
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'image', type => 'image', no_validate => 1,
desc => 'The image to check' }
);
@outargs = (
{ name => 'valid', type => 'boolean',
desc => 'Whether the image ID is valid' }
);
%invoke = (
code => <<'CODE'
{
valid = GIMP_IS_IMAGE (image);
}
CODE
);
}
sub image_list {
$blurb = 'Returns the list of images currently open.';
@ -2527,7 +2556,9 @@ CODE
"core/gimpunit.h"
"gimp-intl.h");
@procs = qw(image_list image_new image_duplicate image_delete
@procs = qw(image_is_valid
image_list
image_new image_duplicate image_delete
image_base_type
image_width image_height
image_free_shadow
@ -2570,7 +2601,7 @@ CODE
image_get_channel_by_tattoo
image_get_vectors_by_tattoo);
%exports = (app => [@procs], lib => [@procs[0..44,47..73]]);
%exports = (app => [@procs], lib => [@procs[0..45,48..74]]);
$desc = 'Image';

View File

@ -15,6 +15,36 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sub vectors_is_valid {
$blurb = 'Returns TRUE if the vectors object is valid.';
$help = <<'HELP';
This procedure checks if the given vectors ID is valid and refers to an
existing vectors object.
HELP
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors', no_validate => 1,
desc => 'The vectors object to check' }
);
@outargs = (
{ name => 'valid', type => 'boolean',
desc => 'Whether the vectors ID is valid' }
);
%invoke = (
code => <<'CODE'
{
valid = (GIMP_IS_VECTORS (vectors) &&
gimp_item_is_attached (GIMP_ITEM (vectors)));
}
CODE
);
}
sub vectors_new {
$blurb = 'Creates a new empty vectors object.';
@ -1253,7 +1283,8 @@ CODE
"vectors/gimpvectors.h"
"gimp-intl.h");
@procs = qw(vectors_new
@procs = qw(vectors_is_valid
vectors_new
vectors_get_image
vectors_get_name vectors_set_name
vectors_get_visible vectors_set_visible