#include "wx/mac/private.h"
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
-typedef float CGFloat;
-#endif
-
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#ifdef __LP64__
// todo flip
CGContextDrawImage(inContext, *inBounds, inImage );
+ return noErr;
#else
- HIViewDrawCGImage( inContext, inBounds, inImage );
+ return HIViewDrawCGImage( inContext, inBounds, inImage );
#endif
}
{
wxASSERT( bmp && bmp->Ok() );
- Init( (CGImageRef) bmp->CGImageCreate() , transform );
+ Init( (CGImageRef) bmp->CreateCGImage() , transform );
}
// ImagePattern takes ownership of CGImageRef passed in
{
m_macATSUIStyle = NULL;
+#ifdef wxMAC_USE_CORE_TEXT
+#elif defined(wxMAC_USE_ATSU_TEXT)
OSStatus status;
status = ATSUCreateAndCopyStyle( (ATSUStyle) font.MacGetATSUStyle() , &m_macATSUIStyle );
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , wxT("couldn't modify ATSU style") );
+#elif defined(WXMAC_USE_CG_TEXT)
+#endif
}
wxMacCoreGraphicsFontData::~wxMacCoreGraphicsFontData()
{
+#ifdef wxMAC_USE_CORE_TEXT
+#elif defined(wxMAC_USE_ATSU_TEXT)
if ( m_macATSUIStyle )
{
::ATSUDisposeStyle((ATSUStyle)m_macATSUIStyle);
m_macATSUIStyle = NULL;
}
+#elif defined(WXMAC_USE_CG_TEXT)
+#endif
}
//
int originX , originY;
originX = originY = 0;
window->MacWindowToRootWindow( &originX , &originY );
- Rect bounds;
- GetWindowBounds( m_windowRef, kWindowContentRgn, &bounds );
+ Rect bounds = { 0,0,0,0 };
+#ifdef __LP64__
+#else
+ GetWindowBounds( m_windowRef, kWindowContentRgn, &bounds );
+#endif
m_windowTransform = CGAffineTransformMakeTranslation( 0 , bounds.bottom - bounds.top );
m_windowTransform = CGAffineTransformScale( m_windowTransform , 1 , -1 );
m_windowTransform = CGAffineTransformTranslate( m_windowTransform, originX, originY ) ;
{
EnsureIsValid();
- CGImageRef image = (CGImageRef)( bmp.CGImageCreate() );
+ CGImageRef image = (CGImageRef)( bmp.CreateCGImage() );
HIRect r = CGRectMake( x , y , w , h );
if ( bmp.GetDepth() == 1 )
{
void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y )
{
+ if ( m_font.IsNull() )
+ return;
+
+ EnsureIsValid();
+#ifdef wxMAC_USE_CORE_TEXT
+ // TODO core text implementation here
+#elif defined(wxMAC_USE_ATSU_TEXT)
DrawText(str, x, y, 0.0);
+#elif defined(WXMAC_USE_CG_TEXT)
+ // TODO core graphics text implementation here
+#endif
}
void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle )
return;
EnsureIsValid();
-
+#ifdef wxMAC_USE_CORE_TEXT
+ // default implementation takes care of rotation and calls non rotated DrawText afterwards
+ wxGraphicsContext::DrawText( str, x, y, angle );
+#elif defined(wxMAC_USE_ATSU_TEXT)
OSStatus status = noErr;
ATSUTextLayout atsuLayout;
UniCharCount chars = str.length();
#if SIZEOF_WCHAR_T == 4
free( ubuf );
#endif
+#elif defined(WXMAC_USE_CG_TEXT)
+ // default implementation takes care of rotation and calls non rotated DrawText afterwards
+ wxGraphicsContext::DrawText( str, x, y, angle );
+#endif
}
void wxMacCoreGraphicsContext::GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height,
if (str.empty())
return;
+#ifdef wxMAC_USE_CORE_TEXT
+ // TODO core text implementation here
+#elif defined(wxMAC_USE_ATSU_TEXT)
OSStatus status = noErr;
ATSUTextLayout atsuLayout;
#if SIZEOF_WCHAR_T == 4
free( ubuf ) ;
#endif
+#elif defined(WXMAC_USE_CG_TEXT)
+ // TODO core graphics text implementation here
+#endif
}
void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const
if (text.empty())
return;
+#ifdef wxMAC_USE_CORE_TEXT
+ // TODO core text implementation here
+#elif defined(wxMAC_USE_ATSU_TEXT)
ATSUTextLayout atsuLayout;
UniCharCount chars = text.length();
UniChar* ubuf = NULL;
#if SIZEOF_WCHAR_T == 4
free( ubuf ) ;
#endif
+#elif defined(WXMAC_USE_CG_TEXT)
+ // TODO core graphics text implementation here
+#endif
}
void * wxMacCoreGraphicsContext::GetNativeContext()