app/core/gimp-gui.[ch] app/widgets/gimphelp.[ch] app/gui/gui-vtable.c

2008-06-10  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-gui.[ch]
	* app/widgets/gimphelp.[ch]
	* app/gui/gui-vtable.c
	* app/gui/gui.c: added a GimpProgress parameter to gimp_help().

	* app/actions/help-commands.c
	* app/widgets/gimpuimanager.c
	* tools/pdbgen/pdb/help.pdb: changed accordingly.

	* app/pdb/help-cmds.c: regenerated.

svn path=/trunk/; revision=25908
This commit is contained in:
Sven Neumann
2008-06-10 09:54:54 +00:00
committed by Sven Neumann
parent 6554c3e397
commit 769c4f925a
11 changed files with 73 additions and 38 deletions

View File

@ -1,3 +1,16 @@
2008-06-10 Sven Neumann <sven@gimp.org>
* app/core/gimp-gui.[ch]
* app/widgets/gimphelp.[ch]
* app/gui/gui-vtable.c
* app/gui/gui.c: added a GimpProgress parameter to gimp_help().
* app/actions/help-commands.c
* app/widgets/gimpuimanager.c
* tools/pdbgen/pdb/help.pdb: changed accordingly.
* app/pdb/help-cmds.c: regenerated.
2008-06-10 Sven Neumann <sven@gimp.org>
* app/plug-in/gimpplugin.c

View File

@ -24,6 +24,10 @@
#include "actions-types.h"
#include "core/gimpprogress.h"
#include "widgets/gimphelp.h"
#include "actions.h"
#include "help-commands.h"
@ -32,7 +36,12 @@ void
help_help_cmd_callback (GtkAction *action,
gpointer data)
{
gimp_standard_help_func (NULL, NULL);
Gimp *gimp;
GimpDisplay *display;
return_if_no_gimp (gimp, data);
return_if_no_display (display, data);
gimp_help_show (gimp, GIMP_PROGRESS (display), NULL, NULL);
}
void

View File

@ -190,14 +190,16 @@ gimp_show_message (Gimp *gimp,
}
void
gimp_help (Gimp *gimp,
const gchar *help_domain,
const gchar *help_id)
gimp_help (Gimp *gimp,
GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
if (gimp->gui.help)
gimp->gui.help (gimp, help_domain, help_id);
gimp->gui.help (gimp, progress, help_domain, help_id);
}
const gchar *

View File

@ -38,6 +38,7 @@ struct _GimpGui
const gchar *domain,
const gchar *message);
void (* help) (Gimp *gimp,
GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id);
@ -126,6 +127,7 @@ void gimp_show_message (Gimp *gimp,
const gchar *domain,
const gchar *message);
void gimp_help (Gimp *gimp,
GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id);

View File

@ -86,6 +86,7 @@ static void gui_threads_leave (Gimp *gimp);
static void gui_set_busy (Gimp *gimp);
static void gui_unset_busy (Gimp *gimp);
static void gui_help (Gimp *gimp,
GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id);
static const gchar * gui_get_program_class (Gimp *gimp);
@ -213,11 +214,12 @@ gui_unset_busy (Gimp *gimp)
}
static void
gui_help (Gimp *gimp,
const gchar *help_domain,
const gchar *help_id)
gui_help (Gimp *gimp,
GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id)
{
gimp_help_show (gimp, help_domain, help_id);
gimp_help_show (gimp, progress, help_domain, help_id);
}
static const gchar *

View File

@ -296,7 +296,7 @@ gui_help_func (const gchar *help_id,
{
g_return_if_fail (GIMP_IS_GIMP (the_gui_gimp));
gimp_help (the_gui_gimp, NULL, help_id);
gimp_help (the_gui_gimp, NULL, NULL, help_id);
}
static gboolean

View File

@ -60,7 +60,7 @@ help_invoker (GimpProcedure *procedure,
manager->current_plug_in->prog,
NULL);
gimp_help (gimp, help_domain, help_id);
gimp_help (gimp, progress, help_domain, help_id);
}
return gimp_procedure_get_return_values (procedure, success);

View File

@ -34,8 +34,9 @@
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimp-utils.h"
#include "core/gimpparamspecs.h"
#include "core/gimpprogress.h"
#include "core/gimp-utils.h"
#include "pdb/gimppdb.h"
#include "pdb/gimpprocedure.h"
@ -55,10 +56,11 @@ typedef struct _GimpIdleHelp GimpIdleHelp;
struct _GimpIdleHelp
{
Gimp *gimp;
gchar *help_domain;
gchar *help_locales;
gchar *help_id;
Gimp *gimp;
GimpProgress *progress;
gchar *help_domain;
gchar *help_locales;
gchar *help_id;
};
@ -73,6 +75,7 @@ static void gimp_help_browser_error (Gimp *gimp,
const gchar *text);
static void gimp_help_call (Gimp *gimp,
GimpProgress *progress,
const gchar *procedure_name,
const gchar *help_domain,
const gchar *help_locales,
@ -83,13 +86,15 @@ static gchar * gimp_help_get_locales (GimpGuiConfig *config);
/* public functions */
void
gimp_help_show (Gimp *gimp,
const gchar *help_domain,
const gchar *help_id)
gimp_help_show (Gimp *gimp,
GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id)
{
GimpGuiConfig *config;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
config = GIMP_GUI_CONFIG (gimp->config);
@ -97,7 +102,8 @@ gimp_help_show (Gimp *gimp,
{
GimpIdleHelp *idle_help = g_slice_new0 (GimpIdleHelp);
idle_help->gimp = gimp;
idle_help->gimp = gimp;
idle_help->progress = progress;
if (help_domain && strlen (help_domain))
idle_help->help_domain = g_strdup (help_domain);
@ -143,6 +149,7 @@ gimp_idle_help (GimpIdleHelp *idle_help)
if (procedure_name)
gimp_help_call (idle_help->gimp,
idle_help->progress,
procedure_name,
idle_help->help_domain,
idle_help->help_locales,
@ -280,11 +287,12 @@ gimp_help_browser_error (Gimp *gimp,
}
static void
gimp_help_call (Gimp *gimp,
const gchar *procedure_name,
const gchar *help_domain,
const gchar *help_locales,
const gchar *help_id)
gimp_help_call (Gimp *gimp,
GimpProgress *progress,
const gchar *procedure_name,
const gchar *help_domain,
const gchar *help_locales,
const gchar *help_id)
{
GimpProcedure *procedure;
@ -303,7 +311,7 @@ gimp_help_call (Gimp *gimp,
return_vals =
gimp_pdb_execute_procedure_by_name (gimp->pdb,
gimp_get_user_context (gimp),
NULL, &error,
progress, &error,
procedure_name,
G_TYPE_STRING, help_domain,
G_TYPE_STRING, help_locales,
@ -352,8 +360,8 @@ gimp_help_call (Gimp *gimp,
gimp_value_take_stringarray (&args->values[3], help_uris, n_domains);
gimp_procedure_execute_async (procedure, gimp,
gimp_get_user_context (gimp),
NULL, args, NULL, &error);
gimp_get_user_context (gimp), progress,
args, NULL, &error);
g_value_array_free (args);
@ -382,7 +390,7 @@ gimp_help_call (Gimp *gimp,
return_vals =
gimp_pdb_execute_procedure_by_name (gimp->pdb,
gimp_get_user_context (gimp),
NULL, &error,
progress, &error,
"extension-gimp-help-temp",
G_TYPE_STRING, procedure_name,
G_TYPE_STRING, help_domain,

View File

@ -25,11 +25,12 @@
/* the main help function
*
* there should be no need to use it in the common case
* there should be no need to use it directly
*/
void gimp_help_show (Gimp *gimp,
const gchar *help_domain,
const gchar *help_id);
void gimp_help_show (Gimp *gimp,
GimpProgress *progress,
const gchar *help_domain,
const gchar *help_id);
#endif /* __GIMP_HELP_H__ */

View File

@ -937,9 +937,7 @@ gimp_ui_manager_item_key_press (GtkWidget *widget,
while (! help_id)
{
GtkWidget *menu_item;
menu_item = GTK_MENU_SHELL (widget)->active_menu_item;
GtkWidget *menu_item = GTK_MENU_SHELL (widget)->active_menu_item;
/* first, get the help page from the item...
*/
@ -1021,7 +1019,7 @@ gimp_ui_manager_item_key_press (GtkWidget *widget,
help_string = g_strdup (help_id);
}
gimp_help (manager->gimp, help_domain, help_string);
gimp_help (manager->gimp, NULL, help_domain, help_string);
g_free (help_domain);
g_free (help_string);

View File

@ -49,7 +49,7 @@ HELP
manager->current_plug_in->prog,
NULL);
gimp_help (gimp, help_domain, help_id);
gimp_help (gimp, progress, help_domain, help_id);
}
CODE
);