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

« back to all changes in this revision

Viewing changes to app/actions/tools-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
41
41
#include "gimp-intl.h"
42
42
 
43
43
 
44
 
static GimpActionEntry tools_actions[] =
 
44
static const GimpActionEntry tools_actions[] =
45
45
{
46
46
  { "tools-popup", GIMP_STOCK_TOOLS,
47
47
    N_("Tools Menu"), NULL, NULL, NULL,
53
53
  { "tools-transform-menu", NULL, N_("_Transform Tools") },
54
54
  { "tools-color-menu",     NULL, N_("_Color Tools")     },
55
55
 
 
56
  { "tools-raise", GTK_STOCK_GO_UP,
 
57
    N_("R_aise Tool"), NULL,
 
58
    N_("Raise tool"),
 
59
    G_CALLBACK (tools_raise_cmd_callback),
 
60
    NULL },
 
61
 
 
62
  { "tools-raise-to-top", GTK_STOCK_GOTO_TOP,
 
63
    N_("Ra_ise to Top"), NULL,
 
64
    N_("Raise tool to top"),
 
65
    G_CALLBACK (tools_raise_to_top_cmd_callback),
 
66
    NULL },
 
67
 
 
68
  { "tools-lower", GTK_STOCK_GO_DOWN,
 
69
    N_("L_ower Tool"), NULL,
 
70
    N_("Lower tool"),
 
71
    G_CALLBACK (tools_lower_cmd_callback),
 
72
    NULL },
 
73
 
 
74
  { "tools-lower-to-bottom", GTK_STOCK_GOTO_BOTTOM,
 
75
    N_("Lo_wer to Bottom"), NULL,
 
76
    N_("Lower tool to bottom"),
 
77
    G_CALLBACK (tools_lower_to_bottom_cmd_callback),
 
78
    NULL },
 
79
 
56
80
  { "tools-reset", GIMP_STOCK_RESET,
57
81
    N_("_Reset Order & Visibility"), NULL,
58
82
    N_("Reset tool order and visibility"),
60
84
    NULL }
61
85
};
62
86
 
63
 
static GimpToggleActionEntry tools_toggle_actions[] =
 
87
static const GimpToggleActionEntry tools_toggle_actions[] =
64
88
{
65
89
  { "tools-visibility", GIMP_STOCK_VISIBLE,
66
90
    N_("_Show in Toolbox"), NULL, NULL,
69
93
    NULL /* FIXME */ }
70
94
};
71
95
 
72
 
static GimpStringActionEntry tools_alternative_actions[] =
 
96
static const GimpStringActionEntry tools_alternative_actions[] =
73
97
{
74
98
  { "tools-by-color-select-short", GIMP_STOCK_TOOL_BY_COLOR_SELECT,
75
 
    N_("_By Color"), NULL, NULL,
 
99
    N_("_By Color"), NULL,
 
100
    N_("Select regions with similar colors"),
76
101
    "gimp-by-color-select-tool",
77
102
    GIMP_HELP_TOOL_BY_COLOR_SELECT },
78
103
 
79
104
  { "tools-rotate-arbitrary", GIMP_STOCK_TOOL_ROTATE,
80
 
    N_("_Arbitrary Rotation..."), NULL, NULL,
81
 
    "gimp-rotate-tool",
 
105
    N_("_Arbitrary Rotation..."), "",
 
106
    N_("Rotate by an arbitrary angle"),
 
107
    "gimp-rotate-layer",
82
108
    GIMP_HELP_TOOL_ROTATE }
83
109
};
84
110
 
 
111
static const GimpEnumActionEntry tools_color_average_radius_actions[] =
 
112
{
 
113
  { "tools-color-average-radius-set", GIMP_STOCK_TOOL_COLOR_PICKER,
 
114
    "Set Color Picker Radius", NULL, NULL,
 
115
    GIMP_ACTION_SELECT_SET, TRUE,
 
116
    NULL },
 
117
  { "tools-color-average-radius-minimum", GIMP_STOCK_TOOL_COLOR_PICKER,
 
118
    "M Color Picker Radius", NULL, NULL,
 
119
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
120
    NULL },
 
121
  { "tools-color-average-radius-maximum", GIMP_STOCK_TOOL_COLOR_PICKER,
 
122
    "Maximum Color Picker Radius", NULL, NULL,
 
123
    GIMP_ACTION_SELECT_LAST, FALSE,
 
124
    NULL },
 
125
  { "tools-color-average-radius-decrease", GIMP_STOCK_TOOL_COLOR_PICKER,
 
126
    "Decrease Color Picker Radius", NULL, NULL,
 
127
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
128
    NULL },
 
129
  { "tools-color-average-radius-increase", GIMP_STOCK_TOOL_COLOR_PICKER,
 
130
    "Increase Color Picker Radius", NULL, NULL,
 
131
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
132
    NULL },
 
133
  { "tools-color-average-radius-decrease-skip",
 
134
    GIMP_STOCK_TOOL_COLOR_PICKER,
 
135
    "Decrease Color Picker Radius More", NULL, NULL,
 
136
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
137
    NULL },
 
138
  { "tools-color-average-radius-increase-skip",
 
139
    GIMP_STOCK_TOOL_COLOR_PICKER,
 
140
    "Increase Color Picker Radius More", NULL, NULL,
 
141
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
142
    NULL },
 
143
};
 
144
 
 
145
static const GimpEnumActionEntry tools_paint_brush_scale_actions[] =
 
146
{
 
147
  { "tools-paint-brush-scale-set", GIMP_STOCK_TOOL_PAINTBRUSH,
 
148
    "Set Brush Scale", NULL, NULL,
 
149
    GIMP_ACTION_SELECT_SET, TRUE,
 
150
    NULL },
 
151
  { "tools-paint-brush-scale-minimum", GIMP_STOCK_TOOL_PAINTBRUSH,
 
152
    "M Brush Scale", NULL, NULL,
 
153
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
154
    NULL },
 
155
  { "tools-paint-brush-scale-maximum", GIMP_STOCK_TOOL_PAINTBRUSH,
 
156
    "Maximum Brush Scale", NULL, NULL,
 
157
    GIMP_ACTION_SELECT_LAST, FALSE,
 
158
    NULL },
 
159
  { "tools-paint-brush-scale-decrease", GIMP_STOCK_TOOL_PAINTBRUSH,
 
160
    "Decrease Brush Scale", NULL, NULL,
 
161
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
162
    NULL },
 
163
  { "tools-paint-brush-scale-increase", GIMP_STOCK_TOOL_PAINTBRUSH,
 
164
    "Increase Brush Scale", NULL, NULL,
 
165
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
166
    NULL },
 
167
  { "tools-paint-brush-scale-decrease-skip", GIMP_STOCK_TOOL_PAINTBRUSH,
 
168
    "Decrease Brush Scale More", NULL, NULL,
 
169
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
170
    NULL },
 
171
  { "tools-paint-brush-scale-increase-skip", GIMP_STOCK_TOOL_PAINTBRUSH,
 
172
    "Increase Brush Scale More", NULL, NULL,
 
173
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
174
    NULL },
 
175
};
 
176
 
 
177
static const GimpEnumActionEntry tools_ink_blob_size_actions[] =
 
178
{
 
179
  { "tools-ink-blob-size-set", GIMP_STOCK_TOOL_INK,
 
180
    "Set Ink Blob Size", NULL, NULL,
 
181
    GIMP_ACTION_SELECT_SET, TRUE,
 
182
    NULL },
 
183
  { "tools-ink-blob-size-minimum", GIMP_STOCK_TOOL_INK,
 
184
    "M Ink Blob Size", NULL, NULL,
 
185
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
186
    NULL },
 
187
  { "tools-ink-blob-size-maximum", GIMP_STOCK_TOOL_INK,
 
188
    "Maximum Ink Blob Size", NULL, NULL,
 
189
    GIMP_ACTION_SELECT_LAST, FALSE,
 
190
    NULL },
 
191
  { "tools-ink-blob-size-decrease", GIMP_STOCK_TOOL_INK,
 
192
    "Decrease Ink Blob Size", NULL, NULL,
 
193
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
194
    NULL },
 
195
  { "tools-ink-blob-size-increase", GIMP_STOCK_TOOL_INK,
 
196
    "Increase Ink Blob Size", NULL, NULL,
 
197
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
198
    NULL },
 
199
  { "tools-ink-blob-size-decrease-skip", GIMP_STOCK_TOOL_INK,
 
200
    "Decrease Ink Blob Size More", NULL, NULL,
 
201
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
202
    NULL },
 
203
  { "tools-ink-blob-size-increase-skip", GIMP_STOCK_TOOL_INK,
 
204
    "Increase Ink Blob Size More", NULL, NULL,
 
205
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
206
    NULL },
 
207
};
 
208
 
 
209
static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
 
210
{
 
211
  { "tools-ink-blob-aspect-set", GIMP_STOCK_TOOL_INK,
 
212
    "Set Ink Blob Aspect", NULL, NULL,
 
213
    GIMP_ACTION_SELECT_SET, TRUE,
 
214
    NULL },
 
215
  { "tools-ink-blob-aspect-minimum", GIMP_STOCK_TOOL_INK,
 
216
    "M Ink Blob Aspect", NULL, NULL,
 
217
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
218
    NULL },
 
219
  { "tools-ink-blob-aspect-maximum", GIMP_STOCK_TOOL_INK,
 
220
    "Maximum Ink Blob Aspect", NULL, NULL,
 
221
    GIMP_ACTION_SELECT_LAST, FALSE,
 
222
    NULL },
 
223
  { "tools-ink-blob-aspect-decrease", GIMP_STOCK_TOOL_INK,
 
224
    "Decrease Ink Blob Aspect", NULL, NULL,
 
225
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
226
    NULL },
 
227
  { "tools-ink-blob-aspect-increase", GIMP_STOCK_TOOL_INK,
 
228
    "Increase Ink Blob Aspect", NULL, NULL,
 
229
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
230
    NULL },
 
231
  { "tools-ink-blob-aspect-decrease-skip", GIMP_STOCK_TOOL_INK,
 
232
    "Decrease Ink Blob Aspect More", NULL, NULL,
 
233
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
234
    NULL },
 
235
  { "tools-ink-blob-aspect-increase-skip", GIMP_STOCK_TOOL_INK,
 
236
    "Increase Ink Blob Aspect More", NULL, NULL,
 
237
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
238
    NULL },
 
239
};
 
240
 
 
241
static const GimpEnumActionEntry tools_ink_blob_angle_actions[] =
 
242
{
 
243
  { "tools-ink-blob-angle-set", GIMP_STOCK_TOOL_INK,
 
244
    "Set Ink Blob Angle", NULL, NULL,
 
245
    GIMP_ACTION_SELECT_SET, TRUE,
 
246
    NULL },
 
247
  { "tools-ink-blob-angle-minimum", GIMP_STOCK_TOOL_INK,
 
248
    "M Ink Blob Angle", NULL, NULL,
 
249
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
250
    NULL },
 
251
  { "tools-ink-blob-angle-maximum", GIMP_STOCK_TOOL_INK,
 
252
    "Maximum Ink Blob Angle", NULL, NULL,
 
253
    GIMP_ACTION_SELECT_LAST, FALSE,
 
254
    NULL },
 
255
  { "tools-ink-blob-angle-decrease", GIMP_STOCK_TOOL_INK,
 
256
    "Decrease Ink Blob Angle", NULL, NULL,
 
257
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
258
    NULL },
 
259
  { "tools-ink-blob-angle-increase", GIMP_STOCK_TOOL_INK,
 
260
    "Increase Ink Blob Angle", NULL, NULL,
 
261
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
262
    NULL },
 
263
  { "tools-ink-blob-angle-decrease-skip", GIMP_STOCK_TOOL_INK,
 
264
    "Decrease Ink Blob Angle More", NULL, NULL,
 
265
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
266
    NULL },
 
267
  { "tools-ink-blob-angle-increase-skip", GIMP_STOCK_TOOL_INK,
 
268
    "Increase Ink Blob Angle More", NULL, NULL,
 
269
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
270
    NULL },
 
271
};
 
272
 
 
273
static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
 
274
{
 
275
  { "tools-foreground-select-brush-size-set",
 
276
    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
 
277
    "Set Foreground Select Brush Size", NULL, NULL,
 
278
    GIMP_ACTION_SELECT_SET, TRUE,
 
279
    NULL },
 
280
  { "tools-foreground-select-brush-size-minimum",
 
281
    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
 
282
    "M Foreground Select Brush Size", NULL, NULL,
 
283
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
284
    NULL },
 
285
  { "tools-foreground-select-brush-size-maximum",
 
286
    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
 
287
    "Maximum Foreground Select Brush Size", NULL, NULL,
 
288
    GIMP_ACTION_SELECT_LAST, FALSE,
 
289
    NULL },
 
290
  { "tools-foreground-select-brush-size-decrease",
 
291
    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
 
292
    "Decrease Foreground Select Brush Size", NULL, NULL,
 
293
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
294
    NULL },
 
295
  { "tools-foreground-select-brush-size-increase",
 
296
    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
 
297
    "Increase Foreground Select Brush Size", NULL, NULL,
 
298
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
299
    NULL },
 
300
  { "tools-foreground-select-brush-size-decrease-skip",
 
301
    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
 
302
    "Decrease Foreground Select Brush Size More", NULL, NULL,
 
303
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
304
    NULL },
 
305
  { "tools-foreground-select-brush-size-increase-skip",
 
306
    GIMP_STOCK_TOOL_FOREGROUND_SELECT,
 
307
    "Increase Foreground Select Brush Size More", NULL, NULL,
 
308
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
309
    NULL },
 
310
};
 
311
 
 
312
static const GimpToggleActionEntry tools_rectangle_toggle_actions[] =
 
313
{
 
314
  { "tools-rectangle-toggle-fixed-aspect", GIMP_STOCK_TOOL_RECT_SELECT,
 
315
    N_("Toggle Fixed-Aspect Option for Rectangle"), NULL, NULL,
 
316
    G_CALLBACK (tools_rectangle_toggle_fixed_aspect),
 
317
    TRUE,
 
318
    NULL},
 
319
  { "tools-rectangle-toggle-fixed-center", GIMP_STOCK_TOOL_RECT_SELECT,
 
320
    N_("Toggle Expand-From-Center Option for Rectangle"), NULL, NULL,
 
321
    G_CALLBACK (tools_rectangle_toggle_fixed_center),
 
322
    TRUE,
 
323
    NULL}
 
324
};
 
325
 
 
326
static const GimpEnumActionEntry tools_value_1_actions[] =
 
327
{
 
328
  { "tools-value-1-set", GIMP_STOCK_TOOL_OPTIONS,
 
329
    "Set Value 1", NULL, NULL,
 
330
    GIMP_ACTION_SELECT_SET, TRUE,
 
331
    NULL },
 
332
  { "tools-value-1-minimum", GIMP_STOCK_TOOL_OPTIONS,
 
333
    "Minimize Value 1", NULL, NULL,
 
334
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
335
    NULL },
 
336
  { "tools-value-1-maximum", GIMP_STOCK_TOOL_OPTIONS,
 
337
    "Maximize Value 1", NULL, NULL,
 
338
    GIMP_ACTION_SELECT_LAST, FALSE,
 
339
    NULL },
 
340
  { "tools-value-1-decrease", GIMP_STOCK_TOOL_OPTIONS,
 
341
    "Decrease Value 1", "less", NULL,
 
342
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
343
    NULL },
 
344
  { "tools-value-1-increase", GIMP_STOCK_TOOL_OPTIONS,
 
345
    "Increase Value 1", "greater", NULL,
 
346
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
347
    NULL },
 
348
  { "tools-value-1-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
 
349
    "Decrease Value 1 More", "<control>less", NULL,
 
350
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
351
    NULL },
 
352
  { "tools-value-1-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
 
353
    "Increase Value 1 More", "<control>greater", NULL,
 
354
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
355
    NULL },
 
356
};
 
357
 
 
358
static const GimpEnumActionEntry tools_value_2_actions[] =
 
359
{
 
360
  { "tools-value-2-set", GIMP_STOCK_TOOL_OPTIONS,
 
361
    "Set Value 2", NULL, NULL,
 
362
    GIMP_ACTION_SELECT_SET, TRUE,
 
363
    NULL },
 
364
  { "tools-value-2-minimum", GIMP_STOCK_TOOL_OPTIONS,
 
365
    "Minimize Value 2", NULL, NULL,
 
366
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
367
    NULL },
 
368
  { "tools-value-2-maximum", GIMP_STOCK_TOOL_OPTIONS,
 
369
    "Maximize Value 2", NULL, NULL,
 
370
    GIMP_ACTION_SELECT_LAST, FALSE,
 
371
    NULL },
 
372
  { "tools-value-2-decrease", GIMP_STOCK_TOOL_OPTIONS,
 
373
    "Decrease Value 2", "bracketleft", NULL,
 
374
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
375
    NULL },
 
376
  { "tools-value-2-increase", GIMP_STOCK_TOOL_OPTIONS,
 
377
    "Increase Value 2", "bracketright", NULL,
 
378
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
379
    NULL },
 
380
  { "tools-value-2-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
 
381
    "Decrease Value 2 More", "<shift>bracketleft", NULL,
 
382
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
383
    NULL },
 
384
  { "tools-value-2-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
 
385
    "Increase Value 2 More", "<shift>bracketright", NULL,
 
386
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
387
    NULL },
 
388
};
 
389
 
 
390
static const GimpEnumActionEntry tools_value_3_actions[] =
 
391
{
 
392
  { "tools-value-3-set", GIMP_STOCK_TOOL_OPTIONS,
 
393
    "Set Value 3", NULL, NULL,
 
394
    GIMP_ACTION_SELECT_SET, TRUE,
 
395
    NULL },
 
396
  { "tools-value-3-minimum", GIMP_STOCK_TOOL_OPTIONS,
 
397
    "Minimize Value 3", NULL, NULL,
 
398
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
399
    NULL },
 
400
  { "tools-value-3-maximum", GIMP_STOCK_TOOL_OPTIONS,
 
401
    "Maximize Value 3", NULL, NULL,
 
402
    GIMP_ACTION_SELECT_LAST, FALSE,
 
403
    NULL },
 
404
  { "tools-value-3-decrease", GIMP_STOCK_TOOL_OPTIONS,
 
405
    "Decrease Value 3", NULL, NULL,
 
406
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
407
    NULL },
 
408
  { "tools-value-3-increase", GIMP_STOCK_TOOL_OPTIONS,
 
409
    "Increase Value 3", NULL, NULL,
 
410
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
411
    NULL },
 
412
  { "tools-value-3-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
 
413
    "Decrease Value 3 More", NULL, NULL,
 
414
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
415
    NULL },
 
416
  { "tools-value-3-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
 
417
    "Increase Value 3 More", NULL, NULL,
 
418
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
419
    NULL },
 
420
};
 
421
 
 
422
static const GimpEnumActionEntry tools_value_4_actions[] =
 
423
{
 
424
  { "tools-value-4-set", GIMP_STOCK_TOOL_OPTIONS,
 
425
    "Set Value 4", NULL, NULL,
 
426
    GIMP_ACTION_SELECT_SET, TRUE,
 
427
    NULL },
 
428
  { "tools-value-4-minimum", GIMP_STOCK_TOOL_OPTIONS,
 
429
    "Minimize Value 4", NULL, NULL,
 
430
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
431
    NULL },
 
432
  { "tools-value-4-maximum", GIMP_STOCK_TOOL_OPTIONS,
 
433
    "Maximize Value 4", NULL, NULL,
 
434
    GIMP_ACTION_SELECT_LAST, FALSE,
 
435
    NULL },
 
436
  { "tools-value-4-decrease", GIMP_STOCK_TOOL_OPTIONS,
 
437
    "Decrease Value 4", NULL, NULL,
 
438
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
439
    NULL },
 
440
  { "tools-value-4-increase", GIMP_STOCK_TOOL_OPTIONS,
 
441
    "Increase Value 4", NULL, NULL,
 
442
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
443
    NULL },
 
444
  { "tools-value-4-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
 
445
    "Decrease Value 4 More", NULL, NULL,
 
446
    GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
 
447
    NULL },
 
448
  { "tools-value-4-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
 
449
    "Increase Value 4 More", NULL, NULL,
 
450
    GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
 
451
    NULL },
 
452
};
 
453
 
 
454
static const GimpEnumActionEntry tools_object_1_actions[] =
 
455
{
 
456
  { "tools-object-1-set", GIMP_STOCK_TOOL_OPTIONS,
 
457
    "Select Object 1 by Index", NULL, NULL,
 
458
    GIMP_ACTION_SELECT_SET, TRUE,
 
459
    NULL },
 
460
  { "tools-object-1-first", GIMP_STOCK_TOOL_OPTIONS,
 
461
    "First Object 1", NULL, NULL,
 
462
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
463
    NULL },
 
464
  { "tools-object-1-last", GIMP_STOCK_TOOL_OPTIONS,
 
465
    "Last Object 1", NULL, NULL,
 
466
    GIMP_ACTION_SELECT_LAST, FALSE,
 
467
    NULL },
 
468
  { "tools-object-1-previous", GIMP_STOCK_TOOL_OPTIONS,
 
469
    "Previous Object 1", NULL, NULL,
 
470
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
471
    NULL },
 
472
  { "tools-object-1-next", GIMP_STOCK_TOOL_OPTIONS,
 
473
    "Next Object 1", NULL, NULL,
 
474
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
475
    NULL }
 
476
};
 
477
 
 
478
static const GimpEnumActionEntry tools_object_2_actions[] =
 
479
{
 
480
  { "tools-object-2-set", GIMP_STOCK_TOOL_OPTIONS,
 
481
    "Select Object 2 by Index", NULL, NULL,
 
482
    GIMP_ACTION_SELECT_SET, TRUE,
 
483
    NULL },
 
484
  { "tools-object-2-first", GIMP_STOCK_TOOL_OPTIONS,
 
485
    "First Object 2", NULL, NULL,
 
486
    GIMP_ACTION_SELECT_FIRST, FALSE,
 
487
    NULL },
 
488
  { "tools-object-2-last", GIMP_STOCK_TOOL_OPTIONS,
 
489
    "Last Object 2", NULL, NULL,
 
490
    GIMP_ACTION_SELECT_LAST, FALSE,
 
491
    NULL },
 
492
  { "tools-object-2-previous", GIMP_STOCK_TOOL_OPTIONS,
 
493
    "Previous Object 2", NULL, NULL,
 
494
    GIMP_ACTION_SELECT_PREVIOUS, FALSE,
 
495
    NULL },
 
496
  { "tools-object-2-next", GIMP_STOCK_TOOL_OPTIONS,
 
497
    "Next Object 2", NULL, NULL,
 
498
    GIMP_ACTION_SELECT_NEXT, FALSE,
 
499
    NULL }
 
500
};
 
501
 
85
502
 
86
503
void
87
504
tools_actions_setup (GimpActionGroup *group)
106
523
                                        "tools-by-color-select-short");
