Mercurial > pidgin
annotate plugins/iconaway.c @ 5992:50624f0d2a25
[gaim-migrate @ 6440]
Mauricio de Lemos Rodrigues Collares Neto added a Portuguese (Brazilian) translation, but i cannot check
that it compiles correctly because gettext 0.12.1 is broken!!! fortunately, it seems my bug report is
being looked at and 0.12.2 might be fixed, whenever that is released.
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 02 Jul 2003 15:23:23 +0000 |
parents | 7d385de2f9cd |
children | 5239a3b4ab33 |
rev | line source |
---|---|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1 #include "internal.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
2 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
3 #include "conversation.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
4 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
5 #include "gtkconv.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
6 #include "gtkplugin.h" |
4202
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4113
diff
changeset
|
7 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
8 #define ICONAWAY_PLUGIN_ID "gtk-iconaway" |
133 | 9 |
5912
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5873
diff
changeset
|
10 #ifdef _WIN32 |
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5873
diff
changeset
|
11 __declspec(dllimport) GtkWidget *imaway; |
5917 | 12 #else |
13 G_MODULE_IMPORT GtkWidget *imaway; | |
5912
b3c412884a22
[gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5873
diff
changeset
|
14 #endif |
133 | 15 |
147
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
16 #ifdef USE_APPLET |
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
17 extern void applet_destroy_buddy(); |
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
18 #endif |
133 | 19 |
5587
1c55b1540e18
[gaim-migrate @ 5991]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
20 void iconify_windows(GaimConnection *gc, char *state, |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
21 char *message, void *data) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5598
diff
changeset
|
22 GaimWindow *win; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
23 GList *windows; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
24 |
2395
c014fd611443
[gaim-migrate @ 2408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2098
diff
changeset
|
25 if (!imaway || !gc->away) |
1406
cabde2947ba4
[gaim-migrate @ 1416]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1405
diff
changeset
|
26 return; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
27 |
3472 | 28 gtk_window_iconify(GTK_WINDOW(imaway)); |
4726
0b1c01fd68f1
[gaim-migrate @ 5039]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4585
diff
changeset
|
29 gaim_blist_set_visible(FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
30 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
31 for (windows = gaim_get_windows(); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
32 windows != NULL; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
33 windows = windows->next) { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
34 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5598
diff
changeset
|
35 win = (GaimWindow *)windows->data; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
36 |
4476
62c1e5e656d0
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4468
diff
changeset
|
37 if (GAIM_IS_GTK_WINDOW(win)) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5598
diff
changeset
|
38 GaimGtkWindow *gtkwin; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
39 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
40 gtkwin = GAIM_GTK_WINDOW(win); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
41 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
42 gtk_window_iconify(GTK_WINDOW(gtkwin->window)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
43 } |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
44 } |
133 | 45 } |
46 | |
3630 | 47 /* |
48 * EXPORTED FUNCTIONS | |
49 */ | |
50 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
51 static gboolean |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
52 plugin_load(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
53 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
54 gaim_signal_connect(plugin, event_away, iconify_windows, NULL); |
133 | 55 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
56 return TRUE; |
133 | 57 } |
58 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
59 static GaimGtkPluginUiInfo ui_info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
60 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
61 NULL /**< get_config_frame */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
62 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
63 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
64 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
65 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
66 2, /**< api_version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
67 GAIM_PLUGIN_STANDARD, /**< type */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
68 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
69 0, /**< flags */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
70 NULL, /**< dependencies */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
71 GAIM_PRIORITY_DEFAULT, /**< priority */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
72 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
73 ICONAWAY_PLUGIN_ID, /**< id */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
74 N_("Iconify on Away"), /**< name */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
75 VERSION, /**< version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
76 /** summary */ |
5598 | 77 N_("Iconifies the buddy list and your conversations when you go away."), |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
78 /** description */ |
5598 | 79 N_("Iconifies the buddy list and your conversations when you go away."), |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
80 "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
81 WEBSITE, /**< homepage */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
82 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
83 plugin_load, /**< load */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
84 NULL, /**< unload */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
85 NULL, /**< destroy */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
86 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
87 &ui_info, /**< ui_info */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
88 NULL /**< extra_info */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
89 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
90 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
91 static void |
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5917
diff
changeset
|
92 init_plugin(GaimPlugin *plugin) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4726
diff
changeset
|
93 { |
133 | 94 } |
95 | |
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5917
diff
changeset
|
96 GAIM_INIT_PLUGIN(iconaway, init_plugin, info); |