virtual void AddArc( wxDouble x, wxDouble y, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise ) ;
// gets the last point of the current path, (0,0) if not yet set
virtual void AddArc( wxDouble x, wxDouble y, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise ) ;
// gets the last point of the current path, (0,0) if not yet set
virtual void * GetNativePath() const { return m_path; }
// give the native path returned by GetNativePath() back (there might be some deallocations necessary)
virtual void * GetNativePath() const { return m_path; }
// give the native path returned by GetNativePath() back (there might be some deallocations necessary)
- virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) ;
+ virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const;
- wxGDIPlusMatrix(wxGraphicsRenderer* renderer, Matrix* matrix = NULL ) ;
- virtual ~wxGDIPlusMatrix() ;
-
- virtual wxGraphicsMatrix *Clone() const ;
+ virtual wxGraphicsObjectRefData* Clone() const ;
// sets the matrix to the respective values
virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
// sets the matrix to the respective values
virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
- wxGDIPlusBrush();
- wxGDIPlusBrush( wxGraphicsRenderer* renderer );
- wxGDIPlusBrush( wxGraphicsRenderer* renderer, const wxBrush &brush );
- ~wxGDIPlusBrush ();
+ wxGDIPlusBrushData( wxGraphicsRenderer* renderer );
+ wxGDIPlusBrushData( wxGraphicsRenderer* renderer, const wxBrush &brush );
+ ~wxGDIPlusBrushData ();
void CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
const wxColour&c1, const wxColour&c2 );
void CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
void CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
const wxColour&c1, const wxColour&c2 );
void CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
virtual Brush* GetGDIPlusBrush() { return m_textBrush; }
virtual Font* GetGDIPlusFont() { return m_font; }
private :
Brush* m_textBrush;
Font* m_font;
virtual Brush* GetGDIPlusBrush() { return m_textBrush; }
virtual Font* GetGDIPlusFont() { return m_font; }
private :
Brush* m_textBrush;
Font* m_font;
- virtual void StrokePath( const wxGraphicsPath *p );
- virtual void FillPath( const wxGraphicsPath *p , int fillStyle = wxWINDING_RULE );
+ virtual void StrokePath( const wxGraphicsPath& p );
+ virtual void FillPath( const wxGraphicsPath& p , int fillStyle = wxODDEVEN_RULE );
virtual void Translate( wxDouble dx , wxDouble dy );
virtual void Scale( wxDouble xScale , wxDouble yScale );
virtual void Rotate( wxDouble angle );
// concatenates this transform with the current transform of this context
virtual void Translate( wxDouble dx , wxDouble dy );
virtual void Scale( wxDouble xScale , wxDouble yScale );
virtual void Rotate( wxDouble angle );
// concatenates this transform with the current transform of this context
virtual void DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h );
virtual void DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h );
virtual void DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h );
virtual void DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h );
// wxGDIPlusPen implementation
//-----------------------------------------------------------------------------
// wxGDIPlusPen implementation
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxGDIPlusPen,wxGraphicsPen)
-
-wxGDIPlusPen::wxGDIPlusPen() : wxGraphicsPen(NULL)
-{
- wxLogDebug(wxT("Illegal Constructor called"));
-}
-
-wxGDIPlusPen::~wxGDIPlusPen()
+wxGDIPlusPenData::~wxGDIPlusPenData()
-wxGDIPlusPen::wxGDIPlusPen( wxGraphicsRenderer* renderer, const wxPen &pen )
-: wxGraphicsPen(renderer)
+wxGDIPlusPenData::wxGDIPlusPenData( wxGraphicsRenderer* renderer, const wxPen &pen )
+: wxGraphicsObjectRefData(renderer)
//-----------------------------------------------------------------------------
// wxGDIPlusBrush implementation
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// wxGDIPlusBrush implementation
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxGDIPlusBrush,wxGraphicsBrush)
-
-wxGDIPlusBrush::wxGDIPlusBrush( wxGraphicsRenderer* renderer )
-: wxGraphicsBrush(renderer)
+wxGDIPlusBrushData::wxGDIPlusBrushData( wxGraphicsRenderer* renderer )
+: wxGraphicsObjectRefData(renderer)
-wxGDIPlusBrush::wxGDIPlusBrush( )
-: wxGraphicsBrush(NULL)
-{
- wxLogDebug(wxT("Illegal Constructor called"));
-}
-
-
-wxGDIPlusBrush::wxGDIPlusBrush( wxGraphicsRenderer* renderer , const wxBrush &brush )
-: wxGraphicsBrush(renderer)
+wxGDIPlusBrushData::wxGDIPlusBrushData( wxGraphicsRenderer* renderer , const wxBrush &brush )
+: wxGraphicsObjectRefData(renderer)
-void wxGDIPlusBrush::CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxColour&c1, const wxColour&c2)
+void wxGDIPlusBrushData::CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxColour&c1, const wxColour&c2)
{
m_brush = new LinearGradientBrush( PointF( x1,y1) , PointF( x2,y2),
Color( c1.Alpha(), c1.Red(),c1.Green() , c1.Blue() ),
Color( c2.Alpha(), c2.Red(),c2.Green() , c2.Blue() ));
}
{
m_brush = new LinearGradientBrush( PointF( x1,y1) , PointF( x2,y2),
Color( c1.Alpha(), c1.Red(),c1.Green() , c1.Blue() ),
Color( c2.Alpha(), c2.Red(),c2.Green() , c2.Blue() ));
}
-void wxGDIPlusBrush::CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
+void wxGDIPlusBrushData::CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
const wxColour &oColor, const wxColour &cColor)
{
// Create a path that consists of a single circle.
const wxColour &oColor, const wxColour &cColor)
{
// Create a path that consists of a single circle.
//-----------------------------------------------------------------------------
// wxGDIPlusFont implementation
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// wxGDIPlusFont implementation
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxGDIPlusFont,wxGraphicsFont)
-
-wxGDIPlusFont::wxGDIPlusFont() : wxGraphicsFont( NULL )
-{
- wxLogDebug(wxT("Illegal Constructor called"));
-}
-
-wxGDIPlusFont::wxGDIPlusFont( wxGraphicsRenderer* renderer, const wxFont &font,
- const wxColour& col ) : wxGraphicsFont( renderer )
+wxGDIPlusFontData::wxGDIPlusFontData( wxGraphicsRenderer* renderer, const wxFont &font,
+ const wxColour& col ) : wxGraphicsObjectRefData( renderer )
//-----------------------------------------------------------------------------
// wxGDIPlusPath implementation
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// wxGDIPlusPath implementation
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxGDIPlusPath,wxGraphicsPath)
-
-wxGDIPlusPath::wxGDIPlusPath(wxGraphicsRenderer* renderer, GraphicsPath* path ) : wxGraphicsPath(renderer)
+wxGDIPlusPathData::wxGDIPlusPathData(wxGraphicsRenderer* renderer, GraphicsPath* path ) : wxGraphicsPathData(renderer)
{
m_path->StartFigure();
m_path->AddLine((REAL) x,(REAL) y,(REAL) x,(REAL) y);
}
{
m_path->StartFigure();
m_path->AddLine((REAL) x,(REAL) y,(REAL) x,(REAL) y);
}
{
m_path->AddLine((REAL) x,(REAL) y,(REAL) x,(REAL) y);
}
{
m_path->AddLine((REAL) x,(REAL) y,(REAL) x,(REAL) y);
}
-void wxGDIPlusPath::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y )
+void wxGDIPlusPathData::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y )
-void wxGDIPlusPath::AddArc( wxDouble x, wxDouble y, wxDouble r, double startAngle, double endAngle, bool clockwise )
+void wxGDIPlusPathData::AddArc( wxDouble x, wxDouble y, wxDouble r, double startAngle, double endAngle, bool clockwise )
m_path->AddArc((REAL) (x-r),(REAL) (y-r),(REAL) (2*r),(REAL) (2*r),RadToDeg(startAngle),RadToDeg(sweepAngle));
}
m_path->AddArc((REAL) (x-r),(REAL) (y-r),(REAL) (2*r),(REAL) (2*r),RadToDeg(startAngle),RadToDeg(sweepAngle));
}
-void wxGDIPlusPath::AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h )
+void wxGDIPlusPathData::AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h )
{
m_path->AddRectangle(RectF(x,y,w,h));
}
{
m_path->AddRectangle(RectF(x,y,w,h));
}
{
m_path->AddPath( (GraphicsPath*) path->GetNativePath(), FALSE);
}
// transforms each point of this path by the matrix
{
m_path->AddPath( (GraphicsPath*) path->GetNativePath(), FALSE);
}
// transforms each point of this path by the matrix
{
m_path->Transform( (Matrix*) matrix->GetNativeMatrix() );
}
// gets the bounding box enclosing all points (possibly including control points)
{
m_path->Transform( (Matrix*) matrix->GetNativeMatrix() );
}
// gets the bounding box enclosing all points (possibly including control points)
-void wxGDIPlusPath::GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h)
+void wxGDIPlusPathData::GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const
{
m_path->SetFillMode( fillStyle == wxODDEVEN_RULE ? FillModeAlternate : FillModeWinding);
return m_path->IsVisible( (FLOAT) x,(FLOAT) y) == TRUE ;
}
//-----------------------------------------------------------------------------
{
m_path->SetFillMode( fillStyle == wxODDEVEN_RULE ? FillModeAlternate : FillModeWinding);
return m_path->IsVisible( (FLOAT) x,(FLOAT) y) == TRUE ;
}
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxGDIPlusMatrix,wxGraphicsMatrix)
-
-wxGDIPlusMatrix::wxGDIPlusMatrix() : wxGraphicsMatrix(NULL)
-{
- wxLogDebug(wxT("Illegal Constructor called"));
-}
-
-wxGDIPlusMatrix::wxGDIPlusMatrix(wxGraphicsRenderer* renderer, Matrix* matrix )
- : wxGraphicsMatrix(renderer)
+wxGDIPlusMatrixData::wxGDIPlusMatrixData(wxGraphicsRenderer* renderer, Matrix* matrix )
+ : wxGraphicsMatrixData(renderer)
-void wxGDIPlusMatrix::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d,
+void wxGDIPlusMatrixData::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d,
wxDouble tx, wxDouble ty)
{
m_matrix->SetElements(a,b,c,d,tx,ty);
}
// makes this the inverse matrix
wxDouble tx, wxDouble ty)
{
m_matrix->SetElements(a,b,c,d,tx,ty);
}
// makes this the inverse matrix
{
return m_matrix->Equals((Matrix*) t->GetNativeMatrix())== TRUE ;
}
// return true if this is the identity matrix
{
return m_matrix->Equals((Matrix*) t->GetNativeMatrix())== TRUE ;
}
// return true if this is the identity matrix
{
m_matrix->Translate(dx,dy);
}
// add the scale to this matrix
{
m_matrix->Translate(dx,dy);
}
// add the scale to this matrix
{
m_matrix->Scale(xScale,yScale);
}
// add the rotation to this matrix (radians)
{
m_matrix->Scale(xScale,yScale);
}
// add the rotation to this matrix (radians)
- ((GraphicsPath*) path->GetNativePath())->SetFillMode( fillStyle == wxODDEVEN_RULE ? FillModeAlternate : FillModeWinding);
- m_context->FillPath( ((wxGDIPlusBrush*)m_brush)->GetGDIPlusBrush() ,
- (GraphicsPath*) path->GetNativePath());
+ ((GraphicsPath*) path.GetNativePath())->SetFillMode( fillStyle == wxODDEVEN_RULE ? FillModeAlternate : FillModeWinding);
+ m_context->FillPath( ((wxGDIPlusBrushData*)m_brush.GetRefData())->GetGDIPlusBrush() ,
+ (GraphicsPath*) path.GetNativePath());
- m_context->DrawString( s , -1 , ((wxGDIPlusFont*)m_font)->GetGDIPlusFont() ,
- PointF( x , y ) , ((wxGDIPlusFont*)m_font)->GetGDIPlusBrush() );
+ m_context->DrawString( s , -1 , ((wxGDIPlusFontData*)m_font.GetRefData())->GetGDIPlusFont() ,
+ PointF( x , y ) , ((wxGDIPlusFontData*)m_font.GetRefData())->GetGDIPlusBrush() );
wxWCharBuffer ws = text.wc_str( *wxConvUI );
size_t len = wcslen( ws ) ;
wxASSERT_MSG(text.length() == len , wxT("GetPartialTextExtents not yet implemented for multichar situations"));
wxWCharBuffer ws = text.wc_str( *wxConvUI );
size_t len = wcslen( ws ) ;
wxASSERT_MSG(text.length() == len , wxT("GetPartialTextExtents not yet implemented for multichar situations"));
}
//-----------------------------------------------------------------------------
// wxGDIPlusRenderer declaration
}
//-----------------------------------------------------------------------------
// wxGDIPlusRenderer declaration
- virtual wxGraphicsMatrix * CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
+ virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
// sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
// sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
- virtual wxGraphicsBrush* CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
+ virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
const wxColour&c1, const wxColour&c2) ;
// sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
// with radius r and color cColor
const wxColour&c1, const wxColour&c2) ;
// sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
// with radius r and color cColor
- virtual wxGraphicsBrush* CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
+ virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
-wxGraphicsMatrix * wxGDIPlusRenderer::CreateMatrix( wxDouble a, wxDouble b, wxDouble c, wxDouble d,
+wxGraphicsMatrix wxGDIPlusRenderer::CreateMatrix( wxDouble a, wxDouble b, wxDouble c, wxDouble d,
- wxGDIPlusMatrix* m = new wxGDIPlusMatrix( this );
- m->Set( a,b,c,d,tx,ty ) ;
+ wxGraphicsMatrix m;
+ wxGDIPlusMatrixData* data = new wxGDIPlusMatrixData( this );
+ data->Set( a,b,c,d,tx,ty ) ;
+ m.SetRefData(data);
}
// sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
}
// sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
-wxGraphicsBrush* wxGDIPlusRenderer::CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
+wxGraphicsBrush wxGDIPlusRenderer::CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
- wxGDIPlusBrush* brush = new wxGDIPlusBrush(this);
- brush->CreateLinearGradientBrush(x1, y1, x2, y2, c1, c2);
- return brush;
-}
+ wxGraphicsBrush p;
+ wxGDIPlusBrushData* d = new wxGDIPlusBrushData( this );
+ d->CreateLinearGradientBrush(x1, y1, x2, y2, c1, c2);
+ p.SetRefData(d);
+ return p;
+ }
// sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
// with radius r and color cColor
// sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc)
// with radius r and color cColor
-wxGraphicsBrush* wxGDIPlusRenderer::CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
+wxGraphicsBrush wxGDIPlusRenderer::CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius,
- wxGDIPlusBrush* brush = new wxGDIPlusBrush(this);
- brush->CreateRadialGradientBrush(xo,yo,xc,yc,radius,oColor,cColor);
- return brush;
+ wxGraphicsBrush p;
+ wxGDIPlusBrushData* d = new wxGDIPlusBrushData( this );
+ d->CreateRadialGradientBrush(xo,yo,xc,yc,radius,oColor,cColor);
+ p.SetRefData(d);
+ return p;