/***************************************
 *                                     *
 * Program: DrawBorder.c               *
 * =================================== *
 *                                     *
 * Author:  Date:      Comments:       *
 * ------  ----------  ----------      *
 * Wgb     10/16/1987  Border box      *
 *                     in Window       *
 *                                     *
 ***************************************/


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


struct IntuitionBase *IntuitionBase;
struct Window        *FirstWindow;


struct NewWindow FirstNewWindow =
   {
   160, 50,             /* LeftEdge, TopEdge   */
   320, 150,            /* Width, Height       */
   0, 1,                /* DetailPen, BlockPen */
   NULL,                /* IDCMP Flags         */
   WINDOWDEPTH |        /* Flags               */
   WINDOWSIZING |
   WINDOWDRAG |
   WINDOWCLOSE |
   SMART_REFRESH,
   NULL,                /* First Gadget        */
   NULL,                /* CheckMark           */
   (UBYTE *)"System programing test",
   NULL,                /* Screen              */
   NULL,                /* BitMap              */
   100, 50,             /* Min Width, Height   */
   640, 200,            /* Max Width, Height   */
   WBENCHSCREEN,        /* Typ                 */
   };

SHORT TestValue[] =
   {
    0,  0,
   50,  0,
   50, 12,
    0, 12,
    0,  0
   };

struct Border TestBorder =
   {
   50, 20,
   2, 0,
   JAM1,
   5,
   TestValue,
   NULL
   };



main()
   {
   struct RastPort *MyWindowsRastPort;

   Open_All();
   
   MyWindowsRastPort = FirstWindow->RPort;

   DrawBorder(MyWindowsRastPort, &TestBorder, 10L, 10L);

   Delay(180L);
   
   Close_All();
   }


/***************************************
 *                                     *
 * Function: Library and Window open   *
 * =================================== *
 ***************************************/

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 all                 *
 * =================================== *
 *                                     *
 ***************************************/

Close_All()

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

