42
42
static const GimpActionEntry drawable_actions[] =
44
44
{ "drawable-equalize", NULL,
45
N_("_Equalize"), NULL,
46
N_("Automatic contrast enhancement"),
45
NC_("drawable-action", "_Equalize"), NULL,
46
NC_("drawable-action", "Automatic contrast enhancement"),
47
47
G_CALLBACK (drawable_equalize_cmd_callback),
48
48
GIMP_HELP_LAYER_EQUALIZE },
50
50
{ "drawable-invert", GIMP_STOCK_INVERT,
52
N_("Invert the colors"),
51
NC_("drawable-action", "In_vert"), NULL,
52
NC_("drawable-action", "Invert the colors"),
53
53
G_CALLBACK (drawable_invert_cmd_callback),
54
54
GIMP_HELP_LAYER_INVERT },
56
56
{ "drawable-levels-stretch", NULL,
57
N_("_White Balance"), NULL,
58
N_("Automatic white balance correction"),
57
NC_("drawable-action", "_White Balance"), NULL,
58
NC_("drawable-action", "Automatic white balance correction"),
59
59
G_CALLBACK (drawable_levels_stretch_cmd_callback),
60
60
GIMP_HELP_LAYER_WHITE_BALANCE},
62
62
{ "drawable-offset", NULL,
63
N_("_Offset..."), "<control><shift>O",
64
N_("Shift the pixels, optionally wrapping them at the borders"),
63
NC_("drawable-action", "_Offset..."), "<primary><shift>O",
64
NC_("drawable-action",
65
"Shift the pixels, optionally wrapping them at the borders"),
65
66
G_CALLBACK (drawable_offset_cmd_callback),
66
67
GIMP_HELP_LAYER_OFFSET }
69
70
static const GimpToggleActionEntry drawable_toggle_actions[] =
72
{ "drawable-visible", GIMP_STOCK_VISIBLE,
73
NC_("drawable-action", "_Visible"), NULL,
74
NC_("drawable-action", "Toggle visibility"),
75
G_CALLBACK (drawable_visible_cmd_callback),
77
GIMP_HELP_LAYER_VISIBLE },
71
79
{ "drawable-linked", GIMP_STOCK_LINKED,
73
N_("Toggle the linked state"),
80
NC_("drawable-action", "_Linked"), NULL,
81
NC_("drawable-action", "Toggle the linked state"),
74
82
G_CALLBACK (drawable_linked_cmd_callback),
76
84
GIMP_HELP_LAYER_LINKED },
78
{ "drawable-visible", GIMP_STOCK_VISIBLE,
80
N_("Toggle visibility"),
81
G_CALLBACK (drawable_visible_cmd_callback),
86
{ "drawable-lock-content", NULL /* GIMP_STOCK_LOCK */,
87
NC_("drawable-action", "L_ock pixels"), NULL,
88
NC_("drawable-action",
89
"Keep the pixels on this drawable from being modified"),
90
G_CALLBACK (drawable_lock_content_cmd_callback),
83
GIMP_HELP_LAYER_VISIBLE }
92
NULL, /* GIMP_HELP_LAYER_LOCK_PIXELS */ }
86
95
static const GimpEnumActionEntry drawable_flip_actions[] =
88
97
{ "drawable-flip-horizontal", GIMP_STOCK_FLIP_HORIZONTAL,
89
N_("Flip _Horizontally"), NULL,
90
N_("Flip horizontally"),
98
NC_("drawable-action", "Flip _Horizontally"), NULL,
99
NC_("drawable-action", "Flip horizontally"),
91
100
GIMP_ORIENTATION_HORIZONTAL, FALSE,
92
101
GIMP_HELP_LAYER_FLIP_HORIZONTAL },
94
103
{ "drawable-flip-vertical", GIMP_STOCK_FLIP_VERTICAL,
95
N_("Flip _Vertically"), NULL,
96
N_("Flip vertically"),
104
NC_("drawable-action", "Flip _Vertically"), NULL,
105
NC_("drawable-action", "Flip vertically"),
97
106
GIMP_ORIENTATION_VERTICAL, FALSE,
98
107
GIMP_HELP_LAYER_FLIP_VERTICAL }
101
110
static const GimpEnumActionEntry drawable_rotate_actions[] =
103
112
{ "drawable-rotate-90", GIMP_STOCK_ROTATE_90,
104
N_("Rotate 90° _clockwise"), NULL,
105
N_("Rotate 90 degrees to the right"),
113
NC_("drawable-action", "Rotate 90° _clockwise"), NULL,
114
NC_("drawable-action", "Rotate 90 degrees to the right"),
106
115
GIMP_ROTATE_90, FALSE,
107
116
GIMP_HELP_LAYER_ROTATE_90 },
109
118
{ "drawable-rotate-180", GIMP_STOCK_ROTATE_180,
110
N_("Rotate _180°"), NULL,
111
N_("Turn upside-down"),
119
NC_("drawable-action", "Rotate _180°"), NULL,
120
NC_("drawable-action", "Turn upside-down"),
112
121
GIMP_ROTATE_180, FALSE,
113
122
GIMP_HELP_LAYER_ROTATE_180 },
115
124
{ "drawable-rotate-270", GIMP_STOCK_ROTATE_270,
116
N_("Rotate 90° counter-clock_wise"), NULL,
117
N_("Rotate 90 degrees to the left"),
125
NC_("drawable-action", "Rotate 90° counter-clock_wise"), NULL,
126
NC_("drawable-action", "Rotate 90 degrees to the left"),
118
127
GIMP_ROTATE_270, FALSE,
119
128
GIMP_HELP_LAYER_ROTATE_270 }
124
133
drawable_actions_setup (GimpActionGroup *group)
126
gimp_action_group_add_actions (group,
135
gimp_action_group_add_actions (group, "drawable-action",
127
136
drawable_actions,
128
137
G_N_ELEMENTS (drawable_actions));
130
gimp_action_group_add_toggle_actions (group,
139
gimp_action_group_add_toggle_actions (group, "drawable-action",
131
140
drawable_toggle_actions,
132
141
G_N_ELEMENTS (drawable_toggle_actions));
134
gimp_action_group_add_enum_actions (group,
143
gimp_action_group_add_enum_actions (group, "drawable-action",
135
144
drawable_flip_actions,
136
145
G_N_ELEMENTS (drawable_flip_actions),
137
146
G_CALLBACK (drawable_flip_cmd_callback));
139
gimp_action_group_add_enum_actions (group,
148
gimp_action_group_add_enum_actions (group, "drawable-action",
140
149
drawable_rotate_actions,
141
150
G_N_ELEMENTS (drawable_rotate_actions),
142
151
G_CALLBACK (drawable_rotate_cmd_callback));
153
#define SET_ALWAYS_SHOW_IMAGE(action,show) \
154
gimp_action_group_set_action_always_show_image (group, action, show)
156
SET_ALWAYS_SHOW_IMAGE ("drawable-rotate-90", TRUE);
157
SET_ALWAYS_SHOW_IMAGE ("drawable-rotate-180", TRUE);
158
SET_ALWAYS_SHOW_IMAGE ("drawable-rotate-270", TRUE);
160
#undef SET_ALWAYS_SHOW_IMAGE
184
210
#define SET_ACTIVE(action,condition) \
185
211
gimp_action_group_set_action_active (group, action, (condition) != 0)
187
SET_SENSITIVE ("drawable-equalize", drawable && ! is_indexed);
188
SET_SENSITIVE ("drawable-invert", drawable && ! is_indexed);
189
SET_SENSITIVE ("drawable-levels-stretch", drawable && is_rgb);
190
SET_SENSITIVE ("drawable-offset", drawable);
192
SET_SENSITIVE ("drawable-visible", drawable);
193
SET_SENSITIVE ("drawable-linked", drawable);
195
SET_ACTIVE ("drawable-visible", visible);
196
SET_ACTIVE ("drawable-linked", linked);
198
SET_SENSITIVE ("drawable-flip-horizontal", drawable);
199
SET_SENSITIVE ("drawable-flip-vertical", drawable);
201
SET_SENSITIVE ("drawable-rotate-90", drawable);
202
SET_SENSITIVE ("drawable-rotate-180", drawable);
203
SET_SENSITIVE ("drawable-rotate-270", drawable);
213
SET_SENSITIVE ("drawable-equalize", writable && !children && !is_indexed);
214
SET_SENSITIVE ("drawable-invert", writable && !children && !is_indexed);
215
SET_SENSITIVE ("drawable-levels-stretch", writable && !children && is_rgb);
216
SET_SENSITIVE ("drawable-offset", writable && !children);
218
SET_SENSITIVE ("drawable-visible", drawable);
219
SET_SENSITIVE ("drawable-linked", drawable);
220
SET_SENSITIVE ("drawable-lock-content", can_lock);
222
SET_ACTIVE ("drawable-visible", visible);
223
SET_ACTIVE ("drawable-linked", linked);
224
SET_ACTIVE ("drawable-lock-content", locked);
226
SET_SENSITIVE ("drawable-flip-horizontal", writable);
227
SET_SENSITIVE ("drawable-flip-vertical", writable);
229
SET_SENSITIVE ("drawable-rotate-90", writable);
230
SET_SENSITIVE ("drawable-rotate-180", writable);
231
SET_SENSITIVE ("drawable-rotate-270", writable);
205
233
#undef SET_SENSITIVE
206
234
#undef SET_ACTIVE