X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c36f02449beace1fe721e14ad4d87a0700d0c49e..0a0fc5b527437ddb5d41057d60506bfb22ea2bd3:/src/mac/uma.cpp diff --git a/src/mac/uma.cpp b/src/mac/uma.cpp index 49ce364221..2c70ef47b7 100644 --- a/src/mac/uma.cpp +++ b/src/mac/uma.cpp @@ -3,9 +3,7 @@ #include "wx/mac/uma.h" #include "wx/mac/aga.h" -#ifdef __UNIX__ - #include -#else +#ifndef __DARWIN__ #include #endif @@ -86,7 +84,7 @@ void UMAInitToolbox( UInt16 inMoreMastersCalls ) #endif // UMA_USE_WINDOWMGR #endif -#ifndef __UNIX__ +#ifndef __DARWIN__ #if TARGET_CARBON // Call currently implicitely done : InitFloatingWindows() ; #else @@ -291,7 +289,11 @@ void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId ) int gPrOpenCounter = 0 ; -OSStatus UMAPrOpen() +#if TARGET_CARBON && PM_USE_SESSION_APIS +OSStatus UMAPrOpen(PMPrintSession *macPrintSession) +#else +OSStatus UMAPrOpen() +#endif { #if !TARGET_CARBON OSErr err = noErr ; @@ -308,14 +310,22 @@ OSStatus UMAPrOpen() ++gPrOpenCounter ; if ( gPrOpenCounter == 1 ) { - err = PMBegin() ; + #if PM_USE_SESSION_APIS + err = PMCreateSession(macPrintSession) ; + #else + err = PMBegin() ; + #endif wxASSERT( err == noErr ) ; } return err ; #endif } -OSStatus UMAPrClose() +#if TARGET_CARBON && PM_USE_SESSION_APIS +OSStatus UMAPrClose(PMPrintSession *macPrintSession) +#else +OSStatus UMAPrClose() +#endif { #if !TARGET_CARBON OSErr err = noErr ; @@ -333,7 +343,12 @@ OSStatus UMAPrClose() wxASSERT( gPrOpenCounter >= 1 ) ; if ( gPrOpenCounter == 1 ) { - err = PMEnd() ; + #if PM_USE_SESSION_APIS + err = PMRelease(*macPrintSession) ; + *macPrintSession = kPMNoReference; + #else + err = PMEnd() ; + #endif } --gPrOpenCounter ; return err ;