Index: gtk/gtkpaned.c
===================================================================
--- gtk/gtkpaned.c	(revision 21513)
+++ gtk/gtkpaned.c	(working copy)
@@ -21,7 +21,7 @@
  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  * file for a list of people on the GTK+ Team.  See the ChangeLog
  * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
 #include "config.h"
@@ -37,6 +37,7 @@
 
 enum {
   PROP_0,
+  PROP_ORIENTATION,
   PROP_POSITION,
   PROP_POSITION_SET,
   PROP_MIN_POSITION,
@@ -78,6 +79,11 @@ static void     gtk_paned_get_child_prop
                                                  GValue           *value,
                                                  GParamSpec       *pspec);
 static void     gtk_paned_finalize              (GObject          *object);
+
+static void     gtk_paned_size_request          (GtkWidget        *widget,
+                                                 GtkRequisition   *requisition);
+static void     gtk_paned_size_allocate         (GtkWidget        *widget,
+                                                 GtkAllocation    *allocation);
 static void     gtk_paned_realize               (GtkWidget        *widget);
 static void     gtk_paned_unrealize             (GtkWidget        *widget);
 static void     gtk_paned_map                   (GtkWidget        *widget);
@@ -134,12 +140,13 @@ static void     gtk_paned_grab_notify   
 
 struct _GtkPanedPrivate
 {
-  GtkWidget *saved_focus;
-  GtkPaned  *first_paned;
-  guint32    grab_time;
+  GtkOrientation  orientation;
+  GtkWidget      *saved_focus;
+  GtkPaned       *first_paned;
+  guint32         grab_time;
 };
 
