[gdl] Fixed remaining sealings and deprecated symbols (bgo#612497, bgo#577460)



commit b3eecbce1e85e1d19da4250f8550a69f09c68cbe
Author: Johannes Schmid <jhs gnome org>
Date:   Tue Jun 22 18:26:42 2010 +0200

    Fixed remaining sealings and deprecated symbols (bgo#612497, bgo#577460)
    
    There is still an issue with button->in_button left that needs fixing in gtk+

 configure.in             |    2 +-
 gdl/gdl-dock-bar.c       |  793 +++++++++++++++++++++++-----------------------
 gdl/gdl-dock-item-grip.c |    6 +-
 gdl/gdl-dock-item.c      |   26 +-
 gdl/gdl-dock-master.c    |    7 +-
 gdl/gdl-dock-paned.c     |   28 +-
 gdl/gdl-dock-tablabel.c  |    7 +-
 gdl/gdl-dock.c           |   28 +-
 gdl/gdl-switcher.c       |   32 +-
 gdl/test-dock.c          |    2 +-
 10 files changed, 470 insertions(+), 461 deletions(-)
---
diff --git a/configure.in b/configure.in
index b5c059c..415cac3 100644
--- a/configure.in
+++ b/configure.in
@@ -49,7 +49,7 @@ AC_SUBST(GDL_VERSION)
 SNAPSHOT=0_`date +%Y%m%d_%H%M%S`_cvs
 AC_SUBST(SNAPSHOT)
 
-GTK_REQUIRED=2.19.7
+GTK_REQUIRED=2.20.0
 XML_REQUIRED=2.2.8
 
 AC_SUBST(GTK_REQUIRED)
diff --git a/gdl/gdl-dock-bar.c b/gdl/gdl-dock-bar.c
index 2827bc4..97a60c6 100644
--- a/gdl/gdl-dock-bar.c
+++ b/gdl/gdl-dock-bar.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
  *
  * This file is part of the GNOME Devtools Libraries.
  *
@@ -457,474 +457,479 @@ static void gdl_dock_bar_size_allocate (GtkWidget *widget,
 }
 
 static void gdl_dock_bar_size_vrequest (GtkWidget *widget,
-		                       GtkRequisition *requisition )
+                                        GtkRequisition *requisition )
 {
-  GtkBox *box;
-  GtkBoxChild *child;
-  GtkRequisition child_requisition;
-  GList *children;
-  gint nvis_children;
-  gint height;
-  guint border_width;
-
-  box = GTK_BOX (widget);
-  requisition->width = 0;
-  requisition->height = 0;
-  nvis_children = 0;
-
-  children = gtk_container_get_children (GTK_CONTAINER (box));
-  while (children)
+    GtkBox *box;
+    GtkBoxChild *child;
+    GtkRequisition child_requisition;
+    GList *children;
+    gint nvis_children;
+    gint height;
+    guint border_width;
+
+    box = GTK_BOX (widget);
+    requisition->width = 0;
+    requisition->height = 0;
+    nvis_children = 0;
+
+    children = gtk_container_get_children (GTK_CONTAINER (box));
+    while (children)
     {
-      child = children->data;
-      children = children->next;
-
-      if (gtk_widget_get_visible (child->widget))
-	{
-	  gtk_widget_size_request (child->widget, &child_requisition);
-
-	  if (gtk_box_get_homogeneous (box))
-	    {
-	      height = child_requisition.height + child->padding * 2;
-	      requisition->height = MAX (requisition->height, height);
-	    }
-	  else
-	    {
-	      requisition->height += child_requisition.height + child->padding * 2;
-	    }
-
-	  requisition->width = MAX (requisition->width, child_requisition.width);
-
-	  nvis_children += 1;
-	}
+        child = children->data;
+        children = children->next;
+
+        if (gtk_widget_get_visible (child->widget))
+        {
+            gtk_widget_size_request (child->widget, &child_requisition);
+
+            if (gtk_box_get_homogeneous (box))
+            {
+                height = child_requisition.height + child->padding * 2;
+                requisition->height = MAX (requisition->height, height);
+            }
+            else
+            {
+                requisition->height += child_requisition.height + child->padding * 2;
+            }
+
+            requisition->width = MAX (requisition->width, child_requisition.width);
+
+            nvis_children += 1;
+        }
     }
 
-  if (nvis_children > 0)
+    if (nvis_children > 0)
     {
-      if (gtk_box_get_homogeneous (box))
-	requisition->height *= nvis_children;
-      requisition->height += (nvis_children - 1) * gtk_box_get_spacing (box);
+        if (gtk_box_get_homogeneous (box))
+            requisition->height *= nvis_children;
+        requisition->height += (nvis_children - 1) * gtk_box_get_spacing (box);
     }
 
-  border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
-  requisition->width += border_width * 2;
-  requisition->height += border_width * 2;
+    border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
+    requisition->width += border_width * 2;
+    requisition->height += border_width * 2;
 
 }
 
 static void gdl_dock_bar_size_vallocate (GtkWidget     *widget,
-			GtkAllocation *allocation)
+                                         GtkAllocation *allocation)
 {
-  GtkBox *box;
-  GtkBoxChild *child;
-  GList *children;
-  GtkAllocation child_allocation;
-  gint nvis_children;
-  gint nexpand_children;
-  gint child_height;
-  gint height;
-  gint extra;
-  gint y;
-  guint border_width;
-
-  box = GTK_BOX (widget);
-  widget->allocation = *allocation;
-
-  nvis_children = 0;
-  nexpand_children = 0;
-  children = gtk_container_get_children (GTK_CONTAINER (box));
-
-  while (children)
+    GtkBox *box;
+    GtkBoxChild *child;
+    GList *children;
+    GtkAllocation child_allocation;
+    gint nvis_children;
+    gint nexpand_children;
+    gint child_height;
+    gint height;
+    gint extra;
+    gint y;
+    guint border_width;
+    GtkRequisition requisition;
+
+    box = GTK_BOX (widget);
+    gtk_widget_set_allocation (widget, allocation);
+
+    gtk_widget_get_requisition (widget, &requisition);
+
+    nvis_children = 0;
+    nexpand_children = 0;
+    children = gtk_container_get_children (GTK_CONTAINER (box));
+
+    while (children)
     {
-      child = children->data;
-      children = children->next;
-
-      if (gtk_widget_get_visible (child->widget))
-	{
-	  nvis_children += 1;
-	  if (child->expand)
-	    nexpand_children += 1;
-	}
+        child = children->data;
+        children = children->next;
+
+        if (gtk_widget_get_visible (child->widget))
+        {
+            nvis_children += 1;
+            if (child->expand)
+                nexpand_children += 1;
+        }
     }
 
-  border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
+    border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
 
-  if (nvis_children > 0)
+    if (nvis_children > 0)
     {
-      if (gtk_box_get_homogeneous (box))
-	{
-	  height = (allocation->height -
-		   border_width * 2 -
-		   (nvis_children - 1) * gtk_box_get_spacing (box));
-	  extra = height / nvis_children;
-	}
-      else if (nexpand_children > 0)
-	{
-	  height = (gint) allocation->height - (gint) widget->requisition.height;
-	  extra = height / nexpand_children;
-	}
-      else
-	{
-	  height = 0;
-	  extra = 0;
-	}
-
-      y = allocation->y + border_width;
-      child_allocation.x = allocation->x + border_width;
-      child_allocation.width = MAX (1, (gint) allocation->width - (gint) border_width * 2);
-
-      children = gtk_container_get_children (GTK_CONTAINER (box));
-      while (children)
-	{
-	  child = children->data;
-	  children = children->next;
-
-	  if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
-	    {
-	      if (gtk_box_get_homogeneous (box))
-		{
-		  if (nvis_children == 1)
-		    child_height = height;
-		  else
-		    child_height = extra;
-
-		  nvis_children -= 1;
-		  height -= extra;
-		}
-	      else
-		{
-		  GtkRequisition child_requisition;
-
-		  gtk_widget_get_child_requisition (child->widget, &child_requisition);
-		  child_height = child_requisition.height + child->padding * 2;
-
-		  if (child->expand)
-		    {
-		      if (nexpand_children == 1)
-			child_height += height;
-		      else
-			child_height += extra;
-
-		      nexpand_children -= 1;
-		      height -= extra;
-		    }
-		}
-
-	      if (child->fill)
-		{
-		  child_allocation.height = MAX (1, child_height - (gint)child->padding * 2);
-		  child_allocation.y = y + child->padding;
-		}
-	      else
-		{
-		  GtkRequisition child_requisition;
-
-		  gtk_widget_get_child_requisition (child->widget, &child_requisition);
-		  child_allocation.height = child_requisition.height;
-		  child_allocation.y = y + (child_height - child_allocation.height) / 2;
-		}
-
-	      gtk_widget_size_allocate (child->widget, &child_allocation);
-
-	      y += child_height + gtk_box_get_spacing (box);
-	    }
-	}
-
-      y = allocation->y + allocation->height - border_width;
-
-      children = gtk_container_get_children (GTK_CONTAINER (box));
-      while (children)
-	{
-	  child = children->data;
-	  children = children->next;
-
-	  if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget))
-	    {
-	      GtkRequisition child_requisition;
-	      gtk_widget_get_child_requisition (child->widget, &child_requisition);
-
-              if (gtk_box_get_homogeneous (box))
+        if (gtk_box_get_homogeneous (box))
+        {
+            height = (allocation->height -
+                      border_width * 2 -
+                      (nvis_children - 1) * gtk_box_get_spacing (box));
+            extra = height / nvis_children;
+        }
+        else if (nexpand_children > 0)
+        {
+            height = (gint) allocation->height - (gint) requisition.height;
+            extra = height / nexpand_children;
+        }
+        else
+        {
+            height = 0;
+            extra = 0;
+        }
+
+        y = allocation->y + border_width;
+        child_allocation.x = allocation->x + border_width;
+        child_allocation.width = MAX (1, (gint) allocation->width - (gint) border_width * 2);
+
+        children = gtk_container_get_children (GTK_CONTAINER (box));
+        while (children)
+        {
+            child = children->data;
+            children = children->next;
+
+            if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
+            {
+                if (gtk_box_get_homogeneous (box))
+                {
+                    if (nvis_children == 1)
+                        child_height = height;
+                    else
+                        child_height = extra;
+
+                    nvis_children -= 1;
+                    height -= extra;
+                }
+                else
+                {
+                    GtkRequisition child_requisition;
+
+                    gtk_widget_get_child_requisition (child->widget, &child_requisition);
+                    child_height = child_requisition.height + child->padding * 2;
+
+                    if (child->expand)
+                    {
+                        if (nexpand_children == 1)
+                            child_height += height;
+                        else
+                            child_height += extra;
+
+                        nexpand_children -= 1;
+                        height -= extra;
+                    }
+                }
+
+                if (child->fill)
+                {
+                    child_allocation.height = MAX (1, child_height - (gint)child->padding * 2);
+                    child_allocation.y = y + child->padding;
+                }
+                else
                 {
-                  if (nvis_children == 1)
-                    child_height = height;
-                  else
-                    child_height = extra;
+                    GtkRequisition child_requisition;
 
-                  nvis_children -= 1;
-                  height -= extra;
+                    gtk_widget_get_child_requisition (child->widget, &child_requisition);
+                    child_allocation.height = child_requisition.height;
+                    child_allocation.y = y + (child_height - child_allocation.height) / 2;
                 }
-              else
+
+                gtk_widget_size_allocate (child->widget, &child_allocation);
+
+                y += child_height + gtk_box_get_spacing (box);
+            }
+        }
+
+        y = allocation->y + allocation->height - border_width;
+
+        children = gtk_container_get_children (GTK_CONTAINER (box));
+        while (children)
+        {
+            child = children->data;
+            children = children->next;
+
+            if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget))
+            {
+                GtkRequisition child_requisition;
+                gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
+                if (gtk_box_get_homogeneous (box))
+                {
+                    if (nvis_children == 1)
+                        child_height = height;
+                    else
+                        child_height = extra;
+
+                    nvis_children -= 1;
+                    height -= extra;
+                }
+                else
                 {
-		  child_height = child_requisition.height + child->padding * 2;
+                    child_height = child_requisition.height + child->padding * 2;
 
-                  if (child->expand)
+                    if (child->expand)
                     {
-                      if (nexpand_children == 1)
-                        child_height += height;
-                      else
-                        child_height += extra;
+                        if (nexpand_children == 1)
+                            child_height += height;
+                        else
+                            child_height += extra;
 
-                      nexpand_children -= 1;
-                      height -= extra;
+                        nexpand_children -= 1;
+                        height -= extra;
                     }
                 }
 
-              if (child->fill)
+                if (child->fill)
                 {
-                  child_allocation.height = MAX (1, child_height - (gint)child->padding * 2);
-                  child_allocation.y = y + child->padding - child_height;
+                    child_allocation.height = MAX (1, child_height - (gint)child->padding * 2);
+                    child_allocation.y = y + child->padding - child_height;
                 }
-              else
+                else
                 {
-		  child_allocation.height = child_requisition.height;
-                  child_allocation.y = y + (child_height - child_allocation.height) / 2 - child_height;
+                    child_allocation.height = child_requisition.height;
+                    child_allocation.y = y + (child_height - child_allocation.height) / 2 - child_height;
                 }
 
-              gtk_widget_size_allocate (child->widget, &child_allocation);
+                gtk_widget_size_allocate (child->widget, &child_allocation);
 
-              y -= (child_height + gtk_box_get_spacing (box));
-	    }
-	}
+                y -= (child_height + gtk_box_get_spacing (box));
+            }
+        }
     }
 }
 
 static void gdl_dock_bar_size_hrequest (GtkWidget *widget,
-		                       GtkRequisition *requisition )
+                                        GtkRequisition *requisition )
 {
-  GtkBox *box;
-  GtkBoxChild *child;
-  GList *children;
-  gint nvis_children;
-  gint width;
-  guint border_width;
-
-  box = GTK_BOX (widget);
-  requisition->width = 0;
-  requisition->height = 0;
-  nvis_children = 0;
-
-  children = gtk_container_get_children (GTK_CONTAINER (box));
-  while (children)
+    GtkBox *box;
+    GtkBoxChild *child;
+    GList *children;
+    gint nvis_children;
+    gint width;
+    guint border_width;
+
+    box = GTK_BOX (widget);
+    requisition->width = 0;
+    requisition->height = 0;
+    nvis_children = 0;
+
+    children = gtk_container_get_children (GTK_CONTAINER (box));
+    while (children)
     {
-      child = children->data;
-      children = children->next;
+        child = children->data;
+        children = children->next;
 
-      if (gtk_widget_get_visible (child->widget))
-	{
-	  GtkRequisition child_requisition;
+        if (gtk_widget_get_visible (child->widget))
+        {
+            GtkRequisition child_requisition;
 
-	  gtk_widget_size_request (child->widget, &child_requisition);
+            gtk_widget_size_request (child->widget, &child_requisition);
 
-	  if (gtk_box_get_homogeneous (box))
-	    {
-	      width = child_requisition.width + child->padding * 2;
-	      requisition->width = MAX (requisition->width, width);
-	    }
-	  else
-	    {
-	      requisition->width += child_requisition.width + child->padding * 2;
-	    }
+            if (gtk_box_get_homogeneous (box))
+            {
+                width = child_requisition.width + child->padding * 2;
+                requisition->width = MAX (requisition->width, width);
+            }
+            else
+            {
+                requisition->width += child_requisition.width + child->padding * 2;
+            }
 
-	  requisition->height = MAX (requisition->height, child_requisition.height);
+            requisition->height = MAX (requisition->height, child_requisition.height);
 
-	  nvis_children += 1;
-	}
+            nvis_children += 1;
+        }
     }
 
-  if (nvis_children > 0)
+    if (nvis_children > 0)
     {
-      if (gtk_box_get_homogeneous (box))
-	requisition->width *= nvis_children;
-      requisition->width += (nvis_children - 1) * gtk_box_get_spacing (box);
+        if (gtk_box_get_homogeneous (box))
+            requisition->width *= nvis_children;
+        requisition->width += (nvis_children - 1) * gtk_box_get_spacing (box);
     }
 
-  border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
-  requisition->width += border_width * 2;
-  requisition->height += border_width * 2;
+    border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
+    requisition->width += border_width * 2;
+    requisition->height += border_width * 2;
 }
 
 static void gdl_dock_bar_size_hallocate (GtkWidget     *widget,
-			GtkAllocation *allocation)
+                                         GtkAllocation *allocation)
 {
- GtkBox *box;
-  GtkBoxChild *child;
-  GList *children;
-  GtkAllocation child_allocation;
-  gint nvis_children;
-  gint nexpand_children;
-  gint child_width;
-  gint width;
-  gint extra;
-  gint x;
-  guint border_width;
-  GtkTextDirection direction;
-
-  box = GTK_BOX (widget);
-  widget->allocation = *allocation;
-
-  direction = gtk_widget_get_direction (widget);
-  
-  nvis_children = 0;
-  nexpand_children = 0;
-  children = gtk_container_get_children (GTK_CONTAINER (box));
-
-  while (children)
+    GtkBox *box;
+    GtkBoxChild *child;
+    GList *children;
+    GtkAllocation child_allocation;
+    gint nvis_children;
+    gint nexpand_children;
+    gint child_width;
+    gint width;
+    gint extra;
+    gint x;
+    guint border_width;
+    GtkTextDirection direction;
+    GtkRequisition requisition;
+
+    box = GTK_BOX (widget);
+    gtk_widget_set_allocation (widget, allocation);
+    gtk_widget_get_requisition (widget, &requisition);
+
+    direction = gtk_widget_get_direction (widget);
+
+    nvis_children = 0;
+    nexpand_children = 0;
+    children = gtk_container_get_children (GTK_CONTAINER (box));
+
+    while (children)
     {
-      child = children->data;
-      children = children->next;
-
-      if (gtk_widget_get_visible (child->widget))
-	{
-	  nvis_children += 1;
-	  if (child->expand)
-	    nexpand_children += 1;
-	}
+        child = children->data;
+        children = children->next;
+
+        if (gtk_widget_get_visible (child->widget))
+        {
+            nvis_children += 1;
+            if (child->expand)
+                nexpand_children += 1;
+        }
     }
 
-  border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
+    border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
 
-  if (nvis_children > 0)
+    if (nvis_children > 0)
     {
-      if (gtk_box_get_homogeneous (box))
-	{
-	  width = (allocation->width -
-		   border_width * 2 -
-		   (nvis_children - 1) * gtk_box_get_spacing (box));
-	  extra = width / nvis_children;
-	}
-      else if (nexpand_children > 0)
-	{
-	  width = (gint) allocation->width - (gint) widget->requisition.width;
-	  extra = width / nexpand_children;
-	}
-      else
-	{
-	  width = 0;
-	  extra = 0;
-	}
-
-      x = allocation->x + border_width;
-      child_allocation.y = allocation->y + border_width;
-      child_allocation.height = MAX (1, (gint) allocation->height - (gint) border_width * 2);
-
-      children = gtk_container_get_children (GTK_CONTAINER (box));
-      while (children)
-	{
-	  child = children->data;
-	  children = children->next;
-
-	  if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
-	    {
-	      if (gtk_box_get_homogeneous (box))
-		{
-		  if (nvis_children == 1)
-		    child_width = width;
-		  else
-		    child_width = extra;
-
-		  nvis_children -= 1;
-		  width -= extra;
-		}
-	      else
-		{
-		  GtkRequisition child_requisition;
-
-		  gtk_widget_get_child_requisition (child->widget, &child_requisition);
-
-		  child_width = child_requisition.width + child->padding * 2;
-
-		  if (child->expand)
-		    {
-		      if (nexpand_children == 1)
-			child_width += width;
-		      else
-			child_width += extra;
-
-		      nexpand_children -= 1;
-		      width -= extra;
-		    }
-		}
-
-	      if (child->fill)
-		{
-		  child_allocation.width = MAX (1, (gint) child_width - (gint) child->padding * 2);
-		  child_allocation.x = x + child->padding;
-		}
-	      else
-		{
-		  GtkRequisition child_requisition;
-
-		  gtk_widget_get_child_requisition (child->widget, &child_requisition);
-		  child_allocation.width = child_requisition.width;
-		  child_allocation.x = x + (child_width - child_allocation.width) / 2;
-		}
-
-	      if (direction == GTK_TEXT_DIR_RTL)
-		child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
-
-	      gtk_widget_size_allocate (child->widget, &child_allocation);
-
-	      x += child_width + gtk_box_get_spacing (box);
-	    }
-	}
-
-      x = allocation->x + allocation->width - border_width;
-
-      children = gtk_container_get_children (GTK_CONTAINER (box));
-      while (children)
-	{
-	  child = children->data;
-	  children = children->next;
-
-	  if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget))
-	    {
-	      GtkRequisition child_requisition;
-	      gtk_widget_get_child_requisition (child->widget, &child_requisition);
-
-              if (gtk_box_get_homogeneous (box))
+        if (gtk_box_get_homogeneous (box))
+        {
+            width = (allocation->width -
+                     border_width * 2 -
+                     (nvis_children - 1) * gtk_box_get_spacing (box));
+            extra = width / nvis_children;
+        }
+        else if (nexpand_children > 0)
+        {
+            width = (gint) allocation->width - (gint) requisition.width;
+            extra = width / nexpand_children;
+        }
+        else
+        {
+            width = 0;
+            extra = 0;
+        }
+
+        x = allocation->x + border_width;
+        child_allocation.y = allocation->y + border_width;
+        child_allocation.height = MAX (1, (gint) allocation->height - (gint) border_width * 2);
+
+        children = gtk_container_get_children (GTK_CONTAINER (box));
+        while (children)
+        {
+            child = children->data;
+            children = children->next;
+
+            if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
+            {
+                if (gtk_box_get_homogeneous (box))
+                {
+                    if (nvis_children == 1)
+                        child_width = width;
+                    else
+                        child_width = extra;
+
+                    nvis_children -= 1;
+                    width -= extra;
+                }
+                else
+                {
+                    GtkRequisition child_requisition;
+
+                    gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
+                    child_width = child_requisition.width + child->padding * 2;
+
+                    if (child->expand)
+                    {
+                        if (nexpand_children == 1)
+                            child_width += width;
+                        else
+                            child_width += extra;
+
+                        nexpand_children -= 1;
+                        width -= extra;
+                    }
+                }
+
+                if (child->fill)
+                {
+                    child_allocation.width = MAX (1, (gint) child_width - (gint) child->padding * 2);
+                    child_allocation.x = x + child->padding;
+                }
+                else
                 {
-                  if (nvis_children == 1)
-                    child_width = width;
-                  else
-                    child_width = extra;
+                    GtkRequisition child_requisition;
 
-                  nvis_children -= 1;
-                  width -= extra;
+                    gtk_widget_get_child_requisition (child->widget, &child_requisition);
+                    child_allocation.width = child_requisition.width;
+                    child_allocation.x = x + (child_width - child_allocation.width) / 2;
                 }
-              else
+
+                if (direction == GTK_TEXT_DIR_RTL)
+                    child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
+
+                gtk_widget_size_allocate (child->widget, &child_allocation);
+
+                x += child_width + gtk_box_get_spacing (box);
+            }
+        }
+
+        x = allocation->x + allocation->width - border_width;
+
+        children = gtk_container_get_children (GTK_CONTAINER (box));
+        while (children)
+        {
+            child = children->data;
+            children = children->next;
+
+            if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget))
+            {
+                GtkRequisition child_requisition;
+                gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
+                if (gtk_box_get_homogeneous (box))
                 {
-		  child_width = child_requisition.width + child->padding * 2;
+                    if (nvis_children == 1)
+                        child_width = width;
+                    else
+                        child_width = extra;
 
-                  if (child->expand)
+                    nvis_children -= 1;
+                    width -= extra;
+                }
+                else
+                {
+                    child_width = child_requisition.width + child->padding * 2;
+
+                    if (child->expand)
                     {
-                      if (nexpand_children == 1)
-                        child_width += width;
-                      else
-                        child_width += extra;
+                        if (nexpand_children == 1)
+                            child_width += width;
+                        else
+                            child_width += extra;
 
-                      nexpand_children -= 1;
-                      width -= extra;
+                        nexpand_children -= 1;
+                        width -= extra;
                     }
                 }
 
-              if (child->fill)
+                if (child->fill)
                 {
-                  child_allocation.width = MAX (1, (gint)child_width - (gint)child->padding * 2);
-                  child_allocation.x = x + child->padding - child_width;
+                    child_allocation.width = MAX (1, (gint)child_width - (gint)child->padding * 2);
+                    child_allocation.x = x + child->padding - child_width;
                 }
-              else
+                else
                 {
-		  child_allocation.width = child_requisition.width;
-                  child_allocation.x = x + (child_width - child_allocation.width) / 2 - child_width;
+                    child_allocation.width = child_requisition.width;
+                    child_allocation.x = x + (child_width - child_allocation.width) / 2 - child_width;
                 }
 
-	      if (direction == GTK_TEXT_DIR_RTL)
-		child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
+                if (direction == GTK_TEXT_DIR_RTL)
+                    child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
 
-              gtk_widget_size_allocate (child->widget, &child_allocation);
+                gtk_widget_size_allocate (child->widget, &child_allocation);
 
-              x -= (child_width + gtk_box_get_spacing (box));
-	    }
-	}
+                x -= (child_width + gtk_box_get_spacing (box));
+            }
+        }
     }
 }
 
