DC reorganization

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-11-30 13:48:22 +00:00
parent 908eeca88d
commit 888dde65f4
85 changed files with 1831 additions and 2836 deletions

View File

@@ -2166,6 +2166,7 @@ public :
// Context
virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc);
virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc);
virtual wxGraphicsContext * CreateContextFromNativeContext( void * context );
@@ -2218,18 +2219,26 @@ wxGraphicsRenderer* wxGraphicsRenderer::GetDefaultRenderer()
return &gs_MacCoreGraphicsRenderer;
}
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxWindowDC& dc)
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxWindowDC& dc )
{
wxMemoryDC* mdc = wxDynamicCast(&dc, wxMemoryDC);
if ( mdc )
{
return new wxMacCoreGraphicsContext(this,
(CGContextRef)mdc->GetGraphicsContext()->GetNativeContext());
}
else
{
return new wxMacCoreGraphicsContext(this,(CGContextRef)dc.GetWindow()->MacGetCGContextRef() );
}
const wxDCImpl* impl = dc.GetImpl();
wxWindowDCImpl *win_impl = wxDynamicCast( impl, wxWindowDCImpl );
if (win_impl)
return new wxMacCoreGraphicsContext( this,
(CGContextRef)(win_impl->GetWindow()->MacGetCGContextRef()) );
return NULL;
}
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxMemoryDC& dc )
{
const wxDCImpl* impl = dc.GetImpl();
wxMemoryDCImpl *mem_impl = wxDynamicCast( impl, wxMemoryDCImpl );
if (mem_impl)
return new wxMacCoreGraphicsContext( this,
(CGContextRef)(mem_impl->GetGraphicsContext()->GetNativeContext()) );
return NULL;
}
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeContext( void * context )