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.312 by root, Tue Nov 4 13:30:41 2008 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines