2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
* 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 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
1999-05-29 09:28:24 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
2000-02-01 04:47:44 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <string.h>
|
1999-05-29 09:28:24 +08:00
|
|
|
|
2000-02-01 04:47:44 +08:00
|
|
|
#include <libgimp/gimp.h>
|
2006-06-07 01:49:56 +08:00
|
|
|
#include <libgimp/gimpui.h>
|
1999-05-29 09:28:24 +08:00
|
|
|
|
2006-10-16 09:08:54 +08:00
|
|
|
#include "tinyscheme/scheme.h"
|
2003-11-27 01:14:58 +08:00
|
|
|
|
2006-06-07 01:49:56 +08:00
|
|
|
#include "script-fu-types.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "script-fu-console.h"
|
2006-06-07 01:49:56 +08:00
|
|
|
#include "script-fu-interface.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "script-fu-scripts.h"
|
|
|
|
#include "script-fu-server.h"
|
2001-07-18 08:59:32 +08:00
|
|
|
#include "script-fu-text-console.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-10-16 09:08:54 +08:00
|
|
|
#include "scheme-wrapper.h"
|
2006-06-07 01:49:56 +08:00
|
|
|
|
2000-02-28 03:35:39 +08:00
|
|
|
#include "script-fu-intl.h"
|
2000-02-01 04:47:44 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-07-02 08:15:09 +08:00
|
|
|
/* Declare local functions. */
|
|
|
|
|
2006-10-19 21:51:42 +08:00
|
|
|
static void script_fu_query (void);
|
|
|
|
static void script_fu_run (const gchar *name,
|
|
|
|
gint nparams,
|
|
|
|
const GimpParam *params,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals);
|
|
|
|
static gchar * script_fu_search_path (void);
|
|
|
|
static void script_fu_extension_init (void);
|
|
|
|
static void script_fu_refresh_proc (const gchar *name,
|
|
|
|
gint nparams,
|
|
|
|
const GimpParam *params,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2006-05-16 20:05:30 +08:00
|
|
|
const GimpPlugInInfo PLUG_IN_INFO =
|
1997-11-25 06:05:25 +08: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-18 06:53:21 +08:00
|
|
|
NULL, /* init_proc */
|
2006-05-16 20:05:30 +08:00
|
|
|
NULL, /* quit_proc */
|
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-18 06:53:21 +08:00
|
|
|
script_fu_query, /* query_proc */
|
2004-07-15 00:03:58 +08:00
|
|
|
script_fu_run /* run_proc */
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2000-11-08 22:35:50 +08:00
|
|
|
|
1998-03-19 10:11:53 +08:00
|
|
|
MAIN ()
|
1997-11-25 06:05:25 +08: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-18 06:53:21 +08:00
|
|
|
script_fu_query (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-05-16 20:05:30 +08:00
|
|
|
static const GimpParamDef console_args[] =
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-06-27 20:38:45 +08:00
|
|
|
{ GIMP_PDB_INT32, "run-mode", "Interactive, [non-interactive]" }
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2006-05-16 20:05:30 +08:00
|
|
|
static const GimpParamDef textconsole_args[] =
|
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-18 06:53:21 +08:00
|
|
|
{
|
2006-06-27 20:38:45 +08:00
|
|
|
{ GIMP_PDB_INT32, "run-mode", "Interactive, [non-interactive]" }
|
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-18 06:53:21 +08:00
|
|
|
};
|
|
|
|
|
2006-05-16 20:05:30 +08:00
|
|
|
static const GimpParamDef eval_args[] =
|
1998-09-11 03:03:20 +08:00
|
|
|
{
|
2006-06-27 20:38:45 +08:00
|
|
|
{ GIMP_PDB_INT32, "run-mode", "[Interactive], non-interactive" },
|
2000-08-08 05:30:35 +08:00
|
|
|
{ GIMP_PDB_STRING, "code", "The code to evaluate" }
|
1998-09-11 03:03:20 +08:00
|
|
|
};
|
|
|
|
|
2006-05-16 20:05:30 +08:00
|
|
|
static const GimpParamDef server_args[] =
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-06-27 20:38:45 +08:00
|
|
|
{ GIMP_PDB_INT32, "run-mode", "[Interactive], non-interactive" },
|
2000-08-08 05:30:35 +08:00
|
|
|
{ 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-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2003-01-26 20:24:05 +08:00
|
|
|
gimp_plugin_domain_register (GETTEXT_PACKAGE "-script-fu", NULL);
|
2000-01-09 23:51:46 +08:00
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
gimp_install_procedure ("extension-script-fu",
|
2006-10-16 09:08:54 +08:00
|
|
|
"A scheme interpreter for scripting GIMP operations",
|
|
|
|
"More help here later",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
GIMP_EXTENSION,
|
|
|
|
0, 0, NULL, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
gimp_install_procedure ("plug-in-script-fu-console",
|
2006-10-16 09:08:54 +08:00
|
|
|
N_("Interactive console for Script-Fu development"),
|
|
|
|
"Provides an interface which allows interactive "
|
|
|
|
"scheme development.",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
|
|
|
N_("Script-Fu _Console"),
|
|
|
|
NULL,
|
|
|
|
GIMP_PLUGIN,
|
|
|
|
G_N_ELEMENTS (console_args), 0,
|
|
|
|
console_args, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
gimp_plugin_menu_register ("plug-in-script-fu-console",
|
2007-03-16 21:21:42 +08:00
|
|
|
"<Toolbox>/Xtns/Languages/Script-Fu");
|
2004-05-07 22:59:33 +08:00
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
gimp_install_procedure ("plug-in-script-fu-text-console",
|
2004-05-07 22:59:33 +08:00
|
|
|
"Provides a text console mode for script-fu "
|
|
|
|
"development",
|
|
|
|
"Provides an interface which allows interactive "
|
|
|
|
"scheme development.",
|
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-18 06:53:21 +08:00
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
2006-10-16 09:08:54 +08:00
|
|
|
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-18 06:53:21 +08:00
|
|
|
NULL,
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
GIMP_PLUGIN,
|
2001-12-06 10:32:57 +08:00
|
|
|
G_N_ELEMENTS (textconsole_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-18 06:53:21 +08:00
|
|
|
textconsole_args, NULL);
|
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
gimp_install_procedure ("plug-in-script-fu-server",
|
2006-10-16 09:08:54 +08:00
|
|
|
N_("Server for remote Script-Fu operation"),
|
|
|
|
"Provides a server for remote script-fu operation",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
|
|
|
N_("_Start Server..."),
|
|
|
|
NULL,
|
|
|
|
GIMP_PLUGIN,
|
|
|
|
G_N_ELEMENTS (server_args), 0,
|
|
|
|
server_args, NULL);
|
2004-05-07 22:59:33 +08:00
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
gimp_plugin_menu_register ("plug-in-script-fu-server",
|
2007-03-16 21:21:42 +08:00
|
|
|
"<Toolbox>/Xtns/Languages/Script-Fu");
|
1998-09-11 03:03:20 +08:00
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
gimp_install_procedure ("plug-in-script-fu-eval",
|
2006-10-16 09:08:54 +08:00
|
|
|
"Evaluate scheme code",
|
|
|
|
"Evaluate the code under the scheme interpreter "
|
|
|
|
"(primarily for batch mode)",
|
|
|
|
"Manish Singh",
|
|
|
|
"Manish Singh",
|
|
|
|
"1998",
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
GIMP_PLUGIN,
|
|
|
|
G_N_ELEMENTS (eval_args), 0,
|
|
|
|
eval_args, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-07-02 08:15:09 +08:00
|
|
|
script_fu_run (const gchar *name,
|
2006-10-16 09:08:54 +08:00
|
|
|
gint nparams,
|
|
|
|
const GimpParam *param,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-10-19 21:51:42 +08:00
|
|
|
gchar *path;
|
|
|
|
|
2001-10-29 20:51:21 +08:00
|
|
|
INIT_I18N();
|
|
|
|
|
2006-10-19 21:51:42 +08:00
|
|
|
path = script_fu_search_path ();
|
|
|
|
|
2006-10-16 09:08:54 +08:00
|
|
|
ts_set_console_mode (0);
|
1998-03-25 10:17:42 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Determine before we allow scripts to register themselves
|
|
|
|
* whether this is the base, automatically installed script-fu extension
|
|
|
|
*/
|
2005-08-03 07:45:24 +08:00
|
|
|
if (strcmp (name, "extension-script-fu") == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
/* Setup auxillary temporary procedures for the base extension */
|
2005-03-27 06:28:17 +08:00
|
|
|
script_fu_extension_init ();
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-10-16 09:08:54 +08:00
|
|
|
/* Init the interpreter and register scripts */
|
2006-10-19 21:51:42 +08:00
|
|
|
tinyscheme_init (path, TRUE);
|
1997-11-25 06:05:25 +08: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-18 06:53:21 +08:00
|
|
|
{
|
|
|
|
/* Init the interpreter */
|
2006-10-19 21:51:42 +08:00
|
|
|
tinyscheme_init (path, FALSE);
|
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-18 06:53:21 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-05-19 01:35:24 +08:00
|
|
|
/* Load all of the available scripts */
|
2006-10-19 21:51:42 +08:00
|
|
|
script_fu_find_scripts (path);
|
|
|
|
|
|
|
|
g_free (path);
|
2006-05-19 01:35:24 +08:00
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
if (strcmp (name, "extension-script-fu") == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-30 08:46:09 +08:00
|
|
|
/*
|
2006-05-16 20:05:30 +08:00
|
|
|
* The main script-fu extension.
|
2001-07-30 08:46:09 +08:00
|
|
|
*/
|
|
|
|
|
2000-11-08 22:35:50 +08:00
|
|
|
static GimpParam values[1];
|
2006-05-16 20:05:30 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Acknowledge that the extension is properly initialized */
|
|
|
|
gimp_extension_ack ();
|
|
|
|
|
2006-05-16 20:05:30 +08:00
|
|
|
/* Go into an endless loop */
|
2000-11-08 22:35:50 +08:00
|
|
|
while (TRUE)
|
2006-10-16 09:08:54 +08:00
|
|
|
gimp_extension_process (0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-05-16 20:05:30 +08:00
|
|
|
/* Set return values; pointless because we never get out of the loop */
|
1997-11-25 06:05:25 +08:00
|
|
|
*nreturn_vals = 1;
|
2000-11-08 22:35:50 +08:00
|
|
|
*return_vals = values;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-11-08 22:35:50 +08:00
|
|
|
values[0].type = GIMP_PDB_STATUS;
|
2006-05-16 20:05:30 +08:00
|
|
|
values[0].data.d_status = GIMP_PDB_SUCCESS;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2005-08-03 07:45:24 +08:00
|
|
|
else if (strcmp (name, "plug-in-script-fu-text-console") == 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-18 06:53:21 +08:00
|
|
|
{
|
2001-07-30 08:46:09 +08:00
|
|
|
/*
|
2006-10-16 09:08:54 +08:00
|
|
|
* The script-fu text console for interactive Scheme development
|
2001-07-30 08:46:09 +08:00
|
|
|
*/
|
|
|
|
|
2007-05-26 01:45:49 +08:00
|
|
|
ts_output_routine = NULL;
|
2001-07-30 08:46:09 +08:00
|
|
|
script_fu_text_console_run (name, nparams, param,
|
2006-10-16 09:08:54 +08:00
|
|
|
nreturn_vals, return_vals);
|
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-18 06:53:21 +08:00
|
|
|
}
|
2005-08-03 07:45:24 +08:00
|
|
|
else if (strcmp (name, "plug-in-script-fu-console") == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-30 08:46:09 +08:00
|
|
|
/*
|
2006-10-16 09:08:54 +08:00
|
|
|
* The script-fu console for interactive Scheme development
|
2001-07-30 08:46:09 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
script_fu_console_run (name, nparams, param,
|
2006-10-16 09:08:54 +08:00
|
|
|
nreturn_vals, return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2005-08-03 07:45:24 +08:00
|
|
|
else if (strcmp (name, "plug-in-script-fu-server") == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-30 08:46:09 +08:00
|
|
|
/*
|
|
|
|
* The script-fu server for remote operation
|
|
|
|
*/
|
2005-02-19 09:56:52 +08:00
|
|
|
|
2001-07-30 08:46:09 +08:00
|
|
|
script_fu_server_run (name, nparams, param,
|
2006-10-16 09:08:54 +08:00
|
|
|
nreturn_vals, return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2005-08-03 07:45:24 +08:00
|
|
|
else if (strcmp (name, "plug-in-script-fu-eval") == 0)
|
1998-09-11 03:03:20 +08:00
|
|
|
{
|
2001-07-30 08:46:09 +08:00
|
|
|
/*
|
|
|
|
* A non-interactive "console" (for batch mode)
|
|
|
|
*/
|
|
|
|
|
|
|
|
script_fu_eval_run (name, nparams, param,
|
2006-10-16 09:08:54 +08:00
|
|
|
nreturn_vals, return_vals);
|
1998-09-11 03:03:20 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2006-10-19 21:51:42 +08:00
|
|
|
static gchar *
|
|
|
|
script_fu_search_path (void)
|
|
|
|
{
|
|
|
|
gchar *path_str;
|
|
|
|
gchar *path = NULL;
|
|
|
|
|
|
|
|
path_str = gimp_gimprc_query ("script-fu-path");
|
|
|
|
|
|
|
|
if (path_str)
|
|
|
|
{
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
path = g_filename_from_utf8 (path_str, -1, NULL, NULL, &error);
|
|
|
|
|
|
|
|
g_free (path_str);
|
|
|
|
|
|
|
|
if (! path)
|
|
|
|
{
|
|
|
|
g_warning ("Can't convert script-fu-path to filesystem encoding: %s",
|
|
|
|
error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
2006-10-16 09:08:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-03-27 06:28:17 +08:00
|
|
|
script_fu_extension_init (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-05-16 20:05:30 +08:00
|
|
|
static const GimpParamDef args[] =
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-06-27 20:38:45 +08:00
|
|
|
{ GIMP_PDB_INT32, "run-mode", "[Interactive], non-interactive" }
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2006-02-08 23:01:56 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Help", N_("_GIMP Online"));
|
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Help", N_("_User Manual"));
|
|
|
|
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Languages",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Script-Fu"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Buttons"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Logos"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Misc"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Patterns"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Languages/Script-Fu",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Test"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
2007-05-16 03:18:29 +08:00
|
|
|
N_("_Utilities"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Web Page Themes"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Web Page Themes",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Alien Glow"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Web Page Themes",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Beveled Pattern"));
|
2005-10-17 01:57:40 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Web Page Themes",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Classic.Gimp.Org"));
|
|
|
|
|
2005-06-17 07:45:32 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("Alpha to _Logo"));
|
2006-10-16 09:08:54 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
|
|
|
N_("An_imation"));
|
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters/Animation",
|
|
|
|
N_("_Animators"));
|
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
|
|
|
N_("_Artistic"));
|
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
|
|
|
N_("_Blur"));
|
2005-06-17 07:45:32 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Decor"));
|
2006-10-16 09:08:54 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
|
|
|
N_("_Effects"));
|
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
|
|
|
N_("En_hance"));
|
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
|
|
|
N_("_Light and Shadow"));
|
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters/Light and Shadow",
|
|
|
|
N_("S_hadow"));
|
2005-06-17 07:45:32 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters",
|
2005-03-27 06:28:17 +08:00
|
|
|
N_("_Render"));
|
2006-10-16 09:08:54 +08:00
|
|
|
gimp_plugin_menu_branch_register ("<Image>/Filters/Effects",
|
|
|
|
N_("_Alchemy"));
|
2005-03-27 06:28:17 +08:00
|
|
|
|
2005-08-03 07:45:24 +08:00
|
|
|
gimp_install_temp_proc ("script-fu-refresh",
|
2006-10-16 09:08:54 +08:00
|
|
|
N_("Re-read all available Script-Fu scripts"),
|
|
|
|
"Re-read all available Script-Fu scripts",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997",
|
|
|
|
N_("_Refresh Scripts"),
|
|
|
|
NULL,
|
|
|
|
GIMP_TEMPORARY,
|
|
|
|
G_N_ELEMENTS (args), 0,
|
|
|
|
args, NULL,
|
|
|
|
script_fu_refresh_proc);
|
2004-11-19 06:44:28 +08:00
|
|
|
|
2006-06-27 21:08:28 +08:00
|
|
|
gimp_plugin_menu_register ("script-fu-refresh",
|
2007-03-16 21:21:42 +08:00
|
|
|
"<Toolbox>/Xtns/Languages/Script-Fu");
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-07-02 08:15:09 +08:00
|
|
|
script_fu_refresh_proc (const gchar *name,
|
2006-10-16 09:08:54 +08:00
|
|
|
gint nparams,
|
|
|
|
const GimpParam *params,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-11-08 22:35:50 +08:00
|
|
|
static GimpParam values[1];
|
2006-06-07 01:49:56 +08:00
|
|
|
GimpPDBStatusType status;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-06-07 01:49:56 +08:00
|
|
|
if (script_fu_interface_is_active ())
|
|
|
|
{
|
|
|
|
g_message (_("You can not use \"Refresh Scripts\" while a "
|
2006-10-16 09:08:54 +08:00
|
|
|
"Script-Fu dialog box is open. Please close "
|
|
|
|
"all Script-Fu windows and try again."));
|
2006-06-07 01:49:56 +08:00
|
|
|
|
|
|
|
status = GIMP_PDB_EXECUTION_ERROR;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Reload all of the available scripts */
|
2006-10-19 21:51:42 +08:00
|
|
|
gchar *path = script_fu_search_path ();
|
|
|
|
|
|
|
|
script_fu_find_scripts (path);
|
|
|
|
|
|
|
|
g_free (path);
|
2006-06-07 01:49:56 +08:00
|
|
|
|
|
|
|
status = GIMP_PDB_SUCCESS;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
*nreturn_vals = 1;
|
2000-11-08 22:35:50 +08:00
|
|
|
*return_vals = values;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-11-08 22:35:50 +08:00
|
|
|
values[0].type = GIMP_PDB_STATUS;
|
1997-11-25 06:05:25 +08:00
|
|
|
values[0].data.d_status = status;
|
|
|
|
}
|