X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d78308f90321ccc428a1f803185becf3abb8ca7..1fd1922a49351a377bc6ef8f7e00f150112ee096:/src/mac/carbon/dcprint.cpp diff --git a/src/mac/carbon/dcprint.cpp b/src/mac/carbon/dcprint.cpp index f772e44dcd..1f36616c8f 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,20 +53,20 @@ 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 { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; 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; @@ -71,10 +81,10 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) err = PrError() ; if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); - UMAPrClose() ; + UMAPrClose(NULL) ; m_ok = FALSE; return; } @@ -83,10 +93,10 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) err = PrError() ; if ( err ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); - UMAPrClose() ; + UMAPrClose(NULL) ; m_ok = FALSE; return; } @@ -107,13 +117,13 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) if ( err != noErr || m_macPrintSessionPort == kPMNoReference ) #endif { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; 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; @@ -129,13 +139,13 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) err = PMGetAdjustedPaperRect((PMPageFormat)m_printData.m_macPageFormat, &rPaper); if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; 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; @@ -168,11 +178,11 @@ wxPrinterDC::~wxPrinterDC(void) } else { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); } - ::UMAPrClose() ; + ::UMAPrClose(NULL) ; // ::SetPort( macPrintFormerPort ) ; ::SetPort( LMGetWMgrPort() ) ; } @@ -186,14 +196,14 @@ wxPrinterDC::~wxPrinterDC(void) #endif if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; 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 } #endif @@ -242,12 +252,12 @@ void wxPrinterDC::StartPage(void) err = PrError() ; if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); ::PrClosePage( (TPPrPort) m_macPrintSessionPort ) ; ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ; - ::UMAPrClose() ; + ::UMAPrClose(NULL) ; ::SetPort( macPrintFormerPort ) ; m_ok = FALSE ; } @@ -261,17 +271,17 @@ void wxPrinterDC::StartPage(void) #endif if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); #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 ; @@ -292,11 +302,11 @@ void wxPrinterDC::EndPage(void) err = PrError() ; if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); ::PrCloseDoc( (TPPrPort) m_macPrintSessionPort ) ; - ::UMAPrClose() ; + ::UMAPrClose(NULL) ; ::SetPort( macPrintFormerPort ) ; m_ok = FALSE ; } @@ -308,15 +318,15 @@ void wxPrinterDC::EndPage(void) #endif if ( err != noErr ) { - message.Printf( "Print Error %d", err ) ; + message.Printf( "Print Error %ld", err ) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; 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 ;