[gnome-games] Gseal: add getter/setter for allocation to games-gtk-compat.h



commit 3ef185bbda8d9fbba65ac4a76739ee63e29d7233
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Sat Aug 29 21:22:39 2009 +0200

    Gseal: add getter/setter for allocation to games-gtk-compat.h
    
    Also use these in games-gridframe.c
    Part of bug 586731

 libgames-support/games-gridframe.c  |    5 +++--
 libgames-support/games-gtk-compat.h |    8 ++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/libgames-support/games-gridframe.c b/libgames-support/games-gridframe.c
index 3ec8ffa..90db76e 100644
--- a/libgames-support/games-gridframe.c
+++ b/libgames-support/games-gridframe.c
@@ -28,6 +28,7 @@
 #include <glib/gi18n.h>
 
 #include "games-gridframe.h"
+#include "games-gtk-compat.h"
 
 enum {
   PROP_0,
@@ -173,7 +174,7 @@ games_grid_frame_size_allocate (GtkWidget * widget,
   GtkAllocation child_allocation;
   gint xsize, ysize, size;
 
-  widget->allocation = *allocation;
+  gtk_widget_set_allocation (widget, allocation);
 
   xsize = MAX (1, (allocation->width - frame->xpadding) / frame->xmult);
   ysize = MAX (1, (allocation->height - frame->ypadding) / frame->ymult);
@@ -195,7 +196,7 @@ games_grid_frame_size_allocate (GtkWidget * widget,
        child_allocation.y != frame->old_allocation.y ||
        child_allocation.width != frame->old_allocation.width ||
        child_allocation.height != frame->old_allocation.height))
-    gdk_window_invalidate_rect (gtk_widget_get_window (widget), &widget->allocation, FALSE);
+    gdk_window_invalidate_rect (gtk_widget_get_window (widget), allocation, FALSE);
 
   if (child && GTK_WIDGET_VISIBLE (child))
     gtk_widget_size_allocate (child, &child_allocation);
diff --git a/libgames-support/games-gtk-compat.h b/libgames-support/games-gtk-compat.h
index 759dc41..5c4a27e 100644
--- a/libgames-support/games-gtk-compat.h
+++ b/libgames-support/games-gtk-compat.h
@@ -27,6 +27,14 @@ G_BEGIN_DECLS
 #define GTK_OBJECT_FLAGS(i) (GTK_OBJECT (i)->GSEAL(flags))
 #endif /* GSEAL_ENABLE */
 
+#if !GTK_CHECK_VERSION (2, 17, 8)
+#define gtk_widget_set_allocation(widget, alloc) ((widget)->allocation=*(alloc))
+#endif /* GTK < 2.17.8 */
+
+#if !GTK_CHECK_VERSION (2, 17, 7)
+#define gtk_widget_get_allocation(widget, alloc) (*(alloc)=(widget)->allocation)
+#endif /* GTK < 2.17.7 */
+
 #if !GTK_CHECK_VERSION (2, 17, 5)
 #define gtk_widget_get_state(widget) ((widget)->state)
 #endif /* GTK < 2.17.5 */



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