- newscr->_clear = TRUE;
- curscr->_clear = FALSE;
-
- def_shell_mode();
- def_prog_mode();
-
- for (i = 0, rsp = rippedoff; rsp->line && (i < (int) N_RIPS); rsp++, i++) {
- T(("ripping off line %d at %s", i, rsp->line < 0 ? "bottom" : "top"));
- SP->_rippedoff[i] = rippedoff[i];
- if (rsp->hook) {
- int count = (rsp->line < 0) ? -rsp->line : rsp->line;
-
- SP->_rippedoff[i].w = newwin(count,
- scolumns,
- ((rsp->line < 0)
- ? SP->_lines_avail - count
- : 0),
- 0);
- if (SP->_rippedoff[i].w != 0)
- SP->_rippedoff[i].hook(SP->_rippedoff[i].w, scolumns);
- else
- returnCode(ERR);
- if (rsp->line < 0)
- bottom_stolen += count;
- else
- SP->_topstolen += count;
- SP->_lines_avail -= count;
+ NewScreen(sp)->_clear = TRUE;
+ CurScreen(sp)->_clear = FALSE;
+
+ NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
+ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
+
+ if (safe_ripoff_sp && safe_ripoff_sp != safe_ripoff_stack) {
+ for (rop = safe_ripoff_stack;
+ rop != safe_ripoff_sp && (rop - safe_ripoff_stack) < N_RIPS;
+ rop++) {
+
+ /* If we must simulate soft labels, grab off the line to be used.
+ We assume that we must simulate, if it is none of the standard
+ formats (4-4 or 3-2-3) for which there may be some hardware
+ support. */
+ if (rop->hook == _nc_slk_initialize) {
+ if (!(NumLabels <= 0 || !SLK_STDFMT(slk_format))) {
+ continue;
+ }
+ }
+ if (rop->hook) {
+ int count;
+ WINDOW *w;
+
+ count = (rop->line < 0) ? -rop->line : rop->line;
+ T(("ripping off %i lines at %s", count,
+ ((rop->line < 0)
+ ? "bottom"
+ : "top")));
+
+ w = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+ count, scolumns,
+ ((rop->line < 0)
+ ? sp->_lines_avail - count
+ : 0),
+ 0);
+ if (w) {
+ rop->win = w;
+ rop->hook(w, scolumns);
+ } else {
+ ReturnScreenError();
+ }
+ if (rop->line < 0) {
+ bottom_stolen += count;
+ } else {
+ sp->_topstolen = (NCURSES_SIZE_T) (sp->_topstolen + count);
+ }
+ sp->_lines_avail = (NCURSES_SIZE_T) (sp->_lines_avail - count);
+ }