/////////////////////////////////////////////////////////////////////////////
-// Name: src/mac/carbon/dccg.cpp
+// Name: src/osx/carbon/dccg.cpp
// Purpose: wxDC class
// Author: Stefan Csomor
// Modified by:
void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y )
{
- if ( m_font.IsNull() )
- return;
+ wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::DrawText - no valid font set") );
EnsureIsValid();
#if wxOSX_USE_CORE_TEXT
void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle )
{
- if ( m_font.IsNull() )
- return;
+ wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::DrawText - no valid font set") );
EnsureIsValid();
#if wxOSX_USE_CORE_TEXT
void wxMacCoreGraphicsContext::GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height,
wxDouble *descent, wxDouble *externalLeading ) const
{
- wxCHECK_RET( !m_font.IsNull(), wxT("wxDC(cg)::DoGetTextExtent - no valid font set") );
+ wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::GetTextExtent - no valid font set") );
if ( width )
*width = 0;
widths.Empty();
widths.Add(0, text.length());
+ wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::DrawText - no valid font set") );
+
if (text.empty())
return;
virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc);
virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc);
+#if wxUSE_PRINTING_ARCHITECTURE
virtual wxGraphicsContext * CreateContext( const wxPrinterDC& dc);
+#endif
virtual wxGraphicsContext * CreateContextFromNativeContext( void * context );
return NULL;
}
+#if wxUSE_PRINTING_ARCHITECTURE
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxPrinterDC& dc )
{
-#if wxUSE_PRINTING_ARCHITECTURE
#ifdef __WXMAC__
const wxDCImpl* impl = dc.GetImpl();
wxPrinterDCImpl *print_impl = wxDynamicCast( impl, wxPrinterDCImpl );
return new wxMacCoreGraphicsContext( this,
(CGContextRef)(print_impl->GetGraphicsContext()->GetNativeContext()), (wxDouble) w, (wxDouble) h );
}
-#endif
#endif
return NULL;
}
+#endif
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeContext( void * context )
{