6 SunCGJ Reference Manual SunCGI to make the application program run correctly. Finally, Chapter 2 A describes SunCGI's option for trapping SIGWINCH signals (generated by man.i- Y pulating the window environment which the application program is using). Output Primitives SunCGI provides functions for drawing geometrical output primitives (for example, polygons, circles, and ellipses) as well as functions for performing ras- ter operations. The coordinates of output primitives are specified in VDC space (with the exception of some raster functions). Geometrical output primitives include rectangles, polymarkers, circular and elliptical arcs.
Geometrical output primitives are affected by attributes described in Chapter 4 (like fill style and line width). All output primitives are affected by the drawing mode which deter- mines how an output primitives is affected by pixels which have been previously drawn on the screen. Attributes Attribute functions control the appearance of output primitives. Attributes can be set individually, or in groups which are called bundles. The use of most attri- butes is fairly straightforward; fill textures require a word of explanation. Geometrical output primitives can be filled with textures called hatches or pat- terns.
Hatches are simply arrays of color values with each element of the array corresponding to a pixel. Patterns are arrays of color values which can be scaled and translated. Input SunCGI offers a standard interface for receiving input from the mouse and the keyboard. The CGI input model is based on the logical input device model in Q. GKS. In this system, a logical input device (for example, a LOCATOR device), is bound to a physical device (for example, the x-y position of the mouse) called a trigger. Triggers may be associated with logical input devices by the applica- tion program.
Each logical input device has an associated measure (for example, the measure of a LOCATOR device is the mouse position on the screen). Each logical input device also has a state which determines how a device handles input. Each logical input device can be in one of five states: I) RELEASED (uninitialized), 2) NO _EVENTS (initialized but unable to receive input), 3) REQUEST_EVENT (waiting for one event), 4) RESPOND _EVENT (report one event asynchronously), and 5) QUEUE_EVENT (put each event at the end of the eve111 queue). Errors Errors are reported in SunCGI by setting the return value of the function to a nonzero result and echoing an error message and number on the terminal.
How- ever, error trapping can be controlled by the set_ error_ warning_ mask function. An explanation of each error message (and suggestions for how to eliminate them) is presented in Appendix D. 0 Vcr,ion C of 17 March 1986