#include "ATSUnicode.h"
#include "TextCommon.h"
#include "TextEncodingConverter.h"
+#include "FixMath.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
#endif
void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") ) ;
- wxMacPortSetter helper(this) ;
if (region.Empty())
{
DestroyClippingRegion();
return;
}
+ wxMacPortSetter helper(this) ;
wxCoord x, y, w, h;
region.GetBox( x, y, w, h );
wxCoord xx, yy, ww, hh;
return TRUE;
}
+#ifndef FixedToInt
+// as macro in FixMath.h for 10.3
inline Fixed IntToFixed( int inInt )
{
return (((SInt32) inInt) << 16);
{
return (((SInt32) inFixed) >> 16);
}
+#endif
void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
double angle)
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
#else
TECObjectRef ec;
- status = TECCreateConverter(&ec,
- wxApp::s_macDefaultEncodingIsPC ? kTextEncodingWindowsLatin1 : kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
+ status = TECCreateConverter(&ec,
+ wxApp::s_macDefaultEncodingIsPC
+ ? (int)kTextEncodingWindowsLatin1
+ : (int)kTextEncodingMacRoman,
+ kTextEncodingUnicodeDefault);
wxASSERT_MSG( status == noErr , wxT("couldn't start converter") ) ;
ByteCount byteOutLen ;
status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
&textBefore , &textAfter, &ascent , &descent );
- drawX += sin(angle/RAD2DEG) * FixedToInt(ascent) ;
- drawY += cos(angle/RAD2DEG) * FixedToInt(ascent) ;
+ drawX += (int)(sin(angle/RAD2DEG) * FixedToInt(ascent));
+ drawY += (int)(cos(angle/RAD2DEG) * FixedToInt(ascent));
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) );
wxASSERT_MSG( status == noErr , wxT("couldn't draw the rotated text") );
Fixed atsuSize = IntToFixed( int(m_scaleY * font->m_macFontSize) ) ;
Style qdStyle = font->m_macFontStyle ;
ATSUFontID atsuFont = font->m_macATSUFontID ;
- status = ::ATSUCreateStyle(&(ATSUStyle)m_macATSUIStyle) ;
+ status = ::ATSUCreateStyle((ATSUStyle *)&m_macATSUIStyle) ;
wxASSERT_MSG( status == noErr , wxT("couldn't create ATSU style") ) ;
ATSUAttributeTag atsuTags[] =
{
} ;
Boolean kTrue = true ;
Boolean kFalse = false ;
- BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ;
+ //BslnBaselineClass kBaselineDefault = kBSLNHangingBaseline ;
ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags)/sizeof(ATSUAttributeTag)] =
{
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
::PenNormal() ;
- int penWidth = m_pen.GetWidth() * (int) m_scaleX ;
+ int penWidth = (int) (m_pen.GetWidth() * m_scaleX) ; ;
// null means only one pixel, at whatever resolution
if ( penWidth == 0 )
penWidth = 1 ;