screen->iconVwin.f_width = screen->fnt_icon->max_bounds.width; screen->iconVwin.f_height = (screen->fnt_icon->ascent + screen->fnt_icon->descent);  screen->iconVwin.width = (screen->max_col + 1) * screen->iconVwin.f_width; screen->iconVwin.fullwidth = screen->iconVwin.width + 2 * screen->border;  screen->iconVwin.height = (screen->max_row + 1) * screen->iconVwin.f_height; screen->iconVwin.fullheight = screen->iconVwin.height + 2 * screen->border;
xtermComputeFontInfo (screen, &(screen->iconVwin), screen->fnt_icon, 0);
static void VTRealize (	Widget w,	XtValueMask *valuemask,	XSetWindowAttributes *values){	unsigned int width, height;	register TScreen *screen = &term->screen;	int xpos, ypos, pr;	XSizeHints		sizehints;	int scrollbar_width;	TabReset (term->tabs);	screen->menu_font_names[fontMenu_fontdefault] = term->misc.f_n;	screen->fnt_norm = screen->fnt_bold = NULL;	if (!xtermLoadFont(screen, term->misc.f_n, term->misc.f_b, False, 0)) {	    if (XmuCompareISOLatin1(term->misc.f_n, "fixed") != 0) {		fprintf (stderr,		     "%s:  unable to open font \"%s\", trying \"fixed\"....\n",		     xterm_name, term->misc.f_n);		(void) xtermLoadFont (screen, "fixed", NULL, False, 0);		screen->menu_font_names[fontMenu_fontdefault] = "fixed";	    }	}	/* really screwed if we couldn't open default font */	if (!screen->fnt_norm) {	    fprintf (stderr, "%s:  unable to locate a suitable font\n",		     xterm_name);	    Exit (1);	}	/* making cursor */	if (!screen->pointer_cursor)	  screen->pointer_cursor = make_colored_cursor(XC_xterm,						       screen->mousecolor,						       screen->mousecolorback);	else	  recolor_cursor (screen->pointer_cursor,			  screen->mousecolor, screen->mousecolorback);	scrollbar_width = (term->misc.scrollbar ?			   screen->scrollWidget->core.width /* +			   screen->scrollWidget->core.border_width */ : 0);	/* set defaults */	xpos = 1; ypos = 1; width = 80; height = 24;	pr = XParseGeometry (term->misc.geo_metry, &xpos, &ypos,			     &width, &height);	screen->max_col = (width - 1);	/* units in character cells */	screen->max_row = (height - 1);	/* units in character cells */	xtermUpdateFontInfo (&term->screen, False);	width = screen->fullVwin.fullwidth;	height = screen->fullVwin.fullheight;	if ((pr & XValue) && (XNegative&pr))	  xpos += DisplayWidth(screen->display, DefaultScreen(screen->display))			- width - (term->core.parent->core.border_width * 2);	if ((pr & YValue) && (YNegative&pr))	  ypos += DisplayHeight(screen->display,DefaultScreen(screen->display))			- height - (term->core.parent->core.border_width * 2);	/* set up size hints for window manager; min 1 char by 1 char */	sizehints.base_width = 2 * screen->border + scrollbar_width;	sizehints.base_height = 2 * screen->border;	sizehints.width_inc = FontWidth(screen);	sizehints.height_inc = FontHeight(screen);	sizehints.min_width = sizehints.base_width + sizehints.width_inc;	sizehints.min_height = sizehints.base_height + sizehints.height_inc;	sizehints.flags = (PBaseSize|PMinSize|PResizeInc);	sizehints.x = xpos;	sizehints.y = ypos;	if ((XValue&pr) || (YValue&pr)) {	    sizehints.flags |= USSize|USPosition;	    sizehints.flags |= PWinGravity;	    switch (pr & (XNegative | YNegative)) {	      case 0:		sizehints.win_gravity = NorthWestGravity;		break;	      case XNegative:		sizehints.win_gravity = NorthEastGravity;		break;	      case YNegative:		sizehints.win_gravity = SouthWestGravity;		break;	      default:		sizehints.win_gravity = SouthEastGravity;		break;	    }	} else {	    /* set a default size, but do *not* set position */	    sizehints.flags |= PSize;	}	sizehints.width = width;	sizehints.height = height;	if ((WidthValue&pr) || (HeightValue&pr))	  sizehints.flags |= USSize;	else sizehints.flags |= PSize;	(void) XtMakeResizeRequest((Widget) term,				   (Dimension)width, (Dimension)height,				   &term->core.width, &term->core.height);	/* XXX This is bogus.  We are parsing geometries too late.  This	 * is information that the shell widget ought to have before we get	 * realized, so that it can do the right thing.	 */        if (sizehints.flags & USPosition)	    XMoveWindow (XtDisplay(term), term->core.parent->core.window,			 sizehints.x, sizehints.y);	XSetWMNormalHints (XtDisplay(term), term->core.parent->core.window,			   &sizehints);	XFlush (XtDisplay(term));	/* get it out to window manager */	/* use ForgetGravity instead of SouthWestGravity because translating	   the Expose events for ConfigureNotifys is too hard */	values->bit_gravity = term->misc.resizeGravity == NorthWestGravity ?	    NorthWestGravity : ForgetGravity;	term->screen.fullVwin.window = term->core.window =	  XCreateWindow(XtDisplay(term), XtWindow(term->core.parent),		term->core.x, term->core.y,		term->core.width, term->core.height, term->core.border_width,		(int) term->core.depth,		InputOutput, CopyFromParent,		*valuemask|CWBitGravity, values);	screen->event_mask = values->event_mask;#ifndef NO_ACTIVE_ICON	if (term->misc.active_icon && screen->fnt_icon) {	    int iconX=0, iconY=0;	    Widget shell = term->core.parent;	    unsigned long mask;	    XGCValues xgcv;	    XtVaGetValues(shell, XtNiconX, &iconX, XtNiconY, &iconY, NULL);	    screen->iconVwin.f_width = screen->fnt_icon->max_bounds.width;	    screen->iconVwin.f_height = (screen->fnt_icon->ascent +					 screen->fnt_icon->descent);	    screen->iconVwin.width =		(screen->max_col + 1) * screen->iconVwin.f_width;	    screen->iconVwin.fullwidth = screen->iconVwin.width +		2 * screen->border;	    screen->iconVwin.height =		(screen->max_row + 1) * screen->iconVwin.f_height;	    screen->iconVwin.fullheight = screen->iconVwin.height +		2 * screen->border;	    /* since only one client is permitted to select for Button	     * events, we have to let the window manager get 'em...	     */	    values->event_mask &= ~(ButtonPressMask|ButtonReleaseMask);	    values->border_pixel = term->misc.icon_border_pixel;	    screen->iconVwin.window =		XCreateWindow(XtDisplay(term),			      RootWindowOfScreen(XtScreen(shell)),			      iconX, iconY,			      screen->iconVwin.fullwidth,			      screen->iconVwin.fullheight,			      term->misc.icon_border_width,			      (int) term->core.depth,			      InputOutput, CopyFromParent,			      *valuemask|CWBitGravity|CWBorderPixel,			      values);	    XtVaSetValues(shell, XtNiconWindow, screen->iconVwin.window, NULL);	    XtRegisterDrawable(XtDisplay(term), screen->iconVwin.window, w);	    mask = (GCFont | GCForeground | GCBackground |		    GCGraphicsExposures | GCFunction);	    xgcv.font = screen->fnt_icon->fid;	    xgcv.foreground = screen->foreground;	    xgcv.background = term->core.background_pixel;	    xgcv.graphics_exposures = TRUE;	/* default */	    xgcv.function = GXcopy;	    screen->iconVwin.normalGC =		screen->iconVwin.normalboldGC =		    XtGetGC(shell, mask, &xgcv);	    xgcv.foreground = term->core.background_pixel;	    xgcv.background = screen->foreground;	    screen->iconVwin.reverseGC =		screen->iconVwin.reverseboldGC =		    XtGetGC(shell, mask, &xgcv);	}	else {	    term->misc.active_icon = False;	}#endif /* NO_ACTIVE_ICON */#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD	VTInitI18N();#else	term->screen.xic = NULL;#endif	set_cursor_gcs (screen);	/* Reset variables used by ANSI emulation. */	resetCharsets(screen);	XDefineCursor(screen->display, VShellWindow, screen->pointer_cursor);        screen->cur_col = screen->cur_row = 0;	screen->max_col = Width(screen)/screen->fullVwin.f_width - 1;	screen->top_marg = 0;	screen->bot_marg = screen->max_row = Height(screen) /				screen->fullVwin.f_height - 1;	screen->sc.row = screen->sc.col = screen->sc.flags = 0;	/* Mark screen buffer as unallocated.  We wait until the run loop so	   that the child process does not fork and exec with all the dynamic	   memory it will never use.  If we were to do it here, the	   swap space for new process would be huge for huge savelines. */#if OPT_TEK4014	if (!tekWidget)			/* if not called after fork */#endif	  screen->visbuf = screen->allbuf = NULL;	screen->do_wrap = 0;	screen->scrolls = screen->incopy = 0;	xtermSetCursorBox (screen);	screen->savedlines = 0;	if (term->misc.scrollbar) {		screen->fullVwin.scrollbar = 0;		ScrollBarOn (term, FALSE, TRUE);	}	CursorSave (term, &screen->sc);	return;}