… | |
… | |
1863 | # endif |
1863 | # endif |
1864 | |
1864 | |
1865 | if (OPTION (Opt_visualBell)) |
1865 | if (OPTION (Opt_visualBell)) |
1866 | { |
1866 | { |
1867 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1867 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
|
|
1868 | display->flush (); |
1868 | rxvt_usleep (VISUAL_BELL_DURATION); |
1869 | rxvt_usleep (VISUAL_BELL_DURATION); |
1869 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1870 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1870 | } |
1871 | } |
1871 | else |
1872 | else |
1872 | XBell (display->display, 0); |
1873 | XBell (display->display, 0); |
… | |
… | |
2456 | |
2457 | |
2457 | if (really) |
2458 | if (really) |
2458 | XClearWindow (display->display, vt); |
2459 | XClearWindow (display->display, vt); |
2459 | } |
2460 | } |
2460 | |
2461 | |
|
|
2462 | void |
|
|
2463 | rxvt_term::scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle1, rend_t rstyle2) |
|
|
2464 | { |
|
|
2465 | int view_end = -view_start + nrow; |
|
|
2466 | int row, col; |
|
|
2467 | |
|
|
2468 | for (row = max (beg_row, -view_start); row <= min (end_row, view_end); row++) |
|
|
2469 | { |
|
|
2470 | text_t *stp = ROW(row).t; |
|
|
2471 | rend_t *srp = ROW(row).r; |
|
|
2472 | |
|
|
2473 | for (col = beg_col; col < end_col; col++) |
|
|
2474 | srp[col] ^= rstyle1; |
|
|
2475 | |
|
|
2476 | while (col-- > beg_col && (stp[col] == NOCHAR || unicode::is_space (stp[col]))) |
|
|
2477 | srp[col] ^= rstyle2; |
|
|
2478 | |
|
|
2479 | if (++col < end_col) |
|
|
2480 | srp[col] ^= rstyle2; |
|
|
2481 | } |
|
|
2482 | } |
|
|
2483 | |
|
|
2484 | void |
|
|
2485 | rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle) |
|
|
2486 | { |
|
|
2487 | int view_end = -view_start + nrow; |
|
|
2488 | int row, col; |
|
|
2489 | |
|
|
2490 | if (beg_row >= -view_start) |
|
|
2491 | { |
|
|
2492 | col = beg_col; |
|
|
2493 | row = beg_row; |
|
|
2494 | } |
|
|
2495 | else |
|
|
2496 | { |
|
|
2497 | col = 0; |
|
|
2498 | row = -view_start; |
|
|
2499 | } |
|
|
2500 | |
|
|
2501 | for (; row < min (end_row, view_end); row++, col = 0) |
|
|
2502 | for (rend_t *srp = ROW(row).r; col < ncol; col++) |
|
|
2503 | srp[col] ^= rstyle; |
|
|
2504 | |
|
|
2505 | if (row == end_row) |
|
|
2506 | for (rend_t *srp = ROW(row).r; col < end_col; col++) |
|
|
2507 | srp[col] ^= rstyle; |
|
|
2508 | } |
|
|
2509 | |
2461 | /* ------------------------------------------------------------------------- */ |
2510 | /* ------------------------------------------------------------------------- */ |
2462 | void |
2511 | void |
2463 | rxvt_term::scr_reverse_selection () |
2512 | rxvt_term::scr_reverse_selection () |
2464 | { |
2513 | { |
2465 | if (selection.op |
2514 | if (selection.op |
2466 | && current_screen == selection.screen |
2515 | && current_screen == selection.screen |
2467 | && selection.end.row >= -view_start) |
2516 | && selection.end.row >= -view_start) |
2468 | { |
2517 | { |
2469 | int view_end = -view_start + nrow; |
|
|
2470 | int row, col; |
|
|
2471 | |
|
|
2472 | #if ENABLE_FRILLS |
2518 | #if ENABLE_FRILLS |
2473 | if (selection.rect) |
2519 | if (selection.rect) |
2474 | { |
2520 | scr_xor_rect (selection.beg.row, selection.beg.col, |
2475 | for (row = max (selection.beg.row, -view_start); row <= min (selection.end.row, view_end); row++) |
2521 | selection.end.row, selection.end.col, |
2476 | { |
2522 | RS_RVid, RS_RVid | RS_Uline); |
2477 | text_t *stp = ROW(row).t; |
|
|
2478 | rend_t *srp = ROW(row).r; |
|
|
2479 | |
|
|
2480 | for (col = selection.beg.col; col < selection.end.col; col++) |
|
|
2481 | srp[col] ^= RS_RVid; |
|
|
2482 | |
|
|
2483 | while (col-- > selection.beg.col && (stp[col] == NOCHAR || unicode::is_space (stp[col]))) |
|
|
2484 | srp[col] ^= RS_RVid | RS_Uline; |
|
|
2485 | |
|
|
2486 | if (++col < selection.end.col) |
|
|
2487 | srp[col] ^= RS_RVid | RS_Uline; |
|
|
2488 | } |
|
|
2489 | } |
|
|
2490 | else |
2523 | else |
2491 | #endif |
2524 | #endif |
2492 | { |
2525 | scr_xor_span (selection.beg.row, selection.beg.col, |
2493 | if (selection.beg.row >= -view_start) |
2526 | selection.end.row, selection.end.col, |
2494 | { |
2527 | RS_RVid); |
2495 | col = selection.beg.col; |
|
|
2496 | row = selection.beg.row; |
|
|
2497 | } |
|
|
2498 | else |
|
|
2499 | { |
|
|
2500 | col = 0; |
|
|
2501 | row = -view_start; |
|
|
2502 | } |
|
|
2503 | |
|
|
2504 | for (; row < min (selection.end.row, view_end); row++, col = 0) |
|
|
2505 | for (rend_t *srp = ROW(row).r; col < ncol; col++) |
|
|
2506 | srp[col] ^= RS_RVid; |
|
|
2507 | |
|
|
2508 | if (row == selection.end.row) |
|
|
2509 | for (rend_t *srp = ROW(row).r; col < selection.end.col; col++) |
|
|
2510 | srp[col] ^= RS_RVid; |
|
|
2511 | } |
|
|
2512 | } |
2528 | } |
2513 | } |
2529 | } |
2514 | |
2530 | |
2515 | /* ------------------------------------------------------------------------- */ |
2531 | /* ------------------------------------------------------------------------- */ |
2516 | /* |
2532 | /* |