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

« back to all changes in this revision

Viewing changes to app/tools/gimphuesaturationtool.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
21
21
#include <gtk/gtk.h>
22
22
 
23
23
#include "libgimpcolor/gimpcolor.h"
24
 
#include "libgimpmath/gimpmath.h"
25
24
#include "libgimpwidgets/gimpwidgets.h"
26
25
 
27
26
#include "tools-types.h"
50
49
#define LIGHTNESS_SLIDER   (1 << 1)
51
50
#define SATURATION_SLIDER  (1 << 2)
52
51
#define DRAW               (1 << 3)
53
 
#define SLIDERS            (HUE_SLIDER | LIGHTNESS_SLIDER | SATURATION_SLIDER)
 
52
#define OVERLAP_SLIDER     (1 << 4)
 
53
#define SLIDERS            (HUE_SLIDER        | \
 
54
                            LIGHTNESS_SLIDER  | \
 
55
                            SATURATION_SLIDER | \
 
56
                            OVERLAP_SLIDER)
54
57
#define ALL                (SLIDERS | DRAW)
55
58
 
56
59
 
57
60
/*  local function prototypes  */
58
61
 
59
 
static void     gimp_hue_saturation_tool_class_init (GimpHueSaturationToolClass *klass);
60
 
static void     gimp_hue_saturation_tool_init       (GimpHueSaturationTool      *tool);
61
 
 
62
62
static void     gimp_hue_saturation_tool_finalize   (GObject          *object);
63
63
 
64
64
static gboolean gimp_hue_saturation_tool_initialize (GimpTool         *tool,
65
 
                                                     GimpDisplay      *gdisp);
 
65
                                                     GimpDisplay      *display,
 
66
                                                     GError          **error);
66
67
 
67
 
static void     gimp_hue_saturation_tool_map        (GimpImageMapTool *image_map_tool);
68
 
static void     gimp_hue_saturation_tool_dialog     (GimpImageMapTool *image_map_tool);
69
 
static void     gimp_hue_saturation_tool_reset      (GimpImageMapTool *image_map_tool);
 
68
static void     gimp_hue_saturation_tool_map        (GimpImageMapTool *im_tool);
 
69
static void     gimp_hue_saturation_tool_dialog     (GimpImageMapTool *im_tool);
 
70
static void     gimp_hue_saturation_tool_reset      (GimpImageMapTool *im_tool);
70
71
 
71
72
static void     hue_saturation_update               (GimpHueSaturationTool *hs_tool,
72
73
                                                     gint                   update);
80
81
                                                             gpointer       data);
81
82
static void     hue_saturation_saturation_adjustment_update (GtkAdjustment *adj,
82
83
                                                             gpointer       data);
83
 
 
84
 
 
85
 
/*  private variables  */
 
84
static void     hue_saturation_overlap_adjustment_update    (GtkAdjustment *adj,
 
85
                                                             gpointer       data);
 
86
 
 
87
 
 
88
G_DEFINE_TYPE (GimpHueSaturationTool, gimp_hue_saturation_tool,
 
89
               GIMP_TYPE_IMAGE_MAP_TOOL)
 
90
 
 
91
#define parent_class gimp_hue_saturation_tool_parent_class
86
92
 
87
93
static gint default_colors[6][3] =
88
94
{
94
100
  { 255,   0, 255 }
95
101
};
96
102
 
97
 
static GimpImageMapToolClass *parent_class = NULL;
98
 
 
99
 
 
100
 
/*  public functions  */
101
103
 
102
104
void
103
105
gimp_hue_saturation_tool_register (GimpToolRegisterCallback  callback,
108
110
                0,
109
111
                "gimp-hue-saturation-tool",
110
112
                _("Hue-Saturation"),
111
 
                _("Adjust hue and saturation"),
 
113
                _("Hue-Saturation Tool: Adjust hue, saturation, and lightness"),
112
114
                N_("Hue-_Saturation..."), NULL,
113
115
                NULL, GIMP_HELP_TOOL_HUE_SATURATION,
114
116
                GIMP_STOCK_TOOL_HUE_SATURATION,
115
117
                data);
116
118
}
117
119
 
118
 
GType
119
 
gimp_hue_saturation_tool_get_type (void)
120
 
{
121
 
  static GType tool_type = 0;
122
 
 
123
 
  if (! tool_type)
124
 
    {
125
 
      static const GTypeInfo tool_info =
126
 
      {
127
 
        sizeof (GimpHueSaturationToolClass),
128
 
        (GBaseInitFunc) NULL,
129
 
        (GBaseFinalizeFunc) NULL,
130
 
        (GClassInitFunc) gimp_hue_saturation_tool_class_init,
131
 
        NULL,           /* class_finalize */
132
 
        NULL,           /* class_data     */
133
 
        sizeof (GimpHueSaturationTool),
134
 
        0,              /* n_preallocs    */
135
 
        (GInstanceInitFunc) gimp_hue_saturation_tool_init,
136
 
      };
137
 
 
138
 
      tool_type = g_type_register_static (GIMP_TYPE_IMAGE_MAP_TOOL,
139
 
                                          "GimpHueSaturationTool",
140
 
                                          &tool_info, 0);
141
 
    }
142
 
 
143
 
  return tool_type;
144
 
}
145
 
 
146
 
 
147
 
/*  private functions  */
148
 
 
149
120
static void
150
121
gimp_hue_saturation_tool_class_init (GimpHueSaturationToolClass *klass)
151
122
{
152
 
  GObjectClass          *object_class;
153
 
  GimpToolClass         *tool_class;
154
 
  GimpImageMapToolClass *image_map_tool_class;
155
 
 
156
 
  object_class         = G_OBJECT_CLASS (klass);
157
 
  tool_class           = GIMP_TOOL_CLASS (klass);
158
 
  image_map_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
159
 
 
160
 
  parent_class = g_type_class_peek_parent (klass);
161
 
 
162
 
  object_class->finalize       = gimp_hue_saturation_tool_finalize;
163
 
 
164
 
  tool_class->initialize       = gimp_hue_saturation_tool_initialize;
165
 
 
166
 
  image_map_tool_class->shell_desc = _("Adjust hue / lightness / saturation");
167
 
 
168
 
  image_map_tool_class->map    = gimp_hue_saturation_tool_map;
169
 
  image_map_tool_class->dialog = gimp_hue_saturation_tool_dialog;
170
 
  image_map_tool_class->reset  = gimp_hue_saturation_tool_reset;
 
123
  GObjectClass          *object_class  = G_OBJECT_CLASS (klass);
 
124
  GimpToolClass         *tool_class    = GIMP_TOOL_CLASS (klass);
 
125
  GimpImageMapToolClass *im_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
 
126
 
 
127
  object_class->finalize    = gimp_hue_saturation_tool_finalize;
 
128
 
 
129
  tool_class->initialize    = gimp_hue_saturation_tool_initialize;
 
130
 
 
131
  im_tool_class->shell_desc = _("Adjust Hue / Lightness / Saturation");
 
132
 
 
133
  im_tool_class->map        = gimp_hue_saturation_tool_map;
 
134
  im_tool_class->dialog     = gimp_hue_saturation_tool_dialog;
 
135
  im_tool_class->reset      = gimp_hue_saturation_tool_reset;
171
136
}
172
137
 
173
138
static void
194
159
}
195
160
 
196
161
static gboolean
197
 
gimp_hue_saturation_tool_initialize (GimpTool    *tool,
198
 
                                     GimpDisplay *gdisp)
 
162
gimp_hue_saturation_tool_initialize (GimpTool     *tool,
 
163
                                     GimpDisplay  *display,
 
164
                                     GError      **error)
