annotate plugins/iconaway.c @ 6378:01289157fc37

[gaim-migrate @ 6883] This solves the problem of 50 billion dialogs on your screen and server requests to re-authorize or re-deny everybody on every privacy list in your protocol. "Oops." committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 05 Aug 2003 18:59:57 +0000
parents 8f94cce8faa5
children 70d5122bc3ff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6063
diff changeset
1 #include "gtkinternal.h"
5872
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
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
a747e9e0e2cf [gaim-migrate @ 6349]
Mark Doliner <mark@kingant.net>
parents: 5912
diff changeset
12 #else
a747e9e0e2cf [gaim-migrate @ 6349]
Mark Doliner <mark@kingant.net>
parents: 5912
diff changeset
13 G_MODULE_IMPORT GtkWidget *imaway;
5912
b3c412884a22 [gaim-migrate @ 6344]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5873
diff changeset
14 #endif
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3188
diff changeset
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
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
47 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
48 * EXPORTED FUNCTIONS
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
49 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3564
diff changeset
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
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4726
diff changeset
56 return TRUE;
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
8b24e4d1e082 [gaim-migrate @ 6002]
Luke Schierer <lschiere@pidgin.im>
parents: 5587
diff changeset
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
8b24e4d1e082 [gaim-migrate @ 6002]
Luke Schierer <lschiere@pidgin.im>
parents: 5587
diff changeset
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 */
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6063
diff changeset
81 GAIM_WEBSITE, /**< homepage */
5205
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
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 5920
diff changeset
96 GAIM_INIT_PLUGIN(iconaway, init_plugin, info)