[gdl] Remove deprecated Gtk+ symbols



commit 1972305dd21a1ee0ba1e8881dc80dc10ae1170e0
Author: Mirsal Ennaime <mirsal ennaime gmail com>
Date:   Mon Apr 12 20:56:59 2010 +0200

    Remove deprecated Gtk+ symbols
    
    bgo#577469
    
    The following deprecated symbols were used throughout the codebase :
    
    GTK_WIDGET_DRAWABLE, GTK_WIDGET_REALIZED, GTK_WIDGET_STATE,
    GTK_WIDGET_VISIBLE, GTK_WIDGET_MAPPED, GTK_WIDGET_NO_WINDOW

 configure.in             |    2 +-
 gdl/gdl-dock-bar.c       |   16 ++++++++--------
 gdl/gdl-dock-item-grip.c |    8 ++++----
 gdl/gdl-dock-item.c      |   34 ++++++++++++++++++----------------
 gdl/gdl-dock-layout.c    |    4 ++--
 gdl/gdl-dock-tablabel.c  |    6 +++---
 gdl/gdl-dock.c           |   26 +++++++++++++-------------
 7 files changed, 49 insertions(+), 47 deletions(-)
---
diff --git a/configure.in b/configure.in
index 98a40a7..ecd48c7 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.12.0
+GTK_REQUIRED=2.19.7
 XML_REQUIRED=2.2.8
 
 AC_SUBST(GTK_REQUIRED)
