reordered vectors procedures.

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

	* tools/pdbgen/pdb/image.pdb: reordered vectors procedures.

	* tools/pdbgen/pdb/parasite.pdb: removed all utility functions
	and added parasite procedures for vectors.

	* tools/pdbgen/pdb/paths.pdb: removed get_visible() and
	set_visible(), deprecated all procedures that are already
	implemented in the vectors namespace.

	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/vectors.pdb: minor cleanup.

	* libgimp/gimp.def: changed accordingly.

	* app/pdb/channel_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/parasite_cmds.c
	* app/pdb/paths_cmds.c
	* app/pdb/vectors_cmds.c
	* libgimp/gimpimage_pdb.[ch]
	* libgimp/gimpparasite_pdb.[ch]
	* libgimp/gimppaths_pdb.[ch]
	* libgimp/gimpvectors_pdb.c: regenerated.
This commit is contained in:
Michael Natterer 2006-03-22 12:15:06 +00:00 committed by Michael Natterer
parent 2368a6a380
commit de7546f5c0
20 changed files with 1882 additions and 1459 deletions

View File

@ -1,3 +1,30 @@
2006-03-22 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/image.pdb: reordered vectors procedures.
* tools/pdbgen/pdb/parasite.pdb: removed all utility functions
and added parasite procedures for vectors.
* tools/pdbgen/pdb/paths.pdb: removed get_visible() and
set_visible(), deprecated all procedures that are already
implemented in the vectors namespace.
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/vectors.pdb: minor cleanup.
* libgimp/gimp.def: changed accordingly.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c
* app/pdb/internal_procs.c
* app/pdb/parasite_cmds.c
* app/pdb/paths_cmds.c
* app/pdb/vectors_cmds.c
* libgimp/gimpimage_pdb.[ch]
* libgimp/gimpparasite_pdb.[ch]
* libgimp/gimppaths_pdb.[ch]
* libgimp/gimpvectors_pdb.c: regenerated.
2006-03-22 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.h: export GimpBrushGeneratedShape to the PDB.

View File

@ -284,7 +284,9 @@ channel_copy_invoker (Gimp *gimp,
{
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
G_TYPE_FROM_INSTANCE (channel), FALSE));
success = (channel_copy != NULL);
if (! channel_copy)
success = FALSE;
}
return_args = procedural_db_return_args (&channel_copy_proc, success);

View File

