Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF

Chapter 2 - Initializing and Terminating SunCGI 23 0 called, results are unpredictable, and may change with a new version of SunCGI. · Note that it is not necessary for an application to catch a SIGWINCH signal, since SunCGI's set up sigwinch routine offers an easier interface. A user's sig_functio-;:. has a different calling semantics from a SIGWINCH in that pw _ damaged and pw _ done damaged have already been invoked. When a window's contents needs regeneration during execution time, the process associated with a window receives a SIGWINCH signal. The application can use this signal to determine when a view surface needs to be regenerated. Note:

Under no circumstances will the user be able to access the SIGWINCH signals gen- erated when a view surface is initialized. When a window obstructs a SunCGI view surface, output to that view surface is normally clipped to the exposed portion only (unless the clip indicator is NOCLIP). When the obstruction is removed, unless the window is RETAINED, the picture must be regenerated by re-running the output generation of the applica- tions, for that view surface at least An application's SIGWINCH handling func- tion is called for this purpose. When a SunCGI window's size changes during execution, the picture must be regenerated.

But first, SunCGI updates the transformation used to map voe space into screen space. Then, if the affected view surface is RETAINED, the retained copy is rewritten onto the view surface. (Because of the size change, this may not repair the damage satisfactorily.) Lastly, the application's SIGWINCH function is called. 0 Set Up SIGWINCH (SunCGI Extension) Cerror set_up_sigwinch(narne, sig_function) Cint name; Cint (*sig_function) (); /* signal handling function */ set_up_sigwinch allows the application program to trap SIGWINCH signals for view surface name. sig_function is a pointer to a function returning an integer.

If sig_function is nonzero, all SIGWINCH signals which are not trapped by the internals of SunCGI (from view surface initialization) are passed to the function specified by sig_function. Toe sig_ function is called when the SIGWINCH signal is received. It is the programmer's responsibility to use a flag to determine if it is safe to process the signal at this time, or to set a flag indicating that signal processing has been put off until later. See the Sun View Programmer's Guide for information on SIGWINCH handling. Toe sig_function argument is called with a single argument: the name of the view surface with which it is associated by the call to set_ up _sigwinch.

This allows more than one view surface to share the same sig function, and d_ifferentiate which view surface needs redisplay. Here is an example of a program that uses set up s igwinch. 0 Version C of 17 March 1986