Chapter 3 - Output 49 0 set global drawing mode function is provided, which affects all output - - - primitives except bitblt's. Resetting the drawing mode in the middle of an appli- cation program only affects those output primitives drawn after the mode is reset. The novice user is advised not to reset the drawing mode until the user has writ-· ten at least one application program using Sun CG I.
Set Drawing Mode Cerror set_drawing_mode(visibility, source, destination, combination) Cbmode visibility; /* transparent or opaque*/ Cbitmaptype source; /* NOT source bits*/ Cbitmaptype destination; /* NOT destination bits*/ Ccombtype combination; /* combination rules*/ set_drawing_mode determines the current drawing mode which in turn determines how bitblt primitives are displayed. The visibility argument deter- mines how pixels with index zero are treated.
typedef enum { TRANSPARENT, OPAQUE Cbmode; typedef enum BITTRUE, BITNOT Cbitmaptype; 0 typedef enum REPLACE, AND, OR, NOT, XOR Ccombtype; If visibility is set to TRANSPARENT, all source pixels with index zero leave the destination pixel unchanged, regardless of the operation, whereas if visibility is set to OPAQUE, all pixels are treated normally. The arguments source and desti- nation determine whether the contents of the source and destination pixrects are NOTted before the bitblt operation is performed. The combination argument determines how the source and destination pixrects are combined.
If combination is equal to REPLACE, the source pixrect ( after optionally being NOT-ted) replaces the destination pixrect. If combination is equal to AND, OR, or XOR the source pixrect and the destination pixrect are com- bined in the indicated Boolean fashion. If combination is equal to NOT, then the destination is set to a bitwise NOT operation of the source pixrect Errors 0 ENOTOPOP [5] CGI not in proper state CGI shall be in in state VDOP, VSOP,orVSAC. Version C of 17 March 1986