1
/* The GIMP -- an image manipulation program
1
/* GIMP - The GNU Image Manipulation Program
2
2
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
4
4
* This program is free software; you can redistribute it and/or modify
21
21
#include <gtk/gtk.h>
23
#include "libgimpbase/gimpbase.h"
24
23
#include "libgimpwidgets/gimpwidgets.h"
26
25
#include "tools-types.h"
28
#include "config/gimpconfig.h"
30
#include "core/gimp.h"
31
27
#include "core/gimptoolinfo.h"
33
29
#include "paint/gimppaintoptions.h"
43
39
#include "gimpclonetool.h"
44
40
#include "gimpconvolvetool.h"
45
41
#include "gimpdodgeburntool.h"
46
#include "gimpdodgeburntool.h"
47
42
#include "gimperasertool.h"
43
#include "gimphealtool.h"
48
44
#include "gimpinktool.h"
49
#include "gimppaintbrushtool.h"
50
45
#include "gimppaintoptions-gui.h"
51
46
#include "gimppenciltool.h"
47
#include "gimpperspectiveclonetool.h"
52
48
#include "gimpsmudgetool.h"
53
49
#include "gimptooloptions-gui.h"
65
61
GimpPaintOptions *paint_options,
67
63
GtkWidget *incremental_toggle);
64
static GtkWidget * jitter_options_gui (GimpJitterOptions *jitter,
65
GimpPaintOptions *paint_options,
70
68
/* public functions */
98
94
g_object_set_data (G_OBJECT (vbox), GIMP_PAINT_OPTIONS_TABLE_KEY, table);
100
/* the opacity scale */
101
gimp_prop_opacity_entry_new (config, "opacity",
102
GTK_TABLE (table), 0, table_row++,
105
96
/* the paint mode menu */
106
menu = gimp_prop_paint_mode_menu_new (config, "paint-mode", TRUE);
97
menu = gimp_prop_paint_mode_menu_new (config, "paint-mode", TRUE, FALSE);
107
98
label = gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
108
99
_("Mode:"), 0.0, 0.5,
117
108
gtk_widget_set_sensitive (label, FALSE);
120
if (tool_type != GIMP_TYPE_BUCKET_FILL_TOOL &&
121
tool_type != GIMP_TYPE_BLEND_TOOL &&
122
tool_type != GIMP_TYPE_INK_TOOL)
111
/* the opacity scale */
112
gimp_prop_opacity_entry_new (config, "opacity",
113
GTK_TABLE (table), 0, table_row++,
117
if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
124
button = gimp_brush_box_new (NULL, GIMP_CONTEXT (tool_options), 2);
119
button = gimp_prop_brush_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
120
"brush-view-type", "brush-view-size");
125
121
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
126
122
_("Brush:"), 0.0, 0.5,
127
123
button, 2, FALSE);
125
if (tool_type != GIMP_TYPE_SMUDGE_TOOL)
129
adj = gimp_prop_scale_entry_new (config, "brush-scale",
130
GTK_TABLE (table), 0, table_row++,
135
gimp_scale_entry_set_logarithmic (adj, TRUE);
130
140
if (tool_type == GIMP_TYPE_BLEND_TOOL)
132
button = gimp_gradient_box_new (NULL, GIMP_CONTEXT (tool_options),
133
"gradient-reverse", 2);
142
button = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
143
"gradient-view-type",
144
"gradient-view-size",
134
146
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
135
147
_("Gradient:"), 0.0, 0.5,
136
148
button, 2, TRUE);
152
164
gtk_widget_show (frame);
167
frame = jitter_options_gui (options->jitter_options,
171
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
172
gtk_widget_show (frame);
155
175
/* the "incremental" toggle */
156
176
if (tool_type == GIMP_TYPE_PENCIL_TOOL ||
157
177
tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
170
190
/* the "hard edge" toggle */
171
if (tool_type == GIMP_TYPE_ERASER_TOOL ||
172
tool_type == GIMP_TYPE_CLONE_TOOL ||
173
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
174
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
191
if (tool_type == GIMP_TYPE_ERASER_TOOL ||
192
tool_type == GIMP_TYPE_CLONE_TOOL ||
193
tool_type == GIMP_TYPE_HEAL_TOOL ||
194
tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
195
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
196
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
175
197
tool_type == GIMP_TYPE_SMUDGE_TOOL)
177
199
button = gimp_prop_check_button_new (config, "hard", _("Hard edge"));
204
226
GtkWidget *wbox = NULL;
205
227
GtkWidget *button;
207
if (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL) ||
208
tool_type == GIMP_TYPE_CLONE_TOOL ||
209
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
210
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
211
tool_type == GIMP_TYPE_ERASER_TOOL ||
212
tool_type == GIMP_TYPE_SMUDGE_TOOL)
229
if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
214
231
GtkWidget *inner_frame;
216
frame = gtk_expander_new (_("Pressure sensitivity"));
217
gtk_expander_set_expanded (GTK_EXPANDER (frame), FALSE);
233
frame = gimp_prop_expander_new (G_OBJECT (paint_options),
235
_("Pressure sensitivity"));
219
237
inner_frame = gimp_frame_new ("<expander>");
220
238
gtk_container_add (GTK_CONTAINER (frame), inner_frame);
229
247
/* the opacity toggle */
230
248
if (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL) ||
231
249
tool_type == GIMP_TYPE_CLONE_TOOL ||
250
tool_type == GIMP_TYPE_HEAL_TOOL ||
251
tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
232
252
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
233
253
tool_type == GIMP_TYPE_ERASER_TOOL)
241
261
/* the pressure toggle */
242
if (tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
243
tool_type == GIMP_TYPE_CLONE_TOOL ||
244
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
245
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
246
tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
262
if (tool_type == GIMP_TYPE_AIRBRUSH_TOOL ||
263
tool_type == GIMP_TYPE_CLONE_TOOL ||
264
tool_type == GIMP_TYPE_HEAL_TOOL ||
265
tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
266
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
267
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
268
tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
247
269
tool_type == GIMP_TYPE_SMUDGE_TOOL)
249
271
button = gimp_prop_check_button_new (config, "pressure-hardness",
266
288
/* the size toggle */
267
if (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL) ||
268
tool_type == GIMP_TYPE_CLONE_TOOL ||
269
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
270
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
271
tool_type == GIMP_TYPE_ERASER_TOOL)
289
if (tool_type == GIMP_TYPE_CLONE_TOOL ||
290
tool_type == GIMP_TYPE_HEAL_TOOL ||
291
tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
292
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
293
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
294
tool_type == GIMP_TYPE_ERASER_TOOL ||
295
tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
296
tool_type == GIMP_TYPE_PENCIL_TOOL)
273
298
button = gimp_prop_check_button_new (config, "pressure-size",
276
301
gtk_widget_show (button);
304
/* the inverse size toggle */
305
if (tool_type == GIMP_TYPE_AIRBRUSH_TOOL)
307
button = gimp_prop_check_button_new (config, "pressure-inverse-size",
309
gtk_container_add (GTK_CONTAINER (wbox), button);
310
gtk_widget_show (button);
279
313
/* the color toggle */
280
314
if (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL))
296
330
GObject *config = G_OBJECT (paint_options);
297
331
GtkWidget *frame = NULL;
299
GtkWidget *spinbutton;
303
if (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL) ||
304
tool_type == GIMP_TYPE_CLONE_TOOL ||
305
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
306
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
307
tool_type == GIMP_TYPE_ERASER_TOOL ||
308
tool_type == GIMP_TYPE_SMUDGE_TOOL)
333
if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
310
frame = gimp_frame_new (NULL);
312
button = gimp_prop_check_button_new (config, "use-fade",
314
gtk_frame_set_label_widget (GTK_FRAME (frame), button);
315
gtk_widget_show (button);
336
GtkWidget *spinbutton;
317
339
table = gtk_table_new (1, 3, FALSE);
318
340
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
319
gtk_container_add (GTK_CONTAINER (frame), table);
321
gtk_widget_show (table);
323
g_signal_connect_object (button, "toggled",
324
G_CALLBACK (gimp_toggle_button_set_visible),
342
frame = gimp_prop_expanding_frame_new (config, "use-fade",
327
346
/* the fade-out sizeentry */
328
347
spinbutton = gimp_prop_spin_button_new (config, "fade-length",
349
368
static GtkWidget *
369
jitter_options_gui (GimpJitterOptions *jitter,
370
GimpPaintOptions *paint_options,
373
GObject *config = G_OBJECT (paint_options);
374
GtkWidget *frame = NULL;
376
if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
380
table = gtk_table_new (1, 3, FALSE);
381
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
383
frame = gimp_prop_expanding_frame_new (config, "use-jitter",
387
gimp_prop_scale_entry_new (config, "jitter-amount",
388
GTK_TABLE (table), 0, 0,
350
398
gradient_options_gui (GimpGradientOptions *gradient,
351
399
GimpPaintOptions *paint_options,
355
403
GObject *config = G_OBJECT (paint_options);
356
404
GtkWidget *frame = NULL;
358
GtkWidget *spinbutton;
363
406
if (g_type_is_a (tool_type, GIMP_TYPE_PAINTBRUSH_TOOL))
365
frame = gimp_frame_new (NULL);
367
button = gimp_prop_check_button_new (config, "use-gradient",
368
_("Use color from gradient"));
369
gtk_frame_set_label_widget (GTK_FRAME (frame), button);
370
gtk_widget_show (button);
409
GtkWidget *spinbutton;
372
414
table = gtk_table_new (3, 3, FALSE);
373
415
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
374
416
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
375
gtk_container_add (GTK_CONTAINER (frame), table);
376
if (gradient->use_gradient)
377
gtk_widget_show (table);
379
g_signal_connect_object (button, "toggled",
380
G_CALLBACK (gimp_toggle_button_set_visible),
418
frame = gimp_prop_expanding_frame_new (config, "use-gradient",
419
_("Use color from gradient"),
383
422
if (incremental_toggle)
391
430
/* the gradient view */
392
button = gimp_gradient_box_new (NULL, GIMP_CONTEXT (config),
393
"gradient-reverse", 2);
431
button = gimp_prop_gradient_box_new (NULL, GIMP_CONTEXT (config), 2,
432
"gradient-view-type",
433
"gradient-view-size",
394
435
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
395
436
_("Gradient:"), 0.0, 0.5,
396
437
button, 2, TRUE);