From 95ccd16f0cde7d7fa6a322bd7869ab916dcddc4e Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 7 Aug 2000 21:30:35 +0000 Subject: [PATCH] forgot to commit this last weekend :) 2000-08-04 Michael Natterer Sven Neumann * 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 --- ChangeLog | 20 +- libgimp/gimp.h | 3 +- libgimp/gimpcompat.h | 2 + libgimp/gimpprocbrowserdialog.c | 24 +-- libgimp/gimpprocview.c | 24 +-- plug-ins/common/curve_bend.c | 20 +- plug-ins/common/plugin-browser.c | 20 +- plug-ins/common/plugindetails.c | 20 +- plug-ins/dbbrowser/dbbrowser_utils.c | 24 +-- plug-ins/dbbrowser/gimpprocbrowser.c | 24 +-- plug-ins/dbbrowser/gimpprocview.c | 24 +-- plug-ins/dbbrowser/plugin-browser.c | 20 +- plug-ins/gap/gap_dbbrowser_utils.c | 24 +-- plug-ins/gap/gap_filter_codegen.c | 48 ++--- plug-ins/gap/gap_filter_pdb.c | 46 ++--- plug-ins/gap/gap_pdb_calls.c | 30 +-- plug-ins/maze/maze_face.c | 14 +- plug-ins/pygimp/gimpmodule.c | 4 +- plug-ins/script-fu/script-fu-interface.c | 142 ++++++------- plug-ins/script-fu/script-fu-scripts.c | 142 ++++++------- plug-ins/script-fu/script-fu.c | 242 ++++++++++++----------- plug-ins/xjt/xpdb_calls.c | 30 +-- 22 files changed, 487 insertions(+), 460 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0a876d4ca..ad73b9eba8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,26 @@ +2000-08-04 Michael Natterer + Sven Neumann + + * 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 * plug-ins/gdyntext/gdyntext.[ch] * 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. 2000-08-07 Sven Neumann diff --git a/libgimp/gimp.h b/libgimp/gimp.h index 7650f12379..2e9ef0f1aa 100644 --- a/libgimp/gimp.h +++ b/libgimp/gimp.h @@ -48,7 +48,7 @@ #include -#include /* to be removed in 1.3 */ +#include /* to be removed before 1.2 */ #ifdef G_OS_WIN32 # include /* For _-argc and __argv */ @@ -69,7 +69,6 @@ extern "C" { #define gimp_get_data gimp_procedural_db_get_data #define gimp_get_data_size gimp_procedural_db_get_data_size #define gimp_set_data gimp_procedural_db_set_data -#define gimp_query_procedure gimp_procedural_db_proc_info GIMPVAR guint gimp_major_version; diff --git a/libgimp/gimpcompat.h b/libgimp/gimpcompat.h index 96e3b2ecce..409dbf0265 100644 --- a/libgimp/gimpcompat.h +++ b/libgimp/gimpcompat.h @@ -65,6 +65,8 @@ extern "C" { #define gimp_plugin_help_func gimp_standard_help_func #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 Parasite GimpParasite diff --git a/libgimp/gimpprocbrowserdialog.c b/libgimp/gimpprocbrowserdialog.c index 85c0b1aebe..97fe5cbc52 100644 --- a/libgimp/gimpprocbrowserdialog.c +++ b/libgimp/gimpprocbrowserdialog.c @@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser, g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_return_vals); - gimp_query_procedure (proc_name, - &(dbbrowser->selected_proc_blurb), - &(dbbrowser->selected_proc_help), - &(dbbrowser->selected_proc_author), - &(dbbrowser->selected_proc_copyright), - &(dbbrowser->selected_proc_date), - &(dbbrowser->selected_proc_type), - &(dbbrowser->selected_nparams), - &(dbbrowser->selected_nreturn_vals), - &(dbbrowser->selected_params), - &(dbbrowser->selected_return_vals)); - + gimp_procedural_db_proc_info (proc_name, + &(dbbrowser->selected_proc_blurb), + &(dbbrowser->selected_proc_help), + &(dbbrowser->selected_proc_author), + &(dbbrowser->selected_proc_copyright), + &(dbbrowser->selected_proc_date), + &(dbbrowser->selected_proc_type), + &(dbbrowser->selected_nparams), + &(dbbrowser->selected_nreturn_vals), + &(dbbrowser->selected_params), + &(dbbrowser->selected_return_vals)); + /* save the "old" table */ old_table = dbbrowser->descr_table; diff --git a/libgimp/gimpprocview.c b/libgimp/gimpprocview.c index 85c0b1aebe..97fe5cbc52 100644 --- a/libgimp/gimpprocview.c +++ b/libgimp/gimpprocview.c @@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser, g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_return_vals); - gimp_query_procedure (proc_name, - &(dbbrowser->selected_proc_blurb), - &(dbbrowser->selected_proc_help), - &(dbbrowser->selected_proc_author), - &(dbbrowser->selected_proc_copyright), - &(dbbrowser->selected_proc_date), - &(dbbrowser->selected_proc_type), - &(dbbrowser->selected_nparams), - &(dbbrowser->selected_nreturn_vals), - &(dbbrowser->selected_params), - &(dbbrowser->selected_return_vals)); - + gimp_procedural_db_proc_info (proc_name, + &(dbbrowser->selected_proc_blurb), + &(dbbrowser->selected_proc_help), + &(dbbrowser->selected_proc_author), + &(dbbrowser->selected_proc_copyright), + &(dbbrowser->selected_proc_date), + &(dbbrowser->selected_proc_type), + &(dbbrowser->selected_nparams), + &(dbbrowser->selected_nreturn_vals), + &(dbbrowser->selected_params), + &(dbbrowser->selected_return_vals)); + /* save the "old" table */ old_table = dbbrowser->descr_table; diff --git a/plug-ins/common/curve_bend.c b/plug-ins/common/curve_bend.c index b9d4896c94..151eceb89e 100644 --- a/plug-ins/common/curve_bend.c +++ b/plug-ins/common/curve_bend.c @@ -393,17 +393,15 @@ p_pdb_procedure_available (char *proc_name) /* Query the gimp application's procedural database * regarding a particular procedure. */ - if (gimp_query_procedure (proc_name, - &l_proc_blurb, - &l_proc_help, - &l_proc_author, - &l_proc_copyright, - &l_proc_date, - &l_proc_type, - &l_nparams, - &l_nreturn_vals, - &l_params, - &l_return_vals)) + if (gimp_procedural_db_proc_info (proc_name, + &l_proc_blurb, + &l_proc_help, + &l_proc_author, + &l_proc_copyright, + &l_proc_date, + &l_proc_type, + &l_nparams, &l_nreturn_vals, + &l_params, &l_return_vals)) { /* procedure found in PDB */ return (l_nparams); diff --git a/plug-ins/common/plugin-browser.c b/plug-ins/common/plugin-browser.c index d1f161c668..dda8851ef8 100644 --- a/plug-ins/common/plugin-browser.c +++ b/plug-ins/common/plugin-browser.c @@ -293,17 +293,15 @@ procedure_general_select_callback (PDesc *pdesc, selected_params = NULL; selected_return_vals = NULL; - gimp_query_procedure (pinfo->realname, - &selected_proc_blurb, - &selected_proc_help, - &selected_proc_author, - &selected_proc_copyright, - &selected_proc_date, - &selected_proc_type, - &selected_nparams, - &selected_nreturn_vals, - &selected_params, - &selected_return_vals); + gimp_procedural_db_proc_info (pinfo->realname, + &selected_proc_blurb, + &selected_proc_help, + &selected_proc_author, + &selected_proc_copyright, + &selected_proc_date, + &selected_proc_type, + &selected_nparams, &selected_nreturn_vals, + &selected_params, &selected_return_vals); old_table = pdesc->info_table; old_align = pdesc->info_align; diff --git a/plug-ins/common/plugindetails.c b/plug-ins/common/plugindetails.c index d1f161c668..dda8851ef8 100644 --- a/plug-ins/common/plugindetails.c +++ b/plug-ins/common/plugindetails.c @@ -293,17 +293,15 @@ procedure_general_select_callback (PDesc *pdesc, selected_params = NULL; selected_return_vals = NULL; - gimp_query_procedure (pinfo->realname, - &selected_proc_blurb, - &selected_proc_help, - &selected_proc_author, - &selected_proc_copyright, - &selected_proc_date, - &selected_proc_type, - &selected_nparams, - &selected_nreturn_vals, - &selected_params, - &selected_return_vals); + gimp_procedural_db_proc_info (pinfo->realname, + &selected_proc_blurb, + &selected_proc_help, + &selected_proc_author, + &selected_proc_copyright, + &selected_proc_date, + &selected_proc_type, + &selected_nparams, &selected_nreturn_vals, + &selected_params, &selected_return_vals); old_table = pdesc->info_table; old_align = pdesc->info_align; diff --git a/plug-ins/dbbrowser/dbbrowser_utils.c b/plug-ins/dbbrowser/dbbrowser_utils.c index 85c0b1aebe..97fe5cbc52 100644 --- a/plug-ins/dbbrowser/dbbrowser_utils.c +++ b/plug-ins/dbbrowser/dbbrowser_utils.c @@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser, g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_return_vals); - gimp_query_procedure (proc_name, - &(dbbrowser->selected_proc_blurb), - &(dbbrowser->selected_proc_help), - &(dbbrowser->selected_proc_author), - &(dbbrowser->selected_proc_copyright), - &(dbbrowser->selected_proc_date), - &(dbbrowser->selected_proc_type), - &(dbbrowser->selected_nparams), - &(dbbrowser->selected_nreturn_vals), - &(dbbrowser->selected_params), - &(dbbrowser->selected_return_vals)); - + gimp_procedural_db_proc_info (proc_name, + &(dbbrowser->selected_proc_blurb), + &(dbbrowser->selected_proc_help), + &(dbbrowser->selected_proc_author), + &(dbbrowser->selected_proc_copyright), + &(dbbrowser->selected_proc_date), + &(dbbrowser->selected_proc_type), + &(dbbrowser->selected_nparams), + &(dbbrowser->selected_nreturn_vals), + &(dbbrowser->selected_params), + &(dbbrowser->selected_return_vals)); + /* save the "old" table */ old_table = dbbrowser->descr_table; diff --git a/plug-ins/dbbrowser/gimpprocbrowser.c b/plug-ins/dbbrowser/gimpprocbrowser.c index 85c0b1aebe..97fe5cbc52 100644 --- a/plug-ins/dbbrowser/gimpprocbrowser.c +++ b/plug-ins/dbbrowser/gimpprocbrowser.c @@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser, g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_return_vals); - gimp_query_procedure (proc_name, - &(dbbrowser->selected_proc_blurb), - &(dbbrowser->selected_proc_help), - &(dbbrowser->selected_proc_author), - &(dbbrowser->selected_proc_copyright), - &(dbbrowser->selected_proc_date), - &(dbbrowser->selected_proc_type), - &(dbbrowser->selected_nparams), - &(dbbrowser->selected_nreturn_vals), - &(dbbrowser->selected_params), - &(dbbrowser->selected_return_vals)); - + gimp_procedural_db_proc_info (proc_name, + &(dbbrowser->selected_proc_blurb), + &(dbbrowser->selected_proc_help), + &(dbbrowser->selected_proc_author), + &(dbbrowser->selected_proc_copyright), + &(dbbrowser->selected_proc_date), + &(dbbrowser->selected_proc_type), + &(dbbrowser->selected_nparams), + &(dbbrowser->selected_nreturn_vals), + &(dbbrowser->selected_params), + &(dbbrowser->selected_return_vals)); + /* save the "old" table */ old_table = dbbrowser->descr_table; diff --git a/plug-ins/dbbrowser/gimpprocview.c b/plug-ins/dbbrowser/gimpprocview.c index 85c0b1aebe..97fe5cbc52 100644 --- a/plug-ins/dbbrowser/gimpprocview.c +++ b/plug-ins/dbbrowser/gimpprocview.c @@ -317,18 +317,18 @@ dialog_select (dbbrowser_t *dbbrowser, g_free (dbbrowser->selected_params); g_free (dbbrowser->selected_return_vals); - gimp_query_procedure (proc_name, - &(dbbrowser->selected_proc_blurb), - &(dbbrowser->selected_proc_help), - &(dbbrowser->selected_proc_author), - &(dbbrowser->selected_proc_copyright), - &(dbbrowser->selected_proc_date), - &(dbbrowser->selected_proc_type), - &(dbbrowser->selected_nparams), - &(dbbrowser->selected_nreturn_vals), - &(dbbrowser->selected_params), - &(dbbrowser->selected_return_vals)); - + gimp_procedural_db_proc_info (proc_name, + &(dbbrowser->selected_proc_blurb), + &(dbbrowser->selected_proc_help), + &(dbbrowser->selected_proc_author), + &(dbbrowser->selected_proc_copyright), + &(dbbrowser->selected_proc_date), + &(dbbrowser->selected_proc_type), + &(dbbrowser->selected_nparams), + &(dbbrowser->selected_nreturn_vals), + &(dbbrowser->selected_params), + &(dbbrowser->selected_return_vals)); + /* save the "old" table */ old_table = dbbrowser->descr_table; diff --git a/plug-ins/dbbrowser/plugin-browser.c b/plug-ins/dbbrowser/plugin-browser.c index d1f161c668..dda8851ef8 100644 --- a/plug-ins/dbbrowser/plugin-browser.c +++ b/plug-ins/dbbrowser/plugin-browser.c @@ -293,17 +293,15 @@ procedure_general_select_callback (PDesc *pdesc, selected_params = NULL; selected_return_vals = NULL; - gimp_query_procedure (pinfo->realname, - &selected_proc_blurb, - &selected_proc_help, - &selected_proc_author, - &selected_proc_copyright, - &selected_proc_date, - &selected_proc_type, - &selected_nparams, - &selected_nreturn_vals, - &selected_params, - &selected_return_vals); + gimp_procedural_db_proc_info (pinfo->realname, + &selected_proc_blurb, + &selected_proc_help, + &selected_proc_author, + &selected_proc_copyright, + &selected_proc_date, + &selected_proc_type, + &selected_nparams, &selected_nreturn_vals, + &selected_params, &selected_return_vals); old_table = pdesc->info_table; old_align = pdesc->info_align; diff --git a/plug-ins/gap/gap_dbbrowser_utils.c b/plug-ins/gap/gap_dbbrowser_utils.c index fd72d6ff46..530e5442c4 100644 --- a/plug-ins/gap/gap_dbbrowser_utils.c +++ b/plug-ins/gap/gap_dbbrowser_utils.c @@ -299,18 +299,18 @@ dialog_select (dbbrowser_t *dbbrowser, if (dbbrowser->selected_params) g_free(dbbrowser->selected_params); if (dbbrowser->selected_return_vals) g_free(dbbrowser->selected_return_vals); - gimp_query_procedure (proc_name, - &(dbbrowser->selected_proc_blurb), - &(dbbrowser->selected_proc_help), - &(dbbrowser->selected_proc_author), - &(dbbrowser->selected_proc_copyright), - &(dbbrowser->selected_proc_date), - &(dbbrowser->selected_proc_type), - &(dbbrowser->selected_nparams), - &(dbbrowser->selected_nreturn_vals), - &(dbbrowser->selected_params), - &(dbbrowser->selected_return_vals)); - + gimp_procedural_db_proc_info (proc_name, + &(dbbrowser->selected_proc_blurb), + &(dbbrowser->selected_proc_help), + &(dbbrowser->selected_proc_author), + &(dbbrowser->selected_proc_copyright), + &(dbbrowser->selected_proc_date), + &(dbbrowser->selected_proc_type), + &(dbbrowser->selected_nparams), + &(dbbrowser->selected_nreturn_vals), + &(dbbrowser->selected_params), + &(dbbrowser->selected_return_vals)); + /* save the "old" table */ old_table = dbbrowser->descr_table; diff --git a/plug-ins/gap/gap_filter_codegen.c b/plug-ins/gap/gap_filter_codegen.c index 0319de26eb..397acb71ec 100644 --- a/plug-ins/gap/gap_filter_codegen.c +++ b/plug-ins/gap/gap_filter_codegen.c @@ -175,18 +175,18 @@ gint p_gen_code_iter_ALT(char *proc_name) /* Query the gimp application's procedural database * regarding a particular procedure. */ - if(gimp_query_procedure (proc_name, - &l_proc_blurb, - &l_proc_help, - &l_proc_author, - &l_proc_copyright, - &l_proc_date, - &l_proc_type, - &l_nparams, - &l_nreturn_vals, - &l_params, - &l_return_vals)) - { + if (gimp_procedural_db_proc_info (proc_name, + &l_proc_blurb, + &l_proc_help, + &l_proc_author, + &l_proc_copyright, + &l_proc_date, + &l_proc_type, + &l_nparams, + &l_nreturn_vals, + &l_params, + &l_return_vals)) + { p_clean_name(proc_name, &l_clean_proc_name[0]); /* procedure found in PDB */ 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 * regarding a particular procedure. */ - if(gimp_query_procedure (proc_name, - &l_proc_blurb, - &l_proc_help, - &l_proc_author, - &l_proc_copyright, - &l_proc_date, - &l_proc_type, - &l_nparams, - &l_nreturn_vals, - &l_params, - &l_return_vals)) - { + if (gimp_procedural_db_proc_info (proc_name, + &l_proc_blurb, + &l_proc_help, + &l_proc_author, + &l_proc_copyright, + &l_proc_date, + &l_proc_type, + &l_nparams, + &l_nreturn_vals, + &l_params, + &l_return_vals)) + { p_clean_name(proc_name, &l_clean_proc_name[0]); /* procedure found in PDB */ if(gap_debug) fprintf(stderr, "DEBUG: found in PDB %s\n", proc_name); diff --git a/plug-ins/gap/gap_filter_pdb.c b/plug-ins/gap/gap_filter_pdb.c index ca0a380127..d74b99fe28 100644 --- a/plug-ins/gap/gap_filter_pdb.c +++ b/plug-ins/gap/gap_filter_pdb.c @@ -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 */ /* query for plugin_name to get its argument types */ - if (FALSE == gimp_query_procedure (plugin_name, - &l_proc_blurb, - &l_proc_help, - &l_proc_author, - &l_proc_copyright, - &l_proc_date, - &l_proc_type, - &l_nparams, - &l_nreturn_vals, - &l_params, - &l_return_vals)) + if (!gimp_procedural_db_proc_info (plugin_name, + &l_proc_blurb, + &l_proc_help, + &l_proc_author, + &l_proc_copyright, + &l_proc_date, + &l_proc_type, + &l_nparams, + &l_nreturn_vals, + &l_params, + &l_return_vals)) { fprintf(stderr, "ERROR: Plugin not available, Name was %s\n", plugin_name); return -1; @@ -277,18 +277,18 @@ gint p_procedure_available(char *proc_name, t_proc_type ptype) /* Query the gimp application's procedural database * regarding a particular procedure. */ - if (gimp_query_procedure (proc_name, - &l_proc_blurb, - &l_proc_help, - &l_proc_author, - &l_proc_copyright, - &l_proc_date, - &l_proc_type, - &l_nparams, - &l_nreturn_vals, - &l_params, - &l_return_vals)) - { + if (gimp_procedural_db_proc_info (proc_name, + &l_proc_blurb, + &l_proc_help, + &l_proc_author, + &l_proc_copyright, + &l_proc_date, + &l_proc_type, + &l_nparams, + &l_nreturn_vals, + &l_params, + &l_return_vals)) + { /* procedure found in PDB */ if(gap_debug) fprintf(stderr, "DEBUG: found in PDB %s\n", proc_name); diff --git a/plug-ins/gap/gap_pdb_calls.c b/plug-ins/gap/gap_pdb_calls.c index 98c88acb0c..96cd2a7fb5 100644 --- a/plug-ins/gap/gap_pdb_calls.c +++ b/plug-ins/gap/gap_pdb_calls.c @@ -78,21 +78,21 @@ gint p_pdb_procedure_available(char *proc_name) /* Query the gimp application's procedural database * regarding a particular procedure. */ - if(gimp_query_procedure (proc_name, - &l_proc_blurb, - &l_proc_help, - &l_proc_author, - &l_proc_copyright, - &l_proc_date, - &l_proc_type, - &l_nparams, - &l_nreturn_vals, - &l_params, - &l_return_vals)) - { - /* procedure found in PDB */ - return (l_nparams); - } + if (gimp_procedural_db_proc_info (proc_name, + &l_proc_blurb, + &l_proc_help, + &l_proc_author, + &l_proc_copyright, + &l_proc_date, + &l_proc_type, + &l_nparams, + &l_nreturn_vals, + &l_params, + &l_return_vals)) + { + /* procedure found in PDB */ + return (l_nparams); + } printf("Warning: Procedure %s not found.\n", proc_name); return -1; diff --git a/plug-ins/maze/maze_face.c b/plug-ins/maze/maze_face.c index 698819af61..497ba8c249 100644 --- a/plug-ins/maze/maze_face.c +++ b/plug-ins/maze/maze_face.c @@ -586,11 +586,15 @@ maze_help (GtkWidget *widget, gint baz; gchar *message; - if (gimp_query_procedure ("extension_web_browser", - &proc_blurb, &proc_help, - &proc_author, &proc_copyright, &proc_date, - &proc_type, &nparams, &nreturn_vals, - ¶ms, &return_vals)) + if (gimp_procedural_db_proc_info ("extension_web_browser", + &proc_blurb, + &proc_help, + &proc_author, + &proc_copyright, + &proc_date, + &proc_type, + &nparams, &nreturn_vals, + ¶ms, &return_vals)) { /* open URL for help */ message = g_strdup_printf (_("Opening %s"), MAZE_URL); diff --git a/plug-ins/pygimp/gimpmodule.c b/plug-ins/pygimp/gimpmodule.c index 9e9fb78529..77f67596a1 100644 --- a/plug-ins/pygimp/gimpmodule.c +++ b/plug-ins/pygimp/gimpmodule.c @@ -904,8 +904,8 @@ newpfobject(name) int pt, np, nr, i; GParamDef *p, *r; - if (!gimp_query_procedure(name, &b, &h, &a, &c, &d, &pt, - &np, &nr, &p, &r)) { + if (!gimp_procedural_db_proc_info (name, &b, &h, &a, &c, &d, &pt, + &np, &nr, &p, &r)) { PyErr_SetString(ErrorObject, "procedure not found."); return NULL; } diff --git a/plug-ins/script-fu/script-fu-interface.c b/plug-ins/script-fu/script-fu-interface.c index b00f050c66..fd449438ec 100644 --- a/plug-ins/script-fu/script-fu-interface.c +++ b/plug-ins/script-fu/script-fu-interface.c @@ -132,22 +132,22 @@ typedef union typedef struct { - GtkWidget **args_widgets; - gchar *script_name; - gchar *pdb_name; - gchar *description; - gchar *help; - gchar *author; - gchar *copyright; - gchar *date; - gchar *img_types; - gint num_args; - SFArgType *arg_types; - gchar **arg_labels; - SFArgValue *arg_defaults; - SFArgValue *arg_values; - gint32 image_based; - GParamDef *args; /* used only temporary until installed */ + GtkWidget **args_widgets; + gchar *script_name; + gchar *pdb_name; + gchar *description; + gchar *help; + gchar *author; + gchar *copyright; + gchar *date; + gchar *img_types; + gint num_args; + SFArgType *arg_types; + gchar **arg_labels; + SFArgValue *arg_defaults; + SFArgValue *arg_values; + gint32 image_based; + GimpParamDef *args; /* used only temporary until installed */ } SFScript; typedef struct @@ -165,36 +165,36 @@ extern long nlength (LISP obj); * Local Functions */ -static gint script_fu_install_script (gpointer foo, - SFScript *script, - gpointer bar); -static gint script_fu_remove_script (gpointer foo, - SFScript *script, - gpointer bar); -static void script_fu_script_proc (gchar *name, - gint nparams, - GParam *params, - gint *nreturn_vals, - GParam **return_vals); +static gint script_fu_install_script (gpointer foo, + SFScript *script, + gpointer bar); +static gint script_fu_remove_script (gpointer foo, + SFScript *script, + gpointer bar); +static void script_fu_script_proc (gchar *name, + gint nparams, + GimpParam *params, + gint *nreturn_vals, + GimpParam **return_vals); -static SFScript * script_fu_find_script (gchar *script_name); -static void script_fu_free_script (SFScript *script); +static SFScript * script_fu_find_script (gchar *script_name); +static void script_fu_free_script (SFScript *script); static void script_fu_enable_cc (void); -static void script_fu_disable_cc (gint err_msg); -static void script_fu_interface (SFScript *script); -static void script_fu_font_preview (GtkWidget *preview, - gchar *fontname); -static void script_fu_cleanup_widgets (SFScript *script); -static void script_fu_ok_callback (GtkWidget *widget, - gpointer data); -static gint script_fu_destroy_callback (GtkWidget *widget, - gpointer data); -static void script_fu_about_callback (GtkWidget *widget, - gpointer data); -static void script_fu_reset_callback (GtkWidget *widget, - gpointer data); -static void script_fu_menu_callback (gint32 id, - gpointer data); +static void script_fu_disable_cc (gint err_msg); +static void script_fu_interface (SFScript *script); +static void script_fu_font_preview (GtkWidget *preview, + gchar *fontname); +static void script_fu_cleanup_widgets (SFScript *script); +static void script_fu_ok_callback (GtkWidget *widget, + gpointer data); +static gint script_fu_destroy_callback (GtkWidget *widget, + gpointer data); +static void script_fu_about_callback (GtkWidget *widget, + gpointer data); +static void script_fu_reset_callback (GtkWidget *widget, + gpointer data); +static void script_fu_menu_callback (gint32 id, + gpointer data); static void script_fu_file_selection_callback(GtkWidget *widget, gpointer data); static void script_fu_font_preview_callback (GtkWidget *widget, @@ -385,7 +385,7 @@ script_fu_find_scripts (void) LISP script_fu_add_script (LISP a) { - GParamDef *args; + GimpParamDef *args; SFScript *script; gchar *val; gint i; @@ -458,8 +458,8 @@ script_fu_add_script (LISP a) /* Check the supplied number of arguments */ script->num_args = nlength (a) / 3; - args = g_new (GParamDef, script->num_args + 1); - args[0].type = PARAM_INT32; + args = g_new (GimpParamDef, script->num_args + 1); + args[0].type = GIMP_PDB_INT32; args[0].name = "run_mode"; args[0].description = "Interactive, non-interactive"; @@ -509,19 +509,19 @@ script_fu_add_script (LISP a) switch (script->arg_types[i]) { case SF_IMAGE: - args[i + 1].type = PARAM_IMAGE; + args[i + 1].type = GIMP_PDB_IMAGE; args[i + 1].name = "image"; break; case SF_DRAWABLE: - args[i + 1].type = PARAM_DRAWABLE; + args[i + 1].type = GIMP_PDB_DRAWABLE; args[i + 1].name = "drawable"; break; case SF_LAYER: - args[i + 1].type = PARAM_LAYER; + args[i + 1].type = GIMP_PDB_LAYER; args[i + 1].name = "layer"; break; case SF_CHANNEL: - args[i + 1].type = PARAM_CHANNEL; + args[i + 1].type = GIMP_PDB_CHANNEL; args[i + 1].name = "channel"; break; 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_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].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; 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.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].description = script->arg_labels[i]; 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.fileselection = NULL; - args[i + 1].type = PARAM_STRING; + args[i + 1].type = GIMP_PDB_STRING; args[i + 1].name = "filename"; args[i + 1].description = script->arg_labels[i]; 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.dialog = NULL; - args[i + 1].type = PARAM_STRING; + args[i + 1].type = GIMP_PDB_STRING; args[i + 1].name = "font"; args[i + 1].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; 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); - args[i + 1].type = PARAM_STRING; + args[i + 1].type = GIMP_PDB_STRING; args[i + 1].name = "brush"; args[i + 1].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; break; @@ -702,7 +702,7 @@ script_fu_add_script (LISP a) script->arg_defaults[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].description = script->arg_labels[i]; break; @@ -805,15 +805,15 @@ script_fu_remove_script (gpointer foo, static void -script_fu_script_proc (gchar *name, - gint nparams, - GParam *params, - gint *nreturn_vals, - GParam **return_vals) +script_fu_script_proc (gchar *name, + gint nparams, + GimpParam *params, + gint *nreturn_vals, + GimpParam **return_vals) { - static GParam values[1]; - GStatusType status = STATUS_SUCCESS; - GRunModeType run_mode; + static GimpParam values[1]; + GimpPDBStatusType status = STATUS_SUCCESS; + GimpRunModeType run_mode; SFScript *script; gint min_args; gchar *escaped; @@ -990,7 +990,7 @@ script_fu_script_proc (gchar *name, *nreturn_vals = 1; *return_vals = values; - values[0].type = PARAM_STATUS; + values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; } diff --git a/plug-ins/script-fu/script-fu-scripts.c b/plug-ins/script-fu/script-fu-scripts.c index b00f050c66..fd449438ec 100644 --- a/plug-ins/script-fu/script-fu-scripts.c +++ b/plug-ins/script-fu/script-fu-scripts.c @@ -132,22 +132,22 @@ typedef union typedef struct { - GtkWidget **args_widgets; - gchar *script_name; - gchar *pdb_name; - gchar *description; - gchar *help; - gchar *author; - gchar *copyright; - gchar *date; - gchar *img_types; - gint num_args; - SFArgType *arg_types; - gchar **arg_labels; - SFArgValue *arg_defaults; - SFArgValue *arg_values; - gint32 image_based; - GParamDef *args; /* used only temporary until installed */ + GtkWidget **args_widgets; + gchar *script_name; + gchar *pdb_name; + gchar *description; + gchar *help; + gchar *author; + gchar *copyright; + gchar *date; + gchar *img_types; + gint num_args; + SFArgType *arg_types; + gchar **arg_labels; + SFArgValue *arg_defaults; + SFArgValue *arg_values; + gint32 image_based; + GimpParamDef *args; /* used only temporary until installed */ } SFScript; typedef struct @@ -165,36 +165,36 @@ extern long nlength (LISP obj); * Local Functions */ -static gint script_fu_install_script (gpointer foo, - SFScript *script, - gpointer bar); -static gint script_fu_remove_script (gpointer foo, - SFScript *script, - gpointer bar); -static void script_fu_script_proc (gchar *name, - gint nparams, - GParam *params, - gint *nreturn_vals, - GParam **return_vals); +static gint script_fu_install_script (gpointer foo, + SFScript *script, + gpointer bar); +static gint script_fu_remove_script (gpointer foo, + SFScript *script, + gpointer bar); +static void script_fu_script_proc (gchar *name, + gint nparams, + GimpParam *params, + gint *nreturn_vals, + GimpParam **return_vals); -static SFScript * script_fu_find_script (gchar *script_name); -static void script_fu_free_script (SFScript *script); +static SFScript * script_fu_find_script (gchar *script_name); +static void script_fu_free_script (SFScript *script); static void script_fu_enable_cc (void); -static void script_fu_disable_cc (gint err_msg); -static void script_fu_interface (SFScript *script); -static void script_fu_font_preview (GtkWidget *preview, - gchar *fontname); -static void script_fu_cleanup_widgets (SFScript *script); -static void script_fu_ok_callback (GtkWidget *widget, - gpointer data); -static gint script_fu_destroy_callback (GtkWidget *widget, - gpointer data); -static void script_fu_about_callback (GtkWidget *widget, - gpointer data); -static void script_fu_reset_callback (GtkWidget *widget, - gpointer data); -static void script_fu_menu_callback (gint32 id, - gpointer data); +static void script_fu_disable_cc (gint err_msg); +static void script_fu_interface (SFScript *script); +static void script_fu_font_preview (GtkWidget *preview, + gchar *fontname); +static void script_fu_cleanup_widgets (SFScript *script); +static void script_fu_ok_callback (GtkWidget *widget, + gpointer data); +static gint script_fu_destroy_callback (GtkWidget *widget, + gpointer data); +static void script_fu_about_callback (GtkWidget *widget, + gpointer data); +static void script_fu_reset_callback (GtkWidget *widget, + gpointer data); +static void script_fu_menu_callback (gint32 id, + gpointer data); static void script_fu_file_selection_callback(GtkWidget *widget, gpointer data); static void script_fu_font_preview_callback (GtkWidget *widget, @@ -385,7 +385,7 @@ script_fu_find_scripts (void) LISP script_fu_add_script (LISP a) { - GParamDef *args; + GimpParamDef *args; SFScript *script; gchar *val; gint i; @@ -458,8 +458,8 @@ script_fu_add_script (LISP a) /* Check the supplied number of arguments */ script->num_args = nlength (a) / 3; - args = g_new (GParamDef, script->num_args + 1); - args[0].type = PARAM_INT32; + args = g_new (GimpParamDef, script->num_args + 1); + args[0].type = GIMP_PDB_INT32; args[0].name = "run_mode"; args[0].description = "Interactive, non-interactive"; @@ -509,19 +509,19 @@ script_fu_add_script (LISP a) switch (script->arg_types[i]) { case SF_IMAGE: - args[i + 1].type = PARAM_IMAGE; + args[i + 1].type = GIMP_PDB_IMAGE; args[i + 1].name = "image"; break; case SF_DRAWABLE: - args[i + 1].type = PARAM_DRAWABLE; + args[i + 1].type = GIMP_PDB_DRAWABLE; args[i + 1].name = "drawable"; break; case SF_LAYER: - args[i + 1].type = PARAM_LAYER; + args[i + 1].type = GIMP_PDB_LAYER; args[i + 1].name = "layer"; break; case SF_CHANNEL: - args[i + 1].type = PARAM_CHANNEL; + args[i + 1].type = GIMP_PDB_CHANNEL; args[i + 1].name = "channel"; break; 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_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].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; 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.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].description = script->arg_labels[i]; 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.fileselection = NULL; - args[i + 1].type = PARAM_STRING; + args[i + 1].type = GIMP_PDB_STRING; args[i + 1].name = "filename"; args[i + 1].description = script->arg_labels[i]; 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.dialog = NULL; - args[i + 1].type = PARAM_STRING; + args[i + 1].type = GIMP_PDB_STRING; args[i + 1].name = "font"; args[i + 1].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; 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); - args[i + 1].type = PARAM_STRING; + args[i + 1].type = GIMP_PDB_STRING; args[i + 1].name = "brush"; args[i + 1].description = script->arg_labels[i]; 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_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].description = script->arg_labels[i]; break; @@ -702,7 +702,7 @@ script_fu_add_script (LISP a) script->arg_defaults[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].description = script->arg_labels[i]; break; @@ -805,15 +805,15 @@ script_fu_remove_script (gpointer foo, static void -script_fu_script_proc (gchar *name, - gint nparams, - GParam *params, - gint *nreturn_vals, - GParam **return_vals) +script_fu_script_proc (gchar *name, + gint nparams, + GimpParam *params, + gint *nreturn_vals, + GimpParam **return_vals) { - static GParam values[1]; - GStatusType status = STATUS_SUCCESS; - GRunModeType run_mode; + static GimpParam values[1]; + GimpPDBStatusType status = STATUS_SUCCESS; + GimpRunModeType run_mode; SFScript *script; gint min_args; gchar *escaped; @@ -990,7 +990,7 @@ script_fu_script_proc (gchar *name, *nreturn_vals = 1; *return_vals = values; - values[0].type = PARAM_STATUS; + values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; } diff --git a/plug-ins/script-fu/script-fu.c b/plug-ins/script-fu/script-fu.c index 1a298ac8f6..55b8c9b2ec 100644 --- a/plug-ins/script-fu/script-fu.c +++ b/plug-ins/script-fu/script-fu.c @@ -58,11 +58,11 @@ extern void fput_st (FILE *f, */ static void sfquit (void); static void query (void); -static void run (gchar *name, - gint nparams, - GParam *param, - gint *nreturn_vals, - GParam **return_vals); +static void run (gchar *name, + gint nparams, + GimpParam *param, + gint *nreturn_vals, + GimpParam **return_vals); static gint init_interp (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 void script_fu_auxillary_init (void); -static void script_fu_refresh_proc (gchar *name, - gint nparams, - GParam *params, - gint *nreturn_vals, - GParam **return_vals); +static void script_fu_refresh_proc (gchar *name, + gint nparams, + GimpParam *params, + gint *nreturn_vals, + GimpParam **return_vals); -GPlugInInfo PLUG_IN_INFO = +GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ sfquit, /* quit_proc */ @@ -121,24 +121,24 @@ sfquit (void) static 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 GParamDef eval_args[] = + static GimpParamDef eval_args[] = { - { PARAM_INT32, "run_mode", "[Interactive], non-interactive" }, - { PARAM_STRING, "code", "The code to evaluate" } + { GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" }, + { GIMP_PDB_STRING, "code", "The code to evaluate" } }; 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" }, - { PARAM_INT32, "port", "The port on which to listen for requests" }, - { PARAM_STRING, "logfile", "The file to log server activity to" } + { GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" }, + { GIMP_PDB_INT32, "port", "The port on which to listen for requests" }, + { GIMP_PDB_STRING, "logfile", "The file to log server activity to" } }; static gint nserver_args = sizeof (server_args) / sizeof (server_args[0]); @@ -152,7 +152,7 @@ query (void) "1997", NULL, NULL, - PROC_EXTENSION, + GIMP_EXTENSION, 0, 0, NULL, NULL); gimp_install_procedure ("extension_script_fu_console", @@ -163,7 +163,7 @@ query (void) "1997", N_("/Xtns/Script-Fu/Console..."), NULL, - PROC_EXTENSION, + GIMP_EXTENSION, nconsole_args, 0, console_args, NULL); @@ -176,7 +176,7 @@ query (void) "1997", N_("/Xtns/Script-Fu/Server..."), NULL, - PROC_EXTENSION, + GIMP_EXTENSION, nserver_args, 0, server_args, NULL); #endif @@ -189,17 +189,17 @@ query (void) "1998", NULL, NULL, - PROC_EXTENSION, + GIMP_EXTENSION, neval_args, 0, eval_args, NULL); } static void -run (gchar *name, - gint nparams, - GParam *param, - gint *nreturn_vals, - GParam **return_vals) +run (gchar *name, + gint nparams, + GimpParam *param, + gint *nreturn_vals, + GimpParam **return_vals) { siod_output = stdout; @@ -228,8 +228,8 @@ run (gchar *name, */ if (strcmp (name, "extension_script_fu") == 0) { - static GParam values[1]; - GStatusType status = STATUS_SUCCESS; + static GimpParam values[1]; + GimpPDBStatusType status = GIMP_PDB_SUCCESS; /* Acknowledge that the extension is properly initialized */ gimp_extension_ack (); @@ -240,7 +240,7 @@ run (gchar *name, *nreturn_vals = 1; *return_vals = values; - values[0].type = PARAM_STATUS; + values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; } /* @@ -322,9 +322,15 @@ init_procedures (void) proc_name = g_strdup (proc_list[i]); /* lookup the procedure */ - if (gimp_query_procedure (proc_name, &proc_blurb, &proc_help, &proc_author, - &proc_copyright, &proc_date, &proc_type, &nparams, &nreturn_vals, - ¶ms, &return_vals) == TRUE) + if (gimp_procedural_db_proc_info (proc_name, + &proc_blurb, + &proc_help, + &proc_author, + &proc_copyright, + &proc_date, + &proc_type, + &nparams, &nreturn_vals, + ¶ms, &return_vals)) { LISP args = NIL; LISP code = NIL; @@ -517,9 +523,15 @@ marshall_proc_db_call (LISP a) script_fu_report_cc (proc_name); /* Attempt to fetch the procedure from the database */ - if (gimp_query_procedure (proc_name, &proc_blurb, &proc_help, &proc_author, - &proc_copyright, &proc_date, &proc_type, &nparams, &nreturn_vals, - ¶ms, &return_vals) == FALSE) + if (!gimp_procedural_db_proc_info (proc_name, + &proc_blurb, + &proc_help, + &proc_author, + &proc_copyright, + &proc_date, + &proc_type, + &nparams, &nreturn_vals, + ¶ms, &return_vals)) return my_err ("Invalid procedure name specified.", NIL); @@ -533,7 +545,7 @@ marshall_proc_db_call (LISP a) /* Marshall the supplied arguments */ if (nparams) - args = (GParam *) g_new (GParam, nparams); + args = (GimpParam *) g_new (GimpParam, nparams); else args = NULL; @@ -542,93 +554,93 @@ marshall_proc_db_call (LISP a) { switch (params[i].type) { - case PARAM_INT32: + case GIMP_PDB_INT32: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_INT32; + args[i].type = GIMP_PDB_INT32; args[i].data.d_int32 = get_c_long (car (a)); } break; - case PARAM_INT16: + case GIMP_PDB_INT16: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_INT16; + args[i].type = GIMP_PDB_INT16; args[i].data.d_int16 = (gint16) get_c_long (car (a)); } break; - case PARAM_INT8: + case GIMP_PDB_INT8: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_INT8; + args[i].type = GIMP_PDB_INT8; args[i].data.d_int8 = (gint8) get_c_long (car (a)); } break; - case PARAM_FLOAT: + case GIMP_PDB_FLOAT: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_FLOAT; + args[i].type = GIMP_PDB_FLOAT; args[i].data.d_float = get_c_double (car (a)); } break; - case PARAM_STRING: + case GIMP_PDB_STRING: if (!TYPEP (car (a), tc_string)) success = FALSE; if (success) { - args[i].type = PARAM_STRING; + args[i].type = GIMP_PDB_STRING; args[i].data.d_string = get_c_string (car (a)); } break; - case PARAM_INT32ARRAY: + case GIMP_PDB_INT32ARRAY: if (!TYPEP (car (a), tc_long_array)) success = FALSE; 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; } break; - case PARAM_INT16ARRAY: + case GIMP_PDB_INT16ARRAY: if (!TYPEP (car (a), tc_long_array)) success = FALSE; 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; } break; - case PARAM_INT8ARRAY: + case GIMP_PDB_INT8ARRAY: if (!TYPEP (car (a), tc_byte_array)) success = FALSE; 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; } break; - case PARAM_FLOATARRAY: + case GIMP_PDB_FLOATARRAY: if (!TYPEP (car (a), tc_double_array)) success = FALSE; 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; } break; - case PARAM_STRINGARRAY: + case GIMP_PDB_STRINGARRAY: if (!TYPEP (car (a), tc_cons)) success = FALSE; if (success) { - args[i].type = PARAM_STRINGARRAY; + args[i].type = GIMP_PDB_STRINGARRAY; /* Set the array */ { @@ -651,12 +663,12 @@ marshall_proc_db_call (LISP a) } } break; - case PARAM_COLOR: + case GIMP_PDB_COLOR: if (!TYPEP (car (a), tc_cons)) success = FALSE; if (success) { - args[i].type = PARAM_COLOR; + args[i].type = GIMP_PDB_COLOR; color_list = car (a); args[i].data.d_color.red = get_c_long (car (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)); } break; - case PARAM_REGION: + case GIMP_PDB_REGION: return my_err ("Regions are currently unsupported as arguments", car (a)); break; - case PARAM_DISPLAY: + case GIMP_PDB_DISPLAY: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_DISPLAY; + args[i].type = GIMP_PDB_DISPLAY; args[i].data.d_int32 = get_c_long (car (a)); } break; - case PARAM_IMAGE: + case GIMP_PDB_IMAGE: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_IMAGE; + args[i].type = GIMP_PDB_IMAGE; args[i].data.d_int32 = get_c_long (car (a)); } break; - case PARAM_LAYER: + case GIMP_PDB_LAYER: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_LAYER; + args[i].type = GIMP_PDB_LAYER; args[i].data.d_int32 = get_c_long (car (a)); } break; - case PARAM_CHANNEL: + case GIMP_PDB_CHANNEL: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_CHANNEL; + args[i].type = GIMP_PDB_CHANNEL; args[i].data.d_int32 = get_c_long (car (a)); } break; - case PARAM_DRAWABLE: + case GIMP_PDB_DRAWABLE: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_DRAWABLE; + args[i].type = GIMP_PDB_DRAWABLE; args[i].data.d_int32 = get_c_long (car (a)); } break; - case PARAM_SELECTION: + case GIMP_PDB_SELECTION: if (!TYPEP (car (a), tc_flonum)) success = FALSE; if (success) { - args[i].type = PARAM_SELECTION; + args[i].type = GIMP_PDB_SELECTION; args[i].data.d_int32 = get_c_long (car (a)); } break; - case PARAM_BOUNDARY: + case GIMP_PDB_BOUNDARY: return my_err ("Boundaries are currently unsupported as arguments", car (a)); break; - case PARAM_PATH: + case GIMP_PDB_PATH: return my_err ("Paths are currently unsupported as arguments", car (a)); break; - case PARAM_PARASITE: + case GIMP_PDB_PARASITE: if (!TYPEP (car (a), tc_cons)) success = FALSE; if (success) { - args[i].type = PARAM_PARASITE; + args[i].type = GIMP_PDB_PARASITE; /* parasite->name */ intermediate_val = car (a); args[i].data.d_parasite.name = @@ -753,7 +765,7 @@ marshall_proc_db_call (LISP a) (void*) (car (intermediate_val))->storage_as.string.data; } break; - case PARAM_STATUS: + case GIMP_PDB_STATUS: return my_err ("Status is for return types, not arguments", car (a)); break; default: @@ -777,41 +789,41 @@ marshall_proc_db_call (LISP a) } switch (values[0].data.d_status) { - case STATUS_EXECUTION_ERROR: + case GIMP_PDB_EXECUTION_ERROR: strcpy (error_str, "Procedural database execution failed:\n "); lprin1s (a_saved, error_str + strlen(error_str)); return my_err (error_str, NIL); break; - case STATUS_CALLING_ERROR: + case GIMP_PDB_CALLING_ERROR: strcpy (error_str, "Procedural database execution failed on invalid input arguments:\n "); lprin1s (a_saved, error_str + strlen(error_str)); return my_err (error_str, NIL); break; - case STATUS_SUCCESS: + case GIMP_PDB_SUCCESS: return_val = NIL; for (i = 0; i < nvalues - 1; i++) { switch (return_vals[i].type) { - case PARAM_INT32: + case GIMP_PDB_INT32: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_INT16: + case GIMP_PDB_INT16: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_INT8: + case GIMP_PDB_INT8: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_FLOAT: + case GIMP_PDB_FLOAT: return_val = cons (flocons (values[i + 1].data.d_float), return_val); break; - case PARAM_STRING: + case GIMP_PDB_STRING: string = (gchar *) values[i + 1].data.d_string; string_len = strlen (string); return_val = cons (strcons (string_len, string), return_val); break; - case PARAM_INT32ARRAY: + case GIMP_PDB_INT32ARRAY: { LISP array; int j; @@ -823,10 +835,10 @@ marshall_proc_db_call (LISP a) return_val = cons (array, return_val); } break; - case PARAM_INT16ARRAY: + case GIMP_PDB_INT16ARRAY: return my_err ("Arrays are currently unsupported as return values", NIL); break; - case PARAM_INT8ARRAY: + case GIMP_PDB_INT8ARRAY: { LISP array; int j; @@ -838,7 +850,7 @@ marshall_proc_db_call (LISP a) return_val = cons (array, return_val); } break; - case PARAM_FLOATARRAY: + case GIMP_PDB_FLOATARRAY: { LISP array; int j; @@ -850,7 +862,7 @@ marshall_proc_db_call (LISP a) return_val = cons (array, return_val); } break; - case PARAM_STRINGARRAY: + case GIMP_PDB_STRINGARRAY: /* string arrays are always implemented such that the previous * 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); } break; - case PARAM_COLOR: + case GIMP_PDB_COLOR: 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.blue), NIL))); return_val = cons (intermediate_val, return_val); break; - case PARAM_REGION: + case GIMP_PDB_REGION: return my_err ("Regions are currently unsupported as return values", NIL); break; - case PARAM_DISPLAY: + case GIMP_PDB_DISPLAY: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_IMAGE: + case GIMP_PDB_IMAGE: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_LAYER: + case GIMP_PDB_LAYER: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_CHANNEL: + case GIMP_PDB_CHANNEL: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_DRAWABLE: + case GIMP_PDB_DRAWABLE: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_SELECTION: + case GIMP_PDB_SELECTION: return_val = cons (flocons (values[i + 1].data.d_int32), return_val); break; - case PARAM_BOUNDARY: + case GIMP_PDB_BOUNDARY: return my_err ("Boundaries are currently unsupported as return values", NIL); break; - case PARAM_PATH: + case GIMP_PDB_PATH: return my_err ("Paths are currently unsupported as return values", NIL); break; - case PARAM_PARASITE: + case GIMP_PDB_PARASITE: { LISP name, flags, data; @@ -929,7 +941,7 @@ marshall_proc_db_call (LISP a) } } break; - case PARAM_STATUS: + case GIMP_PDB_STATUS: return my_err ("Procedural database execution returned multiple status values", NIL); break; default: @@ -992,9 +1004,9 @@ script_fu_quit_call (LISP a) static 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]); @@ -1008,21 +1020,21 @@ script_fu_auxillary_init (void) "1997", N_("/Xtns/Script-Fu/Refresh"), NULL, - PROC_TEMPORARY, + GIMP_TEMPORARY, nargs, 0, args, NULL, script_fu_refresh_proc); } static void -script_fu_refresh_proc (gchar *name, - gint nparams, - GParam *params, - gint *nreturn_vals, - GParam **return_vals) +script_fu_refresh_proc (gchar *name, + gint nparams, + GimpParam *params, + gint *nreturn_vals, + GimpParam **return_vals) { - static GParam values[1]; - GStatusType status = STATUS_SUCCESS; + static GimpParam values[1]; + GimpPDBStatusType status = GIMP_PDB_SUCCESS; /* Reload all of the available scripts */ script_fu_find_scripts (); @@ -1030,6 +1042,6 @@ script_fu_refresh_proc (gchar *name, *nreturn_vals = 1; *return_vals = values; - values[0].type = PARAM_STATUS; + values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; } diff --git a/plug-ins/xjt/xpdb_calls.c b/plug-ins/xjt/xpdb_calls.c index 41153c21b8..7e710eb6a8 100644 --- a/plug-ins/xjt/xpdb_calls.c +++ b/plug-ins/xjt/xpdb_calls.c @@ -74,21 +74,21 @@ gint p_procedure_available(gchar *proc_name) /* Query the gimp application's procedural database * regarding a particular procedure. */ - if(gimp_query_procedure (proc_name, - &l_proc_blurb, - &l_proc_help, - &l_proc_author, - &l_proc_copyright, - &l_proc_date, - &l_proc_type, - &l_nparams, - &l_nreturn_vals, - &l_params, - &l_return_vals)) - { - /* procedure found in PDB */ - return (l_nparams); - } + if (gimp_procedural_db_proc_info (proc_name, + &l_proc_blurb, + &l_proc_help, + &l_proc_author, + &l_proc_copyright, + &l_proc_date, + &l_proc_type, + &l_nparams, + &l_nreturn_vals, + &l_params, + &l_return_vals)) + { + /* procedure found in PDB */ + return (l_nparams); + } printf("Warning: Procedure %s not found.\n", proc_name); return -1;