? bigbadbuilder.patch
? bigbadbuilderpatch.tgz
? gtk/gtkbuildable.c
? gtk/gtkbuildable.h
? gtk/gtkbuilder.c
? gtk/gtkbuilder.h
? gtk/gtkbuilderparser.c
? gtk/gtkbuilderprivate.h
? gtk/gtkclist.c.backup
? gtk/gtkradiomenuitem.c.backup
? tests/Fry.jpg
? tests/Fry.png
? tests/builderdemo
? tests/builderdemo.c
? tests/buildertest
? tests/buildertest.c
? tests/demo.glade
? tests/demo.glade-backup
? tests/demo.glade.2
? tests/full_test.glade
? tests/full_test.glade.backup
? tests/photo.jpg
? tests/testproject.glade
? tests/toolbar.png
Index: gtk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/Makefile.am,v
retrieving revision 1.321
diff -u -p -r1.321 Makefile.am
--- gtk/Makefile.am	5 Oct 2006 15:51:40 -0000	1.321
+++ gtk/Makefile.am	4 Dec 2006 07:08:58 -0000
@@ -143,6 +143,9 @@ gtk_public_h_sources =          \
 	gtkbin.h		\
 	gtkbindings.h		\
 	gtkbox.h		\
+	gtkbuilder.h		\
+	gtkbuildable.h		\
+	gtkbuilderprivate.h 	\
 	gtkbutton.h		\
 	gtkcalendar.h		\
 	gtkcelleditable.h	\
@@ -391,6 +394,9 @@ gtk_base_c_sources =            \
 	gtkbin.c		\
 	gtkbindings.c		\
 	gtkbox.c		\
+	gtkbuildable.c		\
+	gtkbuilder.c		\
+	gtkbuilderparser.c	\
 	gtkbutton.c		\
 	gtkcalendar.c		\
 	gtkcelleditable.c	\
Index: gtk/gtk.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtk.h,v
retrieving revision 1.84
diff -u -p -r1.84 gtk.h
--- gtk/gtk.h	21 Apr 2006 15:09:28 -0000	1.84
+++ gtk/gtk.h	4 Dec 2006 07:08:58 -0000
@@ -45,6 +45,7 @@
 #include <gtk/gtkbin.h>
 #include <gtk/gtkbindings.h>
 #include <gtk/gtkbox.h>
+#include <gtk/gtkbuildable.h>
 #include <gtk/gtkbutton.h>
 #include <gtk/gtkcalendar.h>
 #include <gtk/gtkcelllayout.h>
Index: gtk/gtk.symbols
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtk.symbols,v
retrieving revision 1.134
diff -u -p -r1.134 gtk.symbols
--- gtk/gtk.symbols	16 Nov 2006 12:56:29 -0000	1.134
+++ gtk/gtk.symbols	4 Dec 2006 07:09:06 -0000
@@ -414,6 +414,37 @@ gtk_box_set_spacing
 #endif
 #endif
 
+#if IN_HEADER(__GTK_BUILDABLE_H__)
+#if IN_FILE(__GTK_BUILDABLE_C__)
+gtk_buildable_add
+gtk_buildable_construct_child
+gtk_buildable_custom_tag_start
+gtk_buildable_custom_tag_end
+gtk_buildable_get_internal_child
+gtk_buildable_get_name
+gtk_buildable_get_type G_GNUC_CONST
+gtk_buildable_set_name
+gtk_buildable_set_property
+#endif
+#endif
+
+#if IN_HEADER(__GTK_BUILDER_H__)
+#if IN_FILE(__GTK_BUILDER_C__)
+gtk_builder_get_object
+gtk_builder_get_object_name
+gtk_builder_get_objects
+gtk_builder_get_type G_GNUC_CONST
+gtk_builder_new
+gtk_builder_parse_buffer
+gtk_builder_parse_filename
+gtk_builder_set_translation_domain
+gtk_builder_signal_autoconnect
+gtk_builder_signal_autoconnect_full
+gtk_builder_value_from_string
+gtk_builder_value_from_string_type
+#endif
+#endif
+
 #if IN_HEADER(__GTK_BUTTON_BOX_H__)
 #if IN_FILE(__GTK_BUTTON_BOX_C__)
 #ifndef GTK_DISABLE_DEPRECATED
@@ -4339,6 +4370,8 @@ gtk_tree_view_columns_autosize
 #if IN_HEADER(__GTK_TYPE_UTILS_H__)
 #if IN_FILE(__GTK_TYPE_UTILS_C__)
 gtk_type_class
+gtk_type_register
+gtk_registered_type_from_name
 gtk_identifier_get_type G_GNUC_CONST
 #ifndef GTK_DISABLE_DEPRECATED
 gtk_type_enum_find_value
Index: gtk/gtkaction.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaction.c,v
retrieving revision 1.71
diff -u -p -r1.71 gtkaction.c
--- gtk/gtkaction.c	8 Oct 2006 05:06:29 -0000	1.71
+++ gtk/gtkaction.c	4 Dec 2006 07:09:09 -0000
@@ -46,6 +46,7 @@
 #include "gtktoolbutton.h"
 #include "gtktoolbar.h"
 #include "gtkprivate.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 
@@ -107,14 +108,22 @@ enum 
   PROP_ACTION_GROUP
 };
 
+/* GtkBuildable */
+static void gtk_action_buildable_init           (GtkBuildableIface *iface);
+static void gtk_action_buildable_set_name       (GtkBuildable *buildable,
+						 GtkBuilder   *builder,
+						 const gchar  *name);
+
+G_DEFINE_TYPE_WITH_CODE (GtkAction, gtk_action, G_TYPE_OBJECT,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_action_buildable_init))
+
 
 static GQuark      accel_path_id  = 0;
 static GQuark      quark_gtk_action_proxy  = 0;
 static const gchar accel_path_key[] = "GtkAction::accel_path";
 static const gchar gtk_action_proxy_key[] = "gtk-action";
 
-G_DEFINE_TYPE (GtkAction, gtk_action, G_TYPE_OBJECT)
-
 static void gtk_action_finalize     (GObject *object);
 static void gtk_action_set_property (GObject         *object,
 				     guint            prop_id,
@@ -366,6 +375,25 @@ gtk_action_init (GtkAction *action)
   action->private_data->action_group = NULL;
 
   action->private_data->proxies = NULL;
+}
+
+static void
+gtk_action_buildable_init (GtkBuildableIface *iface)
+{
+  iface->set_name = gtk_action_buildable_set_name;
+}
+
+static void
+gtk_action_buildable_set_name (GtkBuildable *buildable,
+			       GtkBuilder   *builder,
+			       const gchar  *name)
+{
+  gchar *tmp;
+  GtkAction *action = GTK_ACTION (buildable);
+
+  tmp = action->private_data->name;
+  action->private_data->name = g_strdup (name);
+  g_free (tmp);
 }
 
 /**
Index: gtk/gtkactiongroup.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkactiongroup.c,v
retrieving revision 1.60
diff -u -p -r1.60 gtkactiongroup.c
--- gtk/gtkactiongroup.c	3 Oct 2006 15:54:52 -0000	1.60
+++ gtk/gtkactiongroup.c	4 Dec 2006 07:09:12 -0000
@@ -31,6 +31,7 @@
 #include <config.h>
 
 #include "gtkactiongroup.h"
+#include "gtkbuildable.h"
 #include "gtkiconfactory.h"
 #include "gtkicontheme.h"
 #include "gtkstock.h"
@@ -87,6 +88,15 @@ static void       gtk_action_group_get_p
 static GtkAction *gtk_action_group_real_get_action (GtkActionGroup      *self,
 						    const gchar         *name);
 
+/* GtkBuildable */
+static void gtk_action_group_buildable_init (GtkBuildableIface *iface);
+static void gtk_action_group_buildable_add (GtkBuildable  *buildable,
+					    GtkBuilder    *builder,
+					    GObject       *child,
+					    const gchar   *type);
+static void gtk_action_group_buildable_set_name (GtkBuildable *buildable,
+						 GtkBuilder   *builder,
+						 const gchar  *name);
 
 GType
 gtk_action_group_get_type (void)
@@ -108,10 +118,20 @@ gtk_action_group_get_type (void)
         (GInstanceInitFunc) gtk_action_group_init,
       };
 
+      static const GInterfaceInfo buildable_info =
+      {
+	(GInterfaceInitFunc) gtk_action_group_buildable_init,
+	NULL,
+	NULL
+      };
+
       type = g_type_register_static (G_TYPE_OBJECT, I_("GtkActionGroup"),
 				     &type_info, 0);
-    }
 
+      g_type_add_interface_static (type,
+				   GTK_TYPE_BUILDABLE,
+				   &buildable_info);
+    }
   return type;
 }
 
@@ -270,6 +290,32 @@ gtk_action_group_init (GtkActionGroup *s
   self->private_data->translate_func = NULL;
   self->private_data->translate_data = NULL;
   self->private_data->translate_notify = NULL;
+}
+
+static void
+gtk_action_group_buildable_init (GtkBuildableIface *iface)
+{
+  iface->add = gtk_action_group_buildable_add;
+  iface->set_name = gtk_action_group_buildable_set_name;
+}
+
+static void
+gtk_action_group_buildable_add (GtkBuildable  *buildable,
+				GtkBuilder    *builder,
+				GObject       *child,
+				const gchar   *type)
+{
+  gtk_action_group_add_action (GTK_ACTION_GROUP (buildable),
+			       GTK_ACTION (child));
+}
+
+static void
+gtk_action_group_buildable_set_name (GtkBuildable *buildable,
+				     GtkBuilder   *builder,
+				     const gchar  *name)
+{
+  GtkActionGroup *self = GTK_ACTION_GROUP (buildable);
+  self->private_data->name = g_strdup (name);
 }
 
 /**
Index: gtk/gtkbutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkbutton.c,v
retrieving revision 1.145
diff -u -p -r1.145 gtkbutton.c
--- gtk/gtkbutton.c	8 Oct 2006 05:06:29 -0000	1.145
+++ gtk/gtkbutton.c	4 Dec 2006 07:09:18 -0000
@@ -36,6 +36,7 @@
 #include "gtkvbox.h"
 #include "gtkstock.h"
 #include "gtkiconfactory.h"
+#include "gtkbuildable.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
 #include "gtkalias.h"
@@ -142,9 +143,20 @@ static void gtk_button_grab_notify     (
 					gboolean               was_grabbed);
 
 
+static void gtk_button_buildable_init (GtkBuildableIface *iface);
+static void gtk_button_buildable_set_property (GtkBuildable *buildable,
+					       GtkBuilder   *builder,
+					       const gchar  *name,
+					       const GValue *value);
+
+
 static guint button_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (GtkButton, gtk_button, GTK_TYPE_BIN)
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkButton, gtk_button, GTK_TYPE_BIN,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_button_buildable_init));
 
 static void
 gtk_button_class_init (GtkButtonClass *klass)
@@ -516,6 +528,48 @@ gtk_button_init (GtkButton *button)
   priv->image_is_stock = TRUE;
   priv->image_position = GTK_POS_LEFT;
 }
+
+static void
+gtk_button_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_button_buildable_set_property;
+}
+
+static void
+gtk_button_buildable_set_property (GtkBuildable *buildable,
+				   GtkBuilder   *builder,
+				   const gchar  *name,
+				   const GValue *value)
+{
+  if (!strcmp (name, "response-id"))
+    {
+      if (gtk_builder_file_version (builder) <= 1)
+	{
+	  GValue val = { 0, };
+
+	  /* For version 1 glade files, support dialog buttons
+	   * the old fashioned way.
+	   */
+	  if (gtk_builder_value_from_string_type  (builder, G_TYPE_INT,
+						   g_value_get_string (value),
+						   &val))
+	    {
+	      g_object_set_data (buildable, "gtk-button-buildable-response-id",
+				 GINT_TO_POINTER (g_value_get_int (&val)));
+	      g_value_unset (&val);
+	    }
+	}
+      else
+	g_warning ("virtual response-id property on GtkButton is "
+		   "unsupported in builder file version %d\n",
+		   gtk_builder_file_version (builder));
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+}
+
 
 static void
 gtk_button_destroy (GtkObject *object)
Index: gtk/gtkcalendar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcalendar.c,v
retrieving revision 1.115
diff -u -p -r1.115 gtkcalendar.c
--- gtk/gtkcalendar.c	10 Oct 2006 21:51:11 -0000	1.115
+++ gtk/gtkcalendar.c	4 Dec 2006 07:09:24 -0000
@@ -53,6 +53,7 @@
 #include "gtkdnd.h"
 #include "gtkintl.h"
 #include "gtkmain.h"
+#include "gtkbuildable.h"
 #include "gtkmarshalers.h"
 #include "gtkprivate.h"
 #include "gdk/gdkkeysyms.h"
@@ -352,6 +353,12 @@ static gboolean gtk_calendar_drag_drop  
 						 gint              y,
 						 guint             time);
 
+static void     gtk_calender_buildable_init         (GtkBuildableIface *iface);
+static void     gtk_calender_buildable_set_property (GtkBuildable *buildable,
+						     GtkBuilder   *builder,
+						     const gchar  *name,
+						     const GValue *value);
+
 static void calendar_start_spinning (GtkCalendar *calendar,
 				     gint         click_child);
 static void calendar_stop_spinning  (GtkCalendar *calendar);
@@ -366,10 +373,16 @@ static void calendar_invalidate_arrow   
 
 static void calendar_compute_days      (GtkCalendar *calendar);
      
+
+
 static char    *default_abbreviated_dayname[7];
 static char    *default_monthname[12];
 
-G_DEFINE_TYPE (GtkCalendar, gtk_calendar, GTK_TYPE_WIDGET)
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkCalendar, gtk_calendar, GTK_TYPE_WIDGET,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_calender_buildable_init));
 
 static void
 gtk_calendar_class_init (GtkCalendarClass *class)
@@ -723,7 +736,41 @@ gtk_calendar_init (GtkCalendar *calendar
   calendar_compute_days (calendar);
 }
 
-
+
+static void
+gtk_calender_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_calender_buildable_set_property;
+}
+
+static void
+gtk_calender_buildable_set_property (GtkBuildable *buildable,
+				     GtkBuilder   *builder,
+				     const gchar  *name,
+				     const GValue *value)
+{
+  if (!strcmp (name, "display-options"))
+    {
+      GValue val = { 0, };
+
+      if (gtk_builder_value_from_string_type  (builder, GTK_TYPE_CALENDAR_DISPLAY_OPTIONS,
+					       g_value_get_string (value),
+					       &val))
+	{
+	  gtk_calendar_display_options (GTK_CALENDAR (buildable),
+					g_value_get_flags (&val));
+	  
+	  g_value_unset (&val);
+	}
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+}
+
+
+
 /****************************************
  *          Utility Functions           *
  ****************************************/
Index: gtk/gtkcelllayout.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcelllayout.c,v
retrieving revision 1.12
diff -u -p -r1.12 gtkcelllayout.c
--- gtk/gtkcelllayout.c	3 Oct 2006 15:54:52 -0000	1.12
+++ gtk/gtkcelllayout.c	4 Dec 2006 07:09:24 -0000
@@ -17,6 +17,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <string.h>
+#include <stdlib.h>
 #include <config.h>
 #include "gtkcelllayout.h"
 #include "gtkintl.h"
@@ -281,6 +283,114 @@ gtk_cell_layout_reorder (GtkCellLayout  
   (* GTK_CELL_LAYOUT_GET_IFACE (cell_layout)->reorder) (cell_layout,
                                                         cell,
                                                         position);
+}
+
+typedef struct {
+  GtkCellLayout   *cell_layout;
+  GtkCellRenderer *renderer;
+  gchar           *attr_name;
+} AttributesSubParserData;
+
+static void
+attributes_start_element (GMarkupParseContext *context,
+			  const gchar         *element_name,
+			  const gchar        **names,
+			  const gchar        **values,
+			  gpointer             user_data,
+			  GError             **error)
+{
+  AttributesSubParserData *parser_data = (AttributesSubParserData*)user_data;
+  guint i;
+
+  if (!strcmp (element_name, "attribute"))
+    for (i = 0; names[i]; i++)
+      if (!strcmp (names[i], "name"))
+	parser_data->attr_name = g_strdup (values[i]);
+  else if (!strcmp (element_name, "attributes"))
+    return;
+  else
+    g_warning ("Unsupported tag for GtkCellLayout: %s\n", element_name);
+}
+
+static void
+attributes_text_element (GMarkupParseContext *context,
+			 const gchar         *text,
+			 gsize                text_len,
+			 gpointer             user_data,
+			 GError             **error)
+{
+  AttributesSubParserData *parser_data = (AttributesSubParserData*)user_data;
+
+  if (!parser_data->attr_name)
+    return;
+  gtk_cell_layout_add_attribute (parser_data->cell_layout,
+				 parser_data->renderer,
+				 parser_data->attr_name, atoi (text));
+  g_free (parser_data->attr_name);
+  parser_data->attr_name = NULL;
+}
+
+static const GMarkupParser attributes_parser =
+  {
+    attributes_start_element,
+    NULL,
+    attributes_text_element,
+  };
+
+gboolean
+_gtk_cell_layout_buildable_custom_tag_start (GtkBuildable  *buildable,
+					     GtkBuilder    *builder,
+					     GObject       *child,
+					     const gchar   *tagname,
+					     GMarkupParser *parser,
+					     gpointer      *data)
+{
+  AttributesSubParserData *parser_data;
+
+  if (!child)
+    return FALSE;
+
+  if (!strcmp (tagname, "attributes"))
+    {
+      parser_data = g_slice_new0 (AttributesSubParserData);
+      parser_data->cell_layout = GTK_CELL_LAYOUT (buildable);
+      parser_data->renderer = GTK_CELL_RENDERER (child);
+      parser_data->attr_name = NULL;
+
+      *parser = attributes_parser;
+      *data = parser_data;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+void
+_gtk_cell_layout_buildable_custom_tag_end (GtkBuildable *buildable,
+					   GtkBuilder   *builder,
+					   GObject      *child,
+					   const gchar  *tagname,
+					   gpointer      data)
+{
+  AttributesSubParserData *parser_data;
+
+  parser_data = (AttributesSubParserData*)data;
+  g_assert (!parser_data->attr_name);
+  g_slice_free (AttributesSubParserData, parser_data);
+}
+
+void
+_gtk_cell_layout_buildable_add (GtkBuildable      *buildable,
+				GtkBuilder        *builder,
+				GObject           *child,
+				const gchar       *type)
+{
+  g_return_if_fail (GTK_IS_CELL_LAYOUT (buildable));
+  g_return_if_fail (GTK_IS_CELL_RENDERER (child));
+
+  (*GTK_CELL_LAYOUT_GET_IFACE (buildable)->pack_end) (GTK_CELL_LAYOUT (buildable),
+						      GTK_CELL_RENDERER (child),
+						      FALSE);
 }
 
 #define __GTK_CELL_LAYOUT_C__
Index: gtk/gtkcelllayout.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcelllayout.h,v
retrieving revision 1.4
diff -u -p -r1.4 gtkcelllayout.h
--- gtk/gtkcelllayout.h	8 Mar 2005 05:52:55 -0000	1.4
+++ gtk/gtkcelllayout.h	4 Dec 2006 07:09:25 -0000
@@ -24,6 +24,8 @@
 
 #include <gtk/gtkcellrenderer.h>
 #include <gtk/gtktreeviewcolumn.h>
+#include <gtk/gtkbuildable.h>
+#include <gtk/gtkbuilder.h>
 
 G_BEGIN_DECLS
 
@@ -95,7 +97,21 @@ void  gtk_cell_layout_clear_attributes  
 void  gtk_cell_layout_reorder            (GtkCellLayout         *cell_layout,
                                           GtkCellRenderer       *cell,
                                           gint                   position);
-
+gboolean _gtk_cell_layout_buildable_custom_tag_start (GtkBuildable  *buildable,
+						      GtkBuilder    *builder,
+						      GObject       *child,
+						      const gchar   *tagname,
+						      GMarkupParser *parser,
+						      gpointer      *data);
+void _gtk_cell_layout_buildable_custom_tag_end       (GtkBuildable  *buildable,
+						      GtkBuilder    *builder,
+						      GObject       *child,
+						      const gchar   *tagname,
+						      gpointer       data);
+void _gtk_cell_layout_buildable_add                  (GtkBuildable  *buildable,
+						      GtkBuilder    *builder,
+						      GObject       *child,
+						      const gchar   *type);
 
 G_END_DECLS
 
Index: gtk/gtkcellrenderer.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcellrenderer.c,v
retrieving revision 1.55
diff -u -p -r1.55 gtkcellrenderer.c
--- gtk/gtkcellrenderer.c	14 May 2006 04:25:28 -0000	1.55
+++ gtk/gtkcellrenderer.c	4 Dec 2006 07:09:27 -0000
@@ -23,6 +23,7 @@
 #include "gtkmarshalers.h"
 #include "gtkprivate.h"
 #include "gtktreeprivate.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 static void gtk_cell_renderer_get_property  (GObject              *object,
@@ -35,6 +36,7 @@ static void gtk_cell_renderer_set_proper
 					     GParamSpec           *pspec);
 static void set_cell_bg_color               (GtkCellRenderer      *cell,
 					     GdkColor             *color);
+static void gtk_cell_renderer_buildable_init  (GtkBuildableIface *iface);
 
 
 #define GTK_CELL_RENDERER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_RENDERER, GtkCellRendererPrivate))
@@ -73,7 +75,9 @@ enum {
 
 static guint cell_renderer_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_ABSTRACT_TYPE (GtkCellRenderer, gtk_cell_renderer, GTK_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkCellRenderer, gtk_cell_renderer, GTK_TYPE_OBJECT,
+				  G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+							 gtk_cell_renderer_buildable_init))
 
 static void
 gtk_cell_renderer_init (GtkCellRenderer *cell)
@@ -296,6 +300,12 @@ gtk_cell_renderer_class_init (GtkCellRen
                 P_("Whether this tag affects the cell background color"));
 
   g_type_class_add_private (object_class, sizeof (GtkCellRendererPrivate));
+}
+
+static void
+gtk_cell_renderer_buildable_init  (GtkBuildableIface *iface)
+{
+
 }
 
 static void
Index: gtk/gtkcellview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcellview.c,v
retrieving revision 1.48
diff -u -p -r1.48 gtkcellview.c
--- gtk/gtkcellview.c	6 Oct 2006 18:41:39 -0000	1.48
+++ gtk/gtkcellview.c	4 Dec 2006 07:09:28 -0000
@@ -18,6 +18,7 @@
  */
 
 #include <config.h>
+#include <string.h>
 #include "gtkcellview.h"
 #include "gtkcelllayout.h"
 #include "gtkintl.h"
@@ -26,6 +27,7 @@
 #include "gtkcellrendererpixbuf.h"
 #include "gtkprivate.h"
 #include <gobject/gmarshal.h>
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 typedef struct _GtkCellViewCellInfo GtkCellViewCellInfo;
@@ -103,7 +105,21 @@ static void       gtk_cell_view_cell_lay
 static void       gtk_cell_view_cell_layout_reorder            (GtkCellLayout         *layout,
                                                                 GtkCellRenderer       *cell,
                                                                 gint                   position);
+/* buildable */
+static void       gtk_cell_view_buildable_init                 (GtkBuildableIface     *iface);
+static gboolean   gtk_cell_view_buildable_custom_tag_start     (GtkBuildable  *buildable,
+								GtkBuilder    *builder,
+								GObject       *child,
+								const gchar   *tagname,
+								GMarkupParser *parser,
+								gpointer      *data);
+static void       gtk_cell_view_buildable_custom_tag_end       (GtkBuildable  *buildable,
+								GtkBuilder    *builder,
+								GObject       *child,
+								const gchar   *tagname,
+								gpointer       data);
 
+static GtkBuildableIface *parent_buildable_iface;
 
 #define GTK_CELL_VIEW_GET_PRIVATE(obj)    (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_CELL_VIEW, GtkCellViewPrivate))
 
@@ -118,7 +134,9 @@ enum
 
 G_DEFINE_TYPE_WITH_CODE (GtkCellView, gtk_cell_view, GTK_TYPE_WIDGET, 
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
-						gtk_cell_view_cell_layout_init))
+						gtk_cell_view_cell_layout_init)
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_cell_view_buildable_init))
 
 static void
 gtk_cell_view_class_init (GtkCellViewClass *klass)
@@ -175,6 +193,15 @@ gtk_cell_view_class_init (GtkCellViewCla
 }
 
 static void
+gtk_cell_view_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+  iface->add = _gtk_cell_layout_buildable_add;
+  iface->custom_tag_start = gtk_cell_view_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_cell_view_buildable_custom_tag_end;
+}
+
+static void
 gtk_cell_view_cell_layout_init (GtkCellLayoutIface *iface)
 {
   iface->pack_start = gtk_cell_view_cell_layout_pack_start;
@@ -1059,6 +1086,38 @@ gtk_cell_view_get_cell_renderers (GtkCel
 
   return g_list_reverse (retval);
 }
+
+static gboolean
+gtk_cell_view_buildable_custom_tag_start (GtkBuildable  *buildable,
+					  GtkBuilder    *builder,
+					  GObject       *child,
+					  const gchar   *tagname,
+					  GMarkupParser *parser,
+					  gpointer      *data)
+{
+  if (parent_buildable_iface->custom_tag_start (buildable, builder, child,
+						tagname, parser, data))
+    return TRUE;
+
+  return _gtk_cell_layout_buildable_custom_tag_start (buildable, builder, child,
+						      tagname, parser, data);
+}
+
+static void
+gtk_cell_view_buildable_custom_tag_end (GtkBuildable *buildable,
+					GtkBuilder   *builder,
+					GObject      *child,
+					const gchar  *tagname,
+					gpointer      data)
+{
+  if (!strcmp (tagname, "attributes"))
+    _gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname,
+					       data);
+  else
+    parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
+					    data);
+}
+
 
 #define __GTK_CELL_VIEW_C__
 #include "gtkaliasdef.c"
Index: gtk/gtkcheckmenuitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcheckmenuitem.c,v
retrieving revision 1.61
diff -u -p -r1.61 gtkcheckmenuitem.c
--- gtk/gtkcheckmenuitem.c	14 May 2006 04:25:28 -0000	1.61
+++ gtk/gtkcheckmenuitem.c	4 Dec 2006 07:09:31 -0000
@@ -25,8 +25,10 @@
  */
 
 #include <config.h>
+#include <string.h>
 #include "gtkcheckmenuitem.h"
 #include "gtkaccellabel.h"
+#include "gtkbuildable.h"
 #include "gtkmarshalers.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
@@ -62,10 +64,19 @@ static void gtk_check_menu_item_get_prop
 					      GValue          *value,
 					      GParamSpec      *pspec);
 
+static void gtk_check_menu_item_buildable_init         (GtkBuildableIface *iface);
+static void gtk_check_menu_item_buildable_set_property (GtkBuildable      *buildable,
+							GtkBuilder        *builder,
+							const gchar       *name,
+							const GValue      *value);
+
+static GtkBuildableIface *parent_buildable_iface = NULL;
 
 static guint check_menu_item_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_ITEM)
+G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_ITEM,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_check_menu_item_buildable_init));
 
 static void
 gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
@@ -133,6 +144,39 @@ gtk_check_menu_item_class_init (GtkCheck
 		  _gtk_marshal_VOID__VOID,
 		  G_TYPE_NONE, 0);
 }
+
+
+static void
+gtk_check_menu_item_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_check_menu_item_buildable_set_property;
+}
+
+static void 
+gtk_check_menu_item_buildable_set_property (GtkBuildable *buildable,
+					    GtkBuilder   *builder,
+					    const gchar  *name,
+					    const GValue *value)
+{
+  if (!strcmp (name, "always-show-toggle"))
+    {
+      GValue val = { 0, };
+
+      if (gtk_builder_value_from_string_type  (builder, G_TYPE_BOOLEAN,
+					       g_value_get_string (value),
+					       &val))
+	{
+	  gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (buildable), 
+					       g_value_get_boolean (&val));
+	  g_value_unset (&val);
+	}
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+}
+
 
 GtkWidget*
 gtk_check_menu_item_new (void)
Index: gtk/gtkcolorseldialog.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcolorseldialog.c,v
retrieving revision 1.23
diff -u -p -r1.23 gtkcolorseldialog.c
--- gtk/gtkcolorseldialog.c	14 May 2006 04:25:28 -0000	1.23
+++ gtk/gtkcolorseldialog.c	4 Dec 2006 07:09:31 -0000
@@ -24,6 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 #include <config.h>
+#include <string.h>
 #include <glib.h>
 #include "gtkcolorseldialog.h"
 #include "gtkframe.h"
@@ -31,6 +32,7 @@
 #include "gtkbutton.h"
 #include "gtkstock.h"
 #include "gtkintl.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 
@@ -38,7 +40,17 @@
 /* GtkColorSelectionDialog */
 /***************************/
 
-G_DEFINE_TYPE (GtkColorSelectionDialog, gtk_color_selection_dialog, GTK_TYPE_DIALOG)
+static void gtk_color_selection_dialog_buildable_interface_init     (GtkBuildableIface *iface);
+static GObject * gtk_color_selection_dialog_buildable_get_internal_child (GtkBuildable *buildable,
+									  GtkBuilder   *builder,
+									  const gchar  *childname);
+
+G_DEFINE_TYPE_WITH_CODE (GtkColorSelectionDialog, gtk_color_selection_dialog,
+           GTK_TYPE_DIALOG,
+           G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+                      gtk_color_selection_dialog_buildable_interface_init))
+
+static GtkBuildableIface *parent_buildable_iface;
 
 static void
 gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
@@ -105,6 +117,31 @@ gtk_color_selection_dialog_new (const gc
   
   return GTK_WIDGET (colorseldiag);
 }
+
+static void
+gtk_color_selection_dialog_buildable_interface_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+  iface->get_internal_child = gtk_color_selection_dialog_buildable_get_internal_child;
+}
+
+static GObject *
+gtk_color_selection_dialog_buildable_get_internal_child (GtkBuildable *buildable,
+							 GtkBuilder   *builder,
+							 const gchar  *childname)
+{
+    if (!strcmp(childname, "ok_button"))
+	return G_OBJECT (GTK_COLOR_SELECTION_DIALOG (buildable)->ok_button);
+    else if (!strcmp(childname, "cancel_button"))
+	return G_OBJECT (GTK_COLOR_SELECTION_DIALOG (buildable)->cancel_button);
+    else if (!strcmp(childname, "help_button"))
+	return G_OBJECT (GTK_COLOR_SELECTION_DIALOG(buildable)->help_button);
+    else if (!strcmp(childname, "color_selection"))
+	return G_OBJECT (GTK_COLOR_SELECTION_DIALOG(buildable)->colorsel);
+
+    return parent_buildable_iface->get_internal_child (buildable, builder, childname);
+}
+
 
 #define __GTK_COLOR_SELECTION_DIALOG_C__
 #include "gtkaliasdef.c"
Index: gtk/gtkcombobox.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcombobox.c,v
retrieving revision 1.187
diff -u -p -r1.187 gtkcombobox.c
--- gtk/gtkcombobox.c	16 Nov 2006 12:56:29 -0000	1.187
+++ gtk/gtkcombobox.c	4 Dec 2006 07:09:43 -0000
@@ -438,6 +438,21 @@ static void     gtk_combo_box_child_show
 static void     gtk_combo_box_child_hide                     (GtkWidget       *widget,
 							      GtkComboBox     *combo_box);
 
+/* GtkBuildable method implementation */
+static GtkBuildableIface *parent_buildable_iface;
+
+static void     gtk_combo_box_buildable_init                 (GtkBuildableIface *iface);
+static gboolean gtk_combo_box_buildable_custom_tag_start     (GtkBuildable  *buildable,
+							      GtkBuilder    *builder,
+							      GObject       *child,
+							      const gchar   *tagname,
+							      GMarkupParser *parser,
+							      gpointer      *data);
+static void     gtk_combo_box_buildable_custom_tag_end       (GtkBuildable  *buildable,
+							      GtkBuilder    *builder,
+							      GObject       *child,
+							      const gchar   *tagname,
+							      gpointer       data);
 
 /* GtkCellEditable method implementations */
 static void gtk_combo_box_start_editing (GtkCellEditable *cell_editable,
@@ -448,7 +463,10 @@ G_DEFINE_TYPE_WITH_CODE (GtkComboBox, gt
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
 						gtk_combo_box_cell_layout_init)
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_EDITABLE,
-						gtk_combo_box_cell_editable_init))
+						gtk_combo_box_cell_editable_init)
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_combo_box_buildable_init))
+
 
 /* common */
 static void
@@ -779,6 +797,15 @@ gtk_combo_box_class_init (GtkComboBoxCla
 }
 
 static void
+gtk_combo_box_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+  iface->add = _gtk_cell_layout_buildable_add;
+  iface->custom_tag_start = gtk_combo_box_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_combo_box_buildable_custom_tag_end;
+}
+
+static void
 gtk_combo_box_cell_layout_init (GtkCellLayoutIface *iface)
 {
   iface->pack_start = gtk_combo_box_cell_layout_pack_start;
@@ -5502,6 +5529,37 @@ gtk_combo_box_get_focus_on_click (GtkCom
   return combo_box->priv->focus_on_click;
 }
 
+
+static gboolean
+gtk_combo_box_buildable_custom_tag_start (GtkBuildable  *buildable,
+					  GtkBuilder    *builder,
+					  GObject       *child,
+					  const gchar   *tagname,
+					  GMarkupParser *parser,
+					  gpointer      *data)
+{
+  if (parent_buildable_iface->custom_tag_start (buildable, builder, child,
+						tagname, parser, data))
+    return TRUE;
+
+  return _gtk_cell_layout_buildable_custom_tag_start (buildable, builder, child,
+						      tagname, parser, data);
+}
+
+static void
+gtk_combo_box_buildable_custom_tag_end (GtkBuildable *buildable,
+					GtkBuilder   *builder,
+					GObject      *child,
+					const gchar  *tagname,
+					gpointer      data)
+{
+  if (!strcmp (tagname, "attributes"))
+    _gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname,
+					       data);
+  else
+    parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
+					    data);
+}
 
 #define __GTK_COMBO_BOX_C__
 #include "gtkaliasdef.c"
Index: gtk/gtkcomboboxentry.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcomboboxentry.c,v
retrieving revision 1.32
diff -u -p -r1.32 gtkcomboboxentry.c
--- gtk/gtkcomboboxentry.c	17 Jul 2006 03:59:17 -0000	1.32
+++ gtk/gtkcomboboxentry.c	4 Dec 2006 07:09:43 -0000
@@ -18,6 +18,7 @@
  */
 
 #include <config.h>
+#include <string.h>
 #include "gtkcomboboxentry.h"
 #include "gtkcelllayout.h"
 
@@ -26,6 +27,7 @@
 
 #include "gtkprivate.h"
 #include "gtkintl.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 #define GTK_COMBO_BOX_ENTRY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_COMBO_BOX_ENTRY, GtkComboBoxEntryPrivate))
@@ -58,6 +60,10 @@ static void gtk_combo_box_entry_grab_foc
 static void has_frame_changed                    (GtkComboBoxEntry      *entry_box,
 						  GParamSpec            *pspec,
 						  gpointer               data);
+static void gtk_combo_box_entry_buildable_interface_init     (GtkBuildableIface *iface);
+static GObject * gtk_combo_box_entry_buildable_get_internal_child (GtkBuildable *buildable,
+						     GtkBuilder   *builder,
+						     const gchar  *childname);
 
 enum
 {
@@ -65,7 +71,9 @@ enum
   PROP_TEXT_COLUMN
 };
 
-G_DEFINE_TYPE (GtkComboBoxEntry, gtk_combo_box_entry, GTK_TYPE_COMBO_BOX)
+G_DEFINE_TYPE_WITH_CODE (GtkComboBoxEntry, gtk_combo_box_entry, GTK_TYPE_COMBO_BOX,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_combo_box_entry_buildable_interface_init))
 
 static void
 gtk_combo_box_entry_class_init (GtkComboBoxEntryClass *klass)
@@ -125,6 +133,23 @@ gtk_combo_box_entry_init (GtkComboBoxEnt
                     G_CALLBACK (gtk_combo_box_entry_active_changed), NULL);
   has_frame_changed (entry_box, NULL, NULL);
   g_signal_connect (entry_box, "notify::has-frame", G_CALLBACK (has_frame_changed), NULL);
+}
+
+static void
+gtk_combo_box_entry_buildable_interface_init (GtkBuildableIface *iface)
+{
+  iface->get_internal_child = gtk_combo_box_entry_buildable_get_internal_child;
+}
+
+static GObject *
+gtk_combo_box_entry_buildable_get_internal_child (GtkBuildable *buildable,
+						  GtkBuilder   *builder,
+						  const gchar  *childname)
+{
+    if (!strcmp (childname, "entry"))
+      return G_OBJECT (gtk_bin_get_child (GTK_BIN (buildable)));
+
+    return NULL;
 }
 
 static void
Index: gtk/gtkcontainer.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcontainer.c,v
retrieving revision 1.142
diff -u -p -r1.142 gtkcontainer.c
--- gtk/gtkcontainer.c	3 Oct 2006 15:54:52 -0000	1.142
+++ gtk/gtkcontainer.c	4 Dec 2006 07:09:48 -0000
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 
 #include "gtkcontainer.h"
+#include "gtkbuildable.h"
 #include "gtkprivate.h"
 #include "gtkmain.h"
 #include "gtkmarshalers.h"
@@ -99,6 +100,17 @@ static void     gtk_container_unmap     
 static gchar* gtk_container_child_default_composite_name (GtkContainer *container,
 							  GtkWidget    *child);
 
+/* GtkBuildable */
+static void gtk_container_buildable_init           (GtkBuildableIface *iface);
+static void gtk_container_buildable_add            (GtkBuildable *buildable,
+						    GtkBuilder   *builder,
+						    GObject      *child,
+						    const gchar  *type);
+static void gtk_container_buildable_child_set_property (GtkBuildable *buildable,
+							GtkBuilder   *builder,
+							GObject      *child,
+							const gchar  *name,
+							const GValue *value);
 
 /* --- variables --- */
 static const gchar           vadjustment_key[] = "gtk-vadjustment";
@@ -110,6 +122,7 @@ static guint                 container_s
 static GtkWidgetClass       *parent_class = NULL;
 extern GParamSpecPool       *_gtk_widget_child_property_pool;
 extern GObjectNotifyContext *_gtk_widget_child_property_notify_context;
+static GtkBuildableIface    *parent_buildable_iface;
 
 
 /* --- functions --- */
@@ -134,9 +147,21 @@ gtk_container_get_type (void)
 	NULL,       /* value_table */
       };
 
+      static const GInterfaceInfo buildable_info =
+      {
+	(GInterfaceInitFunc) gtk_container_buildable_init,
+	NULL,
+	NULL
+      };
+
       container_type =
 	g_type_register_static (GTK_TYPE_WIDGET, I_("GtkContainer"), 
 				&container_info, G_TYPE_FLAG_ABSTRACT);
+
+      g_type_add_interface_static (container_type,
+				   GTK_TYPE_BUILDABLE,
+				   &buildable_info);
+
     }
 
   return container_type;
@@ -258,6 +283,37 @@ gtk_container_class_init (GtkContainerCl
 		  _gtk_marshal_VOID__OBJECT,
 		  G_TYPE_NONE, 1,
 		  GTK_TYPE_WIDGET);
+}
+
+static void
+gtk_container_buildable_child_set_property (GtkBuildable *buildable,
+					    GtkBuilder   *builder,
+					    GObject      *child,
+					    const gchar  *name,
+					    const GValue *value)
+{
+  gtk_container_child_set_property (GTK_CONTAINER (buildable), 
+				    GTK_WIDGET (child), name, value);
+}
+
+static void
+gtk_container_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->add                = gtk_container_buildable_add;
+  iface->child_set_property = gtk_container_buildable_child_set_property;
+}
+
+static void
+gtk_container_buildable_add (GtkBuildable  *buildable,
+			     GtkBuilder    *builder,
+			     GObject       *child,
+			     const gchar   *type)
+{
+  g_return_if_fail (GTK_IS_WIDGET (child));
+
+  gtk_container_add (GTK_CONTAINER (buildable), GTK_WIDGET (child));
 }
 
 /**
Index: gtk/gtkdebug.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkdebug.h,v
retrieving revision 1.24
diff -u -p -r1.24 gtkdebug.h
--- gtk/gtkdebug.h	21 Jun 2006 18:16:55 -0000	1.24
+++ gtk/gtkdebug.h	4 Dec 2006 07:09:48 -0000
@@ -42,7 +42,8 @@ typedef enum {
   GTK_DEBUG_MODULES     = 1 << 7,
   GTK_DEBUG_GEOMETRY    = 1 << 8,
   GTK_DEBUG_ICONTHEME   = 1 << 9,
-  GTK_DEBUG_PRINTING	= 1 << 10
+  GTK_DEBUG_PRINTING	= 1 << 10,
+  GTK_DEBUG_BUILDER	= 1 << 11
 } GtkDebugFlag;
 
 #ifdef G_ENABLE_DEBUG
Index: gtk/gtkdialog.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkdialog.c,v
retrieving revision 1.82
diff -u -p -r1.82 gtkdialog.c
--- gtk/gtkdialog.c	6 Jul 2006 05:14:01 -0000	1.82
+++ gtk/gtkdialog.c	4 Dec 2006 07:09:53 -0000
@@ -24,6 +24,8 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
+#include <stdlib.h>
+#include <string.h>
 #include <config.h>
 #include "gtkbutton.h"
 #include "gtkdialog.h"
@@ -37,12 +39,15 @@
 #include "gtkintl.h"
 #include "gtkbindings.h"
 #include "gtkprivate.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 #define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_DIALOG, GtkDialogPrivate))
 
 typedef struct {
-  guint ignore_separator : 1;
+  guint  ignore_separator : 1;
+  gulong finish_cb_id;
+  gulong builder_support_id;
 } GtkDialogPrivate;
 
 typedef struct _ResponseData ResponseData;
@@ -77,6 +82,26 @@ static void gtk_dialog_close            
 static ResponseData* get_response_data   (GtkWidget        *widget,
 					  gboolean          create);
 
+static void     gtk_dialog_buildable_init               (GtkBuildableIface *iface);
+static void     gtk_dialog_buildable_set_name           (GtkBuildable      *buildable,
+							 GtkBuilder        *builder,
+							 const gchar       *name);
+static GObject *gtk_dialog_buildable_get_internal_child (GtkBuildable      *buildable,
+							 GtkBuilder        *builder,
+							 const gchar       *childname);
+static gboolean gtk_dialog_buildable_custom_tag_start   (GtkBuildable      *buildable,
+							 GtkBuilder        *builder,
+							 GObject           *child,
+							 const gchar       *tagname,
+							 GMarkupParser     *parser,
+							 gpointer          *data);
+static void     gtk_dialog_buildable_custom_tag_end     (GtkBuildable      *buildable,
+							 GtkBuilder        *builder,
+							 GObject           *child,
+							 const gchar       *tagname,
+							 gpointer           data);
+
+
 enum {
   PROP_0,
   PROP_HAS_SEPARATOR
@@ -90,7 +115,11 @@ enum {
 
 static guint dialog_signals[LAST_SIGNAL];
 
-G_DEFINE_TYPE (GtkDialog, gtk_dialog, GTK_TYPE_WINDOW)
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkDialog, gtk_dialog, GTK_TYPE_WINDOW,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_dialog_buildable_init))
 
 static void
 gtk_dialog_class_init (GtkDialogClass *class)
@@ -202,6 +231,8 @@ gtk_dialog_init (GtkDialog *dialog)
 
   priv = GET_PRIVATE (dialog);
   priv->ignore_separator = FALSE;
+  priv->finish_cb_id = 0;
+  priv->builder_support_id = 0;
 
   /* To avoid breaking old code that prevents destroy on delete event
    * by connecting a handler, we have to have the FIRST signal
@@ -235,6 +266,96 @@ gtk_dialog_init (GtkDialog *dialog)
   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
 }
 
+static void
+gtk_dialog_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_name = gtk_dialog_buildable_set_name;
+  iface->get_internal_child = gtk_dialog_buildable_get_internal_child;
+  iface->custom_tag_start = gtk_dialog_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_dialog_buildable_custom_tag_end;
+}
+
+static void
+old_dialog_support_finish_cb (GtkBuilder   *builder,
+			      GtkBuildable *buildable)
+{
+  GtkDialog *dialog = GTK_DIALOG (buildable);
+  GList *children, *list;
+  GtkDialogPrivate *priv;
+  
+  priv = GET_PRIVATE (buildable);
+  
+  if (dialog->action_area == NULL)
+    return;
+  
+  /* repack children of action_area */
+  children = gtk_container_get_children(GTK_CONTAINER(dialog->action_area));
+  for (list = children; list; list = list->next) {
+    GtkWidget *child = GTK_WIDGET(list->data);
+    
+    g_object_ref(child);
+    gtk_container_remove (GTK_CONTAINER (dialog->action_area), child);
+  }
+  for (list = children; list; list = list->next) {
+    GtkWidget *child = GTK_WIDGET(list->data);
+    gint response_id;
+    
+    g_print ("Setting a custom dialog response id to %d\n", 
+	     GPOINTER_TO_INT(g_object_get_data(G_OBJECT(child),
+					       "gtk-button-buildable-response-id")));
+
+    response_id = GPOINTER_TO_INT(g_object_steal_data(G_OBJECT(child),
+						      "gtk-button-buildable-response-id"));
+
+
+    gtk_dialog_add_action_widget(dialog, child, response_id);
+    g_object_unref(child);
+    
+  }
+  g_list_free (children);
+  
+  g_signal_handler_disconnect (builder, priv->builder_support_id);
+  priv->builder_support_id = 0;
+}
+
+static void
+gtk_dialog_buildable_set_name (GtkBuildable *buildable,
+			       GtkBuilder   *builder,
+			       const gchar  *name)
+{
+  if (gtk_builder_file_version (builder) <= 1)
+    {
+      GtkDialogPrivate *priv;
+
+      priv = GET_PRIVATE (buildable);
+
+      /* For version 1 glade files, support dialog buttons
+       * the old fashioned way.
+       */
+      if (priv->builder_support_id == 0)
+	priv->builder_support_id =
+	  g_signal_connect (builder, "finish",
+			    G_CALLBACK (old_dialog_support_finish_cb),
+			    buildable);
+    }
+  parent_buildable_iface->set_name (buildable, builder, name);
+}
+
+
+static GObject *
+gtk_dialog_buildable_get_internal_child (GtkBuildable *buildable,
+					 GtkBuilder   *builder,
+					 const gchar  *childname)
+{
+    if (!strcmp (childname, "vbox"))
+      return G_OBJECT (GTK_DIALOG (buildable)->vbox);
+    else if (!strcmp (childname, "action_area"))
+      return G_OBJECT (GTK_DIALOG (buildable)->action_area);
+
+    return NULL;
+}
 
 static void 
 gtk_dialog_set_property (GObject      *object,
@@ -1211,6 +1332,151 @@ gtk_dialog_set_alternative_button_order_
       child = dialog_find_button (dialog, new_order[position]);
       gtk_box_reorder_child (GTK_BOX (dialog->action_area), child, position);
     }
+}
+
+typedef struct {
+  gchar *widget_name;
+  gchar *response_id;
+} ActionWidgetInfo;
+
+typedef struct {
+  GtkDialog *dialog;
+  GtkBuilder *builder;
+  GSList *items;
+  gchar *response;
+} ActionWidgetsSubParserData;
+
+static void
+attributes_start_element (GMarkupParseContext *context,
+			  const gchar         *element_name,
+			  const gchar        **names,
+			  const gchar        **values,
+			  gpointer             user_data,
+			  GError             **error)
+{
+  ActionWidgetsSubParserData *parser_data = (ActionWidgetsSubParserData*)user_data;
+  guint i;
+
+  if (!strcmp (element_name, "action-widget"))
+    for (i = 0; names[i]; i++)
+      if (!strcmp (names[i], "response"))
+	parser_data->response = g_strdup (values[i]);
+  else if (!strcmp (element_name, "action-widgets"))
+    return;
+  else
+    g_warning ("Unsupported tag for GtkDialog: %s\n", element_name);
+}
+
+static void
+attributes_text_element (GMarkupParseContext *context,
+			 const gchar         *text,
+			 gsize                text_len,
+			 gpointer             user_data,
+			 GError             **error)
+{
+  ActionWidgetsSubParserData *parser_data = (ActionWidgetsSubParserData*)user_data;
+  ActionWidgetInfo *item;
+
+  if (!parser_data->response)
+    return;
+
+  item = g_new (ActionWidgetInfo, 1);
+  item->widget_name = g_strndup (text, text_len);
+  item->response_id = parser_data->response;
+  parser_data->items = g_slist_prepend (parser_data->items, item);
+  parser_data->response = NULL;
+}
+
+static const GMarkupParser attributes_parser =
+  {
+    attributes_start_element,
+    NULL,
+    attributes_text_element,
+  };
+
+gboolean
+gtk_dialog_buildable_custom_tag_start (GtkBuildable  *buildable,
+				       GtkBuilder    *builder,
+				       GObject       *child,
+				       const gchar   *tagname,
+				       GMarkupParser *parser,
+				       gpointer      *data)
+{
+  ActionWidgetsSubParserData *parser_data;
+
+  if (child)
+    return FALSE;
+
+  if (!strcmp (tagname, "action-widgets"))
+    {
+      parser_data = g_slice_new0 (ActionWidgetsSubParserData);
+      parser_data->dialog = GTK_DIALOG (buildable);
+      parser_data->items = NULL;
+
+      *parser = attributes_parser;
+      *data = parser_data;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static void
+builder_finish_cb (GtkBuilder *builder,
+		   gpointer user_data)
+{
+  GtkDialogPrivate *priv;
+  GSList *l;
+  ActionWidgetsSubParserData *parser_data = (ActionWidgetsSubParserData*)user_data;
+  GObject *object;
+  ResponseData* data;
+
+  priv = GET_PRIVATE (parser_data->dialog);
+  parser_data->items = g_slist_reverse (parser_data->items);
+
+  for (l = parser_data->items; l; l = l->next)
+    {
+      ActionWidgetInfo *item = l->data;
+
+      object = gtk_builder_get_object (builder, item->widget_name);
+      if (!object)
+	{
+	  g_warning ("Unknown object %s specified in action-widgets %s",
+		     item->widget_name,
+		     gtk_buildable_get_name (GTK_BUILDABLE (object)));
+	  continue;
+	}
+
+      data = get_response_data (GTK_WIDGET (object), TRUE);
+      data->response_id = atoi (item->response_id);
+
+      g_free (item->widget_name);
+      g_free (item->response_id);
+      g_free (item);
+    }
+  g_slist_free (parser_data->items);
+  g_slice_free (ActionWidgetsSubParserData, parser_data);
+
+  g_signal_handler_disconnect (builder, priv->finish_cb_id);
+  priv->finish_cb_id = 0;
+}
+
+static void
+gtk_dialog_buildable_custom_tag_end (GtkBuildable *buildable,
+				     GtkBuilder   *builder,
+				     GObject      *child,
+				     const gchar  *tagname,
+				     gpointer      data)
+{
+
+  GtkDialogPrivate *priv;
+
+  priv = GET_PRIVATE (buildable);
+
+  if (priv->finish_cb_id == 0)
+    priv->finish_cb_id = 
+      g_signal_connect (builder, "finish",
+			(GCallback)builder_finish_cb, data);
 }
 
 #define __GTK_DIALOG_C__
Index: gtk/gtkentrycompletion.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkentrycompletion.c,v
retrieving revision 1.84
diff -u -p -r1.84 gtkentrycompletion.c
--- gtk/gtkentrycompletion.c	8 Oct 2006 05:06:50 -0000	1.84
+++ gtk/gtkentrycompletion.c	4 Dec 2006 07:09:59 -0000
@@ -139,9 +139,15 @@ static gboolean gtk_entry_completion_rea
 
 static guint entry_completion_signals[LAST_SIGNAL] = { 0 };
 
+/* GtkBuildable */
+static void     gtk_entry_completion_buildable_init      (GtkBuildableIface  *iface);
+
 G_DEFINE_TYPE_WITH_CODE (GtkEntryCompletion, gtk_entry_completion, G_TYPE_OBJECT,
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
-						gtk_entry_completion_cell_layout_init))
+						gtk_entry_completion_cell_layout_init)
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_entry_completion_buildable_init))
+
 
 static void
 gtk_entry_completion_class_init (GtkEntryCompletionClass *klass)
@@ -332,6 +338,14 @@ gtk_entry_completion_class_init (GtkEntr
  							 GTK_PARAM_READWRITE));
 
   g_type_class_add_private (object_class, sizeof (GtkEntryCompletionPrivate));
+}
+
+static void
+gtk_entry_completion_buildable_init (GtkBuildableIface *iface)
+{
+  iface->add = _gtk_cell_layout_buildable_add;
+  iface->custom_tag_start = _gtk_cell_layout_buildable_custom_tag_start;
+  iface->custom_tag_end = _gtk_cell_layout_buildable_custom_tag_end;
 }
 
 static void
Index: gtk/gtkexpander.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkexpander.c,v
retrieving revision 1.30
diff -u -p -r1.30 gtkexpander.c
--- gtk/gtkexpander.c	2 Oct 2006 03:50:38 -0000	1.30
+++ gtk/gtkexpander.c	4 Dec 2006 07:09:59 -0000
@@ -22,10 +22,11 @@
  */
 
 #include <config.h>
-
+#include <string.h>
 #include "gtkexpander.h"
 
 #include "gtklabel.h"
+#include "gtkbuildable.h"
 #include "gtkcontainer.h"
 #include "gtkmarshalers.h"
 #include "gtkmain.h"
@@ -126,7 +127,16 @@ static void gtk_expander_activate (GtkEx
 static void get_expander_bounds (GtkExpander  *expander,
 				 GdkRectangle *rect);
 
-G_DEFINE_TYPE (GtkExpander, gtk_expander, GTK_TYPE_BIN)
+/* GtkBuildable */
+static void gtk_expander_buildable_init           (GtkBuildableIface *iface);
+static void gtk_expander_buildable_add            (GtkBuildable *buildable,
+						   GtkBuilder   *builder,
+						   GObject      *child,
+						   const gchar  *type);
+
+G_DEFINE_TYPE_WITH_CODE (GtkExpander, gtk_expander, GTK_TYPE_BIN,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_expander_buildable_init))
 
 static void
 gtk_expander_class_init (GtkExpanderClass *klass)
@@ -275,6 +285,26 @@ gtk_expander_init (GtkExpander *expander
 
   gtk_drag_dest_set (GTK_WIDGET (expander), 0, NULL, 0, 0);
   gtk_drag_dest_set_track_motion (GTK_WIDGET (expander), TRUE);
+}
+
+static void
+gtk_expander_buildable_add (GtkBuildable  *buildable,
+			    GtkBuilder    *builder,
+			    GObject       *child,
+			    const gchar   *type)
+{
+  if (!type)
+    gtk_container_add (GTK_CONTAINER (buildable), GTK_WIDGET (child));
+  else if (!strcmp (type, "label"))
+    gtk_expander_set_label_widget (GTK_EXPANDER (buildable), GTK_WIDGET (child));
+  else
+    g_warning ("Invalid type specified: `%s'", type);
+}
+
+static void
+gtk_expander_buildable_init (GtkBuildableIface *iface)
+{
+  iface->add = gtk_expander_buildable_add;
 }
 
 static void
Index: gtk/gtkfontsel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfontsel.c,v
retrieving revision 1.104
diff -u -p -r1.104 gtkfontsel.c
--- gtk/gtkfontsel.c	6 Jul 2006 05:14:01 -0000	1.104
+++ gtk/gtkfontsel.c	4 Dec 2006 07:10:04 -0000
@@ -59,6 +59,7 @@
 #include "gtkintl.h"
 #include "gtkaccessible.h"
 #include "gtkprivate.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 /* We don't enable the font and style entries because they don't add
@@ -1291,7 +1292,17 @@ gtk_font_selection_set_preview_text  (Gt
  * GtkFontSelectionDialog
  *****************************************************************************/
 
-G_DEFINE_TYPE (GtkFontSelectionDialog, gtk_font_selection_dialog, GTK_TYPE_DIALOG);
+static void gtk_font_selection_dialog_buildable_interface_init     (GtkBuildableIface *iface);
+static GObject * gtk_font_selection_dialog_buildable_get_internal_child (GtkBuildable *buildable,
+									  GtkBuilder   *builder,
+									  const gchar  *childname);
+
+G_DEFINE_TYPE_WITH_CODE (GtkFontSelectionDialog, gtk_font_selection_dialog,
+			 GTK_TYPE_DIALOG,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_font_selection_dialog_buildable_interface_init))
+
+static GtkBuildableIface *parent_buildable_iface;
 
 static void
 gtk_font_selection_dialog_class_init (GtkFontSelectionDialogClass *klass)
@@ -1363,6 +1374,30 @@ gtk_font_selection_dialog_new (const gch
     gtk_window_set_title (GTK_WINDOW (fontseldiag), title);
   
   return GTK_WIDGET (fontseldiag);
+}
+
+static void
+gtk_font_selection_dialog_buildable_interface_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+  iface->get_internal_child = gtk_font_selection_dialog_buildable_get_internal_child;
+}
+
+static GObject *
+gtk_font_selection_dialog_buildable_get_internal_child (GtkBuildable *buildable,
+							GtkBuilder   *builder,
+							const gchar  *childname)
+{
+    if (!strcmp(childname, "ok_button"))
+	return G_OBJECT (GTK_FONT_SELECTION_DIALOG(buildable)->ok_button);
+    else if (!strcmp(childname, "cancel_button"))
+	return G_OBJECT (GTK_FONT_SELECTION_DIALOG (buildable)->cancel_button);
+    else if (!strcmp(childname, "apply_button"))
+	return G_OBJECT (GTK_FONT_SELECTION_DIALOG(buildable)->apply_button);
+    else if (!strcmp(childname, "font_selection"))
+	return G_OBJECT (GTK_FONT_SELECTION_DIALOG(buildable)->fontsel);
+
+    return parent_buildable_iface->get_internal_child (buildable, builder, childname);
 }
 
 /**
Index: gtk/gtkframe.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkframe.c,v
retrieving revision 1.63
diff -u -p -r1.63 gtkframe.c
--- gtk/gtkframe.c	14 May 2006 17:35:53 -0000	1.63
+++ gtk/gtkframe.c	4 Dec 2006 07:10:04 -0000
@@ -30,6 +30,7 @@
 #include "gtklabel.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 #define LABEL_PAD 1
@@ -73,7 +74,16 @@ static void gtk_frame_compute_child_allo
 static void gtk_frame_real_compute_child_allocation (GtkFrame      *frame,
 						     GtkAllocation *child_allocation);
 
-G_DEFINE_TYPE (GtkFrame, gtk_frame, GTK_TYPE_BIN)
+/* GtkBuildable */
+static void gtk_frame_buildable_init                (GtkBuildableIface *iface);
+static void gtk_frame_buildable_add                 (GtkBuildable *buildable,
+						     GtkBuilder   *builder,
+						     GObject      *child,
+						     const gchar  *type);
+
+G_DEFINE_TYPE_WITH_CODE (GtkFrame, gtk_frame, GTK_TYPE_BIN,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_frame_buildable_init))
 
 static void
 gtk_frame_class_init (GtkFrameClass *class)
@@ -147,6 +157,30 @@ gtk_frame_class_init (GtkFrameClass *cla
   container_class->forall = gtk_frame_forall;
 
   class->compute_child_allocation = gtk_frame_real_compute_child_allocation;
+}
+
+static void
+gtk_frame_buildable_init (GtkBuildableIface *iface)
+{
+  iface->add = gtk_frame_buildable_add;
+}
+
+static void
+gtk_frame_buildable_add (GtkBuildable *buildable,
+			 GtkBuilder   *builder,
+			 GObject      *child,
+			 const gchar  *type)
+{
+  if (type && 
+      (!strcmp (type, "label") ||
+       /* Support for older glade files */
+       !strcmp (type, "label_item") || 
+       !strcmp (type, "label-item")))
+    gtk_frame_set_label_widget (GTK_FRAME (buildable), GTK_WIDGET (child));
+  else if (!type)
+    gtk_container_add (GTK_CONTAINER (buildable), GTK_WIDGET (child));
+  else
+    g_warning ("Invalid type specified: `%s'", type);
 }
 
 static void
Index: gtk/gtkiconview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkiconview.c,v
retrieving revision 1.106
diff -u -p -r1.106 gtkiconview.c
--- gtk/gtkiconview.c	16 Nov 2006 12:56:29 -0000	1.106
+++ gtk/gtkiconview.c	4 Dec 2006 07:10:25 -0000
@@ -440,11 +440,28 @@ static gboolean gtk_icon_view_maybe_begi
 static void     remove_scroll_timeout            (GtkIconView *icon_view);
 
 
+/* GtkBuildable */
+static GtkBuildableIface *parent_buildable_iface;
+static void     gtk_icon_view_buildable_init             (GtkBuildableIface *iface);
+static gboolean gtk_icon_view_buildable_custom_tag_start (GtkBuildable  *buildable,
+							  GtkBuilder    *builder,
+							  GObject       *child,
+							  const gchar   *tagname,
+							  GMarkupParser *parser,
+							  gpointer      *data);
+static void     gtk_icon_view_buildable_custom_tag_end   (GtkBuildable  *buildable,
+							  GtkBuilder    *builder,
+							  GObject       *child,
+							  const gchar   *tagname,
+							  gpointer       data);
+
 static guint icon_view_signals[LAST_SIGNAL] = { 0 };
 
 G_DEFINE_TYPE_WITH_CODE (GtkIconView, gtk_icon_view, GTK_TYPE_CONTAINER,
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
-						gtk_icon_view_cell_layout_init))
+						gtk_icon_view_cell_layout_init)
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_icon_view_buildable_init))
 
 static void
 gtk_icon_view_class_init (GtkIconViewClass *klass)
