gimp r26928 - in trunk: . plug-ins/script-fu



Author: mitch
Date: Thu Sep 11 18:00:18 2008
New Revision: 26928
URL: http://svn.gnome.org/viewvc/gimp?rev=26928&view=rev

Log:
2008-09-11  Michael Natterer  <mitch gimp org>

	* plug-ins/script-fu/scheme-wrapper.[ch]: reordered and renamed
	functions to be consistent. Got rid of file-global "register_scripts"
	variable. Pass more "scheme *sc" pointers around to reduce usage
	or the global variable.

	* plug-ins/script-fu/script-fu-eval.c
	* plug-ins/script-fu/script-fu-scripts.c
	* plug-ins/script-fu/script-fu-server.c
	* plug-ins/script-fu/script-fu.c: changed accordingly.



Modified:
   trunk/ChangeLog
   trunk/plug-ins/script-fu/scheme-wrapper.c
   trunk/plug-ins/script-fu/scheme-wrapper.h
   trunk/plug-ins/script-fu/script-fu-eval.c
   trunk/plug-ins/script-fu/script-fu-scripts.c
   trunk/plug-ins/script-fu/script-fu-server.c
   trunk/plug-ins/script-fu/script-fu.c

Modified: trunk/plug-ins/script-fu/scheme-wrapper.c
==============================================================================
--- trunk/plug-ins/script-fu/scheme-wrapper.c	(original)
+++ trunk/plug-ins/script-fu/scheme-wrapper.c	Thu Sep 11 18:00:18 2008
@@ -23,7 +23,7 @@
 
 #include "config.h"
 
-#include <string.h> /* memcpy, strcpy, strlen */
+#include <string.h>
 
 #include <glib/gstdio.h>
 
@@ -47,15 +47,35 @@
 
 #include "scheme-wrapper.h"
 
+
 #undef cons
 
-struct named_constant
+static void     ts_init_constants                (scheme    *sc);
+static void     ts_init_procedures               (scheme    *sc,
+                                                  gboolean   register_scipts);
+static void     convert_string                   (gchar     *str);
+static pointer  script_fu_marshal_procedure_call (scheme    *sc,
+                                                  pointer    a);
+static void     script_fu_marshal_destroy_args   (GimpParam *params,
+                                                  gint       n_params);
+
+static pointer  script_fu_register_call          (scheme    *sc,
+                                                  pointer    a);
+static pointer  script_fu_menu_register_call     (scheme    *sc,
+                                                  pointer    a);
+static pointer  script_fu_quit_call              (scheme    *sc,
+                                                  pointer    a);
+static pointer  script_fu_nil_call               (scheme    *sc,
+                                                  pointer    a);
+
+
+typedef struct
 {
   const gchar *name;
   gint         value;
-};
+} NamedConstant;
 
