Mercurial > pidgin
annotate libgaim/plugins/signals-test.c @ 14845:b1650510f4b8
[gaim-migrate @ 17614]
a couple of minor fixes
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 29 Oct 2006 00:15:32 +0000 |
parents | 7fb8a8583c73 |
children |
rev | line source |
---|---|
14192 | 1 /* |
2 * Signals test plugin. | |
3 * | |
4 * Copyright (C) 2003 Christian Hammond. | |
5 * | |
6 * This program is free software; you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation; either version 2 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, but | |
12 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
19 * 02111-1307, USA. | |
20 */ | |
21 #define SIGNAL_TEST_PLUGIN_ID "core-signals-test" | |
22 | |
23 #include <stdio.h> | |
24 | |
25 #include "internal.h" | |
26 #include "cipher.h" | |
27 #include "connection.h" | |
28 #include "conversation.h" | |
29 #include "core.h" | |
30 #include "debug.h" | |
31 #include "ft.h" | |
32 #include "signals.h" | |
33 #include "version.h" | |
34 #include "status.h" | |
35 #include "sound.h" | |
36 | |
37 /************************************************************************** | |
38 * Account subsystem signal callbacks | |
39 **************************************************************************/ | |
40 static void | |
41 account_connecting_cb(GaimAccount *account, void *data) | |
42 { | |
43 gaim_debug_misc("signals test", "account-connecting (%s)\n", | |
44 gaim_account_get_username(account)); | |
45 } | |
46 | |
47 static void | |
48 account_setting_info_cb(GaimAccount *account, const char *info, void *data) | |
49 { | |
50 gaim_debug_misc("signals test", "account-setting-info (%s, %s)\n", | |
51 gaim_account_get_username(account), info); | |
52 } | |
53 | |
54 static void | |
55 account_set_info_cb(GaimAccount *account, const char *info, void *data) | |
56 { | |
57 gaim_debug_misc("signals test", "account-set-info (%s, %s)\n", | |
58 gaim_account_get_username(account), info); | |
59 } | |
60 | |
61 static void | |
62 account_status_changed(GaimAccount *account, GaimStatus *old, GaimStatus *new, | |
63 gpointer data) | |
64 { | |
65 gaim_debug_misc("signals test", "account-status-changed (%s, %s, %s)\n", | |
66 gaim_account_get_username(account), | |
67 gaim_status_get_name(old), | |
68 gaim_status_get_name(new)); | |
69 } | |
70 | |
71 static void | |
72 account_alias_changed(GaimAccount *account, const char *old, gpointer data) | |
73 { | |
74 gaim_debug_misc("signals test", "account-alias-changed (%s, %s, %s)\n", | |
75 gaim_account_get_username(account), | |
76 old, gaim_account_get_alias(account)); | |
77 } | |
78 | |
79 /************************************************************************** | |
80 * Buddy Icons signal callbacks | |
81 **************************************************************************/ | |
82 static void | |
83 buddy_icon_changed_cb(GaimBuddy *buddy) | |
84 { | |
85 gaim_debug_misc("signals test", "buddy icon changed (%s)\n", | |
86 gaim_buddy_get_name(buddy)); | |
87 } | |
88 | |
89 /************************************************************************** | |
90 * Buddy List subsystem signal callbacks | |
91 **************************************************************************/ | |
92 static void | |
93 buddy_status_changed_cb(GaimBuddy *buddy, GaimStatus *old_status, | |
94 GaimStatus *status, void *data) | |
95 { | |
96 gaim_debug_misc("signals test", "buddy-status-changed (%s %s to %s)\n", | |
97 buddy->name, gaim_status_get_id(old_status), | |
98 gaim_status_get_id(status)); | |
99 } | |
100 | |
101 static void | |
102 buddy_idle_changed_cb(GaimBuddy *buddy, gboolean old_idle, gboolean idle, | |
103 void *data) | |
104 { | |
105 gaim_debug_misc("signals test", "buddy-idle-changed (%s %s)\n", | |
106 buddy->name, old_idle ? "unidled" : "idled"); | |
107 } | |
108 | |
109 static void | |
110 buddy_signed_on_cb(GaimBuddy *buddy, void *data) | |
111 { | |
112 gaim_debug_misc("signals test", "buddy-signed-on (%s)\n", buddy->name); | |
113 } | |
114 | |
115 static void | |
116 buddy_signed_off_cb(GaimBuddy *buddy, void *data) | |
117 { | |
118 gaim_debug_misc("signals test", "buddy-signed-off (%s)\n", buddy->name); | |
119 } | |
120 | |
121 static void | |
122 buddy_added_cb(GaimBuddy *buddy, void *data) | |
123 { | |
124 gaim_debug_misc("signals test", "buddy_added_cb (%s)\n", gaim_buddy_get_name(buddy)); | |
125 } | |
126 | |
127 static void | |
128 buddy_removed_cb(GaimBuddy *buddy, void *data) | |
129 { | |
130 gaim_debug_misc("signals test", "buddy_removed_cb (%s)\n", gaim_buddy_get_name(buddy)); | |
131 } | |
132 | |
133 static void | |
134 blist_node_aliased(GaimBlistNode *node, const char *old_alias) | |
135 { | |
136 GaimContact *p = (GaimContact *)node; | |
137 GaimBuddy *b = (GaimBuddy *)node; | |
138 GaimChat *c = (GaimChat *)node; | |
139 GaimGroup *g = (GaimGroup *)node; | |
140 | |
141 if (GAIM_BLIST_NODE_IS_CONTACT(node)) | |
142 gaim_debug_misc("signals test", "blist-node-aliased (Contact: %s, %s)\n", p->alias, old_alias); | |
143 else if (GAIM_BLIST_NODE_IS_BUDDY(node)) | |
144 gaim_debug_misc("signals test", "blist-node-aliased (Buddy: %s, %s)\n", b->name, old_alias); | |
145 else if (GAIM_BLIST_NODE_IS_CHAT(node)) | |
146 gaim_debug_misc("signals test", "blist-node-aliased (Chat: %s, %s)\n", c->alias, old_alias); | |
147 else if (GAIM_BLIST_NODE_IS_GROUP(node)) | |
148 gaim_debug_misc("signals test", "blist-node-aliased (Group: %s, %s)\n", g->name, old_alias); | |
149 else | |
150 gaim_debug_misc("signals test", "blist-node-aliased (UNKNOWN: %d, %s)\n", node->type, old_alias); | |
151 | |
152 } | |
153 | |
154 static void | |
155 blist_node_extended_menu_cb(GaimBlistNode *node, void *data) | |
156 { | |
157 GaimContact *p = (GaimContact *)node; | |
158 GaimBuddy *b = (GaimBuddy *)node; | |
159 GaimChat *c = (GaimChat *)node; | |
160 GaimGroup *g = (GaimGroup *)node; | |
161 | |
162 if (GAIM_BLIST_NODE_IS_CONTACT(node)) | |
163 gaim_debug_misc("signals test", "blist-node-extended-menu (Contact: %s)\n", p->alias); | |
164 else if (GAIM_BLIST_NODE_IS_BUDDY(node)) | |
165 gaim_debug_misc("signals test", "blist-node-extended-menu (Buddy: %s)\n", b->name); | |
166 else if (GAIM_BLIST_NODE_IS_CHAT(node)) | |
167 gaim_debug_misc("signals test", "blist-node-extended-menu (Chat: %s)\n", c->alias); | |
168 else if (GAIM_BLIST_NODE_IS_GROUP(node)) | |
169 gaim_debug_misc("signals test", "blist-node-extended-menu (Group: %s)\n", g->name); | |
170 else | |
171 gaim_debug_misc("signals test", "blist-node-extended-menu (UNKNOWN: %d)\n", node->type); | |
172 | |
173 } | |
174 | |
175 | |
176 /************************************************************************** | |
177 * Connection subsystem signal callbacks | |
178 **************************************************************************/ | |
179 static void | |
180 signing_on_cb(GaimConnection *gc, void *data) | |
181 { | |
182 gaim_debug_misc("signals test", "signing-on (%s)\n", | |
183 gaim_account_get_username(gaim_connection_get_account(gc))); | |
184 } | |
185 | |
186 static void | |
187 signed_on_cb(GaimConnection *gc, void *data) | |
188 { | |
189 gaim_debug_misc("signals test", "signed-on (%s)\n", | |
190 gaim_account_get_username(gaim_connection_get_account(gc))); | |
191 } | |
192 | |
193 static void | |
194 signing_off_cb(GaimConnection *gc, void *data) | |
195 { | |
196 gaim_debug_misc("signals test", "signing-off (%s)\n", | |
197 gaim_account_get_username(gaim_connection_get_account(gc))); | |
198 } | |
199 | |
200 static void | |
201 signed_off_cb(GaimConnection *gc, void *data) | |
202 { | |
203 gaim_debug_misc("signals test", "signed-off (%s)\n", | |
204 gaim_account_get_username(gaim_connection_get_account(gc))); | |
205 } | |
206 | |
207 /************************************************************************** | |
208 * Conversation subsystem signal callbacks | |
209 **************************************************************************/ | |
210 static gboolean | |
211 writing_im_msg_cb(GaimAccount *account, const char *who, char **buffer, | |
212 GaimConversation *conv, GaimMessageFlags flags, void *data) | |
213 { | |
214 gaim_debug_misc("signals test", "writing-im-msg (%s, %s, %s)\n", | |
215 gaim_account_get_username(account), gaim_conversation_get_name(conv), *buffer); | |
216 | |
217 return FALSE; | |
218 | |
219 } | |
220 | |
221 static void | |
222 wrote_im_msg_cb(GaimAccount *account, const char *who, const char *buffer, | |
223 GaimConversation *conv, GaimMessageFlags flags, void *data) | |
224 { | |
225 gaim_debug_misc("signals test", "wrote-im-msg (%s, %s, %s)\n", | |
226 gaim_account_get_username(account), gaim_conversation_get_name(conv), buffer); | |
227 } | |
228 | |
229 static void | |
230 sending_im_msg_cb(GaimAccount *account, char *recipient, char **buffer, void *data) | |
231 { | |
232 gaim_debug_misc("signals test", "sending-im-msg (%s, %s, %s)\n", | |
233 gaim_account_get_username(account), recipient, *buffer); | |
234 | |
235 } | |
236 | |
237 static void | |
238 sent_im_msg_cb(GaimAccount *account, const char *recipient, const char *buffer, void *data) | |
239 { | |
240 gaim_debug_misc("signals test", "sent-im-msg (%s, %s, %s)\n", | |
241 gaim_account_get_username(account), recipient, buffer); | |
242 } | |
243 | |
244 static gboolean | |
245 receiving_im_msg_cb(GaimAccount *account, char **sender, char **buffer, | |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14192
diff
changeset
|
246 GaimConversation *conv, GaimMessageFlags *flags, void *data) |
14192 | 247 { |
248 gaim_debug_misc("signals test", "receiving-im-msg (%s, %s, %s, %s, %d)\n", | |
249 gaim_account_get_username(account), *sender, *buffer, | |
250 (conv != NULL) ? gaim_conversation_get_name(conv) : "(null)", *flags); | |
251 | |
252 return FALSE; | |
253 } | |
254 | |
255 static void | |
256 received_im_msg_cb(GaimAccount *account, char *sender, char *buffer, | |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14192
diff
changeset
|
257 GaimConversation *conv, GaimMessageFlags flags, void *data) |
14192 | 258 { |
259 gaim_debug_misc("signals test", "received-im-msg (%s, %s, %s, %s, %d)\n", | |
260 gaim_account_get_username(account), sender, buffer, | |
261 (conv != NULL) ? gaim_conversation_get_name(conv) : "(null)", flags); | |
262 } | |
263 | |
264 static gboolean | |
265 writing_chat_msg_cb(GaimAccount *account, const char *who, char **buffer, | |
266 GaimConversation *conv, GaimMessageFlags flags, void *data) | |
267 { | |
268 gaim_debug_misc("signals test", "writing-chat-msg (%s, %s)\n", | |
269 gaim_conversation_get_name(conv), *buffer); | |
270 | |
271 return FALSE; | |
272 } | |
273 | |
274 static void | |
275 wrote_chat_msg_cb(GaimAccount *account, const char *who, const char *buffer, | |
276 GaimConversation *conv, GaimMessageFlags flags, void *data) | |
277 { | |
278 gaim_debug_misc("signals test", "wrote-chat-msg (%s, %s)\n", | |
279 gaim_conversation_get_name(conv), buffer); | |
280 } | |
281 | |
282 static gboolean | |
283 sending_chat_msg_cb(GaimAccount *account, char **buffer, int id, void *data) | |
284 { | |
285 gaim_debug_misc("signals test", "sending-chat-msg (%s, %s, %d)\n", | |
286 gaim_account_get_username(account), *buffer, id); | |
287 | |
288 return FALSE; | |
289 } | |
290 | |
291 static void | |
292 sent_chat_msg_cb(GaimAccount *account, const char *buffer, int id, void *data) | |
293 { | |
294 gaim_debug_misc("signals test", "sent-chat-msg (%s, %s, %d)\n", | |
295 gaim_account_get_username(account), buffer, id); | |
296 } | |
297 | |
298 static gboolean | |
299 receiving_chat_msg_cb(GaimAccount *account, char **sender, char **buffer, | |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14192
diff
changeset
|
300 GaimConversation *chat, GaimMessageFlags *flags, void *data) |
14192 | 301 { |
302 gaim_debug_misc("signals test", | |
303 "receiving-chat-msg (%s, %s, %s, %s, %d)\n", | |
304 gaim_account_get_username(account), *sender, *buffer, | |
305 gaim_conversation_get_name(chat), *flags); | |
306 | |
307 return FALSE; | |
308 } | |
309 | |
310 static void | |
311 received_chat_msg_cb(GaimAccount *account, char *sender, char *buffer, | |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14192
diff
changeset
|
312 GaimConversation *chat, GaimMessageFlags flags, void *data) |
14192 | 313 { |
314 gaim_debug_misc("signals test", | |
315 "received-chat-msg (%s, %s, %s, %s, %d)\n", | |
316 gaim_account_get_username(account), sender, buffer, | |
317 gaim_conversation_get_name(chat), flags); | |
318 } | |
319 | |
320 static void | |
321 conversation_created_cb(GaimConversation *conv, void *data) | |
322 { | |
323 gaim_debug_misc("signals test", "conversation-created (%s)\n", | |
324 gaim_conversation_get_name(conv)); | |
325 } | |
326 | |
327 static void | |
328 deleting_conversation_cb(GaimConversation *conv, void *data) | |
329 { | |
330 gaim_debug_misc("signals test", "deleting-conversation (%s)\n", | |
331 gaim_conversation_get_name(conv)); | |
332 } | |
333 | |
334 static void | |
335 buddy_typing_cb(GaimAccount *account, const char *name, void *data) | |
336 { | |
337 gaim_debug_misc("signals test", "buddy-typing (%s, %s)\n", | |
338 gaim_account_get_username(account), name); | |
339 } | |
340 | |
341 static void | |
342 buddy_typing_stopped_cb(GaimAccount *account, const char *name, void *data) | |
343 { | |
344 gaim_debug_misc("signals test", "buddy-typing-stopped (%s, %s)\n", | |
345 gaim_account_get_username(account), name); | |
346 } | |
347 | |
348 static gboolean | |
349 chat_buddy_joining_cb(GaimConversation *conv, const char *user, | |
350 GaimConvChatBuddyFlags flags, void *data) | |
351 { | |
352 gaim_debug_misc("signals test", "chat-buddy-joining (%s, %s, %d)\n", | |
353 gaim_conversation_get_name(conv), user, flags); | |
354 | |
355 return FALSE; | |
356 } | |
357 | |
358 static void | |
359 chat_buddy_joined_cb(GaimConversation *conv, const char *user, | |
360 GaimConvChatBuddyFlags flags, gboolean new_arrival, void *data) | |
361 { | |
362 gaim_debug_misc("signals test", "chat-buddy-joined (%s, %s, %d, %d)\n", | |
363 gaim_conversation_get_name(conv), user, flags, new_arrival); | |
364 } | |
365 | |
366 static void | |
367 chat_buddy_flags_cb(GaimConversation *conv, const char *user, | |
368 GaimConvChatBuddyFlags oldflags, GaimConvChatBuddyFlags newflags, void *data) | |
369 { | |
370 gaim_debug_misc("signals test", "chat-buddy-flags (%s, %s, %d, %d)\n", | |
371 gaim_conversation_get_name(conv), user, oldflags, newflags); | |
372 } | |
373 | |
374 static gboolean | |
375 chat_buddy_leaving_cb(GaimConversation *conv, const char *user, | |
376 const char *reason, void *data) | |
377 { | |
378 gaim_debug_misc("signals test", "chat-buddy-leaving (%s, %s, %s)\n", | |
379 gaim_conversation_get_name(conv), user, reason); | |
380 | |
381 return FALSE; | |
382 } | |
383 | |
384 static void | |
385 chat_buddy_left_cb(GaimConversation *conv, const char *user, | |
386 const char *reason, void *data) | |
387 { | |
388 gaim_debug_misc("signals test", "chat-buddy-left (%s, %s, %s)\n", | |
389 gaim_conversation_get_name(conv), user, reason); | |
390 } | |
391 | |
392 static void | |
393 chat_inviting_user_cb(GaimConversation *conv, const char *name, | |
394 char **reason, void *data) | |
395 { | |
396 gaim_debug_misc("signals test", "chat-inviting-user (%s, %s, %s)\n", | |
397 gaim_conversation_get_name(conv), name, *reason); | |
398 } | |
399 | |
400 static void | |
401 chat_invited_user_cb(GaimConversation *conv, const char *name, | |
402 const char *reason, void *data) | |
403 { | |
404 gaim_debug_misc("signals test", "chat-invited-user (%s, %s, %s)\n", | |
405 gaim_conversation_get_name(conv), name, reason); | |
406 } | |
407 | |
408 static gint | |
409 chat_invited_cb(GaimAccount *account, const char *inviter, | |
410 const char *room_name, const char *message, | |
411 const GHashTable *components, void *data) | |
412 { | |
413 gaim_debug_misc("signals test", "chat-invited (%s, %s, %s, %s)\n", | |
414 gaim_account_get_username(account), inviter, | |
415 room_name, message); | |
416 | |
417 return 0; | |
418 } | |
419 | |
420 static void | |
421 chat_joined_cb(GaimConversation *conv, void *data) | |
422 { | |
423 gaim_debug_misc("signals test", "chat-joined (%s)\n", | |
424 gaim_conversation_get_name(conv)); | |
425 } | |
426 | |
427 static void | |
428 chat_left_cb(GaimConversation *conv, void *data) | |
429 { | |
430 gaim_debug_misc("signals test", "chat-left (%s)\n", | |
431 gaim_conversation_get_name(conv)); | |
432 } | |
433 | |
434 static void | |
435 chat_topic_changed_cb(GaimConversation *conv, const char *who, | |
436 const char *topic, void *data) | |
437 { | |
438 gaim_debug_misc("signals test", | |
439 "chat-topic-changed (%s topic changed to: \"%s\" by %s)\n", | |
440 gaim_conversation_get_name(conv), topic, | |
441 (who) ? who : "unknown"); | |
442 } | |
443 /************************************************************************** | |
444 * Ciphers signal callbacks | |
445 **************************************************************************/ | |
446 static void | |
447 cipher_added_cb(GaimCipher *cipher, void *data) { | |
448 gaim_debug_misc("signals test", "cipher %s added\n", | |
449 gaim_cipher_get_name(cipher)); | |
450 } | |
451 | |
452 static void | |
453 cipher_removed_cb(GaimCipher *cipher, void *data) { | |
454 gaim_debug_misc("signals test", "cipher %s removed\n", | |
455 gaim_cipher_get_name(cipher)); | |
456 } | |
457 | |
458 /************************************************************************** | |
459 * Core signal callbacks | |
460 **************************************************************************/ | |
461 static void | |
462 quitting_cb(void *data) | |
463 { | |
464 gaim_debug_misc("signals test", "quitting ()\n"); | |
465 } | |
466 | |
467 /************************************************************************** | |
468 * File transfer signal callbacks | |
469 **************************************************************************/ | |
470 static void | |
471 ft_recv_accept_cb(GaimXfer *xfer, gpointer data) { | |
472 gaim_debug_misc("signals test", "file receive accepted\n"); | |
473 } | |
474 | |
475 static void | |
476 ft_send_accept_cb(GaimXfer *xfer, gpointer data) { | |
477 gaim_debug_misc("signals test", "file send accepted\n"); | |
478 } | |
479 | |
480 static void | |
481 ft_recv_start_cb(GaimXfer *xfer, gpointer data) { | |
482 gaim_debug_misc("signals test", "file receive started\n"); | |
483 } | |
484 | |
485 static void | |
486 ft_send_start_cb(GaimXfer *xfer, gpointer data) { | |
487 gaim_debug_misc("signals test", "file send started\n"); | |
488 } | |
489 | |
490 static void | |
491 ft_recv_cancel_cb(GaimXfer *xfer, gpointer data) { | |
492 gaim_debug_misc("signals test", "file receive canceled\n"); | |
493 } | |
494 | |
495 static void | |
496 ft_send_cancel_cb(GaimXfer *xfer, gpointer data) { | |
497 gaim_debug_misc("signals test", "file send canceled\n"); | |
498 } | |
499 | |
500 static void | |
501 ft_recv_complete_cb(GaimXfer *xfer, gpointer data) { | |
502 gaim_debug_misc("signals test", "file receive completed\n"); | |
503 } | |
504 | |
505 static void | |
506 ft_send_complete_cb(GaimXfer *xfer, gpointer data) { | |
507 gaim_debug_misc("signals test", "file send completed\n"); | |
508 } | |
509 | |
510 /************************************************************************** | |
511 * Sound signal callbacks | |
512 **************************************************************************/ | |
513 static int | |
514 sound_playing_event_cb(GaimSoundEventID event, const GaimAccount *account) { | |
515 if (account != NULL) | |
516 gaim_debug_misc("signals test", "sound playing event: %d for account: %s\n", | |
517 event, gaim_account_get_username(account)); | |
518 else | |
519 gaim_debug_misc("signals test", "sound playing event: %d\n", event); | |
520 | |
521 return 0; | |
522 } | |
523 | |
524 /************************************************************************** | |
525 * Plugin stuff | |
526 **************************************************************************/ | |
527 static gboolean | |
528 plugin_load(GaimPlugin *plugin) | |
529 { | |
530 void *core_handle = gaim_get_core(); | |
531 void *blist_handle = gaim_blist_get_handle(); | |
532 void *conn_handle = gaim_connections_get_handle(); | |
533 void *conv_handle = gaim_conversations_get_handle(); | |
534 void *accounts_handle = gaim_accounts_get_handle(); | |
535 void *ciphers_handle = gaim_ciphers_get_handle(); | |
536 void *ft_handle = gaim_xfers_get_handle(); | |
537 void *sound_handle = gaim_sounds_get_handle(); | |
538 | |
539 /* Accounts subsystem signals */ | |
540 gaim_signal_connect(accounts_handle, "account-connecting", | |
541 plugin, GAIM_CALLBACK(account_connecting_cb), NULL); | |
542 gaim_signal_connect(accounts_handle, "account-setting-info", | |
543 plugin, GAIM_CALLBACK(account_setting_info_cb), NULL); | |
544 gaim_signal_connect(accounts_handle, "account-set-info", | |
545 plugin, GAIM_CALLBACK(account_set_info_cb), NULL); | |
546 gaim_signal_connect(accounts_handle, "account-status-changed", | |
547 plugin, GAIM_CALLBACK(account_status_changed), NULL); | |
548 gaim_signal_connect(accounts_handle, "account-alias-changed", | |
549 plugin, GAIM_CALLBACK(account_alias_changed), NULL); | |
550 | |
551 /* Buddy List subsystem signals */ | |
552 gaim_signal_connect(blist_handle, "buddy-status-changed", | |
553 plugin, GAIM_CALLBACK(buddy_status_changed_cb), NULL); | |
554 gaim_signal_connect(blist_handle, "buddy-idle-changed", | |
555 plugin, GAIM_CALLBACK(buddy_idle_changed_cb), NULL); | |
556 gaim_signal_connect(blist_handle, "buddy-signed-on", | |
557 plugin, GAIM_CALLBACK(buddy_signed_on_cb), NULL); | |
558 gaim_signal_connect(blist_handle, "buddy-signed-off", | |
559 plugin, GAIM_CALLBACK(buddy_signed_off_cb), NULL); | |
560 gaim_signal_connect(blist_handle, "buddy-added", | |
561 plugin, GAIM_CALLBACK(buddy_added_cb), NULL); | |
562 gaim_signal_connect(blist_handle, "buddy-removed", | |
563 plugin, GAIM_CALLBACK(buddy_removed_cb), NULL); | |
564 gaim_signal_connect(blist_handle, "buddy-icon-changed", | |
565 plugin, GAIM_CALLBACK(buddy_icon_changed_cb), NULL); | |
566 gaim_signal_connect(blist_handle, "blist-node-aliased", | |
567 plugin, GAIM_CALLBACK(blist_node_aliased), NULL); | |
568 gaim_signal_connect(blist_handle, "blist-node-extended-menu", | |
569 plugin, GAIM_CALLBACK(blist_node_extended_menu_cb), NULL); | |
570 | |
571 /* Connection subsystem signals */ | |
572 gaim_signal_connect(conn_handle, "signing-on", | |
573 plugin, GAIM_CALLBACK(signing_on_cb), NULL); | |
574 gaim_signal_connect(conn_handle, "signed-on", | |
575 plugin, GAIM_CALLBACK(signed_on_cb), NULL); | |
576 gaim_signal_connect(conn_handle, "signing-off", | |
577 plugin, GAIM_CALLBACK(signing_off_cb), NULL); | |
578 gaim_signal_connect(conn_handle, "signed-off", | |
579 plugin, GAIM_CALLBACK(signed_off_cb), NULL); | |
580 | |
581 /* Conversations subsystem signals */ | |
582 gaim_signal_connect(conv_handle, "writing-im-msg", | |
583 plugin, GAIM_CALLBACK(writing_im_msg_cb), NULL); | |
584 gaim_signal_connect(conv_handle, "wrote-im-msg", | |
585 plugin, GAIM_CALLBACK(wrote_im_msg_cb), NULL); | |
586 gaim_signal_connect(conv_handle, "sending-im-msg", | |
587 plugin, GAIM_CALLBACK(sending_im_msg_cb), NULL); | |
588 gaim_signal_connect(conv_handle, "sent-im-msg", | |
589 plugin, GAIM_CALLBACK(sent_im_msg_cb), NULL); | |
590 gaim_signal_connect(conv_handle, "receiving-im-msg", | |
591 plugin, GAIM_CALLBACK(receiving_im_msg_cb), NULL); | |
592 gaim_signal_connect(conv_handle, "received-im-msg", | |
593 plugin, GAIM_CALLBACK(received_im_msg_cb), NULL); | |
594 gaim_signal_connect(conv_handle, "writing-chat-msg", | |
595 plugin, GAIM_CALLBACK(writing_chat_msg_cb), NULL); | |
596 gaim_signal_connect(conv_handle, "wrote-chat-msg", | |
597 plugin, GAIM_CALLBACK(wrote_chat_msg_cb), NULL); | |
598 gaim_signal_connect(conv_handle, "sending-chat-msg", | |
599 plugin, GAIM_CALLBACK(sending_chat_msg_cb), NULL); | |
600 gaim_signal_connect(conv_handle, "sent-chat-msg", | |
601 plugin, GAIM_CALLBACK(sent_chat_msg_cb), NULL); | |
602 gaim_signal_connect(conv_handle, "receiving-chat-msg", | |
603 plugin, GAIM_CALLBACK(receiving_chat_msg_cb), NULL); | |
604 gaim_signal_connect(conv_handle, "received-chat-msg", | |
605 plugin, GAIM_CALLBACK(received_chat_msg_cb), NULL); | |
606 gaim_signal_connect(conv_handle, "conversation-created", | |
607 plugin, GAIM_CALLBACK(conversation_created_cb), NULL); | |
608 gaim_signal_connect(conv_handle, "deleting-conversation", | |
609 plugin, GAIM_CALLBACK(deleting_conversation_cb), NULL); | |
610 gaim_signal_connect(conv_handle, "buddy-typing", | |
611 plugin, GAIM_CALLBACK(buddy_typing_cb), NULL); | |
612 gaim_signal_connect(conv_handle, "buddy-typing-stopped", | |
613 plugin, GAIM_CALLBACK(buddy_typing_stopped_cb), NULL); | |
614 gaim_signal_connect(conv_handle, "chat-buddy-joining", | |
615 plugin, GAIM_CALLBACK(chat_buddy_joining_cb), NULL); | |
616 gaim_signal_connect(conv_handle, "chat-buddy-joined", | |
617 plugin, GAIM_CALLBACK(chat_buddy_joined_cb), NULL); | |
618 gaim_signal_connect(conv_handle, "chat-buddy-flags", | |
619 plugin, GAIM_CALLBACK(chat_buddy_flags_cb), NULL); | |
620 gaim_signal_connect(conv_handle, "chat-buddy-leaving", | |
621 plugin, GAIM_CALLBACK(chat_buddy_leaving_cb), NULL); | |
622 gaim_signal_connect(conv_handle, "chat-buddy-left", | |
623 plugin, GAIM_CALLBACK(chat_buddy_left_cb), NULL); | |
624 gaim_signal_connect(conv_handle, "chat-inviting-user", | |
625 plugin, GAIM_CALLBACK(chat_inviting_user_cb), NULL); | |
626 gaim_signal_connect(conv_handle, "chat-invited-user", | |
627 plugin, GAIM_CALLBACK(chat_invited_user_cb), NULL); | |
628 gaim_signal_connect(conv_handle, "chat-invited", | |
629 plugin, GAIM_CALLBACK(chat_invited_cb), NULL); | |
630 gaim_signal_connect(conv_handle, "chat-joined", | |
631 plugin, GAIM_CALLBACK(chat_joined_cb), NULL); | |
632 gaim_signal_connect(conv_handle, "chat-left", | |
633 plugin, GAIM_CALLBACK(chat_left_cb), NULL); | |
634 gaim_signal_connect(conv_handle, "chat-topic-changed", | |
635 plugin, GAIM_CALLBACK(chat_topic_changed_cb), NULL); | |
636 | |
637 /* Ciphers signals */ | |
638 gaim_signal_connect(ciphers_handle, "cipher-added", | |
639 plugin, GAIM_CALLBACK(cipher_added_cb), NULL); | |
640 gaim_signal_connect(ciphers_handle, "cipher-removed", | |
641 plugin, GAIM_CALLBACK(cipher_removed_cb), NULL); | |
642 | |
643 /* Core signals */ | |
644 gaim_signal_connect(core_handle, "quitting", | |
645 plugin, GAIM_CALLBACK(quitting_cb), NULL); | |
646 | |
647 /* File transfer signals */ | |
648 gaim_signal_connect(ft_handle, "file-recv-accept", | |
649 plugin, GAIM_CALLBACK(ft_recv_accept_cb), NULL); | |
650 gaim_signal_connect(ft_handle, "file-recv-start", | |
651 plugin, GAIM_CALLBACK(ft_recv_start_cb), NULL); | |
652 gaim_signal_connect(ft_handle, "file-recv-cancel", | |
653 plugin, GAIM_CALLBACK(ft_recv_cancel_cb), NULL); | |
654 gaim_signal_connect(ft_handle, "file-recv-complete", | |
655 plugin, GAIM_CALLBACK(ft_recv_complete_cb), NULL); | |
656 gaim_signal_connect(ft_handle, "file-send-accept", | |
657 plugin, GAIM_CALLBACK(ft_send_accept_cb), NULL); | |
658 gaim_signal_connect(ft_handle, "file-send-start", | |
659 plugin, GAIM_CALLBACK(ft_send_start_cb), NULL); | |
660 gaim_signal_connect(ft_handle, "file-send-cancel", | |
661 plugin, GAIM_CALLBACK(ft_send_cancel_cb), NULL); | |
662 gaim_signal_connect(ft_handle, "file-send-complete", | |
663 plugin, GAIM_CALLBACK(ft_send_complete_cb), NULL); | |
664 | |
665 /* Sound signals */ | |
666 gaim_signal_connect(sound_handle, "playing-sound-event", plugin, | |
667 GAIM_CALLBACK(sound_playing_event_cb), NULL); | |
668 | |
669 return TRUE; | |
670 } | |
671 | |
672 static GaimPluginInfo info = | |
673 { | |
674 GAIM_PLUGIN_MAGIC, | |
675 GAIM_MAJOR_VERSION, | |
676 GAIM_MINOR_VERSION, | |
677 GAIM_PLUGIN_STANDARD, /**< type */ | |
678 NULL, /**< ui_requirement */ | |
679 0, /**< flags */ | |
680 NULL, /**< dependencies */ | |
681 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
682 | |
683 SIGNAL_TEST_PLUGIN_ID, /**< id */ | |
684 N_("Signals Test"), /**< name */ | |
685 VERSION, /**< version */ | |
686 /** summary */ | |
687 N_("Test to see that all signals are working properly."), | |
688 /** description */ | |
689 N_("Test to see that all signals are working properly."), | |
690 "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
691 GAIM_WEBSITE, /**< homepage */ | |
692 | |
693 plugin_load, /**< load */ | |
694 NULL, /**< unload */ | |
695 NULL, /**< destroy */ | |
696 | |
697 NULL, /**< ui_info */ | |
698 NULL, /**< extra_info */ | |
699 NULL, | |
700 NULL | |
701 }; | |
702 | |
703 static void | |
704 init_plugin(GaimPlugin *plugin) | |
705 { | |
706 } | |
707 | |
708 GAIM_INIT_PLUGIN(signalstest, init_plugin, info) |