gimpitemfactory.c 85.1 KB
Newer Older
Elliot Lee's avatar
Elliot Lee committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/* The GIMP -- an image manipulation program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Elliot Lee's avatar
Elliot Lee committed
17
 */
Sven Neumann's avatar
Sven Neumann committed
18

19 20
#include "config.h"

Michael Natterer's avatar
Michael Natterer committed
21
#include <stdio.h>
Elliot Lee's avatar
Elliot Lee committed
22 23
#include <stdlib.h>
#include <string.h>
24

Sven Neumann's avatar
Sven Neumann committed
25
#include <gtk/gtk.h>
26 27
#include <gdk/gdkkeysyms.h>

28
#include "libgimpbase/gimpbase.h"
29 30
#include "libgimpwidgets/gimpwidgets.h"

31
#include "gui-types.h"
Sven Neumann's avatar
Sven Neumann committed
32

33
#include "core/gimp.h"
34
#include "core/gimplist.h"
Michael Natterer's avatar
Michael Natterer committed
35
#include "core/gimptoolinfo.h"
36

37 38
#include "display/gimpdisplay.h"

Michael Natterer's avatar
Michael Natterer committed
39 40 41 42 43 44 45
#include "tools/gimpbrightnesscontrasttool.h"
#include "tools/gimpcolorbalancetool.h"
#include "tools/gimpcurvestool.h"
#include "tools/gimphuesaturationtool.h"
#include "tools/gimplevelstool.h"
#include "tools/gimpposterizetool.h"
#include "tools/gimpthresholdtool.h"
46 47
#include "tools/tool_manager.h"

48
#include "buffers-commands.h"
49
#include "channels-commands.h"
Elliot Lee's avatar
Elliot Lee committed
50
#include "commands.h"
51
#include "data-commands.h"
52
#include "dialogs-commands.h"
53
#include "documents-commands.h"
Michael Natterer's avatar
Michael Natterer committed
54 55
#include "edit-commands.h"
#include "file-commands.h"
56
#include "gradients-commands.h"
Michael Natterer's avatar
Michael Natterer committed
57
#include "image-commands.h"
Michael Natterer's avatar
Michael Natterer committed
58
#include "layers-commands.h"
59
#include "menus.h"
60
#include "palettes-commands.h"
61
#include "paths-dialog.h"
Michael Natterer's avatar
Michael Natterer committed
62
#include "select-commands.h"
63
#include "test-commands.h"
Michael Natterer's avatar
Michael Natterer committed
64
#include "tools-commands.h"
Michael Natterer's avatar
Michael Natterer committed
65
#include "view-commands.h"
66

67
#include "gimphelp.h"
Elliot Lee's avatar
Elliot Lee committed
68
#include "gimprc.h"
69

70 71 72
#include "libgimp/gimpintl.h"


73 74
/*  local function prototypes  */

75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
static void    menus_create_item               (GtkItemFactory       *item_factory,
                                                GimpItemFactoryEntry *entry,
                                                gpointer              callback_data,
                                                guint                 callback_type,
                                                gboolean              create_tearoff,
                                                gboolean              static_entry);
static void    menus_create_items              (GtkItemFactory       *item_factory,
                                                guint                 n_entries,
                                                GimpItemFactoryEntry *entries,
                                                gpointer              callback_data,
                                                guint                 callback_type,
                                                gboolean              create_tearoff,
                                                gboolean              static_entries);
static GtkItemFactory * menus_item_factory_new (GtkType               container_type,
                                                const gchar          *path,
                                                const gchar          *factory_path,
                                                guint                 n_entries,
                                                GimpItemFactoryEntry *entries,
                                                gpointer              callback_data,
                                                gboolean              create_tearoff);
static void    menus_create_branches           (GtkItemFactory       *item_factory,
                                                GimpItemFactoryEntry *entry);
static void    menus_filters_subdirs_to_top    (GtkMenu              *menu);
static void    menus_tools_create              (GimpToolInfo         *tool_info);
static void    menus_last_opened_update_labels (GimpContainer        *container,
                                                GimpImagefile        *unused,
                                                Gimp                 *gimp);
102 103

#ifdef ENABLE_NLS
104 105
static gchar * menus_menu_translate_func  (const gchar          *path,
					   gpointer              data);
106
#else
107
#define        menus_menu_translate_func  (NULL)
108 109
#endif

110 111 112
static void    menus_tearoff_cmd_callback (GtkWidget            *widget,
					   gpointer              data,
					   guint                 action);
113

114
#ifdef ENABLE_DEBUG_ENTRY
115 116 117 118 119 120
static void    menus_debug_recurse_menu   (GtkWidget            *menu,
					   gint                  depth,
					   gchar                *path);
