changed GimpHelpFunc typedef: - renamed "const gchar *help_data" to "const

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

	* libgimpwidgets/gimpwidgetstypes.h: changed GimpHelpFunc typedef:
	- renamed "const gchar *help_data" to "const gchar *help_id".
	- added "gpointer help_data".

	* libgimpwidgets/gimphelpui.[ch]: added "gpointer help_data" to
	gimp_help_connect(). Removed all fiddling with html links and
	treat all help IDs as opaque identifiers.

	* app/core/gimptoolinfo.[ch]: changed "help_data" member to
	"help_id".

	* app/widgets/gimpitemfactory.[ch]: removed the "help_path"
	parameter from gimp_item_factory_new() since we don't fiddle with
	html file paths any more. Simplifies menu item help a lot.
	Renamed "help_data" member of struct GimpItemFactoryEntry to
	"help_id".

	* app/gui/plug-in-menus.c: changed accordingly. 3rd party
	plug-ins' menu item help IDs are now encoded as
	"help_path:help_id".

	* app/gui/file-open-menu.c
	* app/gui/file-save-menu.c: when constructing the <Load> and
	<Save> menus, take the resp. procedures' locale_domain and
	help_path into account. Fixes translation of 3rd party menu items.
	Also do the right thing for load/save procs which are implemented
	as temporary procedures (they are impossible to implement
	currently but it's nice to do the right thing anyway...).

	* app/widgets/gimphelp-ids.h: added GIMP_HELP_MAIN identifier.

	* libgimpwidgets/gimpdialog.[ch]
	* libgimpwidgets/gimpwidgets.[ch]
	* libgimp/gimpui.c
	* app/display/gimpdisplayshell.c
	* app/gui/gui.c
	* app/gui/about-dialog.c
	* app/gui/color-notebook.c
	* app/gui/dialogs-constructors.c
	* app/gui/file-dialog-utils.[ch]
	* app/gui/gradients-commands.c
	* app/gui/help-commands.c
	* app/gui/image-menu.c
	* app/gui/menus.c
	* app/gui/preferences-dialog.c
	* app/gui/tips-dialog.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimphistogramtool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimptransformtool.c
	* app/widgets/gimperrorconsole.c
	* app/widgets/gimphelp.[ch]
	* app/widgets/gimpmenufactory.[ch]
	* app/widgets/gimptexteditor.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimpviewabledialog.[ch]
	* plug-ins/common/CEL.c
	* plug-ins/common/CML_explorer.c
	* plug-ins/common/gee.c
	* plug-ins/common/gee_zoom.c
	* plug-ins/common/gqbist.c
	* plug-ins/common/spheredesigner.c
	* plug-ins/flame/flame.c
	* plug-ins/fp/fp_gtk.c
	* plug-ins/helpbrowser/helpbrowser.c
	* plug-ins/ifscompose/ifscompose.c
	* plug-ins/imagemap/imap_main.c: changed accordingly. Removed
	trailing whitespace all over the place.
This commit is contained in:
Michael Natterer 2003-08-23 19:35:05 +00:00 committed by Michael Natterer
parent 9a52f49904
commit ba70ce9a10
72 changed files with 898 additions and 839 deletions

View file

@ -1,3 +1,78 @@
2003-08-23 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpwidgetstypes.h: changed GimpHelpFunc typedef:
- renamed "const gchar *help_data" to "const gchar *help_id".
- added "gpointer help_data".
* libgimpwidgets/gimphelpui.[ch]: added "gpointer help_data" to
gimp_help_connect(). Removed all fiddling with html links and
treat all help IDs as opaque identifiers.
* app/core/gimptoolinfo.[ch]: changed "help_data" member to
"help_id".
* app/widgets/gimpitemfactory.[ch]: removed the "help_path"
parameter from gimp_item_factory_new() since we don't fiddle with
html file paths any more. Simplifies menu item help a lot.
Renamed "help_data" member of struct GimpItemFactoryEntry to
"help_id".
* app/gui/plug-in-menus.c: changed accordingly. 3rd party
plug-ins' menu item help IDs are now encoded as
"help_path:help_id".
* app/gui/file-open-menu.c
* app/gui/file-save-menu.c: when constructing the <Load> and
<Save> menus, take the resp. procedures' locale_domain and
help_path into account. Fixes translation of 3rd party menu items.
Also do the right thing for load/save procs which are implemented
as temporary procedures (they are impossible to implement
currently but it's nice to do the right thing anyway...).
* app/widgets/gimphelp-ids.h: added GIMP_HELP_MAIN identifier.
* libgimpwidgets/gimpdialog.[ch]
* libgimpwidgets/gimpwidgets.[ch]
* libgimp/gimpui.c
* app/display/gimpdisplayshell.c
* app/gui/gui.c
* app/gui/about-dialog.c
* app/gui/color-notebook.c
* app/gui/dialogs-constructors.c
* app/gui/file-dialog-utils.[ch]
* app/gui/gradients-commands.c
* app/gui/help-commands.c
* app/gui/image-menu.c
* app/gui/menus.c
* app/gui/preferences-dialog.c
* app/gui/tips-dialog.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpcroptool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphistogramtool.c
* app/tools/gimpimagemaptool.c
* app/tools/gimplevelstool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimptransformtool.c
* app/widgets/gimperrorconsole.c
* app/widgets/gimphelp.[ch]
* app/widgets/gimpmenufactory.[ch]
* app/widgets/gimptexteditor.c
* app/widgets/gimptoolbox.c
* app/widgets/gimpviewabledialog.[ch]
* plug-ins/common/CEL.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/gee.c
* plug-ins/common/gee_zoom.c
* plug-ins/common/gqbist.c
* plug-ins/common/spheredesigner.c
* plug-ins/flame/flame.c
* plug-ins/fp/fp_gtk.c
* plug-ins/helpbrowser/helpbrowser.c
* plug-ins/ifscompose/ifscompose.c
* plug-ins/imagemap/imap_main.c: changed accordingly. Removed
trailing whitespace all over the place.
2003-06-22 Manish Singh <yosh@gimp.org> 2003-06-22 Manish Singh <yosh@gimp.org>
* configure.in: disallow libgimpprint >= 4.3.0, addresses bug #120162. * configure.in: disallow libgimpprint >= 4.3.0, addresses bug #120162.

View file

@ -104,7 +104,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func, gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
GIMP_HELP_GRADIENT_SAVE_AS_POV); GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
gtk_widget_show (GTK_WIDGET (filesel)); gtk_widget_show (GTK_WIDGET (filesel));
} }

View file

@ -24,10 +24,6 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimpobject.h"
#include "plug-in/plug-in.h"
#include "help-commands.h" #include "help-commands.h"
@ -36,7 +32,7 @@ help_help_cmd_callback (GtkWidget *widget,
gpointer data, gpointer data,
guint action) guint action)
{ {
gimp_standard_help_func (NULL); gimp_standard_help_func (NULL, NULL);
} }
void void

View file

@ -104,7 +104,7 @@ gimp_tool_info_init (GimpToolInfo *tool_info)
tool_info->menu_accel = NULL; tool_info->menu_accel = NULL;
tool_info->help_domain = NULL; tool_info->help_domain = NULL;
tool_info->help_data = NULL; tool_info->help_id = NULL;
tool_info->in_toolbox = TRUE; tool_info->in_toolbox = TRUE;
tool_info->tool_options = NULL; tool_info->tool_options = NULL;
@ -145,10 +145,10 @@ gimp_tool_info_finalize (GObject *object)
g_free (tool_info->help_domain); g_free (tool_info->help_domain);
tool_info->help_domain = NULL; tool_info->help_domain = NULL;
} }
if (tool_info->help_data) if (tool_info->help_id)
{ {
g_free (tool_info->help_data); g_free (tool_info->help_id);
tool_info->help_data = NULL; tool_info->help_id = NULL;
} }
if (tool_info->tool_options) if (tool_info->tool_options)
@ -185,7 +185,7 @@ gimp_tool_info_new (Gimp *gimp,
const gchar *menu_path, const gchar *menu_path,
const gchar *menu_accel, const gchar *menu_accel,
const gchar *help_domain, const gchar *help_domain,
const gchar *help_data, const gchar *help_id,
const gchar *paint_core_name, const gchar *paint_core_name,
const gchar *stock_id) const gchar *stock_id)
{ {
@ -227,7 +227,7 @@ gimp_tool_info_new (Gimp *gimp,
tool_info->menu_accel = g_strdup (menu_accel); tool_info->menu_accel = g_strdup (menu_accel);
tool_info->help_domain = g_strdup (help_domain); tool_info->help_domain = g_strdup (help_domain);
tool_info->help_data = g_strdup (help_data); tool_info->help_id = g_strdup (help_id);
gimp_viewable_set_stock_id (viewable, stock_id); gimp_viewable_set_stock_id (viewable, stock_id);

View file

@ -50,7 +50,7 @@ struct _GimpToolInfo
gchar *menu_accel; gchar *menu_accel;
gchar *help_domain; gchar *help_domain;
gchar *help_data; gchar *help_id;
gboolean in_toolbox; gboolean in_toolbox;
GimpToolOptions *tool_options; GimpToolOptions *tool_options;
@ -75,7 +75,7 @@ GimpToolInfo * gimp_tool_info_new (Gimp *gimp,
const gchar *menu_path, const gchar *menu_path,
const gchar *menu_accel, const gchar *menu_accel,
const gchar *help_domain, const gchar *help_domain,
const gchar *help_data, const gchar *help_id,
const gchar *paint_core_name, const gchar *paint_core_name,
const gchar *stock_id); const gchar *stock_id);

View file

@ -242,7 +242,7 @@ about_dialog_create (void)
gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE); gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE);
gimp_help_connect (about_dialog, gimp_standard_help_func, gimp_help_connect (about_dialog, gimp_standard_help_func,
GIMP_HELP_ABOUT_DIALOG); GIMP_HELP_ABOUT_DIALOG, NULL);
g_signal_connect (about_dialog, "destroy", g_signal_connect (about_dialog, "destroy",
G_CALLBACK (about_dialog_destroy), G_CALLBACK (about_dialog_destroy),

View file

@ -95,7 +95,8 @@ static ColorNotebook *
gboolean wants_updates, gboolean wants_updates,
gboolean show_alpha); gboolean show_alpha);
static void color_notebook_help_func (const gchar *help_data); static void color_notebook_help_func (const gchar *help_id,
gpointer help_data);
static void color_notebook_ok_callback (GtkWidget *widget, static void color_notebook_ok_callback (GtkWidget *widget,
ColorNotebook *cnp); ColorNotebook *cnp);
@ -322,22 +323,22 @@ color_notebook_new_internal (GimpViewable *viewable,
cnp->shell = gimp_viewable_dialog_new (viewable, cnp->shell = gimp_viewable_dialog_new (viewable,
title, wmclass_name, title, wmclass_name,
stock_id, desc, stock_id, desc,
color_notebook_help_func, color_notebook_help_func, NULL,
(const gchar *) cnp,
NULL); NULL);
gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE); gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE);
} }
else else
{ {
cnp->shell = gimp_dialog_new (title, wmclass_name, cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func, color_notebook_help_func, NULL,
(const gchar *) cnp, GTK_WIN_POS_NONE,
GTK_WIN_POS_NONE, FALSE, TRUE, TRUE,
FALSE, TRUE, TRUE, NULL);
NULL);
} }
g_object_set_data (G_OBJECT (cnp->shell), "color-notebook", cnp);
gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell), gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell),
GTK_STOCK_CANCEL, GTK_STOCK_CANCEL,
@ -535,21 +536,19 @@ color_notebook_new_internal (GimpViewable *viewable,
} }
static void static void
color_notebook_help_func (const gchar *data) color_notebook_help_func (const gchar *help_id,
gpointer help_data)
{ {
ColorNotebook *cnp; ColorNotebook *cnp;
GimpColorNotebook *notebook; GimpColorNotebook *notebook;
gchar *help_path;
cnp = (ColorNotebook *) data; cnp = g_object_get_data (G_OBJECT (help_data), "color-notebook");
notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook); notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook);
help_path = g_strconcat ("dialogs/color_selectors/", help_id = GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page;
GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page,
NULL); gimp_standard_help_func (help_id, NULL);
gimp_standard_help_func (help_path);
g_free (help_path);
} }
static void static void

View file

@ -1110,8 +1110,7 @@ dialogs_tool_options_tool_changed (GimpContext *context,
gtk_label_set_text (label, tool_info->blurb); gtk_label_set_text (label, tool_info->blurb);
gimp_help_set_help_data (GTK_WIDGET (label)->parent->parent, gimp_help_set_help_data (GTK_WIDGET (label)->parent->parent,
tool_info->help, tool_info->help, tool_info->help_id);
tool_info->help_data);
} }
static GtkWidget * static GtkWidget *

View file

@ -48,7 +48,7 @@ file_dialog_new (Gimp *gimp,
const gchar *menu_identifier, const gchar *menu_identifier,
const gchar *title, const gchar *title,
const gchar *wmclass_name, const gchar *wmclass_name,
const gchar *help_data, const gchar *help_id,
GCallback ok_callback) GCallback ok_callback)
{ {
GtkWidget *filesel; GtkWidget *filesel;
@ -61,7 +61,7 @@ file_dialog_new (Gimp *gimp,
g_return_val_if_fail (menu_identifier != NULL, NULL); g_return_val_if_fail (menu_identifier != NULL, NULL);
g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (title != NULL, NULL);
g_return_val_if_fail (wmclass_name != NULL, NULL); g_return_val_if_fail (wmclass_name != NULL, NULL);
g_return_val_if_fail (help_data != NULL, NULL); g_return_val_if_fail (help_id != NULL, NULL);
g_return_val_if_fail (ok_callback != NULL, NULL); g_return_val_if_fail (ok_callback != NULL, NULL);
filesel = gtk_file_selection_new (title); filesel = gtk_file_selection_new (title);
@ -73,7 +73,7 @@ file_dialog_new (Gimp *gimp,
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_wmclass (GTK_WINDOW (filesel), wmclass_name, "Gimp"); gtk_window_set_wmclass (GTK_WINDOW (filesel), wmclass_name, "Gimp");
gimp_help_connect (filesel, gimp_standard_help_func, help_data); gimp_help_connect (filesel, gimp_standard_help_func, help_id, NULL);
gtk_container_set_border_width (GTK_CONTAINER (fs->button_area), 2); gtk_container_set_border_width (GTK_CONTAINER (fs->button_area), 2);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2);

View file

@ -27,7 +27,7 @@ GtkWidget * file_dialog_new (Gimp *gimp,
const gchar *menu_identifier, const gchar *menu_identifier,
const gchar *title, const gchar *title,
const gchar *wmclass_name, const gchar *wmclass_name,
const gchar *help_data, const gchar *help_id,
GCallback ok_callback); GCallback ok_callback);
void file_dialog_show (GtkWidget *filesel); void file_dialog_show (GtkWidget *filesel);

View file

@ -464,7 +464,7 @@ prefs_notebook_append_page (Gimp *gimp,
const gchar *notebook_icon, const gchar *notebook_icon,
GtkTreeStore *tree, GtkTreeStore *tree,
const gchar *tree_label, const gchar *tree_label,
const gchar *help_data, const gchar *help_id,
GtkTreeIter *parent, GtkTreeIter *parent,
GtkTreeIter *iter, GtkTreeIter *iter,
gint page_index) gint page_index)
@ -478,7 +478,7 @@ prefs_notebook_append_page (Gimp *gimp,
gtk_notebook_append_page (notebook, event_box, NULL); gtk_notebook_append_page (notebook, event_box, NULL);
gtk_widget_show (event_box); gtk_widget_show (event_box);
gimp_help_set_help_data (event_box, NULL, help_data); gimp_help_set_help_data (event_box, NULL, help_id);
vbox = gtk_vbox_new (FALSE, 6); vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
@ -824,21 +824,19 @@ prefs_memsize_entry_add (GObject *config,
} }
static void static void
prefs_help_func (const gchar *help_data) prefs_help_func (const gchar *help_id,
gpointer help_data)
{ {
if (prefs_dialog) GtkWidget *notebook;
{ GtkWidget *event_box;
GtkWidget *notebook; gint page_num;
GtkWidget *event_box;
gint page_num;
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook"); notebook = g_object_get_data (G_OBJECT (help_data), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num); event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data"); help_id = g_object_get_data (G_OBJECT (event_box), "gimp-help-id");
gimp_standard_help_func (help_data); gimp_standard_help_func (help_id, NULL);
}
} }
static GtkWidget * static GtkWidget *

View file

@ -217,9 +217,8 @@ tips_dialog_create (Gimp *gimp)
G_CALLBACK (tips_show_next), G_CALLBACK (tips_show_next),
NULL); NULL);
/* Connect the "F1" help key */
gimp_help_connect (tips_dialog, gimp_standard_help_func, gimp_help_connect (tips_dialog, gimp_standard_help_func,
GIMP_HELP_TIPS_DIALOG); GIMP_HELP_TIPS_DIALOG, NULL);
tips_set_labels (current_tip->data); tips_set_labels (current_tip->data);

View file

@ -242,7 +242,7 @@ about_dialog_create (void)
gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE); gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE);
gimp_help_connect (about_dialog, gimp_standard_help_func, gimp_help_connect (about_dialog, gimp_standard_help_func,
GIMP_HELP_ABOUT_DIALOG); GIMP_HELP_ABOUT_DIALOG, NULL);
g_signal_connect (about_dialog, "destroy", g_signal_connect (about_dialog, "destroy",
G_CALLBACK (about_dialog_destroy), G_CALLBACK (about_dialog_destroy),

View file

@ -95,7 +95,8 @@ static ColorNotebook *
gboolean wants_updates, gboolean wants_updates,
gboolean show_alpha); gboolean show_alpha);
static void color_notebook_help_func (const gchar *help_data); static void color_notebook_help_func (const gchar *help_id,
gpointer help_data);
static void color_notebook_ok_callback (GtkWidget *widget, static void color_notebook_ok_callback (GtkWidget *widget,
ColorNotebook *cnp); ColorNotebook *cnp);
@ -322,22 +323,22 @@ color_notebook_new_internal (GimpViewable *viewable,
cnp->shell = gimp_viewable_dialog_new (viewable, cnp->shell = gimp_viewable_dialog_new (viewable,
title, wmclass_name, title, wmclass_name,
stock_id, desc, stock_id, desc,
color_notebook_help_func, color_notebook_help_func, NULL,
(const gchar *) cnp,
NULL); NULL);
gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE); gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE);
} }
else else
{ {
cnp->shell = gimp_dialog_new (title, wmclass_name, cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func, color_notebook_help_func, NULL,
(const gchar *) cnp, GTK_WIN_POS_NONE,
GTK_WIN_POS_NONE, FALSE, TRUE, TRUE,
FALSE, TRUE, TRUE, NULL);
NULL);
} }
g_object_set_data (G_OBJECT (cnp->shell), "color-notebook", cnp);
gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell), gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell),
GTK_STOCK_CANCEL, GTK_STOCK_CANCEL,
@ -535,21 +536,19 @@ color_notebook_new_internal (GimpViewable *viewable,
} }
static void static void
color_notebook_help_func (const gchar *data) color_notebook_help_func (const gchar *help_id,
gpointer help_data)
{ {
ColorNotebook *cnp; ColorNotebook *cnp;
GimpColorNotebook *notebook; GimpColorNotebook *notebook;
gchar *help_path;
cnp = (ColorNotebook *) data; cnp = g_object_get_data (G_OBJECT (help_data), "color-notebook");
notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook); notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook);
help_path = g_strconcat ("dialogs/color_selectors/", help_id = GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page;
GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page,
NULL); gimp_standard_help_func (help_id, NULL);
gimp_standard_help_func (help_path);
g_free (help_path);
} }
static void static void

View file

@ -1110,8 +1110,7 @@ dialogs_tool_options_tool_changed (GimpContext *context,
gtk_label_set_text (label, tool_info->blurb); gtk_label_set_text (label, tool_info->blurb);
gimp_help_set_help_data (GTK_WIDGET (label)->parent->parent, gimp_help_set_help_data (GTK_WIDGET (label)->parent->parent,
tool_info->help, tool_info->help, tool_info->help_id);
tool_info->help_data);
} }
static GtkWidget * static GtkWidget *

View file

@ -48,7 +48,7 @@ file_dialog_new (Gimp *gimp,
const gchar *menu_identifier, const gchar *menu_identifier,
const gchar *title, const gchar *title,
const gchar *wmclass_name, const gchar *wmclass_name,
const gchar *help_data, const gchar *help_id,
GCallback ok_callback) GCallback ok_callback)
{ {
GtkWidget *filesel; GtkWidget *filesel;
@ -61,7 +61,7 @@ file_dialog_new (Gimp *gimp,
g_return_val_if_fail (menu_identifier != NULL, NULL); g_return_val_if_fail (menu_identifier != NULL, NULL);
g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (title != NULL, NULL);
g_return_val_if_fail (wmclass_name != NULL, NULL); g_return_val_if_fail (wmclass_name != NULL, NULL);
g_return_val_if_fail (help_data != NULL, NULL); g_return_val_if_fail (help_id != NULL, NULL);
g_return_val_if_fail (ok_callback != NULL, NULL); g_return_val_if_fail (ok_callback != NULL, NULL);
filesel = gtk_file_selection_new (title); filesel = gtk_file_selection_new (title);
@ -73,7 +73,7 @@ file_dialog_new (Gimp *gimp,
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE); gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_wmclass (GTK_WINDOW (filesel), wmclass_name, "Gimp"); gtk_window_set_wmclass (GTK_WINDOW (filesel), wmclass_name, "Gimp");
gimp_help_connect (filesel, gimp_standard_help_func, help_data); gimp_help_connect (filesel, gimp_standard_help_func, help_id, NULL);
gtk_container_set_border_width (GTK_CONTAINER (fs->button_area), 2); gtk_container_set_border_width (GTK_CONTAINER (fs->button_area), 2);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 2); gtk_container_set_border_width (GTK_CONTAINER (filesel), 2);

View file

@ -27,7 +27,7 @@ GtkWidget * file_dialog_new (Gimp *gimp,
const gchar *menu_identifier, const gchar *menu_identifier,
const gchar *title, const gchar *title,
const gchar *wmclass_name, const gchar *wmclass_name,
const gchar *help_data, const gchar *help_id,
GCallback ok_callback); GCallback ok_callback);
void file_dialog_show (GtkWidget *filesel); void file_dialog_show (GtkWidget *filesel);

View file

@ -29,6 +29,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "plug-in/plug-in-proc.h" #include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp-ids.h" #include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h" #include "widgets/gimpitemfactory.h"
@ -56,31 +57,48 @@ gint n_file_open_menu_entries = G_N_ELEMENTS (file_open_menu_entries);
void void
file_open_menu_setup (GimpItemFactory *factory) file_open_menu_setup (GimpItemFactory *factory)
{ {
GimpItemFactoryEntry entry; GSList *list;
PlugInProcDef *file_proc;
GSList *list;
for (list = factory->gimp->load_procs; list; list = g_slist_next (list)) for (list = factory->gimp->load_procs; list; list = g_slist_next (list))
{ {
gchar *basename; PlugInProcDef *file_proc;
gchar *lowercase_basename; const gchar *progname;
gchar *help_page; const gchar *locale_domain;
const gchar *help_path;
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
file_proc = (PlugInProcDef *) list->data; file_proc = (PlugInProcDef *) list->data;
basename = g_path_get_basename (file_proc->prog); progname = plug_in_proc_def_get_progname (file_proc);
lowercase_basename = g_ascii_strdown (basename, -1); locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
g_free (basename); #ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
/* NOT g_build_filename() because this is a relative URI */ basename = g_path_get_basename (file_proc->prog);
help_page = g_strconcat ("filters/", lowercase_basename = g_ascii_strdown (basename, -1);
lowercase_basename,
".html",
NULL);
g_free (lowercase_basename); help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (help_id);
entry.entry.path = strstr (file_proc->menu_path, "/"); entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL; entry.entry.accelerator = NULL;
@ -88,12 +106,12 @@ file_open_menu_setup (GimpItemFactory *factory)
entry.entry.callback_action = 0; entry.entry.callback_action = 0;
entry.entry.item_type = NULL; entry.entry.item_type = NULL;
entry.quark_string = NULL; entry.quark_string = NULL;
entry.help_page = help_page; entry.help_id = help_page;
entry.description = NULL; entry.description = NULL;
gimp_item_factory_create_item (factory, gimp_item_factory_create_item (factory,
&entry, &entry,
NULL, locale_domain,
file_proc, 2, file_proc, 2,
TRUE, FALSE); TRUE, FALSE);

View file

@ -30,6 +30,7 @@
#include "core/gimpdrawable.h" #include "core/gimpdrawable.h"
#include "plug-in/plug-in-proc.h" #include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp-ids.h" #include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h" #include "widgets/gimpitemfactory.h"
@ -57,31 +58,48 @@ gint n_file_save_menu_entries = G_N_ELEMENTS (file_save_menu_entries);
void void
file_save_menu_setup (GimpItemFactory *factory) file_save_menu_setup (GimpItemFactory *factory)
{ {
GimpItemFactoryEntry entry; GSList *list;
PlugInProcDef *file_proc;
GSList *list;
for (list = factory->gimp->save_procs; list; list = g_slist_next (list)) for (list = factory->gimp->save_procs; list; list = g_slist_next (list))
{ {
gchar *basename; PlugInProcDef *file_proc;
gchar *lowercase_basename; const gchar *progname;
gchar *help_page; const gchar *locale_domain;
const gchar *help_path;
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
file_proc = (PlugInProcDef *) list->data; file_proc = (PlugInProcDef *) list->data;
basename = g_path_get_basename (file_proc->prog); progname = plug_in_proc_def_get_progname (file_proc);
lowercase_basename = g_ascii_strdown (basename, -1); locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
g_free (basename); #ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
/* NOT g_build_filename() because this is a relative URI */ basename = g_path_get_basename (file_proc->prog);
help_page = g_strconcat ("filters/", lowercase_basename = g_ascii_strdown (basename, -1);
lowercase_basename,
".html",
NULL);
g_free (lowercase_basename); help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (help_id);
entry.entry.path = strstr (file_proc->menu_path, "/"); entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL; entry.entry.accelerator = NULL;
@ -89,12 +107,12 @@ file_save_menu_setup (GimpItemFactory *factory)
entry.entry.callback_action = 0; entry.entry.callback_action = 0;
entry.entry.item_type = NULL; entry.entry.item_type = NULL;
entry.quark_string = NULL; entry.quark_string = NULL;
entry.help_page = help_page; entry.help_id = help_page;
entry.description = NULL; entry.description = NULL;
gimp_item_factory_create_item (factory, gimp_item_factory_create_item (factory,
&entry, &entry,
NULL, locale_domain,
file_proc, 2, file_proc, 2,
TRUE, FALSE); TRUE, FALSE);

View file

@ -104,7 +104,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func, gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
GIMP_HELP_GRADIENT_SAVE_AS_POV); GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
gtk_widget_show (GTK_WIDGET (filesel)); gtk_widget_show (GTK_WIDGET (filesel));
} }

View file

@ -66,7 +66,8 @@
/* local function prototypes */ /* local function prototypes */
static void gui_help_func (const gchar *help_data); static void gui_help_func (const gchar *help_id,
gpointer help_data);
static gboolean gui_get_background_func (GimpRGB *color); static gboolean gui_get_background_func (GimpRGB *color);
static gboolean gui_get_foreground_func (GimpRGB *color); static gboolean gui_get_foreground_func (GimpRGB *color);
@ -367,9 +368,10 @@ gui_post_init (Gimp *gimp)
/* private functions */ /* private functions */
static void static void
gui_help_func (const gchar *help_data) gui_help_func (const gchar *help_id,
gpointer help_data)
{ {
gimp_help (the_gimp, NULL, help_data); gimp_help (the_gimp, NULL, help_id);
} }
static gboolean static gboolean

View file

@ -24,10 +24,6 @@
#include "gui-types.h" #include "gui-types.h"
#include "core/gimpobject.h"
#include "plug-in/plug-in.h"
#include "help-commands.h" #include "help-commands.h"
@ -36,7 +32,7 @@ help_help_cmd_callback (GtkWidget *widget,
gpointer data, gpointer data,
guint action) guint action)
{ {
gimp_standard_help_func (NULL); gimp_standard_help_func (NULL, NULL);
} }
void void

View file

@ -1116,7 +1116,7 @@ image_menu_setup (GimpItemFactory *factory)
const gchar *stock_id; const gchar *stock_id;
const gchar *identifier; const gchar *identifier;
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info)); stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
identifier = gimp_object_get_name (GIMP_OBJECT (tool_info)); identifier = gimp_object_get_name (GIMP_OBJECT (tool_info));
entry.entry.path = tool_info->menu_path; entry.entry.path = tool_info->menu_path;
@ -1126,7 +1126,7 @@ image_menu_setup (GimpItemFactory *factory)
entry.entry.item_type = "<StockItem>"; entry.entry.item_type = "<StockItem>";
entry.entry.extra_data = stock_id; entry.entry.extra_data = stock_id;
entry.quark_string = identifier; entry.quark_string = identifier;
entry.help_page = tool_info->help_data; entry.help_id = tool_info->help_id;
entry.description = NULL; entry.description = NULL;
gimp_item_factory_create_item (factory, gimp_item_factory_create_item (factory,

View file

@ -107,129 +107,108 @@ menus_init (Gimp *gimp)
global_menu_factory = gimp_menu_factory_new (gimp); global_menu_factory = gimp_menu_factory_new (gimp);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Toolbox>",
"<Toolbox>", "toolbox",
toolbox_menu_setup, NULL, FALSE, toolbox_menu_setup, NULL, FALSE,
n_toolbox_menu_entries, n_toolbox_menu_entries,
toolbox_menu_entries); toolbox_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Image>",
"<Image>", "image",
image_menu_setup, image_menu_update, FALSE, image_menu_setup, image_menu_update, FALSE,
n_image_menu_entries, n_image_menu_entries,
image_menu_entries); image_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Load>",
"<Load>", "open",
file_open_menu_setup, NULL, FALSE, file_open_menu_setup, NULL, FALSE,
n_file_open_menu_entries, n_file_open_menu_entries,
file_open_menu_entries); file_open_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Save>",
"<Save>", "save",
file_save_menu_setup, file_save_menu_setup,
file_save_menu_update, FALSE, file_save_menu_update, FALSE,
n_file_save_menu_entries, n_file_save_menu_entries,
file_save_menu_entries); file_save_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Layers>",
"<Layers>", "layers",
NULL, layers_menu_update, TRUE, NULL, layers_menu_update, TRUE,
n_layers_menu_entries, n_layers_menu_entries,
layers_menu_entries); layers_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Channels>",
"<Channels>", "channels",
NULL, channels_menu_update, TRUE, NULL, channels_menu_update, TRUE,
n_channels_menu_entries, n_channels_menu_entries,
channels_menu_entries); channels_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Vectors>",
"<Vectors>", "vectors",
NULL, vectors_menu_update, TRUE, NULL, vectors_menu_update, TRUE,
n_vectors_menu_entries, n_vectors_menu_entries,
vectors_menu_entries); vectors_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Dialogs>",
"<Dialogs>", "dialogs",
NULL, dialogs_menu_update, TRUE, NULL, dialogs_menu_update, TRUE,
n_dialogs_menu_entries, n_dialogs_menu_entries,
dialogs_menu_entries); dialogs_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Brushes>",
"<Brushes>", "brushes",
NULL, brushes_menu_update, TRUE, NULL, brushes_menu_update, TRUE,
n_brushes_menu_entries, n_brushes_menu_entries,
brushes_menu_entries); brushes_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Patterns>",
"<Patterns>", "patterns",
NULL, patterns_menu_update, TRUE, NULL, patterns_menu_update, TRUE,
n_patterns_menu_entries, n_patterns_menu_entries,
patterns_menu_entries); patterns_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Gradients>",
"<Gradients>", "gradients",
NULL, gradients_menu_update, TRUE, NULL, gradients_menu_update, TRUE,
n_gradients_menu_entries, n_gradients_menu_entries,
gradients_menu_entries); gradients_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Palettes>",
"<Palettes>", "palettes",
NULL, palettes_menu_update, TRUE, NULL, palettes_menu_update, TRUE,
n_palettes_menu_entries, n_palettes_menu_entries,
palettes_menu_entries); palettes_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Buffers>",
"<Buffers>", "buffers",
NULL, buffers_menu_update, TRUE, NULL, buffers_menu_update, TRUE,
n_buffers_menu_entries, n_buffers_menu_entries,
buffers_menu_entries); buffers_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Documents>",
"<Documents>", "documents",
NULL, documents_menu_update, TRUE, NULL, documents_menu_update, TRUE,
n_documents_menu_entries, n_documents_menu_entries,
documents_menu_entries); documents_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Templates>",
"<Templates>", "templates",
NULL, templates_menu_update, TRUE, NULL, templates_menu_update, TRUE,
n_templates_menu_entries, n_templates_menu_entries,
templates_menu_entries); templates_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Images>",
"<Images>", "images",
NULL, images_menu_update, TRUE, NULL, images_menu_update, TRUE,
n_images_menu_entries, n_images_menu_entries,
images_menu_entries); images_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<GradientEditor>",
"<GradientEditor>", "gradient_editor",
NULL, gradient_editor_menu_update, TRUE, NULL, gradient_editor_menu_update, TRUE,
n_gradient_editor_menu_entries, n_gradient_editor_menu_entries,
gradient_editor_menu_entries); gradient_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<PaletteEditor>",
"<PaletteEditor>", "palette_editor",
NULL, palette_editor_menu_update, TRUE, NULL, palette_editor_menu_update, TRUE,
n_palette_editor_menu_entries, n_palette_editor_menu_entries,
palette_editor_menu_entries); palette_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<ColormapEditor>",
"<ColormapEditor>", "colormap_editor",
NULL, colormap_editor_menu_update, TRUE, NULL, colormap_editor_menu_update, TRUE,
n_colormap_editor_menu_entries, n_colormap_editor_menu_entries,
colormap_editor_menu_entries); colormap_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<QMask>",
"<QMask>", "qmask",
NULL, qmask_menu_update, TRUE, NULL, qmask_menu_update, TRUE,
n_qmask_menu_entries, n_qmask_menu_entries,
qmask_menu_entries); qmask_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<ErrorConsole>",
"<ErrorConsole>", "error_console",
NULL, error_console_menu_update, TRUE, NULL, error_console_menu_update, TRUE,
n_error_console_menu_entries, n_error_console_menu_entries,
error_console_menu_entries); error_console_menu_entries);
@ -312,7 +291,7 @@ menus_last_opened_add (GimpItemFactory *item_factory,
last_opened_entries[i].entry.item_type = "<StockItem>"; last_opened_entries[i].entry.item_type = "<StockItem>";
last_opened_entries[i].entry.extra_data = GTK_STOCK_OPEN; last_opened_entries[i].entry.extra_data = GTK_STOCK_OPEN;
last_opened_entries[i].quark_string = NULL; last_opened_entries[i].quark_string = NULL;
last_opened_entries[i].help_page = GIMP_HELP_FILE_OPEN_RECENT; last_opened_entries[i].help_id = GIMP_HELP_FILE_OPEN_RECENT;
last_opened_entries[i].description = NULL; last_opened_entries[i].description = NULL;
} }

