/******************************************/
/*                                        */
/* 3.1.3.1.B. GraphicWindow2.c            */
/*                                        */
/* Program: Window for a graphics program */
/* ====================================   */
/*                                        */
/* Author:  Date:      Comments:          */
/* ------  ----------  ----------         */
/* Wgb     12/06/1987  BACKDROP           */
/* JLD     01/06/1988  BORDERLESS         */
/*                                        */
/******************************************/


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


struct IntuitionBase *IntuitionBase;
struct Window        *FirstWindow;
struct IntuiMessage  *message;


struct NewWindow FirstNewWindow =
   {
   0, 0,                  /* LeftEdge, TopEdge   */
   640, 200,              /* Width, Height       */
   0, 1,                  /* DetailPen, BlockPen */
   NULL,                  /* IDCMP Flags         */
/*   WINDOWCLOSE |         /* Flags               */
   BACKDROP |
   BORDERLESS |
   SMART_REFRESH,
   NULL,                  /* First Gadget        */
   NULL,                  /* CheckMark           */
   NULL,                  /*Window Title*/
   NULL,                  /* Screen              */
   NULL,                  /* BitMap              */
   0, 0,                  /* Min Width, Height   */
   0, 0,                  /* Max Width, Height   */
   WBENCHSCREEN,          /* Type                */
   };


main()
   {
   
   Open_All();

   ShowTitle(FirstWindow->WScreen, FALSE);
   
   Delay(180L);
   
   Close_All();
   
   exit(TRUE);
   }



/***************************************
 *                                     *
 * Function: Open library and window   *
 * =================================== *
 *                                     *
 * Author:  Date:      Comment:        *
 * ------  ----------  ----------      *
 * Wgb     10/16/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     10/16/1987  just Intuition  *
 *                     and window      *
 *                                     *
 **************************************/

Close_All()

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

