diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/gio/sgikern/sgiclear.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/gio/sgikern/sgiclear.x')
-rw-r--r-- | sys/gio/sgikern/sgiclear.x | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/sys/gio/sgikern/sgiclear.x b/sys/gio/sgikern/sgiclear.x new file mode 100644 index 00000000..f2a63d29 --- /dev/null +++ b/sys/gio/sgikern/sgiclear.x @@ -0,0 +1,54 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> +include "sgi.h" + +# SGI_CLEAR -- Advance a frame on the plotter. All attribute packets are +# initialized to their default values. Redundant calls or calls immediately +# after a workstation open (before anything has been drawn) are ignored. + +procedure sgi_clear (dummy) + +int dummy # not used at present + +int sgk_open() +errchk sgk_open +include "sgi.com" + +begin + # This is a no-op if nothing has been drawn. + if (g_kt == NULL || g_ndraw == 0) + return + + # Start a new frame. This is done either by issuing the frame advance + # instruction or by starting a new metafile. Close the output file and + # start a new metafile if the maximum frame count has been reached. + # This disposes of the metafile to the system, causing the actual + # plots to be drawn. Open a new metafile ready to receive next frame. + + g_nframes = g_nframes + 1 + if (g_nframes >= g_maxframes) { + + # Does this device require a frame advance at end of metafile? + if (SGI_ENDFRAME(g_kt) == YES) + call sgk_frame (g_out) + + g_nframes = 0 + call sgk_close (g_out) + g_out = sgk_open (Memc[SGI_DEVNAME(g_kt)], g_tty) + + # Does this device require a frame advance at beginning of metafile? + if (SGI_STARTFRAME(g_kt) == YES) + call sgk_frame (g_out) + + } else { + # Merely output frame instruction to start a new frame in the same + # metafile. + + call sgk_frame (g_out) + } + + # Init kernel data structures. + call sgi_reset() + g_ndraw = 0 +end |