2000-05-31 14:15:06 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-02-26 11:41:06 +08:00
|
|
|
*
|
2000-06-02 05:18:04 +08:00
|
|
|
* gimpparasite_pdb.c
|
2000-02-26 11:41:06 +08:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-05-31 14:15:06 +08:00
|
|
|
|
2000-06-02 05:18:04 +08:00
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl */
|
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_parasite_find:
|
|
|
|
* @name: The name of the parasite to find.
|
|
|
|
*
|
|
|
|
* Finds the named parasite.
|
|
|
|
*
|
|
|
|
* Finds and returns the named parasite that was previously attached to
|
|
|
|
* the gimp.
|
|
|
|
*
|
|
|
|
* Returns: The found parasite.
|
|
|
|
*/
|
2000-05-27 06:28:40 +08:00
|
|
|
GimpParasite *
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_parasite_find (const gchar *name)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-02 05:18:04 +08:00
|
|
|
GimpParasite *parasite = NULL;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-parasite-find",
|
1998-10-30 18:21:33 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-06-02 05:18:04 +08:00
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
return parasite;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_parasite_attach:
|
|
|
|
* @parasite: The parasite to attach to the gimp.
|
|
|
|
*
|
|
|
|
* Add a parasite to the gimp.
|
|
|
|
*
|
|
|
|
* This procedure attaches a parasite to the gimp. It has no return
|
|
|
|
* values.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2006-04-03 00:03:32 +08:00
|
|
|
gimp_parasite_attach (const GimpParasite *parasite)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-parasite-attach",
|
1998-10-30 18:21:33 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_PARASITE, parasite,
|
|
|
|
GIMP_PDB_END);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1998-10-30 18:21:33 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_parasite_detach:
|
|
|
|
* @name: The name of the parasite to detach from the gimp.
|
|
|
|
*
|
|
|
|
* Removes a parasite from the gimp.
|
|
|
|
*
|
|
|
|
* This procedure detaches a parasite from the gimp. It has no return
|
|
|
|
* values.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_parasite_detach (const gchar *name)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-parasite-detach",
|
2000-06-01 05:16:11 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_parasite_list:
|
|
|
|
* @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.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-08-22 05:23:31 +08:00
|
|
|
gimp_parasite_list (gint *num_parasites,
|
|
|
|
gchar ***parasites)
|
2000-06-02 05:18:04 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 05:18:04 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-02 05:18:04 +08:00
|
|
|
gint i;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-parasite-list",
|
2000-06-02 05:18:04 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_END);
|
2000-06-02 05:18:04 +08:00
|
|
|
|
|
|
|
*num_parasites = 0;
|
|
|
|
*parasites = NULL;
|
2000-08-22 05:23:31 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
2000-06-02 05:18:04 +08:00
|
|
|
{
|
|
|
|
*num_parasites = return_vals[1].data.d_int32;
|
2000-08-22 05:23:31 +08:00
|
|
|
*parasites = g_new (gchar *, *num_parasites);
|
2000-06-02 05:18:04 +08:00
|
|
|
for (i = 0; i < *num_parasites; i++)
|
2000-08-22 05:23:31 +08:00
|
|
|
(*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
2000-06-02 05:18:04 +08:00
|
|
|
}
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-06-02 05:18:04 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-02 05:18:04 +08:00
|
|
|
}
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
/**
|
|
|
|
* 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
|
2006-04-03 00:03:32 +08:00
|
|
|
gimp_image_parasite_attach (gint32 image_ID,
|
|
|
|
const GimpParasite *parasite)
|
2006-03-22 20:15:06 +08:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_drawable_parasite_find:
|
|
|
|
* @drawable_ID: The drawable.
|
|
|
|
* @name: The name of the parasite to find.
|
|
|
|
*
|
|
|
|
* Finds the named parasite in a drawable
|
|
|
|
*
|
|
|
|
* Finds and returns the named parasite that was previously attached to
|
|
|
|
* a drawable.
|
|
|
|
*
|
|
|
|
* Returns: The found parasite.
|
|
|
|
*/
|
2000-06-02 05:18:04 +08:00
|
|
|
GimpParasite *
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_drawable_parasite_find (gint32 drawable_ID,
|
|
|
|
const gchar *name)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-02 05:18:04 +08:00
|
|
|
GimpParasite *parasite = NULL;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-drawable-parasite-find",
|
2000-06-01 05:16:11 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-06-02 05:18:04 +08:00
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
return parasite;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_drawable_parasite_attach:
|
|
|
|
* @drawable_ID: The drawable.
|
|
|
|
* @parasite: The parasite to attach to a drawable.
|
|
|
|
*
|
|
|
|
* Add a parasite to a drawable.
|
|
|
|
*
|
|
|
|
* This procedure attaches a parasite to a drawable. It has no return
|
|
|
|
* values.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2006-04-03 00:03:32 +08:00
|
|
|
gimp_drawable_parasite_attach (gint32 drawable_ID,
|
|
|
|
const GimpParasite *parasite)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-drawable-parasite-attach",
|
1998-10-30 18:21:33 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_PARASITE, parasite,
|
|
|
|
GIMP_PDB_END);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1998-10-30 18:21:33 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_drawable_parasite_detach:
|
|
|
|
* @drawable_ID: The drawable.
|
|
|
|
* @name: The name of the parasite to detach from a drawable.
|
|
|
|
*
|
|
|
|
* Removes a parasite from a drawable.
|
|
|
|
*
|
|
|
|
* This procedure detaches a parasite from a drawable. It has no return
|
|
|
|
* values.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_drawable_parasite_detach (gint32 drawable_ID,
|
|
|
|
const gchar *name)
|
1998-10-30 18:21:33 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-03-26 02:49:05 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-drawable-parasite-detach",
|
2000-06-01 05:16:11 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-02 05:18:04 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-02 05:18:04 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_drawable_parasite_list:
|
|
|
|
* @drawable_ID: The drawable.
|
|
|
|
* @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.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-08-22 05:23:31 +08:00
|
|
|
gimp_drawable_parasite_list (gint32 drawable_ID,
|
|
|
|
gint *num_parasites,
|
|
|
|
gchar ***parasites)
|
2000-06-02 05:18:04 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 05:18:04 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-02 05:18:04 +08:00
|
|
|
gint i;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-drawable-parasite-list",
|
2000-06-02 05:18:04 +08:00
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_DRAWABLE, drawable_ID,
|
|
|
|
GIMP_PDB_END);
|
2000-06-02 05:18:04 +08:00
|
|
|
|
|
|
|
*num_parasites = 0;
|
|
|
|
*parasites = NULL;
|
2000-08-22 05:23:31 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
2000-06-02 05:18:04 +08:00
|
|
|
{
|
|
|
|
*num_parasites = return_vals[1].data.d_int32;
|
2000-08-22 05:23:31 +08:00
|
|
|
*parasites = g_new (gchar *, *num_parasites);
|
2000-06-02 05:18:04 +08:00
|
|
|
for (i = 0; i < *num_parasites; i++)
|
2000-08-22 05:23:31 +08:00
|
|
|
(*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
2000-06-02 05:18:04 +08:00
|
|
|
}
|
2000-06-01 05:16:11 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_vectors_parasite_find:
|
|
|
|
* @vectors_ID: The vectors object.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @name: The name of the parasite to find.
|
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Finds the named parasite in a vectors object
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Finds and returns the named parasite that was previously attached to
|
2006-03-22 20:15:06 +08:00
|
|
|
* a vectors object.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The found parasite.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2000-06-01 05:16:11 +08:00
|
|
|
GimpParasite *
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_vectors_parasite_find (gint32 vectors_ID,
|
|
|
|
const gchar *name)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint nreturn_vals;
|
2000-06-01 22:59:22 +08:00
|
|
|
GimpParasite *parasite = NULL;
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-vectors-parasite-find",
|
2000-06-01 05:16:11 +08:00
|
|
|
&nreturn_vals,
|
2006-03-22 20:15:06 +08:00
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
parasite = gimp_parasite_copy (&return_vals[1].data.d_parasite);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-06-02 05:18:04 +08:00
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
return parasite;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_vectors_parasite_attach:
|
|
|
|
* @vectors_ID: The vectors object.
|
|
|
|
* @parasite: The parasite to attach to a vectors object.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Add a parasite to a vectors object
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure attaches a parasite to a vectors object. It has no
|
|
|
|
* return values.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2006-04-03 00:03:32 +08:00
|
|
|
gimp_vectors_parasite_attach (gint32 vectors_ID,
|
|
|
|
const GimpParasite *parasite)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-vectors-parasite-attach",
|
2000-06-01 05:16:11 +08:00
|
|
|
&nreturn_vals,
|
2006-03-22 20:15:06 +08:00
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_PARASITE, parasite,
|
|
|
|
GIMP_PDB_END);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_vectors_parasite_detach:
|
|
|
|
* @vectors_ID: The vectors object.
|
|
|
|
* @name: The name of the parasite to detach from a vectors object.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* Removes a parasite from a vectors object
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-03-22 20:15:06 +08:00
|
|
|
* This procedure detaches a parasite from a vectors object. It has no
|
|
|
|
* return values.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_vectors_parasite_detach (gint32 vectors_ID,
|
|
|
|
const gchar *name)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-01 05:16:11 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-vectors-parasite-detach",
|
1998-10-30 18:21:33 +08:00
|
|
|
&nreturn_vals,
|
2006-03-22 20:15:06 +08:00
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
1998-10-30 18:21:33 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
1998-10-30 18:21:33 +08:00
|
|
|
}
|
2000-06-02 05:18:04 +08:00
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
2006-03-22 20:15:06 +08:00
|
|
|
* gimp_vectors_parasite_list:
|
|
|
|
* @vectors_ID: The vectors object.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @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.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2000-08-25 07:06:53 +08:00
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2006-03-22 20:15:06 +08:00
|
|
|
gimp_vectors_parasite_list (gint32 vectors_ID,
|
|
|
|
gint *num_parasites,
|
|
|
|
gchar ***parasites)
|
2000-06-02 05:18:04 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 05:18:04 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-02 05:18:04 +08:00
|
|
|
gint i;
|
|
|
|
|
2006-03-22 20:15:06 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-vectors-parasite-list",
|
2000-06-02 05:18:04 +08:00
|
|
|
&nreturn_vals,
|
2006-03-22 20:15:06 +08:00
|
|
|
GIMP_PDB_VECTORS, vectors_ID,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_END);
|
2000-06-02 05:18:04 +08:00
|
|
|
|
|
|
|
*num_parasites = 0;
|
|
|
|
*parasites = NULL;
|
2000-08-22 05:23:31 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
2000-06-02 05:18:04 +08:00
|
|
|
{
|
|
|
|
*num_parasites = return_vals[1].data.d_int32;
|
2000-08-22 05:23:31 +08:00
|
|
|
*parasites = g_new (gchar *, *num_parasites);
|
2000-06-02 05:18:04 +08:00
|
|
|
for (i = 0; i < *num_parasites; i++)
|
2000-08-22 05:23:31 +08:00
|
|
|
(*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
2000-06-02 05:18:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-02 05:18:04 +08:00
|
|
|
}
|