Google
 

Trailing-Edge - PDP-10 Archives - bb-r775d-bm_tops20_ks_upd_4 - sources/scrinit.bli
There are 10 other files named scrinit.bli in the archive. Click here to see a list.
 %TITLE 'SCRINIT - initialize for screen mode'
MODULE SCRINIT (				! Initialize for screen mode
		IDENT = '3-001'			! File: SCRINIT.BLI Edit: GB3001
		) =
BEGIN
!
!			  COPYRIGHT (c) 1981, 1985 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!		ALL RIGHTS RESERVED.
!
! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE
! INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER
! COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
! OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
! TRANSFERRED.
!
! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
! AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
! CORPORATION.
!
! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS
! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
!

!++
! FACILITY:	EDT -- The DEC Standard Editor
!
! ABSTRACT:
!
!	This module initializes the screen for change mode editingr
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: September 8, 1979
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 12-Feb-1981.  This module was created by
!	extracting the routine EDT$$SC_INIT  from module SCREEN.
! 1-002	- Regularize headers.  JBS 13-Mar-1981
! 1-003 - Initialize for NOKEYPAD mode also.  SMB 1-Mar-1982
! 1-004	- Don't turn off autowrap.  JBS 02-Apr-1982
! 1-005	- Make sure we are in G0.  JBS 26-May-1982
! 1-006	- Remove edit 1-005.  Always sending an SI means we are
!	   sending a control O.  EDT's automatic test procedures
!	   cannot handle control O's.  JBS
! 1-007	- Send "exit hold-screen mode" to a VT52.  JBS 30-Aug-1982
! 1-008	- New screen update logic.  JBS 13-Sep-1982
! 1-009 - Do more initialization of screen update globals.  SMB 20-Sep-1982
! 1-010 - Set up an EOB screen pointer.  SMB 05-Oct-1982
! 1-011	- Remove an unreferenced external declaration.  JBS 09-Oct-1982
! 1-012	- Force the cursor to the upper left corner.  JBS 15-Oct-1982
! 1-013 - Fix the way memory is added to the free list.  SMB 17-Oct-1982
! 1-014	- Don't fool with the screen data base.  JBS 29-Oct-1982
! 1-015	- Make sure the scrolling region is really set.  JBS 18-Jan-1983
! 1-016 - Force a cursor positioning sequence to "home".  SMB 14-Feb-1983
! 1-017	- Do miscellaneous setups first, to be sure terminal will respond
!	   correctly to subsequent setups.  JBS 23-Feb-1983
! 1-018	- Set the width also, in case this is a VT100.  JBS 24-Feb-1983
! 3-001 - Add updates from V3 sources.  GB 03-May-1983
!--
%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$SC_INIT : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!+
! The following macros specify the strings used to initialize the terminals.  After this
! initialization more characters are sent to the terminal to complete putting it in the
! state that EDT expects.
!-
!<BLF/NOFORMAT>

MACRO
    KEYPAD_MODE_STRING = %STRING (%CHAR (ASC_K_ESC), '=') %,		! Application keypad mode

    NOKEYPAD_MODE_STRING = %STRING (%CHAR (ASC_K_ESC), '>') %,		! Numeric keypad mode

    VT100_SETUP_STRING = %STRING (		! VT100 initialization
	    %CHAR (ASC_K_ESC), '\',		! String terminator, in case we are in a REGIS string
	    %CHAR (ASC_K_ESC), '<', 		! ANSI mode (in case we are in VT52 mode)
	    %CHAR (ASC_K_ESC), '[?6l', 		! origin mode off
	    %CHAR (ASC_K_ESC), '[m', 		! video attributes off
	    %CHAR (ASC_K_ESC), ')0'		! select special graphics for G1 (leave G0 as set up by user)
	) %,

    VT52_SETUP_STRING = %STRING (		! VT52 initialization
	    %CHAR (ASC_K_ESC), '\'		! Exit hold-screen mode
        ) %;

!<BLF/FORMAT>
!
! EQUATED SYMBOLS:
!

BIND
    KEYPAD_MODE = UPLIT  (KEYPAD_MODE_STRING),
    NOKEYPAD_MODE = UPLIT (NOKEYPAD_MODE_STRING),
    VT100_SETUP = UPLIT (VT100_SETUP_STRING),
    VT52_SETUP = UPLIT (VT52_SETUP_STRING);

LITERAL
    KEYPAD_MODE_LEN = %CHARCOUNT (KEYPAD_MODE_STRING),
    NOKEYPAD_MODE_LEN = %CHARCOUNT (NOKEYPAD_MODE_STRING),
    VT100_SETUP_LEN = %CHARCOUNT (VT100_SETUP_STRING),
    VT52_SETUP_LEN = %CHARCOUNT (VT52_SETUP_STRING);

!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$SC_INIT  - initialize for screen mode'

GLOBAL ROUTINE EDT$$SC_INIT 			! Initialize for screen mode
    : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Initialize for screen mode.  The scrolling region is set up for VT100's,
!	[no]keypad mode is set, and the globals pointing to the screen information
!	structure are initialized to zero.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	SCR_LNS
!	REVID
!	KPAD
!	TI_TYP
!	TI_WID
!
! IMPLICIT OUTPUTS:
!
!	REVID
!	TOP_SCREG
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$SC_POSABS,				! Position the cursor
	EDT$$SC_SETSCLLREG,			! Set the scrolling region
	EDT$$FMT_LIT : NOVALUE,			! Output a string without interpretation
	EDT$$TI_ENTERCHM : NOVALUE,		! Set up terminal for change mode
	EDT$$SC_SETWID;				! Set the width on a VT100

    EXTERNAL
	SCR_LNS,				! Number of screen lines
	KPAD,				! Keypad activated?
	TI_TYP,				! Terminal type.
	REVID,				! 1 = screen is in reverse video
	TOP_SCREG,			! Top of the scrolling region
	TI_WID;				! Terminal width

!+
! Inform the terminal I/O routines we are entering screen mode
! and set the scrolling region to text area.
!-
    EDT$$TI_ENTERCHM ();
!+
! Set the terminal's parameters properly for EDT.
!-

    IF (.TI_TYP EQL TERM_VT100)
    THEN
	EDT$$FMT_LIT (CH$PTR (VT100_SETUP), VT100_SETUP_LEN)
    ELSE
	EDT$$FMT_LIT (CH$PTR (VT52_SETUP), VT52_SETUP_LEN);

!+
! Set the terminal's width if it is a VT100.
!-
    EDT$$SC_SETWID (.TI_WID);
!+
! Set the scrolling region the way EDT wants it.
!-
    TOP_SCREG = 1;			! Make sure control sequence is issued
    EDT$$SC_SETSCLLREG (0, .SCR_LNS);
!+
! Force a cursor positioning sequence to "home".  This may already have
! been done for some terminals when the scrolling region or width was set.
!-
    EDT$$SC_POSABS (0, 0);
!+
! Either activate or deactivate the keypad.
!-

    IF (.KPAD)				!
    THEN
	EDT$$FMT_LIT (CH$PTR (KEYPAD_MODE), KEYPAD_MODE_LEN)
    ELSE
	EDT$$FMT_LIT (CH$PTR (NOKEYPAD_MODE), NOKEYPAD_MODE_LEN);

    REVID = 0;				! The terminal is not in reverse video
    END;					! of routine EDT$$SC_INIT

!<BLF/PAGE
END						! of module EDT$SCRINIT

ELUDOM