Mercurial > pidgin
annotate plugins/iconaway.c @ 4580:3fef2d45dce0
[gaim-migrate @ 4861]
(12:13:17) ari: This fixes a double-free, resulting in a crash when MALLOC_CHECK_=2, and fixes a problem where when the browser is set to Manual and you click on a link, the same link then becomes corrupted
(12:14:14) ari: basically the last one was because whoever changed browser.c assumed strdelimit returned a new string
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 12 Feb 2003 17:16:16 +0000 |
parents | 62c1e5e656d0 |
children | 2427d847e39c |
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; | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
19 /* XXX G_MODULE_IMPORT GtkWidget *all_chats; */ |
3630 | 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 |
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 | 34 gtk_window_iconify(GTK_WINDOW(imaway)); |
3188 | 35 hide_buddy_list(); |
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 | 51 } |
52 | |
3630 | 53 /* |
54 * EXPORTED FUNCTIONS | |
55 */ | |
56 | |
57 G_MODULE_EXPORT char *gaim_plugin_init(GModule *h) { | |
133 | 58 handle = h; |
59 | |
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 | 63 } |
64 | |
3551 | 65 struct gaim_plugin_description desc; |
3630 | 66 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() { |
3551 | 67 desc.api_version = PLUGIN_API_VERSION; |
4113 | 68 desc.name = g_strdup(_("Iconify on away")); |
3551 | 69 desc.version = g_strdup(VERSION); |
4113 | 70 desc.description = g_strdup(_("Iconifies the away box and the buddy list when you go away.")); |
3551 | 71 desc.authors = g_strdup("Eric Warmenhoven <eric@warmenhoven.org>"); |
72 desc.url = g_strdup(WEBSITE); | |
73 return &desc; | |
74 } | |
75 | |
3630 | 76 G_MODULE_EXPORT char *name() { |
4113 | 77 return _("Iconify On Away"); |
133 | 78 } |
79 | |
3630 | 80 G_MODULE_EXPORT char *description() { |
4113 | 81 return _("Iconifies the away box and the buddy list when you go away."); |
133 | 82 } |