199
165
{
200
166
  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (tool);
201
167
  GimpDrawable          *drawable;
202
168
 
203
 
  drawable = gimp_image_active_drawable (gdisp->gimage);
 
169
  drawable = gimp_image_active_drawable (display->image);
204
170
 
205
171
  if (! drawable)
206
172
    return FALSE;
207
173
 
208
174
  if (! gimp_drawable_is_rgb (drawable))
209
175
    {
210
 
      g_message (_("Hue-Saturation operates only on RGB color layers."));
 
176
      g_set_error (error, 0, 0,
 
177
                   _("Hue-Saturation operates only on RGB color layers."));
211
178
      return FALSE;
212
179
    }
213
180
 
214
181
  hue_saturation_init (hs_tool->hue_saturation);
215
182
 
216
 
  GIMP_TOOL_CLASS (parent_class)->initialize (tool, gdisp);
 
183
  GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
217
184
 
218
185
  hue_saturation_update (hs_tool, ALL);
219
186
 
239
206
gimp_hue_saturation_tool_dialog (GimpImageMapTool *image_map_tool)
240
207
{
241
208
  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
 
209
  GtkWidget             *vbox;
242
210
  GtkWidget             *abox;
243
211
  GtkWidget             *table;
244
212
  GtkWidget             *slider;
245
213
  GtkWidget             *button;
246
214
  GtkWidget             *frame;
247
 
  GtkWidget             *vbox;
248
215
  GtkWidget             *hbox;
249
216
  GtkObject             *data;
 
217
  GtkSizeGroup          *label_group;
 
218
  GtkSizeGroup          *spinner_group;
250
219
  GSList                *group = NULL;
251
220
  gint                   i;
252
221
 
253
222
  const struct
254
223
  {
255
224
    const gchar *label;
 
225
    const gchar *tooltip;
256
226
    gint         label_col;
257
227
    gint         label_row;
258
228
    gint         frame_col;
260
230
  }
261
231
  hue_partition_table[] =
262
232
  {
263
 
    { N_("M_aster"), 2, 3, 0, 0 },
264
 
    { N_("_R"),      2, 1, 2, 0 },
265
 
    { N_("_Y"),      1, 2, 0, 2 },
266
 
    { N_("_G"),      1, 4, 0, 4 },
267
 
    { N_("_C"),      2, 5, 2, 6 },
268
 
    { N_("_B"),      3, 4, 4, 4 },
269
 
    { N_("_M"),      3, 2, 4, 2 }
 
233
    { N_("M_aster"), N_("Adjust all colors"), 2, 3, 0, 0 },
 
234
    { N_("_R"),      N_("Red"),               2, 1, 2, 0 },
 
235
    { N_("_Y"),      N_("Yellow"),            1, 2, 0, 2 },
 
236
    { N_("_G"),      N_("Green"),             1, 4, 0, 4 },
 
237
    { N_("_C"),      N_("Cyan"),              2, 5, 2, 6 },
 
238
    { N_("_B"),      N_("Blue"),              3, 4, 4, 4 },
 
239
    { N_("_M"),      N_("Magenta"),           3, 2, 4, 2 }
270
240
  };
271
241
 
272
 
  frame = gimp_frame_new (_("Select Primary Color to Modify"));
 
242
  frame = gimp_frame_new (_("Select Primary Color to Adjust"));
273
243
  gtk_box_pack_start (GTK_BOX (image_map_tool->main_vbox), frame,
274
 
                      FALSE, FALSE, 0);
 
244
                      TRUE, TRUE, 0);
275
245
  gtk_widget_show (frame);
276
246
 
 
247
  vbox = gtk_vbox_new (FALSE, 6);
 
248
  gtk_container_add (GTK_CONTAINER (frame), vbox);
 
249
  gtk_widget_show (vbox);
 
250
 
277
251
  abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
278
 
  gtk_container_add (GTK_CONTAINER (frame), abox);
 
252
  gtk_box_pack_start (GTK_BOX (vbox), abox, TRUE, TRUE, 0);
279
253
  gtk_widget_show (abox);
280
254
 
281
255
  /*  The table containing hue partitions  */
287
261
  gtk_container_add (GTK_CONTAINER (abox), table);
288
262
 
289
263
  /*  the radio buttons for hue partitions  */
290
 
  for (i = 0; i < 7; i++)
 
264
  for (i = 0; i < G_N_ELEMENTS (hue_partition_table); i++)
291
265
    {
292
 
      button = gtk_radio_button_new_with_mnemonic (group, gettext (hue_partition_table[i].label));
 
266
      button = gtk_radio_button_new_with_mnemonic (group,
 
267
                                                   gettext (hue_partition_table[i].label));
293
268
      group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
294
269
      g_object_set_data (G_OBJECT (button), "hue_partition",
295
270
                         GINT_TO_POINTER (i));
296
271
 
 
272
      gimp_help_set_help_data (button,
 
273
                               gettext (hue_partition_table[i].tooltip),
 
274
                               NULL);
 
275
 
297
276
      if (i == 0)
298
 
        {
299
 
          gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
300
 
          gimp_help_set_help_data (button, _("Modify all colors"), NULL);
301
 
        }
 
277
        gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
302
278
 
303
279
      gtk_table_attach (GTK_TABLE (table), button,
304
280
                        hue_partition_table[i].label_col,
319
295
                            hue_partition_table[i].frame_row,
320
296
                            hue_partition_table[i].frame_row + 1,
321
297
                            GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
322
 
          gtk_widget_show (frame);
 
298
          gtk_widget_show (frame);
323
299
 
324
300
          hs_tool->hue_partition_da[i - 1] = gimp_color_area_new (&color,
325
301
                                                                  GIMP_COLOR_AREA_FLAT,
340
316
 
341
317
  gtk_widget_show (table);
342
318
 
343
 
  frame = gimp_frame_new (_("Modify Selected Color"));
 
319
  label_group  = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
320
  spinner_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
321
 
 
322
  /* Create the 'Overlap' option slider */
 
323
  table = gtk_table_new (3, 1, FALSE);
 
324
  gtk_table_set_col_spacings (GTK_TABLE (table), 4);
 
325
  gtk_table_set_row_spacings (GTK_TABLE (table), 2);
 
326
  gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
 
327
  gtk_widget_show (table);
 
328
 
 
329
  data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
 
330
                               _("_Overlap:"), SLIDER_WIDTH, -1,
 
331
                               0.0, 0, 100.0, 1.0, 15.0, 0,
 
332
                               TRUE, 0.0, 0.0,
 
333
                               NULL, NULL);
 
334
  hs_tool->overlap_data = GTK_ADJUSTMENT (data);
 
335
 
 
336
  gtk_size_group_add_widget (label_group, GIMP_SCALE_ENTRY_LABEL (data));
 
337
  gtk_size_group_add_widget (spinner_group, GIMP_SCALE_ENTRY_SPINBUTTON (data));
 
338
  g_object_unref (label_group);
 
339
  g_object_unref (spinner_group);
 
340
 
 
341
  slider = GIMP_SCALE_ENTRY_SCALE (data);
 
342
  gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_CONTINUOUS);
 
343
 
 
344
  g_signal_connect (data, "value-changed",
 
345
                    G_CALLBACK (hue_saturation_overlap_adjustment_update),
 
346
                    hs_tool);
 
347
 
 
348
  frame = gimp_frame_new (_("Adjust Selected Color"));
344
349
  gtk_box_pack_start (GTK_BOX (image_map_tool->main_vbox), frame,
345
350
                      FALSE, FALSE, 0);
346
351
  gtk_widget_show (frame);
363
368
                               TRUE, 0.0, 0.0,
364
369
                               NULL, NULL);
365
370
  hs_tool->hue_data = GTK_ADJUSTMENT (data);
 
371
 
 
372
  gtk_size_group_add_widget (label_group, GIMP_SCALE_ENTRY_LABEL (data));
 
373
  gtk_size_group_add_widget (spinner_group, GIMP_SCALE_ENTRY_SPINBUTTON (data));
 
374
 
366
375
  slider = GIMP_SCALE_ENTRY_SCALE (data);
367
 
  gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
 
376
  gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_CONTINUOUS);
