home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-27 | 4.3 KB | 189 lines | [TEXT/CWIE] |
- unit MyTypes;
-
- { From Peter's PNL Libraries }
- { Copyright 1992 Peter N Lewis }
- { This source may be used for any non-commercial purposes as long as I get a mention }
- { in the About box and Docs of any derivative program. It may not be used in any commercial }
- { application without my permission }
-
- interface
-
- uses
- Quickdraw, Events;
-
- const
- inProgress = 1; { I/O in progress }
- sysWDProcID = $4552494B; { 'ERIK' }
- myErr = -5;
- myErr2 = -6;
- cancelErr = myErr2;
- myErr3 = -7;
- noType = 0; { should be OSType(0) !!! }
- fsNoCache = $20;
- fsNewLine = $80; { put the newline character in the high Byte of ioPosMode }
- bad_rn = 0;
- bad_date = 1; {$80000000;}
- bad_refnum = -32768;
- bad_vrefnum = -4567;
- bad_dirID = -4567;
- window_at_front = WindowPtr(-1);
-
- const
- ticks_in_ms = 17;
- second_in_ms = 1000;
- minute_in_ms = longint(60) * second_in_ms;
- hour_in_ms = longint(60) * minute_in_ms;
- day_in_ms = longint(24) * hour_in_ms;
- second_in_ticks = longint(60);
- minute_in_ticks = longint(60)*second_in_ticks;
- hour_in_ticks = longint(60)*minute_in_ticks;
- day_in_ticks = longint(24)*hour_in_ticks;
- minute_in_seconds = longint(60);
- hour_in_seconds = longint(60)*minute_in_seconds;
- day_in_seconds = longint(24)*hour_in_seconds;
- hour_in_minutes = longint(60);
- day_in_minutes = longint(24)*hour_in_minutes;
- day_in_hours = longint(24);
-
- const
- M_Apple = 128;
- M_File = 129;
- M_Edit = 130;
- M_Windows = 150;
-
- const
- Cabout = 'abou';
- Cnew = 'new ';
- Copen = 'open';
- Csave = 'save';
- Csaveas = 'svas';
- Cclose = 'clos';
- Cpreferences = 'pref';
- Cpagesetup = 'pgsu';
- Cprint = 'prnt';
- Chelp = 'help';
- Cquit = 'quit';
- Cundo = 'undo';
- Ccut = 'cut ';
- Ccopy = 'copy';
- Cpaste = 'past';
- Cclear = 'clea';
- Cselectall = 'sela';
-
- const
- keyOdocOption = 'auto'; { optional parameter to open }
- keyOdocControl = 'autC'; { optional parameter to open }
-
- const { Low Memory Globals }
- curApNameA = $910;
- ticksA = $16A;
- SFSaveDiskA = $214;
- CurDirStoreA = $398;
-
- const { Other OS constants, probably declared somewhere now }
- kSysEnvironsVersion = 1;
- kOSEvent = osEvt; {event used by MultiFinder}
- kSuspendResumeMessage = 1; {high Byte of suspend/resume event message}
- kResumeMask = 1; {bit of message field for resume vs. suspend}
- kMouseMovedMessage = $00FA; {high Byte of mouse-moved event message}
- kNoEvents = 0; {no events mask}
-
- const { Constants that aren't normally defined }
- drawCntlMsg = 0;
- testCntlMsg = 1;
- calcCRgnsMsg = 2;
- initCntlMsg = 3;
- dispCntlMsg = 4;
- posCntlMsg = 5;
- thumbCntlMsg = 6;
- dragCntlMsg = 7;
- autoTrackMsg = 8;
-
- const
- EMundo = 1;
- EMcut = 3;
- EMcopy = 4;
- EMpaste = 5;
- EMclear = 6;
- EMselectall = 7;
-
- const
- nulChar = 0;
- homeChar = $01;
- enterChar = $03;
- endChar = $04;
- helpChar = $05;
- backSpaceChar = $08;
- tabChar = $09;
- lfChar = $0A;
- pageUpChar = $0b;
- pageDownChar = $0c;
- crChar = $0D;
- escChar = $1b;
- escKey = $35;
- clearChar = $1b;
- clearKey = $47;
- leftArrowChar = $1c;
- rightArrowChar = $1d;
- upArrowChar = $1e;
- downArrowChar = $1f;
- spaceChar = $20;
- delChar = $7f;
- bulletChar = $a5;
- undoKey = $7a;
- cutKey = $78;
- copyKey = $63;
- pasteKey = $76;
-
- const
- nul = chr(nulChar);
- enter = chr(enterChar);
- bs = chr(backSpaceChar);
- tab = chr(tabChar);
- lf = chr(lfChar);
- cr = chr(crChar);
- leftArrow = chr(leftArrowChar);
- rightArrow = chr(rightArrowChar);
- upArrow = chr(upArrowChar);
- downArrow = chr(downArrowChar);
- esc = chr(escChar);
- spc = chr(spaceChar);
- del = chr(delChar);
-
- type
- integerP = ^integer;
- integerH = ^integerP;
- unsignedwordP = ^unsignedword;
- unsignedwordH = ^unsignedwordP;
- longintP = ^longint;
- longintH = ^longintP;
- unsignedlongP = ^unsignedlong;
- unsignedlongH = ^unsignedlongP;
- ptrint = longint; { integer type to cast pointers to to do pointer arithmatic }
- forkType = (no_fork, data_fork, rsrc_fork, both_fork);
- buf255 = packed array[0..255] of char;
- CRLFTypes = (CL_CRLF, CL_CR, CL_LF);
- CharSet = set of char;
- short = integer;
- long = longint;
-
- type
- QDGlobalsPtr = ^QDGlobals;
-
- function GetQDGlobals: QDGlobalsPtr;
- {$IFC not GENERATINGPOWERPC }
- inline
- $2015, $0480, $0000, $00CA, $2E80;
- {$ENDC}
-
- implementation
-
- {$IFC GENERATINGPOWERPC }
- function GetQDGlobals: QDGlobalsPtr;
- begin
- GetQDGlobals := @qd;
- end;
- {$ENDC}
-
- end.
-