Gathering accessibility information from an application

A program that wishes to make use of ATK calls would likely need to do one (or more) of the following things:

  1. Create an event watcher, for example with the atk_add_focus_tracker() function:

    atk_add_focus_tracker (_my_focus_tracker);

    where _my_focus_tracker() is a function with this prototype:

    void _my_focus_tracker (AtkObject *aobject);
  2. Set up a global event listener, with atk_add_global_event_listener():

    mouse_watcher_focus_id =   atk_add_global_event_listener(_my_global_listener,"Gtk:GtkWidget:enter_notify_event");
    

    where _my_global_listener has the prototype of a Glib GSignalEmissionHook. This example would cause the _my_global_listener() to be called whenever an enter_notify_even signal occurs on a GtkWidget object.

  3. Access the ATK top-level object with the following function call.

    AtkObject *root_obj = atk_get_root();

    This returns an AtkObject which contains all toplevel windows in the currently running program. The user could then navigate through the object hierarchy by accessing the root object's children, which corresponds to the toplevel windows.