@ -82,16 +82,16 @@ static ProcRecord image_raise_layer_proc;
static ProcRecord image_lower_layer_proc;
static ProcRecord image_raise_layer_to_top_proc;
static ProcRecord image_lower_layer_to_bottom_proc;
static ProcRecord image_add_channel_proc;
static ProcRecord image_remove_channel_proc;
static ProcRecord image_raise_channel_proc;
static ProcRecord image_lower_channel_proc;
static ProcRecord image_add_vectors_proc;
static ProcRecord image_remove_vectors_proc;
static ProcRecord image_raise_vectors_proc;
static ProcRecord image_lower_vectors_proc;
static ProcRecord image_raise_vectors_to_top_proc;
static ProcRecord image_lower_vectors_to_bottom_proc;
static ProcRecord image_add_channel_proc;
static ProcRecord image_remove_channel_proc;
static ProcRecord image_add_vectors_proc;
static ProcRecord image_remove_vectors_proc;
static ProcRecord image_raise_channel_proc;
static ProcRecord image_lower_channel_proc;
static ProcRecord image_flatten_proc;
static ProcRecord image_merge_visible_layers_proc;
static ProcRecord image_merge_down_proc;
@ -158,16 +158,16 @@ register_image_procs (Gimp *gimp)
procedural_db_register (gimp, &image_lower_layer_proc);
procedural_db_register (gimp, &image_raise_layer_to_top_proc);
procedural_db_register (gimp, &image_lower_layer_to_bottom_proc);
procedural_db_register (gimp, &image_add_channel_proc);
procedural_db_register (gimp, &image_remove_channel_proc);
procedural_db_register (gimp, &image_raise_channel_proc);
procedural_db_register (gimp, &image_lower_channel_proc);
procedural_db_register (gimp, &image_add_vectors_proc);
procedural_db_register (gimp, &image_remove_vectors_proc);
procedural_db_register (gimp, &image_raise_vectors_proc);
procedural_db_register (gimp, &image_lower_vectors_proc);
procedural_db_register (gimp, &image_raise_vectors_to_top_proc);
procedural_db_register (gimp, &image_lower_vectors_to_bottom_proc);
procedural_db_register (gimp, &image_add_channel_proc);
procedural_db_register (gimp, &image_remove_channel_proc);
procedural_db_register (gimp, &image_add_vectors_proc);
procedural_db_register (gimp, &image_remove_vectors_proc);
procedural_db_register (gimp, &image_raise_channel_proc);
procedural_db_register (gimp, &image_lower_channel_proc);
procedural_db_register (gimp, &image_flatten_proc);
procedural_db_register (gimp, &image_merge_visible_layers_proc);
procedural_db_register (gimp, &image_merge_down_proc);
@ -2220,6 +2220,373 @@ static ProcRecord image_lower_layer_to_bottom_proc =
{ { image_lower_layer_to_bottom_invoker } }
};
static Argument *
image_add_channel_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpChannel *channel;
gint32 position;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
success = FALSE;
position = args[2].value.pdb_int;
if (success)
{
success = gimp_item_is_floating (GIMP_ITEM (channel));
if (success)
success = gimp_image_add_channel (gimage, channel, MAX (position, -1));
}
return procedural_db_return_args (&image_add_channel_proc, success);
}
static ProcArg image_add_channel_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_CHANNEL,
"channel",
"The channel"
},
{
GIMP_PDB_INT32,
"position",
"The channel position"
}
};
static ProcRecord image_add_channel_proc =
{
"gimp-image-add-channel",
"gimp-image-add-channel",
"Add the specified channel to the image.",
"This procedure adds the specified channel to the image. The position channel is not currently used, so the channel is always inserted at the top of the channel stack.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
3,
image_add_channel_inargs,
0,
NULL,
{ { image_add_channel_invoker } }
};
static Argument *
image_remove_channel_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpChannel *channel;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
success = FALSE;
if (success)
{
gimp_image_remove_channel (gimage, channel);
}
return procedural_db_return_args (&image_remove_channel_proc, success);
}
static ProcArg image_remove_channel_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_CHANNEL,
"channel",
"The channel"
}
};
static ProcRecord image_remove_channel_proc =
{
"gimp-image-remove-channel",
"gimp-image-remove-channel",
"Remove the specified channel from the image.",
"This procedure removes the specified channel from the image. If the channel doesn't exist, an error is returned.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
2,
image_remove_channel_inargs,
0,
NULL,
{ { image_remove_channel_invoker } }
};
static Argument *
image_raise_channel_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpChannel *channel;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
success = FALSE;
if (success)
{
success = gimp_image_raise_channel (gimage, channel);
}
return procedural_db_return_args (&image_raise_channel_proc, success);
}
static ProcArg image_raise_channel_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_CHANNEL,
"channel",
"The channel to raise"
}
};
static ProcRecord image_raise_channel_proc =
{
"gimp-image-raise-channel",
"gimp-image-raise-channel",
"Raise the specified channel in the image's channel stack",
"This procedure raises the specified channel one step in the existing channel stack. It will not move the channel if there is no channel above it.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
2,
image_raise_channel_inargs,
0,
NULL,
{ { image_raise_channel_invoker } }
};
static Argument *
image_lower_channel_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpChannel *channel;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
success = FALSE;
if (success)
{
success = gimp_image_lower_channel (gimage, channel);
}
return procedural_db_return_args (&image_lower_channel_proc, success);
}
static ProcArg image_lower_channel_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_CHANNEL,
"channel",
"The channel to lower"
}
};
static ProcRecord image_lower_channel_proc =
{
"gimp-image-lower-channel",
"gimp-image-lower-channel",
"Lower the specified channel in the image's channel stack",
"This procedure lowers the specified channel one step in the existing channel stack. It will not move the channel if there is no channel below it.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
2,
image_lower_channel_inargs,
0,
NULL,
{ { image_lower_channel_invoker } }
};
static Argument *
image_add_vectors_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpVectors *vectors;
gint32 position;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
success = FALSE;
position = args[2].value.pdb_int;
if (success)
{
success = gimp_image_add_vectors (gimage, vectors, MAX (position, -1));
}
return procedural_db_return_args (&image_add_vectors_proc, success);
}
static ProcArg image_add_vectors_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
},
{
GIMP_PDB_INT32,
"position",
"The vectors objects position"
}
};
static ProcRecord image_add_vectors_proc =
{
"gimp-image-add-vectors",
"gimp-image-add-vectors",
"Add the specified vectors object to the image.",
"This procedure adds the specified vectors object to the gimage at the given position. If the position is specified as -1, then the vectors object is inserted at the top of the vectors stack.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
3,
image_add_vectors_inargs,
0,
NULL,
{ { image_add_vectors_invoker } }
};
static Argument *
image_remove_vectors_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
success = FALSE;
if (success)
{
gimp_image_remove_vectors (gimage, vectors);
}
return procedural_db_return_args (&image_remove_vectors_proc, success);
}
static ProcArg image_remove_vectors_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
}
};
static ProcRecord image_remove_vectors_proc =
{
"gimp-image-remove-vectors",
"gimp-image-remove-vectors",
"Remove the specified path from the image.",
"This procedure removes the specified path from the image. If the path doesn't exist, an error is returned.",
"Simon Budig",
"Simon Budig",
"2005",
NULL,
GIMP_INTERNAL,
2,
image_remove_vectors_inargs,
0,
NULL,
{ { image_remove_vectors_invoker } }
};
static Argument *
image_raise_vectors_invoker (Gimp *gimp,
GimpContext *context,
@ -2452,373 +2819,6 @@ static ProcRecord image_lower_vectors_to_bottom_proc =
{ { image_lower_vectors_to_bottom_invoker } }
};
static Argument *
image_add_channel_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpChannel *channel;
gint32 position;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
success = FALSE;
position = args[2].value.pdb_int;
if (success)
{
success = gimp_item_is_floating (GIMP_ITEM (channel));
if (success)
success = gimp_image_add_channel (gimage, channel, MAX (position, -1));
}
return procedural_db_return_args (&image_add_channel_proc, success);
}
static ProcArg image_add_channel_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_CHANNEL,
"channel",
"The channel"
},
{
GIMP_PDB_INT32,
"position",
"The channel position"
}
};
static ProcRecord image_add_channel_proc =
{
"gimp-image-add-channel",
"gimp-image-add-channel",
"Add the specified channel to the image.",
"This procedure adds the specified channel to the image. The position channel is not currently used, so the channel is always inserted at the top of the channel stack.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
3,
image_add_channel_inargs,
0,
NULL,
{ { image_add_channel_invoker } }
};
static Argument *
image_remove_channel_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpChannel *channel;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
success = FALSE;
if (success)
{
gimp_image_remove_channel (gimage, channel);
}
return procedural_db_return_args (&image_remove_channel_proc, success);
}
static ProcArg image_remove_channel_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_CHANNEL,
"channel",
"The channel"
}
};
static ProcRecord image_remove_channel_proc =
{
"gimp-image-remove-channel",
"gimp-image-remove-channel",
"Remove the specified channel from the image.",
"This procedure removes the specified channel from the image. If the channel doesn't exist, an error is returned.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
2,
image_remove_channel_inargs,
0,
NULL,
{ { image_remove_channel_invoker } }
};
static Argument *
image_add_vectors_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpVectors *vectors;
gint32 position;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
success = FALSE;
position = args[2].value.pdb_int;
if (success)
{
success = gimp_image_add_vectors (gimage, vectors, MAX (position, -1));
}
return procedural_db_return_args (&image_add_vectors_proc, success);
}
static ProcArg image_add_vectors_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
},
{
GIMP_PDB_INT32,
"position",
"The vectors objects position"
}
};
static ProcRecord image_add_vectors_proc =
{
"gimp-image-add-vectors",
"gimp-image-add-vectors",
"Add the specified vectors object to the image.",
"This procedure adds the specified vectors object to the gimage at the given position. If the position is specified as -1, then the vectors object is inserted at the top of the vectors stack.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
3,
image_add_vectors_inargs,
0,
NULL,
{ { image_add_vectors_invoker } }
};
static Argument *
image_remove_vectors_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpVectors *vectors;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
vectors = (GimpVectors *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_VECTORS (vectors) && ! gimp_item_is_removed (GIMP_ITEM (vectors))))
success = FALSE;
if (success)
{
gimp_image_remove_vectors (gimage, vectors);
}
return procedural_db_return_args (&image_remove_vectors_proc, success);
}
static ProcArg image_remove_vectors_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
}
};
static ProcRecord image_remove_vectors_proc =
{
"gimp-image-remove-vectors",
"gimp-image-remove-vectors",
"Remove the specified path from the image.",
"This procedure removes the specified path from the image. If the path doesn't exist, an error is returned.",
"Simon Budig",
"Simon Budig",
"2005",
NULL,
GIMP_INTERNAL,
2,
image_remove_vectors_inargs,
0,
NULL,
{ { image_remove_vectors_invoker } }
};
static Argument *
image_raise_channel_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpChannel *channel;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
success = FALSE;
if (success)
{
success = gimp_image_raise_channel (gimage, channel);
}
return procedural_db_return_args (&image_raise_channel_proc, success);
}
static ProcArg image_raise_channel_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_CHANNEL,
"channel",
"The channel to raise"
}
};
static ProcRecord image_raise_channel_proc =
{
"gimp-image-raise-channel",
"gimp-image-raise-channel",
"Raise the specified channel in the image's channel stack",
"This procedure raises the specified channel one step in the existing channel stack. It will not move the channel if there is no channel above it.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
2,
image_raise_channel_inargs,
0,
NULL,
{ { image_raise_channel_invoker } }
};
static Argument *
image_lower_channel_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
GimpChannel *channel;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
success = FALSE;
if (success)
{
success = gimp_image_lower_channel (gimage, channel);
}
return procedural_db_return_args (&image_lower_channel_proc, success);
}
static ProcArg image_lower_channel_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_CHANNEL,
"channel",
"The channel to lower"
}
};
static ProcRecord image_lower_channel_proc =
{
"gimp-image-lower-channel",
"gimp-image-lower-channel",
"Lower the specified channel in the image's channel stack",
"This procedure lowers the specified channel one step in the existing channel stack. It will not move the channel if there is no channel below it.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
2,
image_lower_channel_inargs,
0,
NULL,
{ { image_lower_channel_invoker } }
};
static Argument *
image_flatten_invoker (Gimp *gimp,
GimpContext *context,

View File

@ -75,7 +75,7 @@ void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
void register_vectors_procs (Gimp *gimp);
/* 523 procedures registered total */
/* 525 procedures registered total */
void
internal_procs_init (Gimp *gimp)

View File

@ -31,19 +31,24 @@
#include "core/gimp-parasites.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "vectors/gimpvectors.h"
static ProcRecord parasite_find_proc;
static ProcRecord parasite_attach_proc;
static ProcRecord parasite_detach_proc;
static ProcRecord parasite_list_proc;
static ProcRecord drawable_parasite_find_proc;
static ProcRecord drawable_parasite_attach_proc;
static ProcRecord drawable_parasite_detach_proc;
static ProcRecord drawable_parasite_list_proc;
static ProcRecord image_parasite_find_proc;
static ProcRecord image_parasite_attach_proc;
static ProcRecord image_parasite_detach_proc;
static ProcRecord image_parasite_list_proc;
static ProcRecord drawable_parasite_find_proc;
static ProcRecord drawable_parasite_attach_proc;
static ProcRecord drawable_parasite_detach_proc;
static ProcRecord drawable_parasite_list_proc;
static ProcRecord vectors_parasite_find_proc;
static ProcRecord vectors_parasite_attach_proc;
static ProcRecord vectors_parasite_detach_proc;
static ProcRecord vectors_parasite_list_proc;
void
register_parasite_procs (Gimp *gimp)
@ -52,14 +57,18 @@ register_parasite_procs (Gimp *gimp)
procedural_db_register (gimp, &parasite_attach_proc);
procedural_db_register (gimp, &parasite_detach_proc);
procedural_db_register (gimp, &parasite_list_proc);
procedural_db_register (gimp, &drawable_parasite_find_proc);
procedural_db_register (gimp, &drawable_parasite_attach_proc);
procedural_db_register (gimp, &drawable_parasite_detach_proc);
procedural_db_register (gimp, &drawable_parasite_list_proc);
procedural_db_register (gimp, &image_parasite_find_proc);
procedural_db_register (gimp, &image_parasite_attach_proc);
procedural_db_register (gimp, &image_parasite_detach_proc);
procedural_db_register (gimp, &image_parasite_list_proc);
procedural_db_register (gimp, &drawable_parasite_find_proc);
procedural_db_register (gimp, &drawable_parasite_attach_proc);
procedural_db_register (gimp, &drawable_parasite_detach_proc);
procedural_db_register (gimp, &drawable_parasite_list_proc);
procedural_db_register (gimp, &vectors_parasite_find_proc);
procedural_db_register (gimp, &vectors_parasite_attach_proc);
procedural_db_register (gimp, &vectors_parasite_detach_proc);
procedural_db_register (gimp, &vectors_parasite_list_proc);
}
static Argument *
@ -80,7 +89,9 @@ parasite_find_invoker (Gimp *gimp,
if (success)
{
parasite = gimp_parasite_copy (gimp_parasite_find (gimp, name));
success = parasite != NULL;
if (! parasite)
success = FALSE;
}
return_args = procedural_db_return_args (&parasite_find_proc, success);
@ -141,7 +152,9 @@ parasite_attach_invoker (Gimp *gimp,
success = FALSE;
if (success)
gimp_parasite_attach (gimp, parasite);
{
gimp_parasite_attach (gimp, parasite);
}
return procedural_db_return_args (&parasite_attach_proc, success);
}
@ -187,7 +200,9 @@ parasite_detach_invoker (Gimp *gimp,
success = FALSE;
if (success)
gimp_parasite_detach (gimp, name);
{
gimp_parasite_detach (gimp, name);
}
return procedural_db_return_args (&parasite_detach_proc, success);
}
@ -271,264 +286,6 @@ static ProcRecord parasite_list_proc =
{ { parasite_list_invoker } }
};
static Argument *
drawable_parasite_find_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
gchar *name;
GimpParasite *parasite = NULL;
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))))
success = FALSE;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
{
parasite = gimp_parasite_copy (gimp_item_parasite_find (GIMP_ITEM (drawable), name));
success = parasite != NULL;
}
return_args = procedural_db_return_args (&drawable_parasite_find_proc, success);
if (success)
return_args[1].value.pdb_pointer = parasite;
return return_args;
}
static ProcArg drawable_parasite_find_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
},
{
GIMP_PDB_STRING,
"name",
"The name of the parasite to find"
}
};
static ProcArg drawable_parasite_find_outargs[] =
{
{
GIMP_PDB_PARASITE,
"parasite",
"The found parasite"
}
};
static ProcRecord drawable_parasite_find_proc =
{
"gimp-drawable-parasite-find",
"gimp-drawable-parasite-find",
"Finds the named parasite in a drawable",
"Finds and returns the named parasite that was previously attached to a drawable.",
"Jay Cox",
"Jay Cox",
"1998",
NULL,
GIMP_INTERNAL,
2,
drawable_parasite_find_inargs,
1,
drawable_parasite_find_outargs,
{ { drawable_parasite_find_invoker } }
};
static Argument *
drawable_parasite_attach_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
GimpParasite *parasite;
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))))
success = FALSE;
parasite = (GimpParasite *) args[1].value.pdb_pointer;
if (parasite == NULL || parasite->name == NULL || !g_utf8_validate (parasite->name, -1, NULL))
success = FALSE;
if (success)
gimp_item_parasite_attach (GIMP_ITEM (drawable), parasite);
return procedural_db_return_args (&drawable_parasite_attach_proc, success);
}
static ProcArg drawable_parasite_attach_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
},
{
GIMP_PDB_PARASITE,
"parasite",
"The parasite to attach to a drawable"
}
};
static ProcRecord drawable_parasite_attach_proc =
{
"gimp-drawable-parasite-attach",
"gimp-drawable-parasite-attach",
"Add a parasite to a drawable.",
"This procedure attaches a parasite to a drawable. It has no return values.",
"Jay Cox",
"Jay Cox",
"1998",
NULL,
GIMP_INTERNAL,
2,
drawable_parasite_attach_inargs,
0,
NULL,
{ { drawable_parasite_attach_invoker } }
};
static Argument *
drawable_parasite_detach_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gchar *name;
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))))
success = FALSE;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
gimp_item_parasite_detach (GIMP_ITEM (drawable), name);
return procedural_db_return_args (&drawable_parasite_detach_proc, success);
}
static ProcArg drawable_parasite_detach_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
},
{
GIMP_PDB_STRING,
"name",
"The name of the parasite to detach from a drawable."
}
};
static ProcRecord drawable_parasite_detach_proc =
{
"gimp-drawable-parasite-detach",
"gimp-drawable-parasite-detach",
"Removes a parasite from a drawable.",
"This procedure detaches a parasite from a drawable. It has no return values.",
"Jay Cox",
"Jay Cox",
"1998",
NULL,
GIMP_INTERNAL,
2,
drawable_parasite_detach_inargs,
0,
NULL,
{ { drawable_parasite_detach_invoker } }
};
static Argument *
drawable_parasite_list_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
gint32 num_parasites = 0;
gchar **parasites = NULL;
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))))
success = FALSE;
if (success)
parasites = gimp_item_parasite_list (GIMP_ITEM (drawable), &num_parasites);
return_args = procedural_db_return_args (&drawable_parasite_list_proc, success);
if (success)
{
return_args[1].value.pdb_int = num_parasites;
return_args[2].value.pdb_pointer = parasites;
}
return return_args;
}
static ProcArg drawable_parasite_list_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
}
};
static ProcArg drawable_parasite_list_outargs[] =
{
{
GIMP_PDB_INT32,
"num-parasites",
"The number of attached parasites"
},
{
GIMP_PDB_STRINGARRAY,
"parasites",
"The names of currently attached parasites"
}
};
static ProcRecord drawable_parasite_list_proc =
{
"gimp-drawable-parasite-list",
"gimp-drawable-parasite-list",
"List all parasites.",
"Returns a list of all currently attached parasites.",
"Marc Lehmann",
"Marc Lehmann",
"1999",
NULL,
GIMP_INTERNAL,
1,
drawable_parasite_list_inargs,
2,
drawable_parasite_list_outargs,
{ { drawable_parasite_list_invoker } }
};
static Argument *
image_parasite_find_invoker (Gimp *gimp,
GimpContext *context,
@ -552,7 +309,9 @@ image_parasite_find_invoker (Gimp *gimp,
if (success)
{
parasite = gimp_parasite_copy (gimp_image_parasite_find (gimage, name));
success = parasite != NULL;
if (! parasite)
success = FALSE;
}
return_args = procedural_db_return_args (&image_parasite_find_proc, success);
@ -623,7 +382,9 @@ image_parasite_attach_invoker (Gimp *gimp,
success = FALSE;
if (success)
gimp_image_parasite_attach (gimage, parasite);
{
gimp_image_parasite_attach (gimage, parasite);
}
return procedural_db_return_args (&image_parasite_attach_proc, success);
}
@ -679,7 +440,9 @@ image_parasite_detach_invoker (Gimp *gimp,
success = FALSE;
if (success)
gimp_image_parasite_detach (gimage, name);
{
gimp_image_parasite_detach (gimage, name);
}
return procedural_db_return_args (&image_parasite_detach_proc, success);
}
@ -733,7 +496,9 @@ image_parasite_list_invoker (Gimp *gimp,
success = FALSE;
if (success)
parasites = gimp_image_parasite_list (gimage, &num_parasites);
{
parasites = gimp_image_parasite_list (gimage, &num_parasites);
}
return_args = procedural_db_return_args (&image_parasite_list_proc, success);
@ -786,3 +551,537 @@ static ProcRecord image_parasite_list_proc =
image_parasite_list_outargs,
{ { image_parasite_list_invoker } }
};
static Argument *
drawable_parasite_find_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
gchar *name;
GimpParasite *parasite = NULL;
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))))
success = FALSE;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
{
parasite = gimp_parasite_copy (gimp_item_parasite_find (GIMP_ITEM (drawable),
name));
if (! parasite)
success = FALSE;
}
return_args = procedural_db_return_args (&drawable_parasite_find_proc, success);
if (success)
return_args[1].value.pdb_pointer = parasite;
return return_args;
}
static ProcArg drawable_parasite_find_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
},
{
GIMP_PDB_STRING,
"name",
"The name of the parasite to find"
}
};
static ProcArg drawable_parasite_find_outargs[] =
{
{
GIMP_PDB_PARASITE,
"parasite",
"The found parasite"
}
};
static ProcRecord drawable_parasite_find_proc =
{
"gimp-drawable-parasite-find",
"gimp-drawable-parasite-find",
"Finds the named parasite in a drawable",
"Finds and returns the named parasite that was previously attached to a drawable.",
"Jay Cox",
"Jay Cox",
"1998",
NULL,
GIMP_INTERNAL,
2,
drawable_parasite_find_inargs,
1,
drawable_parasite_find_outargs,
{ { drawable_parasite_find_invoker } }
};
static Argument *
drawable_parasite_attach_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
GimpParasite *parasite;
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))))
success = FALSE;
parasite = (GimpParasite *) args[1].value.pdb_pointer;
if (parasite == NULL || parasite->name == NULL || !g_utf8_validate (parasite->name, -1, NULL))
success = FALSE;
if (success)
{
gimp_item_parasite_attach (GIMP_ITEM (drawable), parasite);
}
return procedural_db_return_args (&drawable_parasite_attach_proc, success);
}
static ProcArg drawable_parasite_attach_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
},
{
GIMP_PDB_PARASITE,
"parasite",
"The parasite to attach to a drawable"
}
};
static ProcRecord drawable_parasite_attach_proc =
{
"gimp-drawable-parasite-attach",
"gimp-drawable-parasite-attach",
"Add a parasite to a drawable.",
"This procedure attaches a parasite to a drawable. It has no return values.",
"Jay Cox",
"Jay Cox",
"1998",
NULL,
GIMP_INTERNAL,
2,
drawable_parasite_attach_inargs,
0,
NULL,
{ { drawable_parasite_attach_invoker } }
};
static Argument *
drawable_parasite_detach_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
gchar *name;
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))))
success = FALSE;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
{
gimp_item_parasite_detach (GIMP_ITEM (drawable), name);
}
return procedural_db_return_args (&drawable_parasite_detach_proc, success);
}
static ProcArg drawable_parasite_detach_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
},
{
GIMP_PDB_STRING,
"name",
"The name of the parasite to detach from a drawable."
}
};
static ProcRecord drawable_parasite_detach_proc =
{
"gimp-drawable-parasite-detach",
"gimp-drawable-parasite-detach",
"Removes a parasite from a drawable.",
"This procedure detaches a parasite from a drawable. It has no return values.",
"Jay Cox",
"Jay Cox",
"1998",
NULL,
GIMP_INTERNAL,
2,
drawable_parasite_detach_inargs,
0,
NULL,
{ { drawable_parasite_detach_invoker } }
};
static Argument *
drawable_parasite_list_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpDrawable *drawable;
gint32 num_parasites = 0;
gchar **parasites = NULL;
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))))
success = FALSE;
if (success)
{
parasites = gimp_item_parasite_list (GIMP_ITEM (drawable), &num_parasites);
}
return_args = procedural_db_return_args (&drawable_parasite_list_proc, success);
if (success)
{
return_args[1].value.pdb_int = num_parasites;
return_args[2].value.pdb_pointer = parasites;
}
return return_args;
}
static ProcArg drawable_parasite_list_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
}
};
static ProcArg drawable_parasite_list_outargs[] =
{
{
GIMP_PDB_INT32,
"num-parasites",
"The number of attached parasites"
},
{
GIMP_PDB_STRINGARRAY,
"parasites",
"The names of currently attached parasites"
}
};
static ProcRecord drawable_parasite_list_proc =
{
"gimp-drawable-parasite-list",
"gimp-drawable-parasite-list",
"List all parasites.",
"Returns a list of all currently attached parasites.",
"Marc Lehmann",
"Marc Lehmann",
"1999",
NULL,
GIMP_INTERNAL,
1,
drawable_parasite_list_inargs,
2,
drawable_parasite_list_outargs,
{ { drawable_parasite_list_invoker } }
};
static Argument *
vectors_parasite_find_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpVectors *vectors;
gchar *name;
GimpParasite *parasite = 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;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
{
parasite = gimp_parasite_copy (gimp_item_parasite_find (GIMP_ITEM (vectors),
name));
if (! parasite)
success = FALSE;
}
return_args = procedural_db_return_args (&vectors_parasite_find_proc, success);
if (success)
return_args[1].value.pdb_pointer = parasite;
return return_args;
}
static ProcArg vectors_parasite_find_inargs[] =
{
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
},
{
GIMP_PDB_STRING,
"name",
"The name of the parasite to find"
}
};
static ProcArg vectors_parasite_find_outargs[] =
{
{
GIMP_PDB_PARASITE,
"parasite",
"The found parasite"
}
};
static ProcRecord vectors_parasite_find_proc =
{
"gimp-vectors-parasite-find",
"gimp-vectors-parasite-find",
"Finds the named parasite in a vectors object",
"Finds and returns the named parasite that was previously attached to a vectors object.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer",
"2006",
NULL,
GIMP_INTERNAL,
2,
vectors_parasite_find_inargs,
1,
vectors_parasite_find_outargs,
{ { vectors_parasite_find_invoker } }
};
static Argument *
vectors_parasite_attach_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpVectors *vectors;
GimpParasite *parasite;
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;
parasite = (GimpParasite *) args[1].value.pdb_pointer;
if (parasite == NULL || parasite->name == NULL || !g_utf8_validate (parasite->name, -1, NULL))
success = FALSE;
if (success)
{
gimp_item_parasite_attach (GIMP_ITEM (vectors), parasite);
}
return procedural_db_return_args (&vectors_parasite_attach_proc, success);
}
static ProcArg vectors_parasite_attach_inargs[] =
{
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
},
{
GIMP_PDB_PARASITE,
"parasite",
"The parasite to attach to a vectors object"
}
};
static ProcRecord vectors_parasite_attach_proc =
{
"gimp-vectors-parasite-attach",
"gimp-vectors-parasite-attach",
"Add a parasite to a vectors object",
"This procedure attaches a parasite to a vectors object. It has no return values.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer",
"2006",
NULL,
GIMP_INTERNAL,
2,
vectors_parasite_attach_inargs,
0,
NULL,
{ { vectors_parasite_attach_invoker } }
};
static Argument *
vectors_parasite_detach_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpVectors *vectors;
gchar *name;
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;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
{
gimp_item_parasite_detach (GIMP_ITEM (vectors), name);
}
return procedural_db_return_args (&vectors_parasite_detach_proc, success);
}
static ProcArg vectors_parasite_detach_inargs[] =
{
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
},
{
GIMP_PDB_STRING,
"name",
"The name of the parasite to detach from a vectors object."
}
};
static ProcRecord vectors_parasite_detach_proc =
{
"gimp-vectors-parasite-detach",
"gimp-vectors-parasite-detach",
"Removes a parasite from a vectors object",
"This procedure detaches a parasite from a vectors object. It has no return values.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer",
"2006",
NULL,
GIMP_INTERNAL,
2,
vectors_parasite_detach_inargs,
0,
NULL,
{ { vectors_parasite_detach_invoker } }
};
static Argument *
vectors_parasite_list_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpVectors *vectors;
gint32 num_parasites = 0;
gchar **parasites = 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)
{
parasites = gimp_item_parasite_list (GIMP_ITEM (vectors), &num_parasites);
}
return_args = procedural_db_return_args (&vectors_parasite_list_proc, success);
if (success)
{
return_args[1].value.pdb_int = num_parasites;
return_args[2].value.pdb_pointer = parasites;
}
return return_args;
}
static ProcArg vectors_parasite_list_inargs[] =
{
{
GIMP_PDB_VECTORS,
"vectors",
"The vectors object"
}
};
static ProcArg vectors_parasite_list_outargs[] =
{
{
GIMP_PDB_INT32,
"num-parasites",
"The number of attached parasites"
},
{
GIMP_PDB_STRINGARRAY,
"parasites",
"The names of currently attached parasites"
}
};
static ProcRecord vectors_parasite_list_proc =
{
"gimp-vectors-parasite-list",
"gimp-vectors-parasite-list",
"List all parasites.",
"Returns a list of all currently attached parasites.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer",
"2006",
NULL,
GIMP_INTERNAL,
1,
vectors_parasite_list_inargs,
2,
vectors_parasite_list_outargs,
{ { vectors_parasite_list_invoker } }
};

