X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0845ad3a6c0ce38c0c9faafb93a6c96228900f7..1b895132c960415872de82c1d47589b6b55cecee:/include/wx/generic/dcpsg.h?ds=sidebyside diff --git a/include/wx/generic/dcpsg.h b/include/wx/generic/dcpsg.h index a9f6822be2..bb66e50ce1 100644 --- a/include/wx/generic/dcpsg.h +++ b/include/wx/generic/dcpsg.h @@ -16,6 +16,7 @@ #if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT #include "wx/dc.h" +#include "wx/dcprint.h" #include "wx/dialog.h" #include "wx/module.h" #include "wx/cmndata.h" @@ -25,15 +26,30 @@ // wxPostScriptDC //----------------------------------------------------------------------------- -class WXDLLEXPORT wxPostScriptDC: public wxDC + +class WXDLLIMPEXP_CORE wxPostScriptDC : public wxDC { public: wxPostScriptDC(); // Recommended constructor wxPostScriptDC(const wxPrintData& printData); - - virtual ~wxPostScriptDC(); + +private: + DECLARE_DYNAMIC_CLASS(wxPostScriptDC) +}; + +class WXDLLIMPEXP_CORE wxPostScriptDCImpl : public wxDCImpl +{ +public: + wxPostScriptDCImpl( wxPrinterDC *owner ); + wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data ); + wxPostScriptDCImpl( wxPostScriptDC *owner ); + wxPostScriptDCImpl( wxPostScriptDC *owner, const wxPrintData& data ); + + void Init(); + + virtual ~wxPostScriptDCImpl(); virtual bool Ok() const { return IsOk(); } virtual bool IsOk() const; @@ -61,18 +77,6 @@ public: // Resolution in pixels per logical inch wxSize GetPPI() const; -#if wxUSE_NEW_DC -#else - // these need to be overridden as wxPostscriptDC inherits - // from the platform dependent wxDC and this we'd call - // e.g. wxMSW specific code here. - virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp ); - virtual void SetMapMode(int mode); - virtual void SetUserScale(double x, double y); - virtual void SetLogicalScale(double x, double y); - virtual void SetLogicalOrigin(wxCoord x, wxCoord y); - virtual void SetDeviceOrigin(wxCoord x, wxCoord y); -#endif virtual void ComputeScaleAndOrigin(); void SetBackgroundMode(int WXUNUSED(mode)) { } @@ -83,12 +87,12 @@ public: virtual int GetDepth() const { return 24; } - static void SetResolution(int ppi); - static int GetResolution(); - void PsPrint( const wxString& psdata ); -private: + // Overrridden for wxPrinterDC Impl + + virtual int GetResolution(); + virtual wxRect GetPaperRect(); protected: bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style = wxFLOOD_SURFACE); @@ -105,8 +109,8 @@ protected: void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20); void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); #if wxUSE_SPLINES - void DoDrawSpline(wxList *points); -#endif // wxUSE_SPLINES + void DoDrawSpline(const wxPointList *points); +#endif bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); @@ -115,7 +119,10 @@ protected: void DoDrawText(const wxString& text, wxCoord x, wxCoord y); void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip)) { } + void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip)) + { + wxFAIL_MSG( "not implemented" ); + } void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, @@ -124,7 +131,6 @@ protected: void DoGetSizeMM(int *width, int *height) const; FILE* m_pstream; // PostScript output stream - wxString m_title; unsigned char m_currentRed; unsigned char m_currentGreen; unsigned char m_currentBlue; @@ -136,7 +142,7 @@ protected: double m_pageHeight; private: - DECLARE_DYNAMIC_CLASS(wxPostScriptDC) + DECLARE_DYNAMIC_CLASS(wxPostScriptDCImpl) }; #endif