/*              **
**  Edit Window **
**              */

#include <stdio.h>
#include <stdlib.h>
#include <exec/exec.h>
#include <exec/lists.h>
#include <exec/memory.h>
#include <exec/nodes.h>
#include <exec/types.h>
#include <intuition/intuition.h>
#include <intuition/intuitionbase.h>
#include <intuition/screens.h>
#include <math.h>
#include <string.h>

/* die entsprechenden Matheroutinen includen */
#ifdef _M68881
	#include <m68881.h>
#endif

/* Prototypes für Libraryfunctions */
#include <proto/exec.h>
#include <proto/intuition.h>

/* Version | Revisionscontrol */

#define	VERSION		1
#define	REVISION	00
#define	DATE		"__Date__"
#define	VERS		"EdWin 1.00"
#define	VSTRING		"EdWin 1.00 ("__DATE__")\n\r"
#define	VERSTAG		"\0$VER: EdWin 1.00 ("__DATE__")"

/* Globals */

UBYTE VersTag[]=VERSTAG;		/* Versionsstring */
struct IntuitionBase	*IntuitionBase=0l;
struct Window			*win=0l;

void main(int argc,char *argv[])
{
	WORD xpos,ypos,xres,yres;
	ULONG lock;

	printf("\n[32mEdWin V1.0\nby ENSONIC of TRINOMIC[31m\n");
	if(argc!=5)
	{
		printf("Usage : EdWin xpos ypos xres yres\n\n");
	}
	else
	{
		xpos=atoi(argv[1]);
		ypos=atoi(argv[2]);
		xres=atoi(argv[3]);
		yres=atoi(argv[4]);

		if(IntuitionBase=OpenLibrary("intuition.library",37))
		{
			lock=LockIBase(0);
			win=IntuitionBase->ActiveWindow;
			UnlockIBase(lock);
			ChangeWindowBox(win,xpos,ypos,xres,yres);
			CloseLibrary(IntuitionBase);
		}
	}
}
