Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.1950
diff -u -r1.1950 ChangeLog
--- ChangeLog	2001/05/11 04:09:43	1.1950
+++ ChangeLog	2001/05/12 09:46:38
@@ -1,3 +1,47 @@
+2001-05-12  James Henstridge  <james@daa.com.au>
+
+	* gtk/gtkwindow.c (gtk_window_key_press_event): same here.
+	(gtk_window_add_accel_group): same.
+	(gtk_window_remove_accel_group): same.
+
+	* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same.
+
+	* gtk/gtkmenu.c (gtk_menu_key_press): same.
+
+	* gtk/gtkmenushell.c (gtk_menu_shell_key_press): same.
+
+	* gtk/gtkwidget.c (gtk_widget_add_accelerator): s/GtkObject/GObject.
+	(gtk_widget_remove_accelerator): same.
+	(gtk_widget_remove_accelerators): same.
+
+	* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
+	pass a GObject rather than a GtkObject to
+	gtk_accel_group_entries_from_object.
+
+	* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_new_with_label):
+	same here.
+
+	* gtk/gtkmenuitem.c (gtk_menu_item_new_with_label): change
+	function call.
+
+	* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
+	GtkAccelLabel::accel_object instead of accel_widget.
+
+	* gtk/gtkimagemenuitem.c (gtk_image_menu_item_new): same here.
+
+	* gtk/gtkcheckmenuitem.c (gtk_check_menu_item_new_with_label):
+	change function call.
+
+	* gtk/gtkaccellabel.c: same here.  Also switch from args to
+	properties.
+
+	* gtk/gtkaccellabel.h: s/accel_widget/accel_object/ and add a
+	compatibility macro for gtk_accel_label_set_accel_widget.
+
+	* gtk/gtkaccelgroup.c: conversion to allow setting accelerators on 
+
+	* gtk/gtkaccelgroup.h: s/GtkObject/GObject/
+
 Fri May 11 02:53:57 2001  Tim Janik  <timj@gtk.org>
 
 	* gtk/gtktogglebutton.c (gtk_toggle_button_expose): don't
Index: gtk/gtkaccelgroup.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccelgroup.c,v
retrieving revision 1.24
diff -u -r1.24 gtkaccelgroup.c
--- gtk/gtkaccelgroup.c	2001/04/29 03:08:32	1.24
+++ gtk/gtkaccelgroup.c	2001/05/12 09:46:38
@@ -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,
@@ -158,12 +158,12 @@
 }
 
 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)
     {
@@ -178,47 +178,48 @@
 
 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 (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);
+  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_signal_connectc (object,
+		       "destroy",
+		       G_CALLBACK(gtk_accel_group_object_destroy),
+		       NULL,
+		       FALSE);
   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 (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);
+  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_signal_disconnect_by_func (object,
+				 G_CALLBACK(gtk_accel_group_object_destroy),
+				 NULL);
+  g_object_set_qdata (object, accel_groups_key_id, slist);
 }
 
 void
@@ -265,19 +266,19 @@
   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))
     {
@@ -335,7 +336,7 @@
 		     guint		 accel_key,
 		     GdkModifierType	 accel_mods,
 		     GtkAccelFlags	 accel_flags,
-		     GtkObject		*object,
+		     GObject		*object,
 		     const gchar	*accel_signal)
 {
   guint accel_signal_id = 0;
@@ -350,22 +351,22 @@
   
   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 (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 +375,7 @@
       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 +384,7 @@
       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;
     }
@@ -399,15 +400,15 @@
   /* make sure our structures stay alive
    */
   gtk_accel_group_ref (accel_group);
-  gtk_object_ref (object);
+  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
    */
@@ -415,7 +416,7 @@
   if (entry)
     {
       gtk_accel_group_unref (accel_group);
-      gtk_object_unref (object);
+      g_object_unref (object);
       
       return;
     }
@@ -428,7 +429,7 @@
     {
       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);
@@ -448,10 +449,10 @@
 	{
 	  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);
     }
@@ -461,33 +462,32 @@
    */
   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 (object);
 }
 
 static void
