home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
037.lha
/
DU
/
MyGlobals.def
< prev
next >
Wrap
Text File
|
1987-05-16
|
5KB
|
130 lines
DEFINITION MODULE MyGlobals;
(*
PART OF Windowed development program for Modula 2
This contains the definitions of all global stuff
Written: 5/8/87 by Greg Browne
Compiles on TDI's Modula-2 Compiler version 2.20a
NOTES: I kept being bugged with RefreshWindow not being exported from
Intuition as a flag. Then I found that it is either misspelled
in the .def module (as ResfreshWindow) or that it is supposed
to mean ResetFreshWindow. Don't know whats up but it works now.
*)
FROM Intuition IMPORT ActivationFlags,ActivationFlagSet,Gadget,
PropFlags,PropFlagSet,IntuitionText,
RequesterPtr,WindowPtr,StringInfo,
IntuiMessagePtr,GadgetPtr,IDCMPFlags,
IDCMPFlagSet;
FROM GraphicsLibrary IMPORT DrawingModes,DrawingModeSet;
FROM DOSFiles IMPORT FileInfoBlock,FileLock,InfoData;
(*--------------------------------------------------------------------*)
(* ALMOST ALL CONSTANTS AND MOST VARIABLES/TYPES DEFINED IN .DEF FILE
FOR IMPORTATION
*)
CONST
StringBufSize = 255;
RegFlags = ActivationFlagSet{RelVerify,GadgetImmediate};
StringFlags = ActivationFlagSet{StringCenter} + RegFlags;
JamTwo = DrawingModeSet{Jam2};
SliderFlags = PropFlagSet{FreeVert,AutoKnob};
CloseMe = IDCMPFlagSet{CloseWindowFlag};
RefreshMe = IDCMPFlagSet{ResfreshWindow};
GotOne = IDCMPFlagSet{GadgetUp};
TYPE
WBColors = (Blue,White,Black,Green); (* My workbench colors *)
(*
Gadgets are addressed as a set. First are the devices, then the message
string gadgets, then the command gadgets, and finally the slider. Note
that this is larger than a BITSET already, so the 'GadgetID' is passed as
a set name and converted as CARDINAL(ORD(whatever)). Expansion of the set
should be easy, with only screen positioning being the hard part.
*)
GadgetNames = (df0,df1,df2,dh0,dh1,ram,vd0,
up1,down1,
filewindow,
arc,bytes,copy,copydel,deldir,delete,
dofr,dorf,edit,hprint,htype,info,link,makedir,
modula,move,parent,print,rename,
retag,root,show,stod,swap,tagall,type,untag,
slider,
brun,bsource,bdest, (* relative order of these six *)
run,source,dest, (* IS IMPORTANT *)
msg);
(* EXTERNAL AVAILABLE VARIABLES *)
VAR
IOStringInfo : ARRAY[run..msg] OF StringInfo;
NullReqPtr : RequesterPtr; (* initialized to be NULL always *)
MyWindowPtr : WindowPtr;
IOString : ARRAY[run..msg] OF ARRAY[0..StringBufSize-1] OF CHAR;
GadTxt : ARRAY GadgetNames OF IntuitionText;
MyGads : ARRAY GadgetNames OF Gadget;
MyMsg : IntuiMessagePtr;
MyClass : IDCMPFlagSet;
MyGadPtr : GadgetPtr;
FileText : IntuitionText;
TYPE
CharPtr = POINTER TO CHAR;
FileInfoBlockPtr = POINTER TO FileInfoBlock;
VAR
Curfirst : CARDINAL; (* current first on screen *)
Curdir, (* current dir name *)
Reqdir : ARRAY [0..90] OF CHAR; (* requested dir name *)
Entrydirlock, (* For later *)
Lastdirlock, (* Temporary may use later *)
Curdirlock, (* Current directory lock *)
Reqdirlock : FileLock; (* Requested dir lock *)
inf : POINTER TO InfoData; (* for getting INFO *)
v : ARRAY[0..33] OF CHAR;
Stop : BOOLEAN;
GadGot : GadgetNames;
MyX,MyY : INTEGER;
Gp : ARRAY[0..255] OF CHAR;
from : FileLock;
Boo : BOOLEAN;
CONST
MaxMax = 250; (* Changing this allows more/less files *)
(* eats mucho runtime memory 38 bytes ea *)
MaxScreenFiles = 12;
TYPE
DirInfo = RECORD
FileName : ARRAY[0..30] OF CHAR;
IsDir : BOOLEAN;
IsSelected : BOOLEAN;
WasSelected : BOOLEAN;
FileSize : LONGCARD;
END;
DirPtr = POINTER TO DirInfo;
VAR
DirEntries : CARDINAL;
(* This table is full of pointers to allocated memory for storing
directory entries *)
DirTable : ARRAY[0..MaxMax] OF DirPtr;
MaxFiles : CARDINAL;
IntRead : BOOLEAN;
END MyGlobals.