2001-12-11 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi-listener.h
1 #ifndef _SPI_LISTENER_H_
2 #define _SPI_LISTENER_H_
3
4 #include <cspi/spi-impl.h>
5
6 #ifdef  __cplusplus
7 extern "C" {
8 #endif
9
10 /*
11  * Structure used to encapsulate event information
12  */
13 typedef struct {
14   const char  *type;
15   Accessible  *source;
16   long         detail1;
17   long         detail2;
18 } AccessibleEvent;
19
20 typedef enum {
21   SPI_KEY_PRESSED  = 1<<0,
22   SPI_KEY_RELEASED = 1<<1
23 } AccessibleKeyEventType;
24
25
26 typedef struct {
27   long                   keyID;
28   short                  keycode;
29   long                   timestamp;
30   AccessibleKeyEventType type;
31   unsigned short         modifiers;
32 } AccessibleKeystroke;
33
34 /*
35  * Function prototype typedefs for Event Listener Callbacks.
36  * (see libspi/accessibleeventlistener.h for definition of SpiVoidEventListenerCB).
37  *
38  * usage: signatures should be
39  * void (*AccessibleEventListenerCB) (AccessibleEvent *event);
40  *
41  * SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystrokeEvent *Event);
42  */
43 typedef void       (*AccessibleEventListenerCB)     (AccessibleEvent     *event,
44                                                      void                *user_data);
45 typedef SPIBoolean (*AccessibleKeystrokeListenerCB) (AccessibleKeystroke *stroke,
46                                                      void                *user_data);
47
48 #ifdef  __cplusplus
49 }
50 #endif
51
52 #endif