@@ -884,6 +901,15 @@ gtk_icon_view_class_init (GtkIconViewCla
 }
 
 static void
+gtk_icon_view_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+  iface->add = _gtk_cell_layout_buildable_add;
+  iface->custom_tag_start = gtk_icon_view_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_icon_view_buildable_custom_tag_end;
+}
+
+static void
 gtk_icon_view_cell_layout_init (GtkCellLayoutIface *iface)
 {
   iface->pack_start = gtk_icon_view_cell_layout_pack_start;
@@ -9161,6 +9187,39 @@ gtk_icon_view_get_accessible (GtkWidget 
     } 
   return (* GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->get_accessible) (widget);
 }
+
+static gboolean
+gtk_icon_view_buildable_custom_tag_start (GtkBuildable  *buildable,
+					  GtkBuilder    *builder,
+					  GObject       *child,
+					  const gchar   *tagname,
+					  GMarkupParser *parser,
+					  gpointer      *data)
+{
+  if (parent_buildable_iface->custom_tag_start (buildable, builder, child,
+						tagname, parser, data))
+    return TRUE;
+
+  return _gtk_cell_layout_buildable_custom_tag_start (buildable, builder, child,
+						      tagname, parser, data);
+}
+
+static void
+gtk_icon_view_buildable_custom_tag_end (GtkBuildable *buildable,
+					GtkBuilder   *builder,
+					GObject      *child,
+					const gchar  *tagname,
+					gpointer      data)
+{
+  if (!strcmp (tagname, "attributes"))
+    _gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname,
+					       data);
+  else
+    parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
+					    data);
+}
+
+
 
 #define __GTK_ICON_VIEW_C__
 #include "gtkaliasdef.c"
Index: gtk/gtkimagemenuitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkimagemenuitem.c,v
retrieving revision 1.39
diff -u -p -r1.39 gtkimagemenuitem.c
--- gtk/gtkimagemenuitem.c	8 Oct 2006 05:07:03 -0000	1.39
+++ gtk/gtkimagemenuitem.c	4 Dec 2006 07:10:25 -0000
@@ -25,6 +25,7 @@
  */
 
 #include <config.h>
+#include <string.h>
 #include "gtkimagemenuitem.h"
 #include "gtkaccellabel.h"
 #include "gtkintl.h"
@@ -34,6 +35,7 @@
 #include "gtkmenubar.h"
 #include "gtkcontainer.h"
 #include "gtkwindow.h"
+#include "gtkbuildable.h"
 #include "gtkprivate.h"
 #include "gtkalias.h"
 
@@ -62,13 +64,30 @@ static void gtk_image_menu_item_get_prop
 static void gtk_image_menu_item_screen_changed (GtkWidget        *widget,
 						GdkScreen        *previous_screen);
 
+static void gtk_image_menu_item_buildable_init (GtkBuildableIface *iface);
+
+static void gtk_image_menu_item_buildable_set_property (GtkBuildable *buildable,
+							GtkBuilder   *builder,
+							const gchar  *name,
+							const GValue *value);
+
+static GObject *gtk_image_menu_item_buildable_get_internal_child (GtkBuildable *buildable,
+								  GtkBuilder   *builder,
+								  const gchar  *childname);
+
+
+extern GtkWidget *_gtk_menu_item_ensure_child_label (GtkMenuItem *menu_item);
 
 enum {
   PROP_ZERO,
   PROP_IMAGE
 };
 
-G_DEFINE_TYPE (GtkImageMenuItem, gtk_image_menu_item, GTK_TYPE_MENU_ITEM)
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkImageMenuItem, gtk_image_menu_item, GTK_TYPE_MENU_ITEM, 
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_image_menu_item_buildable_init));
 
 static void
 gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass)
@@ -110,6 +129,97 @@ gtk_image_menu_item_class_init (GtkImage
 						       GTK_PARAM_READWRITE));
   
 }
+
+static void
+gtk_image_menu_item_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_image_menu_item_buildable_set_property;
+  iface->get_internal_child = gtk_image_menu_item_buildable_get_internal_child;
+}
+
+static void
+gtk_image_menu_item_buildable_set_property (GtkBuildable *buildable,
+					    GtkBuilder   *builder,
+					    const gchar  *name,
+					    const GValue *value)
+{
+  GtkWidget *menu_item = GTK_WIDGET (buildable);
+  GValue     val = { 0, };
+
+  if (!strcmp (name, "use-stock"))
+    {
+      GtkWidget *child = _gtk_menu_item_ensure_child_label (GTK_MENU_ITEM (menu_item));
+      
+      gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN,
+					  g_value_get_string (value), &val);
+
+      if (GTK_IS_LABEL (child) && g_value_get_boolean (&val)) 
+	{
+	  const gchar *stock_id = gtk_label_get_label(GTK_LABEL(child));
+	  GtkStockItem stock_item;
+	  
+	  if (gtk_stock_lookup(stock_id, &stock_item)) 
+	    {
+	      /* put in the stock image next to the text.  Done before
+	       * messing with the label child, so that stock_id doesn't
+	       * become invalid. */
+	      GtkWidget *image =
+		gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU);
+	      
+	      gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), image);
+	      gtk_widget_show(image);
+	      
+	      gtk_label_set_text(GTK_LABEL(child), stock_item.label);
+	      gtk_label_set_use_underline(GTK_LABEL(child), TRUE);
+	  
+	      if (stock_item.keyval)
+		gtk_widget_add_accelerator (GTK_WIDGET (buildable),
+					    "activate",
+					    gtk_builder_ensure_accel_group (builder),
+					    stock_item.keyval,
+					    stock_item.modifier,
+					    GTK_ACCEL_VISIBLE);
+	      
+	    } 
+	  else 
+	    {
+	      g_warning("could not look up stock id '%s'", stock_id);
+	    }
+	}
+      g_value_unset (&val);
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+
+}
+
+static GObject *
+gtk_image_menu_item_buildable_get_internal_child (GtkBuildable *buildable,
+						  GtkBuilder   *builder,
+						  const gchar  *childname)
+{
+  if (!strcmp(childname, "image")) 
+    {
+      GtkWidget *pl;
+
+      pl = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (buildable));
+      if (!pl) 
+	{
+	  pl = gtk_image_new ();
+	  
+	  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (buildable), pl);
+	}
+      return G_OBJECT (pl);
+    }
+  else if (parent_buildable_iface->get_internal_child)
+    return parent_buildable_iface->get_internal_child (buildable,
+						       builder,
+						       childname);
+  return NULL; 
+}
+
 
 static void
 gtk_image_menu_item_init (GtkImageMenuItem *image_menu_item)
Index: gtk/gtklistitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklistitem.c,v
retrieving revision 1.41
diff -u -p -r1.41 gtklistitem.c
--- gtk/gtklistitem.c	13 Sep 2005 19:57:41 -0000	1.41
+++ gtk/gtklistitem.c	4 Dec 2006 07:10:25 -0000
@@ -27,10 +27,12 @@
 #undef GTK_DISABLE_DEPRECATED
 
 #include <config.h>
+#include <string.h>
 #include "gtkbindings.h"
 #include "gtklabel.h"
 #include "gtklistitem.h"
 #include "gtklist.h"
+#include "gtkbuildable.h"
 #include "gtkmarshalers.h"
 #include "gtksignal.h"
 #include "gtkintl.h"
@@ -71,9 +73,16 @@ static void gtk_real_list_item_deselect 
 static void gtk_real_list_item_toggle       (GtkItem          *item);
 
 
+static void gtk_list_item_buildable_init    (GtkBuildableIface *iface);
+static void gtk_list_item_buildable_set_property (GtkBuildable *buildable,
+						  GtkBuilder   *builder,
+						  const gchar  *name,
+						  const GValue *value);
+
 static GtkItemClass *parent_class = NULL;
 static guint list_item_signals[LAST_SIGNAL] = {0};
 
+static GtkBuildableIface *parent_buildable_iface = NULL;
 
 GtkType
 gtk_list_item_get_type (void)
@@ -94,8 +103,19 @@ gtk_list_item_get_type (void)
         (GtkClassInitFunc) NULL,
       };
 
+      static const GInterfaceInfo buildable_info =
+      {
+	(GInterfaceInitFunc) gtk_list_item_buildable_init,
+	NULL,
+	NULL
+      };
+
       I_("GtkListItem");
       list_item_type = gtk_type_unique (gtk_item_get_type (), &list_item_info);
+
+      g_type_add_interface_static (list_item_type,
+				   GTK_TYPE_BUILDABLE,
+				   &buildable_info);
     }
 
   return list_item_type;
@@ -379,6 +399,40 @@ static void
 gtk_list_item_init (GtkListItem *list_item)
 {
   GTK_WIDGET_SET_FLAGS (list_item, GTK_CAN_FOCUS);
+}
+
+
+static void
+gtk_list_item_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_list_item_buildable_set_property;
+}
+
+static void
+gtk_list_item_buildable_set_property (GtkBuildable *buildable,
+				      GtkBuilder   *builder,
+				      const gchar  *name,
+				      const GValue *value)
+{
+  if (!strcmp (name, "label"))
+    {
+      GtkWidget *child;
+
+      child = gtk_bin_get_child (GTK_BIN (buildable));
+      if (child)
+	gtk_container_remove (GTK_CONTAINER (buildable), child);
+      
+      child = gtk_label_new (g_value_get_string (value));
+      gtk_misc_set_alignment (GTK_MISC (child), 0.0, 0.5);
+      gtk_misc_set_padding (GTK_MISC (child), 0, 1);
+      
+      gtk_container_add (GTK_CONTAINER (buildable), child);
+      gtk_widget_show (child);
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
 }
 
 GtkWidget*
Index: gtk/gtkliststore.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkliststore.c,v
retrieving revision 1.123
diff -u -p -r1.123 gtkliststore.c
--- gtk/gtkliststore.c	15 Aug 2006 15:46:24 -0000	1.123
+++ gtk/gtkliststore.c	4 Dec 2006 07:10:30 -0000
@@ -18,6 +18,8 @@
  */
 
 #include <config.h>
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 #include <gobject/gvaluecollector.h>
 #include "gtktreemodel.h"
@@ -25,7 +27,9 @@
 #include "gtktreedatalist.h"
 #include "gtktreednd.h"
 #include "gtksequence.h"
+#include "gtkbuildable.h"
 #include "gtkintl.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 #define GTK_LIST_STORE_IS_SORTED(list) (((GtkListStore*)(list))->sort_column_id != GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID)
@@ -35,6 +39,7 @@ static void         gtk_list_store_tree_
 static void         gtk_list_store_drag_source_init(GtkTreeDragSourceIface *iface);
 static void         gtk_list_store_drag_dest_init  (GtkTreeDragDestIface   *iface);
 static void         gtk_list_store_sortable_init   (GtkTreeSortableIface   *iface);
+static void         gtk_list_store_buildable_init  (GtkBuildableIface      *iface);
 static void         gtk_list_store_finalize        (GObject           *object);
 static GtkTreeModelFlags gtk_list_store_get_flags  (GtkTreeModel      *tree_model);
 static gint         gtk_list_store_get_n_columns   (GtkTreeModel      *tree_model);
@@ -115,6 +120,19 @@ static void     gtk_list_store_set_defau
 static gboolean gtk_list_store_has_default_sort_func (GtkTreeSortable        *sortable);
 
 
+/* buildable */
+static gboolean gtk_list_store_buildable_custom_tag_start (GtkBuildable  *buildable,
+							   GtkBuilder    *builder,
+							   GObject       *child,
+							   const gchar   *tagname,
+							   GMarkupParser *parser,
+							   gpointer      *data);
+static void     gtk_list_store_buildable_custom_tag_end (GtkBuildable *buildable,
+							 GtkBuilder   *builder,
+							 GObject      *child,
+							 const gchar  *tagname,
+							 gpointer      data);
+
 G_DEFINE_TYPE_WITH_CODE (GtkListStore, gtk_list_store, G_TYPE_OBJECT,
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
 						gtk_list_store_tree_model_init)
@@ -123,7 +141,10 @@ G_DEFINE_TYPE_WITH_CODE (GtkListStore, g
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_DEST,
 						gtk_list_store_drag_dest_init)
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_SORTABLE,
-						gtk_list_store_sortable_init))
+						gtk_list_store_sortable_init)
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_list_store_buildable_init))
+
 
 static void
 gtk_list_store_class_init (GtkListStoreClass *class)
@@ -177,6 +198,13 @@ gtk_list_store_sortable_init (GtkTreeSor
   iface->has_default_sort_func = gtk_list_store_has_default_sort_func;
 }
 
+void
+gtk_list_store_buildable_init (GtkBuildableIface *iface)
+{
+  iface->custom_tag_start = gtk_list_store_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_list_store_buildable_custom_tag_end;
+}
+
 static void
 gtk_list_store_init (GtkListStore *list_store)
 {
@@ -1945,6 +1973,243 @@ gtk_list_store_insert_with_valuesv (GtkL
   path = gtk_list_store_get_path (GTK_TREE_MODEL (list_store), iter);
   gtk_tree_model_row_inserted (GTK_TREE_MODEL (list_store), path, iter);
   gtk_tree_path_free (path);
+}
+
+/* GtkBuildable custom tag implementation
+ *
+ * <columns>
+ *   <column type="..."/>
+ *   <column type="..."/>
+ * </columns>
+ */
+typedef struct {
+  GObject *object;
+  GtkBuilder *builder;
+  GSList *column_type_names;
+  GType *column_types;
+  GValue *values;
+  gint *columns;
+  gint last_row;
+  gint n_columns;
+  gint row_column;
+  GQuark error_quark;
+  gboolean is_data;
+} SubParserData;
+
+static void
+list_store_start_element (GMarkupParseContext *context,
+			  const gchar         *element_name,
+			  const gchar        **names,
+			  const gchar        **values,
+			  gpointer             user_data,
+			  GError             **error)
+{
+  guint i;
+  SubParserData *data = (SubParserData*)user_data;
+
+  if (!strcmp (element_name, "col"))
+    {
+      int i, id = -1;
+
+      if (data->row_column >= data->n_columns)
+	g_set_error (error, data->error_quark, 0,
+		     "Too many columns, maximum is %d\n", data->n_columns - 1);
+
+      for (i = 0; names[i]; i++)
+	{
+	  if (!strcmp (names[i], "id"))
+	    {
+	      errno = 0;
+	      id = atoi (values[i]);
+	      if (errno)
+		g_set_error (error, data->error_quark, 0,
+			     "the id tag %s could not be converted to an integer", values[i]);
+	    }
+	}
+
+      if (id == -1)
+	g_set_error (error, data->error_quark, 0,
+		     "<col> needs an id attribute");
+
+      data->columns[data->row_column] = id;
+      data->row_column++;
+      data->is_data = TRUE;
+    }
+  else if (!strcmp (element_name, "row"))
+    ;
+  else if (!strcmp (element_name, "column"))
+    {
+      for (i = 0; names[i]; i++)
+	{
+	  if (!strcmp (names[i], "type"))
+	    data->column_type_names = g_slist_prepend (data->column_type_names,
+						  g_strdup (values[i]));
+	}
+    }
+  else if (!strcmp (element_name, "columns"))
+    ;
+  else if (!strcmp (element_name, "data"))
+    ;
+  else
+    g_set_error (error, data->error_quark, 0,
+		 "Unknown tag: %s", element_name);
+}
+
+static void
+list_store_end_element (GMarkupParseContext *context,
+			const gchar         *element_name,
+			gpointer             user_data,
+			GError             **error)
+{
+  SubParserData *data = (SubParserData*)user_data;
+
+  if (!strcmp (element_name, "row"))
+    {
+      GtkTreeIter iter;
+      int i;
+
+      gtk_list_store_insert_with_valuesv (GTK_LIST_STORE (data->object),
+					  &iter,
+					  data->last_row,
+					  data->columns,
+					  data->values,
+					  data->row_column);
+      for (i = 0; i < data->row_column; i++)
+	g_value_unset (&data->values[i]);
+      g_free (data->values);
+      data->values = g_new0 (GValue, data->n_columns);
+      data->last_row++;
+      data->row_column = 0;
+    }
+  else if (!strcmp (element_name, "columns"))
+    {
+      GType *column_types;
+      GSList *l;
+      int i;
+      GType type;
+
+      data->column_type_names = g_slist_reverse (data->column_type_names);
+      column_types = g_new0 (GType, g_slist_length (data->column_type_names));
+
+      for (l = data->column_type_names, i = 0; l; l = l->next, i++)
+	{
+	  type = gtk_registered_type_from_name (l->data);
+	  if (type == G_TYPE_INVALID)
+	    {
+	      g_warning ("Unknown type %s specified in treemodel %s",
+			 (const gchar*)l->data,
+			 gtk_buildable_get_name (GTK_BUILDABLE (data->object)));
+	      continue;
+	    }
+	  column_types[i] = type;
+
+	  g_free (l->data);
+	}
+
+      gtk_list_store_set_column_types (GTK_LIST_STORE (data->object), i,
+				       column_types);
+
+      g_free (column_types);
+      g_slist_free (data->column_type_names);
+      g_slice_free (SubParserData, data);
+    }
+  else if (!strcmp (element_name, "col"))
+    data->is_data = FALSE;
+  else if (!strcmp (element_name, "data"))
+    {
+      g_free (data->columns);
+      g_free (data->values);
+      g_slice_free (SubParserData, data);
+    }
+}
+
+static void
+list_store_text (GMarkupParseContext *context,
+		 const gchar         *text,
+		 gsize                text_len,
+		 gpointer             user_data,
+		 GError             **error)
+{
+  SubParserData *data = (SubParserData*)user_data;
+  gint i;
+
+  if (!data->is_data)
+    return;
+
+  i = data->row_column - 1;
+
+  if (!gtk_builder_value_from_string_type (data->builder,
+					   data->column_types[i],
+					   text,
+					   &data->values[i]))
+    {
+      g_error ("Could not convert '%s' to type %s\n",
+	       text, g_type_name (data->column_types[i]));
+    }
+}
+
+static const GMarkupParser list_store_parser =
+  {
+    list_store_start_element,
+    list_store_end_element,
+    list_store_text
+  };
+
+static gboolean
+gtk_list_store_buildable_custom_tag_start (GtkBuildable  *buildable,
+					   GtkBuilder    *builder,
+					   GObject       *child,
+					   const gchar   *tagname,
+					   GMarkupParser *parser,
+					   gpointer      *data)
+{
+  SubParserData *parser_data;
+
+  if (child)
+    return FALSE;
+
+  if (!strcmp (tagname, "columns"))
+    {
+
+      parser_data = g_slice_new0 (SubParserData);
+      parser_data->object = G_OBJECT (buildable);
+      parser_data->builder = builder;
+      parser_data->column_type_names = NULL;
+
+      *parser = list_store_parser;
+      *data = parser_data;
+      return TRUE;
+    }
+  else if (!strcmp (tagname, "data"))
+    {
+      gint n_columns = gtk_list_store_get_n_columns (GTK_TREE_MODEL (buildable));
+      if (n_columns == 0)
+	g_error ("Cannot append data to an empty model");
+
+      parser_data = g_slice_new0 (SubParserData);
+      parser_data->object = G_OBJECT (buildable);
+      parser_data->values = g_new0 (GValue, n_columns);
+      parser_data->columns = g_new0 (gint, n_columns);
+      parser_data->column_types = GTK_LIST_STORE (buildable)->column_headers;
+      parser_data->n_columns = n_columns;
+      parser_data->last_row = 0;
+      parser_data->error_quark = g_quark_from_static_string ("GtkListStore");
+
+      *parser = list_store_parser;
+      *data = parser_data;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static void
+gtk_list_store_buildable_custom_tag_end (GtkBuildable *buildable,
+					 GtkBuilder   *builder,
+					 GObject      *child,
+					 const gchar  *tagname,
+					 gpointer      data)
+{
 }
 
 #define __GTK_LIST_STORE_C__
Index: gtk/gtkmain.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmain.c,v
retrieving revision 1.282
diff -u -p -r1.282 gtkmain.c
--- gtk/gtkmain.c	23 Nov 2006 22:10:03 -0000	1.282
+++ gtk/gtkmain.c	4 Dec 2006 07:10:35 -0000
@@ -160,7 +160,8 @@ static const GDebugKey gtk_debug_keys[] 
   {"modules", GTK_DEBUG_MODULES},
   {"geometry", GTK_DEBUG_GEOMETRY},
   {"icontheme", GTK_DEBUG_ICONTHEME},
-  {"printing", GTK_DEBUG_PRINTING}
+  {"printing", GTK_DEBUG_PRINTING},
+  {"builder", GTK_DEBUG_BUILDER}
 };
 #endif /* G_ENABLE_DEBUG */
 
@@ -651,6 +652,7 @@ do_post_parse_initialization (int    *ar
   }
 
   gtk_type_init (0);
+  _gtk_type_table_init ();
   _gtk_accel_map_init ();  
   _gtk_rc_init ();
 
Index: gtk/gtkmenuitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenuitem.c,v
retrieving revision 1.132
diff -u -p -r1.132 gtkmenuitem.c
--- gtk/gtkmenuitem.c	9 Jun 2006 15:20:53 -0000	1.132
+++ gtk/gtkmenuitem.c	4 Dec 2006 07:10:40 -0000
@@ -36,6 +36,8 @@
 #include "gtkmenubar.h"
 #include "gtkmenuitem.h"
 #include "gtkseparatormenuitem.h"
+#include "gtkbuildable.h"
+#include "gtkstock.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
 #include "gtkalias.h"
@@ -95,9 +97,25 @@ static gboolean gtk_menu_item_can_activa
 						  guint      signal_id);
 
 
+static void gtk_menu_item_buildable_init (GtkBuildableIface *iface);
+
+static void gtk_menu_item_buildable_add  (GtkBuildable *buildable,
+					  GtkBuilder   *builder,
+					  GObject      *child,
+					  const gchar  *type);
+
+static void gtk_menu_item_buildable_set_property (GtkBuildable *buildable,
+						  GtkBuilder   *builder,
+						  const gchar  *name,
+						  const GValue *value);
+
 static guint menu_item_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (GtkMenuItem, gtk_menu_item, GTK_TYPE_ITEM)
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkMenuItem, gtk_menu_item, GTK_TYPE_ITEM, 
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_menu_item_buildable_init));
 
 static void
 gtk_menu_item_class_init (GtkMenuItemClass *klass)
@@ -230,6 +248,110 @@ gtk_menu_item_init (GtkMenuItem *menu_it
   menu_item->right_justify = FALSE;
 
   menu_item->timer = 0;
+}
+
+static void 
+gtk_menu_item_buildable_add (GtkBuildable *buildable,
+			     GtkBuilder   *builder,
+			     GObject      *child,
+			     const gchar  *type)
+{
+  if (GTK_IS_MENU (child))
+    gtk_menu_item_set_submenu (GTK_MENU_ITEM (buildable), GTK_WIDGET (child));
+  else
+    gtk_container_add (GTK_CONTAINER (buildable), GTK_WIDGET (child));
+}
+
+GtkWidget *
+_gtk_menu_item_ensure_child_label (GtkMenuItem *menu_item)
+{
+      GtkWidget *child = GTK_BIN (menu_item)->child;
+
+      if (!child) {
+	child = gtk_accel_label_new("");
+	gtk_misc_set_alignment(GTK_MISC(child), 0.0, 0.5);
+	gtk_container_add(GTK_CONTAINER(menu_item), child);
+	gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(child), 
+					 GTK_WIDGET (menu_item));
+	gtk_widget_show(child);
+      }
+      
+      return child;
+}
+
+static void
+gtk_menu_item_buildable_set_property (GtkBuildable *buildable,
+				      GtkBuilder   *builder,
+				      const gchar  *name,
+				      const GValue *value)
+{
+  GtkWidget *menu_item = GTK_WIDGET (buildable);
+  GValue     val = { 0, };
+
+  if (!strcmp (name, "label"))
+    {
+      GtkWidget *child = _gtk_menu_item_ensure_child_label (GTK_MENU_ITEM (menu_item));
+
+      if (GTK_IS_LABEL (child))
+	gtk_label_set_text (GTK_LABEL (child), g_value_get_string (value));
+    }
+  else if (!strcmp (name, "use-underline"))
+    {
+      GtkWidget *child = _gtk_menu_item_ensure_child_label (GTK_MENU_ITEM (menu_item));
+
+      gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN,
+					  g_value_get_string (value), &val);
+
+      if (GTK_IS_LABEL (child))
+	gtk_label_set_use_underline (GTK_LABEL (child), 
+				     g_value_get_boolean (&val));
+      
+      g_value_unset (&val);
+    }
+  else if (!strcmp (name, "use-stock"))
+    {
+      GtkWidget *child = _gtk_menu_item_ensure_child_label (GTK_MENU_ITEM (menu_item));
+      
+      gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN,
+					  g_value_get_string (value), &val);
+
+      if (GTK_IS_LABEL (child) && g_value_get_boolean (&val)) 
+	{
+	  const gchar *stock_id = gtk_label_get_label(GTK_LABEL(child));
+	  GtkStockItem stock_item;
+	  
+	  if (gtk_stock_lookup(stock_id, &stock_item)) 
+	    {
+	      gtk_label_set_text(GTK_LABEL(child), stock_item.label);
+	      gtk_label_set_use_underline(GTK_LABEL(child), TRUE);
+	      
+	      if (stock_item.keyval)
+		gtk_widget_add_accelerator (GTK_WIDGET (buildable),
+					    "activate",
+					    gtk_builder_ensure_accel_group (builder),
+					    stock_item.keyval,
+					    stock_item.modifier,
+					    GTK_ACCEL_VISIBLE);
+	    } 
+	  else 
+	    {
+	      g_warning("could not look up stock id '%s'", stock_id);
+	    }
+	}
+      g_value_unset (&val);
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+
+}
+
+static void
+gtk_menu_item_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->add          = gtk_menu_item_buildable_add;
+  iface->set_property = gtk_menu_item_buildable_set_property;
 }
 
 GtkWidget*
Index: gtk/gtknotebook.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtknotebook.c,v
retrieving revision 1.231
diff -u -p -r1.231 gtknotebook.c
--- gtk/gtknotebook.c	16 Nov 2006 12:56:30 -0000	1.231
+++ gtk/gtknotebook.c	4 Dec 2006 07:10:56 -0000
@@ -26,6 +26,7 @@
  */
 
 #include <config.h>
+#include <string.h>
 #include "gtknotebook.h"
 #include "gtkmain.h"
 #include "gtkmenu.h"
@@ -38,6 +39,7 @@
 #include "gtkbindings.h"
 #include "gtkprivate.h"
 #include "gtkdnd.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 #define SCROLL_DELAY_FACTOR   5
@@ -406,6 +408,12 @@ static gboolean focus_child_in (GtkNoteb
 
 static void stop_scrolling (GtkNotebook *notebook);
 
+/* GtkBuildable */
+static void gtk_notebook_buildable_init           (GtkBuildableIface *iface);
+static void gtk_notebook_buildable_add            (GtkBuildable *buildable,
+						   GtkBuilder   *builder,
+						   GObject      *child,
+						   const gchar  *type);
 
 static GtkNotebookWindowCreationFunc window_creation_hook = NULL;
 static gpointer window_creation_hook_data;
@@ -413,7 +421,9 @@ static GDestroyNotify window_creation_ho
 
 static guint notebook_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (GtkNotebook, gtk_notebook, GTK_TYPE_CONTAINER)
+G_DEFINE_TYPE_WITH_CODE (GtkNotebook, gtk_notebook, GTK_TYPE_CONTAINER,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_notebook_buildable_init))
 
 static void
 add_tab_bindings (GtkBindingSet    *binding_set,
@@ -1012,6 +1022,36 @@ gtk_notebook_init (GtkNotebook *notebook
                      GDK_ACTION_MOVE);
 
   gtk_drag_dest_set_track_motion (GTK_WIDGET (notebook), TRUE);
+}
+
+static void
+gtk_notebook_buildable_init (GtkBuildableIface *iface)
+{
+  iface->add = gtk_notebook_buildable_add;
+}
+
+static void
+gtk_notebook_buildable_add (GtkBuildable  *buildable,
+			    GtkBuilder    *builder,
+			    GObject       *child,
+			    const gchar   *type)
+{
+  GtkNotebook *notebook = GTK_NOTEBOOK (buildable);
+
+  if (type && !strcmp (type, "tab"))
+    {
+      GtkWidget * page;
+
+      page = gtk_notebook_get_nth_page (notebook, -1);
+      /* To set the tab label widget, we must have already a child
+       * inside the tab container. */
+      g_assert (page != NULL);
+      gtk_notebook_set_tab_label (notebook, page, GTK_WIDGET (child));
+    }
+  else if (!type)
+    gtk_notebook_append_page (notebook, GTK_WIDGET (child), NULL);
+  else
+    g_warning ("Invalid type specified: `%s'", type);
 }
 
 static gboolean
Index: gtk/gtkoptionmenu.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkoptionmenu.c,v
retrieving revision 1.87
diff -u -p -r1.87 gtkoptionmenu.c
--- gtk/gtkoptionmenu.c	10 Sep 2006 06:39:16 -0000	1.87
+++ gtk/gtkoptionmenu.c	4 Dec 2006 07:10:56 -0000
@@ -25,11 +25,14 @@
  */
 
 #include <config.h>
+#include <string.h>
+#include <stdlib.h>
 #include "gtkintl.h"
 #include "gtkmenu.h"
 #include "gtkmenuitem.h"
 #include "gtkmarshalers.h"
 #include "gdk/gdkkeysyms.h"
+#include "gtkbuildable.h"
 
 #undef GTK_DISABLE_DEPRECATED
 #include "gtkoptionmenu.h"
@@ -96,10 +99,21 @@ static void gtk_option_menu_show_all    
 static void gtk_option_menu_hide_all        (GtkWidget          *widget);
 static gboolean gtk_option_menu_mnemonic_activate (GtkWidget    *widget,
 						   gboolean      group_cycling);
-static GType gtk_option_menu_child_type   (GtkContainer       *container);
+static GType gtk_option_menu_child_type     (GtkContainer       *container);
 static gint gtk_option_menu_scroll_event    (GtkWidget          *widget,
 					     GdkEventScroll     *event);
 
+
+static void gtk_option_menu_buildable_init  (GtkBuildableIface  *iface);
+static void gtk_option_menu_buildable_set_property(GtkBuildable *buildable,
+						   GtkBuilder   *builder,
+						   const gchar  *name,
+						   const GValue *value);
+static void gtk_option_menu_buildable_add   (GtkBuildable       *buildable,
+					     GtkBuilder         *builder,
+					     GObject            *child,
+					     const gchar        *type);
+
 enum
 {
   CHANGED,
@@ -113,9 +127,18 @@ enum
   LAST_PROP
 };
 
+
 static guint signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (GtkOptionMenu, gtk_option_menu, GTK_TYPE_BUTTON)
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+static const gchar *gtk_option_menu_history_key = "GtkOptionMenu::history";
+static GQuark       gtk_option_menu_history_id  = 0;
+
+G_DEFINE_TYPE_WITH_CODE (GtkOptionMenu, gtk_option_menu, GTK_TYPE_BUTTON,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_option_menu_buildable_init));
+
 
 static void
 gtk_option_menu_class_init (GtkOptionMenuClass *class)
@@ -130,6 +153,9 @@ gtk_option_menu_class_init (GtkOptionMen
   widget_class = (GtkWidgetClass*) class;
   container_class = (GtkContainerClass*) class;
 
+  gtk_option_menu_history_id = 
+    g_quark_from_static_string (gtk_option_menu_history_key);
+
   signals[CHANGED] =
     g_signal_new (I_("changed"),
                   G_OBJECT_CLASS_TYPE (class),
@@ -193,6 +219,52 @@ gtk_option_menu_init (GtkOptionMenu *opt
   option_menu->menu_item = NULL;
   option_menu->width = 0;
   option_menu->height = 0;
+}
+
+
+static void
+gtk_option_menu_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->add          = gtk_option_menu_buildable_add;
+  iface->set_property = gtk_option_menu_buildable_set_property;
+}
+
+static void
+gtk_option_menu_buildable_set_property (GtkBuildable *buildable,
+					GtkBuilder   *builder,
+					const gchar  *name,
+					const GValue *value)
+{
+  if (!strcmp (name, "history"))
+    {
+      gint history = strtol (g_value_get_string (value), NULL, 0);
+
+      /* Delay application of this virtual property untill
+       * after adding the submenu
+       */
+      g_object_set_qdata (G_OBJECT (buildable), gtk_option_menu_history_id,
+			  GINT_TO_POINTER (history));
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+}
+
+static void
+gtk_option_menu_buildable_add (GtkBuildable  *buildable,
+			       GtkBuilder    *builder,
+			       GObject       *child,
+			       const gchar   *type)
+{
+  gint history = 
+    GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (buildable), 
+					 gtk_option_menu_history_id));
+
+  gtk_option_menu_set_menu (GTK_OPTION_MENU (buildable), 
+			    GTK_WIDGET (child));
+      
+  gtk_option_menu_set_history (GTK_OPTION_MENU (buildable), history);
 }
 
 GtkWidget*
Index: gtk/gtkpixmap.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkpixmap.c,v
retrieving revision 1.38
diff -u -p -r1.38 gtkpixmap.c
--- gtk/gtkpixmap.c	14 May 2006 04:25:29 -0000	1.38
+++ gtk/gtkpixmap.c	4 Dec 2006 07:10:56 -0000
@@ -32,8 +32,10 @@
 
 #include <config.h>
 #include <math.h>
+#include <string.h>
 #include "gtkcontainer.h"
 #include "gtkpixmap.h"
+#include "gtkbuildable.h"
 #include "gtkintl.h"
 #include "gtkalias.h"
 
@@ -43,7 +45,18 @@ static gint gtk_pixmap_expose     (GtkWi
 static void gtk_pixmap_finalize   (GObject         *object);
 static void build_insensitive_pixmap (GtkPixmap *gtkpixmap);
 
-G_DEFINE_TYPE (GtkPixmap, gtk_pixmap, GTK_TYPE_MISC)
+
+static void gtk_pixmap_buildable_init (GtkBuildableIface *iface);
+static void gtk_pixmap_buildable_set_property (GtkBuildable *buildable,
+					       GtkBuilder   *builder,
+					       const gchar  *name,
+					       const GValue *value);
+
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkPixmap, gtk_pixmap, GTK_TYPE_MISC,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_pixmap_buildable_init));
 
 static void
 gtk_pixmap_class_init (GtkPixmapClass *class)
@@ -65,6 +78,62 @@ gtk_pixmap_init (GtkPixmap *pixmap)
 
   pixmap->pixmap = NULL;
   pixmap->mask = NULL;
+}
+
+static void
+gtk_pixmap_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_pixmap_buildable_set_property;
+}
+
+static void 
+gtk_pixmap_buildable_set_property (GtkBuildable *buildable,
+				   GtkBuilder   *builder,
+				   const gchar  *name,
+				   const GValue *value)
+{
+  if (!strcmp (name, "filename"))
+    {
+      GdkPixbuf *pb;
+      gchar *file;
+      GdkPixmap *pixmap = NULL;
+      GdkBitmap *bitmap = NULL;
+      GdkColormap *cmap;
+    
+      file = gtk_builder_relative_file (builder, g_value_get_string (value));
+      pb = gdk_pixbuf_new_from_file (file, NULL);
+      g_free (file);
+      
+      if (!pb)
+	return;
+
+      cmap = gtk_widget_get_colormap (GTK_WIDGET (buildable));
+      gdk_pixbuf_render_pixmap_and_mask_for_colormap (pb, cmap, &pixmap, &bitmap, 127);
+      gtk_pixmap_set (GTK_PIXMAP (buildable), pixmap, bitmap);
+      
+      if (pixmap) g_object_unref (pixmap);
+      if (bitmap) g_object_unref (bitmap);
+
+      g_object_unref (pb);
+    }
+  else if (!strcmp (name, "build-insensitive"))
+    {
+      GValue val = { 0, };
+
+      if (gtk_builder_value_from_string_type  (builder, G_TYPE_BOOLEAN,
+					       g_value_get_string (value),
+					       &val))
+	{
+	  gtk_pixmap_set_build_insensitive (GTK_PIXMAP (buildable), 
+					    g_value_get_boolean (&val));
+
+	  g_value_unset (&val);
+	}
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
 }
 
 GtkWidget*
Index: gtk/gtkprogress.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkprogress.c,v
retrieving revision 1.45
diff -u -p -r1.45 gtkprogress.c
--- gtk/gtkprogress.c	10 Sep 2006 06:39:16 -0000	1.45
+++ gtk/gtkprogress.c	4 Dec 2006 07:10:56 -0000
@@ -29,6 +29,7 @@
 #include <string.h>
 #undef GTK_DISABLE_DEPRECATED
 #include "gtkprogress.h" 
+#include "gtkbuildable.h"
 #include "gtkprivate.h" 
 #include "gtkintl.h"
 #include "gtkalias.h"
@@ -66,7 +67,19 @@ static void gtk_progress_value_changed  
 static void gtk_progress_changed         (GtkAdjustment    *adjustment,
 					  GtkProgress      *progress);
 
-G_DEFINE_TYPE (GtkProgress, gtk_progress, GTK_TYPE_WIDGET)
+static void gtk_progress_buildable_init (GtkBuildableIface *iface);
+static void gtk_progress_buildable_set_property (GtkBuildable *buildable,
+						 GtkBuilder   *builder,
+						 const gchar  *name,
+						 const GValue *value);
+
+
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkProgress, gtk_progress, GTK_TYPE_WIDGET,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_progress_buildable_init));
+
 
 static void
 gtk_progress_class_init (GtkProgressClass *class)
@@ -123,6 +136,29 @@ gtk_progress_class_init (GtkProgressClas
                                                        P_("The vertical text alignment, from 0 (top) to 1 (bottom)."),
 						       0.0, 1.0, 0.5,
 						       GTK_PARAM_READWRITE));
+}
+
+static void
+gtk_progress_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_progress_buildable_set_property;
+}
+
+static void
+gtk_progress_buildable_set_property (GtkBuildable *buildable,
+				     GtkBuilder   *builder,
+				     const gchar  *name,
+				     const GValue *value)
+{
+  if (!strcmp (name, "format"))
+    {
+      gtk_progress_set_format_string (GTK_PROGRESS (buildable), 
+				      g_value_get_string (value));
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
 }
 
 static void
Index: gtk/gtksizegroup.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtksizegroup.c,v
retrieving revision 1.27
diff -u -p -r1.27 gtksizegroup.c
--- gtk/gtksizegroup.c	2 Oct 2006 05:22:27 -0000	1.27
+++ gtk/gtksizegroup.c	4 Dec 2006 07:11:01 -0000
@@ -19,10 +19,12 @@
  */
 
 #include <config.h>
+#include <string.h>
 #include "gtkcontainer.h"
 #include "gtkintl.h"
 #include "gtkprivate.h"
 #include "gtksizegroup.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 enum {
@@ -49,6 +51,20 @@ static void add_widget_to_closure (GtkWi
 				   GSList           **groups,
 				   GSList           **widgets);
 
+/* GtkBuildable */
+static void gtk_size_group_buildable_init (GtkBuildableIface *iface);
+static gboolean gtk_size_group_buildable_custom_tag_start (GtkBuildable  *buildable,
+							   GtkBuilder    *builder,
+							   GObject       *child,
+							   const gchar   *tagname,
+							   GMarkupParser *parser,
+							   gpointer      *data);
+static void gtk_size_group_buildable_custom_tag_end (GtkBuildable  *buildable,
+						     GtkBuilder    *builder,
+						     GObject       *child,
+						     const gchar   *tagname,
+						     gpointer       data);
+
 static GQuark size_groups_quark;
 static const gchar size_groups_tag[] = "gtk-size-groups";
 
@@ -310,7 +326,16 @@ gtk_size_group_init (GtkSizeGroup *size_
   size_group->ignore_hidden = 0;
 }
 
-G_DEFINE_TYPE (GtkSizeGroup, gtk_size_group, G_TYPE_OBJECT)
+static void
+gtk_size_group_buildable_init (GtkBuildableIface *iface)
+{
+  iface->custom_tag_start = gtk_size_group_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_size_group_buildable_custom_tag_end;
+}
+
+G_DEFINE_TYPE_WITH_CODE (GtkSizeGroup, gtk_size_group, G_TYPE_OBJECT,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_size_group_buildable_init))
 
 static void
 gtk_size_group_set_property (GObject      *object,
@@ -809,6 +834,106 @@ _gtk_size_group_queue_resize (GtkWidget 
 
   queue_resize_on_widget (widget, TRUE);
 }
+
+typedef struct {
+  GObject *object;
+  GSList *items;
+} GSListSubParserData;
+
+static void
+size_group_start_element (GMarkupParseContext *context,
+			  const gchar         *element_name,
+			  const gchar        **names,
+			  const gchar        **values,
+			  gpointer            user_data,
+			  GError            **error)
+{
+  guint i;
+  GSListSubParserData *data = (GSListSubParserData*)user_data;
+
+  if (!strcmp (element_name, "widget"))
+    for (i = 0; names[i]; i++)
+      if (!strcmp (names[i], "name"))
+	data->items = g_slist_prepend (data->items, g_strdup (values[i]));
+  else if (!strcmp (element_name, "widgets"))
+    return;
+  else
+    g_warning ("Unsupported type tag for GtkSizeGroup: %s\n",
+	       element_name);
+
+}
+
+static const GMarkupParser size_group_parser =
+  {
+    size_group_start_element
+  };
+
+static gboolean
+gtk_size_group_buildable_custom_tag_start (GtkBuildable  *buildable,
+					   GtkBuilder    *builder,
+					   GObject       *child,
+					   const gchar   *tagname,
+					   GMarkupParser *parser,
+					   gpointer      *data)
+{
+  GSListSubParserData *parser_data;
+
+  if (child)
+    return FALSE;
+
+  if (!strcmp (tagname, "widgets"))
+    {
+      parser_data = g_slice_new0 (GSListSubParserData);
+      parser_data->items = NULL;
+      parser_data->object = G_OBJECT (buildable);
+
+      *parser = size_group_parser;
+      *data = parser_data;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static void
+builder_finish_cb (GtkBuilder *builder,
+		   gpointer user_data)
+{
+  GSList *l;
+  GSListSubParserData *data = (GSListSubParserData*)user_data;
+  GObject *object;
+
+  data->items = g_slist_reverse (data->items);
+
+  for (l = data->items; l; l = l->next)
+    {
+      object = gtk_builder_get_object (builder, l->data);
+      if (!object)
+	{
+	  g_warning ("Unknown object %s specified in sizegroup %s",
+		     (const gchar*)l->data,
+		     gtk_buildable_get_name (GTK_BUILDABLE (data->object)));
+	  continue;
+	}
+      gtk_size_group_add_widget (GTK_SIZE_GROUP (data->object),
+				 GTK_WIDGET (object));
+      g_free (l->data);
+    }
+  g_slist_free (data->items);
+  g_slice_free (GSListSubParserData, data);
+}
+
+static void
+gtk_size_group_buildable_custom_tag_end (GtkBuildable  *buildable,
+					 GtkBuilder    *builder,
+					 GObject       *child,
+					 const gchar   *tagname,
+					 gpointer       data)
+{
+  g_signal_connect (builder, "finish",
+		    (GCallback)builder_finish_cb, data);
+}
+
 
 #define __GTK_SIZE_GROUP_C__
 #include "gtkaliasdef.c"
Index: gtk/gtktext.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktext.c,v
retrieving revision 1.133
diff -u -p -r1.133 gtktext.c
--- gtk/gtktext.c	6 Jul 2006 05:14:03 -0000	1.133
+++ gtk/gtktext.c	4 Dec 2006 07:11:12 -0000
@@ -38,6 +38,7 @@
 #include "gtksignal.h"
 #include "gtkstyle.h"
 #include "gtkobject.h"
+#include "gtkbuildable.h"
 #define GTK_ENABLE_BROKEN
 #include "gtktext.h"
 #include "line-wrap.xbm"
@@ -397,6 +398,15 @@ static void gtk_text_select_line        
 static void gtk_text_set_position (GtkOldEditable *old_editable,
 				   gint            position);
 
+
+
+/* Buildable */
+static void gtk_text_buildable_init           (GtkBuildableIface *iface);
+static void gtk_text_buildable_set_property   (GtkBuildable      *buildable,
+					       GtkBuilder        *builder,
+					       const gchar       *name,
+					       const GValue      *value);
+
 /* #define DEBUG_GTK_TEXT */
 
 #if defined(DEBUG_GTK_TEXT) && defined(__GNUC__)
@@ -444,6 +454,8 @@ static void gtk_text_show_props (GtkText
 
 static GtkWidgetClass *parent_class = NULL;
 
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
 /**********************************************************************/
 /*			        Widget Crap                           */
 /**********************************************************************/
@@ -473,12 +485,22 @@ gtk_text_get_type (void)
 	NULL, /* interface_finalize */
 	NULL  /* interface_data */
       };
+
+      static const GInterfaceInfo buildable_info =
+      {
+	(GInterfaceInitFunc) gtk_text_buildable_init, /* interface_init */
+	NULL, /* interface_finalize */
+	NULL  /* interface_data */
+      };
       
       I_("GtkText");
       text_type = gtk_type_unique (GTK_TYPE_OLD_EDITABLE, &text_info);
       g_type_add_interface_static (text_type,
 				   GTK_TYPE_EDITABLE,
 				   &editable_info);
+      g_type_add_interface_static (text_type,
+				   GTK_TYPE_BUILDABLE,
+				   &buildable_info);
     }
   
   return text_type;
@@ -693,6 +715,32 @@ gtk_text_init (GtkText *text)
   gtk_text_set_adjustments (text, NULL, NULL);
   gtk_editable_set_position (GTK_EDITABLE (text), 0);
 }
+
+static void
+gtk_text_buildable_init (GtkBuildableIface *iface)
+{
+
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_text_buildable_set_property;
+}
+
+static void
+gtk_text_buildable_set_property (GtkBuildable *buildable,
+				 GtkBuilder   *builder,
+				 const gchar  *name,
+				 const GValue *value)
+{
+  if (!strcmp (name, "text"))
+    {
+      gint pos = 0;
+      gtk_editable_insert_text (GTK_EDITABLE (buildable), 
+				g_value_get_string (value), -1, &pos);
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+}
+
 
 GtkWidget*
 gtk_text_new (GtkAdjustment *hadj,
Index: gtk/gtktextview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextview.c,v
retrieving revision 1.325
diff -u -p -r1.325 gtktextview.c
--- gtk/gtktextview.c	3 Dec 2006 21:16:42 -0000	1.325
+++ gtk/gtktextview.c	4 Dec 2006 07:11:28 -0000
@@ -43,12 +43,14 @@
 #include "gtktextdisplay.h"
 #include "gtktextview.h"
 #include "gtkimmulticontext.h"
+#include "gtkbuildable.h"
 #include "gdk/gdkkeysyms.h"
 #include "gtkprivate.h"
 #include "gtktextutil.h"
 #include "gtkwindow.h"
 #include "gtkalias.h"
 
+
 /* How scrolling, validation, exposes, etc. work.
  *
  * The expose_event handler has the invariant that the onscreen lines
@@ -365,6 +367,13 @@ static void gtk_text_view_forall (GtkCon
                                   GtkCallback   callback,
                                   gpointer      callback_data);
 
+/* Buildable */
+static void gtk_text_view_buildable_init (GtkBuildableIface *iface);
+static void gtk_text_view_buildable_set_property (GtkBuildable *buildable,
+						  GtkBuilder   *builder,
+						  const gchar  *name,
+						  const GValue *value);
+
 /* FIXME probably need the focus methods. */
 
 typedef struct _GtkTextViewChild GtkTextViewChild;
@@ -428,7 +437,12 @@ static gint           text_window_get_he
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (GtkTextView, gtk_text_view, GTK_TYPE_CONTAINER)
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkTextView, gtk_text_view, GTK_TYPE_CONTAINER,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_text_view_buildable_init));
+
 
 static void
 add_move_binding (GtkBindingSet  *binding_set,
@@ -1082,6 +1096,35 @@ gtk_text_view_init (GtkTextView *text_vi
   /* We handle all our own redrawing */
   gtk_widget_set_redraw_on_allocate (widget, FALSE);
 }
+
+static void
+gtk_text_view_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_text_view_buildable_set_property;
+}
+
+static void
+gtk_text_view_buildable_set_property (GtkBuildable *buildable,
+				      GtkBuilder   *builder,
+				      const gchar  *name,
+				      const GValue *value)
+{
+  if (!strcmp (name, "text"))
+    {
+      GtkTextBuffer *buffy;
+      const gchar   *str = g_value_get_string (value);
+
+      buffy = gtk_text_buffer_new (NULL);
+      gtk_text_buffer_set_text (buffy, str, strlen (str));
+      gtk_text_view_set_buffer (GTK_TEXT_VIEW (buildable), buffy);
+      g_object_unref (G_OBJECT (buffy));
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+}
+
 
 /**
  * gtk_text_view_new:
Index: gtk/gtktoolbutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktoolbutton.c,v
retrieving revision 1.44
diff -u -p -r1.44 gtktoolbutton.c
--- gtk/gtktoolbutton.c	8 Oct 2006 05:07:34 -0000	1.44
+++ gtk/gtktoolbutton.c	4 Dec 2006 07:11:33 -0000
@@ -32,6 +32,7 @@
 #include "gtkvbox.h"
 #include "gtkintl.h"
 #include "gtktoolbar.h"
+#include "gtkbuildable.h"
 #include "gtkprivate.h"
 #include "gtkalias.h"
 
@@ -77,9 +78,18 @@ static void gtk_tool_button_style_set   
 					    GtkStyle           *prev_style);
 
 static void gtk_tool_button_construct_contents (GtkToolItem *tool_item);
+
+
+static void gtk_tool_button_buildable_init (GtkBuildableIface *iface);
+
+static void gtk_tool_button_buildable_set_property (GtkBuildable *buildable,
+						    GtkBuilder   *builder,
+						    const gchar  *name,
+						    const GValue *value);
       
 static GObjectClass *parent_class = NULL;
 static guint         toolbutton_signals[LAST_SIGNAL] = { 0 };
+static GtkBuildableIface *parent_buildable_iface = NULL;
 
 #define GTK_TOOL_BUTTON_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_TOOL_BUTTON, GtkToolButtonPrivate))
 
@@ -102,13 +112,25 @@ gtk_tool_button_get_type (void)
   static GtkType type = 0;
 
   if (!type)
-    type = g_type_register_static_simple (GTK_TYPE_TOOL_ITEM,
-					  I_("GtkToolButton"),
-					  sizeof (GtkToolButtonClass),
-					  (GClassInitFunc) gtk_tool_button_class_init,
-					  sizeof (GtkToolButton),
-					  (GInstanceInitFunc) gtk_tool_button_init,
-					  0);
+    {
+      static const GInterfaceInfo buildable_info = 
+	{
+	  (GInterfaceInitFunc)gtk_tool_button_buildable_init, /* interface init */
+	  NULL, /* interface finalize */
+	  NULL  /* interface data */
+	};
+
+      type = g_type_register_static_simple (GTK_TYPE_TOOL_ITEM,
+					    I_("GtkToolButton"),
+					    sizeof (GtkToolButtonClass),
+					    (GClassInitFunc) gtk_tool_button_class_init,
+					    sizeof (GtkToolButton),
+					    (GInstanceInitFunc) gtk_tool_button_init,
+					    0);
+
+      g_type_add_interface_static (type, GTK_TYPE_BUILDABLE, &buildable_info);
+    }
+
   return type;
 }
 
@@ -280,6 +302,49 @@ gtk_tool_button_init (GtkToolButton     
   gtk_container_add (GTK_CONTAINER (button), button->priv->button);
   gtk_widget_show (button->priv->button);
 }
+
+static void
+gtk_tool_button_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_tool_button_buildable_set_property;
+}
+
+static void 
+gtk_tool_button_buildable_set_property (GtkBuildable *buildable,
+					GtkBuilder   *builder,
+					const gchar  *name,
+					const GValue *value)
+{
+
+  if (!strcmp (name, "icon"))
+    {
+      GdkPixbuf *pb;
+      GtkWidget *image;
+      gchar *file;
+
+      file = gtk_builder_relative_file (builder, g_value_get_string (value));
+      pb = gdk_pixbuf_new_from_file (file, NULL);
+      g_free (file);
+
+      if (!pb) 
+	{
+	  g_warning ("Couldn't find image file: %s", g_value_get_string (value));
+	  return;
+	}
+
+      image = gtk_image_new_from_pixbuf (pb);
+      g_object_unref (pb);
+      
+      gtk_widget_show (image);
+      gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (buildable), image);
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+
+}
+
 
 static void
 gtk_tool_button_construct_contents (GtkToolItem *tool_item)
Index: gtk/gtktoolitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktoolitem.c,v
retrieving revision 1.36
diff -u -p -r1.36 gtktoolitem.c
--- gtk/gtktoolitem.c	10 Sep 2006 06:39:16 -0000	1.36
+++ gtk/gtktoolitem.c	4 Dec 2006 07:11:33 -0000
@@ -25,6 +25,7 @@
 #include "gtkmarshalers.h"
 #include "gtktoolbar.h"
 #include "gtkseparatormenuitem.h"
+#include "gtkbuildable.h"
 #include "gtkintl.h"
 #include "gtkmain.h"
 #include "gtkprivate.h"
@@ -94,10 +95,21 @@ static gboolean gtk_tool_item_real_set_t
 
 static gboolean gtk_tool_item_create_menu_proxy (GtkToolItem *item);
 
+static void gtk_tool_item_buildable_init (GtkBuildableIface *iface);
+static void gtk_tool_item_buildable_set_property (GtkBuildable *buildable,
+						  GtkBuilder   *builder,
+						  const gchar  *name,
+						  const GValue *value);
+
 
 static guint toolitem_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (GtkToolItem, gtk_tool_item, GTK_TYPE_BIN)
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
+G_DEFINE_TYPE_WITH_CODE (GtkToolItem, gtk_tool_item, GTK_TYPE_BIN,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, 
+						gtk_tool_item_buildable_init));
+
 
 static void
 gtk_tool_item_class_init (GtkToolItemClass *klass)
@@ -247,6 +259,30 @@ gtk_tool_item_init (GtkToolItem *toolite
   toolitem->priv->visible_vertical = TRUE;
   toolitem->priv->homogeneous = FALSE;
   toolitem->priv->expand = FALSE;
+}
+
+static void
+gtk_tool_item_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_tool_item_buildable_set_property;
+}
+
+static void
+gtk_tool_item_buildable_set_property (GtkBuildable *buildable,
+				      GtkBuilder   *builder,
+				      const gchar  *name,
+				      const GValue *value)
+{
+  if (!strcmp (name, "tooltip"))
+    {
+      gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (buildable), 
+				 gtk_builder_get_tooltips (builder),
+				 g_value_get_string (value), NULL);
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
 }
 
 static void
Index: gtk/gtktree.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktree.c,v
retrieving revision 1.57
diff -u -p -r1.57 gtktree.c
--- gtk/gtktree.c	6 Jul 2006 05:14:03 -0000	1.57
+++ gtk/gtktree.c	4 Dec 2006 07:11:38 -0000
@@ -27,10 +27,12 @@
 #undef GTK_DISABLE_DEPRECATED
 
 #include <config.h>
+#include <string.h>
 #include "gtkmain.h"
 #include "gtkmarshalers.h"
 #include "gtksignal.h"
 #include "gtklist.h"
+#include "gtkbuildable.h"
 
 #define GTK_ENABLE_BROKEN
 #include "gtktree.h"
@@ -77,9 +79,18 @@ static void gtk_real_tree_unselect_child
 
 static GtkType gtk_tree_child_type  (GtkContainer   *container);
 
+static void gtk_tree_buildable_init (GtkBuildableIface *iface);
+static void gtk_tree_buildable_set_property (GtkBuildable *buildable,
+					     GtkBuilder   *builder,
+					     const gchar  *name,
+					     const GValue *value);
+
+
 static GtkContainerClass *parent_class = NULL;
 static guint tree_signals[LAST_SIGNAL] = { 0 };
 
+static GtkBuildableIface *parent_buildable_iface = NULL;
+
 GtkType
 gtk_tree_get_type (void)
 {
@@ -98,9 +109,20 @@ gtk_tree_get_type (void)
         /* reserved_2 */ NULL,
         (GtkClassInitFunc) NULL,
       };
+
+      static const GInterfaceInfo buildable_info =
+      {
+	(GInterfaceInitFunc) gtk_tree_buildable_init,
+	NULL,
+	NULL
+      };
       
       I_("GtkTree");
       tree_type = gtk_type_unique (gtk_container_get_type (), &tree_info);
+
+      g_type_add_interface_static (tree_type,
+				   GTK_TYPE_BUILDABLE,
+				   &buildable_info);
     }
   
   return tree_type;
@@ -187,6 +209,61 @@ gtk_tree_init (GtkTree *tree)
   tree->view_mode = GTK_TREE_VIEW_LINE;
   tree->view_line = TRUE;
 }
+
+static void
+gtk_tree_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+  iface->set_property = gtk_tree_buildable_set_property;
+}
+
+static void
+gtk_tree_buildable_set_property (GtkBuildable *buildable,
+				 GtkBuilder   *builder,
+				 const gchar  *name,
+				 const GValue *value)
+{
+  GValue val = { 0, };
+
+  if (!strcmp (name, "selection-mode"))
+    {
+      if (gtk_builder_value_from_string_type  (builder, GTK_TYPE_SELECTION_MODE,
+					       g_value_get_string (value),
+					       &val))
+	{
+	  gtk_tree_set_selection_mode (GTK_TREE (buildable), 
+				       g_value_get_enum (&val));
+	  g_value_unset (&val);
+	}
+    }
+  else if (!strcmp (name, "view-mode"))
+    {
+      if (gtk_builder_value_from_string_type  (builder, GTK_TYPE_TREE_VIEW_MODE,
+					       g_value_get_string (value),
+					       &val))
+	{
+	  gtk_tree_set_view_mode (GTK_TREE (buildable), 
+				  g_value_get_enum (&val));
+	  g_value_unset (&val);
+	}
+    }
+  else if (!strcmp (name, "view-line"))
+    {
+      if (gtk_builder_value_from_string_type  (builder, G_TYPE_BOOLEAN,
+					       g_value_get_string (value),
+					       &val))
+	{
+	  gtk_tree_set_view_lines (GTK_TREE (buildable), 
+				   g_value_get_boolean (&val));
+	  g_value_unset (&val);
+	}
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
+}
+
+
 
 GtkWidget*
 gtk_tree_new (void)
Index: gtk/gtktreestore.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreestore.c,v
retrieving revision 1.130
diff -u -p -r1.130 gtktreestore.c
--- gtk/gtktreestore.c	6 Jul 2006 05:14:03 -0000	1.130
+++ gtk/gtktreestore.c	4 Dec 2006 07:11:43 -0000
@@ -24,6 +24,7 @@
 #include "gtktreestore.h"
 #include "gtktreedatalist.h"
 #include "gtktreednd.h"
+#include "gtkbuildable.h"
 #include "gtkintl.h"
 #include "gtkalias.h"
 
@@ -35,6 +36,7 @@ static void         gtk_tree_store_tree_
 static void         gtk_tree_store_drag_source_init(GtkTreeDragSourceIface *iface);
 static void         gtk_tree_store_drag_dest_init  (GtkTreeDragDestIface   *iface);
 static void         gtk_tree_store_sortable_init   (GtkTreeSortableIface   *iface);
+static void         gtk_tree_store_buildable_init  (GtkBuildableIface      *iface);
 static void         gtk_tree_store_finalize        (GObject           *object);
 static GtkTreeModelFlags gtk_tree_store_get_flags  (GtkTreeModel      *tree_model);
 static gint         gtk_tree_store_get_n_columns   (GtkTreeModel      *tree_model);
@@ -115,6 +117,22 @@ static void     gtk_tree_store_set_defau
 							GtkDestroyNotify        destroy);
 static gboolean gtk_tree_store_has_default_sort_func   (GtkTreeSortable        *sortable);
 
+
+/* buildable */
+
+/* buildable */
+static gboolean gtk_tree_store_buildable_custom_tag_start (GtkBuildable  *buildable,
+							   GtkBuilder    *builder,
+							   GObject       *child,
+							   const gchar   *tagname,
+							   GMarkupParser *parser,
+							   gpointer      *data);
+static void     gtk_tree_store_buildable_custom_tag_end (GtkBuildable *buildable,
+							 GtkBuilder   *builder,
+							 GObject      *child,
+							 const gchar  *tagname,
+							 gpointer      data);
+
 static void     validate_gnode                         (GNode *node);
 
 static void     gtk_tree_store_move                    (GtkTreeStore           *tree_store,
@@ -142,7 +160,9 @@ G_DEFINE_TYPE_WITH_CODE (GtkTreeStore, g
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_DEST,
 						gtk_tree_store_drag_dest_init)
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_SORTABLE,
-						gtk_tree_store_sortable_init))
+						gtk_tree_store_sortable_init)
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_tree_store_buildable_init))
 
 static void
 gtk_tree_store_class_init (GtkTreeStoreClass *class)
@@ -196,6 +216,13 @@ gtk_tree_store_sortable_init (GtkTreeSor
   iface->has_default_sort_func = gtk_tree_store_has_default_sort_func;
 }
 
+void
+gtk_tree_store_buildable_init (GtkBuildableIface *iface)
+{
+  iface->custom_tag_start = gtk_tree_store_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_tree_store_buildable_custom_tag_end;
+}
+
 static void
 gtk_tree_store_init (GtkTreeStore *tree_store)
 {
@@ -3110,6 +3137,115 @@ validate_gnode (GNode* node)
       validate_gnode (iter);
       iter = iter->next;
     }
+}
+
+/* GtkBuildable custom tag implementation
+ *
+ * <columns>
+ *   <column type="..."/>
+ *   <column type="..."/>
+ * </columns>
+ */
+typedef struct {
+  GObject *object;
+  GSList *items;
+} GSListSubParserData;
+
+static void
+tree_model_start_element (GMarkupParseContext *context,
+			  const gchar         *element_name,
+			  const gchar        **names,
+			  const gchar        **values,
+			  gpointer            user_data,
+			  GError            **error)
+{
+  guint i;
+  GSListSubParserData *data = (GSListSubParserData*)user_data;
+
+  for (i = 0; names[i]; i++)
+    {
+      if (!strcmp (names[i], "type"))
+	data->items = g_slist_prepend (data->items, g_strdup (values[i]));
+    }
+}
+
+static const GMarkupParser tree_model_parser =
+  {
+    tree_model_start_element
+  };
+
+
+static gboolean
+gtk_tree_store_buildable_custom_tag_start (GtkBuildable  *buildable,
+					   GtkBuilder    *builder,
+					   GObject       *child,
+					   const gchar   *tagname,
+					   GMarkupParser *parser,
+					   gpointer      *data)
+{
+  GSListSubParserData *parser_data;
+
+  if (child)
+    return FALSE;
+
+  if (!strcmp (tagname, "columns"))
+    {
+      parser_data = g_slice_new0 (GSListSubParserData);
+      parser_data->items = NULL;
+      parser_data->object = G_OBJECT (buildable);
+
+      *parser = tree_model_parser;
+      *data = parser_data;
+      return TRUE;
+    }
+
+  return FALSE;
+}
+
+static void
+subparser_tree_model_finish_cb (GtkBuilder *builder,
+				gpointer user_data)
+{
+  GSList *l;
+  GSListSubParserData *data = (GSListSubParserData*)user_data;
+  GType *types;
+  int i;
+  GType type;
+
+  data->items = g_slist_reverse (data->items);
+  types = g_new0 (GType, g_slist_length (data->items));
+
+  for (l = data->items, i = 0; l; l = l->next, i++)
+    {
+      type = gtk_registered_type_from_name (l->data);
+      if (type == G_TYPE_INVALID)
+	{
+	  g_warning ("Unknown type %s specified in treemodel %s",
+		     (const gchar*)l->data,
+		     gtk_buildable_get_name (GTK_BUILDABLE (data->object)));
+	  continue;
+	}
+      types[i] = type;
+
+      g_free (l->data);
+    }
+
+  gtk_tree_store_set_column_types (GTK_TREE_STORE (data->object), i, types);
+
+  g_free (types);
+  g_slist_free (data->items);
+  g_slice_free (GSListSubParserData, data);
+}
+
+static void
+gtk_tree_store_buildable_custom_tag_end (GtkBuildable *buildable,
+					 GtkBuilder   *builder,
+					 GObject      *child,
+					 const gchar  *tagname,
+					 gpointer      data)
+{
+  g_signal_connect (G_OBJECT (builder), "finish",
+		    (GCallback)subparser_tree_model_finish_cb, data);
 }
 
 #define __GTK_TREE_STORE_C__
Index: gtk/gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.581
diff -u -p -r1.581 gtktreeview.c
--- gtk/gtktreeview.c	3 Dec 2006 15:14:51 -0000	1.581
+++ gtk/gtktreeview.c	4 Dec 2006 07:12:14 -0000
@@ -29,6 +29,7 @@
 #include "gtkcellrenderer.h"
 #include "gtkmain.h"
 #include "gtkmarshalers.h"
+#include "gtkbuildable.h"
 #include "gtkbutton.h"
 #include "gtkalignment.h"
 #include "gtklabel.h"
@@ -458,6 +459,13 @@ static void gtk_tree_view_tree_window_to
 						      gint         wy,
 						      gint        *tx,
 						      gint        *ty);
+/* GtkBuildable */
+static void gtk_tree_view_buildable_add (GtkBuildable *tree_view,
+					 GtkBuilder  *builder,
+					 GObject     *child,
+					 const gchar *type);
+static void gtk_tree_view_buildable_init (GtkBuildableIface *iface);
+
 
 static gint scroll_row_timeout                       (gpointer     data);
 static void remove_scroll_timeout                    (GtkTreeView *tree_view);
@@ -469,7 +477,9 @@ static guint tree_view_signals [LAST_SIG
 /* GType Methods
  */
 
-G_DEFINE_TYPE (GtkTreeView, gtk_tree_view, GTK_TYPE_CONTAINER)
+G_DEFINE_TYPE_WITH_CODE (GtkTreeView, gtk_tree_view, GTK_TYPE_CONTAINER,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_tree_view_buildable_init))
 
 static void
 gtk_tree_view_class_init (GtkTreeViewClass *class)
@@ -1266,6 +1276,12 @@ gtk_tree_view_class_init (GtkTreeViewCla
 }
 
 static void
+gtk_tree_view_buildable_init (GtkBuildableIface *iface)
+{
+  iface->add = gtk_tree_view_buildable_add;
+}
+
+static void
 gtk_tree_view_init (GtkTreeView *tree_view)
 {
   tree_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (tree_view, GTK_TYPE_TREE_VIEW, GtkTreeViewPrivate);
@@ -1471,6 +1487,15 @@ gtk_tree_view_finalize (GObject *object)
 }
 
 
+
+static void
+gtk_tree_view_buildable_add (GtkBuildable *tree_view,
+			     GtkBuilder  *builder,
+			     GObject     *child,
+			     const gchar *type)
+{
+  gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), GTK_TREE_VIEW_COLUMN (child));
+}
 
 /* GtkObject Methods
  */
Index: gtk/gtktreeviewcolumn.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeviewcolumn.c,v
retrieving revision 1.183
diff -u -p -r1.183 gtktreeviewcolumn.c
--- gtk/gtktreeviewcolumn.c	24 Sep 2006 17:03:45 -0000	1.183
+++ gtk/gtktreeviewcolumn.c	4 Dec 2006 07:12:19 -0000
@@ -112,6 +112,8 @@ static void gtk_tree_view_column_cell_la
 static void gtk_tree_view_column_cell_layout_reorder            (GtkCellLayout         *cell_layout,
                                                                  GtkCellRenderer       *cell,
                                                                  gint                   position);
+/* GtkBuildable implementation */
+static void gtk_tree_view_column_buildable_init                 (GtkBuildableIface     *iface);
 
 /* Button handling code */
 static void gtk_tree_view_column_create_button                 (GtkTreeViewColumn       *tree_column);
@@ -155,7 +157,10 @@ static guint tree_column_signals[LAST_SI
 
 G_DEFINE_TYPE_WITH_CODE (GtkTreeViewColumn, gtk_tree_view_column, GTK_TYPE_OBJECT,
 			 G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
-						gtk_tree_view_column_cell_layout_init))
+						gtk_tree_view_column_cell_layout_init)
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_tree_view_column_buildable_init))
+
 
 static void
 gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
@@ -320,6 +325,14 @@ gtk_tree_view_column_class_init (GtkTree
                                                       GTK_SORT_ASCENDING,
                                                       GTK_PARAM_READWRITE));
   
+}
+
+static void
+gtk_tree_view_column_buildable_init (GtkBuildableIface *iface)
+{
+  iface->add = _gtk_cell_layout_buildable_add;
+  iface->custom_tag_start = _gtk_cell_layout_buildable_custom_tag_start;
+  iface->custom_tag_end = _gtk_cell_layout_buildable_custom_tag_end;
 }
 
 static void
Index: gtk/gtktypeutils.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktypeutils.c,v
retrieving revision 1.79
diff -u -p -r1.79 gtktypeutils.c
--- gtk/gtktypeutils.c	1 Sep 2005 05:11:43 -0000	1.79
+++ gtk/gtktypeutils.c	4 Dec 2006 07:12:19 -0000
@@ -25,15 +25,19 @@
  */
 
 #undef GTK_DISABLE_DEPRECATED
+#define GTK_ENABLE_BROKEN
 
 #include <config.h>
 #include <string.h> /* strcmp */
-
+#include <stdlib.h> /* strtol, strtoul */
+#include <gdk/gdkcolor.h>
 #include "gtktypeutils.h"
+#include "gtkadjustment.h"
+#include "gtkwidget.h"
 #include "gtkobject.h"
 #include "gtkintl.h"
 #include "gtkalias.h"
-
+#include "gtk.h"
 
 /* --- functions --- */
 GtkType
@@ -199,6 +203,257 @@ gtk_type_flags_find_value (GtkType      
   return value;
 }
 
+gint
+_gtk_enum_from_string (GType type, const char *string)
+{
+  GEnumClass *eclass;
+  GEnumValue *ev;
+  gchar *endptr;
+  gint ret = 0;
+
+  ret = strtoul (string, &endptr, 0);
+  if (endptr != string) /* parsed a number */
+    return ret;
+
+  eclass = g_type_class_ref (type);
+  ev = g_enum_get_value_by_name (eclass, string);
+  if (!ev)
+    ev = g_enum_get_value_by_nick (eclass, string);
+
+  if (ev)
+    ret = ev->value;
+
+  g_type_class_unref (eclass);
+
+  return ret;
+}
+
+guint
+_gtk_flags_from_string (GType type, const char *string)
+{
+  GFlagsClass *fclass;
+  gchar *endptr, *prevptr;
+  guint i, j, ret;
+  char *flagstr;
+  GFlagsValue *fv;
+  const char  *flag;
+  gunichar ch;
+  gboolean eos;
+
+  ret = strtoul (string, &endptr, 0);
+  if (endptr != string) /* parsed a number */
+    return ret;
+
+  fclass = g_type_class_ref (type);
+
+  flagstr = g_strdup (string);
+  for (ret = i = j = 0; ; i++)
+    {
+
+      eos = flagstr[i] == '\0';
+
+      if (!eos && flagstr[i] != '|')
+        continue;
+
+      flag = &flagstr[j];
+      endptr = &flagstr[i];
+
+      if (!eos)
+        {
+          flagstr[i++] = '\0';
+          j = i;
+        }
+
+      /* trim spaces */
+      for (;;)
+        {
+          ch = g_utf8_get_char (flag);
+          if (!g_unichar_isspace (ch))
+            break;
+          flag = g_utf8_next_char (flag);
+        }
+
+      while (endptr > flag)
+        {
+          prevptr = g_utf8_prev_char (endptr);
+          ch = g_utf8_get_char (prevptr);
+          if (!g_unichar_isspace (ch))
+            break;
+          endptr = prevptr;
+        }
+
+      if (endptr > flag)
+        {
+          *endptr = '\0';
+          fv = g_flags_get_value_by_name (fclass, flag);
+
+          if (!fv)
+            fv = g_flags_get_value_by_nick (fclass, flag);
+
+          if (fv)
+            ret |= fv->value;
+          else
+            g_warning ("Unknown flag: '%s'", flag);
+        }
+
+      if (eos)
+        break;
+    }
+
+  g_free (flagstr);
+
+  g_type_class_unref (fclass);
+
+  return ret;
+}
+
+static GHashTable* type_table;
+
+/**
+ * gtk_registered_type_from_name
+ * @name: a type name
+ *
+ * Like g_type_from_name, but takes into account the types registered
+ * using the gtk_type_register function.
+ *
+ * Since: 2.12
+ */
+GType
+gtk_registered_type_from_name (const gchar *name)
+{
+  GType gtype;
+
+  gtype = g_type_from_name (name);
+
+  if (gtype == G_TYPE_INVALID)
+    {
+      GTypeGetFunc func = g_hash_table_lookup (type_table, name);
+      if (func)
+        gtype = func ();
+    }
+
+  return gtype;
+}
+
+void
+gtk_type_register (const gchar *name, GTypeGetFunc func)
+{
+  g_return_if_fail (g_hash_table_lookup (type_table, name) == NULL);
+
+  g_hash_table_insert (type_table, g_strdup (name), func);
+}
+
+void
+_gtk_type_table_init (void)
+{
+  type_table = g_hash_table_new (g_str_hash, g_str_equal);
+
+  g_hash_table_insert (type_table, "GdkPixbuf", gdk_pixbuf_get_type);
+  g_hash_table_insert (type_table, "GtkAboutDialog", gtk_about_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkAccelLabel", gtk_accel_label_get_type);
+  g_hash_table_insert (type_table, "GtkAction", gtk_action_get_type);
+  g_hash_table_insert (type_table, "GtkActionGroup", gtk_action_group_get_type);
+  g_hash_table_insert (type_table, "GtkAdjustment", gtk_adjustment_get_type);
+  g_hash_table_insert (type_table, "GtkAlignment", gtk_alignment_get_type);
+  g_hash_table_insert (type_table, "GtkArrow", gtk_arrow_get_type);
+  g_hash_table_insert (type_table, "GtkAspectFrame", gtk_aspect_frame_get_type);
+  g_hash_table_insert (type_table, "GtkAssistant", gtk_assistant_get_type);
+  g_hash_table_insert (type_table, "GtkButton", gtk_button_get_type);
+  g_hash_table_insert (type_table, "GtkCalendar", gtk_calendar_get_type);
+  g_hash_table_insert (type_table, "GtkCheckButton", gtk_check_button_get_type);
+  g_hash_table_insert (type_table, "GtkCellRenderer", gtk_cell_renderer_get_type);
+  g_hash_table_insert (type_table, "GtkCellRendererText", gtk_cell_renderer_text_get_type);
+  g_hash_table_insert (type_table, "GtkCellView", gtk_cell_view_get_type);
+  g_hash_table_insert (type_table, "GtkCheckMenuItem", gtk_check_menu_item_get_type);
+  g_hash_table_insert (type_table, "GtkColorButton", gtk_color_button_get_type);
+  g_hash_table_insert (type_table, "GtkColorSelection", gtk_color_selection_get_type);
+  g_hash_table_insert (type_table, "GtkColorSelectionDialog", gtk_color_selection_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkComboBox", gtk_combo_box_get_type);
+  g_hash_table_insert (type_table, "GtkComboBoxEntry", gtk_combo_box_entry_get_type);
+  g_hash_table_insert (type_table, "GtkCurve", gtk_curve_get_type);
+  g_hash_table_insert (type_table, "GtkDialog", gtk_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkDrawingArea", gtk_drawing_area_get_type);
+  g_hash_table_insert (type_table, "GtkEventBox", gtk_event_box_get_type);
+  g_hash_table_insert (type_table, "GtkEntry", gtk_entry_get_type);
+  g_hash_table_insert (type_table, "GtkEntryCompletion", gtk_entry_completion_get_type);
+  g_hash_table_insert (type_table, "GtkFileChooser", gtk_file_chooser_get_type);
+  g_hash_table_insert (type_table, "GtkFileChooserDialog", gtk_file_chooser_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkFileChooserButton", gtk_file_chooser_button_get_type);
+  g_hash_table_insert (type_table, "GtkFileSelection", gtk_file_selection_get_type);
+  g_hash_table_insert (type_table, "GtkFixed", gtk_fixed_get_type);
+  g_hash_table_insert (type_table, "GtkFontSelection", gtk_font_selection_get_type);
+  g_hash_table_insert (type_table, "GtkFontSelectionDialog", gtk_font_selection_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkFrame", gtk_frame_get_type);
+  g_hash_table_insert (type_table, "GtkExpander", gtk_expander_get_type);
+  g_hash_table_insert (type_table, "GtkFontButton", gtk_font_button_get_type);
+  g_hash_table_insert (type_table, "GtkGammaCurve", gtk_gamma_curve_get_type);
+  g_hash_table_insert (type_table, "GtkHandleBox", gtk_handle_box_get_type);
+  g_hash_table_insert (type_table, "GtkHButtonBox", gtk_hbutton_box_get_type);
+  g_hash_table_insert (type_table, "GtkHBox", gtk_hbox_get_type);
+  g_hash_table_insert (type_table, "GtkHPaned", gtk_hpaned_get_type);
+  g_hash_table_insert (type_table, "GtkHRuler", gtk_hruler_get_type);
+  g_hash_table_insert (type_table, "GtkHScale", gtk_hscale_get_type);
+  g_hash_table_insert (type_table, "GtkHScrollbar", gtk_hscrollbar_get_type);
+  g_hash_table_insert (type_table, "GtkHSeparator", gtk_hseparator_get_type);
+  g_hash_table_insert (type_table, "GtkIconView", gtk_icon_view_get_type);
+  g_hash_table_insert (type_table, "GtkImage", gtk_image_get_type);
+  g_hash_table_insert (type_table, "GtkImageMenuItem", gtk_image_menu_item_get_type);
+  g_hash_table_insert (type_table, "GtkInputDialog ", gtk_input_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkLabel", gtk_label_get_type);
+  g_hash_table_insert (type_table, "GtkLayout", gtk_layout_get_type);
+  g_hash_table_insert (type_table, "GtkLinkButton", gtk_link_button_get_type);
+  g_hash_table_insert (type_table, "GtkList", gtk_list_get_type);
+  g_hash_table_insert (type_table, "GtkListItem", gtk_list_item_get_type);
+  g_hash_table_insert (type_table, "GtkListStore", gtk_list_store_get_type);
+  g_hash_table_insert (type_table, "GtkMenuBar", gtk_menu_bar_get_type);
+  g_hash_table_insert (type_table, "GtkMenu", gtk_menu_get_type);
+  g_hash_table_insert (type_table, "GtkMenuItem", gtk_menu_item_get_type);
+  g_hash_table_insert (type_table, "GtkMenuToolButton", gtk_menu_tool_button_get_type);
+  g_hash_table_insert (type_table, "GtkMessageDialog", gtk_message_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkNotebook", gtk_notebook_get_type);
+  g_hash_table_insert (type_table, "GtkOptionMenu", gtk_option_menu_get_type);
+  g_hash_table_insert (type_table, "GtkPixmap", gtk_pixmap_get_type);
+  g_hash_table_insert (type_table, "GtkProgressBar", gtk_progress_bar_get_type);
+  g_hash_table_insert (type_table, "GtkProgress", gtk_progress_get_type);
+  g_hash_table_insert (type_table, "GtkRadioAction", gtk_radio_action_get_type);
+  g_hash_table_insert (type_table, "GtkRadioButton", gtk_radio_button_get_type);
+  g_hash_table_insert (type_table, "GtkRadioMenuItem", gtk_radio_menu_item_get_type);
+  g_hash_table_insert (type_table, "GtkRadioToolButton", gtk_radio_tool_button_get_type);
+  g_hash_table_insert (type_table, "GtkRecentChooserDialog", gtk_recent_chooser_dialog_get_type);
+  g_hash_table_insert (type_table, "GtkSeparatorMenuItem", gtk_separator_menu_item_get_type);
+  g_hash_table_insert (type_table, "GtkSeparatorToolItem", gtk_separator_tool_item_get_type);
+  g_hash_table_insert (type_table, "GtkSizeGroup", gtk_size_group_get_type);
+  g_hash_table_insert (type_table, "GtkScrolledWindow", gtk_scrolled_window_get_type);
+  g_hash_table_insert (type_table, "GtkSpinButton", gtk_spin_button_get_type);
+  g_hash_table_insert (type_table, "GtkStatusbar", gtk_statusbar_get_type);
+  g_hash_table_insert (type_table, "GtkText", gtk_text_get_type);
+  g_hash_table_insert (type_table, "GtkTextBuffer", gtk_text_buffer_get_type);
+  g_hash_table_insert (type_table, "GtkTextView", gtk_text_view_get_type);
+  g_hash_table_insert (type_table, "GtkToggleAction", gtk_toggle_action_get_type);
+  g_hash_table_insert (type_table, "GtkToggleButton", gtk_toggle_button_get_type);
+  g_hash_table_insert (type_table, "GtkToggleToolButton", gtk_toggle_tool_button_get_type);
+  g_hash_table_insert (type_table, "GtkToolbar", gtk_toolbar_get_type);
+  g_hash_table_insert (type_table, "GtkToolButton", gtk_tool_button_get_type);
+  g_hash_table_insert (type_table, "GtkToolItem", gtk_tool_item_get_type);
+  g_hash_table_insert (type_table, "GtkTooltips", gtk_tooltips_get_type);
+  g_hash_table_insert (type_table, "GtkTree", gtk_tree_get_type);
+  g_hash_table_insert (type_table, "GtkTreeModelFilter", gtk_tree_model_filter_get_type);
+  g_hash_table_insert (type_table, "GtkTreeModelSort", gtk_tree_model_sort_get_type);
+  g_hash_table_insert (type_table, "GtkTreeStore", gtk_tree_store_get_type);
+  g_hash_table_insert (type_table, "GtkTreeView", gtk_tree_view_get_type);
+  g_hash_table_insert (type_table, "GtkTreeViewColumn", gtk_tree_view_column_get_type);
+  g_hash_table_insert (type_table, "GtkTable", gtk_table_get_type);
+  g_hash_table_insert (type_table, "GtkUIManager", gtk_ui_manager_get_type);
+  g_hash_table_insert (type_table, "GtkVBox", gtk_vbox_get_type);
+  g_hash_table_insert (type_table, "GtkVButtonBox", gtk_vbutton_box_get_type);
+  g_hash_table_insert (type_table, "GtkVScrollbar", gtk_vscrollbar_get_type);
+  g_hash_table_insert (type_table, "GtkVSeparator", gtk_vseparator_get_type);
+  g_hash_table_insert (type_table, "GtkViewport", gtk_viewport_get_type);
+  g_hash_table_insert (type_table, "GtkVRuler", gtk_vruler_get_type);
+  g_hash_table_insert (type_table, "GtkVPaned", gtk_vpaned_get_type);
+  g_hash_table_insert (type_table, "GtkVScale", gtk_vscale_get_type);
+  g_hash_table_insert (type_table, "GtkWindow", gtk_window_get_type);
+}
 
 #define __GTK_TYPE_UTILS_C__
 #include "gtkaliasdef.c"
Index: gtk/gtktypeutils.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktypeutils.h,v
retrieving revision 1.68
diff -u -p -r1.68 gtktypeutils.h
--- gtk/gtktypeutils.h	28 Nov 2004 07:02:27 -0000	1.68
+++ gtk/gtktypeutils.h	4 Dec 2006 07:12:29 -0000
@@ -229,7 +229,18 @@ struct _GtkTypeInfo
 
 #endif /* GTK_DISABLE_DEPRECATED */
 
+typedef GType (*GTypeGetFunc) (void);
+
 gpointer	gtk_type_class	(GtkType	 type);
+
+void            _gtk_type_table_init     (void);
+guint           _gtk_flags_from_string   (GType         type,
+					  const char   *string);
+gint            _gtk_enum_from_string    (GType         type,
+					  const char   *string);
+void            gtk_type_register        (const gchar  *name,
+                                          GTypeGetFunc  func);
+GType           gtk_registered_type_from_name (const gchar  *name);
 
 #ifndef GTK_DISABLE_DEPRECATED
 
Index: gtk/gtkuimanager.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkuimanager.c,v
retrieving revision 1.103
diff -u -p -r1.103 gtkuimanager.c
--- gtk/gtkuimanager.c	25 Sep 2006 13:36:00 -0000	1.103
+++ gtk/gtkuimanager.c	4 Dec 2006 07:12:36 -0000
@@ -31,6 +31,7 @@
 #include <config.h>
 
 #include <string.h>
+#include "gtkbuildable.h"
 #include "gtkintl.h"
 #include "gtkmarshalers.h"
 #include "gtkmenu.h"
@@ -142,6 +143,28 @@ static void        node_prepend_ui_refer
 static void        node_remove_ui_reference       (GNode             *node,
                                                    guint              merge_id);
 
+/* GtkBuildable */
+static void gtk_ui_manager_buildable_init (GtkBuildableIface *iface);
+static void gtk_ui_manager_buildable_add (GtkBuildable  *buildable,
+					  GtkBuilder    *builder,
+					  GObject       *child,
+					  const gchar   *type);
+static GObject* gtk_ui_manager_buildable_construct_child (GtkBuildable *buildable,
+							  GtkBuilder   *builder,
+							  const gchar  *name);
+static gboolean gtk_ui_manager_buildable_custom_tag_start (GtkBuildable *buildable,
+							   GtkBuilder   *builder,
+							   GObject      *child,
+							   const gchar  *tagname,
+							   GMarkupParser *parser,
+							   gpointer     *data);
+static void     gtk_ui_manager_buildable_custom_tag_end (GtkBuildable *buildable,
+							 GtkBuilder   *builder,
+							 GObject      *child,
+							 const gchar  *tagname,
+							 gpointer      data);
+
+
 
 enum 
 {
@@ -163,7 +186,9 @@ enum
 
 static guint ui_manager_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (GtkUIManager, gtk_ui_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (GtkUIManager, gtk_ui_manager, GTK_TYPE_OBJECT,
+			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_ui_manager_buildable_init))
 
 static void
 gtk_ui_manager_class_init (GtkUIManagerClass *klass)
@@ -401,6 +426,52 @@ gtk_ui_manager_finalize (GObject *object
 }
 
 static void
+gtk_ui_manager_buildable_init (GtkBuildableIface *iface)
+{
+  iface->add = gtk_ui_manager_buildable_add;
+  iface->construct_child = gtk_ui_manager_buildable_construct_child;
+  iface->custom_tag_start = gtk_ui_manager_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_ui_manager_buildable_custom_tag_end;
+}
+
+static void
+gtk_ui_manager_buildable_add (GtkBuildable  *buildable,
+			      GtkBuilder    *builder,
+			      GObject       *child,
+			      const gchar   *type)
+{
+  GtkUIManager *self = GTK_UI_MANAGER (buildable);
+  guint pos;
+
+  g_return_if_fail (GTK_IS_ACTION_GROUP (child));
+
+  pos = g_list_length (self->private_data->action_groups);
+
+  g_object_ref (child);
+  gtk_ui_manager_insert_action_group (self,
+				      GTK_ACTION_GROUP (child),
+				      pos);
+}
+
+static GObject *
+gtk_ui_manager_buildable_construct_child (GtkBuildable *buildable,
+					  GtkBuilder   *builder,
+					  const gchar  *id)
+{
+  GtkWidget *widget;
+  char *name;
+
+  name = g_strdup_printf ("ui/%s", id);
+  widget = gtk_ui_manager_get_widget (GTK_UI_MANAGER (buildable), name);
+  if (!widget)
+    g_error ("Unknown ui manager child: %s\n", name);
+
+  g_free (name);
+
+  return G_OBJECT (widget);
+}
+
+static void
 gtk_ui_manager_set_property (GObject         *object,
 			     guint            prop_id,
 			     const GValue    *value,
@@ -1479,7 +1550,7 @@ add_ui_from_string (GtkUIManager *self,
 
   queue_update (self);
 
-  g_object_notify (G_OBJECT (self), "ui");      
+  g_object_notify (G_OBJECT (self), "ui");
 
   return ctx.merge_id;
 
@@ -2772,6 +2843,49 @@ print_node (GtkUIManager *self,
 
   if (close_fmt)
     g_string_append_printf (buffer, close_fmt, indent_level, "");
+}
+
+static gboolean
+gtk_ui_manager_buildable_custom_tag_start (GtkBuildable  *buildable,
+					   GtkBuilder    *builder,
+					   GObject       *child,
+					   const gchar   *tagname,
+					   GMarkupParser *parser,
+					   gpointer      *data)
+{
+  if (child)
+    return FALSE;
+
+  if (!strcmp (tagname, "ui"))
+    {
+      ParseContext *ctx;
+
+      ctx = g_new0 (ParseContext, 1);
+      ctx->state = STATE_START;
+      ctx->self = GTK_UI_MANAGER (buildable);
+      ctx->current = NULL;
+      ctx->merge_id = gtk_ui_manager_new_merge_id (GTK_UI_MANAGER (buildable));
+
+      *data = ctx;
+      *parser = ui_parser;
+
+      return TRUE;
+    }
+
+  return FALSE;
+
+}
+
+static void
+gtk_ui_manager_buildable_custom_tag_end (GtkBuildable *buildable,
+					 GtkBuilder   *builder,
+					 GObject      *child,
+					 const gchar  *tagname,
+					 gpointer      data)
+{
+  queue_update (GTK_UI_MANAGER (buildable));
+  g_object_notify (G_OBJECT (buildable), "ui");
+  g_free (data);
 }
 
 /**
Index: gtk/gtkwidget.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwidget.c,v
retrieving revision 1.447
diff -u -p -r1.447 gtkwidget.c
--- gtk/gtkwidget.c	16 Nov 2006 12:56:30 -0000	1.447
+++ gtk/gtkwidget.c	4 Dec 2006 07:12:51 -0000
@@ -51,6 +51,7 @@
 #include "gtkaccessible.h"
 #include "gtktooltips.h"
 #include "gtkinvisible.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 #define WIDGET_CLASS(w)	 GTK_WIDGET_GET_CLASS (w)
@@ -227,9 +228,28 @@ static void             gtk_widget_inval
 								 GdkRegion        *region);
 static GdkScreen *      gtk_widget_get_screen_unchecked         (GtkWidget        *widget);
 static void		gtk_widget_queue_shallow_draw		(GtkWidget        *widget);
-static gboolean         gtk_widget_real_can_activate_accel      (GtkWidget *widget,
-                                                                 guint      signal_id);
-     
+static gboolean         gtk_widget_real_can_activate_accel      (GtkWidget        *widget,
+                                                                 guint             signal_id);
+static void             gtk_widget_buildable_interface_init     (GtkBuildableIface *iface);
+static void             gtk_widget_buildable_set_name           (GtkBuildable     *buildable,
+								 GtkBuilder       *builder,
+								 const gchar      *name);
+static void             gtk_widget_buildable_set_property       (GtkBuildable     *buildable,
+								 GtkBuilder       *builder,
+								 const gchar      *name,
+								 const GValue     *value);
+static gboolean         gtk_widget_buildable_custom_tag_start   (GtkBuildable     *buildable,
+								 GtkBuilder       *builder,
+								 GObject          *child,
+								 const gchar      *tagname,
+								 GMarkupParser    *parser,
+								 gpointer         *data);
+static void             gtk_widget_buildable_custom_tag_end     (GtkBuildable     *buildable,
+								 GtkBuilder       *builder,
+								 GObject          *child,
+								 const gchar      *tagname,
+								 gpointer          data);
+
 static void gtk_widget_set_usize_internal (GtkWidget *widget,
 					   gint       width,
 					   gint       height);
@@ -292,11 +312,20 @@ gtk_widget_get_type (void)
 	NULL /* interface data */
       };
 
+      const GInterfaceInfo buildable_info =
+      {
+	(GInterfaceInitFunc) gtk_widget_buildable_interface_init,
+	(GInterfaceFinalizeFunc) NULL,
+	NULL /* interface data */
+      };
+
       widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget",
                                            &widget_info, G_TYPE_FLAG_ABSTRACT);
 
       g_type_add_interface_static (widget_type, ATK_TYPE_IMPLEMENTOR,
                                    &accessibility_info) ;
+      g_type_add_interface_static (widget_type, GTK_TYPE_BUILDABLE,
+                                   &buildable_info) ;
 
     }
 
@@ -8020,6 +8049,47 @@ gtk_widget_ref_accessible (AtkImplemento
   return accessible;
 }
 
+static void
+gtk_widget_buildable_interface_init (GtkBuildableIface *iface)
+{
+  iface->set_name = gtk_widget_buildable_set_name;
+  iface->set_property = gtk_widget_buildable_set_property;
+  iface->custom_tag_start = gtk_widget_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_widget_buildable_custom_tag_end;
+}
+
+static void
+gtk_widget_buildable_set_name (GtkBuildable *buildable,
+			       GtkBuilder   *builder,
+			       const gchar  *name)
+{
+  gtk_widget_set_name (GTK_WIDGET (buildable), name);
+}
+
+
+static void
+gtk_widget_buildable_set_property (GtkBuildable        *buildable,
+				   GtkBuilder          *builder,
+				   const gchar         *name,
+				   const GValue        *value)
+{
+  if (!strcmp (name, "has-default") && g_value_get_boolean (value))
+    g_signal_connect_swapped (builder, "finish",
+			      G_CALLBACK (gtk_widget_grab_default),
+			      buildable);
+  else if (!strcmp (name, "has-focus") && g_value_get_boolean (value))
+    g_signal_connect_swapped (builder, "finish",
+			      G_CALLBACK (gtk_widget_grab_focus), buildable);
+  else if (!strcmp (name, "tooltip"))
+    {
+      gtk_tooltips_set_tip(gtk_builder_get_tooltips (builder),
+			   GTK_WIDGET (buildable), 
+			   g_value_get_string (value), NULL);
+    }
+  else
+    g_object_set_property (G_OBJECT (buildable), name, value);
+}
+
 /**
  * gtk_widget_get_clipboard:
  * @widget: a #GtkWidget
@@ -8195,6 +8265,120 @@ gtk_widget_set_no_show_all (GtkWidget *w
     GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_SHOW_ALL);
   
   g_object_notify (G_OBJECT (widget), "no-show-all");
+}
+
+typedef struct {
+  GObject *object;
+  guint    key;
+  guint    modifiers;
+  gchar   *signal;
+} AccelGroupParserData;
+
+static void
+accel_group_start_element (GMarkupParseContext *context,
+			   const gchar         *element_name,
+			   const gchar        **names,
+			   const gchar        **values,
+			   gpointer             user_data,
+			   GError             **error)
+{
+  gint i;
+  guint key = 0;
+  guint modifiers = 0;
+  gchar *signal = NULL;
+  AccelGroupParserData *parser_data = (AccelGroupParserData*)user_data;
+
+  for (i = 0; names[i]; i++)
+    {
+      if (!strcmp (names[i], "key"))
+	key = gdk_keyval_from_name (values[i]);
+      else if (!strcmp (names[i], "modifiers"))
+	modifiers = _gtk_flags_from_string (GDK_TYPE_MODIFIER_TYPE, values[i]);
+      else if (!strcmp (names[i], "signal"))
+	signal = g_strdup (values[i]);
+    }
+
+  if (key == 0 || signal == NULL)
+    {
+      g_warning ("<accelerator> requires a key or signal attribute");
+      return;
+    }
+  parser_data->key = key;
+  parser_data->modifiers = modifiers;
+  parser_data->signal = signal;
+}
+
+
+static const GMarkupParser accel_group_parser =
+  {
+    accel_group_start_element,
+  };
+
+static gboolean
+gtk_widget_buildable_custom_tag_start (GtkBuildable     *buildable,
+				       GtkBuilder       *builder,
+				       GObject          *child,
+				       const gchar      *tagname,
+				       GMarkupParser    *parser,
+				       gpointer         *data)
+{
+  AccelGroupParserData *parser_data;
+
+  g_assert (buildable);
+
+  if (!strcmp (tagname, "accelerator"))
+    {
+      parser_data = g_new0 (AccelGroupParserData, 1);
+      parser_data->object = G_OBJECT (buildable);
+      *data = parser_data;
+      *parser = accel_group_parser;
+      return TRUE;
+    }
+  return FALSE;
+}
+
+static void
+builder_finish_cb (GtkBuilder *builder,
+		   gpointer user_data)
+{
+  AccelGroupParserData *data = (AccelGroupParserData*)user_data;
+  GtkWidget *toplevel;
+  GSList *accel_groups;
+  GtkAccelGroup *accel_group;
+
+  g_assert (data);
+  g_assert (data->object);
+
+  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (data->object));
+  accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+  if (g_slist_length (accel_groups) == 0)
+    {
+      accel_group = gtk_accel_group_new ();
+      gtk_window_add_accel_group (GTK_WINDOW (toplevel), accel_group);
+    }
+  else
+    {
+      g_assert (g_slist_length (accel_groups) == 1);
+      accel_group = g_slist_nth_data (accel_groups, 0);
+    }
+  gtk_widget_add_accelerator (GTK_WIDGET(data->object),
+			      data->signal,
+			      accel_group,
+			      data->key,
+			      data->modifiers,
+			      GTK_ACCEL_VISIBLE);
+  g_free (data->signal);
+  g_slice_free (AccelGroupParserData, data);
+}
+
+static void
+gtk_widget_buildable_custom_tag_end (GtkBuildable     *buildable,
+				     GtkBuilder       *builder,
+				     GObject          *child,
+				     const gchar      *tagname,
+				     gpointer          data)
+{
+  g_signal_connect (builder, "finish", (GCallback)builder_finish_cb, data);
 }
 
 #define __GTK_WIDGET_C__
Index: gtk/gtkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.c,v
retrieving revision 1.326
diff -u -p -r1.326 gtkwindow.c
--- gtk/gtkwindow.c	3 Oct 2006 15:54:52 -0000	1.326
+++ gtk/gtkwindow.c	4 Dec 2006 07:13:11 -0000
@@ -44,6 +44,7 @@
 #include "gtkicontheme.h"
 #include "gtkmarshalers.h"
 #include "gtkplug.h"
+#include "gtkbuildable.h"
 #include "gtkalias.h"
 
 #ifdef GDK_WINDOWING_X11
@@ -298,6 +299,8 @@ static GQuark       quark_gtk_window_key
 static GQuark       quark_gtk_window_default_icon_pixmap = 0;
 static GQuark       quark_gtk_window_icon_info = 0;
 
+static GtkBuildableIface *parent_buildable_iface;
+
 static void gtk_window_set_property (GObject         *object,
 				     guint            prop_id,
 				     const GValue    *value,
@@ -307,8 +310,17 @@ static void gtk_window_get_property (GOb
 				     GValue          *value,
 				     GParamSpec      *pspec);
 
+/* GtkBuildable */
+static void gtk_window_buildable_interface_init (GtkBuildableIface *iface);
+static void gtk_window_buildable_set_property   (GtkBuildable        *buildable,
+						 GtkBuilder          *builder,
+						 const gchar         *name,
+						 const GValue        *value);
+
 
-G_DEFINE_TYPE (GtkWindow, gtk_window, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN,
+                         G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+						gtk_window_buildable_interface_init))
 
 static void
 add_tab_bindings (GtkBindingSet    *binding_set,
@@ -1040,6 +1052,43 @@ gtk_window_get_property (GObject      *o
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
     }
+}
+
+static void
+gtk_window_buildable_interface_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+  iface->set_property = gtk_window_buildable_set_property;
+
+}
+
+static void
+gtk_window_buildable_set_property (GtkBuildable        *buildable,
+				   GtkBuilder          *builder,
+				   const gchar         *name,
+				   const GValue        *value)
+{
+  GtkWindow *window = GTK_WINDOW(buildable);
+    
+  if (!strcmp (name, "visible") && g_value_get_boolean (value))
+    g_signal_connect_swapped (builder, "finish",
+			      G_CALLBACK (gtk_widget_show), buildable);
+  else if (!strcmp (name, "wmclass-name"))
+    {
+      gchar *wmclass = g_strdup(window->wmclass_class);
+      
+      gtk_window_set_wmclass(window, g_value_get_string (value), wmclass);
+      g_free(wmclass);
+    }
+  else if (!strcmp (name, "wmclass-class"))
+    {
+      gchar *wmname = g_strdup(window->wmclass_name);
+
+      gtk_window_set_wmclass(window, wmname, g_value_get_string (value));
+      g_free(wmname);
+    }
+  else
+    parent_buildable_iface->set_property (buildable, builder, name, value);
 }
 
 /**
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/tests/Makefile.am,v
retrieving revision 1.65
diff -u -p -r1.65 Makefile.am
--- tests/Makefile.am	28 Aug 2006 16:14:39 -0000	1.65
+++ tests/Makefile.am	4 Dec 2006 07:13:12 -0000
@@ -24,11 +24,14 @@ if USE_X11
 testsocket_programs = testsocket testsocket_child
 endif
 
-TESTS = floatingtest
+TESTS = floatingtest buildertest
+
 
 noinst_PROGRAMS =			\
 	autotestfilechooser		\
 	floatingtest			\
+	builderdemo			\
+	buildertest			\
 	simple				\
 	print-editor			\
 	testaccel			\
@@ -87,6 +90,8 @@ noinst_PROGRAMS =			\
 autotestfilechooser_DEPENDENCIES = $(TEST_DEPS)
 simple_DEPENDENCIES = $(TEST_DEPS)
 floatingtest_DEPENDENCIES = $(TEST_DEPS)
+builderdemo_DEPENDENCIES = $(TEST_DEPS)
+buildertest_DEPENDENCIES = $(TEST_DEPS)
 print_editor_DEPENDENCIES = $(TEST_DEPS)
 testicontheme_DEPENDENCIES = $(TEST_DEPS)
 testiconview_DEPENDENCIES = $(TEST_DEPS)
@@ -138,6 +143,8 @@ testgrouping_DEPENDENCIES = $(TEST_DEPS)
 autotestfilechooser_LDADD = $(LDADDS)
 simple_LDADD = $(LDADDS)
 floatingtest_LDADD = $(LDADDS)
+buildertest_LDADD = $(LDADDS)
+builderdemo_LDADD = $(LDADDS)
 print_editor_LDADD = $(LDADDS)
 testaccel_LDADD = $(LDADDS)
 testassistant_LDADD = $(LDADDS)
@@ -192,6 +199,10 @@ pixbuf_threads_LDADD = $(LDADDS) $(GLIB_
 testmerge_LDADD = $(LDADDS)
 testactions_LDADD = $(LDADDS)
 testgrouping_LDADD = $(LDADDS)
+
+# XXX: Hack
+buildertest_LDFLAGS = -Wl,--export-dynamic
+builderdemo_LDFLAGS = -Wl,--export-dynamic
 
 autotestfilechooser_SOURCES =	\
 	autotestfilechooser.c
