+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();
+}