Important: The information in this document is obsolete and should not be used for new development.
OpenCPort
TheOpenCPort
procedure allocates space for and initializes a color graphics port. The Window Manager callsOpenCPort
for every color window that it creates, and theNewGWorld
procedure callsOpenCPort
for every offscreen graphics world that it creates on a Color QuickDraw computer.
PROCEDURE OpenCPort (port: CGrafPtr);
port
- A pointer to a
CGrafPort
record.DESCRIPTION
TheOpenCPort
procedure is analogous toOpenPort
(described in the chapter "Basic QuickDraw"), except thatOpenCPort
opens aCGrafPort
record instead of aGrafPort
record. TheOpenCPort
procedure is called by the Window Manager'sNewCWindow
andGetNewCWindow
procedures, as well as by the Dialog Manager when the appropriate color resources are present. TheOpenCPort
procedure allocates storage for all the structures in theCGrafPort
record, and then callsInitCPort
to initialize them. TheInitCPort
procedure does not allocate a color table for thePixMap
record for the color graphics port; instead,InitCPort
copies the handle to the current device's CLUT into thePixMap
record. The initial values for theCGrafPort
record are shown in Table 4-3.The additional structures allocated are the
portPixMap
,pnPixPat
,fillPixPat
,bkPixPat
, andgrafVars
handles, as well as the fields of theGrafVars
record.SPECIAL CONSIDERATIONS
TheOpenCPort
procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.