X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e0876d7381ada8459e18fc81a9e47c025778b8ec..72c1ba98f2c5e666516a2e44048c7ca0b3926ff4:/src/msw/graphics.cpp diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index bdad1343e3..4e34e73012 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -197,6 +197,14 @@ public: virtual ~wxGDIPlusContext(); virtual void Clip( const wxRegion ®ion ); + // clips drawings to the rect + virtual void Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ); + + // resets the clipping to original extent + virtual void ResetClip(); + + virtual void * GetNativeContext(); + virtual void StrokePath( const wxGraphicsPath *p ); virtual void FillPath( const wxGraphicsPath *p , int fillStyle = wxWINDING_RULE ); @@ -348,6 +356,7 @@ wxGDIPlusContext::wxGDIPlusContext( WXHDC hdc ) { gGDILoader.EnsureIsLoaded(); m_context = new Graphics( (HDC) hdc); + m_context->SetSmoothingMode(SmoothingModeHighQuality); m_state1 = m_context->Save(); m_state2 = m_context->Save(); @@ -387,7 +396,17 @@ wxGDIPlusContext::~wxGDIPlusContext() void wxGDIPlusContext::Clip( const wxRegion & WXUNUSED(region) ) { -// ClipCGContextToRegion ( m_context, &bounds , (RgnHandle) dc->m_macCurrentClipRgn ); +// TODO +} + +void wxGDIPlusContext::Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) +{ +// TODO +} + +void wxGDIPlusContext::ResetClip() +{ +// TODO } void wxGDIPlusContext::StrokePath( const wxGraphicsPath *p ) @@ -416,7 +435,7 @@ wxGraphicsPath* wxGDIPlusContext::CreatePath() void wxGDIPlusContext::Rotate( wxDouble angle ) { - m_context->RotateTransform( angle ); + m_context->RotateTransform( RadToDeg(angle) ); } void wxGDIPlusContext::Translate( wxDouble dx , wxDouble dy ) @@ -426,21 +445,7 @@ void wxGDIPlusContext::Translate( wxDouble dx , wxDouble dy ) void wxGDIPlusContext::Scale( wxDouble xScale , wxDouble yScale ) { - PointF penWidth( m_pen->GetWidth(), 0); - Matrix matrix ; - if ( !m_penTransparent ) - { - m_context->GetTransform(&matrix); - matrix.TransformVectors(&penWidth); - } m_context->ScaleTransform(xScale,yScale); - if ( !m_penTransparent ) - { - m_context->GetTransform(&matrix); - matrix.Invert(); - matrix.TransformVectors(&penWidth) ; - m_pen->SetWidth( sqrt( penWidth.X*penWidth.X + penWidth.Y*penWidth.Y)); - } } void wxGDIPlusContext::PushState() @@ -940,10 +945,26 @@ void wxGDIPlusContext::SetFont( const wxFont &font ) m_font = new Font( s , size , style ); } +void* wxGDIPlusContext::GetNativeContext() +{ + return m_context; +} + wxGraphicsContext* wxGraphicsContext::Create( const wxWindowDC& dc) { return new wxGDIPlusContext( (HDC) dc.GetHDC() ); } +wxGraphicsContext* wxGraphicsContext::Create( wxWindow * window ) +{ + return NULL; // TODO +} + +wxGraphicsContext* wxGraphicsContext::CreateFromNative( void * context ) +{ + return NULL; // TODO +} + + #endif // wxUSE_GRAPHICS_CONTEXT