~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/actions/layers-actions.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
42
42
#include "gimp-intl.h"
43
43
 
44
44
 
45
 
static GimpActionEntry layers_actions[] =
 
45
static const GimpActionEntry layers_actions[] =
46
46
{
47
47
  { "layers-popup", GIMP_STOCK_LAYERS,
48
48
    N_("Layers Menu"), NULL, NULL, NULL,
49
49
    GIMP_HELP_LAYER_DIALOG },
50
50
 
51
 
  { "layers-menu",              NULL,                    N_("_Layer")        },
52
 
  { "layers-stack-menu",        NULL,                    N_("Stac_k")        },
53
 
  { "layers-colors-menu",       NULL,                    N_("_Colors")       },
54
 
  { "layers-colors-auto-menu",  NULL,                    N_("_Auto")         },
55
 
  { "layers-mask-menu",         NULL,                    N_("_Mask")         },
56
 
  { "layers-transparency-menu", NULL,                    N_("Tr_ansparency") },
57
 
  { "layers-transform-menu",    NULL,                    N_("_Transform")    },
58
 
  { "layers-properties-menu",   NULL,                    N_("_Properties")   },
59
 
  { "layers-opacity-menu",      GIMP_STOCK_TRANSPARENCY, N_("_Opacity")      },
60
 
  { "layers-mode-menu",         GIMP_STOCK_TOOL_PENCIL,  N_("Layer _Mode")   },
 
51
  { "layers-menu",              NULL,                      N_("_Layer")        },
 
52
  { "layers-stack-menu",        NULL,                      N_("Stac_k")        },
 
53
  { "layers-text-to-selection-menu", GIMP_STOCK_TOOL_TEXT, N_("Te_xt to Selection") },
 
54
  { "layers-mask-menu",         NULL,                      N_("_Mask")         },
 
55
  { "layers-transparency-menu", NULL,                      N_("Tr_ansparency") },
 
56
  { "layers-transform-menu",    NULL,                      N_("_Transform")    },
 
57
  { "layers-properties-menu",   GTK_STOCK_PROPERTIES,      N_("_Properties")   },
 
58
  { "layers-opacity-menu",      GIMP_STOCK_TRANSPARENCY,   N_("_Opacity")      },
 
59
  { "layers-mode-menu",         GIMP_STOCK_TOOL_PENCIL,    N_("Layer _Mode")   },
61
60
 
62
61
  { "layers-text-tool", GIMP_STOCK_TOOL_TEXT,
63
 
    N_("Te_xt Tool"), NULL, NULL,
 
62
    N_("Te_xt Tool"), NULL,
 
63
    N_("Activate the text tool on this text layer"),
64
64
    G_CALLBACK (layers_text_tool_cmd_callback),
65
65
    GIMP_HELP_TOOL_TEXT },
66
66
 
67
 
  { "layers-edit-attributes", GIMP_STOCK_EDIT,
 
67
  { "layers-edit-attributes", GTK_STOCK_EDIT,
68
68
    N_("_Edit Layer Attributes..."), NULL,
69
 
    N_("Edit layer attributes"),
 
69
    N_("Edit the layer's name"),
70
70
    G_CALLBACK (layers_edit_attributes_cmd_callback),
71
71
    GIMP_HELP_LAYER_EDIT },
72
72
 
73
73
  { "layers-new", GTK_STOCK_NEW,
74
 
    N_("_New Layer..."), "",
75
 
    N_("New layer..."),
 
74
    N_("_New Layer..."), "<control><shift>N",
 
75
    N_("Create a new layer and add it to the image"),
76
76
    G_CALLBACK (layers_new_cmd_callback),
77
77
    GIMP_HELP_LAYER_NEW },
78
78
 
79
79
  { "layers-new-last-values", GTK_STOCK_NEW,
80
80
    N_("_New Layer"), "",
81
 
    N_("New layer with last values"),
 
81
    N_("Create a new layer with last used values"),
82
82
    G_CALLBACK (layers_new_last_vals_cmd_callback),
83
83
    GIMP_HELP_LAYER_NEW },
84
84
 
85
85
  { "layers-duplicate", GIMP_STOCK_DUPLICATE,
86
 
    N_("D_uplicate Layer"), NULL,
87
 
    N_("Duplicate layer"),
 
86
    N_("D_uplicate Layer"), "<control><shift>D",
 
87
    N_("Create a duplicate of the layer and add it to the image"),
88
88
    G_CALLBACK (layers_duplicate_cmd_callback),
89
89
    GIMP_HELP_LAYER_DUPLICATE },
90
90
 
91
91
  { "layers-delete", GTK_STOCK_DELETE,
92
92
    N_("_Delete Layer"), "",
93
 
    N_("Delete layer"),
 
93
    N_("Delete this layer"),
94
94
    G_CALLBACK (layers_delete_cmd_callback),
95
95
    GIMP_HELP_LAYER_DELETE },
96
96
 
97
97
  { "layers-raise", GTK_STOCK_GO_UP,
98
98
    N_("_Raise Layer"), "",
99
 
    N_("Raise layer"),
 
99
    N_("Raise this layer one step in the layer stack"),
100
100
    G_CALLBACK (layers_raise_cmd_callback),
101
101
    GIMP_HELP_LAYER_RAISE },
102
102
 
103
103
  { "layers-raise-to-top", GTK_STOCK_GOTO_TOP,
104
104
    N_("Layer to _Top"), "",
105
 
    N_("Raise layer to top"),
 
105
    N_("Move this layer to the top of the layer stack"),
106
106
    G_CALLBACK (layers_raise_to_top_cmd_callback),
107
107
    GIMP_HELP_LAYER_RAISE_TO_TOP },
108
108
 
109
109
  { "layers-lower", GTK_STOCK_GO_DOWN,
110
110
    N_("_Lower Layer"), "",
111
 
    N_("Lower layer"),
 
111
    N_("Lower this layer one step in the layer stack"),
112
112
    G_CALLBACK (layers_lower_cmd_callback),
113
113
    GIMP_HELP_LAYER_LOWER },
114
114
 
115
115
  { "layers-lower-to-bottom", GTK_STOCK_GOTO_BOTTOM,
116
116
    N_("Layer to _Bottom"), "",
117
 
    N_("Lower layer to bottom"),
 
117
    N_("Move this layer to the bottom of the layer stack"),
118
118
    G_CALLBACK (layers_lower_to_bottom_cmd_callback),
119
119
    GIMP_HELP_LAYER_LOWER_TO_BOTTOM },
120
120
 
121
121
  { "layers-anchor", GIMP_STOCK_ANCHOR,
122
122
    N_("_Anchor Layer"), "<control>H",
123
 
    N_("Anchor floating layer"),
 
123
    N_("Anchor the floating layer"),
124
124
    G_CALLBACK (layers_anchor_cmd_callback),
125
125
    GIMP_HELP_LAYER_ANCHOR },
126
126
 
127
127
  { "layers-merge-down", GIMP_STOCK_MERGE_DOWN,
128
 
    N_("Merge Do_wn"), NULL, NULL,
 
128
    N_("Merge Do_wn"), NULL,
 
129
    N_("Merge this layer with the one below it"),
129
130
    G_CALLBACK (layers_merge_down_cmd_callback),
130
131
    GIMP_HELP_LAYER_MERGE_DOWN },
131
132
 
132
133
  { "layers-merge-layers", NULL,
133
 
    N_("Merge _Visible Layers..."), NULL, NULL,
 
134
    N_("Merge _Visible Layers..."), NULL,
 
135
    N_("Merge all visible layers into one layer"),
134
136
    G_CALLBACK (image_merge_layers_cmd_callback),
135
137
    GIMP_HELP_IMAGE_MERGE_LAYERS },
136
138
 
137
139
  { "layers-flatten-image", NULL,
138
 
    N_("_Flatten Image"), NULL, NULL,
 
140
    N_("_Flatten Image"), NULL,
 
141
    N_("Merge all layers into one and remove transparency"),
139
142
    G_CALLBACK (image_flatten_image_cmd_callback),
140
143
    GIMP_HELP_IMAGE_FLATTEN },
141
144
 
142
145
  { "layers-text-discard", GIMP_STOCK_TOOL_TEXT,
143
 
    N_("_Discard Text Information"), NULL, NULL,
 
146
    N_("_Discard Text Information"), NULL,
 
147
    N_("Turn this text layer into a normal layer"),
144
148
    G_CALLBACK (layers_text_discard_cmd_callback),
145
149
    GIMP_HELP_LAYER_TEXT_DISCARD },
146
150
 
 
151
  { "layers-text-to-vectors", GIMP_STOCK_TOOL_TEXT,
 
152
    N_("Text to _Path"), NULL,
 
153
    N_("Create a path from this text layer"),
 
154
    G_CALLBACK (layers_text_to_vectors_cmd_callback),
 
155
    GIMP_HELP_LAYER_TEXT_TO_PATH },
 
156
 
 
157
  { "layers-text-along-vectors", GIMP_STOCK_TOOL_TEXT,
 
158
    N_("Text alon_g Path"), NULL,
 
159
    N_("Warp this layer's text along the current path"),
 
160
    G_CALLBACK (layers_text_along_vectors_cmd_callback),
 
161
    GIMP_HELP_LAYER_TEXT_ALONG_PATH },
 
162
 
147
163
  { "layers-resize", GIMP_STOCK_RESIZE,
148
 
    N_("Layer B_oundary Size..."), NULL, NULL,
 
164
    N_("Layer B_oundary Size..."), NULL,
 
165
    N_("Adjust the layer dimensions"),
149
166
    G_CALLBACK (layers_resize_cmd_callback),
150
167
    GIMP_HELP_LAYER_RESIZE },
151
168
 
152
169
  { "layers-resize-to-image", GIMP_STOCK_LAYER_TO_IMAGESIZE,
153
 
    N_("Layer to _Image Size"), NULL, NULL,
 
170
    N_("Layer to _Image Size"), NULL,
 
171
    N_("Resize the layer to the size of the image"),
154
172
    G_CALLBACK (layers_resize_to_image_cmd_callback),
155
173
    GIMP_HELP_LAYER_RESIZE_TO_IMAGE },
156
174
 
157
175
  { "layers-scale", GIMP_STOCK_SCALE,
158
 
    N_("_Scale Layer..."), NULL, NULL,
 
176
    N_("_Scale Layer..."), NULL,
 
177
    N_("Change the size of the layer content"),
159
178
    G_CALLBACK (layers_scale_cmd_callback),
160
179
    GIMP_HELP_LAYER_SCALE },
161
180
 
162
181
  { "layers-crop", GIMP_STOCK_TOOL_CROP,
163
 
    N_("Cr_op Layer"), NULL, NULL,
 
182
    N_("_Crop Layer"), NULL,
 
183
    N_("Crop the layer to the extents of the selection"),
164
184
    G_CALLBACK (layers_crop_cmd_callback),
165
185
    GIMP_HELP_LAYER_CROP },
166
186
 
167
187
  { "layers-mask-add", GIMP_STOCK_LAYER_MASK,
168
 
    N_("Add La_yer Mask..."), NULL, NULL,
 
188
    N_("Add La_yer Mask..."), NULL,
 
189
    N_("Add a mask that allows non-destructive editing of transparency"),
169
190
    G_CALLBACK (layers_mask_add_cmd_callback),
170
191
    GIMP_HELP_LAYER_MASK_ADD },
171
192
 
172
193
  { "layers-alpha-add", GIMP_STOCK_TRANSPARENCY,
173
 
    N_("Add Alpha C_hannel"), NULL, NULL,
 
194
    N_("Add Alpha C_hannel"), NULL,
 
195
    N_("Add transparency information to the layer"),
174
196
    G_CALLBACK (layers_alpha_add_cmd_callback),
175
 
    GIMP_HELP_LAYER_ALPHA_ADD }
 
197
    GIMP_HELP_LAYER_ALPHA_ADD },
 
198
 
 
199
  { "layers-alpha-remove", NULL,
 
200
    N_("_Remove Alpha Channel"), NULL,
 
201
    N_("Remove transparency information from the layer"),
 
202
    G_CALLBACK (layers_alpha_remove_cmd_callback),
 
203
    GIMP_HELP_LAYER_ALPHA_REMOVE }
176
204
};
177
205
 
