removed std_image_arg(), std_antialias_arg() and std_orientation_enum().

2006-03-23  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/stddefs.pdb: removed std_image_arg(),
	std_antialias_arg() and std_orientation_enum().

	* tools/pdbgen/pdb/*.pdb: changed accordingly. Did a global
	s/gimage/image/. Some more cleanup.

	* tools/pdbgen/pdb/grid.pdb
	* tools/pdbgen/pdb/guides.pdb: removed utility functions.

	* tools/pdbgen/pdb/vectors.pdb: reordered procedures. Removed
	obsolete procedure.

	* app/pdb/channel_cmds.c
	* app/pdb/convert_cmds.c
	* app/pdb/display_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/fileops_cmds.c
	* app/pdb/grid_cmds.c
	* app/pdb/guides_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/parasite_cmds.c
	* app/pdb/paths_cmds.c
	* app/pdb/selection_cmds.c
	* app/pdb/selection_tools_cmds.c
	* app/pdb/text_tool_cmds.c
	* app/pdb/undo_cmds.c
	* app/pdb/vectors_cmds.c
	* libgimp/gimpdrawable_pdb.c
	* libgimp/gimpimage_pdb.[ch]
	* libgimp/gimpvectors_pdb.[ch]: regenerated.
This commit is contained in:
Michael Natterer 2006-03-23 21:17:16 +00:00 committed by Michael Natterer
parent e04529c61a
commit cfa086788a
69 changed files with 2139 additions and 1683 deletions

View file

@ -1,3 +1,37 @@
2006-03-23 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/stddefs.pdb: removed std_image_arg(),
std_antialias_arg() and std_orientation_enum().
* tools/pdbgen/pdb/*.pdb: changed accordingly. Did a global
s/gimage/image/. Some more cleanup.
* tools/pdbgen/pdb/grid.pdb
* tools/pdbgen/pdb/guides.pdb: removed utility functions.
* tools/pdbgen/pdb/vectors.pdb: reordered procedures. Removed
obsolete procedure.
* app/pdb/channel_cmds.c
* app/pdb/convert_cmds.c
* app/pdb/display_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/fileops_cmds.c
* app/pdb/grid_cmds.c
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/parasite_cmds.c
* app/pdb/paths_cmds.c
* app/pdb/selection_cmds.c
* app/pdb/selection_tools_cmds.c
* app/pdb/text_tool_cmds.c
* app/pdb/undo_cmds.c
* app/pdb/vectors_cmds.c
* libgimp/gimpdrawable_pdb.c
* libgimp/gimpimage_pdb.[ch]
* libgimp/gimpvectors_pdb.[ch]: regenerated.
2006-03-23 Sven Neumann <sven@gimp.org> 2006-03-23 Sven Neumann <sven@gimp.org>
* themes/Small/gtkrc: commented out the hardcoded font setting. * themes/Small/gtkrc: commented out the hardcoded font setting.

View file

@ -66,7 +66,7 @@ channel_new_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 width; gint32 width;
gint32 height; gint32 height;
gchar *name; gchar *name;
@ -74,8 +74,8 @@ channel_new_invoker (Gimp *gimp,
GimpRGB color; GimpRGB color;
GimpChannel *channel = NULL; GimpChannel *channel = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
width = args[1].value.pdb_int; width = args[1].value.pdb_int;
@ -101,8 +101,10 @@ channel_new_invoker (Gimp *gimp,
GimpRGB rgb_color = color; GimpRGB rgb_color = color;
rgb_color.a = opacity / 100.0; rgb_color.a = opacity / 100.0;
channel = gimp_channel_new (gimage, width, height, name, &rgb_color); channel = gimp_channel_new (image, width, height, name, &rgb_color);
success = channel != NULL;
if (! channel)
success = FALSE;
} }
return_args = procedural_db_return_args (&channel_new_proc, success); return_args = procedural_db_return_args (&channel_new_proc, success);
@ -182,13 +184,13 @@ channel_new_from_component_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 component; gint32 component;
gchar *name; gchar *name;
GimpChannel *channel = NULL; GimpChannel *channel = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
component = args[1].value.pdb_int; component = args[1].value.pdb_int;
@ -201,8 +203,8 @@ channel_new_from_component_invoker (Gimp *gimp,
if (success) if (success)
{ {
if (gimp_image_get_component_index (gimage, component) != -1) if (gimp_image_get_component_index (image, component) != -1)
channel = gimp_channel_new_from_component (gimage, channel = gimp_channel_new_from_component (image,
component, name, NULL); component, name, NULL);
if (channel) if (channel)

View file

@ -52,16 +52,16 @@ image_convert_rgb_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
if (gimp_image_base_type (gimage) != GIMP_RGB) if (gimp_image_base_type (image) != GIMP_RGB)
gimp_image_convert (gimage, GIMP_RGB, 0, 0, FALSE, FALSE, 0, NULL, NULL); gimp_image_convert (image, GIMP_RGB, 0, 0, FALSE, FALSE, 0, NULL, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -103,16 +103,16 @@ image_convert_grayscale_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
if (gimp_image_base_type (gimage) != GIMP_GRAY) if (gimp_image_base_type (image) != GIMP_GRAY)
gimp_image_convert (gimage, GIMP_GRAY, 0, 0, FALSE, FALSE, 0, NULL, NULL); gimp_image_convert (image, GIMP_GRAY, 0, 0, FALSE, FALSE, 0, NULL, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -154,7 +154,7 @@ image_convert_indexed_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gint32 dither_type; gint32 dither_type;
gint32 palette_type; gint32 palette_type;
gint32 num_cols; gint32 num_cols;
@ -162,8 +162,8 @@ image_convert_indexed_invoker (Gimp *gimp,
gboolean remove_unused; gboolean remove_unused;
gchar *palette; gchar *palette;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
dither_type = args[1].value.pdb_int; dither_type = args[1].value.pdb_int;
@ -188,7 +188,7 @@ image_convert_indexed_invoker (Gimp *gimp,
{ {
GimpPalette *pal = NULL; GimpPalette *pal = NULL;
if (gimp_image_base_type (gimage) != GIMP_INDEXED) if (gimp_image_base_type (image) != GIMP_INDEXED)
{ {
switch (palette_type) switch (palette_type)
{ {
@ -213,7 +213,7 @@ image_convert_indexed_invoker (Gimp *gimp,
success = FALSE; success = FALSE;
if (success) if (success)
gimp_image_convert (gimage, GIMP_INDEXED, num_cols, dither_type, gimp_image_convert (image, GIMP_INDEXED, num_cols, dither_type,
alpha_dither, remove_unused, palette_type, pal, alpha_dither, remove_unused, palette_type, pal,
NULL); NULL);
} }

View file

@ -54,22 +54,22 @@ display_new_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
GimpObject *display = NULL; GimpObject *display = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
display = gimp_create_display (gimp, gimage, GIMP_UNIT_PIXEL, 1.0); display = gimp_create_display (gimp, image, GIMP_UNIT_PIXEL, 1.0);
if (display) if (display)
{ {
/* the first display takes ownership of the image */ /* the first display takes ownership of the image */
if (gimage->disp_count == 1) if (image->disp_count == 1)
g_object_unref (gimage); g_object_unref (image);
} }
else else
success = FALSE; success = FALSE;

View file

@ -155,7 +155,7 @@ static ProcRecord drawable_delete_proc =
"gimp-drawable-delete", "gimp-drawable-delete",
"gimp-drawable-delete", "gimp-drawable-delete",
"Delete a drawable.", "Delete a drawable.",
"This procedure deletes the specified drawable. This must not be done if the gimage 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 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",
"Spencer Kimball & Peter Mattis", "Spencer Kimball & Peter Mattis",
"1995-1996", "1995-1996",
@ -1018,7 +1018,7 @@ drawable_get_image_invoker (Gimp *gimp,
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpDrawable *drawable; GimpDrawable *drawable;
GimpImage *gimage = NULL; GimpImage *image = NULL;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable)))) if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
@ -1026,13 +1026,13 @@ drawable_get_image_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); image = gimp_item_get_image (GIMP_ITEM (drawable));
} }
return_args = procedural_db_return_args (&drawable_get_image_proc, success); return_args = procedural_db_return_args (&drawable_get_image_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = gimage ? gimp_image_get_ID (gimage) : -1; return_args[1].value.pdb_int = image ? gimp_image_get_ID (image) : -1;
return return_args; return return_args;
} }
@ -1081,19 +1081,19 @@ drawable_set_image_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpDrawable *drawable; GimpDrawable *drawable;
GimpImage *gimage; GimpImage *image;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable)))) if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
success = FALSE; success = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[1].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[1].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
if (gimage != gimp_item_get_image (GIMP_ITEM (drawable))) if (image != gimp_item_get_image (GIMP_ITEM (drawable)))
success = FALSE; success = FALSE;
} }
@ -2353,7 +2353,7 @@ drawable_thumbnail_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
TempBuf *buf; TempBuf *buf;
gint dwidth, dheight; gint dwidth, dheight;
@ -2366,7 +2366,7 @@ drawable_thumbnail_invoker (Gimp *gimp,
else else
width = MAX (1, (height * dwidth) / dheight); width = MAX (1, (height * dwidth) / dheight);
if (gimage->gimp->config->layer_previews) if (image->gimp->config->layer_previews)
buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (drawable), buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (drawable),
width, height); width, height);
else else
@ -2526,10 +2526,10 @@ drawable_sub_thumbnail_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
TempBuf *buf; TempBuf *buf;
if (gimage->gimp->config->layer_previews) if (image->gimp->config->layer_previews)
buf = gimp_drawable_get_sub_preview (drawable, buf = gimp_drawable_get_sub_preview (drawable,
src_x, src_y, src_x, src_y,
src_width, src_height, src_width, src_height,

View file

@ -552,11 +552,11 @@ file_save_thumbnail_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *filename; gchar *filename;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
filename = (gchar *) args[1].value.pdb_pointer; filename = (gchar *) args[1].value.pdb_pointer;
@ -565,7 +565,7 @@ file_save_thumbnail_invoker (Gimp *gimp,
if (success) if (success)
{ {
const gchar *image_uri = gimp_object_get_name (GIMP_OBJECT (gimage)); const gchar *image_uri = gimp_object_get_name (GIMP_OBJECT (image));
if (! image_uri) if (! image_uri)
success = FALSE; success = FALSE;
@ -587,7 +587,7 @@ file_save_thumbnail_invoker (Gimp *gimp,
GimpImagefile *imagefile; GimpImagefile *imagefile;
imagefile = gimp_imagefile_new (gimp, uri); imagefile = gimp_imagefile_new (gimp, uri);
success = gimp_imagefile_save_thumbnail (imagefile, NULL, gimage); success = gimp_imagefile_save_thumbnail (imagefile, NULL, image);
g_object_unref (imagefile); g_object_unref (imagefile);
} }

View file

@ -67,23 +67,23 @@ image_grid_get_spacing_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gdouble xspacing = 0.0; gdouble xspacing = 0.0;
gdouble yspacing = 0.0; gdouble yspacing = 0.0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
{ g_object_get (grid,
xspacing = grid->xspacing; "xspacing", &xspacing,
yspacing = grid->yspacing; "yspacing", &yspacing,
} NULL);
else else
success = FALSE; success = FALSE;
} }
@ -147,12 +147,12 @@ image_grid_set_spacing_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gdouble xspacing; gdouble xspacing;
gdouble yspacing; gdouble yspacing;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
xspacing = args[1].value.pdb_float; xspacing = args[1].value.pdb_float;
@ -161,7 +161,7 @@ image_grid_set_spacing_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
g_object_set (grid, g_object_set (grid,
@ -220,23 +220,23 @@ image_grid_get_offset_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gdouble xoffset = 0.0; gdouble xoffset = 0.0;
gdouble yoffset = 0.0; gdouble yoffset = 0.0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
{ g_object_get (grid,
xoffset = grid->xoffset; "xoffset", &xoffset,
yoffset = grid->yoffset; "yoffset", &yoffset,
} NULL);
else else
success = FALSE; success = FALSE;
} }
@ -300,12 +300,12 @@ image_grid_set_offset_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gdouble xoffset; gdouble xoffset;
gdouble yoffset; gdouble yoffset;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
xoffset = args[1].value.pdb_float; xoffset = args[1].value.pdb_float;
@ -314,7 +314,7 @@ image_grid_set_offset_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
g_object_set (grid, g_object_set (grid,
@ -373,16 +373,16 @@ image_grid_get_foreground_color_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
GimpRGB fgcolor = { 0.0, 0.0, 0.0, 1.0 }; GimpRGB fgcolor = { 0.0, 0.0, 0.0, 1.0 };
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
fgcolor = grid->fgcolor; fgcolor = grid->fgcolor;
@ -441,23 +441,21 @@ image_grid_set_foreground_color_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
GimpRGB fgcolor; GimpRGB fgcolor;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
fgcolor = args[1].value.pdb_color; fgcolor = args[1].value.pdb_color;
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
g_object_set (grid, g_object_set (grid, "fgcolor", &fgcolor, NULL);
"fgcolor", &fgcolor,
NULL);
else else
success = FALSE; success = FALSE;
} }
@ -505,16 +503,16 @@ image_grid_get_background_color_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
GimpRGB bgcolor = { 0.0, 0.0, 0.0, 1.0 }; GimpRGB bgcolor = { 0.0, 0.0, 0.0, 1.0 };
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
bgcolor = grid->bgcolor; bgcolor = grid->bgcolor;
@ -573,23 +571,21 @@ image_grid_set_background_color_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
GimpRGB bgcolor; GimpRGB bgcolor;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
bgcolor = args[1].value.pdb_color; bgcolor = args[1].value.pdb_color;
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
g_object_set (grid, g_object_set (grid, "bgcolor", &bgcolor, NULL);
"bgcolor", &bgcolor,
NULL);
else else
success = FALSE; success = FALSE;
} }
@ -637,19 +633,19 @@ image_grid_get_style_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 style = 0; gint32 style = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
style = grid->style; g_object_get (grid, "style", &style, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -705,11 +701,11 @@ image_grid_set_style_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gint32 style; gint32 style;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
style = args[1].value.pdb_int; style = args[1].value.pdb_int;
@ -718,12 +714,10 @@ image_grid_set_style_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
g_object_set (grid, g_object_set (grid, "style", style, NULL);
"style", style,
NULL);
else else
success = FALSE; success = FALSE;
} }

View file