107
524
  gtk_action_set_accel_path (action, "<Actions>/tools/tools-by-color-select");
108
525
 
109
 
#ifdef __GNUC__
110
 
#warning FIXME: remove accel_path hack
111
 
#endif
112
 
  g_object_set_data (G_OBJECT (action), "gimp-accel-path",
113
 
                     "<Actions>/tools/tools-by-color-select");
114
 
 
115
 
  action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
116
 
                                        "tools-rotate-arbitrary");
117
 
  gtk_action_set_accel_path (action, "<Actions>/tools/tools-rotate");
118
 
 
119
 
#ifdef __GNUC__
120
 
#warning FIXME: remove accel_path hack
121
 
#endif
122
 
  g_object_set_data (G_OBJECT (action), "gimp-accel-path",
123
 
                     "<Actions>/tools/tools-rotate");
 
526
  gimp_action_group_add_enum_actions (group,
 
527
                                      tools_color_average_radius_actions,
 
528
                                      G_N_ELEMENTS (tools_color_average_radius_actions),
 
529
                                      G_CALLBACK (tools_color_average_radius_cmd_callback));
 
530
 
 
531
  gimp_action_group_add_enum_actions (group,
 
532
                                      tools_paint_brush_scale_actions,
 
533
                                      G_N_ELEMENTS (tools_paint_brush_scale_actions),
 
534
                                      G_CALLBACK (tools_paint_brush_scale_cmd_callback));
 
