]> git.saurik.com Git - wxWidgets.git/commitdiff
exposing wxGraphicsContext through an ordinary wxDC
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 22 Aug 2011 15:10:07 +0000 (15:10 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 22 Aug 2011 15:10:07 +0000 (15:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dc.h

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