]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcbase.cpp
renamed IsRefTo() to IsSameAs() (do complain if this is not more clear) and
[wxWidgets.git] / src / common / dcbase.cpp
index 34b410ab1198642d303727b1152981fb6066f8b7..08d7d49e2b6ee9243c9b830101e2021aa8b296c5 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        common/dcbase.cpp
+// Name:        src/common/dcbase.cpp
 // Purpose:     generic methods of the wxDC Class
 // Author:      Vadim Zeitlin
 // Modified by:
 #endif
 
 #include "wx/dc.h"
-#include "wx/math.h"
+#include "wx/dcbuffer.h" // for IMPLEMENT_DYNAMIC_CLASS
+
+#ifndef WX_PRECOMP
+    #include "wx/math.h"
+#endif
 
 // bool wxDCBase::sm_cacheing = false;
 
+IMPLEMENT_ABSTRACT_CLASS(wxDCBase, wxObject)
+
 // ============================================================================
 // implementation
 // ============================================================================
 
+IMPLEMENT_DYNAMIC_CLASS(wxBufferedDC, wxMemoryDC)
+IMPLEMENT_ABSTRACT_CLASS(wxBufferedPaintDC, wxBufferedDC)
+
 #if WXWIN_COMPATIBILITY_2_6
 void wxDCBase::BeginDrawing()
 {
@@ -321,7 +330,7 @@ void wxDCBase::DoDrawSpline( wxList *points )
     double           x1, y1, x2, y2;
 
     wxList::compatibility_iterator node = points->GetFirst();
-    if (node == wxList::compatibility_iterator())
+    if (!node)
         // empty list
         return;
 
@@ -412,7 +421,7 @@ bool wxDCBase::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths)
 {
     int totalWidth = 0;
 
-    const size_t len = text.Length();
+    const size_t len = text.length();
     widths.Empty();
     widths.Add(0, len);
 
@@ -771,7 +780,7 @@ void wxDCBase::DoGradientFillLinear(const wxRect& rect,
     SetPen(oldPen);
 }
 
-void wxDCBase::GradientFillConcentric(const wxRect& rect,
+void wxDCBase::DoGradientFillConcentric(const wxRect& rect,
                                       const wxColour& initialColour,
                                       const wxColour& destColour,
                                       const wxPoint& circleCenter)
@@ -817,9 +826,9 @@ void wxDCBase::GradientFillConcentric(const wxRect& rect,
                 nGradient = 0;
 
             //get dest colors
-            nR = nR1 + ((nR2 - nR1) * nGradient / 100);
-            nG = nG1 + ((nG2 - nG1) * nGradient / 100);
-            nB = nB1 + ((nB2 - nB1) * nGradient / 100);
+            nR = (wxUint8)(nR1 + ((nR2 - nR1) * nGradient / 100));
+            nG = (wxUint8)(nG1 + ((nG2 - nG1) * nGradient / 100));
+            nB = (wxUint8)(nB1 + ((nB2 - nB1) * nGradient / 100));
 
             //set the pixel
             m_pen.SetColour(wxColour(nR,nG,nB));
@@ -1141,4 +1150,3 @@ void wxDCBase::CalculateEllipticPoints( wxList* points,
 } // CalculateEllipticPoints
 
 #endif
-