]> git.saurik.com Git - wxWidgets.git/commitdiff
Implented DoDrawPolygon() for GNOME print.
authorRobert Roebling <robert@roebling.de>
Sat, 23 Apr 2005 16:41:53 +0000 (16:41 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 23 Apr 2005 16:41:53 +0000 (16:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/gnome/gprint.cpp
src/gtk1/gnome/gprint.cpp

index 2511848240241ad8b250569591f784e0e61d09fd..c1eb690ea2f95ca6f26fda619b836fa6af8da9a3 100644 (file)
@@ -172,11 +172,11 @@ wxGnomePrintLibrary::wxGnomePrintLibrary()
 
     wxLogNull log;
     
-    m_gnome_print_lib = new wxDynamicLibrary( wxT("libgnomeprint-2-2.so") );
+    m_gnome_print_lib = new wxDynamicLibrary( wxT("libgnomeprint-2-2.so.0") );
     m_ok = m_gnome_print_lib->IsLoaded();
     if (!m_ok) return;    
     
-    m_gnome_printui_lib = new wxDynamicLibrary( wxT("libgnomeprintui-2-2.so") );
+    m_gnome_printui_lib = new wxDynamicLibrary( wxT("libgnomeprintui-2-2.so.0") );
     m_ok = m_gnome_printui_lib->IsLoaded();
     if (!m_ok) return;    
     
@@ -904,10 +904,53 @@ void wxGnomePrintDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoo
 
 void wxGnomePrintDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
 {
+    if (n==0) return;
+
+    if (m_brush.GetStyle () != wxTRANSPARENT)
+    {
+        SetBrush( m_brush );
+       
+        int x = points[0].x + xoffset;
+        int y = points[0].y + yoffset;
+        CalcBoundingBox( x, y );
+        gs_lgp->gnome_print_newpath( m_gpc );
+        gs_lgp->gnome_print_moveto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
+        int i;
+        for (i = 1; i < n; i++)
+        {
+            int x = points[i].x + xoffset;
+            int y = points[i].y + yoffset;
+            gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
+            CalcBoundingBox( x, y );
+        }
+        gs_lgp->gnome_print_closepath( m_gpc );
+        gs_lgp->gnome_print_fill( m_gpc );
+    }
+
+    if (m_pen.GetStyle () != wxTRANSPARENT)
+    {
+        SetPen (m_pen);
+
+        int x = points[0].x + xoffset;
+        int y = points[0].y + yoffset;
+        gs_lgp->gnome_print_newpath( m_gpc );
+        gs_lgp->gnome_print_moveto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
+        int i;
+        for (i = 1; i < n; i++)
+        {
+            int x = points[i].x + xoffset;
+            int y = points[i].y + yoffset;
+            gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
+            CalcBoundingBox( x, y );
+        }
+        gs_lgp->gnome_print_closepath( m_gpc );
+        gs_lgp->gnome_print_stroke( m_gpc );
+    }
 }
 
 void wxGnomePrintDC::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
 {
+    wxDC::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle );
 }
 
 void wxGnomePrintDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
index 2511848240241ad8b250569591f784e0e61d09fd..c1eb690ea2f95ca6f26fda619b836fa6af8da9a3 100644 (file)
@@ -172,11 +172,11 @@ wxGnomePrintLibrary::wxGnomePrintLibrary()
 
     wxLogNull log;
     
-    m_gnome_print_lib = new wxDynamicLibrary( wxT("libgnomeprint-2-2.so") );
+    m_gnome_print_lib = new wxDynamicLibrary( wxT("libgnomeprint-2-2.so.0") );
     m_ok = m_gnome_print_lib->IsLoaded();
     if (!m_ok) return;    
     
-    m_gnome_printui_lib = new wxDynamicLibrary( wxT("libgnomeprintui-2-2.so") );
+    m_gnome_printui_lib = new wxDynamicLibrary( wxT("libgnomeprintui-2-2.so.0") );
     m_ok = m_gnome_printui_lib->IsLoaded();
     if (!m_ok) return;    
     
@@ -904,10 +904,53 @@ void wxGnomePrintDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoo
 
 void wxGnomePrintDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
 {
+    if (n==0) return;
+
+    if (m_brush.GetStyle () != wxTRANSPARENT)
+    {
+        SetBrush( m_brush );
+       
+        int x = points[0].x + xoffset;
+        int y = points[0].y + yoffset;
+        CalcBoundingBox( x, y );
+        gs_lgp->gnome_print_newpath( m_gpc );
+        gs_lgp->gnome_print_moveto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
+        int i;
+        for (i = 1; i < n; i++)
+        {
+            int x = points[i].x + xoffset;
+            int y = points[i].y + yoffset;
+            gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
+            CalcBoundingBox( x, y );
+        }
+        gs_lgp->gnome_print_closepath( m_gpc );
+        gs_lgp->gnome_print_fill( m_gpc );
+    }
+
+    if (m_pen.GetStyle () != wxTRANSPARENT)
+    {
+        SetPen (m_pen);
+
+        int x = points[0].x + xoffset;
+        int y = points[0].y + yoffset;
+        gs_lgp->gnome_print_newpath( m_gpc );
+        gs_lgp->gnome_print_moveto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
+        int i;
+        for (i = 1; i < n; i++)
+        {
+            int x = points[i].x + xoffset;
+            int y = points[i].y + yoffset;
+            gs_lgp->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
+            CalcBoundingBox( x, y );
+        }
+        gs_lgp->gnome_print_closepath( m_gpc );
+        gs_lgp->gnome_print_stroke( m_gpc );
+    }
 }
 
 void wxGnomePrintDC::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle)
 {
+    wxDC::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle );
 }
 
 void wxGnomePrintDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)