X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d78308f90321ccc428a1f803185becf3abb8ca7..e7300ec6d9ebbd1cfa2fcf12c0ce6e5aee85a152:/src/mac/carbon/dcprint.cpp diff --git a/src/mac/carbon/dcprint.cpp b/src/mac/carbon/dcprint.cpp index f772e44dcd..7f093c6e71 100644 --- a/src/mac/carbon/dcprint.cpp +++ b/src/mac/carbon/dcprint.cpp @@ -27,6 +27,16 @@ #include "wx/msgdlg.h" #include #include "wx/mac/uma.h" +#ifndef __DARWIN__ +#include "Printing.h" +#endif + +#if defined(TARGET_CARBON) && !defined(__DARWIN__) +# if PM_USE_SESSION_APIS +# include +# endif +# include +#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 ;