gimp/app/plug-in/gimppluginmanager.h
Michael Natterer 5f211479ac ref all registered procedures.
2006-04-07  Michael Natterer  <mitch@gimp.org>

	* app/pdb/gimp-pdb.c (gimp_pdb_register)
	(gimp_pdb_unregister): ref all registered procedures.

	* app/xcf/xcf.c
	* tools/pdbgen/app.pl: unref newly created procedures after
	registering them.

	* app/core/gimp.[ch]: renamed member "plug_in_proc_defs" to
	"plug_in_procedures". Renamed "proc_def" variables to "procedure".

	* app/actions/plug-in-actions.c
	* app/menus/plug-in-menus.c: changed accordingly.

	* app/plug-in/plug-ins.[ch]: keep a reference to all procs which
	are in gimp->plug_in_procedures.

	(plug_ins_exit): unref them all and free the list. Apparently we
	were leaking them before on exit.

	* app/plug-in/plug-in-def.[ch]: s/proc_defs/procedures/. Ref
	procedures added with plug_in_def_add_procedure(). Added
	plug_in_def_remove_procedure() which unrefs them again. Removed
	"free_proc_defs" parameter from plug_in_def_free() and always
	unref the procedures.

	* app/plug-in/plug-in.[ch]: added plug_in_add_temp_proc() and
	plug_in_remove_temp() proc. Ref the added procedures.

	* app/plug-in/plug-in-message.c: use the new APIs instead of
	adding/removing procs and temp procs from their lists manually.
	Unref the newly created procedure after adding then to the
	plug_in_def or plug_in.

	* app/plug-in/plug-in-rc.[ch]
	* app/plug-in/plug-ins-query.c
	* tools/pdbgen/pdb/plug_in.pdb: changed accordingly.

	* app/pdb/*_cmds.c: regenerated.
2006-04-07 08:16:26 +00:00

107 lines
4.9 KiB
C

/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* plug-ins.h
*
* 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.
*/
#ifndef __PLUG_INS_H__
#define __PLUG_INS_H__
struct _PlugInMenuBranch
{
gchar *prog_name;
gchar *menu_path;
gchar *menu_label;
};
void plug_ins_init (Gimp *gimp,
GimpContext *context,
GimpInitStatusFunc status_callback);
void plug_ins_exit (Gimp *gimp);
/* Register an internal plug-in. This is for file load-save
* handlers, which are organized around the plug-in data structure.
* This could all be done a little better, but oh well. -josh
*/
void plug_ins_add_internal (Gimp *gimp,
GimpPlugInProcedure *proc);
/* Add in the file load/save handler fields procedure. */
GimpPlugInProcedure * plug_ins_file_register_magic (Gimp *gimp,
const gchar *name,
const gchar *extensions,
const gchar *prefixes,
const gchar *magics);
GimpPlugInProcedure * plug_ins_file_register_mime (Gimp *gimp,
const gchar *name,
const gchar *mime_type);
GimpPlugInProcedure * plug_ins_file_register_thumb_loader
(Gimp *gimp,
const gchar *load_proc,
const gchar *thumb_proc);
/* Add a plug-in definition. */
void plug_ins_def_add_from_rc (Gimp *gimp,
PlugInDef *plug_in_def);
/* Add/Remove temporary procedures. */
void plug_ins_temp_procedure_add (Gimp *gimp,
GimpTemporaryProcedure *proc);
void plug_ins_temp_procedure_remove (Gimp *gimp,
GimpTemporaryProcedure *proc);
/* Add a menu branch */
void plug_ins_menu_branch_add (Gimp *gimp,
const gchar *prog_name,
const gchar *menu_path,
const gchar *menu_label);
/* Add a locale domain */
void plug_ins_locale_domain_add (Gimp *gimp,
const gchar *prog_name,
const gchar *domain_name,
const gchar *domain_path);
/* Retrieve a plug-ins locale domain */
const gchar * plug_ins_locale_domain (Gimp *gimp,
const gchar *prog_name,
const gchar **locale_path);
/* Add a help domain */
void plug_ins_help_domain_add (Gimp *gimp,
const gchar *prog_name,
const gchar *domain_name,
const gchar *domain_uri);
/* Retrieve a plug-ins help domain */
const gchar * plug_ins_help_domain (Gimp *gimp,
const gchar *prog_name,
const gchar **help_uri);
/* Retrieve all help domains */
gint plug_ins_help_domains (Gimp *gimp,
gchar ***help_domains,
gchar ***help_uris);
#endif /* __PLUG_INS_H__ */