535
 
 
536
  gimp_action_group_add_enum_actions (group,
 
537
                                      tools_ink_blob_size_actions,
 
538
                                      G_N_ELEMENTS (tools_ink_blob_size_actions),
 
539
                                      G_CALLBACK (tools_ink_blob_size_cmd_callback));
 
540
  gimp_action_group_add_enum_actions (group,
 
541
                                      tools_ink_blob_aspect_actions,
 
542
                                      G_N_ELEMENTS (tools_ink_blob_aspect_actions),
 
543
                                      G_CALLBACK (tools_ink_blob_aspect_cmd_callback));
 
544
  gimp_action_group_add_enum_actions (group,
 
545
                                      tools_ink_blob_angle_actions,
 
546
                                      G_N_ELEMENTS (tools_ink_blob_angle_actions),
 
547
                                      G_CALLBACK (tools_ink_blob_angle_cmd_callback));
 
548
 
 
549
  gimp_action_group_add_enum_actions (group,
 
550
                                      tools_foreground_select_brush_size_actions,
 
551
                                      G_N_ELEMENTS (tools_foreground_select_brush_size_actions),
 
552
                                      G_CALLBACK (tools_fg_select_brush_size_cmd_callback));
 
553
 
 
554
  gimp_action_group_add_toggle_actions (group,
 
555
                                        tools_rectangle_toggle_actions,
 
556
                                        G_N_ELEMENTS (tools_rectangle_toggle_actions));
 
