Пример #1
0
/*
 * Delete nchunk line(s) from "row", replacing the
 * bottom line on the screen with a blank line.
 * Unless we're using the scrolling region, this is
 * done with a crafty sequences of insert and delete
 * lines.  The presence of the echo area makes a
 * boundry condition go away.
 */
ttdell(row, bot, nchunk)
{
    register int	i, nl;

    if (row == bot) {		/* One line special case	*/
	ttmove(row, 0);
	tteeol();
	return;
    }
    if (CS) {			/* scrolling region	*/
	nl = bot - row;
	ttwindow(row, bot);
	ttmove(bot, 0);
	while (nchunk--) putpad(SF, nl);
	ttnowindow();
    }
    else if(insdel) {
	ttmove(row, 0);			/* Else use insert/delete line	*/
	nl = nrow - ttrow;
	if (pDL) putpad(tgoto(pDL, 0, nchunk), nl);
	else for (i=0; i<nchunk; i++)	/* For all lines in the chunk	*/
		putpad(DL, nl);
	ttmove(1+bot-nchunk,0);
	nl = nrow - ttrow;	/* ttmove() changes ttrow */
	if (pAL) putpad(tgoto(pAL, 0, nchunk), nl);
	else for (i=0; i<nchunk; i++)	/* For all lines in the chunk	*/
		putpad(AL, nl);
	ttrow = HUGE;
	ttcol = HUGE;
    } else panic("ttdell: Can't insert/delete line");
}
Пример #2
0
/*
 * Insert nchunk blank line(s) onto the
 * screen, scrolling the last line on the
 * screen off the bottom.  Use the scrolling
 * region if possible for a smoother display.
 * If no scrolling region, use a set
 * of insert and delete line sequences
 */
ttinsl(row, bot, nchunk) {
    register int	i, nl;

    if (row == bot) {		/* Case of one line insert is	*/
	ttmove(row, 0);		/*	special			*/
	tteeol();
	return;
    }
    if (CS && SR) {		/* Use scroll region and back index	*/
	nl = bot - row;
	ttwindow(row,bot);
	ttmove(row, 0);
	while (nchunk--) putpad(SR, nl);
	ttnowindow();
	return;
    } else if (insdel) {
	ttmove(1+bot-nchunk, 0);
	nl = nrow - ttrow;
	if (pDL) putpad(tgoto(pDL, 0, nchunk), nl);
	else for (i=0; i<nchunk; i++)	/* For all lines in the chunk	*/
		putpad(DL, nl);
	ttmove(row, 0);
	nl = nrow - ttrow;	/* ttmove() changes ttrow */
	if (pAL) putpad(tgoto(pAL, 0, nchunk), nl);
	else for (i=0; i<nchunk; i++)	/* For all lines in the chunk	*/
		putpad(AL, nl);
	ttrow = HUGE;
	ttcol = HUGE;
    } else panic("ttinsl: Can't insert/delete line");
}
Пример #3
0
/*
 * Insert nchunk blank line(s) onto the screen, scrolling the last line on
 * the screen off the bottom.  Use the scrolling region if possible for a
 * smoother display.  If there is no scrolling region, use a set of insert
 * and delete line sequences.
 */
void
ttinsl(int row, int bot, int nchunk)
{
	int	i, nl;

	/* Case of one line insert is special. */
	if (row == bot) {
		ttmove(row, 0);
		tteeol();
		return;
	}
	if (change_scroll_region && scroll_reverse) {
		/* Use scroll region and back index	 */
		nl = bot - row;
		ttwindow(row, bot);
		ttmove(row, 0);
		while (nchunk--)
			putpad(scroll_reverse, nl);
		ttnowindow();
		return;
	} else if (insdel) {
		ttmove(1 + bot - nchunk, 0);
		nl = nrow - ttrow;
		if (parm_delete_line)
			putpad(tgoto(parm_delete_line, 0, nchunk), nl);
		else
			/* For all lines in the chunk... */
			for (i = 0; i < nchunk; i++)
				putpad(delete_line, nl);
		ttmove(row, 0);

		/* ttmove() changes ttrow */
		nl = nrow - ttrow;

		if (parm_insert_line)
			putpad(tgoto(parm_insert_line, 0, nchunk), nl);
		else
			/* For all lines in the chunk */
			for (i = 0; i < nchunk; i++)
				putpad(insert_line, nl);
		ttrow = HUGE;
		ttcol = HUGE;
	} else
		panic("ttinsl: Can't insert/delete line");
}
Пример #4
0
/*
 * Delete nchunk line(s) from "row", replacing the bottom line on the
 * screen with a blank line.  Unless we're using the scrolling region,
 * this is done with crafty sequences of insert and delete lines.  The
 * presence of the echo area makes a boundary condition go away.
 */
void
ttdell(int row, int bot, int nchunk)
{
	int	i, nl;

	/* One line special cases */
	if (row == bot) {
		ttmove(row, 0);
		tteeol();
		return;
	}
	/* scrolling region */
	if (change_scroll_region) {
		nl = bot - row;
		ttwindow(row, bot);
		ttmove(bot, 0);
		while (nchunk--)
			putpad(scroll_fwd, nl);
		ttnowindow();
	/* else use insert/delete line */
	} else if (insdel) {
		ttmove(row, 0);
		nl = nrow - ttrow;
		if (parm_delete_line)
			putpad(tgoto(parm_delete_line, 0, nchunk), nl);
		else
			/* For all lines in the chunk	 */
			for (i = 0; i < nchunk; i++)
				putpad(delete_line, nl);
		ttmove(1 + bot - nchunk, 0);

		/* ttmove() changes ttrow */
		nl = nrow - ttrow;
		if (parm_insert_line)
			putpad(tgoto(parm_insert_line, 0, nchunk), nl);
		else
			/* For all lines in the chunk */
			for (i = 0; i < nchunk; i++)
				putpad(insert_line, nl);
		ttrow = HUGE;
		ttcol = HUGE;
	} else
		panic("ttdell: Can't insert/delete line");
}
Пример #5
0
/*
 * Delete nchunk line(s) from "row", replacing the
 * bottom line on the screen with a blank line. 
 * Unless we're using the scrolling region, this is 
 * done with a crafty sequences of insert and delete 
 * lines.  The presence of the echo area makes a
 * boundry condition go away.
 */
void
ttdell (int row, int bot, int nchunk)
{
  register int i;

  if (row == bot)
    {				/* One line special case        */
      ttmove (row, 0);
      tteeol ();
      return;
    }
  if (CS)
    {				/* scrolling region     */
      ttwindow (row, bot);
      ttmove (bot, 0);
      while (nchunk--)
	ttputc (LF);
      ttnowindow ();
    }
  else if (insdel)
    {
      ttmove (row, 0);		/* Else use insert/delete line  */
      if (pDL)
	putpad (tgoto (pDL, 0, nchunk));
      else
	for (i = 0; i < nchunk; i++)	/* For all lines in the chunk   */
	  putpad (DL);
      ttmove (1 + bot - nchunk, 0);
      if (pAL)
	putpad (tgoto (pAL, 0, nchunk));
      else
	for (i = 0; i < nchunk; i++)	/* For all lines in the chunk   */
	  putpad (AL);
      ttrow = HUGE;
      ttcol = HUGE;
    }
  else
    panic ("ttdell: Can't insert/delete line");
}