Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/glade3/ChangeLog,v
retrieving revision 1.313
diff -u -p -r1.313 ChangeLog
--- ChangeLog	28 Oct 2004 18:35:30 -0000	1.313
+++ ChangeLog	1 Nov 2004 21:20:30 -0000
@@ -1,3 +1,11 @@
+2004-11-01  Tristan Van Berkom  <tristan.van.berkom@gmail.com>
+
+	* Removed GladePropertyType completely from the source in favor of GParamSpec.
+	* Removed GladeChoice code, and replaced all references thereof
+        * Custom types must now provide a function to retrieve a GParamSpec for that
+	  type.
+        * xml files updated accordingly.
+	
 2004-10-28  Tristan Van Berkom  <tristan.van.berkom@gmail.com>
 
 	* src/glade-editor.[ch]: Implemented glade_editor_query_popup(), also obsoleted
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/glade3/src/Makefile.am,v
retrieving revision 1.32
diff -u -p -r1.32 Makefile.am
--- src/Makefile.am	27 Oct 2004 18:35:21 -0000	1.32
+++ src/Makefile.am	1 Nov 2004 21:20:30 -0000
@@ -52,7 +52,6 @@ glade_3_SOURCES = \
 	glade-popup.c \
 	glade-widget.c \
 	glade-catalog.c \
-	glade-choice.c \
 	glade-editor.c \
 	glade-utils.c \
 	glade-signal.c \
@@ -84,7 +83,6 @@ noinst_HEADERS = \
 	glade-property.h \
 	glade-property-class.h \
 	glade-popup.h \
-	glade-choice.h \
 	glade-catalog.h \
 	glade-utils.h \
 	glade-signal.h \
Index: src/glade-editor.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-editor.c,v
retrieving revision 1.59
diff -u -p -r1.59 glade-editor.c
--- src/glade-editor.c	28 Oct 2004 18:35:30 -0000	1.59
+++ src/glade-editor.c	1 Nov 2004 21:20:30 -0000
@@ -32,7 +32,6 @@
 #include "glade.h"
 #include "glade-widget.h"
 #include "glade-widget-class.h"
-#include "glade-choice.h"
 #include "glade-editor.h"
 #include "glade-signal-editor.h"
 #include "glade-parameter.h"
@@ -272,7 +271,7 @@ static void
 glade_editor_property_changed_enum (GtkWidget *menu_item,
 				    GladeEditorProperty *property)
 {
-	GladeChoice *choice;
+	gint   ival;
 	GValue val = { 0, };
 	GladeProperty *gproperty;
 
@@ -282,13 +281,12 @@ glade_editor_property_changed_enum (GtkW
 	if (property->property->loading)
 		return;
 
-	choice = g_object_get_data (G_OBJECT (menu_item), GLADE_ENUM_DATA_TAG);
-	g_return_if_fail (choice != NULL);
+	ival = GPOINTER_TO_INT(g_object_get_data (G_OBJECT (menu_item), GLADE_ENUM_DATA_TAG));
 
 	gproperty = property->property;
 
-	g_value_init (&val, gproperty->class->def->g_type);
-	g_value_set_enum (&val, choice->value);
+	g_value_init (&val, gproperty->class->pspec->value_type);
+	g_value_set_enum (&val, ival);
 	glade_command_set_property (gproperty, &val);
 
 	g_value_unset (&val);
@@ -336,7 +334,6 @@ static void
 glade_editor_property_changed_numeric (GtkWidget *spin,
 				       GladeEditorProperty *property)
 {
-	GladeEditorNumericType numeric_type;
 	GValue val = { 0, };
 
 	g_return_if_fail (property != NULL);
@@ -345,26 +342,23 @@ glade_editor_property_changed_numeric (G
 	if (property->property->loading)
 		return;
 
-	numeric_type = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (spin), "NumericType"));
-
-	switch (numeric_type)
-	{
-	case GLADE_EDITOR_INTEGER:
-		g_value_init (&val, G_TYPE_INT);
-		g_value_set_int (&val, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin)));
-		break;
-	case GLADE_EDITOR_FLOAT:
-		g_value_init (&val, G_TYPE_FLOAT);
-		g_value_set_float (&val, (gfloat) gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin)));
-		break;
-	case GLADE_EDITOR_DOUBLE:
-		g_value_init (&val, G_TYPE_DOUBLE);
-		g_value_set_double (&val, gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin)));
-		break;
-	default:
-		g_warning ("Invalid numeric_type %i\n", numeric_type);
-		return;
-	}
+	g_value_init (&val, property->class->pspec->value_type);
+	
+	if (G_IS_PARAM_SPEC_INT(property->class->pspec))
+		g_value_set_int (&val, gtk_spin_button_get_value_as_int
+				 (GTK_SPIN_BUTTON (spin)));
+	else if (G_IS_PARAM_SPEC_UINT(property->class->pspec))
+		g_value_set_uint (&val, gtk_spin_button_get_value_as_int
+				  (GTK_SPIN_BUTTON (spin)));
+	else if (G_IS_PARAM_SPEC_FLOAT(property->class->pspec))
+		g_value_set_float (&val, (gfloat) gtk_spin_button_get_value
+				   (GTK_SPIN_BUTTON (spin)));
+	else if (G_IS_PARAM_SPEC_DOUBLE(property->class->pspec))
+		g_value_set_double (&val, gtk_spin_button_get_value
+				    (GTK_SPIN_BUTTON (spin)));
+	else
+		g_warning ("Unsupported type %s\n",
+			   g_type_name(property->class->pspec->value_type));
 
 	glade_command_set_property (property->property, &val);
 
@@ -625,19 +619,18 @@ glade_editor_property_show_flags_dialog 
 /* ============================= Create inputs ============================= */
 static GtkWidget *
 glade_editor_create_input_enum_item (GladeEditorProperty *property,
-				     GladeChoice *choice)
+				     const gchar         *name,
+				     gint                 value)
 {
 	GtkWidget *menu_item;
-	const gchar *name;
 
-	name = choice->name;
 	menu_item = gtk_menu_item_new_with_label (name);
 
 	g_signal_connect (G_OBJECT (menu_item), "activate",
 			  G_CALLBACK (glade_editor_property_changed_enum),
 			  property);
 
-	g_object_set_data (G_OBJECT (menu_item), GLADE_ENUM_DATA_TAG, choice);
+	g_object_set_data (G_OBJECT (menu_item), GLADE_ENUM_DATA_TAG, GINT_TO_POINTER(value));
 
 	return menu_item;
 }
@@ -645,19 +638,23 @@ glade_editor_create_input_enum_item (Gla
 static GtkWidget *
 glade_editor_create_input_enum (GladeEditorProperty *property)
 {
-	GladeChoice *choice;
-	GtkWidget *menu_item;
-	GtkWidget *menu;
-	GtkWidget *option_menu;
-	GList *list;
-
+	GtkWidget   *menu_item;
+	GtkWidget   *menu;
+	GtkWidget   *option_menu;
+	GEnumClass  *eclass;
+	gint         i;
+	
 	g_return_val_if_fail (property != NULL, NULL);
+	g_return_val_if_fail ((eclass = g_type_class_ref
+			       (property->class->pspec->value_type)) != NULL, NULL);
 
 	menu = gtk_menu_new ();
-	for (list = property->class->choices; list; list = list->next)
+
+	for (i = 0; i < eclass->n_values; i++)
 	{
-		choice = (GladeChoice *)list->data;
-		menu_item = glade_editor_create_input_enum_item (property, choice);
+		menu_item = glade_editor_create_input_enum_item (property,
+								 eclass->values[i].value_name,
+								 eclass->values[i].value);
 		gtk_widget_show (menu_item);
 		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
 	}
@@ -665,6 +662,8 @@ glade_editor_create_input_enum (GladeEdi
 	option_menu = gtk_option_menu_new ();
 	gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
 
+	g_type_class_unref (eclass);
+
 	return option_menu;
 }
 
@@ -735,8 +734,7 @@ glade_editor_create_input_text (GladeEdi
 }
 
 static GtkWidget *
-glade_editor_create_input_numeric (GladeEditorProperty *property,
-				   GladeEditorNumericType numeric_type)
+glade_editor_create_input_numeric (GladeEditorProperty *property)
 {
 	GladePropertyClass *property_class;
 	GtkAdjustment *adjustment;
@@ -749,9 +747,10 @@ glade_editor_create_input_numeric (Glade
 	adjustment = glade_parameter_adjustment_new (property_class);
 
 	spin  = gtk_spin_button_new (adjustment, 4,
-				     numeric_type == GLADE_EDITOR_INTEGER ? 0 : 2);
+				     G_IS_PARAM_SPEC_FLOAT(property->class->pspec) ||
+				     G_IS_PARAM_SPEC_DOUBLE(property->class->pspec)
+				     ? 2 : 0);
 
-	g_object_set_data (G_OBJECT (spin), "NumericType", GINT_TO_POINTER (numeric_type));
 	g_signal_connect (G_OBJECT (spin), "value_changed",
 			  G_CALLBACK (glade_editor_property_changed_numeric),
 			  property);
@@ -777,24 +776,6 @@ glade_editor_create_input_numeric (Glade
 }
 
 static GtkWidget *
-glade_editor_create_input_integer (GladeEditorProperty *property)
-{
-	return glade_editor_create_input_numeric (property, GLADE_EDITOR_INTEGER);
-}
-
-static GtkWidget *
-glade_editor_create_input_float (GladeEditorProperty *property)
-{
-	return glade_editor_create_input_numeric (property, GLADE_EDITOR_FLOAT);
-}
-
-static GtkWidget *
-glade_editor_create_input_double (GladeEditorProperty *property)
-{
-	return glade_editor_create_input_numeric (property, GLADE_EDITOR_DOUBLE);
-}
-
-static GtkWidget *
 glade_editor_create_input_boolean (GladeEditorProperty *property)
 {
 	GtkWidget *button;
@@ -831,21 +812,8 @@ glade_editor_create_input_unichar (Glade
 	return entry;
 }
 
-static GtkWidget *
-glade_editor_create_input_object (GladeEditorProperty *property,
-				  GladeEditorTable *table)
-{
-	g_return_val_if_fail (GLADE_IS_EDITOR_TABLE (table), NULL);
-	g_return_val_if_fail (GLADE_IS_EDITOR_PROPERTY (property), NULL);
-
-	glade_editor_table_append_items (table, property->class->child,
-					 &property->children, TABLE_TYPE_GENERAL);
-
-	return NULL;
-}
-
 /**
- * glade_editor_create_item_labe:
+ * glade_editor_create_item_label:
  * @class:
  *
  * TODO: write me
@@ -891,49 +859,23 @@ glade_editor_append_item_real (GladeEdit
 	g_return_val_if_fail (GLADE_IS_EDITOR_TABLE (table), NULL);
 	g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (property->class), NULL);
 
-	switch (property->class->type) {
-	case GLADE_PROPERTY_TYPE_BOOLEAN:
-		input = glade_editor_create_input_boolean (property);
-		break;
-	case GLADE_PROPERTY_TYPE_FLOAT:
-		input = glade_editor_create_input_float (property);
-		break;
-	case GLADE_PROPERTY_TYPE_INTEGER:
-		input = glade_editor_create_input_integer (property);
-		break;
-	case GLADE_PROPERTY_TYPE_DOUBLE:
-		input = glade_editor_create_input_double (property);
-		break;
-	case GLADE_PROPERTY_TYPE_STRING:
-		input = glade_editor_create_input_text (property);
-		break;
-	case GLADE_PROPERTY_TYPE_ENUM:
+
+	if (G_IS_PARAM_SPEC_ENUM(property->class->pspec))
 		input = glade_editor_create_input_enum (property);
-		break;
-	case GLADE_PROPERTY_TYPE_FLAGS:
+	else if (G_IS_PARAM_SPEC_FLAGS(property->class->pspec))
 		input = glade_editor_create_input_flags (property);
-		break;
-	case GLADE_PROPERTY_TYPE_UNICHAR:
+	else if (G_IS_PARAM_SPEC_BOOLEAN(property->class->pspec))
+		input = glade_editor_create_input_boolean (property);
+	else if (G_IS_PARAM_SPEC_FLOAT(property->class->pspec) ||
+		 G_IS_PARAM_SPEC_INT(property->class->pspec)   ||
+		 G_IS_PARAM_SPEC_UINT(property->class->pspec)  ||
+		 G_IS_PARAM_SPEC_DOUBLE(property->class->pspec))
+		input = glade_editor_create_input_numeric (property);
+	else if (G_IS_PARAM_SPEC_STRING(property->class->pspec))
+		input = glade_editor_create_input_text (property);
+	else if (G_IS_PARAM_SPEC_UNICHAR(property->class->pspec))
 		input = glade_editor_create_input_unichar (property);
-		break;
-	case GLADE_PROPERTY_TYPE_OTHER_WIDGETS:
-		g_warning ("The widget type %s does not have an input implemented\n",
-			   property->class->name);
-		break;
-	case GLADE_PROPERTY_TYPE_OBJECT:
-		glade_editor_create_input_object (property, table);
-		/* We don't need to add an input for the object, the object
-		 * has added its childs already
-		 */
-		return NULL;
-	case GLADE_PROPERTY_TYPE_ERROR:
-		return gtk_label_new ("Error !");
-	default:
-		g_warning ("This type %s does not have an input implemented\n",
-			   property->class->name);
-		return gtk_label_new ("Fix me !");
-	}
-
+	
 	if (input == NULL) {
 		g_warning ("Can't create an input widget for type %s\n",
 			   property->class->name);
@@ -1249,15 +1191,12 @@ static void
 glade_editor_property_load_integer (GladeEditorProperty *property)
 {
 	GtkWidget *spin = NULL;
-	GList *parameters;
 	gfloat val;
 
 	g_return_if_fail (property != NULL);
 	g_return_if_fail (property->property != NULL);
 	g_return_if_fail (property->property->value != NULL);
 	g_return_if_fail (property->input != NULL);
-	
-	parameters = property->property->class->parameters;
 
 	if (property->property->class->optional) {
 		GtkBoxChild *child;
@@ -1292,6 +1231,8 @@ glade_editor_property_load_integer (Glad
 
 	if (G_VALUE_TYPE (property->property->value) == G_TYPE_INT)
 		val = (gfloat) g_value_get_int (property->property->value);
+	else if (G_VALUE_TYPE (property->property->value) == G_TYPE_UINT)
+		val = (gfloat) g_value_get_uint (property->property->value);		
 	else if (G_VALUE_TYPE (property->property->value) == G_TYPE_DOUBLE)
 		val = (gfloat) g_value_get_double (property->property->value);
 	else
@@ -1302,61 +1243,41 @@ glade_editor_property_load_integer (Glad
 }
 
 static void
-glade_editor_property_load_float (GladeEditorProperty *property)
-{
-	g_return_if_fail (property != NULL);
-	g_return_if_fail (property->property != NULL);
-	g_return_if_fail (property->property->value != NULL);
-	g_return_if_fail (property->input != NULL);
-
-	glade_editor_property_load_integer (property);
-}
-
-static void
-glade_editor_property_load_double (GladeEditorProperty *property)
-{
-	g_return_if_fail (property != NULL);
-	g_return_if_fail (property->property != NULL);
-	g_return_if_fail (property->property->value != NULL);
-	g_return_if_fail (property->input != NULL);
-
-	glade_editor_property_load_integer (property);
-}
-
-static void
 glade_editor_property_load_enum (GladeEditorProperty *property)
 {
 	GladePropertyClass *pclass;
-	GladeChoice *choice;
-	GList *list;
-	gint idx = 0;
+	GEnumClass         *eclass;
+	gint                i, value;
+	GList              *list;
 
+	
 	g_return_if_fail (property != NULL);
 	g_return_if_fail (property->property != NULL);
 	g_return_if_fail (property->property->value != NULL);
 	g_return_if_fail (property->input != NULL);
+	g_return_if_fail ((eclass = g_type_class_ref
+			   (property->class->pspec->value_type)) != NULL);
 	
 	pclass = property->property->class;
 
-	list = pclass->choices;
-	for (; list != NULL; list = list->next) {
-		gint value = g_value_get_enum (property->property->value);
-		choice = (GladeChoice *)list->data;
-		if (choice->value == value)
+	value = g_value_get_enum (property->property->value);
+
+	for (i = 0; i < eclass->n_values; i++)
+	{
+		if (eclass->values[i].value == value)
 			break;
-		idx ++;
 	}
-
-	if (list == NULL)
-		idx = 0;
-
-	gtk_option_menu_set_history (GTK_OPTION_MENU (property->input), idx);
+	
+	gtk_option_menu_set_history (GTK_OPTION_MENU (property->input),
+				     i < eclass->n_values ? i : 0);
 
 	list = GTK_MENU_SHELL (GTK_OPTION_MENU (property->input)->menu)->children;
 	for (; list != NULL; list = list->next) {
 		GtkMenuItem *menu_item = list->data;
 		g_object_set_data (G_OBJECT (menu_item), "user_data",  property);
 	}
+
+	g_type_class_unref (eclass);
 }
 
 static void
@@ -1389,17 +1310,6 @@ glade_editor_property_load_flags (GladeE
 }
 
 static void
-glade_editor_property_load_other_widgets (GladeEditorProperty *property)
-{
-	g_return_if_fail (property != NULL);
-	g_return_if_fail (property->property != NULL);
-	g_return_if_fail (property->property->value != NULL);
-	g_return_if_fail (property->input != NULL);
-
-	g_warning ("Implement me (%s)!\n", G_GNUC_FUNCTION);
-}
-
-static void
 glade_editor_property_load_boolean (GladeEditorProperty *property)
 {
 	GtkWidget *label;
@@ -1487,22 +1397,6 @@ glade_editor_property_load_unichar (Glad
 /* We are recursing so we need the prototype beforehand. Don't you love C ? */
 static void glade_editor_property_load (GladeEditorProperty *property, GladeWidget *widget);
 
-static void
-glade_editor_property_load_object (GladeEditorProperty *property,
-				   GladeWidget *widget)
-{
-	GladeEditorProperty *child;
-	GList *list;
-
-	g_return_if_fail (property != NULL);
-
-	list = property->children;
-	for (; list != NULL; list = list->next) {
-		child = list->data;
-		glade_editor_property_load (child, widget);
-	}
-		
-}
 
 static void
 glade_editor_property_load (GladeEditorProperty *property, GladeWidget *widget)
@@ -1512,11 +1406,6 @@ glade_editor_property_load (GladeEditorP
 	g_return_if_fail (GLADE_IS_EDITOR_PROPERTY (property));
 	g_return_if_fail (GLADE_IS_PROPERTY_CLASS (property->class));
 
-	if (class->type == GLADE_PROPERTY_TYPE_OBJECT) {
-		glade_editor_property_load_object (property, widget);
-		return;
-	}
-
 	property->property = glade_widget_get_property (widget, class->id);
 
 	g_return_if_fail (property->property != NULL);
@@ -1524,42 +1413,25 @@ glade_editor_property_load (GladeEditorP
 
 	property->property->loading = TRUE;
 
-	switch (class->type) {
-	case GLADE_PROPERTY_TYPE_STRING:
+
+	if (G_IS_PARAM_SPEC_ENUM(class->pspec))
+		glade_editor_property_load_enum (property);
+	else if (G_IS_PARAM_SPEC_FLAGS(class->pspec))
+		glade_editor_property_load_flags (property);
+	else if (G_IS_PARAM_SPEC_STRING(class->pspec))
 		glade_editor_property_load_text (property);
-		break;
-	case GLADE_PROPERTY_TYPE_BOOLEAN:
+	else if (G_IS_PARAM_SPEC_BOOLEAN(class->pspec))
 		glade_editor_property_load_boolean (property);
-		break;
-	case GLADE_PROPERTY_TYPE_FLOAT:
-		glade_editor_property_load_float (property);
-		break;
-	case GLADE_PROPERTY_TYPE_DOUBLE:
-		glade_editor_property_load_double (property);
-		break;
-	case GLADE_PROPERTY_TYPE_INTEGER:
+	else if (G_IS_PARAM_SPEC_FLOAT(class->pspec) ||
+		 G_IS_PARAM_SPEC_DOUBLE(class->pspec) ||
+		 G_IS_PARAM_SPEC_INT(class->pspec) ||
+		 G_IS_PARAM_SPEC_UINT(class->pspec))
 		glade_editor_property_load_integer (property);
-		break;
-	case GLADE_PROPERTY_TYPE_ENUM:
-		glade_editor_property_load_enum (property);
-		break;
-	case GLADE_PROPERTY_TYPE_FLAGS:
-		glade_editor_property_load_flags (property);
-		break;
-	case GLADE_PROPERTY_TYPE_UNICHAR:
+	else if (G_IS_PARAM_SPEC_UNICHAR(class->pspec))
 		glade_editor_property_load_unichar (property);
-		break;
-	case GLADE_PROPERTY_TYPE_OTHER_WIDGETS:
-		glade_editor_property_load_other_widgets (property);
-		break;
-	case GLADE_PROPERTY_TYPE_ERROR:
-		g_warning ("%s : type %i not implemented\n", G_GNUC_FUNCTION,
-			   class->type);
-		break;
-	default:
-		g_assert_not_reached ();
-		break;
-	}
+	else
+		g_warning ("%s : type %s not implemented (%s)\n", __FUNCTION__,
+			   class->name, g_type_name (class->pspec->value_type));
 
 	glade_editor_property_set_tooltips (property);
 
Index: src/glade-editor.h
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-editor.h,v
retrieving revision 1.16
diff -u -p -r1.16 glade-editor.h
--- src/glade-editor.h	28 Oct 2004 18:35:30 -0000	1.16
+++ src/glade-editor.h	1 Nov 2004 21:20:30 -0000
@@ -187,12 +187,6 @@ struct _GladeEditorProperty
 			  */
 };
 
-typedef enum {
-	GLADE_EDITOR_INTEGER,
-	GLADE_EDITOR_FLOAT,
-	GLADE_EDITOR_DOUBLE,
-}GladeEditorNumericType;
-
 GType glade_editor_get_type (void);
 
 GladeEditor *glade_editor_new (void);
Index: src/glade-gtk.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-gtk.c,v
retrieving revision 1.57
diff -u -p -r1.57 glade-gtk.c
--- src/glade-gtk.c	28 Oct 2004 18:35:30 -0000	1.57
+++ src/glade-gtk.c	1 Nov 2004 21:20:30 -0000
@@ -63,6 +63,67 @@
 #define FIXED_DEFAULT_CHILD_WIDTH  100
 #define FIXED_DEFAULT_CHILD_HEIGHT 60
 
+
+
+/* ---------------------------- Custom Property definitions ------------------------ */
+static GType
+glade_gtk_stock_get_type (void)
+{
+	static GType etype = 0;
+	if (etype == 0) {
+		static const GEnumValue values[] = {
+			{ 0,   "None",   "glade-none" },
+			{ 1,   "Ok",     "gtk-ok"     },
+			{ 2,   "Cancel", "gtk-cancel" },
+			{ 3,   "Apply",  "gtk-apply"  },
+			{ 4,   "Close",  "gtk-close"  },
+			{ 0, NULL, NULL }
+		};
+		etype = g_enum_register_static ("GtkTtScrollType", values);
+	}
+	return etype;
+}
+
+GParamSpec *GLADEGTK_API
+glade_gtk_stock_spec (void)
+{
+	return g_param_spec_enum ("stock", "stock", "stock",
+				  glade_gtk_stock_get_type (),
+				  0, G_PARAM_READWRITE);
+}
+
+GParamSpec *GLADEGTK_API
+glade_gtk_standard_int_spec (void)
+{
+	static GParamSpec *int_spec = NULL;
+	if (!int_spec)
+		int_spec = g_param_spec_int ("int", "int", "int",
+					     0, G_MAXINT,
+					     0, G_PARAM_READWRITE);
+	return int_spec;
+}
+
+GParamSpec *GLADEGTK_API
+glade_gtk_standard_string_spec (void)
+{
+	static GParamSpec *str_spec = NULL;
+	if (!str_spec)
+		str_spec = g_param_spec_string ("string", "string", "string",
+						"", G_PARAM_READWRITE);
+	return str_spec;
+}
+
+GParamSpec *GLADEGTK_API
+glade_gtk_standard_float_spec (void)
+{
+	static GParamSpec *float_spec = NULL;
+	if (!float_spec)
+		float_spec = g_param_spec_float ("float", "float", "float",
+						 0.0F, G_MAXFLOAT, 0.0F,
+						 G_PARAM_READWRITE);
+	return float_spec;
+}
+
 /* ------------------------------------ Custom Properties ------------------------------ */
 /**
  * glade_gtk_option_menu_set_items:
@@ -561,14 +622,14 @@ glade_gtk_table_set_n_common (GObject *o
 {
 	GladeWidget *widget;
 	GtkTable *table;
-	gint new_size;
-	gint old_size;
+	guint new_size;
+	guint old_size;
 	gint i, j;
 
 	table = GTK_TABLE (object);
 	g_return_if_fail (GTK_IS_TABLE (table));
 
-	new_size = g_value_get_int (value);
+	new_size = g_value_get_uint (value);
 	old_size = for_rows ? table->nrows : table->ncols;
 
 	if (new_size < 1)
@@ -668,6 +729,7 @@ glade_gtk_table_set_n_columns (GObject *
 	glade_gtk_table_set_n_common (object, value, FALSE);
 }
 
+
 /**
  * glade_gtk_button_set_stock:
  * @object:
@@ -681,11 +743,10 @@ glade_gtk_button_set_stock (GObject *obj
 	GladeWidget *glade_widget;
 	GtkWidget *button;
 	GtkStockItem item;
-	GladeChoice *choice = NULL;
 	GladeProperty *property;
 	GladeProperty *text;
-	GList *list;
-	gint val;
+	GEnumClass    *eclass;
+	gint val, i;
 
 	val = g_value_get_enum (value);	
 
@@ -696,23 +757,24 @@ glade_gtk_button_set_stock (GObject *obj
 
 	property = glade_widget_get_property (glade_widget, "stock");
 	text = glade_widget_get_property (glade_widget, "label");
+
+	eclass = g_type_class_ref (property->class->pspec->value_type);
 	g_return_if_fail (property != NULL);
 	g_return_if_fail (text != NULL);
 
-	list = property->class->choices;
-	for (; list; list = list->next)
+	for (i = 0; i < eclass->n_values; i++)
 	{
-		choice = list->data;
-		if (val == choice->value)
+		if (val == eclass->values[i].value)
 			break;
 	}
-	g_return_if_fail (list != NULL);
+
+	g_return_if_fail (i < eclass->n_values);
 
 	if (GTK_BIN (button)->child)
 		gtk_container_remove (GTK_CONTAINER (button),
 				      GTK_BIN (button)->child);
 	
-	if (!gtk_stock_lookup (choice->id, &item))
+	if (!gtk_stock_lookup (eclass->values[i].value_nick, &item))
 	{
 		GtkWidget *label;
 		
@@ -728,7 +790,7 @@ glade_gtk_button_set_stock (GObject *obj
 
 		hbox = gtk_hbox_new (FALSE, 1);
 		label = gtk_label_new_with_mnemonic (item.label);
-		image = gtk_image_new_from_stock (choice->id,
+		image = gtk_image_new_from_stock (eclass->values[i].value_nick,
 						  GTK_ICON_SIZE_BUTTON);
 
 		gtk_label_set_mnemonic_widget (GTK_LABEL (label),
@@ -740,6 +802,8 @@ glade_gtk_button_set_stock (GObject *obj
 		
 		gtk_widget_show_all (button);
 	}
+
+	g_type_class_unref (eclass);
 }
 
 /**
Index: src/glade-plugin.h
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-plugin.h,v
retrieving revision 1.3
diff -u -p -r1.3 glade-plugin.h
--- src/glade-plugin.h	28 Oct 2004 18:35:30 -0000	1.3
+++ src/glade-plugin.h	1 Nov 2004 21:20:30 -0000
@@ -10,7 +10,6 @@
 #include "glade-editor.h"
 #include "glade-property.h"
 #include "glade-property-class.h"
-#include "glade-choice.h"
 #include "glade-types.h"
 
 #endif
Index: src/glade-property-class.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-property-class.c,v
retrieving revision 1.61
diff -u -p -r1.61 glade-property-class.c
--- src/glade-property-class.c	28 Oct 2004 18:35:30 -0000	1.61
+++ src/glade-property-class.c	1 Nov 2004 21:20:30 -0000
@@ -29,7 +29,6 @@
 #include <gmodule.h>
 
 #include "glade.h"
-#include "glade-choice.h"
 #include "glade-widget.h"
 #include "glade-widget-class.h"
 #include "glade-parameter.h"
@@ -38,79 +37,6 @@
 #include "glade-debug.h"
 
 /**
- * glade_property_type_str_to_enum:
- * @str: a string representation of a property type
- *
- * Returns: the #GladePropertyType described by @str, or 
- *          %GLADE_PROPERTY_TYPE_ERROR if we do not recognize @str
- */
-GladePropertyType
-glade_property_type_str_to_enum (const gchar *str)
-{
-	if (strcmp (str, GLADE_TAG_STRING) == 0)
-		return GLADE_PROPERTY_TYPE_STRING;
-	if (strcmp (str, GLADE_TAG_BOOLEAN) == 0)
-		return GLADE_PROPERTY_TYPE_BOOLEAN;
-	if (strcmp (str, GLADE_TAG_UNICHAR) == 0)
-		return GLADE_PROPERTY_TYPE_UNICHAR;
-	if (strcmp (str, GLADE_TAG_FLOAT) == 0)
-		return GLADE_PROPERTY_TYPE_FLOAT;
-	if (strcmp (str, GLADE_TAG_INTEGER) == 0)
-		return GLADE_PROPERTY_TYPE_INTEGER;
-	if (strcmp (str, GLADE_TAG_ENUM) == 0)
-		return GLADE_PROPERTY_TYPE_ENUM;
-	if (strcmp (str, GLADE_TAG_FLAGS) == 0)
-		return GLADE_PROPERTY_TYPE_FLAGS;
-	if (strcmp (str, GLADE_TAG_OTHER_WIDGETS) == 0)
-		return GLADE_PROPERTY_TYPE_OTHER_WIDGETS;
-	if (strcmp (str, GLADE_TAG_OBJECT) == 0)
-		return GLADE_PROPERTY_TYPE_OBJECT;
-
-	g_warning ("Could not determine the property type from *%s*\n", str);
-
-	return GLADE_PROPERTY_TYPE_ERROR;
-}
-
-/**
- * glade_property_type_enum_to_string:
- * @type: a #GladePropertyType
- *
- * Returns: a string representing @type, or %NULL if @type is
- *          either not recognized or is %GLADE_PROPERTY_TYPE_ERROR
- */
-gchar *
-glade_property_type_enum_to_string (GladePropertyType type)
-{
-	switch (type)
-	{
-	case GLADE_PROPERTY_TYPE_STRING:
-		return GLADE_TAG_STRING;
-	case GLADE_PROPERTY_TYPE_BOOLEAN:
-		return GLADE_TAG_BOOLEAN;
-	case GLADE_PROPERTY_TYPE_UNICHAR:
-		return GLADE_TAG_UNICHAR;
-	case GLADE_PROPERTY_TYPE_FLOAT:
-		return GLADE_TAG_FLOAT;
-	case GLADE_PROPERTY_TYPE_INTEGER:
-		return GLADE_TAG_INTEGER;
-	case GLADE_PROPERTY_TYPE_DOUBLE:
-		return GLADE_TAG_DOUBLE;
-	case GLADE_PROPERTY_TYPE_ENUM:
-		return GLADE_TAG_ENUM;
-	case GLADE_PROPERTY_TYPE_FLAGS:
-		return GLADE_TAG_FLAGS;
-	case GLADE_PROPERTY_TYPE_OTHER_WIDGETS:
-		return GLADE_TAG_OTHER_WIDGETS;
-	case GLADE_PROPERTY_TYPE_OBJECT:
-		return GLADE_TAG_OBJECT;
-	case GLADE_PROPERTY_TYPE_ERROR:
-		return NULL;
-	}
-
-	return NULL;
-}
-
-/**
  * glade_property_class_new:
  *
  * Returns: a new #GladePropertyClass
@@ -121,13 +47,11 @@ glade_property_class_new (void)
 	GladePropertyClass *property_class;
 
 	property_class = g_new0 (GladePropertyClass, 1);
-	property_class->type = GLADE_PROPERTY_TYPE_ERROR;
+	property_class->pspec = NULL;
 	property_class->id = NULL;
 	property_class->name = NULL;
 	property_class->tooltip = NULL;
 	property_class->parameters = NULL;
-	property_class->choices = NULL;
-	property_class->enum_type = 0;
 	property_class->optional = FALSE;
 	property_class->optional_default = TRUE;
 	property_class->common = FALSE;
@@ -155,6 +79,8 @@ glade_property_class_clone (GladePropert
 	clone = g_new0 (GladePropertyClass, 1);
 
 	memcpy (clone, property_class, sizeof(GladePropertyClass));
+
+	clone->pspec = property_class->pspec;
 	clone->id = g_strdup (clone->id);
 	clone->name = g_strdup (clone->name);
 	clone->tooltip = g_strdup (clone->tooltip);
@@ -162,7 +88,7 @@ glade_property_class_clone (GladePropert
 	if (G_IS_VALUE (property_class->def))
 	{
 		clone->def = g_new0 (GValue, 1);
-		g_value_init (clone->def, G_VALUE_TYPE (property_class->def));
+		g_value_init (clone->def, property_class->pspec->value_type);
 		g_value_copy (property_class->def, clone->def);
 	}
 
@@ -172,24 +98,13 @@ glade_property_class_clone (GladePropert
 
 		clone->parameters = g_list_copy (clone->parameters);
 
-		for (parameter = clone->parameters; parameter != NULL; parameter = parameter->next)
-			parameter->data = glade_parameter_clone ((GladeParameter*) parameter->data);
-	}
-
-	if (clone->choices)
-	{
-		GList *choice;
-
-		clone->choices = g_list_copy (clone->choices);
-
-		for (choice = clone->choices; choice != NULL; choice = choice->next)
-			choice->data = glade_choice_clone ((GladeChoice*) choice->data);
+		for (parameter = clone->parameters;
+		     parameter != NULL;
+		     parameter = parameter->next)
+			parameter->data =
+				glade_parameter_clone ((GladeParameter*) parameter->data);
 	}
 
-	/* ok, wtf? what is the child member for? */
-	/* if (clone->child)
-		clone->child = glade_widget_class_clone (clone->child); */
-
 	return clone;
 }
 
@@ -218,108 +133,68 @@ glade_property_class_free (GladeProperty
 	}
 	g_list_foreach (class->parameters, (GFunc) glade_parameter_free, NULL);
 	g_list_free (class->parameters);
-	g_list_foreach (class->choices, (GFunc) glade_choice_free, NULL);
-	g_list_free (class->choices);
-	glade_widget_class_free (class->child);
 	g_free (class);
 }
 
-static GladePropertyType
-glade_property_class_get_type_from_spec (GParamSpec *spec)
-{
-	if (G_IS_PARAM_SPEC_INT (spec) || G_IS_PARAM_SPEC_UINT (spec)) {
-		return GLADE_PROPERTY_TYPE_INTEGER;
-	} else if (G_IS_PARAM_SPEC_FLOAT (spec)) {
-		return GLADE_PROPERTY_TYPE_FLOAT;
-	} else if (G_IS_PARAM_SPEC_BOOLEAN (spec)) {
-		return GLADE_PROPERTY_TYPE_BOOLEAN;
-	} else if (G_IS_PARAM_SPEC_UNICHAR (spec)) {
-		return GLADE_PROPERTY_TYPE_UNICHAR;
-	} else if (G_IS_PARAM_SPEC_STRING (spec)) {
-		/* FIXME: We should solve the "name" conflict with a better solution */
-		if (!g_ascii_strcasecmp ( spec->name, "name"))
-			return GLADE_PROPERTY_TYPE_ERROR;
-		else
-			return GLADE_PROPERTY_TYPE_STRING;
-	} else if (G_IS_PARAM_SPEC_ENUM (spec)) {
-		return GLADE_PROPERTY_TYPE_ENUM;
-	} else if (G_IS_PARAM_SPEC_FLAGS (spec)) {
-		return GLADE_PROPERTY_TYPE_FLAGS;
-	} else if (G_IS_PARAM_SPEC_DOUBLE (spec)) {
-		return GLADE_PROPERTY_TYPE_DOUBLE;
-	} else if (G_IS_PARAM_SPEC_LONG (spec)) {
-		g_warning ("Long not implemented\n");
-	} else if (G_IS_PARAM_SPEC_UCHAR (spec)) {
-		g_warning ("uchar not implemented\n");
-	} else if (G_IS_PARAM_SPEC_OBJECT (spec)) {
-		return GLADE_PROPERTY_TYPE_OBJECT;
-	} else if (G_IS_PARAM_SPEC_BOXED (spec)) {
-		/* FIXME: Implement at least the special case of when the boxed type is GdkColor */
-		return GLADE_PROPERTY_TYPE_ERROR;
-	} else {
-		/* FIXME: We should implement the "events" property */
-		if (g_ascii_strcasecmp (spec->name, "user-data")) {
-			g_warning ("Could not determine GladePropertyType from spec (%s) (%s)",
-				   G_PARAM_SPEC_TYPE_NAME (spec), g_type_name (G_PARAM_SPEC_VALUE_TYPE (spec)));
-		}
-	}
-
-	return GLADE_PROPERTY_TYPE_ERROR;
-}
 
 static GValue *
 glade_property_class_get_default_from_spec (GParamSpec *spec,
 					    GladePropertyClass *class)
 {
 	GValue *value;
-
 	value = g_new0 (GValue, 1);
+	g_value_init (value, spec->value_type);
+	g_param_value_set_default (spec, value);
+	return value;
+}
 
-	switch (class->type) {
-	case GLADE_PROPERTY_TYPE_ENUM:
-		g_value_init (value, spec->value_type);
-		g_value_set_enum (value, G_PARAM_SPEC_ENUM (spec)->default_value);
-		break;
-	case GLADE_PROPERTY_TYPE_FLAGS:
-		g_value_init (value, spec->value_type);
-		g_value_set_flags (value, G_PARAM_SPEC_FLAGS (spec)->default_value);
-		break;
-	case GLADE_PROPERTY_TYPE_STRING:
-		g_value_init (value, G_TYPE_STRING);
-		g_value_set_string (value, G_PARAM_SPEC_STRING (spec)->default_value);
-		break;
-	case GLADE_PROPERTY_TYPE_INTEGER:
-		g_value_init (value, G_TYPE_INT);
-		if (G_IS_PARAM_SPEC_INT (spec))
-			g_value_set_int (value, G_PARAM_SPEC_INT (spec)->default_value);
-		else
-			g_value_set_int (value, G_PARAM_SPEC_UINT (spec)->default_value);
-		break;
-	case GLADE_PROPERTY_TYPE_FLOAT:
-		g_value_init (value, G_TYPE_FLOAT);
-		g_value_set_float (value, G_PARAM_SPEC_FLOAT (spec)->default_value);
-		break;
-	case GLADE_PROPERTY_TYPE_DOUBLE:
-		g_value_init (value, G_TYPE_DOUBLE);
-		g_value_set_double (value, G_PARAM_SPEC_DOUBLE (spec)->default_value);
-		break;
-	case GLADE_PROPERTY_TYPE_BOOLEAN:
-		g_value_init (value, G_TYPE_BOOLEAN);
-		g_value_set_boolean (value, G_PARAM_SPEC_BOOLEAN (spec)->default_value);
-		break;
-	case GLADE_PROPERTY_TYPE_UNICHAR:
-		g_value_init (value, G_TYPE_UINT);
-		g_value_set_uint (value, G_PARAM_SPEC_UNICHAR (spec)->default_value);
-		break;
-	case GLADE_PROPERTY_TYPE_OTHER_WIDGETS:
-		break;
-	case GLADE_PROPERTY_TYPE_OBJECT:
-		break;
-	case GLADE_PROPERTY_TYPE_ERROR:
-		break;
+
+static gchar *
+glade_property_class_make_string_from_enum (GType etype, gint eval)
+{
+	GEnumClass *eclass;
+	gchar      *string = NULL;
+	gint        i;
+
+	g_return_val_if_fail ((eclass = g_type_class_ref (etype)) != NULL, NULL);
+	for (i = 0; i < eclass->n_values; i++)
+	{
+		if (eval == eclass->values[i].value)
+		{
+			string = g_strdup (eclass->values[i].value_name);
+			break;
+		}
 	}
+	g_type_class_unref (eclass);
+	return string;
+}
 
-	return value;
+static gchar *
+glade_property_class_make_string_from_flags (GType ftype, guint fval)
+{
+	GFlagsClass *fclass;
+	gchar       *string = NULL;
+	gint         i;
+	g_return_val_if_fail ((fclass = g_type_class_ref (ftype)) != NULL, NULL);
+
+	for (i = 0; i < fclass->n_values; i++)
+	{
+		if (fval & fclass->values[i].value)
+		{
+			if (!string)
+				string = g_strdup (fclass->values[i].value_name);
+			else
+			{
+				gchar *newstr =
+					g_strconcat (string, "|",
+						     fclass->values[i].value_name,
+						     NULL);
+				string = (g_free (string), newstr);
+			}
+		}
+	}
+	g_type_class_unref (fclass);
+	return string;
 }
 
 /**
@@ -336,64 +211,54 @@ glade_property_class_make_string_from_gv
 					      const GValue *value)
 {
 	gchar *string = NULL;
-	GladePropertyType type = property_class->type;
 
-	switch (type) {
-	case GLADE_PROPERTY_TYPE_INTEGER:
+	if (G_IS_PARAM_SPEC_ENUM(property_class->pspec))
+	{
+		gint eval = g_value_get_enum (value);
+		string = glade_property_class_make_string_from_enum
+			(property_class->pspec->value_type, eval);
+	}
+	else if (G_IS_PARAM_SPEC_FLAGS(property_class->pspec))
+	{
+		guint flags = g_value_get_flags (value);
+		string = glade_property_class_make_string_from_flags
+			(property_class->pspec->value_type, flags);
+	}
+	else if (G_IS_PARAM_SPEC_INT(property_class->pspec))
 		string = g_strdup_printf ("%d", g_value_get_int (value));
-		break;
-	case GLADE_PROPERTY_TYPE_FLOAT:
+	else if (G_IS_PARAM_SPEC_UINT(property_class->pspec))
+		string = g_strdup_printf ("%d", g_value_get_uint (value));
+	else if (G_IS_PARAM_SPEC_FLOAT(property_class->pspec))
 		string = g_strdup_printf ("%f", g_value_get_float (value));
-		break;
-	case GLADE_PROPERTY_TYPE_DOUBLE:
+	else if (G_IS_PARAM_SPEC_DOUBLE(property_class->pspec))
 		string = g_strdup_printf ("%g", g_value_get_double (value));
-		break;
-	case GLADE_PROPERTY_TYPE_BOOLEAN:
-		string = g_strdup_printf ("%s", g_value_get_boolean (value) ?
-					  GLADE_TAG_TRUE : GLADE_TAG_FALSE);
-		break;
-	case GLADE_PROPERTY_TYPE_UNICHAR:
+	else if (G_IS_PARAM_SPEC_STRING(property_class->pspec))
+		string = g_value_dup_string (value);
+	else if (G_IS_PARAM_SPEC_CHAR(property_class->pspec))
+		string = g_strdup_printf ("%c", g_value_get_char (value));
+	else if (G_IS_PARAM_SPEC_UCHAR(property_class->pspec))
+		string = g_strdup_printf ("%c", g_value_get_uchar (value));
+	else if (G_IS_PARAM_SPEC_UNICHAR(property_class->pspec))
+	{
 		string = g_malloc (7);
 		g_unichar_to_utf8 (g_value_get_uint (value), string);
 		*g_utf8_next_char(string) = '\0';
-		break;
-	case GLADE_PROPERTY_TYPE_STRING:
-		string = g_strdup (g_value_get_string (value));
-		break;
-	case GLADE_PROPERTY_TYPE_ENUM:
-		{
-			GList *list;
-			GladeChoice *choice;
-
-			list = g_list_nth (property_class->choices, g_value_get_enum (value));
-			if (list != NULL) {
-				choice = (GladeChoice *) list->data;
-				string = g_strdup (choice->id);
-			} else {
-				g_warning ("Could not found choice #%d\n", g_value_get_enum (value));
-			}
-		}
-		break;
-	case GLADE_PROPERTY_TYPE_FLAGS:
-		{
-			GValue tmp_value = { 0, };
-
-			g_value_init (&tmp_value, G_TYPE_STRING);
-			g_value_transform (value, &tmp_value);
-			string = g_strescape (g_value_get_string (&tmp_value),
-					      NULL);
-			g_value_unset (&tmp_value);
-		}
-		break;
-	default:
-		g_warning ("Could not make string from gvalue for type %s\n",
-			 glade_property_type_enum_to_string (type));
 	}
+	else if (G_IS_PARAM_SPEC_BOOLEAN(property_class->pspec))
+		string = g_strdup_printf ("%s", g_value_get_boolean (value) ?
+					  GLADE_TAG_TRUE : GLADE_TAG_FALSE);
+	else
+		g_critical ("Unsupported pspec type %s",
+			    g_type_name(property_class->pspec->value_type));
 
 	return string;
 }
 
-/* This is copied exactly from libglade. I've just renamed the function. */
+/* This is copied exactly from libglade. I've just renamed the function.
+ *
+ * TODO: Expose function from libglade and use the one in libglade (once
+ * Ivan Wongs libglade patch gets in...).
+ */
 static guint
 glade_property_class_make_flags_from_string (GType type, const char *string)
 {
@@ -472,6 +337,34 @@ glade_property_class_make_flags_from_str
     return ret;
 }
 
+/* This is copied exactly from libglade. I've just renamed the function.
+ *
+ * TODO: Expose function from libglade and use the one in libglade (once
+ * Ivan Wongs libglade patch gets in...).
+ */
+static gint
+glade_property_class_make_enum_from_string (GType type, const char *string)
+{
+    GEnumClass *eclass;
+    GEnumValue *ev;
+    gchar *endptr;
+    gint ret = 0;
+
+    ret = strtoul(string, &endptr, 0);
+    if (endptr != string) /* parsed a number */
+	return ret;
+
+    eclass = g_type_class_ref(type);
+    ev = g_enum_get_value_by_name(eclass, string);
+    if (!ev) ev = g_enum_get_value_by_nick(eclass, string);
+    if (ev)  ret = ev->value;
+
+    g_type_class_unref(eclass);
+
+    return ret;
+}
+
+
 /**
  * glade_property_class_make_gvalue_from_string:
  * @property_class:
@@ -486,150 +379,50 @@ glade_property_class_make_gvalue_from_st
 					      const gchar *string)
 {
 	GValue *value = g_new0 (GValue, 1);
-	GladePropertyType type = property_class->type;
-	
-	switch (type) {
-	case GLADE_PROPERTY_TYPE_INTEGER:
-		g_value_init (value, G_TYPE_INT);
+
+	g_value_init (value, property_class->pspec->value_type);
+
+	if (G_IS_PARAM_SPEC_ENUM(property_class->pspec))
+	{
+		gint eval = glade_property_class_make_enum_from_string
+			(property_class->pspec->value_type, string);
+		g_value_set_enum (value, eval);
+	}
+	else if (G_IS_PARAM_SPEC_FLAGS(property_class->pspec))
+	{
+		guint flags = glade_property_class_make_flags_from_string
+			(property_class->pspec->value_type, string);
+		g_value_set_flags (value, flags);
+	}
+	else if (G_IS_PARAM_SPEC_INT(property_class->pspec))
 		g_value_set_int (value, atoi (string));
-		break;
-	case GLADE_PROPERTY_TYPE_FLOAT:
-		g_value_init (value, G_TYPE_FLOAT);
+	else if (G_IS_PARAM_SPEC_UINT(property_class->pspec))
+		g_value_set_uint (value, atoi (string));
+	else if (G_IS_PARAM_SPEC_FLOAT(property_class->pspec))
 		g_value_set_float (value, (float) atof (string));
-		break;
-	case GLADE_PROPERTY_TYPE_BOOLEAN:
-		g_value_init (value, G_TYPE_BOOLEAN);
+	else if (G_IS_PARAM_SPEC_DOUBLE(property_class->pspec))
+		g_value_set_double (value, (float) atof (string));
+	else if (G_IS_PARAM_SPEC_STRING(property_class->pspec))
+		g_value_set_string (value, string);
+	else if (G_IS_PARAM_SPEC_CHAR(property_class->pspec))
+		g_value_set_char (value, string[0]);
+	else if (G_IS_PARAM_SPEC_UCHAR(property_class->pspec))
+		g_value_set_uchar (value, string[0]);
+	else if (G_IS_PARAM_SPEC_UNICHAR(property_class->pspec))
+		g_value_set_uint (value, g_utf8_get_char (string));
+	else if (G_IS_PARAM_SPEC_BOOLEAN(property_class->pspec))
+	{
 		if (strcmp (string, GLADE_TAG_TRUE) == 0)
 			g_value_set_boolean (value, TRUE);
 		else
 			g_value_set_boolean (value, FALSE);
-		break;
-	case GLADE_PROPERTY_TYPE_UNICHAR:
-		g_value_init (value, G_TYPE_UINT);
-		g_value_set_uint (value, g_utf8_get_char (string));
-		break;
-	case GLADE_PROPERTY_TYPE_DOUBLE:
-		g_value_init (value, G_TYPE_DOUBLE);
-		g_value_set_double (value, atof (string));
-		break;
-	case GLADE_PROPERTY_TYPE_STRING:
-		g_value_init (value, G_TYPE_STRING);
-		g_value_set_string (value, string);
-		break;
-	case GLADE_PROPERTY_TYPE_ENUM:
-		{
-			GList *list;
-			GladeChoice *choice;
-			gint i = 0;
-			gboolean found = FALSE;
-
-			list = g_list_first (property_class->choices);
-			while (list != NULL && !found) {
-				choice = (GladeChoice *) list->data;
-				if (!g_ascii_strcasecmp (string, choice->id)) {
-					g_value_init (value, property_class->enum_type);
-					g_value_set_enum (value, i);
-					found = TRUE;
-				}
-
-				list = g_list_next (list);
-				i++;
-			}
-			if (!found) {
-				g_warning ("Could not found choice for %s\n", string);
-				g_free (value);
-				value = NULL;
-			}
-		}
-		break;
-	case GLADE_PROPERTY_TYPE_FLAGS:
-		{
-			guint flags;
-
-			g_value_init (value, property_class->enum_type);
-			flags = glade_property_class_make_flags_from_string (property_class->enum_type, string);
-			g_value_set_flags (value, flags);
-		}
-	case GLADE_PROPERTY_TYPE_OBJECT:
-		break;
-	default: {
-		const char *typestr = glade_property_type_enum_to_string (type);
-		g_warning ("Could not make gvalue from string ->%s<- and type %s\n",
-			   string ? string : "(null)",
-			   typestr ? typestr : "(null)");
-		g_free (value);
-		value = NULL;
 	}
-	}
-
-	return value;
-}
-
-static gchar *
-glade_property_get_parameter_numeric_min (GParamSpec *spec)
-{
-	gchar *value = NULL;
-	
-	if (G_IS_PARAM_SPEC_INT (spec))
-		value = g_strdup_printf ("%d", G_PARAM_SPEC_INT (spec)->minimum);
-	else if (G_IS_PARAM_SPEC_UINT (spec))
-		value = g_strdup_printf ("%u", G_PARAM_SPEC_UINT (spec)->minimum);
-	else if (G_IS_PARAM_SPEC_FLOAT (spec))
-		value = g_strdup_printf ("%g", G_PARAM_SPEC_FLOAT (spec)->minimum);
-	else if (G_IS_PARAM_SPEC_DOUBLE (spec))
-		value = g_strdup_printf ("%g", G_PARAM_SPEC_DOUBLE (spec)->minimum);
 	else
-		g_warning ("glade_propery_get_parameter_numeric_item invalid ParamSpec (min)\n");
-
+		g_critical ("Unsupported pspec type %s",
+			    g_type_name(property_class->pspec->value_type));
 	return value;
 }
 
-static gchar *
-glade_property_get_parameter_numeric_max (GParamSpec *spec)
-{
-	gchar *value = NULL;
-	
-	if (G_IS_PARAM_SPEC_INT (spec))
-		value = g_strdup_printf ("%d", G_PARAM_SPEC_INT (spec)->maximum);
-	else if (G_IS_PARAM_SPEC_UINT (spec))
-		value = g_strdup_printf ("%u", G_PARAM_SPEC_UINT (spec)->maximum);
-	else if (G_IS_PARAM_SPEC_FLOAT (spec))
-		value = g_strdup_printf ("%g", G_PARAM_SPEC_FLOAT (spec)->maximum);
-	else if (G_IS_PARAM_SPEC_DOUBLE (spec))
-		value = g_strdup_printf ("%g", G_PARAM_SPEC_DOUBLE (spec)->maximum);
-	else 
-		g_warning ("glade_propery_get_parameter_numeric_item invalid ParamSpec (max)\n");
-
-	return value;
-}
-
-static GList *
-glade_property_get_parameters_numeric (GParamSpec *spec,
-				       GladePropertyClass *class)
-{
-	GladeParameter *parameter;
-	GList *list = NULL;
-
-	g_return_val_if_fail (G_IS_PARAM_SPEC_INT    (spec) |
-			      G_IS_PARAM_SPEC_UINT   (spec) |
-			      G_IS_PARAM_SPEC_FLOAT  (spec) |
-			      G_IS_PARAM_SPEC_DOUBLE (spec), NULL);
-
-	/* Get the min value */
-	parameter = glade_parameter_new ();
-	parameter->key = g_strdup ("Min");
-	parameter->value = glade_property_get_parameter_numeric_min (spec);
-	list = g_list_prepend (list, parameter);
-	
-	/* Get the max value */
-	parameter = glade_parameter_new ();
-	parameter->key = g_strdup ("Max");
-	parameter->value = glade_property_get_parameter_numeric_max (spec);
-	list = g_list_prepend (list, parameter);
-
-	return list;
-}
-
 /**
  * glade_property_class_new_from_spec:
  * @spec:
@@ -645,11 +438,14 @@ glade_property_class_new_from_spec (GPar
 
 	property_class = glade_property_class_new ();
 
-	property_class->type = glade_property_class_get_type_from_spec (spec);
-	if (property_class->type == GLADE_PROPERTY_TYPE_ERROR)
-		/* no warnings, there are properties that we don't edit */
-		goto lblError;
+	property_class->pspec = spec;
 
+	/* We dont edit objects or pointers as properties.
+	 */
+	if (G_IS_PARAM_SPEC_OBJECT(property_class->pspec) ||
+	    G_IS_PARAM_SPEC_POINTER(property_class->pspec))
+		goto lblError;
+	
 	property_class->id = g_strdup (spec->name);
 	property_class->name = g_strdup (g_param_spec_get_nick (spec));
 	if (!property_class->id || !property_class->name)
@@ -661,38 +457,9 @@ glade_property_class_new_from_spec (GPar
 	property_class->tooltip = g_strdup (g_param_spec_get_blurb (spec));
 	property_class->def = glade_property_class_get_default_from_spec (spec, property_class);
 
-	switch (property_class->type)
-	{
-	case GLADE_PROPERTY_TYPE_ENUM:
-		property_class->choices = glade_choice_list_new_from_spec (spec);
-		property_class->enum_type = spec->value_type;
-		break;
-	case GLADE_PROPERTY_TYPE_FLAGS:
-		property_class->enum_type = spec->value_type;
-		break;
-	case GLADE_PROPERTY_TYPE_STRING:
-		break;
-	case GLADE_PROPERTY_TYPE_INTEGER:
-	case GLADE_PROPERTY_TYPE_FLOAT:
-	case GLADE_PROPERTY_TYPE_DOUBLE:
-		property_class->parameters = glade_property_get_parameters_numeric (spec, property_class);
-		break;
-	case GLADE_PROPERTY_TYPE_BOOLEAN:
-		break;
-	case GLADE_PROPERTY_TYPE_UNICHAR:
-		break;
-	case GLADE_PROPERTY_TYPE_OTHER_WIDGETS:
-		break;
-	case GLADE_PROPERTY_TYPE_OBJECT:
-//		break;
-		goto lblError; /* we don't support this */
-	case GLADE_PROPERTY_TYPE_ERROR:
-		break;
-	}
-
 	return property_class;
 
-lblError:
+  lblError:
 	glade_property_class_free (property_class);
 	return NULL;
 }
@@ -715,6 +482,7 @@ glade_property_class_is_visible (GladePr
 	return TRUE;
 }
 
+
 /**
  * glade_property_class_update_from_node:
  * @node: the <property> node
@@ -778,16 +546,12 @@ glade_property_class_update_from_node (G
 		class->name = buff;
 	}
 
-	/* ...the type... */
-	buff = glade_xml_get_value_string (node, GLADE_TAG_TYPE);
+	/* ...the spec... */
+	buff = glade_xml_get_value_string (node, GLADE_TAG_SPEC);
 	if (buff)
 	{
-		GladePropertyType type;
-		type = glade_property_type_str_to_enum (buff);
-		g_free (buff);
-		if (type == GLADE_PROPERTY_TYPE_ERROR)
-			return FALSE;
-		class->type = type;
+		class->pspec = glade_utils_get_pspec_from_funcname (buff);
+ 		g_free (buff);
 	}
 
 	/* ...and the tooltip */
@@ -803,39 +567,7 @@ glade_property_class_update_from_node (G
 	if (child)
 		class->parameters = glade_parameter_list_new_from_node (class->parameters, child);
 	glade_parameter_get_boolean (class->parameters, "Optional", &class->optional);
-
-	/* Get the choices */
-	do
-	{
-		if (class->type == GLADE_PROPERTY_TYPE_ENUM)
-		{
-			gchar *type_name;
-			GType type;
-
-			child = glade_xml_search_child (node, GLADE_TAG_ENUMS);
-			if (!child)
-				break;
-			class->choices = glade_choice_list_new_from_node (child);
-			type_name = glade_xml_get_property_string (child, "EnumType");
-			if (!type_name)
-				break;
-			type = g_type_from_name (type_name);
-			g_free (type_name);
-			if (!(type != 0))
-				break;
-			class->enum_type = type;
-		}
-	}
-	while (FALSE);
 		
-#if 0
-	/* If the property is an object load it */
-	if (class->type == GLADE_PROPERTY_TYPE_OBJECT) {
-		child = glade_xml_search_child (node, GLADE_TAG_GLADE_WIDGET_CLASS);
-		if (child)
-			class->child = glade_widget_class_new_from_node (child);
-	}
-#endif
 	/* Get the default */
 	buff = glade_xml_get_property_string (node, GLADE_TAG_DEFAULT);
 	if (buff)
@@ -858,7 +590,8 @@ glade_property_class_update_from_node (G
 	class->query    = glade_xml_get_property_boolean (node, GLADE_TAG_QUERY, FALSE);
 
 	if (class->optional)
-		class->optional_default = glade_xml_get_property_boolean (node, GLADE_TAG_OPTIONAL_DEFAULT, FALSE);
+		class->optional_default =
+			glade_xml_get_property_boolean (node, GLADE_TAG_OPTIONAL_DEFAULT, FALSE);
 
 	/* If this property can't be set with g_object_set, get the work around
 	 * function
@@ -875,13 +608,18 @@ glade_property_class_update_from_node (G
 		gchar *symbol_name = glade_xml_get_content (child);
 
 		if (!widget_class->module)
-			g_warning (_("The property [%s] of the widget's class [%s] needs a special \"set\" function, but there is no library associated to this widget's class."),
+			g_warning (_("The property [%s] of the widget's class [%s] "
+				     "needs a special \"set\" function, but there is "
+				     "no library associated to this widget's class."),
 				   class->name, widget_class->name);
 
-		if (!g_module_symbol (widget_class->module, symbol_name, (gpointer *) &class->set_function))
-			g_warning (_("Unable to get the \"set\" function [%s] of the property [%s] of the widget's class [%s] from the module [%s]: %s"),
-				   symbol_name, class->name, widget_class->name, g_module_name (widget_class->module), g_module_error ());
-
+		if (!g_module_symbol (widget_class->module, symbol_name, (gpointer *)
+				      &class->set_function))
+			g_warning (_("Unable to get the \"set\" function [%s] of the "
+				     "property [%s] of the widget's class [%s] from "
+				     "the module [%s]: %s"),
+				   symbol_name, class->name, widget_class->name,
+				   g_module_name (widget_class->module), g_module_error ());
 		g_free (symbol_name);
 	}
 
@@ -894,13 +632,18 @@ glade_property_class_update_from_node (G
 		gchar *symbol_name = glade_xml_get_content (child);
 
 		if (!widget_class->module)
-			g_warning (_("The property [%s] of the widget's class [%s] needs a special \"get\" function, but there is no library associated to this widget's class."),
+			g_warning (_("The property [%s] of the widget's class [%s] needs a "
+				     "special \"get\" function, but there is no library "
+				     "associated to this widget's class."),
 				   class->name, widget_class->name);
 
-		if (!g_module_symbol(widget_class->module, symbol_name, (gpointer *) &class->get_function))
-			g_warning (_("Unable to get the \"get\" function [%s] of the property [%s] of the widget's class [%s] from the module [%s]: %s"),
-				   symbol_name, class->name, widget_class->name, g_module_name (widget_class->module), g_module_error ());
-
+		if (!g_module_symbol(widget_class->module, symbol_name,
+				     (gpointer *) &class->get_function))
+			g_warning (_("Unable to get the \"get\" function [%s] of the "
+				     "property [%s] of the widget's class [%s] from the "
+				     "module [%s]: %s"),
+				   symbol_name, class->name, widget_class->name,
+				   g_module_name (widget_class->module), g_module_error ());
 		g_free (symbol_name);
 	}
 
Index: src/glade-property-class.h
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-property-class.h,v
retrieving revision 1.33
diff -u -p -r1.33 glade-property-class.h
--- src/glade-property-class.h	28 Oct 2004 18:35:30 -0000	1.33
+++ src/glade-property-class.h	1 Nov 2004 21:20:30 -0000
@@ -4,21 +4,6 @@
 
 G_BEGIN_DECLS
 
-
-typedef enum {
-	GLADE_PROPERTY_TYPE_BOOLEAN,
-	GLADE_PROPERTY_TYPE_FLOAT,
-	GLADE_PROPERTY_TYPE_INTEGER,
-	GLADE_PROPERTY_TYPE_DOUBLE,
-	GLADE_PROPERTY_TYPE_STRING,
-	GLADE_PROPERTY_TYPE_UNICHAR,
-	GLADE_PROPERTY_TYPE_ENUM,
-	GLADE_PROPERTY_TYPE_FLAGS,
-	GLADE_PROPERTY_TYPE_OTHER_WIDGETS,
-	GLADE_PROPERTY_TYPE_OBJECT,
-	GLADE_PROPERTY_TYPE_ERROR
-} GladePropertyType;
-
 /* The GladeProperty object describes a settable parameter of a widget.
  * All entries that the user can change in the first page of the GladeEditor
  * make are a GladeProperty (except for the widget name)
@@ -104,8 +89,8 @@ typedef enum {
 
 struct _GladePropertyClass
 {
-	GladePropertyType type; /* The type of property from GladePropertyType
-				 */
+	GParamSpec *pspec; /* The type of property from GladePropertyType
+			    */
 
 	gchar *id;       /* The id of the property. Like "label" or "xpad"
 			  * this is a non-translatable string
@@ -128,16 +113,6 @@ struct _GladePropertyClass
 			    * for a type == CHOICE
 			    */
 
-	GList *choices;    /* list of GladeChoice items. This is only used
-			    * for propeties of type GLADE_PROPERTY_TYPE_CHOICE
-			    * and is NULL for other poperties.
-			    * [See glade-choice.h]
-			    */
-
-	GType enum_type;   /* If it is GLADE_PROPERTY_TYPE_ENUM or
-			    * GLADE_PROPERTY_TYPE_FLAGS, this holds
-			    * the GType of the enum or flags, otherwise it's 0.
-			    */
 	gboolean query; /* Whether we should explicitly ask the user about this property
 			 * when instantiating a widget with this property (through a popup
 			 * dialog).
@@ -152,15 +127,6 @@ struct _GladePropertyClass
 	gboolean optional_default; /* For optional values, what the default is */
 	gboolean construct_only; /* Whether this property is G_PARAM_CONSTRUCT_ONLY or not */
 	
-	
-	GladeWidgetClass *child; /* A  GladeWidgetClass pointer of objects
-				  * that we need to set for this widget
-				  * for example : GtkSpinButton has a Adjustment inside
-				  * a GtkCombo has an entry inside and a GtkClist which
-				  * makes a drop dowm menu. This is only valid with
-				  * the type is object.
-				  */
-
 	gboolean common; /* Common properties go in the common tab */
 	gboolean packing; /* Packing properties go in the packing tab */
 
@@ -192,8 +158,6 @@ void glade_property_class_free (GladePro
 
 gboolean glade_property_class_is_visible (GladePropertyClass *property_class, GladeWidgetClass *widget_class);
 
-gchar * glade_property_type_enum_to_string (GladePropertyType type);
-
 GValue * glade_property_class_make_gvalue_from_string (GladePropertyClass *property_class,
 						       const gchar *string);
 gchar *  glade_property_class_make_string_from_gvalue (GladePropertyClass *property_class,
Index: src/glade-property.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-property.c,v
retrieving revision 1.53
diff -u -p -r1.53 glade-property.c
--- src/glade-property.c	28 Oct 2004 18:35:30 -0000	1.53
+++ src/glade-property.c	1 Nov 2004 21:20:30 -0000
@@ -25,7 +25,6 @@
 #include <string.h>
 
 #include "glade.h"
-#include "glade-choice.h"
 #include "glade-widget.h"
 #include "glade-property.h"
 #include "glade-property-class.h"
@@ -56,16 +55,6 @@ glade_property_new (GladePropertyClass *
 	property->widget = widget;
 	property->value = g_new0 (GValue, 1);
 	property->enabled = TRUE;
-#if 0
-	property->child = NULL;
-
-	if (class->type == GLADE_PROPERTY_TYPE_OBJECT) {
-		property->child = glade_widget_new_from_class (class->child,
-							       widget->project,
-							       widget);
-		return property;
-	}
-#endif
 
 	/* Create an empty default if the class does not specify a default 
          * value */
@@ -75,31 +64,14 @@ glade_property_new (GladePropertyClass *
 		return property;
 	}
 
-	switch (class->type) {
-	case GLADE_PROPERTY_TYPE_DOUBLE:
-	case GLADE_PROPERTY_TYPE_INTEGER:
-	case GLADE_PROPERTY_TYPE_FLOAT:
+	if (G_IS_PARAM_SPEC_DOUBLE  (class->pspec) ||
+	    G_IS_PARAM_SPEC_FLOAT (class->pspec)   ||
+	    G_IS_PARAM_SPEC_INT (class->pspec)     ||
+	    G_IS_PARAM_SPEC_UINT (class->pspec))
 		property->enabled = class->optional_default;
-		/* Fall thru */
-	case GLADE_PROPERTY_TYPE_ENUM:
-	case GLADE_PROPERTY_TYPE_FLAGS:
-	case GLADE_PROPERTY_TYPE_BOOLEAN:
-	case GLADE_PROPERTY_TYPE_STRING:
-	case GLADE_PROPERTY_TYPE_UNICHAR:
-		g_value_init (property->value, class->def->g_type);
-		g_value_copy (class->def, property->value); // glade_property_set (property, class->def);
-		break;
-	case GLADE_PROPERTY_TYPE_OTHER_WIDGETS:
-#if 0	
-		value = g_strdup ("");
-#endif	
-		break;
-	case GLADE_PROPERTY_TYPE_OBJECT:
-		break;
-	case GLADE_PROPERTY_TYPE_ERROR:
-		g_warning ("Invalid Glade property type (%d)\n", class->type);
-		break;
-	}
+	
+	g_value_init (property->value, class->def->g_type);
+	g_value_copy (class->def, property->value);
 
 	return property;
 }
@@ -122,11 +94,6 @@ glade_property_free (GladeProperty *prop
 		property->value = NULL;
 	}
 
-#if 0
-	if (property->child)
-		g_warning ("Implemenet free property->child\n");
-#endif
-
 	g_free (property);
 }
 
@@ -263,7 +230,8 @@ glade_property_write (GladeXmlContext *c
 	if (!property->enabled)
 		return NULL;
 
-	if (!glade_property_class_is_visible (property->class, glade_widget_get_class (property->widget)))
+	if (!glade_property_class_is_visible (property->class,
+					      glade_widget_get_class (property->widget)))
 		return NULL;
 
 	node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY);
@@ -297,8 +265,9 @@ glade_property_write (GladeXmlContext *c
 
 	if (property->class->def)
 	{
-		default_str = glade_property_class_make_string_from_gvalue (property->class,
-									    property->class->def);
+		default_str =
+			glade_property_class_make_string_from_gvalue (property->class,
+								      property->class->def);
 		if (default_str && strcmp (tmp, default_str) == 0)
 		{
 			g_free (tmp);
Index: src/glade-utils.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-utils.c,v
retrieving revision 1.33
diff -u -p -r1.33 glade-utils.c
--- src/glade-utils.c	22 Oct 2004 16:19:39 -0000	1.33
+++ src/glade-utils.c	1 Nov 2004 21:20:30 -0000
@@ -60,6 +60,48 @@ glade_util_widget_set_tooltip (GtkWidget
 }
 
 /**
+ * glade_util_compose_get_type_func:
+ * @name:
+ *
+ * TODO: write me
+ *
+ * Returns:
+ */
+gchar *
+glade_util_compose_get_type_func (gchar *name)
+{
+	gchar *retval;
+	GString *tmp;
+	gint i = 1, j;
+
+	tmp = g_string_new (name);
+
+	while (tmp->str[i])
+	{
+		if (g_ascii_isupper (tmp->str[i]))
+		{
+			tmp = g_string_insert_c (tmp, i++, '_');
+
+			j = 0;
+			while (g_ascii_isupper (tmp->str[i++]))
+				j++;
+
+			if (j > 2)
+				g_string_insert_c (tmp, i-2, '_');
+
+			continue;
+		}
+		i++;
+	}
+
+	tmp = g_string_append (tmp, "_get_type");
+        retval = g_ascii_strdown (tmp->str, tmp->len);
+	g_string_free (tmp, TRUE);
+
+	return retval;
+}
+
+/**
  * glade_util_get_type_from_name:
  * @name:
  *
@@ -70,7 +112,7 @@ glade_util_widget_set_tooltip (GtkWidget
 GType
 glade_util_get_type_from_name (const gchar *name)
 {
-	static GModule *allsymbols;
+	static GModule *allsymbols = NULL;
 	GType (*get_type) ();
 	GType type;
 
@@ -93,16 +135,38 @@ glade_util_get_type_from_name (const gch
 		return 0;
 	}
 
-/* Disabled for GtkAdjustment, but i'd like to check for this somehow. Chema */
-#if 0	
-	if (!g_type_is_a (type, gtk_widget_get_type ())) {
-		g_warning (_("The loaded type is not a GtkWidget, while trying to load \"%s\""),
-			   class->name);
+	return type;
+}
+
+/**
+ * glade_utils_get_pspec_from_funcname:
+ * @name:
+ *
+ * TODO: write me
+ *
+ * Returns:
+ */
+GParamSpec *
+glade_utils_get_pspec_from_funcname (const gchar *funcname)
+{
+	static GModule *allsymbols     = NULL;
+	GParamSpec     *pspec          = NULL;
+	GParamSpec     *(*get_pspec)() = NULL;
+	
+	if (!allsymbols)
+		allsymbols = g_module_open (NULL, 0);
+
+	if (!g_module_symbol (allsymbols, funcname,
+			      (gpointer) &get_pspec)) {
+		g_warning (_("We could not find the symbol \"%s\""),
+			   funcname);
 		return FALSE;
 	}
-#endif
 
-	return type;
+	g_assert (get_pspec);
+	pspec = get_pspec ();
+
+	return pspec;
 }
 
 /**
@@ -921,3 +985,4 @@ glade_util_object_set_property (GObject 
 	else
 		g_object_set_property (object, property->class->id, value);
 }
+
Index: src/glade-utils.h
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-utils.h,v
retrieving revision 1.23
diff -u -p -r1.23 glade-utils.h
--- src/glade-utils.h	16 May 2004 19:40:04 -0000	1.23
+++ src/glade-utils.h	1 Nov 2004 21:20:30 -0000
@@ -9,7 +9,9 @@ G_BEGIN_DECLS
 
 
 void		glade_util_widget_set_tooltip	(GtkWidget *widget, const gchar *str);
+gchar          *glade_util_compose_get_type_func (gchar *name);
 GType		glade_util_get_type_from_name	(const gchar *name);
+GParamSpec     *glade_utils_get_pspec_from_funcname (const gchar *funcname);
 void		glade_util_ui_warn		(GtkWidget *parent, const gchar *warning);
 void		glade_util_flash_message	(GtkWidget *statusbar, 
 						 guint context_id,
Index: src/glade-widget-class.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-widget-class.c,v
retrieving revision 1.63
diff -u -p -r1.63 glade-widget-class.c
--- src/glade-widget-class.c	28 Oct 2004 18:35:30 -0000	1.63
+++ src/glade-widget-class.c	1 Nov 2004 21:20:30 -0000
@@ -47,40 +47,6 @@
 static GHashTable *widget_classes = NULL;
 
 
-static gchar *
-glade_widget_class_compose_get_type_func (GladeWidgetClass *class)
-{
-	gchar *retval;
-	GString *tmp;
-	gint i = 1, j;
-
-	tmp = g_string_new (class->name);
-
-	while (tmp->str[i])
-	{
-		if (g_ascii_isupper (tmp->str[i]))
-		{
-			tmp = g_string_insert_c (tmp, i++, '_');
-
-			j = 0;
-			while (g_ascii_isupper (tmp->str[i++]))
-				j++;
-
-			if (j > 2)
-				g_string_insert_c (tmp, i-2, '_');
-
-			continue;
-		}
-		i++;
-	}
-
-	tmp = g_string_append (tmp, "_get_type");
-        retval = g_ascii_strdown (tmp->str, tmp->len);
-	g_string_free (tmp, TRUE);
-
-	return retval;
-}
-
 /**
  * glade_widget_class_free:
  * @widget_class: a #GladeWidgetClass
@@ -702,7 +668,7 @@ glade_widget_class_new (const char *name
 	/* we can't just call g_type_from_name (name) to get the type, because
 	 * that only works for registered types, and the only way to register the
 	 * type is to call foo_bar_get_type() */
-	init_function_name = glade_widget_class_compose_get_type_func (widget_class);
+	init_function_name = glade_util_compose_get_type_func (widget_class->name);
 	if (!init_function_name)
 	{
 		g_warning (_("Not enough memory."));
Index: src/glade.h
===================================================================
RCS file: /cvs/gnome/glade3/src/glade.h,v
retrieving revision 1.35
diff -u -p -r1.35 glade.h
--- src/glade.h	6 May 2004 19:45:58 -0000	1.35
+++ src/glade.h	1 Nov 2004 21:20:30 -0000
@@ -58,6 +58,7 @@
 #define GLADE_TAG_OPTIONAL     "Optional"
 #define GLADE_TAG_OPTIONAL_DEFAULT "OptionalDefault"
 #define GLADE_TAG_TYPE         "Type"
+#define GLADE_TAG_SPEC         "Spec"
 #define GLADE_TAG_TOOLTIP      "Tooltip"
 #define GLADE_TAG_GTKARG       "GtkArg"
 #define GLADE_TAG_PARAMETERS   "Parameters"
Index: widgets/gtkbox.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtkbox.xml,v
retrieving revision 1.11
diff -u -p -r1.11 gtkbox.xml
--- widgets/gtkbox.xml	28 Oct 2004 18:36:41 -0000	1.11
+++ widgets/gtkbox.xml	1 Nov 2004 21:20:30 -0000
@@ -5,7 +5,7 @@
   <Properties>
 
     <Property Id="size" Name="Number of items" Query="TRUE" Default="3">
-      <Type>Integer</Type>
+      <Spec>glade_gtk_standard_int_spec</Spec>
       <Tooltip>The number of items in the box</Tooltip>
       <Parameters>
         <Parameter Key="Min" Value="2"/>
Index: widgets/gtkbutton.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtkbutton.xml,v
retrieving revision 1.16
diff -u -p -r1.16 gtkbutton.xml
--- widgets/gtkbutton.xml	6 May 2004 06:19:25 -0000	1.16
+++ widgets/gtkbutton.xml	1 Nov 2004 21:20:30 -0000
@@ -5,19 +5,12 @@
   <Properties>
 
     <Property Id="stock" Name="Stock Button" Default="glade-none">
-      <Type>Enum</Type>
-      <Enums EnumType="GtkReliefStyle">
-        <Enum Id="glade-none" Name="None"/>
-        <Enum Id="gtk-ok"     Name="Ok"/>
-        <Enum Id="gtk-cancel" Name="Cancel"/>
-        <Enum Id="gtk-apply" Name="Apply"/>
-        <Enum Id="gtk-close" Name="Close"/>
-      </Enums>
+      <Spec>glade_gtk_stock_spec</Spec>
       <SetFunction>glade_gtk_button_set_stock</SetFunction>
     </Property>
 
     <Property Id="response-id" Name="Response ID" Default="0" Common="False">
-      <Type>Integer</Type>
+      <Spec>glade_gtk_standard_int_spec</Spec>
       <Tooltip>The response ID of this button in a dialog (it's NOT useful if this button is not in a GtkDialog)</Tooltip>
       <SetFunction>ignore</SetFunction>
       <GetFunction>ignore</GetFunction>
Index: widgets/gtkdialog.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtkdialog.xml,v
retrieving revision 1.9
diff -u -p -r1.9 gtkdialog.xml
--- widgets/gtkdialog.xml	6 May 2004 06:19:25 -0000	1.9
+++ widgets/gtkdialog.xml	1 Nov 2004 21:20:30 -0000
@@ -18,7 +18,7 @@
      So by now we will just add a fake response-id property to buttons
   <ChildProperties>
     <Property Id="response-id" Name="Response ID" Default="0" Common="False">
-      <Type>Integer</Type>
+      <Spec>glade_gtk_standard_int_spec</Spec>
       <Tooltip>The response ID of this button in the dialog</Tooltip>
       <SetFunction>ignore</SetFunction>
       <GetFunction>ignore</GetFunction>
Index: widgets/gtknotebook.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtknotebook.xml,v
retrieving revision 1.12
diff -u -p -r1.12 gtknotebook.xml
--- widgets/gtknotebook.xml	28 Oct 2004 18:36:41 -0000	1.12
+++ widgets/gtknotebook.xml	1 Nov 2004 21:20:30 -0000
@@ -5,7 +5,7 @@
   <Properties>
 
     <Property Id="pages" Name="Number of pages" Default="3" Query="TRUE">
-      <Type>Integer</Type>
+      <Spec>glade_gtk_standard_int_spec</Spec>
       <Tooltip>The number of pages in the notebook</Tooltip>
       <Parameters>
         <Parameter Key="Min" Value="1"/>
Index: widgets/gtkoptionmenu.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtkoptionmenu.xml,v
retrieving revision 1.6
diff -u -p -r1.6 gtkoptionmenu.xml
--- widgets/gtkoptionmenu.xml	13 Oct 2003 16:15:22 -0000	1.6
+++ widgets/gtkoptionmenu.xml	1 Nov 2004 21:20:30 -0000
@@ -7,7 +7,7 @@
 
     <Property Id="border-width"/>
     <Property Id="items" Name="Items">
-       <Type>String</Type>
+       <Spec>glade_gtk_standard_string_spec</Spec>
 	  <SetFunction>glade_gtk_option_menu_set_items</SetFunction>
 	  <Parameters>
 	     <Parameter Key="VisibleLines" Value="2"/>
@@ -15,7 +15,7 @@
     </Property>
     <!--
     <Property ParamSpec="FALSE" Id="initial-choice" Name="Inital Choice">
-       <Type>Integer</Type>
+       <Spec>glade_gtk_standard_int_spec</Spec>
 	  <SetFunction>glade_gtk_option_menu_set_initial_choice</SetFunction>
     </Property>
     -->
Index: widgets/gtkradiobutton.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtkradiobutton.xml,v
retrieving revision 1.9
diff -u -p -r1.9 gtkradiobutton.xml
--- widgets/gtkradiobutton.xml	6 Oct 2004 20:08:53 -0000	1.9
+++ widgets/gtkradiobutton.xml	1 Nov 2004 21:20:30 -0000
@@ -4,7 +4,7 @@
     <Property Id="label" Default="radio button"/>
     <Property Id="draw-indicator" Default="True"/>
     <Property Id="group" Name="Group" Default="True">
-      <Type>String</Type>
+      <Spec>glade_gtk_standard_string_spec</Spec>
       <SetFunction>glade_gtk_radio_button_set_group</SetFunction>
       <GetFunction>glade_gtk_radio_button_get_group</GetFunction>
     </Property>
Index: widgets/gtkspinbutton.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtkspinbutton.xml,v
retrieving revision 1.12
diff -u -p -r1.12 gtkspinbutton.xml
--- widgets/gtkspinbutton.xml	13 Oct 2003 16:15:22 -0000	1.12
+++ widgets/gtkspinbutton.xml	1 Nov 2004 21:20:30 -0000
@@ -3,23 +3,23 @@
   <Properties>
 
     <Property Id="minimum" Name="Min" Default="0">
-      <Type>Float</Type>
+      <Spec>glade_gtk_standard_float_spec</Spec>
       <SetFunction>glade_gtk_spin_button_set_min</SetFunction>
     </Property>
     <Property Id="maximum" Name="Max" Default="100">
-      <Type>Float</Type>
+      <Spec>glade_gtk_standard_float_spec</Spec>
       <SetFunction>glade_gtk_spin_button_set_max</SetFunction>
     </Property>
     <Property Id="step-increment" Name="Step Inc." Default="1">
-      <Type>Float</Type>
+      <Spec>glade_gtk_standard_float_spec</Spec>
       <SetFunction>glade_gtk_spin_button_set_step_increment</SetFunction>
     </Property>
     <Property Id="page-increment" Name="Page Inc." Default="10">
-      <Type>Float</Type>
+      <Spec>glade_gtk_standard_float_spec</Spec>
       <SetFunction>glade_gtk_spin_button_set_step_increment</SetFunction>
     </Property>
     <Property Id="page-size" Name="Page Size" Default="10">
-      <Type>Float</Type>
+      <Spec>glade_gtk_standard_float_spec</Spec>
       <SetFunction>glade_gtk_spin_button_set_step_increment</SetFunction>
     </Property>
 
Index: widgets/gtktoolbar.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtktoolbar.xml,v
retrieving revision 1.3
diff -u -p -r1.3 gtktoolbar.xml
--- widgets/gtktoolbar.xml	14 Nov 2003 18:41:59 -0000	1.3
+++ widgets/gtktoolbar.xml	1 Nov 2004 21:20:30 -0000
@@ -3,7 +3,7 @@
   <Properties>
 
     <Property Id="size" Name="Size" Default="3">
-      <Type>Integer</Type>
+      <Spec>glade_gtk_standard_int_spec</Spec>
       <Tooltip>The number of items in the toolbar</Tooltip>
       <Parameters>
         <Parameter Key="Min" Value="0"/>
Index: widgets/gtkwidget.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtkwidget.xml,v
retrieving revision 1.6
diff -u -p -r1.6 gtkwidget.xml
--- widgets/gtkwidget.xml	6 May 2004 06:19:25 -0000	1.6
+++ widgets/gtkwidget.xml	1 Nov 2004 21:20:30 -0000
@@ -11,7 +11,7 @@
 	<Property Common="True" Optional="True" OptionalDefault="False" Default="0" Id="height-request"/>
 
     <Property Common="True" Id="tooltip" Name="Tooltip" Visible="glade_gtk_widget_condition">
-      <Type>String</Type>
+      <Spec>glade_gtk_standard_string_spec</Spec>
       <SetFunction>glade_gtk_widget_set_tooltip</SetFunction>
       <GetFunction>glade_gtk_widget_get_tooltip</GetFunction>
     </Property>
