144 SunCGI Reference Manual - may also be made to any pixwin function (see example program). Multiple calls o to open_cgi_pw with pointers to different Ccgiwin structures will allow primitives to be displayed on multiple view surfaces by repeating calls to cgipw functions with different Ccgi win descriptors. Attributes are local to the pix win associated with the CG! descriptor passed to the cgipw attribute functions. open_cgi_pw corresponds to open_vws. open_pw_cgi must be called prior to open_cgi_pw; otherwise, error 111 is returned. Other errors (as with open_ vws may also be detected. Errors ENOTOPOP [5] CGI not in proper state CGI shall be either in sta~ CGOP, VSOP, or VSAC.
ENOWSTYP [11] Specified view surface type does not exist. EMAXVSOP [12] Maximum number of view surfaces already open. EMEMSPAC [110] Space allocation has failed. Close a CGI Pixwin Cerror close_cgi_pw(desc) Ccgiwin *desc; /* CGI pixwin descriptor*/ close_cgi_pw takes the CG! pixwindescriptordesc as an argument and removes it from the list of pixwins that CG! writes to. Toe pixwin is not closed. close_cgi_pw corresponds to close_vws, and may return any of the errors close_ vws detects (except 112). ENOTOPOP [5] CGI not in proper state CGI shall be either in state CGOP, 0 VSOP, or VSAC. Errors EVSIDINV [10] Specified view surface name is invalid. EVSNOTOP [13] Specified view surface not open.
Close Pixwin CGI Cerror close_pw_cgi() close _pw _ cgi takes care ofleaving CG! in an orderly state. This function should be called before exiting the application program. close_pw_cgi corresponds to close_ cgi. Errors ENOTOPOP [5] CGI not in proper state CGI should be in state CGOP, VSOP, or VSAC. F.2. Using cgipw After calling the two initialization functions (open_pw_cgi and open_cgi_pw) the application program may call functions from both the Pixwins and cgipw libraries. Figure F-1 contains an example program that uses cgipw functions.
Since cgipw functions use a 1:1 mapping from voe to device coordinates, attri- butes in voe units (such as pattern size and character height) will be huge unless they are reset. And because the cg i pw origin is the device coordinate origin, the upper left-hand comer, attributes with direction or position (e.g.,pat- tern reference point and character orientation ) have their meaning reversed in Version C of 17 Man:h 1986 0