2001-11-13 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_event.c
1
2 /**
3  * createEventListener:
4  * @callback : an #AccessibleEventListenerCB callback function, or NULL.
5  *
6  * Create a new #AccessibleEventListener with a specified callback function.
7  *
8  * Returns: a pointer to a newly-created #AccessibleEventListener.
9  *
10  **/
11 SpiAccessibleEventListener *
12 createEventListener (SpiAccessibleEventListenerCB callback)
13 {
14   SpiAccessibleEventListener *listener = spi_accessible_event_listener_new ();
15   if (callback)
16     {
17       spi_accessible_event_listener_add_callback (listener, callback);
18     }
19   return listener;
20 }
21
22 /**
23  * EventListener_addCallback:
24  * @listener: the #AccessibleEventListener instance to modify.
25  * @callback: an #AccessibleEventListenerCB function pointer.
26  *
27  * Add an in-process callback function to an existing SpiAccessibleEventListener.
28  *
29  * Returns: #TRUE if successful, otherwise #FALSE.
30  *
31  **/
32 boolean
33 EventListener_addCallback (SpiAccessibleEventListener *listener,
34                            SpiAccessibleEventListenerCB callback)
35 {
36   spi_accessible_event_listener_add_callback (listener, callback);
37   return TRUE;
38 }
39
40 /**
41  * EventListener_removeCallback:
42  * @listener: the #AccessibleEventListener instance to modify.
43  * @callback: an #AccessibleEventListenerCB function pointer.
44  *
45  * Remove an in-process callback function from an existing SpiAccessibleEventListener.
46  *
47  * Returns: #TRUE if successful, otherwise #FALSE.
48  *
49  **/
50 boolean
51 EventListener_removeCallback (SpiAccessibleEventListener *listener,
52                            SpiAccessibleEventListenerCB callback)
53 {
54   spi_accessible_event_listener_remove_callback (listener, callback);
55   return TRUE;
56 }
57
58 /**
59  * createKeystrokeListener:
60  * @callback : an #KeystrokeListenerCB callback function, or NULL.
61  *
62  * Create a new #KeystrokeListener with a specified callback function.
63  *
64  * Returns: a pointer to a newly-created #KeystrokeListener.
65  *
66  **/
67 KeystrokeListener *
68 createKeystrokeListener (KeystrokeListenerCB callback)
69 {
70   KeystrokeListener *listener = keystroke_listener_new ();
71   if (callback)
72     {
73       keystroke_listener_add_callback (listener, callback);
74     }
75   return listener;
76 }
77
78 /**
79  * KeystrokeListener_addCallback:
80  * @listener: the #KeystrokeListener instance to modify.
81  * @callback: an #KeystrokeListenerCB function pointer.
82  *
83  * Add an in-process callback function to an existing #KeystrokeListener.
84  *
85  * Returns: #TRUE if successful, otherwise #FALSE.
86  *
87  **/
88 boolean
89 KeystrokeListener_addCallback (KeystrokeListener *listener,
90                            KeystrokeListenerCB callback)
91 {
92   keystroke_listener_add_callback (listener, callback);
93   return TRUE;
94 }
95
96 /**
97  * KeystrokeListener_removeCallback:
98  * @listener: the #KeystrokeListener instance to modify.
99  * @callback: an #KeystrokeListenerCB function pointer.
100  *
101  * Remove an in-process callback function from an existing KeystrokeListener.
102  *
103  * Returns: #TRUE if successful, otherwise #FALSE.
104  *
105  **/
106 boolean
107 KeystrokeListener_removeCallback (KeystrokeListener *listener,
108                                   KeystrokeListenerCB callback)
109 {
110   keystroke_listener_remove_callback (listener, callback);
111   return TRUE;
112 }
113