ptyx.h: * on a screen is screen->max_row + 1, and similarly for columns.
ptyx.h:#define VWindow(screen)		(screen->mappedVwin->window)
ptyx.h:#define TWindow(screen)		(screen->mappedTwin->window)
ptyx.h:#define Width(screen)		(screen->mappedVwin->width)
ptyx.h:#define Height(screen)		(screen->mappedVwin->height)
ptyx.h:#define FullWidth(screen)	(screen->mappedVwin->fullwidth)
ptyx.h:#define FullHeight(screen)	(screen->mappedVwin->fullheight)
ptyx.h:#define FontWidth(screen)	(screen->mappedVwin->f_width)
ptyx.h:#define FontHeight(screen)	(screen->mappedVwin->f_height)
ptyx.h:#define TWidth(screen)		(screen->mappedTwin->width)
ptyx.h:#define THeight(screen)		(screen->mappedTwin->height)
ptyx.h:#define TFullWidth(screen)	(screen->mappedTwin->fullwidth)
ptyx.h:#define TFullHeight(screen)	(screen->mappedTwin->fullheight)
ptyx.h:#define TekScale(screen)	(screen->mappedTwin->tekscale)
ptyx.h:#define Titlebar(screen)	(screen->mappedVwin->titlebar)
ptyx.h:#define TTitlebar(screen)	(screen->mappedTwin->titlebar)
ptyx.h:#define ActiveIcon(screen)	(screen->active_icon && \
ptyx.h:				(screen->mappedVwin == &screen->iconVwin))
ptyx.h:#define TActiveIcon(screen)	(screen->active_icon && \
ptyx.h:				(screen->mappedTwin == &screen->iconTwin))
ptyx.h:#define CursorX(screen,col) ((col) * FontWidth(screen) + screen->border)
ptyx.h:#define CursorY(screen,row) ((screen->instatus ? \
ptyx.h:			: (((row) - screen->topline) * FontHeight(screen))) +\
ptyx.h:			screen->border + Titlebar(screen))
Tekproc.c:#define	TEKHOME		((TekChar[screen->page.fontsize].nlines - 1)\
Tekproc.c:			 * TekChar[screen->page.fontsize].vsize)
Tekproc.c:#define	TekMove(x,y)	screen->cur_X = x; screen->cur_Y = y
Tekproc.c:			if(screen->TekGIN) {
Tekproc.c:				if(screen->margin == MARGIN2)
Tekproc.c:				TekEnq(c, screen->cur_X, screen->cur_Y);
Tekproc.c:			if(screen->logging) {
Tekproc.c:				screen->logstart = buffer;
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			screen->TekGIN = &TekRecord->ptr[-1];
Tekproc.c:			if(GINcursor = make_tcross(screen->mousecolor,
Tekproc.c:			 screen->background, GXcopy))
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:				screen->pen = PENDOWN;
Tekproc.c:				screen->pen = PENUP;
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			screen->cur.fontsize = c & 03;
Tekproc.c:			if((c &= LINEMASK) != screen->cur.linetype) {
Tekproc.c:				screen->cur.linetype = c;
Tekproc.c:			screen->pen = PENUP;
Tekproc.c:			screen->pen = PENDOWN;
Tekproc.c:			x = screen->cur_X;
Tekproc.c:			y = screen->cur_Y;
Tekproc.c:			if(screen->pen == PENDOWN)
Tekproc.c:				if(screen->pen == PENDOWN)
Tekproc.c:					TekDraw(screen->cur.x, screen->cur.y);
Tekproc.c:					TekMove(screen->cur.x, screen->cur.y);
Tekproc.c:				screen->pen = PENDOWN;
Tekproc.c:				TekMove(screen->cur.x, screen->cur.y);
Tekproc.c:				TekDraw(screen->cur.x, screen->cur.y);
Tekproc.c:				TekMove(screen->cur.x, screen->cur.y);
Tekproc.c:				TekDraw(screen->cur.x, screen->cur.y);
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			screen->cur_X = screen->margin == MARGIN1 ? 0 :
Tekproc.c:			if(screen->TekGIN)
Tekproc.c:			if(!TekRefresh && (screen->display->qlen > 0 ||
Tekproc.c:			 (ioctl(screen->display->fd, I_NREAD, &arg), arg) >0))
Tekproc.c:			    : screen->cur.fontsize;
Tekproc.c:			XTextMask(TWindow(screen), (int)(screen->cur_X *
Tekproc.c:			 TekScale(screen)) + screen->border,
Tekproc.c:			 (int)((TEKHEIGHT + TEKTOPPAD - screen->cur_Y) *
Tekproc.c:			 TekScale(screen)) + screen->border + TTitlebar(screen)
Tekproc.c:			 - screen->tobaseline[c], &ch, 1, screen->Tfont[c],
Tekproc.c:			 screen->Tforeground);
Tekproc.c:				if(screen->logging)
Tekproc.c:				if((Tbcnt = read(screen->respond,
Tekproc.c:					if(screen->icon_show
Tekproc.c:					   && !screen->iconinput) {
Tekproc.c:						screen->iconinput = TRUE;
Tekproc.c:				 NULL, screen->timeout)) < 0){
Tekproc.c:					if(GetButtonState(screen->sb) & HILITED)
Tekproc.c:						 ButtonRegion(screen->sb));
Tekproc.c:					screen->timeout->tv_usec = STEPTIME;
Tekproc.c:	register int border = 2 * screen->border;
Tekproc.c:	if(rep && (screen->mappedTwin == &screen->fullTwin)) {
Tekproc.c:			if (screen->active_icon)
Tekproc.c:	screen->cur_X = 0;
Tekproc.c:	screen->cur_Y = TEKHOME;
Tekproc.c:	screen->cur = screen->page;
Tekproc.c:	screen->margin = MARGIN1;
Tekproc.c:	if(screen->TekGIN) {
Tekproc.c:		screen->TekGIN = NULL;
Tekproc.c:	if(!screen->waitrefresh)
Tekproc.c:	XDefineCursor(TWindow(screen), cur = make_wait(screen->mousecolor,
Tekproc.c:	 screen->background, GXcopy));
Tekproc.c:	XDefineCursor(TWindow(screen), (screen->TekGIN && GINcursor) ?
Tekproc.c:	 GINcursor : screen->arrow);
Tekproc.c:	screen->cur_X = 0;
Tekproc.c:	screen->cur_Y = TEKHOME;
Tekproc.c:	screen->margin = MARGIN1;
Tekproc.c:	screen->page = screen->cur;
Tekproc.c:	if(screen->TekGIN)
Tekproc.c:	x = screen->cur.x;
Tekproc.c:	y = screen->cur.y;
Tekproc.c:			screen->cur.x = x;
Tekproc.c:			screen->cur.y = y;
Tekproc.c:	x = ( screen->cur_X -=
Tekproc.c:			       : screen->cur.fontsize]
Tekproc.c:	if(screen->margin == MARGIN1 && x < 0 || screen->margin == MARGIN2
Tekproc.c:		if((l = (screen->cur_Y + (t->vsize - 1)) / t->vsize + 1) >=
Tekproc.c:			screen->margin = !screen->margin;
Tekproc.c:		screen->cur_Y = l * t->vsize;
Tekproc.c:		screen->cur_X = (t->charsperline - 1) * t->hsize;
Tekproc.c:	if( ( screen->cur_X +=
Tekproc.c:			       : screen->cur.fontsize]
Tekproc.c:		if((l = screen->cur_Y / t->vsize - 1) < 0) {
Tekproc.c:			screen->margin = !screen->margin;
Tekproc.c:		screen->cur_Y = l * t->vsize;
Tekproc.c:		screen->cur_X = screen->margin == MARGIN1 ? 0 : TEKWIDTH / 2;
Tekproc.c:		     : screen->cur.fontsize];
Tekproc.c:	if((l = (screen->cur_Y + (t->vsize - 1)) / t->vsize + 1) >= t->nlines) {
Tekproc.c:		if((screen->margin = !screen->margin) != MARGIN1) {
Tekproc.c:			if(screen->cur_X < TEKWIDTH / 2)
Tekproc.c:				screen->cur_X += TEKWIDTH / 2;
Tekproc.c:		} else if(screen->cur_X >= TEKWIDTH / 2)
Tekproc.c:			screen->cur_X -= TEKWIDTH / 2;
Tekproc.c:	screen->cur_Y = l * t->vsize;
Tekproc.c:		     : screen->cur.fontsize];
Tekproc.c:	if((l = screen->cur_Y / t->vsize - 1) < 0) {
Tekproc.c:		if((screen->margin = !screen->margin) != MARGIN1) {
Tekproc.c:			if(screen->cur_X < TEKWIDTH / 2)
Tekproc.c:				screen->cur_X += TEKWIDTH / 2;
Tekproc.c:		} else if(screen->cur_X >= TEKWIDTH / 2)
Tekproc.c:			screen->cur_X -= TEKWIDTH / 2;
Tekproc.c:	screen->cur_Y = l * t->vsize;
Tekproc.c:	if(nplot == 0 || T_lastx != screen->cur_X || T_lasty != screen->cur_Y) {
Tekproc.c:		if(nplot > 0 && screen->cur.linetype != SOLIDLINE)
Tekproc.c:		AddToDraw(VertexDontDraw, screen->cur_X, screen->cur_Y);
Tekproc.c:	T_lastx = screen->cur_X = x;
Tekproc.c:	T_lasty = screen->cur_Y = y;
Tekproc.c:	lp->x = x = x * TekScale(screen) + screen->border;
Tekproc.c:	 screen->border + TTitlebar(screen);
Tekproc.c:	if(screen->cur.linetype == SOLIDLINE)
Tekproc.c:		XDraw (TWindow(screen), Tline, nplot, 1, 1, screen->Tforeground,
Tekproc.c:		 screen->Tforeground, screen->linepat[screen->cur.linetype - 1],
Tekproc.c:	XDefineCursor(TWindow(screen), screen->arrow);
Tekproc.c:	if(screen->TekGIN) {
Tekproc.c:		*screen->TekGIN = CANCEL;	/* modify recording */
Tekproc.c:		screen->TekGIN = NULL;
Tekproc.c:	if((mousex = (mousex - screen->border) / TekScale(screen)) < 0)
Tekproc.c:	if((mousey = TEKHEIGHT + TEKTOPPAD - (mousey - screen->border -
Tekproc.c:	int pty = screen->respond;
Tekproc.c:			screen->TekEmu = FALSE;
Tekproc.c:	if(screen->icon_show) {
Tekproc.c:		if(screen->icon_show < 0) {
Tekproc.c:			screen->mappedTwin = &screen->iconTwin;
Tekproc.c:			screen->icon_show = TRUE;
Tekproc.c:	} else if(!screen->Tshow) {
Tekproc.c:		screen->mappedTwin = &screen->fullTwin;
Tekproc.c:		screen->Tshow = TRUE;
Tekproc.c:	if(screen->select)
Tekproc.c:	screen->TekEmu = FALSE;
Tekproc.c:	register int border = 2 * screen->border;
Tekproc.c:	screen->mappedTwin = &screen->fullTwin;
Tekproc.c:	if (!(screen->Tfont[SMALLFONT] = XGetFont(SMALLFONTNAME))) {
Tekproc.c:	screen->xorplane = 1;
Tekproc.c:	screen->Tbackground = W_Pixel;
Tekproc.c:	screen->Tforeground = B_Pixel;
Tekproc.c:	screen->Tcursorcolor = B_Pixel;
Tekproc.c:			if(XGetColorCells(0, 2, 1, &screen->xorplane, pixels)) {
Tekproc.c:				screen->cellsused = TRUE;
Tekproc.c:				screen->colorcells[2] = cdef;
Tekproc.c:				screen->Tbackground = pixels[0];
Tekproc.c:				screen->Tforeground = pixels[1];
Tekproc.c:				screen->Tcursorcolor = screen->Tbackground |
Tekproc.c:				 screen->xorplane;
Tekproc.c:				screen->Tcolor |= C_CURSOR;
Tekproc.c:				screen->planeused = TRUE;
Tekproc.c:		} else if (XGetColorCells(0, 1, 1, &screen->xorplane,
Tekproc.c:		 &screen->Tbackground)) {
Tekproc.c:			screen->Tforeground = screen->Tbackground |
Tekproc.c:			 screen->xorplane;
Tekproc.c:			screen->Tcursorcolor = screen->Tforeground;
Tekproc.c:			screen->planeused = TRUE;
Tekproc.c:		if (screen->Tbackground != W_Pixel) {
Tekproc.c:				screen->Tcolor |= C_BACKGROUND;
Tekproc.c:			cdef.pixel = screen->Tbackground;
Tekproc.c:			if(screen->cellsused) {
Tekproc.c:				screen->colorcells[0] = cdef;
Tekproc.c:				cdef.pixel = screen->Tforeground |
Tekproc.c:					screen->xorplane;
Tekproc.c:				screen->Tcolor |= C_FOREGROUND;
Tekproc.c:			cdef.pixel = screen->Tforeground;
Tekproc.c:			if(screen->cellsused) {
Tekproc.c:				screen->colorcells[1] = cdef;
Tekproc.c:				cdef.pixel = screen->Tcursorcolor;
Tekproc.c:		screen->Tbgndtile = NULL;
Tekproc.c:	twindow.bdrwidth = screen->borderwidth;
Tekproc.c:	twindow.border = screen->graybordertile;
Tekproc.c:	twindow.background = screen->Tbgndtile;
Tekproc.c:		XFreeFont(screen->Tfont[SMALLFONT]);
Tekproc.c:	screen->Tbox = T_box;
Tekproc.c:		if(screen->timer) {
Tekproc.c:			screen->timer = 0;
Tekproc.c:			screen->select |= INWINDOW;
Tekproc.c:			screen->select &= ~INWINDOW;
Tekproc.c:	XQueryFont(screen->Tfont[SMALLFONT], &finfo);
Tekproc.c:	screen->tobaseline[SMALLFONT] = finfo.height - finfo.baseline;
Tekproc.c:	if (!(screen->Tfont[THREEFONT] = XGetFont(THREEFONTNAME)))
Tekproc.c:		screen->Tfont[THREEFONT] = screen->Tfont[SMALLFONT];
Tekproc.c:		XQueryFont(screen->Tfont[THREEFONT], &finfo);
Tekproc.c:	screen->tobaseline[THREEFONT] = finfo.height - finfo.baseline;
Tekproc.c:	if (!screen->fnt_icon)
Tekproc.c:	    screen->fnt_icon = XGetFont( f_i );
Tekproc.c:	screen->Tfont[ICONFONT] = screen->fnt_icon;
Tekproc.c:	XQueryFont( screen->fnt_icon, &ifinfo );
Tekproc.c:	screen->tobaseline[ICONFONT] = ifinfo.height - ifinfo.baseline;
Tekproc.c:	if (!(screen->Tfont[TWOFONT] = XGetFont(TWOFONTNAME)))
Tekproc.c:		screen->Tfont[TWOFONT] = screen->Tfont[THREEFONT];
Tekproc.c:		XQueryFont(screen->Tfont[TWOFONT], &finfo);
Tekproc.c:	screen->tobaseline[TWOFONT] = finfo.height - finfo.baseline;
Tekproc.c:	if (!(screen->Tfont[LARGEFONT] = XGetFont(LARGEFONTNAME)))
Tekproc.c:		screen->Tfont[LARGEFONT] = screen->Tfont[TWOFONT];
Tekproc.c:		XQueryFont(screen->Tfont[LARGEFONT], &finfo);
Tekproc.c:	screen->tobaseline[LARGEFONT] = finfo.height - finfo.baseline;
Tekproc.c:		screen->linepat[i] = Tpattern[i];
Tekproc.c:	screen->margin = MARGIN1;		/* Margin 1		*/
Tekproc.c:	screen->cur.fontsize = LARGEFONT;	/* set large font	*/
Tekproc.c:	screen->TekGIN = FALSE;			/* GIN off		*/
Tekproc.c:	if(screen->iconVwin.window) {
Tekproc.c:		XQueryWindow(screen->iconVwin.window, &wininfo);
Tekproc.c:		x = twindow.x + (twindow.width - screen->iconTwin.width) / 2;
Tekproc.c:		y = twindow.y + (twindow.height - screen->iconTwin.height) / 2;
Tekproc.c:	screen->iconTwin.window =
Tekproc.c:		XCreateWindow( RootWindow, x, y, 1, 1, screen->borderwidth,
Tekproc.c:			       screen->bordertile, screen->bgndtile );
Tekproc.c:	XSetIconWindow( screen->fullTwin.window, screen->iconTwin.window );
Tekproc.c:	XDefineCursor( screen->iconTwin.window, screen->arrow );
Tekproc.c:	XSelectInput( screen->iconTwin.window,
Tekproc.c:		      screen->active_icon && (term.flags & ICONINPUT)
Tekproc.c:	XDefineCursor( TWindow(screen), screen->curs );
Tekproc.c:	if((screen->Twinname = malloc(screen->winnamelen + 6)) == NULL)
Tekproc.c:	strcpy(screen->Twinname, screen->winname);
Tekproc.c:	strcat(screen->Twinname, " (Tek)");
Tekproc.c:	screen->Twinnamelen = strlen(screen->Twinname);
Tekproc.c:	XStoreName (TWindow(screen), screen->Twinname);
Tekproc.c:	strcpy(iconname, screen->winname);
Tekproc.c:	XStoreName (screen->iconTwin.window, iconname);
Tekproc.c:	screen->cur_X = 0;
Tekproc.c:	screen->cur_Y = TEKHOME;
Tekproc.c:	if(screen->Tbgndtile && ((screen->Tcolor & C_BACKGROUND) ||
Tekproc.c:	 screen->planeused))
Tekproc.c:		XFreePixmap(screen->Tbgndtile);
Tekproc.c:	i = screen->Tbackground;
Tekproc.c:	screen->Tbackground = screen->Tforeground;
Tekproc.c:	screen->Tforeground = i;
Tekproc.c:	screen->Tcolor = (screen->Tcolor & ~C_FBMASK) | switchfb[screen->Tcolor
Tekproc.c:	if(screen->cellsused) {
Tekproc.c:		screen->Tcursorcolor = screen->Tbackground | screen->xorplane;
Tekproc.c:		i = screen->select ? 2 : !flag;
Tekproc.c:		screen->colorcells[i].pixel = screen->Tcursorcolor;
Tekproc.c:		XStoreColor(&screen->colorcells[i]);
Tekproc.c:		screen->colorcells[flag].pixel = screen->Tforeground |
Tekproc.c:		 screen->xorplane;
Tekproc.c:		XStoreColor(&screen->colorcells[flag]);
Tekproc.c:		screen->Tcursorcolor = screen->Tforeground;
Tekproc.c:	if((screen->Tcolor & C_BACKGROUND) || screen->planeused) {
Tekproc.c:		if(!(screen->Tbgndtile = XMakeTile(screen->Tbackground)))
Tekproc.c:		screen->Tbgndtile = (screen->Tbackground == W_Pixel) ? W_Pixmap
Tekproc.c:		XChangeBackground(TWindow(screen), screen->Tbgndtile);
Tekproc.c:	if (screen->icon_show && !screen->active_icon) return;
Tekproc.c:		pixel = screen->Tcursorcolor;
Tekproc.c:		planes = screen->xorplane;
Tekproc.c:		pixel = screen->Tbackground;
Tekproc.c:	    : screen->cur.fontsize;
Tekproc.c:	x = (screen->cur_X * TekScale(screen)) + screen->border;
Tekproc.c:	y = ((TEKHEIGHT + TEKTOPPAD - screen->cur_Y) * TekScale(screen)) +
Tekproc.c:	 screen->border - screen->tobaseline[c] + TTitlebar(screen);
Tekproc.c:	if(!toggle || screen->select) {
Tekproc.c:		screen->Tbox[c]->x = x;
Tekproc.c:		screen->Tbox[c]->y = y;
Tekproc.c:		XDraw(TWindow(screen), screen->Tbox[c], NBOX, 1, 1, pixel,
Tekproc.c:	XChangeBorder(TWindow(screen), screen->bordertile);
Tekproc.c:	XChangeBorder(TWindow(screen), screen->graybordertile);
Tekproc.c:	chown(buf, screen->uid, screen->gid);
Tekproc.c:	sprintf(buf, "\033%c\033%c", screen->page.fontsize + '8',
Tekproc.c:	 screen->page.linetype + '`');
Tekproc.c:	register int border = 2 * screen->border;
Tekproc.c:	if(!screen->Ttitle.tbar)
Tekproc.c:	if(screen->select && screen->TekEmu)
Tekproc.c:	XMapWindow(screen->Ttitle.tbar);
Tekproc.c:	register int border = 2 * screen->border;
Tekproc.c:	XUnmapWindow(screen->Ttitle.tbar);
Tekproc.c:	if(screen->Ttitle.hilited)
Tekproc.c:	XMapWindow(screen->Ttitle.left);
Tekproc.c:	XMapWindow(screen->Ttitle.right);
Tekproc.c:	screen->Ttitle.hilited = TRUE;
Tekproc.c:	if(!screen->Ttitle.hilited)
Tekproc.c:	XUnmapWindow(screen->Ttitle.left);
Tekproc.c:	XUnmapWindow(screen->Ttitle.right);
Tekproc.c:	screen->Ttitle.hilited = FALSE;
Tekproc.c:	if((screen->Ttitle.width = i = screen->Ttitle.fullwidth) >
Tekproc.c:	 (j = width - 2 * (MINHILITE + screen->title_n_size + 1)))
Tekproc.c:		screen->Ttitle.width = (i = j) + screen->title_n_size;
Tekproc.c:	j = width - i - 2 * (screen->title_n_size + 1);
Tekproc.c:	screen->Ttitle.x = i + 1 + screen->title_n_size;
Tekproc.c:	XChangeWindow(screen->Ttitle.tbar, width, screen->titleheight - 1);
Tekproc.c:	XChangeWindow(screen->Ttitle.left, i, screen->titlefont->height);
Tekproc.c:	XConfigureWindow(screen->Ttitle.right, width - j - 1, TITLEPAD, j,
Tekproc.c:	 screen->titlefont->height);
Tekproc.c:	if(rep && (rep->x > (screen->Ttitle.x + screen->Ttitle.width) ||
Tekproc.c:	 (rep->x + rep->width) < screen->Ttitle.x ||
Tekproc.c:	 rep->y > (screen->Ttitle.y + screen->titlefont->height) ||
Tekproc.c:	 (rep->y + rep->height) < screen->Ttitle.y))
Tekproc.c:	XText(screen->Ttitle.tbar, screen->Ttitle.x, screen->Ttitle.y,
Tekproc.c:	 screen->Twinname, screen->Twinnamelen, screen->titlefont->id,
Tekproc.c:	 screen->foreground, screen->background);
Tekproc.c:	if((screen->Ttitle.tbar = XCreateWindow(TWindow(screen), -1, -1,
Tekproc.c:	 w = TFullWidth(screen), screen->titleheight - 1, 1, screen->bordertile,
Tekproc.c:	 screen->bgndtile)) == NULL)
Tekproc.c:	XSelectInput(screen->Ttitle.tbar, ButtonPressed | ButtonReleased |
Tekproc.c:	if(!screen->hilitetile && (screen->hilitetile =
Tekproc.c:	 make_hilite(screen->foreground, screen->background)) == NULL)
Tekproc.c:	screen->Ttitle.fullwidth = XQueryWidth(screen->Twinname,
Tekproc.c:	 screen->titlefont->id);
Tekproc.c:	if((screen->Ttitle.width = i = screen->Ttitle.fullwidth) >
Tekproc.c:	 (j = w - 2 * (MINHILITE + screen->title_n_size + 1)))
Tekproc.c:		screen->Ttitle.width = (i = j) + screen->title_n_size;
Tekproc.c:	j = w - i - 2 * (screen->title_n_size + 1);
Tekproc.c:	screen->Ttitle.x = i + 1 + screen->title_n_size;
Tekproc.c:	screen->Ttitle.y = TITLEPAD;
Tekproc.c:	hilite[0].height = hilite[1].height = screen->titlefont->height;
Tekproc.c:	hilite[0].background = hilite[1].background = screen->hilitetile;
Tekproc.c:	if(XCreateWindows(screen->Ttitle.tbar, hilite, 2) != 2)
Tekproc.c:	screen->Ttitle.left = hilite[0].self;
Tekproc.c:	screen->Ttitle.right = hilite[1].self;
Tekproc.c:			    : screen->cur.fontsize;
Tekproc.c:	curmodes = screen->cur;
Tekproc.c:		if(vshow = screen->show)
Tekproc.c:	if(vshow != screen->show) {
Tekproc.c:		SetItemCheck(*menu, TMENU_VTWIN, (vshow = screen->show));
Tekproc.c:		screen->cur = curmodes;
Tekproc.c:		screen->cur_X = 0;
Tekproc.c:		screen->cur_Y = TEKHOME;
Tekproc.c:		screen->Tshow = FALSE;
Tekproc.c:		if(screen->TekEmu) {
Tekproc.c:			if(screen->logging) {
Tekproc.c:				screen->logstart = buffer;
Tekproc.c:		if(screen->show = !screen->show) {
Tekproc.c:				screen->show = TRUE;
Tekproc.c:			screen->show = FALSE;
Tekproc.c:			if(!screen->TekEmu) {
Tekproc.c:				if(screen->logging) {
Tekproc.c:					screen->logstart = Tbuffer;
Tekproc.c:				screen->TekEmu = TRUE;
Tekproc.c:	if (screen->active_icon) {
Tekproc.c:	    screen->iconTwin.width = TWidth(screen)
Tekproc.c:	    screen->iconTwin.height = THeight(screen)
Tekproc.c:	    XChangeWindow( screen->iconTwin.window,
Tekproc.c:			   screen->iconTwin.width,
Tekproc.c:			   screen->iconTwin.height );
Tekproc.c:	screen->iconTwin.fullwidth = screen->iconTwin.width;
Tekproc.c:	screen->iconTwin.fullheight = screen->iconTwin.height;
Tekproc.c:	screen->iconTwin.tekscale = (double) screen->iconTwin.width
Tekproc.c:	if ( (d = (double) screen->iconTwin.height
Tekproc.c:	     ) < screen->iconTwin.tekscale )
Tekproc.c:	    screen->iconTwin.tekscale = d;
button.c:	bp = (screen->sb && (reply->window == screen->sb->bar ||
button.c:	 GetButtonState(screen->sb) != BUTTON_NORMAL)) ?
button.c:	 ((Titlebar(screen) && (reply->window == screen->title.tbar ||
button.c:	 reply->window == screen->Ttitle.tbar)) ? tfunc[shift][dir][button] :
button.c:	cursor = screen->curs;
button.c:	ncols = screen->max_col + 1;	/* needed by Coordinate() define */
button.c:	 crow > screen->max_row) {
button.c:	if (screen->cursor_state)
button.c:			if (screen->cursor_set && !screen->cursor_state)
button.c:	i = Length(screen, row, col, screen->max_col);
button.c:	SaveText(screen, row, col, screen->max_col, line);
button.c:	cursor = screen->curs;
button.c:	ncols = screen->max_col + 1;	/* needed by Coordinate() define */
button.c:	if (screen->cursor_state)
button.c:			if (screen->cursor_set && !screen->cursor_state)
button.c:	if((row = (y - screen->border - Titlebar(screen)) / FontHeight(screen))
button.c:	else if(row > screen->max_row)
button.c:		row = screen->max_row;
button.c:	if((col = (x - screen->border + (i / 3)) / i) < 0)
button.c:	else if(col > screen->max_col) {
button.c:		row++;	/* this can be screen->max_row + 1 */
button.c:		for(i = screen->max_col,
button.c:		 ch = screen->buf[2 * (row + screen->topline)] + i ;
button.c:		i = screen->foreground;
button.c:		screen->foreground = screen->background;
button.c:		screen->background = i;
button.c:		if((i = screen->max_col - fcol + 1) > 0) {	/* first row */
button.c:			 screen->border, frow * FontHeight(screen) +
button.c:			 screen->border + Titlebar(screen), i * FontWidth(screen),
button.c:			 FontHeight(screen), screen->background);
button.c:			j = screen->max_col + 1;
button.c:			XPixSet(VWindow(screen), screen->border, (frow + 1) *
button.c:			 FontHeight(screen) + screen->border + Titlebar(screen),
button.c:			 screen->background);
button.c:		if(tcol > 0 && trow <= screen->max_row) {	/* last row */
button.c:			XPixSet(VWindow(screen), screen->border, trow *
button.c:			 FontHeight(screen) + screen->border + Titlebar(screen),
button.c:			 screen->background);
button.c:		XPixSet(VWindow(screen), fcol* FontWidth(screen) + screen->border,
button.c:		 frow * FontHeight(screen) + screen->border + Titlebar(screen),
button.c:		 i * FontWidth(screen), FontHeight(screen), screen->background);
button.c:		i = screen->foreground;
button.c:		screen->foreground = screen->background;
button.c:		screen->background = i;
button.c:	else if (ccol > screen->max_col) { crow++; ccol = 0; }
button.c:	else if (crow > screen->max_row) { crow = screen->max_row; ccol = 0; }
button.c:	if (row > screen->max_row) { row = screen->max_row + 1 ; col = 0; }
button.c:	else if (--col > screen->max_col) col = screen->max_col;
button.c:		j += Length(screen, crow, ccol, screen->max_col) + 1;
button.c:			j += Length(screen, i, 0, screen->max_col) + 1;
button.c:		lp = SaveText(screen, crow, ccol, screen->max_col, lp);
button.c:			lp = SaveText(screen, i, 0, screen->max_col, lp);
button.c:	ch = screen->buf[2 * (row + screen->topline)];
button.c:	register char *ch = screen->buf[2 * (row + screen->topline)];
button.c:	if (!screen->send_mouse_pos) {
button.c:	row = (reply->y - screen->border - Titlebar(screen)) / FontHeight(screen);
button.c:	col = (reply->x - screen->border) / FontWidth(screen);
button.c:	if((reply->window == screen->title.tbar || reply->window ==
button.c:	 screen->Ttitle.tbar) && InTitle(screen, reply->window,
button.c:		Gray_Tile = screen->graybordertile;
button.c:		Menu_DefaultCursor = screen->arrow;
button.c:			Menu_DefaultFontInfo = screen->titlefont;
button.c:	 screen->title.tbar)
button.c:	 screen->Ttitle.tbar)
button.c:		wname = (reply->window == screen->title.tbar || reply->window
button.c:		 == VWindow(screen)) ? screen->winname : screen->Twinname;
button.c:		screen->waitrefresh = TRUE;
button.c:	screen->holdoff = TRUE;
button.c:	screen->waitrefresh = FALSE;
button.c:	screen->timer = 0;
button.c:	screen->holdoff = FALSE;
button.c:		if(xactive_icon = screen->active_icon)
button.c:		if(xauto = screen->autoraise)
button.c:		if(xbell = screen->visualbell)
button.c:		if(xdeiconwarp = screen->deiconwarp)
button.c:		if(xlog = screen->logging)
button.c:		if(screen->inhibit & I_LOG)
button.c:		if(screen->inhibit & I_SIGNAL)
button.c:	if (xactive_icon != screen->active_icon)
button.c:			     (xactive_icon = screen->active_icon));
button.c:	if (xauto != screen->autoraise)
button.c:		 screen->autoraise));
button.c:	if (xbell != screen->visualbell)
button.c:		 screen->visualbell));
button.c:	if (xdeiconwarp != screen->deiconwarp)
button.c:		 screen->deiconwarp));
button.c:	if (xlog != screen->logging)
button.c:		SetItemCheck(*menu, XMENU_LOG, (xlog = screen->logging));
button.c:		        screen->fullVwin.titlebar =
button.c:			    screen->fullTwin.titlebar = 0;
button.c:		        screen->fullVwin.titlebar =
button.c:			    screen->fullTwin.titlebar = screen->titleheight;
button.c:		screen->active_icon = !screen->active_icon;
button.c:		if (screen->active_icon && !screen->fnt_icon) {
button.c:		    screen->fnt_icon = fInfo->id;
button.c:		    screen->iconVwin.f_width = fInfo->width;
button.c:		    screen->iconVwin.f_height = fInfo->height;
button.c:		if (screen->iconVwin.window) {
button.c:		    XSelectInput( screen->iconVwin.window,
button.c:		    		  screen->active_icon
button.c:		if (screen->iconTwin.window) {
button.c:		    XSelectInput( screen->iconTwin.window,
button.c:				  screen->active_icon
button.c:		if (screen->iconVwin.window)
button.c:		    XSelectInput( screen->iconVwin.window,
button.c:				  screen->active_icon
button.c:		if (screen->iconTwin.window)
button.c:		    XSelectInput( screen->iconTwin.window,
button.c:				  screen->active_icon
button.c:		screen->autoraise = !screen->autoraise;
button.c:		screen->deiconwarp = !screen->deiconwarp;
button.c:		screen->visualbell = !screen->visualbell;
button.c:		if(screen->logging)
button.c:		if(screen->pid > 1)
button.c:			killpg(getpgrp(screen->pid), SIGCONT);
button.c:		if(screen->pid > 1)
button.c:			killpg(getpgrp(screen->pid), SIGTSTP);
button.c:		if(screen->pid > 1)
button.c:			killpg(getpgrp(screen->pid), SIGINT);
button.c:		if(screen->pid > 1)
button.c:			killpg(getpgrp(screen->pid), SIGHUP);
button.c:		if(screen->pid > 1)
button.c:			killpg(getpgrp(screen->pid), SIGTERM);
button.c:		if(screen->pid > 1)
button.c:			killpg(getpgrp(screen->pid), SIGKILL);
button.c:	if((reply->window == screen->title.tbar || reply->window ==
button.c:	 screen->Ttitle.tbar) && InTitle(screen, reply->window,
button.c:	if(screen->TekGIN) {
charproc.c:			if(!screen->instatus)
charproc.c:			if(screen->display->qlen > 0 ||
charproc.c:			 (ioctl(screen->display->fd, I_NREAD, &arg), arg) > 0)
charproc.c:			screen->cur_col = TabNext(term.tabs, screen->cur_col);
charproc.c:			if (screen->cur_col > screen->max_col)
charproc.c:				screen->cur_col = screen->max_col;
charproc.c:			screen->curgl = 0;
charproc.c:			screen->curgl = 1;
charproc.c:			if(!screen->instatus) {
charproc.c:			if(!screen->instatus) {
charproc.c:			if(!screen->instatus) {
charproc.c:				if(screen->instatus)
charproc.c:				if(screen->instatus)
charproc.c:				if(screen->instatus)
charproc.c:			if(!screen->instatus) {
charproc.c:			if(!screen->instatus) {
charproc.c:				unparseseq(&reply, screen->respond);
charproc.c:				TabClear(term.tabs, screen->cur_col);
charproc.c:				unparseseq(&reply, screen->respond);
charproc.c:				reply.a_param[0] = screen->cur_row+1;
charproc.c:				reply.a_param[1] = screen->cur_col+1;
charproc.c:				unparseseq(&reply, screen->respond);
charproc.c:			if(!screen->instatus) {
charproc.c:				   || bot > screen->max_row + 1
charproc.c:					bot = screen->max_row+1;
charproc.c:					if(screen->scroll_amt)
charproc.c:					screen->top_marg = top-1;
charproc.c:					screen->bot_marg = bot-1;
charproc.c:					 2 * screen->border + screen->scrollbar,
charproc.c:					 screen->statusheight + Titlebar(screen)
charproc.c:					 + 2 * screen->border);
charproc.c:				unparseseq(&reply, screen->respond);
charproc.c:				reply.a_param[1] = (screen->max_col + 1) *
charproc.c:				 FontWidth(screen) + 2 * screen->border +
charproc.c:				 screen->scrollbar;
charproc.c:				reply.a_param[2] = (screen->max_row + 1) *
charproc.c:				 FontHeight(screen) + screen->statusheight +
charproc.c:				 Titlebar(screen) + 2 * screen->border;
charproc.c:				unparseseq(&reply, screen->respond);
charproc.c:				reply.a_param[1] = screen->max_row + 1;
charproc.c:				reply.a_param[2] = screen->max_col + 1;
charproc.c:				unparseseq(&reply, screen->respond);
charproc.c:				unparseseq(&reply, screen->respond);
charproc.c:			if(screen->TekEmu)
charproc.c:			if(screen->cursor_state)
charproc.c:			for(row = screen->max_row ; row >= 0 ; row--) {
charproc.c:				bzero(screen->buf[2 * row + 1],
charproc.c:				 col = screen->max_col + 1);
charproc.c:				for(cp = screen->buf[2 * row] ; col > 0 ; col--)
charproc.c:			ScrnRefresh(screen, 0, 0, screen->max_row + 1,
charproc.c:			 screen->max_col + 1);
charproc.c:			screen->gsets[scstype] = c;
charproc.c:			CursorSave(&term, &screen->sc);
charproc.c:			CursorRestore(&term, &screen->sc);
charproc.c:			if(!screen->instatus)
charproc.c:			if(screen->display->qlen > 0 ||
charproc.c:			 (ioctl(screen->display->fd, I_NREAD, &arg), arg) > 0)
charproc.c:			if(!screen->instatus)
charproc.c:			if(screen->display->qlen > 0 ||
charproc.c:			 (ioctl(screen->display->fd, I_NREAD, &arg), arg) > 0)
charproc.c:			TabSet(term.tabs, screen->cur_col);
charproc.c:			if(!screen->instatus)
charproc.c:			screen->curss = 2;
charproc.c:			screen->curss = 3;
charproc.c:			screen->curgl = 2;
charproc.c:			screen->curgl = 3;
charproc.c:			screen->curgr = 3;
charproc.c:			screen->curgr = 2;
charproc.c:			screen->curgr = 1;
charproc.c:			if(screen->curss) {
charproc.c:				 screen->gsets[screen->curss], bptr, bptr + 1);
charproc.c:				screen->curss = 0;
charproc.c:				 screen->gsets[screen->curgl], bptr, cp);
charproc.c:			if(screen->logging)
charproc.c:			if((bcnt = read(screen->respond, bptr = buffer,
charproc.c:				if(screen->sb && screen->scrollinput &&
charproc.c:				 screen->topline < 0)
charproc.c:					ScrollToBottom(screen->sb);
charproc.c:				if(screen->icon_show && !screen->iconinput) {
charproc.c:					screen->iconinput = TRUE;
charproc.c:		if(screen->scroll_amt)
charproc.c:		if(screen->cursor_set && (screen->cursor_col != screen->cur_col
charproc.c:		 || screen->cursor_row != screen->cur_row)) {
charproc.c:			if(screen->cursor_state)
charproc.c:		} else if(screen->cursor_set != screen->cursor_state) {
charproc.c:			if(screen->cursor_set)
charproc.c:			 screen->timeout)) < 0){
charproc.c:				if(GetButtonState(screen->sb) & HILITED)
charproc.c:					 ButtonRegion(screen->sb));
charproc.c:				screen->timeout->tv_usec = STEPTIME;
charproc.c:		n = screen->max_col-screen->cur_col+1;
charproc.c:			if (screen->do_wrap && (flags&WRAPAROUND) &&
charproc.c:			 !screen->instatus) {
charproc.c:				screen->cur_col = 0;
charproc.c:				screen->do_wrap = 0;
charproc.c:				n = screen->max_col+1;
charproc.c:		next_col = screen->cur_col + n;
charproc.c:		 * the call to WriteText updates screen->cur_col.
charproc.c:		 * If screen->cur_col != next_col, we must have
charproc.c:		screen->do_wrap = (screen->cur_col < next_col);
charproc.c:   if(screen->instatus && screen->reversestatus)
charproc.c:   if(screen->cur_row - screen->topline <= screen->max_row ||
charproc.c:     screen->instatus) {
charproc.c:	if(screen->cur_row == screen->cursor_row && screen->cur_col <=
charproc.c:	 screen->cursor_col && screen->cursor_col <= screen->cur_col + len - 1)
charproc.c:		screen->cursor_state = OFF;
charproc.c:	if(screen->cursor_state)
charproc.c: 	fnt = ActiveIcon(screen) ? screen->fnt_icon
charproc.c:	      : (fgs & BOLD) ? screen->fnt_bold : screen->fnt_norm;
charproc.c:		if(screen->scroll_amt)
charproc.c:	cx = CursorX(screen, screen->cur_col);
charproc.c:	cy = CursorY(screen, screen->cur_row);
charproc.c:	if (screen->show || ActiveIcon(screen)) {
charproc.c:		 pix = screen->background, screen->foreground);
charproc.c:		 pix = screen->foreground, screen->background);
charproc.c:	    if((fgs & BOLD) && screen->enbolden)
charproc.c:			if(screen->c132) {
charproc.c:				 j != screen->max_col + 1) {
charproc.c:					 FontWidth(screen) * j + 2*screen->border
charproc.c:					 + screen->scrollbar,
charproc.c:					 FontHeight(screen) * (screen->max_row
charproc.c:					 + 1) + screen->statusheight +
charproc.c:					 Titlebar(screen) + 2 * screen->border);
charproc.c:				screen->jumpscroll = 0;
charproc.c:				if (screen->scroll_amt)
charproc.c:				screen->jumpscroll = 1;
charproc.c:			(*func)(&screen->send_mouse_pos, 1);
charproc.c:			if(func == bitset & !(screen->inhibit & I_TEK)) {
charproc.c:				if(screen->logging) {
charproc.c:					screen->logstart = Tbuffer;
charproc.c:				screen->TekEmu = TRUE;
charproc.c:			(*func)(&screen->c132, 1);
charproc.c:			(*func)(&screen->curses, 1);
charproc.c:			if(screen->sb)
charproc.c:				SetSaveState(screen->sb, (func == bitset));
charproc.c:			(*func)(&screen->marginbell, 1);
charproc.c:			if(!screen->marginbell)
charproc.c:				screen->bellarmed = -1;
charproc.c:			j = screen->reversestatus;
charproc.c:			(*func)(&screen->reversestatus, 1);
charproc.c:			if(j != screen->reversestatus)
charproc.c:				ScrnRefresh(screen, screen->max_row + 1, 0, 1,
charproc.c:				 screen->max_col + 1);
charproc.c:			j = screen->pagemode;
charproc.c:			(*func)(&screen->pagemode, 1);
charproc.c:			if(!j && screen->pagemode)
charproc.c:				screen->pagecnt = 0;
charproc.c:			screen->save_modes[0] = term->keyboard.flags &
charproc.c:			if(screen->c132)
charproc.c:				screen->save_modes[1] = term->flags &
charproc.c:			screen->save_modes[2] = term->flags & SMOOTHSCROLL;
charproc.c:			screen->save_modes[3] = term->flags & REVERSE_VIDEO;
charproc.c:			screen->save_modes[4] = term->flags & ORIGIN;
charproc.c:			screen->save_modes[5] = term->flags & WRAPAROUND;
charproc.c:			screen->save_modes[6] = term->flags & AUTOREPEAT;
charproc.c:			screen->save_modes[7] = screen->send_mouse_pos;
charproc.c:			screen->save_modes[8] = screen->c132;
charproc.c:			screen->save_modes[9] = screen->curses;
charproc.c:			screen->save_modes[10] = screen->scrollbar;
charproc.c:			if(screen->sb)
charproc.c:				screen->save_modes[11] =
charproc.c:				 GetSaveState(screen->sb);
charproc.c:			screen->save_modes[12] = screen->marginbell;
charproc.c:			screen->save_modes[13] = term->flags & REVERSEWRAP;
charproc.c:			screen->save_modes[14] = screen->logging;
charproc.c:			screen->save_modes[15] = screen->alternate;
charproc.c:			screen->save_modes[16] = screen->reversestatus;
charproc.c:			screen->save_modes[17] = screen->pagemode;
charproc.c:			screen->save_modes[18] = screen->pagecnt;
charproc.c:			term->keyboard.flags |= screen->save_modes[0] &
charproc.c:			if(screen->c132) {
charproc.c:				if((j = (screen->save_modes[1] & IN132COLUMNS)
charproc.c:				 ? 132 : 80) || j != screen->max_col + 1) {
charproc.c:					 FontWidth(screen) * j + 2*screen->border
charproc.c:					 + screen->scrollbar,
charproc.c:					 FontHeight(screen) * (screen->max_row
charproc.c:					 + 1) + screen->statusheight +
charproc.c:					 Titlebar(screen) + 2 * screen->border);
charproc.c:				term->flags |= screen->save_modes[1] &
charproc.c:			if (screen->save_modes[2] & SMOOTHSCROLL) {
charproc.c:				screen->jumpscroll = 0;
charproc.c:				if (screen->scroll_amt)
charproc.c:				screen->jumpscroll = 1;
charproc.c:			term->flags |= screen->save_modes[2] & SMOOTHSCROLL;
charproc.c:			if((screen->save_modes[3] ^ term->flags) &
charproc.c:				term->flags |= screen->save_modes[3] &
charproc.c:			term->flags |= screen->save_modes[4] & ORIGIN;
charproc.c:			term->flags |= screen->save_modes[5] & WRAPAROUND;
charproc.c:			if((screen->save_modes[6] ^ term->flags) & AUTOREPEAT) {
charproc.c:				term->flags |= screen->save_modes[6] &
charproc.c:			screen->send_mouse_pos = screen->save_modes[7];
charproc.c:			screen->c132 = screen->save_modes[8];
charproc.c:			screen->curses = screen->save_modes[9];
charproc.c:			if(screen->save_modes[10])
charproc.c:			if(screen->sb)
charproc.c:				SetSaveState(screen->sb,screen->save_modes[11]);
charproc.c:			if(!(screen->marginbell = screen->save_modes[12]))
charproc.c:				screen->bellarmed = -1;
charproc.c:			term->flags |= screen->save_modes[13] & REVERSEWRAP;
charproc.c:			if(screen->save_modes[14])
charproc.c:			if(screen->save_modes[15])
charproc.c:			if(screen->save_modes[16] != screen->reversestatus) {
charproc.c:				screen->reversestatus = 
charproc.c:				 screen->save_modes[16];
charproc.c:				ScrnRefresh(screen, screen->max_row + 1, 0, 1,
charproc.c:				 screen->max_col + 1);
charproc.c:			screen->pagemode = screen->save_modes[17];
charproc.c:			screen->pagecnt = screen->save_modes[18];
charproc.c:	if(screen->alternate)
charproc.c:	if(!screen->altbuf)
charproc.c:		screen->altbuf = Allocate(screen->max_row + 1, screen->max_col
charproc.c:	if(screen->sb) {
charproc.c:		alt_saving = GetSaveState(screen->sb);
charproc.c:		SetSaveState(screen->sb, FALSE);
charproc.c:	if(alt_pagemode = screen->pagemode)
charproc.c:		alt_pagecnt = screen->pagecnt;
charproc.c:	screen->pagemode = FALSE;
charproc.c:	screen->alternate = TRUE;
charproc.c:	if(!screen->alternate)
charproc.c:	screen->alternate = FALSE;
charproc.c:	if(screen->sb)
charproc.c:		SetSaveState(screen->sb, alt_saving);
charproc.c:	if(screen->pagemode = alt_pagemode)
charproc.c:		screen->pagecnt = alt_pagecnt;
charproc.c:	if(screen->cursor_state)
charproc.c:	rows = screen->max_row + 1;
charproc.c:	bcopy((char *)screen->buf, (char *)save, 2 * sizeof(char *) * rows);
charproc.c:	bcopy((char *)screen->altbuf, (char *)screen->buf, 2 * sizeof(char *) *
charproc.c:	bcopy((char *)save, (char *)screen->altbuf, 2 * sizeof(char *) * rows);
charproc.c:	if((top = -screen->topline) <= screen->max_row) {
charproc.c:		if(screen->scroll_amt)
charproc.c:		if(top == 0 && !screen->statusline)
charproc.c:			XTileSet(VWindow(screen), screen->border, top *
charproc.c:			 FontHeight(screen) + screen->border + Titlebar(screen),
charproc.c:			 Width(screen), (screen->max_row - top + 1) *
charproc.c:			 FontHeight(screen), screen->bgndtile);
charproc.c:	ScrnRefresh(screen, 0, 0, rows, screen->max_col + 1);
charproc.c:			screen->TekEmu = TRUE;
charproc.c:	screen->cursor_state = OFF;
charproc.c:	screen->cursor_set = ON;
charproc.c:	if(screen->icon_show) {
charproc.c:		if(screen->icon_show < 0) {
charproc.c:			screen->icon_show = TRUE;
charproc.c:			screen->mappedVwin = &screen->iconVwin;
charproc.c:			XMapWindow(screen->iconVwin.window);
charproc.c:	} else if(!screen->show) {
charproc.c:		screen->show = TRUE;
charproc.c:		screen->mappedVwin = &screen->fullVwin;
charproc.c:	if(screen->select)
charproc.c:	screen->cursor_set = OFF;
charproc.c:	screen->mappedVwin = &screen->fullVwin;
charproc.c:	screen->fnt_norm = screen->fnt_bold = screen->fnt_icon = NULL;
charproc.c:	screen->fnt_norm = fInfo->id;
charproc.c:	if (!f_b || !(screen->fnt_bold = XGetFont(f_b))) {
charproc.c:		screen->fnt_bold = screen->fnt_norm;
charproc.c:		screen->enbolden = TRUE;
charproc.c:	screen->fullVwin.f_width = fInfo->width;
charproc.c:	screen->fullVwin.f_height = fInfo->height;
charproc.c:	if (screen->active_icon) {
charproc.c:	    if (!screen->fnt_icon) {
charproc.c:		screen->fnt_icon = ifInfo->id;
charproc.c:	    	XQueryFont( screen->fnt_icon, &ifInfo );
charproc.c:	    screen->iconVwin.f_width = ifInfo->width;
charproc.c:	    screen->iconVwin.f_height = ifInfo->height;
charproc.c:	screen->curs = make_xterm(screen->mousecolor, screen->background,
charproc.c:	twindow.bdrwidth = screen->borderwidth;
charproc.c:	twindow.border = screen->graybordertile;
charproc.c:	twindow.background = screen->bgndtile;
charproc.c:	if((screen->minrows = (MINSCROLLBARHEIGHT - 2 * screen->border +
charproc.c:		screen->minrows = 0;
charproc.c:	i = 2 * screen->border + screen->scrollbar;
charproc.c:	j = 2 * screen->border + Titlebar(screen);
charproc.c:	if(screen->statusline)
charproc.c:		j += (screen->statusheight = fInfo->height + 2);
charproc.c:	if((screen->fullVwin.window = XCreateTerm ("Terminal Emulator", xterm_name,
charproc.c:	 geo_metry, def, &twindow, 12, screen->minrows, i, j, &width, &height,
charproc.c:		if(screen->timer) {
charproc.c:			screen->timer = 0;
charproc.c:			screen->select |= INWINDOW;
charproc.c:			screen->select &= ~INWINDOW;
charproc.c:	screen->fullVwin.fullwidth = twindow.width;
charproc.c:	screen->fullVwin.fullheight = twindow.height;
charproc.c:	screen->fullVwin.width = twindow.width - i;
charproc.c:	screen->fullVwin.height = twindow.height - j;
charproc.c:	screen->gsets[0] = 'B';			/* ASCII_G		*/
charproc.c:	screen->gsets[1] = 'B';
charproc.c:	screen->gsets[2] = 'B';			/* DEC supplemental.	*/
charproc.c:	screen->gsets[3] = 'B';
charproc.c:	screen->curgl = 0;			/* G0 => GL.		*/
charproc.c:	screen->curgr = 2;			/* G2 => GR.		*/
charproc.c:	screen->curss = 0;			/* No single shift.	*/
charproc.c:	if(screen->iconTwin.window) {
charproc.c:		XQueryWindow(screen->iconTwin.window, &wininfo);
charproc.c:		x = twindow.x + (twindow.width - screen->iconVwin.width) / 2;
charproc.c:		y = twindow.y + (twindow.height - screen->iconVwin.height) / 2;
charproc.c:	screen->iconVwin.window =
charproc.c:		XCreateWindow( RootWindow, x, y, 1, 1, screen->borderwidth,
charproc.c:			       screen->bordertile, screen->bgndtile );
charproc.c:	XSetIconWindow( screen->fullVwin.window, screen->iconVwin.window );
charproc.c:	XDefineCursor( screen->iconVwin.window, screen->arrow );
charproc.c:	XSelectInput( screen->iconVwin.window,
charproc.c:		      screen->active_icon 
charproc.c:	XDefineCursor( VWindow(screen), screen->curs );
charproc.c:	XStoreName (VWindow(screen), screen->winname);
charproc.c:	strcpy(iconname, screen->winname);
charproc.c:	XStoreName (screen->iconVwin.window, iconname);
charproc.c:	XSetResizeHint (VWindow(screen), 2 * screen->border + screen->scrollbar,
charproc.c:	 2 * screen->border + Titlebar(screen) + screen->statusheight,
charproc.c:	screen->cur_col = screen->cur_row = 0;
charproc.c:	screen->max_col = Width(screen)  / fInfo->width - 1;
charproc.c:	screen->top_marg = 0;
charproc.c:	screen->bot_marg = screen->max_row = Height(screen) / fInfo->height - 1;
charproc.c:	screen->sc.row = screen->sc.col = screen->sc.flags = NULL;
charproc.c:	screen->buf = screen->allbuf = (ScrnBuf) Allocate (screen->max_row + 2,
charproc.c:					  screen->max_col +1);
charproc.c:	screen->do_wrap = NULL;
charproc.c:	screen->scrolls = screen->incopy = 0;
charproc.c:	screen->box = VTbox;
charproc.c:	status_box[0].x = screen->border - 1;
charproc.c:	screen->savelines = save_lines;
charproc.c:	if(screen->scrollbar) {
charproc.c:		screen->scrollbar = 0;
charproc.c:		screen->sb->action = NONE;
charproc.c:	screen->nmarginbell = n_marginbell;
charproc.c:	ScrnRefresh(screen, 0, 0, screen->max_row + 1 + screen->statusline,
charproc.c:	 screen->max_col + 1);
charproc.c:	if (screen->icon_show && !screen->active_icon) return;
charproc.c:	if(!screen->instatus && screen->cur_row - screen->topline >
charproc.c:	 screen->max_row)
charproc.c:	c = screen->buf[y = 2 * (screen->cursor_row = screen->cur_row)]
charproc.c:	 [x = screen->cursor_col = screen->cur_col];
charproc.c:	flags = screen->buf[y + 1][x];
charproc.c:	if(screen->instatus)
charproc.c:	if(screen->select) {
charproc.c:			if(screen->cursorcolor != screen->foreground) {
charproc.c:				fg = screen->foreground;
charproc.c:				bg = screen->cursorcolor;
charproc.c:				fg = screen->background;
charproc.c:				bg = screen->foreground;
charproc.c:			fg = screen->background;
charproc.c:			bg = screen->cursorcolor;
charproc.c:			fg = screen->background;
charproc.c:			bg = screen->foreground;
charproc.c:			fg = screen->foreground;
charproc.c:			bg = screen->background;
charproc.c:	fnt = ActiveIcon(screen) ? screen->fnt_icon
charproc.c:	      : (flags & BOLD) ? screen->fnt_bold : screen->fnt_norm;
charproc.c:	XText(VWindow(screen), x = CursorX (screen, screen->cur_col),
charproc.c:	 y = CursorY(screen, screen->cur_row), &c, 1, fnt, fg, bg);
charproc.c:	if((flags & BOLD) && screen->enbolden)
charproc.c:	if(!screen->select && !ActiveIcon(screen)) {
charproc.c:		screen->box->x = x;
charproc.c:		screen->box->y = y;
charproc.c:		XDraw(VWindow(screen), screen->box, NBOX, 1, 1, fg, GXcopy,
charproc.c:	screen->cursor_state = ON;
charproc.c:	if (screen->icon_show && !screen->active_icon) return;
charproc.c:	if(!(instatus = screen->cursor_row > screen->max_row) &&
charproc.c:	 screen->cursor_row - screen->topline > screen->max_row)
charproc.c:	c = screen->buf[y = 2 * screen->cursor_row][x = screen->cursor_col];
charproc.c:	flags = screen->buf[y + 1][x];
charproc.c:		fg = screen->background;
charproc.c:		bg = screen->foreground;
charproc.c:		fg = screen->foreground;
charproc.c:		bg = screen->background;
charproc.c:	y = (instatus ? (screen->cursor_row * FontHeight(screen) + 1) :
charproc.c:	 ((screen->cursor_row - screen->topline) * FontHeight(screen))) +
charproc.c:	 Titlebar(screen) + screen->border;
charproc.c:	fnt = ActiveIcon(screen) ? screen->fnt_icon
charproc.c:	      : (flags & BOLD) ? screen->fnt_bold : screen->fnt_norm;
charproc.c:	XText(VWindow(screen), x = CursorX (screen, screen->cursor_col),
charproc.c:	if((flags & BOLD) && screen->enbolden)
charproc.c:	screen->cursor_state = OFF;
charproc.c:	XChangeBorder(VWindow(screen), screen->bordertile);
charproc.c:	XChangeBorder(VWindow(screen), screen->graybordertile);
charproc.c:	screen->top_marg = 0;
charproc.c:	screen->bot_marg = screen->max_row;
charproc.c:		screen->gsets[0] = 'B';
charproc.c:		screen->gsets[1] = 'B';
charproc.c:		screen->gsets[2] = 'B';
charproc.c:		screen->gsets[3] = 'B';
charproc.c:		screen->curgl = 0;
charproc.c:		screen->curgr = 2;
charproc.c:		screen->curss = 0;
charproc.c:		screen->cursor_state = OFF;
charproc.c:		if(screen->c132 && (term.flags & IN132COLUMNS)) {
charproc.c:			 2 * screen->border + screen->scrollbar,
charproc.c:			 FontHeight(screen) * (screen->max_row + 1) +
charproc.c:			 screen->statusheight + Titlebar(screen) +
charproc.c:			 2 * screen->border);
charproc.c:	if(col > screen->max_col)
charproc.c:		col = screen->max_col;
charproc.c:	if(!screen->instatus) {
charproc.c:		if(!screen->statusline)
charproc.c:		CursorSave(&term, &screen->statussc);
charproc.c:		screen->instatus = TRUE;
charproc.c:		screen->cur_row = screen->max_row + 1;
charproc.c:	screen->cur_col = col;
charproc.c:	if(!screen->instatus)
charproc.c:	screen->instatus = FALSE;
charproc.c:	CursorRestore(&term, &screen->statussc);
charproc.c:	register int border = 2 * screen->border;
charproc.c:	if(screen->statusline)
charproc.c:	screen->statusline = 1;
charproc.c:	screen->statusheight = FontHeight(screen) + 2;
charproc.c:	XSetResizeHint(VWindow(screen), border + screen->scrollbar, border +
charproc.c:	 Titlebar(screen) + screen->statusheight, FontWidth(screen),
charproc.c:	XChangeWindow (VWindow(screen), FontWidth(screen) * (screen->max_col + 1)
charproc.c:	 + border + screen->scrollbar, FontHeight(screen) *
charproc.c:	 (screen->max_row + 1) + screen->statusheight + Titlebar(screen) +
charproc.c:	register int border = 2 * screen->border;
charproc.c:	if(!screen->statusline)
charproc.c:	if(screen->instatus)
charproc.c:	screen->statusline = 0;
charproc.c:	screen->statusheight = 0;
charproc.c:	bzero(screen->buf[i = 2 * (screen->max_row + 1)], j = screen->max_col +
charproc.c:	bzero(screen->buf[i + 1], j);
charproc.c:	XSetResizeHint(VWindow(screen), border + screen->scrollbar, border +
charproc.c:	 screen->scrollbar, FontHeight(screen) * (screen->max_row + 1) +
charproc.c:	if(!screen->statusline)
charproc.c:	bzero(screen->buf[i = 2 * (screen->max_row + 1)], j = screen->max_col +
charproc.c:	bzero(screen->buf[i + 1], j);
charproc.c:	XPixSet(VWindow(screen), screen->border - 1, (screen->max_row + 1) *
charproc.c:	 FontHeight(screen) + screen->border + Titlebar(screen), j *
charproc.c:	 FontWidth(screen) + 2, screen->statusheight, screen->reversestatus ?
charproc.c:	 screen->foreground : screen->background);
charproc.c:	if(!screen->reversestatus)
charproc.c:	status_box[0].y = (screen->max_row + 1) * FontHeight(screen) +
charproc.c:	 screen->border + Titlebar(screen);
charproc.c:	status_box[3].x = -(status_box[1].x = (screen->max_col + 1) *
charproc.c:	XDraw(VWindow(screen), status_box, NBOX, 1, 1, screen->foreground,
charproc.c:	register int border = 2 * screen->border;
charproc.c:	if(!screen->title.tbar)
charproc.c:		XSetResizeHint(VWindow(screen), border + screen->scrollbar,
charproc.c:		 border + Titlebar(screen) + screen->statusheight,
charproc.c:		 (screen->max_col + 1) + border + screen->scrollbar,
charproc.c:		 FontHeight(screen) * (screen->max_row + 1) + screen->statusheight
charproc.c:	if(screen->select && !screen->TekEmu)
charproc.c:	XMapWindow(screen->title.tbar);
charproc.c:	register int border = 2 * screen->border;
charproc.c:	XUnmapWindow(screen->title.tbar);
charproc.c:	XSetResizeHint(VWindow(screen), border + screen->scrollbar, border +
charproc.c:	 screen->statusheight, FontWidth(screen), FontHeight(screen));
charproc.c:	XChangeWindow (VWindow(screen), FontWidth(screen) * (screen->max_col + 1)
charproc.c:	 + border + screen->scrollbar, FontHeight(screen) *
charproc.c:	 (screen->max_row + 1) + screen->statusheight + border);
charproc.c:	if(screen->title.hilited)
charproc.c:	XMapWindow(screen->title.left);
charproc.c:	XMapWindow(screen->title.right);
charproc.c:	screen->title.hilited = TRUE;
charproc.c:	if(!screen->title.hilited)
charproc.c:	XUnmapWindow(screen->title.left);
charproc.c:	XUnmapWindow(screen->title.right);
charproc.c:	screen->title.hilited = FALSE;
charproc.c:	if((screen->title.width = i = screen->title.fullwidth) >
charproc.c:	 (j = width - 2 * (MINHILITE + screen->title_n_size + 1)))
charproc.c:		screen->title.width = (i = j) + screen->title_n_size;
charproc.c:	j = width - i - 2 * (screen->title_n_size + 1);
charproc.c:	screen->title.x = i + 1 + screen->title_n_size;
charproc.c:	XChangeWindow(screen->title.tbar, width, screen->titleheight - 1);
charproc.c:	XChangeWindow(screen->title.left, i, screen->titlefont->height);
charproc.c:	XConfigureWindow(screen->title.right, width - j - 1, TITLEPAD, j,
charproc.c:	 screen->titlefont->height);
charproc.c:	if(rep && (rep->x > (screen->title.x + screen->title.width) ||
charproc.c:	 (rep->x + rep->width) < screen->title.x ||
charproc.c:	 rep->y > (screen->title.y + screen->titlefont->height) ||
charproc.c:	 (rep->y + rep->height) < screen->title.y))
charproc.c:	XText(screen->title.tbar, screen->title.x, screen->title.y,
charproc.c:	 screen->winname, screen->winnamelen, screen->titlefont->id,
charproc.c:	 screen->foreground, screen->background);
charproc.c:	if((screen->title.tbar = XCreateWindow(VWindow(screen), -1, -1,
charproc.c:	 w = FullWidth(screen), screen->titleheight - 1, 1, screen->bordertile,
charproc.c:	 screen->bgndtile)) == NULL)
charproc.c:	XSelectInput(screen->title.tbar, ButtonPressed | ButtonReleased |
charproc.c:	XDefineCursor(screen->title.tbar, screen->arrow);
charproc.c:	if(!screen->hilitetile && (screen->hilitetile =
charproc.c:	 make_hilite(screen->foreground, screen->background)) == NULL)
charproc.c:	screen->title.fullwidth = XQueryWidth(screen->winname,
charproc.c:	 screen->titlefont->id);
charproc.c:	if((screen->title.width = i = screen->title.fullwidth) >
charproc.c:	 (j = w - 2 * (MINHILITE + screen->title_n_size + 1)))
charproc.c:		screen->title.width = (i = j) + screen->title_n_size;
charproc.c:	j = w - i - 2 * (screen->title_n_size + 1);
charproc.c:	screen->title.x = i + 1 + screen->title_n_size;
charproc.c:	screen->title.y = TITLEPAD;
charproc.c:	hilite[0].height = hilite[1].height = screen->titlefont->height;
charproc.c:	hilite[0].background = hilite[1].background = screen->hilitetile;
charproc.c:	if(XCreateWindows(screen->title.tbar, hilite, 2) != 2)
charproc.c:	screen->title.left = hilite[0].self;
charproc.c:	screen->title.right = hilite[1].self;
charproc.c:		if(tscrollbar = (screen->scrollbar > 0))
charproc.c:		if(tpagemode = screen->pagemode)
charproc.c:		if(tstatusline = screen->statusline)
charproc.c:		if(trevstatus = screen->reversestatus)
charproc.c:		if(t132 = screen->c132)
charproc.c:		if(tcurses = screen->curses)
charproc.c:		if(tmarginbell = screen->marginbell)
charproc.c:		if(tshow = screen->Tshow)
charproc.c:		if(taltern = screen->alternate) {
charproc.c:		if(screen->inhibit & I_TEK) {
charproc.c:	if(tscrollbar != (screen->scrollbar > 0))
charproc.c:		 (screen->scrollbar > 0)));
charproc.c:	if(tpagemode != screen->pagemode)
charproc.c:		 screen->pagemode));
charproc.c:	if(tstatusline != screen->statusline)
charproc.c:		 screen->statusline));
charproc.c:	if(trevstatus != screen->reversestatus)
charproc.c:		 screen->reversestatus));
charproc.c:	if(t132 != screen->c132)
charproc.c:		SetItemCheck(*menu, MMENU_C132, (t132 = screen->c132));
charproc.c:	if(tcurses != screen->curses)
charproc.c:		SetItemCheck(*menu, MMENU_CURSES, (tcurses = screen->curses));
charproc.c:	if(tmarginbell != screen->marginbell)
charproc.c:		screen->marginbell));
charproc.c:	if(tshow != screen->Tshow) {
charproc.c:		SetItemCheck(*menu, MMENU_TEKWIN, (tshow = screen->Tshow));
charproc.c:	if(taltern != screen->alternate) {
charproc.c:		 screen->alternate));
charproc.c:			screen->jumpscroll = FALSE;
charproc.c:			if (screen->scroll_amt)
charproc.c:			screen->jumpscroll = TRUE;
charproc.c:		if(screen->scrollbar)
charproc.c:		if(screen->pagemode = !screen->pagemode)
charproc.c:			screen->pagecnt = 0;
charproc.c:		if(screen->statusline)
charproc.c:		screen->reversestatus = !screen->reversestatus;
charproc.c:		ScrnRefresh(screen, screen->max_row + 1, 0, 1, screen->max_col
charproc.c:		screen->c132 = !screen->c132;
charproc.c:		if(!(screen->marginbell = !screen->marginbell))
charproc.c:			screen->bellarmed = -1;
charproc.c:		screen->curses = !screen->curses;
charproc.c:		screen->show = FALSE;
charproc.c:		if(!screen->TekEmu) {
charproc.c:			if(screen->logging) {
charproc.c:				screen->logstart = Tbuffer;
charproc.c:			screen->TekEmu = TRUE;
charproc.c:			if(screen->pagemode) {
charproc.c:				Scroll(screen, screen->pagecnt);
charproc.c:				screen->pagecnt = 0;
charproc.c:				ioctl(screen->respond, TCXONC, 3);
charproc.c:		if(screen->Tshow = !screen->Tshow) {
charproc.c:				screen->Tshow = TRUE;
charproc.c:			screen->Tshow = FALSE;
charproc.c:			if(screen->TekEmu) {
charproc.c:				if(screen->logging) {
charproc.c:					screen->logstart = buffer;
cursor.c:	screen->cur_col = (col <= screen->max_col ? col : screen->max_col);
cursor.c:	if(!screen->instatus) {
cursor.c:		maxr = screen->max_row;
cursor.c:			row += screen->top_marg;
cursor.c:			maxr = screen->bot_marg;
cursor.c:		screen->cur_row = (row <= maxr ? row : maxr);
cursor.c:	screen->do_wrap = 0;
cursor.c:	 (REVERSEWRAP | WRAPAROUND)) && screen->do_wrap)
cursor.c:	if ((screen->cur_col -= n) < 0) {
cursor.c:			if((i = (j = screen->max_col + 1) * screen->cur_row +
cursor.c:			 screen->cur_col) < 0) {
cursor.c:				k = j * (screen->max_row + 1);
cursor.c:			screen->cur_row = i / j;
cursor.c:			screen->cur_col = i % j;
cursor.c:			screen->cur_col = 0;
cursor.c:	screen->do_wrap = 0;
cursor.c:	screen->cur_col += n;
cursor.c:	if (screen->cur_col > screen->max_col)
cursor.c:		screen->cur_col = screen->max_col;
cursor.c:	screen->do_wrap = 0;
cursor.c:	max = (screen->cur_row > screen->bot_marg ?
cursor.c:		screen->max_row : screen->bot_marg);
cursor.c:	screen->cur_row += n;
cursor.c:	if (screen->cur_row > max)
cursor.c:		screen->cur_row = max;
cursor.c:	screen->do_wrap = 0;
cursor.c:	min = (screen->cur_row < screen->top_marg ?
cursor.c:		0 : screen->top_marg);
cursor.c:	screen->cur_row -= n;
cursor.c:	if (screen->cur_row < min)
cursor.c:		screen->cur_row = min;
cursor.c:	screen->do_wrap = 0;
cursor.c:	if (screen->cur_row > screen->bot_marg
cursor.c:	 || screen->cur_row + amount <= screen->bot_marg) {
cursor.c:		if(screen->pagemode)
cursor.c:			screen->pagecnt += amount;
cursor.c:	CursorDown(screen, j = screen->bot_marg - screen->cur_row);
cursor.c:	if((lines = screen->bot_marg - screen->top_marg - screen->pageoverlap)
cursor.c:	if(!screen->pagemode || (amount + screen->pagecnt) <= lines) {
cursor.c:		if(screen->pagemode)
cursor.c:			screen->pagecnt += amount;
cursor.c:	ioctl(screen->respond, TCXONC, 2);
cursor.c:	if(screen->cursor_state)
cursor.c:	if((j = lines - screen->pagecnt) > 0) {
cursor.c:		if(screen->scroll_amt)
cursor.c:						screen->pagecnt = (lines - 1);
cursor.c:						screen->pagecnt = 0;
cursor.c:						ioctl(screen->respond, TCXONC, 2);
cursor.c:						screen->pagecnt = 0;
cursor.c:					screen->pagecnt = 0;
cursor.c:				screen->pagecnt = amount;
cursor.c:				if(!screen->pagemode) {
cursor.c:					ioctl(screen->respond, TCXONC, 3);
cursor.c:		j = lines - screen->pagecnt;
cursor.c:		screen->pagecnt += j;
cursor.c:	ioctl(screen->respond, TCXONC, 3);
cursor.c:	if (screen->cur_row < screen->top_marg
cursor.c:	 || screen->cur_row-amount >= screen->top_marg) {
cursor.c:	RevScroll(screen, amount - (screen->cur_row - screen->top_marg));
cursor.c:	CursorUp(screen, screen->cur_row - screen->top_marg);
cursor.c:	screen->cur_col = 0;
cursor.c:	screen->do_wrap = 0;
cursor.c:	sc->row = screen->cur_row;
cursor.c:	sc->col = screen->cur_col;
cursor.c:	sc->curgl = screen->curgl;
cursor.c:	sc->curgr = screen->curgr;
cursor.c:	bcopy(screen->gsets, sc->gsets, sizeof(screen->gsets));
cursor.c:	bcopy(sc->gsets, screen->gsets, sizeof(screen->gsets));
cursor.c:	screen->curgl = sc->curgl;
cursor.c:	screen->curgr = sc->curgr;
input.c:	int	pty	= screen->respond;
input.c:		if(screen->TekGIN) {
input.c:	if(key && !screen->TekEmu) {
input.c:		if(screen->scrollkey && screen->topline != 0)
input.c:			ScrollToBottom(screen->sb);
input.c:		if(screen->marginbell) {
input.c:			col = screen->max_col - screen->nmarginbell;
input.c:			if(screen->bellarmed >= 0) {
input.c:				if(screen->bellarmed == screen->cur_row) {
input.c:					if(screen->cur_col >= col) {
input.c:						if(screen->cur_col == col)
input.c:						screen->bellarmed = -1;
input.c:					screen->bellarmed = screen->cur_col <
input.c:					 col ? screen->cur_row : -1;
input.c:			} else if(screen->cur_col < col)
input.c:				screen->bellarmed = screen->cur_row;
main.c:	screen->border = DEFBORDER;
main.c:	screen->borderwidth = DEFBORDERWIDTH;
main.c:	screen->reversestatus = TRUE;
main.c:	screen->mappedVwin = &screen->fullVwin;
main.c:	screen->mappedTwin = &screen->fullTwin;
main.c:	screen->active_icon = DEFACTIVEICON;
main.c:	screen->scrollinput = DEFSCROLLINPUT;
main.c:	screen->fullVwin.titlebar = DEFTITLEBAR;
main.c:				screen->active_icon = FALSE;
main.c:				screen->autoraise = TRUE;
main.c:			screen->borderwidth = atoi (strind);
main.c:				screen->c132 = TRUE;
main.c:				screen->curses = TRUE;
main.c:				screen->deiconwarp = TRUE;
main.c:				screen->icon_show = -1;
main.c:			screen->border = atoi (strind);
main.c:				screen->jumpscroll = TRUE;
main.c:			if(screen->logfile = malloc(strlen(strind) + 1))
main.c:				strcpy(screen->logfile, strind);
main.c:				screen->marginbell = TRUE;
main.c:			if((screen->pageoverlap = atoi (strind) - 1) < 0)
main.c:				screen->pageoverlap = -1;
main.c:				screen->pagemode = TRUE;
main.c:				screen->scrollbar = SCROLLBARWIDTH;
main.c:				screen->scrollinput = FALSE;
main.c:				screen->scrollkey = TRUE;
main.c:				screen->statusline = TRUE;
main.c:			screen->reversestatus = (strcmp (strind, "on") != 0);
main.c:				screen->textundericon = TRUE;
main.c:			    screen->fullVwin.titlebar = FALSE;
main.c:				screen->visualbell = TRUE;
main.c:		screen->c132 = i;
main.c:		screen->autoraise = i;
main.c:		    screen->border = atoi (*++argv);
main.c:		    screen->border = DEFBORDER;
main.c:	        screen->active_icon = !i;
main.c:		    screen->borderwidth = atoi (*++argv);
main.c:		    screen->borderwidth = DEFBORDERWIDTH;
main.c:		screen->curses = i;
main.c:		screen->deiconwarp = i;
main.c:		screen->icon_show = i ? -1 : 0;
main.c:		if(screen->jumpscroll = i)
main.c:		if(screen->logfile)
main.c:			Free(screen->logfile);
main.c:		    if(screen->logfile = malloc(strlen(*++argv) + 1))
main.c:			    strcpy(screen->logfile, *argv);
main.c:		    screen->logfile = NULL;
main.c:		screen->marginbell = i;
main.c:		    if((screen->pageoverlap = atoi (*++argv) - 1) < 0)
main.c:			screen->pageoverlap = -1;
main.c:		    screen->pageoverlap = 0;
main.c:		screen->pagemode = i;
main.c:		screen->multiscroll = i;
main.c:		screen->scrollbar = i ? SCROLLBARWIDTH : 0;
main.c:		screen->scrollinput = i ? FALSE : DEFSCROLLINPUT;
main.c:		screen->scrollkey = i;
main.c:		screen->reversestatus = !i;
main.c:		screen->statusline = i;
main.c:		screen->TekEmu = i;
main.c:		screen->fullVwin.titlebar = i ? FALSE : DEFTITLEBAR;
main.c:		screen->textundericon = i;
main.c:		screen->visualbell = i;
main.c:		screen->TekEmu = FALSE;
main.c:	Xsocket = screen->display->fd;
main.c:	pty = screen->respond;
main.c:	    write(pty, screen->TekEmu ? (char *)&TWindow(screen) :
main.c:	screen->inhibit = inhibit;
main.c:		if(screen->TekEmu)
main.c:	    if (screen->display = XOpenDisplay(display))
main.c:	    if(!(screen->bordertile = XMakeTile(cdef.pixel)))
main.c:	    screen->bordertile = B_Pixmap;
main.c:	screen->graybordertile = make_gray();
main.c:	screen->foreground = B_Pixel;
main.c:	screen->background = W_Pixel;
main.c:	screen->cursorcolor = B_Pixel;
main.c:	screen->mousecolor = B_Pixel;
main.c:			screen->foreground = cdef.pixel;
main.c:			screen->color |= C_FOREGROUND;
main.c:			screen->background = cdef.pixel;
main.c:			screen->color |= C_BACKGROUND;
main.c:			screen->cursorcolor = cdef.pixel;
main.c:			screen->color |= C_CURSOR;
main.c:			screen->cursorcolor = screen->foreground;
main.c:	    screen->mousecolor = cdef.pixel;
main.c:	    screen->color |= C_MOUSE;
main.c:	    screen->mousecolor = screen->cursorcolor;
main.c:	if(screen->color & C_BACKGROUND) {
main.c:	    if(!(screen->bgndtile = XMakeTile(screen->background)))
main.c:		screen->bgndtile = W_Pixmap;
main.c:	screen->arrow = make_arrow(screen->mousecolor, screen->background,
main.c:	if((screen->titlefont = XOpenFont(f_t)) == NULL) {
main.c:	screen->title_n_size= XQueryWidth("m", screen->titlefont->id);
main.c:	screen->titleheight = screen->titlefont->height + 2 * TITLEPAD + 1;
main.c:	if(screen->fullVwin.titlebar)
main.c:		screen->fullVwin.titlebar =
main.c:		    screen->fullTwin.titlebar = screen->titleheight;
main.c:	int Xsocket = screen->display->fd;
main.c:	screen->uid = getuid();
main.c:	screen->gid = getgid();
main.c:	if(!(screen->TekEmu ? TekInit() : VTInit()))
main.c:	if(screen->TekEmu) {
main.c:		envnew = (screen->max_col == 79 && screen->max_row ==
main.c:		screen->respond = loginpty;
main.c:		screen->respond = am_slave;
main.c:		setgid (screen->gid);
main.c:		setuid (screen->uid);
main.c:		get_pty (&screen->respond, &tty);
main.c:		if (screen->respond != Xsocket + 1) {
main.c:			dup2 (screen->respond, Xsocket + 1);
main.c:			close (screen->respond);
main.c:			screen->respond = Xsocket + 1;
main.c:		chown (ttydev, screen->uid, screen->gid);
main.c:		if((pw = getpwuid(screen->uid)) &&
main.c:	if(screen->TekEmu) {
main.c:		ts.ts_lines = screen->max_row + 1;
main.c:		ts.ts_cols = screen->max_col + 1;
main.c:	ioctl (screen->respond, TIOCSSIZE, &ts);
main.c:	if(screen->TekEmu) {
main.c:		ws.ws_row = screen->max_row + 1;
main.c:		ws.ws_col = screen->max_col + 1;
main.c:	ioctl (screen->respond, TIOCSWINSZ, &ws);
main.c:	    if ((screen->pid = fork ()) == -1)
main.c:	    if (screen->pid == 0) {
main.c:		if (LocalConnect(screen->respond, tty) < 0) {
main.c:		close (screen->respond);
main.c:		sprintf(buf, "%d", screen->TekEmu ? (int)TWindow(screen) :
main.c:			Setenv ("DISPLAY=", screen->display->displayname);
main.c:		setgid (screen->gid);
main.c:		setuid (screen->uid);
main.c:		 ((pw == NULL && (pw = getpwuid(screen->uid)) == NULL) ||
main.c:		 ((pw = getpwuid(screen->uid)) == NULL ||
main.c:	if(screen->logging)
main.c:	sprintf (newtc, "%d", li_first ? screen->max_row + 1 :
main.c:	 screen->max_col + 1);
main.c:	sprintf (newtc, "%d", li_first ? screen->max_col + 1 :
main.c:	 screen->max_row + 1);
misc.c:	if(screen->scroll_amt)
misc.c:		if(screen->sb && window == screen->sb->bar) {
misc.c:			 screen->sb->button) {
misc.c:				screen->sb->buttonstate = -1;
misc.c:				DrawButton(screen->sb);
misc.c:			 screen->sb->save) {
misc.c:				screen->sb->savestate = -1;
misc.c:				DrawSave(screen->sb);
misc.c:		if (screen->active_icon) {
misc.c:		    if (window == screen->iconVwin.window) {
misc.c:		        if (!screen->icon_show) {
misc.c:			    screen->mappedVwin = &screen->iconVwin;
misc.c:			    screen->icon_show = TRUE;
misc.c:			    screen->show = FALSE;
misc.c:			    screen->timer = 0;
misc.c:			    screen->holdoff = FALSE;
misc.c:			    if(screen->fullTwin.window)
misc.c:				moveiconwindow( screen->fullTwin.window,
misc.c:						screen->fullVwin.window );
misc.c:			if (screen->TekEmu)
misc.c:			screen->iconinput = FALSE;
misc.c:		    } else if (window == screen->iconTwin.window) {
misc.c:			if (!screen->icon_show) {
misc.c:			    screen->mappedTwin = &screen->iconTwin;
misc.c:			    screen->icon_show = TRUE;
misc.c:			    screen->Tshow = FALSE;
misc.c:			    screen->timer = 0;
misc.c:			    screen->holdoff = FALSE;
misc.c:			    if (screen->fullVwin.window)
misc.c:				moveiconwindow( screen->fullVwin.window,
misc.c:						screen->fullTwin.window );
misc.c:			if (!screen->TekEmu)
misc.c:			screen->iconinput = FALSE;
misc.c:		} else if (window == screen->iconVwin.window ||
misc.c:			   window == screen->iconTwin.window) {
misc.c:				 screen->iconVwin.window ? "icon" : "Ticon");
misc.c:		if(Titlebar(screen) || screen->icon_show) {
misc.c:			if(window == screen->title.tbar) {
misc.c:			} else if(window == screen->Ttitle.tbar) {
misc.c:		if(window == screen->fullVwin.window) {
misc.c:			if(!screen->show) {
misc.c:				screen->mappedVwin = &screen->fullVwin;
misc.c:				if(screen->Ticonunmap) {
misc.c:					screen->Ticonunmap = FALSE;
misc.c:					XMapWindow( screen->fullTwin.window );
misc.c:					screen->Tshow = TRUE;
misc.c:					if(!screen->TekEmu) {
misc.c:					    screen->holdoff = TRUE;
misc.c:					screen->timer = 0;
misc.c:					screen->holdoff = FALSE;
misc.c:				screen->show = TRUE;
misc.c:				if(screen->icon_show && screen->deiconwarp)
misc.c:				screen->icon_show = FALSE;
misc.c:				screen->iconinput = FALSE;
misc.c:		} else if(window == screen->fullTwin.window) {
misc.c:			if(!screen->Tshow) {
misc.c:				screen->mappedTwin = &screen->fullTwin;
misc.c:				if(screen->iconunmap) {
misc.c:					screen->iconunmap = FALSE;
misc.c:					XMapWindow( screen->fullVwin.window );
misc.c:					screen->show = TRUE;
misc.c:					if(screen->TekEmu) {
misc.c:					    screen->holdoff = TRUE;
misc.c:					screen->timer = 0;
misc.c:					screen->holdoff = FALSE;
misc.c:				screen->Tshow = TRUE;
misc.c:				if(screen->icon_show && screen->deiconwarp)
misc.c:				screen->icon_show = FALSE;
misc.c:				screen->iconinput = FALSE;
misc.c:		    screen->incopy <= 0) {
misc.c:			screen->incopy = 1;
misc.c:			if (screen->scrolls > 0)
misc.c:				screen->scrolls--;
misc.c:			screen->cursor_state = OFF;
misc.c:		if (screen->incopy <= 0 && screen->scrolls > 0)
misc.c:			screen->scrolls--;
misc.c:		if (screen->scrolls)
misc.c:			screen->incopy = -1;
misc.c:			screen->incopy = 0;
misc.c:		if (screen->incopy)
misc.c:		if(window == screen->iconVwin.window) {
misc.c:			if(screen->Ticonunmap && !screen->TekEmu) {
misc.c:				screen->Ticonunmap = FALSE;
misc.c:				screen->Tshow = TRUE;
misc.c:				screen->holdoff = TRUE;
misc.c:			XMapWindow(screen->fullVwin.window);
misc.c:		} else if(window == screen->iconTwin.window) {
misc.c:			if(screen->iconunmap && screen->TekEmu) {
misc.c:				screen->iconunmap = FALSE;
misc.c:				screen->show = TRUE;
misc.c:				screen->holdoff = TRUE;
misc.c:			XMapWindow(screen->fullTwin.window);
misc.c:		HandleButtons(&term, rep, screen->respond);
misc.c:		if (window == screen->fullVwin.window) {
misc.c:			if (screen->fullVwin.titlebar)
misc.c:			screen->show = FALSE;
misc.c:			if(screen->Tshow) {
misc.c:				screen->Ticonunmap = TRUE;
misc.c:				screen->Tshow = FALSE;
misc.c:				XUnmapWindow( screen->fullTwin.window );
misc.c:				SyncUnmap( screen->fullTwin.window,
misc.c:		} else if(window == screen->fullTwin.window) {
misc.c:			if (screen->fullTwin.titlebar)
misc.c:			screen->Tshow = FALSE;
misc.c:			if(screen->show) {
misc.c:				screen->iconunmap = TRUE;
misc.c:				screen->show = FALSE;
misc.c:				XUnmapWindow( screen->fullVwin.window );
misc.c:				SyncUnmap( screen->fullVwin.window,
misc.c:		screen->timer = 0;
misc.c:		if(screen->sb) {
misc.c:			if(window == screen->sb->button) {
misc.c:				if((i = GetButtonState(screen->sb)) !=
misc.c:					SetButtonState(screen->sb, i | HILITED);
misc.c:			} else if(window == screen->sb->bar)
misc.c:			screen->autowindow = window;
misc.c:		if(screen->sb) {
misc.c:			if(window == screen->sb->button) {
misc.c:				if((i = GetButtonState(screen->sb)) !=
misc.c:					SetButtonState(screen->sb, i& ~HILITED);
misc.c:			} else if(window == screen->sb->bar)
misc.c:	if(screen->TekEmu) {
misc.c:		if(screen->cellsused) {
misc.c:			screen->colorcells[2].pixel =
misc.c:			 screen->Tcursorcolor;
misc.c:			XStoreColor(&screen->colorcells[2]);
misc.c:		screen->select |= flag;
misc.c:		if(screen->cursor_state &&
misc.c:		   (screen->cursor_col != screen->cur_col ||
misc.c:		    screen->cursor_row != screen->cur_row))
misc.c:		screen->select |= flag;
misc.c:		if(screen->cursor_state)
misc.c:	screen->select &= ~flag;
misc.c:	if(!screen->select) {
misc.c:		if(screen->TekEmu) {
misc.c:			if(screen->cellsused) {
misc.c:				screen->colorcells[i].pixel =
misc.c:				 screen->Tcursorcolor;
misc.c:				 &screen->colorcells[i]);
misc.c:			if(screen->cursor_state &&
misc.c:			 (screen->cursor_col != screen->cur_col ||
misc.c:			 screen->cursor_row != screen->cur_row))
misc.c:			screen->select = 0;
misc.c:			if(screen->cursor_state)
misc.c:		       && (!screen->icon_show
misc.c:			   || (screen->active_icon && term.flags & ICONINPUT)))
misc.c:	if(screen->TekEmu)
misc.c:	if (!screen->autoraise && !screen->holdoff) {
misc.c:	screen->timer = type;
misc.c:	if(!screen->holdoff)
misc.c:	if(screen->timer == 0 || screen->holdoff) {	/* extraneous alarm */
misc.c:	if(screen->timer == EnterWindow) {
misc.c:			 screen->autoraise ? (screen->autowindow ==
misc.c:		if(screen->autoraise)
misc.c:			XRaiseWindow(screen->autowindow);
misc.c:	screen->timer = 0;
misc.c:	if(screen->visualbell) {
misc.c:		if(screen->TekEmu) {
misc.c:			if(screen->icon_show && !screen->active_icon) {
misc.c:				XPixSet(screen->iconTwin.window, 0, 0,
misc.c:				 screen->iconTwin.width, screen->iconTwin.height,
misc.c:				 screen->foreground);
misc.c:				XClear(screen->iconTwin.window);
misc.c:				RefreshIcon(screen, screen->iconTwin.window);
misc.c:				 screen->foreground, (Bitmap)0, GXinvert,
misc.c:				 screen->xorplane);
misc.c:				 screen->foreground, (Bitmap)0, GXinvert,
misc.c:				 screen->xorplane);
misc.c:			if(screen->icon_show && !screen->active_icon) {
misc.c:				XPixSet(screen->iconVwin.window, 0, 0,
misc.c:				 screen->iconVwin.width, screen->iconVwin.height,
misc.c:				 screen->foreground);
misc.c:				XClear(screen->iconVwin.window);
misc.c:				RefreshIcon(screen, screen->iconVwin.window);
misc.c:				 FullHeight(screen), screen->foreground);
misc.c:				ScrnRefresh(screen, 0, 0, screen->max_row + 1 +
misc.c:				 screen->statusline, screen->max_col + 1);
misc.c:	if(VWindow(screen) && screen->show) {
misc.c:		if(screen->scrollbar) {
misc.c:			XClear(screen->sb->bar);
misc.c:			XClear(screen->sb->region);
misc.c:			screen->sb->buttonstate = -1;
misc.c:			DrawButton(screen->sb);
misc.c:			screen->sb->savestate = -1;
misc.c:			DrawSave(screen->sb);
misc.c:			XClear(screen->title.tbar);
misc.c:			XClear(screen->title.left);
misc.c:			XClear(screen->title.right);
misc.c:	if(TWindow(screen) && screen->Tshow) {
misc.c:			XClear(screen->Ttitle.tbar);
misc.c:			XClear(screen->Ttitle.left);
misc.c:			XClear(screen->Ttitle.right);
misc.c:		screen->iconbitmap.bits = icon_bits;
misc.c:		screen->Ticonbitmap.bits = tek_icon_bits;
misc.c:		screen->bitmapwidth = screen->iconbitmap.width =
misc.c:		 screen->Ticonbitmap.width = icon_width;
misc.c:		screen->bitmapheight = screen->iconbitmap.height =
misc.c:		 screen->Ticonbitmap.height = icon_height;
misc.c:		screen->bitmapwidth = screen->bitmapheight = 0;
misc.c:			if((w = XReadBitmapFile(bm, &screen->iconbitmap.width,
misc.c:			 &screen->iconbitmap.height, &screen->iconbitmap.bits,
misc.c:			screen->bitmapwidth = screen->iconbitmap.width;
misc.c:			screen->bitmapheight = screen->iconbitmap.height;
misc.c:			if((w = XReadBitmapFile(Tbm, &screen->Ticonbitmap.width,
misc.c:			 &screen->Ticonbitmap.height, &screen->Ticonbitmap.bits,
misc.c:			if(screen->bitmapwidth < screen->Ticonbitmap.width)
misc.c:				screen->bitmapwidth = screen->Ticonbitmap.width;
misc.c:			if(screen->bitmapheight < screen->Ticonbitmap.height)
misc.c:				screen->bitmapheight =
misc.c:				 screen->Ticonbitmap.height;
misc.c:		if(!screen->iconbitmap.bits) {
misc.c:			if(!screen->Ticonbitmap.bits) {
misc.c:				screen->Ticonbitmap.bits = tek_icon_bits;
misc.c:				screen->bitmapwidth = screen->Ticonbitmap.width
misc.c:				screen->bitmapheight =
misc.c:				 screen->Ticonbitmap.height = icon_height;
misc.c:			screen->iconbitmap.bits = screen->Ticonbitmap.bits;
misc.c:			screen->iconbitmap.width = screen->Ticonbitmap.width;
misc.c:			screen->iconbitmap.height = screen->Ticonbitmap.height;
misc.c:		} else if(!screen->Ticonbitmap.bits) {
misc.c:			if(!screen->iconbitmap.bits) {
misc.c:				screen->iconbitmap.bits = icon_bits;
misc.c:				screen->bitmapwidth = screen->iconbitmap.width
misc.c:				screen->bitmapheight =
misc.c:				 screen->iconbitmap.height = icon_height;
misc.c:			screen->Ticonbitmap.bits = screen->iconbitmap.bits;
misc.c:			screen->Ticonbitmap.width = screen->iconbitmap.width;
misc.c:			screen->Ticonbitmap.height = screen->iconbitmap.height;
misc.c:	if((screen->winname = malloc(strlen(win_name) + 10)) == NULL)
misc.c:	strcpy(screen->winname, win_name);
misc.c:	strcat(screen->winname, uniquesuffix(win_name));
misc.c:	screen->winnamelen = strlen(screen->winname);
misc.c:	if (screen->active_icon) return;
misc.c:	w = XQueryWidth(screen->winname, screen->titlefont->id);
misc.c:	if(screen->bitmapwidth > 0) {
misc.c:		if(screen->textundericon) {
misc.c:			screen->icon_text_x = TITLEPAD;
misc.c:			screen->icon_text_y = screen->bitmapheight +
misc.c:			screen->iconVwin.height = screen->bitmapheight +
misc.c:			  screen->titlefont->height + 3 * TITLEPAD;
misc.c:			screen->iconbitmap.x = screen->Ticonbitmap.x =
misc.c:			 screen->iconbitmap.y = screen->Ticonbitmap.y =
misc.c:			if((i = screen->bitmapwidth - w) >= 0) {
misc.c:				screen->iconVwin.width = screen->bitmapwidth +
misc.c:				screen->icon_text_x += i / 2;
misc.c:				screen->iconVwin.width = w + 2 * TITLEPAD;
misc.c:				screen->iconbitmap.x += i;
misc.c:				screen->Ticonbitmap.x += i;
misc.c:			screen->icon_text_x = screen->bitmapwidth +
misc.c:			screen->icon_text_y = TITLEPAD;
misc.c:			screen->iconVwin.width = w + screen->bitmapwidth +
misc.c:			screen->iconbitmap.x = screen->Ticonbitmap.x =
misc.c:			 screen->iconbitmap.y = screen->Ticonbitmap.y =
misc.c:			if((i = screen->bitmapheight -
misc.c:			 screen->titlefont->height) >= 0) {
misc.c:				screen->iconVwin.height = screen->bitmapheight +
misc.c:				screen->icon_text_y += i / 2;
misc.c:				screen->iconVwin.height = screen->titlefont->height
misc.c:				screen->iconbitmap.y += i;
misc.c:				screen->Ticonbitmap.y += i;
misc.c:		if((i = screen->iconbitmap.width - screen->Ticonbitmap.width)
misc.c:			screen->Ticonbitmap.x += i / 2;
misc.c:			screen->iconbitmap.x += (-i) / 2;
misc.c:		if((i = screen->iconbitmap.height - screen->Ticonbitmap.height)
misc.c:			screen->Ticonbitmap.y += i / 2;
misc.c:			screen->iconbitmap.y += (-i) / 2;
misc.c:		screen->icon_text_x = TITLEPAD;
misc.c:		screen->iconVwin.width = w + 2 * TITLEPAD;
misc.c:		screen->iconVwin.height = screen->titlefont->height + 2 * TITLEPAD;
misc.c:	if (screen->iconVwin.window)
misc.c:	    XChangeWindow( screen->iconVwin.window, screen->iconVwin.width,
misc.c:			   screen->iconVwin.height );
misc.c:	if (screen->iconTwin.window) {
misc.c:	    screen->iconTwin.width = screen->iconVwin.width;
misc.c:	    screen->iconTwin.height = screen->iconVwin.height;
misc.c:	    XChangeWindow( screen->iconTwin.window, screen->iconTwin.width,
misc.c:			   screen->iconTwin.height );
misc.c:	icon_box[0].x = screen->icon_text_x - 2;
misc.c:	icon_box[0].y = screen->icon_text_y - 2;
misc.c:	icon_box[4].y = -(icon_box[2].y = screen->titlefont->height + 3);
misc.c:	bb = screen->TekEmu ? &screen->Ticonbitmap : &screen->iconbitmap;
misc.c:	fg = screen->foreground;
misc.c:	bg = screen->background;
misc.c:	if(screen->bitmapwidth > 0)
misc.c:	XText(window, screen->icon_text_x, screen->icon_text_y,
misc.c:	 screen->winname, screen->winnamelen, screen->titlefont->id, fg, bg);
misc.c:	screen->icon_show = TRUE;
misc.c:	if(screen->iconinput)
misc.c:	if (screen->active_icon) return;
misc.c:	XDraw(screen->TekEmu ? screen->iconTwin.window : screen->iconVwin.window,
misc.c:	 icon_box, NBOX, 1, 1, screen->foreground, GXcopy, AllPlanes);
misc.c:			*ix = DisplayWidth() - *ix - screen->iconVwin.width - 2 *
misc.c:			 screen->borderwidth;
misc.c:			*iy = DisplayHeight() - *iy - screen->iconVwin.height - 2 *
misc.c:			 screen->borderwidth;
misc.c:	if(window == screen->title.tbar) {
misc.c:		i = (j = FullWidth(screen) / 2) - (screen->title.x -
misc.c:		 screen->title_n_size);
misc.c:			XMapWindow(screen->iconVwin.window);
misc.c:		i = (j = TFullWidth(screen) / 2) - (screen->Ttitle.x -
misc.c:		 screen->title_n_size);
misc.c:			XMapWindow(screen->iconTwin.window);
misc.c:	if(screen->logging || (screen->inhibit & I_LOG))
misc.c:	if(screen->logfile == NULL || *screen->logfile == 0) {
misc.c:		if(screen->logfile)
misc.c:			Free(screen->logfile);
misc.c:		if((screen->logfile = malloc(strlen(log_default) + 1)) == NULL)
misc.c:		strcpy(screen->logfile, log_default);
misc.c:	if(*screen->logfile == '|') {	/* exec command */
misc.c:			close(screen->display->fd);
misc.c:			close(screen->respond);
misc.c:				 && ((pw = getpwuid(screen->uid)) == NULL ||
misc.c:			setgid(screen->gid);
misc.c:			setuid(screen->uid);
misc.c:			execl(shell, shell, "-c", &screen->logfile[1], 0);
misc.c:			 &screen->logfile[1]);
misc.c:		screen->logfd = p[1];
misc.c:		if(access(screen->logfile, 0) == 0) {
misc.c:			if(access(screen->logfile, 2) < 0)
misc.c:		} else if(cp = rindex(screen->logfile, '/')) {
misc.c:			i = access(screen->logfile, 2);
misc.c:		if((screen->logfd = open(screen->logfile, O_WRONLY | O_APPEND |
misc.c:		chown(screen->logfile, screen->uid, screen->gid);
misc.c:	screen->logstart = screen->TekEmu ? Tbptr : bptr;
misc.c:	screen->logging = TRUE;
misc.c:	if(!screen->logging || (screen->inhibit & I_LOG))
misc.c:	close(screen->logfd);
misc.c:	screen->logging = FALSE;
misc.c:	cp = screen->TekEmu ? Tbptr : bptr;
misc.c:	if((i = cp - screen->logstart) > 0)
misc.c:		write(screen->logfd, screen->logstart, i);
misc.c:	screen->logstart = screen->TekEmu ? Tbuffer : buffer;
misc.c:	if(screen->logging)
misc.c:		if(screen->logfile)
misc.c:			Free(screen->logfile);
misc.c:		screen->logfile = cp;
misc.c:	Free(screen->winname);
misc.c:	if((screen->winname = malloc((screen->winnamelen = strlen(name)) + 1))
misc.c:	strcpy(screen->winname, name);
misc.c:	if(screen->fullVwin.window) {
misc.c:		XStoreName(screen->fullVwin.window, name);
misc.c:		XStoreName(screen->iconVwin.window, icon);
misc.c:		XChangeWindow(screen->iconVwin.window, screen->iconVwin.width,
misc.c:		 screen->iconVwin.height);
misc.c:		if(screen->title.tbar) {
misc.c:			screen->title.fullwidth = XQueryWidth(name,
misc.c:			 screen->titlefont->id);
misc.c:			if((screen->title.width = i = screen->title.fullwidth)
misc.c:			 > (j = w - 2 * (MINHILITE + screen->title_n_size + 1)))
misc.c:				screen->title.width = (i = j) +
misc.c:				 screen->title_n_size;
misc.c:			j = w - i - 2 * (screen->title_n_size + 1);
misc.c:			screen->title.x = i + 1 + screen->title_n_size;
misc.c:			screen->title.y = TITLEPAD;
misc.c:			XClear(screen->title.tbar);
misc.c:			XChangeWindow(screen->title.left, i,
misc.c:			 screen->titlefont->height);
misc.c:			XConfigureWindow(screen->title.right, w - j - 1,
misc.c:			 TITLEPAD, j, screen->titlefont->height);
misc.c:	if(screen->fullTwin.window) {
misc.c:		Free(screen->Twinname);
misc.c:		if((screen->Twinname = malloc((screen->Twinnamelen =
misc.c:		 screen->winnamelen + 6) + 1)) == NULL)
misc.c:		strcpy(screen->Twinname, name);
misc.c:		strcat(screen->Twinname, " (Tek)");
misc.c:		XStoreName(screen->fullTwin.window, screen->Twinname);
misc.c:		XStoreName(screen->iconTwin.window, icon);
misc.c:		XChangeWindow(screen->iconTwin.window, screen->iconTwin.width,
misc.c:		 screen->iconTwin.height);
misc.c:		if(screen->Ttitle.tbar) {
misc.c:			screen->Ttitle.fullwidth = XQueryWidth(screen->Twinname,
misc.c:			 screen->titlefont->id);
misc.c:			if((screen->Ttitle.width = i = screen->Ttitle.fullwidth)
misc.c:			 > (j = w - 2 * (MINHILITE + screen->title_n_size + 1)))
misc.c:				screen->Ttitle.width = (i = j) +
misc.c:				 screen->title_n_size;
misc.c:			j = w - i - 2 * (screen->title_n_size + 1);
misc.c:			screen->Ttitle.x = i + 1 + screen->title_n_size;
misc.c:			screen->Ttitle.y = TITLEPAD;
misc.c:			XClear(screen->Ttitle.tbar);
misc.c:			XChangeWindow(screen->Ttitle.left, i,
misc.c:			 screen->titlefont->height);
misc.c:			XConfigureWindow(screen->Ttitle.right, w - j - 1,
misc.c:			 TITLEPAD, j, screen->titlefont->height);
misc.c:	if (screen->pid > 1)
misc.c:		killpg(getpgrp(screen->pid), SIGHUP);
screen.c:	register int avail  = screen->max_col - screen->cur_col + 1;
screen.c:	col = screen->buf[avail = 2 * screen->cur_row] + screen->cur_col;
screen.c:	att = screen->buf[avail + 1] + screen->cur_col;
screen.c:	int y = toprow * FontHeight(screen) + screen->border + Titlebar(screen);
screen.c:	register int topline = screen->topline;
screen.c:	int scrollamt = screen->scroll_amt;
screen.c:	int max = screen->max_row;
screen.c:	if(screen->statusline && maxrow == screen->max_row + 1) {
screen.c:	if(screen->cursor_col >= leftcol && screen->cursor_col <=
screen.c:	 (leftcol + ncols - 1) && screen->cursor_row >= toprow + topline &&
screen.c:	 screen->cursor_row <= maxrow + topline)
screen.c:		screen->cursor_state = OFF;
screen.c:	   chars = screen->buf [2 * (lastind + topline)];
screen.c:	   att = screen->buf [2 * (lastind + topline) + 1];
screen.c:		 ? screen->fnt_icon
screen.c:		   ? screen->fnt_bold
screen.c:		   : screen->fnt_norm;
screen.c:	   x = col * FontWidth(screen) + screen->border;
screen.c:		    screen->reversestatus))
screen.c:		   		pix = screen->background, screen->foreground);
screen.c:		   		pix = screen->foreground, screen->background);
screen.c:		   if((flags & BOLD) && screen->enbolden)
screen.c:		   	 ? screen->fnt_icon
screen.c:			   ? screen->fnt_bold
screen.c:			   : screen->fnt_norm;
screen.c:	    screen->reversestatus))
screen.c:		 n = col - lastind, fnt, pix = screen->background,
screen.c:		 screen->foreground);
screen.c:		 n = col - lastind, fnt, pix = screen->foreground,
screen.c:		 screen->background);
screen.c:	   if((flags & BOLD) && screen->enbolden)
screen.c:	toprow = maxrow = max = screen->max_row + 1;
screen.c:	left = leftcol * FontWidth(screen) + screen->border;
screen.c:	if(leftcol + ncols - 1 >= screen->max_col)
screen.c:	XPixSet(VWindow(screen), left, y, width, screen->statusheight,
screen.c:	 screen->reversestatus ? screen->foreground : screen->background);
screen.c:	if(!screen->reversestatus)
screen.c:   Requires first <= last; first, last are rows of screen->buf.
screen.c:		bzero (screen->buf [first++], (screen->max_col + 1));
screen.c:   2. Enlarges screen->buf if necessary.  New space is appended to the bottom
screen.c:   3. Reduces  screen->buf if necessary.  Old space is removed from the bottom
screen.c:   5. Sets screen->max_row and screen->max_col to reflect new size
screen.c:	register ScrnBuf sb = screen->allbuf;
screen.c:	register ScrnBuf ab = screen->altbuf;
screen.c:	register int border = 2 * screen->border;
screen.c:	extra = Titlebar(screen) + screen->statusheight;
screen.c:	cols = (width + FontWidth(screen) / 2 - border - screen->scrollbar) /
screen.c:	if ((width - border - screen->scrollbar) % FontWidth(screen)
screen.c:	 rows < screen->minrows) {
screen.c:		 cols * FontWidth(screen) + border + screen->scrollbar,
screen.c:		 (rows < screen->minrows ? screen->minrows : rows) *
screen.c:	if (screen->max_row != rows - 1 || screen->max_col != cols - 1) {
screen.c:		if(screen->cursor_state)
screen.c:		savelines = screen->sb ? screen->savelines : 0;
screen.c:		sl0 = sb[i = 2 * (savelines + screen->max_row + 1)];
screen.c:		j = screen->max_col + 1;
screen.c:		k = screen->max_row;
screen.c:			 screen->max_row; x += 2, index++) {
screen.c:		for (index = rows, x = 2 * (k - 1); index <= screen->max_row;
screen.c:		    screen->altbuf = ab;
screen.c:		screen->allbuf = sb;
screen.c:		screen->buf = &sb[2 * savelines];
screen.c:			for (index = screen->max_row + 1, x = 2 * index ;
screen.c:		for (index = screen->max_row + 1, x = 2 * (index + savelines) ;
screen.c:		screen->max_row = rows - 1;
screen.c:		screen->max_col = cols - 1;
screen.c:		screen->top_marg = 0;
screen.c:		screen->bot_marg = screen->max_row;
screen.c:		if (screen->instatus)
screen.c:			screen->cur_row = screen->max_row + 1;
screen.c:		else if (screen->cur_row > screen->max_row)
screen.c:			screen->cur_row = screen->max_row;
screen.c:		if (screen->cur_col > screen->max_col)
screen.c:			screen->cur_col = screen->max_col;
screen.c:		screen->fullVwin.height = height - border - extra;
screen.c:		screen->fullVwin.width = width - border - screen->scrollbar;
screen.c:		if (screen->active_icon)
screen.c:	if(screen->sb)
screen.c:		ResizeScrollBar(screen->sb, width - SCROLLBARWIDTH,
screen.c:	if(screen->title.tbar && FullWidth(screen) != width)
screen.c:	screen->fullVwin.fullheight = height;
screen.c:	screen->fullVwin.fullwidth = width;
screen.c:	ioctl (screen->respond, TIOCSSIZE, &ts);
screen.c:	if(screen->pid > 1)
screen.c:		killpg(getpgrp(screen->pid), SIGWINCH);
screen.c:	ioctl (screen->respond, TIOCSWINSZ, &ws);
screen.c:	if(screen->pid > 1)
screen.c:		killpg(getpgrp(screen->pid), SIGWINCH);
screen.c:	if (screen->active_icon) {
screen.c:	    screen->iconVwin.width = (screen->max_col + 1)
screen.c:				     * screen->iconVwin.f_width
screen.c:	    			     + screen->border * 2;
screen.c:	    screen->iconVwin.height = (screen->max_row + 1)
screen.c:				      * screen->iconVwin.f_height
screen.c:	    			      + screen->border * 2;
screen.c:	    XChangeWindow( screen->iconVwin.window,
screen.c:			   screen->iconVwin.width,
screen.c:			   screen->iconVwin.height );
screen.c:	screen->iconVwin.fullwidth = screen->iconVwin.width;
screen.c:	screen->iconVwin.fullheight = screen->iconVwin.height;
scrollbar.c:	register ScrollBar *sb = screen->sb;
scrollbar.c:		screen->timeout = &stepspeed;
scrollbar.c:		WindowScroll(screen, ButtonRegion(screen->sb));
scrollbar.c:	register ScrollBar *sb = screen->sb;
scrollbar.c:		screen->timeout = &stepspeed;
scrollbar.c:		WindowScroll(screen, ButtonRegion(screen->sb));
scrollbar.c:	register ScrollBar *sb = screen->sb;
scrollbar.c:	screen->timeout = NULL;
scrollbar.c:	if((i = screen->topline - top) == 0)
scrollbar.c:	if(screen->cursor_state)
scrollbar.c:	if(lines > screen->max_row + 1)
scrollbar.c:		lines = screen->max_row + 1;
scrollbar.c:	scrollheight = screen->max_row - lines + 1;
scrollbar.c:		if (screen->multiscroll && scrollheight == 1 &&
scrollbar.c:		 screen->topline == 0 && screen->top_marg == 0 &&
scrollbar.c:		 screen->bot_marg == screen->max_row) {
scrollbar.c:			if (screen->incopy < 0 && screen->scrolls == 0)
scrollbar.c:			screen->scrolls++;
scrollbar.c:			if (screen->incopy)
scrollbar.c:			screen->incopy = -1;
scrollbar.c:		XMoveArea(VWindow(screen), screen->border, scrolltop *
scrollbar.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
scrollbar.c:		 screen->border, (scrolltop + i) * FontHeight(screen) +
scrollbar.c:		 screen->border + Titlebar(screen), Width(screen),
scrollbar.c:	screen->topline = top;
scrollbar.c:	XTileSet(VWindow(screen), screen->border, refreshtop * FontHeight(screen) +
scrollbar.c:	 screen->border + Titlebar(screen), Width(screen), lines *
scrollbar.c:	 FontHeight(screen), screen->bgndtile);
scrollbar.c:	ScrnRefresh(screen, refreshtop, 0, lines, screen->max_col + 1);
scrollbar.c:	register int border = 2 * screen->border;
scrollbar.c:	if(screen->scrollbar)
scrollbar.c:	if(!screen->sb) {
scrollbar.c:		if((screen->sb = CreateScrollBar(VWindow(screen),
scrollbar.c:		 Height(screen) + border, screen->foreground,
scrollbar.c:		 screen->background, screen->bordertile, 0,
scrollbar.c:		 screen->max_row + 1, 0, 0, screen->arrow)) == NULL) {
scrollbar.c:		if((screen->allbuf = (ScrnBuf) realloc(screen->buf,
scrollbar.c:		 2*(screen->max_row + 2 + screen->savelines) * sizeof(char *)))
scrollbar.c:		screen->buf = &screen->allbuf[2 * screen->savelines];
scrollbar.c:		bcopy ((char *)screen->allbuf, (char *)screen->buf,
scrollbar.c:		 2 * (screen->max_row + 2) * sizeof (char *));
scrollbar.c:		for(i = 2 * screen->savelines - 1 ; i >= 0 ; i--)
scrollbar.c:			if((screen->allbuf[i] =
scrollbar.c:			 calloc(screen->max_col + 1, sizeof(char))) == NULL)
scrollbar.c:		screen->sb->saveset = !screen->alternate;
scrollbar.c:		XConfigureWindow(screen->sb->bar, FullWidth(screen),
scrollbar.c:		screen->sb->set.height = i - BARSTART;
scrollbar.c:		screen->sb->set.regionheight = screen->max_row + 1;
scrollbar.c:		screen->scrollbar = SCROLLBARWIDTH;
scrollbar.c:		ShowScrollBar(screen->sb);
scrollbar.c:			 border + Titlebar(screen) + screen->statusheight,
scrollbar.c:			XChangeWindow(VWindow(screen), (screen->max_col + 1) *
scrollbar.c:			 FontHeight(screen) * (screen->max_row + 1) +
scrollbar.c:			 screen->statusheight + border + Titlebar(screen));
scrollbar.c:	register int border = 2 * screen->border;
scrollbar.c:	if(!screen->scrollbar)
scrollbar.c:	screen->sb->action = HIDE;
scrollbar.c:	screen->scrollbar = 0;
scrollbar.c:	 screen->statusheight, FontWidth(screen), FontHeight(screen));
scrollbar.c:	XChangeWindow(VWindow(screen), (screen->max_col + 1) * FontWidth(screen) +
scrollbar.c:	 border, FontHeight(screen) * (screen->max_row + 1) + screen->statusheight
scrollbar.c:	if(!screen->sb)
scrollbar.c:	if(screen->topline)
scrollbar.c:	SetScrollBarTop(screen->sb, 0);
scrollbar.c:	DrawScrollRegion(screen->sb);
scrollbar.c:	if(screen->alternate)
scrollbar.c:	if(screen->scroll_amt)
scrollbar.c:		if(sscrollkey = screen->scrollkey)
scrollbar.c:		if(sscrollinput = screen->scrollinput)
scrollbar.c:		if(slinestop = (screen->sb && GetSaveState(screen->sb)))
scrollbar.c:		if(salternate = screen->alternate)
scrollbar.c:	if(sscrollkey != screen->scrollkey)
scrollbar.c:		 screen->scrollkey));
scrollbar.c:	if(sscrollinput != screen->scrollinput)
scrollbar.c:		 screen->scrollinput));
scrollbar.c:	if(screen->sb && slinestop != GetSaveState(screen->sb))
scrollbar.c:		 GetSaveState(screen->sb)));
scrollbar.c:	if(salternate != screen->alternate)
scrollbar.c:		 screen->alternate));
scrollbar.c:		screen->scrollkey = !screen->scrollkey;
scrollbar.c:		screen->scrollinput = !screen->scrollinput;
scrollbar.c:		SetSaveState(screen->sb, !GetSaveState(screen->sb));
tabs.c:	if(screen->curses && screen->do_wrap && (term.flags & WRAPAROUND)) {
tabs.c:		col = screen->cur_col = screen->do_wrap = 0;
util.c:	register int shift = -screen->topline;
util.c:	register int bot = screen->max_row - shift;
util.c:	if(screen->cursor_state)
util.c:	if(screen->scroll_amt > 0) {
util.c:		refreshheight = screen->refresh_amt;
util.c:		scrollheight = screen->bot_marg - screen->top_marg -
util.c:		if((refreshtop = screen->bot_marg - refreshheight + 1 + shift) >
util.c:		 (i = screen->max_row - screen->scroll_amt + 1))
util.c:		if(screen->sb && GetSaveState(screen->sb) &&
util.c:		 screen->top_marg == 0) {
util.c:			if((i = screen->bot_marg - bot) > 0 &&
util.c:			 (refreshheight -= i) < screen->scroll_amt)
util.c:				refreshheight = screen->scroll_amt;
util.c:			if((i = -GetScrollBarTop(screen->sb)) <
util.c:			 screen->savelines) {
util.c:				if((i += screen->scroll_amt) >
util.c:				 screen->savelines)
util.c:					i = screen->savelines;
util.c:				SetScrollBarTop(screen->sb, -i);
util.c:				DrawScrollRegion(screen->sb);
util.c:			scrolltop = screen->top_marg + shift;
util.c:			if((i = bot - (screen->bot_marg - screen->refresh_amt +
util.c:			 screen->scroll_amt)) > 0) {
util.c:				if(bot < screen->bot_marg)
util.c:					refreshheight = screen->scroll_amt + i;
util.c:				refreshheight = screen->scroll_amt;
util.c:				if((i = screen->top_marg + screen->scroll_amt -
util.c:		refreshheight = -screen->refresh_amt;
util.c:		scrollheight = screen->bot_marg - screen->top_marg -
util.c:		refreshtop = screen->top_marg + shift;
util.c:		if((i = screen->bot_marg - bot) > 0)
util.c:		if((i = screen->top_marg + refreshheight - 1 - bot) > 0)
util.c:		if (screen->multiscroll && scrollheight == 1 &&
util.c:		 screen->topline == 0 && screen->top_marg == 0 &&
util.c:		 screen->bot_marg == screen->max_row) {
util.c:			if (screen->incopy < 0 && screen->scrolls == 0)
util.c:			screen->scrolls++;
util.c:			if (screen->incopy)
util.c:			screen->incopy = -1;
util.c:		XMoveArea (VWindow(screen), screen->border, (scrolltop +
util.c:		 screen->scroll_amt) * FontHeight(screen) + screen->border +
util.c:		 Titlebar(screen), screen->border, scrolltop * FontHeight(screen)
util.c:		 + screen->border + Titlebar(screen), Width(screen),
util.c:	screen->scroll_amt = 0;
util.c:	screen->refresh_amt = 0;
util.c:		XTileSet (VWindow(screen), screen->border, refreshtop *
util.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:		 screen->bgndtile);
util.c:		 screen->max_col + 1);
util.c:	register int amount = screen->refresh_amt;
util.c:	register int row = screen->cur_row;
util.c:	if(amount == 0 || screen->instatus)
util.c:		if(row == (bottom = screen->bot_marg) - amount) {
util.c:			screen->refresh_amt++;
util.c:		if(row == (top = screen->top_marg) + amount) {
util.c:			screen->refresh_amt--;
util.c:	register int i = screen->bot_marg - screen->top_marg + 1;
util.c:	if(screen->cursor_state)
util.c:    if(screen->jumpscroll) {
util.c:	if(screen->scroll_amt > 0) {
util.c:		if(screen->refresh_amt + amount > i)
util.c:		screen->scroll_amt += amount;
util.c:		screen->refresh_amt += amount;
util.c:		if(screen->scroll_amt < 0)
util.c:		screen->scroll_amt = amount;
util.c:		screen->refresh_amt = amount;
util.c:	shift = -screen->topline;
util.c:	bot = screen->max_row - shift;
util.c:	if((refreshtop = screen->bot_marg - refreshheight + 1 + shift) >
util.c:	 (i = screen->max_row - refreshheight + 1))
util.c:	if(screen->sb && GetSaveState(screen->sb) && screen->top_marg == 0) {
util.c:		if((i = -GetScrollBarTop(screen->sb)) < screen->savelines) {
util.c:			if((i += amount) > screen->savelines)
util.c:				i = screen->savelines;
util.c:			SetScrollBarTop(screen->sb, -i);
util.c:			DrawScrollRegion(screen->sb);
util.c:		scrolltop = screen->top_marg + shift;
util.c:		if((i = screen->bot_marg - bot) > 0) {
util.c:			if((i = screen->top_marg + amount - 1 - bot) >= 0) {
util.c:		if (screen->multiscroll
util.c:		&& amount==1 && screen->topline == 0
util.c:		&& screen->top_marg==0
util.c:		&& screen->bot_marg==screen->max_row) {
util.c:			if (screen->incopy<0 && screen->scrolls==0)
util.c:			screen->scrolls++;
util.c:			if (screen->incopy)
util.c:			screen->incopy = -1;
util.c:		XMoveArea(VWindow(screen), screen->border, (scrolltop+amount) *
util.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:		 screen->border, scrolltop * FontHeight(screen) + screen->border
util.c:		XTileSet (VWindow(screen), screen->border, refreshtop *
util.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:		 screen->bgndtile);
util.c:	if(screen->sb && GetSaveState(screen->sb) && screen->top_marg == 0)
util.c:		ScrnDeleteLine(screen->allbuf, screen->bot_marg +
util.c:		 screen->savelines, 0, amount, screen->max_col + 1);
util.c:		ScrnDeleteLine(screen->buf, screen->bot_marg, screen->top_marg,
util.c:		 amount, screen->max_col + 1);
util.c:		 screen->max_col + 1);
util.c:	register int i = screen->bot_marg - screen->top_marg + 1;
util.c:	if(screen->cursor_state)
util.c:    if(screen->jumpscroll) {
util.c:	if(screen->scroll_amt < 0) {
util.c:		if(-screen->refresh_amt + amount > i)
util.c:		screen->scroll_amt -= amount;
util.c:		screen->refresh_amt -= amount;
util.c:		if(screen->scroll_amt > 0)
util.c:		screen->scroll_amt = -amount;
util.c:		screen->refresh_amt = -amount;
util.c:	shift = -screen->topline;
util.c:	bot = screen->max_row - shift;
util.c:	scrollheight = screen->bot_marg - screen->top_marg -
util.c:	refreshtop = screen->top_marg + shift;
util.c:	if((i = screen->bot_marg - bot) > 0)
util.c:	if((i = screen->top_marg + refreshheight - 1 - bot) > 0)
util.c:		if (screen->multiscroll
util.c:		&& amount==1 && screen->topline == 0
util.c:		&& screen->top_marg==0
util.c:		&& screen->bot_marg==screen->max_row) {
util.c:			if (screen->incopy<0 && screen->scrolls==0)
util.c:			screen->scrolls++;
util.c:			if (screen->incopy)
util.c:			screen->incopy = -1;
util.c:		XMoveArea (VWindow(screen), screen->border, (scrolltop-amount) *
util.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:		 screen->border, scrolltop * FontHeight(screen) + screen->border
util.c:		XTileSet (VWindow(screen), screen->border, refreshtop *
util.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:		 screen->bgndtile);
util.c:	ScrnInsertLine (screen->buf, screen->bot_marg, screen->top_marg,
util.c:			amount, screen->max_col + 1);
util.c:	if (screen->cur_row < screen->top_marg ||
util.c:	 screen->cur_row > screen->bot_marg)
util.c:	if(screen->cursor_state)
util.c:	screen->do_wrap = 0;
util.c:	if (n > (i = screen->bot_marg - screen->cur_row + 1))
util.c:    if(screen->jumpscroll) {
util.c:	if(screen->scroll_amt <= 0 &&
util.c:	 screen->cur_row <= -screen->refresh_amt) {
util.c:		if(-screen->refresh_amt + n > screen->max_row + 1)
util.c:		screen->scroll_amt -= n;
util.c:		screen->refresh_amt -= n;
util.c:	} else if(screen->scroll_amt)
util.c:    if(!screen->scroll_amt) {
util.c:	shift = -screen->topline;
util.c:	bot = screen->max_row - shift;
util.c:	scrollheight = screen->bot_marg - screen->cur_row - refreshheight + 1;
util.c:	refreshtop = screen->cur_row + shift;
util.c:	if((i = screen->bot_marg - bot) > 0)
util.c:	if((i = screen->cur_row + refreshheight - 1 - bot) > 0)
util.c:		if (screen->incopy)
util.c:		screen->incopy = -1;
util.c:		XMoveArea (VWindow(screen), screen->border, (scrolltop - n) *
util.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:		 screen->border, scrolltop * FontHeight(screen) + screen->border
util.c:		 screen->border, refreshtop * FontHeight(screen) + screen->border
util.c:		 FontHeight(screen), screen->bgndtile);
util.c:	/* adjust screen->buf */
util.c:	ScrnInsertLine(screen->buf, screen->bot_marg, screen->cur_row, n,
util.c:			screen->max_col + 1);
util.c:	if (screen->cur_row < screen->top_marg ||
util.c:	 screen->cur_row > screen->bot_marg)
util.c:	if(screen->cursor_state)
util.c:	screen->do_wrap = 0;
util.c:	if (n > (i = screen->bot_marg - screen->cur_row + 1))
util.c:    if(screen->jumpscroll) {
util.c:	if(screen->scroll_amt >= 0 && screen->cur_row == screen->top_marg) {
util.c:		if(screen->refresh_amt + n > screen->max_row + 1)
util.c:		screen->scroll_amt += n;
util.c:		screen->refresh_amt += n;
util.c:	} else if(screen->scroll_amt)
util.c:    if(!screen->scroll_amt) {
util.c:	shift = -screen->topline;
util.c:	bot = screen->max_row - shift;
util.c:	if((refreshtop = screen->bot_marg - refreshheight + 1 + shift) >
util.c:	 (i = screen->max_row - refreshheight + 1))
util.c:	if(screen->sb && GetSaveState(screen->sb) && screen->cur_row == 0) {
util.c:		if((i = -GetScrollBarTop(screen->sb)) < screen->savelines) {
util.c:			if((i += n) > screen->savelines)
util.c:				i = screen->savelines;
util.c:			SetScrollBarTop(screen->sb, -i);
util.c:			DrawScrollRegion(screen->sb);
util.c:		scrolltop = screen->cur_row + shift;
util.c:		if((i = screen->bot_marg - bot) > 0) {
util.c:			if((i = screen->cur_row + n - 1 - bot) >= 0) {
util.c:		if (screen->incopy)
util.c:		screen->incopy = -1;
util.c:		XMoveArea (VWindow(screen), screen->border, (scrolltop + n) *
util.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:		 screen->border, scrolltop * FontHeight(screen) + screen->border
util.c:		XTileSet (VWindow(screen), screen->border, refreshtop *
util.c:		 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:		 screen->bgndtile);
util.c:	/* adjust screen->buf */
util.c:	if(screen->sb && GetSaveState(screen->sb) && screen->cur_row == 0)
util.c:		ScrnDeleteLine(screen->allbuf, screen->bot_marg +
util.c:		 screen->savelines, 0, n, screen->max_col + 1);
util.c:		ScrnDeleteLine(screen->buf, screen->bot_marg, screen->cur_row,
util.c:		 n, screen->max_col + 1);
util.c:	if(screen->cursor_state)
util.c:	screen->do_wrap = 0;
util.c:	if(screen->cur_row - screen->topline <= screen->max_row ||
util.c:	 screen->instatus) {
util.c:		if(screen->scroll_amt)
util.c:		if (screen->incopy)
util.c:		screen->incopy = -1;
util.c:		cx = CursorX (screen, screen->cur_col);
util.c:		cy = CursorY (screen, screen->cur_row);
util.c:		     Width(screen) - (screen->cur_col + n) * FontWidth(screen),
util.c:		     width, FontHeight(screen), screen->instatus ?
util.c:		     screen->foreground : screen->background);
util.c:	/* adjust screen->buf */
util.c:	ScrnInsertChar(screen->buf, screen->cur_row, screen->cur_col, n,
util.c:			screen->max_col + 1);
util.c:	if(screen->cursor_state)
util.c:	screen->do_wrap = 0;
util.c:	if (n > (width = screen->max_col + 1 - screen->cur_col))
util.c:	if(screen->cur_row - screen->topline <= screen->max_row ||
util.c:	 screen->instatus) {
util.c:		if(screen->scroll_amt)
util.c:		if (screen->incopy)
util.c:		screen->incopy = -1;
util.c:		cx = CursorX (screen, screen->cur_col);
util.c:		cy = CursorY (screen, screen->cur_row);
util.c:		     Width(screen) - (screen->cur_col + n) * FontWidth(screen),
util.c:		     screen->border + Width(screen) - width, cy,
util.c:		     width, FontHeight(screen), screen->instatus ?
util.c:		     screen->foreground : screen->background);
util.c:	/* adjust screen->buf */
util.c:	ScrnDeleteChar (screen->buf, screen->cur_row, screen->cur_col, n,
util.c:			screen->max_col + 1);
util.c:	if(screen->cursor_state)
util.c:	if((top = -screen->topline) <= screen->max_row) {
util.c:		if(screen->scroll_amt)
util.c:		if((height = screen->cur_row + top) > screen->max_row)
util.c:			height = screen->max_row;
util.c:			XTileSet(VWindow(screen), screen->border, top *
util.c:			 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:			 screen->bgndtile);
util.c:		if(screen->cur_row - screen->topline <= screen->max_row)
util.c:	ClearBufRows(screen, 0, screen->cur_row - 1);
util.c:	if((top = screen->cur_row - screen->topline) <= screen->max_row) {
util.c:		if(screen->scroll_amt)
util.c:		if(++top <= screen->max_row)
util.c:			XTileSet(VWindow(screen), screen->border, top *
util.c:			 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:			 Width(screen), (screen->max_row - top + 1) *
util.c:			 FontHeight(screen), screen->bgndtile);
util.c:	ClearBufRows(screen, screen->cur_row + 1, screen->max_row);
util.c:	if(screen->cursor_state)
util.c:	screen->do_wrap = 0;
util.c:	if(screen->cur_row - screen->topline <= screen->max_row ||
util.c:	 screen->instatus) {
util.c:		if(screen->scroll_amt)
util.c:		 CursorX(screen, screen->cur_col),
util.c:		 CursorY(screen, screen->cur_row),
util.c:		 Width(screen) - screen->cur_col * FontWidth(screen),
util.c:		 FontHeight(screen), screen->instatus ? screen->foreground :
util.c:		 screen->background);
util.c:	bzero(screen->buf [2 * screen->cur_row] + screen->cur_col,
util.c:	       (screen->max_col - screen->cur_col + 1));
util.c:	bzero(screen->buf [2 * screen->cur_row + 1] + screen->cur_col,
util.c:	       (screen->max_col - screen->cur_col + 1));
util.c:	if(screen->cursor_state)
util.c:	screen->do_wrap = 0;
util.c:	if(screen->cur_row - screen->topline <= screen->max_row ||
util.c:	 screen->instatus) {
util.c:		if(screen->scroll_amt)
util.c:		     screen->border, CursorY (screen, screen->cur_row),
util.c:		     (screen->cur_col + 1) * FontWidth(screen),
util.c:		     FontHeight(screen), screen->instatus ? screen->foreground :
util.c:		     screen->background);
util.c:	bzero (screen->buf [2 * screen->cur_row], (screen->cur_col + 1));
util.c:	bzero (screen->buf [2 * screen->cur_row + 1], (screen->cur_col + 1));
util.c:	if(screen->cursor_state)
util.c:	screen->do_wrap = 0;
util.c:	if(screen->cur_row - screen->topline <= screen->max_row ||
util.c:	 screen->instatus) {
util.c:		if(screen->scroll_amt)
util.c:		     screen->border, CursorY (screen, screen->cur_row),
util.c:		     Width(screen), FontHeight(screen), screen->instatus ?
util.c:		     screen->foreground : screen->background);
util.c:	bzero (screen->buf [2 * screen->cur_row], (screen->max_col + 1));
util.c:	bzero (screen->buf [2 * screen->cur_row + 1], (screen->max_col + 1));
util.c:	if(screen->cursor_state)
util.c:	screen->do_wrap = 0;
util.c:	if((top = -screen->topline) <= screen->max_row) {
util.c:		if(screen->scroll_amt)
util.c:		if(top == 0 && !screen->statusline)
util.c:			XTileSet(VWindow(screen), screen->border, top *
util.c:			 FontHeight(screen) + screen->border + Titlebar(screen),
util.c:			 Width(screen), (screen->max_row - top + 1) *
util.c:			 FontHeight(screen), screen->bgndtile);
util.c:	ClearBufRows (screen, 0, screen->max_row);
util.c:	screen->pagecnt = 0;
util.c:			    screen->incopy <= 0) {
util.c:				screen->incopy = 1;
util.c:				if (screen->scrolls > 0)
util.c:					screen->scrolls--;
util.c:			if (screen->incopy <= 0 && screen->scrolls > 0)
util.c:				screen->scrolls--;
util.c:			if (screen->scrolls == 0) {
util.c:				screen->incopy = 0;
util.c:			screen->incopy = -1;
util.c:	if((toprow = (reply->y - screen->border - Titlebar(screen)) /
util.c:	if((leftcol = (reply->x - screen->border) / FontWidth(screen)) < 0)
util.c:	nrows = (reply->y + reply->height - 1 - screen->border
util.c:	ncols = (reply->x + reply->width - 1 - screen->border) /
util.c:	toprow -= screen->scrolls;
util.c:	if (toprow + nrows - 1 > screen->max_row)
util.c:		nrows = screen->max_row - toprow + 1 + screen->statusline;
util.c:	if (leftcol + ncols - 1 > screen->max_col)
util.c:		ncols = screen->max_col - leftcol + 1;
util.c:		if (screen->cur_row >= toprow &&
util.c:		    screen->cur_row < toprow + nrows &&
util.c:		    screen->cur_col >= leftcol &&
util.c:		    screen->cur_col < leftcol + ncols)
util.c:	if(screen->color & C_BACKGROUND)
util.c:		XFreePixmap(screen->bgndtile);
util.c:	tmp = screen->background;
util.c:	if(screen->cursorcolor == screen->foreground)
util.c:		screen->cursorcolor = tmp;
util.c:	if(screen->mousecolor == screen->foreground)
util.c:		screen->mousecolor = tmp;
util.c:	screen->background = screen->foreground;
util.c:	screen->foreground = tmp;
util.c:	screen->color = (screen->color & ~C_FBMASK) | switchfb[screen->color
util.c:	if(screen->color & C_BACKGROUND) {
util.c:		if(!(screen->bgndtile = XMakeTile(screen->background)))
util.c:		screen->bgndtile = (screen->background == W_Pixel) ? W_Pixmap
util.c:	XFreeCursor(screen->curs);
util.c:	screen->curs = make_xterm(screen->mousecolor, screen->background,
util.c:	XFreeCursor(screen->arrow);
util.c:	screen->arrow = make_arrow(screen->mousecolor, screen->background,
util.c:	XDefineCursor(VWindow(screen), screen->curs);
util.c:	if(screen->sb)
util.c:		XDefineCursor(screen->sb->bar, screen->sb->cursor =
util.c:		 screen->arrow);
util.c:	if(screen->title.tbar)
util.c:		XDefineCursor(screen->title.tbar, screen->arrow);
util.c:		XDefineCursor(tek, screen->arrow);
util.c:	MenuNewCursor(screen->arrow);
util.c:	if (screen->borderwidth && screen->background < 2 &&
util.c:	 screen->foreground < 2) {
util.c:	    if (screen->bgndtile == B_Pixmap)
util.c:		screen->bordertile = W_Pixmap;
util.c:	    else if (screen->bgndtile == W_Pixmap)
util.c:		screen->bordertile = B_Pixmap;
util.c:	    XChangeBorder (VWindow(screen), pix = screen->bordertile);
util.c:	    XChangeBorder (screen->iconVwin.window, pix);
util.c:	    if(screen->sb)
util.c:		XChangeBorder (screen->sb->bar, pix);
util.c:	    if(screen->title.tbar)
util.c:		XChangeBorder (screen->title.tbar, pix);
util.c:		XChangeBorder (screen->iconTwin.window, pix);
util.c:		if(screen->Ttitle.tbar)
util.c:		    XChangeBorder (screen->Ttitle.tbar, pix);
util.c:	XChangeBackground (VWindow(screen), screen->bgndtile);
util.c:	XChangeBackground (screen->iconVwin.window, screen->bgndtile);
util.c:	if(screen->title.tbar)
util.c:	    XChangeBackground (screen->title.tbar, screen->bgndtile);
util.c:	    XChangeBackground (screen->iconTwin.window, screen->bgndtile);
util.c:	    if(screen->Ttitle.tbar)
util.c:		XChangeBackground (screen->Ttitle.tbar, screen->bgndtile);
util.c:	XClear (screen->iconVwin.window);
util.c:	ScrnRefresh (screen, 0, 0, screen->max_row + 1 + screen->statusline,
util.c:	 screen->max_col + 1);
util.c:	if(screen->Tshow) {
util.c:	    XClear (screen->iconTwin.window);
util.c:	    XClear(screen->title.tbar);
util.c:	    if(screen->Tshow) {
util.c:		XClear(screen->Ttitle.tbar);
