1 #include "atspi/atspi.h"
7 AtspiEventListener *listener;
10 basic (AtspiAccessible *obj)
15 AtspiAccessible *accessible;
17 str = atspi_accessible_get_name (obj, NULL);
20 accessible = atspi_accessible_get_parent (obj, NULL);
22 g_object_unref (accessible);
23 count = atspi_accessible_get_child_count (obj, NULL);
24 for (i = 0; i < count; i++)
26 accessible = atspi_accessible_get_child_at_index (obj, i, NULL);
28 g_object_unref (accessible);
41 kill_child (void *data)
43 kill (child_pid, SIGTERM);
48 on_event (AtspiEvent *event, void *data)
50 if (atspi_accessible_get_role (event->source, NULL) == ATSPI_ROLE_DESKTOP_FRAME)
52 if (strstr (event->type, "add"))
54 AtspiAccessible *desktop = atspi_get_desktop (0);
57 g_object_unref (desktop);
58 id = g_timeout_add (3000, kill_child, NULL);
59 g_source_set_name_by_id (id, "[at-spi2-core] kill_child");
64 id = g_idle_add (end, NULL);
65 g_source_set_name_by_id (id, "[at-spi2-core] end");
68 g_boxed_free (ATSPI_TYPE_EVENT, event);
76 listener = atspi_event_listener_new (on_event, NULL, NULL);
77 atspi_event_listener_register (listener, "object:children-changed", NULL);
80 execlp ("gedit", "gedit", NULL);