home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / include / libraries / reqtools.h < prev    next >
C/C++ Source or Header  |  1993-08-25  |  20KB  |  634 lines

  1. #ifndef LIBRARIES_REQTOOLS_H
  2. #define LIBRARIES_REQTOOLS_H
  3. /*
  4. **    $Filename: libraries/reqtools.h $
  5. **    $Release: 2.1 $
  6. **    $Revision: 38.10 $
  7. **
  8. **    reqtools.library definitions
  9. **
  10. **    (C) Copyright 1991-1993 Nico François
  11. **    All Rights Reserved
  12. */
  13.  
  14. #ifndef    EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif    /* EXEC_TYPES_H */
  17.  
  18. #ifndef    EXEC_LISTS_H
  19. #include <exec/lists.h>
  20. #endif    /* EXEC_LISTS_H */
  21.  
  22. #ifndef    EXEC_LIBRARIES_H
  23. #include <exec/libraries.h>
  24. #endif    /* EXEC_LIBRARIES_H */
  25.  
  26. #ifndef    EXEC_SEMAPHORES_H
  27. #include <exec/semaphores.h>
  28. #endif    /* EXEC_SEMAPHORES_H */
  29.  
  30. #ifndef LIBRARIES_DOS_H
  31. #include <libraries/dos.h>
  32. #endif  /* LIBRARIES_DOS_H */
  33.  
  34. #ifndef LIBRARIES_DOSEXTENS_H
  35. #include <libraries/dosextens.h>
  36. #endif  /* LIBRARIES_DOSEXTENS_H */
  37.  
  38. #ifndef LIBRARIES_DISKFONT_H
  39. #include <libraries/diskfont.h>
  40. #endif  /* LIBRARIES_DISKFONT_H */
  41.  
  42. #ifndef    GRAPHICS_TEXT_H
  43. #include <graphics/text.h>
  44. #endif    /* GRAPHICS_TEXT_H */
  45.  
  46. #ifndef UTILITY_TAGITEM_H
  47. #include <utility/tagitem.h>
  48. #endif    /* UTILITY_TAGITEM_H */
  49.  
  50. #define    REQTOOLSNAME         "reqtools.library"
  51. #define    REQTOOLSVERSION         38L
  52.  
  53. /***********************
  54. *                      *
  55. *     Preferences      *
  56. *                      *
  57. ***********************/
  58.  
  59. #define RTPREF_FILEREQ         0L
  60. #define RTPREF_FONTREQ         1L
  61. #define RTPREF_PALETTEREQ     2L
  62. #define RTPREF_SCREENMODEREQ     3L
  63. #define RTPREF_VOLUMEREQ     4L
  64. #define RTPREF_OTHERREQ         5L
  65. #define RTPREF_NR_OF_REQ     6L
  66.  
  67. struct ReqDefaults {
  68.    ULONG Size;
  69.    ULONG ReqPos;
  70.    UWORD LeftOffset;
  71.    UWORD TopOffset;
  72.     UWORD MinEntries;
  73.     UWORD MaxEntries;
  74.    };
  75.  
  76. struct ReqToolsPrefs {
  77.    /* Size of preferences (_without_ this field and the semaphore) */
  78.    ULONG PrefsSize;
  79.    struct SignalSemaphore PrefsSemaphore;
  80.    /* Start of real preferences */
  81.    ULONG Flags;
  82.    struct ReqDefaults ReqDefaults[RTPREF_NR_OF_REQ];
  83.    };
  84.  
  85. #define RTPREFS_SIZE \
  86.    (sizeof (struct ReqToolsPrefs) - sizeof (struct SignalSemaphore) - 4)
  87.  
  88. /* Flags */
  89.  
  90. #define RTPRB_DIRSFIRST         0L
  91. #define RTPRF_DIRSFIRST         (1L<<RTPRB_DIRSFIRST)
  92. #define RTPRB_DIRSMIXED         1L
  93. #define RTPRF_DIRSMIXED         (1L<<RTPRB_DIRSMIXED)
  94. #define RTPRB_IMMSORT         2L
  95. #define RTPRF_IMMSORT         (1L<<RTPRB_IMMSORT)
  96. #define RTPRB_NOSCRTOFRONT     3L
  97. #define RTPRF_NOSCRTOFRONT     (1L<<RTPRB_NOSCRTOFRONT)
  98.  
  99. /***********************
  100. *                      *
  101. *     Library Base     *
  102. *                      *
  103. ***********************/
  104.  
  105. struct ReqToolsBase {
  106.    struct Library LibNode;
  107.    UBYTE RTFlags;
  108.    UBYTE pad[3];
  109.    BPTR SegList;
  110.  
  111.    /* PUBLIC FIELDS */
  112.  
  113.    /* NOTE: Some versions of the Manx C compiler contain a bug so it gets
  114.             confused by the library bases below.  Add the rt_ prefix to the
  115.             library names to fix the problem (e.g. rt_IntuitionBase). */
  116.  
  117.    /* The following library bases may be read and used by your program */
  118.    struct IntuitionBase *IntuitionBase;
  119.    struct GfxBase *GfxBase;
  120.    struct DosLibrary *DOSBase;
  121.    /* Next two library bases are only (and always) valid on Kickstart 2.0!
  122.       (1.3 version of reqtools also initializes these when run on 2.0) */
  123.    struct Library *GadToolsBase;
  124.    struct Library *UtilityBase;
  125.  
  126.    /* PRIVATE FIELDS, THESE WILL CHANGE FROM RELEASE TO RELEASE! */
  127.  
  128.    /* The RealOpenCnt is for the buffered AvailFonts feature.  Since
  129.       Kickstart 3.0 offers low memory handlers a release of ReqTools for 3.0
  130.       will not use this field and start using the normal OpenCnt again. */
  131.    UWORD RealOpenCnt;
  132.    UWORD AvailFontsLock;
  133.    struct AvailFontsHeader *AvailFontsHeader;
  134.    ULONG FontsAssignType;
  135.    BPTR FontsAssignLock;
  136.    struct AssignList *FontsAssignList;
  137.    struct ReqToolsPrefs ReqToolsPrefs;
  138.    UWORD prefspad;
  139.    };
  140.  
  141. /* types of requesters, for rtAllocRequestA() */
  142. #define RT_FILEREQ         0L
  143. #define RT_REQINFO         1L
  144. #define RT_FONTREQ         2L
  145. /* (V38) */
  146. #define RT_SCREENMODEREQ     3L
  147.  
  148. /***********************
  149. *                      *
  150. *    File requester    *
  151. *                      *
  152. ***********************/
  153.  
  154. /* structure _MUST_ be allocated with rtAllocRequest() */
  155.  
  156. struct rtFileRequester {
  157.    ULONG ReqPos;
  158.    UWORD LeftOffset;
  159.    UWORD TopOffset;
  160.    ULONG Flags;
  161.    /* OBSOLETE IN V38! DON'T USE! */ struct Hook *Hook;
  162.    /* */
  163.    char  *Dir;             /* READ ONLY! Change with rtChangeReqAttrA()! */
  164.    char  *MatchPat;         /* READ ONLY! Change with rtChangeReqAttrA()! */
  165.    /* */
  166.    struct TextFont *DefaultFont;
  167.    ULONG WaitPointer;
  168.    /* (V38) */
  169.    ULONG LockWindow;
  170.    ULONG ShareIDCMP;
  171.    struct Hook *IntuiMsgFunc;
  172.    UWORD reserved1;
  173.    UWORD reserved2;
  174.    UWORD reserved3;
  175.    UWORD ReqHeight;         /* READ ONLY!  Use RTFI_Height tag! */
  176.    /* Private data follows! HANDS OFF :-) */
  177.    };
  178.  
  179. /* returned by rtFileRequestA() if multiselect is enabled,
  180.    free list with rtFreeFileList() */
  181.  
  182. struct rtFileList {
  183.    struct rtFileList *Next;
  184.    ULONG StrLen;         /* -1 for directories */
  185.    char *Name;
  186.    };
  187.  
  188. /* structure passed to RTFI_FilterFunc callback hook by
  189.    volume requester (see RTFI_VolumeRequest tag) */
  190.  
  191. struct rtVolumeEntry {
  192.    ULONG Type;             /* DLT_DEVICE or DLT_DIRECTORY */
  193.    char *Name;
  194.    };
  195.  
  196. /***********************
  197. *                      *
  198. *    Font requester    *
  199. *                      *
  200. ***********************/
  201.  
  202. /* structure _MUST_ be allocated with rtAllocRequest() */
  203.  
  204. struct rtFontRequester {
  205.    ULONG ReqPos;
  206.    UWORD LeftOffset;
  207.    UWORD TopOffset;
  208.    ULONG Flags;
  209.    /* OBSOLETE IN V38! DON'T USE! */ struct Hook *Hook;
  210.    /* */
  211.    struct TextAttr Attr;     /* READ ONLY! */
  212.    /* */
  213.    struct TextFont *DefaultFont;
  214.    ULONG WaitPointer;
  215.    /* (V38) */
  216.    ULONG LockWindow;
  217.    ULONG ShareIDCMP;
  218.    struct Hook *IntuiMsgFunc;
  219.    UWORD reserved1;
  220.    UWORD reserved2;
  221.    UWORD reserved3;
  222.    UWORD ReqHeight;         /* READ ONLY!  Use RTFO_Height tag! */
  223.    /* Private data follows! HANDS OFF :-) */
  224.    };
  225.  
  226. /*************************
  227. *                        *
  228. *  ScreenMode requester  *
  229. *                        *
  230. *************************/
  231.  
  232. /* structure _MUST_ be allocated with rtAllocRequest() */
  233.  
  234. struct rtScreenModeRequester {
  235.    ULONG ReqPos;
  236.    UWORD LeftOffset;
  237.    UWORD TopOffset;
  238.    ULONG Flags;
  239.    ULONG private1;
  240.    /* */
  241.    ULONG DisplayID;         /* READ ONLY! */
  242.    UWORD DisplayWidth;         /* READ ONLY! */
  243.    UWORD DisplayHeight;         /* READ ONLY! */
  244.    /* */
  245.    struct TextFont *DefaultFont;
  246.    ULONG WaitPointer;
  247.    ULONG LockWindow;
  248.    ULONG ShareIDCMP;
  249.    struct Hook *IntuiMsgFunc;
  250.    UWORD reserved1;
  251.    UWORD reserved2;
  252.    UWORD reserved3;
  253.    UWORD ReqHeight;         /* READ ONLY!  Use RTSC_Height tag! */
  254.    /* */
  255.    UWORD DisplayDepth;         /* READ ONLY! */
  256.    UWORD OverscanType;         /* READ ONLY! */
  257.    ULONG AutoScroll;         /* READ ONLY! */
  258.    /* Private data follows! HANDS OFF :-) */
  259.    };
  260.  
  261. /***********************
  262. *                      *
  263. *    Requester Info    *
  264. *                      *
  265. ***********************/
  266.  
  267. /* for rtEZRequestA(), rtGetLongA(), rtGetStringA() and rtPaletteRequestA(),
  268.    _MUST_ be allocated with rtAllocRequest() */
  269.  
  270. struct rtReqInfo {
  271.    ULONG ReqPos;
  272.    UWORD LeftOffset;
  273.    UWORD TopOffset;
  274.    ULONG Width;             /* not for rtEZRequestA() */
  275.    char *ReqTitle;         /* currently only for rtEZRequestA() */
  276.    ULONG Flags;
  277.    struct TextFont *DefaultFont; /* currently only for rtPaletteRequestA() */
  278.    ULONG WaitPointer;
  279.    /* (V38) */
  280.    ULONG LockWindow;
  281.    ULONG ShareIDCMP;
  282.    struct Hook *IntuiMsgFunc;
  283.    /* structure may be extended in future */
  284.    };
  285.  
  286. /***********************
  287. *                      *
  288. *     Handler Info     *
  289. *                      *
  290. ***********************/
  291.  
  292. /* for rtReqHandlerA(), will be allocated for you when you use
  293.    the RT_ReqHandler tag, never try to allocate this yourself! */
  294.  
  295. struct rtHandlerInfo {
  296.    ULONG private1;
  297.    ULONG WaitMask;
  298.    ULONG DoNotWait;
  299.    /* Private data follows, HANDS OFF :-) */
  300.    };
  301.  
  302. /* possible return codes from rtReqHandlerA() */
  303.  
  304. #define CALL_HANDLER         (ULONG)0x80000000
  305.  
  306.  
  307. /*************************************
  308. *                                    *
  309. *                TAGS                *
  310. *                                    *
  311. *************************************/
  312.  
  313. #define RT_TagBase         TAG_USER
  314.  
  315. /*** tags understood by most requester functions ***
  316. */
  317. /* optional pointer to window */
  318. #define RT_Window         (RT_TagBase+1)
  319. /* idcmp