annotate plugins/iconaway.c @ 4204:dac73d754f6a

[gaim-migrate @ 4440] Shush. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 05 Jan 2003 07:10:44 +0000
parents 59751fe608c5
children 5fb47ec9bfe4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4202
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4113
diff changeset
1 #include "config.h"
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4113
diff changeset
2
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4113
diff changeset
3 #ifndef GAIM_PLUGINS
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
4 #define GAIM_PLUGINS
4202
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4113
diff changeset
5 #endif
59751fe608c5 [gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents: 4113
diff changeset
6
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 #include "gaim.h"
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3188
diff changeset
9 #include <gtk/gtk.h>
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
11 #ifdef _WIN32
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
12 #include "win32dep.h"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
13 #endif
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
14
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 void *handle;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
17 G_MODULE_IMPORT GtkWidget *imaway;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
18 G_MODULE_IMPORT GtkWidget *blist;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
19 G_MODULE_IMPORT GtkWidget *all_chats;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
20 G_MODULE_IMPORT GtkWidget *all_convos;
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21
147
ec301cfcaebf [gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 138
diff changeset
22 #ifdef USE_APPLET
ec301cfcaebf [gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 138
diff changeset
23 extern void applet_destroy_buddy();
ec301cfcaebf [gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 138
diff changeset
24 #endif
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25
1404
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
26 void iconify_windows(struct gaim_connection *gc, char *state, char *message, void *data) {
2395
c014fd611443 [gaim-migrate @ 2408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2098
diff changeset
27 if (!imaway || !gc->away)
1406
cabde2947ba4 [gaim-migrate @ 1416]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1405
diff changeset
28 return;
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3188
diff changeset
29 gtk_window_iconify(GTK_WINDOW(imaway));
3188
49fb2b634a2a [gaim-migrate @ 3205]
Sean Egan <seanegan@gmail.com>
parents: 2395
diff changeset
30 hide_buddy_list();
1779
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
31 if (all_convos)
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3188
diff changeset
32 gtk_window_iconify(GTK_WINDOW(all_convos));
1779
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
33 if (all_chats)
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3188
diff changeset
34 gtk_window_iconify(GTK_WINDOW(all_chats));
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
37 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
38 * EXPORTED FUNCTIONS
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
39 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
40
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
41 G_MODULE_EXPORT char *gaim_plugin_init(GModule *h) {
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 handle = h;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 gaim_signal_connect(handle, event_away, iconify_windows, NULL);
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 147
diff changeset
45
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 147
diff changeset
46 return NULL;
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
49 struct gaim_plugin_description desc;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
50 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() {
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
51 desc.api_version = PLUGIN_API_VERSION;
4113
74d27aa5b686 [gaim-migrate @ 4329]
Luke Schierer <lschiere@pidgin.im>
parents: 3630
diff changeset
52 desc.name = g_strdup(_("Iconify on away"));
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
53 desc.version = g_strdup(VERSION);
4113
74d27aa5b686 [gaim-migrate @ 4329]
Luke Schierer <lschiere@pidgin.im>
parents: 3630
diff changeset
54 desc.description = g_strdup(_("Iconifies the away box and the buddy list when you go away."));
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
55 desc.authors = g_strdup("Eric Warmenhoven &lt;eric@warmenhoven.org>");
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
56 desc.url = g_strdup(WEBSITE);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
57 return &desc;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
58 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
59
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
60 G_MODULE_EXPORT char *name() {
4113
74d27aa5b686 [gaim-migrate @ 4329]
Luke Schierer <lschiere@pidgin.im>
parents: 3630
diff changeset
61 return _("Iconify On Away");
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
64 G_MODULE_EXPORT char *description() {
4113
74d27aa5b686 [gaim-migrate @ 4329]
Luke Schierer <lschiere@pidgin.im>
parents: 3630
diff changeset
65 return _("Iconifies the away box and the buddy list when you go away.");
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66 }