X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3d3d3bf6cd84e44521a1617df5e38ed02c6fee2..4b04699b670b4ab4632229fa0264d154acd3bec1:/src/mac/carbon/uma.cpp diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index c899f87471..c9342a3947 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -10,6 +10,8 @@ # include # endif # include +# else +# include # endif #endif @@ -92,7 +94,6 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls ) sUMAHasWindowManager = sUMAWindowManagerAttr & gestaltWindowMgrPresent ; } -#ifndef __DARWIN__ #if TARGET_CARBON // Call currently implicitely done : InitFloatingWindows() ; #else @@ -100,7 +101,6 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls ) InitFloatingWindows() ; else InitWindows(); -#endif #endif if ( NavServicesAvailable() ) @@ -121,8 +121,17 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls ) if ( menuMgrAttr & gestaltMenuMgrAquaLayoutMask ) sUMAHasAquaLayout = true ; sUMASystemInitialized = true ; + } +/* +Boolean CanUseATSUI() + { + long result; + OSErr err = Gestalt(gestaltATSUVersion, &result); + return (err == noErr); + } +*/ // process manager long UMAGetProcessMode() { @@ -368,7 +377,7 @@ GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) { wxASSERT( inWindowRef != NULL ) ; #if TARGET_CARBON - return GetWindowPort( inWindowRef ) ; + return (GrafPtr) GetWindowPort( inWindowRef ) ; #else return (GrafPtr) inWindowRef ; #endif @@ -577,9 +586,10 @@ OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState ) return ::DrawThemePlacard( inRect , inState ) ; } +#if !TARGET_CARBON static OSStatus helpMenuStatus = noErr ; -static MenuRef helpMenuHandle = NULL ; static MenuItemIndex firstCustomItemIndex = 0 ; +#endif OSStatus UMAGetHelpMenu( MenuRef * outHelpMenu, @@ -588,13 +598,11 @@ OSStatus UMAGetHelpMenu( #if TARGET_CARBON return HMGetHelpMenu( outHelpMenu , outFirstCustomItemIndex ) ; #else - if ( helpMenuHandle == NULL ) + MenuRef helpMenuHandle ; + helpMenuStatus = HMGetHelpMenuHandle( &helpMenuHandle ) ; + if ( firstCustomItemIndex == 0 && helpMenuStatus == noErr ) { - helpMenuStatus = HMGetHelpMenuHandle( &helpMenuHandle ) ; - if ( helpMenuStatus == noErr ) - { - firstCustomItemIndex = CountMenuItems( helpMenuHandle ) + 1 ; - } + firstCustomItemIndex = CountMenuItems( helpMenuHandle ) + 1 ; } if ( outFirstCustomItemIndex ) {