#include <exec/types.h>
#include <intuition/intuition.h>
#include <proto/intuition.h>

static ULONG oldIDCMP;   /* Make this static to this file! */
WORD minwidth,minheight; /* minimum window size limits */
UWORD maxwidth,maxheight;/* maximum window size limits */

void DisableWindow(struct Window *win)
{
  oldIDCMP=win->IDCMPFlags;
  ModifyIDCMP(win,NULL);
  SetWindowPointer(win,WA_BusyPointer,TRUE,TAG_DONE);

  minwidth=win->MinWidth;
  minheight=win->MinHeight;
  maxwidth=win->MaxWidth;
  maxheight=win->MaxHeight;
  WindowLimits(win,win->Width,win->Height,win->Width,win->Height);
}

void EnableWindow(struct Window *win)
{
  SetWindowPointer(win,TAG_DONE);
  ModifyIDCMP(win,oldIDCMP);
  WindowLimits(win,minwidth,minheight,maxwidth,maxheight);
}