@ -56,12 +56,12 @@ image_add_hguide_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 yposition; gint32 yposition;
gint32 guide = 0; gint32 guide = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
yposition = args[1].value.pdb_int; yposition = args[1].value.pdb_int;
@ -70,11 +70,11 @@ image_add_hguide_invoker (Gimp *gimp,
if (success) if (success)
{ {
if (yposition <= gimage->height) if (yposition <= image->height)
{ {
GimpGuide *g; GimpGuide *g;
g = gimp_image_add_hguide (gimage, yposition, TRUE); g = gimp_image_add_hguide (image, yposition, TRUE);
guide = g->guide_ID; guide = g->guide_ID;
} }
else else
@ -138,12 +138,12 @@ image_add_vguide_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 xposition; gint32 xposition;
gint32 guide = 0; gint32 guide = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
xposition = args[1].value.pdb_int; xposition = args[1].value.pdb_int;
@ -152,11 +152,11 @@ image_add_vguide_invoker (Gimp *gimp,
if (success) if (success)
{ {
if (xposition <= gimage->width) if (xposition <= image->width)
{ {
GimpGuide *g; GimpGuide *g;
g = gimp_image_add_vguide (gimage, xposition, TRUE); g = gimp_image_add_vguide (image, xposition, TRUE);
guide = g->guide_ID; guide = g->guide_ID;
} }
else else
@ -219,21 +219,21 @@ image_delete_guide_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gint32 guide; gint32 guide;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
guide = args[1].value.pdb_int; guide = args[1].value.pdb_int;
if (success) if (success)
{ {
GimpGuide *g = gimp_image_get_guide (gimage, guide); GimpGuide *g = gimp_image_get_guide (image, guide);
if (g) if (g)
gimp_image_remove_guide (gimage, g, TRUE); gimp_image_remove_guide (image, g, TRUE);
else else
success = FALSE; success = FALSE;
} }
@ -281,19 +281,19 @@ image_find_next_guide_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 guide; gint32 guide;
gint32 next_guide = 0; gint32 next_guide = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
guide = args[1].value.pdb_int; guide = args[1].value.pdb_int;
if (success) if (success)
{ {
GimpGuide *g = gimp_image_get_next_guide (gimage, guide, &success); GimpGuide *g = gimp_image_get_next_guide (image, guide, &success);
if (g) if (g)
next_guide = g->guide_ID; next_guide = g->guide_ID;
@ -356,19 +356,19 @@ image_get_guide_orientation_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 guide; gint32 guide;
gint32 orientation = 0; gint32 orientation = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
guide = args[1].value.pdb_int; guide = args[1].value.pdb_int;
if (success) if (success)
{ {
GimpGuide *g = gimp_image_get_guide (gimage, guide); GimpGuide *g = gimp_image_get_guide (image, guide);
if (g) if (g)
orientation = g->orientation; orientation = g->orientation;
@ -433,19 +433,19 @@ image_get_guide_position_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 guide; gint32 guide;
gint32 position = 0; gint32 position = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
guide = args[1].value.pdb_int; guide = args[1].value.pdb_int;
if (success) if (success)
{ {
GimpGuide *g = gimp_image_get_guide (gimage, guide); GimpGuide *g = gimp_image_get_guide (image, guide);
if (g) if (g)
position = g->position; position = g->position;

File diff suppressed because it is too large Load diff

View file

@ -104,7 +104,7 @@ layer_new_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 width; gint32 width;
gint32 height; gint32 height;
gint32 type; gint32 type;
@ -113,8 +113,8 @@ layer_new_invoker (Gimp *gimp,
gint32 mode; gint32 mode;
GimpLayer *layer = NULL; GimpLayer *layer = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
width = args[1].value.pdb_int; width = args[1].value.pdb_int;
@ -143,9 +143,11 @@ layer_new_invoker (Gimp *gimp,
if (success) if (success)
{ {
layer = gimp_layer_new (gimage, width, height, type, name, layer = gimp_layer_new (image, width, height, type, name,
opacity / 100.0, mode); opacity / 100.0, mode);
success = (layer != NULL);
if (! layer)
success = FALSE;
} }
return_args = procedural_db_return_args (&layer_new_proc, success); return_args = procedural_db_return_args (&layer_new_proc, success);
@ -677,9 +679,9 @@ layer_translate_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_DISPLACE, gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
_("Move Layer")); _("Move Layer"));
gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE); gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
@ -687,7 +689,7 @@ layer_translate_invoker (Gimp *gimp,
if (gimp_item_get_linked (GIMP_ITEM (layer))) if (gimp_item_get_linked (GIMP_ITEM (layer)))
gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE); gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
gimp_image_undo_group_end (gimage); gimp_image_undo_group_end (image);
} }
return procedural_db_return_args (&layer_translate_proc, success); return procedural_db_return_args (&layer_translate_proc, success);
@ -751,9 +753,9 @@ layer_set_offsets_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_DISPLACE, gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
_("Move Layer")); _("Move Layer"));
offx -= GIMP_ITEM (layer)->offset_x; offx -= GIMP_ITEM (layer)->offset_x;
@ -764,7 +766,7 @@ layer_set_offsets_invoker (Gimp *gimp,
if (gimp_item_get_linked (GIMP_ITEM (layer))) if (gimp_item_get_linked (GIMP_ITEM (layer)))
gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE); gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
gimp_image_undo_group_end (gimage); gimp_image_undo_group_end (image);
} }
return procedural_db_return_args (&layer_set_offsets_proc, success); return procedural_db_return_args (&layer_set_offsets_proc, success);

View file

@ -294,12 +294,12 @@ image_parasite_find_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
GimpParasite *parasite = NULL; GimpParasite *parasite = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -308,7 +308,7 @@ image_parasite_find_invoker (Gimp *gimp,
if (success) if (success)
{ {
parasite = gimp_parasite_copy (gimp_image_parasite_find (gimage, name)); parasite = gimp_parasite_copy (gimp_image_parasite_find (image, name));
if (! parasite) if (! parasite)
success = FALSE; success = FALSE;
@ -370,11 +370,11 @@ image_parasite_attach_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
GimpParasite *parasite; GimpParasite *parasite;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
parasite = (GimpParasite *) args[1].value.pdb_pointer; parasite = (GimpParasite *) args[1].value.pdb_pointer;
@ -383,7 +383,7 @@ image_parasite_attach_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_image_parasite_attach (gimage, parasite); gimp_image_parasite_attach (image, parasite);
} }
return procedural_db_return_args (&image_parasite_attach_proc, success); return procedural_db_return_args (&image_parasite_attach_proc, success);
@ -428,11 +428,11 @@ image_parasite_detach_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -441,7 +441,7 @@ image_parasite_detach_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_image_parasite_detach (gimage, name); gimp_image_parasite_detach (image, name);
} }
return procedural_db_return_args (&image_parasite_detach_proc, success); return procedural_db_return_args (&image_parasite_detach_proc, success);
@ -487,17 +487,17 @@ image_parasite_list_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 num_parasites = 0; gint32 num_parasites = 0;
gchar **parasites = NULL; gchar **parasites = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
parasites = gimp_image_parasite_list (gimage, &num_parasites); parasites = gimp_image_parasite_list (image, &num_parasites);
} }
return_args = procedural_db_return_args (&image_parasite_list_proc, success); return_args = procedural_db_return_args (&image_parasite_list_proc, success);

View file

@ -85,17 +85,17 @@ path_list_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 num_paths = 0; gint32 num_paths = 0;
gchar **path_list = NULL; gchar **path_list = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
path_list = gimp_container_get_name_array (gimage->vectors, &num_paths); path_list = gimp_container_get_name_array (image->vectors, &num_paths);
} }
return_args = procedural_db_return_args (&path_list_proc, success); return_args = procedural_db_return_args (&path_list_proc, success);
@ -114,7 +114,7 @@ static ProcArg path_list_inargs[] =
{ {
GIMP_PDB_IMAGE, GIMP_PDB_IMAGE,
"image", "image",
"The ID of the image to list the paths from" "The image to list the paths from"
} }
}; };
@ -158,16 +158,16 @@ path_get_current_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gchar *name = NULL; gchar *name = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_active_vectors (gimage); GimpVectors *vectors = gimp_image_get_active_vectors (image);
if (vectors) if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
@ -188,7 +188,7 @@ static ProcArg path_get_current_inargs[] =
{ {
GIMP_PDB_IMAGE, GIMP_PDB_IMAGE,
"image", "image",
"The ID of the image to get the current path from." "The image to get the current path from"
} }
}; };
@ -226,11 +226,11 @@ path_set_current_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -239,10 +239,10 @@ path_set_current_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_image_set_active_vectors (gimage, vectors); gimp_image_set_active_vectors (image, vectors);
else else
success = FALSE; success = FALSE;
} }
@ -255,7 +255,7 @@ static ProcArg path_set_current_inargs[] =
{ {
GIMP_PDB_IMAGE, GIMP_PDB_IMAGE,
"image", "image",
"The ID of the image in which a path will become current." "The image in which a path will become current"
}, },
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
@ -289,11 +289,11 @@ path_delete_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -302,10 +302,10 @@ path_delete_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_image_remove_vectors (gimage, vectors); gimp_image_remove_vectors (image, vectors);
else else
success = FALSE; success = FALSE;
} }
@ -318,7 +318,7 @@ static ProcArg path_delete_inargs[] =
{ {
GIMP_PDB_IMAGE, GIMP_PDB_IMAGE,
"image", "image",
"The ID of the image to delete the path from." "The image to delete the path from"
}, },
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
@ -353,15 +353,15 @@ path_get_points_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gint32 path_type = 0; gint32 path_type = 0;
gint32 path_closed = 0; gint32 path_closed = 0;
gint32 num_path_point_details = 0; gint32 num_path_point_details = 0;
gdouble *points_pairs = NULL; gdouble *points_pairs = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -370,7 +370,7 @@ path_get_points_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
{ {
@ -427,7 +427,7 @@ static ProcArg path_get_points_inargs[] =
{ {
GIMP_PDB_IMAGE, GIMP_PDB_IMAGE,
"image", "image",
"The ID of the image to list the paths from." "The image to list the paths from"
}, },
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
@ -485,14 +485,14 @@ path_set_points_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gint32 ptype; gint32 ptype;
gint32 num_path_points; gint32 num_path_points;
gdouble *points_pairs; gdouble *points_pairs;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -537,13 +537,13 @@ path_set_points_invoker (Gimp *gimp,
points[i].type = curr_point_pair[2]; points[i].type = curr_point_pair[2];
} }
vectors = gimp_vectors_compat_new (gimage, name, points, n_points, vectors = gimp_vectors_compat_new (image, name, points, n_points,
closed); closed);
g_free (points); g_free (points);
if (vectors) if (vectors)
gimp_image_add_vectors (gimage, vectors, 0); gimp_image_add_vectors (image, vectors, 0);
else else
success = FALSE; success = FALSE;
} }
@ -557,7 +557,7 @@ static ProcArg path_set_points_inargs[] =
{ {
GIMP_PDB_IMAGE, GIMP_PDB_IMAGE,
"image", "image",
"The ID of the image to set the paths in." "The image to set the paths in"
}, },
{ {
GIMP_PDB_STRING, GIMP_PDB_STRING,
@ -606,16 +606,16 @@ path_stroke_current_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_active_vectors (gimage); GimpVectors *vectors = gimp_image_get_active_vectors (image);
GimpDrawable *drawable = gimp_image_active_drawable (gimage); GimpDrawable *drawable = gimp_image_active_drawable (image);
if (vectors && drawable) if (vectors && drawable)
{ {
@ -640,7 +640,7 @@ static ProcArg path_stroke_current_inargs[] =
{ {
GIMP_PDB_IMAGE, GIMP_PDB_IMAGE,
"image", "image",
"The ID of the image which contains the path to stroke." "The image which contains the path to stroke"
} }
}; };
@ -670,14 +670,14 @@ path_get_point_at_dist_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gdouble distance; gdouble distance;
gint32 x_point = 0; gint32 x_point = 0;
gint32 y_point = 0; gint32 y_point = 0;
gdouble slope = 0.0; gdouble slope = 0.0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
distance = args[1].value.pdb_float; distance = args[1].value.pdb_float;
@ -691,7 +691,7 @@ path_get_point_at_dist_invoker (Gimp *gimp,
gdouble stroke_distance; gdouble stroke_distance;
GimpCoords position; GimpCoords position;
vectors = gimp_image_get_active_vectors (gimage); vectors = gimp_image_get_active_vectors (image);
if (vectors) if (vectors)
{ {
@ -752,7 +752,7 @@ static ProcArg path_get_point_at_dist_inargs[] =
{ {
GIMP_PDB_IMAGE, GIMP_PDB_IMAGE,
"image", "image",
"The ID of the image the paths belongs to" "The image the paths belongs to"
}, },
{ {
GIMP_PDB_FLOAT, GIMP_PDB_FLOAT,
@ -806,12 +806,12 @@ path_get_tattoo_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gint32 tattoo = 0; gint32 tattoo = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -820,7 +820,7 @@ path_get_tattoo_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors)); tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
@ -884,12 +884,12 @@ path_set_tattoo_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gint32 tattovalue; gint32 tattovalue;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -900,7 +900,7 @@ path_set_tattoo_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue); gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue);
@ -956,19 +956,19 @@ get_path_by_tattoo_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 tattoo; gint32 tattoo;
gchar *name = NULL; gchar *name = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
tattoo = args[1].value.pdb_int; tattoo = args[1].value.pdb_int;
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo); GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (image, tattoo);
if (vectors) if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
@ -1033,12 +1033,12 @@ path_get_locked_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gboolean locked = FALSE; gboolean locked = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -1047,7 +1047,7 @@ path_get_locked_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
locked = gimp_item_get_linked (GIMP_ITEM (vectors)); locked = gimp_item_get_linked (GIMP_ITEM (vectors));
@ -1111,12 +1111,12 @@ path_set_locked_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gboolean locked; gboolean locked;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -1127,7 +1127,7 @@ path_set_locked_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE); gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE);
@ -1182,7 +1182,7 @@ path_to_selection_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
gint32 op; gint32 op;
gboolean antialias; gboolean antialias;
@ -1190,8 +1190,8 @@ path_to_selection_invoker (Gimp *gimp,
gdouble feather_radius_x; gdouble feather_radius_x;
gdouble feather_radius_y; gdouble feather_radius_y;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -1212,10 +1212,10 @@ path_to_selection_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_channel_select_vectors (gimp_image_get_mask (gimage), gimp_channel_select_vectors (gimp_image_get_mask (image),
_("Path to Selection"), _("Path to Selection"),
vectors, vectors,
op, op,
@ -1294,13 +1294,13 @@ path_import_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *filename; gchar *filename;
gboolean merge; gboolean merge;
gboolean scale; gboolean scale;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
filename = (gchar *) args[1].value.pdb_pointer; filename = (gchar *) args[1].value.pdb_pointer;
@ -1313,7 +1313,7 @@ path_import_invoker (Gimp *gimp,
if (success) if (success)
{ {
success = gimp_vectors_import_file (gimage, filename, merge, scale, -1, NULL); success = gimp_vectors_import_file (image, filename, merge, scale, -1, NULL);
} }
return procedural_db_return_args (&path_import_proc, success); return procedural_db_return_args (&path_import_proc, success);
@ -1368,14 +1368,14 @@ path_import_string_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gchar *string; gchar *string;
gint32 length; gint32 length;
gboolean merge; gboolean merge;
gboolean scale; gboolean scale;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
string = (gchar *) args[1].value.pdb_pointer; string = (gchar *) args[1].value.pdb_pointer;
@ -1390,7 +1390,7 @@ path_import_string_invoker (Gimp *gimp,
if (success) if (success)
{ {
success = gimp_vectors_import_buffer (gimage, string, length, success = gimp_vectors_import_buffer (image, string, length,
merge, scale, -1, NULL); merge, scale, -1, NULL);
} }

View file

@ -83,19 +83,22 @@ selection_bounds_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gboolean non_empty = FALSE; gboolean non_empty = FALSE;
gint32 x1 = 0; gint32 x1 = 0;
gint32 y1 = 0; gint32 y1 = 0;
gint32 x2 = 0; gint32 x2 = 0;
gint32 y2 = 0; gint32 y2 = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
non_empty = gimp_channel_bounds (gimp_image_get_mask (gimage), &x1, &y1, &x2, &y2); {
non_empty = gimp_channel_bounds (gimp_image_get_mask (image),
&x1, &y1, &x2, &y2);
}
return_args = procedural_db_return_args (&selection_bounds_proc, success); return_args = procedural_db_return_args (&selection_bounds_proc, success);
@ -175,13 +178,13 @@ selection_value_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gint32 x; gint32 x;
gint32 y; gint32 y;
gint32 value = 0; gint32 value = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
x = args[1].value.pdb_int; x = args[1].value.pdb_int;
@ -190,7 +193,7 @@ selection_value_invoker (Gimp *gimp,
if (success) if (success)
{ {
value = gimp_pickable_get_opacity_at (GIMP_PICKABLE (gimp_image_get_mask (gimage)), x, y); value = gimp_pickable_get_opacity_at (GIMP_PICKABLE (gimp_image_get_mask (image)), x, y);
} }
return_args = procedural_db_return_args (&selection_value_proc, success); return_args = procedural_db_return_args (&selection_value_proc, success);
@ -255,16 +258,16 @@ selection_is_empty_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gboolean is_empty = FALSE; gboolean is_empty = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
is_empty = gimp_channel_is_empty (gimp_image_get_mask (gimage)); is_empty = gimp_channel_is_empty (gimp_image_get_mask (image));
} }
return_args = procedural_db_return_args (&selection_is_empty_proc, success); return_args = procedural_db_return_args (&selection_is_empty_proc, success);
@ -318,12 +321,12 @@ selection_translate_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gint32 offx; gint32 offx;
gint32 offy; gint32 offy;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
offx = args[1].value.pdb_int; offx = args[1].value.pdb_int;
@ -331,7 +334,10 @@ selection_translate_invoker (Gimp *gimp,
offy = args[2].value.pdb_int; offy = args[2].value.pdb_int;
if (success) if (success)
gimp_item_translate (GIMP_ITEM (gimp_image_get_mask (gimage)), offx, offy, TRUE); {
gimp_item_translate (GIMP_ITEM (gimp_image_get_mask (image)),
offx, offy, TRUE);
}
return procedural_db_return_args (&selection_translate_proc, success); return procedural_db_return_args (&selection_translate_proc, success);
} }
@ -400,9 +406,9 @@ selection_float_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
layer = gimp_selection_float (gimp_image_get_mask (gimage), layer = gimp_selection_float (gimp_image_get_mask (image),
drawable, context, TRUE, offx, offy); drawable, context, TRUE, offx, offy);
if (! layer) if (! layer)
success = FALSE; success = FALSE;
@ -470,15 +476,15 @@ selection_invert_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
gimp_channel_invert (gimp_image_get_mask (gimage), TRUE); gimp_channel_invert (gimp_image_get_mask (image), TRUE);
} }
return procedural_db_return_args (&selection_invert_proc, success); return procedural_db_return_args (&selection_invert_proc, success);
@ -518,15 +524,15 @@ selection_sharpen_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
gimp_channel_sharpen (gimp_image_get_mask (gimage), TRUE); gimp_channel_sharpen (gimp_image_get_mask (image), TRUE);
} }
return procedural_db_return_args (&selection_sharpen_proc, success); return procedural_db_return_args (&selection_sharpen_proc, success);
@ -566,15 +572,15 @@ selection_all_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
gimp_channel_all (gimp_image_get_mask (gimage), TRUE); gimp_channel_all (gimp_image_get_mask (image), TRUE);
} }
return procedural_db_return_args (&selection_all_proc, success); return procedural_db_return_args (&selection_all_proc, success);
@ -614,15 +620,15 @@ selection_none_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE); gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
} }
return procedural_db_return_args (&selection_none_proc, success); return procedural_db_return_args (&selection_none_proc, success);
@ -662,11 +668,11 @@ selection_feather_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gdouble radius; gdouble radius;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
radius = args[1].value.pdb_float; radius = args[1].value.pdb_float;
@ -675,7 +681,7 @@ selection_feather_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_channel_feather (gimp_image_get_mask (gimage), gimp_channel_feather (gimp_image_get_mask (image),
radius, radius, TRUE); radius, radius, TRUE);
} }
@ -721,11 +727,11 @@ selection_border_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gint32 radius; gint32 radius;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
radius = args[1].value.pdb_int; radius = args[1].value.pdb_int;
@ -734,7 +740,7 @@ selection_border_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_channel_border (gimp_image_get_mask (gimage), gimp_channel_border (gimp_image_get_mask (image),
radius, radius, TRUE); radius, radius, TRUE);
} }
@ -780,11 +786,11 @@ selection_grow_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gint32 steps; gint32 steps;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
steps = args[1].value.pdb_int; steps = args[1].value.pdb_int;
@ -793,7 +799,7 @@ selection_grow_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_channel_grow (gimp_image_get_mask (gimage), gimp_channel_grow (gimp_image_get_mask (image),
steps, steps, TRUE); steps, steps, TRUE);
} }
@ -839,11 +845,11 @@ selection_shrink_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gint32 steps; gint32 steps;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
steps = args[1].value.pdb_int; steps = args[1].value.pdb_int;
@ -852,7 +858,7 @@ selection_shrink_invoker (Gimp *gimp,
if (success) if (success)
{ {
gimp_channel_shrink (gimp_image_get_mask (gimage), gimp_channel_shrink (gimp_image_get_mask (image),
steps, steps, FALSE, TRUE); steps, steps, FALSE, TRUE);
} }
@ -906,9 +912,9 @@ selection_layer_alpha_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
gimp_channel_select_alpha (gimp_image_get_mask (gimage), gimp_channel_select_alpha (gimp_image_get_mask (image),
GIMP_DRAWABLE (layer), GIMP_DRAWABLE (layer),
GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0); GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0);
} }
@ -958,13 +964,13 @@ selection_load_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImage *gimage; GimpImage *image;
gint off_x, off_y; gint off_x, off_y;
gimage = gimp_item_get_image (GIMP_ITEM (channel)); image = gimp_item_get_image (GIMP_ITEM (channel));
gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y); gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y);
gimp_channel_select_channel (gimp_image_get_mask (gimage), gimp_channel_select_channel (gimp_image_get_mask (image),
_("Channel to Selection"), _("Channel to Selection"),
channel, channel,
off_x, off_y, off_x, off_y,
@ -1010,16 +1016,16 @@ selection_save_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
GimpChannel *channel = NULL; GimpChannel *channel = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
channel = gimp_selection_save (gimp_image_get_mask (gimage)); channel = gimp_selection_save (gimp_image_get_mask (image));
if (! channel) if (! channel)
success = FALSE; success = FALSE;
@ -1089,13 +1095,13 @@ selection_combine_invoker (Gimp *gimp,
if (success) if (success)
{ {
GimpImage *gimage; GimpImage *image;
gint off_x, off_y; gint off_x, off_y;
gimage = gimp_item_get_image (GIMP_ITEM (channel)); image = gimp_item_get_image (GIMP_ITEM (channel));
gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y); gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y);
gimp_channel_select_channel (gimp_image_get_mask (gimage), gimp_channel_select_channel (gimp_image_get_mask (image),
_("Channel to Selection"), _("Channel to Selection"),
channel, channel,
off_x, off_y, off_x, off_y,

View file

@ -84,14 +84,16 @@ by_color_select_invoker (Gimp *gimp,
feather = args[5].value.pdb_int ? TRUE : FALSE; feather = args[5].value.pdb_int ? TRUE : FALSE;
feather_radius = args[6].value.pdb_float; feather_radius = args[6].value.pdb_float;
if (feather_radius < 0.0)
success = FALSE;
sample_merged = args[7].value.pdb_int ? TRUE : FALSE; sample_merged = args[7].value.pdb_int ? TRUE : FALSE;
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_by_color (gimp_image_get_mask (gimage), drawable, gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
sample_merged, sample_merged,
&color, &color,
threshold, threshold,
@ -175,7 +177,7 @@ ellipse_select_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gdouble x; gdouble x;
gdouble y; gdouble y;
gdouble width; gdouble width;
@ -185,8 +187,8 @@ ellipse_select_invoker (Gimp *gimp,
gboolean feather; gboolean feather;
gdouble feather_radius; gdouble feather_radius;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
x = args[1].value.pdb_float; x = args[1].value.pdb_float;
@ -210,10 +212,12 @@ ellipse_select_invoker (Gimp *gimp,
feather = args[7].value.pdb_int ? TRUE : FALSE; feather = args[7].value.pdb_int ? TRUE : FALSE;
feather_radius = args[8].value.pdb_float; feather_radius = args[8].value.pdb_float;
if (feather_radius < 0.0)
success = FALSE;
if (success) if (success)
{ {
gimp_channel_select_ellipse (gimp_image_get_mask (gimage), gimp_channel_select_ellipse (gimp_image_get_mask (image),
(gint) x, (gint) y, (gint) x, (gint) y,
(gint) width, (gint) height, (gint) width, (gint) height,
operation, operation,
@ -300,7 +304,7 @@ free_select_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gint32 num_segs; gint32 num_segs;
gdouble *segs; gdouble *segs;
gint32 operation; gint32 operation;
@ -308,8 +312,8 @@ free_select_invoker (Gimp *gimp,
gboolean feather; gboolean feather;
gdouble feather_radius; gdouble feather_radius;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
num_segs = args[1].value.pdb_int; num_segs = args[1].value.pdb_int;
@ -327,10 +331,12 @@ free_select_invoker (Gimp *gimp,
feather = args[5].value.pdb_int ? TRUE : FALSE; feather = args[5].value.pdb_int ? TRUE : FALSE;
feather_radius = args[6].value.pdb_float; feather_radius = args[6].value.pdb_float;
if (feather_radius < 0.0)
success = FALSE;
if (success) if (success)
{ {
gimp_channel_select_polygon (gimp_image_get_mask (gimage), gimp_channel_select_polygon (gimp_image_get_mask (image),
_("Free Select"), _("Free Select"),
num_segs / 2, num_segs / 2,
(GimpVector2 *) segs, (GimpVector2 *) segs,
@ -439,14 +445,16 @@ fuzzy_select_invoker (Gimp *gimp,
feather = args[6].value.pdb_int ? TRUE : FALSE; feather = args[6].value.pdb_int ? TRUE : FALSE;
feather_radius = args[7].value.pdb_float; feather_radius = args[7].value.pdb_float;
if (feather_radius < 0.0)
success = FALSE;
sample_merged = args[8].value.pdb_int ? TRUE : FALSE; sample_merged = args[8].value.pdb_int ? TRUE : FALSE;
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_fuzzy (gimp_image_get_mask (gimage), gimp_channel_select_fuzzy (gimp_image_get_mask (image),
drawable, drawable,
sample_merged, sample_merged,
x, y, x, y,
@ -537,7 +545,7 @@ rect_select_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gdouble x; gdouble x;
gdouble y; gdouble y;
gdouble width; gdouble width;
@ -546,8 +554,8 @@ rect_select_invoker (Gimp *gimp,
gboolean feather; gboolean feather;
gdouble feather_radius; gdouble feather_radius;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
x = args[1].value.pdb_float; x = args[1].value.pdb_float;
@ -569,10 +577,12 @@ rect_select_invoker (Gimp *gimp,
feather = args[6].value.pdb_int ? TRUE : FALSE; feather = args[6].value.pdb_int ? TRUE : FALSE;
feather_radius = args[7].value.pdb_float; feather_radius = args[7].value.pdb_float;
if (feather_radius < 0.0)
success = FALSE;
if (success) if (success)
{ {
gimp_channel_select_rectangle (gimp_image_get_mask (gimage), gimp_channel_select_rectangle (gimp_image_get_mask (image),
(gint) x, (gint) y, (gint) x, (gint) y,
(gint) width, (gint) height, (gint) width, (gint) height,
operation, operation,

View file

@ -55,7 +55,7 @@ text_fontname_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
GimpDrawable *drawable; GimpDrawable *drawable;
gdouble x; gdouble x;
gdouble y; gdouble y;
@ -67,8 +67,8 @@ text_fontname_invoker (Gimp *gimp,
gchar *fontname; gchar *fontname;
GimpLayer *text_layer = NULL; GimpLayer *text_layer = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int); drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
@ -108,7 +108,7 @@ text_fontname_invoker (Gimp *gimp,
{ {
gchar *real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size); gchar *real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size);
text_layer = text_render (gimage, drawable, context, text_layer = text_render (image, drawable, context,
x, y, real_fontname, text, x, y, real_fontname, text,
border, antialias); border, antialias);
@ -336,7 +336,7 @@ text_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
GimpDrawable *drawable; GimpDrawable *drawable;
gdouble x; gdouble x;
gdouble y; gdouble y;
@ -355,8 +355,8 @@ text_invoker (Gimp *gimp,
gchar *encoding; gchar *encoding;
GimpLayer *text_layer = NULL; GimpLayer *text_layer = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int); drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
@ -424,7 +424,7 @@ text_invoker (Gimp *gimp,
{ {
gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size); gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
text_layer = text_render (gimage, drawable, context, text_layer = text_render (image, drawable, context,
x, y, real_fontname, text, x, y, real_fontname, text,
border, antialias); border, antialias);

View file

@ -58,10 +58,10 @@ image_undo_group_start_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
@ -71,7 +71,7 @@ image_undo_group_start_invoker (Gimp *gimp,
if (gimp->current_plug_in) if (gimp->current_plug_in)
undo_desc = plug_in_get_undo_desc (gimp->current_plug_in); undo_desc = plug_in_get_undo_desc (gimp->current_plug_in);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_MISC, undo_desc); gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC, undo_desc);
if (undo_desc) if (undo_desc)
g_free (undo_desc); g_free (undo_desc);
@ -114,14 +114,16 @@ image_undo_group_end_invoker (Gimp *gimp,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpImage *gimage; GimpImage *image;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
gimp_image_undo_group_end (gimage); {
gimp_image_undo_group_end (image);
}
return procedural_db_return_args (&image_undo_group_end_proc, success); return procedural_db_return_args (&image_undo_group_end_proc, success);
} }
@ -161,15 +163,17 @@ image_undo_is_enabled_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gboolean enabled = FALSE; gboolean enabled = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
enabled = gimp_image_undo_is_enabled (gimage); {
enabled = gimp_image_undo_is_enabled (image);
}
return_args = procedural_db_return_args (&image_undo_is_enabled_proc, success); return_args = procedural_db_return_args (&image_undo_is_enabled_proc, success);
@ -223,15 +227,17 @@ image_undo_disable_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gboolean disabled = FALSE; gboolean disabled = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
disabled = gimp_image_undo_disable (gimage); {
disabled = gimp_image_undo_disable (image);
}
return_args = procedural_db_return_args (&image_undo_disable_proc, success); return_args = procedural_db_return_args (&image_undo_disable_proc, success);
@ -285,15 +291,17 @@ image_undo_enable_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gboolean enabled = FALSE; gboolean enabled = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
enabled = gimp_image_undo_enable (gimage); {
enabled = gimp_image_undo_enable (image);
}
return_args = procedural_db_return_args (&image_undo_enable_proc, success); return_args = procedural_db_return_args (&image_undo_enable_proc, success);
@ -347,15 +355,17 @@ image_undo_freeze_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gboolean frozen = FALSE; gboolean frozen = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
frozen = gimp_image_undo_freeze (gimage); {
frozen = gimp_image_undo_freeze (image);
}
return_args = procedural_db_return_args (&image_undo_freeze_proc, success); return_args = procedural_db_return_args (&image_undo_freeze_proc, success);
@ -409,15 +419,17 @@ image_undo_thaw_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gboolean thawed = FALSE; gboolean thawed = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
if (success) if (success)
thawed = gimp_image_undo_thaw (gimage); {
thawed = gimp_image_undo_thaw (image);
}
return_args = procedural_db_return_args (&image_undo_thaw_proc, success); return_args = procedural_db_return_args (&image_undo_thaw_proc, success);

View file

@ -36,16 +36,16 @@
#include "vectors/gimpvectors.h" #include "vectors/gimpvectors.h"
static ProcRecord vectors_new_proc; static ProcRecord vectors_new_proc;
static ProcRecord vectors_get_strokes_proc;
static ProcRecord vectors_get_image_proc; static ProcRecord vectors_get_image_proc;
static ProcRecord vectors_get_linked_proc;
static ProcRecord vectors_set_linked_proc;
static ProcRecord vectors_get_visible_proc;
static ProcRecord vectors_set_visible_proc;
static ProcRecord vectors_get_name_proc; static ProcRecord vectors_get_name_proc;
static ProcRecord vectors_set_name_proc; static ProcRecord vectors_set_name_proc;
static ProcRecord vectors_get_visible_proc;
static ProcRecord vectors_set_visible_proc;
static ProcRecord vectors_get_linked_proc;
static ProcRecord vectors_set_linked_proc;
static ProcRecord vectors_get_tattoo_proc; static ProcRecord vectors_get_tattoo_proc;
static ProcRecord vectors_set_tattoo_proc; static ProcRecord vectors_set_tattoo_proc;
static ProcRecord vectors_get_strokes_proc;
static ProcRecord vectors_stroke_get_length_proc; static ProcRecord vectors_stroke_get_length_proc;
static ProcRecord vectors_stroke_get_point_at_dist_proc; static ProcRecord vectors_stroke_get_point_at_dist_proc;
static ProcRecord vectors_stroke_remove_proc; static ProcRecord vectors_stroke_remove_proc;
@ -63,16 +63,16 @@ void
register_vectors_procs (Gimp *gimp) register_vectors_procs (Gimp *gimp)
{ {
procedural_db_register (gimp, &vectors_new_proc); procedural_db_register (gimp, &vectors_new_proc);
procedural_db_register (gimp, &vectors_get_strokes_proc);
procedural_db_register (gimp, &vectors_get_image_proc); procedural_db_register (gimp, &vectors_get_image_proc);
procedural_db_register (gimp, &vectors_get_linked_proc);
procedural_db_register (gimp, &vectors_set_linked_proc);
procedural_db_register (gimp, &vectors_get_visible_proc);
procedural_db_register (gimp, &vectors_set_visible_proc);
procedural_db_register (gimp, &vectors_get_name_proc); procedural_db_register (gimp, &vectors_get_name_proc);
procedural_db_register (gimp, &vectors_set_name_proc); procedural_db_register (gimp, &vectors_set_name_proc);
procedural_db_register (gimp, &vectors_get_visible_proc);
procedural_db_register (gimp, &vectors_set_visible_proc);
procedural_db_register (gimp, &vectors_get_linked_proc);
procedural_db_register (gimp, &vectors_set_linked_proc);
procedural_db_register (gimp, &vectors_get_tattoo_proc); procedural_db_register (gimp, &vectors_get_tattoo_proc);
procedural_db_register (gimp, &vectors_set_tattoo_proc); procedural_db_register (gimp, &vectors_set_tattoo_proc);
procedural_db_register (gimp, &vectors_get_strokes_proc);
procedural_db_register (gimp, &vectors_stroke_get_length_proc); procedural_db_register (gimp, &vectors_stroke_get_length_proc);
procedural_db_register (gimp, &vectors_stroke_get_point_at_dist_proc); procedural_db_register (gimp, &vectors_stroke_get_point_at_dist_proc);
procedural_db_register (gimp, &vectors_stroke_remove_proc); procedural_db_register (gimp, &vectors_stroke_remove_proc);
@ -95,12 +95,12 @@ vectors_new_invoker (Gimp *gimp,
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpImage *gimage; GimpImage *image;
gchar *name; gchar *name;
GimpVectors *vectors = NULL; GimpVectors *vectors = NULL;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); image = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage)) if (! GIMP_IS_IMAGE (image))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; name = (gchar *) args[1].value.pdb_pointer;
@ -109,7 +109,7 @@ vectors_new_invoker (Gimp *gimp,
if (success) if (success)
{ {
vectors = gimp_vectors_new (gimage, name); vectors = gimp_vectors_new (image, name);
} }
return_args = procedural_db_return_args (&vectors_new_proc, success); return_args = procedural_db_return_args (&vectors_new_proc, success);
@ -161,95 +161,6 @@ static ProcRecord vectors_new_proc =
{ { vectors_new_invoker } } { { vectors_new_invoker } }
}; };
static Argument *
vectors_get_strokes_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpVectors *vectors;
gint32 num_strokes = 0;
gint32 *stroke_ids = NULL;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
success = FALSE;
if (success)
{
num_strokes = gimp_vectors_get_n_strokes (vectors);
if (num_strokes)
{
GimpStroke *cur_stroke;
gint i = 0;
stroke_ids = g_new (gint32, num_strokes);
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL);
cur_stroke;
cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke))
{
stroke_ids[i] = gimp_stroke_get_ID (cur_stroke);
i++;
}
}
}
return_args = procedural_db_return_args (&vectors_get_strokes_proc, success);
if (success)
{
return_args[1].value.pdb_int = num_strokes;
return_args[2].value.pdb_pointer = stroke_ids;
}
return return_args;
}
static ProcArg vectors_get_strokes_inargs[] =
{
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
}
};
static ProcArg vectors_get_strokes_outargs[] =
{
{
GIMP_PDB_INT32,
"num-strokes",
"The number of strokes returned."
},
{
GIMP_PDB_INT32ARRAY,
"stroke-ids",
"List of the strokes belonging to the path."
}
};
static ProcRecord vectors_get_strokes_proc =
{
"gimp-vectors-get-strokes",
"gimp-vectors-get-strokes",
"List the strokes associated with the passed path.",
"Returns an Array with the stroke-IDs associated with the passed path.",
"Simon Budig",
"Simon Budig",
"2005",
NULL,
GIMP_INTERNAL,
1,
vectors_get_strokes_inargs,
2,
vectors_get_strokes_outargs,
{ { vectors_get_strokes_invoker } }
};
static Argument * static Argument *
vectors_get_image_invoker (Gimp *gimp, vectors_get_image_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
@ -315,15 +226,15 @@ static ProcRecord vectors_get_image_proc =
}; };
static Argument * static Argument *
vectors_get_linked_invoker (Gimp *gimp, vectors_get_name_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpVectors *vectors; GimpVectors *vectors;
gboolean linked = FALSE; gchar *name = NULL;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -331,18 +242,18 @@ vectors_get_linked_invoker (Gimp *gimp,
if (success) if (success)
{ {
linked = gimp_item_get_linked (GIMP_ITEM (vectors)); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
} }
return_args = procedural_db_return_args (&vectors_get_linked_proc, success); return_args = procedural_db_return_args (&vectors_get_name_proc, success);
if (success) if (success)
return_args[1].value.pdb_int = linked; return_args[1].value.pdb_pointer = name;
return return_args; return return_args;
} }
static ProcArg vectors_get_linked_inargs[] = static ProcArg vectors_get_name_inargs[] =
{ {
{ {
GIMP_PDB_VECTORS, GIMP_PDB_VECTORS,
@ -351,58 +262,60 @@ static ProcArg vectors_get_linked_inargs[] =
} }
}; };
static ProcArg vectors_get_linked_outargs[] = static ProcArg vectors_get_name_outargs[] =
{ {
{ {
GIMP_PDB_INT32, GIMP_PDB_STRING,
"linked", "name",
"TRUE if the path is linked, FALSE otherwise" "The name of the vectors object"
} }
}; };
static ProcRecord vectors_get_linked_proc = static ProcRecord vectors_get_name_proc =
{ {
"gimp-vectors-get-linked", "gimp-vectors-get-name",
"gimp-vectors-get-linked", "gimp-vectors-get-name",
"Gets the linked state of the vectors object.", "Gets the name of the vectors object.",
"Gets the linked state of the vectors object.", "Gets the name of the vectors object.",
"Simon Budig", "Simon Budig",
"Simon Budig", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
1, 1,
vectors_get_linked_inargs, vectors_get_name_inargs,
1, 1,
vectors_get_linked_outargs, vectors_get_name_outargs,
{ { vectors_get_linked_invoker } } { { vectors_get_name_invoker } }
}; };
static Argument * static Argument *
vectors_set_linked_invoker (Gimp *gimp, vectors_set_name_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gboolean linked; gchar *name;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
success = FALSE; success = FALSE;
linked = args[1].value.pdb_int ? TRUE : FALSE; name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success) if (success)
{ {
gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE); success = gimp_item_rename (GIMP_ITEM (vectors), name);
} }
return procedural_db_return_args (&vectors_set_linked_proc, success); return procedural_db_return_args (&vectors_set_name_proc, success);
} }
static ProcArg vectors_set_linked_inargs[] = static ProcArg vectors_set_name_inargs[] =
{ {
{ {
GIMP_PDB_VECTORS, GIMP_PDB_VECTORS,
@ -410,28 +323,28 @@ static ProcArg vectors_set_linked_inargs[] =
"The vectors object" "The vectors object"
}, },
{ {
GIMP_PDB_INT32, GIMP_PDB_STRING,
"linked", "name",
"Whether the path is linked" "the new name of the path"
} }
}; };
static ProcRecord vectors_set_linked_proc = static ProcRecord vectors_set_name_proc =
{ {
"gimp-vectors-set-linked", "gimp-vectors-set-name",
"gimp-vectors-set-linked", "gimp-vectors-set-name",
"Sets the linked state of the vectors object.", "Sets the name of the vectors object.",
"Sets the linked state of the vectors object.", "Sets the name of the vectors object.",
"Simon Budig", "Simon Budig",
"Simon Budig", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
2, 2,
vectors_set_linked_inargs, vectors_set_name_inargs,
0, 0,
NULL, NULL,
{ { vectors_set_linked_invoker } } { { vectors_set_name_invoker } }
}; };
static Argument * static Argument *
@ -555,15 +468,15 @@ static ProcRecord vectors_set_visible_proc =
}; };
static Argument * static Argument *
vectors_get_name_invoker (Gimp *gimp, vectors_get_linked_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
Argument *return_args; Argument *return_args;
GimpVectors *vectors; GimpVectors *vectors;
gchar *name = NULL; gboolean linked = FALSE;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
@ -571,18 +484,18 @@ vectors_get_name_invoker (Gimp *gimp,
if (success) if (success)
{ {
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); linked = gimp_item_get_linked (GIMP_ITEM (vectors));
} }
return_args = procedural_db_return_args (&vectors_get_name_proc, success); return_args = procedural_db_return_args (&vectors_get_linked_proc, success);
if (success) if (success)
return_args[1].value.pdb_pointer = name; return_args[1].value.pdb_int = linked;
return return_args; return return_args;
} }
static ProcArg vectors_get_name_inargs[] = static ProcArg vectors_get_linked_inargs[] =
{ {
{ {
GIMP_PDB_VECTORS, GIMP_PDB_VECTORS,
@ -591,61 +504,58 @@ static ProcArg vectors_get_name_inargs[] =
} }
}; };
static ProcArg vectors_get_name_outargs[] = static ProcArg vectors_get_linked_outargs[] =
{ {
{ {
GIMP_PDB_STRING, GIMP_PDB_INT32,
"name", "linked",
"The name of the vectors object" "TRUE if the path is linked, FALSE otherwise"
} }
}; };
static ProcRecord vectors_get_name_proc = static ProcRecord vectors_get_linked_proc =
{ {
"gimp-vectors-get-name", "gimp-vectors-get-linked",
"gimp-vectors-get-name", "gimp-vectors-get-linked",
"Gets the name of the vectors object.", "Gets the linked state of the vectors object.",
"Gets the name of the vectors object.", "Gets the linked state of the vectors object.",
"Simon Budig", "Simon Budig",
"Simon Budig", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
1, 1,
vectors_get_name_inargs, vectors_get_linked_inargs,
1, 1,
vectors_get_name_outargs, vectors_get_linked_outargs,
{ { vectors_get_name_invoker } } { { vectors_get_linked_invoker } }
}; };
static Argument * static Argument *
vectors_set_name_invoker (Gimp *gimp, vectors_set_linked_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,
GimpProgress *progress, GimpProgress *progress,
Argument *args) Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
GimpVectors *vectors; GimpVectors *vectors;
gchar *name; gboolean linked;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int); vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors)))) if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
success = FALSE; success = FALSE;
name = (gchar *) args[1].value.pdb_pointer; linked = args[1].value.pdb_int ? TRUE : FALSE;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success) if (success)
{ {
if (!gimp_item_rename (GIMP_ITEM (vectors), name)) gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE);
success = FALSE;
} }
return procedural_db_return_args (&vectors_set_name_proc, success); return procedural_db_return_args (&vectors_set_linked_proc, success);
} }
static ProcArg vectors_set_name_inargs[] = static ProcArg vectors_set_linked_inargs[] =
{ {
{ {
GIMP_PDB_VECTORS, GIMP_PDB_VECTORS,
@ -653,28 +563,28 @@ static ProcArg vectors_set_name_inargs[] =
"The vectors object" "The vectors object"
}, },
{ {
GIMP_PDB_STRING, GIMP_PDB_INT32,
"name", "linked",
"the new name of the path" "Whether the path is linked"
} }
}; };
static ProcRecord vectors_set_name_proc = static ProcRecord vectors_set_linked_proc =
{ {
"gimp-vectors-set-name", "gimp-vectors-set-linked",
"gimp-vectors-set-name", "gimp-vectors-set-linked",
"Sets the name of the vectors object.", "Sets the linked state of the vectors object.",
"Sets the name of the vectors object.", "Sets the linked state of the vectors object.",
"Simon Budig", "Simon Budig",
"Simon Budig", "Simon Budig",
"2005", "2005",
NULL, NULL,
GIMP_INTERNAL, GIMP_INTERNAL,
2, 2,
vectors_set_name_inargs, vectors_set_linked_inargs,
0, 0,
NULL, NULL,
{ { vectors_set_name_invoker } } { { vectors_set_linked_invoker } }
}; };
static Argument * static Argument *
@ -797,6 +707,95 @@ static ProcRecord vectors_set_tattoo_proc =
{ { vectors_set_tattoo_invoker } } { { vectors_set_tattoo_invoker } }
}; };
static Argument *
vectors_get_strokes_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpVectors *vectors;
gint32 num_strokes = 0;
gint32 *stroke_ids = NULL;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
success = FALSE;
if (success)
{
num_strokes = gimp_vectors_get_n_strokes (vectors);
if (num_strokes)
{
GimpStroke *cur_stroke;
gint i = 0;
stroke_ids = g_new (gint32, num_strokes);
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL);
cur_stroke;
cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke))
{
stroke_ids[i] = gimp_stroke_get_ID (cur_stroke);
i++;
}
}
}
return_args = procedural_db_return_args (&vectors_get_strokes_proc, success);
if (success)
{
return_args[1].value.pdb_int = num_strokes;
return_args[2].value.pdb_pointer = stroke_ids;
}
return return_args;
}
static ProcArg vectors_get_strokes_inargs[] =
{
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
}
};
static ProcArg vectors_get_strokes_outargs[] =
{
{
GIMP_PDB_INT32,
"num-strokes",
"The number of strokes returned."
},
{
GIMP_PDB_INT32ARRAY,
"stroke-ids",
"List of the strokes belonging to the path."
}
};
static ProcRecord vectors_get_strokes_proc =
{
"gimp-vectors-get-strokes",
"gimp-vectors-get-strokes",
"List the strokes associated with the passed path.",
"Returns an Array with the stroke-IDs associated with the passed path.",
"Simon Budig",
"Simon Budig",
"2005",
NULL,
GIMP_INTERNAL,
1,
vectors_get_strokes_inargs,
2,
vectors_get_strokes_outargs,
{ { vectors_get_strokes_invoker } }
};
static Argument * static Argument *
vectors_stroke_get_length_invoker (Gimp *gimp, vectors_stroke_get_length_invoker (Gimp *gimp,
GimpContext *context, GimpContext *context,

View file

@ -34,7 +34,7 @@
* Delete a drawable. * Delete a drawable.
* *
* This procedure deletes the specified drawable. This must not be done * This procedure deletes the specified drawable. This must not be done
* if the gimage containing this drawable was already deleted or if the * if the image containing this drawable was already deleted or if the
* drawable was already removed from the image. The only case in which * 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 * this procedure is useful is if you want to get rid of a drawable
* which has not yet been added to an image. * which has not yet been added to an image.

View file

@ -891,7 +891,7 @@ gimp_image_pick_correlate_layer (gint32 image_ID,
* *
* Add the specified layer to the image. * Add the specified layer to the image.
* *
* This procedure adds the specified layer to the gimage at the given * This procedure adds the specified layer to the image at the given
* position. If the position is specified as -1, then the layer is * position. If the position is specified as -1, then the layer is
* inserted at the top of the layer stack. If the layer to be added has * inserted at the top of the layer stack. If the layer to be added has
* no alpha channel, it must be added at position 0. The layer type * no alpha channel, it must be added at position 0. The layer type
@ -1241,9 +1241,9 @@ gimp_image_lower_channel (gint32 image_ID,
* *
* Add the specified vectors object to the image. * Add the specified vectors object to the image.
* *
* This procedure adds the specified vectors object to the gimage at * This procedure adds the specified vectors object to the image at the
* the given position. If the position is specified as -1, then the * given position. If the position is specified as -1, then the vectors
* vectors object is inserted at the top of the vectors stack. * object is inserted at the top of the vectors stack.
* *
* Returns: TRUE on success. * Returns: TRUE on success.
*/ */

View file

@ -29,7 +29,7 @@
/** /**
* gimp_path_list: * gimp_path_list:
* @image_ID: The ID of the image to list the paths from. * @image_ID: The image to list the paths from.
* @num_paths: The number of paths returned. * @num_paths: The number of paths returned.
* *
* This procedure is deprecated! Use gimp_image_get_vectors() instead. * This procedure is deprecated! Use gimp_image_get_vectors() instead.
@ -67,7 +67,7 @@ gimp_path_list (gint32 image_ID,
/** /**
* gimp_path_get_current: * gimp_path_get_current:
* @image_ID: The ID of the image to get the current path from. * @image_ID: The image to get the current path from.
* *
* This procedure is deprecated! Use gimp_image_get_active_vectors() * This procedure is deprecated! Use gimp_image_get_active_vectors()
* instead. * instead.
@ -96,7 +96,7 @@ gimp_path_get_current (gint32 image_ID)
/** /**
* gimp_path_set_current: * gimp_path_set_current:
* @image_ID: The ID of the image in which a path will become current. * @image_ID: The image in which a path will become current.
* @name: The name of the path to make current. * @name: The name of the path to make current.
* *
* This procedure is deprecated! Use gimp_image_set_active_vectors() * This procedure is deprecated! Use gimp_image_set_active_vectors()
@ -127,7 +127,7 @@ gimp_path_set_current (gint32 image_ID,
/** /**
* gimp_path_delete: * gimp_path_delete:
* @image_ID: The ID of the image to delete the path from. * @image_ID: The image to delete the path from.
* @name: The name of the path to delete. * @name: The name of the path to delete.
* *
* This procedure is deprecated! Use gimp_image_remove_vectors() * This procedure is deprecated! Use gimp_image_remove_vectors()
@ -158,7 +158,7 @@ gimp_path_delete (gint32 image_ID,
/** /**
* gimp_path_get_points: * gimp_path_get_points:
* @image_ID: The ID of the image to list the paths from. * @image_ID: The image to list the paths from.
* @name: The name of the path whose points should be listed. * @name: The name of the path whose points should be listed.
* @path_closed: Return if the path is closed. (0 = path open, 1 = path closed). * @path_closed: Return if the path is closed. (0 = path open, 1 = path closed).
* @num_path_point_details: The number of points returned. Each point is made up of (x, y, pnt_type) of floats. * @num_path_point_details: The number of points returned. Each point is made up of (x, y, pnt_type) of floats.
@ -206,7 +206,7 @@ gimp_path_get_points (gint32 image_ID,
/** /**
* gimp_path_set_points: * gimp_path_set_points:
* @image_ID: The ID of the image to set the paths in. * @image_ID: The image to set the paths in.
* @name: The name of the path to create. If it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path. * @name: The name of the path to create. If it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path.
* @ptype: The type of the path. Currently only one type (1 = Bezier) is supported. * @ptype: The type of the path. Currently only one type (1 = Bezier) is supported.
* @num_path_points: The number of elements in the array, i.e. the number of points in the path * 3. Each point is made up of (x, y, type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. Note that for BEZIER curves, points must be given in the following order: ACCACCAC... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If (num_path_points/3) % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC. * @num_path_points: The number of elements in the array, i.e. the number of points in the path * 3. Each point is made up of (x, y, type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. Note that for BEZIER curves, points must be given in the following order: ACCACCAC... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If (num_path_points/3) % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC.
@ -247,7 +247,7 @@ gimp_path_set_points (gint32 image_ID,
/** /**
* gimp_path_stroke_current: * gimp_path_stroke_current:
* @image_ID: The ID of the image which contains the path to stroke. * @image_ID: The image which contains the path to stroke.
* *
* Stroke the current path in the passed image. * Stroke the current path in the passed image.
* *
@ -276,7 +276,7 @@ gimp_path_stroke_current (gint32 image_ID)
/** /**
* gimp_path_get_point_at_dist: * gimp_path_get_point_at_dist:
* @image_ID: The ID of the image the paths belongs to. * @image_ID: The image the paths belongs to.
* @distance: The distance along the path. * @distance: The distance along the path.
* @y_point: The y position of the point. * @y_point: The y position of the point.
* @slope: The slope (dy / dx) at the specified point. * @slope: The slope (dy / dx) at the specified point.

View file

@ -63,48 +63,6 @@ gimp_vectors_new (gint32 image_ID,
return vectors_ID; return vectors_ID;
} }
/**
* gimp_vectors_get_strokes:
* @vectors_ID: The vectors object.
* @num_strokes: The number of strokes returned.
*
* List the strokes associated with the passed path.
*
* Returns an Array with the stroke-IDs associated with the passed
* path.
*
* Returns: List of the strokes belonging to the path.
*
* Since: GIMP 2.4
*/
gint *
gimp_vectors_get_strokes (gint32 vectors_ID,
gint *num_strokes)
{
GimpParam *return_vals;
gint nreturn_vals;
gint *stroke_ids = NULL;
return_vals = gimp_run_procedure ("gimp-vectors-get-strokes",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
*num_strokes = 0;
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
{
*num_strokes = return_vals[1].data.d_int32;
stroke_ids = g_new (gint32, *num_strokes);
memcpy (stroke_ids, return_vals[2].data.d_int32array,
*num_strokes * sizeof (gint32));
}
gimp_destroy_params (return_vals, nreturn_vals);
return stroke_ids;
}
/** /**
* gimp_vectors_get_image: * gimp_vectors_get_image:
* @vectors_ID: The vectors object. * @vectors_ID: The vectors object.
@ -138,62 +96,62 @@ gimp_vectors_get_image (gint32 vectors_ID)
} }
/** /**
* gimp_vectors_get_linked: * gimp_vectors_get_name:
* @vectors_ID: The vectors object. * @vectors_ID: The vectors object.
* *
* Gets the linked state of the vectors object. * Gets the name of the vectors object.
* *
* Gets the linked state of the vectors object. * Gets the name of the vectors object.
* *
* Returns: TRUE if the path is linked, FALSE otherwise. * Returns: The name of the vectors object.
* *
* Since: GIMP 2.4 * Since: GIMP 2.4
*/ */
gboolean gchar *
gimp_vectors_get_linked (gint32 vectors_ID) gimp_vectors_get_name (gint32 vectors_ID)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
gboolean linked = FALSE; gchar *name = NULL;
return_vals = gimp_run_procedure ("gimp-vectors-get-linked", return_vals = gimp_run_procedure ("gimp-vectors-get-name",
&nreturn_vals, &nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID, GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END); GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS) if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
linked = return_vals[1].data.d_int32; name = g_strdup (return_vals[1].data.d_string);
gimp_destroy_params (return_vals, nreturn_vals); gimp_destroy_params (return_vals, nreturn_vals);
return linked; return name;
} }
/** /**
* gimp_vectors_set_linked: * gimp_vectors_set_name:
* @vectors_ID: The vectors object. * @vectors_ID: The vectors object.
* @linked: Whether the path is linked. * @name: the new name of the path.
* *
* Sets the linked state of the vectors object. * Sets the name of the vectors object.
* *
* Sets the linked state of the vectors object. * Sets the name of the vectors object.
* *
* Returns: TRUE on success. * Returns: TRUE on success.
* *
* Since: GIMP 2.4 * Since: GIMP 2.4
*/ */
gboolean gboolean
gimp_vectors_set_linked (gint32 vectors_ID, gimp_vectors_set_name (gint32 vectors_ID,
gboolean linked) const gchar *name)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
gboolean success = TRUE; gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-vectors-set-linked", return_vals = gimp_run_procedure ("gimp-vectors-set-name",
&nreturn_vals, &nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID, GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_INT32, linked, GIMP_PDB_STRING, name,
GIMP_PDB_END); GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS; success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
@ -270,62 +228,62 @@ gimp_vectors_set_visible (gint32 vectors_ID,
} }
/** /**
* gimp_vectors_get_name: * gimp_vectors_get_linked:
* @vectors_ID: The vectors object. * @vectors_ID: The vectors object.
* *
* Gets the name of the vectors object. * Gets the linked state of the vectors object.
* *
* Gets the name of the vectors object. * Gets the linked state of the vectors object.
* *
* Returns: The name of the vectors object. * Returns: TRUE if the path is linked, FALSE otherwise.
* *
* Since: GIMP 2.4 * Since: GIMP 2.4
*/ */
gchar * gboolean
gimp_vectors_get_name (gint32 vectors_ID) gimp_vectors_get_linked (gint32 vectors_ID)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
gchar *name = NULL; gboolean linked = FALSE;
return_vals = gimp_run_procedure ("gimp-vectors-get-name", return_vals = gimp_run_procedure ("gimp-vectors-get-linked",
&nreturn_vals, &nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID, GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END); GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS) if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
name = g_strdup (return_vals[1].data.d_string); linked = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals); gimp_destroy_params (return_vals, nreturn_vals);
return name; return linked;
} }
/** /**
* gimp_vectors_set_name: * gimp_vectors_set_linked:
* @vectors_ID: The vectors object. * @vectors_ID: The vectors object.
* @name: the new name of the path. * @linked: Whether the path is linked.
* *
* Sets the name of the vectors object. * Sets the linked state of the vectors object.
* *
* Sets the name of the vectors object. * Sets the linked state of the vectors object.
* *
* Returns: TRUE on success. * Returns: TRUE on success.
* *
* Since: GIMP 2.4 * Since: GIMP 2.4
*/ */
gboolean gboolean
gimp_vectors_set_name (gint32 vectors_ID, gimp_vectors_set_linked (gint32 vectors_ID,
const gchar *name) gboolean linked)
{ {
GimpParam *return_vals; GimpParam *return_vals;
gint nreturn_vals; gint nreturn_vals;
gboolean success = TRUE; gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-vectors-set-name", return_vals = gimp_run_procedure ("gimp-vectors-set-linked",
&nreturn_vals, &nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID, GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_STRING, name, GIMP_PDB_INT32, linked,
GIMP_PDB_END); GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS; success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
@ -401,6 +359,48 @@ gimp_vectors_set_tattoo (gint32 vectors_ID,
return success; return success;
} }
/**
* gimp_vectors_get_strokes:
* @vectors_ID: The vectors object.
* @num_strokes: The number of strokes returned.
*
* List the strokes associated with the passed path.
*
* Returns an Array with the stroke-IDs associated with the passed
* path.
*
* Returns: List of the strokes belonging to the path.
*
* Since: GIMP 2.4
*/
gint *
gimp_vectors_get_strokes (gint32 vectors_ID,
gint *num_strokes)
{
GimpParam *return_vals;
gint nreturn_vals;
gint *stroke_ids = NULL;
return_vals = gimp_run_procedure ("gimp-vectors-get-strokes",
&nreturn_vals,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
*num_strokes = 0;
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
{
*num_strokes = return_vals[1].data.d_int32;
stroke_ids = g_new (gint32, *num_strokes);
memcpy (stroke_ids, return_vals[2].data.d_int32array,
*num_strokes * sizeof (gint32));
}
gimp_destroy_params (return_vals, nreturn_vals);
return stroke_ids;
}
/** /**
* gimp_vectors_stroke_get_length: * gimp_vectors_stroke_get_length:
* @vectors_ID: The vectors object. * @vectors_ID: The vectors object.

View file

@ -31,21 +31,21 @@ G_BEGIN_DECLS
gint32 gimp_vectors_new (gint32 image_ID, gint32 gimp_vectors_new (gint32 image_ID,
const gchar *name); const gchar *name);
gint* gimp_vectors_get_strokes (gint32 vectors_ID,
gint *num_strokes);
gint32 gimp_vectors_get_image (gint32 vectors_ID); gint32 gimp_vectors_get_image (gint32 vectors_ID);
gboolean gimp_vectors_get_linked (gint32 vectors_ID);
gboolean gimp_vectors_set_linked (gint32 vectors_ID,
gboolean linked);
gboolean gimp_vectors_get_visible (gint32 vectors_ID);
gboolean gimp_vectors_set_visible (gint32 vectors_ID,
gboolean visible);
gchar* gimp_vectors_get_name (gint32 vectors_ID); gchar* gimp_vectors_get_name (gint32 vectors_ID);
gboolean gimp_vectors_set_name (gint32 vectors_ID, gboolean gimp_vectors_set_name (gint32 vectors_ID,
const gchar *name); const gchar *name);
gboolean gimp_vectors_get_visible (gint32 vectors_ID);
gboolean gimp_vectors_set_visible (gint32 vectors_ID,
gboolean visible);
gboolean gimp_vectors_get_linked (gint32 vectors_ID);
gboolean gimp_vectors_set_linked (gint32 vectors_ID,
gboolean linked);
gint gimp_vectors_get_tattoo (gint32 vectors_ID); gint gimp_vectors_get_tattoo (gint32 vectors_ID);
gboolean gimp_vectors_set_tattoo (gint32 vectors_ID, gboolean gimp_vectors_set_tattoo (gint32 vectors_ID,
gint tattoo); gint tattoo);
gint* gimp_vectors_get_strokes (gint32 vectors_ID,
gint *num_strokes);
gdouble gimp_vectors_stroke_get_length (gint32 vectors_ID, gdouble gimp_vectors_stroke_get_length (gint32 vectors_ID,
gint stroke_id, gint stroke_id,
gdouble prescision); gdouble prescision);

View file

@ -886,6 +886,7 @@ CODE
brush_set_shape brush_set_radius brush_set_shape brush_set_radius
brush_set_spikes brush_set_hardness brush_set_spikes brush_set_hardness
brush_set_aspect_ratio brush_set_angle); brush_set_aspect_ratio brush_set_angle);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Brush'; $desc = 'Brush';

View file

@ -119,9 +119,11 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "core/gimpdatafactory.h"); @headers = qw("core/gimp.h" "core/gimpdatafactory.h");
@procs = qw(brushes_popup brushes_close_popup brushes_set_popup); @procs = qw(brushes_popup brushes_close_popup brushes_set_popup);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Brush UI'; $desc = 'Brush UI';

View file

@ -208,8 +208,11 @@ CODE
"core/gimp.h" "core/gimplist.h" "core/gimpbrush.h" "core/gimp.h" "core/gimplist.h" "core/gimpbrush.h"
"core/gimpcontext.h" "core/gimpdatafactory.h"); "core/gimpcontext.h" "core/gimpdatafactory.h");
@procs = qw(brushes_refresh brushes_get_list brushes_get_brush @procs = qw(brushes_refresh brushes_get_list
brushes_get_spacing brushes_set_spacing brushes_get_brush_data); brushes_get_brush
brushes_get_spacing brushes_set_spacing
brushes_get_brush_data);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Brushes'; $desc = 'Brushes';

View file

@ -236,6 +236,7 @@ CODE
); );
} }
@headers = qw(<string.h> "core/gimp.h" "core/gimpbuffer.h" @headers = qw(<string.h> "core/gimp.h" "core/gimpbuffer.h"
"core/gimpcontainer.h" "core/gimpcontainer-filter.h" "core/gimpcontainer.h" "core/gimpcontainer-filter.h"
"gimp-intl.h"); "gimp-intl.h");
@ -244,6 +245,7 @@ CODE
buffer_rename buffer_delete buffer_rename buffer_delete
buffer_get_width buffer_get_height buffer_get_width buffer_get_height
buffer_get_bytes buffer_get_image_type); buffer_get_bytes buffer_get_image_type);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Buffer procedures'; $desc = 'Buffer procedures';

View file

@ -32,7 +32,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image to which to add the channel' },
{ name => 'width', type => '0 < int32', { name => 'width', type => '0 < int32',
desc => 'The channel width: (%%desc%%)' }, desc => 'The channel width: (%%desc%%)' },
{ name => 'height', type => '0 < int32', { name => 'height', type => '0 < int32',
@ -45,7 +46,6 @@ HELP
desc => 'The channel compositing color' desc => 'The channel compositing color'
} }
); );
$inargs[0]->{desc} .= ' to which to add the channel';
@outargs = ( @outargs = (
{ name => 'channel', type => 'channel', wrap => 1, { name => 'channel', type => 'channel', wrap => 1,
@ -58,8 +58,10 @@ HELP
GimpRGB rgb_color = color; GimpRGB rgb_color = color;
rgb_color.a = opacity / 100.0; rgb_color.a = opacity / 100.0;
channel = gimp_channel_new (gimage, width, height, name, &rgb_color); channel = gimp_channel_new (image, width, height, name, &rgb_color);
success = channel != NULL;
if (! channel)
success = FALSE;
} }
CODE CODE
); );
@ -142,13 +144,13 @@ HELP
&shlomi_pdb_misc('2005', '2.4'); &shlomi_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image to which to add the channel' },
{ name => 'component', type => 'enum GimpChannelType', { name => 'component', type => 'enum GimpChannelType',
desc => 'The image component: { %%desc%% }' }, desc => 'The image component: { %%desc%% }' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The channel name' }, desc => 'The channel name' },
); );
$inargs[0]->{desc} .= ' to which to add the channel';
@outargs = ( @outargs = (
{ name => 'channel', type => 'channel', { name => 'channel', type => 'channel',
@ -158,8 +160,8 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
if (gimp_image_get_component_index (gimage, component) != -1) if (gimp_image_get_component_index (image, component) != -1)
channel = gimp_channel_new_from_component (gimage, channel = gimp_channel_new_from_component (image,
component, name, NULL); component, name, NULL);
if (channel) if (channel)
@ -337,11 +339,13 @@ CODE
); );
} }
@procs = qw(channel_new channel_new_from_component channel_copy @procs = qw(channel_new channel_new_from_component channel_copy
channel_combine_masks channel_combine_masks
channel_get_show_masked channel_set_show_masked channel_get_show_masked channel_set_show_masked
channel_get_opacity channel_set_opacity channel_get_opacity channel_set_opacity
channel_get_color channel_set_color); channel_get_color channel_set_color);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Channel'; $desc = 'Channel';

View file

@ -934,6 +934,7 @@ CODE
); );
} }
@headers = qw("base/gimphistogram.h" @headers = qw("base/gimphistogram.h"
"base/gimplut.h" "base/lut-funcs.h" "base/gimplut.h" "base/lut-funcs.h"
"base/pixel-region.h" "base/pixel-processor.h" "base/pixel-region.h" "base/pixel-processor.h"
@ -944,6 +945,7 @@ CODE
desaturate desaturate_full equalize invert curves_spline desaturate desaturate_full equalize invert curves_spline
curves_explicit color_balance colorize histogram hue_saturation curves_explicit color_balance colorize histogram hue_saturation
threshold); threshold);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Color'; $desc = 'Color';

View file

@ -679,6 +679,7 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "core/gimpcontainer.h" "core/gimpcontext.h" @headers = qw("core/gimp.h" "core/gimpcontainer.h" "core/gimpcontext.h"
"core/gimpdatafactory.h" "core/gimpdatafactory.h"
"plug-in/plug-in.h" "plug-in/plug-in-context.h"); "plug-in/plug-in.h" "plug-in/plug-in-context.h");
@ -695,6 +696,7 @@ CODE
context_get_gradient context_set_gradient context_get_gradient context_set_gradient
context_get_palette context_set_palette context_get_palette context_set_palette
context_get_font context_set_font); context_get_font context_set_font);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Context'; $desc = 'Context';

View file

@ -29,14 +29,15 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
if (gimp_image_base_type (gimage) != GIMP_RGB) if (gimp_image_base_type (image) != GIMP_RGB)
gimp_image_convert (gimage, GIMP_RGB, 0, 0, FALSE, FALSE, 0, NULL, NULL); gimp_image_convert (image, GIMP_RGB, 0, 0, FALSE, FALSE, 0, NULL, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -56,14 +57,15 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
if (gimp_image_base_type (gimage) != GIMP_GRAY) if (gimp_image_base_type (image) != GIMP_GRAY)
gimp_image_convert (gimage, GIMP_GRAY, 0, 0, FALSE, FALSE, 0, NULL, NULL); gimp_image_convert (image, GIMP_GRAY, 0, 0, FALSE, FALSE, 0, NULL, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -93,7 +95,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'dither_type', type => 'enum GimpConvertDitherType', { name => 'dither_type', type => 'enum GimpConvertDitherType',
desc => 'The dither type to use: { %%desc%% }' }, desc => 'The dither type to use: { %%desc%% }' },
{ name => 'palette_type', type => 'enum GimpConvertPaletteType', { name => 'palette_type', type => 'enum GimpConvertPaletteType',
@ -116,7 +119,7 @@ HELP
{ {
GimpPalette *pal = NULL; GimpPalette *pal = NULL;
if (gimp_image_base_type (gimage) != GIMP_INDEXED) if (gimp_image_base_type (image) != GIMP_INDEXED)
{ {
switch (palette_type) switch (palette_type)
{ {
@ -141,7 +144,7 @@ HELP
success = FALSE; success = FALSE;
if (success) if (success)
gimp_image_convert (gimage, GIMP_INDEXED, num_cols, dither_type, gimp_image_convert (image, GIMP_INDEXED, num_cols, dither_type,
alpha_dither, remove_unused, palette_type, pal, alpha_dither, remove_unused, palette_type, pal,
NULL); NULL);
} }
@ -149,11 +152,15 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "core/gimpcontainer.h" "core/gimpdatafactory.h" @headers = qw("core/gimp.h" "core/gimpcontainer.h" "core/gimpdatafactory.h"
"core/gimpimage.h" "core/gimpimage-convert.h" "core/gimpimage.h" "core/gimpimage-convert.h"
"core/gimppalette.h"); "core/gimppalette.h");
@procs = qw(image_convert_rgb image_convert_grayscale image_convert_indexed); @procs = qw(image_convert_rgb
image_convert_grayscale
image_convert_indexed);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Convert'; $desc = 'Convert';

View file

@ -31,7 +31,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
@outargs = ( @outargs = (
@ -42,13 +43,13 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
display = gimp_create_display (gimp, gimage, GIMP_UNIT_PIXEL, 1.0); display = gimp_create_display (gimp, image, GIMP_UNIT_PIXEL, 1.0);
if (display) if (display)
{ {
/* the first display takes ownership of the image */ /* the first display takes ownership of the image */
if (gimage->disp_count == 1) if (image->disp_count == 1)
g_object_unref (gimage); g_object_unref (image);
} }
else else
success = FALSE; success = FALSE;
@ -170,10 +171,12 @@ CODE
); );
} }
@headers = qw("core/gimp.h"); @headers = qw("core/gimp.h");
@procs = qw(display_new display_delete display_get_window_handle @procs = qw(display_new display_delete display_get_window_handle
displays_flush displays_reconnect); displays_flush displays_reconnect);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Display procedures'; $desc = 'Display procedures';

View file

@ -22,9 +22,10 @@ sub drawable_merge_shadow {
$help = <<'HELP'; $help = <<'HELP';
This procedure combines the contents of the image's shadow buffer (for This procedure combines the contents of the image's shadow buffer (for
temporary processing) with the specified drawable. The "undo" parameter temporary processing) with the specified drawable. The "undo"
specifies whether to add an undo step for the operation. Requesting no undo is parameter specifies whether to add an undo step for the
useful for such applications as 'auto-apply'. operation. Requesting no undo is useful for such applications as
'auto-apply'.
HELP HELP
&std_pdb_misc; &std_pdb_misc;
@ -233,14 +234,14 @@ sub drawable_get_image {
); );
@outargs = ( @outargs = (
&std_image_arg { name => 'image', type => 'image',
desc => "The drawable's image" }
); );
$outargs[0]->{desc} = "The drawable's image";
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimage = gimp_item_get_image (GIMP_ITEM (drawable)); image = gimp_item_get_image (GIMP_ITEM (drawable));
} }
CODE CODE
); );
@ -948,13 +949,14 @@ sub drawable_set_image {
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The drawable' }, desc => 'The drawable' },
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
%invoke = ( %invoke = (
code =><<'CODE' code =><<'CODE'
{ {
if (gimage != gimp_item_get_image (GIMP_ITEM (drawable))) if (image != gimp_item_get_image (GIMP_ITEM (drawable)))
success = FALSE; success = FALSE;
} }
CODE CODE
@ -998,7 +1000,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
TempBuf *buf; TempBuf *buf;
gint dwidth, dheight; gint dwidth, dheight;
@ -1011,7 +1013,7 @@ HELP
else else
width = MAX (1, (height * dwidth) / dheight); width = MAX (1, (height * dwidth) / dheight);
if (gimage->gimp->config->layer_previews) if (image->gimp->config->layer_previews)
buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (drawable), buf = gimp_viewable_get_new_preview (GIMP_VIEWABLE (drawable),
width, height); width, height);
else else
@ -1089,10 +1091,10 @@ HELP
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
TempBuf *buf; TempBuf *buf;
if (gimage->gimp->config->layer_previews) if (image->gimp->config->layer_previews)
buf = gimp_drawable_get_sub_preview (drawable, buf = gimp_drawable_get_sub_preview (drawable,
src_x, src_y, src_x, src_y,
src_width, src_height, src_width, src_height,
@ -1172,7 +1174,7 @@ sub drawable_delete {
$help = <<'HELP'; $help = <<'HELP';
This procedure deletes the specified drawable. This must not be done if the This procedure deletes the specified drawable. This must not be done if the
gimage containing this drawable was already deleted or if the drawable was 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 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 useful is if you want to get rid of a drawable which has not yet been
added to an image. added to an image.
@ -1253,6 +1255,7 @@ CODE
drawable_fill drawable_offset drawable_fill drawable_offset
drawable_thumbnail drawable_sub_thumbnail drawable_thumbnail drawable_sub_thumbnail
drawable_foreground_extract); drawable_foreground_extract);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Drawable procedures'; $desc = 'Drawable procedures';

View file

@ -23,26 +23,6 @@
# shortcuts # shortcuts
sub transform_options_args () {
{ name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' },
{ name => 'interpolation', type => 'enum GimpInterpolationType',
desc => 'Type of interpolation: { %%desc%% }' },
{ name => 'supersample', type => 'boolean',
desc => 'Whether to perform supersample' },
{ name => 'recursion_level', type => '0 < int32',
desc => 'Level of recursion (3 is a nice default)' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
}
sub transform_options_default_args () {
{ name => 'interpolate', type => 'boolean',
desc => 'Whether to use interpolation and supersampling' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
}
sub transform_invoke { sub transform_invoke {
my ($progress_text, $assemble_matrix, $check) = @_; my ($progress_text, $assemble_matrix, $check) = @_;
my $success_check = 'gimp_item_is_attached (GIMP_ITEM (drawable));'; my $success_check = 'gimp_item_is_attached (GIMP_ITEM (drawable));';
@ -155,7 +135,8 @@ HELP
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' }, desc => 'The affected drawable' },
{ name => 'flip_type', type => &std_orientation_enum, { name => 'flip_type',
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
desc => 'Type of flip: %%desc%%' }, desc => 'Type of flip: %%desc%%' },
{ name => 'auto_center', type => 'boolean', { name => 'auto_center', type => 'boolean',
desc => 'Whether to automatically position the axis in the selection center' }, desc => 'Whether to automatically position the axis in the selection center' },
@ -222,7 +203,16 @@ HELP
desc => 'horz. coord. of other end of axis' }, desc => 'horz. coord. of other end of axis' },
{ name => 'y1', type => 'float', { name => 'y1', type => 'float',
desc => 'vert. coord. of other end of axis' }, desc => 'vert. coord. of other end of axis' },
&transform_options_args { name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' },
{ name => 'interpolation', type => 'enum GimpInterpolationType',
desc => 'Type of interpolation: { %%desc%% }' },
{ name => 'supersample', type => 'boolean',
desc => 'Whether to perform supersample' },
{ name => 'recursion_level', type => '0 < int32',
desc => 'Level of recursion (3 is a nice default)' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -262,7 +252,10 @@ HELP
desc => 'horz. coord. of other end of axis' }, desc => 'horz. coord. of other end of axis' },
{ name => 'y1', type => 'float', { name => 'y1', type => 'float',
desc => 'vert. coord. of other end of axis' }, desc => 'vert. coord. of other end of axis' },
&transform_options_default_args { name => 'interpolate', type => 'boolean',
desc => 'Whether to use interpolation and supersampling' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -330,7 +323,16 @@ HELP
{ name => 'y3', type => 'float', { name => 'y3', type => 'float',
desc => 'The new y coordinate of lower-right corner of original desc => 'The new y coordinate of lower-right corner of original
bounding box' }, bounding box' },
&transform_options_args { name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' },
{ name => 'interpolation', type => 'enum GimpInterpolationType',
desc => 'Type of interpolation: { %%desc%% }' },
{ name => 'supersample', type => 'boolean',
desc => 'Whether to perform supersample' },
{ name => 'recursion_level', type => '0 < int32',
desc => 'Level of recursion (3 is a nice default)' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -390,7 +392,10 @@ HELP
{ name => 'y3', type => 'float', { name => 'y3', type => 'float',
desc => 'The new y coordinate of lower-right corner of original desc => 'The new y coordinate of lower-right corner of original
bounding box' }, bounding box' },
&transform_options_default_args { name => 'interpolate', type => 'boolean',
desc => 'Whether to use interpolation and supersampling' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -495,7 +500,16 @@ HELP
desc => 'The hor. coordinate of the center of rotation' }, desc => 'The hor. coordinate of the center of rotation' },
{ name => 'center_y', type => 'int32', { name => 'center_y', type => 'int32',
desc => 'The vert. coordinate of the center of rotation' }, desc => 'The vert. coordinate of the center of rotation' },
&transform_options_args { name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' },
{ name => 'interpolation', type => 'enum GimpInterpolationType',
desc => 'Type of interpolation: { %%desc%% }' },
{ name => 'supersample', type => 'boolean',
desc => 'Whether to perform supersample' },
{ name => 'recursion_level', type => '0 < int32',
desc => 'Level of recursion (3 is a nice default)' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -538,7 +552,10 @@ HELP
desc => 'The hor. coordinate of the center of rotation' }, desc => 'The hor. coordinate of the center of rotation' },
{ name => 'center_y', type => 'int32', { name => 'center_y', type => 'int32',
desc => 'The vert. coordinate of the center of rotation' }, desc => 'The vert. coordinate of the center of rotation' },
&transform_options_default_args { name => 'interpolate', type => 'boolean',
desc => 'Whether to use interpolation and supersampling' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -587,7 +604,16 @@ HELP
{ name => 'y1', type => 'float', { name => 'y1', type => 'float',
desc => 'The new y coordinate of the lower-right corner of the desc => 'The new y coordinate of the lower-right corner of the
scaled region' }, scaled region' },
&transform_options_args { name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' },
{ name => 'interpolation', type => 'enum GimpInterpolationType',
desc => 'Type of interpolation: { %%desc%% }' },
{ name => 'supersample', type => 'boolean',
desc => 'Whether to perform supersample' },
{ name => 'recursion_level', type => '0 < int32',
desc => 'Level of recursion (3 is a nice default)' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -632,8 +658,11 @@ HELP
{ name => 'y1', type => 'float', { name => 'y1', type => 'float',
desc => 'The new y coordinate of the lower-right corner of the desc => 'The new y coordinate of the lower-right corner of the
scaled region' }, scaled region' },
&transform_options_default_args { name => 'interpolate', type => 'boolean',
); desc => 'Whether to use interpolation and supersampling' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
);
@outargs = ( @outargs = (
{ name => 'drawable', type => 'drawable', no_declare => 1, { name => 'drawable', type => 'drawable', no_declare => 1,
@ -674,11 +703,21 @@ HELP
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' }, desc => 'The affected drawable' },
{ name => 'shear_type', type => &std_orientation_enum, { name => 'shear_type',
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
desc => 'Type of shear: %%desc%%' }, desc => 'Type of shear: %%desc%%' },
{ name => 'magnitude', type => 'float', { name => 'magnitude', type => 'float',
desc => 'The magnitude of the shear' }, desc => 'The magnitude of the shear' },
&transform_options_args { name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' },
{ name => 'interpolation', type => 'enum GimpInterpolationType',
desc => 'Type of interpolation: { %%desc%% }' },
{ name => 'supersample', type => 'boolean',
desc => 'Whether to perform supersample' },
{ name => 'recursion_level', type => '0 < int32',
desc => 'Level of recursion (3 is a nice default)' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -711,11 +750,15 @@ HELP
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' }, desc => 'The affected drawable' },
{ name => 'shear_type', type => &std_orientation_enum, { name => 'shear_type',
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
desc => 'Type of shear: %%desc%%' }, desc => 'Type of shear: %%desc%%' },
{ name => 'magnitude', type => 'float', { name => 'magnitude', type => 'float',
desc => 'The magnitude of the shear' }, desc => 'The magnitude of the shear' },
&transform_options_default_args { name => 'interpolate', type => 'boolean',
desc => 'Whether to use interpolation and supersampling' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -770,7 +813,16 @@ HELP
desc => 'X coordinate of where the center goes' }, desc => 'X coordinate of where the center goes' },
{ name => 'dest_y', type => 'float', { name => 'dest_y', type => 'float',
desc => 'Y coordinate of where the center goes' }, desc => 'Y coordinate of where the center goes' },
&transform_options_args { name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' },
{ name => 'interpolation', type => 'enum GimpInterpolationType',
desc => 'Type of interpolation: { %%desc%% }' },
{ name => 'supersample', type => 'boolean',
desc => 'Whether to perform supersample' },
{ name => 'recursion_level', type => '0 < int32',
desc => 'Level of recursion (3 is a nice default)' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -818,7 +870,10 @@ HELP
desc => 'X coordinate of where the center goes' }, desc => 'X coordinate of where the center goes' },
{ name => 'dest_y', type => 'float', { name => 'dest_y', type => 'float',
desc => 'Y coordinate of where the center goes' }, desc => 'Y coordinate of where the center goes' },
&transform_options_default_args { name => 'interpolate', type => 'boolean',
desc => 'Whether to use interpolation and supersampling' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -875,7 +930,16 @@ HELP
desc => 'coefficient (2,1) of the transformation matrix' }, desc => 'coefficient (2,1) of the transformation matrix' },
{ name => 'coeff_2_2', type => 'float', { name => 'coeff_2_2', type => 'float',
desc => 'coefficient (2,2) of the transformation matrix' }, desc => 'coefficient (2,2) of the transformation matrix' },
&transform_options_args { name => 'transform_direction', type => 'enum GimpTransformDirection',
desc => 'Direction of Transformation: { %%desc%% }' },
{ name => 'interpolation', type => 'enum GimpInterpolationType',
desc => 'Type of interpolation: { %%desc%% }' },
{ name => 'supersample', type => 'boolean',
desc => 'Whether to perform supersample' },
{ name => 'recursion_level', type => '0 < int32',
desc => 'Level of recursion (3 is a nice default)' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (
@ -931,7 +995,10 @@ HELP
desc => 'coefficient (2,1) of the transformation matrix' }, desc => 'coefficient (2,1) of the transformation matrix' },
{ name => 'coeff_2_2', type => 'float', { name => 'coeff_2_2', type => 'float',
desc => 'coefficient (2,2) of the transformation matrix' }, desc => 'coefficient (2,2) of the transformation matrix' },
&transform_options_default_args { name => 'interpolate', type => 'boolean',
desc => 'Whether to use interpolation and supersampling' },
{ name => 'clip_result', type => 'boolean',
desc => 'Whether to clip results' }
); );
@outargs = ( @outargs = (

View file

@ -730,7 +730,8 @@ CODE
edit_paste edit_paste_as_new edit_paste edit_paste_as_new
edit_named_cut edit_named_copy edit_named_copy_visible edit_named_cut edit_named_copy edit_named_copy_visible
edit_named_paste edit_named_paste_as_new edit_named_paste edit_named_paste_as_new
edit_clear edit_fill edit_bucket_fill edit_blend edit_stroke ); edit_clear edit_fill edit_bucket_fill edit_blend edit_stroke);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Edit procedures'; $desc = 'Edit procedures';

View file

@ -43,9 +43,9 @@ HELP
); );
@outargs = ( @outargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The output image' }
); );
$outargs[0]->{desc} = 'The output image';
%invoke = ( %invoke = (
proc => [ 'proc->name', 'new_args' ], proc => [ 'proc->name', 'new_args' ],
@ -313,7 +313,8 @@ HELP
&josh_pdb_misc('1997'); &josh_pdb_misc('1997');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'filename', type => 'string', no_validate => 1, { name => 'filename', type => 'string', no_validate => 1,
desc => 'The name of the file the thumbnail belongs to' }, desc => 'The name of the file the thumbnail belongs to' },
); );
@ -321,7 +322,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
const gchar *image_uri = gimp_object_get_name (GIMP_OBJECT (gimage)); const gchar *image_uri = gimp_object_get_name (GIMP_OBJECT (image));
if (! image_uri) if (! image_uri)
success = FALSE; success = FALSE;
@ -343,7 +344,7 @@ HELP
GimpImagefile *imagefile; GimpImagefile *imagefile;
imagefile = gimp_imagefile_new (gimp, uri); imagefile = gimp_imagefile_new (gimp, uri);
success = gimp_imagefile_save_thumbnail (imagefile, NULL, gimage); success = gimp_imagefile_save_thumbnail (imagefile, NULL, image);
g_object_unref (imagefile); g_object_unref (imagefile);
} }
@ -672,6 +673,7 @@ CODE
temp_name register_magic_load_handler register_load_handler temp_name register_magic_load_handler register_load_handler
register_save_handler register_file_handler_mime register_save_handler register_file_handler_mime
register_thumbnail_loader); register_thumbnail_loader);
%exports = (app => [@procs], lib => [@procs[0,1,3,5..10]]); %exports = (app => [@procs], lib => [@procs[0,1,3,5..10]]);
$desc = 'File Operations'; $desc = 'File Operations';

View file

@ -188,10 +188,12 @@ CODE
); );
} }
@headers = qw("core/gimplayer-floating-sel.h"); @headers = qw("core/gimplayer-floating-sel.h");
@procs = qw(floating_sel_remove floating_sel_anchor floating_sel_to_layer @procs = qw(floating_sel_remove floating_sel_anchor floating_sel_to_layer
floating_sel_attach floating_sel_rigor floating_sel_relax); floating_sel_attach floating_sel_rigor floating_sel_relax);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Floating selections'; $desc = 'Floating selections';

View file

@ -95,9 +95,11 @@ CODE
); );
} }
@headers = qw("core/gimp.h"); @headers = qw("core/gimp.h");
@procs = qw(fonts_popup fonts_close_popup fonts_set_popup); @procs = qw(fonts_popup fonts_close_popup fonts_set_popup);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Font UI'; $desc = 'Font UI';

View file

@ -68,9 +68,11 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "core/gimpcontainer.h" "text/gimp-fonts.h"); @headers = qw("core/gimp.h" "core/gimpcontainer.h" "text/gimp-fonts.h");
@procs = qw(fonts_refresh fonts_get_list); @procs = qw(fonts_refresh fonts_get_list);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Fonts'; $desc = 'Fonts';

View file

@ -211,11 +211,13 @@ CODE
); );
} }
@headers = qw(<string.h> "core/gimp.h" "config/gimprc.h"); @headers = qw(<string.h> "core/gimp.h" "config/gimprc.h");
@procs = qw(gimprc_query gimprc_set @procs = qw(gimprc_query gimprc_set
get_default_comment get_monitor_resolution get_theme_dir get_default_comment get_monitor_resolution get_theme_dir
get_color_configuration get_module_load_inhibit); get_color_configuration get_module_load_inhibit);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Gimprc procedures'; $desc = 'Gimprc procedures';

View file

@ -1392,6 +1392,7 @@ gradient_get_range (Gimp *gimp,
} }
CODE CODE
@headers = qw(<string.h> "core/gimp.h" "core/gimpcontext.h" @headers = qw(<string.h> "core/gimp.h" "core/gimpcontext.h"
"core/gimpgradient.h" "core/gimpcontainer.h" "core/gimpgradient.h" "core/gimpcontainer.h"
"core/gimpdatafactory.h" "core/gimplist.h"); "core/gimpdatafactory.h" "core/gimplist.h");
@ -1417,6 +1418,7 @@ CODE
gradient_segment_range_blend_colors gradient_segment_range_blend_colors
gradient_segment_range_blend_opacity gradient_segment_range_blend_opacity
gradient_segment_range_move); gradient_segment_range_move);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Gradient'; $desc = 'Gradient';

View file

@ -107,9 +107,11 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "core/gimpdatafactory.h" "core/gimpgradient.h"); @headers = qw("core/gimp.h" "core/gimpdatafactory.h" "core/gimpgradient.h");
@procs = qw(gradients_popup gradients_close_popup gradients_set_popup); @procs = qw(gradients_popup gradients_close_popup gradients_set_popup);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Gradient UI'; $desc = 'Gradient UI';

View file

@ -258,6 +258,7 @@ CODE
@procs = qw(gradients_refresh gradients_get_list @procs = qw(gradients_refresh gradients_get_list
gradients_sample_uniform gradients_sample_custom gradients_sample_uniform gradients_sample_custom
gradients_get_gradient_data); gradients_get_gradient_data);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Gradients'; $desc = 'Gradients';

View file

@ -15,90 +15,37 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sub pdb_misc { sub image_grid_get_spacing {
$author = $copyright = 'Sylvain Foret'; $blurb = "Gets the spacing of an image's grid.";
$date = '2005';
$since = '2.4';
}
sub image_grid_get_dimensions {
my ($type) = @_;
$blurb = "Gets the ${type} of an image's grid.";
$help = <<HELP; $help = <<HELP;
This procedure retrieves the horizontal and vertical ${type} of an image's grid. This procedure retrieves the horizontal and vertical spacing of an image's grid.
It takes the image as parameter. It takes the image as parameter.
HELP HELP
&pdb_misc; &sylvain_pdb_misc('2005', '2.4');
my $bounded_type = 'float';
#my $bounded_type = ($type eq 'spacing') ? 1 : '-GIMP_MAX_IMAGE_SIZE';
#$bounded_type .= " <= float <= GIMP_MAX_IMAGE_SIZE";
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
@outargs = ( @outargs = (
{ name => "x$type", type => $bounded_type, void_ret => 1, { name => 'xspacing', type => 'float', void_ret => 1,
desc => "The image's grid horizontal $type" }, desc => "The image's grid horizontal spacing" },
{ name => "y$type", type => $bounded_type, void_ret => 1, { name => 'yspacing', type => 'float', void_ret => 1,
desc => "The image's grid vertical $type" } desc => "The image's grid vertical spacing" }
); );
%invoke = ( %invoke = (
code => <<CODE code => <<'CODE'
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
{ g_object_get (grid,
x$type = grid->x$type; "xspacing", &xspacing,
y$type = grid->y$type; "yspacing", &yspacing,
}
else
success = FALSE;
}
CODE
);
}
sub image_grid_set_dimensions {
my ($type) = @_;
$blurb = "Sets the ${type} of an image's grid.";
$help = <<HELP;
This procedure sets the horizontal and vertical ${type} of an image's grid.
HELP
&pdb_misc;
my $bounded_type = 'float';
#my $bounded_type = ($type eq 'spacing') ? 1 : '-GIMP_MAX_IMAGE_SIZE';
#$bounded_type .= " <= float <= GIMP_MAX_IMAGE_SIZE";
@inargs = (
&std_image_arg,
{ name => "x$type",
type => $bounded_type,
desc => "The image's grid horizontal $type" },
{ name => "y$type",
type => $bounded_type,
desc => "The image's grid vertical $type" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
g_object_set (grid,
"x$type", x$type,
"y$type", y$type,
NULL); NULL);
else else
success = FALSE; success = FALSE;
@ -107,109 +54,239 @@ CODE
); );
} }
sub image_grid_get_color {
my ($desc, $type) = @_;
my $arg = "${type}color";
$blurb = "Sets the $desc color of an image's grid.";
$help = <<HELP;
This procedure gets the $desc color of an image's grid.
HELP
&pdb_misc;
@inargs = (
&std_image_arg,
);
@outargs = (
{ name => "$arg",
type => 'color',
void_ret => 1,
desc => "The image's grid $desc color" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
$arg = grid->$arg;
else
success = FALSE;
}
CODE
);
}
sub image_grid_set_color {
my ($desc, $type) = @_;
my $arg = "${type}color";
$blurb = "Gets the $desc color of an image's grid.";
$help = <<HELP;
This procedure sets the $desc color of an image's grid.
HELP
&pdb_misc;
@inargs = (
&std_image_arg,
{ name => "$arg",
type => 'color',
desc => "The new $desc color" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
g_object_set (grid,
"$arg", &$arg,
NULL);
else
success = FALSE;
}
CODE
);
}
# The defs
sub image_grid_get_spacing {
&image_grid_get_dimensions ('spacing');
}
sub image_grid_set_spacing { sub image_grid_set_spacing {
&image_grid_set_dimensions ('spacing'); $blurb = "Sets the spacing of an image's grid.";
$help = <<HELP;
This procedure sets the horizontal and vertical spacing of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'xspacing', type => 'float',
desc => "The image's grid horizontal spacing" },
{ name => 'yspacing', type => 'float',
desc => "The image's grid vertical spacing" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid,
"xspacing", xspacing,
"yspacing", yspacing,
NULL);
else
success = FALSE;
}
CODE
);
} }
sub image_grid_get_offset { sub image_grid_get_offset {
&image_grid_get_dimensions ('offset'); $blurb = "Gets the offset of an image's grid.";
$help = <<HELP;
This procedure retrieves the horizontal and vertical offset of an image's grid.
It takes the image as parameter.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'xoffset', type => 'float', void_ret => 1,
desc => "The image's grid horizontal offset" },
{ name => 'yoffset', type => 'float', void_ret => 1,
desc => "The image's grid vertical offset" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_get (grid,
"xoffset", &xoffset,
"yoffset", &yoffset,
NULL);
else
success = FALSE;
}
CODE
);
} }
sub image_grid_set_offset { sub image_grid_set_offset {
&image_grid_set_dimensions ('offset'); $blurb = "Sets the offset of an image's grid.";
$help = <<HELP;
This procedure sets the horizontal and vertical offset of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'xoffset', type => 'float',
desc => "The image's grid horizontal offset" },
{ name => 'yoffset', type => 'float',
desc => "The image's grid vertical offset" }
);
%invoke = (
code => <<CODE
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid,
"xoffset", xoffset,
"yoffset", yoffset,
NULL);
else
success = FALSE;
}
CODE
);
} }
sub image_grid_get_foreground_color { sub image_grid_get_foreground_color {
&image_grid_get_color ('foreground', 'fg'); $blurb = "Sets the foreground color of an image's grid.";
$help = <<HELP;
This procedure gets the foreground color of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'fgcolor', type => 'color', void_ret => 1,
desc => "The image's grid foreground color" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
fgcolor = grid->fgcolor;
else
success = FALSE;
}
CODE
);
} }
sub image_grid_set_foreground_color { sub image_grid_set_foreground_color {
&image_grid_set_color ('foreground', 'fg'); $blurb = "Gets the foreground color of an image's grid.";
$help = <<HELP;
This procedure sets the foreground color of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'fgcolor', type => 'color',
desc => "The new foreground color" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid, "fgcolor", &fgcolor, NULL);
else
success = FALSE;
}
CODE
);
} }
sub image_grid_get_background_color { sub image_grid_get_background_color {
&image_grid_get_color ('background', 'bg'); $blurb = "Sets the background color of an image's grid.";
$help = <<HELP;
This procedure gets the background color of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'bgcolor', type => 'color', void_ret => 1,
desc => "The image's grid background color" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
bgcolor = grid->bgcolor;
else
success = FALSE;
}
CODE
);
} }
sub image_grid_set_background_color { sub image_grid_set_background_color {
&image_grid_set_color ('background', 'bg'); $blurb = "Gets the background color of an image's grid.";
$help = <<HELP;
This procedure sets the background color of an image's grid.
HELP
&sylvain_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'bgcolor', type => 'color',
desc => "The new background color" }
);
%invoke = (
code => <<'CODE'
{
GimpGrid *grid = gimp_image_get_grid (image);
if (grid)
g_object_set (grid, "bgcolor", &bgcolor, NULL);
else
success = FALSE;
}
CODE
);
} }
sub image_grid_get_style { sub image_grid_get_style {
@ -219,10 +296,11 @@ sub image_grid_get_style {
This procedure retrieves the style of an image's grid. This procedure retrieves the style of an image's grid.
HELP HELP
&pdb_misc; &sylvain_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
@outargs = ( @outargs = (
@ -233,10 +311,10 @@ HELP
%invoke = ( %invoke = (
code => <<CODE code => <<CODE
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
style = grid->style; g_object_get (grid, "style", &style, NULL);
else else
success = FALSE; success = FALSE;
} }
@ -252,10 +330,11 @@ This procedure sets the style of an image's grid.
It takes the image and the new style as parameters. It takes the image and the new style as parameters.
HELP HELP
&pdb_misc; &sylvain_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'style', type => 'enum GimpGridStyle', { name => 'style', type => 'enum GimpGridStyle',
desc => "The image's grid style" } desc => "The image's grid style" }
); );
@ -263,12 +342,10 @@ HELP
%invoke = ( %invoke = (
code => <<CODE code => <<CODE
{ {
GimpGrid *grid = gimp_image_get_grid (gimage); GimpGrid *grid = gimp_image_get_grid (image);
if (grid) if (grid)
g_object_set (grid, g_object_set (grid, "style", style, NULL);
"style", style,
NULL);
else else
success = FALSE; success = FALSE;
} }
@ -276,13 +353,10 @@ CODE
); );
} }
# Required headers
@headers = qw("core/gimpimage-grid.h" "core/gimpgrid.h" @headers = qw("core/gimpimage-grid.h" "core/gimpgrid.h"
"libgimpbase/gimpbaseenums.h"); "libgimpbase/gimpbaseenums.h");
# Exported procedures
@procs = qw(image_grid_get_spacing image_grid_set_spacing @procs = qw(image_grid_get_spacing image_grid_set_spacing
image_grid_get_offset image_grid_set_offset image_grid_get_offset image_grid_set_offset
image_grid_get_foreground_color image_grid_set_foreground_color image_grid_get_foreground_color image_grid_set_foreground_color

View file

@ -17,24 +17,22 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org> # "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub image_add_hguide {
sub image_add_guide { $blurb = 'Add a horizontal guide to an image.';
my ($desc, $type, $max, $pos) = @_;
$blurb = "Add a $desc guide to an image.";
$help = <<HELP; $help = <<HELP;
This procedure adds a $desc guide to an image. It takes the input image and the This procedure adds a horizontal guide to an image. It takes the input
$type-position of the new guide as parameters. It returns the guide ID of the image and the y-position of the new guide as parameters. It returns
new guide. the guide ID of the new guide.
HELP HELP
&adam_pdb_misc('1998'); &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
{ name => "${type}position", type => '0 <= int32', desc => 'The image' },
desc => "The guide's ${type}-offset from $pos of image" } { name => 'yposition', type => '0 <= int32',
desc => "The guide's y-offset from top of image" }
); );
@outargs = ( @outargs = (
@ -42,15 +40,14 @@ HELP
desc => 'The new guide' } desc => 'The new guide' }
); );
my $func = substr($desc, 0, 1);
%invoke = ( %invoke = (
code => <<CODE code => <<'CODE'
{ {
if (${type}position <= gimage->$max) if (yposition <= image->height)
{ {
GimpGuide *g; GimpGuide *g;
g = gimp_image_add_${func}guide (gimage, ${type}position, TRUE); g = gimp_image_add_hguide (image, yposition, TRUE);
guide = g->guide_ID; guide = g->guide_ID;
} }
else else
@ -60,14 +57,44 @@ CODE
); );
} }
# The defs
sub image_add_hguide {
&image_add_guide('horizontal', 'y', 'height', 'top');
}
sub image_add_vguide { sub image_add_vguide {
&image_add_guide('vertical', 'x', 'width', 'left'); $blurb = 'Add a vertical guide to an image.';
$help = <<HELP;
This procedure adds a vertical guide to an image. It takes the input
image and the x-position of the new guide as parameters. It returns
the guide ID of the new guide.
HELP
&adam_pdb_misc('1998');
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'xposition', type => '0 <= int32',
desc => "The guide's x-offset from left of image" }
);
@outargs = (
{ name => 'guide', type => 'guide',
desc => 'The new guide' }
);
%invoke = (
code => <<'CODE'
{
if (xposition <= image->width)
{
GimpGuide *g;
g = gimp_image_add_vguide (image, xposition, TRUE);
guide = g->guide_ID;
}
else
success = FALSE;
}
CODE
);
} }
sub image_delete_guide { sub image_delete_guide {
@ -81,7 +108,8 @@ HELP
&adam_pdb_misc('1998'); &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'guide', type => 'guide', { name => 'guide', type => 'guide',
desc => 'The ID of the guide to be removed' } desc => 'The ID of the guide to be removed' }
); );
@ -89,10 +117,10 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpGuide *g = gimp_image_get_guide (gimage, guide); GimpGuide *g = gimp_image_get_guide (image, guide);
if (g) if (g)
gimp_image_remove_guide (gimage, g, TRUE); gimp_image_remove_guide (image, g, TRUE);
else else
success = FALSE; success = FALSE;
} }
@ -113,7 +141,8 @@ HELP
&adam_pdb_misc('1998'); &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'guide', type => 'guide', { name => 'guide', type => 'guide',
desc => 'The ID of the current guide (0 if first invocation)' } desc => 'The ID of the current guide (0 if first invocation)' }
); );
@ -126,7 +155,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpGuide *g = gimp_image_get_next_guide (gimage, guide, &success); GimpGuide *g = gimp_image_get_next_guide (image, guide, &success);
if (g) if (g)
next_guide = g->guide_ID; next_guide = g->guide_ID;
@ -146,13 +175,15 @@ HELP
&adam_pdb_misc('1998'); &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'guide', type => 'guide', { name => 'guide', type => 'guide',
desc => 'The guide' } desc => 'The guide' }
); );
@outargs = ( @outargs = (
{ name => 'orientation', type => &std_orientation_enum, { name => 'orientation',
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
desc => "The guide's orientation: { %%desc%% }", desc => "The guide's orientation: { %%desc%% }",
libdef => 'GIMP_ORIENTATION_UNKNOWN' } libdef => 'GIMP_ORIENTATION_UNKNOWN' }
); );
@ -160,7 +191,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpGuide *g = gimp_image_get_guide (gimage, guide); GimpGuide *g = gimp_image_get_guide (image, guide);
if (g) if (g)
orientation = g->orientation; orientation = g->orientation;
@ -182,7 +213,8 @@ HELP
&adam_pdb_misc('1998'); &adam_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'guide', type => 'guide', { name => 'guide', type => 'guide',
desc => 'The guide' } desc => 'The guide' }
); );
@ -195,7 +227,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpGuide *g = gimp_image_get_guide (gimage, guide); GimpGuide *g = gimp_image_get_guide (image, guide);
if (g) if (g)
position = g->position; position = g->position;
@ -206,11 +238,13 @@ CODE
); );
} }
@headers = qw("core/gimpimage-guides.h" "core/gimpimage-undo-push.h"); @headers = qw("core/gimpimage-guides.h" "core/gimpimage-undo-push.h");
@procs = qw(image_add_hguide image_add_vguide image_delete_guide @procs = qw(image_add_hguide image_add_vguide image_delete_guide
image_find_next_guide image_get_guide_orientation image_find_next_guide image_get_guide_orientation
image_get_guide_position); image_get_guide_position);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Guide procedures'; $desc = 'Guide procedures';

View file

@ -51,9 +51,11 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-ins.h"); @headers = qw("core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-ins.h");
@procs = qw(help); @procs = qw(help);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Help procedures'; $desc = 'Help procedures';

File diff suppressed because it is too large Load diff

View file

@ -31,7 +31,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image to which to add the layer' },
{ name => 'width', type => '0 < int32', { name => 'width', type => '0 < int32',
desc => 'The layer width: (%%desc%%)' }, desc => 'The layer width: (%%desc%%)' },
{ name => 'height', type => '0 < int32', { name => 'height', type => '0 < int32',
@ -45,7 +46,6 @@ HELP
{ name => 'mode', type => 'enum GimpLayerModeEffects', { name => 'mode', type => 'enum GimpLayerModeEffects',
desc => 'The layer combination mode: { %%desc%% }' } desc => 'The layer combination mode: { %%desc%% }' }
); );
$inargs[0]->{desc} .= ' to which to add the layer';
@outargs = ( @outargs = (
{ name => 'layer', type => 'layer', wrap => 1, { name => 'layer', type => 'layer', wrap => 1,
@ -55,9 +55,11 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
layer = gimp_layer_new (gimage, width, height, type, name, layer = gimp_layer_new (image, width, height, type, name,
opacity / 100.0, mode); opacity / 100.0, mode);
success = (layer != NULL);
if (! layer)
success = FALSE;
} }
CODE CODE
); );
@ -333,9 +335,9 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_DISPLACE, gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
_("Move Layer")); _("Move Layer"));
gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE); gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);
@ -343,7 +345,7 @@ HELP
if (gimp_item_get_linked (GIMP_ITEM (layer))) if (gimp_item_get_linked (GIMP_ITEM (layer)))
gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE); gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
gimp_image_undo_group_end (gimage); gimp_image_undo_group_end (image);
} }
CODE CODE
); );
@ -401,9 +403,9 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_DISPLACE, gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
_("Move Layer")); _("Move Layer"));
offx -= GIMP_ITEM (layer)->offset_x; offx -= GIMP_ITEM (layer)->offset_x;
@ -414,7 +416,7 @@ HELP
if (gimp_item_get_linked (GIMP_ITEM (layer))) if (gimp_item_get_linked (GIMP_ITEM (layer)))
gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE); gimp_item_linked_translate (GIMP_ITEM (layer), offx, offy, TRUE);
gimp_image_undo_group_end (gimage); gimp_image_undo_group_end (image);
} }
CODE CODE
); );
@ -899,6 +901,7 @@ CODE
); );
} }
@headers = qw("config/gimpcoreconfig.h" "core/gimp.h" "core/gimpimage-undo.h" @headers = qw("config/gimpcoreconfig.h" "core/gimp.h" "core/gimpimage-undo.h"
"core/gimpitem-linked.h" "gimp-intl.h"); "core/gimpitem-linked.h" "gimp-intl.h");
@ -915,6 +918,7 @@ CODE
layer_get_edit_mask layer_set_edit_mask layer_get_edit_mask layer_set_edit_mask
layer_get_opacity layer_set_opacity layer_get_opacity layer_set_opacity
layer_get_mode layer_set_mode); layer_get_mode layer_set_mode);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Layer'; $desc = 'Layer';

View file

@ -94,10 +94,12 @@ CODE
); );
} }
@headers = qw(<string.h> "core/gimp.h" "plug-in/plug-in.h" @headers = qw(<string.h> "core/gimp.h" "plug-in/plug-in.h"
"plug-in/plug-in-progress.h" "gimp-intl.h"); "plug-in/plug-in-progress.h" "gimp-intl.h");
@procs = qw(message message_get_handler message_set_handler); @procs = qw(message message_get_handler message_set_handler);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Message procedures'; $desc = 'Message procedures';

View file

@ -93,7 +93,9 @@ CODE
); );
} }
@procs = qw(version getpid quit); @procs = qw(version getpid quit);
%exports = (app => [@procs], lib => [@procs[0..1]]); %exports = (app => [@procs], lib => [@procs[0..1]]);
$desc = 'Miscellaneous'; $desc = 'Miscellaneous';

View file

@ -781,9 +781,6 @@ sub ink {
); );
} }
@headers = qw("libgimpmath/gimpmath.h"
"paint/gimppaintcore-stroke.h" "paint/gimppaintoptions.h"
"core/gimp.h" "core/gimpcontainer.h" "core/gimppaintinfo.h");
$extra{app}->{code} = <<'CODE'; $extra{app}->{code} = <<'CODE';
static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES; static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES;
@ -834,6 +831,11 @@ paint_tools_stroke (Gimp *gimp,
} }
CODE CODE
@headers = qw("libgimpmath/gimpmath.h"
"paint/gimppaintcore-stroke.h" "paint/gimppaintoptions.h"
"core/gimp.h" "core/gimpcontainer.h" "core/gimppaintinfo.h");
@procs = qw(airbrush airbrush_default @procs = qw(airbrush airbrush_default
clone clone_default clone clone_default
convolve convolve_default convolve convolve_default

View file

@ -576,6 +576,7 @@ CODE
palette_add_entry palette_delete_entry palette_add_entry palette_delete_entry
palette_entry_get_color palette_entry_set_color palette_entry_get_color palette_entry_set_color
palette_entry_get_name palette_entry_set_name); palette_entry_get_name palette_entry_set_name);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Palette'; $desc = 'Palette';

View file

@ -98,9 +98,11 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "core/gimpdatafactory.h"); @headers = qw("core/gimp.h" "core/gimpdatafactory.h");
@procs = qw(palettes_popup palettes_close_popup palettes_set_popup); @procs = qw(palettes_popup palettes_close_popup palettes_set_popup);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Palette UI'; $desc = 'Palette UI';

View file

@ -157,6 +157,7 @@ CODE
@procs = qw(palettes_refresh palettes_get_list @procs = qw(palettes_refresh palettes_get_list
palettes_get_palette palettes_get_palette_entry); palettes_get_palette palettes_get_palette_entry);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Palettes'; $desc = 'Palettes';

View file

@ -125,7 +125,8 @@ HELP
&jay_pdb_misc('1998'); &jay_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the parasite to find' } desc => 'The name of the parasite to find' }
); );
@ -138,7 +139,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
parasite = gimp_parasite_copy (gimp_image_parasite_find (gimage, name)); parasite = gimp_parasite_copy (gimp_image_parasite_find (image, name));
if (! parasite) if (! parasite)
success = FALSE; success = FALSE;
@ -157,7 +158,8 @@ HELP
&jay_pdb_misc('1998'); &jay_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'parasite', type => 'parasite', { name => 'parasite', type => 'parasite',
desc => 'The parasite to attach to an image' } desc => 'The parasite to attach to an image' }
); );
@ -165,7 +167,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_image_parasite_attach (gimage, parasite); gimp_image_parasite_attach (image, parasite);
} }
CODE CODE
); );
@ -181,7 +183,8 @@ HELP
&jay_pdb_misc('1998'); &jay_pdb_misc('1998');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the parasite to detach from an image.' } desc => 'The name of the parasite to detach from an image.' }
); );
@ -189,7 +192,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_image_parasite_detach (gimage, name); gimp_image_parasite_detach (image, name);
} }
CODE CODE
); );
@ -202,7 +205,8 @@ sub image_parasite_list {
&marc_pdb_misc('1999'); &marc_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
@outargs = ( @outargs = (
@ -214,7 +218,7 @@ sub image_parasite_list {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
parasites = gimp_image_parasite_list (gimage, &num_parasites); parasites = gimp_image_parasite_list (image, &num_parasites);
} }
CODE CODE
); );
@ -442,6 +446,7 @@ CODE
); );
} }
@headers = qw("core/gimp-parasites.h"); @headers = qw("core/gimp-parasites.h");
@procs = qw(parasite_find @procs = qw(parasite_find
@ -456,6 +461,7 @@ CODE
vectors_parasite_find vectors_parasite_find
vectors_parasite_attach vectors_parasite_detach vectors_parasite_attach vectors_parasite_detach
vectors_parasite_list); vectors_parasite_list);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Parasite procedures'; $desc = 'Parasite procedures';

View file

