From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/gio/stdgraph/stgdeact.x | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sys/gio/stdgraph/stgdeact.x (limited to 'sys/gio/stdgraph/stgdeact.x') diff --git a/sys/gio/stdgraph/stgdeact.x b/sys/gio/stdgraph/stgdeact.x new file mode 100644 index 00000000..b11e4a07 --- /dev/null +++ b/sys/gio/stdgraph/stgdeact.x @@ -0,0 +1,54 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include "stdgraph.h" + +# STG_DEACTIVATEWS -- Deactivate the workstation, i.e., disable graphics, +# leaving the terminal in text mode. Note that it is the CW (close +# workstation) sequence which is actually output, since the GD sequence is +# used only to write single lines of text to the status line. + +procedure stg_deactivatews (flags) + +int flags # action modifier flags + +char buf[1] +int stg_readtty(), and() +include "stdgraph.com" + +begin + if (g_out <= 0) + return + + # The g_active and g_out test permits us to be called before the + # kernel is opened and causes redundant calls to be ignored. + + if (g_active == YES) { + # Pause before deactivating? + if (and (flags, AW_PAUSE) != 0) { + call stg_putline (g_out, "\n[Hit return to continue]\n") + while (stg_readtty (STDIN, buf, 1) != EOF) + if (buf[1] == '\r' || buf[1] == '\n') + break + } + + # Deactivate the workstation. + call stgctrl ("CW") + + g_active = NO + g_enable = NO + + # Reenable stty ucaseout mode if it was set when the workstation + # was activated. + + if (g_ucaseout == YES) + call ttseti (g_out, TT_UCASEOUT, YES) + } + + # Clear the text screen? + if (and (flags, AW_CLEAR) != 0 && g_term != NULL) + call ttyclear (g_out, g_term) + + call flush (g_out) +end -- cgit