#if wxUSE_GRAPHICS_CONTEXT
-#include "wx/private/graphics.h"
+#include "wx/graphics.h"
#ifndef WX_PRECOMP
#include "wx/icon.h"
#include "wx/log.h"
#endif
-//-----------------------------------------------------------------------------
-// constants
-//-----------------------------------------------------------------------------
-
-static const double RAD2DEG = 180.0 / M_PI;
+#include "wx/private/graphics.h"
//-----------------------------------------------------------------------------
// Local functions
return wxRect2DDouble( x,y,w,h );
}
-bool wxGraphicsPath::Contains( const wxPoint2DDouble& c, int fillStyle ) const
+bool wxGraphicsPath::Contains( const wxPoint2DDouble& c, wxPolygonFillMode fillStyle ) const
{
return Contains( c.m_x, c.m_y, fillStyle);
}
GetPathData()->GetBox(x,y,w,h);
}
-bool wxGraphicsPath::Contains( wxDouble x, wxDouble y, int fillStyle ) const
+bool wxGraphicsPath::Contains( wxDouble x, wxDouble y, wxPolygonFillMode fillStyle ) const
{
return GetPathData()->Contains(x,y,fillStyle);
}
wxDouble dist = r / sin(alpha/2) * cos(alpha/2);
// calculate tangential points
wxPoint2DDouble t1 = dist*v1 + p1;
- wxPoint2DDouble t2 = dist*v2 + p1;
wxPoint2DDouble nv1 = v1;
nv1.SetVectorAngle(v1.GetVectorAngle()-90);
IMPLEMENT_ABSTRACT_CLASS(wxGraphicsContext, wxObject)
-wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer) : wxGraphicsObject(renderer)
+wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer) :
+ wxGraphicsObject(renderer),
+ m_antialias(wxANTIALIAS_DEFAULT),
+ m_composition(wxCOMPOSITION_OVER)
{
- m_logicalFunction = wxCOPY;
}
wxGraphicsContext::~wxGraphicsContext()
void wxGraphicsContext::SetPen( const wxPen& pen )
{
- if ( !pen.Ok() || pen.GetStyle() == wxTRANSPARENT )
+ if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
SetPen( wxNullGraphicsPen );
else
SetPen( CreatePen( pen ) );
void wxGraphicsContext::SetBrush( const wxBrush& brush )
{
- if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT )
+ if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT )
SetBrush( wxNullGraphicsBrush );
else
SetBrush( CreateBrush( brush ) );
m_font = font;
}
-bool wxGraphicsContext::SetLogicalFunction( int function )
-{
- if ( function == wxCOPY )
- {
- m_logicalFunction = function;
- return true;
- }
- return false;
-}
-
void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour )
{
if ( font.Ok() )
SetFont( wxNullGraphicsFont );
}
-void wxGraphicsContext::DrawPath( const wxGraphicsPath& path, int fillStyle )
+void wxGraphicsContext::DrawPath( const wxGraphicsPath& path, wxPolygonFillMode fillStyle )
{
FillPath( path , fillStyle );
StrokePath( path );
StrokePath( path );
}
-void wxGraphicsContext::DrawLines( size_t n, const wxPoint2DDouble *points, int fillStyle)
+void wxGraphicsContext::DrawLines( size_t n, const wxPoint2DDouble *points, wxPolygonFillMode fillStyle)
{
wxASSERT(n > 1);
wxGraphicsPath path = CreatePath();
wxGraphicsBitmap wxGraphicsContext::CreateBitmap( const wxBitmap& bmp ) const
{
-#ifndef __WXGTK20__
return GetRenderer()->CreateBitmap(bmp);
-#else
- return wxNullGraphicsBitmap;
-#endif
}
wxGraphicsBitmap wxGraphicsContext::CreateSubBitmap( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) const
{
-#ifndef __WXGTK20__
return GetRenderer()->CreateSubBitmap(bmp,x,y,w,h);
-#else
- return wxNullGraphicsBitmap;
-#endif
}
/* static */ wxGraphicsContext* wxGraphicsContext::Create( const wxWindowDC& dc)