]> git.saurik.com Git - wxWidgets.git/commitdiff
adapting to new inheritance of wxMemoryDC (under MSW only at the moment)
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 6 Nov 2006 09:47:20 +0000 (09:47 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 6 Nov 2006 09:47:20 +0000 (09:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dcgraph.h
include/wx/graphics.h
src/common/dcgraph.cpp
src/common/graphcmn.cpp
src/generic/graphicc.cpp
src/msw/graphics.cpp

index f5a77adae292881f31cc8ae114ae4dd76507b516..091ebdfc32107a21e3482b49d97872e5f39f07b5 100755 (executable)
@@ -36,6 +36,9 @@ class WXDLLEXPORT wxGCDC:
 
 public:
     wxGCDC(const wxWindowDC& dc);
+#ifdef __WXMSW__
+    wxGCDC( const wxMemoryDC& dc);
+#endif    
     wxGCDC();
     virtual ~wxGCDC();
 
index 1d8fcd3c17433ccf7a1e82fe8d618481aa121b68..ef18b3ed15bc1c2228f082fb60ecf758ac9860d6 100755 (executable)
@@ -18,6 +18,7 @@
 #include "wx/dynarray.h"
 
 class WXDLLIMPEXP_CORE wxWindowDC;
+class WXDLLIMPEXP_CORE wxMemoryDC;
 class WXDLLIMPEXP_CORE wxGraphicsContext;
 class WXDLLIMPEXP_CORE wxGraphicsPath;
 class WXDLLIMPEXP_CORE wxGraphicsMatrix;
@@ -387,6 +388,10 @@ public:
     
     static wxGraphicsContext* Create( const wxWindowDC& dc) ;
     
+#ifdef __WXMSW__
+    static wxGraphicsContext * Create( const wxMemoryDC& dc) ;
+#endif    
+
     static wxGraphicsContext* CreateFromNative( void * context ) ;
 
     static wxGraphicsContext* CreateFromNativeWindow( void * window ) ;
@@ -605,7 +610,9 @@ public :
     // Context
 
     virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0 ;
-    
+#ifdef __WXMSW__
+    virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc) = 0 ;
+#endif    
     virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ) = 0;
 
     virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window ) = 0;
index 94f164466569e9b616b83389665d84029a5e4b22..fc1a6a89e743a7a59852be76d3dc68930ba6ab18 100644 (file)
@@ -83,6 +83,14 @@ wxGCDC::wxGCDC(const wxWindowDC& dc)
     SetGraphicsContext( wxGraphicsContext::Create(dc) );
 }
 
+#ifdef __WXMSW__
+wxGCDC::wxGCDC(const wxMemoryDC& dc)
+{
+    Init();
+    SetGraphicsContext( wxGraphicsContext::Create(dc) );
+}
+#endif    
+
 void wxGCDC::Init()
 {
     m_ok = false;
index 91894232e424a6e8579a5aa99cfc0d8d16612e03..fe68a237c57dcccabf668a08003b635c752e4e34 100644 (file)
@@ -707,6 +707,12 @@ wxGraphicsContext* wxGraphicsContext::Create( const wxWindowDC& dc)
 {
     return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc);
 }
+#ifdef __WXMSW__
+wxGraphicsContext* wxGraphicsContext::Create( const wxMemoryDC& dc) 
+{
+    return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc);
+}
+#endif
 
 wxGraphicsContext* wxGraphicsContext::CreateFromNative( void * context )
 {
index a4d2e774e1f844bd4648406e87536c52de3b9387..04e918bab1fa965c37e50b9068a1baeeb45bee6c 100755 (executable)
@@ -1166,6 +1166,10 @@ public :
 
     virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc);
 
+#ifdef __WXMSW__
+    virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc);
+#endif
+
     virtual wxGraphicsContext * CreateContextFromNativeContext( void * context );
 
     virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window );
@@ -1224,6 +1228,13 @@ wxGraphicsContext * wxCairoRenderer::CreateContext( const wxWindowDC& dc)
     return new wxCairoContext(this,dc);
 }
 
+#ifdef __WXMSW__
+wxGraphicsContext * wxCairoRenderer::CreateContext( const wxMemoryDC& dc)
+{
+    return NULL;
+}
+#endif
+
 wxGraphicsContext * wxCairoRenderer::CreateContextFromNativeContext( void * context )
 {
     return new wxCairoContext(this,(cairo_t*)context);
index 612e8e926d9eb748cd0a77298bf0ded98ad47146..cda93a281a6dc15f7b1137fc66652d168a4d2d8a 100644 (file)
@@ -1227,6 +1227,8 @@ public :
 
     virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc);
 
+    virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc);
+
     virtual wxGraphicsContext * CreateContextFromNativeContext( void * context );
 
     virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window );
@@ -1313,6 +1315,12 @@ wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxWindowDC& dc)
     return new wxGDIPlusContext(this,(HDC) dc.GetHDC());
 }
 
+wxGraphicsContext * wxGDIPlusRenderer::CreateContext( const wxMemoryDC& dc)
+{
+    EnsureIsLoaded();
+    return new wxGDIPlusContext(this,(HDC) dc.GetHDC());
+}
+
 wxGraphicsContext * wxGDIPlusRenderer::CreateMeasuringContext()
 {
     EnsureIsLoaded();