From f4c80a78ce0e5648334fc43e5c93a068ed3ec5be Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 9 Feb 2017 14:05:57 +0100 Subject: Xserver: Support building against libXfont2 (v2) API and old libXfont(1) API alike. Fixes ArcticaProject/nx-libs#296. Inspired by the following X.org commit. Other than X.org, we will continue support for building nx-libs against libXfont1 for a while. commit 05a793f5b3c40747d5a92a076def7f4fb673c7e7 Author: Keith Packard Date: Tue Sep 1 18:50:55 2015 -0700 dix: Switch to the libXfont2 API (v2) This new libXfont API eliminates exposing internal X server symbols to the font library, replacing those with a struct full of the entire API needed to use that library. v2: Use libXfont2 instead of libXfont_2 Signed-off-by: Keith Packard Reviewed-by: Adam Jackson --- nx-X11/programs/Xserver/hw/nxagent/Font.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Font.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index e1f12e733..f9c682765 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -41,6 +41,7 @@ is" without express or implied warranty. #include "dixstruct.h" #include #include +#include "dixfontstr.h" #include "misc.h" #include "miscstruct.h" #include "opaque.h" @@ -495,7 +496,11 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) const char *name; char *origName = (char*) pScreen; +#ifdef HAS_XFONT2 + xfont2_font_set_private(pFont, nxagentFontPrivateIndex, NULL); +#else FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL); +#endif /* HAS_XFONT2 */ if (requestingClient && XpClientIsPrintClient(requestingClient, NULL)) return True; @@ -540,7 +545,11 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) } priv = (void *)malloc(sizeof(nxagentPrivFont)); +#ifdef HAS_XFONT2 + xfont2_font_set_private(pFont, nxagentFontPrivateIndex, priv); +#else FontSetPrivate(pFont, nxagentFontPrivateIndex, priv); +#endif /* HAS_XFONT2 */ nxagentFontPriv(pFont) -> mirrorID = 0; @@ -688,7 +697,11 @@ Bool nxagentUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) FreeResource(nxagentFontPriv(pFont) -> mirrorID, RT_NONE); free(nxagentFontPriv(pFont)); +#ifdef HAS_XFONT2 + xfont2_font_set_private(pFont, nxagentFontPrivateIndex, NULL); +#else FontSetPrivate(pFont, nxagentFontPrivateIndex, NULL); +#endif /* HAS_XFONT2 */ } return True; -- cgit v1.2.3