View File

@ -52,8 +52,6 @@ static ProcRecord path_set_tattoo_proc;
static ProcRecord get_path_by_tattoo_proc;
static ProcRecord path_get_locked_proc;
static ProcRecord path_set_locked_proc;
static ProcRecord path_get_visible_proc;
static ProcRecord path_set_visible_proc;
static ProcRecord path_to_selection_proc;
static ProcRecord path_import_proc;
static ProcRecord path_import_string_proc;
@ -74,8 +72,6 @@ register_paths_procs (Gimp *gimp)
procedural_db_register (gimp, &get_path_by_tattoo_proc);
procedural_db_register (gimp, &path_get_locked_proc);
procedural_db_register (gimp, &path_set_locked_proc);
procedural_db_register (gimp, &path_get_visible_proc);
procedural_db_register (gimp, &path_set_visible_proc);
procedural_db_register (gimp, &path_to_selection_proc);
procedural_db_register (gimp, &path_import_proc);
procedural_db_register (gimp, &path_import_string_proc);
@ -140,12 +136,12 @@ static ProcRecord path_list_proc =
{
"gimp-path-list",
"gimp-path-list",
"List the paths associated with the passed image.",
"List the paths associated with the passed image.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-image-get-vectors' instead.",
"This procedure is deprecated! Use 'gimp-image-get-vectors' instead.",
"",
"",
"",
"gimp-image-get-vectors",
GIMP_INTERNAL,
1,
path_list_inargs,
@ -209,12 +205,12 @@ static ProcRecord path_get_current_proc =
{
"gimp-path-get-current",
"gimp-path-get-current",
"The name of the current path. Error if no paths.",
"The name of the current path. Error if no paths.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-image-get-active-vectors' instead.",
"This procedure is deprecated! Use 'gimp-image-get-active-vectors' instead.",
"",
"",
"",
"gimp-image-get-active-vectors",
GIMP_INTERNAL,
1,
path_get_current_inargs,
@ -272,12 +268,12 @@ static ProcRecord path_set_current_proc =
{
"gimp-path-set-current",
"gimp-path-set-current",
"Sets the current path associated with the passed image.",
"Sets a named path as the current path.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-image-set-active-vectors' instead.",
"This procedure is deprecated! Use 'gimp-image-set-active-vectors' instead.",
"",
"",
"",
"gimp-image-set-active-vectors",
GIMP_INTERNAL,
2,
path_set_current_inargs,
@ -335,12 +331,12 @@ static ProcRecord path_delete_proc =
{
"gimp-path-delete",
"gimp-path-delete",
"Delete the named path associated with the passed image.",
"Delete the named path.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-image-remove-vectors' instead.",
"This procedure is deprecated! Use 'gimp-image-remove-vectors' instead.",
"",
"",
"",
"gimp-image-remove-vectors",
GIMP_INTERNAL,
2,
path_delete_inargs,
@ -867,12 +863,12 @@ static ProcRecord path_get_tattoo_proc =
{
"gimp-path-get-tattoo",
"gimp-path-get-tattoo",
"Returns the tattoo associated with the name path.",
"This procedure returns the tattoo associated with the specified path. A tattoo is a unique and permanent identifier attached to a path that can be used to uniquely identify a path within an image even between sessions.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-vectors-get-tattoo' instead.",
"This procedure is deprecated! Use 'gimp-vectors-get-tattoo' instead.",
"",
"",
"",
"gimp-vectors-get-tattoo",
GIMP_INTERNAL,
2,
path_get_tattoo_inargs,
@ -938,12 +934,12 @@ static ProcRecord path_set_tattoo_proc =
{
"gimp-path-set-tattoo",
"gimp-path-set-tattoo",
"Sets the tattoo associated with the named path.",
"This procedure sets the tattoo associated with the specified path. A tattoo is a unique and permenant identifier attached to a path that can be used to uniquely identify a path within an image even between sessions. Note that the value passed to this function must have been obtained from a previous call to path_get_tattoo.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-vectors-set-tattoo' instead.",
"This procedure is deprecated! Use 'gimp-vectors-set-tattoo' instead.",
"",
"",
"",
"gimp-vectors-set-tattoo",
GIMP_INTERNAL,
3,
path_set_tattoo_inargs,
@ -1015,12 +1011,12 @@ static ProcRecord get_path_by_tattoo_proc =
{
"gimp-get-path-by-tattoo",
"gimp-get-path-by-tattoo",
"Return the name of the path with the given tattoo.",
"The procedure returns the name of the path in the specified image which has the passed tattoo. The tattoos are unique within the image and will be preserved across sessions and through renaming of the path. An error is returned if no path with the specified tattoo can be found.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-image-get-vectors-by-tattoo' instead.",
"This procedure is deprecated! Use 'gimp-image-get-vectors-by-tattoo' instead.",
"",
"",
"",
"gimp-image-get-vectors-by-tattoo",
GIMP_INTERNAL,
2,
get_path_by_tattoo_inargs,
@ -1094,12 +1090,12 @@ static ProcRecord path_get_locked_proc =
{
"gimp-path-get-locked",
"gimp-path-get-locked",
"Returns the locked status associated with the named path.",
"This procedure returns the lock status associated with the specified path. A path can be \"locked\" which means that the transformation tool operations will also apply to the path.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-vectors-get-linked' instead.",
"This procedure is deprecated! Use 'gimp-vectors-get-linked' instead.",
"",
"",
"",
"gimp-vectors-get-linked",
GIMP_INTERNAL,
2,
path_get_locked_inargs,
@ -1165,12 +1161,12 @@ static ProcRecord path_set_locked_proc =
{
"gimp-path-set-locked",
"gimp-path-set-locked",
"Set the locked status associated with the named path.",
"This procedure sets the lock status associated with the specified path. A path can be \"locked\" which means that the transformation tool operations will also apply to the path.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
"This procedure is deprecated! Use 'gimp-vectors-set-linked' instead.",
"This procedure is deprecated! Use 'gimp-vectors-set-linked' instead.",
"",
"",
"",
"gimp-vectors-set-linked",
GIMP_INTERNAL,
3,
path_set_locked_inargs,
@ -1179,156 +1175,6 @@ static ProcRecord path_set_locked_proc =
{ { path_set_locked_invoker } }
};
static Argument *
path_get_visible_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
gchar *name;
gboolean visible = FALSE;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
if (success)
{
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
visible = gimp_item_get_visible (GIMP_ITEM (vectors));
else
success = FALSE;
}
return_args = procedural_db_return_args (&path_get_visible_proc, success);
if (success)
return_args[1].value.pdb_int = visible;
return return_args;
}
static ProcArg path_get_visible_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_STRING,
"name",
"The name of the path whose visibility should be obtained."
}
};
static ProcArg path_get_visible_outargs[] =
{
{
GIMP_PDB_INT32,
"visible",
"TRUE if the path is visible, FALSE otherwise"
}
};
static ProcRecord path_get_visible_proc =
{
"gimp-path-get-visible",
"gimp-path-get-visible",
"Get the visibility of the named path.",
"This procedure returns the visibility of the specified path.",
"Andy Thomas",
"Andy Thomas",
"1999",
NULL,
GIMP_INTERNAL,
2,
path_get_visible_inargs,
1,
path_get_visible_outargs,
{ { path_get_visible_invoker } }
};
static Argument *
path_set_visible_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
gchar *name;
gboolean visible;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
success = FALSE;
name = (gchar *) args[1].value.pdb_pointer;
if (name == NULL || !g_utf8_validate (name, -1, NULL))
success = FALSE;
visible = args[2].value.pdb_int ? TRUE : FALSE;
if (success)
{
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
else
success = FALSE;
}
return procedural_db_return_args (&path_set_visible_proc, success);
}
static ProcArg path_set_visible_inargs[] =
{
{
GIMP_PDB_IMAGE,
"image",
"The image"
},
{
GIMP_PDB_STRING,
"name",
"The name of the path whose visibility should be set"
},
{
GIMP_PDB_INT32,
"visible",
"The new path visibility"
}
};
static ProcRecord path_set_visible_proc =
{
"gimp-path-set-visible",
"gimp-path-set-visible",
"Sets the visibility of the named path.",
"This procedure sets the specified path's visibility.",
"Sven Neumann <sven@gimp.org>",
"Sven Neumann",
"2005",
NULL,
GIMP_INTERNAL,
3,
path_set_visible_inargs,
0,
NULL,
{ { path_set_visible_invoker } }
};
static Argument *
path_to_selection_invoker (Gimp *gimp,
GimpContext *context,

View File

@ -33,7 +33,6 @@
#include "gimp-intl.h"
#include "vectors/gimpanchor.h"
#include "vectors/gimpbezierstroke.h"
#include "vectors/gimpvectors-compat.h"
#include "vectors/gimpvectors.h"
static ProcRecord vectors_new_proc;
@ -148,7 +147,7 @@ static ProcRecord vectors_new_proc =
{
"gimp-vectors-new",
"gimp-vectors-new",
"Creates a new empty vectors object. Needs to be added to an image using gimp_image_add_vectors.",
"Creates a new empty vectors object.",
"Creates a new empty vectors object. Needs to be added to an image using gimp_image_add_vectors.",
"Simon Budig",
"Simon Budig",

View File

@ -469,7 +469,6 @@ EXPORTS
gimp_path_get_point_at_dist
gimp_path_get_points
gimp_path_get_tattoo
gimp_path_get_visible
gimp_path_import
gimp_path_import_string
gimp_path_list
@ -477,7 +476,6 @@ EXPORTS
gimp_path_set_locked
gimp_path_set_points
gimp_path_set_tattoo
gimp_path_set_visible
gimp_path_stroke_current
gimp_path_to_selection
gimp_pattern_get_info
@ -613,6 +611,10 @@ EXPORTS
gimp_vectors_get_tattoo
gimp_vectors_get_visible
gimp_vectors_new
gimp_vectors_parasite_attach
gimp_vectors_parasite_detach
gimp_vectors_parasite_find
gimp_vectors_parasite_list
gimp_vectors_set_linked
gimp_vectors_set_name
gimp_vectors_set_tattoo

View File

@ -1095,6 +1095,216 @@ gimp_image_lower_layer_to_bottom (gint32 image_ID,
return success;
}
/**
* gimp_image_add_channel:
* @image_ID: The image.
* @channel_ID: The channel.
* @position: The channel position.
*
* Add the specified channel to the image.
*
* This procedure adds the specified channel to the image. The position
* channel is not currently used, so the channel is always inserted at
* the top of the channel stack.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_add_channel (gint32 image_ID,
gint32 channel_ID,
gint position)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-add-channel",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_INT32, position,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_remove_channel:
* @image_ID: The image.
* @channel_ID: The channel.
*
* Remove the specified channel from the image.
*
* This procedure removes the specified channel from the image. If the
* channel doesn't exist, an error is returned.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_remove_channel (gint32 image_ID,
gint32 channel_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-remove-channel",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_raise_channel:
* @image_ID: The image.
* @channel_ID: The channel to raise.
*
* Raise the specified channel in the image's channel stack
*
* This procedure raises the specified channel one step in the existing
* channel stack. It will not move the channel if there is no channel
* above it.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_raise_channel (gint32 image_ID,
gint32 channel_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-raise-channel",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_lower_channel:
* @image_ID: The image.
* @channel_ID: The channel to lower.
*
* Lower the specified channel in the image's channel stack
*
* This procedure lowers the specified channel one step in the existing
* channel stack. It will not move the channel if there is no channel
* below it.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_lower_channel (gint32 image_ID,
gint32 channel_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-lower-channel",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_add_vectors:
* @image_ID: The image.
* @vectors_ID: The vectors object.
* @position: The vectors objects position.
*
* Add the specified vectors object to the image.
*
* This procedure adds the specified vectors object to the gimage at
* the given position. If the position is specified as -1, then the
* vectors object is inserted at the top of the vectors stack.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_add_vectors (gint32 image_ID,
gint32 vectors_ID,
gint position)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-add-vectors",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_INT32, position,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_remove_vectors:
* @image_ID: The image.
* @vectors_ID: The vectors object.
*
* Remove the specified path from the image.
*
* This procedure removes the specified path from the image. If the
* path doesn't exist, an error is returned.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_image_remove_vectors (gint32 image_ID,
gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-remove-vectors",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_raise_vectors:
* @image_ID: The image.
@ -1241,216 +1451,6 @@ gimp_image_lower_vectors_to_bottom (gint32 image_ID,
return success;
}
/**
* gimp_image_add_channel:
* @image_ID: The image.
* @channel_ID: The channel.
* @position: The channel position.
*
* Add the specified channel to the image.
*
* This procedure adds the specified channel to the image. The position
* channel is not currently used, so the channel is always inserted at
* the top of the channel stack.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_add_channel (gint32 image_ID,
gint32 channel_ID,
gint position)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-add-channel",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_INT32, position,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_remove_channel:
* @image_ID: The image.
* @channel_ID: The channel.
*
* Remove the specified channel from the image.
*
* This procedure removes the specified channel from the image. If the
* channel doesn't exist, an error is returned.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_remove_channel (gint32 image_ID,
gint32 channel_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-remove-channel",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_add_vectors:
* @image_ID: The image.
* @vectors_ID: The vectors object.
* @position: The vectors objects position.
*
* Add the specified vectors object to the image.
*
* This procedure adds the specified vectors object to the gimage at
* the given position. If the position is specified as -1, then the
* vectors object is inserted at the top of the vectors stack.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_add_vectors (gint32 image_ID,
gint32 vectors_ID,
gint position)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-add-vectors",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_INT32, position,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_remove_vectors:
* @image_ID: The image.
* @vectors_ID: The vectors object.
*
* Remove the specified path from the image.
*
* This procedure removes the specified path from the image. If the
* path doesn't exist, an error is returned.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_image_remove_vectors (gint32 image_ID,
gint32 vectors_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-remove-vectors",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_raise_channel:
* @image_ID: The image.
* @channel_ID: The channel to raise.
*
* Raise the specified channel in the image's channel stack
*
* This procedure raises the specified channel one step in the existing
* channel stack. It will not move the channel if there is no channel
* above it.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_raise_channel (gint32 image_ID,
gint32 channel_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-raise-channel",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_lower_channel:
* @image_ID: The image.
* @channel_ID: The channel to lower.
*
* Lower the specified channel in the image's channel stack
*
* This procedure lowers the specified channel one step in the existing
* channel stack. It will not move the channel if there is no channel
* below it.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_lower_channel (gint32 image_ID,
gint32 channel_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-lower-channel",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_CHANNEL, channel_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_flatten:
* @image_ID: The image.

View File

@ -91,6 +91,20 @@ gboolean gimp_image_raise_layer_to_top (gint32 ima
gint32 layer_ID);
gboolean gimp_image_lower_layer_to_bottom (gint32 image_ID,
gint32 layer_ID);
gboolean gimp_image_add_channel (gint32 image_ID,
gint32 channel_ID,
gint position);
gboolean gimp_image_remove_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_raise_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_lower_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_add_vectors (gint32 image_ID,
gint32 vectors_ID,
gint position);
gboolean gimp_image_remove_vectors (gint32 image_ID,
gint32 vectors_ID);
gboolean gimp_image_raise_vectors (gint32 image_ID,
gint32 vectors_ID);
gboolean gimp_image_lower_vectors (gint32 image_ID,
@ -99,20 +113,6 @@ gboolean gimp_image_raise_vectors_to_top (gint32 ima
gint32 vectors_ID);
gboolean gimp_image_lower_vectors_to_bottom (gint32 image_ID,
gint32 vectors_ID);
gboolean gimp_image_add_channel (gint32 image_ID,
gint32 channel_ID,
gint position);
gboolean gimp_image_remove_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_add_vectors (gint32 image_ID,
gint32 vectors_ID,
gint position);
gboolean gimp_image_remove_vectors (gint32 image_ID,
gint32 vectors_ID);
gboolean gimp_image_raise_channel (gint32 image_ID,
gint32 channel_ID);
gboolean gimp_image_lower_channel (gint32 image_ID,
gint32 channel_ID);
gint32 gimp_image_flatten (gint32 image_ID);
gint32 gimp_image_merge_visible_layers (gint32 image_ID,
GimpMergeType merge_type);

View File

@ -158,6 +158,151 @@ gimp_parasite_list (gint *num_parasites,
return success;
}
/**
* gimp_image_parasite_find:
* @image_ID: The image.
* @name: The name of the parasite to find.
*
* Finds the named parasite in an image
*
* Finds and returns the named parasite that was previously attached to
* an image.
*
* Returns: The found parasite.
*/
GimpParasite *
gimp_image_parasite_find (gint32 image_ID,
const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
GimpParasite *parasite = NULL;
return_vals = gimp_run_procedure ("gimp-image-parasite-find",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
gimp_destroy_params (return_vals, nreturn_vals);
return parasite;
}
/**
* gimp_image_parasite_attach:
* @image_ID: The image.
* @parasite: The parasite to attach to an image.
*
* Add a parasite to an image.
*
* This procedure attaches a parasite to an image. It has no return
* values.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_parasite_attach (gint32 image_ID,
GimpParasite *parasite)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-parasite-attach",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_PARASITE, parasite,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_parasite_detach:
* @image_ID: The image.
* @name: The name of the parasite to detach from an image.
*
* Removes a parasite from an image.
*
* This procedure detaches a parasite from an image. It has no return
* values.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_parasite_detach (gint32 image_ID,
const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-parasite-detach",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_image_parasite_list:
* @image_ID: The image.
* @num_parasites: The number of attached parasites.
* @parasites: The names of currently attached parasites.
*
* List all parasites.
*
* Returns a list of all currently attached parasites.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_parasite_list (gint32 image_ID,
gint *num_parasites,
gchar ***parasites)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
gint i;
return_vals = gimp_run_procedure ("gimp-image-parasite-list",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_END);
*num_parasites = 0;
*parasites = NULL;
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
if (success)
{
*num_parasites = return_vals[1].data.d_int32;
*parasites = g_new (gchar *, *num_parasites);
for (i = 0; i < *num_parasites; i++)
(*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
}
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_drawable_parasite_find:
* @drawable_ID: The drawable.
@ -304,28 +449,30 @@ gimp_drawable_parasite_list (gint32 drawable_ID,
}
/**
* gimp_image_parasite_find:
* @image_ID: The image.
* gimp_vectors_parasite_find:
* @vectors_ID: The vectors object.
* @name: The name of the parasite to find.
*
* Finds the named parasite in an image
* Finds the named parasite in a vectors object
*
* Finds and returns the named parasite that was previously attached to
* an image.
* a vectors object.
*
* Returns: The found parasite.
*
* Since: GIMP 2.4
*/
GimpParasite *
gimp_image_parasite_find (gint32 image_ID,
const gchar *name)
gimp_vectors_parasite_find (gint32 vectors_ID,
const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
GimpParasite *parasite = NULL;
return_vals = gimp_run_procedure ("gimp-image-parasite-find",
return_vals = gimp_run_procedure ("gimp-vectors-parasite-find",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
@ -338,28 +485,30 @@ gimp_image_parasite_find (gint32 image_ID,
}
/**
* gimp_image_parasite_attach:
* @image_ID: The image.
* @parasite: The parasite to attach to an image.
* gimp_vectors_parasite_attach:
* @vectors_ID: The vectors object.
* @parasite: The parasite to attach to a vectors object.
*
* Add a parasite to an image.
* Add a parasite to a vectors object
*
* This procedure attaches a parasite to an image. It has no return
* values.
* This procedure attaches a parasite to a vectors object. It has no
* return values.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_image_parasite_attach (gint32 image_ID,
GimpParasite *parasite)
gimp_vectors_parasite_attach (gint32 vectors_ID,
GimpParasite *parasite)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-parasite-attach",
return_vals = gimp_run_procedure ("gimp-vectors-parasite-attach",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_PARASITE, parasite,
GIMP_PDB_END);
@ -371,28 +520,30 @@ gimp_image_parasite_attach (gint32 image_ID,
}
/**
* gimp_image_parasite_detach:
* @image_ID: The image.
* @name: The name of the parasite to detach from an image.
* gimp_vectors_parasite_detach:
* @vectors_ID: The vectors object.
* @name: The name of the parasite to detach from a vectors object.
*
* Removes a parasite from an image.
* Removes a parasite from a vectors object
*
* This procedure detaches a parasite from an image. It has no return
* values.
* This procedure detaches a parasite from a vectors object. It has no
* return values.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_image_parasite_detach (gint32 image_ID,
const gchar *name)
gimp_vectors_parasite_detach (gint32 vectors_ID,
const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-image-parasite-detach",
return_vals = gimp_run_procedure ("gimp-vectors-parasite-detach",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
@ -404,8 +555,8 @@ gimp_image_parasite_detach (gint32 image_ID,
}
/**
* gimp_image_parasite_list:
* @image_ID: The image.
* gimp_vectors_parasite_list:
* @vectors_ID: The vectors object.
* @num_parasites: The number of attached parasites.
* @parasites: The names of currently attached parasites.
*
@ -414,20 +565,22 @@ gimp_image_parasite_detach (gint32 image_ID,
* Returns a list of all currently attached parasites.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_image_parasite_list (gint32 image_ID,
gint *num_parasites,
gchar ***parasites)
gimp_vectors_parasite_list (gint32 vectors_ID,
gint *num_parasites,
gchar ***parasites)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
gint i;
return_vals = gimp_run_procedure ("gimp-image-parasite-list",
return_vals = gimp_run_procedure ("gimp-vectors-parasite-list",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_VECTORS, vectors_ID,
GIMP_PDB_END);
*num_parasites = 0;

View File

@ -34,15 +34,6 @@ gboolean gimp_parasite_attach (GimpParasite *parasite);
gboolean gimp_parasite_detach (const gchar *name);
gboolean gimp_parasite_list (gint *num_parasites,
gchar ***parasites);
GimpParasite* gimp_drawable_parasite_find (gint32 drawable_ID,
const gchar *name);
gboolean gimp_drawable_parasite_attach (gint32 drawable_ID,
GimpParasite *parasite);
gboolean gimp_drawable_parasite_detach (gint32 drawable_ID,
const gchar *name);
gboolean gimp_drawable_parasite_list (gint32 drawable_ID,
gint *num_parasites,
gchar ***parasites);
GimpParasite* gimp_image_parasite_find (gint32 image_ID,
const gchar *name);
gboolean gimp_image_parasite_attach (gint32 image_ID,
@ -52,6 +43,24 @@ gboolean gimp_image_parasite_detach (gint32 image_ID,
gboolean gimp_image_parasite_list (gint32 image_ID,
gint *num_parasites,
gchar ***parasites);
GimpParasite* gimp_drawable_parasite_find (gint32 drawable_ID,
const gchar *name);
gboolean gimp_drawable_parasite_attach (gint32 drawable_ID,
GimpParasite *parasite);
gboolean gimp_drawable_parasite_detach (gint32 drawable_ID,
const gchar *name);
gboolean gimp_drawable_parasite_list (gint32 drawable_ID,
gint *num_parasites,
gchar ***parasites);
GimpParasite* gimp_vectors_parasite_find (gint32 vectors_ID,
const gchar *name);
gboolean gimp_vectors_parasite_attach (gint32 vectors_ID,
GimpParasite *parasite);
gboolean gimp_vectors_parasite_detach (gint32 vectors_ID,
const gchar *name);
gboolean gimp_vectors_parasite_list (gint32 vectors_ID,
gint *num_parasites,
gchar ***parasites);
G_END_DECLS

View File

@ -32,9 +32,7 @@
* @image_ID: The ID of the image to list the paths from.
* @num_paths: The number of paths returned.
*
* List the paths associated with the passed image.
*
* List the paths associated with the passed image.
* This procedure is deprecated! Use gimp_image_get_vectors() instead.
*
* Returns: List of the paths belonging to this image.
*/
@ -71,9 +69,8 @@ gimp_path_list (gint32 image_ID,
* gimp_path_get_current:
* @image_ID: The ID of the image to get the current path from.
*
* The name of the current path. Error if no paths.
*
* The name of the current path. Error if no paths.
* This procedure is deprecated! Use gimp_image_get_active_vectors()
* instead.
*
* Returns: The name of the current path.
*/
@ -102,9 +99,8 @@ gimp_path_get_current (gint32 image_ID)
* @image_ID: The ID of the image in which a path will become current.
* @name: The name of the path to make current.
*
* Sets the current path associated with the passed image.
*
* Sets a named path as the current path.
* This procedure is deprecated! Use gimp_image_set_active_vectors()
* instead.
*
* Returns: TRUE on success.
*/
@ -134,9 +130,8 @@ gimp_path_set_current (gint32 image_ID,
* @image_ID: The ID of the image to delete the path from.
* @name: The name of the path to delete.
*
* Delete the named path associated with the passed image.
*
* Delete the named path.
* This procedure is deprecated! Use gimp_image_remove_vectors()
* instead.
*
* Returns: TRUE on success.
*/
@ -330,12 +325,7 @@ gimp_path_get_point_at_dist (gint32 image_ID,
* @image_ID: The image.
* @name: The name of the path whose tattoo should be obtained.
*
* Returns the tattoo associated with the name path.
*
* This procedure returns the tattoo associated with the specified
* path. A tattoo is a unique and permanent identifier attached to a
* path that can be used to uniquely identify a path within an image
* even between sessions.
* This procedure is deprecated! Use gimp_vectors_get_tattoo() instead.
*
* Returns: The tattoo associated with the named path.
*/
@ -367,13 +357,7 @@ gimp_path_get_tattoo (gint32 image_ID,
* @name: the name of the path whose tattoo should be set.
* @tattovalue: The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here.
*
* Sets the tattoo associated with the named path.
*
* This procedure sets the tattoo associated with the specified path. A
* tattoo is a unique and permenant identifier attached to a path that
* can be used to uniquely identify a path within an image even between
* sessions. Note that the value passed to this function must have been
* obtained from a previous call to path_get_tattoo.
* This procedure is deprecated! Use gimp_vectors_set_tattoo() instead.
*
* Returns: TRUE on success.
*/
@ -405,13 +389,8 @@ gimp_path_set_tattoo (gint32 image_ID,
* @image_ID: The image.
* @tattoo: The tattoo of the required path.
*
* Return the name of the path with the given tattoo.
*
* The procedure returns the name of the path in the specified image
* which has the passed tattoo. The tattoos are unique within the image
* and will be preserved across sessions and through renaming of the
* path. An error is returned if no path with the specified tattoo can
* be found.
* This procedure is deprecated! Use gimp_image_get_vectors_by_tattoo()
* instead.
*
* Returns: The name of the path with the specified tattoo.
*/
@ -442,11 +421,7 @@ gimp_get_path_by_tattoo (gint32 image_ID,
* @image_ID: The image.
* @name: The name of the path whose locked status should be obtained.
*
* Returns the locked status associated with the named path.
*
* This procedure returns the lock status associated with the specified
* path. A path can be \"locked\" which means that the transformation
* tool operations will also apply to the path.
* This procedure is deprecated! Use gimp_vectors_get_linked() instead.
*
* Returns: TRUE if the path is locked, FALSE otherwise.
*/
@ -478,11 +453,7 @@ gimp_path_get_locked (gint32 image_ID,
* @name: the name of the path whose locked status should be set.
* @locked: Whether the path is locked.
*
* Set the locked status associated with the named path.
*
* This procedure sets the lock status associated with the specified
* path. A path can be \"locked\" which means that the transformation
* tool operations will also apply to the path.
* This procedure is deprecated! Use gimp_vectors_set_linked() instead.
*
* Returns: TRUE on success.
*/
@ -509,76 +480,6 @@ gimp_path_set_locked (gint32 image_ID,
return success;
}
/**
* gimp_path_get_visible:
* @image_ID: The image.
* @name: The name of the path whose visibility should be obtained.
*
* Get the visibility of the named path.
*
* This procedure returns the visibility of the specified path.
*
* Returns: TRUE if the path is visible, FALSE otherwise.
*/
gboolean
gimp_path_get_visible (gint32 image_ID,
const gchar *name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean visible = FALSE;
return_vals = gimp_run_procedure ("gimp-path-get-visible",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_STRING, name,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
visible = return_vals[1].data.d_int32;
gimp_destroy_params (return_vals, nreturn_vals);
return visible;
}
/**
* gimp_path_set_visible:
* @image_ID: The image.
* @name: The name of the path whose visibility should be set.
* @visible: The new path visibility.
*
* Sets the visibility of the named path.
*
* This procedure sets the specified path's visibility.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.4
*/
gboolean
gimp_path_set_visible (gint32 image_ID,
const gchar *name,
gboolean visible)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-path-set-visible",
&nreturn_vals,
GIMP_PDB_IMAGE, image_ID,
GIMP_PDB_STRING, name,
GIMP_PDB_INT32, visible,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_path_to_selection:
* @image_ID: The image.

View File

@ -29,6 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#ifndef GIMP_DISABLE_DEPRECATED
gchar** gimp_path_list (gint32 image_ID,
gint *num_paths);
gchar* gimp_path_get_current (gint32 image_ID);
@ -36,6 +37,7 @@ gboolean gimp_path_set_current (gint32 image_ID,
const gchar *name);
gboolean gimp_path_delete (gint32 image_ID,
const gchar *name);
#endif /* GIMP_DISABLE_DEPRECATED */
gint gimp_path_get_points (gint32 image_ID,
const gchar *name,
gint *path_closed,
@ -51,6 +53,7 @@ gint gimp_path_get_point_at_dist (gint32 image_ID,
gdouble distance,
gint *y_point,
gdouble *slope);
#ifndef GIMP_DISABLE_DEPRECATED
gint gimp_path_get_tattoo (gint32 image_ID,
const gchar *name);
gboolean gimp_path_set_tattoo (gint32 image_ID,
@ -63,11 +66,7 @@ gboolean gimp_path_get_locked (gint32 image_ID,
gboolean gimp_path_set_locked (gint32 image_ID,
const gchar *name,
gboolean locked);
gboolean gimp_path_get_visible (gint32 image_ID,
const gchar *name);
gboolean gimp_path_set_visible (gint32 image_ID,
const gchar *name,
gboolean visible);
#endif /* GIMP_DISABLE_DEPRECATED */
gboolean gimp_path_to_selection (gint32 image_ID,
const gchar *name,
GimpChannelOps op,

View File

@ -32,8 +32,7 @@
* @image_ID: The image.
* @name: the name of the new vector object.
*
* Creates a new empty vectors object. Needs to be added to an image
* using gimp_image_add_vectors.
* Creates a new empty vectors object.
*
* Creates a new empty vectors object. Needs to be added to an image
* using gimp_image_add_vectors.

View File

@ -89,7 +89,9 @@ HELP
{
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
G_TYPE_FROM_INSTANCE (channel), FALSE));
success = (channel_copy != NULL);
if (! channel_copy)
success = FALSE;
}
CODE
);
@ -113,11 +115,11 @@ HELP
{ name => 'operation', type => 'enum GimpChannelOps',
desc => 'The selection operation: { %%desc%% }' },
{ name => 'offx', type => 'int32',
desc => "x offset between upper left corner of
channels: (second - first)" },
desc => 'x offset between upper left corner of
channels: (second - first)' },
{ name => 'offy', type => 'int32',
desc => "y offset between upper left corner of
channels: (second - first)" }
desc => 'y offset between upper left corner of
channels: (second - first)' }
);
%invoke = (

View File

@ -2358,12 +2358,11 @@ CODE
image_add_layer image_remove_layer
image_raise_layer image_lower_layer
image_raise_layer_to_top image_lower_layer_to_bottom
image_add_channel image_remove_channel
image_raise_channel image_lower_channel
image_add_vectors image_remove_vectors
image_raise_vectors image_lower_vectors
image_raise_vectors_to_top image_lower_vectors_to_bottom
image_add_channel image_remove_channel
image_add_vectors
image_remove_vectors
image_raise_channel image_lower_channel
image_flatten image_merge_visible_layers image_merge_down
image_add_layer_mask image_remove_layer_mask
image_get_colormap image_set_colormap

View File

@ -17,34 +17,6 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub drawable_arg () {{
name => 'drawable',
type => 'drawable',
desc => 'The drawable'
}}
sub convert_proc {
my ($pdb_type, $arg, $var, $core_type) = @_;
my $desc = ($pdb_type =~ /^[aeiou]/ ? 'an ' : 'a ') . $pdb_type;
foreach ($blurb, $help, $inargs[0]->{desc}) { s/the gimp/$desc/e }
unshift @inargs, $arg;
# ugly double substitution
# gimp_parasite_copy -> GIMP_parasite_copy -> gimp_parasite_copy
# because of a lack op perl knowledge :) --Mitch
$invoke{code} =~ s/gimp_parasite_copy/GIMP_parasite_copy/;
$invoke{code} =~ s/gimp_/"gimp_$core_type\_"/e;
$invoke{code} =~ s/gimp, /"$var, "/e;
$invoke{code} =~ s/GIMP_parasite_copy/gimp_parasite_copy/;
}
# The defs
sub parasite_find {
$blurb = 'Finds the named parasite.';
@ -68,7 +40,9 @@ HELP
code => <<'CODE'
{
parasite = gimp_parasite_copy (gimp_parasite_find (gimp, name));
success = parasite != NULL;
if (! parasite)
success = FALSE;
}
CODE
);
@ -88,7 +62,13 @@ HELP
desc => 'The parasite to attach to the gimp' }
);
%invoke = ( code => 'gimp_parasite_attach (gimp, parasite);' );
%invoke = (
code => <<'CODE'
{
gimp_parasite_attach (gimp, parasite);
}
CODE
);
}
sub parasite_detach {
@ -105,7 +85,13 @@ HELP
desc => 'The name of the parasite to detach from the gimp.' }
);
%invoke = ( code => 'gimp_parasite_detach (gimp, name);' );
%invoke = (
code => <<'CODE'
{
gimp_parasite_detach (gimp, name);
}
CODE
);
}
sub parasite_list {
@ -120,45 +106,356 @@ sub parasite_list {
array => { desc => 'The number of attached parasites' } }
);
%invoke = ( code => 'parasites = gimp_parasite_list (gimp, &num_parasites);' );
%invoke = (
code => <<'CODE'
{
parasites = gimp_parasite_list (gimp, &num_parasites);
}
CODE
);
}
sub image_parasite_find {
$blurb = 'Finds the named parasite in an image';
$help = <<'HELP';
Finds and returns the named parasite that was previously attached to an image.
HELP
&jay_pdb_misc('1998');
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the parasite to find' }
);
@outargs = (
{ name => 'parasite', type => 'parasite',
desc => 'The found parasite' }
);
%invoke = (
code => <<'CODE'
{
parasite = gimp_parasite_copy (gimp_image_parasite_find (gimage, name));
if (! parasite)
success = FALSE;
}
CODE
);
}
sub image_parasite_attach {
$blurb = 'Add a parasite to an image.';
$help = <<'HELP';
This procedure attaches a parasite to an image. It has no return values.
HELP
&jay_pdb_misc('1998');
@inargs = (
&std_image_arg,
{ name => 'parasite', type => 'parasite',
desc => 'The parasite to attach to an image' }
);
%invoke = (
code => <<'CODE'
{
gimp_image_parasite_attach (gimage, parasite);
}
CODE
);
}
sub image_parasite_detach {
$blurb = 'Removes a parasite from an image.';
$help = <<'HELP';
This procedure detaches a parasite from an image. It has no return values.
HELP
&jay_pdb_misc('1998');
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the parasite to detach from an image.' }
);
%invoke = (
code => <<'CODE'
{
gimp_image_parasite_detach (gimage, name);
}
CODE
);
}
sub image_parasite_list {
$blurb = 'List all parasites.';
$help = 'Returns a list of all currently attached parasites.';
&marc_pdb_misc('1999');
@inargs = (
&std_image_arg
);
@outargs = (
{ name => 'parasites', type => 'stringarray', void_ret => 1,
desc => 'The names of currently attached parasites',
array => { desc => 'The number of attached parasites' } }
);
%invoke = (
code => <<'CODE'
{
parasites = gimp_image_parasite_list (gimage, &num_parasites);
}
CODE
);
}
sub drawable_parasite_find {
$blurb = 'Finds the named parasite in a drawable';
$help = <<'HELP';
Finds and returns the named parasite that was previously attached to a drawable.
HELP
&jay_pdb_misc('1998');
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'name', type => 'string',
desc => 'The name of the parasite to find' }
);
@outargs = (
{ name => 'parasite', type => 'parasite',
desc => 'The found parasite' }
);
%invoke = (
code => <<'CODE'
{
parasite = gimp_parasite_copy (gimp_item_parasite_find (GIMP_ITEM (drawable),
name));
if (! parasite)
success = FALSE;
}
CODE
);
}
sub drawable_parasite_attach {
$blurb = 'Add a parasite to a drawable.';
$help = <<'HELP';
This procedure attaches a parasite to a drawable. It has no return values.
HELP
&jay_pdb_misc('1998');
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'parasite', type => 'parasite',
desc => 'The parasite to attach to a drawable' }
);
%invoke = (
code => <<'CODE'
{
gimp_item_parasite_attach (GIMP_ITEM (drawable), parasite);
}
CODE
);
}
sub drawable_parasite_detach {
$blurb = 'Removes a parasite from a drawable.';
$help = <<'HELP';
This procedure detaches a parasite from a drawable. It has no return values.
HELP
&jay_pdb_misc('1998');
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' },
{ name => 'name', type => 'string',
desc => 'The name of the parasite to detach from a drawable.' }
);
%invoke = (
code => <<'CODE'
{
gimp_item_parasite_detach (GIMP_ITEM (drawable), name);
}
CODE
);
}
sub drawable_parasite_list {
$blurb = 'List all parasites.';
$help = 'Returns a list of all currently attached parasites.';
&marc_pdb_misc('1999');
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
@outargs = (
{ name => 'parasites', type => 'stringarray', void_ret => 1,
desc => 'The names of currently attached parasites',
array => { desc => 'The number of attached parasites' } }
);
%invoke = (
code => <<'CODE'
{
parasites = gimp_item_parasite_list (GIMP_ITEM (drawable), &num_parasites);
}
CODE
);
}
sub vectors_parasite_find {
$blurb = 'Finds the named parasite in a vectors object';
$help = <<'HELP';
Finds and returns the named parasite that was previously attached
to a vectors object.
HELP
&mitch_pdb_misc('2006', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'name', type => 'string',
desc => 'The name of the parasite to find' }
);
@outargs = (
{ name => 'parasite', type => 'parasite',
desc => 'The found parasite' }
);
%invoke = (
code => <<'CODE'
{
parasite = gimp_parasite_copy (gimp_item_parasite_find (GIMP_ITEM (vectors),
name));
if (! parasite)
success = FALSE;
}
CODE
);
}
sub vectors_parasite_attach {
$blurb = 'Add a parasite to a vectors object';
$help = <<'HELP';
This procedure attaches a parasite to a vectors object. It has no return values.
HELP
&mitch_pdb_misc('2006', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'parasite', type => 'parasite',
desc => 'The parasite to attach to a vectors object' }
);
%invoke = (
code => <<'CODE'
{
gimp_item_parasite_attach (GIMP_ITEM (vectors), parasite);
}
CODE
);
}
sub vectors_parasite_detach {
$blurb = 'Removes a parasite from a vectors object';
$help = <<'HELP';
This procedure detaches a parasite from a vectors object.
It has no return values.
HELP
&mitch_pdb_misc('2006', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' },
{ name => 'name', type => 'string',
desc => 'The name of the parasite to detach from a vectors object.' }
);
%invoke = (
code => <<'CODE'
{
gimp_item_parasite_detach (GIMP_ITEM (vectors), name);
}
CODE
);
}
sub vectors_parasite_list {
$blurb = 'List all parasites.';
$help = 'Returns a list of all currently attached parasites.';
&mitch_pdb_misc('2006', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors',
desc => 'The vectors object' }
);
@outargs = (
{ name => 'parasites', type => 'stringarray', void_ret => 1,
desc => 'The names of currently attached parasites',
array => { desc => 'The number of attached parasites' } }
);
%invoke = (
code => <<'CODE'
{
parasites = gimp_item_parasite_list (GIMP_ITEM (vectors), &num_parasites);
}
CODE
);
}
@headers = qw("core/gimp-parasites.h");
@procs = qw(parasite_find parasite_attach parasite_detach parasite_list);
@types = (
['drawable', '&drawable_arg' , 'GIMP_ITEM (drawable)', 'item' ],
['image' , '&std_image_arg', 'gimage', 'image' ]
);
foreach $type (@types) {
foreach (@procs[0..3]) {
my $desc = ($type->[0] =~ /^[aeiou]/ ? 'an ' : 'a ') . $type->[0];
my $args = join(', ', map { /^&/ ? $_ : "'$_'" } @$type);
my $pre = ""; my $post = "";
if (/find/) {
$pre = "\$blurb =~ s/\\.\$/ in $desc/;";
}
elsif (/list/) {
$pre = "\@inargs = ( $type->[1] );";
$post = "\@inargs = ( $type->[1] );";
}
eval <<SUB;
sub $type->[0]_$_ {
\&$_;
$pre
&convert_proc($args);
$post;
}
SUB
push @procs, "$type->[0]_$_";
}
}
@procs = qw(parasite_find
parasite_attach parasite_detach
parasite_list
image_parasite_find
image_parasite_attach image_parasite_detach
image_parasite_list
drawable_parasite_find
drawable_parasite_attach drawable_parasite_detach
drawable_parasite_list
vectors_parasite_find
vectors_parasite_attach vectors_parasite_detach
vectors_parasite_list);
%exports = (app => [@procs], lib => [@procs]);
$desc = 'Parasite procedures';

View File

@ -18,12 +18,11 @@
# "Perlized" from C source by Andy Thomas <alt@gimp.org>
sub path_list {
$blurb = 'List the paths associated with the passed image.';
$help = 'List the paths associated with the passed image.';
&std_pdb_deprecated('gimp-image-get-vectors');
&andy_pdb_misc('1999');
@inargs = ( &std_image_arg );
@inargs = (
&std_image_arg
);
$inargs[0]->{desc} = 'The ID of the image to list the paths from';
@outargs = (
@ -120,10 +119,7 @@ CODE
}
sub path_get_current {
$blurb = 'The name of the current path. Error if no paths.';
$help = 'The name of the current path. Error if no paths.';
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-image-get-active-vectors');
@inargs = (
&std_image_arg
@ -150,10 +146,7 @@ CODE
}
sub path_set_current {
$blurb = 'Sets the current path associated with the passed image.';
$help = 'Sets a named path as the current path.';
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-image-set-active-vectors');
@inargs = (
&std_image_arg,
@ -388,15 +381,7 @@ CODE
}
sub path_get_tattoo {
$blurb = 'Returns the tattoo associated with the name path.';
$help = <<'HELP';
This procedure returns the tattoo associated with the specified path. A
tattoo is a unique and permanent identifier attached to a path that can
be used to uniquely identify a path within an image even between sessions.
HELP
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-vectors-get-tattoo');
@inargs = (
&std_image_arg,
@ -424,17 +409,7 @@ CODE
}
sub path_set_tattoo {
$blurb = 'Sets the tattoo associated with the named path.';
$help = <<'HELP';
This procedure sets the tattoo associated with the specified path. A
tattoo is a unique and permenant identifier attached to a path that
can be used to uniquely identify a path within an image even between
sessions. Note that the value passed to this function must have been
obtained from a previous call to path_get_tattoo.
HELP
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-vectors-set-tattoo');
@inargs = (
&std_image_arg,
@ -460,16 +435,7 @@ CODE
}
sub get_path_by_tattoo {
$blurb = 'Return the name of the path with the given tattoo.';
$help = <<'HELP';
The procedure returns the name of the path in the specified image
which has the passed tattoo. The tattoos are unique within the image
and will be preserved across sessions and through renaming of the path.
An error is returned if no path with the specified tattoo can be found.
HELP
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-image-get-vectors-by-tattoo');
@inargs = (
&std_image_arg,
@ -497,10 +463,7 @@ CODE
}
sub path_delete {
$blurb = 'Delete the named path associated with the passed image.';
$help = 'Delete the named path.';
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-image-remove-vectors');
@inargs = (
&std_image_arg,
@ -524,15 +487,7 @@ CODE
}
sub path_get_locked {
$blurb = 'Returns the locked status associated with the named path.';
$help = <<'HELP';
This procedure returns the lock status associated with the specified
path. A path can be "locked" which means that the transformation
tool operations will also apply to the path.
HELP
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-vectors-get-linked');
@inargs = (
&std_image_arg,
@ -561,15 +516,7 @@ CODE
}
sub path_set_locked {
$blurb = 'Set the locked status associated with the named path.';
$help = <<'HELP';
This procedure sets the lock status associated with the specified path. A
path can be "locked" which means that the transformation tool operations
will also apply to the path.
HELP
&andy_pdb_misc('1999');
&std_pdb_deprecated('gimp-vectors-set-linked');
@inargs = (
&std_image_arg,
@ -593,65 +540,6 @@ CODE
);
}
sub path_get_visible {
$blurb = 'Get the visibility of the named path.';
$help = 'This procedure returns the visibility of the specified path.';
&andy_pdb_misc('1999');
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path whose visibility should be obtained.' }
);
@outargs = (
{ name => 'visible', type => 'boolean',
desc => 'TRUE if the path is visible, FALSE otherwise' }
);
%invoke = (
code => <<'CODE'
{
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
visible = gimp_item_get_visible (GIMP_ITEM (vectors));
else
success = FALSE;
}
CODE
);
}
sub path_set_visible {
$blurb = 'Sets the visibility of the named path.';
$help = "This procedure sets the specified path's visibility.";
&neo_pdb_misc('2005', '2.4');
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path whose visibility should be set' },
{ name => 'visible', type => 'boolean',
desc => 'The new path visibility' }
);
%invoke = (
code => <<'CODE'
{
GimpVectors *vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_item_set_visible (GIMP_ITEM (vectors), visible, TRUE);
else
success = FALSE;
}
CODE
);
}
sub path_to_selection {
$blurb = 'Transforms the active path into a selection';
@ -774,7 +662,6 @@ CODE
path_stroke_current path_get_point_at_dist
path_get_tattoo path_set_tattoo get_path_by_tattoo
path_get_locked path_set_locked
path_get_visible path_set_visible
path_to_selection path_import path_import_string);
%exports = (app => [@procs], lib => [@procs]);

View File

@ -16,10 +16,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sub vectors_new {
$blurb = 'Creates a new empty vectors object. Needs to be added to an image using gimp_image_add_vectors.';
$blurb = 'Creates a new empty vectors object.';
$help = <<'HELP';
Creates a new empty vectors object. Needs to be added to an image using gimp_image_add_vectors.
Creates a new empty vectors object. Needs to be added to an image
using gimp_image_add_vectors.
HELP
&simon_pdb_misc('2005', '2.4');
@ -52,7 +53,9 @@ sub vectors_get_current {
&simon_pdb_misc('2005', '2.4');
@inargs = ( &std_image_arg );
@inargs = (
&std_image_arg
);
$inargs[0]->{desc} = 'The ID of the image to get the current path from.';
@outargs = (
@ -875,10 +878,9 @@ CODE
}
@headers = qw(<string.h> "core/gimp.h" "core/gimplist.h"
"core/gimpimage.h"
@headers = qw(<string.h> "core/gimp.h" "core/gimplist.h" "core/gimpimage.h"
"vectors/gimpanchor.h" "vectors/gimpbezierstroke.h"
"vectors/gimpvectors.h" "vectors/gimpvectors-compat.h"
"vectors/gimpvectors.h"
"gimp-intl.h");
@procs = qw(vectors_new vectors_get_strokes vectors_get_image