Dump AtkComponent properties

Note that the spatial aspects of AtkComponent are all dependent
on fonts and other environmental factors, thus we only dump the
little bits outside of that.
This commit is contained in:
Matthias Clasen 2011-06-19 19:51:15 -04:00
parent 570c185935
commit 52aa225713
8 changed files with 93 additions and 0 deletions

View File

@ -264,6 +264,36 @@ dump_text_attributes (GString *string,
atk_attribute_set_free (attributes);
}
extern GType atk_layer_get_type (void);
static const gchar *
layer_name (AtkLayer layer)
{
GEnumClass *class;
GEnumValue *value;
class = g_type_class_ref (atk_layer_get_type ());
value = g_enum_get_value (class, layer);
g_type_class_unref (class);
return value->value_nick;
}
static void
dump_atk_component (AtkComponent *atk_component,
guint depth,
GString *string)
{
AtkLayer layer;
g_string_append_printf (string, "%*s<AtkComponent>\n", depth, "");
layer = atk_component_get_layer (atk_component);
g_string_append_printf (string, "%*slayer: %s\n", depth, "", layer_name (layer));
g_string_append_printf (string, "%*salpha: %g\n", depth, "", atk_component_get_alpha (atk_component));
}
static void
dump_atk_text (AtkText *atk_text,
guint depth,
@ -435,6 +465,9 @@ dump_accessible (AtkObject *accessible,
dump_state_set (string, depth, atk_object_ref_state_set (accessible));
dump_attribute_set (string, depth, atk_object_get_attributes (accessible));
if (ATK_IS_COMPONENT (accessible))
dump_atk_component (ATK_COMPONENT (accessible), depth, string);
if (ATK_IS_TEXT (accessible))
dump_atk_text (ATK_TEXT (accessible), depth, string);

View File

@ -3,6 +3,9 @@ window1
index: 0
state: enabled resizable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: window
alpha: 1
button1
"push button"
parent: window1
@ -10,6 +13,9 @@ window1
name: Accessible name
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12

View File

@ -3,6 +3,9 @@ window1
index: 0
state: enabled resizable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: window
alpha: 1
button1
"push button"
parent: window1
@ -10,6 +13,9 @@ window1
name: Hello World!
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12

View File

@ -3,6 +3,9 @@ window1
index: 0
state: enabled resizable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: window
alpha: 1
button1
"push button"
parent: window1
@ -10,6 +13,9 @@ window1
name: Hello World!
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12

View File

@ -3,12 +3,18 @@ window1
index: 0
state: enabled resizable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: window
alpha: 1
box1
"filler"
parent: window1
index: 0
state: enabled horizontal sensitive
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
label1
"label"
parent: box1
@ -17,6 +23,9 @@ window1
label-for: entry1
state: enabled multi-line sensitive visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Entry:
character count: 6
@ -29,6 +38,9 @@ window1
labelled-by: label1
state: editable enabled focusable sensitive single-line visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: text
character count: 4

View File

@ -3,12 +3,18 @@ window1
index: 0
state: enabled resizable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: window
alpha: 1
notebook1
"page tab list"
parent: window1
index: 0
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkSelection>
selection count: 1
selected children: 0
@ -18,6 +24,9 @@ window1
index: 0
name: Tab 1
state: enabled multi-line selectable selected sensitive showing visible
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Tab 1
character count: 5
@ -29,6 +38,9 @@ window1
name: Yes
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Yes
character count: 3
@ -48,6 +60,9 @@ window1
index: 1
name: Tab 2
state: enabled multi-line selectable sensitive showing visible
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Tab 2
character count: 5
@ -59,6 +74,9 @@ window1
name: No
state: enabled focusable sensitive visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: No
character count: 2

View File

@ -3,12 +3,18 @@ window1
index: 0
state: enabled resizable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: window
alpha: 1
scale1
"slider"
parent: window1
index: 0
state: enabled focusable horizontal sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: 45.5
character count: 5

View File

@ -3,12 +3,18 @@ window1
index: 0
state: enabled resizable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: window
alpha: 1
text1
"text"
parent: window1
index: 0
state: editable enabled focusable multi-line sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Twas brillig, and the slithy toves
Did gyre and gimple in the wabe