annotate plugins/iconaway.c @ 5165:f55f87a82311

[gaim-migrate @ 5529] jsi doesn't think the redundancy is needed with modern-day compilers. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 18 Apr 2003 15:29:15 +0000
parents 0b1c01fd68f1
children fefad67de2c7
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;
4726
0b1c01fd68f1 [gaim-migrate @ 5039]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4585
diff changeset
18 /*G_MODULE_IMPORT GtkWidget *blist;*/
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
19 /* XXX G_MODULE_IMPORT GtkWidget *all_chats; */
4726
0b1c01fd68f1 [gaim-migrate @ 5039]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4585
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
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
26 void iconify_windows(struct gaim_connection *gc, char *state,
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
27 char *message, void *data) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
28 struct gaim_window *win;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
29 GList *windows;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
30
2395
c014fd611443 [gaim-migrate @ 2408]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2098
diff changeset
31 if (!imaway || !gc->away)
1406
cabde2947ba4 [gaim-migrate @ 1416]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1405
diff changeset
32 return;
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
33
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3188
diff changeset
34 gtk_window_iconify(GTK_WINDOW(imaway));
4726
0b1c01fd68f1 [gaim-migrate @ 5039]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4585
diff changeset
35 gaim_blist_set_visible(FALSE);
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
36
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
37 for (windows = gaim_get_windows();
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
38 windows != NULL;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
39 windows = windows->next) {
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
40
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
41 win = (struct gaim_window *)windows->data;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
42
4476
62c1e5e656d0 [gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents: 4468
diff changeset
43 if (GAIM_IS_GTK_WINDOW(win)) {
4359
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
44 struct gaim_gtk_window *gtkwin;
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
45
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
46 gtkwin = GAIM_GTK_WINDOW(win);
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
47
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
48 gtk_window_iconify(GTK_WINDOW(gtkwin->window));
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
49 }
5fb47ec9bfe4 [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4202
diff changeset
50 }
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
53 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
54 * EXPORTED FUNCTIONS
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
55 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
56
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
57 G_MODULE_EXPORT char *gaim_plugin_init(GModule *h) {
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 handle = h;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 gaim_signal_connect(handle, event_away, iconify_windows, NULL);
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 147
diff changeset
61
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 147
diff changeset
62 return NULL;
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
65 struct gaim_plugin_description desc;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
66 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() {
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
67 desc.api_version = PLUGIN_API_VERSION;
4113
74d27aa5b686 [gaim-migrate @ 4329]
Luke Schierer <lschiere@pidgin.im>
parents: 3630
diff changeset
68 desc.name = g_strdup(_("Iconify on away"));
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
69 desc.version = g_strdup(VERSION);
4113
74d27aa5b686 [gaim-migrate @ 4329]
Luke Schierer <lschiere@pidgin.im>
parents: 3630
diff changeset
70 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
71 desc.authors = g_strdup("Eric Warmenhoven &lt;eric@warmenhoven.org>");
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
72 desc.url = g_strdup(WEBSITE);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
73 return &desc;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
74 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
75
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
76 G_MODULE_EXPORT char *name() {
4585
2427d847e39c [gaim-migrate @ 4869]
Luke Schierer <lschiere@pidgin.im>
parents: 4476
diff changeset
77 return _("Iconify on away");
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
80 G_MODULE_EXPORT char *description() {
4113
74d27aa5b686 [gaim-migrate @ 4329]
Luke Schierer <lschiere@pidgin.im>
parents: 3630
diff changeset
81 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
82 }