ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.317 by root, Tue Nov 4 15:09:51 2008 UTC vs.
Revision 1.318 by root, Tue Nov 4 22:44:09 2008 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines