removed empty quit() method. Only load scripts when extension-script-fu is

2006-05-16  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/script-fu.c: removed empty quit() method.
	Only load scripts when extension-script-fu is started.

	* plug-ins/script-fu/script-fu-scripts.c: minor cleanup.
This commit is contained in:
Sven Neumann
2006-05-16 12:05:30 +00:00
committed by Sven Neumann
parent c14c5393cc
commit 055617ac6f
3 changed files with 28 additions and 26 deletions

View File

@ -35,7 +35,6 @@
/* Declare local functions. */
static void script_fu_quit (void);
static void script_fu_query (void);
static void script_fu_run (const gchar *name,
gint nparams,
@ -50,43 +49,38 @@ static void script_fu_refresh_proc (const gchar *name,
GimpParam **return_vals);
GimpPlugInInfo PLUG_IN_INFO =
const GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
script_fu_quit, /* quit_proc */
NULL, /* quit_proc */
script_fu_query, /* query_proc */
script_fu_run /* run_proc */
};
MAIN ()
static void
script_fu_quit (void)
{
}
static void
script_fu_query (void)
{
static GimpParamDef console_args[] =
static const GimpParamDef console_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, [non-interactive]" }
};
static GimpParamDef textconsole_args[] =
static const GimpParamDef textconsole_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, [non-interactive]" }
};
static GimpParamDef eval_args[] =
static const GimpParamDef eval_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" },
{ GIMP_PDB_STRING, "code", "The code to evaluate" }
};
static GimpParamDef server_args[] =
static const GimpParamDef server_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" },
{ GIMP_PDB_INT32, "port", "The port on which to listen for requests" },
@ -194,31 +188,30 @@ script_fu_run (const gchar *name,
siod_init (FALSE);
}
/* Load all of the available scripts */
script_fu_find_scripts ();
if (strcmp (name, "extension-script-fu") == 0)
{
/*
* The main, automatically installed script fu extension. For
* things like logos and effects that are runnable from GIMP
* menus.
* The main script-fu extension.
*/
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
/* Load all of the available scripts */
script_fu_find_scripts ();
/* Acknowledge that the extension is properly initialized */
gimp_extension_ack ();
/* Go into an endless loop */
while (TRUE)
gimp_extension_process (0);
/* Set return values; pointless because we never get out of the loop */
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
values[0].data.d_status = GIMP_PDB_SUCCESS;
}
else if (strcmp (name, "plug-in-script-fu-text-console") == 0)
{
@ -261,7 +254,7 @@ script_fu_run (const gchar *name,
static void
script_fu_extension_init (void)
{
static GimpParamDef args[] =
static const GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "[Interactive], non-interactive" }
};