Lines Matching +full:d +full:-

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2021-2023 Alfonso Sabato Siciliano
39 * -1- Error and diagnostic
45 * ----------------------------------------------------
46 * -2- (Unicode) Multicolumn character strings
53 * ----------------------------------------------------
54 * -3- Buttons
62 * ----------------------------------------------------
63 * -4- (Auto) Sizing and (Auto) Position
79 * ----------------------------------------------------
80 * -5- (Dialog) Widget components and utils
88 * ----------------------------------------------------
89 * -6- Dialog init/build, update/draw, destroy
100 * -1- Error and diagnostic
113 strncpy(errorbuffer, str, ERRBUFLEN-1); in set_error_string()
121 vsnprintf(errorbuffer, ERRBUFLEN-1, fmt, arg_ptr); in set_fmt_error_string()
126 * -2- (Unicode) Multicolumn character strings
139 charlen != (size_t)-1 && charlen != (size_t)-2) { in alloc_mbstows()
174 charlen != (size_t)-1 && charlen != (size_t)-2) { in str_props()
176 return (-1); in str_props()
204 charlen != (size_t)-1 && charlen != (size_t)-2) { in strcols()
216 * -3- Buttons
222 width = bs->nbuttons * bs->sizebutton; in buttons_min_width()
223 if (bs->nbuttons > 0) in buttons_min_width()
224 width += (bs->nbuttons - 1) * t.button.minmargin; in buttons_min_width()
249 for (i = 1; i < size - 1; i++) in draw_button()
256 x = x + 1 + ((size - 2 - strcols(text))/2); in draw_button()
268 void draw_buttons(struct dialog *d) in draw_buttons() argument
273 y = d->h - 2; in draw_buttons()
275 newmargin = d->w - BORDERS - (d->bs.nbuttons * d->bs.sizebutton); in draw_buttons()
276 newmargin /= (d->bs.nbuttons + 1); in draw_buttons()
280 wbuttons = buttons_min_width(&d->bs); in draw_buttons()
283 wbuttons = d->bs.nbuttons * d->bs.sizebutton; in draw_buttons()
284 wbuttons += (d->bs.nbuttons + 1) * margin; in draw_buttons()
287 startx = d->w/2 - wbuttons/2 + newmargin; in draw_buttons()
288 for (i = 0; i < (int)d->bs.nbuttons; i++) { in draw_buttons()
289 x = i * (d->bs.sizebutton + margin); in draw_buttons()
290 draw_button(d->widget, y, startx + x, d->bs.sizebutton, in draw_buttons()
291 d->bs.label[i], d->bs.first[i], i == d->bs.curr, in draw_buttons()
292 d->bs.shortcut); in draw_buttons()
297 set_buttons(struct dialog *d, bool shortcut, const char *oklabel, in set_buttons() argument
306 d->bs.nbuttons = 0; in set_buttons()
307 d->bs.curr = 0; in set_buttons()
308 d->bs.sizebutton = 0; in set_buttons()
309 d->bs.shortcut = shortcut; in set_buttons()
311 if (d->conf->button.left1_label != NULL) { in set_buttons()
312 d->bs.label[d->bs.nbuttons] = d->conf->button.left1_label; in set_buttons()
313 d->bs.value[d->bs.nbuttons] = BSDDIALOG_LEFT1; in set_buttons()
314 d->bs.nbuttons += 1; in set_buttons()
317 if (d->conf->button.left2_label != NULL) { in set_buttons()
318 d->bs.label[d->bs.nbuttons] = d->conf->button.left2_label; in set_buttons()
319 d->bs.value[d->bs.nbuttons] = BSDDIALOG_LEFT2; in set_buttons()
320 d->bs.nbuttons += 1; in set_buttons()
323 if (d->conf->button.left3_label != NULL) { in set_buttons()
324 d->bs.label[d->bs.nbuttons] = d->conf->button.left3_label; in set_buttons()
325 d->bs.value[d->bs.nbuttons] = BSDDIALOG_LEFT3; in set_buttons()
326 d->bs.nbuttons += 1; in set_buttons()
329 if (oklabel != NULL && d->conf->button.without_ok == false) { in set_buttons()
330 d->bs.label[d->bs.nbuttons] = d->conf->button.ok_label != NULL ? in set_buttons()
331 d->conf->button.ok_label : oklabel; in set_buttons()
332 d->bs.value[d->bs.nbuttons] = BSDDIALOG_OK; in set_buttons()
333 d->bs.nbuttons += 1; in set_buttons()
336 if (d->conf->button.with_extra) { in set_buttons()
337 d->bs.label[d->bs.nbuttons] = d->conf->button.extra_label != NULL ? in set_buttons()
338 d->conf->button.extra_label : "Extra"; in set_buttons()
339 d->bs.value[d->bs.nbuttons] = BSDDIALOG_EXTRA; in set_buttons()
340 d->bs.nbuttons += 1; in set_buttons()
343 if (cancellabel != NULL && d->conf->button.without_cancel == false) { in set_buttons()
344 d->bs.label[d->bs.nbuttons] = d->conf->button.cancel_label ? in set_buttons()
345 d->conf->button.cancel_label : cancellabel; in set_buttons()
346 d->bs.value[d->bs.nbuttons] = BSDDIALOG_CANCEL; in set_buttons()
347 if (d->conf->button.default_cancel) in set_buttons()
348 d->bs.curr = d->bs.nbuttons; in set_buttons()
349 d->bs.nbuttons += 1; in set_buttons()
352 if (d->conf->button.with_help) { in set_buttons()
353 d->bs.label[d->bs.nbuttons] = d->conf->button.help_label != NULL ? in set_buttons()
354 d->conf->button.help_label : "Help"; in set_buttons()
355 d->bs.value[d->bs.nbuttons] = BSDDIALOG_HELP; in set_buttons()
356 d->bs.nbuttons += 1; in set_buttons()
359 if (d->conf->button.right1_label != NULL) { in set_buttons()
360 d->bs.label[d->bs.nbuttons] = d->conf->button.right1_label; in set_buttons()
361 d->bs.value[d->bs.nbuttons] = BSDDIALOG_RIGHT1; in set_buttons()
362 d->bs.nbuttons += 1; in set_buttons()
365 if (d->conf->button.right2_label != NULL) { in set_buttons()
366 d->bs.label[d->bs.nbuttons] = d->conf->button.right2_label; in set_buttons()
367 d->bs.value[d->bs.nbuttons] = BSDDIALOG_RIGHT2; in set_buttons()
368 d->bs.nbuttons += 1; in set_buttons()
371 if (d->conf->button.right3_label != NULL) { in set_buttons()
372 d->bs.label[d->bs.nbuttons] = d->conf->button.right3_label; in set_buttons()
373 d->bs.value[d->bs.nbuttons] = BSDDIALOG_RIGHT3; in set_buttons()
374 d->bs.nbuttons += 1; in set_buttons()
377 if (d->bs.nbuttons == 0) { in set_buttons()
378 d->bs.label[0] = DEFAULT_BUTTON_LABEL; in set_buttons()
379 d->bs.value[0] = DEFAULT_BUTTON_VALUE; in set_buttons()
380 d->bs.nbuttons = 1; in set_buttons()
383 for (i = 0; i < (int)d->bs.nbuttons; i++) { in set_buttons()
384 mbtowc(&first, d->bs.label[i], MB_CUR_MAX); in set_buttons()
385 d->bs.first[i] = first; in set_buttons()
388 if (d->conf->button.default_label != NULL) { in set_buttons()
389 for (i = 0; i < (int)d->bs.nbuttons; i++) { in set_buttons()
390 if (strcmp(d->conf->button.default_label, in set_buttons()
391 d->bs.label[i]) == 0) in set_buttons()
392 d->bs.curr = i; in set_buttons()
396 d->bs.sizebutton = MAX(SIZEBUTTON - 2, strcols(d->bs.label[0])); in set_buttons()
397 for (i = 1; i < (int)d->bs.nbuttons; i++) in set_buttons()
398 d->bs.sizebutton = MAX(d->bs.sizebutton, strcols(d->bs.label[i])); in set_buttons()
399 d->bs.sizebutton += 2; in set_buttons()
408 for (i = 0; i < bs->nbuttons; i++) { in shortcut_buttons()
409 if (towlower(key) == towlower(bs->first[i])) { in shortcut_buttons()
410 bs->curr = i; in shortcut_buttons()
420 * -4- (Auto) Sizing and (Auto) Position
426 maxheight = conf->shadow ? SCREENLINES - (int)t.shadow.y : SCREENLINES; in widget_max_height()
428 RETURN_ERROR("Terminal too small, screen lines - shadow <= 0"); in widget_max_height()
430 if (conf->y != BSDDIALOG_CENTER && conf->auto_topmargin > 0) in widget_max_height()
431 RETURN_ERROR("conf.y > 0 and conf->auto_topmargin > 0"); in widget_max_height()
432 else if (conf->y == BSDDIALOG_CENTER) { in widget_max_height()
433 maxheight -= conf->auto_topmargin; in widget_max_height()
435 RETURN_ERROR("Terminal too small, screen lines - top " in widget_max_height()
437 } else if (conf->y > 0) { in widget_max_height()
438 maxheight -= conf->y; in widget_max_height()
440 RETURN_ERROR("Terminal too small, screen lines - " in widget_max_height()
441 "shadow - y <= 0"); in widget_max_height()
444 maxheight -= conf->auto_downmargin; in widget_max_height()
446 RETURN_ERROR("Terminal too small, screen lines - Down margins " in widget_max_height()
456 maxwidth = conf->shadow ? SCREENCOLS - (int)t.shadow.x : SCREENCOLS; in widget_max_width()
458 RETURN_ERROR("Terminal too small, screen cols - shadow <= 0"); in widget_max_width()
460 if (conf->x > 0) { in widget_max_width()
461 maxwidth -= conf->x; in widget_max_width()
463 RETURN_ERROR("Terminal too small, screen cols - shadow " in widget_max_width()
464 "- x <= 0"); in widget_max_width()
484 #define NL -1
485 #define WS -2
486 #define TB -3
504 tablen = (conf->text.tablen == 0) ? TABSIZE : (int)conf->text.tablen; in text_properties()
507 if ((tp->words = calloc(maxwords, sizeof(int))) == NULL) in text_properties()
513 if ((tp->wletters = calloc(wtextlen, sizeof(uint8_t))) == NULL) in text_properties()
516 tp->nword = 0; in text_properties()
517 tp->maxline = 0; in text_properties()
518 tp->maxwordcols = 0; in text_properties()
519 tp->hasnewline = false; in text_properties()
524 if (conf->text.escape && is_wtext_attr(wtext + i)) { in text_properties()
529 if (tp->nword + 1 >= maxwords) { in text_properties()
531 tp->words = realloc(tp->words, maxwords * sizeof(int)); in text_properties()
532 if (tp->words == NULL) in text_properties()
538 tp->maxwordcols = MAX(wordcols, tp->maxwordcols); in text_properties()
544 tp->words[tp->nword] = wordcols; in text_properties()
545 tp->nword += 1; in text_properties()
554 tp->words[tp->nword] = TB; in text_properties()
558 tp->hasnewline = true; in text_properties()
559 tp->maxline = MAX(tp->maxline, currlinecols); in text_properties()
562 tp->words[tp->nword] = NL; in text_properties()
568 tp->words[tp->nword] = WS; in text_properties()
571 tp->nword += 1; in text_properties()
573 tp->wletters[l] = wcwidth(wtext[i]); in text_properties()
574 wordcols += tp->wletters[l]; in text_properties()
580 tp->words[tp->nword] = wordcols; in text_properties()
581 tp->nword += 1; in text_properties()
582 tp->maxwordcols = MAX(wordcols, tp->maxwordcols); in text_properties()
585 tp->maxline = MAX(tp->maxline, currlinecols); in text_properties()
598 maxwidth = widget_max_width(conf) - BORDERS - TEXTHMARGINS; in text_autosize()
599 tablen = (conf->text.tablen == 0) ? TABSIZE : (int)conf->text.tablen; in text_autosize()
602 mincols = MAX(mincols, tp->maxwordcols); in text_autosize()
604 (int)conf->auto_minwidth - BORDERS - TEXTHMARGINS); in text_autosize()
613 for (i = 0; i < tp->nword; i++) { in text_autosize()
614 switch (tp->words[i]) { in text_autosize()
636 if (tp->words[i] + x <= mincols) { in text_autosize()
637 x += tp->words[i]; in text_autosize()
638 for (z = 0 ; z != tp->words[i]; l++ ) in text_autosize()
639 z += tp->wletters[l]; in text_autosize()
640 } else if (tp->words[i] <= mincols) { in text_autosize()
642 x = tp->words[i]; in text_autosize()
643 for (z = 0 ; z != tp->words[i]; l++ ) in text_autosize()
644 z += tp->wletters[l]; in text_autosize()
646 for (j = tp->words[i]; j > 0; ) { in text_autosize()
650 z += tp->wletters[l]; in text_autosize()
655 j -= z; in text_autosize()
666 if (line >= y * (int)conf->text.cols_per_row && y <= maxrows) in text_autosize()
671 *h = (tp->nword == 0) ? 0 : y; in text_autosize()
686 if (bs->nbuttons > 0) in text_size()
691 maxhtext = widget_max_height(conf) - BORDERS - rowsnotext; in text_size()
693 maxhtext = rows - BORDERS - rowsnotext; in text_size()
695 if (bs->nbuttons > 0) in text_size()
696 maxhtext -= 2; in text_size()
702 startwtext = MAX(startwtext, wbuttons - TEXTHMARGINS); in text_size()
705 startwtext = widget_max_width(conf) - BORDERS - TEXTHMARGINS; in text_size()
708 startwtext = cols - BORDERS - TEXTHMARGINS; in text_size()
720 "needed at least %d cols to draw text", in text_size()
749 min += HBUTTONS; /* buttons and their up-border */ in widget_min_height()
752 min = MAX(min, (int)conf->auto_minheight); in widget_min_height()
767 if (bs->nbuttons > 0) in widget_min_width()
778 if (conf->title != NULL) { in widget_min_width()
780 wtitle = strcols(conf->title); in widget_min_width()
785 if (conf->bottomtitle != NULL) { in widget_min_width()
786 wbottomtitle = strcols(conf->bottomtitle); in widget_min_width()
793 min = MAX(min, (int)conf->auto_minwidth); in widget_min_width()
809 RETURN_ERROR("Negative (less than -1) height"); in set_widget_size()
820 RETURN_ERROR("Negative (less than -1) width"); in set_widget_size()
845 *h = widget_min_height(conf, htext, hnotext, bs->nbuttons > 0); in set_widget_autosize()
862 if (bs->nbuttons > 0) in widget_checksize()
865 RETURN_FMTERROR("Current rows: %d, needed at least: %d", in widget_checksize()
869 if (bs->nbuttons > 0) in widget_checksize()
874 RETURN_FMTERROR("Current cols: %d, nedeed at least %d", in widget_checksize()
883 int hshadow = conf->shadow ? (int)t.shadow.y : 0; in set_widget_position()
884 int wshadow = conf->shadow ? (int)t.shadow.x : 0; in set_widget_position()
886 if (conf->y == BSDDIALOG_CENTER) { in set_widget_position()
887 *y = SCREENLINES/2 - (h + hshadow)/2; in set_widget_position()
888 if (*y < (int)conf->auto_topmargin) in set_widget_position()
889 *y = conf->auto_topmargin; in set_widget_position()
890 if (*y + h + hshadow > SCREENLINES - (int)conf->auto_downmargin) in set_widget_position()
891 *y = SCREENLINES - h - hshadow - conf->auto_downmargin; in set_widget_position()
893 else if (conf->y < BSDDIALOG_CENTER) in set_widget_position()
894 RETURN_ERROR("Negative begin y (less than -1)"); in set_widget_position()
895 else if (conf->y >= SCREENLINES) in set_widget_position()
898 *y = conf->y; in set_widget_position()
905 if (conf->x == BSDDIALOG_CENTER) in set_widget_position()
906 *x = SCREENCOLS/2 - (w + wshadow)/2; in set_widget_position()
907 else if (conf->x < BSDDIALOG_CENTER) in set_widget_position()
908 RETURN_ERROR("Negative begin x (less than -1)"); in set_widget_position()
909 else if (conf->x >= SCREENCOLS) in set_widget_position()
912 *x = conf->x; in set_widget_position()
921 int dialog_size_position(struct dialog *d, int hnotext, int minw, int *htext) in dialog_size_position() argument
923 if (set_widget_size(d->conf, d->rows, d->cols, &d->h, &d->w) != 0) in dialog_size_position()
925 if (set_widget_autosize(d->conf, d->rows, d->cols, &d->h, &d->w, in dialog_size_position()
926 d->text, htext, &d->bs, hnotext, minw) != 0) in dialog_size_position()
928 if (widget_checksize(d->h, d->w, &d->bs, hnotext, minw) != 0) in dialog_size_position()
930 if (set_widget_position(d->conf, &d->y, &d->x, d->h, d->w) != 0) in dialog_size_position()
937 * -5- Widget components and utilities
939 int hide_dialog(struct dialog *d) in hide_dialog() argument
943 if ((clear = newwin(d->h, d->w, d->y, d->x)) == NULL) in hide_dialog()
948 if (d->conf->shadow) { in hide_dialog()
949 mvwin(clear, d->y + t.shadow.y, d->x + t.shadow.x); in hide_dialog()
967 hconf.ascii_lines = conf->ascii_lines; in f1help_dialog()
968 hconf.no_lines = conf->no_lines; in f1help_dialog()
969 hconf.shadow = conf->shadow; in f1help_dialog()
970 hconf.text.escape = conf->text.escape; in f1help_dialog()
973 if (conf->key.f1_message != NULL) in f1help_dialog()
974 output = bsddialog_msgbox(&hconf, conf->key.f1_message, 0, 0); in f1help_dialog()
976 if (output != BSDDIALOG_ERROR && conf->key.f1_file != NULL) in f1help_dialog()
977 output = bsddialog_textbox(&hconf, conf->key.f1_file, 0, 0); in f1help_dialog()
989 if (conf->no_lines) in draw_borders()
992 if (conf->ascii_lines) { in draw_borders()
995 setcchar(&vline, L"-", 0, 0, NULL); in draw_borders()
1019 mvwadd_wch(win, 0, w-1, tr); in draw_borders()
1020 mvwvline_set(win, 1, w-1, rs, h-2); in draw_borders()
1021 mvwadd_wch(win, h-1, w-1, br); in draw_borders()
1022 mvwhline_set(win, h-1, 1, bs, w-2); in draw_borders()
1037 rtextpad(struct dialog *d, int ytext, int xtext, int upnotext, int downnotext) in rtextpad() argument
1039 pnoutrefresh(d->textpad, ytext, xtext, in rtextpad()
1040 d->y + BORDER + upnotext, in rtextpad()
1041 d->x + BORDER + TEXTHMARGIN, in rtextpad()
1042 d->y + d->h - 1 - downnotext - BORDER, in rtextpad()
1043 d->x + d->w - TEXTHMARGIN - BORDER); in rtextpad()
1047 * -6- Dialog init/build, update/draw, destroy
1049 void end_dialog(struct dialog *d) in end_dialog() argument
1051 if (d->conf->sleep > 0) in end_dialog()
1052 sleep(d->conf->sleep); in end_dialog()
1054 delwin(d->textpad); in end_dialog()
1055 delwin(d->widget); in end_dialog()
1056 if (d->conf->shadow) in end_dialog()
1057 delwin(d->shadow); in end_dialog()
1059 if (d->conf->clear) in end_dialog()
1060 hide_dialog(d); in end_dialog()
1062 if (d->conf->get_height != NULL) in end_dialog()
1063 *d->conf->get_height = d->h; in end_dialog()
1064 if (d->conf->get_width != NULL) in end_dialog()
1065 *d->conf->get_width = d->w; in end_dialog()
1077 wattron(win, bsddialog_color(wtext[2] - L'0', bg, 0)); in check_set_wtext_attr()
1092 case L'd': in check_set_wtext_attr()
1095 case L'D': in check_set_wtext_attr()
1175 strwidth -= charwidth; in print_string()
1197 tablen = (conf->text.tablen == 0) ? TABSIZE : (int)conf->text.tablen; in print_textpad()
1207 conf->text.escape); in print_textpad()
1217 j = -1; in print_textpad()
1227 j = -1; in print_textpad()
1235 j = -1; in print_textpad()
1253 int draw_dialog(struct dialog *d) in draw_dialog() argument
1258 if (d->conf->ascii_lines) { in draw_dialog()
1259 setcchar(&ts, L"-", 0, 0, NULL); in draw_dialog()
1268 if (d->conf->shadow) { in draw_dialog()
1269 wclear(d->shadow); in draw_dialog()
1270 wresize(d->shadow, d->h, d->w); in draw_dialog()
1271 mvwin(d->shadow, d->y + t.shadow.y, d->x + t.shadow.x); in draw_dialog()
1272 wnoutrefresh(d->shadow); in draw_dialog()
1275 wclear(d->widget); in draw_dialog()
1276 wresize(d->widget, d->h, d->w); in draw_dialog()
1277 mvwin(d->widget, d->y, d->x); in draw_dialog()
1278 draw_borders(d->conf, d->widget, RAISED); in draw_dialog()
1280 if (d->conf->title != NULL) { in draw_dialog()
1281 if ((wtitle = strcols(d->conf->title)) < 0) in draw_dialog()
1283 if (t.dialog.delimtitle && d->conf->no_lines == false) { in draw_dialog()
1284 wattron(d->widget, t.dialog.lineraisecolor); in draw_dialog()
1285 mvwadd_wch(d->widget, 0, d->w/2 - wtitle/2 -1, &rtee); in draw_dialog()
1286 wattroff(d->widget, t.dialog.lineraisecolor); in draw_dialog()
1288 wattron(d->widget, t.dialog.titlecolor); in draw_dialog()
1289 mvwaddstr(d->widget, 0, d->w/2 - wtitle/2, d->conf->title); in draw_dialog()
1290 wattroff(d->widget, t.dialog.titlecolor); in draw_dialog()
1291 if (t.dialog.delimtitle && d->conf->no_lines == false) { in draw_dialog()
1292 wattron(d->widget, t.dialog.lineraisecolor); in draw_dialog()
1293 wadd_wch(d->widget, &ltee); in draw_dialog()
1294 wattroff(d->widget, t.dialog.lineraisecolor); in draw_dialog()
1298 if (d->bs.nbuttons > 0) { in draw_dialog()
1299 if (d->conf->no_lines == false) { in draw_dialog()
1300 wattron(d->widget, t.dialog.lineraisecolor); in draw_dialog()
1301 mvwadd_wch(d->widget, d->h-3, 0, &ltee); in draw_dialog()
1302 mvwhline_set(d->widget, d->h-3, 1, &ts, d->w-2); in draw_dialog()
1303 wattroff(d->widget, t.dialog.lineraisecolor); in draw_dialog()
1305 wattron(d->widget, t.dialog.linelowercolor); in draw_dialog()
1306 mvwadd_wch(d->widget, d->h-3, d->w-1, &rtee); in draw_dialog()
1307 wattroff(d->widget, t.dialog.linelowercolor); in draw_dialog()
1309 draw_buttons(d); in draw_dialog()
1312 if (d->conf->bottomtitle != NULL) { in draw_dialog()
1313 if ((wbottomtitle = strcols(d->conf->bottomtitle)) < 0) in draw_dialog()
1315 wattron(d->widget, t.dialog.bottomtitlecolor); in draw_dialog()
1316 wmove(d->widget, d->h - 1, d->w/2 - wbottomtitle/2 - 1); in draw_dialog()
1317 waddch(d->widget, ' '); in draw_dialog()
1318 waddstr(d->widget, d->conf->bottomtitle); in draw_dialog()
1319 waddch(d->widget, ' '); in draw_dialog()
1320 wattroff(d->widget, t.dialog.bottomtitlecolor); in draw_dialog()
1323 wnoutrefresh(d->widget); in draw_dialog()
1325 wclear(d->textpad); in draw_dialog()
1327 wresize(d->textpad, 1, d->w - BORDERS - TEXTHMARGINS); in draw_dialog()
1329 if (print_textpad(d->conf, d->textpad, d->text) != 0) in draw_dialog()
1332 d->built = true; in draw_dialog()
1339 int cols, struct dialog *d) in prepare_dialog() argument
1343 d->built = false; in prepare_dialog()
1344 d->conf = conf; in prepare_dialog()
1345 d->rows = rows; in prepare_dialog()
1346 d->cols = cols; in prepare_dialog()
1347 d->text = CHECK_STR(text); in prepare_dialog()
1348 d->bs.nbuttons = 0; in prepare_dialog()
1350 if (d->conf->shadow) { in prepare_dialog()
1351 if ((d->shadow = newwin(1, 1, 1, 1)) == NULL) in prepare_dialog()
1353 wbkgd(d->shadow, t.shadow.color); in prepare_dialog()
1356 if ((d->widget = newwin(1, 1, 1, 1)) == NULL) in prepare_dialog()
1358 wbkgd(d->widget, t.dialog.color); in prepare_dialog()
1361 if ((d->textpad = newpad(1, 1)) == NULL) in prepare_dialog()
1363 wbkgd(d->textpad, t.dialog.color); in prepare_dialog()