[gimp] app: avoid the deprecated gdk_drawable_get_size() on GTK+ >= 2.24



commit 075c7d4a4d5639b48158a65b8167ab6969eb95bd
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 17 15:10:17 2011 +0100

    app: avoid the deprecated gdk_drawable_get_size() on GTK+ >= 2.24
    
    Use gdk_window_get_width/height() instead.

 app/widgets/gimpoverlaychild.c |    5 +++++
 app/widgets/gimpspinscale.c    |    9 +++++++++
 app/widgets/gimptagentry.c     |    5 +++++
 3 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpoverlaychild.c b/app/widgets/gimpoverlaychild.c
index 8c322f6..d01b745 100644
--- a/app/widgets/gimpoverlaychild.c
+++ b/app/widgets/gimpoverlaychild.c
@@ -257,9 +257,14 @@ gimp_overlay_child_size_allocate (GimpOverlayBox   *box,
       gdk_window_get_position (child->window,
                                &old_allocation.x,
                                &old_allocation.y);
+#if GTK_CHECK_VERSION (2, 24, 0)
+      old_allocation.width  = gdk_window_get_width (child->window);
+      old_allocation.height = gdk_window_get_height (child->window);
+#else
       gdk_drawable_get_size (child->window,
                              &old_allocation.width,
                              &old_allocation.height);
+#endif
 
       gimp_overlay_child_transform_bounds (child, &old_allocation, &old_bounds);
 
diff --git a/app/widgets/gimpspinscale.c b/app/widgets/gimpspinscale.c
index d1b1368..f14fc8b 100644
--- a/app/widgets/gimpspinscale.c
+++ b/app/widgets/gimpspinscale.c
@@ -222,7 +222,12 @@ gimp_spin_scale_expose (GtkWidget      *widget,
   gdk_cairo_region (cr, event->region);
   cairo_clip (cr);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+  w = gdk_window_get_width (event->window);
+  h = gdk_window_get_height (event->window);
+#else
   gdk_drawable_get_size (event->window, &w, &h);
+#endif
 
   cairo_set_line_width (cr, 1.0);
 
@@ -310,7 +315,11 @@ gimp_spin_scale_set_value (GtkWidget *widget,
   gdouble        fraction;
   gdouble        value;
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+  width = gdk_window_get_width (text_window);
+#else
   gdk_drawable_get_size (text_window, &width, NULL);
+#endif
 
   fraction = x / (gdouble) width;
 
diff --git a/app/widgets/gimptagentry.c b/app/widgets/gimptagentry.c
index 982f9db..31f5143 100644
--- a/app/widgets/gimptagentry.c
+++ b/app/widgets/gimptagentry.c
@@ -1292,8 +1292,13 @@ gimp_tag_entry_expose (GtkWidget      *widget,
   pango_layout_set_attributes (layout, attr_list);
   pango_attr_list_unref (attr_list);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+  window_width  = gdk_window_get_width (event->window);
+  window_height = gdk_window_get_height (event->window);
+#else
   gdk_drawable_get_size (GDK_DRAWABLE (event->window),
                          &window_width, &window_height);
+#endif
   pango_layout_get_size (layout,
                          &layout_width, &layout_height);
   offset = (window_height - PANGO_PIXELS (layout_height)) / 2;



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