//-----------------------------------------------------------------------------
-#if wxUSE_NEW_DC
-
class WXDLLEXPORT wxPostScriptDC : public wxDC
{
public:
// Recommended constructor
wxPostScriptDC(const wxPrintData& printData);
-
+
private:
DECLARE_DYNAMIC_CLASS(wxPostScriptDC)
};
-#endif
-
-#if wxUSE_NEW_DC
class WXDLLEXPORT wxPostScriptDCImpl : public wxDCImpl
-#else
-#define wxPostScriptDCImpl wxPostScriptDC
-class WXDLLEXPORT wxPostScriptDC : public wxDC
-#endif
{
public:
-#if wxUSE_NEW_DC
wxPostScriptDCImpl( wxPrinterDC *owner );
wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data );
wxPostScriptDCImpl( wxPostScriptDC *owner );
wxPostScriptDCImpl( wxPostScriptDC *owner, const wxPrintData& data );
-#else
- wxPostScriptDC();
- // Recommended constructor
- wxPostScriptDC(const wxPrintData& printData);
-#endif
-
void Init();
virtual ~wxPostScriptDCImpl();
// 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)) { }
virtual int GetDepth() const { return 24; }
void PsPrint( const wxString& psdata );
-
+
// Overrridden for wxPrinterDC Impl
-
+
virtual int GetResolution();
virtual wxRect GetPaperRect();
//-------------------------------------------------------------------------------
-#if wxUSE_NEW_DC
-
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
wxPostScriptDC::wxPostScriptDC()
+ : wxDC(new wxPostScriptDCImpl(this))
{
- m_pimpl = new wxPostScriptDCImpl( this );
}
wxPostScriptDC::wxPostScriptDC(const wxPrintData& printData)
+ : wxDC(new wxPostScriptDCImpl(this, printData))
{
- m_pimpl = new wxPostScriptDCImpl( this, printData );
}
-#endif
-
-
// conversion
static const double RAD2DEG = 180.0 / M_PI;
#define YLOG2DEVREL(x) ((double)(LogicalToDeviceYRel(x)) * DEV2PS)
-#if wxUSE_NEW_DC
IMPLEMENT_ABSTRACT_CLASS(wxPostScriptDCImpl, wxDCImpl)
-#else
-IMPLEMENT_ABSTRACT_CLASS(wxPostScriptDC, wxDC)
-#endif
//-------------------------------------------------------------------------------
-#if wxUSE_NEW_DC
wxPostScriptDCImpl::wxPostScriptDCImpl( wxPostScriptDC *owner ) :
wxDCImpl( owner )
{
Init();
m_pageHeight = 842 * PS2DEV;
-
+
m_ok = true;
}
wxDCImpl( owner )
{
Init();
-
+
// this calculates m_pageHeight required for
// taking the inverted Y axis into account
SetPrintData( data );
m_ok = true;
}
-#endif
-#if wxUSE_NEW_DC
wxPostScriptDCImpl::wxPostScriptDCImpl( wxPrinterDC *owner ) :
wxDCImpl( owner )
-#else
-wxPostScriptDC::wxPostScriptDC()
-#endif
{
Init();
m_pageHeight = 842 * PS2DEV;
-
+
m_ok = true;
}
-#if wxUSE_NEW_DC
wxPostScriptDCImpl::wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data ) :
wxDCImpl( owner )
-#else
-wxPostScriptDC::wxPostScriptDC( const wxPrintData& data )
-#endif
{
Init();
-
+
// this calculates m_pageHeight required for
// taking the inverted Y axis into account
SetPrintData( data );
if (m_clipping)
DestroyClippingRegion();
-#if wxUSE_NEW_DC
m_clipX1 = x;
m_clipY1 = y;
m_clipX2 = x + w;
m_clipY2 = y + h;
-#else
- wxDC::DoSetClippingRegion(x, y, w, h);
-#endif
m_clipping = true;
PsPrint( "grestore\n" );
}
-#if wxUSE_NEW_DC
wxDCImpl::DestroyClippingRegion();
-#else
- wxDC::DestroyClippingRegion();
-#endif
}
void wxPostScriptDCImpl::Clear()
m_pageHeight = h * PS2DEV;
}
-#if wxUSE_NEW_DC
-#else
-void wxPostScriptDCImpl::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
-{
- wxDCBase::SetAxisOrientation(xLeftRight,yBottomUp);
-}
-
-void wxPostScriptDCImpl::SetMapMode(int mode)
-{
- wxDCBase::SetMapMode(mode);
-}
-
-void wxPostScriptDCImpl::SetUserScale(double x, double y)
-{
- wxDCBase::SetUserScale(x,y);
-}
-
-void wxPostScriptDCImpl::SetLogicalScale(double x, double y)
-{
- wxDCBase::SetLogicalScale(x,y);
-}
-
-void wxPostScriptDCImpl::SetLogicalOrigin(wxCoord x, wxCoord y)
-{
- wxDCBase::SetLogicalOrigin(x,y);
-}
-
-void wxPostScriptDCImpl::SetDeviceOrigin(wxCoord x, wxCoord y)
-{
- wxDCBase::SetDeviceOrigin(x,y);
-}
-#endif
-
void wxPostScriptDCImpl::ComputeScaleAndOrigin()
{
const wxRealPoint origScale(m_scaleX, m_scaleY);
-#if wxUSE_NEW_DC
wxDCImpl::ComputeScaleAndOrigin();
-#else
- wxDC::ComputeScaleAndOrigin();
-#endif
// If scale has changed call SetPen to recalulate the line width
// and SetFont to recalculate font size