-void wxPrinterDC::StartPage(void)
-{
- if ( !m_ok )
- return ;
-
- m_logicalFunction = wxCOPY;
-// m_textAlignment = wxALIGN_TOP_LEFT;
- m_backgroundMode = wxTRANSPARENT;
-
- m_textForegroundColour = *wxBLACK;
- m_textBackgroundColour = *wxWHITE;
- m_pen = *wxBLACK_PEN;
- m_font = *wxNORMAL_FONT;
- m_brush = *wxTRANSPARENT_BRUSH;
- m_backgroundBrush = *wxWHITE_BRUSH;
-
- m_macFontInstalled = false ;
- m_macBrushInstalled = false ;
- m_macPenInstalled = false ;
-
-
- OSStatus err ;
- wxString message ;
-
-#if !TARGET_CARBON
- PrOpenPage( m_macPrintPort , NULL ) ;
- m_macLocalOrigin.h = (**m_printData.m_macPrintInfo).rPaper.left ;
- m_macLocalOrigin.v = (**m_printData.m_macPrintInfo).rPaper.top ;
-
- SetOrigin( - m_macLocalOrigin.h , - m_macLocalOrigin.v ) ;
- Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
- ::ClipRect( &clip ) ;
- err = PrError() ;
- if ( err )
- {
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- ::PrClosePage( m_macPrintPort) ;
- ::PrCloseDoc( m_macPrintPort ) ;
- ::UMAPrClose() ;
- ::SetPort( macPrintFormerPort ) ;
- m_ok = FALSE ;
- }
-#else
- err = PMBeginPage(m_macPrintPort, nil);
- if ( err )
- {
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- PMEndPage(m_macPrintPort);
- PMEndDocument(m_macPrintPort);
- UMAPrClose() ;
- ::SetPort( macPrintFormerPort ) ;
- m_ok = FALSE ;
- }
+wxPrinterDC::~wxPrinterDC(void)
+{
+ delete m_nativePrinterDC ;
+}
+
+#if wxMAC_USE_CORE_GRAPHICS
+void wxPrinterDC::MacSetCGContext( void * cg )
+{
+ ((wxMacCGContext*)(m_graphicContext))->SetNativeContext( (CGContextRef) cg ) ;
+ m_graphicContext->SetPen( m_pen ) ;
+ m_graphicContext->SetBrush( m_brush ) ;
+}