]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/gnome/gprint.cpp
made wxMBConv_iconv MT-safe
[wxWidgets.git] / src / gtk1 / gnome / gprint.cpp
index 9f0903dc80f0a5030be65acfbbeeccd0330836c5..12f74b4db3661ed4e1140a0bbcde82ace9893135 100644 (file)
@@ -442,10 +442,36 @@ bool wxGnomePrintDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord
 
 void wxGnomePrintDC::DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y )
 {
+    DoDrawBitmap( icon, x, y, true );
 }
 
 void wxGnomePrintDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask )
 {
+    if (!bitmap.Ok()) return;
+    
+#if 0
+    // TODO do something clever here
+    if (bitmap.HasPixbuf())
+    {
+    }
+    else
+#endif
+    {
+        wxImage image = bitmap.ConvertToImage();
+
+        if (!image.Ok()) return;
+        
+        double matrix[6];
+       matrix[0] = XLOG2DEVREL(image.GetWidth());
+       matrix[1] = 0;
+       matrix[2] = 0;
+       matrix[3] = YLOG2DEVREL(image.GetHeight());
+       matrix[4] = XLOG2DEV(x);
+        matrix[5] = YLOG2DEV(y+image.GetHeight());
+       gnome_print_concat( m_gpc, matrix );
+           gnome_print_moveto(  m_gpc, 0, 0 );
+        gnome_print_rgbimage( m_gpc, (guchar*) image.GetData(), image.GetWidth(), image.GetHeight(), image.GetWidth()*3 );
+    }
 }
 
 void wxGnomePrintDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y )