del_r_window() { #ifdef HAS_INTERP if( !(work_debug(curr_workspace) & DBF_ON) ) error( ER(180,"nodebug`Debug window does not exist") ); work_debug(curr_workspace) = 0; delwin( curr_window->out_split ); delwin( curr_window->w_desc ); delwin( curWindows[CMDWIN] ); curr_window->w_desc = curWindows[MAINWIN] = savemain; curr_window->out_split = (WINDOW *)0; curWindows[EXTRAWIN] = (WINDOW *)0; curWindows[CMDWIN] = savecmd; redrw_screen(TRUE); #endif HAS_INTERP }
imm_ws() { register nodep wtop; cursor = work_node(curr_workspace); dec_block( N_IMM_BLOCK ); cursor = realcp( kid2((wtop = work_node(curr_workspace))) ); work_scursor(curr_workspace) = wtop; work_debug(curr_workspace) = 0; #ifdef GEM do_gdupdate(); #endif prep_r_window(); /* setup for debug */ }
/* setup pg_out window to get ready to run */ prep_to_run() { #ifdef HAS_INTERP if( work_debug(curr_workspace) & DBF_ON ) { change_pg_out(work_owindow(curr_workspace)); printt1( "Setting program output to window %x\n", pg_out ); } else { change_pg_out(curWindows[MAINWIN]); werase( pg_out ); wmove( pg_out, 0, 0); printt0( "Using main win for program output\n" ); wrefresh( pg_out ); } scrollok( pg_out, TRUE ); curOff( pg_out ); #endif HAS_INTERP }
init_ws() { #ifndef GEM extern alice_window main_win; curr_window = &main_win; #endif curr_workspace = ws_list = Tptr(main_ws); #ifndef GEM main_win.wspace = curr_workspace; #endif linkup( curr_workspace, 0, make_stub( C_ROOT ) ); work_name(curr_workspace) = "main"; work_debug( curr_workspace ) = 0; #ifdef GEM do_gdupdate(); #endif printt1( "Initialize workspaces - main_ws is %x\n", Tptr(main_ws) ); /* an init_pwork will be done later if we decide to clip */ }
prep_r_window() { #ifdef HAS_INTERP int cwlines; register int newlines; int statrows; /* how many rows for status lines */ WINDOW *newerr, *newedit, *newout, *newcmd; if( work_debug(curr_workspace) & DBF_ON ) return 0; /* already set up */ #ifdef Notdef /* This code is for a fancier windowing system with an output window always present */ if( curr_window->out_split ) { work_owindow(curr_workspace) = curr_window->out_split; work_debug(curr_workspace) |= DBF_ON; return; } #endif SaveLines = cwlines = curr_window->w_height; newlines = ( cwlines * 2 ) / 3; statrows = COLS < 64 ? 2 : 1; if( newlines < 3 ) error(ER(179,"noroom`Not enough room to set up program output window")); savemain = curWindows[MAINWIN]; savecmd = curWindows[CMDWIN]; /* * clear the entire screen, so that we can recreate the windows in * new positions */ /* (is thes needed?) wclear( stdscr ); wrefresh( stdscr ); */ #ifdef ICON_WIN_MGR newerr = pnewwin( statrows, curr_window->w_width, (1+DEMO_BORD)*BORDER_WIDTH+DEMO_LINES*CHAR_HEIGHT, CHAR_WIDTH/2 - 1, FALSE); newedit = pnewwin( newlines, curr_window->w_width, (statrows+DEMO_LINES)*CHAR_HEIGHT + (3+DEMO_BORD)*BORDER_WIDTH, CHAR_WIDTH/2 - 1, TRUE ); newcmd = pnewwin( statrows, curr_window->w_width, (newlines + statrows + DEMO_LINES)*CHAR_HEIGHT + (6+DEMO_BORD)*BORDER_WIDTH, CHAR_WIDTH/2 - 1, FALSE ); newout = pnewwin( cwlines - newlines, curr_window->w_width, (newlines+2*statrows+DEMO_LINES)*CHAR_HEIGHT+(9+DEMO_BORD)*BORDER_WIDTH, CHAR_WIDTH/2 - 1, FALSE ); #else newerr = subwin( stdscr, statrows, curr_window->w_width, DEMO_LINES, savemain->_begx ); curOff( newerr ); newedit = subwin( stdscr, newlines, curr_window->w_width, savemain->_begy, savemain->_begx); newcmd = subwin( stdscr, statrows, curr_window->w_width, savemain->_begy + newlines, savemain->_begx); newout = subwin( stdscr, cwlines - newlines, curr_window->w_width, savemain->_begy + newlines + statrows, savemain->_begx); curOff( newcmd ); #endif ICON_WIN_MGR printt2( "New editor window %d high, %d wide\n", newlines, curr_window->w_width ); work_debug(curr_workspace) |= DBF_ON; dmfree(curr_window->w_lines); setwlines(curr_window, newlines ); delwin( curWindows[ERRWIN] ); curWindows[CMDWIN] = newcmd; curWindows[ERRWIN] = newerr; curWindows[MAINWIN] = curr_window->w_desc = newedit; curWindows[EXTRAWIN] = work_owindow(curr_workspace) = curr_window->out_split = newout; wclear(newout); wrefresh(newout); show_whole_doda(); #endif HAS_INTERP }