home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 638a.lha / DrawMap_v4.0src&libs / DrawMap_v4p0.LZH / DrawMap_v4.0 / source / reqbase.h < prev    next >
C/C++ Source or Header  |  1992-04-06  |  17KB  |  393 lines

  1. /* reqlibrary.h © 1988/1989/1990 reserved by Colin Fox and Bruce Dawson */
  2.  
  3. #ifndef REQLIBRARY_H
  4. #define REQLIBRARY_H
  5.  
  6. /*
  7. **   $Filename: libraries/reqbase.h $
  8. **   $Release: 2.0 release 1 $
  9. **   $Revision: 2.5 $
  10. **   $Date: 90/11/23 $
  11. **
  12. **   req.library definitions
  13. **
  14. */
  15.  
  16. #ifndef      EXEC_TYPES_H
  17. #include   "exec/types.h"
  18. #endif
  19.  
  20. #ifndef      AZTEC_C
  21. #ifndef      DOS_DOS_H
  22. #include   "dos/dos.h"
  23. #endif
  24. #endif
  25.  
  26.  
  27. #define   REQVERSION   2
  28. #define   NUMPAIRS   10
  29.  
  30. struct GadgetBlock
  31.    {
  32.    struct Gadget      Gadget;
  33.    struct Border      Border;
  34.    WORD            Pairs[NUMPAIRS];
  35.    struct IntuiText   Text;
  36.    };
  37.  
  38. struct StringBlock
  39.    {
  40.    struct Gadget      Gadget;
  41.    struct StringInfo   Info;
  42.    struct Border      Border;
  43.    WORD            Pairs[NUMPAIRS];
  44.    };
  45.  
  46. struct PropBlock
  47.    {
  48.    struct Gadget      Gadget;
  49.    struct PropInfo      Info;
  50.    struct Image      Image;
  51.    };
  52.  
  53. struct ScrollBlock
  54.    {
  55.    struct Gadget      ArrowUpLt;
  56.    struct Image      ImageUpLt;
  57.    struct Gadget      ArrowDnRt;
  58.    struct Image      ImageDnRt;
  59.    struct PropBlock   Prop;
  60.    };
  61.  
  62. struct TwoImageGadget
  63.    {
  64.    struct Gadget      Gadget;
  65.    struct Image      Image1;
  66.    struct Image      Image2;
  67.    };
  68.  
  69. #define   ATTITUDEB   16
  70.  
  71. #define   HORIZSLIDER      (0L)         /*which way the slider stands*/
  72. #define   VERTSLIDER      (1L<<ATTITUDEB)   /*This is so that it bypasses all gadget flags.*/
  73.  
  74.  
  75.  
  76. /*         This structure is use with the TextRequester function.*/
  77.  
  78. struct TRStructure
  79.    {
  80.    char   *Text;         /* This is the message text, including printf() style formatting if desired.*/
  81.    char   *Controls;      /* This is the address of the parameter list, if printf() style formatting is used.*/
  82.    struct Window   *Window;/* This is an optional (zero if not used) pointer to a window on the screen you*/
  83.                      /* would like the requester to show up on.*/
  84.    char   *MiddleText;   /* If non-zero, this is the text for the gadget in the lower middle (returns 2).*/
  85.    char   *PositiveText;   /* If non-zero, this is the text for the gadget in the lower left hand corner (returns 1).*/
  86.    char   *NegativeText;   /* If non-zero, this is the text for the gadget in the lower right (returns 0).*/
  87.    char   *Title;         /* This is the title for the window.*/
  88.    WORD   KeyMask;      /* This is the qualifier mask for the keyboard shortcuts.*/
  89.                      /* Use $FFFF to allow any qualifiers (or none).*/
  90.                      /* Zero means that no keyboard shortcuts are allowed.*/
  91.    WORD   textcolor;      /* Color of the text.  Uses color 1 if no color specified. */
  92.    WORD   detailcolor;   /* Detail and block color, as in a NewWindow structure.  If */
  93.    WORD   blockcolor;      /* both are left zero, block pen will be set to 1. */
  94.    WORD   versionnumber;   /* Make SURE this is set to REQVERSION. */
  95.    UWORD   Timeout;      /* the timeout value in seconds */
  96.    LONG   AbortMask;      /* If the requester gets a Signal() with this bit, it will abort */
  97.                      /* this is useful for remote-control applications. */
  98.    UWORD   rfu1;
  99.    };
  100.  
  101. /* NOTE:
  102.  
  103.     The  control  values  mentioned above are used if you choose to insert
  104. printf  style directives in your strings and should contain the address of
  105. a list of control parameters, usually on the stack.
  106.     */
  107.  
  108.  
  109.  
  110. /*         Remember,   if  you  don't  want  to  go  through  the  hassle  of */
  111. /* initializing a ExtendedColorRequester structure, you can always just call */
  112. /* ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester */
  113. /* just  takes  a  single  parameter, in D0, the color that should start out */
  114. /* being highlit.  It returns a single value, the color that was selected at */
  115. /* the end. */
  116.  
  117. /*         This structure is for use with the ExtendedColorRequester (_not_, */
  118. /* the ColorRequester) function. */
  119.  
  120. struct ExtendedColorRequester
  121.    {
  122.    LONG   defcolor;      /*The color that is initially highlit. */
  123.    struct Window *window;   /*The window the 'requester' opens up in. */
  124.    LONG   rfu1;         /*Who knows what these will be used for, */
  125.    LONG   rfu2;         /*but I'm sure we'll think of something. */
  126.    LONG   rfu3;         /*Until then, just keep these zeroed. */
  127.    LONG   rfu4;         /*Okay? */
  128.    LONG   rfu5;
  129.    };
  130.  
  131.  
  132.  
  133. /*         This structure is for use with the GetLong function.*/
  134.  
  135. #define   GLNODEFAULTB   0   /*Set this bit in the flags if you don't want a default*/
  136.                      /*value to show up in the get long string gadget.  For*/
  137.                      /*some things this is much better than having a zero*/
  138.                      /*show up.*/
  139.  
  140. #define   GLNODEFAULTM   (1<<GLNODEFAULTB)
  141.  
  142. struct GetLongStruct
  143.    {
  144.    char   *titlebar;
  145.    LONG   defaultval;
  146.    LONG   minlimit;
  147.    LONG   maxlimit;
  148.    LONG   result;
  149.    struct Window   *window;
  150.    WORD   versionnumber;   /* Make SURE this is set to REQVERSION. */
  151.    LONG   flags;         /* Some, uh flags.  See above for bit definitions. */
  152.    LONG   rfu2;         /* Make SURE you leave these two zeroed also. */
  153.    };
  154.  
  155. struct GetStringStruct
  156.    {
  157.    char   *titlebar;
  158.    char   *stringbuffer;
  159.    struct   Window *window;
  160.    WORD   stringsize;         /* how many characters in the buffer */
  161.    WORD   visiblesize;      /* how many characters show on screen */
  162.    WORD   versionnumber;      /* make sure this is REQVERSION */
  163.    LONG   flags;
  164.    LONG   rfu1;
  165.    LONG   rfu2;
  166.    LONG   rfu3;
  167.    };
  168.  
  169.  
  170.  
  171. #ifndef   DSIZE
  172. #define   DSIZE   130
  173. #define   FCHARS   30
  174. #endif   /* ifndef DSIZE */
  175.  
  176. #define   WILDLENGTH   30
  177.  
  178. /*
  179.    These  are  the  bit  numbers  of various bits that you can set in the
  180. Flags  field of the file requester structure.  The actual values that come
  181. out of these bit numbers are defined in the set of includes below with the
  182. same  names  but  with  an  M  (for  mask) ending instead of a B (for bit)
  183. ending.
  184.    */
  185.  
  186. #define   FRQSHOWINFOB   0   /*Set this in Flags if you want .info files to show.  They default to hidden.*/
  187. #define   FRQEXTSELECTB   1   /*Set this in Flags if you want extended select.  Default is not.*/
  188. #define   FRQCACHINGB      2   /*Set this in Flags if you want directory caching.  Default is not.*/
  189. #define   FRQGETFONTSB   3   /*Set this in Flags if you want a font requester rather than a file requester.*/
  190. #define   FRQINFOGADGETB   4   /*Set this in Flags if you want a hide-info files gadget.*/
  191. #define   FRQHIDEWILDSB   5   /*Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.*/
  192. #define   FRQABSOLUTEXYB   6   /*Use absolute x,y positions rather than centering on mouse.*/
  193. #define   FRQCACHEPURGEB   7   /*Purge the cache whenever the directory date stamp changes if this is set.*/
  194. #define   FRQNOHALFCACHEB   8   /*Don't cache a directory unless it is completely read in when this is set.*/
  195. #define   FRQNOSORTB      9   /*Set this in Flags if you DON'T want sorted directories.*/
  196. #define   FRQNODRAGB      10   /*Set this in Flags if you DON'T want a drag bar and depth gadgets.*/
  197. #define   FRQSAVINGB      11   /*Set this bit if you are selecting a file to save to.*/
  198. #define   FRQLOADINGB      12   /*Set this bit if you are selecting a file(s) to load from.*/
  199.                      /*These two bits (save and load) aren't currently used for*/
  200.                      /*anything, but they may be in the future, so you should*/
  201.                      /*remember to set them.  Also, these bits make it easier if*/
  202.                      /*somebody wants to customize the file requester for their*/
  203.                      /*machine.  They can make it behave differently for loading*/
  204.                      /*vs saving.*/
  205. #define   FRQDIRONLYB      13   /*Allow the user to select a directory, rather than a file.*/
  206.  
  207. /*
  208.    These  are the mask values that you can OR into the Flags field of the
  209. file requester structure.
  210.    */
  211.  
  212. #define   FRQSHOWINFOM   (1<<FRQSHOWINFOB)
  213. #define   FRQEXTSELECTM   (1<<FRQEXTSELECTB)
  214. #define   FRQCACHINGM      (1<<FRQCACHINGB)
  215. #define   FRQGETFONTSM   (1<<FRQGETFONTSB)
  216. #define   FRQINFOGADGETM   (1<<FRQINFOGADGETB)
  217. #define   FRQHIDEWILDSM   (1<<FRQHIDEWILDSB)
  218. #define   FRQABSOLUTEXYM   (1<<FRQABSOLUTEXYB)
  219. #define   FRQCACHEPURGEM   (1<<FRQCACHEPURGEB)
  220. #define   FRQNOHALFCACHEM   (1<<FRQNOHALFCACHEB)
  221. #define   FRQNOSORTM      (1<<FRQNOSORTB)
  222. #define   FRQNODRAGM      (1<<FRQNODRAGB)
  223. #define   FRQSAVINGM      (1<<FRQSAVINGB)
  224. #define   FRQLOADINGM      (1<<FRQLOADINGB)
  225. #define   FRQDIRONLYM      (1<<FRQDIRONLYB)
  226.  
  227. struct ESStructure
  228.    {
  229.    struct ESStructure   *NextFile;
  230.    WORD   NameLength;         /* Length of thefilename field, not including the terminating zero. */
  231.    WORD   Pad;
  232.    APTR   Node;            /* For internal use only. */
  233.    char   thefilename[1];      /* This is a variable size field. */
  234.    };
  235.  
  236. struct ReqFileRequester
  237.    {
  238.    UWORD   VersionNumber;            /* Make sure this is set to REQVERSION. */
  239.  
  240.    char   *Title;                  /* Hailing text */
  241.    char   *Dir;                  /* Directory array (DSIZE+1) */
  242.    char   *File;                  /* Filename array (FCHARS+1) */
  243.  
  244.    char   *PathName;               /* Complete path name array (DSIZE+FCHARS+2) */
  245.  
  246.    struct Window   *Window;         /* Window requesting or NULL */
  247.  
  248.  
  249.    UWORD   MaxExtendedSelect;         /* Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.*/
  250.    UWORD   numlines;               /* Number of lines in file window. */
  251.    UWORD   numcolumns;               /* Number of columns in file window. */
  252.    UWORD   devcolumns;
  253.    ULONG   Flags;                  /* Various - umm - flags.  See above for more info. */
  254.    UWORD   dirnamescolor;         /* These five colors will all default */
  255.    UWORD   filenamescolor;         /* to color one if you don't specify */
  256.    UWORD   devicenamescolor;      /* a color (ie; if you specify color zero). */
  257.    UWORD   fontnamescolor;         /* If you want color zero to be used, specify */
  258.    UWORD   fontsizescolor;         /* color 32, or some other too large number */
  259.                            /* which mods down to zero. */
  260.  
  261.    UWORD   detailcolor;         /* If both of these colors are specified as */
  262.    UWORD   blockcolor;            /* zero then the block pen will be set to one. */
  263.  
  264.    UWORD   gadgettextcolor;      /* The color for the text of the five boolean gadgets.  Defaults to 1. */
  265.    UWORD   textmessagecolor;      /* The color for the message at the screen top.  Defaults to 1. */
  266.    UWORD   stringnamecolor;      /* The color for the words Drawer, File, Hide and Show.  Defaults to 3. */
  267.    UWORD   stringgadgetcolor;      /* The color for the borders of the string gadgets.  Defaults to 3. */
  268.                            /* Unfortunately it is not possible to specify */
  269.                            /* the color of the actual text in an Intuition */
  270.                            /* string gadget. */
  271.    UWORD   boxbordercolor;         /* The color for the boxes around the file and directory areas.  Defaults to 3. */
  272.    UWORD   gadgetboxcolor;         /* The color for the boxes around the five boolean gadgets.  Defaults to 3. */
  273.  
  274.    UWORD   FRU_Stuff[18];            /* This area, which is reserved for */
  275.                               /* future use, should all be zero. */
  276.  
  277.    struct DateStamp   DirDateStamp;   /* A copy of the cached directories date stamp. */
  278.                               /* There should never be any need to change this. */
  279.  
  280.    UWORD   WindowLeftEdge;         /* These two fields are used for the Center */
  281.    UWORD   WindowTopEdge;         /* function. See the Center() function docs */
  282.                            /* for their explanation.*/
  283.  
  284.    UWORD   FontYSize;            /* These fields are used to return the selected */
  285.    UWORD   FontStyle;            /* font size and style, only applicable when the */
  286.                            /* font bit is set. */
  287.  
  288.    /*If you set the extended select bit and the user extended selects, the list of filenames will start from here.*/
  289.    struct ESStructure *ExtendedSelect;
  290.    char   Hide[WILDLENGTH+2];      /* The wildcards text. */
  291.    char   Show[WILDLENGTH+2];      /* More wildcards text. */
  292.    WORD   FileBufferPos;         /* Various fields taken from the various */
  293.    WORD   FileDispPos;         /* string gadgets so that the cursor */
  294.    WORD   DirBufferPos;         /* can be returned to the same position */
  295.    WORD   DirDispPos;            /* on subsequent calls. */
  296.    WORD   HideBufferPos;
  297.    WORD   HideDispPos;
  298.    WORD   ShowBufferPos;
  299.    WORD   ShowDispPos;
  300.  
  301. /**;      The  following  fields are PRIVATE!  Don't go messing with them or
  302. ; wierd  things may/will happen.  If this isn't enough of a warning, go read
  303. ; the one in intuition.h, that should scare you off.**/
  304.  
  305.    APTR   Memory;                  /* Memory allocate for dir entries. */
  306.    APTR   Memory2;               /* More memory, used for hidden files. */
  307.    APTR   Lock;
  308.    char   PrivateDirBuffer[DSIZE+2];   /* Used for keeping a record of which */
  309.                               /* directory we have file names for. */
  310.    struct FileInfoBlock   *FileInfoBlock;
  311.    WORD   NumEntries;
  312.    WORD   NumHiddenEntries;
  313.    WORD   filestartnumber;
  314.    WORD   devicestartnumber;
  315.    };
  316.  
  317.  
  318.  
  319. /*        This is used with the RealTimeScroll function. */
  320.  
  321. struct ReqScrollStruct
  322.     {
  323.    ULONG   TopEntryNumber;         /*This is the ordinal number of the first*/
  324.                            /*displayed entry.*/
  325.    ULONG   NumEntries;            /*This is the total number of entries in*/
  326.                            /*the list.*/
  327.    UWORD   LineSpacing;         /*This is how many pixels high each entry is.*/
  328.    ULONG   NumLines;            /*This is how many entries can be displayed simultaneously.*/
  329.    struct Gadget   *PropGadget;   /*This is a pointer to the prop gadget being monitored.*/
  330.  
  331.    void   (*RedrawAll)();         /*This routine is used to redraw all of the*/
  332.                            /*entries when the user moves far enough*/
  333.                            /*that scrolling will take too long.*/
  334.                            /* The ScrollStruct is passed on the stack */
  335.                            /* and in A0 */
  336.  
  337.    void   (*ReadMore)();         /*An optional routine that is called when*/
  338.                            /*the scroll routine is waiting for movement.*/
  339.                            /*This allows reading of new data while real*/
  340.                            /*time scrolling.*/
  341.                            /* The ScrollStruct is passed on the stack */
  342.                            /* and in A0 */
  343.    void   (*ScrollAndDraw)();      /*This routine is called when the data needs*/
  344.                            /*to be scrolled and updated.  This routine is*/
  345.                            /*passed five long parameters (on the stack and*/
  346.                            /*in D0-D3/A0) which are, respectively:*/
  347.                            /*D0 - entry number of first line to be drawn.*/
  348.                            /*D1 - pixel offset to draw first line at.*/
  349.                            /*D2 - amount to scroll before doing any drawing.*/
  350.                            /*D3 - number of lines of data to draw.*/
  351.                            /*A0 - the Scroll structure itself. */
  352.    WORD   versionnumber;         /*REQVERSION should be put here*/
  353.    LONG   rfu1;               /*Make SURE you leave these two zeroed also. */
  354.    LONG   rfu2;               /*Make SURE you leave these two zeroed also. */
  355.    };
  356.  
  357.  
  358.  
  359.  
  360.  
  361. struct chipstuff
  362.    {
  363.    char   ArrowUp[20];      /* 16 pixels wide, 10 pixels high. */
  364.    char   ArrowDown[20];      /* 16 pixels wide, 10 pixels high. */
  365.    char   ArrowLeft[18];      /* 16 pixels wide, 9 pixels high. */
  366.    char   ArrowRight[18];      /* 16 pixels wide, 9 pixels high. */
  367.    char   Letter_R[20];      /* 16 pixels wide, 10 pixels high. */
  368.    char   Letter_G[20];      /* 16 pixels wide, 10 pixels high. */
  369.    char   Letter_B[20];      /* 16 pixels wide, 10 pixels high. */
  370.    char   Letter_H[20];      /* 16 pixels wide, 10 pixels high. */
  371.    char   Letter_S[20];      /* 16 pixels wide, 10 pixels high. */
  372.    char   Letter_V[20];      /* 16 pixels wide, 10 pixels high. */
  373.    };
  374.  
  375. struct ReqLib
  376.    {
  377.    struct Library RLib;
  378.    struct Library         *SysLib;
  379.    struct Library         *DosLib;
  380.    struct Library         *IntuiLib;
  381.    struct Library         *GfxLib;
  382.    APTR               SegList;
  383.    struct chipstuff      *Images;
  384.    BYTE               Flags;
  385.    BYTE               Pad;
  386.    struct   Device         *ConsoleDev;
  387.    struct   IOStdReq      *ConsoleHandle;
  388.    struct   Library         *RexxSysBase;
  389.    };
  390.  
  391.  
  392. #endif
  393.