Commit 9dc429e4 authored by Kevin Cozens's avatar Kevin Cozens Committed by Kevin Cozens

This big patch brings Tiny-Fu in sync with the Script-Fu plug-in of GIMP.

2006-12-09  Kevin Cozens  <kcozens@cvs.gnome.org>

	This big patch brings Tiny-Fu in sync with the Script-Fu plug-in
	of GIMP. This will make it easier to it in sync with Script-Fu.

	* tiny-fu/Makefile.am: Removed USE_STRCASECMP. Use the setting for
	USE_STRLWR that is used in TinyScheme.

	* tiny-fu/tiny-fu-console.c:
	* tiny-fu/tiny-fu-console.h:
	* tiny-fu/tiny-fu-interface.c:
	* tiny-fu/tiny-fu-interface.h:
	* tiny-fu/tiny-fu-scripts.c:
	* tiny-fu/tiny-fu-scripts.h:
	* tiny-fu/tiny-fu-text-console.c:
	* tiny-fu/tiny-fu-types.h:
	* tiny-fu/tiny-fu.c:
	* tiny-fu/ts-wrapper.c:
	* tiny-fu/ts-wrapper.h: Updated with the latest copy of these files
	from the Script-Fu plug-in in the CVS version of GIMP. This includes
	the change to the use of vectors instead of the hacked on array data
	type to handle GIMP's PDB ARRAY argument types.

	* tinyscheme/CHANGES: Updated to 1.38 version in TinyScheme.

	* tinyscheme/scheme.c: Added some changes from the 1.38 version of
	TinyScheme. Added fix for bug #1589701 (reported on SourceForge.net).

	* tinyscheme/scheme.h: Added a prototype to quiet the compiler. Added
	one change from the 1.38 version of TinyScheme.

	* scripts/script-fu-compat.init: Added delq, make-list, prin1, and
	print. Corrected name of unstrbreakup to unbreakupstr and fixed bug
	in it. Fixed butlast to handle lists with one entry. Changes to use
	native vector data type in aref, aset!, and cons-array.

	* scripts/erase-rows.scm
	* scripts/hsv-graph.scm: don't ever use the term "drawable" in
	user-visible strings.

	* scripts/3d-outline.scm:
	* scripts/paste-as-pattern.scm: Formatting changes.

	* scripts/test-sphere.scm: Show how to use named constants in register
	block. Added SF-VECTORS entry to register block.
