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
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <string.h>
|
1999-04-25 03:12:12 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
#include <glib-object.h>
|
1998-08-29 07:01:46 +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
|
|
|
|
2003-01-08 01:00:49 +08:00
|
|
|
#include "config/gimpguiconfig.h"
|
2002-11-19 04:50:31 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
#include "base/tile.h"
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
#include "core/gimp.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
#include "pdb/procedural_db.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-in-params.h"
|
2003-01-30 19:20:12 +08:00
|
|
|
#include "plug-in-run.h"
|
|
|
|
#include "plug-in-shm.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
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* local function prototypes */
|
1998-09-19 08:40:27 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
static Argument * plug_in_temp_run (ProcRecord *proc_rec,
|
|
|
|
Argument *args,
|
|
|
|
gint argc);
|
|
|
|
static Argument * plug_in_get_return_vals (PlugIn *plug_in,
|
|
|
|
ProcRecord *proc_rec);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* global variables */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
ProcRecord *last_plug_in = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* public functions */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
Argument *
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_run (Gimp *gimp,
|
|
|
|
ProcRecord *proc_rec,
|
1997-11-25 06:05:25 +08:00
|
|
|
Argument *args,
|
2000-02-25 00:11:26 +08:00
|
|
|
gint argc,
|
|
|
|
gboolean synchronous,
|
2003-01-30 19:20:12 +08:00
|
|
|
gboolean destroy_return_vals,
|
2000-02-25 00:11:26 +08:00
|
|
|
gint gdisp_ID)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
Argument *return_vals = NULL;
|
|
|
|
PlugIn *plug_in;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in = plug_in_new (gimp, proc_rec->exec_method.plug_in.filename);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (plug_in)
|
|
|
|
{
|
|
|
|
if (plug_in_open (plug_in))
|
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
GPConfig config;
|
|
|
|
GPProcRun proc_run;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in->recurse = synchronous;
|
|
|
|
|
|
|
|
plug_in_push (plug_in);
|
|
|
|
|
2003-01-08 01:00:49 +08:00
|
|
|
config.version = GP_VERSION;
|
|
|
|
config.tile_width = TILE_WIDTH;
|
|
|
|
config.tile_height = TILE_HEIGHT;
|
2003-01-30 19:20:12 +08:00
|
|
|
config.shm_ID = plug_in_shm_get_ID (gimp);
|
2003-01-08 01:00:49 +08:00
|
|
|
config.gamma = gimp->config->gamma_val;
|
|
|
|
config.install_cmap = gimp->config->install_cmap;
|
|
|
|
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
|
|
|
|
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
|
|
|
|
config.gdisp_ID = gdisp_ID;
|
2000-05-01 02:17:55 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
if (! gp_config_write (plug_in->my_write, &config, plug_in) ||
|
|
|
|
! gp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
|
|
|
|
! wire_flush (plug_in->my_write, plug_in))
|
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))
|
2001-11-18 00:32:34 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in_main_loop (plug_in);
|
2001-11-18 00:32:34 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* If this plug-in is requested to run synchronously, wait for
|
|
|
|
* its return values
|
|
|
|
*/
|
1997-11-25 06:05:25 +08:00
|
|
|
if (plug_in->recurse)
|
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in_main_loop (plug_in);
|
2001-11-18 00:32:34 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
return_vals = plug_in_get_return_vals (plug_in, proc_rec);
|
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
|
|
|
|
2000-05-17 20:29:38 +08:00
|
|
|
done:
|
2003-01-30 19:20:12 +08:00
|
|
|
if (return_vals && destroy_return_vals)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
procedural_db_destroy_args (return_vals, proc_rec->num_values);
|
|
|
|
return_vals = NULL;
|
|
|
|
}
|
2003-01-30 19:20:12 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return return_vals;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_repeat (Gimp *gimp,
|
|
|
|
gint display_ID,
|
|
|
|
gint image_ID,
|
|
|
|
gint drawable_ID,
|
|
|
|
gboolean with_interface)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-10-17 19:33:43 +08:00
|
|
|
Argument *args;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (last_plug_in)
|
|
|
|
{
|
|
|
|
/* 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 */
|
2001-12-19 08:13:16 +08:00
|
|
|
args[0].value.pdb_int = (with_interface ?
|
|
|
|
GIMP_RUN_INTERACTIVE : GIMP_RUN_WITH_LAST_VALS);
|
2002-03-21 01:46:13 +08:00
|
|
|
args[1].value.pdb_int = image_ID;
|
|
|
|
args[2].value.pdb_int = drawable_ID;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* run the plug-in procedure */
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_run (gimp, last_plug_in, args, 3, FALSE, TRUE, display_ID);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
g_free (args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* private functions */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
static Argument *
|
|
|
|
plug_in_temp_run (ProcRecord *proc_rec,
|
|
|
|
Argument *args,
|
|
|
|
gint argc)
|
|
|
|
{
|
|
|
|
Argument *return_vals;
|
|
|
|
PlugIn *plug_in;
|
|
|
|
GPProcRun proc_run;
|
|
|
|
gint old_recurse;
|
2000-05-11 05:21:23 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
return_vals = NULL;
|
2000-05-11 05:21:23 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in = (PlugIn *) proc_rec->exec_method.temporary.plug_in;
|
2000-05-11 05:21:23 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
if (plug_in)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
if (plug_in->in_temp_proc)
|
2000-05-11 05:21:23 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
|
|
|
goto done;
|
2000-05-11 05:21:23 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in->in_temp_proc = TRUE;
|
2000-05-11 05:21:23 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in_push (plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
proc_run.name = proc_rec->name;
|
|
|
|
proc_run.nparams = argc;
|
|
|
|
proc_run.params = plug_in_args_to_params (args, argc, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
|
|
|
|
! wire_flush (plug_in->my_write, plug_in))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
|
|
|
goto done;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in_pop ();
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
old_recurse = plug_in->recurse;
|
|
|
|
plug_in->recurse = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
#ifdef ENABLE_TEMP_RETURN
|
|
|
|
plug_in_main_loop (plug_in);
|
|
|
|
|
|
|
|
return_vals = plug_in_get_return_vals (proc_rec);
|
|
|
|
#else
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, TRUE);
|
|
|
|
#endif
|
2003-01-18 02:07:37 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in->recurse = old_recurse;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in->in_temp_proc = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2002-05-21 18:58:50 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
done:
|
|
|
|
return return_vals;
|
2002-02-12 15:59:16 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
static Argument *
|
|
|
|
plug_in_get_return_vals (PlugIn *plug_in,
|
|
|
|
ProcRecord *proc_rec)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
Argument *return_vals;
|
|
|
|
gint nargs;
|
2002-05-17 01:41:38 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
g_return_val_if_fail (plug_in != NULL, NULL);
|
|
|
|
g_return_val_if_fail (proc_rec != NULL, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* Return the status code plus the current return values. */
|
|
|
|
nargs = proc_rec->num_values + 1;
|
|
|
|
if (plug_in->return_vals && plug_in->n_return_vals == nargs)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
return_vals = plug_in->return_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2003-01-30 19:20:12 +08:00
|
|
|
else if (plug_in->return_vals)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
/* Allocate new return values of the correct size. */
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* Copy all of the arguments we can. */
|
|
|
|
memcpy (return_vals, plug_in->return_vals,
|
|
|
|
sizeof (Argument) * MIN (plug_in->n_return_vals, nargs));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* 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 (plug_in->return_vals);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
/* Just return a dummy set of values. */
|
|
|
|
return_vals = procedural_db_return_args (proc_rec, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2002-02-12 10:41:01 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* We have consumed any saved values, so clear them. */
|
|
|
|
plug_in->return_vals = NULL;
|
|
|
|
plug_in->n_return_vals = 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
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return return_vals;
|
|
|
|
}
|