--- rxvt-unicode/src/screen.C 2004/01/28 23:40:50 1.18 +++ rxvt-unicode/src/screen.C 2004/01/30 15:58:07 1.20 @@ -1651,6 +1651,30 @@ * ------------------------------------------------------------------------- */ /* + * refresh matching text. + */ +bool +rxvt_term::scr_refresh_rend (rend_t mask, rend_t value) +{ + bool found = false; + + for (int i = 0; i < TermWin.nrow; i++) + { + int col = 0; + rend_t *drp = drawn_rend [i]; + + for (; col < TermWin.ncol; col++, drp++) + if ((*drp & mask) == value) + { + found = true; + *drp = ~value; + } + } + + return found; +} + +/* * Refresh an area */ enum { @@ -1872,13 +1896,6 @@ */ clearfirst = clearlast = must_clear = 0; - if (currmaxcol < TermWin.ncol) - { - currmaxcol = TermWin.ncol; - buffer = (char *)rxvt_realloc (buffer, - sizeof(char) * (currmaxcol + 1) * MB_CUR_MAX); - } - refresh_count = 0; row_offset = TermWin.saveLines - TermWin.view_start; @@ -1931,7 +1948,7 @@ *srp ^= RS_RVid; #ifndef NO_CURSORCOLOR cc1 = *srp & (RS_fgMask | RS_bgMask); - if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_cursor)) + if (ISSET_PIXCOLOR (this, Color_cursor)) ccol1 = Color_cursor; else #ifdef CURSOR_COLOR_IS_RENDITION_COLOR @@ -1939,7 +1956,7 @@ #else ccol1 = Color_fg; #endif - if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_cursor2)) + if (ISSET_PIXCOLOR (this, Color_cursor2)) ccol2 = Color_cursor2; else #ifdef CURSOR_COLOR_IS_RENDITION_COLOR @@ -2135,13 +2152,16 @@ rend = GET_ATTR (rend); rvid = !!(rend & RS_RVid); -#ifdef OPTION_HC - if (!rvid && (rend & RS_Blink)) +#ifdef TEXT_BLINK + if (rend & RS_Blink) { - if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_HC)) - back = Color_HC; - else - rvid = !rvid; /* fall back */ + if (!text_blink_ev.active) + { + text_blink_ev.start (NOW + TEXT_BLINK_INTERVAL); + hidden_text = 0; + } + else if (hidden_text) + fore = back; } #endif if (rvid) @@ -2149,7 +2169,7 @@ SWAP_IT(fore, back, int); #ifndef NO_BOLD_UNDERLINE_REVERSE - if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_RV) + if (ISSET_PIXCOLOR (this, Color_RV) # ifndef NO_CURSORCOLOR && !ISSET_PIXCOLOR (this, Color_cursor) # endif @@ -2160,12 +2180,14 @@ #ifndef NO_BOLD_UNDERLINE_REVERSE else if (rend & RS_Bold) { - if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_BD)) + if (ISSET_PIXCOLOR (this, Color_BD)) fore = Color_BD; + else if (fore == Color_fg) + fore = Color_White; } else if (rend & RS_Uline) { - if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_UL)) + if (ISSET_PIXCOLOR (this, Color_UL)) fore = Color_UL; } #endif @@ -2217,7 +2239,7 @@ #ifndef NO_CURSORCOLOR unsigned long gcmask; /* Graphics Context mask */ - if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_cursor)) + if (ISSET_PIXCOLOR (this, Color_cursor)) XSetForeground (Xdisplay, TermWin.gc, PixColors[Color_cursor]); #endif XDrawRectangle(Xdisplay, drawBuffer, TermWin.gc, @@ -2310,18 +2332,10 @@ end_row += R->TermWin.nrow; for (; i < row && i < end_row; i++, col = 0) for (srp = R->screen.rend[i]; col < R->TermWin.ncol; col++) -#ifndef OPTION_HC srp[col] ^= RS_RVid; -#else - srp[col] ^= RS_Blink; -#endif if (i == row && i < end_row) for (srp = R->screen.rend[i]; col < R->selection.end.col; col++) -#ifndef OPTION_HC srp[col] ^= RS_RVid; -#else - srp[col] ^= RS_Blink; -#endif } }