X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ba681060f36767a2682b8547871af2c6f8159955..41895a05eae22da85e8c659f9492d2312a63af13:/src/generic/dcpsg.cpp diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 55ba6d7768..f592a769c8 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -1465,20 +1465,32 @@ 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 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" ); + + /* blit into a bitmap */ + + wxBitmap bitmap( fwidth, fheight ); + wxMemoryDC memDC; + memDC.SelectObject(bitmap); + memDC.Blit(0, 0, fwidth, fheight, source, xsrc, ysrc, rop); /* TODO: Blit transparently? */ + memDC.SelectObject(wxNullBitmap); + + /* 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(); @@ -1486,9 +1498,9 @@ long wxPostScriptDC::GetCharHeight () return 12; } -void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y, - long *descent, long *externalLeading, wxFont *theFont, - bool WXUNUSED(use16)) +void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y, + long *descent, long *externalLeading, wxFont *theFont, + bool WXUNUSED(use16) ) { wxFont *fontToUse = theFont; @@ -1600,7 +1612,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; }