#include <intuition/intuition.h>
#include <stdio.h>

struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;

/* Externe Structuren der Fonts */

extern struct TextFont FrankfurterFont;
extern struct TextFont NinetysFont;
extern struct TextFont OutlineFont;
extern struct TextFont BroadwayFont;

struct Window *win;
struct RastPort *rp;
struct IntuiMessage *mes;

ULONG mesclass;

struct NewWindow nwin =
  {
    0,0,640,200,0,1,CLOSEWINDOW,
    ACTIVATE|WINDOWCLOSE,NULL,NULL,"<- Hier anklicken um Window zu schliessen",NULL,NULL,0,0,0,0,WBENCHSCREEN
  };

main()
  {
    IntuitionBase = ( struct IntuitionBase * )
    OpenLibrary ( "intuition.library",0 );

    GfxBase = ( struct GfxBase * )
    OpenLibrary ( "graphics.library",0 );

    win = ( struct Window * )
    OpenWindow ( &nwin );

    rp = win  -> RPort;

    SetAPen(rp,1);

    /* Fonts initialisieren */

    FontInit_Frankfurter();
    FontInit_Ninetys();
    FontInit_Outline();
    FontInit_Broadway();

    SetFont ( rp,&BroadwayFont );                           /* Font einschalten */
    Move(rp,10,37);
    Text(rp,"Dieser Text wurde mit vier",26);               /* Text im gewählten Font ausgeben */

    SetFont ( rp,&FrankfurterFont );                        /* Font einschalten */
    Move(rp,10,67);
    Text(rp,"verschiedenen Fonts ausgegeben,",31);         /* Text im gewählten Font ausgeben */

    SetFont ( rp,&NinetysFont );                            /* Font einschalten */
    Move(rp,10,97);
    Text(rp,"ohne das die Diskfont.library",29);            /* Text im gewählten Font ausgeben */

    SetFont ( rp,&OutlineFont );                            /* Font einschalten */
    Move(rp,10,127);
    Text(rp,"oder ein Font nachgeladen werden musste.",40); /* Text im gewählten Font ausgeben */

    SetFont ( rp,&BroadwayFont );                           /* Font einschalten */
    Move(rp,10,157);
    Text(rp,"Der Text wurde mit der Text-Function aus",40); /* Text im gewählten Font ausgeben */

    SetFont ( rp,&FrankfurterFont );                        /* Font einschalten */
    Move(rp,10,187);
    Text(rp,"der Graphics.library ausgegeben.",32);         /* Text im gewählten Font ausgeben */

    for(;;)
      {
        if(mes=(struct IntuiMessage *)GetMsg(win->UserPort))
          {
            mesclass=mes->Class;
            ReplyMsg(mes);
            if(mesclass==CLOSEWINDOW)
              {
                close_all();
                exit(EXIT_SUCCESS);
              }
          }
      }
  }

close_all()
  {
    CloseWindow  ( win );
    CloseLibrary ( GfxBase );
    CloseLibrary ( IntuitionBase );
  }

