home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / new / amigalibdisks / d996 / startup-menu / source / reqtools.pas < prev    next >
Pascal/Delphi Source File  |  1994-04-05  |  27KB  |  1,093 lines

  1.  
  2. {        ReqTools (V38) interface for HSPascal         }
  3. {                                                      }
  4. { ReqTools is (C) Copyright 1991/1992 by Nico François }
  5. {                                                      }
  6. {  HSPascal interface v1.2 © 1992 by Gunter Indenhoek  }
  7.  
  8. Unit ReqTools;
  9.  
  10. Interface
  11. Uses Exec,AmigaDOS,Intuition,Graphics,Init,Utility;
  12.  
  13. Const
  14.     
  15.     REQTOOLSNAME = 'reqtools.library';
  16.     REQTOOLSVERSION = 38;
  17.  
  18. Type
  19.  
  20. { for Dosnames like Dir, Fontnames, etc. }
  21.  
  22.     pString = ^tString;
  23.     tString = String;
  24.  
  25. { array to pass your arguments to EZRequestA() }
  26.  
  27.     argarray = array[0..31] of LongInt;
  28.  
  29. { array to pass your flags to reqtools-requesters }
  30.  
  31.     preqtaglist = ^treqtaglist;
  32.  
  33.     treqtaglist = array[0..32] of tTagItem;
  34.  
  35. { library - base }
  36.  
  37.     pReqToolsBase = ^tReqToolsBase;
  38.  
  39.     tReqToolsBase = 
  40.         Record
  41.             Lib_Node: pLibrary;
  42.             Flags: ShortInt;
  43.             Pad: Array[0..2] of ShortInt;
  44.             SegList: BPTR;
  45.             { The following library bases may be read and used by your program }
  46.             IntuitionBase: ^tIntuitionBase;
  47.             GfxBase: ^tGfxBase;
  48.             DOSBase: ^tDosLibrary;
  49.             { Next two library bases are only (and always) valid on Kickstart 2.0!
  50.               (1.3 version of reqtools also initializes these when run on 2.0) }
  51.             GadToolsBase: pLibrary;
  52.             UtilityBase: pLibrary;
  53.         end;
  54.  
  55. Const
  56.  
  57. { types of requesters, for rtAllocRequestA() }
  58.  
  59.     RT_FILEREQ = 0;
  60.     RT_REQINFO = 1;
  61.     RT_FONTREQ = 2;
  62.     { (V38) }
  63.     RT_SCREENMODEREQ = 3;
  64.  
  65. {***********************
  66. *                      *
  67. *    File requester    *
  68. *                      *
  69. ***********************}
  70.  
  71. type
  72.  
  73. { structure _MUST_ be allocated with rtAllocRequest() }
  74.  
  75.     prtFileRequester = ^trtFileRequester;
  76.  
  77.     trtFileRequester = Record
  78.         ReqPos: LongInt;
  79.         LeftOffset: Integer;
  80.         TopOffset: Integer;
  81.         Flags: LongInt;
  82.         { OBSOLETE IN V38! DON'T USE! } Hook: pHook;
  83.         Dir: pString;             { READ ONLY! Change with rtChangeReqAttrA()! }
  84.         MatchPat: pString;     { READ ONLY! Change with rtChangeReqAttrA()! }
  85.         DefaultFont: pTextFont;
  86.         WaitPointer: LongInt;
  87.         { (V38) }
  88.         LockWindow: LongInt;
  89.         ShareIDCMP: LongInt;
  90.         IntuiMsgFunc: pHook;
  91.         reserved1: Integer;
  92.         reserved2: Integer;
  93.         reserved3: Integer;
  94.         ReqHeight: Integer;        { READ ONLY! Use RTFI_Height tag! }
  95.         { Private data follows! HANDS OFF }
  96.     end;
  97.  
  98. { returned by rtFileRequestA() if multiselect is enabled,
  99.   free list with rtFreeFileList() }
  100.  
  101.     prtFileList = ^trtFileList;
  102.  
  103.     trtFileList = Record
  104.         Next: prtFileList;
  105.         StrLen: LongInt;        { -1 for directories }
  106.         Name: pString;
  107.     end;
  108.  
  109. {***********************
  110. *                      *
  111. *    Font requester    *
  112. *                      *
  113. ***********************}
  114.  
  115. { structure _MUST_ be allocated with rtAllocRequest() }
  116.  
  117.     prtFontRequester = ^trtFontRequester;
  118.  
  119.     trtFontRequester = Record
  120.         ReqPos: LongInt;
  121.         LeftOffset: Integer;
  122.         TopOffset: Integer;
  123.         Flags: LongInt;
  124.         { OBSOLETE IN V38! DON'T USE! } Hook: pHook;
  125.         Attr: tTextAttr; { READ ONLY! }
  126.         DefaultFont: pTextFont;
  127.         WaitPointer: LongInt;
  128.         { (V38) }
  129.         LockWindow: LongInt;
  130.         ShareIDCMP: LongInt;
  131.         IntuiMsgFunc: pHook;
  132.         reserved1: Integer;
  133.         reserved2: Integer;
  134.         reserved3: Integer;
  135.         ReqHeight: Integer; { READ ONLY!  Use RTFO_Height tag! }
  136.         { Private data follows! HANDS OFF }
  137.     end;
  138.  
  139. {*************************
  140. *                        *
  141. *  ScreenMode requester  *
  142. *                        *
  143. *************************}
  144.  
  145. { structure _MUST_ be allocated with rtAllocRequest() }
  146.  
  147.     prtScreenModeRequester = ^trtScreenModeRequester;
  148.  
  149.     trtScreenModeRequester = Record
  150.         ReqPos: LongInt;
  151.         LeftOffset: Integer;
  152.         TopOffset: Integer;
  153.         Flags: LongInt;
  154.         private1: LongInt;
  155.         DisplayID: LongInt;        { READ ONLY! }
  156.         DisplayWidth: Integer;    { READ ONLY! }
  157.         DisplayHeight: Integer;    { READ ONLY! }
  158.         DefaultFont: pTextFont;
  159.         WaitPointer: LongInt;
  160.         LockWindow: LongInt;
  161.         ShareIDCMP: LongInt;
  162.         IntuiMsgFunc: pHook;
  163.         reserved1: Integer;
  164.         reserved2: Integer;
  165.         reserved3: Integer;
  166.         ReqHeight: Integer;        { READ ONLY!  Use RTSC_Height tag! }
  167.         DisplayDepth: Integer;    { READ ONLY! }
  168.         OverscanType: Integer;    { READ ONLY! }
  169.         AutoScroll: LongInt;        { READ ONLY! }
  170.         { Private data follows! HANDS OFF }
  171.     end;
  172.  
  173. {***********************
  174. *                      *
  175. *    Requester Info    *
  176. *                      *
  177. ***********************}
  178.  
  179. { for rtEZRequestA(), rtGetLongA(), rtGetStringA() and rtPaletteRequestA(),
  180.    _MUST_ be allocated with rtAllocRequest() }
  181.  
  182.     prtReqInfo = ^ trtReqInfo;
  183.  
  184.     trtReqInfo = Record
  185.         ReqPos: LongInt;
  186.         LeftOffset: Integer;
  187.         TopOffset: Integer;
  188.         Width: LongInt;                { not for rtEZRequestA() }
  189.         ReqTitle: pString;            { currently only for rtEZRequestA() }
  190.         Flags: LongInt;                { currently only for rtEZRequestA() }
  191.         DefaultFont: pTextFont;        { currently only for rtPaletteRequestA() }
  192.         WaitPointer: LongInt;
  193.         { (V38) }
  194.         LockWindow: LongInt;
  195.         ShareIDCMP: LongInt;
  196.         IntuiMsgFunc: pHook;
  197.         { structure may be extended in future }
  198.     end;
  199.  
  200. {***********************
  201. *                      *
  202. *     Handler Info     *
  203. *                      *
  204. ***********************}
  205.  
  206. { for rtReqHandlerA(), will be allocated for you when you use
  207.    the RT_ReqHandler tag, never try to allocate this yourself! }
  208.  
  209.     prtHandlerInfo = ^trtHandlerInfo;
  210.  
  211.     trtHandlerInfo = Record
  212.         private1: LongInt;
  213.         WaitMask: LongInt;
  214.         DoNotWait: LongInt;
  215.        { Private data follows, HANDS OFF }
  216.     end;
  217.  
  218. Const
  219.  
  220. { possible return codes from rtReqHandlerA() }
  221.  
  222.     CALL_HANDLER = $80000000;
  223.  
  224. {*************************************
  225. *                                    *
  226. *                TAGS                *
  227. *                                    *
  228. *************************************}
  229.  
  230.     RT_TagBase = TAG_USER;
  231.  
  232. { *** tags understood by most requester functions *** }
  233. { Optional pointer to window }
  234.     RT_Window = $80000001;
  235. { idcmp flags requester should abort on (useful for IDCMP_DISKINSERTED) }
  236.     RT_IDCMPFlags = $80000002;
  237. { position of requester window (see below) - default REQPOS_POINTER }
  238.     RT_ReqPos = $80000003;
  239. { signal mask to wait for abort signal }
  240.     RT_LeftOffset = $80000004;
  241. { topedge offset of requester relative to position specified by RT_ReqPos }
  242.     RT_TopOffset = $80000005;
  243. { name of public screen to put requester on (Kickstart 2.0 only!) }
  244.     RT_PubScrName = $80000006;
  245. { address of screen to put requester on }
  246.     RT_Screen = $80000007;
  247. { tagdata must hold the address of (!) an APTR variable }
  248.     RT_ReqHandler = $80000008;
  249. { font to use when screen font is rejected, _MUST_ be fixed-width font!
  250.    ( pTextFont , not pTextAttr )
  251.    - default GfxBase^.DefaultFont }
  252.     RT_DefaultFont = $80000009;
  253. { boolean to set the standard wait pointer in window - default FALSE }
  254.     RT_WaitPointer = $8000000A;
  255. { (V38) char preceding keyboard shortcut characters (will be underlined) }
  256.     RT_Underscore = $8000000B;
  257. { (V38) share IDCMP port with window - default FALSE }
  258.     RT_ShareIDCMP = $8000000C;
  259. { (V38) lock window and set standard wait pointer - default FALSE }
  260.     RT_LockWindow = $8000000D;
  261. { (V38) boolean to make requester's screen pop to front - default TRUE }
  262.     RT_ScreenToFront = $8000000E;
  263. { (V38) Requester should use this font - default: screen font }
  264.     RT_TextAttr = $8000000F;
  265. { (V38) call this hook for every IDCMP message not for requester }
  266.     RT_IntuiMsgFunc = $80000010;
  267. { (V38) Locale ReqTools should use for text }
  268.     RT_Locale = $80000011;
  269.  
  270. { *** tags specific to rtEZRequestA *** }
  271. { title of requester window - english default "Request" or "Information" }
  272.     RTEZ_ReqTitle = $80000014;
  273. { ($80000015) reserved }
  274. { various flags (see below) }
  275.     RTEZ_Flags = $80000016;
  276. { default response (activated by pressing RETURN) - default TRUE }
  277.     RTEZ_DefaultResponse = $80000017;
  278.  
  279. { *** tags specific to rtGetLongA *** }
  280. { minimum allowed value - default MININT }
  281.     RTGL_Min = $8000001E;
  282. { maximum allowed value - default MAXINT }
  283.     RTGL_Max = $8000001F;
  284. { suggested width of requester window (in pixels) }
  285.     RTGL_Width = $80000020;
  286. { boolean to show the default value - default TRUE }
  287.     RTGL_ShowDefault = $80000021;
  288. { (V38) string with possible responses - english default " _Ok |_Cancel" }
  289.     RTGL_GadFmt = $80000022;
  290. { (V38) optional arguments for RTGL_GadFmt }
  291.     RTGL_GadFmtArgs = $80000023;
  292. { (V38) invisible typing - default FALSE }
  293.     RTGL_Invisible = $80000024;
  294. { (V38) window backfill - default TRUE }
  295.     RTGL_BackFill = $8