home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / textplus_465.lzh / TextPlus / SrcE.lzh / SrcE / fs.h < prev    next >
C/C++ Source or Header  |  1990-08-06  |  7KB  |  126 lines

  1. /*
  2.  * Header file for the PathMaster File Selector.
  3.  * Copyright © 1989 by Justin V. McCormick.  All Rights Reserved.
  4.  */
  5.  
  6. #define STANDALONE 1
  7.  
  8. #ifdef _lint
  9. #define __regargs
  10. #define __stdargs
  11. #define __fARGS(a) ()
  12. #define AZTEC_C
  13. #endif
  14.  
  15. #ifdef AZTEC_C
  16. #define __regargs
  17. #define __stdargs
  18. #define __fARGS(a) ()
  19. #define __ARGS(a) ()
  20. #endif
  21.  
  22. #ifndef __fARGS
  23. #define __fARGS(a) a
  24. #endif
  25.  
  26. #define LABELFPEN               3               /* Forecolor for text labels */
  27. #define LABELBPEN               0               /* Backcolor for text labels */
  28.  
  29. #define GADTFPEN                0               /* Gadget text forecolor */
  30. #define GADTBPEN                1               /* Gadget text backcolor */
  31.  
  32. #define GADFILLPEN              1               /* Gadget interior pen */
  33. #define GADBORDPEN              3               /* Gadget border pen   */
  34.  
  35. #define ARROWFPEN               1               /* Pen used for drawing arrows */
  36. #define ARROWBPEN               3               /* Arrow gadget border pen     */
  37.  
  38. #define SBORDFPEN               1               /* String and File area border pen */
  39. #define SBORDBPEN               0               /* Backcolor (not really useful    */
  40.  
  41. #define FPEN                    1               /* Pen for rendering file names      */
  42. #define DPEN                    3               /* Pen for rendering directory names */
  43. #define FDBPEN                  0               /* Backfill pen for files & dirs     */
  44.  
  45. #define PATHSTRSIZE             300             /* 10 subdirs worth of space    */
  46. #define FILESTRSIZE             32              /* Room for filename + null + roundoff          */
  47. #define MATCHSTRSIZE            32              /* Room for 30 char pattern + null + "  */
  48.  
  49. /* File node structure */
  50. struct node_data
  51. {
  52.   BYTE alphadata[58];                           /* ascii data                                   */
  53.   WORD filetype;                                /* Dir or file flag                             */
  54.   WORD showit;                                  /* 0=skip, 1=showable                           */
  55.   WORD textcolor;                               /* Color to render this file as */
  56.   WORD namelength;                              /* Actual length of file name   */
  57.   ULONG filesize;                               /* File size in bytes                           */
  58.   ULONG days;                                   /* File creation date                           */
  59.   ULONG minutes;
  60.   ULONG ticks;
  61. };
  62.  
  63. struct file_node
  64. {
  65.   struct MinNode fn_Node;       /* Exec List linkage            */
  66.   struct node_data *info;       /* file info structure          */
  67.   WORD idnum;                                   /* numerical list position */
  68. };
  69.  
  70. /* Struct for list of Devices found */
  71. struct dev_node
  72. {
  73.   struct MinNode dn_Node;
  74.   UBYTE name[FILESTRSIZE];
  75. };
  76.  
  77. /* File selector request structure */
  78. struct FSRequest
  79. {
  80.   BYTE dirname[PATHSTRSIZE];       /* Contents of the "PATH" string gadget      */
  81.   BYTE filename[FILESTRSIZE];      /* Contents of the "FILE" string gadget      */
  82.   BYTE matchpattern[MATCHSTRSIZE]; /* Contents of the "PATTERN" string gadget   */
  83.   WORD leftedge;             /* Window initial x position, user modifiable      */
  84.   WORD topedge;                      /* Window initial y position                                               */
  85.   WORD sorttype;             /* -1=NoSort,0=Alpha,1=Size,2=Time                                 */
  86.   UWORD flags;               /* See below defines                                                               */
  87.   ULONG windowflags;         /* Special Windowflags                                                             */
  88.   BYTE *fullname;            /* Must point to BYTE[344] space for full path!    */
  89.   BYTE *ignorepattern;       /* Wildcard to skip files, e.g. "*.info"                           */
  90.   BYTE *pathgadstr;                  /* "PATH" or equivalent string gadget label                */
  91.   BYTE *filegadstr;          /* "FILE", "NAME", string gadget label                             */
  92.   BYTE *titlestr;                    /* Static titlebar message, "LOAD ANIMATION>"              */
  93.   BYTE *readingstr;                  /* "Reading..." or appropriate substitute                  */
  94.   BYTE *sortingstr;          /* "Sorting..." or equivalent message                              */
  95.   BYTE *emptydirstr;         /* "Empty Directory" or equivalent                                 */
  96.   BYTE *nomatchstr;                  /* "Nothing matched PATTERN" or equivalent                 */
  97.   BYTE *selectfilestr;               /* "Select File:" or equivalent message                    */
  98.   BYTE *selectstr;                   /* "Okay", "Load", etc. gadget text                        */
  99.   BYTE *cancelstr;                   /* "Cancel", "Exit", etc. gadget text                      */
  100.   BYTE *specgadstr;                  /* Text for optional definable gadget                      */
  101.   struct Screen *userscreen; /* Screen to open requester on or 0L for WBench    */
  102.   struct MsgPort *userport;  /* port to Wait on, then call userfunc or 0L       */
  103. /* Function called if specgadstr != 0L on GADGETUP              */
  104.   LONG (*specgadfunc) __fARGS((struct FSRequest *, struct Window *, struct Gadget *));
  105. /* Clicked on a directory function */
  106.   LONG (*dirfunc) __fARGS((struct FSRequest *, struct Window *));
  107. /* Clicked on a filename function or 0L                         */
  108.   LONG (*filefunc) __fARGS((struct FSRequest *, struct Window *));
  109. /* Function called when Signal at userport set  */
  110.   LONG (*userfunc) __fARGS((struct FSRequest *, struct Window *));
  111. /* Called right after OpenWindow for SetPointering              */
  112.   LONG (*initfunc) __fARGS((struct FSRequest *, struct Window *));
  113. /* Called for each node_data, your chance to accept/reject/change */
  114.   LONG (*matchfunc) __fARGS((struct FSRequest *, BYTE *, struct file_node *));
  115. };
  116.  
  117. /* FSRequest flags */
  118. #define FS_NO_DCLICK_EXIT   (1L << 0)           /* Disable Double-Click         exit            */
  119. #define FS_NO_STRING_EXIT   (1L << 1)           /* Disable File String Gadget exit              */
  120. #define FS_NO_STRING_OKAY   (1L << 2)           /* Allow clean exit with no file name           */
  121. #define FS_SHOW_FILES_FIRST (1L << 3)   /* Show files first in mixture                          */
  122. #define FS_SHOW_DIRS_FIRST  (1L << 4)   /* Show dirs first in mixture                           */
  123. #define FS_SHOW_FILES_ONLY  (1L << 5)           /* Don't show dirs                                              */
  124. #define FS_SHOW_DIRS_ONLY   (1L << 6)   /* Don't show files                                     */
  125. #define FS_DELAYED_SORT     (1L << 7)   /* Don't sort till user hits slide      */
  126.