Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rochester!bullwinkle!uw-beaver!tikal!bobc From: bobc@tikal.UUCP (Bob Campbell) Newsgroups: net.sources.mac Subject: ETHZ Standalone Definition Modules (3 of 4) Message-ID: <424@tikal.UUCP> Date: Thu, 8-May-86 15:42:14 EDT Article-I.D.: tikal.424 Posted: Thu May 8 15:42:14 1986 Date-Received: Wed, 14-May-86 05:08:16 EDT Reply-To: bobc@tikal.UUCP (Bob Campbell) Organization: Teltone Corp., Kirkland, WA Lines: 744 # The rest of this file is a shell script which will extract: # MemoryManager.DEF MenuManager.DEF PascalStrings.DEF Pictures.DEF # QuickDraw.DEF Regions.DEF echo x - MemoryManager.DEF cat >MemoryManager.DEF <<'!Funky!Stuff!' DEFINITION MODULE MemoryManager; FROM SYSTEM IMPORT ADDRESS; FROM MacSYSTEM IMPORT Handle,LONGINT,OSErr,noErr; EXPORT QUALIFIED (*CONST*) maxSize, (* Result codes *) memFullErr,memLockedErr,memPurErr,memWZErr,nilHandleErr, (*TYPES*) Size,THz,Zone,MyGrowZone, (*VAR*) DefltStack,MinStack,MemTop,ScrnBase,BufPtr,CurrentA5, CurStackBase,ApplLimit,HeapEnd,ApplZone,SysZone,TheZone,GZRootHnd, (* Routines *) InitApplZone,SetApplBase,InitZone,GetApplLimit,SetApplLimit,MaxApplZone, MoreMasters, GetZone,SetZone,SystemZone,ApplicZone, NewHandle,DisposHandle,GetHandleSize,SetHandleSize, HandleZone,RecoverHandle,ReallocHandle, NewPtr,DisposPtr,GetPtrSize,SetPtrSize,PtrZone, FreeMem,MaxMem,CompactMem,ResrvMem,PurgeMem,EmptyHandle, HLock,HUnlock,HPurge,HNoPurge, SetGrowZone,GZSaveHnd, BlockMove,TopMem,MoveHHi,MemError; CONST maxSize = 0800000H; (* Result codes *) memFullErr = -108; (* not enough room in zone *) memLockedErr = -117; (* block is locked *) memPurErr = -112; (* attempt to purge a locked block *) memWZErr = -111; (* attempt to operate on a free block *) nilHandleErr = -109; (* NIL master pointer *) TYPE Size = LONGINT; THz = POINTER TO Zone; Zone = RECORD bkLim: ADDRESS; (* limit pointer *) purgePtr: ADDRESS; (* used internally *) hFatFree: ADDRESS; (* first free master pointer *) zcbFree: LONGINT; (* number of free bytes *) gzProc: ADDRESS; (* grow zone function *) moreMast: INTEGER; (* master pointers to allocate *) flags: INTEGER; (* used internally *) cntRel: INTEGER; (* relocatable blocks *) maxRel: INTEGER; (* maximum cntRel value *) cntNRel: INTEGER; (* nonrelocatable blocks *) maxNRel: INTEGER; (* maximum maxRel value *) cntEmpty: INTEGER; (* empty master pointers *) cntHandles: INTEGER; (* total master pointers *) minCBFree: LONGINT; (* minimum zcbFree value *) purgeProc: ADDRESS; (* purge warning procedure *) sparePtr: ADDRESS; (* used internally *) allocPtr: ADDRESS; (* used internally *) heapData: INTEGER; (* first usable byte in zone *) END; MyGrowZone = PROCEDURE(Size):Size; VAR DefltStack[0322H]: LONGINT; MinStack[031EH]: LONGINT; MemTop[0108H]: ADDRESS; ScrnBase[0824H]: ADDRESS; BufPtr[010CH]: ADDRESS; CurrentA5[0904H]: ADDRESS; CurStackBase[0908H]: ADDRESS; ApplLimit[0130H]: ADDRESS; HeapEnd[0114H]: ADDRESS; ApplZone[02AAH]: ADDRESS; SysZone[02A6H]: ADDRESS; TheZone[0118H]: ADDRESS; GZRootHnd[0328H]: ADDRESS; (* Routines *) (* Initialization and Allocation *) PROCEDURE InitApplZone; PROCEDURE SetApplBase(startPtr:ADDRESS); PROCEDURE InitZone(pGrowZone:ADDRESS;cMoreMasters:INTEGER; limitPtr,startPtr:ADDRESS); PROCEDURE GetApplLimit():ADDRESS;(* Not in ROM *) PROCEDURE SetApplLimit(zoneLimit:ADDRESS); PROCEDURE MaxApplZone; (* No trap Macro *) PROCEDURE MoreMasters; (* Heap Zone Access *) PROCEDURE GetZone():THz; PROCEDURE SetZone(hz:THz); PROCEDURE SystemZone():THz; (* No trap macro *) PROCEDURE ApplicZone():THz; (* No trap macro *) (* Allocating and Releasing Relocatable Blocks *) PROCEDURE NewHandle(logicalSize:Size):Handle; PROCEDURE DisposHandle(h:Handle); PROCEDURE GetHandleSize(h:Handle):Size; PROCEDURE SetHandleSize(h:Handle;newSize:Size); PROCEDURE HandleZone(h:Handle):THz; PROCEDURE RecoverHandle(p:ADDRESS):Handle; PROCEDURE ReallocHandle(h:Handle;logicalSize:Size); (* Allocating and Releasing Nonrelocatable Blocks *) PROCEDURE NewPtr(logicalSize:Size):ADDRESS; PROCEDURE DisposPtr(p:ADDRESS); PROCEDURE GetPtrSize(p:ADDRESS):Size; PROCEDURE SetPtrSize(p:ADDRESS;newSize:Size); PROCEDURE PtrZone(p:ADDRESS):THz; (* Freeing Space in the Heap *) PROCEDURE FreeMem():LONGINT; PROCEDURE MaxMem(VAR grow:Size):Size; PROCEDURE CompactMem(cbNeeded:Size):Size; PROCEDURE ResrvMem(cbNeeded:Size); PROCEDURE PurgeMem(cbNeeded:Size); PROCEDURE EmptyHandle(h:Handle); (* Properties of Relocatable Blocks *) PROCEDURE HLock(h:Handle); PROCEDURE HUnlock(h:Handle); PROCEDURE HPurge(h:Handle); PROCEDURE HNoPurge(h:Handle); (* Grow Zone Operations *) PROCEDURE SetGrowZone(growZone:ADDRESS); PROCEDURE GZSaveHnd():Handle; (* No trap macro *) (* Miscellaneous Routines *) PROCEDURE BlockMove(src,dst:ADDRESS;count:Size); PROCEDURE TopMem():ADDRESS; (* No trap macro *) PROCEDURE MoveHHi(h:Handle); (* No trap macro *) PROCEDURE MemError():OSErr; (* No trap macro *) END MemoryManager. !Funky!Stuff! echo x - MenuManager.DEF cat >MenuManager.DEF <<'!Funky!Stuff!' DEFINITION MODULE MenuManager; FROM SYSTEM IMPORT ADDRESS,WORD; FROM MacSYSTEM IMPORT LONGINT,Handle; FROM QuickDraw IMPORT Point,Rect,Style; FROM ResourceManager IMPORT ResType; EXPORT QUALIFIED (*CONST*) (* Special Characters *) noMark,commandMark,checkMark,diamondMark,appleMark, (* Messages to menu definition procedure *) mDrawMsg,mChooseMsg,mSizeMsg, (* Resource ID of standard menu definition procedure *) textMenuProc, (*TYPE*) MenuHandle,MenuPtr,MenuInfo, (*PROC*) NewMenu,GetMenu,DisposeMenu, (*Forming the Menus*) AppendMenu,AddResMenu,InsertResMenu, (*Forming the Menus*) InsertMenu,DrawMenuBar,DeleteMenu,ClearMenuBar,GetNewMBar, GetMenuBar,SetMenuBar, (*Choosing from a menu*) MenuSelect,MenuKey,HiliteMenu, (*Controlling Items' Appearance*) SetItem,GetItem,DisableItem,EnableItem,CheckItem,SetItemMark, GetItemMark,SetItemIcon,GetItemIcon,SetItemStyle,GetItemStyle, (*Miscellaneous Routines*) CalcMenuSize,CountMItems,GetMHandle,FlashMenuBar,SetMenuFlash; CONST (* Special Characters *) noMark = 0C; (* NULL Char, to remove a mark *) commandMark = 021C; (* Command Key Symbol *) checkMark = 022C; diamondMark = 023C; appleMark = 024C; (* Messages to menu definition procedure *) mDrawMsg = 0; (* draw the menu *) mChooseMsg = 1; (* tell which item was chosen and highlight it *) mSizeMsg = 2; (* calculate the menu's dimensions *) (* Resource ID of standard menu definition procedure *) textMenuProc = 0; TYPE MenuHandle = POINTER TO MenuPtr; MenuPtr = POINTER TO MenuInfo; MenuInfo = RECORD menuID: INTEGER; menuWidth: INTEGER; menuHeight: INTEGER; menuProc: Handle; enableFlags: LONGINT; menuData: ARRAY [0..255] OF CHAR; END; PROCEDURE NewMenu(menuID:INTEGER;VAR menuTitle:ARRAY OF CHAR):MenuHandle; PROCEDURE GetMenu(resourceID:INTEGER):MenuHandle; PROCEDURE DisposeMenu(theMenu:MenuHandle); (*Forming the Menus*) PROCEDURE AppendMenu(theMenu:MenuHandle;VAR data:ARRAY OF CHAR); PROCEDURE AddResMenu(theMenu:MenuHandle;theType:ResType); PROCEDURE InsertResMenu(theMenu:MenuHandle;theType:ResType; afterItem:INTEGER); (*Forming the Menus*) PROCEDURE InsertMenu(theMenu:MenuHandle;beforeID:INTEGER); PROCEDURE DrawMenuBar; PROCEDURE DeleteMenu(menuID:INTEGER); PROCEDURE ClearMenuBar; PROCEDURE GetNewMBar(menuBarID:INTEGER):Handle; PROCEDURE GetMenuBar():Handle; PROCEDURE SetMenuBar(menuList:Handle); (*Choosing from a menu*) PROCEDURE MenuSelect(startPt:Point):LONGINT; PROCEDURE MenuKey(ch:CHAR):LONGINT; PROCEDURE HiliteMenu(menuID:INTEGER); (*Controlling Items' Appearance*) PROCEDURE SetItem(theMenu:MenuHandle;item:INTEGER;VAR itemString:ARRAY OF CHAR); PROCEDURE GetItem(theMenu:MenuHandle;item:INTEGER;VAR itemString:ARRAY OF CHAR); PROCEDURE DisableItem(theMenu:MenuHandle;item:INTEGER); PROCEDURE EnableItem(theMenu:MenuHandle;item:INTEGER); PROCEDURE CheckItem(theMenu:MenuHandle;item:INTEGER;checked:BOOLEAN); PROCEDURE SetItemMark(theMenu:MenuHandle;item:INTEGER;markChar:CHAR); PROCEDURE GetItemMark(theMenu:MenuHandle;item:INTEGER;VAR markChar:CHAR); PROCEDURE SetItemIcon(theMenu:MenuHandle;item:INTEGER;icon:CHAR); PROCEDURE GetItemIcon(theMenu:MenuHandle;item:INTEGER;VAR icon:CHAR); PROCEDURE SetItemStyle(theMenu:MenuHandle;item:INTEGER;chStyle:Style); PROCEDURE GetItemStyle (theMenu: MenuHandle;item:INTEGER; VAR chStyle:Style); (*Miscellaneous Routines*) PROCEDURE CalcMenuSize(theMenu:MenuHandle); PROCEDURE CountMItems(theMenu:MenuHandle):INTEGER; PROCEDURE GetMHandle(menuID:INTEGER):MenuHandle; PROCEDURE FlashMenuBar(menuID:INTEGER); PROCEDURE SetMenuFlash(count:INTEGER); END MenuManager. !Funky!Stuff! echo x - PascalStrings.DEF cat >PascalStrings.DEF <<'!Funky!Stuff!' DEFINITION MODULE PascalStrings; (* A.W. 20-NOV-84*) (* last modification 19.01.85 fxk *) (* * This module converts arrays of characters into strings, as expected by * the Lisa's or MacIntoshOS, and vice versa. *) EXPORT QUALIFIED MakePascalString, MakeModulaString, emptyPascalString; PROCEDURE MakePascalString(VAR in: ARRAY OF CHAR; VAR out: ARRAY OF CHAR); (* converts a modula string into a pascal string. NOTE: If "out" is not * long enough to hold the converted string, the latter is truncated! *) PROCEDURE MakeModulaString(VAR in: ARRAY OF CHAR; VAR out: ARRAY OF CHAR); (* converts a pascal string into a modula string. NOTE: If "out" is not * long enough to hold the converted string, the latter is truncated! *) PROCEDURE emptyPascalString(VAR string:ARRAY OF CHAR); (* makes an empty PascalString by setting length byte to zero *) END PascalStrings. !Funky!Stuff! echo x - Pictures.DEF cat >Pictures.DEF <<'!Funky!Stuff!' DEFINITION MODULE Pictures; FROM QuickDraw IMPORT Rect; EXPORT QUALIFIED (*CONST*) picLParen,picRParen, (*TYPES*) PicHandle,PicPtr,Picture, (* Picture Routines *) GetPicture,OpenPicture,ClosePicture, KillPicture,DrawPicture,PicComment; CONST picLParen =0; picRParen =1; (* standard picture comments *) TYPE PicHandle = POINTER TO PicPtr; PicPtr = POINTER TO Picture; Picture = RECORD picSize: INTEGER; picFrame: Rect; (* picture definition data *) END; (* Picture Routines *) PROCEDURE GetPicture(picID:INTEGER):PicHandle; PROCEDURE OpenPicture (VAR picFrame:Rect):PicHandle; PROCEDURE ClosePicture; PROCEDURE KillPicture (thePicture:PicHandle); PROCEDURE DrawPicture (thePicture:PicHandle;VAR inRect:Rect); PROCEDURE PicComment (kind,dataSize:INTEGER;data:PicHandle); END Pictures. !Funky!Stuff! echo x - QuickDraw.DEF cat >QuickDraw.DEF <<'!Funky!Stuff!' DEFINITION MODULE QuickDraw; (* Franz Kronseder 07.12.84 *) (* last modification 06.02.85 *) (* standalone modification 20.02.86 *) FROM SYSTEM IMPORT ADDRESS,WORD; FROM MacSYSTEM IMPORT LONGINT; (* * This code is addapted from Inside Macintosh(TM) Volume I * * Because of the extreme size of this module some parts have been * put in other modules where they make more sence. * * FontManager: GetFontInfo, and FontInfo. * Cursors: InitCursor, SetCursor, HideCursor, ShowCursor, * and ObscureCursor. * Pictures: picLParen, picRParen, PicHandle, PicPtr, Picture, OpenPicture, * PicComment, ClosePicture, DrawPicture, and KillPicture. * Regions: NewRgn, OpenRgn, CloseRgn, DisposeRgn, SetEmptyRgn, * RectRgn, CopyRgn, PtInRgn, RectInRgn, OffsetRgn, InsetRgn, EmptyRgn, * UnionRgn, SectRgn, DiffRgn, XOrRgn, EqualRgn, MapRgn, FrameRgn, * PaintRgn, FillRgn, EraseRgn, and InvertRgn. * Toolbox: Random, and StuffHex. *) EXPORT QUALIFIED (*CONST*) srcCopy,srcOr,srcXor,srcBic,notSrcCopy,notSrcOr,notSrcXor,notSrcBic, patCopy,patOr,patXor,patBic,notPatCopy,notPatOr,notPatXor,notPatBic, blackColor,whiteColor,redColor,greenColor,blueColor,cyanColor, magentaColor,yellowColor, (*TYPE*) Str255,QDHandle, StyleItem,Style,VHSelect,Point,Rect,RgnHandle,RgnPtr,Region, BitMap,Pattern,Bits16,Cursor,(*QDProcsPtr,QDProcs,*) GrafPtr, GrafPort,PolyHandle,PolyPtr,Polygon,PenState,GrafVerb, (*VAR*) randSeed,screenBits,arrow,dkGray,ltGray,gray,black,white,thePort, (* GrafPort Routines *) OpenPort,InitPort,ClosePort,SetPort,GetPort,GrafDevice, SetPortBits,PortSize,MovePortTo,SetOrigin,SetClip,GetClip, ClipRect,BackPat, (* Line Routines *) HidePen,ShowPen,GetPen,GetPenState,SetPenState,PenSize,PenMode, PenPat,PenNormal,MoveTo,Move,LineTo,Line, (* Text Routines *) TextFont,TextFace,TextMode,TextSize,SpaceExtra,DrawChar,DrawString, DrawText,CharWidth,StringWidth,TextWidth, (* Point Calculations *) AddPt,SubPt,SetPt,EqualPt,ScalePt,MapPt,LocalToGlobal,GlobalToLocal, (* Rectangle Calculations *) SetRect,EqualRect,EmptyRect,OffsetRect,MapRect,InsetRect,SectRect, UnionRect,PtInRect,Pt2Rect, (* Graphical Operations on Rectangles *) FrameRect,PaintRect,EraseRect,InvertRect,FillRect, (* RoundRect Routines *) FrameRoundRect,PaintRoundRect,FillRoundRect,EraseRoundRect, InvertRoundRect, (* Drawing Ovals *) FrameOval,PaintOval,EraseOval,InvertOval,FillOval, (* Arc Routines *) FrameArc,PaintArc,FillArc,EraseArc,InvertArc,PtToAngle, (* Polygon Routines *) OpenPoly,ClosePoly,KillPoly,OffsetPoly,MapPoly,FramePoly,PaintPoly, FillPoly,ErasePoly,InvertPoly, (* Graphical Operations on BitMaps *) ScrollRect,CopyBits, (* Misc Utility Routines *) GetPixel,ForeColor,BackColor,ColorBit; (* these definitions come from the MacIntosh Interface files * on the Lisa Workshop Supplement for the MAC. * Copyright 1983 Apple Computer Inc. *) (* the 16 transfer modes *) CONST srcCopy = 0; srcOr = 1; srcXor = 2; srcBic = 3; notSrcCopy = 4; notSrcOr = 5; notSrcXor = 6; notSrcBic = 7; patCopy = 8; patOr = 9; patXor = 10; patBic = 11; notPatCopy = 12; notPatOr = 13; notPatXor = 14; notPatBic = 15; (* normal screen mapping inverse screen mapping *) (* RGB additive mapping CMYBk subtractive mapping *) (* colors expressed in these mappings *) blackColor = 33; whiteColor = 30; redColor = 205; greenColor = 341; blueColor = 409; cyanColor = 273; magentaColor = 137; yellowColor = 69; TYPE QDHandle = POINTER TO ADDRESS; (* blind handle *) Str255 = ARRAY [0..255] OF CHAR; (* Pascal compatible String *) StyleItem = (bold,italic,underline,outline,shadow,condense,extend, unused1,unused2); (* sets of < 8 elements are a byte *) Style = SET OF StyleItem; VHSelect = (v,h); Point = RECORD CASE INTEGER OF 0: v: INTEGER;h: INTEGER; | 1: vh: ARRAY VHSelect OF INTEGER | 2: param:LONGINT END END; Rect = RECORD CASE INTEGER OF 0: top: INTEGER; left: INTEGER; bottom: INTEGER; right: INTEGER; | 1: topLeft: Point; botRight: Point; END END; (* Region Definitions are here to avoid cyclic imports *) RgnHandle = POINTER TO RgnPtr; RgnPtr = POINTER TO Region; Region = RECORD rgnSize: INTEGER; (* rgnSize = 10 for rectangular *) rgnBBox: Rect; (* plus more data if not rectangular *) END; BitMap = RECORD baseAddr: ADDRESS; rowBytes: INTEGER; bounds: Rect; END; Pattern = ARRAY[0..7] OF SET OF [0..7]; Bits16 = ARRAY[0..15] OF INTEGER; Cursor = RECORD data: Bits16; mask: Bits16; hotSpot: Point; END; (* * Not supported yet, removed to save space. * * QDProcsPtr = POINTER TO QDProcs; * QDProcs = RECORD * textProc: ADDRESS; * lineProc: ADDRESS; * rectProc: ADDRESS; * rRectProc: ADDRESS; * ovalProc: ADDRESS; * arcProc: ADDRESS; * polyProc: ADDRESS; * rgnProc: ADDRESS; * bitsProc: ADDRESS; * commentProc: ADDRESS; * txMeasProc: ADDRESS; * getPicProc: ADDRESS; * putPicProc: ADDRESS; * END; *) GrafPtr = POINTER TO GrafPort; GrafPort = RECORD device: INTEGER; portBits: BitMap; portRect: Rect; visRgn: RgnHandle; clipRgn: RgnHandle; bkPat: Pattern; fillPat: Pattern; pnLoc: Point; pnSize: Point; pnMode: INTEGER; pnPat: Pattern; pnVis: INTEGER; txFont: INTEGER; txFace: Style; txMode: INTEGER; txSize: INTEGER; spExtra: LONGINT; fgColor: LONGINT; bkColor: LONGINT; colrBit: INTEGER; patStretch: INTEGER; picSave: QDHandle; rgnSave: QDHandle; polySave: QDHandle; grafProcs: ADDRESS; (* was QDProcsPtr *) END; (* PicHandle, PicPtr, and Picture moved to Pictures *) PolyHandle = POINTER TO PolyPtr; PolyPtr = POINTER TO Polygon; Polygon = RECORD polySize: INTEGER; polyBBox: Rect; polyPoints: ARRAY [0..0] OF Point END; PenState = RECORD pnLoc: Point; pnSize: Point; pnMode: INTEGER; pnPat: Pattern; END; GrafVerb = (frame,paint,erase,invert,fill); VAR (* Must pad for Private QuickDraw Values *) QDPad: ARRAY[0..37] OF CARDINAL; (* wideOpen EQU $FFFFFF7E ; RgnHandle wideMaster EQU $FFFFFF7A ; RgnPtr wideData EQU $FFFFFF70 ; Fake Region rgnBuf EQU $FFFFFF6C ; PointsHandle rgnIndex EQU $FFFFFF6A ; INTEGER rgnMax EQU $FFFFFF68 ; INTEGER playPic EQU $FFFFFF64 ; Long playIndex EQU $FFFFFF62 ; INTEGER thePoly EQU $FFFFFF5E ; POLYHANDLE polyMax EQU $FFFFFF5C ; INTEGER patAlign EQU $FFFFFF58 ; Point fontAdj EQU $FFFFFF54 ; Fixed Point fontPtr EQU $FFFFFF50 ; long, ^FMOutput record fontData EQU $FFFFFF36 ; FMOutput record lastGrafGlob EQU $FFFFFF36 *) randSeed: LONGINT; (* -126 *) screenBits: BitMap; (* -122 *) arrow: Cursor; (* -108 *) dkGray: Pattern; (* -40 *) ltGray: Pattern; (* -32 *) gray: Pattern; (* -24 *) black: Pattern; (* -16 *) white: Pattern; (* -8 *) thePort: GrafPtr; (* 0 *) (* GrafPort Routines *) (* InitGraf is automaticly called *) PROCEDURE OpenPort (port: GrafPtr); PROCEDURE InitPort (port: GrafPtr); PROCEDURE ClosePort (port: GrafPtr); PROCEDURE SetPort (port: GrafPtr); PROCEDURE GetPort (VAR port: GrafPtr); PROCEDURE GrafDevice (device: INTEGER); PROCEDURE SetPortBits(VAR bm: BitMap); PROCEDURE PortSize (width,height: INTEGER); PROCEDURE MovePortTo (leftGlobal,topGlobal: INTEGER); PROCEDURE SetOrigin (h,v: INTEGER); PROCEDURE SetClip (rgn: RgnHandle); PROCEDURE GetClip (rgn: RgnHandle); PROCEDURE ClipRect (VAR r: Rect); PROCEDURE BackPat (VAR pat: Pattern); (* Cursor Routines moved to Cursors *) (* Line Routines *) PROCEDURE HidePen; PROCEDURE ShowPen; PROCEDURE GetPen (VAR pt: Point); PROCEDURE GetPenState(VAR pnState: PenState); PROCEDURE SetPenState(VAR pnState: PenState); PROCEDURE PenSize (width,height: INTEGER); PROCEDURE PenMode (mode: INTEGER); PROCEDURE PenPat (VAR pat: Pattern); PROCEDURE PenNormal; PROCEDURE MoveTo (h,v: INTEGER); PROCEDURE Move (dh,dv: INTEGER); PROCEDURE LineTo (h,v: INTEGER); PROCEDURE Line (dh,dv: INTEGER); (* Text Routines *) PROCEDURE TextFont (font: INTEGER); PROCEDURE TextFace (face: Style); PROCEDURE TextMode (mode: INTEGER); PROCEDURE TextSize (size: INTEGER); PROCEDURE SpaceExtra (extra: LONGINT); PROCEDURE DrawChar (ch: CHAR); PROCEDURE DrawString (VAR s:ARRAY OF CHAR); PROCEDURE DrawText (textBuf: ADDRESS; firstByte,byteCount: INTEGER); PROCEDURE CharWidth (ch: CHAR): INTEGER; PROCEDURE StringWidth (VAR s:ARRAY OF CHAR): INTEGER; PROCEDURE TextWidth (textBuf: ADDRESS; firstByte,byteCount: INTEGER): INTEGER; (* GetFontInfo moved to FontManager *) (* Drawing In Color *) PROCEDURE ForeColor (color:LONGINT); PROCEDURE BackColor (color:LONGINT); PROCEDURE ColorBit (whichBit:INTEGER); (* Rectangle Calculations *) PROCEDURE SetRect (VAR r:Rect;left,top,right,bottom:INTEGER); PROCEDURE OffsetRect(VAR r:Rect;dh,dv:INTEGER); PROCEDURE InsetRect (VAR r:Rect;dh,dv:INTEGER); PROCEDURE SectRect (VAR src1,src2:Rect;VAR dstRect:Rect):BOOLEAN; PROCEDURE UnionRect (VAR src1,src2:Rect;VAR dstRect:Rect); PROCEDURE PtInRect (pt: Point; dstRect:Rect):BOOLEAN; PROCEDURE Pt2Rect (pt1,pt2:Point;VAR dstRect:Rect); PROCEDURE PtToAngle(inRect:Rect;thePoint:Point;VAR theAngle:INTEGER); PROCEDURE EqualRect(VAR rect1,rect2:Rect):BOOLEAN; PROCEDURE EmptyRect(VAR r:Rect):BOOLEAN; (* Graphical Operations on Rectangles *) PROCEDURE FrameRect (VAR r: Rect); PROCEDURE PaintRect (VAR r: Rect); PROCEDURE EraseRect (VAR r: Rect); PROCEDURE InvertRect (VAR r: Rect); PROCEDURE FillRect (VAR r: Rect;VAR pat: Pattern); (* Drawing Ovals *) PROCEDURE FrameOval(VAR inRect:Rect); PROCEDURE PaintOval(VAR inRect:Rect); PROCEDURE EraseOval(VAR inRect:Rect); PROCEDURE InvertOval(VAR inRect:Rect); PROCEDURE FillOval(VAR inRect:Rect;VAR pat:Pattern); (* RoundRect Routines *) PROCEDURE FrameRoundRect (VAR theRect:Rect;cornerWidth,cornerHeigth:INTEGER); PROCEDURE PaintRoundRect (VAR theRect:Rect;cornerWidth,cornerHeight:INTEGER); PROCEDURE EraseRoundRect(VAR theRect:Rect;cornerWidth,cornerHeight:INTEGER); PROCEDURE InvertRoundRect(VAR theRect:Rect;cornerWidth,cornerHeigth:INTEGER); PROCEDURE FillRoundRect (VAR theRect:Rect;cornerWidth,cornerHeigth:INTEGER; VAR fillPat:Pattern); (* Arc Routines *) PROCEDURE FrameArc(VAR inRect:Rect;startAngle,arcAngle:INTEGER); PROCEDURE PaintArc(VAR inRect:Rect;startAngle,arcAngle:INTEGER); PROCEDURE EraseArc(VAR inRect:Rect;startAngle,arcAngle:INTEGER); PROCEDURE InvertArc(VAR inRect:Rect;startAngle,arcAngle:INTEGER); PROCEDURE FillArc(VAR inRect:Rect;startAngle,arcAngle:INTEGER; VAR fillpat:Pattern); (* Region routines move to Regions *) (* Graphical Operations on BitMaps *) PROCEDURE ScrollRect(VAR dstRect: Rect; dh,dv: INTEGER; updateRgn: RgnHandle); PROCEDURE CopyBits (VAR srcBits,dstBits: BitMap; VAR srcRect,dstRect: Rect; mode: INTEGER; maskRgn: RgnHandle); (* Picture routines moved to Pictures *) (* Polygon Routines *) PROCEDURE OpenPoly():PolyHandle; PROCEDURE ClosePoly; PROCEDURE KillPoly (thePolygon:PolyHandle); PROCEDURE OffsetPoly (thePolygon:PolyHandle;hOffset,vOffset:INTEGER); PROCEDURE FramePoly (thePolygon:PolyHandle); PROCEDURE PaintPoly (thePolygon:PolyHandle); PROCEDURE ErasePoly (thePolygon:PolyHandle); PROCEDURE InvertPoly (thePolygon:PolyHandle); PROCEDURE FillPoly (thePolygon:PolyHandle;VAR fillPat:Pattern); (* Point Calculations *) PROCEDURE AddPt (src:Point;VAR dst:Point); PROCEDURE SubPt (src:Point;VAR dst:Point); PROCEDURE SetPt (VAR pt: Point;h,v:INTEGER); PROCEDURE EqualPt (pt1,pt2: Point) :BOOLEAN; PROCEDURE LocalToGlobal (VAR pt:Point); PROCEDURE GlobalToLocal (VAR pt:Point); (* Misc Utility Routines *) PROCEDURE GetPixel(h,v:INTEGER):BOOLEAN; PROCEDURE ScalePt (VAR pt:Point;VAR fromRect,toRect:Rect); PROCEDURE MapPt (VAR pt:Point;VAR fromRect,toRect:Rect); PROCEDURE MapRect (VAR r:Rect;VAR fromRect,toRect:Rect); (* MapRgn moved to Regions *) PROCEDURE MapPoly (thePolygon:PolyHandle;VAR fromRect,toRect:Rect); END QuickDraw. !Funky!Stuff! echo x - Regions.DEF cat >Regions.DEF <<'!Funky!Stuff!' DEFINITION MODULE Regions; FROM QuickDraw IMPORT RgnHandle,RgnPtr,Region,Point,Rect,Pattern; EXPORT QUALIFIED (* Region Calculations *) NewRgn,OpenRgn,CloseRgn,DisposeRgn,SetEmptyRgn,RectRgn,CopyRgn, PtInRgn,RectInRgn,OffsetRgn,InsetRgn,EmptyRgn,UnionRgn,SectRgn, DiffRgn,XOrRgn,EqualRgn,MapRgn, (* Drawing Regions *) FrameRgn,PaintRgn,FillRgn,EraseRgn,InvertRgn; (* Region Calculations *) PROCEDURE NewRgn ():RgnHandle; PROCEDURE OpenRgn; PROCEDURE CloseRgn (theRegion:RgnHandle); PROCEDURE DisposeRgn (theRegion:RgnHandle); PROCEDURE SetEmptyRgn (theRegion:RgnHandle); PROCEDURE RectRgn (theRegion:RgnHandle;VAR theRect:Rect); PROCEDURE SetRectRgn (theRegion:RgnHandle;left,top,right,bottom:INTEGER); PROCEDURE CopyRgn (fromRegion,toRegion:RgnHandle); PROCEDURE PtInRgn (thePoint:Point;theRegion:RgnHandle):BOOLEAN; PROCEDURE RectInRgn (VAR theRect:Rect;theRegion:RgnHandle):BOOLEAN; PROCEDURE OffsetRgn (theRegion:RgnHandle;hOffset,vOffset:INTEGER); PROCEDURE InsetRgn (theRegion:RgnHandle;hInset,vInset:INTEGER); PROCEDURE EmptyRgn (theRegion:RgnHandle):BOOLEAN; PROCEDURE UnionRgn (region1,region2,resultRegion:RgnHandle); PROCEDURE SectRgn (region1,region2,resultRegion:RgnHandle); PROCEDURE DiffRgn (region1,region2,resultRegion:RgnHandle); PROCEDURE XOrRgn (region1,region2,resultRegion:RgnHandle); PROCEDURE EqualRgn (region1,region2:RgnHandle):BOOLEAN; PROCEDURE MapRgn (theRegion:RgnHandle;VAR fromRect,toRect:Rect); (* Drawing Regions *) PROCEDURE FrameRgn (theRegion:RgnHandle); PROCEDURE PaintRgn (theRegion:RgnHandle); PROCEDURE FillRgn (theRegion:RgnHandle;VAR fillPat:Pattern); PROCEDURE EraseRgn (theRegion:RgnHandle); PROCEDURE InvertRgn (theRegion:RgnHandle); END Regions. !Funky!Stuff!