+report_focus_event (AccessibleEvent *event)
+{
+ char *s = Accessible_getName (event->source);
+ fprintf (stderr, "%s event from %s\n", event->type, s);
+ SPI_freeString (s);
+ report_focussed_accessible (event->source, TRUE);
+}
+
+void
+report_button_press (AccessibleEvent *event)
+{
+ char *s = Accessible_getName (event->source);
+ fprintf (stderr, "%s event from %s\n", event->type, s);
+ SPI_freeString (s);
+ s = Accessible_getDescription (event->source);
+ fprintf (stderr, "Object description %s\n", s);
+ SPI_freeString (s);
+}
+
+
+void
+check_property_change (AccessibleEvent *event)
+{
+ AccessibleSelection *selection = Accessible_getSelection (event->source);
+ int n_selections;
+ int i;
+ char *s;
+ if (selection)
+ {
+ n_selections = (int) AccessibleSelection_getNSelectedChildren (selection);
+ s = Accessible_getName (event->source);
+ fprintf (stderr, "(Property) %s event from %s, %d selected children\n",
+ event->type, s, n_selections);
+ SPI_freeString (s);
+ /* for now, speak entire selection set */
+ for (i=0; i<n_selections; ++i)
+ {
+ Accessible *obj = AccessibleSelection_getSelectedChild (selection, (long) i);
+ g_return_if_fail (obj);
+ s = Accessible_getName (obj);
+ fprintf (stderr, "Child %d, name=%s\n", i, s);
+ SPI_freeString (s);
+ report_focussed_accessible (obj, i==0);
+ }
+ }
+}
+
+static void
+simple_at_exit()
+{
+ deregisterGlobalEventListenerAll (focus_listener);
+ deregisterGlobalEventListenerAll (property_listener);
+ deregisterGlobalEventListenerAll (button_listener);
+
+ deregisterAccessibleKeystrokeListener (command_key_listener, SPI_KEYMASK_ALT );
+ deregisterAccessibleKeystrokeListener (ordinary_key_listener, SPI_KEYMASK_UNMODIFIED );
+ deregisterAccessibleKeystrokeListener (ordinary_key_listener, SPI_KEYMASK_SHIFT );
+ AccessibleKeystrokeListener_unref (command_key_listener);
+ AccessibleKeystrokeListener_unref (ordinary_key_listener);
+
+ SPI_exit ();
+}
+
+static SPIBoolean
+is_command_key (AccessibleKeystroke *key)