1997-11-25 06:05:25 +08:00
|
|
|
/* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "appenv.h"
|
|
|
|
#include "colormaps.h"
|
|
|
|
#include "commands.h"
|
|
|
|
#include "fileops.h"
|
1998-07-12 13:18:17 +08:00
|
|
|
#include "general.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimprc.h"
|
|
|
|
#include "interface.h"
|
|
|
|
#include "menus.h"
|
|
|
|
#include "paint_funcs.h"
|
|
|
|
#include "procedural_db.h"
|
|
|
|
#include "scale.h"
|
|
|
|
#include "tools.h"
|
1998-03-11 16:58:42 +08:00
|
|
|
#include "gdisplay.h"
|
1998-07-08 17:04:33 +08:00
|
|
|
#include "docindex.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
#define MRU_MENU_ENTRY_SIZE sizeof ("/File/MRU00 ")
|
1998-07-12 13:18:17 +08:00
|
|
|
#define MRU_MENU_ACCEL_SIZE sizeof ("<control>0")
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void menus_init (void);
|
1998-08-06 07:46:04 +08:00
|
|
|
static GtkItemFactoryEntry * translate_entries (GtkItemFactoryEntry *, gint);
|
|
|
|
static void free_translated_entries(GtkItemFactoryEntry *, gint);
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-07-12 13:18:17 +08:00
|
|
|
static GSList *last_opened_raw_filenames = NULL;
|
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
static GtkItemFactoryEntry toolbox_entries[] =
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 0 },
|
|
|
|
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
|
|
|
|
{ N_("/File/About..."), NULL, about_dialog_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/---"), NULL, NULL, 0, "<Separator>" },
|
|
|
|
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
|
|
|
|
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
|
|
|
|
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
|
1998-11-01 00:22:37 +08:00
|
|
|
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
|
|
|
|
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>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/---"), NULL, NULL, 0, "<Separator>" },
|
1998-06-07 21:55:36 +08:00
|
|
|
};
|
|
|
|
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
|
|
|
|
static GtkItemFactory *toolbox_factory = NULL;
|
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
static GtkItemFactoryEntry file_menu_separator = { N_("/File/---"), NULL, NULL, 0, "<Separator>" };
|
|
|
|
static GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 };
|
1998-07-12 13:18:17 +08:00
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
static GtkItemFactoryEntry image_entries[] =
|
|
|
|
{
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 1 },
|
|
|
|
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
|
|
|
|
{ N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
|
|
|
|
{ N_("/File/Save as"), NULL, file_save_as_cmd_callback, 0 },
|
|
|
|
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
|
|
|
|
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/File/Close"), "<control>W", file_close_cmd_callback, 0 },
|
|
|
|
{ N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 },
|
|
|
|
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Edit/Cut"), "<control>X", edit_cut_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Copy"), "<control>C", edit_copy_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Paste"), "<control>V", edit_paste_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Paste Into"), NULL, edit_paste_into_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Clear"), "<control>K", edit_clear_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Fill"), "<control>period", edit_fill_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Stroke"), NULL, edit_stroke_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Undo"), "<control>Z", edit_undo_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Redo"), "<control>R", edit_redo_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
|
|
|
|
{ N_("/Edit/Cut Named"), "<control><shift>X", edit_named_cut_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Copy Named"), "<control><shift>C", edit_named_copy_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/Paste Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
|
|
|
|
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Select/Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/Invert"), "<control>I", select_invert_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/All"), "<control>A", select_all_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/None"), "<control><shift>A", select_none_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/Float"), "<control><shift>L", select_float_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/Sharpen"), "<control><shift>H", select_sharpen_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/Border"), "<control><shift>B", select_border_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/Feather"), "<control><shift>F", select_feather_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/Grow"), NULL, select_grow_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 },
|
|
|
|
{ N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 },
|
1998-06-22 04:17:21 +08:00
|
|
|
/*
|
|
|
|
{ "/Select/By Color...", NULL, tools_select_cmd_callback, BY_COLOR_SELECT },
|
|
|
|
*/
|
1998-08-06 07:46:04 +08:00
|
|
|
|
|
|
|
{ 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 },
|
1998-12-06 05:48:37 +08:00
|
|
|
{ N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/View/Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
|
|
|
|
{ N_("/View/Toggle Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
|
|
|
|
{ N_("/View/Toggle Statusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
|
|
|
|
{ N_("/View/Toggle Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
|
|
|
|
{ N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
|
|
|
|
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
|
|
|
|
{ N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 },
|
|
|
|
{ N_("/View/Shrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 },
|
|
|
|
{ N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 },
|
1998-06-22 04:17:21 +08:00
|
|
|
/*
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Image/Colors/Posterize"), NULL, tools_select_cmd_callback, POSTERIZE },
|
|
|
|
{ N_("/Image/Colors/Threshold"), NULL, tools_select_cmd_callback, THRESHOLD },
|
|
|
|
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
|
|
|
|
{ N_("/Image/Colors/Color Balance"), NULL, tools_select_cmd_callback, COLOR_BALANCE },
|
|
|
|
{ N_("/Image/Colors/Brightness-Contrast"), NULL, tools_select_cmd_callback, BRIGHTNESS_CONTRAST },
|
|
|
|
{ N_("/Image/Colors/Hue-Saturation"), NULL, tools_select_cmd_callback, 0 },
|
|
|
|
{ N_("/Image/Colors/Curves"), NULL, tools_select_cmd_callback, CURVES },
|
|
|
|
{ N_("/Image/Colors/Levels"), NULL, tools_select_cmd_callback, LEVELS },
|
1998-06-22 04:17:21 +08:00
|
|
|
*/
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
|
|
|
|
{ N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
|
|
|
|
{ N_("/Image/Channel Ops/Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
|
|
|
|
{ N_("/Image/Channel Ops/Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
|
|
|
|
{ N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
|
|
|
|
{ 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, "<Separator>" },
|
|
|
|
{ N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 },
|
|
|
|
{ N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 },
|
|
|
|
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
|
|
|
|
/* { N_("/Image/Histogram"), NULL, tools_select_cmd_callback, HISTOGRAM}, */
|
|
|
|
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Layers/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
|
|
|
|
{ N_("/Layers/Raise Layer"), "<control>F", layers_raise_cmd_callback, 0 },
|
|
|
|
{ N_("/Layers/Lower Layer"), "<control>B", layers_lower_cmd_callback, 0 },
|
|
|
|
{ N_("/Layers/Anchor Layer"), "<control>H", layers_anchor_cmd_callback, 0 },
|
|
|
|
{ N_("/Layers/Merge Visible Layers"), "<control>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 },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
/* { N_("/Tools/Rect Select"), "R", tools_select_cmd_callback, RECT_SELECT },
|
|
|
|
{ N_("/Tools/Ellipse Select"), "E", tools_select_cmd_callback, ELLIPSE_SELECT },
|
|
|
|
{ N_("/Tools/Free Select"), "F", tools_select_cmd_callback, FREE_SELECT },
|
|
|
|
{ N_("/Tools/Fuzzy Select"), "Z", tools_select_cmd_callback, FUZZY_SELECT },
|
|
|
|
{ N_("/Tools/Bezier Select"), "B", tools_select_cmd_callback, BEZIER_SELECT },
|
|
|
|
{ N_("/Tools/Intelligent Scissors"), "I", tools_select_cmd_callback, ISCISSORS },
|
|
|
|
{ N_("/Tools/Move"), "M", tools_select_cmd_callback, MOVE },
|
|
|
|
{ N_("/Tools/Magnify"), "<shift>M", tools_select_cmd_callback, MAGNIFY },
|
|
|
|
{ N_("/Tools/Crop"), "<shift>C", tools_select_cmd_callback, CROP },
|
|
|
|
{ N_("/Tools/Transform"), "<shift>T", tools_select_cmd_callback, ROTATE },
|
|
|
|
{ N_("/Tools/Flip"), "<shift>F", tools_select_cmd_callback, FLIP_HORZ },
|
|
|
|
{ N_("/Tools/Text"), "T", tools_select_cmd_callback, TEXT },
|
|
|
|
{ N_("/Tools/Color Picker"), "O", tools_select_cmd_callback, COLOR_PICKER },
|
|
|
|
{ N_("/Tools/Bucket Fill"), "<shift>B", tools_select_cmd_callback, BUCKET_FILL },
|
|
|
|
{ N_("/Tools/Blend"), "L", tools_select_cmd_callback, BLEND },
|
|
|
|
{ N_("/Tools/Paintbrush"), "P", tools_select_cmd_callback, PAINTBRUSH },
|
|
|
|
{ N_("/Tools/Pencil"), "<shift>P", tools_select_cmd_callback, PENCIL },
|
|
|
|
{ N_("/Tools/Eraser"), "<shift>E", tools_select_cmd_callback, ERASER },
|
|
|
|
{ N_("/Tools/Airbrush"), "A", tools_select_cmd_callback, AIRBRUSH },
|
|
|
|
{ N_("/Tools/Clone"), "C", tools_select_cmd_callback, CLONE },
|
|
|
|
{ N_("/Tools/Convolve"), "V", tools_select_cmd_callback, CONVOLVE },
|
|
|
|
{ N_("/Tools/Ink"), "K", tools_select_cmd_callback, INK },
|
|
|
|
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
|
|
|
|
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 }, */
|
|
|
|
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
|
|
|
|
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
|
|
|
|
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
|
|
|
|
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
|
|
|
|
{ N_("/Filters/"), NULL, NULL, 0 },
|
|
|
|
{ N_("/Filters/Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
|
|
|
|
{ N_("/Filters/Re-show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
|
|
|
|
{ N_("/Filters/---"), NULL, NULL, 0, "<Separator>" },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Script-Fu/"), NULL, NULL, 0 },
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
|
|
|
|
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
|
|
|
|
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
|
1998-11-01 00:22:37 +08:00
|
|
|
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Dialogs/Layers & Channels..."), "<control>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 },
|
1998-06-07 21:55:36 +08:00
|
|
|
};
|
|
|
|
static guint n_image_entries = sizeof (image_entries) / sizeof (image_entries[0]);
|
|
|
|
static GtkItemFactory *image_factory = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
static GtkItemFactoryEntry load_entries[] =
|
|
|
|
{
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/Automatic"), NULL, file_load_by_extension_callback, 0 },
|
1998-06-07 21:55:36 +08:00
|
|
|
{ "/---", NULL, NULL, 0, "<Separator>" },
|
|
|
|
};
|
|
|
|
static guint n_load_entries = sizeof (load_entries) / sizeof (load_entries[0]);
|
|
|
|
static GtkItemFactory *load_factory = NULL;
|
1998-01-25 10:18:54 +08:00
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
static GtkItemFactoryEntry save_entries[] =
|
|
|
|
{
|
1998-08-06 07:46:04 +08:00
|
|
|
{ N_("/By extension"), NULL, file_save_by_extension_callback, 0 },
|
1998-06-07 21:55:36 +08:00
|
|
|
{ "/---", NULL, NULL, 0, "<Separator>" },
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
1998-06-07 21:55:36 +08:00
|
|
|
static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]);
|
|
|
|
static GtkItemFactory *save_factory = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static int initialize = TRUE;
|
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
extern int num_tools;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
menus_get_toolbox_menubar (GtkWidget **menubar,
|
1998-06-07 21:55:36 +08:00
|
|
|
GtkAccelGroup **accel_group)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (initialize)
|
|
|
|
menus_init ();
|
1998-06-07 21:55:36 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (menubar)
|
1998-06-07 21:55:36 +08:00
|
|
|
*menubar = toolbox_factory->widget;
|
|
|
|
if (accel_group)
|
|
|
|
*accel_group = toolbox_factory->accel_group;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_get_image_menu (GtkWidget **menu,
|
1998-06-07 21:55:36 +08:00
|
|
|
GtkAccelGroup **accel_group)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (initialize)
|
|
|
|
menus_init ();
|
|
|
|
|
|
|
|
if (menu)
|
1998-06-07 21:55:36 +08:00
|
|
|
*menu = image_factory->widget;
|
|
|
|
if (accel_group)
|
|
|
|
*accel_group = image_factory->accel_group;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_get_load_menu (GtkWidget **menu,
|
1998-06-07 21:55:36 +08:00
|
|
|
GtkAccelGroup **accel_group)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (initialize)
|
|
|
|
menus_init ();
|
|
|
|
|
|
|
|
if (menu)
|
1998-06-07 21:55:36 +08:00
|
|
|
*menu = load_factory->widget;
|
|
|
|
if (accel_group)
|
|
|
|
*accel_group = load_factory->accel_group;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_get_save_menu (GtkWidget **menu,
|
1998-06-07 21:55:36 +08:00
|
|
|
GtkAccelGroup **accel_group)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (initialize)
|
|
|
|
menus_init ();
|
|
|
|
|
|
|
|
if (menu)
|
1998-06-07 21:55:36 +08:00
|
|
|
*menu = save_factory->widget;
|
|
|
|
if (accel_group)
|
|
|
|
*accel_group = save_factory->accel_group;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_create (GtkMenuEntry *entries,
|
|
|
|
int nmenu_entries)
|
|
|
|
{
|
|
|
|
if (initialize)
|
|
|
|
menus_init ();
|
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
gtk_item_factory_create_menu_entries (nmenu_entries, entries);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-06-22 04:17:21 +08:00
|
|
|
void
|
|
|
|
menus_tools_create (ToolInfo *tool_info)
|
|
|
|
{
|
|
|
|
GtkItemFactoryEntry entry;
|
|
|
|
|
|
|
|
/* entry.path = g_strconcat ("<Image>", tool_info->menu_path, NULL);*/
|
|
|
|
/* entry.callback_data = tool_info; */
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
entry.path = gettext(tool_info->menu_path);
|
1998-06-22 04:17:21 +08:00
|
|
|
entry.accelerator = tool_info->menu_accel;
|
|
|
|
entry.callback = tools_select_cmd_callback;
|
|
|
|
entry.callback_action = tool_info->tool_id;
|
|
|
|
entry.item_type = NULL;
|
|
|
|
|
|
|
|
fflush(stderr);
|
|
|
|
/*menus_create (&entry, 1);*/
|
|
|
|
gtk_item_factory_create_item (image_factory,
|
|
|
|
&entry,
|
|
|
|
(gpointer)tool_info,
|
|
|
|
2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
menus_set_sensitive (char *path,
|
|
|
|
int sensitive)
|
|
|
|
{
|
1998-06-07 21:55:36 +08:00
|
|
|
GtkItemFactory *ifactory;
|
|
|
|
GtkWidget *widget = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (initialize)
|
|
|
|
menus_init ();
|
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
ifactory = gtk_item_factory_from_path (path);
|
|
|
|
|
|
|
|
if (ifactory)
|
|
|
|
{
|
|
|
|
widget = gtk_item_factory_get_widget (ifactory, path);
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
gtk_widget_set_sensitive (widget, sensitive);
|
|
|
|
}
|
|
|
|
if (!ifactory || !widget)
|
1998-11-06 08:51:39 +08:00
|
|
|
g_message (_("Unable to set sensitivity for menu which doesn't exist:\n%s"), path);
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
menus_set_state (char *path,
|
|
|
|
int state)
|
|
|
|
{
|
1998-06-07 21:55:36 +08:00
|
|
|
GtkItemFactory *ifactory;
|
|
|
|
GtkWidget *widget = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (initialize)
|
|
|
|
menus_init ();
|
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
ifactory = gtk_item_factory_from_path (path);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
if (ifactory)
|
|
|
|
{
|
|
|
|
widget = gtk_item_factory_get_widget (ifactory, path);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
if (widget && GTK_IS_CHECK_MENU_ITEM (widget))
|
|
|
|
gtk_check_menu_item_set_state (GTK_CHECK_MENU_ITEM (widget), state);
|
|
|
|
else
|
|
|
|
widget = NULL;
|
|
|
|
}
|
|
|
|
if (!ifactory || !widget)
|
1998-11-06 08:51:39 +08:00
|
|
|
g_message (_("Unable to set state for menu which doesn't exist:\n%s\n"), path);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_destroy (char *path)
|
|
|
|
{
|
|
|
|
if (initialize)
|
|
|
|
menus_init ();
|
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
gtk_item_factories_path_delete (NULL, path);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_quit ()
|
|
|
|
{
|
1998-06-07 21:55:36 +08:00
|
|
|
gchar *filename;
|
|
|
|
|
|
|
|
filename = g_strconcat (gimp_directory (), "/menurc", NULL);
|
|
|
|
gtk_item_factory_dump_rc (filename, NULL, TRUE);
|
|
|
|
g_free (filename);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-02-04 06:56:55 +08:00
|
|
|
if (!initialize)
|
|
|
|
{
|
1998-06-09 08:50:32 +08:00
|
|
|
gtk_object_unref (GTK_OBJECT (toolbox_factory));
|
|
|
|
gtk_object_unref (GTK_OBJECT (image_factory));
|
|
|
|
gtk_object_unref (GTK_OBJECT (load_factory));
|
|
|
|
gtk_object_unref (GTK_OBJECT (save_factory));
|
1998-02-04 06:56:55 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-07-12 13:18:17 +08:00
|
|
|
void
|
|
|
|
menus_last_opened_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer callback_data,
|
|
|
|
guint num)
|
|
|
|
{
|
|
|
|
gchar *filename, *raw_filename;
|
|
|
|
|
|
|
|
raw_filename = ((GString *) g_slist_nth_data (last_opened_raw_filenames, num))->str;
|
|
|
|
filename = prune_filename (raw_filename);
|
|
|
|
|
|
|
|
if (!file_open(raw_filename, filename))
|
1998-08-06 07:46:04 +08:00
|
|
|
g_message (_("Error opening file: %s\n"), raw_filename);
|
1998-07-12 13:18:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_last_opened_update_labels ()
|
|
|
|
{
|
|
|
|
GSList *filename_slist;
|
|
|
|
GString *entry_filename, *path;
|
|
|
|
GtkWidget *widget;
|
|
|
|
gint i;
|
1998-07-14 06:31:45 +08:00
|
|
|
guint num_entries;
|
1998-07-12 13:18:17 +08:00
|
|
|
|
|
|
|
entry_filename = g_string_new ("");
|
|
|
|
path = g_string_new ("");
|
|
|
|
|
|
|
|
filename_slist = last_opened_raw_filenames;
|
1998-07-14 06:31:45 +08:00
|
|
|
num_entries = g_slist_length (last_opened_raw_filenames);
|
1998-07-12 13:18:17 +08:00
|
|
|
|
|
|
|
for (i = 1; i <= num_entries; i++)
|
|
|
|
{
|
|
|
|
g_string_sprintf (entry_filename, "%d. %s", i, prune_filename (((GString *) filename_slist->data)->str));
|
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
g_string_sprintf (path, _("/File/MRU%02d"), i);
|
1998-07-12 13:18:17 +08:00
|
|
|
|
|
|
|
widget = gtk_item_factory_get_widget (toolbox_factory, path->str);
|
|
|
|
gtk_widget_show (widget);
|
|
|
|
|
|
|
|
gtk_label_set (GTK_LABEL (GTK_BIN (widget)->child), entry_filename->str);
|
|
|
|
|
|
|
|
filename_slist = filename_slist->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_string_free (entry_filename, TRUE);
|
|
|
|
g_string_free (path, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_last_opened_add (gchar *filename)
|
|
|
|
{
|
|
|
|
GString *raw_filename;
|
|
|
|
GtkWidget *widget;
|
1998-07-14 06:31:45 +08:00
|
|
|
guint num_entries;
|
|
|
|
|
|
|
|
num_entries = g_slist_length (last_opened_raw_filenames);
|
1998-07-12 13:18:17 +08:00
|
|
|
|
|
|
|
if (num_entries == last_opened_size)
|
|
|
|
{
|
1998-07-14 06:31:45 +08:00
|
|
|
g_slist_remove_link (last_opened_raw_filenames,
|
|
|
|
g_slist_last (last_opened_raw_filenames));
|
1998-07-12 13:18:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
raw_filename = g_string_new (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);
|
|
|
|
gtk_widget_show (widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
menus_last_opened_update_labels ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
menus_init_mru ()
|
|
|
|
{
|
|
|
|
gchar *paths, *accelerators;
|
|
|
|
gint i;
|
|
|
|
GtkItemFactoryEntry *last_opened_entries;
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
last_opened_entries = g_new (GtkItemFactoryEntry, last_opened_size);
|
|
|
|
|
|
|
|
paths = g_new (gchar, last_opened_size * MRU_MENU_ENTRY_SIZE);
|
|
|
|
accelerators = g_new (gchar, 9 * MRU_MENU_ACCEL_SIZE);
|
|
|
|
|
|
|
|
for (i = 0; i < last_opened_size; i++)
|
|
|
|
{
|
|
|
|
gchar *path, *accelerator;
|
|
|
|
|
|
|
|
path = &paths[i * MRU_MENU_ENTRY_SIZE];
|
|
|
|
if (i < 9)
|
|
|
|
accelerator = &accelerators[i * MRU_MENU_ACCEL_SIZE];
|
|
|
|
else
|
|
|
|
accelerator = NULL;
|
|
|
|
|
|
|
|
last_opened_entries[i].path = path;
|
|
|
|
last_opened_entries[i].accelerator = accelerator;
|
|
|
|
last_opened_entries[i].callback = (GtkItemFactoryCallback) menus_last_opened_cmd_callback;
|
|
|
|
last_opened_entries[i].callback_action = i;
|
|
|
|
last_opened_entries[i].item_type = NULL;
|
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
sprintf (path, _("/File/MRU%02d"), i + 1);
|
1998-07-12 13:18:17 +08:00
|
|
|
sprintf (accelerator, "<control>%d", i + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_item_factory_create_items_ac (toolbox_factory, last_opened_size,
|
|
|
|
last_opened_entries, NULL, 2);
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
|
1998-07-12 13:18:17 +08:00
|
|
|
for (i=0; i < last_opened_size; i++)
|
|
|
|
{
|
|
|
|
widget = gtk_item_factory_get_widget (toolbox_factory,
|
|
|
|
last_opened_entries[i].path);
|
|
|
|
gtk_widget_hide (widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
widget = gtk_item_factory_get_widget (toolbox_factory, file_menu_separator.path);
|
|
|
|
gtk_widget_hide (widget);
|
|
|
|
|
|
|
|
g_free (paths);
|
|
|
|
g_free (accelerators);
|
|
|
|
g_free (last_opened_entries);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is separate from menus_init() in case the last_opened_size changes,
|
|
|
|
or for any other reason we might want to regen just the toolbox menu */
|
|
|
|
void
|
|
|
|
menus_init_toolbox ()
|
|
|
|
{
|
1998-08-06 07:46:04 +08:00
|
|
|
GtkItemFactoryEntry *translated_entries;
|
|
|
|
|
1998-07-12 13:18:17 +08:00
|
|
|
toolbox_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<Toolbox>", NULL);
|
1998-08-06 07:46:04 +08:00
|
|
|
translated_entries=translate_entries(toolbox_entries, n_toolbox_entries);
|
1998-07-12 13:18:17 +08:00
|
|
|
gtk_item_factory_create_items_ac (toolbox_factory, n_toolbox_entries,
|
1998-08-06 07:46:04 +08:00
|
|
|
translated_entries, NULL, 2);
|
|
|
|
free_translated_entries(translated_entries, n_toolbox_entries);
|
1998-07-12 13:18:17 +08:00
|
|
|
menus_init_mru ();
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
|
|
|
|
translated_entries=translate_entries(&file_menu_separator,1);
|
|
|
|
gtk_item_factory_create_item (toolbox_factory, translated_entries, NULL, 2);
|
|
|
|
free_translated_entries(translated_entries, 1);
|
|
|
|
|
|
|
|
translated_entries=translate_entries(&toolbox_end,1);
|
|
|
|
gtk_item_factory_create_item (toolbox_factory, translated_entries, NULL, 2);
|
|
|
|
free_translated_entries(translated_entries, 1);
|
1998-07-12 13:18:17 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-08-06 07:46:04 +08:00
|
|
|
static GtkItemFactoryEntry *
|
|
|
|
translate_entries (GtkItemFactoryEntry *entries, gint n)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
GtkItemFactoryEntry *ret;
|
|
|
|
|
|
|
|
ret=g_malloc( sizeof(GtkItemFactoryEntry) * n );
|
|
|
|
for (i=0; i<n; i++) {
|
|
|
|
/* Translation. Note the explicit use of gettext(). */
|
|
|
|
ret[i].path=g_strdup( gettext(entries[i].path) );
|
|
|
|
/* accelerator and item_type are not duped, only referenced */
|
|
|
|
ret[i].accelerator=entries[i].accelerator;
|
|
|
|
ret[i].callback=entries[i].callback;
|
|
|
|
ret[i].callback_action=entries[i].callback_action;
|
|
|
|
ret[i].item_type=entries[i].item_type;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
free_translated_entries(GtkItemFactoryEntry *entries, gint n)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i=0; i<n; i++)
|
|
|
|
g_free(entries[i].path);
|
|
|
|
g_free(entries);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
|
|
|
menus_init ()
|
|
|
|
{
|
1998-06-22 04:17:21 +08:00
|
|
|
int i;
|
1998-08-06 07:46:04 +08:00
|
|
|
GtkItemFactoryEntry *translated_entries;
|
1998-06-22 04:17:21 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (initialize)
|
|
|
|
{
|
1998-06-07 21:55:36 +08:00
|
|
|
gchar *filename;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
initialize = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-07-12 13:18:17 +08:00
|
|
|
menus_init_toolbox ();
|
|
|
|
|
1998-06-07 21:55:36 +08:00
|
|
|
image_factory = gtk_item_factory_new (GTK_TYPE_MENU, "<Image>", NULL);
|
1998-08-06 07:46:04 +08:00
|
|
|
translated_entries=translate_entries(image_entries, n_image_entries);
|
1998-06-07 21:55:36 +08:00
|
|
|
gtk_item_factory_create_items_ac (image_factory,
|
|
|
|
n_image_entries,
|
1998-08-06 07:46:04 +08:00
|
|
|
translated_entries,
|
1998-06-07 21:55:36 +08:00
|
|
|
NULL, 2);
|
1998-08-06 07:46:04 +08:00
|
|
|
free_translated_entries(translated_entries, n_image_entries);
|
1998-06-07 21:55:36 +08:00
|
|
|
load_factory = gtk_item_factory_new (GTK_TYPE_MENU, "<Load>", NULL);
|
1998-08-06 07:46:04 +08:00
|
|
|
translated_entries=translate_entries(load_entries, n_load_entries);
|
1998-06-07 21:55:36 +08:00
|
|
|
gtk_item_factory_create_items_ac (load_factory,
|
|
|
|
n_load_entries,
|
1998-08-06 07:46:04 +08:00
|
|
|
translated_entries,
|
1998-06-07 21:55:36 +08:00
|
|
|
NULL, 2);
|
1998-08-06 07:46:04 +08:00
|
|
|
free_translated_entries(translated_entries, n_load_entries);
|
1998-06-07 21:55:36 +08:00
|
|
|
save_factory = gtk_item_factory_new (GTK_TYPE_MENU, "<Save>", NULL);
|
1998-08-06 07:46:04 +08:00
|
|
|
translated_entries=translate_entries(load_entries, n_save_entries);
|
1998-06-07 21:55:36 +08:00
|
|
|
gtk_item_factory_create_items_ac (save_factory,
|
|
|
|
n_save_entries,
|
1998-08-06 07:46:04 +08:00
|
|
|
translated_entries,
|
1998-06-07 21:55:36 +08:00
|
|
|
NULL, 2);
|
1998-08-06 07:46:04 +08:00
|
|
|
free_translated_entries(translated_entries, n_save_entries);
|
1998-06-22 04:17:21 +08:00
|
|
|
for (i = 0; i < num_tools; i++)
|
|
|
|
{
|
|
|
|
/* FIXME this need to use access functions to check a flag */
|
|
|
|
if (tool_info[i].menu_path)
|
|
|
|
menus_tools_create (tool_info+i);
|
|
|
|
}
|
1998-06-07 21:55:36 +08:00
|
|
|
filename = g_strconcat (gimp_directory (), "/menurc", NULL);
|
|
|
|
gtk_item_factory_parse_rc (filename);
|
|
|
|
g_free (filename);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|