gimp/plug-ins/script-fu/script-fu-scripts.c

2194 lines
61 KiB
C
Raw Normal View History

1997-11-25 06:05:25 +08: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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1997-11-25 06:05:25 +08:00
*/
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
#include "config.h"
#include <glib.h> /* Include early for obscure Win32
build reasons */
1997-11-25 06:05:25 +08:00
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
1999-04-26 03:30:31 +08:00
#include <sys/types.h>
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
#include <gtk/gtk.h>
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
from now on use make.msc from $(TOP)/glib/build/win32; all occurences of 2001-02-17 Hans Breuer <hans@breuer.org> * */*/makefile.msc */makefile.msc : from now on use make.msc from $(TOP)/glib/build/win32; all occurences of DIRENT removed and general update * app/config/makefile.msc app/paint/makefile.msc app/plug-in/makefile.msc themes/Default/makefile.msc : new files * app/base/base.c : ported to GDir usage * app/config/gimpconfig-serialize.c : app/config/gimpconfig-deserialize.c : HAVE_UNISTD_H * app/config/gimpconfig.c : app/config/gimprc.c : HAVE_UNISTD_H, use <io.h> for open() prototype and merged pmode parameter (_S_IREAD | _S_IWRITE) * app/core/cpercep.c : msvc doesn't have cbrt(), provide it via pow(). Also include <glib.h> for painless 'inline' definition. * app/core/gimpdatafiles.c : ported to GDir usage * app/core/gimpimage-convert.c : work around a msvc compiler limitation (can't convert from uint64 to double) * app/file/file-open.c app/file/file-save.c : access() -> _access() for G_OS_WIN32 * app/plug-in/plug-in.c : HAVE_UNISTD_H and <io.h> * libgimpbase/gimpbase.def : updated externals * libgimpbase/gimpenv.c : define WIN32_LEAN_AND_MEAN to avoid clashes with incompatible DATADIR definitions * libgimpcolor/gimpcolor.def : updated externals * lingimpmath/gimpmath.def : updated externals * libgimpwidgets/gimpwidgets.def : updated externals * libgimpwidgets/libgimp-glue.c : adapt to const changes of some prototypes * plug-ins/makefile.msc : disabled gdyntext * plug-ins/gap/iter_ALT/*/*.inc : GimpRunModeType -> GimpRunMode * plug-ins/FractalExplorer/FractalExplorer.c : * plug-ins/gap/gap_lib.c : * plug-ins/gfig/gfig.c : * plug-ins/gflare/gflare.c : * plug-ins/gimpressionist/gimpressionist.c : replaced DIRENT usage with GDir * plug-ins/script-fu/script-fu-scripts.c : #include <windows.h> to get the Sleep() prototype
2002-02-17 23:55:54 +08:00
#ifdef G_OS_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
1997-11-25 06:05:25 +08:00
#include "siod.h"
#include "script-fu-scripts.h"
2000-02-28 03:35:39 +08:00
#include "script-fu-intl.h"
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
#define TEXT_WIDTH 100
#define COLOR_SAMPLE_WIDTH 100
#define COLOR_SAMPLE_HEIGHT 15
#define SLIDER_WIDTH 100
#define FONT_PREVIEW_WIDTH 100
1998-08-10 23:06:58 +08:00
#define DEFAULT_FONT_SIZE 240
1997-11-25 06:05:25 +08:00
#define MAX_STRING_LENGTH 4096
1997-11-25 06:05:25 +08:00
typedef struct
{
GtkAdjustment *adj;
gfloat value;
gfloat lower;
gfloat upper;
gfloat step;
gfloat page;
gint digits;
SFAdjustmentType type;
} SFAdjustment;
1998-08-10 23:06:58 +08:00
typedef struct
{
GtkWidget *preview;
GtkWidget *dialog;
gchar *fontname;
} SFFont;
typedef struct
{
1999-05-19 01:33:39 +08:00
GtkWidget *fileselection;
gchar *filename;
} SFFilename;
typedef struct
{
gchar *name;
gdouble opacity;
gint spacing;
gint paint_mode;
} SFBrush;
typedef struct
{
GSList *list;
guint history;
} SFOption;
1997-11-25 06:05:25 +08:00
typedef union
{
gint32 sfa_image;
gint32 sfa_drawable;
gint32 sfa_layer;
gint32 sfa_channel;
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
GimpRGB sfa_color;
gint32 sfa_toggle;
gchar *sfa_value;
SFAdjustment sfa_adjustment;
SFFont sfa_font;
SFFilename sfa_file;
gchar *sfa_pattern;
gchar *sfa_gradient;
SFBrush sfa_brush;
SFOption sfa_option;
1997-11-25 06:05:25 +08:00
} SFArgValue;
typedef struct
{
gchar *script_name;
gchar *pdb_name;
gchar *description;
gchar *help;
gchar *author;
gchar *copyright;
gchar *date;
gchar *img_types;
gint num_args;
SFArgType *arg_types;
gchar **arg_labels;
SFArgValue *arg_defaults;
SFArgValue *arg_values;
gboolean image_based;
GimpParamDef *args; /* used only temporary until installed */
1997-11-25 06:05:25 +08:00
} SFScript;
typedef struct
{
GtkWidget *dialog;
GtkWidget **args_widgets;
GtkWidget *status;
GtkWidget *about_dialog;
gchar *title;
gchar *last_command;
gint command_count;
gint consec_command_count;
1997-11-25 06:05:25 +08:00
} SFInterface;
1997-11-25 06:05:25 +08:00
/* External functions
*/
extern long nlength (LISP obj);
1997-11-25 06:05:25 +08:00
/*
* Local Functions
*/
static gboolean script_fu_install_script (gpointer foo,
SFScript *script,
gpointer bar);
static gboolean script_fu_remove_script (gpointer foo,
SFScript *script,
gpointer bar);
static void script_fu_script_proc (gchar *name,
gint nparams,
GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals);
static SFScript * script_fu_find_script (gchar *script_name);
static void script_fu_free_script (SFScript *script);
static void script_fu_interface (SFScript *script);
static void script_fu_interface_quit (SFScript *script);
static void script_fu_error_msg (gchar *command);
static void script_fu_ok_callback (GtkWidget *widget,
gpointer data);
static void script_fu_about_callback (GtkWidget *widget,
gpointer data);
static void script_fu_reset_callback (GtkWidget *widget,
gpointer data);
static void script_fu_menu_callback (gint32 id,
gpointer data);
static void script_fu_file_selection_callback (GtkWidget *widget,
gpointer data);
static void script_fu_font_preview_callback (GtkWidget *widget,
gpointer data);
static void script_fu_font_dialog_ok (GtkWidget *widget,
gpointer data);
static void script_fu_font_dialog_cancel (GtkWidget *widget,
gpointer data);
static gboolean script_fu_font_dialog_delete (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static void script_fu_font_preview (GtkWidget *preview,
gchar *fontname);
static void script_fu_pattern_preview (gchar *name,
gint width,
gint height,
gint bytes,
gchar *mask_data,
gboolean closing,
gpointer data);
static void script_fu_gradient_preview (gchar *name,
gint width,
gdouble *mask_data,
gboolean closing,
gpointer data);
static void script_fu_brush_preview (gchar *name,
gdouble opacity,
gint spacing,
gint paint_mode,
gint width,
gint height,
gchar *mask_data,
gboolean closing,
gpointer data);
1997-11-25 06:05:25 +08:00
/*
* Local variables
*/
static GTree *script_list = NULL;
static SFInterface *sf_interface = NULL; /* there can only be at most one
interactive interface */
extern gchar siod_err_msg[];
1997-11-25 06:05:25 +08:00
/*
* Function definitions
*/
void
script_fu_find_scripts (void)
1997-11-25 06:05:25 +08:00
{
const gchar *home;
const gchar *entry;
gchar *path_str;
gchar *local_path;
gchar *path;
gchar *filename;
gchar *token;
gchar *next_token;
gchar *command;
GDir *dir;
1997-11-25 06:05:25 +08:00
/* Make sure to clear any existing scripts */
if (script_list != NULL)
{
g_tree_foreach (script_list,
(GTraverseFunc) script_fu_remove_script,
NULL);
g_tree_destroy (script_list);
1997-11-25 06:05:25 +08:00
}
script_list = g_tree_new ((GCompareFunc) strcoll);
path_str = gimp_gimprc_query ("script-fu-path");
1997-11-25 06:05:25 +08:00
if (path_str == NULL)
return;
1997-11-25 06:05:25 +08:00
/* Set local path to contain temp_path, where (supposedly)
* there may be working files.
*/
home = g_get_home_dir ();
local_path = g_strdup (path_str);
/* Search through all directories in the local path */
next_token = local_path;
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
1997-11-25 06:05:25 +08:00
while (token)
{
if (*token == '~')
{
path = g_malloc (strlen (home) + strlen (token) + 2);
sprintf (path, "%s%s", home, token + 1);
}
else
{
path = g_malloc (strlen (token) + 2);
strcpy (path, token);
}
/* Check if directory exists and if it has any items in it */
if (g_file_test (path, G_FILE_TEST_IS_DIR))
{
GError *error;
dir = g_dir_open (path, 0, &error);
if (!dir)
{
g_message ("Error reading script folder '%s'\n%s",
path, error->message);
g_clear_error (&error);
}
1997-11-25 06:05:25 +08:00
else
{
while ((entry = g_dir_read_name (dir)))
1997-11-25 06:05:25 +08:00
{
filename = g_build_filename (path, entry, NULL);
added -DG_DISABLE_DEPRECATED and -DGDK_DISABLE_COMPAT_H. 2001-08-29 Michael Natterer <mitch@gimp.org> * configure.in: added -DG_DISABLE_DEPRECATED and -DGDK_DISABLE_COMPAT_H. * app/batch.c * app/file-utils.c * app/gdisplay.c * app/gdisplay_ops.c * app/gimprc.[ch] * app/module_db.c * app/nav_window.c * app/undo_history.c * app/core/gimpgradient.c * app/core/gimpimagefile.c * app/core/gimppalette.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/error-console-dialog.c * app/gui/file-commands.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-window.c * app/gui/menus.c * app/gui/palette-import-dialog.c * app/tools/gimpbycolorselecttool.c * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpdatafactoryview.c * libgimp/gimpmenu.c * plug-ins/common/bz2.c * plug-ins/common/compose.c * plug-ins/common/csource.c * plug-ins/common/decompose.c * plug-ins/common/gz.c * plug-ins/common/uniteditor.c * plug-ins/common/wmf.c * plug-ins/common/xbm.c * plug-ins/rcm/rcm_dialog.c * plug-ins/script-fu/interp_slib.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gimprc.pdb * app/pdb/fileops_cmds.c * app/pdb/gimprc_cmds.c: removed deprecated stuff like g_basename(), g_dirname(), g_strup() and friends. Added some "const gchar *" declarations while I was on it. Added some G_N_ELEMENTS() macros instead of declaring a useless variable for the number of items. * app/widgets/gtkhwrapbox.[ch] * app/widgets/gtkvwrapbox.[ch] * app/widgets/gtkwrapbox.[ch]: replaced with the latest versions from GLE, ported by the master himself. * app/gui/toolbox.c: changed accordingly. * app/plug_in.c * libgimp/gimp.c * libgimpbase/gimpwire.[ch]: use evil hacks to get binary mode from the new GIOChannel implementation (upstream bugreport already posted).
2001-08-30 01:48:28 +08:00
if (g_ascii_strcasecmp (filename + strlen (filename) - 4, ".scm") == 0)
1997-11-25 06:05:25 +08:00
{
/* Check the file and see that it is not a sub-directory */
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR))
1997-11-25 06:05:25 +08:00
{
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
gchar *qf = g_strescape (filename, NULL);
1999-04-26 03:30:31 +08:00
#ifdef __EMX__
_fnslashify(qf);
1999-04-26 03:30:31 +08:00
#endif
command = g_strdup_printf ("(load \"%s\")", qf);
g_free (qf);
if (repl_c_string (command, 0, 0, 1) != 0)
script_fu_error_msg (command);
#ifdef G_OS_WIN32
/* No, I don't know why, but this is
* necessary on NT 4.0.
*/
Sleep(0);
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
#endif
g_free (command);
1997-11-25 06:05:25 +08:00
}
}
g_free (filename);
} /* while */
g_dir_close (dir);
} /* else */
} /* if */
g_free (path);
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
} /* while */
g_free (local_path);
g_free (path_str);
/* now that all scripts are read in and sorted, tell gimp about them */
g_tree_foreach (script_list,
(GTraverseFunc) script_fu_install_script,
NULL);
1997-11-25 06:05:25 +08:00
}
LISP
script_fu_add_script (LISP a)
{
GimpParamDef *args;
SFScript *script;
gchar *val;
gint i;
guchar r, g, b;
LISP color_list;
LISP adj_list;
LISP brush_list;
LISP option_list;
gchar *s;
1997-11-25 06:05:25 +08:00
/* Check the length of a */
if (nlength (a) < 7)
return my_err ("Too few arguments to script-fu-register", NIL);
1997-11-25 06:05:25 +08:00
/* Create a new script */
script = g_new0 (SFScript, 1);
1997-11-25 06:05:25 +08:00
/* Find the script name */
val = get_c_string (car (a));
script->script_name = g_strdup (val);
a = cdr (a);
1999-12-06 04:48:06 +08:00
/* transform the function name into a name containing "_" for each "-".
* this does not hurt anybody, yet improves the life of many... ;)
*/
script->pdb_name = g_strdup (val);
for (s = script->pdb_name; *s; s++)
if (*s == '-')
*s = '_';
1997-11-25 06:05:25 +08:00
/* Find the script description */
val = get_c_string (car (a));
script->description = g_strdup (val);
a = cdr (a);
/* Find the script help */
val = get_c_string (car (a));
script->help = g_strdup (val);
a = cdr (a);
/* Find the script author */
val = get_c_string (car (a));
script->author = g_strdup (val);
a = cdr (a);
/* Find the script copyright */
val = get_c_string (car (a));
script->copyright = g_strdup (val);
a = cdr (a);
/* Find the script date */
val = get_c_string (car (a));
script->date = g_strdup (val);
a = cdr (a);
/* Find the script image types */
if (TYPEP (a, tc_cons))
{
val = get_c_string (car (a));
a = cdr (a);
}
else
{
val = get_c_string (a);
a = NIL;
}
script->img_types = g_strdup (val);
/* Check the supplied number of arguments */
script->num_args = nlength (a) / 3;
args = g_new (GimpParamDef, script->num_args + 1);
args[0].type = GIMP_PDB_INT32;
args[0].name = "run_mode";
args[0].description = "Interactive, non-interactive";
script->arg_types = g_new (SFArgType, script->num_args);
script->arg_labels = g_new (gchar *, script->num_args);
script->arg_defaults = g_new0 (SFArgValue, script->num_args);
script->arg_values = g_new0 (SFArgValue, script->num_args);
1997-11-25 06:05:25 +08:00
if (script->num_args > 0)
{
for (i = 0; i < script->num_args; i++)
{
if (a != NIL)
{
if (!TYPEP (car (a), tc_flonum))
return my_err ("script-fu-register: argument types must be integer values", NIL);
1997-11-25 06:05:25 +08:00
script->arg_types[i] = get_c_long (car (a));
a = cdr (a);
}
else
return my_err ("script-fu-register: missing type specifier", NIL);
1997-11-25 06:05:25 +08:00
if (a != NIL)
{
if (!TYPEP (car (a), tc_string))
return my_err ("script-fu-register: argument labels must be strings", NIL);
1997-11-25 06:05:25 +08:00
script->arg_labels[i] = g_strdup (get_c_string (car (a)));
a = cdr (a);
}
else
return my_err ("script-fu-register: missing arguments label", NIL);
1997-11-25 06:05:25 +08:00
if (a != NIL)
{
switch (script->arg_types[i])
{
case SF_IMAGE:
case SF_DRAWABLE:
case SF_LAYER:
case SF_CHANNEL:
if (!TYPEP (car (a), tc_flonum))
return my_err ("script-fu-register: drawable defaults must be integer values", NIL);
1997-11-25 06:05:25 +08:00
script->arg_defaults[i].sfa_image = get_c_long (car (a));
script->arg_values[i].sfa_image = script->arg_defaults[i].sfa_image;
switch (script->arg_types[i])
{
case SF_IMAGE:
args[i + 1].type = GIMP_PDB_IMAGE;
1997-11-25 06:05:25 +08:00
args[i + 1].name = "image";
break;
1997-11-25 06:05:25 +08:00
case SF_DRAWABLE:
args[i + 1].type = GIMP_PDB_DRAWABLE;
1997-11-25 06:05:25 +08:00
args[i + 1].name = "drawable";
break;
1997-11-25 06:05:25 +08:00
case SF_LAYER:
args[i + 1].type = GIMP_PDB_LAYER;
1997-11-25 06:05:25 +08:00
args[i + 1].name = "layer";
break;
1997-11-25 06:05:25 +08:00
case SF_CHANNEL:
args[i + 1].type = GIMP_PDB_CHANNEL;
1997-11-25 06:05:25 +08:00
args[i + 1].name = "channel";
break;
1997-11-25 06:05:25 +08:00
default:
break;
}
args[i + 1].description = script->arg_labels[i];
break;
case SF_COLOR:
if (!TYPEP (car (a), tc_cons))
return my_err ("script-fu-register: color defaults must be a list of 3 integers", NIL);
1997-11-25 06:05:25 +08:00
color_list = car (a);
r = CLAMP (get_c_long (car (color_list)), 0, 255);
1997-11-25 06:05:25 +08:00
color_list = cdr (color_list);
g = CLAMP (get_c_long (car (color_list)), 0, 255);
1997-11-25 06:05:25 +08:00
color_list = cdr (color_list);
b = CLAMP (get_c_long (car (color_list)), 0, 255);
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
gimp_rgb_set_uchar (&script->arg_defaults[i].sfa_color,
r, g, b);
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
script->arg_values[i].sfa_color =
script->arg_defaults[i].sfa_color;
1997-11-25 06:05:25 +08:00
args[i + 1].type = GIMP_PDB_COLOR;
1997-11-25 06:05:25 +08:00
args[i + 1].name = "color";
args[i + 1].description = script->arg_labels[i];
break;
case SF_TOGGLE:
if (!TYPEP (car (a), tc_flonum))
return my_err ("script-fu-register: toggle default must be an integer value", NIL);
script->arg_defaults[i].sfa_toggle =
(get_c_long (car (a))) ? TRUE : FALSE;
script->arg_values[i].sfa_toggle =
script->arg_defaults[i].sfa_toggle;
1997-11-25 06:05:25 +08:00
args[i + 1].type = GIMP_PDB_INT32;
1997-11-25 06:05:25 +08:00
args[i + 1].name = "toggle";
args[i + 1].description = script->arg_labels[i];
break;
1998-08-10 23:06:58 +08:00
case SF_VALUE:
1997-11-25 06:05:25 +08:00
if (!TYPEP (car (a), tc_string))
return my_err ("script-fu-register: value defaults must be string values", NIL);
script->arg_defaults[i].sfa_value =
g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_value =
g_strdup (script->arg_defaults[i].sfa_value);
1997-11-25 06:05:25 +08:00
args[i + 1].type = GIMP_PDB_STRING;
1997-11-25 06:05:25 +08:00
args[i + 1].name = "value";
args[i + 1].description = script->arg_labels[i];
break;
case SF_STRING:
if (!TYPEP (car (a), tc_string))
return my_err ("script-fu-register: string defaults must be string values", NIL);
script->arg_defaults[i].sfa_value =
g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_value =
g_strdup (script->arg_defaults[i].sfa_value);
args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "string";
args[i + 1].description = script->arg_labels[i];
break;
case SF_ADJUSTMENT:
if (!TYPEP (car (a), tc_cons))
return my_err ("script-fu-register: adjustment defaults must be a list", NIL);
adj_list = car (a);
script->arg_defaults[i].sfa_adjustment.value =
get_c_double (car (adj_list));
adj_list = cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.lower =
get_c_double (car (adj_list));
adj_list = cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.upper =
get_c_double (car (adj_list));
adj_list = cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.step =
get_c_double (car (adj_list));
adj_list = cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.page =
get_c_double (car (adj_list));
adj_list = cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.digits =
get_c_long (car (adj_list));
adj_list = cdr (adj_list);
script->arg_defaults[i].sfa_adjustment.type =
get_c_long (car (adj_list));
script->arg_values[i].sfa_adjustment.adj = NULL;
script->arg_values[i].sfa_adjustment.value =
script->arg_defaults[i].sfa_adjustment.value;
args[i + 1].type = GIMP_PDB_FLOAT;
args[i + 1].name = "value";
args[i + 1].description = script->arg_labels[i];
break;
case SF_FILENAME:
if (!TYPEP (car (a), tc_string))
return my_err ("script-fu-register: filename defaults must be string values", NIL);
/* fallthrough */
case SF_DIRNAME:
if (!TYPEP (car (a), tc_string))
return my_err ("script-fu-register: dirname defaults must be string values", NIL);
script->arg_defaults[i].sfa_file.filename =
g_strdup (get_c_string (car (a)));
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
#ifdef G_OS_WIN32
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
/* Replace POSIX slashes with Win32 backslashes. This
* is just so script-fus can be written with only
* POSIX directory separators.
*/
val = script->arg_defaults[i].sfa_file.filename;
while (*val)
{
if (*val == '/')
*val = '\\';
val++;
}
#endif
script->arg_values[i].sfa_file.filename =
g_strdup (script->arg_defaults[i].sfa_file.filename);
1999-05-19 01:33:39 +08:00
script->arg_values[i].sfa_file.fileselection = NULL;
args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = (script->arg_types[i] == SF_FILENAME ?
"filename" : "dirname");
1999-05-19 01:33:39 +08:00
args[i + 1].description = script->arg_labels[i];
break;
1998-08-10 23:06:58 +08:00
case SF_FONT:
if (!TYPEP (car (a), tc_string))
return my_err ("script-fu-register: font defaults must be string values", NIL);
script->arg_defaults[i].sfa_font.fontname =
g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_font.fontname =
g_strdup (script->arg_defaults[i].sfa_font.fontname);
1998-08-10 23:06:58 +08:00
script->arg_values[i].sfa_font.preview = NULL;
script->arg_values[i].sfa_font.dialog = NULL;
args[i + 1].type = GIMP_PDB_STRING;
1998-08-10 23:06:58 +08:00
args[i + 1].name = "font";
args[i + 1].description = script->arg_labels[i];
break;
case SF_PATTERN:
if (!TYPEP (car (a), tc_string))
return my_err ("script-fu-register: pattern defaults must be string values", NIL);
script->arg_defaults[i].sfa_pattern =
g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_pattern =
g_strdup (script->arg_defaults[i].sfa_pattern);
args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "pattern";
args[i + 1].description = script->arg_labels[i];
break;
case SF_BRUSH:
if (!TYPEP (car (a), tc_cons))
return my_err ("script-fu-register: brush defaults must be a list", NIL);
brush_list = car (a);
script->arg_defaults[i].sfa_brush.name =
g_strdup (get_c_string (car (brush_list)));
brush_list = cdr (brush_list);
script->arg_defaults[i].sfa_brush.opacity =
get_c_double (car (brush_list));
brush_list = cdr (brush_list);
script->arg_defaults[i].sfa_brush.spacing =
get_c_long (car (brush_list));
brush_list = cdr (brush_list);
script->arg_defaults[i].sfa_brush.paint_mode =
get_c_long (car (brush_list));
script->arg_values[i].sfa_brush =
script->arg_defaults[i].sfa_brush;
/* Need this since we need a copy of the string
* in the values area. We could free it later but the
* default one must hang around.
*/
script->arg_values[i].sfa_brush.name =
g_strdup(script->arg_defaults[i].sfa_brush.name);
args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "brush";
args[i + 1].description = script->arg_labels[i];
1998-08-10 23:06:58 +08:00
break;
case SF_GRADIENT:
if (!TYPEP (car (a), tc_string))
return my_err ("script-fu-register: gradient defaults must be string values", NIL);
script->arg_defaults[i].sfa_gradient =
g_strdup (get_c_string (car (a)));
script->arg_values[i].sfa_gradient =
g_strdup (script->arg_defaults[i].sfa_pattern);
args[i + 1].type = GIMP_PDB_STRING;
args[i + 1].name = "gradient";
args[i + 1].description = script->arg_labels[i];
break;
case SF_OPTION:
if (!TYPEP (car (a), tc_cons))
return my_err ("script-fu-register: option defaults must be a list", NIL);
for (option_list = car (a);
option_list;
option_list = cdr (option_list))
{
script->arg_defaults[i].sfa_option.list =
g_slist_append (script->arg_defaults[i].sfa_option.list,
g_strdup (get_c_string (car (option_list))));
}
script->arg_defaults[i].sfa_option.history = 0;
script->arg_values[i].sfa_option.history = 0;
args[i + 1].type = GIMP_PDB_INT32;
args[i + 1].name = "option";
args[i + 1].description = script->arg_labels[i];
break;
1997-11-25 06:05:25 +08:00
default:
break;
}
a = cdr (a);
}
else
return my_err ("script-fu-register: missing default argument", NIL);
1997-11-25 06:05:25 +08:00
}
}
script->args = args;
g_tree_insert (script_list, gettext (script->description), script);
1997-11-25 06:05:25 +08:00
return NIL;
}
void
script_fu_report_cc (gchar *command)
{
if (sf_interface == NULL)
return;
if (sf_interface->last_command &&
strcmp (sf_interface->last_command, command) == 0)
1997-11-25 06:05:25 +08:00
{
gchar *new_command;
1997-11-25 06:05:25 +08:00
sf_interface->command_count++;
new_command = g_strdup_printf ("%s <%d>",
command, sf_interface->command_count);
gtk_label_set_text (GTK_LABEL (sf_interface->status), new_command);
1997-11-25 06:05:25 +08:00
g_free (new_command);
}
else
{
sf_interface->command_count = 1;
gtk_label_set_text (GTK_LABEL (sf_interface->status), command);
g_free (sf_interface->last_command);
sf_interface->last_command = g_strdup (command);
1997-11-25 06:05:25 +08:00
}
while (gtk_main_iteration ());
1997-11-25 06:05:25 +08:00
}
/*
* The following function is a GTraverseFunction. Please
* note that it frees the script->args structure. --Sven
*/
static gboolean
script_fu_install_script (gpointer foo,
SFScript *script,
gpointer bar)
{
gchar *menu_path = NULL;
/* Allow scripts with no menus */
if (strncmp (script->description, "<None>", 6) != 0)
menu_path = script->description;
gimp_install_temp_proc (script->pdb_name,
script->description,
script->help,
script->author,
script->copyright,
script->date,
menu_path,
script->img_types,
GIMP_TEMPORARY,
script->num_args + 1, 0,
script->args, NULL,
script_fu_script_proc);
g_free (script->args);
script->args = NULL;
return FALSE;
}
/*
* The following function is a GTraverseFunction.
*/
static gboolean
script_fu_remove_script (gpointer foo,
SFScript *script,
gpointer bar)
{
script_fu_free_script (script);
return FALSE;
}
1997-11-25 06:05:25 +08:00
static void
script_fu_script_proc (gchar *name,
gint nparams,
GimpParam *params,
gint *nreturn_vals,
GimpParam **return_vals)
1997-11-25 06:05:25 +08:00
{
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
SFScript *script;
gint min_args;
gchar *escaped;
1997-11-25 06:05:25 +08:00
run_mode = params[0].data.d_int32;
if (! (script = script_fu_find_script (name)))
{
status = GIMP_PDB_CALLING_ERROR;
}
1997-11-25 06:05:25 +08:00
else
{
if (script->num_args == 0)
run_mode = GIMP_RUN_NONINTERACTIVE;
1997-11-25 06:05:25 +08:00
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
/* Determine whether the script is image based (runs on an image) */
1997-11-25 06:05:25 +08:00
if (strncmp (script->description, "<Image>", 7) == 0)
{
script->arg_values[0].sfa_image = params[1].data.d_image;
1997-11-25 06:05:25 +08:00
script->arg_values[1].sfa_drawable = params[2].data.d_drawable;
script->image_based = TRUE;
}
else
script->image_based = FALSE;
/* 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)
{
script_fu_interface (script);
break;
}
/* else fallthrough */
1997-11-25 06:05:25 +08:00
case GIMP_RUN_NONINTERACTIVE:
1997-11-25 06:05:25 +08:00
/* Make sure all the arguments are there! */
if (nparams != (script->num_args + 1))
status = GIMP_PDB_CALLING_ERROR;
if (status == GIMP_PDB_SUCCESS)
1997-11-25 06:05:25 +08:00
{
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
guchar color[3];
gchar *text = NULL;
gchar *command;
gchar *c;
gchar buffer[MAX_STRING_LENGTH];
gint length;
gint i;
1997-11-25 06:05:25 +08:00
length = strlen (script->script_name) + 3;
for (i = 0; i < script->num_args; i++)
switch (script->arg_types[i])
{
case SF_IMAGE:
case SF_DRAWABLE:
case SF_LAYER:
case SF_CHANNEL:
length += 12; /* Maximum size of integer value will not exceed this many characters */
break;
1997-11-25 06:05:25 +08:00
case SF_COLOR:
length += 16; /* Maximum size of color string: '(XXX XXX XXX) */
break;
1997-11-25 06:05:25 +08:00
case SF_TOGGLE:
length += 6; /* Maximum size of (TRUE, FALSE) */
break;
1997-11-25 06:05:25 +08:00
case SF_VALUE:
length += strlen (params[i + 1].data.d_string) + 1;
break;
case SF_STRING:
case SF_FILENAME:
case SF_DIRNAME:
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
escaped = g_strescape (params[i + 1].data.d_string, NULL);
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
length += strlen (escaped) + 3;
g_free (escaped);
break;
case SF_ADJUSTMENT:
length += strlen (params[i + 1].data.d_string) + 1;
break;
1998-08-10 23:06:58 +08:00
case SF_FONT:
case SF_PATTERN:
case SF_GRADIENT:
case SF_BRUSH:
length += strlen (params[i + 1].data.d_string) + 3;
break;
case SF_OPTION:
length += strlen (params[i + 1].data.d_string) + 1;
break;
1997-11-25 06:05:25 +08:00
default:
break;
}
c = command = g_new (gchar, length);
1997-11-25 06:05:25 +08:00
if (script->num_args)
1999-12-06 04:48:06 +08:00
{
sprintf (command, "(%s ", script->script_name);
c += strlen (script->script_name) + 2;
1999-12-06 04:48:06 +08:00
for (i = 0; i < script->num_args; i++)
{
switch (script->arg_types[i])
{
case SF_IMAGE:
case SF_DRAWABLE:
case SF_LAYER:
case SF_CHANNEL:
g_snprintf (buffer, sizeof (buffer), "%d",
params[i + 1].data.d_image);
1999-12-06 04:48:06 +08:00
text = buffer;
break;
1999-12-06 04:48:06 +08:00
case SF_COLOR:
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
gimp_rgb_get_uchar (&params[i + 1].data.d_color,
color, color + 1, color + 2);
g_snprintf (buffer, sizeof (buffer), "'(%d %d %d)",
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
color[0], color[1], color[2]);
1999-12-06 04:48:06 +08:00
text = buffer;
break;
1999-12-06 04:48:06 +08:00
case SF_TOGGLE:
g_snprintf (buffer, sizeof (buffer), "%s",
(params[i + 1].data.d_int32) ? "TRUE"
: "FALSE");
1999-12-06 04:48:06 +08:00
text = buffer;
break;
1999-12-06 04:48:06 +08:00
case SF_VALUE:
text = params[i + 1].data.d_string;
break;
1999-12-06 04:48:06 +08:00
case SF_STRING:
case SF_FILENAME:
case SF_DIRNAME:
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
escaped = g_strescape (params[i + 1].data.d_string,
NULL);
g_snprintf (buffer, sizeof (buffer), "\"%s\"",
escaped);
1999-12-06 04:48:06 +08:00
g_free (escaped);
text = buffer;
break;
1999-12-06 04:48:06 +08:00
case SF_ADJUSTMENT:
text = params[i + 1].data.d_string;
break;
1999-12-06 04:48:06 +08:00
case SF_FONT:
case SF_PATTERN:
case SF_GRADIENT:
case SF_BRUSH:
g_snprintf (buffer, sizeof (buffer), "\"%s\"",
params[i + 1].data.d_string);
1999-12-06 04:48:06 +08:00
text = buffer;
break;
case SF_OPTION:
text = params[i + 1].data.d_string;
break;
1999-12-06 04:48:06 +08:00
default:
break;
}
if (i == script->num_args - 1)
sprintf (c, "%s)", text);
else
sprintf (c, "%s ", text);
1999-12-06 04:48:06 +08:00
c += strlen (text) + 1;
}
}
else
sprintf (command, "(%s)", script->script_name);
1997-11-25 06:05:25 +08:00
/* run the command through the interpreter */
if (repl_c_string (command, 0, 0, 1) != 0)
script_fu_error_msg (command);
1997-11-25 06:05:25 +08:00
g_free (command);
}
break;
default:
break;
}
}
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
1997-11-25 06:05:25 +08:00
values[0].data.d_status = status;
}
/* this is a GTraverseFunction */
static gboolean
script_fu_lookup_script (gpointer *foo,
SFScript *script,
gchar **name)
1997-11-25 06:05:25 +08:00
{
if (strcmp (script->pdb_name, *name) == 0)
{
/* store the script in the name pointer and stop the traversal */
*name = (gchar *)script;
return TRUE;
1997-11-25 06:05:25 +08:00
}
else
return FALSE;
}
1997-11-25 06:05:25 +08:00
static SFScript *
script_fu_find_script (gchar *pdb_name)
{
gchar *script;
script = pdb_name;
g_tree_foreach (script_list,
(GTraverseFunc) script_fu_lookup_script,
&script);
if (script == pdb_name)
return NULL;
else
return (SFScript *)script;
1997-11-25 06:05:25 +08:00
}
static void
script_fu_free_script (SFScript *script)
{
gint i;
1997-11-25 06:05:25 +08:00
/* Uninstall the temporary procedure for this script */
gimp_uninstall_temp_proc (script->script_name);
if (script)
{
g_free (script->script_name);
g_free (script->description);
g_free (script->help);
g_free (script->author);
g_free (script->copyright);
g_free (script->date);
g_free (script->img_types);
g_free (script->arg_types);
for (i = 0; i < script->num_args; i++)
{
g_free (script->arg_labels[i]);
switch (script->arg_types[i])
{
case SF_IMAGE:
case SF_DRAWABLE:
case SF_LAYER:
case SF_CHANNEL:
case SF_COLOR:
break;
1997-11-25 06:05:25 +08:00
case SF_VALUE:
1998-08-10 23:06:58 +08:00
case SF_STRING:
1997-11-25 06:05:25 +08:00
g_free (script->arg_defaults[i].sfa_value);
g_free (script->arg_values[i].sfa_value);
break;
case SF_ADJUSTMENT:
break;
case SF_FILENAME:
case SF_DIRNAME:
g_free (script->arg_defaults[i].sfa_file.filename);
g_free (script->arg_values[i].sfa_file.filename);
break;
1998-08-10 23:06:58 +08:00
case SF_FONT:
g_free (script->arg_defaults[i].sfa_font.fontname);
g_free (script->arg_values[i].sfa_font.fontname);
break;
case SF_PATTERN:
g_free (script->arg_defaults[i].sfa_pattern);
g_free (script->arg_values[i].sfa_pattern);
break;
case SF_GRADIENT:
g_free (script->arg_defaults[i].sfa_gradient);
g_free (script->arg_values[i].sfa_gradient);
break;
case SF_BRUSH:
g_free (script->arg_defaults[i].sfa_brush.name);
g_free (script->arg_values[i].sfa_brush.name);
break;
case SF_OPTION:
g_slist_foreach (script->arg_defaults[i].sfa_option.list,
(GFunc)g_free, NULL);
if (script->arg_defaults[i].sfa_option.list)
g_slist_free (script->arg_defaults[i].sfa_option.list);
break;
1997-11-25 06:05:25 +08:00
default:
break;
}
}
g_free (script->arg_labels);
g_free (script->arg_defaults);
g_free (script->arg_values);
g_free (script);
}
}
static void
script_fu_interface (SFScript *script)
{
GtkWidget *dlg;
GtkWidget *frame;
1997-11-25 06:05:25 +08:00
GtkWidget *button;
GtkWidget *menu;
GtkWidget *table;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *menu_item;
GSList *list;
gchar *buf;
gint start_args;
gint i;
guint j;
1997-11-25 06:05:25 +08:00
static gboolean gtk_initted = FALSE;
1997-11-25 06:05:25 +08:00
/* Simply return if there is already an interface. This is an
ugly workaround for the fact that we can not process two
scripts at a time. */
if (sf_interface != NULL)
return;
g_return_if_fail (script != NULL);
1997-11-25 06:05:25 +08:00
if (!gtk_initted)
{
INIT_I18N();
gimprc.in replaced "color-cube" by "min-colors". 2000-04-30 Michael Natterer <mitch@gimp.org> * gimprc.in * app/gimprc.[ch]: replaced "color-cube" by "min-colors". * app/app_procs.c: read unitrc/gimprc before displaying the splash. * app/colormaps.c: set min_colors and install_cmap before initializing GdkRGB. * app/gimprc.[ch] * app/gimpunit.c: don't call the splash's progress_update function. * app/plug_in.c: pass min_colors instead of color_cube to plugins. * app/preferences_dialog.c: widget for min_colors. * libgimp/gimp.[ch]: s/color_cube/min_colors/ but left gimp_color_cube() there for source level compatibility. * libgimp/gimpprotocol.[ch]: changed the GPConfig message accordinly and increased the gimp protocol version number because the change breaks binary compatibility. Also actually pass the use_xshm variable over the wire (was only in the GPConfig struct before). Was it the right thing to do to increase the version number?? * libgimp/gimpui.c (gimp_ui_init): use the same code as the app for initializing GdkRGB. Never explicitly activate Gdk's SHM usage (only switch it off). * app/main.c * libgimp/gimp.c: reverted the handling of all signals except SIGCHLD back to plain old signal() because those signals are fatal anyway and sigaction() as used by gimp_signal_*() made debugging (stacktrace) impossible. * plug-ins/AlienMap/AlienMap.c * plug-ins/AlienMap2/AlienMap2.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/bmp/bmp.c * plug-ins/borderaverage/borderaverage.c * plug-ins/dbbrowser/dbbrowser.c * plug-ins/faxg3/faxg3.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp.c * plug-ins/fp/fp_gtk.c * plug-ins/gdyntext/Makefile.am * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/helpbrowser/helpbrowser.c * plug-ins/ifscompose/ifscompose.c * plug-ins/imagemap/Makefile.am * plug-ins/imagemap/imap_main.c * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print.c * plug-ins/rcm/rcm_dialog.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/Makefile.am * plug-ins/sel2path/sel2path.c * plug-ins/sgi/sgi.c * plug-ins/sinus/sinus.c * plug-ins/struc/struc.c * plug-ins/webbrowser/webbrowser.c * plug-ins/winsnap/winsnap.c * plug-ins/xjt/xjt.c: use gimp_ui_init(). * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c: only switch Gdk SHM usage off, never on. Don't use gimp_ui_init() here because of libgck.
2000-05-01 02:17:55 +08:00
gimp_ui_init ("script-fu", TRUE);
1997-11-25 06:05:25 +08:00
gtk_initted = TRUE;
}
sf_interface = g_new0 (SFInterface, 1);
sf_interface->args_widgets = g_new0 (GtkWidget *, script->num_args);
2000-02-28 03:35:39 +08:00
/* strip the first part of the menupath if it contains _("/Script-Fu/") */
buf = strstr (gettext (script->description), _("/Script-Fu/"));
if (buf)
sf_interface->title = g_strdup (buf + strlen (_("/Script-Fu/")));
else
sf_interface->title = g_strdup (gettext (script->description));
2000-02-28 03:35:39 +08:00
buf = strstr (sf_interface->title, "...");
2000-02-28 03:35:39 +08:00
if (buf)
*buf = '\0';
buf = g_strdup_printf (_("Script-Fu: %s"), sf_interface->title);
dlg = gimp_dialog_new (buf, "script-fu",
gimp_standard_help_func, "filters/script-fu.html",
GTK_WIN_POS_MOUSE,
TRUE, FALSE, TRUE,
GTK_STOCK_CANCEL, gtk_widget_destroy,
NULL, 1, NULL, FALSE, TRUE,
GTK_STOCK_OK, script_fu_ok_callback,
script, NULL, NULL, TRUE, FALSE,
NULL);
g_free (buf);
sf_interface->dialog = dlg;
g_signal_connect_swapped (dlg, "destroy",
G_CALLBACK (script_fu_interface_quit),
script);
gtk_window_set_resizable (GTK_WINDOW (dlg), TRUE);
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
sf_interface->status = gtk_label_new (sf_interface->title);
gtk_misc_set_alignment (GTK_MISC (sf_interface->status), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), sf_interface->status, TRUE, TRUE, 0);
gtk_widget_show (sf_interface->status);
button = gtk_button_new_with_label (_("About"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (script_fu_about_callback),
script);
1998-08-12 03:17:23 +08:00
/* the script arguments frame */
frame = gtk_frame_new (_("Script Arguments"));
gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
1997-11-25 06:05:25 +08:00
/* the vbox holding all widgets */
vbox = gtk_vbox_new (FALSE, 2);
1998-08-12 03:17:23 +08:00
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
1997-11-25 06:05:25 +08:00
/* The argument table */
table = gtk_table_new (script->num_args + 1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0);
1997-11-25 06:05:25 +08:00
start_args = (script->image_based) ? 2 : 0;
for (i = start_args; i < script->num_args; i++)
{
/* we add a colon after the label;
some languages want an extra space here */
gchar *label_text =
g_strdup_printf (_("%s:"), gettext (script->arg_labels[i]));
gfloat label_yalign = 0.5;
gboolean widget_leftalign = TRUE;
1997-11-25 06:05:25 +08:00
switch (script->arg_types[i])
{
case SF_IMAGE:
case SF_DRAWABLE:
case SF_LAYER:
case SF_CHANNEL:
sf_interface->args_widgets[i] = gtk_option_menu_new ();
1997-11-25 06:05:25 +08:00
switch (script->arg_types[i])
{
case SF_IMAGE:
menu = gimp_image_menu_new (NULL, script_fu_menu_callback,
&script->arg_values[i].sfa_image,
script->arg_values[i].sfa_image);
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SF_DRAWABLE:
menu = gimp_drawable_menu_new (NULL, script_fu_menu_callback,
&script->arg_values[i].sfa_drawable,
script->arg_values[i].sfa_drawable);
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SF_LAYER:
menu = gimp_layer_menu_new (NULL, script_fu_menu_callback,
&script->arg_values[i].sfa_layer,
script->arg_values[i].sfa_layer);
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SF_CHANNEL:
menu = gimp_channel_menu_new (NULL, script_fu_menu_callback,
&script->arg_values[i].sfa_channel,
script->arg_values[i].sfa_channel);
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
default:
menu = NULL;
break;
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (sf_interface->args_widgets[i]),
menu);
1997-11-25 06:05:25 +08:00
break;
case SF_COLOR:
sf_interface->args_widgets[i] =
gimp_color_button_new (_("Script-Fu Color Selection"),
COLOR_SAMPLE_WIDTH, COLOR_SAMPLE_HEIGHT,
&script->arg_values[i].sfa_color,
GIMP_COLOR_AREA_FLAT);
g_signal_connect (sf_interface->args_widgets[i],
"color_changed",
G_CALLBACK (gimp_color_button_get_color),
&script->arg_values[i].sfa_color);
1997-11-25 06:05:25 +08:00
break;
case SF_TOGGLE:
g_free (label_text);
label_text = NULL;
sf_interface->args_widgets[i] =
2000-02-28 03:35:39 +08:00
gtk_check_button_new_with_label (gettext (script->arg_labels[i]));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sf_interface->args_widgets[i]),
1997-11-25 06:05:25 +08:00
script->arg_values[i].sfa_toggle);
g_signal_connect (sf_interface->args_widgets[i],
"toggled",
G_CALLBACK (gimp_toggle_button_update),
&script->arg_values[i].sfa_toggle);
1997-11-25 06:05:25 +08:00
break;
case SF_VALUE:
case SF_STRING:
widget_leftalign = FALSE;
sf_interface->args_widgets[i] = gtk_entry_new ();
app/gimpprogress.c app/nav_window.c app/ops_buttons.c app/undo_history.c 2001-12-29 Michael Natterer <mitch@gimp.org> * app/gimpprogress.c * app/nav_window.c * app/ops_buttons.c * app/undo_history.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/color-select.c * app/gui/colormap-dialog.c * app/gui/convert-dialog.c * app/gui/device-status-dialog.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-dialog.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/paths-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c * app/gui/user-install-dialog.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/selection_options.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpconstrainedhwrapbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd.c * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpfontselection-dialog.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemfactory.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch] * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.[ch] * app/widgets/gtkhwrapbox.c * app/widgets/gtkvwrapbox.c * app/widgets/gtkwrapbox.c * libgimp/gimpbrushmenu.c * libgimp/gimpexport.c * libgimp/gimpgradientmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimpwidgets/gimpbutton.c * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimphelpui.c * libgimpwidgets/gimpoffsetarea.c * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimppixmap.h * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpstock.[ch] * libgimpwidgets/gimpwidgets.h * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/bmp/bmpwrite.c * plug-ins/dbbrowser/dbbrowser_utils.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/fp/fp_misc.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/*.c * plug-ins/imagemap/*.[ch] * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print_gimp.h * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/rcm/rcm_misc.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/sgi/sgi.c * plug-ins/webbrowser/webbrowser.c * plug-ins/xjt/xjt.c * plug-ins/common/[A-n]*.c: compile with GTK_DISABLE_DEPRECATED defined. Not everything is fully ported yet, had to #undef GTK_DISABLE_DEPRECATED in many places and added #warnings when doing so. * pixmaps/Makefile.am * pixmaps/chain.xpm: removed. * themes/Default/Makefile.am * themes/Default/images/Makefile.am * themes/Default/images/stock-button-hchain-broken.png * themes/Default/images/stock-button-hchain.png * themes/Default/images/stock-button-vchain-broken.png * themes/Default/images/stock-button-vchain.png: new stock icons.
2001-12-29 21:26:29 +08:00
gtk_widget_set_size_request (sf_interface->args_widgets[i],
TEXT_WIDTH, -1);
gtk_entry_set_text (GTK_ENTRY (sf_interface->args_widgets[i]),
script->arg_values[i].sfa_value);
break;
case SF_ADJUSTMENT:
script->arg_values[i].sfa_adjustment.adj = (GtkAdjustment *)
gtk_adjustment_new (script->arg_values[i].sfa_adjustment.value,
script->arg_defaults[i].sfa_adjustment.lower,
script->arg_defaults[i].sfa_adjustment.upper,
script->arg_defaults[i].sfa_adjustment.step,
script->arg_defaults[i].sfa_adjustment.page, 0);
switch (script->arg_defaults[i].sfa_adjustment.type)
{
case SF_SLIDER:
label_yalign = 1.0;
widget_leftalign = FALSE;
sf_interface->args_widgets[i] =
gtk_hscale_new (script->arg_values[i].sfa_adjustment.adj);
app/gimpprogress.c app/nav_window.c app/ops_buttons.c app/undo_history.c 2001-12-29 Michael Natterer <mitch@gimp.org> * app/gimpprogress.c * app/nav_window.c * app/ops_buttons.c * app/undo_history.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/color-select.c * app/gui/colormap-dialog.c * app/gui/convert-dialog.c * app/gui/device-status-dialog.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-dialog.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/paths-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c * app/gui/user-install-dialog.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/selection_options.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpconstrainedhwrapbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd.c * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpfontselection-dialog.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemfactory.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch] * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.[ch] * app/widgets/gtkhwrapbox.c * app/widgets/gtkvwrapbox.c * app/widgets/gtkwrapbox.c * libgimp/gimpbrushmenu.c * libgimp/gimpexport.c * libgimp/gimpgradientmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimpwidgets/gimpbutton.c * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimphelpui.c * libgimpwidgets/gimpoffsetarea.c * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimppixmap.h * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpstock.[ch] * libgimpwidgets/gimpwidgets.h * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/bmp/bmpwrite.c * plug-ins/dbbrowser/dbbrowser_utils.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/fp/fp_misc.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/*.c * plug-ins/imagemap/*.[ch] * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print_gimp.h * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/rcm/rcm_misc.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/sgi/sgi.c * plug-ins/webbrowser/webbrowser.c * plug-ins/xjt/xjt.c * plug-ins/common/[A-n]*.c: compile with GTK_DISABLE_DEPRECATED defined. Not everything is fully ported yet, had to #undef GTK_DISABLE_DEPRECATED in many places and added #warnings when doing so. * pixmaps/Makefile.am * pixmaps/chain.xpm: removed. * themes/Default/Makefile.am * themes/Default/images/Makefile.am * themes/Default/images/stock-button-hchain-broken.png * themes/Default/images/stock-button-hchain.png * themes/Default/images/stock-button-vchain-broken.png * themes/Default/images/stock-button-vchain.png: new stock icons.
2001-12-29 21:26:29 +08:00
gtk_widget_set_size_request (GTK_WIDGET (sf_interface->args_widgets[i]),
SLIDER_WIDTH, -1);
gtk_scale_set_digits (GTK_SCALE (sf_interface->args_widgets[i]),
script->arg_defaults[i].sfa_adjustment.digits);
gtk_scale_set_draw_value (GTK_SCALE (sf_interface->args_widgets[i]), TRUE);
gtk_range_set_update_policy (GTK_RANGE (sf_interface->args_widgets[i]),
GTK_UPDATE_DELAYED);
break;
case SF_SPINNER:
sf_interface->args_widgets[i] =
gtk_spin_button_new (script->arg_values[i].sfa_adjustment.adj,
0,
script->arg_defaults[i].sfa_adjustment.digits);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (sf_interface->args_widgets[i]), TRUE);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (sf_interface->args_widgets[i]), TRUE);
break;
default: /* this shouldn't happen */
sf_interface->args_widgets[i] = NULL;
break;
1998-08-10 23:06:58 +08:00
}
break;
case SF_FILENAME:
case SF_DIRNAME:
widget_leftalign = FALSE;
if (script->arg_types[i] == SF_FILENAME)
sf_interface->args_widgets[i] =
gimp_file_selection_new (_("Script-Fu File Selection"),
script->arg_values[i].sfa_file.filename,
FALSE, TRUE);
else
sf_interface->args_widgets[i] =
gimp_file_selection_new (_("Script-Fu Folder Selection"),
script->arg_values[i].sfa_file.filename,
TRUE, TRUE);
script->arg_values[i].sfa_file.fileselection =
sf_interface->args_widgets[i];
1999-05-19 01:33:39 +08:00
g_signal_connect (sf_interface->args_widgets[i],
"filename_changed",
G_CALLBACK (script_fu_file_selection_callback),
&script->arg_values[i].sfa_file);
break;
1998-08-10 23:06:58 +08:00
case SF_FONT:
widget_leftalign = FALSE;
sf_interface->args_widgets[i] = gtk_button_new ();
1998-08-10 23:06:58 +08:00
script->arg_values[i].sfa_font.preview = gtk_label_new ("");
script->arg_values[i].sfa_font.dialog = NULL;
app/gimpprogress.c app/nav_window.c app/ops_buttons.c app/undo_history.c 2001-12-29 Michael Natterer <mitch@gimp.org> * app/gimpprogress.c * app/nav_window.c * app/ops_buttons.c * app/undo_history.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/color-select.c * app/gui/colormap-dialog.c * app/gui/convert-dialog.c * app/gui/device-status-dialog.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-dialog.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/paths-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c * app/gui/user-install-dialog.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/selection_options.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpconstrainedhwrapbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd.c * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpfontselection-dialog.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemfactory.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch] * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.[ch] * app/widgets/gtkhwrapbox.c * app/widgets/gtkvwrapbox.c * app/widgets/gtkwrapbox.c * libgimp/gimpbrushmenu.c * libgimp/gimpexport.c * libgimp/gimpgradientmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimpwidgets/gimpbutton.c * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimphelpui.c * libgimpwidgets/gimpoffsetarea.c * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimppixmap.h * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpstock.[ch] * libgimpwidgets/gimpwidgets.h * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/bmp/bmpwrite.c * plug-ins/dbbrowser/dbbrowser_utils.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/fp/fp_misc.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/*.c * plug-ins/imagemap/*.[ch] * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print_gimp.h * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/rcm/rcm_misc.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/sgi/sgi.c * plug-ins/webbrowser/webbrowser.c * plug-ins/xjt/xjt.c * plug-ins/common/[A-n]*.c: compile with GTK_DISABLE_DEPRECATED defined. Not everything is fully ported yet, had to #undef GTK_DISABLE_DEPRECATED in many places and added #warnings when doing so. * pixmaps/Makefile.am * pixmaps/chain.xpm: removed. * themes/Default/Makefile.am * themes/Default/images/Makefile.am * themes/Default/images/stock-button-hchain-broken.png * themes/Default/images/stock-button-hchain.png * themes/Default/images/stock-button-vchain-broken.png * themes/Default/images/stock-button-vchain.png: new stock icons.
2001-12-29 21:26:29 +08:00
gtk_widget_set_size_request (sf_interface->args_widgets[i],
FONT_PREVIEW_WIDTH, -1);
gtk_container_add (GTK_CONTAINER (sf_interface->args_widgets[i]),
1998-08-10 23:06:58 +08:00
script->arg_values[i].sfa_font.preview);
gtk_widget_show (script->arg_values[i].sfa_font.preview);
script_fu_font_preview (script->arg_values[i].sfa_font.preview,
script->arg_values[i].sfa_font.fontname);
g_signal_connect (sf_interface->args_widgets[i], "clicked",
G_CALLBACK (script_fu_font_preview_callback),
&script->arg_values[i].sfa_font);
1998-08-10 23:06:58 +08:00
break;
case SF_PATTERN:
sf_interface->args_widgets[i] =
gimp_pattern_select_widget (_("Script-fu Pattern Selection"),
script->arg_values[i].sfa_pattern,
script_fu_pattern_preview,
&script->arg_values[i].sfa_pattern);
break;
case SF_GRADIENT:
sf_interface->args_widgets[i] =
gimp_gradient_select_widget (_("Script-Fu Gradient Selection"),
script->arg_values[i].sfa_gradient,
script_fu_gradient_preview,
&script->arg_values[i].sfa_gradient);
break;
case SF_BRUSH:
sf_interface->args_widgets[i] =
gimp_brush_select_widget (_("Script-Fu Brush Selection"),
script->arg_values[i].sfa_brush.name,
script->arg_values[i].sfa_brush.opacity,
script->arg_values[i].sfa_brush.spacing,
script->arg_values[i].sfa_brush.paint_mode,
script_fu_brush_preview,
&script->arg_values[i].sfa_brush);
break;
case SF_OPTION:
sf_interface->args_widgets[i] = gtk_option_menu_new ();
menu = gtk_menu_new ();
for (list = script->arg_defaults[i].sfa_option.list, j = 0;
list;
list = g_slist_next (list), j++)
{
menu_item = gtk_menu_item_new_with_label (gettext ((gchar *)list->data));
app/gimpprogress.c app/nav_window.c app/ops_buttons.c app/undo_history.c 2001-12-29 Michael Natterer <mitch@gimp.org> * app/gimpprogress.c * app/nav_window.c * app/ops_buttons.c * app/undo_history.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/color-select.c * app/gui/colormap-dialog.c * app/gui/convert-dialog.c * app/gui/device-status-dialog.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-dialog.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/paths-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c * app/gui/user-install-dialog.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/selection_options.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpconstrainedhwrapbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd.c * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpfontselection-dialog.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemfactory.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch] * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.[ch] * app/widgets/gtkhwrapbox.c * app/widgets/gtkvwrapbox.c * app/widgets/gtkwrapbox.c * libgimp/gimpbrushmenu.c * libgimp/gimpexport.c * libgimp/gimpgradientmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimpwidgets/gimpbutton.c * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimphelpui.c * libgimpwidgets/gimpoffsetarea.c * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimppixmap.h * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpstock.[ch] * libgimpwidgets/gimpwidgets.h * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/bmp/bmpwrite.c * plug-ins/dbbrowser/dbbrowser_utils.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/fp/fp_misc.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/*.c * plug-ins/imagemap/*.[ch] * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print_gimp.h * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/rcm/rcm_misc.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/sgi/sgi.c * plug-ins/webbrowser/webbrowser.c * plug-ins/xjt/xjt.c * plug-ins/common/[A-n]*.c: compile with GTK_DISABLE_DEPRECATED defined. Not everything is fully ported yet, had to #undef GTK_DISABLE_DEPRECATED in many places and added #warnings when doing so. * pixmaps/Makefile.am * pixmaps/chain.xpm: removed. * themes/Default/Makefile.am * themes/Default/images/Makefile.am * themes/Default/images/stock-button-hchain-broken.png * themes/Default/images/stock-button-hchain.png * themes/Default/images/stock-button-vchain-broken.png * themes/Default/images/stock-button-vchain.png: new stock icons.
2001-12-29 21:26:29 +08:00
g_object_set_data (G_OBJECT (menu_item), "gimp-item-data",
GUINT_TO_POINTER (j));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_show (menu_item);
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (sf_interface->args_widgets[i]),
menu);
gtk_option_menu_set_history (GTK_OPTION_MENU (sf_interface->args_widgets[i]),
script->arg_values[i].sfa_option.history);
break;
1997-11-25 06:05:25 +08:00
default:
break;
}
gimp_table_attach_aligned (GTK_TABLE (table), 0, i,
label_text, 1.0, label_yalign,
sf_interface->args_widgets[i], 1,
widget_leftalign);
g_free (label_text);
1997-11-25 06:05:25 +08:00
}
1997-11-25 06:05:25 +08:00
gtk_widget_show (table);
/* Reset to defaults */
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
gtk_widget_show (hbox);
button = gtk_button_new_from_stock (GIMP_STOCK_RESET);
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (script_fu_reset_callback),
script);
1998-08-12 03:17:23 +08:00
gtk_widget_show (vbox);
gtk_widget_show (frame);
1997-11-25 06:05:25 +08:00
gtk_widget_show (dlg);
gtk_main ();
}
static void
script_fu_interface_quit (SFScript *script)
{
gint i;
g_return_if_fail (script != NULL);
g_return_if_fail (sf_interface != NULL);
g_free (sf_interface->title);
if (sf_interface->about_dialog)
gtk_widget_destroy (sf_interface->about_dialog);
for (i = 0; i < script->num_args; i++)
switch (script->arg_types[i])
{
case SF_FONT:
if (script->arg_values[i].sfa_font.dialog != NULL)
{
gtk_widget_destroy (script->arg_values[i].sfa_font.dialog);
script->arg_values[i].sfa_font.dialog = NULL;
}
break;
case SF_PATTERN:
gimp_pattern_select_widget_close_popup (sf_interface->args_widgets[i]);
break;
case SF_GRADIENT:
gimp_gradient_select_widget_close_popup (sf_interface->args_widgets[i]);
break;
case SF_BRUSH:
gimp_brush_select_widget_close_popup (sf_interface->args_widgets[i]);
break;
default:
break;
}
g_free (sf_interface->args_widgets);
g_free (sf_interface->last_command);
g_free (sf_interface);
sf_interface = NULL;
/*
* We do not call gtk_main_quit() earlier to reduce the possibility
* that script_fu_script_proc() is called from gimp_extension_process()
* while we are not finished with the current script. This sucks!
*/
gtk_main_quit ();
1997-11-25 06:05:25 +08:00
}
static void
script_fu_pattern_preview (gchar *name,
gint width,
gint height,
gint bytes,
gchar *mask_data,
gboolean closing,
gpointer data)
{
gchar **pname;
pname = (gchar **) data;
g_free (*pname);
*pname = g_strdup (name);
}
static void
script_fu_gradient_preview (gchar *name,
gint width,
gdouble *mask_data,
gboolean closing,
gpointer data)
{
gchar **gname;
gname = (gchar **) data;
g_free (*gname);
*gname = g_strdup (name);
}
static void
script_fu_brush_preview (gchar *name,
gdouble opacity,
gint spacing,
gint paint_mode,
gint width,
gint height,
gchar *mask_data,
gboolean closing,
gpointer data)
{
SFBrush *brush;
brush = (SFBrush *) data;
g_free (brush->name);
brush->name = g_strdup (name);
brush->opacity = opacity;
brush->spacing = spacing;
brush->paint_mode = paint_mode;
}
1998-08-10 23:06:58 +08:00
static void
script_fu_font_preview (GtkWidget *preview,
gchar *data)
{
/* FIXME: here should be a check if the fontname is valid and the font is present */
gtk_label_set_text (GTK_LABEL (preview), data);
1998-08-10 23:06:58 +08:00
}
1997-11-25 06:05:25 +08:00
static void
script_fu_ok_callback (GtkWidget *widget,
gpointer data)
{
GtkWidget *menu_item;
gchar *escaped;
gchar *text = NULL;
gchar *command;
gchar *c;
guchar r, g, b;
gchar buffer[MAX_STRING_LENGTH];
gint length;
gint i;
SFScript *script = (SFScript *) data;
#if 0
GdkFont *font;
1998-08-10 23:06:58 +08:00
/* Check if choosen fonts are there */
for (i = 0; i < script->num_args; i++)
if (script->arg_types[i] == SF_FONT)
{
font = gdk_font_load (script->arg_values[i].sfa_font.fontname);
if (font == NULL)
{
g_message (_("At least one font you've choosen is invalid.\n"
"Please check your settings.\n"));
1998-08-10 23:06:58 +08:00
return;
}
else
gdk_font_unref (font);
1998-08-10 23:06:58 +08:00
}
#endif
1998-08-12 03:17:23 +08:00
1997-11-25 06:05:25 +08:00
length = strlen (script->script_name) + 3;
for (i = 0; i < script->num_args; i++)
switch (script->arg_types[i])
{
case SF_IMAGE:
case SF_DRAWABLE:
case SF_LAYER:
case SF_CHANNEL:
length += 12; /* Maximum size of integer value */
1997-11-25 06:05:25 +08:00
break;
1997-11-25 06:05:25 +08:00
case SF_COLOR:
length += 16; /* Maximum size of color string: '(XXX XXX XXX) */
break;
1997-11-25 06:05:25 +08:00
case SF_TOGGLE:
length += 6; /* Maximum size of (TRUE, FALSE) */
break;
1997-11-25 06:05:25 +08:00
case SF_VALUE:
length += strlen (gtk_entry_get_text (GTK_ENTRY (sf_interface->args_widgets[i]))) + 1;
1997-11-25 06:05:25 +08:00
break;
case SF_STRING:
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
escaped = g_strescape (gtk_entry_get_text (GTK_ENTRY (sf_interface->args_widgets[i])), NULL);
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
length += strlen (escaped) + 3;
g_free (escaped);
break;
case SF_ADJUSTMENT:
length += 24; /* Maximum size of float value */
break;
case SF_FILENAME:
case SF_DIRNAME:
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
escaped = g_strescape (script->arg_values[i].sfa_file.filename, NULL);
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
length += strlen (escaped) + 3;
g_free (escaped);
break;
1998-08-10 23:06:58 +08:00
case SF_FONT:
length += strlen (script->arg_values[i].sfa_font.fontname) + 3;
break;
case SF_PATTERN:
length += strlen (script->arg_values[i].sfa_pattern) + 3;
break;
case SF_GRADIENT:
length += strlen (script->arg_values[i].sfa_gradient) + 3;
break;
case SF_BRUSH:
length += strlen (script->arg_values[i].sfa_brush.name) + 3;
length += 36; /* Maximum size of three ints */
/* for opacity, spacing, mode */
break;
case SF_OPTION:
length += 12; /* Maximum size of integer value */
break;
1997-11-25 06:05:25 +08:00
default:
break;
}
c = command = g_new (gchar, length);
1997-11-25 06:05:25 +08:00
sprintf (command, "(%s ", script->script_name);
c += strlen (script->script_name) + 2;
for (i = 0; i < script->num_args; i++)
{
switch (script->arg_types[i])
{
case SF_IMAGE:
case SF_DRAWABLE:
case SF_LAYER:
case SF_CHANNEL:
g_snprintf (buffer, sizeof (buffer), "%d",
script->arg_values[i].sfa_image);
1997-11-25 06:05:25 +08:00
text = buffer;
break;
case SF_COLOR:
gimp_rgb_get_uchar (&script->arg_values[i].sfa_color, &r, &g, &b);
g_snprintf (buffer, sizeof (buffer), "'(%d %d %d)",
(gint) r, (gint) g, (gint) b);
1997-11-25 06:05:25 +08:00
text = buffer;
break;
1997-11-25 06:05:25 +08:00
case SF_TOGGLE:
g_snprintf (buffer, sizeof (buffer), "%s",
(script->arg_values[i].sfa_toggle) ? "TRUE" : "FALSE");
1997-11-25 06:05:25 +08:00
text = buffer;
break;
1997-11-25 06:05:25 +08:00
case SF_VALUE:
text = (gchar *) gtk_entry_get_text (GTK_ENTRY (sf_interface->args_widgets[i]));
g_free (script->arg_values[i].sfa_value);
script->arg_values[i].sfa_value = g_strdup (text);
1997-11-25 06:05:25 +08:00
break;
case SF_STRING:
text = (gchar *) gtk_entry_get_text (GTK_ENTRY (sf_interface->args_widgets[i]));
g_free (script->arg_values[i].sfa_value);
script->arg_values[i].sfa_value = g_strdup (text);
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
escaped = g_strescape (text, NULL);
g_snprintf (buffer, sizeof (buffer), "\"%s\"", escaped);
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
g_free (escaped);
text = buffer;
break;
case SF_ADJUSTMENT:
switch (script->arg_defaults[i].sfa_adjustment.type)
{
case SF_SLIDER:
script->arg_values[i].sfa_adjustment.value =
script->arg_values[i].sfa_adjustment.adj->value;
text = g_ascii_dtostr (buffer, sizeof (buffer),
script->arg_values[i].sfa_adjustment.value);
break;
case SF_SPINNER:
script->arg_values[i].sfa_adjustment.value =
app/gimpprogress.c app/nav_window.c app/ops_buttons.c app/undo_history.c 2001-12-29 Michael Natterer <mitch@gimp.org> * app/gimpprogress.c * app/nav_window.c * app/ops_buttons.c * app/undo_history.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/color-select.c * app/gui/colormap-dialog.c * app/gui/convert-dialog.c * app/gui/device-status-dialog.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-dialog.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/paths-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c * app/gui/user-install-dialog.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/selection_options.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpconstrainedhwrapbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd.c * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpfontselection-dialog.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemfactory.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch] * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.[ch] * app/widgets/gtkhwrapbox.c * app/widgets/gtkvwrapbox.c * app/widgets/gtkwrapbox.c * libgimp/gimpbrushmenu.c * libgimp/gimpexport.c * libgimp/gimpgradientmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimpwidgets/gimpbutton.c * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimphelpui.c * libgimpwidgets/gimpoffsetarea.c * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimppixmap.h * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpstock.[ch] * libgimpwidgets/gimpwidgets.h * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/bmp/bmpwrite.c * plug-ins/dbbrowser/dbbrowser_utils.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/fp/fp_misc.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/*.c * plug-ins/imagemap/*.[ch] * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print_gimp.h * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/rcm/rcm_misc.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/sgi/sgi.c * plug-ins/webbrowser/webbrowser.c * plug-ins/xjt/xjt.c * plug-ins/common/[A-n]*.c: compile with GTK_DISABLE_DEPRECATED defined. Not everything is fully ported yet, had to #undef GTK_DISABLE_DEPRECATED in many places and added #warnings when doing so. * pixmaps/Makefile.am * pixmaps/chain.xpm: removed. * themes/Default/Makefile.am * themes/Default/images/Makefile.am * themes/Default/images/stock-button-hchain-broken.png * themes/Default/images/stock-button-hchain.png * themes/Default/images/stock-button-vchain-broken.png * themes/Default/images/stock-button-vchain.png: new stock icons.
2001-12-29 21:26:29 +08:00
gtk_spin_button_get_value (GTK_SPIN_BUTTON (sf_interface->args_widgets[i]));
text = g_ascii_dtostr (buffer, sizeof (buffer),
script->arg_values[i].sfa_adjustment.value);
break;
default:
break;
}
break;
case SF_FILENAME:
case SF_DIRNAME:
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
escaped = g_strescape (script->arg_values[i].sfa_file.filename,
NULL);
g_snprintf (buffer, sizeof (buffer), "\"%s\"", escaped);
New file. * plug-ins/makefile.msc: New file. * plug-ins/*/*.c (Well, not really all files, but many): Portability fixes. Include config.h, and guard inclusion of POSIX and Unix headers like <unistd.h>, <dirent.h> and <sys/time.h>. Include <string.h> if functions from it are used. Use g_ntohl() and g_htonl() insteead of ntohl() and htonl(), thus no need to include <netinet/in.h>. Include <io.h> on Win32 when using open/read/write (which actually are defined as _open/_read/_write by glib.h). Define S_* macros if necessary on Win32. Define rint() and M_PI if necessary (these definitions should be factored out somewhere, no sense repeating them in lots of files). Open files in binary mode when needed. * plug-ins/FractalExplorer/FractalExplorer.c: Use g_malloc()/g_free(). Use g_strdup_printf(). * plug-ins/dbbrowser/dbbrowser.c: No need to include <X11/Xlib.h>. * plug-ins/destripe/destripe.c: Guard use of SIGBUS. * plug-ins/{flame/flame,hrz/hrz,pnm/pnm}.c: No need to check for NULL returns from g_malloc() and g_new() as they abort on failure. Use g_strdup_printf(). * plug-ins/gz/gz.c: Win32 version of running the subprocess. * plug-ins/hrz/hrz.c: Win32 version. Use more generic tests for non-Unix (OS/2 and Win32), for instance HAVE_MMAP. * plug-ins/script-fu/interp_slib.c: Win32 version of myruntime(). * plug-ins/script-fu/interp_sliba.c: Handle \\ (escaped backslahsh). * plug-ins/script-fu/script-fu-console.c: Bypass on Win32. * plug-ins/script-fu/script-fu-scripts.c: Portability fixes. Use g_strdup_printf() instead of separate malloc() and sprintf(). Use g_strescape() for strings being passed to Scheme. Some Win32-only stuff.
1999-05-29 09:28:24 +08:00
g_free (escaped);
text = buffer;
break;
1998-08-10 23:06:58 +08:00
case SF_FONT:
g_snprintf (buffer, sizeof (buffer), "\"%s\"",
script->arg_values[i].sfa_font.fontname);
1998-08-10 23:06:58 +08:00
text = buffer;
break;
case SF_PATTERN:
g_snprintf (buffer, sizeof (buffer), "\"%s\"",
script->arg_values[i].sfa_pattern);
text = buffer;
break;
case SF_GRADIENT:
g_snprintf (buffer, sizeof (buffer), "\"%s\"",
script->arg_values[i].sfa_gradient);
text = buffer;
break;
case SF_BRUSH:
{
gchar opacity[G_ASCII_DTOSTR_BUF_SIZE];
g_ascii_dtostr (opacity, sizeof (opacity),
script->arg_values[i].sfa_brush.opacity);
g_snprintf (buffer, sizeof (buffer), "'(\"%s\" %s %d %d)",
script->arg_values[i].sfa_brush.name,
opacity,
script->arg_values[i].sfa_brush.spacing,
script->arg_values[i].sfa_brush.paint_mode);
text = buffer;
}
break;
case SF_OPTION:
menu_item =
gtk_menu_get_active (GTK_MENU (gtk_option_menu_get_menu (GTK_OPTION_MENU (sf_interface->args_widgets[i]))));
script->arg_values[i].sfa_option.history =
app/gimpprogress.c app/nav_window.c app/ops_buttons.c app/undo_history.c 2001-12-29 Michael Natterer <mitch@gimp.org> * app/gimpprogress.c * app/nav_window.c * app/ops_buttons.c * app/undo_history.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/color-select.c * app/gui/colormap-dialog.c * app/gui/convert-dialog.c * app/gui/device-status-dialog.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-dialog.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/paths-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c * app/gui/user-install-dialog.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/selection_options.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpconstrainedhwrapbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd.c * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpfontselection-dialog.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemfactory.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch] * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.[ch] * app/widgets/gtkhwrapbox.c * app/widgets/gtkvwrapbox.c * app/widgets/gtkwrapbox.c * libgimp/gimpbrushmenu.c * libgimp/gimpexport.c * libgimp/gimpgradientmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimpwidgets/gimpbutton.c * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimphelpui.c * libgimpwidgets/gimpoffsetarea.c * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimppixmap.h * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpstock.[ch] * libgimpwidgets/gimpwidgets.h * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/bmp/bmpwrite.c * plug-ins/dbbrowser/dbbrowser_utils.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/fp/fp_misc.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/*.c * plug-ins/imagemap/*.[ch] * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print_gimp.h * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/rcm/rcm_misc.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/sgi/sgi.c * plug-ins/webbrowser/webbrowser.c * plug-ins/xjt/xjt.c * plug-ins/common/[A-n]*.c: compile with GTK_DISABLE_DEPRECATED defined. Not everything is fully ported yet, had to #undef GTK_DISABLE_DEPRECATED in many places and added #warnings when doing so. * pixmaps/Makefile.am * pixmaps/chain.xpm: removed. * themes/Default/Makefile.am * themes/Default/images/Makefile.am * themes/Default/images/stock-button-hchain-broken.png * themes/Default/images/stock-button-hchain.png * themes/Default/images/stock-button-vchain-broken.png * themes/Default/images/stock-button-vchain.png: new stock icons.
2001-12-29 21:26:29 +08:00
GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (menu_item),
"gimp-item-data"));
g_snprintf (buffer, sizeof (buffer), "%d",
script->arg_values[i].sfa_option.history);
text = buffer;
break;
1997-11-25 06:05:25 +08:00
default:
break;
}
if (i == script->num_args - 1)
sprintf (c, "%s)", text);
else
sprintf (c, "%s ", text);
c += strlen (text) + 1;
}
/* run the command through the interpreter */
if (repl_c_string (command, 0, 0, 1) != 0)
script_fu_error_msg (command);
1997-11-25 06:05:25 +08:00
g_free (command);
gtk_widget_destroy (sf_interface->dialog);
1997-11-25 06:05:25 +08:00
}
1998-08-12 03:17:23 +08:00
static void
script_fu_about_callback (GtkWidget *widget,
gpointer data)
{
GtkWidget *dialog;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *scrolled_window;
GtkWidget *table;
GtkWidget *text_view;
GtkTextBuffer *text_buffer;
1998-08-12 03:17:23 +08:00
SFScript *script = (SFScript *) data;
if (sf_interface->about_dialog == NULL)
1998-08-12 03:17:23 +08:00
{
dialog = gimp_dialog_new (sf_interface->title, "script-fu-about",
gimp_standard_help_func,
"filters/script-fu.html",
GTK_WIN_POS_MOUSE,
FALSE, TRUE, FALSE,
2001-08-04 03:52:08 +08:00
GTK_STOCK_CLOSE, gtk_widget_destroy, NULL,
1, NULL, TRUE, TRUE,
NULL);
sf_interface->about_dialog = dialog;
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&sf_interface->about_dialog);
1998-08-12 03:17:23 +08:00
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_set_border_width (GTK_CONTAINER (frame), 2);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), frame,
TRUE, TRUE, 0);
1998-08-12 03:17:23 +08:00
gtk_widget_show (frame);
vbox = gtk_vbox_new (FALSE, 0);
1998-08-12 03:17:23 +08:00
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
1998-08-12 03:17:23 +08:00
/* the name */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
label = gtk_label_new (script->script_name);
gtk_misc_set_padding (GTK_MISC (label), 2, 2);
gtk_container_add (GTK_CONTAINER (frame), label);
1998-08-12 03:17:23 +08:00
gtk_widget_show (label);
/* the help display */
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 4);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0);
gtk_widget_show (scrolled_window);
text_buffer = gtk_text_buffer_new (NULL);
text_view = gtk_text_view_new_with_buffer (text_buffer);
g_object_unref (text_buffer);
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
gtk_widget_set_size_request (text_view, 240, 120);
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
gtk_widget_show (text_view);
gtk_text_buffer_set_text (text_buffer, script->help, -1);
1998-08-12 03:17:23 +08:00
/* author, copyright, etc. */
table = gtk_table_new (2, 4, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
1998-08-12 03:17:23 +08:00
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
label = gtk_label_new (script->author);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Author:"), 1.0, 0.5,
label, 1, FALSE);
1998-08-12 03:17:23 +08:00
label = gtk_label_new (script->copyright);
1998-08-12 03:17:23 +08:00
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Copyright:"), 1.0, 0.5,
label, 1, FALSE);
1998-08-12 03:17:23 +08:00
label = gtk_label_new (script->date);
1998-08-12 03:17:23 +08:00
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Date:"), 1.0, 0.5,
label, 1, FALSE);
if (strlen (script->img_types) > 0)
1998-08-12 03:17:23 +08:00
{
label = gtk_label_new (script->img_types);
1998-08-12 03:17:23 +08:00
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("Image Types:"), 1.0, 0.5,
label, 1, FALSE);
1998-08-12 03:17:23 +08:00
}
}
gtk_widget_show (sf_interface->about_dialog);
1998-08-12 03:17:23 +08:00
}
static void
script_fu_reset_callback (GtkWidget *widget,
gpointer data)
{
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
gint i;
SFScript *script = (SFScript *) data;
for (i = 0; i < script->num_args; i++)
switch (script->arg_types[i])
{
case SF_IMAGE:
case SF_DRAWABLE:
case SF_LAYER:
case SF_CHANNEL:
break;
case SF_COLOR:
script->arg_values[i].sfa_color = script->arg_defaults[i].sfa_color;
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
gimp_color_button_set_color (GIMP_COLOR_BUTTON (sf_interface->args_widgets[i]),
&script->arg_values[i].sfa_color);
break;
case SF_TOGGLE:
script->arg_values[i].sfa_toggle = script->arg_defaults[i].sfa_toggle;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sf_interface->args_widgets[i]),
script->arg_values[i].sfa_toggle);
break;
case SF_VALUE:
case SF_STRING:
g_free (script->arg_values[i].sfa_value);
script->arg_values[i].sfa_value =
g_strdup (script->arg_defaults[i].sfa_value);
gtk_entry_set_text (GTK_ENTRY (sf_interface->args_widgets[i]),
script->arg_values[i].sfa_value);
break;
case SF_ADJUSTMENT:
script->arg_values[i].sfa_adjustment.value =
script->arg_defaults[i].sfa_adjustment.value;
gtk_adjustment_set_value (script->arg_values[i].sfa_adjustment.adj,
script->arg_values[i].sfa_adjustment.value);
break;
case SF_FILENAME:
case SF_DIRNAME:
g_free (script->arg_values[i].sfa_file.filename);
script->arg_values[i].sfa_file.filename =
g_strdup (script->arg_defaults[i].sfa_file.filename);
gimp_file_selection_set_filename
(GIMP_FILE_SELECTION (script->arg_values[i].sfa_file.fileselection),
script->arg_values[i].sfa_file.filename);
break;
1998-08-10 23:06:58 +08:00
case SF_FONT:
g_free (script->arg_values[i].sfa_font.fontname);
script->arg_values[i].sfa_font.fontname =
g_strdup (script->arg_defaults[i].sfa_font.fontname);
1998-08-10 23:06:58 +08:00
if (script->arg_values[i].sfa_font.dialog)
{
gtk_font_selection_dialog_set_font_name
(GTK_FONT_SELECTION_DIALOG (script->arg_values[i].sfa_font.dialog),
script->arg_values[i].sfa_font.fontname);
1998-08-10 23:06:58 +08:00
}
script_fu_font_preview (script->arg_values[i].sfa_font.preview,
script->arg_values[i].sfa_font.fontname);
break;
case SF_PATTERN:
gimp_pattern_select_widget_set_popup
(sf_interface->args_widgets[i], script->arg_defaults[i].sfa_pattern);
break;
case SF_GRADIENT:
gimp_gradient_select_widget_set_popup
(sf_interface->args_widgets[i], script->arg_defaults[i].sfa_gradient);
break;
case SF_BRUSH:
gimp_brush_select_widget_set_popup
(sf_interface->args_widgets[i],
script->arg_defaults[i].sfa_brush.name,
script->arg_defaults[i].sfa_brush.opacity,
script->arg_defaults[i].sfa_brush.spacing,
script->arg_defaults[i].sfa_brush.paint_mode);
break;
case SF_OPTION:
script->arg_values[i].sfa_option.history =
script->arg_defaults[i].sfa_option.history;
gtk_option_menu_set_history (GTK_OPTION_MENU (sf_interface->args_widgets[i]),
script->arg_values[i].sfa_option.history);
default:
break;
}
}
1997-11-25 06:05:25 +08:00
static void
script_fu_menu_callback (gint32 id,
gpointer data)
1997-11-25 06:05:25 +08:00
{
*((gint32 *) data) = id;
}
static void
1999-05-19 01:33:39 +08:00
script_fu_file_selection_callback (GtkWidget *widget,
gpointer data)
{
SFFilename *file;
file = (SFFilename *) data;
1999-05-19 01:33:39 +08:00
if (file->filename)
g_free (file->filename);
file->filename =
gimp_file_selection_get_filename (GIMP_FILE_SELECTION (file->fileselection));
}
1998-08-10 23:06:58 +08:00
static void
script_fu_font_preview_callback (GtkWidget *widget,
gpointer data)
{
GtkFontSelectionDialog *fsd;
SFFont *font;
1998-08-10 23:06:58 +08:00
font = (SFFont *) data;
if (! font->dialog)
1998-08-10 23:06:58 +08:00
{
font->dialog =
gtk_font_selection_dialog_new (_("Script-Fu Font Selection"));
1998-08-10 23:06:58 +08:00
fsd = GTK_FONT_SELECTION_DIALOG (font->dialog);
g_signal_connect (fsd->ok_button, "clicked",
G_CALLBACK (script_fu_font_dialog_ok),
font);
g_signal_connect (fsd, "delete_event",
G_CALLBACK (script_fu_font_dialog_delete),
font);
g_signal_connect (fsd, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&font->dialog);
g_signal_connect (fsd->cancel_button, "clicked",
G_CALLBACK (script_fu_font_dialog_cancel),
font);
1998-08-10 23:06:58 +08:00
}
else
{
fsd = GTK_FONT_SELECTION_DIALOG (font->dialog);
}
1998-08-10 23:06:58 +08:00
gtk_font_selection_dialog_set_font_name (fsd, font->fontname);
added -DGTK_DISABLE_COMPAT_H to CPPFLAGS. 2000-08-28 Michael Natterer <mitch@gimp.org> * configure.in: added -DGTK_DISABLE_COMPAT_H to CPPFLAGS. * app/app_procs.c * app/gdisplay.c * app/layers_dialog.c * app/menus.c * app/tips_dialog.c * libgimp/gimpcolorbutton.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/bmp/bmpwrite.c * plug-ins/common/AlienMap.c * plug-ins/common/AlienMap2.c * plug-ins/common/CML_explorer.c * plug-ins/common/animationplay.c * plug-ins/common/cubism.c * plug-ins/common/curve_bend.c * plug-ins/common/deinterlace.c * plug-ins/common/gee.c * plug-ins/common/glasstile.c * plug-ins/common/iwarp.c * plug-ins/common/mail.c * plug-ins/common/pat.c * plug-ins/common/pixelize.c * plug-ins/common/plugindetails.c * plug-ins/common/png.c * plug-ins/common/sample_colorize.c * plug-ins/common/sel_gauss.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/spheredesigner.c * plug-ins/common/tga.c * plug-ins/common/tileit.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/waves.c * plug-ins/common/wmf.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/gap/gap_arr_dialog.c * plug-ins/gap/gap_dbbrowser_utils.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gap/gap_resi_dialog.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/gfig/gfig.c * plug-ins/gimpressionist/brush.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/gimp_main_window.c * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/xjt/xjt.c: removed COMPAT_CRUFT.
2000-08-28 08:42:32 +08:00
gtk_window_set_position (GTK_WINDOW (font->dialog), GTK_WIN_POS_MOUSE);
1998-08-10 23:06:58 +08:00
gtk_widget_show (font->dialog);
}
static void
script_fu_font_dialog_ok (GtkWidget *widget,
gpointer data)
1998-08-10 23:06:58 +08:00
{
SFFont *font;
gchar *fontname;
font = (SFFont *) data;
fontname =
gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (font->dialog));
1998-08-10 23:06:58 +08:00
if (fontname != NULL)
{
g_free (font->fontname);
font->fontname = fontname;
}
1998-08-12 03:17:23 +08:00
gtk_widget_hide (font->dialog);
1998-08-10 23:06:58 +08:00
script_fu_font_preview (font->preview, font->fontname);
}
static void
script_fu_font_dialog_cancel (GtkWidget *widget,
gpointer data)
1998-08-10 23:06:58 +08:00
{
SFFont *font;
font = (SFFont *) data;
1998-08-12 03:17:23 +08:00
gtk_widget_hide (font->dialog);
1998-08-10 23:06:58 +08:00
}
static gboolean
1998-08-10 23:06:58 +08:00
script_fu_font_dialog_delete (GtkWidget *widget,
GdkEvent *event,
gpointer data)
1998-08-10 23:06:58 +08:00
{
script_fu_font_dialog_cancel (widget, data);
return TRUE;
}
1998-08-12 03:17:23 +08:00
static void
script_fu_error_msg (gchar *command)
1998-08-12 03:17:23 +08:00
{
g_message (_("Script-Fu Error while executing\n %s\n%s"),
command, siod_err_msg);
1998-08-12 03:17:23 +08:00
}