postscript Blit()

DC::GetSize() bug corrected


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-02-04 16:12:32 +00:00
parent c606a9a401
commit ea6f44b5ec
4 changed files with 54 additions and 24 deletions

View File

@@ -64,6 +64,11 @@
#endif
#ifdef __WXGTK__
#include "gtk/gtk.h"
#include "gdk/gdk.h"
#endif
//-----------------------------------------------------------------------------
// start and end of document/page
//-----------------------------------------------------------------------------
@@ -1465,20 +1470,41 @@ void wxPostScriptDC::EndPage ()
*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();
@@ -1600,7 +1626,7 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y,
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;
}

View File

@@ -58,14 +58,16 @@ 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;
@@ -78,7 +80,7 @@ wxDC::wxDC()
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()

View File

@@ -58,14 +58,16 @@ 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;
@@ -78,7 +80,7 @@ wxDC::wxDC()
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()

View File

@@ -68,8 +68,8 @@ wxDC::wxDC(void)
m_signX = 1; // default x-axis left to right
m_signY = 1; // default y-axis top down
m_maxX = m_maxY = -100000;
m_minY = m_minY = 100000;
m_maxX = m_maxY = 0;
m_minX = m_minY = 0;
m_logicalFunction = wxCOPY;
// m_textAlignment = wxALIGN_TOP_LEFT;