[gimp/gtk3-port: 168/228] libgimpwidgets: move all GimpColorSelection members to a private struct



commit 0d0bf9085ad7407102c36fda08390f94c15e7c40
Author: Michael Natterer <mitch gimp org>
Date:   Mon Jan 3 13:00:37 2011 +0100

    libgimpwidgets: move all GimpColorSelection members to a private struct

 app/widgets/gimpcolordialog.c       |    4 +-
 libgimpwidgets/gimpcolorbutton.c    |    2 +-
 libgimpwidgets/gimpcolorselection.c |  300 +++++++++++++++++++++++------------
 libgimpwidgets/gimpcolorselection.h |   20 +--
 4 files changed, 205 insertions(+), 121 deletions(-)
---
diff --git a/app/widgets/gimpcolordialog.c b/app/widgets/gimpcolordialog.c
index 9f7fb5c..d287b75 100644
--- a/app/widgets/gimpcolordialog.c
+++ b/app/widgets/gimpcolordialog.c
@@ -140,7 +140,7 @@ gimp_color_dialog_init (GimpColorDialog *dialog)
   gtk_table_set_row_spacings (GTK_TABLE (table), 2);
   gtk_table_set_col_spacings (GTK_TABLE (table), 2);
   gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
-  gtk_box_pack_end (GTK_BOX (GIMP_COLOR_SELECTION (dialog->selection)->right_vbox),
+  gtk_box_pack_end (GTK_BOX (gimp_color_selection_get_right_vbox (GIMP_COLOR_SELECTION (dialog->selection))),
                     table, FALSE, FALSE, 0);
   gtk_widget_show (table);
 
@@ -365,7 +365,7 @@ gimp_color_dialog_help_func (const gchar *help_id,
   GimpColorSelector *current;
 
   notebook =
-    GIMP_COLOR_NOTEBOOK (GIMP_COLOR_SELECTION (dialog->selection)->notebook);
+    GIMP_COLOR_NOTEBOOK (gimp_color_selection_get_notebook (GIMP_COLOR_SELECTION (dialog->selection)));
 
   current = gimp_color_notebook_get_current_selector (notebook);
 
diff --git a/libgimpwidgets/gimpcolorbutton.c b/libgimpwidgets/gimpcolorbutton.c
index c094c32..c80d112 100644
--- a/libgimpwidgets/gimpcolorbutton.c
+++ b/libgimpwidgets/gimpcolorbutton.c
@@ -1014,7 +1014,7 @@ gimp_color_button_help_func (const gchar *help_id,
 
   selection = g_object_get_data (G_OBJECT (help_data), COLOR_SELECTION_KEY);
 
-  notebook = GIMP_COLOR_NOTEBOOK (selection->notebook);
+  notebook = GIMP_COLOR_NOTEBOOK (gimp_color_selection_get_notebook (selection));
 
   current = gimp_color_notebook_get_current_selector (notebook);
 
diff --git a/libgimpwidgets/gimpcolorselection.c b/libgimpwidgets/gimpcolorselection.c
index 56a49c9..cf4f998 100644
--- a/libgimpwidgets/gimpcolorselection.c
+++ b/libgimpwidgets/gimpcolorselection.c
@@ -82,6 +82,31 @@ enum
 };
 
 
+typedef struct _GimpColorSelectionPrivate GimpColorSelectionPrivate;
+
+struct _GimpColorSelectionPrivate
+{
+  gboolean                  show_alpha;
+
+  GimpHSV                   hsv;
+  GimpRGB                   rgb;
+  GimpColorSelectorChannel  channel;
+
+  GtkWidget                *left_vbox;
+  GtkWidget                *right_vbox;
+
+  GtkWidget                *notebook;
+  GtkWidget                *scales;
+
+  GtkWidget                *new_color;
+  GtkWidget                *old_color;
+};
+
+#define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
+                                                       GIMP_TYPE_COLOR_SELECTION, \
+                                                       GimpColorSelectionPrivate))
+
+
 static void   gimp_color_selection_set_property      (GObject            *object,
                                                       guint               property_id,
                                                       const GValue       *value,
@@ -145,40 +170,42 @@ gimp_color_selection_class_init (GimpColorSelectionClass *klass)
                   g_cclosure_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
 
+  g_type_class_add_private (object_class, sizeof (GimpColorSelectionPrivate));
 }
 
 static void
 gimp_color_selection_init (GimpColorSelection *selection)
 {
-  GtkWidget    *main_hbox;
-  GtkWidget    *hbox;
-  GtkWidget    *vbox;
-  GtkWidget    *frame;
-  GtkWidget    *label;
-  GtkWidget    *entry;
-  GtkWidget    *button;
-  GtkSizeGroup *new_group;
-  GtkSizeGroup *old_group;
-
-  selection->show_alpha = TRUE;
+  GimpColorSelectionPrivate *private = GET_PRIVATE (selection);
+  GtkWidget                 *main_hbox;
+  GtkWidget                 *hbox;
+  GtkWidget                 *vbox;
+  GtkWidget                 *frame;
+  GtkWidget                 *label;
+  GtkWidget                 *entry;
+  GtkWidget                 *button;
+  GtkSizeGroup              *new_group;
+  GtkSizeGroup              *old_group;
+
+  private->show_alpha = TRUE;
 
   gtk_orientable_set_orientation (GTK_ORIENTABLE (selection),
                                   GTK_ORIENTATION_VERTICAL);
 
-  gimp_rgba_set (&selection->rgb, 0.0, 0.0, 0.0, 1.0);
-  gimp_rgb_to_hsv (&selection->rgb, &selection->hsv);
+  gimp_rgba_set (&private->rgb, 0.0, 0.0, 0.0, 1.0);
+  gimp_rgb_to_hsv (&private->rgb, &private->hsv);
 
-  selection->channel = GIMP_COLOR_SELECTOR_HUE;
+  private->channel = GIMP_COLOR_SELECTOR_HUE;
 
   main_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
   gtk_container_add (GTK_CONTAINER (selection), main_hbox);
   gtk_widget_show (main_hbox);
 
   /*  The left vbox with the notebook  */
-  selection->left_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-  gtk_box_pack_start (GTK_BOX (main_hbox), selection->left_vbox,
+  private->left_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+  gtk_box_pack_start (GTK_BOX (main_hbox), private->left_vbox,
                       TRUE, TRUE, 0);
-  gtk_widget_show (selection->left_vbox);
+  gtk_widget_show (private->left_vbox);
 
   if (_gimp_ensure_modules_func)
     {
@@ -186,31 +213,31 @@ gimp_color_selection_init (GimpColorSelection *selection)
       _gimp_ensure_modules_func ();
     }
 
-  selection->notebook = gimp_color_selector_new (GIMP_TYPE_COLOR_NOTEBOOK,
-                                                 &selection->rgb,
-                                                 &selection->hsv,
-                                                 selection->channel);
+  private->notebook = gimp_color_selector_new (GIMP_TYPE_COLOR_NOTEBOOK,
+                                                 &private->rgb,
+                                                 &private->hsv,
+                                                 private->channel);
 
   if (_gimp_ensure_modules_func)
     g_type_class_unref (g_type_class_peek (GIMP_TYPE_COLOR_SELECT));
 
   gimp_color_selector_set_toggles_visible
-    (GIMP_COLOR_SELECTOR (selection->notebook), FALSE);
-  gtk_box_pack_start (GTK_BOX (selection->left_vbox), selection->notebook,
+    (GIMP_COLOR_SELECTOR (private->notebook), FALSE);
+  gtk_box_pack_start (GTK_BOX (private->left_vbox), private->notebook,
                       TRUE, TRUE, 0);
-  gtk_widget_show (selection->notebook);
+  gtk_widget_show (private->notebook);
 
-  g_signal_connect (selection->notebook, "color-changed",
+  g_signal_connect (private->notebook, "color-changed",
                     G_CALLBACK (gimp_color_selection_notebook_changed),
                     selection);
-  g_signal_connect (gimp_color_notebook_get_notebook (GIMP_COLOR_NOTEBOOK (selection->notebook)),
+  g_signal_connect (gimp_color_notebook_get_notebook (GIMP_COLOR_NOTEBOOK (private->notebook)),
                     "switch-page",
                     G_CALLBACK (gimp_color_selection_switch_page),
                     selection);
 
   /*  The hbox for the color_areas  */
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-  gtk_box_pack_end (GTK_BOX (selection->left_vbox), hbox, FALSE, FALSE, 0);
+  gtk_box_pack_end (GTK_BOX (private->left_vbox), hbox, FALSE, FALSE, 0);
   gtk_widget_show (hbox);
 
   /*  The labels  */
@@ -246,58 +273,58 @@ gimp_color_selection_init (GimpColorSelection *selection)
   gtk_container_add (GTK_CONTAINER (frame), vbox);
   gtk_widget_show (vbox);
 
-  selection->new_color = gimp_color_area_new (&selection->rgb,
-                                              selection->show_alpha ?
+  private->new_color = gimp_color_area_new (&private->rgb,
+                                              private->show_alpha ?
                                               GIMP_COLOR_AREA_SMALL_CHECKS :
                                               GIMP_COLOR_AREA_FLAT,
                                               GDK_BUTTON1_MASK |
                                               GDK_BUTTON2_MASK);
-  gtk_size_group_add_widget (new_group, selection->new_color);
-  gtk_box_pack_start (GTK_BOX (vbox), selection->new_color, FALSE, FALSE, 0);
-  gtk_widget_show (selection->new_color);
+  gtk_size_group_add_widget (new_group, private->new_color);
+  gtk_box_pack_start (GTK_BOX (vbox), private->new_color, FALSE, FALSE, 0);
+  gtk_widget_show (private->new_color);
 
-  g_signal_connect (selection->new_color, "color-changed",
+  g_signal_connect (private->new_color, "color-changed",
                     G_CALLBACK (gimp_color_selection_new_color_changed),
                     selection);
 
-  selection->old_color = gimp_color_area_new (&selection->rgb,
-                                              selection->show_alpha ?
+  private->old_color = gimp_color_area_new (&private->rgb,
+                                              private->show_alpha ?
                                               GIMP_COLOR_AREA_SMALL_CHECKS :
                                               GIMP_COLOR_AREA_FLAT,
                                               GDK_BUTTON1_MASK |
                                               GDK_BUTTON2_MASK);
-  gtk_drag_dest_unset (selection->old_color);
-  gtk_size_group_add_widget (old_group, selection->old_color);
-  gtk_box_pack_start (GTK_BOX (vbox), selection->old_color, FALSE, FALSE, 0);
-  gtk_widget_show (selection->old_color);
+  gtk_drag_dest_unset (private->old_color);
+  gtk_size_group_add_widget (old_group, private->old_color);
+  gtk_box_pack_start (GTK_BOX (vbox), private->old_color, FALSE, FALSE, 0);
+  gtk_widget_show (private->old_color);
 
   /*  The right vbox with color scales  */
-  selection->right_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-  gtk_box_pack_start (GTK_BOX (main_hbox), selection->right_vbox,
+  private->right_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+  gtk_box_pack_start (GTK_BOX (main_hbox), private->right_vbox,
                       TRUE, TRUE, 0);
-  gtk_widget_show (selection->right_vbox);
+  gtk_widget_show (private->right_vbox);
 
-  selection->scales = gimp_color_selector_new (GIMP_TYPE_COLOR_SCALES,
-                                               &selection->rgb,
-                                               &selection->hsv,
-                                               selection->channel);
+  private->scales = gimp_color_selector_new (GIMP_TYPE_COLOR_SCALES,
+                                               &private->rgb,
+                                               &private->hsv,
+                                               private->channel);
   gimp_color_selector_set_toggles_visible
-    (GIMP_COLOR_SELECTOR (selection->scales), TRUE);
-  gimp_color_selector_set_show_alpha (GIMP_COLOR_SELECTOR (selection->scales),
-                                      selection->show_alpha);
-  gtk_box_pack_start (GTK_BOX (selection->right_vbox), selection->scales,
+    (GIMP_COLOR_SELECTOR (private->scales), TRUE);
+  gimp_color_selector_set_show_alpha (GIMP_COLOR_SELECTOR (private->scales),
+                                      private->show_alpha);
+  gtk_box_pack_start (GTK_BOX (private->right_vbox), private->scales,
                       TRUE, TRUE, 0);
-  gtk_widget_show (selection->scales);
+  gtk_widget_show (private->scales);
 
-  g_signal_connect (selection->scales, "channel-changed",
+  g_signal_connect (private->scales, "channel-changed",
                     G_CALLBACK (gimp_color_selection_channel_changed),
                     selection);
-  g_signal_connect (selection->scales, "color-changed",
+  g_signal_connect (private->scales, "color-changed",
                     G_CALLBACK (gimp_color_selection_scales_changed),
                     selection);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-  gtk_box_pack_start (GTK_BOX (selection->right_vbox), hbox, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (private->right_vbox), hbox, FALSE, FALSE, 0);
   gtk_widget_show (hbox);
 
   /*  The color picker  */
@@ -375,23 +402,27 @@ void
 gimp_color_selection_set_show_alpha (GimpColorSelection *selection,
                                      gboolean            show_alpha)
 {
+  GimpColorSelectionPrivate *private;
+
   g_return_if_fail (GIMP_IS_COLOR_SELECTION (selection));
 
-  if (show_alpha != selection->show_alpha)
+  private = GET_PRIVATE (selection);
+
+  if (show_alpha != private->show_alpha)
     {
-      selection->show_alpha = show_alpha ? TRUE : FALSE;
+      private->show_alpha = show_alpha ? TRUE : FALSE;
 
       gimp_color_selector_set_show_alpha
-        (GIMP_COLOR_SELECTOR (selection->notebook), selection->show_alpha);
+        (GIMP_COLOR_SELECTOR (private->notebook), private->show_alpha);
       gimp_color_selector_set_show_alpha
-        (GIMP_COLOR_SELECTOR (selection->scales), selection->show_alpha);
+        (GIMP_COLOR_SELECTOR (private->scales), private->show_alpha);
 
-      gimp_color_area_set_type (GIMP_COLOR_AREA (selection->new_color),
-                                selection->show_alpha ?
+      gimp_color_area_set_type (GIMP_COLOR_AREA (private->new_color),
+                                private->show_alpha ?
                                 GIMP_COLOR_AREA_SMALL_CHECKS :
                                 GIMP_COLOR_AREA_FLAT);
-      gimp_color_area_set_type (GIMP_COLOR_AREA (selection->old_color),
-                                selection->show_alpha ?
+      gimp_color_area_set_type (GIMP_COLOR_AREA (private->old_color),
+                                private->show_alpha ?
                                 GIMP_COLOR_AREA_SMALL_CHECKS :
                                 GIMP_COLOR_AREA_FLAT);
     }
@@ -410,7 +441,7 @@ gimp_color_selection_get_show_alpha (GimpColorSelection *selection)
 {
   g_return_val_if_fail (GIMP_IS_COLOR_SELECTION (selection), FALSE);
 
-  return selection->show_alpha;
+  return GET_PRIVATE (selection)->show_alpha;
 }
 
 /**
@@ -424,11 +455,15 @@ void
 gimp_color_selection_set_color (GimpColorSelection *selection,
                                 const GimpRGB      *color)
 {
+  GimpColorSelectionPrivate *private;
+
   g_return_if_fail (GIMP_IS_COLOR_SELECTION (selection));
   g_return_if_fail (color != NULL);
 
-  selection->rgb = *color;
-  gimp_rgb_to_hsv (&selection->rgb, &selection->hsv);
+  private = GET_PRIVATE (selection);
+
+  private->rgb = *color;
+  gimp_rgb_to_hsv (&private->rgb, &private->hsv);
 
   gimp_color_selection_update (selection, UPDATE_ALL);
 
@@ -449,7 +484,7 @@ gimp_color_selection_get_color (GimpColorSelection *selection,
   g_return_if_fail (GIMP_IS_COLOR_SELECTION (selection));
   g_return_if_fail (color != NULL);
 
-  *color = selection->rgb;
+  *color = GET_PRIVATE (selection)->rgb;
 }
 
 /**
@@ -463,10 +498,14 @@ void
 gimp_color_selection_set_old_color (GimpColorSelection *selection,
                                     const GimpRGB      *color)
 {
+  GimpColorSelectionPrivate *private;
+
   g_return_if_fail (GIMP_IS_COLOR_SELECTION (selection));
   g_return_if_fail (color != NULL);
 
-  gimp_color_area_set_color (GIMP_COLOR_AREA (selection->old_color), color);
+  private = GET_PRIVATE (selection);
+
+  gimp_color_area_set_color (GIMP_COLOR_AREA (private->old_color), color);
 }
 
 /**
@@ -480,10 +519,14 @@ void
 gimp_color_selection_get_old_color (GimpColorSelection *selection,
                                     GimpRGB            *color)
 {
+  GimpColorSelectionPrivate *private;
+
   g_return_if_fail (GIMP_IS_COLOR_SELECTION (selection));
   g_return_if_fail (color != NULL);
 
-  gimp_color_area_get_color (GIMP_COLOR_AREA (selection->old_color), color);
+  private = GET_PRIVATE (selection);
+
+  gimp_color_area_get_color (GIMP_COLOR_AREA (private->old_color), color);
 }
 
 /**
@@ -495,11 +538,14 @@ gimp_color_selection_get_old_color (GimpColorSelection *selection,
 void
 gimp_color_selection_reset (GimpColorSelection *selection)
 {
-  GimpRGB color;
+  GimpColorSelectionPrivate *private;
+  GimpRGB                    color;
 
   g_return_if_fail (GIMP_IS_COLOR_SELECTION (selection));
 
-  gimp_color_area_get_color (GIMP_COLOR_AREA (selection->old_color), &color);
+  private = GET_PRIVATE (selection);
+
+  gimp_color_area_get_color (GIMP_COLOR_AREA (private->old_color), &color);
   gimp_color_selection_set_color (selection, &color);
 }
 
@@ -530,15 +576,52 @@ void
 gimp_color_selection_set_config (GimpColorSelection *selection,
                                  GimpColorConfig    *config)
 {
+  GimpColorSelectionPrivate *private;
+
   g_return_if_fail (GIMP_IS_COLOR_SELECTION (selection));
   g_return_if_fail (config == NULL || GIMP_IS_COLOR_CONFIG (config));
 
-  gimp_color_selector_set_config (GIMP_COLOR_SELECTOR (selection->notebook),
+  private = GET_PRIVATE (selection);
+
+  gimp_color_selector_set_config (GIMP_COLOR_SELECTOR (private->notebook),
                                   config);
-  gimp_color_selector_set_config (GIMP_COLOR_SELECTOR (selection->scales),
+  gimp_color_selector_set_config (GIMP_COLOR_SELECTOR (private->scales),
                                   config);
 }
 
+/**
+ * gimp_color_selection_get_notebook:
+ * @selection: A #GimpColorSelection widget.
+ *
+ * Returns: The selection's #GimpColorNotebook.
+ *
+ * Since: GIMP 3.0
+ */
+GtkWidget *
+gimp_color_selection_get_notebook (GimpColorSelection *selection)
+{
+  g_return_val_if_fail (GIMP_IS_COLOR_SELECTION (selection), NULL);
+
+  return GET_PRIVATE (selection)->notebook;
+}
+
+/**
+ * gimp_color_selection_get_right_vbox:
+ * @selection: A #GimpColorSelection widget.
+ *
+ * Returns: The selection's right #GtkBox which contains the color scales.
+ *
+ * Since: GIMP 3.0
+ */
+GtkWidget *
+gimp_color_selection_get_right_vbox (GimpColorSelection *selection)
+{
+  g_return_val_if_fail (GIMP_IS_COLOR_SELECTION (selection), NULL);
+
+  return GET_PRIVATE (selection)->right_vbox;
+}
+
+
 /*  private functions  */
 
 static void
@@ -547,16 +630,17 @@ gimp_color_selection_switch_page (GtkWidget          *widget,
                                   guint               page_num,
                                   GimpColorSelection *selection)
 {
-  GimpColorNotebook *notebook = GIMP_COLOR_NOTEBOOK (selection->notebook);
-  GimpColorSelector *current;
-  gboolean           sensitive;
+  GimpColorSelectionPrivate *private  = GET_PRIVATE (selection);
+  GimpColorNotebook         *notebook = GIMP_COLOR_NOTEBOOK (private->notebook);
+  GimpColorSelector         *current;
+  gboolean                   sensitive;
 
   current = gimp_color_notebook_get_current_selector (notebook);
 
   sensitive = (GIMP_COLOR_SELECTOR_GET_CLASS (current)->set_channel != NULL);
 
   gimp_color_selector_set_toggles_sensitive
-    (GIMP_COLOR_SELECTOR (selection->scales), sensitive);
+    (GIMP_COLOR_SELECTOR (private->scales), sensitive);
 }
 
 static void
@@ -565,8 +649,10 @@ gimp_color_selection_notebook_changed (GimpColorSelector  *selector,
                                        const GimpHSV      *hsv,
                                        GimpColorSelection *selection)
 {
-  selection->hsv = *hsv;
-  selection->rgb = *rgb;
+  GimpColorSelectionPrivate *private = GET_PRIVATE (selection);
+
+  private->hsv = *hsv;
+  private->rgb = *rgb;
 
   gimp_color_selection_update (selection,
                                UPDATE_SCALES | UPDATE_ENTRY | UPDATE_COLOR);
@@ -579,8 +665,10 @@ gimp_color_selection_scales_changed (GimpColorSelector  *selector,
                                      const GimpHSV      *hsv,
                                      GimpColorSelection *selection)
 {
-  selection->rgb = *rgb;
-  selection->hsv = *hsv;
+  GimpColorSelectionPrivate *private = GET_PRIVATE (selection);
+
+  private->rgb = *rgb;
+  private->hsv = *hsv;
 
   gimp_color_selection_update (selection,
                                UPDATE_ENTRY | UPDATE_NOTEBOOK | UPDATE_COLOR);
@@ -599,9 +687,11 @@ static void
 gimp_color_selection_entry_changed (GimpColorHexEntry  *entry,
                                     GimpColorSelection *selection)
 {
-  gimp_color_hex_entry_get_color (entry, &selection->rgb);
+  GimpColorSelectionPrivate *private = GET_PRIVATE (selection);
+
+  gimp_color_hex_entry_get_color (entry, &private->rgb);
 
-  gimp_rgb_to_hsv (&selection->rgb, &selection->hsv);
+  gimp_rgb_to_hsv (&private->rgb, &private->hsv);
 
   gimp_color_selection_update (selection,
                                UPDATE_NOTEBOOK | UPDATE_SCALES | UPDATE_COLOR);
@@ -613,18 +703,22 @@ gimp_color_selection_channel_changed (GimpColorSelector        *selector,
                                       GimpColorSelectorChannel  channel,
                                       GimpColorSelection       *selection)
 {
-  selection->channel = channel;
+  GimpColorSelectionPrivate *private = GET_PRIVATE (selection);
 
-  gimp_color_selector_set_channel (GIMP_COLOR_SELECTOR (selection->notebook),
-                                   selection->channel);
+  private->channel = channel;
+
+  gimp_color_selector_set_channel (GIMP_COLOR_SELECTOR (private->notebook),
+                                   private->channel);
 }
 
 static void
 gimp_color_selection_new_color_changed (GtkWidget          *widget,
                                         GimpColorSelection *selection)
 {
-  gimp_color_area_get_color (GIMP_COLOR_AREA (widget), &selection->rgb);
-  gimp_rgb_to_hsv (&selection->rgb, &selection->hsv);
+  GimpColorSelectionPrivate *private = GET_PRIVATE (selection);
+
+  gimp_color_area_get_color (GIMP_COLOR_AREA (widget), &private->rgb);
+  gimp_rgb_to_hsv (&private->rgb, &private->hsv);
 
   gimp_color_selection_update (selection,
                                UPDATE_NOTEBOOK | UPDATE_SCALES | UPDATE_ENTRY);
@@ -635,32 +729,34 @@ static void
 gimp_color_selection_update (GimpColorSelection *selection,
                              UpdateType          update)
 {
+  GimpColorSelectionPrivate *private = GET_PRIVATE (selection);
+
   if (update & UPDATE_NOTEBOOK)
     {
-      g_signal_handlers_block_by_func (selection->notebook,
+      g_signal_handlers_block_by_func (private->notebook,
                                        gimp_color_selection_notebook_changed,
                                        selection);
 
-      gimp_color_selector_set_color (GIMP_COLOR_SELECTOR (selection->notebook),
-                                     &selection->rgb,
-                                     &selection->hsv);
+      gimp_color_selector_set_color (GIMP_COLOR_SELECTOR (private->notebook),
+                                     &private->rgb,
+                                     &private->hsv);
 
-      g_signal_handlers_unblock_by_func (selection->notebook,
+      g_signal_handlers_unblock_by_func (private->notebook,
                                          gimp_color_selection_notebook_changed,
                                          selection);
     }
 
   if (update & UPDATE_SCALES)
     {
-      g_signal_handlers_block_by_func (selection->scales,
+      g_signal_handlers_block_by_func (private->scales,
                                        gimp_color_selection_scales_changed,
                                        selection);
 
-      gimp_color_selector_set_color (GIMP_COLOR_SELECTOR (selection->scales),
-                                     &selection->rgb,
-                                     &selection->hsv);
+      gimp_color_selector_set_color (GIMP_COLOR_SELECTOR (private->scales),
+                                     &private->rgb,
+                                     &private->hsv);
 
-      g_signal_handlers_unblock_by_func (selection->scales,
+      g_signal_handlers_unblock_by_func (private->scales,
                                          gimp_color_selection_scales_changed,
                                          selection);
     }
@@ -675,7 +771,7 @@ gimp_color_selection_update (GimpColorSelection *selection,
                                        gimp_color_selection_entry_changed,
                                        selection);
 
-      gimp_color_hex_entry_set_color (entry, &selection->rgb);
+      gimp_color_hex_entry_set_color (entry, &private->rgb);
 
       g_signal_handlers_unblock_by_func (entry,
                                          gimp_color_selection_entry_changed,
@@ -684,14 +780,14 @@ gimp_color_selection_update (GimpColorSelection *selection,
 
   if (update & UPDATE_COLOR)
     {
-      g_signal_handlers_block_by_func (selection->new_color,
+      g_signal_handlers_block_by_func (private->new_color,
                                        gimp_color_selection_new_color_changed,
                                        selection);
 
-      gimp_color_area_set_color (GIMP_COLOR_AREA (selection->new_color),
-                                 &selection->rgb);
+      gimp_color_area_set_color (GIMP_COLOR_AREA (private->new_color),
+                                 &private->rgb);
 
-      g_signal_handlers_unblock_by_func (selection->new_color,
+      g_signal_handlers_unblock_by_func (private->new_color,
                                          gimp_color_selection_new_color_changed,
                                          selection);
     }
diff --git a/libgimpwidgets/gimpcolorselection.h b/libgimpwidgets/gimpcolorselection.h
index 3f15164..5263d69 100644
--- a/libgimpwidgets/gimpcolorselection.h
+++ b/libgimpwidgets/gimpcolorselection.h
@@ -43,22 +43,7 @@ typedef struct _GimpColorSelectionClass GimpColorSelectionClass;
 
 struct _GimpColorSelection
 {
-  GtkBox                    parent_instance;
-
-  gboolean                  show_alpha;
-
-  GimpHSV                   hsv;
-  GimpRGB                   rgb;
-  GimpColorSelectorChannel  channel;
-
-  GtkWidget                *left_vbox;
-  GtkWidget                *right_vbox;
-
-  GtkWidget                *notebook;
-  GtkWidget                *scales;
-
-  GtkWidget                *new_color;
-  GtkWidget                *old_color;
+  GtkBox  parent_instance;
 };
 
 struct _GimpColorSelectionClass
@@ -100,6 +85,9 @@ void        gimp_color_selection_color_changed  (GimpColorSelection *selection);
 void        gimp_color_selection_set_config     (GimpColorSelection *selection,
                                                  GimpColorConfig    *config);
 
+GtkWidget * gimp_color_selection_get_notebook   (GimpColorSelection *selection);
+GtkWidget * gimp_color_selection_get_right_vbox (GimpColorSelection *selection);
+
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]