1997-11-24 22:05:25 +00:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 05:44:11 +00:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-24 22:05:25 +00:00
|
|
|
*/
|
1999-05-29 01:28:24 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
2000-01-31 20:47:44 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
1999-05-29 01:28:24 +00:00
|
|
|
#if HAVE_UNISTD_H
|
1997-11-24 22:05:25 +00:00
|
|
|
#include <unistd.h>
|
1999-05-29 01:28:24 +00:00
|
|
|
#endif
|
|
|
|
|
2000-01-31 20:47:44 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <libgimp/gimp.h>
|
1999-05-29 01:28:24 +00:00
|
|
|
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
#include "siod-wrapper.h"
|
1997-11-24 22:05:25 +00:00
|
|
|
#include "script-fu-console.h"
|
1999-10-03 23:48:33 +00:00
|
|
|
#include "script-fu-constants.h"
|
1997-11-24 22:05:25 +00:00
|
|
|
#include "script-fu-scripts.h"
|
|
|
|
#include "script-fu-server.h"
|
|
|
|
|
2000-02-27 19:35:39 +00:00
|
|
|
#include "script-fu-intl.h"
|
2000-01-31 20:47:44 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
/* External functions
|
|
|
|
*/
|
2000-01-31 20:47:44 +00:00
|
|
|
extern void gimp_extension_process (guint timeout);
|
|
|
|
extern void gimp_extension_ack (void);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Declare local functions.
|
|
|
|
*/
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
static void script_fu_quit (void);
|
|
|
|
static void script_fu_query (void);
|
|
|
|
static void script_fu_run (gchar *name,
|
|
|
|
gint nparams,
|
|
|
|
GimpParam *param,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals);
|
2001-01-21 20:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void script_fu_auxillary_init (void);
|
|
|
|
static void script_fu_refresh_proc (gchar *name,
|
|
|
|
gint nparams,
|
|
|
|
GimpParam *params,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
|
2000-08-07 21:30:35 +00:00
|
|
|
GimpPlugInInfo PLUG_IN_INFO =
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
NULL, /* init_proc */
|
|
|
|
script_fu_quit, /* quit_proc */
|
|
|
|
script_fu_query, /* query_proc */
|
|
|
|
script_fu_run, /* run_proc */
|
1997-11-24 22:05:25 +00:00
|
|
|
};
|
|
|
|
|
2000-11-08 14:35:50 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1998-03-19 02:11:53 +00:00
|
|
|
MAIN ()
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
static void
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
script_fu_quit (void)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
script_fu_query (void)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2000-08-07 21:30:35 +00:00
|
|
|
static GimpParamDef console_args[] =
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2000-08-07 21:30:35 +00:00
|
|
|
{ GIMP_PDB_INT32, "run_mode", "Interactive, [non-interactive]" }
|
1997-11-24 22:05:25 +00:00
|
|
|
};
|
|
|
|
static gint nconsole_args = sizeof (console_args) / sizeof (console_args[0]);
|
|
|
|
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
static GimpParamDef textconsole_args[] =
|
|
|
|
{
|
|
|
|
{ GIMP_PDB_INT32, "run_mode", "Interactive, [non-interactive]" }
|
|
|
|
};
|
|
|
|
static gint ntextconsole_args = sizeof (textconsole_args) / sizeof (textconsole_args[0]);
|
|
|
|
|
2000-08-07 21:30:35 +00:00
|
|
|
static GimpParamDef eval_args[] =
|
1998-09-10 19:03:20 +00:00
|
|
|
{
|
2000-08-07 21:30:35 +00:00
|
|
|
{ GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" },
|
|
|
|
{ GIMP_PDB_STRING, "code", "The code to evaluate" }
|
1998-09-10 19:03:20 +00:00
|
|
|
};
|
|
|
|
static gint neval_args = sizeof (eval_args) / sizeof (eval_args[0]);
|
|
|
|
|
2000-08-07 21:30:35 +00:00
|
|
|
static GimpParamDef server_args[] =
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2000-08-07 21:30:35 +00:00
|
|
|
{ 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" }
|
1997-11-24 22:05:25 +00:00
|
|
|
};
|
|
|
|
static gint nserver_args = sizeof (server_args) / sizeof (server_args[0]);
|
|
|
|
|
2000-05-31 13:24:14 +00:00
|
|
|
gimp_plugin_domain_register ("gimp-script-fu", NULL);
|
2000-01-09 15:51:46 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
gimp_install_procedure ("extension_script_fu",
|
2000-01-31 02:32:30 +00:00
|
|
|
"A scheme interpreter for scripting GIMP operations",
|
2000-01-28 16:56:47 +00:00
|
|
|
"More help here later",
|
1997-11-24 22:05:25 +00:00
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2000-08-07 21:30:35 +00:00
|
|
|
GIMP_EXTENSION,
|
1997-11-24 22:05:25 +00:00
|
|
|
0, 0, NULL, NULL);
|
|
|
|
|
|
|
|
gimp_install_procedure ("extension_script_fu_console",
|
2000-01-31 02:32:30 +00:00
|
|
|
"Provides a console mode for script-fu development",
|
|
|
|
"Provides an interface which allows interactive scheme development.",
|
1997-11-24 22:05:25 +00:00
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
1999-11-23 20:29:20 +00:00
|
|
|
N_("<Toolbox>/Xtns/Script-Fu/Console..."),
|
2000-01-02 20:52:57 +00:00
|
|
|
NULL,
|
2000-08-07 21:30:35 +00:00
|
|
|
GIMP_EXTENSION,
|
1997-11-24 22:05:25 +00:00
|
|
|
nconsole_args, 0,
|
|
|
|
console_args, NULL);
|
|
|
|
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
gimp_install_procedure ("extension_script_fu_text_console",
|
|
|
|
"Provides a text console mode for script-fu development",
|
|
|
|
"Provides an interface which allows interactive scheme development.",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
GIMP_EXTENSION,
|
|
|
|
ntextconsole_args, 0,
|
|
|
|
textconsole_args, NULL);
|
|
|
|
|
Change Win32 implementation to be a bit simpler. Use minigzip (from zlib)
2000-07-31 Tor Lillqvist <tml@iki.fi>
* plug-ins/common/gz.c (load_image,save_image): Change Win32
implementation to be a bit simpler. Use minigzip (from zlib)
instead of the full gzip. Intend to include minigzip with the
(binary) distribution.
* libgimp/makefile.{cygwin,msc}
* app/makefile.{cygwin,msc}: Add G_LOG_DOMAIN.
* app/gimpbrushhose.{c,h}: Really remove these files, as
Adrian tried on August 23.
* plug-ins/script-fu/script-fu.c: Enable the script-fu console on
Win32, too.
* plug-ins/script-fu/script-fu-console.c: Now with new GLib
GIOChannel implementaion, compile for Win32, too. Use
g_io_add_watch instead of gdk_input_add (on Unix, too). The
callback for g_io_add_watch is passed a GIOChannel, while the
callback for gdk_input_add is passed a file descriptor. On Win32
(and possibly other non-Unices) we want GIOChannels, as we must
use g_io_channel_read to read from file descriptors being
watched. Works as previously on Unix this way, too.
2000-07-30 23:17:00 +00:00
|
|
|
#ifndef G_OS_WIN32
|
1997-11-24 22:05:25 +00:00
|
|
|
gimp_install_procedure ("extension_script_fu_server",
|
2000-01-31 02:32:30 +00:00
|
|
|
"Provides a server for remote script-fu operation",
|
|
|
|
"Provides a server for remote script-fu operation",
|
1997-11-24 22:05:25 +00:00
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
1999-11-23 20:29:20 +00:00
|
|
|
N_("<Toolbox>/Xtns/Script-Fu/Server..."),
|
2000-01-02 20:52:57 +00:00
|
|
|
NULL,
|
2000-08-07 21:30:35 +00:00
|
|
|
GIMP_EXTENSION,
|
1997-11-24 22:05:25 +00:00
|
|
|
nserver_args, 0,
|
|
|
|
server_args, NULL);
|
1999-05-29 01:28:24 +00:00
|
|
|
#endif
|
1998-09-10 19:03:20 +00:00
|
|
|
|
|
|
|
gimp_install_procedure ("extension_script_fu_eval",
|
2000-01-31 02:32:30 +00:00
|
|
|
"Evaluate scheme code",
|
|
|
|
"Evaluate the code under the scheme interpeter (primarily for batch mode)",
|
1998-09-10 19:03:20 +00:00
|
|
|
"Manish Singh",
|
|
|
|
"Manish Singh",
|
|
|
|
"1998",
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2000-08-07 21:30:35 +00:00
|
|
|
GIMP_EXTENSION,
|
1998-09-10 19:03:20 +00:00
|
|
|
neval_args, 0,
|
|
|
|
eval_args, NULL);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
script_fu_run (gchar *name,
|
|
|
|
gint nparams,
|
|
|
|
GimpParam *param,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
siod_set_output_file (stdout);
|
1998-03-25 02:17:42 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
/* Determine before we allow scripts to register themselves
|
|
|
|
* whether this is the base, automatically installed script-fu extension
|
|
|
|
*/
|
|
|
|
if (strcmp (name, "extension_script_fu") == 0)
|
|
|
|
{
|
|
|
|
/* Setup auxillary temporary procedures for the base extension */
|
|
|
|
script_fu_auxillary_init ();
|
|
|
|
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
/* Init the interpreter */
|
|
|
|
siod_init (TRUE);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
else
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
{
|
|
|
|
/* Init the interpreter */
|
|
|
|
siod_init (FALSE);
|
|
|
|
}
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Load all of the available scripts */
|
|
|
|
script_fu_find_scripts ();
|
|
|
|
|
|
|
|
/*
|
2000-11-08 14:35:50 +00:00
|
|
|
* The main, automatically installed script fu extension.
|
|
|
|
* For things like logos and effects that are runnable from GIMP menus.
|
1997-11-24 22:05:25 +00:00
|
|
|
*/
|
|
|
|
if (strcmp (name, "extension_script_fu") == 0)
|
|
|
|
{
|
2000-11-08 14:35:50 +00:00
|
|
|
static GimpParam values[1];
|
2000-08-07 21:30:35 +00:00
|
|
|
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* Acknowledge that the extension is properly initialized */
|
|
|
|
gimp_extension_ack ();
|
|
|
|
|
2000-11-08 14:35:50 +00:00
|
|
|
while (TRUE)
|
1997-11-24 22:05:25 +00:00
|
|
|
gimp_extension_process (0);
|
|
|
|
|
|
|
|
*nreturn_vals = 1;
|
2000-11-08 14:35:50 +00:00
|
|
|
*return_vals = values;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2000-11-08 14:35:50 +00:00
|
|
|
values[0].type = GIMP_PDB_STATUS;
|
1997-11-24 22:05:25 +00:00
|
|
|
values[0].data.d_status = status;
|
|
|
|
}
|
|
|
|
/*
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
* The script-fu consoles for interactive SIOD development
|
1997-11-24 22:05:25 +00:00
|
|
|
*/
|
new code to call the script_fuc_text_console pdb function. remove batch
2001-07-17 Mathieu Lacage <mathieu@gnome.org>
* app/batch.c: new code to call the script_fuc_text_console pdb function.
* app/main.c: (main): remove batch command code.
* plug-ins/script-fu/Makefile.am: add siod-wrapper.h/c
* plug-ins/script-fu/script-fu-console.c:
(script_fu_cc_key_function),
(script_fu_open_siod_console),
(script_fu_close_siod_console):
* plug-ins/script-fu/script-fu-scripts.h:
* plug-ins/script-fu/script-fu-server.c:
(script_fu_server_quit),
(script_fu_server_get_mode),
(execute_command):
Replace all direct calls to the scheme interpreter with calls to the siod-wrapper.
* plug-ins/script-fu/script-fu-console.h: remove run_eval.
* plug-ins/script-fu/script-fu-server.h:
* plug-ins/script-fu/script-fu-text-console.c:
(script_fu_text_console_run),
(read_command),
(script_fu_text_console_interface):
The actual new text console.
* plug-ins/script-fu/script-fu-text-console.h: header.
* plug-ins/script-fu/script-fu.c:
(script_fu_quit),
(script_fu_query),
(script_fu_run): rename to better words.
move most of the code to siod-wrapper.c/h
* plug-ins/script-fu/siod-wrapper.c:
(siod_get_output_file),
(siod_set_output_file),
(siod_get_verbose_level),
(siod_set_verbose_level),
(siod_print_welcome),
(siod_interpret_string),
(siod_get_error_msg),
(siod_get_success_msg),
(siod_init),
(init_procedures),
(init_constants),
(convert_string),
(sputs_fcn),
(lprin1s),
(marshall_proc_db_call),
(script_fu_register_call),
(script_fu_quit_call):
All the funcitons dealing with the internals of the scheme interpreter.
* plug-ins/script-fu/siod-wrapper.h: the header.
2001-07-17 22:53:21 +00:00
|
|
|
else if (strcmp (name, "extension_script_fu_text_console") == 0)
|
|
|
|
{
|
|
|
|
script_fu_text_console_run (name, nparams, param, nreturn_vals, return_vals);
|
|
|
|
}
|
1997-11-24 22:05:25 +00:00
|
|
|
else if (strcmp (name, "extension_script_fu_console") == 0)
|
|
|
|
{
|
|
|
|
script_fu_console_run (name, nparams, param, nreturn_vals, return_vals);
|
|
|
|
}
|
Change Win32 implementation to be a bit simpler. Use minigzip (from zlib)
2000-07-31 Tor Lillqvist <tml@iki.fi>
* plug-ins/common/gz.c (load_image,save_image): Change Win32
implementation to be a bit simpler. Use minigzip (from zlib)
instead of the full gzip. Intend to include minigzip with the
(binary) distribution.
* libgimp/makefile.{cygwin,msc}
* app/makefile.{cygwin,msc}: Add G_LOG_DOMAIN.
* app/gimpbrushhose.{c,h}: Really remove these files, as
Adrian tried on August 23.
* plug-ins/script-fu/script-fu.c: Enable the script-fu console on
Win32, too.
* plug-ins/script-fu/script-fu-console.c: Now with new GLib
GIOChannel implementaion, compile for Win32, too. Use
g_io_add_watch instead of gdk_input_add (on Unix, too). The
callback for g_io_add_watch is passed a GIOChannel, while the
callback for gdk_input_add is passed a file descriptor. On Win32
(and possibly other non-Unices) we want GIOChannels, as we must
use g_io_channel_read to read from file descriptors being
watched. Works as previously on Unix this way, too.
2000-07-30 23:17:00 +00:00
|
|
|
#ifndef G_OS_WIN32
|
1997-11-24 22:05:25 +00:00
|
|
|
/*
|
|
|
|
* The script-fu server for remote operation
|
|
|
|
*/
|
|
|
|
else if (strcmp (name, "extension_script_fu_server") == 0)
|
|
|
|
{
|
|
|
|
script_fu_server_run (name, nparams, param, nreturn_vals, return_vals);
|
|
|
|
}
|
1999-05-29 01:28:24 +00:00
|
|
|
#endif
|
1998-09-10 19:03:20 +00:00
|
|
|
/*
|
|
|
|
* A non-interactive "console" (for batch mode)
|
|
|
|
*/
|
|
|
|
else if (strcmp (name, "extension_script_fu_eval") == 0)
|
|
|
|
{
|
|
|
|
script_fu_eval_run (name, nparams, param, nreturn_vals, return_vals);
|
|
|
|
}
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2000-01-31 20:47:44 +00:00
|
|
|
script_fu_auxillary_init (void)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2000-08-07 21:30:35 +00:00
|
|
|
static GimpParamDef args[] =
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2000-08-07 21:30:35 +00:00
|
|
|
{ GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" }
|
1997-11-24 22:05:25 +00:00
|
|
|
};
|
|
|
|
static gint nargs = sizeof (args) / sizeof (args[0]);
|
|
|
|
|
2001-01-11 08:19:01 +00:00
|
|
|
INIT_I18N_UI();
|
2000-01-28 16:56:47 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
gimp_install_temp_proc ("script_fu_refresh",
|
2000-01-28 16:56:47 +00:00
|
|
|
_("Re-read all available scripts"),
|
|
|
|
_("Re-read all available scripts"),
|
1997-11-24 22:05:25 +00:00
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
2000-01-28 16:56:47 +00:00
|
|
|
N_("<Toolbox>/Xtns/Script-Fu/Refresh"),
|
2000-01-03 10:46:58 +00:00
|
|
|
NULL,
|
2000-08-07 21:30:35 +00:00
|
|
|
GIMP_TEMPORARY,
|
1997-11-24 22:05:25 +00:00
|
|
|
nargs, 0,
|
|
|
|
args, NULL,
|
|
|
|
script_fu_refresh_proc);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-08-07 21:30:35 +00:00
|
|
|
script_fu_refresh_proc (gchar *name,
|
|
|
|
gint nparams,
|
|
|
|
GimpParam *params,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2000-11-08 14:35:50 +00:00
|
|
|
static GimpParam values[1];
|
2000-08-07 21:30:35 +00:00
|
|
|
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* Reload all of the available scripts */
|
|
|
|
script_fu_find_scripts ();
|
|
|
|
|
|
|
|
*nreturn_vals = 1;
|
2000-11-08 14:35:50 +00:00
|
|
|
*return_vals = values;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2000-11-08 14:35:50 +00:00
|
|
|
values[0].type = GIMP_PDB_STATUS;
|
1997-11-24 22:05:25 +00:00
|
|
|
values[0].data.d_status = status;
|
|
|
|
}
|