#endif
#if !USE_SHARED_LIBRARY
-wxClassInfo wxObject::sm_classwxObject((char *) "wxObject", (char *) NULL, (char *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
+wxClassInfo wxObject::sm_classwxObject((wxChar *) wxT("wxObject"), (wxChar *) NULL, (wxChar *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
wxClassInfo* wxClassInfo::sm_first = (wxClassInfo *) NULL;
wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL;
#endif
return FALSE;
}
-#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
+wxObject *wxObject::Clone() const
+{
+ wxObject *object = GetClassInfo()->CreateObject();
+ CopyObject(*object);
+ return object;
+}
+
+void wxObject::CopyObject(wxObject& object_dest) const
+{
+ wxASSERT(object_dest.GetClassInfo()->IsKindOf(GetClassInfo()));
+}
+
+#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT)
void wxObject::Dump(ostream& str)
{
if (GetClassInfo() && GetClassInfo()->GetClassName())
#undef new
#endif
-void *wxObject::operator new (size_t size, char * fileName, int lineNum)
+void *wxObject::operator new (size_t size, wxChar * fileName, int lineNum)
{
return wxDebugAlloc(size, fileName, lineNum, TRUE);
}
// Cause problems for VC++ - crashes
#if !defined(__VISUALC__) && wxUSE_ARRAY_MEMORY_OPERATORS
-void * wxObject::operator new[] (size_t size, char * fileName, int lineNum)
+void * wxObject::operator new[] (size_t size, wxChar * fileName, int lineNum)
{
return wxDebugAlloc(size, fileName, lineNum, TRUE, TRUE);
}
* Class info: provides run-time class type information.
*/
-wxClassInfo::wxClassInfo(char *cName, char *baseName1, char *baseName2, int sz, wxObjectConstructorFn constr)
+wxClassInfo::wxClassInfo(wxChar *cName, wxChar *baseName1, wxChar *baseName2, int sz, wxObjectConstructorFn constr)
{
m_className = cName;
m_baseClassName1 = baseName1;
return (wxObject *) NULL;
}
-wxClassInfo *wxClassInfo::FindClass(char *c)
+wxClassInfo *wxClassInfo::FindClass(wxChar *c)
{
wxClassInfo *p = sm_first;
while (p)
{
- if (p && p->GetClassName() && strcmp(p->GetClassName(), c) == 0)
+ if (p && p->GetClassName() && wxStrcmp(p->GetClassName(), c) == 0)
return p;
p = p->m_next;
}
wxClassInfo::sm_classTable = NULL;
}
-wxObject *wxCreateDynamicObject(const char *name)
+wxObject *wxCreateDynamicObject(const wxChar *name)
{
if (wxClassInfo::sm_classTable)
{
wxClassInfo *info = wxClassInfo::sm_first;
while (info)
{
- if (info->m_className && strcmp(info->m_className, name) == 0)
+ if (info->m_className && wxStrcmp(info->m_className, name) == 0)
return info->CreateObject();
info = info->m_next;
}