Xnest: drop xnestFontStruct() macro
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
17b27b2ec3
commit
2db318a341
|
|
@ -70,9 +70,7 @@ xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont)
|
|||
priv = (void *) malloc(sizeof(xnestPrivFont));
|
||||
xfont2_font_set_private(pFont, xnestFontPrivateIndex, priv);
|
||||
|
||||
xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name);
|
||||
|
||||
if (!xnestFontStruct(pFont))
|
||||
if (!(xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name)))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -82,8 +80,8 @@ Bool
|
|||
xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
|
||||
{
|
||||
if (xnestFontPriv(pFont)) {
|
||||
if (xnestFontStruct(pFont))
|
||||
XFreeFont(xnestDisplay, xnestFontStruct(pFont));
|
||||
if (xnestFontPriv(pFont)->font_struct)
|
||||
XFreeFont(xnestDisplay, xnestFontPriv(pFont)->font_struct);
|
||||
free(xnestFontPriv(pFont));
|
||||
xfont2_font_set_private(pFont, xnestFontPrivateIndex, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
|
|||
|
||||
free(buffer);
|
||||
|
||||
width = XTextWidth(xnestFontStruct(pGC->font), string, count);
|
||||
width = XTextWidth(xnestFontPriv(pGC->font)->font_struct, string, count);
|
||||
|
||||
return width + x;
|
||||
}
|
||||
|
|
@ -378,7 +378,7 @@ xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
|
|||
|
||||
free(buffer);
|
||||
|
||||
width = XTextWidth16(xnestFontStruct(pGC->font), (XChar2b *) string, count);
|
||||
width = XTextWidth16(xnestFontPriv(pGC->font)->font_struct, (XChar2b *) string, count);
|
||||
|
||||
return width + x;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@ extern int xnestFontPrivateIndex;
|
|||
#define xnestFontPriv(pFont) \
|
||||
((xnestPrivFont *)FontGetPrivate(pFont, xnestFontPrivateIndex))
|
||||
|
||||
#define xnestFontStruct(pFont) (xnestFontPriv(pFont)->font_struct)
|
||||
|
||||
#define xnestFont(pFont) (xnestFontStruct(pFont)->fid)
|
||||
#define xnestFont(pFont) (xnestFontPriv(pFont)->font_struct->fid)
|
||||
|
||||
Bool xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont);
|
||||
Bool xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont);
|
||||
|
|
|
|||
Loading…
Reference in New Issue