]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcgraph.cpp
Rework the GTK WebKit backend history to remove the need for the map between wxWebHis...
[wxWidgets.git] / src / common / dcgraph.cpp
index ab615e482fe02cbdab5af9fefbd6950bed53310d..a06cd25382a4ec19db041675f1a142b9e1fb23bf 100644 (file)
@@ -114,6 +114,13 @@ wxGCDC::wxGCDC( const wxPrinterDC& dc) :
 }
 #endif
 
+#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
+wxGCDC::wxGCDC(const wxEnhMetaFileDC& dc)
+   : wxDC(new wxGCDCImpl(this, dc))
+{
+}
+#endif
+
 wxGCDC::wxGCDC() :
   wxDC( new wxGCDCImpl( this ) )
 {
@@ -193,6 +200,15 @@ wxGCDCImpl::wxGCDCImpl( wxDC *owner, const wxPrinterDC& dc ) :
 }
 #endif
 
+#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
+wxGCDCImpl::wxGCDCImpl(wxDC *owner, const wxEnhMetaFileDC& dc)
+   : wxDCImpl(owner)
+{
+    Init();
+    SetGraphicsContext(wxGraphicsContext::Create(dc));
+}
+#endif
+
 void wxGCDCImpl::Init()
 {
     m_ok = false;
@@ -1156,4 +1172,21 @@ void wxGCDCImpl::DoDrawCheckMark(wxCoord x, wxCoord y,
     wxDCImpl::DoDrawCheckMark(x,y,width,height);
 }
 
+#ifdef __WXMSW__
+wxRect wxGCDCImpl::MSWApplyGDIPlusTransform(const wxRect& r) const
+{
+    wxGraphicsContext* const gc = GetGraphicsContext();
+    wxCHECK_MSG( gc, r, wxT("Invalid wxGCDC") );
+
+    double x = 0,
+           y = 0;
+    gc->GetTransform().TransformPoint(&x, &y);
+
+    wxRect rect(r);
+    rect.Offset(x, y);
+
+    return rect;
+}
+#endif // __WXMSW__
+
 #endif // wxUSE_GRAPHICS_CONTEXT