/********************************************************************
 ** WINDOWS OVER THE NETWORK PRLIM TEST (NOT MEANT TO BE USEFUL YET)
 **
 ** (c) Spak, Darrell Tam, c9107253@firebird.newcastle.edu.au (1994)
 ** phone (Australia) 049-829-710
 **                    49-829-710
 ** (c) SST 1994
 **
 ** SOME GFX ROUTINES
 **
 ** TABS to 4
 ********************************************************************/


#include "/snd/everything.h"
#include "/snd/gfxthings_protos.h"
#include <st/st_proto.h>
#include <st/gadsetup.h>

/********************************************************************/
		void ScrollWindowUp(struct Window *wdw)
/********************************************************************/
{
	SetWrMsk(wdw->RPort, 0x1);
	ScrollRaster(wdw->RPort, 0, 8,
					wdw->BorderLeft,
					wdw->BorderTop,
					wdw->Width-wdw->BorderRight-1,
					wdw->Height-wdw->BorderBottom-1);

}

/********************************************************************/
			void MyPrint(struct Window *wdw, char *str)
/********************************************************************/
{
struct RastPort *rp = wdw->RPort;
	ScrollWindowUp(wdw);
	Move(rp, 4, wdw->Height-wdw->BorderBottom-3);
	SetAPen(rp, 1);
	SetBPen(rp, 0);
	SetDrMd(rp, JAM2);
	Text(rp, str, strlen(str));
}

/** STUFF FOR THE FIRST WINDOW */
struct	Window *win1;
struct  HoldGadget win1gadhold;
UWORD win1cols[32] = {
	0x530,0x100,0xa85,0xf88
};


/** COLOURS WHICH ARE SAVED */
UWORD savecols[32] = {
	0x345,0xfff,0x122,0xabc
};


/********************************************************************/
					void CloseGfx(void)
/********************************************************************/
{
	if(win1) {
		FlushWindowInput(win1);
		CloseWindow(win1);
		win1 = NULL;
	}
}


/********************************************************************/
						long OpenGfx(void)
/********************************************************************/
{
static struct NewWindow Nw1 = {
	0, 10, 352, 200, (unsigned char)-1, (unsigned char)-1,

	IDCMP_CLOSEWINDOW |
	IDCMP_MENUPICK |
	IDCMP_RAWKEY |
	IDCMP_NEWSIZE |
	IDCMP_INACTIVEWINDOW |
	IDCMP_ACTIVEWINDOW |
	IDCMP_GADGETDOWN |
	IDCMP_GADGETUP |
	IDCMP_MOUSEBUTTONS |
	IDCMP_MOUSEMOVE ,

	WINDOWSIZING |
	WINDOWDRAG |
	WINDOWDEPTH |
	WINDOWCLOSE |
	NOCAREREFRESH |
	ACTIVATE,
	NULL, NULL, "Network-notepad", NULL, NULL,
	32, 32, (unsigned short)-1, (unsigned short)-1, WBENCHSCREEN
};

	if(! (win1 = OpenWindow(&Nw1)))
		{ fpf(Output(), "Can't open window\n"); CloseGfx(); return 0; }
	InitHoldGadget(&win1gadhold, win1, IDCMP_INTUITICKS, NULL);
}



