Google
 

Trailing-Edge - PDP-10 Archives - BB-R775E-BM - sources/edt/scrwid.bli
There are 10 other files named scrwid.bli in the archive. Click here to see a list.
 %TITLE 'SCRWID - set the screen width'
MODULE SCRWID (				! Set the screen width
		IDENT = '3-001'			! File: SCRWID.BLI Edit: CJG3001
		) =
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 outputs an escape sequence to set the terminal width
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Sharon M. Burlingame, CREATION DATE: July 29, 1982
!
! MODIFIED BY:
!
! 1-001	- Original.  SMB 29-Jul-1982.
! 1-002	- Maintain PRV_COL and PRV_LN.  JBS 05-Oct-1982
! 1-003 - Remove conditional setting of screen width.  SMB 16-Feb-1983
! 3-001 - Manual says that you can SET SCREEN on a VT52. Make sure it works.
!	  Also check for silly values of width. CJG 12-Jan-1984
!--
%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$SC_SETWID;				! Set screen width on VT100's

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!

BIND
    WID_80 = UPLIT (%STRING (%CHAR (ASC_K_ESC), '[?3l')),
    WID_132 = UPLIT (%STRING (%CHAR (ASC_K_ESC), '[?3h'));

LITERAL
    WID_LEN = 5;

!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$SC_SETWID - set screen width'

GLOBAL ROUTINE EDT$$SC_SETWID (			! Set screen width
    SIZE					! Desired screen size
    ) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	If this terminal is a VT100, then output an escape sequence
!	to modify the width of the terminal
!
! FORMAL PARAMETERS:
!
!  SIZE			the desired screen size
!
! IMPLICIT INPUTS:
!
!	TI_WID
!	TI_TYP
!
! IMPLICIT OUTPUTS:
!
!	TI_WID
!	PRV_COL
!	PRV_LN
!
! ROUTINE VALUE:
!
!	0 = screen size was not changed
!	1 = screen size was changed
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$OUT_FMTBUF,		! Output the escape seq
	EDT$$FMT_LIT;			! Format the escape seq

    EXTERNAL
	TI_WID,				! Current screen size
	TI_TYP,				! Terminal type
	PRV_COL,			! Cursor column number
	PRV_LN;				! Cursor line number

!+
! If this is a VT100 then set the width in the terminal
!-

    IF (.TI_TYP EQL TERM_VT100)
    THEN
	BEGIN
	IF (.SIZE GTR 132) THEN RETURN (0);

!+
! Set the width unconditionally because sometimes the hardware screws up.
!_

	IF (.SIZE LEQ 80)
	THEN
	    EDT$$FMT_LIT (CH$PTR (WID_80), WID_LEN)
	ELSE
	    EDT$$FMT_LIT (CH$PTR (WID_132), WID_LEN);

	EDT$$OUT_FMTBUF ();
	PRV_COL = 0;
	PRV_LN = 0;
	END
    ELSE
	IF (.SIZE GTR 80) THEN RETURN (0);

    TI_WID = .SIZE;
    RETURN (1);
    END;					! of routine EDT$$SC_SETWID

!<BLF/PAGE>
END						! of module EDT$SCWID

ELUDOM