home *** CD-ROM | disk | FTP | other *** search
- { reqlibrary.h © 1988/1989/1990 reserved by Colin Fox and Bruce Dawson }
-
- {$if not def REQLIBRARY_LIB}
- CONST REQLIBRARY_LIB=26731;
-
- {$if not def INTUITION_INTUITION_H;incl"intuition/intuition.h";endif}
- {$if not def INTUITION_SCREENS_H; incl"intuition/screens.h"; endif}
- {$if not def LIBRARIES_DOS_H; incl"libraries/dos.h"; endif}
- {$if not def EXEC_LIBRARIES_H; incl"exec/libraries.h"; endif}
- {$if not def EXEC_DEVICES_H; incl"exec/devices.h"; endif}
- {$if not def EXEC_IO_H; incl"exec/io.h"; endif}
-
- {
- ** $Filename: libraries/reqbase.h $
- ** $Release: 2.0 release 1 $
- ** $Revision: 2.5 $
- ** $Date: 90/11/23 $
- **
- ** req.library definitions
- **
- }
-
- CONST
- REQVERSION = 2;
- NUMPAIRS = 10;
-
- TYPE
- p_GadgetBlock = ^GadgetBlock;
- p_StringBlock = ^StringBlock;
- p_PropBlock = ^PropBlock;
- p_ScrollBlock = ^ScrollBlock;
- p_TwoImageGadget = ^TwoImageGadget;
- p_TRStructure = ^TRStructure;
- p_ExtendedColorRequester = ^_ExtendedColorRequester;
- p_GetLongStruct = ^GetLongStruct;
- p_GetStringStruct = ^GetStringStruct;
- p_ESStructure = ^ESStructure;
- p_ReqFileRequester = ^ReqFileRequester;
- p_ReqScrollStruct = ^ReqScrollStruct;
- p_chipstuff = ^chipstuff;
- p_ReqLib = ^ReqLib;
- GadgetBlock = RECORD
- Gadget: Gadget;
- Border: Border;
- Pairs: Array[1..NUMPAIRS] of Integer;
- Text: IntuiText;
- END;
- StringBlock = RECORD
- Gadget: Gadget;
- Info: StringInfo;
- Border: Border;
- Pairs: Array[1..NUMPAIRS] of Integer;
- END;
- PropBlock = RECORD
- Gadget: Gadget;
- Info: PropInfo;
- Image: Image;
- END;
- ScrollBlock = RECORD
- ArrowUpLt: Gadget;
- ImageUpLt: Image;
- ArrowDnRt: Gadget;
- ImageDnRt: Image;
- Prop: PropBlock;
- END;
- TwoImageGadget = RECORD
- Gadget: Gadget;
- Image1: Image;
- Image2: Image;
- END;
-
- CONST
- HORIZSLIDER = $0; {which way the slider stands}
- VERTSLIDER = $10000; {This is so that it bypasses all gadget flags.}
-
- { This structure is use with the TextRequester function.}
-
- TYPE
- TRStructure = RECORD
- Text, { This is the message text, including printf() style formatting if desired.}
- Controls: Str; { This is the address of the parameter list, if printf() style formatting is used.}
- Window: p_Window; { This is an optional (zero if not used) pointer to a window on the screen you}
- { would like the requester to show up on.}
- MiddleText, { If non-zero, this is the text for the gadget in the lower middle (returns 2).}
- PositiveText, { If non-zero, this is the text for the gadget in the lower left hand corner (returns 1).}
- NegativeText, { If non-zero, this is the text for the gadget in the lower right (returns 0).}
- Title: Str; { This is the title for the window.}
- KeyMask: Integer; { This is the qualifier mask for the keyboard shortcuts.}
- { Use $FFFF to allow any qualifiers (or none).}
- { Zero means that no keyboard shortcuts are allowed.}
- textcolor, { Color of the text. Uses color 1 if no color specified. }
- detailcolor, { Detail and block color, as in a NewWindow structure. If }
- blockcolor, { both are left zero, block pen will be set to 1. }
- versionnumber: Integer; { Make SURE this is set to REQVERSION. }
- Timeout: Word; { the timeout value in seconds }
- AbortMask: Long; { If the requester gets a Signal() with this bit, it will abort }
- { this is useful for remote-control applications. }
- rfu1: Word;
- END;
-
- { 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.
- }
-
-
- { 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. }
-
- _ExtendedColorRequester = RECORD
- defcolor: Long; {The color that is initially highlit. }
- window: p_Window {The window the 'requester' opens up in. }
- rfu1, {Who knows what these will be used for, }
- rfu2, {but I'm sure we'll think of something. }
- rfu3, {Until then, just keep these zeroed. }
- rfu4, {Okay? }
- rfu5: Long;
- END;
-
-
- { This structure is for use with the GetLong function.}
-
- CONST
- GLNODEFAULTM = 1 {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.}
-
- TYPE
- GetLongStruct = RECORD;
- titlebar: Str;
- defaultval,
- minlimit,
- maxlimit,
- result: Long;
- window: p_Window;
- versionnumber: Integer; { Make SURE this is set to REQVERSION. }
- flags, { Some, uh flags. See above for bit definitions. }
- rfu2: Long; { Make SURE you leave these two zeroed also. }
- END;
- GetStringStruct = RECORD
- titlebar: Str;
- stringbuffer: Str;
- window: p_Window;
- stringsize, { how many characters in the buffer }
- visiblesize, { how many characters show on screen }
- versionnumber: Integer; { make sure this is REQVERSION }
- flags,
- rfu1,
- rfu2,
- rfu3: Long;
- END;
-
-
- {$ if not def DSIZE}
- CONST
- DSIZE = 130;
- FCHARS = 30;
- {$ endif }
-
- CONST
- WILDLENGTH = 30;
-
- { These are the bit numbers of various bits that you can set in the
- Flags field of the file requester structure. }
-
- CONST
- FRQSHOWINFOM = $1; {Set this in Flags if you want .info files to show. They default to hidden.}
- FRQEXTSELECTM = $2; {Set this in Flags if you want extended select. Default is not.}
- FRQCACHINGM = $4; {Set this in Flags if you want directory caching. Default is not.}
- FRQGETFONTSM = $8; {Set this in Flags if you want a font requester rather than a file requester.}
- FRQINFOGADGETM = $10; {Set this in Flags if you want a hide-info files gadget.}
- FRQHIDEWILDSM = $20; {Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.}
- FRQABSOLUTEXYM = $40; {Use absolute x,y positions rather than centering on mouse.}
- FRQCACHEPURGEM = $80; {Purge the cache whenever the directory date stamp changes if this is set.}
- FRQNOHALFCACHEM = $100; {Don't cache a directory unless it is completely read in when this is set.}
- FRQNOSORTM = $200; {Set this in Flags if you DON'T want sorted directories.}
- FRQNODRAGM = $400; {Set this in Flags if you DON'T want a drag bar and depth gadgets.}
- FRQSAVINGM = $800; {Set this bit if you are selecting a file to save to.}
- FRQLOADINGM = $1000; {Set this bit 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.}
- FRQDIRONLYM = $2000; {Allow the user to select a directory, rather than a file.}
-
- TYPE
- ESStructure = RECORD
- NextFile: p_ESStructure;
- NameLength, { Length of thefilename field, not including the terminating zero. }
- Pad: Integer;
- Node: Ptr; { For internal use only. }
- thefilename: Char; { This is a variable size field. }
- END;
- ReqFileRequester = RECORD
- VersionNumber: Word; { Make sure this is set to REQVERSION. }
- Title, { Hailing text }
- Dir, { Directory array (DSIZE+1) }
- _File, { Filename array (FCHARS+1) }
- PathName: Str; { Complete path name array (DSIZE+FCHARS+2) }
- Window: p_Window; { Window requesting or NULL }
- MaxExtendedSelect, { Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.}
- numlines, { Number of lines in file window. }
- numcolumns, { Number of columns in file window. }
- devcolumns: Word;
- Flags: Long; { Various - umm - flags. See above for more info. }
- dirnamescolor, { These five colors will all default }
- filenamescolor, { to color one if you don't specify }
- devicenamescolor, { a color (ie; if you specify color zero). }
- fontnamescolor, { If you want color zero to be used, specify }
- fontsizescolor: Word; { color 32, or some other too large number }
- { which mods down to zero. }
- detailcolor, { If both of these colors are specified as }
- blockcolor: Word; { zero then the block pen will be set to one. }
- gadgettextcolor, { The color for the text of the five boolean gadgets. Defaults to 1. }
- textmessagecolor, { The color for the message at the screen top. Defaults to 1. }
- stringnamecolor, { The color for the words Drawer, File, Hide and Show. Defaults to 3. }
- stringgadgetcolor, { The color for the borders of the string gadgets. Defaults to 3. }
- { Unfortunately it is not possible to specify }
- { the color of the actual text in an Intuition }
- { string gadget. }
- boxbordercolor, { The color for the boxes around the file and directory areas. Defaults to 3. }
- gadgetboxcolor: Word; { The color for the boxes around the five boolean gadgets. Defaults to 3. }
- FRU_Stuff: Array[1..18] of Word; { This area, which is reserved for }
- { future use, should all be zero. }
- DirDateStamp: DateStamp; { A copy of the cached directories date stamp. }
- { There should never be any need to change this. }
- WindowLeftEdge, { These two fields are used for the Center }
- WindowTopEdge: Word; { function. See the Center() function docs }
- { for their explanation.}
- FontYSize, { These fields are used to return the selected }
- FontStyle: Word; { 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.}
- ExtendedSelect: p_ESStructure;
- Hide: Array[-1..WILDLENGTH] of Char; { The wildcards text. }
- Show: Array[-1..WILDLENGTH] of Char; { More wildcards text. }
- FileBufferPos, { Various fields taken from the various }
- FileDispPos, { string gadgets so that the cursor }
- DirBufferPos, { can be returned to the same position }
- DirDispPos, { on subsequent calls. }
- HideBufferPos,
- HideDispPos,
- ShowBufferPos,
- ShowDispPos: Integer;
- { The following fields are PRIVATE! Don't go messing with them or
- weird things may/will happen. If this isn't enough of a warning, go read
- the one in intuition.h, that should scare you off. }
- Memory, { Memory allocate for dir entries. }
- Memory2, { More memory, used for hidden files. }
- Lock: Ptr;
- PrivateDirBuffer: Array[-1..DSIZE] of Char; { Used for keeping a record }
- { of which directory we have file names for. }
- FileInfoBlock: p_FileInfoBlock;
- NumEntries,
- NumHiddenEntries: Integer;
- filestartnumber,
- devicestartnumber: Integer;
- END;
-
- { This is used with the RealTimeScroll function. }
-
- ReqScrollStruct = RECORD
- TopEntryNumber: Long; {This is the ordinal number of the first}
- {displayed entry.}
- NumEntries: Long; {This is the total number of entries in}
- {the list.}
- LineSpacing: Word; {This is how many pixels high each entry is.}
- NumLines: Long; {This is how many entries can be displayed simultaneously.}
- PropGadget: p_Gadget; {This is a pointer to the prop gadget being monitored.}
- RedrawAll: Ptr; {This routine is used to redraw all of the}
- {entries when the user moves far enough}
- {that scrolling will take too long.}
- { The ScrollStruct is passed on the stack }
- { and in A0 }
- ReadMore: Ptr; {An optional routine that is called when}
- {the scroll routine is waiting for movement.}
- {This allows reading of new data while real}
- {time scrolling.}
- { The ScrollStruct is passed on the stack }
- { and in A0 }
- ScrollAndDraw: Ptr; {This routine is called when the data needs}
- {to be scrolled and updated. This routine is}
- {passed five long parameters (on the stack and}
- {in D0-D3/A0) 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.}
- {A0 - the Scroll structure itself. }
- versionnumber: Integer; {REQVERSION should be put here}
- rfu1, {Make SURE you leave these two zeroed also. }
- rfu2: Integer;
- END;
- chipstuff = RECORD
- ArrowUp: String[20]; { 16 pixels wide, 10 pixels high. }
- ArrowDown: String[20]; { 16 pixels wide, 10 pixels high. }
- ArrowLeft: String[18]; { 16 pixels wide, 9 pixels high. }
- ArrowRight: String[18]; { 16 pixels wide, 9 pixels high. }
- Letter_R: String[20]; { 16 pixels wide, 10 pixels high. }
- Letter_G: String[20]; { 16 pixels wide, 10 pixels high. }
- Letter_B: String[20]; { 16 pixels wide, 10 pixels high. }
- Letter_H: String[20]; { 16 pixels wide, 10 pixels high. }
- Letter_S: String[20]; { 16 pixels wide, 10 pixels high. }
- Letter_V: String[20]; { 16 pixels wide, 10 pixels high. }
- END;
- ReqLib = RECORD
- RLib: _Library;
- SysLib,
- DosLib,
- IntuiLib,
- GfxLib: p_Library;
- SegList: Ptr;
- Images: p_chipstuff;
- Flags,
- Pad: Byte;
- ConsoleDev: p_Device;
- ConsoleHandle: p_IOStdReq;
- RexxSysBase: p_Library;
- END;
-
- VAR ReqBase: Ptr;
-
- LIBRARY ReqBase:
- -42: PROCEDURE _AddGadget(a0:p_Window; a1:p_Gadget; d0:Ptr);
- -30: PROCEDURE Center(a0:p_NewWindow; d0, d1: Word);
- -36: FUNCTION SetSize(d0, d1: Long): Integer;
- -42: FUNCTION SetLocation(d0, d1, d2: Long): Integer;
- -48: FUNCTION ReadLocation(d0, d1: Long; d2: Integer): Long;
- -54: FUNCTION ReqFormat(a2, a1: Str; a0: Ptr): Long; { a0 ist ^Str }
- {-60: Dispatch}
- {-66: Fake1}
- {-72: Fake2}
- {-78: Fake3}
- -84: FUNCTION _FileRequester(a0: p_ReqFileRequester): Boolean;
- -90: FUNCTION ColorRequester(a0: Long): Long;
- -96: PROCEDURE DrawBox(a1: p_RastPort; d0, d1, d2, d3: Long);
- -102: PROCEDURE MakeButton(a0: p_TwoImageGadget; a1, a2: Ptr; d0, d1, d2: Long);
- { a1, a2 sind eigentlich Str, allerdings zeigen sie auf Bilddaten }
- -108: PROCEDURE MakeScrollBar(a0: p_ScrollBlock, d0, d1, d2, d3: Long);
- -114: PROCEDURE PurgeFiles(a0: p_ReqFileRequester);
- {-120: GetFontHeightAndWidth}
- -126: PROCEDURE MakeGadget(a0: p_GadgetBlock; a1: Str; d0, d1: Long);
- -132: PROCEDURE MakeString(a0: p_StringBlock; a1, a2: Str; d0, d1, d2, d3: Long);
- -138: PROCEDURE MakeProp(a0: p_PropBlock; d0, d1, d2: Long);
- -144: PROCEDURE LinkGadget(a0: p_GadgetBlock; a1: Str; a3: p_NewWindow; d0, d1: Long );
- -150: PROCEDURE LinkStringGadget(a0: p_StringBlock; a1, a2: Str; a3: p_NewWindow; d0, d1, d2, d3: Long);
- -156: PROCEDURE LinkPropGadget(a0: p_PropBlock; a3: p_NewWindow; d0, d1, d2, d3, d4: Long);
- -162: FUNCTION GetString(a0, a1: Str; a2: p_Window; d0, d1: Integer): Boolean;
- -168: PROCEDURE RealTimeScroll(a0: p_ReqScrollStruct);
- -174: FUNCTION TextRequest(a0: p_TRStructure): Integer;
- -180: FUNCTION GetLong(a0: p_GetLongStruct): Boolean;
- -186: FUNCTION RawKeyToAscii(d0, d1: Word; a0: Ptr): Char;
- -192: FUNCTION ExtendedColorRequester(a0: p_ExtendedColorRequester): Long;
- -198: FUNCTION NewGetString(a0: p_GetStringStruct): Boolean;
- END;
- {$endif}
-