OpenPort
void OpenPort(whichPort );
GrafPtr whichPort ; pointer to a GrafPort structure
OpenPort initializes fields for a new GrafPort, allocates memory for its
visRgn and clipRgn, and activates the GrafPort.
whichPort is a GrafPtr (pointer to a 108-byte GrafPort structure). This
structure may reside as a static or auto variable in a procedure or
you you may allocate the storage via NewPtr.
Returns: none

Notes: You normally won't need to use this, since the Window Manager calls this
function when you create a window via NewWindow or GetNewWindow.
If used, the typical sequence is:
myPortPtr = (GrafPtr) NewPtr( sizeof(GrafPort) );
OpenPort( myPortPtr );
Use ClosePort to dispose of the memory allocated. As above, the Window
Manager does this for you when you close a window.
Don't use a handle to store a GrafPort. A GrafPort must not move between
the time you open it and the time you close it. QuickDraw keeps a list of
pointers to open ports. If a port moves, QuickDraw won't be able to find it.
The fields of whichPort GrafPort are initialized as follows:
Field Data Type Initial Setting
device short 0 (the screen)
portBits BitMap screenBits (global variable)
portRect Rect screenBits.bounds (global variable)
visRgn RgnHandle handle to a rectangular region covering
(-32767,-32767) to (32767, 32767)
clipRgn RgnHandle handle to a rectangular region (as above)
fillPat Pattern black
pnLoc Point (0,0)
pnSize Point (1,1)
pnMode short patCopy (8)
pnPat Pattern black (global variable)
pnVis short 0 ( visible)
txFont short 0 (system font; i.e., chicago)
txFace Style plain (0)
txMode short srcOr (2)
txSize short 0 (system font size; i.e., 12)
spExtra Fixed 0
fgColor long blackColor (33)
bkColor long whiteColor (30)
colrBit short 0
patStretch short 0
picSave Handle NIL (0)
rgnSave Handle NIL (0)
polySave Handle NIL (0)
grafProcs QDProcsPtr NIL (0)