/***************************************/
/*                                     */
/*  3.1.2.4.C  MoveWindow.c            */
/*                                     */
/* Program: Window local definition    */
/* =================================== */
/*                                     */
/* Author:  Date:      Comment:        */
/* ------  ----------  ----------      */
/* Wgb     10/16/1987  move            */
/* JLD     01/06/88    window          */
/* Aztec C use +L option on compiler   */
/***************************************/


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


struct IntuitionBase *IntuitionBase;
struct Window        *FirstWindow;


struct NewWindow FirstNewWindow;


main()
   {
   short DeltaX,DeltaY;

   FirstNewWindow.LeftEdge   = 160;
   FirstNewWindow.TopEdge    = 50;
   FirstNewWindow.Width      = 320;
   FirstNewWindow.Height     = 150;
   FirstNewWindow.DetailPen  = 0;
   FirstNewWindow.BlockPen   = 1;
   FirstNewWindow.IDCMPFlags = NULL;
   FirstNewWindow.Flags      = WINDOWDEPTH | WINDOWSIZING |
                               WINDOWDRAG | WINDOWCLOSE | SMART_REFRESH;
   FirstNewWindow.FirstGadget= NULL;
   FirstNewWindow.CheckMark  = NULL;
   FirstNewWindow.Title    = (UBYTE *)"System test";
   FirstNewWindow.Screen     = NULL;
   FirstNewWindow.BitMap     = NULL;
   FirstNewWindow.MinWidth   = 100;
   FirstNewWindow.MinHeight  = 50;
   FirstNewWindow.MaxWidth   = 640;
   FirstNewWindow.MaxHeight  = 200;
   FirstNewWindow.Type       = WBENCHSCREEN;
   
   Open_All();
   
   Delay(180L);
   DeltaX = FirstWindow->LeftEdge;
   DeltaY = FirstWindow->TopEdge;
   MoveWindow(FirstWindow,-1*DeltaX,-1*DeltaY);
   Delay(180L);
   
   Close_All();
   }


/***************************************
 *                                     *
 * Function: Open library and window   *
 * =================================== *
 *                                     *
 * Author:  Date:      Comment:        *
 * ------  ----------  ----------      *
 * Wgb     16.10.1987                  *
 *                                     *
 *                                     *
 **************************************/

Open_All()

   {
   void          *OpenLibrary();
   struct Window *OpenWindow();
   
   if (!(IntuitionBase = (struct IntuitionBase *)
       OpenLibrary("intuition.library", 0L)))
      {
      printf("Intuition library not found!\n");
      Close_All();
      exit(FALSE);
      }
   
   if (!(FirstWindow = (struct Window *)
       OpenWindow(&FirstNewWindow)))
      {
      printf("Window will not open!\n");
      Close_All();
      exit(FALSE);
      }
   }

/***************************************
 *                                     *
 * Function: Close everything opened   *
 * =================================== *
 *                                     *
 * Author:  Date:      Comment:        *
 * ------  ----------  ----------      *
 * Wgb     16.10.1987  just Intuition  *
 *                     and window      *
 *                                     *
 **************************************/

Close_All()

   {
   if (FirstWindow)     CloseWindow(FirstWindow);
   if (IntuitionBase)   CloseLibrary(IntuitionBase);
   }