parent b4761763
2006-12-09 Kevin Cozens <kcozens@cvs.gnome.org>
This big patch brings Tiny-Fu in sync with the Script-Fu plug-in
of GIMP. This will make it easier to it in sync with Script-Fu.
* tiny-fu/Makefile.am: Removed USE_STRCASECMP. Use the setting for
USE_STRLWR that is used in TinyScheme.
* tiny-fu/tiny-fu-console.c:
* tiny-fu/tiny-fu-console.h:
* tiny-fu/tiny-fu-interface.c:
* tiny-fu/tiny-fu-interface.h:
* tiny-fu/tiny-fu-scripts.c:
* tiny-fu/tiny-fu-scripts.h:
* tiny-fu/tiny-fu-text-console.c:
* tiny-fu/tiny-fu-types.h:
* tiny-fu/tiny-fu.c:
* tiny-fu/ts-wrapper.c:
* tiny-fu/ts-wrapper.h: Updated with the latest copy of these files
from the Script-Fu plug-in in the CVS version of GIMP. This includes
the change to the use of vectors instead of the hacked on array data
type to handle GIMP's PDB ARRAY argument types.
* tinyscheme/CHANGES: Updated to 1.38 version in TinyScheme.
* tinyscheme/scheme.c: Added some changes from the 1.38 version of
TinyScheme. Added fix for bug #1589701 (reported on SourceForge.net).
* tinyscheme/scheme.h: Added a prototype to quiet the compiler. Added
one change from the 1.38 version of TinyScheme.
* scripts/script-fu-compat.init: Added delq, make-list, prin1, and
print. Corrected name of unstrbreakup to unbreakupstr and fixed bug
in it. Fixed butlast to handle lists with one entry. Changes to use
native vector data type in aref, aset!, and cons-array.
* scripts/erase-rows.scm
* scripts/hsv-graph.scm: don't ever use the term "drawable" in
user-visible strings.
* scripts/3d-outline.scm:
* scripts/paste-as-pattern.scm: Formatting changes.
* scripts/test-sphere.scm: Show how to use named constants in register
block. Added SF-VECTORS entry to register block.
2006-11-21 Kevin Cozens <kcozens@cvs.gnome.org>
* Makefile.am: Start lines with tabs instead of spaces.
......
......@@ -67,8 +67,8 @@
(gimp-selection-all img)
(gimp-context-set-pattern text-pattern)
(gimp-edit-bucket-fill pattern PATTERN-BUCKET-FILL
NORMAL-MODE 100 0 FALSE 0 0)
(gimp-edit-bucket-fill pattern
PATTERN-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
(plug-in-bump-map noninteractive img pattern layer2
110.0 45.0 4 0 0 0 0 TRUE FALSE 0)
......
......@@ -33,7 +33,7 @@
(script-fu-register "script-fu-erase-rows"
_"_Erase Every Other Row..."
_"Erase every other row/column of pixels of the active drawable"
_"Erase every other row or column"
"Federico Mena Quintero"
"Federico Mena Quintero"
"June 1997"
......
......@@ -354,7 +354,7 @@
(script-fu-register "script-fu-hsv-graph"
_"Draw _HSV Graph..."
_"Create a graph of the Hue, Saturation, and Value distributions of the current drawable"
_"Create a graph of the Hue, Saturation, and Value distributions"
"Shuji Narazaki <narazaki@InetQ.or.jp>"
"Shuji Narazaki"
"1997"
......
......@@ -30,14 +30,15 @@
".pat"))
)
(file-pat-save RUN-NONINTERACTIVE
pattern-image pattern-draw path path
name)
(file-pat-save RUN-NONINTERACTIVE
pattern-image pattern-draw path path
name)
(gimp-image-delete pattern-image)
(gimp-image-delete pattern-image)
(gimp-patterns-refresh)
(gimp-context-set-pattern name)
(gimp-patterns-refresh)
(gimp-context-set-pattern name)
)
)
(script-fu-register "script-fu-paste-as-pattern"
......
......@@ -128,6 +128,30 @@
;Items below this line are for compatability with Script-Fu but
;may be useful enough to keep around
(define (delq item lis)
(let ((l))
(if (null? lis)
(set! l '())
(begin
(set! l (car lis))
(set! lis (cdr lis))
(while (not (null? lis))
(if (not (= item (car lis)))
(set! l (append l (list (car lis))))
)
(set! lis (cdr lis))
)
)
)
l
)
)
(define (make-list count fill)
(vector->list (make-vector count fill))
)
(define (strbreakup str sep)
(let* (
(seplen (string-length sep))
......@@ -200,9 +224,10 @@
)
)
(define (unstrbreakup stringlist sep)
(define (unbreakupstr stringlist sep)
(let ((str (car stringlist)))
(set! stringlist (cdr stringlist))
(while (not (null? stringlist))
(set! str (string-append str sep (car stringlist)))
(set! stringlist (cdr stringlist))
......@@ -215,13 +240,20 @@
;Items below this line are deprecated and should not be used in new scripts.
(define aset array-set!)
(define aref array-ref)
(define aset vector-set!)
(define aref vector-ref)
(define fopen open-input-file)
(define mapcar map)
(define nil '())
(define nreverse reverse)
(define pow expt)
(define prin1 write)
(define (print obj . port)
(apply write obj port)
(newline)
)
(define strcat string-append)
(define string-lessp string<?)
(define symbol-bound? defined?)
......@@ -232,16 +264,19 @@
)
(define (butlast x)
(reverse (cdr (reverse x)))
(if (= (length x) 1)
'()
(reverse (cdr (reverse x)))
)
)
(define (cons-array count type)
(case type
((long) (make-array count "int32"))
((short) (make-array count "int16"))
((byte) (make-array count "int8"))
((double) (make-array count "float"))
((string) (make-array count "string"))
((long) (make-vector count 0))
((short) (make-vector count 0))
((byte) (make-vector count 0))
((double) (make-vector count 0.0))
((string) (make-vector count ""))
(else type)
)
)
......
......@@ -267,8 +267,8 @@
"Spencer Kimball"
"1996, 1998"
""
SF-ADJUSTMENT "Radius (in pixels)" '(100 1 5000 1 10 0 SF-SPINNER)
SF-ADJUSTMENT "Lighting (degrees)" '(45 0 360 1 10 1 SF-SLIDER)
SF-ADJUSTMENT "Radius (in pixels)" (list 100 1 5000 1 10 0 SF-SPINNER)
SF-ADJUSTMENT "Lighting (degrees)" (list 45 0 360 1 10 1 SF-SLIDER)
SF-TOGGLE "Shadow" TRUE
SF-COLOR "Background color" "white"
SF-COLOR "Sphere color" "red"
......@@ -279,7 +279,7 @@
SF-GRADIENT "Gradient" "Deep Sea"
SF-TOGGLE "Gradient reverse" FALSE
SF-FONT "Font" "Agate"
SF-ADJUSTMENT "Font size (pixels)" '(50 1 1000 1 10 0 SF-SPINNER)
SF-ADJUSTMENT "Font size (pixels)" '(50 1 1000 1 10 0 1)
SF-PALETTE "Palette" "Default"
SF-FILENAME "Environment map"
(string-append gimp-data-directory
......@@ -292,6 +292,7 @@
SF-LAYER "Layer" -1
SF-CHANNEL "Channel" -1
SF-DRAWABLE "Drawable" -1
SF-VECTORS "Vectors" -1
)
(script-fu-menu-register "script-fu-test-sphere"
......
......@@ -11,8 +11,7 @@ endif
AM_CFLAGS = \
-DUSE_INTERFACE=1 \
-DUSE_STRCASECMP=1 \
-DUSE_STRLWR=1 \
-DUSE_STRLWR=0 \
-I$(top_srcdir) \
$(GIMP_CFLAGS)
......
......@@ -20,6 +20,8 @@
#include <errno.h>
#include <glib/gstdio.h>
#include "libgimp/gimp.h"
#include "libgimp/gimpui.h"
......@@ -77,6 +79,7 @@ static void tiny_fu_browse_response (GtkWidget *widget,
gint response_id,
ConsoleInterface *console);
static void tiny_fu_browse_row_activated (GtkDialog *dialog);
static gboolean tiny_fu_cc_is_empty (ConsoleInterface *console);
static gboolean tiny_fu_cc_key_function (GtkWidget *widget,
GdkEventKey *event,
......@@ -155,7 +158,6 @@ tiny_fu_console_interface (void)
g_object_add_weak_pointer (G_OBJECT (console->dialog),
(gpointer) &console->dialog);
g_signal_connect (console->dialog, "response",
G_CALLBACK (tiny_fu_console_response),
console);
......@@ -182,32 +184,31 @@ tiny_fu_console_interface (void)
output = console->text_view;
gtk_text_view_set_editable (GTK_TEXT_VIEW (console->text_view), FALSE);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (console->text_view), 12);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (console->text_view), 12);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (console->text_view), 6);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (console->text_view), 6);
gtk_widget_set_size_request (console->text_view, TEXT_WIDTH, TEXT_HEIGHT);
gtk_container_add (GTK_CONTAINER (scrolled_window), console->text_view);
gtk_widget_show (console->text_view);
gtk_text_buffer_create_tag (console->console, "strong",
"weight", PANGO_WEIGHT_BOLD,
"size", 12 * PANGO_SCALE,
"size", PANGO_SCALE_LARGE,
NULL);
gtk_text_buffer_create_tag (console->console, "emphasis",
"style", PANGO_STYLE_OBLIQUE,
"size", 10 * PANGO_SCALE,
NULL);
gtk_text_buffer_create_tag (console->console, "weak",
"size", 10 * PANGO_SCALE,
NULL);
{
const gchar *greeting_texts[] =
{
"strong", _("Welcome to TinyScheme\n"),
"weak", _("Copyright (c) Dimitrios Souflis\n\n"),
"strong", _("Script-Fu Console - "),
"strong", _("Welcome to TinyScheme"),
NULL, "\n",
NULL, "Copyright (c) Dimitrios Souflis",
NULL, "\n\n",
"strong", _("Script-Fu Console"),
NULL, " - ",
"emphasis", _("Interactive Scheme Development"),
NULL
NULL, "\n"
};
GtkTextIter cursor;
......@@ -215,12 +216,16 @@ tiny_fu_console_interface (void)
gtk_text_buffer_get_end_iter (console->console, &cursor);
for (i = 0; greeting_texts[i]; i += 2)
for (i = 0; i < G_N_ELEMENTS (greeting_texts); i += 2)
{
gtk_text_buffer_insert_with_tags_by_name (console->console, &cursor,
greeting_texts[i + 1], -1,
greeting_texts[i],
NULL);
if (greeting_texts[i])
gtk_text_buffer_insert_with_tags_by_name (console->console, &cursor,
greeting_texts[i + 1], -1,
greeting_texts[i],
NULL);
else
gtk_text_buffer_insert (console->console, &cursor,
greeting_texts[i + 1], -1);
}
}
......@@ -295,10 +300,10 @@ tiny_fu_console_response (GtkWidget *widget,
static void
tiny_fu_console_save_dialog (ConsoleInterface *console)
{
if (! console->dialog)
if (! console->save_dialog)
{
console->save_dialog =
gtk_file_chooser_dialog_new (_("Save Tiny-Fu Console Output"),
gtk_file_chooser_dialog_new (_("Save Script-Fu Console Output"),
GTK_WINDOW (console->dialog),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
......@@ -320,7 +325,7 @@ tiny_fu_console_save_dialog (ConsoleInterface *console)
console);
}
gtk_window_present (GTK_WINDOW (console->dialog));
gtk_window_present (GTK_WINDOW (console->save_dialog));
}
static void
......@@ -338,7 +343,7 @@ tiny_fu_console_save_response (GtkWidget *dialog,
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
fh = fopen (filename, "w");
fh = g_fopen (filename, "w");
if (! fh)
{
......@@ -497,7 +502,8 @@ tiny_fu_console_scroll_end (GtkWidget *view)
}
void
tiny_fu_output_to_console (gchar *text)
tiny_fu_output_to_console (gchar *text,
gint len)
{
/* FIXME: This function needs to be passed a pointer to the console.
*/
......@@ -507,10 +513,7 @@ tiny_fu_output_to_console (gchar *text)
GtkTextIter cursor;
gtk_text_buffer_get_end_iter (buffer, &cursor);
gtk_text_buffer_insert_with_tags_by_name (buffer, &cursor,
text, -1,
"weak",
NULL);
gtk_text_buffer_insert (buffer, &cursor, text, len);
tiny_fu_console_scroll_end (output);
}
......@@ -563,15 +566,10 @@ tiny_fu_cc_key_function (GtkWidget *widget,
"strong",
NULL);
gtk_text_buffer_insert_with_tags_by_name (console->console, &cursor,
gtk_entry_get_text (GTK_ENTRY (console->cc)), -1,
"weak",
NULL);
gtk_text_buffer_insert (console->console, &cursor,
gtk_entry_get_text (GTK_ENTRY (console->cc)), -1);
gtk_text_buffer_insert_with_tags_by_name (console->console, &cursor,
"\n", -1,
"weak",
NULL);
gtk_text_buffer_insert (console->console, &cursor, "\n", -1);
tiny_fu_console_scroll_end (console->text_view);
......
......@@ -20,18 +20,19 @@
#define __TINY_FU_CONSOLE_H__
void tiny_fu_console_run (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
void tiny_fu_eval_run (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
void tiny_fu_console_run (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
void tiny_fu_eval_run (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
void tiny_fu_output_to_console (gchar *text);
void tiny_fu_output_to_console (gchar *text,
gint len);
#endif /* __TINY_FU_CONSOLE__ */
......@@ -153,7 +153,8 @@ tiny_fu_interface_report_cc (const gchar *command)
}
void
tiny_fu_interface (SFScript *script)
tiny_fu_interface (SFScript *script,
gint start_arg)
{
GtkWidget *dialog;
GtkWidget *menu;
......@@ -200,6 +201,7 @@ tiny_fu_interface (SFScript *script)
/* strip the first part of the menupath if it contains _("/Script-Fu/") */
tmp = strstr (gettext (script->menu_path), _("/Script-Fu/"));
if (tmp)
sf_interface->title = g_strdup (tmp + strlen (_("/Script-Fu/")));
else
......@@ -258,10 +260,7 @@ tiny_fu_interface (SFScript *script)
gtk_widget_show (vbox);
/* The argument table */
if (script->image_based)
sf_interface->table = gtk_table_new (script->num_args - 1, 3, FALSE);
else
sf_interface->table = gtk_table_new (script->num_args + 1, 3, FALSE);
sf_interface->table = gtk_table_new (script->num_args - start_arg, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (sf_interface->table), 6);
gtk_table_set_row_spacings (GTK_TABLE (sf_interface->table), 6);
......@@ -270,7 +269,7 @@ tiny_fu_interface (SFScript *script)
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
for (i = script->image_based ? 2 : 0; i < script->num_args; i++)
for (i = start_arg; i < script->num_args; i++)
{
GtkWidget *widget = NULL;
GtkObject *adj;
......@@ -280,13 +279,11 @@ tiny_fu_interface (SFScript *script)
gint row = i;
gboolean left_align = FALSE;
if (script->image_based)
row -= 2;
row -= start_arg;
/* we add a colon after the label;
some languages want an extra space here */
label_text = g_strdup_printf (_("%s:"),
gettext (script->arg_labels[i]));
label_text = g_strdup_printf (_("%s:"), gettext (script->arg_labels[i]));
switch (script->arg_types[i])
{
......@@ -410,6 +407,11 @@ tiny_fu_interface (SFScript *script)
gtk_entry_set_activates_default (GIMP_SCALE_ENTRY_SPINBUTTON (script->arg_values[i].sfa_adjustment.adj), TRUE);
break;
default:
g_warning ("Unexpected adjustment type: %d",
script->arg_defaults[i].sfa_adjustment.type);
/* fallthrough */
case SF_SPINNER:
left_align = TRUE;
widget =
......
......@@ -19,7 +19,8 @@
#ifndef __TINY_FU_INTERFACE_H__
#define __TINY_FU_INTERFACE_H__
void tiny_fu_interface (SFScript *script);
void tiny_fu_interface (SFScript *script,
gint start_arg);
void tiny_fu_interface_report_cc (const gchar *command);
gboolean tiny_fu_interface_is_dialog_open (void);
......
......@@ -32,19 +32,16 @@
#include "tinyscheme/scheme-private.h"
#include "ts-wrapper.h"
#include "tiny-fu-types.h"
#include "tiny-fu-interface.h"
#include "tiny-fu-scripts.h"
#include "ts-wrapper.h"
#include "tiny-fu-intl.h"
#define RESPONSE_RESET 1
#define RESPONSE_ABOUT 2
typedef struct
{
SFScript *script;
......@@ -91,12 +88,8 @@ static GList *script_menu_list = NULL;
*/
void
tiny_fu_load_all_scripts (void)
tiny_fu_load_all_scripts (const gchar *path)
{
gchar *path_str;
gchar *path;
GError *error = NULL;
/* Make sure to clear any existing scripts */
if (script_tree != NULL)
{
......@@ -106,28 +99,14 @@ tiny_fu_load_all_scripts (void)
g_tree_destroy (script_tree);
}
script_tree = g_tree_new ((GCompareFunc) g_utf8_collate);
path_str = gimp_gimprc_query ("script-fu-path");
if (! path_str)
return;
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;
}
script_tree = g_tree_new ((GCompareFunc) g_utf8_collate);
gimp_datafiles_read_directories (path, G_FILE_TEST_IS_REGULAR,
tiny_fu_load_script,
NULL);
g_free (path);
/* Now that all scripts are read in and sorted, tell gimp about them */
g_tree_foreach (script_tree,
......@@ -188,10 +167,6 @@ tiny_fu_add_script (scheme *sc, pointer a)
/* Find the script menu_path */
val = sc->vptr->string_value (sc->vptr->pair_car (a));
script->menu_path = g_strdup (val);
if (strncmp (script->menu_path, "<Image>", 7) == 0)
script->image_based = TRUE;
else
script->image_based = FALSE;
a = sc->vptr->pair_cdr (a);
/* Find the script blurb */
......@@ -393,21 +368,27 @@ tiny_fu_add_script (scheme *sc, pointer a)
adj_list = sc->vptr->pair_car (a);
script->arg_defaults[i].sfa_adjustment.value =
sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
adj_list = sc->vptr->pair_cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.lower =
sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
adj_list = sc->vptr->pair_cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.upper =
sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
adj_list = sc->vptr->pair_cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.step =
sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
adj_list = sc->vptr->pair_cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.page =
sc->vptr->rvalue (sc->vptr->pair_car (adj_list));
adj_list = sc->vptr->pair_cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.digits =
sc->vptr->ivalue (sc->vptr->pair_car (adj_list));
adj_list = sc->vptr->pair_cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.type =
sc->vptr->ivalue (sc->vptr->pair_car (adj_list));
......@@ -786,7 +767,7 @@ tiny_fu_script_proc (const gchar *name,
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
SFScript *script;
gint min_args;
gint min_args = 0;
run_mode = params[0].data.d_int32;
......@@ -803,27 +784,26 @@ tiny_fu_script_proc (const gchar *name,
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
/* Determine whether the script is image based (runs on an image).
* When being called from an image, nparams is 3, otherwise it's 1.
*/
if (nparams == 3 && script->num_args >= 2)
if (nparams > 1 && params[1].type == GIMP_PDB_IMAGE &&
script->num_args > 0 && script->arg_types[0] == SF_IMAGE)
{
script->arg_values[0].sfa_image = params[1].data.d_image;
script->arg_values[1].sfa_drawable = params[2].data.d_drawable;
script->image_based = TRUE;
script->arg_values[0].sfa_image = params[1].data.d_image;
min_args++;
}
else
if (nparams > 2 && params[2].type == GIMP_PDB_DRAWABLE &&
script->num_args > 1 && script->arg_types[1] == SF_DRAWABLE)
{
script->image_based = FALSE;
script->arg_values[1].sfa_drawable = params[2].data.d_drawable;
min_args++;
}
/* First acquire information with a dialog */
/* Skip this part if the script takes no parameters */
min_args = (script->image_based) ? 2 : 0;
if (script->num_args > min_args)
{
tiny_fu_interface (script);
tiny_fu_interface (script, min_args);
break;
}
/* else fallthrough */
......
......@@ -19,7 +19,7 @@
#ifndef __TINY_FU_SCRIPTS_H__
#define __TINY_FU_SCRIPTS_H__
void tiny_fu_load_all_scripts (void);
void tiny_fu_load_all_scripts (const gchar *path);
pointer tiny_fu_add_script (scheme *sc, pointer a);
pointer tiny_fu_add_menu (scheme *sc, pointer a);
void tiny_fu_error_msg (const gchar *command);
......
......@@ -28,6 +28,7 @@
#include "libgimp/gimp.h"
#include "ts-wrapper.h"
#include "script-fu-text-console.h"
#include "tiny-fu-intl.h"
......@@ -62,7 +63,6 @@ tiny_fu_text_console_run (const gchar *name,
static gboolean
read_command (GString *command)
{
guchar c;
gint next;
gint level = 0;
......@@ -70,7 +70,7 @@ read_command (GString *command)
while ((next = fgetc (stdin)) != EOF)
{
c = (guchar) next;
guchar c = (guchar) next;
switch (c)
{
......
......@@ -94,7 +94,6 @@ typedef struct
gchar **arg_labels;
SFArgValue *arg_defaults;
SFArgValue *arg_values;
gboolean image_based;
GimpParamDef *args; /* used only temporary until installed */
} SFScript;
......
......@@ -40,18 +40,19 @@
/* Declare local functions. */
static void tiny_fu_query (void);
static void tiny_fu_run (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
static void tiny_fu_extension_init (void);
static void tiny_fu_refresh_proc (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
static void tiny_fu_query (void);
static void tiny_fu_run (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
static gchar * tiny_fu_search_path (void);
static void tiny_fu_extension_init (void);
static void tiny_fu_refresh_proc (const gchar *name,
gint nparams,
const GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
const GimpPlugInInfo PLUG_IN_INFO =
......@@ -165,14 +166,18 @@ tiny_fu_query (void)
}
static void
tiny_fu_run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
tiny_fu_run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
gchar *path;
INIT_I18N();
path = tiny_fu_search_path ();