--- rxvt-unicode/src/rxvtfont.h 2010/03/31 22:46:40 1.34 +++ rxvt-unicode/src/rxvtfont.h 2012/05/17 20:05:55 1.41 @@ -8,7 +8,6 @@ #include -#include "feature.h" #include "encoding.h" #include "rxvtutil.h" #include "rxvttoolkit.h" @@ -58,9 +57,13 @@ int x, int y, const text_t *text, int len, int fg, int bg) = 0; -}; -#define FONT_UNREF(f) do { (f)->clear (); delete (f); } while (0) + void unref () + { + clear (); + delete this; + } +}; struct rxvt_fallback_font; @@ -68,8 +71,15 @@ { char *fontdesc; - enum { fontCount = 3 }; // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h - enum { firstFont = 2 }; // index of first font in set + // must be power-of-two - 1, also has to match RS_fontMask in rxvt.h +#if USE_256_COLORS + enum { fontCount = 7 }; // 4 extra colors bits, 4 fewer fontcount bits +#else + enum { fontCount = 127 }; +#endif + + // index of first font in set + enum { firstFont = 2 }; rxvt_fontset (rxvt_term *term); ~rxvt_fontset (); @@ -98,7 +108,18 @@ simplevec fonts; const rxvt_fallback_font *fallback; - typedef unsigned char pagemap[256]; + // this once was a "typedef xxx pagemap[256] + // but c++ arrays are not normal types, and cnanot be + // put into containers, new doesn't work for them etc. etc. + // so we wrap out array into an objetc that acts like one. doh. + // example: C++ has no separate new and new [] forms, + // and if pagemap is char[256], new incorrectly assumes we want to + // allocate an array of chars instead of a single pagemap. + struct pagemap + { + unsigned char cppsucks[256]; + unsigned char &operator [](int i) { return cppsucks [i]; }; + }; vector fmap; void clear ();