home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <intuition/intuition.h>
- #include <proto/intuition.h>
- #include <proto/graphics.h>
- #include <proto/exec.h>
-
- #include "viewprotos.h"
-
-
- struct NewScreen ns =
- {
- 0, 180,
- 640, 200,
- 2,
- -1, -1,
- HIRES,
- SCREENQUIET,
- NULL,
- NULL,
- NULL,
- };
-
- struct NewWindow nw =
- {
- 0,0,
- 640,200,
- 1, 0,
- NULL,
- SMART_REFRESH|BACKDROP|BORDERLESS|ACTIVATE|NOCAREREFRESH|RMBTRAP,
- NULL, /* first gadget */
- NULL,
- NULL,
- NULL,
- NULL,
- 640,200,
- 640,200,
- CUSTOMSCREEN
- };
-
- UWORD wbPens[] = {0,1,1,2,1,3,1,0,3,~0};
-
- struct TagItem tag[] = {
- {SA_Pens,(ULONG)wbPens},
- {SA_DisplayID,(ULONG)HIRES_KEY},
- {TAG_DONE,NULL}
- };
-
- struct TextAttr textAttr;
- struct TextFont *textFont=NULL, *oldFont;
-
- extern struct Window *gWindow;
- extern struct Screen *gScreen;
- extern struct MsgPort *messagePort;
- extern struct Library *HameBase;
- extern struct Gadget hilaceGadget, main2Gadget;
-
- VOID
- gadgetScreen(VOID)
- {
- struct ViewPort *vp;
-
- gScreen = (struct Screen *)OpenScreenTagList(&ns,tag);
- if(gScreen == NULL) myExit("Open Gadget Screen");
-
- nw.Screen = gScreen;
-
- gWindow = (struct Window *)OpenWindow(&nw);
- if(gWindow == NULL) myExit("Open Gadget Window");
-
- ShowTitle(gScreen, FALSE);
-
- if(gWindow->UserPort) DeletePort(gWindow->UserPort);
- gWindow->UserPort = messagePort;
- ModifyIDCMP(gWindow,MOUSEBUTTONS|GADGETUP|GADGETDOWN);
-
- textAttr.ta_Name = "topaz.font";
- textAttr.ta_YSize = 8;
- textAttr.ta_Style = FS_NORMAL;
- textAttr.ta_Flags = FPF_DESIGNED | FPF_ROMFONT;
-
- oldFont = gWindow->RPort->Font;
-
- textFont = OpenFont(&textAttr);
- if(!textFont) myExit("Aaaak! Can't open Topaz Font");
-
- SetFont(gWindow->RPort, textFont);
-
- vp = ViewPortAddress(gWindow);
-
- SetRGB4(vp, 0, 0xa, 0xa, 0xa);
- SetRGB4(vp, 1, 0x0, 0x0, 0x0);
- SetRGB4(vp, 2, 0xf, 0xf, 0xf);
- SetRGB4(vp, 3, 0x4, 0x5, 0x9);
-
- mainGadgets();
-
- if(HameBase==NULL) hilaceGadget.NextGadget=&main2Gadget;
-
- return;
- }
-