]> git.saurik.com Git - wxWidgets.git/commitdiff
comments added
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 24 May 2003 07:35:06 +0000 (07:35 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 24 May 2003 07:35:06 +0000 (07:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dc.cpp
src/mac/dc.cpp

index b429b618310d24095d2ff45797bf5d76ac7af671..7a023ff885da26a9bce080e2c9658e5d33ed3767 100644 (file)
@@ -236,7 +236,11 @@ wxDC::wxDC()
     m_pen = *wxBLACK_PEN;
     m_font = *wxNORMAL_FONT;
     m_brush = *wxWHITE_BRUSH;
+#ifdef __WXDEBUG__
+    // needed to debug possible errors with two active drawing methods at the same time on 
+    // the same DC
     m_macCurrentPortStateHelper = NULL ;
+#endif
     m_macATSUIStyle = NULL ;
     m_macAliasWasEnabled = false;
     m_macForegroundPixMap = NULL ;
@@ -251,8 +255,10 @@ wxDC::~wxDC(void)
 
 void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
 {
+#ifdef __WXDEBUG__
     wxASSERT( m_macCurrentPortStateHelper == NULL ) ;
     m_macCurrentPortStateHelper = help ;
+#endif
     SetClip( (RgnHandle) m_macCurrentClipRgn);
     m_macFontInstalled = false ;
     m_macBrushInstalled = false ;
@@ -261,8 +267,10 @@ void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
 
 void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
 {
+#ifdef __WXDEBUG__
     wxASSERT( m_macCurrentPortStateHelper == help ) ;
     m_macCurrentPortStateHelper = NULL ;
+#endif
     if( m_macATSUIStyle )
     {
         ::ATSUDisposeStyle((ATSUStyle)m_macATSUIStyle);
@@ -464,12 +472,6 @@ void wxDC::DestroyClippingRegion()
     m_clipping = FALSE;
 }
 
-void wxDC::DoGetSize( int* width, int* height ) const
-{
-    *width = m_maxX-m_minX;
-    *height = m_maxY-m_minY;
-}
-
 void wxDC::DoGetSizeMM( int* width, int* height ) const
 {
     int w = 0;
@@ -1289,11 +1291,13 @@ void  wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
                               double angle)
 {
     wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText  Invalid window dc") );
+
     if (angle == 0.0 )
     {
         DrawText(str, x, y);
         return;
     }
+
     if ( str.Length() == 0 )
         return ;
         
@@ -1385,10 +1389,12 @@ void  wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
 void  wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
 {
     wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText  Invalid DC"));
+
     wxMacPortSetter helper(this) ;
     long xx = XLOG2DEVMAC(x);
     long yy = YLOG2DEVMAC(y);
 #if TARGET_CARBON
+
     bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
     if ( IsKindOf(CLASSINFO( wxPrinterDC ) ) || m_font.GetNoAntiAliasing() )
         useDrawThemeText = false ;
@@ -1815,7 +1821,7 @@ void wxDC::MacInstallFont() const
             (qdStyle & condense) ? &kTrue : &kFalse ,
             (qdStyle & extend) ? &kTrue : &kFalse ,
     } ;
-    status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag),
+    status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag) ,
         atsuTags, atsuSizes, atsuValues);
     wxASSERT_MSG( status == noErr , wxT("couldn't set create ATSU style") ) ;
 }
index b429b618310d24095d2ff45797bf5d76ac7af671..7a023ff885da26a9bce080e2c9658e5d33ed3767 100644 (file)
@@ -236,7 +236,11 @@ wxDC::wxDC()
     m_pen = *wxBLACK_PEN;
     m_font = *wxNORMAL_FONT;
     m_brush = *wxWHITE_BRUSH;
+#ifdef __WXDEBUG__
+    // needed to debug possible errors with two active drawing methods at the same time on 
+    // the same DC
     m_macCurrentPortStateHelper = NULL ;
+#endif
     m_macATSUIStyle = NULL ;
     m_macAliasWasEnabled = false;
     m_macForegroundPixMap = NULL ;
@@ -251,8 +255,10 @@ wxDC::~wxDC(void)
 
 void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
 {
+#ifdef __WXDEBUG__
     wxASSERT( m_macCurrentPortStateHelper == NULL ) ;
     m_macCurrentPortStateHelper = help ;
+#endif
     SetClip( (RgnHandle) m_macCurrentClipRgn);
     m_macFontInstalled = false ;
     m_macBrushInstalled = false ;
@@ -261,8 +267,10 @@ void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
 
 void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
 {
+#ifdef __WXDEBUG__
     wxASSERT( m_macCurrentPortStateHelper == help ) ;
     m_macCurrentPortStateHelper = NULL ;
+#endif
     if( m_macATSUIStyle )
     {
         ::ATSUDisposeStyle((ATSUStyle)m_macATSUIStyle);
@@ -464,12 +472,6 @@ void wxDC::DestroyClippingRegion()
     m_clipping = FALSE;
 }
 
-void wxDC::DoGetSize( int* width, int* height ) const
-{
-    *width = m_maxX-m_minX;
-    *height = m_maxY-m_minY;
-}
-
 void wxDC::DoGetSizeMM( int* width, int* height ) const
 {
     int w = 0;
@@ -1289,11 +1291,13 @@ void  wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
                               double angle)
 {
     wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText  Invalid window dc") );
+
     if (angle == 0.0 )
     {
         DrawText(str, x, y);
         return;
     }
+
     if ( str.Length() == 0 )
         return ;
         
@@ -1385,10 +1389,12 @@ void  wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
 void  wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
 {
     wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText  Invalid DC"));
+
     wxMacPortSetter helper(this) ;
     long xx = XLOG2DEVMAC(x);
     long yy = YLOG2DEVMAC(y);
 #if TARGET_CARBON
+
     bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
     if ( IsKindOf(CLASSINFO( wxPrinterDC ) ) || m_font.GetNoAntiAliasing() )
         useDrawThemeText = false ;
@@ -1815,7 +1821,7 @@ void wxDC::MacInstallFont() const
             (qdStyle & condense) ? &kTrue : &kFalse ,
             (qdStyle & extend) ? &kTrue : &kFalse ,
     } ;
-    status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag),
+    status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag) ,
         atsuTags, atsuSizes, atsuValues);
     wxASSERT_MSG( status == noErr , wxT("couldn't set create ATSU style") ) ;
 }