From a11f33345d160ff7bd45804974e48403c863b9fb Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 3 Oct 1999 13:50:19 +0000 Subject: [PATCH] The GIMP Help System part II: press "F1" while browsing a menu to show the 1999-10-03 Michael Natterer The GIMP Help System part II: press "F1" while browsing a menu to show the help page for the menu entry you're currently over with the mouse. * app/color_notebook.c: all color selectors have to register with a help page now. * app/color_select.[ch]: register with a help string. Removed the dialog part of the files because it's use was deprecated anyway (use color notebooks instead). * app/colormap_dialog.i.c * app/colormap_dialog.p.h * app/palette.c * app/palette_select.c: use a color notebook instead of a color selector. * app/gimphelp.c * app/gimpui.c: minor changes. * app/gimprc.c: "use help" defaults to TRUE now. * app/lc_dialog.c * app/lc_dialogP.h: a special help function which shows the help for the currently selected notebook page. * app/menus.c: some weird code which catches "key_press_event" in all menu shells and pops up the corresp. help page for the selected item. Embedded the GtkItemFactoryEntry in a new GimpItemFactoryEntry to allow a help path to be stored. Will be partially exported and moved to gimphelp.[ch] later to catch key_press for plug-in menu items (don't try this now ;-) * app/app_procs.c * app/brush_edit.c * app/brush_select.c * app/channel_ops.c * app/channels_dialog.c * app/commands.c * app/convert.c * app/devices.c * app/file_new_dialog.c * app/fileops.c * app/gdisplay.c * app/gdisplay_color.c * app/gdisplay_color_ui.c * app/gdisplay_ops.c * app/global_edit.c * app/gradient.c * app/gradient_select.c * app/interface.c * app/layers_dialog.c * app/module_db.c * app/paths_dialog.c * app/pattern_select.c * app/preferences_dialog.c * app/qmask.c * app/resize.c * app/undo_history.c: changed all dialog constructors to point to the right place in the new help file structure. * configure.in * help/*: the basic new help file structure. * modules/colorsel_gtk.c * modules/colorsel_triangle.c * modules/colorsel_water.c: register a help page. * plug-ins/helpbrowser/helpbrowser.c: load the help files according to the new help file structure. --- ChangeLog | 73 ++ app/actions/help-commands.c | 10 +- app/actions/qmask-commands.c | 2 +- app/actions/quick-mask-commands.c | 2 +- app/app_procs.c | 2 +- app/brush_edit.c | 2 +- app/brush_select.c | 4 +- app/channel_ops.c | 2 +- app/channels_dialog.c | 4 +- app/color_notebook.c | 29 +- app/color_select.c | 183 ++-- app/color_select.h | 47 - app/colormap_dialog.i.c | 46 +- app/colormap_dialog.p.h | 4 +- app/commands.c | 10 +- app/convert.c | 2 +- app/core/gimp-edit.c | 6 +- app/core/gimpdrawable-offset.c | 2 +- app/core/gimpedit.c | 6 +- app/core/gimpimage-convert.c | 2 +- app/core/gimpimage-duplicate.c | 2 +- app/core/gimpimage-qmask.c | 2 +- app/core/gimpimage-quick-mask.c | 2 +- app/core/gimpprojection.c | 5 +- app/devices.c | 4 +- app/dialogs/color-dialog.c | 29 +- app/dialogs/image-new-dialog.c | 4 +- app/dialogs/module-dialog.c | 2 +- app/dialogs/preferences-dialog.c | 2 +- app/dialogs/resize-dialog.c | 8 +- app/display/gimpdisplay-ops.c | 2 +- app/display/gimpdisplay.c | 5 +- app/display/gimpdisplayshell-draw.c | 4 +- app/display/gimpdisplayshell-filter-dialog.c | 2 +- app/display/gimpdisplayshell-filter.c | 2 +- app/display/gimpdisplayshell-qmask.c | 2 +- app/display/gimpdisplayshell.c | 4 +- app/file_new_dialog.c | 4 +- app/fileops.c | 6 +- app/gdisplay.c | 5 +- app/gdisplay_color.c | 2 +- app/gdisplay_color_ui.c | 2 +- app/gdisplay_ops.c | 2 +- app/gimpdrawable-offset.c | 2 +- app/gimphelp.c | 10 + app/gimpimage-convert.c | 2 +- app/gimpimage-duplicate.c | 2 +- app/gimprc.c | 2 +- app/gimpui.c | 16 +- app/global_edit.c | 6 +- app/gradient.c | 16 +- app/gradient_editor.c | 16 +- app/gradient_select.c | 2 +- app/gui/brush-editor.c | 2 +- app/gui/brush-select.c | 4 +- app/gui/channels-dialog.c | 4 +- app/gui/color-notebook.c | 29 +- app/gui/color-select.c | 183 ++-- app/gui/color-select.h | 47 - app/gui/commands.c | 10 +- app/gui/device-status-dialog.c | 4 +- app/gui/file-new-dialog.c | 4 +- app/gui/gradient-editor.c | 16 +- app/gui/gradient-select.c | 2 +- app/gui/help-commands.c | 10 +- app/gui/input-dialog.c | 4 +- app/gui/layers-dialog.c | 10 +- app/gui/menus.c | 852 +++++++++++++------ app/gui/module-browser.c | 2 +- app/gui/palette-editor.c | 90 +- app/gui/palette-select.c | 20 +- app/gui/paths-dialog.c | 2 +- app/gui/pattern-select.c | 4 +- app/gui/preferences-dialog.c | 2 +- app/gui/qmask-commands.c | 2 +- app/gui/resize-dialog.c | 8 +- app/interface.c | 4 +- app/layers_dialog.c | 10 +- app/lc_dialog.c | 49 +- app/lc_dialogP.h | 2 + app/menus.c | 852 +++++++++++++------ app/menus/menus.c | 852 +++++++++++++------ app/module_db.c | 2 +- app/palette.c | 90 +- app/palette_select.c | 20 +- app/paths_dialog.c | 2 +- app/pattern_select.c | 4 +- app/preferences_dialog.c | 2 +- app/qmask.c | 2 +- app/resize.c | 8 +- app/undo_history.c | 2 +- app/widgets/gimpbrusheditor.c | 2 +- app/widgets/gimpcolordialog.c | 29 +- app/widgets/gimpcolordisplayeditor.c | 2 +- app/widgets/gimpdeviceinfo.c | 4 +- app/widgets/gimpdevices.c | 4 +- app/widgets/gimpgradienteditor.c | 16 +- app/widgets/gimphelp.c | 10 + app/widgets/gimpitemfactory.c | 852 +++++++++++++------ app/widgets/gimppaletteeditor.c | 90 +- app/widgets/gimpwidgets-utils.c | 16 +- configure.in | 2 + help/C/.cvsignore | 2 + help/C/Makefile.am | 18 + help/{ => C}/contents.html | 0 help/{ => C}/index.html | 0 help/{ => C}/welcome.html | 9 +- help/Makefile.am | 17 +- help/images/.cvsignore | 2 + help/images/Makefile.am | 16 + help/{ => images}/eek.png | Bin help/{ => images}/wilber.png | Bin libgimp/color_selector.h | 1 + libgimp/gimpcolorselector.h | 1 + libgimpwidgets/gimpcolorselect.c | 183 ++-- modules/colorsel_gtk.c | 2 +- modules/colorsel_triangle.c | 2 +- modules/colorsel_water.c | 3 +- plug-ins/common/compose.c | 2 +- plug-ins/common/decompose.c | 2 +- plug-ins/helpbrowser/helpbrowser.c | 12 + 121 files changed, 3204 insertions(+), 1921 deletions(-) create mode 100644 help/C/.cvsignore create mode 100644 help/C/Makefile.am rename help/{ => C}/contents.html (100%) rename help/{ => C}/index.html (100%) rename help/{ => C}/welcome.html (64%) create mode 100644 help/images/.cvsignore create mode 100644 help/images/Makefile.am rename help/{ => images}/eek.png (100%) rename help/{ => images}/wilber.png (100%) diff --git a/ChangeLog b/ChangeLog index b3ca0b127a..a86c168ede 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,76 @@ +1999-10-03 Michael Natterer + + The GIMP Help System part II: press "F1" while browsing a menu + to show the help page for the menu entry you're currently over + with the mouse. + + * app/color_notebook.c: all color selectors have to register with + a help page now. + + * app/color_select.[ch]: register with a help string. Removed + the dialog part of the files because it's use was deprecated + anyway (use color notebooks instead). + + * app/colormap_dialog.i.c + * app/colormap_dialog.p.h + * app/palette.c + * app/palette_select.c: use a color notebook instead of a color + selector. + + * app/gimphelp.c + * app/gimpui.c: minor changes. + + * app/gimprc.c: "use help" defaults to TRUE now. + + * app/lc_dialog.c + * app/lc_dialogP.h: a special help function which shows the help + for the currently selected notebook page. + + * app/menus.c: some weird code which catches "key_press_event" + in all menu shells and pops up the corresp. help page for the + selected item. Embedded the GtkItemFactoryEntry in a new + GimpItemFactoryEntry to allow a help path to be stored. + Will be partially exported and moved to gimphelp.[ch] later to + catch key_press for plug-in menu items (don't try this now ;-) + + * app/app_procs.c + * app/brush_edit.c + * app/brush_select.c + * app/channel_ops.c + * app/channels_dialog.c + * app/commands.c + * app/convert.c + * app/devices.c + * app/file_new_dialog.c + * app/fileops.c + * app/gdisplay.c + * app/gdisplay_color.c + * app/gdisplay_color_ui.c + * app/gdisplay_ops.c + * app/global_edit.c + * app/gradient.c + * app/gradient_select.c + * app/interface.c + * app/layers_dialog.c + * app/module_db.c + * app/paths_dialog.c + * app/pattern_select.c + * app/preferences_dialog.c + * app/qmask.c + * app/resize.c + * app/undo_history.c: changed all dialog constructors to point + to the right place in the new help file structure. + + * configure.in + * help/*: the basic new help file structure. + + * modules/colorsel_gtk.c + * modules/colorsel_triangle.c + * modules/colorsel_water.c: register a help page. + + * plug-ins/helpbrowser/helpbrowser.c: load the help files + according to the new help file structure. + 1999-10-03 Tor Lillqvist * app/cursorutil.h app/session.c app/text_tool.c: Change the diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index 9dc31ff075..344533c4e2 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -352,7 +352,7 @@ select_border_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Border Selection"), gimp_standard_help_func, - "dialogs/border_selection_dialog.html", + "dialogs/border_selection.html", _("Border selection by:"), selection_border_radius, 1, 32767, 0, gdisp->gimage->unit, @@ -375,7 +375,7 @@ select_feather_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Feather Selection"), gimp_standard_help_func, - "dialogs/feather_selection_dialog.html", + "dialogs/feather_selection.html", _("Feather selection by:"), selection_feather_radius, 0, 32767, 3, gdisp->gimage->unit, @@ -398,7 +398,7 @@ select_grow_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Grow Selection"), gimp_standard_help_func, - "dialogs/grow_selection_dialog.html", + "dialogs/grow_selection.html", _("Grow selection by:"), selection_grow_pixels, 1, 32767, 0, gdisp->gimage->unit, @@ -423,7 +423,7 @@ select_shrink_cmd_callback (GtkWidget *widget, shrink_dialog = gimp_query_size_box (N_("Shrink Selection"), gimp_standard_help_func, - "dialogs/shrink_selection_dialog.html", + "dialogs/shrink_selection.html", N_("Shrink selection by:"), selection_shrink_pixels, 1, 32767, 0, gdisp->gimage->unit, @@ -1195,7 +1195,7 @@ void gimp_help_cmd_callback (GtkWidget *widget, gpointer client_data) { - gimp_help (""); + gimp_help (NULL); } void diff --git a/app/actions/qmask-commands.c b/app/actions/qmask-commands.c index 7ff287f61d..9a3aa1b35e 100644 --- a/app/actions/qmask-commands.c +++ b/app/actions/qmask-commands.c @@ -248,7 +248,7 @@ edit_qmask_channel_query (GDisplay * gdisp) options->query_box = gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes", gimp_standard_help_func, - "dialogs/edit_qmask_attributes_dialog.html", + "dialogs/edit_qmask_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/actions/quick-mask-commands.c b/app/actions/quick-mask-commands.c index 7ff287f61d..9a3aa1b35e 100644 --- a/app/actions/quick-mask-commands.c +++ b/app/actions/quick-mask-commands.c @@ -248,7 +248,7 @@ edit_qmask_channel_query (GDisplay * gdisp) options->query_box = gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes", gimp_standard_help_func, - "dialogs/edit_qmask_attributes_dialog.html", + "dialogs/edit_qmask_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/app_procs.c b/app/app_procs.c index ec7d1fe99c..02650b5592 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -728,7 +728,7 @@ really_quit_dialog (void) dialog = gimp_dialog_new (_("Really Quit?"), "really_quit", gimp_standard_help_func, - "dialogs/really_quit_dialog.html", + "dialogs/really_quit.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/brush_edit.c b/app/brush_edit.c index 4541982c79..ea0ff0610e 100644 --- a/app/brush_edit.c +++ b/app/brush_edit.c @@ -207,7 +207,7 @@ brush_edit_generated_new () begw->shell = gimp_dialog_new (_("Brush Editor"), "generated_brush_editor", gimp_standard_help_func, - "dialogs/generated_brush_editor_dialog.html", + "dialogs/generated_brush_editor.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/brush_select.c b/app/brush_select.c index 967d5ba394..517aae0b25 100644 --- a/app/brush_select.c +++ b/app/brush_select.c @@ -200,7 +200,7 @@ brush_select_new (gchar *title, { bsp->shell = gimp_dialog_new (title, "brush_selection", gimp_standard_help_func, - "dialogs/brush_selection_dialog.html", + "dialogs/brush_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -218,7 +218,7 @@ brush_select_new (gchar *title, { bsp->shell = gimp_dialog_new (_("Brush Selection"), "brush_selection", gimp_standard_help_func, - "dialogs/brush_selection_dialog.html", + "dialogs/brush_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/channel_ops.c b/app/channel_ops.c index c61e6748ee..6fc3662023 100644 --- a/app/channel_ops.c +++ b/app/channel_ops.c @@ -85,7 +85,7 @@ channel_ops_offset (GimpImage* gimage) off_d->dlg = gimp_dialog_new (_("Offset"), "offset", gimp_standard_help_func, - "dialogs/offset_dialog.html", + "dialogs/offset.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/channels_dialog.c b/app/channels_dialog.c index 65eb33dae3..b49f49494e 100644 --- a/app/channels_dialog.c +++ b/app/channels_dialog.c @@ -2391,7 +2391,7 @@ channels_dialog_new_channel_query (GimpImage* gimage) options->query_box = gimp_dialog_new (_("New Channel Options"), "new_channel_options", gimp_standard_help_func, - "dialogs/channels_dialog.html", + "dialogs/channels/dialogs/new_channel.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -2565,7 +2565,7 @@ channels_dialog_edit_channel_query (ChannelWidget *channel_widget) options->query_box = gimp_dialog_new (_("Edit Channel Attributes"), "edit_channel_attributes", gimp_standard_help_func, - "dialogs/channels_dialog.html", + "dialogs/channels/dialogs/edit_channel_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/color_notebook.c b/app/color_notebook.c index 39976e007a..7875d62d78 100644 --- a/app/color_notebook.c +++ b/app/color_notebook.c @@ -37,11 +37,14 @@ static void color_notebook_ok_callback (GtkWidget *, gpointer); static void color_notebook_cancel_callback (GtkWidget *, gpointer); static void color_notebook_update_callback (void *, int, int, int); -static void color_notebook_page_switch (GtkWidget *, GtkNotebookPage *, guint); +static void color_notebook_page_switch (GtkWidget *, GtkNotebookPage *, + guint); +static void color_notebook_help_func (gpointer data); /* information we keep on each registered colour selector */ typedef struct _ColorSelectorInfo { char *name; /* label used in notebook tab */ + char *help_page; GimpColorSelectorMethods m; int refs; /* number of instances around */ gboolean active; @@ -100,8 +103,7 @@ color_notebook_new (int r, cnp->shell = gimp_dialog_new (_("Color Selection"), "color_selection", - gimp_standard_help_func, - "dialogs/color_notebook_dialog.html", + color_notebook_help_func, cnp, GTK_WIN_POS_NONE, FALSE, FALSE, FALSE, @@ -134,7 +136,7 @@ color_notebook_new (int r, if (info->active) { - csel = g_malloc (sizeof (ColorSelectorInstance)); + csel = g_new (ColorSelectorInstance, 1); csel->color_notebook = cnp; csel->info = info; info->refs++; @@ -336,12 +338,28 @@ color_notebook_page_switch (GtkWidget *widget, TRUE); } +static void +color_notebook_help_func (gpointer data) +{ + ColorNotebookP cnp; + gchar *help_path; + + cnp = (ColorNotebookP) data; + + help_path = g_strconcat ("dialogs/color_selectors/", + cnp->cur_page->info->help_page, + NULL); + gimp_help (help_path); + g_free (help_path); +} + /**************************************************************/ /* Registration functions */ G_MODULE_EXPORT GimpColorSelectorID gimp_color_selector_register (const char *name, + const char *help_page, GimpColorSelectorMethods *methods) { ColorSelectorInfo *info; @@ -355,9 +373,10 @@ gimp_color_selector_register (const char *name, info = info->next; } - info = g_malloc (sizeof (ColorSelectorInfo)); + info = g_new (ColorSelectorInfo, 1); info->name = g_strdup (name); + info->help_page = g_strdup (help_page); info->m = *methods; info->refs = 0; info->active = TRUE; diff --git a/app/color_select.c b/app/color_select.c index 8222bbd0c0..81fde9defe 100644 --- a/app/color_select.c +++ b/app/color_select.c @@ -45,6 +45,13 @@ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | \ GDK_BUTTON1_MOTION_MASK | GDK_ENTER_NOTIFY_MASK +typedef enum +{ + COLOR_SELECT_OK, + COLOR_SELECT_CANCEL, + COLOR_SELECT_UPDATE +} ColorSelectState; + typedef enum { HUE = 0, @@ -72,6 +79,33 @@ typedef enum UPDATE_CALLER = 1 << 6 } ColorSelectUpdateType; +typedef void (*ColorSelectCallback) (gint, gint, gint, ColorSelectState, void *); + +typedef struct _ColorSelect ColorSelect, *ColorSelectP; + +struct _ColorSelect +{ + GtkWidget *xy_color; + GtkWidget *z_color; + GtkWidget *new_color; + GtkWidget *orig_color; + GtkWidget *toggles[6]; + GtkWidget *entries[6]; + GtkWidget *hex_entry; + GtkAdjustment *slider_data[6]; + + gint pos[3]; + gint values[6]; + gint z_color_fill; + gint xy_color_fill; + gint orig_values[3]; + gboolean wants_updates; + GdkGC *gc; + + ColorSelectCallback callback; + void *client_data; +}; + typedef struct _ColorSelectFill ColorSelectFill; typedef void (*ColorSelectFillUpdateProc) (ColorSelectFill *); @@ -110,8 +144,6 @@ static void color_select_update_sliders (ColorSelect *, gint); static void color_select_update_entries (ColorSelect *, gint); static void color_select_update_colors (ColorSelect *, gint); -static void color_select_ok_callback (GtkWidget *, gpointer); -static void color_select_cancel_callback (GtkWidget *, gpointer); static gint color_select_xy_expose (GtkWidget *, GdkEventExpose *, ColorSelect *); static gint color_select_xy_events (GtkWidget *, GdkEvent *, @@ -180,60 +212,22 @@ static GtkTargetEntry color_select_target_table[] = static guint n_color_select_targets = (sizeof (color_select_target_table) / sizeof (color_select_target_table[0])); -ColorSelect * -color_select_new (gint r, - gint g, - gint b, - ColorSelectCallback callback, - gpointer data, - gboolean wants_updates) + +/* Register the GIMP colour selector with the color notebook */ +void +color_select_init (void) { - ColorSelect *csp; - GtkWidget *main_vbox; + GimpColorSelectorMethods methods = + { + color_select_notebook_new, + color_select_notebook_free, + color_select_notebook_setcolor + }; - csp = g_new (ColorSelect, 1); - - csp->callback = callback; - csp->client_data = data; - csp->z_color_fill = HUE; - csp->xy_color_fill = SATURATION_VALUE; - csp->gc = NULL; - csp->wants_updates = wants_updates; - - csp->values[RED] = csp->orig_values[0] = r; - csp->values[GREEN] = csp->orig_values[1] = g; - csp->values[BLUE] = csp->orig_values[2] = b; - color_select_update_hsv_values (csp); - color_select_update_pos (csp); - - csp->shell = - gimp_dialog_new (_("Color Selection"), "color_selection", - gimp_standard_help_func, - "dialogs/color_selection_dialog.html", - GTK_WIN_POS_NONE, - FALSE, FALSE, FALSE, - - wants_updates ? _("Close") : _("OK"), - color_select_ok_callback, - csp, NULL, TRUE, FALSE, - wants_updates ? _("Revert to Old Color") : _("Cancel"), - color_select_cancel_callback, - csp, NULL, FALSE, TRUE, - - NULL); - - main_vbox = color_select_widget_new (csp, r, g, b); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (csp->shell)->vbox), main_vbox); - gtk_widget_show (main_vbox); - - color_select_image_fill (csp->z_color, csp->z_color_fill, csp->values); - color_select_image_fill (csp->xy_color, csp->xy_color_fill, csp->values); - - gtk_widget_show (csp->shell); - - return csp; + gimp_color_selector_register ("GIMP", "built_in.html", &methods); } + static GtkWidget * color_select_widget_new (ColorSelect *csp, gint r, @@ -504,47 +498,7 @@ color_select_drag_old_color (GtkWidget *widget, *b = (guchar) csp->orig_values[2]; } -/* Register the GIMP colour selector with the color notebook */ -void -color_select_init (void) -{ - GimpColorSelectorMethods methods = - { - color_select_notebook_new, - color_select_notebook_free, - color_select_notebook_setcolor - }; - - gimp_color_selector_register ("GIMP", &methods); -} - -void -color_select_show (ColorSelect *csp) -{ - if (csp) - gtk_widget_show (csp->shell); -} - -void -color_select_hide (ColorSelect *csp) -{ - if (csp) - gtk_widget_hide (csp->shell); -} - -void -color_select_free (ColorSelect *csp) -{ - if (csp) - { - if (csp->shell) - gtk_widget_destroy (csp->shell); - gdk_gc_destroy (csp->gc); - g_free (csp); - } -} - -void +static void color_select_set_color (ColorSelect *csp, gint r, gint g, @@ -963,42 +917,6 @@ color_select_update_colors (ColorSelect *csp, } } -static void -color_select_ok_callback (GtkWidget *widget, - gpointer data) -{ - ColorSelect *csp; - - csp = (ColorSelect *) data; - if (csp) - { - if (csp->callback) - (* csp->callback) (csp->values[RED], - csp->values[GREEN], - csp->values[BLUE], - COLOR_SELECT_OK, - csp->client_data); - } -} - -static void -color_select_cancel_callback (GtkWidget *widget, - gpointer data) -{ - ColorSelect *csp; - - csp = (ColorSelect *) data; - if (csp) - { - if (csp->callback) - (* csp->callback) (csp->orig_values[0], - csp->orig_values[1], - csp->orig_values[2], - COLOR_SELECT_CANCEL, - csp->client_data); - } -} - static gint color_select_xy_expose (GtkWidget *widget, GdkEventExpose *event, @@ -2176,9 +2094,6 @@ color_select_notebook_new (gint r, glue->main_vbox = color_select_widget_new (csp, r, g, b); - /* the shell is provided by the notebook */ - csp->shell = NULL; - color_select_image_fill (csp->z_color, csp->z_color_fill, csp->values); color_select_image_fill (csp->xy_color, csp->xy_color_fill, csp->values); @@ -2186,13 +2101,13 @@ color_select_notebook_new (gint r, return glue->main_vbox; } - static void color_select_notebook_free (void *data) { notebook_glue *glue = data; - color_select_free (glue->csp); + gdk_gc_destroy (glue->csp->gc); + g_free (glue->csp); /* don't need to destroy the widget, since it's done by the caller * of this function */ g_free (glue); diff --git a/app/color_select.h b/app/color_select.h index a736c0c8d4..6486277f7b 100644 --- a/app/color_select.h +++ b/app/color_select.h @@ -18,53 +18,6 @@ #ifndef __COLOR_SELECT_H__ #define __COLOR_SELECT_H__ -typedef enum -{ - COLOR_SELECT_OK, - COLOR_SELECT_CANCEL, - COLOR_SELECT_UPDATE -} ColorSelectState; - -typedef void (*ColorSelectCallback) (gint, gint, gint, ColorSelectState, void *); - -typedef struct _ColorSelect ColorSelect, *ColorSelectP; - -struct _ColorSelect -{ - GtkWidget *shell; - GtkWidget *xy_color; - GtkWidget *z_color; - GtkWidget *new_color; - GtkWidget *orig_color; - GtkWidget *toggles[6]; - GtkWidget *entries[6]; - GtkWidget *hex_entry; - GtkAdjustment *slider_data[6]; - - gint pos[3]; - gint values[6]; - gint z_color_fill; - gint xy_color_fill; - gint orig_values[3]; - gboolean wants_updates; - GdkGC *gc; - - ColorSelectCallback callback; - void *client_data; -}; - void color_select_init (void); -ColorSelectP color_select_new (gint r, - gint g, - gint b, - ColorSelectCallback callback, - gpointer client_data, - gboolean wants_update); -void color_select_show (ColorSelectP); -void color_select_hide (ColorSelectP); -void color_select_free (ColorSelectP); -void color_select_set_color (ColorSelectP, - gint, gint, gint, gint); - #endif /* __COLOR_SELECT_H__ */ diff --git a/app/colormap_dialog.i.c b/app/colormap_dialog.i.c index 86cc39b32a..b4ad06ee8f 100644 --- a/app/colormap_dialog.i.c +++ b/app/colormap_dialog.i.c @@ -5,7 +5,7 @@ #include "gdk/gdkkeysyms.h" #include "actionarea.h" -#include "color_select.h" +#include "color_notebook.h" #include "image_render.h" #include "dialog_handler.h" #include "buildmenu.h" @@ -41,7 +41,7 @@ static void ipal_update_image_list (GimpColormapDialog* ipal); static void ipal_add_callback (GtkWidget *, gpointer); static void ipal_edit_callback (GtkWidget *, gpointer); static void ipal_close_callback (GtkWidget *, gpointer); -static void ipal_select_callback (int, int, int, ColorSelectState, void *); +static void ipal_select_callback (int, int, int, ColorNotebookState, void *); /* event callback */ static gint ipal_area_events (GtkWidget *, GdkEvent *, GimpColormapDialog *); @@ -281,7 +281,7 @@ ipal_create (GimpSet* context) /* Connect the "F1" help key */ gimp_help_connect_help_accel (GTK_WIDGET (ipal), gimp_standard_help_func, - "dialogs/indexed_palette_dialog.html"); + "dialogs/indexed_palette.html"); gtk_widget_show_all (vbox); /* gtk_widget_show (ipal); */ @@ -662,8 +662,8 @@ ipal_set_image (GimpColormapDialog* ipal, GimpImage* gimage) ipal_draw (ipal); gtk_container_queue_resize(GTK_CONTAINER(ipal)); }else{ - if(ipal->color_select) - color_select_hide(ipal->color_select); + if(ipal->color_notebook) + color_notebook_hide(ipal->color_notebook); } ipal->col_index = 0; @@ -698,16 +698,16 @@ ipal_edit_callback (GtkWidget *w, r = ipal->image->cmap[ipal->col_index*3]; g = ipal->image->cmap[ipal->col_index*3+1]; b = ipal->image->cmap[ipal->col_index*3+2]; - if (! ipal->color_select) + if (! ipal->color_notebook) { - ipal->color_select - = color_select_new (r, g, b, - ipal_select_callback, ipal, FALSE); + ipal->color_notebook + = color_notebook_new (r, g, b, + ipal_select_callback, ipal, FALSE); } else { - color_select_show (ipal->color_select); - color_select_set_color (ipal->color_select, r, g, b, 1); + color_notebook_show (ipal->color_notebook); + color_notebook_set_color (ipal->color_notebook, r, g, b, 1); } } @@ -724,7 +724,7 @@ static void ipal_select_callback (int r, int g, int b, - ColorSelectState state, + ColorNotebookState state, void *client_data) { GimpImage *gimage; @@ -732,21 +732,21 @@ ipal_select_callback (int r, g_return_if_fail (ipal); g_return_if_fail (ipal->image); - g_return_if_fail (ipal->color_select); + g_return_if_fail (ipal->color_notebook); gimage = ipal->image; switch (state) { - case COLOR_SELECT_UPDATE: + case COLOR_NOTEBOOK_UPDATE: break; - case COLOR_SELECT_OK: + case COLOR_NOTEBOOK_OK: gimage->cmap[ipal->col_index * 3 + 0] = r; gimage->cmap[ipal->col_index * 3 + 1] = g; gimage->cmap[ipal->col_index * 3 + 2] = b; gimp_image_colormap_changed (gimage, ipal->col_index); /* Fall through */ - case COLOR_SELECT_CANCEL: - color_select_hide (ipal->color_select); + case COLOR_NOTEBOOK_CANCEL: + color_notebook_hide (ipal->color_notebook); } } @@ -796,16 +796,16 @@ ipal_area_events (GtkWidget *widget, if (bevent->button == 3) { ipal->col_index = col; - if (! ipal->color_select) + if (! ipal->color_notebook) { - ipal->color_select - = color_select_new (r, g, b, - ipal_select_callback, ipal, FALSE); + ipal->color_notebook + = color_notebook_new (r, g, b, + ipal_select_callback, ipal, FALSE); } else { - color_select_show (ipal->color_select); - color_select_set_color (ipal->color_select, r, g, b, 1); + color_notebook_show (ipal->color_notebook); + color_notebook_set_color (ipal->color_notebook, r, g, b, 1); } } break; diff --git a/app/colormap_dialog.p.h b/app/colormap_dialog.p.h index d4822ad739..9729551fa8 100644 --- a/app/colormap_dialog.p.h +++ b/app/colormap_dialog.p.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include typedef struct _GimpColormapDialogClass GimpColormapDialogClass; @@ -35,7 +35,7 @@ struct _GimpColormapDialog { GimpSetHandlerId rename_handler; GimpSetHandlerId cmap_changed_handler; GtkWidget* add_item; - ColorSelectP color_select; + ColorNotebookP color_notebook; }; void gimp_colormap_dialog_selected ( GimpColormapDialog* colormap_dialog); diff --git a/app/commands.c b/app/commands.c index 9dc31ff075..344533c4e2 100644 --- a/app/commands.c +++ b/app/commands.c @@ -352,7 +352,7 @@ select_border_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Border Selection"), gimp_standard_help_func, - "dialogs/border_selection_dialog.html", + "dialogs/border_selection.html", _("Border selection by:"), selection_border_radius, 1, 32767, 0, gdisp->gimage->unit, @@ -375,7 +375,7 @@ select_feather_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Feather Selection"), gimp_standard_help_func, - "dialogs/feather_selection_dialog.html", + "dialogs/feather_selection.html", _("Feather selection by:"), selection_feather_radius, 0, 32767, 3, gdisp->gimage->unit, @@ -398,7 +398,7 @@ select_grow_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Grow Selection"), gimp_standard_help_func, - "dialogs/grow_selection_dialog.html", + "dialogs/grow_selection.html", _("Grow selection by:"), selection_grow_pixels, 1, 32767, 0, gdisp->gimage->unit, @@ -423,7 +423,7 @@ select_shrink_cmd_callback (GtkWidget *widget, shrink_dialog = gimp_query_size_box (N_("Shrink Selection"), gimp_standard_help_func, - "dialogs/shrink_selection_dialog.html", + "dialogs/shrink_selection.html", N_("Shrink selection by:"), selection_shrink_pixels, 1, 32767, 0, gdisp->gimage->unit, @@ -1195,7 +1195,7 @@ void gimp_help_cmd_callback (GtkWidget *widget, gpointer client_data) { - gimp_help (""); + gimp_help (NULL); } void diff --git a/app/convert.c b/app/convert.c index 7525cc7742..a7cb549006 100644 --- a/app/convert.c +++ b/app/convert.c @@ -490,7 +490,7 @@ convert_to_indexed (GimpImage *gimage) dialog->shell = gimp_dialog_new (_("Indexed Color Conversion"), "indexed_color_conversion", gimp_standard_help_func, - "dialogs/indexed_color_conversion_dialog.html", + "dialogs/convert_to_indexed.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index 2aa1d78983..522d1e458e 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -703,7 +703,7 @@ paste_named_buffer (GDisplay *gdisp) pn_dlg->shell = gimp_dialog_new (_("Paste Named Buffer"), "paste_named_buffer", gimp_standard_help_func, - "dialogs/paste_named_buffer_dialog.html", + "dialogs/paste_named.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -806,7 +806,7 @@ named_edit_cut (void *gdisp_ptr) qbox = gimp_query_string_box (_("Cut Named"), gimp_standard_help_func, - "dialogs/cut_named_dialog.html", + "dialogs/cut_named.html", _("Enter a name for this buffer"), NULL, GTK_OBJECT (gdisp->gimage), "destroy", @@ -843,7 +843,7 @@ named_edit_copy (void *gdisp_ptr) qbox = gimp_query_string_box (_("Copy Named"), gimp_standard_help_func, - "dialogs/copy_named_dialog.html", + "dialogs/copy_named.html", _("Enter a name for this buffer"), NULL, GTK_OBJECT (gdisp->gimage), "destroy", diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c index c61e6748ee..6fc3662023 100644 --- a/app/core/gimpdrawable-offset.c +++ b/app/core/gimpdrawable-offset.c @@ -85,7 +85,7 @@ channel_ops_offset (GimpImage* gimage) off_d->dlg = gimp_dialog_new (_("Offset"), "offset", gimp_standard_help_func, - "dialogs/offset_dialog.html", + "dialogs/offset.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/core/gimpedit.c b/app/core/gimpedit.c index 2aa1d78983..522d1e458e 100644 --- a/app/core/gimpedit.c +++ b/app/core/gimpedit.c @@ -703,7 +703,7 @@ paste_named_buffer (GDisplay *gdisp) pn_dlg->shell = gimp_dialog_new (_("Paste Named Buffer"), "paste_named_buffer", gimp_standard_help_func, - "dialogs/paste_named_buffer_dialog.html", + "dialogs/paste_named.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -806,7 +806,7 @@ named_edit_cut (void *gdisp_ptr) qbox = gimp_query_string_box (_("Cut Named"), gimp_standard_help_func, - "dialogs/cut_named_dialog.html", + "dialogs/cut_named.html", _("Enter a name for this buffer"), NULL, GTK_OBJECT (gdisp->gimage), "destroy", @@ -843,7 +843,7 @@ named_edit_copy (void *gdisp_ptr) qbox = gimp_query_string_box (_("Copy Named"), gimp_standard_help_func, - "dialogs/copy_named_dialog.html", + "dialogs/copy_named.html", _("Enter a name for this buffer"), NULL, GTK_OBJECT (gdisp->gimage), "destroy", diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c index 7525cc7742..a7cb549006 100644 --- a/app/core/gimpimage-convert.c +++ b/app/core/gimpimage-convert.c @@ -490,7 +490,7 @@ convert_to_indexed (GimpImage *gimage) dialog->shell = gimp_dialog_new (_("Indexed Color Conversion"), "indexed_color_conversion", gimp_standard_help_func, - "dialogs/indexed_color_conversion_dialog.html", + "dialogs/convert_to_indexed.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index c61e6748ee..6fc3662023 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -85,7 +85,7 @@ channel_ops_offset (GimpImage* gimage) off_d->dlg = gimp_dialog_new (_("Offset"), "offset", gimp_standard_help_func, - "dialogs/offset_dialog.html", + "dialogs/offset.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/core/gimpimage-qmask.c b/app/core/gimpimage-qmask.c index 7ff287f61d..9a3aa1b35e 100644 --- a/app/core/gimpimage-qmask.c +++ b/app/core/gimpimage-qmask.c @@ -248,7 +248,7 @@ edit_qmask_channel_query (GDisplay * gdisp) options->query_box = gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes", gimp_standard_help_func, - "dialogs/edit_qmask_attributes_dialog.html", + "dialogs/edit_qmask_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/core/gimpimage-quick-mask.c b/app/core/gimpimage-quick-mask.c index 7ff287f61d..9a3aa1b35e 100644 --- a/app/core/gimpimage-quick-mask.c +++ b/app/core/gimpimage-quick-mask.c @@ -248,7 +248,7 @@ edit_qmask_channel_query (GDisplay * gdisp) options->query_box = gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes", gimp_standard_help_func, - "dialogs/edit_qmask_attributes_dialog.html", + "dialogs/edit_qmask_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index 3e9327a8c3..a7895195b4 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -1670,8 +1670,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) SET_SENSITIVE (N_("/Image"), gdisp); SET_SENSITIVE (N_("/Image/Colors"), gdisp); - SET_SENSITIVE (N_("/Image/Channel Ops"), gdisp); + SET_SENSITIVE (N_("/Image/Channels"), gdisp); SET_SENSITIVE (N_("/Image/Alpha"), gdisp); + SET_SENSITIVE (N_("/Image/Transforms"), gdisp); if (gdisp) { SET_SENSITIVE (N_("/Image/RGB"), (base_type != RGB)); @@ -1695,7 +1696,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) SET_SENSITIVE (N_("/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha); - SET_SENSITIVE (N_("/Image/Channel Ops/Offset"), lp); + SET_SENSITIVE (N_("/Image/Transforms/Offset"), lp); } SET_SENSITIVE (N_("/Layers/Stack"), gdisp); diff --git a/app/devices.c b/app/devices.c index 4ca834935d..86edffc323 100644 --- a/app/devices.c +++ b/app/devices.c @@ -185,7 +185,7 @@ create_input_dialog (void) /* Connect the "F1" help key */ gimp_help_connect_help_accel (inputd, gimp_standard_help_func, - "dialogs/input_devices_dialog.html"); + "dialogs/input_devices.html"); gtk_widget_show (inputd); } @@ -706,7 +706,7 @@ create_device_status (void) deviceD->shell = gimp_dialog_new (_("Device Status"), "device_status", gimp_standard_help_func, - "dialogs/device_status_dialog.html", + "dialogs/device_status.html", GTK_WIN_POS_NONE, FALSE, FALSE, TRUE, diff --git a/app/dialogs/color-dialog.c b/app/dialogs/color-dialog.c index 39976e007a..7875d62d78 100644 --- a/app/dialogs/color-dialog.c +++ b/app/dialogs/color-dialog.c @@ -37,11 +37,14 @@ static void color_notebook_ok_callback (GtkWidget *, gpointer); static void color_notebook_cancel_callback (GtkWidget *, gpointer); static void color_notebook_update_callback (void *, int, int, int); -static void color_notebook_page_switch (GtkWidget *, GtkNotebookPage *, guint); +static void color_notebook_page_switch (GtkWidget *, GtkNotebookPage *, + guint); +static void color_notebook_help_func (gpointer data); /* information we keep on each registered colour selector */ typedef struct _ColorSelectorInfo { char *name; /* label used in notebook tab */ + char *help_page; GimpColorSelectorMethods m; int refs; /* number of instances around */ gboolean active; @@ -100,8 +103,7 @@ color_notebook_new (int r, cnp->shell = gimp_dialog_new (_("Color Selection"), "color_selection", - gimp_standard_help_func, - "dialogs/color_notebook_dialog.html", + color_notebook_help_func, cnp, GTK_WIN_POS_NONE, FALSE, FALSE, FALSE, @@ -134,7 +136,7 @@ color_notebook_new (int r, if (info->active) { - csel = g_malloc (sizeof (ColorSelectorInstance)); + csel = g_new (ColorSelectorInstance, 1); csel->color_notebook = cnp; csel->info = info; info->refs++; @@ -336,12 +338,28 @@ color_notebook_page_switch (GtkWidget *widget, TRUE); } +static void +color_notebook_help_func (gpointer data) +{ + ColorNotebookP cnp; + gchar *help_path; + + cnp = (ColorNotebookP) data; + + help_path = g_strconcat ("dialogs/color_selectors/", + cnp->cur_page->info->help_page, + NULL); + gimp_help (help_path); + g_free (help_path); +} + /**************************************************************/ /* Registration functions */ G_MODULE_EXPORT GimpColorSelectorID gimp_color_selector_register (const char *name, + const char *help_page, GimpColorSelectorMethods *methods) { ColorSelectorInfo *info; @@ -355,9 +373,10 @@ gimp_color_selector_register (const char *name, info = info->next; } - info = g_malloc (sizeof (ColorSelectorInfo)); + info = g_new (ColorSelectorInfo, 1); info->name = g_strdup (name); + info->help_page = g_strdup (help_page); info->m = *methods; info->refs = 0; info->active = TRUE; diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c index f23969962d..7ecf825f14 100644 --- a/app/dialogs/image-new-dialog.c +++ b/app/dialogs/image-new-dialog.c @@ -187,7 +187,7 @@ file_new_confirm_dialog (NewImageInfo *info) info->confirm_dlg = gimp_dialog_new (_("Confirm Image Size"), "confirm_size", gimp_standard_help_func, - "dialogs/file_new_dialog.html#confirm_size_dialog", + "dialogs/file_new.html#confirm_size", GTK_WIN_POS_MOUSE, FALSE, FALSE, FALSE, @@ -367,7 +367,7 @@ ui_new_image_window_create (const GimpImageNewValues *values_orig) info->dlg = gimp_dialog_new (_("New Image"), "new_image", gimp_standard_help_func, - "dialogs/file_new_dialog.html", + "dialogs/file_new.html", GTK_WIN_POS_MOUSE, FALSE, FALSE, TRUE, diff --git a/app/dialogs/module-dialog.c b/app/dialogs/module-dialog.c index a2fb3ebda5..5cd358d341 100644 --- a/app/dialogs/module-dialog.c +++ b/app/dialogs/module-dialog.c @@ -261,7 +261,7 @@ module_db_browser_new (void) shell = gimp_dialog_new (_("Module DB"), "module_db_dialog", gimp_standard_help_func, - "dialogs/module_db_dialog.html", + "dialogs/module_browser.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 0a61751d03..57b6182b0e 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -1164,7 +1164,7 @@ file_pref_cmd_callback (GtkWidget *widget, prefs_dlg = gimp_dialog_new (_("Preferences"), "gimp_preferences", gimp_standard_help_func, - "dialogs/preferences_dialog.html", + "dialogs/preferences.html", GTK_WIN_POS_NONE, FALSE, FALSE, FALSE, diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index 7e2925d1db..06019a5d1a 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -152,13 +152,13 @@ resize_widget_new (ResizeType type, case ResizeLayer: wmclass = "scale_layer"; window_title = _("Scale Layer"); - help_page = "dialogs/scale_layer_dialog.html"; + help_page = "dialogs/layers/dialogs/scale_layer.html"; frame = gtk_frame_new (_("Size")); break; case ResizeImage: wmclass = "image_scale"; window_title = _("Image Scale"); - help_page = "dialogs/scale_image_dialog.html"; + help_page = "dialogs/scale_image.html"; frame = gtk_frame_new (_("Pixel Dimensions")); break; } @@ -170,12 +170,12 @@ resize_widget_new (ResizeType type, case ResizeLayer: wmclass = "resize_layer"; window_title = _("Resize Layer"); - help_page = "dialogs/resize_layer_dialog.html"; + help_page = "dialogs/layers/dialogs/resize_layer.html"; break; case ResizeImage: wmclass = "image_resize"; window_title = _("Image Resize"); - help_page = "dialogs/resize_image_dialog.html"; + help_page = "dialogs/resize_image.html"; break; } frame = gtk_frame_new (_("Size")); diff --git a/app/display/gimpdisplay-ops.c b/app/display/gimpdisplay-ops.c index 9218dc67fe..793085596d 100644 --- a/app/display/gimpdisplay-ops.c +++ b/app/display/gimpdisplay-ops.c @@ -347,7 +347,7 @@ gdisplay_close_warning_dialog (char *image_name, warning_dialog = mbox = gimp_dialog_new (image_name, "really_close", gimp_standard_help_func, - "dialogs/really_close_dialog.html", + "dialogs/really_close.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index 3e9327a8c3..a7895195b4 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -1670,8 +1670,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) SET_SENSITIVE (N_("/Image"), gdisp); SET_SENSITIVE (N_("/Image/Colors"), gdisp); - SET_SENSITIVE (N_("/Image/Channel Ops"), gdisp); + SET_SENSITIVE (N_("/Image/Channels"), gdisp); SET_SENSITIVE (N_("/Image/Alpha"), gdisp); + SET_SENSITIVE (N_("/Image/Transforms"), gdisp); if (gdisp) { SET_SENSITIVE (N_("/Image/RGB"), (base_type != RGB)); @@ -1695,7 +1696,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) SET_SENSITIVE (N_("/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha); - SET_SENSITIVE (N_("/Image/Channel Ops/Offset"), lp); + SET_SENSITIVE (N_("/Image/Transforms/Offset"), lp); } SET_SENSITIVE (N_("/Layers/Stack"), gdisp); diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 05c4875d05..8cd68c1258 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -591,7 +591,7 @@ create_toolbox (void) /* Connect the "F1" help key */ gimp_help_connect_help_accel (window, gimp_standard_help_func, - "dialogs/toolbox.html"); + "toolbox/index.html"); wbox = gtk_vwrap_box_new (FALSE); gtk_wrap_box_set_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_FILL); @@ -954,7 +954,7 @@ create_display_shell (GDisplay* gdisp, /* Connect the "F1" help key */ gimp_help_connect_help_accel (gdisp->shell, gimp_standard_help_func, - "dialogs/image_window.html"); + "image/index.html"); gtk_widget_show (arrow); gtk_widget_show (gdisp->qmaskon); diff --git a/app/display/gimpdisplayshell-filter-dialog.c b/app/display/gimpdisplayshell-filter-dialog.c index 3e85750e10..a4e72d7f28 100644 --- a/app/display/gimpdisplayshell-filter-dialog.c +++ b/app/display/gimpdisplayshell-filter-dialog.c @@ -77,7 +77,7 @@ make_dialog (void) cdd.shell = gimp_dialog_new (_("Color Display Filters"), "display_color", gimp_standard_help_func, - "dialogs/color_diaplsy_filters_dialog.html", + "dialogs/display_filters.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/display/gimpdisplayshell-filter.c b/app/display/gimpdisplayshell-filter.c index de711cb160..ea6561ae3b 100644 --- a/app/display/gimpdisplayshell-filter.c +++ b/app/display/gimpdisplayshell-filter.c @@ -412,7 +412,7 @@ gamma_configure (gpointer cd_ID) context->shell = gimp_dialog_new (_("Gamma"), "gamma", gimp_standard_help_func, - "dialogs/gamma_dialog.html", + "dialogs/display_filters/gamma.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/display/gimpdisplayshell-qmask.c b/app/display/gimpdisplayshell-qmask.c index 7ff287f61d..9a3aa1b35e 100644 --- a/app/display/gimpdisplayshell-qmask.c +++ b/app/display/gimpdisplayshell-qmask.c @@ -248,7 +248,7 @@ edit_qmask_channel_query (GDisplay * gdisp) options->query_box = gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes", gimp_standard_help_func, - "dialogs/edit_qmask_attributes_dialog.html", + "dialogs/edit_qmask_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 05c4875d05..8cd68c1258 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -591,7 +591,7 @@ create_toolbox (void) /* Connect the "F1" help key */ gimp_help_connect_help_accel (window, gimp_standard_help_func, - "dialogs/toolbox.html"); + "toolbox/index.html"); wbox = gtk_vwrap_box_new (FALSE); gtk_wrap_box_set_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_FILL); @@ -954,7 +954,7 @@ create_display_shell (GDisplay* gdisp, /* Connect the "F1" help key */ gimp_help_connect_help_accel (gdisp->shell, gimp_standard_help_func, - "dialogs/image_window.html"); + "image/index.html"); gtk_widget_show (arrow); gtk_widget_show (gdisp->qmaskon); diff --git a/app/file_new_dialog.c b/app/file_new_dialog.c index f23969962d..7ecf825f14 100644 --- a/app/file_new_dialog.c +++ b/app/file_new_dialog.c @@ -187,7 +187,7 @@ file_new_confirm_dialog (NewImageInfo *info) info->confirm_dlg = gimp_dialog_new (_("Confirm Image Size"), "confirm_size", gimp_standard_help_func, - "dialogs/file_new_dialog.html#confirm_size_dialog", + "dialogs/file_new.html#confirm_size", GTK_WIN_POS_MOUSE, FALSE, FALSE, FALSE, @@ -367,7 +367,7 @@ ui_new_image_window_create (const GimpImageNewValues *values_orig) info->dlg = gimp_dialog_new (_("New Image"), "new_image", gimp_standard_help_func, - "dialogs/file_new_dialog.html", + "dialogs/file_new.html", GTK_WIN_POS_MOUSE, FALSE, FALSE, TRUE, diff --git a/app/fileops.c b/app/fileops.c index 3320bc12a2..9267701d62 100644 --- a/app/fileops.c +++ b/app/fileops.c @@ -234,7 +234,7 @@ file_open_callback (GtkWidget *widget, /* Connect the "F1" help key */ gimp_help_connect_help_accel (fileload, gimp_standard_help_func, - "dialogs/file_load_dialog.html"); + "dialogs/file_open.html"); } else { @@ -461,7 +461,7 @@ file_save_as_callback (GtkWidget *widget, /* Connect the "F1" help key */ gimp_help_connect_help_accel (filesave, gimp_standard_help_func, - "dialogs/file_save_dialog.html"); + "dialogs/file_save.html"); } gdisplay = gdisplay_active (); @@ -1592,7 +1592,7 @@ file_overwrite (char *filename, overwrite_box->obox = gimp_dialog_new (_("File Exists!"), "file_exists", gimp_standard_help_func, - "dialogs/file_exists_dialog.html", + "dialogs/file_exists.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/gdisplay.c b/app/gdisplay.c index 3e9327a8c3..a7895195b4 100644 --- a/app/gdisplay.c +++ b/app/gdisplay.c @@ -1670,8 +1670,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) SET_SENSITIVE (N_("/Image"), gdisp); SET_SENSITIVE (N_("/Image/Colors"), gdisp); - SET_SENSITIVE (N_("/Image/Channel Ops"), gdisp); + SET_SENSITIVE (N_("/Image/Channels"), gdisp); SET_SENSITIVE (N_("/Image/Alpha"), gdisp); + SET_SENSITIVE (N_("/Image/Transforms"), gdisp); if (gdisp) { SET_SENSITIVE (N_("/Image/RGB"), (base_type != RGB)); @@ -1695,7 +1696,7 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp) SET_SENSITIVE (N_("/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha); - SET_SENSITIVE (N_("/Image/Channel Ops/Offset"), lp); + SET_SENSITIVE (N_("/Image/Transforms/Offset"), lp); } SET_SENSITIVE (N_("/Layers/Stack"), gdisp); diff --git a/app/gdisplay_color.c b/app/gdisplay_color.c index de711cb160..ea6561ae3b 100644 --- a/app/gdisplay_color.c +++ b/app/gdisplay_color.c @@ -412,7 +412,7 @@ gamma_configure (gpointer cd_ID) context->shell = gimp_dialog_new (_("Gamma"), "gamma", gimp_standard_help_func, - "dialogs/gamma_dialog.html", + "dialogs/display_filters/gamma.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gdisplay_color_ui.c b/app/gdisplay_color_ui.c index 3e85750e10..a4e72d7f28 100644 --- a/app/gdisplay_color_ui.c +++ b/app/gdisplay_color_ui.c @@ -77,7 +77,7 @@ make_dialog (void) cdd.shell = gimp_dialog_new (_("Color Display Filters"), "display_color", gimp_standard_help_func, - "dialogs/color_diaplsy_filters_dialog.html", + "dialogs/display_filters.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gdisplay_ops.c b/app/gdisplay_ops.c index 9218dc67fe..793085596d 100644 --- a/app/gdisplay_ops.c +++ b/app/gdisplay_ops.c @@ -347,7 +347,7 @@ gdisplay_close_warning_dialog (char *image_name, warning_dialog = mbox = gimp_dialog_new (image_name, "really_close", gimp_standard_help_func, - "dialogs/really_close_dialog.html", + "dialogs/really_close.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/gimpdrawable-offset.c b/app/gimpdrawable-offset.c index c61e6748ee..6fc3662023 100644 --- a/app/gimpdrawable-offset.c +++ b/app/gimpdrawable-offset.c @@ -85,7 +85,7 @@ channel_ops_offset (GimpImage* gimage) off_d->dlg = gimp_dialog_new (_("Offset"), "offset", gimp_standard_help_func, - "dialogs/offset_dialog.html", + "dialogs/offset.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gimphelp.c b/app/gimphelp.c index 77e4ae427a..64201eefd5 100644 --- a/app/gimphelp.c +++ b/app/gimphelp.c @@ -61,6 +61,9 @@ gimp_help_connect_help_accel (GtkWidget *widget, GtkAccelGroup *accel_group; static guint help_signal_id = 0; + if (! help_func) + return; + /* create the help signal if not already done */ if (! help_signal_id) { @@ -86,6 +89,13 @@ gimp_help_connect_help_accel (GtkWidget *widget, /* a new accelerator group for this widget */ accel_group = gtk_accel_group_new (); + + /* FIXME: does not work for some reason... + gtk_widget_add_accelerator (widget, "help", accel_group, + GDK_F1, 0, GTK_ACCEL_LOCKED); + */ + + /* ...while using this internal stuff works */ gtk_accel_group_add (accel_group, GDK_F1, 0, 0, GTK_OBJECT (widget), "help"); gtk_accel_group_attach (accel_group, GTK_OBJECT (widget)); diff --git a/app/gimpimage-convert.c b/app/gimpimage-convert.c index 7525cc7742..a7cb549006 100644 --- a/app/gimpimage-convert.c +++ b/app/gimpimage-convert.c @@ -490,7 +490,7 @@ convert_to_indexed (GimpImage *gimage) dialog->shell = gimp_dialog_new (_("Indexed Color Conversion"), "indexed_color_conversion", gimp_standard_help_func, - "dialogs/indexed_color_conversion_dialog.html", + "dialogs/convert_to_indexed.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gimpimage-duplicate.c b/app/gimpimage-duplicate.c index c61e6748ee..6fc3662023 100644 --- a/app/gimpimage-duplicate.c +++ b/app/gimpimage-duplicate.c @@ -85,7 +85,7 @@ channel_ops_offset (GimpImage* gimage) off_d->dlg = gimp_dialog_new (_("Offset"), "offset", gimp_standard_help_func, - "dialogs/offset_dialog.html", + "dialogs/offset.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gimprc.c b/app/gimprc.c index 27bb560b92..aa531fb1e4 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -157,7 +157,7 @@ int show_indicators = TRUE; int max_new_image_size = 33554432; /* 32 MB */ int thumbnail_mode = 1; int trust_dirty_flag = FALSE; -int use_help = FALSE; +int use_help = TRUE; extern char * module_db_load_inhibit; diff --git a/app/gimpui.c b/app/gimpui.c index d5380d3ceb..9a981ae3a1 100644 --- a/app/gimpui.c +++ b/app/gimpui.c @@ -51,7 +51,7 @@ gimp_dialog_delete_callback (GtkWidget *widget, } /* -#include "/home/mitschel/gimpfiles/wilber.xpm" +#include "/home/mitch/gimp.xpm" static void gimp_dialog_realize_callback (GtkWidget *widget, @@ -68,7 +68,7 @@ gimp_dialog_realize_callback (GtkWidget *widget, gdk_pixmap_create_from_xpm_d (widget->window, &wilber_mask, &style->bg[GTK_STATE_NORMAL], - wilber_xpm); + gimp_xpm); gdk_window_set_icon (widget->window, NULL, wilber_pixmap, wilber_mask); @@ -86,11 +86,12 @@ gimp_dialog_new (const gchar *title, gint auto_shrink, /* specify action area buttons as va_list: - * gchar *label, - * GtkSignalFunc callback, - * gpointer data, - * gboolean default_action, - * gboolean connect_delete, + * gchar *label, + * GtkSignalFunc callback, + * gpointer data, + * GtkWidget **widget_ptr, + * gboolean default_action, + * gboolean connect_delete, */ ...) @@ -219,7 +220,6 @@ gimp_dialog_newv (const gchar *title, gtk_signal_connect (GTK_OBJECT (dialog), "realize", (GtkSignalFunc) gimp_dialog_realize_callback, NULL); - */ /* connect the "F1" help key */ diff --git a/app/global_edit.c b/app/global_edit.c index 2aa1d78983..522d1e458e 100644 --- a/app/global_edit.c +++ b/app/global_edit.c @@ -703,7 +703,7 @@ paste_named_buffer (GDisplay *gdisp) pn_dlg->shell = gimp_dialog_new (_("Paste Named Buffer"), "paste_named_buffer", gimp_standard_help_func, - "dialogs/paste_named_buffer_dialog.html", + "dialogs/paste_named.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -806,7 +806,7 @@ named_edit_cut (void *gdisp_ptr) qbox = gimp_query_string_box (_("Cut Named"), gimp_standard_help_func, - "dialogs/cut_named_dialog.html", + "dialogs/cut_named.html", _("Enter a name for this buffer"), NULL, GTK_OBJECT (gdisp->gimage), "destroy", @@ -843,7 +843,7 @@ named_edit_copy (void *gdisp_ptr) qbox = gimp_query_string_box (_("Copy Named"), gimp_standard_help_func, - "dialogs/copy_named_dialog.html", + "dialogs/copy_named.html", _("Enter a name for this buffer"), NULL, GTK_OBJECT (gdisp->gimage), "destroy", diff --git a/app/gradient.c b/app/gradient.c index b2aff31b1f..0711514fca 100644 --- a/app/gradient.c +++ b/app/gradient.c @@ -685,7 +685,7 @@ grad_create_gradient_editor_init (gint need_show) /* Shell and main vbox */ g_editor->shell = gimp_dialog_new (_("Gradient Editor"), "gradient_editor", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/index.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -1325,7 +1325,7 @@ ed_new_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("New gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/new_gradient.html", _("Enter a name for the new gradient"), _("untitled"), NULL, NULL, @@ -1388,7 +1388,7 @@ ed_copy_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Copy gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/copy_gradient.html", _("Enter a name for the copied gradient"), name, NULL, NULL, @@ -1474,7 +1474,7 @@ ed_rename_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Rename gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/rename_gradient.html", _("Enter a new name for the gradient"), curr_gradient->name, NULL, NULL, @@ -1556,7 +1556,7 @@ ed_delete_gradient_callback (GtkWidget *widget, dialog = gimp_dialog_new (_("Delete gradient"), "delete_gradient", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/delete_gradient.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -1682,7 +1682,7 @@ ed_save_pov_callback (GtkWidget *widget, /* Connect the "F1" help key */ gimp_help_connect_help_accel (window, gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html"); + "dialogs/gradient_editor/dialogs/save_as_pov_ray.html"); gtk_widget_show (window); gtk_widget_set_sensitive (g_editor->shell, FALSE); @@ -4612,7 +4612,7 @@ cpopup_split_uniform_callback (GtkWidget *widget, _("Split segments uniformly"), "gradient_segment_split_uniformly", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/split_segments_uniformly.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -5171,7 +5171,7 @@ cpopup_replicate_callback (GtkWidget *widget, _("Replicate selection"), "gradient_segment_replicate", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/replicate_segment.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/gradient_editor.c b/app/gradient_editor.c index b2aff31b1f..0711514fca 100644 --- a/app/gradient_editor.c +++ b/app/gradient_editor.c @@ -685,7 +685,7 @@ grad_create_gradient_editor_init (gint need_show) /* Shell and main vbox */ g_editor->shell = gimp_dialog_new (_("Gradient Editor"), "gradient_editor", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/index.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -1325,7 +1325,7 @@ ed_new_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("New gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/new_gradient.html", _("Enter a name for the new gradient"), _("untitled"), NULL, NULL, @@ -1388,7 +1388,7 @@ ed_copy_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Copy gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/copy_gradient.html", _("Enter a name for the copied gradient"), name, NULL, NULL, @@ -1474,7 +1474,7 @@ ed_rename_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Rename gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/rename_gradient.html", _("Enter a new name for the gradient"), curr_gradient->name, NULL, NULL, @@ -1556,7 +1556,7 @@ ed_delete_gradient_callback (GtkWidget *widget, dialog = gimp_dialog_new (_("Delete gradient"), "delete_gradient", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/delete_gradient.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -1682,7 +1682,7 @@ ed_save_pov_callback (GtkWidget *widget, /* Connect the "F1" help key */ gimp_help_connect_help_accel (window, gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html"); + "dialogs/gradient_editor/dialogs/save_as_pov_ray.html"); gtk_widget_show (window); gtk_widget_set_sensitive (g_editor->shell, FALSE); @@ -4612,7 +4612,7 @@ cpopup_split_uniform_callback (GtkWidget *widget, _("Split segments uniformly"), "gradient_segment_split_uniformly", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/split_segments_uniformly.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -5171,7 +5171,7 @@ cpopup_replicate_callback (GtkWidget *widget, _("Replicate selection"), "gradient_segment_replicate", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/replicate_segment.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/gradient_select.c b/app/gradient_select.c index 75591d0a96..58425c2709 100644 --- a/app/gradient_select.c +++ b/app/gradient_select.c @@ -447,7 +447,7 @@ gsel_new_selection (gchar *title, gsp->shell = gimp_dialog_new (title ? title : _("Gradient Selection"), "gradient_selection", gimp_standard_help_func, - "dialogs/gradient_selection_dialog.html", + "dialogs/gradient_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gui/brush-editor.c b/app/gui/brush-editor.c index 4541982c79..ea0ff0610e 100644 --- a/app/gui/brush-editor.c +++ b/app/gui/brush-editor.c @@ -207,7 +207,7 @@ brush_edit_generated_new () begw->shell = gimp_dialog_new (_("Brush Editor"), "generated_brush_editor", gimp_standard_help_func, - "dialogs/generated_brush_editor_dialog.html", + "dialogs/generated_brush_editor.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gui/brush-select.c b/app/gui/brush-select.c index 967d5ba394..517aae0b25 100644 --- a/app/gui/brush-select.c +++ b/app/gui/brush-select.c @@ -200,7 +200,7 @@ brush_select_new (gchar *title, { bsp->shell = gimp_dialog_new (title, "brush_selection", gimp_standard_help_func, - "dialogs/brush_selection_dialog.html", + "dialogs/brush_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -218,7 +218,7 @@ brush_select_new (gchar *title, { bsp->shell = gimp_dialog_new (_("Brush Selection"), "brush_selection", gimp_standard_help_func, - "dialogs/brush_selection_dialog.html", + "dialogs/brush_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gui/channels-dialog.c b/app/gui/channels-dialog.c index 65eb33dae3..b49f49494e 100644 --- a/app/gui/channels-dialog.c +++ b/app/gui/channels-dialog.c @@ -2391,7 +2391,7 @@ channels_dialog_new_channel_query (GimpImage* gimage) options->query_box = gimp_dialog_new (_("New Channel Options"), "new_channel_options", gimp_standard_help_func, - "dialogs/channels_dialog.html", + "dialogs/channels/dialogs/new_channel.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -2565,7 +2565,7 @@ channels_dialog_edit_channel_query (ChannelWidget *channel_widget) options->query_box = gimp_dialog_new (_("Edit Channel Attributes"), "edit_channel_attributes", gimp_standard_help_func, - "dialogs/channels_dialog.html", + "dialogs/channels/dialogs/edit_channel_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/gui/color-notebook.c b/app/gui/color-notebook.c index 39976e007a..7875d62d78 100644 --- a/app/gui/color-notebook.c +++ b/app/gui/color-notebook.c @@ -37,11 +37,14 @@ static void color_notebook_ok_callback (GtkWidget *, gpointer); static void color_notebook_cancel_callback (GtkWidget *, gpointer); static void color_notebook_update_callback (void *, int, int, int); -static void color_notebook_page_switch (GtkWidget *, GtkNotebookPage *, guint); +static void color_notebook_page_switch (GtkWidget *, GtkNotebookPage *, + guint); +static void color_notebook_help_func (gpointer data); /* information we keep on each registered colour selector */ typedef struct _ColorSelectorInfo { char *name; /* label used in notebook tab */ + char *help_page; GimpColorSelectorMethods m; int refs; /* number of instances around */ gboolean active; @@ -100,8 +103,7 @@ color_notebook_new (int r, cnp->shell = gimp_dialog_new (_("Color Selection"), "color_selection", - gimp_standard_help_func, - "dialogs/color_notebook_dialog.html", + color_notebook_help_func, cnp, GTK_WIN_POS_NONE, FALSE, FALSE, FALSE, @@ -134,7 +136,7 @@ color_notebook_new (int r, if (info->active) { - csel = g_malloc (sizeof (ColorSelectorInstance)); + csel = g_new (ColorSelectorInstance, 1); csel->color_notebook = cnp; csel->info = info; info->refs++; @@ -336,12 +338,28 @@ color_notebook_page_switch (GtkWidget *widget, TRUE); } +static void +color_notebook_help_func (gpointer data) +{ + ColorNotebookP cnp; + gchar *help_path; + + cnp = (ColorNotebookP) data; + + help_path = g_strconcat ("dialogs/color_selectors/", + cnp->cur_page->info->help_page, + NULL); + gimp_help (help_path); + g_free (help_path); +} + /**************************************************************/ /* Registration functions */ G_MODULE_EXPORT GimpColorSelectorID gimp_color_selector_register (const char *name, + const char *help_page, GimpColorSelectorMethods *methods) { ColorSelectorInfo *info; @@ -355,9 +373,10 @@ gimp_color_selector_register (const char *name, info = info->next; } - info = g_malloc (sizeof (ColorSelectorInfo)); + info = g_new (ColorSelectorInfo, 1); info->name = g_strdup (name); + info->help_page = g_strdup (help_page); info->m = *methods; info->refs = 0; info->active = TRUE; diff --git a/app/gui/color-select.c b/app/gui/color-select.c index 8222bbd0c0..81fde9defe 100644 --- a/app/gui/color-select.c +++ b/app/gui/color-select.c @@ -45,6 +45,13 @@ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | \ GDK_BUTTON1_MOTION_MASK | GDK_ENTER_NOTIFY_MASK +typedef enum +{ + COLOR_SELECT_OK, + COLOR_SELECT_CANCEL, + COLOR_SELECT_UPDATE +} ColorSelectState; + typedef enum { HUE = 0, @@ -72,6 +79,33 @@ typedef enum UPDATE_CALLER = 1 << 6 } ColorSelectUpdateType; +typedef void (*ColorSelectCallback) (gint, gint, gint, ColorSelectState, void *); + +typedef struct _ColorSelect ColorSelect, *ColorSelectP; + +struct _ColorSelect +{ + GtkWidget *xy_color; + GtkWidget *z_color; + GtkWidget *new_color; + GtkWidget *orig_color; + GtkWidget *toggles[6]; + GtkWidget *entries[6]; + GtkWidget *hex_entry; + GtkAdjustment *slider_data[6]; + + gint pos[3]; + gint values[6]; + gint z_color_fill; + gint xy_color_fill; + gint orig_values[3]; + gboolean wants_updates; + GdkGC *gc; + + ColorSelectCallback callback; + void *client_data; +}; + typedef struct _ColorSelectFill ColorSelectFill; typedef void (*ColorSelectFillUpdateProc) (ColorSelectFill *); @@ -110,8 +144,6 @@ static void color_select_update_sliders (ColorSelect *, gint); static void color_select_update_entries (ColorSelect *, gint); static void color_select_update_colors (ColorSelect *, gint); -static void color_select_ok_callback (GtkWidget *, gpointer); -static void color_select_cancel_callback (GtkWidget *, gpointer); static gint color_select_xy_expose (GtkWidget *, GdkEventExpose *, ColorSelect *); static gint color_select_xy_events (GtkWidget *, GdkEvent *, @@ -180,60 +212,22 @@ static GtkTargetEntry color_select_target_table[] = static guint n_color_select_targets = (sizeof (color_select_target_table) / sizeof (color_select_target_table[0])); -ColorSelect * -color_select_new (gint r, - gint g, - gint b, - ColorSelectCallback callback, - gpointer data, - gboolean wants_updates) + +/* Register the GIMP colour selector with the color notebook */ +void +color_select_init (void) { - ColorSelect *csp; - GtkWidget *main_vbox; + GimpColorSelectorMethods methods = + { + color_select_notebook_new, + color_select_notebook_free, + color_select_notebook_setcolor + }; - csp = g_new (ColorSelect, 1); - - csp->callback = callback; - csp->client_data = data; - csp->z_color_fill = HUE; - csp->xy_color_fill = SATURATION_VALUE; - csp->gc = NULL; - csp->wants_updates = wants_updates; - - csp->values[RED] = csp->orig_values[0] = r; - csp->values[GREEN] = csp->orig_values[1] = g; - csp->values[BLUE] = csp->orig_values[2] = b; - color_select_update_hsv_values (csp); - color_select_update_pos (csp); - - csp->shell = - gimp_dialog_new (_("Color Selection"), "color_selection", - gimp_standard_help_func, - "dialogs/color_selection_dialog.html", - GTK_WIN_POS_NONE, - FALSE, FALSE, FALSE, - - wants_updates ? _("Close") : _("OK"), - color_select_ok_callback, - csp, NULL, TRUE, FALSE, - wants_updates ? _("Revert to Old Color") : _("Cancel"), - color_select_cancel_callback, - csp, NULL, FALSE, TRUE, - - NULL); - - main_vbox = color_select_widget_new (csp, r, g, b); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (csp->shell)->vbox), main_vbox); - gtk_widget_show (main_vbox); - - color_select_image_fill (csp->z_color, csp->z_color_fill, csp->values); - color_select_image_fill (csp->xy_color, csp->xy_color_fill, csp->values); - - gtk_widget_show (csp->shell); - - return csp; + gimp_color_selector_register ("GIMP", "built_in.html", &methods); } + static GtkWidget * color_select_widget_new (ColorSelect *csp, gint r, @@ -504,47 +498,7 @@ color_select_drag_old_color (GtkWidget *widget, *b = (guchar) csp->orig_values[2]; } -/* Register the GIMP colour selector with the color notebook */ -void -color_select_init (void) -{ - GimpColorSelectorMethods methods = - { - color_select_notebook_new, - color_select_notebook_free, - color_select_notebook_setcolor - }; - - gimp_color_selector_register ("GIMP", &methods); -} - -void -color_select_show (ColorSelect *csp) -{ - if (csp) - gtk_widget_show (csp->shell); -} - -void -color_select_hide (ColorSelect *csp) -{ - if (csp) - gtk_widget_hide (csp->shell); -} - -void -color_select_free (ColorSelect *csp) -{ - if (csp) - { - if (csp->shell) - gtk_widget_destroy (csp->shell); - gdk_gc_destroy (csp->gc); - g_free (csp); - } -} - -void +static void color_select_set_color (ColorSelect *csp, gint r, gint g, @@ -963,42 +917,6 @@ color_select_update_colors (ColorSelect *csp, } } -static void -color_select_ok_callback (GtkWidget *widget, - gpointer data) -{ - ColorSelect *csp; - - csp = (ColorSelect *) data; - if (csp) - { - if (csp->callback) - (* csp->callback) (csp->values[RED], - csp->values[GREEN], - csp->values[BLUE], - COLOR_SELECT_OK, - csp->client_data); - } -} - -static void -color_select_cancel_callback (GtkWidget *widget, - gpointer data) -{ - ColorSelect *csp; - - csp = (ColorSelect *) data; - if (csp) - { - if (csp->callback) - (* csp->callback) (csp->orig_values[0], - csp->orig_values[1], - csp->orig_values[2], - COLOR_SELECT_CANCEL, - csp->client_data); - } -} - static gint color_select_xy_expose (GtkWidget *widget, GdkEventExpose *event, @@ -2176,9 +2094,6 @@ color_select_notebook_new (gint r, glue->main_vbox = color_select_widget_new (csp, r, g, b); - /* the shell is provided by the notebook */ - csp->shell = NULL; - color_select_image_fill (csp->z_color, csp->z_color_fill, csp->values); color_select_image_fill (csp->xy_color, csp->xy_color_fill, csp->values); @@ -2186,13 +2101,13 @@ color_select_notebook_new (gint r, return glue->main_vbox; } - static void color_select_notebook_free (void *data) { notebook_glue *glue = data; - color_select_free (glue->csp); + gdk_gc_destroy (glue->csp->gc); + g_free (glue->csp); /* don't need to destroy the widget, since it's done by the caller * of this function */ g_free (glue); diff --git a/app/gui/color-select.h b/app/gui/color-select.h index a736c0c8d4..6486277f7b 100644 --- a/app/gui/color-select.h +++ b/app/gui/color-select.h @@ -18,53 +18,6 @@ #ifndef __COLOR_SELECT_H__ #define __COLOR_SELECT_H__ -typedef enum -{ - COLOR_SELECT_OK, - COLOR_SELECT_CANCEL, - COLOR_SELECT_UPDATE -} ColorSelectState; - -typedef void (*ColorSelectCallback) (gint, gint, gint, ColorSelectState, void *); - -typedef struct _ColorSelect ColorSelect, *ColorSelectP; - -struct _ColorSelect -{ - GtkWidget *shell; - GtkWidget *xy_color; - GtkWidget *z_color; - GtkWidget *new_color; - GtkWidget *orig_color; - GtkWidget *toggles[6]; - GtkWidget *entries[6]; - GtkWidget *hex_entry; - GtkAdjustment *slider_data[6]; - - gint pos[3]; - gint values[6]; - gint z_color_fill; - gint xy_color_fill; - gint orig_values[3]; - gboolean wants_updates; - GdkGC *gc; - - ColorSelectCallback callback; - void *client_data; -}; - void color_select_init (void); -ColorSelectP color_select_new (gint r, - gint g, - gint b, - ColorSelectCallback callback, - gpointer client_data, - gboolean wants_update); -void color_select_show (ColorSelectP); -void color_select_hide (ColorSelectP); -void color_select_free (ColorSelectP); -void color_select_set_color (ColorSelectP, - gint, gint, gint, gint); - #endif /* __COLOR_SELECT_H__ */ diff --git a/app/gui/commands.c b/app/gui/commands.c index 9dc31ff075..344533c4e2 100644 --- a/app/gui/commands.c +++ b/app/gui/commands.c @@ -352,7 +352,7 @@ select_border_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Border Selection"), gimp_standard_help_func, - "dialogs/border_selection_dialog.html", + "dialogs/border_selection.html", _("Border selection by:"), selection_border_radius, 1, 32767, 0, gdisp->gimage->unit, @@ -375,7 +375,7 @@ select_feather_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Feather Selection"), gimp_standard_help_func, - "dialogs/feather_selection_dialog.html", + "dialogs/feather_selection.html", _("Feather selection by:"), selection_feather_radius, 0, 32767, 3, gdisp->gimage->unit, @@ -398,7 +398,7 @@ select_grow_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Grow Selection"), gimp_standard_help_func, - "dialogs/grow_selection_dialog.html", + "dialogs/grow_selection.html", _("Grow selection by:"), selection_grow_pixels, 1, 32767, 0, gdisp->gimage->unit, @@ -423,7 +423,7 @@ select_shrink_cmd_callback (GtkWidget *widget, shrink_dialog = gimp_query_size_box (N_("Shrink Selection"), gimp_standard_help_func, - "dialogs/shrink_selection_dialog.html", + "dialogs/shrink_selection.html", N_("Shrink selection by:"), selection_shrink_pixels, 1, 32767, 0, gdisp->gimage->unit, @@ -1195,7 +1195,7 @@ void gimp_help_cmd_callback (GtkWidget *widget, gpointer client_data) { - gimp_help (""); + gimp_help (NULL); } void diff --git a/app/gui/device-status-dialog.c b/app/gui/device-status-dialog.c index 4ca834935d..86edffc323 100644 --- a/app/gui/device-status-dialog.c +++ b/app/gui/device-status-dialog.c @@ -185,7 +185,7 @@ create_input_dialog (void) /* Connect the "F1" help key */ gimp_help_connect_help_accel (inputd, gimp_standard_help_func, - "dialogs/input_devices_dialog.html"); + "dialogs/input_devices.html"); gtk_widget_show (inputd); } @@ -706,7 +706,7 @@ create_device_status (void) deviceD->shell = gimp_dialog_new (_("Device Status"), "device_status", gimp_standard_help_func, - "dialogs/device_status_dialog.html", + "dialogs/device_status.html", GTK_WIN_POS_NONE, FALSE, FALSE, TRUE, diff --git a/app/gui/file-new-dialog.c b/app/gui/file-new-dialog.c index f23969962d..7ecf825f14 100644 --- a/app/gui/file-new-dialog.c +++ b/app/gui/file-new-dialog.c @@ -187,7 +187,7 @@ file_new_confirm_dialog (NewImageInfo *info) info->confirm_dlg = gimp_dialog_new (_("Confirm Image Size"), "confirm_size", gimp_standard_help_func, - "dialogs/file_new_dialog.html#confirm_size_dialog", + "dialogs/file_new.html#confirm_size", GTK_WIN_POS_MOUSE, FALSE, FALSE, FALSE, @@ -367,7 +367,7 @@ ui_new_image_window_create (const GimpImageNewValues *values_orig) info->dlg = gimp_dialog_new (_("New Image"), "new_image", gimp_standard_help_func, - "dialogs/file_new_dialog.html", + "dialogs/file_new.html", GTK_WIN_POS_MOUSE, FALSE, FALSE, TRUE, diff --git a/app/gui/gradient-editor.c b/app/gui/gradient-editor.c index b2aff31b1f..0711514fca 100644 --- a/app/gui/gradient-editor.c +++ b/app/gui/gradient-editor.c @@ -685,7 +685,7 @@ grad_create_gradient_editor_init (gint need_show) /* Shell and main vbox */ g_editor->shell = gimp_dialog_new (_("Gradient Editor"), "gradient_editor", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/index.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -1325,7 +1325,7 @@ ed_new_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("New gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/new_gradient.html", _("Enter a name for the new gradient"), _("untitled"), NULL, NULL, @@ -1388,7 +1388,7 @@ ed_copy_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Copy gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/copy_gradient.html", _("Enter a name for the copied gradient"), name, NULL, NULL, @@ -1474,7 +1474,7 @@ ed_rename_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Rename gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/rename_gradient.html", _("Enter a new name for the gradient"), curr_gradient->name, NULL, NULL, @@ -1556,7 +1556,7 @@ ed_delete_gradient_callback (GtkWidget *widget, dialog = gimp_dialog_new (_("Delete gradient"), "delete_gradient", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/delete_gradient.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -1682,7 +1682,7 @@ ed_save_pov_callback (GtkWidget *widget, /* Connect the "F1" help key */ gimp_help_connect_help_accel (window, gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html"); + "dialogs/gradient_editor/dialogs/save_as_pov_ray.html"); gtk_widget_show (window); gtk_widget_set_sensitive (g_editor->shell, FALSE); @@ -4612,7 +4612,7 @@ cpopup_split_uniform_callback (GtkWidget *widget, _("Split segments uniformly"), "gradient_segment_split_uniformly", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/split_segments_uniformly.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -5171,7 +5171,7 @@ cpopup_replicate_callback (GtkWidget *widget, _("Replicate selection"), "gradient_segment_replicate", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/replicate_segment.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/gui/gradient-select.c b/app/gui/gradient-select.c index 75591d0a96..58425c2709 100644 --- a/app/gui/gradient-select.c +++ b/app/gui/gradient-select.c @@ -447,7 +447,7 @@ gsel_new_selection (gchar *title, gsp->shell = gimp_dialog_new (title ? title : _("Gradient Selection"), "gradient_selection", gimp_standard_help_func, - "dialogs/gradient_selection_dialog.html", + "dialogs/gradient_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gui/help-commands.c b/app/gui/help-commands.c index 9dc31ff075..344533c4e2 100644 --- a/app/gui/help-commands.c +++ b/app/gui/help-commands.c @@ -352,7 +352,7 @@ select_border_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Border Selection"), gimp_standard_help_func, - "dialogs/border_selection_dialog.html", + "dialogs/border_selection.html", _("Border selection by:"), selection_border_radius, 1, 32767, 0, gdisp->gimage->unit, @@ -375,7 +375,7 @@ select_feather_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Feather Selection"), gimp_standard_help_func, - "dialogs/feather_selection_dialog.html", + "dialogs/feather_selection.html", _("Feather selection by:"), selection_feather_radius, 0, 32767, 3, gdisp->gimage->unit, @@ -398,7 +398,7 @@ select_grow_cmd_callback (GtkWidget *widget, qbox = gimp_query_size_box (_("Grow Selection"), gimp_standard_help_func, - "dialogs/grow_selection_dialog.html", + "dialogs/grow_selection.html", _("Grow selection by:"), selection_grow_pixels, 1, 32767, 0, gdisp->gimage->unit, @@ -423,7 +423,7 @@ select_shrink_cmd_callback (GtkWidget *widget, shrink_dialog = gimp_query_size_box (N_("Shrink Selection"), gimp_standard_help_func, - "dialogs/shrink_selection_dialog.html", + "dialogs/shrink_selection.html", N_("Shrink selection by:"), selection_shrink_pixels, 1, 32767, 0, gdisp->gimage->unit, @@ -1195,7 +1195,7 @@ void gimp_help_cmd_callback (GtkWidget *widget, gpointer client_data) { - gimp_help (""); + gimp_help (NULL); } void diff --git a/app/gui/input-dialog.c b/app/gui/input-dialog.c index 4ca834935d..86edffc323 100644 --- a/app/gui/input-dialog.c +++ b/app/gui/input-dialog.c @@ -185,7 +185,7 @@ create_input_dialog (void) /* Connect the "F1" help key */ gimp_help_connect_help_accel (inputd, gimp_standard_help_func, - "dialogs/input_devices_dialog.html"); + "dialogs/input_devices.html"); gtk_widget_show (inputd); } @@ -706,7 +706,7 @@ create_device_status (void) deviceD->shell = gimp_dialog_new (_("Device Status"), "device_status", gimp_standard_help_func, - "dialogs/device_status_dialog.html", + "dialogs/device_status.html", GTK_WIN_POS_NONE, FALSE, FALSE, TRUE, diff --git a/app/gui/layers-dialog.c b/app/gui/layers-dialog.c index 2f95e0694e..fe42e08f06 100644 --- a/app/gui/layers-dialog.c +++ b/app/gui/layers-dialog.c @@ -3302,7 +3302,7 @@ layers_dialog_new_layer_query (GimpImage* gimage) options->query_box = gimp_dialog_new (_("New Layer Options"), "new_layer_options", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/new_layer.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -3508,7 +3508,7 @@ layers_dialog_edit_layer_query (LayerWidget *layer_widget) options->query_box = gimp_dialog_new (_("Edit Layer Attributes"), "edit_layer_attributes", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/edit_layer_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -3633,7 +3633,7 @@ layers_dialog_add_mask_query (Layer *layer) options->query_box = gimp_dialog_new (_("Add Mask Options"), "add_mask_options", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/add_mask.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -3745,7 +3745,7 @@ layers_dialog_apply_mask_query (Layer *layer) options->query_box = gimp_dialog_new (_("Layer Mask Options"), "layer_mask_options", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/apply_mask.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -4034,7 +4034,7 @@ layers_dialog_layer_merge_query (GImage *gimage, options->query_box = gimp_dialog_new (_("Layer Merge Options"), "layer_merge_options", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/merge_visible_layers.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/gui/menus.c b/app/gui/menus.c index 5550911d3a..98c1e5694c 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -17,13 +17,14 @@ */ #include #include +#include + #include "appenv.h" #include "channels_dialog.h" #include "colormaps.h" #include "commands.h" #include "dialog_handler.h" #include "fileops.h" -#include "general.h" #include "gimprc.h" #include "interface.h" #include "layers_dialog.h" @@ -43,6 +44,16 @@ #define MRU_MENU_ENTRY_SIZE (strlen (_("/File/MRU00 ")) + 1) #define MRU_MENU_ACCEL_SIZE sizeof ("0") +typedef struct _GimpItemFactoryEntry GimpItemFactoryEntry; + +struct _GimpItemFactoryEntry +{ + GtkItemFactoryEntry entry; + + gchar *help_page; + gchar *description; +}; + static char* G_GNUC_UNUSED dummyMenus[] = { N_("/File/MRU00 "), N_("/File"), N_("/File/Dialogs"), @@ -53,8 +64,12 @@ static char* G_GNUC_UNUSED dummyMenus[] = { N_("/File/MRU00 "), N_("/View/Zoom"), N_("/Stack")}; +static void menus_create_item (GtkItemFactory *item_factory, + GimpItemFactoryEntry *entry, + gpointer callback_data, + guint callback_type); static void menus_init (void); -static gchar* menu_translate (const gchar *path, +static gchar *menu_translate (const gchar *path, gpointer data); static void tearoff_cmd_callback (GtkWidget *widget, gpointer callback_data, @@ -62,184 +77,342 @@ static void tearoff_cmd_callback (GtkWidget *widget, static GSList *last_opened_raw_filenames = NULL; -static GtkItemFactoryEntry toolbox_entries[] = +static GimpItemFactoryEntry toolbox_entries[] = { - { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/New"), "N", file_new_cmd_callback, 0 }, - { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, - { N_("/File/Acquire"), NULL, NULL, 0, "" }, - { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, - { N_("/File/Help..."), NULL, gimp_help_cmd_callback, 0 }, - { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, - { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, + { { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/New"), "N", file_new_cmd_callback, 0 }, + "file/dialogs/file_new.html", NULL }, + { { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, + "file/dialogs/file_open.html", NULL }, + { { N_("/File/Acquire/tearoff1"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, + "file/dialogs/about.html", NULL }, + { { N_("/File/Help..."), NULL, gimp_help_cmd_callback, 0 }, + "file/dialogs/help.html", NULL }, + { { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, + "file/dialogs/preferences.html", NULL }, + { { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, + "file/dialogs/tip_of_the_day.html", NULL }, - { N_("/File/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, - { N_("/File/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, - { N_("/File/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, - { N_("/File/Dialogs/Gradient..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, - { N_("/File/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/File/Dialogs/Tool Options..."), "T", dialogs_tools_options_cmd_callback, 0 }, - { N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, - { N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, - { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, - { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, - { N_("/File/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + { { N_("/File/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, + "file/dialogs/brush_selection.html", NULL }, + { { N_("/File/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, + "file/dialogs/pattern_selection.html", NULL }, + { { N_("/File/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, + "file/dialogs/palette_selection.html", NULL }, + { { N_("/File/Dialogs/Gradients..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, + "file/dialogs/gradient_selection.html", NULL }, + { { N_("/File/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "file/dialogs/layers_and_channels.html", NULL }, + { { N_("/File/Dialogs/Tool Options..."), "T", dialogs_tools_options_cmd_callback, 0 }, + "file/dialogs/tool_options.html", NULL }, + { { N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, + "file/dialogs/input_devices.html", NULL }, + { { N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, + "file/dialogs/device_status.html", NULL }, + { { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, + "file/dialogs/document_index.html", NULL }, + { { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, + "file/dialogs/error_console.html", NULL }, + { { N_("/File/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + "file/dialogs/display_filters.html", NULL }, - { N_("/Xtns/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 }, - { N_("/File/---"), NULL, NULL, 0, "" }, - { N_("/File/---"), NULL, NULL, 0, "" } + { { N_("/Xtns/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 }, + "xtns/module_browser.html", NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, }; -static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); +static guint n_toolbox_entries = (sizeof (toolbox_entries) / + sizeof (toolbox_entries[0])); static GtkItemFactory *toolbox_factory = NULL; -static GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "" }; -static GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }; +static GimpItemFactoryEntry file_menu_separator = +{ { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }; -static GtkItemFactoryEntry image_entries[] = +static GimpItemFactoryEntry toolbox_end = +{ { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, + "file/dialogs/quit.html", NULL }; + +static GimpItemFactoryEntry image_entries[] = { - { N_("/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/New"), "N", file_new_cmd_callback, 1 }, - { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, - { N_("/File/Save"), "S", file_save_cmd_callback, 0 }, - { N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 }, - { N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 }, - { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, - { N_("/File/---"), NULL, NULL, 0, "" }, + { { N_("/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/New"), "N", file_new_cmd_callback, 1 }, + "file/dialogs/file_new.html", NULL }, + { { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, + "file/dialogs/file_open.html", NULL }, + { { N_("/File/Save"), "S", file_save_cmd_callback, 0 }, + "file/dialogs/file_save.html", NULL }, + { { N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 }, + "file/dialogs/save_as.html", NULL }, + { { N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 }, + "file/revert.html", NULL }, + { { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, + "file/dialogs/preferences.html", NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/File/Close"), "W", file_close_cmd_callback, 0 }, - { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, - { N_("/File/---moved"), NULL, NULL, 0, "" }, + { { N_("/File/Close"), "W", file_close_cmd_callback, 0 }, + "file/close.html", NULL }, + { { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, + "file/dialogs/quit.html", NULL }, + { { N_("/File/---moved"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Edit/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Edit/Cut"), "X", edit_cut_cmd_callback, 0 }, - { N_("/Edit/Copy"), "C", edit_copy_cmd_callback, 0 }, - { N_("/Edit/Paste"), "V", edit_paste_cmd_callback, 0 }, - { N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 }, - { N_("/Edit/Paste As New"), NULL, edit_paste_as_new_cmd_callback, 0 }, - { N_("/Edit/---"), NULL, NULL, 0, "" }, - { N_("/Edit/Clear"), "K", edit_clear_cmd_callback, 0 }, - { N_("/Edit/Fill"), "period", edit_fill_cmd_callback, 0 }, - { N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 }, - { N_("/Edit/Undo"), "Z", edit_undo_cmd_callback, 0 }, - { N_("/Edit/Redo"), "R", edit_redo_cmd_callback, 0 }, - { N_("/Edit/Undo history..."), NULL, edit_show_undo_history_cmd_callback, 0}, - { N_("/Edit/---"), NULL, NULL, 0, "" }, - { N_("/Edit/Cut Named"), "X", edit_named_cut_cmd_callback, 0 }, - { N_("/Edit/Copy Named"), "C", edit_named_copy_cmd_callback, 0 }, - { N_("/Edit/Paste Named"), "V", edit_named_paste_cmd_callback, 0 }, - { N_("/Edit/---"), NULL, NULL, 0, "" }, + { { N_("/Edit/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Cut"), "X", edit_cut_cmd_callback, 0 }, + "edit/cut.html", NULL }, + { { N_("/Edit/Copy"), "C", edit_copy_cmd_callback, 0 }, + "edit/copy.html", NULL }, + { { N_("/Edit/Paste"), "V", edit_paste_cmd_callback, 0 }, + "edit/paste.html", NULL }, + { { N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 }, + "edit/paste_into.html", NULL }, + { { N_("/Edit/Paste As New"), NULL, edit_paste_as_new_cmd_callback, 0 }, + "edit/paste_as_new.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Clear"), "K", edit_clear_cmd_callback, 0 }, + "edit/clear.html", NULL }, + { { N_("/Edit/Fill"), "period", edit_fill_cmd_callback, 0 }, + "edit/fill.html", NULL }, + { { N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 }, + "edit/stroke.html", NULL }, + { { N_("/Edit/Undo"), "Z", edit_undo_cmd_callback, 0 }, + "edit/undo.html", NULL }, + { { N_("/Edit/Redo"), "R", edit_redo_cmd_callback, 0 }, + "edit/redo.html", NULL }, + { { N_("/Edit/Undo history..."), NULL, edit_show_undo_history_cmd_callback, 0}, + "edit/dialogs/undo_history.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Cut Named"), "X", edit_named_cut_cmd_callback, 0 }, + "edit/dialogs/cut_named.html", NULL }, + { { N_("/Edit/Copy Named"), "C", edit_named_copy_cmd_callback, 0 }, + "edit/dialogs/copy_named.html", NULL }, + { { N_("/Edit/Paste Named"), "V", edit_named_paste_cmd_callback, 0 }, + "edit/dialogs/paste_named.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Select/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Select/Invert"), "I", select_invert_cmd_callback, 0 }, - { N_("/Select/All"), "A", select_all_cmd_callback, 0 }, - { N_("/Select/None"), "A", select_none_cmd_callback, 0 }, - { N_("/Select/Float"), "L", select_float_cmd_callback, 0 }, - { N_("/Select/---"), NULL, NULL, 0, "" }, - { N_("/Select/Feather"), "F", select_feather_cmd_callback, 0 }, - { N_("/Select/Sharpen"), "H", select_sharpen_cmd_callback, 0 }, - { N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 }, - { N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 }, - { N_("/Select/Border"), "B", select_border_cmd_callback, 0 }, - { N_("/Select/---"), NULL, NULL, 0, "" }, - { N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 }, + { { N_("/Select/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Select/Invert"), "I", select_invert_cmd_callback, 0 }, + "select/invert.html", NULL }, + { { N_("/Select/All"), "A", select_all_cmd_callback, 0 }, + "select/all.html", NULL }, + { { N_("/Select/None"), "A", select_none_cmd_callback, 0 }, + "select/none.html", NULL }, + { { N_("/Select/Float"), "L", select_float_cmd_callback, 0 }, + "select/float.html", NULL }, + { { N_("/Select/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Select/Feather"), "F", select_feather_cmd_callback, 0 }, + "select/dialogs/feather_selection.html", NULL }, + { { N_("/Select/Sharpen"), "H", select_sharpen_cmd_callback, 0 }, + "select/sharpen.html", NULL }, + { { N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 }, + "select/dialogs/shrink_selection.html", NULL }, + { { N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 }, + "select/dialogs/grow_selection.html", NULL }, + { { N_("/Select/Border"), "B", select_border_cmd_callback, 0 }, + "select/dialogs/border_selection.html", NULL }, + { { N_("/Select/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 }, + "select/save_to_channel.html", NULL }, - { N_("/View/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 }, - { N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 }, - { N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 }, - { N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 }, - { N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 }, - { N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 }, - { N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 }, - { N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 }, - { N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 }, - { N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 }, - { N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 }, - { N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, ""}, - { N_("/View/Window Info..."), "I", view_window_info_cmd_callback, 0 }, - { N_("/View/Window Nav..."), NULL, view_window_nav_cmd_callback, 0 }, + { { N_("/View/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "" }, + "view/dot_for_dot.html", NULL }, + { { N_("/View/Info Window..."), "I", view_window_info_cmd_callback, 0 }, + "view/dialogs/info_window.html", NULL }, + { { N_("/View/Nav. Window..."), NULL, view_window_nav_cmd_callback, 0 }, + "view/dialogs/navigation_window.html", NULL }, - { N_("/View/---"), NULL, NULL, 0, "" }, - { N_("/View/Toggle Selection"), "T", view_toggle_selection_cmd_callback, 0, "" }, - { N_("/View/Toggle Rulers"), "R", view_toggle_rulers_cmd_callback, 0, "" }, - { N_("/View/Toggle Statusbar"), "S", view_toggle_statusbar_cmd_callback, 0, "" }, - { N_("/View/Toggle Guides"), "T", view_toggle_guides_cmd_callback, 0, "" }, - { N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "" }, - { N_("/View/---"), NULL, NULL, 0, "" }, + { { N_("/View/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/View/Toggle Selection"), "T", view_toggle_selection_cmd_callback, 0, "" }, + "view/toggle_selection.html", NULL }, + { { N_("/View/Toggle Rulers"), "R", view_toggle_rulers_cmd_callback, 0, "" }, + "view/toggle_rulers.html", NULL }, + { { N_("/View/Toggle Statusbar"), "S", view_toggle_statusbar_cmd_callback, 0, "" }, + "view/toggle_statusbar.html", NULL }, + { { N_("/View/Toggle Guides"), "T", view_toggle_guides_cmd_callback, 0, "" }, + "view/toggle_guides.html", NULL }, + { { N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "" }, + "view/snap_to_guides.html", NULL }, + { { N_("/View/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 }, - { N_("/View/Shrink Wrap"), "E", view_shrink_wrap_cmd_callback, 0 }, + { { N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 }, + "view/new_view.html", NULL }, + { { N_("/View/Shrink Wrap"), "E", view_shrink_wrap_cmd_callback, 0 }, + "view/shrink_wrap.html", NULL }, - { N_("/Image/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Colors/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 }, - { N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 }, - { N_("/Image/Colors/---"), NULL, NULL, 0, "" }, - { N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 }, - { N_("/Image/Channel Ops/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Channel Ops/Duplicate"), "D", channel_ops_duplicate_cmd_callback, 0 }, - { N_("/Image/Channel Ops/Offset"), "O", channel_ops_offset_cmd_callback, 0 }, - { N_("/Image/Alpha/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + { { N_("/Image/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 }, + "image/colors/equalize.html", NULL }, + { { N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 }, + "image/colors/invert.html", NULL }, + { { N_("/Image/Colors/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 }, + "image/colors/desaturate.html", NULL }, + + { { N_("/Image/Channels/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + + { { N_("/Image/Alpha/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + "layers/add_alpha_channel.html", NULL }, + + { { N_("/Image/Transforms/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Transforms/Offset"), "O", channel_ops_offset_cmd_callback, 0 }, + "image/transforms/dialogs/offset.html", NULL }, - { N_("/Image/---"), NULL, NULL, 0, "" }, - { N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 }, - { N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 }, - { N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 }, - { N_("/Image/---"), NULL, NULL, 0, "" }, - { N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 }, - { N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 }, - { N_("/Image/---"), NULL, NULL, 0, "" }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 }, + "image/convert_to_rgb.html", NULL }, + { { N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 }, + "image/convert_to_grayscale.html", NULL }, + { { N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 }, + "image/dialogs/convert_to_indexed.html", NULL }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 }, + "image/dialogs/resize_image.html", NULL }, + { { N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 }, + "image/dialogs/scale_image.html", NULL }, + { { N_("/Image/Duplicate"), "D", channel_ops_duplicate_cmd_callback, 0 }, + "image/duplicate.html", NULL }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Layers/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Layers/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/Layers/Stack/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 }, - { N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 }, - { N_("/Layers/Stack/Raise Layer"), "Prior", layers_raise_cmd_callback, 0 }, - { N_("/Layers/Stack/Lower Layer"), "Next", layers_lower_cmd_callback, 0 }, - { N_("/Layers/Stack/Layer to Top"), "Prior", layers_raise_to_top_cmd_callback, 0 }, - { N_("/Layers/Stack/Layer to Bottom"), "Next", layers_lower_to_bottom_cmd_callback, 0 }, - { N_("/Layers/---"), NULL, NULL, 0, "" }, - { N_("/Layers/Anchor Layer"), "H", layers_anchor_cmd_callback, 0 }, - { N_("/Layers/Merge Visible Layers"), "M", layers_merge_cmd_callback, 0 }, - { N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 }, - { N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 }, - { N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 }, - { N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, - { N_("/Layers/---"), NULL, NULL, 0, "" }, + { { N_("/Layers/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "layers/dialogs/layers_and_channels.html", NULL }, + { { N_("/Layers/Stack/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 }, + "layers/stack/index.html#previous_layer", NULL }, + { { N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 }, + "layers/stack/index.html#next_layer", NULL }, + { { N_("/Layers/Stack/Raise Layer"), "Prior", layers_raise_cmd_callback, 0 }, + "layers/stack/index.html#raise_layer", NULL }, + { { N_("/Layers/Stack/Lower Layer"), "Next", layers_lower_cmd_callback, 0 }, + "layers/stack/index.html#lower_layer", NULL }, + { { N_("/Layers/Stack/Layer to Top"), "Prior", layers_raise_to_top_cmd_callback, 0 }, + "layers/stack/index.html#layer_to_top", NULL }, + { { N_("/Layers/Stack/Layer to Bottom"), "Next", layers_lower_to_bottom_cmd_callback, 0 }, + "layers/stack/index.html#layer_to_bottom", NULL }, + { { N_("/Layers/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Anchor Layer"), "H", layers_anchor_cmd_callback, 0 }, + "layers/anchor_layer.html", NULL }, + { { N_("/Layers/Merge Visible Layers"), "M", layers_merge_cmd_callback, 0 }, + "layers/dialogs/layers/merge_visible_layers.html", NULL }, + { { N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 }, + "layers/flatten_image.html", NULL }, + { { N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 }, + "layers/alpha_to_selection.html", NULL }, + { { N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 }, + "layers/mask_to_selection.html", NULL }, + { { N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + "layers/add_alpha_channel.html", NULL }, + { { N_("/Layers/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Tools/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 }, - { N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 }, - { N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, - { N_("/Tools/---"), NULL, NULL, 0, "" }, + { { N_("/Tools/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 }, + "toolbox/index.html", NULL }, + { { N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 }, + "toolbox/index.html#default_colors", NULL }, + { { N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, + "toolbox/index.html#swap_colors", NULL }, + { { N_("/Tools/---"), NULL, NULL, 0, "" }, + NULL, NULL }, /* the tool entries themselves are built on the fly */ - { N_("/Filters/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Filters/Repeat last"), "F", filters_repeat_cmd_callback, 0x0 }, - { N_("/Filters/Re-show last"), "F", filters_repeat_cmd_callback, 0x1 }, - { N_("/Filters/---"), NULL, NULL, 0, "" }, + { { N_("/Filters/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Filters/Repeat last"), "F", filters_repeat_cmd_callback, 0x0 }, + "filters/repeat_last.html", NULL }, + { { N_("/Filters/Re-show last"), "F", filters_repeat_cmd_callback, 0x1 }, + "filters/reshow_last.html", NULL }, + { { N_("/Filters/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Script-Fu/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Script-Fu/"), NULL, NULL, 0 }, + { { N_("/Script-Fu/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, - { N_("/Dialogs/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, - { N_("/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, - { N_("/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, - { N_("/Dialogs/Gradient..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, - { N_("/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 }, - { N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 }, - { N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, - { N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, - { N_("/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 } + { { N_("/Dialogs/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, + "dialogs/brush_selection.html", NULL }, + { { N_("/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, + "dialogs/pattern_selection.html", NULL }, + { { N_("/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, + "dialogs/palette_selection.html", NULL }, + { { N_("/Dialogs/Gradients..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, + "dialogs/gradient_selection.html", NULL }, + { { N_("/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "dialogs/layers_and_channels.html", NULL }, + { { N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 }, + "dialogs/indexed_palette.html", NULL }, + { { N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 }, + "dialogs/tool_options.html", NULL }, + { { N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, + "dialogs/input_devices.html", NULL }, + { { N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, + "dialogs/device_status.html", NULL }, + { { N_("/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + "dialogs/display_filters.html", NULL }, }; -static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]); +static guint n_image_entries = (sizeof (image_entries) / + sizeof (image_entries[0])); static GtkItemFactory *image_factory = NULL; static GtkItemFactoryEntry load_entries[] = @@ -258,66 +431,113 @@ static GtkItemFactoryEntry save_entries[] = static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]); static GtkItemFactory *save_factory = NULL; -static GtkItemFactoryEntry layers_entries[] = +static GimpItemFactoryEntry layers_entries[] = { - { N_("/New Layer"), "N", layers_dialog_new_layer_callback, 0 }, - { N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 }, - { N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 }, - { N_("/Stack/Raise Layer"), "Prior", layers_dialog_raise_layer_callback, 0 }, - { N_("/Stack/Lower Layer"), "Next", layers_dialog_lower_layer_callback, 0 }, - { N_("/Stack/Layer to Top"), "Prior", layers_dialog_raise_layer_to_top_callback, 0 }, - { N_("/Stack/Layer to Bottom"), "Next", layers_dialog_lower_layer_to_bottom_callback, 0 }, - { N_("/Duplicate Layer"), "C", layers_dialog_duplicate_layer_callback, 0 }, - { N_("/Anchor Layer"), "H", layers_dialog_anchor_layer_callback, 0 }, - { N_("/Delete Layer"), "X", layers_dialog_delete_layer_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Scale Layer"), "S", layers_dialog_scale_layer_callback, 0 }, - { N_("/Resize Layer"), "R", layers_dialog_resize_layer_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Merge Visible Layers"), "M", layers_dialog_merge_layers_callback, 0 }, - { N_("/Merge Down"), "M", layers_dialog_merge_down_callback, 0 }, - { N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 }, - { N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 }, - { N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 }, - { N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 }, - { N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 } + { { N_("/New Layer"), "N", layers_dialog_new_layer_callback, 0 }, + "dialogs/layers/new_layer.html", NULL }, + { { N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 }, + "stack/index.html#previous_layer", NULL }, + { { N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 }, + "stack/index.html#next_layer", NULL }, + { { N_("/Stack/Raise Layer"), "Prior", layers_dialog_raise_layer_callback, 0 }, + "stack/index.html#raise_layer", NULL }, + { { N_("/Stack/Lower Layer"), "Next", layers_dialog_lower_layer_callback, 0 }, + "stack/index.html#lower_layer", NULL }, + { { N_("/Stack/Layer to Top"), "Prior", layers_dialog_raise_layer_to_top_callback, 0 }, + "stack/index.html#later_to_top", NULL }, + { { N_("/Stack/Layer to Bottom"), "Next", layers_dialog_lower_layer_to_bottom_callback, 0 }, + "stack/index.html#layer_to_bottom", NULL }, + { { N_("/Duplicate Layer"), "C", layers_dialog_duplicate_layer_callback, 0 }, + "duplicate_layer.html", NULL }, + { { N_("/Anchor Layer"), "H", layers_dialog_anchor_layer_callback, 0 }, + "anchor_layer.html", NULL }, + { { N_("/Delete Layer"), "X", layers_dialog_delete_layer_callback, 0 }, + "delete_layer.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Scale Layer"), "S", layers_dialog_scale_layer_callback, 0 }, + "dialogs/layers/scale_layer.html", NULL }, + { { N_("/Resize Layer"), "R", layers_dialog_resize_layer_callback, 0 }, + "dialogs/layers/resize_layer.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Merge Visible Layers"), "M", layers_dialog_merge_layers_callback, 0 }, + "dialogs/layers/merge_visible_layers.html", NULL }, + { { N_("/Merge Down"), "M", layers_dialog_merge_down_callback, 0 }, + "merge_down.html", NULL }, + { { N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 }, + "flatten_image.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 }, + "dialogs/layers/add_mask.html", NULL }, + { { N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 }, + "dialogs/layers/apply_mask.html", NULL }, + { { N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 }, + "alpha_to_selection.html", NULL }, + { { N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 }, + "mask_to_selection.html", NULL }, + { { N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 }, + "add_alpha_channel.html", NULL } }; -static guint n_layers_entries = sizeof (layers_entries) / sizeof (layers_entries[0]); +static guint n_layers_entries = (sizeof (layers_entries) / + sizeof (layers_entries[0])); static GtkItemFactory *layers_factory = NULL; -static GtkItemFactoryEntry channels_entries[] = +static GimpItemFactoryEntry channels_entries[] = { - { N_("/New Channel"), "N", channels_dialog_new_channel_callback, 0 }, - { N_("/Raise Channel"), "F", channels_dialog_raise_channel_callback, 0 }, - { N_("/Lower Channel"), "B", channels_dialog_lower_channel_callback, 0 }, - { N_("/Duplicate Channel"), "C", channels_dialog_duplicate_channel_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Channel to Selection"), "S", channels_dialog_channel_to_sel_callback, 0 }, - { N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 }, - { N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, - { N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Delete Channel"), "X", channels_dialog_delete_channel_callback, 0 } + { { N_("/New Channel"), "N", channels_dialog_new_channel_callback, 0 }, + "/dialogs/channels/new_channel.html", NULL }, + { { N_("/Raise Channel"), "F", channels_dialog_raise_channel_callback, 0 }, + "raise_channel.html", NULL }, + { { N_("/Lower Channel"), "B", channels_dialog_lower_channel_callback, 0 }, + "lower_channel.html", NULL }, + { { N_("/Duplicate Channel"), "C", channels_dialog_duplicate_channel_callback, 0 }, + "duplicate_channel.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Channel to Selection"), "S", channels_dialog_channel_to_sel_callback, 0 }, + "channel_to_selection.html", NULL }, + { { N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 }, + "channel_to_selection.html#add", NULL }, + { { N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, + "channel_to_selection.html#subtract", NULL }, + { { N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, + "channel_to_selection.html#intersect", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Delete Channel"), "X", channels_dialog_delete_channel_callback, 0 }, + "delete_layer.html", NULL } }; -static guint n_channels_entries = sizeof (channels_entries) / sizeof (channels_entries[0]); +static guint n_channels_entries = (sizeof (channels_entries) / + sizeof (channels_entries[0])); static GtkItemFactory *channels_factory = NULL; -static GtkItemFactoryEntry paths_entries[] = +static GimpItemFactoryEntry paths_entries[] = { - { N_("/New Path"), "N", paths_dialog_new_path_callback, 0 }, - { N_("/Duplicate Path"), "U", paths_dialog_dup_path_callback, 0 }, - { N_("/Path to Selection"), "S", paths_dialog_path_to_sel_callback, 0 }, - { N_("/Stroke Path"), "T", paths_dialog_stroke_path_callback, 0 }, - { N_("/Delete Path"), "X", paths_dialog_delete_path_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Copy Path"), "C", paths_dialog_copy_path_callback, 0 }, - { N_("/Paste Path"), "V", paths_dialog_paste_path_callback, 0 }, - { N_("/Import Path"), "I", paths_dialog_import_path_callback, 0 }, - { N_("/Export Path"), "E", paths_dialog_export_path_callback, 0 } + { { N_("/New Path"), "N", paths_dialog_new_path_callback, 0 }, + "new_path.html", NULL }, + { { N_("/Duplicate Path"), "U", paths_dialog_dup_path_callback, 0 }, + "duplicate_path.html", NULL }, + { { N_("/Path to Selection"), "S", paths_dialog_path_to_sel_callback, 0 }, + "path_to_selection.html", NULL }, + { { N_("/Stroke Path"), "T", paths_dialog_stroke_path_callback, 0 }, + "stroke_path.html", NULL }, + { { N_("/Delete Path"), "X", paths_dialog_delete_path_callback, 0 }, + "delete_path.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Copy Path"), "C", paths_dialog_copy_path_callback, 0 }, + "copy_path.html", NULL }, + { { N_("/Paste Path"), "V", paths_dialog_paste_path_callback, 0 }, + "paste_path.html", NULL }, + { { N_("/Import Path"), "I", paths_dialog_import_path_callback, 0 }, + "import_path.html", NULL }, + { { N_("/Export Path"), "E", paths_dialog_export_path_callback, 0 }, + "export_path.html", NULL } }; -static guint n_paths_entries = sizeof (paths_entries) / sizeof (paths_entries[0]); +static guint n_paths_entries = (sizeof (paths_entries) / + sizeof (paths_entries[0])); static GtkItemFactory *paths_factory = NULL; static int initialize = TRUE; @@ -479,18 +699,23 @@ menus_create (GtkMenuEntry *entries, void menus_tools_create (ToolInfo *tool_info) { - GtkItemFactoryEntry entry; + GimpItemFactoryEntry entry; - entry.path = tool_info->menu_path; - entry.accelerator = tool_info->menu_accel; - entry.callback = tools_select_cmd_callback; - entry.callback_action = tool_info->tool_id; - entry.item_type = NULL; + entry.entry.path = tool_info->menu_path; + entry.entry.accelerator = tool_info->menu_accel; + entry.entry.callback = tools_select_cmd_callback; + entry.entry.callback_action = tool_info->tool_id; + entry.entry.item_type = NULL; + entry.help_page = g_strconcat ("tools/", + tool_info->private_tip, + ".html", + NULL); + entry.description = NULL; - gtk_item_factory_create_item (image_factory, - &entry, - (gpointer) tool_info, - 2); + menus_create_item (image_factory, + &entry, + (gpointer) tool_info, + 2); } void @@ -633,7 +858,8 @@ menus_last_opened_update_labels (void) for (i = 1; i <= num_entries; i++) { - g_string_sprintf (entry_filename, "%d. %s", i, g_basename (((GString *) filename_slist->data)->str)); + g_string_sprintf (entry_filename, "%d. %s", i, + g_basename (((GString *) filename_slist->data)->str)); g_string_sprintf (path, N_("/File/MRU%02d"), i); @@ -641,7 +867,8 @@ menus_last_opened_update_labels (void) if (widget != NULL) { gtk_widget_show (widget); - gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), entry_filename->str); + gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), + entry_filename->str); } filename_slist = filename_slist->next; } @@ -677,11 +904,13 @@ menus_last_opened_add (gchar *filename) } raw_filename = g_string_new (filename); - last_opened_raw_filenames = g_slist_prepend (last_opened_raw_filenames, raw_filename); + last_opened_raw_filenames = g_slist_prepend (last_opened_raw_filenames, + raw_filename); if (num_entries == 0) { - widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path); + widget = gtk_item_factory_get_widget (toolbox_factory, + file_menu_separator.entry.path); gtk_widget_show (widget); } @@ -728,11 +957,14 @@ menus_init_mru (void) for (i=0; i < last_opened_size; i++) { widget = gtk_item_factory_get_widget (toolbox_factory, - last_opened_entries[i].path); + last_opened_entries[i].path); + gtk_object_set_data (GTK_OBJECT (widget), "help_page", + (gpointer) "file/last_opened.html"); gtk_widget_hide (widget); } - widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path); + widget = gtk_item_factory_get_widget (toolbox_factory, + file_menu_separator.entry.path); gtk_widget_hide (widget); g_free (paths); @@ -740,19 +972,135 @@ menus_init_mru (void) g_free (last_opened_entries); } +/* This function gets called while browsing a menu created + * by a GtkItemFactory + */ +static gint +menus_item_key_press (GtkWidget *widget, + GdkEventKey *kevent, + gpointer data) +{ + GtkItemFactory *item_factory = NULL; + GtkWidget *active_menu_item = NULL; + gchar *help_path = NULL; + gchar *help_page = NULL; + + if (kevent->keyval != GDK_F1) + return FALSE; + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), + "key_press_event"); + + item_factory = (GtkItemFactory *) data; + help_path = (gchar *) gtk_object_get_data (GTK_OBJECT (item_factory), + "help_path"); + + active_menu_item = GTK_MENU_SHELL (widget)->active_menu_item; + if (active_menu_item) + help_page = (gchar *) gtk_object_get_data (GTK_OBJECT (active_menu_item), + "help_page"); + if (! help_page) + help_page = "index.html"; + + if (help_path && help_page) + { + gchar *help_string; + + help_string = g_strdup_printf ("%s/%s", help_path, help_page); + gimp_help (help_string); + g_free (help_string); + } + else + { + gimp_help (NULL); + } + + return TRUE; +} + +/* set up the callback to catch the "F1" key */ +static void +menus_item_realize (GtkWidget *widget, + gpointer data) +{ + if (GTK_IS_MENU_SHELL (widget->parent)) + { + if (! gtk_object_get_data (GTK_OBJECT (widget->parent), + "menus_key_press_connected")) + { + gtk_signal_connect (GTK_OBJECT (widget->parent), "key_press_event", + GTK_SIGNAL_FUNC (menus_item_key_press), + (gpointer) data); + + gtk_object_set_data (GTK_OBJECT (widget->parent), + "menus_key_press_connected", + (gpointer) TRUE); + } + } +} + +static void +menus_create_item (GtkItemFactory *item_factory, + GimpItemFactoryEntry *entry, + gpointer callback_data, + guint callback_type) +{ + GtkWidget *item; + + gtk_item_factory_create_item (item_factory, + (GtkItemFactoryEntry *) entry, + callback_data, + callback_type); + + item = gtk_item_factory_get_item (item_factory, + ((GtkItemFactoryEntry *) entry)->path); + + if (item) + { + gtk_signal_connect_after (GTK_OBJECT (item), "realize", + GTK_SIGNAL_FUNC (menus_item_realize), + (gpointer) item_factory); + + gtk_object_set_data (GTK_OBJECT (item), "help_page", + (gpointer) entry->help_page); + } +} + +static void +menus_create_items (GtkItemFactory *item_factory, + guint n_entries, + GimpItemFactoryEntry *entries, + gpointer callback_data, + guint callback_type) +{ + gint i; + + for (i = 0; i < n_entries; i++) + { + menus_create_item (item_factory, + entries + i, + callback_data, + callback_type); + } +} + void menus_init_toolbox (void) { toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "", NULL); + gtk_object_set_data (GTK_OBJECT (toolbox_factory), "help_path", + (gpointer) "toolbox"); gtk_item_factory_set_translate_func (toolbox_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (toolbox_factory, n_toolbox_entries, - toolbox_entries, NULL, 2); + menus_create_items (toolbox_factory, n_toolbox_entries, + toolbox_entries, NULL, 2); menus_init_mru (); - gtk_item_factory_create_item (toolbox_factory, &file_menu_separator, NULL, 2); - - gtk_item_factory_create_item (toolbox_factory, &toolbox_end, NULL, 2); + menus_create_items (toolbox_factory, 1, + &file_menu_separator, NULL, 2); + + menus_create_items (toolbox_factory, 1, + &toolbox_end, NULL, 2); } static void @@ -769,13 +1117,15 @@ menus_init (void) menus_init_toolbox (); image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (image_factory), "help_path", + (gpointer) "image"); gtk_item_factory_set_translate_func (image_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (image_factory, - n_image_entries, - image_entries, - NULL, 2); + menus_create_items (image_factory, + n_image_entries, + image_entries, + NULL, 2); load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); gtk_item_factory_set_translate_func (load_factory, @@ -796,31 +1146,37 @@ menus_init (void) NULL, 2); layers_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (layers_factory), "help_path", + (gpointer) "layers"); gtk_item_factory_set_translate_func (layers_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (layers_factory, - n_layers_entries, - layers_entries, - NULL, 2); + menus_create_items (layers_factory, + n_layers_entries, + layers_entries, + NULL, 2); channels_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (channels_factory), "help_path", + (gpointer) "channels"); gtk_item_factory_set_translate_func (channels_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (channels_factory, - n_channels_entries, - channels_entries, - NULL, 2); + menus_create_items (channels_factory, + n_channels_entries, + channels_entries, + NULL, 2); paths_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (paths_factory), "help_path", + (gpointer) "paths"); gtk_item_factory_set_translate_func (paths_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (paths_factory, - n_paths_entries, - paths_entries, - NULL, 2); + menus_create_items (paths_factory, + n_paths_entries, + paths_entries, + NULL, 2); for (i = 0; i < num_tools; i++) { @@ -866,7 +1222,7 @@ tearoff_delete_cb (GtkWidget *widget, gpointer data) { /* Unregister if dialog is deleted as well */ - dialog_unregister((GtkWidget *)data); + dialog_unregister ((GtkWidget *) data); return TRUE; } @@ -875,16 +1231,16 @@ tearoff_cmd_callback (GtkWidget *widget, gpointer callback_data, guint callback_action) { - if(GTK_IS_TEAROFF_MENU_ITEM(widget)) + if (GTK_IS_TEAROFF_MENU_ITEM (widget)) { GtkTearoffMenuItem *tomi = (GtkTearoffMenuItem *)widget; - if(tomi->torn_off) + if (tomi->torn_off) { GtkWidget *top = gtk_widget_get_toplevel(widget); /* This should be a window */ - if(!GTK_IS_WINDOW(top)) + if (!GTK_IS_WINDOW (top)) { g_message(_("tearoff menu not in top level window")); } @@ -904,7 +1260,7 @@ tearoff_cmd_callback (GtkWidget *widget, GtkWidget *top = (GtkWidget *)gtk_object_get_data (GTK_OBJECT (widget),"tearoff_menu_top"); if(!top) { - g_message(_("can't unregister tearoff menu top level window")); + g_message (_("can't unregister tearoff menu top level window")); } else { diff --git a/app/gui/module-browser.c b/app/gui/module-browser.c index a2fb3ebda5..5cd358d341 100644 --- a/app/gui/module-browser.c +++ b/app/gui/module-browser.c @@ -261,7 +261,7 @@ module_db_browser_new (void) shell = gimp_dialog_new (_("Module DB"), "module_db_dialog", gimp_standard_help_func, - "dialogs/module_db_dialog.html", + "dialogs/module_browser.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gui/palette-editor.c b/app/gui/palette-editor.c index 5cda99f042..18334831f7 100644 --- a/app/gui/palette-editor.c +++ b/app/gui/palette-editor.c @@ -34,7 +34,7 @@ #include "buildmenu.h" #include "colormaps.h" #include "color_area.h" -#include "color_select.h" +#include "color_notebook.h" #include "datafiles.h" #include "devices.h" #include "errors.h" @@ -110,8 +110,8 @@ struct _PaletteDialog GtkWidget *clist; GtkWidget *popup_menu; GtkWidget *popup_small_menu; - ColorSelectP color_select; - int color_select_active; + ColorNotebookP color_notebook; + gboolean color_notebook_active; PaletteEntriesP entries; PaletteEntryP color; GdkGC *gc; @@ -470,8 +470,8 @@ palette_free () gdk_gc_destroy (top_level_edit_palette->gc); - if (top_level_edit_palette->color_select) - color_select_free (top_level_edit_palette->color_select); + if (top_level_edit_palette->color_notebook) + color_notebook_free (top_level_edit_palette->color_notebook); g_free (top_level_edit_palette); @@ -1078,7 +1078,7 @@ palette_new_entries_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("New Palette"), gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/new_palette.html", _("Enter a name for new palette"), NULL, NULL, NULL, @@ -1135,10 +1135,10 @@ palette_refresh (PaletteDialog *palette) palette->entries = NULL; /* If a color selection dialog is up, hide it */ - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } palette_free_palettes (); /* free palettes, don't save any modified versions */ palette_init_palettes (FALSE); /* reload palettes */ @@ -1234,11 +1234,11 @@ palette_draw_small_preview(GdkGC *gc, static void -palette_select_callback (gint r, - gint g, - gint b, - ColorSelectState state, - void *data) +palette_select_callback (gint r, + gint g, + gint b, + ColorNotebookState state, + void *data) { PaletteDialog *palette; guchar *color; @@ -1252,9 +1252,9 @@ palette_select_callback (gint r, { switch (state) { - case COLOR_SELECT_UPDATE: + case COLOR_NOTEBOOK_UPDATE: break; - case COLOR_SELECT_OK: + case COLOR_NOTEBOOK_OK: if (palette->color) { color = palette->color->color; @@ -1298,9 +1298,9 @@ palette_select_callback (gint r, palette_select2_set_text_all (palette->entries); } /* Fallthrough */ - case COLOR_SELECT_CANCEL: - color_select_hide (palette->color_select); - palette->color_select_active = 0; + case COLOR_NOTEBOOK_CANCEL: + color_notebook_hide (palette->color_notebook); + palette->color_notebook_active = FALSE; } } } @@ -1361,10 +1361,10 @@ palette_close_callback (GtkWidget *widget, palette = data; if (palette) { - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } if(import_dialog) @@ -1406,24 +1406,24 @@ palette_edit_callback (GtkWidget *widget, { color = palette->color->color; - if (!palette->color_select) + if (!palette->color_notebook) { - palette->color_select = - color_select_new (color[0], color[1], color[2], - palette_select_callback, palette, - FALSE); - palette->color_select_active = 1; + palette->color_notebook = + color_notebook_new (color[0], color[1], color[2], + palette_select_callback, palette, + FALSE); + palette->color_notebook_active = TRUE; } else { - if (!palette->color_select_active) + if (!palette->color_notebook_active) { - color_select_show (palette->color_select); - palette->color_select_active = 1; + color_notebook_show (palette->color_notebook); + palette->color_notebook_active = TRUE; } - color_select_set_color (palette->color_select, - color[0], color[1], color[2], 1); + color_notebook_set_color (palette->color_notebook, + color[0], color[1], color[2], 1); } } } @@ -1931,15 +1931,15 @@ palette_list_item_update (GtkWidget *widget, palette = (PaletteDialog *) data; - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } - if (palette->color_select) - color_select_free (palette->color_select); - palette->color_select = NULL; + if (palette->color_notebook) + color_notebook_free (palette->color_notebook); + palette->color_notebook = NULL; p_entries = (PaletteEntriesP) gtk_clist_get_row_data (GTK_CLIST (palette->clist), row); @@ -2013,8 +2013,8 @@ create_palette_dialog (gint vert) palette->entries = default_palette_entries; palette->color = NULL; - palette->color_select = NULL; - palette->color_select_active = 0; + palette->color_notebook = NULL; + palette->color_notebook_active = FALSE; palette->zoom_factor = 1.0; palette->columns = COLUMNS; palette->columns_valid = TRUE; @@ -2025,7 +2025,7 @@ create_palette_dialog (gint vert) palette->shell = gimp_dialog_new (_("Color Palette Edit"), "color_palette_edit", gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/index.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -2044,7 +2044,7 @@ create_palette_dialog (gint vert) palette->shell = gimp_dialog_new (_("Color Palette"), "color_palette", gimp_standard_help_func, - "dialogs/color_palette_dialog.html", + "dialogs/palette_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -2484,7 +2484,7 @@ palette_merge_dialog_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Merge Palette"), gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/merge_palette.html", _("Enter a name for merged palette"), NULL, NULL, NULL, @@ -2829,7 +2829,7 @@ palette_import_dialog (PaletteDialog *palette) import_dialog->dialog = dialog = gimp_dialog_new (_("Import Palette"), "import_palette", gimp_standard_help_func, - "dialogs/import_palette_dialog.html", + "dialogs/palette_editor/import_palette.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gui/palette-select.c b/app/gui/palette-select.c index 07599ce323..d7b71d9797 100644 --- a/app/gui/palette-select.c +++ b/app/gui/palette-select.c @@ -16,25 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "config.h" - -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include - -#include "colormaps.h" -#include "color_area.h" -#include "color_select.h" -#include "datafiles.h" -#include "errors.h" -#include "gimprc.h" #include "gimpui.h" -#include "interface.h" -#include "palette.h" #include "palette_entries.h" #include "session.h" #include "palette_select.h" @@ -234,7 +216,7 @@ palette_new_selection (gchar *title, psp->shell = gimp_dialog_new (title ? title : _("Palette Selection"), "palette_selection", gimp_standard_help_func, - "dialogs/palette_selection_dialog.html", + "dialogs/palette_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gui/paths-dialog.c b/app/gui/paths-dialog.c index fafffaaa49..1f0689ad20 100644 --- a/app/gui/paths-dialog.c +++ b/app/gui/paths-dialog.c @@ -1230,7 +1230,7 @@ paths_dialog_edit_path_query (GtkWidget *widget) qbox = gimp_query_string_box (_("Rename path"), gimp_standard_help_func, - "dialogs/paths_dialog.html", + "dialogs/paths/rename_path.html", _("Enter a new name for the path"), text, NULL, NULL, diff --git a/app/gui/pattern-select.c b/app/gui/pattern-select.c index dc4bb3b6f5..d866210c1e 100644 --- a/app/gui/pattern-select.c +++ b/app/gui/pattern-select.c @@ -95,7 +95,7 @@ pattern_select_new (gchar *title, psp->shell = gimp_dialog_new (title, "pattern_selection", gimp_standard_help_func, - "dialogs/pattern_selection_dialog.html", + "dialogs/pattern_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -114,7 +114,7 @@ pattern_select_new (gchar *title, psp->shell = gimp_dialog_new (_("Pattern Selection"), "pattern_selection", gimp_standard_help_func, - "dialogs/pattern_selection_dialog.html", + "dialogs/pattern_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index 0a61751d03..57b6182b0e 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -1164,7 +1164,7 @@ file_pref_cmd_callback (GtkWidget *widget, prefs_dlg = gimp_dialog_new (_("Preferences"), "gimp_preferences", gimp_standard_help_func, - "dialogs/preferences_dialog.html", + "dialogs/preferences.html", GTK_WIN_POS_NONE, FALSE, FALSE, FALSE, diff --git a/app/gui/qmask-commands.c b/app/gui/qmask-commands.c index 7ff287f61d..9a3aa1b35e 100644 --- a/app/gui/qmask-commands.c +++ b/app/gui/qmask-commands.c @@ -248,7 +248,7 @@ edit_qmask_channel_query (GDisplay * gdisp) options->query_box = gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes", gimp_standard_help_func, - "dialogs/edit_qmask_attributes_dialog.html", + "dialogs/edit_qmask_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/gui/resize-dialog.c b/app/gui/resize-dialog.c index 7e2925d1db..06019a5d1a 100644 --- a/app/gui/resize-dialog.c +++ b/app/gui/resize-dialog.c @@ -152,13 +152,13 @@ resize_widget_new (ResizeType type, case ResizeLayer: wmclass = "scale_layer"; window_title = _("Scale Layer"); - help_page = "dialogs/scale_layer_dialog.html"; + help_page = "dialogs/layers/dialogs/scale_layer.html"; frame = gtk_frame_new (_("Size")); break; case ResizeImage: wmclass = "image_scale"; window_title = _("Image Scale"); - help_page = "dialogs/scale_image_dialog.html"; + help_page = "dialogs/scale_image.html"; frame = gtk_frame_new (_("Pixel Dimensions")); break; } @@ -170,12 +170,12 @@ resize_widget_new (ResizeType type, case ResizeLayer: wmclass = "resize_layer"; window_title = _("Resize Layer"); - help_page = "dialogs/resize_layer_dialog.html"; + help_page = "dialogs/layers/dialogs/resize_layer.html"; break; case ResizeImage: wmclass = "image_resize"; window_title = _("Image Resize"); - help_page = "dialogs/resize_image_dialog.html"; + help_page = "dialogs/resize_image.html"; break; } frame = gtk_frame_new (_("Size")); diff --git a/app/interface.c b/app/interface.c index 05c4875d05..8cd68c1258 100644 --- a/app/interface.c +++ b/app/interface.c @@ -591,7 +591,7 @@ create_toolbox (void) /* Connect the "F1" help key */ gimp_help_connect_help_accel (window, gimp_standard_help_func, - "dialogs/toolbox.html"); + "toolbox/index.html"); wbox = gtk_vwrap_box_new (FALSE); gtk_wrap_box_set_justify (GTK_WRAP_BOX (wbox), GTK_JUSTIFY_FILL); @@ -954,7 +954,7 @@ create_display_shell (GDisplay* gdisp, /* Connect the "F1" help key */ gimp_help_connect_help_accel (gdisp->shell, gimp_standard_help_func, - "dialogs/image_window.html"); + "image/index.html"); gtk_widget_show (arrow); gtk_widget_show (gdisp->qmaskon); diff --git a/app/layers_dialog.c b/app/layers_dialog.c index 2f95e0694e..fe42e08f06 100644 --- a/app/layers_dialog.c +++ b/app/layers_dialog.c @@ -3302,7 +3302,7 @@ layers_dialog_new_layer_query (GimpImage* gimage) options->query_box = gimp_dialog_new (_("New Layer Options"), "new_layer_options", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/new_layer.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -3508,7 +3508,7 @@ layers_dialog_edit_layer_query (LayerWidget *layer_widget) options->query_box = gimp_dialog_new (_("Edit Layer Attributes"), "edit_layer_attributes", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/edit_layer_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -3633,7 +3633,7 @@ layers_dialog_add_mask_query (Layer *layer) options->query_box = gimp_dialog_new (_("Add Mask Options"), "add_mask_options", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/add_mask.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -3745,7 +3745,7 @@ layers_dialog_apply_mask_query (Layer *layer) options->query_box = gimp_dialog_new (_("Layer Mask Options"), "layer_mask_options", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/apply_mask.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -4034,7 +4034,7 @@ layers_dialog_layer_merge_query (GImage *gimage, options->query_box = gimp_dialog_new (_("Layer Merge Options"), "layer_merge_options", gimp_standard_help_func, - "dialogs/layers_dialog.html", + "dialogs/layers/merge_visible_layers.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/lc_dialog.c b/app/lc_dialog.c index 1e7a8ef205..6257f3a21d 100644 --- a/app/lc_dialog.c +++ b/app/lc_dialog.c @@ -51,6 +51,7 @@ static void lc_dialog_remove_cb (GimpSet *, GimpImage *, gpointer); static void lc_dialog_destroy_cb (GimpImage *, gpointer); static void lc_dialog_change_image (GimpContext *, GimpImage *, gpointer); +static void lc_dialog_help_func (gpointer); static void lc_dialog_image_menu_preview_update_cb (GtkWidget *,gpointer); static void lc_dialog_fill_preview_with_thumb(GtkWidget *, GimpImage *, @@ -77,7 +78,6 @@ lc_dialog_create (GimpImage* gimage) GtkWidget *auto_button; GtkWidget *button; GtkWidget *label; - GtkWidget *notebook; GtkWidget *separator; int default_index; @@ -103,8 +103,7 @@ lc_dialog_create (GimpImage* gimage) lc_dialog = g_new (LCDialog, 1); lc_dialog->shell = gimp_dialog_new (_("Layers & Channels"), "layers_and_channels", - gimp_standard_help_func, - "dialogs/layers_and_channels_dialog.html", + lc_dialog_help_func, NULL, GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, NULL); @@ -165,22 +164,23 @@ lc_dialog_create (GimpImage* gimage) gtk_widget_show (separator); /* The notebook widget */ - notebook = gtk_notebook_new (); - gtk_container_set_border_width (GTK_CONTAINER (notebook), 2); - gtk_box_pack_start (GTK_BOX (lc_dialog->subshell), notebook, TRUE, TRUE, 0); + lc_dialog->notebook = gtk_notebook_new (); + gtk_container_set_border_width (GTK_CONTAINER (lc_dialog->notebook), 2); + gtk_box_pack_start (GTK_BOX (lc_dialog->subshell), lc_dialog->notebook, + TRUE, TRUE, 0); label = gtk_label_new (_("Layers")); - gtk_notebook_append_page (GTK_NOTEBOOK (notebook), + gtk_notebook_append_page (GTK_NOTEBOOK (lc_dialog->notebook), layers_dialog_create (), label); gtk_widget_show (label); label = gtk_label_new (_("Channels")); - gtk_notebook_append_page (GTK_NOTEBOOK (notebook), + gtk_notebook_append_page (GTK_NOTEBOOK (lc_dialog->notebook), channels_dialog_create (), label); gtk_widget_show (label); label = gtk_label_new (_("Paths")); - gtk_notebook_append_page (GTK_NOTEBOOK (notebook), + gtk_notebook_append_page (GTK_NOTEBOOK (lc_dialog->notebook), paths_dialog_create (), label); gtk_widget_show (label); @@ -188,7 +188,7 @@ lc_dialog_create (GimpImage* gimage) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (auto_button), lc_dialog->auto_follow_active); - gtk_widget_show (notebook); + gtk_widget_show (lc_dialog->notebook); /* The action area */ gtk_container_set_border_width @@ -204,8 +204,8 @@ lc_dialog_create (GimpImage* gimage) gtk_widget_show (button); /* Make sure the channels page is realized */ - gtk_notebook_set_page (GTK_NOTEBOOK (notebook), 1); - gtk_notebook_set_page (GTK_NOTEBOOK (notebook), 0); + gtk_notebook_set_page (GTK_NOTEBOOK (lc_dialog->notebook), 1); + gtk_notebook_set_page (GTK_NOTEBOOK (lc_dialog->notebook), 0); gtk_signal_connect (GTK_OBJECT (image_context), "add", GTK_SIGNAL_FUNC (lc_dialog_add_cb), NULL); @@ -408,10 +408,10 @@ typedef struct } IMCBData; static void -lc_dialog_fill_preview_with_thumb(GtkWidget *w, - GimpImage *gimage, - gint width, - gint height) +lc_dialog_fill_preview_with_thumb (GtkWidget *w, + GimpImage *gimage, + gint width, + gint height) { guchar *drawable_data; TempBuf *buf; @@ -713,3 +713,20 @@ lc_dialog_change_image (GimpContext *context, lc_dialog_update_image_list (); } + +static void +lc_dialog_help_func (gpointer data) +{ + gchar *help_page; + gint page_num; + + page_num = + gtk_notebook_get_current_page (GTK_NOTEBOOK (lc_dialog->notebook)); + + help_page = g_strconcat ((page_num == 0) ? "layers" : + ((page_num == 1) ? "channels" : "paths"), + "/index.html", + NULL); + gimp_help (help_page); + g_free (help_page); +} diff --git a/app/lc_dialogP.h b/app/lc_dialogP.h index 276038b98c..fc92559baa 100644 --- a/app/lc_dialogP.h +++ b/app/lc_dialogP.h @@ -30,6 +30,8 @@ struct _LCDialog GimpImage *gimage; gboolean auto_follow_active; + + GtkWidget *notebook; }; GtkWidget * layers_dialog_create (void); diff --git a/app/menus.c b/app/menus.c index 5550911d3a..98c1e5694c 100644 --- a/app/menus.c +++ b/app/menus.c @@ -17,13 +17,14 @@ */ #include #include +#include + #include "appenv.h" #include "channels_dialog.h" #include "colormaps.h" #include "commands.h" #include "dialog_handler.h" #include "fileops.h" -#include "general.h" #include "gimprc.h" #include "interface.h" #include "layers_dialog.h" @@ -43,6 +44,16 @@ #define MRU_MENU_ENTRY_SIZE (strlen (_("/File/MRU00 ")) + 1) #define MRU_MENU_ACCEL_SIZE sizeof ("0") +typedef struct _GimpItemFactoryEntry GimpItemFactoryEntry; + +struct _GimpItemFactoryEntry +{ + GtkItemFactoryEntry entry; + + gchar *help_page; + gchar *description; +}; + static char* G_GNUC_UNUSED dummyMenus[] = { N_("/File/MRU00 "), N_("/File"), N_("/File/Dialogs"), @@ -53,8 +64,12 @@ static char* G_GNUC_UNUSED dummyMenus[] = { N_("/File/MRU00 "), N_("/View/Zoom"), N_("/Stack")}; +static void menus_create_item (GtkItemFactory *item_factory, + GimpItemFactoryEntry *entry, + gpointer callback_data, + guint callback_type); static void menus_init (void); -static gchar* menu_translate (const gchar *path, +static gchar *menu_translate (const gchar *path, gpointer data); static void tearoff_cmd_callback (GtkWidget *widget, gpointer callback_data, @@ -62,184 +77,342 @@ static void tearoff_cmd_callback (GtkWidget *widget, static GSList *last_opened_raw_filenames = NULL; -static GtkItemFactoryEntry toolbox_entries[] = +static GimpItemFactoryEntry toolbox_entries[] = { - { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/New"), "N", file_new_cmd_callback, 0 }, - { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, - { N_("/File/Acquire"), NULL, NULL, 0, "" }, - { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, - { N_("/File/Help..."), NULL, gimp_help_cmd_callback, 0 }, - { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, - { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, + { { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/New"), "N", file_new_cmd_callback, 0 }, + "file/dialogs/file_new.html", NULL }, + { { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, + "file/dialogs/file_open.html", NULL }, + { { N_("/File/Acquire/tearoff1"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, + "file/dialogs/about.html", NULL }, + { { N_("/File/Help..."), NULL, gimp_help_cmd_callback, 0 }, + "file/dialogs/help.html", NULL }, + { { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, + "file/dialogs/preferences.html", NULL }, + { { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, + "file/dialogs/tip_of_the_day.html", NULL }, - { N_("/File/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, - { N_("/File/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, - { N_("/File/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, - { N_("/File/Dialogs/Gradient..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, - { N_("/File/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/File/Dialogs/Tool Options..."), "T", dialogs_tools_options_cmd_callback, 0 }, - { N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, - { N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, - { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, - { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, - { N_("/File/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + { { N_("/File/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, + "file/dialogs/brush_selection.html", NULL }, + { { N_("/File/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, + "file/dialogs/pattern_selection.html", NULL }, + { { N_("/File/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, + "file/dialogs/palette_selection.html", NULL }, + { { N_("/File/Dialogs/Gradients..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, + "file/dialogs/gradient_selection.html", NULL }, + { { N_("/File/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "file/dialogs/layers_and_channels.html", NULL }, + { { N_("/File/Dialogs/Tool Options..."), "T", dialogs_tools_options_cmd_callback, 0 }, + "file/dialogs/tool_options.html", NULL }, + { { N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, + "file/dialogs/input_devices.html", NULL }, + { { N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, + "file/dialogs/device_status.html", NULL }, + { { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, + "file/dialogs/document_index.html", NULL }, + { { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, + "file/dialogs/error_console.html", NULL }, + { { N_("/File/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + "file/dialogs/display_filters.html", NULL }, - { N_("/Xtns/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 }, - { N_("/File/---"), NULL, NULL, 0, "" }, - { N_("/File/---"), NULL, NULL, 0, "" } + { { N_("/Xtns/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 }, + "xtns/module_browser.html", NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, }; -static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); +static guint n_toolbox_entries = (sizeof (toolbox_entries) / + sizeof (toolbox_entries[0])); static GtkItemFactory *toolbox_factory = NULL; -static GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "" }; -static GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }; +static GimpItemFactoryEntry file_menu_separator = +{ { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }; -static GtkItemFactoryEntry image_entries[] = +static GimpItemFactoryEntry toolbox_end = +{ { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, + "file/dialogs/quit.html", NULL }; + +static GimpItemFactoryEntry image_entries[] = { - { N_("/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/New"), "N", file_new_cmd_callback, 1 }, - { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, - { N_("/File/Save"), "S", file_save_cmd_callback, 0 }, - { N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 }, - { N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 }, - { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, - { N_("/File/---"), NULL, NULL, 0, "" }, + { { N_("/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/New"), "N", file_new_cmd_callback, 1 }, + "file/dialogs/file_new.html", NULL }, + { { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, + "file/dialogs/file_open.html", NULL }, + { { N_("/File/Save"), "S", file_save_cmd_callback, 0 }, + "file/dialogs/file_save.html", NULL }, + { { N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 }, + "file/dialogs/save_as.html", NULL }, + { { N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 }, + "file/revert.html", NULL }, + { { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, + "file/dialogs/preferences.html", NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/File/Close"), "W", file_close_cmd_callback, 0 }, - { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, - { N_("/File/---moved"), NULL, NULL, 0, "" }, + { { N_("/File/Close"), "W", file_close_cmd_callback, 0 }, + "file/close.html", NULL }, + { { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, + "file/dialogs/quit.html", NULL }, + { { N_("/File/---moved"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Edit/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Edit/Cut"), "X", edit_cut_cmd_callback, 0 }, - { N_("/Edit/Copy"), "C", edit_copy_cmd_callback, 0 }, - { N_("/Edit/Paste"), "V", edit_paste_cmd_callback, 0 }, - { N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 }, - { N_("/Edit/Paste As New"), NULL, edit_paste_as_new_cmd_callback, 0 }, - { N_("/Edit/---"), NULL, NULL, 0, "" }, - { N_("/Edit/Clear"), "K", edit_clear_cmd_callback, 0 }, - { N_("/Edit/Fill"), "period", edit_fill_cmd_callback, 0 }, - { N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 }, - { N_("/Edit/Undo"), "Z", edit_undo_cmd_callback, 0 }, - { N_("/Edit/Redo"), "R", edit_redo_cmd_callback, 0 }, - { N_("/Edit/Undo history..."), NULL, edit_show_undo_history_cmd_callback, 0}, - { N_("/Edit/---"), NULL, NULL, 0, "" }, - { N_("/Edit/Cut Named"), "X", edit_named_cut_cmd_callback, 0 }, - { N_("/Edit/Copy Named"), "C", edit_named_copy_cmd_callback, 0 }, - { N_("/Edit/Paste Named"), "V", edit_named_paste_cmd_callback, 0 }, - { N_("/Edit/---"), NULL, NULL, 0, "" }, + { { N_("/Edit/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Cut"), "X", edit_cut_cmd_callback, 0 }, + "edit/cut.html", NULL }, + { { N_("/Edit/Copy"), "C", edit_copy_cmd_callback, 0 }, + "edit/copy.html", NULL }, + { { N_("/Edit/Paste"), "V", edit_paste_cmd_callback, 0 }, + "edit/paste.html", NULL }, + { { N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 }, + "edit/paste_into.html", NULL }, + { { N_("/Edit/Paste As New"), NULL, edit_paste_as_new_cmd_callback, 0 }, + "edit/paste_as_new.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Clear"), "K", edit_clear_cmd_callback, 0 }, + "edit/clear.html", NULL }, + { { N_("/Edit/Fill"), "period", edit_fill_cmd_callback, 0 }, + "edit/fill.html", NULL }, + { { N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 }, + "edit/stroke.html", NULL }, + { { N_("/Edit/Undo"), "Z", edit_undo_cmd_callback, 0 }, + "edit/undo.html", NULL }, + { { N_("/Edit/Redo"), "R", edit_redo_cmd_callback, 0 }, + "edit/redo.html", NULL }, + { { N_("/Edit/Undo history..."), NULL, edit_show_undo_history_cmd_callback, 0}, + "edit/dialogs/undo_history.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Cut Named"), "X", edit_named_cut_cmd_callback, 0 }, + "edit/dialogs/cut_named.html", NULL }, + { { N_("/Edit/Copy Named"), "C", edit_named_copy_cmd_callback, 0 }, + "edit/dialogs/copy_named.html", NULL }, + { { N_("/Edit/Paste Named"), "V", edit_named_paste_cmd_callback, 0 }, + "edit/dialogs/paste_named.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Select/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Select/Invert"), "I", select_invert_cmd_callback, 0 }, - { N_("/Select/All"), "A", select_all_cmd_callback, 0 }, - { N_("/Select/None"), "A", select_none_cmd_callback, 0 }, - { N_("/Select/Float"), "L", select_float_cmd_callback, 0 }, - { N_("/Select/---"), NULL, NULL, 0, "" }, - { N_("/Select/Feather"), "F", select_feather_cmd_callback, 0 }, - { N_("/Select/Sharpen"), "H", select_sharpen_cmd_callback, 0 }, - { N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 }, - { N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 }, - { N_("/Select/Border"), "B", select_border_cmd_callback, 0 }, - { N_("/Select/---"), NULL, NULL, 0, "" }, - { N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 }, + { { N_("/Select/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Select/Invert"), "I", select_invert_cmd_callback, 0 }, + "select/invert.html", NULL }, + { { N_("/Select/All"), "A", select_all_cmd_callback, 0 }, + "select/all.html", NULL }, + { { N_("/Select/None"), "A", select_none_cmd_callback, 0 }, + "select/none.html", NULL }, + { { N_("/Select/Float"), "L", select_float_cmd_callback, 0 }, + "select/float.html", NULL }, + { { N_("/Select/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Select/Feather"), "F", select_feather_cmd_callback, 0 }, + "select/dialogs/feather_selection.html", NULL }, + { { N_("/Select/Sharpen"), "H", select_sharpen_cmd_callback, 0 }, + "select/sharpen.html", NULL }, + { { N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 }, + "select/dialogs/shrink_selection.html", NULL }, + { { N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 }, + "select/dialogs/grow_selection.html", NULL }, + { { N_("/Select/Border"), "B", select_border_cmd_callback, 0 }, + "select/dialogs/border_selection.html", NULL }, + { { N_("/Select/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 }, + "select/save_to_channel.html", NULL }, - { N_("/View/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 }, - { N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 }, - { N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 }, - { N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 }, - { N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 }, - { N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 }, - { N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 }, - { N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 }, - { N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 }, - { N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 }, - { N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 }, - { N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, ""}, - { N_("/View/Window Info..."), "I", view_window_info_cmd_callback, 0 }, - { N_("/View/Window Nav..."), NULL, view_window_nav_cmd_callback, 0 }, + { { N_("/View/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "" }, + "view/dot_for_dot.html", NULL }, + { { N_("/View/Info Window..."), "I", view_window_info_cmd_callback, 0 }, + "view/dialogs/info_window.html", NULL }, + { { N_("/View/Nav. Window..."), NULL, view_window_nav_cmd_callback, 0 }, + "view/dialogs/navigation_window.html", NULL }, - { N_("/View/---"), NULL, NULL, 0, "" }, - { N_("/View/Toggle Selection"), "T", view_toggle_selection_cmd_callback, 0, "" }, - { N_("/View/Toggle Rulers"), "R", view_toggle_rulers_cmd_callback, 0, "" }, - { N_("/View/Toggle Statusbar"), "S", view_toggle_statusbar_cmd_callback, 0, "" }, - { N_("/View/Toggle Guides"), "T", view_toggle_guides_cmd_callback, 0, "" }, - { N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "" }, - { N_("/View/---"), NULL, NULL, 0, "" }, + { { N_("/View/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/View/Toggle Selection"), "T", view_toggle_selection_cmd_callback, 0, "" }, + "view/toggle_selection.html", NULL }, + { { N_("/View/Toggle Rulers"), "R", view_toggle_rulers_cmd_callback, 0, "" }, + "view/toggle_rulers.html", NULL }, + { { N_("/View/Toggle Statusbar"), "S", view_toggle_statusbar_cmd_callback, 0, "" }, + "view/toggle_statusbar.html", NULL }, + { { N_("/View/Toggle Guides"), "T", view_toggle_guides_cmd_callback, 0, "" }, + "view/toggle_guides.html", NULL }, + { { N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "" }, + "view/snap_to_guides.html", NULL }, + { { N_("/View/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 }, - { N_("/View/Shrink Wrap"), "E", view_shrink_wrap_cmd_callback, 0 }, + { { N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 }, + "view/new_view.html", NULL }, + { { N_("/View/Shrink Wrap"), "E", view_shrink_wrap_cmd_callback, 0 }, + "view/shrink_wrap.html", NULL }, - { N_("/Image/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Colors/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 }, - { N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 }, - { N_("/Image/Colors/---"), NULL, NULL, 0, "" }, - { N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 }, - { N_("/Image/Channel Ops/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Channel Ops/Duplicate"), "D", channel_ops_duplicate_cmd_callback, 0 }, - { N_("/Image/Channel Ops/Offset"), "O", channel_ops_offset_cmd_callback, 0 }, - { N_("/Image/Alpha/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + { { N_("/Image/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 }, + "image/colors/equalize.html", NULL }, + { { N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 }, + "image/colors/invert.html", NULL }, + { { N_("/Image/Colors/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 }, + "image/colors/desaturate.html", NULL }, + + { { N_("/Image/Channels/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + + { { N_("/Image/Alpha/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + "layers/add_alpha_channel.html", NULL }, + + { { N_("/Image/Transforms/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Transforms/Offset"), "O", channel_ops_offset_cmd_callback, 0 }, + "image/transforms/dialogs/offset.html", NULL }, - { N_("/Image/---"), NULL, NULL, 0, "" }, - { N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 }, - { N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 }, - { N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 }, - { N_("/Image/---"), NULL, NULL, 0, "" }, - { N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 }, - { N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 }, - { N_("/Image/---"), NULL, NULL, 0, "" }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 }, + "image/convert_to_rgb.html", NULL }, + { { N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 }, + "image/convert_to_grayscale.html", NULL }, + { { N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 }, + "image/dialogs/convert_to_indexed.html", NULL }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 }, + "image/dialogs/resize_image.html", NULL }, + { { N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 }, + "image/dialogs/scale_image.html", NULL }, + { { N_("/Image/Duplicate"), "D", channel_ops_duplicate_cmd_callback, 0 }, + "image/duplicate.html", NULL }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Layers/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Layers/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/Layers/Stack/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 }, - { N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 }, - { N_("/Layers/Stack/Raise Layer"), "Prior", layers_raise_cmd_callback, 0 }, - { N_("/Layers/Stack/Lower Layer"), "Next", layers_lower_cmd_callback, 0 }, - { N_("/Layers/Stack/Layer to Top"), "Prior", layers_raise_to_top_cmd_callback, 0 }, - { N_("/Layers/Stack/Layer to Bottom"), "Next", layers_lower_to_bottom_cmd_callback, 0 }, - { N_("/Layers/---"), NULL, NULL, 0, "" }, - { N_("/Layers/Anchor Layer"), "H", layers_anchor_cmd_callback, 0 }, - { N_("/Layers/Merge Visible Layers"), "M", layers_merge_cmd_callback, 0 }, - { N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 }, - { N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 }, - { N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 }, - { N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, - { N_("/Layers/---"), NULL, NULL, 0, "" }, + { { N_("/Layers/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "layers/dialogs/layers_and_channels.html", NULL }, + { { N_("/Layers/Stack/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 }, + "layers/stack/index.html#previous_layer", NULL }, + { { N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 }, + "layers/stack/index.html#next_layer", NULL }, + { { N_("/Layers/Stack/Raise Layer"), "Prior", layers_raise_cmd_callback, 0 }, + "layers/stack/index.html#raise_layer", NULL }, + { { N_("/Layers/Stack/Lower Layer"), "Next", layers_lower_cmd_callback, 0 }, + "layers/stack/index.html#lower_layer", NULL }, + { { N_("/Layers/Stack/Layer to Top"), "Prior", layers_raise_to_top_cmd_callback, 0 }, + "layers/stack/index.html#layer_to_top", NULL }, + { { N_("/Layers/Stack/Layer to Bottom"), "Next", layers_lower_to_bottom_cmd_callback, 0 }, + "layers/stack/index.html#layer_to_bottom", NULL }, + { { N_("/Layers/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Anchor Layer"), "H", layers_anchor_cmd_callback, 0 }, + "layers/anchor_layer.html", NULL }, + { { N_("/Layers/Merge Visible Layers"), "M", layers_merge_cmd_callback, 0 }, + "layers/dialogs/layers/merge_visible_layers.html", NULL }, + { { N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 }, + "layers/flatten_image.html", NULL }, + { { N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 }, + "layers/alpha_to_selection.html", NULL }, + { { N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 }, + "layers/mask_to_selection.html", NULL }, + { { N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + "layers/add_alpha_channel.html", NULL }, + { { N_("/Layers/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Tools/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 }, - { N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 }, - { N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, - { N_("/Tools/---"), NULL, NULL, 0, "" }, + { { N_("/Tools/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 }, + "toolbox/index.html", NULL }, + { { N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 }, + "toolbox/index.html#default_colors", NULL }, + { { N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, + "toolbox/index.html#swap_colors", NULL }, + { { N_("/Tools/---"), NULL, NULL, 0, "" }, + NULL, NULL }, /* the tool entries themselves are built on the fly */ - { N_("/Filters/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Filters/Repeat last"), "F", filters_repeat_cmd_callback, 0x0 }, - { N_("/Filters/Re-show last"), "F", filters_repeat_cmd_callback, 0x1 }, - { N_("/Filters/---"), NULL, NULL, 0, "" }, + { { N_("/Filters/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Filters/Repeat last"), "F", filters_repeat_cmd_callback, 0x0 }, + "filters/repeat_last.html", NULL }, + { { N_("/Filters/Re-show last"), "F", filters_repeat_cmd_callback, 0x1 }, + "filters/reshow_last.html", NULL }, + { { N_("/Filters/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Script-Fu/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Script-Fu/"), NULL, NULL, 0 }, + { { N_("/Script-Fu/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, - { N_("/Dialogs/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, - { N_("/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, - { N_("/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, - { N_("/Dialogs/Gradient..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, - { N_("/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 }, - { N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 }, - { N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, - { N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, - { N_("/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 } + { { N_("/Dialogs/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, + "dialogs/brush_selection.html", NULL }, + { { N_("/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, + "dialogs/pattern_selection.html", NULL }, + { { N_("/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, + "dialogs/palette_selection.html", NULL }, + { { N_("/Dialogs/Gradients..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, + "dialogs/gradient_selection.html", NULL }, + { { N_("/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "dialogs/layers_and_channels.html", NULL }, + { { N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 }, + "dialogs/indexed_palette.html", NULL }, + { { N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 }, + "dialogs/tool_options.html", NULL }, + { { N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, + "dialogs/input_devices.html", NULL }, + { { N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, + "dialogs/device_status.html", NULL }, + { { N_("/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + "dialogs/display_filters.html", NULL }, }; -static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]); +static guint n_image_entries = (sizeof (image_entries) / + sizeof (image_entries[0])); static GtkItemFactory *image_factory = NULL; static GtkItemFactoryEntry load_entries[] = @@ -258,66 +431,113 @@ static GtkItemFactoryEntry save_entries[] = static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]); static GtkItemFactory *save_factory = NULL; -static GtkItemFactoryEntry layers_entries[] = +static GimpItemFactoryEntry layers_entries[] = { - { N_("/New Layer"), "N", layers_dialog_new_layer_callback, 0 }, - { N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 }, - { N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 }, - { N_("/Stack/Raise Layer"), "Prior", layers_dialog_raise_layer_callback, 0 }, - { N_("/Stack/Lower Layer"), "Next", layers_dialog_lower_layer_callback, 0 }, - { N_("/Stack/Layer to Top"), "Prior", layers_dialog_raise_layer_to_top_callback, 0 }, - { N_("/Stack/Layer to Bottom"), "Next", layers_dialog_lower_layer_to_bottom_callback, 0 }, - { N_("/Duplicate Layer"), "C", layers_dialog_duplicate_layer_callback, 0 }, - { N_("/Anchor Layer"), "H", layers_dialog_anchor_layer_callback, 0 }, - { N_("/Delete Layer"), "X", layers_dialog_delete_layer_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Scale Layer"), "S", layers_dialog_scale_layer_callback, 0 }, - { N_("/Resize Layer"), "R", layers_dialog_resize_layer_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Merge Visible Layers"), "M", layers_dialog_merge_layers_callback, 0 }, - { N_("/Merge Down"), "M", layers_dialog_merge_down_callback, 0 }, - { N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 }, - { N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 }, - { N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 }, - { N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 }, - { N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 } + { { N_("/New Layer"), "N", layers_dialog_new_layer_callback, 0 }, + "dialogs/layers/new_layer.html", NULL }, + { { N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 }, + "stack/index.html#previous_layer", NULL }, + { { N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 }, + "stack/index.html#next_layer", NULL }, + { { N_("/Stack/Raise Layer"), "Prior", layers_dialog_raise_layer_callback, 0 }, + "stack/index.html#raise_layer", NULL }, + { { N_("/Stack/Lower Layer"), "Next", layers_dialog_lower_layer_callback, 0 }, + "stack/index.html#lower_layer", NULL }, + { { N_("/Stack/Layer to Top"), "Prior", layers_dialog_raise_layer_to_top_callback, 0 }, + "stack/index.html#later_to_top", NULL }, + { { N_("/Stack/Layer to Bottom"), "Next", layers_dialog_lower_layer_to_bottom_callback, 0 }, + "stack/index.html#layer_to_bottom", NULL }, + { { N_("/Duplicate Layer"), "C", layers_dialog_duplicate_layer_callback, 0 }, + "duplicate_layer.html", NULL }, + { { N_("/Anchor Layer"), "H", layers_dialog_anchor_layer_callback, 0 }, + "anchor_layer.html", NULL }, + { { N_("/Delete Layer"), "X", layers_dialog_delete_layer_callback, 0 }, + "delete_layer.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Scale Layer"), "S", layers_dialog_scale_layer_callback, 0 }, + "dialogs/layers/scale_layer.html", NULL }, + { { N_("/Resize Layer"), "R", layers_dialog_resize_layer_callback, 0 }, + "dialogs/layers/resize_layer.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Merge Visible Layers"), "M", layers_dialog_merge_layers_callback, 0 }, + "dialogs/layers/merge_visible_layers.html", NULL }, + { { N_("/Merge Down"), "M", layers_dialog_merge_down_callback, 0 }, + "merge_down.html", NULL }, + { { N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 }, + "flatten_image.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 }, + "dialogs/layers/add_mask.html", NULL }, + { { N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 }, + "dialogs/layers/apply_mask.html", NULL }, + { { N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 }, + "alpha_to_selection.html", NULL }, + { { N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 }, + "mask_to_selection.html", NULL }, + { { N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 }, + "add_alpha_channel.html", NULL } }; -static guint n_layers_entries = sizeof (layers_entries) / sizeof (layers_entries[0]); +static guint n_layers_entries = (sizeof (layers_entries) / + sizeof (layers_entries[0])); static GtkItemFactory *layers_factory = NULL; -static GtkItemFactoryEntry channels_entries[] = +static GimpItemFactoryEntry channels_entries[] = { - { N_("/New Channel"), "N", channels_dialog_new_channel_callback, 0 }, - { N_("/Raise Channel"), "F", channels_dialog_raise_channel_callback, 0 }, - { N_("/Lower Channel"), "B", channels_dialog_lower_channel_callback, 0 }, - { N_("/Duplicate Channel"), "C", channels_dialog_duplicate_channel_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Channel to Selection"), "S", channels_dialog_channel_to_sel_callback, 0 }, - { N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 }, - { N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, - { N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Delete Channel"), "X", channels_dialog_delete_channel_callback, 0 } + { { N_("/New Channel"), "N", channels_dialog_new_channel_callback, 0 }, + "/dialogs/channels/new_channel.html", NULL }, + { { N_("/Raise Channel"), "F", channels_dialog_raise_channel_callback, 0 }, + "raise_channel.html", NULL }, + { { N_("/Lower Channel"), "B", channels_dialog_lower_channel_callback, 0 }, + "lower_channel.html", NULL }, + { { N_("/Duplicate Channel"), "C", channels_dialog_duplicate_channel_callback, 0 }, + "duplicate_channel.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Channel to Selection"), "S", channels_dialog_channel_to_sel_callback, 0 }, + "channel_to_selection.html", NULL }, + { { N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 }, + "channel_to_selection.html#add", NULL }, + { { N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, + "channel_to_selection.html#subtract", NULL }, + { { N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, + "channel_to_selection.html#intersect", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Delete Channel"), "X", channels_dialog_delete_channel_callback, 0 }, + "delete_layer.html", NULL } }; -static guint n_channels_entries = sizeof (channels_entries) / sizeof (channels_entries[0]); +static guint n_channels_entries = (sizeof (channels_entries) / + sizeof (channels_entries[0])); static GtkItemFactory *channels_factory = NULL; -static GtkItemFactoryEntry paths_entries[] = +static GimpItemFactoryEntry paths_entries[] = { - { N_("/New Path"), "N", paths_dialog_new_path_callback, 0 }, - { N_("/Duplicate Path"), "U", paths_dialog_dup_path_callback, 0 }, - { N_("/Path to Selection"), "S", paths_dialog_path_to_sel_callback, 0 }, - { N_("/Stroke Path"), "T", paths_dialog_stroke_path_callback, 0 }, - { N_("/Delete Path"), "X", paths_dialog_delete_path_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Copy Path"), "C", paths_dialog_copy_path_callback, 0 }, - { N_("/Paste Path"), "V", paths_dialog_paste_path_callback, 0 }, - { N_("/Import Path"), "I", paths_dialog_import_path_callback, 0 }, - { N_("/Export Path"), "E", paths_dialog_export_path_callback, 0 } + { { N_("/New Path"), "N", paths_dialog_new_path_callback, 0 }, + "new_path.html", NULL }, + { { N_("/Duplicate Path"), "U", paths_dialog_dup_path_callback, 0 }, + "duplicate_path.html", NULL }, + { { N_("/Path to Selection"), "S", paths_dialog_path_to_sel_callback, 0 }, + "path_to_selection.html", NULL }, + { { N_("/Stroke Path"), "T", paths_dialog_stroke_path_callback, 0 }, + "stroke_path.html", NULL }, + { { N_("/Delete Path"), "X", paths_dialog_delete_path_callback, 0 }, + "delete_path.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Copy Path"), "C", paths_dialog_copy_path_callback, 0 }, + "copy_path.html", NULL }, + { { N_("/Paste Path"), "V", paths_dialog_paste_path_callback, 0 }, + "paste_path.html", NULL }, + { { N_("/Import Path"), "I", paths_dialog_import_path_callback, 0 }, + "import_path.html", NULL }, + { { N_("/Export Path"), "E", paths_dialog_export_path_callback, 0 }, + "export_path.html", NULL } }; -static guint n_paths_entries = sizeof (paths_entries) / sizeof (paths_entries[0]); +static guint n_paths_entries = (sizeof (paths_entries) / + sizeof (paths_entries[0])); static GtkItemFactory *paths_factory = NULL; static int initialize = TRUE; @@ -479,18 +699,23 @@ menus_create (GtkMenuEntry *entries, void menus_tools_create (ToolInfo *tool_info) { - GtkItemFactoryEntry entry; + GimpItemFactoryEntry entry; - entry.path = tool_info->menu_path; - entry.accelerator = tool_info->menu_accel; - entry.callback = tools_select_cmd_callback; - entry.callback_action = tool_info->tool_id; - entry.item_type = NULL; + entry.entry.path = tool_info->menu_path; + entry.entry.accelerator = tool_info->menu_accel; + entry.entry.callback = tools_select_cmd_callback; + entry.entry.callback_action = tool_info->tool_id; + entry.entry.item_type = NULL; + entry.help_page = g_strconcat ("tools/", + tool_info->private_tip, + ".html", + NULL); + entry.description = NULL; - gtk_item_factory_create_item (image_factory, - &entry, - (gpointer) tool_info, - 2); + menus_create_item (image_factory, + &entry, + (gpointer) tool_info, + 2); } void @@ -633,7 +858,8 @@ menus_last_opened_update_labels (void) for (i = 1; i <= num_entries; i++) { - g_string_sprintf (entry_filename, "%d. %s", i, g_basename (((GString *) filename_slist->data)->str)); + g_string_sprintf (entry_filename, "%d. %s", i, + g_basename (((GString *) filename_slist->data)->str)); g_string_sprintf (path, N_("/File/MRU%02d"), i); @@ -641,7 +867,8 @@ menus_last_opened_update_labels (void) if (widget != NULL) { gtk_widget_show (widget); - gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), entry_filename->str); + gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), + entry_filename->str); } filename_slist = filename_slist->next; } @@ -677,11 +904,13 @@ menus_last_opened_add (gchar *filename) } raw_filename = g_string_new (filename); - last_opened_raw_filenames = g_slist_prepend (last_opened_raw_filenames, raw_filename); + last_opened_raw_filenames = g_slist_prepend (last_opened_raw_filenames, + raw_filename); if (num_entries == 0) { - widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path); + widget = gtk_item_factory_get_widget (toolbox_factory, + file_menu_separator.entry.path); gtk_widget_show (widget); } @@ -728,11 +957,14 @@ menus_init_mru (void) for (i=0; i < last_opened_size; i++) { widget = gtk_item_factory_get_widget (toolbox_factory, - last_opened_entries[i].path); + last_opened_entries[i].path); + gtk_object_set_data (GTK_OBJECT (widget), "help_page", + (gpointer) "file/last_opened.html"); gtk_widget_hide (widget); } - widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path); + widget = gtk_item_factory_get_widget (toolbox_factory, + file_menu_separator.entry.path); gtk_widget_hide (widget); g_free (paths); @@ -740,19 +972,135 @@ menus_init_mru (void) g_free (last_opened_entries); } +/* This function gets called while browsing a menu created + * by a GtkItemFactory + */ +static gint +menus_item_key_press (GtkWidget *widget, + GdkEventKey *kevent, + gpointer data) +{ + GtkItemFactory *item_factory = NULL; + GtkWidget *active_menu_item = NULL; + gchar *help_path = NULL; + gchar *help_page = NULL; + + if (kevent->keyval != GDK_F1) + return FALSE; + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), + "key_press_event"); + + item_factory = (GtkItemFactory *) data; + help_path = (gchar *) gtk_object_get_data (GTK_OBJECT (item_factory), + "help_path"); + + active_menu_item = GTK_MENU_SHELL (widget)->active_menu_item; + if (active_menu_item) + help_page = (gchar *) gtk_object_get_data (GTK_OBJECT (active_menu_item), + "help_page"); + if (! help_page) + help_page = "index.html"; + + if (help_path && help_page) + { + gchar *help_string; + + help_string = g_strdup_printf ("%s/%s", help_path, help_page); + gimp_help (help_string); + g_free (help_string); + } + else + { + gimp_help (NULL); + } + + return TRUE; +} + +/* set up the callback to catch the "F1" key */ +static void +menus_item_realize (GtkWidget *widget, + gpointer data) +{ + if (GTK_IS_MENU_SHELL (widget->parent)) + { + if (! gtk_object_get_data (GTK_OBJECT (widget->parent), + "menus_key_press_connected")) + { + gtk_signal_connect (GTK_OBJECT (widget->parent), "key_press_event", + GTK_SIGNAL_FUNC (menus_item_key_press), + (gpointer) data); + + gtk_object_set_data (GTK_OBJECT (widget->parent), + "menus_key_press_connected", + (gpointer) TRUE); + } + } +} + +static void +menus_create_item (GtkItemFactory *item_factory, + GimpItemFactoryEntry *entry, + gpointer callback_data, + guint callback_type) +{ + GtkWidget *item; + + gtk_item_factory_create_item (item_factory, + (GtkItemFactoryEntry *) entry, + callback_data, + callback_type); + + item = gtk_item_factory_get_item (item_factory, + ((GtkItemFactoryEntry *) entry)->path); + + if (item) + { + gtk_signal_connect_after (GTK_OBJECT (item), "realize", + GTK_SIGNAL_FUNC (menus_item_realize), + (gpointer) item_factory); + + gtk_object_set_data (GTK_OBJECT (item), "help_page", + (gpointer) entry->help_page); + } +} + +static void +menus_create_items (GtkItemFactory *item_factory, + guint n_entries, + GimpItemFactoryEntry *entries, + gpointer callback_data, + guint callback_type) +{ + gint i; + + for (i = 0; i < n_entries; i++) + { + menus_create_item (item_factory, + entries + i, + callback_data, + callback_type); + } +} + void menus_init_toolbox (void) { toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "", NULL); + gtk_object_set_data (GTK_OBJECT (toolbox_factory), "help_path", + (gpointer) "toolbox"); gtk_item_factory_set_translate_func (toolbox_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (toolbox_factory, n_toolbox_entries, - toolbox_entries, NULL, 2); + menus_create_items (toolbox_factory, n_toolbox_entries, + toolbox_entries, NULL, 2); menus_init_mru (); - gtk_item_factory_create_item (toolbox_factory, &file_menu_separator, NULL, 2); - - gtk_item_factory_create_item (toolbox_factory, &toolbox_end, NULL, 2); + menus_create_items (toolbox_factory, 1, + &file_menu_separator, NULL, 2); + + menus_create_items (toolbox_factory, 1, + &toolbox_end, NULL, 2); } static void @@ -769,13 +1117,15 @@ menus_init (void) menus_init_toolbox (); image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (image_factory), "help_path", + (gpointer) "image"); gtk_item_factory_set_translate_func (image_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (image_factory, - n_image_entries, - image_entries, - NULL, 2); + menus_create_items (image_factory, + n_image_entries, + image_entries, + NULL, 2); load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); gtk_item_factory_set_translate_func (load_factory, @@ -796,31 +1146,37 @@ menus_init (void) NULL, 2); layers_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (layers_factory), "help_path", + (gpointer) "layers"); gtk_item_factory_set_translate_func (layers_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (layers_factory, - n_layers_entries, - layers_entries, - NULL, 2); + menus_create_items (layers_factory, + n_layers_entries, + layers_entries, + NULL, 2); channels_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (channels_factory), "help_path", + (gpointer) "channels"); gtk_item_factory_set_translate_func (channels_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (channels_factory, - n_channels_entries, - channels_entries, - NULL, 2); + menus_create_items (channels_factory, + n_channels_entries, + channels_entries, + NULL, 2); paths_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (paths_factory), "help_path", + (gpointer) "paths"); gtk_item_factory_set_translate_func (paths_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (paths_factory, - n_paths_entries, - paths_entries, - NULL, 2); + menus_create_items (paths_factory, + n_paths_entries, + paths_entries, + NULL, 2); for (i = 0; i < num_tools; i++) { @@ -866,7 +1222,7 @@ tearoff_delete_cb (GtkWidget *widget, gpointer data) { /* Unregister if dialog is deleted as well */ - dialog_unregister((GtkWidget *)data); + dialog_unregister ((GtkWidget *) data); return TRUE; } @@ -875,16 +1231,16 @@ tearoff_cmd_callback (GtkWidget *widget, gpointer callback_data, guint callback_action) { - if(GTK_IS_TEAROFF_MENU_ITEM(widget)) + if (GTK_IS_TEAROFF_MENU_ITEM (widget)) { GtkTearoffMenuItem *tomi = (GtkTearoffMenuItem *)widget; - if(tomi->torn_off) + if (tomi->torn_off) { GtkWidget *top = gtk_widget_get_toplevel(widget); /* This should be a window */ - if(!GTK_IS_WINDOW(top)) + if (!GTK_IS_WINDOW (top)) { g_message(_("tearoff menu not in top level window")); } @@ -904,7 +1260,7 @@ tearoff_cmd_callback (GtkWidget *widget, GtkWidget *top = (GtkWidget *)gtk_object_get_data (GTK_OBJECT (widget),"tearoff_menu_top"); if(!top) { - g_message(_("can't unregister tearoff menu top level window")); + g_message (_("can't unregister tearoff menu top level window")); } else { diff --git a/app/menus/menus.c b/app/menus/menus.c index 5550911d3a..98c1e5694c 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -17,13 +17,14 @@ */ #include #include +#include + #include "appenv.h" #include "channels_dialog.h" #include "colormaps.h" #include "commands.h" #include "dialog_handler.h" #include "fileops.h" -#include "general.h" #include "gimprc.h" #include "interface.h" #include "layers_dialog.h" @@ -43,6 +44,16 @@ #define MRU_MENU_ENTRY_SIZE (strlen (_("/File/MRU00 ")) + 1) #define MRU_MENU_ACCEL_SIZE sizeof ("0") +typedef struct _GimpItemFactoryEntry GimpItemFactoryEntry; + +struct _GimpItemFactoryEntry +{ + GtkItemFactoryEntry entry; + + gchar *help_page; + gchar *description; +}; + static char* G_GNUC_UNUSED dummyMenus[] = { N_("/File/MRU00 "), N_("/File"), N_("/File/Dialogs"), @@ -53,8 +64,12 @@ static char* G_GNUC_UNUSED dummyMenus[] = { N_("/File/MRU00 "), N_("/View/Zoom"), N_("/Stack")}; +static void menus_create_item (GtkItemFactory *item_factory, + GimpItemFactoryEntry *entry, + gpointer callback_data, + guint callback_type); static void menus_init (void); -static gchar* menu_translate (const gchar *path, +static gchar *menu_translate (const gchar *path, gpointer data); static void tearoff_cmd_callback (GtkWidget *widget, gpointer callback_data, @@ -62,184 +77,342 @@ static void tearoff_cmd_callback (GtkWidget *widget, static GSList *last_opened_raw_filenames = NULL; -static GtkItemFactoryEntry toolbox_entries[] = +static GimpItemFactoryEntry toolbox_entries[] = { - { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/New"), "N", file_new_cmd_callback, 0 }, - { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, - { N_("/File/Acquire"), NULL, NULL, 0, "" }, - { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, - { N_("/File/Help..."), NULL, gimp_help_cmd_callback, 0 }, - { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, - { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, + { { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/New"), "N", file_new_cmd_callback, 0 }, + "file/dialogs/file_new.html", NULL }, + { { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, + "file/dialogs/file_open.html", NULL }, + { { N_("/File/Acquire/tearoff1"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, + "file/dialogs/about.html", NULL }, + { { N_("/File/Help..."), NULL, gimp_help_cmd_callback, 0 }, + "file/dialogs/help.html", NULL }, + { { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, + "file/dialogs/preferences.html", NULL }, + { { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, + "file/dialogs/tip_of_the_day.html", NULL }, - { N_("/File/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, - { N_("/File/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, - { N_("/File/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, - { N_("/File/Dialogs/Gradient..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, - { N_("/File/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/File/Dialogs/Tool Options..."), "T", dialogs_tools_options_cmd_callback, 0 }, - { N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, - { N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, - { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, - { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, - { N_("/File/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + { { N_("/File/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, + "file/dialogs/brush_selection.html", NULL }, + { { N_("/File/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, + "file/dialogs/pattern_selection.html", NULL }, + { { N_("/File/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, + "file/dialogs/palette_selection.html", NULL }, + { { N_("/File/Dialogs/Gradients..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, + "file/dialogs/gradient_selection.html", NULL }, + { { N_("/File/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "file/dialogs/layers_and_channels.html", NULL }, + { { N_("/File/Dialogs/Tool Options..."), "T", dialogs_tools_options_cmd_callback, 0 }, + "file/dialogs/tool_options.html", NULL }, + { { N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, + "file/dialogs/input_devices.html", NULL }, + { { N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, + "file/dialogs/device_status.html", NULL }, + { { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, + "file/dialogs/document_index.html", NULL }, + { { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, + "file/dialogs/error_console.html", NULL }, + { { N_("/File/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + "file/dialogs/display_filters.html", NULL }, - { N_("/Xtns/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 }, - { N_("/File/---"), NULL, NULL, 0, "" }, - { N_("/File/---"), NULL, NULL, 0, "" } + { { N_("/Xtns/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 }, + "xtns/module_browser.html", NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, }; -static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); +static guint n_toolbox_entries = (sizeof (toolbox_entries) / + sizeof (toolbox_entries[0])); static GtkItemFactory *toolbox_factory = NULL; -static GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "" }; -static GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }; +static GimpItemFactoryEntry file_menu_separator = +{ { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }; -static GtkItemFactoryEntry image_entries[] = +static GimpItemFactoryEntry toolbox_end = +{ { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, + "file/dialogs/quit.html", NULL }; + +static GimpItemFactoryEntry image_entries[] = { - { N_("/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/New"), "N", file_new_cmd_callback, 1 }, - { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, - { N_("/File/Save"), "S", file_save_cmd_callback, 0 }, - { N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 }, - { N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 }, - { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, - { N_("/File/---"), NULL, NULL, 0, "" }, + { { N_("/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/New"), "N", file_new_cmd_callback, 1 }, + "file/dialogs/file_new.html", NULL }, + { { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, + "file/dialogs/file_open.html", NULL }, + { { N_("/File/Save"), "S", file_save_cmd_callback, 0 }, + "file/dialogs/file_save.html", NULL }, + { { N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 }, + "file/dialogs/save_as.html", NULL }, + { { N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 }, + "file/revert.html", NULL }, + { { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, + "file/dialogs/preferences.html", NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/File/Close"), "W", file_close_cmd_callback, 0 }, - { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, - { N_("/File/---moved"), NULL, NULL, 0, "" }, + { { N_("/File/Close"), "W", file_close_cmd_callback, 0 }, + "file/close.html", NULL }, + { { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, + "file/dialogs/quit.html", NULL }, + { { N_("/File/---moved"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Edit/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Edit/Cut"), "X", edit_cut_cmd_callback, 0 }, - { N_("/Edit/Copy"), "C", edit_copy_cmd_callback, 0 }, - { N_("/Edit/Paste"), "V", edit_paste_cmd_callback, 0 }, - { N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 }, - { N_("/Edit/Paste As New"), NULL, edit_paste_as_new_cmd_callback, 0 }, - { N_("/Edit/---"), NULL, NULL, 0, "" }, - { N_("/Edit/Clear"), "K", edit_clear_cmd_callback, 0 }, - { N_("/Edit/Fill"), "period", edit_fill_cmd_callback, 0 }, - { N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 }, - { N_("/Edit/Undo"), "Z", edit_undo_cmd_callback, 0 }, - { N_("/Edit/Redo"), "R", edit_redo_cmd_callback, 0 }, - { N_("/Edit/Undo history..."), NULL, edit_show_undo_history_cmd_callback, 0}, - { N_("/Edit/---"), NULL, NULL, 0, "" }, - { N_("/Edit/Cut Named"), "X", edit_named_cut_cmd_callback, 0 }, - { N_("/Edit/Copy Named"), "C", edit_named_copy_cmd_callback, 0 }, - { N_("/Edit/Paste Named"), "V", edit_named_paste_cmd_callback, 0 }, - { N_("/Edit/---"), NULL, NULL, 0, "" }, + { { N_("/Edit/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Cut"), "X", edit_cut_cmd_callback, 0 }, + "edit/cut.html", NULL }, + { { N_("/Edit/Copy"), "C", edit_copy_cmd_callback, 0 }, + "edit/copy.html", NULL }, + { { N_("/Edit/Paste"), "V", edit_paste_cmd_callback, 0 }, + "edit/paste.html", NULL }, + { { N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 }, + "edit/paste_into.html", NULL }, + { { N_("/Edit/Paste As New"), NULL, edit_paste_as_new_cmd_callback, 0 }, + "edit/paste_as_new.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Clear"), "K", edit_clear_cmd_callback, 0 }, + "edit/clear.html", NULL }, + { { N_("/Edit/Fill"), "period", edit_fill_cmd_callback, 0 }, + "edit/fill.html", NULL }, + { { N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 }, + "edit/stroke.html", NULL }, + { { N_("/Edit/Undo"), "Z", edit_undo_cmd_callback, 0 }, + "edit/undo.html", NULL }, + { { N_("/Edit/Redo"), "R", edit_redo_cmd_callback, 0 }, + "edit/redo.html", NULL }, + { { N_("/Edit/Undo history..."), NULL, edit_show_undo_history_cmd_callback, 0}, + "edit/dialogs/undo_history.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Cut Named"), "X", edit_named_cut_cmd_callback, 0 }, + "edit/dialogs/cut_named.html", NULL }, + { { N_("/Edit/Copy Named"), "C", edit_named_copy_cmd_callback, 0 }, + "edit/dialogs/copy_named.html", NULL }, + { { N_("/Edit/Paste Named"), "V", edit_named_paste_cmd_callback, 0 }, + "edit/dialogs/paste_named.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Select/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Select/Invert"), "I", select_invert_cmd_callback, 0 }, - { N_("/Select/All"), "A", select_all_cmd_callback, 0 }, - { N_("/Select/None"), "A", select_none_cmd_callback, 0 }, - { N_("/Select/Float"), "L", select_float_cmd_callback, 0 }, - { N_("/Select/---"), NULL, NULL, 0, "" }, - { N_("/Select/Feather"), "F", select_feather_cmd_callback, 0 }, - { N_("/Select/Sharpen"), "H", select_sharpen_cmd_callback, 0 }, - { N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 }, - { N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 }, - { N_("/Select/Border"), "B", select_border_cmd_callback, 0 }, - { N_("/Select/---"), NULL, NULL, 0, "" }, - { N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 }, + { { N_("/Select/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Select/Invert"), "I", select_invert_cmd_callback, 0 }, + "select/invert.html", NULL }, + { { N_("/Select/All"), "A", select_all_cmd_callback, 0 }, + "select/all.html", NULL }, + { { N_("/Select/None"), "A", select_none_cmd_callback, 0 }, + "select/none.html", NULL }, + { { N_("/Select/Float"), "L", select_float_cmd_callback, 0 }, + "select/float.html", NULL }, + { { N_("/Select/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Select/Feather"), "F", select_feather_cmd_callback, 0 }, + "select/dialogs/feather_selection.html", NULL }, + { { N_("/Select/Sharpen"), "H", select_sharpen_cmd_callback, 0 }, + "select/sharpen.html", NULL }, + { { N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 }, + "select/dialogs/shrink_selection.html", NULL }, + { { N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 }, + "select/dialogs/grow_selection.html", NULL }, + { { N_("/Select/Border"), "B", select_border_cmd_callback, 0 }, + "select/dialogs/border_selection.html", NULL }, + { { N_("/Select/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 }, + "select/save_to_channel.html", NULL }, - { N_("/View/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 }, - { N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 }, - { N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 }, - { N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 }, - { N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 }, - { N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 }, - { N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 }, - { N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 }, - { N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 }, - { N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 }, - { N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 }, - { N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, ""}, - { N_("/View/Window Info..."), "I", view_window_info_cmd_callback, 0 }, - { N_("/View/Window Nav..."), NULL, view_window_nav_cmd_callback, 0 }, + { { N_("/View/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "" }, + "view/dot_for_dot.html", NULL }, + { { N_("/View/Info Window..."), "I", view_window_info_cmd_callback, 0 }, + "view/dialogs/info_window.html", NULL }, + { { N_("/View/Nav. Window..."), NULL, view_window_nav_cmd_callback, 0 }, + "view/dialogs/navigation_window.html", NULL }, - { N_("/View/---"), NULL, NULL, 0, "" }, - { N_("/View/Toggle Selection"), "T", view_toggle_selection_cmd_callback, 0, "" }, - { N_("/View/Toggle Rulers"), "R", view_toggle_rulers_cmd_callback, 0, "" }, - { N_("/View/Toggle Statusbar"), "S", view_toggle_statusbar_cmd_callback, 0, "" }, - { N_("/View/Toggle Guides"), "T", view_toggle_guides_cmd_callback, 0, "" }, - { N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "" }, - { N_("/View/---"), NULL, NULL, 0, "" }, + { { N_("/View/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/View/Toggle Selection"), "T", view_toggle_selection_cmd_callback, 0, "" }, + "view/toggle_selection.html", NULL }, + { { N_("/View/Toggle Rulers"), "R", view_toggle_rulers_cmd_callback, 0, "" }, + "view/toggle_rulers.html", NULL }, + { { N_("/View/Toggle Statusbar"), "S", view_toggle_statusbar_cmd_callback, 0, "" }, + "view/toggle_statusbar.html", NULL }, + { { N_("/View/Toggle Guides"), "T", view_toggle_guides_cmd_callback, 0, "" }, + "view/toggle_guides.html", NULL }, + { { N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "" }, + "view/snap_to_guides.html", NULL }, + { { N_("/View/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 }, - { N_("/View/Shrink Wrap"), "E", view_shrink_wrap_cmd_callback, 0 }, + { { N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 }, + "view/new_view.html", NULL }, + { { N_("/View/Shrink Wrap"), "E", view_shrink_wrap_cmd_callback, 0 }, + "view/shrink_wrap.html", NULL }, - { N_("/Image/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Colors/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 }, - { N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 }, - { N_("/Image/Colors/---"), NULL, NULL, 0, "" }, - { N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 }, - { N_("/Image/Channel Ops/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Channel Ops/Duplicate"), "D", channel_ops_duplicate_cmd_callback, 0 }, - { N_("/Image/Channel Ops/Offset"), "O", channel_ops_offset_cmd_callback, 0 }, - { N_("/Image/Alpha/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + { { N_("/Image/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 }, + "image/colors/equalize.html", NULL }, + { { N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 }, + "image/colors/invert.html", NULL }, + { { N_("/Image/Colors/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 }, + "image/colors/desaturate.html", NULL }, + + { { N_("/Image/Channels/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + + { { N_("/Image/Alpha/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + "layers/add_alpha_channel.html", NULL }, + + { { N_("/Image/Transforms/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Transforms/Offset"), "O", channel_ops_offset_cmd_callback, 0 }, + "image/transforms/dialogs/offset.html", NULL }, - { N_("/Image/---"), NULL, NULL, 0, "" }, - { N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 }, - { N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 }, - { N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 }, - { N_("/Image/---"), NULL, NULL, 0, "" }, - { N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 }, - { N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 }, - { N_("/Image/---"), NULL, NULL, 0, "" }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 }, + "image/convert_to_rgb.html", NULL }, + { { N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 }, + "image/convert_to_grayscale.html", NULL }, + { { N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 }, + "image/dialogs/convert_to_indexed.html", NULL }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 }, + "image/dialogs/resize_image.html", NULL }, + { { N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 }, + "image/dialogs/scale_image.html", NULL }, + { { N_("/Image/Duplicate"), "D", channel_ops_duplicate_cmd_callback, 0 }, + "image/duplicate.html", NULL }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Layers/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Layers/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/Layers/Stack/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 }, - { N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 }, - { N_("/Layers/Stack/Raise Layer"), "Prior", layers_raise_cmd_callback, 0 }, - { N_("/Layers/Stack/Lower Layer"), "Next", layers_lower_cmd_callback, 0 }, - { N_("/Layers/Stack/Layer to Top"), "Prior", layers_raise_to_top_cmd_callback, 0 }, - { N_("/Layers/Stack/Layer to Bottom"), "Next", layers_lower_to_bottom_cmd_callback, 0 }, - { N_("/Layers/---"), NULL, NULL, 0, "" }, - { N_("/Layers/Anchor Layer"), "H", layers_anchor_cmd_callback, 0 }, - { N_("/Layers/Merge Visible Layers"), "M", layers_merge_cmd_callback, 0 }, - { N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 }, - { N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 }, - { N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 }, - { N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, - { N_("/Layers/---"), NULL, NULL, 0, "" }, + { { N_("/Layers/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "layers/dialogs/layers_and_channels.html", NULL }, + { { N_("/Layers/Stack/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 }, + "layers/stack/index.html#previous_layer", NULL }, + { { N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 }, + "layers/stack/index.html#next_layer", NULL }, + { { N_("/Layers/Stack/Raise Layer"), "Prior", layers_raise_cmd_callback, 0 }, + "layers/stack/index.html#raise_layer", NULL }, + { { N_("/Layers/Stack/Lower Layer"), "Next", layers_lower_cmd_callback, 0 }, + "layers/stack/index.html#lower_layer", NULL }, + { { N_("/Layers/Stack/Layer to Top"), "Prior", layers_raise_to_top_cmd_callback, 0 }, + "layers/stack/index.html#layer_to_top", NULL }, + { { N_("/Layers/Stack/Layer to Bottom"), "Next", layers_lower_to_bottom_cmd_callback, 0 }, + "layers/stack/index.html#layer_to_bottom", NULL }, + { { N_("/Layers/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Anchor Layer"), "H", layers_anchor_cmd_callback, 0 }, + "layers/anchor_layer.html", NULL }, + { { N_("/Layers/Merge Visible Layers"), "M", layers_merge_cmd_callback, 0 }, + "layers/dialogs/layers/merge_visible_layers.html", NULL }, + { { N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 }, + "layers/flatten_image.html", NULL }, + { { N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 }, + "layers/alpha_to_selection.html", NULL }, + { { N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 }, + "layers/mask_to_selection.html", NULL }, + { { N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + "layers/add_alpha_channel.html", NULL }, + { { N_("/Layers/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Tools/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 }, - { N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 }, - { N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, - { N_("/Tools/---"), NULL, NULL, 0, "" }, + { { N_("/Tools/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 }, + "toolbox/index.html", NULL }, + { { N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 }, + "toolbox/index.html#default_colors", NULL }, + { { N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, + "toolbox/index.html#swap_colors", NULL }, + { { N_("/Tools/---"), NULL, NULL, 0, "" }, + NULL, NULL }, /* the tool entries themselves are built on the fly */ - { N_("/Filters/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Filters/Repeat last"), "F", filters_repeat_cmd_callback, 0x0 }, - { N_("/Filters/Re-show last"), "F", filters_repeat_cmd_callback, 0x1 }, - { N_("/Filters/---"), NULL, NULL, 0, "" }, + { { N_("/Filters/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Filters/Repeat last"), "F", filters_repeat_cmd_callback, 0x0 }, + "filters/repeat_last.html", NULL }, + { { N_("/Filters/Re-show last"), "F", filters_repeat_cmd_callback, 0x1 }, + "filters/reshow_last.html", NULL }, + { { N_("/Filters/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Script-Fu/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Script-Fu/"), NULL, NULL, 0 }, + { { N_("/Script-Fu/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, - { N_("/Dialogs/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, - { N_("/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, - { N_("/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, - { N_("/Dialogs/Gradient..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, - { N_("/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 }, - { N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 }, - { N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, - { N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, - { N_("/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 } + { { N_("/Dialogs/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, + "dialogs/brush_selection.html", NULL }, + { { N_("/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, + "dialogs/pattern_selection.html", NULL }, + { { N_("/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, + "dialogs/palette_selection.html", NULL }, + { { N_("/Dialogs/Gradients..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, + "dialogs/gradient_selection.html", NULL }, + { { N_("/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "dialogs/layers_and_channels.html", NULL }, + { { N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 }, + "dialogs/indexed_palette.html", NULL }, + { { N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 }, + "dialogs/tool_options.html", NULL }, + { { N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, + "dialogs/input_devices.html", NULL }, + { { N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, + "dialogs/device_status.html", NULL }, + { { N_("/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + "dialogs/display_filters.html", NULL }, }; -static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]); +static guint n_image_entries = (sizeof (image_entries) / + sizeof (image_entries[0])); static GtkItemFactory *image_factory = NULL; static GtkItemFactoryEntry load_entries[] = @@ -258,66 +431,113 @@ static GtkItemFactoryEntry save_entries[] = static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]); static GtkItemFactory *save_factory = NULL; -static GtkItemFactoryEntry layers_entries[] = +static GimpItemFactoryEntry layers_entries[] = { - { N_("/New Layer"), "N", layers_dialog_new_layer_callback, 0 }, - { N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 }, - { N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 }, - { N_("/Stack/Raise Layer"), "Prior", layers_dialog_raise_layer_callback, 0 }, - { N_("/Stack/Lower Layer"), "Next", layers_dialog_lower_layer_callback, 0 }, - { N_("/Stack/Layer to Top"), "Prior", layers_dialog_raise_layer_to_top_callback, 0 }, - { N_("/Stack/Layer to Bottom"), "Next", layers_dialog_lower_layer_to_bottom_callback, 0 }, - { N_("/Duplicate Layer"), "C", layers_dialog_duplicate_layer_callback, 0 }, - { N_("/Anchor Layer"), "H", layers_dialog_anchor_layer_callback, 0 }, - { N_("/Delete Layer"), "X", layers_dialog_delete_layer_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Scale Layer"), "S", layers_dialog_scale_layer_callback, 0 }, - { N_("/Resize Layer"), "R", layers_dialog_resize_layer_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Merge Visible Layers"), "M", layers_dialog_merge_layers_callback, 0 }, - { N_("/Merge Down"), "M", layers_dialog_merge_down_callback, 0 }, - { N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 }, - { N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 }, - { N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 }, - { N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 }, - { N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 } + { { N_("/New Layer"), "N", layers_dialog_new_layer_callback, 0 }, + "dialogs/layers/new_layer.html", NULL }, + { { N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 }, + "stack/index.html#previous_layer", NULL }, + { { N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 }, + "stack/index.html#next_layer", NULL }, + { { N_("/Stack/Raise Layer"), "Prior", layers_dialog_raise_layer_callback, 0 }, + "stack/index.html#raise_layer", NULL }, + { { N_("/Stack/Lower Layer"), "Next", layers_dialog_lower_layer_callback, 0 }, + "stack/index.html#lower_layer", NULL }, + { { N_("/Stack/Layer to Top"), "Prior", layers_dialog_raise_layer_to_top_callback, 0 }, + "stack/index.html#later_to_top", NULL }, + { { N_("/Stack/Layer to Bottom"), "Next", layers_dialog_lower_layer_to_bottom_callback, 0 }, + "stack/index.html#layer_to_bottom", NULL }, + { { N_("/Duplicate Layer"), "C", layers_dialog_duplicate_layer_callback, 0 }, + "duplicate_layer.html", NULL }, + { { N_("/Anchor Layer"), "H", layers_dialog_anchor_layer_callback, 0 }, + "anchor_layer.html", NULL }, + { { N_("/Delete Layer"), "X", layers_dialog_delete_layer_callback, 0 }, + "delete_layer.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Scale Layer"), "S", layers_dialog_scale_layer_callback, 0 }, + "dialogs/layers/scale_layer.html", NULL }, + { { N_("/Resize Layer"), "R", layers_dialog_resize_layer_callback, 0 }, + "dialogs/layers/resize_layer.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Merge Visible Layers"), "M", layers_dialog_merge_layers_callback, 0 }, + "dialogs/layers/merge_visible_layers.html", NULL }, + { { N_("/Merge Down"), "M", layers_dialog_merge_down_callback, 0 }, + "merge_down.html", NULL }, + { { N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 }, + "flatten_image.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 }, + "dialogs/layers/add_mask.html", NULL }, + { { N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 }, + "dialogs/layers/apply_mask.html", NULL }, + { { N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 }, + "alpha_to_selection.html", NULL }, + { { N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 }, + "mask_to_selection.html", NULL }, + { { N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 }, + "add_alpha_channel.html", NULL } }; -static guint n_layers_entries = sizeof (layers_entries) / sizeof (layers_entries[0]); +static guint n_layers_entries = (sizeof (layers_entries) / + sizeof (layers_entries[0])); static GtkItemFactory *layers_factory = NULL; -static GtkItemFactoryEntry channels_entries[] = +static GimpItemFactoryEntry channels_entries[] = { - { N_("/New Channel"), "N", channels_dialog_new_channel_callback, 0 }, - { N_("/Raise Channel"), "F", channels_dialog_raise_channel_callback, 0 }, - { N_("/Lower Channel"), "B", channels_dialog_lower_channel_callback, 0 }, - { N_("/Duplicate Channel"), "C", channels_dialog_duplicate_channel_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Channel to Selection"), "S", channels_dialog_channel_to_sel_callback, 0 }, - { N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 }, - { N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, - { N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Delete Channel"), "X", channels_dialog_delete_channel_callback, 0 } + { { N_("/New Channel"), "N", channels_dialog_new_channel_callback, 0 }, + "/dialogs/channels/new_channel.html", NULL }, + { { N_("/Raise Channel"), "F", channels_dialog_raise_channel_callback, 0 }, + "raise_channel.html", NULL }, + { { N_("/Lower Channel"), "B", channels_dialog_lower_channel_callback, 0 }, + "lower_channel.html", NULL }, + { { N_("/Duplicate Channel"), "C", channels_dialog_duplicate_channel_callback, 0 }, + "duplicate_channel.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Channel to Selection"), "S", channels_dialog_channel_to_sel_callback, 0 }, + "channel_to_selection.html", NULL }, + { { N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 }, + "channel_to_selection.html#add", NULL }, + { { N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, + "channel_to_selection.html#subtract", NULL }, + { { N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, + "channel_to_selection.html#intersect", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Delete Channel"), "X", channels_dialog_delete_channel_callback, 0 }, + "delete_layer.html", NULL } }; -static guint n_channels_entries = sizeof (channels_entries) / sizeof (channels_entries[0]); +static guint n_channels_entries = (sizeof (channels_entries) / + sizeof (channels_entries[0])); static GtkItemFactory *channels_factory = NULL; -static GtkItemFactoryEntry paths_entries[] = +static GimpItemFactoryEntry paths_entries[] = { - { N_("/New Path"), "N", paths_dialog_new_path_callback, 0 }, - { N_("/Duplicate Path"), "U", paths_dialog_dup_path_callback, 0 }, - { N_("/Path to Selection"), "S", paths_dialog_path_to_sel_callback, 0 }, - { N_("/Stroke Path"), "T", paths_dialog_stroke_path_callback, 0 }, - { N_("/Delete Path"), "X", paths_dialog_delete_path_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Copy Path"), "C", paths_dialog_copy_path_callback, 0 }, - { N_("/Paste Path"), "V", paths_dialog_paste_path_callback, 0 }, - { N_("/Import Path"), "I", paths_dialog_import_path_callback, 0 }, - { N_("/Export Path"), "E", paths_dialog_export_path_callback, 0 } + { { N_("/New Path"), "N", paths_dialog_new_path_callback, 0 }, + "new_path.html", NULL }, + { { N_("/Duplicate Path"), "U", paths_dialog_dup_path_callback, 0 }, + "duplicate_path.html", NULL }, + { { N_("/Path to Selection"), "S", paths_dialog_path_to_sel_callback, 0 }, + "path_to_selection.html", NULL }, + { { N_("/Stroke Path"), "T", paths_dialog_stroke_path_callback, 0 }, + "stroke_path.html", NULL }, + { { N_("/Delete Path"), "X", paths_dialog_delete_path_callback, 0 }, + "delete_path.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Copy Path"), "C", paths_dialog_copy_path_callback, 0 }, + "copy_path.html", NULL }, + { { N_("/Paste Path"), "V", paths_dialog_paste_path_callback, 0 }, + "paste_path.html", NULL }, + { { N_("/Import Path"), "I", paths_dialog_import_path_callback, 0 }, + "import_path.html", NULL }, + { { N_("/Export Path"), "E", paths_dialog_export_path_callback, 0 }, + "export_path.html", NULL } }; -static guint n_paths_entries = sizeof (paths_entries) / sizeof (paths_entries[0]); +static guint n_paths_entries = (sizeof (paths_entries) / + sizeof (paths_entries[0])); static GtkItemFactory *paths_factory = NULL; static int initialize = TRUE; @@ -479,18 +699,23 @@ menus_create (GtkMenuEntry *entries, void menus_tools_create (ToolInfo *tool_info) { - GtkItemFactoryEntry entry; + GimpItemFactoryEntry entry; - entry.path = tool_info->menu_path; - entry.accelerator = tool_info->menu_accel; - entry.callback = tools_select_cmd_callback; - entry.callback_action = tool_info->tool_id; - entry.item_type = NULL; + entry.entry.path = tool_info->menu_path; + entry.entry.accelerator = tool_info->menu_accel; + entry.entry.callback = tools_select_cmd_callback; + entry.entry.callback_action = tool_info->tool_id; + entry.entry.item_type = NULL; + entry.help_page = g_strconcat ("tools/", + tool_info->private_tip, + ".html", + NULL); + entry.description = NULL; - gtk_item_factory_create_item (image_factory, - &entry, - (gpointer) tool_info, - 2); + menus_create_item (image_factory, + &entry, + (gpointer) tool_info, + 2); } void @@ -633,7 +858,8 @@ menus_last_opened_update_labels (void) for (i = 1; i <= num_entries; i++) { - g_string_sprintf (entry_filename, "%d. %s", i, g_basename (((GString *) filename_slist->data)->str)); + g_string_sprintf (entry_filename, "%d. %s", i, + g_basename (((GString *) filename_slist->data)->str)); g_string_sprintf (path, N_("/File/MRU%02d"), i); @@ -641,7 +867,8 @@ menus_last_opened_update_labels (void) if (widget != NULL) { gtk_widget_show (widget); - gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), entry_filename->str); + gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), + entry_filename->str); } filename_slist = filename_slist->next; } @@ -677,11 +904,13 @@ menus_last_opened_add (gchar *filename) } raw_filename = g_string_new (filename); - last_opened_raw_filenames = g_slist_prepend (last_opened_raw_filenames, raw_filename); + last_opened_raw_filenames = g_slist_prepend (last_opened_raw_filenames, + raw_filename); if (num_entries == 0) { - widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path); + widget = gtk_item_factory_get_widget (toolbox_factory, + file_menu_separator.entry.path); gtk_widget_show (widget); } @@ -728,11 +957,14 @@ menus_init_mru (void) for (i=0; i < last_opened_size; i++) { widget = gtk_item_factory_get_widget (toolbox_factory, - last_opened_entries[i].path); + last_opened_entries[i].path); + gtk_object_set_data (GTK_OBJECT (widget), "help_page", + (gpointer) "file/last_opened.html"); gtk_widget_hide (widget); } - widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path); + widget = gtk_item_factory_get_widget (toolbox_factory, + file_menu_separator.entry.path); gtk_widget_hide (widget); g_free (paths); @@ -740,19 +972,135 @@ menus_init_mru (void) g_free (last_opened_entries); } +/* This function gets called while browsing a menu created + * by a GtkItemFactory + */ +static gint +menus_item_key_press (GtkWidget *widget, + GdkEventKey *kevent, + gpointer data) +{ + GtkItemFactory *item_factory = NULL; + GtkWidget *active_menu_item = NULL; + gchar *help_path = NULL; + gchar *help_page = NULL; + + if (kevent->keyval != GDK_F1) + return FALSE; + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), + "key_press_event"); + + item_factory = (GtkItemFactory *) data; + help_path = (gchar *) gtk_object_get_data (GTK_OBJECT (item_factory), + "help_path"); + + active_menu_item = GTK_MENU_SHELL (widget)->active_menu_item; + if (active_menu_item) + help_page = (gchar *) gtk_object_get_data (GTK_OBJECT (active_menu_item), + "help_page"); + if (! help_page) + help_page = "index.html"; + + if (help_path && help_page) + { + gchar *help_string; + + help_string = g_strdup_printf ("%s/%s", help_path, help_page); + gimp_help (help_string); + g_free (help_string); + } + else + { + gimp_help (NULL); + } + + return TRUE; +} + +/* set up the callback to catch the "F1" key */ +static void +menus_item_realize (GtkWidget *widget, + gpointer data) +{ + if (GTK_IS_MENU_SHELL (widget->parent)) + { + if (! gtk_object_get_data (GTK_OBJECT (widget->parent), + "menus_key_press_connected")) + { + gtk_signal_connect (GTK_OBJECT (widget->parent), "key_press_event", + GTK_SIGNAL_FUNC (menus_item_key_press), + (gpointer) data); + + gtk_object_set_data (GTK_OBJECT (widget->parent), + "menus_key_press_connected", + (gpointer) TRUE); + } + } +} + +static void +menus_create_item (GtkItemFactory *item_factory, + GimpItemFactoryEntry *entry, + gpointer callback_data, + guint callback_type) +{ + GtkWidget *item; + + gtk_item_factory_create_item (item_factory, + (GtkItemFactoryEntry *) entry, + callback_data, + callback_type); + + item = gtk_item_factory_get_item (item_factory, + ((GtkItemFactoryEntry *) entry)->path); + + if (item) + { + gtk_signal_connect_after (GTK_OBJECT (item), "realize", + GTK_SIGNAL_FUNC (menus_item_realize), + (gpointer) item_factory); + + gtk_object_set_data (GTK_OBJECT (item), "help_page", + (gpointer) entry->help_page); + } +} + +static void +menus_create_items (GtkItemFactory *item_factory, + guint n_entries, + GimpItemFactoryEntry *entries, + gpointer callback_data, + guint callback_type) +{ + gint i; + + for (i = 0; i < n_entries; i++) + { + menus_create_item (item_factory, + entries + i, + callback_data, + callback_type); + } +} + void menus_init_toolbox (void) { toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "", NULL); + gtk_object_set_data (GTK_OBJECT (toolbox_factory), "help_path", + (gpointer) "toolbox"); gtk_item_factory_set_translate_func (toolbox_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (toolbox_factory, n_toolbox_entries, - toolbox_entries, NULL, 2); + menus_create_items (toolbox_factory, n_toolbox_entries, + toolbox_entries, NULL, 2); menus_init_mru (); - gtk_item_factory_create_item (toolbox_factory, &file_menu_separator, NULL, 2); - - gtk_item_factory_create_item (toolbox_factory, &toolbox_end, NULL, 2); + menus_create_items (toolbox_factory, 1, + &file_menu_separator, NULL, 2); + + menus_create_items (toolbox_factory, 1, + &toolbox_end, NULL, 2); } static void @@ -769,13 +1117,15 @@ menus_init (void) menus_init_toolbox (); image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (image_factory), "help_path", + (gpointer) "image"); gtk_item_factory_set_translate_func (image_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (image_factory, - n_image_entries, - image_entries, - NULL, 2); + menus_create_items (image_factory, + n_image_entries, + image_entries, + NULL, 2); load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); gtk_item_factory_set_translate_func (load_factory, @@ -796,31 +1146,37 @@ menus_init (void) NULL, 2); layers_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (layers_factory), "help_path", + (gpointer) "layers"); gtk_item_factory_set_translate_func (layers_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (layers_factory, - n_layers_entries, - layers_entries, - NULL, 2); + menus_create_items (layers_factory, + n_layers_entries, + layers_entries, + NULL, 2); channels_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (channels_factory), "help_path", + (gpointer) "channels"); gtk_item_factory_set_translate_func (channels_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (channels_factory, - n_channels_entries, - channels_entries, - NULL, 2); + menus_create_items (channels_factory, + n_channels_entries, + channels_entries, + NULL, 2); paths_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (paths_factory), "help_path", + (gpointer) "paths"); gtk_item_factory_set_translate_func (paths_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (paths_factory, - n_paths_entries, - paths_entries, - NULL, 2); + menus_create_items (paths_factory, + n_paths_entries, + paths_entries, + NULL, 2); for (i = 0; i < num_tools; i++) { @@ -866,7 +1222,7 @@ tearoff_delete_cb (GtkWidget *widget, gpointer data) { /* Unregister if dialog is deleted as well */ - dialog_unregister((GtkWidget *)data); + dialog_unregister ((GtkWidget *) data); return TRUE; } @@ -875,16 +1231,16 @@ tearoff_cmd_callback (GtkWidget *widget, gpointer callback_data, guint callback_action) { - if(GTK_IS_TEAROFF_MENU_ITEM(widget)) + if (GTK_IS_TEAROFF_MENU_ITEM (widget)) { GtkTearoffMenuItem *tomi = (GtkTearoffMenuItem *)widget; - if(tomi->torn_off) + if (tomi->torn_off) { GtkWidget *top = gtk_widget_get_toplevel(widget); /* This should be a window */ - if(!GTK_IS_WINDOW(top)) + if (!GTK_IS_WINDOW (top)) { g_message(_("tearoff menu not in top level window")); } @@ -904,7 +1260,7 @@ tearoff_cmd_callback (GtkWidget *widget, GtkWidget *top = (GtkWidget *)gtk_object_get_data (GTK_OBJECT (widget),"tearoff_menu_top"); if(!top) { - g_message(_("can't unregister tearoff menu top level window")); + g_message (_("can't unregister tearoff menu top level window")); } else { diff --git a/app/module_db.c b/app/module_db.c index a2fb3ebda5..5cd358d341 100644 --- a/app/module_db.c +++ b/app/module_db.c @@ -261,7 +261,7 @@ module_db_browser_new (void) shell = gimp_dialog_new (_("Module DB"), "module_db_dialog", gimp_standard_help_func, - "dialogs/module_db_dialog.html", + "dialogs/module_browser.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/palette.c b/app/palette.c index 5cda99f042..18334831f7 100644 --- a/app/palette.c +++ b/app/palette.c @@ -34,7 +34,7 @@ #include "buildmenu.h" #include "colormaps.h" #include "color_area.h" -#include "color_select.h" +#include "color_notebook.h" #include "datafiles.h" #include "devices.h" #include "errors.h" @@ -110,8 +110,8 @@ struct _PaletteDialog GtkWidget *clist; GtkWidget *popup_menu; GtkWidget *popup_small_menu; - ColorSelectP color_select; - int color_select_active; + ColorNotebookP color_notebook; + gboolean color_notebook_active; PaletteEntriesP entries; PaletteEntryP color; GdkGC *gc; @@ -470,8 +470,8 @@ palette_free () gdk_gc_destroy (top_level_edit_palette->gc); - if (top_level_edit_palette->color_select) - color_select_free (top_level_edit_palette->color_select); + if (top_level_edit_palette->color_notebook) + color_notebook_free (top_level_edit_palette->color_notebook); g_free (top_level_edit_palette); @@ -1078,7 +1078,7 @@ palette_new_entries_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("New Palette"), gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/new_palette.html", _("Enter a name for new palette"), NULL, NULL, NULL, @@ -1135,10 +1135,10 @@ palette_refresh (PaletteDialog *palette) palette->entries = NULL; /* If a color selection dialog is up, hide it */ - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } palette_free_palettes (); /* free palettes, don't save any modified versions */ palette_init_palettes (FALSE); /* reload palettes */ @@ -1234,11 +1234,11 @@ palette_draw_small_preview(GdkGC *gc, static void -palette_select_callback (gint r, - gint g, - gint b, - ColorSelectState state, - void *data) +palette_select_callback (gint r, + gint g, + gint b, + ColorNotebookState state, + void *data) { PaletteDialog *palette; guchar *color; @@ -1252,9 +1252,9 @@ palette_select_callback (gint r, { switch (state) { - case COLOR_SELECT_UPDATE: + case COLOR_NOTEBOOK_UPDATE: break; - case COLOR_SELECT_OK: + case COLOR_NOTEBOOK_OK: if (palette->color) { color = palette->color->color; @@ -1298,9 +1298,9 @@ palette_select_callback (gint r, palette_select2_set_text_all (palette->entries); } /* Fallthrough */ - case COLOR_SELECT_CANCEL: - color_select_hide (palette->color_select); - palette->color_select_active = 0; + case COLOR_NOTEBOOK_CANCEL: + color_notebook_hide (palette->color_notebook); + palette->color_notebook_active = FALSE; } } } @@ -1361,10 +1361,10 @@ palette_close_callback (GtkWidget *widget, palette = data; if (palette) { - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } if(import_dialog) @@ -1406,24 +1406,24 @@ palette_edit_callback (GtkWidget *widget, { color = palette->color->color; - if (!palette->color_select) + if (!palette->color_notebook) { - palette->color_select = - color_select_new (color[0], color[1], color[2], - palette_select_callback, palette, - FALSE); - palette->color_select_active = 1; + palette->color_notebook = + color_notebook_new (color[0], color[1], color[2], + palette_select_callback, palette, + FALSE); + palette->color_notebook_active = TRUE; } else { - if (!palette->color_select_active) + if (!palette->color_notebook_active) { - color_select_show (palette->color_select); - palette->color_select_active = 1; + color_notebook_show (palette->color_notebook); + palette->color_notebook_active = TRUE; } - color_select_set_color (palette->color_select, - color[0], color[1], color[2], 1); + color_notebook_set_color (palette->color_notebook, + color[0], color[1], color[2], 1); } } } @@ -1931,15 +1931,15 @@ palette_list_item_update (GtkWidget *widget, palette = (PaletteDialog *) data; - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } - if (palette->color_select) - color_select_free (palette->color_select); - palette->color_select = NULL; + if (palette->color_notebook) + color_notebook_free (palette->color_notebook); + palette->color_notebook = NULL; p_entries = (PaletteEntriesP) gtk_clist_get_row_data (GTK_CLIST (palette->clist), row); @@ -2013,8 +2013,8 @@ create_palette_dialog (gint vert) palette->entries = default_palette_entries; palette->color = NULL; - palette->color_select = NULL; - palette->color_select_active = 0; + palette->color_notebook = NULL; + palette->color_notebook_active = FALSE; palette->zoom_factor = 1.0; palette->columns = COLUMNS; palette->columns_valid = TRUE; @@ -2025,7 +2025,7 @@ create_palette_dialog (gint vert) palette->shell = gimp_dialog_new (_("Color Palette Edit"), "color_palette_edit", gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/index.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -2044,7 +2044,7 @@ create_palette_dialog (gint vert) palette->shell = gimp_dialog_new (_("Color Palette"), "color_palette", gimp_standard_help_func, - "dialogs/color_palette_dialog.html", + "dialogs/palette_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -2484,7 +2484,7 @@ palette_merge_dialog_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Merge Palette"), gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/merge_palette.html", _("Enter a name for merged palette"), NULL, NULL, NULL, @@ -2829,7 +2829,7 @@ palette_import_dialog (PaletteDialog *palette) import_dialog->dialog = dialog = gimp_dialog_new (_("Import Palette"), "import_palette", gimp_standard_help_func, - "dialogs/import_palette_dialog.html", + "dialogs/palette_editor/import_palette.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/palette_select.c b/app/palette_select.c index 07599ce323..d7b71d9797 100644 --- a/app/palette_select.c +++ b/app/palette_select.c @@ -16,25 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "config.h" - -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include - -#include "colormaps.h" -#include "color_area.h" -#include "color_select.h" -#include "datafiles.h" -#include "errors.h" -#include "gimprc.h" #include "gimpui.h" -#include "interface.h" -#include "palette.h" #include "palette_entries.h" #include "session.h" #include "palette_select.h" @@ -234,7 +216,7 @@ palette_new_selection (gchar *title, psp->shell = gimp_dialog_new (title ? title : _("Palette Selection"), "palette_selection", gimp_standard_help_func, - "dialogs/palette_selection_dialog.html", + "dialogs/palette_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/paths_dialog.c b/app/paths_dialog.c index fafffaaa49..1f0689ad20 100644 --- a/app/paths_dialog.c +++ b/app/paths_dialog.c @@ -1230,7 +1230,7 @@ paths_dialog_edit_path_query (GtkWidget *widget) qbox = gimp_query_string_box (_("Rename path"), gimp_standard_help_func, - "dialogs/paths_dialog.html", + "dialogs/paths/rename_path.html", _("Enter a new name for the path"), text, NULL, NULL, diff --git a/app/pattern_select.c b/app/pattern_select.c index dc4bb3b6f5..d866210c1e 100644 --- a/app/pattern_select.c +++ b/app/pattern_select.c @@ -95,7 +95,7 @@ pattern_select_new (gchar *title, psp->shell = gimp_dialog_new (title, "pattern_selection", gimp_standard_help_func, - "dialogs/pattern_selection_dialog.html", + "dialogs/pattern_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -114,7 +114,7 @@ pattern_select_new (gchar *title, psp->shell = gimp_dialog_new (_("Pattern Selection"), "pattern_selection", gimp_standard_help_func, - "dialogs/pattern_selection_dialog.html", + "dialogs/pattern_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/preferences_dialog.c b/app/preferences_dialog.c index 0a61751d03..57b6182b0e 100644 --- a/app/preferences_dialog.c +++ b/app/preferences_dialog.c @@ -1164,7 +1164,7 @@ file_pref_cmd_callback (GtkWidget *widget, prefs_dlg = gimp_dialog_new (_("Preferences"), "gimp_preferences", gimp_standard_help_func, - "dialogs/preferences_dialog.html", + "dialogs/preferences.html", GTK_WIN_POS_NONE, FALSE, FALSE, FALSE, diff --git a/app/qmask.c b/app/qmask.c index 7ff287f61d..9a3aa1b35e 100644 --- a/app/qmask.c +++ b/app/qmask.c @@ -248,7 +248,7 @@ edit_qmask_channel_query (GDisplay * gdisp) options->query_box = gimp_dialog_new (_("Edit Qmask Attributes"), "edit_qmask_attributes", gimp_standard_help_func, - "dialogs/edit_qmask_attributes_dialog.html", + "dialogs/edit_qmask_attributes.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/resize.c b/app/resize.c index 7e2925d1db..06019a5d1a 100644 --- a/app/resize.c +++ b/app/resize.c @@ -152,13 +152,13 @@ resize_widget_new (ResizeType type, case ResizeLayer: wmclass = "scale_layer"; window_title = _("Scale Layer"); - help_page = "dialogs/scale_layer_dialog.html"; + help_page = "dialogs/layers/dialogs/scale_layer.html"; frame = gtk_frame_new (_("Size")); break; case ResizeImage: wmclass = "image_scale"; window_title = _("Image Scale"); - help_page = "dialogs/scale_image_dialog.html"; + help_page = "dialogs/scale_image.html"; frame = gtk_frame_new (_("Pixel Dimensions")); break; } @@ -170,12 +170,12 @@ resize_widget_new (ResizeType type, case ResizeLayer: wmclass = "resize_layer"; window_title = _("Resize Layer"); - help_page = "dialogs/resize_layer_dialog.html"; + help_page = "dialogs/layers/dialogs/resize_layer.html"; break; case ResizeImage: wmclass = "image_resize"; window_title = _("Image Resize"); - help_page = "dialogs/resize_image_dialog.html"; + help_page = "dialogs/resize_image.html"; break; } frame = gtk_frame_new (_("Size")); diff --git a/app/undo_history.c b/app/undo_history.c index bc7d782fa1..df65ebf301 100644 --- a/app/undo_history.c +++ b/app/undo_history.c @@ -427,7 +427,7 @@ undo_history_new (GImage *gimage) g_basename (gimage_filename (gimage))); st->shell = gimp_dialog_new (title, "undo_history", gimp_standard_help_func, - "dialogs/undo_histroy_dialog.html", + "dialogs/undo_histroy.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/widgets/gimpbrusheditor.c b/app/widgets/gimpbrusheditor.c index 4541982c79..ea0ff0610e 100644 --- a/app/widgets/gimpbrusheditor.c +++ b/app/widgets/gimpbrusheditor.c @@ -207,7 +207,7 @@ brush_edit_generated_new () begw->shell = gimp_dialog_new (_("Brush Editor"), "generated_brush_editor", gimp_standard_help_func, - "dialogs/generated_brush_editor_dialog.html", + "dialogs/generated_brush_editor.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/widgets/gimpcolordialog.c b/app/widgets/gimpcolordialog.c index 39976e007a..7875d62d78 100644 --- a/app/widgets/gimpcolordialog.c +++ b/app/widgets/gimpcolordialog.c @@ -37,11 +37,14 @@ static void color_notebook_ok_callback (GtkWidget *, gpointer); static void color_notebook_cancel_callback (GtkWidget *, gpointer); static void color_notebook_update_callback (void *, int, int, int); -static void color_notebook_page_switch (GtkWidget *, GtkNotebookPage *, guint); +static void color_notebook_page_switch (GtkWidget *, GtkNotebookPage *, + guint); +static void color_notebook_help_func (gpointer data); /* information we keep on each registered colour selector */ typedef struct _ColorSelectorInfo { char *name; /* label used in notebook tab */ + char *help_page; GimpColorSelectorMethods m; int refs; /* number of instances around */ gboolean active; @@ -100,8 +103,7 @@ color_notebook_new (int r, cnp->shell = gimp_dialog_new (_("Color Selection"), "color_selection", - gimp_standard_help_func, - "dialogs/color_notebook_dialog.html", + color_notebook_help_func, cnp, GTK_WIN_POS_NONE, FALSE, FALSE, FALSE, @@ -134,7 +136,7 @@ color_notebook_new (int r, if (info->active) { - csel = g_malloc (sizeof (ColorSelectorInstance)); + csel = g_new (ColorSelectorInstance, 1); csel->color_notebook = cnp; csel->info = info; info->refs++; @@ -336,12 +338,28 @@ color_notebook_page_switch (GtkWidget *widget, TRUE); } +static void +color_notebook_help_func (gpointer data) +{ + ColorNotebookP cnp; + gchar *help_path; + + cnp = (ColorNotebookP) data; + + help_path = g_strconcat ("dialogs/color_selectors/", + cnp->cur_page->info->help_page, + NULL); + gimp_help (help_path); + g_free (help_path); +} + /**************************************************************/ /* Registration functions */ G_MODULE_EXPORT GimpColorSelectorID gimp_color_selector_register (const char *name, + const char *help_page, GimpColorSelectorMethods *methods) { ColorSelectorInfo *info; @@ -355,9 +373,10 @@ gimp_color_selector_register (const char *name, info = info->next; } - info = g_malloc (sizeof (ColorSelectorInfo)); + info = g_new (ColorSelectorInfo, 1); info->name = g_strdup (name); + info->help_page = g_strdup (help_page); info->m = *methods; info->refs = 0; info->active = TRUE; diff --git a/app/widgets/gimpcolordisplayeditor.c b/app/widgets/gimpcolordisplayeditor.c index 3e85750e10..a4e72d7f28 100644 --- a/app/widgets/gimpcolordisplayeditor.c +++ b/app/widgets/gimpcolordisplayeditor.c @@ -77,7 +77,7 @@ make_dialog (void) cdd.shell = gimp_dialog_new (_("Color Display Filters"), "display_color", gimp_standard_help_func, - "dialogs/color_diaplsy_filters_dialog.html", + "dialogs/display_filters.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/widgets/gimpdeviceinfo.c b/app/widgets/gimpdeviceinfo.c index 4ca834935d..86edffc323 100644 --- a/app/widgets/gimpdeviceinfo.c +++ b/app/widgets/gimpdeviceinfo.c @@ -185,7 +185,7 @@ create_input_dialog (void) /* Connect the "F1" help key */ gimp_help_connect_help_accel (inputd, gimp_standard_help_func, - "dialogs/input_devices_dialog.html"); + "dialogs/input_devices.html"); gtk_widget_show (inputd); } @@ -706,7 +706,7 @@ create_device_status (void) deviceD->shell = gimp_dialog_new (_("Device Status"), "device_status", gimp_standard_help_func, - "dialogs/device_status_dialog.html", + "dialogs/device_status.html", GTK_WIN_POS_NONE, FALSE, FALSE, TRUE, diff --git a/app/widgets/gimpdevices.c b/app/widgets/gimpdevices.c index 4ca834935d..86edffc323 100644 --- a/app/widgets/gimpdevices.c +++ b/app/widgets/gimpdevices.c @@ -185,7 +185,7 @@ create_input_dialog (void) /* Connect the "F1" help key */ gimp_help_connect_help_accel (inputd, gimp_standard_help_func, - "dialogs/input_devices_dialog.html"); + "dialogs/input_devices.html"); gtk_widget_show (inputd); } @@ -706,7 +706,7 @@ create_device_status (void) deviceD->shell = gimp_dialog_new (_("Device Status"), "device_status", gimp_standard_help_func, - "dialogs/device_status_dialog.html", + "dialogs/device_status.html", GTK_WIN_POS_NONE, FALSE, FALSE, TRUE, diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c index b2aff31b1f..0711514fca 100644 --- a/app/widgets/gimpgradienteditor.c +++ b/app/widgets/gimpgradienteditor.c @@ -685,7 +685,7 @@ grad_create_gradient_editor_init (gint need_show) /* Shell and main vbox */ g_editor->shell = gimp_dialog_new (_("Gradient Editor"), "gradient_editor", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/index.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -1325,7 +1325,7 @@ ed_new_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("New gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/new_gradient.html", _("Enter a name for the new gradient"), _("untitled"), NULL, NULL, @@ -1388,7 +1388,7 @@ ed_copy_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Copy gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/copy_gradient.html", _("Enter a name for the copied gradient"), name, NULL, NULL, @@ -1474,7 +1474,7 @@ ed_rename_gradient_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Rename gradient"), gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/rename_gradient.html", _("Enter a new name for the gradient"), curr_gradient->name, NULL, NULL, @@ -1556,7 +1556,7 @@ ed_delete_gradient_callback (GtkWidget *widget, dialog = gimp_dialog_new (_("Delete gradient"), "delete_gradient", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/delete_gradient.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -1682,7 +1682,7 @@ ed_save_pov_callback (GtkWidget *widget, /* Connect the "F1" help key */ gimp_help_connect_help_accel (window, gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html"); + "dialogs/gradient_editor/dialogs/save_as_pov_ray.html"); gtk_widget_show (window); gtk_widget_set_sensitive (g_editor->shell, FALSE); @@ -4612,7 +4612,7 @@ cpopup_split_uniform_callback (GtkWidget *widget, _("Split segments uniformly"), "gradient_segment_split_uniformly", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/split_segments_uniformly.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, @@ -5171,7 +5171,7 @@ cpopup_replicate_callback (GtkWidget *widget, _("Replicate selection"), "gradient_segment_replicate", gimp_standard_help_func, - "dialogs/gradient_editor_dialog.html", + "dialogs/gradient_editor/dialogs/replicate_segment.html", GTK_WIN_POS_MOUSE, FALSE, TRUE, FALSE, diff --git a/app/widgets/gimphelp.c b/app/widgets/gimphelp.c index 77e4ae427a..64201eefd5 100644 --- a/app/widgets/gimphelp.c +++ b/app/widgets/gimphelp.c @@ -61,6 +61,9 @@ gimp_help_connect_help_accel (GtkWidget *widget, GtkAccelGroup *accel_group; static guint help_signal_id = 0; + if (! help_func) + return; + /* create the help signal if not already done */ if (! help_signal_id) { @@ -86,6 +89,13 @@ gimp_help_connect_help_accel (GtkWidget *widget, /* a new accelerator group for this widget */ accel_group = gtk_accel_group_new (); + + /* FIXME: does not work for some reason... + gtk_widget_add_accelerator (widget, "help", accel_group, + GDK_F1, 0, GTK_ACCEL_LOCKED); + */ + + /* ...while using this internal stuff works */ gtk_accel_group_add (accel_group, GDK_F1, 0, 0, GTK_OBJECT (widget), "help"); gtk_accel_group_attach (accel_group, GTK_OBJECT (widget)); diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index 5550911d3a..98c1e5694c 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -17,13 +17,14 @@ */ #include #include +#include + #include "appenv.h" #include "channels_dialog.h" #include "colormaps.h" #include "commands.h" #include "dialog_handler.h" #include "fileops.h" -#include "general.h" #include "gimprc.h" #include "interface.h" #include "layers_dialog.h" @@ -43,6 +44,16 @@ #define MRU_MENU_ENTRY_SIZE (strlen (_("/File/MRU00 ")) + 1) #define MRU_MENU_ACCEL_SIZE sizeof ("0") +typedef struct _GimpItemFactoryEntry GimpItemFactoryEntry; + +struct _GimpItemFactoryEntry +{ + GtkItemFactoryEntry entry; + + gchar *help_page; + gchar *description; +}; + static char* G_GNUC_UNUSED dummyMenus[] = { N_("/File/MRU00 "), N_("/File"), N_("/File/Dialogs"), @@ -53,8 +64,12 @@ static char* G_GNUC_UNUSED dummyMenus[] = { N_("/File/MRU00 "), N_("/View/Zoom"), N_("/Stack")}; +static void menus_create_item (GtkItemFactory *item_factory, + GimpItemFactoryEntry *entry, + gpointer callback_data, + guint callback_type); static void menus_init (void); -static gchar* menu_translate (const gchar *path, +static gchar *menu_translate (const gchar *path, gpointer data); static void tearoff_cmd_callback (GtkWidget *widget, gpointer callback_data, @@ -62,184 +77,342 @@ static void tearoff_cmd_callback (GtkWidget *widget, static GSList *last_opened_raw_filenames = NULL; -static GtkItemFactoryEntry toolbox_entries[] = +static GimpItemFactoryEntry toolbox_entries[] = { - { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/New"), "N", file_new_cmd_callback, 0 }, - { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, - { N_("/File/Acquire"), NULL, NULL, 0, "" }, - { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, - { N_("/File/Help..."), NULL, gimp_help_cmd_callback, 0 }, - { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, - { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, + { { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/New"), "N", file_new_cmd_callback, 0 }, + "file/dialogs/file_new.html", NULL }, + { { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, + "file/dialogs/file_open.html", NULL }, + { { N_("/File/Acquire/tearoff1"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 }, + "file/dialogs/about.html", NULL }, + { { N_("/File/Help..."), NULL, gimp_help_cmd_callback, 0 }, + "file/dialogs/help.html", NULL }, + { { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, + "file/dialogs/preferences.html", NULL }, + { { N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 }, + "file/dialogs/tip_of_the_day.html", NULL }, - { N_("/File/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, - { N_("/File/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, - { N_("/File/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, - { N_("/File/Dialogs/Gradient..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, - { N_("/File/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/File/Dialogs/Tool Options..."), "T", dialogs_tools_options_cmd_callback, 0 }, - { N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, - { N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, - { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, - { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, - { N_("/File/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + { { N_("/File/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, + "file/dialogs/brush_selection.html", NULL }, + { { N_("/File/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, + "file/dialogs/pattern_selection.html", NULL }, + { { N_("/File/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, + "file/dialogs/palette_selection.html", NULL }, + { { N_("/File/Dialogs/Gradients..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, + "file/dialogs/gradient_selection.html", NULL }, + { { N_("/File/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "file/dialogs/layers_and_channels.html", NULL }, + { { N_("/File/Dialogs/Tool Options..."), "T", dialogs_tools_options_cmd_callback, 0 }, + "file/dialogs/tool_options.html", NULL }, + { { N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, + "file/dialogs/input_devices.html", NULL }, + { { N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, + "file/dialogs/device_status.html", NULL }, + { { N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 }, + "file/dialogs/document_index.html", NULL }, + { { N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 }, + "file/dialogs/error_console.html", NULL }, + { { N_("/File/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + "file/dialogs/display_filters.html", NULL }, - { N_("/Xtns/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 }, - { N_("/File/---"), NULL, NULL, 0, "" }, - { N_("/File/---"), NULL, NULL, 0, "" } + { { N_("/Xtns/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 }, + "xtns/module_browser.html", NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, }; -static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); +static guint n_toolbox_entries = (sizeof (toolbox_entries) / + sizeof (toolbox_entries[0])); static GtkItemFactory *toolbox_factory = NULL; -static GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "" }; -static GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }; +static GimpItemFactoryEntry file_menu_separator = +{ { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }; -static GtkItemFactoryEntry image_entries[] = +static GimpItemFactoryEntry toolbox_end = +{ { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, + "file/dialogs/quit.html", NULL }; + +static GimpItemFactoryEntry image_entries[] = { - { N_("/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/File/New"), "N", file_new_cmd_callback, 1 }, - { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, - { N_("/File/Save"), "S", file_save_cmd_callback, 0 }, - { N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 }, - { N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 }, - { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, - { N_("/File/---"), NULL, NULL, 0, "" }, + { { N_("/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/File/New"), "N", file_new_cmd_callback, 1 }, + "file/dialogs/file_new.html", NULL }, + { { N_("/File/Open"), "O", file_open_cmd_callback, 0 }, + "file/dialogs/file_open.html", NULL }, + { { N_("/File/Save"), "S", file_save_cmd_callback, 0 }, + "file/dialogs/file_save.html", NULL }, + { { N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 }, + "file/dialogs/save_as.html", NULL }, + { { N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 }, + "file/revert.html", NULL }, + { { N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 }, + "file/dialogs/preferences.html", NULL }, + { { N_("/File/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/File/Close"), "W", file_close_cmd_callback, 0 }, - { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, - { N_("/File/---moved"), NULL, NULL, 0, "" }, + { { N_("/File/Close"), "W", file_close_cmd_callback, 0 }, + "file/close.html", NULL }, + { { N_("/File/Quit"), "Q", file_quit_cmd_callback, 0 }, + "file/dialogs/quit.html", NULL }, + { { N_("/File/---moved"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Edit/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Edit/Cut"), "X", edit_cut_cmd_callback, 0 }, - { N_("/Edit/Copy"), "C", edit_copy_cmd_callback, 0 }, - { N_("/Edit/Paste"), "V", edit_paste_cmd_callback, 0 }, - { N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 }, - { N_("/Edit/Paste As New"), NULL, edit_paste_as_new_cmd_callback, 0 }, - { N_("/Edit/---"), NULL, NULL, 0, "" }, - { N_("/Edit/Clear"), "K", edit_clear_cmd_callback, 0 }, - { N_("/Edit/Fill"), "period", edit_fill_cmd_callback, 0 }, - { N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 }, - { N_("/Edit/Undo"), "Z", edit_undo_cmd_callback, 0 }, - { N_("/Edit/Redo"), "R", edit_redo_cmd_callback, 0 }, - { N_("/Edit/Undo history..."), NULL, edit_show_undo_history_cmd_callback, 0}, - { N_("/Edit/---"), NULL, NULL, 0, "" }, - { N_("/Edit/Cut Named"), "X", edit_named_cut_cmd_callback, 0 }, - { N_("/Edit/Copy Named"), "C", edit_named_copy_cmd_callback, 0 }, - { N_("/Edit/Paste Named"), "V", edit_named_paste_cmd_callback, 0 }, - { N_("/Edit/---"), NULL, NULL, 0, "" }, + { { N_("/Edit/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Cut"), "X", edit_cut_cmd_callback, 0 }, + "edit/cut.html", NULL }, + { { N_("/Edit/Copy"), "C", edit_copy_cmd_callback, 0 }, + "edit/copy.html", NULL }, + { { N_("/Edit/Paste"), "V", edit_paste_cmd_callback, 0 }, + "edit/paste.html", NULL }, + { { N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 }, + "edit/paste_into.html", NULL }, + { { N_("/Edit/Paste As New"), NULL, edit_paste_as_new_cmd_callback, 0 }, + "edit/paste_as_new.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Clear"), "K", edit_clear_cmd_callback, 0 }, + "edit/clear.html", NULL }, + { { N_("/Edit/Fill"), "period", edit_fill_cmd_callback, 0 }, + "edit/fill.html", NULL }, + { { N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 }, + "edit/stroke.html", NULL }, + { { N_("/Edit/Undo"), "Z", edit_undo_cmd_callback, 0 }, + "edit/undo.html", NULL }, + { { N_("/Edit/Redo"), "R", edit_redo_cmd_callback, 0 }, + "edit/redo.html", NULL }, + { { N_("/Edit/Undo history..."), NULL, edit_show_undo_history_cmd_callback, 0}, + "edit/dialogs/undo_history.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Edit/Cut Named"), "X", edit_named_cut_cmd_callback, 0 }, + "edit/dialogs/cut_named.html", NULL }, + { { N_("/Edit/Copy Named"), "C", edit_named_copy_cmd_callback, 0 }, + "edit/dialogs/copy_named.html", NULL }, + { { N_("/Edit/Paste Named"), "V", edit_named_paste_cmd_callback, 0 }, + "edit/dialogs/paste_named.html", NULL }, + { { N_("/Edit/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Select/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Select/Invert"), "I", select_invert_cmd_callback, 0 }, - { N_("/Select/All"), "A", select_all_cmd_callback, 0 }, - { N_("/Select/None"), "A", select_none_cmd_callback, 0 }, - { N_("/Select/Float"), "L", select_float_cmd_callback, 0 }, - { N_("/Select/---"), NULL, NULL, 0, "" }, - { N_("/Select/Feather"), "F", select_feather_cmd_callback, 0 }, - { N_("/Select/Sharpen"), "H", select_sharpen_cmd_callback, 0 }, - { N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 }, - { N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 }, - { N_("/Select/Border"), "B", select_border_cmd_callback, 0 }, - { N_("/Select/---"), NULL, NULL, 0, "" }, - { N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 }, + { { N_("/Select/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Select/Invert"), "I", select_invert_cmd_callback, 0 }, + "select/invert.html", NULL }, + { { N_("/Select/All"), "A", select_all_cmd_callback, 0 }, + "select/all.html", NULL }, + { { N_("/Select/None"), "A", select_none_cmd_callback, 0 }, + "select/none.html", NULL }, + { { N_("/Select/Float"), "L", select_float_cmd_callback, 0 }, + "select/float.html", NULL }, + { { N_("/Select/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Select/Feather"), "F", select_feather_cmd_callback, 0 }, + "select/dialogs/feather_selection.html", NULL }, + { { N_("/Select/Sharpen"), "H", select_sharpen_cmd_callback, 0 }, + "select/sharpen.html", NULL }, + { { N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 }, + "select/dialogs/shrink_selection.html", NULL }, + { { N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 }, + "select/dialogs/grow_selection.html", NULL }, + { { N_("/Select/Border"), "B", select_border_cmd_callback, 0 }, + "select/dialogs/border_selection.html", NULL }, + { { N_("/Select/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 }, + "select/save_to_channel.html", NULL }, - { N_("/View/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 }, - { N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 }, - { N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 }, - { N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 }, - { N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 }, - { N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 }, - { N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 }, - { N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 }, - { N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 }, - { N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 }, - { N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 }, - { N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, ""}, - { N_("/View/Window Info..."), "I", view_window_info_cmd_callback, 0 }, - { N_("/View/Window Nav..."), NULL, view_window_nav_cmd_callback, 0 }, + { { N_("/View/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/8:1"), NULL, view_zoom_8_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/4:1"), NULL, view_zoom_4_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/2:1"), NULL, view_zoom_2_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:1"), "1", view_zoom_1_1_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:2"), NULL, view_zoom_1_2_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:4"), NULL, view_zoom_1_4_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:8"), NULL, view_zoom_1_8_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 }, + "view/zoom.html", NULL }, + { { N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "" }, + "view/dot_for_dot.html", NULL }, + { { N_("/View/Info Window..."), "I", view_window_info_cmd_callback, 0 }, + "view/dialogs/info_window.html", NULL }, + { { N_("/View/Nav. Window..."), NULL, view_window_nav_cmd_callback, 0 }, + "view/dialogs/navigation_window.html", NULL }, - { N_("/View/---"), NULL, NULL, 0, "" }, - { N_("/View/Toggle Selection"), "T", view_toggle_selection_cmd_callback, 0, "" }, - { N_("/View/Toggle Rulers"), "R", view_toggle_rulers_cmd_callback, 0, "" }, - { N_("/View/Toggle Statusbar"), "S", view_toggle_statusbar_cmd_callback, 0, "" }, - { N_("/View/Toggle Guides"), "T", view_toggle_guides_cmd_callback, 0, "" }, - { N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "" }, - { N_("/View/---"), NULL, NULL, 0, "" }, + { { N_("/View/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/View/Toggle Selection"), "T", view_toggle_selection_cmd_callback, 0, "" }, + "view/toggle_selection.html", NULL }, + { { N_("/View/Toggle Rulers"), "R", view_toggle_rulers_cmd_callback, 0, "" }, + "view/toggle_rulers.html", NULL }, + { { N_("/View/Toggle Statusbar"), "S", view_toggle_statusbar_cmd_callback, 0, "" }, + "view/toggle_statusbar.html", NULL }, + { { N_("/View/Toggle Guides"), "T", view_toggle_guides_cmd_callback, 0, "" }, + "view/toggle_guides.html", NULL }, + { { N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "" }, + "view/snap_to_guides.html", NULL }, + { { N_("/View/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 }, - { N_("/View/Shrink Wrap"), "E", view_shrink_wrap_cmd_callback, 0 }, + { { N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 }, + "view/new_view.html", NULL }, + { { N_("/View/Shrink Wrap"), "E", view_shrink_wrap_cmd_callback, 0 }, + "view/shrink_wrap.html", NULL }, - { N_("/Image/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Colors/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 }, - { N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 }, - { N_("/Image/Colors/---"), NULL, NULL, 0, "" }, - { N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 }, - { N_("/Image/Channel Ops/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Channel Ops/Duplicate"), "D", channel_ops_duplicate_cmd_callback, 0 }, - { N_("/Image/Channel Ops/Offset"), "O", channel_ops_offset_cmd_callback, 0 }, - { N_("/Image/Alpha/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + { { N_("/Image/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 }, + "image/colors/equalize.html", NULL }, + { { N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 }, + "image/colors/invert.html", NULL }, + { { N_("/Image/Colors/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 }, + "image/colors/desaturate.html", NULL }, + + { { N_("/Image/Channels/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + + { { N_("/Image/Alpha/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + "layers/add_alpha_channel.html", NULL }, + + { { N_("/Image/Transforms/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Image/Transforms/Offset"), "O", channel_ops_offset_cmd_callback, 0 }, + "image/transforms/dialogs/offset.html", NULL }, - { N_("/Image/---"), NULL, NULL, 0, "" }, - { N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 }, - { N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 }, - { N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 }, - { N_("/Image/---"), NULL, NULL, 0, "" }, - { N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 }, - { N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 }, - { N_("/Image/---"), NULL, NULL, 0, "" }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/RGB"), NULL, image_convert_rgb_cmd_callback, 0 }, + "image/convert_to_rgb.html", NULL }, + { { N_("/Image/Grayscale"), NULL, image_convert_grayscale_cmd_callback, 0 }, + "image/convert_to_grayscale.html", NULL }, + { { N_("/Image/Indexed"), NULL, image_convert_indexed_cmd_callback, 0 }, + "image/dialogs/convert_to_indexed.html", NULL }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 }, + "image/dialogs/resize_image.html", NULL }, + { { N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 }, + "image/dialogs/scale_image.html", NULL }, + { { N_("/Image/Duplicate"), "D", channel_ops_duplicate_cmd_callback, 0 }, + "image/duplicate.html", NULL }, + { { N_("/Image/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Layers/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Layers/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/Layers/Stack/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 }, - { N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 }, - { N_("/Layers/Stack/Raise Layer"), "Prior", layers_raise_cmd_callback, 0 }, - { N_("/Layers/Stack/Lower Layer"), "Next", layers_lower_cmd_callback, 0 }, - { N_("/Layers/Stack/Layer to Top"), "Prior", layers_raise_to_top_cmd_callback, 0 }, - { N_("/Layers/Stack/Layer to Bottom"), "Next", layers_lower_to_bottom_cmd_callback, 0 }, - { N_("/Layers/---"), NULL, NULL, 0, "" }, - { N_("/Layers/Anchor Layer"), "H", layers_anchor_cmd_callback, 0 }, - { N_("/Layers/Merge Visible Layers"), "M", layers_merge_cmd_callback, 0 }, - { N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 }, - { N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 }, - { N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 }, - { N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, - { N_("/Layers/---"), NULL, NULL, 0, "" }, + { { N_("/Layers/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "layers/dialogs/layers_and_channels.html", NULL }, + { { N_("/Layers/Stack/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 }, + "layers/stack/index.html#previous_layer", NULL }, + { { N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 }, + "layers/stack/index.html#next_layer", NULL }, + { { N_("/Layers/Stack/Raise Layer"), "Prior", layers_raise_cmd_callback, 0 }, + "layers/stack/index.html#raise_layer", NULL }, + { { N_("/Layers/Stack/Lower Layer"), "Next", layers_lower_cmd_callback, 0 }, + "layers/stack/index.html#lower_layer", NULL }, + { { N_("/Layers/Stack/Layer to Top"), "Prior", layers_raise_to_top_cmd_callback, 0 }, + "layers/stack/index.html#layer_to_top", NULL }, + { { N_("/Layers/Stack/Layer to Bottom"), "Next", layers_lower_to_bottom_cmd_callback, 0 }, + "layers/stack/index.html#layer_to_bottom", NULL }, + { { N_("/Layers/---"), NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Layers/Anchor Layer"), "H", layers_anchor_cmd_callback, 0 }, + "layers/anchor_layer.html", NULL }, + { { N_("/Layers/Merge Visible Layers"), "M", layers_merge_cmd_callback, 0 }, + "layers/dialogs/layers/merge_visible_layers.html", NULL }, + { { N_("/Layers/Flatten Image"), NULL, layers_flatten_cmd_callback, 0 }, + "layers/flatten_image.html", NULL }, + { { N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 }, + "layers/alpha_to_selection.html", NULL }, + { { N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 }, + "layers/mask_to_selection.html", NULL }, + { { N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 }, + "layers/add_alpha_channel.html", NULL }, + { { N_("/Layers/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Tools/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 }, - { N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 }, - { N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, - { N_("/Tools/---"), NULL, NULL, 0, "" }, + { { N_("/Tools/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 }, + "toolbox/index.html", NULL }, + { { N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 }, + "toolbox/index.html#default_colors", NULL }, + { { N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, + "toolbox/index.html#swap_colors", NULL }, + { { N_("/Tools/---"), NULL, NULL, 0, "" }, + NULL, NULL }, /* the tool entries themselves are built on the fly */ - { N_("/Filters/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Filters/Repeat last"), "F", filters_repeat_cmd_callback, 0x0 }, - { N_("/Filters/Re-show last"), "F", filters_repeat_cmd_callback, 0x1 }, - { N_("/Filters/---"), NULL, NULL, 0, "" }, + { { N_("/Filters/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Filters/Repeat last"), "F", filters_repeat_cmd_callback, 0x0 }, + "filters/repeat_last.html", NULL }, + { { N_("/Filters/Re-show last"), "F", filters_repeat_cmd_callback, 0x1 }, + "filters/reshow_last.html", NULL }, + { { N_("/Filters/---"), NULL, NULL, 0, "" }, + NULL, NULL }, - { N_("/Script-Fu/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Script-Fu/"), NULL, NULL, 0 }, + { { N_("/Script-Fu/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, - { N_("/Dialogs/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, - { N_("/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, - { N_("/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, - { N_("/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, - { N_("/Dialogs/Gradient..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, - { N_("/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, - { N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 }, - { N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 }, - { N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, - { N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, - { N_("/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 } + { { N_("/Dialogs/tearoff1"), NULL, tearoff_cmd_callback, 0, "" }, + NULL, NULL }, + { { N_("/Dialogs/Brushes..."), "B", dialogs_brushes_cmd_callback, 0 }, + "dialogs/brush_selection.html", NULL }, + { { N_("/Dialogs/Patterns..."), "P", dialogs_patterns_cmd_callback, 0 }, + "dialogs/pattern_selection.html", NULL }, + { { N_("/Dialogs/Palette..."), "P", dialogs_palette_cmd_callback, 0 }, + "dialogs/palette_selection.html", NULL }, + { { N_("/Dialogs/Gradients..."), "G", dialogs_gradient_editor_cmd_callback, 0 }, + "dialogs/gradient_selection.html", NULL }, + { { N_("/Dialogs/Layers & Channels..."), "L", dialogs_lc_cmd_callback, 0 }, + "dialogs/layers_and_channels.html", NULL }, + { { N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 }, + "dialogs/indexed_palette.html", NULL }, + { { N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 }, + "dialogs/tool_options.html", NULL }, + { { N_("/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 }, + "dialogs/input_devices.html", NULL }, + { { N_("/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 }, + "dialogs/device_status.html", NULL }, + { { N_("/Dialogs/Display Filters..."), NULL, dialogs_display_filters_cmd_callback, 0 }, + "dialogs/display_filters.html", NULL }, }; -static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]); +static guint n_image_entries = (sizeof (image_entries) / + sizeof (image_entries[0])); static GtkItemFactory *image_factory = NULL; static GtkItemFactoryEntry load_entries[] = @@ -258,66 +431,113 @@ static GtkItemFactoryEntry save_entries[] = static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]); static GtkItemFactory *save_factory = NULL; -static GtkItemFactoryEntry layers_entries[] = +static GimpItemFactoryEntry layers_entries[] = { - { N_("/New Layer"), "N", layers_dialog_new_layer_callback, 0 }, - { N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 }, - { N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 }, - { N_("/Stack/Raise Layer"), "Prior", layers_dialog_raise_layer_callback, 0 }, - { N_("/Stack/Lower Layer"), "Next", layers_dialog_lower_layer_callback, 0 }, - { N_("/Stack/Layer to Top"), "Prior", layers_dialog_raise_layer_to_top_callback, 0 }, - { N_("/Stack/Layer to Bottom"), "Next", layers_dialog_lower_layer_to_bottom_callback, 0 }, - { N_("/Duplicate Layer"), "C", layers_dialog_duplicate_layer_callback, 0 }, - { N_("/Anchor Layer"), "H", layers_dialog_anchor_layer_callback, 0 }, - { N_("/Delete Layer"), "X", layers_dialog_delete_layer_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Scale Layer"), "S", layers_dialog_scale_layer_callback, 0 }, - { N_("/Resize Layer"), "R", layers_dialog_resize_layer_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Merge Visible Layers"), "M", layers_dialog_merge_layers_callback, 0 }, - { N_("/Merge Down"), "M", layers_dialog_merge_down_callback, 0 }, - { N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 }, - { N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 }, - { N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 }, - { N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 }, - { N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 } + { { N_("/New Layer"), "N", layers_dialog_new_layer_callback, 0 }, + "dialogs/layers/new_layer.html", NULL }, + { { N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 }, + "stack/index.html#previous_layer", NULL }, + { { N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 }, + "stack/index.html#next_layer", NULL }, + { { N_("/Stack/Raise Layer"), "Prior", layers_dialog_raise_layer_callback, 0 }, + "stack/index.html#raise_layer", NULL }, + { { N_("/Stack/Lower Layer"), "Next", layers_dialog_lower_layer_callback, 0 }, + "stack/index.html#lower_layer", NULL }, + { { N_("/Stack/Layer to Top"), "Prior", layers_dialog_raise_layer_to_top_callback, 0 }, + "stack/index.html#later_to_top", NULL }, + { { N_("/Stack/Layer to Bottom"), "Next", layers_dialog_lower_layer_to_bottom_callback, 0 }, + "stack/index.html#layer_to_bottom", NULL }, + { { N_("/Duplicate Layer"), "C", layers_dialog_duplicate_layer_callback, 0 }, + "duplicate_layer.html", NULL }, + { { N_("/Anchor Layer"), "H", layers_dialog_anchor_layer_callback, 0 }, + "anchor_layer.html", NULL }, + { { N_("/Delete Layer"), "X", layers_dialog_delete_layer_callback, 0 }, + "delete_layer.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Scale Layer"), "S", layers_dialog_scale_layer_callback, 0 }, + "dialogs/layers/scale_layer.html", NULL }, + { { N_("/Resize Layer"), "R", layers_dialog_resize_layer_callback, 0 }, + "dialogs/layers/resize_layer.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Merge Visible Layers"), "M", layers_dialog_merge_layers_callback, 0 }, + "dialogs/layers/merge_visible_layers.html", NULL }, + { { N_("/Merge Down"), "M", layers_dialog_merge_down_callback, 0 }, + "merge_down.html", NULL }, + { { N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 }, + "flatten_image.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 }, + "dialogs/layers/add_mask.html", NULL }, + { { N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 }, + "dialogs/layers/apply_mask.html", NULL }, + { { N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 }, + "alpha_to_selection.html", NULL }, + { { N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 }, + "mask_to_selection.html", NULL }, + { { N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 }, + "add_alpha_channel.html", NULL } }; -static guint n_layers_entries = sizeof (layers_entries) / sizeof (layers_entries[0]); +static guint n_layers_entries = (sizeof (layers_entries) / + sizeof (layers_entries[0])); static GtkItemFactory *layers_factory = NULL; -static GtkItemFactoryEntry channels_entries[] = +static GimpItemFactoryEntry channels_entries[] = { - { N_("/New Channel"), "N", channels_dialog_new_channel_callback, 0 }, - { N_("/Raise Channel"), "F", channels_dialog_raise_channel_callback, 0 }, - { N_("/Lower Channel"), "B", channels_dialog_lower_channel_callback, 0 }, - { N_("/Duplicate Channel"), "C", channels_dialog_duplicate_channel_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Channel to Selection"), "S", channels_dialog_channel_to_sel_callback, 0 }, - { N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 }, - { N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, - { N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Delete Channel"), "X", channels_dialog_delete_channel_callback, 0 } + { { N_("/New Channel"), "N", channels_dialog_new_channel_callback, 0 }, + "/dialogs/channels/new_channel.html", NULL }, + { { N_("/Raise Channel"), "F", channels_dialog_raise_channel_callback, 0 }, + "raise_channel.html", NULL }, + { { N_("/Lower Channel"), "B", channels_dialog_lower_channel_callback, 0 }, + "lower_channel.html", NULL }, + { { N_("/Duplicate Channel"), "C", channels_dialog_duplicate_channel_callback, 0 }, + "duplicate_channel.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Channel to Selection"), "S", channels_dialog_channel_to_sel_callback, 0 }, + "channel_to_selection.html", NULL }, + { { N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 }, + "channel_to_selection.html#add", NULL }, + { { N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, + "channel_to_selection.html#subtract", NULL }, + { { N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }, + "channel_to_selection.html#intersect", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Delete Channel"), "X", channels_dialog_delete_channel_callback, 0 }, + "delete_layer.html", NULL } }; -static guint n_channels_entries = sizeof (channels_entries) / sizeof (channels_entries[0]); +static guint n_channels_entries = (sizeof (channels_entries) / + sizeof (channels_entries[0])); static GtkItemFactory *channels_factory = NULL; -static GtkItemFactoryEntry paths_entries[] = +static GimpItemFactoryEntry paths_entries[] = { - { N_("/New Path"), "N", paths_dialog_new_path_callback, 0 }, - { N_("/Duplicate Path"), "U", paths_dialog_dup_path_callback, 0 }, - { N_("/Path to Selection"), "S", paths_dialog_path_to_sel_callback, 0 }, - { N_("/Stroke Path"), "T", paths_dialog_stroke_path_callback, 0 }, - { N_("/Delete Path"), "X", paths_dialog_delete_path_callback, 0 }, - { "/---", NULL, NULL, 0, "" }, - { N_("/Copy Path"), "C", paths_dialog_copy_path_callback, 0 }, - { N_("/Paste Path"), "V", paths_dialog_paste_path_callback, 0 }, - { N_("/Import Path"), "I", paths_dialog_import_path_callback, 0 }, - { N_("/Export Path"), "E", paths_dialog_export_path_callback, 0 } + { { N_("/New Path"), "N", paths_dialog_new_path_callback, 0 }, + "new_path.html", NULL }, + { { N_("/Duplicate Path"), "U", paths_dialog_dup_path_callback, 0 }, + "duplicate_path.html", NULL }, + { { N_("/Path to Selection"), "S", paths_dialog_path_to_sel_callback, 0 }, + "path_to_selection.html", NULL }, + { { N_("/Stroke Path"), "T", paths_dialog_stroke_path_callback, 0 }, + "stroke_path.html", NULL }, + { { N_("/Delete Path"), "X", paths_dialog_delete_path_callback, 0 }, + "delete_path.html", NULL }, + { { "/---", NULL, NULL, 0, "" }, + NULL, NULL }, + { { N_("/Copy Path"), "C", paths_dialog_copy_path_callback, 0 }, + "copy_path.html", NULL }, + { { N_("/Paste Path"), "V", paths_dialog_paste_path_callback, 0 }, + "paste_path.html", NULL }, + { { N_("/Import Path"), "I", paths_dialog_import_path_callback, 0 }, + "import_path.html", NULL }, + { { N_("/Export Path"), "E", paths_dialog_export_path_callback, 0 }, + "export_path.html", NULL } }; -static guint n_paths_entries = sizeof (paths_entries) / sizeof (paths_entries[0]); +static guint n_paths_entries = (sizeof (paths_entries) / + sizeof (paths_entries[0])); static GtkItemFactory *paths_factory = NULL; static int initialize = TRUE; @@ -479,18 +699,23 @@ menus_create (GtkMenuEntry *entries, void menus_tools_create (ToolInfo *tool_info) { - GtkItemFactoryEntry entry; + GimpItemFactoryEntry entry; - entry.path = tool_info->menu_path; - entry.accelerator = tool_info->menu_accel; - entry.callback = tools_select_cmd_callback; - entry.callback_action = tool_info->tool_id; - entry.item_type = NULL; + entry.entry.path = tool_info->menu_path; + entry.entry.accelerator = tool_info->menu_accel; + entry.entry.callback = tools_select_cmd_callback; + entry.entry.callback_action = tool_info->tool_id; + entry.entry.item_type = NULL; + entry.help_page = g_strconcat ("tools/", + tool_info->private_tip, + ".html", + NULL); + entry.description = NULL; - gtk_item_factory_create_item (image_factory, - &entry, - (gpointer) tool_info, - 2); + menus_create_item (image_factory, + &entry, + (gpointer) tool_info, + 2); } void @@ -633,7 +858,8 @@ menus_last_opened_update_labels (void) for (i = 1; i <= num_entries; i++) { - g_string_sprintf (entry_filename, "%d. %s", i, g_basename (((GString *) filename_slist->data)->str)); + g_string_sprintf (entry_filename, "%d. %s", i, + g_basename (((GString *) filename_slist->data)->str)); g_string_sprintf (path, N_("/File/MRU%02d"), i); @@ -641,7 +867,8 @@ menus_last_opened_update_labels (void) if (widget != NULL) { gtk_widget_show (widget); - gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), entry_filename->str); + gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), + entry_filename->str); } filename_slist = filename_slist->next; } @@ -677,11 +904,13 @@ menus_last_opened_add (gchar *filename) } raw_filename = g_string_new (filename); - last_opened_raw_filenames = g_slist_prepend (last_opened_raw_filenames, raw_filename); + last_opened_raw_filenames = g_slist_prepend (last_opened_raw_filenames, + raw_filename); if (num_entries == 0) { - widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path); + widget = gtk_item_factory_get_widget (toolbox_factory, + file_menu_separator.entry.path); gtk_widget_show (widget); } @@ -728,11 +957,14 @@ menus_init_mru (void) for (i=0; i < last_opened_size; i++) { widget = gtk_item_factory_get_widget (toolbox_factory, - last_opened_entries[i].path); + last_opened_entries[i].path); + gtk_object_set_data (GTK_OBJECT (widget), "help_page", + (gpointer) "file/last_opened.html"); gtk_widget_hide (widget); } - widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path); + widget = gtk_item_factory_get_widget (toolbox_factory, + file_menu_separator.entry.path); gtk_widget_hide (widget); g_free (paths); @@ -740,19 +972,135 @@ menus_init_mru (void) g_free (last_opened_entries); } +/* This function gets called while browsing a menu created + * by a GtkItemFactory + */ +static gint +menus_item_key_press (GtkWidget *widget, + GdkEventKey *kevent, + gpointer data) +{ + GtkItemFactory *item_factory = NULL; + GtkWidget *active_menu_item = NULL; + gchar *help_path = NULL; + gchar *help_page = NULL; + + if (kevent->keyval != GDK_F1) + return FALSE; + + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), + "key_press_event"); + + item_factory = (GtkItemFactory *) data; + help_path = (gchar *) gtk_object_get_data (GTK_OBJECT (item_factory), + "help_path"); + + active_menu_item = GTK_MENU_SHELL (widget)->active_menu_item; + if (active_menu_item) + help_page = (gchar *) gtk_object_get_data (GTK_OBJECT (active_menu_item), + "help_page"); + if (! help_page) + help_page = "index.html"; + + if (help_path && help_page) + { + gchar *help_string; + + help_string = g_strdup_printf ("%s/%s", help_path, help_page); + gimp_help (help_string); + g_free (help_string); + } + else + { + gimp_help (NULL); + } + + return TRUE; +} + +/* set up the callback to catch the "F1" key */ +static void +menus_item_realize (GtkWidget *widget, + gpointer data) +{ + if (GTK_IS_MENU_SHELL (widget->parent)) + { + if (! gtk_object_get_data (GTK_OBJECT (widget->parent), + "menus_key_press_connected")) + { + gtk_signal_connect (GTK_OBJECT (widget->parent), "key_press_event", + GTK_SIGNAL_FUNC (menus_item_key_press), + (gpointer) data); + + gtk_object_set_data (GTK_OBJECT (widget->parent), + "menus_key_press_connected", + (gpointer) TRUE); + } + } +} + +static void +menus_create_item (GtkItemFactory *item_factory, + GimpItemFactoryEntry *entry, + gpointer callback_data, + guint callback_type) +{ + GtkWidget *item; + + gtk_item_factory_create_item (item_factory, + (GtkItemFactoryEntry *) entry, + callback_data, + callback_type); + + item = gtk_item_factory_get_item (item_factory, + ((GtkItemFactoryEntry *) entry)->path); + + if (item) + { + gtk_signal_connect_after (GTK_OBJECT (item), "realize", + GTK_SIGNAL_FUNC (menus_item_realize), + (gpointer) item_factory); + + gtk_object_set_data (GTK_OBJECT (item), "help_page", + (gpointer) entry->help_page); + } +} + +static void +menus_create_items (GtkItemFactory *item_factory, + guint n_entries, + GimpItemFactoryEntry *entries, + gpointer callback_data, + guint callback_type) +{ + gint i; + + for (i = 0; i < n_entries; i++) + { + menus_create_item (item_factory, + entries + i, + callback_data, + callback_type); + } +} + void menus_init_toolbox (void) { toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "", NULL); + gtk_object_set_data (GTK_OBJECT (toolbox_factory), "help_path", + (gpointer) "toolbox"); gtk_item_factory_set_translate_func (toolbox_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (toolbox_factory, n_toolbox_entries, - toolbox_entries, NULL, 2); + menus_create_items (toolbox_factory, n_toolbox_entries, + toolbox_entries, NULL, 2); menus_init_mru (); - gtk_item_factory_create_item (toolbox_factory, &file_menu_separator, NULL, 2); - - gtk_item_factory_create_item (toolbox_factory, &toolbox_end, NULL, 2); + menus_create_items (toolbox_factory, 1, + &file_menu_separator, NULL, 2); + + menus_create_items (toolbox_factory, 1, + &toolbox_end, NULL, 2); } static void @@ -769,13 +1117,15 @@ menus_init (void) menus_init_toolbox (); image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (image_factory), "help_path", + (gpointer) "image"); gtk_item_factory_set_translate_func (image_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (image_factory, - n_image_entries, - image_entries, - NULL, 2); + menus_create_items (image_factory, + n_image_entries, + image_entries, + NULL, 2); load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); gtk_item_factory_set_translate_func (load_factory, @@ -796,31 +1146,37 @@ menus_init (void) NULL, 2); layers_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (layers_factory), "help_path", + (gpointer) "layers"); gtk_item_factory_set_translate_func (layers_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (layers_factory, - n_layers_entries, - layers_entries, - NULL, 2); + menus_create_items (layers_factory, + n_layers_entries, + layers_entries, + NULL, 2); channels_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (channels_factory), "help_path", + (gpointer) "channels"); gtk_item_factory_set_translate_func (channels_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (channels_factory, - n_channels_entries, - channels_entries, - NULL, 2); + menus_create_items (channels_factory, + n_channels_entries, + channels_entries, + NULL, 2); paths_factory = gtk_item_factory_new (GTK_TYPE_MENU, "", NULL); + gtk_object_set_data (GTK_OBJECT (paths_factory), "help_path", + (gpointer) "paths"); gtk_item_factory_set_translate_func (paths_factory, menu_translate, NULL, NULL); - gtk_item_factory_create_items_ac (paths_factory, - n_paths_entries, - paths_entries, - NULL, 2); + menus_create_items (paths_factory, + n_paths_entries, + paths_entries, + NULL, 2); for (i = 0; i < num_tools; i++) { @@ -866,7 +1222,7 @@ tearoff_delete_cb (GtkWidget *widget, gpointer data) { /* Unregister if dialog is deleted as well */ - dialog_unregister((GtkWidget *)data); + dialog_unregister ((GtkWidget *) data); return TRUE; } @@ -875,16 +1231,16 @@ tearoff_cmd_callback (GtkWidget *widget, gpointer callback_data, guint callback_action) { - if(GTK_IS_TEAROFF_MENU_ITEM(widget)) + if (GTK_IS_TEAROFF_MENU_ITEM (widget)) { GtkTearoffMenuItem *tomi = (GtkTearoffMenuItem *)widget; - if(tomi->torn_off) + if (tomi->torn_off) { GtkWidget *top = gtk_widget_get_toplevel(widget); /* This should be a window */ - if(!GTK_IS_WINDOW(top)) + if (!GTK_IS_WINDOW (top)) { g_message(_("tearoff menu not in top level window")); } @@ -904,7 +1260,7 @@ tearoff_cmd_callback (GtkWidget *widget, GtkWidget *top = (GtkWidget *)gtk_object_get_data (GTK_OBJECT (widget),"tearoff_menu_top"); if(!top) { - g_message(_("can't unregister tearoff menu top level window")); + g_message (_("can't unregister tearoff menu top level window")); } else { diff --git a/app/widgets/gimppaletteeditor.c b/app/widgets/gimppaletteeditor.c index 5cda99f042..18334831f7 100644 --- a/app/widgets/gimppaletteeditor.c +++ b/app/widgets/gimppaletteeditor.c @@ -34,7 +34,7 @@ #include "buildmenu.h" #include "colormaps.h" #include "color_area.h" -#include "color_select.h" +#include "color_notebook.h" #include "datafiles.h" #include "devices.h" #include "errors.h" @@ -110,8 +110,8 @@ struct _PaletteDialog GtkWidget *clist; GtkWidget *popup_menu; GtkWidget *popup_small_menu; - ColorSelectP color_select; - int color_select_active; + ColorNotebookP color_notebook; + gboolean color_notebook_active; PaletteEntriesP entries; PaletteEntryP color; GdkGC *gc; @@ -470,8 +470,8 @@ palette_free () gdk_gc_destroy (top_level_edit_palette->gc); - if (top_level_edit_palette->color_select) - color_select_free (top_level_edit_palette->color_select); + if (top_level_edit_palette->color_notebook) + color_notebook_free (top_level_edit_palette->color_notebook); g_free (top_level_edit_palette); @@ -1078,7 +1078,7 @@ palette_new_entries_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("New Palette"), gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/new_palette.html", _("Enter a name for new palette"), NULL, NULL, NULL, @@ -1135,10 +1135,10 @@ palette_refresh (PaletteDialog *palette) palette->entries = NULL; /* If a color selection dialog is up, hide it */ - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } palette_free_palettes (); /* free palettes, don't save any modified versions */ palette_init_palettes (FALSE); /* reload palettes */ @@ -1234,11 +1234,11 @@ palette_draw_small_preview(GdkGC *gc, static void -palette_select_callback (gint r, - gint g, - gint b, - ColorSelectState state, - void *data) +palette_select_callback (gint r, + gint g, + gint b, + ColorNotebookState state, + void *data) { PaletteDialog *palette; guchar *color; @@ -1252,9 +1252,9 @@ palette_select_callback (gint r, { switch (state) { - case COLOR_SELECT_UPDATE: + case COLOR_NOTEBOOK_UPDATE: break; - case COLOR_SELECT_OK: + case COLOR_NOTEBOOK_OK: if (palette->color) { color = palette->color->color; @@ -1298,9 +1298,9 @@ palette_select_callback (gint r, palette_select2_set_text_all (palette->entries); } /* Fallthrough */ - case COLOR_SELECT_CANCEL: - color_select_hide (palette->color_select); - palette->color_select_active = 0; + case COLOR_NOTEBOOK_CANCEL: + color_notebook_hide (palette->color_notebook); + palette->color_notebook_active = FALSE; } } } @@ -1361,10 +1361,10 @@ palette_close_callback (GtkWidget *widget, palette = data; if (palette) { - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } if(import_dialog) @@ -1406,24 +1406,24 @@ palette_edit_callback (GtkWidget *widget, { color = palette->color->color; - if (!palette->color_select) + if (!palette->color_notebook) { - palette->color_select = - color_select_new (color[0], color[1], color[2], - palette_select_callback, palette, - FALSE); - palette->color_select_active = 1; + palette->color_notebook = + color_notebook_new (color[0], color[1], color[2], + palette_select_callback, palette, + FALSE); + palette->color_notebook_active = TRUE; } else { - if (!palette->color_select_active) + if (!palette->color_notebook_active) { - color_select_show (palette->color_select); - palette->color_select_active = 1; + color_notebook_show (palette->color_notebook); + palette->color_notebook_active = TRUE; } - color_select_set_color (palette->color_select, - color[0], color[1], color[2], 1); + color_notebook_set_color (palette->color_notebook, + color[0], color[1], color[2], 1); } } } @@ -1931,15 +1931,15 @@ palette_list_item_update (GtkWidget *widget, palette = (PaletteDialog *) data; - if (palette->color_select_active) + if (palette->color_notebook_active) { - palette->color_select_active = 0; - color_select_hide (palette->color_select); + palette->color_notebook_active = FALSE; + color_notebook_hide (palette->color_notebook); } - if (palette->color_select) - color_select_free (palette->color_select); - palette->color_select = NULL; + if (palette->color_notebook) + color_notebook_free (palette->color_notebook); + palette->color_notebook = NULL; p_entries = (PaletteEntriesP) gtk_clist_get_row_data (GTK_CLIST (palette->clist), row); @@ -2013,8 +2013,8 @@ create_palette_dialog (gint vert) palette->entries = default_palette_entries; palette->color = NULL; - palette->color_select = NULL; - palette->color_select_active = 0; + palette->color_notebook = NULL; + palette->color_notebook_active = FALSE; palette->zoom_factor = 1.0; palette->columns = COLUMNS; palette->columns_valid = TRUE; @@ -2025,7 +2025,7 @@ create_palette_dialog (gint vert) palette->shell = gimp_dialog_new (_("Color Palette Edit"), "color_palette_edit", gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/index.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -2044,7 +2044,7 @@ create_palette_dialog (gint vert) palette->shell = gimp_dialog_new (_("Color Palette"), "color_palette", gimp_standard_help_func, - "dialogs/color_palette_dialog.html", + "dialogs/palette_selection.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, @@ -2484,7 +2484,7 @@ palette_merge_dialog_callback (GtkWidget *widget, qbox = gimp_query_string_box (_("Merge Palette"), gimp_standard_help_func, - "dialogs/color_palette_edit_dialog.html", + "dialogs/palette_editor/merge_palette.html", _("Enter a name for merged palette"), NULL, NULL, NULL, @@ -2829,7 +2829,7 @@ palette_import_dialog (PaletteDialog *palette) import_dialog->dialog = dialog = gimp_dialog_new (_("Import Palette"), "import_palette", gimp_standard_help_func, - "dialogs/import_palette_dialog.html", + "dialogs/palette_editor/import_palette.html", GTK_WIN_POS_NONE, FALSE, TRUE, FALSE, diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c index d5380d3ceb..9a981ae3a1 100644 --- a/app/widgets/gimpwidgets-utils.c +++ b/app/widgets/gimpwidgets-utils.c @@ -51,7 +51,7 @@ gimp_dialog_delete_callback (GtkWidget *widget, } /* -#include "/home/mitschel/gimpfiles/wilber.xpm" +#include "/home/mitch/gimp.xpm" static void gimp_dialog_realize_callback (GtkWidget *widget, @@ -68,7 +68,7 @@ gimp_dialog_realize_callback (GtkWidget *widget, gdk_pixmap_create_from_xpm_d (widget->window, &wilber_mask, &style->bg[GTK_STATE_NORMAL], - wilber_xpm); + gimp_xpm); gdk_window_set_icon (widget->window, NULL, wilber_pixmap, wilber_mask); @@ -86,11 +86,12 @@ gimp_dialog_new (const gchar *title, gint auto_shrink, /* specify action area buttons as va_list: - * gchar *label, - * GtkSignalFunc callback, - * gpointer data, - * gboolean default_action, - * gboolean connect_delete, + * gchar *label, + * GtkSignalFunc callback, + * gpointer data, + * GtkWidget **widget_ptr, + * gboolean default_action, + * gboolean connect_delete, */ ...) @@ -219,7 +220,6 @@ gimp_dialog_newv (const gchar *title, gtk_signal_connect (GTK_OBJECT (dialog), "realize", (GtkSignalFunc) gimp_dialog_realize_callback, NULL); - */ /* connect the "F1" help key */ diff --git a/configure.in b/configure.in index cab6579930..d4750f1e7a 100644 --- a/configure.in +++ b/configure.in @@ -729,6 +729,8 @@ intl/Makefile tools/Makefile tools/pdbgen/Makefile help/Makefile +help/C/Makefile +help/images/Makefile tips/Makefile], [ chmod +x gimptool diff --git a/help/C/.cvsignore b/help/C/.cvsignore new file mode 100644 index 0000000000..3dda72986f --- /dev/null +++ b/help/C/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/help/C/Makefile.am b/help/C/Makefile.am new file mode 100644 index 0000000000..9239e0c4cb --- /dev/null +++ b/help/C/Makefile.am @@ -0,0 +1,18 @@ +## Process this file with automake to produce Makefile.in + +helpdatadir = $(gimpdatadir)/help/C + +helpdata_DATA = \ + contents.html \ + index.html \ + welcome.html + + +EXTRA_DIST = $(helpdata_DATA) + +.PHONY: files + +files: + @files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \ + echo $$p; \ + done diff --git a/help/contents.html b/help/C/contents.html similarity index 100% rename from help/contents.html rename to help/C/contents.html diff --git a/help/index.html b/help/C/index.html similarity index 100% rename from help/index.html rename to help/C/index.html diff --git a/help/welcome.html b/help/C/welcome.html similarity index 64% rename from help/welcome.html rename to help/C/welcome.html index 69a425e874..d71915fccd 100644 --- a/help/welcome.html +++ b/help/C/welcome.html @@ -6,14 +6,15 @@

Welcome to the

GIMP Help Browser

- +

-Brought to you by: +brought to you by:

- -
Sven Neumann

sven@gimp.org
Michael Natterer

mitschel@cs.tu-berlin.de
+

Michael Natterer

mitch@gimp.org
+
+ diff --git a/help/Makefile.am b/help/Makefile.am index 6227b4cfe5..31f0dd5605 100644 --- a/help/Makefile.am +++ b/help/Makefile.am @@ -1,15 +1,6 @@ ## Process this file with automake to produce Makefile.in -helpdatadir = $(gimpdatadir)/help - -helpdata_DATA = \ - welcome.html \ - contents.html \ - index.html \ - eek.png \ - wilber.png - -EXTRA_DIST = $(helpdata_DATA) +SUBDIRS = C images .PHONY: files @@ -17,3 +8,9 @@ files: @files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \ echo $$p; \ done + @for subdir in $(SUBDIRS); do \ + files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \ + for file in $$files; do \ + echo $$subdir/$$file; \ + done; \ + done diff --git a/help/images/.cvsignore b/help/images/.cvsignore new file mode 100644 index 0000000000..3dda72986f --- /dev/null +++ b/help/images/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/help/images/Makefile.am b/help/images/Makefile.am new file mode 100644 index 0000000000..9f479d95a4 --- /dev/null +++ b/help/images/Makefile.am @@ -0,0 +1,16 @@ +## Process this file with automake to produce Makefile.in + +helpdatadir = $(gimpdatadir)/help/images + +helpdata_DATA = \ + eek.png \ + wilber.png + +EXTRA_DIST = $(helpdata_DATA) + +.PHONY: files + +files: + @files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \ + echo $$p; \ + done diff --git a/help/eek.png b/help/images/eek.png similarity index 100% rename from help/eek.png rename to help/images/eek.png diff --git a/help/wilber.png b/help/images/wilber.png similarity index 100% rename from help/wilber.png rename to help/images/wilber.png diff --git a/libgimp/color_selector.h b/libgimp/color_selector.h index 0e782a9857..e7632532e6 100644 --- a/libgimp/color_selector.h +++ b/libgimp/color_selector.h @@ -86,6 +86,7 @@ typedef void *GimpColorSelectorID; * the name and method table are internalised, so may be freed after * this call. */ GimpColorSelectorID gimp_color_selector_register (const char *name, + const char *help_page, GimpColorSelectorMethods *methods); /* Remove the selector "id" from active service. New instances of the diff --git a/libgimp/gimpcolorselector.h b/libgimp/gimpcolorselector.h index 0e782a9857..e7632532e6 100644 --- a/libgimp/gimpcolorselector.h +++ b/libgimp/gimpcolorselector.h @@ -86,6 +86,7 @@ typedef void *GimpColorSelectorID; * the name and method table are internalised, so may be freed after * this call. */ GimpColorSelectorID gimp_color_selector_register (const char *name, + const char *help_page, GimpColorSelectorMethods *methods); /* Remove the selector "id" from active service. New instances of the diff --git a/libgimpwidgets/gimpcolorselect.c b/libgimpwidgets/gimpcolorselect.c index 8222bbd0c0..81fde9defe 100644 --- a/libgimpwidgets/gimpcolorselect.c +++ b/libgimpwidgets/gimpcolorselect.c @@ -45,6 +45,13 @@ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | \ GDK_BUTTON1_MOTION_MASK | GDK_ENTER_NOTIFY_MASK +typedef enum +{ + COLOR_SELECT_OK, + COLOR_SELECT_CANCEL, + COLOR_SELECT_UPDATE +} ColorSelectState; + typedef enum { HUE = 0, @@ -72,6 +79,33 @@ typedef enum UPDATE_CALLER = 1 << 6 } ColorSelectUpdateType; +typedef void (*ColorSelectCallback) (gint, gint, gint, ColorSelectState, void *); + +typedef struct _ColorSelect ColorSelect, *ColorSelectP; + +struct _ColorSelect +{ + GtkWidget *xy_color; + GtkWidget *z_color; + GtkWidget *new_color; + GtkWidget *orig_color; + GtkWidget *toggles[6]; + GtkWidget *entries[6]; + GtkWidget *hex_entry; + GtkAdjustment *slider_data[6]; + + gint pos[3]; + gint values[6]; + gint z_color_fill; + gint xy_color_fill; + gint orig_values[3]; + gboolean wants_updates; + GdkGC *gc; + + ColorSelectCallback callback; + void *client_data; +}; + typedef struct _ColorSelectFill ColorSelectFill; typedef void (*ColorSelectFillUpdateProc) (ColorSelectFill *); @@ -110,8 +144,6 @@ static void color_select_update_sliders (ColorSelect *, gint); static void color_select_update_entries (ColorSelect *, gint); static void color_select_update_colors (ColorSelect *, gint); -static void color_select_ok_callback (GtkWidget *, gpointer); -static void color_select_cancel_callback (GtkWidget *, gpointer); static gint color_select_xy_expose (GtkWidget *, GdkEventExpose *, ColorSelect *); static gint color_select_xy_events (GtkWidget *, GdkEvent *, @@ -180,60 +212,22 @@ static GtkTargetEntry color_select_target_table[] = static guint n_color_select_targets = (sizeof (color_select_target_table) / sizeof (color_select_target_table[0])); -ColorSelect * -color_select_new (gint r, - gint g, - gint b, - ColorSelectCallback callback, - gpointer data, - gboolean wants_updates) + +/* Register the GIMP colour selector with the color notebook */ +void +color_select_init (void) { - ColorSelect *csp; - GtkWidget *main_vbox; + GimpColorSelectorMethods methods = + { + color_select_notebook_new, + color_select_notebook_free, + color_select_notebook_setcolor + }; - csp = g_new (ColorSelect, 1); - - csp->callback = callback; - csp->client_data = data; - csp->z_color_fill = HUE; - csp->xy_color_fill = SATURATION_VALUE; - csp->gc = NULL; - csp->wants_updates = wants_updates; - - csp->values[RED] = csp->orig_values[0] = r; - csp->values[GREEN] = csp->orig_values[1] = g; - csp->values[BLUE] = csp->orig_values[2] = b; - color_select_update_hsv_values (csp); - color_select_update_pos (csp); - - csp->shell = - gimp_dialog_new (_("Color Selection"), "color_selection", - gimp_standard_help_func, - "dialogs/color_selection_dialog.html", - GTK_WIN_POS_NONE, - FALSE, FALSE, FALSE, - - wants_updates ? _("Close") : _("OK"), - color_select_ok_callback, - csp, NULL, TRUE, FALSE, - wants_updates ? _("Revert to Old Color") : _("Cancel"), - color_select_cancel_callback, - csp, NULL, FALSE, TRUE, - - NULL); - - main_vbox = color_select_widget_new (csp, r, g, b); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (csp->shell)->vbox), main_vbox); - gtk_widget_show (main_vbox); - - color_select_image_fill (csp->z_color, csp->z_color_fill, csp->values); - color_select_image_fill (csp->xy_color, csp->xy_color_fill, csp->values); - - gtk_widget_show (csp->shell); - - return csp; + gimp_color_selector_register ("GIMP", "built_in.html", &methods); } + static GtkWidget * color_select_widget_new (ColorSelect *csp, gint r, @@ -504,47 +498,7 @@ color_select_drag_old_color (GtkWidget *widget, *b = (guchar) csp->orig_values[2]; } -/* Register the GIMP colour selector with the color notebook */ -void -color_select_init (void) -{ - GimpColorSelectorMethods methods = - { - color_select_notebook_new, - color_select_notebook_free, - color_select_notebook_setcolor - }; - - gimp_color_selector_register ("GIMP", &methods); -} - -void -color_select_show (ColorSelect *csp) -{ - if (csp) - gtk_widget_show (csp->shell); -} - -void -color_select_hide (ColorSelect *csp) -{ - if (csp) - gtk_widget_hide (csp->shell); -} - -void -color_select_free (ColorSelect *csp) -{ - if (csp) - { - if (csp->shell) - gtk_widget_destroy (csp->shell); - gdk_gc_destroy (csp->gc); - g_free (csp); - } -} - -void +static void color_select_set_color (ColorSelect *csp, gint r, gint g, @@ -963,42 +917,6 @@ color_select_update_colors (ColorSelect *csp, } } -static void -color_select_ok_callback (GtkWidget *widget, - gpointer data) -{ - ColorSelect *csp; - - csp = (ColorSelect *) data; - if (csp) - { - if (csp->callback) - (* csp->callback) (csp->values[RED], - csp->values[GREEN], - csp->values[BLUE], - COLOR_SELECT_OK, - csp->client_data); - } -} - -static void -color_select_cancel_callback (GtkWidget *widget, - gpointer data) -{ - ColorSelect *csp; - - csp = (ColorSelect *) data; - if (csp) - { - if (csp->callback) - (* csp->callback) (csp->orig_values[0], - csp->orig_values[1], - csp->orig_values[2], - COLOR_SELECT_CANCEL, - csp->client_data); - } -} - static gint color_select_xy_expose (GtkWidget *widget, GdkEventExpose *event, @@ -2176,9 +2094,6 @@ color_select_notebook_new (gint r, glue->main_vbox = color_select_widget_new (csp, r, g, b); - /* the shell is provided by the notebook */ - csp->shell = NULL; - color_select_image_fill (csp->z_color, csp->z_color_fill, csp->values); color_select_image_fill (csp->xy_color, csp->xy_color_fill, csp->values); @@ -2186,13 +2101,13 @@ color_select_notebook_new (gint r, return glue->main_vbox; } - static void color_select_notebook_free (void *data) { notebook_glue *glue = data; - color_select_free (glue->csp); + gdk_gc_destroy (glue->csp->gc); + g_free (glue->csp); /* don't need to destroy the widget, since it's done by the caller * of this function */ g_free (glue); diff --git a/modules/colorsel_gtk.c b/modules/colorsel_gtk.c index ebe140bdad..33b2af9aa8 100644 --- a/modules/colorsel_gtk.c +++ b/modules/colorsel_gtk.c @@ -83,7 +83,7 @@ module_init (GimpModuleInfo **inforet) GimpColorSelectorID id; #ifndef __EMX__ - id = gimp_color_selector_register ("GTK", &methods); + id = gimp_color_selector_register ("GTK", "gtk.html", &methods); if (id) #else diff --git a/modules/colorsel_triangle.c b/modules/colorsel_triangle.c index 476da62cf2..a59b53ab08 100644 --- a/modules/colorsel_triangle.c +++ b/modules/colorsel_triangle.c @@ -169,7 +169,7 @@ module_init (GimpModuleInfo **inforet) GimpColorSelectorID id; #ifndef __EMX__ - id = gimp_color_selector_register ("Triangle", &methods); + id = gimp_color_selector_register ("Triangle", "triangle.html", &methods); if (id) #else diff --git a/modules/colorsel_water.c b/modules/colorsel_water.c index 8dc1dab50e..707aa7b11e 100644 --- a/modules/colorsel_water.c +++ b/modules/colorsel_water.c @@ -90,7 +90,8 @@ module_init (GimpModuleInfo **inforet) { GimpColorSelectorID id; - id = gimp_color_selector_register ("Watercolor", &methods); + id = gimp_color_selector_register ("Watercolor", "watercolor.html", + &methods); if (id) { diff --git a/plug-ins/common/compose.c b/plug-ins/common/compose.c index 1c806826c2..fb8087276a 100644 --- a/plug-ins/common/compose.c +++ b/plug-ins/common/compose.c @@ -231,7 +231,7 @@ query () "Peter Kirchgessner", "Peter Kirchgessner (peter@kirchgessner.net)", "1997", - N_("/Image/Channel Ops/Compose"), + N_("/Image/Channels/Compose"), "GRAY*", PROC_PLUG_IN, nargs, nreturn_vals, diff --git a/plug-ins/common/decompose.c b/plug-ins/common/decompose.c index f833b4fc21..87fd77592b 100644 --- a/plug-ins/common/decompose.c +++ b/plug-ins/common/decompose.c @@ -219,7 +219,7 @@ query () "Peter Kirchgessner", "Peter Kirchgessner (peter@kirchgessner.net)", "1997", - N_("/Image/Channel Ops/Decompose"), + N_("/Image/Channels/Decompose"), "RGB*", PROC_PLUG_IN, nargs, nreturn_vals, diff --git a/plug-ins/helpbrowser/helpbrowser.c b/plug-ins/helpbrowser/helpbrowser.c index 1e3c181d9e..69b04b9fc2 100644 --- a/plug-ins/helpbrowser/helpbrowser.c +++ b/plug-ins/helpbrowser/helpbrowser.c @@ -153,6 +153,7 @@ static HelpPage pages[] = } }; +static gchar *current_locale = "C"; static HelpPage *current_page = &pages[HELP]; static GList *history = NULL; @@ -735,6 +736,7 @@ open_browser_dialog (gchar *path) } eek_png_path = g_strconcat (root_dir, G_DIR_SEPARATOR_S, + "images", G_DIR_SEPARATOR_S, "eek.png", NULL); if (access (eek_png_path, R_OK) == 0) eek_png_tag = g_strdup_printf ("", eek_png_path); @@ -804,6 +806,7 @@ open_browser_dialog (gchar *path) pages[i].html = gtk_xmhtml_new (); pages[i].queue = queue_new (); pages[i].current_ref = g_strconcat (initial_dir, G_DIR_SEPARATOR_S, + current_locale, G_DIR_SEPARATOR_S, ".", NULL); gtk_xmhtml_set_anchor_underline_type (GTK_XMHTML (pages[i].html), @@ -865,10 +868,12 @@ open_browser_dialog (gchar *path) initial_ref = g_strdup (path); else initial_ref = g_strconcat (initial_dir, G_DIR_SEPARATOR_S, + current_locale, G_DIR_SEPARATOR_S, path, NULL); } else initial_ref = g_strconcat (initial_dir, G_DIR_SEPARATOR_S, + current_locale, G_DIR_SEPARATOR_S, pages[i].home, NULL); success = load_page (&pages[i], &pages[i], initial_ref, 0, TRUE, FALSE); @@ -945,16 +950,20 @@ run_temp_proc (gchar *name, /* Make sure all the arguments are there! */ if ((nparams != 1) || + !param[0].data.d_string || !strlen (param[0].data.d_string)) path = "welcome.html"; else path = param[0].data.d_string; + g_strdelimit (path, "/", G_DIR_SEPARATOR); + if (g_path_is_absolute (path)) path = g_strdup (path); else path = g_strconcat (gimp_data_directory (), G_DIR_SEPARATOR_S, GIMP_HELP_PREFIX, G_DIR_SEPARATOR_S, + current_locale, G_DIR_SEPARATOR_S, path, NULL); gtk_idle_add (idle_load_page, path); @@ -1088,6 +1097,7 @@ run (char *name, case RUN_WITH_LAST_VALS: /* Make sure all the arguments are there! */ if ((nparams != 2) || + !param[1].data.d_string || !strlen (param[1].data.d_string)) path = g_strdup ("welcome.html"); else @@ -1097,6 +1107,8 @@ run (char *name, break; } + g_strdelimit (path, "/", G_DIR_SEPARATOR); + if (status == STATUS_SUCCESS) { if (!open_url (path))