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
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
#include "string.h"
|
1999-06-22 04:04:04 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
1999-06-15 06:18:02 +08:00
|
|
|
|
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-12-01 08:14:14 +08:00
|
|
|
#include "plug-in-types.h"
|
2001-05-22 04:30:16 +08:00
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
#include "core/gimp.h"
|
2001-10-17 19:33:43 +08:00
|
|
|
#include "core/gimpcontext.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
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
#include "gui/plug-in-menus.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
|
2001-12-01 08:14:14 +08:00
|
|
|
#include "plug-in.h"
|
2002-03-21 01:46:13 +08:00
|
|
|
#include "plug-ins.h"
|
|
|
|
#include "plug-in-def.h"
|
|
|
|
#include "plug-in-params.h"
|
2001-12-19 08:13:16 +08:00
|
|
|
#include "plug-in-proc.h"
|
2002-03-21 01:46:13 +08:00
|
|
|
#include "plug-in-progress.h"
|
2001-12-28 07:45:12 +08:00
|
|
|
#include "plug-in-rc.h"
|
2001-12-01 08:14:14 +08:00
|
|
|
|
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
|
|
|
|
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
|
|
|
typedef struct _PlugInHelpPathDef PlugInHelpPathDef;
|
|
|
|
|
|
|
|
struct _PlugInHelpPathDef
|
|
|
|
{
|
|
|
|
gchar *prog_name;
|
|
|
|
gchar *help_path;
|
2000-05-08 06:04:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
static void plug_ins_init_file (const gchar *filename,
|
|
|
|
gpointer loader_data);
|
|
|
|
static void plug_ins_add_to_db (Gimp *gimp);
|
|
|
|
static void plug_ins_proc_def_insert (PlugInProcDef *proc_def,
|
|
|
|
void (* superceed_fn) (void *));
|
|
|
|
static void plug_ins_proc_def_dead (void *freed_proc_def);
|
1999-05-07 04:56:07 +08:00
|
|
|
|
|
|
|
|
2002-05-07 19:33:58 +08:00
|
|
|
GSList *proc_defs = NULL;
|
|
|
|
const gchar *std_plugins_domain = "gimp14-std-plug-ins";
|
2002-03-21 01:46:13 +08:00
|
|
|
|
|
|
|
static GSList *plug_in_defs = NULL;
|
|
|
|
static GSList *gimprc_proc_defs = NULL;
|
|
|
|
static GSList *help_path_defs = NULL;
|
|
|
|
|
|
|
|
static gboolean write_pluginrc = FALSE;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
1999-05-07 04:56:07 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_init (Gimp *gimp,
|
|
|
|
GimpInitStatusFunc status_callback)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
gchar *filename;
|
2001-11-25 04:31:15 +08:00
|
|
|
gchar *basename;
|
2000-07-16 20:49:04 +08:00
|
|
|
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
|
|
|
|
2001-10-20 00:41:09 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (status_callback != NULL);
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_init (gimp);
|
2000-07-16 20:49:04 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* search for binaries in the plug-in directory path */
|
2002-03-21 01:46:13 +08:00
|
|
|
gimp_datafiles_read_directories (gimp->config->plug_in_path,
|
2001-09-19 22:42:35 +08:00
|
|
|
MODE_EXECUTABLE,
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_init_file, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* read the pluginrc file for cached data */
|
2002-03-21 01:46:13 +08:00
|
|
|
if (gimp->config->pluginrc_path)
|
1998-04-11 13:07:52 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
if (g_path_is_absolute (gimp->config->pluginrc_path))
|
|
|
|
filename = g_strdup (gimp->config->pluginrc_path);
|
1998-04-11 13:07:52 +08:00
|
|
|
else
|
2001-10-24 23:56:33 +08:00
|
|
|
filename = g_build_filename (gimp_directory (),
|
2002-03-21 01:46:13 +08:00
|
|
|
gimp->config->pluginrc_path,
|
2001-10-24 23:56:33 +08:00
|
|
|
NULL);
|
1998-04-11 13:07:52 +08:00
|
|
|
}
|
|
|
|
else
|
2002-03-21 01:46:13 +08:00
|
|
|
{
|
|
|
|
filename = gimp_personal_rc_file ("pluginrc");
|
|
|
|
}
|
1998-04-11 13:07:52 +08:00
|
|
|
|
2001-10-20 00:41:09 +08:00
|
|
|
(* status_callback) (_("Resource configuration"), filename, -1);
|
2001-12-28 07:45:12 +08:00
|
|
|
plug_in_rc_parse (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;
|
2002-02-12 10:41:01 +08:00
|
|
|
(* status_callback) (_("New Plug-ins"), "", 0);
|
2000-02-24 02:07:53 +08:00
|
|
|
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
|
|
|
|
2001-12-01 08:14:14 +08:00
|
|
|
if (gimp->be_verbose)
|
2002-02-12 10:41:01 +08:00
|
|
|
g_print (_("querying plug-in: \"%s\"\n"), plug_in_def->prog);
|
2000-08-15 23:42:14 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_call_query (gimp, plug_in_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2000-08-15 23:42:14 +08:00
|
|
|
|
2001-11-25 04:31:15 +08:00
|
|
|
basename = g_path_get_basename (plug_in_def->prog);
|
|
|
|
(* status_callback) (NULL, basename, nth / nplugins);
|
1998-01-20 08:12:21 +08:00
|
|
|
nth++;
|
2001-11-25 04:31:15 +08:00
|
|
|
g_free (basename);
|
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);
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_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;
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_proc_def_insert (proc_def, plug_ins_proc_def_dead);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* write the pluginrc file if necessary */
|
|
|
|
if (write_pluginrc)
|
|
|
|
{
|
2001-12-01 08:14:14 +08:00
|
|
|
if (gimp->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
|
|
|
|
2001-12-29 06:58:14 +08:00
|
|
|
plug_in_rc_write (plug_in_defs, filename);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
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 */
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_add_to_db (gimp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-11-18 00:32:34 +08:00
|
|
|
if (! gimp->no_interface)
|
|
|
|
{
|
|
|
|
/* make the menu */
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_make_menu (plug_in_defs, std_plugins_domain);
|
2001-11-18 00:32:34 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-02-12 10:41:01 +08:00
|
|
|
/* initial the plug-ins */
|
|
|
|
(* status_callback) (_("Plug-ins"), "", 0);
|
|
|
|
|
|
|
|
tmp = plug_in_defs;
|
|
|
|
nth=0;
|
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
plug_in_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
2002-02-12 15:59:16 +08:00
|
|
|
if (plug_in_def->has_init)
|
2002-02-12 10:41:01 +08:00
|
|
|
{
|
|
|
|
if (gimp->be_verbose)
|
|
|
|
g_print (_("initializing plug-in: \"%s\"\n"), plug_in_def->prog);
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_call_init (gimp, plug_in_def);
|
2002-02-12 10:41:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
basename = g_path_get_basename (plug_in_def->prog);
|
|
|
|
(* status_callback) (NULL, basename, nth / nplugins);
|
|
|
|
nth++;
|
|
|
|
g_free (basename);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* run the available extensions */
|
2001-12-01 08:14:14 +08:00
|
|
|
if (gimp->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
|
|
|
|
2001-10-20 00:41:09 +08:00
|
|
|
(* status_callback) (_("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
|
|
|
{
|
2001-12-01 08:14:14 +08:00
|
|
|
if (gimp->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
|
|
|
|
2001-10-20 00:41:09 +08:00
|
|
|
(* status_callback) (NULL, proc_def->db_info.name, nth / nplugins);
|
1998-01-26 06:13:00 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_run (gimp, &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
|
|
|
|
2001-12-01 08:14:14 +08:00
|
|
|
if (gimp->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
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_exit (Gimp *gimp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_kill (gimp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
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 *
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_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
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_add_internal (PlugInProcDef *proc_def)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
proc_defs = g_slist_prepend (proc_defs, proc_def);
|
|
|
|
}
|
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
PlugInProcDef *
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_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);
|
|
|
|
}
|
2002-03-21 01:46:13 +08:00
|
|
|
|
|
|
|
proc_def->extensions_list =
|
|
|
|
plug_ins_extensions_parse (proc_def->extensions);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* 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);
|
|
|
|
}
|
2002-03-21 01:46:13 +08:00
|
|
|
|
|
|
|
proc_def->prefixes_list =
|
|
|
|
plug_ins_extensions_parse (proc_def->prefixes);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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);
|
|
|
|
}
|
2002-03-21 01:46:13 +08:00
|
|
|
|
|
|
|
proc_def->magics_list =
|
|
|
|
plug_ins_extensions_parse (proc_def->magics);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return proc_def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_def_add (PlugInDef *plug_in_def)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
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);
|
2002-03-22 23:21:18 +08:00
|
|
|
g_free (basename1);
|
2001-07-27 23:18:20 +08:00
|
|
|
|
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 *
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_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 *
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_help_path (gchar *prog_name)
|
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
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
static void
|
|
|
|
plug_ins_init_file (const gchar *filename,
|
|
|
|
gpointer loader_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
GSList *tmp;
|
|
|
|
PlugInDef *plug_in_def;
|
|
|
|
gchar *plug_in_name;
|
|
|
|
gchar *basename;
|
|
|
|
|
|
|
|
basename = g_path_get_basename (filename);
|
|
|
|
|
|
|
|
plug_in_def = NULL;
|
|
|
|
tmp = plug_in_defs;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
while (tmp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
2001-05-17 02:09:45 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_name = g_path_get_basename (plug_in_def->prog);
|
|
|
|
|
|
|
|
if (g_ascii_strcasecmp (basename, plug_in_name) == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
g_print ("duplicate plug-in: \"%s\" (skipping)\n", filename);
|
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
g_free (plug_in_name);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_def = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
g_free (basename);
|
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
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_def = plug_in_def_new (filename);
|
|
|
|
plug_in_def->mtime = gimp_datafile_mtime ();
|
|
|
|
plug_in_def->query = TRUE;
|
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
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_defs = g_slist_append (plug_in_defs, plug_in_def);
|
|
|
|
}
|
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
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
static void
|
|
|
|
plug_ins_add_to_db (Gimp *gimp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
PlugInProcDef *proc_def;
|
|
|
|
Argument args[4];
|
|
|
|
Argument *return_vals;
|
|
|
|
GSList *tmp;
|
|
|
|
|
|
|
|
tmp = proc_defs;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
while (tmp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (proc_def->prog && (proc_def->db_info.proc_type != GIMP_INTERNAL))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
proc_def->db_info.exec_method.plug_in.filename = proc_def->prog;
|
|
|
|
procedural_db_register (gimp, &proc_def->db_info);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2002-03-21 01:46:13 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
for (tmp = proc_defs; tmp; tmp = tmp->next)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
|
|
|
|
if (proc_def->extensions || proc_def->prefixes || proc_def->magics)
|
|
|
|
{
|
|
|
|
args[0].arg_type = GIMP_PDB_STRING;
|
|
|
|
args[0].value.pdb_pointer = proc_def->db_info.name;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
args[1].arg_type = GIMP_PDB_STRING;
|
|
|
|
args[1].value.pdb_pointer = proc_def->extensions;
|
2001-08-30 01:48:28 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
args[2].arg_type = GIMP_PDB_STRING;
|
|
|
|
args[2].value.pdb_pointer = proc_def->prefixes;
|
1999-03-07 20:56:03 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
args[3].arg_type = GIMP_PDB_STRING;
|
|
|
|
args[3].value.pdb_pointer = proc_def->magics;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (proc_def->image_types)
|
|
|
|
{
|
|
|
|
return_vals =
|
|
|
|
procedural_db_execute (gimp,
|
|
|
|
"gimp_register_save_handler",
|
|
|
|
args);
|
|
|
|
g_free (return_vals);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return_vals =
|
|
|
|
procedural_db_execute (gimp,
|
|
|
|
"gimp_register_magic_load_handler",
|
|
|
|
args);
|
|
|
|
g_free (return_vals);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
static void
|
|
|
|
plug_ins_proc_def_insert (PlugInProcDef *proc_def,
|
|
|
|
void (*superceed_fn)(void*))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
PlugInProcDef *tmp_proc_def;
|
|
|
|
GSList *tmp;
|
|
|
|
GSList *prev;
|
|
|
|
GSList *list;
|
2001-09-03 21:03:34 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
prev = NULL;
|
|
|
|
tmp = proc_defs;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
while (tmp)
|
2001-09-03 21:03:34 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
tmp_proc_def = tmp->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (strcmp (proc_def->db_info.name, tmp_proc_def->db_info.name) == 0)
|
1999-03-07 20:56:03 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
tmp->data = proc_def;
|
2001-09-03 21:03:34 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (proc_def->menu_path)
|
|
|
|
g_free (proc_def->menu_path);
|
|
|
|
if (proc_def->accelerator)
|
|
|
|
g_free (proc_def->accelerator);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
proc_def->menu_path = tmp_proc_def->menu_path;
|
|
|
|
proc_def->accelerator = tmp_proc_def->accelerator;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
tmp_proc_def->menu_path = NULL;
|
|
|
|
tmp_proc_def->accelerator = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (superceed_fn)
|
|
|
|
(* superceed_fn) (tmp_proc_def);
|
2001-11-18 00:32:34 +08:00
|
|
|
|
2002-03-21 01:46:13 +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;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
list->next = tmp;
|
|
|
|
if (prev)
|
|
|
|
prev->next = list;
|
|
|
|
else
|
|
|
|
proc_defs = list;
|
|
|
|
return;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
prev = tmp;
|
|
|
|
tmp = tmp->next;
|
2001-09-03 21:03:34 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
proc_defs = g_slist_append (proc_defs, proc_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
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
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_proc_def_dead (void *freed_proc_def)
|
1999-02-14 09:53:23 +08:00
|
|
|
{
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
void
|
|
|
|
plug_ins_proc_def_remove (PlugInProcDef *proc_def,
|
|
|
|
Gimp *gimp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
if (! gimp->no_interface)
|
2001-11-18 00:32:34 +08:00
|
|
|
{
|
|
|
|
if (proc_def->menu_path)
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_delete_menu_entry (proc_def->menu_path);
|
2001-11-18 00:32:34 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Unregister the procedural database entry */
|
2002-03-21 01:46:13 +08:00
|
|
|
procedural_db_unregister (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
|
|
|
}
|
|
|
|
|
2001-12-14 23:30:31 +08:00
|
|
|
PlugInImageType
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_ins_image_types_parse (gchar *image_types)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-12-14 23:30:31 +08:00
|
|
|
gchar *type_spec = image_types;
|
|
|
|
PlugInImageType 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;
|
|
|
|
}
|