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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-07-16 20:49:04 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "config.h"
|
1999-03-07 20:56:03 +08:00
|
|
|
|
1999-06-22 04:04:04 +08:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
|
|
|
#include <sys/param.h>
|
|
|
|
#endif
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
1999-06-15 06:18:02 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <errno.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#ifdef HAVE_SYS_WAIT_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <sys/wait.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_TIME_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <sys/time.h>
|
1999-03-07 21:23:06 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <time.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#ifdef HAVE_UNISTD_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <unistd.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
|
|
|
|
1999-10-07 05:27:18 +08:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
1999-03-07 20:56:03 +08:00
|
|
|
#define STRICT
|
|
|
|
#include <windows.h>
|
|
|
|
#include <process.h>
|
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifdef G_OS_WIN32
|
1999-03-07 20:56:03 +08:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <io.h>
|
2001-05-17 02:09:45 +08:00
|
|
|
#ifndef S_ISREG
|
|
|
|
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
|
|
|
#endif
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
|
|
|
|
1999-10-07 05:27:18 +08:00
|
|
|
#ifdef G_WITH_CYGWIN
|
1999-03-07 20:56:03 +08:00
|
|
|
#define O_TEXT 0x0100 /* text file */
|
|
|
|
#define _O_TEXT 0x0100 /* text file */
|
|
|
|
#define O_BINARY 0x0200 /* binary file */
|
|
|
|
#define _O_BINARY 0x0200 /* binary file */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
1999-04-25 03:12:12 +08:00
|
|
|
#ifdef __EMX__
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <process.h>
|
|
|
|
#define _O_BINARY O_BINARY
|
|
|
|
#define _P_NOWAIT P_NOWAIT
|
2000-08-06 21:37:05 +08:00
|
|
|
#define xspawnv spawnv
|
1999-04-25 03:12:12 +08:00
|
|
|
#endif
|
|
|
|
|
1998-08-29 07:01:46 +08:00
|
|
|
#ifdef HAVE_IPC_H
|
|
|
|
#include <sys/ipc.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SHM_H
|
|
|
|
#include <sys/shm.h>
|
|
|
|
#endif
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
#include "libgimpbase/gimpprotocol.h"
|
|
|
|
#include "libgimpbase/gimpwire.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/display-types.h"
|
2001-05-22 04:30:16 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
#include "base/tile.h"
|
|
|
|
#include "base/tile-manager.h"
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
#include "core/gimp.h"
|
2001-07-07 20:17:23 +08:00
|
|
|
#include "core/gimpcoreconfig.h"
|
2001-07-10 03:48:30 +08:00
|
|
|
#include "core/gimpdatafiles.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
#include "core/gimpimage.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "gui/brush-select.h"
|
|
|
|
#include "gui/gradient-select.h"
|
|
|
|
#include "gui/menus.h"
|
|
|
|
#include "gui/pattern-select.h"
|
|
|
|
|
1998-01-20 08:12:21 +08:00
|
|
|
#include "app_procs.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "appenv.h"
|
2000-07-16 20:49:04 +08:00
|
|
|
#include "errors.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "gimpprogress.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimprc.h"
|
|
|
|
#include "plug_in.h"
|
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
typedef struct _PlugInBlocked PlugInBlocked;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
struct _PlugInBlocked
|
|
|
|
{
|
|
|
|
PlugIn *plug_in;
|
2000-02-25 00:11:26 +08:00
|
|
|
gchar *proc_name;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-05-08 06:04:51 +08:00
|
|
|
typedef struct _PlugInMenuEntry PlugInMenuEntry;
|
|
|
|
|
|
|
|
struct _PlugInMenuEntry
|
|
|
|
{
|
|
|
|
PlugInProcDef *proc_def;
|
|
|
|
gchar *domain;
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
gchar *help_path;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _PlugInHelpPathDef PlugInHelpPathDef;
|
|
|
|
|
|
|
|
struct _PlugInHelpPathDef
|
|
|
|
{
|
|
|
|
gchar *prog_name;
|
|
|
|
gchar *help_path;
|
2000-05-08 06:04:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-02-25 00:11:26 +08:00
|
|
|
static gboolean plug_in_write (GIOChannel *channel,
|
1997-11-25 06:05:25 +08:00
|
|
|
guint8 *buf,
|
|
|
|
gulong count);
|
2000-02-25 00:11:26 +08:00
|
|
|
static gboolean plug_in_flush (GIOChannel *channel);
|
|
|
|
static void plug_in_push (PlugIn *plug_in);
|
|
|
|
static void plug_in_pop (void);
|
1999-03-07 20:56:03 +08:00
|
|
|
static gboolean plug_in_recv_message (GIOChannel *channel,
|
|
|
|
GIOCondition cond,
|
|
|
|
gpointer data);
|
1997-11-25 06:05:25 +08:00
|
|
|
static void plug_in_handle_message (WireMessage *msg);
|
|
|
|
static void plug_in_handle_quit (void);
|
|
|
|
static void plug_in_handle_tile_req (GPTileReq *tile_req);
|
|
|
|
static void plug_in_handle_proc_run (GPProcRun *proc_run);
|
|
|
|
static void plug_in_handle_proc_return (GPProcReturn *proc_return);
|
|
|
|
static void plug_in_handle_proc_install (GPProcInstall *proc_install);
|
|
|
|
static void plug_in_handle_proc_uninstall (GPProcUninstall *proc_uninstall);
|
2001-01-14 11:55:56 +08:00
|
|
|
static void plug_in_write_rc (const gchar *filename);
|
2001-02-12 00:14:25 +08:00
|
|
|
static void plug_in_init_file (const gchar *filename,
|
|
|
|
gpointer loader_data);
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
static void plug_in_query (PlugInDef *plug_in_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
static void plug_in_add_to_db (void);
|
|
|
|
static void plug_in_make_menu (void);
|
2000-05-08 06:04:51 +08:00
|
|
|
static gint plug_in_make_menu_entry (gpointer foo,
|
|
|
|
PlugInMenuEntry *menu_entry,
|
|
|
|
gpointer bar);
|
1997-11-25 06:05:25 +08:00
|
|
|
static void plug_in_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data);
|
1999-02-14 09:53:23 +08:00
|
|
|
static void plug_in_proc_def_insert (PlugInProcDef *proc_def,
|
2000-07-16 20:49:04 +08:00
|
|
|
void (* superceed_fn) (void *));
|
|
|
|
static void plug_in_proc_def_dead (void *freed_proc_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
static void plug_in_proc_def_remove (PlugInProcDef *proc_def);
|
|
|
|
static void plug_in_proc_def_destroy (PlugInProcDef *proc_def,
|
2000-02-25 00:11:26 +08:00
|
|
|
gboolean data_only);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
static Argument * plug_in_temp_run (ProcRecord *proc_rec,
|
|
|
|
Argument *args,
|
|
|
|
gint argc);
|
|
|
|
static Argument * plug_in_params_to_args (GPParam *params,
|
|
|
|
gint nparams,
|
|
|
|
gboolean full_copy);
|
|
|
|
static GPParam * plug_in_args_to_params (Argument *args,
|
|
|
|
gint nargs,
|
|
|
|
gboolean full_copy);
|
|
|
|
static void plug_in_params_destroy (GPParam *params,
|
|
|
|
gint nparams,
|
|
|
|
gboolean full_destroy);
|
|
|
|
static void plug_in_args_destroy (Argument *args,
|
|
|
|
gint nargs,
|
|
|
|
gboolean full_destroy);
|
|
|
|
static void plug_in_init_shm (void);
|
|
|
|
|
2001-05-17 02:09:45 +08:00
|
|
|
static gchar * plug_in_search_in_path (gchar *search_path,
|
|
|
|
gchar *filename);
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
1999-05-04 03:22:58 +08:00
|
|
|
PlugIn *current_plug_in = NULL;
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
GSList *proc_defs = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
static GSList *plug_in_defs = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
static GSList *gimprc_proc_defs = NULL;
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
static GSList *open_plug_ins = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
static GSList *blocked_plug_ins = NULL;
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
static GSList *help_path_defs = NULL;
|
|
|
|
|
|
|
|
static GSList *plug_in_stack = NULL;
|
|
|
|
static GIOChannel *current_readchannel = NULL;
|
|
|
|
static GIOChannel *current_writechannel = NULL;
|
2000-05-17 20:29:38 +08:00
|
|
|
static gint current_write_buffer_index = 0;
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
static gchar *current_write_buffer = NULL;
|
|
|
|
static Argument *current_return_vals = NULL;
|
|
|
|
static gint current_return_nvals = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static ProcRecord *last_plug_in = NULL;
|
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
static gint shm_ID = -1;
|
1997-11-25 06:05:25 +08:00
|
|
|
static guchar *shm_addr = NULL;
|
|
|
|
|
1999-10-07 05:27:18 +08:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
1999-03-07 20:56:03 +08:00
|
|
|
static HANDLE shm_handle;
|
|
|
|
#endif
|
|
|
|
|
2000-02-25 00:11:26 +08:00
|
|
|
static gboolean write_pluginrc = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-02-24 07:21:31 +08:00
|
|
|
static gchar *std_plugins_domain = "gimp-std-plugins";
|
1999-05-07 04:56:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_init_shm (void)
|
|
|
|
{
|
|
|
|
/* allocate a piece of shared memory for use in transporting tiles
|
|
|
|
* to plug-ins. if we can't allocate a piece of shared memory then
|
|
|
|
* we'll fall back on sending the data over the pipe.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_SHM_H
|
|
|
|
shm_ID = shmget (IPC_PRIVATE, TILE_WIDTH * TILE_HEIGHT * 4, IPC_CREAT | 0777);
|
|
|
|
|
|
|
|
if (shm_ID == -1)
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("shmget() failed: Disabling shared memory tile transport.");
|
1999-05-07 04:56:07 +08:00
|
|
|
else
|
|
|
|
{
|
2000-04-11 23:24:15 +08:00
|
|
|
shm_addr = (guchar *) shmat (shm_ID, NULL, 0);
|
|
|
|
if (shm_addr == (guchar *) -1)
|
1999-05-07 04:56:07 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("shmat() failed: Disabling shared memory tile transport.");
|
2000-04-11 23:24:15 +08:00
|
|
|
shmctl (shm_ID, IPC_RMID, NULL);
|
1999-05-07 04:56:07 +08:00
|
|
|
shm_ID = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef IPC_RMID_DEFERRED_RELEASE
|
2000-04-11 23:24:15 +08:00
|
|
|
if (shm_addr != (guchar *) -1)
|
|
|
|
shmctl (shm_ID, IPC_RMID, NULL);
|
1999-05-07 04:56:07 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#else
|
1999-10-07 05:27:18 +08:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
1999-05-07 04:56:07 +08:00
|
|
|
/* Use Win32 shared memory mechanisms for
|
|
|
|
* transfering tile data.
|
|
|
|
*/
|
2000-05-17 20:29:38 +08:00
|
|
|
gint pid;
|
|
|
|
gchar fileMapName[MAX_PATH];
|
|
|
|
gint tileByteSize = TILE_WIDTH * TILE_HEIGHT * 4;
|
1999-05-07 04:56:07 +08:00
|
|
|
|
|
|
|
/* Our shared memory id will be our process ID */
|
|
|
|
pid = GetCurrentProcessId ();
|
|
|
|
|
|
|
|
/* From the id, derive the file map name */
|
2000-07-16 20:49:04 +08:00
|
|
|
g_snprintf (fileMapName, sizeof (fileMapName), "GIMP%d.SHM", pid);
|
|
|
|
|
1999-05-07 04:56:07 +08:00
|
|
|
/* Create the file mapping into paging space */
|
|
|
|
shm_handle = CreateFileMapping ((HANDLE) 0xFFFFFFFF, NULL,
|
|
|
|
PAGE_READWRITE, 0,
|
|
|
|
tileByteSize, fileMapName);
|
|
|
|
|
|
|
|
if (shm_handle)
|
|
|
|
{
|
|
|
|
/* Map the shared memory into our address space for use */
|
|
|
|
shm_addr = (guchar *) MapViewOfFile(shm_handle,
|
2000-04-11 23:24:15 +08:00
|
|
|
FILE_MAP_ALL_ACCESS,
|
1999-05-07 04:56:07 +08:00
|
|
|
0, 0, tileByteSize);
|
|
|
|
|
|
|
|
/* Verify that we mapped our view */
|
|
|
|
if (shm_addr)
|
|
|
|
shm_ID = pid;
|
2000-04-11 23:24:15 +08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("MapViewOfFile error: %d... disabling shared memory transport\n", GetLastError());
|
|
|
|
}
|
1999-05-07 04:56:07 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("CreateFileMapping error: %d... disabling shared memory transport\n", GetLastError());
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-05-04 03:22:58 +08:00
|
|
|
plug_in_init (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
extern gboolean use_shm;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
|
|
|
gchar *filename;
|
|
|
|
GSList *tmp;
|
|
|
|
GSList *tmp2;
|
2000-05-17 20:29:38 +08:00
|
|
|
PlugInDef *plug_in_def;
|
1997-11-25 06:05:25 +08:00
|
|
|
PlugInProcDef *proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
gfloat nplugins;
|
|
|
|
gfloat nth;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* initialize the gimp protocol library and set the read and
|
|
|
|
* write handlers.
|
|
|
|
*/
|
|
|
|
gp_init ();
|
|
|
|
wire_set_writer (plug_in_write);
|
|
|
|
wire_set_flusher (plug_in_flush);
|
|
|
|
|
|
|
|
/* allocate a piece of shared memory for use in transporting tiles
|
|
|
|
* to plug-ins. if we can't allocate a piece of shared memory then
|
|
|
|
* we'll fall back on sending the data over the pipe.
|
|
|
|
*/
|
|
|
|
if (use_shm)
|
2000-07-16 20:49:04 +08:00
|
|
|
plug_in_init_shm ();
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* search for binaries in the plug-in directory path */
|
2001-09-19 22:42:35 +08:00
|
|
|
gimp_datafiles_read_directories (the_gimp->config->plug_in_path,
|
|
|
|
MODE_EXECUTABLE,
|
2001-05-10 06:34:59 +08:00
|
|
|
plug_in_init_file, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* read the pluginrc file for cached data */
|
1999-03-07 20:56:03 +08:00
|
|
|
filename = NULL;
|
2001-07-11 20:39:49 +08:00
|
|
|
if (the_gimp->config->pluginrc_path)
|
1998-04-11 13:07:52 +08:00
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
if (g_path_is_absolute (the_gimp->config->pluginrc_path))
|
|
|
|
filename = g_strdup (the_gimp->config->pluginrc_path);
|
1998-04-11 13:07:52 +08:00
|
|
|
else
|
1999-03-07 20:56:03 +08:00
|
|
|
filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s",
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_directory (),
|
2001-07-11 20:39:49 +08:00
|
|
|
the_gimp->config->pluginrc_path);
|
1998-04-11 13:07:52 +08:00
|
|
|
}
|
|
|
|
else
|
1999-03-07 20:56:03 +08:00
|
|
|
filename = gimp_personal_rc_file ("pluginrc");
|
1998-04-11 13:07:52 +08:00
|
|
|
|
2000-02-24 02:07:53 +08:00
|
|
|
app_init_update_status (_("Resource configuration"), filename, -1);
|
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
|
|
|
gimprc_parse_file (filename);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* query any plug-ins that have changed since we last wrote out
|
|
|
|
* the pluginrc file.
|
|
|
|
*/
|
|
|
|
tmp = plug_in_defs;
|
2000-02-24 02:07:53 +08:00
|
|
|
app_init_update_status (_("Plug-ins"), "", 0);
|
|
|
|
nplugins = g_slist_length (tmp);
|
1998-01-20 08:12:21 +08:00
|
|
|
nth = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
plug_in_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (plug_in_def->query)
|
|
|
|
{
|
|
|
|
write_pluginrc = TRUE;
|
2000-08-15 23:42:14 +08:00
|
|
|
|
|
|
|
if (be_verbose)
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_print (_("query plug-in: \"%s\"\n"), plug_in_def->prog);
|
2000-08-15 23:42:14 +08:00
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in_query (plug_in_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2000-08-15 23:42:14 +08:00
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
app_init_update_status (NULL, plug_in_def->prog, nth / nplugins);
|
1998-01-20 08:12:21 +08:00
|
|
|
nth++;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* insert the proc defs */
|
2000-05-11 05:21:23 +08:00
|
|
|
for (tmp = gimprc_proc_defs; tmp; tmp = g_slist_next (tmp))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
proc_def = g_new (PlugInProcDef, 1);
|
|
|
|
*proc_def = *((PlugInProcDef*) tmp->data);
|
1999-02-14 09:53:23 +08:00
|
|
|
plug_in_proc_def_insert (proc_def, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
tmp = plug_in_defs;
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
plug_in_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
tmp2 = plug_in_def->proc_defs;
|
|
|
|
while (tmp2)
|
|
|
|
{
|
|
|
|
proc_def = tmp2->data;
|
|
|
|
tmp2 = tmp2->next;
|
|
|
|
|
1999-01-31 09:08:26 +08:00
|
|
|
proc_def->mtime = plug_in_def->mtime;
|
1999-02-14 09:53:23 +08:00
|
|
|
plug_in_proc_def_insert (proc_def, plug_in_proc_def_dead);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* write the pluginrc file if necessary */
|
|
|
|
if (write_pluginrc)
|
|
|
|
{
|
2000-08-15 23:42:14 +08:00
|
|
|
if (be_verbose)
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_print (_("writing \"%s\"\n"), filename);
|
2000-08-15 23:42:14 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc (filename);
|
|
|
|
}
|
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
g_free (filename);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* add the plug-in procs to the procedure database */
|
|
|
|
plug_in_add_to_db ();
|
|
|
|
|
|
|
|
/* make the menu */
|
|
|
|
plug_in_make_menu ();
|
|
|
|
|
|
|
|
/* run the available extensions */
|
2000-08-15 23:42:14 +08:00
|
|
|
if (be_verbose)
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_print (_("Starting extensions: "));
|
2000-08-15 23:42:14 +08:00
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
app_init_update_status (_("Extensions"), "", 0);
|
2000-08-15 23:42:14 +08:00
|
|
|
|
|
|
|
tmp = proc_defs;
|
2000-05-17 20:29:38 +08:00
|
|
|
nplugins = g_slist_length (tmp); nth = 0;
|
1998-01-26 06:13:00 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (proc_def->prog &&
|
|
|
|
(proc_def->db_info.num_args == 0) &&
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_def->db_info.proc_type == GIMP_EXTENSION))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-08-15 23:42:14 +08:00
|
|
|
if (be_verbose)
|
1998-03-26 05:36:59 +08:00
|
|
|
g_print ("%s ", proc_def->db_info.name);
|
2000-08-15 23:42:14 +08:00
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
app_init_update_status (NULL, proc_def->db_info.name,
|
|
|
|
nth / nplugins);
|
1998-01-26 06:13:00 +08:00
|
|
|
|
1998-10-22 03:10:14 +08:00
|
|
|
plug_in_run (&proc_def->db_info, NULL, 0, FALSE, TRUE, -1);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
2000-08-15 23:42:14 +08:00
|
|
|
|
|
|
|
if (be_verbose)
|
1998-03-26 05:36:59 +08:00
|
|
|
g_print ("\n");
|
1997-11-25 06:05:25 +08:00
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
/* create help path list and free up stuff */
|
2000-05-11 05:21:23 +08:00
|
|
|
for (tmp = plug_in_defs; tmp; tmp = g_slist_next (tmp))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
plug_in_def = tmp->data;
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
if (plug_in_def->help_path)
|
|
|
|
{
|
|
|
|
PlugInHelpPathDef *help_path_def;
|
|
|
|
|
|
|
|
help_path_def = g_new (PlugInHelpPathDef, 1);
|
|
|
|
|
|
|
|
help_path_def->prog_name = g_strdup (plug_in_def->prog);
|
|
|
|
help_path_def->help_path = g_strdup (plug_in_def->help_path);
|
|
|
|
|
|
|
|
help_path_defs = g_slist_prepend (help_path_defs, help_path_def);
|
|
|
|
}
|
|
|
|
|
2000-02-24 06:31:26 +08:00
|
|
|
plug_in_def_free (plug_in_def, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
g_slist_free (plug_in_defs);
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in_defs = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-05-04 03:22:58 +08:00
|
|
|
plug_in_kill (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
PlugIn *plug_in;
|
|
|
|
|
1999-10-07 05:27:18 +08:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
1999-03-07 20:56:03 +08:00
|
|
|
CloseHandle (shm_handle);
|
|
|
|
#else
|
1998-08-29 07:01:46 +08:00
|
|
|
#ifdef HAVE_SHM_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#ifndef IPC_RMID_DEFERRED_RELEASE
|
|
|
|
if (shm_ID != -1)
|
|
|
|
{
|
2000-04-11 23:24:15 +08:00
|
|
|
shmdt ((gchar *) shm_addr);
|
|
|
|
shmctl (shm_ID, IPC_RMID, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
#else /* IPC_RMID_DEFERRED_RELEASE */
|
|
|
|
if (shm_ID != -1)
|
2000-04-11 23:24:15 +08:00
|
|
|
shmdt ((gchar *) shm_addr);
|
1997-11-25 06:05:25 +08:00
|
|
|
#endif
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
1998-08-29 07:01:46 +08:00
|
|
|
#endif
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
tmp = open_plug_ins;
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
plug_in = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
plug_in_destroy (plug_in);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_add (gchar *prog,
|
|
|
|
gchar *menu_path,
|
|
|
|
gchar *accelerator)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
PlugInProcDef *proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-14 23:18:37 +08:00
|
|
|
g_return_if_fail (prog != NULL);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (strncmp ("plug_in_", prog, 8) != 0)
|
|
|
|
{
|
2000-02-25 00:11:26 +08:00
|
|
|
gchar *t = g_strdup_printf ("plug_in_%s", prog);
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (prog);
|
|
|
|
prog = t;
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp = gimprc_proc_defs;
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, prog) == 0)
|
|
|
|
{
|
|
|
|
if (proc_def->db_info.name)
|
|
|
|
g_free (proc_def->db_info.name);
|
|
|
|
if (proc_def->menu_path)
|
|
|
|
g_free (proc_def->menu_path);
|
|
|
|
if (proc_def->accelerator)
|
|
|
|
g_free (proc_def->accelerator);
|
|
|
|
if (proc_def->extensions)
|
|
|
|
g_free (proc_def->extensions);
|
|
|
|
if (proc_def->prefixes)
|
|
|
|
g_free (proc_def->prefixes);
|
|
|
|
if (proc_def->magics)
|
|
|
|
g_free (proc_def->magics);
|
|
|
|
if (proc_def->image_types)
|
|
|
|
g_free (proc_def->image_types);
|
|
|
|
|
|
|
|
proc_def->db_info.name = prog;
|
2000-07-16 20:49:04 +08:00
|
|
|
proc_def->menu_path = menu_path;
|
|
|
|
proc_def->accelerator = accelerator;
|
|
|
|
proc_def->prefixes = NULL;
|
|
|
|
proc_def->extensions = NULL;
|
|
|
|
proc_def->magics = NULL;
|
|
|
|
proc_def->image_types = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
proc_def = g_new0 (PlugInProcDef, 1);
|
|
|
|
proc_def->db_info.name = prog;
|
2000-07-16 20:49:04 +08:00
|
|
|
proc_def->menu_path = menu_path;
|
|
|
|
proc_def->accelerator = accelerator;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimprc_proc_defs = g_slist_prepend (gimprc_proc_defs, proc_def);
|
|
|
|
}
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
gchar *
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_image_types (gchar *name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
PlugInDef *plug_in_def;
|
1997-11-25 06:05:25 +08:00
|
|
|
PlugInProcDef *proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-14 23:18:37 +08:00
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (current_plug_in)
|
|
|
|
{
|
|
|
|
plug_in_def = current_plug_in->user_data;
|
|
|
|
tmp = plug_in_def->proc_defs;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tmp = proc_defs;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, name) == 0)
|
|
|
|
return proc_def->image_types;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
GSList *
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_extensions_parse (gchar *extensions)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GSList *list;
|
2000-05-17 20:29:38 +08:00
|
|
|
gchar *extension;
|
|
|
|
gchar *next_token;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
list = NULL;
|
2000-05-17 20:29:38 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
|
|
|
|
if (extensions)
|
|
|
|
{
|
|
|
|
extensions = g_strdup (extensions);
|
2000-01-06 06:59:16 +08:00
|
|
|
next_token = extensions;
|
|
|
|
extension = strtok (next_token, " \t,");
|
1997-11-25 06:05:25 +08:00
|
|
|
while (extension)
|
|
|
|
{
|
|
|
|
list = g_slist_prepend (list, g_strdup (extension));
|
|
|
|
extension = strtok (NULL, " \t,");
|
|
|
|
}
|
|
|
|
g_free (extensions);
|
|
|
|
}
|
|
|
|
|
|
|
|
return g_slist_reverse (list);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
plug_in_add_internal (PlugInProcDef *proc_def)
|
|
|
|
{
|
|
|
|
proc_defs = g_slist_prepend (proc_defs, proc_def);
|
|
|
|
}
|
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
PlugInProcDef *
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_file_handler (gchar *name,
|
|
|
|
gchar *extensions,
|
|
|
|
gchar *prefixes,
|
|
|
|
gchar *magics)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
PlugInDef *plug_in_def;
|
1997-11-25 06:05:25 +08:00
|
|
|
PlugInProcDef *proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-14 23:18:37 +08:00
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (current_plug_in)
|
|
|
|
{
|
|
|
|
plug_in_def = current_plug_in->user_data;
|
|
|
|
tmp = plug_in_def->proc_defs;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tmp = proc_defs;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, name) == 0)
|
|
|
|
{
|
|
|
|
/* EXTENSIONS can be proc_def->extensions */
|
|
|
|
if (proc_def->extensions != extensions)
|
|
|
|
{
|
|
|
|
if (proc_def->extensions)
|
|
|
|
g_free (proc_def->extensions);
|
|
|
|
proc_def->extensions = g_strdup (extensions);
|
|
|
|
}
|
|
|
|
proc_def->extensions_list = plug_in_extensions_parse (proc_def->extensions);
|
|
|
|
|
|
|
|
/* PREFIXES can be proc_def->prefixes */
|
|
|
|
if (proc_def->prefixes != prefixes)
|
|
|
|
{
|
|
|
|
if (proc_def->prefixes)
|
|
|
|
g_free (proc_def->prefixes);
|
|
|
|
proc_def->prefixes = g_strdup (prefixes);
|
|
|
|
}
|
|
|
|
proc_def->prefixes_list = plug_in_extensions_parse (proc_def->prefixes);
|
|
|
|
|
1998-05-16 14:37:14 +08:00
|
|
|
/* MAGICS can be proc_def->magics */
|
1997-11-25 06:05:25 +08:00
|
|
|
if (proc_def->magics != magics)
|
|
|
|
{
|
|
|
|
if (proc_def->magics)
|
|
|
|
g_free (proc_def->magics);
|
|
|
|
proc_def->magics = g_strdup (magics);
|
|
|
|
}
|
|
|
|
proc_def->magics_list = plug_in_extensions_parse (proc_def->magics);
|
|
|
|
return proc_def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2000-02-24 02:07:53 +08:00
|
|
|
|
|
|
|
PlugInDef *
|
2001-01-14 11:55:56 +08:00
|
|
|
plug_in_def_new (const gchar *prog)
|
2000-02-24 02:07:53 +08:00
|
|
|
{
|
|
|
|
PlugInDef *plug_in_def;
|
|
|
|
|
|
|
|
g_return_val_if_fail (prog != NULL, NULL);
|
|
|
|
|
|
|
|
plug_in_def = g_new (PlugInDef, 1);
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in_def->prog = g_strdup (prog);
|
|
|
|
plug_in_def->proc_defs = NULL;
|
2000-02-24 02:07:53 +08:00
|
|
|
plug_in_def->locale_domain = NULL;
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in_def->locale_path = NULL;
|
|
|
|
plug_in_def->help_path = NULL;
|
|
|
|
plug_in_def->mtime = 0;
|
|
|
|
plug_in_def->query = FALSE;
|
2000-02-24 02:07:53 +08:00
|
|
|
|
|
|
|
return plug_in_def;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
plug_in_def_free (PlugInDef *plug_in_def,
|
|
|
|
gboolean free_proc_defs)
|
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
g_free (plug_in_def->prog);
|
2000-07-16 20:49:04 +08:00
|
|
|
if (plug_in_def->locale_domain)
|
|
|
|
g_free (plug_in_def->locale_domain);
|
|
|
|
if (plug_in_def->locale_path)
|
|
|
|
g_free (plug_in_def->locale_path);
|
|
|
|
if (plug_in_def->help_path)
|
|
|
|
g_free (plug_in_def->help_path);
|
2000-02-24 02:07:53 +08:00
|
|
|
|
2000-02-24 06:31:26 +08:00
|
|
|
if (free_proc_defs)
|
2000-02-24 02:07:53 +08:00
|
|
|
{
|
|
|
|
for (list = plug_in_def->proc_defs; list; list = list->next)
|
2000-02-24 06:31:26 +08:00
|
|
|
plug_in_proc_def_destroy ((PlugInProcDef *)(list->data), FALSE);
|
2000-02-24 02:07:53 +08:00
|
|
|
}
|
|
|
|
|
2000-02-24 06:31:26 +08:00
|
|
|
if (plug_in_def->proc_defs)
|
|
|
|
g_slist_free (plug_in_def->proc_defs);
|
|
|
|
|
2000-02-24 02:07:53 +08:00
|
|
|
g_free (plug_in_def);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
plug_in_def_add (PlugInDef *plug_in_def)
|
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
PlugInDef *tplug_in_def;
|
1999-02-14 09:53:23 +08:00
|
|
|
PlugInProcDef *proc_def;
|
2001-07-27 23:18:20 +08:00
|
|
|
GSList *tmp;
|
|
|
|
gchar *basename1;
|
|
|
|
gchar *basename2;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
basename1 = g_path_get_basename (plug_in_def->prog);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* If this is a file load or save plugin, make sure we have
|
|
|
|
* something for one of the extensions, prefixes, or magic number.
|
|
|
|
* Other bits of code rely on detecting file plugins by the presence
|
|
|
|
* of one of these things, but Nick Lamb's alien/unknown format
|
|
|
|
* loader needs to be able to register no extensions, prefixes or
|
|
|
|
* magics. -- austin 13/Feb/99
|
|
|
|
*/
|
1999-11-25 19:35:48 +08:00
|
|
|
for (tmp = plug_in_def->proc_defs; tmp; tmp = g_slist_next (tmp))
|
1999-02-14 09:53:23 +08:00
|
|
|
{
|
1999-11-25 19:35:48 +08:00
|
|
|
proc_def = tmp->data;
|
1999-02-14 09:53:23 +08:00
|
|
|
|
1999-11-25 19:35:48 +08:00
|
|
|
if (!proc_def->extensions && !proc_def->prefixes && !proc_def->magics &&
|
|
|
|
proc_def->menu_path &&
|
|
|
|
(!strncmp (proc_def->menu_path, "<Load>", 6) ||
|
|
|
|
!strncmp (proc_def->menu_path, "<Save>", 6)))
|
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc_def->extensions = g_strdup ("");
|
1999-11-25 19:35:48 +08:00
|
|
|
}
|
|
|
|
}
|
1999-02-14 09:53:23 +08:00
|
|
|
|
1999-11-25 19:35:48 +08:00
|
|
|
for (tmp = plug_in_defs; tmp; tmp = g_slist_next (tmp))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
tplug_in_def = tmp->data;
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
basename2 = g_path_get_basename (tplug_in_def->prog);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
if (strcmp (basename1, basename2) == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-08-30 01:48:28 +08:00
|
|
|
if ((g_ascii_strcasecmp (plug_in_def->prog, tplug_in_def->prog) == 0) &&
|
1997-11-25 06:05:25 +08:00
|
|
|
(plug_in_def->mtime == tplug_in_def->mtime))
|
|
|
|
{
|
|
|
|
/* Use cached plug-in entry */
|
|
|
|
tmp->data = plug_in_def;
|
2000-02-24 06:31:26 +08:00
|
|
|
plug_in_def_free (tplug_in_def, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-02-24 06:31:26 +08:00
|
|
|
plug_in_def_free (plug_in_def, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2001-07-27 23:18:20 +08:00
|
|
|
|
|
|
|
g_free (basename2);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
2001-07-27 23:18:20 +08:00
|
|
|
|
|
|
|
g_free (basename2);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
g_free (basename1);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
write_pluginrc = TRUE;
|
1999-09-23 19:49:16 +08:00
|
|
|
g_print ("\"%s\" executable not found\n", plug_in_def->prog);
|
2000-02-24 02:07:53 +08:00
|
|
|
plug_in_def_free (plug_in_def, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-25 19:35:48 +08:00
|
|
|
gchar *
|
|
|
|
plug_in_menu_path (gchar *name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
PlugInDef *plug_in_def;
|
|
|
|
PlugInProcDef *proc_def;
|
|
|
|
GSList *tmp, *tmp2;
|
|
|
|
|
2001-01-14 23:18:37 +08:00
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
|
|
1999-11-25 19:35:48 +08:00
|
|
|
for (tmp = plug_in_defs; tmp; tmp = g_slist_next (tmp))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
plug_in_def = tmp->data;
|
|
|
|
|
1999-11-25 19:35:48 +08:00
|
|
|
for (tmp2 = plug_in_def->proc_defs; tmp2; tmp2 = g_slist_next (tmp2))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
proc_def = tmp2->data;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, name) == 0)
|
|
|
|
return proc_def->menu_path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-11-25 19:35:48 +08:00
|
|
|
for (tmp = proc_defs; tmp; tmp = g_slist_next (tmp))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, name) == 0)
|
|
|
|
return proc_def->menu_path;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
gchar *
|
|
|
|
plug_in_help_path (gchar *prog_name)
|
|
|
|
{
|
|
|
|
PlugInHelpPathDef *help_path_def;
|
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
if (!prog_name || !strlen (prog_name))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
for (list = help_path_defs; list; list = g_slist_next (list))
|
|
|
|
{
|
|
|
|
help_path_def = (PlugInHelpPathDef *) list->data;
|
|
|
|
|
|
|
|
if (help_path_def &&
|
|
|
|
help_path_def->prog_name &&
|
|
|
|
strcmp (help_path_def->prog_name, prog_name) == 0)
|
|
|
|
return help_path_def->help_path;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
PlugIn *
|
1999-11-25 19:35:48 +08:00
|
|
|
plug_in_new (gchar *name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
PlugIn *plug_in;
|
2000-05-17 20:29:38 +08:00
|
|
|
gchar *path;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-05-17 02:09:45 +08:00
|
|
|
if (! g_path_is_absolute (name))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-11 20:39:49 +08:00
|
|
|
path = plug_in_search_in_path (the_gimp->config->plug_in_path, name);
|
2001-05-17 02:09:45 +08:00
|
|
|
|
|
|
|
if (! path)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message (_("Unable to locate Plug-In: \"%s\""), name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
path = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
plug_in = g_new (PlugIn, 1);
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in->open = FALSE;
|
|
|
|
plug_in->destroy = FALSE;
|
|
|
|
plug_in->query = FALSE;
|
|
|
|
plug_in->synchronous = FALSE;
|
|
|
|
plug_in->recurse = FALSE;
|
|
|
|
plug_in->busy = FALSE;
|
|
|
|
plug_in->pid = 0;
|
|
|
|
plug_in->args[0] = g_strdup (path);
|
|
|
|
plug_in->args[1] = g_strdup ("-gimp");
|
2000-07-16 20:49:04 +08:00
|
|
|
plug_in->args[2] = NULL;
|
|
|
|
plug_in->args[3] = NULL;
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in->args[4] = NULL;
|
|
|
|
plug_in->args[5] = NULL;
|
|
|
|
plug_in->args[6] = NULL;
|
|
|
|
plug_in->my_read = NULL;
|
|
|
|
plug_in->my_write = NULL;
|
|
|
|
plug_in->his_read = NULL;
|
|
|
|
plug_in->his_write = NULL;
|
|
|
|
plug_in->input_id = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in->write_buffer_index = 0;
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in->temp_proc_defs = NULL;
|
|
|
|
plug_in->progress = NULL;
|
|
|
|
plug_in->user_data = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return plug_in;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
plug_in_destroy (PlugIn *plug_in)
|
|
|
|
{
|
|
|
|
if (plug_in)
|
|
|
|
{
|
2001-09-03 21:03:34 +08:00
|
|
|
if (plug_in->open)
|
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (plug_in->args[0])
|
|
|
|
g_free (plug_in->args[0]);
|
|
|
|
if (plug_in->args[1])
|
|
|
|
g_free (plug_in->args[1]);
|
|
|
|
if (plug_in->args[2])
|
|
|
|
g_free (plug_in->args[2]);
|
|
|
|
if (plug_in->args[3])
|
|
|
|
g_free (plug_in->args[3]);
|
|
|
|
if (plug_in->args[4])
|
|
|
|
g_free (plug_in->args[4]);
|
|
|
|
if (plug_in->args[5])
|
|
|
|
g_free (plug_in->args[5]);
|
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
if (plug_in->progress)
|
|
|
|
progress_end (plug_in->progress);
|
|
|
|
plug_in->progress = NULL;
|
1998-06-15 10:25:27 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (plug_in == current_plug_in)
|
|
|
|
plug_in_pop ();
|
|
|
|
|
|
|
|
if (!plug_in->destroy)
|
|
|
|
g_free (plug_in);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
/* The Microsoft _spawnv() does not allow to run scripts. But
|
|
|
|
* this is essential to get scripting extension up and running.
|
|
|
|
* Following the replacement function xspawnv().
|
|
|
|
*/
|
2000-02-25 00:11:26 +08:00
|
|
|
gint
|
|
|
|
xspawnv (gint mode,
|
|
|
|
const gchar *cmdname,
|
2000-07-16 20:49:04 +08:00
|
|
|
const gchar *const *argv)
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
{
|
2000-02-25 00:11:26 +08:00
|
|
|
gchar sExecutable[_MAX_PATH*2];
|
|
|
|
gchar** sArgsList;
|
|
|
|
gchar sCmndLine[1024];
|
|
|
|
gchar* sPath;
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
HINSTANCE hInst;
|
2000-02-25 00:11:26 +08:00
|
|
|
gint i;
|
|
|
|
gint pid;
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
|
|
|
|
/* only use it if _spawnv fails */
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
pid = _spawnv (mode, cmdname, argv);
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
if (pid != -1) return pid;
|
|
|
|
|
|
|
|
/* stuff parameters into one cmndline */
|
|
|
|
sCmndLine[0] = 0;
|
|
|
|
for (i = 1; argv[i] != NULL; i++)
|
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
strcat (sCmndLine, argv[i]);
|
|
|
|
strcat (sCmndLine, " ");
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
}
|
|
|
|
/* remove last blank */
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
sCmndLine[strlen (sCmndLine)-1] = 0;
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
|
|
|
|
/* do we really need _spawnv (ShelExecute seems not to do it)*/
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
if (32 <= (int) FindExecutable (cmdname,
|
|
|
|
gimp_directory (),
|
|
|
|
sExecutable))
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
/* g_print("_spawnlp %s %s %s", sExecutable, cmdname, sCmndLine); */
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
pid = _spawnlp (mode, sExecutable, "-c", cmdname, sCmndLine, NULL);
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
g_warning ("Execution error for: %s", cmdname);
|
Add gimpcolorspace object.
2000-01-04 Tor Lillqvist <tml@iki.fi>
* libgimp/makefile.{cygwin.msc}: Add gimpcolorspace object.
* libgimp/gimp.def: Add functions from it.
Fixes from Hans Breuer:
* app/datafiles.c: redefine the executable flag for Win32
to _S_IREAD, to get _all_ files from the plug-in dirs as
executables (including scripts)
* app/main.c: Win32-specific changes to allow building Gimp as a
console application, with all its benefits (like inheriting the
console), but hide it if the user doesn't want it. Also, if stdout
goes to a console, give the user a chance to read the help or
version messages. (tml: I am not convinced that it is better to
build gimp as a console application, but let's try it this way for
a while.)
* app/makefile.{cygwin,msc}: Build as console application, and
link with shell32 library.
* app/paint_core.c (paint_core_motion): Pass the value of a call
to the function gimage_active_drawable() to the paint_func,
instead of just passing the address of gimage_active_drawable...
(tml: This code is only called when the TOOL_TRACES_ON_WINDOW flag
is on, and only the clone tool sets that, and the clone tool's
paint_func doesn't use the drawable argument, so this hasn't
caused any trouble.)
* app/plug_in.c: On Win32, to support scripts, use new function
xspawn() instead of _spawnv. Add some more code to properly kill
plug-ins.
* libgimp/color_display.h: Add G_MODULE_EXPORT declarations.
2000-01-05 01:46:41 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return pid;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* G_OS_WIN32 */
|
|
|
|
|
2000-02-25 00:11:26 +08:00
|
|
|
gboolean
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_open (PlugIn *plug_in)
|
|
|
|
{
|
2000-02-25 00:11:26 +08:00
|
|
|
gint my_read[2];
|
|
|
|
gint my_write[2];
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (plug_in)
|
|
|
|
{
|
|
|
|
/* Open two pipes. (Bidirectional communication).
|
|
|
|
*/
|
|
|
|
if ((pipe (my_read) == -1) || (pipe (my_write) == -1))
|
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("pipe() failed: Unable to start Plug-In \"%s\"\n(%s)",
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (plug_in->args[0]),
|
|
|
|
plug_in->args[0]);
|
2000-02-25 00:11:26 +08:00
|
|
|
return FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-10-07 05:27:18 +08:00
|
|
|
#if defined(G_WITH_CYGWIN) || defined(__EMX__)
|
1999-03-07 20:56:03 +08:00
|
|
|
/* Set to binary mode */
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
setmode (my_read[0], _O_BINARY);
|
|
|
|
setmode (my_write[0], _O_BINARY);
|
|
|
|
setmode (my_read[1], _O_BINARY);
|
|
|
|
setmode (my_write[1], _O_BINARY);
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in->my_read = g_io_channel_unix_new (my_read[0]);
|
|
|
|
plug_in->my_write = g_io_channel_unix_new (my_write[1]);
|
|
|
|
plug_in->his_read = g_io_channel_unix_new (my_write[0]);
|
1999-03-07 20:56:03 +08:00
|
|
|
plug_in->his_write = g_io_channel_unix_new (my_read[1]);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
g_io_channel_set_encoding (plug_in->my_read, NULL, NULL);
|
|
|
|
g_io_channel_set_encoding (plug_in->my_write, NULL, NULL);
|
|
|
|
g_io_channel_set_encoding (plug_in->his_read, NULL, NULL);
|
|
|
|
g_io_channel_set_encoding (plug_in->his_write, NULL, NULL);
|
|
|
|
|
2001-08-30 09:09:58 +08:00
|
|
|
g_io_channel_set_buffered (plug_in->my_read, FALSE);
|
|
|
|
g_io_channel_set_buffered (plug_in->my_write, FALSE);
|
|
|
|
g_io_channel_set_buffered (plug_in->his_read, FALSE);
|
|
|
|
g_io_channel_set_buffered (plug_in->his_write, FALSE);
|
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
g_io_channel_set_close_on_unref (plug_in->my_read, TRUE);
|
|
|
|
g_io_channel_set_close_on_unref (plug_in->my_write, TRUE);
|
|
|
|
g_io_channel_set_close_on_unref (plug_in->his_read, TRUE);
|
|
|
|
g_io_channel_set_close_on_unref (plug_in->his_write, TRUE);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Remember the file descriptors for the pipes.
|
|
|
|
*/
|
2000-07-16 20:49:04 +08:00
|
|
|
plug_in->args[2] =
|
|
|
|
g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read));
|
|
|
|
plug_in->args[3] =
|
|
|
|
g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Set the rest of the command line arguments.
|
|
|
|
*/
|
|
|
|
if (plug_in->query)
|
|
|
|
{
|
|
|
|
plug_in->args[4] = g_strdup ("-query");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
plug_in->args[4] = g_strdup ("-run");
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
plug_in->args[5] = g_strdup_printf ("%d", (gint) stack_trace_mode);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Fork another process. We'll remember the process id
|
|
|
|
* so that we can later use it to kill the filter if
|
|
|
|
* necessary.
|
|
|
|
*/
|
1999-04-25 03:12:12 +08:00
|
|
|
#ifdef __EMX__
|
2000-07-16 20:49:04 +08:00
|
|
|
fcntl (my_read[0], F_SETFD, 1);
|
|
|
|
fcntl (my_write[1], F_SETFD, 1);
|
1999-04-25 03:12:12 +08:00
|
|
|
#endif
|
1999-10-07 05:27:18 +08:00
|
|
|
#if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__)
|
2000-07-30 05:32:55 +08:00
|
|
|
plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
1999-03-07 20:56:03 +08:00
|
|
|
if (plug_in->pid == -1)
|
|
|
|
#else
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in->pid = fork ();
|
|
|
|
|
|
|
|
if (plug_in->pid == 0)
|
|
|
|
{
|
1999-03-08 18:27:52 +08:00
|
|
|
g_io_channel_unref (plug_in->my_read);
|
|
|
|
plug_in->my_read = NULL;
|
2001-08-30 01:48:28 +08:00
|
|
|
|
1999-03-08 18:27:52 +08:00
|
|
|
g_io_channel_unref (plug_in->my_write);
|
|
|
|
plug_in->my_write = NULL;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Execute the filter. The "_exit" call should never
|
|
|
|
* be reached, unless some strange error condition
|
|
|
|
* exists.
|
|
|
|
*/
|
|
|
|
execvp (plug_in->args[0], plug_in->args);
|
|
|
|
_exit (1);
|
|
|
|
}
|
|
|
|
else if (plug_in->pid == -1)
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("fork() failed: Unable to run Plug-In: \"%s\"\n(%s)",
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (plug_in->args[0]),
|
|
|
|
plug_in->args[0]);
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_destroy (plug_in);
|
2000-02-25 00:11:26 +08:00
|
|
|
return FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
g_io_channel_unref (plug_in->his_read);
|
|
|
|
plug_in->his_read = NULL;
|
2001-08-30 01:48:28 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
g_io_channel_unref (plug_in->his_write);
|
|
|
|
plug_in->his_write = NULL;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!plug_in->synchronous)
|
|
|
|
{
|
2000-05-11 05:21:23 +08:00
|
|
|
plug_in->input_id =
|
|
|
|
g_io_add_watch (plug_in->my_read,
|
|
|
|
G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP,
|
|
|
|
plug_in_recv_message,
|
|
|
|
plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
open_plug_ins = g_slist_prepend (open_plug_ins, plug_in);
|
|
|
|
}
|
|
|
|
|
|
|
|
plug_in->open = TRUE;
|
1999-11-25 19:35:48 +08:00
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-25 19:35:48 +08:00
|
|
|
return FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_close (PlugIn *plug_in,
|
|
|
|
gboolean kill_it)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-25 19:35:48 +08:00
|
|
|
gint status;
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifndef G_OS_WIN32
|
1997-11-25 06:05:25 +08:00
|
|
|
struct timeval tv;
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
g_return_if_fail (plug_in != NULL);
|
|
|
|
g_return_if_fail (plug_in->open == TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
if (! plug_in->open)
|
|
|
|
return;
|
|
|
|
|
|
|
|
plug_in->open = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
/* Ask the filter to exit gracefully */
|
|
|
|
if (kill_it && plug_in->pid)
|
|
|
|
{
|
|
|
|
plug_in_push (plug_in);
|
|
|
|
gp_quit_write (current_writechannel);
|
|
|
|
plug_in_pop ();
|
|
|
|
|
|
|
|
/* give the plug-in some time (10 ms) */
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifndef G_OS_WIN32
|
2001-09-03 21:03:34 +08:00
|
|
|
tv.tv_sec = 0;
|
|
|
|
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
|
|
|
select (0, NULL, NULL, NULL, &tv);
|
1999-03-07 20:56:03 +08:00
|
|
|
#else
|
2001-09-03 21:03:34 +08:00
|
|
|
Sleep (10);
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
2001-09-03 21:03:34 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
/* If necessary, kill the filter. */
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifndef G_OS_WIN32
|
2001-09-03 21:03:34 +08:00
|
|
|
if (kill_it && plug_in->pid)
|
|
|
|
status = kill (plug_in->pid, SIGKILL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
/* Wait for the process to exit. This will happen
|
|
|
|
* immediately if it was just killed.
|
|
|
|
*/
|
|
|
|
if (plug_in->pid)
|
|
|
|
waitpid (plug_in->pid, &status, 0);
|
1999-03-07 20:56:03 +08:00
|
|
|
#else
|
2001-09-03 21:03:34 +08:00
|
|
|
if (kill_it && plug_in->pid)
|
|
|
|
{
|
|
|
|
/* Trying to avoid TerminateProcess (does mostly work).
|
|
|
|
* Otherwise some of our needed DLLs may get into an unstable state
|
|
|
|
* (see Win32 API docs).
|
|
|
|
*/
|
|
|
|
DWORD dwExitCode = STILL_ACTIVE;
|
|
|
|
DWORD dwTries = 10;
|
|
|
|
while ((STILL_ACTIVE == dwExitCode)
|
|
|
|
&& GetExitCodeProcess((HANDLE) plug_in->pid, &dwExitCode)
|
|
|
|
&& (dwTries > 0))
|
1999-03-07 20:56:03 +08:00
|
|
|
{
|
2001-09-03 21:03:34 +08:00
|
|
|
Sleep(10);
|
|
|
|
dwTries--;
|
1999-03-07 20:56:03 +08:00
|
|
|
}
|
2001-09-03 21:03:34 +08:00
|
|
|
if (STILL_ACTIVE == dwExitCode)
|
1999-03-07 20:56:03 +08:00
|
|
|
{
|
2001-09-03 21:03:34 +08:00
|
|
|
g_warning("Terminating %s ...", plug_in->args[0]);
|
|
|
|
TerminateProcess ((HANDLE) plug_in->pid, 0);
|
1999-03-07 20:56:03 +08:00
|
|
|
}
|
2001-09-03 21:03:34 +08:00
|
|
|
}
|
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
plug_in->pid = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
/* Remove the input handler. */
|
|
|
|
if (plug_in->input_id)
|
|
|
|
{
|
|
|
|
g_source_remove (plug_in->input_id);
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in->input_id = 0;
|
2001-09-03 21:03:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Close the pipes. */
|
|
|
|
if (plug_in->my_read != NULL)
|
|
|
|
{
|
|
|
|
g_io_channel_unref (plug_in->my_read);
|
1999-03-07 20:56:03 +08:00
|
|
|
plug_in->my_read = NULL;
|
2001-09-03 21:03:34 +08:00
|
|
|
}
|
|
|
|
if (plug_in->my_write != NULL)
|
|
|
|
{
|
|
|
|
g_io_channel_unref (plug_in->my_write);
|
1999-03-07 20:56:03 +08:00
|
|
|
plug_in->my_write = NULL;
|
2001-09-03 21:03:34 +08:00
|
|
|
}
|
|
|
|
if (plug_in->his_read != NULL)
|
|
|
|
{
|
|
|
|
g_io_channel_unref (plug_in->his_read);
|
1999-03-07 20:56:03 +08:00
|
|
|
plug_in->his_read = NULL;
|
2001-09-03 21:03:34 +08:00
|
|
|
}
|
|
|
|
if (plug_in->his_write != NULL)
|
|
|
|
{
|
|
|
|
g_io_channel_unref (plug_in->his_write);
|
1999-03-07 20:56:03 +08:00
|
|
|
plug_in->his_write = NULL;
|
2001-09-03 21:03:34 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
wire_clear_error ();
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
/* Destroy the progress dialog if it exists. */
|
|
|
|
if (plug_in->progress)
|
|
|
|
{
|
|
|
|
progress_end (plug_in->progress);
|
|
|
|
plug_in->progress = NULL;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
if (plug_in->recurse)
|
|
|
|
{
|
|
|
|
gtk_main_quit ();
|
|
|
|
plug_in->recurse = FALSE;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
plug_in->synchronous = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
/* Unregister any temporary procedures. */
|
|
|
|
if (plug_in->temp_proc_defs)
|
|
|
|
{
|
|
|
|
g_slist_foreach (plug_in->temp_proc_defs,
|
|
|
|
(GFunc) plug_in_proc_def_remove,
|
|
|
|
NULL);
|
|
|
|
g_slist_free (plug_in->temp_proc_defs);
|
|
|
|
plug_in->temp_proc_defs = NULL;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
/* Close any dialogs that this plugin might have opened */
|
|
|
|
brush_select_dialogs_check ();
|
|
|
|
pattern_select_dialogs_check ();
|
|
|
|
gradient_select_dialogs_check ();
|
1998-09-19 08:40:27 +08:00
|
|
|
|
2001-09-03 21:03:34 +08:00
|
|
|
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Argument *
|
|
|
|
plug_in_get_current_return_vals (ProcRecord *proc_rec)
|
|
|
|
{
|
|
|
|
Argument *return_vals;
|
2000-07-16 20:49:04 +08:00
|
|
|
gint nargs;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Return the status code plus the current return values. */
|
|
|
|
nargs = proc_rec->num_values + 1;
|
|
|
|
if (current_return_vals && current_return_nvals == nargs)
|
2000-07-16 20:49:04 +08:00
|
|
|
{
|
|
|
|
return_vals = current_return_vals;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
else if (current_return_vals)
|
|
|
|
{
|
|
|
|
/* Allocate new return values of the correct size. */
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
|
|
|
|
|
|
|
/* Copy all of the arguments we can. */
|
|
|
|
memcpy (return_vals, current_return_vals,
|
|
|
|
sizeof (Argument) * MIN (current_return_nvals, nargs));
|
|
|
|
|
|
|
|
/* Free the old argument pointer. This will cause a memory leak
|
|
|
|
only if there were more values returned than we need (which
|
|
|
|
shouldn't ever happen). */
|
|
|
|
g_free (current_return_vals);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Just return a dummy set of values. */
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We have consumed any saved values, so clear them. */
|
|
|
|
current_return_nvals = 0;
|
2000-07-16 20:49:04 +08:00
|
|
|
current_return_vals = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return return_vals;
|
|
|
|
}
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
Argument *
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_run (ProcRecord *proc_rec,
|
|
|
|
Argument *args,
|
2000-02-25 00:11:26 +08:00
|
|
|
gint argc,
|
|
|
|
gboolean synchronous,
|
|
|
|
gboolean destroy_values,
|
|
|
|
gint gdisp_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
GPConfig config;
|
|
|
|
GPProcRun proc_run;
|
|
|
|
Argument *return_vals;
|
|
|
|
PlugIn *plug_in;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = NULL;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
if (proc_rec->proc_type == GIMP_TEMPORARY)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-10-22 03:10:14 +08:00
|
|
|
return_vals = plug_in_temp_run (proc_rec, args, argc);
|
1997-11-25 06:05:25 +08:00
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
plug_in = plug_in_new (proc_rec->exec_method.plug_in.filename);
|
|
|
|
|
|
|
|
if (plug_in)
|
|
|
|
{
|
|
|
|
if (plug_in_open (plug_in))
|
|
|
|
{
|
|
|
|
plug_in->recurse = synchronous;
|
|
|
|
|
|
|
|
plug_in_push (plug_in);
|
|
|
|
|
2000-05-01 02:17:55 +08:00
|
|
|
config.version = GP_VERSION;
|
|
|
|
config.tile_width = TILE_WIDTH;
|
|
|
|
config.tile_height = TILE_HEIGHT;
|
|
|
|
config.shm_ID = shm_ID;
|
2001-06-04 04:40:50 +08:00
|
|
|
config.gamma = gimprc.gamma_val;
|
|
|
|
config.install_cmap = gimprc.install_cmap;
|
2001-09-19 22:42:35 +08:00
|
|
|
config.unused = 0;
|
|
|
|
config.min_colors = CLAMP (gimprc.min_colors, 27, 256);
|
2000-05-01 02:17:55 +08:00
|
|
|
config.gdisp_ID = gdisp_ID;
|
|
|
|
|
|
|
|
proc_run.name = proc_rec->name;
|
1998-10-22 03:10:14 +08:00
|
|
|
proc_run.nparams = argc;
|
2000-05-01 02:17:55 +08:00
|
|
|
proc_run.params = plug_in_args_to_params (args, argc, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!gp_config_write (current_writechannel, &config) ||
|
|
|
|
!gp_proc_run_write (current_writechannel, &proc_run) ||
|
|
|
|
!wire_flush (current_writechannel))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
plug_in_pop ();
|
|
|
|
|
|
|
|
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* If this is an automatically installed extension, wait for an
|
|
|
|
* installation-confirmation message
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2001-05-21 21:58:46 +08:00
|
|
|
if ((proc_rec->proc_type == GIMP_EXTENSION) &&
|
2000-05-17 20:29:38 +08:00
|
|
|
(proc_rec->num_args == 0))
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_main ();
|
|
|
|
|
|
|
|
if (plug_in->recurse)
|
|
|
|
{
|
|
|
|
gtk_main ();
|
|
|
|
return_vals = plug_in_get_current_return_vals (proc_rec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
done:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (return_vals && destroy_values)
|
|
|
|
{
|
|
|
|
procedural_db_destroy_args (return_vals, proc_rec->num_values);
|
|
|
|
return_vals = NULL;
|
|
|
|
}
|
|
|
|
return return_vals;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_repeat (gboolean with_interface)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GDisplay *gdisplay;
|
|
|
|
Argument *args;
|
2000-02-25 00:11:26 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (last_plug_in)
|
|
|
|
{
|
|
|
|
gdisplay = gdisplay_active ();
|
1999-06-22 06:12:07 +08:00
|
|
|
if (!gdisplay) return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* construct the procedures arguments */
|
1998-10-22 03:10:14 +08:00
|
|
|
args = g_new (Argument, 3);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-10-22 03:10:14 +08:00
|
|
|
/* initialize the first three argument types */
|
|
|
|
for (i = 0; i < 3; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].arg_type = last_plug_in->args[i].arg_type;
|
|
|
|
|
1998-10-22 03:10:14 +08:00
|
|
|
/* initialize the first three plug-in arguments */
|
1997-11-25 06:05:25 +08:00
|
|
|
args[0].value.pdb_int = (with_interface ? RUN_INTERACTIVE : RUN_WITH_LAST_VALS);
|
2001-04-13 22:50:43 +08:00
|
|
|
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
|
2001-01-15 05:11:52 +08:00
|
|
|
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* run the plug-in procedure */
|
1998-10-22 03:10:14 +08:00
|
|
|
plug_in_run (last_plug_in, args, 3, FALSE, TRUE, gdisplay->ID);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
g_free (args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
Actually use the enum types GimpImageType, GimpImageBaseType,
* app/*.[ch]: Actually use the enum types GimpImageType,
GimpImageBaseType, LayerModeEffects, PaintApplicationMode,
BrushApplicationMode, GimpFillType and ConvertPaletteType, instead
of just int or gint. Hopefully I catched most of the places
where these should be used.
Add an enum ConvolutionType, suffix the too general constants
NORMAL, ABSOLUTE and NEGATIVE with _CONVOL. Use NORMAL_MODE
instead of NORMAL in some places (this was what was intended). Fix
some minor gccisms.
* app/apptypes.h: New file. This file contains the above
enumeration types, and some opaque struct typedefs. It was
necessary to collect these in one header that doesn't include
other headers, because when we started using the above mentioned
types in the headers, all hell broke loose because of the
spaghetti-like cross-inclusion mess between headers.
(An example: Header A includes header B, which includes header C
which includes A. B uses a type defined in A. This is not defined,
because A hasn't defined it yet at the point where it includes B,
and A included from B of course is skipped as we already are
reading A.)
1999-08-19 07:41:39 +08:00
|
|
|
plug_in_set_menu_sensitivity (GimpImageType type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
PlugInProcDef *proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
|
|
|
gboolean sensitive = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-25 19:35:48 +08:00
|
|
|
for (tmp = proc_defs; tmp; tmp = g_slist_next (tmp))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
|
|
|
|
if (proc_def->image_types_val && proc_def->menu_path)
|
1998-05-05 10:38:10 +08:00
|
|
|
{
|
Actually use the enum types GimpImageType, GimpImageBaseType,
* app/*.[ch]: Actually use the enum types GimpImageType,
GimpImageBaseType, LayerModeEffects, PaintApplicationMode,
BrushApplicationMode, GimpFillType and ConvertPaletteType, instead
of just int or gint. Hopefully I catched most of the places
where these should be used.
Add an enum ConvolutionType, suffix the too general constants
NORMAL, ABSOLUTE and NEGATIVE with _CONVOL. Use NORMAL_MODE
instead of NORMAL in some places (this was what was intended). Fix
some minor gccisms.
* app/apptypes.h: New file. This file contains the above
enumeration types, and some opaque struct typedefs. It was
necessary to collect these in one header that doesn't include
other headers, because when we started using the above mentioned
types in the headers, all hell broke loose because of the
spaghetti-like cross-inclusion mess between headers.
(An example: Header A includes header B, which includes header C
which includes A. B uses a type defined in A. This is not defined,
because A hasn't defined it yet at the point where it includes B,
and A included from B of course is skipped as we already are
reading A.)
1999-08-19 07:41:39 +08:00
|
|
|
switch (type)
|
1998-05-05 10:38:10 +08:00
|
|
|
{
|
|
|
|
case RGB_GIMAGE:
|
1999-10-19 12:58:17 +08:00
|
|
|
sensitive = proc_def->image_types_val & PLUG_IN_RGB_IMAGE;
|
1998-05-05 10:38:10 +08:00
|
|
|
break;
|
|
|
|
case RGBA_GIMAGE:
|
1999-10-19 12:58:17 +08:00
|
|
|
sensitive = proc_def->image_types_val & PLUG_IN_RGBA_IMAGE;
|
1998-05-05 10:38:10 +08:00
|
|
|
break;
|
|
|
|
case GRAY_GIMAGE:
|
1999-10-19 12:58:17 +08:00
|
|
|
sensitive = proc_def->image_types_val & PLUG_IN_GRAY_IMAGE;
|
1998-05-05 10:38:10 +08:00
|
|
|
break;
|
|
|
|
case GRAYA_GIMAGE:
|
1999-10-19 12:58:17 +08:00
|
|
|
sensitive = proc_def->image_types_val & PLUG_IN_GRAYA_IMAGE;
|
1998-05-05 10:38:10 +08:00
|
|
|
break;
|
|
|
|
case INDEXED_GIMAGE:
|
1999-10-19 12:58:17 +08:00
|
|
|
sensitive = proc_def->image_types_val & PLUG_IN_INDEXED_IMAGE;
|
1998-05-05 10:38:10 +08:00
|
|
|
break;
|
|
|
|
case INDEXEDA_GIMAGE:
|
1999-10-19 12:58:17 +08:00
|
|
|
sensitive = proc_def->image_types_val & PLUG_IN_INDEXEDA_IMAGE;
|
1998-05-05 10:38:10 +08:00
|
|
|
break;
|
1999-09-26 17:57:32 +08:00
|
|
|
default:
|
|
|
|
sensitive = FALSE;
|
|
|
|
break;
|
1998-05-05 10:38:10 +08:00
|
|
|
}
|
|
|
|
|
1999-06-07 05:13:03 +08:00
|
|
|
menus_set_sensitive (proc_def->menu_path, sensitive);
|
1999-11-25 19:35:48 +08:00
|
|
|
|
1998-05-05 10:38:10 +08:00
|
|
|
if (last_plug_in && (last_plug_in == &(proc_def->db_info)))
|
|
|
|
{
|
1999-12-14 22:10:34 +08:00
|
|
|
menus_set_sensitive ("<Image>/Filters/Repeat Last", sensitive);
|
|
|
|
menus_set_sensitive ("<Image>/Filters/Re-Show Last", sensitive);
|
1998-05-05 10:38:10 +08:00
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2000-05-17 20:29:38 +08:00
|
|
|
|
|
|
|
if (!last_plug_in)
|
|
|
|
{
|
|
|
|
menus_set_sensitive ("<Image>/Filters/Repeat Last", FALSE);
|
|
|
|
menus_set_sensitive ("<Image>/Filters/Re-Show Last", FALSE);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
static gboolean
|
2000-07-16 20:49:04 +08:00
|
|
|
plug_in_recv_message (GIOChannel *channel,
|
|
|
|
GIOCondition cond,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-11 05:21:23 +08:00
|
|
|
gboolean got_message = FALSE;
|
|
|
|
|
|
|
|
if ((PlugIn *) data != current_plug_in)
|
|
|
|
plug_in_push ((PlugIn *) data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
if (current_readchannel == NULL)
|
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-05-11 05:21:23 +08:00
|
|
|
if (cond & (G_IO_IN | G_IO_PRI))
|
|
|
|
{
|
|
|
|
WireMessage msg;
|
|
|
|
|
|
|
|
memset (&msg, 0, sizeof (WireMessage));
|
|
|
|
|
|
|
|
if (!wire_read_msg (current_readchannel, &msg))
|
|
|
|
{
|
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
plug_in_handle_message (&msg);
|
|
|
|
wire_destroy (&msg);
|
|
|
|
got_message = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cond & (G_IO_ERR | G_IO_HUP))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-11 05:21:23 +08:00
|
|
|
if (current_plug_in->open)
|
|
|
|
{
|
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-05-11 05:21:23 +08:00
|
|
|
if (!got_message)
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message (_("Plug-In crashed: \"%s\"\n(%s)\n\n"
|
|
|
|
"The dying Plug-In may have messed up GIMP's internal state.\n"
|
|
|
|
"You may want to save your images and restart GIMP\n"
|
|
|
|
"to be on the safe side."),
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (current_plug_in->args[0]),
|
2000-05-11 05:21:23 +08:00
|
|
|
current_plug_in->args[0]);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!current_plug_in->open)
|
|
|
|
plug_in_destroy (current_plug_in);
|
|
|
|
else
|
|
|
|
plug_in_pop ();
|
2000-05-11 05:21:23 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_handle_message (WireMessage *msg)
|
|
|
|
{
|
|
|
|
switch (msg->type)
|
|
|
|
{
|
|
|
|
case GP_QUIT:
|
|
|
|
plug_in_handle_quit ();
|
|
|
|
break;
|
|
|
|
case GP_CONFIG:
|
2000-07-16 20:49:04 +08:00
|
|
|
g_warning ("plug_in_handle_message(): "
|
|
|
|
"received a config message (should not happen)");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
break;
|
|
|
|
case GP_TILE_REQ:
|
|
|
|
plug_in_handle_tile_req (msg->data);
|
|
|
|
break;
|
|
|
|
case GP_TILE_ACK:
|
2000-07-16 20:49:04 +08:00
|
|
|
g_warning ("plug_in_handle_message(): "
|
|
|
|
"received a tile ack message (should not happen)");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
break;
|
|
|
|
case GP_TILE_DATA:
|
2000-07-16 20:49:04 +08:00
|
|
|
g_warning ("plug_in_handle_message(): "
|
|
|
|
"received a tile data message (should not happen)");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
break;
|
|
|
|
case GP_PROC_RUN:
|
|
|
|
plug_in_handle_proc_run (msg->data);
|
|
|
|
break;
|
|
|
|
case GP_PROC_RETURN:
|
|
|
|
plug_in_handle_proc_return (msg->data);
|
|
|
|
plug_in_close (current_plug_in, FALSE);
|
|
|
|
break;
|
|
|
|
case GP_TEMP_PROC_RUN:
|
2000-07-16 20:49:04 +08:00
|
|
|
g_warning ("plug_in_handle_message(): "
|
|
|
|
"received a temp proc run message (should not happen)");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
break;
|
|
|
|
case GP_TEMP_PROC_RETURN:
|
|
|
|
plug_in_handle_proc_return (msg->data);
|
|
|
|
gtk_main_quit ();
|
|
|
|
break;
|
|
|
|
case GP_PROC_INSTALL:
|
|
|
|
plug_in_handle_proc_install (msg->data);
|
|
|
|
break;
|
|
|
|
case GP_PROC_UNINSTALL:
|
|
|
|
plug_in_handle_proc_uninstall (msg->data);
|
|
|
|
break;
|
|
|
|
case GP_EXTENSION_ACK:
|
|
|
|
gtk_main_quit ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-05-04 03:22:58 +08:00
|
|
|
plug_in_handle_quit (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
plug_in_close (current_plug_in, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_handle_tile_req (GPTileReq *tile_req)
|
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
GPTileData tile_data;
|
|
|
|
GPTileData *tile_info;
|
|
|
|
WireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
TileManager *tm;
|
2000-05-17 20:29:38 +08:00
|
|
|
Tile *tile;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (tile_req->drawable_ID == -1)
|
|
|
|
{
|
|
|
|
tile_data.drawable_ID = -1;
|
2000-07-16 20:49:04 +08:00
|
|
|
tile_data.tile_num = 0;
|
|
|
|
tile_data.shadow = 0;
|
|
|
|
tile_data.bpp = 0;
|
|
|
|
tile_data.width = 0;
|
|
|
|
tile_data.height = 0;
|
|
|
|
tile_data.use_shm = (shm_ID == -1) ? FALSE : TRUE;
|
|
|
|
tile_data.data = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!gp_tile_data_write (current_writechannel, &tile_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug_in_handle_tile_req: ERROR");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!wire_read_msg (current_readchannel, &msg))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug_in_handle_tile_req: ERROR");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg.type != GP_TILE_DATA)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("expected tile data and received: %d", msg.type);
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
tile_info = msg.data;
|
|
|
|
|
|
|
|
if (tile_info->shadow)
|
2001-07-11 20:39:49 +08:00
|
|
|
tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID));
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2001-07-11 20:39:49 +08:00
|
|
|
tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!tm)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug-in requested invalid drawable (killing)");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-08-16 03:17:36 +08:00
|
|
|
tile = tile_manager_get (tm, tile_info->tile_num, TRUE, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!tile)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug-in requested invalid tile (killing)");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tile_data.use_shm)
|
1998-08-12 01:35:34 +08:00
|
|
|
memcpy (tile_data_pointer (tile, 0, 0), shm_addr, tile_size (tile));
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
1998-08-12 01:35:34 +08:00
|
|
|
memcpy (tile_data_pointer (tile, 0, 0), tile_info->data, tile_size (tile));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-07-10 10:43:12 +08:00
|
|
|
tile_release (tile, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
wire_destroy (&msg);
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!gp_tile_ack_write (current_writechannel))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug_in_handle_tile_req: ERROR");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (tile_req->shadow)
|
2001-07-11 20:39:49 +08:00
|
|
|
tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID));
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2001-07-11 20:39:49 +08:00
|
|
|
tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!tm)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug-in requested invalid drawable (killing)");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-08-16 03:17:36 +08:00
|
|
|
tile = tile_manager_get (tm, tile_req->tile_num, TRUE, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!tile)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug-in requested invalid tile (killing)");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
tile_data.drawable_ID = tile_req->drawable_ID;
|
2000-05-17 20:29:38 +08:00
|
|
|
tile_data.tile_num = tile_req->tile_num;
|
|
|
|
tile_data.shadow = tile_req->shadow;
|
|
|
|
tile_data.bpp = tile_bpp (tile);
|
|
|
|
tile_data.width = tile_ewidth (tile);
|
|
|
|
tile_data.height = tile_eheight (tile);
|
|
|
|
tile_data.use_shm = (shm_ID == -1) ? FALSE : TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (tile_data.use_shm)
|
1998-08-12 01:35:34 +08:00
|
|
|
memcpy (shm_addr, tile_data_pointer (tile, 0, 0), tile_size (tile));
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
1998-08-12 01:35:34 +08:00
|
|
|
tile_data.data = tile_data_pointer (tile, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!gp_tile_data_write (current_writechannel, &tile_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_message ("plug_in_handle_tile_req: ERROR");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-07-10 10:43:12 +08:00
|
|
|
tile_release (tile, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!wire_read_msg (current_readchannel, &msg))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_message ("plug_in_handle_tile_req: ERROR");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg.type != GP_TILE_ACK)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("expected tile ack and received: %d", msg.type);
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
wire_destroy (&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_handle_proc_run (GPProcRun *proc_run)
|
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
GPProcReturn proc_return;
|
|
|
|
ProcRecord *proc_rec;
|
|
|
|
Argument *args;
|
|
|
|
Argument *return_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
PlugInBlocked *blocked;
|
|
|
|
|
|
|
|
args = plug_in_params_to_args (proc_run->params, proc_run->nparams, FALSE);
|
2001-07-05 03:31:35 +08:00
|
|
|
proc_rec = procedural_db_lookup (the_gimp, proc_run->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-28 21:28:37 +08:00
|
|
|
if (proc_rec)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-05 03:31:35 +08:00
|
|
|
return_vals = procedural_db_execute (the_gimp, proc_run->name, args);
|
1999-06-28 21:28:37 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* if the name lookup failed, construct a
|
|
|
|
* dummy "executiuon error" return value --Michael
|
|
|
|
*/
|
|
|
|
return_vals = g_new (Argument, 1);
|
2001-05-21 21:58:46 +08:00
|
|
|
return_vals[0].arg_type = GIMP_PDB_STATUS;
|
|
|
|
return_vals[0].value.pdb_int = GIMP_PDB_EXECUTION_ERROR;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (return_vals)
|
|
|
|
{
|
|
|
|
proc_return.name = proc_run->name;
|
|
|
|
|
|
|
|
if (proc_rec)
|
|
|
|
{
|
|
|
|
proc_return.nparams = proc_rec->num_values + 1;
|
|
|
|
proc_return.params = plug_in_args_to_params (return_vals, proc_rec->num_values + 1, FALSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
proc_return.nparams = 1;
|
|
|
|
proc_return.params = plug_in_args_to_params (return_vals, 1, FALSE);
|
|
|
|
}
|
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!gp_proc_return_write (current_writechannel, &proc_return))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug_in_handle_proc_run: ERROR");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
plug_in_args_destroy (args, proc_run->nparams, FALSE);
|
|
|
|
plug_in_args_destroy (return_vals, (proc_rec ? (proc_rec->num_values + 1) : 1), TRUE);
|
|
|
|
plug_in_params_destroy (proc_return.params, proc_return.nparams, FALSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
blocked = g_new (PlugInBlocked, 1);
|
|
|
|
blocked->plug_in = current_plug_in;
|
|
|
|
blocked->proc_name = g_strdup (proc_run->name);
|
|
|
|
blocked_plug_ins = g_slist_prepend (blocked_plug_ins, blocked);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_handle_proc_return (GPProcReturn *proc_return)
|
|
|
|
{
|
|
|
|
PlugInBlocked *blocked;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (current_plug_in->recurse)
|
|
|
|
{
|
|
|
|
current_return_vals = plug_in_params_to_args (proc_return->params,
|
|
|
|
proc_return->nparams,
|
|
|
|
TRUE);
|
|
|
|
current_return_nvals = proc_return->nparams;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tmp = blocked_plug_ins;
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
blocked = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
2001-01-14 23:18:37 +08:00
|
|
|
if (blocked->proc_name && proc_return->name &&
|
|
|
|
strcmp (blocked->proc_name, proc_return->name) == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
plug_in_push (blocked->plug_in);
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!gp_proc_return_write (current_writechannel, proc_return))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_message ("plug_in_handle_proc_run: ERROR");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
plug_in_pop ();
|
|
|
|
|
|
|
|
blocked_plug_ins = g_slist_remove (blocked_plug_ins, blocked);
|
|
|
|
g_free (blocked->proc_name);
|
|
|
|
g_free (blocked);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_handle_proc_install (GPProcInstall *proc_install)
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
PlugInDef *plug_in_def = NULL;
|
|
|
|
PlugInProcDef *proc_def;
|
|
|
|
ProcRecord *proc = NULL;
|
2000-05-08 06:04:51 +08:00
|
|
|
PlugInMenuEntry *menu_entry;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp = NULL;
|
|
|
|
gchar *prog = NULL;
|
|
|
|
gboolean add_proc_def;
|
2001-09-03 08:26:06 +08:00
|
|
|
gboolean valid;
|
2000-02-25 00:11:26 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* Argument checking
|
1997-11-25 06:05:25 +08:00
|
|
|
* --only sanity check arguments when the procedure requests a menu path
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (proc_install->menu_path)
|
|
|
|
{
|
|
|
|
if (strncmp (proc_install->menu_path, "<Toolbox>", 9) == 0)
|
|
|
|
{
|
|
|
|
if ((proc_install->nparams < 1) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[0].type != GIMP_PDB_INT32))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
|
|
|
"attempted to install procedure \"%s\"\n"
|
|
|
|
"which does not take the standard Plug-In args.",
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (current_plug_in->args[0]),
|
2000-05-17 20:29:38 +08:00
|
|
|
current_plug_in->args[0],
|
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strncmp (proc_install->menu_path, "<Image>", 7) == 0)
|
|
|
|
{
|
|
|
|
if ((proc_install->nparams < 3) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
|
|
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
|
|
|
(proc_install->params[2].type != GIMP_PDB_DRAWABLE))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
|
|
|
"attempted to install procedure \"%s\"\n"
|
|
|
|
"which does not take the standard Plug-In args.",
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (current_plug_in->args[0]),
|
2000-05-17 20:29:38 +08:00
|
|
|
current_plug_in->args[0],
|
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strncmp (proc_install->menu_path, "<Load>", 6) == 0)
|
|
|
|
{
|
|
|
|
if ((proc_install->nparams < 3) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
|
|
|
(proc_install->params[1].type != GIMP_PDB_STRING) ||
|
|
|
|
(proc_install->params[2].type != GIMP_PDB_STRING))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
|
|
|
"attempted to install procedure \"%s\"\n"
|
|
|
|
"which does not take the standard Plug-In args.",
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (current_plug_in->args[0]),
|
2000-05-17 20:29:38 +08:00
|
|
|
current_plug_in->args[0],
|
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
|
|
|
{
|
|
|
|
if ((proc_install->nparams < 5) ||
|
2001-09-03 08:26:06 +08:00
|
|
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
|
|
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
2001-09-03 08:26:06 +08:00
|
|
|
(proc_install->params[3].type != GIMP_PDB_STRING) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
|
|
|
"attempted to install procedure \"%s\"\n"
|
|
|
|
"which does not take the standard Plug-In args.",
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (current_plug_in->args[0]),
|
2000-05-17 20:29:38 +08:00
|
|
|
current_plug_in->args[0],
|
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
|
|
|
"attempted to install procedure \"%s\"\n"
|
|
|
|
"in an invalid menu location.\n"
|
|
|
|
"Use either \"<Toolbox>\", \"<Image>\", "
|
1999-09-23 19:49:16 +08:00
|
|
|
"\"<Load>\", or \"<Save>\".",
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (current_plug_in->args[0]),
|
2000-05-17 20:29:38 +08:00
|
|
|
current_plug_in->args[0],
|
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* Sanity check for array arguments */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
for (i = 1; i < proc_install->nparams; i++)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
2001-09-03 08:26:06 +08:00
|
|
|
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
|
2001-05-21 21:58:46 +08:00
|
|
|
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
|
2001-09-03 08:26:06 +08:00
|
|
|
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
|
|
|
|
&&
|
2001-05-21 21:58:46 +08:00
|
|
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
|
|
|
"attempted to install procedure \"%s\"\n"
|
|
|
|
"which fails to comply with the array parameter\n"
|
1999-09-23 19:49:16 +08:00
|
|
|
"passing standard. Argument %d is noncompliant.",
|
2001-08-30 01:48:28 +08:00
|
|
|
g_path_get_basename (current_plug_in->args[0]),
|
2000-05-17 20:29:38 +08:00
|
|
|
current_plug_in->args[0],
|
|
|
|
proc_install->name, i);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2001-09-03 08:26:06 +08:00
|
|
|
|
|
|
|
/* Sanity check strings for UTF-8 validity */
|
|
|
|
valid = FALSE;
|
|
|
|
|
|
|
|
if ((proc_install->menu_path == NULL ||
|
|
|
|
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
|
|
|
|
(g_utf8_validate (proc_install->name, -1, NULL)) &&
|
|
|
|
(proc_install->blurb == NULL ||
|
|
|
|
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
|
|
|
|
(proc_install->help == NULL ||
|
|
|
|
g_utf8_validate (proc_install->help, -1, NULL)) &&
|
|
|
|
(proc_install->author == NULL ||
|
|
|
|
g_utf8_validate (proc_install->author, -1, NULL)) &&
|
|
|
|
(proc_install->copyright == NULL ||
|
|
|
|
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
|
|
|
|
(proc_install->date == NULL ||
|
|
|
|
g_utf8_validate (proc_install->date, -1, NULL)))
|
|
|
|
{
|
|
|
|
valid = TRUE;
|
|
|
|
|
|
|
|
for (i = 0; i < proc_install->nparams && valid; i++)
|
|
|
|
{
|
|
|
|
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
|
|
|
|
(proc_install->params[i].description == NULL ||
|
|
|
|
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
|
|
|
|
valid = FALSE;
|
|
|
|
}
|
|
|
|
for (i = 0; i < proc_install->nreturn_vals && valid; i++)
|
|
|
|
{
|
|
|
|
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
|
|
|
|
(proc_install->return_vals[i].description == NULL ||
|
|
|
|
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
|
|
|
|
valid = FALSE;
|
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-09-03 08:26:06 +08:00
|
|
|
if (!valid)
|
|
|
|
{
|
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
|
|
|
"attempted to install a procedure with invalid UTF-8 strings.\n",
|
|
|
|
g_path_get_basename (current_plug_in->args[0]),
|
|
|
|
current_plug_in->args[0]);
|
|
|
|
return;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* Initialization */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_def = NULL;
|
|
|
|
|
|
|
|
switch (proc_install->type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PLUGIN:
|
|
|
|
case GIMP_EXTENSION:
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_def = current_plug_in->user_data;
|
|
|
|
prog = plug_in_def->prog;
|
|
|
|
|
|
|
|
tmp = plug_in_def->proc_defs;
|
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_TEMPORARY:
|
1998-03-01 09:18:45 +08:00
|
|
|
prog = "none";
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
tmp = current_plug_in->temp_proc_defs;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, proc_install->name) == 0)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
if (proc_install->type == GIMP_TEMPORARY)
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_proc_def_remove (proc_def);
|
|
|
|
else
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_proc_def_destroy (proc_def, TRUE); /* destroys data_only */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
proc_def = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
add_proc_def = FALSE;
|
|
|
|
if (!proc_def)
|
|
|
|
{
|
|
|
|
add_proc_def = TRUE;
|
|
|
|
proc_def = g_new (PlugInProcDef, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
proc_def->prog = g_strdup (prog);
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc_def->menu_path = g_strdup (proc_install->menu_path);
|
|
|
|
proc_def->accelerator = NULL;
|
|
|
|
proc_def->extensions = NULL;
|
|
|
|
proc_def->prefixes = NULL;
|
|
|
|
proc_def->magics = NULL;
|
|
|
|
proc_def->image_types = g_strdup (proc_install->image_types);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_def->image_types_val = plug_in_image_types_parse (proc_def->image_types);
|
1999-01-31 09:08:26 +08:00
|
|
|
/* Install temp one use todays time */
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc_def->mtime = time (NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
proc = &proc_def->db_info;
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* The procedural database procedure */
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->name = g_strdup (proc_install->name);
|
|
|
|
proc->blurb = g_strdup (proc_install->blurb);
|
|
|
|
proc->help = g_strdup (proc_install->help);
|
|
|
|
proc->author = g_strdup (proc_install->author);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->copyright = g_strdup (proc_install->copyright);
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->date = g_strdup (proc_install->date);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->proc_type = proc_install->type;
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->num_args = proc_install->nparams;
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->num_values = proc_install->nreturn_vals;
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->args = g_new (ProcArg, proc->num_args);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->values = g_new (ProcArg, proc->num_values);
|
|
|
|
|
|
|
|
for (i = 0; i < proc->num_args; i++)
|
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->args[i].arg_type = proc_install->params[i].type;
|
|
|
|
proc->args[i].name = g_strdup (proc_install->params[i].name);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->args[i].description = g_strdup (proc_install->params[i].description);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < proc->num_values; i++)
|
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->values[i].arg_type = proc_install->return_vals[i].type;
|
|
|
|
proc->values[i].name = g_strdup (proc_install->return_vals[i].name);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->values[i].description = g_strdup (proc_install->return_vals[i].description);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (proc_install->type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PLUGIN:
|
|
|
|
case GIMP_EXTENSION:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (add_proc_def)
|
|
|
|
plug_in_def->proc_defs = g_slist_prepend (plug_in_def->proc_defs, proc_def);
|
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_TEMPORARY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (add_proc_def)
|
2000-05-08 06:04:51 +08:00
|
|
|
current_plug_in->temp_proc_defs =
|
|
|
|
g_slist_prepend (current_plug_in->temp_proc_defs, proc_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
proc_defs = g_slist_append (proc_defs, proc_def);
|
|
|
|
proc->exec_method.temporary.plug_in = (void *) current_plug_in;
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_register (the_gimp, proc);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* If there is a menu path specified, create a menu entry */
|
|
|
|
if (proc_install->menu_path)
|
|
|
|
{
|
2000-05-08 06:04:51 +08:00
|
|
|
menu_entry = g_new (PlugInMenuEntry, 1);
|
|
|
|
menu_entry->proc_def = proc_def;
|
1999-10-04 00:54:17 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* Below we use a hack to allow translations of Script-Fu paths.
|
|
|
|
* Would be nice if we could solve this properly, but I haven't
|
|
|
|
* found a way yet ... (Sven)
|
|
|
|
*/
|
2000-02-24 04:25:24 +08:00
|
|
|
if (plug_in_def && plug_in_def->locale_domain)
|
2000-05-08 06:04:51 +08:00
|
|
|
menu_entry->domain = plug_in_def->locale_domain;
|
2000-02-28 03:35:39 +08:00
|
|
|
else if (strncmp (proc_def->db_info.name, "script_fu", 9) == 0)
|
2000-05-08 06:04:51 +08:00
|
|
|
menu_entry->domain = "gimp-script-fu";
|
2000-02-24 04:25:24 +08:00
|
|
|
else
|
2000-05-08 06:04:51 +08:00
|
|
|
menu_entry->domain = std_plugins_domain;
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
if (plug_in_def)
|
|
|
|
menu_entry->help_path = plug_in_def->help_path;
|
|
|
|
else
|
|
|
|
menu_entry->help_path = NULL;
|
|
|
|
|
2000-05-08 06:04:51 +08:00
|
|
|
/* plug_in_make_menu_entry frees the menu_entry for us */
|
|
|
|
plug_in_make_menu_entry (NULL, menu_entry, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_handle_proc_uninstall (GPProcUninstall *proc_uninstall)
|
|
|
|
{
|
|
|
|
PlugInProcDef *proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
tmp = current_plug_in->temp_proc_defs;
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, proc_uninstall->name) == 0)
|
|
|
|
{
|
|
|
|
current_plug_in->temp_proc_defs = g_slist_remove (current_plug_in->temp_proc_defs, proc_def);
|
|
|
|
plug_in_proc_def_remove (proc_def);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-02-25 00:11:26 +08:00
|
|
|
static gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
plug_in_write (GIOChannel *channel,
|
|
|
|
guint8 *buf,
|
|
|
|
gulong count)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
gulong bytes;
|
|
|
|
|
|
|
|
while (count > 0)
|
|
|
|
{
|
|
|
|
if ((current_write_buffer_index + count) >= WRITE_BUFFER_SIZE)
|
|
|
|
{
|
|
|
|
bytes = WRITE_BUFFER_SIZE - current_write_buffer_index;
|
|
|
|
memcpy (¤t_write_buffer[current_write_buffer_index], buf, bytes);
|
|
|
|
current_write_buffer_index += bytes;
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!wire_flush (channel))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bytes = count;
|
|
|
|
memcpy (¤t_write_buffer[current_write_buffer_index], buf, bytes);
|
|
|
|
current_write_buffer_index += bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
buf += bytes;
|
|
|
|
count -= bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-02-25 00:11:26 +08:00
|
|
|
static gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
plug_in_flush (GIOChannel *channel)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-08-30 01:48:28 +08:00
|
|
|
GIOStatus status;
|
2001-08-30 09:09:58 +08:00
|
|
|
GError *error = NULL;
|
2001-08-30 01:48:28 +08:00
|
|
|
gint count;
|
|
|
|
guint bytes;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (current_write_buffer_index > 0)
|
|
|
|
{
|
|
|
|
count = 0;
|
|
|
|
while (count != current_write_buffer_index)
|
|
|
|
{
|
2001-08-30 01:48:28 +08:00
|
|
|
do
|
|
|
|
{
|
|
|
|
bytes = 0;
|
|
|
|
status = g_io_channel_write_chars (channel,
|
|
|
|
¤t_write_buffer[count],
|
|
|
|
(current_write_buffer_index - count),
|
|
|
|
&bytes,
|
|
|
|
&error);
|
|
|
|
}
|
|
|
|
while (status == G_IO_STATUS_AGAIN);
|
|
|
|
|
|
|
|
if (status != G_IO_STATUS_NORMAL)
|
2001-08-30 09:09:58 +08:00
|
|
|
{
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
g_warning ("%s: plug_in_flush(): error: %s",
|
|
|
|
g_get_prgname (), error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("%s: plug_in_flush(): error",
|
|
|
|
g_get_prgname ());
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
count += bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
current_write_buffer_index = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_push (PlugIn *plug_in)
|
|
|
|
{
|
|
|
|
if (plug_in)
|
|
|
|
{
|
|
|
|
current_plug_in = plug_in;
|
|
|
|
plug_in_stack = g_slist_prepend (plug_in_stack, current_plug_in);
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
current_readchannel = current_plug_in->my_read;
|
|
|
|
current_writechannel = current_plug_in->my_write;
|
1997-11-25 06:05:25 +08:00
|
|
|
current_write_buffer_index = current_plug_in->write_buffer_index;
|
2000-07-16 20:49:04 +08:00
|
|
|
current_write_buffer = current_plug_in->write_buffer;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
current_readchannel = NULL;
|
|
|
|
current_writechannel = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
current_write_buffer_index = 0;
|
2000-07-16 20:49:04 +08:00
|
|
|
current_write_buffer = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-05-04 03:22:58 +08:00
|
|
|
plug_in_pop (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
|
|
|
|
if (current_plug_in)
|
|
|
|
{
|
|
|
|
current_plug_in->write_buffer_index = current_write_buffer_index;
|
|
|
|
|
|
|
|
tmp = plug_in_stack;
|
|
|
|
plug_in_stack = plug_in_stack->next;
|
|
|
|
tmp->next = NULL;
|
|
|
|
g_slist_free (tmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (plug_in_stack)
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
current_plug_in = plug_in_stack->data;
|
|
|
|
current_readchannel = current_plug_in->my_read;
|
|
|
|
current_writechannel = current_plug_in->my_write;
|
1997-11-25 06:05:25 +08:00
|
|
|
current_write_buffer_index = current_plug_in->write_buffer_index;
|
2000-07-16 20:49:04 +08:00
|
|
|
current_write_buffer = current_plug_in->write_buffer;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
current_plug_in = NULL;
|
|
|
|
current_readchannel = NULL;
|
|
|
|
current_writechannel = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
current_write_buffer_index = 0;
|
2000-07-16 20:49:04 +08:00
|
|
|
current_write_buffer = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_write_rc_string (FILE *fp,
|
|
|
|
gchar *str)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
fputc ('"', fp);
|
|
|
|
|
|
|
|
if (str)
|
|
|
|
while (*str)
|
|
|
|
{
|
1999-03-07 20:56:03 +08:00
|
|
|
if (*str == '\n')
|
|
|
|
{
|
|
|
|
fputc ('\\', fp);
|
|
|
|
fputc ('n', fp);
|
|
|
|
}
|
|
|
|
else if (*str == '\r')
|
|
|
|
{
|
|
|
|
fputc ('\\', fp);
|
|
|
|
fputc ('r', fp);
|
|
|
|
}
|
|
|
|
else if (*str == '\032') /* ^Z is problematic on Windows */
|
|
|
|
{
|
|
|
|
fputc ('\\', fp);
|
|
|
|
fputc ('z', fp);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((*str == '"') || (*str == '\\'))
|
|
|
|
fputc ('\\', fp);
|
|
|
|
fputc (*str, fp);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
str += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fputc ('"', fp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-01-14 11:55:56 +08:00
|
|
|
plug_in_write_rc (const gchar *filename)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
FILE *fp;
|
|
|
|
PlugInDef *plug_in_def;
|
1997-11-25 06:05:25 +08:00
|
|
|
PlugInProcDef *proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
|
|
|
GSList *tmp2;
|
2000-02-25 00:11:26 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
fp = fopen (filename, "w");
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!fp)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tmp = plug_in_defs;
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
plug_in_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (plug_in_def->proc_defs)
|
|
|
|
{
|
1999-03-07 20:56:03 +08:00
|
|
|
fprintf (fp, "(plug-in-def ");
|
|
|
|
plug_in_write_rc_string (fp, plug_in_def->prog);
|
|
|
|
fprintf (fp, " %ld", (long) plug_in_def->mtime);
|
1997-11-25 06:05:25 +08:00
|
|
|
tmp2 = plug_in_def->proc_defs;
|
|
|
|
if (tmp2)
|
|
|
|
fprintf (fp, "\n");
|
|
|
|
|
|
|
|
while (tmp2)
|
|
|
|
{
|
|
|
|
proc_def = tmp2->data;
|
|
|
|
tmp2 = tmp2->next;
|
|
|
|
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\t(proc-def \"%s\" %d\n",
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_def->db_info.name, proc_def->db_info.proc_type);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.blurb);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.help);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.author);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.copyright);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.date);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->menu_path);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->extensions);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->prefixes);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->magics);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t");
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_write_rc_string (fp, proc_def->image_types);
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\n\t\t%d %d\n",
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_def->db_info.num_args, proc_def->db_info.num_values);
|
|
|
|
|
|
|
|
for (i = 0; i < proc_def->db_info.num_args; i++)
|
|
|
|
{
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\t\t(proc-arg %d ",
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_def->db_info.args[i].arg_type);
|
|
|
|
|
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.args[i].name);
|
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.args[i].description);
|
|
|
|
|
|
|
|
fprintf (fp, ")%s",
|
|
|
|
(proc_def->db_info.num_values ||
|
|
|
|
(i < (proc_def->db_info.num_args - 1))) ? "\n" : "");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < proc_def->db_info.num_values; i++)
|
|
|
|
{
|
2000-01-13 12:15:01 +08:00
|
|
|
fprintf (fp, "\t\t(proc-arg %d ",
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_def->db_info.values[i].arg_type);
|
|
|
|
|
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.values[i].name);
|
|
|
|
plug_in_write_rc_string (fp, proc_def->db_info.values[i].description);
|
|
|
|
|
|
|
|
fprintf (fp, ")%s", (i < (proc_def->db_info.num_values - 1)) ? "\n" : "");
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf (fp, ")");
|
|
|
|
|
|
|
|
if (tmp2)
|
|
|
|
fprintf (fp, "\n");
|
|
|
|
}
|
2000-02-24 02:07:53 +08:00
|
|
|
|
|
|
|
if (plug_in_def->locale_domain)
|
|
|
|
{
|
|
|
|
fprintf (fp, "\n\t(locale-def \"%s\"", plug_in_def->locale_domain);
|
|
|
|
if (plug_in_def->locale_path)
|
|
|
|
fprintf (fp, " \"%s\")", plug_in_def->locale_path);
|
|
|
|
else
|
|
|
|
fprintf (fp, ")");
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
if (plug_in_def->help_path)
|
|
|
|
{
|
|
|
|
fprintf (fp, "\n\t(help-def \"%s\")", plug_in_def->help_path);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
fprintf (fp, ")\n");
|
|
|
|
|
|
|
|
if (tmp)
|
|
|
|
fprintf (fp, "\n");
|
|
|
|
}
|
2000-02-24 02:07:53 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
fclose (fp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-02-12 00:14:25 +08:00
|
|
|
plug_in_init_file (const gchar *filename,
|
|
|
|
gpointer loader_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-29 22:09:50 +08:00
|
|
|
GSList *tmp;
|
|
|
|
PlugInDef *plug_in_def;
|
2001-08-30 01:48:28 +08:00
|
|
|
gchar *plug_in_name;
|
|
|
|
gchar *basename;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
basename = g_path_get_basename (filename);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
plug_in_def = NULL;
|
|
|
|
tmp = plug_in_defs;
|
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
plug_in_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
plug_in_name = g_path_get_basename (plug_in_def->prog);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
if (g_ascii_strcasecmp (basename, plug_in_name) == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-09-26 17:57:32 +08:00
|
|
|
g_print ("duplicate plug-in: \"%s\" (skipping)\n", filename);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
g_free (plug_in_name);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_def = NULL;
|
|
|
|
}
|
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
g_free (basename);
|
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
plug_in_def = plug_in_def_new (filename);
|
|
|
|
plug_in_def->mtime = gimp_datafile_mtime ();
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_def->query = TRUE;
|
|
|
|
|
|
|
|
plug_in_defs = g_slist_append (plug_in_defs, plug_in_def);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in_query (PlugInDef *plug_in_def)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
PlugIn *plug_in;
|
|
|
|
WireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
plug_in = plug_in_new (plug_in_def->prog);
|
1997-11-25 06:05:25 +08:00
|
|
|
if (plug_in)
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
plug_in->query = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in->synchronous = TRUE;
|
2000-07-16 20:49:04 +08:00
|
|
|
plug_in->user_data = plug_in_def;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (plug_in_open (plug_in))
|
|
|
|
{
|
|
|
|
plug_in_push (plug_in);
|
|
|
|
|
|
|
|
while (plug_in->open)
|
|
|
|
{
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!wire_read_msg (current_readchannel, &msg))
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_close (current_plug_in, TRUE);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
plug_in_handle_message (&msg);
|
|
|
|
wire_destroy (&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
plug_in_pop ();
|
1998-01-25 09:24:46 +08:00
|
|
|
plug_in_destroy (plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-05-04 03:22:58 +08:00
|
|
|
plug_in_add_to_db (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
PlugInProcDef *proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
Argument args[4];
|
|
|
|
Argument *return_vals;
|
|
|
|
GSList *tmp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
tmp = proc_defs;
|
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
if (proc_def->prog && (proc_def->db_info.proc_type != GIMP_INTERNAL))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
proc_def->db_info.exec_method.plug_in.filename = proc_def->prog;
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_register (the_gimp, &proc_def->db_info);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (tmp = proc_defs; tmp; tmp = tmp->next)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
|
|
|
|
if (proc_def->extensions || proc_def->prefixes || proc_def->magics)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
args[0].arg_type = GIMP_PDB_STRING;
|
1997-11-25 06:05:25 +08:00
|
|
|
args[0].value.pdb_pointer = proc_def->db_info.name;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
args[1].arg_type = GIMP_PDB_STRING;
|
1997-11-25 06:05:25 +08:00
|
|
|
args[1].value.pdb_pointer = proc_def->extensions;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
args[2].arg_type = GIMP_PDB_STRING;
|
1997-11-25 06:05:25 +08:00
|
|
|
args[2].value.pdb_pointer = proc_def->prefixes;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
args[3].arg_type = GIMP_PDB_STRING;
|
1997-11-25 06:05:25 +08:00
|
|
|
args[3].value.pdb_pointer = proc_def->magics;
|
|
|
|
|
|
|
|
if (proc_def->image_types)
|
|
|
|
{
|
2001-01-25 09:20:05 +08:00
|
|
|
return_vals =
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_execute (the_gimp,
|
|
|
|
"gimp_register_save_handler",
|
2001-01-25 09:20:05 +08:00
|
|
|
args);
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (return_vals);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-01-25 09:20:05 +08:00
|
|
|
return_vals =
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_execute (the_gimp,
|
|
|
|
"gimp_register_magic_load_handler",
|
2001-01-25 09:20:05 +08:00
|
|
|
args);
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (return_vals);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* The following function has to be a GTraverseFunction,
|
2000-05-08 06:04:51 +08:00
|
|
|
* but is also called directly. Please note that it frees the
|
|
|
|
* menu_entry strcuture. --Sven
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
plug_in_make_menu_entry (gpointer foo,
|
|
|
|
PlugInMenuEntry *menu_entry,
|
|
|
|
gpointer bar)
|
|
|
|
{
|
|
|
|
GimpItemFactoryEntry entry;
|
|
|
|
gchar *help_page;
|
2001-08-30 01:48:28 +08:00
|
|
|
gchar *basename;
|
|
|
|
gchar *lowercase_page;
|
|
|
|
|
|
|
|
basename = g_path_get_basename (menu_entry->proc_def->prog);
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
if (menu_entry->help_path)
|
|
|
|
{
|
|
|
|
help_page = g_strconcat (menu_entry->help_path,
|
|
|
|
"@", /* HACK: locale subdir */
|
2001-08-30 01:48:28 +08:00
|
|
|
basename,
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
".html",
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
help_page = g_strconcat ("filters/", /* _not_ G_DIR_SEPARATOR_S */
|
2001-08-30 01:48:28 +08:00
|
|
|
basename,
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
".html",
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
g_free (basename);
|
|
|
|
|
2001-09-26 20:52:12 +08:00
|
|
|
lowercase_page = g_ascii_strdown (help_page, -1);
|
2001-08-30 01:48:28 +08:00
|
|
|
|
|
|
|
g_free (help_page);
|
|
|
|
|
2000-05-08 06:04:51 +08:00
|
|
|
entry.entry.path = menu_entry->proc_def->menu_path;
|
|
|
|
entry.entry.accelerator = menu_entry->proc_def->accelerator;
|
|
|
|
entry.entry.callback = plug_in_callback;
|
|
|
|
entry.entry.callback_action = 0;
|
|
|
|
entry.entry.item_type = NULL;
|
2001-07-10 02:55:05 +08:00
|
|
|
entry.quark_string = NULL;
|
2001-08-30 01:48:28 +08:00
|
|
|
entry.help_page = lowercase_page;
|
2000-05-08 06:04:51 +08:00
|
|
|
entry.description = NULL;
|
|
|
|
|
|
|
|
menus_create_item_from_full_path (&entry,
|
|
|
|
menu_entry->domain,
|
|
|
|
&menu_entry->proc_def->db_info);
|
|
|
|
g_free (menu_entry);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
1999-05-04 03:22:58 +08:00
|
|
|
plug_in_make_menu (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-08 06:04:51 +08:00
|
|
|
PlugInDef *plug_in_def;
|
|
|
|
PlugInProcDef *proc_def;
|
|
|
|
PlugInMenuEntry *menu_entry;
|
2000-02-24 04:25:24 +08:00
|
|
|
GSList *domains = NULL;
|
|
|
|
GSList *procs;
|
1997-11-25 06:05:25 +08:00
|
|
|
GSList *tmp;
|
2000-05-08 06:04:51 +08:00
|
|
|
GTree *menu_entries;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
#ifdef ENABLE_NLS
|
2000-02-24 07:21:31 +08:00
|
|
|
bindtextdomain (std_plugins_domain, LOCALEDIR);
|
2001-08-30 08:48:38 +08:00
|
|
|
bind_textdomain_codeset (std_plugins_domain, "UTF-8");
|
2000-02-24 07:21:31 +08:00
|
|
|
domains = g_slist_append (domains, std_plugins_domain);
|
2000-05-08 06:04:51 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_NLS
|
|
|
|
menu_entries = g_tree_new ((GCompareFunc)strcoll);
|
|
|
|
#else
|
|
|
|
menu_entries = g_tree_new ((GCompareFunc)strcmp);
|
|
|
|
#endif
|
2000-02-24 04:25:24 +08:00
|
|
|
|
|
|
|
tmp = plug_in_defs;
|
1997-11-25 06:05:25 +08:00
|
|
|
while (tmp)
|
|
|
|
{
|
2000-02-24 04:25:24 +08:00
|
|
|
plug_in_def = tmp->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
tmp = tmp->next;
|
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
procs = plug_in_def->proc_defs;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
if (!procs)
|
|
|
|
continue;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
#ifdef ENABLE_NLS
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
gchar *domain;
|
|
|
|
GSList *list;
|
|
|
|
gboolean found = FALSE;
|
1999-10-04 00:54:17 +08:00
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
if (plug_in_def->locale_domain)
|
|
|
|
{
|
|
|
|
domain = plug_in_def->locale_domain;
|
|
|
|
for (list = domains; list && !found; list = list->next)
|
|
|
|
{
|
|
|
|
if (strcmp (domain, (gchar*)(list->data)) == 0)
|
|
|
|
found = TRUE;
|
|
|
|
}
|
|
|
|
if (!found)
|
|
|
|
{
|
|
|
|
domains = g_slist_append (domains, domain);
|
|
|
|
if (plug_in_def->locale_path)
|
|
|
|
bindtextdomain (domain, plug_in_def->locale_path);
|
|
|
|
else
|
|
|
|
bindtextdomain (domain, LOCALEDIR);
|
2001-08-30 08:48:38 +08:00
|
|
|
bind_textdomain_codeset (domain, "UTF-8");
|
2000-02-24 04:25:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* ENABLE_NLS */
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
while (procs)
|
|
|
|
{
|
|
|
|
proc_def = procs->data;
|
|
|
|
procs = procs->next;
|
1999-10-04 00:54:17 +08:00
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
if (proc_def->prog && proc_def->menu_path && (!proc_def->extensions &&
|
|
|
|
!proc_def->prefixes &&
|
|
|
|
!proc_def->magics))
|
|
|
|
{
|
2000-05-08 06:04:51 +08:00
|
|
|
menu_entry = g_new (PlugInMenuEntry, 1);
|
|
|
|
menu_entry->proc_def = proc_def;
|
|
|
|
menu_entry->domain = plug_in_def->locale_domain ?
|
|
|
|
plug_in_def->locale_domain : std_plugins_domain;
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
menu_entry->help_path = plug_in_def->help_path;
|
2000-05-08 06:04:51 +08:00
|
|
|
|
|
|
|
g_tree_insert (menu_entries,
|
|
|
|
dgettext (menu_entry->domain, proc_def->menu_path),
|
|
|
|
menu_entry);
|
2000-02-24 04:25:24 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
2000-05-08 06:04:51 +08:00
|
|
|
|
|
|
|
g_tree_traverse (menu_entries,
|
|
|
|
(GTraverseFunc)plug_in_make_menu_entry, G_IN_ORDER, NULL);
|
|
|
|
g_tree_destroy (menu_entries);
|
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
g_slist_free (domains);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-02-24 04:25:24 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
|
|
|
plug_in_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
GDisplay *gdisplay;
|
1997-11-25 06:05:25 +08:00
|
|
|
ProcRecord *proc_rec;
|
2000-07-16 20:49:04 +08:00
|
|
|
Argument *args;
|
2000-02-25 00:11:26 +08:00
|
|
|
gint i;
|
|
|
|
gint gdisp_ID = -1;
|
|
|
|
gint argc = 0; /* calm down a gcc warning. */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* get the active gdisplay */
|
|
|
|
gdisplay = gdisplay_active ();
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
proc_rec = (ProcRecord *) client_data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* construct the procedures arguments */
|
2000-07-16 20:49:04 +08:00
|
|
|
args = g_new0 (Argument, proc_rec->num_args);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* initialize the argument types */
|
|
|
|
for (i = 0; i < proc_rec->num_args; i++)
|
|
|
|
args[i].arg_type = proc_rec->args[i].arg_type;
|
|
|
|
|
|
|
|
switch (proc_rec->proc_type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_EXTENSION:
|
1997-11-25 06:05:25 +08:00
|
|
|
/* initialize the first argument */
|
|
|
|
args[0].value.pdb_int = RUN_INTERACTIVE;
|
1998-10-22 03:10:14 +08:00
|
|
|
argc = 1;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PLUGIN:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (gdisplay)
|
|
|
|
{
|
1998-06-14 12:33:27 +08:00
|
|
|
gdisp_ID = gdisplay->ID;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* initialize the first 3 plug-in arguments */
|
|
|
|
args[0].value.pdb_int = RUN_INTERACTIVE;
|
2001-04-13 22:50:43 +08:00
|
|
|
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
|
2001-01-15 05:11:52 +08:00
|
|
|
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
|
1998-10-22 03:10:14 +08:00
|
|
|
argc = 3;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("Uh-oh, no active gdisplay for the plug-in!");
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (args);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_TEMPORARY:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[0].value.pdb_int = RUN_INTERACTIVE;
|
1998-10-25 04:11:17 +08:00
|
|
|
argc = 1;
|
1997-11-25 06:05:25 +08:00
|
|
|
if (proc_rec->num_args >= 3 &&
|
2001-05-21 21:58:46 +08:00
|
|
|
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE &&
|
|
|
|
proc_rec->args[2].arg_type == GIMP_PDB_DRAWABLE)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (gdisplay)
|
|
|
|
{
|
1998-06-14 12:33:27 +08:00
|
|
|
gdisp_ID = gdisplay->ID;
|
|
|
|
|
2001-04-13 22:50:43 +08:00
|
|
|
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
|
2001-01-15 05:11:52 +08:00
|
|
|
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
|
1998-10-22 03:10:14 +08:00
|
|
|
argc = 3;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("Uh-oh, no active gdisplay for the temporary procedure!");
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (args);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
1999-09-23 19:49:16 +08:00
|
|
|
g_error ("Unknown procedure type.");
|
1998-10-22 03:10:14 +08:00
|
|
|
g_free (args);
|
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* run the plug-in procedure */
|
1998-10-22 03:10:14 +08:00
|
|
|
plug_in_run (proc_rec, args, argc, FALSE, TRUE, gdisp_ID);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
if (proc_rec->proc_type == GIMP_PLUGIN)
|
1997-11-25 06:05:25 +08:00
|
|
|
last_plug_in = proc_rec;
|
|
|
|
|
|
|
|
g_free (args);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-02-14 09:53:23 +08:00
|
|
|
plug_in_proc_def_insert (PlugInProcDef *proc_def,
|
|
|
|
void (*superceed_fn)(void*))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
PlugInProcDef *tmp_proc_def;
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
|
|
|
GSList *prev;
|
1997-11-25 06:05:25 +08:00
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
prev = NULL;
|
2000-07-16 20:49:04 +08:00
|
|
|
tmp = proc_defs;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
tmp_proc_def = tmp->data;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, tmp_proc_def->db_info.name) == 0)
|
|
|
|
{
|
|
|
|
tmp->data = proc_def;
|
|
|
|
|
|
|
|
if (proc_def->menu_path)
|
|
|
|
g_free (proc_def->menu_path);
|
|
|
|
if (proc_def->accelerator)
|
|
|
|
g_free (proc_def->accelerator);
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
proc_def->menu_path = tmp_proc_def->menu_path;
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_def->accelerator = tmp_proc_def->accelerator;
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
tmp_proc_def->menu_path = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
tmp_proc_def->accelerator = NULL;
|
|
|
|
|
1999-02-14 09:53:23 +08:00
|
|
|
if (superceed_fn)
|
2000-07-16 20:49:04 +08:00
|
|
|
(* superceed_fn) (tmp_proc_def);
|
1999-02-14 09:53:23 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_proc_def_destroy (tmp_proc_def, FALSE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (!proc_def->menu_path ||
|
|
|
|
(tmp_proc_def->menu_path &&
|
|
|
|
(strcmp (proc_def->menu_path, tmp_proc_def->menu_path) < 0)))
|
|
|
|
{
|
|
|
|
list = g_slist_alloc ();
|
|
|
|
list->data = proc_def;
|
|
|
|
|
|
|
|
list->next = tmp;
|
|
|
|
if (prev)
|
|
|
|
prev->next = list;
|
|
|
|
else
|
|
|
|
proc_defs = list;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
prev = tmp;
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
proc_defs = g_slist_append (proc_defs, proc_def);
|
|
|
|
}
|
|
|
|
|
1999-02-14 09:53:23 +08:00
|
|
|
/* called when plug_in_proc_def_insert causes a proc_def to be
|
2000-07-16 20:49:04 +08:00
|
|
|
* overridden and thus g_free()d.
|
|
|
|
*/
|
1999-02-14 09:53:23 +08:00
|
|
|
static void
|
|
|
|
plug_in_proc_def_dead (void *freed_proc_def)
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
GSList *tmp;
|
|
|
|
PlugInDef *plug_in_def;
|
1999-02-14 09:53:23 +08:00
|
|
|
PlugInProcDef *proc_def = freed_proc_def;
|
|
|
|
|
1999-09-23 19:49:16 +08:00
|
|
|
g_warning ("removing duplicate PDB procedure \"%s\"",
|
1999-02-14 09:53:23 +08:00
|
|
|
proc_def->db_info.name);
|
|
|
|
|
|
|
|
/* search the plugin list to see if any plugins had references to
|
2000-07-16 20:49:04 +08:00
|
|
|
* the recently freed proc_def.
|
|
|
|
*/
|
|
|
|
for (tmp = plug_in_defs; tmp; tmp = g_slist_next (tmp))
|
1999-02-14 09:53:23 +08:00
|
|
|
{
|
|
|
|
plug_in_def = tmp->data;
|
|
|
|
|
|
|
|
plug_in_def->proc_defs = g_slist_remove (plug_in_def->proc_defs,
|
|
|
|
freed_proc_def);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
|
|
|
plug_in_proc_def_remove (PlugInProcDef *proc_def)
|
|
|
|
{
|
|
|
|
/* Destroy the menu item */
|
|
|
|
if (proc_def->menu_path)
|
1999-11-25 19:35:48 +08:00
|
|
|
menus_destroy (proc_def->menu_path);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Unregister the procedural database entry */
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_unregister (the_gimp, proc_def->db_info.name);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Remove the defintion from the global list */
|
|
|
|
proc_defs = g_slist_remove (proc_defs, proc_def);
|
|
|
|
|
|
|
|
/* Destroy the definition */
|
2000-03-28 21:35:50 +08:00
|
|
|
plug_in_proc_def_destroy (proc_def, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_proc_def_destroy (PlugInProcDef *proc_def,
|
2000-02-25 00:11:26 +08:00
|
|
|
gboolean data_only)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-25 00:11:26 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (proc_def->prog)
|
|
|
|
g_free (proc_def->prog);
|
|
|
|
if (proc_def->menu_path)
|
|
|
|
g_free (proc_def->menu_path);
|
|
|
|
if (proc_def->accelerator)
|
|
|
|
g_free (proc_def->accelerator);
|
|
|
|
if (proc_def->extensions)
|
|
|
|
g_free (proc_def->extensions);
|
|
|
|
if (proc_def->prefixes)
|
|
|
|
g_free (proc_def->prefixes);
|
|
|
|
if (proc_def->magics)
|
|
|
|
g_free (proc_def->magics);
|
|
|
|
if (proc_def->image_types)
|
|
|
|
g_free (proc_def->image_types);
|
|
|
|
if (proc_def->db_info.name)
|
|
|
|
g_free (proc_def->db_info.name);
|
|
|
|
if (proc_def->db_info.blurb)
|
|
|
|
g_free (proc_def->db_info.blurb);
|
|
|
|
if (proc_def->db_info.help)
|
|
|
|
g_free (proc_def->db_info.help);
|
|
|
|
if (proc_def->db_info.author)
|
|
|
|
g_free (proc_def->db_info.author);
|
|
|
|
if (proc_def->db_info.copyright)
|
|
|
|
g_free (proc_def->db_info.copyright);
|
|
|
|
if (proc_def->db_info.date)
|
|
|
|
g_free (proc_def->db_info.date);
|
|
|
|
|
|
|
|
for (i = 0; i < proc_def->db_info.num_args; i++)
|
|
|
|
{
|
|
|
|
if (proc_def->db_info.args[i].name)
|
|
|
|
g_free (proc_def->db_info.args[i].name);
|
|
|
|
if (proc_def->db_info.args[i].description)
|
|
|
|
g_free (proc_def->db_info.args[i].description);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < proc_def->db_info.num_values; i++)
|
|
|
|
{
|
|
|
|
if (proc_def->db_info.values[i].name)
|
|
|
|
g_free (proc_def->db_info.values[i].name);
|
|
|
|
if (proc_def->db_info.values[i].description)
|
|
|
|
g_free (proc_def->db_info.values[i].description);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (proc_def->db_info.args)
|
|
|
|
g_free (proc_def->db_info.args);
|
|
|
|
if (proc_def->db_info.values)
|
|
|
|
g_free (proc_def->db_info.values);
|
|
|
|
|
|
|
|
if (!data_only)
|
|
|
|
g_free (proc_def);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Argument *
|
|
|
|
plug_in_temp_run (ProcRecord *proc_rec,
|
1998-10-22 03:10:14 +08:00
|
|
|
Argument *args,
|
2000-02-25 00:11:26 +08:00
|
|
|
gint argc)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
Argument *return_vals;
|
|
|
|
PlugIn *plug_in;
|
|
|
|
GPProcRun proc_run;
|
|
|
|
gint old_recurse;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return_vals = NULL;
|
|
|
|
|
|
|
|
plug_in = (PlugIn *) proc_rec->exec_method.temporary.plug_in;
|
|
|
|
|
|
|
|
if (plug_in)
|
|
|
|
{
|
|
|
|
if (plug_in->busy)
|
|
|
|
{
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
plug_in->busy = TRUE;
|
|
|
|
plug_in_push (plug_in);
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
proc_run.name = proc_rec->name;
|
1998-10-22 03:10:14 +08:00
|
|
|
proc_run.nparams = argc;
|
2000-07-16 20:49:04 +08:00
|
|
|
proc_run.params = plug_in_args_to_params (args, argc, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
if (!gp_temp_proc_run_write (current_writechannel, &proc_run) ||
|
|
|
|
!wire_flush (current_writechannel))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2000-06-07 19:58:45 +08:00
|
|
|
plug_in_pop ();
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
|
|
|
|
|
|
|
|
old_recurse = plug_in->recurse;
|
|
|
|
plug_in->recurse = TRUE;
|
|
|
|
|
1998-09-19 08:40:27 +08:00
|
|
|
/* gtk_main (); */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-09-19 08:40:27 +08:00
|
|
|
/* return_vals = plug_in_get_current_return_vals (proc_rec); */
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in->recurse = old_recurse;
|
|
|
|
plug_in->busy = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
|
|
|
return return_vals;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Argument*
|
|
|
|
plug_in_params_to_args (GPParam *params,
|
2000-02-25 00:11:26 +08:00
|
|
|
gint nparams,
|
|
|
|
gboolean full_copy)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
Argument *args;
|
|
|
|
gchar **stringarray;
|
2001-01-25 09:20:05 +08:00
|
|
|
gint count;
|
|
|
|
gint i, j;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (nparams == 0)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
args = g_new (Argument, nparams);
|
|
|
|
|
|
|
|
for (i = 0; i < nparams; i++)
|
|
|
|
{
|
|
|
|
args[i].arg_type = params[i].type;
|
|
|
|
|
|
|
|
switch (args[i].arg_type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT32:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_int32;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT16:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_int16;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT8:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_int8;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_FLOAT:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_float = params[i].data.d_float;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRING:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
args[i].value.pdb_pointer = g_strdup (params[i].data.d_string);
|
|
|
|
else
|
|
|
|
args[i].value.pdb_pointer = params[i].data.d_string;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT32ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
count = args[i-1].value.pdb_int;
|
|
|
|
args[i].value.pdb_pointer = g_new (gint32, count);
|
2001-01-25 09:20:05 +08:00
|
|
|
memcpy (args[i].value.pdb_pointer,
|
|
|
|
params[i].data.d_int32array, count * 4);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
args[i].value.pdb_pointer = params[i].data.d_int32array;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT16ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
count = args[i-1].value.pdb_int;
|
|
|
|
args[i].value.pdb_pointer = g_new (gint16, count);
|
2001-01-25 09:20:05 +08:00
|
|
|
memcpy (args[i].value.pdb_pointer,
|
|
|
|
params[i].data.d_int16array, count * 2);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
args[i].value.pdb_pointer = params[i].data.d_int16array;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT8ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
count = args[i-1].value.pdb_int;
|
|
|
|
args[i].value.pdb_pointer = g_new (gint8, count);
|
2001-01-25 09:20:05 +08:00
|
|
|
memcpy (args[i].value.pdb_pointer,
|
|
|
|
params[i].data.d_int8array, count);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
args[i].value.pdb_pointer = params[i].data.d_int8array;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_FLOATARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
count = args[i-1].value.pdb_int;
|
|
|
|
args[i].value.pdb_pointer = g_new (gdouble, count);
|
2001-01-25 09:20:05 +08:00
|
|
|
memcpy (args[i].value.pdb_pointer,
|
|
|
|
params[i].data.d_floatarray, count * 8);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
args[i].value.pdb_pointer = params[i].data.d_floatarray;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRINGARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
2001-01-25 09:20:05 +08:00
|
|
|
args[i].value.pdb_pointer = g_new (gchar *,
|
|
|
|
args[i-1].value.pdb_int);
|
1997-11-25 06:05:25 +08:00
|
|
|
stringarray = args[i].value.pdb_pointer;
|
|
|
|
|
|
|
|
for (j = 0; j < args[i-1].value.pdb_int; j++)
|
|
|
|
stringarray[j] = g_strdup (params[i].data.d_stringarray[j]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
args[i].value.pdb_pointer = params[i].data.d_stringarray;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_COLOR:
|
2001-01-25 09:20:05 +08:00
|
|
|
args[i].value.pdb_color = params[i].data.d_color;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_REGION:
|
1999-09-23 19:49:16 +08:00
|
|
|
g_message ("the \"region\" arg type is not currently supported");
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_DISPLAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_display;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_IMAGE:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_image;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_LAYER:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_layer;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_CHANNEL:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_channel;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_DRAWABLE:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_drawable;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_SELECTION:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_selection;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_BOUNDARY:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_boundary;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_PATH:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_path;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
1998-10-08 16:15:21 +08:00
|
|
|
if (full_copy)
|
2000-05-27 06:28:40 +08:00
|
|
|
args[i].value.pdb_pointer =
|
|
|
|
gimp_parasite_copy ((GimpParasite *) &(params[i].data.d_parasite));
|
1998-10-08 16:15:21 +08:00
|
|
|
else
|
2001-01-25 09:20:05 +08:00
|
|
|
args[i].value.pdb_pointer = (gpointer) &(params[i].data.d_parasite);
|
1998-10-08 16:15:21 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STATUS:
|
1997-11-25 06:05:25 +08:00
|
|
|
args[i].value.pdb_int = params[i].data.d_status;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_END:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return args;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GPParam*
|
|
|
|
plug_in_args_to_params (Argument *args,
|
2000-07-16 20:49:04 +08:00
|
|
|
gint nargs,
|
|
|
|
gboolean full_copy)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
GPParam *params;
|
|
|
|
gchar **stringarray;
|
2001-01-25 09:20:05 +08:00
|
|
|
gint i, j;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (nargs == 0)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
params = g_new (GPParam, nargs);
|
|
|
|
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
{
|
|
|
|
params[i].type = args[i].arg_type;
|
|
|
|
|
|
|
|
switch (args[i].arg_type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT32:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_int32 = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT16:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_int16 = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT8:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_int8 = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_FLOAT:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_float = args[i].value.pdb_float;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRING:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
params[i].data.d_string = g_strdup (args[i].value.pdb_pointer);
|
|
|
|
else
|
|
|
|
params[i].data.d_string = args[i].value.pdb_pointer;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT32ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
params[i].data.d_int32array = g_new (gint32, params[i-1].data.d_int32);
|
|
|
|
memcpy (params[i].data.d_int32array,
|
|
|
|
args[i].value.pdb_pointer,
|
|
|
|
params[i-1].data.d_int32 * 4);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
params[i].data.d_int32array = args[i].value.pdb_pointer;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT16ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
params[i].data.d_int16array = g_new (gint16, params[i-1].data.d_int32);
|
|
|
|
memcpy (params[i].data.d_int16array,
|
|
|
|
args[i].value.pdb_pointer,
|
|
|
|
params[i-1].data.d_int32 * 2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
params[i].data.d_int16array = args[i].value.pdb_pointer;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT8ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
params[i].data.d_int8array = g_new (gint8, params[i-1].data.d_int32);
|
|
|
|
memcpy (params[i].data.d_int8array,
|
|
|
|
args[i].value.pdb_pointer,
|
|
|
|
params[i-1].data.d_int32);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
params[i].data.d_int8array = args[i].value.pdb_pointer;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_FLOATARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
params[i].data.d_floatarray = g_new (gdouble, params[i-1].data.d_int32);
|
|
|
|
memcpy (params[i].data.d_floatarray,
|
|
|
|
args[i].value.pdb_pointer,
|
|
|
|
params[i-1].data.d_int32 * 8);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
params[i].data.d_floatarray = args[i].value.pdb_pointer;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRINGARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
|
|
|
params[i].data.d_stringarray = g_new (gchar*, params[i-1].data.d_int32);
|
|
|
|
stringarray = args[i].value.pdb_pointer;
|
|
|
|
|
|
|
|
for (j = 0; j < params[i-1].data.d_int32; j++)
|
|
|
|
params[i].data.d_stringarray[j] = g_strdup (stringarray[j]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
params[i].data.d_stringarray = args[i].value.pdb_pointer;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_COLOR:
|
2001-01-25 09:20:05 +08:00
|
|
|
params[i].data.d_color = args[i].value.pdb_color;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_REGION:
|
1999-09-23 19:49:16 +08:00
|
|
|
g_message ("the \"region\" arg type is not currently supported");
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_DISPLAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_display = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_IMAGE:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_image = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_LAYER:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_layer = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_CHANNEL:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_channel = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_DRAWABLE:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_drawable = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_SELECTION:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_selection = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_BOUNDARY:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_boundary = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_PATH:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_path = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
1998-10-08 16:15:21 +08:00
|
|
|
if (full_copy)
|
|
|
|
{
|
2000-05-27 06:28:40 +08:00
|
|
|
GimpParasite *tmp;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2000-05-27 06:28:40 +08:00
|
|
|
tmp = gimp_parasite_copy (args[i].value.pdb_pointer);
|
1998-10-08 16:15:21 +08:00
|
|
|
if (tmp == NULL)
|
2000-05-27 06:28:40 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
params[i].data.d_parasite.name = 0;
|
2000-05-27 06:28:40 +08:00
|
|
|
params[i].data.d_parasite.flags = 0;
|
2000-07-16 20:49:04 +08:00
|
|
|
params[i].data.d_parasite.size = 0;
|
|
|
|
params[i].data.d_parasite.data = 0;
|
2000-05-27 06:28:40 +08:00
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
else
|
2000-05-27 06:28:40 +08:00
|
|
|
{
|
|
|
|
memcpy (¶ms[i].data.d_parasite, tmp,
|
|
|
|
sizeof (GimpParasite));
|
|
|
|
g_free (tmp);
|
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (args[i].value.pdb_pointer == NULL)
|
2000-05-27 06:28:40 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
params[i].data.d_parasite.name = 0;
|
2000-05-27 06:28:40 +08:00
|
|
|
params[i].data.d_parasite.flags = 0;
|
2000-07-16 20:49:04 +08:00
|
|
|
params[i].data.d_parasite.size = 0;
|
|
|
|
params[i].data.d_parasite.data = 0;
|
2000-05-27 06:28:40 +08:00
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
else
|
|
|
|
memcpy (¶ms[i].data.d_parasite,
|
2000-05-27 06:28:40 +08:00
|
|
|
(GimpParasite *) (args[i].value.pdb_pointer),
|
|
|
|
sizeof (GimpParasite));
|
1998-10-08 16:15:21 +08:00
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STATUS:
|
1997-11-25 06:05:25 +08:00
|
|
|
params[i].data.d_status = args[i].value.pdb_int;
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_END:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return params;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_params_destroy (GPParam *params,
|
2000-02-25 00:11:26 +08:00
|
|
|
gint nparams,
|
|
|
|
gboolean full_destroy)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-25 00:11:26 +08:00
|
|
|
gint i, j;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
for (i = 0; i < nparams; i++)
|
|
|
|
{
|
|
|
|
switch (params[i].type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT32:
|
|
|
|
case GIMP_PDB_INT16:
|
|
|
|
case GIMP_PDB_INT8:
|
|
|
|
case GIMP_PDB_FLOAT:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRING:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (params[i].data.d_string);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT32ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (params[i].data.d_int32array);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT16ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (params[i].data.d_int16array);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT8ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (params[i].data.d_int8array);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_FLOATARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (params[i].data.d_floatarray);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRINGARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
{
|
|
|
|
for (j = 0; j < params[i-1].data.d_int32; j++)
|
|
|
|
g_free (params[i].data.d_stringarray[j]);
|
|
|
|
g_free (params[i].data.d_stringarray);
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_COLOR:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_REGION:
|
1999-09-23 19:49:16 +08:00
|
|
|
g_message ("the \"region\" arg type is not currently supported");
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_DISPLAY:
|
|
|
|
case GIMP_PDB_IMAGE:
|
|
|
|
case GIMP_PDB_LAYER:
|
|
|
|
case GIMP_PDB_CHANNEL:
|
|
|
|
case GIMP_PDB_DRAWABLE:
|
|
|
|
case GIMP_PDB_SELECTION:
|
|
|
|
case GIMP_PDB_BOUNDARY:
|
|
|
|
case GIMP_PDB_PATH:
|
1998-10-08 16:15:21 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
1998-10-08 16:15:21 +08:00
|
|
|
if (full_destroy)
|
|
|
|
if (params[i].data.d_parasite.data)
|
|
|
|
{
|
1998-10-14 10:54:02 +08:00
|
|
|
g_free (params[i].data.d_parasite.name);
|
1998-10-08 16:15:21 +08:00
|
|
|
g_free (params[i].data.d_parasite.data);
|
1998-10-14 10:54:02 +08:00
|
|
|
params[i].data.d_parasite.name = 0;
|
1998-10-08 16:15:21 +08:00
|
|
|
params[i].data.d_parasite.data = 0;
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STATUS:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_END:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (params);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_args_destroy (Argument *args,
|
2000-02-25 00:11:26 +08:00
|
|
|
gint nargs,
|
|
|
|
gboolean full_destroy)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
gchar **stringarray;
|
2000-07-16 20:49:04 +08:00
|
|
|
gint count;
|
|
|
|
gint i, j;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
{
|
|
|
|
switch (args[i].arg_type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT32:
|
|
|
|
case GIMP_PDB_INT16:
|
|
|
|
case GIMP_PDB_INT8:
|
|
|
|
case GIMP_PDB_FLOAT:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRING:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (args[i].value.pdb_pointer);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT32ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (args[i].value.pdb_pointer);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT16ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (args[i].value.pdb_pointer);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_INT8ARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (args[i].value.pdb_pointer);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_FLOATARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
g_free (args[i].value.pdb_pointer);
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRINGARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (full_destroy)
|
|
|
|
{
|
|
|
|
count = args[i-1].value.pdb_int;
|
|
|
|
stringarray = args[i].value.pdb_pointer;
|
|
|
|
|
|
|
|
for (j = 0; j < count; j++)
|
|
|
|
g_free (stringarray[j]);
|
|
|
|
|
|
|
|
g_free (args[i].value.pdb_pointer);
|
|
|
|
}
|
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_COLOR:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_REGION:
|
1999-09-23 19:49:16 +08:00
|
|
|
g_message ("the \"region\" arg type is not currently supported");
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_DISPLAY:
|
|
|
|
case GIMP_PDB_IMAGE:
|
|
|
|
case GIMP_PDB_LAYER:
|
|
|
|
case GIMP_PDB_CHANNEL:
|
|
|
|
case GIMP_PDB_DRAWABLE:
|
|
|
|
case GIMP_PDB_SELECTION:
|
|
|
|
case GIMP_PDB_BOUNDARY:
|
|
|
|
case GIMP_PDB_PATH:
|
1998-10-08 16:15:21 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
1998-10-08 16:15:21 +08:00
|
|
|
if (full_destroy)
|
2000-05-27 06:28:40 +08:00
|
|
|
{
|
|
|
|
gimp_parasite_free ((GimpParasite *) (args[i].value.pdb_pointer));
|
|
|
|
args[i].value.pdb_pointer = NULL;
|
|
|
|
}
|
1998-10-08 16:15:21 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STATUS:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_END:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (args);
|
|
|
|
}
|
|
|
|
|
2000-02-25 00:11:26 +08:00
|
|
|
gint
|
|
|
|
plug_in_image_types_parse (gchar *image_types)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-10 11:02:55 +08:00
|
|
|
gchar *type_spec = image_types;
|
2000-05-27 06:28:40 +08:00
|
|
|
gint types = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-01-03 04:52:57 +08:00
|
|
|
/*
|
|
|
|
* If the plug_in registers with image_type == NULL or "", return 0
|
|
|
|
* By doing so it won't be touched by plug_in_set_menu_sensitivity()
|
|
|
|
*/
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!image_types)
|
2000-01-03 04:52:57 +08:00
|
|
|
return types;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
while (*image_types)
|
|
|
|
{
|
|
|
|
while (*image_types &&
|
|
|
|
((*image_types == ' ') ||
|
|
|
|
(*image_types == '\t') ||
|
|
|
|
(*image_types == ',')))
|
|
|
|
image_types++;
|
|
|
|
|
|
|
|
if (*image_types)
|
|
|
|
{
|
|
|
|
if (strncmp (image_types, "RGBA", 4) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_RGBA_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 4;
|
|
|
|
}
|
|
|
|
else if (strncmp (image_types, "RGB*", 4) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 4;
|
|
|
|
}
|
|
|
|
else if (strncmp (image_types, "RGB", 3) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_RGB_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 3;
|
|
|
|
}
|
|
|
|
else if (strncmp (image_types, "GRAYA", 5) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_GRAYA_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 5;
|
|
|
|
}
|
|
|
|
else if (strncmp (image_types, "GRAY*", 5) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 5;
|
|
|
|
}
|
|
|
|
else if (strncmp (image_types, "GRAY", 4) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_GRAY_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 4;
|
|
|
|
}
|
|
|
|
else if (strncmp (image_types, "INDEXEDA", 8) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_INDEXEDA_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 8;
|
|
|
|
}
|
|
|
|
else if (strncmp (image_types, "INDEXED*", 8) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 8;
|
|
|
|
}
|
|
|
|
else if (strncmp (image_types, "INDEXED", 7) == 0)
|
|
|
|
{
|
1999-10-19 12:58:17 +08:00
|
|
|
types |= PLUG_IN_INDEXED_IMAGE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types += 7;
|
|
|
|
}
|
1999-11-22 05:15:28 +08:00
|
|
|
else if (strncmp (image_types, "*", 1) == 0)
|
|
|
|
{
|
|
|
|
types |= PLUG_IN_RGB_IMAGE | PLUG_IN_RGBA_IMAGE
|
|
|
|
| PLUG_IN_GRAY_IMAGE | PLUG_IN_GRAYA_IMAGE
|
|
|
|
| PLUG_IN_INDEXED_IMAGE | PLUG_IN_INDEXEDA_IMAGE;
|
|
|
|
image_types += 1;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
|
|
|
{
|
2000-05-10 11:02:55 +08:00
|
|
|
g_warning ("image_type contains unrecognizable parts: '%s'", type_spec);
|
1997-11-25 06:05:25 +08:00
|
|
|
while (*image_types &&
|
2000-05-10 11:02:55 +08:00
|
|
|
((*image_types != ' ') ||
|
|
|
|
(*image_types != '\t') ||
|
|
|
|
(*image_types != ',')))
|
1997-11-25 06:05:25 +08:00
|
|
|
image_types++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return types;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
plug_in_progress_cancel (GtkWidget *widget,
|
|
|
|
PlugIn *plug_in)
|
|
|
|
{
|
|
|
|
plug_in_destroy (plug_in);
|
|
|
|
}
|
|
|
|
|
1999-05-04 03:22:58 +08:00
|
|
|
void
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_progress_init (PlugIn *plug_in,
|
2000-02-25 00:11:26 +08:00
|
|
|
gchar *message,
|
|
|
|
gint gdisp_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-06-15 12:46:32 +08:00
|
|
|
GDisplay *gdisp = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!message)
|
|
|
|
message = plug_in->args[0];
|
|
|
|
|
2001-01-15 05:11:52 +08:00
|
|
|
if (gdisp_ID > 0)
|
2001-07-11 20:39:49 +08:00
|
|
|
gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID);
|
1998-06-15 10:25:27 +08:00
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
if (plug_in->progress)
|
|
|
|
plug_in->progress = progress_restart (plug_in->progress, message,
|
2001-07-29 22:09:50 +08:00
|
|
|
G_CALLBACK (plug_in_progress_cancel),
|
|
|
|
plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
plug_in->progress = progress_start (gdisp, message, TRUE,
|
2001-07-29 22:09:50 +08:00
|
|
|
G_CALLBACK (plug_in_progress_cancel),
|
|
|
|
plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-05-04 03:22:58 +08:00
|
|
|
void
|
2000-02-25 00:11:26 +08:00
|
|
|
plug_in_progress_update (PlugIn *plug_in,
|
|
|
|
gdouble percentage)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
if (!plug_in->progress)
|
|
|
|
plug_in_progress_init (plug_in, NULL, -1);
|
|
|
|
|
|
|
|
progress_update (plug_in->progress, percentage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2001-05-17 02:09:45 +08:00
|
|
|
|
|
|
|
static gchar *
|
|
|
|
plug_in_search_in_path (gchar *search_path,
|
|
|
|
gchar *filename)
|
|
|
|
{
|
|
|
|
static gchar path[256];
|
|
|
|
gchar *local_path;
|
|
|
|
gchar *token;
|
|
|
|
gchar *next_token;
|
|
|
|
struct stat buf;
|
|
|
|
gint err;
|
|
|
|
|
|
|
|
local_path = g_strdup (search_path);
|
|
|
|
next_token = local_path;
|
|
|
|
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
|
|
|
|
|
|
|
|
while (token)
|
|
|
|
{
|
|
|
|
sprintf (path, "%s", token);
|
|
|
|
|
|
|
|
if (token[strlen (token) - 1] != G_DIR_SEPARATOR)
|
|
|
|
strcat (path, G_DIR_SEPARATOR_S);
|
|
|
|
strcat (path, filename);
|
|
|
|
|
|
|
|
err = stat (path, &buf);
|
|
|
|
if (!err && S_ISREG (buf.st_mode))
|
|
|
|
{
|
|
|
|
token = path;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
token = strtok (NULL, G_SEARCHPATH_SEPARATOR_S);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (local_path);
|
|
|
|
|
|
|
|
return token;
|
|
|
|
}
|