Mercurial > pidgin.yaz
annotate plugins/SIGNALS @ 116:8c982b7f18d4
[gaim-migrate @ 126]
Hmm
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Fri, 14 Apr 2000 08:36:36 +0000 |
parents | c5a1a1b05c26 |
children | 395a8593918f |
rev | line source |
---|---|
93 | 1 enum gaim_event { |
2 event_signon = 0, | |
3 event_signoff, | |
4 event_im_recv, | |
5 event_im_send, | |
6 event_buddy_signon, | |
7 event_buddy_signoff, | |
116 | 8 event_blist_update |
93 | 9 }; |
10 | |
11 To add a signal handler, call the fuction gaim_signal_connect with the | |
12 following arguments: | |
13 | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
14 void *, enum gaim_event, void *, void * |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
15 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
16 The first arg is the handle that was passed to gaim_signal_init. You did |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
17 save it, right? |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
18 The second arg is hopefully obvious. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
19 The third arg is a pointer to a function that takes various args |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
20 depending on which event you're dealing with. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
21 The fourth arg is any data you want to send to your function, as a final |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
22 argument. |
93 | 23 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
24 To remove a signal handler, call the function gaim_signal_disconnect with the |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
25 following arguments: |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
26 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
27 void *, enum gaim_event, void * |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
28 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
29 The first arg is the handle that was passed to gaim_signal_init. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
30 The second arg is hopefully obvious. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
31 The third arg is a pointer to the function you attached. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
32 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
33 Note that it deletes *all* functions matching the function you pass, not just |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
34 one. Sorry, that's just the way it works. |
93 | 35 |
36 So here are the args that get passed to your functions in various events: | |
37 | |
38 event_signon: | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
39 (none) |
93 | 40 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
41 Note that you can get the username (which would probably be the only |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
42 useful information here) from other places. (Read gaim.h for details). |
93 | 43 |
44 event_signoff: | |
45 (none) | |
46 | |
47 event_im_recv: | |
48 char **who, char **text | |
49 | |
50 'who' is the username of the person who sent the message. | |
51 'text' is the actual strict text (with HTML tags and all) of the | |
52 message they sent. | |
53 | |
54 Note that you can modify these values. (You are encouraged to do so!) | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
55 Note that *other* plugins can also modify these values, so you should |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
56 check that they are not NULL, and try not to leave them as NULL. |
93 | 57 |
58 event_im_send: | |
103
c5a1a1b05c26
[gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
59 char *who, char **text |
93 | 60 |
61 'who' is the username of the person you're sending the message to. | |
62 'text' is the actual strict text (with HTML tags and all) of the | |
63 message you're sending. | |
64 | |
103
c5a1a1b05c26
[gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
65 Note that you can modify outgoing text. (You are _not_ encouraged to |
93 | 66 do so ;-) .) |
67 | |
68 event_buddy_signon: | |
69 char *who | |
70 | |
71 'who' is who signed on. | |
72 | |
73 event_buddy_signoff: | |
74 char *who | |
75 | |
76 'who' is who signed off. | |
116 | 77 |
78 event_blist_update: | |
79 (none) | |
80 | |
81 This event is called when the buddylist is updated (automatically every 20 seconds) | |
82 |