-struct named_constant const script_constants[] =
+static const NamedConstant const script_constants[] =
 {
   /* Useful values from libgimpbase/gimplimits.h */
   { "MIN-IMAGE-SIZE", GIMP_MIN_IMAGE_SIZE },
@@ -108,7 +128,7 @@
  * included to keep backwards compatability with
  * older scripts used with version 2.0 of GIMP.
  */
-struct named_constant const old_constants[] =
+static const NamedConstant const old_constants[] =
 {
   { "NORMAL",               GIMP_NORMAL_MODE       },
   { "DISSOLVE",             GIMP_DISSOLVE_MODE     },
@@ -190,84 +210,11 @@
 
 
 void
-ts_stdout_output_func (TsOutputType  type,
-                       const char   *string,
-                       int           len,
-                       gpointer      user_data)
-{
-  if (len < 0)
-    len = strlen (string);
-  fprintf (stdout, "%.*s", len, string);
-}
-
-void
-ts_gstring_output_func (TsOutputType  type,
-                        const char   *string,
-                        int           len,
-                        gpointer      user_data)
-{
-  GString *gstr = (GString *) user_data;
-
-  g_string_append_len (gstr, string, len);
-}
-
-void
-ts_set_print_flag (gint print_flag)
-{
-  sc.print_output = print_flag;
-}
-
-void
-ts_print_welcome (void)
-{
-  ts_output_string (TS_OUTPUT_NORMAL,
-                    "Welcome to TinyScheme, Version 1.38\n", -1);
-  ts_output_string (TS_OUTPUT_NORMAL,
-                    "Copyright (c) Dimitrios Souflis\n", -1);
-}
-
-void
-ts_interpret_stdin (void)
-{
-  scheme_load_file (&sc, stdin);
-}
-
-gint
-ts_interpret_string (const gchar *expr)
-{
-#if DEBUG_SCRIPTS
-  sc.print_output = 1;
-  sc.tracing = 1;
-#endif
-
-  sc.vptr->load_string (&sc, (char *) expr);
-
-  return sc.retcode;
-}
-
-const gchar *
-ts_get_success_msg (void)
-{
-  if (sc.vptr->is_string (sc.value))
-    return sc.vptr->string_value (sc.value);
-
-  return "Success";
-}
-
-
-static void  init_constants  (void);
-static void  init_procedures (void);
-
-static gboolean register_scripts = FALSE;
-
-void
 tinyscheme_init (const gchar *path,
-                 gboolean     local_register_scripts)
+                 gboolean     register_scripts)
 {
-  register_scripts = local_register_scripts;
-
   /* init the interpreter */
-  if (!scheme_init (&sc))
+  if (! scheme_init (&sc))
     {
       g_message ("Could not initialize TinyScheme!");
       return;
@@ -282,8 +229,8 @@
   script_fu_regex_init (&sc);
 
   /* register in the interpreter the gimp functions and types. */
-  init_constants ();
-  init_procedures ();
+  ts_init_constants (&sc);
+  ts_init_procedures (&sc, register_scripts);
 
   if (path)
     {
@@ -328,16 +275,11 @@
     }
 }
 
+/* Create an SF-RUN-MODE constant for use in scripts.
+ * It is set to the run mode state determined by GIMP.
+ */
 void
-tinyscheme_deinit (void)
-{
-  scheme_deinit (&sc);
-}
-
-/* Create an SF-RUN-MODE constant for use in scripts.  */
-/* It is set to the run mode state determined by GIMP. */
-void
-set_run_mode_constant (GimpRunMode run_mode)
+ts_set_run_mode (GimpRunMode run_mode)
 {
   pointer symbol;
 
@@ -347,58 +289,110 @@
   sc.vptr->setimmutable (symbol);
 }
 
-static void     convert_string                   (gchar     *str);
-static pointer  script_fu_marshal_procedure_call (scheme    *sc,
-                                                  pointer    a);
-static void     script_fu_marshal_destroy_args   (GimpParam *params,
-                                                  gint       n_params);
+void
+ts_set_print_flag (gint print_flag)
+{
+  sc.print_output = print_flag;
+}
 
-static pointer  script_fu_register_call          (scheme    *sc,
-                                                  pointer    a);
-static pointer  script_fu_menu_register_call     (scheme    *sc,
-                                                  pointer    a);
-static pointer  script_fu_quit_call              (scheme    *sc,
-                                                  pointer    a);
+void
+ts_print_welcome (void)
+{
+  ts_output_string (TS_OUTPUT_NORMAL,
+                    "Welcome to TinyScheme, Version 1.38\n", -1);
+  ts_output_string (TS_OUTPUT_NORMAL,
+                    "Copyright (c) Dimitrios Souflis\n", -1);
+}
 
+void
+ts_interpret_stdin (void)
+{
+  scheme_load_file (&sc, stdin);
+}
+
+gint
+ts_interpret_string (const gchar *expr)
+{
+#if DEBUG_SCRIPTS
+  sc.print_output = 1;
+  sc.tracing = 1;
+#endif
+
+  sc.vptr->load_string (&sc, (char *) expr);
+
+  return sc.retcode;
+}
+
+const gchar *
+ts_get_success_msg (void)
+{
+  if (sc.vptr->is_string (sc.value))
+    return sc.vptr->string_value (sc.value);
+
+  return "Success";
+}
+
+void
+ts_stdout_output_func (TsOutputType  type,
+                       const char   *string,
+                       int           len,
+                       gpointer      user_data)
+{
+  if (len < 0)
+    len = strlen (string);
+  fprintf (stdout, "%.*s", len, string);
+}
+
+void
+ts_gstring_output_func (TsOutputType  type,
+                        const char   *string,
+                        int           len,
+                        gpointer      user_data)
+{
+  GString *gstr = (GString *) user_data;
+
+  g_string_append_len (gstr, string, len);
+}
+
+
+/*  private functions  */
 
 /*
  * Below can be found the functions responsible for registering the
  * gimp functions and types against the scheme interpreter.
  */
-
-
 static void
-init_constants (void)
+ts_init_constants (scheme *sc)
 {
   const gchar **enum_type_names;
   gint          n_enum_type_names;
   gint          i;
   pointer       symbol;
 
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_directory ()));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-data-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_data_directory ()));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-plug-in-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_plug_in_directory ()));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-locale-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_locale_directory ()));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-sysconf-directory");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_sysconf_directory ()));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc, "gimp-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-data-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_data_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-plug-in-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_plug_in_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-locale-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_locale_directory ()));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-sysconf-directory");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_sysconf_directory ()));
+  sc->vptr->setimmutable (symbol);
 
   enum_type_names = gimp_enums_get_type_names (&n_enum_type_names);
 
