signals.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_SIGNALS_H_
#define _PURPLE_SIGNALS_H_
#include <glib.h>
#include "value.h"
#define PURPLE_CALLBACK(func) ((PurpleCallback)func)
typedef void (*PurpleCallback)(void);
typedef void (*PurpleSignalMarshalFunc)(PurpleCallback cb, va_list args,
void *data, void **return_val);
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************/
/**************************************************************************/
#define PURPLE_SIGNAL_PRIORITY_DEFAULT 0
#define PURPLE_SIGNAL_PRIORITY_HIGHEST 9999
#define PURPLE_SIGNAL_PRIORITY_LOWEST -9999
gulong purple_signal_register(void *instance, const char *signal,
PurpleSignalMarshalFunc marshal,
PurpleValue *ret_value, int num_values, ...);
void purple_signal_unregister(void *instance, const char *signal);
void purple_signals_unregister_by_instance(void *instance);
void purple_signal_get_values(void *instance, const char *signal,
PurpleValue **ret_value,
int *num_values, PurpleValue ***values);
gulong purple_signal_connect_priority(void *instance, const char *signal,
void *handle, PurpleCallback func, void *data, int priority);
gulong purple_signal_connect(void *instance, const char *signal,
void *handle, PurpleCallback func, void *data);
gulong purple_signal_connect_priority_vargs(void *instance, const char *signal,
void *handle, PurpleCallback func, void *data, int priority);
gulong purple_signal_connect_vargs(void *instance, const char *signal,
void *handle, PurpleCallback func, void *data);
void purple_signal_disconnect(void *instance, const char *signal,
void *handle, PurpleCallback func);
void purple_signals_disconnect_by_handle(void *handle);
void purple_signal_emit(void *instance, const char *signal, ...);
void purple_signal_emit_vargs(void *instance, const char *signal, va_list args);
void *purple_signal_emit_return_1(void *instance, const char *signal, ...);
void *purple_signal_emit_vargs_return_1(void *instance, const char *signal,
va_list args);
void purple_signals_init(void);
void purple_signals_uninit(void);
/**************************************************************************/
/**************************************************************************/
void purple_marshal_VOID(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__INT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__INT_INT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_INT_INT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_INT_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_UINT_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_POINTER_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_VOID__POINTER_POINTER_POINTER_UINT_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_INT__INT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_INT__INT_INT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_INT__POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_INT__POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_INT__POINTER_POINTER_POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_BOOLEAN(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_POINTER_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_UINT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_BOOLEAN__INT_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_POINTER__POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_POINTER__POINTER_INT(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_POINTER__POINTER_INT64(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_POINTER__POINTER_INT_BOOLEAN(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_POINTER__POINTER_INT64_BOOLEAN(
PurpleCallback cb, va_list args, void *data, void **return_val);
void purple_marshal_POINTER__POINTER_POINTER(
PurpleCallback cb, va_list args, void *data, void **return_val);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_SIGNALS_H_ */
purple_signal_connect_priority
gulong purple_signal_connect_priority(void *instance, const char *signal, void *handle, PurpleCallback func, void *data, int priority)
Connects a signal handler to a signal for a particular object.
purple_signal_register
gulong purple_signal_register(void *instance, const char *signal, PurpleSignalMarshalFunc marshal, PurpleValue *ret_value, int num_values,...)
Registers a signal in an instance.
purple_signals_init
void purple_signals_init(void)
Initializes the signals subsystem.
purple_signals_disconnect_by_handle
void purple_signals_disconnect_by_handle(void *handle)
Removes all callbacks associated with a receiver handle.
purple_signals_unregister_by_instance
void purple_signals_unregister_by_instance(void *instance)
Unregisters all signals in an instance.
purple_signal_connect_vargs
gulong purple_signal_connect_vargs(void *instance, const char *signal, void *handle, PurpleCallback func, void *data)
Connects a signal handler to a signal for a particular object.
purple_signal_get_values
void purple_signal_get_values(void *instance, const char *signal, PurpleValue **ret_value, int *num_values, PurpleValue ***values)
Returns a list of value types used for a signal.
purple_signal_emit_vargs_return_1
void * purple_signal_emit_vargs_return_1(void *instance, const char *signal, va_list args)
Emits a signal and returns the first non-NULL return value.
purple_signal_emit_return_1
void * purple_signal_emit_return_1(void *instance, const char *signal,...)
Emits a signal and returns the first non-NULL return value.
purple_signals_uninit
void purple_signals_uninit(void)
Uninitializes the signals subsystem.
purple_signal_connect
gulong purple_signal_connect(void *instance, const char *signal, void *handle, PurpleCallback func, void *data)
Connects a signal handler to a signal for a particular object.
purple_signal_unregister
void purple_signal_unregister(void *instance, const char *signal)
Unregisters a signal in an instance.
PurpleValue
A wrapper for a type, subtype, and specific type of value.
Definition: value.h:89
purple_signal_emit
void purple_signal_emit(void *instance, const char *signal,...)
Emits a signal.
purple_signal_disconnect
void purple_signal_disconnect(void *instance, const char *signal, void *handle, PurpleCallback func)
Disconnects a signal handler from a signal on an object.
value.h
Value wrapper API.
purple_signal_emit_vargs
void purple_signal_emit_vargs(void *instance, const char *signal, va_list args)
Emits a signal, using a va_list of arguments.
purple_signal_connect_priority_vargs
gulong purple_signal_connect_priority_vargs(void *instance, const char *signal, void *handle, PurpleCallback func, void *data, int priority)
Connects a signal handler to a signal for a particular object.