- wxMacClassicPrintData *native = (wxMacClassicPrintData*) data->m_nativePrintData ;
-
- if ( ::PrValidate( native->m_macPrintSettings ) )
- {
- // the driver has changed in the mean time, should we pop up a page setup dialog ?
- if ( !::PrStlDialog( native->m_macPrintSettings ) )
- {
- m_err = -1 ;
- return;
- }
- }
- m_err = PrError() ;
-
- if ( m_err == noErr )
- {
- m_maxX = (**native->m_macPrintSettings).prInfo.rPage.right - (**native->m_macPrintSettings).prInfo.rPage.left ;
- m_maxY = (**native->m_macPrintSettings).prInfo.rPage.bottom - (**native->m_macPrintSettings).prInfo.rPage.top ;
- }
-}
-
-wxMacClassicPrinterDC::~wxMacClassicPrinterDC()
-{
- ::UMAPrClose() ;
- ::SetPort( LMGetWMgrPort() ) ;
-}
-
-bool wxMacClassicPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED(message) )
-{
- if ( m_err )
- return false ;
-
- wxMacClassicPrintData *native = (wxMacClassicPrintData*) dc->GetPrintData().m_nativePrintData ;
- m_macPrintingPort = ::PrOpenDoc( native->m_macPrintSettings , NULL , NULL ) ;
- m_err = PrError() ;
- if ( m_err )
- return false ;
-
- // sets current port
- dc->m_macPort = (GrafPtr ) m_macPrintingPort ;
- m_maxX = (**native->m_macPrintSettings).prInfo.rPage.right - (**native->m_macPrintSettings).prInfo.rPage.left ;
- m_maxY = (**native->m_macPrintSettings).prInfo.rPage.bottom - (**native->m_macPrintSettings).prInfo.rPage.top ;
- return true ;
-}
-
-void wxMacClassicPrinterDC::EndDoc( wxPrinterDC* dc )
-{
- if ( m_err )
- return ;
-
- PrCloseDoc( m_macPrintingPort ) ;
- m_err = PrError() ;
-}
-
-void wxMacClassicPrinterDC::StartPage( wxPrinterDC* dc )
-{
- if ( m_err )
- return ;
-
- wxMacClassicPrintData *native = (wxMacClassicPrintData*) dc->GetPrintData().m_nativePrintData ;
-
- PrOpenPage( m_macPrintingPort , NULL ) ;
- dc->m_macLocalOrigin.x = (**native->m_macPrintSettings).rPaper.left ;
- dc->m_macLocalOrigin.y = (**native->m_macPrintSettings).rPaper.top ;
- // m_macPrintingPort is now the current port
- Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
- ::ClipRect( &clip ) ;
- m_err = PrError() ;
- if ( m_err != noErr )
- ::PrCloseDoc( m_macPrintingPort ) ;
-}
-
-void wxMacClassicPrinterDC::EndPage( wxPrinterDC* dc )
-{
- if ( m_err )
- return ;
-
- PrClosePage( m_macPrintingPort ) ;
- m_err = PrError() ;
- if ( m_err != noErr )
- ::PrCloseDoc( m_macPrintingPort ) ;
-}
-
-#endif