X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1296186133b677fdbaddfc1551b2b2c7321dac39..f87584b55268e165f15de6f8ae34c99df72e5896:/include/wx/xti.h diff --git a/include/wx/xti.h b/include/wx/xti.h index 8137aa64a8..ca4db5f41c 100644 --- a/include/wx/xti.h +++ b/include/wx/xti.h @@ -13,10 +13,6 @@ #ifndef _WX_XTIH__ #define _WX_XTIH__ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "xti.h" -#endif - // We want to support properties, event sources and events sinks through // explicit declarations, using templates and specialization to make the // effort as painless as possible. @@ -90,6 +86,7 @@ class WXDLLIMPEXP_BASE wxDynamicClassInfo; class WXDLLIMPEXP_BASE wxHashTable; class WXDLLIMPEXP_BASE wxObjectRefData; class WXDLLIMPEXP_BASE wxEvent; +class WXDLLIMPEXP_BASE wxEvtHandler; typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); @@ -243,7 +240,7 @@ void wxSetToString( wxString &s , const wxBitset &data ) if ( data.test( value ) ) { // this could also be done by the templated calls - if ( !s.IsEmpty() ) + if ( !s.empty() ) s +=wxT("|") ; s += edata->GetEnumMemberNameByIndex(i) ; } @@ -303,7 +300,7 @@ void wxFlagsToString( wxString &s , const e& data ) // clear the flags we just set dataValue &= ~value ; // this could also be done by the templated calls - if ( !s.IsEmpty() ) + if ( !s.empty() ) s +=wxT("|") ; s += edata->GetEnumMemberNameByIndex(i) ; } @@ -667,7 +664,8 @@ public : wxxVariant& operator=(const wxxVariant &d) { - m_data = d.m_data->Clone() ; + delete m_data; + m_data = d.m_data ? d.m_data->Clone() : NULL ; m_name = d.m_name ; return *this ; } @@ -691,7 +689,7 @@ private : wxString m_name ; } ; -#include +#include "wx/dynarray.h" WX_DECLARE_OBJARRAY_WITH_DECL(wxxVariant, wxxVariantArray, class WXDLLIMPEXP_BASE); @@ -877,7 +875,8 @@ public : wxGenericPropertyAccessor( const wxString &propName ) ; ~wxGenericPropertyAccessor() ; - void RenameProperty( const wxString &oldName , const wxString &newName ) + void RenameProperty( const wxString& WXUNUSED_UNLESS_DEBUG(oldName), + const wxString& newName ) { wxASSERT( oldName == m_propertyName ) ; m_propertyName = newName ; } @@ -1662,6 +1661,7 @@ public: const wxChar *GetIncludeName() const { return m_unitName ; } const wxClassInfo **GetParents() const { return m_parents; } int GetSize() const { return m_objectSize; } + bool IsDynamic() const { return (NULL != m_objectConstructor); } wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; } static const wxClassInfo *GetFirst() { return sm_first; } @@ -1973,7 +1973,7 @@ private : #define IMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_NO_BASE_XTI( name , unit ) \ const wxClassInfo* name::ms_classParents[] = { NULL } ; \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxT("") , wxT(#name), \ + wxClassInfo name::ms_classInfo(name::ms_classParents , wxEmptyString , wxT(#name), \ (int) sizeof(name), \ (wxObjectConstructorFn) 0 , \ name::GetPropertiesStatic(),name::GetHandlersStatic(),0 , 0 , \ @@ -1984,7 +1984,7 @@ private : #define IMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_XTI( name , basename, unit ) \ const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo ,NULL } ; \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxT("") , wxT(#name), \ + wxClassInfo name::ms_classInfo(name::ms_classParents , wxEmptyString , wxT(#name), \ (int) sizeof(name), \ (wxObjectConstructorFn) 0 , \ name::GetPropertiesStatic(),name::GetHandlersStatic(),0 , 0 , \ @@ -2029,7 +2029,7 @@ private : wxObject* wxVariantToObjectConverter##name ( wxxVariant &data ) { return data.wxTEMPLATED_MEMBER_CALL(Get , name*) ; } \ wxObject* wxVariantOfPtrToObjectConverter##name ( wxxVariant &data ) { return data.wxTEMPLATED_MEMBER_CALL(Get , name*) ; } \ wxxVariant wxObjectToVariantConverter##name ( wxObject *data ) { return wxxVariant( dynamic_cast (data) ) ; } \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxT("") , wxT(#name), \ + wxClassInfo name::ms_classInfo(name::ms_classParents , wxEmptyString , wxT(#name), \ (int) sizeof(name), \ (wxObjectConstructorFn) 0 , \ name::GetPropertiesStatic(),name::GetHandlersStatic(),0 , 0 , \ @@ -2077,4 +2077,4 @@ template void wxArrayCollectionToVariantArray( const coll } -#endif +#endif // _WX_XTIH__