
; reqlibrary.i © 1988/1989 reserved by Colin Fox and Bruce Dawson */



_LVOCenter                 EQU   -30   ; (^NewWin, x, y) (a0, d0, d1)
_LVOSetSize                EQU   -36   ; (MaxLines, ViewLines) (d0, d1)
_LVOSetLocation            EQU   -42   ; (MaxVal, ViewSize, Value) (d0,d1,d2)
_LVOReadLocation           EQU   -48   ; (MaxVal, ViewSize, PotValue) (d0,d1,d2.w)
_LVOFormat                 EQU   -54   ; (Buffer, string, values) (a2, a0, a1)

_LVOFakeFunction1          EQU   -60   ; Old function.  Don't use.
_LVOFakeFunction2          EQU   -66   ; Old function.  Don't use.
_LVOFakeFunction3          EQU   -72   ; Old function.  Don't use.
_LVOFakeFunction4          EQU   -78   ; Old function.  Don't use.

_LVOFileRequester          EQU   -84   ; (^FileRequesterStructure)  (a0) ->d0
_LVOColorRequester         EQU   -90   ; (DesiredColor) (d0)
_LVODrawBox                EQU   -96   ; (rp,MinX,MinY,MaxX,MaxY) (a1,d0,d1,d2,d3)
_LVOMakeButton             EQU   -102  ; (Buf,Image,Image2,Width,Height,Depth)
                                       ; (a0    a1    a2     d0    d1    d2)
_LVOMakeScrollBar          EQU   -108  ; (Buffer,Flags,Size,X,Y) (a0,d0,d1,d2,d3)
_LVOPurgeFiles             EQU   -114  ; (^FileRequesterStruct) (a0)
_LVOGetFontHeightAndWidth  EQU   -120  ; ()  Width->d0  Height->d1
_LVOMakeGadget             EQU   -126  ; (Buffer, String, X, Y) (a0,a1,d0,d1)
_LVOMakeString             EQU   -132  ; (Buf,StrBuf,UndoBuf,MaxWid,MaxChar,X,Y)
                                       ; ( a0   a1     a2      d0     d1   d2 d3)
_LVOMakeProp               EQU   -138  ; (Buffer,Width,Height,Flags) (a0,d0,d1,d2)
_LVOLinkGadget             EQU   -144  ; (Buffer,String,^NewWin,X,Y) (a0,a1,a3,d0,d1) 
_LVOLinkStringGadget       EQU   -150  ; (Buf,StrBuf,UndoBuf,^nw,WidBits,NmChr,X,Y)
                                       ; (a0    a1     a2     a3   d0     d1  d2 d3)
_LVOLinkPropGadget         EQU   -156  ; (Buf,^nw,Wid,Height,Flags,LeftEdge,TopEdge)
                                       ; (a0   a3  d0     d1    d2     d3      d4)
_LVOGetString              EQU   -162  ; (Buf,title,window,visiblechars,maxchars)
                                       ; (a0   a1    a2      d0          d1)
_LVORealTimeScroll         EQU   -168  ; (^ScrollStructure) (a0)
_LVOTextRequest            EQU   -174  ; (^TRStructure) (a0)  ->d0
_LVOGetLong                EQU   -180  ; (^GetLongStruct) (a0)
_LVORawKeyToAscii          EQU   -186  ; (Code,Qualifier,IAddress) (d0,d1,a0)
_LVOExtendedColorRequester EQU   -192  ; (^ExtendedColorRequester) (a0)
_LVONewGetString           EQU   -198  ; (^GetStringStruct)  (a0)




ReqVersion   EQU                 1

PairsSize    EQU                 20


** STRUCTURE   GadgetBlock  OFFSET=0  **  a boolean button style text gadget

gb_Gadget   EQU   0
gb_Border   EQU   $2c
gb_Pairs    EQU   $3c
gb_Text     EQU   $50
gb_SIZEOF   EQU   $64

** STRUCTURE   StringBlock  OFFSET=0  **  a string gadget

sb_Gadget   EQU   $0
sb_Info     EQU   $2c
sb_Border   EQU   $50
sb_Pairs    EQU   $60
sb_SIZEOF   EQU   $74

** STRUCTURE   PropBlock  OFFSET=0  **  a prop gadget

pb_Gadget   EQU   $0
pb_Info     EQU   $2c
pb_Image    EQU   $42
pb_SIZEOF   EQU   $56

