+wxGraphicsObjectRefData::wxGraphicsObjectRefData( wxGraphicsRenderer* renderer )
+{
+ m_renderer = renderer;
+}
+wxGraphicsObjectRefData::wxGraphicsObjectRefData( const wxGraphicsObjectRefData* data )
+{
+ m_renderer = data->m_renderer;
+}
+wxGraphicsRenderer* wxGraphicsObjectRefData::GetRenderer() const
+{
+ return m_renderer ;
+}
+
+wxGraphicsObjectRefData* wxGraphicsObjectRefData::Clone() const
+{
+ return new wxGraphicsObjectRefData(this);
+}
+
+wxGraphicsObject::wxGraphicsObject()
+{
+}
+
+wxGraphicsObject::wxGraphicsObject( wxGraphicsRenderer* renderer )
+{
+ SetRefData( new wxGraphicsObjectRefData(renderer));
+}
+
+wxGraphicsObject::~wxGraphicsObject()
+{
+}
+
+bool wxGraphicsObject::IsNull() const
+{
+ return m_refData == NULL;
+}
+
+wxGraphicsRenderer* wxGraphicsObject::GetRenderer() const
+{
+ return ( IsNull() ? NULL : GetGraphicsData()->GetRenderer() );
+}
+
+wxGraphicsObjectRefData* wxGraphicsObject::GetGraphicsData() const
+{
+ return (wxGraphicsObjectRefData*) m_refData;
+}
+
+wxObjectRefData* wxGraphicsObject::CreateRefData() const
+{
+ wxLogDebug(wxT("A Null Object cannot be changed"));
+ return NULL;
+}
+
+wxObjectRefData* wxGraphicsObject::CloneRefData(const wxObjectRefData* data) const
+{
+ const wxGraphicsObjectRefData* ptr = (const wxGraphicsObjectRefData*) data;
+ return ptr->Clone();
+}
+
+//-----------------------------------------------------------------------------
+// pens etc.
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxGraphicsPen, wxGraphicsObject)
+IMPLEMENT_DYNAMIC_CLASS(wxGraphicsBrush, wxGraphicsObject)
+IMPLEMENT_DYNAMIC_CLASS(wxGraphicsFont, wxGraphicsObject)
+IMPLEMENT_DYNAMIC_CLASS(wxGraphicsBitmap, wxGraphicsObject)
+
+WXDLLIMPEXP_DATA_CORE(wxGraphicsPen) wxNullGraphicsPen;
+WXDLLIMPEXP_DATA_CORE(wxGraphicsBrush) wxNullGraphicsBrush;
+WXDLLIMPEXP_DATA_CORE(wxGraphicsFont) wxNullGraphicsFont;
+WXDLLIMPEXP_DATA_CORE(wxGraphicsBitmap) wxNullGraphicsBitmap;
+
+//-----------------------------------------------------------------------------
+// matrix
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxGraphicsMatrix, wxGraphicsObject)
+WXDLLIMPEXP_DATA_CORE(wxGraphicsMatrix) wxNullGraphicsMatrix;
+
+// concatenates the matrix
+void wxGraphicsMatrix::Concat( const wxGraphicsMatrix *t )
+{
+ AllocExclusive();
+ GetMatrixData()->Concat(t->GetMatrixData());
+}
+
+// sets the matrix to the respective values
+void wxGraphicsMatrix::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d,
+ wxDouble tx, wxDouble ty)
+{
+ AllocExclusive();
+ GetMatrixData()->Set(a,b,c,d,tx,ty);
+}
+
+// gets the component valuess of the matrix
+void wxGraphicsMatrix::Get(wxDouble* a, wxDouble* b, wxDouble* c,
+ wxDouble* d, wxDouble* tx, wxDouble* ty) const
+{
+ GetMatrixData()->Get(a, b, c, d, tx, ty);
+}
+
+// makes this the inverse matrix
+void wxGraphicsMatrix::Invert()
+{
+ AllocExclusive();
+ GetMatrixData()->Invert();
+}
+
+// returns true if the elements of the transformation matrix are equal ?
+bool wxGraphicsMatrix::IsEqual( const wxGraphicsMatrix* t) const
+{
+ return GetMatrixData()->IsEqual(t->GetMatrixData());
+}
+
+// return true if this is the identity matrix
+bool wxGraphicsMatrix::IsIdentity() const
+{
+ return GetMatrixData()->IsIdentity();
+}
+
+// add the translation to this matrix
+void wxGraphicsMatrix::Translate( wxDouble dx , wxDouble dy )
+{
+ AllocExclusive();
+ GetMatrixData()->Translate(dx,dy);
+}
+
+// add the scale to this matrix
+void wxGraphicsMatrix::Scale( wxDouble xScale , wxDouble yScale )
+{
+ AllocExclusive();
+ GetMatrixData()->Scale(xScale,yScale);
+}
+
+// add the rotation to this matrix (radians)
+void wxGraphicsMatrix::Rotate( wxDouble angle )
+{
+ AllocExclusive();
+ GetMatrixData()->Rotate(angle);
+}
+
+//
+// apply the transforms
+//
+
+// applies that matrix to the point
+void wxGraphicsMatrix::TransformPoint( wxDouble *x, wxDouble *y ) const
+{
+ GetMatrixData()->TransformPoint(x,y);
+}