GnomeDruidPageStandard patch



this fixes a few things in GnomeDruidPageStandard:

    1.  no more infinite loop when sizing
    2.  fix some memory leaks
    3.  stop initializing GParams twice
    4.  don't chain _set_property() / _get_property()

if someone could give this patch (and gnome-druid-page-standard.c) a
once-over before i commit this i'd appreciate it.

jacob
-- 
"In fact, can you imagine anything more terrifying than a zombie clown?"
	-- moby
Index: gnome-druid-page-standard.c
===================================================================
RCS file: /cvs/gnome/libgnomeui/libgnomeui/gnome-druid-page-standard.c,v
retrieving revision 1.38
diff -u -r1.38 gnome-druid-page-standard.c
--- gnome-druid-page-standard.c	2001/12/27 01:27:07	1.38
+++ gnome-druid-page-standard.c	2002/01/08 01:04:29
@@ -74,8 +74,6 @@
 						     GtkStyle                    *old_style);
 static void gnome_druid_page_standard_prepare       (GnomeDruidPage              *page,
 						     GtkWidget                   *druid);
-static void gnome_druid_page_standard_size_allocate (GtkWidget                   *widget,
-						     GtkAllocation               *allocation);
 static void gnome_druid_page_standard_layout_setup  (GnomeDruidPageStandard      *druid_page_standard);
 static void gnome_druid_page_standard_set_color     (GnomeDruidPageStandard      *druid_page_standard);
 
@@ -122,7 +120,6 @@
 	gobject_class->set_property = gnome_druid_page_standard_set_property;
 	gobject_class->finalize = gnome_druid_page_standard_finalize;
 	object_class->destroy = gnome_druid_page_standard_destroy;
-	widget_class->size_allocate = gnome_druid_page_standard_size_allocate;
 	widget_class->realize = gnome_druid_page_standard_realize;
 	widget_class->style_set = gnome_druid_page_standard_style_set;
 	druid_page_class->prepare = gnome_druid_page_standard_prepare;
@@ -307,17 +304,6 @@
 }
 
 static void
-get_color_arg (GValue *value, GdkColor *orig)
-{
-  GdkColor *color;
-
-  color = g_new (GdkColor, 1);
-  *color = *orig;
-  g_value_init (value, GDK_TYPE_COLOR);
-  g_value_set_boxed (value, color);
-}
-
-static void
 gnome_druid_page_standard_get_property (GObject    *object,
 					guint       prop_id,
 					GValue     *value,
@@ -336,25 +322,25 @@
 		g_value_set_object (value, druid_page_standard->top_watermark);
 		break;
 	case PROP_TITLE_FOREGROUND_GDK:
-		get_color_arg (value, & (druid_page_standard->title_foreground));
+		g_value_set_boxed (value, &druid_page_standard->title_foreground);
 		break;
 	case PROP_TITLE_FOREGROUND_SET:
 		g_value_set_boolean (value, druid_page_standard->_priv->title_foreground_set);
 		break;
 	case PROP_BACKGROUND_GDK:
-		get_color_arg (value, & (druid_page_standard->background));
+		g_value_set_boxed (value, &druid_page_standard->background);
 		break;
 	case PROP_BACKGROUND_SET:
 		g_value_set_boolean (value, druid_page_standard->_priv->background_set);
 		break;
 	case PROP_LOGO_BACKGROUND_GDK:
-		get_color_arg (value, & (druid_page_standard->logo_background));
+		g_value_set_boxed (value, &druid_page_standard->logo_background);
 		break;
 	case PROP_LOGO_BACKGROUND_SET:
 		g_value_set_boolean (value, druid_page_standard->_priv->logo_background_set);
 		break;
 	case PROP_CONTENTS_BACKGROUND_GDK:
-		get_color_arg (value, & (druid_page_standard->contents_background));
+		g_value_set_boxed (value, &druid_page_standard->contents_background);
 		break;
 	case PROP_CONTENTS_BACKGROUND_SET:
 		g_value_set_boolean (value, druid_page_standard->_priv->contents_background_set);
@@ -363,8 +349,6 @@
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
 	}
-
-	GNOME_CALL_PARENT (G_OBJECT_CLASS, get_property, (object, prop_id, value, pspec));
 }
 
 static void
@@ -460,8 +444,6 @@
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
 	}
-
-	GNOME_CALL_PARENT (G_OBJECT_CLASS, set_property, (object, prop_id, value, pspec));
 }
 
 static void
@@ -777,15 +759,6 @@
 		gtk_box_pack_start (GTK_BOX (vbox), a_label, FALSE, FALSE, 0);
 		gtk_widget_show (a_label);
 	}
-}
-
-static void
-gnome_druid_page_standard_size_allocate (GtkWidget *widget,
-					 GtkAllocation *allocation)
-{
-	GNOME_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate,
-				   (widget, allocation));
-	gnome_druid_page_standard_layout_setup (GNOME_DRUID_PAGE_STANDARD (widget));
 }
 
 static void


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