--- rxvt-unicode/src/rxvtfont.C 2006/01/25 13:24:45 1.86 +++ rxvt-unicode/src/rxvtfont.C 2006/01/30 02:21:20 1.90 @@ -159,7 +159,7 @@ #define NUM_EXTENT_TEST_CHARS (sizeof (extent_test_chars) / sizeof (extent_test_chars[0])) -#define dTermDisplay Display *disp = term->display->display +#define dTermDisplay Display *disp = term->xdisp #define dTermGC GC gc = term->gc ///////////////////////////////////////////////////////////////////////////// @@ -174,7 +174,7 @@ rxvt_drawable::operator XftDraw *() { if (!xftdrawable) - xftdrawable = XftDrawCreate (display->display, drawable, display->visual, display->cmap); + xftdrawable = XftDrawCreate (screen->xdisp, drawable, screen->visual, screen->cmap); return xftdrawable; } @@ -247,7 +247,7 @@ dTermGC; if (color == Color_bg) - XClearArea (disp, d, x, y, w, h, FALSE); + XClearArea (disp, d, x, y, w, h, false); else if (color >= 0) { #if XFT @@ -495,19 +495,19 @@ codeset cs; bool enc2b, encm; - char *get_property (XFontStruct *f, const char *property, const char *repl) const; + char *get_property (XFontStruct *f, Atom property, const char *repl) const; bool set_properties (rxvt_fontprop &p, int height, const char *weight, const char *slant, int avgwidth); bool set_properties (rxvt_fontprop &p, XFontStruct *f); bool set_properties (rxvt_fontprop &p, const char *name); }; char * -rxvt_font_x11::get_property (XFontStruct *f, const char *property, const char *repl) const +rxvt_font_x11::get_property (XFontStruct *f, Atom property, const char *repl) const { unsigned long value; - if (XGetFontProperty (f, XInternAtom (term->display->display, property, 0), &value)) - return XGetAtomName (term->display->display, value); + if (XGetFontProperty (f, property, &value)) + return XGetAtomName (term->xdisp, value); else return rxvt_strdup (repl); } @@ -538,18 +538,18 @@ unsigned long height; #if 0 - if (!XGetFontProperty (f, XInternAtom (term->display->display, "PIXEL_SIZE", 0), &height)) + if (!XGetFontProperty (f, XInternAtom (term->xdisp, "PIXEL_SIZE", 0), &height)) return false; #else height = f->ascent + f->descent; #endif unsigned long avgwidth; - if (!XGetFontProperty (f, XInternAtom (term->display->display, "AVERAGE_WIDTH", 0), &avgwidth)) + if (!XGetFontProperty (f, term->xa [XA_AVERAGE_WIDTH], &avgwidth)) avgwidth = 0; - char *weight = get_property (f, "WEIGHT_NAME", "medium"); - char *slant = get_property (f, "SLANT", "r"); + char *weight = get_property (f, term->xa [XA_WEIGHT_NAME], "medium"); + char *slant = get_property (f, term->xa [XA_SLANT], "r"); set_properties (p, height, weight, slant, avgwidth); @@ -657,7 +657,7 @@ if (!f) return false; - char *new_name = get_property (f, "FONT", name); + char *new_name = get_property (f, XA_FONT, name); if (new_name) set_name (new_name); @@ -776,8 +776,8 @@ if (!f) return false; - char *registry = get_property (f, "CHARSET_REGISTRY", 0); - char *encoding = get_property (f, "CHARSET_ENCODING", 0); + char *registry = get_property (f, term->xa [XA_CHARSET_REGISTRY], 0); + char *encoding = get_property (f, term->xa [XA_CHARSET_ENCODING], 0); if (registry && encoding) { @@ -788,7 +788,7 @@ } else { - const char *charset = get_property (f, "FONT", 0); + const char *charset = get_property (f, XA_FONT, 0); if (!charset) charset = name; @@ -886,7 +886,7 @@ { if (f) { - XFreeFont (term->display->display, f); + XFreeFont (term->xdisp, f); f = 0; } } @@ -1068,7 +1068,7 @@ { if (f) { - XftFontClose (term->display->display, f); + XftFontClose (term->xdisp, f); f = 0; } } @@ -1245,7 +1245,7 @@ { careful = false; - if (!XftCharExists (term->display->display, f, unicode)) + if (!XftCharExists (term->xdisp, f, unicode)) return false; if (!prop || prop->width == rxvt_fontprop::unset) @@ -1254,7 +1254,7 @@ // check character against base font bounding box FcChar32 ch = unicode; XGlyphInfo g; - XftTextExtents32 (term->display->display, f, &ch, 1, &g); + XftTextExtents32 (term->xdisp, f, &ch, 1, &g); int w = g.width - g.x; int wcw = WCWIDTH (unicode); @@ -1562,7 +1562,7 @@ //FcPatternAddBool (p, FC_ANTIALIAS, 1); XftResult result; - FcPattern *match = XftFontMatch (term->display->display, term->display->screen, p, &result); + FcPattern *match = XftFontMatch (term->xdisp, term->display->screen, p, &result); FcPatternDestroy (p);