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

14 SunCGI Reference Manual If the view surface of the specified type has been previously initialized and the Q type of view surface is a window (PIXWINDD or CGPIXW1NDD), a CG! tool (a win- dow with the name CG! Tool) is opened. Other characteristics of the view surface can be defined by setting the other elements of the of the devdd argument (which is of type Cvwsurf).

typedef struct { char screenname[DEVNAMESIZE]; /* physical screen*/ char windowname[DEVNAMESIZE]; /*window*/ int windowfd; /* window file descriptor*/ int retained; /* retained flag*/ int dd;, / * device * / int cmapsize; /* color map size*/ char cmapname[DEVNAMESIZE]; /* color map name*/ int flags; /* new flag*/ char **ptr; /* CGI tool descriptor*/ Cvwsurf; The elements screenname and windowname specify alternate screens (for exam- ple, ldevlcgoneO) or alternate window (for example, ldevlwinJO ). If these ele- ments are left blank, the current screen and the current window are used, unless the dd field implicitly specifies a device (for example CGJDD ).

The element windo>lfd is the window file descriptor for the current device. The current implementation of SunCGI ignores this element. If the element retained is nonzero, then the view surface created by open_ vws o has a retained window associated with it (that is, if the window is covered up by · another window and then revealed, the picture present before the window was covered-up will be redisplayed. By default the window created by open_ vws is non-retained. That is, if the window is covered-up and then revealed the covered-portion will be redisplayed as white.

However, drawing in non-retained windows is twice as fast as drawing in retained windows, so the choice of which type of view surface to open should be carefully considered. The dd element specifies the view surface type. The cmapsize and the cmap- name elements determine the size and the name of the colormap. No colormap is enabled for monochrome devices. The colormap determines the mapping between color indices and red, green, and blue values. If the colormap specified by the cmapname element of the devdd argument is the same as a colormap seg- ment which already exists, then the colormap segment is shared. cmapsize should be a power of two, less than or equal to 256.

Refer to the Sun View Programmer's Guide for more information about colormaps. When the flags element is nonzero, no attempt is made to take over the current graphics subwindow (if one exists). If this flag is set or the graphics subwindow has already been taken over by SunCGI, then a CGI Tool (a window with the name View Surface Tool) is created. The ptr element specifies the size and placement of the CGI Tool. ptr is a pointer to an array of characters which should consist of nine decimal numbers separated by commas. The array takes the following form: 0 .. nl,nt,nw,nh,il,it,iw,ih,I" ~)sun ~ mr::rosystems Version C of 17 March 1986