Mercurial > pidgin
annotate plugins/SIGNALS @ 319:cea40691706c
[gaim-migrate @ 329]
A few good oscar changes before release.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 02 Jun 2000 19:45:16 +0000 |
parents | 4e91b92f91a7 |
children | be408b41c172 |
rev | line source |
---|---|
93 | 1 enum gaim_event { |
2 event_signon = 0, | |
3 event_signoff, | |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
4 event_away, |
136
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
5 event_back, |
93 | 6 event_im_recv, |
7 event_im_send, | |
8 event_buddy_signon, | |
9 event_buddy_signoff, | |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
10 event_buddy_away, |
136
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
11 event_buddy_back, |
116 | 12 event_blist_update |
93 | 13 }; |
14 | |
15 To add a signal handler, call the fuction gaim_signal_connect with the | |
16 following arguments: | |
17 | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
18 void *, enum gaim_event, void *, void * |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
19 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
20 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
|
21 save it, right? |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
22 The second arg is hopefully obvious. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
23 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
|
24 depending on which event you're dealing with. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
25 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
|
26 argument. |
93 | 27 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
28 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
|
29 following arguments: |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
30 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
31 void *, enum gaim_event, void * |
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 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
|
34 The second arg is hopefully obvious. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
35 The third arg is a pointer to the function you attached. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
36 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
37 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
|
38 one. Sorry, that's just the way it works. |
93 | 39 |
40 So here are the args that get passed to your functions in various events: | |
41 | |
42 event_signon: | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
43 (none) |
93 | 44 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
45 Note that you can get the username (which would probably be the only |
136
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
46 useful information here) from other places. (Read gaim.h for details.) |
93 | 47 |
48 event_signoff: | |
49 (none) | |
50 | |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
51 event_away: |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
52 (none) |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
53 |
136
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
54 Note that the away message that's being used can be retrieved from a |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
55 global variable. (Read gaim.h for details.) |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
56 |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
57 event_back: |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
58 (none) |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
59 |
93 | 60 event_im_recv: |
61 char **who, char **text | |
62 | |
63 'who' is the username of the person who sent the message. | |
64 'text' is the actual strict text (with HTML tags and all) of the | |
65 message they sent. | |
66 | |
67 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
|
68 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
|
69 check that they are not NULL, and try not to leave them as NULL. |
93 | 70 |
71 event_im_send: | |
103
c5a1a1b05c26
[gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
72 char *who, char **text |
93 | 73 |
74 'who' is the username of the person you're sending the message to. | |
75 'text' is the actual strict text (with HTML tags and all) of the | |
76 message you're sending. | |
77 | |
103
c5a1a1b05c26
[gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
78 Note that you can modify outgoing text. (You are _not_ encouraged to |
93 | 79 do so ;-) .) |
80 | |
81 event_buddy_signon: | |
82 char *who | |
83 | |
84 'who' is who signed on. | |
85 | |
86 event_buddy_signoff: | |
87 char *who | |
88 | |
89 'who' is who signed off. | |
116 | 90 |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
91 event_buddy_away: |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
92 char *who |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
93 |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
94 'who' is who went away. |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
95 |
136
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
96 event_buddy_back: |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
97 char *who |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
98 |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
99 'who' is who is no longer away. |
4e91b92f91a7
[gaim-migrate @ 146]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
100 |
116 | 101 event_blist_update: |
102 (none) | |
103 | |
117
395a8593918f
[gaim-migrate @ 127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
116
diff
changeset
|
104 This event is called when the buddylist is updated (automatically every |
395a8593918f
[gaim-migrate @ 127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
116
diff
changeset
|
105 20 seconds) |