forgot to commit this last weekend :)

2000-08-04  Michael Natterer  <mitch@gimp.org>
	    Sven Neumann  <sven@gimp.org>

	* libgimp/gimp.h
	* libgimp/gimpcompat.h
	* plug-ins/common/curve_bend.c
	* plug-ins/common/plugindetails.c
	* plug-ins/dbbrowser/dbbrowser_utils.c
	* plug-ins/gap/gap_dbbrowser_utils.c
	* plug-ins/gap/gap_filter_codegen.c
	* plug-ins/gap/gap_filter_pdb.c
	* plug-ins/gap/gap_pdb_calls.c
	* plug-ins/maze/maze_face.c
	* plug-ins/pygimp/gimpmodule.c
	* plug-ins/script-fu/script-fu-scripts.c
	* plug-ins/script-fu/script-fu.c
	* plug-ins/xjt/xpdb_calls.c: removed COMPAT_CRUFT
This commit is contained in:
Michael Natterer 2000-08-07 21:30:35 +00:00 committed by Michael Natterer
parent 64b27852cb
commit 95ccd16f0c
22 changed files with 487 additions and 460 deletions

View File

@ -1,8 +1,26 @@
2000-08-04 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org>
* libgimp/gimp.h
* libgimp/gimpcompat.h
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/dbbrowser/dbbrowser_utils.c
* plug-ins/gap/gap_dbbrowser_utils.c
* plug-ins/gap/gap_filter_codegen.c
* plug-ins/gap/gap_filter_pdb.c
* plug-ins/gap/gap_pdb_calls.c
* plug-ins/maze/maze_face.c
* plug-ins/pygimp/gimpmodule.c
* plug-ins/script-fu/script-fu-scripts.c
* plug-ins/script-fu/script-fu.c
* plug-ins/xjt/xpdb_calls.c: removed COMPAT_CRUFT
2000-08-07 Sven Neumann <sven@gimp.org> 2000-08-07 Sven Neumann <sven@gimp.org>
* plug-ins/gdyntext/gdyntext.[ch] * plug-ins/gdyntext/gdyntext.[ch]
* lug-ins/gdyntext/gdyntext_ui.c: use a GimpColorButton to select * lug-ins/gdyntext/gdyntext_ui.c: use a GimpColorButton to select
the text color (fixes bug #5302). Reintended the code so it becomes the text color (fixes bug #5302). Reindented the code so it becomes
readable. readable.
2000-08-07 Sven Neumann <sven@gimp.org> 2000-08-07 Sven Neumann <sven@gimp.org>

View File

@ -48,7 +48,7 @@
#include <libgimp/gimp_pdb.h> #include <libgimp/gimp_pdb.h>
#include <libgimp/gimpcompat.h> /* to be removed in 1.3 */ #include <libgimp/gimpcompat.h> /* to be removed before 1.2 */
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
# include <stdlib.h> /* For _-argc and __argv */ # include <stdlib.h> /* For _-argc and __argv */
@ -69,7 +69,6 @@ extern "C" {
#define gimp_get_data gimp_procedural_db_get_data #define gimp_get_data gimp_procedural_db_get_data
#define gimp_get_data_size gimp_procedural_db_get_data_size #define gimp_get_data_size gimp_procedural_db_get_data_size
#define gimp_set_data gimp_procedural_db_set_data #define gimp_set_data gimp_procedural_db_set_data
#define gimp_query_procedure gimp_procedural_db_proc_info
GIMPVAR guint gimp_major_version; GIMPVAR guint gimp_major_version;

View File

@ -65,6 +65,8 @@ extern "C" {
#define gimp_plugin_help_func gimp_standard_help_func #define gimp_plugin_help_func gimp_standard_help_func
#define gimp_query_database gimp_procedural_db_query #define gimp_query_database gimp_procedural_db_query
#define gimp_query_procedure gimp_procedural_db_proc_info
#define gimp_query_images gimp_image_list #define gimp_query_images gimp_image_list
#define Parasite GimpParasite #define Parasite GimpParasite

View File

@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser,
g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_params);
g_free (dbbrowser->selected_return_vals); g_free (dbbrowser->selected_return_vals);
gimp_query_procedure (proc_name, gimp_procedural_db_proc_info (proc_name,
&(dbbrowser->selected_proc_blurb), &(dbbrowser->selected_proc_blurb),
&(dbbrowser->selected_proc_help), &(dbbrowser->selected_proc_help),
&(dbbrowser->selected_proc_author), &(dbbrowser->selected_proc_author),
&(dbbrowser->selected_proc_copyright), &(dbbrowser->selected_proc_copyright),
&(dbbrowser->selected_proc_date), &(dbbrowser->selected_proc_date),
&(dbbrowser->selected_proc_type), &(dbbrowser->selected_proc_type),
&(dbbrowser->selected_nparams), &(dbbrowser->selected_nparams),
&(dbbrowser->selected_nreturn_vals), &(dbbrowser->selected_nreturn_vals),
&(dbbrowser->selected_params), &(dbbrowser->selected_params),
&(dbbrowser->selected_return_vals)); &(dbbrowser->selected_return_vals));
/* save the "old" table */ /* save the "old" table */
old_table = dbbrowser->descr_table; old_table = dbbrowser->descr_table;

View File

@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser,
g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_params);
g_free (dbbrowser->selected_return_vals); g_free (dbbrowser->selected_return_vals);
gimp_query_procedure (proc_name, gimp_procedural_db_proc_info (proc_name,
&(dbbrowser->selected_proc_blurb), &(dbbrowser->selected_proc_blurb),
&(dbbrowser->selected_proc_help), &(dbbrowser->selected_proc_help),
&(dbbrowser->selected_proc_author), &(dbbrowser->selected_proc_author),
&(dbbrowser->selected_proc_copyright), &(dbbrowser->selected_proc_copyright),
&(dbbrowser->selected_proc_date), &(dbbrowser->selected_proc_date),
&(dbbrowser->selected_proc_type), &(dbbrowser->selected_proc_type),
&(dbbrowser->selected_nparams), &(dbbrowser->selected_nparams),
&(dbbrowser->selected_nreturn_vals), &(dbbrowser->selected_nreturn_vals),
&(dbbrowser->selected_params), &(dbbrowser->selected_params),
&(dbbrowser->selected_return_vals)); &(dbbrowser->selected_return_vals));
/* save the "old" table */ /* save the "old" table */
old_table = dbbrowser->descr_table; old_table = dbbrowser->descr_table;

View File

@ -393,17 +393,15 @@ p_pdb_procedure_available (char *proc_name)
/* Query the gimp application's procedural database /* Query the gimp application's procedural database
* regarding a particular procedure. * regarding a particular procedure.
*/ */
if (gimp_query_procedure (proc_name, if (gimp_procedural_db_proc_info (proc_name,
&l_proc_blurb, &l_proc_blurb,
&l_proc_help, &l_proc_help,
&l_proc_author, &l_proc_author,
&l_proc_copyright, &l_proc_copyright,
&l_proc_date, &l_proc_date,
&l_proc_type, &l_proc_type,
&l_nparams, &l_nparams, &l_nreturn_vals,
&l_nreturn_vals, &l_params, &l_return_vals))
&l_params,
&l_return_vals))
{ {
/* procedure found in PDB */ /* procedure found in PDB */
return (l_nparams); return (l_nparams);

View File

@ -293,17 +293,15 @@ procedure_general_select_callback (PDesc *pdesc,
selected_params = NULL; selected_params = NULL;
selected_return_vals = NULL; selected_return_vals = NULL;
gimp_query_procedure (pinfo->realname, gimp_procedural_db_proc_info (pinfo->realname,
&selected_proc_blurb, &selected_proc_blurb,
&selected_proc_help, &selected_proc_help,
&selected_proc_author, &selected_proc_author,
&selected_proc_copyright, &selected_proc_copyright,
&selected_proc_date, &selected_proc_date,
&selected_proc_type, &selected_proc_type,
&selected_nparams, &selected_nparams, &selected_nreturn_vals,
&selected_nreturn_vals, &selected_params, &selected_return_vals);
&selected_params,
&selected_return_vals);
old_table = pdesc->info_table; old_table = pdesc->info_table;
old_align = pdesc->info_align; old_align = pdesc->info_align;

View File

@ -293,17 +293,15 @@ procedure_general_select_callback (PDesc *pdesc,
selected_params = NULL; selected_params = NULL;
selected_return_vals = NULL; selected_return_vals = NULL;
gimp_query_procedure (pinfo->realname, gimp_procedural_db_proc_info (pinfo->realname,
&selected_proc_blurb, &selected_proc_blurb,
&selected_proc_help, &selected_proc_help,
&selected_proc_author, &selected_proc_author,
&selected_proc_copyright, &selected_proc_copyright,
&selected_proc_date, &selected_proc_date,
&selected_proc_type, &selected_proc_type,
&selected_nparams, &selected_nparams, &selected_nreturn_vals,
&selected_nreturn_vals, &selected_params, &selected_return_vals);
&selected_params,
&selected_return_vals);
old_table = pdesc->info_table; old_table = pdesc->info_table;
old_align = pdesc->info_align; old_align = pdesc->info_align;

View File

@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser,
g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_params);
g_free (dbbrowser->selected_return_vals); g_free (dbbrowser->selected_return_vals);
gimp_query_procedure (proc_name, gimp_procedural_db_proc_info (proc_name,
&(dbbrowser->selected_proc_blurb), &(dbbrowser->selected_proc_blurb),
&(dbbrowser->selected_proc_help), &(dbbrowser->selected_proc_help),
&(dbbrowser->selected_proc_author), &(dbbrowser->selected_proc_author),
&(dbbrowser->selected_proc_copyright), &(dbbrowser->selected_proc_copyright),
&(dbbrowser->selected_proc_date), &(dbbrowser->selected_proc_date),
&(dbbrowser->selected_proc_type), &(dbbrowser->selected_proc_type),
&(dbbrowser->selected_nparams), &(dbbrowser->selected_nparams),
&(dbbrowser->selected_nreturn_vals), &(dbbrowser->selected_nreturn_vals),
&(dbbrowser->selected_params), &(dbbrowser->selected_params),
&(dbbrowser->selected_return_vals)); &(dbbrowser->selected_return_vals));
/* save the "old" table */ /* save the "old" table */
old_table = dbbrowser->descr_table; old_table = dbbrowser->descr_table;

View File

@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser,
g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_params);
g_free (dbbrowser->selected_return_vals); g_free (dbbrowser->selected_return_vals);
gimp_query_procedure (proc_name, gimp_procedural_db_proc_info (proc_name,
&(dbbrowser->selected_proc_blurb), &(dbbrowser->selected_proc_blurb),
&(dbbrowser->selected_proc_help), &(dbbrowser->selected_proc_help),
&(dbbrowser->selected_proc_author), &(dbbrowser->selected_proc_author),
&(dbbrowser->selected_proc_copyright), &(dbbrowser->selected_proc_copyright),
&(dbbrowser->selected_proc_date), &(dbbrowser->selected_proc_date),
&(dbbrowser->selected_proc_type), &(dbbrowser->selected_proc_type),
&(dbbrowser->selected_nparams), &(dbbrowser->selected_nparams),
&(dbbrowser->selected_nreturn_vals), &(dbbrowser->selected_nreturn_vals),
&(dbbrowser->selected_params), &(dbbrowser->selected_params),
&(dbbrowser->selected_return_vals)); &(dbbrowser->selected_return_vals));
/* save the "old" table */ /* save the "old" table */
old_table = dbbrowser->descr_table; old_table = dbbrowser->descr_table;

View File

@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser,
g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_params);
g_free (dbbrowser->selected_return_vals); g_free (dbbrowser->selected_return_vals);
gimp_query_procedure (proc_name, gimp_procedural_db_proc_info (proc_name,
&(dbbrowser->selected_proc_blurb), &(dbbrowser->selected_proc_blurb),
&(dbbrowser->selected_proc_help), &(dbbrowser->selected_proc_help),
&(dbbrowser->selected_proc_author), &(dbbrowser->selected_proc_author),
&(dbbrowser->selected_proc_copyright), &(dbbrowser->selected_proc_copyright),
&(dbbrowser->selected_proc_date), &(dbbrowser->selected_proc_date),
&(dbbrowser->selected_proc_type), &(dbbrowser->selected_proc_type),
&(dbbrowser->selected_nparams), &(dbbrowser->selected_nparams),
&(dbbrowser->selected_nreturn_vals), &(dbbrowser->selected_nreturn_vals),
&(dbbrowser->selected_params), &(dbbrowser->selected_params),
&(dbbrowser->selected_return_vals)); &(dbbrowser->selected_return_vals));
/* save the "old" table */ /* save the "old" table */
old_table = dbbrowser->descr_table; old_table = dbbrowser->descr_table;

View File

@ -293,17 +293,15 @@ procedure_general_select_callback (PDesc *pdesc,
selected_params = NULL; selected_params = NULL;
selected_return_vals = NULL; selected_return_vals = NULL;
gimp_query_procedure (pinfo->realname, gimp_procedural_db_proc_info (pinfo->realname,
&selected_proc_blurb, &selected_proc_blurb,
&selected_proc_help, &selected_proc_help,
&selected_proc_author, &selected_proc_author,
&selected_proc_copyright, &selected_proc_copyright,
&selected_proc_date, &selected_proc_date,
&selected_proc_type, &selected_proc_type,
&selected_nparams, &selected_nparams, &selected_nreturn_vals,
&selected_nreturn_vals, &selected_params, &selected_return_vals);
&selected_params,
&selected_return_vals);
old_table = pdesc->info_table; old_table = pdesc->info_table;
old_align = pdesc->info_align; old_align = pdesc->info_align;

View File

@ -299,18 +299,18 @@ dialog_select (dbbrowser_t *dbbrowser,
if (dbbrowser->selected_params) g_free(dbbrowser->selected_params); if (dbbrowser->selected_params) g_free(dbbrowser->selected_params);
if (dbbrowser->selected_return_vals) g_free(dbbrowser->selected_return_vals); if (dbbrowser->selected_return_vals) g_free(dbbrowser->selected_return_vals);
gimp_query_procedure (proc_name, gimp_procedural_db_proc_info (proc_name,
&(dbbrowser->selected_proc_blurb), &(dbbrowser->selected_proc_blurb),
&(dbbrowser->selected_proc_help), &(dbbrowser->selected_proc_help),
&(dbbrowser->selected_proc_author), &(dbbrowser->selected_proc_author),
&(dbbrowser->selected_proc_copyright), &(dbbrowser->selected_proc_copyright),
&(dbbrowser->selected_proc_date), &(dbbrowser->selected_proc_date),
&(dbbrowser->selected_proc_type), &(dbbrowser->selected_proc_type),
&(dbbrowser->selected_nparams), &(dbbrowser->selected_nparams),
&(dbbrowser->selected_nreturn_vals), &(dbbrowser->selected_nreturn_vals),
&(dbbrowser->selected_params), &(dbbrowser->selected_params),
&(dbbrowser->selected_return_vals)); &(dbbrowser->selected_return_vals));
/* save the "old" table */ /* save the "old" table */
old_table = dbbrowser->descr_table; old_table = dbbrowser->descr_table;

View File

@ -175,18 +175,18 @@ gint p_gen_code_iter_ALT(char *proc_name)
/* Query the gimp application's procedural database /* Query the gimp application's procedural database
* regarding a particular procedure. * regarding a particular procedure.
*/ */
if(gimp_query_procedure (proc_name, if (gimp_procedural_db_proc_info (proc_name,
&l_proc_blurb, &l_proc_blurb,
&l_proc_help, &l_proc_help,
&l_proc_author, &l_proc_author,
&l_proc_copyright, &l_proc_copyright,
&l_proc_date, &l_proc_date,
&l_proc_type, &l_proc_type,
&l_nparams, &l_nparams,
&l_nreturn_vals, &l_nreturn_vals,
&l_params, &l_params,
&l_return_vals)) &l_return_vals))
{ {
p_clean_name(proc_name, &l_clean_proc_name[0]); p_clean_name(proc_name, &l_clean_proc_name[0]);
/* procedure found in PDB */ /* procedure found in PDB */
if(gap_debug) fprintf(stderr, "DEBUG: found in PDB %s author: %s copyright: %s\n", if(gap_debug) fprintf(stderr, "DEBUG: found in PDB %s author: %s copyright: %s\n",
@ -367,18 +367,18 @@ gint p_gen_code_iter(char *proc_name)
/* Query the gimp application's procedural database /* Query the gimp application's procedural database
* regarding a particular procedure. * regarding a particular procedure.
*/ */
if(gimp_query_procedure (proc_name, if (gimp_procedural_db_proc_info (proc_name,
&l_proc_blurb, &l_proc_blurb,
&l_proc_help, &l_proc_help,
&l_proc_author, &l_proc_author,
&l_proc_copyright, &l_proc_copyright,
&l_proc_date, &l_proc_date,
&l_proc_type, &l_proc_type,
&l_nparams, &l_nparams,
&l_nreturn_vals, &l_nreturn_vals,
&l_params, &l_params,
&l_return_vals)) &l_return_vals))
{ {
p_clean_name(proc_name, &l_clean_proc_name[0]); p_clean_name(proc_name, &l_clean_proc_name[0]);
/* procedure found in PDB */ /* procedure found in PDB */
if(gap_debug) fprintf(stderr, "DEBUG: found in PDB %s\n", proc_name); if(gap_debug) fprintf(stderr, "DEBUG: found in PDB %s\n", proc_name);

View File

@ -92,17 +92,17 @@ gint p_call_plugin(char *plugin_name, gint32 image_id, gint32 layer_id, GRunMode
l_drawable = gimp_drawable_get(layer_id); /* use the background layer */ l_drawable = gimp_drawable_get(layer_id); /* use the background layer */
/* query for plugin_name to get its argument types */ /* query for plugin_name to get its argument types */
if (FALSE == gimp_query_procedure (plugin_name, if (!gimp_procedural_db_proc_info (plugin_name,
&l_proc_blurb, &l_proc_blurb,
&l_proc_help, &l_proc_help,
&l_proc_author, &l_proc_author,
&l_proc_copyright, &l_proc_copyright,
&l_proc_date, &l_proc_date,
&l_proc_type, &l_proc_type,
&l_nparams, &l_nparams,
&l_nreturn_vals, &l_nreturn_vals,
&l_params, &l_params,
&l_return_vals)) &l_return_vals))
{ {
fprintf(stderr, "ERROR: Plugin not available, Name was %s\n", plugin_name); fprintf(stderr, "ERROR: Plugin not available, Name was %s\n", plugin_name);
return -1; return -1;
@ -277,18 +277,18 @@ gint p_procedure_available(char *proc_name, t_proc_type ptype)
/* Query the gimp application's procedural database /* Query the gimp application's procedural database
* regarding a particular procedure. * regarding a particular procedure.
*/ */
if (gimp_query_procedure (proc_name, if (gimp_procedural_db_proc_info (proc_name,
&l_proc_blurb, &l_proc_blurb,
&l_proc_help, &l_proc_help,
&l_proc_author, &l_proc_author,
&l_proc_copyright, &l_proc_copyright,
&l_proc_date, &l_proc_date,
&l_proc_type, &l_proc_type,
&l_nparams, &l_nparams,
&l_nreturn_vals, &l_nreturn_vals,
&l_params, &l_params,
&l_return_vals)) &l_return_vals))
{ {
/* procedure found in PDB */ /* procedure found in PDB */
if(gap_debug) fprintf(stderr, "DEBUG: found in PDB %s\n", proc_name); if(gap_debug) fprintf(stderr, "DEBUG: found in PDB %s\n", proc_name);

View File

@ -78,21 +78,21 @@ gint p_pdb_procedure_available(char *proc_name)
/* Query the gimp application's procedural database /* Query the gimp application's procedural database
* regarding a particular procedure. * regarding a particular procedure.
*/ */
if(gimp_query_procedure (proc_name, if (gimp_procedural_db_proc_info (proc_name,
&l_proc_blurb, &l_proc_blurb,
&l_proc_help, &l_proc_help,
&l_proc_author, &l_proc_author,
&l_proc_copyright, &l_proc_copyright,
&l_proc_date, &l_proc_date,
&l_proc_type, &l_proc_type,
&l_nparams, &l_nparams,
&l_nreturn_vals, &l_nreturn_vals,
&l_params, &l_params,
&l_return_vals)) &l_return_vals))
{ {
/* procedure found in PDB */ /* procedure found in PDB */
return (l_nparams); return (l_nparams);
} }
printf("Warning: Procedure %s not found.\n", proc_name); printf("Warning: Procedure %s not found.\n", proc_name);
return -1; return -1;

View File

@ -586,11 +586,15 @@ maze_help (GtkWidget *widget,
gint baz; gint baz;
gchar *message; gchar *message;
if (gimp_query_procedure ("extension_web_browser", if (gimp_procedural_db_proc_info ("extension_web_browser",
&proc_blurb, &proc_help, &proc_blurb,
&proc_author, &proc_copyright, &proc_date, &proc_help,
&proc_type, &nparams, &nreturn_vals, &proc_author,
&params, &return_vals)) &proc_copyright,
&proc_date,
&proc_type,
&nparams, &nreturn_vals,
&params, &return_vals))
{ {
/* open URL for help */ /* open URL for help */
message = g_strdup_printf (_("Opening %s"), MAZE_URL); message = g_strdup_printf (_("Opening %s"), MAZE_URL);

View File

@ -904,8 +904,8 @@ newpfobject(name)
int pt, np, nr, i; int pt, np, nr, i;
GParamDef *p, *r; GParamDef *p, *r;
if (!gimp_query_procedure(name, &b, &h, &a, &c, &d, &pt, if (!gimp_procedural_db_proc_info (name, &b, &h, &a, &c, &d, &pt,
&np, &nr, &p, &r)) { &np, &nr, &p, &r)) {
PyErr_SetString(ErrorObject, "procedure not found."); PyErr_SetString(ErrorObject, "procedure not found.");
return NULL; return NULL;
} }

View File

@ -132,22 +132,22 @@ typedef union
typedef struct typedef struct
{ {
GtkWidget **args_widgets; GtkWidget **args_widgets;
gchar *script_name; gchar *script_name;
gchar *pdb_name; gchar *pdb_name;
gchar *description; gchar *description;
gchar *help; gchar *help;
gchar *author; gchar *author;
gchar *copyright; gchar *copyright;
gchar *date; gchar *date;
gchar *img_types; gchar *img_types;
gint num_args; gint num_args;
SFArgType *arg_types; SFArgType *arg_types;
gchar **arg_labels; gchar **arg_labels;
SFArgValue *arg_defaults; SFArgValue *arg_defaults;
SFArgValue *arg_values; SFArgValue *arg_values;
gint32 image_based; gint32 image_based;
GParamDef *args; /* used only temporary until installed */ GimpParamDef *args; /* used only temporary until installed */
} SFScript; } SFScript;
typedef struct typedef struct
@ -165,36 +165,36 @@ extern long nlength (LISP obj);
* Local Functions * Local Functions
*/ */
static gint script_fu_install_script (gpointer foo, static gint script_fu_install_script (gpointer foo,
SFScript *script, SFScript *script,
gpointer bar); gpointer bar);
static gint script_fu_remove_script (gpointer foo, static gint script_fu_remove_script (gpointer foo,
SFScript *script, SFScript *script,
gpointer bar); gpointer bar);
static void script_fu_script_proc (gchar *name, static void script_fu_script_proc (gchar *name,
gint nparams, gint nparams,
GParam *params, GimpParam *params,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals); GimpParam **return_vals);
static SFScript * script_fu_find_script (gchar *script_name); static SFScript * script_fu_find_script (gchar *script_name);
static void script_fu_free_script (SFScript *script); static void script_fu_free_script (SFScript *script);
static void script_fu_enable_cc (void); static void script_fu_enable_cc (void);
static void script_fu_disable_cc (gint err_msg); static void script_fu_disable_cc (gint err_msg);
static void script_fu_interface (SFScript *script); static void script_fu_interface (SFScript *script);
static void script_fu_font_preview (GtkWidget *preview, static void script_fu_font_preview (GtkWidget *preview,
gchar *fontname); gchar *fontname);
static void script_fu_cleanup_widgets (SFScript *script); static void script_fu_cleanup_widgets (SFScript *script);
static void script_fu_ok_callback (GtkWidget *widget, static void script_fu_ok_callback (GtkWidget *widget,
gpointer data); gpointer data);
static gint script_fu_destroy_callback (GtkWidget *widget, static gint script_fu_destroy_callback (GtkWidget *widget,
gpointer data); gpointer data);
static void script_fu_about_callback (GtkWidget *widget, static void script_fu_about_callback (GtkWidget *widget,
gpointer data); gpointer data);
static void script_fu_reset_callback (GtkWidget *widget, static void script_fu_reset_callback (GtkWidget *widget,
gpointer data); gpointer data);
static void script_fu_menu_callback (gint32 id, static void script_fu_menu_callback (gint32 id,
gpointer data); gpointer data);
static void script_fu_file_selection_callback(GtkWidget *widget, static void script_fu_file_selection_callback(GtkWidget *widget,
gpointer data); gpointer data);
static void script_fu_font_preview_callback (GtkWidget *widget, static void script_fu_font_preview_callback (GtkWidget *widget,
@ -385,7 +385,7 @@ script_fu_find_scripts (void)
LISP LISP
script_fu_add_script (LISP a) script_fu_add_script (LISP a)
{ {
GParamDef *args; GimpParamDef *args;
SFScript *script; SFScript *script;
gchar *val; gchar *val;
gint i; gint i;
@ -458,8 +458,8 @@ script_fu_add_script (LISP a)
/* Check the supplied number of arguments */ /* Check the supplied number of arguments */
script->num_args = nlength (a) / 3; script->num_args = nlength (a) / 3;
args = g_new (GParamDef, script->num_args + 1); args = g_new (GimpParamDef, script->num_args + 1);
args[0].type = PARAM_INT32; args[0].type = GIMP_PDB_INT32;
args[0].name = "run_mode"; args[0].name = "run_mode";
args[0].description = "Interactive, non-interactive"; args[0].description = "Interactive, non-interactive";
@ -509,19 +509,19 @@ script_fu_add_script (LISP a)
switch (script->arg_types[i]) switch (script->arg_types[i])
{ {
case SF_IMAGE: case SF_IMAGE:
args[i + 1].type = PARAM_IMAGE; args[i + 1].type = GIMP_PDB_IMAGE;
args[i + 1].name = "image"; args[i + 1].name = "image";
break; break;
case SF_DRAWABLE: case SF_DRAWABLE:
args[i + 1].type = PARAM_DRAWABLE; args[i + 1].type = GIMP_PDB_DRAWABLE;
args[i + 1].name = "drawable"; args[i + 1].name = "drawable";
break; break;
case SF_LAYER: case SF_LAYER:
args[i + 1].type = PARAM_LAYER; args[i + 1].type = GIMP_PDB_LAYER;
args[i + 1].name = "layer"; args[i + 1].name = "layer";
break; break;
case SF_CHANNEL: case SF_CHANNEL:
args[i + 1].type = PARAM_CHANNEL; args[i + 1].type = GIMP_PDB_CHANNEL;
args[i + 1].name = "channel"; args[i + 1].name = "channel";
break; break;
default: default:
@ -543,7 +543,7 @@ script_fu_add_script (LISP a)
memcpy (script->arg_defaults[i].sfa_color, color, sizeof (guchar) * 3); memcpy (script->arg_defaults[i].sfa_color, color, sizeof (guchar) * 3);
memcpy (script->arg_values[i].sfa_color, color, sizeof (guchar) * 3); memcpy (script->arg_values[i].sfa_color, color, sizeof (guchar) * 3);
args[i + 1].type = PARAM_COLOR; args[i + 1].type = GIMP_PDB_COLOR;
args[i + 1].name = "color"; args[i + 1].name = "color";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -554,7 +554,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_toggle = (get_c_long (car (a))) ? TRUE : FALSE; script->arg_defaults[i].sfa_toggle = (get_c_long (car (a))) ? TRUE : FALSE;
script->arg_values[i].sfa_toggle = script->arg_defaults[i].sfa_toggle; script->arg_values[i].sfa_toggle = script->arg_defaults[i].sfa_toggle;
args[i + 1].type = PARAM_INT32; args[i + 1].type = GIMP_PDB_INT32;
args[i + 1].name = "toggle"; args[i + 1].name = "toggle";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -565,7 +565,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_value = g_strdup (get_c_string (car (a))); script->arg_defaults[i].sfa_value = g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_value = g_strdup (script->arg_defaults[i].sfa_value); script->arg_values[i].sfa_value = g_strdup (script->arg_defaults[i].sfa_value);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "value"; args[i + 1].name = "value";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -576,7 +576,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_value = g_strdup (get_c_string (car (a))); script->arg_defaults[i].sfa_value = g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_value = g_strdup (script->arg_defaults[i].sfa_value); script->arg_values[i].sfa_value = g_strdup (script->arg_defaults[i].sfa_value);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "string"; args[i + 1].name = "string";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -601,7 +601,7 @@ script_fu_add_script (LISP a)
script->arg_values[i].sfa_adjustment.adj = NULL; script->arg_values[i].sfa_adjustment.adj = NULL;
script->arg_values[i].sfa_adjustment.value = script->arg_defaults[i].sfa_adjustment.value; script->arg_values[i].sfa_adjustment.value = script->arg_defaults[i].sfa_adjustment.value;
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "value"; args[i + 1].name = "value";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -627,7 +627,7 @@ script_fu_add_script (LISP a)
script->arg_values[i].sfa_file.filename = g_strdup (script->arg_defaults[i].sfa_file.filename); script->arg_values[i].sfa_file.filename = g_strdup (script->arg_defaults[i].sfa_file.filename);
script->arg_values[i].sfa_file.fileselection = NULL; script->arg_values[i].sfa_file.fileselection = NULL;
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "filename"; args[i + 1].name = "filename";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -640,7 +640,7 @@ script_fu_add_script (LISP a)
script->arg_values[i].sfa_font.preview = NULL; script->arg_values[i].sfa_font.preview = NULL;
script->arg_values[i].sfa_font.dialog = NULL; script->arg_values[i].sfa_font.dialog = NULL;
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "font"; args[i + 1].name = "font";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -651,7 +651,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_pattern = g_strdup (get_c_string (car (a))); script->arg_defaults[i].sfa_pattern = g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_pattern = g_strdup (script->arg_defaults[i].sfa_pattern); script->arg_values[i].sfa_pattern = g_strdup (script->arg_defaults[i].sfa_pattern);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "pattern"; args[i + 1].name = "pattern";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -674,7 +674,7 @@ script_fu_add_script (LISP a)
*/ */
script->arg_values[i].sfa_brush.name = g_strdup(script->arg_defaults[i].sfa_brush.name); script->arg_values[i].sfa_brush.name = g_strdup(script->arg_defaults[i].sfa_brush.name);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "brush"; args[i + 1].name = "brush";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -685,7 +685,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_gradient = g_strdup (get_c_string (car (a))); script->arg_defaults[i].sfa_gradient = g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_gradient = g_strdup (script->arg_defaults[i].sfa_pattern); script->arg_values[i].sfa_gradient = g_strdup (script->arg_defaults[i].sfa_pattern);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "gradient"; args[i + 1].name = "gradient";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -702,7 +702,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_option.history = 0; script->arg_defaults[i].sfa_option.history = 0;
script->arg_values[i].sfa_option.history = 0; script->arg_values[i].sfa_option.history = 0;
args[i + 1].type = PARAM_INT32; args[i + 1].type = GIMP_PDB_INT32;
args[i + 1].name = "option"; args[i + 1].name = "option";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -805,15 +805,15 @@ script_fu_remove_script (gpointer foo,
static void static void
script_fu_script_proc (gchar *name, script_fu_script_proc (gchar *name,
gint nparams, gint nparams,
GParam *params, GimpParam *params,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals) GimpParam **return_vals)
{ {
static GParam values[1]; static GimpParam values[1];
GStatusType status = STATUS_SUCCESS; GimpPDBStatusType status = STATUS_SUCCESS;
GRunModeType run_mode; GimpRunModeType run_mode;
SFScript *script; SFScript *script;
gint min_args; gint min_args;
gchar *escaped; gchar *escaped;
@ -990,7 +990,7 @@ script_fu_script_proc (gchar *name,
*nreturn_vals = 1; *nreturn_vals = 1;
*return_vals = values; *return_vals = values;
values[0].type = PARAM_STATUS; values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status; values[0].data.d_status = status;
} }

View File

@ -132,22 +132,22 @@ typedef union
typedef struct typedef struct
{ {
GtkWidget **args_widgets; GtkWidget **args_widgets;
gchar *script_name; gchar *script_name;
gchar *pdb_name; gchar *pdb_name;
gchar *description; gchar *description;
gchar *help; gchar *help;
gchar *author; gchar *author;
gchar *copyright; gchar *copyright;
gchar *date; gchar *date;
gchar *img_types; gchar *img_types;
gint num_args; gint num_args;
SFArgType *arg_types; SFArgType *arg_types;
gchar **arg_labels; gchar **arg_labels;
SFArgValue *arg_defaults; SFArgValue *arg_defaults;
SFArgValue *arg_values; SFArgValue *arg_values;
gint32 image_based; gint32 image_based;
GParamDef *args; /* used only temporary until installed */ GimpParamDef *args; /* used only temporary until installed */
} SFScript; } SFScript;
typedef struct typedef struct
@ -165,36 +165,36 @@ extern long nlength (LISP obj);
* Local Functions * Local Functions
*/ */
static gint script_fu_install_script (gpointer foo, static gint script_fu_install_script (gpointer foo,
SFScript *script, SFScript *script,
gpointer bar); gpointer bar);
static gint script_fu_remove_script (gpointer foo, static gint script_fu_remove_script (gpointer foo,
SFScript *script, SFScript *script,
gpointer bar); gpointer bar);
static void script_fu_script_proc (gchar *name, static void script_fu_script_proc (gchar *name,
gint nparams, gint nparams,
GParam *params, GimpParam *params,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals); GimpParam **return_vals);
static SFScript * script_fu_find_script (gchar *script_name); static SFScript * script_fu_find_script (gchar *script_name);
static void script_fu_free_script (SFScript *script); static void script_fu_free_script (SFScript *script);
static void script_fu_enable_cc (void); static void script_fu_enable_cc (void);
static void script_fu_disable_cc (gint err_msg); static void script_fu_disable_cc (gint err_msg);
static void script_fu_interface (SFScript *script); static void script_fu_interface (SFScript *script);
static void script_fu_font_preview (GtkWidget *preview, static void script_fu_font_preview (GtkWidget *preview,
gchar *fontname); gchar *fontname);
static void script_fu_cleanup_widgets (SFScript *script); static void script_fu_cleanup_widgets (SFScript *script);
static void script_fu_ok_callback (GtkWidget *widget, static void script_fu_ok_callback (GtkWidget *widget,
gpointer data); gpointer data);
static gint script_fu_destroy_callback (GtkWidget *widget, static gint script_fu_destroy_callback (GtkWidget *widget,
gpointer data); gpointer data);
static void script_fu_about_callback (GtkWidget *widget, static void script_fu_about_callback (GtkWidget *widget,
gpointer data); gpointer data);
static void script_fu_reset_callback (GtkWidget *widget, static void script_fu_reset_callback (GtkWidget *widget,
gpointer data); gpointer data);
static void script_fu_menu_callback (gint32 id, static void script_fu_menu_callback (gint32 id,
gpointer data); gpointer data);
static void script_fu_file_selection_callback(GtkWidget *widget, static void script_fu_file_selection_callback(GtkWidget *widget,
gpointer data); gpointer data);
static void script_fu_font_preview_callback (GtkWidget *widget, static void script_fu_font_preview_callback (GtkWidget *widget,
@ -385,7 +385,7 @@ script_fu_find_scripts (void)
LISP LISP
script_fu_add_script (LISP a) script_fu_add_script (LISP a)
{ {
GParamDef *args; GimpParamDef *args;
SFScript *script; SFScript *script;
gchar *val; gchar *val;
gint i; gint i;
@ -458,8 +458,8 @@ script_fu_add_script (LISP a)
/* Check the supplied number of arguments */ /* Check the supplied number of arguments */
script->num_args = nlength (a) / 3; script->num_args = nlength (a) / 3;
args = g_new (GParamDef, script->num_args + 1); args = g_new (GimpParamDef, script->num_args + 1);
args[0].type = PARAM_INT32; args[0].type = GIMP_PDB_INT32;
args[0].name = "run_mode"; args[0].name = "run_mode";
args[0].description = "Interactive, non-interactive"; args[0].description = "Interactive, non-interactive";
@ -509,19 +509,19 @@ script_fu_add_script (LISP a)
switch (script->arg_types[i]) switch (script->arg_types[i])
{ {
case SF_IMAGE: case SF_IMAGE:
args[i + 1].type = PARAM_IMAGE; args[i + 1].type = GIMP_PDB_IMAGE;
args[i + 1].name = "image"; args[i + 1].name = "image";
break; break;
case SF_DRAWABLE: case SF_DRAWABLE:
args[i + 1].type = PARAM_DRAWABLE; args[i + 1].type = GIMP_PDB_DRAWABLE;
args[i + 1].name = "drawable"; args[i + 1].name = "drawable";
break; break;
case SF_LAYER: case SF_LAYER:
args[i + 1].type = PARAM_LAYER; args[i + 1].type = GIMP_PDB_LAYER;
args[i + 1].name = "layer"; args[i + 1].name = "layer";
break; break;
case SF_CHANNEL: case SF_CHANNEL:
args[i + 1].type = PARAM_CHANNEL; args[i + 1].type = GIMP_PDB_CHANNEL;
args[i + 1].name = "channel"; args[i + 1].name = "channel";
break; break;
default: default:
@ -543,7 +543,7 @@ script_fu_add_script (LISP a)
memcpy (script->arg_defaults[i].sfa_color, color, sizeof (guchar) * 3); memcpy (script->arg_defaults[i].sfa_color, color, sizeof (guchar) * 3);
memcpy (script->arg_values[i].sfa_color, color, sizeof (guchar) * 3); memcpy (script->arg_values[i].sfa_color, color, sizeof (guchar) * 3);
args[i + 1].type = PARAM_COLOR; args[i + 1].type = GIMP_PDB_COLOR;
args[i + 1].name = "color"; args[i + 1].name = "color";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -554,7 +554,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_toggle = (get_c_long (car (a))) ? TRUE : FALSE; script->arg_defaults[i].sfa_toggle = (get_c_long (car (a))) ? TRUE : FALSE;
script->arg_values[i].sfa_toggle = script->arg_defaults[i].sfa_toggle; script->arg_values[i].sfa_toggle = script->arg_defaults[i].sfa_toggle;
args[i + 1].type = PARAM_INT32; args[i + 1].type = GIMP_PDB_INT32;
args[i + 1].name = "toggle"; args[i + 1].name = "toggle";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -565,7 +565,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_value = g_strdup (get_c_string (car (a))); script->arg_defaults[i].sfa_value = g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_value = g_strdup (script->arg_defaults[i].sfa_value); script->arg_values[i].sfa_value = g_strdup (script->arg_defaults[i].sfa_value);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "value"; args[i + 1].name = "value";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -576,7 +576,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_value = g_strdup (get_c_string (car (a))); script->arg_defaults[i].sfa_value = g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_value = g_strdup (script->arg_defaults[i].sfa_value); script->arg_values[i].sfa_value = g_strdup (script->arg_defaults[i].sfa_value);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "string"; args[i + 1].name = "string";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -601,7 +601,7 @@ script_fu_add_script (LISP a)
script->arg_values[i].sfa_adjustment.adj = NULL; script->arg_values[i].sfa_adjustment.adj = NULL;
script->arg_values[i].sfa_adjustment.value = script->arg_defaults[i].sfa_adjustment.value; script->arg_values[i].sfa_adjustment.value = script->arg_defaults[i].sfa_adjustment.value;
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "value"; args[i + 1].name = "value";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -627,7 +627,7 @@ script_fu_add_script (LISP a)
script->arg_values[i].sfa_file.filename = g_strdup (script->arg_defaults[i].sfa_file.filename); script->arg_values[i].sfa_file.filename = g_strdup (script->arg_defaults[i].sfa_file.filename);
script->arg_values[i].sfa_file.fileselection = NULL; script->arg_values[i].sfa_file.fileselection = NULL;
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "filename"; args[i + 1].name = "filename";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -640,7 +640,7 @@ script_fu_add_script (LISP a)
script->arg_values[i].sfa_font.preview = NULL; script->arg_values[i].sfa_font.preview = NULL;
script->arg_values[i].sfa_font.dialog = NULL; script->arg_values[i].sfa_font.dialog = NULL;
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "font"; args[i + 1].name = "font";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -651,7 +651,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_pattern = g_strdup (get_c_string (car (a))); script->arg_defaults[i].sfa_pattern = g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_pattern = g_strdup (script->arg_defaults[i].sfa_pattern); script->arg_values[i].sfa_pattern = g_strdup (script->arg_defaults[i].sfa_pattern);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "pattern"; args[i + 1].name = "pattern";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -674,7 +674,7 @@ script_fu_add_script (LISP a)
*/ */
script->arg_values[i].sfa_brush.name = g_strdup(script->arg_defaults[i].sfa_brush.name); script->arg_values[i].sfa_brush.name = g_strdup(script->arg_defaults[i].sfa_brush.name);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "brush"; args[i + 1].name = "brush";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -685,7 +685,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_gradient = g_strdup (get_c_string (car (a))); script->arg_defaults[i].sfa_gradient = g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_gradient = g_strdup (script->arg_defaults[i].sfa_pattern); script->arg_values[i].sfa_gradient = g_strdup (script->arg_defaults[i].sfa_pattern);
args[i + 1].type = PARAM_STRING; args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "gradient"; args[i + 1].name = "gradient";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -702,7 +702,7 @@ script_fu_add_script (LISP a)
script->arg_defaults[i].sfa_option.history = 0; script->arg_defaults[i].sfa_option.history = 0;
script->arg_values[i].sfa_option.history = 0; script->arg_values[i].sfa_option.history = 0;
args[i + 1].type = PARAM_INT32; args[i + 1].type = GIMP_PDB_INT32;
args[i + 1].name = "option"; args[i + 1].name = "option";
args[i + 1].description = script->arg_labels[i]; args[i + 1].description = script->arg_labels[i];
break; break;
@ -805,15 +805,15 @@ script_fu_remove_script (gpointer foo,
static void static void
script_fu_script_proc (gchar *name, script_fu_script_proc (gchar *name,
gint nparams, gint nparams,
GParam *params, GimpParam *params,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals) GimpParam **return_vals)
{ {
static GParam values[1]; static GimpParam values[1];
GStatusType status = STATUS_SUCCESS; GimpPDBStatusType status = STATUS_SUCCESS;
GRunModeType run_mode; GimpRunModeType run_mode;
SFScript *script; SFScript *script;
gint min_args; gint min_args;
gchar *escaped; gchar *escaped;
@ -990,7 +990,7 @@ script_fu_script_proc (gchar *name,
*nreturn_vals = 1; *nreturn_vals = 1;
*return_vals = values; *return_vals = values;
values[0].type = PARAM_STATUS; values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status; values[0].data.d_status = status;
} }

View File

@ -58,11 +58,11 @@ extern void fput_st (FILE *f,
*/ */
static void sfquit (void); static void sfquit (void);
static void query (void); static void query (void);
static void run (gchar *name, static void run (gchar *name,
gint nparams, gint nparams,
GParam *param, GimpParam *param,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals); GimpParam **return_vals);
static gint init_interp (void); static gint init_interp (void);
static void init_gimp (void); static void init_gimp (void);
@ -80,14 +80,14 @@ static LISP script_fu_register_call (LISP a);
static LISP script_fu_quit_call (LISP a); static LISP script_fu_quit_call (LISP a);
static void script_fu_auxillary_init (void); static void script_fu_auxillary_init (void);
static void script_fu_refresh_proc (gchar *name, static void script_fu_refresh_proc (gchar *name,
gint nparams, gint nparams,
GParam *params, GimpParam *params,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals); GimpParam **return_vals);
GPlugInInfo PLUG_IN_INFO = GimpPlugInInfo PLUG_IN_INFO =
{ {
NULL, /* init_proc */ NULL, /* init_proc */
sfquit, /* quit_proc */ sfquit, /* quit_proc */
@ -121,24 +121,24 @@ sfquit (void)
static void static void
query (void) query (void)
{ {
static GParamDef console_args[] = static GimpParamDef console_args[] =
{ {
{ PARAM_INT32, "run_mode", "Interactive, [non-interactive]" } { GIMP_PDB_INT32, "run_mode", "Interactive, [non-interactive]" }
}; };
static gint nconsole_args = sizeof (console_args) / sizeof (console_args[0]); static gint nconsole_args = sizeof (console_args) / sizeof (console_args[0]);
static GParamDef eval_args[] = static GimpParamDef eval_args[] =
{ {
{ PARAM_INT32, "run_mode", "[Interactive], non-interactive" }, { GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" },
{ PARAM_STRING, "code", "The code to evaluate" } { GIMP_PDB_STRING, "code", "The code to evaluate" }
}; };
static gint neval_args = sizeof (eval_args) / sizeof (eval_args[0]); static gint neval_args = sizeof (eval_args) / sizeof (eval_args[0]);
static GParamDef server_args[] = static GimpParamDef server_args[] =
{ {
{ PARAM_INT32, "run_mode", "[Interactive], non-interactive" }, { GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" },
{ PARAM_INT32, "port", "The port on which to listen for requests" }, { GIMP_PDB_INT32, "port", "The port on which to listen for requests" },
{ PARAM_STRING, "logfile", "The file to log server activity to" } { GIMP_PDB_STRING, "logfile", "The file to log server activity to" }
}; };
static gint nserver_args = sizeof (server_args) / sizeof (server_args[0]); static gint nserver_args = sizeof (server_args) / sizeof (server_args[0]);
@ -152,7 +152,7 @@ query (void)
"1997", "1997",
NULL, NULL,
NULL, NULL,
PROC_EXTENSION, GIMP_EXTENSION,
0, 0, NULL, NULL); 0, 0, NULL, NULL);
gimp_install_procedure ("extension_script_fu_console", gimp_install_procedure ("extension_script_fu_console",
@ -163,7 +163,7 @@ query (void)
"1997", "1997",
N_("<Toolbox>/Xtns/Script-Fu/Console..."), N_("<Toolbox>/Xtns/Script-Fu/Console..."),
NULL, NULL,
PROC_EXTENSION, GIMP_EXTENSION,
nconsole_args, 0, nconsole_args, 0,
console_args, NULL); console_args, NULL);
@ -176,7 +176,7 @@ query (void)
"1997", "1997",
N_("<Toolbox>/Xtns/Script-Fu/Server..."), N_("<Toolbox>/Xtns/Script-Fu/Server..."),
NULL, NULL,
PROC_EXTENSION, GIMP_EXTENSION,
nserver_args, 0, nserver_args, 0,
server_args, NULL); server_args, NULL);
#endif #endif
@ -189,17 +189,17 @@ query (void)
"1998", "1998",
NULL, NULL,
NULL, NULL,
PROC_EXTENSION, GIMP_EXTENSION,
neval_args, 0, neval_args, 0,
eval_args, NULL); eval_args, NULL);
} }
static void static void
run (gchar *name, run (gchar *name,
gint nparams, gint nparams,
GParam *param, GimpParam *param,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals) GimpParam **return_vals)
{ {
siod_output = stdout; siod_output = stdout;
@ -228,8 +228,8 @@ run (gchar *name,
*/ */
if (strcmp (name, "extension_script_fu") == 0) if (strcmp (name, "extension_script_fu") == 0)
{ {
static GParam values[1]; static GimpParam values[1];
GStatusType status = STATUS_SUCCESS; GimpPDBStatusType status = GIMP_PDB_SUCCESS;
/* Acknowledge that the extension is properly initialized */ /* Acknowledge that the extension is properly initialized */
gimp_extension_ack (); gimp_extension_ack ();
@ -240,7 +240,7 @@ run (gchar *name,
*nreturn_vals = 1; *nreturn_vals = 1;
*return_vals = values; *return_vals = values;
values[0].type = PARAM_STATUS; values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status; values[0].data.d_status = status;
} }
/* /*
@ -322,9 +322,15 @@ init_procedures (void)
proc_name = g_strdup (proc_list[i]); proc_name = g_strdup (proc_list[i]);
/* lookup the procedure */ /* lookup the procedure */
if (gimp_query_procedure (proc_name, &proc_blurb, &proc_help, &proc_author, if (gimp_procedural_db_proc_info (proc_name,
&proc_copyright, &proc_date, &proc_type, &nparams, &nreturn_vals, &proc_blurb,
&params, &return_vals) == TRUE) &proc_help,
&proc_author,
&proc_copyright,
&proc_date,
&proc_type,
&nparams, &nreturn_vals,
&params, &return_vals))
{ {
LISP args = NIL; LISP args = NIL;
LISP code = NIL; LISP code = NIL;
@ -517,9 +523,15 @@ marshall_proc_db_call (LISP a)
script_fu_report_cc (proc_name); script_fu_report_cc (proc_name);
/* Attempt to fetch the procedure from the database */ /* Attempt to fetch the procedure from the database */
if (gimp_query_procedure (proc_name, &proc_blurb, &proc_help, &proc_author, if (!gimp_procedural_db_proc_info (proc_name,
&proc_copyright, &proc_date, &proc_type, &nparams, &nreturn_vals, &proc_blurb,
&params, &return_vals) == FALSE) &proc_help,
&proc_author,
&proc_copyright,
&proc_date,
&proc_type,
&nparams, &nreturn_vals,
&params, &return_vals))
return my_err ("Invalid procedure name specified.", NIL); return my_err ("Invalid procedure name specified.", NIL);
@ -533,7 +545,7 @@ marshall_proc_db_call (LISP a)
/* Marshall the supplied arguments */ /* Marshall the supplied arguments */
if (nparams) if (nparams)
args = (GParam *) g_new (GParam, nparams); args = (GimpParam *) g_new (GimpParam, nparams);
else else
args = NULL; args = NULL;
@ -542,93 +554,93 @@ marshall_proc_db_call (LISP a)
{ {
switch (params[i].type) switch (params[i].type)
{ {
case PARAM_INT32: case GIMP_PDB_INT32:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_INT32; args[i].type = GIMP_PDB_INT32;
args[i].data.d_int32 = get_c_long (car (a)); args[i].data.d_int32 = get_c_long (car (a));
} }
break; break;
case PARAM_INT16: case GIMP_PDB_INT16:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_INT16; args[i].type = GIMP_PDB_INT16;
args[i].data.d_int16 = (gint16) get_c_long (car (a)); args[i].data.d_int16 = (gint16) get_c_long (car (a));
} }
break; break;
case PARAM_INT8: case GIMP_PDB_INT8:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_INT8; args[i].type = GIMP_PDB_INT8;
args[i].data.d_int8 = (gint8) get_c_long (car (a)); args[i].data.d_int8 = (gint8) get_c_long (car (a));
} }
break; break;
case PARAM_FLOAT: case GIMP_PDB_FLOAT:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_FLOAT; args[i].type = GIMP_PDB_FLOAT;
args[i].data.d_float = get_c_double (car (a)); args[i].data.d_float = get_c_double (car (a));
} }
break; break;
case PARAM_STRING: case GIMP_PDB_STRING:
if (!TYPEP (car (a), tc_string)) if (!TYPEP (car (a), tc_string))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_STRING; args[i].type = GIMP_PDB_STRING;
args[i].data.d_string = get_c_string (car (a)); args[i].data.d_string = get_c_string (car (a));
} }
break; break;
case PARAM_INT32ARRAY: case GIMP_PDB_INT32ARRAY:
if (!TYPEP (car (a), tc_long_array)) if (!TYPEP (car (a), tc_long_array))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_INT32ARRAY; args[i].type = GIMP_PDB_INT32ARRAY;
args[i].data.d_int32array = (gint32*) (car (a))->storage_as.long_array.data; args[i].data.d_int32array = (gint32*) (car (a))->storage_as.long_array.data;
} }
break; break;
case PARAM_INT16ARRAY: case GIMP_PDB_INT16ARRAY:
if (!TYPEP (car (a), tc_long_array)) if (!TYPEP (car (a), tc_long_array))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_INT16ARRAY; args[i].type = GIMP_PDB_INT16ARRAY;
args[i].data.d_int16array = (gint16*) (car (a))->storage_as.long_array.data; args[i].data.d_int16array = (gint16*) (car (a))->storage_as.long_array.data;
} }
break; break;
case PARAM_INT8ARRAY: case GIMP_PDB_INT8ARRAY:
if (!TYPEP (car (a), tc_byte_array)) if (!TYPEP (car (a), tc_byte_array))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_INT8ARRAY; args[i].type = GIMP_PDB_INT8ARRAY;
args[i].data.d_int8array = (gint8*) (car (a))->storage_as.string.data; args[i].data.d_int8array = (gint8*) (car (a))->storage_as.string.data;
} }
break; break;
case PARAM_FLOATARRAY: case GIMP_PDB_FLOATARRAY:
if (!TYPEP (car (a), tc_double_array)) if (!TYPEP (car (a), tc_double_array))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_FLOATARRAY; args[i].type = GIMP_PDB_FLOATARRAY;
args[i].data.d_floatarray = (car (a))->storage_as.double_array.data; args[i].data.d_floatarray = (car (a))->storage_as.double_array.data;
} }
break; break;
case PARAM_STRINGARRAY: case GIMP_PDB_STRINGARRAY:
if (!TYPEP (car (a), tc_cons)) if (!TYPEP (car (a), tc_cons))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_STRINGARRAY; args[i].type = GIMP_PDB_STRINGARRAY;
/* Set the array */ /* Set the array */
{ {
@ -651,12 +663,12 @@ marshall_proc_db_call (LISP a)
} }
} }
break; break;
case PARAM_COLOR: case GIMP_PDB_COLOR:
if (!TYPEP (car (a), tc_cons)) if (!TYPEP (car (a), tc_cons))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_COLOR; args[i].type = GIMP_PDB_COLOR;
color_list = car (a); color_list = car (a);
args[i].data.d_color.red = get_c_long (car (color_list)); args[i].data.d_color.red = get_c_long (car (color_list));
color_list = cdr (color_list); color_list = cdr (color_list);
@ -665,75 +677,75 @@ marshall_proc_db_call (LISP a)
args[i].data.d_color.blue = get_c_long (car (color_list)); args[i].data.d_color.blue = get_c_long (car (color_list));
} }
break; break;
case PARAM_REGION: case GIMP_PDB_REGION:
return my_err ("Regions are currently unsupported as arguments", car (a)); return my_err ("Regions are currently unsupported as arguments", car (a));
break; break;
case PARAM_DISPLAY: case GIMP_PDB_DISPLAY:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_DISPLAY; args[i].type = GIMP_PDB_DISPLAY;
args[i].data.d_int32 = get_c_long (car (a)); args[i].data.d_int32 = get_c_long (car (a));
} }
break; break;
case PARAM_IMAGE: case GIMP_PDB_IMAGE:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_IMAGE; args[i].type = GIMP_PDB_IMAGE;
args[i].data.d_int32 = get_c_long (car (a)); args[i].data.d_int32 = get_c_long (car (a));
} }
break; break;
case PARAM_LAYER: case GIMP_PDB_LAYER:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_LAYER; args[i].type = GIMP_PDB_LAYER;
args[i].data.d_int32 = get_c_long (car (a)); args[i].data.d_int32 = get_c_long (car (a));
} }
break; break;
case PARAM_CHANNEL: case GIMP_PDB_CHANNEL:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_CHANNEL; args[i].type = GIMP_PDB_CHANNEL;
args[i].data.d_int32 = get_c_long (car (a)); args[i].data.d_int32 = get_c_long (car (a));
} }
break; break;
case PARAM_DRAWABLE: case GIMP_PDB_DRAWABLE:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_DRAWABLE; args[i].type = GIMP_PDB_DRAWABLE;
args[i].data.d_int32 = get_c_long (car (a)); args[i].data.d_int32 = get_c_long (car (a));
} }
break; break;
case PARAM_SELECTION: case GIMP_PDB_SELECTION:
if (!TYPEP (car (a), tc_flonum)) if (!TYPEP (car (a), tc_flonum))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_SELECTION; args[i].type = GIMP_PDB_SELECTION;
args[i].data.d_int32 = get_c_long (car (a)); args[i].data.d_int32 = get_c_long (car (a));
} }
break; break;
case PARAM_BOUNDARY: case GIMP_PDB_BOUNDARY:
return my_err ("Boundaries are currently unsupported as arguments", car (a)); return my_err ("Boundaries are currently unsupported as arguments", car (a));
break; break;
case PARAM_PATH: case GIMP_PDB_PATH:
return my_err ("Paths are currently unsupported as arguments", car (a)); return my_err ("Paths are currently unsupported as arguments", car (a));
break; break;
case PARAM_PARASITE: case GIMP_PDB_PARASITE:
if (!TYPEP (car (a), tc_cons)) if (!TYPEP (car (a), tc_cons))
success = FALSE; success = FALSE;
if (success) if (success)
{ {
args[i].type = PARAM_PARASITE; args[i].type = GIMP_PDB_PARASITE;
/* parasite->name */ /* parasite->name */
intermediate_val = car (a); intermediate_val = car (a);
args[i].data.d_parasite.name = args[i].data.d_parasite.name =
@ -753,7 +765,7 @@ marshall_proc_db_call (LISP a)
(void*) (car (intermediate_val))->storage_as.string.data; (void*) (car (intermediate_val))->storage_as.string.data;
} }
break; break;
case PARAM_STATUS: case GIMP_PDB_STATUS:
return my_err ("Status is for return types, not arguments", car (a)); return my_err ("Status is for return types, not arguments", car (a));
break; break;
default: default:
@ -777,41 +789,41 @@ marshall_proc_db_call (LISP a)
} }
switch (values[0].data.d_status) switch (values[0].data.d_status)
{ {
case STATUS_EXECUTION_ERROR: case GIMP_PDB_EXECUTION_ERROR:
strcpy (error_str, "Procedural database execution failed:\n "); strcpy (error_str, "Procedural database execution failed:\n ");
lprin1s (a_saved, error_str + strlen(error_str)); lprin1s (a_saved, error_str + strlen(error_str));
return my_err (error_str, NIL); return my_err (error_str, NIL);
break; break;
case STATUS_CALLING_ERROR: case GIMP_PDB_CALLING_ERROR:
strcpy (error_str, "Procedural database execution failed on invalid input arguments:\n "); strcpy (error_str, "Procedural database execution failed on invalid input arguments:\n ");
lprin1s (a_saved, error_str + strlen(error_str)); lprin1s (a_saved, error_str + strlen(error_str));
return my_err (error_str, NIL); return my_err (error_str, NIL);
break; break;
case STATUS_SUCCESS: case GIMP_PDB_SUCCESS:
return_val = NIL; return_val = NIL;
for (i = 0; i < nvalues - 1; i++) for (i = 0; i < nvalues - 1; i++)
{ {
switch (return_vals[i].type) switch (return_vals[i].type)
{ {
case PARAM_INT32: case GIMP_PDB_INT32:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_INT16: case GIMP_PDB_INT16:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_INT8: case GIMP_PDB_INT8:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_FLOAT: case GIMP_PDB_FLOAT:
return_val = cons (flocons (values[i + 1].data.d_float), return_val); return_val = cons (flocons (values[i + 1].data.d_float), return_val);
break; break;
case PARAM_STRING: case GIMP_PDB_STRING:
string = (gchar *) values[i + 1].data.d_string; string = (gchar *) values[i + 1].data.d_string;
string_len = strlen (string); string_len = strlen (string);
return_val = cons (strcons (string_len, string), return_val); return_val = cons (strcons (string_len, string), return_val);
break; break;
case PARAM_INT32ARRAY: case GIMP_PDB_INT32ARRAY:
{ {
LISP array; LISP array;
int j; int j;
@ -823,10 +835,10 @@ marshall_proc_db_call (LISP a)
return_val = cons (array, return_val); return_val = cons (array, return_val);
} }
break; break;
case PARAM_INT16ARRAY: case GIMP_PDB_INT16ARRAY:
return my_err ("Arrays are currently unsupported as return values", NIL); return my_err ("Arrays are currently unsupported as return values", NIL);
break; break;
case PARAM_INT8ARRAY: case GIMP_PDB_INT8ARRAY:
{ {
LISP array; LISP array;
int j; int j;
@ -838,7 +850,7 @@ marshall_proc_db_call (LISP a)
return_val = cons (array, return_val); return_val = cons (array, return_val);
} }
break; break;
case PARAM_FLOATARRAY: case GIMP_PDB_FLOATARRAY:
{ {
LISP array; LISP array;
int j; int j;
@ -850,7 +862,7 @@ marshall_proc_db_call (LISP a)
return_val = cons (array, return_val); return_val = cons (array, return_val);
} }
break; break;
case PARAM_STRINGARRAY: case GIMP_PDB_STRINGARRAY:
/* string arrays are always implemented such that the previous /* string arrays are always implemented such that the previous
* return value contains the number of strings in the array * return value contains the number of strings in the array
*/ */
@ -869,41 +881,41 @@ marshall_proc_db_call (LISP a)
return_val = cons (nreverse (string_array), return_val); return_val = cons (nreverse (string_array), return_val);
} }
break; break;
case PARAM_COLOR: case GIMP_PDB_COLOR:
intermediate_val = cons (flocons ((int) values[i + 1].data.d_color.red), intermediate_val = cons (flocons ((int) values[i + 1].data.d_color.red),
cons (flocons ((int) values[i + 1].data.d_color.green), cons (flocons ((int) values[i + 1].data.d_color.green),
cons (flocons ((int) values[i + 1].data.d_color.blue), cons (flocons ((int) values[i + 1].data.d_color.blue),
NIL))); NIL)));
return_val = cons (intermediate_val, return_val); return_val = cons (intermediate_val, return_val);
break; break;
case PARAM_REGION: case GIMP_PDB_REGION:
return my_err ("Regions are currently unsupported as return values", NIL); return my_err ("Regions are currently unsupported as return values", NIL);
break; break;
case PARAM_DISPLAY: case GIMP_PDB_DISPLAY:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_IMAGE: case GIMP_PDB_IMAGE:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_LAYER: case GIMP_PDB_LAYER:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_CHANNEL: case GIMP_PDB_CHANNEL:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_DRAWABLE: case GIMP_PDB_DRAWABLE:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_SELECTION: case GIMP_PDB_SELECTION:
return_val = cons (flocons (values[i + 1].data.d_int32), return_val); return_val = cons (flocons (values[i + 1].data.d_int32), return_val);
break; break;
case PARAM_BOUNDARY: case GIMP_PDB_BOUNDARY:
return my_err ("Boundaries are currently unsupported as return values", NIL); return my_err ("Boundaries are currently unsupported as return values", NIL);
break; break;
case PARAM_PATH: case GIMP_PDB_PATH:
return my_err ("Paths are currently unsupported as return values", NIL); return my_err ("Paths are currently unsupported as return values", NIL);
break; break;
case PARAM_PARASITE: case GIMP_PDB_PARASITE:
{ {
LISP name, flags, data; LISP name, flags, data;
@ -929,7 +941,7 @@ marshall_proc_db_call (LISP a)
} }
} }
break; break;
case PARAM_STATUS: case GIMP_PDB_STATUS:
return my_err ("Procedural database execution returned multiple status values", NIL); return my_err ("Procedural database execution returned multiple status values", NIL);
break; break;
default: default:
@ -992,9 +1004,9 @@ script_fu_quit_call (LISP a)
static void static void
script_fu_auxillary_init (void) script_fu_auxillary_init (void)
{ {
static GParamDef args[] = static GimpParamDef args[] =
{ {
{ PARAM_INT32, "run_mode", "[Interactive], non-interactive" } { GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" }
}; };
static gint nargs = sizeof (args) / sizeof (args[0]); static gint nargs = sizeof (args) / sizeof (args[0]);
@ -1008,21 +1020,21 @@ script_fu_auxillary_init (void)
"1997", "1997",
N_("<Toolbox>/Xtns/Script-Fu/Refresh"), N_("<Toolbox>/Xtns/Script-Fu/Refresh"),
NULL, NULL,
PROC_TEMPORARY, GIMP_TEMPORARY,
nargs, 0, nargs, 0,
args, NULL, args, NULL,
script_fu_refresh_proc); script_fu_refresh_proc);
} }
static void static void
script_fu_refresh_proc (gchar *name, script_fu_refresh_proc (gchar *name,
gint nparams, gint nparams,
GParam *params, GimpParam *params,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals) GimpParam **return_vals)
{ {
static GParam values[1]; static GimpParam values[1];
GStatusType status = STATUS_SUCCESS; GimpPDBStatusType status = GIMP_PDB_SUCCESS;
/* Reload all of the available scripts */ /* Reload all of the available scripts */
script_fu_find_scripts (); script_fu_find_scripts ();
@ -1030,6 +1042,6 @@ script_fu_refresh_proc (gchar *name,
*nreturn_vals = 1; *nreturn_vals = 1;
*return_vals = values; *return_vals = values;
values[0].type = PARAM_STATUS; values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status; values[0].data.d_status = status;
} }

View File

@ -74,21 +74,21 @@ gint p_procedure_available(gchar *proc_name)
/* Query the gimp application's procedural database /* Query the gimp application's procedural database
* regarding a particular procedure. * regarding a particular procedure.
*/ */
if(gimp_query_procedure (proc_name, if (gimp_procedural_db_proc_info (proc_name,
&l_proc_blurb, &l_proc_blurb,
&l_proc_help, &l_proc_help,
&l_proc_author, &l_proc_author,
&l_proc_copyright, &l_proc_copyright,
&l_proc_date, &l_proc_date,
&l_proc_type, &l_proc_type,
&l_nparams, &l_nparams,
&l_nreturn_vals, &l_nreturn_vals,
&l_params, &l_params,
&l_return_vals)) &l_return_vals))
{ {
/* procedure found in PDB */ /* procedure found in PDB */
return (l_nparams); return (l_nparams);
} }
printf("Warning: Procedure %s not found.\n", proc_name); printf("Warning: Procedure %s not found.\n", proc_name);
return -1; return -1;