#endif
+#ifdef __WXGTK__
+#include "gtk/gtk.h"
+#include "gdk/gdk.h"
+#endif
+
//-----------------------------------------------------------------------------
// start and end of document/page
//-----------------------------------------------------------------------------
*m_pstream << "showpage\n";
}
-bool wxPostScriptDC::Blit( long WXUNUSED(xdest), long WXUNUSED(ydest),
- long WXUNUSED(fwidth), long WXUNUSED(fheight),
- wxDC *WXUNUSED(source),
- long WXUNUSED(xsrc), long WXUNUSED(ysrc),
- int WXUNUSED(rop), bool WXUNUSED(useMask) )
+bool wxPostScriptDC::Blit( long xdest, long ydest,
+ long fwidth, long fheight,
+ wxDC *source,
+ long xsrc, long ysrc,
+ int WXUNUSED(rop), bool WXUNUSED(useMask) )
{
wxCHECK_MSG( m_ok && m_pstream, FALSE, "invalid postscript dc" );
- wxFAIL_MSG( "wxPostScriptDC::Blit no yet implemented." );
+ wxCHECK_MSG( source, FALSE, "invalid source dc" );
+
+ wxClientDC *srcDC = (wxClientDC*)source;
+
+ wxBitmap bitmap( fwidth, fheight );
+
+#ifdef __WXGTK__
+ /* just take any GC so we don't have to create our own. */
+
+ GtkStyle *style = gtk_widget_get_default_style ();
+ GdkGC *gc = style->white_gc;
+
+ /* copy from either window or bitmap */
+
+ gdk_window_copy_area( bitmap.GetPixmap(), gc, 0, 0,
+ srcDC->GetWindow(),
+ xsrc, ysrc, fwidth, fheight );
+#endif
+
+ /* draw bitmap. scaling and positioning is done there */
+
+ DrawBitmap( bitmap, xdest, ydest );
return TRUE;
}
-long wxPostScriptDC::GetCharHeight ()
+long wxPostScriptDC::GetCharHeight()
{
if (m_font.Ok())
return m_font.GetPointSize();
if ((Style == wxITALIC) && (Weight == wxBOLD)) name = "HelvBoO";
else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = "HelvBo";
else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = "Helv0";
- else if ((Style != wxITALIC) && (Weight != wxBOLD)) name = "Helv";
+ else name = "Helv";
}
break;
}
m_scaleY = 1.0;
m_mappingMode = MM_TEXT;
- m_needComputeScaleX = FALSE;
- m_needComputeScaleY = FALSE;
+ m_needComputeScaleX = FALSE; /* not used yet */
+ m_needComputeScaleY = FALSE; /* not used yet */
- m_signX = 1; // default x-axis left to right
- m_signY = 1; // default y-axis top down
+ m_signX = 1; /* default x-axis left to right */
+ m_signY = 1; /* default y-axis top down. -1 in postscript. */
- m_maxX = m_maxY = -100000;
- m_minY = m_minY = 100000;
+ m_maxX = 0;
+ m_maxY = 0;
+ m_minX = 0;
+ m_minY = 0;
m_logicalFunction = wxCOPY;
// m_textAlignment = wxALIGN_TOP_LEFT;
m_brush = *wxTRANSPARENT_BRUSH;
m_backgroundBrush = *wxWHITE_BRUSH;
-// m_palette = wxAPP_COLOURMAP;
+// m_palette = wxAPP_COLOURMAP; /* I'll learn to handle palettes later in my life */
}
wxDC::~wxDC()
m_scaleY = 1.0;
m_mappingMode = MM_TEXT;
- m_needComputeScaleX = FALSE;
- m_needComputeScaleY = FALSE;
+ m_needComputeScaleX = FALSE; /* not used yet */
+ m_needComputeScaleY = FALSE; /* not used yet */
- m_signX = 1; // default x-axis left to right
- m_signY = 1; // default y-axis top down
+ m_signX = 1; /* default x-axis left to right */
+ m_signY = 1; /* default y-axis top down. -1 in postscript. */
- m_maxX = m_maxY = -100000;
- m_minY = m_minY = 100000;
+ m_maxX = 0;
+ m_maxY = 0;
+ m_minX = 0;
+ m_minY = 0;
m_logicalFunction = wxCOPY;
// m_textAlignment = wxALIGN_TOP_LEFT;
m_brush = *wxTRANSPARENT_BRUSH;
m_backgroundBrush = *wxWHITE_BRUSH;
-// m_palette = wxAPP_COLOURMAP;
+// m_palette = wxAPP_COLOURMAP; /* I'll learn to handle palettes later in my life */
}
wxDC::~wxDC()