window_ops(termw) XtermWidget termw;
window_ops(XtermWidget termw)
window_ops(termw)    XtermWidget termw;{	register TScreen	*screen	= &termw->screen;	XWindowChanges values;	XWindowAttributes win_attrs;	XTextProperty text;	unsigned int value_mask;	Position x, y;	switch (param[0]) {	case 1:		/* Restore (de-iconify) window */		XMapWindow(screen->display,			VShellWindow);		break;	case 2:		/* Minimize (iconify) window */		XIconifyWindow(screen->display,			VShellWindow,			DefaultScreen(screen->display));		break;	case 3:		/* Move the window to the given position */		values.x   = param[1];		values.y   = param[2];		value_mask = (CWX | CWY);		XReconfigureWMWindow(			screen->display,			VShellWindow,			DefaultScreen(screen->display),			value_mask,			&values);		break;	case 4:		/* Resize the window to given size in pixels */		RequestResize(termw, param[1], param[2], FALSE);		break;	case 5:		/* Raise the window to the front of the stack */		XRaiseWindow(screen->display, VShellWindow);		break;	case 6:		/* Lower the window to the bottom of the stack */		XLowerWindow(screen->display, VShellWindow);		break;	case 7:		/* Refresh the window */		Redraw();		break;	case 8:		/* Resize the text-area, in characters */		RequestResize(termw, param[1], param[2], TRUE);		break;	case 11:	/* Report the window's state */		XGetWindowAttributes(screen->display,			VWindow(screen),			&win_attrs);		reply.a_type = CSI;		reply.a_pintro = 0;		reply.a_nparam = 1;		reply.a_param[0] = (win_attrs.map_state == IsViewable) ? 1 : 2;		reply.a_inters = 0;		reply.a_final  = 't';		unparseseq(&reply, screen->respond);		break;	case 13:	/* Report the window's position */		XtTranslateCoords(toplevel, 0, 0, &x, &y);		reply.a_type = CSI;		reply.a_pintro = 0;		reply.a_nparam = 3;		reply.a_param[0] = 3;		reply.a_param[1] = x;		reply.a_param[2] = y;		reply.a_inters = 0;		reply.a_final  = 't';		unparseseq(&reply, screen->respond);		break;	case 14:	/* Report the window's size in pixels */		XGetWindowAttributes(screen->display,			VWindow(screen),			&win_attrs);		reply.a_type = CSI;		reply.a_pintro = 0;		reply.a_nparam = 3;		reply.a_param[0] = 4;		/*FIXME: find if dtterm uses		 *	win_attrs.height or Height		 *	win_attrs.width  or Width		 */		reply.a_param[1] = Height(screen);		reply.a_param[2] = Width(screen);		reply.a_inters = 0;		reply.a_final  = 't';		unparseseq(&reply, screen->respond);		break;	case 18:	/* Report the text's size in characters */		reply.a_type = CSI;		reply.a_pintro = 0;		reply.a_nparam = 3;		reply.a_param[0] = 8;		reply.a_param[1] = screen->max_row + 1;		reply.a_param[2] = screen->max_col + 1;		reply.a_inters = 0;		reply.a_final  = 't';		unparseseq(&reply, screen->respond);		break;	case 20:	/* Report the icon's label */		report_win_label(screen, 'L', &text,			XGetWMIconName(				screen->display,				VShellWindow,				&text));		break;	case 21:	/* Report the window's title */		report_win_label(screen, 'l', &text,			XGetWMName(				screen->display,				VShellWindow,				&text));		break;	default: /* DECSLPP (24, 25, 36, 48, 72, 144) */		if (param[0] >= 24)			RequestResize(termw, param[0], -1, TRUE);		break;	}}