home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / comms / network / grn1src.lha / system.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-03  |  4.2 KB  |  128 lines

  1. #include        <exec/types.h>
  2. #include        <intuition/intuitionbase.h>
  3. #include        <libraries/gadtools.h>
  4. #include        <intuition/gadgetclass.h>
  5. #include        <graphics/displayinfo.h>
  6. #include        <exec/types.h>
  7. #include        <exec/nodes.h>
  8. #include        <exec/lists.h>
  9. #include        <dos/dos.h>
  10. #include        <dos/dosextens.h>
  11. #include        <dos/dostags.h>
  12. #include        <stdlib.h>
  13. #include        <ctype.h>
  14. #include        <stdio.h>
  15. #include        <fcntl.h>
  16. #include        <string.h>
  17. #include        <clib/exec_protos.h>
  18. #include        <clib/dos_protos.h>
  19. #include        <clib/intuition_protos.h>
  20. #include        <clib/diskfont_protos.h>
  21. #include        <clib/graphics_protos.h>
  22. #include        <clib/gadtools_protos.h>
  23. #include        <clib/asl_protos.h>
  24. #include        <clib/alib_protos.h>
  25.  
  26. #define O_READ  (O_RDONLY)
  27. #define O_WRITE (O_WRONLY|O_CREAT|O_TRUNC)
  28.  
  29. typedef struct Library          LIBRARY;
  30. typedef struct TagItem          TAGS;
  31. typedef struct List             LIST;
  32. typedef struct Node             NODE;
  33. typedef struct VisualInfo       VINFO;
  34. typedef struct Gadget           GADGET;
  35. typedef struct NewGadget        NEWGAD;
  36. typedef struct Screen           SCREEN;
  37. typedef struct Window           WINDOW;
  38. typedef struct ViewPort         VPORT;
  39. typedef struct RastPort         RPORT;
  40. typedef struct IntuiMessage     IMSG;
  41. typedef struct TextAttr         TATTR;
  42. typedef struct StringInfo       STRINGINFO;
  43. typedef struct Rectangle        RECT;
  44. typedef struct TextFont         FONT;
  45. typedef struct FileInfoBlock    FIB;
  46. typedef BPTR                    LOCK;
  47. typedef struct Process          PROCESS;
  48. typedef struct FontRequester    FONTREQ;
  49. typedef struct FileRequester    FILEREQ;
  50. typedef struct MsgPort          MPORT;
  51. typedef struct IntuitionBase    IBASE;
  52.  
  53.  
  54. /*
  55.  * By making an Array of these, you can write a short routine to open
  56.  * and close the libraries.  This saves memory and makes it easy to
  57.  * open an additional library/base.  I tried to use LIBRARY ** intead
  58.  * of APTR *, but the compiler complained.
  59.  */
  60. typedef struct {
  61.         char    *name;
  62.         APTR    *base;
  63. } LIBDEFS;
  64.  
  65. /*
  66.  * By making an Array of these, you can use a simple/short routine to
  67.  * create GadTools gadgets.  These fields are copied into the NewGadget
  68.  * structure.
  69.  */
  70. typedef struct GADDEF {
  71.         TAGS    *tags;
  72.         ULONG   kind;
  73.         UWORD   left,top,width,height;
  74.         ULONG   flags;
  75.         char    *text;
  76. } GADDEF;
  77.  
  78. /*
  79.  * IDCMP flags.  GADIDCMP are those for GadTools, MYIDCMP are the ones I personally want.
  80.  */
  81. #define GADIDCMP        (SLIDERIDCMP|STRINGIDCMP|BUTTONIDCMP|CYCLEIDCMP|LISTVIEWIDCMP)
  82. #define MYIDCMP         (IDCMP_VANILLAKEY|IDCMP_RAWKEY|IDCMP_REFRESHWINDOW)|GADIDCMP|CLOSEWINDOW
  83.  
  84. extern char     prefFontName[];         // name of preference font (defaults to grn.font)
  85. extern UWORD    prefFontSize;           // defaults to 8
  86. extern UWORD    prefWidth, prefHeight;  // 640x400 or whatever is in tooltypes
  87. extern UWORD    prefTop, prefLeft;      // defaults to right edge of screen!
  88.  
  89. extern short    screenHeight, screenWidth, screenTop;
  90. extern RECT     oscanRect;
  91.  
  92. extern IBASE    *IntuitionBase;
  93. extern LIBRARY  *GfxBase;
  94. extern LIBRARY  *DiskfontBase;
  95. extern LIBRARY  *AslBase;
  96. extern LIBRARY  *GadToolsBase;
  97. extern LIBRARY  *WorkbenchBase;
  98. extern LIBRARY  *IconBase;
  99. extern LIBRARY  *CxBase;
  100.  
  101. extern VINFO    *vi;
  102. extern SCREEN   *screen;
  103. extern VPORT    *vp;
  104. extern RPORT    *rp;
  105.  
  106. extern FONT     *defaultFont, *topaz80Font;
  107. extern RPORT    *topazRP;
  108.  
  109. void    t_printf();
  110. void    EventHandler();
  111.  
  112. void    CloseLibs (LIBDEFS libDefs[]);
  113. void    OpenLibs (LIBDEFS libDefs[]);
  114. GADGET *CreateGadgets(GADGET *gadArray[], GADDEF gadDefs[]);
  115. short   TextLen (RPORT *rp, char *txt);
  116. void    InitSystem (void);
  117. void    CloseSystem (void);
  118. WINDOW *CreateWindow(GADGET *gList, short left, short top, short width,
  119.                                     short height, char *title);
  120. void    DefaultIDCMPFunc (WINDOW *window, IMSG *m);
  121. int     OutputStrings (const int fd, const char *str, ...);
  122. int     Editor (const char *filename, const char *editor);
  123. char   *TempName (void);
  124. int     CopyStrings (char *dest, const char *str, ...);
  125. char   *itoa (const long i);
  126. void    PostNews (const int followupFlag, const char *filename);
  127. void    SendMail (const char *filename);
  128.