7ff4858d33c9a5631d0ad33e70439d323f7812bf
[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 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_accessible_event_listener_new ();
36   if (callback)
37     {
38       spi_accessible_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  *
50  * Returns: #TRUE if successful, otherwise #FALSE.
51  *
52  **/
53 boolean
54 AccessibleEventListener_addCallback (AccessibleEventListener *listener,
55                                      AccessibleEventListenerCB callback)
56 {
57   spi_accessible_event_listener_add_callback (listener, callback);
58   return TRUE;
59 }
60
61 /**
62  * AccessibleEventListener_removeCallback:
63  * @listener: the #AccessibleEventListener instance to modify.
64  * @callback: an #AccessibleEventListenerCB function pointer.
65  *
66  * Remove an in-process callback function from an existing AccessibleEventListener.
67  *
68  * Returns: #TRUE if successful, otherwise #FALSE.
69  *
70  **/
71 boolean
72 AccessibleEventListener_removeCallback (AccessibleEventListener *listener,
73                                         AccessibleEventListenerCB callback)
74 {
75   spi_accessible_event_listener_remove_callback (listener, callback);
76   return TRUE;
77 }
78
79 /**
80  * createAccessibleKeystrokeListener:
81  * @callback : an #AccessibleKeystrokeListenerCB callback function, or NULL.
82  *
83  * Create a new #AccessibleKeystrokeListener with a specified callback function.
84  *
85  * Returns: a pointer to a newly-created #AccessibleKeystrokeListener.
86  *
87  **/
88 AccessibleKeystrokeListener *
89 createAccessibleKeystrokeListener (AccessibleKeystrokeListenerCB callback)
90 {
91   SpiKeystrokeListener *listener = spi_keystroke_listener_new ();
92   if (callback)
93     {
94       spi_keystroke_listener_add_callback (listener, callback);
95     }
96   return (AccessibleKeystrokeListener *)listener;
97 }
98
99 /**
100  * AccessibleKeystrokeListener_addCallback:
101  * @listener: the #AccessibleKeystrokeListener instance to modify.
102  * @callback: an #AccessibleKeystrokeListenerCB function pointer.
103  *
104  * Add an in-process callback function to an existing #AccessibleKeystrokeListener.
105  *
106  * Returns: #TRUE if successful, otherwise #FALSE.
107  *
108  **/
109 boolean
110 AccessibleKeystrokeListener_addCallback (AccessibleKeystrokeListener *listener,
111                                          AccessibleKeystrokeListenerCB callback)
112 {
113   spi_keystroke_listener_add_callback (listener, callback);
114   return TRUE;
115 }
116
117 /**
118  * AccessibleKeystrokeListener_removeCallback:
119  * @listener: the #AccessibleKeystrokeListener instance to modify.
120  * @callback: an #AccessibleKeystrokeListenerCB function pointer.
121  *
122  * Remove an in-process callback function from an existing #AccessibleKeystrokeListener.
123  *
124  * Returns: #TRUE if successful, otherwise #FALSE.
125  *
126  **/
127 boolean
128 AccessibleKeystrokeListener_removeCallback (AccessibleKeystrokeListener *listener,
129                                             AccessibleKeystrokeListenerCB callback)
130 {
131   keystroke_listener_remove_callback (listener, callback);
132   return TRUE;
133 }
134