diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index bac9620..0850158 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -146,8 +146,40 @@ struct _GtkWidgetPrivate
    */
   guint saved_state : 3;
 
-  /* unused bits in our 32-bit block */
-  guint reserved : 10;
+  guint in_destruction        : 1;
+  guint toplevel              : 1;
+  guint no_window             : 1;
+  guint realized              : 1;
+  guint mapped                : 1;
+  guint visible               : 1;
+  guint sensitive             : 1;
+  guint parent_sensitive      : 1;
+  guint can_focus             : 1;
+  guint has_focus             : 1;
+  guint can_default           : 1;
+  guint has_default           : 1;
+  guint has_grab              : 1;
+  guint rc_style              : 1;
+  guint composite_child       : 1;
+  guint app_paintable         : 1;
+  guint receives_default      : 1;
+  guint double_buffered       : 1;
+  guint no_show_all           : 1;
+  guint multidevice           : 1;
+  guint user_style            : 1;
+  guint resize_pending        : 1;
+  guint has_pointer           : 1;
+  guint shadowed              : 1;
+  guint has_shape_mask        : 1;
+  guint in_reparent           : 1;
+  guint anchored              : 1;
+  guint child_visible         : 1;
+  guint redraw_on_alloc       : 1;
+  guint alloc_needed          : 1;
+  guint width_request_needed  : 1;
+  guint height_request_needed : 1;
+
+  guint direction             : 2;
 
   /* The widget's name. If the widget does not have a name
    *  (the name is NULL), then its name (as returned by
@@ -183,6 +215,7 @@ struct _GtkWidgetPrivate
 };
 
 enum {
+  DESTROY,
   SHOW,
   HIDE,
   MAP,
@@ -1005,6 +1038,23 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                                                      GTK_PARAM_READWRITE));
 
   /**
+   * GtkWidget::destroy:
+   * @object: the object which received the signal
+   *
+   * Signals that all holders of a reference to the widget should release
+   * the reference that they hold. May result in finalization of the widget
+   * if all references are released.
+   */
+  widget_signals[DESTROY] =
+    g_signal_new (I_("destroy"),
+                  G_TYPE_FROM_CLASS (gobject_class),
+                  G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+                  G_STRUCT_OFFSET (GtkWidgetClass, destroy),
+                  NULL, NULL,
+                  _gtk_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);
+
+  /**
    * GtkWidget::show:
    * @widget: the object which received the signal.
    */
@@ -3038,7 +3088,7 @@ gtk_widget_get_property (GObject         *object,
       g_value_set_boolean (value, (gtk_widget_get_receives_default (widget) != FALSE));
       break;
     case PROP_COMPOSITE_CHILD:
-      g_value_set_boolean (value, (GTK_OBJECT_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0 );
+      g_value_set_boolean (value, widget->priv->composite_child);
       break;
     case PROP_STYLE:
       g_value_set_object (value, gtk_widget_get_style (widget));
@@ -3127,7 +3177,7 @@ gtk_widget_init (GtkWidget *widget)
                                               GtkWidgetPrivate);
   priv = widget->priv;
 
-  GTK_PRIVATE_FLAGS (widget) = PRIVATE_GTK_CHILD_VISIBLE;
+  priv->child_visible = TRUE;
   priv->state = GTK_STATE_NORMAL;
   priv->saved_state = GTK_STATE_NORMAL;
   priv->name = NULL;
@@ -3138,15 +3188,14 @@ gtk_widget_init (GtkWidget *widget)
   priv->window = NULL;
   priv->parent = NULL;
 
-  GTK_OBJECT_FLAGS (widget) |= GTK_SENSITIVE;
-  GTK_OBJECT_FLAGS (widget) |= GTK_PARENT_SENSITIVE;
-  GTK_OBJECT_FLAGS (widget) |= composite_child_stack ? GTK_COMPOSITE_CHILD : 0;
-  gtk_widget_set_double_buffered (widget, TRUE);
-
-  GTK_PRIVATE_SET_FLAG (widget, GTK_REDRAW_ON_ALLOC);
-  GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED);
-  GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED);
-  GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED);
+  priv->sensitive = TRUE;
+  priv->parent_sensitive = TRUE;
+  priv->composite_child = composite_child_stack != 0;
+  priv->double_buffered = TRUE;
+  priv->redraw_on_alloc = TRUE;
+  priv->width_request_needed = TRUE;
+  priv->height_request_needed = TRUE;
+  priv->alloc_needed = TRUE;
 
   priv->style = gtk_widget_get_default_style ();
   g_object_ref (priv->style);
