const wxColour &oColor, const wxColour &cColor )
{
m_gradientFunction = CreateGradientFunction( oColor, cColor );
- m_shading = CGShadingCreateRadial( wxMacGetGenericRGBColorSpace(), CGPointMake((CGFloat) xo,(CGFloat) yo), 0,
+ m_shading = CGShadingCreateRadial( wxMacGetGenericRGBColorSpace(), CGPointMake((CGFloat) xo,(CGFloat) yo), 0,
CGPointMake((CGFloat) xc,(CGFloat) yc), (CGFloat) radius, m_gradientFunction, true, true ) ;
m_isShading = true ;
}
// text
//
- virtual void DrawText( const wxString &str, wxDouble x, wxDouble y );
-
- virtual void DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle );
-
virtual void GetTextExtent( const wxString &text, wxDouble *width, wxDouble *height,
wxDouble *descent, wxDouble *externalLeading ) const;
private:
void EnsureIsValid();
+ virtual void DoDrawText( const wxString &str, wxDouble x, wxDouble y );
+ virtual void DoDrawRotatedText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle );
+
CGContextRef m_cgContext;
#if wxOSX_USE_CARBON
WindowRef m_windowRef;
CGContextRestoreGState( m_cgContext );
}
-void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y )
+void wxMacCoreGraphicsContext::DoDrawText( const wxString &str, wxDouble x, wxDouble y )
{
wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::DrawText - no valid font set") );
CGContextSaveGState(m_cgContext);
CGColorRef col = wxMacCreateCGColor( fref->GetColour() );
- CGContextSetTextDrawingMode (m_cgContext, kCGTextFill);
+ CGContextSetTextDrawingMode (m_cgContext, kCGTextFill);
CGContextSetFillColorWithColor( m_cgContext, col );
wxCFStringRef text(str, wxLocale::GetSystemEncoding() );
#endif
}
-void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle )
+void wxMacCoreGraphicsContext::DoDrawRotatedText(const wxString &str,
+ wxDouble x, wxDouble y,
+ wxDouble angle)
{
wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::DrawText - no valid font set") );
#endif
#if wxOSX_USE_IPHONE
// default implementation takes care of rotation and calls non rotated DrawText afterwards
- wxGraphicsContext::DrawText( str, x, y, angle );
+ wxGraphicsContext::DoDrawRotatedText( str, x, y, angle );
#endif
}
wxCFStringRef text(str, wxLocale::GetSystemEncoding() );
CGSize sz = MeasureTextInContext( fref->GetUIFont() , text.AsNSString() );
-
+
if ( height )
*height = sz.height;
/*
#else
ATSLayoutRecord *layoutRecords = NULL;
ItemCount glyphCount = 0;
-
+
// Get the glyph extents
OSStatus err = ::ATSUDirectGetLayoutDataArrayPtrFromTextLayout(atsuLayout,
0,
&layoutRecords,
&glyphCount);
wxASSERT(glyphCount == (text.length()+1));
-
+
if ( err == noErr && glyphCount == (text.length()+1))
{
for ( int pos = 1; pos < (int)glyphCount ; pos ++ )
widths[pos-1] = FixedToInt( layoutRecords[pos].realPos );
}
}
-
+
::ATSUDirectReleaseLayoutDataArrayPtr(NULL,
kATSUDirectDataLayoutRecordATSLayoutRecordCurrent,
(void **) &layoutRecords);