亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? screen.c

?? STEVIE文本文件編緝器的C 語言源程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Header: /nw2/tony/src/stevie/src/RCS/screen.c,v 1.9 89/08/31 09:59:24 tony Exp $
 *
 * Routines to manipulate the screen representations.
 */

#include "stevie.h"

/*
 * This gets set if we ignored an update request while input was pending.
 * We check this when the input is drained to see if the screen should be
 * updated.
 */
bool_t	need_redraw = FALSE;

/*
 * The following variable is set (in filetonext) to the number of physical
 * lines taken by the line the cursor is on. We use this to avoid extra
 * calls to plines(). The optimized routines lfiletonext() and lnexttoscreen()
 * make sure that the size of the cursor line hasn't changed. If so, lines
 * below the cursor will move up or down and we need to call the routines
 * filetonext() and nexttoscreen() to examine the entire screen.
 */
static	int	Cline_size;	/* size (in rows) of the cursor line */
static	int	Cline_row;	/* starting row of the cursor line */

static	char	*mkline();	/* calculate line string for "number" mode */

/*
 * filetonext()
 *
 * Based on the current value of Topchar, transfer a screenfull of
 * stuff from Filemem to Nextscreen, and update Botchar.
 */

static void
filetonext()
{
	register int	row, col;
	register char	*screenp = Nextscreen;
	LPTR	memp;
	LPTR	save;			/* save pos. in case line won't fit */
	register char	*endscreen;
	register char	*nextrow;
	char	extra[16];
	int	nextra = 0;
	register int	c;
	int	n;
	bool_t	done;		/* if TRUE, we hit the end of the file */
	bool_t	didline;	/* if TRUE, we finished the last line */
	int	srow;		/* starting row of the current line */
	int	lno;		/* number of the line we're doing */
	int	coff;		/* column offset */

	coff = P(P_NU) ? 8 : 0;

	save = memp = *Topchar;

	if (P(P_NU))
		lno = cntllines(Filemem, Topchar);

	/*
	 * The number of rows shown is Rows-1.
	 * The last line is the status/command line.
	 */
	endscreen = &screenp[(Rows-1)*Columns];

	done = didline = FALSE;
	srow = row = col = 0;
	/*
	 * We go one past the end of the screen so we can find out if the
	 * last line fit on the screen or not.
	 */
	while ( screenp <= endscreen && !done) {


		if (P(P_NU) && col == 0 && memp.index == 0) {
			strcpy(extra, mkline(lno++));
			nextra = 8;
		}

		/* Get the next character to put on the screen. */

		/* The 'extra' array contains the extra stuff that is */
		/* inserted to represent special characters (tabs, and */
		/* other non-printable stuff.  The order in the 'extra' */
		/* array is reversed. */

		if ( nextra > 0 )
			c = extra[--nextra];
		else {
			c = (unsigned)(0xff & gchar(&memp));
			if (inc(&memp) == -1)
				done = 1;
			/* when getting a character from the file, we */
			/* may have to turn it into something else on */
			/* the way to putting it into 'Nextscreen'. */
			if ( c == TAB && !P(P_LS) ) {
				strcpy(extra,"        ");
				/* tab amount depends on current column */
				nextra = ((P(P_TS)-1) - (col - coff)%P(P_TS));
				c = ' ';
			}
			else if ( c == NUL && P(P_LS) ) {
				extra[0] = NUL;
				nextra = 1;
				c = '$';
			} else if ( (n = chars[c].ch_size) > 1 ) {
				char *p;
				nextra = 0;
				p = chars[c].ch_str;
				/* copy 'ch-str'ing into 'extra' in reverse */
				while ( n > 1 )
					extra[nextra++] = p[--n];
				c = p[0];
			}
		}

		if (screenp == endscreen) {
			/*
			 * We're one past the end of the screen. If the
			 * current character is null, then we really did
			 * finish, so set didline = TRUE. In either case,
			 * break out because we're done.
			 */
			dec(&memp);
			if (memp.index != 0 && c == NUL) {
				didline = TRUE;
				inc(&memp);
			}
			break;
		}

		if ( c == NUL ) {
			srow = ++row;
			/*
			 * Save this position in case the next line won't
			 * fit on the screen completely.
			 */
			save = memp;
			/* get pointer to start of next row */
			nextrow = &Nextscreen[row*Columns];
			/* blank out the rest of this row */
			while ( screenp != nextrow )
				*screenp++ = ' ';
			col = 0;
			continue;
		}
		if ( col >= Columns ) {
			row++;
			col = 0;
		}
		/* store the character in Nextscreen */
		*screenp++ = c;
		col++;
	}
	/*
	 * If we didn't hit the end of the file, and we didn't finish
	 * the last line we were working on, then the line didn't fit.
	 */
	if (!done && !didline) {
		/*
		 * Clear the rest of the screen and mark the unused lines.
		 */
		screenp = &Nextscreen[srow * Columns];
		while (screenp < endscreen)
			*screenp++ = ' ';
		for (; srow < (Rows-1) ;srow++)
			Nextscreen[srow * Columns] = '@';
		*Botchar = save;
		return;
	}
	/* make sure the rest of the screen is blank */
	while ( screenp < endscreen )
		*screenp++ = ' ';
	/* put '~'s on rows that aren't part of the file. */
	if ( col != 0 )
		row++;
	while ( row < Rows ) {
		Nextscreen[row*Columns] = '~';
		row++;
	}
	if (done)	/* we hit the end of the file */
		*Botchar = *Fileend;
	else
		*Botchar = memp;	/* FIX - prev? */
}

