annotate plugins/iconaway.c @ 3408:ba6d0856c8e4

[gaim-migrate @ 3427] This should work a little bit better for everyone. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 18 Aug 2002 18:21:08 +0000
parents 49fb2b634a2a
children d33ec392a5e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2098
d37c2220e4df [gaim-migrate @ 2108]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2090
diff changeset
1 #include "../config.h"
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 #include "gaim.h"
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 #include <gdk/gdkx.h>
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 #include <X11/Xlib.h>
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 void *handle;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 extern GtkWidget *imaway;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 extern GtkWidget *blist;
1779
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
11 extern GtkWidget *all_chats;
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
12 extern GtkWidget *all_convos;
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13
147
ec301cfcaebf [gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 138
diff changeset
14 #ifdef USE_APPLET
ec301cfcaebf [gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 138
diff changeset
15 extern void applet_destroy_buddy();
ec301cfcaebf [gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 138
diff changeset
16 #endif
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17
1404
96e93119268d [gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1047
diff changeset
18 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
19 if (!imaway || !gc->away)
1406
cabde2947ba4 [gaim-migrate @ 1416]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1405
diff changeset
20 return;
1405
cf36481bbc8f [gaim-migrate @ 1415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
21 XIconifyWindow(GDK_DISPLAY(),
cf36481bbc8f [gaim-migrate @ 1415]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
22 GDK_WINDOW_XWINDOW(imaway->window),
3188
49fb2b634a2a [gaim-migrate @ 3205]
Sean Egan <seanegan@gmail.com>
parents: 2395
diff changeset
23 ((_XPrivDisplay)GDK_DISPLAY())->default_screen);
49fb2b634a2a [gaim-migrate @ 3205]
Sean Egan <seanegan@gmail.com>
parents: 2395
diff changeset
24 hide_buddy_list();
1779
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
25 if (all_convos)
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
26 XIconifyWindow(GDK_DISPLAY(),
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
27 GDK_WINDOW_XWINDOW(all_convos->window),
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
28 ((_XPrivDisplay)GDK_DISPLAY())->default_screen);
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
29 if (all_chats)
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
30 XIconifyWindow(GDK_DISPLAY(),
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
31 GDK_WINDOW_XWINDOW(all_chats->window),
0da2a831c0ae [gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1406
diff changeset
32 ((_XPrivDisplay)GDK_DISPLAY())->default_screen);
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 147
diff changeset
35 char *gaim_plugin_init(GModule *h) {
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 handle = h;
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 gaim_signal_connect(handle, event_away, iconify_windows, NULL);
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 147
diff changeset
39
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 147
diff changeset
40 return NULL;
133
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 }
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 char *name() {
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 return "Iconify On Away";
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
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 char *description() {
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48 return "Iconifies the away box and the buddy list when you go away.";
e277d5f0c1dd [gaim-migrate @ 143]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 }