| 111 * @instance: The instance to unregister the signal for. |
111 * @instance: The instance to unregister the signal for. |
| 112 * |
112 * |
| 113 * Unregisters all signals in an instance. |
113 * Unregisters all signals in an instance. |
| 114 */ |
114 */ |
| 115 void purple_signals_unregister_by_instance(void *instance); |
115 void purple_signals_unregister_by_instance(void *instance); |
| 116 |
|
| 117 /** |
|
| 118 * purple_signal_get_types: |
|
| 119 * @instance: The instance the signal is registered to. |
|
| 120 * @signal: The signal. |
|
| 121 * @ret_type: (out): The return type. |
|
| 122 * @num_values: (out): The returned number of parameters. |
|
| 123 * @param_types: (out): The returned list of parameter types. |
|
| 124 * |
|
| 125 * Outputs a list of value types used for a signal through the @ret_type, |
|
| 126 * @num_values and @param_types out parameters. |
|
| 127 */ |
|
| 128 void purple_signal_get_types(void *instance, const char *signal, |
|
| 129 GType *ret_type, int *num_values, |
|
| 130 GType **param_types); |
|
| 131 |
116 |
| 132 /** |
117 /** |
| 133 * purple_signal_connect_priority: |
118 * purple_signal_connect_priority: |
| 134 * @instance: The instance to connect to. |
119 * @instance: The instance to connect to. |
| 135 * @signal: The name of the signal to connect. |
120 * @signal: The name of the signal to connect. |
| 173 */ |
158 */ |
| 174 gulong purple_signal_connect(void *instance, const char *signal, |
159 gulong purple_signal_connect(void *instance, const char *signal, |
| 175 void *handle, GCallback func, void *data); |
160 void *handle, GCallback func, void *data); |
| 176 |
161 |
| 177 /** |
162 /** |
| 178 * purple_signal_connect_priority_vargs: |
|
| 179 * @instance: The instance to connect to. |
|
| 180 * @signal: The name of the signal to connect. |
|
| 181 * @handle: The handle of the receiver. |
|
| 182 * @func: (scope notified): The callback function. |
|
| 183 * @data: The data to pass to the callback function. |
|
| 184 * @priority: The priority with which the handler should be called. Signal |
|
| 185 * handlers are called in ascending numerical order of |
|
| 186 * @priority from #PURPLE_SIGNAL_PRIORITY_LOWEST to |
|
| 187 * #PURPLE_SIGNAL_PRIORITY_HIGHEST. |
|
| 188 * |
|
| 189 * Connects a signal handler to a signal for a particular object. |
|
| 190 * |
|
| 191 * The signal handler will take a va_args of arguments, instead of |
|
| 192 * individual arguments. |
|
| 193 * |
|
| 194 * Take care not to register a handler function twice. Purple will |
|
| 195 * not correct any mistakes for you in this area. |
|
| 196 * |
|
| 197 * See purple_signal_disconnect() |
|
| 198 * |
|
| 199 * Returns: The signal handler ID. |
|
| 200 */ |
|
| 201 gulong purple_signal_connect_priority_vargs(void *instance, const char *signal, |
|
| 202 void *handle, GCallback func, void *data, int priority); |
|
| 203 |
|
| 204 /** |
|
| 205 * purple_signal_connect_vargs: |
|
| 206 * @instance: The instance to connect to. |
|
| 207 * @signal: The name of the signal to connect. |
|
| 208 * @handle: The handle of the receiver. |
|
| 209 * @func: (scope notified): The callback function. |
|
| 210 * @data: The data to pass to the callback function. |
|
| 211 * |
|
| 212 * Connects a signal handler to a signal for a particular object. |
|
| 213 * (Its priority defaults to 0, aka #PURPLE_SIGNAL_PRIORITY_DEFAULT.) |
|
| 214 * |
|
| 215 * The signal handler will take a va_args of arguments, instead of |
|
| 216 * individual arguments. |
|
| 217 * |
|
| 218 * Take care not to register a handler function twice. Purple will |
|
| 219 * not correct any mistakes for you in this area. |
|
| 220 * |
|
| 221 * See purple_signal_disconnect() |
|
| 222 * |
|
| 223 * Returns: The signal handler ID. |
|
| 224 */ |
|
| 225 gulong purple_signal_connect_vargs(void *instance, const char *signal, |
|
| 226 void *handle, GCallback func, void *data); |
|
| 227 |
|
| 228 /** |
|
| 229 * purple_signal_disconnect: |
163 * purple_signal_disconnect: |
| 230 * @instance: The instance to disconnect from. |
164 * @instance: The instance to disconnect from. |
| 231 * @signal: The name of the signal to disconnect. |
165 * @signal: The name of the signal to disconnect. |
| 232 * @handle: The handle of the receiver. |
166 * @handle: The handle of the receiver. |
| 233 * @func: (scope call): The registered function to disconnect. |
167 * @func: (scope call): The registered function to disconnect. |
| 258 * See purple_signal_connect(), purple_signal_disconnect() |
192 * See purple_signal_connect(), purple_signal_disconnect() |
| 259 */ |
193 */ |
| 260 void purple_signal_emit(void *instance, const char *signal, ...); |
194 void purple_signal_emit(void *instance, const char *signal, ...); |
| 261 |
195 |
| 262 /** |
196 /** |
| 263 * purple_signal_emit_vargs: |
|
| 264 * @instance: The instance emitting the signal. |
|
| 265 * @signal: The signal being emitted. |
|
| 266 * @args: The arguments list. |
|
| 267 * |
|
| 268 * Emits a signal, using a va_list of arguments. |
|
| 269 * |
|
| 270 * See purple_signal_connect(), purple_signal_disconnect() |
|
| 271 */ |
|
| 272 void purple_signal_emit_vargs(void *instance, const char *signal, va_list args); |
|
| 273 |
|
| 274 /** |
|
| 275 * purple_signal_emit_return_1: |
197 * purple_signal_emit_return_1: |
| 276 * @instance: The instance emitting the signal. |
198 * @instance: The instance emitting the signal. |
| 277 * @signal: The signal being emitted. |
199 * @signal: The signal being emitted. |
| 278 * @...: The arguments to pass to the callbacks. |
200 * @...: The arguments to pass to the callbacks. |
| 279 * |
201 * |
| 285 * Returns: The first non-NULL return value |
207 * Returns: The first non-NULL return value |
| 286 */ |
208 */ |
| 287 void *purple_signal_emit_return_1(void *instance, const char *signal, ...); |
209 void *purple_signal_emit_return_1(void *instance, const char *signal, ...); |
| 288 |
210 |
| 289 /** |
211 /** |
| 290 * purple_signal_emit_vargs_return_1: |
|
| 291 * @instance: The instance emitting the signal. |
|
| 292 * @signal: The signal being emitted. |
|
| 293 * @args: The arguments list. |
|
| 294 * |
|
| 295 * Emits a signal and returns the first non-NULL return value. |
|
| 296 * |
|
| 297 * Further signal handlers are NOT called after a handler returns |
|
| 298 * something other than NULL. |
|
| 299 * |
|
| 300 * Returns: The first non-NULL return value |
|
| 301 */ |
|
| 302 void *purple_signal_emit_vargs_return_1(void *instance, const char *signal, |
|
| 303 va_list args); |
|
| 304 |
|
| 305 /** |
|
| 306 * purple_signals_init: |
212 * purple_signals_init: |
| 307 * |
213 * |
| 308 * Initializes the signals subsystem. |
214 * Initializes the signals subsystem. |
| 309 */ |
215 */ |
| 310 void purple_signals_init(void); |
216 void purple_signals_init(void); |