-#ifndef _SPI_SPI_LISTENER_H_
-#define _SPI_SPI_LISTENER_H_
+#ifndef _SPI_LISTENER_H_
+#define _SPI_LISTENER_H_
+#include <cspi/spi-impl.h>
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include "accessibleeventlistener.h"
-#include "keystrokelistener.h"
-
+G_BEGIN_DECLS
/*
- *
* Structure used to encapsulate event information
- *
*/
-
-typedef Accessibility_Event SpiAccessibleEvent;
+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;
+ long timestamp;
+ AccessibleKeyEventType type;
+ unsigned short modifiers;
+} AccessibleKeystroke;
/*
- *
- * Function prototype typedefs for Event SpiListener Callbacks.
- * (see libspi/accessibleeventlistener.h for definition of VoidEventListenerCB).
+ * Function prototype typedefs for Event Listener Callbacks.
+ * (see libspi/accessibleeventlistener.h for definition of SpiVoidEventListenerCB).
*
* usage: signatures should be
- * void (*SpiAccessibleEventListenerCB) (SpiAccessibleEvent *event);
+ * void (*AccessibleEventListenerCB) (AccessibleEvent *event);
*
- * boolean (*KeystrokeListenerCB) (KeystrokeEvent *Event);
+ * SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystrokeEvent *Event);
*/
+typedef void (*AccessibleEventListenerCB) (AccessibleEvent *event);
+typedef SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystroke *stroke);
-typedef VoidEventListenerCB SpiAccessibleEventListenerCB;
-typedef BooleanKeystrokeListenerCB KeystrokeListenerCB;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
+G_END_DECLS
#endif