gimp/app/plug-in/plug-in-def.c
Michael Natterer 47c5473e46 badly chopped into the new files below. Pass around much more "PlugIn" and
2002-03-20  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-in.[ch]: badly chopped into the new files below.
	Pass around much more "PlugIn" and "Gimp" pointers instead of
	using "current_plug_in" and "the_gimp". Needs much more hacking
	though... :(

	* app/plug-in/Makefile.am
	* app/plug-in/plug-in-def.[ch]
	* app/plug-in/plug-in-params.[ch]
	* app/plug-in/plug-in-progress.[ch]
	* app/plug-in/plug-ins.[ch]: new files.

	* app/gui/Makefile.am
	* app/gui/plug-in-commands.[ch]
	* app/gui/plug-in-menus.[ch]: ditto.

	* app/plug-in/plug-in-rc.c
	* app/plug-in/plug-in-types.h: changed accordingly.

	* app/pdb/procedural_db.c: changed procedural_db_destroy_args()
	so it can be used from plug_in_args_destroy(). Fixed a parasite
	memory leak (or introduced a new SEGV, we'll see...).

	* app/display/Makefile.am: another "truly ugly hack" until the
	plug-in menu stuff is chopped even more...

	* app/gui/commands.[ch]: removed filters_repeat_cmd_callback() here,
	it is now in plug-in-commands.[ch].

	* app/widgets/gimpitemfactory.[ch]: removed all gimp_menu_item_*()
	hacks. We have a GimpItemFactory available in most cases we used
	to call this functions, and can use gimp_item_factors_from_path()
	in all other cases. The item factory stuff needs more work
	anyway...

	* app/app_procs.c
	* app/gimphelp.c
	* app/display/gimpdisplayshell.c
	* app/gui/file-dialog-utils.c
	* app/gui/file-open-dialog.[ch]
	* app/gui/file-save-dialog.[ch]
	* app/gui/gui.c
	* app/gui/menus.c
	* app/gui/paths-dialog.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/help.pdb
	* tools/pdbgen/pdb/plug_in.pdb: changed accordingly (includes,
	renamed functions and gimp_menu_item_*() removal).

	* app/pdb/fileops_cmds.c
	* app/pdb/help_cmds.c
	* app/pdb/plug_in_cmds.c: regenerated.
2002-03-20 17:46:13 +00:00

111 lines
2.9 KiB
C

/* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "plug-in-types.h"
#include "plug-in.h"
#include "plug-in-def.h"
#include "plug-in-proc.h"
PlugInDef *
plug_in_def_new (const gchar *prog)
{
PlugInDef *plug_in_def;
g_return_val_if_fail (prog != NULL, NULL);
plug_in_def = g_new0 (PlugInDef, 1);
plug_in_def->prog = g_strdup (prog);
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);
g_free (plug_in_def->locale_domain);
g_free (plug_in_def->locale_path);
g_free (plug_in_def->help_path);
if (free_proc_defs)
{
for (list = plug_in_def->proc_defs; list; list = list->next)
plug_in_proc_def_destroy ((PlugInProcDef *)(list->data), FALSE);
}
if (plug_in_def->proc_defs)
g_slist_free (plug_in_def->proc_defs);
g_free (plug_in_def);
}
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);
}
void
plug_in_def_set_mtime (PlugInDef *plug_in_def,
time_t mtime)
{
plug_in_def->mtime = mtime;
}
void
plug_in_def_set_locale_domain_name (PlugInDef *plug_in_def,
const gchar *domain_name)
{
if (plug_in_def->locale_domain)
g_free (plug_in_def->locale_domain);
plug_in_def->locale_domain = g_strdup (domain_name);
}
void
plug_in_def_set_locale_domain_path (PlugInDef *plug_in_def,
const gchar *domain_path)
{
if (plug_in_def->locale_path)
g_free (plug_in_def->locale_path);
plug_in_def->locale_path = g_strdup (domain_path);
}
void
plug_in_def_set_help_path (PlugInDef *plug_in_def,
const gchar *help_path)
{
if (plug_in_def->help_path)
g_free (plug_in_def->help_path);
plug_in_def->help_path = g_strdup (help_path);
}