home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************/
- /* Miscellaneous handy Intuition functions */
- /**********************************************************************/
-
- #include <exec/types.h>
- #include <intuition/intuition.h>
- #include <intuition/intuitionbase.h>
- #include <graphics/gfxbase.h>
- #include <Exec/libraries.h>
- #include <clib/intuition_protos.h>
- #include <clib/exec_protos.h>
- #include <clib/gadtools_protos.h>
- #include <clib/graphics_protos.h>
- #include <pragmas/exec.h>
- #include <pragmas/intuition.h>
- #include <pragmas/gadtools.h>
- #include <pragmas/graphics.h>
- #include <graphics/text.h>
-
- struct IntuitionBase *IntuitionBase;
- struct GfxBase *GfxBase;
- struct Library *GadToolsBase;
-
- struct TextFont *Topaz;
-
- ULONG IntuitionVersion;
- ULONG GfxVersion;
- ULONG GadToolsVersion;
-
- struct TextAttr Topaz80 =
- {
- "topaz.font", /* Name */
- 8, /* YSize */
- 0, /* Style */
- 0, /* Flags */
- };
-
- /**********************************************************************/
- /* Open Intuition and Graphics libraries */
- /**********************************************************************/
- int
- OpenLibraries(ULONG Version)
- {
- IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", Version);
- GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", Version);
- GadToolsBase = (struct GadToolsBase *)OpenLibrary("gadtools.library", Version);
-
- if (!IntuitionBase || !GfxBase || !GadToolsBase)
- return(FALSE);
-
- GfxVersion=GfxBase->LibNode.lib_Version;
- IntuitionVersion=IntuitionBase->LibNode.lib_Version;
- GadToolsVersion=GadToolsBase->lib_Version;
-
- Topaz=OpenFont(&Topaz80);
- if (Topaz==0) return(FALSE);
-
- return(TRUE);
- }
-
-
- /**********************************************************************/
- /* Close the Intuition and Graphics libraries */
- /**********************************************************************/
- void
- CloseLibraries(void)
- {
- if (IntuitionBase) CloseLibrary((struct Library *)IntuitionBase);
- if (GfxBase) CloseLibrary((struct Library *)GfxBase);
- if (GadToolsBase) CloseLibrary((struct Library *)GfxBase);
- if (Topaz) CloseFont(Topaz);
-
- IntuitionBase=0;
- GfxBase=0;
- GadToolsBase=0;
- Topaz=0;
- }
-
- /**********************************************************************/
- /* Simple interface to EasyRequest() */
- /**********************************************************************/
- int
- IntuiRequest(struct Window *Window, char *Text, char *Gadgets)
- {
- struct EasyStruct ES;
-
- ES.es_StructSize=sizeof(ES);
- ES.es_Flags=0;
- ES.es_Title=NULL;
- ES.es_TextFormat=Text;
- ES.es_GadgetFormat=Gadgets;
-
- return(EasyRequestArgs(Window, &ES, NULL, NULL));
- }
-