- wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) dc->GetPrintData().m_nativePrintData ;
-
- m_err = PMSessionEndPage(native->m_macPrintSession);
- if ( m_err != noErr )
- {
- PMSessionEndDocument(native->m_macPrintSession);
- }
-}
-
-#else
-
-class wxMacClassicPrinterDC : public wxNativePrinterDC
-{
-public :
- wxMacClassicPrinterDC( wxPrintData* data ) ;
- ~wxMacClassicPrinterDC() ;
- virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) ;
- virtual void EndDoc( wxPrinterDC* dc ) ;
- virtual void StartPage( wxPrinterDC* dc ) ;
- virtual void EndPage( wxPrinterDC* dc ) ;
- virtual wxCoord GetMaxX() const { return m_maxX ; }
- virtual wxCoord GetMaxY() const { return m_maxY ; }
- virtual wxUint32 GetStatus() const { return m_err ; }
-private :
- GrafPtr m_macPrintFormerPort ;
- TPPrPort m_macPrintingPort ;
- OSErr m_err ;
- long m_maxX ;
- long m_maxY ;
-} ;
-
-wxNativePrinterDC* wxNativePrinterDC::Create(wxPrintData* data)
-{
- return new wxMacClassicPrinterDC(data) ;
-}
+ wxPrinterDCImpl *impl = (wxPrinterDCImpl*) dc->GetImpl();
+ wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) impl->GetPrintData().GetNativeData() ;