exposing wxGraphicsContext through an ordinary wxDC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2011-08-22 15:10:07 +00:00
parent c08598f6cd
commit e516208e3d

View File

@ -43,6 +43,10 @@ class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
class WXDLLIMPEXP_FWD_CORE wxPrinterDC; class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
class WXDLLIMPEXP_FWD_CORE wxPrintData; class WXDLLIMPEXP_FWD_CORE wxPrintData;
#if wxUSE_GRAPHICS_CONTEXT
class WXDLLIMPEXP_FWD_CORE wxGraphicsContext;
#endif
// Logical ops // Logical ops
enum wxRasterOperationMode enum wxRasterOperationMode
{ {
@ -640,6 +644,13 @@ public:
virtual int GetResolution() const virtual int GetResolution() const
{ return -1; } { return -1; }
#if wxUSE_GRAPHICS_CONTEXT
virtual wxGraphicsContext* GetGraphicsContext() const
{ return NULL; }
virtual void SetGraphicsContext( wxGraphicsContext* WXUNUSED(ctx) )
{}
#endif
private: private:
wxDC *m_owner; wxDC *m_owner;
@ -1329,6 +1340,17 @@ public:
TempHDC GetTempHDC() { return TempHDC(*this); } TempHDC GetTempHDC() { return TempHDC(*this); }
#endif // __WXMSW__ #endif // __WXMSW__
#if wxUSE_GRAPHICS_CONTEXT
virtual wxGraphicsContext* GetGraphicsContext() const
{
return m_pimpl->GetGraphicsContext();
}
virtual void SetGraphicsContext( wxGraphicsContext* ctx )
{
m_pimpl->SetGraphicsContext(ctx);
}
#endif
protected: protected:
// ctor takes ownership of the pointer // ctor takes ownership of the pointer
wxDC(wxDCImpl *pimpl) : m_pimpl(pimpl) { } wxDC(wxDCImpl *pimpl) : m_pimpl(pimpl) { }