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.396 by root, Wed Nov 2 10:53:12 2011 UTC vs.
Revision 1.410 by sf-exg, Thu Nov 24 18:09:54 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))
682 else 687 else
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
693 && selection.beg.row <= row2)
688 { 694 {
689 selection.beg.row -= count; 695 selection.beg.row -= count;
690 selection.end.row -= count; 696 selection.end.row -= count;
691 selection.mark.row -= count; 697 selection.mark.row -= count;
692 698
774rxvt_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
775{ 781{
776 if (len <= 0) /* sanity */ 782 if (len <= 0) /* sanity */
777 return; 783 return;
778 784
779 unsigned char checksel; 785 bool checksel;
780 unicode_t c; 786 unicode_t c;
781 int ncol = this->ncol; 787 int ncol = this->ncol;
782 const wchar_t *strend = str + len; 788 const wchar_t *strend = str + len;
783 789
784 want_refresh = 1; 790 want_refresh = 1;
1306 scr_blank_line (line, col, num, rstyle); 1312 scr_blank_line (line, col, num, rstyle);
1307} 1313}
1308 1314
1309/* ------------------------------------------------------------------------- */ 1315/* ------------------------------------------------------------------------- */
1310/* 1316/*
1311 * Erase part of whole of the screen 1317 * Erase part or whole of the screen
1312 * XTERM_SEQ: Clear screen after cursor : ESC [ 0 J 1318 * XTERM_SEQ: Clear screen after cursor : ESC [ 0 J
1313 * XTERM_SEQ: Clear screen before cursor: ESC [ 1 J 1319 * XTERM_SEQ: Clear screen before cursor: ESC [ 1 J
1314 * XTERM_SEQ: Clear whole screen : ESC [ 2 J 1320 * XTERM_SEQ: Clear whole screen : ESC [ 2 J
1315 */ 1321 */
1316void 1322void
1325 ZERO_SCROLLBACK (); 1331 ZERO_SCROLLBACK ();
1326 1332
1327 switch (mode) 1333 switch (mode)
1328 { 1334 {
1329 case 0: /* erase to end of screen */ 1335 case 0: /* erase to end of screen */
1330 selection_check (1);
1331 scr_erase_line (0); 1336 scr_erase_line (0);
1332 row = screen.cur.row + 1; /* possible OOB */ 1337 row = screen.cur.row + 1; /* possible OOB */
1333 num = nrow - row; 1338 num = nrow - row;
1334 break; 1339 break;
1335 case 1: /* erase to beginning of screen */ 1340 case 1: /* erase to beginning of screen */
1336 selection_check (3);
1337 scr_erase_line (1); 1341 scr_erase_line (1);
1338 row = 0; 1342 row = 0;
1339 num = screen.cur.row; 1343 num = screen.cur.row;
1340 break; 1344 break;
1341 case 2: /* erase whole screen */ 1345 case 2: /* erase whole screen */
1342 selection_check (3);
1343 row = 0; 1346 row = 0;
1344 num = nrow; 1347 num = nrow;
1345 break; 1348 break;
1346 default: 1349 default:
1347 return; 1350 return;
1418 1421
1419 want_refresh = 1; 1422 want_refresh = 1;
1420 ZERO_SCROLLBACK (); 1423 ZERO_SCROLLBACK ();
1421 1424
1422 num_scr_allow = 0; 1425 num_scr_allow = 0;
1423 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 ();
1424 1431
1425 fs = SET_FONT (rstyle, FONTSET (rstyle)->find_font ('E')); 1432 fs = SET_FONT (rstyle, FONTSET (rstyle)->find_font ('E'));
1426 for (int row = nrow; row--; ) 1433 for (int row = nrow; row--; )
1427 { 1434 {
1428 line_t &line = ROW(row); 1435 line_t &line = ROW(row);
2041 * A: set up vars 2048 * A: set up vars
2042 */ 2049 */
2043 refresh_count = 0; 2050 refresh_count = 0;
2044 2051
2045 unsigned int old_screen_flags = screen.flags; 2052 unsigned int old_screen_flags = screen.flags;
2046 char have_bg = 0; 2053 bool have_bg = 0;
2047#ifdef HAVE_BG_PIXMAP 2054#ifdef HAVE_BG_PIXMAP
2048 have_bg = bg_pixmap != None; 2055 have_bg = bg_pixmap != None;
2049#endif 2056#endif
2050 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ 2057 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
2051 2058
2057 HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); 2064 HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END));
2058#if ENABLE_OVERLAY 2065#if ENABLE_OVERLAY
2059 scr_swap_overlay (); 2066 scr_swap_overlay ();
2060#endif 2067#endif
2061 2068
2062 char showcursor = screen.flags & Screen_VisibleCursor; 2069 bool showcursor = screen.flags & Screen_VisibleCursor;
2063 2070
2064 /* 2071 /*
2065 * C: set the cursor character (s) 2072 * C: set the cursor character (s)
2066 */ 2073 */
2067 { 2074 {
2068 unsigned char setoldcursor; 2075 bool setoldcursor;
2069 2076
2070#ifdef CURSOR_BLINK 2077#ifdef CURSOR_BLINK
2071 if (hidden_cursor) 2078 if (hidden_cursor)
2072 showcursor = 0; 2079 showcursor = 0;
2073#endif 2080#endif
2160 { 2167 {
2161 int16_t nits; 2168 int16_t nits;
2162 int i = num_scr; 2169 int i = num_scr;
2163 int j; 2170 int j;
2164 int len, wlen; 2171 int len, wlen;
2165 dLocal (int, num_scr);
2166 2172
2167 j = nrow; 2173 j = nrow;
2168 wlen = len = -1; 2174 wlen = len = -1;
2169 row = i > 0 ? 0 : j - 1; 2175 row = i > 0 ? 0 : j - 1;
2170 2176
2661 */ 2667 */
2662#if 0 2668#if 0
2663void 2669void
2664rxvt_term::scr_dump (int fd) NOTHROW 2670rxvt_term::scr_dump (int fd) NOTHROW
2665{ 2671{
2666 int row, wrote; 2672 // if this method is needed, it can be implemented by factoring the
2667 unsigned int width, towrite; 2673 // relevant code in scr_printscreen
2668 const char r1[] = "\n";
2669
2670 for (row = saveLines + top_row;
2671 row < saveLines + nrow - 1; row++)
2672 {
2673 width = row_buf[row].l >= 0 ? row_buf[row].l
2674 : ncol;
2675 for (towrite = width; towrite; towrite -= wrote)
2676 {
2677 wrote = write (fd, & (row_buf[row].t[width - towrite]),
2678 towrite);
2679 if (wrote < 0)
2680 return; /* XXX: death, no report */
2681 }
2682 if (row_buf[row].l >= 0)
2683 if (write (fd, r1, 1) <= 0)
2684 return; /* XXX: death, no report */
2685 }
2686} 2674}
2687#endif 2675#endif
2688 2676
2689/* ------------------------------------------------------------------------- * 2677/* ------------------------------------------------------------------------- *
2690 * CHARACTER SELECTION * 2678 * CHARACTER SELECTION *
2691 * ------------------------------------------------------------------------- */ 2679 * ------------------------------------------------------------------------- */
2692void 2680void
2693rxvt_term::selection_check (int check_more) NOTHROW 2681rxvt_term::selection_check (int check_more) NOTHROW
2694{ 2682{
2695 row_col_t pos;
2696
2697 if (!selection.op) 2683 if (!selection.op)
2698 return; 2684 return;
2699 2685
2700 pos.row = pos.col = 0;
2701 if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) 2686 if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow)
2702 || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) 2687 || !IN_RANGE_EXC (selection.mark.row, top_row, nrow)
2703 || !IN_RANGE_EXC (selection.end.row, top_row, nrow) 2688 || !IN_RANGE_EXC (selection.end.row, top_row, nrow)
2704 || (check_more == 1 2689 || (check_more == 1
2705 && current_screen == selection.screen 2690 && current_screen == selection.screen
2706 && !ROWCOL_IS_BEFORE (screen.cur, selection.beg) 2691 && !ROWCOL_IS_BEFORE (screen.cur, selection.beg)
2707 && ROWCOL_IS_BEFORE (screen.cur, selection.end)) 2692 && ROWCOL_IS_BEFORE (screen.cur, selection.end)))
2708 || (check_more == 2
2709 && ROWCOL_IS_BEFORE (selection.beg, pos)
2710 && ROWCOL_IS_AFTER (selection.end, pos))
2711 || (check_more == 3
2712 && ROWCOL_IS_AFTER (selection.end, pos))
2713 || (check_more == 4 /* screen width change */
2714 && (selection.beg.row != selection.end.row
2715 || selection.end.col > ncol)))
2716 CLEAR_ALL_SELECTION (); 2693 CLEAR_ALL_SELECTION ();
2717} 2694}
2718 2695
2719/* ------------------------------------------------------------------------- */ 2696/* ------------------------------------------------------------------------- */
2720/* 2697/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines