[gnome-games] GSEAL: fixes for GTK_WIDGET_HAS_FOCUS and GTK_WIDGET_VISIBLE



commit 98544d94e25cb20382a6d3af5c3277d16d183858
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Tue Oct 6 01:04:27 2009 +0200

    GSEAL: fixes for GTK_WIDGET_HAS_FOCUS and GTK_WIDGET_VISIBLE
    
    bug#586731

 aisleriot/board-noclutter.c         |   10 +++++-----
 blackjack/src/dialog.cpp            |    2 +-
 gnomine/minefield.c                 |    2 +-
 libgames-support/games-gridframe.c  |    4 ++--
 libgames-support/games-gtk-compat.h |   16 ++++++----------
 5 files changed, 15 insertions(+), 19 deletions(-)
---
diff --git a/aisleriot/board-noclutter.c b/aisleriot/board-noclutter.c
index 2c95832..0662078 100644
--- a/aisleriot/board-noclutter.c
+++ b/aisleriot/board-noclutter.c
@@ -619,7 +619,7 @@ set_focus (AisleriotBoard *board,
 
   if (priv->focus_slot != NULL) {
     if (priv->show_focus &&
-        GTK_WIDGET_HAS_FOCUS (widget)) {
+        gtk_widget_has_focus (widget)) {
       gdk_window_invalidate_rect (window, &priv->focus_rect, FALSE);
     
       priv->show_focus = FALSE;
@@ -638,7 +638,7 @@ set_focus (AisleriotBoard *board,
   priv->focus_card_id = card_id;
 
   if (show_focus &&
-      GTK_WIDGET_HAS_FOCUS (widget)) {
+      gtk_widget_has_focus (widget)) {
     get_focus_rect (board, &priv->focus_rect);
     gdk_window_invalidate_rect (window, &priv->focus_rect, FALSE);
   }
@@ -2196,7 +2196,7 @@ aisleriot_board_activate (AisleriotBoard *board)
   int selection_start_card_id = priv->selection_start_card_id;
   guint state = 0;
 
-  if (!GTK_WIDGET_HAS_FOCUS (widget))
+  if (!gtk_widget_has_focus (widget))
     return;
 
   if (!focus_slot) {
@@ -2274,7 +2274,7 @@ aisleriot_board_move_cursor (AisleriotBoard *board,
   guint state;
   gboolean is_control, is_shift, moved = FALSE;
 
-  if (!GTK_WIDGET_HAS_FOCUS (widget))
+  if (!gtk_widget_has_focus (widget))
     return FALSE;
 
   g_return_val_if_fail (step == GTK_MOVEMENT_LOGICAL_POSITIONS ||
@@ -3283,7 +3283,7 @@ draw_focus:
 #ifdef ENABLE_KEYNAV
   if (G_UNLIKELY (priv->show_focus &&
                   priv->focus_slot != NULL &&
-                  GTK_WIDGET_HAS_FOCUS (widget))) {
+                  gtk_widget_has_focus (widget))) {
     GdkRectangle focus_rect;
 
     /* Check whether this needs to be drawn */
diff --git a/blackjack/src/dialog.cpp b/blackjack/src/dialog.cpp
index 4cc3d4b..53a04f2 100644
--- a/blackjack/src/dialog.cpp
+++ b/blackjack/src/dialog.cpp
@@ -424,7 +424,7 @@ show_preferences_dialog (void)
                                   G_CALLBACK (gtk_widget_hide), NULL);
         }
         
-        if (pref_dialog && !GTK_WIDGET_VISIBLE (pref_dialog)) {
+        if (pref_dialog && !gtk_widget_get_visible (pref_dialog)) {
                 // Set card style?
 
                 gtk_widget_show_all (pref_dialog);
diff --git a/gnomine/minefield.c b/gnomine/minefield.c
index 6d554d6..49777ea 100644
--- a/gnomine/minefield.c
+++ b/gnomine/minefield.c
@@ -1272,7 +1272,7 @@ gtk_minefield_set_size (GtkMineField * mfield, guint xsize, guint ysize)
   mfield->xsize = xsize;
   mfield->ysize = ysize;
 
-  if (GTK_WIDGET_VISIBLE (mfield)) {
+  if (gtk_widget_get_visible (mfield)) {
     gtk_widget_queue_resize (GTK_WIDGET (mfield));
   }
 }
diff --git a/libgames-support/games-gridframe.c b/libgames-support/games-gridframe.c
index 90db76e..3e4363f 100644
--- a/libgames-support/games-gridframe.c
+++ b/libgames-support/games-gridframe.c
@@ -160,7 +160,7 @@ games_grid_frame_size_request (GtkWidget * widget,
   requisition->width = 1;
   requisition->height = 1;
 
-  if (child && GTK_WIDGET_VISIBLE (child)) {
+  if (child && gtk_widget_get_visible (child)) {
     gtk_widget_size_request (child, requisition);
   }
 }
@@ -198,7 +198,7 @@ games_grid_frame_size_allocate (GtkWidget * widget,
        child_allocation.height != frame->old_allocation.height))
     gdk_window_invalidate_rect (gtk_widget_get_window (widget), allocation, FALSE);
 
-  if (child && GTK_WIDGET_VISIBLE (child))
+  if (child && gtk_widget_get_visible (child))
     gtk_widget_size_allocate (child, &child_allocation);
 
   frame->old_allocation = child_allocation;
diff --git a/libgames-support/games-gtk-compat.h b/libgames-support/games-gtk-compat.h
index 5c4a27e..4a2a022 100644
--- a/libgames-support/games-gtk-compat.h
+++ b/libgames-support/games-gtk-compat.h
@@ -27,21 +27,17 @@ G_BEGIN_DECLS
 #define GTK_OBJECT_FLAGS(i) (GTK_OBJECT (i)->GSEAL(flags))
 #endif /* GSEAL_ENABLE */
 
-#if !GTK_CHECK_VERSION (2, 17, 8)
+#if !GTK_CHECK_VERSION (2, 18, 0)
 #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_has_focus(widget) (GTK_WIDGET_HAS_FOCUS (widget))
 #define gtk_widget_get_state(widget) ((widget)->state)
-#endif /* GTK < 2.17.5 */
+#define gtk_widget_get_visible(widget) (GTK_WIDGET_VISIBLE (widget))
+#endif /* GTK < 2.18.0 */
 
-#if !GTK_CHECK_VERSION (2, 13, 4)
+#if !GTK_CHECK_VERSION (2, 14, 0)
 #define gtk_widget_get_window(widget) ((widget)->window)
-#endif /* GTK < 2.13.4 */
+#endif /* GTK < 2.14.0 */
 
 G_END_DECLS
 



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