… | |
… | |
158 | * ------------------------------------------------------------------------- */ |
158 | * ------------------------------------------------------------------------- */ |
159 | |
159 | |
160 | void |
160 | void |
161 | rxvt_term::scr_reset () |
161 | rxvt_term::scr_reset () |
162 | { |
162 | { |
163 | #if ENABLE_OVERLAY |
163 | scr_soft_reset (); |
164 | scr_overlay_off (); |
|
|
165 | #endif |
|
|
166 | |
|
|
167 | rvideo_mode = false; |
|
|
168 | view_start = 0; |
164 | view_start = 0; |
|
|
165 | |
169 | num_scr = 0; |
166 | num_scr = 0; |
170 | |
167 | |
171 | if (ncol == 0) |
168 | if (ncol == 0) |
172 | ncol = 80; |
169 | ncol = 80; |
173 | |
170 | |
174 | if (nrow == 0) |
171 | if (nrow == 0) |
175 | nrow = 24; |
172 | nrow = 24; |
176 | |
173 | |
177 | if (ncol == prev_ncol && nrow == prev_nrow) |
174 | if (ncol == prev_ncol && nrow == prev_nrow) |
178 | return; |
175 | return; |
179 | |
|
|
180 | if (current_screen != PRIMARY) |
|
|
181 | scr_swap_screen (); |
|
|
182 | |
176 | |
183 | // we need at least two lines for wrapping to work correctly |
177 | // we need at least two lines for wrapping to work correctly |
184 | while (nrow + saveLines < 2) |
178 | while (nrow + saveLines < 2) |
185 | { |
179 | { |
186 | //TODO//FIXME |
180 | //TODO//FIXME |
… | |
… | |
399 | delete old_ta; |
393 | delete old_ta; |
400 | delete old_ra; |
394 | delete old_ra; |
401 | |
395 | |
402 | clamp_it (screen.cur.row, 0, nrow - 1); |
396 | clamp_it (screen.cur.row, 0, nrow - 1); |
403 | clamp_it (screen.cur.col, 0, ncol - 1); |
397 | clamp_it (screen.cur.col, 0, ncol - 1); |
404 | |
|
|
405 | free (tabs); |
|
|
406 | } |
398 | } |
407 | |
399 | |
408 | CLEAR_ALL_SELECTION (); |
400 | CLEAR_ALL_SELECTION (); |
409 | |
401 | |
410 | prev_nrow = nrow; |
402 | prev_nrow = nrow; |
411 | prev_ncol = ncol; |
403 | prev_ncol = ncol; |
412 | |
|
|
413 | tabs = (char *)rxvt_malloc (ncol); |
|
|
414 | |
|
|
415 | for (int col = ncol; --col; ) |
|
|
416 | tabs [col] = col % TABSIZE == 0; |
|
|
417 | |
|
|
418 | if (current_screen != PRIMARY) |
|
|
419 | scr_swap_screen (); |
|
|
420 | |
404 | |
421 | tt_winch (); |
405 | tt_winch (); |
422 | |
406 | |
423 | HOOK_INVOKE ((this, HOOK_RESET, DT_END)); |
407 | HOOK_INVOKE ((this, HOOK_RESET, DT_END)); |
424 | } |
408 | } |
… | |
… | |
436 | delete ralloc; ralloc = 0; |
420 | delete ralloc; ralloc = 0; |
437 | |
421 | |
438 | free (row_buf); |
422 | free (row_buf); |
439 | free (swap_buf); |
423 | free (swap_buf); |
440 | free (drawn_buf); |
424 | free (drawn_buf); |
|
|
425 | row_buf = 0; // signal that we freed all the arrays above |
|
|
426 | |
441 | free (tabs); |
427 | free (tabs); |
442 | |
428 | tabs = 0; |
443 | row_buf = 0; // signal that we freed all the arrays |
|
|
444 | } |
429 | } |
445 | } |
430 | } |
446 | |
431 | |
447 | /* ------------------------------------------------------------------------- */ |
432 | /* ------------------------------------------------------------------------- */ |
448 | /* |
433 | /* |
449 | * Hard reset |
434 | * Hard/Soft reset |
450 | */ |
435 | */ |
451 | void |
436 | void |
452 | rxvt_term::scr_poweron () |
437 | rxvt_term::scr_poweron () |
453 | { |
438 | { |
454 | scr_release (); |
439 | scr_release (); |
455 | prev_nrow = prev_ncol = 0; |
440 | prev_nrow = prev_ncol = 0; |
456 | scr_reset (); |
441 | scr_reset (); |
457 | |
442 | |
458 | scr_clear (true); |
443 | scr_clear (true); |
459 | scr_refresh (); |
444 | scr_refresh (); |
|
|
445 | } |
|
|
446 | |
|
|
447 | void |
|
|
448 | rxvt_term::scr_soft_reset () |
|
|
449 | { |
|
|
450 | /* only affects modes, nothing drastic such as clearing the screen */ |
|
|
451 | #if ENABLE_OVERLAY |
|
|
452 | scr_overlay_off (); |
|
|
453 | #endif |
|
|
454 | |
|
|
455 | rvideo_mode = false; |
|
|
456 | |
|
|
457 | if (current_screen != PRIMARY) |
|
|
458 | scr_swap_screen (); |
|
|
459 | |
|
|
460 | free (tabs); |
|
|
461 | tabs = (char *)rxvt_malloc (ncol); |
|
|
462 | |
|
|
463 | for (int col = ncol; --col; ) |
|
|
464 | tabs [col] = col % TABSIZE == 0; |
|
|
465 | |
|
|
466 | scr_scroll_region (0, MAX_ROWS - 1); |
|
|
467 | scr_rendition (0, ~RS_None); |
|
|
468 | scr_insert_mode (0); |
460 | } |
469 | } |
461 | |
470 | |
462 | /* ------------------------------------------------------------------------- * |
471 | /* ------------------------------------------------------------------------- * |
463 | * PROCESS SCREEN COMMANDS * |
472 | * PROCESS SCREEN COMMANDS * |
464 | * ------------------------------------------------------------------------- */ |
473 | * ------------------------------------------------------------------------- */ |