diff options
Diffstat (limited to 'macosx/tkMacOSXColor.c')
-rw-r--r-- | macosx/tkMacOSXColor.c | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 8885792..813f59b 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -92,9 +92,9 @@ void initColorTable() for (key in [systemColorList allKeys]) { int length = [key lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; char *name; - entry = ckalloc(sizeof(SystemColorDatum)); + entry = (SystemColorDatum *)ckalloc(sizeof(SystemColorDatum)); bzero(entry, sizeof(SystemColorDatum)); - name = ckalloc(length + 1); + name = (char *)ckalloc(length + 1); strcpy(name, key.UTF8String); name[0] = toupper(name[0]); if (!strcmp(name, "WindowBackgroundColor")) { @@ -124,7 +124,7 @@ void initColorTable() */ numSystemColors = index; - systemColorIndex = ckalloc(numSystemColors * sizeof(SystemColorDatum*)); + systemColorIndex = (SystemColorDatum **)ckalloc(numSystemColors * sizeof(SystemColorDatum *)); for (hPtr = Tcl_FirstHashEntry(&systemColors, &search); hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr); @@ -335,27 +335,6 @@ GetRGBA( break; case clearColor: rgba[3] = 0; - case HIText: -#ifdef __LP64__ - color = [[NSColor textColor] colorUsingColorSpace:sRGB]; - [color getComponents: rgba]; -#else - { - RGBColor rgb; - err = GetThemeTextColor(kThemeTextColorPushButtonActive, 32, - true, &rgb); - if (err == noErr) { - rgba[0] = (CGFLoat) rgb.red / 65535; - rgba[1] = (CGFLoat) rgb.green / 65535; - rgba[2] = (CGFLoat) rgb.blue / 65535; - } - } -#endif - break; - case HIBackground: - color = [[NSColor windowBackgroundColor] colorUsingColorSpace:sRGB]; - [color getComponents: rgba]; - break; default: break; } @@ -372,12 +351,6 @@ GetRGBA( * values are copied into the CGColorRef. Otherwise the components are * computed from the SystemColorDatum. * - * In 64 bit macOS systems there are no HITheme functions which convert - * HIText or HIBackground colors to CGColors. (GetThemeTextColor was - * removed, and it was never possible with backgrounds.) On 64-bit systems - * we replace all HIText colors by systemTextColor and all HIBackground - * colors by systemWindowBackgroundColor. - * * Results: * True if the function succeeds, false otherwise. * @@ -663,8 +636,6 @@ TkMacOSXSetColorInContext( OSStatus err = noErr; CGColorRef cgColor = nil; SystemColorDatum *entry = GetEntryFromPixel(pixel); - CGRect rect; - HIThemeBackgroundDrawInfo info = {0, kThemeStateActive, 0};; if (entry) { switch (entry->type) { @@ -676,16 +647,6 @@ TkMacOSXSetColorInContext( kHIThemeOrientationNormal); } break; - case HIText: - err = ChkErr(HIThemeSetTextFill, entry->value, NULL, context, - kHIThemeOrientationNormal); - break; - case HIBackground: - info.kind = entry->value; - rect = CGContextGetClipBoundingBox(context); - err = ChkErr(HIThemeApplyBackground, &rect, &info, - context, kHIThemeOrientationNormal); - break; default: if (SetCGColorComponents(entry, pixel, &cgColor)){ SetCachedColor(gc, pixel, cgColor); |