ARGSUSED*/
| 1852 | |
| 1853 | /*ARGSUSED*/ |
| 1854 | void |
| 1855 | tty_display_nhwindow( |
| 1856 | winid window, |
| 1857 | boolean blocking) /* with ttys, all windows are blocking */ |
| 1858 | { |
| 1859 | struct WinDesc *cw = 0; |
| 1860 | short s_maxcol; |
| 1861 | |
| 1862 | HUPSKIP(); |
| 1863 | if (window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) |
| 1864 | ttywindowpanic(); |
| 1865 | if (cw->flags & WIN_CANCELLED) |
| 1866 | return; |
| 1867 | ttyDisplay->lastwin = window; |
| 1868 | ttyDisplay->rawprint = 0; |
| 1869 | |
| 1870 | print_vt_code2(AVTC_SELECT_WINDOW, window); |
| 1871 | |
| 1872 | switch (cw->type) { |
| 1873 | case NHW_MESSAGE: |
| 1874 | if (ttyDisplay->toplin == TOPLINE_NEED_MORE) { |
| 1875 | more(); |
| 1876 | ttyDisplay->toplin = TOPLINE_NEED_MORE; /* more resets this */ |
| 1877 | tty_clear_nhwindow(window); |
| 1878 | nhassert(ttyDisplay->toplin == TOPLINE_EMPTY); |
| 1879 | } else |
| 1880 | ttyDisplay->toplin = TOPLINE_EMPTY; |
| 1881 | cw->curx = cw->cury = 0; |
| 1882 | if (!cw->active) |
| 1883 | iflags.window_inited = TRUE; |
| 1884 | break; |
| 1885 | case NHW_MAP: |
| 1886 | end_glyphout(); |
| 1887 | if (blocking) { |
| 1888 | if (ttyDisplay->toplin != TOPLINE_EMPTY) |
| 1889 | ttyDisplay->toplin = TOPLINE_NEED_MORE; |
| 1890 | tty_display_nhwindow(WIN_MESSAGE, TRUE); |
| 1891 | return; |
| 1892 | } |
| 1893 | FALLTHROUGH; |
| 1894 | /*FALLTHRU*/ |
| 1895 | case NHW_BASE: |
| 1896 | (void) fflush(stdout); |
| 1897 | break; |
| 1898 | case NHW_TEXT: |
| 1899 | cw->maxcol = ttyDisplay->cols; /* force full-screen mode */ |
| 1900 | FALLTHROUGH; |
| 1901 | /*FALLTHRU*/ |
| 1902 | case NHW_MENU: |
| 1903 | cw->active = 1; |
| 1904 | /* cw->maxcol is a long, but its value is constrained to |
| 1905 | be <= ttyDisplay->cols, so is sure to fit within a short */ |
| 1906 | s_maxcol = (short) cw->maxcol; |
| 1907 | #ifdef H2344_BROKEN |
| 1908 | cw->offx = (cw->type == NHW_TEXT) |
| 1909 | ? 0 |
| 1910 | : min(min(82, ttyDisplay->cols / 2), |
| 1911 | ttyDisplay->cols - s_maxcol - 1); |
no test coverage detected