ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/defaultfont.C
(Generate patch)

Comparing rxvt-unicode/src/defaultfont.C (file contents):
Revision 1.19 by pcg, Fri Feb 13 13:28:17 2004 UTC vs.
Revision 1.22 by pcg, Sat Feb 21 22:14:00 2004 UTC

1/*--------------------------------*-C-*---------------------------------*; 1/*--------------------------------*-C-*---------------------------------*;
2 * File: defaultfont.C 2 * File: defaultfont.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * Copyright (c) 2003 Marc Lehmann rxvt@plan9.de> 4 * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com>
5 * - original version. 5 * - original version.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 9 * the Free Software Foundation; either version 2 of the License, or
760}; 760};
761 761
762void 762void
763rxvt_font_xft::clear () 763rxvt_font_xft::clear ()
764{ 764{
765 if (d)
766 {
767 XftDrawDestroy (d);
768 d = 0;
769 }
770
765 if (f) 771 if (f)
766 { 772 {
767 XftFontClose (DISPLAY, f); 773 XftFontClose (DISPLAY, f);
768 f = 0; 774 f = 0;
769 }
770
771 if (d)
772 {
773 XftDrawDestroy (d);
774 d = 0;
775 } 775 }
776} 776}
777 777
778rxvt_fontprop 778rxvt_fontprop
779rxvt_font_xft::properties () 779rxvt_font_xft::properties ()
890void 890void
891rxvt_font_xft::draw (int x, int y, 891rxvt_font_xft::draw (int x, int y,
892 const text_t *text, int len, 892 const text_t *text, int len,
893 int fg, int bg) 893 int fg, int bg)
894{ 894{
895 if (!d)
896 d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap); 895 d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap);
897 896
898 if (bg >= 0 && bg != Color_bg) 897 if (bg >= 0 && bg != Color_bg)
899 XftDrawRect (d, &r->PixColors[bg].c, x, y, r->TermWin.fwidth * len, r->TermWin.fheight); 898 XftDrawRect (d, &r->PixColors[bg].c, x, y, r->TermWin.fwidth * len, r->TermWin.fheight);
900 else 899 else
901 clear_rect (x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg); 900 clear_rect (x, y, r->TermWin.fwidth * len, r->TermWin.fheight, bg);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines