]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dcclient.cpp
Thread fixes (but they still don't work at all...)
[wxWidgets.git] / src / motif / dcclient.cpp
index 808dbc3fd0164348a154197e21ab77d1f47490a7..f9e71014b275864ceccc2c79d1be4e0e3dc70b97 100644 (file)
@@ -57,8 +57,10 @@ static Pixmap bdiag, cdiag, fdiag, cross, horiz, verti;
 //-----------------------------------------------------------------------------
 
 #define RAD2DEG 57.2957795131
+
 // Fudge factor. Obsolete?
-#define WX_GC_CF 0
+  // No. Robert Roebling
+#define WX_GC_CF 1
 
 //-----------------------------------------------------------------------------
 // wxWindowDC
@@ -172,7 +174,7 @@ wxWindowDC::~wxWindowDC(void)
 };
 
 void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1), 
-  wxColour* WXUNUSED(col), int WXUNUSED(style) )
+  const wxColour& WXUNUSED(col), int WXUNUSED(style) )
 {
   // TODO
 };
@@ -849,12 +851,15 @@ static void XCopyRemote(Display *src_display, Display *dest_display,
     XDestroyImage(image);
 }
 
-void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
+void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y)
 {
   if (!Ok()) return;
   
   if (!icon.Ok()) return;
-  
+
+  DrawBitmap(icon, x, y, TRUE);  
+
+#if 0
 //  FreeGetPixelCache();
 
   // Be sure that foreground pixels (1) of
@@ -909,7 +914,7 @@ void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
         (int) XLOG2DEV (x), (int) YLOG2DEV (y), FALSE, &cache);
   }
   CalcBoundingBox (x, y);
-
+#endif
 };
 
 bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
@@ -1229,7 +1234,8 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh
   if (!theFont->Ok())
   {
     // TODO: this should be an error log function
-    cerr << "wxWindows warning - set a valid font before calling GetTextExtent!\n";
+    wxFAIL_MSG("set a valid font before calling GetTextExtent!");
+
     *width = -1;
     *height = -1;
     return;
@@ -1298,7 +1304,6 @@ void wxWindowDC::Clear(void)
   int w, h;
   if (m_window)
     {
-      // TODO: should we get the virtual size?
       m_window->GetSize(&w, &h);
 
       if (m_window && m_window->GetBackingPixmap())
@@ -1330,6 +1335,24 @@ void wxWindowDC::Clear(void)
   m_brush = saveBrush;
 };
 
+void wxWindowDC::Clear(const wxRect& rect)
+{
+  if (!Ok()) return;
+  
+  int x = rect.x; int y = rect.y;
+  int w = rect.width; int h = rect.height;
+
+  wxBrush saveBrush = m_brush;
+  SetBrush (m_backgroundBrush);
+
+  XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, x, y, w, h);
+
+  if (m_window && m_window->GetBackingPixmap())
+    XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, x, y, w, h);
+
+  m_brush = saveBrush;
+};
+
 void wxWindowDC::SetFont( const wxFont &font )
 {
   if (!Ok()) return;
@@ -1385,7 +1408,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
   m_currentPenDash = m_pen.GetDash();
 
   if (m_currentStyle == wxSTIPPLE)
-    m_currentStipple = m_pen.GetStipple ();
+    m_currentStipple = m_pen.GetStipple ();
 
   bool sameStyle = (oldStyle == m_currentStyle &&
              oldFill == m_currentFill &&
@@ -1494,7 +1517,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
           break;
         case wxCAP_ROUND:
         default:
-          cap = CapRound;
+          cap = (scaled_width <= 1) ? CapNotLast : CapRound;
           break;
       }
 
@@ -1522,7 +1545,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
     {
       Pixmap myStipple;
 
-      oldStipple = (wxBitmap*) NULL;    // For later reset!!
+      oldStipple = wxNullBitmap;    // For later reset!!
 
       switch (m_currentFill)
       {
@@ -1673,7 +1696,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
 
   m_currentFill = m_brush.GetStyle ();
   if (m_currentFill == wxSTIPPLE)
-    m_currentStipple = m_brush.GetStipple ();
+    m_currentStipple = m_brush.GetStipple ();
 
   wxColour oldBrushColour(m_currentColour);
   m_currentColour = m_brush.GetColour ();