Started fixing IDL docs.
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 21 Nov 2001 00:12:35 +0000 (00:12 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 21 Nov 2001 00:12:35 +0000 (00:12 +0000)
Fixes to event dispatching.
Got key notification working for non-preemptive key events, still needs
some work on filters (currently KeySet filters are ignored, you get
all key events that match a given modifier mask).

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@103 e2bd861d-eb25-0410-b326-f6ed22b6b98c

22 files changed:
ChangeLog
at-bridge/bridge.c
atk-bridge/bridge.c
cspi/spi.h
cspi/spi_accessible.c
cspi/spi_registry.c
docs/Makefile.am
idl/Accessibility_Accessible.idl
idl/Accessibility_Action.idl
idl/Accessibility_Application.idl
idl/Accessibility_Registry.idl
idl/Accessible.idl
idl/Action.idl
idl/Application.idl
idl/Registry.idl
libspi/deviceeventcontroller.c
libspi/deviceeventcontroller.h
libspi/registry.c
registryd/deviceeventcontroller.c
registryd/deviceeventcontroller.h
registryd/registry.c
test/simple-at.c

index 4446641..ad1804f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,40 @@
-2001-11-20  Michael Meeks  <michael@ximian.com>
+2001-18-11  Bill Haneman <bill.haneman@sun.com>
+
+       * idl/Accessible.idl:
+       * idl/Application.idl:
+       * idl/Registry.idl:
+       * idl/Action.idl:
+       Started gtk-doc cleanup on IDL.
+
+       * libspi/deviceeventcontroller.c:
+       Added and connected non-preemptive key notification from the
+       toolkits (in addition to the pre-emptive support from XServer
+       which we had before, but which causes 'focus flashing').  Filters
+       are presently limited to key modifiers and global/non-global,
+       KeySets are presently ignored, as are KeyEvent masks.
+
+       Fixed naughtiness in dec_key_listener_new(), we copy the CORBA
+       structs into the persistant structure rather than just storing
+       pointers to things that might not persist across servant
+       invocations.
+
+       The XGrabKey call now does async keygrabs, because synchronous
+       ones were deadlocking with GDK_event code in a very nasty way.
+
+       Added boolean to internal method notify_keylisteners, to indicate
+       whether the event came from the 'toolkit source' or the 'global
+       (XServer) source' - this is used in the notification process to
+       determine which listeners to send the event to.
+       
+       * libspi/registry.c:
+       Fixed regression in application de-registration.
+       Also fixed some really brain-dead weirdness having to do with
+       event dispatching - event structs are now duplicated before being
+       re-marshalled in the dispatch to listeners.  This also fixes a
+       Solaris build problem.
+       
+       
+2001-20-11  Michael Meeks  <michael@ximian.com>
 
        * libspi/registry.c
        (impl_accessibility_registry_deregister_global_event_listener): 
 
        * libspi/registry.c
        (impl_accessibility_registry_deregister_global_event_listener): 
@@ -15,7 +51,7 @@
        * libspi/application.h: kill unused ( and whacked out )
        gboolean *spi_application_set_id (AtkObject *app, long id);
 
        * libspi/application.h: kill unused ( and whacked out )
        gboolean *spi_application_set_id (AtkObject *app, long id);
 
-2001-11-20  Michael Meeks  <michael@ximian.com>
+2001-20-11  Michael Meeks  <michael@ximian.com>
 
        * libspi/*.[ch]: further convert to bonobo's type func
        macros, remove redundnant casts etc.
 
        * libspi/*.[ch]: further convert to bonobo's type func
        macros, remove redundnant casts etc.
@@ -32,7 +68,7 @@
 
        * */.cvsignore: update
        
 
        * */.cvsignore: update
        
-2001-11-20  Michael Meeks  <michael@ximian.com>
+2001-20-11  Michael Meeks  <michael@ximian.com>
 
        * libspi/deviceeventcontroller.c
        (_controller_register_with_devices): use g_getenv,
 
        * libspi/deviceeventcontroller.c
        (_controller_register_with_devices): use g_getenv,
@@ -47,7 +83,7 @@
 
        * libspi/*.[ch]: more headers, includes and over commenting.
        
 
        * libspi/*.[ch]: more headers, includes and over commenting.
        
-2001-11-20  Michael Meeks  <michael@ximian.com>
+2001-20-11  Michael Meeks  <michael@ximian.com>
 
        * libspi/*.[ch]: fixup headers, includes and over commenting.
 
 
        * libspi/*.[ch]: fixup headers, includes and over commenting.
 
@@ -59,7 +95,7 @@
 
        * libspi/libspi.h: add.
 
 
        * libspi/libspi.h: add.
 
-2001-11-19  Michael Meeks  <michael@ximian.com>
+2001-19-11  Michael Meeks  <michael@ximian.com>
 
        * libspi/editabletext.c (impl_setAttributes): fix warnings.
 
 
        * libspi/editabletext.c (impl_setAttributes): fix warnings.
 
index 6c66892..29fb569 100644 (file)
@@ -64,8 +64,7 @@ static gboolean bridge_signal_listener (GSignalInvocationHint *signal_hint,
                                        const GValue *param_values,
                                        gpointer data);
 
                                        const GValue *param_values,
                                        gpointer data);
 
-static gint bridge_key_listener (AtkImplementor *atk_impl,
-                                AtkKeyEventStruct *event,
+static gint bridge_key_listener (AtkKeyEventStruct *event,
                                 gpointer data);
 
 int
                                 gpointer data);
 
 int
@@ -137,14 +136,10 @@ register_atk_event_listeners ()
    * the AtkText signal handlers below won't get registered
    */
 
    * the AtkText signal handlers below won't get registered
    */
 
-  AtkNoOpObject *o = atk_no_op_object_new (g_object_new (ATK_TYPE_OBJECT, NULL));
+  AtkObject *o = atk_no_op_object_new (g_object_new (ATK_TYPE_OBJECT, NULL));
 
   /* Register for focus event notifications, and register app with central registry  */
 
 
   /* Register for focus event notifications, and register app with central registry  */
 
-  g_type_class_ref (ATK_TYPE_TEXT);
-  g_type_class_ref (ATK_TYPE_SELECTION);
-  g_type_class_ref (ATK_TYPE_TABLE);
-
   atk_add_focus_tracker (bridge_focus_tracker);
   atk_add_global_event_listener (bridge_property_event_listener, "Gtk:AtkObject:property-change");
   atk_add_global_event_listener (bridge_signal_listener, "Gtk:AtkObject:children-changed");
   atk_add_focus_tracker (bridge_focus_tracker);
   atk_add_global_event_listener (bridge_property_event_listener, "Gtk:AtkObject:property-change");
   atk_add_global_event_listener (bridge_signal_listener, "Gtk:AtkObject:children-changed");
@@ -284,17 +279,49 @@ bridge_state_event_listener (GSignalInvocationHint *signal_hint,
   return TRUE;
 }
 
   return TRUE;
 }
 
-static gint
-bridge_key_listener (AtkImplementor *atk_impl, AtkKeyEventStruct *event, gpointer data)
+#define SPI_DEBUG
+
+static Accessibility_KeyStroke *
+accessibility_keystroke_from_atk_key_event (AtkKeyEventStruct *event)
 {
 {
-  Accessibility_KeyStroke *key_event;
-  static Accessibility_DeviceEventController controller = CORBA_OBJECT_NIL;
-  if (controller == CORBA_OBJECT_NIL)
+  Accessibility_KeyStroke *keystroke;
+  keystroke = Accessibility_KeyStroke__alloc ();
+
+#ifdef SPI_DEBUG
+  if (event) g_print ("event %c (%d)\n", (int) event->keyval, (int) event->keycode);
+  else
+#endif
+  if (!event) g_print ("WARNING: NULL key event!");
+  
+  keystroke->keyID = (CORBA_long) event->keyval;
+  keystroke->keycode = (CORBA_short) event->keycode;
+  keystroke->timestamp = (CORBA_unsigned_long) event->timestamp;
+  keystroke->modifiers = (CORBA_unsigned_short) (event->state & 0xFFFF);
+
+  switch (event->type)
     {
     {
-      controller = Accessibility_Registry_getDeviceEventController (registry, &ev);
+    case (ATK_KEY_EVENT_PRESS):
+           keystroke->type = Accessibility_KEY_PRESSED;
+           break;
+    case (ATK_KEY_EVENT_RELEASE):
+           keystroke->type = Accessibility_KEY_RELEASED;
+           break;
+    default:
     }
     }
-  g_print ("bridge key listener fired!\n");
-/* Accessibility_DeviceEventController_notifyListenersSync (controller, key_event, &ev); */
+  
+  return keystroke;
+}
+
+static gint
+bridge_key_listener (AtkKeyEventStruct *event, gpointer data)
+{
+  Accessibility_KeyStroke *key_event = accessibility_keystroke_from_atk_key_event (event);
+  CORBA_boolean result;
+  Accessibility_DeviceEventController controller =
+         Accessibility_Registry_getDeviceEventController (registry, &ev);
+  result = Accessibility_DeviceEventController_notifyListenersSync (controller,
+                                                                   (Accessibility_DeviceEvent *) key_event,
+                                                                   &ev);
 }
 
 static gboolean
 }
 
 static gboolean
index 6c66892..29fb569 100644 (file)
@@ -64,8 +64,7 @@ static gboolean bridge_signal_listener (GSignalInvocationHint *signal_hint,
                                        const GValue *param_values,
                                        gpointer data);
 
                                        const GValue *param_values,
                                        gpointer data);
 
-static gint bridge_key_listener (AtkImplementor *atk_impl,
-                                AtkKeyEventStruct *event,
+static gint bridge_key_listener (AtkKeyEventStruct *event,
                                 gpointer data);
 
 int
                                 gpointer data);
 
 int
@@ -137,14 +136,10 @@ register_atk_event_listeners ()
    * the AtkText signal handlers below won't get registered
    */
 
    * the AtkText signal handlers below won't get registered
    */
 
-  AtkNoOpObject *o = atk_no_op_object_new (g_object_new (ATK_TYPE_OBJECT, NULL));
+  AtkObject *o = atk_no_op_object_new (g_object_new (ATK_TYPE_OBJECT, NULL));
 
   /* Register for focus event notifications, and register app with central registry  */
 
 
   /* Register for focus event notifications, and register app with central registry  */
 
-  g_type_class_ref (ATK_TYPE_TEXT);
-  g_type_class_ref (ATK_TYPE_SELECTION);
-  g_type_class_ref (ATK_TYPE_TABLE);
-
   atk_add_focus_tracker (bridge_focus_tracker);
   atk_add_global_event_listener (bridge_property_event_listener, "Gtk:AtkObject:property-change");
   atk_add_global_event_listener (bridge_signal_listener, "Gtk:AtkObject:children-changed");
   atk_add_focus_tracker (bridge_focus_tracker);
   atk_add_global_event_listener (bridge_property_event_listener, "Gtk:AtkObject:property-change");
   atk_add_global_event_listener (bridge_signal_listener, "Gtk:AtkObject:children-changed");
@@ -284,17 +279,49 @@ bridge_state_event_listener (GSignalInvocationHint *signal_hint,
   return TRUE;
 }
 
   return TRUE;
 }
 
-static gint
-bridge_key_listener (AtkImplementor *atk_impl, AtkKeyEventStruct *event, gpointer data)
+#define SPI_DEBUG
+
+static Accessibility_KeyStroke *
+accessibility_keystroke_from_atk_key_event (AtkKeyEventStruct *event)
 {
 {
-  Accessibility_KeyStroke *key_event;
-  static Accessibility_DeviceEventController controller = CORBA_OBJECT_NIL;
-  if (controller == CORBA_OBJECT_NIL)
+  Accessibility_KeyStroke *keystroke;
+  keystroke = Accessibility_KeyStroke__alloc ();
+
+#ifdef SPI_DEBUG
+  if (event) g_print ("event %c (%d)\n", (int) event->keyval, (int) event->keycode);
+  else
+#endif
+  if (!event) g_print ("WARNING: NULL key event!");
+  
+  keystroke->keyID = (CORBA_long) event->keyval;
+  keystroke->keycode = (CORBA_short) event->keycode;
+  keystroke->timestamp = (CORBA_unsigned_long) event->timestamp;
+  keystroke->modifiers = (CORBA_unsigned_short) (event->state & 0xFFFF);
+
+  switch (event->type)
     {
     {
-      controller = Accessibility_Registry_getDeviceEventController (registry, &ev);
+    case (ATK_KEY_EVENT_PRESS):
+           keystroke->type = Accessibility_KEY_PRESSED;
+           break;
+    case (ATK_KEY_EVENT_RELEASE):
+           keystroke->type = Accessibility_KEY_RELEASED;
+           break;
+    default:
     }
     }
-  g_print ("bridge key listener fired!\n");
-/* Accessibility_DeviceEventController_notifyListenersSync (controller, key_event, &ev); */
+  
+  return keystroke;
+}
+
+static gint
+bridge_key_listener (AtkKeyEventStruct *event, gpointer data)
+{
+  Accessibility_KeyStroke *key_event = accessibility_keystroke_from_atk_key_event (event);
+  CORBA_boolean result;
+  Accessibility_DeviceEventController controller =
+         Accessibility_Registry_getDeviceEventController (registry, &ev);
+  result = Accessibility_DeviceEventController_notifyListenersSync (controller,
+                                                                   (Accessibility_DeviceEvent *) key_event,
+                                                                   &ev);
 }
 
 static gboolean
 }
 
 static gboolean
index b29719e..97e6409 100644 (file)
@@ -86,6 +86,7 @@ typedef struct _AccessibleKeyStroke
 {
        long keyID;
        short keycode;
 {
        long keyID;
        short keycode;
+       long timestamp;
        AccessibleKeyEventType type;
        unsigned short modifiers;
 } AccessibleKeyStroke;
        AccessibleKeyEventType type;
        unsigned short modifiers;
 } AccessibleKeyStroke;
index 31fb819..72a0dfa 100644 (file)
@@ -928,6 +928,9 @@ AccessibleStateSet_equals (AccessibleStateSet *obj,
  * AccessibleStateSet_compare:
  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
  * AccessibleStateSet_compare:
  * @obj: a pointer to the first #AccessibleStateSet object on which to operate.
  * @obj2: a pointer to the second #AccessibleStateSet object on which to operate.
+ * @differenceSet: a pointer to an array of #AccessibleStates, which is set when the
+ *        fuction returns to point to an array of states representing the states which
+ *        the two state sets do not have in common.
  *
  * Determine the differences between two instances of #AccessibleStateSet.
  *.
  *
  * Determine the differences between two instances of #AccessibleStateSet.
  *.
index 40f81b7..382f253 100644 (file)
@@ -1,3 +1,24 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
 
 /*
  *
 
 /*
  *
index 04b55a8..4b474bc 100644 (file)
@@ -12,7 +12,7 @@ DOC_MODULE=at-spi
 DOC_MAIN_SGML_FILE=at-spi-docs.sgml
 
 # The directory containing the source code (if it contains documentation).
 DOC_MAIN_SGML_FILE=at-spi-docs.sgml
 
 # The directory containing the source code (if it contains documentation).
-DOC_SOURCE_DIR=../cspi
+DOC_SOURCE_DIR=../cspi ../idl
 
 INSTALLDIR=$(prefix)/share/gtk-doc
 
 
 INSTALLDIR=$(prefix)/share/gtk-doc
 
index 09735cb..dae5ed1 100644 (file)
@@ -36,33 +36,32 @@ module Accessibility {
   interface Accessible : Bonobo::Unknown {
 
     /**
   interface Accessible : Bonobo::Unknown {
 
     /**
-     * #attribute name: a (short) @string representing the object's name.
+     * @name: a (short) #string representing the object's name.
      **/
     attribute string name;
 
     /**
      **/
     attribute string name;
 
     /**
-     * #attribute description: a @string describing the object in more detail than @name.
+     * @description: a #string describing the object in more detail than @name.
      **/
     attribute string description;
 
     /**
      **/
     attribute string description;
 
     /**
-     * #attribute parent: an @Accessible object which is this object's containing object.
+     * @parent: an #Accessible object which is this object's containing object.
      **/
     readonly attribute Accessible parent;
 
     /**
      **/
     readonly attribute Accessible parent;
 
     /**
-     * getChildCount:
-     * return values: the number of children contained by this object (zero if none).
-     *
-     * Get the number of children contained by this object.
-     *
+     * @childCount: the number of children contained by this object.
      **/
     readonly attribute long            childCount;
 
     /**
      * isEqual:
      **/
     readonly attribute long            childCount;
 
     /**
      * isEqual:
-     * @object: an #Accessible object reference to compare to
-     * return values: a #boolean indicating whether the two object references
+     * @obj: an #Accessible object reference to compare to
+     *
+     * Determine whether an #Accessible refers to the same object as another
+     *
+     * Returns: a #boolean indicating whether the two object references
      *         point to the same object. 
      **/
     boolean isEqual (in Accessible obj);
      *         point to the same object. 
      **/
     boolean isEqual (in Accessible obj);
@@ -70,45 +69,44 @@ module Accessibility {
     /**
      * getChildAtIndex:
      * @index: an in parameter indicating which child is requested (zero-indexed).
     /**
      * getChildAtIndex:
      * @index: an in parameter indicating which child is requested (zero-indexed).
-     * return values: the 'nth' @Accessible child of this object.
      *
      * Get the accessible child of this object at index @index.
      *
      *
      * Get the accessible child of this object at index @index.
      *
+     * Returns: the 'nth' @Accessible child of this object.
      **/
     Accessible         getChildAtIndex (in long index);
 
     /**
      * getIndexInParent:
      **/
     Accessible         getChildAtIndex (in long index);
 
     /**
      * getIndexInParent:
-     * return values: a long integer indicating this object's index in the parent's list.
      *
      * Get the index of this object in its parent's child list.
      *
      *
      * Get the index of this object in its parent's child list.
      *
+     * Returns: a long integer indicating this object's index in the parent's list.
      **/
     long               getIndexInParent ();
 
     /**
      * getRelationSet:
      **/
     long               getIndexInParent ();
 
     /**
      * getRelationSet:
-     * return values: a @RelationSet defining this object's relationships.
      *
      * Get a set defining this object's relationship to other accessible objects.
      *
      *
      * Get a set defining this object's relationship to other accessible objects.
      *
+     * Returns: a @RelationSet defining this object's relationships.
      **/
     RelationSet        getRelationSet ();
 
     /**
      * getRole:
      **/
     RelationSet        getRelationSet ();
 
     /**
      * getRole:
-     * return values: the @Role of this object.
-     *
      * Get the @Role indicating the type of UI role played by this object.
      *
      * Get the @Role indicating the type of UI role played by this object.
      *
+     * Returns: a @Role indicating the type of UI role played by this object.
      **/
     Role               getRole ();
 
     /**
      * getState:
      **/
     Role               getRole ();
 
     /**
      * getState:
-     * return values: a @StateSet encapsulating the currently true states of the object.
      *
      * Get the current state of the object as a @StateSet.
      *
      * Get the current state of the object as a @StateSet.
+     * Returns: a @StateSet encapsulating the currently true states of the object.
      **/
     StateSet   getState ();
   };
      **/
     StateSet   getState ();
   };