** STRUCTURE   SliderBlock  OFFSET=0  **  a slider (two arrows & a prop)

slb_ArrowUpLt  EQU   $0
slb_ImageUpLt  EQU   $2c
slb_ArrowDnRt  EQU   $40
slb_ImageDnRt  EQU   $6c
slb_Prop       EQU   $80    ;this is at the end for REFRESH GLIST purposes
slb_SIZEOF     EQU   $d6

** STRUCTURE   TwoImageBlock  OFFSET=0  **

tib_Gadget  EQU   $0
tib_Image1  EQU   $2c
tib_Image2  EQU   $40
tib_SIZEOF  EQU   $54

ATTITUDEB    EQU                 16 ;Bit# of the attitude bit.

HorizSlider  EQU                 0<<ATTITUDEB   ;which way the slider stands
VertSlider   EQU                 1<<ATTITUDEB   ;This is so that it bypasses all gadget flags.

;         This structure is used with the TextRequester function.

** STRUCTURE   TRStructure  OFFSET=0 **

TR_Text           EQU   $0    ; This is the message text, including printf()
                              ; style formatting if desired.
TR_Controls       EQU   $4    ; This is the address of the parameter list,
                              ; if printf() style formatting is used.
TR_Window         EQU   $8    ; This is an optional (zero if not used) pointer
                              ; to a window on the screen you 
                              ; would like the requester to show up on.
TR_MiddleText     EQU   $c    ; If set, text for gadget in middle (returns 2).
TR_PositiveText   EQU   $10      ; If set, text for gadget in left corner (returns 1).
TR_NegativeText   EQU   $14   ; If set, text for gadget in right (returns 0).
TR_Title          EQU   $18   ; This is the title for the window.
TR_KeyMask        EQU   $1c   ; Qualifier mask for the keyboard shortcuts.
                              ; Use $FFFF to allow any qualifiers (or none).
                              ; Zero means that no keyboard shortcuts are allowed.
TR_textcolor      EQU   $1e   ; Text Colour.  Uses Color 1 if no Color specified.
TR_detailcolor    EQU   $20   ; Detail and block color, as in NewWindow struct
TR_blockcolor     EQU   $22   ; If both are  zero, block pen will be set to 1.
TR_versionnumber  EQU   $24   ; Make SURE this is set to zero.
TR_rfu1           EQU   $26   ; Make SURE you leave these two zeroed also.
TR_rfu2           EQU   $2a   ; Make SURE you leave these two zeroed also.
TR_SIZEOF         EQU   $2e

;/* NOTE:
;
;    The  control  values  mentioned above are used if you choose to insert
;printf  style directives in your strings and should contain the address of
;a list of control parameters, usually on the stack.
;    */



;         This structure is for use with the GetLong function.

GLNODEFAULTB EQU                 0  ;Set this bit in the flags if you don't want a default
                                    ;value to show up in the get long string gadget.  For
                                    ;some things this is much better than having a zero
                                    ;show up.

GLNODEFAULTM EQU                 1<<GLNODEFAULTB

** STRUCTURE   GetLongStruct  OFFSET=0 **

gl_titlebar       EQU   $0
gl_defaultval     EQU   $4
gl_minlimit       EQU   $8
gl_maxlimit       EQU   $c
gl_result         EQU   $10
gl_window         EQU   $14
gl_versionnumber  EQU   $18      ;  Make SURE this is set to zero.
gl_flags          EQU   $1a      ;  Some, uh flags.  See above for bit definitions.
gl_rfu2           EQU   $1e      ;  Make SURE you leave these two zeroed also.
gl_SIZEOF         EQU   $22


** STRUCTURE   GetStringStruct  OFFSET=0  **

gs_titlebar       EQU   $0
gs_stringbuffer   EQU   $4
gs_window         EQU   $8
gs_stringsize     EQU   $c
gs_visiblesize    EQU   $e
gs_versionnumber  EQU   $10
gs_flags          EQU   $12
gs_rfu1           EQU   $16
gs_rfu2           EQU   $1a
gs_rfu3           EQU   $1e
gs_SIZEOF         EQU   $22


;         Remember,   if  you  don't  want  to  go  through  the  hassle  of
; initializing a ExtendedColorRequester structure, you can always just call
; ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester
; just  takes  a  single  parameter, in D0, the color that should start out
; being highlit.  It returns a single value, the color that was selected at
; the end.