-gtk_accel_group_delete_entries (GtkObject *object)
+gtk_accel_group_delete_entries (GObject *object)
 {
   GSList *free_slist, *slist;
-  
-  gtk_signal_disconnect_by_func (object,
-				 GTK_SIGNAL_FUNC (gtk_accel_group_delete_entries),
-				 NULL);
 
+  g_signal_disconnect_by_func (object,
+			       G_CALLBACK (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);
+  free_slist = g_object_get_qdata(object, accel_entries_key_id);
+  g_object_set_qdata (object, accel_entries_key_id, NULL);
   for (slist = free_slist; slist; slist = slist->next)
     {
       GtkAccelEntry *entry;
@@ -502,7 +502,7 @@
 }
 
 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,
@@ -512,7 +512,7 @@
   GtkAccelEntry *entry;
   
   g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_OBJECT (object));
+  g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (accel_group != NULL);
   g_return_if_fail (accel_signal_id > 0);
 
@@ -536,14 +536,15 @@
       
       g_hash_table_insert (accel_entry_hash_table, entry, entry);
       
-      slist = gtk_object_get_data_by_id (object, accel_entries_key_id);
+      slist = g_object_get_qdata (object, accel_entries_key_id);
       if (!slist)
-	gtk_signal_connect (object,
-			    "destroy",
-			    GTK_SIGNAL_FUNC (gtk_accel_group_delete_entries),
-			    NULL);
+	g_signal_connectc (object,
+			   "destroy",
+			   G_CALLBACK (gtk_accel_group_delete_entries),
+			   NULL,
+			   FALSE);
       slist = g_slist_prepend (slist, entry);
-      gtk_object_set_data_by_id (object, accel_entries_key_id, slist);
+      g_object_set_qdata (object, accel_entries_key_id, slist);
     }
 }
 
@@ -551,24 +552,24 @@
 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 (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;
     }
   
@@ -589,23 +590,23 @@
   /* make sure our structures stay alive
    */
   gtk_accel_group_ref (accel_group);
-  gtk_object_ref (object);
+  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 (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)
@@ -613,7 +614,7 @@
   GtkAccelEntry *entry;
   
   g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_OBJECT (object));
+  g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (accel_group != NULL);
   
   entry = gtk_accel_group_lookup (accel_group, accel_key, accel_mods);
@@ -625,16 +626,17 @@
 	  
 	  g_hash_table_remove (accel_entry_hash_table, entry);
 	  
-	  slist = gtk_object_get_data_by_id (object, accel_entries_key_id);
+	  slist = g_object_get_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);
-	      
+		g_signal_disconnect_by_func (object,
+					     G_CALLBACK (gtk_accel_group_delete_entries),
+					     NULL);
+	      g_object_set_qdata (object, accel_entries_key_id, slist);
+
 	      gtk_accel_group_unref (accel_group);
 	      
 	      g_chunk_free (entry, accel_entries_mem_chunk);
@@ -648,59 +650,61 @@
 }
 
 guint
-gtk_accel_group_create_add (GtkType          class_type,
+gtk_accel_group_create_add (GType            class_type,
 			    GtkSignalRunType signal_flags,
 			    guint            handler_offset)
 {
-  g_return_val_if_fail (GTK_TYPE_IS_OBJECT (class_type), 0);
+  g_return_val_if_fail (G_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);
+  return g_signal_newc ("add-accelerator",
+			class_type,
+			signal_flags,
+			handler_offset,
+			(GSignalAccumulator) NULL, NULL,
+			gtk_marshal_VOID__UINT_BOXED_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,
+gtk_accel_group_create_remove (GType            class_type,
 			       GtkSignalRunType signal_flags,
 			       guint            handler_offset)
 {
-  g_return_val_if_fail (GTK_TYPE_IS_OBJECT (class_type), 0);
+  g_return_val_if_fail (G_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);
+  return g_signal_newc ("remove-accelerator",
+			class_type,
+			signal_flags,
+			handler_offset,
+			(GSignalAccumulator) NULL, NULL,
+			gtk_marshal_VOID__BOXED_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/gtkaccelgroup.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccelgroup.h,v
retrieving revision 1.9
diff -u -r1.9 gtkaccelgroup.h
--- gtk/gtkaccelgroup.h	2000/08/30 00:33:36	1.9
+++ gtk/gtkaccelgroup.h	2001/05/12 09:46:39
@@ -78,7 +78,7 @@
   GdkModifierType	 accelerator_mods;
   
   GtkAccelFlags		 accel_flags;
-  GtkObject		*object;
+  GObject		*object;
   guint			 signal_id;
 };
 
@@ -104,7 +104,7 @@
 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 +114,9 @@
 						 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,36 +133,36 @@
 						 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,
+guint		gtk_accel_group_create_add	(GType		 class_type,
 						 GtkSignalRunType signal_flags,
 						 guint		 handler_offset);
-guint		gtk_accel_group_create_remove	(GtkType	 class_type,
+guint		gtk_accel_group_create_remove	(GType		 class_type,
 						 GtkSignalRunType 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);
 
 
 
Index: gtk/gtkaccellabel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccellabel.c,v
retrieving revision 1.26
diff -u -r1.26 gtkaccellabel.c
--- gtk/gtkaccellabel.c	2001/04/30 23:23:52	1.26
+++ gtk/gtkaccellabel.c	2001/05/12 09:46:40
@@ -29,24 +29,27 @@
 
 #include <string.h>
 #include <ctype.h>
+#include "gtkintl.h"
 #include "gtkmain.h"
 #include "gtksignal.h"
 #include "gtkaccellabel.h"
 
 
 enum {
-  ARG_0,
-  ARG_ACCEL_WIDGET
+  PROP_0,
+  PROP_ACCEL_OBJECT
 };
 
 static void gtk_accel_label_class_init	     (GtkAccelLabelClass *klass);
 static void gtk_accel_label_init	     (GtkAccelLabel  *accel_label);
-static void gtk_accel_label_set_arg	     (GtkObject	     *object,
-					      GtkArg	     *arg,
-					      guint	      arg_id);
-static void gtk_accel_label_get_arg	     (GtkObject      *object,
-					      GtkArg	     *arg,
-					      guint	      arg_id);
+static void gtk_accel_label_set_property     (GObject        *object,
+					      guint           prop_id,
+					      const GValue   *value,
+					      GParamSpec     *pspec);
+static void gtk_accel_label_get_property     (GObject        *object,
+					      guint           prop_id,
+					      GValue         *value,
+					      GParamSpec     *pspec);
 static void gtk_accel_label_destroy	     (GtkObject	     *object);
 static void gtk_accel_label_finalize	     (GObject	     *object);
 static void gtk_accel_label_size_request     (GtkWidget	     *widget,
@@ -100,13 +103,11 @@
   label_class = (GtkLabelClass*) class;
   
   parent_class = gtk_type_class (GTK_TYPE_LABEL);
-  
-  gtk_object_add_arg_type ("GtkAccelLabel::accel_widget", GTK_TYPE_WIDGET, GTK_ARG_READWRITE, ARG_ACCEL_WIDGET);
 
   gobject_class->finalize = gtk_accel_label_finalize;
+  gobject_class->set_property = gtk_accel_label_set_property;
+  gobject_class->get_property = gtk_accel_label_get_property;
 
-  object_class->set_arg = gtk_accel_label_set_arg;
-  object_class->get_arg = gtk_accel_label_get_arg;
   object_class->destroy = gtk_accel_label_destroy;
   
   widget_class->size_request = gtk_accel_label_size_request;
@@ -120,43 +121,56 @@
   class->mod_separator = g_strdup ("+");
   class->accel_seperator = g_strdup (" / ");
   class->latin1_to_char = TRUE;
+
+  g_object_class_install_property (gobject_class,
+				   PROP_ACCEL_OBJECT,
+				   g_param_spec_object ("accel_object",
+							_("Accelerator object"),
+							_("The object to watch for accelerator changes."),
+							G_TYPE_OBJECT,
+							G_PARAM_READWRITE));
+				   
 }
 
 static void
-gtk_accel_label_set_arg (GtkObject      *object,
-			 GtkArg		*arg,
-			 guint		 arg_id)
+gtk_accel_label_set_property (GObject        *object,
+			      guint           prop_id,
+			      const GValue   *value,
+			      GParamSpec     *pspec)
 {
-  GtkAccelLabel  *accel_label;
+  GtkAccelLabel *accel_label;
 
-  accel_label = GTK_ACCEL_LABEL (object);
+  accel_label = GTK_ACCEL_LABEL(object);
 
-  switch (arg_id)
+  switch (prop_id)
     {
-    case ARG_ACCEL_WIDGET:
-      gtk_accel_label_set_accel_widget (accel_label, (GtkWidget*) GTK_VALUE_OBJECT (*arg));
+    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);
       break;
     }
 }
 
 static void
-gtk_accel_label_get_arg (GtkObject      *object,
-			 GtkArg		*arg,
-			 guint		 arg_id)
+gtk_accel_label_get_property (GObject        *object,
+			      guint           prop_id,
+			      GValue         *value,
+			      GParamSpec     *pspec)
 {
-  GtkAccelLabel  *accel_label;
+  GtkAccelLabel *accel_label;
 
-  accel_label = GTK_ACCEL_LABEL (object);
+  accel_label = GTK_ACCEL_LABEL(object);
 
-  switch (arg_id)
+  switch (prop_id)
     {
-    case ARG_ACCEL_WIDGET:
-      GTK_VALUE_OBJECT (*arg) = (GtkObject*) accel_label->accel_widget;
+    case PROP_ACCEL_OBJECT:
+      g_value_set_object (value, accel_label->accel_object);
       break;
     default:
-      arg->type = GTK_TYPE_INVALID;
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
     }
 }
@@ -166,7 +180,7 @@
 {
   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);
@@ -179,7 +193,7 @@
   
   g_return_val_if_fail (string != NULL, NULL);
   
-  accel_label = gtk_type_new (GTK_TYPE_ACCEL_LABEL);
+  accel_label = g_object_new (GTK_TYPE_ACCEL_LABEL, NULL);
   
   gtk_label_set_text (GTK_LABEL (accel_label), string);
   
@@ -196,7 +210,7 @@
   
   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);
 }
@@ -324,40 +338,42 @@
 }
 
 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));
