Index: gobject/gobject.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/gobject.c,v
retrieving revision 1.65.2.1
diff -u -p -d -r1.65.2.1 gobject.c
--- gobject/gobject.c	14 Mar 2005 06:39:23 -0000	1.65.2.1
+++ gobject/gobject.c	8 May 2005 17:08:45 -0000
@@ -2015,5 +2015,24 @@ g_cclosure_new_object_swap (GCallback ca
   return closure;
 }
 
+/**
+ * g_object_traverse: - query a #GObject for references to other contained #GObject's
+ * @object: a #GObject we wish to query
+ * @visit: a "visitor" function to callback with results
+ * @data: extra data to pass back to the visitor function
+ * 
+ * Call back the function @visit with @data for each GObject reference
+ * owned by @object.
+ **/
+void
+g_object_traverse (GObject          *object,
+                   GObjectVisitFunc  visit,
+                   gpointer          data)
+{
+    GObjectClass *klass = G_OBJECT_GET_CLASS (object);
+    if (klass->traverse)
+        klass->traverse (object, visit, data);
+}
+
 #define __G_OBJECT_C__
 #include "gobjectaliasdef.c"
Index: gobject/gobject.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gobject.h,v
retrieving revision 1.29
diff -u -p -d -r1.29 gobject.h
--- gobject/gobject.h	21 Oct 2003 19:12:27 -0000	1.29
+++ gobject/gobject.h	8 May 2005 17:08:45 -0000
@@ -60,6 +60,9 @@ typedef void (*GObjectSetPropertyFunc)  
 typedef void (*GObjectFinalizeFunc)     (GObject      *object);
 typedef void (*GWeakNotify)		(gpointer      data,
 					 GObject      *where_the_object_was);
+typedef void (*GObjectVisitFunc)        (GObject      *object,
+                                         gpointer      data);
+
 struct  _GObject
 {
   GTypeInstance g_type_instance;
@@ -99,9 +102,15 @@ struct  _GObjectClass
   /* signals */
   void	     (*notify)			(GObject	*object,
 					 GParamSpec	*pspec);
+
+  /* for language binding garbage collection support */
+  void       (*traverse)                (GObject          *object,
+                                         GObjectVisitFunc  visit,
+                                         gpointer          data);
+
   /*< private >*/
   /* padding */
-  gpointer	pdummy[8];
+  gpointer	pdummy[7];
 };
 struct _GObjectConstructParam
 {
@@ -217,7 +226,9 @@ gulong	    g_signal_connect_object      
 					       GCallback       c_handler,
 					       gpointer	       gobject,
 					       GConnectFlags   connect_flags);
-
+void       g_object_traverse                  (GObject        *object,
+                                               GObjectVisitFunc visit,
+                                               gpointer        data);
 
 /*< protected >*/
 void        g_object_run_dispose	      (GObject	      *object);
