--- rxvt-unicode/src/defaultfont.h 2004/02/22 08:28:36 1.13 +++ rxvt-unicode/src/defaultfont.h 2004/03/06 00:05:01 1.17 @@ -1,12 +1,17 @@ #ifndef DEFAULTFONT_H_ #define DEFAULTFONT_H_ +#include +#if XFT +# include +#endif + #ifdef HAVE_XSETLOCALE # define X_LOCALE # include #else # ifdef HAVE_SETLOCALE -# include +# include # endif #endif /* HAVE_XLOCALE */ @@ -28,7 +33,31 @@ int weight, slant; }; +struct rxvt_drawable { + rxvt_display *display; + Drawable drawable; +#if XFT + XftDraw *xftdrawable; + operator XftDraw *(); +#endif + + rxvt_drawable (rxvt_display *display, Drawable drawable) + : display(display), +#if XFT + xftdrawable(0), +#endif + drawable(drawable) + { } + +#if XFT + ~rxvt_drawable (); +#endif + + operator Drawable() { return drawable; } +}; + struct rxvt_font { + struct rxvt_fontset *fs; // managed by the fontset rxvt_t r; void set_term (rxvt_t r) { this->r = r; } @@ -51,7 +80,7 @@ rxvt_font () { name = 0; } ~rxvt_font () { free (name); }; - void clear_rect (int x, int y, int w, int h, int color); + void clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color); virtual void clear () { }; @@ -60,7 +89,8 @@ virtual bool load (const rxvt_fontprop &prop) = 0; virtual bool has_codepoint (uint32_t unicode) = 0; - virtual void draw (int x, int y, + virtual void draw (rxvt_drawable &d, + int x, int y, const text_t *text, int len, int fg, int bg) = 0; };