#include "wx/dcprint.h"
#include "wx/msgdlg.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
// Use generic page setup dialog: use your own native one if one exists.
wxPrintDialog::~wxPrintDialog()
{
- if (m_destroyDC && m_printerDC)
+ if (m_destroyDC && m_printerDC) {
delete m_printerDC;
+ m_printerDC = NULL;
+ }
}
int wxPrintDialog::ShowModal()
wxString message ;
#if !TARGET_CARBON
- err = ::UMAPrOpen() ;
+ err = ::UMAPrOpen(NULL) ;
if ( err == noErr )
{
m_printDialogData.ConvertToNative() ;
- if ( ::PrJobDialog( (THPrint) m_printDialogData.GetPrintData().m_macPrintInfo ) )
+ if ( ::PrJobDialog( (THPrint) m_printDialogData.GetPrintData().m_macPrintSettings ) )
{
m_printDialogData.ConvertFromNative() ;
result = wxID_OK ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
- ::UMAPrClose() ;
+ ::UMAPrClose(NULL) ;
#else
#if PM_USE_SESSION_APIS
PMPrintSession macPrintSession = kPMNoReference;
wxString message ;
#if !TARGET_CARBON
- err = ::UMAPrOpen() ;
+ err = ::UMAPrOpen(NULL) ;
if ( err == noErr )
{
m_pageSetupData.ConvertToNative() ;
- if ( ::PrStlDialog( (THPrint) m_pageSetupData.GetPrintData().m_macPrintInfo ) )
+ if ( ::PrStlDialog( (THPrint) m_pageSetupData.GetPrintData().m_macPrintSettings ) )
{
m_pageSetupData.ConvertFromNative() ;
result = wxID_OK ;
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal();
}
- ::UMAPrClose() ;
+ ::UMAPrClose(NULL) ;
#else
#if PM_USE_SESSION_APIS
PMPrintSession macPrintSession = kPMNoReference;