/* This program shows the size of the current window */

#include <stdio.h>
#include "proto/exec.h"

#include "intuition/intuitionbase.h"

struct IntuitionBase *IntBase;

void main(int argc, char *argv[])
{
  struct Window *Win;
  if (IntBase = (struct IntuitionBase *) OpenLibrary("intuition.library",0))
    {
      Win = IntBase->ActiveWindow;
      if (argc > 1)
	{
	  if ((*argv[1] == '-'))
	    {
	      switch (argv[1][1])
		{
		case 'c':
		case 'C':
		  {
		    printf ("%d/%d/%d/%d/",Win->LeftEdge,Win->TopEdge,Win->Width,Win->Height);
		    break;
		  }
		default:
		  {
		    printf("Usage: WinSize [-c] , where -c means CON: type output\n");
		  }
		}
	    }
	}
      else
	printf ("Window Position: %d x %d , Size: %d x %d\n",Win->LeftEdge,Win->TopEdge,Win->Width,Win->Height);
      CloseLibrary((struct Library *) IntBase);
    }
}