557
 
 
558
  gimp_action_group_add_enum_actions (group,
 
559
                                      tools_value_1_actions,
 
560
                                      G_N_ELEMENTS (tools_value_1_actions),
 
561
                                      G_CALLBACK (tools_value_1_cmd_callback));
 
562
  gimp_action_group_add_enum_actions (group,
 
563
                                      tools_value_2_actions,
 
564
                                      G_N_ELEMENTS (tools_value_2_actions),
 
565
                                      G_CALLBACK (tools_value_2_cmd_callback));
 
566
  gimp_action_group_add_enum_actions (group,
 
567
                                      tools_value_3_actions,
 
568
                                      G_N_ELEMENTS (tools_value_3_actions),
 
569
                                      G_CALLBACK (tools_value_3_cmd_callback));
 
570
  gimp_action_group_add_enum_actions (group,
 
571
                                      tools_value_4_actions,
 
572
                                      G_N_ELEMENTS (tools_value_4_actions),
 
573
                                      G_CALLBACK (tools_value_4_cmd_callback));
 
574
 
 
575
  gimp_action_group_add_enum_actions (group,
 
576
                                      tools_object_1_actions,
 
577
                                      G_N_ELEMENTS (tools_object_1_actions),
 
578
                                      G_CALLBACK (tools_object_1_cmd_callback));
 
