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.401 by sf-exg, Tue Nov 15 18:20:38 2011 UTC vs.
Revision 1.408 by sf-exg, Thu Nov 17 10:43:16 2011 UTC

549 return; 549 return;
550 550
551 want_refresh = 1; 551 want_refresh = 1;
552 view_start = 0; 552 view_start = 0;
553 553
554 selection_check (2); /* check for boundary cross */ 554 /* check for boundary cross */
555 row_col_t pos;
556 pos.row = pos.col = 0;
557 if (ROWCOL_IS_BEFORE (selection.beg, pos)
558 && ROWCOL_IS_AFTER (selection.end, pos))
559 CLEAR_SELECTION ();
555 560
556 current_screen = scrn; 561 current_screen = scrn;
557 562
558#if NSCREENS 563#if NSCREENS
559 if (option (Opt_secondaryScreen)) 564 if (option (Opt_secondaryScreen))
683 scr_blank_screen_mem (l, rstyle); 688 scr_blank_screen_mem (l, rstyle);
684 } 689 }
685 690
686 // move and/or clear selection, if any 691 // move and/or clear selection, if any
687 if (selection.op && current_screen == selection.screen 692 if (selection.op && current_screen == selection.screen
688 && selection.beg.row < row2) 693 && selection.beg.row <= row2)
689 { 694 {
690 selection.beg.row -= count; 695 selection.beg.row -= count;
691 selection.end.row -= count; 696 selection.end.row -= count;
692 selection.mark.row -= count; 697 selection.mark.row -= count;
693 698
775rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW 780rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW
776{ 781{
777 if (len <= 0) /* sanity */ 782 if (len <= 0) /* sanity */
778 return; 783 return;
779 784
780 unsigned char checksel; 785 bool checksel;
781 unicode_t c; 786 unicode_t c;
782 int ncol = this->ncol; 787 int ncol = this->ncol;
783 const wchar_t *strend = str + len; 788 const wchar_t *strend = str + len;
784 789
785 want_refresh = 1; 790 want_refresh = 1;
1307 scr_blank_line (line, col, num, rstyle); 1312 scr_blank_line (line, col, num, rstyle);
1308} 1313}
1309 1314
1310/* ------------------------------------------------------------------------- */ 1315/* ------------------------------------------------------------------------- */
1311/* 1316/*
1312 * Erase part of whole of the screen 1317 * Erase part or whole of the screen
1313 * XTERM_SEQ: Clear screen after cursor : ESC [ 0 J 1318 * XTERM_SEQ: Clear screen after cursor : ESC [ 0 J
1314 * XTERM_SEQ: Clear screen before cursor: ESC [ 1 J 1319 * XTERM_SEQ: Clear screen before cursor: ESC [ 1 J
1315 * XTERM_SEQ: Clear whole screen : ESC [ 2 J 1320 * XTERM_SEQ: Clear whole screen : ESC [ 2 J
1316 */ 1321 */
1317void 1322void
1326 ZERO_SCROLLBACK (); 1331 ZERO_SCROLLBACK ();
1327 1332
1328 switch (mode) 1333 switch (mode)
1329 { 1334 {
1330 case 0: /* erase to end of screen */ 1335 case 0: /* erase to end of screen */
1331 selection_check (1);
1332 scr_erase_line (0); 1336 scr_erase_line (0);
1333 row = screen.cur.row + 1; /* possible OOB */ 1337 row = screen.cur.row + 1; /* possible OOB */
1334 num = nrow - row; 1338 num = nrow - row;
1335 break; 1339 break;
1336 case 1: /* erase to beginning of screen */ 1340 case 1: /* erase to beginning of screen */
1337 selection_check (3);
1338 scr_erase_line (1); 1341 scr_erase_line (1);
1339 row = 0; 1342 row = 0;
1340 num = screen.cur.row; 1343 num = screen.cur.row;
1341 break; 1344 break;
1342 case 2: /* erase whole screen */ 1345 case 2: /* erase whole screen */
1343 selection_check (3);
1344 row = 0; 1346 row = 0;
1345 num = nrow; 1347 num = nrow;
1346 break; 1348 break;
1347 default: 1349 default:
1348 return; 1350 return;
1419 1421
1420 want_refresh = 1; 1422 want_refresh = 1;
1421 ZERO_SCROLLBACK (); 1423 ZERO_SCROLLBACK ();
1422 1424
1423 num_scr_allow = 0; 1425 num_scr_allow = 0;
1424 selection_check (3); 1426
1427 row_col_t pos;
1428 pos.row = pos.col = 0;
1429 if (ROWCOL_IS_AFTER (selection.end, pos))
1430 CLEAR_SELECTION ();
1425 1431
1426 fs = SET_FONT (rstyle, FONTSET (rstyle)->find_font ('E')); 1432 fs = SET_FONT (rstyle, FONTSET (rstyle)->find_font ('E'));
1427 for (int row = nrow; row--; ) 1433 for (int row = nrow; row--; )
1428 { 1434 {
1429 line_t &line = ROW(row); 1435 line_t &line = ROW(row);
2042 * A: set up vars 2048 * A: set up vars
2043 */ 2049 */
2044 refresh_count = 0; 2050 refresh_count = 0;
2045 2051
2046 unsigned int old_screen_flags = screen.flags; 2052 unsigned int old_screen_flags = screen.flags;
2047 char have_bg = 0; 2053 bool have_bg = 0;
2048#ifdef HAVE_BG_PIXMAP 2054#ifdef HAVE_BG_PIXMAP
2049 have_bg = bg_pixmap != None; 2055 have_bg = bg_pixmap != None;
2050#endif 2056#endif
2051 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ 2057 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
2052 2058
2058 HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); 2064 HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END));
2059#if ENABLE_OVERLAY 2065#if ENABLE_OVERLAY
2060 scr_swap_overlay (); 2066 scr_swap_overlay ();
2061#endif 2067#endif
2062 2068
2063 char showcursor = screen.flags & Screen_VisibleCursor; 2069 bool showcursor = screen.flags & Screen_VisibleCursor;
2064 2070
2065 /* 2071 /*
2066 * C: set the cursor character (s) 2072 * C: set the cursor character (s)
2067 */ 2073 */
2068 { 2074 {
2069 unsigned char setoldcursor; 2075 bool setoldcursor;
2070 2076
2071#ifdef CURSOR_BLINK 2077#ifdef CURSOR_BLINK
2072 if (hidden_cursor) 2078 if (hidden_cursor)
2073 showcursor = 0; 2079 showcursor = 0;
2074#endif 2080#endif
2694rxvt_term::selection_check (int check_more) NOTHROW 2700rxvt_term::selection_check (int check_more) NOTHROW
2695{ 2701{
2696 if (!selection.op) 2702 if (!selection.op)
2697 return; 2703 return;
2698 2704
2699 row_col_t pos;
2700 pos.row = pos.col = 0;
2701
2702 if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) 2705 if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow)
2703 || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) 2706 || !IN_RANGE_EXC (selection.mark.row, top_row, nrow)
2704 || !IN_RANGE_EXC (selection.end.row, top_row, nrow) 2707 || !IN_RANGE_EXC (selection.end.row, top_row, nrow)
2705 || (check_more == 1 2708 || (check_more == 1
2706 && current_screen == selection.screen 2709 && current_screen == selection.screen
2707 && !ROWCOL_IS_BEFORE (screen.cur, selection.beg) 2710 && !ROWCOL_IS_BEFORE (screen.cur, selection.beg)
2708 && ROWCOL_IS_BEFORE (screen.cur, selection.end)) 2711 && ROWCOL_IS_BEFORE (screen.cur, selection.end)))
2709 || (check_more == 2
2710 && ROWCOL_IS_BEFORE (selection.beg, pos)
2711 && ROWCOL_IS_AFTER (selection.end, pos))
2712 || (check_more == 3
2713 && ROWCOL_IS_AFTER (selection.end, pos)))
2714 CLEAR_ALL_SELECTION (); 2712 CLEAR_ALL_SELECTION ();
2715} 2713}
2716 2714
2717/* ------------------------------------------------------------------------- */ 2715/* ------------------------------------------------------------------------- */
2718/* 2716/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines