// 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"
#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 <ATSUnicode.h>
#include <TextCommon.h>
#include <TextEncodingConverter.h>
-#if !USE_SHARED_LIBRARY
-IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
#endif
+IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
+
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
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);
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() ) ) ;
}
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 );
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 ) ;
&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) ;
Pattern whiteColor ;
::BackPat(GetQDGlobalsWhite(&whiteColor));
}
-
+
wxASSERT( m_font.Ok() ) ;
-
+
::TextFont( m_font.MacGetFontNum() ) ;
::TextSize( (short)(m_scaleY * m_font.MacGetFontSize()) ) ;
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , wxT("couldn't Modify ATSU style") ) ;
-
+
}
Pattern gPatterns[] =