@@ -418,10 +412,10 @@
               scheme_name = g_strdup (value->value_name + strlen ("GIMP_"));
               convert_string (scheme_name);
 
-              symbol = sc.vptr->mk_symbol (&sc, scheme_name);
-              sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                                      sc.vptr->mk_integer (&sc, value->value));
-              sc.vptr->setimmutable(symbol);
+              symbol = sc->vptr->mk_symbol (sc, scheme_name);
+              sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                                       sc->vptr->mk_integer (sc, value->value));
+              sc->vptr->setimmutable (symbol);
 
               g_free (scheme_name);
             }
@@ -433,47 +427,48 @@
   /* Constants used in the register block of scripts */
   for (i = 0; script_constants[i].name != NULL; ++i)
     {
-      symbol = sc.vptr->mk_symbol (&sc, script_constants[i].name);
-      sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                              sc.vptr->mk_integer (&sc,
-                                                   script_constants[i].value));
-      sc.vptr->setimmutable(symbol);
+      symbol = sc->vptr->mk_symbol (sc, script_constants[i].name);
+      sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                               sc->vptr->mk_integer (sc,
+                                                     script_constants[i].value));
+      sc->vptr->setimmutable (symbol);
     }
 
   /* Define string constant for use in building paths to files/directories */
-  symbol = sc.vptr->mk_symbol (&sc, "DIR-SEPARATOR");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, G_DIR_SEPARATOR_S));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc, "DIR-SEPARATOR");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, G_DIR_SEPARATOR_S));
+  sc->vptr->setimmutable (symbol);
 
   /* These constants are deprecated and will be removed at a later date. */
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-dir");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_directory () ));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-data-dir");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_data_directory () ));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-plugin-dir");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_string (&sc, gimp_plug_in_directory () ));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc, "gimp-dir");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_directory () ));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-data-dir");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_data_directory () ));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "gimp-plugin-dir");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_string (sc, gimp_plug_in_directory () ));
+  sc->vptr->setimmutable (symbol);
 
   for (i = 0; old_constants[i].name != NULL; ++i)
     {
-      symbol = sc.vptr->mk_symbol (&sc, old_constants[i].name);
-      sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                              sc.vptr->mk_integer (&sc,
-                                                   old_constants[i].value));
-      sc.vptr->setimmutable(symbol);
+      symbol = sc->vptr->mk_symbol (sc, old_constants[i].name);
+      sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                               sc->vptr->mk_integer (sc,
+                                                     old_constants[i].value));
+      sc->vptr->setimmutable (symbol);
     }
 }
 
 static void
-init_procedures (void)
+ts_init_procedures (scheme   *sc,
+                    gboolean  register_scripts)
 {
   gchar          **proc_list;
   gchar           *proc_blurb;
@@ -492,35 +487,39 @@
   pointer          symbol;
 
 #if USE_DL
-  symbol = sc.vptr->mk_symbol (&sc,"load-extension");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc, scm_load_ext));
-  sc.vptr->setimmutable(symbol);
-#endif
-
-  symbol = sc.vptr->mk_symbol (&sc, "script-fu-register");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc,
-                                                    script_fu_register_call));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "script-fu-menu-register");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc,
-                                                    script_fu_menu_register_call));
-  sc.vptr->setimmutable(symbol);
-
-  symbol = sc.vptr->mk_symbol (&sc, "script-fu-quit");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc, script_fu_quit_call));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc,"load-extension");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc, scm_load_ext));
+  sc->vptr->setimmutable (symbol);
+#endif
+
+  symbol = sc->vptr->mk_symbol (sc, "script-fu-register");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc,
+                                                      register_scripts ?
+                                                      script_fu_register_call :
+                                                      script_fu_nil_call));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "script-fu-menu-register");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc,
+                                                      register_scripts ?
+                                                      script_fu_menu_register_call :
+                                                      script_fu_nil_call));
+  sc->vptr->setimmutable (symbol);
+
+  symbol = sc->vptr->mk_symbol (sc, "script-fu-quit");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc, script_fu_quit_call));
+  sc->vptr->setimmutable (symbol);
 
   /*  register the database execution procedure  */
