gnome-games r7215 - trunk/aisleriot



Author: chpe
Date: Sun Jan 13 22:09:06 2008
New Revision: 7215
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7215&view=rev

Log:
Move add_atk_relation to util.c.


Modified:
   trunk/aisleriot/stats-dialog.c
   trunk/aisleriot/util.c
   trunk/aisleriot/util.h

Modified: trunk/aisleriot/stats-dialog.c
==============================================================================
--- trunk/aisleriot/stats-dialog.c	(original)
+++ trunk/aisleriot/stats-dialog.c	Sun Jan 13 22:09:06 2008
@@ -26,6 +26,7 @@
 #include <libgames-support/games-stock.h>
 
 #include "conf.h"
+#include "util.h"
 
 #include "stats-dialog.h"
 
@@ -45,25 +46,6 @@
 
 /* helper functions */
 
-#ifndef HAVE_HILDON
-static void
-add_atk_relation (GtkWidget *widget,
-                  GtkWidget *other,
-                  AtkRelationType type)
-{
-  AtkRelationSet *set;
-  AtkRelation *relation;
-  AtkObject *object;
-
-  object = gtk_widget_get_accessible (other);
-  set = atk_object_ref_relation_set (gtk_widget_get_accessible (widget));
-  relation = atk_relation_new (&object, 1, type);
-  atk_relation_set_add (set, relation);
-  g_object_unref (relation);
-  g_object_unref (set);
-}
-#endif /* !HAVE_HILDON */
-
 static void
 pack_in_frame (GtkWidget *box,
                GtkWidget *content,
@@ -92,8 +74,8 @@
   gtk_widget_show_all (frame);
 
 #ifndef HAVE_HILDON
-  add_atk_relation (label, frame, ATK_RELATION_LABEL_FOR);
-  add_atk_relation (frame, label, ATK_RELATION_LABELLED_BY);
+  aisleriot_util_add_atk_relation (label, frame, ATK_RELATION_LABEL_FOR);
+  aisleriot_util_add_atk_relation (frame, label, ATK_RELATION_LABELLED_BY);
 #endif /* !HAVE_HILDON */
 }
 
@@ -117,8 +99,8 @@
                              1, 2, row, row + 1);
 
 #ifndef HAVE_HILDON
-  add_atk_relation (label, data_label, ATK_RELATION_LABEL_FOR);
-  add_atk_relation (data_label, label, ATK_RELATION_LABELLED_BY);
+  aisleriot_util_add_atk_relation (label, data_label, ATK_RELATION_LABEL_FOR);
+  aisleriot_util_add_atk_relation (data_label, label, ATK_RELATION_LABELLED_BY);
 #endif /* !HAVE_HILDON */
 
   return GTK_LABEL (data_label);

Modified: trunk/aisleriot/util.c
==============================================================================
--- trunk/aisleriot/util.c	(original)
+++ trunk/aisleriot/util.c	Sun Jan 13 22:09:06 2008
@@ -117,3 +117,31 @@
 
   help_hook (parent, game_file, help_hook_data);
 }
+
+/**
+ * aisleriot_util_add_atk_relation:
+ * @widget:
+ * @other:
+ * @type:
+ *
+ * Adds an AtkRelation of type @type to @other into @widget's
+ * AtkRelationSet.
+ */
+void
+aisleriot_util_add_atk_relation (GtkWidget *widget,
+                                 GtkWidget *other,
+                                 AtkRelationType type)
+{
+#ifndef HAVE_HILDON
+  AtkRelationSet *set;
+  AtkRelation *relation;
+  AtkObject *object;
+
+  object = gtk_widget_get_accessible (other);
+  set = atk_object_ref_relation_set (gtk_widget_get_accessible (widget));
+  relation = atk_relation_new (&object, 1, type);
+  atk_relation_set_add (set, relation);
+  g_object_unref (relation);
+  g_object_unref (set);
+#endif /* !HAVE_HILDON */
+}

Modified: trunk/aisleriot/util.h
==============================================================================
--- trunk/aisleriot/util.h	(original)
+++ trunk/aisleriot/util.h	Sun Jan 13 22:09:06 2008
@@ -33,6 +33,10 @@
 
 void aisleriot_display_help (GtkWindow * parent, const char *game_file);
 
+void aisleriot_util_add_atk_relation (GtkWidget *widget,
+                                      GtkWidget *other,
+                                      AtkRelationType type);
+
 G_END_DECLS
 
 #endif /* !UTIL_H */



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