compilation fix after removing default wxDC ctor

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-11-30 21:17:23 +00:00
parent f2498c4e33
commit b1f0e54a75
2 changed files with 9 additions and 101 deletions

View File

@@ -27,8 +27,6 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#if wxUSE_NEW_DC
class WXDLLEXPORT wxPostScriptDC : public wxDC class WXDLLEXPORT wxPostScriptDC : public wxDC
{ {
public: public:
@@ -36,33 +34,19 @@ public:
// Recommended constructor // Recommended constructor
wxPostScriptDC(const wxPrintData& printData); wxPostScriptDC(const wxPrintData& printData);
private: private:
DECLARE_DYNAMIC_CLASS(wxPostScriptDC) DECLARE_DYNAMIC_CLASS(wxPostScriptDC)
}; };
#endif
#if wxUSE_NEW_DC
class WXDLLEXPORT wxPostScriptDCImpl : public wxDCImpl class WXDLLEXPORT wxPostScriptDCImpl : public wxDCImpl
#else
#define wxPostScriptDCImpl wxPostScriptDC
class WXDLLEXPORT wxPostScriptDC : public wxDC
#endif
{ {
public: public:
#if wxUSE_NEW_DC
wxPostScriptDCImpl( wxPrinterDC *owner ); wxPostScriptDCImpl( wxPrinterDC *owner );
wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data ); wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data );
wxPostScriptDCImpl( wxPostScriptDC *owner ); wxPostScriptDCImpl( wxPostScriptDC *owner );
wxPostScriptDCImpl( wxPostScriptDC *owner, const wxPrintData& data ); wxPostScriptDCImpl( wxPostScriptDC *owner, const wxPrintData& data );
#else
wxPostScriptDC();
// Recommended constructor
wxPostScriptDC(const wxPrintData& printData);
#endif
void Init(); void Init();
virtual ~wxPostScriptDCImpl(); virtual ~wxPostScriptDCImpl();
@@ -93,18 +77,6 @@ public:
// Resolution in pixels per logical inch // Resolution in pixels per logical inch
wxSize GetPPI() const; 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(); virtual void ComputeScaleAndOrigin();
void SetBackgroundMode(int WXUNUSED(mode)) { } void SetBackgroundMode(int WXUNUSED(mode)) { }
@@ -116,9 +88,9 @@ public:
virtual int GetDepth() const { return 24; } virtual int GetDepth() const { return 24; }
void PsPrint( const wxString& psdata ); void PsPrint( const wxString& psdata );
// Overrridden for wxPrinterDC Impl // Overrridden for wxPrinterDC Impl
virtual int GetResolution(); virtual int GetResolution();
virtual wxRect GetPaperRect(); virtual wxRect GetPaperRect();

View File

@@ -236,23 +236,18 @@ static char wxPostScriptHeaderReencodeISO2[] =
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
#if wxUSE_NEW_DC
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC) IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
wxPostScriptDC::wxPostScriptDC() wxPostScriptDC::wxPostScriptDC()
: wxDC(new wxPostScriptDCImpl(this))
{ {
m_pimpl = new wxPostScriptDCImpl( this );
} }
wxPostScriptDC::wxPostScriptDC(const wxPrintData& printData) wxPostScriptDC::wxPostScriptDC(const wxPrintData& printData)
: wxDC(new wxPostScriptDCImpl(this, printData))
{ {
m_pimpl = new wxPostScriptDCImpl( this, printData );
} }
#endif
// conversion // conversion
static const double RAD2DEG = 180.0 / M_PI; static const double RAD2DEG = 180.0 / M_PI;
@@ -267,22 +262,17 @@ static const double DEV2PS = 72.0 / 600.0;
#define YLOG2DEVREL(x) ((double)(LogicalToDeviceYRel(x)) * DEV2PS) #define YLOG2DEVREL(x) ((double)(LogicalToDeviceYRel(x)) * DEV2PS)
#if wxUSE_NEW_DC
IMPLEMENT_ABSTRACT_CLASS(wxPostScriptDCImpl, wxDCImpl) IMPLEMENT_ABSTRACT_CLASS(wxPostScriptDCImpl, wxDCImpl)
#else
IMPLEMENT_ABSTRACT_CLASS(wxPostScriptDC, wxDC)
#endif
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
#if wxUSE_NEW_DC
wxPostScriptDCImpl::wxPostScriptDCImpl( wxPostScriptDC *owner ) : wxPostScriptDCImpl::wxPostScriptDCImpl( wxPostScriptDC *owner ) :
wxDCImpl( owner ) wxDCImpl( owner )
{ {
Init(); Init();
m_pageHeight = 842 * PS2DEV; m_pageHeight = 842 * PS2DEV;
m_ok = true; m_ok = true;
} }
@@ -290,39 +280,30 @@ wxPostScriptDCImpl::wxPostScriptDCImpl( wxPostScriptDC *owner, const wxPrintData
wxDCImpl( owner ) wxDCImpl( owner )
{ {
Init(); Init();
// this calculates m_pageHeight required for // this calculates m_pageHeight required for
// taking the inverted Y axis into account // taking the inverted Y axis into account
SetPrintData( data ); SetPrintData( data );
m_ok = true; m_ok = true;
} }
#endif
#if wxUSE_NEW_DC
wxPostScriptDCImpl::wxPostScriptDCImpl( wxPrinterDC *owner ) : wxPostScriptDCImpl::wxPostScriptDCImpl( wxPrinterDC *owner ) :
wxDCImpl( owner ) wxDCImpl( owner )
#else
wxPostScriptDC::wxPostScriptDC()
#endif
{ {
Init(); Init();
m_pageHeight = 842 * PS2DEV; m_pageHeight = 842 * PS2DEV;
m_ok = true; m_ok = true;
} }
#if wxUSE_NEW_DC
wxPostScriptDCImpl::wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data ) : wxPostScriptDCImpl::wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data ) :
wxDCImpl( owner ) wxDCImpl( owner )
#else
wxPostScriptDC::wxPostScriptDC( const wxPrintData& data )
#endif
{ {
Init(); Init();
// this calculates m_pageHeight required for // this calculates m_pageHeight required for
// taking the inverted Y axis into account // taking the inverted Y axis into account
SetPrintData( data ); SetPrintData( data );
@@ -381,14 +362,10 @@ void wxPostScriptDCImpl::DoSetClippingRegion (wxCoord x, wxCoord y, wxCoord w, w
if (m_clipping) if (m_clipping)
DestroyClippingRegion(); DestroyClippingRegion();
#if wxUSE_NEW_DC
m_clipX1 = x; m_clipX1 = x;
m_clipY1 = y; m_clipY1 = y;
m_clipX2 = x + w; m_clipX2 = x + w;
m_clipY2 = y + h; m_clipY2 = y + h;
#else
wxDC::DoSetClippingRegion(x, y, w, h);
#endif
m_clipping = true; m_clipping = true;
@@ -419,11 +396,7 @@ void wxPostScriptDCImpl::DestroyClippingRegion()
PsPrint( "grestore\n" ); PsPrint( "grestore\n" );
} }
#if wxUSE_NEW_DC
wxDCImpl::DestroyClippingRegion(); wxDCImpl::DestroyClippingRegion();
#else
wxDC::DestroyClippingRegion();
#endif
} }
void wxPostScriptDCImpl::Clear() void wxPostScriptDCImpl::Clear()
@@ -1649,48 +1622,11 @@ void wxPostScriptDCImpl::SetPrintData(const wxPrintData& data)
m_pageHeight = h * PS2DEV; 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() void wxPostScriptDCImpl::ComputeScaleAndOrigin()
{ {
const wxRealPoint origScale(m_scaleX, m_scaleY); const wxRealPoint origScale(m_scaleX, m_scaleY);
#if wxUSE_NEW_DC
wxDCImpl::ComputeScaleAndOrigin(); wxDCImpl::ComputeScaleAndOrigin();
#else
wxDC::ComputeScaleAndOrigin();
#endif
// If scale has changed call SetPen to recalulate the line width // If scale has changed call SetPen to recalulate the line width
// and SetFont to recalculate font size // and SetFont to recalculate font size