home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / cdity / findfiles.lha / FindFile / FFSource.lha / FindFile.h < prev   
Encoding:
C/C++ Source or Header  |  1993-04-03  |  4.6 KB  |  170 lines

  1. /*************************************************************************************
  2.  FindFile.h     Header file for FindFile
  3.  
  4.  FindFile.h 1.7 1993/04/03 13:34:06 RUSS Exp
  5.  
  6.  1.7
  7.  
  8.  FindFile.h
  9.  * Revision 1.7  1993/04/03  13:34:06  RUSS
  10.  * Fixed crashing problem when starting a second FindFile.
  11.  *
  12.  * Revision 1.6  1993/04/03  02:05:56  RUSS
  13.  * Added newgadget. Altered controlPanel to accomodate.
  14.  * New function proto added.
  15.  *
  16.  * Revision 1.5  1993/04/01  21:52:45  RUSS
  17.  * Widened window. Other alterations to conform
  18.  * to the new display format and new gadget.
  19.  *
  20.  * Revision 1.4  1993/02/28  00:39:57  RUSS
  21.  * Changed controlpanel to use arrays of gadgetpointers
  22.  *
  23.  * Revision 1.3  1993/02/27  15:59:35  RUSS
  24.  * Moved system include files to the front of
  25.  * the header
  26.  *
  27.  * Revision 1.2  1993/02/27  15:48:24  RUSS
  28.  * Added structure defs and #defines to
  29.  * this file.
  30.  *
  31.  * Revision 1.1  1993/02/27  00:42:46  RUSS
  32.  * Initial revision
  33.  *
  34.  
  35. ************************************************************************************/
  36.  
  37. /*** Include Files ***/
  38.  
  39. #include <date.h>
  40. #define INTUI_V36_NAMES_ONLY
  41. #include <exec/types.h>
  42. #include <exec/lists.h>
  43. #include <exec/memory.h>
  44. #include <intuition/intuition.h>
  45. #include <intuition/screens.h>
  46. #include <intuition/gadgetclass.h>
  47. #include <libraries/gadtools.h>
  48. #include <libraries/commodities.h>
  49. #include <libraries/asl.h>
  50. #include <dos/dos.h>
  51. #include <dos/dosextens.h>
  52. #include <clib/alib_protos.h>
  53. #include <clib/commodities_protos.h>
  54. #include <clib/dos_protos.h>
  55. #include <clib/exec_protos.h>
  56. #include <clib/gadtools_protos.h>
  57. #include <clib/graphics_protos.h>
  58. #include <clib/intuition_protos.h>
  59. #include <pragmas/commodities_lib.h>
  60. #include <pragmas/dos_lib.h>
  61. #include <pragmas/exec_lib.h>
  62. #include <pragmas/gadtools_lib.h>
  63. #include <pragmas/graphics_lib.h>
  64. #include <pragmas/intuition_lib.h>
  65.  
  66. /***************************** Global Constants **********************************/
  67.  
  68. #define NAME       "FindFile"
  69. #define MAXSTR       256
  70. #define MAXPAT       ( MAXSTR * 2 ) + 4
  71. #define OPEN_WINDOW 1
  72. #define FF_WIDTH    460
  73. #define FF_HEIGHT   165
  74.  
  75. /*** Useful debugging macros **/
  76.  
  77. /*#define DEBUG*/
  78. #ifdef DEBUG
  79. #define DB( x )      printf("%s():",__FUNC__ );puts( x );
  80. #define DBf( x , y ) printf("%s():",__FUNC__ );printf( x , y );
  81. #else
  82. #define DB( x )
  83. #define DBf( x , y )
  84. #endif
  85.  
  86. /** Gadget ID's **/
  87.  
  88. enum
  89. {
  90.   ID_PATGAD,ID_DEVGAD,ID_FILEREQ,ID_FOUNDLIST,
  91.   ID_SEARCH,ID_HIDE,ID_QUIT,ID_ABORT,
  92.   ID_NUMGADS
  93. };
  94.  
  95. /***************************** Structure Defs ************************************/
  96.  
  97. struct foundNode {
  98.   struct Node    fn_Node;
  99.   UBYTE   fn_Name[MAXSTR];
  100. };
  101.  
  102. struct controlPanel {
  103.   struct Window *ffWindow;
  104.   SHORT   lastX,
  105.      lastY;
  106.   BOOL       centerWindow;
  107.   BOOL       ignoreIcons;
  108.   BOOL       sortList;
  109.   UBYTE   ignoreIconsPat[MAXPAT];
  110.   struct VisualInfo *ffWinVi;
  111.   struct Gadget *ffWinGadList;
  112.   struct Gadget *ffWinGads[ ID_NUMGADS ];
  113.   struct FileRequester *ffFileReq;
  114.   UBYTE searchString[MAXSTR];
  115.   UBYTE searchPattern[MAXPAT];
  116.   UBYTE searchPath[MAXSTR];
  117.   WORD     numDevs;
  118.   STRPTR *devList;
  119.   struct MinList foundList;
  120.   UWORD  numFound;
  121.   UWORD  currFound;
  122.   struct {
  123.        struct MsgPort *cxPort;
  124.        CxObj      *ffBroker;
  125.        UBYTE       cxHotKeyString[MAXSTR];
  126.        LONG    cxPriority;
  127.   } cxInterface;
  128. };
  129.  
  130. /***************************** Function Prototypes *******************************/
  131.  
  132. void Init( struct controlPanel * );
  133. void SetUp( struct controlPanel * , int , char ** );
  134. void Shutdown( struct controlPanel * , int );
  135.  
  136. ULONG GetWaitMask( struct controlPanel * );
  137.  
  138. void OpenFFWindow( struct controlPanel * );
  139. void CloseFFWindow( struct controlPanel * );
  140. void HandleFFWindowCommand( struct controlPanel * );
  141.  
  142. void CreateFFGadgets( struct controlPanel *, int , BYTE);
  143. void CenterWindow( struct Screen *, WORD *, WORD * );
  144. struct foundNode *NodeAddress( struct MinList * , UWORD );
  145. BOOL QuitCheck( struct controlPanel * );
  146.  
  147. void  Bstrcpy( UBYTE * , BSTR );
  148. STRPTR *GetDevList( struct controlPanel * );
  149. void  FreeDevList( STRPTR * );
  150. BOOL  ScanDir( STRPTR , struct controlPanel * );
  151. BOOL  MatchFile( struct controlPanel *, STRPTR );
  152.  
  153. void AddPathNode( STRPTR , BPTR );
  154. void DeletePathNode( STRPTR );
  155. struct foundNode *AddFoundNode( struct MinList *, STRPTR , BOOL );
  156. void DeleteFoundList( struct MinList * );
  157. void AddFoundFile( struct controlPanel *, BPTR, STRPTR );
  158.  
  159. void OpenCxInterface( struct controlPanel * );
  160. void CloseCxInterface( struct controlPanel * );
  161. void HandleCxCommand( struct controlPanel * );
  162.  
  163. void DoFileRequest( struct controlPanel * );
  164.  
  165. void CMD_Show( struct controlPanel * );
  166. void CMD_Hide( struct controlPanel * );
  167. void CMD_Search( struct controlPanel * );
  168. void CMD_Quit( struct controlPanel * );
  169.  
  170.