2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
26 void report_focus_event (void *fp);
28 void report_button_press (void *fp);
31 main(int argc, char **argv)
37 Accessible *application;
38 AccessibleEventListener *focus_listener;
39 AccessibleEventListener *button_listener;
43 focus_listener = createEventListener (report_focus_event);
44 button_listener = createEventListener (report_button_press);
46 registerGlobalEventListener (focus_listener, "focus:");
47 registerGlobalEventListener (button_listener, "Gtk:GtkWidget:button-press-event");
49 n_desktops = getDesktopCount ();
51 for (i=0; i<n_desktops; ++i)
53 desktop = getDesktop (i);
54 fprintf (stderr, "desktop %d name: %s\n", i, Accessible_getName (desktop));
55 n_apps = Accessible_getChildCount (desktop);
56 for (j=0; j<n_apps; ++j)
58 application = Accessible_getChildAtIndex (desktop, j);
59 fprintf (stderr, "app %d name: %s\n", j, Accessible_getName (application));
62 SPI_event_main(FALSE);
66 report_focus_event (void *p)
68 AccessibleEvent *ev = (AccessibleEvent *) p;
69 fprintf (stderr, "%s event from %s\n", ev->type,
70 Accessible_getName (&ev->source));
74 report_button_press (void *p)
76 AccessibleEvent *ev = (AccessibleEvent *) p;
77 fprintf (stderr, "%s event from %s\n", ev->type,
78 Accessible_getName (&ev->source));