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.309 by root, Mon Jul 21 16:51:31 2008 UTC vs.
Revision 1.311 by root, Wed Oct 15 14:48:22 2008 UTC

1899 XMapWindow (dpy, parent[0]); 1899 XMapWindow (dpy, parent[0]);
1900# endif 1900# endif
1901 1901
1902# if ENABLE_FRILLS 1902# if ENABLE_FRILLS
1903 if (option (Opt_urgentOnBell)) 1903 if (option (Opt_urgentOnBell))
1904 { 1904 set_urgency (1);
1905 if (XWMHints *h = XGetWMHints(dpy, parent[0]))
1906 {
1907 h->flags |= XUrgencyHint;
1908 XSetWMHints (dpy, parent[0], h);
1909 }
1910 }
1911# endif 1905# endif
1912 1906
1913 if (option (Opt_visualBell)) 1907 if (option (Opt_visualBell))
1914 { 1908 {
1915 rvideo_bell = true; 1909 rvideo_bell = true;
2210 continue; 2204 continue;
2211 2205
2212 // redraw one or more characters 2206 // redraw one or more characters
2213 2207
2214 // seek to the beginning of wide characters 2208 // seek to the beginning of wide characters
2215 while (stp[col] == NOCHAR && col > 0) 2209 while (expect_false (stp[col] == NOCHAR && col > 0))
2216 --col; 2210 --col;
2217 2211
2218 rend_t rend = srp[col]; /* screen rendition (target rendtion) */ 2212 rend_t rend = srp[col]; /* screen rendition (target rendtion) */
2219 text_t *text = stp + col; 2213 text_t *text = stp + col;
2220 int count = 1; 2214 int count = 1;
2257 2251
2258 col--; /* went one too far. move back */ 2252 col--; /* went one too far. move back */
2259 count -= i; /* dump any matching trailing chars */ 2253 count -= i; /* dump any matching trailing chars */
2260 2254
2261 // sometimes we optimize away the trailing NOCHAR's, add them back 2255 // sometimes we optimize away the trailing NOCHAR's, add them back
2262 while (i && text[count] == NOCHAR) 2256 while (expect_false (i && text[count] == NOCHAR))
2263 count++, i--; 2257 count++, i--;
2264 2258
2265 /* 2259 /*
2266 * Determine the attributes for the string 2260 * Determine the attributes for the string
2267 */ 2261 */
2268 int fore = fgcolor_of (rend); // desired foreground 2262 int fore = fgcolor_of (rend); // desired foreground
2269 int back = bgcolor_of (rend); // desired background 2263 int back = bgcolor_of (rend); // desired background
2270 2264
2271 // only do special processing if any attributes are set, which is unlikely 2265 // only do special processing if any attributes are set, which is unlikely
2272 if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) 2266 if (expect_false (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)))
2273 { 2267 {
2274 bool invert = rend & RS_RVid; 2268 bool invert = rend & RS_RVid;
2275 2269
2276#ifndef NO_BOLD_UNDERLINE_REVERSE 2270#ifndef NO_BOLD_UNDERLINE_REVERSE
2277 if (rend & RS_Bold && fore == Color_fg) 2271 if (rend & RS_Bold && fore == Color_fg)
2360 /* 2354 /*
2361 * Actually do the drawing of the string here 2355 * Actually do the drawing of the string here
2362 */ 2356 */
2363 rxvt_font *font = (*fontset[GET_STYLE (rend)])[GET_FONT (rend)]; 2357 rxvt_font *font = (*fontset[GET_STYLE (rend)])[GET_FONT (rend)];
2364 2358
2365 if (have_bg && back == Color_bg) 2359 if (expect_true (have_bg && back == Color_bg))
2366 { 2360 {
2367 // this is very ugly, maybe push it into ->draw? 2361 // this is very ugly, maybe push it into ->draw?
2368 2362
2369 for (i = 0; i < count; i++) /* don't draw empty strings */ 2363 for (i = 0; i < count; i++) /* don't draw empty strings */
2370 if (text[i] != ' ') 2364 if (text[i] != ' ')
2377 did_clear: ; 2371 did_clear: ;
2378 } 2372 }
2379 else 2373 else
2380 font->draw (*drawable, xpixel, ypixel, text, count, fore, back); 2374 font->draw (*drawable, xpixel, ypixel, text, count, fore, back);
2381 2375
2382 if (rend & RS_Uline && font->descent > 1 && fore != back) 2376 if (expect_false (rend & RS_Uline && font->descent > 1 && fore != back))
2383 { 2377 {
2384#if ENABLE_FRILLS 2378#if ENABLE_FRILLS
2385 if (ISSET_PIXCOLOR (Color_underline)) 2379 if (ISSET_PIXCOLOR (Color_underline))
2386 XSetForeground (dpy, gc, pix_colors[Color_underline]); 2380 XSetForeground (dpy, gc, pix_colors[Color_underline]);
2387 else 2381 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines