* cspi/spi_accessible.c: (Accessible_getRelationSet):
use NULL, not CORBA_OBJECT_NIL.
* libspi/accessible.c:
(impl_accessibility_accessible_get_relation_set):
allocate the sequence correctly.
* libspi/remoteobject.h: kill spi_remote_object_new.
* test/test-simple.c: (validate_accessible): add code
to test relation sets, now all we need is to figure
out how to excercise this code path :/
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@229
e2bd861d-eb25-0410-b326-
f6ed22b6b98c
+2002-01-24 Mark McLoughlin <mark@skynet.ie>
+
+ * cspi/spi_accessible.c: (Accessible_getRelationSet):
+ use NULL, not CORBA_OBJECT_NIL.
+
+ * libspi/accessible.c:
+ (impl_accessibility_accessible_get_relation_set):
+ allocate the sequence correctly.
+
+ * libspi/remoteobject.h: kill spi_remote_object_new.
+
+ * test/test-simple.c: (validate_accessible): add code
+ to test relation sets, now all we need is to figure
+ out how to excercise this code path :/
+
2002-01-18 Michael Meeks <michael@ximian.com>
* test/test-simple.c
relations[i] = cspi_object_add (CORBA_Object_duplicate (
relation_set->_buffer[i], cspi_ev ()));
}
- relations[i] = CORBA_OBJECT_NIL;
+ relations[i] = NULL;
CORBA_free (relation_set);
relation_set = atk_object_ref_relation_set (object);
n_relations = atk_relation_set_get_n_relations (relation_set);
+
retval = CORBA_sequence_Accessibility_Relation__alloc ();
- CORBA_sequence_Accessibility_Relation_allocbuf (n_relations);
+ retval->_length = retval->_maximum = n_relations;
+ retval->_buffer = CORBA_sequence_Accessibility_Relation_allocbuf (n_relations);
+ CORBA_sequence_set_release (retval, CORBA_TRUE);
for (i = 0; i < n_relations; ++i)
{
ev);
}
- printf ("SpiAccessible get_relation_set.\n");
return retval;
}
} SpiRemoteObjectClass;
GType spi_remote_object_get_type (void);
-AtkObject *spi_remote_object_new (GObject *o);
Accessibility_Accessible spi_remote_object_get_accessible (SpiRemoteObject *o);
G_END_DECLS
gboolean has_parent,
gboolean recurse_down)
{
- Accessible *tmp;
- char *name, *descr;
- AccessibleRole role;
- char *role_name;
- GString *item_str = g_string_new ("");
+ Accessible *tmp;
+ char *name, *descr;
+ AccessibleRole role;
+ AccessibleRelation **relations;
+ char *role_name;
+ GString *item_str = g_string_new ("");
+ int i;
name = Accessible_getName (accessible);
g_assert (name != NULL);
g_assert (role != SPI_ROLE_INVALID);
role_name = Accessible_getRoleName (accessible);
g_assert (role_name != NULL);
-
+
+ relations = Accessible_getRelationSet (accessible);
+ g_assert (relations != NULL);
+
+ for (i = 0; relations [i]; i++) {
+ AccessibleRelationType type;
+ int targets;
+
+ fprintf (stderr, "relation %d\n", i);
+
+ type = AccessibleRelation_getRelationType (relations [i]);
+ g_assert (type != SPI_RELATION_NULL);
+
+ targets = AccessibleRelation_getNTargets (relations [i]);
+ g_assert (targets != -1);
+
+ AccessibleRelation_unref (relations [i]);
+ relations [i] = NULL;
+ }
+ g_free (relations);
if (print_tree) {
int i;