CTFontRef wxMacCreateCTFont( const wxFont& font )
{
#ifdef __WXMAC__
- return wxCFRetain((CTFontRef) font.MacGetCTFont());
+ return wxCFRetain((CTFontRef) font.OSXGetCTFont());
#else
return CTFontCreateWithName( wxCFStringRef( font.GetFaceName(), wxLocale::GetSystemEncoding() ) , font.GetPointSize() , NULL );
#endif
virtual ATSUStyle GetATSUStyle() { return m_macATSUIStyle; }
#endif
#if wxOSX_USE_CORE_TEXT
- CTFontRef GetCTFont() const { return m_ctFont ; }
+ CTFontRef OSXGetCTFont() const { return m_ctFont ; }
#endif
wxColour GetColour() const { return m_colour ; }
// we need the scale here ...
- Fixed atsuSize = IntToFixed( int( 1 * font.MacGetFontSize()) );
+ Fixed atsuSize = IntToFixed( int( 1 * font.GetPointSize()) );
RGBColor atsuColor ;
col.GetRGBColor( &atsuColor );
ATSUAttributeTag atsuTags[] =
return true;
#if wxOSX_USE_COCOA_OR_CARBON
-#if 1 // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
if ( UMAGetSystemVersion() < 0x1060 )
{
CGCompositeOperation cop = kCGCompositeOperationSourceOver;
case wxCOMPOSITION_XOR:
cop = kCGCompositeOperationXOR;
break;
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
case wxCOMPOSITION_ADD:
mode = kCGBlendModePlusLighter ;
break;
+#endif
default:
return false;
}
else
CGContextSetBlendMode(m_cgContext, mode);
}
- else
-#endif
#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+ else
{
CGBlendMode mode = kCGBlendModeNormal;
switch( op )
}
CGContextSetBlendMode(m_cgContext, mode);
}
+#endif
return true;
}
void wxMacCoreGraphicsContext::BeginLayer(wxDouble opacity)
{
CGContextSaveGState(m_cgContext);
- CGContextSetAlpha(m_cgContext, opacity);
+ CGContextSetAlpha(m_cgContext, (CGFloat) opacity);
CGContextBeginTransparencyLayer(m_cgContext, 0);
}
{
wxMacCoreGraphicsFontData* fref = (wxMacCoreGraphicsFontData*)m_font.GetRefData();
wxCFStringRef text(str, wxLocale::GetSystemEncoding() );
- CTFontRef font = fref->GetCTFont();
+ CTFontRef font = fref->OSXGetCTFont();
CGColorRef col = wxMacCreateCGColor( fref->GetColour() );
CTUnderlineStyle ustyle = fref->GetUnderlined() ? kCTUnderlineStyleSingle : kCTUnderlineStyleNone ;
wxCFRef<CFNumberRef> underlined( CFNumberCreate(NULL, kCFNumberSInt32Type, &ustyle) );
y += CTFontGetAscent(font);
CGContextSaveGState(m_cgContext);
- CGContextTranslateCTM(m_cgContext, x, y);
+ CGContextTranslateCTM(m_cgContext, (CGFloat) x, (CGFloat) y);
CGContextScaleCTM(m_cgContext, 1, -1);
CGContextSetTextPosition(m_cgContext, 0, 0);
CTLineDraw( line, m_cgContext );
if ( UMAGetSystemVersion() >= 0x1050 )
{
wxMacCoreGraphicsFontData* fref = (wxMacCoreGraphicsFontData*)m_font.GetRefData();
- CTFontRef font = fref->GetCTFont();
+ CTFontRef font = fref->OSXGetCTFont();
wxCFStringRef text(str, wxLocale::GetSystemEncoding() );
CFStringRef keys[] = { kCTFontAttributeName };
wxCFRef<CFAttributedStringRef> attrtext( CFAttributedStringCreate(kCFAllocatorDefault, text, attributes) );
wxCFRef<CTLineRef> line( CTLineCreateWithAttributedString(attrtext) );
- CGFloat w, a, d, l;
+ double w;
+ CGFloat a, d, l;
w = CTLineGetTypographicBounds(line, &a, &d, &l) ;
#if wxOSX_USE_CORE_TEXT
{
wxMacCoreGraphicsFontData* fref = (wxMacCoreGraphicsFontData*)m_font.GetRefData();
- CTFontRef font = fref->GetCTFont();
+ CTFontRef font = fref->OSXGetCTFont();
wxCFStringRef t(text, wxLocale::GetSystemEncoding() );
CFStringRef keys[] = { kCTFontAttributeName };
#if wxOSX_USE_CARBON
return new wxMacCoreGraphicsContext(this,(WindowRef)window);
#else
+ wxUnusedVar(window);
return NULL;
#endif
}