;         This structure is for use with the ExtendedColorRequester (_not_,
; the ColorRequester) function.

** STRUCTURE   ExtendedColorRequesterStruct  OFFSET=0 **

ecr_defcolor   EQU   $0       ;The color that is initially highlit.
ecr_window     EQU   $4       ;The window the 'requester' opens up in (zero normally).
ecr_rfu1       EQU   $8       ;Who knows what these will be used for,
ecr_rfu2       EQU   $c       ;but I'm sure we'll think of something.
ecr_rfu3       EQU   $10      ;Until then, just keep these zeroed.
ecr_rfu4       EQU   $14      ;Okay?
ecr_rfu5       EQU   $18
ecr_SIZEOF     EQU   $1c



   IFND      DSIZE
DSIZE       EQU   130
FCHARS                           EQU   30
   ENDC

WILDLENGTH   EQU                 30

FRQSHOWINFOB      EQU   0        ; Set if you want .info files to show. Default hidden.
FRQEXTSELECTB     EQU   1        ; Set if you want extended select.  Default is not.
FRQCACHINGB       EQU   2        ; Set if you want directory caching.  Default is not.
FRQGETFONTSB      EQU   3        ; Set if you want a font req rather than file requester.
FRQINFOGADGETB    EQU   4        ; Set if you want a hide-info files gadget.
FRQHIDEWILDSB     EQU   5        ; Set if you DON'T want 'show' and 'hide' string gadgets.
FRQABSOLUTEXYB    EQU   6        ; Use absolute x,y positions - NOT centering on mouse.
FRQCACHEPURGEB    EQU   7        ; Purge cache whenever dir date stamp changes if set.
FRQNOHALFCACHEB   EQU   8        ; Don't cache dir unless completely read in when set.
FRQNOSORTB        EQU   9        ; Set if you DON'T want sorted directories.
FRQNODRAGB        EQU   10       ; Set if you DON'T want a drag bar and depth gadgets.
FRQSAVINGB        EQU   11       ; Set if you are selecting a file to save to.
FRQLOADINGB       EQU   12       ; Set if you are selecting a file(s) to load from.
                                 ;These two bits (save and load) aren't currently used for
                                 ;anything, but they may be in the future, so you should
                                 ;remember to set them.  Also, these bits make it easier if
                                 ;somebody wants to customize the file requester for their
                                 ;machine.  They can make it behave differently for loading
                                 ;vs saving.
FRQDIRONLYB       EQU   13       ; Allow user to select dir, rather than file.

FRQSHOWINFOM      EQU   1<<FRQSHOWINFOB
FRQEXTSELECTM     EQU   1<<FRQEXTSELECTB
FRQCACHINGM       EQU   1<<FRQCACHINGB
FRQGETFONTSM      EQU   1<<FRQGETFONTSB
FRQINFOGADGETM    EQU   1<<FRQINFOGADGETB
FRQHIDEWILDSM     EQU   1<<FRQHIDEWILDSB
FRQABSOLUTEXYM    EQU   1<<FRQABSOLUTEXYB
FRQCACHEPURGEM    EQU   1<<FRQCACHEPURGEB
FRQNOHALFCACHEM   EQU   1<<FRQNOHALFCACHEB
FRQNOSORTM        EQU   1<<FRQNOSORTB
FRQNODRAGM        EQU   1<<FRQNODRAGB
FRQSAVINGM        EQU   1<<FRQSAVINGB
FRQLOADINGM       EQU   1<<FRQLOADINGB
FRQDIRONLYM       EQU   1<<FRQDIRONLYB


** STRUCTURE   ESStructure  OFFSET=0  **  ;ExtendedSelectStructure

es_NextFile    EQU   $0    ; This must be the first element!
es_NameLength  EQU   $4    ; File name length, not including the terminating zero.
es_Pad         EQU   $6
es_Node        EQU   $8    ; Node that the user has extended selected.
es_FileName    EQU   $c    ; actual filename field, of length es_NameLength
es_SIZEOF      EQU   $c

;         When  using  extended  select,  the  directory pointer is required
; since  only  the  file  names  are stored in the frq_ExtendedSelect linked
; list.   When  not  using  extended select, you can either have frq_Dir and
; frq_File  point  be initialized, or you can have frq_PathName initialized,
; or  both.   frq_PathName will contain the concatenation of the file and
; directory chosen.