-  symbol = sc.vptr->mk_symbol (&sc, "gimp-proc-db-call");
-  sc.vptr->scheme_define (&sc, sc.global_env, symbol,
-                          sc.vptr->mk_foreign_func (&sc,
-                                                    script_fu_marshal_procedure_call));
-  sc.vptr->setimmutable(symbol);
+  symbol = sc->vptr->mk_symbol (sc, "gimp-proc-db-call");
+  sc->vptr->scheme_define (sc, sc->global_env, symbol,
+                           sc->vptr->mk_foreign_func (sc,
+                                                      script_fu_marshal_procedure_call));
+  sc->vptr->setimmutable (symbol);
 
   gimp_procedural_db_query (".*", ".*", ".*", ".*", ".*", ".*", ".*",
                             &num_procs, &proc_list);
@@ -538,37 +537,38 @@
                                         &proc_type,
                                         &nparams, &nreturn_vals,
                                         &params, &return_vals))
-      {
-         /* Build a define that will call the foreign function */
-         /* The Scheme statement was suggested by Simon Budig  */
-         if (nparams == 0)
-           {
-             buff = g_strdup_printf (" (define (%s)"
-                                     " (gimp-proc-db-call \"%s\"))",
-                                     proc_list[i], proc_list[i]);
-           }
-         else
-           {
-             buff = g_strdup_printf (" (define %s (lambda x"
-                                     " (apply gimp-proc-db-call (cons \"%s\" x))))",
-                                     proc_list[i], proc_list[i]);
-           }
-
-         /*  Execute the 'define'  */
-         sc.vptr->load_string (&sc, buff);
-
-         g_free (buff);
-
-         /*  free the queried information  */
-         g_free (proc_blurb);
-         g_free (proc_help);
-         g_free (proc_author);
-         g_free (proc_copyright);
-         g_free (proc_date);
+        {
+          /* Build a define that will call the foreign function.
+           * The Scheme statement was suggested by Simon Budig.
+           */
+          if (nparams == 0)
+            {
+              buff = g_strdup_printf (" (define (%s)"
+                                      " (gimp-proc-db-call \"%s\"))",
+                                      proc_list[i], proc_list[i]);
+            }
+          else
+            {
+              buff = g_strdup_printf (" (define %s (lambda x"
+                                      " (apply gimp-proc-db-call (cons \"%s\" x))))",
+                                      proc_list[i], proc_list[i]);
+            }
 
-         gimp_destroy_paramdefs (params, nparams);
-         gimp_destroy_paramdefs (return_vals, nreturn_vals);
-      }
+          /*  Execute the 'define'  */
+          sc->vptr->load_string (sc, buff);
+
+          g_free (buff);
+
+          /*  free the queried information  */
+          g_free (proc_blurb);
+          g_free (proc_help);
+          g_free (proc_author);
+          g_free (proc_copyright);
+          g_free (proc_date);
+
+          gimp_destroy_paramdefs (params, nparams);
+          gimp_destroy_paramdefs (return_vals, nreturn_vals);
+        }
 
       g_free (proc_list[i]);
     }
@@ -1759,20 +1759,14 @@
 script_fu_register_call (scheme  *sc,
                          pointer  a)
 {
-  if (register_scripts)
-    return script_fu_add_script (sc, a);
-  else
-    return sc->NIL;
+  return script_fu_add_script (sc, a);
 }
 
 static pointer
 script_fu_menu_register_call (scheme  *sc,
                               pointer  a)
 {
-  if (register_scripts)
-    return script_fu_add_menu (sc, a);
-  else
-    return sc->NIL;
+  return script_fu_add_menu (sc, a);
 }
 
 static pointer
@@ -1785,3 +1779,10 @@
 
   return sc->NIL;
 }
+
+static pointer
+script_fu_nil_call (scheme  *sc,
+                    pointer  a)
+{
+  return sc->NIL;
+}

