… | |
… | |
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)) |
… | |
… | |
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 | */ |
1317 | void |
1322 | void |
… | |
… | |
1362 | { |
1367 | { |
1363 | ren = DEFAULT_RSTYLE; |
1368 | ren = DEFAULT_RSTYLE; |
1364 | |
1369 | |
1365 | if (mapped) |
1370 | if (mapped) |
1366 | XClearArea (dpy, vt, 0, |
1371 | XClearArea (dpy, vt, 0, |
1367 | Row2Pixel (row - view_start), (unsigned int)width, |
1372 | Row2Pixel (row - view_start), (unsigned int)vt_width, |
1368 | (unsigned int)Height2Pixel (num), False); |
1373 | (unsigned int)Height2Pixel (num), False); |
1369 | } |
1374 | } |
1370 | else |
1375 | else |
1371 | { |
1376 | { |
1372 | ren = rstyle & (RS_fgMask | RS_bgMask); |
1377 | ren = rstyle & (RS_fgMask | RS_bgMask); |
… | |
… | |
1375 | { |
1380 | { |
1376 | gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; |
1381 | gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; |
1377 | XChangeGC (dpy, gc, GCForeground, &gcvalue); |
1382 | XChangeGC (dpy, gc, GCForeground, &gcvalue); |
1378 | XFillRectangle (dpy, vt, gc, |
1383 | XFillRectangle (dpy, vt, gc, |
1379 | 0, Row2Pixel (row - view_start), |
1384 | 0, Row2Pixel (row - view_start), |
1380 | (unsigned int)width, |
1385 | (unsigned int)vt_width, |
1381 | (unsigned int)Height2Pixel (num)); |
1386 | (unsigned int)Height2Pixel (num)); |
1382 | gcvalue.foreground = pix_colors[Color_fg]; |
1387 | gcvalue.foreground = pix_colors[Color_fg]; |
1383 | XChangeGC (dpy, gc, GCForeground, &gcvalue); |
1388 | XChangeGC (dpy, gc, GCForeground, &gcvalue); |
1384 | } |
1389 | } |
1385 | } |
1390 | } |
… | |
… | |
1416 | |
1421 | |
1417 | want_refresh = 1; |
1422 | want_refresh = 1; |
1418 | ZERO_SCROLLBACK (); |
1423 | ZERO_SCROLLBACK (); |
1419 | |
1424 | |
1420 | num_scr_allow = 0; |
1425 | num_scr_allow = 0; |
1421 | 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 (); |
1422 | |
1431 | |
1423 | fs = SET_FONT (rstyle, FONTSET (rstyle)->find_font ('E')); |
1432 | fs = SET_FONT (rstyle, FONTSET (rstyle)->find_font ('E')); |
1424 | for (int row = nrow; row--; ) |
1433 | for (int row = nrow; row--; ) |
1425 | { |
1434 | { |
1426 | line_t &line = ROW(row); |
1435 | line_t &line = ROW(row); |
… | |
… | |
1867 | * Refresh the entire screen |
1876 | * Refresh the entire screen |
1868 | */ |
1877 | */ |
1869 | void |
1878 | void |
1870 | rxvt_term::scr_touch (bool refresh) NOTHROW |
1879 | rxvt_term::scr_touch (bool refresh) NOTHROW |
1871 | { |
1880 | { |
1872 | scr_expose (0, 0, width, height, refresh); |
1881 | scr_expose (0, 0, vt_width, vt_height, refresh); |
1873 | } |
1882 | } |
1874 | |
1883 | |
1875 | /* ------------------------------------------------------------------------- */ |
1884 | /* ------------------------------------------------------------------------- */ |
1876 | /* |
1885 | /* |
1877 | * Move the display so that the line represented by scrollbar value Y is at |
1886 | * Move the display so that the line represented by scrollbar value Y is at |
… | |
… | |
2158 | { |
2167 | { |
2159 | int16_t nits; |
2168 | int16_t nits; |
2160 | int i = num_scr; |
2169 | int i = num_scr; |
2161 | int j; |
2170 | int j; |
2162 | int len, wlen; |
2171 | int len, wlen; |
2163 | dLocal (int, num_scr); |
|
|
2164 | |
2172 | |
2165 | j = nrow; |
2173 | j = nrow; |
2166 | wlen = len = -1; |
2174 | wlen = len = -1; |
2167 | row = i > 0 ? 0 : j - 1; |
2175 | row = i > 0 ? 0 : j - 1; |
2168 | |
2176 | |
… | |
… | |
2659 | */ |
2667 | */ |
2660 | #if 0 |
2668 | #if 0 |
2661 | void |
2669 | void |
2662 | rxvt_term::scr_dump (int fd) NOTHROW |
2670 | rxvt_term::scr_dump (int fd) NOTHROW |
2663 | { |
2671 | { |
2664 | int row, wrote; |
2672 | // if this method is needed, it can be implemented by factoring the |
2665 | unsigned int width, towrite; |
2673 | // relevant code in scr_printscreen |
2666 | const char r1[] = "\n"; |
|
|
2667 | |
|
|
2668 | for (row = saveLines + top_row; |
|
|
2669 | row < saveLines + nrow - 1; row++) |
|
|
2670 | { |
|
|
2671 | width = row_buf[row].l >= 0 ? row_buf[row].l |
|
|
2672 | : ncol; |
|
|
2673 | for (towrite = width; towrite; towrite -= wrote) |
|
|
2674 | { |
|
|
2675 | wrote = write (fd, & (row_buf[row].t[width - towrite]), |
|
|
2676 | towrite); |
|
|
2677 | if (wrote < 0) |
|
|
2678 | return; /* XXX: death, no report */ |
|
|
2679 | } |
|
|
2680 | if (row_buf[row].l >= 0) |
|
|
2681 | if (write (fd, r1, 1) <= 0) |
|
|
2682 | return; /* XXX: death, no report */ |
|
|
2683 | } |
|
|
2684 | } |
2674 | } |
2685 | #endif |
2675 | #endif |
2686 | |
2676 | |
2687 | /* ------------------------------------------------------------------------- * |
2677 | /* ------------------------------------------------------------------------- * |
2688 | * CHARACTER SELECTION * |
2678 | * CHARACTER SELECTION * |
… | |
… | |
2690 | void |
2680 | void |
2691 | rxvt_term::selection_check (int check_more) NOTHROW |
2681 | rxvt_term::selection_check (int check_more) NOTHROW |
2692 | { |
2682 | { |
2693 | if (!selection.op) |
2683 | if (!selection.op) |
2694 | return; |
2684 | return; |
2695 | |
|
|
2696 | row_col_t pos; |
|
|
2697 | pos.row = pos.col = 0; |
|
|
2698 | |
2685 | |
2699 | if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) |
2686 | if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) |
2700 | || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) |
2687 | || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) |
2701 | || !IN_RANGE_EXC (selection.end.row, top_row, nrow) |
2688 | || !IN_RANGE_EXC (selection.end.row, top_row, nrow) |
2702 | || (check_more == 1 |
2689 | || (check_more == 1 |
2703 | && current_screen == selection.screen |
2690 | && current_screen == selection.screen |
2704 | && !ROWCOL_IS_BEFORE (screen.cur, selection.beg) |
2691 | && !ROWCOL_IS_BEFORE (screen.cur, selection.beg) |
2705 | && ROWCOL_IS_BEFORE (screen.cur, selection.end)) |
2692 | && ROWCOL_IS_BEFORE (screen.cur, selection.end))) |
2706 | || (check_more == 2 |
|
|
2707 | && ROWCOL_IS_BEFORE (selection.beg, pos) |
|
|
2708 | && ROWCOL_IS_AFTER (selection.end, pos)) |
|
|
2709 | || (check_more == 3 |
|
|
2710 | && ROWCOL_IS_AFTER (selection.end, pos))) |
|
|
2711 | CLEAR_ALL_SELECTION (); |
2693 | CLEAR_ALL_SELECTION (); |
2712 | } |
2694 | } |
2713 | |
2695 | |
2714 | /* ------------------------------------------------------------------------- */ |
2696 | /* ------------------------------------------------------------------------- */ |
2715 | /* |
2697 | /* |