+  g_return_if_fail (accel_object == NULL || G_IS_OBJECT (accel_object));
   
-  if (accel_widget != accel_label->accel_widget)
+  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_disconnect_by_func (accel_label->accel_object,
+				       G_CALLBACK (gtk_accel_label_queue_refetch),
+				       accel_label);
+	  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;
+      g_object_notify(G_OBJECT(accel_label), "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),
+				   G_OBJECT (accel_label),
+				   TRUE, TRUE);
+	  g_signal_connect_object (accel_label->accel_object,
+				   "remove-accelerator",
+				   G_CALLBACK (gtk_accel_label_queue_refetch),
+				   G_OBJECT (accel_label),
+				   TRUE, TRUE);
 	}
     }
 }
@@ -387,12 +403,12 @@
   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/gtkaccellabel.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccellabel.h,v
retrieving revision 1.9
diff -u -r1.9 gtkaccellabel.h
--- gtk/gtkaccellabel.h	2000/08/30 00:33:37	1.9
+++ gtk/gtkaccellabel.h	2001/05/12 09:46:40
@@ -56,9 +56,9 @@
 
   guint	     queue_id;
   guint	     accel_padding;
-  GtkWidget *accel_widget;
+  GObject   *accel_object;
   gchar     *accel_string;
-  guint16     accel_string_width;
+  guint16    accel_string_width;
 };
 
 struct _GtkAccelLabelClass
@@ -79,10 +79,13 @@
 GtkType	   gtk_accel_label_get_type	     (void) G_GNUC_CONST;
 GtkWidget* gtk_accel_label_new		     (const gchar   *string);
 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_set_accel_widget(accel_label, accel_widget) gtk_accel_label_set_accel_object((accel_label), G_OBJECT(accel_widget))
+#endif
 
 #ifdef __cplusplus
 }
Index: gtk/gtkcheckmenuitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcheckmenuitem.c,v
retrieving revision 1.31
diff -u -r1.31 gtkcheckmenuitem.c
--- gtk/gtkcheckmenuitem.c	2001/03/29 00:24:56	1.31
+++ gtk/gtkcheckmenuitem.c	2001/05/12 09:46:51
@@ -159,7 +159,8 @@
   gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
 
   gtk_container_add (GTK_CONTAINER (check_menu_item), accel_label);
-  gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), check_menu_item);
+  gtk_accel_label_set_accel_object (GTK_ACCEL_LABEL (accel_label),
+				    G_OBJECT (check_menu_item));
   gtk_widget_show (accel_label);
 
   return check_menu_item;
Index: gtk/gtkimagemenuitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkimagemenuitem.c,v
retrieving revision 1.5
diff -u -r1.5 gtkimagemenuitem.c
--- gtk/gtkimagemenuitem.c	2001/03/21 08:56:25	1.5
+++ gtk/gtkimagemenuitem.c	2001/05/12 09:46:51
@@ -352,8 +352,8 @@
   gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
 
   gtk_container_add (GTK_CONTAINER (image_menu_item), accel_label);
-  gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
-                                    GTK_WIDGET (image_menu_item));
+  gtk_accel_label_set_accel_object (GTK_ACCEL_LABEL (accel_label),
+                                    G_OBJECT (image_menu_item));
   gtk_widget_show (accel_label);
 
   if (widget)