368
377
 
369
 
  g_signal_connect (data, "value_changed",
 
378
  g_signal_connect (data, "value-changed",
370
379
                    G_CALLBACK (hue_saturation_hue_adjustment_update),
371
380
                    hs_tool);
372
381
 
377
386
                               TRUE, 0.0, 0.0,
378
387
                               NULL, NULL);
379
388
  hs_tool->lightness_data = GTK_ADJUSTMENT (data);
 
389
 
 
390
  gtk_size_group_add_widget (label_group, GIMP_SCALE_ENTRY_LABEL (data));
 
391
  gtk_size_group_add_widget (spinner_group, GIMP_SCALE_ENTRY_SPINBUTTON (data));
 
392
 
380
393
  slider = GIMP_SCALE_ENTRY_SCALE (data);
381
 
  gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
 
394
  gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_CONTINUOUS);
382
395
 
383
 
  g_signal_connect (data, "value_changed",
 
396
  g_signal_connect (data, "value-changed",
384
397
                    G_CALLBACK (hue_saturation_lightness_adjustment_update),
385
398
                    hs_tool);
386
399
 
391
404
                               TRUE, 0.0, 0.0,
392
405
                               NULL, NULL);
393
406
  hs_tool->saturation_data = GTK_ADJUSTMENT (data);
 
407
 
 
408
  gtk_size_group_add_widget (label_group, GIMP_SCALE_ENTRY_LABEL (data));
 
409
  gtk_size_group_add_widget (spinner_group, GIMP_SCALE_ENTRY_SPINBUTTON (data));
 
410
 
394
411
  slider = GIMP_SCALE_ENTRY_SCALE (data);
395
 
  gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
 
412
  gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_CONTINUOUS);
396
413
 
397
 
  g_signal_connect (hs_tool->saturation_data, "value_changed",
 
414
  g_signal_connect (hs_tool->saturation_data, "value-changed",
398
415
                    G_CALLBACK (hue_saturation_saturation_adjustment_update),
399
416
                    hs_tool);
400
417
 
402
419
  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
403
420
  gtk_widget_show (hbox);
404
421
 
405
 
  button = gtk_button_new_with_mnemonic (_("R_eset color"));
 
422
  button = gtk_button_new_with_mnemonic (_("R_eset Color"));
406
423
  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
407
424
  gtk_widget_show (button);
408
425
 
422
439
 
423
440
static void
424
441
hue_saturation_update (GimpHueSaturationTool *hs_tool,
425
 
                       gint                   update)
 
442
                       gint                   update)
