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.218 by root, Mon Jan 9 22:41:41 2006 UTC vs.
Revision 1.219 by root, Mon Jan 9 23:00:07 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines