X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbae49eedf664c3492d72fc05cb6b869b13c046b..66c571291d40958b745098c88abbee0efb24c622:/src/common/object.cpp diff --git a/src/common/object.cpp b/src/common/object.cpp index 8dad5efc0f..b66a33ab71 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -22,7 +22,8 @@ #endif #ifndef WX_PRECOMP -#include "wx/hash.h" + #include "wx/hash.h" + #include "wx/object.h" #endif #include @@ -50,9 +51,28 @@ #pragma optimize("", off) #endif +#if wxUSE_EXTENDED_RTTI +const wxClassInfo* wxObject::sm_classParentswxObject[] = { NULL } ; + wxObject* wxVariantToObjectConverterwxObject ( wxxVariant &data ) +{ return data.Get() ; } + wxObject* wxVariantOfPtrToObjectConverterwxObject ( wxxVariant &data ) +{ return &data.Get() ; } + wxxVariant wxObjectToVariantConverterwxObject ( wxObject *data ) + { return wxxVariant( dynamic_cast (data) ) ; } + wxClassInfo wxObject::sm_classwxObject(sm_classParentswxObject , wxT("") , wxT("wxObject"), + (int) sizeof(wxObject), \ + (wxObjectConstructorFn) 0 , + (wxPropertyInfo*) NULL,(wxHandlerInfo*) NULL,0 , 0 , + 0 , wxVariantOfPtrToObjectConverterwxObject , wxVariantToObjectConverterwxObject , wxObjectToVariantConverterwxObject); + template<> void wxStringReadValue(const wxString & , wxObject * & ){assert(0) ;} + template<> void wxStringWriteValue(wxString & , wxObject* const & ){assert(0) ;} + template<> const wxTypeInfo* wxGetTypeInfo( wxObject ** ) + { static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &wxObject::sm_classwxObject) ; return &s_typeInfo ; } +#else wxClassInfo wxObject::sm_classwxObject( wxT("wxObject"), 0, 0, (int) sizeof(wxObject), (wxObjectConstructorFn) 0 ); +#endif // restore optimizations #if defined __VISUALC__ && __VISUALC__ >= 1300 @@ -170,6 +190,9 @@ wxClassInfo::~wxClassInfo() info = info->m_next; } } +#if wxUSE_EXTENDED_RTTI + Unregister( m_className ) ; +#endif } wxClassInfo *wxClassInfo::FindClass(const wxChar *className) @@ -243,6 +266,7 @@ void wxClassInfo::InitializeClasses() } } +#if wxUSE_EXTENDED_RTTI == 0 // Set base pointers for each wxClassInfo for(info = sm_first; info; info = info->m_next) @@ -250,6 +274,7 @@ void wxClassInfo::InitializeClasses() info->m_baseInfo1 = GetBaseByName(info->GetBaseClassName1()); info->m_baseInfo2 = GetBaseByName(info->GetBaseClassName2()); } +#endif } void wxClassInfo::CleanUpClasses() @@ -258,7 +283,6 @@ void wxClassInfo::CleanUpClasses() wxClassInfo::sm_classTable = NULL; } - wxObject *wxCreateDynamicObject(const wxChar *name) { #if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT