glade3 r1764 - in trunk: . gladeui plugins/gtk+



Author: tvb
Date: Thu Apr  3 20:52:40 2008
New Revision: 1764
URL: http://svn.gnome.org/viewvc/glade3?rev=1764&view=rev

Log:
merging builder branch into trunk


A    plugins/gtk+/glade-keysyms.c
M    plugins/gtk+/glade-gtk.c
M    plugins/gtk+/gtk+.xml.in
A    plugins/gtk+/glade-accels.c
M    plugins/gtk+/Makefile.am
A    plugins/gtk+/glade-accels.h
M    ChangeLog
M    gladeui/glade-editor.c
M    gladeui/glade-editor-property.c
M    gladeui/glade-editor-property.h
M    gladeui/glade-widget.c
M    gladeui/glade-widget.h
M    gladeui/glade-widget-adaptor.c
M    gladeui/glade-command.c
M    gladeui/glade-widget-adaptor.h
M    gladeui/glade-parser.c
M    gladeui/glade-xml-utils.c
M    gladeui/glade-base-editor.c
M    gladeui/glade-utils.c
D    gladeui/glade-parser.h
M    gladeui/glade-signal-editor.c
M    gladeui/glade-xml-utils.h
D    gladeui/glade-keysyms.c
M    gladeui/glade-property.c
M    gladeui/glade-property-class.c
M    gladeui/glade-property.h
M    gladeui/glade-builtins.c
M    gladeui/glade-property-class.h
M    gladeui/glade-builtins.h
M    gladeui/glade-project.c
M    gladeui/glade-signal.c
M    gladeui/Makefile.am
M    gladeui/glade-signal.h


Added:
   trunk/plugins/gtk+/glade-accels.c
      - copied unchanged from r1763, /branches/builder/plugins/gtk+/glade-accels.c
   trunk/plugins/gtk+/glade-accels.h
      - copied unchanged from r1763, /branches/builder/plugins/gtk+/glade-accels.h
   trunk/plugins/gtk+/glade-keysyms.c
      - copied unchanged from r1763, /branches/builder/plugins/gtk+/glade-keysyms.c
Removed:
   trunk/gladeui/glade-keysyms.c
   trunk/gladeui/glade-parser.h
Modified:
   trunk/ChangeLog
   trunk/gladeui/Makefile.am
   trunk/gladeui/glade-base-editor.c
   trunk/gladeui/glade-builtins.c
   trunk/gladeui/glade-builtins.h
   trunk/gladeui/glade-command.c
   trunk/gladeui/glade-editor-property.c
   trunk/gladeui/glade-editor-property.h
   trunk/gladeui/glade-editor.c
   trunk/gladeui/glade-parser.c
   trunk/gladeui/glade-project.c
   trunk/gladeui/glade-property-class.c
   trunk/gladeui/glade-property-class.h
   trunk/gladeui/glade-property.c
   trunk/gladeui/glade-property.h
   trunk/gladeui/glade-signal-editor.c
   trunk/gladeui/glade-signal.c
   trunk/gladeui/glade-signal.h
   trunk/gladeui/glade-utils.c
   trunk/gladeui/glade-widget-adaptor.c
   trunk/gladeui/glade-widget-adaptor.h
   trunk/gladeui/glade-widget.c
   trunk/gladeui/glade-widget.h
   trunk/gladeui/glade-xml-utils.c
   trunk/gladeui/glade-xml-utils.h
   trunk/plugins/gtk+/Makefile.am
   trunk/plugins/gtk+/glade-gtk.c
   trunk/plugins/gtk+/gtk+.xml.in

Modified: trunk/gladeui/Makefile.am
==============================================================================
--- trunk/gladeui/Makefile.am	(original)
+++ trunk/gladeui/Makefile.am	Thu Apr  3 20:52:40 2008
@@ -51,10 +51,8 @@
 	glade-id-allocator.h \
 	glade-marshallers.c \
 	glade-accumulators.c \
-	glade-parser.c \
 	glade-builtins.c \
 	glade-app.c \
-	glade-keysyms.c \
 	glade-fixed.c \
 	glade-base-editor.c \
 	glade-palette-item.h \
@@ -110,11 +108,10 @@
 	glade-fixed.h \
 	glade-base-editor.h \
 	glade-xml-utils.h \
-	glade-parser.h \
 	glade-signal.h \
 	glade-cursor.h \
 	glade-widget-action.h
-	
+
 
 if PLATFORM_WIN32
 libgladeui_1_la_LDFLAGS += -no-undefined

Modified: trunk/gladeui/glade-base-editor.c
==============================================================================
--- trunk/gladeui/glade-base-editor.c	(original)
+++ trunk/gladeui/glade-base-editor.c	Thu Apr  3 20:52:40 2008
@@ -1675,7 +1675,7 @@
 	
 	while (property)
 	{
-		eprop = glade_editor_property_new_from_widget (gchild, property, packing, TRUE);
+		eprop = glade_widget_create_editor_property (gchild, property, packing, TRUE);
 		if (eprop)
 			glade_base_editor_table_attach (editor, 
 							GLADE_EDITOR_PROPERTY (eprop)->item_label,

Modified: trunk/gladeui/glade-builtins.c
==============================================================================
--- trunk/gladeui/glade-builtins.c	(original)
+++ trunk/gladeui/glade-builtins.c	Thu Apr  3 20:52:40 2008
@@ -41,15 +41,6 @@
 			     */
 };
 
-struct _GladeParamSpecAccel {
-	GParamSpec    parent_instance;
-	
-	GType         type; /* The type this accel key is for; this allows
-			     * us to verify the validity of any signals for
-			     * this type.
-			     */
-};
-
 typedef struct _GladeStockItem {
 	gchar *value_name;
 	gchar *value_nick;
@@ -277,10 +268,9 @@
 				  0, G_PARAM_READWRITE);
 }
 
-
 /****************************************************************
  *  A GList boxed type used by GladeParamSpecObjects and        *
- *  GladeParamSpecAccel                                         *
+ *  GladeParamSpecAccel (which is now in the glade-gtk backend) *
  ****************************************************************/
 GType
 glade_glist_get_type (void)
@@ -295,180 +285,6 @@
 	return type_id;
 }
 
-GList *
-glade_accel_list_copy (GList *accels)
-{
-	GList          *ret = NULL, *list;
-	GladeAccelInfo *info, *dup_info;
-
-	for (list = accels; list; list = list->next)
-	{
-		info = list->data;
-
-		dup_info            = g_new0 (GladeAccelInfo, 1);
-		dup_info->signal    = g_strdup (info->signal);
-		dup_info->key       = info->key;
-		dup_info->modifiers = info->modifiers;
-
-		ret = g_list_prepend (ret, dup_info);
-	}
-
-	return g_list_reverse (ret);
-}
-
-void
-glade_accel_list_free (GList *accels)
-{
-	GList          *list;
-	GladeAccelInfo *info;
-
-	for (list = accels; list; list = list->next)
-	{
-		info = list->data;
-
-		g_free (info->signal);
-		g_free (info);
-	}
-	g_list_free (accels);
-}
-
-GType
-glade_accel_glist_get_type (void)
-{
-	static GType type_id = 0;
-
-	if (!type_id)
-		type_id = g_boxed_type_register_static
-			("GladeAccelGList", 
-			 (GBoxedCopyFunc) glade_accel_list_copy,
-			 (GBoxedFreeFunc) glade_accel_list_free);
-	return type_id;
-}
-
-
-/****************************************************************
- *  Built-in GladeParamSpecAccel for accelerator properties     *
- ****************************************************************/
-gboolean
-glade_keyval_valid (guint val)
-{
-	gint i;
-
-	for (i = 0; GladeKeys[i].name != NULL; i++)
-	{
-		if (GladeKeys[i].value == val)
-			return TRUE;
-	}
-	return FALSE;
-}
-
-
-static void
-param_accel_init (GParamSpec *pspec)
-{
-	GladeParamSpecAccel *ospec = GLADE_PARAM_SPEC_ACCEL (pspec);
-	ospec->type = G_TYPE_OBJECT;
-}
-
-static void
-param_accel_set_default (GParamSpec *pspec,
-			 GValue     *value)
-{
-	if (value->data[0].v_pointer != NULL)
-	{
-		g_free (value->data[0].v_pointer);
-	}
-	value->data[0].v_pointer = NULL;
-}
-
-static gboolean
-param_accel_validate (GParamSpec *pspec,
-		      GValue     *value)
-{
-	/* GladeParamSpecAccel *aspec = GLADE_PARAM_SPEC_ACCEL (pspec); */
-	GList               *accels, *list, *toremove = NULL;
-	GladeAccelInfo      *info;
-
-	accels = value->data[0].v_pointer;
-
-	for (list = accels; list; list = list->next)
-	{
-		info = list->data;
-		
-		/* Is it an invalid key ? */
-		if (glade_keyval_valid (info->key) == FALSE ||
-		    /* Does the modifier contain any unwanted bits ? */
-		    info->modifiers & GDK_MODIFIER_MASK ||
-		    /* Do we have a signal ? */
-		    /* FIXME: Check if the signal is valid for 'type' */
-		    info->signal == NULL)
-			toremove = g_list_prepend (toremove, info);
-	}
-
-	for (list = toremove; list; list = list->next)
-		accels = g_list_remove (accels, list->data);
-
-	if (toremove) g_list_free (toremove);
- 
-	value->data[0].v_pointer = accels;
-
-	return toremove != NULL;
-}
-
-static gint
-param_accel_values_cmp (GParamSpec   *pspec,
-			  const GValue *value1,
-			  const GValue *value2)
-{
-  guint8 *p1 = value1->data[0].v_pointer;
-  guint8 *p2 = value2->data[0].v_pointer;
-
-  /* not much to compare here, try to at least provide stable lesser/greater result */
-
-  return p1 < p2 ? -1 : p1 > p2;
-}
-
-GType
-glade_param_accel_get_type (void)
-{
-	static GType accel_type = 0;
-
-	if (accel_type == 0)
-	{
-		static /* const */ GParamSpecTypeInfo pspec_info = {
-			sizeof (GladeParamSpecAccel),  /* instance_size */
-			16,                         /* n_preallocs */
-			param_accel_init,         /* instance_init */
-			0xdeadbeef,                 /* value_type, assigned further down */
-			NULL,                       /* finalize */
-			param_accel_set_default,  /* value_set_default */
-			param_accel_validate,     /* value_validate */
-			param_accel_values_cmp,   /* values_cmp */
-		};
-		pspec_info.value_type = GLADE_TYPE_ACCEL_GLIST;
-
-		accel_type = g_param_type_register_static
-			("GladeParamAccel", &pspec_info);
-	}
-	return accel_type;
-}
-
-GParamSpec *
-glade_param_spec_accel (const gchar   *name,
-			const gchar   *nick,
-			const gchar   *blurb,
-			GType          widget_type,
-			GParamFlags    flags)
-{
-  GladeParamSpecAccel *pspec;
-
-  pspec = g_param_spec_internal (GLADE_TYPE_PARAM_ACCEL,
-				 name, nick, blurb, flags);
-  
-  pspec->type = widget_type;
-  return G_PARAM_SPEC (pspec);
-}
-
 /****************************************************************
  *  Built-in GladeParamSpecObjects for object list properties   *
  *  (Used as a pspec to desctibe an AtkRelationSet, but can     *
@@ -628,16 +444,6 @@
 				     G_PARAM_READWRITE);
 }
 
-/* Accelerator spec */
-GParamSpec *
-glade_standard_accel_spec (void)
-{
-	return glade_param_spec_accel ("accelerators", _("Accelerators"),
-				       _("A list of accelerator keys"), 
-				       GTK_TYPE_WIDGET,
-				       G_PARAM_READWRITE);
-}
-
 /****************************************************************
  *                    Basic types follow                        *
  ****************************************************************/
@@ -692,31 +498,6 @@
 				     G_PARAM_READWRITE);
 }
 
-guint
-glade_builtin_key_from_string (const gchar *string)
-{
-	gint i;
-
-	g_return_val_if_fail (string != NULL, 0);
-
-	for (i = 0; GladeKeys[i].name != NULL; i++)
-		if (!strcmp (string, GladeKeys[i].name))
-			return GladeKeys[i].value;
-
-	return 0;
-}
-
-const gchar *
-glade_builtin_string_from_key (guint key)
-{
-	gint i;
-
-	for (i = 0; GladeKeys[i].name != NULL; i++)
-		if (GladeKeys[i].value == key)
-			return GladeKeys[i].name;
-	return NULL;
-}
-
 GType
 glade_item_appearance_get_type (void)
 {

Modified: trunk/gladeui/glade-builtins.h
==============================================================================
--- trunk/gladeui/glade-builtins.h	(original)
+++ trunk/gladeui/glade-builtins.h	Thu Apr  3 20:52:40 2008
@@ -8,28 +8,12 @@
 G_BEGIN_DECLS
 
 typedef struct _GladeParamSpecObjects   GladeParamSpecObjects;
-typedef struct _GladeParamSpecAccel     GladeParamSpecAccel;
-typedef struct _GladeKey                GladeKey;
 
 
-struct _GladeKey {
-	guint  value;
-	gchar *name;
-};
-
-extern const GladeKey GladeKeys[];
-
-#define  GLADE_KEYS_LAST_ALPHANUM    "9"
-#define  GLADE_KEYS_LAST_EXTRA       "questiondown"
-#define  GLADE_KEYS_LAST_KP          "KP_9"
-#define  GLADE_KEYS_LAST_FKEY        "F35"
-
 #define GLADE_TYPE_STOCK               (glade_standard_stock_get_type())
 #define GLADE_TYPE_STOCK_IMAGE         (glade_standard_stock_image_get_type())
 #define	GLADE_TYPE_GLIST               (glade_glist_get_type())
-#define	GLADE_TYPE_ACCEL_GLIST         (glade_accel_glist_get_type())
 #define	GLADE_TYPE_PARAM_OBJECTS       (glade_param_objects_get_type())
-#define	GLADE_TYPE_PARAM_ACCEL         (glade_param_accel_get_type())
 #define GLADE_TYPE_ITEM_APPEARANCE     (glade_item_appearance_get_type())
 
 #define GLADE_IS_STOCK(pspec) \
@@ -45,42 +29,22 @@
         (G_TYPE_CHECK_INSTANCE_CAST ((pspec),  \
          GLADE_TYPE_PARAM_OBJECTS, GladeParamSpecObjects))
 
-#define GLADE_IS_PARAM_SPEC_ACCEL(pspec)       \
-        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec),  \
-         GLADE_TYPE_PARAM_ACCEL))
-#define GLADE_PARAM_SPEC_ACCEL(pspec)          \
-        (G_TYPE_CHECK_INSTANCE_CAST ((pspec),  \
-         GLADE_TYPE_PARAM_ACCEL, GladeParamSpecAccel))
-
 GType        glade_standard_stock_get_type       (void) G_GNUC_CONST;
 GType        glade_standard_stock_image_get_type (void) G_GNUC_CONST;
 GType        glade_glist_get_type                (void) G_GNUC_CONST;
-GType        glade_accel_glist_get_type          (void) G_GNUC_CONST;
 GType        glade_param_objects_get_type        (void) G_GNUC_CONST;
-GType        glade_param_accel_get_type          (void) G_GNUC_CONST;
 GType        glade_item_appearance_get_type      (void) G_GNUC_CONST;
 
 guint        glade_builtin_key_from_string (const gchar   *string);
 const gchar *glade_builtin_string_from_key (guint          key);
 
 
-GList       *glade_accel_list_copy         (GList         *accels);
-void         glade_accel_list_free         (GList         *accels);
-
-
-
 GParamSpec  *glade_param_spec_objects      (const gchar   *name,
 					    const gchar   *nick,
 					    const gchar   *blurb,
 					    GType          accepted_type,
 					    GParamFlags    flags);
 
-GParamSpec  *glade_param_spec_accel        (const gchar   *name,
-					    const gchar   *nick,
-					    const gchar   *blurb,
-					    GType          widget_type,
-					    GParamFlags    flags);
-
 void         glade_param_spec_objects_set_type (GladeParamSpecObjects *pspec,
 						GType                  type);
 GType        glade_param_spec_objects_get_type (GladeParamSpecObjects *pspec);
@@ -90,7 +54,6 @@
 GParamSpec  *glade_standard_objects_spec     (void);
 GParamSpec  *glade_standard_stock_spec       (void);
 GParamSpec  *glade_standard_stock_image_spec (void);
-GParamSpec  *glade_standard_accel_spec       (void);
 GParamSpec  *glade_standard_int_spec         (void);
 GParamSpec  *glade_standard_uint_spec        (void);
 GParamSpec  *glade_standard_string_spec      (void);
@@ -100,8 +63,6 @@
 
 void         glade_standard_stock_append_prefix (const gchar *prefix);
 
-gboolean     glade_keyval_valid              (guint val);
-
 G_END_DECLS
 
 #endif   /* __GLADE_BUILTINS_H__ */

Modified: trunk/gladeui/glade-command.c
==============================================================================
--- trunk/gladeui/glade-command.c	(original)
+++ trunk/gladeui/glade-command.c	Thu Apr  3 20:52:40 2008
@@ -364,8 +364,9 @@
 #if 0
 		{
 			gchar *str =
-				glade_property_class_make_string_from_gvalue 
-				(sdata->property->klass, &new_value);
+				glade_widget_adaptor_string_from_value
+				(GLADE_WIDGET_ADAPTOR (sdata->property->klass->handle),
+				 sdata->property->klass, &new_value);
 
 			g_print ("Setting %s property of %s to %s (sumode: %d)\n",
 				 sdata->property->klass->id,
@@ -550,8 +551,10 @@
 	else 
 	{
 		sdata = me->sdata->data;
-		value_name = glade_property_class_make_string_from_gvalue (sdata->property->klass, 
-									   sdata->new_value);
+		value_name = glade_widget_adaptor_string_from_value
+			(GLADE_WIDGET_ADAPTOR (sdata->property->klass->handle),
+			 sdata->property->klass, sdata->new_value);
+
 		if (!value_name || strlen (value_name) > MAX_UNDO_MENU_ITEM_VALUE_LEN
 		    || strchr (value_name, '_')) {
 			description = g_strdup_printf (_("Setting %s of %s"),

Modified: trunk/gladeui/glade-editor-property.c
==============================================================================
--- trunk/gladeui/glade-editor-property.c	(original)
+++ trunk/gladeui/glade-editor-property.c	Thu Apr  3 20:52:40 2008
@@ -70,61 +70,6 @@
 #define FLAGS_COLUMN_SETTING             0
 #define FLAGS_COLUMN_SYMBOL              1
 
-/*******************************************************************************
-                Boiler plate macros (inspired from glade-command.c)
- *******************************************************************************/
-#define MAKE_TYPE(func, type, parent)			\
-GType							\
-func ## _get_type (void)				\
-{							\
-	static GType cmd_type = 0;			\
-							\
-	if (!cmd_type)					\
-	{						\
-		static const GTypeInfo info =		\
-		{					\
-			sizeof (type ## Class),		\
-			(GBaseInitFunc) NULL,		\
-			(GBaseFinalizeFunc) NULL,	\
-			(GClassInitFunc) func ## _class_init,	\
-			(GClassFinalizeFunc) NULL,	\
-			NULL,				\
-			sizeof (type),			\
-			0,				\
-			(GInstanceInitFunc) NULL	\
-		};					\
-							\
-		cmd_type = g_type_register_static (parent, #type, &info, 0);	\
-	}						\
-							\
-	return cmd_type;				\
-}							\
-
-
-#define GLADE_MAKE_EPROP(type, func)					\
-static void								\
-func ## _finalize (GObject *object);					\
-static void								\
-func ## _load (GladeEditorProperty *me, GladeProperty *property);	\
-static GtkWidget *							\
-func ## _create_input (GladeEditorProperty *me);			\
-static void								\
-func ## _class_init (gpointer parent_tmp, gpointer notused)		\
-{									\
-	GladeEditorPropertyClass *parent = parent_tmp;			\
-	GObjectClass* object_class;					\
-	object_class = G_OBJECT_CLASS (parent);				\
-	parent->load =  func ## _load;					\
-	parent->create_input =  func ## _create_input;			\
-	object_class->finalize = func ## _finalize;			\
-}									\
-typedef struct {							\
-	GladeEditorPropertyClass cmd;					\
-} type ## Class;							\
-static MAKE_TYPE(func, type, GLADE_TYPE_EDITOR_PROPERTY)
-
-
-
 
 /*******************************************************************************
                                GladeEditorPropertyClass
@@ -134,9 +79,15 @@
 static void glade_editor_property_load_common (GladeEditorProperty *eprop, 
 					       GladeProperty       *property);
 
-/* For use in editor implementations
+/** 
+ * glade_editor_property_commit:
+ * @eprop: A #GladeEditorProperty
+ * @value: The #GValue
+ *
+ * Commits the value onto the widget and glade-command interface
+ * (for use in GladeEditorProperty implementations)
  */
-static void
+void
 glade_editor_property_commit (GladeEditorProperty *eprop,
 			      GValue              *value)
 {
@@ -596,7 +547,6 @@
 } GladeEPropNumeric;
 
 GLADE_MAKE_EPROP (GladeEPropNumeric, glade_eprop_numeric)
-#define GLADE_TYPE_EPROP_NUMERIC            (glade_eprop_numeric_get_type())
 #define GLADE_EPROP_NUMERIC(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_NUMERIC, GladeEPropNumeric))
 #define GLADE_EPROP_NUMERIC_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_NUMERIC, GladeEPropNumericClass))
 #define GLADE_IS_EPROP_NUMERIC(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_NUMERIC))
@@ -717,7 +667,6 @@
 } GladeEPropEnum;
 
 GLADE_MAKE_EPROP (GladeEPropEnum, glade_eprop_enum)
-#define GLADE_TYPE_EPROP_ENUM            (glade_eprop_enum_get_type())
 #define GLADE_EPROP_ENUM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_ENUM, GladeEPropEnum))
 #define GLADE_EPROP_ENUM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_ENUM, GladeEPropEnumClass))
 #define GLADE_IS_EPROP_ENUM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_ENUM))
@@ -871,7 +820,6 @@
 } GladeEPropFlags;
 
 GLADE_MAKE_EPROP (GladeEPropFlags, glade_eprop_flags)
-#define GLADE_TYPE_EPROP_FLAGS            (glade_eprop_flags_get_type())
 #define GLADE_EPROP_FLAGS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_FLAGS, GladeEPropFlags))
 #define GLADE_EPROP_FLAGS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_FLAGS, GladeEPropFlagsClass))
 #define GLADE_IS_EPROP_FLAGS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_FLAGS))
@@ -1160,7 +1108,6 @@
 } GladeEPropColor;
 
 GLADE_MAKE_EPROP (GladeEPropColor, glade_eprop_color)
-#define GLADE_TYPE_EPROP_COLOR            (glade_eprop_color_get_type())
 #define GLADE_EPROP_COLOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_COLOR, GladeEPropColor))
 #define GLADE_EPROP_COLOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_COLOR, GladeEPropColorClass))
 #define GLADE_IS_EPROP_COLOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_COLOR))
@@ -1187,8 +1134,9 @@
 	
 	if (property)
 	{
-		if ((text = glade_property_class_make_string_from_gvalue
-		     (eprop->klass, property->value)) != NULL)
+		if ((text = glade_widget_adaptor_string_from_value
+		     (GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
+		      eprop->klass, property->value)) != NULL)
 		{
 			gtk_entry_set_text (GTK_ENTRY (eprop_color->entry), text);
 			g_free (text);
@@ -1268,7 +1216,6 @@
 } GladeEPropNamedIcon;
 
 GLADE_MAKE_EPROP (GladeEPropNamedIcon, glade_eprop_named_icon)
-#define GLADE_TYPE_EPROP_NAMED_ICON            (glade_eprop_named_icon_get_type())
 #define GLADE_EPROP_NAMED_ICON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_NAMED_ICON, GladeEPropNamedIcon))
 #define GLADE_EPROP_NAMED_ICON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_NAMED_ICON, GladeEPropNamedIconClass))
 #define GLADE_IS_EPROP_NAMED_ICON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_NAMED_ICON))
@@ -1478,7 +1425,6 @@
 } GladeEPropText;
 
 GLADE_MAKE_EPROP (GladeEPropText, glade_eprop_text)
-#define GLADE_TYPE_EPROP_TEXT            (glade_eprop_text_get_type())
 #define GLADE_EPROP_TEXT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_TEXT, GladeEPropText))
 #define GLADE_EPROP_TEXT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_TEXT, GladeEPropTextClass))
 #define GLADE_IS_EPROP_TEXT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_TEXT))
@@ -1519,8 +1465,9 @@
 		if (G_VALUE_HOLDS (property->value, G_TYPE_STRV) ||
 		    G_VALUE_HOLDS (property->value, G_TYPE_VALUE_ARRAY))
 		{
-			gchar *text = glade_property_class_make_string_from_gvalue (
-						property->klass, property->value);
+			gchar *text = glade_widget_adaptor_string_from_value
+				(GLADE_WIDGET_ADAPTOR (property->klass->handle),
+				 property->klass, property->value);
 			gtk_text_buffer_set_text (buffer, text ? text : "", -1);
 			g_free (text);
 		}
@@ -1684,7 +1631,7 @@
 					  text,
 					  -1);
 	}
-	
+
 	/* Translatable and context prefix. */
 	hbox = gtk_hbox_new (FALSE, 12);
 	gtk_widget_show (hbox);
@@ -1757,7 +1704,8 @@
 	if (res == GTK_RESPONSE_OK) {
 		GtkTextIter start, end;
 		gboolean translatable, has_context;
-		
+
+
 		/* get the new values for translatable, has_context, and comment */
 		translatable = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (translatable_button));
 		has_context = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (context_button));
@@ -1777,11 +1725,6 @@
 		/* Text */
 		gtk_text_buffer_get_bounds (text_buffer, &start, &end);
 		str = gtk_text_buffer_get_text (text_buffer, &start, &end, TRUE);
-		if (str[0] == '\0')
-		{
-			g_free (str);
-			str = NULL;
-		}
 		
 		/* set the new text */
 		glade_eprop_text_changed_common (eprop, str, eprop->use_command);
@@ -1860,7 +1803,6 @@
 } GladeEPropBool;
 
 GLADE_MAKE_EPROP (GladeEPropBool, glade_eprop_bool)
-#define GLADE_TYPE_EPROP_BOOL            (glade_eprop_bool_get_type())
 #define GLADE_EPROP_BOOL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_BOOL, GladeEPropBool))
 #define GLADE_EPROP_BOOL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_BOOL, GladeEPropBoolClass))
 #define GLADE_IS_EPROP_BOOL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_BOOL))
@@ -1942,7 +1884,6 @@
 } GladeEPropUnichar;
 
 GLADE_MAKE_EPROP (GladeEPropUnichar, glade_eprop_unichar)
-#define GLADE_TYPE_EPROP_UNICHAR            (glade_eprop_unichar_get_type())
 #define GLADE_EPROP_UNICHAR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_UNICHAR, GladeEPropUnichar))
 #define GLADE_EPROP_UNICHAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_UNICHAR, GladeEPropUnicharClass))
 #define GLADE_IS_EPROP_UNICHAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_UNICHAR))
@@ -2072,7 +2013,6 @@
 } GladeEPropResource;
 
 GLADE_MAKE_EPROP (GladeEPropResource, glade_eprop_resource)
-#define GLADE_TYPE_EPROP_RESOURCE            (glade_eprop_resource_get_type())
 #define GLADE_EPROP_RESOURCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_RESOURCE, GladeEPropResource))
 #define GLADE_EPROP_RESOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_RESOURCE, GladeEPropResourceClass))
 #define GLADE_IS_EPROP_RESOURCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_RESOURCE))
@@ -2173,8 +2113,9 @@
 
 	if (property == NULL) return;
 
-	file  = glade_property_class_make_string_from_gvalue
-						(eprop->klass, property->value);
+	file = glade_widget_adaptor_string_from_value
+		(GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
+		 eprop->klass, property->value);
 	if (file)
 	{
 		gtk_entry_set_text (GTK_ENTRY (eprop_resource->entry), file);
@@ -2238,7 +2179,6 @@
 } GladeEPropObject;
 
 GLADE_MAKE_EPROP (GladeEPropObject, glade_eprop_object)
-#define GLADE_TYPE_EPROP_OBJECT            (glade_eprop_object_get_type())
 #define GLADE_EPROP_OBJECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_OBJECT, GladeEPropObject))
 #define GLADE_EPROP_OBJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_OBJECT, GladeEPropObjectClass))
 #define GLADE_IS_EPROP_OBJECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_OBJECT))
@@ -2682,8 +2622,9 @@
 
 	if (property == NULL) return;
 
-	if ((obj_name  = glade_property_class_make_string_from_gvalue
-	     (eprop->klass, property->value)) != NULL)
+	if ((obj_name = glade_widget_adaptor_string_from_value
+	     (GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
+	      eprop->klass, property->value)) != NULL)
 	{
 		gtk_entry_set_text (GTK_ENTRY (eprop_object->entry), obj_name);
 		g_free (obj_name);
@@ -2728,7 +2669,6 @@
 } GladeEPropObjects;
 
 GLADE_MAKE_EPROP (GladeEPropObjects, glade_eprop_objects)
-#define GLADE_TYPE_EPROP_OBJECTS            (glade_eprop_objects_get_type())
 #define GLADE_EPROP_OBJECTS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_OBJECTS, GladeEPropObjects))
 #define GLADE_EPROP_OBJECTS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_OBJECTS, GladeEPropObjectsClass))
 #define GLADE_IS_EPROP_OBJECTS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_OBJECTS))
@@ -2753,8 +2693,9 @@
 
 	if (property == NULL) return;
 
-	if ((obj_name  = glade_property_class_make_string_from_gvalue
-	     (eprop->klass, property->value)) != NULL)
+	if ((obj_name = glade_widget_adaptor_string_from_value
+	     (GLADE_WIDGET_ADAPTOR (eprop->klass->handle),
+	      eprop->klass, property->value)) != NULL)
 	{
 		gtk_entry_set_text (GTK_ENTRY (eprop_objects->entry), obj_name);
 		g_free (obj_name);
@@ -2913,7 +2854,6 @@
 } GladeEPropAdjustment;
 
 GLADE_MAKE_EPROP (GladeEPropAdjustment, glade_eprop_adjustment)
-#define GLADE_TYPE_EPROP_ADJUSTMENT            (glade_eprop_adjustment_get_type())
 #define GLADE_EPROP_ADJUSTMENT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_ADJUSTMENT, GladeEPropAdjustment))
 #define GLADE_EPROP_ADJUSTMENT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_ADJUSTMENT, GladeEPropAdjustmentClass))
 #define GLADE_IS_EPROP_ADJUSTMENT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_ADJUSTMENT))
@@ -3165,813 +3105,10 @@
 
 
 /*******************************************************************************
-                        GladeEditorPropertyAccelClass
- *******************************************************************************/
-enum {
-	ACCEL_COLUMN_SIGNAL = 0,
-	ACCEL_COLUMN_REAL_SIGNAL,
-	ACCEL_COLUMN_KEY,
-	ACCEL_COLUMN_MOD_SHIFT,
-	ACCEL_COLUMN_MOD_CNTL,
-	ACCEL_COLUMN_MOD_ALT,
-	ACCEL_COLUMN_IS_CLASS,
-	ACCEL_COLUMN_IS_SIGNAL,
-	ACCEL_COLUMN_KEY_ENTERED,
-	ACCEL_COLUMN_KEY_SLOT,
-	ACCEL_NUM_COLUMNS
-};
-
-enum {
-	ACCEL_COMBO_COLUMN_TEXT = 0,
-	ACCEL_COMBO_NUM_COLUMNS,
-};
-
-typedef struct {
-	GladeEditorProperty parent_instance;
-	
-	GtkWidget    *entry;
-	GList        *parent_iters;
-	GtkTreeModel *model;
-} GladeEPropAccel;
-
-typedef struct {
-	GtkTreeIter *iter;
-	gchar       *name; /* <-- dont free */
-} GladeEpropIterTab;
-
-
-static GtkTreeModel *keysyms_model   = NULL;
-
-GLADE_MAKE_EPROP (GladeEPropAccel, glade_eprop_accel)
-#define GLADE_TYPE_EPROP_ACCEL            (glade_eprop_accel_get_type())
-#define GLADE_EPROP_ACCEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_ACCEL, GladeEPropAccel))
-#define GLADE_EPROP_ACCEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_ACCEL, GladeEPropAccelClass))
-#define GLADE_IS_EPROP_ACCEL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_ACCEL))
-#define GLADE_IS_EPROP_ACCEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_EPROP_ACCEL))
-#define GLADE_EPROP_ACCEL_GET_CLASS(o)    (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_EPROP_ACCEL, GladeEPropAccelClass))
-
-
-static GtkTreeModel *
-create_keysyms_model (void)
-{
-	GtkTreeModel *model;
-	GtkTreeIter   iter, alphanum, fkey, keypad, other, extra;
-	GtkTreeIter  *parent;
-	gint          i;
-
-	model = (GtkTreeModel *)gtk_tree_store_new
-		(ACCEL_COMBO_NUM_COLUMNS,
-		 G_TYPE_STRING);       /* The Key charachter name */
-
-	gtk_tree_store_append (GTK_TREE_STORE (model), &alphanum, NULL);
-	gtk_tree_store_set    
-		(GTK_TREE_STORE (model), &alphanum, 
-		 ACCEL_COMBO_COLUMN_TEXT, _("Alphanumerical"), -1);
-
-	gtk_tree_store_append (GTK_TREE_STORE (model), &extra, NULL);
-	gtk_tree_store_set    
-		(GTK_TREE_STORE (model), &extra, 
-		 ACCEL_COMBO_COLUMN_TEXT, _("Extra"), -1);
-
-	gtk_tree_store_append (GTK_TREE_STORE (model), &keypad, NULL);
-	gtk_tree_store_set    
-		(GTK_TREE_STORE (model), &keypad, 
-		 ACCEL_COMBO_COLUMN_TEXT, _("Keypad"), -1);
-
-	gtk_tree_store_append (GTK_TREE_STORE (model), &fkey, NULL);
-	gtk_tree_store_set    
-		(GTK_TREE_STORE (model), &fkey, 
-		 ACCEL_COMBO_COLUMN_TEXT, _("Functions"), -1);
-	
-	gtk_tree_store_append (GTK_TREE_STORE (model), &other, NULL);
-	gtk_tree_store_set    
-		(GTK_TREE_STORE (model), &other, 
-		 ACCEL_COMBO_COLUMN_TEXT, _("Other"), -1);
-
-	parent = &alphanum;
-
-	for (i = 0; GladeKeys[i].name != NULL; i++)
-	{
-		gtk_tree_store_append (GTK_TREE_STORE (model), &iter, parent);
-		gtk_tree_store_set    
-			(GTK_TREE_STORE (model), &iter, 
-			 ACCEL_COMBO_COLUMN_TEXT, GladeKeys[i].name, -1);
-
-		if (!strcmp (GladeKeys[i].name, GLADE_KEYS_LAST_ALPHANUM))
-			parent = &extra;
-		else if (!strcmp (GladeKeys[i].name, GLADE_KEYS_LAST_EXTRA))
-			parent = &keypad;
-		else if (!strcmp (GladeKeys[i].name, GLADE_KEYS_LAST_KP))
-			parent = &fkey;
-		else if (!strcmp (GladeKeys[i].name, GLADE_KEYS_LAST_FKEY))
-			parent = &other;
-	}
-	return model;
-}
-
-static void
-glade_eprop_accel_finalize (GObject *object)
-{
-	/* Chain up */
-	G_OBJECT_CLASS (editor_property_class)->finalize (object);
-}
-
-static void
-glade_eprop_accel_load (GladeEditorProperty *eprop, 
-			GladeProperty       *property)
-{
-	GladeEPropAccel *eprop_accel = GLADE_EPROP_ACCEL (eprop);
-	gchar           *accels;
-
-	/* Chain up first */
-	editor_property_class->load (eprop, property);
-
-	if (property == NULL) return;
-
-	if ((accels  = glade_property_class_make_string_from_gvalue
-	     (eprop->klass, property->value)) != NULL)
-	{
-		gtk_entry_set_text (GTK_ENTRY (eprop_accel->entry), accels);
-		g_free (accels);
-	}
-	else
-		gtk_entry_set_text (GTK_ENTRY (eprop_accel->entry), "");
-
-}
-
-static gint
-eprop_find_iter (GladeEpropIterTab *iter_tab,
-		 gchar             *name)
-{
-	return strcmp (iter_tab->name, name);
-}
-
-static void
-iter_tab_free (GladeEpropIterTab *iter_tab)
-{
-	gtk_tree_iter_free (iter_tab->iter);
-	g_free (iter_tab);
-}
-
-static void
-glade_eprop_accel_populate_view (GladeEditorProperty *eprop,
-				 GtkTreeView         *view)
-{
-	GladeEPropAccel    *eprop_accel = GLADE_EPROP_ACCEL (eprop);
-	GladeSignalClass   *sclass;
-	GladeWidgetAdaptor *adaptor = glade_widget_adaptor_from_pclass (eprop->klass);
-	GtkTreeStore       *model = (GtkTreeStore *)gtk_tree_view_get_model (view);
-	GtkTreeIter         iter;
-	GladeEpropIterTab  *parent_tab;
-	GladeAccelInfo     *info;
-	GList              *list, *l, *found, *accelerators;
-	gchar              *name;
-
-	accelerators = g_value_get_boxed (eprop->property->value);
-
-	/* First make parent iters...
-	 */
-	for (list = adaptor->signals; list; list = list->next)
-	{
-		sclass = list->data;
-
-		/* Only action signals have accelerators. */
-		if ((sclass->query.signal_flags & G_SIGNAL_ACTION) == 0)
-			continue;
-
-		if (g_list_find_custom (eprop_accel->parent_iters, 
-					sclass->type,
-					(GCompareFunc)eprop_find_iter) == NULL)
-		{
-			gtk_tree_store_append (model, &iter, NULL);
-			gtk_tree_store_set (model, &iter,
-					    ACCEL_COLUMN_SIGNAL, sclass->type,
-					    ACCEL_COLUMN_IS_CLASS, TRUE,
-					    ACCEL_COLUMN_IS_SIGNAL, FALSE,
-					    -1);
-			
-			parent_tab = g_new0 (GladeEpropIterTab, 1);
-			parent_tab->name = sclass->type;
-			parent_tab->iter = gtk_tree_iter_copy (&iter);
-
-			eprop_accel->parent_iters = 
-				g_list_prepend (eprop_accel->parent_iters,
-						parent_tab);
-		}
-	}
-
-	/* Now we populate...
-	 */
-	for (list = adaptor->signals; list; list = list->next)
-	{
-		sclass = list->data;
-
-		/* Only action signals have accelerators. */
-		if ((sclass->query.signal_flags & G_SIGNAL_ACTION) == 0)
-			continue;
-
-		if ((found = g_list_find_custom (eprop_accel->parent_iters, 
-						 sclass->type,
-						 (GCompareFunc)eprop_find_iter)) != NULL)
-		{
-			parent_tab = found->data;
-			name       = g_strdup_printf ("    %s", sclass->name);
-
-			/* Populate from accelerator list
-			 */
-			for (l = accelerators; l; l = l->next)
-			{
-				info = l->data;
-
-				if (strcmp (info->signal, sclass->name))
-					continue;
-
-				gtk_tree_store_append (model, &iter, parent_tab->iter);
-				gtk_tree_store_set    
-					(model, &iter,
-					 ACCEL_COLUMN_SIGNAL, name,
-					 ACCEL_COLUMN_REAL_SIGNAL, sclass->name,
-					 ACCEL_COLUMN_IS_CLASS, FALSE,
-					 ACCEL_COLUMN_IS_SIGNAL, TRUE,
-					 ACCEL_COLUMN_MOD_SHIFT, 
-					 (info->modifiers & GDK_SHIFT_MASK) != 0,
-					 ACCEL_COLUMN_MOD_CNTL, 
-					 (info->modifiers & GDK_CONTROL_MASK) != 0,
-					 ACCEL_COLUMN_MOD_ALT,
-					 (info->modifiers & GDK_MOD1_MASK) != 0,
-					 ACCEL_COLUMN_KEY, 
-					 glade_builtin_string_from_key (info->key),
-					 ACCEL_COLUMN_KEY_ENTERED, TRUE,
-					 ACCEL_COLUMN_KEY_SLOT, FALSE,
-					 -1);
-			}
-
-			/* Append a new empty slot at the end */
-			gtk_tree_store_append (model, &iter, parent_tab->iter);
-			gtk_tree_store_set    
-				(model, &iter,
-				 ACCEL_COLUMN_SIGNAL, name,
-				 ACCEL_COLUMN_REAL_SIGNAL, sclass->name,
-				 ACCEL_COLUMN_IS_CLASS, FALSE,
-				 ACCEL_COLUMN_IS_SIGNAL, TRUE,
-				 ACCEL_COLUMN_MOD_SHIFT, FALSE,
-				 ACCEL_COLUMN_MOD_CNTL, FALSE,
-				 ACCEL_COLUMN_MOD_ALT, FALSE,
-				 ACCEL_COLUMN_KEY, _("<choose a key>"),
-				 ACCEL_COLUMN_KEY_ENTERED, FALSE,
-				 ACCEL_COLUMN_KEY_SLOT, TRUE,
-				 -1);
-
-			g_free (name);
-		}
-	}
-}
-
-static void
-key_edited (GtkCellRendererText *cell,
-	    const gchar         *path_string,
-	    const gchar         *new_text,
-	    GladeEditorProperty *eprop)
-{
-	GladeEPropAccel *eprop_accel = GLADE_EPROP_ACCEL (eprop);
-	gboolean         key_was_set;
-	const gchar     *text;
-	GtkTreeIter      iter, parent_iter, new_iter;
-
-	if (!gtk_tree_model_get_iter_from_string (eprop_accel->model,
-						  &iter, path_string))
-		return;
-
-	gtk_tree_model_get (eprop_accel->model, &iter,
-			    ACCEL_COLUMN_KEY_ENTERED, &key_was_set,
-			    -1);
-
-	/* If user selects "none"; remove old entry or ignore new one.
-	 */
-	if (!new_text || new_text[0] == '\0' ||
-	    glade_builtin_string_from_key ((guint)new_text[0]) == NULL ||
-	    g_utf8_collate (new_text, _("None")) == 0 ||
-	    g_utf8_collate (new_text, _("<choose a key>")) == 0)
-	{
-		if (key_was_set)
-			gtk_tree_store_remove
-				(GTK_TREE_STORE (eprop_accel->model), &iter);
-
-		return;
-	}
-
-	if (glade_builtin_key_from_string (new_text) != 0)
-		text = new_text;
-	else
-		text = glade_builtin_string_from_key ((guint)new_text[0]);
-
-	gtk_tree_store_set    
-		(GTK_TREE_STORE (eprop_accel->model), &iter,
-		 ACCEL_COLUMN_KEY, text,
-		 ACCEL_COLUMN_KEY_ENTERED, TRUE,
-		 ACCEL_COLUMN_KEY_SLOT, FALSE,
-		 -1);
-
-	/* Append a new one if needed
-	 */
-	if (key_was_set == FALSE &&
-	    gtk_tree_model_iter_parent (eprop_accel->model,
-					&parent_iter, &iter))
-	{	
-		gchar *signal, *real_signal;
-		
-		gtk_tree_model_get (eprop_accel->model, &iter,
-				    ACCEL_COLUMN_SIGNAL, &signal,
-				    ACCEL_COLUMN_REAL_SIGNAL, &real_signal,
-				    -1);
-		
-		/* Append a new empty slot at the end */
-		gtk_tree_store_insert_after (GTK_TREE_STORE (eprop_accel->model), 
-					     &new_iter, &parent_iter, &iter);
-		gtk_tree_store_set (GTK_TREE_STORE (eprop_accel->model), &new_iter,
-				    ACCEL_COLUMN_SIGNAL, signal,
-				    ACCEL_COLUMN_REAL_SIGNAL, real_signal,
-				    ACCEL_COLUMN_IS_CLASS, FALSE,
-				    ACCEL_COLUMN_IS_SIGNAL, TRUE,
-				    ACCEL_COLUMN_MOD_SHIFT, FALSE,
-				    ACCEL_COLUMN_MOD_CNTL, FALSE,
-				    ACCEL_COLUMN_MOD_ALT, FALSE,
-				    ACCEL_COLUMN_KEY, _("<choose a key>"),
-				    ACCEL_COLUMN_KEY_ENTERED, FALSE,
-				    ACCEL_COLUMN_KEY_SLOT, TRUE,
-				    -1);
-		g_free (signal);
-		g_free (real_signal);
-	}
-}
-
-static void
-modifier_toggled (GtkCellRendererToggle *cell,
-		  gchar                 *path_string,
-		  GladeEditorProperty   *eprop)
-{
-	GladeEPropAccel   *eprop_accel = GLADE_EPROP_ACCEL (eprop);
-	GtkTreeIter        iter;
-	gint               column;
-	gboolean           active, key_entered;
-
-	if (!gtk_tree_model_get_iter_from_string (eprop_accel->model,
-						  &iter, path_string))
-		return;
-
-	column = GPOINTER_TO_INT (g_object_get_data
-				  (G_OBJECT (cell), "model-column"));
-
-	gtk_tree_model_get
-		(eprop_accel->model, &iter,
-		 ACCEL_COLUMN_KEY_ENTERED, &key_entered,
-		 column, &active, -1);
-
-	if (key_entered)
-		gtk_tree_store_set
-			(GTK_TREE_STORE (eprop_accel->model), &iter,
-			 column, !active, -1);
-}
-
-
-static GtkWidget *
-glade_eprop_accel_view (GladeEditorProperty *eprop)
-{
-	GladeEPropAccel   *eprop_accel = GLADE_EPROP_ACCEL (eprop);
-	GtkWidget         *view_widget;
- 	GtkCellRenderer   *renderer;
-	GtkTreeViewColumn *column;
-
-	eprop_accel->model = (GtkTreeModel *)gtk_tree_store_new
-		(ACCEL_NUM_COLUMNS,
-		 G_TYPE_STRING,        /* The GSignal name formatted for display */
-		 G_TYPE_STRING,        /* The GSignal name */
-		 G_TYPE_STRING,        /* The Gdk keycode */
-		 G_TYPE_BOOLEAN,       /* The shift modifier */
-		 G_TYPE_BOOLEAN,       /* The cntl modifier */
-		 G_TYPE_BOOLEAN,       /* The alt modifier */
-		 G_TYPE_BOOLEAN,       /* Whether this is a class entry */
-		 G_TYPE_BOOLEAN,       /* Whether this is a signal entry (oposite of above) */
-		 G_TYPE_BOOLEAN,       /* Whether the key has been entered for this row */
-		 G_TYPE_BOOLEAN);      /* Oposite of above */
-
-	view_widget = gtk_tree_view_new_with_model (eprop_accel->model);
-	g_object_set (G_OBJECT (view_widget), "enable-search", FALSE, NULL);
-	
-	/********************* fake invisible column *********************/
- 	renderer = gtk_cell_renderer_text_new ();
-	g_object_set (G_OBJECT (renderer), "editable", FALSE, "visible", FALSE, NULL);
-
-	column = gtk_tree_view_column_new_with_attributes (NULL, renderer, NULL);
- 	gtk_tree_view_append_column (GTK_TREE_VIEW (view_widget), column);
-
-	gtk_tree_view_column_set_visible (column, FALSE);
-	gtk_tree_view_set_expander_column (GTK_TREE_VIEW (view_widget), column);
-
-	/********************* signal name column *********************/
- 	renderer = gtk_cell_renderer_text_new ();
-	g_object_set (G_OBJECT (renderer), 
-		      "editable", FALSE, 
-		      "weight", PANGO_WEIGHT_BOLD,
-		      NULL);
-
-	column = gtk_tree_view_column_new_with_attributes
-		(_("Signal"),  renderer, 
-		 "text", ACCEL_COLUMN_SIGNAL, 
-		 "weight-set", ACCEL_COLUMN_IS_CLASS,
-		 NULL);
-
-	g_object_set (G_OBJECT (column), "expand", TRUE, NULL);
-
- 	gtk_tree_view_append_column (GTK_TREE_VIEW (view_widget), column);
-
-	/********************* key name column *********************/
-	if (keysyms_model == NULL)
-		keysyms_model = create_keysyms_model ();
-
- 	renderer = gtk_cell_renderer_combo_new ();
-	g_object_set (G_OBJECT (renderer), 
-		      "editable",    TRUE,
-		      "model",       keysyms_model,
-		      "text-column", ACCEL_COMBO_COLUMN_TEXT,
-		      "has-entry",   TRUE,
-		      "style",       PANGO_STYLE_ITALIC,
-		      "foreground",  "Gray", 
-		      NULL);
-
-	g_signal_connect (renderer, "edited",
-			  G_CALLBACK (key_edited), eprop);
-
-	column = gtk_tree_view_column_new_with_attributes
-		(_("Key"),         renderer, 
-		 "text",           ACCEL_COLUMN_KEY,
-		 "style-set",      ACCEL_COLUMN_KEY_SLOT,
-		 "foreground-set", ACCEL_COLUMN_KEY_SLOT,
- 		 "visible",        ACCEL_COLUMN_IS_SIGNAL,
-		 NULL);
-
-	g_object_set (G_OBJECT (column), "expand", TRUE, NULL);
-
- 	gtk_tree_view_append_column (GTK_TREE_VIEW (view_widget), column);
-
-	/********************* shift modifier column *********************/
- 	renderer = gtk_cell_renderer_toggle_new ();
-	column   = gtk_tree_view_column_new_with_attributes
-		(_("Shift"),  renderer, 
-		 "visible", ACCEL_COLUMN_IS_SIGNAL,
-		 "sensitive", ACCEL_COLUMN_KEY_ENTERED,
-		 "active", ACCEL_COLUMN_MOD_SHIFT,
-		 NULL);
-
-	g_object_set_data (G_OBJECT (renderer), "model-column",
-			   GINT_TO_POINTER (ACCEL_COLUMN_MOD_SHIFT));
-	g_signal_connect (G_OBJECT (renderer), "toggled",
-			  G_CALLBACK (modifier_toggled), eprop);
-
- 	gtk_tree_view_append_column (GTK_TREE_VIEW (view_widget), column);
-
-	/********************* control modifier column *********************/
- 	renderer = gtk_cell_renderer_toggle_new ();
-	column   = gtk_tree_view_column_new_with_attributes
-		(_("Control"),  renderer, 
-		 "visible", ACCEL_COLUMN_IS_SIGNAL,
-		 "sensitive", ACCEL_COLUMN_KEY_ENTERED,
-		 "active", ACCEL_COLUMN_MOD_CNTL,
-		 NULL);
-
-	g_object_set_data (G_OBJECT (renderer), "model-column",
-			   GINT_TO_POINTER (ACCEL_COLUMN_MOD_CNTL));
-	g_signal_connect (G_OBJECT (renderer), "toggled",
-			  G_CALLBACK (modifier_toggled), eprop);
-
- 	gtk_tree_view_append_column (GTK_TREE_VIEW (view_widget), column);
-
-	/********************* alt modifier column *********************/
- 	renderer = gtk_cell_renderer_toggle_new ();
-	column   = gtk_tree_view_column_new_with_attributes
-		(_("Alt"),  renderer, 
-		 "visible", ACCEL_COLUMN_IS_SIGNAL,
-		 "sensitive", ACCEL_COLUMN_KEY_ENTERED,
-		 "active", ACCEL_COLUMN_MOD_ALT,
-		 NULL);
-
-	g_object_set_data (G_OBJECT (renderer), "model-column",
-			   GINT_TO_POINTER (ACCEL_COLUMN_MOD_ALT));
-	g_signal_connect (G_OBJECT (renderer), "toggled",
-			  G_CALLBACK (modifier_toggled), eprop);
-
- 	gtk_tree_view_append_column (GTK_TREE_VIEW (view_widget), column);
-
-	return view_widget;
-}
-
-static gboolean
-glade_eprop_accel_accum_accelerators (GtkTreeModel  *model,
-				      GtkTreePath    *path,
-				      GtkTreeIter    *iter,
-				      GList         **ret)
-{
-	GladeAccelInfo *info;
-	gchar          *signal, *key_str;
-	gboolean        shift, cntl, alt, entered;
-
-	gtk_tree_model_get (model, iter, ACCEL_COLUMN_KEY_ENTERED, &entered, -1);
-	if (entered == FALSE) return FALSE;
-	
-	gtk_tree_model_get (model, iter,
-			    ACCEL_COLUMN_REAL_SIGNAL, &signal,
-			    ACCEL_COLUMN_KEY,         &key_str,
-			    ACCEL_COLUMN_MOD_SHIFT,   &shift,
-			    ACCEL_COLUMN_MOD_CNTL,    &cntl,
-			    ACCEL_COLUMN_MOD_ALT,     &alt,
-			    -1);
-
-	info            = g_new0 (GladeAccelInfo, 1);
-	info->signal    = signal;
-	info->key       = glade_builtin_key_from_string (key_str);
-	info->modifiers = (shift ? GDK_SHIFT_MASK   : 0) |
-			  (cntl  ? GDK_CONTROL_MASK : 0) |
-			  (alt   ? GDK_MOD1_MASK    : 0);
-
-	*ret = g_list_prepend (*ret, info);
-
-	g_free (key_str);
-	
-	return FALSE;
-}
-
-
-static void
-glade_eprop_accel_show_dialog (GtkWidget           *dialog_button,
-			       GladeEditorProperty *eprop)
-{
-	GladeEPropAccel  *eprop_accel = GLADE_EPROP_ACCEL (eprop);
-	GtkWidget        *dialog, *parent, *vbox, *sw, *tree_view;
-	GladeProject     *project;
-	GValue           *value;
-	GList            *accelerators = NULL;
-	gint              res;
-	
-	project = glade_widget_get_project (eprop->property->widget);
-	parent = gtk_widget_get_toplevel (GTK_WIDGET (eprop));
-
-	dialog = gtk_dialog_new_with_buttons (_("Choose accelerator keys..."),
-					      GTK_WINDOW (parent),
-					      GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-					      GTK_STOCK_CLEAR, GLADE_RESPONSE_CLEAR,
-					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-					      GTK_STOCK_OK, GTK_RESPONSE_OK,
-					      NULL);
-
-	gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-
-	vbox = gtk_vbox_new (FALSE, 6);
-	gtk_widget_show (vbox);
-
-	gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
-
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, TRUE, TRUE, 0);
-
-	sw = gtk_scrolled_window_new (NULL, NULL);
-	gtk_widget_show (sw);
-	gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
-	gtk_widget_set_size_request (sw, 400, 200);
-	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
-					GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
-
-	tree_view = glade_eprop_accel_view (eprop);
-	glade_eprop_accel_populate_view (eprop, GTK_TREE_VIEW (tree_view));
-
-	gtk_tree_view_expand_all (GTK_TREE_VIEW (tree_view));
-
-	gtk_widget_show (tree_view);
-	gtk_container_add (GTK_CONTAINER (sw), tree_view);
-	
-	/* Run the dialog */
-	res = gtk_dialog_run (GTK_DIALOG (dialog));
-	if (res == GTK_RESPONSE_OK) 
-	{
-		gtk_tree_model_foreach
-			(gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)),
-			 (GtkTreeModelForeachFunc)
-			 glade_eprop_accel_accum_accelerators, &accelerators);
-		
-		value = g_new0 (GValue, 1);
-		g_value_init (value, GLADE_TYPE_ACCEL_GLIST);
-		g_value_take_boxed (value, accelerators);
-
-		glade_editor_property_commit (eprop, value);
-
-		g_value_unset (value);
-		g_free (value);
-	} 
-	else if (res == GLADE_RESPONSE_CLEAR)
-	{
-		value = g_new0 (GValue, 1);
-		g_value_init (value, GLADE_TYPE_ACCEL_GLIST);
-		g_value_set_boxed (value, NULL);
-
-		glade_editor_property_commit (eprop, value);
-
-		g_value_unset (value);
-		g_free (value);
-	}
-
-	/* Clean up ...
-	 */
-	gtk_widget_destroy (dialog);
-
-	g_object_unref (G_OBJECT (eprop_accel->model));
-	eprop_accel->model = NULL;
-
-	if (eprop_accel->parent_iters)
-	{
-		g_list_foreach (eprop_accel->parent_iters, (GFunc)iter_tab_free, NULL);
-		g_list_free (eprop_accel->parent_iters);
-		eprop_accel->parent_iters = NULL;
-	}
-
-}
-
-static GtkWidget *
-glade_eprop_accel_create_input (GladeEditorProperty *eprop)
-{
-	GladeEPropAccel *eprop_accel = GLADE_EPROP_ACCEL (eprop);
-	GtkWidget        *hbox;
-	GtkWidget        *button;
-
-	hbox               = gtk_hbox_new (FALSE, 0);
-	eprop_accel->entry = gtk_entry_new ();
-	gtk_entry_set_editable (GTK_ENTRY (eprop_accel->entry), FALSE);
-	gtk_widget_show (eprop_accel->entry);
-	gtk_box_pack_start (GTK_BOX (hbox), eprop_accel->entry, TRUE, TRUE, 0);
-
-	button = gtk_button_new_with_label ("...");
-	gtk_widget_show (button);
-	gtk_box_pack_start (GTK_BOX (hbox), button,  FALSE, FALSE, 0);
-
-	g_signal_connect (G_OBJECT (button), "clicked",
-			  G_CALLBACK (glade_eprop_accel_show_dialog), 
-			  eprop);
-
-	return hbox;
-}
-
-
-
-/*******************************************************************************
-                              Misc static stuff
- *******************************************************************************/
-static GType 
-glade_editor_property_type (GParamSpec *pspec)
-{
-	GType type = 0;
-
-	if (pspec->value_type == GLADE_TYPE_STOCK ||
-	    G_IS_PARAM_SPEC_ENUM(pspec))
-		type = GLADE_TYPE_EPROP_ENUM;
-	else if (G_IS_PARAM_SPEC_FLAGS(pspec))
-		type = GLADE_TYPE_EPROP_FLAGS;
-	else if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec))
-	{
-		if (pspec->value_type == G_TYPE_VALUE_ARRAY)
-			type = GLADE_TYPE_EPROP_TEXT;
-	}
-	else if (G_IS_PARAM_SPEC_BOXED(pspec))
-	{
-		if (pspec->value_type == GDK_TYPE_COLOR)
-			type = GLADE_TYPE_EPROP_COLOR;
-		else if (pspec->value_type == G_TYPE_STRV)
-			type = GLADE_TYPE_EPROP_TEXT;
-	}
-	else if (G_IS_PARAM_SPEC_STRING(pspec))
-		type = GLADE_TYPE_EPROP_TEXT;
-	else if (G_IS_PARAM_SPEC_BOOLEAN(pspec))
-		type = GLADE_TYPE_EPROP_BOOL;
-	else if (G_IS_PARAM_SPEC_FLOAT(pspec)  ||
-		 G_IS_PARAM_SPEC_DOUBLE(pspec) ||
-		 G_IS_PARAM_SPEC_INT(pspec)    ||
-		 G_IS_PARAM_SPEC_UINT(pspec)   ||
-		 G_IS_PARAM_SPEC_LONG(pspec)   ||
-		 G_IS_PARAM_SPEC_ULONG(pspec)  ||
-		 G_IS_PARAM_SPEC_INT64(pspec)  ||
-		 G_IS_PARAM_SPEC_UINT64(pspec))
-		type = GLADE_TYPE_EPROP_NUMERIC;
-	else if (G_IS_PARAM_SPEC_UNICHAR(pspec))
-		type = GLADE_TYPE_EPROP_UNICHAR;
-	else if (G_IS_PARAM_SPEC_OBJECT(pspec))
-	{
-		if (pspec->value_type == GDK_TYPE_PIXBUF)
-			type = GLADE_TYPE_EPROP_RESOURCE;
-		else if (pspec->value_type == GTK_TYPE_ADJUSTMENT)
-			type = GLADE_TYPE_EPROP_ADJUSTMENT;
-		else
-			type = GLADE_TYPE_EPROP_OBJECT;
-	}
-	else if (GLADE_IS_PARAM_SPEC_OBJECTS(pspec))
-		type = GLADE_TYPE_EPROP_OBJECTS;
-	else if (GLADE_IS_PARAM_SPEC_ACCEL(pspec))
-		type = GLADE_TYPE_EPROP_ACCEL;
-
-	return type;
-}
-
-/*******************************************************************************
                                      API
  *******************************************************************************/
 
 /**
- * glade_editor_property_new:
- * @klass: A #GladePropertyClass
- * @use_command: Whether the undo/redo stack applies here.
- *
- * This is a factory function to create the correct type of
- * editor property that can edit the said type of #GladePropertyClass
- *
- * Returns: A newly created GladeEditorProperty of the correct type
- */
-GladeEditorProperty *
-glade_editor_property_new (GladePropertyClass  *klass,
-			   gboolean             use_command)
-{
-	GladeEditorProperty *eprop;
-	GType                type = 0;
-
-	/* Find the right type of GladeEditorProperty for this
-	 * GladePropertyClass.
-	 */
-	if ((type = glade_editor_property_type (klass->pspec)) == 0)
-		g_error ("%s : pspec '%s' type '%s' not implemented (%s)\n", 
-			 G_GNUC_PRETTY_FUNCTION, 
-			 klass->name, 
-			 g_type_name (G_PARAM_SPEC_TYPE (klass->pspec)),
-			 g_type_name (klass->pspec->value_type));
-
-	/* special case for resource specs which are hand specified in the catalog. */
-	if (klass->resource)
-		type = GLADE_TYPE_EPROP_RESOURCE;
-	
-	/* special case for string specs that denote themed application icons. */
-	if (klass->themed_icon)
-		type = GLADE_TYPE_EPROP_NAMED_ICON;
-
-	/* Create and return the correct type of GladeEditorProperty */
-	eprop = g_object_new (type,
-			      "property-class", klass, 
-			      "use-command", use_command,
-			      NULL);
-
-	return eprop;
-}
-
-/**
- * glade_editor_property_new_from_widget:
- * @widget: A #GladeWidget
- * @property: The widget's property
- * @packing: whether @property indicates a packing property or not.
- * @use_command: Whether the undo/redo stack applies here.
- *
- * This is a convenience function to create a GladeEditorProperty corresponding
- * to @property
- *
- * Returns: A newly created and connected GladeEditorProperty
- */
-GladeEditorProperty *
-glade_editor_property_new_from_widget (GladeWidget *widget,
-				       const gchar *property,
-				       gboolean     packing,
-				       gboolean     use_command)
-{
-	GladeEditorProperty *eprop;
-	GladeProperty *p;
-	
-	if (packing)
-		p = glade_widget_get_pack_property (widget, property);
-	else
-		p = glade_widget_get_property (widget, property);
-	g_return_val_if_fail (GLADE_IS_PROPERTY (p), NULL);
-
-	eprop = glade_editor_property_new (p->klass, use_command);
-	glade_editor_property_load (eprop, p);
-	
-	return eprop;
-}
-
-/**
- * glade_editor_property_supported:
- * @pspec: A #GParamSpec
- *
- * Returns: whether this pspec is supported by GladeEditorProperties.
- */
-gboolean
-glade_editor_property_supported (GParamSpec *pspec)
-{
-	return glade_editor_property_type (pspec) != 0;
-}
-
-
-/**
  * glade_editor_property_load:
  * @eprop: A #GladeEditorProperty
  * @property: A #GladeProperty
@@ -4009,10 +3146,12 @@
 	g_return_if_fail (widget == NULL || GLADE_IS_WIDGET (widget));
 
 	if (widget)
+	{
 		/* properties are allowed to be missing on some internal widgets */
 		property = glade_widget_get_property (widget, eprop->klass->id);
 
-	glade_editor_property_load (eprop, property);
+		glade_editor_property_load (eprop, property);
+	}
 }
 
 /**

Modified: trunk/gladeui/glade-editor-property.h
==============================================================================
--- trunk/gladeui/glade-editor-property.h	(original)
+++ trunk/gladeui/glade-editor-property.h	Thu Apr  3 20:52:40 2008
@@ -2,8 +2,69 @@
 #ifndef __GLADE_EDITOR_PROPERTY_H__
 #define __GLADE_EDITOR_PROPERTY_H__
 
+#include <gtk/gtk.h>
+
 G_BEGIN_DECLS
 
+
+
+/*******************************************************************************
+                Boiler plate macros (inspired from glade-command.c)
+ *******************************************************************************/
+/* XXX document me ! */
+
+#define GLADE_MAKE_EPROP_TYPE(func, type, parent)	\
+GType							\
+func ## _get_type (void)				\
+{							\
+	static GType cmd_type = 0;			\
+							\
+	if (!cmd_type)					\
+	{						\
+		static const GTypeInfo info =		\
+		{					\
+			sizeof (type ## Class),		\
+			(GBaseInitFunc) NULL,		\
+			(GBaseFinalizeFunc) NULL,	\
+			(GClassInitFunc) func ## _class_init,	\
+			(GClassFinalizeFunc) NULL,	\
+			NULL,				\
+			sizeof (type),			\
+			0,				\
+			(GInstanceInitFunc) NULL	\
+		};					\
+							\
+		cmd_type = g_type_register_static (parent, #type, &info, 0);	\
+	}						\
+							\
+	return cmd_type;				\
+}							\
+
+
+#define GLADE_MAKE_EPROP(type, func)					\
+static void								\
+func ## _finalize (GObject *object);					\
+static void								\
+func ## _load (GladeEditorProperty *me, GladeProperty *property);	\
+static GtkWidget *							\
+func ## _create_input (GladeEditorProperty *me);			\
+static void								\
+func ## _class_init (gpointer parent_tmp, gpointer notused)		\
+{									\
+	GladeEditorPropertyClass *parent = parent_tmp;			\
+	GObjectClass* object_class;					\
+	object_class = G_OBJECT_CLASS (parent);				\
+	parent->load =  func ## _load;					\
+	parent->create_input =  func ## _create_input;			\
+	object_class->finalize = func ## _finalize;			\
+}									\
+typedef struct {							\
+	GladeEditorPropertyClass cmd;					\
+} type ## Class;							\
+GLADE_MAKE_EPROP_TYPE(func, type, GLADE_TYPE_EDITOR_PROPERTY)
+
+
+
 #define GLADE_TYPE_EDITOR_PROPERTY            (glade_editor_property_get_type())
 #define GLADE_EDITOR_PROPERTY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EDITOR_PROPERTY, GladeEditorProperty))
 #define GLADE_EDITOR_PROPERTY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EDITOR_PROPERTY, GladeEditorPropertyClass))
@@ -59,7 +120,6 @@
 
 	void        (* load)          (GladeEditorProperty *, GladeProperty *);
 
-	/* private */
 	GtkWidget  *(* create_input)  (GladeEditorProperty *);
 
 	void        (* gtk_doc_search)(GladeEditorProperty *, 
@@ -71,15 +131,7 @@
 
 
 
-GType                glade_editor_property_get_type       (void);
-
-GladeEditorProperty *glade_editor_property_new            (GladePropertyClass  *klass,
-							   gboolean             use_command);
-
-GladeEditorProperty *glade_editor_property_new_from_widget (GladeWidget        *widget,
-							    const gchar        *property,
-							    gboolean            packing,
-							    gboolean            use_command);
+GType                glade_editor_property_get_type       (void) G_GNUC_CONST;
 
 void                 glade_editor_property_load           (GladeEditorProperty *eprop,
 							   GladeProperty       *property);
@@ -87,12 +139,40 @@
 void                 glade_editor_property_load_by_widget (GladeEditorProperty *eprop,
 							   GladeWidget         *widget);
 
-gboolean             glade_editor_property_supported      (GParamSpec          *pspec);
-
 void                 glade_editor_property_show_info      (GladeEditorProperty *eprop);
 
 void                 glade_editor_property_hide_info      (GladeEditorProperty *eprop);
 
+void                 glade_editor_property_commit         (GladeEditorProperty *eprop,
+							   GValue              *value);
+
+
+/* Generic eprops */
+#define GLADE_TYPE_EPROP_NUMERIC         (glade_eprop_numeric_get_type())
+#define GLADE_TYPE_EPROP_ENUM            (glade_eprop_enum_get_type())
+#define GLADE_TYPE_EPROP_FLAGS           (glade_eprop_flags_get_type())
+#define GLADE_TYPE_EPROP_COLOR           (glade_eprop_color_get_type())
+#define GLADE_TYPE_EPROP_NAMED_ICON      (glade_eprop_named_icon_get_type())
+#define GLADE_TYPE_EPROP_TEXT            (glade_eprop_text_get_type())
+#define GLADE_TYPE_EPROP_BOOL            (glade_eprop_bool_get_type())
+#define GLADE_TYPE_EPROP_UNICHAR         (glade_eprop_unichar_get_type())
+#define GLADE_TYPE_EPROP_RESOURCE        (glade_eprop_resource_get_type())
+#define GLADE_TYPE_EPROP_OBJECT          (glade_eprop_object_get_type())
+#define GLADE_TYPE_EPROP_OBJECTS         (glade_eprop_objects_get_type())
+#define GLADE_TYPE_EPROP_ADJUSTMENT      (glade_eprop_adjustment_get_type())
+GType     glade_eprop_numeric_get_type     (void) G_GNUC_CONST;
+GType     glade_eprop_enum_get_type        (void) G_GNUC_CONST;
+GType     glade_eprop_flags_get_type       (void) G_GNUC_CONST;
+GType     glade_eprop_color_get_type       (void) G_GNUC_CONST;
+GType     glade_eprop_named_icon_get_type  (void) G_GNUC_CONST;
+GType     glade_eprop_text_get_type        (void) G_GNUC_CONST;
+GType     glade_eprop_bool_get_type        (void) G_GNUC_CONST;
+GType     glade_eprop_unichar_get_type     (void) G_GNUC_CONST;
+GType     glade_eprop_resource_get_type    (void) G_GNUC_CONST;
+GType     glade_eprop_object_get_type      (void) G_GNUC_CONST;
+GType     glade_eprop_objects_get_type     (void) G_GNUC_CONST;
+GType     glade_eprop_adjustment_get_type  (void) G_GNUC_CONST;
+
 
 G_END_DECLS
 

Modified: trunk/gladeui/glade-editor.c
==============================================================================
--- trunk/gladeui/glade-editor.c	(original)
+++ trunk/gladeui/glade-editor.c	Thu Apr  3 20:52:40 2008
@@ -434,7 +434,10 @@
 {
 	GladeEditorProperty *property;
 
-	property = glade_editor_property_new (klass, from_query_dialog == FALSE);
+	property = glade_widget_adaptor_create_eprop 
+		(GLADE_WIDGET_ADAPTOR (klass->handle), 
+		 klass, from_query_dialog == FALSE);
+
 	gtk_widget_show (GTK_WIDGET (property));
 	gtk_widget_show_all (property->item_label);
 
@@ -570,13 +573,9 @@
 			continue;
 		else if (type == TABLE_TYPE_GENERAL && property_class->common)
 			continue;
-		else if (type == TABLE_TYPE_ATK && 
-			 (property_class->type == GPC_NORMAL ||
-			  property_class->type == GPC_ACCEL_PROPERTY))
+		else if (type == TABLE_TYPE_ATK && !property_class->atk)
 			 continue;
-		else if (type != TABLE_TYPE_ATK && 
-			 (property_class->type != GPC_NORMAL &&
-			  property_class->type != GPC_ACCEL_PROPERTY))
+		else if (type != TABLE_TYPE_ATK && property_class->atk)
 			 continue;
 
 		property = glade_editor_table_append_item (table, property_class, 
@@ -1197,8 +1196,7 @@
 		if (glade_property_class_is_visible (property->klass) == FALSE)
 			continue;
 		
-		if (property->klass->type != GPC_NORMAL && 
-		    property->klass->type != GPC_ACCEL_PROPERTY)
+		if (property->klass->atk)
 			iter = &atk_iter;
 		else if (property->klass->common)
 			iter = &common_iter;

Modified: trunk/gladeui/glade-parser.c
==============================================================================
--- trunk/gladeui/glade-parser.c	(original)
+++ trunk/gladeui/glade-parser.c	Thu Apr  3 20:52:40 2008
@@ -1276,102 +1276,6 @@
     return state.interface;
 }
 
-static gchar *
-modifier_string_from_bits (GdkModifierType modifiers)
-{
-    GString *string = g_string_new ("");
-
-    if (modifiers & GDK_SHIFT_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_SHIFT_MASK");
-    }
-
-    if (modifiers & GDK_LOCK_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_LOCK_MASK");
-    }
-
-    if (modifiers & GDK_CONTROL_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_CONTROL_MASK");
-    }
-
-    if (modifiers & GDK_MOD1_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_MOD1_MASK");
-    }
-
-    if (modifiers & GDK_MOD2_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_MOD2_MASK");
-    }
-
-    if (modifiers & GDK_MOD3_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_MOD3_MASK");
-    }
-
-    if (modifiers & GDK_MOD4_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_MOD4_MASK");
-    }
-
-    if (modifiers & GDK_MOD5_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_MOD5_MASK");
-    }
-
-    if (modifiers & GDK_BUTTON1_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_BUTTON1_MASK");
-    }
-
-    if (modifiers & GDK_BUTTON2_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_BUTTON2_MASK");
-    }
-
-    if (modifiers & GDK_BUTTON3_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_BUTTON3_MASK");
-    }
-
-    if (modifiers & GDK_BUTTON4_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_BUTTON4_MASK");
-    }
-
-    if (modifiers & GDK_BUTTON5_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_BUTTON5_MASK");
-    }
-
-    if (modifiers & GDK_RELEASE_MASK) {
-	if (string->len > 0)
-	    g_string_append (string, " | ");
-	g_string_append (string, "GDK_RELEASE_MASK");
-    }
-
-    if (string->len > 0)
-	return g_string_free (string, FALSE);
-
-    g_string_free (string, TRUE);
-    return NULL;
-}
-
 static void
 dump_widget(xmlNode *parent, GladeWidgetInfo *info, gint indent)
 {

Modified: trunk/gladeui/glade-project.c
==============================================================================
--- trunk/gladeui/glade-project.c	(original)
+++ trunk/gladeui/glade-project.c	Thu Apr  3 20:52:40 2008
@@ -128,9 +128,9 @@
 
 static GladeIDAllocator  *unsaved_number_allocator = NULL;
 
-static gboolean glade_project_load_from_interface (GladeProject   *project,
-						   GladeInterface *interface,
-						   const gchar    *path);
+/* XXX static gboolean glade_project_load_from_interface (GladeProject   *project, */
+/* 						   GladeInterface *interface, */
+/* 						   const gchar    *path); */
 
 
 G_DEFINE_TYPE (GladeProject, glade_project, G_TYPE_OBJECT)
@@ -764,9 +764,114 @@
 	return g_object_new (GLADE_TYPE_PROJECT, NULL);
 }
 
+
+static void 
+glade_project_fix_object_props (GladeProject *project)
+{
+	GList         *l, *ll;
+	GValue        *value;
+	GladeWidget   *gwidget;
+	GladeProperty *property;
+	gchar         *txt;
+
+	for (l = project->priv->objects; l; l = l->next)
+	{
+		gwidget = glade_widget_get_from_gobject (l->data);
+
+		for (ll = gwidget->properties; ll; ll = ll->next)
+		{
+			property = GLADE_PROPERTY (ll->data);
+
+			if (glade_property_class_is_object (property->klass) &&
+			    (txt = g_object_get_data (G_OBJECT (property), 
+						      "glade-loaded-object")) != NULL)
+			{
+				/* Parse the object list and set the property to it
+				 * (this magicly works for both objects & object lists)
+				 */
+				value = glade_property_class_make_gvalue_from_string
+					(property->klass, txt, project);
+				
+				glade_property_set_value (property, value);
+				
+				g_value_unset (value);
+				g_free (value);
+				
+				g_object_set_data (G_OBJECT (property), 
+						   "glade-loaded-object", NULL);
+			}
+		}
+	}
+}
+
 gboolean
 glade_project_load_from_file (GladeProject *project, const gchar *path)
 {
+	GladeXmlContext *context;
+	GladeXmlDoc     *doc;
+	GladeXmlNode    *root;
+	GladeXmlNode    *node;
+	GladeWidget     *widget;
+
+	project->priv->path = glade_util_canonical_path (path);
+	
+	project->priv->selection = NULL;
+	project->priv->objects = NULL;
+	project->priv->loading = TRUE;
+
+
+	/* get the context & root node of the catalog file */
+	if (!(context = 
+	      glade_xml_context_new_from_path (path,
+					       NULL, 
+					       GLADE_XML_TAG_PROJECT)))
+	{
+		g_warning ("Couldn't open glade file [%s].", path);
+		return FALSE;
+	}
+
+	doc  = glade_xml_context_get_doc (context);
+	root = glade_xml_doc_get_root (doc);
+
+	if (!glade_xml_node_verify (root, GLADE_XML_TAG_PROJECT)) 
+	{
+		g_warning ("Glade file root node is not '%s', skipping %s",
+			   GLADE_XML_TAG_PROJECT, path);
+		glade_xml_context_free (context);
+		return FALSE;
+	}
+
+	for (node = glade_xml_node_get_children (root); 
+	     node; node = glade_xml_node_next (node))
+	{
+		if ((widget = glade_widget_read (project, NULL, node, NULL)) != NULL)
+			glade_project_add_object (project, NULL, widget->object);
+	}
+
+	if (glade_util_file_is_writeable (project->priv->path) == FALSE)
+		glade_project_set_readonly (project, TRUE);
+
+
+	project->priv->mtime = glade_util_get_file_mtime (project->priv->path, NULL);
+
+	/* Reset project status here too so that you get a clean
+	 * slate after calling glade_project_open().
+	 */
+	project->priv->modified = FALSE;
+	project->priv->loading = FALSE;
+
+	/* Emit "parse-finished" signal */
+	g_signal_emit (project, glade_project_signals [PARSE_FINISHED], 0);
+	
+	/* Now we have to loop over all the object properties
+	 * and fix'em all ('cause they probably weren't found)
+	 */
+	glade_project_fix_object_props (project);
+
+	return TRUE;
+
+#if LOADING_WAS_IMPLEMENTED
+
 	GladeInterface *interface;
 	
 	g_return_val_if_fail (GLADE_IS_PROJECT (project), FALSE); 
@@ -795,7 +900,8 @@
 		
 	project->priv->mtime = glade_util_get_file_mtime (project->priv->path, NULL);
 
-	return TRUE;
+#endif // LOADING_WAS_IMPLEMENTED
+
 }
 
 
@@ -866,8 +972,9 @@
 
 			glade_property_get_value (property, &value);
 			
-			if ((resource = glade_property_class_make_string_from_gvalue
-			     (property->klass, &value)) != NULL)
+			if ((resource = glade_widget_adaptor_string_from_value
+			     (GLADE_WIDGET_ADAPTOR (property->klass->handle),
+			      property->klass, &value)) != NULL)
 			{
 				full_resource = glade_project_resource_fullpath
 					(prev_project ? prev_project : project, resource);
@@ -1517,6 +1624,39 @@
 	g_strfreev (lines);
 }
 
+
+static GladeXmlContext *
+glade_project_write (GladeProject *project)
+{
+	GladeXmlContext *context;
+	GladeXmlDoc     *doc;
+	GladeXmlNode    *root;
+	GList           *list;
+
+	doc     = glade_xml_doc_new ();
+	context = glade_xml_context_new (doc, NULL);
+	root    = glade_xml_node_new (context, GLADE_XML_TAG_PROJECT);
+	glade_xml_doc_set_root (doc, root);
+
+
+	for (list = project->priv->objects; list; list = list->next)
+	{
+		GladeWidget *widget;
+
+		widget = glade_widget_get_from_gobject (list->data);
+
+		/* 
+		 * Append toplevel widgets. Each widget then takes
+		 * care of appending its children.
+		 */
+		if (widget->parent == NULL)
+			glade_widget_write (widget, context, root);
+	}
+	
+	return context;
+}
+#if LOADING_WAS_IMPLEMENTED
+
 /**
  * glade_project_write:
  * @project: a #GladeProject
@@ -1606,44 +1746,10 @@
 	return loadable;
 }
 
-static void 
-glade_project_fix_object_props (GladeProject *project)
-{
-	GList         *l, *ll;
-	GValue        *value;
-	GladeWidget   *gwidget;
-	GladeProperty *property;
-	gchar         *txt;
-
-	for (l = project->priv->objects; l; l = l->next)
-	{
-		gwidget = glade_widget_get_from_gobject (l->data);
+#endif // LOADING_WAS_IMPLEMENTED
 
-		for (ll = gwidget->properties; ll; ll = ll->next)
-		{
-			property = GLADE_PROPERTY (ll->data);
 
-			if (glade_property_class_is_object (property->klass) &&
-			    (txt = g_object_get_data (G_OBJECT (property), 
-						      "glade-loaded-object")) != NULL)
-			{
-				/* Parse the object list and set the property to it
-				 * (this magicly works for both objects & object lists)
-				 */
-				value = glade_property_class_make_gvalue_from_string
-					(property->klass, txt, project);
-				
-				glade_property_set_value (property, value);
-				
-				g_value_unset (value);
-				g_free (value);
-				
-				g_object_set_data (G_OBJECT (property), 
-						   "glade-loaded-object", NULL);
-			}
-		}
-	}
-}
+#if LOADING_WAS_IMPLEMENTED
 
 static gboolean
 glade_project_load_from_interface (GladeProject   *project,
@@ -1700,6 +1806,9 @@
 	return TRUE;	
 }
 
+#endif // LOADING_WAS_IMPLEMENTED
+
+
 /**
  * glade_project_load:
  * @path:
@@ -1774,22 +1883,15 @@
 gboolean
 glade_project_save (GladeProject *project, const gchar *path, GError **error)
 {
-	GladeInterface *interface;
-	gboolean        ret;
-	gchar          *canonical_path;
-
-	g_return_val_if_fail (GLADE_IS_PROJECT (project), FALSE);
-	g_return_val_if_fail (path != NULL, FALSE);
-
-	interface = glade_project_write (project);
-	if (!interface)
-	{
-		g_warning ("Could not write glade document\n");
-		return FALSE;
-	}
-
-	ret = glade_parser_interface_dump (interface, path, error);
-	glade_parser_interface_destroy (interface);
+	GladeXmlContext *context;
+	GladeXmlDoc     *doc;
+	gchar           *canonical_path;
+	gint             ret;
+
+	context = glade_project_write (project);
+	doc     = glade_xml_context_get_doc (context);
+	ret     = glade_xml_doc_save (doc, path);
+	glade_xml_context_destroy (context);
 
 	canonical_path = glade_util_canonical_path (path);
 	g_assert (canonical_path);
@@ -1829,7 +1931,7 @@
 
 	g_free (canonical_path);
 
-	return ret;
+	return ret > 0;
 }
 
 

Modified: trunk/gladeui/glade-property-class.c
==============================================================================
--- trunk/gladeui/glade-property-class.c	(original)
+++ trunk/gladeui/glade-property-class.c	Thu Apr  3 20:52:40 2008
@@ -53,102 +53,6 @@
 #define NUMERICAL_PAGE_INCREMENT   10
 #define NUMERICAL_PAGE_SIZE        1
 
-
-/* Hardcoded recognized atk actions
- */
-typedef struct {
-	gchar *prop_name;
-	gchar *id;
-	gchar *name;
-	gchar *tooltip;
-} GPCAtkPropertyTab;
-
-static const GPCAtkPropertyTab action_names_table[] = {
-	{ "click",   "atk-click",   N_("Click"),   
-	  N_("Set the description of the Click atk action") },
-	{ "press",   "atk-press",   N_("Press"),   
-	  N_("Set the description of the Press atk action") },
-	{ "release", "atk-release", N_("Release"), 
-	  N_("Set the description of the Release atk action") },
-	{ "activate", "atk-activate", N_("Activate"), 
-	  N_("Set the description of the Activate atk action") }
-};
-
-static const GPCAtkPropertyTab relation_names_table[] = {
-	{ "controlled-by", "atk-controlled-by", N_("Controlled By"),
-	  N_("Indicates an object controlled by one or more target objects") },
-
-	{ "controlled-for", "atk-controlled-for", N_("Controller For"),
-	  N_("Indicates an object is a controller for one or more target objects") },
-
-	{ "labelled-by", "atk-labelled-by", N_("Labelled By"),
-	  N_("Indicates an object is labelled by one or more target objects") },
-
-	{ "label-for", "atk-label-for", N_("Label For"),
-	  N_("Indicates an object is a label for one or more target objects") },
-
-	{ "member-of", "atk-member-of", N_("Member Of"),
-	  N_("Indicates an object is a member of a group of one or more target objects") },
-
-	{ "child-node-of", "atk-child-node-of", N_("Child Node Of"),
-	  N_("Indicates an object is a cell in a treetable which is displayed "
-	     "because a cell in the same column is expanded and identifies that cell") },
-
-	{ "flows-to", "atk-flows-to", N_("Flows To"),
-	  N_("Indicates that the object has content that flows logically to another "
-	     "AtkObject in a sequential way (text-flow, for instance).") },
-
-	{ "flows-from", "atk-flows-from", N_("Flows From"),
-	  N_("Indicates that the object has content that flows logically from another "
-	     "AtkObject in a sequential way, (for instance text-flow)") },
-
-	{ "subwindow-of", "atk-subwindow-of", N_("Subwindow Of"),
-	  N_("Indicates a subwindow attached to a component but otherwise has no "
-	     "connection in the UI hierarchy to that component") },
-
-	{ "embeds", "atk-embeds", N_("Embeds"),
-	  N_("Indicates that the object visually embeds another object's content, "
-	     "i.e. this object's content flows around another's content") },
-
-	{ "embedded-by", "atk-embedded-by", N_("Embedded By"),
-	  N_("Inverse of 'Embeds', indicates that this object's content "
-	     "is visually embedded in another object") },
-
-	{ "popup-for", "atk-popup-for", N_("Popup For"),
-	  N_("Indicates that an object is a popup for another object") },
-
-	{ "parent-window-of", "atk-parent-window-of", N_("Parent Window Of"),
-	  N_("Indicates that an object is a parent window of another object") }
-};
-
-
-/**
- * glade_property_class_atk_realname:
- * @atk_name: The id of the atk property
- *
- * Translates a GladePropertyClass->id to the name that should be
- * saved into the glade file.
- *
- * Returns: a pointer to a constant string.
- */
-G_CONST_RETURN gchar *
-glade_property_class_atk_realname (const gchar *atk_name)
-{
-	gint i;
-
-	g_return_val_if_fail (atk_name != NULL, NULL);
-
-	for (i = 0; i < G_N_ELEMENTS (action_names_table); i++)
-		if (!strcmp (action_names_table[i].id, atk_name))
-			return action_names_table[i].prop_name;
-
-	for (i = 0; i < G_N_ELEMENTS (relation_names_table); i++)
-		if (!strcmp (relation_names_table[i].id, atk_name))
-			return relation_names_table[i].prop_name;
-
-	return atk_name;
-}
-
 /**
  * glade_property_class_new:
  * @handle: A generic pointer (i.e. a #GladeWidgetClass)
@@ -183,7 +87,7 @@
 	property_class->resource = FALSE;
 	property_class->themed_icon = FALSE;
 	property_class->translatable = FALSE;
-	property_class->type = GPC_NORMAL;
+	property_class->atk = FALSE;
 	property_class->virt = TRUE;
 	property_class->transfer_on_paste = FALSE;
 	property_class->weight = -1.0;
@@ -474,41 +378,6 @@
 	return string;
 }
 
-/* This is not used to save in the glade file... and its a one-way conversion.
- * its only usefull to show the values in the UI.
- */
-static gchar *
-glade_property_class_make_string_from_accels (GladePropertyClass *property_class,
-					      GList              *accels)
-{
-	GladeAccelInfo *info;
-	GString        *string;
-	GList          *list;
-
-	string = g_string_new ("");
-
-	for (list = accels; list; list = list->next)
-	{
-		info = list->data;
-		
-		if (info->modifiers & GDK_SHIFT_MASK)
-			g_string_append (string, "SHIFT-");
-
-		if (info->modifiers & GDK_CONTROL_MASK)
-			g_string_append (string, "CNTL-");
-
-		if (info->modifiers & GDK_MOD1_MASK)
-			g_string_append (string, "ALT-");
-
-		g_string_append (string, glade_builtin_string_from_key (info->key));
-
-		if (list->next)
-			g_string_append (string, ", ");
-	}
-
-	return g_string_free (string, FALSE);
-}
-
 /**
  * glade_property_class_make_string_from_gvalue:
  * @property_class: A #GladePropertyClass
@@ -523,7 +392,7 @@
 	gchar    *string = NULL, **strv, str[G_ASCII_DTOSTR_BUF_SIZE];
 	GObject  *object;
 	GdkColor *color;
-	GList    *objects, *accels;
+	GList    *objects;
 
 	if (G_IS_PARAM_SPEC_ENUM(property_class->pspec))
 	{
@@ -629,14 +498,8 @@
 		string = glade_property_class_make_string_from_objects
 			(property_class, objects);
 	}
-	else if (GLADE_IS_PARAM_SPEC_ACCEL (property_class->pspec))
-	{
-		accels = g_value_get_boxed (value);
-		string = glade_property_class_make_string_from_accels 
-			(property_class, accels);
-	}
 	else
-		g_critical ("Unsupported pspec type %s",
+		g_critical ("Unsupported pspec type %s (value -> string)",
 			    g_type_name(G_PARAM_SPEC_TYPE (property_class->pspec)));
 
 	return string;
@@ -961,7 +824,7 @@
 		g_value_set_boxed (value, objects);
 	}
 	else
-		g_critical ("Unsupported pspec type %s",
+		g_critical ("Unsupported pspec type %s (string -> value)",
 			    g_type_name(G_PARAM_SPEC_TYPE (property_class->pspec)));
 
 	return value;
@@ -1024,7 +887,7 @@
 	else if (GLADE_IS_PARAM_SPEC_OBJECTS(klass->pspec))
 		g_value_set_boxed (value, va_arg (vl, gpointer));
 	else
-		g_critical ("Unsupported pspec type %s",
+		g_critical ("Unsupported pspec type %s (vl -> string)",
 			    g_type_name(G_PARAM_SPEC_TYPE (klass->pspec)));
 	
 	return value;
@@ -1113,7 +976,7 @@
 	else if (GLADE_IS_PARAM_SPEC_OBJECTS(klass->pspec))
 		*(gpointer *)(va_arg (vl, gpointer *)) = g_value_get_boxed (value);
 	else
-		g_critical ("Unsupported pspec type %s",
+		g_critical ("Unsupported pspec type %s (string -> vl)",
 			    g_type_name(G_PARAM_SPEC_TYPE (klass->pspec)));
 }
 
@@ -1141,108 +1004,6 @@
 }
 
 /**
- * glade_property_class_list_atk_relations:
- * @handle: A generic pointer (i.e. a #GladeWidgetClass)
- * @owner_type: The #GType of the owning widget class.
- *
- * Returns: a #GList of newly created atk relation #GladePropertyClass.
- */
-GList *
-glade_property_class_list_atk_relations (gpointer handle,
-					 GType    owner_type)
-{
-	const GPCAtkPropertyTab *relation_tab = NULL;
-	GladePropertyClass      *property_class;
-	GList                   *list = NULL;
-	gint                     i;
-	
-	/* Loop through our hard-coded table enties */
-	for (i = 0; i < G_N_ELEMENTS (relation_names_table); i++)
-	{
-		relation_tab = &relation_names_table[i];
-
-		property_class                    = glade_property_class_new (handle);
-		property_class->pspec             = 
-			glade_param_spec_objects (relation_tab->id,
-						  _(relation_tab->name),
-						  _(relation_tab->tooltip),
-						  ATK_TYPE_IMPLEMENTOR,
-						  G_PARAM_READWRITE);
-		
-		property_class->pspec->owner_type = owner_type;
-		property_class->id                = g_strdup (relation_tab->id);
-		property_class->name              = g_strdup (_(relation_tab->name));
-		property_class->tooltip           = g_strdup (_(relation_tab->tooltip));
-		property_class->type              = GPC_ATK_RELATION;
-		property_class->visible_lines     = 2;
-		property_class->ignore            = TRUE;
-
-		property_class->def = 
-			glade_property_class_make_gvalue_from_string
-			(property_class, "", NULL);
-		
-		property_class->orig_def = 
-			glade_property_class_make_gvalue_from_string
-			(property_class, "", NULL);
-
-		list = g_list_prepend (list, property_class);
-	}
-
-	return g_list_reverse (list);
-}
-
-/**
- * glade_property_class_accel_property:
- * @handle: A generic pointer (i.e. a #GladeWidgetClass)
- * @owner_type: The #GType of the owning widget class.
- *
- * Returns: a newly created #GladePropertyClass for accelerators
- *          of the prescribed @owner_type.
- */
-GladePropertyClass *
-glade_property_class_accel_property (gpointer handle,
-				     GType    owner_type)
-{
-	GladePropertyClass *property_class;
-	GValue             *def_value;
-
-	property_class                    = glade_property_class_new (handle);
-	property_class->pspec             = 
-		glade_param_spec_accel ("accelerators", _("Accelerators"),
-					_("A list of accelerator keys"), 
-					owner_type,
-					G_PARAM_READWRITE);
-
-	
-	property_class->pspec->owner_type = owner_type;
-	property_class->id                = g_strdup (g_param_spec_get_name
-						      (property_class->pspec));
-	property_class->name              = g_strdup (g_param_spec_get_nick
-						      (property_class->pspec));
-	property_class->tooltip           = g_strdup (g_param_spec_get_blurb
-						      (property_class->pspec));
-
-	property_class->type              = GPC_ACCEL_PROPERTY;
-	property_class->ignore            = TRUE;
-	property_class->common            = TRUE;
-
-	/* Setup default */
-	def_value = g_new0 (GValue, 1);
-	g_value_init (def_value, GLADE_TYPE_ACCEL_GLIST);
-	g_value_set_boxed (def_value, NULL);
-	property_class->def = def_value;
-
-	/* Setup original default */
-	def_value = g_new0 (GValue, 1);
-	g_value_init (def_value, GLADE_TYPE_ACCEL_GLIST);
-	g_value_set_boxed (def_value, NULL);
-	property_class->orig_def = def_value;
-
-	return property_class;
-}
-
-
-/**
  * glade_property_class_new_from_spec:
  * @handle: A generic pointer (i.e. a #GladeWidgetClass)
  * @spec: A #GParamSpec
@@ -1254,8 +1015,9 @@
 glade_property_class_new_from_spec (gpointer     handle,
 				    GParamSpec  *spec)
 {
-	GObjectClass       *gtk_widget_class;
-	GladePropertyClass *property_class;
+	GObjectClass        *gtk_widget_class;
+	GladePropertyClass  *property_class;
+	GladeEditorProperty *eprop;
 
 	g_return_val_if_fail (spec != NULL, NULL);
 	gtk_widget_class = g_type_class_ref (GTK_TYPE_WIDGET);
@@ -1271,13 +1033,17 @@
 	if ((spec->flags & G_PARAM_WRITABLE) == 0)
 		goto failed;
 
+	property_class->id   = g_strdup (spec->name);
+	property_class->name = g_strdup (g_param_spec_get_nick (spec));
+
 	/* Register only editable properties.
 	 */
-	if (!glade_editor_property_supported (property_class->pspec))
+	if (!(eprop = glade_widget_adaptor_create_eprop
+	      (GLADE_WIDGET_ADAPTOR (handle), property_class, FALSE)))
 		goto failed;
-	
-	property_class->id   = g_strdup (spec->name);
-	property_class->name = g_strdup (g_param_spec_get_nick (spec));
+
+	/* Just created it to see if it was supported.... destroy now... */
+	gtk_widget_destroy (GTK_WIDGET (eprop));
 
 	/* If its on the GtkWidgetClass, it goes in "common" 
 	 * (unless stipulated otherwise in the xml file)
@@ -1290,17 +1056,6 @@
 	if (spec->flags & G_PARAM_CONSTRUCT_ONLY)
 		property_class->construct_only = TRUE;
 
-	if (g_type_is_a (spec->owner_type, ATK_TYPE_OBJECT))
-	{
-		property_class->type    = GPC_ATK_PROPERTY;
-		property_class->ignore  = TRUE;
-
-		/* We only use the name and desctription props,
-		 * they are both translatable.
-		 */
-		property_class->translatable = TRUE;
-	}
-
 	if (!property_class->id || !property_class->name)
 	{
 		g_critical ("No name or id for "
@@ -1735,22 +1490,10 @@
 		klass->displayable_values = gpc_get_displayable_values_from_node
 							(child, klass, domain);
 	
-	/* A sprinkle of hard-code to get atk properties working right
-	 */
-	if (glade_xml_get_property_boolean (node, GLADE_TAG_ATK_ACTION, FALSE))
-		klass->type = GPC_ATK_ACTION;
-	else if (glade_xml_get_property_boolean (node, GLADE_TAG_ATK_PROPERTY, FALSE))
-	{
-		if (GLADE_IS_PARAM_SPEC_OBJECTS (klass->pspec))
-			klass->type = GPC_ATK_RELATION;
-		else
-			klass->type = GPC_ATK_PROPERTY;
-	}
-
-	/* Special case accelerators here.
+	/* Right now allowing the backend to specify that some properties
+	 * go in the atk tab, ideally this shouldnt be needed.
 	 */
-	if (GLADE_IS_PARAM_SPEC_ACCEL (klass->pspec))
-		klass->type = GPC_ACCEL_PROPERTY;
+	klass->atk = glade_xml_get_property_boolean (node, GLADE_TAG_ATK_PROPERTY, klass->atk);
 
 	/* Special case pixbuf here.
 	 */

Modified: trunk/gladeui/glade-property-class.h
==============================================================================
--- trunk/gladeui/glade-property-class.h	(original)
+++ trunk/gladeui/glade-property-class.h	Thu Apr  3 20:52:40 2008
@@ -20,28 +20,10 @@
 
 typedef struct _GladePropertyClass GladePropertyClass;
 
-/**
- * GPCType:
- * @GPC_NORMAL: is not an atk property
- * @GPC_ATK_PROPERTY: is a property of an #AtkImplementor object
- * @GPC_ATK_RELATION: is an atk relation set property
- * @GPC_ATK_ACTION: is an atk action property
- * @GPC_ACCEL_PROPERTY: is an accelerator key property
- */
-typedef enum {
-	GPC_NORMAL,
-	GPC_ATK_PROPERTY,
-	GPC_ATK_RELATION,
-	GPC_ATK_ACTION,
-	GPC_ACCEL_PROPERTY
-} GPCType;
-
 struct _GladePropertyClass
 {
-	GPCType type; /* A symbolic type used to load/save properties differently
-		       */
 
-	gpointer    handle; /* The GladeWidgetClass that this property class
+	gpointer    handle; /* The GladeWidgetAdaptor that this property class
 			     * was created for.
 			     */
 
@@ -103,7 +85,8 @@
 
 	gboolean construct_only; /* Whether this property is G_PARAM_CONSTRUCT_ONLY or not */
 	
-	gboolean common; /* Common properties go in the common tab */
+	gboolean common;  /* Common properties go in the common tab */
+	gboolean atk;     /* Atk properties go in the atk tab */
 	gboolean packing; /* Packing properties go in the packing tab */
 
 	
@@ -120,7 +103,9 @@
 	 * property editor availability & live object updates in the glade environment.
 	 */
 	gboolean save;      /* Whether we should save to the glade file or not
-			     * (mostly just for custom glade properties)
+			     * (mostly just for virtual internal glade properties,
+			     * also used for properties with generic pspecs that
+			     * are saved in custom ways by the plugin)
 			     */
 	gboolean save_always; /* Used to make a special case exception and always
 			       * save this property regardless of what the default
@@ -131,10 +116,9 @@
 	gboolean visible;   /* Whether or not to show this property in the editor
 			     */
 	gboolean ignore;    /* When true, we will not sync the object when the property
-			     * changes.
+			     * changes, or load values from the object.
 			     */
 
-
 	gboolean is_modified; /* If true, this property_class has been "modified" from the
 			       * the standard property by a xml file. */
 
@@ -166,13 +150,6 @@
 
 GladePropertyClass *glade_property_class_new_from_spec           (gpointer             handle,
 								  GParamSpec          *spec);
- 
-GList              *glade_property_class_list_atk_relations      (gpointer             handle,
-								  GType                owner_type);
-
-GladePropertyClass *glade_property_class_accel_property          (gpointer             handle,
-								  GType                owner_type);
-
 
 GladePropertyClass *glade_property_class_clone                   (GladePropertyClass  *property_class);
 
@@ -220,8 +197,6 @@
 gboolean            glade_property_class_void_value              (GladePropertyClass *klass,
 								  GValue             *value);
 
-G_CONST_RETURN gchar *glade_property_class_atk_realname          (const gchar        *atk_name);
-
 G_END_DECLS
 
 #endif /* __GLADE_PROPERTY_CLASS_H__ */

Modified: trunk/gladeui/glade-property.c
==============================================================================
--- trunk/gladeui/glade-property.c	(original)
+++ trunk/gladeui/glade-property.c	Thu Apr  3 20:52:40 2008
@@ -220,8 +220,9 @@
 
 #if 0
 	{
-		gchar *str = glade_property_class_make_string_from_gvalue
-			(property->klass, value);
+		gchar *str = glade_widget_adaptor_string_from_value
+			     (GLADE_WIDGET_ADAPTOR (property->klass->handle),
+			      property->klass, value);
 		g_print ("Setting property %s on %s to %s\n",
 			 property->klass->id,
 			 property->widget ? property->widget->name : "unknown", str);
@@ -343,9 +344,10 @@
 	
 	if (property->widget == NULL ||
 	    property->klass->packing ||
-	    property->klass->type != GPC_NORMAL ||
+	    property->klass->ignore  ||
 	    !(property->klass->pspec->flags & G_PARAM_READABLE))
 		return;
+
 	object = glade_widget_get_object (property->widget);
 	oclass = G_OBJECT_GET_CLASS (object);
 	
@@ -353,122 +355,6 @@
 		g_object_get_property (object, property->klass->id, property->value);
 }
 
-static gboolean
-glade_property_write_impl (GladeProperty  *property, 
-			   GladeInterface *interface,
-			   GArray         *props)
-{
-	GladePropInfo         info  = { 0, };
-	GladeAtkActionInfo    ainfo = { 0, };
-	GList                *list;
-	gchar                *name, *value, **split, *tmp;
-	gint                  i;
-
-	if (!property->klass->save || !property->enabled)
-		return FALSE;
-
-	g_assert (property->klass->orig_def);
-	g_assert (property->klass->def);
-
-	/* Skip properties that are default by original pspec default
-	 * (excepting those that specified otherwise).
-	 */
-	if (!(property->klass->save_always || property->save_always) &&
-	    glade_property_equals_value (property, property->klass->orig_def))
-		return FALSE;
-
-	/* we should change each '-' by '_' on the name of the property 
-         * (<property name="...">) */
-	if (property->klass->type != GPC_NORMAL)
-	{
-
-		tmp = (gchar *)glade_property_class_atk_realname (property->klass->id);
-		name = g_strdup (tmp);
-	}
-	else
-	{
-		name = g_strdup (property->klass->id);
-	}
-
-	/* convert the value of this property to a string */
-	if (property->klass->type == GPC_ACCEL_PROPERTY ||
-	    (value = glade_property_class_make_string_from_gvalue 
-	     (property->klass, property->value)) == NULL)
-		/* make sure we keep the empty string, also... upcomming
-		 * funcs that may not like NULL.
-		 */
-		value = g_strdup ("");
-	else
-	{
-		/* Escape the string so that it will be parsed as it should. */
-		tmp = value;
-		value = g_markup_escape_text (value, -1);
-		g_free (tmp);
-	}
-	
-	switch (property->klass->type)
-	{
-	case GPC_ATK_PROPERTY:
-		tmp = g_strdup_printf ("AtkObject::%s", name);
-		g_free (name);
-		name = tmp;
-		/* Dont break here ... */
-	case GPC_NORMAL:
-		info.name = glade_xml_alloc_propname(interface, name);
-		info.value = glade_xml_alloc_string(interface,  value);
-		
-		if (property->klass->translatable)
-		{
-			info.translatable = property->i18n_translatable;
-			info.has_context  = property->i18n_has_context;
-			if (property->i18n_comment)
-				info.comment = glade_xml_alloc_string
-					(interface, property->i18n_comment);
-		}
-		g_array_append_val (props, info);
-		break;
-	case GPC_ATK_RELATION:
-		if ((split = g_strsplit (value, GPC_OBJECT_DELIMITER, 0)) != NULL)
-		{
-			for (i = 0; split[i] != NULL; i++)
-			{
-				GladeAtkRelationInfo rinfo = { 0, };
-				rinfo.type   = glade_xml_alloc_string(interface, name);
-				rinfo.target = glade_xml_alloc_string(interface, split[i]);
-				g_array_append_val (props, rinfo);
-			}
-			g_strfreev (split);
-		}
-		break;
-	case GPC_ATK_ACTION:
-		ainfo.action_name = glade_xml_alloc_string(interface, name);
-		ainfo.description = glade_xml_alloc_string(interface, value);
-		g_array_append_val (props, ainfo);
-		break;
-	case GPC_ACCEL_PROPERTY:
-		for (list = g_value_get_boxed (property->value); 
-		     list; list = list->next)
-		{
-			GladeAccelInfo *accel = list->data;
-			GladeAccelInfo  accel_info = { 0, };
-
-			accel_info.signal    = glade_xml_alloc_string(interface, accel->signal);
-			accel_info.key       = accel->key;
-			accel_info.modifiers = accel->modifiers;
-
-			g_array_append_val (props, accel_info);
-		}
-		break;
-	default:
-		break;
-	}
-	
-	g_free (name);
-	g_free (value);
-
-	return TRUE;
-}
-
 static G_CONST_RETURN gchar *
 glade_property_get_tooltip_impl (GladeProperty *property)
 {
@@ -593,7 +479,6 @@
 	prop_class->get_default           = glade_property_get_default_impl;
 	prop_class->sync                  = glade_property_sync_impl;
 	prop_class->load                  = glade_property_load_impl;
-	prop_class->write                 = glade_property_write_impl;
 	prop_class->get_tooltip           = glade_property_get_tooltip_impl;
 	prop_class->value_changed         = NULL;
 	prop_class->tooltip_changed       = NULL;
@@ -658,7 +543,6 @@
 
 }
 
-
 GType
 glade_property_get_type (void)
 {
@@ -687,308 +571,6 @@
 }
 
 /*******************************************************************************
-                        GladeInterface Parsing code
- *******************************************************************************/
-static GValue *
-glade_property_read_packing (GladeProperty      *property, 
-			     GladePropertyClass *pclass,
-			     GladeProject       *project,
-			     GladeChildInfo     *info,
-			     gboolean            free_value)
-{
-	GValue    *gvalue = NULL;
-	gint       i;
-	gchar     *id;
-
-	for (i = 0; i < info->n_properties; ++i)
-	{
-		GladePropInfo *pinfo = info->properties + i;
-		
-		id = glade_util_read_prop_name (pinfo->name);
-		
-		if (!strcmp (id, pclass->id))
-		{
-			gvalue = glade_property_class_make_gvalue_from_string
-				(pclass, pinfo->value, project);
-			
-			if (property)
-			{
-				glade_property_i18n_set_translatable
-					(property, pinfo->translatable);
-				glade_property_i18n_set_has_context
-					(property, pinfo->has_context);
-				glade_property_i18n_set_comment
-					(property, pinfo->comment);
-
-				property->enabled = TRUE;
-				
-				GLADE_PROPERTY_GET_KLASS (property)->set_value
-					(property, gvalue);
-			}
-
-			if (free_value)
-			{
-				g_value_unset (gvalue);
-				g_free (gvalue);
-			}
-
-			g_free (id);
-			break;
-		}
-		g_free (id);
-	}
-	return gvalue;
-}
-
-static GValue *
-glade_property_read_normal (GladeProperty      *property, 
-			    GladePropertyClass *pclass,
-			    GladeProject       *project,
-			    GladeWidgetInfo    *info,
-			    gboolean            free_value)
-{
-	GValue    *gvalue = NULL;
-	gint       i;
-	gchar     *id;
-
-	for (i = 0; i < info->n_properties; ++i)
-	{
-		GladePropInfo *pinfo = info->properties + i;
-		
-		id = glade_util_read_prop_name (pinfo->name);
-		
-		if (!strcmp (id, pclass->id))
-		{
-			if (property && glade_property_class_is_object (pclass))
-			{
-				/* we must synchronize this directly after loading this project
-				 * (i.e. lookup the actual objects after they've been parsed and
-				 * are present).
-				 */
-				g_object_set_data_full (G_OBJECT (property), 
-							"glade-loaded-object", 
-							g_strdup (pinfo->value), g_free);
-			}
-			else
-			{
-				gvalue = glade_property_class_make_gvalue_from_string
-					(pclass, pinfo->value, project);
-
-				if (property)
-					GLADE_PROPERTY_GET_KLASS
-						(property)->set_value (property, gvalue);
-
-				if (free_value)
-				{
-					g_value_unset (gvalue);
-					g_free (gvalue);
-				}
-			}
-			
-			if (property)
-			{
-				glade_property_i18n_set_translatable
-					(property, pinfo->translatable);
-				glade_property_i18n_set_has_context
-					(property, pinfo->has_context);
-				glade_property_i18n_set_comment
-					(property, pinfo->comment);
-
-				property->enabled = TRUE;
-			}
-
-			g_free (id);
-			break;
-		}
-		g_free (id);
-	}
-	return gvalue;
-}
-
-static GValue *
-glade_property_read_atk_prop (GladeProperty      *property, 
-			      GladePropertyClass *pclass,
-			      GladeProject       *project,
-			      GladeWidgetInfo    *info,
-			      gboolean            free_value)
-{
-	GValue    *gvalue = NULL;
-	gint       i;
-	gchar     *id;
-
-	for (i = 0; i < info->n_atk_props; ++i)
-	{
-		GladePropInfo *pinfo = info->atk_props + i;
-		
-		id = glade_util_read_prop_name (pinfo->name);
-		
-		if (!strcmp (id, pclass->id))
-		{
-			gvalue = glade_property_class_make_gvalue_from_string
-				(pclass, pinfo->value, project);
-
-			if (property)
-			{
-				glade_property_i18n_set_translatable
-					(property, pinfo->translatable);
-				glade_property_i18n_set_has_context
-					(property, pinfo->has_context);
-				glade_property_i18n_set_comment
-					(property, pinfo->comment);
-
-				property->enabled = TRUE;
-
-				GLADE_PROPERTY_GET_KLASS (property)->set_value
-					(property, gvalue);
-			}
-
-			if (free_value)
-			{
-				g_value_unset (gvalue);
-				g_free (gvalue);
-			}
-			
-			g_free (id);
-			break;
-		}
-		g_free (id);
-	}
-	return gvalue;
-}
-
-static GValue *
-glade_property_read_atk_relation (GladeProperty      *property, 
-				  GladePropertyClass *pclass,
-				  GladeProject       *project,
-				  GladeWidgetInfo    *info)
-{
-	const gchar *class_id;
-	gchar       *id, *string = NULL, *tmp;
-	gint         i;
-
-	for (i = 0; i < info->n_relations; ++i)
-	{
-		GladeAtkRelationInfo *rinfo = info->relations + i;
-			
-		id       = glade_util_read_prop_name (rinfo->type);
-		class_id = glade_property_class_atk_realname (pclass->id);
-
-		if (!strcmp (id, class_id))
-		{
-			if (string == NULL)
-				string = g_strdup (rinfo->target);
-			else
-			{
-				tmp = g_strdup_printf ("%s%s%s", string, 
-						       GPC_OBJECT_DELIMITER, rinfo->target);
-				string = (g_free (string), tmp);
-			}
-		}
-		g_free (id);
-	}
-
-	/* we must synchronize this directly after loading this project
-	 * (i.e. lookup the actual objects after they've been parsed and
-	 * are present).
-	 */
-	if (property)
-	{
-		g_object_set_data_full (G_OBJECT (property), "glade-loaded-object", 
-					g_strdup (string), g_free);
-	}
-
-	return NULL;
-}
-
-static GValue *
-glade_property_read_atk_action (GladeProperty      *property, 
-				GladePropertyClass *pclass,
-				GladeProject       *project,
-				GladeWidgetInfo    *info,
-				gboolean            free_value)
-{
-	GValue      *gvalue = NULL;
-	const gchar *class_id;
-	gchar       *id;
-	gint         i;
-
-	for (i = 0; i < info->n_atk_actions; ++i)
-	{
-		GladeAtkActionInfo *ainfo = info->atk_actions + i;
-			
-		id       = glade_util_read_prop_name (ainfo->action_name);
-		class_id = glade_property_class_atk_realname (pclass->id);
-
-		if (!strcmp (id, class_id))
-		{
-			/* Need special case for NULL values here ??? */
-			
-			gvalue = glade_property_class_make_gvalue_from_string 
-				(pclass, ainfo->description, project);
-				
-			if (property)
-				GLADE_PROPERTY_GET_KLASS
-					(property)->set_value (property, gvalue);
-
-			if (free_value)
-			{
-				g_value_unset (gvalue);
-				g_free (gvalue);
-			}
-			g_free (id);
-			break;
-		}
-		g_free (id);
-	}
-	return gvalue;
-}
-
-static GValue *
-glade_property_read_accel_prop (GladeProperty      *property, 
-				GladePropertyClass *pclass,
-				GladeProject       *project,
-				GladeWidgetInfo    *info,
-				gboolean            free_value)
-{
-	GValue      *gvalue = NULL;
-	GList       *accels = NULL;
-	gint         i;
-
-	for (i = 0; i < info->n_accels; ++i)
-	{
-		GladeAccelInfo *ainfo = info->accels + i;
-		
-		GladeAccelInfo *ainfo_dup = g_new0 (GladeAccelInfo, 1);
-		
-		ainfo_dup            = g_new0 (GladeAccelInfo, 1);
-		ainfo_dup->signal    = g_strdup (ainfo->signal);
-		ainfo_dup->key       = ainfo->key;
-		ainfo_dup->modifiers = ainfo->modifiers;
-
-		accels = g_list_prepend (accels, ainfo_dup);
-	}
-
-	gvalue = g_new0 (GValue, 1);
-	g_value_init (gvalue, GLADE_TYPE_ACCEL_GLIST);
-	g_value_take_boxed (gvalue, accels);
-
-
-	if (property)
-		GLADE_PROPERTY_GET_KLASS
-			(property)->set_value (property, gvalue);
-
-	
-	if (free_value)
-	{
-		g_value_unset (gvalue);
-		g_free (gvalue);
-	}
-
-	return gvalue;
-}
-
-
-/*******************************************************************************
                                      API
  *******************************************************************************/
 /**
@@ -1321,83 +903,208 @@
 /**
  * glade_property_read:
  * @property: a #GladeProperty or #NULL
- * @pclass: the #GladePropertyClass
  * @project: the #GladeProject
- * @info: a #GladeWidgetInfo struct or a #GladeChildInfo struct if
- *        a packing property is passed.
- * @free_value: Whether the return value should be freed after applying
- *              it to the property or if it should be returned in tact.
+ * @node: the #GladeXmlNode to read, will either be a <widget>
+ *        node or a <child> node for packing properties.
  *
- * Read the value and any attributes for @property from @info, assumes
+ * Read the value and any attributes for @property from @node, assumes
  * @property is being loaded for @project
  *
- * Returns: The newly created #GValue if successfull (and if @free_value == FALSE)
- *
  * Note that object values will only be resolved after the project is
  * completely loaded
  */
-GValue *
+void
 glade_property_read (GladeProperty      *property, 
-		     GladePropertyClass *pclass,
 		     GladeProject       *project,
-		     gpointer            info,
-		     gboolean            free_value)
+		     GladeXmlNode       *node)
 {
-	GValue *ret = NULL;
+	GladeXmlNode *prop;
+	GValue       *gvalue = NULL;
+	gchar        *id, *name, *value;
 
-	g_return_val_if_fail (pclass != NULL, FALSE);
-	g_return_val_if_fail (info != NULL, FALSE);
+	g_return_if_fail (GLADE_IS_PROPERTY (property));
+	g_return_if_fail (GLADE_IS_PROJECT (project));
+	g_return_if_fail (node != NULL);
 
-	if (pclass->packing)
-	{
-		ret = glade_property_read_packing 
-			(property, pclass, project, (GladeChildInfo *)info, free_value);
-	}
-	else switch (pclass->type)
+	/* This code should work the same for <packing> and <widget> */
+	if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_PACKING) ||
+	      glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET)))
+		return;
+
+	for (prop = glade_xml_node_get_children (node); 
+	     prop; prop = glade_xml_node_next (prop))
 	{
-	case GPC_NORMAL:
-		ret = glade_property_read_normal
-			(property, pclass, project, (GladeWidgetInfo *)info, free_value);
-		break;
-	case GPC_ATK_PROPERTY:
-		ret = glade_property_read_atk_prop
-			(property, pclass, project, (GladeWidgetInfo *)info, free_value);
-		break;
-	case GPC_ATK_RELATION:
-		ret = glade_property_read_atk_relation
-			(property, pclass, project, (GladeWidgetInfo *)info);
-		break;
-	case GPC_ATK_ACTION:
-		ret = glade_property_read_atk_action
-			(property, pclass, project, (GladeWidgetInfo *)info, free_value);
-		break;
-	case GPC_ACCEL_PROPERTY:
-		ret = glade_property_read_accel_prop
-			(property, pclass, project, (GladeWidgetInfo *)info, free_value);
-		break;
-	default:
-		break;
-	}
 
-	return ret;
+		if (!glade_xml_node_verify_silent (prop, GLADE_XML_TAG_PROPERTY))
+			continue;
+
+		if (!(name = glade_xml_get_property_string_required
+		      (prop, GLADE_XML_TAG_NAME, NULL)))
+			continue;
+
+		/* Make sure we are working with dashes and
+		 * not underscores ... 
+		 */
+		id = glade_util_read_prop_name (name);
+		g_free (name);
+
+		if (!strcmp (id, property->klass->id))
+		{
+			if (!(value = glade_xml_get_content (prop)))
+			{
+				/* XXX should be glade_xml_get_content_required()... */
+				g_free (id);
+				break;
+			}
+
+			if (property && glade_property_class_is_object (property->klass))
+			{
+				/* we must synchronize this directly after loading this project
+				 * (i.e. lookup the actual objects after they've been parsed and
+				 * are present).
+				 */
+				g_object_set_data_full (G_OBJECT (property), 
+							"glade-loaded-object", 
+							g_strdup (value), g_free);
+			}
+			else
+			{
+				gvalue = glade_property_class_make_gvalue_from_string
+					(property->klass, value, project);
+
+				if (property) 
+				{
+					GLADE_PROPERTY_GET_KLASS
+						(property)->set_value (property, gvalue);
+				}
+
+				g_value_unset (gvalue);
+				g_free (gvalue);
+
+				/* If an optional property is specified in the
+				 * glade file, its enabled
+				 */
+				property->enabled = TRUE;
+			}
+
+			if (property)
+			{
+				gint translatable, has_context;
+				gchar *comment;
+
+				translatable = glade_xml_get_property_boolean
+					(prop, GLADE_TAG_TRANSLATABLE, FALSE);
+				has_context = glade_xml_get_property_boolean
+					(prop, GLADE_TAG_HAS_CONTEXT, FALSE);
+				comment = glade_xml_get_property_string
+					(prop, GLADE_TAG_COMMENT);
+
+				glade_property_i18n_set_translatable
+					(property, translatable);
+				glade_property_i18n_set_has_context
+					(property, has_context);
+				glade_property_i18n_set_comment
+					(property, comment);
+
+				g_free (comment);
+			}
+
+			g_free (value);
+			g_free (id);
+			break;
+		}
+		g_free (id);
+	}
 }
 
 
 /**
  * glade_property_write:
  * @property: a #GladeProperty
- * @interface: a #GladeInterface
- * @props: a GArray of #GladePropInfo
+ * @context: A #GladeXmlContext
+ * @node: A #GladeXmlNode
  *
- * Write this property to the GladeInterface metadata
+ * Write @property to @node
  */
-gboolean
-glade_property_write (GladeProperty *property, GladeInterface *interface, GArray *props)
+void
+glade_property_write (GladeProperty   *property,
+		      GladeXmlContext *context,
+		      GladeXmlNode    *node)
 {
-	g_return_val_if_fail (GLADE_IS_PROPERTY (property), FALSE);
-	g_return_val_if_fail (interface != NULL, FALSE);
-	g_return_val_if_fail (props != NULL, FALSE);
-	return GLADE_PROPERTY_GET_KLASS (property)->write (property, interface, props);
+	GladeXmlNode *prop_node;
+	gchar *name, *value, *tmp;
+
+	g_return_if_fail (GLADE_IS_PROPERTY (property));
+	g_return_if_fail (node != NULL);
+
+	/* This code should work the same for <packing> and <widget> */
+	if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_PACKING) ||
+	      glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET)))
+		return;
+
+	if (!property->klass->save || !property->enabled)
+		return;
+
+	g_assert (property->klass->orig_def);
+	g_assert (property->klass->def);
+
+	/* Skip properties that are default by original pspec default
+	 * (excepting those that specified otherwise).
+	 */
+	if (!(property->klass->save_always || property->save_always) &&
+	    glade_property_equals_value (property, property->klass->orig_def))
+		return;
+
+	/* Escape our string and save with underscores */
+	name = g_strdup (property->klass->id);
+	glade_util_replace (name, '-', '_');
+
+	/* convert the value of this property to a string */
+	if (!(value = glade_widget_adaptor_string_from_value
+	     (GLADE_WIDGET_ADAPTOR (property->klass->handle),
+	      property->klass, property->value)))
+		/* make sure we keep the empty string, also... upcomming
+		 * funcs that may not like NULL.
+		 */
+		value = g_strdup ("");
+	else
+	{
+		/* Escape the string so that it will be parsed as it should. */
+		tmp = value;
+		value = g_markup_escape_text (value, -1);
+		g_free (tmp);
+	}
+
+	/* Now dump the node values... */
+	prop_node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY);
+	glade_xml_node_append_child (node, prop_node);
+
+	/* Name and value */
+	glade_xml_node_set_property_string (prop_node, GLADE_XML_TAG_NAME, name);
+	glade_xml_set_content (prop_node, value);
+
+	/* i18n stuff */
+	if (property->klass->translatable)
+	{
+		if (property->i18n_translatable)
+			glade_xml_node_set_property_string (prop_node, 
+							    GLADE_TAG_TRANSLATABLE, 
+							    GLADE_XML_TAG_I18N_TRUE);
+
+		if (property->i18n_has_context)
+			glade_xml_node_set_property_string (prop_node, 
+							    GLADE_TAG_HAS_CONTEXT, 
+							    GLADE_XML_TAG_I18N_TRUE);
+
+
+		if (property->i18n_comment)
+			glade_xml_node_set_property_string (prop_node, 
+							    GLADE_TAG_COMMENT, 
+							    property->i18n_comment);
+	}
+
+	g_free (name);
+	g_free (value);
 }
 
 /**

Modified: trunk/gladeui/glade-property.h
==============================================================================
--- trunk/gladeui/glade-property.h	(original)
+++ trunk/gladeui/glade-property.h	Thu Apr  3 20:52:40 2008
@@ -78,7 +78,6 @@
 	void                    (* get_default)           (GladeProperty *, GValue *);
 	void                    (* sync)                  (GladeProperty *);
 	void                    (* load)                  (GladeProperty *);
-	gboolean                (* write)                 (GladeProperty *, GladeInterface *, GArray *);
 	G_CONST_RETURN gchar *  (* get_tooltip)           (GladeProperty *);
 
 	/* Signals */
@@ -141,15 +140,13 @@
 
 void                    glade_property_load                  (GladeProperty      *property);
 
-GValue                 *glade_property_read                  (GladeProperty      *property,
-							      GladePropertyClass *pclass,
+void                    glade_property_read                  (GladeProperty      *property,
 							      GladeProject       *project,
-							      gpointer            info,
-							      gboolean            free_value);
+							      GladeXmlNode       *node);
 
-gboolean                glade_property_write                 (GladeProperty      *property, 
-							      GladeInterface     *interface, 
-							      GArray             *props);
+void                    glade_property_write                 (GladeProperty      *property,	
+							      GladeXmlContext    *context,
+							      GladeXmlNode       *node);
 
 G_CONST_RETURN gchar   *glade_property_get_tooltip           (GladeProperty      *property);
 

Modified: trunk/gladeui/glade-signal-editor.c
==============================================================================
--- trunk/gladeui/glade-signal-editor.c	(original)
+++ trunk/gladeui/glade-signal-editor.c	Thu Apr  3 20:52:40 2008
@@ -102,8 +102,8 @@
 		g_assert (signal_name != NULL);
 	}
 
-	old_signal = glade_signal_new (signal_name, handler, userdata, lookup, after);
-	new_signal = glade_signal_new (signal_name, handler, userdata, lookup, !after);
+	old_signal = glade_signal_new (signal_name, handler, userdata, after);
+	new_signal = glade_signal_new (signal_name, handler, userdata, !after);
 
 	glade_command_change_signal (editor->widget, old_signal, new_signal);
 	gtk_tree_store_set (GTK_TREE_STORE (model), &iter, COLUMN_AFTER, !after, -1);
@@ -348,7 +348,7 @@
 	if (slot && !is_void_signal_handler(new_handler))
 	{
 		GladeSignal *new_signal = glade_signal_new (signal_name, new_handler,
-							    NULL, FALSE, FALSE);
+							    NULL, FALSE);
 		glade_command_add_signal (glade_widget, new_signal);
 		glade_signal_free (new_signal);
 		gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
@@ -368,7 +368,7 @@
 			glade_signal_new (signal_name, 
 					  old_handler,
 					  is_void_user_data (userdata) ? NULL : userdata, 
-					  lookup, after);
+					  after);
 		glade_command_remove_signal (glade_widget, old_signal);
 		glade_signal_free (old_signal);
 
@@ -397,14 +397,12 @@
 			(signal_name,
 			 old_handler,
 			 is_void_user_data(userdata) ? NULL : userdata,
-			 lookup,
 			 after);
 		GladeSignal *new_signal =
 			glade_signal_new
 			(signal_name,
 			 new_handler,
 			 is_void_user_data(userdata) ? NULL : userdata,
-			 lookup,
 			 after);
 
 		glade_command_change_signal (glade_widget, old_signal, new_signal);
@@ -619,14 +617,12 @@
 	old_signal =
 		glade_signal_new
 		(signal_name, handler,
-		 is_void_user_data(old_userdata) ? NULL : old_userdata,
-		 lookup, after);
+		 is_void_user_data(old_userdata) ? NULL : old_userdata, after);
 
 	new_signal = 
 		glade_signal_new 
 		(signal_name, handler,
-		 is_void_user_data(new_userdata) ? NULL : new_userdata,
-		 lookup, after);
+		 is_void_user_data(new_userdata) ? NULL : new_userdata, after);
 
 	if (glade_signal_equal (old_signal, new_signal) == FALSE)
 		glade_command_change_signal (glade_widget, old_signal, new_signal);
@@ -921,7 +917,7 @@
 				 COLUMN_USERDATA,
 				 widget_signal->userdata ?
 				 widget_signal->userdata : _(USERDATA_DEFAULT),
-				 COLUMN_LOOKUP,             widget_signal->lookup,
+				 COLUMN_LOOKUP,             FALSE/* widget_signal->lookup */,
 				 COLUMN_LOOKUP_VISIBLE,
 				 widget_signal->userdata ?  TRUE : FALSE,
 				 COLUMN_AFTER_VISIBLE,      TRUE,
@@ -944,7 +940,7 @@
 					 COLUMN_USERDATA,
 					 widget_signal->userdata  ?
 					 widget_signal->userdata : _(USERDATA_DEFAULT),
-					 COLUMN_LOOKUP,           widget_signal->lookup,
+					 COLUMN_LOOKUP,         FALSE/* widget_signal->lookup */,
 					 COLUMN_LOOKUP_VISIBLE,
 					 widget_signal->userdata  ? TRUE : FALSE,
 					 COLUMN_AFTER_VISIBLE,      TRUE,

Modified: trunk/gladeui/glade-signal.c
==============================================================================
--- trunk/gladeui/glade-signal.c	(original)
+++ trunk/gladeui/glade-signal.c	Thu Apr  3 20:52:40 2008
@@ -45,7 +45,6 @@
 GladeSignal *glade_signal_new (const gchar *name,
 			       const gchar *handler,
 			       const gchar *userdata,
-			       gboolean     lookup,
 			       gboolean     after)
 {
 	GladeSignal *signal = g_new0 (GladeSignal, 1);
@@ -53,7 +52,6 @@
 	signal->name     = g_strdup (name);
 	signal->handler  = g_strdup (handler);
 	signal->userdata = userdata ? g_strdup (userdata) : NULL;
-	signal->lookup   = lookup;
 	signal->after    = after;
 
 	return signal;
@@ -92,8 +90,7 @@
 	
 	if (!strcmp (sig1->name, sig2->name)        &&
 	    !strcmp (sig1->handler, sig2->handler)  &&
-	    sig1->after  == sig2->after             &&
-	    sig1->lookup == sig2->lookup)
+	    sig1->after  == sig2->after)
 	{
 		if ((sig1->userdata == NULL && sig2->userdata == NULL) ||
 		    (sig1->userdata != NULL && sig2->userdata != NULL  &&
@@ -116,51 +113,88 @@
 	return glade_signal_new (signal->name,
 				 signal->handler,
 				 signal->userdata,
-				 signal->lookup,
 				 signal->after);
+
 }
 
 /**
  * glade_signal_write:
- * @info:
- * @signal:
- * @interface:
+ * @signal: The #GladeSignal
+ * @context: A #GladeXmlContext
+ * @node: A #GladeXmlNode
  *
- * Returns: TRUE if succeed
+ * Writes @signal to @node
  */
-gboolean
-glade_signal_write (GladeSignalInfo *info, GladeSignal *signal,
-		     GladeInterface *interface)
+void
+glade_signal_write (GladeSignal     *signal,
+		    GladeXmlContext *context,
+		    GladeXmlNode    *node)
 {
-	info->name    = glade_xml_alloc_string(interface, signal->name);
-	glade_util_replace (info->name, '-', '_');
-	info->handler = glade_xml_alloc_string(interface, signal->handler);
-	info->object  =
-		signal->userdata ?
-		glade_xml_alloc_string(interface, signal->userdata) : NULL;
-	info->after   = signal->after;
-	info->lookup  = signal->lookup;
+	GladeXmlNode *signal_node;
+	gchar        *name;
+
+	if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
+		return;
+
+	name = g_strdup (signal->name);
+	glade_util_replace (name, '-', '_');
+
+	/* Now dump the node values... */
+	signal_node = glade_xml_node_new (context, GLADE_XML_TAG_SIGNAL);
+	glade_xml_node_append_child (node, signal_node);
+
+	glade_xml_node_set_property_string (signal_node, GLADE_XML_TAG_NAME, name);
+	glade_xml_node_set_property_string (signal_node, GLADE_XML_TAG_HANDLER, signal->handler);
+
+	if (signal->userdata)
+		glade_xml_node_set_property_string (signal_node, 
+						    GLADE_XML_TAG_OBJECT, 
+						    signal->userdata);
+
+	if (signal->after)
+		glade_xml_node_set_property_string (signal_node, 
+						    GLADE_XML_TAG_AFTER, 
+						    GLADE_XML_TAG_SIGNAL_TRUE);
+
+	g_free (name);
 	return TRUE;
 }
 
-/*
- * Returns a new GladeSignal with the attributes defined in node
+
+/**
+ * glade_signal_read:
+ * @node: The #GladeXmlNode to read
+ *
+ * Reads and creates a ner #GladeSignal based on @node
+ *
+ * Returns: A newly created #GladeSignal
  */
-GladeSignal *glade_signal_new_from_signal_info (GladeSignalInfo *info)
+GladeSignal *
+glade_signal_read (GladeXmlNode *node)
 {
 	GladeSignal *signal;
+	gchar *name, *handler;
 
-	g_return_val_if_fail (info != NULL, NULL);
+	g_return_val_if_fail (glade_xml_node_verify_silent 
+			      (node, GLADE_XML_TAG_SIGNAL), NULL);
 
-	signal = g_new0 (GladeSignal, 1);
-	signal->name     = g_strdup (info->name);
-	glade_util_replace (signal->name, '_', '-');
-	signal->handler  = g_strdup (info->handler);
-	signal->after    = info->after;
-	signal->userdata = g_strdup (info->object);
+	if (!(name = 
+	      glade_xml_get_property_string_required (node, GLADE_XML_TAG_NAME, NULL)))
+		return NULL;
+	glade_util_replace (name, '_', '-');
 
-	if (!signal->name)
+	if (!(handler = 
+	      glade_xml_get_property_string_required (node, GLADE_XML_TAG_HANDLER, NULL)))
+	{
+		g_free (name);
 		return NULL;
+	}
+
+	signal = g_new0 (GladeSignal, 1);
+	signal->name     = name;
+	signal->handler  = handler;
+	signal->after    = glade_xml_get_property_boolean (node, GLADE_XML_TAG_AFTER, FALSE);
+	signal->userdata = glade_xml_get_property_string (node, GLADE_XML_TAG_OBJECT);
 
 	return signal;
 }

Modified: trunk/gladeui/glade-signal.h
==============================================================================
--- trunk/gladeui/glade-signal.h	(original)
+++ trunk/gladeui/glade-signal.h	Thu Apr  3 20:52:40 2008
@@ -2,7 +2,7 @@
 #ifndef __GLADE_SIGNAL_H__
 #define __GLADE_SIGNAL_H__
 
-#include "glade-parser.h"
+#include <glib.h>
 
 G_BEGIN_DECLS
 
@@ -17,9 +17,6 @@
 	gchar    *name;         /* Signal name eg "clicked"            */
 	gchar    *handler;      /* Handler function eg "gtk_main_quit" */
 	gchar    *userdata;     /* User data signal handler argument   */
-	gboolean  lookup;       /* Whether user_data should be looked up
-				 * with the GModule interface by libglade.
-				 */
 	gboolean  after;        /* Connect after TRUE or FALSE         */
 };
 
@@ -27,18 +24,16 @@
 GladeSignal *glade_signal_new   (const gchar *name,
 				 const gchar *handler,
 				 const gchar *userdata,
-				 gboolean     lookup,
 				 gboolean     after);
 GladeSignal *glade_signal_clone (const GladeSignal *signal);
 void         glade_signal_free  (GladeSignal *signal);
 
 gboolean     glade_signal_equal (GladeSignal *sig1, GladeSignal *sig2);
 
-gboolean     glade_signal_write (GladeSignalInfo *info, GladeSignal *signal,
-				 GladeInterface *interface);
-
-GladeSignal *glade_signal_new_from_signal_info (GladeSignalInfo *info);
-
+GladeSignal *glade_signal_read  (GladeXmlNode *node);
+void         glade_signal_write (GladeSignal     *signal,
+				 GladeXmlContext *context,
+				 GladeXmlNode    *node);
 
 G_END_DECLS
 

Modified: trunk/gladeui/glade-utils.c
==============================================================================
--- trunk/gladeui/glade-utils.c	(original)
+++ trunk/gladeui/glade-utils.c	Thu Apr  3 20:52:40 2008
@@ -569,15 +569,6 @@
 
 	glade_util_replace (id, '_', '-');
 
-	if (strstr (id, "::"))
-	{
-		/* Extract the second half of "AtkObject::accessible_name"
-		 */
-		gchar **split = g_strsplit (id, "::", 0);
-		g_free (id);
-		id = g_strdup (split[1]);
-		g_strfreev (split);
-	}
 	return id;
 }
 

Modified: trunk/gladeui/glade-widget-adaptor.c
==============================================================================
--- trunk/gladeui/glade-widget-adaptor.c	(original)
+++ trunk/gladeui/glade-widget-adaptor.c	Thu Apr  3 20:52:40 2008
@@ -73,6 +73,13 @@
 	GList *packing_defaults;
 };
 
+
+struct _GladePackingDefault {
+    gchar  *id;
+    gchar  *value;
+};
+
+
 enum {
 	PROP_0,
 	PROP_NAME,
@@ -86,7 +93,8 @@
 	PROP_CURSOR
 };
 
-typedef struct _GladeChildPacking GladeChildPacking;
+typedef struct _GladeChildPacking    GladeChildPacking;
+typedef struct _GladePackingDefault  GladePackingDefault;
 
 static GObjectClass *parent_class = NULL;
 static GHashTable   *adaptor_hash = NULL;
@@ -126,11 +134,10 @@
 	for (l = *properties; l && l->data; l = g_list_next (l))
 	{
 		GladePropertyClass *klass = l->data;
-		GPCType type = klass->type;
 	
 		if (klass->visible &&
 		    (parent) ? parent == klass->pspec->owner_type : TRUE &&
-	    	    (type == GPC_NORMAL || type == GPC_ACCEL_PROPERTY))
+	    	    !klass->atk)
 		{
 			/* Use a different counter for each tab (common, packing and normal) */
 			if (klass->common) common++;
@@ -395,9 +402,6 @@
 				       g_list_reverse (list));
 }
 
-/* XXX Atk relations and accel props disregarded - they should
- *     be implemented from the gtk+ catalog instead I think.
- */
 static void
 gwa_setup_properties (GladeWidgetAdaptor *adaptor,
 		      GObjectClass       *object_class,
@@ -750,6 +754,175 @@
 		   adaptor->name, action_id);
 }
 
+static void
+glade_widget_adaptor_object_read_widget (GladeWidgetAdaptor *adaptor,
+					 GladeWidget        *widget,
+					 GladeXmlNode       *node)
+{
+	GladeXmlNode *sig_node;
+	GList *props;
+	GladeSignal *signal;
+
+	/* Read in the properties */
+	for (props = widget->properties; 
+	     props; props = props->next)
+       	{
+		GladeProperty *property = props->data;
+		glade_property_read
+			(property, widget->project, node);
+	}
+	
+	/* Read in the signals */
+	for (sig_node = glade_xml_node_get_children (node); 
+	     sig_node; sig_node = glade_xml_node_next (sig_node))
+	{
+		if (!glade_xml_node_verify_silent (sig_node, GLADE_XML_TAG_SIGNAL))
+			continue;
+		
+		if (!(signal = glade_signal_read (sig_node)))
+			continue;
+
+		glade_widget_add_signal_handler (widget, signal);
+	}
+}
+
+typedef struct {
+	GladeXmlContext *context;
+	GladeXmlNode    *node;
+} WriteSignalsInfo;
+
+
+static void
+glade_widget_adaptor_write_signals (gpointer key, 
+				    gpointer value, 
+				    gpointer user_data)
+{
+	WriteSignalsInfo *info;
+        GPtrArray *signals;
+	guint i;
+
+	info = (WriteSignalsInfo *) user_data;
+	signals = (GPtrArray *) value;
+	for (i = 0; i < signals->len; i++)
+	{
+		GladeSignal *signal = g_ptr_array_index (signals, i);
+		glade_signal_write (signal,
+				    info->context,
+				    info->node);
+	}
+}
+
+static void
+glade_widget_adaptor_object_write_widget (GladeWidgetAdaptor *adaptor,
+					  GladeWidget        *widget,
+					  GladeXmlContext    *context,
+					  GladeXmlNode       *node)
+{
+	GList *props;
+	WriteSignalsInfo info = { context, node };
+
+	/* Write the properties */
+	for (props = widget->properties; 
+	     props; props = props->next)
+		glade_property_write (GLADE_PROPERTY (props->data), context, node);
+
+	/* Write the signals */
+	g_hash_table_foreach (widget->signals,
+			      glade_widget_adaptor_write_signals,
+			      &info);
+}
+
+static GType 
+glade_widget_adaptor_get_eprop_type (GParamSpec *pspec)
+{
+	GType type = 0;
+
+	if (pspec->value_type == GLADE_TYPE_STOCK ||
+	    G_IS_PARAM_SPEC_ENUM(pspec))
+		type = GLADE_TYPE_EPROP_ENUM;
+	else if (G_IS_PARAM_SPEC_FLAGS(pspec))
+		type = GLADE_TYPE_EPROP_FLAGS;
+	else if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec))
+	{
+		if (pspec->value_type == G_TYPE_VALUE_ARRAY)
+			type = GLADE_TYPE_EPROP_TEXT;
+	}
+	else if (G_IS_PARAM_SPEC_BOXED(pspec))
+	{
+		if (pspec->value_type == GDK_TYPE_COLOR)
+			type = GLADE_TYPE_EPROP_COLOR;
+		else if (pspec->value_type == G_TYPE_STRV)
+			type = GLADE_TYPE_EPROP_TEXT;
+	}
+	else if (G_IS_PARAM_SPEC_STRING(pspec))
+		type = GLADE_TYPE_EPROP_TEXT;
+	else if (G_IS_PARAM_SPEC_BOOLEAN(pspec))
+		type = GLADE_TYPE_EPROP_BOOL;
+	else if (G_IS_PARAM_SPEC_FLOAT(pspec)  ||
+		 G_IS_PARAM_SPEC_DOUBLE(pspec) ||
+		 G_IS_PARAM_SPEC_INT(pspec)    ||
+		 G_IS_PARAM_SPEC_UINT(pspec)   ||
+		 G_IS_PARAM_SPEC_LONG(pspec)   ||
+		 G_IS_PARAM_SPEC_ULONG(pspec)  ||
+		 G_IS_PARAM_SPEC_INT64(pspec)  ||
+		 G_IS_PARAM_SPEC_UINT64(pspec))
+		type = GLADE_TYPE_EPROP_NUMERIC;
+	else if (G_IS_PARAM_SPEC_UNICHAR(pspec))
+		type = GLADE_TYPE_EPROP_UNICHAR;
+	else if (G_IS_PARAM_SPEC_OBJECT(pspec))
+	{
+		if (pspec->value_type == GDK_TYPE_PIXBUF)
+			type = GLADE_TYPE_EPROP_RESOURCE;
+		else if (pspec->value_type == GTK_TYPE_ADJUSTMENT)
+			type = GLADE_TYPE_EPROP_ADJUSTMENT;
+		else
+			type = GLADE_TYPE_EPROP_OBJECT;
+	}
+	else if (GLADE_IS_PARAM_SPEC_OBJECTS(pspec))
+		type = GLADE_TYPE_EPROP_OBJECTS;
+
+	return type;
+}
+
+static GladeEditorProperty *
+glade_widget_adaptor_object_create_eprop (GladeWidgetAdaptor *adaptor,
+					  GladePropertyClass *klass,
+					  gboolean            use_command)
+{
+	GladeEditorProperty *eprop;
+	GType                type = 0;
+
+	/* Find the right type of GladeEditorProperty for this
+	 * GladePropertyClass.
+	 */
+	if ((type = glade_widget_adaptor_get_eprop_type (klass->pspec)) == 0)
+		return NULL;
+
+	/* special case for resource specs which are hand specified in the catalog. */
+	if (klass->resource)
+		type = GLADE_TYPE_EPROP_RESOURCE;
+	
+	/* special case for string specs that denote themed application icons. */
+	if (klass->themed_icon)
+		type = GLADE_TYPE_EPROP_NAMED_ICON;
+
+	/* Create and return the correct type of GladeEditorProperty */
+	eprop = g_object_new (type,
+			      "property-class", klass, 
+			      "use-command", use_command,
+			      NULL);
+
+	return eprop;
+}
+
+static gchar *
+glade_widget_adaptor_object_string_from_value (GladeWidgetAdaptor *adaptor,
+					       GladePropertyClass *klass,
+					       const GValue       *value)
+{
+	return glade_property_class_make_string_from_gvalue (klass, value);
+}
+
 /*******************************************************************************
             GladeWidgetAdaptor type registration and class initializer
  *******************************************************************************/
@@ -789,6 +962,12 @@
 	adaptor_class->child_get_property   = NULL;
 	adaptor_class->action_activate      = glade_widget_adaptor_object_action_activate;
 	adaptor_class->child_action_activate= glade_widget_adaptor_object_child_action_activate;
+	adaptor_class->read_widget          = glade_widget_adaptor_object_read_widget;
+	adaptor_class->write_widget         = glade_widget_adaptor_object_write_widget;
+	adaptor_class->create_eprop         = glade_widget_adaptor_object_create_eprop;
+	adaptor_class->string_from_value    = glade_widget_adaptor_object_string_from_value;
+
+
 
 	/* Base defaults here */
 	adaptor_class->fixed                = FALSE;
@@ -1029,6 +1208,27 @@
 					  GLADE_TAG_CHILD_ACTION_ACTIVATE_FUNCTION,
 					  &symbol))
 		klass->child_action_activate = symbol;
+
+	if (glade_xml_load_sym_from_node (node, module,
+					  GLADE_TAG_READ_WIDGET_FUNCTION,
+					  &symbol))
+		klass->read_widget = symbol;
+
+	if (glade_xml_load_sym_from_node (node, module,
+					  GLADE_TAG_WRITE_WIDGET_FUNCTION,
+					  &symbol))
+		klass->write_widget = symbol;
+
+	if (glade_xml_load_sym_from_node (node, module,
+					  GLADE_TAG_CREATE_EPROP_FUNCTION,
+					  &symbol))
+		klass->create_eprop = symbol;
+
+	if (glade_xml_load_sym_from_node (node, module,
+					  GLADE_TAG_STRING_FROM_VALUE_FUNCTION,
+					  &symbol))
+		klass->string_from_value = symbol;
+
 }
 
 static void
@@ -2777,3 +2977,108 @@
 
 	GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->child_action_activate (adaptor, container, object, action_path);
 }
+
+
+
+/**
+ * glade_widget_adaptor_read_widget:
+ * @adaptor: A #GladeWidgetAdaptor
+ * @widget: The #GladeWidget
+ * @node: The #GladeXmlNode
+ *
+ * This function is called to update @widget from @node 
+ * when loading xml files.
+ */
+void
+glade_widget_adaptor_read_widget (GladeWidgetAdaptor *adaptor,
+				  GladeWidget        *widget,
+				  GladeXmlNode       *node)
+{
+	g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
+	g_return_if_fail (GLADE_IS_WIDGET (widget));
+	g_return_if_fail (node != NULL);
+
+	GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->read_widget (adaptor, widget, node);
+}
+
+
+/**
+ * glade_widget_adaptor_write_widget:
+ * @adaptor: A #GladeWidgetAdaptor
+ * @widget: The #GladeWidget
+ * @context: The #GladeXmlContext
+ * @node: The #GladeXmlNode
+ *
+ * This function is called to update @widget from @node 
+ * when loading xml files.
+ */
+void
+glade_widget_adaptor_write_widget (GladeWidgetAdaptor *adaptor,
+				   GladeWidget        *widget,
+				   GladeXmlContext    *context,
+				   GladeXmlNode       *node)
+{
+	g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
+	g_return_if_fail (GLADE_IS_WIDGET (widget));
+	g_return_if_fail (node != NULL);
+
+	GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->write_widget (adaptor, widget, 
+								context, node);
+}
+
+
+/**
+ * glade_widget_adaptor_create_eprop:
+ * @adaptor: A #GladeWidgetAdaptor
+ * @klass: The #GladePropertyClass to be edited
+ * @use_command: whether to use the GladeCommand interface
+ * to commit property changes
+ * 
+ * Creates a GladeEditorProperty to edit @klass
+ *
+ * Returns: A newly created #GladeEditorProperty
+ */
+GladeEditorProperty *
+glade_widget_adaptor_create_eprop (GladeWidgetAdaptor *adaptor,
+				   GladePropertyClass *klass,
+				   gboolean            use_command)
+{
+	GladeEditorProperty *eprop;
+	g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
+	g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (klass), NULL);
+
+	eprop = GLADE_WIDGET_ADAPTOR_GET_CLASS
+		(adaptor)->create_eprop (adaptor, klass, use_command);
+
+	/* XXX we really need to print a g_error() here, exept we are
+	 * now using this func to test for unsupported properties
+	 * at init time from glade-property-class */
+
+	return eprop;
+}
+
+
+/**
+ * glade_widget_adaptor_string_from_value:
+ * @adaptor: A #GladeWidgetAdaptor
+ * @klass: The #GladePropertyClass 
+ * @value: The #GValue to convert to a string
+ * 
+ * For normal properties this is used to serialize
+ * property values, for custom properties its still
+ * needed to update the UI for undo/redo items etc.
+ *
+ * Returns: A newly allocated string representation of @value
+ */
+gchar *
+glade_widget_adaptor_string_from_value (GladeWidgetAdaptor *adaptor,
+					GladePropertyClass *klass,
+					const GValue       *value)
+{
+	g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL);
+	g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (klass), NULL);
+	g_return_val_if_fail (value != NULL, NULL);
+
+	return GLADE_WIDGET_ADAPTOR_GET_CLASS
+		(adaptor)->string_from_value (adaptor, klass, value);
+}

Modified: trunk/gladeui/glade-widget-adaptor.h
==============================================================================
--- trunk/gladeui/glade-widget-adaptor.h	(original)
+++ trunk/gladeui/glade-widget-adaptor.h	Thu Apr  3 20:52:40 2008
@@ -4,6 +4,7 @@
 
 #include <gladeui/glade-xml-utils.h>
 #include <gladeui/glade-property-class.h>
+#include <gladeui/glade-editor-property.h>
 #include <glib-object.h>
 #include <gmodule.h>
 #include <gtk/gtk.h>
@@ -237,9 +238,10 @@
 /**
  * GladeGetChildrenFunc:
  * @container: A #GObject container
- * @Returns: A #GList of #GObject children.
  *
  * A function called to get @containers children.
+ *
+ * Returns: A #GList of #GObject children.
  */
 typedef GList   *(* GladeGetChildrenFunc)         (GladeWidgetAdaptor *adaptor,
 						   GObject            *container);
@@ -297,6 +299,8 @@
  * @name: A string identifier
  *
  * Called to lookup @child in composite object @parent by @name.
+ *
+ * Returns: The specified internal widget.
  */
 typedef GObject *(* GladeGetInternalFunc)         (GladeWidgetAdaptor *adaptor,
 						   GObject            *parent,
@@ -330,6 +334,66 @@
 						   GObject            *object,
 						   const gchar        *action_path);
 
+/**
+ * GladeReadWidgetFunc:
+ * @adaptor: A #GladeWidgetAdaptor
+ * @widget: The #GladeWidget
+ * @node: The #GladeXmlNode
+ *
+ * This function is called to update @widget from @node.
+ *
+ */
+typedef void     (* GladeReadWidgetFunc) (GladeWidgetAdaptor *adaptor,
+					  GladeWidget        *widget,
+					  GladeXmlNode       *node);
+
+/**
+ * GladeWriteWidgetFunc:
+ * @adaptor: A #GladeWidgetAdaptor
+ * @widget: The #GladeWidget
+ * @node: The #GladeXmlNode
+ *
+ * This function is called to fill in @node from @widget.
+ *
+ */
+typedef void     (* GladeWriteWidgetFunc) (GladeWidgetAdaptor *adaptor,
+					   GladeWidget        *widget,
+					   GladeXmlContext    *context,
+					   GladeXmlNode       *node);
+
+
+/**
+ * GladeCreateEPropFunc:
+ * @adaptor: A #GladeWidgetAdaptor
+ * @klass: The #GladePropertyClass to be edited
+ * @use_command: whether to use the GladeCommand interface
+ * to commit property changes
+ * 
+ * Creates a GladeEditorProperty to edit @klass
+ *
+ * Returns: A newly created #GladeEditorProperty
+ */
+typedef GladeEditorProperty *(* GladeCreateEPropFunc) (GladeWidgetAdaptor *adaptor,
+						       GladePropertyClass *klass,
+						       gboolean            use_command);
+
+/**
+ * GladeStringFromValueFunc:
+ * @adaptor: A #GladeWidgetAdaptor
+ * @klass: The #GladePropertyClass 
+ * @value: The #GValue to convert to a string
+ * 
+ * For normal properties this is used to serialize
+ * property values, for custom properties its still
+ * needed to update the UI for undo/redo items etc.
+ *
+ * Returns: A newly allocated string representation of @value
+ */
+typedef gchar   *(* GladeStringFromValueFunc) (GladeWidgetAdaptor *adaptor,
+					       GladePropertyClass *klass,
+					       const GValue       *value);
+
+
 /* GladeSignalClass contains all the info we need for a given signal, such as
  * the signal name, and maybe more in the future 
  */
@@ -472,6 +536,15 @@
 	
 	GladeActionActivateFunc      action_activate;       /* This method is used to catch actions */
 	GladeChildActionActivateFunc child_action_activate; /* This method is used to catch packing actions */
+
+
+	GladeReadWidgetFunc          read_widget; /* Reads widget attributes from xml */
+	
+	GladeWriteWidgetFunc         write_widget; /* Writes widget attributes to the xml */
+
+	GladeCreateEPropFunc         create_eprop; /* Creates a GladeEditorProperty */
+
+	GladeStringFromValueFunc     string_from_value; /* Creates a string for a value */
 };
 
 #define glade_widget_adaptor_create_widget(adaptor, query, ...) \
@@ -622,6 +695,24 @@
 								 GObject            *container,
 								 GObject            *object,
 								 const gchar        *action_path);
+
+void                 glade_widget_adaptor_read_widget        (GladeWidgetAdaptor *adaptor,
+							      GladeWidget        *widget,
+							      GladeXmlNode       *node);
+
+void                 glade_widget_adaptor_write_widget       (GladeWidgetAdaptor *adaptor,
+							      GladeWidget        *widget,
+							      GladeXmlContext    *context,
+							      GladeXmlNode       *node);
+
+GladeEditorProperty *glade_widget_adaptor_create_eprop       (GladeWidgetAdaptor *adaptor,
+							      GladePropertyClass *klass,
+							      gboolean            use_command);
+
+gchar               *glade_widget_adaptor_string_from_value  (GladeWidgetAdaptor *adaptor,
+							      GladePropertyClass *klass,
+							      const GValue       *value);
+
 G_END_DECLS
 
 #endif /* __GLADE_WIDGET_ADAPTOR_H__ */

Modified: trunk/gladeui/glade-widget.c
==============================================================================
--- trunk/gladeui/glade-widget.c	(original)
+++ trunk/gladeui/glade-widget.c	Thu Apr  3 20:52:40 2008
@@ -62,17 +62,6 @@
 							GladeWidgetAdaptor    *adaptor);
 static void         glade_widget_set_properties        (GladeWidget           *widget,
 							GList                 *properties);
-static GParameter  *glade_widget_info_params           (GladeWidgetAdaptor    *adaptor,
-							GladeWidgetInfo       *info,
-							gboolean               construct,
-							guint                 *n_params);
-static void         glade_widget_fill_from_widget_info (GladeWidgetInfo       *info,
-							GladeWidget           *widget,
-							gboolean               apply_props);
-static GladeWidget *glade_widget_new_from_widget_info  (GladeWidgetInfo       *info,
-							GladeProject          *project,
-							GladeWidget           *parent);
-
 static gboolean     glade_window_is_embedded           (GtkWindow *window);
 static gboolean     glade_widget_embed                 (GladeWidget *widget);
 
@@ -100,18 +89,12 @@
 	PROP_PARENT,
 	PROP_INTERNAL_NAME,
 	PROP_TEMPLATE,
-	PROP_INFO,
 	PROP_REASON,
 	PROP_TOPLEVEL_WIDTH,
 	PROP_TOPLEVEL_HEIGHT
 };
 
 static guint         glade_widget_signals[LAST_SIGNAL] = {0};
-
-/* Sometimes we need to use the project deep in the loading code,
- * this is just a shortcut way to get the project.
- */
-static GladeProject *loading_project = NULL;
 static GQuark        glade_widget_name_quark = 0;
 
 
@@ -300,7 +283,6 @@
 				g_strdup (new_signal_handler->userdata);
 			
 			tmp_signal_handler->after  = new_signal_handler->after;
-			tmp_signal_handler->lookup = new_signal_handler->lookup;
 			break;
 		}
 	}
@@ -519,7 +501,7 @@
 }
 
 static GObject *
-glade_widget_build_object (GladeWidgetAdaptor *adaptor, GladeWidget *widget, GladeWidgetInfo *info)
+glade_widget_build_object (GladeWidgetAdaptor *adaptor, GladeWidget *widget, void /* GladeWidgetInfo */ *info)
 {
 	GParameter          *params;
 	GObject             *object;
@@ -527,8 +509,8 @@
 
 	if (widget)
 		params = glade_widget_template_params (widget, TRUE, &n_params);
-	else if (info)
-		params = glade_widget_info_params (adaptor, info, TRUE, &n_params);
+/* 	else if (info) */
+/* 		params = glade_widget_info_params (adaptor, info, TRUE, &n_params); */
 	else
 		params = glade_widget_adaptor_default_params (adaptor, TRUE, &n_params);
 
@@ -540,8 +522,8 @@
 
 	if (widget)
 		params = glade_widget_template_params (widget, FALSE, &n_params);
-	else if (info)
-		params = glade_widget_info_params (adaptor, info, FALSE, &n_params);
+/* 	else if (info) */
+/* 		params = glade_widget_info_params (adaptor, info, FALSE, &n_params); */
 	else
 		params = glade_widget_adaptor_default_params (adaptor, FALSE, &n_params);
 
@@ -715,7 +697,7 @@
 	{
 		object = glade_widget_build_object(gwidget->adaptor, 
 						   gwidget->construct_template, 
-						   gwidget->construct_info);
+						   NULL/* gwidget->construct_info */);
 		glade_widget_set_object (gwidget, object);
 	}
 
@@ -863,9 +845,6 @@
 	case PROP_TEMPLATE:
 		widget->construct_template = g_value_get_object (value);
 		break;
-	case PROP_INFO:
-		widget->construct_info = g_value_get_pointer (value);
-		break;
 	case PROP_REASON:
 		widget->construct_reason = g_value_get_int (value);
 		break;
@@ -1077,12 +1056,6 @@
 				      G_PARAM_CONSTRUCT_ONLY|G_PARAM_WRITABLE));
 
 	g_object_class_install_property
-		(object_class, 	PROP_INFO,
-		 g_param_spec_pointer ("info", _("Info"),
-				       _("A GladeWidgetInfo struct to base a new widget on"),
-				       G_PARAM_CONSTRUCT_ONLY|G_PARAM_WRITABLE));
-
-	g_object_class_install_property
 		(object_class, 	PROP_REASON,
 		 g_param_spec_int ("reason", _("Reason"),
 				   _("A GladeCreateReason for this creation"),
@@ -1786,301 +1759,6 @@
 }
 
 /*******************************************************************************
-                           GladeInterface Parsing code
- *******************************************************************************/
-static gint
-glade_widget_set_child_type_from_child_info (GladeChildInfo     *child_info,
-					     GladeWidgetAdaptor *parent_adaptor,
-					     GObject *child)
-{
-	guint           i;
-	GladePropInfo  *prop_info;
-	gchar          *special_child_type;
-
-	g_object_get (parent_adaptor, "special-child-type", &special_child_type, NULL);
-	
-	if (!special_child_type)
-		return -1;
-
-	for (i = 0; i < child_info->n_properties; ++i)
-	{
-		prop_info = child_info->properties + i;
-		if (!strcmp (prop_info->name, special_child_type))
-		{
-			g_free (special_child_type);
-			
-			g_object_set_data_full (child,
-						"special-child-type",
-						g_strdup (prop_info->value),
-						g_free);
-			return i;
-		}
-	}
-	g_free (special_child_type);
-	return -1;
-}
-
-static gboolean
-glade_widget_new_child_from_child_info (GladeChildInfo *info,
-					GladeProject   *project,
-					GladeWidget    *parent)
-{
-	GladeWidget    *child;
-	GList          *list;
-
-	g_return_val_if_fail (info != NULL, FALSE);
-	g_return_val_if_fail (project != NULL, FALSE);
-
-	/* is it a placeholder? */
-	if (!info->child)
-	{
-		GObject *palaceholder = G_OBJECT (glade_placeholder_new ());
-		glade_widget_set_child_type_from_child_info 
-			(info, parent->adaptor, palaceholder);
-		glade_widget_adaptor_add (parent->adaptor,
-					  parent->object,
-					  palaceholder);
-		return TRUE;
-	}
-
-	/* is it an internal child? */
-	if (info->internal_child)
-	{
-		GObject *child_object =
-			glade_widget_get_internal_child (parent, info->internal_child);
-
-		if (!child_object)
-                {
-			g_warning ("Failed to locate internal child %s of %s",
-				   info->internal_child, glade_widget_get_name (parent));
-			return FALSE;
-		}
-
-		if ((child = glade_widget_get_from_gobject (child_object)) == NULL)
-			g_error ("Unable to get GladeWidget for internal child %s\n",
-				 info->internal_child);
-
-		/* Apply internal widget name from here */
-		glade_widget_set_name (child, info->child->name);
-		glade_widget_fill_from_widget_info (info->child, child, TRUE);
-		glade_widget_sync_custom_props (child);
-	}
-        else
-        {
-		child = glade_widget_new_from_widget_info (info->child, project, parent);
-		if (!child)
-			return FALSE;
-
-		child->parent = parent;
-
-		glade_widget_set_child_type_from_child_info 
-			(info, parent->adaptor, child->object);
-		
-		glade_widget_add_child (parent, child, FALSE);
-
-		glade_widget_sync_packing_props (child);
-	}
-
-	/* Get the packing properties */
-	for (list = child->packing_properties; list; list = list->next)
-	{
-		GladeProperty *property = list->data;
-		glade_property_read (property, property->klass, 
-				     loading_project, info, TRUE);
-	}
-	return TRUE;
-}
-
-static void
-glade_widget_fill_from_widget_info (GladeWidgetInfo *info,
-				    GladeWidget     *widget,
-				    gboolean         apply_props)
-{
-	GladeProperty *property;
-	GList         *list;
-	guint          i;
-
-	g_return_if_fail (GLADE_IS_WIDGET (widget));
-	g_return_if_fail (info != NULL);
-	
-	g_assert (strcmp (info->classname, widget->adaptor->name) == 0);
-
-	/* Children */
-	for (i = 0; i < info->n_children; ++i)
-	{
-		if (!glade_widget_new_child_from_child_info (info->children + i,
-							     widget->project, widget))
-		{
-			g_warning ("Failed to read child of %s",
-				   glade_widget_get_name (widget));
-			continue;
-		}
-	}
-
-	/* Signals */
-	for (i = 0; i < info->n_signals; ++i)
-	{
-		GladeSignal *signal;
-
-		signal = glade_signal_new_from_signal_info (info->signals + i);
-		if (!signal)
-		{
-			g_warning ("Failed to read signal");
-			continue;
-		}
-		glade_widget_add_signal_handler (widget, signal);
-	}
-
-	/* Properties */
-	if (apply_props)
-	{
- 		for (list = widget->properties; list; list = list->next)
-  		{
-			property = list->data;
-			glade_property_read (property, property->klass, 
-					     loading_project, info, TRUE);
-		}
-	}
-}
-
-
-
-static GList *
-glade_widget_properties_from_widget_info (GladeWidgetAdaptor *klass,
-					  GladeWidgetInfo  *info)
-{
-	GList  *properties = NULL, *list;
-	
-	for (list = klass->properties; list && list->data; list = list->next)
-	{
-		GladePropertyClass *pclass = list->data;
-		GladeProperty      *property;
-
-		/* If there is a value in the XML, initialize property with it,
-		 * otherwise initialize property to default.
-		 */
-		property = glade_property_new (pclass, NULL, NULL);
-		
-		glade_property_original_reset (property);
-		
-		glade_property_read (property, property->klass, 
-				     loading_project, info, TRUE);
-
-		properties = g_list_prepend (properties, property);
-	}
-
-	return g_list_reverse (properties);
-}
-
-static GladeWidget *
-glade_widget_new_from_widget_info (GladeWidgetInfo *info,
-                                   GladeProject    *project,
-                                   GladeWidget     *parent)
-{
-	GladeWidgetAdaptor *adaptor;
-	GladeWidget        *widget;
-	GList              *properties;
-	
-	g_return_val_if_fail (info != NULL, NULL);
-	g_return_val_if_fail (project != NULL, NULL);
-
-	if ((adaptor = 
-	     glade_widget_adaptor_get_by_name (info->classname)) == NULL)
-	{
-		g_warning ("Widget class %s unknown.", info->classname);
-		return NULL;
-	}
-
-	properties = glade_widget_properties_from_widget_info (adaptor, info);
-	widget = glade_widget_adaptor_create_widget
-		(adaptor, FALSE,
-		 "name", info->name, 
-		 "parent", parent, 
-		 "project", project, 
-		 "info", info, 
-		 "properties", properties, 
-		 "reason", GLADE_CREATE_LOAD, NULL);
-
-	/* create the packing_properties list, without setting them */
-	if (parent)
-		widget->packing_properties =
-			glade_widget_create_packing_properties (parent, widget);
-
-	/* Load children first */
-	glade_widget_fill_from_widget_info (info, widget, FALSE);
-
-	/* Now sync custom props, things like "size" on GtkBox need
-	 * this to be done afterwards.
-	 */
-	glade_widget_sync_custom_props (widget);
-
-	return widget;
-}
-
-static GParameter *
-glade_widget_info_params (GladeWidgetAdaptor *adaptor,
-			  GladeWidgetInfo    *info,
-			  gboolean            construct,
-			  guint              *n_params)
-{
-	GladePropertyClass   *glade_property_class;
-	GObjectClass         *oclass;
-	GParamSpec          **pspec;
-	GArray               *params;
-	guint                 i, n_props;
-	
-	oclass = g_type_class_ref (adaptor->type);
-	pspec  = g_object_class_list_properties (oclass, &n_props);
-	params = g_array_new (FALSE, FALSE, sizeof (GParameter));
-
-	/* prepare parameters that have glade_property_class->def */
-	for (i = 0; i < n_props; i++)
-	{
-		GParameter  parameter = { 0, };
-		GValue     *value;
-		
-		glade_property_class =
-			glade_widget_adaptor_get_property_class (adaptor,
-								 pspec[i]->name);
-		if (glade_property_class == NULL  ||
-		    glade_property_class->virt    ||
-		    glade_property_class->ignore)
-			continue;
-
-		if (construct &&
-		    (pspec[i]->flags & 
-		     (G_PARAM_CONSTRUCT|G_PARAM_CONSTRUCT_ONLY)) == 0)
-			continue;
-		else if (!construct &&
-			 (pspec[i]->flags & 
-			  (G_PARAM_CONSTRUCT|G_PARAM_CONSTRUCT_ONLY)) != 0)
-			continue;
-
-
-		/* Try filling parameter with value from widget info.
-		 */
-		if ((value = glade_property_read (NULL, glade_property_class,
-						  loading_project, info, FALSE)) != NULL)
-		{
-			parameter.name = pspec[i]->name;
-			g_value_init (&parameter.value, pspec[i]->value_type);
-			
-			g_value_copy (value, &parameter.value);
-			g_value_unset (value);
-			g_free (value);
-
-			g_array_append_val (params, parameter);
-		}
-	}
-	g_free(pspec);
-
-	g_type_class_unref (oclass);
-
-	*n_params = params->len;
-	return (GParameter *)g_array_free (params, FALSE);
-}
-
-/*******************************************************************************
                                      API
  *******************************************************************************/
 GladeWidget *
@@ -2176,7 +1854,7 @@
 		if (layout && !GTK_WIDGET_REALIZED (layout))
 		{
 			/* XXX Dangerous !!! give her a little kick */
-			g_idle_add (glade_widget_show_idle, widget);
+			g_idle_add ((GSourceFunc)glade_widget_show_idle, widget);
 			return;
 		}
 		else if (!layout)
@@ -3103,9 +2781,9 @@
 	g_return_val_if_fail (id_property != NULL, NULL);
 
 	if ((property = glade_widget_get_property (widget, id_property)) != NULL)
-		ret_string =
-			glade_property_class_make_string_from_gvalue (property->klass,
-								      value ? value : property->value);
+		ret_string = glade_widget_adaptor_string_from_value
+			(GLADE_WIDGET_ADAPTOR (property->klass->handle),
+			 property->klass, value ? value : property->value);
 
 	return ret_string;
 }
@@ -3133,9 +2811,9 @@
 	g_return_val_if_fail (id_property != NULL, NULL);
 
 	if ((property = glade_widget_get_pack_property (widget, id_property)) != NULL)
-		ret_string =
-			glade_property_class_make_string_from_gvalue (property->klass,
-								      value ? value : property->value);
+		ret_string = glade_widget_adaptor_string_from_value
+			(GLADE_WIDGET_ADAPTOR (property->klass->handle),
+			 property->klass, value ? value : property->value);
 
 	return ret_string;
 }
@@ -3608,288 +3286,379 @@
 	GLADE_WIDGET_GET_CLASS (parent)->replace_child (parent, old_object, new_object);
 }
 
-/* XML Serialization */
-static gboolean
-glade_widget_write_child (GArray *children, GladeWidget *parent, GObject *object, GladeInterface *interface);
-
-typedef struct _WriteSignalsContext
+/*******************************************************************************
+ *                           Xml Parsing code                                  *
+ *******************************************************************************/
+static void
+glade_widget_set_child_type_from_node (GladeWidgetAdaptor  *parent_adaptor,
+				       GObject             *child,
+				       GladeXmlNode        *node)
 {
-	GladeInterface *interface;
-	GArray *signals;
-} WriteSignalsContext;
+	GladeXmlNode *packing_node, *prop;
+	gchar        *special_child_type, *name, *value;
+
+	if (!glade_xml_node_verify (node, GLADE_XML_TAG_CHILD))
+		return;
+
+	g_object_get (parent_adaptor, "special-child-type", &special_child_type, NULL);
+	if (!special_child_type)
+		return;
+
+	if ((packing_node = 
+	     glade_xml_search_child (node, GLADE_XML_TAG_PACKING)) != NULL)
+	{
+		for (prop = glade_xml_node_get_children (packing_node); 
+		     prop; prop = glade_xml_node_next (prop))
+		{
+			if (!(name = 
+			      glade_xml_get_property_string_required (prop,
+								      GLADE_XML_TAG_NAME,
+								      NULL)))
+				continue;
+			
+			if (!(value = glade_xml_get_content (prop)))
+			{
+				/* XXX should be glade_xml_get_content_required()... */
+				g_free (name);
+				continue;
+			}
+			
+			if (!strcmp (name, special_child_type))
+			{
+				g_object_set_data_full (child,
+							"special-child-type",
+							g_strdup (value),
+							g_free);
+				g_free (name);
+				g_free (value);
+				break;
+			}
+			g_free (name);
+			g_free (value);
+		}
+	}
+	g_free (special_child_type);
+}
 
 static void
-glade_widget_write_signals (gpointer key, gpointer value, gpointer user_data)
+glade_widget_read_children (GladeWidget  *widget,
+			    GladeXmlNode *node)
 {
-	WriteSignalsContext *write_signals_context;
-        GPtrArray *signals;
-	guint i;
-
-	write_signals_context = (WriteSignalsContext *) user_data;
-	signals = (GPtrArray *) value;
-	for (i = 0; i < signals->len; i++)
+	GladeXmlNode *child, *widget_node, *packing_node;
+	GladeWidget  *child_widget;
+	GList        *packing;
+	/* 
+	 * Deal with children...
+	 */
+	for (child = glade_xml_node_get_children (node); 
+	     child; child = glade_xml_node_next (child))
 	{
-		GladeSignal *signal = g_ptr_array_index (signals, i);
-		GladeSignalInfo signalinfo;
+		const gchar *node_name = glade_xml_node_get_name (child);
+		gchar *internal_name;
+		
+		if (strcmp (node_name, GLADE_XML_TAG_CHILD) != 0) 
+			continue;
+
+		internal_name = 
+			glade_xml_get_property_string 
+			(child, GLADE_XML_TAG_INTERNAL_CHILD);
+
+		if ((widget_node = 
+		     glade_xml_search_child
+		     (child, GLADE_XML_TAG_WIDGET)) != NULL)
+		{
+			child_widget = 
+				glade_widget_read (widget->project, 
+						   widget, 
+						   widget_node, 
+						   internal_name);
+
+			if (child_widget)
+			{
+				if (!internal_name) {
+					glade_widget_set_child_type_from_node 
+						(widget->adaptor, 
+						 child_widget->object, child);
+					glade_widget_add_child (widget, child_widget, FALSE);
+				}
+				
+				if ((packing_node =
+				     glade_xml_search_child
+				     (child, GLADE_XML_TAG_PACKING)) != NULL)
+				{
 
-		glade_signal_write (&signalinfo, signal,
-				    write_signals_context->interface);
-		g_array_append_val (write_signals_context->signals, 
-				    signalinfo);
+					/* Get the packing properties */
+					for (packing = child_widget->packing_properties; 
+					     packing; packing = packing->next)
+					{
+						GladeProperty *property = packing->data;
+						glade_property_read (property, 
+								     child_widget->project, 
+								     packing_node);
+					}
+				}
+			}
+
+		} else {
+			GObject *palaceholder = 
+				G_OBJECT (glade_placeholder_new ());
+
+			glade_widget_set_child_type_from_node (widget->adaptor, 
+							       palaceholder,
+							       child);
+			
+			glade_widget_adaptor_add (widget->adaptor,
+						  widget->object,
+						  palaceholder);
+			
+		}
+		g_free (internal_name);
 	}
 }
 
+
 /**
- * glade_widget_write:
- * @widget: a #GladeWidget
- * @interface: a #GladeInterface
- *
- * TODO: write me
+ * glade_widget_read:
+ * @project: a #GladeProject
+ * @parent: The parent #GladeWidget or %NULL
+ * @node: a #GladeXmlNode
  *
- * Returns: 
+ * Returns: a new #GladeWidget for @project, based on @node
  */
-GladeWidgetInfo*
-glade_widget_write (GladeWidget *widget, GladeInterface *interface)
+GladeWidget *
+glade_widget_read (GladeProject *project, 
+		   GladeWidget  *parent, 
+		   GladeXmlNode *node,
+		   const gchar  *internal)
 {
-	WriteSignalsContext write_signals_context;
-	GladeWidgetInfo *info;
-	GArray *props, *atk_props, *atk_actions, *atk_relations, *accels, *children;
-	GList *list;
+	GladeWidgetAdaptor *adaptor;
+	GladeWidget  *widget = NULL;
+	gchar        *klass, *id;
 
-	g_return_val_if_fail (GLADE_IS_WIDGET (widget), NULL);
+	glade_widget_push_superuser ();
 
-	info = g_new0 (GladeWidgetInfo, 1);
+	if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
+		return NULL;
 
-	info->classname = glade_xml_alloc_string (interface, widget->adaptor->name);
-	info->name      = glade_xml_alloc_string (interface, widget->name);
+	if ((klass = 
+	     glade_xml_get_property_string_required
+	     (node, GLADE_XML_TAG_CLASS, NULL)) != NULL)
+	{
+		if ((id = 
+		     glade_xml_get_property_string_required
+		     (node, GLADE_XML_TAG_ID, NULL)) != NULL)
+		{
+			/* 
+			 * Create GladeWidget instance based on type. 
+			 */
+			if ((adaptor = 
+			     glade_widget_adaptor_get_by_name (klass)) != NULL)
+			{
 
-	/* Write the properties */
-	props         = g_array_new (FALSE, FALSE, sizeof (GladePropInfo));
-	atk_props     = g_array_new (FALSE, FALSE, sizeof (GladePropInfo));
-	atk_relations = g_array_new (FALSE, FALSE, sizeof (GladeAtkRelationInfo));
-	atk_actions   = g_array_new (FALSE, FALSE, sizeof (GladeAtkActionInfo));
-	accels        = g_array_new (FALSE, FALSE, sizeof (GladeAccelInfo));
+				// Internal children !!!
+				if (internal)
+				{
+					GObject *child_object =
+						glade_widget_get_internal_child 
+						(parent, internal);
+					
+					if (!child_object)
+					{
+						g_warning ("Failed to locate "
+							   "internal child %s of %s",
+							   internal,
+							   glade_widget_get_name (parent));
+						return FALSE;
+					}
+
+					if (!(widget = 
+					      glade_widget_get_from_gobject (child_object)))
+						g_error ("Unable to get GladeWidget "
+							 "for internal child %s\n",
+							 internal);
+
+					/* Apply internal widget name from here */
+					glade_widget_set_name (widget, id);
+				} else { 
+					widget = glade_widget_adaptor_create_widget
+						(adaptor, FALSE,
+						 "name", id, 
+						 "parent", parent, 
+						 "project", project, 
+						 "reason", GLADE_CREATE_LOAD, NULL);
+				}
 
-	for (list = widget->properties; list; list = list->next)
-	{
-		GladeProperty *property = list->data;
+				glade_widget_adaptor_read_widget (adaptor,
+								  widget,
+								  node);
 
-		/* This should never happen */
-		if (property->klass->packing)
-			continue;
+				glade_widget_read_children (widget, node);
 
-		switch (property->klass->type)
-		{
-		case GPC_NORMAL:
-			glade_property_write (property, interface, props);
-			break;
-		case GPC_ATK_PROPERTY:
-			glade_property_write (property, interface, atk_props);
-			break;
-		case GPC_ATK_RELATION:
-			glade_property_write (property, interface, atk_relations);
-			break;
-		case GPC_ATK_ACTION:
-			glade_property_write (property, interface, atk_actions);
-			break;
-		case GPC_ACCEL_PROPERTY:
-			glade_property_write (property, interface, accels);
-			break;
-		default:
-			break;
+			}
+			g_free (id);
 		}
+		g_free (klass);
 	}
 
-	/* Properties */
-	info->properties = (GladePropInfo *) props->data;
-	info->n_properties = props->len;
-	g_array_free(props, FALSE);
-
-	/* Atk Properties */
-	info->atk_props = (GladePropInfo *) atk_props->data;
-	info->n_atk_props = atk_props->len;
-	g_array_free(atk_props, FALSE);
-
-	/* Atk Relations */
-	info->relations = (GladeAtkRelationInfo *) atk_relations->data;
-	info->n_relations = atk_relations->len;
-	g_array_free(atk_relations, FALSE);
-
-	/* Atk Actions */
-	info->atk_actions = (GladeAtkActionInfo *) atk_actions->data;
-	info->n_atk_actions = atk_actions->len;
-	g_array_free(atk_actions, FALSE);
-
-	/* Accels */
-	info->accels = (GladeAccelInfo *) accels->data;
-	info->n_accels = accels->len;
-	g_array_free(accels, FALSE);
-
-	/* Signals */
-	write_signals_context.interface = interface;
-	write_signals_context.signals = g_array_new (FALSE, FALSE,
-	                                              sizeof (GladeSignalInfo));
-	g_hash_table_foreach (widget->signals,
-			      glade_widget_write_signals,
-			      &write_signals_context);
-	info->signals = (GladeSignalInfo *)
-				write_signals_context.signals->data;
-	info->n_signals = write_signals_context.signals->len;
-	g_array_free (write_signals_context.signals, FALSE);
-
-	/* Children */
-	if ((list =
-	     glade_widget_adaptor_get_children (widget->adaptor,
-						widget->object)) != NULL)
-	{
-		children = g_array_new (FALSE, FALSE, sizeof (GladeChildInfo));
-		while (list && list->data)
-		{
-			GObject *child = list->data;
-			glade_widget_write_child (children, widget, child, interface);
-			list = list->next;
-		}
-		info->children   = (GladeChildInfo *) children->data;
-		info->n_children = children->len;
-		
-		g_array_free (children, FALSE);
-		g_list_free (list);
-	}
-	g_hash_table_insert(interface->names, info->name, info);
+	glade_widget_pop_superuser ();
 
-	return info;
+	return widget;
 }
 
-
-static gboolean
-glade_widget_write_special_child_prop (GArray *props, 
-				       GladeWidget *parent, 
-				       GObject *object, 
-				       GladeInterface *interface)
+static void
+glade_widget_write_special_child_prop (GladeWidget     *parent, 
+				       GObject         *object,
+				       GladeXmlContext *context,
+				       GladeXmlNode    *node)
 {
-	GladePropInfo         info = { 0 };
-	gchar                *buff, *special_child_type;
+	GladeXmlNode *prop_node;
+	gchar        *buff, *special_child_type;
 
 	buff = g_object_get_data (object, "special-child-type");
-
 	g_object_get (parent->adaptor, "special-child-type", &special_child_type, NULL);
 
 	if (special_child_type && buff)
 	{
-		info.name  = glade_xml_alloc_propname (interface, 
-						       special_child_type);
-		info.value = glade_xml_alloc_string (interface, buff);
-		g_array_append_val (props, info);
 
-		g_free (special_child_type);
-		return TRUE;
+		prop_node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY);
+		glade_xml_node_append_child (node, prop_node);
+
+		/* Name and value */
+		glade_xml_node_set_property_string (prop_node, 
+						    GLADE_XML_TAG_NAME, 
+						    special_child_type);
+		glade_xml_set_content (prop_node, buff);
+
 	}
 	g_free (special_child_type);
-	return FALSE;
 }
 
-gboolean
-glade_widget_write_child (GArray         *children, 
-			  GladeWidget    *parent, 
-			  GObject        *object,
-			  GladeInterface *interface)
+static void
+glade_widget_write_child (GladeWidget     *widget,
+			  GladeXmlContext *context,
+			  GladeXmlNode    *node)
 {
-	GladeChildInfo info = { 0 };
-	GladeWidget *child_widget;
-	GList *list;
-	GArray *props;
+	GladeXmlNode *child_node, *packing_node;
+	GList        *props;
 
-	if (GLADE_IS_PLACEHOLDER (object))
-	{
-		props = g_array_new (FALSE, FALSE,
-				     sizeof (GladePropInfo));
-		/* Here we have to add the "special-child-type" packing property */
-		glade_widget_write_special_child_prop (props, parent, 
-						       object, interface);
+	child_node = glade_xml_node_new (context, GLADE_XML_TAG_CHILD);
+	glade_xml_node_append_child (node, child_node);
 
-		info.properties = (GladePropInfo *) props->data;
-		info.n_properties = props->len;
-		g_array_free(props, FALSE);
+	/* Set internal child */
+	if (widget->internal)
+		glade_xml_node_set_property_string (child_node, 
+						    GLADE_XML_TAG_INTERNAL_CHILD, 
+						    widget->internal);
 
-		g_array_append_val (children, info);
+	/* Write out the widget */
+	glade_widget_write (widget, context, child_node);
 
-		return TRUE;
-	}
+	/* Write out packing properties and special-child-type */
+	packing_node = glade_xml_node_new (context, GLADE_XML_TAG_PACKING);
+	glade_xml_node_append_child (child_node, packing_node);
 
-	child_widget = glade_widget_get_from_gobject (object);
-	if (!child_widget)
-		return FALSE;
-	
-	if (child_widget->internal)
-		info.internal_child = glade_xml_alloc_string(interface, child_widget->internal);
+	for (props = widget->packing_properties; 
+	     props; props = props->next)
+		glade_property_write (GLADE_PROPERTY (props->data), 
+				      context, packing_node);
 
-	info.child = glade_widget_write (child_widget, interface);
-	if (!info.child)
+	glade_widget_write_special_child_prop (widget->parent,
+					       widget->object,
+					       context, packing_node);
+
+	
+	/* Default packing properties and such are not saved,
+	 * so lets check afterwords if there was anything saved
+	 * and then just remove the node.
+	 */
+	if (!glade_xml_node_get_children (packing_node))
 	{
-		g_warning ("Failed to write child widget");
-		return FALSE;
+		glade_xml_node_remove (packing_node);
+		glade_xml_node_delete (packing_node);
 	}
+}
 
-	/* Append the packing properties */
-	props = g_array_new (FALSE, FALSE, sizeof (GladePropInfo));
-	
-	/* Here we have to add the "special-child-type" packing property */
-	glade_widget_write_special_child_prop (props, parent, 
-					       child_widget->object,
-					       interface);
+static void
+glade_widget_write_placeholder (GladeWidget     *parent,
+				GObject         *object,
+				GladeXmlContext *context,
+				GladeXmlNode    *node)
+{
+	GladeXmlNode *child_node, *packing_node, *placeholder_node;
 
-	if (child_widget->packing_properties != NULL) 
-	{
-		for (list = child_widget->packing_properties;
-		     list; list = list->next) 
-		{
-			GladeProperty *property;
+	child_node = glade_xml_node_new (context, GLADE_XML_TAG_CHILD);
+	glade_xml_node_append_child (node, child_node);
 
-			property = list->data;
-			g_assert (property->klass->packing != FALSE);
-			glade_property_write (property, interface, props);
-		}
-	}
+	placeholder_node = glade_xml_node_new (context, GLADE_XML_TAG_PLACEHOLDER);
+	glade_xml_node_append_child (child_node, placeholder_node);
 
-	info.properties = (GladePropInfo *) props->data;
-	info.n_properties = props->len;
-	g_array_free(props, FALSE);
-	
-	g_array_append_val (children, info);
+	/* maybe write out special-child-type here */
+	packing_node = glade_xml_node_new (context, GLADE_XML_TAG_PACKING);
+	glade_xml_node_append_child (child_node, packing_node);
 
-	return TRUE;
+	glade_widget_write_special_child_prop (parent, object,
+					       context, packing_node);
+
+	if (!glade_xml_node_get_children (packing_node))
+	{
+		glade_xml_node_remove (packing_node);
+		glade_xml_node_delete (packing_node);
+	}
 }
 
 /**
- * glade_widget_read:
- * @project: a #GladeProject
- * @info: a #GladeWidgetInfo
+ * glade_widget_write:
+ * @widget: The #GladeWidget
+ * @context: A #GladeXmlContext
+ * @node: A #GladeXmlNode
  *
- * Returns: a new #GladeWidget for @project, based on @info
+ * Recursively writes out @widget and its children
+ * and appends the created #GladeXmlNode to @node.
  */
-GladeWidget *
-glade_widget_read (GladeProject *project, GladeWidgetInfo *info)
+void
+glade_widget_write (GladeWidget     *widget,
+		    GladeXmlContext *context,
+		    GladeXmlNode    *node)
 {
-	GladeWidget *widget;
+	GladeXmlNode *widget_node;
+	GList        *list, *l;
 
-	glade_widget_push_superuser ();
-	loading_project = project;
-		
-	if ((widget = glade_widget_new_from_widget_info
-	     (info, project, NULL)) != NULL)
+	widget_node = glade_xml_node_new (context, GLADE_XML_TAG_WIDGET);
+	glade_xml_node_append_child (node, widget_node);
+
+	/* Set class and id */
+	glade_xml_node_set_property_string (widget_node, 
+					    GLADE_XML_TAG_CLASS, 
+					    widget->adaptor->name);
+	glade_xml_node_set_property_string (widget_node, 
+					    GLADE_XML_TAG_ID, 
+					    widget->name);
+
+	/* Write out widget content (properties and signals) */
+	glade_widget_adaptor_write_widget (widget->adaptor, widget, context, widget_node);
+
+	/* Write out children */
+	if ((list =
+	     glade_widget_adaptor_get_children (widget->adaptor,
+						widget->object)) != NULL)
 	{
-#if 0
-		if (glade_verbose)
-			glade_widget_debug (widget);
-#endif
-	}	
+		for (l = list; l; l = l->next)
+		{
+			GladeWidget *child = glade_widget_get_from_gobject (l->data);
 
-	loading_project = NULL;
-	glade_widget_pop_superuser ();
+			if (child) 
+				glade_widget_write_child (child, context, widget_node);
+			else if (GLADE_IS_PLACEHOLDER (l->data))
+				glade_widget_write_placeholder (widget, 
+								G_OBJECT (l->data),
+								context, widget_node);
+		}
+		g_list_free (list);
+	}
 
-	return widget;
 }
 
+
 static gint glade_widget_su_stack = 0;
 
 /**
@@ -4282,3 +4051,40 @@
 	return TRUE;
 }
 
+
+
+/**
+ * glade_widget_create_editor_property:
+ * @widget: A #GladeWidget
+ * @property: The widget's property
+ * @packing: whether @property indicates a packing property or not.
+ * @use_command: Whether the undo/redo stack applies here.
+ *
+ * This is a convenience function to create a GladeEditorProperty corresponding
+ * to @property
+ *
+ * Returns: A newly created and connected GladeEditorProperty
+ */
+GladeEditorProperty *
+glade_widget_create_editor_property (GladeWidget *widget,
+				     const gchar *property,
+				     gboolean     packing,
+				     gboolean     use_command)
+{
+	GladeEditorProperty *eprop;
+	GladeProperty *p;
+	
+	if (packing)
+		p = glade_widget_get_pack_property (widget, property);
+	else
+		p = glade_widget_get_property (widget, property);
+
+	g_return_val_if_fail (GLADE_IS_PROPERTY (p), NULL);
+
+	eprop = glade_widget_adaptor_create_eprop (widget->adaptor, 
+						   p->klass, 
+						   use_command);
+	glade_editor_property_load (eprop, p);
+	
+	return eprop;
+}

Modified: trunk/gladeui/glade-widget.h
==============================================================================
--- trunk/gladeui/glade-widget.h	(original)
+++ trunk/gladeui/glade-widget.h	Thu Apr  3 20:52:40 2008
@@ -97,7 +97,6 @@
 	
 	/* Construct parameters: */
 	GladeWidget       *construct_template;
-	GladeWidgetInfo   *construct_info;
 	GladeCreateReason  construct_reason;
 	gchar             *construct_internal;
 };
@@ -135,13 +134,7 @@
 
 void                    glade_widget_remove_child           (GladeWidget      *parent,
 							     GladeWidget      *child);
- 
-GladeWidgetInfo        *glade_widget_write                  (GladeWidget      *widget,
-							     GladeInterface   *interface);
- 
-GladeWidget            *glade_widget_read                   (GladeProject     *project,
-							     GladeWidgetInfo  *info);
- 
+
 void                    glade_widget_replace                (GladeWidget      *parent,
 							     GObject          *old_object,
 							     GObject          *new_object);
@@ -219,6 +212,20 @@
 GtkWidget *             glade_widget_create_action_menu     (GladeWidget *widget,
 							     const gchar *action_path);
 
+void                    glade_widget_write                  (GladeWidget     *widget,
+							     GladeXmlContext *context,
+							     GladeXmlNode    *node);
+
+GladeWidget            *glade_widget_read                   (GladeProject     *project,
+							     GladeWidget      *parent,
+							     GladeXmlNode     *node,
+							     const gchar      *internal);
+
+GladeEditorProperty    *glade_widget_create_editor_property (GladeWidget      *widget,
+							     const gchar      *property,
+							     gboolean          packing,
+							     gboolean          use_command);
+
 /*******************************************************************************
                       Project, object property references
  *******************************************************************************/

Modified: trunk/gladeui/glade-xml-utils.c
==============================================================================
--- trunk/gladeui/glade-xml-utils.c	(original)
+++ trunk/gladeui/glade-xml-utils.c	Thu Apr  3 20:52:40 2008
@@ -232,7 +232,7 @@
 	ret = glade_xml_get_value_int (node, name, val);
 
 	if (ret == FALSE)
-		g_warning ("The file did not contained the required value \"%s\"\n"
+		g_warning ("The file did not contain the required value \"%s\"\n"
 			   "Under the \"%s\" tag.", name, glade_xml_node_get_name (node));
 			
 	return ret;
@@ -425,10 +425,10 @@
 	if (value == NULL)
 	{
 		if (xtra == NULL)
-			g_warning ("The file did not contained the required value \"%s\"\n"
+			g_warning ("The file did not contain the required value \"%s\"\n"
 				   "Under the \"%s\" tag.", name, node->name);
 		else
-			g_warning ("The file did not contained the required value \"%s\"\n"
+			g_warning ("The file did not contain the required value \"%s\"\n"
 				   "Under the \"%s\" tag (%s).", name, node->name, xtra);
 	}
 
@@ -464,10 +464,10 @@
 	if (value == NULL)
 	{
 		if (xtra == NULL)
-			g_warning ("The file did not contained the required property \"%s\"\n"
+			g_warning ("The file did not contain the required property \"%s\"\n"
 				   "Under the \"%s\" tag.", name, node->name);
 		else
-			g_warning ("The file did not contained the required property \"%s\"\n"
+			g_warning ("The file did not contain the required property \"%s\"\n"
 				   "Under the \"%s\" tag (%s).", name, node->name, xtra);
 	}
 	return value;
@@ -514,7 +514,7 @@
 	child = glade_xml_search_child (node, name);
 
 	if (child == NULL)
-		g_warning ("The file did not contained the required tag \"%s\"\n"
+		g_warning ("The file did not contain the required tag \"%s\"\n"
 			   "Under the \"%s\" node.", name, glade_xml_node_get_name (node));
 
 	return child;
@@ -538,7 +538,7 @@
 glade_xml_context_new (GladeXmlDoc *doc, const gchar *name_space)
 {
 	/* We are not using the namespace now */
-	return glade_xml_context_new_real (doc, FALSE, NULL);
+	return glade_xml_context_new_real (doc, TRUE, NULL);
 }
 
 void
@@ -579,7 +579,7 @@
 	name_space = xmlSearchNsByHref (doc, doc->children, BAD_CAST(nspace));
 	if (name_space == NULL && nspace != NULL)
 	{
-		g_warning ("The file did not contained the expected name space\n"
+		g_warning ("The file did not contain the expected name space\n"
 			   "Expected \"%s\" [%s]",
 			   nspace, full_path);
 		xmlFreeDoc (doc);
@@ -589,7 +589,7 @@
 	root = xmlDocGetRootElement(doc);
 	if ((root->name == NULL) || (xmlStrcmp (root->name, BAD_CAST(root_name)) !=0 ))
 	{
-		g_warning ("The file did not contained the expected root name\n"
+		g_warning ("The file did not contain the expected root name\n"
 			   "Expected \"%s\", actual : \"%s\" [%s]",
 			   root_name, root->name, full_path);
 		xmlFreeDoc (doc);
@@ -630,6 +630,17 @@
 	xmlAddChild (node, child);
 }
 
+void
+glade_xml_node_remove (GladeXmlNode *node_in)
+{
+	xmlNodePtr node = (xmlNodePtr) node_in;
+	
+	g_return_if_fail (node  != NULL);
+	
+	xmlReplaceNode (node, NULL);
+}
+
+
 GladeXmlNode *
 glade_xml_node_new (GladeXmlContext *context, const gchar *name)
 {
@@ -744,39 +755,6 @@
 	return (GladeXmlNode *)node;
 }
 
-gchar *
-glade_xml_alloc_string(GladeInterface *interface, const gchar *string)
-{
-    gchar *s;
-
-    s = g_hash_table_lookup(interface->strings, string);
-    if (!s) {
-        s = g_strdup(string);
-        g_hash_table_insert(interface->strings, s, s);
-    }
-
-    return s;
-}
-
-gchar *
-glade_xml_alloc_propname(GladeInterface *interface, const gchar *string)
-{
-    static GString *norm_str;
-    guint i;
-
-    if (!norm_str)
-	norm_str = g_string_new_len(NULL, 64);
-
-    /* assign the string to norm_str */
-    g_string_assign(norm_str, string);
-    /* convert all dashes to underscores */
-    for (i = 0; i < norm_str->len; i++)
-	if (norm_str->str[i] == '-')
-	    norm_str->str[i] = '_';
-
-    return glade_xml_alloc_string(interface, norm_str->str);
-}
-
 gboolean
 glade_xml_load_sym_from_node (GladeXmlNode     *node_in,
 			      GModule          *module,

Modified: trunk/gladeui/glade-xml-utils.h
==============================================================================
--- trunk/gladeui/glade-xml-utils.h	(original)
+++ trunk/gladeui/glade-xml-utils.h	Thu Apr  3 20:52:40 2008
@@ -3,13 +3,18 @@
 #ifndef __GLADE_XML_UTILS_H__
 #define __GLADE_XML_UTILS_H__
 
-#include <gladeui/glade-parser.h>
+#include <glib.h>
+#include <gmodule.h>
+
 
 G_BEGIN_DECLS
 
 #define GLADE_XML_CONTEXT(c)    ((GladeXmlContext *)c)
 #define GLADE_XML_IS_CONTEXT(c) (c != NULL)
 
+#define CAST_BAD (gchar *)
+
+
 typedef struct _GladeXmlContext GladeXmlContext;
 typedef struct _GladeXmlNode    GladeXmlNode;
 typedef struct _GladeXmlDoc     GladeXmlDoc;
@@ -23,13 +28,15 @@
 #define GLADE_XML_TAG_ID                          "id"
 #define GLADE_XML_TAG_SIGNAL                      "signal"
 #define GLADE_XML_TAG_HANDLER                     "handler"
+#define GLADE_XML_TAG_AFTER                       "after"
+#define GLADE_XML_TAG_OBJECT                      "object"
 #define GLADE_XML_TAG_NAME                        "name"
 #define GLADE_XML_TAG_CHILD                       "child"
-#define GLADE_XML_TAG_SIGNAL                      "signal"
-#define GLADE_XML_TAG_AFTER                       "after"
 #define GLADE_XML_TAG_PACKING                     "packing"
 #define GLADE_XML_TAG_PLACEHOLDER                 "placeholder"
 #define GLADE_XML_TAG_INTERNAL_CHILD              "internal-child"
+#define GLADE_XML_TAG_I18N_TRUE                   "yes"
+#define GLADE_XML_TAG_SIGNAL_TRUE                 "yes"
 
 #define GLADE_TAG_GLADE_CATALOG                   "glade-catalog"
 #define GLADE_TAG_GLADE_WIDGET_CLASSES            "glade-widget-classes"
@@ -58,6 +65,10 @@
 #define GLADE_TAG_CONSTRUCTOR_FUNCTION            "constructor-function"
 #define GLADE_TAG_ACTION_ACTIVATE_FUNCTION        "action-activate-function"
 #define GLADE_TAG_CHILD_ACTION_ACTIVATE_FUNCTION  "child-action-activate-function"
+#define GLADE_TAG_READ_WIDGET_FUNCTION            "read-widget-function"
+#define GLADE_TAG_WRITE_WIDGET_FUNCTION           "write-widget-function"
+#define GLADE_TAG_CREATE_EPROP_FUNCTION           "create-editor-property-function"
+#define GLADE_TAG_STRING_FROM_VALUE_FUNCTION      "string-from-value-function"
 #define GLADE_TAG_PROPERTIES                      "properties"
 #define GLADE_TAG_PACKING_PROPERTIES              "packing-properties"
 #define GLADE_TAG_PROPERTY                        "property"
@@ -86,6 +97,8 @@
 #define GLADE_TAG_KEY                             "key"
 #define GLADE_TAG_VALUE                           "value"
 #define GLADE_TAG_TRANSLATABLE                    "translatable"
+#define GLADE_TAG_HAS_CONTEXT                     "context"
+#define GLADE_TAG_COMMENT                         "comments"
 #define GLADE_TAG_PACKING_DEFAULTS                "packing-defaults"
 #define GLADE_TAG_PARENT_CLASS                    "parent-class"
 #define GLADE_TAG_CHILD_PROPERTY                  "child-property"
@@ -100,7 +113,6 @@
 #define GLADE_TAG_RESOURCE                        "resource"
 #define GLADE_TAG_THEMED_ICON                     "themed-icon"
 #define GLADE_TAG_INIT_FUNCTION                   "init-function"
-#define GLADE_TAG_ATK_ACTION                      "atk-action"
 #define GLADE_TAG_ATK_PROPERTY                    "atk-property"
 #define GLADE_TAG_FIXED                           "fixed"
 #define GLADE_TAG_TRANSFER_ON_PASTE               "transfer-on-paste"
@@ -162,6 +174,8 @@
 gboolean       glade_xml_node_verify_silent (GladeXmlNode *node_in, const gchar *name);
 const gchar *  glade_xml_node_get_name (GladeXmlNode *node_in);
 void           glade_xml_node_append_child (GladeXmlNode * node, GladeXmlNode * child);
+void           glade_xml_node_remove (GladeXmlNode *node_in);
+
 
 /* Document Operatons */
 GladeXmlNode * glade_xml_doc_get_root (GladeXmlDoc *doc);
@@ -179,9 +193,6 @@
 						   const gchar *root_name);
 GladeXmlDoc *     glade_xml_context_get_doc (GladeXmlContext *context);
 
-gchar *		glade_xml_alloc_string   (GladeInterface *interface, const gchar *string);
-gchar *		glade_xml_alloc_propname (GladeInterface *interface, const gchar *string);
-
 gboolean        glade_xml_load_sym_from_node (GladeXmlNode     *node_in,
 					      GModule          *module,
 					      gchar            *tagname,

Modified: trunk/plugins/gtk+/Makefile.am
==============================================================================
--- trunk/plugins/gtk+/Makefile.am	(original)
+++ trunk/plugins/gtk+/Makefile.am	Thu Apr  3 20:52:40 2008
@@ -23,7 +23,7 @@
 	$(PLUGINS_WARN_CFLAGS)         \
 	$(AM_CFLAGS)
 
-libgladegtk_la_SOURCES     = glade-gtk.c fixed-bg.xpm
+libgladegtk_la_SOURCES     = glade-gtk.c glade-accels.c glade-keysyms.c fixed-bg.xpm
 libgladegtk_la_LDFLAGS     = -module -avoid-version $(AM_LDFLAGS)
 libgladegtk_la_LIBADD      = $(libgladeui) $(GTK_LIBS)
 

Modified: trunk/plugins/gtk+/glade-gtk.c
==============================================================================
--- trunk/plugins/gtk+/glade-gtk.c	(original)
+++ trunk/plugins/gtk+/glade-gtk.c	Thu Apr  3 20:52:40 2008
@@ -26,6 +26,7 @@
 
 #include "glade-gtk.h"
 #include "fixed-bg.xpm"
+#include "glade-accels.h"
 
 #include <gladeui/glade-editor-property.h>
 #include <gladeui/glade-base-editor.h>
@@ -242,6 +243,705 @@
 }
 
 /* ----------------------------- GtkWidget ------------------------------ */
+#define GLADE_TAG_ACCEL             "accelerator"
+#define GLADE_TAG_ACCEL_KEY         "key"
+#define GLADE_TAG_ACCEL_MODIFIERS   "modifiers"
+#define GLADE_TAG_ACCEL_SIGNAL      "signal"
+
+#define GLADE_TAG_A11Y_A11Y         "accessibility"
+#define GLADE_TAG_A11Y_ACTION       "atkaction"
+#define GLADE_TAG_A11Y_PROPERTY     "atkproperty"
+#define GLADE_TAG_A11Y_ACTION_NAME  "action_name" /* We should make -/_ synonymous */
+#define GLADE_TAG_A11Y_DESC         "description"
+#define GLADE_TAG_A11Y_RELATION     "atkrelation"
+#define GLADE_TAG_A11Y_TARGET       "target"
+#define GLADE_TAG_A11Y_TYPE         "type"
+
+static const gchar *atk_relations_list[] = {
+	"controlled-by",
+	"controller-for",
+	"labelled-by",
+	"label-for",
+	"member-of",
+	"node-child-of",
+	"flows-to",
+	"flows-from",
+	"subwindow-of",
+	"embeds",
+	"embedded-by",
+	"popup-for",
+	"parent-window-of",
+	"described-by",
+	"description-for",
+	NULL
+};
+
+
+static GdkModifierType
+glade_gtk_parse_modifiers (const gchar *string)
+{
+	const gchar     *pos = string;
+	GdkModifierType	 modifiers = 0;
+
+	while (pos[0])
+	{
+		if (!strncmp(pos, "GDK_", 4)) {
+			pos += 4;
+			if (!strncmp(pos, "SHIFT_MASK", 10)) {
+				modifiers |= GDK_SHIFT_MASK;
+				pos += 10;
+			} else if (!strncmp(pos, "LOCK_MASK", 9)) {
+				modifiers |= GDK_LOCK_MASK;
+				pos += 9;
+			} else if (!strncmp(pos, "CONTROL_MASK", 12)) {
+				modifiers |= GDK_CONTROL_MASK;
+				pos += 12;
+			} else if (!strncmp(pos, "MOD", 3) &&
+				   !strncmp(pos+4, "_MASK", 5)) {
+				switch (pos[3]) {
+				case '1':
+					modifiers |= GDK_MOD1_MASK; break;
+				case '2':
+					modifiers |= GDK_MOD2_MASK; break;
+				case '3':
+					modifiers |= GDK_MOD3_MASK; break;
+				case '4':
+					modifiers |= GDK_MOD4_MASK; break;
+				case '5':
+					modifiers |= GDK_MOD5_MASK; break;
+				}
+				pos += 9;
+			} else if (!strncmp(pos, "BUTTON", 6) &&
+				   !strncmp(pos+7, "_MASK", 5)) {
+				switch (pos[6]) {
+				case '1':
+					modifiers |= GDK_BUTTON1_MASK; break;
+				case '2':
+					modifiers |= GDK_BUTTON2_MASK; break;
+				case '3':
+					modifiers |= GDK_BUTTON3_MASK; break;
+				case '4':
+					modifiers |= GDK_BUTTON4_MASK; break;
+				case '5':
+					modifiers |= GDK_BUTTON5_MASK; break;
+				}
+				pos += 12;
+			} else if (!strncmp(pos, "RELEASE_MASK", 12)) {
+				modifiers |= GDK_RELEASE_MASK;
+				pos += 12;
+			} else
+				pos++;
+		} else
+			pos++;
+	}
+	return modifiers;
+}
+
+static void
+glade_gtk_widget_read_accels (GladeWidget  *widget,
+			      GladeXmlNode *node)
+{
+	GladeProperty  *property;
+	GladeXmlNode   *prop;
+	GladeAccelInfo *ainfo;
+	GValue         *value = NULL;
+	GList          *accels = NULL;
+
+	for (prop = glade_xml_node_get_children (node); 
+	     prop; prop = glade_xml_node_next (prop))
+	{
+		gchar *key, *modifiers, *signal;
+
+
+		if (!glade_xml_node_verify_silent (prop, GLADE_TAG_ACCEL))
+			continue;
+
+		/* Get from xml... */
+		key = glade_xml_get_property_string_required
+			(prop, GLADE_TAG_ACCEL_KEY, NULL);
+		signal = glade_xml_get_property_string_required
+			(prop, GLADE_TAG_ACCEL_SIGNAL, NULL);
+		modifiers = glade_xml_get_property_string (prop, GLADE_TAG_ACCEL_MODIFIERS);
+
+		/* translate to GladeAccelInfo... */
+		ainfo = g_new0 (GladeAccelInfo, 1);
+		ainfo->key = gdk_keyval_from_name(key);
+		ainfo->signal = signal; /* take string ownership... */
+		ainfo->modifiers = glade_gtk_parse_modifiers (modifiers);
+
+		accels = g_list_prepend (accels, ainfo);
+		g_free (modifiers);
+	}
+
+	if (accels)
+	{
+		value = g_new0 (GValue, 1);
+		g_value_init (value, GLADE_TYPE_ACCEL_GLIST);
+		g_value_take_boxed (value, accels);
+
+		property = glade_widget_get_property (widget, "accelerator");
+		glade_property_set_value (property, value);
+
+		g_value_unset (value);
+		g_free (value);
+	}
+}
+
+static void
+glade_gtk_parse_atk_props (GladeWidget  *widget,
+			   GladeXmlNode *node)
+{
+	GladeXmlNode  *prop;
+	GladeProperty *property;
+	GValue        *gvalue;
+	gchar         *value, *name, *id, *comment;
+	gint           translatable, has_context;
+	gboolean       is_action;
+
+	for (prop = glade_xml_node_get_children (node); 
+	     prop; prop = glade_xml_node_next (prop))
+	{
+		if (glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_PROPERTY))
+			is_action = FALSE;
+		else if (glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_ACTION))
+			is_action = TRUE;
+		else 
+			continue;
+
+		if (!is_action && 
+		    !(name = glade_xml_get_property_string_required
+		      (prop, GLADE_XML_TAG_NAME, NULL)))
+			continue;
+		else if (is_action && 
+			 !(name = glade_xml_get_property_string_required
+			   (prop, GLADE_TAG_A11Y_ACTION_NAME, NULL)))
+			continue;
+
+		/* Make sure we are working with dashes and
+		 * not underscores ... 
+		 */
+		id = glade_util_read_prop_name (name);
+		g_free (name);
+
+		/* We are namespacing the action properties internally
+		 * just incase they clash (all property names must be
+		 * unique...)
+		 */
+		if (is_action) 
+		{
+			name = g_strdup_printf ("atk-%s", id);
+			g_free (id);
+			id = name;
+		}
+
+		if ((property = glade_widget_get_property (widget, id)) != NULL)
+		{
+			/* Complex statement just getting the value here... */
+			if ((!is_action && 
+			     !(value = glade_xml_get_content (prop))) ||
+			    (is_action &&
+			     !(value = glade_xml_get_property_string_required
+			       (prop, GLADE_TAG_A11Y_DESC, NULL))))
+			{
+				/* XXX should be a glade_xml_get_content_required()... */
+				g_free (id);
+				continue;
+			}
+
+			/* Set the parsed value on the property ... */
+			gvalue = glade_property_class_make_gvalue_from_string
+				(property->klass, value, widget->project);
+			glade_property_set_value (property, gvalue);
+			g_value_unset (gvalue);
+			g_free (gvalue);
+
+			/* Deal with i18n... */
+			translatable = glade_xml_get_property_boolean
+				(prop, GLADE_TAG_TRANSLATABLE, FALSE);
+			has_context = glade_xml_get_property_boolean
+				(prop, GLADE_TAG_HAS_CONTEXT, FALSE);
+			comment = glade_xml_get_property_string
+				(prop, GLADE_TAG_COMMENT);
+
+			glade_property_i18n_set_translatable
+				(property, translatable);
+			glade_property_i18n_set_has_context
+				(property, has_context);
+			glade_property_i18n_set_comment
+				(property, comment);
+			
+			g_free (comment);
+			g_free (value);
+		}
+
+		g_free (id);
+	}
+}
+
+static void
+glade_gtk_parse_atk_relation (GladeProperty *property,
+			      GladeXmlNode  *node)
+{
+	GladeXmlNode *prop;
+	gchar *type, *target, *id, *tmp;
+	gchar *string = NULL;
+
+	for (prop = glade_xml_node_get_children (node); 
+	     prop; prop = glade_xml_node_next (prop))
+	{
+		if (!glade_xml_node_verify_silent (prop, GLADE_TAG_A11Y_RELATION))
+			continue;
+
+		if (!(type = 
+		     glade_xml_get_property_string_required
+		     (prop, GLADE_TAG_A11Y_TYPE, NULL)))
+			continue;
+
+		if (!(target = 
+		      glade_xml_get_property_string_required
+		      (prop, GLADE_TAG_A11Y_TARGET, NULL)))
+		{
+			g_free (type);
+			continue;
+		}
+
+		id = glade_util_read_prop_name (type);
+
+		if (!strcmp (id, property->klass->id))
+		{
+			if (string == NULL)
+				string = g_strdup (target);
+			else
+			{
+				tmp = g_strdup_printf ("%s%s%s", string, 
+						       GPC_OBJECT_DELIMITER, target);
+				string = (g_free (string), tmp);
+			}
+			
+		}
+
+		g_free (id);
+		g_free (type);
+		g_free (target);
+	}
+
+
+	/* we must synchronize this directly after loading this project
+	 * (i.e. lookup the actual objects after they've been parsed and
+	 * are present). this is a feature of object and object list properties
+	 * that needs a better api.
+	 */
+	if (string)
+	{
+		g_object_set_data_full (G_OBJECT (property), "glade-loaded-object", 
+					g_strdup (string), g_free);
+	}
+}
+
+static void
+glade_gtk_widget_read_atk_props (GladeWidget  *widget,
+				 GladeXmlNode *node)
+{
+	GladeXmlNode  *atk_node;
+	GladeProperty *property;
+	gint           i;
+
+	if ((atk_node = 
+	     glade_xml_search_child (node, GLADE_TAG_A11Y_A11Y)) != NULL)
+	{
+		/* Properties & actions */
+		glade_gtk_parse_atk_props (widget, atk_node);
+
+		/* Relations */
+		for (i = 0; atk_relations_list[i]; i++)
+		{
+			if ((property = 
+			     glade_widget_get_property (widget, 
+							atk_relations_list[i])))
+				glade_gtk_parse_atk_relation (property, atk_node);
+			else
+				g_warning ("Couldnt find atk relation %s",
+					   atk_relations_list[i]);
+		}
+	}
+}
+
+void
+glade_gtk_widget_read_widget (GladeWidgetAdaptor *adaptor,
+			      GladeWidget        *widget,
+			      GladeXmlNode       *node)
+{
+	/* This code should work the same for <packing> and <widget> */
+	if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
+		return;
+
+	/* First chain up and read in all the normal properties.. */
+        GWA_GET_CLASS (G_TYPE_OBJECT)->read_widget (adaptor, widget, node);
+
+	/* Read in accelerators */
+	glade_gtk_widget_read_accels (widget, node);
+
+	/* Read in atk props */
+	glade_gtk_widget_read_atk_props (widget, node);
+
+}
+
+static void
+glade_gtk_widget_write_atk_property (GladeProperty      *property,
+				     GladeXmlContext    *context,
+				     GladeXmlNode       *node)
+{
+	GladeXmlNode  *prop_node;
+	gchar         *value;
+	
+	glade_property_get (property, &value);
+	if (value && value[0])
+	{
+		prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_PROPERTY);
+		glade_xml_node_append_child (node, prop_node);
+
+		glade_xml_node_set_property_string (prop_node, 
+						    GLADE_TAG_NAME, 
+						    property->klass->id);
+
+		glade_xml_set_content (prop_node, value);
+
+		if (property->i18n_translatable)
+			glade_xml_node_set_property_string (prop_node, 
+							    GLADE_TAG_TRANSLATABLE, 
+							    GLADE_XML_TAG_I18N_TRUE);
+
+		if (property->i18n_has_context)
+			glade_xml_node_set_property_string (prop_node, 
+							    GLADE_TAG_HAS_CONTEXT, 
+							    GLADE_XML_TAG_I18N_TRUE);
+
+
+		if (property->i18n_comment)
+			glade_xml_node_set_property_string (prop_node, 
+							    GLADE_TAG_COMMENT, 
+							    property->i18n_comment);
+	}
+}
+
+static void
+glade_gtk_widget_write_atk_properties (GladeWidget        *widget,
+				       GladeXmlContext    *context,
+				       GladeXmlNode       *node)
+{
+	GladeProperty *name_prop, *desc_prop;
+
+	name_prop = glade_widget_get_property (widget, "AtkObject::accessible-name");
+	desc_prop = glade_widget_get_property (widget, "AtkObject::accessible-description");
+
+	glade_gtk_widget_write_atk_property (name_prop, context, node);
+	glade_gtk_widget_write_atk_property (desc_prop, context, node);
+}
+
+static void
+glade_gtk_widget_write_atk_relation (GladeProperty      *property,
+				     GladeXmlContext    *context,
+				     GladeXmlNode       *node)
+{
+	GladeXmlNode *prop_node;
+	gchar        *value, **split;
+	gint          i;
+
+	if ((value = glade_widget_adaptor_string_from_value
+	     (GLADE_WIDGET_ADAPTOR (property->klass->handle),
+	      property->klass, property->value)) != NULL)
+	{
+		if ((split = g_strsplit (value, GPC_OBJECT_DELIMITER, 0)) != NULL)
+		{
+			for (i = 0; split[i] != NULL; i++)
+			{
+				prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_RELATION);
+				glade_xml_node_append_child (node, prop_node);
+
+				glade_xml_node_set_property_string (prop_node, 
+								    GLADE_TAG_A11Y_TYPE, 
+								    property->klass->id);
+				glade_xml_node_set_property_string (prop_node, 
+								    GLADE_TAG_A11Y_TARGET, 
+								    split[i]);
+			}
+			g_strfreev (split);
+		}
+	}
+}
+
+static void
+glade_gtk_widget_write_atk_relations (GladeWidget        *widget,
+				      GladeXmlContext    *context,
+				      GladeXmlNode       *node)
+{
+	GladeProperty *property;
+	gint i;
+
+	for (i = 0; atk_relations_list[i]; i++)
+	{
+		if ((property = 
+		     glade_widget_get_property (widget, 
+						atk_relations_list[i])))
+			glade_gtk_widget_write_atk_relation (property, context, node);
+		else
+			g_warning ("Couldnt find atk relation %s on widget %s",
+				   atk_relations_list[i], widget->name);
+	}
+}
+
+static void
+glade_gtk_widget_write_atk_action (GladeProperty      *property,
+				   GladeXmlContext    *context,
+				   GladeXmlNode       *node)
+{
+	GladeXmlNode *prop_node;
+	gchar        *value = NULL;
+
+	glade_property_get (property, &value);
+
+	if (value && value[0])
+	{
+		prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_ACTION);
+		glade_xml_node_append_child (node, prop_node);
+
+		glade_xml_node_set_property_string (prop_node, 
+						    GLADE_TAG_A11Y_ACTION_NAME, 
+						    &property->klass->id[4]);
+		glade_xml_node_set_property_string (prop_node, 
+						    GLADE_TAG_A11Y_DESC, 
+						    value);
+	}
+}
+
+static void
+glade_gtk_widget_write_atk_actions (GladeWidget        *widget,
+				    GladeXmlContext    *context,
+				    GladeXmlNode       *node)
+{
+	GladeProperty *property;
+
+	if ((property = glade_widget_get_property (widget, "atk-click")) != NULL)
+		glade_gtk_widget_write_atk_action (property, context, node);
+	if ((property = glade_widget_get_property (widget, "atk-activate")) != NULL)
+		glade_gtk_widget_write_atk_action (property, context, node);
+	if ((property = glade_widget_get_property (widget, "atk-press")) != NULL)
+		glade_gtk_widget_write_atk_action (property, context, node);
+	if ((property = glade_widget_get_property (widget, "atk-release")) != NULL)
+		glade_gtk_widget_write_atk_action (property, context, node);
+}
+
+static void
+glade_gtk_widget_write_atk_props (GladeWidget        *widget,
+				  GladeXmlContext    *context,
+				  GladeXmlNode       *node)
+{
+	GladeXmlNode *atk_node;
+
+	atk_node = glade_xml_node_new (context, GLADE_TAG_A11Y_A11Y);
+	glade_xml_node_append_child (node, atk_node);
+
+	glade_gtk_widget_write_atk_properties (widget, context, atk_node);
+	glade_gtk_widget_write_atk_relations (widget, context, atk_node);
+	glade_gtk_widget_write_atk_actions (widget, context, atk_node);
+
+	if (!glade_xml_node_get_children (atk_node))
+	{
+		glade_xml_node_remove (atk_node);
+		glade_xml_node_delete (atk_node);
+	}
+}
+
+static gchar *
+glade_gtk_modifier_string_from_bits (GdkModifierType modifiers)
+{
+    GString *string = g_string_new ("");
+
+    if (modifiers & GDK_SHIFT_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_SHIFT_MASK");
+    }
+
+    if (modifiers & GDK_LOCK_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_LOCK_MASK");
+    }
+
+    if (modifiers & GDK_CONTROL_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_CONTROL_MASK");
+    }
+
+    if (modifiers & GDK_MOD1_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_MOD1_MASK");
+    }
+
+    if (modifiers & GDK_MOD2_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_MOD2_MASK");
+    }
+
+    if (modifiers & GDK_MOD3_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_MOD3_MASK");
+    }
+
+    if (modifiers & GDK_MOD4_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_MOD4_MASK");
+    }
+
+    if (modifiers & GDK_MOD5_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_MOD5_MASK");
+    }
+
+    if (modifiers & GDK_BUTTON1_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_BUTTON1_MASK");
+    }
+
+    if (modifiers & GDK_BUTTON2_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_BUTTON2_MASK");
+    }
+
+    if (modifiers & GDK_BUTTON3_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_BUTTON3_MASK");
+    }
+
+    if (modifiers & GDK_BUTTON4_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_BUTTON4_MASK");
+    }
+
+    if (modifiers & GDK_BUTTON5_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_BUTTON5_MASK");
+    }
+
+    if (modifiers & GDK_RELEASE_MASK) {
+	if (string->len > 0)
+	    g_string_append (string, " | ");
+	g_string_append (string, "GDK_RELEASE_MASK");
+    }
+
+    if (string->len > 0)
+	return g_string_free (string, FALSE);
+
+    g_string_free (string, TRUE);
+    return NULL;
+}
+
+
+static void
+glade_gtk_widget_write_accels (GladeWidget        *widget,
+			       GladeXmlContext    *context,
+			       GladeXmlNode       *node)
+{
+	GladeXmlNode  *accel_node;
+	GladeProperty *property;
+	GList         *list;
+
+	/* Some child widgets may have disabled the property */
+	if (!(property = glade_widget_get_property (widget, "accelerator")))
+		return;
+
+	for (list = g_value_get_boxed (property->value); 
+	     list; list = list->next)
+	{
+		GladeAccelInfo *accel = list->data;
+		gchar *modifiers = glade_gtk_modifier_string_from_bits (accel->modifiers);
+
+		accel_node = glade_xml_node_new (context, GLADE_TAG_ACCEL);
+		glade_xml_node_append_child (node, accel_node);
+
+		glade_xml_node_set_property_string (accel_node, GLADE_TAG_ACCEL_KEY,
+						    gdk_keyval_name(accel->key));
+		glade_xml_node_set_property_string (accel_node, GLADE_TAG_ACCEL_SIGNAL,
+						    accel->signal);
+		glade_xml_node_set_property_string (accel_node, GLADE_TAG_ACCEL_MODIFIERS,
+						    modifiers);
+
+		g_free (modifiers);
+	}
+
+
+}
+
+void
+glade_gtk_widget_write_widget (GladeWidgetAdaptor *adaptor,
+			       GladeWidget        *widget,
+			       GladeXmlContext    *context,
+			       GladeXmlNode       *node)
+{
+	/* This code should work the same for <packing> and <widget> */
+	if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET))
+		return;
+
+	/* First chain up and read in all the normal properties.. */
+        GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node);
+
+
+	/* Write atk props */
+	glade_gtk_widget_write_atk_props (widget, context, node);
+
+	/* Write accelerators */
+	glade_gtk_widget_write_accels (widget, context, node);
+
+}
+
+
+GladeEditorProperty *
+glade_gtk_widget_create_eprop (GladeWidgetAdaptor *adaptor,
+			       GladePropertyClass *klass,
+			       gboolean            use_command)
+{
+	GladeEditorProperty *eprop;
+
+	/* chain up.. */
+	if (GLADE_IS_PARAM_SPEC_ACCEL (klass->pspec))
+		eprop = g_object_new (GLADE_TYPE_EPROP_ACCEL,
+				      "property-class", klass, 
+				      "use-command", use_command,
+				      NULL);
+	else
+		eprop = GWA_GET_CLASS 
+			(G_TYPE_OBJECT)->create_eprop (adaptor, 
+						       klass, 
+						       use_command);
+	return eprop;
+}
+
+gchar *
+glade_gtk_widget_string_from_value (GladeWidgetAdaptor *adaptor,
+				    GladePropertyClass *klass,
+				    const GValue       *value)
+{
+	if (GLADE_IS_PARAM_SPEC_ACCEL (klass->pspec))
+		return glade_accels_make_string (g_value_get_boxed (value));
+	else
+		return GWA_GET_CLASS 
+			(G_TYPE_OBJECT)->string_from_value (adaptor, 
+							    klass, 
+							    value);
+}
+
 static void
 widget_parent_changed (GtkWidget          *widget,
 		       GParamSpec         *pspec,

Modified: trunk/plugins/gtk+/gtk+.xml.in
==============================================================================
--- trunk/plugins/gtk+/gtk+.xml.in	(original)
+++ trunk/plugins/gtk+/gtk+.xml.in	Thu Apr  3 20:52:40 2008
@@ -11,6 +11,10 @@
       <set-property-function>glade_gtk_widget_set_property</set-property-function>
       <get-property-function>glade_gtk_widget_get_property</get-property-function>
       <action-activate-function>glade_gtk_widget_action_activate</action-activate-function>
+      <read-widget-function>glade_gtk_widget_read_widget</read-widget-function>
+      <write-widget-function>glade_gtk_widget_write_widget</write-widget-function>
+      <create-editor-property-function>glade_gtk_widget_create_eprop</create-editor-property-function>
+      <string-from-value-function>glade_gtk_widget_string_from_value</string-from-value-function>
 
       <actions>
         <action id="remove_parent" _name="Remove Parent" stock="gtk-remove"/>
@@ -84,101 +88,101 @@
 	<property id="has-default" ignore="True" common="True"/>
 
 	<!-- Accelerators -->
-	<property id="accelerator" _name="Accelerators" ignore="True" common="True">
+	<property id="accelerator" _name="Accelerators" ignore="True" common="True" save="False">
 	  <spec>glade_standard_accel_spec</spec>
 	</property>
 
 	<!-- Atk name and description properties -->
-	<property id="accessible-name" _name="Accessible Name" ignore="True" atk-property="True" translatable="True">
+	<property id="AtkObject::accessible-name" _name="Accessible Name" ignore="True" atk-property="True" translatable="True" save="False">
 	  <_tooltip>Object instance's name formatted for assistive technology access</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
 	</property>
 
-	<property id="accessible-description" _name="Accessible Description" ignore="True" atk-property="True" translatable="True">
+	<property id="AtkObject::accessible-description" _name="Accessible Description" ignore="True" atk-property="True" translatable="True" save="False">
 	  <_tooltip>Description of an object, formatted for assistive technology access</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
 	</property>
 
 	<!-- Atk relationset properties -->
-	<property id="controlled-by" _name="Controlled By" ignore="True" atk-property="True">
+	<property id="controlled-by" _name="Controlled By" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates an object controlled by one or more target objects</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="controller-for" _name="Controller For" ignore="True" atk-property="True">
+	<property id="controller-for" _name="Controller For" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates an object is a controller for one or more target objects</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="labelled-by" _name="Labelled By" ignore="True" atk-property="True">
+	<property id="labelled-by" _name="Labelled By" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates an object is labelled by one or more target objects</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="label-for" _name="Label For" ignore="True" atk-property="True">
+	<property id="label-for" _name="Label For" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates an object is a label for one or more target objects</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="member-of" _name="Member Of" ignore="True" atk-property="True">
+	<property id="member-of" _name="Member Of" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates an object is a member of a group of one or more target objects</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="node-child-of" _name="Node Child Of" ignore="True" atk-property="True">
+	<property id="node-child-of" _name="Node Child Of" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates an object is a cell in a treetable which is displayed because a 
 cell in the same column is expanded and identifies that cell</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="flows-to" _name="Flows To" ignore="True" atk-property="True">
+	<property id="flows-to" _name="Flows To" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates that the object has content that flows logically to another 
 AtkObject in a sequential way, (for instance text-flow)</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="flows-from" _name="Flows From" ignore="True" atk-property="True">
+	<property id="flows-from" _name="Flows From" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates that the object has content that flows logically from another 
 AtkObject in a sequential way, (for instance text-flow)</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="subwindow-of" _name="Subwindow Of" ignore="True" atk-property="True">
+	<property id="subwindow-of" _name="Subwindow Of" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates a subwindow attached to a component but otherwise has no 
 connection in the UI hierarchy to that component</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="embeds" _name="Embeds" ignore="True" atk-property="True">
+	<property id="embeds" _name="Embeds" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates that the object visually embeds another object's content, i.e. 
 this object's content flows around another's content</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="embedded-by" _name="Embedded By" ignore="True" atk-property="True">
+	<property id="embedded-by" _name="Embedded By" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Inverse of 'Embeds', indicates that this object's content is visually 
 embedded in another object</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="popup-for" _name="Popup For" ignore="True" atk-property="True">
+	<property id="popup-for" _name="Popup For" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates that an object is a popup for another object</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="parent-window-of" _name="Parent Window Of" ignore="True" atk-property="True">
+	<property id="parent-window-of" _name="Parent Window Of" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates that an object is a parent window of another object</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="described-by" _name="Described By" ignore="True" atk-property="True">
+	<property id="described-by" _name="Described By" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates that another object provides descriptive information about this object; more verbose than 'Labelled By'</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
 
-	<property id="description-for" _name="Description For" ignore="True" atk-property="True">
+	<property id="description-for" _name="Description For" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Indicates that an object provides descriptive information about another object; more verbose than 'Label For'</_tooltip>
 	  <spec>glade_standard_objects_spec</spec>
 	</property>
@@ -351,7 +355,7 @@
           <spec>glade_standard_boolean_spec</spec>
         </property>
 	<!-- Atk click property -->
-	<property id="atk-click" _name="Click" ignore="True" atk-action="True">
+	<property id="atk-click" _name="Click" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Click atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
@@ -605,7 +609,7 @@
 	  </displayable-values>
 	</property>
 	<!-- Atk activate property -->
-	<property id="atk-activate" _name="Activate" ignore="True" atk-action="True">
+	<property id="atk-activate" _name="Activate" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Activate atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
@@ -699,21 +703,21 @@
 	</property>
 
 	<!-- Atk click property -->
-	<property id="atk-click" _name="Click" ignore="True" atk-action="True">
+	<property id="atk-click" _name="Click" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Click atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
 	</property>
 
 	<!-- Atk press property -->
-	<property id="atk-press" _name="Press" ignore="True" atk-action="True">
+	<property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Press atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
 	</property>
 
 	<!-- Atk release property -->
-	<property id="atk-release" _name="Release" ignore="True" atk-action="True">
+	<property id="atk-release" _name="Release" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Release atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
@@ -854,7 +858,7 @@
 	</property>
 
 	<!-- Atk press property -->
-	<property id="atk-press" _name="Press" ignore="True" atk-action="True">
+	<property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Press atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
@@ -1292,7 +1296,7 @@
 	<property id="label-widget" disabled="True"/>
 
 	<!-- Atk activate property -->
-	<property id="atk-activate" _name="Activate" ignore="True" atk-action="True">
+	<property id="atk-activate" _name="Activate" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Activate atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
@@ -1477,7 +1481,7 @@
 	<property id="size" disabled="True"/>
 
 	<!-- Atk press property -->
-	<property id="atk-press" _name="Press" ignore="True" atk-action="True">
+	<property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Press atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>
@@ -1489,7 +1493,7 @@
     <glade-widget-class name="GtkOptionMenu" generic-name="optionmenu" _title="Option Menu">
       <properties>
 	<!-- Atk press property -->
-	<property id="atk-press" _name="Press" ignore="True" atk-action="True">
+	<property id="atk-press" _name="Press" ignore="True" atk-property="True" save="False">
 	  <_tooltip>Set the description of the Press atk action</_tooltip>
 	  <spec>glade_standard_string_spec</spec>
 	  <visible-lines>2</visible-lines>



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