1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: rxvtfont.C |
2 | * File: rxvtfont.C |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
4 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
5 | * - original version. |
5 | * - original version. |
6 | * |
6 | * |
… | |
… | |
232 | rxvt_font::clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const |
232 | rxvt_font::clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const |
233 | { |
233 | { |
234 | dTermDisplay; |
234 | dTermDisplay; |
235 | dTermGC; |
235 | dTermGC; |
236 | |
236 | |
237 | if (color == Color_bg) |
237 | if (color < 0 || color == Color_bg) |
238 | XClearArea (disp, d, x, y, w, h, false); |
238 | XClearArea (disp, d, x, y, w, h, false); |
239 | else if (color >= 0) |
239 | else |
240 | { |
240 | { |
241 | #if XFT |
241 | #if XFT |
242 | XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); |
242 | XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); |
243 | #else |
243 | #else |
244 | XSetForeground (disp, gc, term->pix_colors[color]); |
244 | XSetForeground (disp, gc, term->pix_colors[color]); |
… | |
… | |
1274 | dTermGC; |
1274 | dTermGC; |
1275 | |
1275 | |
1276 | int w = term->fwidth * len; |
1276 | int w = term->fwidth * len; |
1277 | int h = term->fheight; |
1277 | int h = term->fheight; |
1278 | |
1278 | |
1279 | bool buffered = false; |
1279 | bool buffered = bg >= 0 // we don't use a transparent bg |
|
|
1280 | #ifndef FORCE_UNBUFFERED_XFT |
|
|
1281 | # if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
|
|
1282 | || !term->am_transparent // we aren't transparent |
|
|
1283 | || term->am_pixmap_trans // we have a pixmap |
|
|
1284 | # endif |
|
|
1285 | #endif |
|
|
1286 | ; |
1280 | |
1287 | |
1281 | // cut trailing spaces |
1288 | // cut trailing spaces |
1282 | while (len && text [len - 1] == ' ') |
1289 | while (len && text [len - 1] == ' ') |
1283 | len--; |
1290 | len--; |
1284 | |
1291 | |
… | |
… | |
1315 | { |
1322 | { |
1316 | if (ep != enc) |
1323 | if (ep != enc) |
1317 | { |
1324 | { |
1318 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1325 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1319 | |
1326 | |
|
|
1327 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
|
|
1328 | if (bg < 0 && term->am_pixmap_trans) |
|
|
1329 | XCopyArea (disp, term->pixmap, d2, gc, x, y, w, h, 0, 0); |
|
|
1330 | else if (bg < 0 && term->bgPixmap.pixmap) |
|
|
1331 | { |
|
|
1332 | XGCValues gcv; |
|
|
1333 | |
|
|
1334 | gcv.fill_style = FillTiled; |
|
|
1335 | gcv.tile = term->pixmap; |
|
|
1336 | gcv.ts_x_origin = -x; |
|
|
1337 | gcv.ts_y_origin = -y; |
|
|
1338 | |
|
|
1339 | GC gc2 = XCreateGC (disp, d2, |
|
|
1340 | GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, |
|
|
1341 | &gcv); |
|
|
1342 | |
|
|
1343 | XFillRectangle (disp, d2, gc2, 0, 0, w, h); |
|
|
1344 | |
|
|
1345 | XFreeGC (disp, gc2); |
|
|
1346 | } |
|
|
1347 | else |
|
|
1348 | #endif |
1320 | XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); |
1349 | XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); |
1321 | |
1350 | |
1322 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1351 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1323 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1352 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1324 | } |
1353 | } |
1325 | else |
1354 | else |