Index: gtk/gtkitemfactory.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkitemfactory.c,v
retrieving revision 1.38
diff -u -r1.38 gtkitemfactory.c
--- gtk/gtkitemfactory.c	2001/04/03 13:17:59	1.38
+++ gtk/gtkitemfactory.c	2001/05/12 09:46:51
@@ -335,7 +335,7 @@
 	    {
 	      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 @@
       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.62
diff -u -r1.62 gtkmenu.c
--- gtk/gtkmenu.c	2001/04/28 00:12:44	1.62
+++ gtk/gtkmenu.c	2001/05/12 09:46:55
@@ -1464,7 +1464,7 @@
 	{
 	  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/gtkmenuitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenuitem.c,v
retrieving revision 1.50
diff -u -r1.50 gtkmenuitem.c
--- gtk/gtkmenuitem.c	2001/04/01 07:32:39	1.50
+++ gtk/gtkmenuitem.c	2001/05/12 09:47:05
@@ -223,7 +223,8 @@
   gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
 
   gtk_container_add (GTK_CONTAINER (menu_item), accel_label);
-  gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), menu_item);
+  gtk_accel_label_set_accel_object (GTK_ACCEL_LABEL (accel_label),
+				    G_OBJECT (menu_item));
   gtk_widget_show (accel_label);
 
   return menu_item;
Index: gtk/gtkmenushell.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenushell.c,v
retrieving revision 1.42
diff -u -r1.42 gtkmenushell.c
--- gtk/gtkmenushell.c	2001/04/01 07:32:39	1.42
+++ gtk/gtkmenushell.c	2001/05/12 09:47:05
@@ -573,7 +573,7 @@
 				    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.24
diff -u -r1.24 gtkplug.c
--- gtk/gtkplug.c	2001/04/23 19:51:06	1.24
+++ gtk/gtkplug.c	2001/05/12 09:47:05
@@ -393,7 +393,7 @@
 
   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/gtkpreview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkpreview.c,v
retrieving revision 1.34
diff -u -r1.34 gtkpreview.c
--- gtk/gtkpreview.c	2000/11/12 03:43:22	1.34
+++ gtk/gtkpreview.c	2001/05/12 09:47:05
@@ -122,7 +122,7 @@
   klass->info.gamma = 1.0;
 
   gdk_rgb_init ();
-  klass->info.cmap = gdk_rgb_get_cmap ();
+  klass->info.cmap = gdk_rgb_get_colormap ();
   klass->info.visual = gdk_rgb_get_visual ();
 
   gtk_object_add_arg_type ("GtkPreview::expand",
Index: gtk/gtkradiomenuitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkradiomenuitem.c,v
retrieving revision 1.18
diff -u -r1.18 gtkradiomenuitem.c
--- gtk/gtkradiomenuitem.c	2001/02/19 22:25:29	1.18
+++ gtk/gtkradiomenuitem.c	2001/05/12 09:47:05
@@ -132,7 +132,8 @@
   accel_label = gtk_accel_label_new (label);
   gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
   gtk_container_add (GTK_CONTAINER (radio_menu_item), accel_label);
-  gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), radio_menu_item);
+  gtk_accel_label_set_accel_object (GTK_ACCEL_LABEL (accel_label),
+				    G_OBJECT (radio_menu_item));
   gtk_widget_show (accel_label);
 
   return radio_menu_item;
Index: gtk/gtkwidget.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwidget.c,v
retrieving revision 1.214
diff -u -r1.214 gtkwidget.c
--- gtk/gtkwidget.c	2001/05/03 20:11:07	1.214
+++ gtk/gtkwidget.c	2001/05/12 09:47:19
@@ -2364,7 +2364,7 @@
 		       accel_key,
 		       accel_mods,
 		       accel_flags,
-		       (GtkObject*) widget,
+		       (GObject*) widget,
 		       accel_signal);
 }
 
@@ -2381,7 +2381,7 @@
   gtk_accel_group_remove (accel_group,
 			  accel_key,
 			  accel_mods,
-			  (GtkObject*) widget);
+			  (GObject*) widget);
 }
 
 void
@@ -2399,7 +2399,7 @@
   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;
@@ -2429,7 +2429,7 @@
 
   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.119
diff -u -r1.119 gtkwindow.c
--- gtk/gtkwindow.c	2001/05/07 18:08:10	1.119
+++ gtk/gtkwindow.c	2001/05/12 09:47:30
@@ -909,7 +909,7 @@
   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
@@ -920,7 +920,7 @@
   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
@@ -2164,7 +2164,7 @@
 					    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)
