Mercurial > pidgin
annotate plugins/SIGNALS @ 94:9f6ce50ffb78
[gaim-migrate @ 104]
Woohoo, the landing of the plugins. Nearly everything necessary is here. The
only thing missing is that you can't load a plugin without signing on first
(at least, not without some trickery).
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Sun, 09 Apr 2000 11:18:25 +0000 |
| parents | 5ca21b68eb29 |
| children | c5a1a1b05c26 |
| 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: | |
| 58 char **who, char **text | |
| 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 | |
| 64 Note that you can modify these values. (You are _not_ encouraged to | |
| 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. |