diff --git a/gdl/gdl-dock-item-grip.c b/gdl/gdl-dock-item-grip.c
index 1997ae9..8bb8465 100644
--- a/gdl/gdl-dock-item-grip.c
+++ b/gdl/gdl-dock-item-grip.c
@@ -259,10 +259,6 @@ gdl_dock_item_grip_close_clicked (GtkWidget       *widget,
     gdl_dock_item_hide_item (grip->item);
 }
 
-#if !GTK_CHECK_VERSION (2, 20, 0)
-  #define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)
-#endif /* GTK < 2.20.0 */
-
 static void
 gdl_dock_item_grip_fix_iconify_button (GdlDockItemGrip *grip)
 {
@@ -294,7 +290,7 @@ gdl_dock_item_grip_fix_iconify_button (GdlDockItemGrip *grip)
     event->crossing.focus = FALSE;
     event->crossing.state = modifiers;
 
-    GTK_BUTTON (iconify_button)->in_button = FALSE;
+    //GTK_BUTTON (iconify_button)->in_button = FALSE;
     g_signal_emit_by_name (iconify_button, "leave-notify-event",
                            event, &ev_ret, 0);
 
diff --git a/gdl/gdl-dock-item.c b/gdl/gdl-dock-item.c
index 2167f94..a7d9461 100644
--- a/gdl/gdl-dock-item.c
+++ b/gdl/gdl-dock-item.c
@@ -786,7 +786,7 @@ gdl_dock_item_size_request (GtkWidget      *widget,
     requisition->width += (border_width + style->xthickness) * 2;
     requisition->height += (border_width + style->ythickness) * 2;
 
-    widget->requisition = *requisition;
+    //gtk_widget_size_request (widget, requisition);    
 }
 
 static void
@@ -1164,21 +1164,21 @@ gdl_dock_item_dock_request (GdlDockObject  *object,
                             gint            y,
                             GdlDockRequest *request)
 {
-    GtkAllocation *alloc;
+    GtkAllocation  alloc;
     gint           rel_x, rel_y;
 
     /* we get (x,y) in our allocation coordinates system */
     
     /* Get item's allocation. */
-    gtk_widget_get_allocation (GTK_WIDGET (object), alloc);
+    gtk_widget_get_allocation (GTK_WIDGET (object), &alloc);
     
     /* Get coordinates relative to our window. */
-    rel_x = x - alloc->x;
-    rel_y = y - alloc->y;
+    rel_x = x - alloc.x;
+    rel_y = y - alloc.y;
 
     /* Location is inside. */
-    if (rel_x > 0 && rel_x < alloc->width &&
-        rel_y > 0 && rel_y < alloc->height) {
+    if (rel_x > 0 && rel_x < alloc.width &&
+        rel_y > 0 && rel_y < alloc.height) {
         float rx, ry;
         GtkRequisition my, other;
         gint divider = -1;
@@ -1188,8 +1188,8 @@ gdl_dock_item_dock_request (GdlDockObject  *object,
         gdl_dock_item_preferred_size (GDL_DOCK_ITEM (object), &my);
         
         /* Calculate location in terms of the available space (0-100%). */
-        rx = (float) rel_x / alloc->width;
-        ry = (float) rel_y / alloc->height;
+        rx = (float) rel_x / alloc.width;
+        ry = (float) rel_y / alloc.height;
 
         /* Determine dock location. */
         if (rx < SPLIT_RATIO) {
@@ -1215,8 +1215,8 @@ gdl_dock_item_dock_request (GdlDockObject  *object,
         /* Reset rectangle coordinates to entire item. */
         request->rect.x = 0;
         request->rect.y = 0;
-        request->rect.width = alloc->width;
-        request->rect.height = alloc->height;
+        request->rect.width = alloc.width;
+        request->rect.height = alloc.height;
 
         /* Calculate docking indicator rectangle size for new locations. Only
            do this when we're not over the item's current location. */
@@ -1251,8 +1251,8 @@ gdl_dock_item_dock_request (GdlDockObject  *object,
 
         /* adjust returned coordinates so they are have the same
            origin as our window */
-        request->rect.x += alloc->x;
-        request->rect.y += alloc->y;
+        request->rect.x += alloc.x;
+        request->rect.y += alloc.y;
         
         /* Set possible target location and return TRUE. */            
         request->target = object;
diff --git a/gdl/gdl-dock-master.c b/gdl/gdl-dock-master.c
index 873e9ac..31dc7a8 100644
--- a/gdl/gdl-dock-master.c
+++ b/gdl/gdl-dock-master.c
@@ -461,7 +461,7 @@ gdl_dock_master_drag_motion (GdlDockItem *item,
     GdlDockMaster  *master;
     GdlDockRequest  my_request, *request;
     GdkWindow      *window;
-    GdkWindow      *widget_window, *dock_window;
+    GdkWindow      *widget_window;
     gint            win_x, win_y;
     gint            x, y;
     GdlDock        *dock = NULL;
@@ -504,8 +504,9 @@ gdl_dock_master_drag_motion (GdlDockItem *item,
         }
     }
 
-    dock_window = gtk_widget_get_window (GTK_WIDGET (dock));
     if (dock) {
+        GdkWindow *dock_window = gtk_widget_get_window (GTK_WIDGET (dock));
+
         /* translate root coordinates into dock object coordinates
            (i.e. widget coordinates) */
         gdk_window_get_origin (dock_window, &win_x, &win_y);
@@ -519,7 +520,9 @@ gdl_dock_master_drag_motion (GdlDockItem *item,
 
         /* try to dock the item in all the docks in the ring in turn */
         for (l = master->toplevel_docks; l; l = l->next) {
+            GdkWindow *dock_window;
             dock = GDL_DOCK (l->data);
+            dock_window = gtk_widget_get_window (GTK_WIDGET (dock));
             /* translate root coordinates into dock object coordinates
                (i.e. widget coordinates) */
             gdk_window_get_origin (dock_window, &win_x, &win_y);
diff --git a/gdl/gdl-dock-paned.c b/gdl/gdl-dock-paned.c
index 3b2289c..2b6bd1b 100644
--- a/gdl/gdl-dock-paned.c
+++ b/gdl/gdl-dock-paned.c
@@ -398,7 +398,7 @@ gdl_dock_paned_dock_request (GdlDockObject  *object,
     GdlDockItem        *item;
     guint               bw;
     gint                rel_x, rel_y;
-    GtkAllocation      *alloc;
+    GtkAllocation       alloc;
     gboolean            may_dock = FALSE;
     GdlDockRequest      my_request;
 
@@ -409,19 +409,19 @@ gdl_dock_paned_dock_request (GdlDockObject  *object,
     item = GDL_DOCK_ITEM (object);
     
     /* Get item's allocation. */
-    gtk_widget_get_allocation (GTK_WIDGET (object), alloc);
+    gtk_widget_get_allocation (GTK_WIDGET (object), &alloc);
     bw = gtk_container_get_border_width (GTK_CONTAINER (object));
 
     /* Get coordinates relative to our window. */
-    rel_x = x - alloc->x;
-    rel_y = y - alloc->y;
+    rel_x = x - alloc.x;
+    rel_y = y - alloc.y;
 
     if (request)
         my_request = *request;
         
     /* Check if coordinates are inside the widget. */
-    if (rel_x > 0 && rel_x < alloc->width &&
-        rel_y > 0 && rel_y < alloc->height) {
+    if (rel_x > 0 && rel_x < alloc.width &&
+        rel_y > 0 && rel_y < alloc.height) {
         GtkRequisition my, other;
         gint divider = -1;
         
@@ -434,8 +434,8 @@ gdl_dock_paned_dock_request (GdlDockObject  *object,
 	/* Set docking indicator rectangle to the widget size. */
         my_request.rect.x = bw;
         my_request.rect.y = bw;
-        my_request.rect.width = alloc->width - 2*bw;
-        my_request.rect.height = alloc->height - 2*bw;
+        my_request.rect.width = alloc.width - 2*bw;
+        my_request.rect.height = alloc.height - 2*bw;
 
         my_request.target = object;
 
@@ -444,7 +444,7 @@ gdl_dock_paned_dock_request (GdlDockObject  *object,
             my_request.position = GDL_DOCK_LEFT;
             my_request.rect.width *= SPLIT_RATIO;
             divider = other.width;
-        } else if (rel_x > alloc->width - bw) {
+        } else if (rel_x > alloc.width - bw) {
             my_request.position = GDL_DOCK_RIGHT;
             my_request.rect.x += my_request.rect.width * (1 - SPLIT_RATIO);
             my_request.rect.width *= SPLIT_RATIO;
@@ -453,7 +453,7 @@ gdl_dock_paned_dock_request (GdlDockObject  *object,
             my_request.position = GDL_DOCK_TOP;
             my_request.rect.height *= SPLIT_RATIO;
             divider = other.height;
-        } else if (rel_y > alloc->height - bw) {
+        } else if (rel_y > alloc.height - bw) {
             my_request.position = GDL_DOCK_BOTTOM;
             my_request.rect.y += my_request.rect.height * (1 - SPLIT_RATIO);
             my_request.rect.height *= SPLIT_RATIO;
@@ -484,7 +484,7 @@ gdl_dock_paned_dock_request (GdlDockObject  *object,
                    or left/right */
                 may_dock = TRUE;
                 if (item->orientation == GTK_ORIENTATION_HORIZONTAL) {
-                    if (rel_y < alloc->height / 2) {
+                    if (rel_y < alloc.height / 2) {
                         my_request.position = GDL_DOCK_TOP;
                         my_request.rect.height *= SPLIT_RATIO;
                         divider = other.height;
@@ -495,7 +495,7 @@ gdl_dock_paned_dock_request (GdlDockObject  *object,
                         divider = MAX (0, my.height - other.height);
                     }
                 } else {
-                    if (rel_x < alloc->width / 2) {
+                    if (rel_x < alloc.width / 2) {
                         my_request.position = GDL_DOCK_LEFT;
                         my_request.rect.width *= SPLIT_RATIO;
                         divider = other.width;
@@ -519,8 +519,8 @@ gdl_dock_paned_dock_request (GdlDockObject  *object,
         if (may_dock) {
             /* adjust returned coordinates so they are relative to
                our allocation */
-            my_request.rect.x += alloc->x;
-            my_request.rect.y += alloc->y;
+            my_request.rect.x += alloc.x;
+            my_request.rect.y += alloc.y;
         }
     }
 
diff --git a/gdl/gdl-dock-tablabel.c b/gdl/gdl-dock-tablabel.c
index 2a43824..6a2db70 100644
--- a/gdl/gdl-dock-tablabel.c
+++ b/gdl/gdl-dock-tablabel.c
@@ -305,7 +305,7 @@ gdl_dock_tablabel_size_request (GtkWidget      *widget,
     requisition->width += border_width * 2;
     requisition->height += border_width * 2;
 
-    widget->requisition = *requisition;
+    //gtk_widget_size_request (widget, requisition);    
 }
 
 static void
@@ -560,8 +560,9 @@ gdl_dock_tablabel_realize (GtkWidget *widget)
         gdk_window_new (gtk_widget_get_parent_window (widget),
                         &attributes, attributes_mask);
     gdk_window_set_user_data (tablabel->event_window, widget);
-    
-    widget->style = gtk_style_attach (widget->style, widget->window);
+   
+    gtk_widget_set_style (widget, gtk_style_attach (gtk_widget_get_style (widget),
+                                                    gtk_widget_get_window (widget)));
     
     gtk_widget_set_realized (widget, TRUE);
 }
diff --git a/gdl/gdl-dock.c b/gdl/gdl-dock.c
index 3eef7d6..27d5fe1 100644
--- a/gdl/gdl-dock.c
+++ b/gdl/gdl-dock.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
  *
  * This file is part of the GNOME Devtools Libraries.
  *
@@ -559,7 +559,7 @@ gdl_dock_size_request (GtkWidget      *widget,
     requisition->width += 2 * border_width;
     requisition->height += 2 * border_width;
 
-    widget->requisition = *requisition;
+    //gtk_widget_size_request (widget, requisition);    
 }
 
 static void
@@ -791,7 +791,7 @@ gdl_dock_dock_request (GdlDockObject  *object,
     GdlDock            *dock;
     guint               bw;
     gint                rel_x, rel_y;
-    GtkAllocation      *alloc;
+    GtkAllocation       alloc;
     gboolean            may_dock = FALSE;
     GdlDockRequest      my_request;
 
@@ -802,28 +802,28 @@ gdl_dock_dock_request (GdlDockObject  *object,
     dock = GDL_DOCK (object);
     
     /* Get dock size. */
-    gtk_widget_get_allocation (GTK_WIDGET (dock), alloc);
+    gtk_widget_get_allocation (GTK_WIDGET (dock), &alloc);
     bw = gtk_container_get_border_width (GTK_CONTAINER (dock));
 
     /* Get coordinates relative to our allocation area. */
-    rel_x = x - alloc->x;
-    rel_y = y - alloc->y;
+    rel_x = x - alloc.x;
+    rel_y = y - alloc.y;
 
     if (request)
         my_request = *request;
         
     /* Check if coordinates are in GdlDock widget. */
-    if (rel_x > 0 && rel_x < alloc->width &&
-        rel_y > 0 && rel_y < alloc->height) {
+    if (rel_x > 0 && rel_x < alloc.width &&
+        rel_y > 0 && rel_y < alloc.height) {
 
         /* It's inside our area. */
         may_dock = TRUE;
 
 	/* Set docking indicator rectangle to the GdlDock size. */
-        my_request.rect.x = alloc->x + bw;
-        my_request.rect.y = alloc->y + bw;
-        my_request.rect.width = alloc->width - 2*bw;
-        my_request.rect.height = alloc->height - 2*bw;
+        my_request.rect.x = alloc.x + bw;
+        my_request.rect.y = alloc.y + bw;
+        my_request.rect.width = alloc.width - 2*bw;
+        my_request.rect.height = alloc.height - 2*bw;
 
 	/* If GdlDock has no root item yet, set the dock itself as 
 	   possible target. */
@@ -837,14 +837,14 @@ gdl_dock_dock_request (GdlDockObject  *object,
             if (rel_x < bw) {
                 my_request.position = GDL_DOCK_LEFT;
                 my_request.rect.width *= SPLIT_RATIO;
-            } else if (rel_x > alloc->width - bw) {
+            } else if (rel_x > alloc.width - bw) {
                 my_request.position = GDL_DOCK_RIGHT;
                 my_request.rect.x += my_request.rect.width * (1 - SPLIT_RATIO);
                 my_request.rect.width *= SPLIT_RATIO;
             } else if (rel_y < bw) {
                 my_request.position = GDL_DOCK_TOP;
                 my_request.rect.height *= SPLIT_RATIO;
-            } else if (rel_y > alloc->height - bw) {
+            } else if (rel_y > alloc.height - bw) {
                 my_request.position = GDL_DOCK_BOTTOM;
                 my_request.rect.y += my_request.rect.height * (1 - SPLIT_RATIO);
                 my_request.rect.height *= SPLIT_RATIO;
diff --git a/gdl/gdl-switcher.c b/gdl/gdl-switcher.c
index c7d59b8..dc55273 100644
--- a/gdl/gdl-switcher.c
+++ b/gdl/gdl-switcher.c
@@ -256,7 +256,7 @@ static int
 layout_buttons (GdlSwitcher *switcher)
 {
     GtkRequisition client_requisition = {0,};
-    GtkAllocation *allocation = & GTK_WIDGET (switcher)->allocation;
+    GtkAllocation allocation;
     GdlSwitcherStyle switcher_style;
     gboolean icons_only;
     int num_btns = g_slist_length (switcher->priv->buttons);
@@ -271,13 +271,15 @@ layout_buttons (GdlSwitcher *switcher)
     int i;
     int rows_count;
     int last_buttons_height;
+
+    gtk_widget_get_allocation (GTK_WIDGET (switcher), &allocation);
     
     last_buttons_height = switcher->priv->buttons_height_request;
     
     GDL_CALL_PARENT (GTK_WIDGET_CLASS, size_request,
                      (GTK_WIDGET (switcher), &client_requisition));
 
-    y = allocation->y + allocation->height - V_PADDING - 1;
+    y = allocation.y + allocation.height - V_PADDING - 1;
 
     if (num_btns == 0)
         return y;
@@ -299,10 +301,10 @@ layout_buttons (GdlSwitcher *switcher)
     }
 
     /* Figure out how many rows and columns we'll use. */
-    btns_per_row = allocation->width / (max_btn_width + H_PADDING);
+    btns_per_row = allocation.width / (max_btn_width + H_PADDING);
     
     /* If all the buttons could fit in the single row, have it so */
-    if (allocation->width >= optimal_layout_width)
+    if (allocation.width >= optimal_layout_width)
     {
         btns_per_row = num_btns;
     }
@@ -379,7 +381,7 @@ layout_buttons (GdlSwitcher *switcher)
         /* Check for possible size over flow (taking into account client
          * requisition
          */
-        if (y < (allocation->y + client_requisition.height)) {
+        if (y < (allocation.y + client_requisition.height)) {
             /* We have an overflow: Insufficient allocation */
             if (last_buttons_height < switcher->priv->buttons_height_request) {
                 /* Request for a new resize */
@@ -387,11 +389,11 @@ layout_buttons (GdlSwitcher *switcher)
                 return -1;
             }
         }
-        x = H_PADDING + allocation->x;
+        x = H_PADDING + allocation.x;
         len = g_slist_length (rows[i]);
         if (switcher_style == GDL_SWITCHER_STYLE_TEXT ||
             switcher_style == GDL_SWITCHER_STYLE_BOTH)
-            extra_width = (allocation->width - (len * max_btn_width )
+            extra_width = (allocation.width - (len * max_btn_width )
                            - (len * H_PADDING)) / len;
         else
             extra_width = 0;
@@ -431,23 +433,25 @@ layout_buttons (GdlSwitcher *switcher)
 static void
 do_layout (GdlSwitcher *switcher)
 {
-    GtkAllocation *allocation = & GTK_WIDGET (switcher)->allocation;
+    GtkAllocation allocation;
     GtkAllocation child_allocation;
     int y;
 
+    gtk_widget_get_allocation (GTK_WIDGET (switcher), &allocation);
+    
     if (switcher->priv->show) {
         y = layout_buttons (switcher);
         if (y < 0) /* Layout did not happen and a resize was requested */
             return;
     }
     else
-        y = allocation->y + allocation->height;
+        y = allocation.y + allocation.height;
     
     /* Place the parent widget.  */
-    child_allocation.x = allocation->x;
-    child_allocation.y = allocation->y;
-    child_allocation.width = allocation->width;
-    child_allocation.height = y - allocation->y;
+    child_allocation.x = allocation.x;
+    child_allocation.y = allocation.y;
+    child_allocation.width = allocation.width;
+    child_allocation.height = y - allocation.y;
     
     GDL_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate,
                      (GTK_WIDGET (switcher), &child_allocation));
@@ -536,7 +540,7 @@ gdl_switcher_size_request (GtkWidget *widget, GtkRequisition *requisition)
 static void
 gdl_switcher_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 {
-    widget->allocation = *allocation;
+    gtk_widget_set_allocation (widget, allocation);
     do_layout (GDL_SWITCHER (widget));
 }
 
diff --git a/gdl/test-dock.c b/gdl/test-dock.c
index d193897..c891116 100644
--- a/gdl/test-dock.c
+++ b/gdl/test-dock.c
@@ -156,7 +156,7 @@ save_layout_cb (GtkWidget *w, gpointer data)
 
 	hbox = gtk_hbox_new (FALSE, 8);
 	gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new ("Name:");
 	gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]