2006-12-10 05:33:38 +08:00
/* GIMP - The GNU Image Manipulation Program
2003-07-03 08:47:26 +08:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1999-04-13 15:09:33 +08:00
*
2009-01-18 06:28:01 +08:00
* This program is free software : you can redistribute it and / or modify
1999-04-13 15:09:33 +08:00
* it under the terms of the GNU General Public License as published by
2009-01-18 06:28:01 +08:00
* the Free Software Foundation ; either version 3 of the License , or
1999-04-13 15:09:33 +08:00
* ( at your option ) any later version .
*
* This program 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 General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2009-01-18 06:28:01 +08:00
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
1999-04-13 15:09:33 +08:00
*/
2007-01-09 18:52:47 +08:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
1999-04-13 15:09:33 +08:00
2000-12-29 23:22:01 +08:00
# include "config.h"
2008-10-10 04:24:04 +08:00
# include <gegl.h>
2000-12-29 23:22:01 +08:00
2004-05-07 07:26:45 +08:00
# include "libgimpbase/gimpbase.h"
2001-08-17 22:27:31 +08:00
# include "pdb-types.h"
1999-04-13 15:09:33 +08:00
2011-03-08 21:31:04 +08:00
# include "core/gimp-parasites.h"
2012-04-24 03:13:57 +08:00
# include "core/gimp-utils.h"
2002-12-05 23:49:59 +08:00
# include "core/gimp.h"
2008-02-08 01:08:54 +08:00
# include "core/gimpparamspecs.h"
1999-05-01 05:11:27 +08:00
2008-02-08 01:08:54 +08:00
# include "gimppdb.h"
# include "gimpprocedure.h"
2008-04-04 19:15:55 +08:00
# include "internal-procs.h"
2006-11-01 03:02:56 +08:00
1999-04-13 15:09:33 +08:00
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
version_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-04-13 15:09:33 +08:00
{
2006-04-04 18:30:58 +08:00
GValueArray * return_vals ;
2006-03-15 23:00:01 +08:00
gchar * version = NULL ;
version = g_strdup ( GIMP_VERSION ) ;
1999-04-13 15:09:33 +08:00
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , TRUE , NULL ) ;
2006-04-04 18:30:58 +08:00
g_value_take_string ( & return_vals - > values [ 1 ] , version ) ;
1999-04-13 15:09:33 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
1999-04-13 15:09:33 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
getpid_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
2005-07-25 07:34:25 +08:00
{
2006-04-04 18:30:58 +08:00
GValueArray * return_vals ;
2006-03-15 23:00:01 +08:00
gint32 pid = 0 ;
2012-04-24 03:13:57 +08:00
pid = gimp_get_pid ( ) ;
2005-07-25 07:34:25 +08:00
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , TRUE , NULL ) ;
2006-04-04 18:30:58 +08:00
g_value_set_int ( & return_vals - > values [ 1 ] , pid ) ;
2005-07-25 07:34:25 +08:00
2006-03-28 05:09:32 +08:00
return return_vals ;
2005-07-25 07:34:25 +08:00
}
2006-04-04 18:30:58 +08:00
static GValueArray *
2007-12-03 02:05:54 +08:00
quit_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
1999-05-01 05:11:27 +08:00
{
2006-03-30 07:56:07 +08:00
gboolean success = TRUE ;
2003-12-01 00:05:56 +08:00
gboolean force ;
1999-05-01 05:11:27 +08:00
2006-04-04 18:30:58 +08:00
force = g_value_get_boolean ( & args - > values [ 0 ] ) ;
1999-05-01 05:11:27 +08:00
2006-03-30 07:56:07 +08:00
if ( success )
{
gimp_exit ( gimp , force ) ;
}
1999-05-01 05:11:27 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-05-01 05:11:27 +08:00
}
2011-03-08 21:31:04 +08:00
static GValueArray *
attach_parasite_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
const GimpParasite * parasite ;
parasite = g_value_get_boxed ( & args - > values [ 0 ] ) ;
if ( success )
{
gimp_parasite_attach ( gimp , parasite ) ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
static GValueArray *
detach_parasite_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
const gchar * name ;
name = g_value_get_string ( & args - > values [ 0 ] ) ;
if ( success )
{
gimp_parasite_detach ( gimp , name ) ;
}
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
}
static GValueArray *
get_parasite_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
{
gboolean success = TRUE ;
GValueArray * return_vals ;
const gchar * name ;
GimpParasite * parasite = NULL ;
name = g_value_get_string ( & args - > values [ 0 ] ) ;
if ( success )
{
parasite = gimp_parasite_copy ( gimp_parasite_find ( gimp , 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 *
get_parasite_list_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GValueArray * args ,
GError * * error )
{
GValueArray * return_vals ;
gint32 num_parasites = 0 ;
gchar * * parasites = NULL ;
parasites = gimp_parasite_list ( gimp , & num_parasites ) ;
return_vals = gimp_procedure_get_return_values ( procedure , TRUE , NULL ) ;
g_value_set_int ( & return_vals - > values [ 1 ] , num_parasites ) ;
gimp_value_take_stringarray ( & return_vals - > values [ 2 ] , parasites , num_parasites ) ;
return return_vals ;
}
2006-04-05 05:11:45 +08:00
void
2011-03-08 20:58:56 +08:00
register_gimp_procs ( GimpPDB * pdb )
1999-05-01 05:11:27 +08:00
{
2006-04-05 05:11:45 +08:00
GimpProcedure * procedure ;
/*
* gimp - version
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( version_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-version " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-version " ,
2006-12-22 17:49:36 +08:00
" Returns the host GIMP version. " ,
" This procedure returns the version number of the currently running GIMP. " ,
2006-04-05 05:11:45 +08:00
" Manish Singh " ,
" Manish Singh " ,
" 1999 " ,
NULL ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_string ( " version " ,
" version " ,
2006-12-22 17:49:36 +08:00
" GIMP version number " ,
2007-04-25 22:23:05 +08:00
FALSE , FALSE , FALSE ,
2006-04-05 05:11:45 +08:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - getpid
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( getpid_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-getpid " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-getpid " ,
2006-12-22 17:49:36 +08:00
" Returns the PID of the host GIMP process. " ,
" This procedure returns the process ID of the currently running GIMP. " ,
2006-04-05 05:11:45 +08:00
" Michael Natterer <mitch@gimp.org> " ,
" Michael Natterer " ,
" 2005 " ,
NULL ) ;
gimp_procedure_add_return_value ( procedure ,
gimp_param_spec_int32 ( " pid " ,
" pid " ,
" The PID " ,
G_MININT32 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - quit
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( quit_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-quit " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-quit " ,
2006-12-22 17:49:36 +08:00
" Causes GIMP to exit gracefully. " ,
" If there are unsaved images in an interactive GIMP session, the user will be asked for confirmation. If force is TRUE, the application is quit without querying the user to save any dirty images. " ,
2006-04-05 05:11:45 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " force " ,
" force " ,
2006-12-22 17:49:36 +08:00
" Force GIMP to quit without asking " ,
2006-04-05 05:11:45 +08:00
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2011-03-08 21:31:04 +08:00
/*
* gimp - attach - parasite
*/
procedure = gimp_procedure_new ( attach_parasite_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-attach-parasite " ) ;
gimp_procedure_set_static_strings ( procedure ,
" gimp-attach-parasite " ,
" Add a global parasite. " ,
" This procedure attaches a global parasite. It has no return values. " ,
" Jay Cox " ,
" Jay Cox " ,
" 1998 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_parasite ( " parasite " ,
" parasite " ,
" The parasite to attach " ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - detach - parasite
*/
procedure = gimp_procedure_new ( detach_parasite_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-detach-parasite " ) ;
gimp_procedure_set_static_strings ( procedure ,
" gimp-detach-parasite " ,
" Removes a global parasite. " ,
" This procedure detaches a global parasite from. It has no return values. " ,
" Jay Cox " ,
" Jay Cox " ,
" 1998 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " name " ,
" name " ,
" The name of the parasite to detach. " ,
FALSE , FALSE , FALSE ,
NULL ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
/*
* gimp - get - parasite
*/
procedure = gimp_procedure_new ( get_parasite_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-get-parasite " ) ;
gimp_procedure_set_static_strings ( procedure ,
" gimp-get-parasite " ,
" Look up a global parasite. " ,
" Finds and returns the global parasite that was previously attached. " ,
" Jay Cox " ,
" Jay Cox " ,
" 1998 " ,
NULL ) ;
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 - get - parasite - list
*/
procedure = gimp_procedure_new ( get_parasite_list_invoker ) ;
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-get-parasite-list " ) ;
gimp_procedure_set_static_strings ( procedure ,
" gimp-get-parasite-list " ,
" List all parasites. " ,
" Returns a list of all currently attached global parasites. " ,
" Marc Lehmann " ,
" Marc Lehmann " ,
" 1999 " ,
NULL ) ;
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 ) ;
2006-04-05 05:11:45 +08:00
}