/*
 * nexttoscreen
 *
 * Transfer the contents of Nextscreen to the screen, using Realscreen
 * to avoid unnecessary output.
 */
static void
nexttoscreen()
{
	register char	*np = Nextscreen;
	register char	*rp = Realscreen;
	register char	*endscreen;
	register int	row = 0, col = 0;
	int	gorow = -1, gocol = -1;

	if (anyinput()) {
		need_redraw = TRUE;
		return;
	}

	endscreen = &np[(Rows-1)*Columns];

	outcstr(T_CI);		/* disable cursor */

	for ( ; np < endscreen ; np++,rp++ ) {
		/* If desired screen (contents of Nextscreen) does not */
		/* match what's really there, put it there. */
		if ( *np != *rp ) {
			/* if we are positioned at the right place, */
			/* we don't have to use windgoto(). */
			if (gocol != col || gorow != row) {
				/*
				 * If we're just off by one, don't send
				 * an entire esc. seq. (this happens a lot!)
				 */
				if (gorow == row && gocol+1 == col) {
					outchar(*(np-1));
					gocol++;
				} else
					windgoto(gorow=row,gocol=col);
			}
			outchar(*rp = *np);
			gocol++;
		}
		if ( ++col >= Columns ) {
			col = 0;
			row++;
		}
	}
	outcstr(T_CV);		/* enable cursor again */
}

/*
 * lfiletonext() - like filetonext() but only for cursor line
 *
 * Returns true if the size of the cursor line (in rows) hasn't changed.
 * This determines whether or not we need to call filetonext() to examine
 * the entire screen for changes.
 */