@ -21,9 +21,9 @@ sub path_list {
&std_pdb_deprecated('gimp-image-get-vectors'); &std_pdb_deprecated('gimp-image-get-vectors');
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image to list the paths from' }
); );
$inargs[0]->{desc} = 'The ID of the image to list the paths from';
@outargs = ( @outargs = (
{ name => 'path_list', type => 'stringarray', { name => 'path_list', type => 'stringarray',
@ -35,7 +35,7 @@ sub path_list {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
path_list = gimp_container_get_name_array (gimage->vectors, &num_paths); path_list = gimp_container_get_name_array (image->vectors, &num_paths);
} }
CODE CODE
); );
@ -48,11 +48,11 @@ sub path_get_points {
&andy_pdb_misc('1999'); &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image to list the paths from' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the path whose points should be listed.' } desc => 'The name of the path whose points should be listed.' }
); );
$inargs[0]->{desc} = 'The ID of the image to list the paths from.';
@outargs = ( @outargs = (
{ name => 'path_type', type => 'int32', { name => 'path_type', type => 'int32',
@ -76,7 +76,7 @@ sub path_get_points {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
{ {
@ -122,9 +122,9 @@ sub path_get_current {
&std_pdb_deprecated('gimp-image-get-active-vectors'); &std_pdb_deprecated('gimp-image-get-active-vectors');
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image to get the current path from' },
); );
$inargs[0]->{desc} = 'The ID of the image to get the current path from.';
@outargs = ( @outargs = (
{ name => 'name', type => 'string', { name => 'name', type => 'string',
@ -134,7 +134,7 @@ sub path_get_current {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_active_vectors (gimage); GimpVectors *vectors = gimp_image_get_active_vectors (image);
if (vectors) if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
@ -149,19 +149,19 @@ sub path_set_current {
&std_pdb_deprecated('gimp-image-set-active-vectors'); &std_pdb_deprecated('gimp-image-set-active-vectors');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image in which a path will become current' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the path to make current.' } desc => 'The name of the path to make current.' }
); );
$inargs[0]->{desc} = 'The ID of the image in which a path will become current.';
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_image_set_active_vectors (gimage, vectors); gimp_image_set_active_vectors (image, vectors);
else else
success = FALSE; success = FALSE;
} }
@ -176,7 +176,8 @@ sub path_set_points {
&andy_pdb_misc('1999'); &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image to set the paths in' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the path to create. If it exists then a unique desc => 'The name of the path to create. If it exists then a unique
name will be created - query the list of paths if you want name will be created - query the list of paths if you want
@ -209,7 +210,6 @@ sub path_set_points {
assumed to be closed and the points are assumed to be closed and the points are
ACCACCACCACC.' } } ACCACCACCACC.' } }
); );
$inargs[0]->{desc} = 'The ID of the image to set the paths in.';
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
@ -242,13 +242,13 @@ sub path_set_points {
points[i].type = curr_point_pair[2]; points[i].type = curr_point_pair[2];
} }
vectors = gimp_vectors_compat_new (gimage, name, points, n_points, vectors = gimp_vectors_compat_new (image, name, points, n_points,
closed); closed);
g_free (points); g_free (points);
if (vectors) if (vectors)
gimp_image_add_vectors (gimage, vectors, 0); gimp_image_add_vectors (image, vectors, 0);
else else
success = FALSE; success = FALSE;
} }
@ -264,17 +264,16 @@ sub path_stroke_current {
&andy_pdb_misc('1999'); &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image which contains the path to stroke' },
); );
$inargs[0]->{desc} = 'The ID of the image which contains the path to
stroke.';
%invoke = ( %invoke = (
headers => [ qw("core/gimpstrokedesc.h") ], headers => [ qw("core/gimpstrokedesc.h") ],
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_active_vectors (gimage); GimpVectors *vectors = gimp_image_get_active_vectors (image);
GimpDrawable *drawable = gimp_image_active_drawable (gimage); GimpDrawable *drawable = gimp_image_active_drawable (image);
if (vectors && drawable) if (vectors && drawable)
{ {
@ -308,11 +307,11 @@ HELP
&andy_pdb_misc('1999'); &andy_pdb_misc('1999');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image the paths belongs to' },
{ name => 'distance', type => 'float', { name => 'distance', type => 'float',
desc => 'The distance along the path.' } desc => 'The distance along the path.' }
); );
$inargs[0]->{desc} = 'The ID of the image the paths belongs to';
@outargs = ( @outargs = (
{ name => 'x_point', type => 'int32', { name => 'x_point', type => 'int32',
@ -333,7 +332,7 @@ HELP
gdouble stroke_distance; gdouble stroke_distance;
GimpCoords position; GimpCoords position;
vectors = gimp_image_get_active_vectors (gimage); vectors = gimp_image_get_active_vectors (image);
if (vectors) if (vectors)
{ {
@ -384,7 +383,8 @@ sub path_get_tattoo {
&std_pdb_deprecated('gimp-vectors-get-tattoo'); &std_pdb_deprecated('gimp-vectors-get-tattoo');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the path whose tattoo should be obtained.' } desc => 'The name of the path whose tattoo should be obtained.' }
); );
@ -397,7 +397,7 @@ sub path_get_tattoo {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors)); tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
@ -412,7 +412,8 @@ sub path_set_tattoo {
&std_pdb_deprecated('gimp-vectors-set-tattoo'); &std_pdb_deprecated('gimp-vectors-set-tattoo');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'the name of the path whose tattoo should be set' }, desc => 'the name of the path whose tattoo should be set' },
{ name => 'tattovalue', type => 'int32', { name => 'tattovalue', type => 'int32',
@ -423,7 +424,7 @@ sub path_set_tattoo {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue); gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue);
@ -438,7 +439,8 @@ sub get_path_by_tattoo {
&std_pdb_deprecated('gimp-image-get-vectors-by-tattoo'); &std_pdb_deprecated('gimp-image-get-vectors-by-tattoo');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'tattoo', type => 'int32', { name => 'tattoo', type => 'int32',
desc => 'The tattoo of the required path.' } desc => 'The tattoo of the required path.' }
); );
@ -451,7 +453,7 @@ sub get_path_by_tattoo {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo); GimpVectors *vectors = gimp_image_get_vectors_by_tattoo (image, tattoo);
if (vectors) if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
@ -466,19 +468,19 @@ sub path_delete {
&std_pdb_deprecated('gimp-image-remove-vectors'); &std_pdb_deprecated('gimp-image-remove-vectors');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image to delete the path from' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the path to delete.' } desc => 'The name of the path to delete.' }
); );
$inargs[0]->{desc} = 'The ID of the image to delete the path from.';
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_image_remove_vectors (gimage, vectors); gimp_image_remove_vectors (image, vectors);
else else
success = FALSE; success = FALSE;
} }
@ -490,7 +492,8 @@ sub path_get_locked {
&std_pdb_deprecated('gimp-vectors-get-linked'); &std_pdb_deprecated('gimp-vectors-get-linked');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the path whose locked status should be desc => 'The name of the path whose locked status should be
obtained.' } obtained.' }
@ -504,7 +507,7 @@ sub path_get_locked {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
locked = gimp_item_get_linked (GIMP_ITEM (vectors)); locked = gimp_item_get_linked (GIMP_ITEM (vectors));
@ -519,7 +522,8 @@ sub path_set_locked {
&std_pdb_deprecated('gimp-vectors-set-linked'); &std_pdb_deprecated('gimp-vectors-set-linked');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'the name of the path whose locked status should be set' }, desc => 'the name of the path whose locked status should be set' },
{ name => 'locked', type => 'boolean', { name => 'locked', type => 'boolean',
@ -529,7 +533,7 @@ sub path_set_locked {
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE); gimp_item_set_linked (GIMP_ITEM (vectors), locked, TRUE);
@ -550,7 +554,8 @@ HELP
&joao_pdb_misc('2003'); &joao_pdb_misc('2003');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'The name of the path which should be made into selection.' }, desc => 'The name of the path which should be made into selection.' },
{ name => 'op', type => 'enum GimpChannelOps', { name => 'op', type => 'enum GimpChannelOps',
@ -568,10 +573,10 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name); GimpVectors *vectors = gimp_image_get_vectors_by_name (image, name);
if (vectors) if (vectors)
gimp_channel_select_vectors (gimp_image_get_mask (gimage), gimp_channel_select_vectors (gimp_image_get_mask (image),
_("Path to Selection"), _("Path to Selection"),
vectors, vectors,
op, op,
@ -597,7 +602,8 @@ HELP
&neo_pdb_misc('2003'); &neo_pdb_misc('2003');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'filename', type => 'string', no_validate => 1, { name => 'filename', type => 'string', no_validate => 1,
desc => 'The name of the SVG file to import.' }, desc => 'The name of the SVG file to import.' },
{ name => 'merge', type => 'boolean', { name => 'merge', type => 'boolean',
@ -610,7 +616,7 @@ HELP
headers => [ qw("vectors/gimpvectors-import.h") ], headers => [ qw("vectors/gimpvectors-import.h") ],
code => <<'CODE' code => <<'CODE'
{ {
success = gimp_vectors_import_file (gimage, filename, merge, scale, -1, NULL); success = gimp_vectors_import_file (image, filename, merge, scale, -1, NULL);
} }
CODE CODE
); );
@ -628,7 +634,8 @@ HELP
&neo_pdb_misc('2005', '2.4'); &neo_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'string', type => 'string', no_validate => 1, { name => 'string', type => 'string', no_validate => 1,
desc => 'A string that must be a complete and valid SVG document.' }, desc => 'A string that must be a complete and valid SVG document.' },
{ name => 'length', type => 'int32', { name => 'length', type => 'int32',
@ -644,13 +651,14 @@ HELP
headers => [ qw("vectors/gimpvectors-import.h") ], headers => [ qw("vectors/gimpvectors-import.h") ],
code => <<'CODE' code => <<'CODE'
{ {
success = gimp_vectors_import_buffer (gimage, string, length, success = gimp_vectors_import_buffer (image, string, length,
merge, scale, -1, NULL); merge, scale, -1, NULL);
} }
CODE CODE
); );
} }
@headers = qw(<string.h> "core/gimp.h" "core/gimplist.h" @headers = qw(<string.h> "core/gimp.h" "core/gimplist.h"
"core/gimpchannel-select.h" "core/gimpchannel-select.h"
"vectors/gimpanchor.h" "vectors/gimpbezierstroke.h" "vectors/gimpanchor.h" "vectors/gimpbezierstroke.h"
@ -663,6 +671,7 @@ CODE
path_get_tattoo path_set_tattoo get_path_by_tattoo path_get_tattoo path_set_tattoo get_path_by_tattoo
path_get_locked path_set_locked path_get_locked path_set_locked
path_to_selection path_import path_import_string); path_to_selection path_import path_import_string);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Paths'; $desc = 'Paths';

View file

@ -119,6 +119,7 @@ CODE
"core/gimpdatafactory.h" "core/gimppattern.h" ); "core/gimpdatafactory.h" "core/gimppattern.h" );
@procs = qw(pattern_get_info pattern_get_pixels); @procs = qw(pattern_get_info pattern_get_pixels);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Pattern'; $desc = 'Pattern';

View file

@ -98,9 +98,11 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "core/gimpdatafactory.h"); @headers = qw("core/gimp.h" "core/gimpdatafactory.h");
@procs = qw(patterns_popup patterns_close_popup patterns_set_popup); @procs = qw(patterns_popup patterns_close_popup patterns_set_popup);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Pattern UI'; $desc = 'Pattern UI';

View file

@ -155,11 +155,13 @@ CODE
); );
} }
@headers = qw(<string.h> "core/gimp.h" "core/gimpcontext.h" "core/gimplist.h" @headers = qw(<string.h> "core/gimp.h" "core/gimpcontext.h" "core/gimplist.h"
"core/gimpdatafactory.h" "core/gimppattern.h" "base/temp-buf.h"); "core/gimpdatafactory.h" "core/gimppattern.h" "base/temp-buf.h");
@procs = qw(patterns_refresh patterns_get_list patterns_get_pattern @procs = qw(patterns_refresh patterns_get_list patterns_get_pattern
patterns_get_pattern_data); patterns_get_pattern_data);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Patterns'; $desc = 'Patterns';

View file

@ -284,6 +284,7 @@ CODE
plugin_domain_register plugin_help_register plugin_domain_register plugin_help_register
plugin_menu_register plugin_menu_branch_register plugin_menu_register plugin_menu_branch_register
plugin_icon_register); plugin_icon_register);
%exports = (app => [@procs], lib => [@procs[1,2,3,4,5]]); %exports = (app => [@procs], lib => [@procs[1,2,3,4,5]]);
$desc = 'Plug-in'; $desc = 'Plug-in';

View file

@ -390,6 +390,7 @@ CODE
); );
} }
@headers = qw("libgimpbase/gimpbase.h" "core/gimp.h" "plug-in/plug-in-data.h" @headers = qw("libgimpbase/gimpbase.h" "core/gimp.h" "plug-in/plug-in-data.h"
"procedural-db-query.h"); "procedural-db-query.h");
@ -398,6 +399,7 @@ CODE
procedural_db_proc_arg procedural_db_proc_val procedural_db_proc_arg procedural_db_proc_val
procedural_db_get_data procedural_db_get_data_size procedural_db_get_data procedural_db_get_data_size
procedural_db_set_data); procedural_db_set_data);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Procedural database'; $desc = 'Procedural database';

View file

@ -256,11 +256,13 @@ CODE
); );
} }
@headers = qw("core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-in-progress.h"); @headers = qw("core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-in-progress.h");
@procs = qw(progress_init progress_update progress_pulse progress_set_text @procs = qw(progress_init progress_update progress_pulse progress_set_text
progress_get_window_handle progress_get_window_handle
progress_install progress_uninstall progress_cancel); progress_install progress_uninstall progress_cancel);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Progress'; $desc = 'Progress';

View file

@ -33,7 +33,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
@outargs = ( @outargs = (
@ -50,7 +51,12 @@ HELP
); );
%invoke = ( %invoke = (
code => 'non_empty = gimp_channel_bounds (gimp_image_get_mask (gimage), &x1, &y1, &x2, &y2);' code => <<'CODE'
{
non_empty = gimp_channel_bounds (gimp_image_get_mask (image),
&x1, &y1, &x2, &y2);
}
CODE
); );
} }
@ -65,7 +71,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'x', type => 'int32', { name => 'x', type => 'int32',
desc => 'x coordinate of value' }, desc => 'x coordinate of value' },
{ name => 'y', type => 'int32', { name => 'y', type => 'int32',
@ -80,7 +87,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
value = gimp_pickable_get_opacity_at (GIMP_PICKABLE (gimp_image_get_mask (gimage)), x, y); value = gimp_pickable_get_opacity_at (GIMP_PICKABLE (gimp_image_get_mask (image)), x, y);
} }
CODE CODE
); );
@ -97,7 +104,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
@outargs = ( @outargs = (
@ -108,7 +116,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
is_empty = gimp_channel_is_empty (gimp_image_get_mask (gimage)); is_empty = gimp_channel_is_empty (gimp_image_get_mask (image));
} }
CODE CODE
); );
@ -127,14 +135,22 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'offx', type => 'int32', { name => 'offx', type => 'int32',
desc => 'x offset for translation' }, desc => 'x offset for translation' },
{ name => 'offy', type => 'int32', { name => 'offy', type => 'int32',
desc => 'y offset for translation' } desc => 'y offset for translation' }
); );
%invoke = ( code => 'gimp_item_translate (GIMP_ITEM (gimp_image_get_mask (gimage)), offx, offy, TRUE);' ); %invoke = (
code => <<'CODE'
{
gimp_item_translate (GIMP_ITEM (gimp_image_get_mask (image)),
offx, offy, TRUE);
}
CODE
);
} }
sub selection_float { sub selection_float {
@ -173,9 +189,9 @@ HELP
if (success) if (success)
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
layer = gimp_selection_float (gimp_image_get_mask (gimage), layer = gimp_selection_float (gimp_image_get_mask (image),
drawable, context, TRUE, offx, offy); drawable, context, TRUE, offx, offy);
if (! layer) if (! layer)
success = FALSE; success = FALSE;
@ -196,13 +212,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_invert (gimp_image_get_mask (gimage), TRUE); gimp_channel_invert (gimp_image_get_mask (image), TRUE);
} }
CODE CODE
); );
@ -220,13 +237,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_sharpen (gimp_image_get_mask (gimage), TRUE); gimp_channel_sharpen (gimp_image_get_mask (image), TRUE);
} }
CODE CODE
); );
@ -243,13 +261,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_all (gimp_image_get_mask (gimage), TRUE); gimp_channel_all (gimp_image_get_mask (image), TRUE);
} }
CODE CODE
); );
@ -266,13 +285,14 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE); gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
} }
CODE CODE
); );
@ -289,7 +309,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'radius', type => '0 <= float', { name => 'radius', type => '0 <= float',
desc => 'Radius of feather (in pixels)' } desc => 'Radius of feather (in pixels)' }
); );
@ -297,7 +318,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_feather (gimp_image_get_mask (gimage), gimp_channel_feather (gimp_image_get_mask (image),
radius, radius, TRUE); radius, radius, TRUE);
} }
CODE CODE
@ -316,7 +337,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'radius', type => '0 <= int32', { name => 'radius', type => '0 <= int32',
desc => 'Radius of border (in pixels)' } desc => 'Radius of border (in pixels)' }
); );
@ -324,7 +346,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_border (gimp_image_get_mask (gimage), gimp_channel_border (gimp_image_get_mask (image),
radius, radius, TRUE); radius, radius, TRUE);
} }
CODE CODE
@ -342,7 +364,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'steps', type => '0 <= int32', { name => 'steps', type => '0 <= int32',
desc => 'Steps of grow (in pixels)' } desc => 'Steps of grow (in pixels)' }
); );
@ -350,7 +373,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_grow (gimp_image_get_mask (gimage), gimp_channel_grow (gimp_image_get_mask (image),
steps, steps, TRUE); steps, steps, TRUE);
} }
CODE CODE
@ -369,7 +392,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'steps', type => '0 <= int32', { name => 'steps', type => '0 <= int32',
desc => 'Steps of shrink (in pixels)' } desc => 'Steps of shrink (in pixels)' }
); );
@ -377,7 +401,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_shrink (gimp_image_get_mask (gimage), gimp_channel_shrink (gimp_image_get_mask (image),
steps, steps, FALSE, TRUE); steps, steps, FALSE, TRUE);
} }
CODE CODE
@ -407,9 +431,9 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
gimp_channel_select_alpha (gimp_image_get_mask (gimage), gimp_channel_select_alpha (gimp_image_get_mask (image),
GIMP_DRAWABLE (layer), GIMP_DRAWABLE (layer),
GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0); GIMP_CHANNEL_OP_REPLACE, FALSE, 0.0, 0.0);
} }
@ -434,13 +458,13 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpImage *gimage; GimpImage *image;
gint off_x, off_y; gint off_x, off_y;
gimage = gimp_item_get_image (GIMP_ITEM (channel)); image = gimp_item_get_image (GIMP_ITEM (channel));
gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y); gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y);
gimp_channel_select_channel (gimp_image_get_mask (gimage), gimp_channel_select_channel (gimp_image_get_mask (image),
_("Channel to Selection"), _("Channel to Selection"),
channel, channel,
off_x, off_y, off_x, off_y,
@ -470,13 +494,13 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpImage *gimage; GimpImage *image;
gint off_x, off_y; gint off_x, off_y;
gimage = gimp_item_get_image (GIMP_ITEM (channel)); image = gimp_item_get_image (GIMP_ITEM (channel));
gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y); gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y);
gimp_channel_select_channel (gimp_image_get_mask (gimage), gimp_channel_select_channel (gimp_image_get_mask (image),
_("Channel to Selection"), _("Channel to Selection"),
channel, channel,
off_x, off_y, off_x, off_y,
@ -499,7 +523,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg { name => 'image', type => 'image',
desc => 'The image' }
); );
@outargs = ( @outargs = (
@ -511,7 +536,7 @@ HELP
headers => [qw("core/gimpselection.h") ], headers => [qw("core/gimpselection.h") ],
code => <<'CODE' code => <<'CODE'
{ {
channel = gimp_selection_save (gimp_image_get_mask (gimage)); channel = gimp_selection_save (gimp_image_get_mask (image));
if (! channel) if (! channel)
success = FALSE; success = FALSE;
@ -520,6 +545,7 @@ CODE
); );
} }
@headers = qw("core/gimpchannel-select.h" "core/gimppickable.h" @headers = qw("core/gimpchannel-select.h" "core/gimppickable.h"
"gimp-intl.h"); "gimp-intl.h");
@ -529,6 +555,7 @@ CODE
selection_feather selection_border selection_grow selection_shrink selection_feather selection_border selection_grow selection_shrink
selection_layer_alpha selection_load selection_save selection_layer_alpha selection_load selection_save
selection_combine); selection_combine);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Image mask'; $desc = 'Image mask';

View file

