]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dcprint.cpp
corrected path splitting for mac relative paths
[wxWidgets.git] / src / mac / carbon / dcprint.cpp
index f772e44dcd4a7368c65577ecfe992ef75cd8b323..7f093c6e718748d43520556e1dab0fe2385f5c7a 100644 (file)
 #include "wx/msgdlg.h"
 #include <math.h>
 #include "wx/mac/uma.h"
+#ifndef __DARWIN__
+#include "Printing.h"
+#endif
+
+#if defined(TARGET_CARBON) && !defined(__DARWIN__)
+#  if PM_USE_SESSION_APIS
+#    include <PMCore.h>
+#  endif
+#  include <PMApplication.h>
+#endif
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_CLASS(wxPrinterDC, wxDC)
@@ -43,10 +53,10 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
        m_printData.ConvertToNative() ;
 
 #if TARGET_CARBON && PM_USE_SESSION_APIS
-       err = UMAPrOpen((PMPrintSession *)&m_macPrintSessionPort) ;
+       err = UMAPrOpen(&m_macPrintSessionPort) ;
        if ( err != noErr || m_macPrintSessionPort == kPMNoData )
 #else
-       err = UMAPrOpen() ;
+       err = UMAPrOpen(NULL) ;
        if ( err != noErr )
 #endif
        {
@@ -54,9 +64,9 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
                wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
                dialog.ShowModal();
 #if TARGET_CARBON && PM_USE_SESSION_APIS
-               UMAPrClose((PMPrintSession *)&m_macPrintSessionPort) ;
+               UMAPrClose(&m_macPrintSessionPort) ;
 #else
-               UMAPrClose() ;
+               UMAPrClose(NULL) ;
 #endif
                m_ok = FALSE;
                return;
@@ -74,7 +84,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
                message.Printf( "Print Error %d", err ) ;
                wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
                dialog.ShowModal();
-               UMAPrClose() ;
+               UMAPrClose(NULL) ;
                m_ok = FALSE;
                return;
        }
@@ -86,7 +96,7 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
                message.Printf( "Print Error %d", err ) ;
                wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
                dialog.ShowModal();
-               UMAPrClose() ;
+               UMAPrClose(NULL) ;
                m_ok = FALSE;
                return;
        }
@@ -111,9 +121,9 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
                wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
                dialog.ShowModal();
   #if TARGET_CARBON && PM_USE_SESSION_APIS
-               UMAPrClose((PMPrintSession *)&m_macPrintSessionPort) ;
+               UMAPrClose(&m_macPrintSessionPort) ;
   #else
-               UMAPrClose() ;
+               UMAPrClose(NULL) ;
   #endif
                m_ok = FALSE;
                return;
@@ -133,9 +143,9 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
                wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
                dialog.ShowModal();
   #if TARGET_CARBON && PM_USE_SESSION_APIS
-               UMAPrClose((PMPrintSession *)&m_macPrintSessionPort) ;
+               UMAPrClose(&m_macPrintSessionPort) ;
   #else
-               UMAPrClose() ;
+               UMAPrClose(NULL) ;
   #endif
                m_ok = FALSE;
                return;
@@ -172,7 +182,7 @@ wxPrinterDC::~wxPrinterDC(void)
                        wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
                    dialog.ShowModal();
                }
-               ::UMAPrClose() ;
+               ::UMAPrClose(NULL) ;
 //       ::SetPort( macPrintFormerPort ) ;
                ::SetPort( LMGetWMgrPort() ) ;
        }
@@ -191,9 +201,9 @@ wxPrinterDC::~wxPrinterDC(void)
                    dialog.ShowModal();
        }
   #if TARGET_CARBON && PM_USE_SESSION_APIS
-           UMAPrClose((PMPrintSession *)&m_macPrintSessionPort) ;
+           UMAPrClose(&m_macPrintSessionPort) ;
   #else
-           UMAPrClose() ;
+           UMAPrClose(NULL) ;
   #endif
        }
 #endif
@@ -247,7 +257,7 @@ void wxPrinterDC::StartPage(void)
                dialog.ShowModal();
                ::PrClosePage( (TPPrPort) m_macPrintSessionPort ) ;
                ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ;
-               ::UMAPrClose() ;
+               ::UMAPrClose(NULL) ;
                ::SetPort( macPrintFormerPort ) ;
                m_ok = FALSE ;
        }
@@ -267,11 +277,11 @@ void wxPrinterDC::StartPage(void)
   #if PM_USE_SESSION_APIS
                PMSessionEndPage((PMPrintSession)m_macPrintSessionPort);
                PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
-               UMAPrClose((PMPrintSession *)&m_macPrintSessionPort) ;
+               UMAPrClose(&m_macPrintSessionPort) ;
   #else
                PMEndPage(m_macPrintSessionPort);
                PMEndDocument(m_macPrintSessionPort);
-               UMAPrClose() ;
+               UMAPrClose(NULL) ;
   #endif
                ::SetPort( macPrintFormerPort ) ;
                m_ok = FALSE ;
@@ -296,7 +306,7 @@ void wxPrinterDC::EndPage(void)
                wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
                dialog.ShowModal();
                ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort  ) ;
-               ::UMAPrClose() ;
+               ::UMAPrClose(NULL) ;
                ::SetPort( macPrintFormerPort ) ;
                m_ok = FALSE ;
        }
@@ -313,10 +323,10 @@ void wxPrinterDC::EndPage(void)
                dialog.ShowModal();
   #if PM_USE_SESSION_APIS
                PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
-               UMAPrClose((PMPrintSession *)&m_macPrintSessionPort) ;
+               UMAPrClose(&m_macPrintSessionPort) ;
   #else
                PMEndDocument(m_macPrintSessionPort);
-               UMAPrClose() ;
+               UMAPrClose(NULL) ;
   #endif
                ::SetPort( macPrintFormerPort ) ;
                m_ok = FALSE ;