Mercurial > pidgin
annotate plugins/SIGNALS @ 106:e05e6373ea5a
[gaim-migrate @ 116]
Modified spellchk.c so now it uses a more customizable dictionary and added
filectl.c to allow remote-control of gaim.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 12 Apr 2000 06:51:37 +0000 |
parents | c5a1a1b05c26 |
children | 8c982b7f18d4 |
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, | |
8 }; | |
9 | |
10 To add a signal handler, call the fuction gaim_signal_connect with the | |
11 following arguments: | |
12 | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
13 void *, enum gaim_event, void *, void * |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
14 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
15 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
|
16 save it, right? |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
17 The second arg is hopefully obvious. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
18 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
|
19 depending on which event you're dealing with. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
20 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
|
21 argument. |
93 | 22 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
23 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
|
24 following arguments: |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
25 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
26 void *, enum gaim_event, void * |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
27 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
28 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
|
29 The second arg is hopefully obvious. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
30 The third arg is a pointer to the function you attached. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
31 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
32 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
|
33 one. Sorry, that's just the way it works. |
93 | 34 |
35 So here are the args that get passed to your functions in various events: | |
36 | |
37 event_signon: | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
38 (none) |
93 | 39 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
40 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
|
41 useful information here) from other places. (Read gaim.h for details). |
93 | 42 |
43 event_signoff: | |
44 (none) | |
45 | |
46 event_im_recv: | |
47 char **who, char **text | |
48 | |
49 'who' is the username of the person who sent the message. | |
50 'text' is the actual strict text (with HTML tags and all) of the | |
51 message they sent. | |
52 | |
53 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
|
54 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
|
55 check that they are not NULL, and try not to leave them as NULL. |
93 | 56 |
57 event_im_send: | |
103
c5a1a1b05c26
[gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
58 char *who, char **text |
93 | 59 |
60 'who' is the username of the person you're sending the message to. | |
61 'text' is the actual strict text (with HTML tags and all) of the | |
62 message you're sending. | |
63 | |
103
c5a1a1b05c26
[gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
64 Note that you can modify outgoing text. (You are _not_ encouraged to |
93 | 65 do so ;-) .) |
66 | |
67 event_buddy_signon: | |
68 char *who | |
69 | |
70 'who' is who signed on. | |
71 | |
72 event_buddy_signoff: | |
73 char *who | |
74 | |
75 'who' is who signed off. |