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.18 by pcg, Wed Jan 28 23:40:50 2004 UTC vs.
Revision 1.20 by pcg, Fri Jan 30 15:58:07 2004 UTC

1649/* ------------------------------------------------------------------------- * 1649/* ------------------------------------------------------------------------- *
1650 * MAJOR SCREEN MANIPULATION * 1650 * MAJOR SCREEN MANIPULATION *
1651 * ------------------------------------------------------------------------- */ 1651 * ------------------------------------------------------------------------- */
1652 1652
1653/* 1653/*
1654 * refresh matching text.
1655 */
1656bool
1657rxvt_term::scr_refresh_rend (rend_t mask, rend_t value)
1658{
1659 bool found = false;
1660
1661 for (int i = 0; i < TermWin.nrow; i++)
1662 {
1663 int col = 0;
1664 rend_t *drp = drawn_rend [i];
1665
1666 for (; col < TermWin.ncol; col++, drp++)
1667 if ((*drp & mask) == value)
1668 {
1669 found = true;
1670 *drp = ~value;
1671 }
1672 }
1673
1674 return found;
1675}
1676
1677/*
1654 * Refresh an area 1678 * Refresh an area
1655 */ 1679 */
1656enum { 1680enum {
1657 PART_BEG = 0, 1681 PART_BEG = 0,
1658 PART_END, 1682 PART_END,
1870 /* 1894 /*
1871 * A: set up vars 1895 * A: set up vars
1872 */ 1896 */
1873 clearfirst = clearlast = must_clear = 0; 1897 clearfirst = clearlast = must_clear = 0;
1874 1898
1875 if (currmaxcol < TermWin.ncol)
1876 {
1877 currmaxcol = TermWin.ncol;
1878 buffer = (char *)rxvt_realloc (buffer,
1879 sizeof(char) * (currmaxcol + 1) * MB_CUR_MAX);
1880 }
1881
1882 refresh_count = 0; 1899 refresh_count = 0;
1883 1900
1884 row_offset = TermWin.saveLines - TermWin.view_start; 1901 row_offset = TermWin.saveLines - TermWin.view_start;
1885 1902
1886 if ((refresh_type & REFRESH_BOUNDS)) 1903 if ((refresh_type & REFRESH_BOUNDS))
1929 if (showcursor && TermWin.focus) 1946 if (showcursor && TermWin.focus)
1930 { 1947 {
1931 *srp ^= RS_RVid; 1948 *srp ^= RS_RVid;
1932#ifndef NO_CURSORCOLOR 1949#ifndef NO_CURSORCOLOR
1933 cc1 = *srp & (RS_fgMask | RS_bgMask); 1950 cc1 = *srp & (RS_fgMask | RS_bgMask);
1934 if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_cursor)) 1951 if (ISSET_PIXCOLOR (this, Color_cursor))
1935 ccol1 = Color_cursor; 1952 ccol1 = Color_cursor;
1936 else 1953 else
1937#ifdef CURSOR_COLOR_IS_RENDITION_COLOR 1954#ifdef CURSOR_COLOR_IS_RENDITION_COLOR
1938 ccol1 = GET_FGCOLOR(rstyle); 1955 ccol1 = GET_FGCOLOR(rstyle);
1939#else 1956#else
1940 ccol1 = Color_fg; 1957 ccol1 = Color_fg;
1941#endif 1958#endif
1942 if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_cursor2)) 1959 if (ISSET_PIXCOLOR (this, Color_cursor2))
1943 ccol2 = Color_cursor2; 1960 ccol2 = Color_cursor2;
1944 else 1961 else
1945#ifdef CURSOR_COLOR_IS_RENDITION_COLOR 1962#ifdef CURSOR_COLOR_IS_RENDITION_COLOR
1946 ccol2 = GET_BGCOLOR(rstyle); 1963 ccol2 = GET_BGCOLOR(rstyle);
1947#else 1964#else
2133 int back = GET_BGCOLOR (rend); // desired background 2150 int back = GET_BGCOLOR (rend); // desired background
2134 2151
2135 rend = GET_ATTR (rend); 2152 rend = GET_ATTR (rend);
2136 2153
2137 rvid = !!(rend & RS_RVid); 2154 rvid = !!(rend & RS_RVid);
2138#ifdef OPTION_HC 2155#ifdef TEXT_BLINK
2139 if (!rvid && (rend & RS_Blink)) 2156 if (rend & RS_Blink)
2140 { 2157 {
2141 if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_HC)) 2158 if (!text_blink_ev.active)
2142 back = Color_HC;
2143 else 2159 {
2144 rvid = !rvid; /* fall back */ 2160 text_blink_ev.start (NOW + TEXT_BLINK_INTERVAL);
2161 hidden_text = 0;
2162 }
2163 else if (hidden_text)
2164 fore = back;
2145 } 2165 }
2146#endif 2166#endif
2147 if (rvid) 2167 if (rvid)
2148 { 2168 {
2149 SWAP_IT(fore, back, int); 2169 SWAP_IT(fore, back, int);
2150 2170
2151#ifndef NO_BOLD_UNDERLINE_REVERSE 2171#ifndef NO_BOLD_UNDERLINE_REVERSE
2152 if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_RV) 2172 if (ISSET_PIXCOLOR (this, Color_RV)
2153# ifndef NO_CURSORCOLOR 2173# ifndef NO_CURSORCOLOR
2154 && !ISSET_PIXCOLOR (this, Color_cursor) 2174 && !ISSET_PIXCOLOR (this, Color_cursor)
2155# endif 2175# endif
2156 ) 2176 )
2157 back = Color_RV; 2177 back = Color_RV;
2158#endif 2178#endif
2159 } 2179 }
2160#ifndef NO_BOLD_UNDERLINE_REVERSE 2180#ifndef NO_BOLD_UNDERLINE_REVERSE
2161 else if (rend & RS_Bold) 2181 else if (rend & RS_Bold)
2162 { 2182 {
2163 if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_BD)) 2183 if (ISSET_PIXCOLOR (this, Color_BD))
2164 fore = Color_BD; 2184 fore = Color_BD;
2185 else if (fore == Color_fg)
2186 fore = Color_White;
2165 } 2187 }
2166 else if (rend & RS_Uline) 2188 else if (rend & RS_Uline)
2167 { 2189 {
2168 if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_UL)) 2190 if (ISSET_PIXCOLOR (this, Color_UL))
2169 fore = Color_UL; 2191 fore = Color_UL;
2170 } 2192 }
2171#endif 2193#endif
2172 2194
2173 /* 2195 /*
2215#endif 2237#endif
2216 } else if (oldcursor.row >= 0) { 2238 } else if (oldcursor.row >= 0) {
2217#ifndef NO_CURSORCOLOR 2239#ifndef NO_CURSORCOLOR
2218 unsigned long gcmask; /* Graphics Context mask */ 2240 unsigned long gcmask; /* Graphics Context mask */
2219 2241
2220 if (Xdepth > 2 && ISSET_PIXCOLOR (this, Color_cursor)) 2242 if (ISSET_PIXCOLOR (this, Color_cursor))
2221 XSetForeground (Xdisplay, TermWin.gc, PixColors[Color_cursor]); 2243 XSetForeground (Xdisplay, TermWin.gc, PixColors[Color_cursor]);
2222#endif 2244#endif
2223 XDrawRectangle(Xdisplay, drawBuffer, TermWin.gc, 2245 XDrawRectangle(Xdisplay, drawBuffer, TermWin.gc,
2224 Col2Pixel(oldcursor.col), 2246 Col2Pixel(oldcursor.col),
2225 Row2Pixel(oldcursor.row), 2247 Row2Pixel(oldcursor.row),
2308 i = end_row; 2330 i = end_row;
2309 } 2331 }
2310 end_row += R->TermWin.nrow; 2332 end_row += R->TermWin.nrow;
2311 for (; i < row && i < end_row; i++, col = 0) 2333 for (; i < row && i < end_row; i++, col = 0)
2312 for (srp = R->screen.rend[i]; col < R->TermWin.ncol; col++) 2334 for (srp = R->screen.rend[i]; col < R->TermWin.ncol; col++)
2313#ifndef OPTION_HC
2314 srp[col] ^= RS_RVid; 2335 srp[col] ^= RS_RVid;
2315#else
2316 srp[col] ^= RS_Blink;
2317#endif
2318 if (i == row && i < end_row) 2336 if (i == row && i < end_row)
2319 for (srp = R->screen.rend[i]; col < R->selection.end.col; col++) 2337 for (srp = R->screen.rend[i]; col < R->selection.end.col; col++)
2320#ifndef OPTION_HC
2321 srp[col] ^= RS_RVid; 2338 srp[col] ^= RS_RVid;
2322#else
2323 srp[col] ^= RS_Blink;
2324#endif
2325 } 2339 }
2326} 2340}
2327 2341
2328/* ------------------------------------------------------------------------- */ 2342/* ------------------------------------------------------------------------- */
2329/* 2343/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines