+ SpiAccessible_getName (&ev->source));
+}
+
+
+void
+check_property_change (void *p)
+{
+ SpiAccessibleEvent *ev = (SpiAccessibleEvent *) p;
+ SpiAccessibleSelection *selection = SpiAccessible_getSelection (&ev->source);
+ int n_selections;
+ int i;
+ if (selection)
+ {
+ n_selections = (int) SpiAccessibleSelection_getNSelectedChildren (selection);
+ fprintf (stderr, "(Property) %s event from %s, %d selected children\n", ev->type,
+ SpiAccessible_getName (&ev->source), n_selections);
+ /* for now, speak entire selection set */
+ for (i=0; i<n_selections; ++i)
+ {
+ SpiAccessible *obj = SpiAccessibleSelection_getSelectedChild (selection, (long) i);
+ g_return_if_fail (obj);
+ fprintf (stderr, "Child %d, name=%s\n", i, SpiAccessible_getName (obj));
+ report_focussed_accessible (obj, i==0);
+ }
+ }
+}
+
+static void
+simple_at_exit()
+{
+ deregisterGlobalEventListenerAll (focus_listener);
+ deregisterGlobalEventListenerAll (property_listener);
+ deregisterGlobalEventListenerAll (button_listener);
+ deregisterKeystrokeListener (key_listener, KEYMASK_ALT );
+
+ SPI_exit ();
+}
+
+static boolean
+is_command_key (KeyStroke *key)
+{
+ switch (key->keyID)
+ {
+ case 'Q':
+ case 'q':
+ simple_at_exit();
+ return TRUE; /* not reached */
+ case 'M':
+ case 'm':
+ use_magnifier = ! use_magnifier;
+ return TRUE;
+ case 'F':
+ case 'f':
+ use_festival = ! use_festival;
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+static boolean
+report_key_event (void *p)
+{
+ KeyStroke *key = (KeyStroke *) p;
+ fprintf(stderr, "KeyEvent %s%c (keycode %d)\n",
+ (key->modifiers & KEYMASK_ALT)?"Alt-":"",
+ ((key->modifiers & KEYMASK_SHIFT)^(key->modifiers & KEYMASK_SHIFTLOCK))?
+ (char) toupper((int) key->keyID) : (char) tolower((int) key->keyID),
+ (int) key->keycode);
+ return is_command_key (key);