@ -48,10 +48,11 @@ HELP
desc => 'Threshold in intensity levels %%desc%%' }, desc => 'Threshold in intensity levels %%desc%%' },
{ name => 'operation', type => 'enum GimpChannelOps', { name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' }, desc => 'The selection operation: { %%desc%% }' },
&std_antialias_arg, { name => 'antialias', type => 'boolean',
desc => 'Antialiasing (%%desc%%)' },
{ name => 'feather', type => 'boolean', { name => 'feather', type => 'boolean',
desc => 'Feather option for selections' }, desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float', { name => 'feather_radius', type => '0 <= float',
desc => 'Radius for feather operation' }, desc => 'Radius for feather operation' },
{ name => 'sample_merged', type => 'boolean', { name => 'sample_merged', type => 'boolean',
desc => 'Use the composite image, not the drawable' } desc => 'Use the composite image, not the drawable' }
@ -60,9 +61,9 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_by_color (gimp_image_get_mask (gimage), drawable, gimp_channel_select_by_color (gimp_image_get_mask (image), drawable,
sample_merged, sample_merged,
&color, &color,
threshold, threshold,
@ -94,7 +95,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'x', type => 'float', { name => 'x', type => 'float',
desc => 'x coordinate of upper-left corner of ellipse bounding box' }, desc => 'x coordinate of upper-left corner of ellipse bounding box' },
{ name => 'y', type => 'float', { name => 'y', type => 'float',
@ -105,17 +107,18 @@ HELP
desc => 'The height of the ellipse: %%desc%%' }, desc => 'The height of the ellipse: %%desc%%' },
{ name => 'operation', type => 'enum GimpChannelOps', { name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' }, desc => 'The selection operation: { %%desc%% }' },
&std_antialias_arg, { name => 'antialias', type => 'boolean',
desc => 'Antialiasing (%%desc%%)' },
{ name => 'feather', type => 'boolean', { name => 'feather', type => 'boolean',
desc => 'Feather option for selections' }, desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float', { name => 'feather_radius', type => '0 <= float',
desc => 'Radius for feather operation' } desc => 'Radius for feather operation' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_select_ellipse (gimp_image_get_mask (gimage), gimp_channel_select_ellipse (gimp_image_get_mask (image),
(gint) x, (gint) y, (gint) x, (gint) y,
(gint) width, (gint) height, (gint) width, (gint) height,
operation, operation,
@ -146,7 +149,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'segs', type => 'floatarray', { name => 'segs', type => 'floatarray',
desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ..., desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
pn.x, pn.y}', pn.x, pn.y}',
@ -155,17 +159,18 @@ HELP
points)' } }, points)' } },
{ name => 'operation', type => 'enum GimpChannelOps', { name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' }, desc => 'The selection operation: { %%desc%% }' },
&std_antialias_arg, { name => 'antialias', type => 'boolean',
desc => 'Antialiasing (%%desc%%)' },
{ name => 'feather', type => 'boolean', { name => 'feather', type => 'boolean',
desc => 'Feather option for selections' }, desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float', { name => 'feather_radius', type => '0 <= float',
desc => 'Radius for feather operation' } desc => 'Radius for feather operation' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_select_polygon (gimp_image_get_mask (gimage), gimp_channel_select_polygon (gimp_image_get_mask (image),
_("Free Select"), _("Free Select"),
num_segs / 2, num_segs / 2,
(GimpVector2 *) segs, (GimpVector2 *) segs,
@ -218,10 +223,11 @@ HELP
desc => 'Threshold in intensity levels %%desc%%' }, desc => 'Threshold in intensity levels %%desc%%' },
{ name => 'operation', type => 'enum GimpChannelOps', { name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' }, desc => 'The selection operation: { %%desc%% }' },
&std_antialias_arg, { name => 'antialias', type => 'boolean',
desc => 'Antialiasing (%%desc%%)' },
{ name => 'feather', type => 'boolean', { name => 'feather', type => 'boolean',
desc => 'Feather option for selections' }, desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float', { name => 'feather_radius', type => '0 <= float',
desc => 'Radius for feather operation' }, desc => 'Radius for feather operation' },
{ name => 'sample_merged', type => 'boolean', { name => 'sample_merged', type => 'boolean',
desc => 'Use the composite image, not the drawable' } desc => 'Use the composite image, not the drawable' }
@ -230,9 +236,9 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
gimp_channel_select_fuzzy (gimp_image_get_mask (gimage), gimp_channel_select_fuzzy (gimp_image_get_mask (image),
drawable, drawable,
sample_merged, sample_merged,
x, y, x, y,
@ -262,7 +268,8 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'x', type => 'float', { name => 'x', type => 'float',
desc => 'x coordinate of upper-left corner of rectangle' }, desc => 'x coordinate of upper-left corner of rectangle' },
{ name => 'y', type => 'float', { name => 'y', type => 'float',
@ -275,14 +282,14 @@ HELP
desc => 'The selection operation: { %%desc%% }' }, desc => 'The selection operation: { %%desc%% }' },
{ name => 'feather', type => 'boolean', { name => 'feather', type => 'boolean',
desc => 'Feather option for selections' }, desc => 'Feather option for selections' },
{ name => 'feather_radius', type => 'float', { name => 'feather_radius', type => '0 <= float',
desc => 'Radius for feather operation' } desc => 'Radius for feather operation' }
); );
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
gimp_channel_select_rectangle (gimp_image_get_mask (gimage), gimp_channel_select_rectangle (gimp_image_get_mask (image),
(gint) x, (gint) y, (gint) x, (gint) y,
(gint) width, (gint) height, (gint) width, (gint) height,
operation, operation,
@ -294,10 +301,12 @@ CODE
); );
} }
@headers = qw("core/gimpchannel-select.h" "gimp-intl.h"); @headers = qw("core/gimpchannel-select.h" "gimp-intl.h");
@procs = qw(by_color_select ellipse_select free_select fuzzy_select @procs = qw(by_color_select ellipse_select free_select fuzzy_select
rect_select); rect_select);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Selection Tool procedures'; $desc = 'Selection Tool procedures';

View file

@ -39,7 +39,8 @@ HELP
$date = '1998- 2001'; $date = '1998- 2001';
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The affected drawable: (-1 for a new text layer)', desc => 'The affected drawable: (-1 for a new text layer)',
no_success => 1 }, no_success => 1 },
@ -51,7 +52,8 @@ HELP
desc => 'The text to generate (in UTF-8 encoding)' }, desc => 'The text to generate (in UTF-8 encoding)' },
{ name => 'border', type => '-1 <= int32', { name => 'border', type => '-1 <= int32',
desc => 'The size of the border: %%desc%%' }, desc => 'The size of the border: %%desc%%' },
&std_antialias_arg, { name => 'antialias', type => 'boolean',
desc => 'Antialiasing (%%desc%%)' },
{ name => 'size', type => '0 < float', { name => 'size', type => '0 < float',
desc => 'The size of text in either pixels or points' }, desc => 'The size of text in either pixels or points' },
{ name => 'size_type', type => 'enum GimpSizeType', { name => 'size_type', type => 'enum GimpSizeType',
@ -75,7 +77,7 @@ HELP
{ {
gchar *real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size); gchar *real_fontname = g_strdup_printf ("%s %d", fontname, (gint) size);
text_layer = text_render (gimage, drawable, context, text_layer = text_render (image, drawable, context,
x, y, real_fontname, text, x, y, real_fontname, text,
border, antialias); border, antialias);
@ -140,7 +142,8 @@ sub text {
&std_pdb_deprecated ('gimp-text-fontname'); &std_pdb_deprecated ('gimp-text-fontname');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The affected drawable: (-1 for a new text layer)', desc => 'The affected drawable: (-1 for a new text layer)',
no_success => 1 }, no_success => 1 },
@ -152,7 +155,8 @@ sub text {
desc => 'The text to generate (in UTF-8 encoding)' }, desc => 'The text to generate (in UTF-8 encoding)' },
{ name => 'border', type => '-1 <= int32', { name => 'border', type => '-1 <= int32',
desc => 'The size of the border: %%desc%%' }, desc => 'The size of the border: %%desc%%' },
&std_antialias_arg, { name => 'antialias', type => 'boolean',
desc => 'Antialiasing (%%desc%%)' },
{ name => 'size', type => '0 < float', { name => 'size', type => '0 < float',
desc => 'The size of text in either pixels or points' }, desc => 'The size of text in either pixels or points' },
{ name => 'size_type', type => 'enum GimpSizeType', { name => 'size_type', type => 'enum GimpSizeType',
@ -190,7 +194,7 @@ sub text {
{ {
gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size); gchar *real_fontname = g_strdup_printf ("%s %d", family, (gint) size);
text_layer = text_render (gimage, drawable, context, text_layer = text_render (image, drawable, context,
x, y, real_fontname, text, x, y, real_fontname, text,
border, antialias); border, antialias);
@ -255,9 +259,12 @@ CODE
); );
} }
@headers = qw("libgimpbase/gimpbase.h" "text/gimptext-compat.h"); @headers = qw("libgimpbase/gimpbase.h" "text/gimptext-compat.h");
@procs = qw(text_fontname text_get_extents_fontname text text_get_extents); @procs = qw(text_fontname text_get_extents_fontname
text text_get_extents);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Text procedures'; $desc = 'Text procedures';

View file

@ -23,7 +23,8 @@ sub flip {
@inargs = ( @inargs = (
{ name => 'drawable', type => 'drawable', { name => 'drawable', type => 'drawable',
desc => 'The affected drawable' }, desc => 'The affected drawable' },
{ name => 'flip_type', type => &std_orientation_enum, { name => 'flip_type',
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
desc => 'Type of flip: %%desc%%' } desc => 'Type of flip: %%desc%%' }
); );
@ -266,7 +267,8 @@ sub shear {
desc => 'The affected drawable' }, desc => 'The affected drawable' },
{ name => 'interpolation', type => 'boolean', { name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' }, desc => 'Whether to use interpolation' },
{ name => 'shear_type', type => &std_orientation_enum, { name => 'shear_type',
type => 'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)',
desc => 'Type of shear: %%desc%%' }, desc => 'Type of shear: %%desc%%' },
{ name => 'magnitude', type => 'float', { name => 'magnitude', type => 'float',
desc => 'The magnitude of the shear' } desc => 'The magnitude of the shear' }
@ -386,6 +388,7 @@ CODE
); );
} }
@headers = qw("libgimpmath/gimpmath.h" "config/gimpcoreconfig.h" @headers = qw("libgimpmath/gimpmath.h" "config/gimpcoreconfig.h"
"core/gimp.h" "core/gimp-transform-utils.h" "core/gimpimage.h" "core/gimp.h" "core/gimp-transform-utils.h" "core/gimpimage.h"
"core/gimpdrawable.h" "core/gimpdrawable-transform.h" "core/gimpdrawable.h" "core/gimpdrawable-transform.h"

View file

@ -29,18 +29,21 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
@inargs = ( &std_image_arg ); @inargs = (
$inargs[0]->{desc} = 'The ID of the image in which to open an undo group'; { name => 'image', type => 'image',
desc => 'The ID of the image in which to open an undo group' }
);
%invoke = ( headers => [ qw("core/gimp.h" "plug-in/plug-in.h") ], %invoke = (
code => <<CODE headers => [ qw("core/gimp.h" "plug-in/plug-in.h") ],
code => <<'CODE'
{ {
gchar *undo_desc = NULL; gchar *undo_desc = NULL;
if (gimp->current_plug_in) if (gimp->current_plug_in)
undo_desc = plug_in_get_undo_desc (gimp->current_plug_in); undo_desc = plug_in_get_undo_desc (gimp->current_plug_in);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_MISC, undo_desc); gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC, undo_desc);
if (undo_desc) if (undo_desc)
g_free (undo_desc); g_free (undo_desc);
@ -60,10 +63,18 @@ HELP
&std_pdb_misc; &std_pdb_misc;
$date = '1997'; $date = '1997';
@inargs = ( &std_image_arg ); @inargs = (
$inargs[0]->{desc} = 'The ID of the image in which to close an undo group'; { name => 'image', type => 'image',
desc => 'The ID of the image in which to close an undo group' }
);
%invoke = ( code => 'gimp_image_undo_group_end (gimage);' ); %invoke = (
code => <<'CODE'
{
gimp_image_undo_group_end (image);
}
CODE
);
} }
sub image_undo_is_enabled { sub image_undo_is_enabled {
@ -78,14 +89,23 @@ HELP
&raphael_pdb_misc('1999'); &raphael_pdb_misc('1999');
@inargs = ( &std_image_arg ); @inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = ( @outargs = (
{ name => 'enabled', type => 'boolean', { name => 'enabled', type => 'boolean',
desc => 'True if undo is enabled for this image' } desc => 'True if undo is enabled for this image' }
); );
%invoke = ( code => 'enabled = gimp_image_undo_is_enabled (gimage);' ); %invoke = (
code => <<'CODE'
{
enabled = gimp_image_undo_is_enabled (image);
}
CODE
);
} }
sub image_undo_disable { sub image_undo_disable {
@ -100,14 +120,23 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = ( @outargs = (
{ name => 'disabled', type => 'boolean', { name => 'disabled', type => 'boolean',
desc => 'True if the image undo has been disabled' } desc => 'True if the image undo has been disabled' }
); );
%invoke = ( code => 'disabled = gimp_image_undo_disable (gimage);' ); %invoke = (
code => <<'CODE'
{
disabled = gimp_image_undo_disable (image);
}
CODE
);
} }
sub image_undo_enable { sub image_undo_enable {
@ -121,14 +150,23 @@ HELP
&std_pdb_misc; &std_pdb_misc;
@inargs = ( &std_image_arg ); @inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = ( @outargs = (
{ name => 'enabled', type => 'boolean', { name => 'enabled', type => 'boolean',
desc => 'True if the image undo has been enabled' } desc => 'True if the image undo has been enabled' }
); );
%invoke = ( code => 'enabled = gimp_image_undo_enable (gimage);' ); %invoke = (
code => <<'CODE'
{
enabled = gimp_image_undo_enable (image);
}
CODE
);
} }
sub image_undo_freeze { sub image_undo_freeze {
@ -148,14 +186,23 @@ that the image is back to the same state it was frozen in before thawing, else
'undo' behaviour is undefined. 'undo' behaviour is undefined.
HELP HELP
@inargs = ( &std_image_arg ); @inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = ( @outargs = (
{ name => 'frozen', type => 'boolean', { name => 'frozen', type => 'boolean',
desc => 'True if the image undo has been frozen' } desc => 'True if the image undo has been frozen' }
); );
%invoke = ( code => 'frozen = gimp_image_undo_freeze (gimage);' ); %invoke = (
code => <<'CODE'
{
frozen = gimp_image_undo_freeze (image);
}
CODE
);
} }
sub image_undo_thaw { sub image_undo_thaw {
@ -175,15 +222,25 @@ in-situ plugin previews. Balancing freezes and thaws and ensuring image
consistancy is the responsibility of the caller. consistancy is the responsibility of the caller.
HELP HELP
@inargs = ( &std_image_arg ); @inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = ( @outargs = (
{ name => 'thawed', type => 'boolean', { name => 'thawed', type => 'boolean',
desc => 'True if the image undo has been thawed' } desc => 'True if the image undo has been thawed' }
); );
%invoke = ( code => 'thawed = gimp_image_undo_thaw (gimage);' ); %invoke = (
code => <<'CODE'
{
thawed = gimp_image_undo_thaw (image);
} }
CODE
);
}
@headers = qw("core/gimpimage-undo.h"); @headers = qw("core/gimpimage-undo.h");
@ -191,6 +248,7 @@ HELP
image_undo_is_enabled image_undo_is_enabled
image_undo_disable image_undo_enable image_undo_disable image_undo_enable
image_undo_freeze image_undo_thaw); image_undo_freeze image_undo_thaw);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Undo'; $desc = 'Undo';

View file

@ -61,7 +61,6 @@ CODE
); );
} }
sub unit_new { sub unit_new {
$blurb = "Creates a new unit and returns it's integer ID."; $blurb = "Creates a new unit and returns it's integer ID.";
@ -357,6 +356,7 @@ CODE
); );
} }
@headers = qw("libgimpbase/gimpbase.h" "core/gimpunit.h"); @headers = qw("libgimpbase/gimpbase.h" "core/gimpunit.h");
@procs = qw(unit_get_number_of_units unit_get_number_of_built_in_units @procs = qw(unit_get_number_of_units unit_get_number_of_built_in_units
@ -364,6 +364,7 @@ CODE
unit_get_identifier unit_get_factor unit_get_digits unit_get_identifier unit_get_factor unit_get_digits
unit_get_symbol unit_get_abbreviation unit_get_singular unit_get_symbol unit_get_abbreviation unit_get_singular
unit_get_plural); unit_get_plural);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Units'; $desc = 'Units';

View file

@ -26,7 +26,8 @@ HELP
&simon_pdb_misc('2005', '2.4'); &simon_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
&std_image_arg, { name => 'image', type => 'image',
desc => 'The image' },
{ name => 'name', type => 'string', { name => 'name', type => 'string',
desc => 'the name of the new vector object.' } desc => 'the name of the new vector object.' }
); );
@ -38,42 +39,14 @@ HELP
); );
%invoke = ( %invoke = (
code => <<"CODE" code => <<'CODE'
{ {
vectors = gimp_vectors_new (gimage, name); vectors = gimp_vectors_new (image, name);
} }
CODE CODE
); );
} }
sub vectors_get_current {
$blurb = 'Gets the current path in the given image.';
$help = 'Gets the current path in the given image.';
&simon_pdb_misc('2005', '2.4');
@inargs = (
&std_image_arg
);
$inargs[0]->{desc} = 'The ID of the image to get the current path from.';
@outargs = (
{ name => 'vectors', type => 'vectors',
desc => 'the current vector object, 0 if no vector exists
in the image.' }
);
%invoke = (
code => <<"CODE"
{
vectors = gimp_image_get_active_vectors (gimage);
}
CODE
);
}
sub vectors_get_image { sub vectors_get_image {
$blurb = 'Returns the vectors objects image.'; $blurb = 'Returns the vectors objects image.';
$help = 'Returns the vectors objects image.'; $help = 'Returns the vectors objects image.';
@ -99,10 +72,9 @@ CODE
); );
} }
sub vectors_get_name {
sub vectors_get_linked { $blurb = 'Gets the name of the vectors object.';
$blurb = 'Gets the linked state of the vectors object.'; $help = 'Gets the name of the vectors object.';
$help = 'Gets the linked state of the vectors object.';
&simon_pdb_misc('2005', '2.4'); &simon_pdb_misc('2005', '2.4');
@ -112,92 +84,41 @@ sub vectors_get_linked {
); );
@outargs = ( @outargs = (
{ name => 'linked', type => 'boolean', { name => 'name', type => 'string',
desc => 'TRUE if the path is linked, FALSE otherwise' } desc => 'The name of the vectors object' }
); );
%invoke = ( %invoke = (
code => <<"CODE" code => <<"CODE"
{ {
linked = gimp_item_get_linked (GIMP_ITEM (vectors)); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
} }
CODE CODE
); );
} }
sub vectors_set_name {
sub vectors_set_linked { $blurb = 'Sets the name of the vectors object.';
$blurb = 'Sets the linked state of the vectors object.'; $help = 'Sets the name of the vectors object.';
$help = 'Sets the linked state of the vectors object.';
&simon_pdb_misc('2005', '2.4'); &simon_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
{ name => 'vectors', type => 'vectors', { name => 'vectors', type => 'vectors',
desc => 'The vectors object' }, desc => 'The vectors object' },
{ name => 'linked', type => 'boolean', { name => 'name', type => 'string',
desc => 'Whether the path is linked' } desc => 'the new name of the path' }
); );
%invoke = ( %invoke = (
code => <<"CODE" code => <<"CODE"
{ {
gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE); success = gimp_item_rename (GIMP_ITEM (vectors), name);
} }
CODE CODE
); );
} }
sub vectors_get_tattoo {
$blurb = 'Get the tattoo of the vectors object.';
$help = 'Get the tattoo state of the vectors object.';
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = (
{ name => 'tattoo', type => 'int32',
desc => 'The vectors tattoo' }
);
%invoke = (
code => <<"CODE"
{
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
}
CODE
);
}
sub vectors_set_tattoo {
$blurb = 'Set the tattoo of the vectors object.';
$help = 'Set the tattoo of the vectors object.';
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'tattoo', type => 'int32',
desc => 'the new tattoo' }
);
%invoke = (
code => <<"CODE"
{
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
}
CODE
);
}
sub vectors_get_visible { sub vectors_get_visible {
$blurb = 'Gets the visibility of the vectors object.'; $blurb = 'Gets the visibility of the vectors object.';
$help = 'Gets the visibility of the vectors object.'; $help = 'Gets the visibility of the vectors object.';
@ -223,7 +144,6 @@ CODE
); );
} }
sub vectors_set_visible { sub vectors_set_visible {
$blurb = 'Sets the visibility of the vectors object.'; $blurb = 'Sets the visibility of the vectors object.';
$help = 'Sets the visibility of the vectors object.'; $help = 'Sets the visibility of the vectors object.';
@ -246,10 +166,9 @@ CODE
); );
} }
sub vectors_get_linked {
sub vectors_get_name { $blurb = 'Gets the linked state of the vectors object.';
$blurb = 'Gets the name of the vectors object.'; $help = 'Gets the linked state of the vectors object.';
$help = 'Gets the name of the vectors object.';
&simon_pdb_misc('2005', '2.4'); &simon_pdb_misc('2005', '2.4');
@ -259,43 +178,87 @@ sub vectors_get_name {
); );
@outargs = ( @outargs = (
{ name => 'name', type => 'string', { name => 'linked', type => 'boolean',
desc => 'The name of the vectors object' } desc => 'TRUE if the path is linked, FALSE otherwise' }
); );
%invoke = ( %invoke = (
code => <<"CODE" code => <<"CODE"
{ {
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors))); linked = gimp_item_get_linked (GIMP_ITEM (vectors));
} }
CODE CODE
); );
} }
sub vectors_set_linked {
sub vectors_set_name { $blurb = 'Sets the linked state of the vectors object.';
$blurb = 'Sets the name of the vectors object.'; $help = 'Sets the linked state of the vectors object.';
$help = 'Sets the name of the vectors object.';
&simon_pdb_misc('2005', '2.4'); &simon_pdb_misc('2005', '2.4');
@inargs = ( @inargs = (
{ name => 'vectors', type => 'vectors', { name => 'vectors', type => 'vectors',
desc => 'The vectors object' }, desc => 'The vectors object' },
{ name => 'name', type => 'string', { name => 'linked', type => 'boolean',
desc => 'the new name of the path' } desc => 'Whether the path is linked' }
); );
%invoke = ( %invoke = (
code => <<"CODE" code => <<"CODE"
{ {
if (!gimp_item_rename (GIMP_ITEM (vectors), name)) gimp_item_set_linked (GIMP_ITEM (vectors), linked, TRUE);
success = FALSE;
} }
CODE CODE
); );
} }
sub vectors_get_tattoo {
$blurb = 'Get the tattoo of the vectors object.';
$help = 'Get the tattoo state of the vectors object.';
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = (
{ name => 'tattoo', type => 'int32',
desc => 'The vectors tattoo' }
);
%invoke = (
code => <<"CODE"
{
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
}
CODE
);
}
sub vectors_set_tattoo {
$blurb = 'Set the tattoo of the vectors object.';
$help = 'Set the tattoo of the vectors object.';
&simon_pdb_misc('2005', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'tattoo', type => 'int32',
desc => 'the new tattoo' }
);
%invoke = (
code => <<"CODE"
{
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
}
CODE
);
}
sub vectors_get_strokes { sub vectors_get_strokes {
$blurb = 'List the strokes associated with the passed path.'; $blurb = 'List the strokes associated with the passed path.';
@ -343,7 +306,6 @@ CODE
); );
} }
sub vectors_stroke_get_length { sub vectors_stroke_get_length {
$blurb = 'Measure the length of the given stroke.'; $blurb = 'Measure the length of the given stroke.';
$help = 'Measure the length of the given stroke.'; $help = 'Measure the length of the given stroke.';
@ -378,7 +340,6 @@ CODE
); );
} }
sub vectors_stroke_get_point_at_dist { sub vectors_stroke_get_point_at_dist {
$blurb = 'Get point at a specified distance along the stroke.'; $blurb = 'Get point at a specified distance along the stroke.';
@ -437,7 +398,6 @@ CODE
); );
} }
sub vectors_stroke_remove { sub vectors_stroke_remove {
$blurb = 'remove the stroke from a vectors object.'; $blurb = 'remove the stroke from a vectors object.';
@ -468,7 +428,6 @@ CODE
); );
} }
sub vectors_stroke_close { sub vectors_stroke_close {
$blurb = 'closes the specified stroke.'; $blurb = 'closes the specified stroke.';
@ -883,11 +842,13 @@ CODE
"vectors/gimpvectors.h" "vectors/gimpvectors.h"
"gimp-intl.h"); "gimp-intl.h");
@procs = qw(vectors_new vectors_get_strokes vectors_get_image @procs = qw(vectors_new
vectors_get_linked vectors_set_linked vectors_get_image
vectors_get_visible vectors_set_visible
vectors_get_name vectors_set_name vectors_get_name vectors_set_name
vectors_get_visible vectors_set_visible
vectors_get_linked vectors_set_linked
vectors_get_tattoo vectors_set_tattoo vectors_get_tattoo vectors_set_tattoo
vectors_get_strokes
vectors_stroke_get_length vectors_stroke_get_length
vectors_stroke_get_point_at_dist vectors_stroke_get_point_at_dist
vectors_stroke_remove vectors_stroke_remove
@ -900,6 +861,7 @@ CODE
vectors_bezier_stroke_conicto vectors_bezier_stroke_conicto
vectors_bezier_stroke_cubicto vectors_bezier_stroke_cubicto
vectors_bezier_stroke_new_ellipse); vectors_bezier_stroke_new_ellipse);
%exports = (app => [@procs], lib => [@procs]); %exports = (app => [@procs], lib => [@procs]);
$desc = 'Paths'; $desc = 'Paths';

View file

@ -118,6 +118,10 @@ sub simon_pdb_misc {
contrib_pdb_misc('Simon Budig', '', @_); contrib_pdb_misc('Simon Budig', '', @_);
} }
sub sylvain_pdb_misc {
contrib_pdb_misc('Sylvain Foret', '', @_);
}
sub wolfgang_pdb_misc { sub wolfgang_pdb_misc {
contrib_pdb_misc('Wolfgang Hofer', '', @_); contrib_pdb_misc('Wolfgang Hofer', '', @_);
} }
@ -137,21 +141,4 @@ sub std_pdb_deprecated {
$author = $copyright = $date = ''; $author = $copyright = $date = '';
} }
sub std_image_arg () {{
name => 'image',
type => 'image',
desc => 'The image',
alias => 'gimage'
}}
sub std_antialias_arg () {{
name => 'antialias',
type => 'boolean',
desc => 'Antialiasing (%%desc%%)'
}}
sub std_orientation_enum () {
'enum GimpOrientationType (no GIMP_ORIENTATION_UNKNOWN)'
}
1; 1;