Renamed SpiAccessibleEventListener to (just) SpiEventListener.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_event.c
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001 Sun Microsystems Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 /**
24  * createAccessibleEventListener:
25  * @callback : an #AccessibleEventListenerCB callback function, or NULL.
26  *
27  * Create a new #AccessibleEventListener with a specified (in-process) callback function.
28  *
29  * Returns: a pointer to a newly-created #AccessibleEventListener.
30  *
31  **/
32 AccessibleEventListener *
33 createAccessibleEventListener (AccessibleEventListenerCB callback)
34 {
35   AccessibleEventListener *listener = spi_event_listener_new ();
36   if (callback)
37     {
38       spi_event_listener_add_callback (listener, callback);
39     }
40   return listener;
41 }
42
43 /**
44  * AccessibleEventListener_addCallback:
45  * @listener: the #AccessibleEventListener instance to modify.
46  * @callback: an #AccessibleEventListenerCB function pointer.
47  *
48  * Add an in-process callback function to an existing AccessibleEventListener.
49  * Note that the callback function must live in the same address
50  * space as the AccessibleEventListener implementation code, thus one should not
51  * use this function to attach callbacks to a 'remote' event listener
52  * (that is, one that was not created by a client call to
53  * createAccessibleEventListener ();
54  *
55  * Returns: #TRUE if successful, otherwise #FALSE.
56  *
57  **/
58 boolean
59 AccessibleEventListener_addCallback (AccessibleEventListener *listener,
60                            AccessibleEventListenerCB callback)
61 {
62   spi_event_listener_add_callback (listener, callback);
63   return TRUE;
64 }
65
66 /**
67  * AccessibleEventListener_removeCallback:
68  * @listener: the #AccessibleEventListener instance to modify.
69  * @callback: an #AccessibleEventListenerCB function pointer.
70  *
71  * Remove an in-process callback function from an existing AccessibleEventListener.
72  *
73  * Returns: #TRUE if successful, otherwise #FALSE.
74  *
75  **/
76 boolean
77 AccessibleEventListener_removeCallback (AccessibleEventListener *listener,
78                                         AccessibleEventListenerCB callback)
79 {
80   spi_event_listener_remove_callback (listener, callback);
81   return TRUE;
82 }
83
84 /**
85  * createAccessibleKeystrokeListener:
86  * @callback : an #AccessibleKeystrokeListenerCB callback function, or NULL.
87  *
88  * Create a new #AccessibleKeystrokeListener with a specified callback function.
89  *
90  * Returns: a pointer to a newly-created #AccessibleKeystrokeListener.
91  *
92  **/
93 AccessibleKeystrokeListener *
94 createAccessibleKeystrokeListener (AccessibleKeystrokeListenerCB callback)
95 {
96   SpiKeystrokeListener *listener = spi_keystroke_listener_new ();
97   if (callback)
98     {
99       spi_keystroke_listener_add_callback (listener, callback);
100     }
101   return (AccessibleKeystrokeListener *)listener;
102 }
103
104 /**
105  * AccessibleKeystrokeListener_addCallback:
106  * @listener: the #AccessibleKeystrokeListener instance to modify.
107  * @callback: an #AccessibleKeystrokeListenerCB function pointer.
108  *
109  * Add an in-process callback function to an existing #AccessibleKeystrokeListener.
110  *
111  * Returns: #TRUE if successful, otherwise #FALSE.
112  *
113  **/
114 boolean
115 AccessibleKeystrokeListener_addCallback (AccessibleKeystrokeListener *listener,
116                                          AccessibleKeystrokeListenerCB callback)
117 {
118   spi_keystroke_listener_add_callback (listener, callback);
119   return TRUE;
120 }
121
122 /**
123  * AccessibleKeystrokeListener_removeCallback:
124  * @listener: the #AccessibleKeystrokeListener instance to modify.
125  * @callback: an #AccessibleKeystrokeListenerCB function pointer.
126  *
127  * Remove an in-process callback function from an existing #AccessibleKeystrokeListener.
128  *
129  * Returns: #TRUE if successful, otherwise #FALSE.
130  *
131  **/
132 boolean
133 AccessibleKeystrokeListener_removeCallback (AccessibleKeystrokeListener *listener,
134                                             AccessibleKeystrokeListenerCB callback)
135 {
136   keystroke_listener_remove_callback (listener, callback);
137   return TRUE;
138 }
139