426
443
{
427
444
  gint    rgb[3];
428
445
  GimpRGB color;
442
459
    gtk_adjustment_set_value (GTK_ADJUSTMENT (hs_tool->saturation_data),
443
460
                              hs_tool->hue_saturation->saturation[hs_tool->hue_partition]);
444
461
 
 
462
  if (update & OVERLAP_SLIDER)
 
463
    gtk_adjustment_set_value (GTK_ADJUSTMENT (hs_tool->overlap_data),
 
464
                              hs_tool->hue_saturation->overlap);
 
465
 
445
466
  if (update & DRAW)
446
467
    {
447
468
      for (i = 0; i < 6; i++)
469
490
 
470
491
static void
471
492
hue_saturation_partition_callback (GtkWidget *widget,
472
 
                                   gpointer   data)
 
493
                                   gpointer   data)
473
494
{
474
 
  GimpHueSaturationTool *hs_tool;
 
495
  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
475
496
  GimpHueRange           partition;
476
497
 
477
 
  hs_tool = GIMP_HUE_SATURATION_TOOL (data);
478
 
 
479
498
  partition = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
480
499
                                                  "hue_partition"));
481
500
 
490
509
hue_saturation_partition_reset_callback (GtkWidget *widget,
491
510
                                         gpointer   data)
492
511
{
493
 
  GimpHueSaturationTool *hs_tool;
494
 
 
495
 
  hs_tool = GIMP_HUE_SATURATION_TOOL (data);
 
512
  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
496
513
 
497
514
  hue_saturation_partition_reset (hs_tool->hue_saturation,
498
515
                                  hs_tool->hue_partition);
503
520
 
504
521
static void
505
522
hue_saturation_hue_adjustment_update (GtkAdjustment *adjustment,
506
 
                                      gpointer       data)
 
523
                                      gpointer       data)
507
524
{
508
 
  GimpHueSaturationTool *hs_tool;
509
 
  GimpHueRange           part;
510
 
 
511
 
  hs_tool = GIMP_HUE_SATURATION_TOOL (data);
512
 
 
513
 
  part = hs_tool->hue_partition;
 
525
  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
 
526
  GimpHueRange           part    = hs_tool->hue_partition;
514
527
 
515
528
  if (hs_tool->hue_saturation->hue[part] != adjustment->value)
516
529
    {
523
536
 
524
537
static void
525
538
hue_saturation_lightness_adjustment_update (GtkAdjustment *adjustment,
526
 
                                            gpointer       data)
 
539
                                            gpointer       data)
527
540
{
528
 
  GimpHueSaturationTool *hs_tool;
529
 
  GimpHueRange           part;
530
 
 
531
 
  hs_tool = GIMP_HUE_SATURATION_TOOL (data);
532
 
 
533
 
  part = hs_tool->hue_partition;
 
541
  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
 
542
  GimpHueRange           part    = hs_tool->hue_partition;
534
543
 
535
544
  if (hs_tool->hue_saturation->lightness[part] != adjustment->value)
536
545
    {
543
552
 
544
553
static void
545
554
hue_saturation_saturation_adjustment_update (GtkAdjustment *adjustment,
546
 
                                             gpointer       data)
 
555
                                             gpointer       data)
547
556
{
548
 
  GimpHueSaturationTool *hs_tool;
549
 
  GimpHueRange           part;
550
 
 
551
 
  hs_tool = GIMP_HUE_SATURATION_TOOL (data);
552
 
 
553
 
  part = hs_tool->hue_partition;
 
557
  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
 
558
  GimpHueRange           part    = hs_tool->hue_partition;
554
559
 
555
560
  if (hs_tool->hue_saturation->saturation[part] != adjustment->value)
556
561
    {
560
565
      gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (hs_tool));
561
566
    }
562
567
}
 
568
 
 
569
static void
 
570
hue_saturation_overlap_adjustment_update (GtkAdjustment *adjustment,
 
571
                                          gpointer       data)
 
572
{
 
573
  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
 
574
 
 
575
  if (hs_tool->hue_saturation->overlap != adjustment->value)
 
576
    {
 
577
      hs_tool->hue_saturation->overlap = adjustment->value;
 
578
      hue_saturation_update (hs_tool, DRAW);
 
579
 
 
580
      gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (hs_tool));
 
581
    }
 
582
}