diff --git a/gdl/gdl-dock-bar.c b/gdl/gdl-dock-bar.c
index 9008c68..6fee679 100644
--- a/gdl/gdl-dock-bar.c
+++ b/gdl/gdl-dock-bar.c
@@ -477,7 +477,7 @@ static void gdl_dock_bar_size_vrequest (GtkWidget *widget,
       child = children->data;
       children = children->next;
 
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
 	{
 	  gtk_widget_size_request (child->widget, &child_requisition);
 
@@ -535,7 +535,7 @@ static void gdl_dock_bar_size_vallocate (GtkWidget     *widget,
       child = children->data;
       children = children->next;
 
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
 	{
 	  nvis_children += 1;
 	  if (child->expand)
@@ -573,7 +573,7 @@ static void gdl_dock_bar_size_vallocate (GtkWidget     *widget,
 	  child = children->data;
 	  children = children->next;
 
-	  if ((child->pack == GTK_PACK_START) && GTK_WIDGET_VISIBLE (child->widget))
+	  if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
 	    {
 	      if (box->homogeneous)
 		{
@@ -632,7 +632,7 @@ static void gdl_dock_bar_size_vallocate (GtkWidget     *widget,
 	  child = children->data;
 	  children = children->next;
 
-	  if ((child->pack == GTK_PACK_END) && GTK_WIDGET_VISIBLE (child->widget))
+	  if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget))
 	    {
 	      GtkRequisition child_requisition;
 	      gtk_widget_get_child_requisition (child->widget, &child_requisition);
@@ -702,7 +702,7 @@ static void gdl_dock_bar_size_hrequest (GtkWidget *widget,
       child = children->data;
       children = children->next;
 
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
 	{
 	  GtkRequisition child_requisition;
 
@@ -764,7 +764,7 @@ static void gdl_dock_bar_size_hallocate (GtkWidget     *widget,
       child = children->data;
       children = children->next;
 
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
 	{
 	  nvis_children += 1;
 	  if (child->expand)
@@ -802,7 +802,7 @@ static void gdl_dock_bar_size_hallocate (GtkWidget     *widget,
 	  child = children->data;
 	  children = children->next;
 
-	  if ((child->pack == GTK_PACK_START) && GTK_WIDGET_VISIBLE (child->widget))
+	  if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
 	    {
 	      if (box->homogeneous)
 		{
@@ -865,7 +865,7 @@ static void gdl_dock_bar_size_hallocate (GtkWidget     *widget,
 	  child = children->data;
 	  children = children->next;
 
-	  if ((child->pack == GTK_PACK_END) && GTK_WIDGET_VISIBLE (child->widget))
+	  if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget))
 	    {
 	      GtkRequisition child_requisition;
 	      gtk_widget_get_child_requisition (child->widget, &child_requisition);
diff --git a/gdl/gdl-dock-item-grip.c b/gdl/gdl-dock-item-grip.c
index 65d76d8..728cfb6 100644
--- a/gdl/gdl-dock-item-grip.c
+++ b/gdl/gdl-dock-item-grip.c
@@ -454,13 +454,13 @@ gdl_dock_item_grip_size_request (GtkWidget      *widget,
 
     gtk_widget_size_request (grip->_priv->close_button, &child_requisition);
     layout_height = MAX (layout_height, child_requisition.height);
-    if (GTK_WIDGET_VISIBLE (grip->_priv->close_button)) {
+    if (gtk_widget_get_visible (grip->_priv->close_button)) {
        requisition->width += child_requisition.width;
     }
     
     gtk_widget_size_request (grip->_priv->iconify_button, &child_requisition);
     layout_height = MAX (layout_height, child_requisition.height);
-    if (GTK_WIDGET_VISIBLE (grip->_priv->iconify_button)) {
+    if (gtk_widget_get_visible (grip->_priv->iconify_button)) {
         requisition->width += child_requisition.width;
     }
    
@@ -510,7 +510,7 @@ gdl_dock_item_grip_size_allocate (GtkWidget     *widget,
     child_allocation.y = container->border_width;
 
     /* Layout Close Button */
-    if (GTK_WIDGET_VISIBLE (grip->_priv->close_button)) {
+    if (gtk_widget_get_visible (grip->_priv->close_button)) {
 
         if(space_for_buttons) {
             if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL)
@@ -529,7 +529,7 @@ gdl_dock_item_grip_size_allocate (GtkWidget     *widget,
     }    
 
     /* Layout Iconify Button */
-    if (GTK_WIDGET_VISIBLE (grip->_priv->iconify_button)) {
+    if (gtk_widget_get_visible (grip->_priv->iconify_button)) {
 
         if(space_for_buttons) {
             if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL)
diff --git a/gdl/gdl-dock-item.c b/gdl/gdl-dock-item.c
index bbfab61..d846975 100644
--- a/gdl/gdl-dock-item.c
+++ b/gdl/gdl-dock-item.c
@@ -620,7 +620,7 @@ gdl_dock_item_remove (GtkContainer *container,
     
     item = GDL_DOCK_ITEM (container);
     if (item->_priv && widget == item->_priv->grip) {
-        gboolean grip_was_visible = GTK_WIDGET_VISIBLE (widget);
+        gboolean grip_was_visible = gtk_widget_get_visible (widget);
         gtk_widget_unparent (widget);
         item->_priv->grip = NULL;
         if (grip_was_visible)
@@ -634,7 +634,7 @@ gdl_dock_item_remove (GtkContainer *container,
     
     g_return_if_fail (item->child == widget);
     
-    was_visible = GTK_WIDGET_VISIBLE (widget);
+    was_visible = gtk_widget_get_visible (widget);
 
     gtk_widget_unparent (widget);
     item->child = NULL;
@@ -744,14 +744,14 @@ gdl_dock_item_size_allocate (GtkWidget     *widget,
     item->_priv->preferred_height = -1;
     item->_priv->preferred_width = -1;
     
-    if (GTK_WIDGET_REALIZED (widget))
+    if (gtk_widget_get_realized (widget))
         gdk_window_move_resize (widget->window,
                                 widget->allocation.x,
                                 widget->allocation.y,
                                 widget->allocation.width,
                                 widget->allocation.height);
 
-    if (item->child && GTK_WIDGET_VISIBLE (item->child)) {
+    if (item->child && gtk_widget_get_visible (item->child)) {
         GtkAllocation  child_allocation;
         int            border_width;
 
@@ -806,13 +806,13 @@ gdl_dock_item_map (GtkWidget *widget)
     gdk_window_show (widget->window);
 
     if (item->child
-        && GTK_WIDGET_VISIBLE (item->child)
-        && !GTK_WIDGET_MAPPED (item->child))
+        && gtk_widget_get_visible (item->child)
+        && !gtk_widget_get_mapped (item->child))
         gtk_widget_map (item->child);
 
     if (item->_priv->grip
-        && GTK_WIDGET_VISIBLE (item->_priv->grip)
-        && !GTK_WIDGET_MAPPED (item->_priv->grip))
+        && gtk_widget_get_visible (GTK_WIDGET (item->_priv->grip))
+        && !gtk_widget_get_mapped (GTK_WIDGET (item->_priv->grip)))
         gtk_widget_map (item->_priv->grip);
 }
 
@@ -869,7 +869,7 @@ gdl_dock_item_realize (GtkWidget *widget)
   
     widget->style = gtk_style_attach (widget->style, widget->window);
     gtk_style_set_background (widget->style, widget->window, 
-                              GTK_WIDGET_STATE (item));
+                              gtk_widget_get_state (GTK_WIDGET (item)));
     gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
 
     if (item->child)
@@ -886,10 +886,12 @@ gdl_dock_item_style_set (GtkWidget *widget,
     g_return_if_fail (widget != NULL);
     g_return_if_fail (GDL_IS_DOCK_ITEM (widget));
 
-    if (GTK_WIDGET_REALIZED (widget) && !GTK_WIDGET_NO_WINDOW (widget)) {
+    if (gtk_widget_get_realized (widget) &&
+            gtk_widget_get_has_window (widget))
+    {
         gtk_style_set_background (widget->style, widget->window,
                                   widget->state);
-        if (GTK_WIDGET_DRAWABLE (widget))
+        if (gtk_widget_is_drawable (widget))
             gdk_window_clear (widget->window);
     }
 }
@@ -904,7 +906,7 @@ gdl_dock_item_paint (GtkWidget      *widget,
 
     gtk_paint_box (widget->style,
                    widget->window,
-                   GTK_WIDGET_STATE (widget),
+                   gtk_widget_get_state (widget),
                    GTK_SHADOW_NONE,
                    &event->area, widget,
                    "dockitem",
@@ -919,7 +921,7 @@ gdl_dock_item_expose (GtkWidget      *widget,
     g_return_val_if_fail (GDL_IS_DOCK_ITEM (widget), FALSE);
     g_return_val_if_fail (event != NULL, FALSE);
 
-    if (GTK_WIDGET_DRAWABLE (widget) && event->window == widget->window) {
+    if (gtk_widget_is_drawable (widget) && event->window == widget->window) {
         gdl_dock_item_paint (widget, event);
         GDL_CALL_PARENT_GBOOLEAN(GTK_WIDGET_CLASS, expose_event, (widget,event));
     }
@@ -1374,7 +1376,7 @@ gdl_dock_item_dock (GdlDockObject    *object,
             gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (new_parent));
 
         /* show automatic object */
-        if (GTK_WIDGET_VISIBLE (object))
+        if (gtk_widget_get_visible (GTK_WIDGET (object)))
         {
             gtk_widget_show (GTK_WIDGET (new_parent));
             GDL_DOCK_OBJECT_UNSET_FLAGS (object, GDL_DOCK_IN_REFLOW);
@@ -1470,7 +1472,7 @@ gdl_dock_item_drag_start (GdlDockItem *item)
 {
     GdkCursor *fleur;
 
-    if (!GTK_WIDGET_REALIZED (item))
+    if (!gtk_widget_get_realized (GTK_WIDGET (item)))
         gtk_widget_realize (GTK_WIDGET (item));
     
     GDL_DOCK_ITEM_SET_FLAGS (item, GDL_DOCK_IN_DRAG);
@@ -1596,7 +1598,7 @@ gdl_dock_item_real_set_orientation (GdlDockItem    *item,
 {
     item->orientation = orientation;
     
-    if (GTK_WIDGET_DRAWABLE (item))
+    if (gtk_widget_is_drawable (GTK_WIDGET (item)))
         gtk_widget_queue_draw (GTK_WIDGET (item));
     gtk_widget_queue_resize (GTK_WIDGET (item));
 }
diff --git a/gdl/gdl-dock-layout.c b/gdl/gdl-dock-layout.c
index 7c52795..04a0fe0 100644
--- a/gdl/gdl-dock-layout.c
+++ b/gdl/gdl-dock-layout.c
@@ -899,13 +899,13 @@ gdl_dock_layout_recursive_build (GdlDockMaster *master,
                                                  parent);
                 else if (gdl_dock_object_is_compound (parent)) {
                     gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (object));
-                    if (GTK_WIDGET_VISIBLE (parent))
+                    if (gtk_widget_get_visible (GTK_WIDGET (parent)))
                         gtk_widget_show (GTK_WIDGET (object));
                 }
             }
             else {
                 GdlDockObject *controller = gdl_dock_master_get_controller (master);
-                if (controller != object && GTK_WIDGET_VISIBLE (controller))
+                if (controller != object && gtk_widget_get_visible (GTK_WIDGET (controller)))
                     gtk_widget_show (GTK_WIDGET (object));
             }
                 
diff --git a/gdl/gdl-dock-tablabel.c b/gdl/gdl-dock-tablabel.c
index bd75589..1de95d2 100644
--- a/gdl/gdl-dock-tablabel.c
+++ b/gdl/gdl-dock-tablabel.c
@@ -324,14 +324,14 @@ gdl_dock_tablabel_size_allocate (GtkWidget     *widget,
   
     widget->allocation = *allocation;
 
-    if (GTK_WIDGET_REALIZED (widget))
+    if (gtk_widget_get_realized (widget))
         gdk_window_move_resize (tablabel->event_window, 
                                 allocation->x, 
                                 allocation->y,
                                 allocation->width, 
                                 allocation->height);
 
-    if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) {
+    if (bin->child && gtk_widget_get_visible (bin->child)) {
         GtkAllocation  child_allocation;
 
         child_allocation.x = widget->allocation.x + border_width;
@@ -386,7 +386,7 @@ gdl_dock_tablabel_expose (GtkWidget      *widget,
     g_return_val_if_fail (GDL_IS_DOCK_TABLABEL (widget), FALSE);
     g_return_val_if_fail (event != NULL, FALSE);
 
-    if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget)) {
+    if (gtk_widget_get_visible (widget) && gtk_widget_get_mapped (widget)) {
         GDL_CALL_PARENT_GBOOLEAN(GTK_WIDGET_CLASS, expose_event, (widget,event));
         gdl_dock_tablabel_paint (widget, event);
     };
diff --git a/gdl/gdl-dock.c b/gdl/gdl-dock.c
index 3ac10e4..06984bd 100644
--- a/gdl/gdl-dock.c
+++ b/gdl/gdl-dock.c
@@ -546,7 +546,7 @@ gdl_dock_size_request (GtkWidget      *widget,
     border_width = container->border_width;
 
     /* make request to root */
-    if (dock->root && GTK_WIDGET_VISIBLE (dock->root))
+    if (dock->root && gtk_widget_get_visible (GTK_WIDGET (dock->root)))
         gtk_widget_size_request (GTK_WIDGET (dock->root), requisition);
     else {
         requisition->width = 0;
@@ -582,7 +582,7 @@ gdl_dock_size_allocate (GtkWidget     *widget,
     allocation->width = MAX (1, allocation->width - 2 * border_width);
     allocation->height = MAX (1, allocation->height - 2 * border_width);
 
-    if (dock->root && GTK_WIDGET_VISIBLE (dock->root))
+    if (dock->root && gtk_widget_get_visible (GTK_WIDGET (dock->root)))
         gtk_widget_size_allocate (GTK_WIDGET (dock->root), allocation);
 }
 
@@ -601,7 +601,7 @@ gdl_dock_map (GtkWidget *widget)
 
     if (dock->root) {
         child = GTK_WIDGET (dock->root);
-        if (GTK_WIDGET_VISIBLE (child) && !GTK_WIDGET_MAPPED (child))
+        if (gtk_widget_get_visible (child) && !gtk_widget_get_mapped (child))
             gtk_widget_map (child);
     }
 }
@@ -621,7 +621,7 @@ gdl_dock_unmap (GtkWidget *widget)
 
     if (dock->root) {
         child = GTK_WIDGET (dock->root);
-        if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_MAPPED (child))
+        if (gtk_widget_get_visible (child) && gtk_widget_get_mapped (child))
             gtk_widget_unmap (child);
     }
     
@@ -705,14 +705,14 @@ gdl_dock_remove (GtkContainer *container,
     g_return_if_fail (widget != NULL);
 
     dock = GDL_DOCK (container);
-    was_visible = GTK_WIDGET_VISIBLE (widget);
+    was_visible = gtk_widget_get_visible (widget);
 
     if (GTK_WIDGET (dock->root) == widget) {
         dock->root = NULL;
         GDL_DOCK_OBJECT_UNSET_FLAGS (widget, GDL_DOCK_ATTACHED);
         gtk_widget_unparent (widget);
 
-        if (was_visible && GTK_WIDGET_VISIBLE (GTK_WIDGET (container)))
+        if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container)))
             gtk_widget_queue_resize (GTK_WIDGET (dock));
     }
 }
@@ -912,15 +912,15 @@ gdl_dock_dock (GdlDockObject    *object,
 
         /* Realize the item (create its corresponding GdkWindow) when 
            GdlDock has been realized. */
-        if (GTK_WIDGET_REALIZED (dock))
+        if (gtk_widget_get_realized (GTK_WIDGET (dock)))
             gtk_widget_realize (widget);
         
         /* Map the widget if it's visible and the parent is visible and has 
            been mapped. This is done to make sure that the GdkWindow is 
            visible. */
-        if (GTK_WIDGET_VISIBLE (dock) && 
-            GTK_WIDGET_VISIBLE (widget)) {
-            if (GTK_WIDGET_MAPPED (dock))
+        if (gtk_widget_get_visible (GTK_WIDGET (dock)) && 
+            gtk_widget_get_visible (widget)) {
+            if (gtk_widget_get_mapped (GTK_WIDGET (dock)))
                 gtk_widget_map (widget);
             
             /* Make the widget resize. */
@@ -1249,9 +1249,9 @@ gdl_dock_add_floating_item (GdlDock        *dock,
                                        "floaty", y,
                                        NULL));
     
-    if (GTK_WIDGET_VISIBLE (dock)) {
+    if (gtk_widget_get_visible (GTK_WIDGET (dock))) {
         gtk_widget_show (GTK_WIDGET (new_dock));
-        if (GTK_WIDGET_MAPPED (dock))
+        if (gtk_widget_get_mapped (GTK_WIDGET (dock)))
             gtk_widget_map (GTK_WIDGET (new_dock));
         
         /* Make the widget resize. */
@@ -1326,7 +1326,7 @@ gdl_dock_xor_rect (GdlDock      *dock,
     widget = GTK_WIDGET (dock);
 
     if (!dock->_priv->xor_gc) {
-        if (GTK_WIDGET_REALIZED (widget)) {
+        if (gtk_widget_get_realized (widget)) {
             GdkGCValues values;
 
             values.function = GDK_INVERT;



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