diff options
Diffstat (limited to 'unix/tkUnixRFont.c')
-rw-r--r-- | unix/tkUnixRFont.c | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index cac6f8e..d277db8 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -56,14 +56,24 @@ typedef struct { static Tcl_ThreadDataKey dataKey; /* - * Package initialization: - * Nothing to do here except register the fact that we're using Xft in - * the TIP 59 configuration database. + *------------------------------------------------------------------------- + * + * TkpFontPkgInit -- + * + * This procedure is called when an application is created. It + * initializes all the structures that are used by the + * platform-dependant code on a per application basis. + * Note that this is called before TkpInit() ! + * + * Results: + * None. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- */ -#ifndef TCL_CFGVAL_ENCODING -#define TCL_CFGVAL_ENCODING "ascii" -#endif static int utf8ToUcs4(const char *source, FcChar32 *c, int numBytes) { @@ -77,12 +87,7 @@ void TkpFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - static const Tcl_Config cfg[] = { - { "fontsystem", "xft" }, - { 0,0 } - }; - - Tcl_RegisterConfig(mainPtr->interp, "tk", cfg, TCL_CFGVAL_ENCODING); + (void)mainPtr; } static XftFont * @@ -262,9 +267,9 @@ FinishedWithFont( static int InitFontErrorProc( ClientData clientData, - XErrorEvent *errorPtr) + TCL_UNUSED(XErrorEvent *)) { - int *errorFlagPtr = (int *) clientData; + int *errorFlagPtr = (int *)clientData; if (errorFlagPtr != NULL) { *errorFlagPtr = 1; @@ -286,7 +291,7 @@ InitFont( Tk_ErrorHandler handler; if (!fontPtr) { - fontPtr = ckalloc(sizeof(UnixFtFont)); + fontPtr = (UnixFtFont *)ckalloc(sizeof(UnixFtFont)); } FcConfigSubstitute(0, pattern, FcMatchPattern); @@ -304,7 +309,7 @@ InitFont( fontPtr->fontset = set; fontPtr->pattern = pattern; - fontPtr->faces = ckalloc(set->nfont * sizeof(UnixFtFace)); + fontPtr->faces = (UnixFtFace *)ckalloc(set->nfont * sizeof(UnixFtFace)); fontPtr->nfaces = set->nfont; /* @@ -668,7 +673,7 @@ void TkpGetFontAttrsForChar( Tk_Window tkwin, /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ - int c, /* Character of interest */ + int c, /* Character of interest */ TkFontAttributes *faPtr) /* Output: Font attributes */ { UnixFtFont *fontPtr = (UnixFtFont *) tkfont; @@ -677,6 +682,7 @@ TkpGetFontAttrsForChar( /* UCS-4 character to map */ XftFont *ftFont = GetFont(fontPtr, ucs4, 0.0); /* Actual font used to render the character */ + (void)tkwin; GetTkFontAttributes(ftFont, faPtr); faPtr->underline = fontPtr->font.fa.underline; @@ -945,7 +951,7 @@ Tk_DrawChars( } XGetGCValues(display, gc, GCForeground, &values); xftcolor = LookUpColor(display, fontPtr, values.foreground); - if (tsdPtr->clipRegion != None) { + if (tsdPtr->clipRegion != NULL) { XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion); } nspec = 0; @@ -995,7 +1001,7 @@ Tk_DrawChars( } doUnderlineStrikeout: - if (tsdPtr->clipRegion != None) { + if (tsdPtr->clipRegion != NULL) { XftDrawSetClip(fontPtr->ftDraw, NULL); } if (fontPtr->font.fa.underline != 0) { @@ -1087,7 +1093,7 @@ TkDrawAngledChars( nglyph = 0; currentFtFont = NULL; - originX = originY = 0; /* lint */ + originX = originY = 0; while (numBytes > 0) { XftFont *ftFont; @@ -1189,7 +1195,7 @@ TkDrawAngledChars( } XGetGCValues(display, gc, GCForeground, &values); xftcolor = LookUpColor(display, fontPtr, values.foreground); - if (tsdPtr->clipRegion != None) { + if (tsdPtr->clipRegion != NULL) { XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion); } nspec = 0; @@ -1241,7 +1247,7 @@ TkDrawAngledChars( #endif /* XFT_HAS_FIXED_ROTATED_PLACEMENT */ doUnderlineStrikeout: - if (tsdPtr->clipRegion != None) { + if (tsdPtr->clipRegion != NULL) { XftDrawSetClip(fontPtr->ftDraw, NULL); } if (fontPtr->font.fa.underline || fontPtr->font.fa.overstrike) { @@ -1385,12 +1391,12 @@ TkpDrawAngledCharsInContext( void TkUnixSetXftClipRegion( - TkRegion clipRegion) /* The clipping region to install. */ + Region clipRegion) /* The clipping region to install. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - tsdPtr->clipRegion = (Region) clipRegion; + tsdPtr->clipRegion = clipRegion; } /* |