static void    menus_debug_cmd_callback   (GtkWidget            *widget,
					   gpointer              data,
					   guint                 action);
121
#endif  /*  ENABLE_DEBUG_ENTRY  */
122

123

Michael Natterer's avatar
Michael Natterer committed
124 125 126 127 128
#define SEPARATOR(path) \
        { { (path), NULL, NULL, 0, "<Separator>" }, NULL, NULL, NULL }

#define BRANCH(path) \
        { { (path), NULL, NULL, 0, "<Branch>" }, NULL, NULL, NULL }
129

130

131 132
/*****  <Toolbox>  *****/

133 134
static GimpItemFactoryEntry toolbox_entries[] =
{
135 136
  /*  <Toolbox>/File  */

Michael Natterer's avatar
Michael Natterer committed
137 138
  BRANCH (N_("/_File")),

139
  { { N_("/File/New..."), "<control>N",
140 141
      file_new_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_NEW },
Michael Natterer's avatar
Michael Natterer committed
142
    NULL,
143
    "file/dialogs/file_new.html", NULL },
144
  { { N_("/File/Open..."), "<control>O",
145 146
      file_open_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_OPEN },
Michael Natterer's avatar
Michael Natterer committed
147
    NULL,
Daniel Egger's avatar
Daniel Egger committed
148
    "file/dialogs/file_open.html", NULL },
149 150 151

  /*  <Toolbox>/File/Acquire  */

Michael Natterer's avatar
Michael Natterer committed
152
  SEPARATOR ("/File/---"),
153

Michael Natterer's avatar
Michael Natterer committed
154 155 156 157 158
  BRANCH (N_("/File/Acquire")),

  SEPARATOR ("/File/---"),

  { { N_("/File/Preferences..."), NULL,
159 160
      dialogs_create_toplevel_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_PREFERENCES },
Michael Natterer's avatar
Michael Natterer committed
161
    "gimp:preferences-dialog",
Michael Natterer's avatar
Michael Natterer committed
162
    "file/dialogs/preferences/preferences.html", NULL },
163 164

  /*  <Toolbox>/File/Dialogs  */
165

Michael Natterer's avatar
Michael Natterer committed
166 167 168 169 170
  SEPARATOR ("/File/---"),

  { { N_("/File/Dialogs/Layers, Channels & Paths..."), "<control>L",
      dialogs_create_lc_cmd_callback, 0 },
    NULL,
171
    "file/dialogs/layers_and_channels.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
172 173 174
  { { N_("/File/Dialogs/Tool Options..."), "<control><shift>T",
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:tool-options-dialog",
175 176
    "file/dialogs/tool_options.html", NULL },

Michael Natterer's avatar
Michael Natterer committed
177 178
  SEPARATOR ("/File/Dialogs/---"),

179
  { { "/File/Dialogs/Old + Testing/Brushes...", NULL,
Michael Natterer's avatar
Michael Natterer committed
180 181
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:brush-select-dialog",
182
    "file/dialogs/brush_selection.html", NULL },
183
  { { "/File/Dialogs/Old + Testing/Patterns...", NULL,
Michael Natterer's avatar
Michael Natterer committed
184 185
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:pattern-select-dialog",
186
    "file/dialogs/pattern_selection.html", NULL },
187
  { { "/File/Dialogs/Old + Testing/Gradients...", NULL,
Michael Natterer's avatar
Michael Natterer committed
188 189
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:gradient-select-dialog",
190
    "file/dialogs/gradient_selection.html", NULL },
191
  { { "/File/Dialogs/Old + Testing/Palette...", NULL,
Michael Natterer's avatar
Michael Natterer committed
192
      dialogs_create_toplevel_cmd_callback, 0 },
193
    "gimp:palette-select-dialog",
194
    "file/dialogs/palette_selection.html", NULL },
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219

  SEPARATOR ("/File/Dialogs/Old + Testing/---"),

  { { "/File/Dialogs/Old + Testing/Multi List...", NULL,
      test_multi_container_list_view_cmd_callback, 0 },
    NULL,
    NULL, NULL },
  { { "/File/Dialogs/Old + Testing/Multi Grid...", NULL,
      test_multi_container_grid_view_cmd_callback, 0 },
    NULL,
    NULL, NULL },

  { { N_("/File/Dialogs/Brushes..."), "<control><shift>B",
      dialogs_create_dockable_cmd_callback, 0 },
    "gimp:brush-grid",
    "file/dialogs/brush_selection.html", NULL },
  { { N_("/File/Dialogs/Patterns..."), "<control><shift>P",
      dialogs_create_dockable_cmd_callback, 0 },
    "gimp:pattern-grid",
    "file/dialogs/pattern_selection.html", NULL },
  { { N_("/File/Dialogs/Gradients..."), "<control>G",
      dialogs_create_dockable_cmd_callback, 0 },
    "gimp:gradient-list",
    "file/dialogs/gradient_selection.html", NULL },
  { { N_("/File/Dialogs/Palettes..."), "<control>P",
Michael Natterer's avatar
Michael Natterer committed
220 221
      dialogs_create_dockable_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_SELECT_COLOR },
222 223
    "gimp:palette-list",
    "file/dialogs/palette_selection.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
224
  { { N_("/File/Dialogs/Indexed Palette..."), NULL,
Michael Natterer's avatar
Michael Natterer committed
225 226
      dialogs_create_dockable_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_SELECT_COLOR },
227
    "gimp:indexed-palette",
228
    "file/dialogs/indexed_palette.html", NULL },
229 230 231 232
  { { N_("/File/Dialogs/Buffers..."), NULL,
      dialogs_create_dockable_cmd_callback, 0 },
    "gimp:buffer-list",
    NULL, NULL },
233 234 235 236
  { { N_("/File/Dialogs/Images..."), NULL,
      dialogs_create_dockable_cmd_callback, 0 },
    "gimp:image-list",
    NULL, NULL },
237

Michael Natterer's avatar
Michael Natterer committed
238 239 240 241 242
  SEPARATOR ("/File/Dialogs/---"),

  { { N_("/File/Dialogs/Input Devices..."), NULL,
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:input-devices-dialog",
243
    "file/dialogs/input_devices.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
244 245 246
  { { N_("/File/Dialogs/Device Status..."), NULL,
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:device-status-dialog",
247
    "file/dialogs/device_status.html", NULL },
248

Michael Natterer's avatar
Michael Natterer committed
249 250
  SEPARATOR ("/File/Dialogs/---"),

Michael Natterer's avatar
Michael Natterer committed
251 252 253
  { { N_("/File/Dialogs/Document History..."), NULL,
      dialogs_create_dockable_cmd_callback, 0 },
    "gimp:document-history",
254
    "file/dialogs/document_index.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
255
  { { N_("/File/Dialogs/Error Console..."), NULL,
Michael Natterer's avatar
Michael Natterer committed
256 257
      dialogs_create_dockable_cmd_callback, 0 },
    "gimp:error-console",
258
    "file/dialogs/error_console.html", NULL },
259
#ifdef DISPLAY_FILTERS
Michael Natterer's avatar
Michael Natterer committed
260 261 262
  { { N_("/File/Dialogs/Display Filters..."), NULL,
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:display-filters-dialog",
Michael Natterer's avatar
Michael Natterer committed
263
    "file/dialogs/display_filters/display_filters.html", NULL },
264
#endif /* DISPLAY_FILTERS */
265

Michael Natterer's avatar
Michael Natterer committed
266
  SEPARATOR ("/File/---"),
267 268 269

  /*  MRU entries are inserted here  */

Michael Natterer's avatar
Michael Natterer committed
270 271 272
  SEPARATOR ("/File/---MRU"),

  { { N_("/File/Quit"), "<control>Q",
273 274
      file_quit_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_QUIT },
Michael Natterer's avatar
Michael Natterer committed
275
    NULL,
276
    "file/quit.html", NULL },
277 278 279

  /*  <Toolbox>/Xtns  */

Michael Natterer's avatar
Michael Natterer committed
280 281 282 283 284
  BRANCH (N_("/_Xtns")),

  { { N_("/Xtns/Module Browser..."), NULL,
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:module-browser-dialog",
Michael Natterer's avatar
Michael Natterer committed
285
    "dialogs/module_browser.html", NULL },
286

Michael Natterer's avatar
Michael Natterer committed
287
  SEPARATOR ("/Xtns/---"),
288 289 290

  /*  <Toolbox>/Help  */

Michael Natterer's avatar
Michael Natterer committed
291 292 293
  BRANCH (N_("/_Help")),

  { { N_("/Help/Help..."), "F1",
294 295
      help_help_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_HELP },
Michael Natterer's avatar
Michael Natterer committed
296
    NULL,
297
    "help/dialogs/help.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
298 299 300
  { { N_("/Help/Context Help..."), "<shift>F1",
      help_context_help_cmd_callback, 0 },
    NULL,
301
    "help/context_help.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
302 303 304
  { { N_("/Help/Tip of the Day..."), NULL,
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:tips-dialog",
305
    "help/dialogs/tip_of_the_day.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
306 307 308
  { { N_("/Help/About..."), NULL,
      dialogs_create_toplevel_cmd_callback, 0 },
    "gimp:about-dialog",
309
    "help/dialogs/about.html", NULL },
310 311 312 313 314 315 316 317

  SEPARATOR ("/Help/---"),

  { { N_("/Help/Mem Profile"), NULL,
      mem_profile_cmd_callback, 0 },
    NULL,
    NULL, NULL },

318
#ifdef ENABLE_DEBUG_ENTRY
Michael Natterer's avatar
Michael Natterer committed
319
  { { "/Help/Dump Items (Debug)", NULL,
Michael Natterer's avatar
Michael Natterer committed
320 321
      menus_debug_cmd_callback, 0 },
    NULL,
322
    NULL, NULL }
323
#endif
324 325
};

326

327 328
/*****  <Image>  *****/

329 330
static GimpItemFactoryEntry image_entries[] =
{
331
  { { "/tearoff1", NULL, menus_tearoff_cmd_callback, 0, "<Tearoff>" },
Michael Natterer's avatar
Michael Natterer committed
332
    NULL,
333
    NULL, NULL },
334 335 336

  /*  <Image>/File  */

Michael Natterer's avatar
Michael Natterer committed
337
  { { N_("/File/New..."), "<control>N",
338 339
      file_new_cmd_callback, 1,
      "<StockItem>", GTK_STOCK_NEW },
Michael Natterer's avatar
Michael Natterer committed
340
    NULL,
341
    "file/dialogs/file_new.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
342
  { { N_("/File/Open..."), "<control>O",
343 344
      file_open_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_OPEN },
Michael Natterer's avatar
Michael Natterer committed
345
    NULL,
Daniel Egger's avatar
Daniel Egger committed
346
    "file/dialogs/file_open.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
347
  { { N_("/File/Save"), "<control>S",
348 349
      file_save_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_SAVE },
Michael Natterer's avatar
Michael Natterer committed
350
    NULL,
Daniel Egger's avatar
Daniel Egger committed
351
    "file/dialogs/file_save.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
352
  { { N_("/File/Save as..."), NULL,
353 354
      file_save_as_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_SAVE_AS },
Michael Natterer's avatar
Michael Natterer committed
355
    NULL,
356
    "file/dialogs/file_save.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
357
  { { N_("/File/Save a Copy as..."), NULL,
358 359
      file_save_a_copy_as_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_SAVE_AS },
Michael Natterer's avatar
Michael Natterer committed
360
    NULL,
Daniel Egger's avatar
Daniel Egger committed
361
    "file/dialogs/file_save.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
362
  { { N_("/File/Revert..."), NULL,
363 364
      file_revert_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_REVERT_TO_SAVED },
Michael Natterer's avatar
Michael Natterer committed
365
    NULL,
366
    "file/revert.html", NULL },
367

Michael Natterer's avatar
Michael Natterer committed
368 369 370
  SEPARATOR ("/File/---"),

  { { N_( "/File/Close"), "<control>W",
371 372
      file_close_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_CLOSE },
Michael Natterer's avatar
Michael Natterer committed
373
    NULL,
374
    "file/close.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
375
  { { N_("/File/Quit"), "<control>Q",
376 377
      file_quit_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_QUIT },
Michael Natterer's avatar
Michael Natterer committed
378
    NULL,
Michael Natterer's avatar
Michael Natterer committed
379
    "file/quit.html", NULL },
380

Michael Natterer's avatar
Michael Natterer committed
381
  SEPARATOR ("/File/---moved"),
382

383 384
  /*  <Image>/Edit  */

Michael Natterer's avatar
Michael Natterer committed
385
  { { N_("/Edit/Undo"), "<control>Z",
386 387
      edit_undo_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_UNDO },
Michael Natterer's avatar
Michael Natterer committed
388
    NULL,
389
    "edit/undo.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
390
  { { N_("/Edit/Redo"), "<control>R",
391 392
      edit_redo_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_REDO },
Michael Natterer's avatar
Michael Natterer committed
393
    NULL,
394 395
    "edit/redo.html", NULL },

Michael Natterer's avatar
Michael Natterer committed
396 397 398
  SEPARATOR ("/Edit/---"),

  { { N_("/Edit/Cut"), "<control>X",
399 400
      edit_cut_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_CUT },
Michael Natterer's avatar
Michael Natterer committed
401
    NULL,
402
    "edit/cut.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
403
  { { N_("/Edit/Copy"), "<control>C",
404 405
      edit_copy_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_COPY },
Michael Natterer's avatar
Michael Natterer committed
406
    NULL,
407
    "edit/copy.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
408
  { { N_("/Edit/Paste"), "<control>V",
409 410
      edit_paste_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_PASTE },
Michael Natterer's avatar
Michael Natterer committed
411
    NULL,
412
    "edit/paste.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
413
  { { N_("/Edit/Paste Into"), NULL,
414 415
      edit_paste_into_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_PASTE },
Michael Natterer's avatar
Michael Natterer committed
416
    NULL,
417
    "edit/paste_into.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
418
  { { N_("/Edit/Paste as New"), NULL,
419 420
      edit_paste_as_new_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_PASTE },
Michael Natterer's avatar
Michael Natterer committed
421
    NULL,
422
    "edit/paste_as_new.html", NULL },
423 424 425

  /*  <Image>/Edit/Buffer  */

Michael Natterer's avatar
Michael Natterer committed
426
  { { N_("/Edit/Buffer/Cut Named..."), "<control><shift>X",
427 428
      edit_named_cut_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_CUT },
Michael Natterer's avatar
Michael Natterer committed
429
    NULL,
430
    "edit/dialogs/cut_named.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
431
  { { N_("/Edit/Buffer/Copy Named..."), "<control><shift>C",
432 433
      edit_named_copy_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_COPY },
Michael Natterer's avatar
Michael Natterer committed
434
    NULL,
435
    "edit/dialogs/copy_named.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
436
  { { N_("/Edit/Buffer/Paste Named..."), "<control><shift>V",
437 438
      edit_named_paste_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_PASTE },
Michael Natterer's avatar
Michael Natterer committed
439
    NULL,
440 441
    "edit/dialogs/paste_named.html", NULL },

Michael Natterer's avatar
Michael Natterer committed
442 443 444
  SEPARATOR ("/Edit/---"),

  { { N_("/Edit/Clear"), "<control>K",
445 446
      edit_clear_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_CLEAR },
Michael Natterer's avatar
Michael Natterer committed
447
    NULL,
448
    "edit/clear.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
449
  { { N_("/Edit/Fill with FG Color"), "<control>comma",
450 451
      edit_fill_cmd_callback, (guint) FOREGROUND_FILL,
      "<StockItem>", GIMP_STOCK_TOOL_BUCKET_FILL },
Michael Natterer's avatar
Michael Natterer committed
452
    NULL,
453
    "edit/fill.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
454
  { { N_("/Edit/Fill with BG Color"), "<control>period",
455 456
      edit_fill_cmd_callback, (guint) BACKGROUND_FILL,
      "<StockItem>", GIMP_STOCK_TOOL_BUCKET_FILL },
Michael Natterer's avatar
Michael Natterer committed
457
    NULL,
458
    "edit/fill.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
459
  { { N_("/Edit/Stroke"), NULL,
460 461
      edit_stroke_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_STROKE },
Michael Natterer's avatar
Michael Natterer committed
462
    NULL,
463
    "edit/stroke.html", NULL },
464

Michael Natterer's avatar
Michael Natterer committed
465
  SEPARATOR ("/Edit/---"),
466 467

  /*  <Image>/Select  */
468
  
Michael Natterer's avatar
Michael Natterer committed
469 470 471
  { { N_("/Select/Invert"), "<control>I",
      select_invert_cmd_callback, 0 },
    NULL,
472
    "select/invert.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
473 474 475
  { { N_("/Select/All"), "<control>A",
      select_all_cmd_callback, 0 },
    NULL,
476
    "select/all.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
477 478 479
  { { N_("/Select/None"), "<control><shift>A",
      select_none_cmd_callback, 0 },
    NULL,
480
    "select/none.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
481 482 483
  { { N_("/Select/Float"), "<control><shift>L",
      select_float_cmd_callback, 0 },
    NULL,
484
    "select/float.html", NULL },
485

Michael Natterer's avatar
Michael Natterer committed
486 487 488 489 490
  SEPARATOR ("/Select/---"),

  { { N_("/Select/Feather..."), "<control><shift>F",
      select_feather_cmd_callback, 0 },
    NULL,
491
    "select/dialogs/feather_selection.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
492 493 494
  { { N_("/Select/Sharpen"), "<control><shift>H",
      select_sharpen_cmd_callback, 0 },
    NULL,
495
    "select/sharpen.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
496 497 498
  { { N_("/Select/Shrink..."), NULL,
      select_shrink_cmd_callback, 0 },
    NULL,
499
    "select/dialogs/shrink_selection.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
500 501 502
  { { N_("/Select/Grow..."), NULL,
      select_grow_cmd_callback, 0 },
    NULL,
503
    "select/dialogs/grow_selection.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
504 505 506
  { { N_("/Select/Border..."), "<control><shift>B",
      select_border_cmd_callback, 0 },
    NULL,
507
    "select/dialogs/border_selection.html", NULL },
508

Michael Natterer's avatar
Michael Natterer committed
509 510 511 512 513
  SEPARATOR ("/Select/---"),

  { { N_("/Select/Save to Channel"), NULL,
      select_save_cmd_callback, 0 },
    NULL,
514 515
    "select/save_to_channel.html", NULL },

516 517
  /*  <Image>/View  */

518
  { { N_("/View/Zoom In"), "equal",
519
      view_zoom_in_cmd_callback, 0,
520
      "<StockItem>", GTK_STOCK_ZOOM_IN },
Michael Natterer's avatar
Michael Natterer committed
521
    NULL,
522
    "view/zoom.html", NULL },
523
  { { N_("/View/Zoom Out"), "minus",
524
      view_zoom_out_cmd_callback, 0,
525
      "<StockItem>", GTK_STOCK_ZOOM_OUT },
Michael Natterer's avatar
Michael Natterer committed
526
    NULL,
527
    "view/zoom.html", NULL },
528 529 530 531 532
  { { N_("/View/Zoom to Fit Window"), NULL,
      view_zoom_fit_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_ZOOM_FIT },
    NULL,
    "view/zoom.html", NULL },
533 534 535

  /*  <Image>/View/Zoom  */

536 537 538
  { { N_("/View/Zoom/16:1"), NULL,
      view_zoom_cmd_callback, 1601,
      "<StockItem>", GTK_STOCK_ZOOM_IN },
Michael Natterer's avatar
Michael Natterer committed
539
    NULL,
540
    "view/zoom.html", NULL },
541 542 543
  { { N_("/View/Zoom/8:1"), NULL,
      view_zoom_cmd_callback, 801,
      "<StockItem>", GTK_STOCK_ZOOM_IN },
Michael Natterer's avatar
Michael Natterer committed
544
    NULL,
545
    "view/zoom.html", NULL },
546 547 548
  { { N_("/View/Zoom/4:1"), NULL,
      view_zoom_cmd_callback, 401,
      "<StockItem>", GTK_STOCK_ZOOM_IN },
Michael Natterer's avatar
Michael Natterer committed
549
    NULL,
550
    "view/zoom.html", NULL },
551 552 553
  { { N_("/View/Zoom/2:1"), NULL,
      view_zoom_cmd_callback, 201,
      "<StockItem>", GTK_STOCK_ZOOM_IN },
Michael Natterer's avatar
Michael Natterer committed
554
    NULL,
555
    "view/zoom.html", NULL },
556 557 558
  { { N_("/View/Zoom/1:1"), "1",
      view_zoom_cmd_callback, 101,
      "<StockItem>", GTK_STOCK_ZOOM_100 },
Michael Natterer's avatar
Michael Natterer committed
559
    NULL,
560
    "view/zoom.html", NULL },
561 562 563
  { { N_("/View/Zoom/1:2"), NULL,
      view_zoom_cmd_callback, 102,
      "<StockItem>", GTK_STOCK_ZOOM_OUT },
Michael Natterer's avatar
Michael Natterer committed
564
    NULL,
565
    "view/zoom.html", NULL },
566 567 568
  { { N_("/View/Zoom/1:4"), NULL,
      view_zoom_cmd_callback, 104,
      "<StockItem>", GTK_STOCK_ZOOM_OUT },
Michael Natterer's avatar
Michael Natterer committed
569
    NULL,
570
    "view/zoom.html", NULL },
571 572 573
  { { N_("/View/Zoom/1:8"), NULL,
      view_zoom_cmd_callback, 108,
      "<StockItem>", GTK_STOCK_ZOOM_OUT },
Michael Natterer's avatar
Michael Natterer committed
574
    NULL,
575
    "view/zoom.html", NULL },
576 577 578
  { { N_("/View/Zoom/1:16"), NULL,
      view_zoom_cmd_callback, 116,
      "<StockItem>", GTK_STOCK_ZOOM_OUT },
Michael Natterer's avatar
Michael Natterer committed
579
    NULL,
580
    "view/zoom.html", NULL },
581

Michael Natterer's avatar
Michael Natterer committed
582 583 584
  { { N_("/View/Dot for Dot"), NULL,
      view_dot_for_dot_cmd_callback, 0, "<ToggleItem>" },
    NULL,
585
    "view/dot_for_dot.html", NULL },
586

Michael Natterer's avatar
Michael Natterer committed
587 588 589
  SEPARATOR ("/View/---"),

  { { N_("/View/Info Window..."), "<control><shift>I",
590 591
      view_info_window_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_HELP },
Michael Natterer's avatar
Michael Natterer committed
592
    NULL,
593
    "view/dialogs/info_window.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
594
  { { N_("/View/Nav. Window..."), "<control><shift>N",
595 596
      view_nav_window_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_TOOL_MOVE },
Michael Natterer's avatar
Michael Natterer committed
597
    NULL,
598 599
    "view/dialogs/navigation_window.html", NULL },

Michael Natterer's avatar
Michael Natterer committed
600 601 602 603 604
  SEPARATOR ("/View/---"),

  { { N_("/View/Toggle Selection"), "<control>T",
      view_toggle_selection_cmd_callback, 0, "<ToggleItem>" },
    NULL,
605
    "view/toggle_selection.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
606 607
  { { N_("/View/Toggle Layer Boundary"), NULL,
      view_toggle_layer_boundary_cmd_callback, 0, "<ToggleItem>" },
Michael Natterer's avatar
Michael Natterer committed
608
    NULL,
Michael Natterer's avatar
Michael Natterer committed
609
    "view/toggle_selection.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
610 611 612
  { { N_("/View/Toggle Guides"), "<control><shift>T",
      view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
    NULL,
613
    "view/toggle_guides.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
614 615 616
  { { N_("/View/Snap to Guides"), NULL,
      view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
    NULL,
617
    "view/snap_to_guides.html", NULL },
618

Michael Natterer's avatar
Michael Natterer committed
619 620
  SEPARATOR ("/View/---"),

Michael Natterer's avatar
Michael Natterer committed
621 622 623 624 625 626 627 628 629 630 631
  { { N_("/View/Toggle Rulers"), "<control><shift>R",
      view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
    NULL,
    "view/toggle_rulers.html", NULL },
  { { N_("/View/Toggle Statusbar"), "<control><shift>S",
      view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
    NULL,
    "view/toggle_statusbar.html", NULL },

  SEPARATOR ("/View/---"),

Michael Natterer's avatar
Michael Natterer committed
632
  { { N_("/View/New View"), NULL,
633 634
      view_new_view_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_NEW },
Michael Natterer's avatar
Michael Natterer committed
635
    NULL,
636
    "view/new_view.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
637 638 639
  { { N_("/View/Shrink Wrap"), "<control>E",
      view_shrink_wrap_cmd_callback, 0 },
    NULL,
640 641
    "view/shrink_wrap.html", NULL },

642 643
  /*  <Image>/Image/Mode  */

Michael Natterer's avatar
Michael Natterer committed
644
  { { N_("/Image/Mode/RGB"), "<alt>R",
645 646
      image_convert_rgb_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_CONVERT },
Michael Natterer's avatar
Michael Natterer committed
647
    NULL,
648
    "image/mode/convert_to_rgb.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
649
  { { N_("/Image/Mode/Grayscale"), "<alt>G",
650 651
      image_convert_grayscale_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_CONVERT },
Michael Natterer's avatar
Michael Natterer committed
652
    NULL,
653
    "image/mode/convert_to_grayscale.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
654
  { { N_("/Image/Mode/Indexed..."), "<alt>I",
655 656
      image_convert_indexed_cmd_callback, 0,
      "<StockItem>", GTK_STOCK_CONVERT },
Michael Natterer's avatar
Michael Natterer committed
657
    NULL,
658 659
    "image/mode/dialogs/convert_to_indexed.html", NULL },

Michael Natterer's avatar
Michael Natterer committed
660
  SEPARATOR ("/Image/Mode/---"),
661 662 663

  /*  <Image>/Image/Colors  */

Michael Natterer's avatar
Michael Natterer committed
664 665 666
  { { N_("/Image/Colors/Desaturate"), NULL,
      image_desaturate_cmd_callback, 0 },
    NULL,
667
    "image/colors/desaturate.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
668 669 670
  { { N_("/Image/Colors/Invert"), NULL,
      image_invert_cmd_callback, 0 },
    NULL,
671 672
    "image/colors/invert.html", NULL },

Michael Natterer's avatar
Michael Natterer committed
673
  SEPARATOR ("/Image/Colors/---"),
674

675 676
  /*  <Image>/Image/Colors/Auto  */

Michael Natterer's avatar
Michael Natterer committed
677 678 679
  { { N_("/Image/Colors/Auto/Equalize"), NULL,
      image_equalize_cmd_callback, 0 },
    NULL,
680 681
    "image/colors/auto/equalize.html", NULL },

Michael Natterer's avatar
Michael Natterer committed
682
  SEPARATOR ("/Image/Colors/---"),
683 684

  /*  <Image>/Image/Alpha  */
685

Michael Natterer's avatar
Michael Natterer committed
686 687 688
  { { N_("/Image/Alpha/Add Alpha Channel"), NULL,
      layers_add_alpha_channel_cmd_callback, 0 },
    NULL,
689 690
    "layers/add_alpha_channel.html", NULL },

691 692
  /*  <Image>/Image/Transforms  */

Michael Natterer's avatar
Michael Natterer committed
693 694 695
  { { N_("/Image/Transforms/Offset..."), "<control><shift>O",
      image_offset_cmd_callback, 0 },
    NULL,
696
    "image/transforms/dialogs/offset.html", NULL },
697

Michael Natterer's avatar
Michael Natterer committed
698 699 700 701 702 703 704 705 706
  BRANCH (N_("/Image/Transforms/Rotate")),

  SEPARATOR ("/Image/Transforms/---"),

  SEPARATOR ("/Image/---"),

  { { N_("/Image/Canvas Size..."), NULL,
      image_resize_cmd_callback, 0 },
    NULL,
707
    "image/dialogs/set_canvas_size.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
708
  { { N_("/Image/Scale Image..."), NULL,
709 710
      image_scale_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_TOOL_SCALE },
Michael Natterer's avatar
Michael Natterer committed
711
    NULL,
712
    "image/dialogs/scale_image.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
713
  { { N_("/Image/Duplicate"), "<control>D",
Michael Natterer's avatar
Michael Natterer committed
714 715
      image_duplicate_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_DUPLICATE },
Michael Natterer's avatar
Michael Natterer committed
716
    NULL,
717
    "image/duplicate.html", NULL },
718

Michael Natterer's avatar
Michael Natterer committed
719
  SEPARATOR ("/Image/---"),
720

721 722
  /*  <Image>/Layers  */

Michael Natterer's avatar
Michael Natterer committed
723 724 725
  { { N_("/Layers/Layers, Channels & Paths..."), "<control>L",
      dialogs_create_lc_cmd_callback, 0 },
    NULL,
Michael Natterer's avatar
Michael Natterer committed
726
    "dialogs/layers_and_channels.html", NULL },
Michael Natterer's avatar
Michael Natterer committed
727 728 729 730 731 732

  SEPARATOR ("/Layers/---"),

  { { N_("/Layers/Layer to Imagesize"), NULL,
      layers_resize_to_image_cmd_callback, 0 },
    NULL,
733
    "layers/layer_to_image_size.html", NULL },
734 735 736

  /*  <Image>/Layers/Stack  */

Michael Natterer's avatar
Michael Natterer committed
737 738 739
  { { N_("/Layers/Stack/Previous Layer"), "Prior",
      layers_previous_cmd_callback, 0 },
    NULL,
Michael Natterer's avatar
Michael Natterer committed
740
    "layers/stack/stack.html#previous_layer", NULL },
Michael Natterer's avatar
Michael Natterer committed
741 742 743
  { { N_("/Layers/Stack/Next Layer"), "Next",
      layers_next_cmd_callback, 0 },
    NULL,
Michael Natterer's avatar
Michael Natterer committed
744
    "layers/stack/stack.html#next_layer", NULL },
Michael Natterer's avatar
Michael Natterer committed
745
  { { N_("/Layers/Stack/Raise Layer"), "<shift>Prior",
746 747
      layers_raise_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_RAISE },
Michael Natterer's avatar
Michael Natterer committed
748
    NULL,
Michael Natterer's avatar
Michael Natterer committed
749
    "layers/stack/stack.html#raise_layer", NULL },
Michael Natterer's avatar
Michael Natterer committed
750
  { { N_("/Layers/Stack/Lower Layer"), "<shift>Next",
751 752
      layers_lower_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_LOWER },
Michael Natterer's avatar
Michael Natterer committed
753
    NULL,
Michael Natterer's avatar
Michael Natterer committed
754
    "layers/stack/stack.html#lower_layer", NULL },
Michael Natterer's avatar
Michael Natterer committed
755
  { { N_("/Layers/Stack/Layer to Top"), "<control>Prior",
756 757
      layers_raise_to_top_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_RAISE },
Michael Natterer's avatar
Michael Natterer committed
758
    NULL,
Michael Natterer's avatar
Michael Natterer committed
759
    "layers/stack/stack.html#layer_to_top", NULL },
Michael Natterer's avatar
Michael Natterer committed
760
  { { N_("/Layers/Stack/Layer to Bottom"), "<control>Next",
761 762
      layers_lower_to_bottom_cmd_callback, 0,
      "<StockItem>", GIMP_STOCK_LOWER },
Michael Natterer's avatar
Michael Natterer committed
763
    NULL,
Michael Natterer's avatar
Michael Natterer committed
764
    "layers/stack/stack.html#layer_to_bottom", NULL },
Michael Natterer's avatar
Michael Natterer committed
765 766

  SEPARATOR ("/Layers/Stack/---"),
767 768 769

  /*  <Image>/Layers/Rotate  */

Michael Natterer's avatar
Michael Natterer committed
770
  BRANCH (N_("/Layers/Rotate")),