Mercurial > pidgin.yaz
annotate plugins/SIGNALS @ 133:e277d5f0c1dd
[gaim-migrate @ 143]
Let's see if I can remember everything I did:
- Fixed a bug I let slip. If you choose the new option to not play
login sounds when you log in, and then quit before the timeout is
up, it would save that you didn't want login sounds at all.
- Added two new plugin events: event_away and event_buddy_away.
- Made GtkWidget *imaway in away.c and void play(uchar *, int) in
sound.c not static any more (though not referenced in gaim.h).
This is so plugins can use those (and not have to worry about
writing their own sound code).
- Wrote a quick plugin to auto-iconify windows when you go away. I
had just been locally patching my own copy, since I figured it wasn't
worth including as an option. It also demonstrates some of the issues
of deciding between USE_APPLET and not. Perhaps plugins are the way
to go with some things that would otherwise have been options (for
example, the Lag-O-Meter is one of those things that could possibly
have been a plugin instead of hard-coded in).
I think that's everything.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 19 Apr 2000 02:04:30 +0000 |
parents | 395a8593918f |
children | 4e91b92f91a7 |
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, |
93 | 5 event_im_recv, |
6 event_im_send, | |
7 event_buddy_signon, | |
8 event_buddy_signoff, | |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
9 event_buddy_away, |
116 | 10 event_blist_update |
93 | 11 }; |
12 | |
13 To add a signal handler, call the fuction gaim_signal_connect with the | |
14 following arguments: | |
15 | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
16 void *, enum gaim_event, void *, void * |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
17 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
18 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
|
19 save it, right? |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
20 The second arg is hopefully obvious. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
21 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
|
22 depending on which event you're dealing with. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
23 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
|
24 argument. |
93 | 25 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
26 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
|
27 following arguments: |
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 void *, enum gaim_event, void * |
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 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
|
32 The second arg is hopefully obvious. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
33 The third arg is a pointer to the function you attached. |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
34 |
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
35 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
|
36 one. Sorry, that's just the way it works. |
93 | 37 |
38 So here are the args that get passed to your functions in various events: | |
39 | |
40 event_signon: | |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
41 (none) |
93 | 42 |
94
9f6ce50ffb78
[gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
93
diff
changeset
|
43 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
|
44 useful information here) from other places. (Read gaim.h for details). |
93 | 45 |
46 event_signoff: | |
47 (none) | |
48 | |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
49 event_away: |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
50 (none) |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
51 |
93 | 52 event_im_recv: |
53 char **who, char **text | |
54 | |
55 'who' is the username of the person who sent the message. | |
56 'text' is the actual strict text (with HTML tags and all) of the | |
57 message they sent. | |
58 | |
59 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
|
60 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
|
61 check that they are not NULL, and try not to leave them as NULL. |
93 | 62 |
63 event_im_send: | |
103
c5a1a1b05c26
[gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
64 char *who, char **text |
93 | 65 |
66 'who' is the username of the person you're sending the message to. | |
67 'text' is the actual strict text (with HTML tags and all) of the | |
68 message you're sending. | |
69 | |
103
c5a1a1b05c26
[gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
94
diff
changeset
|
70 Note that you can modify outgoing text. (You are _not_ encouraged to |
93 | 71 do so ;-) .) |
72 | |
73 event_buddy_signon: | |
74 char *who | |
75 | |
76 'who' is who signed on. | |
77 | |
78 event_buddy_signoff: | |
79 char *who | |
80 | |
81 'who' is who signed off. | |
116 | 82 |
133
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
83 event_buddy_away: |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
84 char *who |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
85 |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
86 'who' is who went away. |
e277d5f0c1dd
[gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
117
diff
changeset
|
87 |
116 | 88 event_blist_update: |
89 (none) | |
90 | |
117
395a8593918f
[gaim-migrate @ 127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
116
diff
changeset
|
91 This event is called when the buddylist is updated (automatically every |
395a8593918f
[gaim-migrate @ 127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
116
diff
changeset
|
92 20 seconds) |