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
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
1999-06-15 06:18:02 +08:00
|
|
|
|
2001-12-01 08:14:14 +08:00
|
|
|
#include "plug-in-types.h"
|
2001-05-22 04:30:16 +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-def.h"
|
2001-12-19 08:13:16 +08:00
|
|
|
#include "plug-in-proc.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-02-24 02:07:53 +08:00
|
|
|
|
|
|
|
PlugInDef *
|
2001-01-14 11:55:56 +08:00
|
|
|
plug_in_def_new (const gchar *prog)
|
2000-02-24 02:07:53 +08:00
|
|
|
{
|
|
|
|
PlugInDef *plug_in_def;
|
|
|
|
|
|
|
|
g_return_val_if_fail (prog != NULL, NULL);
|
|
|
|
|
2001-12-29 06:58:14 +08:00
|
|
|
plug_in_def = g_new0 (PlugInDef, 1);
|
2000-02-24 02:07:53 +08:00
|
|
|
|
2001-12-29 06:58:14 +08:00
|
|
|
plug_in_def->prog = g_strdup (prog);
|
2000-02-24 02:07:53 +08:00
|
|
|
|
|
|
|
return plug_in_def;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
plug_in_def_free (PlugInDef *plug_in_def,
|
|
|
|
gboolean free_proc_defs)
|
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
g_free (plug_in_def->prog);
|
2001-12-29 06:58:14 +08:00
|
|
|
g_free (plug_in_def->locale_domain);
|
|
|
|
g_free (plug_in_def->locale_path);
|
|
|
|
g_free (plug_in_def->help_path);
|
2000-02-24 02:07:53 +08:00
|
|
|
|
2000-02-24 06:31:26 +08:00
|
|
|
if (free_proc_defs)
|
2000-02-24 02:07:53 +08:00
|
|
|
{
|
|
|
|
for (list = plug_in_def->proc_defs; list; list = list->next)
|
2000-02-24 06:31:26 +08:00
|
|
|
plug_in_proc_def_destroy ((PlugInProcDef *)(list->data), FALSE);
|
2000-02-24 02:07:53 +08:00
|
|
|
}
|
|
|
|
|
2000-02-24 06:31:26 +08:00
|
|
|
if (plug_in_def->proc_defs)
|
|
|
|
g_slist_free (plug_in_def->proc_defs);
|
|
|
|
|
2000-02-24 02:07:53 +08:00
|
|
|
g_free (plug_in_def);
|
|
|
|
}
|
|
|
|
|
2001-11-25 04:31:15 +08:00
|
|
|
void
|
|
|
|
plug_in_def_add_proc_def (PlugInDef *plug_in_def,
|
|
|
|
PlugInProcDef *proc_def)
|
|
|
|
{
|
|
|
|
proc_def->mtime = plug_in_def->mtime;
|
|
|
|
proc_def->prog = g_strdup (plug_in_def->prog);
|
|
|
|
|
|
|
|
plug_in_def->proc_defs = g_slist_append (plug_in_def->proc_defs,
|
|
|
|
proc_def);
|
|
|
|
}
|
2000-02-24 02:07:53 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_def_set_mtime (PlugInDef *plug_in_def,
|
|
|
|
time_t mtime)
|
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-03-21 01:46:13 +08:00
|
|
|
plug_in_def->mtime = mtime;
|
|
|
|
}
|
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-03-21 01:46:13 +08:00
|
|
|
void
|
|
|
|
plug_in_def_set_locale_domain_name (PlugInDef *plug_in_def,
|
|
|
|
const gchar *domain_name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
if (plug_in_def->locale_domain)
|
|
|
|
g_free (plug_in_def->locale_domain);
|
|
|
|
plug_in_def->locale_domain = g_strdup (domain_name);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2002-03-21 01:46:13 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_def_set_locale_domain_path (PlugInDef *plug_in_def,
|
|
|
|
const gchar *domain_path)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
if (plug_in_def->locale_path)
|
|
|
|
g_free (plug_in_def->locale_path);
|
|
|
|
plug_in_def->locale_path = g_strdup (domain_path);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
void
|
|
|
|
plug_in_def_set_help_path (PlugInDef *plug_in_def,
|
|
|
|
const gchar *help_path)
|
2001-11-25 04:31:15 +08:00
|
|
|
{
|
|
|
|
if (plug_in_def->help_path)
|
|
|
|
g_free (plug_in_def->help_path);
|
|
|
|
plug_in_def->help_path = g_strdup (help_path);
|
|
|
|
}
|