Mercurial > pidgin
diff src/signals.h @ 10656:9b223bf37ca0
[gaim-migrate @ 12186]
sf patch #1154788, from Will Gorman
I added two new functions to signal_handler.h which
allows one to specify priority when registering a signal
callback.
the functions are:
gulong gaim_signal_connect_priority(void *instance,
const char *signal, void *handle, GaimCallback func,
void *data, int priority);
and
gulong gaim_signal_connect_priority_vargs(void
*instance, const char *signal, void *handle,
GaimCallback func, void *data, int priority);
(thanks Gary for the suggestion)
This allows plugins to specify in what order their
callbacks get called.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 06 Mar 2005 01:27:39 +0000 |
parents | 60db14d54914 |
children | 0caa9827edf5 |
line wrap: on
line diff
--- a/src/signals.h Sun Mar 06 00:57:42 2005 +0000 +++ b/src/signals.h Sun Mar 06 01:27:39 2005 +0000 @@ -44,6 +44,13 @@ /*@{*/ /** + * Signal Connect Priorities + */ +#define GAIM_SIGNAL_PRIORITY_DEFAULT 0 +#define GAIM_SIGNAL_PRIORITY_HIGHEST 9999 +#define GAIM_SIGNAL_PRIORITY_LOWEST -9999 + +/** * Registers a signal in an instance. * * @param instance The instance to register the signal for. @@ -101,6 +108,27 @@ * @param handle The handle of the receiver. * @param func The callback function. * @param data The data to pass to the callback function. + * @param priority The order in which the signal should be added to the list + * + * @return The signal handler ID. + * + * @see gaim_signal_disconnect() + */ +gulong gaim_signal_connect_priority(void *instance, const char *signal, + void *handle, GaimCallback func, void *data, int priority); + +/** + * Connects a signal handler to a signal for a particular object. + * (priority defaults to 0) + * + * Take care not to register a handler function twice. Gaim will + * not correct any mistakes for you in this area. + * + * @param instance The instance to connect to. + * @param signal The name of the signal to connect. + * @param handle The handle of the receiver. + * @param func The callback function. + * @param data The data to pass to the callback function. * * @return The signal handler ID. * @@ -123,6 +151,29 @@ * @param handle The handle of the receiver. * @param func The callback function. * @param data The data to pass to the callback function. + * @param priority The order in which the signal should be added to the list + * + * @return The signal handler ID. + * + * @see gaim_signal_disconnect() + */ +gulong gaim_signal_connect_priority_vargs(void *instance, const char *signal, + void *handle, GaimCallback func, void *data, int priority); + +/** + * Connects a signal handler to a signal for a particular object. + * (priority defaults to 0) + * The signal handler will take a va_args of arguments, instead of + * individual arguments. + * + * Take care not to register a handler function twice. Gaim will + * not correct any mistakes for you in this area. + * + * @param instance The instance to connect to. + * @param signal The name of the signal to connect. + * @param handle The handle of the receiver. + * @param func The callback function. + * @param data The data to pass to the callback function. * * @return The signal handler ID. *