Modified: trunk/plug-ins/script-fu/scheme-wrapper.h
==============================================================================
--- trunk/plug-ins/script-fu/scheme-wrapper.h	(original)
+++ trunk/plug-ins/script-fu/scheme-wrapper.h	Thu Sep 11 18:00:18 2008
@@ -16,35 +16,33 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#ifndef SCHEME_WRAPPER_H
-#define SCHEME_WRAPPER_H
+#ifndef __SCHEME_WRAPPER_H__
+#define __SCHEME_WRAPPER_H__
 
 #include "tinyscheme/scheme.h"
 
-void          ts_stdout_output_func   (TsOutputType    type,
-                                       const char     *string,
-                                       int             len,
-                                       gpointer        user_data);
+void          tinyscheme_init         (const gchar  *path,
+                                       gboolean      register_scripts);
 
-void          ts_gstring_output_func  (TsOutputType    type,
-                                       const char     *string,
-                                       int             len,
-                                       gpointer        user_data);
+void          ts_set_run_mode         (GimpRunMode   run_mode);
 
-void          ts_set_print_flag    (gint);
-void          ts_print_welcome     (void);
+void          ts_set_print_flag       (gint          print_flag);
+void          ts_print_welcome        (void);
 
-const gchar * ts_get_success_msg   (void);
+const gchar * ts_get_success_msg      (void);
 
-void          tinyscheme_init      (const gchar  *path,
-                                    gboolean      local_register_scripts);
-void          tinyscheme_deinit    (void);
-
-void          set_run_mode_constant (GimpRunMode run_mode);
-
-void          ts_interpret_stdin   (void);
+void          ts_interpret_stdin      (void);
 
 /* if the return value is 0, success. error otherwise. */
-gint          ts_interpret_string  (const gchar *);
+gint          ts_interpret_string     (const gchar  *expr);
+
+void          ts_stdout_output_func   (TsOutputType  type,
+                                       const char   *string,
+                                       int           len,
+                                       gpointer      user_data);
+void          ts_gstring_output_func  (TsOutputType  type,
+                                       const char   *string,
+                                       int           len,
+                                       gpointer      user_data);
 
-#endif /* SCHEME_WRAPPER_H */
+#endif /* __SCHEME_WRAPPER_H__ */

Modified: trunk/plug-ins/script-fu/script-fu-eval.c
==============================================================================
--- trunk/plug-ins/script-fu/script-fu-eval.c	(original)
+++ trunk/plug-ins/script-fu/script-fu-eval.c	Thu Sep 11 18:00:18 2008
@@ -44,7 +44,7 @@
 
   run_mode = params[0].data.d_int32;
 
-  set_run_mode_constant (run_mode);
+  ts_set_run_mode (run_mode);
 
   switch (run_mode)
     {

Modified: trunk/plug-ins/script-fu/script-fu-scripts.c
==============================================================================
--- trunk/plug-ins/script-fu/script-fu-scripts.c	(original)
+++ trunk/plug-ins/script-fu/script-fu-scripts.c	Thu Sep 11 18:00:18 2008
@@ -627,7 +627,8 @@
 }
 
 pointer
-script_fu_add_menu (scheme *sc, pointer a)
+script_fu_add_menu (scheme  *sc,
+                    pointer  a)
 {
   SFScript    *script;
   SFMenu      *menu;
@@ -926,7 +927,7 @@
     {
       GimpRunMode run_mode = params[0].data.d_int32;
 
-      set_run_mode_constant (run_mode);
+      ts_set_run_mode (run_mode);
 
       switch (run_mode)
         {

Modified: trunk/plug-ins/script-fu/script-fu-server.c
==============================================================================
--- trunk/plug-ins/script-fu/script-fu-server.c	(original)
+++ trunk/plug-ins/script-fu/script-fu-server.c	Thu Sep 11 18:00:18 2008
@@ -199,7 +199,8 @@
   GimpRunMode        run_mode;
 
   run_mode = params[0].data.d_int32;
-  set_run_mode_constant (run_mode);
+
+  ts_set_run_mode (run_mode);
 
   switch (run_mode)
     {

Modified: trunk/plug-ins/script-fu/script-fu.c
==============================================================================
--- trunk/plug-ins/script-fu/script-fu.c	(original)
+++ trunk/plug-ins/script-fu/script-fu.c	Thu Sep 11 18:00:18 2008
@@ -197,7 +197,7 @@
     }
 
   if (param != NULL)
-    set_run_mode_constant ((GimpRunMode) param[0].data.d_int32);
+    ts_set_run_mode ((GimpRunMode) param[0].data.d_int32);
 
   /*  Load all of the available scripts  */
   script_fu_find_scripts (path);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]