Commit 1f2c75e5 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Completed the new help infrastructure. Needs some polishing but basically

2003-08-28  Michael Natterer  <mitch@gimp.org>

	Completed the new help infrastructure. Needs some polishing but
	basically works as proposed:

	* tools/pdbgen/pdb/plug_in.pdb: changed gimp_plugin_help_register()
	to take a "domain_name" (which is the XML namespace) and a
	"domain_uri" (which is the root of the plug-in's help pages).

	* tools/pdbgen/pdb/help.pdb: changed gimp_help() to take help_id
	instead of a non-UTF-8 help_path.

	* app/plug-in/plug-in-def.[ch]
	* app/plug-in/plug-in-proc.[ch]
	* app/plug-in/plug-in-rc.c
	* app/plug-in/plug-ins.[ch]: remember the plug-ins' help_domain
	and help_uri instead of just help_path. Changed all plug-in APIs
	to reflect this change.

	* app/widgets/gimphelp.[ch]: on helpbrowser startup, pass it the
	whole list of help domains. The actual help request is now made
	using the browser's temporary procedure.

	* app/core/gimp.h
	* app/gui/file-open-menu.c
	* app/gui/file-save-menu.c
	* app/gui/plug-in-menus.[ch]
	* app/widgets/gimpitemfactory.c: changed accordingly.

	* app/pdb/help_cmds.c
	* app/pdb/plug_in_cmds.c
	* libgimp/gimphelp_pdb.[ch]
	* libgimp/gimpplugin_pdb.[ch]: regenerated.

	Changed the help broser to load the pages according to the
	new system:

	- moved the browser window stuff to dialog.[ch]
	- moved help domain handling to domain.[ch]
	- added gimp-help.xml parsing to domain.c
	- tons of cleanup

	* plug-ins/helpbrowser/Makefile.am
	* plug-ins/helpbrowser/dialog.[ch]
	* plug-ins/helpbrowser/domain.[ch]: new files.
	* plug-ins/helpbrowser/helpbrowser.c: chopped.
parent 4d70bc73
2003-08-28 Michael Natterer <mitch@gimp.org>
Completed the new help infrastructure. Needs some polishing but
basically works as proposed:
* tools/pdbgen/pdb/plug_in.pdb: changed gimp_plugin_help_register()
to take a "domain_name" (which is the XML namespace) and a
"domain_uri" (which is the root of the plug-in's help pages).
* tools/pdbgen/pdb/help.pdb: changed gimp_help() to take help_id
instead of a non-UTF-8 help_path.
* app/plug-in/plug-in-def.[ch]
* app/plug-in/plug-in-proc.[ch]
* app/plug-in/plug-in-rc.c
* app/plug-in/plug-ins.[ch]: remember the plug-ins' help_domain
and help_uri instead of just help_path. Changed all plug-in APIs
to reflect this change.
* app/widgets/gimphelp.[ch]: on helpbrowser startup, pass it the
whole list of help domains. The actual help request is now made
using the browser's temporary procedure.
* app/core/gimp.h
* app/gui/file-open-menu.c
* app/gui/file-save-menu.c
* app/gui/plug-in-menus.[ch]
* app/widgets/gimpitemfactory.c: changed accordingly.
* app/pdb/help_cmds.c
* app/pdb/plug_in_cmds.c
* libgimp/gimphelp_pdb.[ch]
* libgimp/gimpplugin_pdb.[ch]: regenerated.
Changed the help broser to load the pages according to the
new system:
- moved the browser window stuff to dialog.[ch]
- moved help domain handling to domain.[ch]
- added gimp-help.xml parsing to domain.c
- tons of cleanup
* plug-ins/helpbrowser/Makefile.am
* plug-ins/helpbrowser/dialog.[ch]
* plug-ins/helpbrowser/domain.[ch]: new files.
* plug-ins/helpbrowser/helpbrowser.c: chopped.
2003-08-28 Simon Budig <simon@gimp.org>
* app/core/gimpimage-mask-select.c
......@@ -84,7 +84,7 @@ struct _Gimp
GSList *plug_in_proc_defs;
GSList *plug_in_locale_domains;
GSList *plug_in_help_paths;
GSList *plug_in_help_domains;
PlugIn *current_plug_in;
GSList *open_plug_ins;
......
......@@ -82,21 +82,21 @@ file_open_menu_setup (GimpItemFactory *factory)
else
{
const gchar *progname;
const gchar *help_path;
const gchar *help_domain;
progname = plug_in_proc_def_get_progname (file_proc);
locale_domain = plug_ins_locale_domain (factory->gimp, progname, NULL);
help_path = plug_ins_help_path (factory->gimp, progname);
help_domain = plug_ins_help_domain (factory->gimp, progname, NULL);
help_id = plug_in_proc_def_get_help_id (file_proc, help_path);
help_id = plug_in_proc_def_get_help_id (file_proc, help_domain);
}
entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL;
entry.entry.callback = file_open_type_cmd_callback;
entry.entry.callback_action = 0;
entry.entry.item_type = item_type;
entry.entry.item_type = (gchar *) item_type;
entry.entry.extra_data = stock_id;
entry.quark_string = NULL;
entry.help_id = help_id;
......
......@@ -83,21 +83,21 @@ file_save_menu_setup (GimpItemFactory *factory)
else
{
const gchar *progname;
const gchar *help_path;
const gchar *help_domain;
progname = plug_in_proc_def_get_progname (file_proc);
locale_domain = plug_ins_locale_domain (factory->gimp, progname, NULL);
help_path = plug_ins_help_path (factory->gimp, progname);
help_domain = plug_ins_help_domain (factory->gimp, progname, NULL);
help_id = plug_in_proc_def_get_help_id (file_proc, help_path);
help_id = plug_in_proc_def_get_help_id (file_proc, help_domain);
}
entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL;
entry.entry.callback = file_save_type_cmd_callback;
entry.entry.callback_action = 0;
entry.entry.item_type = item_type;
entry.entry.item_type = (gchar *) item_type;
entry.entry.extra_data = stock_id;
entry.quark_string = NULL;
entry.help_id = help_id;
......
......@@ -49,7 +49,7 @@ struct _PlugInMenuEntry
{
PlugInProcDef *proc_def;
const gchar *locale_domain;
const gchar *help_path;
const gchar *help_domain;
};
......@@ -135,20 +135,20 @@ plug_in_menus_create (GimpItemFactory *item_factory,
PlugInMenuEntry *menu_entry;
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
const gchar *help_domain;
progname = plug_in_proc_def_get_progname (proc_def);
locale_domain = plug_ins_locale_domain (item_factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (item_factory->gimp,
progname);
help_domain = plug_ins_help_domain (item_factory->gimp,
progname, NULL);
menu_entry = g_new0 (PlugInMenuEntry, 1);
menu_entry->proc_def = proc_def;
menu_entry->locale_domain = locale_domain;
menu_entry->help_path = help_path;
menu_entry->help_domain = help_domain;
g_tree_insert (menu_entries,
dgettext (locale_domain, proc_def->menu_path),
......@@ -166,7 +166,7 @@ void
plug_in_menus_create_entry (GimpItemFactory *item_factory,
PlugInProcDef *proc_def,
const gchar *locale_domain,
const gchar *help_path)
const gchar *help_domain)
{
GimpItemFactoryEntry entry;
gchar *help_id;
......@@ -175,7 +175,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
GIMP_IS_ITEM_FACTORY (item_factory));
g_return_if_fail (proc_def != NULL);
help_id = plug_in_proc_def_get_help_id (proc_def, help_path);
help_id = plug_in_proc_def_get_help_id (proc_def, help_domain);
entry.entry.path = strstr (proc_def->menu_path, "/");
entry.entry.accelerator = proc_def->accelerator;
......@@ -388,7 +388,7 @@ plug_in_menu_tree_traverse_func (gpointer foo,
plug_in_menus_create_entry (item_factory,
menu_entry->proc_def,
menu_entry->locale_domain,
menu_entry->help_path);
menu_entry->help_domain);
return FALSE;
}
......@@ -29,7 +29,7 @@ void plug_in_menus_create (GimpItemFactory *item_factory,
void plug_in_menus_create_entry (GimpItemFactory *item_factory,
PlugInProcDef *proc_def,
const gchar *locale_domain,
const gchar *help_path);
const gchar *help_domain);
void plug_in_menus_delete_entry (const gchar *menu_path);
void plug_in_menus_update (GimpItemFactory *item_factory,
......
......@@ -82,21 +82,21 @@ file_open_menu_setup (GimpItemFactory *factory)
else
{
const gchar *progname;
const gchar *help_path;
const gchar *help_domain;
progname = plug_in_proc_def_get_progname (file_proc);
locale_domain = plug_ins_locale_domain (factory->gimp, progname, NULL);
help_path = plug_ins_help_path (factory->gimp, progname);
help_domain = plug_ins_help_domain (factory->gimp, progname, NULL);
help_id = plug_in_proc_def_get_help_id (file_proc, help_path);
help_id = plug_in_proc_def_get_help_id (file_proc, help_domain);
}
entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL;
entry.entry.callback = file_open_type_cmd_callback;
entry.entry.callback_action = 0;
entry.entry.item_type = item_type;
entry.entry.item_type = (gchar *) item_type;
entry.entry.extra_data = stock_id;
entry.quark_string = NULL;
entry.help_id = help_id;
......
......@@ -83,21 +83,21 @@ file_save_menu_setup (GimpItemFactory *factory)
else
{
const gchar *progname;
const gchar *help_path;
const gchar *help_domain;
progname = plug_in_proc_def_get_progname (file_proc);
locale_domain = plug_ins_locale_domain (factory->gimp, progname, NULL);
help_path = plug_ins_help_path (factory->gimp, progname);
help_domain = plug_ins_help_domain (factory->gimp, progname, NULL);
help_id = plug_in_proc_def_get_help_id (file_proc, help_path);
help_id = plug_in_proc_def_get_help_id (file_proc, help_domain);
}
entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL;
entry.entry.callback = file_save_type_cmd_callback;
entry.entry.callback_action = 0;
entry.entry.item_type = item_type;
entry.entry.item_type = (gchar *) item_type;
entry.entry.extra_data = stock_id;
entry.quark_string = NULL;
entry.help_id = help_id;
......
......@@ -49,7 +49,7 @@ struct _PlugInMenuEntry
{
PlugInProcDef *proc_def;
const gchar *locale_domain;
const gchar *help_path;
const gchar *help_domain;
};
......@@ -135,20 +135,20 @@ plug_in_menus_create (GimpItemFactory *item_factory,
PlugInMenuEntry *menu_entry;
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
const gchar *help_domain;
progname = plug_in_proc_def_get_progname (proc_def);
locale_domain = plug_ins_locale_domain (item_factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (item_factory->gimp,
progname);
help_domain = plug_ins_help_domain (item_factory->gimp,
progname, NULL);
menu_entry = g_new0 (PlugInMenuEntry, 1);
menu_entry->proc_def = proc_def;
menu_entry->locale_domain = locale_domain;
menu_entry->help_path = help_path;
menu_entry->help_domain = help_domain;
g_tree_insert (menu_entries,
dgettext (locale_domain, proc_def->menu_path),
......@@ -166,7 +166,7 @@ void
plug_in_menus_create_entry (GimpItemFactory *item_factory,
PlugInProcDef *proc_def,
const gchar *locale_domain,
const gchar *help_path)
const gchar *help_domain)
{
GimpItemFactoryEntry entry;
gchar *help_id;
......@@ -175,7 +175,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
GIMP_IS_ITEM_FACTORY (item_factory));
g_return_if_fail (proc_def != NULL);
help_id = plug_in_proc_def_get_help_id (proc_def, help_path);
help_id = plug_in_proc_def_get_help_id (proc_def, help_domain);
entry.entry.path = strstr (proc_def->menu_path, "/");
entry.entry.accelerator = proc_def->accelerator;
......@@ -388,7 +388,7 @@ plug_in_menu_tree_traverse_func (gpointer foo,
plug_in_menus_create_entry (item_factory,
menu_entry->proc_def,
menu_entry->locale_domain,
menu_entry->help_path);
menu_entry->help_domain);
return FALSE;
}
......@@ -29,7 +29,7 @@ void plug_in_menus_create (GimpItemFactory *item_factory,
void plug_in_menus_create_entry (GimpItemFactory *item_factory,
PlugInProcDef *proc_def,
const gchar *locale_domain,
const gchar *help_path);
const gchar *help_domain);
void plug_in_menus_delete_entry (const gchar *menu_path);
void plug_in_menus_update (GimpItemFactory *item_factory,
......
......@@ -107,7 +107,7 @@ plug_in_proc_def_get_progname (PlugInProcDef *proc_def)
gchar *
plug_in_proc_def_get_help_id (PlugInProcDef *proc_def,
const gchar *help_path)
const gchar *help_domain)
{
gchar *help_id;
gchar *p;
......@@ -120,14 +120,14 @@ plug_in_proc_def_get_help_id (PlugInProcDef *proc_def,
if (*p == '_')
*p = '-';
if (help_path)
if (help_domain)
{
gchar *path_and_id;
gchar *domain_and_id;
path_and_id = g_strconcat (help_path, ":", help_id, NULL);
domain_and_id = g_strconcat (help_domain, "?", help_id, NULL);
g_free (help_id);
return path_and_id;
return domain_and_id;
}
return help_id;
......
......@@ -48,7 +48,7 @@ void plug_in_proc_def_free (PlugInProcDef *proc_def);
ProcRecord * plug_in_proc_def_get_proc (PlugInProcDef *proc_def);
const gchar * plug_in_proc_def_get_progname (PlugInProcDef *proc_def);
gchar * plug_in_proc_def_get_help_id (PlugInProcDef *proc_def,
const gchar *help_path);
const gchar *help_domain);
#endif /* __PLUG_IN_PROC_H__ */
......@@ -46,18 +46,18 @@ help_invoker (Gimp *gimp,
{
gboolean success = TRUE;
gchar *prog_name;
gchar *help_page;
gchar *help_id;
prog_name = (gchar *) args[0].value.pdb_pointer;
if (prog_name == NULL)
success = FALSE;
help_page = (gchar *) args[1].value.pdb_pointer;
if (help_page == NULL)
help_id = (gchar *) args[1].value.pdb_pointer;
if (help_id == NULL || !g_utf8_validate (help_id, -1, NULL))
success = FALSE;
if (success)
gimp_help (gimp, plug_ins_help_path (gimp, prog_name), help_page);
gimp_help (gimp, plug_ins_help_domain (gimp, prog_name, NULL), help_id);
return procedural_db_return_args (&help_proc, success);
}
......@@ -71,8 +71,8 @@ static ProcArg help_inargs[] =
},
{
GIMP_PDB_STRING,
"help_page",
"The location of the help page"
"help_id",
"The help page's ID"
}
};
......
......@@ -475,17 +475,25 @@ plugin_help_register_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
gchar *help_path;
gchar *domain_name;
gchar *domain_uri;
domain_name = (gchar *) args[0].value.pdb_pointer;
if (domain_name == NULL || !g_utf8_validate (domain_name, -1, NULL))
success = FALSE;
help_path = (gchar *) args[0].value.pdb_pointer;
if (help_path == NULL)
domain_uri = (gchar *) args[1].value.pdb_pointer;
if (domain_uri == NULL || !g_utf8_validate (domain_uri, -1, NULL))
success = FALSE;
if (success)
{
if (gimp->current_plug_in && gimp->current_plug_in->query)
{
plug_in_def_set_help_path (gimp->current_plug_in->plug_in_def, help_path);
plug_in_def_set_help_domain_name (gimp->current_plug_in->plug_in_def,
domain_name);
plug_in_def_set_help_domain_uri (gimp->current_plug_in->plug_in_def,
domain_uri);
}
}
......@@ -496,8 +504,13 @@ static ProcArg plugin_help_register_inargs[] =
{
{
GIMP_PDB_STRING,
"help_path",
"The rootdir of the plug-in's help pages"
"domain_name",
"The XML namespace of the plug-in's help pages"
},
{
GIMP_PDB_STRING,
"domain_uri",
"The root URI of the plug-in's help pages"
}
};
......@@ -505,12 +518,12 @@ static ProcRecord plugin_help_register_proc =
{
"gimp_plugin_help_register",
"Register a help path for a plug-in.",
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir. This procedure can only be called in the query function of a plug-in and it has to be called before any procedure is installed.",
"This procedure changes the help rootdir for the plug-in which calls it. All subsequent calls of gimp_help from this plug-in will be interpreted relative to this rootdir.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"2000",
GIMP_INTERNAL,
1,
2,
plugin_help_register_inargs,
0,
NULL,
......
......@@ -59,19 +59,20 @@
typedef struct _PlugInLocaleDomainDef PlugInLocaleDomainDef;
typedef struct _PlugInHelpPathDef PlugInHelpPathDef;
typedef struct _PlugInHelpDomainDef PlugInHelpDomainDef;
struct _PlugInLocaleDomainDef
{
gchar *prog_name;
gchar *locale_domain;
gchar *locale_path;
gchar *domain_name;
gchar *domain_path;
};
struct _PlugInHelpPathDef
struct _PlugInHelpDomainDef
{
gchar *prog_name;
gchar *help_path;
gchar *domain_name;
gchar *domain_uri;
};
......@@ -240,31 +241,38 @@ plug_ins_init (Gimp *gimp,
{
plug_in_def = tmp->data;
if (plug_in_def->locale_domain)
if (plug_in_def->locale_domain_name)
{
PlugInLocaleDomainDef *locale_domain_def;
PlugInLocaleDomainDef *def;
locale_domain_def = g_new (PlugInLocaleDomainDef, 1);
def = g_new (PlugInLocaleDomainDef, 1);
locale_domain_def->prog_name = g_strdup (plug_in_def->prog);
locale_domain_def->locale_domain = g_strdup (plug_in_def->locale_domain);
locale_domain_def->locale_path = g_strdup (plug_in_def->locale_path);
def->prog_name = g_strdup (plug_in_def->prog);
def->domain_name = g_strdup (plug_in_def->locale_domain_name);
def->domain_path = g_strdup (plug_in_def->locale_domain_path);
gimp->plug_in_locale_domains =
g_slist_prepend (gimp->plug_in_locale_domains, locale_domain_def);
g_slist_prepend (gimp->plug_in_locale_domains, def);
g_print ("added locale domain \"%s\" for path \"%s\"\n",
def->domain_name, def->domain_path);
}
if (plug_in_def->help_path)
if (plug_in_def->help_domain_name)
{
PlugInHelpPathDef *help_path_def;
PlugInHelpDomainDef *def;
def = g_new (PlugInHelpDomainDef, 1);
help_path_def = g_new (PlugInHelpPathDef, 1);
def->prog_name = g_strdup (plug_in_def->prog);
def->domain_name = g_strdup (plug_in_def->help_domain_name);
def->domain_uri = g_strdup (plug_in_def->help_domain_uri);
help_path_def->prog_name = g_strdup (plug_in_def->prog);
help_path_def->help_path = g_strdup (plug_in_def->help_path);
gimp->plug_in_help_domains =
g_slist_prepend (gimp->plug_in_help_domains, def);
gimp->plug_in_help_paths =
g_slist_prepend (gimp->plug_in_help_paths, help_path_def);
g_print ("added help domain \"%s\" for base uri \"%s\"\n",
def->domain_name, def->domain_uri);
}
}
......@@ -358,32 +366,29 @@ plug_ins_exit (Gimp *gimp)
for (list = gimp->plug_in_locale_domains; list; list = g_slist_next (list))
{
PlugInLocaleDomainDef *locale_domain_def;
locale_domain_def = list->data;
PlugInLocaleDomainDef *def = list->data;
g_free (locale_domain_def->prog_name);
g_free (locale_domain_def->locale_domain);
g_free (locale_domain_def->locale_path);
g_free (locale_domain_def);
g_free (def->prog_name);
g_free (def->domain_name);
g_free (def->domain_path);
g_free (def);
}
g_slist_free (gimp->plug_in_locale_domains);
gimp->plug_in_locale_domains = NULL;
for (list = gimp->plug_in_help_paths; list; list = g_slist_next (list))
for (list = gimp->plug_in_help_domains; list; list = g_slist_next (list))
{
PlugInHelpPathDef *help_path_def;
PlugInHelpDomainDef *def = list->data;
help_path_def = list->data;
g_free (help_path_def->prog_name);
g_free (help_path_def->help_path);
g_free (help_path_def);
g_free (def->prog_name);
g_free (def->domain_name);
g_free (def->domain_uri);
g_free (def);
}
g_slist_free (gimp->plug_in_help_paths);
gimp->plug_in_help_paths = NULL;
g_slist_free (gimp->plug_in_help_domains);
gimp->plug_in_help_domains = NULL;
}
void
......@@ -563,15 +568,15 @@ plug_ins_temp_proc_def_add (Gimp *gimp,
{
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
const gchar *help_domain;
progname = plug_in_proc_def_get_progname (proc_def);
locale_domain = plug_ins_locale_domain (gimp, progname, NULL);
help_path = plug_ins_help_path (gimp, progname);
help_domain = plug_ins_help_domain (gimp, progname, NULL);
plug_in_menus_create_entry (NULL, proc_def,
locale_domain, help_path);
locale_domain, help_domain);
}
}
......@@ -608,29 +613,26 @@ plug_ins_temp_proc_def_remove (Gimp *gimp,
const gchar *
plug_ins_locale_domain (Gimp *gimp,
const gchar *prog_name,
const gchar **locale_path)
const gchar **domain_path)
{
PlugInLocaleDomainDef *locale_domain_def;
GSList *list;
GSList *list;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (prog_name != NULL, NULL);
if (locale_path)
*locale_path = gimp_locale_directory ();
if (domain_path)
*domain_path = gimp_locale_directory ();
for (list = gimp->plug_in_locale_domains; list; list = g_slist_next (list))
{
locale_domain_def = (PlugInLocaleDomainDef *) list->data;
PlugInLocaleDomainDef *def = list->data;
if (locale_domain_def &&
locale_domain_def->prog_name &&
strcmp (locale_domain_def->prog_name, prog_name) == 0)
if (def && def->prog_name && ! strcmp (def->prog_name, prog_name))
{
if (locale_path && locale_domain_def->locale_path)
*locale_path = locale_domain_def->locale_path;
if (domain_path && def->domain_path)
*domain_path = def->domain_path;
return locale_domain_def->locale_domain;
return def->domain_name;
}
}
......@@ -638,28 +640,65 @@ plug_ins_locale_domain (Gimp *gimp,
}
const gchar *
plug_ins_help_path (Gimp *gimp,
const gchar *prog_name)
plug_ins_help_domain (Gimp *gimp,
const gchar *prog_name,
const gchar **domain_uri)
{
PlugInHelpPathDef *help_path_def;
GSList *list;
GSList *list;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (prog_name != NULL, NULL);
for (list = gimp->plug_in_help_paths; list; list = g_slist_next (list))
if (domain_uri)
*domain_uri = NULL;
for (list = gimp->plug_in_help_domains; list; list = g_slist_next (list))
{
help_path_def = (PlugInHelpPathDef *) list->data;
PlugInHelpDomainDef *def = list->data;
if (def && def->prog_name && ! strcmp (def->prog_name, prog_name))
{
if (domain_uri && def->domain_uri)
*domain_uri = def->domain_uri;
if (help_path_def &&
help_path_def->prog_name &&
strcmp (help_path_def->prog_name, prog_name) == 0)
return help_path_def->help_path;
return def->domain_name;
}
}
return NULL;
}
gint
plug_ins_help_domains (Gimp *gimp,
gchar ***help_domains,
gchar ***help_uris)
{
GSList *list;
gint n_domains;
gint i;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), 0);
g_return_val_if_fail (help_domains != NULL, 0);
g_return_val_if_fail (help_uris != NULL, 0);
n_domains = g_slist_length (gimp->plug_in_help_domains);
*help_domains = g_new0 (gchar *, n_domains);
*help_uris = g_new0 (gchar *, n_domains);
for (list = gimp->plug_in_help_domains, i = 0;
list;
list = g_slist_next (list), i++)
{
PlugInHelpDomainDef *def = list->data;
*help_domains[i] = g_strdup (def->domain_name);
*help_uris[i] = g_strdup (def->domain_uri);
}
return n_domains;
}
PlugInProcDef *
plug_ins_proc_def_find (Gimp *gimp,
ProcRecord *proc_rec)
......
......@@ -53,9 +53,15 @@ const gchar * plug_ins_locale_domain (Gimp *gimp,
const gchar *prog_name,
const gchar **locale_path);
/* Retrieve a plug-ins help path */
const gchar * plug_ins_help_path (Gimp *gimp,
const gchar *prog_name);
/* 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,