178
 
static GimpToggleActionEntry layers_toggle_actions[] =
 
206
static const GimpToggleActionEntry layers_toggle_actions[] =
179
207
{
180
 
  { "layers-preserve-transparency", GIMP_STOCK_TRANSPARENCY,
181
 
    N_("Keep Transparency"), NULL, NULL,
182
 
    G_CALLBACK (layers_preserve_trans_cmd_callback),
 
208
  { "layers-lock-alpha", GIMP_STOCK_TRANSPARENCY,
 
209
    N_("Lock Alph_a Channel"), NULL,
 
210
    N_("Keep transparency information on this layer from being modified"),
 
211
    G_CALLBACK (layers_lock_alpha_cmd_callback),
183
212
    FALSE,
184
 
    GIMP_HELP_LAYER_KEEP_TRANSPARENCY },
 
213
    GIMP_HELP_LAYER_LOCK_ALPHA },
185
214
 
186
 
  { "layers-mask-edit", GIMP_STOCK_EDIT,
187
 
    N_("Edit Layer Mask"), NULL, NULL,
 
215
  { "layers-mask-edit", GTK_STOCK_EDIT,
 
216
    N_("_Edit Layer Mask"), NULL,
 
217
    N_("Work on the layer mask"),
188
218
    G_CALLBACK (layers_mask_edit_cmd_callback),
189
219
    FALSE,
190
220
    GIMP_HELP_LAYER_MASK_EDIT },
191
221
 
192
222
  { "layers-mask-show", GIMP_STOCK_VISIBLE,
193
 
    N_("Show Layer Mask"), NULL, NULL,
 
223
    N_("S_how Layer Mask"), NULL, NULL,
194
224
    G_CALLBACK (layers_mask_show_cmd_callback),
195
225
    FALSE,
196
226
    GIMP_HELP_LAYER_MASK_SHOW },
197
227
 
198
228
  { "layers-mask-disable", NULL,
199
 
    N_("Disable Layer Mask"), NULL, NULL,
 
229
    N_("_Disable Layer Mask"), NULL,
 
230
    N_("Dismiss the effect of the layer mask"),
200
231
    G_CALLBACK (layers_mask_disable_cmd_callback),
201
232
    FALSE,
202
233
    GIMP_HELP_LAYER_MASK_DISABLE }
203
234
};
204
235
 
205
 
static GimpEnumActionEntry layers_mask_apply_actions[] =
 
236
static const GimpEnumActionEntry layers_mask_apply_actions[] =
206
237
{
207
238
  { "layers-mask-apply", NULL,
208
 
    N_("Apply Layer _Mask"), NULL, NULL,
 
239
    N_("Apply Layer _Mask"), NULL,
 
240
    N_("Apply the effect of the layer mask and remove it"),
209
241
    GIMP_MASK_APPLY, FALSE,
210
242
    GIMP_HELP_LAYER_MASK_APPLY },
211
243
 
212
244
  { "layers-mask-delete", GTK_STOCK_DELETE,
213
 
    N_("Delete Layer Mas_k"), "", NULL,
 
245
    N_("Delete Layer Mas_k"), "",
 
246
    N_("Remove the layer mask and its effect"),
214
247
    GIMP_MASK_DISCARD, FALSE,
215
248
    GIMP_HELP_LAYER_MASK_DELETE }
216
249
};
217
250
 
218
 
static GimpEnumActionEntry layers_mask_to_selection_actions[] =
 
251
static const GimpEnumActionEntry layers_mask_to_selection_actions[] =
219
252
{
220
253
  { "layers-mask-selection-replace", GIMP_STOCK_SELECTION_REPLACE,
221
 
    N_("_Mask to Selection"), NULL, NULL,
 
254
    N_("_Mask to Selection"), NULL,
 
255
    N_("Replace the selection with the layer mask"),
222
256
    GIMP_CHANNEL_OP_REPLACE, FALSE,
223
257
    GIMP_HELP_LAYER_MASK_SELECTION_REPLACE },
224
258
 
225
259
  { "layers-mask-selection-add", GIMP_STOCK_SELECTION_ADD,
226
 
    N_("_Add to Selection"), NULL, NULL,
 
260
    N_("_Add to Selection"), NULL,
 
261
    N_("Add the layer mask to the current selection"),
227
262
    GIMP_CHANNEL_OP_ADD, FALSE,
228
263
    GIMP_HELP_LAYER_MASK_SELECTION_ADD },
229
264
 
230
265
  { "layers-mask-selection-subtract", GIMP_STOCK_SELECTION_SUBTRACT,
231
 
    N_("_Subtract from Selection"), NULL, NULL,
 
266
    N_("_Subtract from Selection"), NULL,
 
267
    N_("Subtract the layer mask from the current selection"),
232
268
    GIMP_CHANNEL_OP_SUBTRACT, FALSE,
233
269
    GIMP_HELP_LAYER_MASK_SELECTION_SUBTRACT },
234
270
 
235
271
  { "layers-mask-selection-intersect", GIMP_STOCK_SELECTION_INTERSECT,
236
 
    N_("_Intersect with Selection"), NULL, NULL,
 
272
    N_("_Intersect with Selection"), NULL,
 
273
    N_("Intersect the layer mask with the current selection"),
237
274
    GIMP_CHANNEL_OP_INTERSECT, FALSE,
238
275
    GIMP_HELP_LAYER_MASK_SELECTION_INTERSECT }
239
276
};
240
277
 
241
 
static GimpEnumActionEntry layers_alpha_to_selection_actions[] =
 
278
static const GimpEnumActionEntry layers_alpha_to_selection_actions[] =
242
279
{
243
280
  { "layers-alpha-selection-replace", GIMP_STOCK_SELECTION_REPLACE,
244
 
    N_("Al_pha to Selection"), NULL, NULL,
 
281
    N_("Al_pha to Selection"), NULL,
 
282
    N_("Replace the selection with the layer's alpha channel"),
245
283
    GIMP_CHANNEL_OP_REPLACE, FALSE,
246
284
    GIMP_HELP_LAYER_ALPHA_SELECTION_REPLACE },
247
285
 
248
286
  { "layers-alpha-selection-add", GIMP_STOCK_SELECTION_ADD,
249
 
    N_("A_dd to Selection"), NULL, NULL,
 
287
    N_("A_dd to Selection"), NULL,
 
288
    N_("Add the layer's alpha channel to the current selection"),
250
289
    GIMP_CHANNEL_OP_ADD, FALSE,
251
290
    GIMP_HELP_LAYER_ALPHA_SELECTION_ADD },
252
291
 
253
292
  { "layers-alpha-selection-subtract", GIMP_STOCK_SELECTION_SUBTRACT,
254
 
    N_("_Subtract from Selection"), NULL, NULL,
 
293
    N_("_Subtract from Selection"), NULL,
 
294
    N_("Subtract the layer's alpha channel from the current selection"),
255
295
    GIMP_CHANNEL_OP_SUBTRACT, FALSE,
256
296
    GIMP_HELP_LAYER_ALPHA_SELECTION_SUBTRACT },
257
297
 
258
298
  { "layers-alpha-selection-intersect", GIMP_STOCK_SELECTION_INTERSECT,
259
 
    N_("_Intersect with Selection"), NULL, NULL,
 
299
    N_("_Intersect with Selection"), NULL,
 
300
    N_("Intersect the layer's alpha channel with the current selection"),
260
301
    GIMP_CHANNEL_OP_INTERSECT, FALSE,
261
302
    GIMP_HELP_LAYER_ALPHA_SELECTION_INTERSECT }
262
303
};
263
304
 
264
 
static GimpEnumActionEntry layers_select_actions[] =
 
305
static const GimpEnumActionEntry layers_text_to_selection_actions[] =
 
306
{
 
307
  { "layers-text-selection-replace", GIMP_STOCK_SELECTION_REPLACE,
 
308
    N_("_Text to Selection"), NULL,
 
309
    N_("Replace the selection with the text layer's outline"),
 
310
    GIMP_CHANNEL_OP_REPLACE, FALSE,
 
311
    GIMP_HELP_LAYER_TEXT_SELECTION_REPLACE },
 
312
 
 
313
  { "layers-text-selection-add", GIMP_STOCK_SELECTION_ADD,
 
314
    N_("A_dd to Selection"), NULL,
 
315
    N_("Add the text layer's outline to the current selection"),
 
316
    GIMP_CHANNEL_OP_ADD, FALSE,
 
317
    GIMP_HELP_LAYER_TEXT_SELECTION_ADD },
 
318
 
 
319
  { "layers-text-selection-subtract", GIMP_STOCK_SELECTION_SUBTRACT,
 
320
    N_("_Subtract from Selection"), NULL,
 
321
    N_("Subtract the text layer's outline from the current selection"),
 
322
    GIMP_CHANNEL_OP_SUBTRACT, FALSE,
 
323
    GIMP_HELP_LAYER_TEXT_SELECTION_SUBTRACT },
 
324
 
 
325
  { "layers-text-selection-intersect", GIMP_STOCK_SELECTION_INTERSECT,
 
326
    N_("_Intersect with Selection"), NULL,
 
327
    N_("Intersect the text layer's outline with the current selection"),
 
328
    GIMP_CHANNEL_OP_INTERSECT, FALSE,
 
329
    GIMP_HELP_LAYER_TEXT_SELECTION_INTERSECT }
 
330
};
 
331
 
 
332
static const GimpEnumActionEntry layers_select_actions[] =
265
333
{
266
334
  { "layers-select-top", NULL,
267
 
    N_("Select _Top Layer"), "Home", NULL,
 
335
    N_("Select _Top Layer"), "Home",
 
336
    N_("Select the topmost layer"),
268
337
    GIMP_ACTION_SELECT_FIRST, FALSE,
269
338
    GIMP_HELP_LAYER_TOP },
270
339
 
271
340
  { "layers-select-bottom", NULL,
272
 
    N_("Select _Bottom Layer"), "End", NULL,
 
341
    N_("Select _Bottom Layer"), "End",
 
342
    N_("Select the bottommost layer"),
273
343
    GIMP_ACTION_SELECT_LAST, FALSE,
274
344
    GIMP_HELP_LAYER_BOTTOM },
275
345
 
276
346
  { "layers-select-previous", NULL,
277
 
    N_("Select _Previous Layer"), "Prior", NULL,
 
347
    N_("Select _Previous Layer"), "Prior",
 
348
    N_("Select the layer above the current layer"),
278
349
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
279
350
    GIMP_HELP_LAYER_PREVIOUS },
280
351
 
281
352
  { "layers-select-next", NULL,
282
 
    N_("Select _Next Layer"), "Next", NULL,
 
353
    N_("Select _Next Layer"), "Next",
 
354
    N_("Select the layer below the current layer"),
283
355
    GIMP_ACTION_SELECT_NEXT, FALSE,
284
356
    GIMP_HELP_LAYER_NEXT }
285
357
};
286
358
 
287
 
static GimpEnumActionEntry layers_opacity_actions[] =
 
359
static const GimpEnumActionEntry layers_opacity_actions[] =
288
360
{
289
361
  { "layers-opacity-set", GIMP_STOCK_TRANSPARENCY,
290
362
    N_("Set Opacity"), NULL, NULL,
316
388
    GIMP_HELP_LAYER_OPACITY }
317
389
};
318
390
 
319
 
static GimpEnumActionEntry layers_mode_actions[] =
 
391
static const GimpEnumActionEntry layers_mode_actions[] =
320
392
{
321
393
  { "layers-mode-first", GIMP_STOCK_TOOL_PENCIL,
322
394
    "First Layer Mode", NULL, NULL,
364
436
                                      G_CALLBACK (layers_alpha_to_selection_cmd_callback));
365
437
 
366
438
  gimp_action_group_add_enum_actions (group,
 
439
                                      layers_text_to_selection_actions,
 
440
                                      G_N_ELEMENTS (layers_alpha_to_selection_actions),
 
441
                                      G_CALLBACK (layers_alpha_to_selection_cmd_callback));
 
442
 
 
443
  gimp_action_group_add_enum_actions (group,
367
444
                                      layers_select_actions,
368
445
                                      G_N_ELEMENTS (layers_select_actions),
369
446
                                      G_CALLBACK (layers_select_cmd_callback));
383
460
layers_actions_update (GimpActionGroup *group,
384
461
                       gpointer         data)
385
462
{
386
 
  GimpImage     *gimage     = action_data_get_image (data);
 
463
  GimpImage     *image     = action_data_get_image (data);
387
464
  GimpLayer     *layer      = NULL;
388
465
  GimpLayerMask *mask       = NULL;     /*  layer mask             */
389
466
  gboolean       fs         = FALSE;    /*  floating sel           */
391
468
  gboolean       sel        = FALSE;
392
469
  gboolean       alpha      = FALSE;    /*  alpha channel present  */
393
470
  gboolean       indexed    = FALSE;    /*  is indexed             */
394
 
  gboolean       preserve   = FALSE;
395
 
  gboolean       next_alpha = FALSE;
 
471
  gboolean       lock_alpha = FALSE;
396
472
  gboolean       text_layer = FALSE;
397
473
  GList         *next       = NULL;
398
474
  GList         *prev       = NULL;
399
475
 
400
 
  if (gimage)
 
476
  if (image)
401
477
    {
402
 
      fs      = (gimp_image_floating_sel (gimage) != NULL);
403
 
      ac      = (gimp_image_get_active_channel (gimage) != NULL);
404
 
      sel     = ! gimp_channel_is_empty (gimp_image_get_mask (gimage));
405
 
      indexed = (gimp_image_base_type (gimage) == GIMP_INDEXED);
 
478
      fs      = (gimp_image_floating_sel (image) != NULL);
 
479
      ac      = (gimp_image_get_active_channel (image) != NULL);
 
480
      sel     = ! gimp_channel_is_empty (gimp_image_get_mask (image));
 
481
      indexed = (gimp_image_base_type (image) == GIMP_INDEXED);
406
482
 
407
 
      layer = gimp_image_get_active_layer (gimage);
 
483
      layer = gimp_image_get_active_layer (image);
408
484
 
409
485
      if (layer)
410
486
        {
411
487
          GList *list;
412
488
 
413
 
          mask     = gimp_layer_get_mask (layer);
414
 
          preserve = gimp_layer_get_preserve_trans (layer);
415
 
          alpha    = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
 
489
          mask       = gimp_layer_get_mask (layer);
 
490
          lock_alpha = gimp_layer_get_lock_alpha (layer);
 
491
          alpha      = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
416
492
 
417
 
          list = g_list_find (GIMP_LIST (gimage->layers)->list, layer);
 
493
          list = g_list_find (GIMP_LIST (image->layers)->list, layer);
418
494
 
419
495
          if (list)
420
496
            {
422
498
              next = g_list_next (list);
423
499
            }
424
500
 
425
 
          if (next)
426
 
            next_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (next->data));
427
 
 
428
501
          if (layer)
429
502
            text_layer = gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer));
430
503
        }
440
513
  SET_VISIBLE   ("layers-text-tool",       text_layer && !ac);
441
514
  SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac);
442
515
 
443
 
  SET_SENSITIVE ("layers-new",             gimage);
444
 
  SET_SENSITIVE ("layers-new-last-values", gimage);
 
516
  SET_SENSITIVE ("layers-new",             image);
 
517
  SET_SENSITIVE ("layers-new-last-values", image);
445
518
  SET_SENSITIVE ("layers-duplicate",       layer && !fs && !ac);
446
519
  SET_SENSITIVE ("layers-delete",          layer && !ac);
447
520
 
450
523
  SET_SENSITIVE ("layers-select-previous", layer && !fs && !ac && prev);
451
524
  SET_SENSITIVE ("layers-select-next",     layer && !fs && !ac && next);
452
525
 
453
 
  SET_SENSITIVE ("layers-raise",           layer && !fs && !ac && alpha && prev);
454
 
  SET_SENSITIVE ("layers-raise-to-top",    layer && !fs && !ac && alpha && prev);
455
 
  SET_SENSITIVE ("layers-lower",           layer && !fs && !ac && next && next_alpha);
456
 
  SET_SENSITIVE ("layers-lower-to-bottom", layer && !fs && !ac && next && next_alpha);
457
 
 
458
 
  SET_SENSITIVE ("layers-anchor",        layer &&  fs && !ac);
459
 
  SET_SENSITIVE ("layers-merge-down",    layer && !fs && !ac && next);
460
 
  SET_SENSITIVE ("layers-merge-layers",  layer && !fs && !ac);
461
 
  SET_SENSITIVE ("layers-flatten-image", layer && !fs && !ac);
462
 
  SET_VISIBLE   ("layers-text-discard",  text_layer && !ac);
 
526
  SET_SENSITIVE ("layers-raise",           layer && !fs && !ac && prev);
 
527
  SET_SENSITIVE ("layers-raise-to-top",    layer && !fs && !ac && prev);
 
528
  SET_SENSITIVE ("layers-lower",           layer && !fs && !ac && next);
 
529
  SET_SENSITIVE ("layers-lower-to-bottom", layer && !fs && !ac && next);
 
530
 
 
531
  SET_SENSITIVE ("layers-anchor",          layer &&  fs && !ac);
 
532
  SET_SENSITIVE ("layers-merge-down",      layer && !fs && !ac && next);
 
533
  SET_SENSITIVE ("layers-merge-layers",    layer && !fs && !ac);
 
534
  SET_SENSITIVE ("layers-flatten-image",   layer && !fs && !ac);
 
535
 
 
536
  SET_VISIBLE   ("layers-text-discard",             text_layer && !ac);
 
537
  SET_VISIBLE   ("layers-text-to-vectors",          text_layer && !ac);
 
