Mercurial > pidgin.yaz
annotate plugins/iconaway.c @ 4358:2b8abf7f9cc1
[gaim-migrate @ 4624]
Aubin has the eyes of an Eagle, and the talons of the restaurant place
that Lana Lang runs on Smallville.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 20 Jan 2003 07:00:10 +0000 |
parents | 59751fe608c5 |
children | 5fb47ec9bfe4 |
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 | 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 | 7 #include "gaim.h" |
8 | |
3472 | 9 #include <gtk/gtk.h> |
133 | 10 |
3630 | 11 #ifdef _WIN32 |
12 #include "win32dep.h" | |
13 #endif | |
14 | |
133 | 15 void *handle; |
16 | |
3630 | 17 G_MODULE_IMPORT GtkWidget *imaway; |
18 G_MODULE_IMPORT GtkWidget *blist; | |
19 G_MODULE_IMPORT GtkWidget *all_chats; | |
20 G_MODULE_IMPORT GtkWidget *all_convos; | |
133 | 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 | 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 | 29 gtk_window_iconify(GTK_WINDOW(imaway)); |
3188 | 30 hide_buddy_list(); |
1779
0da2a831c0ae
[gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1406
diff
changeset
|
31 if (all_convos) |
3472 | 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 | 34 gtk_window_iconify(GTK_WINDOW(all_chats)); |
133 | 35 } |
36 | |
3630 | 37 /* |
38 * EXPORTED FUNCTIONS | |
39 */ | |
40 | |
41 G_MODULE_EXPORT char *gaim_plugin_init(GModule *h) { | |
133 | 42 handle = h; |
43 | |
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 | 47 } |
48 | |
3551 | 49 struct gaim_plugin_description desc; |
3630 | 50 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() { |
3551 | 51 desc.api_version = PLUGIN_API_VERSION; |
4113 | 52 desc.name = g_strdup(_("Iconify on away")); |
3551 | 53 desc.version = g_strdup(VERSION); |
4113 | 54 desc.description = g_strdup(_("Iconifies the away box and the buddy list when you go away.")); |
3551 | 55 desc.authors = g_strdup("Eric Warmenhoven <eric@warmenhoven.org>"); |
56 desc.url = g_strdup(WEBSITE); | |
57 return &desc; | |
58 } | |
59 | |
3630 | 60 G_MODULE_EXPORT char *name() { |
4113 | 61 return _("Iconify On Away"); |
133 | 62 } |
63 | |
3630 | 64 G_MODULE_EXPORT char *description() { |
4113 | 65 return _("Iconifies the away box and the buddy list when you go away."); |
133 | 66 } |