while (opts->name) {
while (opts && opts->name) {
ScreenDialog(XF86SetupInfo *info){    static Widget dialog, d1, d4, d8, d16, d24, labelRotate, cw, ccw;    Arg args[2];    XF86ConfMonitorPtr mon = screen->scrn_monitor;    XF86ConfModeLinePtr mline = mon != NULL ? mon->mon_modeline_lst : NULL;    int i;#ifdef USE_MODULES    xf86cfgModuleOptions *drv_opts = module_options;    Bool foundRotate = False;#endif    while (nmodes > 0)	XtFree(modes[--nmodes]);    XtFree((XtPointer)modes);    modes = NULL;    while (mline) {	if (nmodes % 16 == 0)	    modes = (char**)XtRealloc((XtPointer)modes,				      sizeof(char*) * (nmodes + 16));	modes[nmodes++] = XtNewString(mline->ml_identifier);	mline = (XF86ConfModeLinePtr)(mline->list.next);    }    for (i = 0; i < sizeof(standard_modes) / sizeof(standard_modes[0]); i++) {	if (nmodes % 16 == 0)	    modes = (char**)XtRealloc((XtPointer)modes,				      sizeof(char*) * (nmodes + 16));	modes[nmodes++] = XtNewString(standard_modes[i]);    }    if (dialog == NULL) {	Widget command, viewport;	dialog = XtCreateWidget("screenD", formWidgetClass,				configp, NULL, 0);	XtCreateManagedWidget("depthL", labelWidgetClass,			      dialog, NULL, 0);	d1 = XtCreateManagedWidget("1", toggleWidgetClass, dialog, NULL, 0);	XtAddCallback(d1, XtNcallback, DepthCallback, (XtPointer)1);	d4 = XtVaCreateManagedWidget("4", toggleWidgetClass, dialog,				     XtNradioGroup, d1, NULL, 0);	XtAddCallback(d4, XtNcallback, DepthCallback, (XtPointer)4);	d8 = XtVaCreateManagedWidget("8", toggleWidgetClass, dialog,				      XtNradioGroup, d4, NULL, 0);	XtAddCallback(d8, XtNcallback, DepthCallback, (XtPointer)8);	d16 = XtVaCreateManagedWidget("16", toggleWidgetClass, dialog,				      XtNradioGroup, d8, NULL, 0);	XtAddCallback(d16, XtNcallback, DepthCallback, (XtPointer)16);	d24 = XtVaCreateManagedWidget("24", toggleWidgetClass, dialog,				      XtNradioGroup, d16, NULL, 0);	XtAddCallback(d24, XtNcallback, DepthCallback, (XtPointer)24);	XtCreateManagedWidget("modeL", labelWidgetClass, dialog, NULL, 0);	viewport = XtCreateManagedWidget("viewL", viewportWidgetClass, dialog,					 NULL, 0);	listL = XtCreateManagedWidget("listLeft", listWidgetClass, viewport,					NULL, 0);	XtAddCallback(listL, XtNcallback, SelectIndexCallback, NULL);	command = XtCreateManagedWidget("select", commandWidgetClass,					dialog, NULL, 0);	XtAddCallback(command, XtNcallback, SelectCallback, NULL);	command = XtCreateManagedWidget("unselect", commandWidgetClass,					dialog, NULL, 0);	XtAddCallback(command, XtNcallback, UnselectCallback, NULL);	command = XtCreateManagedWidget("up", commandWidgetClass,					dialog, NULL, 0);	XtAddCallback(command, XtNcallback, MoveCallback, (XtPointer)False);	command = XtCreateManagedWidget("down", commandWidgetClass,					dialog, NULL, 0);	XtAddCallback(command, XtNcallback, MoveCallback, (XtPointer)True);	viewport = XtCreateManagedWidget("viewR", viewportWidgetClass, dialog,					 NULL, 0);	listR = XtCreateManagedWidget("listRight", listWidgetClass, viewport,				      NULL, 0);	XtAddCallback(listR, XtNcallback, UnselectIndexCallback, NULL);	labelRotate = XtCreateManagedWidget("rotate", labelWidgetClass,					    dialog, NULL, 0);	cw = XtCreateManagedWidget("CW", toggleWidgetClass, dialog, NULL, 0);	XtAddCallback(cw, XtNcallback, RotateCallback, (XtPointer)CW);	ccw = XtVaCreateManagedWidget("CCW", toggleWidgetClass, dialog,				      XtNradioGroup, cw, NULL, 0);	XtAddCallback(ccw, XtNcallback, RotateCallback, (XtPointer)CCW);	XtRealizeWidget(dialog);    }#ifdef USE_MODULES    if (!nomodules) {	while (drv_opts) {	    if (drv_opts->type == VideoModule &&		strcmp(drv_opts->name, screen->scrn_device->dev_driver) == 0) {		OptionInfoPtr opts = drv_opts->option;		while (opts->name) {		    if (xf86nameCompare(opts->name, "Rotate") == 0) {			foundRotate = True;			break;		    }		    opts++;		}		break;	    }	    drv_opts = drv_opts->next;	}	if (!foundRotate) {	    XtUnmapWidget(labelRotate);	    XtUnmapWidget(cw);	    XtUnmapWidget(ccw);	}	else {	    XtMapWidget(labelRotate);	    XtMapWidget(cw);	    XtMapWidget(ccw);	}    }#else    (void)labelRotate;#endif    if (rotate == CW) {	XtVaSetValues(cw, XtNstate, True, NULL, 0);	XtVaSetValues(ccw, XtNstate, False, NULL, 0);    }    else if (rotate == CCW) {	XtVaSetValues(cw, XtNstate, False, NULL, 0);	XtVaSetValues(ccw, XtNstate, True, NULL, 0);    }    else {	XtVaSetValues(cw, XtNstate, False, NULL, 0);	XtVaSetValues(ccw, XtNstate, False, NULL, 0);    }    XtSetArg(args[0], XtNlist, modes);    XtSetArg(args[1], XtNnumberStrings, nmodes);    XtSetValues(listL, args, 2);    XtSetArg(args[0], XtNlist, defmodes);    XtSetArg(args[1], XtNnumberStrings, ndefmodes);    XtSetValues(listR, args, 2);    XtSetArg(args[0], XtNstate, True);    XtSetValues(default_depth == 1 ? d1 :		default_depth == 4 ? d4 :		default_depth == 16 ? d16 :		default_depth == 24 ? d24 : d8, args, 1);    XtChangeManagedSet(&current, 1, NULL, NULL, &dialog, 1);    current = dialog;}