index 95fd5ca..7a458c7 100644 (file)
@@ -25,7 +25,7 @@ module Accessibility {
   interface Action : Bonobo::Unknown {
 
     /**
   interface Action : Bonobo::Unknown {
 
     /**
-     * nActionss: a @long containing the number of actions this object supports.
+     * nActions: a @long containing the number of actions this object supports.
      * 
      **/
     readonly attribute long nActions;
      * 
      **/
     readonly attribute long nActions;
@@ -37,7 +37,7 @@ module Accessibility {
      *
      * Gets the description of the specified action.
      *
      *
      * Gets the description of the specified action.
      *
-     * return values: a @wstring containing the description of the specified action.
+     * Returns: a @wstring containing the description of the specified action.
      *
      **/
     string getDescription (in long index);
      *
      **/
     string getDescription (in long index);
@@ -49,7 +49,7 @@ module Accessibility {
      *
      * Gets the name of the specified action.
      *
      *
      * Gets the name of the specified action.
      *
-     * return values: a @string containing the name of the specified action.
+     * Returns: a @string containing the name of the specified action.
      *
      **/
     string getName (in long index);
      *
      **/
     string getName (in long index);
@@ -60,20 +60,20 @@ module Accessibility {
      *
      * Causes the object to perform the specified action.
      *
      *
      * Causes the object to perform the specified action.
      *
-     * return values: a @boolean indicating success or failure.
+     * Returns: a @boolean indicating success or failure.
      *
      **/
     boolean doAction (in long index);
 
     /**
      * getKeyBinding:
      *
      **/
     boolean doAction (in long index);
 
     /**
      * getKeyBinding:
-     * return values: a @string containing the key binding for the specified action,
-     *   "" if none exists.
      * @index: an %in parameter specifying the 0-based index of the action 
      *   for which a key binding is requested.
      *
      * Gets the key binding associated with a specific action.
      *
      * @index: an %in parameter specifying the 0-based index of the action 
      *   for which a key binding is requested.
      *
      * Gets the key binding associated with a specific action.
      *
+     * Returns: a @string containing the key binding for the specified action,
+     *   "" if none exists.
      **/
     string getKeyBinding (in long index);
   };
      **/
     string getKeyBinding (in long index);
   };
index 01deff3..b921af6 100644 (file)
@@ -30,7 +30,8 @@ module Accessibility {
   interface Application : Accessible {
 
     /**
   interface Application : Accessible {
 
     /**
-     * Get a string indicating the type of user interface toolkit
+     * @toolkitName:
+     * A string indicating the type of user interface toolkit
      * which is used by the application.
      * Ordinarily clients of @AccessibleApplication should be
      * toolkit-agnostic, dependencies on this method probably
      * which is used by the application.
      * Ordinarily clients of @AccessibleApplication should be
      * toolkit-agnostic, dependencies on this method probably
@@ -39,46 +40,63 @@ module Accessibility {
     readonly attribute string toolkitName;
 
     /**
     readonly attribute string toolkitName;
 
     /**
-     * Get a string indicating the version number of the application's
+     * @version:
+     * A string indicating the version number of the application's
      * accessibility bridge implementation.
      **/
     readonly attribute string version;
 
     /**
      * accessibility bridge implementation.
      **/
     readonly attribute string version;
 
     /**
-     * Get the application instance's unique ID as assigned by the registry.
-     *
+     * @id:
+     * The application instance's unique ID as assigned by the registry.
      **/
     attribute long id;
 
     /**
      **/
     attribute long id;
 
     /**
+     * registerToolkitEventListener:
+     * @listener: an #EventListener object which will receive the requested
+     *            events from the application's toolkits via toolit 'bridges'
+     * @eventName: a UTF-8 string indicating the type of (toolkit-specific) event
+     *            being requested.  Not all applications can generate toolkit events of
+     *            a given type.
+     *
      * Register with this application's toolkit for "toolkit-specific" event notifications.
      * Register with this application's toolkit for "toolkit-specific" event notifications.
+     *       For most event support, clients should use non-toolkit-specific events
+     *       whenever possible, via #Registry::registerGlobalEventListener - this method 
+     *       is provided as a 'back door' when generic names do not exist for the events in question.
+     * SUBJECT TO DEPRECATION in favor of Registry::registerGlobalEventListener forms.
      *
      **/
     void registerToolkitEventListener (in EventListener listener, in string eventName);
 
     /**
      *
      **/
     void registerToolkitEventListener (in EventListener listener, in string eventName);
 
     /**
-     * Register with this application's toolkit for "Accessibility::Accessible" 
-     * event notifications.
+     * registerObjectEventListener:
+     * @listener: an #EventListener object which will receive the requested
+     *            events
+     * @eventName: a UTF-8 string indicating the type of (toolkit-specific) event
+     *            being requested.  
+     * Register with this application toolkit for "Accessibility::Accessible" 
+     * event notifications. SUBJECT TO DEPRECATION
      *
      **/
     void registerObjectEventListener (in EventListener listener, in string eventName);
 
     /**
      * pause:
      *
      **/
     void registerObjectEventListener (in EventListener listener, in string eventName);
 
     /**
      * pause:
-     * Returns: %true if the request succeeded, %false otherwise.
      *
      * Request that the application temporarily stop sending events.
      * In most cases this should pause the application's main event loop.
      *
      *
      * Request that the application temporarily stop sending events.
      * In most cases this should pause the application's main event loop.
      *
+     * Returns: %true if the request succeeded, %false otherwise.
      **/
     boolean       pause ();
 
     /**
      * resume:
      **/
     boolean       pause ();
 
     /**
      * resume:
-     * Returns: %true if the request succeeded, %false otherwise.
      *
      * Request that the application resume sending events.
      *
      *
      * Request that the application resume sending events.
      *
+     * Returns: %true if the request succeeded, %false otherwise.
      **/
     boolean       resume ();
   };
      **/
     boolean       resume ();
   };
index 2e56cf3..52d3c2a 100644 (file)
@@ -39,7 +39,6 @@ module Accessibility {
        /**
          * registerApplication:
          * @application: a reference to the requesting @Application
        /**
          * registerApplication:
          * @application: a reference to the requesting @Application
-        * return values: void
          *
          * Register a new application with the accessibility broker.
          *
          *
          * Register a new application with the accessibility broker.
          *
@@ -50,8 +49,7 @@ module Accessibility {
          * deregisterApplication:
          * @application: a reference to the @Application 
          * to be deregistered.
          * deregisterApplication:
          * @application: a reference to the @Application 
          * to be deregistered.
-        * return values: void
-         *
+        *
          * De-register an application previously registered with the broker.
          *
         **/
          * De-register an application previously registered with the broker.
          *
         **/
@@ -62,7 +60,6 @@ module Accessibility {
          * @listener: a reference to the requesting @EventListener.
          * @eventName: a string which indicates the type of events about 
          * which the client desires notification.
          * @listener: a reference to the requesting @EventListener.
          * @eventName: a string which indicates the type of events about 
          * which the client desires notification.
-        * return values: void
          *
          * Register a client's interest in (all) application events of 
          * a certain type.
          *
          * Register a client's interest in (all) application events of 
          * a certain type.
@@ -75,7 +72,6 @@ module Accessibility {
          * deregisterGlobalEventListener:
          * @listener: the requesting @EventListener
          * @eventName: a string indicating the type of events
          * deregisterGlobalEventListener:
          * @listener: the requesting @EventListener
          * @eventName: a string indicating the type of events
-        * return values: void
          *
          * Request that a previously registered client stop receiving
          * global notifications for events of a certain type.
          *
          * Request that a previously registered client stop receiving
          * global notifications for events of a certain type.
@@ -87,7 +83,6 @@ module Accessibility {
          * deregisterGlobalEventListener:
          * @listener: the requesting @EventListener
          * @eventName: a string indicating the type of events
          * deregisterGlobalEventListener:
          * @listener: the requesting @EventListener
          * @eventName: a string indicating the type of events
-        * return values: void
          *
          * Request that a previously registered client stop receiving
          * global notifications for events of a certain type.
          *
          * Request that a previously registered client stop receiving
          * global notifications for events of a certain type.
@@ -115,38 +110,37 @@ module Accessibility {
 
        /**
          * getDesktopCount:
 
        /**
          * getDesktopCount:
-        * return values: a short integer indicating the current number of 
-         * @Desktops.
          *
          * Get the current number of desktops.
          *
          * Get the current number of desktops.
-         *
+        * Returns: a short integer indicating the current number of 
+         * @Desktops.
         **/
         short getDesktopCount ();
 
        /**
          * getDesktop:
          * @n: the index of the requested @Desktop.
         **/
         short getDesktopCount ();
 
        /**
          * getDesktop:
          * @n: the index of the requested @Desktop.
-        * return values: a reference to the requested @Desktop.
          *
          * Get the nth accessible desktop. 
          *
          *
          * Get the nth accessible desktop. 
          *
+        * Returns: a reference to the requested @Desktop.
         **/
         Desktop getDesktop (in short n);
 
        /**
          * getDesktopList:
         **/
         Desktop getDesktop (in short n);
 
        /**
          * getDesktopList:
-        * return values: a sequence containing references to
-         * the @Desktops.
          *
          * Get a list of accessible desktops. 
          *
          *
          * Get a list of accessible desktops. 
          *
+        * Returns: a sequence containing references to
+         * the @Desktops.
         **/
         DesktopSeq getDesktopList ();
 
        /**
          * getDeviceEventController:
         **/
         DesktopSeq getDesktopList ();
 
        /**
          * getDeviceEventController:
-        * return values: an object implementing DeviceEventController
          *
          *
+        * Returns: an object implementing DeviceEventController
         **/
         DeviceEventController getDeviceEventController ();
 
         **/
         DeviceEventController getDeviceEventController ();
 
@@ -257,11 +251,9 @@ module Accessibility {
                                        in KeyEventTypeSeq type,
                                        in boolean is_synchronous);
     
                                        in KeyEventTypeSeq type,
                                        in boolean is_synchronous);
     
-        boolean notifyListenersSync (in DeviceEventListener listener,
-                                    in DeviceEvent event);
+        boolean notifyListenersSync (in DeviceEvent event);
 
 
-        oneway void notifyListenersAsync (in DeviceEventListener listener,
-                                         in DeviceEvent event);
+        oneway void notifyListenersAsync (in DeviceEvent event);
 
         /**
          * generateKeyEvent:
 
         /**
          * generateKeyEvent:
index 09735cb..dae5ed1 100644 (file)
@@ -36,33 +36,32 @@ module Accessibility {
   interface Accessible : Bonobo::Unknown {
 
     /**
   interface Accessible : Bonobo::Unknown {
 
     /**
-     * #attribute name: a (short) @string representing the object's name.
+     * @name: a (short) #string representing the object's name.
      **/
     attribute string name;
 
     /**
      **/
     attribute string name;
 
     /**
-     * #attribute description: a @string describing the object in more detail than @name.
+     * @description: a #string describing the object in more detail than @name.
      **/
     attribute string description;
 
     /**
      **/
     attribute string description;
 
     /**
-     * #attribute parent: an @Accessible object which is this object's containing object.
+     * @parent: an #Accessible object which is this object's containing object.
      **/
     readonly attribute Accessible parent;
 
     /**
      **/
     readonly attribute Accessible parent;
 
     /**
-     * getChildCount:
-     * return values: the number of children contained by this object (zero if none).
-     *
-     * Get the number of children contained by this object.
-     *
+     * @childCount: the number of children contained by this object.
      **/
     readonly attribute long            childCount;
 
     /**
      * isEqual:
      **/
     readonly attribute long            childCount;
 
     /**
      * isEqual:
-     * @object: an #Accessible object reference to compare to
-     * return values: a #boolean indicating whether the two object references
+     * @obj: an #Accessible object reference to compare to
+     *
+     * Determine whether an #Accessible refers to the same object as another
+     *
+     * Returns: a #boolean indicating whether the two object references
      *         point to the same object. 
      **/
     boolean isEqual (in Accessible obj);
      *         point to the same object. 
      **/
     boolean isEqual (in Accessible obj);
@@ -70,45 +69,44 @@ module Accessibility {
     /**
      * getChildAtIndex:
      * @index: an in parameter indicating which child is requested (zero-indexed).
     /**
      * getChildAtIndex:
      * @index: an in parameter indicating which child is requested (zero-indexed).
-     * return values: the 'nth' @Accessible child of this object.
      *
      * Get the accessible child of this object at index @index.
      *
      *
      * Get the accessible child of this object at index @index.
      *
+     * Returns: the 'nth' @Accessible child of this object.
      **/
     Accessible         getChildAtIndex (in long index);
 
     /**
      * getIndexInParent:
      **/
     Accessible         getChildAtIndex (in long index);
 
     /**
      * getIndexInParent:
-     * return values: a long integer indicating this object's index in the parent's list.
      *
      * Get the index of this object in its parent's child list.
      *
      *
      * Get the index of this object in its parent's child list.
      *
+     * Returns: a long integer indicating this object's index in the parent's list.
      **/
     long               getIndexInParent ();
 
     /**
      * getRelationSet:
      **/
     long               getIndexInParent ();
 
     /**
      * getRelationSet:
-     * return values: a @RelationSet defining this object's relationships.
      *
      * Get a set defining this object's relationship to other accessible objects.
      *
      *
      * Get a set defining this object's relationship to other accessible objects.
      *
+     * Returns: a @RelationSet defining this object's relationships.
      **/
     RelationSet        getRelationSet ();
 
     /**
      * getRole:
      **/
     RelationSet        getRelationSet ();
 
     /**
      * getRole:
-     * return values: the @Role of this object.
-     *
      * Get the @Role indicating the type of UI role played by this object.
      *
      * Get the @Role indicating the type of UI role played by this object.
      *
+     * Returns: a @Role indicating the type of UI role played by this object.
      **/
     Role               getRole ();
 
     /**
      * getState:
      **/
     Role               getRole ();
 
     /**
      * getState:
-     * return values: a @StateSet encapsulating the currently true states of the object.
      *
      * Get the current state of the object as a @StateSet.
      *
      * Get the current state of the object as a @StateSet.
+     * Returns: a @StateSet encapsulating the currently true states of the object.
      **/
     StateSet   getState ();
   };
      **/
     StateSet   getState ();
   };
index 95fd5ca..7a458c7 100644 (file)
@@ -25,7 +25,7 @@ module Accessibility {
   interface Action : Bonobo::Unknown {
 
     /**
   interface Action : Bonobo::Unknown {
 
     /**
-     * nActionss: a @long containing the number of actions this object supports.
+     * nActions: a @long containing the number of actions this object supports.
      * 
      **/
     readonly attribute long nActions;
      * 
      **/
     readonly attribute long nActions;
@@ -37,7 +37,7 @@ module Accessibility {
      *
      * Gets the description of the specified action.
      *
      *
      * Gets the description of the specified action.
      *
-     * return values: a @wstring containing the description of the specified action.
+     * Returns: a @wstring containing the description of the specified action.
      *
      **/
     string getDescription (in long index);
      *
      **/
     string getDescription (in long index);
@@ -49,7 +49,7 @@ module Accessibility {
      *
      * Gets the name of the specified action.
      *
      *
      * Gets the name of the specified action.
      *
-     * return values: a @string containing the name of the specified action.
+     * Returns: a @string containing the name of the specified action.
      *
      **/
     string getName (in long index);
      *
      **/
     string getName (in long index);
@@ -60,20 +60,20 @@ module Accessibility {
      *
      * Causes the object to perform the specified action.
      *
      *
      * Causes the object to perform the specified action.
      *
-     * return values: a @boolean indicating success or failure.
+     * Returns: a @boolean indicating success or failure.
      *
      **/
     boolean doAction (in long index);
 
     /**
      * getKeyBinding:
      *
      **/
     boolean doAction (in long index);
 
     /**
      * getKeyBinding:
-     * return values: a @string containing the key binding for the specified action,
-     *   "" if none exists.
      * @index: an %in parameter specifying the 0-based index of the action 
      *   for which a key binding is requested.
      *
      * Gets the key binding associated with a specific action.
      *
      * @index: an %in parameter specifying the 0-based index of the action 
      *   for which a key binding is requested.
      *
      * Gets the key binding associated with a specific action.
      *
+     * Returns: a @string containing the key binding for the specified action,
+     *   "" if none exists.
      **/
     string getKeyBinding (in long index);
   };
      **/
     string getKeyBinding (in long index);
   };
index 01deff3..b921af6 100644 (file)
@@ -30,7 +30,8 @@ module Accessibility {
   interface Application : Accessible {
 
     /**
   interface Application : Accessible {
 
     /**
-     * Get a string indicating the type of user interface toolkit
+     * @toolkitName:
+     * A string indicating the type of user interface toolkit
      * which is used by the application.
      * Ordinarily clients of @AccessibleApplication should be
      * toolkit-agnostic, dependencies on this method probably
      * which is used by the application.
      * Ordinarily clients of @AccessibleApplication should be
      * toolkit-agnostic, dependencies on this method probably
@@ -39,46 +40,63 @@ module Accessibility {
     readonly attribute string toolkitName;
 
     /**
     readonly attribute string toolkitName;
 
     /**
-     * Get a string indicating the version number of the application's
+     * @version:
+     * A string indicating the version number of the application's
      * accessibility bridge implementation.
      **/
     readonly attribute string version;
 
     /**
      * accessibility bridge implementation.
      **/
     readonly attribute string version;
 
     /**
-     * Get the application instance's unique ID as assigned by the registry.
-     *
+     * @id:
+     * The application instance's unique ID as assigned by the registry.
      **/
     attribute long id;
 
     /**
      **/
     attribute long id;
 
     /**
+     * registerToolkitEventListener:
+     * @listener: an #EventListener object which will receive the requested
+     *            events from the application's toolkits via toolit 'bridges'
+     * @eventName: a UTF-8 string indicating the type of (toolkit-specific) event
+     *            being requested.  Not all applications can generate toolkit events of
+     *            a given type.
+     *
      * Register with this application's toolkit for "toolkit-specific" event notifications.
      * Register with this application's toolkit for "toolkit-specific" event notifications.
+     *       For most event support, clients should use non-toolkit-specific events
+     *       whenever possible, via #Registry::registerGlobalEventListener - this method 
+     *       is provided as a 'back door' when generic names do not exist for the events in question.
+     * SUBJECT TO DEPRECATION in favor of Registry::registerGlobalEventListener forms.
      *
      **/
     void registerToolkitEventListener (in EventListener listener, in string eventName);
 
     /**
      *
      **/
     void registerToolkitEventListener (in EventListener listener, in string eventName);
 
     /**
-     * Register with this application's toolkit for "Accessibility::Accessible" 
-     * event notifications.
+     * registerObjectEventListener:
+     * @listener: an #EventListener object which will receive the requested
+     *            events
+     * @eventName: a UTF-8 string indicating the type of (toolkit-specific) event
+     *            being requested.  
+     * Register with this application toolkit for "Accessibility::Accessible" 
+     * event notifications. SUBJECT TO DEPRECATION
      *
      **/
     void registerObjectEventListener (in EventListener listener, in string eventName);
 
     /**
      * pause:
      *
      **/
     void registerObjectEventListener (in EventListener listener, in string eventName);
 
     /**
      * pause:
-     * Returns: %true if the request succeeded, %false otherwise.
      *
      * Request that the application temporarily stop sending events.
      * In most cases this should pause the application's main event loop.
      *
      *
      * Request that the application temporarily stop sending events.
      * In most cases this should pause the application's main event loop.
      *
+     * Returns: %true if the request succeeded, %false otherwise.
      **/
     boolean       pause ();
 
     /**
      * resume:
      **/
     boolean       pause ();
 
     /**
      * resume:
-     * Returns: %true if the request succeeded, %false otherwise.
      *
      * Request that the application resume sending events.
      *
      *
      * Request that the application resume sending events.
      *
+     * Returns: %true if the request succeeded, %false otherwise.
      **/
     boolean       resume ();
   };
      **/
     boolean       resume ();
   };
index 2e56cf3..52d3c2a 100644 (file)
@@ -39,7 +39,6 @@ module Accessibility {
        /**
          * registerApplication:
          * @application: a reference to the requesting @Application
        /**
          * registerApplication:
          * @application: a reference to the requesting @Application
-        * return values: void
          *
          * Register a new application with the accessibility broker.
          *
          *
          * Register a new application with the accessibility broker.
          *
@@ -50,8 +49,7 @@ module Accessibility {
          * deregisterApplication:
          * @application: a reference to the @Application 
          * to be deregistered.
          * deregisterApplication:
          * @application: a reference to the @Application 
          * to be deregistered.
-        * return values: void
-         *
+        *
          * De-register an application previously registered with the broker.
          *
         **/
          * De-register an application previously registered with the broker.
          *
         **/
@@ -62,7 +60,6 @@ module Accessibility {
          * @listener: a reference to the requesting @EventListener.
          * @eventName: a string which indicates the type of events about 
          * which the client desires notification.
          * @listener: a reference to the requesting @EventListener.
          * @eventName: a string which indicates the type of events about 
          * which the client desires notification.
-        * return values: void
          *
          * Register a client's interest in (all) application events of 
          * a certain type.
          *
          * Register a client's interest in (all) application events of 
          * a certain type.
@@ -75,7 +72,6 @@ module Accessibility {
          * deregisterGlobalEventListener:
          * @listener: the requesting @EventListener
          * @eventName: a string indicating the type of events
          * deregisterGlobalEventListener:
          * @listener: the requesting @EventListener
          * @eventName: a string indicating the type of events
-        * return values: void
          *
          * Request that a previously registered client stop receiving
          * global notifications for events of a certain type.
          *
          * Request that a previously registered client stop receiving
          * global notifications for events of a certain type.
@@ -87,7 +83,6 @@ module Accessibility {
          * deregisterGlobalEventListener:
          * @listener: the requesting @EventListener
          * @eventName: a string indicating the type of events
          * deregisterGlobalEventListener:
          * @listener: the requesting @EventListener
          * @eventName: a string indicating the type of events
-        * return values: void
          *
          * Request that a previously registered client stop receiving
          * global notifications for events of a certain type.
          *
          * Request that a previously registered client stop receiving
          * global notifications for events of a certain type.
@@ -115,38 +110,37 @@ module Accessibility {
 
        /**
          * getDesktopCount:
 
        /**
          * getDesktopCount:
-        * return values: a short integer indicating the current number of 
-         * @Desktops.
          *
          * Get the current number of desktops.
          *
          * Get the current number of desktops.
-         *
+        * Returns: a short integer indicating the current number of 
+         * @Desktops.
         **/
         short getDesktopCount ();
 
        /**
          * getDesktop:
          * @n: the index of the requested @Desktop.
         **/
         short getDesktopCount ();
 
        /**
          * getDesktop:
          * @n: the index of the requested @Desktop.
-        * return values: a reference to the requested @Desktop.
          *
          * Get the nth accessible desktop. 
          *
          *
          * Get the nth accessible desktop. 
          *
+        * Returns: a reference to the requested @Desktop.
         **/
         Desktop getDesktop (in short n);
 
        /**
          * getDesktopList:
         **/
         Desktop getDesktop (in short n);
 
        /**
          * getDesktopList:
-        * return values: a sequence containing references to
-         * the @Desktops.
          *
          * Get a list of accessible desktops. 
          *
          *
          * Get a list of accessible desktops. 
          *
+        * Returns: a sequence containing references to
+         * the @Desktops.
         **/
         DesktopSeq getDesktopList ();
 
        /**
          * getDeviceEventController:
         **/
         DesktopSeq getDesktopList ();
 
        /**
          * getDeviceEventController:
-        * return values: an object implementing DeviceEventController
          *
          *
+        * Returns: an object implementing DeviceEventController
         **/
         DeviceEventController getDeviceEventController ();
 
         **/
         DeviceEventController getDeviceEventController ();
 
@@ -257,11 +251,9 @@ module Accessibility {
                                        in KeyEventTypeSeq type,
                                        in boolean is_synchronous);
     
                                        in KeyEventTypeSeq type,
                                        in boolean is_synchronous);
     
-        boolean notifyListenersSync (in DeviceEventListener listener,
-                                    in DeviceEvent event);
+        boolean notifyListenersSync (in DeviceEvent event);
 
 
-        oneway void notifyListenersAsync (in DeviceEventListener listener,
-                                         in DeviceEvent event);
+        oneway void notifyListenersAsync (in DeviceEvent event);
 
         /**
          * generateKeyEvent:
 
         /**
          * generateKeyEvent:
index f4e19b3..9897f38 100644 (file)
@@ -127,10 +127,15 @@ dec_key_listener_new (CORBA_Object l,
   DEControllerKeyListener *key_listener = g_new0 (DEControllerKeyListener, 1);
   key_listener->listener.object = CORBA_Object_duplicate (l, ev);
   key_listener->listener.type = SPI_DEVICE_TYPE_KBD;
   DEControllerKeyListener *key_listener = g_new0 (DEControllerKeyListener, 1);
   key_listener->listener.object = CORBA_Object_duplicate (l, ev);
   key_listener->listener.type = SPI_DEVICE_TYPE_KBD;
-  key_listener->keys = keys;
-  key_listener->mask = mask;
+  key_listener->keys = ORBit_copy_value (keys, TC_Accessibility_KeySet);
+  key_listener->mask = ORBit_copy_value (mask, TC_Accessibility_ControllerEventMask);
   key_listener->is_system_global = is_system_global;
 
   key_listener->is_system_global = is_system_global;
 
+  g_print ("new listener, with mask %x, is_global %d, keys %p\n",
+          (unsigned int) key_listener->mask->value,
+           (int) key_listener->is_system_global,
+          (void *) key_listener->keys);
+  
   return key_listener; 
 }
 
   return key_listener; 
 }
 
@@ -243,24 +248,50 @@ _controller_register_with_devices (SpiDeviceEventController *controller)
 
 
 static gboolean
 
 
 static gboolean
-notify_keylisteners (GList *key_listeners, Accessibility_KeyStroke *key_event, CORBA_Environment *ev)
+key_event_matches_listener (Accessibility_KeyStroke *key_event,
+                           DEControllerKeyListener *listener,
+                           CORBA_boolean is_system_global)
+{
+  g_print ("mask=%x, listener mask= %x\n", (unsigned int) key_event->modifiers,
+          (unsigned int) (listener->mask->value & 0xFFFF));    
+  if ((key_event->modifiers == (CORBA_unsigned_short) (listener->mask->value && 0xFFFF)) &&
+      ((listener->keys == NULL) || (1)) && /* in keyset seq */
+      (1) && /* in event type seq */
+      (is_system_global == listener->is_system_global))
+    {
+      return TRUE;
+    }
+  else
+    return FALSE;
+}
+
+static gboolean
+notify_keylisteners (GList *key_listeners,
+                    Accessibility_KeyStroke *key_event,
+                    CORBA_boolean is_system_global,
+                    CORBA_Environment *ev)
 {
   int i, n_listeners = g_list_length (key_listeners);
   gboolean is_consumed = FALSE;
 {
   int i, n_listeners = g_list_length (key_listeners);
   gboolean is_consumed = FALSE;
+
   for (i=0; i<n_listeners && !is_consumed; ++i)
     {
       Accessibility_KeystrokeListener ls;
   for (i=0; i<n_listeners && !is_consumed; ++i)
     {
       Accessibility_KeystrokeListener ls;
-      ls = (Accessibility_KeystrokeListener)
+      DEControllerKeyListener *key_listener = (DEControllerKeyListener *)
            g_list_nth_data (key_listeners, i);
            g_list_nth_data (key_listeners, i);
-      if (!CORBA_Object_is_nil(ls, ev))
+      ls = (Accessibility_KeystrokeListener) key_listener->listener.object;
+      if (key_event_matches_listener (key_event, key_listener, is_system_global))
         {
         {
-           is_consumed = Accessibility_KeystrokeListener_keyEvent (ls, key_event, ev);
-        }              
+          if (!CORBA_Object_is_nil(ls, ev))
+            {
+             is_consumed = Accessibility_KeystrokeListener_keyEvent (ls, key_event, ev);
+            }          
+        }
+      else g_print ("no match for listener %d\n", i);
     }
   return is_consumed;
 }
 
     }
   return is_consumed;
 }
 
-
 static gboolean
 _check_key_event (SpiDeviceEventController *controller)
 {
 static gboolean
 _check_key_event (SpiDeviceEventController *controller)
 {
@@ -311,11 +342,11 @@ _check_key_event (SpiDeviceEventController *controller)
 #endif
            }
            /* relay to listeners, and decide whether to consume it or not */
 #endif
            }
            /* relay to listeners, and decide whether to consume it or not */
-           is_consumed = notify_keylisteners (controller->key_listeners, &key_event, &ev);
+           is_consumed = notify_keylisteners (controller->key_listeners, &key_event, CORBA_TRUE, &ev);
 
            if (is_consumed)
            {
 
            if (is_consumed)
            {
-             XAllowEvents (display, SyncKeyboard, CurrentTime);
+             XAllowEvents (display, AsyncKeyboard, CurrentTime);
            }
            else
            {
            }
            else
            {
@@ -361,7 +392,7 @@ _controller_grab_keyboard (SpiDeviceEventController *controller)
                                  root_window,
                                  True,
                                  GrabModeAsync,
                                  root_window,
                                  True,
                                  GrabModeAsync,
-                                 GrabModeSync);
+                                 GrabModeAsync);
                        /* TODO: check call for errors and return FALSE if error occurs */
                } else {
                        return FALSE; /* can't do control key yet */
                        /* TODO: check call for errors and return FALSE if error occurs */
                } else {
                        return FALSE; /* can't do control key yet */
@@ -503,10 +534,7 @@ impl_generate_key_event (PortableServer_Servant     servant,
        }
 }
 
        }
 }
 
-/*
- * CORBA Accessibility::DeviceEventController::generateMouseEvent
- *     method implementation
- */
+/* Accessibility::DeviceEventController::generateMouseEvent */
 static void
 impl_generate_mouse_event (PortableServer_Servant servant,
                           const CORBA_long       x,
 static void
 impl_generate_mouse_event (PortableServer_Servant servant,
                           const CORBA_long       x,
@@ -515,8 +543,40 @@ impl_generate_mouse_event (PortableServer_Servant servant,
                           CORBA_Environment     *ev)
 {
 #ifdef SPI_DEBUG
                           CORBA_Environment     *ev)
 {
 #ifdef SPI_DEBUG
-       fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
+  fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
+#endif
+}
+
+/* Accessibility::DeviceEventController::notifyListenersSync */
+static CORBA_boolean
+impl_notify_listeners_sync(PortableServer_Servant     servant,
+                          const Accessibility_DeviceEvent *event,
+                          CORBA_Environment         *ev)
+{
+  SpiDeviceEventController *controller = SPI_DEVICE_EVENT_CONTROLLER (
+                                         bonobo_object_from_servant (servant));
+  Accessibility_KeyStroke *key_event = (Accessibility_KeyStroke *) event;      
+#ifdef SPI_DEBUG
+  g_print ("notifying listeners synchronously: controller %x, event id %d\n",
+          (void *) controller, (int) event->eventID);
+#endif
+  return (notify_keylisteners (controller->key_listeners, key_event, CORBA_FALSE, ev) ?
+         CORBA_TRUE : CORBA_FALSE); 
+}
+
+/* Accessibility::DeviceEventController::notifyListenersAsync */
+static void
+impl_notify_listeners_async (PortableServer_Servant     servant,
+                            const Accessibility_DeviceEvent *event,
+                            CORBA_Environment         *ev)
+{
+  SpiDeviceEventController *controller = SPI_DEVICE_EVENT_CONTROLLER(
+                                        bonobo_object_from_servant (servant));
+  Accessibility_KeyStroke *key_event = (Accessibility_KeyStroke *) event;      
+#ifdef SPI_DEBUG
+  fprintf (stderr, "notifying listeners asynchronously\n");
 #endif
 #endif
+  notify_keylisteners (controller->key_listeners, key_event, CORBA_FALSE, ev); 
 }
 
 static void
 }
 
 static void
@@ -533,6 +593,8 @@ spi_device_event_controller_class_init (SpiDeviceEventControllerClass *klass)
 /*        epv->registerMouseListener = impl_register_mouse_listener; */
         epv->generateKeyEvent = impl_generate_key_event;
         epv->generateMouseEvent = impl_generate_mouse_event;
 /*        epv->registerMouseListener = impl_register_mouse_listener; */
         epv->generateKeyEvent = impl_generate_key_event;
         epv->generateMouseEvent = impl_generate_mouse_event;
+       epv->notifyListenersSync = impl_notify_listeners_sync;
+       epv->notifyListenersAsync = impl_notify_listeners_async;
        klass->check_key_event = _check_key_event;
 }
 
        klass->check_key_event = _check_key_event;
 }
 
@@ -557,7 +619,7 @@ spi_device_event_controller_check_key_event (SpiDeviceEventController *controlle
 SpiDeviceEventController *
 spi_device_event_controller_new (void *registryp)
 {
 SpiDeviceEventController *
 spi_device_event_controller_new (void *registryp)
 {
-  SpiRegistry *registry = SPI_REGISTRY (registryp);    
+  BonoboObject *registry = (BonoboObject *) registryp; 
   SpiDeviceEventController *retval = g_object_new (
          SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL);
   retval->registry = registry;
   SpiDeviceEventController *retval = g_object_new (
          SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL);
   retval->registry = registry;
index e5e9e28..e3e8c97 100644 (file)
@@ -39,7 +39,7 @@ G_BEGIN_DECLS
 
 typedef struct {
         BonoboObject parent;
 
 typedef struct {
         BonoboObject parent;
-       struct SpiRegistry *registry;
+       void  *registry;
         GList *key_listeners;
         GList *mouse_listeners;
        GList *keymask_list;
         GList *key_listeners;
         GList *mouse_listeners;
        GList *keymask_list;
index 7e278b5..51a3cb4 100644 (file)
@@ -71,7 +71,7 @@ typedef struct {
 } SpiListenerStruct;
 
 /* static function prototypes */
 } SpiListenerStruct;
 
 /* static function prototypes */
-static void _registry_notify_listeners ( GList *listeners,
+static void _registry_notify_listeners (GList *listeners,
                                         const Accessibility_Event *e,
                                         CORBA_Environment *ev);
 
                                         const Accessibility_Event *e,
                                         CORBA_Environment *ev);
 
@@ -258,7 +258,7 @@ impl_accessibility_registry_deregister_application (PortableServer_Servant serva
                                                     CORBA_Environment * ev)
 {
   SpiRegistry *registry = SPI_REGISTRY (bonobo_object_from_servant (servant));
                                                     CORBA_Environment * ev)
 {
   SpiRegistry *registry = SPI_REGISTRY (bonobo_object_from_servant (servant));
-  GList *list = g_list_find_custom (registry->desktop->applications, &application, compare_corba_objects);
+  GList *list = g_list_find_custom (registry->desktop->applications, application, compare_corba_objects);
 
 #ifdef SPI_DEBUG
   gint i;
 
 #ifdef SPI_DEBUG
   gint i;
@@ -272,15 +272,18 @@ impl_accessibility_registry_deregister_application (PortableServer_Servant serva
       registry->desktop->applications = g_list_delete_link (registry->desktop->applications, list);
 #ifdef SPI_DEBUG
       fprintf (stderr, "there are now %d apps registered.\n", g_list_length (registry->desktop->applications));
       registry->desktop->applications = g_list_delete_link (registry->desktop->applications, list);
 #ifdef SPI_DEBUG
       fprintf (stderr, "there are now %d apps registered.\n", g_list_length (registry->desktop->applications));
-      for (i = 0; i < g_list_length (registry->desktop->applications); ++i) {
+      for (i = 0; i < g_list_length (registry->desktop->applications); ++i)
+        {
           fprintf (stderr, "getting application %d\n", i);
           fprintf (stderr, "object address %p\n",
           fprintf (stderr, "getting application %d\n", i);
           fprintf (stderr, "object address %p\n",
-               g_list_nth_data (registry->desktop->applications, i));
-      }
+                      g_list_nth_data (registry->desktop->applications, i));
+        }
 #endif      
     }
   else
 #endif      
     }
   else
-    fprintf (stderr, "could not deregister application\n");
+    {
+      fprintf (stderr, "could not deregister application %p\n", application);
+    }
 }
 
 /*
 }
 
 /*
@@ -523,16 +526,17 @@ _get_unique_id ()
 }
 
 static void
 }
 
 static void
-_registry_notify_listeners ( GList *listeners,
-                            const Accessibility_Event *e,
+_registry_notify_listeners (GList *listeners,
+                            const Accessibility_Event *e_in,
                             CORBA_Environment *ev)
 {
   int n;
   int len;
   SpiListenerStruct *ls;
   EventTypeStruct etype;
                             CORBA_Environment *ev)
 {
   int n;
   int len;
   SpiListenerStruct *ls;
   EventTypeStruct etype;
+  Accessibility_Event *e_out;
   guint minor_hash;
   guint minor_hash;
-  parse_event_type (&etype, e->type);
+  parse_event_type (&etype, e_in->type);
   minor_hash = g_str_hash (g_strconcat (etype.major, etype.minor, NULL));
   len = g_list_length (listeners);
 
   minor_hash = g_str_hash (g_strconcat (etype.major, etype.minor, NULL));
   len = g_list_length (listeners);
 
@@ -547,13 +551,16 @@ _registry_notify_listeners ( GList *listeners,
         {
 #ifdef SPI_DEBUG
           fprintf(stderr, "notifying listener #%d\n", n);
         {
 #ifdef SPI_DEBUG
           fprintf(stderr, "notifying listener #%d\n", n);
-          fprintf(stderr, "event source name %s\n", Accessibility_Accessible__get_name(e->source, ev));
+          fprintf(stderr, "event source name %s\n", Accessibility_Accessible__get_name(e_in->source, ev));
 #endif
 #endif
-         e->source = CORBA_Object_duplicate (e->source, ev);
-          Accessibility_Accessible_ref ( e->source, ev);
+         e_out = ORBit_copy_value (e_in, TC_Accessibility_Event);
+         e_out->source = CORBA_Object_duplicate (e_in->source, ev);
+          Accessibility_Accessible_ref ( e_out->source, ev);
           Accessibility_EventListener_notifyEvent ((Accessibility_EventListener) ls->listener,
           Accessibility_EventListener_notifyEvent ((Accessibility_EventListener) ls->listener,
-                                                   e,
+                                                   e_out,
                                                    ev);
                                                    ev);
+         /* is it safe to free e_out now ? notifyEvent is a oneway... */
+         CORBA_free (e_out);
           if (ev->_major != CORBA_NO_EXCEPTION) {
                 fprintf(stderr,
                 ("Accessibility app error: exception during event notification: %s\n"),
           if (ev->_major != CORBA_NO_EXCEPTION) {
                 fprintf(stderr,
                 ("Accessibility app error: exception during event notification: %s\n"),
index f4e19b3..9897f38 100644 (file)
@@ -127,10 +127,15 @@ dec_key_listener_new (CORBA_Object l,
   DEControllerKeyListener *key_listener = g_new0 (DEControllerKeyListener, 1);
   key_listener->listener.object = CORBA_Object_duplicate (l, ev);
   key_listener->listener.type = SPI_DEVICE_TYPE_KBD;
   DEControllerKeyListener *key_listener = g_new0 (DEControllerKeyListener, 1);
   key_listener->listener.object = CORBA_Object_duplicate (l, ev);
   key_listener->listener.type = SPI_DEVICE_TYPE_KBD;
-  key_listener->keys = keys;
-  key_listener->mask = mask;
+  key_listener->keys = ORBit_copy_value (keys, TC_Accessibility_KeySet);
+  key_listener->mask = ORBit_copy_value (mask, TC_Accessibility_ControllerEventMask);
   key_listener->is_system_global = is_system_global;
 
   key_listener->is_system_global = is_system_global;
 
+  g_print ("new listener, with mask %x, is_global %d, keys %p\n",
+          (unsigned int) key_listener->mask->value,
+           (int) key_listener->is_system_global,
+          (void *) key_listener->keys);
+  
   return key_listener; 
 }
 
   return key_listener; 
 }
 
@@ -243,24 +248,50 @@ _controller_register_with_devices (SpiDeviceEventController *controller)
 
 
 static gboolean
 
 
 static gboolean
-notify_keylisteners (GList *key_listeners, Accessibility_KeyStroke *key_event, CORBA_Environment *ev)
+key_event_matches_listener (Accessibility_KeyStroke *key_event,
+                           DEControllerKeyListener *listener,
+                           CORBA_boolean is_system_global)
+{
+  g_print ("mask=%x, listener mask= %x\n", (unsigned int) key_event->modifiers,
+          (unsigned int) (listener->mask->value & 0xFFFF));    
+  if ((key_event->modifiers == (CORBA_unsigned_short) (listener->mask->value && 0xFFFF)) &&
+      ((listener->keys == NULL) || (1)) && /* in keyset seq */
+      (1) && /* in event type seq */
+      (is_system_global == listener->is_system_global))
+    {
+      return TRUE;
+    }
+  else
+    return FALSE;
+}
+
+static gboolean
+notify_keylisteners (GList *key_listeners,
+                    Accessibility_KeyStroke *key_event,
+                    CORBA_boolean is_system_global,
+                    CORBA_Environment *ev)
 {
   int i, n_listeners = g_list_length (key_listeners);
   gboolean is_consumed = FALSE;
 {
   int i, n_listeners = g_list_length (key_listeners);
   gboolean is_consumed = FALSE;
+
   for (i=0; i<n_listeners && !is_consumed; ++i)
     {
       Accessibility_KeystrokeListener ls;
   for (i=0; i<n_listeners && !is_consumed; ++i)
     {
       Accessibility_KeystrokeListener ls;
-      ls = (Accessibility_KeystrokeListener)
+      DEControllerKeyListener *key_listener = (DEControllerKeyListener *)
            g_list_nth_data (key_listeners, i);
            g_list_nth_data (key_listeners, i);
-      if (!CORBA_Object_is_nil(ls, ev))
+      ls = (Accessibility_KeystrokeListener) key_listener->listener.object;
+      if (key_event_matches_listener (key_event, key_listener, is_system_global))
         {
         {
-           is_consumed = Accessibility_KeystrokeListener_keyEvent (ls, key_event, ev);
-        }              
+          if (!CORBA_Object_is_nil(ls, ev))
+            {
+             is_consumed = Accessibility_KeystrokeListener_keyEvent (ls, key_event, ev);
+            }          
+        }
+      else g_print ("no match for listener %d\n", i);
     }
   return is_consumed;
 }
 
     }
   return is_consumed;
 }
 
-
 static gboolean
 _check_key_event (SpiDeviceEventController *controller)
 {
 static gboolean
 _check_key_event (SpiDeviceEventController *controller)
 {
@@ -311,11 +342,11 @@ _check_key_event (SpiDeviceEventController *controller)
 #endif
            }
            /* relay to listeners, and decide whether to consume it or not */
 #endif
            }
            /* relay to listeners, and decide whether to consume it or not */
-           is_consumed = notify_keylisteners (controller->key_listeners, &key_event, &ev);
+           is_consumed = notify_keylisteners (controller->key_listeners, &key_event, CORBA_TRUE, &ev);
 
            if (is_consumed)
            {
 
            if (is_consumed)
            {
-             XAllowEvents (display, SyncKeyboard, CurrentTime);
+             XAllowEvents (display, AsyncKeyboard, CurrentTime);
            }
            else
            {
            }
            else
            {
@@ -361,7 +392,7 @@ _controller_grab_keyboard (SpiDeviceEventController *controller)
                                  root_window,
                                  True,
                                  GrabModeAsync,
                                  root_window,
                                  True,
                                  GrabModeAsync,
-                                 GrabModeSync);
+                                 GrabModeAsync);
                        /* TODO: check call for errors and return FALSE if error occurs */
                } else {
                        return FALSE; /* can't do control key yet */
                        /* TODO: check call for errors and return FALSE if error occurs */
                } else {
                        return FALSE; /* can't do control key yet */
@@ -503,10 +534,7 @@ impl_generate_key_event (PortableServer_Servant     servant,
        }
 }
 
        }
 }
 
-/*
- * CORBA Accessibility::DeviceEventController::generateMouseEvent
- *     method implementation
- */
+/* Accessibility::DeviceEventController::generateMouseEvent */
 static void
 impl_generate_mouse_event (PortableServer_Servant servant,
                           const CORBA_long       x,
 static void
 impl_generate_mouse_event (PortableServer_Servant servant,
                           const CORBA_long       x,
@@ -515,8 +543,40 @@ impl_generate_mouse_event (PortableServer_Servant servant,
                           CORBA_Environment     *ev)
 {
 #ifdef SPI_DEBUG
                           CORBA_Environment     *ev)
 {
 #ifdef SPI_DEBUG
-       fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
+  fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
+#endif
+}
+
+/* Accessibility::DeviceEventController::notifyListenersSync */
+static CORBA_boolean
+impl_notify_listeners_sync(PortableServer_Servant     servant,
+                          const Accessibility_DeviceEvent *event,
+                          CORBA_Environment         *ev)
+{
+  SpiDeviceEventController *controller = SPI_DEVICE_EVENT_CONTROLLER (
+                                         bonobo_object_from_servant (servant));
+  Accessibility_KeyStroke *key_event = (Accessibility_KeyStroke *) event;      
+#ifdef SPI_DEBUG
+  g_print ("notifying listeners synchronously: controller %x, event id %d\n",
+          (void *) controller, (int) event->eventID);
+#endif
+  return (notify_keylisteners (controller->key_listeners, key_event, CORBA_FALSE, ev) ?
+         CORBA_TRUE : CORBA_FALSE); 
+}
+
+/* Accessibility::DeviceEventController::notifyListenersAsync */
+static void
+impl_notify_listeners_async (PortableServer_Servant     servant,
+                            const Accessibility_DeviceEvent *event,
+                            CORBA_Environment         *ev)
+{
+  SpiDeviceEventController *controller = SPI_DEVICE_EVENT_CONTROLLER(
+                                        bonobo_object_from_servant (servant));
+  Accessibility_KeyStroke *key_event = (Accessibility_KeyStroke *) event;      
+#ifdef SPI_DEBUG
+  fprintf (stderr, "notifying listeners asynchronously\n");
 #endif
 #endif
+  notify_keylisteners (controller->key_listeners, key_event, CORBA_FALSE, ev); 
 }
 
 static void
 }
 
 static void
@@ -533,6 +593,8 @@ spi_device_event_controller_class_init (SpiDeviceEventControllerClass *klass)
 /*        epv->registerMouseListener = impl_register_mouse_listener; */
         epv->generateKeyEvent = impl_generate_key_event;
         epv->generateMouseEvent = impl_generate_mouse_event;
 /*        epv->registerMouseListener = impl_register_mouse_listener; */
         epv->generateKeyEvent = impl_generate_key_event;
         epv->generateMouseEvent = impl_generate_mouse_event;
+       epv->notifyListenersSync = impl_notify_listeners_sync;
+       epv->notifyListenersAsync = impl_notify_listeners_async;
        klass->check_key_event = _check_key_event;
 }
 
        klass->check_key_event = _check_key_event;
 }
 
@@ -557,7 +619,7 @@ spi_device_event_controller_check_key_event (SpiDeviceEventController *controlle
 SpiDeviceEventController *
 spi_device_event_controller_new (void *registryp)
 {
 SpiDeviceEventController *
 spi_device_event_controller_new (void *registryp)
 {
-  SpiRegistry *registry = SPI_REGISTRY (registryp);    
+  BonoboObject *registry = (BonoboObject *) registryp; 
   SpiDeviceEventController *retval = g_object_new (
          SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL);
   retval->registry = registry;
   SpiDeviceEventController *retval = g_object_new (
          SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL);
   retval->registry = registry;
index e5e9e28..e3e8c97 100644 (file)
@@ -39,7 +39,7 @@ G_BEGIN_DECLS
 
 typedef struct {
         BonoboObject parent;
 
 typedef struct {
         BonoboObject parent;
-       struct SpiRegistry *registry;
+       void  *registry;
         GList *key_listeners;
         GList *mouse_listeners;
        GList *keymask_list;
         GList *key_listeners;
         GList *mouse_listeners;
        GList *keymask_list;
index 7e278b5..51a3cb4 100644 (file)
@@ -71,7 +71,7 @@ typedef struct {
 } SpiListenerStruct;
 
 /* static function prototypes */
 } SpiListenerStruct;
 
 /* static function prototypes */
-static void _registry_notify_listeners ( GList *listeners,
+static void _registry_notify_listeners (GList *listeners,
                                         const Accessibility_Event *e,
                                         CORBA_Environment *ev);
 
                                         const Accessibility_Event *e,
                                         CORBA_Environment *ev);
 
@@ -258,7 +258,7 @@ impl_accessibility_registry_deregister_application (PortableServer_Servant serva
                                                     CORBA_Environment * ev)
 {
   SpiRegistry *registry = SPI_REGISTRY (bonobo_object_from_servant (servant));
                                                     CORBA_Environment * ev)
 {
   SpiRegistry *registry = SPI_REGISTRY (bonobo_object_from_servant (servant));
-  GList *list = g_list_find_custom (registry->desktop->applications, &application, compare_corba_objects);
+  GList *list = g_list_find_custom (registry->desktop->applications, application, compare_corba_objects);
 
 #ifdef SPI_DEBUG
   gint i;
 
 #ifdef SPI_DEBUG
   gint i;
@@ -272,15 +272,18 @@ impl_accessibility_registry_deregister_application (PortableServer_Servant serva
       registry->desktop->applications = g_list_delete_link (registry->desktop->applications, list);
 #ifdef SPI_DEBUG
       fprintf (stderr, "there are now %d apps registered.\n", g_list_length (registry->desktop->applications));
       registry->desktop->applications = g_list_delete_link (registry->desktop->applications, list);
 #ifdef SPI_DEBUG
       fprintf (stderr, "there are now %d apps registered.\n", g_list_length (registry->desktop->applications));
-      for (i = 0; i < g_list_length (registry->desktop->applications); ++i) {
+      for (i = 0; i < g_list_length (registry->desktop->applications); ++i)
+        {
           fprintf (stderr, "getting application %d\n", i);
           fprintf (stderr, "object address %p\n",
           fprintf (stderr, "getting application %d\n", i);
           fprintf (stderr, "object address %p\n",
-               g_list_nth_data (registry->desktop->applications, i));
-      }
+                      g_list_nth_data (registry->desktop->applications, i));
+        }
 #endif      
     }
   else
 #endif      
     }
   else
-    fprintf (stderr, "could not deregister application\n");
+    {
+      fprintf (stderr, "could not deregister application %p\n", application);
+    }
 }
 
 /*
 }
 
 /*
@@ -523,16 +526,17 @@ _get_unique_id ()
 }
 
 static void
 }
 
 static void
-_registry_notify_listeners ( GList *listeners,
-                            const Accessibility_Event *e,
+_registry_notify_listeners (GList *listeners,
+                            const Accessibility_Event *e_in,
                             CORBA_Environment *ev)
 {
   int n;
   int len;
   SpiListenerStruct *ls;
   EventTypeStruct etype;
                             CORBA_Environment *ev)
 {
   int n;
   int len;
   SpiListenerStruct *ls;
   EventTypeStruct etype;
+  Accessibility_Event *e_out;
   guint minor_hash;
   guint minor_hash;
-  parse_event_type (&etype, e->type);
+  parse_event_type (&etype, e_in->type);
   minor_hash = g_str_hash (g_strconcat (etype.major, etype.minor, NULL));
   len = g_list_length (listeners);
 
   minor_hash = g_str_hash (g_strconcat (etype.major, etype.minor, NULL));
   len = g_list_length (listeners);
 
@@ -547,13 +551,16 @@ _registry_notify_listeners ( GList *listeners,
         {
 #ifdef SPI_DEBUG
           fprintf(stderr, "notifying listener #%d\n", n);
         {
 #ifdef SPI_DEBUG
           fprintf(stderr, "notifying listener #%d\n", n);
-          fprintf(stderr, "event source name %s\n", Accessibility_Accessible__get_name(e->source, ev));
+          fprintf(stderr, "event source name %s\n", Accessibility_Accessible__get_name(e_in->source, ev));
 #endif
 #endif
-         e->source = CORBA_Object_duplicate (e->source, ev);
-          Accessibility_Accessible_ref ( e->source, ev);
+         e_out = ORBit_copy_value (e_in, TC_Accessibility_Event);
+         e_out->source = CORBA_Object_duplicate (e_in->source, ev);
+          Accessibility_Accessible_ref ( e_out->source, ev);
           Accessibility_EventListener_notifyEvent ((Accessibility_EventListener) ls->listener,
           Accessibility_EventListener_notifyEvent ((Accessibility_EventListener) ls->listener,
-                                                   e,
+                                                   e_out,
                                                    ev);
                                                    ev);
+         /* is it safe to free e_out now ? notifyEvent is a oneway... */
+         CORBA_free (e_out);
           if (ev->_major != CORBA_NO_EXCEPTION) {
                 fprintf(stderr,
                 ("Accessibility app error: exception during event notification: %s\n"),
           if (ev->_major != CORBA_NO_EXCEPTION) {
                 fprintf(stderr,
                 ("Accessibility app error: exception during event notification: %s\n"),
index 94fa106..1a532a4 100644 (file)
@@ -237,11 +237,16 @@ static boolean
 report_key_event (void *p)
 {
   AccessibleKeyStroke *key = (AccessibleKeyStroke *) p;
 report_key_event (void *p)
 {
   AccessibleKeyStroke *key = (AccessibleKeyStroke *) p;
-  fprintf(stderr, "KeyEvent %s%c (keycode %d)\n",
+  fprintf (stderr, "KeyEvent %s%c (keycode %d)\n",
          (key->modifiers & SPI_KEYMASK_ALT)?"Alt-":"",
          ((key->modifiers & SPI_KEYMASK_SHIFT)^(key->modifiers & SPI_KEYMASK_SHIFTLOCK))?
          (char) toupper((int) key->keyID) : (char) tolower((int) key->keyID),
          (int) key->keycode);
          (key->modifiers & SPI_KEYMASK_ALT)?"Alt-":"",
          ((key->modifiers & SPI_KEYMASK_SHIFT)^(key->modifiers & SPI_KEYMASK_SHIFTLOCK))?
          (char) toupper((int) key->keyID) : (char) tolower((int) key->keyID),
          (int) key->keycode);
+  fprintf (stderr, "Key:\tsym %ld\n\tmods %x\n\tcode %d\n\ttime %ld\n",
+          (long) key->keyID,
+          (unsigned int) key->modifiers,
+          (int) key->keycode,
+          (long int) key->timestamp);
   return is_command_key (key);
 }
 
   return is_command_key (key);
 }