** STRUCTURE   .FileRequester  OFFSET=0  **
.FileRequester EQU   $0

frq_VersionNumber EQU   0     ;MUST BE ZERO!!!!!!!!!!!!!!!!!!

               ;You will probably want to initialize these three variables.
frq_Title            EQU   $2     ; Hailing text
frq_Dir              EQU   $6     ; Directory array (must be DSIZE+1 characters long)
frq_File             EQU   $a     ; Filename array (must be FCHARS+1 characters long)
                                  ; If you initialize this variable then the file
                                  ; requester will place the complete path name
                                  ; in here on exit.
frq_PathName         EQU   $e     ; Complete path name (must be DSIZE+FCHARS+2 long)
                                  ; If you want the file requester to pop up on your
                                  ; custom screen, put one of your window pointers
                                  ; here.  Or better yet, you can leave this field
                                  ; zeroed and put a pointer to one of your windows
                                  ; in the pr_WindowPtr field in your process
                                  ; structure.
frq_Window           EQU   $12    ; Window requesting or NULL
                                  ; Initialize these to the number of lines and
                                  ; columns you want to appear in the inner window
                                  ; that displays the file names.  If you leave
                                  ; these set to zero then default values are used.
frq_MaxExtendedSelect   EQU   $16 ; Zero implies max of 65535, if FRQEXTSELECT set.
frq_numlines            EQU   $18 ; Number of lines in file window.
frq_numcolumns          EQU   $1a ; Number of columns in file window.
frq_devcolumns          EQU   $1c ; Number of columns in device window.
frq_Flags               EQU   $1e ; Various - umm - flags.  See above for more info.
frq_dirnamescolor       EQU   $22 ; These five colors will all default
frq_filenamescolor      EQU   $24 ; to color one if you don't specify
frq_devicenamescolor    EQU   $26 ; a color (ie; if you specify color zero).
frq_fontnamescolor      EQU   $28 ; If you want color zero to be used, specify
frq_fontsizescolor      EQU   $2a ; color 32, or some other too large number
                                  ; which mods down to zero.

frq_detailcolor         EQU   $2c ; If both of these colors are specified as
frq_blockcolor          EQU   $2e ; zero then the block pen will be set to one.

frq_gadgettextcolor     EQU   $30 ; color of text of 5 boolean gadgets. Def to 1.
frq_textmessagecolor    EQU   $32 ; color of msg at screen top.  Defaults to 1.
frq_stringnamecolor     EQU   $34 ; color of words Drawer File Hide Show. Def to 3.
frq_stringgadgetcolor   EQU   $36 ; color of borders of string gadgets. Def to 3.
                                  ; Unfortunately it is not possible to specify
                                  ; the color of the actual text in an Intuition
                                  ; string gadget.
frq_boxbordercolor      EQU   $38 ; color of boxes round file & dir areas. Def to 3.
frq_gadgetboxcolor      EQU   $3a ; color of boxes round 5 boolean gadg.  Def to 3.

frq_RFU_Stuff           EQU   $3c ; This area, which is reserved for
                                  ; future use, should all be zero.

frq_DirDateStamp        EQU   $60 ; A copy of the cached directories date stamp.
                                  ; There should never be any need to change this.

frq_WindowLeftEdge      EQU   $6c ; These two fields are only used when the
frq_WindowTopEdge       EQU   $6e ; FRQABSOLUTEXY flag is set.  They specify
                                  ; the location of the upper left hand
                                  ; corner of the window.

frq_FontYSize           EQU   $70 ; These fields are used to return the selected
frq_FontStyle           EQU   $72 ; font size and style, only applicable when the
                                  ; font bit is set.

                                  ; If you set the extended select bit and the
                                  ; user extended selects, the list of filenames
                                  ; will start from here.
frq_ExtendedSelect      EQU   $74 ; Linked list of ESStructures if more than one
                                  ; filename is chosen.
                                  ; All of the following variables you shouldn't
                                  ; need to touch.  They contain fields that the
                                  ; file requester sets and likes to preserve
                                  ; over calls, to make life easier for the user.
frq_Hide                EQU   $78 ; Wildcards for files to hide.
frq_Show                EQU   $98 ; Wildcards for files to show.
frq_FileBufferPos       EQU   $b8 ; Cursor's  position  and first
frq_FileDispPos         EQU   $ba ; displayed character number in
frq_DirBufferPos        EQU   $bc ; the three string gadgets.  No
frq_DirDispPos          EQU   $be ; need  to initialized these if
frq_HideBufferPos       EQU   $c0 ; you don't want to.
frq_HideDispPos         EQU   $c2
frq_ShowBufferPos       EQU   $c4
frq_ShowDispPos         EQU   $c6

;         The  following  fields are PRIVATE!  Don't go messing with them or
; wierd  things may/will happen.  If this isn't enough of a warning, go read
; the one in intuition.h, that should scare you off.

frq_Memory              EQU   $c8 ; Memory allocated for dir entries.
frq_Memory2             EQU   $cc ; Used for currently hidden files.
frq_Lock                EQU   $d0 ; Contains lock on directories being read across calls.
frq_PrivateDirBuffer    EQU   $d4 ; Used for keeping a record of which
                                  ; directory we have file names for.
frq_FileInfoBlock       EQU   $158
frq_NumEntries          EQU   $15c
frq_NumHiddenEntries    EQU   $15e
frq_filestartnumber     EQU   $160
frq_devicestartnumber   EQU   $162
frq_SIZEOF              EQU   $164


;         This is used with the RealTimeScroll function.

** STRUCTURE   ScrollStruct  OFFSET=0  **

ss_TopEntryNumber    EQU   $0    ; This is the ordinal number of the first
                                 ; displayed entry.
ss_NumEntries        EQU   $4    ; This is the total number of entries in
                                 ; the list.
ss_LineSpacing       EQU   $8    ; This is how many pixels high each entry is.
ss_NumLines          EQU   $a    ; This is how many entries displayed simultaneously.
ss_PropGadget        EQU   $e    ; This is a pointer to prop gadget being monitored.

ss_RedrawAll         EQU   $12   ; This routine is used to redraw all of the
                                 ; entries when the user moves far enough
                                 ; that scrolling will take too long.

ss_ReadMore          EQU   $16   ; An optional routine that is called when
                                 ; the scroll routine is waiting for movement.
                                 ; This allows reading of new data while real
                                 ; time scrolling.
ss_ScrollAndDraw     EQU   $1a   ; This routine is called when the data needs
                                 ; to be scrolled and updated.  This routine is
                                 ; passed four long parameters (on the stack and
                                 ; in D0-D3) which are, respectively:
                                 ; D0 - entry number of first line to be drawn.
                                 ; D1 - pixel offset to draw first line at.
                                 ; D2 - amount to scroll before doing any drawing.
                                 ; D3 - number of lines of data to draw.
versionnumber        EQU   $1e   ; Make SURE this is set to zero.
rfu1                 EQU   $20   ; Make SURE you leave these two zeroed also.
rfu2                 EQU   $24   ; Make SURE you leave these two zeroed also.
ss_SIZEOF            EQU   $28


** STRUCTURE   Arrows  OFFSET=0  **

ArrowUp           EQU   0
ArrowDown         EQU   20
ArrowLeft         EQU   40
ArrowRight        EQU   58
Letter_R          EQU   76
Letter_G          EQU   96
Letter_B          EQU   116
Letter_H          EQU   136
Letter_S          EQU   156
Letter_V          EQU   176
chipstuff_SIZEOF  EQU   196


; These are the positions relative to the rl_Images pointer.
;ie
;  MOVE.L    rl_Images(A6),A0
;  ADD.L     #ArrowLeft,A0          ;A0 now points at the left arrow.


** STRUCTURE   ReqLib  OFFSET=LIB_SIZE  **

rl_SysLib         EQU   $22
rl_DosLib         EQU   $26      ; These must be kept in the same order,
rl_IntuiLib       EQU   $2a      ; the library expunge code depends on it.
rl_GfxLib         EQU   $2e      ;
rl_SegList        EQU   $32
rl_Images         EQU   $36      ; pointer to the arrow images.
rl_Flags          EQU   $3a
rl_Pad            EQU   $3b
rl_ConsoleDev     EQU   $3c      ; for RawKeyToAscii
rl_ConsoleHandle  EQU   $40      ; so we can close the device later
MyLib_Sizeof      EQU   $44

