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
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2000-02-26 11:41:06 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-02-26 11:41:06 +08:00
|
|
|
*
|
|
|
|
* 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
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2000-02-26 11:41:06 +08:00
|
|
|
*/
|
2000-05-31 14:15:06 +08:00
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2000-06-02 05:18:04 +08:00
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1998-10-30 18:21:33 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION: gimpparasite
|
|
|
|
* @title: gimpparasite
|
|
|
|
* @short_description: Operations related to parasites.
|
|
|
|
*
|
|
|
|
* Operations related to parasites.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_parasite_find:
|
|
|
|
* @name: The name of the parasite to find.
|
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* Look up a global parasite.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* Finds and returns the global parasite that was previously attached.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: The found parasite.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
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",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
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:
|
2006-12-22 17:49:36 +08:00
|
|
|
* @parasite: The parasite to attach.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* Add a global parasite.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* This procedure attaches a global parasite. It has no return values.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
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",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
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:
|
2006-12-22 17:49:36 +08:00
|
|
|
* @name: The name of the parasite to detach.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* Removes a global parasite.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* This procedure detaches a global parasite from. It has no return
|
2000-08-25 07:06:53 +08:00
|
|
|
* values.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
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",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
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.
|
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* Returns a list of all currently attached global parasites.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-08-22 05:23:31 +08:00
|
|
|
gimp_parasite_list (gint *num_parasites,
|
2006-04-12 18:27:31 +08:00
|
|
|
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",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
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++)
|
2006-04-12 18:38:15 +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.
|
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* Look up a parasite in an image
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
2006-12-22 17:49:36 +08:00
|
|
|
* Finds and returns the parasite that was previously attached to an
|
|
|
|
* image.
|
2006-03-22 20:15:06 +08:00
|
|
|
*
|
|
|
|
* Returns: The found parasite.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2006-03-22 20:15:06 +08:00
|
|
|
GimpParasite *
|
|
|
|
gimp_image_parasite_find (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name)
|
2006-03-22 20:15:06 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
GimpParasite *parasite = NULL;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-parasite-find",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2006-03-22 20:15:06 +08:00
|
|
|
|
|
|
|
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.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2006-03-22 20:15:06 +08:00
|
|
|
gboolean
|
2006-04-03 00:03:32 +08:00
|
|
|
gimp_image_parasite_attach (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
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",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_PARASITE, parasite,
|
|
|
|
GIMP_PDB_END);
|
2006-03-22 20:15:06 +08:00
|
|
|
|
|
|
|
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.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2006-03-22 20:15:06 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_parasite_detach (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *name)
|
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-detach",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, name,
|
|
|
|
GIMP_PDB_END);
|
2006-03-22 20:15:06 +08:00
|
|
|
|
|
|
|
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.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2006-03-22 20:15:06 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_parasite_list (gint32 image_ID,
|
2006-04-12 18:27:31 +08:00
|
|
|
gint *num_parasites,
|
|
|
|
gchar ***parasites)
|
2006-03-22 20:15:06 +08:00
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-image-parasite-list",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_END);
|
2006-03-22 20:15:06 +08:00
|
|
|
|
|
|
|
*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++)
|
2006-04-12 18:38:15 +08:00
|
|
|
(*parasites)[i] = g_strdup (return_vals[2].data.d_stringarray[i]);
|
2006-03-22 20:15:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|