gimp r24691 - in trunk: . app/tools



Author: mitch
Date: Wed Jan 23 15:14:28 2008
New Revision: 24691
URL: http://svn.gnome.org/viewvc/gimp?rev=24691&view=rev

Log:
2008-01-23  Michael Natterer  <mitch gimp org>

	* app/tools/gimphuesaturationtool.c: change signature of widget
	callbacks to take a GimpHueSaturationTool pointer instead of
	"gpointer data".

	* app/tools/gimpposterizetool.c: remove redundant GTK_ADJUSTMENT()
	casts.



Modified:
   trunk/ChangeLog
   trunk/app/tools/gimphuesaturationtool.c
   trunk/app/tools/gimpposterizetool.c

Modified: trunk/app/tools/gimphuesaturationtool.c
==============================================================================
--- trunk/app/tools/gimphuesaturationtool.c	(original)
+++ trunk/app/tools/gimphuesaturationtool.c	Wed Jan 23 15:14:28 2008
@@ -63,21 +63,21 @@
 static void       gimp_hue_saturation_tool_dialog        (GimpImageMapTool *im_tool);
 static void       gimp_hue_saturation_tool_reset         (GimpImageMapTool *im_tool);
 
-static void     hue_saturation_update_sliders       (GimpHueSaturationTool *hs_tool);
-static void     hue_saturation_update_color_areas   (GimpHueSaturationTool *hs_tool);
+static void     hue_saturation_update_sliders           (GimpHueSaturationTool *hs_tool);
+static void     hue_saturation_update_color_areas       (GimpHueSaturationTool *hs_tool);
 
-static void     hue_saturation_partition_callback       (GtkWidget     *widget,
-                                                         gpointer       data);
-static void     hue_saturation_partition_reset_callback (GtkWidget     *widget,
-                                                         gpointer       data);
-static void     hue_saturation_hue_changed              (GtkAdjustment *adj,
-                                                         gpointer       data);
-static void     hue_saturation_lightness_changed        (GtkAdjustment *adj,
-                                                         gpointer       data);
-static void     hue_saturation_saturation_changed       (GtkAdjustment *adj,
-                                                         gpointer       data);
-static void     hue_saturation_overlap_changed          (GtkAdjustment *adj,
-                                                         gpointer       data);
+static void     hue_saturation_partition_callback       (GtkWidget             *widget,
+                                                         GimpHueSaturationTool *hs_tool);
+static void     hue_saturation_partition_reset_callback (GtkWidget             *widget,
+                                                         GimpHueSaturationTool *hs_tool);
+static void     hue_saturation_hue_changed              (GtkAdjustment         *adjustment,
+                                                         GimpHueSaturationTool *hs_tool);
+static void     hue_saturation_lightness_changed        (GtkAdjustment         *adjustment,
+                                                         GimpHueSaturationTool *hs_tool);
+static void     hue_saturation_saturation_changed       (GtkAdjustment         *adjustment,
+                                                         GimpHueSaturationTool *hs_tool);
+static void     hue_saturation_overlap_changed          (GtkAdjustment         *adjustment,
+                                                         GimpHueSaturationTool *hs_tool);
 
 
 G_DEFINE_TYPE (GimpHueSaturationTool, gimp_hue_saturation_tool,
@@ -503,11 +503,10 @@
 }
 
 static void
-hue_saturation_partition_callback (GtkWidget *widget,
-                                   gpointer   data)
+hue_saturation_partition_callback (GtkWidget             *widget,
+                                   GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
-  GimpHueRange           partition;
+  GimpHueRange partition;
 
   partition = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
                                                   "hue_partition"));
@@ -525,11 +524,9 @@
 }
 
 static void
-hue_saturation_partition_reset_callback (GtkWidget *widget,
-                                         gpointer   data)
+hue_saturation_partition_reset_callback (GtkWidget             *widget,
+                                         GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
-
   gimp_hue_saturation_config_reset_range (hs_tool->config,
                                           hs_tool->hue_partition);
 
@@ -540,11 +537,10 @@
 }
 
 static void
-hue_saturation_hue_changed (GtkAdjustment *adjustment,
-                            gpointer       data)
+hue_saturation_hue_changed (GtkAdjustment         *adjustment,
+                            GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
-  gdouble                value   = adjustment->value / 180.0;
+  gdouble value = adjustment->value / 180.0;
 
   if (hs_tool->config->hue[hs_tool->hue_partition] != value)
     {
@@ -559,11 +555,10 @@
 }
 
 static void
-hue_saturation_lightness_changed (GtkAdjustment *adjustment,
-                                  gpointer       data)
+hue_saturation_lightness_changed (GtkAdjustment         *adjustment,
+                                  GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
-  gdouble                value   = adjustment->value / 100.0;
+  gdouble value = adjustment->value / 100.0;
 
   if (hs_tool->config->lightness[hs_tool->hue_partition] != value)
     {
@@ -578,11 +573,10 @@
 }
 
 static void
-hue_saturation_saturation_changed (GtkAdjustment *adjustment,
-                                   gpointer       data)
+hue_saturation_saturation_changed (GtkAdjustment         *adjustment,
+                                   GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
-  gdouble                value   = adjustment->value / 100.0;
+  gdouble value = adjustment->value / 100.0;
 
   if (hs_tool->config->saturation[hs_tool->hue_partition] != value)
     {
@@ -597,11 +591,10 @@
 }
 
 static void
-hue_saturation_overlap_changed (GtkAdjustment *adjustment,
-                                gpointer       data)
+hue_saturation_overlap_changed (GtkAdjustment         *adjustment,
+                                GimpHueSaturationTool *hs_tool)
 {
-  GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (data);
-  gdouble                value   = adjustment->value / 100.0;
+  gdouble value = adjustment->value / 100.0;
 
   if (hs_tool->config->overlap != value)
     {

Modified: trunk/app/tools/gimpposterizetool.c
==============================================================================
--- trunk/app/tools/gimpposterizetool.c	(original)
+++ trunk/app/tools/gimpposterizetool.c	Wed Jan 23 15:14:28 2008
@@ -153,7 +153,7 @@
 
   GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
 
-  gtk_adjustment_set_value (GTK_ADJUSTMENT (posterize_tool->levels_data),
+  gtk_adjustment_set_value (posterize_tool->levels_data,
                             posterize_tool->levels);
 
   gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (posterize_tool));
@@ -225,7 +225,7 @@
 
   posterize_tool->levels = POSTERIZE_DEFAULT_LEVELS;
 
-  gtk_adjustment_set_value (GTK_ADJUSTMENT (posterize_tool->levels_data),
+  gtk_adjustment_set_value (posterize_tool->levels_data,
                             posterize_tool->levels);
 }
 



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