Mercurial > pidgin.yaz
annotate plugins/iconaway.c @ 1475:a15d5aaca94a
[gaim-migrate @ 1485]
I'm baaaaaaaaaaaack :-)
Time to do some crazy development, yo!
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Tue, 06 Feb 2001 17:58:17 +0000 |
parents | cabde2947ba4 |
children | 0da2a831c0ae |
rev | line source |
---|---|
133 | 1 #define GAIM_PLUGINS |
2 #include "gaim.h" | |
3 | |
4 #include <gdk/gdkx.h> | |
5 #include <X11/Xlib.h> | |
6 | |
7 void *handle; | |
8 | |
9 extern GtkWidget *imaway; | |
10 extern GtkWidget *blist; | |
11 | |
147
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
12 #ifdef USE_APPLET |
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
13 extern void applet_destroy_buddy(); |
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
14 #endif |
133 | 15 |
1404
96e93119268d
[gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
16 void iconify_windows(struct gaim_connection *gc, char *state, char *message, void *data) { |
1405
cf36481bbc8f
[gaim-migrate @ 1415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1404
diff
changeset
|
17 if (!gc->away) |
cf36481bbc8f
[gaim-migrate @ 1415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1404
diff
changeset
|
18 return; |
1406
cabde2947ba4
[gaim-migrate @ 1416]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1405
diff
changeset
|
19 if (!imaway) |
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), |
cf36481bbc8f
[gaim-migrate @ 1415]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1404
diff
changeset
|
23 ((_XPrivDisplay)GDK_DISPLAY())->default_screen); |
133 | 24 #ifdef USE_APPLET |
138
e8ea1e2fdf0c
[gaim-migrate @ 148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
133
diff
changeset
|
25 applet_destroy_buddy(); |
133 | 26 #else |
27 XIconifyWindow(GDK_DISPLAY(), | |
28 GDK_WINDOW_XWINDOW(blist->window), | |
29 ((_XPrivDisplay)GDK_DISPLAY())->default_screen); | |
30 #endif | |
31 } | |
32 | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
147
diff
changeset
|
33 char *gaim_plugin_init(GModule *h) { |
133 | 34 handle = h; |
35 | |
36 gaim_signal_connect(handle, event_away, iconify_windows, NULL); | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
147
diff
changeset
|
37 |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
147
diff
changeset
|
38 return NULL; |
133 | 39 } |
40 | |
41 char *name() { | |
42 return "Iconify On Away"; | |
43 } | |
44 | |
45 char *description() { | |
46 return "Iconifies the away box and the buddy list when you go away."; | |
47 } |