View file

@ -48,7 +48,7 @@ typedef struct _PlugInMenuEntry PlugInMenuEntry;
struct _PlugInMenuEntry struct _PlugInMenuEntry
{ {
PlugInProcDef *proc_def; PlugInProcDef *proc_def;
const gchar *domain; const gchar *locale_domain;
const gchar *help_path; const gchar *help_path;
}; };
@ -149,9 +149,9 @@ plug_in_menus_create (GimpItemFactory *item_factory,
menu_entry = g_new0 (PlugInMenuEntry, 1); menu_entry = g_new0 (PlugInMenuEntry, 1);
menu_entry->proc_def = proc_def; menu_entry->proc_def = proc_def;
menu_entry->domain = locale_domain; menu_entry->locale_domain = locale_domain;
menu_entry->help_path = help_path; menu_entry->help_path = help_path;
g_tree_insert (menu_entries, g_tree_insert (menu_entries,
dgettext (locale_domain, proc_def->menu_path), dgettext (locale_domain, proc_def->menu_path),
@ -172,36 +172,33 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
const gchar *help_path) const gchar *help_path)
{ {
GimpItemFactoryEntry entry; GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page; gchar *help_page;
gchar *basename;
gchar *lowercase_page;
g_return_if_fail (item_factory == NULL || g_return_if_fail (item_factory == NULL ||
GIMP_IS_ITEM_FACTORY (item_factory)); GIMP_IS_ITEM_FACTORY (item_factory));
basename = g_path_get_basename (proc_def->prog); #ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (proc_def->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path) if (help_path)
{ help_page = g_strconcat (help_path, ":", help_id, NULL);
help_page = g_strconcat (help_path,
"@", /* HACK: locale subdir */
basename,
".html",
NULL);
}
else else
{ help_page = g_strconcat ("filters/", help_id, NULL);
help_page = g_strconcat ("filters/", /* _not_ G_DIR_SEPARATOR_S */
basename,
".html",
NULL);
}
g_free (basename); g_free (help_id);
lowercase_page = g_ascii_strdown (help_page, -1);
g_free (help_page);
entry.entry.path = strstr (proc_def->menu_path, "/"); entry.entry.path = strstr (proc_def->menu_path, "/");
entry.entry.accelerator = proc_def->accelerator; entry.entry.accelerator = proc_def->accelerator;
@ -209,7 +206,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
entry.entry.callback_action = 0; entry.entry.callback_action = 0;
entry.entry.item_type = NULL; entry.entry.item_type = NULL;
entry.quark_string = NULL; entry.quark_string = NULL;
entry.help_page = lowercase_page; entry.help_id = help_page;
entry.description = NULL; entry.description = NULL;
if (item_factory) if (item_factory)
@ -246,7 +243,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
} }
} }
g_free (lowercase_page); g_free (help_page);
} }
void void
@ -413,7 +410,7 @@ plug_in_menu_tree_traverse_func (gpointer foo,
{ {
plug_in_menus_create_entry (item_factory, plug_in_menus_create_entry (item_factory,
menu_entry->proc_def, menu_entry->proc_def,
menu_entry->domain, menu_entry->locale_domain,
menu_entry->help_path); menu_entry->help_path);
return FALSE; return FALSE;

View file

@ -464,7 +464,7 @@ prefs_notebook_append_page (Gimp *gimp,
const gchar *notebook_icon, const gchar *notebook_icon,
GtkTreeStore *tree, GtkTreeStore *tree,
const gchar *tree_label, const gchar *tree_label,
const gchar *help_data, const gchar *help_id,
GtkTreeIter *parent, GtkTreeIter *parent,
GtkTreeIter *iter, GtkTreeIter *iter,
gint page_index) gint page_index)
@ -478,7 +478,7 @@ prefs_notebook_append_page (Gimp *gimp,
gtk_notebook_append_page (notebook, event_box, NULL); gtk_notebook_append_page (notebook, event_box, NULL);
gtk_widget_show (event_box); gtk_widget_show (event_box);
gimp_help_set_help_data (event_box, NULL, help_data); gimp_help_set_help_data (event_box, NULL, help_id);
vbox = gtk_vbox_new (FALSE, 6); vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
@ -824,21 +824,19 @@ prefs_memsize_entry_add (GObject *config,
} }
static void static void
prefs_help_func (const gchar *help_data) prefs_help_func (const gchar *help_id,
gpointer help_data)
{ {
if (prefs_dialog) GtkWidget *notebook;
{ GtkWidget *event_box;
GtkWidget *notebook; gint page_num;
GtkWidget *event_box;
gint page_num;
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook"); notebook = g_object_get_data (G_OBJECT (help_data), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num); event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data"); help_id = g_object_get_data (G_OBJECT (event_box), "gimp-help-id");
gimp_standard_help_func (help_data); gimp_standard_help_func (help_id, NULL);
}
} }
static GtkWidget * static GtkWidget *

View file

@ -217,9 +217,8 @@ tips_dialog_create (Gimp *gimp)
G_CALLBACK (tips_show_next), G_CALLBACK (tips_show_next),
NULL); NULL);
/* Connect the "F1" help key */
gimp_help_connect (tips_dialog, gimp_standard_help_func, gimp_help_connect (tips_dialog, gimp_standard_help_func,
GIMP_HELP_TIPS_DIALOG); GIMP_HELP_TIPS_DIALOG, NULL);
tips_set_labels (current_tip->data); tips_set_labels (current_tip->data);

View file

@ -29,6 +29,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "plug-in/plug-in-proc.h" #include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp-ids.h" #include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h" #include "widgets/gimpitemfactory.h"
@ -56,31 +57,48 @@ gint n_file_open_menu_entries = G_N_ELEMENTS (file_open_menu_entries);
void void
file_open_menu_setup (GimpItemFactory *factory) file_open_menu_setup (GimpItemFactory *factory)
{ {
GimpItemFactoryEntry entry; GSList *list;
PlugInProcDef *file_proc;
GSList *list;
for (list = factory->gimp->load_procs; list; list = g_slist_next (list)) for (list = factory->gimp->load_procs; list; list = g_slist_next (list))
{ {
gchar *basename; PlugInProcDef *file_proc;
gchar *lowercase_basename; const gchar *progname;
gchar *help_page; const gchar *locale_domain;
const gchar *help_path;
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
file_proc = (PlugInProcDef *) list->data; file_proc = (PlugInProcDef *) list->data;
basename = g_path_get_basename (file_proc->prog); progname = plug_in_proc_def_get_progname (file_proc);
lowercase_basename = g_ascii_strdown (basename, -1); locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
g_free (basename); #ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
/* NOT g_build_filename() because this is a relative URI */ basename = g_path_get_basename (file_proc->prog);
help_page = g_strconcat ("filters/", lowercase_basename = g_ascii_strdown (basename, -1);
lowercase_basename,
".html",
NULL);
g_free (lowercase_basename); help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (help_id);
entry.entry.path = strstr (file_proc->menu_path, "/"); entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL; entry.entry.accelerator = NULL;
@ -88,12 +106,12 @@ file_open_menu_setup (GimpItemFactory *factory)
entry.entry.callback_action = 0; entry.entry.callback_action = 0;
entry.entry.item_type = NULL; entry.entry.item_type = NULL;
entry.quark_string = NULL; entry.quark_string = NULL;
entry.help_page = help_page; entry.help_id = help_page;
entry.description = NULL; entry.description = NULL;
gimp_item_factory_create_item (factory, gimp_item_factory_create_item (factory,
&entry, &entry,
NULL, locale_domain,
file_proc, 2, file_proc, 2,
TRUE, FALSE); TRUE, FALSE);

View file

@ -30,6 +30,7 @@
#include "core/gimpdrawable.h" #include "core/gimpdrawable.h"
#include "plug-in/plug-in-proc.h" #include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp-ids.h" #include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h" #include "widgets/gimpitemfactory.h"
@ -57,31 +58,48 @@ gint n_file_save_menu_entries = G_N_ELEMENTS (file_save_menu_entries);
void void
file_save_menu_setup (GimpItemFactory *factory) file_save_menu_setup (GimpItemFactory *factory)
{ {
GimpItemFactoryEntry entry; GSList *list;
PlugInProcDef *file_proc;
GSList *list;
for (list = factory->gimp->save_procs; list; list = g_slist_next (list)) for (list = factory->gimp->save_procs; list; list = g_slist_next (list))
{ {
gchar *basename; PlugInProcDef *file_proc;
gchar *lowercase_basename; const gchar *progname;
gchar *help_page; const gchar *locale_domain;
const gchar *help_path;
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
file_proc = (PlugInProcDef *) list->data; file_proc = (PlugInProcDef *) list->data;
basename = g_path_get_basename (file_proc->prog); progname = plug_in_proc_def_get_progname (file_proc);
lowercase_basename = g_ascii_strdown (basename, -1); locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
g_free (basename); #ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
/* NOT g_build_filename() because this is a relative URI */ basename = g_path_get_basename (file_proc->prog);
help_page = g_strconcat ("filters/", lowercase_basename = g_ascii_strdown (basename, -1);
lowercase_basename,
".html",
NULL);
g_free (lowercase_basename); help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (help_id);
entry.entry.path = strstr (file_proc->menu_path, "/"); entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL; entry.entry.accelerator = NULL;
@ -89,12 +107,12 @@ file_save_menu_setup (GimpItemFactory *factory)
entry.entry.callback_action = 0; entry.entry.callback_action = 0;
entry.entry.item_type = NULL; entry.entry.item_type = NULL;
entry.quark_string = NULL; entry.quark_string = NULL;
entry.help_page = help_page; entry.help_id = help_page;
entry.description = NULL; entry.description = NULL;
gimp_item_factory_create_item (factory, gimp_item_factory_create_item (factory,
&entry, &entry,
NULL, locale_domain,
file_proc, 2, file_proc, 2,
TRUE, FALSE); TRUE, FALSE);

View file

@ -1116,7 +1116,7 @@ image_menu_setup (GimpItemFactory *factory)
const gchar *stock_id; const gchar *stock_id;
const gchar *identifier; const gchar *identifier;
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info)); stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
identifier = gimp_object_get_name (GIMP_OBJECT (tool_info)); identifier = gimp_object_get_name (GIMP_OBJECT (tool_info));
entry.entry.path = tool_info->menu_path; entry.entry.path = tool_info->menu_path;
@ -1126,7 +1126,7 @@ image_menu_setup (GimpItemFactory *factory)
entry.entry.item_type = "<StockItem>"; entry.entry.item_type = "<StockItem>";
entry.entry.extra_data = stock_id; entry.entry.extra_data = stock_id;
entry.quark_string = identifier; entry.quark_string = identifier;
entry.help_page = tool_info->help_data; entry.help_id = tool_info->help_id;
entry.description = NULL; entry.description = NULL;
gimp_item_factory_create_item (factory, gimp_item_factory_create_item (factory,

View file

@ -107,129 +107,108 @@ menus_init (Gimp *gimp)
global_menu_factory = gimp_menu_factory_new (gimp); global_menu_factory = gimp_menu_factory_new (gimp);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Toolbox>",
"<Toolbox>", "toolbox",
toolbox_menu_setup, NULL, FALSE, toolbox_menu_setup, NULL, FALSE,
n_toolbox_menu_entries, n_toolbox_menu_entries,
toolbox_menu_entries); toolbox_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Image>",
"<Image>", "image",
image_menu_setup, image_menu_update, FALSE, image_menu_setup, image_menu_update, FALSE,
n_image_menu_entries, n_image_menu_entries,
image_menu_entries); image_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Load>",
"<Load>", "open",
file_open_menu_setup, NULL, FALSE, file_open_menu_setup, NULL, FALSE,
n_file_open_menu_entries, n_file_open_menu_entries,
file_open_menu_entries); file_open_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Save>",
"<Save>", "save",
file_save_menu_setup, file_save_menu_setup,
file_save_menu_update, FALSE, file_save_menu_update, FALSE,
n_file_save_menu_entries, n_file_save_menu_entries,
file_save_menu_entries); file_save_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Layers>",
"<Layers>", "layers",
NULL, layers_menu_update, TRUE, NULL, layers_menu_update, TRUE,
n_layers_menu_entries, n_layers_menu_entries,
layers_menu_entries); layers_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Channels>",
"<Channels>", "channels",
NULL, channels_menu_update, TRUE, NULL, channels_menu_update, TRUE,
n_channels_menu_entries, n_channels_menu_entries,
channels_menu_entries); channels_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Vectors>",
"<Vectors>", "vectors",
NULL, vectors_menu_update, TRUE, NULL, vectors_menu_update, TRUE,
n_vectors_menu_entries, n_vectors_menu_entries,
vectors_menu_entries); vectors_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Dialogs>",
"<Dialogs>", "dialogs",
NULL, dialogs_menu_update, TRUE, NULL, dialogs_menu_update, TRUE,
n_dialogs_menu_entries, n_dialogs_menu_entries,
dialogs_menu_entries); dialogs_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Brushes>",
"<Brushes>", "brushes",
NULL, brushes_menu_update, TRUE, NULL, brushes_menu_update, TRUE,
n_brushes_menu_entries, n_brushes_menu_entries,
brushes_menu_entries); brushes_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Patterns>",
"<Patterns>", "patterns",
NULL, patterns_menu_update, TRUE, NULL, patterns_menu_update, TRUE,
n_patterns_menu_entries, n_patterns_menu_entries,
patterns_menu_entries); patterns_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Gradients>",
"<Gradients>", "gradients",
NULL, gradients_menu_update, TRUE, NULL, gradients_menu_update, TRUE,
n_gradients_menu_entries, n_gradients_menu_entries,
gradients_menu_entries); gradients_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Palettes>",
"<Palettes>", "palettes",
NULL, palettes_menu_update, TRUE, NULL, palettes_menu_update, TRUE,
n_palettes_menu_entries, n_palettes_menu_entries,
palettes_menu_entries); palettes_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Buffers>",
"<Buffers>", "buffers",
NULL, buffers_menu_update, TRUE, NULL, buffers_menu_update, TRUE,
n_buffers_menu_entries, n_buffers_menu_entries,
buffers_menu_entries); buffers_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Documents>",
"<Documents>", "documents",
NULL, documents_menu_update, TRUE, NULL, documents_menu_update, TRUE,
n_documents_menu_entries, n_documents_menu_entries,
documents_menu_entries); documents_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Templates>",
"<Templates>", "templates",
NULL, templates_menu_update, TRUE, NULL, templates_menu_update, TRUE,
n_templates_menu_entries, n_templates_menu_entries,
templates_menu_entries); templates_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<Images>",
"<Images>", "images",
NULL, images_menu_update, TRUE, NULL, images_menu_update, TRUE,
n_images_menu_entries, n_images_menu_entries,
images_menu_entries); images_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<GradientEditor>",
"<GradientEditor>", "gradient_editor",
NULL, gradient_editor_menu_update, TRUE, NULL, gradient_editor_menu_update, TRUE,
n_gradient_editor_menu_entries, n_gradient_editor_menu_entries,
gradient_editor_menu_entries); gradient_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<PaletteEditor>",
"<PaletteEditor>", "palette_editor",
NULL, palette_editor_menu_update, TRUE, NULL, palette_editor_menu_update, TRUE,
n_palette_editor_menu_entries, n_palette_editor_menu_entries,
palette_editor_menu_entries); palette_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<ColormapEditor>",
"<ColormapEditor>", "colormap_editor",
NULL, colormap_editor_menu_update, TRUE, NULL, colormap_editor_menu_update, TRUE,
n_colormap_editor_menu_entries, n_colormap_editor_menu_entries,
colormap_editor_menu_entries); colormap_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<QMask>",
"<QMask>", "qmask",
NULL, qmask_menu_update, TRUE, NULL, qmask_menu_update, TRUE,
n_qmask_menu_entries, n_qmask_menu_entries,
qmask_menu_entries); qmask_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory, gimp_menu_factory_menu_register (global_menu_factory, "<ErrorConsole>",
"<ErrorConsole>", "error_console",
NULL, error_console_menu_update, TRUE, NULL, error_console_menu_update, TRUE,
n_error_console_menu_entries, n_error_console_menu_entries,
error_console_menu_entries); error_console_menu_entries);
@ -312,7 +291,7 @@ menus_last_opened_add (GimpItemFactory *item_factory,
last_opened_entries[i].entry.item_type = "<StockItem>"; last_opened_entries[i].entry.item_type = "<StockItem>";
last_opened_entries[i].entry.extra_data = GTK_STOCK_OPEN; last_opened_entries[i].entry.extra_data = GTK_STOCK_OPEN;
last_opened_entries[i].quark_string = NULL; last_opened_entries[i].quark_string = NULL;
last_opened_entries[i].help_page = GIMP_HELP_FILE_OPEN_RECENT; last_opened_entries[i].help_id = GIMP_HELP_FILE_OPEN_RECENT;
last_opened_entries[i].description = NULL; last_opened_entries[i].description = NULL;
} }

View file

@ -48,7 +48,7 @@ typedef struct _PlugInMenuEntry PlugInMenuEntry;
struct _PlugInMenuEntry struct _PlugInMenuEntry
{ {
PlugInProcDef *proc_def; PlugInProcDef *proc_def;
const gchar *domain; const gchar *locale_domain;
const gchar *help_path; const gchar *help_path;
}; };
@ -149,9 +149,9 @@ plug_in_menus_create (GimpItemFactory *item_factory,
menu_entry = g_new0 (PlugInMenuEntry, 1); menu_entry = g_new0 (PlugInMenuEntry, 1);
menu_entry->proc_def = proc_def; menu_entry->proc_def = proc_def;
menu_entry->domain = locale_domain; menu_entry->locale_domain = locale_domain;
menu_entry->help_path = help_path; menu_entry->help_path = help_path;
g_tree_insert (menu_entries, g_tree_insert (menu_entries,
dgettext (locale_domain, proc_def->menu_path), dgettext (locale_domain, proc_def->menu_path),
@ -172,36 +172,33 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
const gchar *help_path) const gchar *help_path)
{ {
GimpItemFactoryEntry entry; GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page; gchar *help_page;
gchar *basename;
gchar *lowercase_page;
g_return_if_fail (item_factory == NULL || g_return_if_fail (item_factory == NULL ||
GIMP_IS_ITEM_FACTORY (item_factory)); GIMP_IS_ITEM_FACTORY (item_factory));
basename = g_path_get_basename (proc_def->prog); #ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (proc_def->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path) if (help_path)
{ help_page = g_strconcat (help_path, ":", help_id, NULL);
help_page = g_strconcat (help_path,
"@", /* HACK: locale subdir */
basename,
".html",
NULL);
}
else else
{ help_page = g_strconcat ("filters/", help_id, NULL);
help_page = g_strconcat ("filters/", /* _not_ G_DIR_SEPARATOR_S */
basename,
".html",
NULL);
}
g_free (basename); g_free (help_id);
lowercase_page = g_ascii_strdown (help_page, -1);
g_free (help_page);
entry.entry.path = strstr (proc_def->menu_path, "/"); entry.entry.path = strstr (proc_def->menu_path, "/");
entry.entry.accelerator = proc_def->accelerator; entry.entry.accelerator = proc_def->accelerator;
@ -209,7 +206,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
entry.entry.callback_action = 0; entry.entry.callback_action = 0;
entry.entry.item_type = NULL; entry.entry.item_type = NULL;
entry.quark_string = NULL; entry.quark_string = NULL;
entry.help_page = lowercase_page; entry.help_id = help_page;
entry.description = NULL; entry.description = NULL;
if (item_factory) if (item_factory)
@ -246,7 +243,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
} }
} }
g_free (lowercase_page); g_free (help_page);
} }
void void
@ -413,7 +410,7 @@ plug_in_menu_tree_traverse_func (gpointer foo,
{ {
plug_in_menus_create_entry (item_factory, plug_in_menus_create_entry (item_factory,
menu_entry->proc_def, menu_entry->proc_def,
menu_entry->domain, menu_entry->locale_domain,
menu_entry->help_path); menu_entry->help_path);
return FALSE; return FALSE;

View file

@ -263,7 +263,7 @@ gimp_color_picker_tool_info_create (GimpTool *tool)
GIMP_STOCK_TOOL_COLOR_PICKER, GIMP_STOCK_TOOL_COLOR_PICKER,
_("Color Picker Information"), _("Color Picker Information"),
gimp_standard_help_func, gimp_standard_help_func,
tool->tool_info->help_data); tool->tool_info->help_id);
gimp_dialog_create_action_area (GIMP_DIALOG (info_dialog->shell), gimp_dialog_create_action_area (GIMP_DIALOG (info_dialog->shell),

View file

@ -988,7 +988,7 @@ crop_info_create (GimpCropTool *crop)
stock_id, stock_id,
_("Crop & Resize Information"), _("Crop & Resize Information"),
gimp_standard_help_func, gimp_standard_help_func,
tool->tool_info->help_data); tool->tool_info->help_id);
gimp_dialog_create_action_area (GIMP_DIALOG (crop->crop_info->shell), gimp_dialog_create_action_area (GIMP_DIALOG (crop->crop_info->shell),

View file

@ -1273,7 +1273,7 @@ file_dialog_create (GimpCurvesTool *c_tool)
g_free (temp); g_free (temp);
gimp_help_connect (c_tool->file_dialog, gimp_standard_help_func, gimp_help_connect (c_tool->file_dialog, gimp_standard_help_func,
GIMP_TOOL (c_tool)->tool_info->help_data); GIMP_TOOL (c_tool)->tool_info->help_id, NULL);
} }
static void static void

View file

@ -349,7 +349,7 @@ histogram_tool_dialog_new (GimpToolInfo *tool_info)
GIMP_OBJECT (tool_info)->name, GIMP_OBJECT (tool_info)->name,
stock_id, stock_id,
_("View Image Histogram"), _("View Image Histogram"),
gimp_standard_help_func, tool_info->help_data, gimp_standard_help_func, tool_info->help_id,
GTK_STOCK_CLOSE, histogram_tool_close_callback, GTK_STOCK_CLOSE, histogram_tool_close_callback,
htd, NULL, NULL, TRUE, TRUE, htd, NULL, NULL, TRUE, TRUE,

View file

@ -223,7 +223,7 @@ gimp_image_map_tool_initialize (GimpTool *tool,
stock_id, stock_id,
image_map_tool->shell_desc, image_map_tool->shell_desc,
gimp_standard_help_func, gimp_standard_help_func,
tool_info->help_data, tool_info->help_id,
GIMP_STOCK_RESET, GIMP_STOCK_RESET,
gimp_image_map_tool_reset_clicked, gimp_image_map_tool_reset_clicked,

View file

@ -1471,7 +1471,7 @@ file_dialog_create (GimpLevelsTool *l_tool)
g_free (temp); g_free (temp);
gimp_help_connect (l_tool->file_dialog, gimp_standard_help_func, gimp_help_connect (l_tool->file_dialog, gimp_standard_help_func,
GIMP_TOOL (l_tool)->tool_info->help_data); GIMP_TOOL (l_tool)->tool_info->help_id, NULL);
} }
static void static void

View file

@ -386,7 +386,7 @@ gimp_measure_tool_button_press (GimpTool *tool,
stock_id, stock_id,
_("Measure Distances and Angles"), _("Measure Distances and Angles"),
gimp_standard_help_func, gimp_standard_help_func,
tool->tool_info->help_data); tool->tool_info->help_id);
info_dialog_add_label (measure_tool_info, _("Distance:"), distance_buf); info_dialog_add_label (measure_tool_info, _("Distance:"), distance_buf);
info_dialog_add_label (measure_tool_info, _("Angle:"), angle_buf); info_dialog_add_label (measure_tool_info, _("Angle:"), angle_buf);

View file

@ -1239,7 +1239,7 @@ gimp_transform_tool_dialog (GimpTransformTool *tr_tool)
GIMP_OBJECT (tool_info)->name, GIMP_OBJECT (tool_info)->name,
stock_id, stock_id,
tr_tool->shell_desc, tr_tool->shell_desc,
gimp_standard_help_func, tool_info->help_data); gimp_standard_help_func, tool_info->help_id);
gimp_dialog_create_action_area (GIMP_DIALOG (tr_tool->info_dialog->shell), gimp_dialog_create_action_area (GIMP_DIALOG (tr_tool->info_dialog->shell),

View file

@ -95,7 +95,8 @@ static ColorNotebook *
gboolean wants_updates, gboolean wants_updates,
gboolean show_alpha); gboolean show_alpha);
static void color_notebook_help_func (const gchar *help_data); static void color_notebook_help_func (const gchar *help_id,
gpointer help_data);
static void color_notebook_ok_callback (GtkWidget *widget, static void color_notebook_ok_callback (GtkWidget *widget,
ColorNotebook *cnp); ColorNotebook *cnp);
@ -322,22 +323,22 @@ color_notebook_new_internal (GimpViewable *viewable,
cnp->shell = gimp_viewable_dialog_new (viewable, cnp->shell = gimp_viewable_dialog_new (viewable,
title, wmclass_name, title, wmclass_name,
stock_id, desc, stock_id, desc,
color_notebook_help_func, color_notebook_help_func, NULL,
(const gchar *) cnp,
NULL); NULL);
gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE); gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE);
} }
else else
{ {
cnp->shell = gimp_dialog_new (title, wmclass_name, cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func, color_notebook_help_func, NULL,
(const gchar *) cnp, GTK_WIN_POS_NONE,
GTK_WIN_POS_NONE, FALSE, TRUE, TRUE,
FALSE, TRUE, TRUE, NULL);
NULL);
} }
g_object_set_data (G_OBJECT (cnp->shell), "color-notebook", cnp);
gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell), gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell),
GTK_STOCK_CANCEL, GTK_STOCK_CANCEL,
@ -535,21 +536,19 @@ color_notebook_new_internal (GimpViewable *viewable,
} }
static void static void
color_notebook_help_func (const gchar *data) color_notebook_help_func (const gchar *help_id,
gpointer help_data)
{ {
ColorNotebook *cnp; ColorNotebook *cnp;
GimpColorNotebook *notebook; GimpColorNotebook *notebook;
gchar *help_path;
cnp = (ColorNotebook *) data; cnp = g_object_get_data (G_OBJECT (help_data), "color-notebook");
notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook); notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook);
help_path = g_strconcat ("dialogs/color_selectors/", help_id = GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page;
GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page,
NULL); gimp_standard_help_func (help_id, NULL);
gimp_standard_help_func (help_path);
g_free (help_path);
} }
static void static void

View file

@ -370,7 +370,7 @@ gimp_error_console_save_ext_clicked (GtkWidget *button,
console); console);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func, gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
GIMP_HELP_ERROR_DIALOG); GIMP_HELP_ERROR_DIALOG, NULL);
gtk_widget_show (GTK_WIDGET (filesel)); gtk_widget_show (GTK_WIDGET (filesel));
} }

View file

@ -23,6 +23,8 @@
#define __GIMP_HELP_IDS_H__ #define __GIMP_HELP_IDS_H__
#define GIMP_HELP_MAIN "index.html"
#define GIMP_HELP_FILE_NEW "dialogs/file_new.html" #define GIMP_HELP_FILE_NEW "dialogs/file_new.html"
#define GIMP_HELP_FILE_NEW_CONFIRM "dialogs/file_new.html#confirm_dialog" #define GIMP_HELP_FILE_NEW_CONFIRM "dialogs/file_new.html#confirm_dialog"
#define GIMP_HELP_FILE_OPEN "dialogs/file_open.html" #define GIMP_HELP_FILE_OPEN "dialogs/file_open.html"

View file

@ -43,6 +43,7 @@
#include "plug-in/plug-in-run.h" #include "plug-in/plug-in-run.h"
#include "gimphelp.h" #include "gimphelp.h"
#include "gimphelp-ids.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -58,7 +59,7 @@ struct _GimpIdleHelp
Gimp *gimp; Gimp *gimp;
gchar *help_path; gchar *help_path;
gchar *help_locale; gchar *help_locale;
gchar *help_data; gchar *help_id;
}; };
@ -68,11 +69,11 @@ static gint gimp_idle_help (gpointer data);
static gboolean gimp_help_internal (Gimp *gimp, static gboolean gimp_help_internal (Gimp *gimp,
const gchar *help_path, const gchar *help_path,
const gchar *current_locale, const gchar *current_locale,
const gchar *help_data); const gchar *help_id);
static void gimp_help_netscape (Gimp *gimp, static void gimp_help_netscape (Gimp *gimp,
const gchar *help_path, const gchar *help_path,
const gchar *current_locale, const gchar *current_locale,
const gchar *help_data); const gchar *help_id);
/* public functions */ /* public functions */
@ -80,7 +81,7 @@ static void gimp_help_netscape (Gimp *gimp,
void void
gimp_help (Gimp *gimp, gimp_help (Gimp *gimp,
const gchar *help_path, const gchar *help_path,
const gchar *help_data) const gchar *help_id)
{ {
g_return_if_fail (GIMP_IS_GIMP (gimp)); g_return_if_fail (GIMP_IS_GIMP (gimp));
@ -97,8 +98,8 @@ gimp_help (Gimp *gimp,
idle_help->help_locale = g_strdup ("C"); idle_help->help_locale = g_strdup ("C");
if (help_data && strlen (help_data)) if (help_id && strlen (help_id))
idle_help->help_data = g_strdup (help_data); idle_help->help_id = g_strdup (help_id);
g_idle_add (gimp_idle_help, idle_help); g_idle_add (gimp_idle_help, idle_help);
} }
@ -123,10 +124,10 @@ gimp_idle_help (gpointer data)
else else
g_print ("Help Path: NULL\n"); g_print ("Help Path: NULL\n");
if (idle_help->help_data) if (idle_help->help_id)
g_print ("Help Page: %s\n", idle_help->help_data); g_print ("Help ID: %s\n", idle_help->help_id);
else else
g_print ("Help Page: NULL\n"); g_print ("Help ID: NULL\n");
g_print ("\n"); g_print ("\n");
#endif /* DEBUG_HELP */ #endif /* DEBUG_HELP */
@ -137,14 +138,14 @@ gimp_idle_help (gpointer data)
if (gimp_help_internal (idle_help->gimp, if (gimp_help_internal (idle_help->gimp,
idle_help->help_path, idle_help->help_path,
idle_help->help_locale, idle_help->help_locale,
idle_help->help_data)) idle_help->help_id))
break; break;
case GIMP_HELP_BROWSER_NETSCAPE: case GIMP_HELP_BROWSER_NETSCAPE:
gimp_help_netscape (idle_help->gimp, gimp_help_netscape (idle_help->gimp,
idle_help->help_path, idle_help->help_path,
idle_help->help_locale, idle_help->help_locale,
idle_help->help_data); idle_help->help_id);
break; break;
default: default:
@ -153,7 +154,7 @@ gimp_idle_help (gpointer data)
g_free (idle_help->help_path); g_free (idle_help->help_path);
g_free (idle_help->help_locale); g_free (idle_help->help_locale);
g_free (idle_help->help_data); g_free (idle_help->help_id);
g_free (idle_help); g_free (idle_help);
return FALSE; return FALSE;
@ -178,7 +179,7 @@ static gboolean
gimp_help_internal (Gimp *gimp, gimp_help_internal (Gimp *gimp,
const gchar *help_path, const gchar *help_path,
const gchar *current_locale, const gchar *current_locale,
const gchar *help_data) const gchar *help_id)
{ {
ProcRecord *proc_rec; ProcRecord *proc_rec;
@ -228,7 +229,7 @@ gimp_help_internal (Gimp *gimp,
args[2].arg_type = GIMP_PDB_STRING; args[2].arg_type = GIMP_PDB_STRING;
args[2].value.pdb_pointer = (gpointer) current_locale; args[2].value.pdb_pointer = (gpointer) current_locale;
args[3].arg_type = GIMP_PDB_STRING; args[3].arg_type = GIMP_PDB_STRING;
args[3].value.pdb_pointer = (gpointer) help_data; args[3].value.pdb_pointer = (gpointer) help_id;
plug_in_run (gimp, proc_rec, args, 4, FALSE, TRUE, -1); plug_in_run (gimp, proc_rec, args, 4, FALSE, TRUE, -1);
@ -245,7 +246,7 @@ gimp_help_internal (Gimp *gimp,
&nreturn_vals, &nreturn_vals,
GIMP_PDB_STRING, help_path, GIMP_PDB_STRING, help_path,
GIMP_PDB_STRING, current_locale, GIMP_PDB_STRING, current_locale,
GIMP_PDB_STRING, help_data, GIMP_PDB_STRING, help_id,
GIMP_PDB_END); GIMP_PDB_END);
procedural_db_destroy_args (return_vals, nreturn_vals); procedural_db_destroy_args (return_vals, nreturn_vals);
@ -260,18 +261,18 @@ static void
gimp_help_netscape (Gimp *gimp, gimp_help_netscape (Gimp *gimp,
const gchar *help_path, const gchar *help_path,
const gchar *current_locale, const gchar *current_locale,
const gchar *help_data) const gchar *help_id)
{ {
Argument *return_vals; Argument *return_vals;
gint nreturn_vals; gint nreturn_vals;
gchar *url; gchar *url;
if (!help_data) if (! help_id)
help_data = "introduction.html"; help_id = GIMP_HELP_MAIN;
if (help_data[0] == '/') /* _not_ g_path_is_absolute() */ if (help_id[0] == '/') /* _not_ g_path_is_absolute() */
{ {
url = g_strconcat ("file:", help_data, NULL); url = g_strconcat ("file:", help_id, NULL);
} }
else else
{ {
@ -281,7 +282,7 @@ gimp_help_netscape (Gimp *gimp,
gimp_data_directory (), gimp_data_directory (),
"/help/", "/help/",
current_locale, "/", current_locale, "/",
help_data, help_id,
NULL); NULL);
} }
else else
@ -289,7 +290,7 @@ gimp_help_netscape (Gimp *gimp,
url = g_strconcat ("file:", url = g_strconcat ("file:",
help_path, "/", help_path, "/",
current_locale, "/", current_locale, "/",
help_data, help_id,
NULL); NULL);
} }
} }

View file

@ -29,7 +29,7 @@
*/ */
void gimp_help (Gimp *gimp, void gimp_help (Gimp *gimp,
const gchar *help_path, const gchar *help_path,
const gchar *help_data); const gchar *help_id);
#endif /* __GIMP_HELP_H__ */ #endif /* __GIMP_HELP_H__ */

View file

@ -156,7 +156,6 @@ GimpItemFactory *
gimp_item_factory_new (Gimp *gimp, gimp_item_factory_new (Gimp *gimp,
GType container_type, GType container_type,
const gchar *factory_path, const gchar *factory_path,
const gchar *help_path,
GimpItemFactoryUpdateFunc update_func, GimpItemFactoryUpdateFunc update_func,
gboolean update_on_popup, gboolean update_on_popup,
guint n_entries, guint n_entries,
@ -170,7 +169,6 @@ gimp_item_factory_new (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (factory_path != NULL, NULL); g_return_val_if_fail (factory_path != NULL, NULL);
g_return_val_if_fail (help_path != NULL, NULL);
g_return_val_if_fail (factory_path[0] == '<', NULL); g_return_val_if_fail (factory_path[0] == '<', NULL);
g_return_val_if_fail (factory_path[strlen (factory_path) - 1] == '>', NULL); g_return_val_if_fail (factory_path[strlen (factory_path) - 1] == '>', NULL);
@ -200,11 +198,6 @@ gimp_item_factory_new (Gimp *gimp,
g_strdup (factory_path), g_strdup (factory_path),
list); list);
/* this will go away <mitch> */
g_object_set_data_full (G_OBJECT (factory), "help_path",
g_strdup (help_path),
(GDestroyNotify) g_free);
gimp_item_factory_create_items (factory, gimp_item_factory_create_items (factory,
n_entries, n_entries,
entries, entries,
@ -326,14 +319,14 @@ gimp_item_factory_create_item (GimpItemFactory *item_factory,
G_CALLBACK (gimp_item_factory_item_realize), G_CALLBACK (gimp_item_factory_item_realize),
item_factory); item_factory);
if (entry->help_page) if (entry->help_id)
{ {
if (static_entry) if (static_entry)
g_object_set_data (G_OBJECT (menu_item), "help_page", g_object_set_data (G_OBJECT (menu_item), "gimp-help-id",
(gpointer) entry->help_page); (gpointer) entry->help_id);
else else
g_object_set_data_full (G_OBJECT (menu_item), "help_page", g_object_set_data_full (G_OBJECT (menu_item), "gimp-help-id",
g_strdup (entry->help_page), g_strdup (entry->help_id),
g_free); g_free);
} }
} }
@ -881,9 +874,7 @@ gimp_item_factory_item_key_press (GtkWidget *widget,
GimpItemFactory *item_factory) GimpItemFactory *item_factory)
{ {
GtkWidget *active_menu_item; GtkWidget *active_menu_item;
gchar *factory_help_path = NULL; gchar *help_id = NULL;
gchar *help_path = NULL;
gchar *help_page = NULL;
active_menu_item = GTK_MENU_SHELL (widget)->active_menu_item; active_menu_item = GTK_MENU_SHELL (widget)->active_menu_item;
@ -891,10 +882,10 @@ gimp_item_factory_item_key_press (GtkWidget *widget,
*/ */
if (active_menu_item) if (active_menu_item)
{ {
help_page = g_object_get_data (G_OBJECT (active_menu_item), "help_page"); help_id = g_object_get_data (G_OBJECT (active_menu_item), "gimp-help-id");
if (help_page && ! *help_page) if (help_id && ! strlen (help_id))
help_page = NULL; help_id = NULL;
} }
/* For any valid accelerator key except F1, continue with the /* For any valid accelerator key except F1, continue with the
@ -903,55 +894,49 @@ gimp_item_factory_item_key_press (GtkWidget *widget,
*/ */
if (kevent->keyval != GDK_F1) if (kevent->keyval != GDK_F1)
{ {
if (help_page && if (help_id &&
gtk_accelerator_valid (kevent->keyval, 0) && gtk_accelerator_valid (kevent->keyval, 0) &&
(strcmp (help_page, GIMP_HELP_HELP) == 0 || (strcmp (help_id, GIMP_HELP_HELP) == 0 ||
strcmp (help_page, GIMP_HELP_HELP_CONTEXT) == 0)) strcmp (help_id, GIMP_HELP_HELP_CONTEXT) == 0))
{ {
return TRUE; return TRUE;
} }
else
{ return FALSE;
return FALSE;
}
} }
/* ...finally, if F1 was pressed over any menu, show it's help page... */ /* ...finally, if F1 was pressed over any menu, show it's help page... */
factory_help_path = g_object_get_data (G_OBJECT (item_factory), "help_path"); if (! help_id)
help_id = GIMP_HELP_MAIN;
if (! help_page) {
help_page = "index.html"; gchar *help_path = NULL;
gchar *help_string = NULL;
gchar *path_separator;
if (factory_help_path && help_page) help_id = g_strdup (help_id);
{
gchar *help_string;
gchar *at;
help_page = g_strdup (help_page); path_separator = strchr (help_id, ':');
at = strchr (help_page, '@'); /* HACK: locale subdir */ if (path_separator)
{
*path_separator = '\0';
if (at) help_path = g_strdup (help_id);
{ help_string = g_strdup (path_separator + 1);
*at = '\0'; }
help_path = g_strdup (help_page); else
help_string = g_strdup (at + 1); {
} help_string = g_strdup (help_id);
else }
{
help_string = g_strdup_printf ("%s/%s", factory_help_path, help_page);
}
gimp_help (item_factory->gimp, help_path, help_string); gimp_help (item_factory->gimp, help_path, help_string);
g_free (help_string); g_free (help_path);
g_free (help_page); g_free (help_string);
} g_free (help_id);
else }
{
gimp_standard_help_func (NULL);
}
return TRUE; return TRUE;
} }

View file

@ -28,7 +28,7 @@ struct _GimpItemFactoryEntry
const gchar *quark_string; const gchar *quark_string;
const gchar *help_page; const gchar *help_id;
const gchar *description; const gchar *description;
}; };
@ -65,7 +65,6 @@ GType gimp_item_factory_get_type (void) G_GNUC_CONST;
GimpItemFactory * gimp_item_factory_new (Gimp *gimp, GimpItemFactory * gimp_item_factory_new (Gimp *gimp,
GType container_type, GType container_type,
const gchar *factory_path, const gchar *factory_path,
const gchar *help_path,
GimpItemFactoryUpdateFunc update_func, GimpItemFactoryUpdateFunc update_func,
gboolean update_on_popup, gboolean update_on_popup,
guint n_entries, guint n_entries,

View file

@ -106,7 +106,6 @@ gimp_menu_factory_finalize (GObject *object)
entry = (GimpMenuFactoryEntry *) list->data; entry = (GimpMenuFactoryEntry *) list->data;
g_free (entry->identifier); g_free (entry->identifier);
g_free (entry->help_path);
g_free (entry); g_free (entry);
} }
@ -133,7 +132,6 @@ gimp_menu_factory_new (Gimp *gimp)
void void
gimp_menu_factory_menu_register (GimpMenuFactory *factory, gimp_menu_factory_menu_register (GimpMenuFactory *factory,
const gchar *identifier, const gchar *identifier,
const gchar *help_path,
GimpItemFactorySetupFunc setup_func, GimpItemFactorySetupFunc setup_func,
GimpItemFactoryUpdateFunc update_func, GimpItemFactoryUpdateFunc update_func,
gboolean update_on_popup, gboolean update_on_popup,
@ -144,14 +142,12 @@ gimp_menu_factory_menu_register (GimpMenuFactory *factory,
g_return_if_fail (GIMP_IS_MENU_FACTORY (factory)); g_return_if_fail (GIMP_IS_MENU_FACTORY (factory));
g_return_if_fail (identifier != NULL); g_return_if_fail (identifier != NULL);
g_return_if_fail (help_path != NULL);
g_return_if_fail (n_entries > 0); g_return_if_fail (n_entries > 0);
g_return_if_fail (entries != NULL); g_return_if_fail (entries != NULL);
entry = g_new0 (GimpMenuFactoryEntry, 1); entry = g_new0 (GimpMenuFactoryEntry, 1);
entry->identifier = g_strdup (identifier); entry->identifier = g_strdup (identifier);
entry->help_path = g_strdup (help_path);
entry->setup_func = setup_func; entry->setup_func = setup_func;
entry->update_func = update_func; entry->update_func = update_func;
entry->update_on_popup = update_on_popup ? TRUE : FALSE; entry->update_on_popup = update_on_popup ? TRUE : FALSE;
@ -184,7 +180,6 @@ gimp_menu_factory_menu_new (GimpMenuFactory *factory,
item_factory = gimp_item_factory_new (factory->gimp, item_factory = gimp_item_factory_new (factory->gimp,
container_type, container_type,
entry->identifier, entry->identifier,
entry->help_path,
entry->update_func, entry->update_func,
entry->update_on_popup, entry->update_on_popup,
entry->n_entries, entry->n_entries,

View file

@ -31,7 +31,6 @@ typedef struct _GimpMenuFactoryEntry GimpMenuFactoryEntry;
struct _GimpMenuFactoryEntry struct _GimpMenuFactoryEntry
{ {
gchar *identifier; gchar *identifier;
gchar *help_path;
GimpItemFactorySetupFunc setup_func; GimpItemFactorySetupFunc setup_func;
GimpItemFactoryUpdateFunc update_func; GimpItemFactoryUpdateFunc update_func;
gboolean update_on_popup; gboolean update_on_popup;
@ -70,7 +69,6 @@ GimpMenuFactory * gimp_menu_factory_new (Gimp *gimp);
void gimp_menu_factory_menu_register (GimpMenuFactory *factory, void gimp_menu_factory_menu_register (GimpMenuFactory *factory,
const gchar *identifier, const gchar *identifier,
const gchar *help_path,
GimpItemFactorySetupFunc setup_func, GimpItemFactorySetupFunc setup_func,
GimpItemFactoryUpdateFunc update_func, GimpItemFactoryUpdateFunc update_func,
gboolean update_on_popup, gboolean update_on_popup,

View file

@ -172,8 +172,8 @@ gimp_text_editor_new (const gchar *title,
NULL); NULL);
gtk_window_set_wmclass (GTK_WINDOW (editor), "text_editor", "Gimp"); gtk_window_set_wmclass (GTK_WINDOW (editor), "text_editor", "Gimp");
gimp_help_connect (GTK_WIDGET (editor), gimp_help_connect (GTK_WIDGET (editor), gimp_standard_help_func,
gimp_standard_help_func, "dialogs/text_editor.html"); "dialogs/text_editor.html", NULL);
gimp_dialog_create_action_area (GIMP_DIALOG (editor), gimp_dialog_create_action_area (GIMP_DIALOG (editor),
GTK_STOCK_CLOSE, gtk_widget_destroy, GTK_STOCK_CLOSE, gtk_widget_destroy,

View file

@ -190,7 +190,7 @@ gimp_toolbox_init (GimpToolbox *toolbox)
GTK_ITEM_FACTORY (toolbox_factory)->accel_group); GTK_ITEM_FACTORY (toolbox_factory)->accel_group);
gimp_help_connect (GTK_WIDGET (toolbox), gimp_standard_help_func, gimp_help_connect (GTK_WIDGET (toolbox), gimp_standard_help_func,
GIMP_HELP_TOOLBOX); GIMP_HELP_TOOLBOX, NULL);
toolbox->wbox = gtk_hwrap_box_new (FALSE); toolbox->wbox = gtk_hwrap_box_new (FALSE);
gtk_wrap_box_set_justify (GTK_WRAP_BOX (toolbox->wbox), GTK_JUSTIFY_TOP); gtk_wrap_box_set_justify (GTK_WRAP_BOX (toolbox->wbox), GTK_JUSTIFY_TOP);
@ -595,9 +595,7 @@ gimp_toolbox_button_accel_changed (GtkAccelGroup *accel_group,
tooltip = g_strdup (tool_info->help); tooltip = g_strdup (tool_info->help);
} }
gimp_help_set_help_data (tool_button, gimp_help_set_help_data (tool_button, tooltip, tool_info->help_id);
tooltip,
tool_info->help_data);
g_free (tooltip); g_free (tooltip);
} }

View file

@ -158,7 +158,7 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
const gchar *stock_id, const gchar *stock_id,
const gchar *desc, const gchar *desc,
GimpHelpFunc help_func, GimpHelpFunc help_func,
const gchar *help_data, const gchar *help_id,
/* specify action area buttons /* specify action area buttons
* as va_list: * as va_list:
@ -189,16 +189,15 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
gtk_window_set_wmclass (GTK_WINDOW (dialog), wmclass_name, "Gimp"); gtk_window_set_wmclass (GTK_WINDOW (dialog), wmclass_name, "Gimp");
if (help_func) if (help_func)
gimp_help_connect (GTK_WIDGET (dialog), help_func, help_data); gimp_help_connect (GTK_WIDGET (dialog), help_func, help_id, dialog);
va_start (args, help_data); va_start (args, help_id);
gimp_dialog_create_action_areav (GIMP_DIALOG (dialog), args); gimp_dialog_create_action_areav (GIMP_DIALOG (dialog), args);
va_end (args); va_end (args);
gtk_image_set_from_stock (GTK_IMAGE (dialog->icon), stock_id, gtk_image_set_from_stock (GTK_IMAGE (dialog->icon), stock_id,
GTK_ICON_SIZE_LARGE_TOOLBAR); GTK_ICON_SIZE_LARGE_TOOLBAR);
attrs = pango_attr_list_new (); attrs = pango_attr_list_new ();
attr = pango_attr_scale_new (PANGO_SCALE_LARGE); attr = pango_attr_scale_new (PANGO_SCALE_LARGE);

View file

@ -61,7 +61,7 @@ GtkWidget * gimp_viewable_dialog_new (GimpViewable *viewable,
const gchar *stock_id, const gchar *stock_id,
const gchar *desc, const gchar *desc,
GimpHelpFunc help_func, GimpHelpFunc help_func,
const gchar *help_data, const gchar *help_id,
/* specify action area buttons /* specify action area buttons
* as va_list: * as va_list:

View file

@ -28,7 +28,8 @@
/* local function prototypes */ /* local function prototypes */
static void gimp_ui_help_func (const gchar *help_data); static void gimp_ui_help_func (const gchar *help_id,
gpointer help_data);
/* public functions */ /* public functions */
@ -115,7 +116,8 @@ gimp_ui_init (const gchar *prog_name,
/* private functions */ /* private functions */
static void static void
gimp_ui_help_func (const gchar *help_data) gimp_ui_help_func (const gchar *help_id,
gpointer help_data)
{ {
gimp_help (gimp_get_progname (), (gchar *) help_data); gimp_help (gimp_get_progname (), help_id);
} }

View file

@ -136,7 +136,7 @@ gimp_dialog_close (GtkDialog *dialog)
* gtk_window_set_wmclass(). The @wmclass_class will be * gtk_window_set_wmclass(). The @wmclass_class will be
* automatically set to "Gimp". * automatically set to "Gimp".
* @help_func: The function which will be called if the user presses "F1". * @help_func: The function which will be called if the user presses "F1".
* @help_data: The data pointer which will be passed to @help_func. * @help_id: The help_id which will be passed to @help_func.
* @position: The dialog's initial position which will be set with * @position: The dialog's initial position which will be set with
* gtk_window_set_position(). * gtk_window_set_position().
* @allow_shrink: The dialog's @allow_shrink flag, ... * @allow_shrink: The dialog's @allow_shrink flag, ...
@ -158,7 +158,7 @@ GtkWidget *
gimp_dialog_new (const gchar *title, gimp_dialog_new (const gchar *title,
const gchar *wmclass_name, const gchar *wmclass_name,
GimpHelpFunc help_func, GimpHelpFunc help_func,
const gchar *help_data, const gchar *help_id,
GtkWindowPosition position, GtkWindowPosition position,
gint allow_shrink, gint allow_shrink,
gint allow_grow, gint allow_grow,
@ -184,7 +184,7 @@ gimp_dialog_new (const gchar *title,
dialog = gimp_dialog_newv (title, dialog = gimp_dialog_newv (title,
wmclass_name, wmclass_name,
help_func, help_func,
help_data, help_id,
position, position,
allow_shrink, allow_shrink,
allow_grow, allow_grow,
@ -204,7 +204,7 @@ gimp_dialog_new (const gchar *title,
* gtk_window_set_wmclass(). The @wmclass_class will be * gtk_window_set_wmclass(). The @wmclass_class will be
* automatically set to "Gimp". * automatically set to "Gimp".
* @help_func: The function which will be called if the user presses "F1". * @help_func: The function which will be called if the user presses "F1".
* @help_data: The data pointer which will be passed to @help_func. * @help_id: The help_id which will be passed to @help_func.
* @position: The dialog's initial position which will be set with * @position: The dialog's initial position which will be set with
* gtk_window_set_position(). * gtk_window_set_position().
* @allow_shrink: The dialog's @allow_shrink flag, ... * @allow_shrink: The dialog's @allow_shrink flag, ...
@ -226,7 +226,7 @@ GtkWidget *
gimp_dialog_newv (const gchar *title, gimp_dialog_newv (const gchar *title,
const gchar *wmclass_name, const gchar *wmclass_name,
GimpHelpFunc help_func, GimpHelpFunc help_func,
const gchar *help_data, const gchar *help_id,
GtkWindowPosition position, GtkWindowPosition position,
gint allow_shrink, gint allow_shrink,
gint allow_grow, gint allow_grow,
@ -256,7 +256,7 @@ gimp_dialog_newv (const gchar *title,
/* connect the "F1" help key */ /* connect the "F1" help key */
if (help_func) if (help_func)
gimp_help_connect (dialog, help_func, help_data); gimp_help_connect (dialog, help_func, help_id, dialog);
return dialog; return dialog;
} }

View file

@ -56,7 +56,7 @@ GType gimp_dialog_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_dialog_new (const gchar *title, GtkWidget * gimp_dialog_new (const gchar *title,
const gchar *wmclass_name, const gchar *wmclass_name,
GimpHelpFunc help_func, GimpHelpFunc help_func,
const gchar *help_data, const gchar *help_id,
GtkWindowPosition position, GtkWindowPosition position,
gint allow_shrink, gint allow_shrink,
gint allow_grow, gint allow_grow,
@ -78,7 +78,7 @@ GtkWidget * gimp_dialog_new (const gchar *title,
GtkWidget * gimp_dialog_newv (const gchar *title, GtkWidget * gimp_dialog_newv (const gchar *title,
const gchar *wmclass_name, const gchar *wmclass_name,
GimpHelpFunc help_func, GimpHelpFunc help_func,
const gchar *help_data, const gchar *help_id,
GtkWindowPosition position, GtkWindowPosition position,
gint allow_shrink, gint allow_shrink,
gint allow_grow, gint allow_grow,

View file

@ -22,9 +22,8 @@
#include "config.h" #include "config.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#ifdef __GNUC__ #ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED #warning GTK_DISABLE_DEPRECATED
@ -51,7 +50,8 @@ typedef enum
/* local function prototypes */ /* local function prototypes */
static const gchar * gimp_help_get_help_data (GtkWidget *widget, static const gchar * gimp_help_get_help_data (GtkWidget *widget,
GtkWidget **help_widget); GtkWidget **help_widget,
gpointer *ret_data);
static gboolean gimp_help_callback (GtkWidget *widget, static gboolean gimp_help_callback (GtkWidget *widget,
GtkWidgetHelpType help_type, GtkWidgetHelpType help_type,
GimpHelpFunc help_func); GimpHelpFunc help_func);
@ -122,7 +122,8 @@ gimp_help_disable_tooltips (void)
} }
void void
gimp_standard_help_func (const gchar *help_data) gimp_standard_help_func (const gchar *help_id,
gpointer data)
{ {
if (! _gimp_standard_help_func) if (! _gimp_standard_help_func)
{ {
@ -131,7 +132,7 @@ gimp_standard_help_func (const gchar *help_data)
return; return;
} }
(* _gimp_standard_help_func) (help_data); (* _gimp_standard_help_func) (help_id, data);
} }
/** /**
@ -139,7 +140,8 @@ gimp_standard_help_func (const gchar *help_data)
* @widget: The widget you want to connect the help accelerator for. Will * @widget: The widget you want to connect the help accelerator for. Will
* be a #GtkWindow in most cases. * be a #GtkWindow in most cases.
* @help_func: The function which will be called if the user presses "F1". * @help_func: The function which will be called if the user presses "F1".
* @help_data: The data pointer which will be passed to @help_func. * @help_id: The help_id which will be passed to @help_func.
* @help_data: The help_data pointer which will be passed to @help_func.
* *
* Note that this function is automatically called by all libgimp dialog * Note that this function is automatically called by all libgimp dialog
* constructors. You only have to call it for windows/dialogs you created * constructors. You only have to call it for windows/dialogs you created
@ -148,7 +150,8 @@ gimp_standard_help_func (const gchar *help_data)
void void
gimp_help_connect (GtkWidget *widget, gimp_help_connect (GtkWidget *widget,
GimpHelpFunc help_func, GimpHelpFunc help_func,
const gchar *help_data) const gchar *help_id,
gpointer help_data)
{ {
g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (help_func != NULL); g_return_if_fail (help_func != NULL);
@ -189,7 +192,9 @@ gimp_help_connect (GtkWidget *widget,
gtk_widget_realize (tips_query); gtk_widget_realize (tips_query);
} }
gimp_help_set_help_data (widget, NULL, help_data); gimp_help_set_help_data (widget, NULL, help_id);
g_object_set_data (G_OBJECT (widget), "gimp-help-data", help_data);
g_signal_connect (widget, "show_help", g_signal_connect (widget, "show_help",
G_CALLBACK (gimp_help_callback), G_CALLBACK (gimp_help_callback),
@ -200,45 +205,29 @@ gimp_help_connect (GtkWidget *widget,
/** /**
* gimp_help_set_help_data: * gimp_help_set_help_data:
* @widget: The #GtkWidget you want to set a @tooltip and/or @help_data for. * @widget: The #GtkWidget you want to set a @tooltip and/or @help_data for.
* @tooltip: The text for this widget's tooltip (or %NULL). * @tooltip: The text for this widget's tooltip (or %NULL).
* @help_data: The @help_data for the #GtkTipsQuery tooltips inspector. * @help_id: The @help_id for the #GtkTipsQuery tooltips inspector.
* *
* The reason why we don't use gtk_tooltips_set_tip() is that it's * The reason why we don't use gtk_tooltips_set_tip() is that it's
* impossible to set a @private_tip (aka @help_data) without a visible * impossible to set a @private_tip (aka @help_id) without a visible
* @tooltip. * @tooltip.
* *
* This function can be called with %NULL for @tooltip. Use this feature * This function can be called with %NULL for @tooltip. Use this feature
* if you want to set a HTML help link for a widget which shouldn't have * if you want to set a help link for a widget which shouldn't have
* a visible tooltip. * a visible tooltip.
*
* You can e.g. set a @help_data string to a complete HTML page for a
* container widget (e.g. a #GtkBox). For the widgets inside the box
* you can set HTML anchors which point inside the container widget's
* help page by setting @help_data strings starting with "#".
*
* If the tooltips inspector (Shift + "F1") is invoked and the user
* clicks on one of the widgets which only contain a "#" link, the
* help system will automatically ascend the widget hierarchy until it
* finds another widget with @help_data attached and concatenates both
* to a complete help path.
**/ **/
void void
gimp_help_set_help_data (GtkWidget *widget, gimp_help_set_help_data (GtkWidget *widget,
const gchar *tooltip, const gchar *tooltip,
const gchar *help_data) const gchar *help_id)
{ {
g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_WIDGET (widget));
if (tooltip) if (tooltip)
{ gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_id);
gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_data); else
} g_object_set_data (G_OBJECT (widget), "gimp-help-id", (gpointer) help_id);
else if (help_data)
{
g_object_set_data (G_OBJECT (widget), "gimp_help_data",
(gpointer) help_data);
}
} }
/** /**
@ -249,10 +238,10 @@ gimp_help_set_help_data (GtkWidget *widget,
* The mouse cursor will turn turn into a question mark and the user can * The mouse cursor will turn turn into a question mark and the user can
* click on any widget of the application which started the inspector. * click on any widget of the application which started the inspector.
* *
* If the widget the user clicked on has a @help_data string attached * If the widget the user clicked on has a @help_id string attached
* (see gimp_help_set_help_data()), the corresponding HTML page will * (see gimp_help_set_help_data()), the corresponding help page will
* be displayed. Otherwise the help system will ascend the widget hierarchy * be displayed. Otherwise the help system will ascend the widget hierarchy
* until it finds an attached @help_data string (which should be the * until it finds an attached @help_id string (which should be the
* case at least for every window/dialog). * case at least for every window/dialog).
**/ **/
void void
@ -267,29 +256,36 @@ gimp_context_help (void)
static const gchar * static const gchar *
gimp_help_get_help_data (GtkWidget *widget, gimp_help_get_help_data (GtkWidget *widget,
GtkWidget **help_widget) GtkWidget **help_widget,
gpointer *ret_data)
{ {
GtkTooltipsData *tooltips_data; GtkTooltipsData *tooltips_data;
gchar *help_data = NULL; gchar *help_id = NULL;
gpointer help_data = NULL;
for (; widget; widget = widget->parent) for (; widget; widget = widget->parent)
{ {
if ((tooltips_data = gtk_tooltips_data_get (widget)) && if ((tooltips_data = gtk_tooltips_data_get (widget)) &&
tooltips_data->tip_private) tooltips_data->tip_private)
{ {
help_data = tooltips_data->tip_private; help_id = tooltips_data->tip_private;
} }
else else
{ {
help_data = g_object_get_data (G_OBJECT (widget), "gimp_help_data"); help_id = g_object_get_data (G_OBJECT (widget), "gimp-help-id");
} }
if (help_data) help_data = g_object_get_data (G_OBJECT (widget), "gimp-help-data");
if (help_id)
{ {
if (help_widget) if (help_widget)
*help_widget = widget; *help_widget = widget;
return (const gchar *) help_data; if (ret_data)
*ret_data = help_data;
return (const gchar *) help_id;
} }
} }
@ -306,11 +302,23 @@ gimp_help_callback (GtkWidget *widget,
case GIMP_WIDGET_HELP_TYPE_HELP: case GIMP_WIDGET_HELP_TYPE_HELP:
if (help_func) if (help_func)
{ {
gchar *help_data; GtkTooltipsData *tooltips_data;
gchar *help_id = NULL;
gpointer help_data = NULL;
help_data = g_object_get_data (G_OBJECT (widget), "gimp_help_data"); if ((tooltips_data = gtk_tooltips_data_get (widget)) &&
tooltips_data->tip_private)
{
help_id = tooltips_data->tip_private;
}
else
{
help_id = g_object_get_data (G_OBJECT (widget), "gimp-help-id");
}
(* help_func) (help_data); help_data = g_object_get_data (G_OBJECT (widget), "gimp-help-data");
(* help_func) (help_id, help_data);
} }
return TRUE; return TRUE;
@ -337,33 +345,14 @@ static gboolean
gimp_help_tips_query_idle_show_help (gpointer data) gimp_help_tips_query_idle_show_help (gpointer data)
{ {
GtkWidget *help_widget; GtkWidget *help_widget;
const gchar *help_data = NULL; const gchar *help_id = NULL;
gpointer help_data = NULL;
help_data = gimp_help_get_help_data (GTK_WIDGET (data), &help_widget); help_id = gimp_help_get_help_data (GTK_WIDGET (data), &help_widget,
&help_data);
if (help_data) if (help_id)
{ gimp_standard_help_func (help_id, help_data);
if (help_data[0] == '#')
{
const gchar *help_index;
help_index = help_data;
help_data = gimp_help_get_help_data (help_widget->parent, NULL);
if (help_data)
{
gchar *help_text;
help_text = g_strconcat (help_data, help_index, NULL);
gimp_standard_help_func (help_text);
g_free (help_text);
}
}
else
{
gimp_standard_help_func (help_data);
}
}
return FALSE; return FALSE;
} }

View file

@ -35,17 +35,19 @@ void gimp_help_disable_tooltips (void);
/* the standard gimp help function /* the standard gimp help function
*/ */
void gimp_standard_help_func (const gchar *help_data); void gimp_standard_help_func (const gchar *help_id,
gpointer help_data);
/* connect the help callback of a window */ /* connect the help callback of a window */
void gimp_help_connect (GtkWidget *widget, void gimp_help_connect (GtkWidget *widget,
GimpHelpFunc help_func, GimpHelpFunc help_func,
const gchar *help_data); const gchar *help_id,
gpointer help_data);
/* set help data for non-window widgets */ /* set help data for non-window widgets */
void gimp_help_set_help_data (GtkWidget *widget, void gimp_help_set_help_data (GtkWidget *widget,
const gchar *tooltip, const gchar *tooltip,
const gchar *help_data); const gchar *help_id);
/* activate the context help inspector */ /* activate the context help inspector */
void gimp_context_help (void); void gimp_context_help (void);

View file

@ -658,7 +658,7 @@ gimp_scale_entry_new_internal (gboolean color_scale,
gdouble unconstrained_lower, gdouble unconstrained_lower,
gdouble unconstrained_upper, gdouble unconstrained_upper,
const gchar *tooltip, const gchar *tooltip,
const gchar *help_data) const gchar *help_id)
{ {
GtkWidget *label; GtkWidget *label;
GtkWidget *scale; GtkWidget *scale;
@ -749,10 +749,10 @@ gimp_scale_entry_new_internal (gboolean color_scale,
GTK_SHRINK, GTK_SHRINK, 0, 0); GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (spinbutton); gtk_widget_show (spinbutton);
if (tooltip || help_data) if (tooltip || help_id)
{ {
gimp_help_set_help_data (scale, tooltip, help_data); gimp_help_set_help_data (scale, tooltip, help_id);
gimp_help_set_help_data (spinbutton, tooltip, help_data); gimp_help_set_help_data (spinbutton, tooltip, help_id);
} }
g_object_set_data (G_OBJECT (return_adj), "label", label); g_object_set_data (G_OBJECT (return_adj), "label", label);
@ -784,7 +784,7 @@ gimp_scale_entry_new_internal (gboolean color_scale,
* @unconstrained_upper: The spinbutton's upper boundary * @unconstrained_upper: The spinbutton's upper boundary
* if @constrain == %FALSE. * if @constrain == %FALSE.
* @tooltip: A tooltip message for the scale and the spinbutton. * @tooltip: A tooltip message for the scale and the spinbutton.
* @help_data: The widgets' help_data (see gimp_help_set_help_data()). * @help_id: The widgets' help_id (see gimp_help_set_help_data()).
* *
* This function creates a #GtkLabel, a #GtkHScale and a #GtkSpinButton and * This function creates a #GtkLabel, a #GtkHScale and a #GtkSpinButton and
* attaches them to a 3-column #GtkTable. * attaches them to a 3-column #GtkTable.
@ -808,7 +808,7 @@ gimp_scale_entry_new (GtkTable *table,
gdouble unconstrained_lower, gdouble unconstrained_lower,
gdouble unconstrained_upper, gdouble unconstrained_upper,
const gchar *tooltip, const gchar *tooltip,
const gchar *help_data) const gchar *help_id)
{ {
return gimp_scale_entry_new_internal (FALSE, return gimp_scale_entry_new_internal (FALSE,
table, column, row, table, column, row,
@ -819,7 +819,7 @@ gimp_scale_entry_new (GtkTable *table,
constrain, constrain,
unconstrained_lower, unconstrained_lower,
unconstrained_upper, unconstrained_upper,
tooltip, help_data); tooltip, help_id);
} }
/** /**
@ -838,7 +838,7 @@ gimp_scale_entry_new (GtkTable *table,
* @page_increment: The page increment. * @page_increment: The page increment.
* @digits: The number of decimal digits. * @digits: The number of decimal digits.
* @tooltip: A tooltip message for the scale and the spinbutton. * @tooltip: A tooltip message for the scale and the spinbutton.
* @help_data: The widgets' help_data (see gimp_help_set_help_data()). * @help_id: The widgets' help_id (see gimp_help_set_help_data()).
* *
* This function creates a #GtkLabel, a #GimpColorScale and a * This function creates a #GtkLabel, a #GimpColorScale and a
* #GtkSpinButton and attaches them to a 3-column #GtkTable. * #GtkSpinButton and attaches them to a 3-column #GtkTable.
@ -859,7 +859,7 @@ gimp_color_scale_entry_new (GtkTable *table,
gdouble page_increment, gdouble page_increment,
guint digits, guint digits,
const gchar *tooltip, const gchar *tooltip,
const gchar *help_data) const gchar *help_id)
{ {
return gimp_scale_entry_new_internal (TRUE, return gimp_scale_entry_new_internal (TRUE,
table, column, row, table, column, row,
@ -868,7 +868,7 @@ gimp_color_scale_entry_new (GtkTable *table,
step_increment, page_increment, step_increment, page_increment,
digits, digits,
TRUE, 0.0, 0.0, TRUE, 0.0, 0.0,
tooltip, help_data); tooltip, help_id);
} }
/** /**

View file

@ -168,7 +168,7 @@ GtkObject * gimp_scale_entry_new (GtkTable *table,
gdouble unconstrained_lower, gdouble unconstrained_lower,
gdouble unconstrained_upper, gdouble unconstrained_upper,
const gchar *tooltip, const gchar *tooltip,
const gchar *help_data); const gchar *help_id);
GtkObject * gimp_color_scale_entry_new (GtkTable *table, GtkObject * gimp_color_scale_entry_new (GtkTable *table,
gint column, gint column,
@ -183,7 +183,7 @@ GtkObject * gimp_color_scale_entry_new (GtkTable *table,
gdouble page_increment, gdouble page_increment,
guint digits, guint digits,
const gchar *tooltip, const gchar *tooltip,
const gchar *help_data); const gchar *help_id);
void gimp_scale_entry_set_sensitive (GtkObject *adjustment, void gimp_scale_entry_set_sensitive (GtkObject *adjustment,
gboolean sensitive); gboolean sensitive);

View file

@ -76,7 +76,8 @@ typedef struct _GimpSizeEntry GimpSizeEntry;
typedef struct _GimpUnitMenu GimpUnitMenu; typedef struct _GimpUnitMenu GimpUnitMenu;
typedef void (* GimpHelpFunc) (const gchar *help_data); typedef void (* GimpHelpFunc) (const gchar *help_id,
gpointer data);
G_END_DECLS G_END_DECLS

View file

@ -618,7 +618,7 @@ palette_dialog (const gchar *title)
NULL); NULL);
gimp_help_connect (dialog, gimp_standard_help_func, gimp_help_connect (dialog, gimp_standard_help_func,
"filters/cel.html"); "filters/cel.html", NULL);
gtk_widget_show (dialog); gtk_widget_show (dialog);

View file

@ -2102,7 +2102,7 @@ CML_save_to_file_callback (GtkWidget *widget,
filesel); filesel);
gimp_help_connect (filesel, gimp_standard_help_func, gimp_help_connect (filesel, gimp_standard_help_func,
"filters/cml_explorer.html"); "filters/cml_explorer.html", NULL);
} }
if (strlen (VALS.last_file_name) > 0) if (strlen (VALS.last_file_name) > 0)
@ -2310,7 +2310,7 @@ CML_load_from_file_callback (GtkWidget *widget,
filesel); filesel);
gimp_help_connect (filesel, gimp_standard_help_func, gimp_help_connect (filesel, gimp_standard_help_func,
"filters/cml_explorer.html"); "filters/cml_explorer.html", NULL);
} }
if ((selective_load_source == 0) || (selective_load_destination == 0)) if ((selective_load_source == 0) || (selective_load_destination == 0))

View file

@ -166,7 +166,6 @@ build_dialog (void)
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *hbox2; GtkWidget *hbox2;
GtkTooltips *tooltips;
gimp_ui_init ("gee", TRUE); gimp_ui_init ("gee", TRUE);
@ -178,7 +177,8 @@ build_dialog (void)
G_CALLBACK (window_delete_callback), G_CALLBACK (window_delete_callback),
NULL); NULL);
gimp_help_connect (dlg, gimp_standard_help_func, "filters/geeslime.html"); gimp_help_connect (dlg, gimp_standard_help_func,
"filters/geeslime.html", NULL);
/* Action area - 'close' button only. */ /* Action area - 'close' button only. */
@ -193,11 +193,10 @@ build_dialog (void)
G_CALLBACK (window_close_callback), G_CALLBACK (window_close_callback),
dlg); dlg);
tooltips = gtk_tooltips_new (); gimp_help_set_help_data (button,
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), button, _("A less-obsolete creation of Adam D. Moss / "
_("A less-obsolete creation of Adam D. Moss / adam@gimp.org / adam@foxbox.org / 1998-2000"), "adam@gimp.org / adam@foxbox.org / 1998-2000"),
NULL); NULL);
gtk_tooltips_enable (tooltips);
/* The 'fun' half of the dialog */ /* The 'fun' half of the dialog */

View file

@ -196,7 +196,6 @@ build_dialog (void)
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *hbox2; GtkWidget *hbox2;
GtkTooltips *tooltips;
gimp_ui_init ("gee_zoom", TRUE); gimp_ui_init ("gee_zoom", TRUE);
@ -209,7 +208,8 @@ build_dialog (void)
G_CALLBACK (window_delete_callback), G_CALLBACK (window_delete_callback),
NULL); NULL);
gimp_help_connect (dlg, gimp_standard_help_func, "filters/gee.html"); gimp_help_connect (dlg, gimp_standard_help_func,
"filters/gee.html", NULL);
/* Action area - 'close' button only. */ /* Action area - 'close' button only. */
@ -224,11 +224,10 @@ build_dialog (void)
G_CALLBACK (window_close_callback), G_CALLBACK (window_close_callback),
dlg); dlg);
tooltips = gtk_tooltips_new (); gimp_help_set_help_data (button,
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), button, _("An obsolete creation of Adam D. Moss / "
_("An obsolete creation of Adam D. Moss / adam@gimp.org / adam@foxbox.org / 1998-2000"), "adam@gimp.org / adam@foxbox.org / 1998-2000"),
NULL); NULL);
gtk_tooltips_enable (tooltips);
/* The 'fun' half of the dialog */ /* The 'fun' half of the dialog */

View file

@ -716,7 +716,8 @@ static void
file_selection_save (GtkWidget *widget, file_selection_save (GtkWidget *widget,
GtkWidget *file_select) GtkWidget *file_select)
{ {
strcpy (qbist_info.path, gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_select))); strcpy (qbist_info.path,
gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_select)));
save_data (qbist_info.path); save_data (qbist_info.path);
gtk_widget_destroy (file_select); gtk_widget_destroy (file_select);
@ -743,7 +744,7 @@ dialog_load (GtkWidget *widget,
file_select = gtk_file_selection_new (_("Load QBE file...")); file_select = gtk_file_selection_new (_("Load QBE file..."));
gimp_help_connect (file_select, gimp_standard_help_func, gimp_help_connect (file_select, gimp_standard_help_func,
"filters/gqbist.html"); "filters/gqbist.html", NULL);
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_select), gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_select),
qbist_info.path); qbist_info.path);
@ -770,7 +771,7 @@ dialog_save (GtkWidget *widget,
gtk_file_selection_new (_("Save (middle transform) as QBE file...")); gtk_file_selection_new (_("Save (middle transform) as QBE file..."));
gimp_help_connect (file_select, gimp_standard_help_func, gimp_help_connect (file_select, gimp_standard_help_func,
"filters/gqbist.html"); "filters/gqbist.html", NULL);
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_select), gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_select),
qbist_info.path); qbist_info.path);

View file

@ -2172,7 +2172,7 @@ fileselect (gint action)
windows[action]); windows[action]);
gimp_help_connect (windows[action], gimp_standard_help_func, gimp_help_connect (windows[action], gimp_standard_help_func,
"filters/spheredesigner.html"); "filters/spheredesigner.html", NULL);
} }
gtk_widget_show (windows[action]); gtk_widget_show (windows[action]);
} }