-G_DEFINE_ABSTRACT_TYPE (GtkPaned, gtk_paned, GTK_TYPE_CONTAINER)
+G_DEFINE_TYPE (GtkPaned, gtk_paned, GTK_TYPE_CONTAINER)
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
@@ -182,6 +189,8 @@ gtk_paned_class_init (GtkPanedClass *cla
   object_class->get_property = gtk_paned_get_property;
   object_class->finalize = gtk_paned_finalize;
 
+  widget_class->size_request = gtk_paned_size_request;
+  widget_class->size_allocate = gtk_paned_size_allocate;
   widget_class->realize = gtk_paned_realize;
   widget_class->unrealize = gtk_paned_unrealize;
   widget_class->map = gtk_paned_map;
@@ -212,6 +221,22 @@ gtk_paned_class_init (GtkPanedClass *cla
   paned_class->accept_position = gtk_paned_accept_position;
   paned_class->cancel_position = gtk_paned_cancel_position;
 
+  /**
+   * GtkPaned:orientation:
+   *
+   * The orientation of the paned.
+   *
+   * Since: 2.16
+   **/
+  g_object_class_install_property (object_class,
+                                   PROP_ORIENTATION,
+                                   g_param_spec_enum ("orientation",
+                                                      P_("Orientation"),
+                                                      P_("The orientation of the paned"),
+                                                      GTK_TYPE_ORIENTATION,
+                                                      GTK_ORIENTATION_HORIZONTAL,
+                                                      GTK_PARAM_READWRITE));
+
   g_object_class_install_property (object_class,
 				   PROP_POSITION,
 				   g_param_spec_int ("position",
@@ -221,6 +246,7 @@ gtk_paned_class_init (GtkPanedClass *cla
 						     G_MAXINT,
 						     0,
 						     GTK_PARAM_READWRITE));
+
   g_object_class_install_property (object_class,
 				   PROP_POSITION_SET,
 				   g_param_spec_boolean ("position-set",
@@ -520,7 +546,7 @@ gtk_paned_class_init (GtkPanedClass *cla
   add_move_binding (binding_set, GDK_End, 0, GTK_SCROLL_END);
   add_move_binding (binding_set, GDK_KP_End, 0, GTK_SCROLL_END);
 
-  g_type_class_add_private (object_class, sizeof (GtkPanedPrivate));  
+  g_type_class_add_private (object_class, sizeof (GtkPanedPrivate));
 }
 
 static GType
@@ -538,9 +564,15 @@ gtk_paned_init (GtkPaned *paned)
   GTK_WIDGET_SET_FLAGS (paned, GTK_NO_WINDOW | GTK_CAN_FOCUS);
 
   /* We only need to redraw when the handle position moves, which is
-   * independent of the overall allocation of the GtkPaned */
+   * independent of the overall allocation of the GtkPaned
+   */
   gtk_widget_set_redraw_on_allocate (GTK_WIDGET (paned), FALSE);
 
+  paned->priv = G_TYPE_INSTANCE_GET_PRIVATE (paned, GTK_TYPE_PANED, GtkPanedPrivate);
+
+  paned->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
+  paned->cursor_type = GDK_SB_H_DOUBLE_ARROW;
+
   paned->child1 = NULL;
   paned->child2 = NULL;
   paned->handle = NULL;
@@ -553,7 +585,6 @@ gtk_paned_init (GtkPaned *paned)
   paned->last_allocation = -1;
   paned->in_drag = FALSE;
 
-  paned->priv = G_TYPE_INSTANCE_GET_PRIVATE (paned, GTK_TYPE_PANED, GtkPanedPrivate);
   paned->last_child1_focus = NULL;
   paned->last_child2_focus = NULL;
   paned->in_recursion = FALSE;
@@ -576,6 +607,9 @@ gtk_paned_set_property (GObject        *
   
   switch (prop_id)
     {
+    case PROP_ORIENTATION:
+      gtk_paned_set_orientation (paned, g_value_get_enum (value));
+      break;
     case PROP_POSITION:
       gtk_paned_set_position (paned, g_value_get_int (value));
       break;
@@ -599,6 +633,9 @@ gtk_paned_get_property (GObject        *
   
   switch (prop_id)
     {
+    case PROP_ORIENTATION:
+      g_value_set_enum (value, gtk_paned_get_orientation (paned));
+      break;
     case PROP_POSITION:
       g_value_set_int (value, paned->child1_size);
       break;
@@ -708,6 +745,224 @@ gtk_paned_finalize (GObject *object)
 }
 
 static void
+gtk_paned_size_request (GtkWidget      *widget,
+                        GtkRequisition *requisition)
+{
+  GtkPaned *paned = GTK_PANED (widget);
+  GtkRequisition child_requisition;
+
+  requisition->width = 0;
+  requisition->height = 0;
+
+  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
+    {
+      gtk_widget_size_request (paned->child1, &child_requisition);
+
+      requisition->height = child_requisition.height;
+      requisition->width = child_requisition.width;
+    }
+
+  if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+    {
+      gtk_widget_size_request (paned->child2, &child_requisition);
+
+      if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+        {
+          requisition->height = MAX (requisition->height,
+                                     child_requisition.height);
+          requisition->width += child_requisition.width;
+        }
+      else
+        {
+          requisition->width = MAX (requisition->width,
+                                    child_requisition.width);
+          requisition->height += child_requisition.height;
+        }
+    }
+
+  requisition->width += GTK_CONTAINER (paned)->border_width * 2;
+  requisition->height += GTK_CONTAINER (paned)->border_width * 2;
+
+  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
+      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+    {
+      gint handle_size;
+
+      gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
+
+      if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+        requisition->width += handle_size;
+      else
+        requisition->height += handle_size;
+    }
+}
+
+static void
+flip_child (GtkWidget     *widget,
+            GtkAllocation *child_pos)
+{
+  gint x     = widget->allocation.x;
+  gint width = widget->allocation.width;
+
+  child_pos->x = 2 * x + width - child_pos->x - child_pos->width;
+}
+
+static void
+gtk_paned_size_allocate (GtkWidget     *widget,
+                         GtkAllocation *allocation)
+{
+  GtkPaned *paned = GTK_PANED (widget);
+  gint border_width = GTK_CONTAINER (paned)->border_width;
+
+  widget->allocation = *allocation;
+
+  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
+      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+    {
+      GtkRequisition child1_requisition;
+      GtkRequisition child2_requisition;
+      GtkAllocation child1_allocation;
+      GtkAllocation child2_allocation;
+      GdkRectangle old_handle_pos;
+      gint handle_size;
+
+      gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
+
+      gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
+      gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
+
+      old_handle_pos = paned->handle_pos;
+
+      if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+        {
+          gtk_paned_compute_position (paned,
+                                      MAX (1, widget->allocation.width
+                                           - handle_size
+                                           - 2 * border_width),
+                                      child1_requisition.width,
+                                      child2_requisition.width);
+
+          paned->handle_pos.x = widget->allocation.x + paned->child1_size + border_width;
+          paned->handle_pos.y = widget->allocation.y + border_width;
+          paned->handle_pos.width = handle_size;
+          paned->handle_pos.height = MAX (1, widget->allocation.height - 2 * border_width);
+
+          child1_allocation.height = child2_allocation.height = MAX (1, (gint) allocation->height - border_width * 2);
+          child1_allocation.width = MAX (1, paned->child1_size);
+          child1_allocation.x = widget->allocation.x + border_width;
+          child1_allocation.y = child2_allocation.y = widget->allocation.y + border_width;
+
+          child2_allocation.x = child1_allocation.x + paned->child1_size + paned->handle_pos.width;
+          child2_allocation.width = MAX (1, widget->allocation.x + widget->allocation.width - child2_allocation.x - border_width);
+
+          if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL)
+            {
+              flip_child (widget, &(child2_allocation));
+              flip_child (widget, &(child1_allocation));
+              flip_child (widget, &(paned->handle_pos));
+            }
+        }
+      else
+        {
+          gtk_paned_compute_position (paned,
+                                      MAX (1, widget->allocation.height
+                                           - handle_size
+                                           - 2 * border_width),
+                                      child1_requisition.height,
+                                      child2_requisition.height);
+
+          paned->handle_pos.x = widget->allocation.x + border_width;
+          paned->handle_pos.y = widget->allocation.y + paned->child1_size + border_width;
+          paned->handle_pos.width = MAX (1, (gint) widget->allocation.width - 2 * border_width);
+          paned->handle_pos.height = handle_size;
+
+          child1_allocation.width = child2_allocation.width = MAX (1, (gint) allocation->width - border_width * 2);
+          child1_allocation.height = MAX (1, paned->child1_size);
+          child1_allocation.x = child2_allocation.x = widget->allocation.x + border_width;
+          child1_allocation.y = widget->allocation.y + border_width;
+
+          child2_allocation.y = child1_allocation.y + paned->child1_size + paned->handle_pos.height;
+          child2_allocation.height = MAX (1, widget->allocation.y + widget->allocation.height - child2_allocation.y - border_width);
+        }
+
+      if (GTK_WIDGET_MAPPED (widget) &&
+          (old_handle_pos.x != paned->handle_pos.x ||
+           old_handle_pos.y != paned->handle_pos.y ||
+           old_handle_pos.width != paned->handle_pos.width ||
+           old_handle_pos.height != paned->handle_pos.height))
+        {
+          gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
+          gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
+        }
+
+      if (GTK_WIDGET_REALIZED (widget))
+	{
+	  if (GTK_WIDGET_MAPPED (widget))
+	    gdk_window_show (paned->handle);
+
+          if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+            {
+              gdk_window_move_resize (paned->handle,
+                                      paned->handle_pos.x,
+                                      paned->handle_pos.y,
+                                      handle_size,
+                                      paned->handle_pos.height);
+            }
+          else
+            {
+              gdk_window_move_resize (paned->handle,
+                                      paned->handle_pos.x,
+                                      paned->handle_pos.y,
+                                      paned->handle_pos.width,
+                                      handle_size);
+            }
+	}
+
+      /* Now allocate the childen, making sure, when resizing not to
+       * overlap the windows
+       */
+      if (GTK_WIDGET_MAPPED (widget) &&
+
+          ((paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL &&
+            paned->child1->allocation.width < child1_allocation.width) ||
+
+           (paned->priv->orientation == GTK_ORIENTATION_VERTICAL &&
+            paned->child1->allocation.height < child1_allocation.height)))
+	{
+	  gtk_widget_size_allocate (paned->child2, &child2_allocation);
+	  gtk_widget_size_allocate (paned->child1, &child1_allocation);
+	}
+      else
+	{
+	  gtk_widget_size_allocate (paned->child1, &child1_allocation);
+	  gtk_widget_size_allocate (paned->child2, &child2_allocation);
+	}
+    }
+  else
+    {
+      GtkAllocation child_allocation;
+
+      if (GTK_WIDGET_REALIZED (widget))
+	gdk_window_hide (paned->handle);
+
+      if (paned->child1)
+	gtk_widget_set_child_visible (paned->child1, TRUE);
+      if (paned->child2)
+	gtk_widget_set_child_visible (paned->child2, TRUE);
+
+      child_allocation.x = widget->allocation.x + border_width;
+      child_allocation.y = widget->allocation.y + border_width;
+      child_allocation.width = MAX (1, allocation->width - 2 * border_width);
+      child_allocation.height = MAX (1, allocation->height - 2 * border_width);
+
+      if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
+	gtk_widget_size_allocate (paned->child1, &child_allocation);
+      else if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
+	gtk_widget_size_allocate (paned->child2, &child_allocation);
+    }
+}
+
+static void
 gtk_paned_realize (GtkWidget *widget)
 {
   GtkPaned *paned;
@@ -824,7 +1079,7 @@ gtk_paned_expose (GtkWidget      *widget
 			&paned->handle_pos, widget, "paned",
 			paned->handle_pos.x, paned->handle_pos.y,
 			paned->handle_pos.width, paned->handle_pos.height,
-			paned->orientation);
+			!paned->priv->orientation);
     }
 
   /* Chain up to draw children */
@@ -836,7 +1091,7 @@ gtk_paned_expose (GtkWidget      *widget
 static gboolean
 is_rtl (GtkPaned *paned)
 {
-  if (paned->orientation == GTK_ORIENTATION_VERTICAL &&
+  if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL &&
       gtk_widget_get_direction (GTK_WIDGET (paned)) == GTK_TEXT_DIR_RTL)
     {
       return TRUE;
@@ -851,11 +1106,11 @@ update_drag (GtkPaned *paned)
   gint pos;
   gint handle_size;
   gint size;
-  
-  if (paned->orientation == GTK_ORIENTATION_HORIZONTAL)
-    gtk_widget_get_pointer (GTK_WIDGET (paned), NULL, &pos);
-  else
+
+  if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
     gtk_widget_get_pointer (GTK_WIDGET (paned), &pos, NULL);
+  else
+    gtk_widget_get_pointer (GTK_WIDGET (paned), NULL, &pos);
 
   pos -= paned->drag_pos;
 
@@ -964,11 +1219,11 @@ gtk_paned_button_press (GtkWidget      *
       paned->in_drag = TRUE;
       paned->priv->grab_time = event->time;
 
-      if (paned->orientation == GTK_ORIENTATION_HORIZONTAL)
-	paned->drag_pos = event->y;
-      else
+      if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
 	paned->drag_pos = event->x;
-      
+      else
+	paned->drag_pos = event->y;
+
       return TRUE;
     }
 
@@ -1061,6 +1316,24 @@ gtk_paned_motion (GtkWidget      *widget
   return FALSE;
 }
 
+/**
+ * gtk_paned_new:
+ * @orientation: the paned's orientation.
+ *
+ * Creates a new #GtkPaned widget.
+ *
+ * Return value: a new #GtkPaned.
+ *
+ * Since: 2.16
+ **/
+GtkWidget *
+gtk_paned_new (GtkOrientation orientation)
+{
+  return g_object_new (GTK_TYPE_PANED,
+                       "orientation", orientation,
+                       NULL);
+}
+
 void
 gtk_paned_add1 (GtkPaned  *paned,
 		GtkWidget *widget)
@@ -1181,6 +1454,58 @@ gtk_paned_forall (GtkContainer *containe
 }
 
 /**
+ * gtk_paned_set_orientation:
+ * @paned: a #GtkPaned.
+ * @orientation: the paned's new orientation.
+ *
+ * Sets the paned's orientation.
+ *
+ * Since: 2.16
+ **/
+void
+gtk_paned_set_orientation (GtkPaned       *paned,
+                           GtkOrientation  orientation)
+{
+  g_return_if_fail (GTK_IS_PANED (paned));
+
+  if (paned->priv->orientation != orientation)
+    {
+      paned->priv->orientation = orientation;
+
+      paned->orientation = !paned->priv->orientation;
+
+      if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+        paned->cursor_type = GDK_SB_H_DOUBLE_ARROW;
+      else
+        paned->cursor_type = GDK_SB_V_DOUBLE_ARROW;
+
+      /* state_changed updates the cursor */
+      gtk_paned_state_changed (GTK_WIDGET (paned), GTK_WIDGET (paned)->state);
+      gtk_widget_queue_resize (GTK_WIDGET (paned));
+
+      g_object_notify (G_OBJECT (paned), "orientation");
+    }
+}
+
+/**
+ * gtk_paned_get_orientation:
+ * @paned: a #GtkPaned.
+ *
+ * Returns the paned's orientation.
+ *
+ * Return value: the paned's orientation.
+ *
+ * Since: 2.16
+ **/
+GtkOrientation
+gtk_paned_get_orientation (GtkPaned *paned)
+{
+  g_return_val_if_fail (GTK_IS_PANED (paned), GTK_ORIENTATION_HORIZONTAL);
+
+  return paned->priv->orientation;
+}
+
+/**
  * gtk_paned_get_position:
  * @paned: a #GtkPaned widget
  * 
Index: gtk/gtkpaned.h
===================================================================
--- gtk/gtkpaned.h	(revision 21513)
+++ gtk/gtkpaned.h	(working copy)
@@ -107,25 +107,31 @@ struct _GtkPanedClass
 };
 
 
-GType   gtk_paned_get_type        (void) G_GNUC_CONST;
-void    gtk_paned_add1            (GtkPaned  *paned,
-				   GtkWidget *child);
-void    gtk_paned_add2            (GtkPaned  *paned,
-				   GtkWidget *child);
-void    gtk_paned_pack1           (GtkPaned  *paned,
-				   GtkWidget *child,
-				   gboolean   resize,
-				   gboolean   shrink);
-void    gtk_paned_pack2           (GtkPaned  *paned,
-				   GtkWidget *child,
-				   gboolean   resize,
-				   gboolean   shrink);
-gint    gtk_paned_get_position    (GtkPaned  *paned);
-void    gtk_paned_set_position    (GtkPaned  *paned,
-				   gint       position);
+GType            gtk_paned_get_type        (void) G_GNUC_CONST;
+GtkWidget      * gtk_paned_new             (GtkOrientation  orientation);
 
-GtkWidget *gtk_paned_get_child1   (GtkPaned  *paned);
-GtkWidget *gtk_paned_get_child2   (GtkPaned  *paned);
+void             gtk_paned_add1            (GtkPaned       *paned,
+					    GtkWidget      *child);
+void             gtk_paned_add2            (GtkPaned       *paned,
+					    GtkWidget      *child);
+void             gtk_paned_pack1           (GtkPaned       *paned,
+					    GtkWidget      *child,
+					    gboolean        resize,
+					    gboolean        shrink);
+void             gtk_paned_pack2           (GtkPaned       *paned,
+					    GtkWidget      *child,
+					    gboolean        resize,
+					    gboolean        shrink);
+
+void             gtk_paned_set_orientation (GtkPaned       *paned,
+                                            GtkOrientation  orientation);
+GtkOrientation   gtk_paned_get_orientation (GtkPaned       *paned);
+gint             gtk_paned_get_position    (GtkPaned       *paned);
+void             gtk_paned_set_position    (GtkPaned       *paned,
+					    gint            position);
+
+GtkWidget      * gtk_paned_get_child1      (GtkPaned       *paned);
+GtkWidget      * gtk_paned_get_child2      (GtkPaned       *paned);
 
 /* Internal function */
 #if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
Index: gtk/gtkhpaned.c
===================================================================
--- gtk/gtkhpaned.c	(revision 21513)
+++ gtk/gtkhpaned.c	(working copy)
@@ -21,208 +21,30 @@
  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  * file for a list of people on the GTK+ Team.  See the ChangeLog
  * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
 #include "config.h"
 #include "gtkhpaned.h"
-#include "gtkintl.h"
 #include "gtkalias.h"
 
-static void     gtk_hpaned_size_request   (GtkWidget      *widget,
-					   GtkRequisition *requisition);
-static void     gtk_hpaned_size_allocate  (GtkWidget      *widget,
-					   GtkAllocation  *allocation);
-
 G_DEFINE_TYPE (GtkHPaned, gtk_hpaned, GTK_TYPE_PANED)
 
 static void
 gtk_hpaned_class_init (GtkHPanedClass *class)
 {
-  GtkWidgetClass *widget_class;
-
-  widget_class = (GtkWidgetClass *) class;
-
-  widget_class->size_request = gtk_hpaned_size_request;
-  widget_class->size_allocate = gtk_hpaned_size_allocate;
 }
 
 static void
 gtk_hpaned_init (GtkHPaned *hpaned)
 {
-  GtkPaned *paned = GTK_PANED (hpaned);
-
-  paned->cursor_type = GDK_SB_H_DOUBLE_ARROW;
-  paned->orientation = GTK_ORIENTATION_VERTICAL;
+  g_object_set (hpaned, "orientation", GTK_ORIENTATION_HORIZONTAL, NULL);
 }
 
 GtkWidget *
 gtk_hpaned_new (void)
 {
-  GtkHPaned *hpaned;
-
-  hpaned = g_object_new (GTK_TYPE_HPANED, NULL);
-
-  return GTK_WIDGET (hpaned);
-}
-
-static void
-gtk_hpaned_size_request (GtkWidget      *widget,
-			 GtkRequisition *requisition)
-{
-  GtkPaned *paned = GTK_PANED (widget);
-  GtkRequisition child_requisition;
-
-  requisition->width = 0;
-  requisition->height = 0;
-
-  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
-    {
-      gtk_widget_size_request (paned->child1, &child_requisition);
-
-      requisition->height = child_requisition.height;
-      requisition->width = child_requisition.width;
-    }
-
-  if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-    {
-      gtk_widget_size_request (paned->child2, &child_requisition);
-
-      requisition->height = MAX(requisition->height, child_requisition.height);
-      requisition->width += child_requisition.width;
-    }
-
-  requisition->width += GTK_CONTAINER (paned)->border_width * 2;
-  requisition->height += GTK_CONTAINER (paned)->border_width * 2;
-
-  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
-      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-    {
-      gint handle_size;
-      
-      gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
-      requisition->width += handle_size;
-    }
-}
-
-static void
-flip_child (GtkWidget *widget, GtkAllocation *child_pos)
-{
-  gint x = widget->allocation.x;
-  gint width = widget->allocation.width;
-
-  child_pos->x = 2 * x + width - child_pos->x - child_pos->width;
-}
-
-static void
-gtk_hpaned_size_allocate (GtkWidget     *widget,
-			  GtkAllocation *allocation)
-{
-  GtkPaned *paned = GTK_PANED (widget);
-  gint border_width = GTK_CONTAINER (paned)->border_width;
-
-  widget->allocation = *allocation;
-
-  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
-      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-    {
-      GtkAllocation child1_allocation;
-      GtkAllocation child2_allocation;
-      GtkRequisition child1_requisition;
-      GtkRequisition child2_requisition;
-      GdkRectangle old_handle_pos;
-      gint handle_size;
-      
-      gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
-
-      gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
-      gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
-      
-      gtk_paned_compute_position (paned,
-				  MAX (1, widget->allocation.width
-				       - handle_size
-				       - 2 * border_width),
-				  child1_requisition.width,
-				  child2_requisition.width);
-
-      old_handle_pos = paned->handle_pos;
-      
-      paned->handle_pos.x = widget->allocation.x + paned->child1_size + border_width;
-      paned->handle_pos.y = widget->allocation.y + border_width;
-      paned->handle_pos.width = handle_size;
-      paned->handle_pos.height = MAX (1, widget->allocation.height - 2 * border_width);
-
-      child1_allocation.height = child2_allocation.height = MAX (1, (gint) allocation->height - border_width * 2);
-      child1_allocation.width = MAX (1, paned->child1_size);
-      child1_allocation.x = widget->allocation.x + border_width;
-      child1_allocation.y = child2_allocation.y = widget->allocation.y + border_width;
-      
-      child2_allocation.x = child1_allocation.x + paned->child1_size + paned->handle_pos.width;
-      child2_allocation.width = MAX (1, widget->allocation.x + widget->allocation.width - child2_allocation.x - border_width);
-
-      if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL)
-	{
-	  flip_child (widget, &(child2_allocation));
-	  flip_child (widget, &(child1_allocation));
-	  flip_child (widget, &(paned->handle_pos));
-	}
-      
-      if (GTK_WIDGET_MAPPED (widget) &&
-	  (old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y ||
-	   old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height))
-	{
-	  gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
-	  gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
-	}
-
-      if (GTK_WIDGET_REALIZED (widget))
-	{
-	  if (GTK_WIDGET_MAPPED (widget))
-	    gdk_window_show (paned->handle);
-	  gdk_window_move_resize (paned->handle,
-				  paned->handle_pos.x,
-				  paned->handle_pos.y,
-				  handle_size,
-				  paned->handle_pos.height);
-	}
-      
-      /* Now allocate the childen, making sure, when resizing not to
-       * overlap the windows
-       */
-      if (GTK_WIDGET_MAPPED (widget) &&
-	  paned->child1->allocation.width < child1_allocation.width)
-	{
-	  gtk_widget_size_allocate (paned->child2, &child2_allocation);
-	  gtk_widget_size_allocate (paned->child1, &child1_allocation);
-	}
-      else
-	{
-	  gtk_widget_size_allocate (paned->child1, &child1_allocation);
-	  gtk_widget_size_allocate (paned->child2, &child2_allocation);
-	}
-    }
-  else
-    {
-      GtkAllocation child_allocation;
-
-      if (GTK_WIDGET_REALIZED (widget))      
-	gdk_window_hide (paned->handle);
-
-      if (paned->child1)
-	gtk_widget_set_child_visible (paned->child1, TRUE);
-      if (paned->child2)
-	gtk_widget_set_child_visible (paned->child2, TRUE);
-
-      child_allocation.x = widget->allocation.x + border_width;
-      child_allocation.y = widget->allocation.y + border_width;
-      child_allocation.width = MAX (1, allocation->width - 2 * border_width);
-      child_allocation.height = MAX (1, allocation->height - 2 * border_width);
-      
-      if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
-	gtk_widget_size_allocate (paned->child1, &child_allocation);
-      else if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-	gtk_widget_size_allocate (paned->child2, &child_allocation);
-    }
+  return g_object_new (GTK_TYPE_HPANED, NULL);
 }
 
 #define __GTK_HPANED_C__
Index: gtk/gtkhpaned.h
===================================================================
--- gtk/gtkhpaned.h	(revision 21513)
+++ gtk/gtkhpaned.h	(working copy)
@@ -56,6 +56,7 @@ struct _GtkHPanedClass
   GtkPanedClass parent_class;
 };
 
+
 GType      gtk_hpaned_get_type (void) G_GNUC_CONST;
 GtkWidget *gtk_hpaned_new      (void);
 
Index: gtk/gtkvpaned.c
===================================================================
--- gtk/gtkvpaned.c	(revision 21513)
+++ gtk/gtkvpaned.c	(working copy)
@@ -21,196 +21,30 @@
  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  * file for a list of people on the GTK+ Team.  See the ChangeLog
  * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
 #include "config.h"
 #include "gtkvpaned.h"
-#include "gtkintl.h"
 #include "gtkalias.h"
 
-static void     gtk_vpaned_size_request   (GtkWidget      *widget,
-					   GtkRequisition *requisition);
-static void     gtk_vpaned_size_allocate  (GtkWidget      *widget,
-					   GtkAllocation  *allocation);
-
 G_DEFINE_TYPE (GtkVPaned, gtk_vpaned, GTK_TYPE_PANED)
 
 static void
 gtk_vpaned_class_init (GtkVPanedClass *class)
 {
-  GtkWidgetClass *widget_class;
-
-  widget_class = (GtkWidgetClass *) class;
-
-  widget_class->size_request = gtk_vpaned_size_request;
-  widget_class->size_allocate = gtk_vpaned_size_allocate;
 }
 
 static void
 gtk_vpaned_init (GtkVPaned *vpaned)
 {
-  GtkPaned *paned;
-
-  g_return_if_fail (GTK_IS_PANED (vpaned));
-
-  paned = GTK_PANED (vpaned);
-
-  paned->cursor_type = GDK_SB_V_DOUBLE_ARROW;
-  paned->orientation = GTK_ORIENTATION_HORIZONTAL;
+  g_object_set (vpaned, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
 }
 
 GtkWidget *
 gtk_vpaned_new (void)
 {
-  GtkVPaned *vpaned;
-
-  vpaned = g_object_new (GTK_TYPE_VPANED, NULL);
-
-  return GTK_WIDGET (vpaned);
-}
-
-static void
-gtk_vpaned_size_request (GtkWidget      *widget,
-			 GtkRequisition *requisition)
-{
-  GtkPaned *paned = GTK_PANED (widget);
-  GtkRequisition child_requisition;
-
-  requisition->width = 0;
-  requisition->height = 0;
-
-  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
-    {
-      gtk_widget_size_request (paned->child1, &child_requisition);
-
-      requisition->height = child_requisition.height;
-      requisition->width = child_requisition.width;
-    }
-
-  if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-    {
-      gtk_widget_size_request (paned->child2, &child_requisition);
-
-      requisition->width = MAX (requisition->width, child_requisition.width);
-      requisition->height += child_requisition.height;
-    }
-
-  requisition->height += GTK_CONTAINER (paned)->border_width * 2;
-  requisition->width += GTK_CONTAINER (paned)->border_width * 2;
-  
-  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
-      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-    {
-      gint handle_size;
-
-      gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
-      requisition->height += handle_size;
-    }
-}
-
-static void
-gtk_vpaned_size_allocate (GtkWidget     *widget,
-			  GtkAllocation *allocation)
-{
-  GtkPaned *paned = GTK_PANED (widget);
-  gint border_width = GTK_CONTAINER (paned)->border_width;
-
-  widget->allocation = *allocation;
-
-  if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1) &&
-      paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-    {
-      GtkRequisition child1_requisition;
-      GtkRequisition child2_requisition;
-      GtkAllocation child1_allocation;
-      GtkAllocation child2_allocation;
-      GdkRectangle old_handle_pos;
-      gint handle_size;
-      
-      gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
-
-      gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
-      gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
-    
-      gtk_paned_compute_position (paned,
-				  MAX (1, widget->allocation.height
-				       - handle_size
-				       - 2 * border_width),
-				  child1_requisition.height,
-				  child2_requisition.height);
-
-      old_handle_pos = paned->handle_pos;
-
-      paned->handle_pos.x = widget->allocation.x + border_width;
-      paned->handle_pos.y = widget->allocation.y + paned->child1_size + border_width;
-      paned->handle_pos.width = MAX (1, (gint) widget->allocation.width - 2 * border_width);
-      paned->handle_pos.height = handle_size;
-      
-      if (GTK_WIDGET_MAPPED (widget) &&
-	  (old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y ||
-	   old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height))
-	{
-	  gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
-	  gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
-	}
-
-      if (GTK_WIDGET_REALIZED (widget))
-	{
-	  if (GTK_WIDGET_MAPPED (widget))
-	    gdk_window_show (paned->handle);
-	  gdk_window_move_resize (paned->handle,
-				  paned->handle_pos.x,
-				  paned->handle_pos.y,
-				  paned->handle_pos.width,
-				  handle_size);
-	}
-
-      child1_allocation.width = child2_allocation.width = MAX (1, (gint) allocation->width - border_width * 2);
-      child1_allocation.height = MAX (1, paned->child1_size);
-      child1_allocation.x = child2_allocation.x = widget->allocation.x + border_width;
-      child1_allocation.y = widget->allocation.y + border_width;
-      
-      child2_allocation.y = child1_allocation.y + paned->child1_size + paned->handle_pos.height;
-      child2_allocation.height = MAX (1, widget->allocation.y + widget->allocation.height - child2_allocation.y - border_width);
-      
-      /* Now allocate the childen, making sure, when resizing not to
-       * overlap the windows
-       */
-      if (GTK_WIDGET_MAPPED (widget) &&
-	  paned->child1->allocation.height < child1_allocation.height)
-	{
-	  gtk_widget_size_allocate (paned->child2, &child2_allocation);
-	  gtk_widget_size_allocate (paned->child1, &child1_allocation);
-	}
-      else
-	{
-	  gtk_widget_size_allocate (paned->child1, &child1_allocation);
-	  gtk_widget_size_allocate (paned->child2, &child2_allocation);
-	}
-    }
-  else
-    {
-      GtkAllocation child_allocation;
-
-      if (GTK_WIDGET_REALIZED (widget))      
-	gdk_window_hide (paned->handle);
-
-      if (paned->child1)
-	gtk_widget_set_child_visible (paned->child1, TRUE);
-      if (paned->child2)
-	gtk_widget_set_child_visible (paned->child2, TRUE);
-
-      child_allocation.x = widget->allocation.x + border_width;
-      child_allocation.y = widget->allocation.y + border_width;
-      child_allocation.width = MAX (1, allocation->width - 2 * border_width);
-      child_allocation.height = MAX (1, allocation->height - 2 * border_width);
-      
-      if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
-	gtk_widget_size_allocate (paned->child1, &child_allocation);
-      else if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
-	gtk_widget_size_allocate (paned->child2, &child_allocation);
-    }
+  return g_object_new (GTK_TYPE_VPANED, NULL);
 }
 
 #define __GTK_VPANED_C__
Index: gtk/gtkvpaned.h
===================================================================
--- gtk/gtkvpaned.h	(revision 21513)
+++ gtk/gtkvpaned.h	(working copy)
@@ -33,10 +33,8 @@
 
 #include <gtk/gtkpaned.h>
 
-
 G_BEGIN_DECLS
 
-
 #define GTK_TYPE_VPANED            (gtk_vpaned_get_type ())
 #define GTK_VPANED(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VPANED, GtkVPaned))
 #define GTK_VPANED_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VPANED, GtkVPanedClass))
@@ -58,11 +56,10 @@ struct _GtkVPanedClass
   GtkPanedClass parent_class;
 };
 
+
 GType      gtk_vpaned_get_type (void) G_GNUC_CONST;
 GtkWidget *gtk_vpaned_new      (void);
 
-
 G_END_DECLS
 
-
 #endif /* __GTK_VPANED_H__ */
