diff options
Diffstat (limited to 'tests/dummyatk/my-atk-object.c')
-rw-r--r-- | tests/dummyatk/my-atk-object.c | 45 |
1 files changed, 11 insertions, 34 deletions
diff --git a/tests/dummyatk/my-atk-object.c b/tests/dummyatk/my-atk-object.c index c20ad7a..c0b3014 100644 --- a/tests/dummyatk/my-atk-object.c +++ b/tests/dummyatk/my-atk-object.c @@ -25,21 +25,6 @@ #include "my-atk-object.h" -struct _MyAtkObject -{ - AtkObject parent; - AtkStateSet *state_set; - AtkAttributeSet *attributes; - AtkRelationSet *relation_set; - GPtrArray* children; - gint id; -}; - -struct _MyAtkObjectClass -{ - AtkObjectClass parent; -}; - GType my_atk_object_get_type (void); G_DEFINE_TYPE (MyAtkObject, @@ -66,7 +51,7 @@ void my_atk_object_remove_child (MyAtkObject* parent, for (i = parent->children->len - 1; i >= 0; i--) { if (g_ptr_array_index (parent->children, i) == child) break; - } + } g_return_if_fail (i < 0); g_ptr_array_remove_index (parent->children, i); g_signal_emit_by_name (parent, "children-changed::remove", i, child); @@ -140,24 +125,16 @@ static AtkStateSet *my_atk_object_ref_state_set (AtkObject *accessible) static AtkAttributeSet *my_atk_object_get_attributes (AtkObject *accessible) { - MyAtkObject *obj = MY_ATK_OBJECT (accessible); - AtkAttributeSet *rs = obj->attributes = NULL; - AtkAttribute *a, *b, *c; - - a = g_new (AtkAttribute, 1); - b = g_new (AtkAttribute, 1); - c = g_new (AtkAttribute, 1); - - a->name = g_strdup ("foo"); - a->value = g_strdup ("bar"); - b->name = g_strdup ("baz"); - b->value = g_strdup ("qux"); - c->name = g_strdup ("quux"); - c->value = g_strdup ("corge"); - - rs = g_slist_append (rs, (gpointer) a); - rs = g_slist_append (rs, (gpointer) b); - rs = g_slist_append (rs, (gpointer) c); + AtkAttributeSet *attributes; + AtkAttribute *attr; + + attr = g_malloc (sizeof (AtkAttribute)); + attr->name = g_strdup ("atspi"); + attr->value = g_strdup ("test"); + + attributes = g_slist_append (NULL, attr); + + return attributes; } static void my_atk_object_init (MyAtkObject *self) |