static bool_t
lfiletonext()
{
	register int	row, col;
	register char	*screenp;
	LPTR	memp;
	register char	*nextrow;
	char	extra[16];
	int	nextra = 0;
	register int	c;
	int	n;
	bool_t	eof;
	int	lno;		/* number of the line we're doing */
	int	coff;		/* column offset */

	coff = P(P_NU) ? 8 : 0;

	/*
	 * This should be done more efficiently.
	 */
	if (P(P_NU))
		lno = cntllines(Filemem, Curschar);

	screenp = Nextscreen + (Cline_row * Columns);

	memp = *Curschar;
	memp.index = 0;

	eof = FALSE;
	col = 0;
	row = Cline_row;

	while (!eof) {

		if (P(P_NU) && col == 0 && memp.index == 0) {
			strcpy(extra, mkline(lno));
			nextra = 8;
		}

		/* Get the next character to put on the screen. */

		/* The 'extra' array contains the extra stuff that is */
		/* inserted to represent special characters (tabs, and */
		/* other non-printable stuff.  The order in the 'extra' */
		/* array is reversed. */

		if ( nextra > 0 )
			c = extra[--nextra];
		else {
			c = (unsigned)(0xff & gchar(&memp));
			if (inc(&memp) == -1)
				eof = TRUE;
			/* when getting a character from the file, we */
			/* may have to turn it into something else on */
			/* the way to putting it into 'Nextscreen'. */
			if ( c == TAB && !P(P_LS) ) {
				strcpy(extra,"        ");
				/* tab amount depends on current column */
				nextra = ((P(P_TS)-1) - (col - coff)%P(P_TS));
				c = ' ';
			} else if ( c == NUL && P(P_LS) ) {
				extra[0] = NUL;
				nextra = 1;
				c = '$';
			} else if ( c != NUL && (n=chars[c].ch_size) > 1 ) {
				char *p;
				nextra = 0;
				p = chars[c].ch_str;
				/* copy 'ch-str'ing into 'extra' in reverse */
				while ( n > 1 )
					extra[nextra++] = p[--n];
				c = p[0];
			}
		}

		if ( c == NUL ) {
			row++;
			/* get pointer to start of next row */
			nextrow = &Nextscreen[row*Columns];
			/* blank out the rest of this row */
			while ( screenp != nextrow )
				*screenp++ = ' ';
			col = 0;
			break;
		}

		if ( col >= Columns ) {
			row++;
			col = 0;
		}
		/* store the character in Nextscreen */
		*screenp++ = c;
		col++;
	}
	return ((row - Cline_row) == Cline_size);
}

/*
 * lnexttoscreen
 *
 * Like nexttoscreen() but only for the cursor line.
 */
static void
lnexttoscreen()
{
	register char	*np = Nextscreen + (Cline_row * Columns);
	register char	*rp = Realscreen + (Cline_row * Columns);
	register char	*endline;
	register int	row, col;
	int	gorow = -1, gocol = -1;

	if (anyinput()) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久午夜国产精品| 在线观看一区二区视频| 91精品国产综合久久香蕉的特点| 日本一区二区视频在线观看| 国产一区二区调教| 日韩免费在线观看| 日韩激情视频在线观看| 欧美三级三级三级| 亚洲一二三四在线观看| 色视频成人在线观看免| 亚洲毛片av在线| 色综合天天综合| 亚洲国产成人在线| 国内成+人亚洲+欧美+综合在线| 欧美日韩成人综合在线一区二区| 一区二区成人在线| 欧美亚洲国产bt| 亚洲成人动漫精品| 欧美一级精品在线| 国产乱人伦偷精品视频不卡| 国产欧美日韩在线观看| 国产成人av电影在线观看| 久久精品夜色噜噜亚洲aⅴ| 国产传媒日韩欧美成人| 亚洲图片你懂的| 91亚洲大成网污www| 亚洲精品高清在线| 欧美日韩视频在线一区二区| 日本在线播放一区二区三区| 欧美va亚洲va| 国产99久久久国产精品潘金| 国产精品久久久久久久久图文区 | 国产精品毛片久久久久久久| 国产在线一区观看| 中文字幕一区二区三区在线播放| 欧美在线观看一二区| 石原莉奈一区二区三区在线观看| 欧美videos中文字幕| 成人高清av在线| 亚洲精品免费在线观看| 在线成人高清不卡| 免费在线观看日韩欧美| 精品国产sm最大网站免费看| 国产高清视频一区| 亚洲一区二区三区四区中文字幕| 91精品国产综合久久小美女| 国产98色在线|日韩| 亚洲一区二区三区在线看| 日韩亚洲欧美高清| 不卡电影一区二区三区| 视频一区在线播放| 国产精品久久久久影院亚瑟 | 国产一本一道久久香蕉| 久久亚洲精精品中文字幕早川悠里| 99久久国产综合色|国产精品| 舔着乳尖日韩一区| 国产欧美一区在线| 欧美一区二区三区在线看| 国产91丝袜在线播放| 亚洲主播在线观看| 国产精品美女久久久久高潮| 欧美人xxxx| 色综合久久久久久久久| 九九九久久久精品| 亚洲午夜免费视频| 欧美成人video| 欧洲生活片亚洲生活在线观看| 国产乱码精品1区2区3区| 亚洲一区二区三区在线播放| 中文字幕一区二区三| 精品三级av在线| 精品视频123区在线观看| 波多野结衣亚洲| 国产一区二区电影| 免费观看日韩av| 亚洲国产三级在线| 国产精品无圣光一区二区| 欧美色图一区二区三区| 粉嫩aⅴ一区二区三区四区五区| 日韩国产高清影视| 亚洲美女偷拍久久| 国产精品久久精品日日| 国产日韩欧美激情| 26uuu亚洲综合色| 欧美成人女星排名| 欧美一级欧美三级| 欧美精品v国产精品v日韩精品| 色呦呦日韩精品| 国产精品影视在线观看| 日产欧产美韩系列久久99| 亚洲一二三四在线| 亚洲国产欧美一区二区三区丁香婷| 专区另类欧美日韩| 中文字幕亚洲欧美在线不卡| 中文字幕一区二区5566日韩| 国产精品私人影院| 国产精品久久久久婷婷二区次| 国产欧美日韩久久| 欧美成人一级视频| 日韩久久久精品| 制服丝袜国产精品| 精品日韩在线观看| 国产女主播一区| 中文在线资源观看网站视频免费不卡 | 日韩美女天天操| 久久久国产综合精品女国产盗摄| 久久久久亚洲蜜桃| 国产精品久久久久久亚洲伦| 中文字幕亚洲成人| 自拍偷自拍亚洲精品播放| 国产精品成人午夜| 亚洲男人的天堂在线观看| 亚洲免费观看在线观看| 亚洲午夜久久久久久久久电影院| 亚洲第一电影网| 另类小说欧美激情| 国产黄色91视频| 91在线观看美女| 欧美日韩视频专区在线播放| 欧美成人免费网站| 精品动漫一区二区三区在线观看| 日韩欧美中文字幕公布| 国产亚洲综合色| 亚洲免费视频中文字幕| 偷拍一区二区三区| 国产一区日韩二区欧美三区| av午夜精品一区二区三区| 91久久精品国产91性色tv| 91精品国产一区二区| 国产三级欧美三级| 中文字幕一区二区三中文字幕| **网站欧美大片在线观看| 亚洲午夜精品网| 韩国女主播成人在线观看| 9人人澡人人爽人人精品| 欧美日韩国产综合草草| 国产日韩精品一区二区三区| 亚洲免费av在线| 久久电影网站中文字幕| 91色综合久久久久婷婷| 日韩欧美的一区| 亚洲欧美国产77777| 激情深爱一区二区| 色综合视频一区二区三区高清| 欧美一级日韩不卡播放免费| 成人免费在线播放视频| 日本午夜一区二区| 972aa.com艺术欧美| 欧美va在线播放| 亚洲精品v日韩精品| 国产精品亚洲综合一区在线观看| 精品视频一区二区不卡| 国产精品免费免费| 亚洲成人动漫在线免费观看| 久久精品国产澳门| 欧美亚洲一区二区在线观看| 国产亚洲一二三区| 日本色综合中文字幕| 色噜噜狠狠一区二区三区果冻| 精品国产亚洲在线| 婷婷综合五月天| 不卡区在线中文字幕| 久久精品在线观看| 老司机精品视频在线| 欧美日韩国产系列| 亚洲国产美女搞黄色| 欧美日韩一区二区三区在线| 一区二区三区蜜桃| 欧美性做爰猛烈叫床潮| 亚洲高清不卡在线观看| 欧美日韩一区三区| 午夜精品一区二区三区三上悠亚| 欧美日韩国产片| 免费一级片91| 精品国产91乱码一区二区三区| 极品美女销魂一区二区三区免费| 精品国产凹凸成av人导航| 国产激情偷乱视频一区二区三区 | 欧美日韩久久久久久| 五月激情综合色| 欧美一级艳片视频免费观看| 久99久精品视频免费观看| 久久久高清一区二区三区| 岛国精品在线播放| 日韩毛片视频在线看| 欧美日韩国产精选| 麻豆精品在线观看| 中文在线免费一区三区高中清不卡| 成人av电影在线网| 亚洲精品乱码久久久久久| 91精品欧美福利在线观看| 久久99精品视频| 国产精品日产欧美久久久久| 色老综合老女人久久久| 视频一区中文字幕| 国产三级一区二区| 欧美私人免费视频| 精品一区二区在线免费观看| 国产精品色哟哟| 在线播放欧美女士性生活|