plugins/iconaway.c

Sat, 27 Apr 2002 19:41:07 +0000

author
Robert McQueen <robot101@debian.org>
date
Sat, 27 Apr 2002 19:41:07 +0000
changeset 3188
a71bad9ff940
parent 2395
a8dcd0aec51a
child 3472
3939deb42c1e
permissions
-rw-r--r--

[gaim-migrate @ 3205]
The Robot101 commit.

A toc fix (don't use toc) and the possibility to compile iconaway.c on an
applet and use it on the standalone app.

committer: Sean Egan <seanegan@pidgin.im>

#include "../config.h"
#include "gaim.h"

#include <gdk/gdkx.h>
#include <X11/Xlib.h>

void *handle;

extern GtkWidget *imaway;
extern GtkWidget *blist;
extern GtkWidget *all_chats;
extern GtkWidget *all_convos;

#ifdef USE_APPLET
extern void applet_destroy_buddy();
#endif

void iconify_windows(struct gaim_connection *gc, char *state, char *message, void *data) {
	if (!imaway || !gc->away)
		return;
	XIconifyWindow(GDK_DISPLAY(),
			GDK_WINDOW_XWINDOW(imaway->window),
		       ((_XPrivDisplay)GDK_DISPLAY())->default_screen);
	hide_buddy_list();
	if (all_convos)
		XIconifyWindow(GDK_DISPLAY(),
				GDK_WINDOW_XWINDOW(all_convos->window),
				((_XPrivDisplay)GDK_DISPLAY())->default_screen);
	if (all_chats)
		XIconifyWindow(GDK_DISPLAY(),
				GDK_WINDOW_XWINDOW(all_chats->window),
				((_XPrivDisplay)GDK_DISPLAY())->default_screen);
}

char *gaim_plugin_init(GModule *h) {
	handle = h;

	gaim_signal_connect(handle, event_away, iconify_windows, NULL);

	return NULL;
}

char *name() {
	return "Iconify On Away";
}

char *description() {
	return "Iconifies the away box and the buddy list when you go away.";
}

mercurial