538
  SET_VISIBLE   ("layers-text-along-vectors",       text_layer && !ac);
 
539
  SET_VISIBLE   ("layers-text-selection-replace",   text_layer && !ac);
 
540
  SET_VISIBLE   ("layers-text-selection-add",       text_layer && !ac);
 
541
  SET_VISIBLE   ("layers-text-selection-subtract",  text_layer && !ac);
 
542
  SET_VISIBLE   ("layers-text-selection-intersect", text_layer && !ac);
463
543
 
464
544
  SET_SENSITIVE ("layers-resize",          layer && !ac);
465
545
  SET_SENSITIVE ("layers-resize-to-image", layer && !ac);
467
547
 
468
548
  SET_SENSITIVE ("layers-crop",            layer && sel);
469
549
 
470
 
  SET_SENSITIVE ("layers-alpha-add", layer && !fs && !alpha);
 
550
  SET_SENSITIVE ("layers-alpha-add",       layer && !fs && !alpha);
 
551
  SET_SENSITIVE ("layers-alpha-remove",    layer && !fs &&  alpha);
471
552
 
472
 
  SET_SENSITIVE ("layers-preserve-transparency", layer);
473
 
  SET_ACTIVE    ("layers-preserve-transparency", preserve);
 
553
  SET_SENSITIVE ("layers-lock-alpha", layer);
 
554
  SET_ACTIVE    ("layers-lock-alpha", lock_alpha);
474
555
 
475
556
  SET_SENSITIVE ("layers-mask-add",    layer && !fs && !ac && !mask);
476
557
  SET_SENSITIVE ("layers-mask-apply",  layer && !fs && !ac &&  mask);