comparison plugins/iconaway.c @ 133:e277d5f0c1dd

[gaim-migrate @ 143] Let's see if I can remember everything I did: - Fixed a bug I let slip. If you choose the new option to not play login sounds when you log in, and then quit before the timeout is up, it would save that you didn't want login sounds at all. - Added two new plugin events: event_away and event_buddy_away. - Made GtkWidget *imaway in away.c and void play(uchar *, int) in sound.c not static any more (though not referenced in gaim.h). This is so plugins can use those (and not have to worry about writing their own sound code). - Wrote a quick plugin to auto-iconify windows when you go away. I had just been locally patching my own copy, since I figured it wasn't worth including as an option. It also demonstrates some of the issues of deciding between USE_APPLET and not. Perhaps plugins are the way to go with some things that would otherwise have been options (for example, the Lag-O-Meter is one of those things that could possibly have been a plugin instead of hard-coded in). I think that's everything. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 19 Apr 2000 02:04:30 +0000
parents
children e8ea1e2fdf0c
comparison
equal deleted inserted replaced
132:f12425e6660d 133:e277d5f0c1dd
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
12 extern void set_applet_draw_closed();
13
14 void iconify_windows(void *data) {
15 XIconifyWindow(GDK_DISPLAY(),
16 GDK_WINDOW_XWINDOW(imaway->window),
17 ((_XPrivDisplay)GDK_DISPLAY())->default_screen);
18 #ifdef USE_APPLET
19 gnome_buddy_hide();
20 set_applet_draw_closed();
21 #else
22 XIconifyWindow(GDK_DISPLAY(),
23 GDK_WINDOW_XWINDOW(blist->window),
24 ((_XPrivDisplay)GDK_DISPLAY())->default_screen);
25 #endif
26 }
27
28 void gaim_plugin_init(void *h) {
29 handle = h;
30
31 gaim_signal_connect(handle, event_away, iconify_windows, NULL);
32 }
33
34 char *name() {
35 return "Iconify On Away";
36 }
37
38 char *description() {
39 return "Iconifies the away box and the buddy list when you go away.";
40 }