home *** CD-ROM | disk | FTP | other *** search
- unit ReqTools;
-
- INTERFACE
- uses Exec, AmigaDOS, Graphics, Intuition, Utility;
-
-
- type
- prtReqInfo = ^trtReqInfo;
- trtReqInfo = record
- ReqPos: long;
- LeftOffset: word;
- TopOffset: word;
- Width: long;
- ReqTitle: pbyte;
- Flags: long;
- DefaultFont: pTextFont;
- WaitPointer: long;
- end;
-
- prtHandlerInfo = ^trtHandlerInfo;
- trtHandlerInfo = record
- private1: long;
- WaitMask: long;
- DoNotWait: long;
- end;
-
- prtFileList = ^trtFileList;
- trtFileList = record
- Next: prtFileList;
- StrLen: long;
- Name: pbyte;
- end;
-
- prtFileRequester = ^trtFileRequester;
- trtFileRequester = record
- ReqPos: long;
- LeftOffset: word;
- TopOffset: word;
- Flags: long;
- Hook: pHook;
- Dir: pbyte;
- MatchPat: pbyte;
- DefaultFont: pTextFont;
- WaitPointer: long;
- end;
-
- prtFontRequester = ^trtFontRequester;
- trtFontRequester = record
- ReqPos: long;
- LeftOffset: word;
- TopOffset: word;
- Flags: long;
- Hook: pHook;
- Attr: tTextAttr;
- DefaultFont: pTextFont;
- WaitPointer: long;
- end;
-
- pReqToolsBase = ^tReqToolsBase;
- tReqToolsBase = record
- LibNode: tLibrary;
- Flags: byte;
- pad: array [0..2] of byte;
- SegList: BPTR;
- IntuitionBase: pIntuitionBase;
- GfxBase: pGfxBase;
- DOSBase: pDosLibrary;
- GadToolsBase: pLibrary;
- UtilityBase: pLibrary;
- end;
-
-
-
- var
- ReqToolsBase: pReqToolsBase;
-
-
- const
- RTFI_OkText = $8000002A;
- RTFO_Height = $80000029;
- FREQB_DOWILDFUNC = $B;
- FREQF_CHANGEPALETTE = $80;
- REQPOS_POINTER = 0;
- FREQB_FIXEDWIDTH = 5;
- RTEZ_Flags = $80000016;
- RTFO_FontHeight = $80000040;
- RTFO_SampleHeight = $8000003C;
- FREQB_SELECTDIRS = $C;
- FREQF_DOWILDFUNC = $800;
- RTFO_OkText = $8000002A;
- FREQF_FIXEDWIDTH = $20;
- RT_IDCMPFlags = $80000002;
- RTPA_Color = $80000046;
- EZREQB_NORETURNKEY = 0;
- FREQF_SELECTDIRS = $1000;
- RTGL_Width = $80000020;
- EZREQF_NORETURNKEY = 1;
- REQHOOK_WILDFILE = 0;
- REQTOOLSNAME = 'reqtools.library';
- EZREQB_CENTERTEXT = 2;
- RT_TagBase = $80000000;
- FREQB_SCALE = 9;
- EZREQF_CENTERTEXT = 4;
- RTEZ_ReqTitle = $80000014;
- RTGS_Width = $80000020;
- RTGL_ShowDefault = $80000021;
- FREQF_SCALE = $200;
- RT_PubScrName = $80000006;
- RTRH_EndRequest = $8000003C;
- FREQB_COLORFONTS = 6;
- REQPOS_TOPLEFTSCR = 4;
- FREQF_COLORFONTS = $40;
- RTFO_FontStyle = $80000041;
- REQHOOK_WILDFONT = 1;
- REQPOS_TOPLEFTWIN = 3;
- REQPOS_CENTERSCR = 2;
- RTGS_AllowEmpty = $80000050;
- RTFI_RemoveEntry = $80000035;
- REQ_CANCEL = 0;
- FREQB_LEAVEPALETTE = 8;
- REQPOS_CENTERWIN = 1;
- FREQF_LEAVEPALETTE = $100;
- RT_ReqHandler = $80000008;
- FREQB_NOBUFFER = 2;
- RT_ReqPos = $80000003;
- FREQF_NOBUFFER = 4;
- FREQB_STYLE = $A;
- RTEZ_DefaultResponse = $80000017;
- RT_LeftOffset = $80000004;
- FREQB_SAVE = 1;
- FREQF_STYLE = $400;
- RT_Screen = $80000007;
- FREQF_SAVE = 2;
- RT_DefaultFont = $80000009;
- REQTOOLSVERSION = $25;
- RT_TopOffset = $80000005;
- RT_FILEREQ = 0;
- EZREQB_LAMIGAQUAL = 1;
- REQ_OK = 1;
- EZREQF_LAMIGAQUAL = 2;
- RTFI_MatchPat = $80000033;
- CALL_HANDLER = $80000000;
- FREQB_NOFILES = 3;
- RT_Window = $80000001;
- RTFI_Dir = $80000032;
- RT_REQINFO = 1;
- FREQF_NOFILES = 8;
- RTFI_AddEntry = $80000034;
- FREQB_PATGAD = 4;
- RTFI_Flags = $80000028;
- RT_WaitPointer = $8000000A;
- RTFO_MinHeight = $8000003D;
- RTFO_FontName = $8000003F;
- FREQF_PATGAD = $10;
- RTFO_MaxHeight = $8000003E;
- RTGL_Min = $8000001E;
- FREQB_MULTISELECT = 0;
- RTFO_Flags = $80000028;
- RTGL_Max = $8000001F;
- RTFI_Height = $80000029;
- RT_FONTREQ = 2;
- RTFO_FontFlags = $80000042;
- FREQF_MULTISELECT = 1;
- FREQB_CHANGEPALETTE = 7;
-
-
- function rtAllocRequestA
- (type_: long;
- taglist: pTagItem): pointer;
-
- procedure rtFreeRequest (req: pointer);
- procedure rtFreeReqBuffer (req: pointer);
- function rtChangeReqAttrA
- (req: pointer;
- taglist: pTagItem): longint;
-
- function rtFileRequestA
- (filereq: prtFileRequester;
- file_: STRPTR;
- title: STRPTR;
- taglist: pTagItem): pointer;
-
- procedure rtFreeFileList (filelist: prtFileList);
- function rtEZRequestA
- (bodyfmt: STRPTR;
- gadfmt: STRPTR;
- reqinfo: prtReqInfo;
- argarray: pointer;
- taglist: pTagItem): long;
-
- function rtGetStringA
- (buffer: pbyte;
- maxchars: long;
- title: STRPTR;
- reqinfo: prtReqInfo;
- taglist: pTagItem): long;
-
- function rtGetLongA
- (longptr: plong;
- title: STRPTR;
- reqinfo: prtReqInfo;
- taglist: pTagItem): long;
-
- function rtFontRequestA
- (fontreq: prtFontRequester;
- title: STRPTR;
- taglist: pTagItem): boolean;
-
- function rtPaletteRequestA
- (title: STRPTR;
- reqinfo: prtReqInfo;
- taglist: pTagItem): longint;
-
- function rtReqHandlerA
- (handlerinfo: prtHandlerInfo;
- sigs: long;
- taglist: pTagItem): long;
-
- procedure rtSetWaitPointer (window: pWindow);
- function rtGetVScreenSize
- (screen: pScreen;
- widthptr: plong;
- heightptr: plong): long;
-
- procedure rtSetReqPosition
- (reqpos: long;
- newwindow: pNewWindow;
- screen: pScreen;
- window: pWindow);
-
- procedure rtSpread
- (posarray: plong;
- sizearray: plong;
- length: long;
- min: long;
- max: long;
- num: long);
-
- procedure rtScreenToFrontSafely (screen: pScreen);
-
-
- IMPLEMENTATION
- function rtAllocRequestA; xassembler;
- asm
- move.l a6,-(sp)
- lea 8(sp),a6
- move.l (a6)+,a0
- move.l (a6)+,d0
- move.l ReqToolsBase,a6
- jsr -$1E(a6)
- move.l d0,$10(sp)
- move.l (sp)+,a6
- end;
-
- procedure rtFreeRequest; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a1
- move.l ReqToolsBase,a6
- jsr -$24(a6)
- move.l (sp)+,a6
- end;
-
- procedure rtFreeReqBuffer; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a1
- move.l ReqToolsBase,a6
- jsr -$2A(a6)
- move.l (sp)+,a6
- end;
-
- function rtChangeReqAttrA; xassembler;
- asm
- move.l a6,-(sp)
- movem.l 8(sp),a0-a1
- move.l ReqToolsBase,a6
- jsr -$30(a6)
- move.l d0,$10(sp)
- move.l (sp)+,a6
- end;
-
- function rtFileRequestA; xassembler;
- asm
- movem.l a2-a3/a6,-(sp)
- lea $10(sp),a6
- move.l (a6)+,a0
- move.l (a6)+,a3
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l ReqToolsBase,a6
- jsr -$36(a6)
- move.l d0,$20(sp)
- movem.l (sp)+,a2-a3/a6
- end;
-
- procedure rtFreeFileList; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l ReqToolsBase,a6
- jsr -$3C(a6)
- move.l (sp)+,a6
- end;
-
- function rtEZRequestA; xassembler;
- asm
- movem.l a2-a4/a6,-(sp)
- lea $14(sp),a6
- move.l (a6)+,a0
- move.l (a6)+,a4
- move.l (a6)+,a3
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l ReqToolsBase,a6
- jsr -$42(a6)
- move.l d0,$28(sp)
- movem.l (sp)+,a2-a4/a6
- end;
-
- function rtGetStringA; xassembler;
- asm
- movem.l a2-a3/a6,-(sp)
- lea $10(sp),a6
- move.l (a6)+,a0
- move.l (a6)+,a3
- move.l (a6)+,a2
- move.l (a6)+,d0
- move.l (a6)+,a1
- move.l ReqToolsBase,a6
- jsr -$48(a6)
- move.l d0,$24(sp)
- movem.l (sp)+,a2-a3/a6
- end;
-
- function rtGetLongA; xassembler;
- asm
- movem.l a2-a3/a6,-(sp)
- lea $10(sp),a6
- move.l (a6)+,a0
- move.l (a6)+,a3
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l ReqToolsBase,a6
- jsr -$4E(a6)
- move.l d0,$20(sp)
- movem.l (sp)+,a2-a3/a6
- end;
-
- function rtFontRequestA; xassembler;
- asm
- movem.l a3/a6,-(sp)
- lea $C(sp),a6
- move.l (a6)+,a0
- move.l (a6)+,a3
- move.l (a6)+,a1
- move.l ReqToolsBase,a6
- jsr -$60(a6)
- tst.l d0
- sne d0
- neg.b d0
- move.b d0,$18(sp)
- movem.l (sp)+,a3/a6
- end;
-
- function rtPaletteRequestA; xassembler;
- asm
- movem.l a2-a3/a6,-(sp)
- lea $10(sp),a6
- move.l (a6)+,a0
- move.l (a6)+,a3
- move.l (a6)+,a2
- move.l ReqToolsBase,a6
- jsr -$66(a6)
- move.l d0,$1C(sp)
- movem.l (sp)+,a2-a3/a6
- end;
-
- function rtReqHandlerA; xassembler;
- asm
- move.l a6,-(sp)
- lea 8(sp),a6
- move.l (a6)+,a0
- move.l (a6)+,d0
- move.l (a6)+,a1
- move.l ReqToolsBase,a6
- jsr -$6C(a6)
- move.l d0,$14(sp)
- move.l (sp)+,a6
- end;
-
- procedure rtSetWaitPointer; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l ReqToolsBase,a6
- jsr -$72(a6)
- move.l (sp)+,a6
- end;
-
- function rtGetVScreenSize; xassembler;
- asm
- movem.l a2/a6,-(sp)
- lea $C(sp),a6
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l ReqToolsBase,a6
- jsr -$78(a6)
- move.l d0,$18(sp)
- movem.l (sp)+,a2/a6
- end;
-
- procedure rtSetReqPosition; xassembler;
- asm
- movem.l a2/a6,-(sp)
- lea $C(sp),a6
- move.l (a6)+,a2
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l (a6)+,d0
- move.l ReqToolsBase,a6
- jsr -$7E(a6)
- movem.l (sp)+,a2/a6
- end;
-
- procedure rtSpread; xassembler;
- asm
- movem.l d3/a6,-(sp)
- lea $C(sp),a6
- move.l (a6)+,d3
- move.l (a6)+,d2
- move.l (a6)+,d1
- move.l (a6)+,d0
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l ReqToolsBase,a6
- jsr -$84(a6)
- movem.l (sp)+,d3/a6
- end;
-
- procedure rtScreenToFrontSafely; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l ReqToolsBase,a6
- jsr -$8A(a6)
- move.l (sp)+,a6
- end;
-
- end.
-