/* $Id: Pan.c,v 1.1 1997/04/22 13:22:34 archer Exp $
 *	PAN.C - Scrolls a window contents
 *
 */
#include <Widget/WidgetsP.h>
#include <Widget/panP.h>


/**
 ** Private variables
 **/
static GC	pan_gc;


/**
 ** X11_PAN_WINDOW
 **	Scrolls a window, using the pan_gc
 **/
void x11__pan_window(X11_widget wdg, int delta_x, int delta_y)
{
/*
 * Make sure we have a widget
 */
#if 0
	if (!pan_gc)
		pan_gc = x11__widget_gc(wdg);
	if (delta_x) {
		if (delta_x < 0) {
		}
		return;
	}
	if (delta_y) {
		return;
	}
#endif
/*** HACK ***/
	if (wdg->id)
		XClearArea(x11__screen, wdg->id, 0, 0, 0, 0, True);
}
#if 0
XEvent	fake;
int	to_clr, to_copy;
int	w, h;
	old   = W_LIST->delta;
	if (delta > old) {
		to_clr  = delta - old;
		if (to_clr > wdg->h)
			to_clr = wdg->h;
		to_copy = wdg->h - to_clr;
		if (to_copy > 0)
			XCopyArea(x11__screen, wdg->id,wdg->id, x11__default_gc,
					0, to_clr, wdg->w, to_copy, 0, 0);
		W_LIST->delta = delta;
		fake.xexpose.y      = to_copy;
		fake.xexpose.height = to_clr;
		if (!wdg->unmapped)
			(*wdg->on_expose)(wdg, &fake);
	} else
		if (delta < old) {
			XClearArea(x11__screen, wdg->id, 0, 0, 0, 0, False);
			W_LIST->delta       = delta;
			fake.xexpose.y      = 0;
			fake.xexpose.height = wdg->h - wdg->border2;
			if (!wdg->unmapped)
				(*wdg->on_expose)(wdg, &fake);
		}
#endif
