[gtk+/a11y] Dump AtkHyperLinkImpl properties



commit 7208aad8266fa85081038eb719af9eeac62aaa55
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 19 18:53:56 2011 -0400

    Dump AtkHyperLinkImpl properties

 tests/a11y/accessibility-dump.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c
index 695be50..ee72eb5 100644
--- a/tests/a11y/accessibility-dump.c
+++ b/tests/a11y/accessibility-dump.c
@@ -358,7 +358,30 @@ dump_atk_value (AtkValue *atk_value,
   g_string_append_printf (string, "%*scurrent value: %g\n", depth, "", g_value_get_double (&value));
   atk_value_get_minimum_increment (atk_value, &value);
   g_string_append_printf (string, "%*sminimum increment: %g\n", depth, "", g_value_get_double (&value));
+}
+
+static void
+dump_atk_hyperlink_impl (AtkHyperlinkImpl *impl,
+                         guint             depth,
+                         GString          *string)
+{
+  AtkHyperlink *atk_link;
+  gint i;
+
+  atk_link = atk_hyperlink_impl_get_hyperlink (impl);
 
+  g_string_append_printf (string, "%*sanchors: %d\n", depth, "", atk_hyperlink_get_n_anchors (atk_link));
+
+  for (i = 0; i < atk_hyperlink_get_n_anchors (atk_link); i++)
+    {
+      gchar *uri;
+
+      uri = atk_hyperlink_get_uri (atk_link, i);
+      g_string_append_printf (string, "%*suri %d: %s\n", depth, "", i, uri);
+      g_free (uri);
+    }
+
+  g_object_unref (atk_link);
 }
 
 static void
@@ -399,6 +422,9 @@ dump_accessible (AtkObject     *accessible,
   if (ATK_IS_VALUE (accessible))
     dump_atk_value (ATK_VALUE (accessible), depth, string);
 
+  if (ATK_IS_HYPERLINK_IMPL (accessible))
+    dump_atk_hyperlink_impl (ATK_HYPERLINK_IMPL (accessible), depth, string);
+
   for (i = 0; i < atk_object_get_n_accessible_children (accessible); i++)
     {
       AtkObject *child = atk_object_ref_accessible_child (accessible, i);



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