mirror of https://github.com/GNOME/gimp.git
libgimp: move the item parasite functions to the parasites files
and rename them yet again to be gimp_item_foo_parasite() instead of gimp_item_parasite_foo() because the latter is just a misnaming (they are not GimpItemParasites, they are GimpParasites attached to GimpItems, just as layers are attached to images).
This commit is contained in:
parent
aa667f790e
commit
b4c9987de6
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include <gegl.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
||||
#include "pdb-types.h"
|
||||
|
||||
#include "core/gimpimage.h"
|
||||
|
@ -706,6 +708,121 @@ item_set_tattoo_invoker (GimpProcedure *procedure,
|
|||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
item_attach_parasite_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpItem *item;
|
||||
const GimpParasite *parasite;
|
||||
|
||||
item = gimp_value_get_item (&args->values[0], gimp);
|
||||
parasite = g_value_get_boxed (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_item_parasite_attach (item, parasite, TRUE);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
item_detach_parasite_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpItem *item;
|
||||
const gchar *name;
|
||||
|
||||
item = gimp_value_get_item (&args->values[0], gimp);
|
||||
name = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_item_parasite_detach (item, name, TRUE);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
item_find_parasite_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpItem *item;
|
||||
const gchar *name;
|
||||
GimpParasite *parasite = NULL;
|
||||
|
||||
item = gimp_value_get_item (&args->values[0], gimp);
|
||||
name = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
parasite = gimp_parasite_copy (gimp_item_parasite_find (item, name));
|
||||
|
||||
if (! parasite)
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_take_boxed (&return_vals->values[1], parasite);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
item_list_parasites_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpItem *item;
|
||||
gint32 num_parasites = 0;
|
||||
gchar **parasites = NULL;
|
||||
|
||||
item = gimp_value_get_item (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
parasites = gimp_item_parasite_list (item, &num_parasites);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_set_int (&return_vals->values[1], num_parasites);
|
||||
gimp_value_take_stringarray (&return_vals->values[2], parasites, num_parasites);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
void
|
||||
register_item_procs (GimpPDB *pdb)
|
||||
{
|
||||
|
@ -1378,4 +1495,131 @@ register_item_procs (GimpPDB *pdb)
|
|||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-item-attach-parasite
|
||||
*/
|
||||
procedure = gimp_procedure_new (item_attach_parasite_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-item-attach-parasite");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-item-attach-parasite",
|
||||
"Add a parasite to an item.",
|
||||
"This procedure attaches a parasite to an item. It has no return values.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_item_id ("item",
|
||||
"item",
|
||||
"The item",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_parasite ("parasite",
|
||||
"parasite",
|
||||
"The parasite to attach to the item",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-item-detach-parasite
|
||||
*/
|
||||
procedure = gimp_procedure_new (item_detach_parasite_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-item-detach-parasite");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-item-detach-parasite",
|
||||
"Removes a parasite from an item.",
|
||||
"This procedure detaches a parasite from an item. It has no return values.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_item_id ("item",
|
||||
"item",
|
||||
"The item",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The name of the parasite to detach from the item.",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-item-find-parasite
|
||||
*/
|
||||
procedure = gimp_procedure_new (item_find_parasite_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-item-find-parasite");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-item-find-parasite",
|
||||
"Look up a parasite in an item",
|
||||
"Finds and returns the parasite that is attached to an item.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_item_id ("item",
|
||||
"item",
|
||||
"The item",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The name of the parasite to find",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_parasite ("parasite",
|
||||
"parasite",
|
||||
"The found parasite",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-item-list-parasites
|
||||
*/
|
||||
procedure = gimp_procedure_new (item_list_parasites_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-item-list-parasites");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-item-list-parasites",
|
||||
"List all parasites.",
|
||||
"Returns a list of all parasites currently attached the an item.",
|
||||
"Marc Lehmann",
|
||||
"Marc Lehmann",
|
||||
"1999",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_item_id ("item",
|
||||
"item",
|
||||
"The item",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-parasites",
|
||||
"num parasites",
|
||||
"The number of attached parasites",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("parasites",
|
||||
"parasites",
|
||||
"The names of currently attached parasites",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "core/gimp-parasites.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpitem.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
#include "vectors/gimpvectors.h"
|
||||
|
||||
|
@ -250,121 +249,6 @@ image_parasite_list_invoker (GimpProcedure *procedure,
|
|||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
item_parasite_find_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpItem *item;
|
||||
const gchar *name;
|
||||
GimpParasite *parasite = NULL;
|
||||
|
||||
item = gimp_value_get_item (&args->values[0], gimp);
|
||||
name = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
parasite = gimp_parasite_copy (gimp_item_parasite_find (item, name));
|
||||
|
||||
if (! parasite)
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
g_value_take_boxed (&return_vals->values[1], parasite);
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
item_parasite_attach_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpItem *item;
|
||||
const GimpParasite *parasite;
|
||||
|
||||
item = gimp_value_get_item (&args->values[0], gimp);
|
||||
parasite = g_value_get_boxed (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_item_parasite_attach (item, parasite, TRUE);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
item_parasite_detach_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpItem *item;
|
||||
const gchar *name;
|
||||
|
||||
item = gimp_value_get_item (&args->values[0], gimp);
|
||||
name = g_value_get_string (&args->values[1]);
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_item_parasite_detach (item, name, TRUE);
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
item_parasite_list_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const GValueArray *args,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GValueArray *return_vals;
|
||||
GimpItem *item;
|
||||
gint32 num_parasites = 0;
|
||||
gchar **parasites = NULL;
|
||||
|
||||
item = gimp_value_get_item (&args->values[0], gimp);
|
||||
|
||||
if (success)
|
||||
{
|
||||
parasites = gimp_item_parasite_list (item, &num_parasites);
|
||||
}
|
||||
|
||||
return_vals = gimp_procedure_get_return_values (procedure, success,
|
||||
error ? *error : NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
g_value_set_int (&return_vals->values[1], num_parasites);
|
||||
gimp_value_take_stringarray (&return_vals->values[2], parasites, num_parasites);
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
static GValueArray *
|
||||
drawable_parasite_find_invoker (GimpProcedure *procedure,
|
||||
Gimp *gimp,
|
||||
|
@ -832,133 +716,6 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-item-parasite-find
|
||||
*/
|
||||
procedure = gimp_procedure_new (item_parasite_find_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-item-parasite-find");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-item-parasite-find",
|
||||
"Look up a parasite in an item",
|
||||
"Finds and returns the parasite that is attached to an item.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_item_id ("item",
|
||||
"item",
|
||||
"The item",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The name of the parasite to find",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_parasite ("parasite",
|
||||
"parasite",
|
||||
"The found parasite",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-item-parasite-attach
|
||||
*/
|
||||
procedure = gimp_procedure_new (item_parasite_attach_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-item-parasite-attach");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-item-parasite-attach",
|
||||
"Add a parasite to an item.",
|
||||
"This procedure attaches a parasite to an item. It has no return values.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_item_id ("item",
|
||||
"item",
|
||||
"The item",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_parasite ("parasite",
|
||||
"parasite",
|
||||
"The parasite to attach to the item",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-item-parasite-detach
|
||||
*/
|
||||
procedure = gimp_procedure_new (item_parasite_detach_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-item-parasite-detach");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-item-parasite-detach",
|
||||
"Removes a parasite from an item.",
|
||||
"This procedure detaches a parasite from an item. It has no return values.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_item_id ("item",
|
||||
"item",
|
||||
"The item",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
"name",
|
||||
"The name of the parasite to detach from the item.",
|
||||
FALSE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-item-parasite-list
|
||||
*/
|
||||
procedure = gimp_procedure_new (item_parasite_list_invoker);
|
||||
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
||||
"gimp-item-parasite-list");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-item-parasite-list",
|
||||
"List all parasites.",
|
||||
"Returns a list of all parasites currently attached the an item.",
|
||||
"Marc Lehmann",
|
||||
"Marc Lehmann",
|
||||
"1999",
|
||||
NULL);
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_item_id ("item",
|
||||
"item",
|
||||
"The item",
|
||||
pdb->gimp, FALSE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_int32 ("num-parasites",
|
||||
"num parasites",
|
||||
"The number of attached parasites",
|
||||
0, G_MAXINT32, 0,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string_array ("parasites",
|
||||
"parasites",
|
||||
"The names of currently attached parasites",
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
/*
|
||||
* gimp-drawable-parasite-find
|
||||
*/
|
||||
|
@ -967,12 +724,12 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
"gimp-drawable-parasite-find");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-drawable-parasite-find",
|
||||
"Deprecated: Use 'gimp-item-parasite-find' instead.",
|
||||
"Deprecated: Use 'gimp-item-parasite-find' instead.",
|
||||
"Deprecated: Use 'gimp-item-find-parasite' instead.",
|
||||
"Deprecated: Use 'gimp-item-find-parasite' instead.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
"gimp-item-parasite-find");
|
||||
"gimp-item-find-parasite");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
|
@ -1002,12 +759,12 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
"gimp-drawable-parasite-attach");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-drawable-parasite-attach",
|
||||
"Deprecated: Use 'gimp-item-parasite-attach' instead.",
|
||||
"Deprecated: Use 'gimp-item-parasite-attach' instead.",
|
||||
"Deprecated: Use 'gimp-item-attach-parasite' instead.",
|
||||
"Deprecated: Use 'gimp-item-attach-parasite' instead.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
"gimp-item-parasite-attach");
|
||||
"gimp-item-attach-parasite");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
|
@ -1030,12 +787,12 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
"gimp-drawable-parasite-detach");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-drawable-parasite-detach",
|
||||
"Deprecated: Use 'gimp-item-parasite-detach' instead.",
|
||||
"Deprecated: Use 'gimp-item-parasite-detach' instead.",
|
||||
"Deprecated: Use 'gimp-item-detach-parasite' instead.",
|
||||
"Deprecated: Use 'gimp-item-detach-parasite' instead.",
|
||||
"Jay Cox",
|
||||
"Jay Cox",
|
||||
"1998",
|
||||
"gimp-item-parasite-detach");
|
||||
"gimp-item-detach-parasite");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
|
@ -1060,12 +817,12 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
"gimp-drawable-parasite-list");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-drawable-parasite-list",
|
||||
"Deprecated: Use 'gimp-item-parasite-list' instead.",
|
||||
"Deprecated: Use 'gimp-item-parasite-list' instead.",
|
||||
"Deprecated: Use 'gimp-item-list-parasites' instead.",
|
||||
"Deprecated: Use 'gimp-item-list-parasites' instead.",
|
||||
"Marc Lehmann",
|
||||
"Marc Lehmann",
|
||||
"1999",
|
||||
"gimp-item-parasite-list");
|
||||
"gimp-item-list-parasites");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_drawable_id ("drawable",
|
||||
"drawable",
|
||||
|
@ -1094,12 +851,12 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
"gimp-vectors-parasite-find");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-parasite-find",
|
||||
"Deprecated: Use 'gimp-item-parasite-find' instead.",
|
||||
"Deprecated: Use 'gimp-item-parasite-find' instead.",
|
||||
"Deprecated: Use 'gimp-item-find-parasite' instead.",
|
||||
"Deprecated: Use 'gimp-item-find-parasite' instead.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2006",
|
||||
"gimp-item-parasite-find");
|
||||
"gimp-item-find-parasite");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
|
@ -1129,12 +886,12 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
"gimp-vectors-parasite-attach");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-parasite-attach",
|
||||
"Deprecated: Use 'gimp-item-parasite-attach' instead.",
|
||||
"Deprecated: Use 'gimp-item-parasite-attach' instead.",
|
||||
"Deprecated: Use 'gimp-item-attach--parasite' instead.",
|
||||
"Deprecated: Use 'gimp-item-attach--parasite' instead.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2006",
|
||||
"gimp-item-parasite-attach");
|
||||
"gimp-item-attach--parasite");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
|
@ -1157,12 +914,12 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
"gimp-vectors-parasite-detach");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-parasite-detach",
|
||||
"Deprecated: Use 'gimp-item-parasite-detach' instead.",
|
||||
"Deprecated: Use 'gimp-item-parasite-detach' instead.",
|
||||
"Deprecated: Use 'gimp-item-detach-parasite' instead.",
|
||||
"Deprecated: Use 'gimp-item-detach-parasite' instead.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2006",
|
||||
"gimp-item-parasite-detach");
|
||||
"gimp-item-detach-parasite");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
|
@ -1187,12 +944,12 @@ register_parasite_procs (GimpPDB *pdb)
|
|||
"gimp-vectors-parasite-list");
|
||||
gimp_procedure_set_static_strings (procedure,
|
||||
"gimp-vectors-parasite-list",
|
||||
"Deprecated: Use 'gimp-item-parasite-list' instead.",
|
||||
"Deprecated: Use 'gimp-item-parasite-list' instead.",
|
||||
"Deprecated: Use 'gimp-item-list-parasites' instead.",
|
||||
"Deprecated: Use 'gimp-item-list-parasites' instead.",
|
||||
"Michael Natterer <mitch@gimp.org>",
|
||||
"Michael Natterer",
|
||||
"2006",
|
||||
"gimp-item-parasite-list");
|
||||
"gimp-item-list-parasites");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_vectors_id ("vectors",
|
||||
"vectors",
|
||||
|
|
|
@ -448,7 +448,10 @@ EXPORTS
|
|||
gimp_install_procedure
|
||||
gimp_install_temp_proc
|
||||
gimp_invert
|
||||
gimp_item_attach_parasite
|
||||
gimp_item_delete
|
||||
gimp_item_detach_parasite
|
||||
gimp_item_find_parasite
|
||||
gimp_item_get_children
|
||||
gimp_item_get_image
|
||||
gimp_item_get_linked
|
||||
|
@ -466,10 +469,7 @@ EXPORTS
|
|||
gimp_item_is_text_layer
|
||||
gimp_item_is_valid
|
||||
gimp_item_is_vectors
|
||||
gimp_item_parasite_attach
|
||||
gimp_item_parasite_detach
|
||||
gimp_item_parasite_find
|
||||
gimp_item_parasite_list
|
||||
gimp_item_list_parasites
|
||||
gimp_item_set_linked
|
||||
gimp_item_set_lock_content
|
||||
gimp_item_set_name
|
||||
|
|
|
@ -571,7 +571,7 @@ gimp_drawable_attach_new_parasite (gint32 drawable_ID,
|
|||
GimpParasite *parasite = gimp_parasite_new (name, flags, size, data);
|
||||
gboolean success;
|
||||
|
||||
success = gimp_item_parasite_attach (drawable_ID, parasite);
|
||||
success = gimp_item_attach_parasite (drawable_ID, parasite);
|
||||
|
||||
gimp_parasite_free (parasite);
|
||||
|
||||
|
|
|
@ -801,3 +801,155 @@ gimp_item_set_tattoo (gint32 item_ID,
|
|||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_item_attach_parasite:
|
||||
* @item_ID: The item.
|
||||
* @parasite: The parasite to attach to the item.
|
||||
*
|
||||
* Add a parasite to an item.
|
||||
*
|
||||
* This procedure attaches a parasite to an item. It has no return
|
||||
* values.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
**/
|
||||
gboolean
|
||||
gimp_item_attach_parasite (gint32 item_ID,
|
||||
const GimpParasite *parasite)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-item-attach-parasite",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_ITEM, item_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_item_detach_parasite:
|
||||
* @item_ID: The item.
|
||||
* @name: The name of the parasite to detach from the item.
|
||||
*
|
||||
* Removes a parasite from an item.
|
||||
*
|
||||
* This procedure detaches a parasite from an item. It has no return
|
||||
* values.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
**/
|
||||
gboolean
|
||||
gimp_item_detach_parasite (gint32 item_ID,
|
||||
const gchar *name)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-item-detach-parasite",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_ITEM, item_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_item_find_parasite:
|
||||
* @item_ID: The item.
|
||||
* @name: The name of the parasite to find.
|
||||
*
|
||||
* Look up a parasite in an item
|
||||
*
|
||||
* Finds and returns the parasite that is attached to an item.
|
||||
*
|
||||
* Returns: The found parasite.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
**/
|
||||
GimpParasite *
|
||||
gimp_item_find_parasite (gint32 item_ID,
|
||||
const gchar *name)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
GimpParasite *parasite = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-item-find-parasite",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_ITEM, item_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_item_list_parasites:
|
||||
* @item_ID: The item.
|
||||
* @num_parasites: The number of attached parasites.
|
||||
* @parasites: The names of currently attached parasites.
|
||||
*
|
||||
* List all parasites.
|
||||
*
|
||||
* Returns a list of all parasites currently attached the an item.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
**/
|
||||
gboolean
|
||||
gimp_item_list_parasites (gint32 item_ID,
|
||||
gint *num_parasites,
|
||||
gchar ***parasites)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
gint i;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-item-list-parasites",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_ITEM, item_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;
|
||||
}
|
||||
|
|
|
@ -28,35 +28,44 @@ G_BEGIN_DECLS
|
|||
/* For information look into the C source or the html documentation */
|
||||
|
||||
|
||||
gboolean gimp_item_is_valid (gint32 item_ID);
|
||||
gint32 gimp_item_get_image (gint32 item_ID);
|
||||
gboolean gimp_item_delete (gint32 item_ID);
|
||||
gboolean gimp_item_is_drawable (gint32 item_ID);
|
||||
gboolean gimp_item_is_layer (gint32 item_ID);
|
||||
gboolean gimp_item_is_text_layer (gint32 item_ID);
|
||||
gboolean gimp_item_is_channel (gint32 item_ID);
|
||||
gboolean gimp_item_is_layer_mask (gint32 item_ID);
|
||||
gboolean gimp_item_is_selection (gint32 item_ID);
|
||||
gboolean gimp_item_is_vectors (gint32 item_ID);
|
||||
gboolean gimp_item_is_group (gint32 item_ID);
|
||||
gint32 gimp_item_get_parent (gint32 item_ID);
|
||||
gint* gimp_item_get_children (gint32 item_ID,
|
||||
gint *num_children);
|
||||
gchar* gimp_item_get_name (gint32 item_ID);
|
||||
gboolean gimp_item_set_name (gint32 item_ID,
|
||||
const gchar *name);
|
||||
gboolean gimp_item_get_visible (gint32 item_ID);
|
||||
gboolean gimp_item_set_visible (gint32 item_ID,
|
||||
gboolean visible);
|
||||
gboolean gimp_item_get_linked (gint32 item_ID);
|
||||
gboolean gimp_item_set_linked (gint32 item_ID,
|
||||
gboolean linked);
|
||||
gboolean gimp_item_get_lock_content (gint32 item_ID);
|
||||
gboolean gimp_item_set_lock_content (gint32 item_ID,
|
||||
gboolean lock_content);
|
||||
gint gimp_item_get_tattoo (gint32 item_ID);
|
||||
gboolean gimp_item_set_tattoo (gint32 item_ID,
|
||||
gint tattoo);
|
||||
gboolean gimp_item_is_valid (gint32 item_ID);
|
||||
gint32 gimp_item_get_image (gint32 item_ID);
|
||||
gboolean gimp_item_delete (gint32 item_ID);
|
||||
gboolean gimp_item_is_drawable (gint32 item_ID);
|
||||
gboolean gimp_item_is_layer (gint32 item_ID);
|
||||
gboolean gimp_item_is_text_layer (gint32 item_ID);
|
||||
gboolean gimp_item_is_channel (gint32 item_ID);
|
||||
gboolean gimp_item_is_layer_mask (gint32 item_ID);
|
||||
gboolean gimp_item_is_selection (gint32 item_ID);
|
||||
gboolean gimp_item_is_vectors (gint32 item_ID);
|
||||
gboolean gimp_item_is_group (gint32 item_ID);
|
||||
gint32 gimp_item_get_parent (gint32 item_ID);
|
||||
gint* gimp_item_get_children (gint32 item_ID,
|
||||
gint *num_children);
|
||||
gchar* gimp_item_get_name (gint32 item_ID);
|
||||
gboolean gimp_item_set_name (gint32 item_ID,
|
||||
const gchar *name);
|
||||
gboolean gimp_item_get_visible (gint32 item_ID);
|
||||
gboolean gimp_item_set_visible (gint32 item_ID,
|
||||
gboolean visible);
|
||||
gboolean gimp_item_get_linked (gint32 item_ID);
|
||||
gboolean gimp_item_set_linked (gint32 item_ID,
|
||||
gboolean linked);
|
||||
gboolean gimp_item_get_lock_content (gint32 item_ID);
|
||||
gboolean gimp_item_set_lock_content (gint32 item_ID,
|
||||
gboolean lock_content);
|
||||
gint gimp_item_get_tattoo (gint32 item_ID);
|
||||
gboolean gimp_item_set_tattoo (gint32 item_ID,
|
||||
gint tattoo);
|
||||
gboolean gimp_item_attach_parasite (gint32 item_ID,
|
||||
const GimpParasite *parasite);
|
||||
gboolean gimp_item_detach_parasite (gint32 item_ID,
|
||||
const gchar *name);
|
||||
GimpParasite* gimp_item_find_parasite (gint32 item_ID,
|
||||
const gchar *name);
|
||||
gboolean gimp_item_list_parasites (gint32 item_ID,
|
||||
gint *num_parasites,
|
||||
gchar ***parasites);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -313,164 +313,12 @@ gimp_image_parasite_list (gint32 image_ID,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_item_parasite_find:
|
||||
* @item_ID: The item.
|
||||
* @name: The name of the parasite to find.
|
||||
*
|
||||
* Look up a parasite in an item
|
||||
*
|
||||
* Finds and returns the parasite that is attached to an item.
|
||||
*
|
||||
* Returns: The found parasite.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
**/
|
||||
GimpParasite *
|
||||
gimp_item_parasite_find (gint32 item_ID,
|
||||
const gchar *name)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
GimpParasite *parasite = NULL;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-item-parasite-find",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_ITEM, item_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_item_parasite_attach:
|
||||
* @item_ID: The item.
|
||||
* @parasite: The parasite to attach to the item.
|
||||
*
|
||||
* Add a parasite to an item.
|
||||
*
|
||||
* This procedure attaches a parasite to an item. It has no return
|
||||
* values.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
**/
|
||||
gboolean
|
||||
gimp_item_parasite_attach (gint32 item_ID,
|
||||
const GimpParasite *parasite)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-item-parasite-attach",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_ITEM, item_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_item_parasite_detach:
|
||||
* @item_ID: The item.
|
||||
* @name: The name of the parasite to detach from the item.
|
||||
*
|
||||
* Removes a parasite from an item.
|
||||
*
|
||||
* This procedure detaches a parasite from an item. It has no return
|
||||
* values.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
**/
|
||||
gboolean
|
||||
gimp_item_parasite_detach (gint32 item_ID,
|
||||
const gchar *name)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-item-parasite-detach",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_ITEM, item_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_item_parasite_list:
|
||||
* @item_ID: The item.
|
||||
* @num_parasites: The number of attached parasites.
|
||||
* @parasites: The names of currently attached parasites.
|
||||
*
|
||||
* List all parasites.
|
||||
*
|
||||
* Returns a list of all parasites currently attached the an item.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
* Since: GIMP 2.8
|
||||
**/
|
||||
gboolean
|
||||
gimp_item_parasite_list (gint32 item_ID,
|
||||
gint *num_parasites,
|
||||
gchar ***parasites)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
gint i;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp-item-parasite-list",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_ITEM, item_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.
|
||||
* @name: The name of the parasite to find.
|
||||
*
|
||||
* Deprecated: Use gimp_item_parasite_find() instead.
|
||||
* Deprecated: Use gimp_item_find_parasite() instead.
|
||||
*
|
||||
* Returns: The found parasite.
|
||||
**/
|
||||
|
@ -501,7 +349,7 @@ gimp_drawable_parasite_find (gint32 drawable_ID,
|
|||
* @drawable_ID: The drawable.
|
||||
* @parasite: The parasite to attach to a drawable.
|
||||
*
|
||||
* Deprecated: Use gimp_item_parasite_attach() instead.
|
||||
* Deprecated: Use gimp_item_attach_parasite() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
|
@ -531,7 +379,7 @@ gimp_drawable_parasite_attach (gint32 drawable_ID,
|
|||
* @drawable_ID: The drawable.
|
||||
* @name: The name of the parasite to detach from a drawable.
|
||||
*
|
||||
* Deprecated: Use gimp_item_parasite_detach() instead.
|
||||
* Deprecated: Use gimp_item_detach_parasite() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
|
@ -562,7 +410,7 @@ gimp_drawable_parasite_detach (gint32 drawable_ID,
|
|||
* @num_parasites: The number of attached parasites.
|
||||
* @parasites: The names of currently attached parasites.
|
||||
*
|
||||
* Deprecated: Use gimp_item_parasite_list() instead.
|
||||
* Deprecated: Use gimp_item_list_parasites() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
**/
|
||||
|
@ -604,7 +452,7 @@ gimp_drawable_parasite_list (gint32 drawable_ID,
|
|||
* @vectors_ID: The vectors object.
|
||||
* @name: The name of the parasite to find.
|
||||
*
|
||||
* Deprecated: Use gimp_item_parasite_find() instead.
|
||||
* Deprecated: Use gimp_item_find_parasite() instead.
|
||||
*
|
||||
* Returns: The found parasite.
|
||||
*
|
||||
|
@ -637,7 +485,7 @@ gimp_vectors_parasite_find (gint32 vectors_ID,
|
|||
* @vectors_ID: The vectors object.
|
||||
* @parasite: The parasite to attach to a vectors object.
|
||||
*
|
||||
* Deprecated: Use gimp_item_parasite_attach() instead.
|
||||
* Deprecated: Use gimp_item_attach__parasite() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
|
@ -669,7 +517,7 @@ gimp_vectors_parasite_attach (gint32 vectors_ID,
|
|||
* @vectors_ID: The vectors object.
|
||||
* @name: The name of the parasite to detach from a vectors object.
|
||||
*
|
||||
* Deprecated: Use gimp_item_parasite_detach() instead.
|
||||
* Deprecated: Use gimp_item_detach_parasite() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
|
@ -702,7 +550,7 @@ gimp_vectors_parasite_detach (gint32 vectors_ID,
|
|||
* @num_parasites: The number of attached parasites.
|
||||
* @parasites: The names of currently attached parasites.
|
||||
*
|
||||
* Deprecated: Use gimp_item_parasite_list() instead.
|
||||
* Deprecated: Use gimp_item_list_parasites() instead.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*
|
||||
|
|
|
@ -42,15 +42,6 @@ gboolean gimp_image_parasite_detach (gint32 image_ID,
|
|||
gboolean gimp_image_parasite_list (gint32 image_ID,
|
||||
gint *num_parasites,
|
||||
gchar ***parasites);
|
||||
GimpParasite* gimp_item_parasite_find (gint32 item_ID,
|
||||
const gchar *name);
|
||||
gboolean gimp_item_parasite_attach (gint32 item_ID,
|
||||
const GimpParasite *parasite);
|
||||
gboolean gimp_item_parasite_detach (gint32 item_ID,
|
||||
const gchar *name);
|
||||
gboolean gimp_item_parasite_list (gint32 item_ID,
|
||||
gint *num_parasites,
|
||||
gchar ***parasites);
|
||||
#ifndef GIMP_DISABLE_DEPRECATED
|
||||
GimpParasite* gimp_drawable_parasite_find (gint32 drawable_ID,
|
||||
const gchar *name);
|
||||
|
|
|
@ -225,7 +225,7 @@ gfig_dialog (void)
|
|||
*/
|
||||
gfig_list = NULL;
|
||||
undo_level = -1;
|
||||
parasite = gimp_item_parasite_find (gfig_context->drawable_id, "gfig");
|
||||
parasite = gimp_item_find_parasite (gfig_context->drawable_id, "gfig");
|
||||
gfig_context->enable_repaint = FALSE;
|
||||
|
||||
/* debug */
|
||||
|
|
|
@ -730,7 +730,7 @@ gfig_save_as_parasite (void)
|
|||
|
||||
g_string_free (string, TRUE);
|
||||
|
||||
if (!gimp_item_parasite_attach (gfig_context->drawable_id, parasite))
|
||||
if (!gimp_item_attach_parasite (gfig_context->drawable_id, parasite))
|
||||
{
|
||||
g_message (_("Error trying to save figure as a parasite: "
|
||||
"can't attach parasite to drawable."));
|
||||
|
@ -750,7 +750,7 @@ gfig_load_from_parasite (void)
|
|||
GimpParasite *parasite;
|
||||
GFigObj *gfig;
|
||||
|
||||
parasite = gimp_item_parasite_find (gfig_context->drawable_id, "gfig");
|
||||
parasite = gimp_item_find_parasite (gfig_context->drawable_id, "gfig");
|
||||
if (! parasite)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -384,7 +384,7 @@ run (const gchar *name,
|
|||
/* Possibly retrieve data; first look for a parasite -
|
||||
* if not found, fall back to global values
|
||||
*/
|
||||
parasite = gimp_item_parasite_find (drawable->drawable_id,
|
||||
parasite = gimp_item_find_parasite (drawable->drawable_id,
|
||||
PLUG_IN_PARASITE);
|
||||
if (parasite)
|
||||
{
|
||||
|
@ -472,7 +472,7 @@ run (const gchar *name,
|
|||
GIMP_PARASITE_PERSISTENT |
|
||||
GIMP_PARASITE_UNDOABLE,
|
||||
strlen (str) + 1, str);
|
||||
gimp_item_parasite_attach (drawable->drawable_id, parasite);
|
||||
gimp_item_attach_parasite (drawable->drawable_id, parasite);
|
||||
gimp_parasite_free (parasite);
|
||||
|
||||
g_free (str);
|
||||
|
|
|
@ -229,7 +229,7 @@ drw_parasite_find(PyGimpDrawable *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "s:parasite_find", &name))
|
||||
return NULL;
|
||||
|
||||
return pygimp_parasite_new(gimp_item_parasite_find(self->ID, name));
|
||||
return pygimp_parasite_new(gimp_item_find_parasite(self->ID, name));
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
@ -241,7 +241,7 @@ drw_parasite_attach(PyGimpDrawable *self, PyObject *args)
|
|||
¶site))
|
||||
return NULL;
|
||||
|
||||
if (!gimp_item_parasite_attach(self->ID, parasite->para)) {
|
||||
if (!gimp_item_attach_parasite(self->ID, parasite->para)) {
|
||||
PyErr_Format(pygimp_error,
|
||||
"could not attach parasite '%s' on drawable (ID %d)",
|
||||
gimp_parasite_name(parasite->para), self->ID);
|
||||
|
@ -291,7 +291,7 @@ drw_parasite_detach(PyGimpDrawable *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "s:detach_parasite", &name))
|
||||
return NULL;
|
||||
|
||||
if (!gimp_item_parasite_detach(self->ID, name)) {
|
||||
if (!gimp_item_detach_parasite(self->ID, name)) {
|
||||
PyErr_Format(pygimp_error,
|
||||
"could not detach parasite '%s' from drawable (ID %d)",
|
||||
name, self->ID);
|
||||
|
@ -308,7 +308,7 @@ drw_parasite_list(PyGimpDrawable *self)
|
|||
gint num_parasites;
|
||||
gchar **parasites;
|
||||
|
||||
if (gimp_item_parasite_list(self->ID, &num_parasites, ¶sites)) {
|
||||
if (gimp_item_list_parasites(self->ID, &num_parasites, ¶sites)) {
|
||||
PyObject *ret;
|
||||
gint i;
|
||||
|
||||
|
|
|
@ -650,7 +650,7 @@ vectors_parasite_find(PyGimpVectors *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "s:parasite_find", &name))
|
||||
return NULL;
|
||||
|
||||
return pygimp_parasite_new(gimp_item_parasite_find(self->ID, name));
|
||||
return pygimp_parasite_new(gimp_item_find_parasite(self->ID, name));
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
@ -662,7 +662,7 @@ vectors_parasite_attach(PyGimpVectors *self, PyObject *args)
|
|||
¶site))
|
||||
return NULL;
|
||||
|
||||
if (!gimp_item_parasite_attach(self->ID, parasite->para)) {
|
||||
if (!gimp_item_attach_parasite(self->ID, parasite->para)) {
|
||||
PyErr_Format(pygimp_error,
|
||||
"could not attach parasite '%s' to vectors (ID %d)",
|
||||
parasite->para->name, self->ID);
|
||||
|
@ -681,7 +681,7 @@ vectors_parasite_detach(PyGimpVectors *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "s:parasite_detach", &name))
|
||||
return NULL;
|
||||
|
||||
if (!gimp_item_parasite_detach(self->ID, name)) {
|
||||
if (!gimp_item_detach_parasite(self->ID, name)) {
|
||||
PyErr_Format(pygimp_error,
|
||||
"could not detach parasite '%s' from vectors (ID %d)",
|
||||
name, self->ID);
|
||||
|
@ -698,7 +698,7 @@ vectors_parasite_list(PyGimpVectors *self)
|
|||
gint num_parasites;
|
||||
gchar **parasites;
|
||||
|
||||
if (gimp_item_parasite_list(self->ID, &num_parasites, ¶sites)) {
|
||||
if (gimp_item_list_parasites(self->ID, &num_parasites, ¶sites)) {
|
||||
PyObject *ret;
|
||||
gint i;
|
||||
|
||||
|
|
|
@ -682,6 +682,115 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub item_attach_parasite {
|
||||
$blurb = 'Add a parasite to an item.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure attaches a parasite to an item. It has no return values.
|
||||
HELP
|
||||
|
||||
&jay_pdb_misc('1998', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'item', type => 'item',
|
||||
desc => 'The item' },
|
||||
{ name => 'parasite', type => 'parasite',
|
||||
desc => 'The parasite to attach to the item' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_item_parasite_attach (item, parasite, TRUE);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub item_detach_parasite {
|
||||
$blurb = 'Removes a parasite from an item.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure detaches a parasite from an item. It has no return values.
|
||||
HELP
|
||||
|
||||
&jay_pdb_misc('1998', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'item', type => 'item',
|
||||
desc => 'The item' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the parasite to detach from the item.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_item_parasite_detach (item, name, TRUE);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub item_find_parasite {
|
||||
$blurb = 'Look up a parasite in an item';
|
||||
|
||||
$help = <<'HELP';
|
||||
Finds and returns the parasite that is attached to an item.
|
||||
HELP
|
||||
|
||||
&jay_pdb_misc('1998', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'item', type => 'item',
|
||||
desc => 'The item' },
|
||||
{ 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 (item, name));
|
||||
|
||||
if (! parasite)
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub item_list_parasites {
|
||||
$blurb = 'List all parasites.';
|
||||
$help = 'Returns a list of all parasites currently attached the an item.';
|
||||
|
||||
&marc_pdb_misc('1999', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'item', type => 'item',
|
||||
desc => 'The item' }
|
||||
);
|
||||
|
||||
@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 (item, &num_parasites);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
@headers = qw("core/gimplayermask.h"
|
||||
"core/gimplist.h"
|
||||
"core/gimpselection.h"
|
||||
|
@ -708,7 +817,10 @@ CODE
|
|||
item_get_visible item_set_visible
|
||||
item_get_linked item_set_linked
|
||||
item_get_lock_content item_set_lock_content
|
||||
item_get_tattoo item_set_tattoo);
|
||||
item_get_tattoo item_set_tattoo
|
||||
item_attach_parasite item_detach_parasite
|
||||
item_find_parasite
|
||||
item_list_parasites);
|
||||
|
||||
%exports = (app => [@procs], lib => [@procs]);
|
||||
|
||||
|
|
|
@ -223,117 +223,8 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub item_parasite_find {
|
||||
$blurb = 'Look up a parasite in an item';
|
||||
|
||||
$help = <<'HELP';
|
||||
Finds and returns the parasite that is attached to an item.
|
||||
HELP
|
||||
|
||||
&jay_pdb_misc('1998', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'item', type => 'item',
|
||||
desc => 'The item' },
|
||||
{ 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 (item, name));
|
||||
|
||||
if (! parasite)
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub item_parasite_attach {
|
||||
$blurb = 'Add a parasite to an item.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure attaches a parasite to an item. It has no return values.
|
||||
HELP
|
||||
|
||||
&jay_pdb_misc('1998', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'item', type => 'item',
|
||||
desc => 'The item' },
|
||||
{ name => 'parasite', type => 'parasite',
|
||||
desc => 'The parasite to attach to the item' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_item_parasite_attach (item, parasite, TRUE);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub item_parasite_detach {
|
||||
$blurb = 'Removes a parasite from an item.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure detaches a parasite from an item. It has no return values.
|
||||
HELP
|
||||
|
||||
&jay_pdb_misc('1998', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'item', type => 'item',
|
||||
desc => 'The item' },
|
||||
{ name => 'name', type => 'string',
|
||||
desc => 'The name of the parasite to detach from the item.' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_item_parasite_detach (item, name, TRUE);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub item_parasite_list {
|
||||
$blurb = 'List all parasites.';
|
||||
$help = 'Returns a list of all parasites currently attached the an item.';
|
||||
|
||||
&marc_pdb_misc('1999', '2.8');
|
||||
|
||||
@inargs = (
|
||||
{ name => 'item', type => 'item',
|
||||
desc => 'The item' }
|
||||
);
|
||||
|
||||
@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 (item, &num_parasites);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub drawable_parasite_find {
|
||||
&std_pdb_deprecated ('gimp-item-parasite-find');
|
||||
&std_pdb_deprecated ('gimp-item-find-parasite');
|
||||
&jay_pdb_misc('1998');
|
||||
|
||||
@inargs = (
|
||||
|
@ -362,7 +253,7 @@ CODE
|
|||
}
|
||||
|
||||
sub drawable_parasite_attach {
|
||||
&std_pdb_deprecated ('gimp-item-parasite-attach');
|
||||
&std_pdb_deprecated ('gimp-item-attach-parasite');
|
||||
&jay_pdb_misc('1998');
|
||||
|
||||
@inargs = (
|
||||
|
@ -382,7 +273,7 @@ CODE
|
|||
}
|
||||
|
||||
sub drawable_parasite_detach {
|
||||
&std_pdb_deprecated ('gimp-item-parasite-detach');
|
||||
&std_pdb_deprecated ('gimp-item-detach-parasite');
|
||||
&jay_pdb_misc('1998');
|
||||
|
||||
@inargs = (
|
||||
|
@ -402,7 +293,7 @@ CODE
|
|||
}
|
||||
|
||||
sub drawable_parasite_list {
|
||||
&std_pdb_deprecated ('gimp-item-parasite-list');
|
||||
&std_pdb_deprecated ('gimp-item-list-parasites');
|
||||
&marc_pdb_misc('1999');
|
||||
|
||||
@inargs = (
|
||||
|
@ -426,7 +317,7 @@ CODE
|
|||
}
|
||||
|
||||
sub vectors_parasite_find {
|
||||
&std_pdb_deprecated ('gimp-item-parasite-find');
|
||||
&std_pdb_deprecated ('gimp-item-find-parasite');
|
||||
&mitch_pdb_misc('2006', '2.4');
|
||||
|
||||
@inargs = (
|
||||
|
@ -455,7 +346,7 @@ CODE
|
|||
}
|
||||
|
||||
sub vectors_parasite_attach {
|
||||
&std_pdb_deprecated ('gimp-item-parasite-attach');
|
||||
&std_pdb_deprecated ('gimp-item-attach--parasite');
|
||||
&mitch_pdb_misc('2006', '2.4');
|
||||
|
||||
@inargs = (
|
||||
|
@ -475,7 +366,7 @@ CODE
|
|||
}
|
||||
|
||||
sub vectors_parasite_detach {
|
||||
&std_pdb_deprecated ('gimp-item-parasite-detach');
|
||||
&std_pdb_deprecated ('gimp-item-detach-parasite');
|
||||
&mitch_pdb_misc('2006', '2.4');
|
||||
|
||||
@inargs = (
|
||||
|
@ -495,7 +386,7 @@ CODE
|
|||
}
|
||||
|
||||
sub vectors_parasite_list {
|
||||
&std_pdb_deprecated ('gimp-item-parasite-list');
|
||||
&std_pdb_deprecated ('gimp-item-list-parasites');
|
||||
&mitch_pdb_misc('2006', '2.4');
|
||||
|
||||
@inargs = (
|
||||
|
@ -527,9 +418,6 @@ CODE
|
|||
image_parasite_find
|
||||
image_parasite_attach image_parasite_detach
|
||||
image_parasite_list
|
||||
item_parasite_find
|
||||
item_parasite_attach item_parasite_detach
|
||||
item_parasite_list
|
||||
drawable_parasite_find
|
||||
drawable_parasite_attach drawable_parasite_detach
|
||||
drawable_parasite_list
|
||||
|
|
Loading…
Reference in New Issue