X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0b822969a677939811d9fb966177031fb5fc625b..8691bf118c80d22b0e6908a0877b46cedde7a3eb:/src/mac/carbon/graphics.cpp diff --git a/src/mac/carbon/graphics.cpp b/src/mac/carbon/graphics.cpp index 83fc525b3f..e5567b5f8d 100644 --- a/src/mac/carbon/graphics.cpp +++ b/src/mac/carbon/graphics.cpp @@ -23,6 +23,7 @@ #include "wx/icon.h" #endif + #ifdef __MSL__ #if __MSL__ >= 0x6000 #include "math.h" @@ -34,6 +35,7 @@ #ifdef __WXMAC__ #include "wx/mac/uma.h" + #include "wx/mac/dcprint.h" #else #include "CoreServices/CoreServices.h" #include "ApplicationServices/ApplicationServices.h" @@ -2360,8 +2362,14 @@ wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxPrinterDC& { #ifdef __WXMAC__ const wxDCImpl* impl = dc.GetImpl(); - - // TODO + wxPrinterDCImpl *print_impl = wxDynamicCast( impl, wxPrinterDCImpl ); + if (print_impl) + { + int w, h; + print_impl->GetSize( &w, &h ); + return new wxMacCoreGraphicsContext( this, + (CGContextRef)(print_impl->GetGraphicsContext()->GetNativeContext()), (wxDouble) w, (wxDouble) h ); + } #endif return NULL; }