Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF (EN)

0 F Using SunCGI and Pixwins The CG! standard does not provide facilities for dealing with multiple overlap- ping windows. An application program can use SunCGI and Pixwins features through the cgipw functions. These functions combine the richness ofCGI's primitives with the ability of Pixwins to manage multiple (potentially overlap- ping) windows. This appendix assumes familiarity with both SunCGI and Pixwins. See Sun- View Programmer's Guide for more information on Pixwins. An example pro- gram is included at the end ofthis appendix in Figure F-1. If you decide to use CG! and Pixwins, you may not use the standard SunCGI calls. Instead you must use cgipw calls.

For example, cgipw_polyline replaces polyline. The first argument of each cgipw function is a pixwin descriptor of type Ccgiwin. The file h> must be included in the cgipw application program instead of h>. 0 F.1. cgipw Functions The four functions open_pw_cgi, open_cgi_pw, close_cgi_pw and close_pw_cgi are necessary for managing the SunCGI-Pixwins interface. Open Pixwin CGI Cerror open_J:>w_cgi() open_pw_cgi initializes CG! by setting the attributes to the default values and setting the voe to device coordinate mapping to 1: 1. Therefore, all input and output primitives will use device coordinates.

The origin of the device coordi- nates is in the upper left-hand comer instead of the lower left-hand comer. The entire window is used, not just a square region within it. No standard errors are specified for open _pw _ cgi. If open_pw _ cgi returns a nonzero result, then the initialization failed. open _pw _ cgi corresponds to open_ cgi. Open a CGI Pixwin Cerror open_cgi_J:>w(pw, desc, name) struct pixwin *pw; /* pixwin */ Ccgiwin *desc; /* CGI pixwin descriptor*/ Cint *name; open_cgi_pw informs CG! of the pixwin pointed to by pw. Calls to CG! primi- tives may then reference this pixwin. However, CG! does not guarantee that a · pixwin exists or is in any other way properly initialized.

desc is a pointer to a CG! pixwin descriptor allocated by the application program and defined by open_cgi_pw. It will be used as the first argument to cgipw functions. Calls 0 143 Version C of 17 March 1986