]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/uma.cpp
use GetText() instead of GetText(wxString&), made some methods inline
[wxWidgets.git] / src / mac / uma.cpp
index 49ce364221e11998dfcf7cb990791dc5113b4e6e..e0e3bdf35f88a621b63cf258ace2b03d3e59860f 100644 (file)
@@ -3,9 +3,7 @@
 #include "wx/mac/uma.h"
 #include "wx/mac/aga.h"
 
-#ifdef __UNIX__
-  #include <Carbon/Carbon.h>
-#else
+#ifndef __UNIX__
   #include <Navigation.h>
 #endif
 
@@ -291,7 +289,11 @@ void UMAInsertMenu( MenuRef insertMenu , SInt16 afterId )
 
 int gPrOpenCounter = 0 ;
 
-OSStatus UMAPrOpen() 
+#if PM_USE_SESSION_APIS
+OSStatus UMAPrOpen(PMPrintSession *macPrintPort)
+#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(macPrintPort) ;
+  #else
+           err = PMBegin() ;
+  #endif
                wxASSERT( err == noErr ) ;
        }
        return err ;
 #endif
 }
 
-OSStatus UMAPrClose() 
+#if PM_USE_SESSION_APIS
+OSStatus UMAPrClose(PMPrintSession *macPrintPort)
+#else
+OSStatus UMAPrClose()
+#endif
 {
 #if !TARGET_CARBON
        OSErr err = noErr ;
@@ -333,7 +343,11 @@ OSStatus UMAPrClose()
        wxASSERT( gPrOpenCounter >= 1 ) ;
        if ( gPrOpenCounter == 1 )
        {
-               err = PMEnd() ;
+  #if PM_USE_SESSION_APIS
+           err = PMRelease(*macPrintPort) ;
+  #else
+           err = PMEnd() ;
+  #endif
        }
        --gPrOpenCounter ;
        return err ;