Google
 

Trailing-Edge - PDP-10 Archives - bb-r775e-bm_tops20_ks_upd_5 - sources/edt/scrzapsin.bli
There are 10 other files named scrzapsin.bli in the archive. Click here to see a list.
 %TITLE 'SCRZAPSIN - Mark lines to be repainted'
MODULE SCRZAPSIN (				! Mark lines to be repainted
		IDENT = '3-002'			! File: SCRZAPSIN.BLI Edit: CJG3002
		) =
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 marks screen lines for repaint
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: September 8, 1979
!
! MODIFIED BY:
!
! 2-001	- Original.  SMB 20-Sep-1982.  This module is a complete
!	  rewrite of the old SCRZAPSIN module.
! 2-002 - Modify to use new 48 bit macro. STS 01-Oct-1982
! 2-003 - Modify to mark screen pointers for repaint.  SMB 08-Oct-1982
! 2-004 - Fix up the format a little.  SMB 10-Oct-1982
! 2-005	- Put deleted lines on the free list.  JBS 24-Oct-1982
! 2-006	- Maintain the various screen pointers.  JBS 24-Oct-1982
! 2-007	- Don't check on CUR_SCRPTR.  JBS 25-Oct-1982
! 2-008 - Call SC_LNDEL instead of hard coding delete lines.  SMB 26-Oct-1982
! 2-009	- Maintain SCR_EDIT_MINPOS.  JBS 27-Oct-1982
! 2-010	- Add the third parameter.  JBS 09-Nov-1982
! 2-011	- Remove the edit buffer.  JBS 27-Dec-1982
! 2-012	- Add two more parameters.  JBS 27-Dec-1982
! 3-001 - Modify for Tops10/20.  GB 03-May-1983
! 3-002 - Modify ASSERT macro to include error code. CJG 30-Jan-1984
!--
%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$SC_REPAINT : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$SC_REPAINT  - mark screen lines for repaint'

GLOBAL ROUTINE EDT$$SC_REPAINT (		! Mark screen lines for repaint
    FIRST, 					! First line to clear
    LAST, 					! Last line to clear
    MINPOS, 					! First position modified
    MAXPOS, 					! Last position modified
    INSDEL_FLAG					! Flag for handling of inserted and deleted lines
    ) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine marks specified lines in the screen data structure for
!	repaint, indicating that those lines must be completely updated.
!
! FORMAL PARAMETERS:
!
!  FIRST	The first line to repaint
!
!  LAST		The last line to repaint
!
!  MINPOS	First position modified, in first line
!
!  MAXPOS	Last position modified, in last line (if < 0, don't repaint the last line)
!
!  INSDEL_FLAG	 0 = skip deleted and inserted lines,
!		 1 = free deleted lines, repaint inserted lines,
!		-1 = should be no deleted or inserted lines
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	FST_SCRPTR
!	LST_SCRPTR
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	Marks the specified lines as modified.
!
!--

    BEGIN

    MAP
	FIRST : REF SCREEN_LINE,
	LAST : REF SCREEN_LINE;

    EXTERNAL ROUTINE
	EDT$$SC_LNDEL;				! Delete a line from the structure

    EXTERNAL
	FST_SCRPTR : REF SCREEN_LINE,	! First screen pointer in the data base
	LST_SCRPTR : REF SCREEN_LINE;	! Last screen pointer in the data base

    LOCAL
	NXT_SCRPTR : REF SCREEN_LINE,
	SCRPTR : REF SCREEN_LINE,
	REPAINT_DONE;

    SCRPTR = .FIRST;
    REPAINT_DONE = 0;
!+
! Update the lines for repaint until the last line is seen.
! Deleted lines, however, are put on the free list if so requested.
!-

    WHILE (( NOT .REPAINT_DONE) AND (.SCRPTR NEQA 0)) DO
	BEGIN

	IF ((.SCRPTR [SCR_EDIT_FLAGS] AND (SCR_EDIT_INSLN OR SCR_EDIT_DELLN)) NEQ 0)
	THEN
	    BEGIN

	    CASE .INSDEL_FLAG FROM 0 TO 1 OF
		SET

		[0] : 				! Skip over deleted and inserted lines
		    BEGIN
		    NXT_SCRPTR = .SCRPTR [SCR_NXT_LINE];

		    IF (.SCRPTR EQLA .LAST) THEN REPAINT_DONE = 1 ELSE SCRPTR = .NXT_SCRPTR;

		    END;

		[1] : 				! Free deleted lines, mark inserted lines for repaint
		    BEGIN
		    NXT_SCRPTR = .SCRPTR [SCR_NXT_LINE];

		    IF ((.SCRPTR [SCR_EDIT_FLAGS] AND SCR_EDIT_DELLN) NEQ 0)
		    THEN
			BEGIN
			EDT$$SC_LNDEL (.SCRPTR);	! Free the deleted line
!+
! The first and last cells had better not have been set to zero.
!-
			ASSERT (23, .LST_SCRPTR NEQA 0);
			ASSERT (23, .FST_SCRPTR NEQA 0);
			END
		    ELSE
			BEGIN			! Mark the inserted line for repaint
			SCRPTR [SCR_EDIT_FLAGS] = .SCRPTR [SCR_EDIT_FLAGS] AND ( NOT SCR_EDIT_INSLN);
			SCRPTR [SCR_EDIT_FLAGS] = .SCRPTR [SCR_EDIT_FLAGS] OR SCR_EDIT_MODIFY;
			END;

		    IF (.SCRPTR EQLA .LAST) THEN REPAINT_DONE = 1 ELSE SCRPTR = .NXT_SCRPTR;

		    END;

		[OUTRANGE] :
		    ASSERT (23, 0);
		TES;

	    END
	ELSE
	    BEGIN

	    IF (.SCRPTR EQLA .FIRST)
	    THEN
		SCRPTR [SCR_EDIT_MINPOS] = MINU (.SCRPTR [SCR_EDIT_MINPOS], .MINPOS)
	    ELSE
		SCRPTR [SCR_EDIT_MINPOS] = 0;

	    IF ((.SCRPTR EQLA .LAST) AND (.MAXPOS GEQ 0))
	    THEN
		SCRPTR [SCR_EDIT_MAXPOS] = MAXU (.SCRPTR [SCR_EDIT_MAXPOS], .MAXPOS)
	    ELSE
		SCRPTR [SCR_EDIT_MAXPOS] = 255;

	    IF ((.SCRPTR NEQA .LAST) OR (.MAXPOS GEQ 0))
	    THEN
		SCRPTR [SCR_EDIT_FLAGS] = .SCRPTR [SCR_EDIT_FLAGS] OR SCR_EDIT_MODIFY;

	    IF (.SCRPTR EQLA .LAST) THEN REPAINT_DONE = 1 ELSE SCRPTR = .SCRPTR [SCR_NXT_LINE];

	    END;

	END;

    END;					! of routine EDT$$SC_REPAINT

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

ELUDOM