@@ -3366,7 +3415,7 @@ gtk_widget_unparent (GtkWidget *widget)
   
   if (gtk_widget_get_realized (widget))
     {
-      if (GTK_WIDGET_IN_REPARENT (widget))
+      if (priv->in_reparent)
 	gtk_widget_unmap (widget);
       else
 	gtk_widget_unrealize (widget);
@@ -3376,7 +3425,7 @@ gtk_widget_unparent (GtkWidget *widget)
    * flag to the default state, so it doesn't affect the child
    * in the next parent.
    */
-  GTK_PRIVATE_SET_FLAG (widget, GTK_CHILD_VISIBLE);
+  priv->child_visible = TRUE;
     
   old_parent = priv->parent;
   priv->parent = NULL;
@@ -3400,8 +3449,9 @@ gtk_widget_unparent (GtkWidget *widget)
  * gtk_widget_destroy:
  * @widget: a #GtkWidget
  *
- * Destroys a widget. Equivalent to gtk_object_destroy(), except that
- * you don't have to cast the widget to #GtkObject. When a widget is
+ * Destroys a widget.
+ *
+ * When a widget is
  * destroyed, it will break any references it holds to other objects.
  * If the widget is inside a container, the widget will be removed
  * from the container. If the widget is a toplevel (derived from
@@ -3420,7 +3470,8 @@ gtk_widget_destroy (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  gtk_object_destroy ((GtkObject*) widget);
+  if (!widget->priv->in_destruction)
+    g_object_run_dispose (G_OBJECT (widget));
 }
 
 /**
@@ -3487,7 +3538,7 @@ gtk_widget_real_show (GtkWidget *widget)
 
   if (!gtk_widget_get_visible (widget))
     {
-      GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
+      priv->visible = TRUE;
 
       if (priv->parent &&
 	  gtk_widget_get_mapped (priv->parent) &&
@@ -3573,7 +3624,7 @@ gtk_widget_real_hide (GtkWidget *widget)
 {
   if (gtk_widget_get_visible (widget))
     {
-      GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
+      widget->priv->visible = FALSE;
       
       if (gtk_widget_get_mapped (widget))
 	gtk_widget_unmap (widget);
@@ -3835,7 +3886,7 @@ gtk_widget_realize (GtkWidget *widget)
 				       GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (widget), quark_has_tooltip)),
 				       TRUE);
 
-      if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
+      if (priv->has_shape_mask)
 	{
 	  shape_info = g_object_get_qdata (G_OBJECT (widget), quark_shape_info);
 	  gdk_window_shape_combine_mask (priv->window,
@@ -3855,7 +3906,7 @@ gtk_widget_realize (GtkWidget *widget)
       if (mode != GDK_EXTENSION_EVENTS_NONE)
         gtk_widget_set_extension_events_internal (widget, mode, NULL);
 
-      if ((GTK_WIDGET_FLAGS (widget) & GTK_MULTIDEVICE) != 0)
+      if (priv->multidevice)
         gdk_window_set_support_multidevice (priv->window, TRUE);
 
       _gtk_widget_enable_device_events (widget);
@@ -3875,7 +3926,7 @@ gtk_widget_unrealize (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
+  if (widget->priv->has_shape_mask)
     gtk_widget_shape_combine_mask (widget, NULL, 0, 0);
 
   if (g_object_get_qdata (G_OBJECT (widget), quark_input_shape_info))
@@ -4226,10 +4277,10 @@ gtk_widget_size_allocate (GtkWidget	*widget,
     }
 #endif /* G_ENABLE_DEBUG */
  
-  alloc_needed = GTK_WIDGET_ALLOC_NEEDED (widget);
-  if (!GTK_WIDGET_WIDTH_REQUEST_NEEDED (widget) &&
-      !GTK_WIDGET_HEIGHT_REQUEST_NEEDED (widget))      /* Preserve request/allocate ordering */
-    GTK_PRIVATE_UNSET_FLAG (widget, GTK_ALLOC_NEEDED);
+  alloc_needed = priv->alloc_needed;
+  if (!priv->width_request_needed && !priv->height_request_needed)
+    /* Preserve request/allocate ordering */
+    priv->alloc_needed = FALSE;
 
   old_allocation = priv->allocation;
   real_allocation = *allocation;
@@ -5481,16 +5532,16 @@ gtk_widget_reparent (GtkWidget *widget,
        * that gtk_widget_unparent doesn't unrealize widget
        */
       if (gtk_widget_get_realized (widget) && gtk_widget_get_realized (new_parent))
-	GTK_PRIVATE_SET_FLAG (widget, GTK_IN_REPARENT);
+	priv->in_reparent = TRUE;
       
       g_object_ref (widget);
       gtk_container_remove (GTK_CONTAINER (priv->parent), widget);
       gtk_container_add (GTK_CONTAINER (new_parent), widget);
       g_object_unref (widget);
       
-      if (GTK_WIDGET_IN_REPARENT (widget))
+      if (priv->in_reparent)
 	{
-	  GTK_PRIVATE_UNSET_FLAG (widget, GTK_IN_REPARENT);
+          priv->in_reparent = FALSE;
 
 	  gtk_widget_reparent_subwindows (widget, gtk_widget_get_parent_window (widget));
 	  gtk_widget_reparent_fixup_child (widget,
@@ -5818,12 +5869,9 @@ gtk_widget_set_can_focus (GtkWidget *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (can_focus != gtk_widget_get_can_focus (widget))
+  if (widget->priv->can_focus != can_focus)
     {
-      if (can_focus)
-        GTK_OBJECT_FLAGS (widget) |= GTK_CAN_FOCUS;
-      else
-        GTK_OBJECT_FLAGS (widget) &= ~(GTK_CAN_FOCUS);
+      widget->priv->can_focus = can_focus;
 
       gtk_widget_queue_resize (widget);
       g_object_notify (G_OBJECT (widget), "can-focus");
@@ -5846,7 +5894,7 @@ gtk_widget_get_can_focus (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_CAN_FOCUS) != 0;
+  return widget->priv->can_focus;
 }
 
 /**
@@ -5866,7 +5914,7 @@ gtk_widget_has_focus (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_HAS_FOCUS) != 0;
+  return widget->priv->has_focus;
 }
 
 /**
@@ -5912,12 +5960,9 @@ gtk_widget_set_can_default (GtkWidget *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (can_default != gtk_widget_get_can_default (widget))
+  if (widget->priv->can_default != can_default)
     {
-      if (can_default)
-        GTK_OBJECT_FLAGS (widget) |= GTK_CAN_DEFAULT;
-      else
-        GTK_OBJECT_FLAGS (widget) &= ~(GTK_CAN_DEFAULT);
+      widget->priv->can_default = can_default;
 
       gtk_widget_queue_resize (widget);
       g_object_notify (G_OBJECT (widget), "can-default");
@@ -5940,7 +5985,7 @@ gtk_widget_get_can_default (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_CAN_DEFAULT) != 0;
+  return widget->priv->can_default;
 }
 
 /**
@@ -5960,17 +6005,14 @@ gtk_widget_has_default (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_HAS_DEFAULT) != 0;
+  return widget->priv->has_default;
 }
 
 void
 _gtk_widget_set_has_default (GtkWidget *widget,
                              gboolean   has_default)
 {
-  if (has_default)
-    GTK_OBJECT_FLAGS (widget) |= GTK_HAS_DEFAULT;
-  else
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_HAS_DEFAULT);
+  widget->priv->has_default = has_default;
 }
 
 /**
@@ -6023,12 +6065,9 @@ gtk_widget_set_receives_default (GtkWidget *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (receives_default != gtk_widget_get_receives_default (widget))
+  if (widget->priv->receives_default != receives_default)
     {
-      if (receives_default)
-        GTK_OBJECT_FLAGS (widget) |= GTK_RECEIVES_DEFAULT;
-      else
-        GTK_OBJECT_FLAGS (widget) &= ~(GTK_RECEIVES_DEFAULT);
+      widget->priv->receives_default = receives_default;
 
       g_object_notify (G_OBJECT (widget), "receives-default");
     }
@@ -6054,7 +6093,7 @@ gtk_widget_get_receives_default (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_RECEIVES_DEFAULT) != 0;
+  return widget->priv->receives_default;
 }
 
 /**
@@ -6075,17 +6114,14 @@ gtk_widget_has_grab (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_HAS_GRAB) != 0;
+  return widget->priv->has_grab;
 }
 
 void
 _gtk_widget_set_has_grab (GtkWidget *widget,
                           gboolean   has_grab)
 {
-  if (has_grab)
-    GTK_OBJECT_FLAGS (widget) |= GTK_HAS_GRAB;
-  else
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_HAS_GRAB);
+  widget->priv->has_grab = has_grab;
 }
 
 /**
@@ -6168,7 +6204,7 @@ gtk_widget_set_name (GtkWidget	 *widget,
   g_free (priv->name);
   priv->name = new_name;
 
-  if (gtk_widget_has_rc_style (widget))
+  if (priv->rc_style)
     gtk_widget_reset_rc_style (widget);
 
   g_object_notify (G_OBJECT (widget), "name");
@@ -6308,7 +6344,7 @@ gtk_widget_get_visible (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_VISIBLE) != 0;
+  return widget->priv->visible;
 }
 
 /**
@@ -6335,10 +6371,7 @@ gtk_widget_set_has_window (GtkWidget *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (has_window)
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_NO_WINDOW);
-  else
-    GTK_OBJECT_FLAGS (widget) |= GTK_NO_WINDOW;
+  widget->priv->no_window = !has_window;
 }
 
 /**
@@ -6357,7 +6390,7 @@ gtk_widget_get_has_window (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return !((GTK_OBJECT_FLAGS (widget) & GTK_NO_WINDOW) != 0);
+  return ! widget->priv->no_window;
 }
 
 /**
@@ -6377,17 +6410,14 @@ gtk_widget_is_toplevel (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_TOPLEVEL) != 0;
+  return widget->priv->toplevel;
 }
 
 void
 _gtk_widget_set_is_toplevel (GtkWidget *widget,
                              gboolean   is_toplevel)
 {
-  if (is_toplevel)
-    GTK_OBJECT_FLAGS (widget) |= GTK_TOPLEVEL;
-  else
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_TOPLEVEL);
+  widget->priv->toplevel = is_toplevel;
 }
 
 /**
@@ -6425,7 +6455,7 @@ gtk_widget_get_realized (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_REALIZED) != 0;
+  return widget->priv->realized;
 }
 
 /**
@@ -6446,10 +6476,7 @@ gtk_widget_set_realized (GtkWidget *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (realized)
-    GTK_OBJECT_FLAGS (widget) |= GTK_REALIZED;
-  else
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_REALIZED);
+  widget->priv->realized = realized;
 }
 
 /**
@@ -6467,7 +6494,7 @@ gtk_widget_get_mapped (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_MAPPED) != 0;
+  return widget->priv->mapped;
 }
 
 /**
@@ -6488,10 +6515,7 @@ gtk_widget_set_mapped (GtkWidget *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (mapped)
-    GTK_OBJECT_FLAGS (widget) |= GTK_MAPPED;
-  else
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_MAPPED);
+  widget->priv->mapped = mapped;
 }
 
 /**
@@ -6526,12 +6550,9 @@ gtk_widget_set_app_paintable (GtkWidget *widget,
 
   app_paintable = (app_paintable != FALSE);
 
-  if (gtk_widget_get_app_paintable (widget) != app_paintable)
+  if (widget->priv->app_paintable != app_paintable)
     {
-      if (app_paintable)
-        GTK_OBJECT_FLAGS (widget) |= GTK_APP_PAINTABLE;
-      else
-        GTK_OBJECT_FLAGS (widget) &= ~(GTK_APP_PAINTABLE);
+      widget->priv->app_paintable = app_paintable;
 
       if (gtk_widget_is_drawable (widget))
 	gtk_widget_queue_draw (widget);
@@ -6558,7 +6579,7 @@ gtk_widget_get_app_paintable (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_APP_PAINTABLE) != 0;
+  return widget->priv->app_paintable;
 }
 
 /**
@@ -6593,12 +6614,9 @@ gtk_widget_set_double_buffered (GtkWidget *widget,
 
   double_buffered = (double_buffered != FALSE);
 
-  if (double_buffered != gtk_widget_get_double_buffered (widget))
+  if (widget->priv->double_buffered != double_buffered)
     {
-      if (double_buffered)
-        GTK_OBJECT_FLAGS (widget) |= GTK_DOUBLE_BUFFERED;
-      else
-        GTK_OBJECT_FLAGS (widget) &= ~(GTK_DOUBLE_BUFFERED);
+      widget->priv->double_buffered = double_buffered;
 
       g_object_notify (G_OBJECT (widget), "double-buffered");
     }
@@ -6621,7 +6639,7 @@ gtk_widget_get_double_buffered (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_DOUBLE_BUFFERED) != 0;
+  return widget->priv->double_buffered;
 }
 
 /**
@@ -6652,10 +6670,7 @@ gtk_widget_set_redraw_on_allocate (GtkWidget *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (redraw_on_allocate)
-    GTK_PRIVATE_SET_FLAG (widget, GTK_REDRAW_ON_ALLOC);
-  else
-    GTK_PRIVATE_UNSET_FLAG (widget, GTK_REDRAW_ON_ALLOC);
+  widget->priv->redraw_on_alloc = redraw_on_allocate;
 }
 
 /**
@@ -6681,24 +6696,24 @@ gtk_widget_set_sensitive (GtkWidget *widget,
 
   sensitive = (sensitive != FALSE);
 
-  if (sensitive == (gtk_widget_get_sensitive (widget) != FALSE))
+  if (widget->priv->sensitive == sensitive)
     return;
 
   if (sensitive)
     {
-      GTK_OBJECT_FLAGS (widget) |= GTK_SENSITIVE;
+      widget->priv->sensitive = TRUE;
       data.state = priv->saved_state;
     }
   else
     {
-      GTK_OBJECT_FLAGS (widget) &= ~(GTK_SENSITIVE);
+      widget->priv->sensitive = FALSE;
       data.state = gtk_widget_get_state (widget);
     }
   data.state_restoration = TRUE;
   data.use_forall = TRUE;
 
   if (priv->parent)
-    data.parent_sensitive = (gtk_widget_is_sensitive (priv->parent) != FALSE);
+    data.parent_sensitive = gtk_widget_is_sensitive (priv->parent);
   else
     data.parent_sensitive = TRUE;
 
@@ -6728,7 +6743,7 @@ gtk_widget_get_sensitive (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_SENSITIVE) != 0;
+  return widget->priv->sensitive;
 }
 
 /**
@@ -6747,8 +6762,7 @@ gtk_widget_is_sensitive (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (gtk_widget_get_sensitive (widget) &&
-          (GTK_OBJECT_FLAGS (widget) & GTK_PARENT_SENSITIVE) != 0);
+  return widget->priv->sensitive && widget->priv->parent_sensitive;
 }
 
 /**
@@ -6894,7 +6908,7 @@ gtk_widget_has_rc_style (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return (GTK_OBJECT_FLAGS (widget) & GTK_RC_STYLE) != 0;
+  return widget->priv->rc_style;
 }
 
 /**
@@ -6918,16 +6932,16 @@ gtk_widget_set_style (GtkWidget *widget,
     {
       gboolean initial_emission;
 
-      initial_emission = !gtk_widget_has_rc_style (widget) && !GTK_WIDGET_USER_STYLE (widget);
+      initial_emission = !widget->priv->rc_style && !widget->priv->user_style;
       
-      GTK_OBJECT_FLAGS (widget) &= ~(GTK_RC_STYLE);
-      GTK_PRIVATE_SET_FLAG (widget, GTK_USER_STYLE);
+      widget->priv->rc_style = FALSE;
+      widget->priv->user_style = TRUE;
       
       gtk_widget_set_style_internal (widget, style, initial_emission);
     }
   else
     {
-      if (GTK_WIDGET_USER_STYLE (widget))
+      if (widget->priv->user_style)
 	gtk_widget_reset_rc_style (widget);
     }
 }
@@ -6946,8 +6960,7 @@ gtk_widget_ensure_style (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (!GTK_WIDGET_USER_STYLE (widget) &&
-      !gtk_widget_has_rc_style (widget))
+  if (!widget->priv->rc_style && !widget->priv->user_style)
     gtk_widget_reset_rc_style (widget);
 }
 
@@ -6960,12 +6973,12 @@ gtk_widget_reset_rc_style (GtkWidget *widget)
   GtkWidgetPrivate *priv = widget->priv;
   GtkStyle *new_style = NULL;
   gboolean initial_emission;
-  
-  initial_emission = !gtk_widget_has_rc_style (widget) && !GTK_WIDGET_USER_STYLE (widget);
 
-  GTK_PRIVATE_UNSET_FLAG (widget, GTK_USER_STYLE);
-  GTK_OBJECT_FLAGS (widget) |= GTK_RC_STYLE;
-  
+  initial_emission = !priv->rc_style && !priv->user_style;
+
+  priv->user_style = FALSE;
+  priv->rc_style = TRUE;
+
   if (gtk_widget_has_screen (widget))
     new_style = gtk_rc_get_style (widget);
   if (!new_style)
@@ -7030,7 +7043,7 @@ gtk_widget_modify_style (GtkWidget      *widget,
    * modifier style and the only reference was our own.
    */
   
-  if (gtk_widget_has_rc_style (widget))
+  if (widget->priv->rc_style)
     gtk_widget_reset_rc_style (widget);
 }
 
@@ -7446,14 +7459,11 @@ gtk_widget_propagate_hierarchy_changed_recurse (GtkWidget *widget,
   gboolean new_anchored = gtk_widget_is_toplevel (widget) ||
                  (priv->parent && GTK_WIDGET_ANCHORED (priv->parent));
 
-  if (GTK_WIDGET_ANCHORED (widget) != new_anchored)
+  if (priv->anchored != new_anchored)
     {
       g_object_ref (widget);
-      
-      if (new_anchored)
-	GTK_PRIVATE_SET_FLAG (widget, GTK_ANCHORED);
-      else
-	GTK_PRIVATE_UNSET_FLAG (widget, GTK_ANCHORED);
+
+      priv->anchored = new_anchored;
       
       g_signal_emit (widget, widget_signals[HIERARCHY_CHANGED], 0, info->previous_toplevel);
       do_screen_change (widget, info->previous_screen, info->new_screen);
@@ -7601,7 +7611,7 @@ _gtk_widget_propagate_screen_changed (GtkWidget    *widget,
 static void
 reset_rc_styles_recurse (GtkWidget *widget, gpointer data)
 {
-  if (gtk_widget_has_rc_style (widget))
+  if (widget->priv->rc_style)
     gtk_widget_reset_rc_style (widget);
   
   if (GTK_IS_CONTAINER (widget))
@@ -7945,12 +7955,12 @@ gtk_widget_set_child_visible (GtkWidget *widget,
   g_object_ref (widget);
 
   if (is_visible)
-    GTK_PRIVATE_SET_FLAG (widget, GTK_CHILD_VISIBLE);
+    priv->child_visible = TRUE;
   else
     {
       GtkWidget *toplevel;
-      
-      GTK_PRIVATE_UNSET_FLAG (widget, GTK_CHILD_VISIBLE);
+
+      priv->child_visible = FALSE;
 
       toplevel = gtk_widget_get_toplevel (widget);
       if (toplevel != widget && gtk_widget_is_toplevel (toplevel))
@@ -8927,7 +8937,7 @@ gtk_widget_set_composite_name (GtkWidget   *widget,
 			       const gchar *name)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail ((GTK_OBJECT_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0);
+  g_return_if_fail (widget->priv->composite_child);
   g_return_if_fail (name != NULL);
 
   if (!quark_composite_name)
@@ -8958,7 +8968,7 @@ gtk_widget_get_composite_name (GtkWidget *widget)
 
   priv = widget->priv;
 
-  if (((GTK_OBJECT_FLAGS (widget) & GTK_COMPOSITE_CHILD) != 0) && priv->parent)
+  if (widget->priv->composite_child && priv->parent)
     return _gtk_container_child_composite_name (GTK_CONTAINER (priv->parent),
 					       widget);
   else
@@ -9116,17 +9126,8 @@ gtk_widget_set_direction (GtkWidget        *widget,
   g_return_if_fail (dir >= GTK_TEXT_DIR_NONE && dir <= GTK_TEXT_DIR_RTL);
 
   old_dir = gtk_widget_get_direction (widget);
-  
-  if (dir == GTK_TEXT_DIR_NONE)
-    GTK_PRIVATE_UNSET_FLAG (widget, GTK_DIRECTION_SET);
-  else
-    {
-      GTK_PRIVATE_SET_FLAG (widget, GTK_DIRECTION_SET);
-      if (dir == GTK_TEXT_DIR_LTR)
-	GTK_PRIVATE_SET_FLAG (widget, GTK_DIRECTION_LTR);
-      else
-	GTK_PRIVATE_UNSET_FLAG (widget, GTK_DIRECTION_LTR);
-    }
+
+  widget->priv->direction = dir;
 
   if (old_dir != gtk_widget_get_direction (widget))
     gtk_widget_emit_direction_changed (widget, old_dir);
@@ -9146,10 +9147,10 @@ gtk_widget_get_direction (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), GTK_TEXT_DIR_LTR);
   
-  if (GTK_WIDGET_DIRECTION_SET (widget))
-    return GTK_WIDGET_DIRECTION_LTR (widget) ? GTK_TEXT_DIR_LTR : GTK_TEXT_DIR_RTL;
-  else
+  if (widget->priv->direction == GTK_TEXT_DIR_NONE)
     return gtk_default_direction;
+  else
+    return widget->priv->direction;
 }
 
 static void
@@ -9159,7 +9160,7 @@ gtk_widget_set_default_direction_recurse (GtkWidget *widget, gpointer data)
 
   g_object_ref (widget);
   
-  if (!GTK_WIDGET_DIRECTION_SET (widget))
+  if (widget->priv->direction == GTK_TEXT_DIR_NONE)
     gtk_widget_emit_direction_changed (widget, old_dir);
   
   if (GTK_IS_CONTAINER (widget))
@@ -9230,10 +9231,19 @@ gtk_widget_dispose (GObject *object)
   else if (gtk_widget_get_visible (widget))
     gtk_widget_hide (widget);
 
-  GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
+  priv->visible = FALSE;
   if (gtk_widget_get_realized (widget))
     gtk_widget_unrealize (widget);
-  
+
+  if (!priv->in_destruction)
+    {
+      priv->in_destruction = TRUE;
+
+      g_signal_emit (object, widget_signals[DESTROY], 0);
+
+      priv->in_destruction = FALSE;
+    }
+
   G_OBJECT_CLASS (gtk_widget_parent_class)->dispose (object);
 }
 
@@ -9250,14 +9260,12 @@ gtk_widget_real_destroy (GtkObject *object)
 
   /* Callers of add_mnemonic_label() should disconnect on ::destroy */
   g_object_set_qdata (G_OBJECT (widget), quark_mnemonic_labels, NULL);
-  
+
   gtk_grab_remove (widget);
 
   g_object_unref (priv->style);
   priv->style = gtk_widget_get_default_style ();
   g_object_ref (priv->style);
-
-  GTK_OBJECT_CLASS (gtk_widget_parent_class)->destroy (object);
 }
 
 static void
@@ -9283,6 +9291,12 @@ gtk_widget_finalize (GObject *object)
   if (accessible)
     g_object_unref (accessible);
 
+  if (g_object_is_floating (object))
+    g_warning ("A floating object was finalized. This means that someone\n"
+               "called g_object_unref() on an object that had only a floating\n"
+               "reference; the initial floating reference is not owned by anyone\n"
+               "and must be removed with g_object_ref_sink().");
+
   G_OBJECT_CLASS (gtk_widget_parent_class)->finalize (object);
 }
 
@@ -9861,10 +9875,7 @@ gtk_widget_propagate_state (GtkWidget           *widget,
    */
 
 
-  if (data->parent_sensitive)
-    GTK_OBJECT_FLAGS (widget) |= GTK_PARENT_SENSITIVE;
-  else
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_PARENT_SENSITIVE);
+  priv->parent_sensitive = data->parent_sensitive;
 
   if (gtk_widget_is_sensitive (widget))
     {
@@ -9904,7 +9915,7 @@ gtk_widget_propagate_state (GtkWidget           *widget,
 
       g_signal_emit (widget, widget_signals[STATE_CHANGED], 0, old_state);
 
-      if (!GTK_WIDGET_SHADOWED (widget))
+      if (!priv->shadowed)
         {
           GList *event_windows = NULL;
           GList *devices, *d;
@@ -10057,7 +10068,7 @@ gtk_widget_shape_combine_mask (GtkWidget *widget,
 
   if (!shape_mask)
     {
-      GTK_PRIVATE_UNSET_FLAG (widget, GTK_HAS_SHAPE_MASK);
+      priv->has_shape_mask = FALSE;
 
       if (priv->window)
 	gdk_window_shape_combine_mask (priv->window, NULL, 0, 0);
@@ -10066,7 +10077,7 @@ gtk_widget_shape_combine_mask (GtkWidget *widget,
     }
   else
     {
-      GTK_PRIVATE_SET_FLAG (widget, GTK_HAS_SHAPE_MASK);
+      priv->has_shape_mask = TRUE;
       
       shape_info = g_slice_new (GtkWidgetShapeInfo);
       g_object_set_qdata_full (G_OBJECT (widget), quark_shape_info, shape_info,
@@ -10173,7 +10184,7 @@ gtk_widget_reset_shapes (GtkWidget *widget)
 
   priv = widget->priv;
 
-  if (!GTK_WIDGET_HAS_SHAPE_MASK (widget))
+  if (!priv->has_shape_mask)
     gtk_reset_shapes_recurse (widget, priv->window);
 }
 
@@ -11784,7 +11795,7 @@ gtk_widget_get_no_show_all (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
   
-  return (GTK_OBJECT_FLAGS (widget) & GTK_NO_SHOW_ALL) != 0;
+  return widget->priv->no_show_all;
 }
 
 /**
@@ -11809,15 +11820,12 @@ gtk_widget_set_no_show_all (GtkWidget *widget,
 
   no_show_all = (no_show_all != FALSE);
 
-  if (no_show_all == gtk_widget_get_no_show_all (widget))
-    return;
+  if (widget->priv->no_show_all != no_show_all)
+    {
+      widget->priv->no_show_all = no_show_all;
 
-  if (no_show_all)
-    GTK_OBJECT_FLAGS (widget) |= GTK_NO_SHOW_ALL;
-  else
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_NO_SHOW_ALL);
-  
-  g_object_notify (G_OBJECT (widget), "no-show-all");
+      g_object_notify (G_OBJECT (widget), "no-show-all");
+    }
 }
 
 
@@ -12245,7 +12253,7 @@ gtk_widget_get_support_multidevice (GtkWidget *widget)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return GTK_WIDGET_FLAGS (widget) & GTK_MULTIDEVICE;
+  return widget->priv->multidevice;
 }
 
 /**
@@ -12272,12 +12280,12 @@ gtk_widget_set_support_multidevice (GtkWidget *widget,
 
   if (support_multidevice)
     {
-      GTK_WIDGET_SET_FLAGS (widget, GTK_MULTIDEVICE);
+      priv->multidevice = TRUE;
       gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL);
     }
   else
     {
-      GTK_WIDGET_UNSET_FLAGS (widget, GTK_MULTIDEVICE);
+      priv->multidevice = FALSE;
       gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_NONE);
     }
 
@@ -12289,10 +12297,7 @@ static void
 _gtk_widget_set_has_focus (GtkWidget *widget,
                            gboolean   has_focus)
 {
-  if (has_focus)
-    GTK_OBJECT_FLAGS (widget) |= GTK_HAS_FOCUS;
-  else
-    GTK_OBJECT_FLAGS (widget) &= ~(GTK_HAS_FOCUS);
+  widget->priv->has_focus = has_focus;
 }
 
 /**
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 73c7bb6..d9e4c45 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -33,7 +33,6 @@
 
 #include <gdk/gdk.h>
 #include <gtk/gtkaccelgroup.h>
-#include <gtk/gtkobject.h>
 #include <gtk/gtkadjustment.h>
 #include <gtk/gtkstyle.h>
 #include <gtk/gtksettings.h>
@@ -250,13 +249,7 @@ struct _GtkRequisition
  */
 struct _GtkWidget
 {
-  /* The object structure needs to be the first
-   *  element in the widget structure in order for
-   *  the object mechanism to work correctly. This
-   *  allows a GtkWidget pointer to be cast to a
-   *  GtkObject pointer.
-   */
-  GtkObject object;
+  GInitiallyUnowned parent_instance;
 
   /* internally used private flags. */
   guint GSEAL (private_flags) : 16;
@@ -284,13 +277,7 @@ struct _GtkWidget
  */
 struct _GtkWidgetClass
 {
-  /* The object class structure needs to be the first
-   *  element in the widget class structure in order for
-   *  the class mechanism to work correctly. This allows a
-   *  GtkWidgetClass pointer to be cast to a GtkObjectClass
-   *  pointer.
-   */
-  GtkObjectClass parent_class;
+  GInitiallyUnownedClass parent_class;
 
   /*< public >*/
   
@@ -306,6 +293,7 @@ struct _GtkWidgetClass
 					     GParamSpec **pspecs);
 
   /* basics */
+  void (* destroy)             (GtkWidget        *widget);
   void (* show)		       (GtkWidget        *widget);
   void (* show_all)            (GtkWidget        *widget);
   void (* hide)		       (GtkWidget        *widget);
