Details

[Home]

Issue of the Implementation # S0596

Brief

Type of "accesible-value" property of an AtkObject doesn't conform to AtkValue interface

Detailed Description

The "accessible-value" property of AtkObject has type gdouble. The get/set functions provided for this purpose use the functions from AtkValue interface which should be implemented by the descendant of AtkObject.

However AtkValue works with an arbitrary GValue which may contain data of any type, not only gdouble. For example it can be gint or something else.

This can lead to errors in setting/reading the value of the property. E.g. one cannot read the value of the property "accessible_value", if atk_value_get_current_value returns GValue of type, which differs from G_TYPE_DOUBLE (see example).

Problem location(s) in the standard

ATK 1.9.0 Reference Manual, AtkObject, AtkValue

Example

// Implementation of MyAtkValue that inherits AtkObject 
// and implements AtkValue
...
void 
my_atk_value_get_current_value(AtkValue *obj, GValue* value)
{
    g_value_init(value, G_TYPE_INT);
    g_value_set_int(value, 10);
}
...
int 
main()
{
    gdouble current_value = 0;
    MyAtkValue* obj = g_object_new(MY_TYPE_ATK_VALUE, NULL);
    g_object_get(obj, "accessible-value", &value, NULL);
    
    // Now current_value is still 0 
    // because an error has occured when reading the value.

    ...
    return 0;
}

Possible solutions

Change the type of the "accessible-value" property from gdouble to GValue and adjust the implementation accordingly.

Component

gtk-atk 1.9.0 or later

Accepted

Gnome Bugzilla 504042

[Home]