home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************/
- /* */
- /* GWIN INCLUDE FILE */
- /* */
- /*******************************************************/
-
- #include <exec/types.h>
- #include <graphics/gfxbase.h>
- #include <graphics/display.h>
- #include <graphics/regions.h>
- #include <graphics/gfx.h>
- #include <graphics/gfxmacros.h>
- #include <intuition/intuitionbase.h>
- #include <intuition/intuition.h>
- #include <stdio.h>
- #include <exec/memory.h>
- #include <hardware/custom.h>
- #include <hardware/dmabits.h>
- #include <libraries/dos.h>
- #include <libraries/diskfont.h>
- #include <devices/audio.h>
- #include <math.h>
-
- #define SCR_MAX 1
- #define WIN_MAX 1
- #define MAXVECTORS 1000
- /* 640 x 400 / 8 (page 230 Mortimore) */
- #define RASTERSIZE 32000
-
- #define USTART(a,b,c,d,e) { if(!OpenGWINBase()) { \
- printf("Can't open GWIN.library.\n"); \
- printf("Exiting.\n"); \
- exit(1); \
- } \
- G = ustart( (a),(b),(c),(d),(e) ); \
- GfxBase = G->GfxBase; \
- IntuitionBase = G->IntuitionBase; \
- DiskfontBase = G->DiskfontBase; \
- rport1 = G->rport1; \
- win[0] = G->win[0]; \
- scr[0] = G->scr[0]; }
-
- #define UEND() { uend(G); \
- CloseGWINBase(); }
- /*
-
- extern short Enable_Abort;
-
- */
-
- /*******************************************************/
- /* */
- /* GLOBAL VARIABLES */
- /* */
- /*******************************************************/
-
- struct G_user_subset {
- struct RastPort *rport1;
- struct Window *win[WIN_MAX];
- struct Screen *scr[SCR_MAX];
-
- struct GfxBase *GfxBase;
- struct IntuitionBase *IntuitionBase;
- struct DiskfontBase *DiskfontBase;
- } *G;
-
- struct RastPort *rport1;
- struct Window *win[WIN_MAX];
- struct Screen *scr[SCR_MAX];
-
- struct GfxBase *GfxBase;
- struct IntuitionBase *IntuitionBase;
- struct DiskfontBase *DiskfontBase;
-
-
- /*******************************************************/
- /* */
- /* STRUCTURE DEFINITIONS */
- /* */
- /*******************************************************/
-
- struct G_user_subset *ustart(char *c, float x1, float x2,
- float y1, float y2);
-
- struct GWINBase *GWINBase = 0L;
-
- BOOL OpenGWINBase()
- {
- GWINBase=(struct GWINBase *)OpenLibrary("GWIN.library",1L);
- if(GWINBase) {
- return(TRUE);
- }
- else {
- return(FALSE);
- }
- }
-
- void CloseGWINBase()
- {
- if(GWINBase) CloseLibrary(GWINBase);
- GWINBase=0L;
- }
-
- struct uuevent {
- ULONG event;
- char key;
- } uuev;
-
- /*******************************************************/
- /* */
- /* FUNCTION PROTOTYPES */
- /* */
- /*******************************************************/
-
- extern struct G_user_subset *ustart(char *c, float x1, float x2,
- float y1, float y2);
- extern int udarea(struct G_user_subset *G, float x1, float x2,
- float y1, float y2);
- extern int uwindo(struct G_user_subset *G, float xmin, float xmax,
- float ymin, float ymax);
- extern int uoutln(struct G_user_subset *G);
- extern int uerase(struct G_user_subset *G);
- extern int uflush(struct G_user_subset *G);
- extern int uwhere(struct G_user_subset *G, float *x, float *y);
- extern int uadjust(struct G_user_subset *G, float x, float y,
- float *xa, float *ya);
- extern int urotate(struct G_user_subset *G, float x, float y, float theta);
- extern int ugrin(struct G_user_subset *G, float *x, float *y);
- extern int ugrinc(struct G_user_subset *G, float *x, float *y,
- struct uuevent *uuev);
- extern int ugrinl(struct G_user_subset *G, float *x, float *y,
- struct uuevent *uuev);
- extern int ugrina(struct G_user_subset *G, float *x, float *y,
- struct uuevent *uuev);
- extern int uigrina(struct G_user_subset *G, int *ix, int *iy,
- struct uuevent *uuev);
- extern int uyorn(struct G_user_subset *G, char *bodytext,
- char *positivetext, char *negativetext, float width,
- float height);
- extern int uimove(struct G_user_subset *G, int ix, int iy);
- extern int uidraw(struct G_user_subset *G, int ix, int iy);
- extern int umove(struct G_user_subset *G, float x, float y);
- extern int udraw(struct G_user_subset *G, float x, float y);
- extern int urect(struct G_user_subset *G, float x1, float y1,
- float x2, float y2);
- extern int uplygn(struct G_user_subset *G, float x, float y,
- float n, float r);
- extern int ucrcle(struct G_user_subset *G, float x, float y, float r);
- extern int uamenu(struct G_user_subset *G, int gwinmenu0,
- int gwinmenu1, int gwinmenu2, char* text,
- char comchr, int mutex, USHORT flags, int (*routine)() );
-
- extern int upset(struct G_user_subset *G, char *text, float value);
- extern int uset(struct G_user_subset *G, char *text);
- extern int usetrgb(struct G_user_subset *G, float colorindex,
- float redvalue, float greenvalue, float bluevalue);
- extern int ugetrgb(struct G_user_subset *G, float colorindex,
- float *redvalue, float *greenvalue, float *bluevalue);
- extern int ugetstring(struct G_user_subset *G, float x1, float y1,
- float width, char *text, char *prompt);
- extern int ufont(struct G_user_subset *G, char *name, float size);
- extern int uprint(struct G_user_subset *G, float x, float y, char *line);
- extern int uprnt1(struct G_user_subset *G, char *option, char *line);
-
- extern int uprscr(struct G_user_subset *G);
- extern int usetcleanup(struct G_user_subset *G, int (*cleanup_routine)() );
- extern int uend(struct G_user_subset *G);
- extern int uzvtodconv(struct GR *G, float x, float y, float *xt, float *yt,
- int *ix, int *iy);
- extern int uzdtovconv(struct GR *G,int ix, int iy, float *x, float *y);
-
-
- /*******************************************************/
- /* */
- /* PRAGMAS */
- /* */
- /*******************************************************/
-
- #pragma amicall(GWINBase, 0x1E, ustart(a0,d0,d1,d2,d3))
- #pragma amicall(GWINBase, 0x24, udarea(a0,d0,d1,d2,d3))
- #pragma amicall(GWINBase, 0x2A, uwindo(a0,d0,d1,d2,d3))
- #pragma amicall(GWINBase, 0x30, uoutln(a0))
- #pragma amicall(GWINBase, 0x36, uerase(a0))
- #pragma amicall(GWINBase, 0x3C, uflush(a0))
- #pragma amicall(GWINBase, 0x42, uwhere(a0,a1,a2))
- #pragma amicall(GWINBase, 0x48, uadjust(a0,d0,d1,a1,a2))
- #pragma amicall(GWINBase, 0x4E, urotate(a0,d0,d1,d2))
- #pragma amicall(GWINBase, 0x54, ugrin(a0,a1,a2))
- #pragma amicall(GWINBase, 0x5A, ugrinc(a0,a1,a2,a3))
- #pragma amicall(GWINBase, 0x60, ugrinl(a0,a1,a2,a3))
- #pragma amicall(GWINBase, 0x66, ugrina(a0,a1,a2,a3))
- #pragma amicall(GWINBase, 0x6C, uigrina(a0,a1,a2,a3))
- #pragma amicall(GWINBase, 0x72, uyorn(a0,a1,a2,a3,d0,d1))
- #pragma amicall(GWINBase, 0x78, uimove(a0,d0,d1))
- #pragma amicall(GWINBase, 0x7E, uidraw(a0,d0,d1))
- #pragma amicall(GWINBase, 0x84, umove(a0,d0,d1))
- #pragma amicall(GWINBase, 0x8A, udraw(a0,d0,d1))
- #pragma amicall(GWINBase, 0x90, urect(a0,d0,d1,d2,d3))
- #pragma amicall(GWINBase, 0x96, uplygn(a0,d0,d1,d2,d3))
- #pragma amicall(GWINBase, 0x9C, ucrcle(a0,d0,d1,d2))
- #pragma amicall(GWINBase, 0xA2, uamenu(a0,d0,d1,d2,a1,d3,d4,d5,a2))
- #pragma amicall(GWINBase, 0xA8, upset(a0,a1,d0))
- #pragma amicall(GWINBase, 0xAE, uset(a0,a1))
- #pragma amicall(GWINBase, 0xB4, usetrgb(a0,d0,d1,d2,d3))
- #pragma amicall(GWINBase, 0xBA, ugetrgb(a0,d0,a1,a2,a3))
- #pragma amicall(GWINBase, 0xC0, ugetstring(a0,d0,d1,d2,a1,a2))
- #pragma amicall(GWINBase, 0xC6, ufont(a0,a1,d0))
- #pragma amicall(GWINBase, 0xCC, uprint(a0,d0,d1,a1))
- #pragma amicall(GWINBase, 0xD2, uprnt1(a0,a1,a2))
- #pragma amicall(GWINBase, 0xD8, uprscr(a0))
- #pragma amicall(GWINBase, 0xDE, usetcleanup(a0,a1))
- #pragma amicall(GWINBase, 0xE4, uend(a0))
- #pragma amicall(GWINBase, 0xEA, uzvtodconv(a0,d0,d1,a1,a2,a3,a5))
- #pragma amicall(GWINBase, 0xF0, uzdtovconv(a0,d0,d1,a1,a2))
-
-