Commit ebcb621c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

changed "prog_name" parameter of gimp_help() to "help_domain". It's

2004-01-20  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/help.pdb: changed "prog_name" parameter of
	gimp_help() to "help_domain". It's useless to pass the plug-in's
	executable name to the core because the core already knows it.
	Instead, enabled accessing arbitrary help domains via the
	PDB. Passing NULL as help_domain will use the domain the plug-in
	registered, or the GIMP main help domain if it didn't register a
	domain.

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

	* libgimp/gimpui.c (gimp_ui_help_func): pass NULL as help_domain.
parent b5bf60ac
2004-01-20 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/help.pdb: changed "prog_name" parameter of
gimp_help() to "help_domain". It's useless to pass the plug-in's
executable name to the core because the core already knows it.
Instead, enabled accessing arbitrary help domains via the
PDB. Passing NULL as help_domain will use the domain the plug-in
registered, or the GIMP main help domain if it didn't register a
domain.
* app/pdb/help_cmds.c
* libgimp/gimphelp_pdb.[ch]: regenerated.
* libgimp/gimpui.c (gimp_ui_help_func): pass NULL as help_domain.
2004-01-20 Sven Neumann <sven@gimp.org>
* tools/gimp-remote.c: made --new the default behaviour and allow
......@@ -20,7 +20,6 @@
#include "config.h"
#include <sys/types.h>
#include <glib-object.h>
......@@ -29,6 +28,8 @@
#include "pdb-types.h"
#include "procedural_db.h"
#include "core/gimp.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp.h"
......@@ -45,11 +46,11 @@ help_invoker (Gimp *gimp,
Argument *args)
{
gboolean success = TRUE;
gchar *prog_name;
gchar *help_domain;
gchar *help_id;
prog_name = (gchar *) args[0].value.pdb_pointer;
if (prog_name == NULL)
help_domain = (gchar *) args[0].value.pdb_pointer;
if (help_domain && !g_utf8_validate (help_domain, -1, NULL))
success = FALSE;
help_id = (gchar *) args[1].value.pdb_pointer;
......@@ -57,7 +58,13 @@ help_invoker (Gimp *gimp,
success = FALSE;
if (success)
gimp_help (gimp, plug_ins_help_domain (gimp, prog_name, NULL), help_id);
{
if (! help_domain && gimp->current_plug_in)
help_domain = (gchar *)
plug_ins_help_domain (gimp, gimp->current_plug_in->prog, NULL);
gimp_help (gimp, help_domain, help_id);
}
return procedural_db_return_args (&help_proc, success);
}
......@@ -66,8 +73,8 @@ static ProcArg help_inargs[] =
{
{
GIMP_PDB_STRING,
"prog_name",
"The plug-in's executable name or an empty string"
"help_domain",
"The help domain in which help_id is registered"
},
{
GIMP_PDB_STRING,
......@@ -80,7 +87,7 @@ static ProcRecord help_proc =
{
"gimp_help",
"Load a help page.",
"This procedure loads the specified help page into the helpbrowser or what ever is configured as help viewer. The location of the help page is given relative to the help rootdir. The help rootdir is determined from the prog_name: if prog_name is NULL, we use the help rootdir of the main GIMP installation, if the plug-in's full executable name is passed as prog_name, the GIMP will use this information to look up the help path the plug-in has registered before with gimp-plugin-help-register.",
"This procedure loads the specified help page into the helpbrowser or what ever is configured as help viewer. The help page is identified by its domain and ID: if help_domain is NULL, we use the help_domain which was registered using the gimp-plugin-help-register procedure. If help_domain is NULL and no help domain was registered, the help domain of the main GIMP installation is used.",
"Michael Natterer <mitch@gimp.org>",
"Michael Natterer <mitch@gimp.org>",
"2000",
......
......@@ -27,24 +27,22 @@
/**
* gimp_help:
* @prog_name: The plug-in's executable name or an empty string.
* @help_domain: The help domain in which help_id is registered.
* @help_id: The help page's ID.
*
* Load a help page.
*
* This procedure loads the specified help page into the helpbrowser or
* what ever is configured as help viewer. The location of the help
* page is given relative to the help rootdir. The help rootdir is
* determined from the prog_name: if prog_name is NULL, we use the help
* rootdir of the main GIMP installation, if the plug-in's full
* executable name is passed as prog_name, the GIMP will use this
* information to look up the help path the plug-in has registered
* before with gimp-plugin-help-register.
* what ever is configured as help viewer. The help page is identified
* by its domain and ID: if help_domain is NULL, we use the help_domain
* which was registered using the gimp-plugin-help-register procedure.
* If help_domain is NULL and no help domain was registered, the help
* domain of the main GIMP installation is used.
*
* Returns: TRUE on success.
*/
gboolean
gimp_help (const gchar *prog_name,
gimp_help (const gchar *help_domain,
const gchar *help_id)
{
GimpParam *return_vals;
......@@ -53,7 +51,7 @@ gimp_help (const gchar *prog_name,
return_vals = gimp_run_procedure ("gimp_help",
&nreturn_vals,
GIMP_PDB_STRING, prog_name,
GIMP_PDB_STRING, help_domain,
GIMP_PDB_STRING, help_id,
GIMP_PDB_END);
......
......@@ -29,7 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_help (const gchar *prog_name,
gboolean gimp_help (const gchar *help_domain,
const gchar *help_id);
......
......@@ -125,7 +125,7 @@ static void
gimp_ui_help_func (const gchar *help_id,
gpointer help_data)
{
gimp_help (gimp_get_progname (), help_id);
gimp_help (NULL, help_id);
}
static void
......
......@@ -17,40 +17,43 @@
# "Perlized" from C source by Sven Neumann <sven@gimp.org>
sub pdb_misc {
$author = $copyright = 'Michael Natterer <mitch@gimp.org>';
$date = '2000';
}
sub help {
$blurb = "Load a help page.";
$help = <<HELP;
This procedure loads the specified help page into the helpbrowser or what ever
is configured as help viewer. The location of the help page is given relative
to the help rootdir. The help rootdir is determined from the prog_name: if
prog_name is NULL, we use the help rootdir of the main GIMP installation,
if the plug-in's full executable name is passed as prog_name, the GIMP
will use this information to look up the help path the plug-in has registered
before with gimp-plugin-help-register.
This procedure loads the specified help page into the helpbrowser or
what ever is configured as help viewer. The help page is identified by
its domain and ID: if help_domain is NULL, we use the help_domain
which was registered using the gimp-plugin-help-register procedure. If
help_domain is NULL and no help domain was registered, the help domain
of the main GIMP installation is used.
HELP
&pdb_misc;
$author = $copyright = 'Michael Natterer <mitch@gimp.org>';
$date = '2000';
@inargs = (
{ name => 'prog_name', type => 'string', no_validate => 1,
desc => "The plug-in's executable name or an empty string" },
{ name => 'help_domain', type => 'string', null_ok => 1,
desc => "The help domain in which help_id is registered" },
{ name => 'help_id', type => 'string',
desc => 'The help page\'s ID' }
);
%invoke = (
success => 'TRUE',
code => 'gimp_help (gimp, plug_ins_help_domain (gimp, prog_name, NULL), help_id);'
code => <<CODE
{
if (! help_domain && gimp->current_plug_in)
help_domain = (gchar *)
plug_ins_help_domain (gimp, gimp->current_plug_in->prog, NULL);
gimp_help (gimp, help_domain, help_id);
}
CODE
);
}
@headers = qw(<sys/types.h> "plug-in/plug-ins.h" "widgets/gimphelp.h");
@headers = qw("core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-ins.h"
"widgets/gimphelp.h");
@procs = qw(help);
%exports = (app => [@procs], lib => [@procs]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment