X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4f74e0d132e73250ef422c06175dcf7e4146ec57..9a88fc583625296157989d8783a5a1d032082aec:/src/mac/carbon/dcprint.cpp?ds=sidebyside diff --git a/src/mac/carbon/dcprint.cpp b/src/mac/carbon/dcprint.cpp index ce17739428..ad07cc2d94 100644 --- a/src/mac/carbon/dcprint.cpp +++ b/src/mac/carbon/dcprint.cpp @@ -27,6 +27,7 @@ #include "wx/mac/uma.h" #include "wx/mac/private/print.h" +#include "wx/graphics.h" IMPLEMENT_CLASS(wxPrinterDC, wxDC) @@ -94,8 +95,8 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data ) PMPrinterGetOutputResolution( printer, native->m_macPrintSettings, &res) ; #else m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res); - m_ppi = wxSize(int(res.hRes), int(res.vRes)); #endif + m_ppi = wxSize(int(res.hRes), int(res.vRes)); } wxMacCarbonPrinterDC::~wxMacCarbonPrinterDC() @@ -286,8 +287,10 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata) m_mm_to_pix_y = mm2inches * sz.y; } #if wxMAC_USE_CORE_GRAPHICS +/* // the cgContext will only be handed over page by page m_graphicContext = new wxMacCGContext() ; + */ #endif } } @@ -300,8 +303,10 @@ wxSize wxPrinterDC::GetPPI() const wxPrinterDC::~wxPrinterDC(void) { #if wxMAC_USE_CORE_GRAPHICS +/* // this context was borrowed ((wxMacCGContext*)(m_graphicContext))->SetNativeContext( NULL ) ; + */ #endif delete m_nativePrinterDC ; } @@ -309,7 +314,7 @@ wxPrinterDC::~wxPrinterDC(void) #if wxMAC_USE_CORE_GRAPHICS void wxPrinterDC::MacSetCGContext( void * cg ) { - ((wxMacCGContext*)(m_graphicContext))->SetNativeContext( (CGContextRef) cg ) ; + SetGraphicsContext( wxGraphicsContext::CreateFromNative( cg ) ); m_graphicContext->SetPen( m_pen ) ; m_graphicContext->SetBrush( m_brush ) ; }