2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-24 22:05:25 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-24 22:05:25 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1997-11-24 22:05:25 +00:00
|
|
|
* (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
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
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 <string.h>
|
1999-05-29 01:28:24 +00:00
|
|
|
|
2000-01-31 20:47:44 +00:00
|
|
|
#include <libgimp/gimp.h>
|
2006-06-06 17:49:56 +00:00
|
|
|
|
2023-05-14 16:30:22 -04:00
|
|
|
#include "console/script-fu-console.h"
|
2008-08-21 14:48:29 +00:00
|
|
|
#include "script-fu-eval.h"
|
2001-07-18 00:59:32 +00:00
|
|
|
#include "script-fu-text-console.h"
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2022-05-29 15:48:51 -04:00
|
|
|
#include "libscriptfu/script-fu-lib.h"
|
|
|
|
#include "libscriptfu/script-fu-intl.h"
|
2000-01-31 20:47:44 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2022-06-13 16:13:36 -04:00
|
|
|
#define SCRIPT_FU_TYPE (script_fu_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (ScriptFu, script_fu, SCRIPT, FU, GimpPlugIn)
|
2019-08-12 20:11:45 +02:00
|
|
|
|
|
|
|
struct _ScriptFu
|
|
|
|
{
|
|
|
|
GimpPlugIn parent_instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
static GList * script_fu_query_procedures (GimpPlugIn *plug_in);
|
|
|
|
static GimpProcedure * script_fu_create_procedure (GimpPlugIn *plug_in,
|
|
|
|
const gchar *name);
|
|
|
|
|
|
|
|
static GimpValueArray * script_fu_run (GimpProcedure *procedure,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data);
|
2022-04-16 17:55:35 +02:00
|
|
|
static GimpValueArray * script_fu_batch_run (GimpProcedure *procedure,
|
|
|
|
GimpRunMode run_mode,
|
|
|
|
const gchar *code,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data);
|
|
|
|
static void script_fu_run_init (GimpProcedure *procedure,
|
|
|
|
GimpRunMode run_mode);
|
2019-08-12 20:11:45 +02:00
|
|
|
static void script_fu_extension_init (GimpPlugIn *plug_in);
|
|
|
|
static GimpValueArray * script_fu_refresh_proc (GimpProcedure *procedure,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data);
|
|
|
|
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (ScriptFu, script_fu, GIMP_TYPE_PLUG_IN)
|
|
|
|
|
|
|
|
GIMP_MAIN (SCRIPT_FU_TYPE)
|
2022-05-26 00:59:36 +02:00
|
|
|
DEFINE_STD_SET_I18N
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
2019-08-12 20:11:45 +02:00
|
|
|
script_fu_class_init (ScriptFuClass *klass)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2019-08-12 20:11:45 +02:00
|
|
|
GimpPlugInClass *plug_in_class = GIMP_PLUG_IN_CLASS (klass);
|
|
|
|
|
|
|
|
plug_in_class->query_procedures = script_fu_query_procedures;
|
|
|
|
plug_in_class->create_procedure = script_fu_create_procedure;
|
2022-05-26 00:59:36 +02:00
|
|
|
plug_in_class->set_i18n = STD_SET_I18N;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-08-12 20:11:45 +02:00
|
|
|
script_fu_init (ScriptFu *script_fu)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2019-08-12 20:11:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
|
|
|
script_fu_query_procedures (GimpPlugIn *plug_in)
|
|
|
|
{
|
|
|
|
GList *list = NULL;
|
|
|
|
|
|
|
|
list = g_list_append (list, g_strdup ("extension-script-fu"));
|
|
|
|
list = g_list_append (list, g_strdup ("plug-in-script-fu-console"));
|
|
|
|
list = g_list_append (list, g_strdup ("plug-in-script-fu-text-console"));
|
|
|
|
list = g_list_append (list, g_strdup ("plug-in-script-fu-eval"));
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpProcedure *
|
|
|
|
script_fu_create_procedure (GimpPlugIn *plug_in,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
GimpProcedure *procedure = NULL;
|
|
|
|
|
|
|
|
if (! strcmp (name, "extension-script-fu"))
|
|
|
|
{
|
2019-08-30 12:52:28 +02:00
|
|
|
procedure = gimp_procedure_new (plug_in, name,
|
|
|
|
GIMP_PDB_PROC_TYPE_EXTENSION,
|
2019-08-12 20:11:45 +02:00
|
|
|
script_fu_run, NULL, NULL);
|
|
|
|
|
|
|
|
gimp_procedure_set_documentation (procedure,
|
|
|
|
"A scheme interpreter for scripting "
|
|
|
|
"GIMP operations",
|
|
|
|
"More help here later",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_set_attribution (procedure,
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997");
|
|
|
|
}
|
|
|
|
else if (! strcmp (name, "plug-in-script-fu-console"))
|
|
|
|
{
|
2019-08-30 12:52:28 +02:00
|
|
|
procedure = gimp_procedure_new (plug_in, name,
|
|
|
|
GIMP_PDB_PROC_TYPE_PLUGIN,
|
2019-08-12 20:11:45 +02:00
|
|
|
script_fu_run, NULL, NULL);
|
|
|
|
|
2022-07-04 22:50:53 +02:00
|
|
|
gimp_procedure_set_menu_label (procedure, _("Script-Fu _Console"));
|
2019-08-12 20:11:45 +02:00
|
|
|
gimp_procedure_add_menu_path (procedure,
|
|
|
|
"<Image>/Filters/Development/Script-Fu");
|
|
|
|
|
|
|
|
gimp_procedure_set_documentation (procedure,
|
2022-07-04 22:50:53 +02:00
|
|
|
_("Interactive console for Script-Fu "
|
|
|
|
"development"),
|
2019-08-12 20:11:45 +02:00
|
|
|
"Provides an interface which allows "
|
|
|
|
"interactive scheme development.",
|
|
|
|
name);
|
|
|
|
gimp_procedure_set_attribution (procedure,
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997");
|
|
|
|
|
2019-08-19 10:02:07 +02:00
|
|
|
GIMP_PROC_ARG_ENUM (procedure, "run-mode",
|
|
|
|
"Run mode",
|
|
|
|
"The run mode",
|
|
|
|
GIMP_TYPE_RUN_MODE,
|
|
|
|
GIMP_RUN_INTERACTIVE,
|
|
|
|
G_PARAM_READWRITE);
|
2023-06-15 16:22:27 -04:00
|
|
|
GIMP_PROC_AUX_ARG_STRV (procedure, "history",
|
|
|
|
"Command history",
|
|
|
|
"History",
|
|
|
|
G_PARAM_READWRITE);
|
2019-08-12 20:11:45 +02:00
|
|
|
}
|
|
|
|
else if (! strcmp (name, "plug-in-script-fu-text-console"))
|
|
|
|
{
|
2019-08-30 12:52:28 +02:00
|
|
|
procedure = gimp_procedure_new (plug_in, name,
|
|
|
|
GIMP_PDB_PROC_TYPE_PLUGIN,
|
2019-08-12 20:11:45 +02:00
|
|
|
script_fu_run, NULL, NULL);
|
|
|
|
|
|
|
|
gimp_procedure_set_documentation (procedure,
|
|
|
|
"Provides a text console mode for "
|
|
|
|
"script-fu development",
|
|
|
|
"Provides an interface which allows "
|
|
|
|
"interactive scheme development.",
|
|
|
|
name);
|
|
|
|
gimp_procedure_set_attribution (procedure,
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997");
|
|
|
|
|
2019-08-19 10:02:07 +02:00
|
|
|
GIMP_PROC_ARG_ENUM (procedure, "run-mode",
|
|
|
|
"Run mode",
|
|
|
|
"The run mode",
|
|
|
|
GIMP_TYPE_RUN_MODE,
|
|
|
|
GIMP_RUN_INTERACTIVE,
|
|
|
|
G_PARAM_READWRITE);
|
2019-08-12 20:11:45 +02:00
|
|
|
}
|
|
|
|
else if (! strcmp (name, "plug-in-script-fu-eval"))
|
|
|
|
{
|
2022-04-16 23:13:50 +02:00
|
|
|
procedure = gimp_batch_procedure_new (plug_in, name, "Script-fu (scheme)",
|
2022-04-16 17:55:35 +02:00
|
|
|
GIMP_PDB_PROC_TYPE_PLUGIN,
|
|
|
|
script_fu_batch_run, NULL, NULL);
|
2019-08-12 20:11:45 +02:00
|
|
|
|
|
|
|
gimp_procedure_set_documentation (procedure,
|
|
|
|
"Evaluate scheme code",
|
|
|
|
"Evaluate the code under the scheme "
|
|
|
|
"interpreter (primarily for batch mode)",
|
|
|
|
name);
|
|
|
|
gimp_procedure_set_attribution (procedure,
|
|
|
|
"Manish Singh",
|
|
|
|
"Manish Singh",
|
|
|
|
"1998");
|
|
|
|
}
|
|
|
|
|
|
|
|
return procedure;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpValueArray *
|
|
|
|
script_fu_run (GimpProcedure *procedure,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data)
|
|
|
|
{
|
|
|
|
GimpPlugIn *plug_in = gimp_procedure_get_plug_in (procedure);
|
|
|
|
const gchar *name = gimp_procedure_get_name (procedure);
|
|
|
|
GimpValueArray *return_vals = NULL;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2019-08-12 20:11:45 +02:00
|
|
|
if (gimp_value_array_length (args) > 0)
|
2022-04-16 17:55:35 +02:00
|
|
|
script_fu_run_init (procedure, GIMP_VALUES_GET_ENUM (args, 0));
|
|
|
|
else
|
|
|
|
script_fu_run_init (procedure, GIMP_RUN_NONINTERACTIVE);
|
2006-05-18 17:35:24 +00:00
|
|
|
|
2005-08-02 23:45:24 +00:00
|
|
|
if (strcmp (name, "extension-script-fu") == 0)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2001-07-30 00:46:09 +00:00
|
|
|
/*
|
2006-05-16 12:05:30 +00:00
|
|
|
* The main script-fu extension.
|
2001-07-30 00:46:09 +00:00
|
|
|
*/
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
/* Acknowledge that the extension is properly initialized */
|
2019-08-12 20:11:45 +02:00
|
|
|
gimp_procedure_extension_ready (procedure);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2006-05-16 12:05:30 +00:00
|
|
|
/* Go into an endless loop */
|
2000-11-08 14:35:50 +00:00
|
|
|
while (TRUE)
|
2019-08-12 20:11:45 +02:00
|
|
|
gimp_plug_in_extension_process (plug_in, 0);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
2005-08-02 23:45:24 +00: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-17 22:53:21 +00:00
|
|
|
{
|
2001-07-30 00:46:09 +00:00
|
|
|
/*
|
2006-10-16 01:08:54 +00:00
|
|
|
* The script-fu text console for interactive Scheme development
|
2001-07-30 00:46:09 +00:00
|
|
|
*/
|
|
|
|
|
2019-08-12 20:11:45 +02:00
|
|
|
return_vals = script_fu_text_console_run (procedure, 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-17 22:53:21 +00:00
|
|
|
}
|
2005-08-02 23:45:24 +00:00
|
|
|
else if (strcmp (name, "plug-in-script-fu-console") == 0)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2001-07-30 00:46:09 +00:00
|
|
|
/*
|
2006-10-16 01:08:54 +00:00
|
|
|
* The script-fu console for interactive Scheme development
|
2001-07-30 00:46:09 +00:00
|
|
|
*/
|
|
|
|
|
2019-08-12 20:11:45 +02:00
|
|
|
return_vals = script_fu_console_run (procedure, args);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
2022-04-16 17:55:35 +02:00
|
|
|
|
|
|
|
if (! return_vals)
|
|
|
|
return_vals = gimp_procedure_new_return_values (procedure,
|
|
|
|
GIMP_PDB_SUCCESS,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return return_vals;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpValueArray *
|
|
|
|
script_fu_batch_run (GimpProcedure *procedure,
|
|
|
|
GimpRunMode run_mode,
|
|
|
|
const gchar *code,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data)
|
|
|
|
{
|
|
|
|
const gchar *name = gimp_procedure_get_name (procedure);
|
|
|
|
GimpValueArray *return_vals = NULL;
|
|
|
|
|
|
|
|
script_fu_run_init (procedure, run_mode);
|
|
|
|
|
|
|
|
if (strcmp (name, "plug-in-script-fu-eval") == 0)
|
1998-09-10 19:03:20 +00:00
|
|
|
{
|
2001-07-30 00:46:09 +00:00
|
|
|
/*
|
|
|
|
* A non-interactive "console" (for batch mode)
|
|
|
|
*/
|
|
|
|
|
2022-04-17 14:23:21 +02:00
|
|
|
if (g_strcmp0 (code, "-") == 0)
|
|
|
|
/* Redirecting to script-fu text console, for backward compatibility */
|
|
|
|
return_vals = script_fu_text_console_run (procedure, args);
|
|
|
|
else
|
|
|
|
return_vals = script_fu_eval_run (procedure, run_mode, code, args);
|
1998-09-10 19:03:20 +00:00
|
|
|
}
|
2019-08-12 20:11:45 +02:00
|
|
|
|
|
|
|
if (! return_vals)
|
|
|
|
return_vals = gimp_procedure_new_return_values (procedure,
|
|
|
|
GIMP_PDB_SUCCESS,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return return_vals;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
2022-04-16 17:55:35 +02:00
|
|
|
static void
|
|
|
|
script_fu_run_init (GimpProcedure *procedure,
|
|
|
|
GimpRunMode run_mode)
|
|
|
|
{
|
|
|
|
GimpPlugIn *plug_in = gimp_procedure_get_plug_in (procedure);
|
|
|
|
const gchar *name = gimp_procedure_get_name (procedure);
|
|
|
|
GList *path;
|
|
|
|
|
|
|
|
path = script_fu_search_path ();
|
|
|
|
|
|
|
|
/* 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 auxiliary temporary procedures for the base extension */
|
|
|
|
script_fu_extension_init (plug_in);
|
|
|
|
|
2022-05-29 15:48:51 -04:00
|
|
|
/* Init the interpreter, allow register scripts */
|
|
|
|
script_fu_init_embedded_interpreter (path, TRUE, run_mode);
|
2022-04-16 17:55:35 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-05-29 15:48:51 -04:00
|
|
|
/* Init the interpreter, not allow register scripts */
|
|
|
|
script_fu_init_embedded_interpreter (path, FALSE, run_mode);
|
2022-04-16 17:55:35 +02:00
|
|
|
}
|
|
|
|
|
2022-05-29 15:48:51 -04:00
|
|
|
script_fu_find_and_register_scripts (plug_in, path);
|
2022-04-16 17:55:35 +02:00
|
|
|
|
|
|
|
g_list_free_full (path, (GDestroyNotify) g_object_unref);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
static void
|
2019-08-12 20:11:45 +02:00
|
|
|
script_fu_extension_init (GimpPlugIn *plug_in)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2019-08-12 20:11:45 +02:00
|
|
|
GimpProcedure *procedure;
|
|
|
|
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/Help", N_("_GIMP Online"));
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/Help", N_("_User Manual"));
|
|
|
|
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/Filters/Development",
|
|
|
|
N_("_Script-Fu"));
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/Filters/Development/Script-Fu",
|
|
|
|
N_("_Test"));
|
|
|
|
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/File/Create",
|
|
|
|
N_("_Buttons"));
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/File/Create",
|
|
|
|
N_("_Logos"));
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/File/Create",
|
|
|
|
N_("_Patterns"));
|
|
|
|
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/File/Create",
|
|
|
|
N_("_Web Page Themes"));
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/File/Create/Web Page Themes",
|
|
|
|
N_("_Alien Glow"));
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/File/Create/Web Page Themes",
|
|
|
|
N_("_Beveled Pattern"));
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/File/Create/Web Page Themes",
|
|
|
|
N_("_Classic.Gimp.Org"));
|
|
|
|
|
|
|
|
gimp_plug_in_add_menu_branch (plug_in, "<Image>/Filters",
|
|
|
|
N_("Alpha to _Logo"));
|
|
|
|
|
|
|
|
procedure = gimp_procedure_new (plug_in, "script-fu-refresh",
|
2019-08-30 12:52:28 +02:00
|
|
|
GIMP_PDB_PROC_TYPE_TEMPORARY,
|
2019-08-12 20:11:45 +02:00
|
|
|
script_fu_refresh_proc, NULL, NULL);
|
|
|
|
|
2022-07-04 22:50:53 +02:00
|
|
|
gimp_procedure_set_menu_label (procedure, _("_Refresh Scripts"));
|
2019-08-12 20:11:45 +02:00
|
|
|
gimp_procedure_add_menu_path (procedure,
|
|
|
|
"<Image>/Filters/Development/Script-Fu");
|
|
|
|
|
|
|
|
gimp_procedure_set_documentation (procedure,
|
2022-07-04 22:50:53 +02:00
|
|
|
_("Re-read all available Script-Fu scripts"),
|
2019-08-12 20:11:45 +02:00
|
|
|
"Re-read all available Script-Fu scripts",
|
|
|
|
"script-fu-refresh");
|
|
|
|
gimp_procedure_set_attribution (procedure,
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"Spencer Kimball & Peter Mattis",
|
|
|
|
"1997");
|
|
|
|
|
2019-08-19 10:02:07 +02:00
|
|
|
GIMP_PROC_ARG_ENUM (procedure, "run-mode",
|
|
|
|
"Run mode",
|
|
|
|
"The run mode",
|
|
|
|
GIMP_TYPE_RUN_MODE,
|
|
|
|
GIMP_RUN_INTERACTIVE,
|
|
|
|
G_PARAM_READWRITE);
|
2019-08-12 20:11:45 +02:00
|
|
|
|
|
|
|
gimp_plug_in_add_temp_procedure (plug_in, procedure);
|
|
|
|
g_object_unref (procedure);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
2019-08-12 20:11:45 +02:00
|
|
|
static GimpValueArray *
|
|
|
|
script_fu_refresh_proc (GimpProcedure *procedure,
|
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2022-05-29 15:48:51 -04:00
|
|
|
if (script_fu_extension_is_busy ())
|
2006-06-06 17:49:56 +00:00
|
|
|
{
|
|
|
|
g_message (_("You can not use \"Refresh Scripts\" while a "
|
2006-10-16 01:08:54 +00:00
|
|
|
"Script-Fu dialog box is open. Please close "
|
|
|
|
"all Script-Fu windows and try again."));
|
2006-06-06 17:49:56 +00:00
|
|
|
|
2019-08-12 20:11:45 +02:00
|
|
|
return gimp_procedure_new_return_values (procedure,
|
|
|
|
GIMP_PDB_EXECUTION_ERROR,
|
|
|
|
NULL);
|
2006-06-06 17:49:56 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Reload all of the available scripts */
|
2014-08-03 21:49:20 +02:00
|
|
|
GList *path = script_fu_search_path ();
|
2006-10-19 13:51:42 +00:00
|
|
|
|
2022-05-29 15:48:51 -04:00
|
|
|
script_fu_find_and_register_scripts (gimp_procedure_get_plug_in (procedure), path);
|
2006-10-19 13:51:42 +00:00
|
|
|
|
2014-08-03 21:49:20 +02:00
|
|
|
g_list_free_full (path, (GDestroyNotify) g_object_unref);
|
2006-06-06 17:49:56 +00:00
|
|
|
}
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2019-08-12 20:11:45 +02:00
|
|
|
return gimp_procedure_new_return_values (procedure, GIMP_PDB_SUCCESS, NULL);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|