home *** CD-ROM | disk | FTP | other *** search
- /* guido.h - Public header file for Guido - Copyright 1992 Bryan Ford */
- #ifndef GUIDO_H
- #define GUIDO_H
-
- #ifndef EXEC_LIBRARIES_H
- #include <exec/libraries.h>
- #endif
-
-
- /* By default, this header file uses the linked Guido library.
- To use the Amiga runtime guido.library, #define the symbol G_RUNLIB before
- including this header file. */
-
-
- /* You can get some useful stuff out of GuidoBase whenever you have it open. */
- /* If you are using the link library, you must open all these libraries yourself. */
- struct GuidoBase
- {
- struct Library Node;
- short Private[3];
-
- /* These will always be valid whenever guido.library is open. */
- struct ExecBase *SysBase;
- struct DosLibrary *DOSBase;
- struct GfxBase *GfxBase;
- struct IntuitionBase *IntuitionBase;
- struct GadToolsBase *GadToolsBase;
- struct AslBase *AslBase;
- struct DiskfontBase *DiskfontBase;
- };
-
-
-
- /* Some special provisions to support both link and runtime libraries on the Amiga */
- #ifdef AMIGA
- # ifdef __SASC
- # define G_FAR __far
- # define G_STD __stdargs
- # ifndef G_RUNLIB
- # define G_ASM __asm
- # define G_REG(r) register __ ## r
- # endif
- # endif
- # ifdef MANX
- # define G_FAR _far
- # endif
- #endif
-
-
- /* As a default, all these things are meaningless and should
- * cause generation of simple prototypes for the various functions
- * as through they were normal C-callable link library functions.
- */
- #ifndef G_FAR
- # define G_FAR
- #endif
- #ifndef G_ASM
- # define G_ASM
- #endif
- #ifndef G_STD
- # define G_STD
- #endif
- #ifndef G_REG
- # define G_REG(r)
- #endif
-
-
- /* Use this to reference an external GuidoSpec (a symbol defined by GComp). */
- typedef char G_FAR GuidoSpec[];
-
-
- /* This is what all Guido callback functions receive as their first argument. */
- /* This may look like part of an IntuiMessage, but that is not necessarily what it is... */
- struct GuidoMessage
- {
- long Class;
- short Code;
- short Qualifier;
- void *Address;
- short MouseX, MouseY;
- long Seconds, Micros;
- struct Window *Window;
- };
-
-
- /* All Guido callback functions should look something like this: */
- typedef void GuidoCallback(struct GuidoMessage *gmsg,long userdata);
-
-
- /* Function prototypes */
-
- /* Guido Requesters */
- /* These functions use the ASL requesters. */
- /* You must have AslBase initialized before calling these functions. */
- /* All requesters are fully asynchronous (detached as a separate process). */
- void * G_ASM
- GCreateRequester(
- G_REG(a2) void *reqspec);
-
- int G_ASM
- GOpenRequester(
- G_REG(a0) void *greq,
- G_REG(a2) void *reqspec,
- G_REG(a3) void *userstruct);
-
- int G_ASM
- GCheckRequester(
- G_REG(a0) void *greq,
- G_REG(a1) void **retdataptr);
-
- void G_ASM
- GGetRequesterLocation(
- G_REG(a0) void *greq,
- G_REG(a1) short *location);
-
- //int G_ASM
- // GCloseRequester(
- // G_REG(a0) void *greq);
-
- int G_ASM
- GDeleteRequester(
- G_REG(a0) void *greq);
-
-
- /* Simple window manipulation */
- struct Window * G_ASM
- GOpenWindow(
- G_REG(a2) void *winspec,
- G_REG(a3) void *userstruct);
-
- void G_ASM
- GCloseWindow(
- G_REG(a0) struct Window *gwin);
-
-
- /* Gadget manipulation */
- struct Gadget * G_ASM
- GCreateGadgets(
- G_REG(a2) void *gadspec,
- G_REG(a3) void *userstruct,
- G_REG(a0) struct Screen *gadscreen,
- G_REG(a1) struct TextAttr *defattr,
- G_REG(d0) short leftofs,
- G_REG(d1) short topofs,
- G_REG(a4) short *whreturn);
-
- void G_ASM
- GDeleteGadgets(
- G_REG(a0) struct Gadget *gadlist);
-
-
- /* General gadget functions */
- void G_ASM
- GDisableGadget(
- G_REG(a1) struct Window *gwin,
- G_REG(a0) struct Gadget *ggad);
-
- void G_ASM
- GEnableGadget(
- G_REG(a1) struct Window *gwin,
- G_REG(a0) struct Gadget *ggad);
-
- void G_ASM
- GEnDisGadget(
- G_REG(a1) struct Window *gwin,
- G_REG(d0) long enable,
- G_REG(a0) struct Gadget *ggad);
-
- void G_ASM
- GActivateGadget(
- G_REG(a1) struct Window *gwin,
- G_REG(a0) struct Gadget *ggad);
-
-
- /* Replacements for system event-handling functions */
- /* (You only need to worry about these if you don't use GCheckPanel() for event handling.) */
- struct IntuiMessage *G_ASM
- GGetIMsg(
- G_REG(a0) struct Window *gwin);
-
- void G_ASM
- GReplyIMsg(
- G_REG(a1) struct IntuiMessage *imsg);
-
- void G_ASM
- GBeginRefresh(
- G_REG(a0) struct Window *gwin);
-
- void G_ASM
- GEndRefresh(
- G_REG(a0) struct Window *gwin);
-
- void G_ASM
- GRefreshWindow(
- G_REG(a0) struct Window *gwin);
-
-
- /* Control panel (window+gadgets+windowevents) manipulation */
- /* If you use these calls, you probably won't have to use any of the above window/gadget calls. */
- /* You can also use GOpenPanel and GClosePanel without using GCheckPanel if you are so inclined. */
- struct Window * G_ASM
- GOpenPanel(
- G_REG(a2) void *wingadspec,
- G_REG(a3) void *userstruct,
- G_REG(a0) struct TextAttr *defattr);
-
- void G_ASM
- GClosePanel(
- G_REG(a0) struct Window *panelwin);
-
- long G_ASM
- GCheckPanel(
- G_REG(a0) struct Window *panelwin,
- G_REG(a1) GuidoCallback *callback,
- G_REG(d0) long data);
-
-
- /* Cycle gadgets */
- //long G_ASM
- // GGetCycleActive(
- // G_REG(a0) struct Gadget *gad);
-
- void G_ASM
- GSetCycleActive(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(d0) int active);
-
- void G_ASM
- GSetCycleOptions(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(a2) char **options,
- G_REG(d0) int active);
-
-
- /* Checkbox gadgets */
- long G_ASM
- GGetCheckboxChecked(
- G_REG(a0) struct Gadget *gad);
-
- void G_ASM
- GSetCheckboxChecked(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(d0) int checked);
-
-
- /* Mutual-exclude (radio) gadgets */
- //long G_ASM
- // GGetMXActive(
- // G_REG(a0) struct Gadget *gad);
-
- //long G_ASM
- // GGetRadioActive(
- // G_REG(a0) struct Gadget *gad);
-
- void G_ASM
- GSetMXActive(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(d0) int active);
-
- void G_ASM
- GSetRadioActive(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(d0) int active);
-
-
- /* Text gadgets */
- /* (Text gadgets are read-only noninteractive objects like titles and such.) */
- void G_ASM
- GSetText(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(a2) char *text);
-
-
- /* String gadgets */
- /* (These are the actual interactive text-entry gadgets.) */
- char * G_ASM
- GGetString(
- G_REG(a0) struct Gadget *gad);
-
- void G_ASM
- GSetString(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(a2) char *string);
-
-
- /* Number gadgets */
- /* (Noninteractive display-only objects) */
- void G_ASM
- GSetNumber(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(d0) long number);
-
-
- /* Integer gadgets */
- /* (Interactive, editable numbers) */
- long G_ASM
- GGetInteger(
- G_REG(a0) struct Gadget *gad);
-
- void G_ASM
- GSetInteger(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(d0) long integer);
-
-
- /* ListView gadgets */
- //int G_ASM
- // GGetListViewTop(
- // G_REG(a0) struct Gadget *gad);
-
- //int G_ASM
- // GGetListViewActive(
- // G_REG(a0) struct Gadget *gad);
-
- void G_ASM
- GSetListViewActive(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(d0) int topitem,
- G_REG(d1) int actitem);
-
- void G_ASM
- GAttachListView(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(a2) struct List *list,
- G_REG(d0) int topitem,
- G_REG(d1) int actitem);
-
- void G_ASM
- GDetachListView(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad);
-
-
- /* Slider gadgets */
- //int G_ASM
- // GGetSliderLevel(
- // G_REG(a0) struct Gadget *gad);
-
- void G_ASM
- GSetSliderLevel(
- G_REG(a1) struct Window *win,
- G_REG(a0) struct Gadget *gad,
- G_REG(d0) int level);
-
-
- /* Varargs support functions available only in the linked library */
- #ifndef G_RUNLIB
-
- void G_STD
- GDisableGadgets(
- struct Window *gwin,
- struct Gadget *ggad,...);
-
- void G_STD
- GEnableGadgets(
- struct Window *gwin,
- struct Gadget *ggad,...);
-
- void G_STD
- GEnDisGadgets(
- struct Window *gwin,
- long enable,
- struct Gadget *ggad,...);
-
- #endif
-
-
- /* Manx C register call assignments */
- #ifdef AMIGA
- # ifdef AZTEC_C
- # ifndef G_RUNLIB
- # pragma regcall(GCreateRequester(a2))
- # pragma regcall(GOpenRequester(a0,a2,a3))
- # pragma regcall(GCheckRequester(a0,a1))
- # pragma regcall(GGetRequesterLocation(a0,a1))
- //# pragma regcall(GCloseRequester(a0))
- # pragma regcall(GDeleteRequester(a0))
- # pragma regcall(GOpenWindow(a2,a3))
- # pragma regcall(GCloseWindow(a0))
- # pragma regcall(GCreateGadgets(a2,a3,a0,a1,d0,d1,a4))
- # pragma regcall(GDeleteGadgets(a0))
- # pragma regcall(GDisableGadget(a1,a0))
- # pragma regcall(GEnableGadget(a1,a0))
- # pragma regcall(GEnDisGadget(a1,a0,d0))
- # pragma regcall(GActivateGadget(a1,a0))
- # pragma regcall(GGetIMsg(a0))
- # pragma regcall(GReplyIMsg(a1))
- # pragma regcall(GBeginRefresh(a0))
- # pragma regcall(GEndRefresh(a0))
- # pragma regcall(GRefreshWindow(a0))
- # pragma regcall(GOpenPanel(a2,a3,a0))
- # pragma regcall(GClosePanel(a0))
- # pragma regcall(GCheckPanel(a0,a1,d0))
- //# pragma regcall(GGetCycleActive(a0))
- # pragma regcall(GSetCycleActive(a1,a0,d0))
- # pragma regcall(GSetCycleOptions(a1,a0,a2,d0))
- # pragma regcall(GGetCheckboxChecked(a0))
- # pragma regcall(GSetCheckboxChecked(a1,a0,d0))
- //# pragma regcall(GGetMXActive(a0))
- //# pragma regcall(GGetRadioActive(a0))
- # pragma regcall(GSetMXActive(a1,a0,d0))
- # pragma regcall(GSetRadioActive(a1,a0,d0))
- # pragma regcall(GSetText(a1,a0,a3))
- # pragma regcall(GGetString(a0))
- # pragma regcall(GSetString(a1,a0,a2))
- # pragma regcall(GSetNumber(a1,a0,d0))
- # pragma regcall(GGetInteger(a0))
- # pragma regcall(GSetInteger(a1,a0,d0))
- //# pragma regcall(GGetListViewTop(a0))
- //# pragma regcall(GGetListViewActive(a0))
- # pragma regcall(GSetListViewActive(a1,a0,d0,d1))
- # pragma regcall(GAttachListView(a1,a0,a2,d0,d1))
- # pragma regcall(GDetachListView(a1,a0))
- //# pragma regcall(GGetSliderLevel(a0))
- # pragma regcall(GSetSliderLevel(a1,a0,d0))
- # endif
- # endif
- #endif
-
-
- /* Function call pragmas for use with the runtime library (guido.library). */
- /* These pragmas (SAS style) will work for both Manx and SAS. */
- #ifdef AMIGA
- # ifdef G_RUNLIB
- # pragma libcall GuidoBase GCreateRequester 1E A01
- # pragma libcall GuidoBase GOpenRequester 24 BA803
- # pragma libcall GuidoBase GCheckRequester 2A 9802
- # pragma libcall GuidoBase GGetRequesterLocation 30 9802
- /* pragma libcall GuidoBase GCloseRequester 36 801*/
- # pragma libcall GuidoBase GDeleteRequester 3C 801
- # pragma libcall GuidoBase GOpenWindow 42 BA02
- # pragma libcall GuidoBase GCloseWindow 48 801
- # pragma libcall GuidoBase GCreateGadgets 4E C1098BA07
- # pragma libcall GuidoBase GDeleteGadgets 54 801
- # pragma libcall GuidoBase GDisableGadget 5A 8902
- # pragma libcall GuidoBase GEnableGadget 60 8902
- # pragma libcall GuidoBase GEnDisGadget 66 08903
- # pragma libcall GuidoBase GActivateGadget 6C 8902
- # pragma libcall GuidoBase GGetIMsg 72 801
- # pragma libcall GuidoBase GReplyIMsg 78 901
- # pragma libcall GuidoBase GBeginRefresh 7E 801
- # pragma libcall GuidoBase GEndRefresh 84 801
- # pragma libcall GuidoBase GRefreshWindow 8A 801
- # pragma libcall GuidoBase GOpenPanel 90 8BA03
- # pragma libcall GuidoBase GClosePanel 96 801
- # pragma libcall GuidoBase GCheckPanel 9C 09803
- /* pragma libcall GuidoBase GGetCycleActive A2 801*/
- # pragma libcall GuidoBase GSetCycleActive A8 08903
- # pragma libcall GuidoBase GSetCycleOptions AE 0A8904
- # pragma libcall GuidoBase GGetCheckboxChecked B4 801
- # pragma libcall GuidoBase GSetCheckboxChecked BA 08903
- /* pragma libcall GuidoBase GGetMXActive C0 801*/
- /* pragma libcall GuidoBase GGetRadioActive C6 801*/
- # pragma libcall GuidoBase GSetMXActive CC 08903
- # pragma libcall GuidoBase GSetRadioActive D2 08903
- # pragma libcall GuidoBase GSetText D8 A8903
- # pragma libcall GuidoBase GGetString DE 801
- # pragma libcall GuidoBase GSetString E4 A8903
- # pragma libcall GuidoBase GSetNumber EA 08903
- # pragma libcall GuidoBase GGetInteger F0 801
- # pragma libcall GuidoBase GSetInteger F6 08903
- /* pragma libcall GuidoBase GGetListViewTop FC 801*/
- /* pragma libcall GuidoBase GGetListViewActive 102 801*/
- # pragma libcall GuidoBase GSetListViewActive 108 108904
- # pragma libcall GuidoBase GAttachListView 10E 10A8905
- # pragma libcall GuidoBase GDetachListView 114 A802
- /* pragma libcall GuidoBase GGetSliderLevel 11A 801*/
- # pragma libcall GuidoBase GSetSliderLevel 120 08903
- # endif
- #endif
-
- /* Get rid of our baggage */
- #undef G_FAR
- #undef G_ASM
- #undef G_STD
- #undef G_REG
-
- #endif
-