summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXColor.c
diff options
context:
space:
mode:
authordas <das>2007-06-06 09:55:52 (GMT)
committerdas <das>2007-06-06 09:55:52 (GMT)
commitadc0bc4faa9cf2596b856fd534befb42fab5d366 (patch)
tree480bc4a2a26bcba12a790acc330f4781adc0e2e5 /macosx/tkMacOSXColor.c
parent9f684a33310103c2c81b8afa31efbf646c5354ee (diff)
downloadtk-adc0bc4faa9cf2596b856fd534befb42fab5d366.zip
tk-adc0bc4faa9cf2596b856fd534befb42fab5d366.tar.gz
tk-adc0bc4faa9cf2596b856fd534befb42fab5d366.tar.bz2
* macosx/tkMacOSXMouseEvent.c (GenerateMouseWheelEvent): enable
processing of mousewheel events in background windows. * macosx/tkMacOSXScrlbr.c: modernize checks for active/front window. * macosx/tkMacOSXScale.c: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXColor.c: factor out verbose #ifdef checks of * macosx/tkMacOSXDraw.c: MAC_OS_X_VERSION_{MAX_ALLOWED,MIN_REQUIRED} * macosx/tkMacOSXEntry.c: and runtime checks of kHIToolboxVersion into * macosx/tkMacOSXEvent.c: new TK_{IF,ELSE,ENDIF}_MAC_OS_X macros. * macosx/tkMacOSXInit.c: * macosx/tkMacOSXInt.h: * macosx/tkMacOSXWm.c: * macosx/tkMacOSXDraw.c: factor out clip clearing in QD ports; * macosx/tkMacOSXEntry.c: formatting cleanup. * macosx/Wish.xcodeproj/project.pbxproj: add settings for Fix&Continue.
Diffstat (limited to 'macosx/tkMacOSXColor.c')
-rw-r--r--macosx/tkMacOSXColor.c62
1 files changed, 19 insertions, 43 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index c8944e4..7355356 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXColor.c,v 1.9 2007/05/31 13:38:13 das Exp $
+ * RCS: @(#) $Id: tkMacOSXColor.c,v 1.10 2007/06/06 09:55:52 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -382,50 +382,34 @@ TkMacOSXSetColorInContext(unsigned long pixel, CGContextRef context)
if (GetThemeFromPixelCode((pixel >> 24) & 0xff, &brush, &textColor,
&background)) {
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
if (brush) {
- if (1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
- && HIThemeSetFill != NULL && HIThemeSetStroke != NULL
-#endif
- ) {
+ TK_IF_MAC_OS_X_API (4, HIThemeSetFill,
err = ChkErr(HIThemeSetFill, brush, NULL, context,
kHIThemeOrientationNormal);
- if (err == noErr) {
+ TK_IF_MAC_OS_X_API_COND (4, err == noErr, HIThemeSetFill,
err = ChkErr(HIThemeSetStroke, brush, NULL, context,
kHIThemeOrientationNormal);
- }
- }
+ ) TK_ENDIF_MAC_OS_X
+ ) TK_ENDIF_MAC_OS_X
} else if (textColor) {
- if (1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
- && HIThemeSetTextFill != NULL
-#endif
- ) {
+ TK_IF_MAC_OS_X_API (4, HIThemeSetTextFill,
err = ChkErr(HIThemeSetTextFill, textColor, NULL, context,
kHIThemeOrientationNormal);
- }
- } else
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- if (background) {
- if (1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030
- && CGContextGetClipBoundingBox != NULL
- && HIThemeApplyBackground != NULL
- && &kHIToolboxVersionNumber != NULL /* c.f. QA1377 */
- && kHIToolboxVersionNumber >= kHIToolboxVersionNumber10_3
-#endif
- ) {
+ ) TK_ENDIF_MAC_OS_X
+ } else if (background) {
+ TK_IF_MAC_OS_X_API (3, CGContextGetClipBoundingBox,
CGRect rect = CGContextGetClipBoundingBox(context);
HIThemeBackgroundDrawInfo info = { 0, kThemeStateActive,
background };
- err = ChkErr(HIThemeApplyBackground, &rect, &info, context,
- kHIThemeOrientationNormal);
- }
+ TK_IF_MAC_OS_X_API (3, HIThemeApplyBackground,
+ TK_IF_MAC_OS_X_HI_TOOLBOX (3, /* c.f. QA1377 */
+ err = ChkErr(HIThemeApplyBackground, &rect, &info,
+ context, kHIThemeOrientationNormal);
+ ) TK_ENDIF_MAC_OS_X
+ ) TK_ENDIF_MAC_OS_X
+ ) TK_ENDIF_MAC_OS_X
}
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
if (err == noErr) {
return;
}
@@ -458,17 +442,9 @@ TkMacOSXSetColorInContext(unsigned long pixel, CGContextRef context)
Tcl_Panic("TkMacOSXSetColorInContext(): "
"pattern initialization failed !");
}
- bitmapInfo =
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- (1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
- && &kHIToolboxVersionNumber != NULL
- && kHIToolboxVersionNumber >=
- kHIToolboxVersionNumber10_4
-#endif
- ) ? kCGBitmapByteOrder32Host :
-#endif
- 0;
+ TK_IF_MAC_OS_X_HI_TOOLBOX (4,
+ bitmapInfo = kCGBitmapByteOrder32Host;
+ ) TK_ENDIF_MAC_OS_X
}
portChanged = QDSwapPort(patGWorld, &savePort);
TkMacOSXSetColorInPort(pixel, 1, pixpat);