home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 037.lha / DU / MyGlobals.def < prev    next >
Text File  |  1987-05-16  |  5KB  |  130 lines

  1. DEFINITION MODULE MyGlobals;
  2.  
  3. (*
  4.         PART OF Windowed development program for Modula 2
  5.  
  6.         This contains the definitions of all global stuff
  7.  
  8.         Written: 5/8/87 by Greg Browne
  9.  
  10.         Compiles on TDI's Modula-2 Compiler version 2.20a
  11.  
  12.  NOTES: I kept being bugged with RefreshWindow not being exported from
  13.         Intuition as a flag. Then I found that it is either misspelled
  14.         in the .def module (as  ResfreshWindow) or that it is supposed
  15.         to mean ResetFreshWindow. Don't know whats up but it works now.
  16.  
  17.  
  18. *)
  19.  
  20. FROM Intuition          IMPORT  ActivationFlags,ActivationFlagSet,Gadget,
  21.                                 PropFlags,PropFlagSet,IntuitionText,
  22.                                 RequesterPtr,WindowPtr,StringInfo,
  23.                                 IntuiMessagePtr,GadgetPtr,IDCMPFlags,
  24.                                 IDCMPFlagSet;
  25. FROM GraphicsLibrary    IMPORT  DrawingModes,DrawingModeSet;
  26. FROM DOSFiles           IMPORT  FileInfoBlock,FileLock,InfoData;
  27. (*--------------------------------------------------------------------*)
  28.  
  29. (* ALMOST ALL CONSTANTS AND MOST VARIABLES/TYPES DEFINED IN .DEF FILE
  30.    FOR IMPORTATION
  31. *)
  32.  
  33. CONST
  34.   StringBufSize = 255;
  35.   RegFlags      = ActivationFlagSet{RelVerify,GadgetImmediate};
  36.   StringFlags   = ActivationFlagSet{StringCenter} + RegFlags;
  37.   JamTwo        = DrawingModeSet{Jam2};
  38.   SliderFlags   = PropFlagSet{FreeVert,AutoKnob};
  39.   CloseMe       = IDCMPFlagSet{CloseWindowFlag};
  40.   RefreshMe     = IDCMPFlagSet{ResfreshWindow};
  41.   GotOne        = IDCMPFlagSet{GadgetUp};
  42.  
  43. TYPE
  44.   WBColors      = (Blue,White,Black,Green);     (* My workbench colors *)
  45.  
  46. (*
  47.    Gadgets are addressed as a set. First are the devices, then the message
  48.    string gadgets, then the command gadgets, and finally the slider.  Note
  49.    that this is larger than a BITSET already, so the 'GadgetID' is passed as
  50.    a set name and converted as CARDINAL(ORD(whatever)). Expansion of the set
  51.    should be easy, with only screen positioning being the hard part.
  52. *)
  53.  
  54.   GadgetNames   = (df0,df1,df2,dh0,dh1,ram,vd0,
  55.                    up1,down1,
  56.                    filewindow,
  57.                    arc,bytes,copy,copydel,deldir,delete,
  58.                    dofr,dorf,edit,hprint,htype,info,link,makedir,
  59.                    modula,move,parent,print,rename,
  60.                    retag,root,show,stod,swap,tagall,type,untag,
  61.                    slider,
  62.                    brun,bsource,bdest, (* relative order of these six *)
  63.                    run,source,dest,    (* IS IMPORTANT *)
  64.                    msg);
  65.  
  66. (* EXTERNAL AVAILABLE VARIABLES *)
  67.  
  68. VAR
  69.  
  70.   IOStringInfo  : ARRAY[run..msg] OF StringInfo;
  71.   NullReqPtr    : RequesterPtr;   (* initialized to be NULL always *)
  72.   MyWindowPtr   : WindowPtr;
  73.   IOString      : ARRAY[run..msg] OF ARRAY[0..StringBufSize-1] OF CHAR;
  74.   GadTxt        : ARRAY GadgetNames OF IntuitionText;
  75.   MyGads        : ARRAY GadgetNames OF Gadget;
  76.   MyMsg         : IntuiMessagePtr;
  77.   MyClass       : IDCMPFlagSet;
  78.   MyGadPtr      : GadgetPtr;
  79.   FileText      : IntuitionText;
  80.  
  81. TYPE
  82.   CharPtr          = POINTER TO CHAR;
  83.   FileInfoBlockPtr = POINTER TO FileInfoBlock;
  84.  
  85. VAR
  86.   Curfirst      : CARDINAL;              (* current first on screen *)
  87.   Curdir,                                (* current dir name        *)
  88.   Reqdir        : ARRAY [0..90] OF CHAR; (* requested dir name      *)
  89.   Entrydirlock,                          (* For later               *)
  90.   Lastdirlock,                           (* Temporary may use later *)
  91.   Curdirlock,                            (* Current directory lock  *)
  92.   Reqdirlock    : FileLock;              (* Requested dir lock      *)
  93.   inf           : POINTER TO InfoData;   (* for getting INFO        *)
  94.   v             : ARRAY[0..33] OF CHAR;
  95.   Stop          : BOOLEAN;
  96.   GadGot        : GadgetNames;
  97.   MyX,MyY       : INTEGER;
  98.   Gp            : ARRAY[0..255] OF CHAR;
  99.   from          : FileLock;
  100.   Boo           : BOOLEAN;
  101.  
  102.  
  103. CONST
  104.   MaxMax                = 250;  (* Changing this allows more/less files  *)
  105.                                 (* eats mucho runtime memory 38 bytes ea *)
  106.   MaxScreenFiles        = 12;
  107.  
  108. TYPE
  109.   DirInfo       = RECORD
  110.                     FileName    : ARRAY[0..30] OF CHAR;
  111.                     IsDir       : BOOLEAN;
  112.                     IsSelected  : BOOLEAN;
  113.                     WasSelected : BOOLEAN;
  114.                     FileSize    : LONGCARD;
  115.                   END;
  116.   DirPtr        = POINTER TO DirInfo;
  117.  
  118. VAR
  119.   DirEntries    : CARDINAL;
  120.  
  121.     (* This table is full of pointers to allocated memory for storing
  122.        directory entries   *)
  123.  
  124.   DirTable      : ARRAY[0..MaxMax] OF DirPtr;
  125.   MaxFiles      : CARDINAL;
  126.   IntRead       : BOOLEAN;
  127.  
  128.  
  129. END MyGlobals.
  130.