2002-03-27 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi-listener.h
index e30d0b4..1da413a 100644 (file)
@@ -1,40 +1,54 @@
 #ifndef _SPI_LISTENER_H_
 #define _SPI_LISTENER_H_
 
+#include <cspi/spi-impl.h>
 
-#ifdef __cplusplus
+#ifdef  __cplusplus
 extern "C" {
-#endif /* __cplusplus */
-
-#include "accessibleeventlistener.h"
-#include "keystrokelistener.h"
-
+#endif
 
 /*
- *
  * Structure used to encapsulate event information
- *
  */
-
-typedef Accessibility_Event AccessibleEvent;
+typedef struct {
+  const char  *type;
+  Accessible  *source;
+  long         detail1;
+  long         detail2;
+} AccessibleEvent;
+
+typedef enum {
+  SPI_KEY_PRESSED  = 1<<0,
+  SPI_KEY_RELEASED = 1<<1
+} AccessibleKeyEventType;
+
+
+typedef struct {
+  long                   keyID;
+  short                  keycode;
+  char *                 keystring;
+  long                   timestamp;
+  AccessibleKeyEventType type;
+  unsigned short         modifiers;
+  SPIBoolean             is_text;      
+} AccessibleKeystroke;
 
 /*
- *
  * Function prototype typedefs for Event Listener Callbacks.
- * (see libspi/accessibleeventlistener.h for definition of VoidEventListenerCB).
+ * (see libspi/accessibleeventlistener.h for definition of SpiVoidEventListenerCB).
  *
  * usage: signatures should be
  * void (*AccessibleEventListenerCB) (AccessibleEvent *event);
  *
- * boolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystrokeEvent *Event);
+ * SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystrokeEvent *Event);
  */
+typedef void       (*AccessibleEventListenerCB)     (const AccessibleEvent     *event,
+                                                    void                      *user_data);
+typedef SPIBoolean (*AccessibleKeystrokeListenerCB) (const AccessibleKeystroke *stroke,
+                                                    void                      *user_data);
 
-typedef VoidEventListenerCB AccessibleEventListenerCB;
-typedef BooleanKeystrokeListenerCB AccessibleKeystrokeListenerCB;
-
-#ifdef __cplusplus
+#ifdef  __cplusplus
 }
-#endif /* __cplusplus */
-
+#endif
 
 #endif