579
  gimp_action_group_add_enum_actions (group,
 
580
                                      tools_object_2_actions,
 
581
                                      G_N_ELEMENTS (tools_object_2_actions),
 
582
                                      G_CALLBACK (tools_object_2_cmd_callback));
124
583
 
125
584
  for (list = GIMP_LIST (group->gimp->tool_info_list)->list;
126
585
       list;
148
607
          entry.stock_id    = stock_id;
149
608
          entry.label       = tool_info->menu_path;
150
609
          entry.accelerator = tool_info->menu_accel;
151
 
          entry.tooltip     = tool_info->blurb;
 
610
          entry.tooltip     = tool_info->help;
152
611
          entry.help_id     = tool_info->help_id;
153
612
          entry.value       = identifier;
154
613
 
165
624
tools_actions_update (GimpActionGroup *group,
166
625
                      gpointer         data)
167
626
{
168
 
  GimpContext  *context   = gimp_get_user_context (group->gimp);
169
 
  GimpToolInfo *tool_info = gimp_context_get_tool (context);
 
627
  GimpContext   *context   = gimp_get_user_context (group->gimp);
 
628
  GimpToolInfo  *tool_info = gimp_context_get_tool (context);
 
629
  GimpContainer *container = context->gimp->tool_info_list;
 
630
  gboolean       raise     = FALSE;
 
631
  gboolean       lower     = FALSE;
170
632
 
171
633
#define SET_SENSITIVE(action,condition) \
172
634
        gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
176
638
  SET_SENSITIVE ("tools-visibility", tool_info);
177
639
 
178
640
  if (tool_info)
179
 
    SET_ACTIVE ("tools-visibility", tool_info->visible);
 
641
    {
 
642
      gint last_index;
 
643
      gint index;
 
644
 
 
645
      SET_ACTIVE ("tools-visibility", tool_info->visible);
 
646
 
 
647
      last_index = gimp_container_num_children (container) -1;
 
648
      index      = gimp_container_get_child_index   (container,
 
649
                                                     GIMP_OBJECT (tool_info));
 
650
 
 
651
      raise = index != 0;
 
652
      lower = index != last_index;
 
653
    }
 
654
 
 
655
  SET_SENSITIVE ("tools-raise",           raise);
 
656
  SET_SENSITIVE ("tools-raise-to-top",    raise);
 
657
  SET_SENSITIVE ("tools-lower",           lower);
 
658
  SET_SENSITIVE ("tools-lower-to-bottom", lower);
180
659
 
181
660
#undef SET_SENSITIVE
182
661
#undef SET_ACTIVE