… | |
… | |
1948 | /* ------------------------------------------------------------------------- */ |
1948 | /* ------------------------------------------------------------------------- */ |
1949 | void |
1949 | void |
1950 | rxvt_term::scr_bell () |
1950 | rxvt_term::scr_bell () |
1951 | { |
1951 | { |
1952 | #ifndef NO_BELL |
1952 | #ifndef NO_BELL |
|
|
1953 | |
1953 | # ifndef NO_MAPALERT |
1954 | # ifndef NO_MAPALERT |
1954 | # ifdef MAPALERT_OPTION |
1955 | # ifdef MAPALERT_OPTION |
1955 | if (options & Opt_mapAlert) |
1956 | if (options & Opt_mapAlert) |
1956 | # endif |
1957 | # endif |
1957 | XMapWindow (display->display, TermWin.parent[0]); |
1958 | XMapWindow (display->display, TermWin.parent[0]); |
1958 | # endif |
1959 | # endif |
|
|
1960 | |
1959 | if (options & Opt_visualBell) |
1961 | if (options & Opt_visualBell) |
1960 | { |
1962 | { |
1961 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1963 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
|
|
1964 | rxvt_usleep (VISUAL_BELL_DURATION); |
1962 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1965 | scr_rvideo_mode (!rvideo); /* refresh also done */ |
1963 | } |
1966 | } |
1964 | else |
1967 | else |
1965 | XBell (display->display, 0); |
1968 | XBell (display->display, 0); |
|
|
1969 | |
1966 | #endif |
1970 | #endif |
1967 | } |
1971 | } |
1968 | |
1972 | |
1969 | /* ------------------------------------------------------------------------- */ |
1973 | /* ------------------------------------------------------------------------- */ |
1970 | /* ARGSUSED */ |
1974 | /* ARGSUSED */ |
… | |
… | |
2304 | |
2308 | |
2305 | // sometimes we optimize away the trailing NOCHAR's, add them back |
2309 | // sometimes we optimize away the trailing NOCHAR's, add them back |
2306 | while (i && text[count] == NOCHAR) |
2310 | while (i && text[count] == NOCHAR) |
2307 | count++, i--; |
2311 | count++, i--; |
2308 | |
2312 | |
2309 | #if ENABLE_STYLES |
|
|
2310 | // force redraw after "careful" characters to avoid pixel droppings |
|
|
2311 | if (srp[col] & RS_Careful && col < TermWin.ncol - 1 && 0) |
|
|
2312 | drp[col + 1] = ~srp[col + 1]; |
|
|
2313 | |
|
|
2314 | // include previous careful character(s) if possible, looks nicer (best effort...) |
|
|
2315 | while (text > stp |
|
|
2316 | && srp[text - stp - 1] & RS_Careful |
|
|
2317 | && RS_SAME (rend, srp[text - stp - 1])) |
|
|
2318 | text--, count++, xpixel -= TermWin.fwidth; |
|
|
2319 | #endif |
|
|
2320 | |
|
|
2321 | /* |
2313 | /* |
2322 | * Determine the attributes for the string |
2314 | * Determine the attributes for the string |
2323 | */ |
2315 | */ |
2324 | int fore = GET_FGCOLOR (rend); // desired foreground |
2316 | int fore = GET_FGCOLOR (rend); // desired foreground |
2325 | int back = GET_BGCOLOR (rend); // desired background |
2317 | int back = GET_BGCOLOR (rend); // desired background |
2326 | |
2318 | |
2327 | // only do special processing if ana attributes are set, which is rare |
2319 | // only do special processing if any attributes are set, which is rare |
2328 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink)) |
2320 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) |
2329 | { |
2321 | { |
|
|
2322 | #if ENABLE_STYLES |
|
|
2323 | // force redraw after "careful" characters to avoid pixel droppings |
|
|
2324 | if (srp[col] & RS_Careful && col < TermWin.ncol - 1 && 0) |
|
|
2325 | drp[col + 1] = ~srp[col + 1]; |
|
|
2326 | |
|
|
2327 | // include previous careful character(s) if possible, looks nicer (best effort...) |
|
|
2328 | while (text > stp |
|
|
2329 | && srp[text - stp - 1] & RS_Careful |
|
|
2330 | && RS_SAME (rend, srp[text - stp - 1])) |
|
|
2331 | text--, count++, xpixel -= TermWin.fwidth; |
|
|
2332 | #endif |
|
|
2333 | |
2330 | bool invert = rend & RS_RVid; |
2334 | bool invert = rend & RS_RVid; |
2331 | |
2335 | |
2332 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2336 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2333 | if (rend & RS_Bold |
2337 | if (rend & RS_Bold |
2334 | && fore == Color_fg) |
2338 | && fore == Color_fg) |
… | |
… | |
2361 | SWAP_IT (fore, back, int); |
2365 | SWAP_IT (fore, back, int); |
2362 | |
2366 | |
2363 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2367 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2364 | if (ISSET_PIXCOLOR (Color_RV)) |
2368 | if (ISSET_PIXCOLOR (Color_RV)) |
2365 | back = Color_RV; |
2369 | back = Color_RV; |
|
|
2370 | |
|
|
2371 | if (fore == back) |
|
|
2372 | { |
|
|
2373 | fore = Color_bg; |
|
|
2374 | back = Color_fg; |
|
|
2375 | } |
2366 | #endif |
2376 | #endif |
2367 | } |
2377 | } |
2368 | |
2378 | |
2369 | #ifdef TEXT_BLINK |
2379 | #ifdef TEXT_BLINK |
2370 | if (rend & RS_Blink && (back == Color_bg || fore == Color_bg)) |
2380 | if (rend & RS_Blink && (back == Color_bg || fore == Color_bg)) |