Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.2122
diff -u -p -r1.2122 ChangeLog
--- ChangeLog	2001/07/14 11:35:22	1.2122
+++ ChangeLog	2001/07/15 07:26:45
@@ -1,3 +1,41 @@
+2001-07-15  James Henstridge  <james@daa.com.au>
+
+	* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
+	(gtk_window_remove_accel_group): same here.
+	(gtk_window_key_press_event): same here.
+
+	* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
+	(gtk_widget_remove_accelerator): same here.
+	(gtk_widget_remove_accelerators): same here.
+
+	* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.
+
+	* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
+	instead of GtkObject.
+
+	* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
+	now takes GObjects.
+
+	* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
+	pass a GObject to gtk_accel_group_entries_from_object.
+	(gtk_item_factory_create_item): s/accel_widget/accel_object/
+
+	* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.
+
+	* gtk/gtkaccellabel.c: convert to handle GObject accel objects.
+
+	* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
+	GObjects can have accelerators set now.  Add compatibility
+	defines.
+
+	* gtk/gtkmarshal.list: add missing marshallers.
+
+	* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
+	accelerators on plain GObjects.  gtk_accel_group_object_destroy
+	has been converted into a weak reference, and
+	gtk_accel_group_delete_entries is now a destroy notify for that
+	piece of data.
+
 Sat Jul 14 12:47:35 2001  Tim Janik  <timj@gtk.org>
 
 	* gtk/gtkrange.c:
Index: gtk/gtkaccelgroup.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccelgroup.h,v
retrieving revision 1.9
diff -u -p -r1.9 gtkaccelgroup.h
--- gtk/gtkaccelgroup.h	2000/08/30 00:33:36	1.9
+++ gtk/gtkaccelgroup.h	2001/07/15 07:26:45
@@ -36,14 +36,21 @@
 #include <gtk/gtkenums.h>
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 
-typedef struct _GtkAccelGroup	GtkAccelGroup;
-typedef struct _GtkAccelEntry	GtkAccelEntry;
+#define GTK_TYPE_ACCEL_GROUP              (gtk_accel_group_get_type ())
+#define GTK_ACCEL_GROUP(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ACCEL_GROUP, GtkAccelGroup))
+#define GTK_ACCEL_GROUP_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_GROUP, GtkAccelGroupClass))
+#define GTK_IS_ACCEL_GROUP(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_ACCEL_GROUP))
+#define GTK_IS_ACCEL_GROUP_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCEL_GROUP))
+#define GTK_ACCEL_GROUP_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCEL_GROUP, GtkAccelGroupClass))
 
+
+typedef struct _GtkAccelGroup	   GtkAccelGroup;
+typedef struct _GtkAccelGroupClass GtkAccelGroupClass;
+typedef struct _GtkAccelEntry	   GtkAccelEntry;
+
 typedef enum
 {
   /* should the accelerator appear in
@@ -63,12 +70,17 @@ typedef enum
 
 struct _GtkAccelGroup
 {
-  guint	          ref_count;
+  GObject         parent;
   guint	          lock_count;
   GdkModifierType modifier_mask;
   GSList         *attach_objects;
 };
 
+struct _GtkAccelGroupClass
+{
+  GObjectClass parent_class;
+};
+
 struct _GtkAccelEntry
 {
   /* key portion
@@ -78,7 +90,7 @@ struct _GtkAccelEntry
   GdkModifierType	 accelerator_mods;
   
   GtkAccelFlags		 accel_flags;
-  GtkObject		*object;
+  GObject		*object;
   guint			 signal_id;
 };
 
@@ -98,13 +110,14 @@ guint	 gtk_accelerator_get_default_mod_m
 
 /* Accelerator Groups
  */
+GType           gtk_accel_group_get_type        (void);
 GtkAccelGroup*  gtk_accel_group_new	      	(void);
 GtkAccelGroup*  gtk_accel_group_get_default    	(void);
 GtkAccelGroup*  gtk_accel_group_ref	     	(GtkAccelGroup	*accel_group);
 void	        gtk_accel_group_unref	      	(GtkAccelGroup	*accel_group);
 void		gtk_accel_group_lock		(GtkAccelGroup	*accel_group);
 void		gtk_accel_group_unlock		(GtkAccelGroup	*accel_group);
-gboolean        gtk_accel_groups_activate      	(GtkObject	*object,
+gboolean        gtk_accel_groups_activate      	(GObject	*object,
 						 guint		 accel_key,
 						 GdkModifierType accel_mods);
 
@@ -114,9 +127,9 @@ gboolean        gtk_accel_group_activate
 						 guint		 accel_key,
 						 GdkModifierType accel_mods);
 void		gtk_accel_group_attach		(GtkAccelGroup	*accel_group,
-						 GtkObject	*object);
+						 GObject	*object);
 void		gtk_accel_group_detach		(GtkAccelGroup	*accel_group,
-						 GtkObject	*object);
+						 GObject	*object);
 
 /* Accelerator Group Entries (internal)
  */
@@ -133,42 +146,39 @@ void		gtk_accel_group_add		(GtkAccelGrou
 						 guint		 accel_key,
 						 GdkModifierType accel_mods,
 						 GtkAccelFlags	 accel_flags,
-						 GtkObject	*object,
+						 GObject	*object,
 						 const gchar	*accel_signal);
 void		gtk_accel_group_remove		(GtkAccelGroup	*accel_group,
 						 guint		 accel_key,
 						 GdkModifierType accel_mods,
-						 GtkObject	*object);
+						 GObject	*object);
 
 /* Accelerator Signals (internal)
  */
-void		gtk_accel_group_handle_add	(GtkObject	*object,
+void		gtk_accel_group_handle_add	(GObject	*object,
 						 guint		 accel_signal_id,
 						 GtkAccelGroup	*accel_group,
 						 guint		 accel_key,
 						 GdkModifierType accel_mods,
 						 GtkAccelFlags   accel_flags);
-void		gtk_accel_group_handle_remove	(GtkObject	*object,
+void		gtk_accel_group_handle_remove	(GObject	*object,
 						 GtkAccelGroup	*accel_group,
 						 guint		 accel_key,
 						 GdkModifierType accel_mods);
-guint		gtk_accel_group_create_add	(GtkType	 class_type,
-						 GtkSignalRunType signal_flags,
+guint		gtk_accel_group_create_add	(GType		 class_type,
+						 GSignalFlags    signal_flags,
 						 guint		 handler_offset);
-guint		gtk_accel_group_create_remove	(GtkType	 class_type,
-						 GtkSignalRunType signal_flags,
+guint		gtk_accel_group_create_remove	(GType		 class_type,
+						 GSignalFlags    signal_flags,
 						 guint		 handler_offset);
 
 /* Miscellaneous (internal)
  */
-GSList*	gtk_accel_groups_from_object		(GtkObject	*object);
-GSList*	gtk_accel_group_entries_from_object	(GtkObject	*object);
-
+GSList*	gtk_accel_groups_from_object		(GObject	*object);
+GSList*	gtk_accel_group_entries_from_object	(GObject	*object);
 
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 
 #endif /* __GTK_ACCEL_GROUP_H__ */
Index: gtk/gtkaccelgroup.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccelgroup.c,v
retrieving revision 1.24
diff -u -p -r1.24 gtkaccelgroup.c
--- gtk/gtkaccelgroup.c	2001/04/29 03:08:32	1.24
+++ gtk/gtkaccelgroup.c	2001/07/15 07:26:47
@@ -36,14 +36,14 @@
 
 
 /* --- signals --- */
-typedef void (*GtkSignalAddAccelerator)	   (GtkObject	    *object,
+typedef void (*GtkSignalAddAccelerator)	   (GObject	    *object,
 					    guint	     accel_signal_id,
 					    GtkAccelGroup   *accel_group,
 					    guint	     accel_key,
 					    GdkModifierType  accel_mods,
 					    GtkAccelFlags    accel_flags,
 					    gpointer	     func_data);
-typedef void (*GtkSignalRemoveAccelerator) (GtkObject	    *object,
+typedef void (*GtkSignalRemoveAccelerator) (GObject	    *object,
 					    GtkAccelGroup   *accel_group,
 					    guint	     accel_key,
 					    GdkModifierType  accel_mods,
@@ -59,10 +59,11 @@ static guint		 accel_groups_key_id = 0;
 static const gchar	*accel_entries_key = "gtk-accel-entries";
 static guint		 accel_entries_key_id = 0;
 static GHashTable	*accel_entry_hash_table = NULL;
-static GMemChunk	*accel_tables_mem_chunk = NULL;
 static GMemChunk	*accel_entries_mem_chunk = NULL;
 
+static GObjectClass     *parent_class = NULL;
 
+
 /* --- functions --- */
 static gboolean
 gtk_accel_entries_equal (gconstpointer a,
@@ -95,11 +96,59 @@ gtk_accel_entries_hash (gconstpointer a)
   return h;
 }
 
-GtkAccelGroup*
-gtk_accel_group_new (void)
+static void gtk_accel_group_class_init (GObjectClass *class);
+static void gtk_accel_group_init (GtkAccelGroup *accel_group);
+
+GType
+gtk_accel_group_get_type (void)
 {
-  GtkAccelGroup *accel_group;
-  
+  static GType object_type = 0;
+
+  if (!object_type)
+    {
+      static const GTypeInfo object_info =
+      {
+	sizeof (GtkAccelGroupClass),
+	(GBaseInitFunc) NULL,
+	(GBaseFinalizeFunc) NULL,
+	(GClassInitFunc) gtk_accel_group_class_init,
+	NULL,   /* clas_finalize */
+	NULL,   /* class_data */
+	sizeof(GtkAccelGroup),
+	0,      /* n_preallocs */
+	(GInstanceInitFunc) gtk_accel_group_init,
+      };
+
+      object_type = g_type_register_static (G_TYPE_OBJECT,
+					    "GtkAccelGroup",
+					    &object_info, 0);
+    }
+
+  return object_type;
+}
+
+static void
+gtk_accel_group_finalize (GObject *object)
+{
+  GtkAccelGroup *accel_group = GTK_ACCEL_GROUP(object);
+
+  if (accel_group == default_accel_group)
+    g_warning (G_STRLOC "default accel group should not be finalized");
+
+  (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+}
+
+static void
+gtk_accel_group_class_init (GObjectClass *class)
+{
+  parent_class = g_type_class_ref (G_TYPE_OBJECT);
+
+  class->finalize = gtk_accel_group_finalize;
+}
+
+static void
+gtk_accel_group_init (GtkAccelGroup *accel_group)
+{
   if (!accel_groups_key_id)
     {
       accel_groups_key_id = g_quark_from_static_string (accel_groups_key);
@@ -108,21 +157,23 @@ gtk_accel_group_new (void)
       accel_entry_hash_table = g_hash_table_new (gtk_accel_entries_hash,
 						 gtk_accel_entries_equal);
       
-      accel_tables_mem_chunk = g_mem_chunk_create (GtkAccelGroup, 8, G_ALLOC_AND_FREE);
       accel_entries_mem_chunk = g_mem_chunk_create (GtkAccelEntry, 64, G_ALLOC_AND_FREE);
     }
-  
-  accel_group = g_chunk_new (GtkAccelGroup, accel_tables_mem_chunk);
-  
-  accel_group->ref_count = 1;
+
   accel_group->lock_count = 0;
   accel_group->modifier_mask = gtk_accelerator_get_default_mod_mask ();
   accel_group->attach_objects = NULL;
-  
-  return accel_group;
 }
 
 GtkAccelGroup*
+gtk_accel_group_new (void)
+{
+  GtkAccelGroup *accel_group;
+
+  accel_group = (GtkAccelGroup *)g_object_new(GTK_TYPE_ACCEL_GROUP, NULL);
+}
+
+GtkAccelGroup*
 gtk_accel_group_get_default (void)
 {
   if (!default_accel_group)
@@ -134,36 +185,26 @@ gtk_accel_group_get_default (void)
 GtkAccelGroup*
 gtk_accel_group_ref (GtkAccelGroup	*accel_group)
 {
-  g_return_val_if_fail (accel_group != NULL, NULL);
-  
-  accel_group->ref_count += 1;
-  
-  return accel_group;
+  g_return_val_if_fail (GTK_IS_ACCEL_GROUP(accel_group), NULL);
+
+  return (GtkAccelGroup *)g_object_ref(accel_group);
 }
 
 void
 gtk_accel_group_unref (GtkAccelGroup  *accel_group)
 {
-  g_return_if_fail (accel_group != NULL);
-  g_return_if_fail (accel_group->ref_count > 0);
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
   
-  accel_group->ref_count -= 1;
-  if (accel_group->ref_count == 0)
-    {
-      g_return_if_fail (accel_group != default_accel_group);
-      g_return_if_fail (accel_group->attach_objects == NULL);
-      
-      g_chunk_free (accel_group, accel_tables_mem_chunk);
-    }
+  g_object_unref(accel_group);
 }
 
 static void
-gtk_accel_group_object_destroy (GtkObject *object)
+gtk_accel_group_object_destroy (GObject *object)
 {
   GSList *free_list, *slist;
   
-  free_list = gtk_object_get_data_by_id (object, accel_groups_key_id);
-  gtk_object_set_data_by_id (object, accel_groups_key_id, NULL);
+  free_list = g_object_get_qdata (object, accel_groups_key_id);
+  g_object_set_qdata (object, accel_groups_key_id, NULL);
   
   for (slist = free_list; slist; slist = slist->next)
     {
@@ -171,60 +212,57 @@ gtk_accel_group_object_destroy (GtkObjec
       
       accel_group = slist->data;
       accel_group->attach_objects = g_slist_remove (accel_group->attach_objects, object);
-      gtk_accel_group_unref (accel_group);
+      g_object_unref (accel_group);
     }
   g_slist_free (free_list);
 }
 
 void
 gtk_accel_group_attach (GtkAccelGroup	*accel_group,
-			GtkObject	*object)
+			GObject		*object)
 {
   GSList *slist;
   
-  g_return_if_fail (accel_group != NULL);
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_OBJECT (object));
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
+  g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (g_slist_find (accel_group->attach_objects, object) == NULL);
   
   accel_group->attach_objects = g_slist_prepend (accel_group->attach_objects, object);
-  gtk_accel_group_ref (accel_group);
-  slist = gtk_object_get_data_by_id (object, accel_groups_key_id);
+  g_object_ref (accel_group);
+  slist = g_object_get_qdata (object, accel_groups_key_id);
   if (!slist)
-    gtk_signal_connect (object,
-			"destroy",
-			GTK_SIGNAL_FUNC (gtk_accel_group_object_destroy),
-			NULL);
+    g_object_weak_ref(object,
+		      (GWeakNotify)gtk_accel_group_object_destroy,
+		      object);
   slist = g_slist_prepend (slist, accel_group);
-  gtk_object_set_data_by_id (object, accel_groups_key_id, slist);
+  g_object_set_qdata (object, accel_groups_key_id, slist);
 }
 
 void
 gtk_accel_group_detach (GtkAccelGroup	*accel_group,
-		        GtkObject	*object)
+		        GObject		*object)
 {
   GSList *slist;
   
-  g_return_if_fail (accel_group != NULL);
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_OBJECT (object));
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
+  g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (g_slist_find (accel_group->attach_objects, object) != NULL);
   
   accel_group->attach_objects = g_slist_remove (accel_group->attach_objects, object);
-  gtk_accel_group_unref (accel_group);
-  slist = gtk_object_get_data_by_id (object, accel_groups_key_id);
+  g_object_unref (accel_group);
+  slist = g_object_get_qdata (object, accel_groups_key_id);
   slist = g_slist_remove (slist, accel_group);
   if (!slist)
-    gtk_signal_disconnect_by_func (object,
-				   GTK_SIGNAL_FUNC (gtk_accel_group_object_destroy),
-				   NULL);
-  gtk_object_set_data_by_id (object, accel_groups_key_id, slist);
+    g_object_weak_unref(object,
+			(GWeakNotify)gtk_accel_group_object_destroy,
+			object);
+  g_object_set_qdata (object, accel_groups_key_id, slist);
 }
 
 void
 gtk_accel_group_lock (GtkAccelGroup	 *accel_group)
 {
-  g_return_if_fail (accel_group != NULL);
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
   
   accel_group->lock_count += 1;
 }
@@ -232,7 +270,7 @@ gtk_accel_group_lock (GtkAccelGroup	 *ac
 void
 gtk_accel_group_unlock (GtkAccelGroup  *accel_group)
 {
-  g_return_if_fail (accel_group != NULL);
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
   
   if (accel_group->lock_count)
     accel_group->lock_count -= 1;
@@ -259,25 +297,24 @@ gtk_accel_group_activate (GtkAccelGroup	
 {
   GtkAccelEntry *entry;
   
-  g_return_val_if_fail (accel_group != NULL, FALSE);
+  g_return_val_if_fail (GTK_IS_ACCEL_GROUP(accel_group), FALSE);
   
   entry = gtk_accel_group_lookup (accel_group, accel_key, accel_mods);
   if (entry && entry->signal_id &&
       (!GTK_IS_WIDGET (entry->object) || GTK_WIDGET_IS_SENSITIVE (entry->object)))
     {
-      gtk_signal_emit (entry->object, entry->signal_id);
+      g_signal_emit (entry->object, entry->signal_id, 0);
       return TRUE;
     }
   return FALSE;
 }
 
 gboolean
-gtk_accel_groups_activate (GtkObject	    *object,
+gtk_accel_groups_activate (GObject	    *object,
 			   guint	     accel_key,
 			   GdkModifierType   accel_mods)
 {
-  g_return_val_if_fail (object != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_OBJECT (object), FALSE);
+  g_return_val_if_fail (G_IS_OBJECT (object), FALSE);
   
   if (gtk_accelerator_valid (accel_key, accel_mods))
     {
@@ -299,7 +336,7 @@ gtk_accel_group_lock_entry (GtkAccelGrou
 {
   GtkAccelEntry *entry;
   
-  g_return_if_fail (accel_group != NULL);
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
   
   entry = gtk_accel_group_lookup (accel_group, accel_key, accel_mods);
   if (entry)
@@ -313,7 +350,7 @@ gtk_accel_group_unlock_entry (GtkAccelGr
 {
   GtkAccelEntry *entry;
   
-  g_return_if_fail (accel_group != NULL);
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
   
   entry = gtk_accel_group_lookup (accel_group, accel_key, accel_mods);
   if (entry)
@@ -325,7 +362,7 @@ gtk_accel_group_get_entry (GtkAccelGroup
 			   guint             accel_key,
 			   GdkModifierType   accel_mods)
 {
-  g_return_val_if_fail (accel_group != NULL, 0);
+  g_return_val_if_fail (GTK_IS_ACCEL_GROUP(accel_group), 0);
   
   return gtk_accel_group_lookup (accel_group, accel_key, accel_mods);
 }
@@ -335,7 +372,7 @@ gtk_accel_group_add (GtkAccelGroup	*acce
 		     guint		 accel_key,
 		     GdkModifierType	 accel_mods,
 		     GtkAccelFlags	 accel_flags,
-		     GtkObject		*object,
+		     GObject		*object,
 		     const gchar	*accel_signal)
 {
   guint accel_signal_id = 0;
@@ -348,24 +385,23 @@ gtk_accel_group_add (GtkAccelGroup	*acce
   GSList *attach_objects;
   GtkAccelEntry *entry;
   
-  g_return_if_fail (accel_group != NULL);
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_OBJECT (object));
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
+  g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (accel_signal != NULL);
   
   /* check for required signals in the objects branch
    */
   signal = (gchar*) accel_signal;
-  accel_signal_id = gtk_signal_lookup (signal, GTK_OBJECT_TYPE (object));
+  accel_signal_id = g_signal_lookup (signal, G_OBJECT_TYPE (object));
   if (accel_signal_id)
     {
       signal = "add-accelerator";
-      add_accelerator_signal_id = gtk_signal_lookup (signal, GTK_OBJECT_TYPE (object));
+      add_accelerator_signal_id = g_signal_lookup (signal, G_OBJECT_TYPE (object));
     }
   if (add_accelerator_signal_id)
     {
       signal = "remove-accelerator";
-      remove_accelerator_signal_id = gtk_signal_lookup (signal, GTK_OBJECT_TYPE (object));
+      remove_accelerator_signal_id = g_signal_lookup (signal, G_OBJECT_TYPE (object));
     }
   if (!accel_signal_id ||
       !add_accelerator_signal_id ||
@@ -374,7 +410,7 @@ gtk_accel_group_add (GtkAccelGroup	*acce
       g_warning ("gtk_accel_group_add(): could not find signal \"%s\""
 		 "in the `%s' class ancestry",
 		 signal,
-		 gtk_type_name (GTK_OBJECT_TYPE (object)));
+		 g_type_name (G_OBJECT_TYPE (object)));
       return;
     }
   g_signal_query (accel_signal_id, &query);
@@ -383,7 +419,7 @@ gtk_accel_group_add (GtkAccelGroup	*acce
       g_warning ("gtk_accel_group_add(): signal \"%s\" in the `%s' class ancestry"
 		 "cannot be used as accelerator signal %s",
 		 accel_signal,
-		 gtk_type_name (GTK_OBJECT_TYPE (object)),
+		 g_type_name (G_OBJECT_TYPE (object)),
 		 query.n_params > 0 ? "(extraneous parameters are not supported)" : "");
       return;
     }
@@ -398,24 +434,24 @@ gtk_accel_group_add (GtkAccelGroup	*acce
   
   /* make sure our structures stay alive
    */
-  gtk_accel_group_ref (accel_group);
-  gtk_object_ref (object);
+  g_object_ref (accel_group);
+  g_object_ref (object);
   
   /* remove an existing entry
    */
   if (entry)
-    gtk_signal_emit (entry->object, remove_accelerator_signal_id,
-		     accel_group,
-		     gdk_keyval_to_lower (accel_key),
-		     accel_mods & accel_group->modifier_mask);
+    g_signal_emit (entry->object, remove_accelerator_signal_id, 0,
+		   accel_group,
+		   gdk_keyval_to_lower (accel_key),
+		   accel_mods & accel_group->modifier_mask);
   
   /* abort if the entry still exists
    */
   entry = gtk_accel_group_lookup (accel_group, accel_key, accel_mods);
   if (entry)
     {
-      gtk_accel_group_unref (accel_group);
-      gtk_object_unref (object);
+      g_object_unref (accel_group);
+      g_object_unref (object);
       
       return;
     }
@@ -428,11 +464,11 @@ gtk_accel_group_add (GtkAccelGroup	*acce
     {
       GSList *tmp_groups;
       
-      tmp_groups = gtk_object_get_data_by_id (attach_objects->data, accel_groups_key_id);
+      tmp_groups = g_object_get_qdata (attach_objects->data, accel_groups_key_id);
       while (tmp_groups)
 	{
 	  groups = g_slist_prepend (groups, tmp_groups->data);
-	  gtk_accel_group_ref (tmp_groups->data);
+	  g_object_ref (tmp_groups->data);
 	  tmp_groups = tmp_groups->next;
 	}
     }
@@ -448,12 +484,12 @@ gtk_accel_group_add (GtkAccelGroup	*acce
 	{
 	  entry = gtk_accel_group_lookup (tmp_group, accel_key, accel_mods);
 	  if (entry && !(entry->accel_flags & GTK_ACCEL_LOCKED))
-	    gtk_signal_emit (entry->object, remove_accelerator_signal_id,
-			     tmp_group,
-			     gdk_keyval_to_lower (accel_key),
-			     accel_mods & tmp_group->modifier_mask);
+	    g_signal_emit (entry->object, remove_accelerator_signal_id, 0,
+			   tmp_group,
+			   gdk_keyval_to_lower (accel_key),
+			   accel_mods & tmp_group->modifier_mask);
 	}
-      gtk_accel_group_unref (tmp_group);
+      g_object_unref (tmp_group);
     }
   g_slist_free (groups);
   
@@ -461,48 +497,42 @@ gtk_accel_group_add (GtkAccelGroup	*acce
    */
   entry = gtk_accel_group_lookup (accel_group, accel_key, accel_mods);
   if (!entry)
-    gtk_signal_emit (object, add_accelerator_signal_id,
-		     accel_signal_id,
-		     accel_group,
-		     gdk_keyval_to_lower (accel_key),
-		     accel_mods & accel_group->modifier_mask,
-		     accel_flags & GTK_ACCEL_MASK);
+    g_signal_emit (object, add_accelerator_signal_id, 0,
+		   accel_signal_id,
+		   accel_group,
+		   gdk_keyval_to_lower (accel_key),
+		   accel_mods & accel_group->modifier_mask,
+		   accel_flags & GTK_ACCEL_MASK);
   
   /* and release the structures again
    */
-  gtk_accel_group_unref (accel_group);
-  gtk_object_unref (object);
+  g_object_unref (accel_group);
+  g_object_unref (object);
 }
 
 static void
-gtk_accel_group_delete_entries (GtkObject *object)
+gtk_accel_group_delete_entries (GSList *entries)
 {
-  GSList *free_slist, *slist;
+  GSList *slist;
   
-  gtk_signal_disconnect_by_func (object,
-				 GTK_SIGNAL_FUNC (gtk_accel_group_delete_entries),
-				 NULL);
-
   /* we remove all entries of this object the hard
    * way (i.e. without signal emission).
    */
-  free_slist = gtk_object_get_data_by_id (object, accel_entries_key_id);
-  gtk_object_set_data_by_id (object, accel_entries_key_id, NULL);
-  for (slist = free_slist; slist; slist = slist->next)
+  for (slist = entries; slist; slist = slist->next)
     {
       GtkAccelEntry *entry;
       
       entry = slist->data;
       
       g_hash_table_remove (accel_entry_hash_table, entry);
-      gtk_accel_group_unref (entry->accel_group);
+      g_object_unref (entry->accel_group);
       g_chunk_free (entry, accel_entries_mem_chunk);
     }
-  g_slist_free (free_slist);
+  g_slist_free (entries);
 }
 
 void
-gtk_accel_group_handle_add (GtkObject	      *object,
+gtk_accel_group_handle_add (GObject	      *object,
 			    guint	       accel_signal_id,
 			    GtkAccelGroup     *accel_group,
 			    guint	       accel_key,
@@ -511,9 +541,8 @@ gtk_accel_group_handle_add (GtkObject	  
 {
   GtkAccelEntry *entry;
   
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_OBJECT (object));
-  g_return_if_fail (accel_group != NULL);
+  g_return_if_fail (G_IS_OBJECT (object));
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
   g_return_if_fail (accel_signal_id > 0);
 
   if (!gtk_accelerator_valid (accel_key, accel_mods))
@@ -524,7 +553,7 @@ gtk_accel_group_handle_add (GtkObject	  
     {
       GSList *slist;
       
-      gtk_accel_group_ref (accel_group);
+      g_object_ref (accel_group);
       
       entry = g_chunk_new (GtkAccelEntry, accel_entries_mem_chunk);
       entry->accel_group = accel_group;
@@ -536,14 +565,10 @@ gtk_accel_group_handle_add (GtkObject	  
       
       g_hash_table_insert (accel_entry_hash_table, entry, entry);
       
-      slist = gtk_object_get_data_by_id (object, accel_entries_key_id);
-      if (!slist)
-	gtk_signal_connect (object,
-			    "destroy",
-			    GTK_SIGNAL_FUNC (gtk_accel_group_delete_entries),
-			    NULL);
+      slist = g_object_steal_qdata (object, accel_entries_key_id);
       slist = g_slist_prepend (slist, entry);
-      gtk_object_set_data_by_id (object, accel_entries_key_id, slist);
+      g_object_set_qdata_full (object, accel_entries_key_id, slist,
+			       (GDestroyNotify) gtk_accel_group_delete_entries);
     }
 }
 
@@ -551,24 +576,23 @@ void
 gtk_accel_group_remove (GtkAccelGroup	  *accel_group,
 			guint		   accel_key,
 			GdkModifierType	   accel_mods,
-			GtkObject	  *object)
+			GObject		  *object)
 {
   GtkAccelEntry *entry;
   guint remove_accelerator_signal_id = 0;
   
-  g_return_if_fail (accel_group != NULL);
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_OBJECT (object));
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
+  g_return_if_fail (G_IS_OBJECT (object));
   
   /* check for required signals in the objects branch
    */
-  remove_accelerator_signal_id = gtk_signal_lookup ("remove-accelerator", GTK_OBJECT_TYPE (object));
+  remove_accelerator_signal_id = g_signal_lookup ("remove-accelerator", G_OBJECT_TYPE (object));
   if (!remove_accelerator_signal_id)
     {
       g_warning ("gtk_accel_group_remove(): could not find signal \"%s\""
 		 "in the `%s' class ancestry",
 		 "remove-accelerator",
-		 gtk_type_name (GTK_OBJECT_TYPE (object)));
+		 g_type_name (G_OBJECT_TYPE (object)));
       return;
     }
   
@@ -588,33 +612,32 @@ gtk_accel_group_remove (GtkAccelGroup	  
   
   /* make sure our structures stay alive
    */
-  gtk_accel_group_ref (accel_group);
-  gtk_object_ref (object);
+  g_object_ref (accel_group);
+  g_object_ref (object);
   
   /* remove the entry
    */
-  gtk_signal_emit (entry->object, remove_accelerator_signal_id,
-		   accel_group,
-		   gdk_keyval_to_lower (accel_key),
-		   accel_mods & accel_group->modifier_mask);
+  g_signal_emit (entry->object, remove_accelerator_signal_id, 0,
+		 accel_group,
+		 gdk_keyval_to_lower (accel_key),
+		 accel_mods & accel_group->modifier_mask);
   
   /* and release the structures again
    */
-  gtk_accel_group_unref (accel_group);
-  gtk_object_unref (object);
+  g_object_unref (accel_group);
+  g_object_unref (object);
 }
 
 void
-gtk_accel_group_handle_remove (GtkObject	 *object,
+gtk_accel_group_handle_remove (GObject		 *object,
 			       GtkAccelGroup	 *accel_group,
 			       guint		  accel_key,
 			       GdkModifierType	  accel_mods)
 {
   GtkAccelEntry *entry;
   
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_OBJECT (object));
-  g_return_if_fail (accel_group != NULL);
+  g_return_if_fail (G_IS_OBJECT (object));
+  g_return_if_fail (GTK_IS_ACCEL_GROUP(accel_group));
   
   entry = gtk_accel_group_lookup (accel_group, accel_key, accel_mods);
   if (entry)
@@ -625,17 +648,15 @@ gtk_accel_group_handle_remove (GtkObject
 	  
 	  g_hash_table_remove (accel_entry_hash_table, entry);
 	  
-	  slist = gtk_object_get_data_by_id (object, accel_entries_key_id);
+	  slist = g_object_steal_qdata (object, accel_entries_key_id);
 	  if (slist)
 	    {
 	      slist = g_slist_remove (slist, entry);
-	      if (!slist)
-		gtk_signal_disconnect_by_func (object,
-					       GTK_SIGNAL_FUNC (gtk_accel_group_delete_entries),
-					       NULL);
-	      gtk_object_set_data_by_id (object, accel_entries_key_id, slist);
+	      if (slist)
+		g_object_set_qdata_full (object, accel_entries_key_id, slist,
+					 (GDestroyNotify) gtk_accel_group_delete_entries);
 	      
-	      gtk_accel_group_unref (accel_group);
+	      g_object_unref (accel_group);
 	      
 	      g_chunk_free (entry, accel_entries_mem_chunk);
 	    }
@@ -648,59 +669,59 @@ gtk_accel_group_handle_remove (GtkObject
 }
 
 guint
-gtk_accel_group_create_add (GtkType          class_type,
-			    GtkSignalRunType signal_flags,
-			    guint            handler_offset)
-{
-  g_return_val_if_fail (GTK_TYPE_IS_OBJECT (class_type), 0);
-
-  return gtk_signal_new ("add-accelerator",
-			 signal_flags,
-			 class_type,
-			 handler_offset,
-			 gtk_marshal_VOID__UINT_BOXED_UINT_FLAGS_FLAGS,
-			 GTK_TYPE_NONE, 5,
-			 GTK_TYPE_UINT,
-			 GTK_TYPE_ACCEL_GROUP,
-			 GTK_TYPE_UINT,
-			 GDK_TYPE_MODIFIER_TYPE,
-			 GTK_TYPE_ACCEL_FLAGS);
+gtk_accel_group_create_add (GType        class_type,
+			    GSignalFlags signal_flags,
+			    guint        handler_offset)
+{
+  g_return_val_if_fail (G_TYPE_IS_OBJECT (class_type), 0);
+
+  return g_signal_new ("add-accelerator",
+		       class_type,
+		       signal_flags,
+		       handler_offset,
+		       (GSignalAccumulator) NULL, NULL,
+		       gtk_marshal_VOID__UINT_OBJECT_UINT_FLAGS_FLAGS,
+		       G_TYPE_NONE, 5,
+		       G_TYPE_UINT,
+		       GTK_TYPE_ACCEL_GROUP,
+		       G_TYPE_UINT,
+		       GDK_TYPE_MODIFIER_TYPE,
+		       GTK_TYPE_ACCEL_FLAGS);
 }
 
 guint
-gtk_accel_group_create_remove (GtkType          class_type,
-			       GtkSignalRunType signal_flags,
-			       guint            handler_offset)
-{
-  g_return_val_if_fail (GTK_TYPE_IS_OBJECT (class_type), 0);
-
-  return gtk_signal_new ("remove-accelerator",
-			 signal_flags,
-			 class_type,
-			 handler_offset,
-			 gtk_marshal_VOID__BOXED_UINT_FLAGS,
-			 GTK_TYPE_NONE, 3,
-			 GTK_TYPE_ACCEL_GROUP,
-			 GTK_TYPE_UINT,
-			 GDK_TYPE_MODIFIER_TYPE);
+gtk_accel_group_create_remove (GType        class_type,
+			       GSignalFlags signal_flags,
+			       guint        handler_offset)
+{
+  g_return_val_if_fail (G_TYPE_IS_OBJECT (class_type), 0);
+
+  return g_signal_new ("remove-accelerator",
+		       class_type,
+		       signal_flags,
+		       handler_offset,
+		       (GSignalAccumulator) NULL, NULL,
+		       gtk_marshal_VOID__OBJECT_UINT_FLAGS,
+		       G_TYPE_NONE, 3,
+		       GTK_TYPE_ACCEL_GROUP,
+		       G_TYPE_UINT,
+		       GDK_TYPE_MODIFIER_TYPE);
 }
 
 GSList*
-gtk_accel_groups_from_object (GtkObject	     *object)
+gtk_accel_groups_from_object (GObject	     *object)
 {
-  g_return_val_if_fail (object != NULL, NULL);
-  g_return_val_if_fail (GTK_IS_OBJECT (object), NULL);
+  g_return_val_if_fail (G_IS_OBJECT (object), NULL);
   
-  return gtk_object_get_data_by_id (object, accel_groups_key_id);
+  return g_object_get_qdata (object, accel_groups_key_id);
 }
 
 GSList*
-gtk_accel_group_entries_from_object (GtkObject	     *object)
+gtk_accel_group_entries_from_object (GObject	     *object)
 {
-  g_return_val_if_fail (object != NULL, NULL);
-  g_return_val_if_fail (GTK_IS_OBJECT (object), NULL);
+  g_return_val_if_fail (G_IS_OBJECT (object), NULL);
   
-  return gtk_object_get_data_by_id (object, accel_entries_key_id);
+  return g_object_get_qdata (object, accel_entries_key_id);
 }
 
 gboolean
Index: gtk/gtkmarshal.list
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmarshal.list,v
retrieving revision 1.35
diff -u -p -r1.35 gtkmarshal.list
--- gtk/gtkmarshal.list	2001/06/29 01:59:01	1.35
+++ gtk/gtkmarshal.list	2001/07/15 07:26:48
@@ -70,6 +70,7 @@ VOID:OBJECT,INT,INT,BOXED,UINT,UINT
 VOID:OBJECT,OBJECT
 VOID:OBJECT,STRING,STRING
 VOID:OBJECT,UINT
+VOID:OBJECT,UINT,FLAGS
 VOID:POINTER
 VOID:POINTER,INT
 VOID:POINTER,POINTER,POINTER
@@ -77,7 +78,6 @@ VOID:POINTER,UINT
 VOID:STRING
 VOID:STRING,INT,POINTER
 VOID:UINT,BOXED,UINT,FLAGS,FLAGS
+VOID:UINT,OBJECT,UINT,FLAGS,FLAGS
 VOID:UINT,STRING
 VOID:VOID
-
-
Index: gtk/gtk-boxed.defs
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtk-boxed.defs,v
retrieving revision 1.15
diff -u -p -r1.15 gtk-boxed.defs
--- gtk/gtk-boxed.defs	2001/07/02 14:25:20	1.15
+++ gtk/gtk-boxed.defs	2001/07/15 07:26:49
@@ -9,10 +9,6 @@
 
 ;;; Gtk boxed types
 
-(define-boxed GtkAccelGroup
-  gtk_accel_group_ref
-  gtk_accel_group_unref)
-
 (define-boxed GtkBorder
   gtk_border_copy
   gtk_border_free
Index: gtk/gtkaccellabel.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccellabel.h,v
retrieving revision 1.11
diff -u -p -r1.11 gtkaccellabel.h
--- gtk/gtkaccellabel.h	2001/06/24 15:34:46	1.11
+++ gtk/gtkaccellabel.h	2001/07/15 07:26:50
@@ -56,7 +56,7 @@ struct _GtkAccelLabel
 
   guint	     queue_id;
   guint	     accel_padding;
-  GtkWidget *accel_widget;
+  GObject   *accel_object;
   gchar     *accel_string;
   guint16     accel_string_width;
 };
@@ -77,13 +77,19 @@ struct _GtkAccelLabelClass
 
 
 GtkType	   gtk_accel_label_get_type	     (void) G_GNUC_CONST;
-GtkWidget* gtk_accel_label_new		     (const gchar   *string);
-GtkWidget* gtk_accel_label_get_accel_widget  (GtkAccelLabel *accel_label);
+GtkWidget *gtk_accel_label_new		     (const gchar   *string);
+GObject   *gtk_accel_label_get_accel_object  (GtkAccelLabel *accel_label);
 guint	   gtk_accel_label_get_accel_width   (GtkAccelLabel *accel_label);
-void	   gtk_accel_label_set_accel_widget  (GtkAccelLabel *accel_label,
-					      GtkWidget	    *accel_widget);
+void	   gtk_accel_label_set_accel_object  (GtkAccelLabel *accel_label,
+					      GObject	    *accel_object);
 gboolean   gtk_accel_label_refetch           (GtkAccelLabel *accel_label);
 
+#ifndef GTK_DISABLE_DEPRECATED
+#define gtk_accel_label_get_accel_widget(accel_label) \
+  GTK_WIDGET(gtk_accel_label_get_accel_object(acel_label))
+#define gtk_accel_label_set_accel_widget(accel_label, accel_widget) \
+  gtk_accel_label_set_accel_object((accel_label), G_OBJECT(accel_widget))
+#endif
 
 #ifdef __cplusplus
 }
Index: gtk/gtkaccellabel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccellabel.c,v
retrieving revision 1.28
diff -u -p -r1.28 gtkaccellabel.c
--- gtk/gtkaccellabel.c	2001/06/24 15:34:46	1.28
+++ gtk/gtkaccellabel.c	2001/07/15 07:26:51
@@ -36,7 +36,7 @@
 
 enum {
   PROP_0,
-  PROP_ACCEL_WIDGET
+  PROP_ACCEL_OBJECT
 };
 
 static void     gtk_accel_label_class_init   (GtkAccelLabelClass *klass);
@@ -110,11 +110,11 @@ gtk_accel_label_class_init (GtkAccelLabe
   object_class->destroy = gtk_accel_label_destroy;
   
   g_object_class_install_property (G_OBJECT_CLASS(object_class),
-                                   PROP_ACCEL_WIDGET,
-                                   g_param_spec_object ("accel_widget",
-                                                        _("Accelerator widget"),
-                                                        _("The widget monitored by this accelerator label"),
-                                                        GTK_TYPE_WIDGET,
+                                   PROP_ACCEL_OBJECT,
+                                   g_param_spec_object ("accel_object",
+                                                        _("Accelerator object"),
+                                                        _("The object monitored by this accelerator label"),
+                                                        G_TYPE_OBJECT,
                                                         G_PARAM_READABLE | G_PARAM_WRITABLE));
 
    
@@ -143,8 +143,8 @@ gtk_accel_label_set_property (GObject   
 
   switch (prop_id)
     {
-    case PROP_ACCEL_WIDGET:
-      gtk_accel_label_set_accel_widget (accel_label, (GtkWidget*) g_value_get_object (value));
+    case PROP_ACCEL_OBJECT:
+      gtk_accel_label_set_accel_object (accel_label, g_value_get_object (value));
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -163,8 +163,8 @@ static void gtk_accel_label_get_property
 
   switch (prop_id)
     {
-    case PROP_ACCEL_WIDGET:
-       g_value_set_object (value, G_OBJECT (accel_label->accel_widget));
+    case PROP_ACCEL_OBJECT:
+       g_value_set_object (value, accel_label->accel_object);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -177,7 +177,7 @@ gtk_accel_label_init (GtkAccelLabel *acc
 {
   accel_label->queue_id = 0;
   accel_label->accel_padding = 3;
-  accel_label->accel_widget = NULL;
+  accel_label->accel_object = NULL;
   accel_label->accel_string = NULL;
   
   gtk_accel_label_refetch (accel_label);
@@ -207,7 +207,7 @@ gtk_accel_label_destroy (GtkObject *obje
   
   accel_label = GTK_ACCEL_LABEL (object);
 
-  gtk_accel_label_set_accel_widget (accel_label, NULL);
+  gtk_accel_label_set_accel_object (accel_label, NULL);
   
   GTK_OBJECT_CLASS (parent_class)->destroy (object);
 }
@@ -227,21 +227,21 @@ gtk_accel_label_finalize (GObject *objec
 }
 
 /**
- * gtk_accel_label_get_accel_widget:
+ * gtk_accel_label_get_accel_object:
  * @accel_label: a #GtkAccelLabel
  *
  * Fetches the widget monitored by this accelerator label. See
- * gtk_accel_label_set_accel_widget().
+ * gtk_accel_label_set_accel_object().
  *
- * Return value: the widget monitored by the accelerator label,
+ * Return value: the object monitored by the accelerator label,
  *               or %NULL.
  **/
-GtkWidget *
-gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label)
+GObject *
+gtk_accel_label_get_accel_object (GtkAccelLabel *accel_label)
 {
   g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), NULL);
 
-  return accel_label->accel_widget;
+  return accel_label->accel_object;
 }
 
 guint
@@ -353,42 +353,43 @@ gtk_accel_label_queue_refetch (GtkAccelL
 }
 
 void
-gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label,
-				  GtkWidget	*accel_widget)
+gtk_accel_label_set_accel_object (GtkAccelLabel *accel_label,
+				  GObject	*accel_object)
 {
   g_return_if_fail (accel_label != NULL);
   g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label));
-  if (accel_widget != NULL)
-    g_return_if_fail (GTK_IS_WIDGET (accel_widget));
-  
-  if (accel_widget != accel_label->accel_widget)
+  g_return_if_fail (accel_object == NULL || G_IS_OBJECT (accel_object));
+    
+  if (accel_object != accel_label->accel_object)
     {
-      if (accel_label->accel_widget)
+      if (accel_label->accel_object)
 	{
-	  gtk_signal_disconnect_by_func (GTK_OBJECT (accel_label->accel_widget),
-					 GTK_SIGNAL_FUNC (gtk_accel_label_queue_refetch),
-					 accel_label);
-	  gtk_widget_unref (accel_label->accel_widget);
+	  g_signal_handlers_disconnect_by_func (accel_label->accel_object,
+						G_CALLBACK (gtk_accel_label_queue_refetch),
+						accel_object);
+	  g_object_unref (accel_label->accel_object);
 	}
       if (accel_label->queue_id)
 	{
 	  gtk_idle_remove (accel_label->queue_id);
 	  accel_label->queue_id = 0;
 	}
-      accel_label->accel_widget = accel_widget;
-      if (accel_label->accel_widget)
+      accel_label->accel_object = accel_object;
+      if (accel_label->accel_object)
 	{
-	  gtk_widget_ref (accel_label->accel_widget);
-	  gtk_signal_connect_object_after (GTK_OBJECT (accel_label->accel_widget),
-					   "add-accelerator",
-					   GTK_SIGNAL_FUNC (gtk_accel_label_queue_refetch),
-					   GTK_OBJECT (accel_label));
-	  gtk_signal_connect_object_after (GTK_OBJECT (accel_label->accel_widget),
-					   "remove-accelerator",
-					   GTK_SIGNAL_FUNC (gtk_accel_label_queue_refetch),
-					   GTK_OBJECT (accel_label));
+	  g_object_ref (accel_label->accel_object);
+	  g_signal_connect_object (accel_label->accel_object,
+				   "add-accelerator",
+				   G_CALLBACK (gtk_accel_label_queue_refetch),
+				   accel_label,
+				   G_CONNECT_AFTER | G_CONNECT_SWAPPED);
+	  g_signal_connect_object (accel_label->accel_object,
+				   "remove-accelerator",
+				   G_CALLBACK (gtk_accel_label_queue_refetch),
+				   accel_label,
+				   G_CONNECT_AFTER | G_CONNECT_SWAPPED);
 	}
-       g_object_notify (G_OBJECT (accel_label), "accel_widget");
+       g_object_notify (G_OBJECT (accel_label), "accel_object");
     }
 }
 
@@ -409,7 +410,6 @@ gtk_accel_label_refetch (GtkAccelLabel *
 {
   GtkAccelLabelClass *class;
 
-  g_return_val_if_fail (accel_label != NULL, FALSE);
   g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), FALSE);
 
   class = GTK_ACCEL_LABEL_GET_CLASS (accel_label);
@@ -417,12 +417,12 @@ gtk_accel_label_refetch (GtkAccelLabel *
   g_free (accel_label->accel_string);
   accel_label->accel_string = NULL;
   
-  if (accel_label->accel_widget)
+  if (accel_label->accel_object)
     {
       GtkAccelEntry *entry = NULL;
       GSList *slist;
       
-      slist = gtk_accel_group_entries_from_object (GTK_OBJECT (accel_label->accel_widget));
+      slist = gtk_accel_group_entries_from_object (accel_label->accel_object);
       for (; slist; slist = slist->next)
 	{
 	  entry = slist->data;
Index: gtk/gtkitemfactory.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkitemfactory.c,v
retrieving revision 1.43
diff -u -p -r1.43 gtkitemfactory.c
--- gtk/gtkitemfactory.c	2001/06/29 01:59:01	1.43
+++ gtk/gtkitemfactory.c	2001/07/15 07:27:01
@@ -335,7 +335,7 @@ gtk_item_factory_propagate_accelerator (
 	    {
 	      GSList *work;
 	      
-	      work = gtk_accel_group_entries_from_object (GTK_OBJECT (widget));
+	      work = gtk_accel_group_entries_from_object (G_OBJECT (widget));
 	      while (work)
 		{
 		  GtkAccelEntry *ac_entry;
@@ -1273,7 +1273,7 @@ gtk_item_factory_create_item (GtkItemFac
       label = gtk_widget_new (GTK_TYPE_ACCEL_LABEL,
 			      "GtkWidget::visible", TRUE,
 			      "GtkWidget::parent", widget,
-			      "GtkAccelLabel::accel_widget", widget,
+			      "GtkAccelLabel::accel_object", widget,
 			      "GtkMisc::xalign", 0.0,
 			      NULL);
       
Index: gtk/gtkmenu.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenu.c,v
retrieving revision 1.66
diff -u -p -r1.66 gtkmenu.c
--- gtk/gtkmenu.c	2001/07/12 17:50:13	1.66
+++ gtk/gtkmenu.c	2001/07/15 07:27:05
@@ -1518,7 +1518,7 @@ gtk_menu_key_press (GtkWidget	*widget,
 	{
 	  GSList *slist;
 	  
-	  slist = gtk_accel_group_entries_from_object (GTK_OBJECT (menu_item));
+	  slist = gtk_accel_group_entries_from_object (G_OBJECT (menu_item));
 	  while (slist)
 	    {
 	      GtkAccelEntry *ac_entry;
Index: gtk/gtkmenushell.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenushell.c,v
retrieving revision 1.43
diff -u -p -r1.43 gtkmenushell.c
--- gtk/gtkmenushell.c	2001/06/29 01:59:01	1.43
+++ gtk/gtkmenushell.c	2001/07/15 07:27:08
@@ -583,7 +583,7 @@ gtk_menu_shell_key_press (GtkWidget	*wid
 				    event->state))
     return TRUE;
   
-  if (gtk_accel_groups_activate (GTK_OBJECT (widget), event->keyval, event->state))
+  if (gtk_accel_groups_activate (G_OBJECT (widget), event->keyval, event->state))
     return TRUE;
 
   return FALSE;
Index: gtk/gtkplug.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkplug.c,v
retrieving revision 1.28
diff -u -p -r1.28 gtkplug.c
--- gtk/gtkplug.c	2001/07/05 02:58:34	1.28
+++ gtk/gtkplug.c	2001/07/15 07:27:18
@@ -712,7 +712,7 @@ gtk_plug_accel_entries_changed (GtkWindo
 
   new_grabbed_keys = g_hash_table_new (grabbed_key_hash, grabbed_key_equal);
 
-  accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (window));
+  accel_groups = gtk_accel_groups_from_object (G_OBJECT (window));
   
   tmp_list = accel_groups;
 
Index: gtk/gtkwidget.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwidget.c,v
retrieving revision 1.241
diff -u -p -r1.241 gtkwidget.c
--- gtk/gtkwidget.c	2001/07/12 20:59:42	1.241
+++ gtk/gtkwidget.c	2001/07/15 07:27:24
@@ -2473,7 +2473,7 @@ gtk_widget_add_accelerator (GtkWidget   
 		       accel_key,
 		       accel_mods,
 		       accel_flags,
-		       (GtkObject*) widget,
+		       (GObject*) widget,
 		       accel_signal);
 }
 
@@ -2490,7 +2490,7 @@ gtk_widget_remove_accelerator (GtkWidget
   gtk_accel_group_remove (accel_group,
 			  accel_key,
 			  accel_mods,
-			  (GtkObject*) widget);
+			  (GObject*) widget);
 }
 
 void
@@ -2508,7 +2508,7 @@ gtk_widget_remove_accelerators (GtkWidge
   signal_id = gtk_signal_lookup (accel_signal, GTK_OBJECT_TYPE (widget));
   g_return_if_fail (signal_id != 0);
   
-  slist = gtk_accel_group_entries_from_object (GTK_OBJECT (widget));
+  slist = gtk_accel_group_entries_from_object (G_OBJECT (widget));
   while (slist)
     {
       GtkAccelEntry *ac_entry;
@@ -2538,7 +2538,7 @@ gtk_widget_accelerator_signal (GtkWidget
 
   ac_entry = gtk_accel_group_get_entry (accel_group, accel_key, accel_mods);
 
-  if (ac_entry && ac_entry->object == (GtkObject*) widget)
+  if (ac_entry && ac_entry->object == (GObject*) widget)
     return ac_entry->signal_id;
   return 0;
 }
Index: gtk/gtkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.c,v
retrieving revision 1.135
diff -u -p -r1.135 gtkwindow.c
--- gtk/gtkwindow.c	2001/07/12 17:50:14	1.135
+++ gtk/gtkwindow.c	2001/07/15 07:27:36
@@ -973,7 +973,7 @@ gtk_window_add_accel_group (GtkWindow   
   g_return_if_fail (GTK_IS_WINDOW (window));
   g_return_if_fail (accel_group != NULL);
 
-  gtk_accel_group_attach (accel_group, GTK_OBJECT (window));
+  gtk_accel_group_attach (accel_group, G_OBJECT (window));
 }
 
 void
@@ -984,7 +984,7 @@ gtk_window_remove_accel_group (GtkWindow
   g_return_if_fail (GTK_IS_WINDOW (window));
   g_return_if_fail (accel_group != NULL);
 
-  gtk_accel_group_detach (accel_group, GTK_OBJECT (window));
+  gtk_accel_group_detach (accel_group, G_OBJECT (window));
 }
 
 void
@@ -2363,7 +2363,7 @@ gtk_window_key_press_event (GtkWidget   
 					    event->state);
 
   if (!handled)
-    handled = gtk_accel_groups_activate (GTK_OBJECT (window), event->keyval, event->state);
+    handled = gtk_accel_groups_activate (G_OBJECT (window), event->keyval, event->state);
 
   /* Chain up, invokes binding set */
   if (!handled && GTK_WIDGET_CLASS (parent_class)->key_press_event)