View file

@ -487,7 +487,8 @@ make_file_dlg (void)
G_CALLBACK (file_cancel_callback), G_CALLBACK (file_cancel_callback),
file_dlg); file_dlg);
gimp_help_connect (file_dlg, gimp_standard_help_func, "filters/flame.html"); gimp_help_connect (file_dlg, gimp_standard_help_func,
"filters/flame.html", NULL);
} }
static void static void

View file

@ -199,7 +199,8 @@ fp_create_circle_palette (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL); win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, "filters/fp.html"); gimp_help_connect (win, gimp_standard_help_func,
"filters/fp.html", NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Hue Variations")); gtk_window_set_title (GTK_WINDOW (win), _("Hue Variations"));
gtk_container_add (GTK_CONTAINER (win), frame); gtk_container_add (GTK_CONTAINER (win), frame);
@ -347,7 +348,8 @@ fp_create_lnd (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL); win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, "filters/fp.html"); gimp_help_connect (win, gimp_standard_help_func,
"filters/fp.html", NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Value Variations")); gtk_window_set_title (GTK_WINDOW (win), _("Value Variations"));
gtk_container_add (GTK_CONTAINER (win), frame); gtk_container_add (GTK_CONTAINER (win), frame);
@ -396,7 +398,8 @@ fp_create_msnls (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL); win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, "filters/fp.html"); gimp_help_connect (win, gimp_standard_help_func,
"filters/fp.html", NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Saturation Variations")); gtk_window_set_title (GTK_WINDOW (win), _("Saturation Variations"));
gtk_container_add (GTK_CONTAINER (win), frame); gtk_container_add (GTK_CONTAINER (win), frame);
@ -1046,7 +1049,7 @@ fp_advanced_dialog (void)
AW.window = gtk_window_new (GTK_WINDOW_TOPLEVEL); AW.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (AW.window, gimp_standard_help_func, gimp_help_connect (AW.window, gimp_standard_help_func,
"filters/fp.html"); "filters/fp.html", NULL);
gtk_window_set_title (GTK_WINDOW (AW.window), gtk_window_set_title (GTK_WINDOW (AW.window),
_("Advanced Filter Pack Options")); _("Advanced Filter Pack Options"));

View file

@ -587,13 +587,15 @@ open_browser_dialog (const gchar *help_path,
/* the dialog window */ /* the dialog window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "destroy",
G_CALLBACK (close_callback),
NULL);
gtk_window_set_wmclass (GTK_WINDOW (window), "helpbrowser", "Gimp"); gtk_window_set_wmclass (GTK_WINDOW (window), "helpbrowser", "Gimp");
gtk_window_set_title (GTK_WINDOW (window), _("GIMP Help Browser")); gtk_window_set_title (GTK_WINDOW (window), _("GIMP Help Browser"));
gimp_help_connect (window, gimp_standard_help_func, "dialogs/help.html"); g_signal_connect (window, "destroy",
G_CALLBACK (close_callback),
NULL);
gimp_help_connect (window, gimp_standard_help_func,
"dialogs/help.html", NULL);
vbox = gtk_vbox_new (FALSE, 2); vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (window), vbox); gtk_container_add (GTK_CONTAINER (window), vbox);

View file

@ -2738,7 +2738,7 @@ ifs_compose_save_callback (GtkWidget *widget,
file_select = gtk_file_selection_new (_("Save as IFS file")); file_select = gtk_file_selection_new (_("Save as IFS file"));
gimp_help_connect (file_select, gimp_standard_help_func, gimp_help_connect (file_select, gimp_standard_help_func,
"filters/ifscompose.html"); "filters/ifscompose.html", NULL);
g_signal_connect (GTK_FILE_SELECTION (file_select)->ok_button, "clicked", g_signal_connect (GTK_FILE_SELECTION (file_select)->ok_button, "clicked",
G_CALLBACK (ifsfile_save), G_CALLBACK (ifsfile_save),
@ -2763,7 +2763,7 @@ ifs_compose_load_callback (GtkWidget *widget,
file_select = gtk_file_selection_new (_("Load IFS file")); file_select = gtk_file_selection_new (_("Load IFS file"));
gimp_help_connect (file_select, gimp_standard_help_func, gimp_help_connect (file_select, gimp_standard_help_func,
"filters/ifscompose.html"); "filters/ifscompose.html", NULL);
g_signal_connect (GTK_FILE_SELECTION (file_select)->ok_button, "clicked", g_signal_connect (GTK_FILE_SELECTION (file_select)->ok_button, "clicked",
G_CALLBACK (ifsfile_load), G_CALLBACK (ifsfile_load),

View file

@ -1415,7 +1415,8 @@ dialog(GimpDrawable *drawable)
gtk_window_set_resizable(GTK_WINDOW(dlg), TRUE); gtk_window_set_resizable(GTK_WINDOW(dlg), TRUE);
main_set_title(NULL); main_set_title(NULL);
gimp_help_connect (dlg, gimp_standard_help_func, "filters/imagemap.html"); gimp_help_connect (dlg, gimp_standard_help_func,
"filters/imagemap.html", NULL);
gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_MOUSE); gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_MOUSE);
g_signal_connect(dlg, "delete_event", g_signal_connect(dlg, "delete_event",