]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/print.cpp
release update region as soon as we finished painting the window instead of keeping...
[wxWidgets.git] / src / gtk / print.cpp
index d1f3080828ed6260990a0db5f0658026b2aba364..2374a13d87b714200bcfef8fecb467c58b0121a4 100644 (file)
@@ -1415,6 +1415,9 @@ void wxGtkPrintDC::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoo
 
 void wxGtkPrintDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
 {
+    width--;
+    height--;
+
     gs_cairo->cairo_new_path(m_cairo);
     gs_cairo->cairo_rectangle ( m_cairo, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEVREL(width), YLOG2DEVREL(height));
 
@@ -1430,6 +1433,9 @@ void wxGtkPrintDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord
 
 void wxGtkPrintDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
 {
+    width--;
+    height--;
+
     if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
 
     wxCoord dd = 2 * (wxCoord) radius;
@@ -1475,6 +1481,9 @@ void wxGtkPrintDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, w
 
 void wxGtkPrintDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
 {
+    width--;
+    height--;
+
     gs_cairo->cairo_save (m_cairo);
 
     gs_cairo->cairo_new_path(m_cairo);
@@ -1496,20 +1505,20 @@ void wxGtkPrintDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord he
 }
 
 #if wxUSE_SPLINES
-void wxGtkPrintDC::DoDrawSpline(wxList *points)
+void wxGtkPrintDC::DoDrawSpline(const wxPointList *points)
 {
     SetPen (m_pen);
 
     double c, d, x1, y1, x2, y2, x3, y3;
     wxPoint *p, *q;
 
-    wxList::compatibility_iterator node = points->GetFirst();
-    p = (wxPoint *)node->GetData();
+    wxPointList::compatibility_iterator node = points->GetFirst();
+    p = node->GetData();
     x1 = p->x;
     y1 = p->y;
 
     node = node->GetNext();
-    p = (wxPoint *)node->GetData();
+    p = node->GetData();
     c = p->x;
     d = p->y;
     x3 =
@@ -1527,7 +1536,7 @@ void wxGtkPrintDC::DoDrawSpline(wxList *points)
     node = node->GetNext();
     while (node)
     {
-        q = (wxPoint *)node->GetData();
+        q = node->GetData();
 
         x1 = x3;
         y1 = y3;
@@ -1706,12 +1715,7 @@ void wxGtkPrintDC::DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
 
     bool underlined = m_font.Ok() && m_font.GetUnderlined();
 
-// FIXME-UTF8: wouldn't be needed if utf8_str() always returned a buffer
-#if wxUSE_UNICODE_UTF8
-    const char *data = text.utf8_str();
-#else
-    const wxCharBuffer data = text.utf8_str();
-#endif
+    const wxUTF8Buf data = text.utf8_str();
 
     size_t datalen = strlen(data);
     pango_layout_set_text( m_layout, data, datalen);
@@ -2126,12 +2130,7 @@ void wxGtkPrintDC::DoGetTextExtent(const wxString& string, wxCoord *width, wxCoo
     }
 
     // Set layout's text
-    // FIXME-UTF8: wouldn't be needed if utf8_str() always returned a buffer
-#if wxUSE_UNICODE_UTF8
-    const char *dataUTF8 = string.utf8_str();
-#else
-    const wxCharBuffer dataUTF8 = string.utf8_str();
-#endif
+    const wxUTF8Buf dataUTF8 = string.utf8_str();
 
     PangoFontDescription *desc = m_fontdesc;
     if (theFont) desc = theFont->GetNativeFontInfo()->description;