X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b905d6cc083a38d46ae48712f5221236247a39ce..6270539bcf24f2ec32150a09f8aad383f5de0671:/src/mac/carbon/dc.cpp diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index d9630ecbb9..825c9b9816 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -6,13 +6,9 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "dc.h" -#endif - #include "wx/wxprec.h" #include "wx/dc.h" @@ -26,19 +22,22 @@ #include "wx/image.h" #include "wx/log.h" -#if __MSL__ >= 0x6000 -namespace std {} -using namespace std ; +#ifdef __MSL__ + #if __MSL__ >= 0x6000 + namespace std {} + using namespace std ; + #endif #endif #include "wx/mac/private.h" +#ifndef __DARWIN__ #include #include #include -#if !USE_SHARED_LIBRARY -IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) #endif +IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) + //----------------------------------------------------------------------------- // constants //----------------------------------------------------------------------------- @@ -366,7 +365,7 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask PixMapHandle bmappixels ; // Set foreground and background colours (for bitmaps depth = 1) if(bmp.GetDepth() == 1) - { + { RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel()); RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel()); RGBForeColor(&fore); @@ -418,8 +417,12 @@ void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ) wxCoord xx = XLOG2DEVMAC(x); wxCoord yy = YLOG2DEVMAC(y); + wxCoord w = icon.GetWidth(); + wxCoord h = icon.GetHeight(); + wxCoord ww = XLOG2DEVREL(w); + wxCoord hh = YLOG2DEVREL(h); - Rect r = { yy , xx, yy + 32 , xx + 32 } ; + Rect r = { yy , xx, yy + hh , xx + ww } ; PlotIconRef( &r , kAlignNone , kTransformNone , kPlotIconRefNormalFlags , MAC_WXHICON( icon.GetHICON() ) ) ; } @@ -453,11 +456,6 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) { wxCHECK_RET( Ok(), wxT("invalid window dc") ) ; - if (region.Empty()) - { - DestroyClippingRegion(); - return; - } wxMacFastPortSetter helper(this) ; wxCoord x, y, w, h; region.GetBox( x, y, w, h ); @@ -1317,7 +1315,7 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, UniCharCount chars = str.Length() ; UniChar* ubuf = NULL ; #if SIZEOF_WCHAR_T == 4 - wxMBConvUTF16BE converter ; + wxMBConvUTF16 converter ; #if wxUSE_UNICODE size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ; ubuf = (UniChar*) malloc( unicharlen + 2 ) ; @@ -1343,6 +1341,10 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ; wxASSERT_MSG( status == noErr , wxT("couldn't create the layout of the rotated text") ); + + status = ::ATSUSetTransientFontMatching( atsuLayout , true ) ; + wxASSERT_MSG( status == noErr , wxT("couldn't setup transient font matching") ); + int iAngle = int( angle ); int drawX = XLOG2DEVMAC(x) ; int drawY = YLOG2DEVMAC(y) ; @@ -1664,9 +1666,9 @@ void wxDC::MacInstallFont() const Pattern whiteColor ; ::BackPat(GetQDGlobalsWhite(&whiteColor)); } - + wxASSERT( m_font.Ok() ) ; - + ::TextFont( m_font.MacGetFontNum() ) ; ::TextSize( (short)(m_scaleY * m_font.MacGetFontSize()) ) ; @@ -1743,7 +1745,7 @@ void wxDC::MacInstallFont() const atsuTags, atsuSizes, atsuValues); wxASSERT_MSG( status == noErr , wxT("couldn't Modify ATSU style") ) ; - + } Pattern gPatterns[] =