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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
93
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 enum gaim_event {
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 event_signon = 0,
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 event_signoff,
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 117
diff changeset
4 event_away,
93
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 event_im_recv,
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 event_im_send,
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 event_buddy_signon,
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 event_buddy_signoff,
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 117
diff changeset
9 event_buddy_away,
116
8c982b7f18d4 [gaim-migrate @ 126]
Rob Flynn <gaim@robflynn.com>
parents: 103
diff changeset
10 event_blist_update
93
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 };
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 To add a signal handler, call the fuction gaim_signal_connect with the
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 following arguments:
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 So here are the args that get passed to your functions in various events:
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 event_signon:
94
9f6ce50ffb78 [gaim-migrate @ 104]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 93
diff changeset
41 (none)
93
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 event_signoff:
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 (none)
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 event_im_recv:
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 char **who, char **text
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 'who' is the username of the person who sent the message.
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 'text' is the actual strict text (with HTML tags and all) of the
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 message they sent.
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 event_im_send:
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 94
diff changeset
64 char *who, char **text
93
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 'who' is the username of the person you're sending the message to.
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 'text' is the actual strict text (with HTML tags and all) of the
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68 message you're sending.
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 do so ;-) .)
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73 event_buddy_signon:
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 char *who
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 'who' is who signed on.
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 event_buddy_signoff:
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 char *who
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80
5ca21b68eb29 [gaim-migrate @ 103]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 'who' is who signed off.
116
8c982b7f18d4 [gaim-migrate @ 126]
Rob Flynn <gaim@robflynn.com>
parents: 103
diff changeset
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
8c982b7f18d4 [gaim-migrate @ 126]
Rob Flynn <gaim@robflynn.com>
parents: 103
diff changeset
88 event_blist_update:
8c982b7f18d4 [gaim-migrate @ 126]
Rob Flynn <gaim@robflynn.com>
parents: 103
diff changeset
89 (none)
8c982b7f18d4 [gaim-migrate @ 126]
Rob Flynn <gaim@robflynn.com>
parents: 103
diff changeset
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)