]> Pileus Git - ~andy/gtk/commitdiff
More text properties
authorMatthias Clasen <mclasen@redhat.com>
Sun, 19 Jun 2011 19:22:08 +0000 (15:22 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jul 2011 20:07:59 +0000 (16:07 -0400)
tests/a11y/accessibility-dump.c
tests/a11y/accessible-name.txt
tests/a11y/hello-world.txt
tests/a11y/mnemonic.txt

index 6a8fcee3d665b2ab88122651715ac54771287575..9bdc70621f996ce34735be0141abbb36fddda0ba 100644 (file)
@@ -221,6 +221,42 @@ dump_attribute_set (GString         *string,
     }
 }
 
+static void
+dump_text_attributes (GString         *string,
+                      gint             depth,
+                      const gchar     *name,
+                      AtkAttributeSet *attributes)
+{
+  GSList *l;
+  AtkAttribute *attr;
+  const gchar *value;
+
+  if (attributes == NULL)
+    return;
+
+  g_string_append_printf (string, "%*s%s:", depth, "", name);
+  for (l = attributes; l; l = l->next)
+    {
+      attr = l->data;
+      /* don't dump values that depend on the environment */
+      if (strcmp (attr->name, "family-name") == 0 ||
+          strcmp (attr->name, "size") == 0 ||
+          strcmp (attr->name, "weight") == 0 ||
+          strcmp (attr->name, "stretch") == 0 ||
+          strcmp (attr->name, "variant") == 0 ||
+          strcmp (attr->name, "style") == 0 ||
+          strcmp (attr->name, "language") == 0 ||
+          strcmp (attr->name, "direction") == 0)
+        value = "<omitted>";
+      else
+        value = attr->value;
+      g_string_append_printf (string, " %s:%s", attr->name, value);
+    }
+  g_string_append_c (string, '\n');
+
+  atk_attribute_set_free (attributes);
+}
+
 static void
 dump_atk_text (AtkText *atk_text,
                guint    depth,
@@ -233,6 +269,8 @@ dump_atk_text (AtkText *atk_text,
   g_string_append_printf (string, "%*stext: %s\n", depth, "", text);
   g_free (text);
 
+  g_string_append_printf (string, "%*scharacter count: %d\n", depth, "", atk_text_get_character_count (atk_text));
+
   g_string_append_printf (string, "%*scaret offset: %d\n", depth, "", atk_text_get_caret_offset (atk_text));
 
   for (i = 0; i < atk_text_get_n_selections (atk_text); i++)
@@ -242,6 +280,8 @@ dump_atk_text (AtkText *atk_text,
         g_string_append_printf (string, "%*sselection %d: (%d, %d) %s\n", depth, "", i, start, end, text);
       g_free (text);
     }
+
+  dump_text_attributes (string, depth, "default attributes", atk_text_get_default_attributes (atk_text));
 }
 
 static void
index 7105697db67e9e6d61d6c28a438d686e19c4c206..438054b837d13bea59333fd005a4b1965deb4ee8 100644 (file)
@@ -11,4 +11,6 @@ window1
     state: enabled focusable sensitive showing visible
     toolkit: gail
     text: Hello World!
+    character count: 12
     caret offset: 0
+    default attributes: left-margin:0 right-margin:0 indent:0 invisible:false editable:false pixels-above-lines:0 pixels-below-lines:0 pixels-inside-wrap:0 bg-full-height:0 scale:1 rise:0 underline:none strikethrough:false bg-stipple:false fg-stipple:false fg-color:0,0,0 bg-color:56540,56026,54741 wrap-mode:word justification:left size:<omitted> weight:<omitted> family-name:<omitted> stretch:<omitted> variant:<omitted> style:<omitted> language:<omitted> direction:<omitted>
index b3b8e8fbe115f77636c990da43aa00ec20b99691..6a76eee09f3ed6ecb8975740f892c2fe28b06a3d 100644 (file)
@@ -11,4 +11,6 @@ window1
     state: enabled focusable sensitive showing visible
     toolkit: gail
     text: Hello World!
+    character count: 12
     caret offset: 0
+    default attributes: left-margin:0 right-margin:0 indent:0 invisible:false editable:false pixels-above-lines:0 pixels-below-lines:0 pixels-inside-wrap:0 bg-full-height:0 scale:1 rise:0 underline:none strikethrough:false bg-stipple:false fg-stipple:false fg-color:0,0,0 bg-color:56540,56026,54741 wrap-mode:word justification:left size:<omitted> weight:<omitted> family-name:<omitted> stretch:<omitted> variant:<omitted> style:<omitted> language:<omitted> direction:<omitted>
index 354b274ae03b6f86bd764f6a1720cfa6231092fe..8925d4193b0193ad0e61eca7c7ed6d61828f3540 100644 (file)
@@ -18,7 +18,9 @@ window1
       state: enabled multi-line sensitive visible
       toolkit: gail
       text: Entry:
+      character count: 6
       caret offset: 0
+      default attributes: left-margin:0 right-margin:0 indent:0 invisible:false editable:false pixels-above-lines:0 pixels-below-lines:0 pixels-inside-wrap:0 bg-full-height:0 scale:1 rise:0 underline:none strikethrough:false bg-stipple:false fg-stipple:false fg-color:0,0,0 bg-color:56540,56026,54741 wrap-mode:word justification:left size:<omitted> weight:<omitted> family-name:<omitted> stretch:<omitted> variant:<omitted> style:<omitted> language:<omitted> direction:<omitted>
     entry1
       "text"
       parent: box1
@@ -27,4 +29,6 @@ window1
       state: editable enabled focusable sensitive single-line visible
       toolkit: gail
       text: text
+      character count: 4
       caret offset: 0
+      default attributes: left-margin:0 right-margin:0 indent:0 invisible:false editable:false pixels-above-lines:0 pixels-below-lines:0 pixels-inside-wrap:0 bg-full-height:0 scale:1 rise:0 underline:none strikethrough:false bg-stipple:false fg-stipple:false fg-color:0,0,0 bg-color:65535,65535,65535 wrap-mode:word justification:left size:<omitted> weight:<omitted> family-name:<omitted> stretch:<omitted> variant:<omitted> style:<omitted> language:<omitted> direction:<omitted>