… | |
… | |
47 | if (this->name) free (this->name); // let the compiler optimize |
47 | if (this->name) free (this->name); // let the compiler optimize |
48 | this->name = name; |
48 | this->name = name; |
49 | } |
49 | } |
50 | |
50 | |
51 | rxvt_font () { name = 0; } |
51 | rxvt_font () { name = 0; } |
52 | ~rxvt_font () { clear (); free (name); }; |
52 | ~rxvt_font () { free (name); }; |
53 | |
53 | |
54 | void clear_rect (int x, int y, int w, int h, int color); |
54 | void clear_rect (int x, int y, int w, int h, int color); |
55 | |
55 | |
56 | virtual void clear () { }; |
56 | virtual void clear () { }; |
57 | |
57 | |
… | |
… | |
63 | virtual void draw (int x, int y, |
63 | virtual void draw (int x, int y, |
64 | const text_t *text, int len, |
64 | const text_t *text, int len, |
65 | int fg, int bg) = 0; |
65 | int fg, int bg) = 0; |
66 | }; |
66 | }; |
67 | |
67 | |
68 | //#define FONT_REF(obj) (obj)->refcnt++ |
68 | #define FONT_UNREF(f) do { (f)->clear (); delete (f); } while (0) |
69 | //#define FONT_UNREF(obj) if (!--(obj)->refcnt) delete (obj) |
|
|
70 | #define FONT_UNREF(f) delete f |
|
|
71 | |
69 | |
72 | struct rxvt_fallback_font; |
70 | struct rxvt_fallback_font; |
73 | |
71 | |
74 | struct rxvt_fontset { |
72 | struct rxvt_fontset { |
75 | rxvt_fontset (rxvt_t r); |
73 | rxvt_fontset (rxvt_t r); |