Mercurial > pidgin
comparison 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 |
comparison
equal
deleted
inserted
replaced
10655:9699787f1c55 | 10656:9b223bf37ca0 |
---|---|
40 | 40 |
41 /**************************************************************************/ | 41 /**************************************************************************/ |
42 /** @name Signal API */ | 42 /** @name Signal API */ |
43 /**************************************************************************/ | 43 /**************************************************************************/ |
44 /*@{*/ | 44 /*@{*/ |
45 | |
46 /** | |
47 * Signal Connect Priorities | |
48 */ | |
49 #define GAIM_SIGNAL_PRIORITY_DEFAULT 0 | |
50 #define GAIM_SIGNAL_PRIORITY_HIGHEST 9999 | |
51 #define GAIM_SIGNAL_PRIORITY_LOWEST -9999 | |
45 | 52 |
46 /** | 53 /** |
47 * Registers a signal in an instance. | 54 * Registers a signal in an instance. |
48 * | 55 * |
49 * @param instance The instance to register the signal for. | 56 * @param instance The instance to register the signal for. |
99 * @param instance The instance to connect to. | 106 * @param instance The instance to connect to. |
100 * @param signal The name of the signal to connect. | 107 * @param signal The name of the signal to connect. |
101 * @param handle The handle of the receiver. | 108 * @param handle The handle of the receiver. |
102 * @param func The callback function. | 109 * @param func The callback function. |
103 * @param data The data to pass to the callback function. | 110 * @param data The data to pass to the callback function. |
111 * @param priority The order in which the signal should be added to the list | |
112 * | |
113 * @return The signal handler ID. | |
114 * | |
115 * @see gaim_signal_disconnect() | |
116 */ | |
117 gulong gaim_signal_connect_priority(void *instance, const char *signal, | |
118 void *handle, GaimCallback func, void *data, int priority); | |
119 | |
120 /** | |
121 * Connects a signal handler to a signal for a particular object. | |
122 * (priority defaults to 0) | |
123 * | |
124 * Take care not to register a handler function twice. Gaim will | |
125 * not correct any mistakes for you in this area. | |
126 * | |
127 * @param instance The instance to connect to. | |
128 * @param signal The name of the signal to connect. | |
129 * @param handle The handle of the receiver. | |
130 * @param func The callback function. | |
131 * @param data The data to pass to the callback function. | |
104 * | 132 * |
105 * @return The signal handler ID. | 133 * @return The signal handler ID. |
106 * | 134 * |
107 * @see gaim_signal_disconnect() | 135 * @see gaim_signal_disconnect() |
108 */ | 136 */ |
110 void *handle, GaimCallback func, void *data); | 138 void *handle, GaimCallback func, void *data); |
111 | 139 |
112 /** | 140 /** |
113 * Connects a signal handler to a signal for a particular object. | 141 * Connects a signal handler to a signal for a particular object. |
114 * | 142 * |
143 * The signal handler will take a va_args of arguments, instead of | |
144 * individual arguments. | |
145 * | |
146 * Take care not to register a handler function twice. Gaim will | |
147 * not correct any mistakes for you in this area. | |
148 * | |
149 * @param instance The instance to connect to. | |
150 * @param signal The name of the signal to connect. | |
151 * @param handle The handle of the receiver. | |
152 * @param func The callback function. | |
153 * @param data The data to pass to the callback function. | |
154 * @param priority The order in which the signal should be added to the list | |
155 * | |
156 * @return The signal handler ID. | |
157 * | |
158 * @see gaim_signal_disconnect() | |
159 */ | |
160 gulong gaim_signal_connect_priority_vargs(void *instance, const char *signal, | |
161 void *handle, GaimCallback func, void *data, int priority); | |
162 | |
163 /** | |
164 * Connects a signal handler to a signal for a particular object. | |
165 * (priority defaults to 0) | |
115 * The signal handler will take a va_args of arguments, instead of | 166 * The signal handler will take a va_args of arguments, instead of |
116 * individual arguments. | 167 * individual arguments. |
117 * | 168 * |
118 * Take care not to register a handler function twice. Gaim will | 169 * Take care not to register a handler function twice. Gaim will |
119 * not correct any mistakes for you in this area. | 170 * not correct any mistakes for you in this area. |