mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 19:30:10 +00:00
Handle AtkValue implementations that return integer values
We do this by transforming the returned GValue to a string. As a side-effect, the formatting for doubles changes, so adjust expected output to match.
This commit is contained in:
parent
8fdcb60c87
commit
dbf204b5b9
@ -396,17 +396,48 @@ dump_atk_value (AtkValue *atk_value,
|
||||
GString *string)
|
||||
{
|
||||
GValue value = { 0, };
|
||||
GValue svalue = { 0, };
|
||||
|
||||
g_string_append_printf (string, "%*s<AtkValue>\n", depth, "");
|
||||
|
||||
g_value_init (&value, G_TYPE_DOUBLE);
|
||||
g_value_init (&svalue, G_TYPE_STRING);
|
||||
|
||||
atk_value_get_minimum_value (atk_value, &value);
|
||||
g_string_append_printf (string, "%*sminimum value: %g\n", depth, "", g_value_get_double (&value));
|
||||
if (g_value_transform (&value, &svalue))
|
||||
g_string_append_printf (string, "%*sminimum value: %s\n", depth, "", g_value_get_string (&svalue));
|
||||
else
|
||||
g_string_append_printf (string, "%*sminimum value: <%s>\n", depth, "", G_VALUE_TYPE_NAME (&value));
|
||||
|
||||
g_value_reset (&value);
|
||||
g_value_reset (&svalue);
|
||||
|
||||
atk_value_get_maximum_value (atk_value, &value);
|
||||
g_string_append_printf (string, "%*smaximum value: %g\n", depth, "", g_value_get_double (&value));
|
||||
if (g_value_transform (&value, &svalue))
|
||||
g_string_append_printf (string, "%*smaximum value: %s\n", depth, "", g_value_get_string (&svalue));
|
||||
else
|
||||
g_string_append_printf (string, "%*smaximum value: <%s>\n", depth, "", G_VALUE_TYPE_NAME (&value));
|
||||
|
||||
g_value_reset (&value);
|
||||
g_value_reset (&svalue);
|
||||
|
||||
atk_value_get_current_value (atk_value, &value);
|
||||
g_string_append_printf (string, "%*scurrent value: %g\n", depth, "", g_value_get_double (&value));
|
||||
if (g_value_transform (&value, &svalue))
|
||||
g_string_append_printf (string, "%*scurrent value: %s\n", depth, "", g_value_get_string (&svalue));
|
||||
else
|
||||
g_string_append_printf (string, "%*scurrent value: %s\n", depth, "", G_VALUE_TYPE_NAME (&value));
|
||||
|
||||
g_value_reset (&value);
|
||||
g_value_reset (&svalue);
|
||||
|
||||
atk_value_get_minimum_increment (atk_value, &value);
|
||||
g_string_append_printf (string, "%*sminimum increment: %g\n", depth, "", g_value_get_double (&value));
|
||||
if (g_value_transform (&value, &svalue))
|
||||
g_string_append_printf (string, "%*sminimum increment: %s\n", depth, "", g_value_get_string (&svalue));
|
||||
else
|
||||
g_string_append_printf (string, "%*sminimum increment: %s\n", depth, "", G_VALUE_TYPE_NAME (&value));
|
||||
|
||||
g_value_reset (&value);
|
||||
g_value_reset (&svalue);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -16,7 +16,7 @@ window1
|
||||
layer: widget
|
||||
alpha: 1
|
||||
<AtkText>
|
||||
text: 45.5
|
||||
text: ?45.5
|
||||
character count: 5
|
||||
caret offset: 0
|
||||
default attributes: left-margin: 0
|
||||
@ -49,7 +49,7 @@ window1
|
||||
<AtkAction>
|
||||
action 0 name: activate
|
||||
<AtkValue>
|
||||
minimum value: 0.5
|
||||
maximum value: 99.5
|
||||
current value: 45.5
|
||||
minimum increment: 0.5
|
||||
minimum value: 0.500000
|
||||
maximum value: 99.500000
|
||||
current value: 45.500000
|
||||
minimum increment: 0.500000
|
||||
|
Loading…
Reference in New Issue
Block a user