summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authordas <das>2007-06-06 09:55:52 (GMT)
committerdas <das>2007-06-06 09:55:52 (GMT)
commit9097b4e31ebb9a75d2214580079c0eba0b27d8e9 (patch)
tree480bc4a2a26bcba12a790acc330f4781adc0e2e5 /macosx/tkMacOSXWm.c
parentd2f8944de61eb7002614fc793b874eed84a8fa2d (diff)
downloadtk-9097b4e31ebb9a75d2214580079c0eba0b27d8e9.zip
tk-9097b4e31ebb9a75d2214580079c0eba0b27d8e9.tar.gz
tk-9097b4e31ebb9a75d2214580079c0eba0b27d8e9.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/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c81
1 files changed, 22 insertions, 59 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index f4bba1f..96d423a 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.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: tkMacOSXWm.c,v 1.52 2007/06/03 13:44:40 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWm.c,v 1.53 2007/06/06 09:55:52 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -804,17 +804,9 @@ static int WmSetAttribute(
err = ChkErr(FSPathMakeRef, (const unsigned char*) path, &ref,
&d);
if (err == noErr) {
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- if (1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
- && HIWindowSetProxyFSRef != NULL
-#endif
- ) {
+ TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
err = ChkErr(HIWindowSetProxyFSRef, macWindow, &ref);
- } else
-#endif
- {
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
+ ) TK_ELSE_MAC_OS_X (4,
AliasHandle alias;
err = ChkErr(FSNewAlias, NULL, &ref, &alias);
@@ -823,8 +815,7 @@ static int WmSetAttribute(
alias);
DisposeHandle((Handle) alias);
}
-#endif
- }
+ ) TK_ENDIF_MAC_OS_X
}
} else {
int len;
@@ -871,12 +862,7 @@ static int WmSetAttribute(
if (boolean) {
wmPtr->flags |= WM_TRANSPARENT;
wmPtr->attributes |= kWindowNoShadowAttribute;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- if (1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030
- && HIWindowChangeFeatures != NULL
-#endif
- ) {
+ TK_IF_MAC_OS_X_API (3, HIWindowChangeFeatures,
UInt32 features;
ChkErr(GetWindowFeatures, macWindow, &features);
@@ -884,8 +870,7 @@ static int WmSetAttribute(
ChkErr(HIWindowChangeFeatures, macWindow, 0,
kWindowIsOpaque);
}
- }
-#endif
+ ) TK_ENDIF_MAC_OS_X
} else {
wmPtr->flags &= ~WM_TRANSPARENT;
wmPtr->attributes &= ~kWindowNoShadowAttribute;
@@ -944,17 +929,9 @@ static Tcl_Obj *WmGetAttribute(
UInt8 path[PATH_MAX+1];
OSStatus err;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- if (1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
- && HIWindowSetProxyFSRef != NULL
-#endif
- ) {
+ TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
err = ChkErr(HIWindowGetProxyFSRef, macWindow, &ref);
- } else
-#endif
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
- {
+ ) TK_ELSE_MAC_OS_X (4,
Boolean wasChanged;
AliasHandle alias;
@@ -963,8 +940,7 @@ static Tcl_Obj *WmGetAttribute(
err = ChkErr(FSResolveAlias, NULL, alias, &ref,
&wasChanged);
}
- }
-#endif
+ ) TK_ENDIF_MAC_OS_X
if (err == noErr) {
err = ChkErr(FSRefMakePath, &ref, path, PATH_MAX);
}
@@ -5784,8 +5760,7 @@ TkWmStackorderToplevel(parentPtr)
goto done;
}
- frontWindow = (WindowRef) FrontWindow();
-
+ frontWindow = GetFrontWindowOfClass(kAllWindowClasses, false);
if (frontWindow == NULL) {
ckfree((char *) windows);
windows = NULL;
@@ -5794,11 +5769,11 @@ TkWmStackorderToplevel(parentPtr)
*window_ptr-- = NULL;
while (frontWindow != NULL) {
hPtr = Tcl_FindHashEntry(&table, (char *) frontWindow);
- if (hPtr != NULL) {
- childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
- *window_ptr-- = childWinPtr;
- }
- frontWindow = GetNextWindow(frontWindow);
+ if (hPtr != NULL) {
+ childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
+ *window_ptr-- = childWinPtr;
+ }
+ frontWindow = GetNextWindow(frontWindow);
}
if (window_ptr != (windows-1))
Tcl_Panic("num matched toplevel windows does not equal num "
@@ -5859,16 +5834,12 @@ ApplyWindowClassAttributeChanges(
macWindow = GetWindowFromPort(TkMacOSXGetDrawablePort(
winPtr->window));
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- if (wmPtr->macClass != oldClass
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030
- && HIWindowChangeClass != NULL
-#endif
- ) {
- ChkErr(HIWindowChangeClass, macWindow, wmPtr->macClass);
+ if (wmPtr->macClass != oldClass) {
+ TK_IF_MAC_OS_X_API (4, HIWindowChangeClass,
+ ChkErr(HIWindowChangeClass, macWindow, wmPtr->macClass);
+ ) TK_ENDIF_MAC_OS_X
ChkErr(GetWindowClass, macWindow, &(wmPtr->macClass));
}
-#endif
if (newAttributes != oldAttributes) {
newAttributes &= GetAvailableWindowAttributes(wmPtr->macClass);
ChkErr(ChangeWindowAttributes, macWindow,
@@ -6090,20 +6061,12 @@ TkMacOSXEnterExitFullscreen(
static SystemUIOptions fullscreenOptions = 0;
if (!fullscreenMode) {
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- if (1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030
- && &kHIToolboxVersionNumber != NULL
- && kHIToolboxVersionNumber >= kHIToolboxVersionNumber10_3
-#endif
- ) {
+ TK_IF_MAC_OS_X_HI_TOOLBOX (3,
fullscreenMode = kUIModeAllSuppressed;
- } else
-#endif
- {
+ ) TK_ELSE_MAC_OS_X (3,
fullscreenMode = kUIModeAllHidden;
fullscreenOptions = kUIOptionAutoShowMenuBar;
- }
+ ) TK_ENDIF_MAC_OS_X
}
if (mode != fullscreenMode) {
ChkErr(SetSystemUIMode, fullscreenMode, fullscreenOptions);