55
55
N_("Image Menu"), NULL, NULL, NULL,
56
56
GIMP_HELP_IMAGE_WINDOW },
58
{ "extensions-menu", NULL, N_("_Xtns") },
59
{ "image-menu", NULL, N_("_Image") },
60
{ "image-mode-menu", NULL, N_("_Mode") },
61
{ "image-transform-menu", NULL, N_("_Transform") },
62
{ "image-guides-menu", NULL, N_("_Guides") },
58
{ "extensions-menu", NULL, N_("_Xtns") },
60
{ "image-menu", NULL, N_("_Image") },
61
{ "image-mode-menu", NULL, N_("_Mode") },
62
{ "image-transform-menu", NULL, N_("_Transform") },
63
{ "image-guides-menu", NULL, N_("_Guides") },
65
{ "colors-menu", NULL, N_("_Colors") },
66
{ "colors-info-menu", NULL, N_("I_nfo") },
67
{ "colors-auto-menu", NULL, N_("_Auto") },
68
{ "colors-map-menu", NULL, N_("_Map") },
69
{ "colors-components-menu", NULL, N_("C_omponents") },
64
71
{ "image-new", GTK_STOCK_NEW,
65
N_("_New..."), "<control>N", NULL,
72
N_("_New..."), "<control>N",
73
N_("Create a new image"),
66
74
G_CALLBACK (image_new_cmd_callback),
67
75
GIMP_HELP_FILE_NEW },
69
77
{ "image-new-from-image", GTK_STOCK_NEW,
70
N_("_New..."), NULL, NULL,
79
N_("Create a new image"),
71
80
G_CALLBACK (image_new_from_image_cmd_callback),
72
81
GIMP_HELP_FILE_NEW },
74
83
{ "image-resize", GIMP_STOCK_RESIZE,
75
N_("Can_vas Size..."), NULL, NULL,
84
N_("Can_vas Size..."), NULL,
85
N_("Adjust the image dimensions"),
76
86
G_CALLBACK (image_resize_cmd_callback),
77
87
GIMP_HELP_IMAGE_RESIZE },
79
89
{ "image-resize-to-layers", NULL,
80
N_("F_it Canvas to Layers"), NULL, NULL,
90
N_("F_it Canvas to Layers"), NULL,
91
N_("Resize the image to enclose all layers"),
81
92
G_CALLBACK (image_resize_to_layers_cmd_callback),
82
93
GIMP_HELP_IMAGE_RESIZE_TO_LAYERS },
84
95
{ "image-print-size", GIMP_STOCK_PRINT_RESOLUTION,
85
N_("_Print Size..."), NULL, NULL,
96
N_("_Print Size..."), NULL,
97
N_("Adjust the print resolution"),
86
98
G_CALLBACK (image_print_size_cmd_callback),
87
99
GIMP_HELP_IMAGE_PRINT_SIZE },
89
101
{ "image-scale", GIMP_STOCK_SCALE,
90
N_("_Scale Image..."), NULL, NULL,
102
N_("_Scale Image..."), NULL,
103
N_("Change the size of the image content"),
91
104
G_CALLBACK (image_scale_cmd_callback),
92
105
GIMP_HELP_IMAGE_SCALE },
94
107
{ "image-crop", GIMP_STOCK_TOOL_CROP,
95
N_("_Crop Image"), NULL, NULL,
108
N_("_Crop Image"), NULL,
109
N_("Crop the image to the extents of the selection"),
96
110
G_CALLBACK (image_crop_cmd_callback),
97
111
GIMP_HELP_IMAGE_CROP },
99
113
{ "image-duplicate", GIMP_STOCK_DUPLICATE,
100
N_("_Duplicate"), "<control>D", NULL,
114
N_("_Duplicate"), "<control>D",
115
N_("Create a duplicate of this image"),
101
116
G_CALLBACK (image_duplicate_cmd_callback),
102
117
GIMP_HELP_IMAGE_DUPLICATE },
104
119
{ "image-merge-layers", NULL,
105
N_("Merge Visible _Layers..."), "<control>M", NULL,
120
N_("Merge Visible _Layers..."), "<control>M",
121
N_("Merge all visible layers into one layer"),
106
122
G_CALLBACK (image_merge_layers_cmd_callback),
107
123
GIMP_HELP_IMAGE_MERGE_LAYERS },
109
125
{ "image-flatten", NULL,
110
N_("_Flatten Image"), NULL, NULL,
126
N_("_Flatten Image"), NULL,
127
N_("Merge all layers into one and remove transparency"),
111
128
G_CALLBACK (image_flatten_image_cmd_callback),
112
129
GIMP_HELP_IMAGE_FLATTEN },
114
131
{ "image-configure-grid", GIMP_STOCK_GRID,
115
N_("Configure G_rid..."), NULL, NULL,
132
N_("Configure G_rid..."), NULL,
133
N_("Configure the grid for this image"),
116
134
G_CALLBACK (image_configure_grid_cmd_callback),
117
GIMP_HELP_IMAGE_GRID }
135
GIMP_HELP_IMAGE_GRID },
137
{ "image-properties", GTK_STOCK_INFO,
138
N_("Image Pr_operties"), NULL,
139
N_("Display information about this image"),
140
G_CALLBACK (image_properties_cmd_callback),
141
GIMP_HELP_IMAGE_PROPERTIES }
120
static GimpEnumActionEntry image_convert_actions[] =
144
static const GimpRadioActionEntry image_convert_actions[] =
122
146
{ "image-convert-rgb", GIMP_STOCK_CONVERT_RGB,
123
N_("_RGB"), NULL, NULL,
125
GIMP_HELP_IMAGE_CONVERT_RGB },
148
N_("Convert the image to the RGB colorspace"),
149
GIMP_RGB, GIMP_HELP_IMAGE_CONVERT_RGB },
127
151
{ "image-convert-grayscale", GIMP_STOCK_CONVERT_GRAYSCALE,
128
N_("_Grayscale"), NULL, NULL,
130
GIMP_HELP_IMAGE_CONVERT_GRAYSCALE },
152
N_("_Grayscale"), NULL,
153
N_("Convert the image to grayscale"),
154
GIMP_GRAY, GIMP_HELP_IMAGE_CONVERT_GRAYSCALE },
132
156
{ "image-convert-indexed", GIMP_STOCK_CONVERT_INDEXED,
133
N_("_Indexed..."), NULL, NULL,
135
GIMP_HELP_IMAGE_CONVERT_INDEXED }
157
N_("_Indexed..."), NULL,
158
N_("Convert the image to indexed colors"),
159
GIMP_INDEXED, GIMP_HELP_IMAGE_CONVERT_INDEXED }
138
static GimpEnumActionEntry image_flip_actions[] =
162
static const GimpEnumActionEntry image_flip_actions[] =
140
164
{ "image-flip-horizontal", GIMP_STOCK_FLIP_HORIZONTAL,
141
N_("Flip _Horizontally"), NULL, NULL,
165
N_("Flip _Horizontally"), NULL,
166
N_("Flip image horizontally"),
142
167
GIMP_ORIENTATION_HORIZONTAL, FALSE,
143
168
GIMP_HELP_IMAGE_FLIP_HORIZONTAL },
145
170
{ "image-flip-vertical", GIMP_STOCK_FLIP_VERTICAL,
146
N_("Flip _Vertically"), NULL, NULL,
171
N_("Flip _Vertically"), NULL,
172
N_("Flip image vertically"),
147
173
GIMP_ORIENTATION_VERTICAL, FALSE,
148
174
GIMP_HELP_IMAGE_FLIP_VERTICAL }
151
static GimpEnumActionEntry image_rotate_actions[] =
177
static const GimpEnumActionEntry image_rotate_actions[] =
153
179
{ "image-rotate-90", GIMP_STOCK_ROTATE_90,
154
/* please use the degree symbol in the translation */
155
N_("Rotate 90 degrees _CW"), NULL, NULL,
180
N_("Rotate 90° _clockwise"), NULL,
181
N_("Rotate the image 90 degrees to the right"),
156
182
GIMP_ROTATE_90, FALSE,
157
183
GIMP_HELP_IMAGE_ROTATE_90 },
159
185
{ "image-rotate-180", GIMP_STOCK_ROTATE_180,
160
N_("Rotate _180 degrees"), NULL, NULL,
186
N_("Rotate _180°"), NULL,
187
N_("Turn the image upside-down"),
161
188
GIMP_ROTATE_180, FALSE,
162
189
GIMP_HELP_IMAGE_ROTATE_180 },
164
191
{ "image-rotate-270", GIMP_STOCK_ROTATE_270,
165
N_("Rotate 90 degrees CC_W"), NULL, NULL,
192
N_("Rotate 90° counter-clock_wise"), NULL,
193
N_("Rotate the image 90 degrees to the left"),
166
194
GIMP_ROTATE_270, FALSE,
167
195
GIMP_HELP_IMAGE_ROTATE_270 }
207
230
image_actions_update (GimpActionGroup *group,
210
GimpImage *gimage = action_data_get_image (data);
211
gboolean is_rgb = FALSE;
212
gboolean is_gray = FALSE;
213
gboolean is_indexed = FALSE;
215
gboolean aux = FALSE;
217
gboolean sel = FALSE;
233
GimpImage *image = action_data_get_image (data);
235
gboolean aux = FALSE;
237
gboolean sel = FALSE;
221
GimpImageBaseType base_type;
223
base_type = gimp_image_base_type (gimage);
225
is_rgb = (base_type == GIMP_RGB);
226
is_gray = (base_type == GIMP_GRAY);
227
is_indexed = (base_type == GIMP_INDEXED);
229
fs = (gimp_image_floating_sel (gimage) != NULL);
230
aux = (gimp_image_get_active_channel (gimage) != NULL);
231
lp = ! gimp_image_is_empty (gimage);
232
sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage));
241
const gchar *action = NULL;
243
switch (gimp_image_base_type (image))
246
action = "image-convert-rgb";
250
action = "image-convert-grayscale";
254
action = "image-convert-indexed";
258
gimp_action_group_set_action_active (group, action, TRUE);
260
fs = (gimp_image_floating_sel (image) != NULL);
261
aux = (gimp_image_get_active_channel (image) != NULL);
262
lp = ! gimp_image_is_empty (image);
263
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
235
266
#define SET_SENSITIVE(action,condition) \
236
267
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
238
SET_SENSITIVE ("image-convert-rgb", gimage && ! is_rgb);
239
SET_SENSITIVE ("image-convert-grayscale", gimage && ! is_gray);
240
SET_SENSITIVE ("image-convert-indexed", gimage && ! is_indexed);
242
SET_SENSITIVE ("image-flip-horizontal", gimage);
243
SET_SENSITIVE ("image-flip-vertical", gimage);
244
SET_SENSITIVE ("image-rotate-90", gimage);
245
SET_SENSITIVE ("image-rotate-180", gimage);
246
SET_SENSITIVE ("image-rotate-270", gimage);
248
SET_SENSITIVE ("image-resize", gimage);
249
SET_SENSITIVE ("image-resize-to-layers", gimage);
250
SET_SENSITIVE ("image-print-size", gimage);
251
SET_SENSITIVE ("image-scale", gimage);
252
SET_SENSITIVE ("image-crop", gimage && sel);
253
SET_SENSITIVE ("image-duplicate", gimage);
254
SET_SENSITIVE ("image-merge-layers", gimage && !fs && !aux && lp);
255
SET_SENSITIVE ("image-flatten", gimage && !fs && !aux && lp);
256
SET_SENSITIVE ("image-configure-grid", gimage);
269
SET_SENSITIVE ("image-convert-rgb", image);
270
SET_SENSITIVE ("image-convert-grayscale", image);
271
SET_SENSITIVE ("image-convert-indexed", image);
273
SET_SENSITIVE ("image-flip-horizontal", image);
274
SET_SENSITIVE ("image-flip-vertical", image);
275
SET_SENSITIVE ("image-rotate-90", image);
276
SET_SENSITIVE ("image-rotate-180", image);
277
SET_SENSITIVE ("image-rotate-270", image);
279
SET_SENSITIVE ("image-resize", image);
280
SET_SENSITIVE ("image-resize-to-layers", image);
281
SET_SENSITIVE ("image-print-size", image);
282
SET_SENSITIVE ("image-scale", image);
283
SET_SENSITIVE ("image-crop", image && sel);
284
SET_SENSITIVE ("image-duplicate", image);
285
SET_SENSITIVE ("image-merge-layers", image && !fs && !aux && lp);
286
SET_SENSITIVE ("image-flatten", image && !fs && !aux && lp);
287
SET_SENSITIVE ("image-configure-grid", image);
288
SET_SENSITIVE ("image-properties", image);
258
290
#undef SET_SENSITIVE