+ str.Printf(wxT("%s(%p)"), GetType().c_str(), static_cast<void*>(m_value));
+ return true;
+}
+
+#if wxUSE_STD_IOSTREAM
+bool wxVariantDataWxObjectPtr::Read(wxSTD istream& WXUNUSED(str))
+{
+ // Not implemented
+ return false;
+}
+#endif
+
+bool wxVariantDataWxObjectPtr::Read(wxString& WXUNUSED(str))
+{
+ // Not implemented
+ return false;
+}
+
+// wxVariant
+
+wxVariant::wxVariant( wxObject* val, const wxString& name)
+{
+ m_refData = new wxVariantDataWxObjectPtr(val);
+ m_name = name;
+}
+
+bool wxVariant::operator== (wxObject* value) const
+{
+ return (value == ((wxVariantDataWxObjectPtr*)GetData())->GetValue());
+}
+
+bool wxVariant::operator!= (wxObject* value) const
+{
+ return (!((*this) == (wxObject*) value));
+}
+
+void wxVariant::operator= (wxObject* value)
+{
+ UnRef();
+ m_refData = new wxVariantDataWxObjectPtr(value);
+}
+
+wxObject* wxVariant::GetWxObjectPtr() const
+{
+ return (wxObject*) ((wxVariantDataWxObjectPtr*) m_refData)->GetValue();
+}
+
+// ----------------------------------------------------------------------------
+// wxVariantDataVoidPtr
+// ----------------------------------------------------------------------------
+
+class wxVariantDataVoidPtr: public wxVariantData
+{
+public:
+ wxVariantDataVoidPtr() { }
+ wxVariantDataVoidPtr(void* value) { m_value = value; }
+
+ inline void* GetValue() const { return m_value; }
+ inline void SetValue(void* value) { m_value = value; }
+
+ virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
+ virtual bool Write(wxSTD ostream& str) const;
+#endif
+ virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
+ virtual bool Read(wxSTD istream& str);
+#endif
+ virtual bool Read(wxString& str);
+ virtual wxString GetType() const { return wxT("void*"); }
+ virtual wxVariantData* Clone() const { return new wxVariantDataVoidPtr(m_value); }
+
+ DECLARE_WXANY_CONVERSION()
+protected:
+ void* m_value;
+};
+
+IMPLEMENT_TRIVIAL_WXANY_CONVERSION(void*, wxVariantDataVoidPtr)
+
+bool wxVariantDataVoidPtr::Eq(wxVariantData& data) const
+{
+ wxASSERT_MSG( data.GetType() == wxT("void*"), wxT("wxVariantDataVoidPtr::Eq: argument mismatch") );
+
+ wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data;
+
+ return (otherData.m_value == m_value);
+}
+
+#if wxUSE_STD_IOSTREAM
+bool wxVariantDataVoidPtr::Write(wxSTD ostream& str) const
+{
+ wxString s;
+ Write(s);
+ str << (const char*) s.mb_str();
+ return true;
+}
+#endif
+
+bool wxVariantDataVoidPtr::Write(wxString& str) const
+{
+ str.Printf(wxT("%p"), m_value);
+ return true;