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.254 by root, Sat Jan 28 14:23:16 2006 UTC vs.
Revision 1.257 by root, Tue Jan 31 00:25:16 2006 UTC

1114 * Process DEC Back Index 1114 * Process DEC Back Index
1115 * XTERM_SEQ: ESC 6 1115 * XTERM_SEQ: ESC 6
1116 * Move cursor left in row. If we're at the left boundary, shift everything 1116 * Move cursor left in row. If we're at the left boundary, shift everything
1117 * in that row right. Clear left column. 1117 * in that row right. Clear left column.
1118 */ 1118 */
1119#if ENABLE_FRILLS 1119#if !ENABLE_MINIMAL
1120void 1120void
1121rxvt_term::scr_backindex () NOTHROW 1121rxvt_term::scr_backindex () NOTHROW
1122{ 1122{
1123 if (screen.cur.col > 0) 1123 if (screen.cur.col > 0)
1124 scr_gotorc (0, -1, R_RELATIVE | C_RELATIVE); 1124 scr_gotorc (0, -1, R_RELATIVE | C_RELATIVE);
1131 * Process DEC Forward Index 1131 * Process DEC Forward Index
1132 * XTERM_SEQ: ESC 9 1132 * XTERM_SEQ: ESC 9
1133 * Move cursor right in row. If we're at the right boundary, shift everything 1133 * Move cursor right in row. If we're at the right boundary, shift everything
1134 * in that row left. Clear right column. 1134 * in that row left. Clear right column.
1135 */ 1135 */
1136#if ENABLE_FRILLS 1136#if !ENABLE_MINIMAL
1137void 1137void
1138rxvt_term::scr_forwardindex () NOTHROW 1138rxvt_term::scr_forwardindex () NOTHROW
1139{ 1139{
1140 if (screen.cur.col < ncol - 1) 1140 if (screen.cur.col < ncol - 1)
1141 scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); 1141 scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE);
1355 scr_blank_screen_mem (ROW(row), rstyle); 1355 scr_blank_screen_mem (ROW(row), rstyle);
1356 scr_blank_line (drawn_buf [row], 0, ncol, ren); 1356 scr_blank_line (drawn_buf [row], 0, ncol, ren);
1357 } 1357 }
1358} 1358}
1359 1359
1360#if ENABLE_FRILLS 1360#if !ENABLE_MINIMAL
1361void 1361void
1362rxvt_term::scr_erase_savelines () NOTHROW 1362rxvt_term::scr_erase_savelines () NOTHROW
1363{ 1363{
1364 want_refresh = 1; 1364 want_refresh = 1;
1365 ZERO_SCROLLBACK (); 1365 ZERO_SCROLLBACK ();
1754{ 1754{
1755 bool found = false; 1755 bool found = false;
1756 1756
1757 for (int i = 0; i < nrow; i++) 1757 for (int i = 0; i < nrow; i++)
1758 { 1758 {
1759 int col = 0;
1760 rend_t *drp = drawn_buf[i].r; 1759 rend_t *drp = drawn_buf[i].r;
1761 1760
1762 for (; col < ncol; col++, drp++) 1761 for (int col = 0; col < ncol; col++, drp++)
1763 if ((*drp & mask) == value) 1762 if ((*drp & mask) == value)
1764 { 1763 {
1765 found = true; 1764 found = true;
1766 *drp = ~value; 1765 *drp = ~value;
1767 } 1766 }
2258 && RS_SAME (rend, srp[text - stp - 1])) 2257 && RS_SAME (rend, srp[text - stp - 1]))
2259 text--, count++, xpixel -= fwidth; 2258 text--, count++, xpixel -= fwidth;
2260 2259
2261 // force redraw after "careful" characters to avoid pixel droppings 2260 // force redraw after "careful" characters to avoid pixel droppings
2262 for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++) 2261 for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++)
2263 drp[col + i + 1] = ~srp[col + i + 1]; 2262 drp[col + i + 1] = srp[col + i + 1] ^ RS_redraw;
2264 2263
2265 // force redraw before "careful" characters to avoid pixel droppings 2264 // force redraw before "careful" characters to avoid pixel droppings
2266 for (int i = 0; srp[text - stp - i] & RS_Careful && text - i > stp; i++) 2265 for (int i = 0; srp[text - stp - i] & RS_Careful && text - i > stp; i++)
2267 drp[text - stp - i - 1] = ~srp[text - stp - i - 1]; 2266 drp[text - stp - i - 1] = srp[text - stp - i - 1] ^ RS_redraw;
2268#endif 2267#endif
2269 2268
2270 bool invert = rend & RS_RVid; 2269 bool invert = rend & RS_RVid;
2271 2270
2272#ifndef NO_BOLD_UNDERLINE_REVERSE 2271#ifndef NO_BOLD_UNDERLINE_REVERSE
2330 * Actually do the drawing of the string here 2329 * Actually do the drawing of the string here
2331 */ 2330 */
2332 rxvt_font *font = (*fontset[GET_STYLE (rend)])[GET_FONT (rend)]; 2331 rxvt_font *font = (*fontset[GET_STYLE (rend)])[GET_FONT (rend)];
2333 2332
2334 if (back == fore) 2333 if (back == fore)
2335 font->clear_rect (*drawable, xpixel, ypixel, 2334 font->clear_rect (*drawable, xpixel, ypixel, fwidth * count, fheight, back);
2336 fwidth * count, fheight,
2337 back);
2338 else if (back == Color_bg) 2335 else if (back == Color_bg)
2339 { 2336 {
2340 if (must_clear) 2337 if (must_clear)
2341 { 2338 {
2342 CLEAR_CHARS (xpixel, ypixel, count); 2339 CLEAR_CHARS (xpixel, ypixel, count);
2549{ 2546{
2550 if (selection.op 2547 if (selection.op
2551 && current_screen == selection.screen 2548 && current_screen == selection.screen
2552 && selection.end.row >= view_start) 2549 && selection.end.row >= view_start)
2553 { 2550 {
2554#if ENABLE_FRILLS 2551#if !ENABLE_MINIMAL
2555 if (selection.rect) 2552 if (selection.rect)
2556 scr_xor_rect (selection.beg.row, selection.beg.col, 2553 scr_xor_rect (selection.beg.row, selection.beg.col,
2557 selection.end.row, selection.end.col, 2554 selection.end.row, selection.end.col,
2558 RS_RVid, RS_RVid | RS_Uline); 2555 RS_RVid, RS_RVid | RS_Uline);
2559 else 2556 else
2774 } 2771 }
2775 2772
2776 char **cl; 2773 char **cl;
2777 int cr; 2774 int cr;
2778 2775
2779#if ENABLE_FRILLS 2776#if !ENABLE_MINIMAL
2780 // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it 2777 // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it
2781 // so recode it manually 2778 // so recode it manually
2782 if (ct.encoding == xa[XA_UTF8_STRING]) 2779 if (ct.encoding == xa[XA_UTF8_STRING])
2783 { 2780 {
2784 wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems); 2781 wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems);
2955 2952
2956 int end_col; 2953 int end_col;
2957 2954
2958 for (; row <= selection.end.row; row++, col = 0) 2955 for (; row <= selection.end.row; row++, col = 0)
2959 { 2956 {
2960#if ENABLE_FRILLS 2957#if !ENABLE_MINIMAL
2961 if (selection.rect) 2958 if (selection.rect)
2962 { 2959 {
2963 col = selection.beg.col; 2960 col = selection.beg.col;
2964 end_col = ncol + 1; 2961 end_col = ncol + 1;
2965 } 2962 }
2968 end_col = ROW(row).l; 2965 end_col = ROW(row).l;
2969 2966
2970 col = max (col, 0); 2967 col = max (col, 0);
2971 2968
2972 if (row == selection.end.row 2969 if (row == selection.end.row
2973#if ENABLE_FRILLS 2970#if !ENABLE_MINIMAL
2974 || selection.rect 2971 || selection.rect
2975#endif 2972#endif
2976 ) 2973 )
2977 min_it (end_col, selection.end.col); 2974 min_it (end_col, selection.end.col);
2978 2975
3001#endif 2998#endif
3002 else 2999 else
3003 new_selection_text[ofs++] = *t++; 3000 new_selection_text[ofs++] = *t++;
3004 } 3001 }
3005 3002
3006#if ENABLE_FRILLS 3003#if !ENABLE_MINIMAL
3007 if (selection.rect) 3004 if (selection.rect)
3008 { 3005 {
3009 while (ofs 3006 while (ofs
3010 && new_selection_text[ofs - 1] != C0_LF 3007 && new_selection_text[ofs - 1] != C0_LF
3011 && unicode::is_space (new_selection_text[ofs - 1])) 3008 && unicode::is_space (new_selection_text[ofs - 1]))
3372 3369
3373 if (selection.clicks == 1) 3370 if (selection.clicks == 1)
3374 { 3371 {
3375 if (selection.beg.col > ROW(selection.beg.row).l //TODO//FIXME//LEN 3372 if (selection.beg.col > ROW(selection.beg.row).l //TODO//FIXME//LEN
3376 && !ROW(selection.beg.row).is_longer () 3373 && !ROW(selection.beg.row).is_longer ()
3377#if ENABLE_FRILLS 3374#if !ENABLE_MINIMAL
3378 && !selection.rect 3375 && !selection.rect
3379#endif 3376#endif
3380 ) 3377 )
3381 selection.beg.col = ncol; 3378 selection.beg.col = ncol;
3382 3379
3383 if ( 3380 if (
3384 selection.end.col > ROW(selection.end.row).l //TODO//FIXME//LEN 3381 selection.end.col > ROW(selection.end.row).l //TODO//FIXME//LEN
3385 && !ROW(selection.end.row).is_longer () 3382 && !ROW(selection.end.row).is_longer ()
3386#if ENABLE_FRILLS 3383#if !ENABLE_MINIMAL
3387 && !selection.rect 3384 && !selection.rect
3388#endif 3385#endif
3389 ) 3386 )
3390 selection.end.col = ncol; 3387 selection.end.col = ncol;
3391 } 3388 }
3408 { 3405 {
3409 if (!ROW(end_row).is_longer ()) 3406 if (!ROW(end_row).is_longer ())
3410 { 3407 {
3411 selection.end.row = end_row; 3408 selection.end.row = end_row;
3412 selection.end.col = ROW(end_row).l; 3409 selection.end.col = ROW(end_row).l;
3410# if !ENABLE_MINIMAL
3413 selection_remove_trailing_spaces (); 3411 selection_remove_trailing_spaces ();
3412# endif
3414 break; 3413 break;
3415 } 3414 }
3416 } 3415 }
3417 } 3416 }
3418 else 3417 else
3447 selection.mark.row = selection.beg.row; 3446 selection.mark.row = selection.beg.row;
3448 selection.mark.col = selection.beg.col; 3447 selection.mark.col = selection.beg.col;
3449 } 3448 }
3450 } 3449 }
3451 3450
3452#if ENABLE_FRILLS 3451#if !ENABLE_MINIMAL
3453 if (selection.rect && selection.beg.col > selection.end.col) 3452 if (selection.rect && selection.beg.col > selection.end.col)
3454 ::swap (selection.beg.col, selection.end.col); 3453 ::swap (selection.beg.col, selection.end.col);
3455#endif 3454#endif
3456} 3455}
3457 3456
3458#if ENABLE_FRILLS 3457#if !ENABLE_MINIMAL
3459void 3458void
3460rxvt_term::selection_remove_trailing_spaces () NOTHROW 3459rxvt_term::selection_remove_trailing_spaces () NOTHROW
3461{ 3460{
3462 int32_t end_col, end_row; 3461 int32_t end_col, end_row;
3463 text_t *stp; 3462 text_t *stp;
3588 style = enc_string; 3587 style = enc_string;
3589 else if (target == xa[XA_TEXT]) 3588 else if (target == xa[XA_TEXT])
3590 style = enc_text; 3589 style = enc_text;
3591 else if (target == xa[XA_COMPOUND_TEXT]) 3590 else if (target == xa[XA_COMPOUND_TEXT])
3592 style = enc_compound_text; 3591 style = enc_compound_text;
3593#if ENABLE_FRILLS 3592#if !ENABLE_MINIMAL
3594 else if (target == xa[XA_UTF8_STRING]) 3593 else if (target == xa[XA_UTF8_STRING])
3595 style = enc_utf8; 3594 style = enc_utf8;
3596#endif 3595#endif
3597 else 3596 else
3598 { 3597 {
3609 { 3608 {
3610 cl = L""; 3609 cl = L"";
3611 selectlen = 0; 3610 selectlen = 0;
3612 } 3611 }
3613 3612
3614#if ENABLE_FRILLS 3613#if !ENABLE_MINIMAL
3615 // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it 3614 // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it
3616 // so recode it manually 3615 // so recode it manually
3617 if (style == enc_utf8) 3616 if (style == enc_utf8)
3618 { 3617 {
3619 freect = 1; 3618 freect = 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines