diff options
author | jenglish <jenglish@flightlab.com> | 2009-02-08 19:35:35 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2009-02-08 19:35:35 (GMT) |
commit | a7f3e6b8652f5d9ea2c4db8a47c14033cb559466 (patch) | |
tree | b77850fad5f37f79d05730f2d09bec514b78f07c /generic/ttk/ttkCache.c | |
parent | 76e883da5646c90946512d237df48377778d63cc (diff) | |
download | tk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.zip tk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.tar.gz tk-a7f3e6b8652f5d9ea2c4db8a47c14033cb559466.tar.bz2 |
Renamed several internal data structures and functions:
ElementImpl -> ElementClass, LayoutNode -> Element.
Remove more unnecessary casts.
Add function Ttk_ClientRegion, common factor
of entry, scale, progress, and treeview widgets.
Diffstat (limited to 'generic/ttk/ttkCache.c')
-rw-r--r-- | generic/ttk/ttkCache.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c index 0d558d4..8bb54ec 100644 --- a/generic/ttk/ttkCache.c +++ b/generic/ttk/ttkCache.c @@ -1,6 +1,6 @@ /* - * $Id: ttkCache.c,v 1.2 2009/01/28 20:47:49 nijtmans Exp $ - * Ttk theme engine, resource cache. + * $Id: ttkCache.c,v 1.3 2009/02/08 19:35:35 jenglish Exp $ + * Theme engine resource cache. * * Copyright (c) 2004, Joe English * @@ -77,7 +77,7 @@ static void Ttk_ClearCache(Ttk_ResourceCache cache) */ entryPtr = Tcl_FirstHashEntry(&cache->fontTable, &search); while (entryPtr != NULL) { - Tcl_Obj *fontObj = (Tcl_Obj*)Tcl_GetHashValue(entryPtr); + Tcl_Obj *fontObj = Tcl_GetHashValue(entryPtr); if (fontObj) { Tk_FreeFontFromObj(cache->tkwin, fontObj); Tcl_DecrRefCount(fontObj); @@ -92,7 +92,7 @@ static void Ttk_ClearCache(Ttk_ResourceCache cache) */ entryPtr = Tcl_FirstHashEntry(&cache->colorTable, &search); while (entryPtr != NULL) { - Tcl_Obj *colorObj = (Tcl_Obj*)Tcl_GetHashValue(entryPtr); + Tcl_Obj *colorObj = Tcl_GetHashValue(entryPtr); if (colorObj) { Tk_FreeColorFromObj(cache->tkwin, colorObj); Tcl_DecrRefCount(colorObj); @@ -107,7 +107,7 @@ static void Ttk_ClearCache(Ttk_ResourceCache cache) */ entryPtr = Tcl_FirstHashEntry(&cache->borderTable, &search); while (entryPtr != NULL) { - Tcl_Obj *borderObj = (Tcl_Obj*)Tcl_GetHashValue(entryPtr); + Tcl_Obj *borderObj = Tcl_GetHashValue(entryPtr); if (borderObj) { Tk_Free3DBorderFromObj(cache->tkwin, borderObj); Tcl_DecrRefCount(borderObj); @@ -122,7 +122,7 @@ static void Ttk_ClearCache(Ttk_ResourceCache cache) */ entryPtr = Tcl_FirstHashEntry(&cache->imageTable, &search); while (entryPtr != NULL) { - Tk_Image image = (Tk_Image)Tcl_GetHashValue(entryPtr); + Tk_Image image = Tcl_GetHashValue(entryPtr); if (image) { Tk_FreeImage(image); } @@ -155,7 +155,7 @@ void Ttk_FreeResourceCache(Ttk_ResourceCache cache) */ entryPtr = Tcl_FirstHashEntry(&cache->namedColors, &search); while (entryPtr != NULL) { - Tcl_Obj *colorNameObj = (Tcl_Obj*)Tcl_GetHashValue(entryPtr); + Tcl_Obj *colorNameObj = Tcl_GetHashValue(entryPtr); Tcl_DecrRefCount(colorNameObj); entryPtr = Tcl_NextHashEntry(&search); } @@ -170,7 +170,7 @@ void Ttk_FreeResourceCache(Ttk_ResourceCache cache) */ static void CacheWinEventHandler(ClientData clientData, XEvent *eventPtr) { - Ttk_ResourceCache cache = (Ttk_ResourceCache)clientData; + Ttk_ResourceCache cache = clientData; if (eventPtr->type != DestroyNotify) { return; @@ -192,7 +192,7 @@ static void InitCacheWindow(Ttk_ResourceCache cache, Tk_Window tkwin) if (cache->tkwin == NULL) { cache->tkwin = tkwin; Tk_CreateEventHandler(tkwin, StructureNotifyMask, - CacheWinEventHandler, (ClientData)cache); + CacheWinEventHandler, cache); } } @@ -200,7 +200,6 @@ static void InitCacheWindow(Ttk_ResourceCache cache, Tk_Window tkwin) * Ttk_RegisterNamedColor -- * Specify an RGB triplet as a named color. * Overrides any previous named color specification. - * */ void Ttk_RegisterNamedColor( Ttk_ResourceCache cache, @@ -219,7 +218,7 @@ void Ttk_RegisterNamedColor( entryPtr = Tcl_CreateHashEntry(&cache->namedColors, colorName, &newEntry); if (!newEntry) { - Tcl_Obj *oldColor = (Tcl_Obj*)Tcl_GetHashValue(entryPtr); + Tcl_Obj *oldColor = Tcl_GetHashValue(entryPtr); Tcl_DecrRefCount(oldColor); } @@ -237,7 +236,7 @@ static Tcl_Obj *CheckNamedColor(Ttk_ResourceCache cache, Tcl_Obj *objPtr) Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(&cache->namedColors, Tcl_GetString(objPtr)); if (entryPtr) { /* Use named color instead */ - objPtr = (Tcl_Obj *)Tcl_GetHashValue(entryPtr); + objPtr = Tcl_GetHashValue(entryPtr); } return objPtr; } @@ -260,7 +259,7 @@ static Tcl_Obj *Ttk_Use( Tcl_Obj *cacheObj; if (!newEntry) { - return (Tcl_Obj*)Tcl_GetHashValue(entryPtr); + return Tcl_GetHashValue(entryPtr); } cacheObj = Tcl_DuplicateObj(objPtr); @@ -336,7 +335,7 @@ Tk_Image Ttk_UseImage(Ttk_ResourceCache cache, Tk_Window tkwin, Tcl_Obj *objPtr) InitCacheWindow(cache, tkwin); if (!newEntry) { - return (Tk_Image)Tcl_GetHashValue(entryPtr); + return Tcl_GetHashValue(entryPtr); } image = Tk_GetImage(cache->interp, tkwin, imageName, NullImageChanged,0); |