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-12-17 05:37:03 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <sys/types.h>
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
|
2001-08-17 22:27:31 +08:00
|
|
|
#include "pdb-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "core/gimp.h"
|
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
#include "plug-in/plug-in-run.h"
|
2001-02-04 06:05:41 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "procedural_db.h"
|
2000-04-28 01:27:28 +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"
|
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2002-09-11 04:23:00 +08:00
|
|
|
typedef struct _PDBData PDBData;
|
|
|
|
|
|
|
|
struct _PDBData
|
|
|
|
{
|
|
|
|
gchar *identifier;
|
|
|
|
gint32 bytes;
|
|
|
|
guint8 *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_init (Gimp *gimp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-05 03:31:35 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
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
|
|
|
|
2002-09-11 04:23:00 +08:00
|
|
|
gimp->procedural_ht = g_hash_table_new (g_str_hash, g_str_equal);
|
|
|
|
gimp->procedural_db_data_list = 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 void
|
1999-10-28 04:45:57 +08:00
|
|
|
procedural_db_free_entry (gpointer key,
|
|
|
|
gpointer value,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
if (value)
|
|
|
|
g_list_free (value);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_free (Gimp *gimp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-09-11 04:23:00 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
if (gimp->procedural_ht)
|
1999-10-28 04:45:57 +08:00
|
|
|
{
|
2001-12-28 01:58:30 +08:00
|
|
|
g_hash_table_foreach (gimp->procedural_ht,
|
|
|
|
procedural_db_free_entry, NULL);
|
2001-07-05 03:31:35 +08:00
|
|
|
g_hash_table_destroy (gimp->procedural_ht);
|
1999-10-28 04:45:57 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp->procedural_ht = NULL;
|
|
|
|
}
|
2002-09-11 04:23:00 +08:00
|
|
|
|
|
|
|
if (gimp->procedural_db_data_list)
|
|
|
|
{
|
|
|
|
PDBData *data;
|
|
|
|
GList *list;
|
|
|
|
|
2003-01-09 20:45:25 +08:00
|
|
|
for (list = gimp->procedural_db_data_list;
|
|
|
|
list;
|
|
|
|
list = g_list_next (list))
|
2002-09-11 04:23:00 +08:00
|
|
|
{
|
|
|
|
data = (PDBData *) list->data;
|
|
|
|
|
|
|
|
g_free (data->identifier);
|
|
|
|
g_free (data->data);
|
|
|
|
g_free (data);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (gimp->procedural_db_data_list);
|
|
|
|
gimp->procedural_db_data_list = NULL;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_register (Gimp *gimp,
|
|
|
|
ProcRecord *procedure)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
2002-09-11 04:23:00 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (procedure != NULL);
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
list = g_hash_table_lookup (gimp->procedural_ht, (gpointer) procedure->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
list = g_list_prepend (list, (gpointer) procedure);
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
g_hash_table_insert (gimp->procedural_ht,
|
1997-11-25 06:05:25 +08:00
|
|
|
(gpointer) procedure->name,
|
|
|
|
(gpointer) list);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_unregister (Gimp *gimp,
|
|
|
|
const gchar *name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
2002-09-11 04:23:00 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (name != NULL);
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
list = g_hash_table_lookup (gimp->procedural_ht, (gpointer) name);
|
2001-12-28 01:58:30 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (list)
|
|
|
|
{
|
|
|
|
list = g_list_remove (list, list->data);
|
|
|
|
|
|
|
|
if (list)
|
2001-07-05 03:31:35 +08:00
|
|
|
g_hash_table_insert (gimp->procedural_ht,
|
1997-11-25 06:05:25 +08:00
|
|
|
(gpointer) name,
|
|
|
|
(gpointer) list);
|
|
|
|
else
|
2001-07-05 03:31:35 +08:00
|
|
|
g_hash_table_remove (gimp->procedural_ht,
|
1997-11-25 06:05:25 +08:00
|
|
|
(gpointer) name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ProcRecord *
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_lookup (Gimp *gimp,
|
|
|
|
const gchar *name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-12-28 01:58:30 +08:00
|
|
|
GList *list;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-09-11 04:23:00 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
list = g_hash_table_lookup (gimp->procedural_ht, (gpointer) name);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-12-28 01:58:30 +08:00
|
|
|
if (list)
|
|
|
|
return (ProcRecord *) list->data;
|
|
|
|
else
|
|
|
|
return NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Argument *
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_execute (Gimp *gimp,
|
|
|
|
const gchar *name,
|
2001-05-14 08:04:29 +08:00
|
|
|
Argument *args)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
ProcRecord *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
|
|
|
Argument *return_args;
|
|
|
|
GList *list;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-09-11 04:23:00 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return_args = NULL;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
list = g_hash_table_lookup (gimp->procedural_ht, (gpointer) name);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-28 04:45:57 +08:00
|
|
|
if (list == NULL)
|
|
|
|
{
|
|
|
|
g_message (_("PDB calling error %s not found"), 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
|
|
|
return_args = g_new (Argument, 1);
|
2001-12-28 01:58:30 +08:00
|
|
|
return_args->arg_type = GIMP_PDB_STATUS;
|
2001-05-21 21:58:46 +08:00
|
|
|
return_args->value.pdb_int = GIMP_PDB_CALLING_ERROR;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
1999-10-28 04:45:57 +08:00
|
|
|
return return_args;
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
if ((procedure = (ProcRecord *) list->data) == NULL)
|
|
|
|
{
|
1999-10-23 09:30:52 +08:00
|
|
|
g_message (_("PDB calling error %s not found"), 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
|
|
|
return_args = g_new (Argument, 1);
|
2001-12-28 01:58:30 +08:00
|
|
|
return_args->arg_type = GIMP_PDB_STATUS;
|
2001-05-21 21:58:46 +08:00
|
|
|
return_args->value.pdb_int = GIMP_PDB_CALLING_ERROR;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return return_args;
|
|
|
|
}
|
|
|
|
list = list->next;
|
|
|
|
|
|
|
|
/* check the arguments */
|
|
|
|
for (i = 0; i < procedure->num_args; i++)
|
|
|
|
{
|
|
|
|
if (args[i].arg_type != procedure->args[i].arg_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
|
|
|
return_args = g_new (Argument, 1);
|
2001-12-28 01:58:30 +08:00
|
|
|
return_args->arg_type = GIMP_PDB_STATUS;
|
2001-05-21 21:58:46 +08:00
|
|
|
return_args->value.pdb_int = GIMP_PDB_CALLING_ERROR;
|
1997-11-25 06:05:25 +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
|
|
|
g_message (_("PDB calling error %s"), procedure->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return return_args;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* call the procedure */
|
|
|
|
switch (procedure->proc_type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_INTERNAL:
|
2001-12-28 01:58:30 +08:00
|
|
|
return_args =
|
|
|
|
(* procedure->exec_method.internal.marshal_func) (gimp, args);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PLUGIN:
|
|
|
|
case GIMP_EXTENSION:
|
|
|
|
case GIMP_TEMPORARY:
|
2002-03-21 01:46:13 +08:00
|
|
|
return_args = plug_in_run (gimp,
|
|
|
|
procedure,
|
2001-12-28 01:58:30 +08:00
|
|
|
args, procedure->num_args,
|
|
|
|
TRUE, FALSE, -1);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
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
|
|
|
return_args = g_new (Argument, 1);
|
2001-12-28 01:58:30 +08:00
|
|
|
return_args->arg_type = GIMP_PDB_STATUS;
|
2001-05-21 21:58:46 +08:00
|
|
|
return_args->value.pdb_int = GIMP_PDB_EXECUTION_ERROR;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
if ((return_args[0].value.pdb_int != GIMP_PDB_SUCCESS) &&
|
1997-11-25 06:05:25 +08:00
|
|
|
(procedure->num_values > 0))
|
|
|
|
memset (&return_args[1], 0, sizeof (Argument) * procedure->num_values);
|
|
|
|
|
2001-12-28 01:58:30 +08:00
|
|
|
/* Check if the return value is a PDB_PASS_THROUGH,
|
|
|
|
in which case run the next procedure in the list */
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
if (return_args[0].value.pdb_int != GIMP_PDB_PASS_THROUGH)
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
else if (list) /* Pass through,
|
|
|
|
destroy return values and run another procedure */
|
1997-11-25 06:05:25 +08:00
|
|
|
procedural_db_destroy_args (return_args, procedure->num_values);
|
|
|
|
}
|
|
|
|
|
|
|
|
return return_args;
|
|
|
|
}
|
|
|
|
|
|
|
|
Argument *
|
2001-07-05 03:31:35 +08:00
|
|
|
procedural_db_run_proc (Gimp *gimp,
|
|
|
|
const gchar *name,
|
2001-05-14 08:04:29 +08:00
|
|
|
gint *nreturn_vals,
|
1997-11-25 06:05:25 +08:00
|
|
|
...)
|
|
|
|
{
|
|
|
|
ProcRecord *proc;
|
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
|
|
|
Argument *params;
|
|
|
|
Argument *return_vals;
|
|
|
|
va_list args;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-09-11 04:23:00 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
2003-01-09 20:45:25 +08:00
|
|
|
g_return_val_if_fail (nreturn_vals != NULL, NULL);
|
2002-09-11 04:23:00 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
if ((proc = procedural_db_lookup (gimp, name)) == NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-09 20:45:25 +08:00
|
|
|
*nreturn_vals = 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
|
|
|
return_vals = g_new (Argument, 1);
|
2001-12-28 01:58:30 +08:00
|
|
|
return_vals->arg_type = GIMP_PDB_STATUS;
|
2001-05-21 21:58:46 +08:00
|
|
|
return_vals->value.pdb_int = GIMP_PDB_CALLING_ERROR;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return return_vals;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* allocate the parameter array */
|
|
|
|
params = g_new (Argument, proc->num_args);
|
|
|
|
|
|
|
|
va_start (args, nreturn_vals);
|
|
|
|
|
|
|
|
for (i = 0; i < proc->num_args; i++)
|
|
|
|
{
|
2001-12-28 01:58:30 +08:00
|
|
|
if (proc->args[i].arg_type !=
|
|
|
|
(params[i].arg_type = va_arg (args, GimpPDBArgType)))
|
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
|
|
|
g_message (_("Incorrect arguments passed to procedural_db_run_proc:\n"
|
|
|
|
"Argument %d to '%s' should be a %s, but got passed a %s"),
|
1999-04-21 07:03:31 +08:00
|
|
|
i+1, proc->name,
|
|
|
|
pdb_type_name (proc->args[i].arg_type),
|
|
|
|
pdb_type_name (params[i].arg_type));
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (params);
|
2003-01-09 20:45:25 +08:00
|
|
|
|
|
|
|
*nreturn_vals = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (proc->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_DISPLAY:
|
2001-01-25 09:20:05 +08:00
|
|
|
params[i].value.pdb_int = (gint32) va_arg (args, gint);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_FLOAT:
|
2001-01-25 09:20:05 +08:00
|
|
|
params[i].value.pdb_float = (gdouble) va_arg (args, gdouble);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRING:
|
|
|
|
case GIMP_PDB_INT32ARRAY:
|
|
|
|
case GIMP_PDB_INT16ARRAY:
|
|
|
|
case GIMP_PDB_INT8ARRAY:
|
|
|
|
case GIMP_PDB_FLOATARRAY:
|
|
|
|
case GIMP_PDB_STRINGARRAY:
|
2001-01-25 09:20:05 +08:00
|
|
|
params[i].value.pdb_pointer = va_arg (args, gpointer);
|
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_COLOR:
|
2001-03-11 21:15:41 +08:00
|
|
|
params[i].value.pdb_color = va_arg (args, GimpRGB);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_REGION:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
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:
|
2001-01-25 09:20:05 +08:00
|
|
|
params[i].value.pdb_int = (gint32) va_arg (args, gint);
|
1998-10-08 16:15:21 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
2001-01-25 09:20:05 +08:00
|
|
|
params[i].value.pdb_pointer = va_arg (args, gpointer);
|
1998-10-08 16:15:21 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STATUS:
|
2001-01-25 09:20:05 +08:00
|
|
|
params[i].value.pdb_int = (gint32) va_arg (args, gint);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_END:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
|
|
|
|
*nreturn_vals = proc->num_values;
|
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
return_vals = procedural_db_execute (gimp, name, params);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
g_free (params);
|
|
|
|
|
|
|
|
return return_vals;
|
|
|
|
}
|
|
|
|
|
|
|
|
Argument *
|
|
|
|
procedural_db_return_args (ProcRecord *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
|
|
|
gboolean success)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
Argument *return_args;
|
2001-07-05 03:31:35 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-09-11 04:23:00 +08:00
|
|
|
g_return_val_if_fail (procedure != NULL, 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
|
|
|
return_args = g_new (Argument, procedure->num_values + 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2001-12-28 01:58:30 +08:00
|
|
|
return_args[0].arg_type = GIMP_PDB_STATUS;
|
2001-05-21 21:58:46 +08:00
|
|
|
return_args[0].value.pdb_int = GIMP_PDB_SUCCESS;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-12-28 01:58:30 +08:00
|
|
|
return_args[0].arg_type = GIMP_PDB_STATUS;
|
2001-05-21 21:58:46 +08:00
|
|
|
return_args[0].value.pdb_int = GIMP_PDB_EXECUTION_ERROR;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the arg types for the return values */
|
|
|
|
for (i = 0; i < procedure->num_values; i++)
|
|
|
|
return_args[i+1].arg_type = procedure->values[i].arg_type;
|
|
|
|
|
|
|
|
return return_args;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
procedural_db_destroy_args (Argument *args,
|
2002-03-21 01:46:13 +08:00
|
|
|
gint nargs)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (! args)
|
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
|
|
|
return;
|
1999-04-21 07:03:31 +08:00
|
|
|
|
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-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRING:
|
|
|
|
case GIMP_PDB_INT32ARRAY:
|
|
|
|
case GIMP_PDB_INT16ARRAY:
|
|
|
|
case GIMP_PDB_INT8ARRAY:
|
|
|
|
case GIMP_PDB_FLOATARRAY:
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (args[i].value.pdb_pointer);
|
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STRINGARRAY:
|
2002-03-21 01:46:13 +08:00
|
|
|
{
|
|
|
|
gchar **stringarray;
|
|
|
|
gint count;
|
|
|
|
gint j;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
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);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2001-12-28 01:58:30 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
case GIMP_PDB_COLOR:
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_REGION:
|
|
|
|
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:
|
2002-03-21 01:46:13 +08:00
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
2002-03-21 01:46:13 +08:00
|
|
|
gimp_parasite_free ((GimpParasite *) (args[i].value.pdb_pointer));
|
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PDB_STATUS:
|
|
|
|
case GIMP_PDB_END:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (args);
|
|
|
|
}
|
2002-09-11 04:23:00 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
procedural_db_set_data (Gimp *gimp,
|
|
|
|
const gchar *identifier,
|
|
|
|
gint32 bytes,
|
|
|
|
const guint8 *data)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
PDBData *pdb_data;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
g_return_if_fail (identifier != NULL);
|
|
|
|
g_return_if_fail (bytes > 0);
|
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
|
|
|
|
for (list = gimp->procedural_db_data_list; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
pdb_data = (PDBData *) list->data;
|
|
|
|
|
|
|
|
if (! strcmp (pdb_data->identifier, identifier))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If there isn't already data with the specified identifier, create one */
|
|
|
|
if (list == NULL)
|
|
|
|
{
|
|
|
|
pdb_data = g_new0 (PDBData, 1);
|
|
|
|
pdb_data->identifier = g_strdup (identifier);
|
|
|
|
|
|
|
|
gimp->procedural_db_data_list =
|
|
|
|
g_list_prepend (gimp->procedural_db_data_list, pdb_data);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_free (pdb_data->data);
|
|
|
|
}
|
|
|
|
|
|
|
|
pdb_data->bytes = bytes;
|
|
|
|
pdb_data->data = g_memdup (data, bytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
const guint8 *
|
|
|
|
procedural_db_get_data (Gimp *gimp,
|
|
|
|
const gchar *identifier,
|
|
|
|
gint32 *bytes)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
PDBData *pdb_data;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
g_return_val_if_fail (identifier != NULL, NULL);
|
|
|
|
g_return_val_if_fail (bytes != NULL, NULL);
|
|
|
|
|
|
|
|
*bytes = 0;
|
|
|
|
|
|
|
|
for (list = gimp->procedural_db_data_list; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
pdb_data = (PDBData *) list->data;
|
|
|
|
|
|
|
|
if (! strcmp (pdb_data->identifier, identifier))
|
|
|
|
{
|
|
|
|
*bytes = pdb_data->bytes;
|
|
|
|
return pdb_data->data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|