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

struct Intuition *IntuitionBase;
struct GfxBase *GfxBase;

#define INTUITION_REV  29
#define GRAPHICS_REV   29

struct TextAttr MyFont =
{
 "topaz.font",
 TOPAZ_EIGHTY,
};

struct NewScreen NewScreen =
{
 0,
 0,
 320,
 200,
 2,
 0, 1,
 NULL,
 CUSTOMSCREEN,
 &MyFont,
 "Amiga Magazine",
 NULL,
 NULL,
 };

main()
{
  struct Screen *Screen;
  struct NewWindow NewWindow;
  struct Window *Window;

  LONG i;
  int n=10;
  int m;
  IntuitionBase = (struct IntuitionBase *)
    OpenLibrary("intuition.library", INTUITION_REV);
  if (IntuitionBase == NULL) exit(FALSE);

  GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", GRAPHICS_REV);
  if (GfxBase == NULL) exit(FALSE);
  
  if ((Screen = (struct Screen *)OpenScreen(&NewScreen)) == NULL)
     exit(FALSE);

  NewWindow.LeftEdge = 0;
  NewWindow.TopEdge = 11;
  NewWindow.Width = 250;
  NewWindow.Height = 100;
  NewWindow.DetailPen = 0;
  NewWindow.BlockPen = 1;
  NewWindow.Title = "Forza Amiga";
  NewWindow.Flags = WINDOWCLOSE|SMART_REFRESH|BORDERLESS;
  NewWindow.IDCMPFlags = CLOSEWINDOW;
  NewWindow.Type = CUSTOMSCREEN;
  NewWindow.FirstGadget = NULL;
  NewWindow.CheckMark = NULL;
  NewWindow.Screen = Screen;
  NewWindow.BitMap = NULL;
  NewWindow.MinWidth = 2;
  NewWindow.MinHeight = 6;
  NewWindow.MaxWidth = 640;
  NewWindow.MaxHeight = 220;

  if (( Window = (struct Window *)OpenWindow(&NewWindow) ) == NULL)
      exit(FALSE);
  Wait(1 << Window->UserPort->mp_SigBit);
  CloseWindow(Window);
  CloseScreen(Screen);
  exit(TRUE);
}
