X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/afc89ff455aeff7b156273726e62c3c90f197687..bcf7614cf3a2329e484fd8f437b3a8b521f2b94b:/include/wx/xti.h?ds=sidebyside diff --git a/include/wx/xti.h b/include/wx/xti.h index f603574c32..25d18e1ace 100644 --- a/include/wx/xti.h +++ b/include/wx/xti.h @@ -80,13 +80,14 @@ #define EMPTY_MACROVALUE /**/ -class WXDLLIMPEXP_BASE wxObject; -class WXDLLIMPEXP_BASE wxClassInfo; -class WXDLLIMPEXP_BASE wxDynamicClassInfo; -class WXDLLIMPEXP_BASE wxHashTable; -class WXDLLIMPEXP_BASE wxObjectRefData; -class WXDLLIMPEXP_BASE wxEvent; -class WXDLLIMPEXP_BASE wxEvtHandler; +class WXDLLIMPEXP_FWD_BASE wxObject; +class WXDLLIMPEXP_FWD_BASE wxClassInfo; +class WXDLLIMPEXP_FWD_BASE wxDynamicClassInfo; +class WXDLLIMPEXP_FWD_BASE wxHashTable; +class WXDLLIMPEXP_FWD_BASE wxHashTable_Node; +class WXDLLIMPEXP_FWD_BASE wxObjectRefData; +class WXDLLIMPEXP_FWD_BASE wxEvent; +class WXDLLIMPEXP_FWD_BASE wxEvtHandler; typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); @@ -367,8 +368,8 @@ enum wxTypeKind wxT_LAST_TYPE_KIND = wxT_DELEGATE // sentinel for bad data, asserts, debugging }; -class WXDLLIMPEXP_BASE wxxVariant ; -class WXDLLIMPEXP_BASE wxTypeInfo ; +class WXDLLIMPEXP_FWD_BASE wxxVariant ; +class WXDLLIMPEXP_FWD_BASE wxTypeInfo ; WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxTypeInfo* , wxTypeInfoMap , class WXDLLIMPEXP_BASE ) ; @@ -930,7 +931,7 @@ enum { class WXDLLIMPEXP_BASE wxPropertyInfo { - friend class WXDLLIMPEXP_BASE wxDynamicClassInfo ; + friend class WXDLLIMPEXP_FWD_BASE wxDynamicClassInfo ; public : wxPropertyInfo(wxPropertyInfo* &iter, wxClassInfo* itsClass, @@ -1204,7 +1205,7 @@ public: \ class WXDLLIMPEXP_BASE wxHandlerInfo { - friend class WXDLLIMPEXP_BASE wxDynamicClassInfo ; + friend class WXDLLIMPEXP_FWD_BASE wxDynamicClassInfo ; public : wxHandlerInfo(wxHandlerInfo* &iter, wxClassInfo* itsClass, @@ -1592,15 +1593,16 @@ typedef wxObject *(*wxObjectConstructorFn)(void); typedef wxObject* (*wxVariantToObjectConverter)( wxxVariant &data ) ; typedef wxxVariant (*wxObjectToVariantConverter)( wxObject* ) ; -class WXDLLIMPEXP_BASE wxWriter; -class WXDLLIMPEXP_BASE wxPersister; +class WXDLLIMPEXP_FWD_BASE wxWriter; +class WXDLLIMPEXP_FWD_BASE wxPersister; typedef bool (*wxObjectStreamingCallback) ( const wxObject *, wxWriter * , wxPersister * , wxxVariantArray & ) ; class WXDLLIMPEXP_BASE wxClassInfo { - friend class WXDLLIMPEXP_BASE wxPropertyInfo ; - friend class WXDLLIMPEXP_BASE wxHandlerInfo ; + friend class WXDLLIMPEXP_FWD_BASE wxPropertyInfo ; + friend class WXDLLIMPEXP_FWD_BASE wxHandlerInfo ; + friend wxObject *wxCreateDynamicObject(const wxString& name); public: wxClassInfo(const wxClassInfo **_Parents, const wxChar *_UnitName, @@ -1697,7 +1699,7 @@ public: wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; } static const wxClassInfo *GetFirst() { return sm_first; } const wxClassInfo *GetNext() const { return m_next; } - static wxClassInfo *FindClass(const wxChar *className); + static wxClassInfo *FindClass(const wxString& className); // Climb upwards through inheritance hierarchy. // Dual inheritance is catered for. @@ -1718,6 +1720,8 @@ public: return false ; } + DECLARE_CLASS_INFO_ITERATORS() + // if there is a callback registered with that class it will be called // before this object will be written to disk, it can veto streaming out // this object by returning false, if this class has not registered a @@ -1788,7 +1792,7 @@ public: // puts all the properties of this class and its superclasses in the map, as long as there is not yet // an entry with the same name (overriding mechanism) void GetProperties( wxPropertyInfoMap &map ) const ; -public: +private: const wxChar *m_className; int m_objectSize; wxObjectConstructorFn m_objectConstructor; @@ -1799,8 +1803,6 @@ public: static wxClassInfo *sm_first; wxClassInfo *m_next; - // FIXME: this should be private (currently used directly by way too - // many clients) static wxHashTable *sm_classTable; protected : @@ -1828,7 +1830,7 @@ protected: }; -WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name); +WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name); // ---------------------------------------------------------------------------- // wxDynamicObject @@ -1838,7 +1840,7 @@ WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name); class WXDLLIMPEXP_BASE wxDynamicClassInfo : public wxClassInfo { - friend class WXDLLIMPEXP_BASE wxDynamicObject ; + friend class WXDLLIMPEXP_FWD_BASE wxDynamicObject ; public : wxDynamicClassInfo( const wxChar *_UnitName, const wxChar *_ClassName , const wxClassInfo* superClass ) ; virtual ~wxDynamicClassInfo() ; @@ -2015,27 +2017,27 @@ private : // Multiple inheritance with two base classes -#define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit) \ +#define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit, callback) \ wxObject* wxConstructorFor##name() \ { return new name; } \ const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo ,&basename2::ms_classInfo , NULL } ; \ - 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(unit) , wxT(#name), \ (int) sizeof(name), \ (wxObjectConstructorFn) wxConstructorFor##name , \ name::GetPropertiesStatic(),name::GetHandlersStatic(),name::ms_constructor , name::ms_constructorProperties , \ - name::ms_constructorPropertiesCount , wxVariantToObjectConverter##name , NULL, wxObjectToVariantConverter##name); \ + name::ms_constructorPropertiesCount , wxVariantOfPtrToObjectConverter##name , NULL , wxObjectToVariantConverter##name , callback); #define IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2) \ - _IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2 , "") \ + _IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2 , "", NULL) \ _TYPEINFO_CLASSES(name, NULL , NULL) \ wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL ; } \ wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL ; } \ wxCONSTRUCTOR_DUMMY( name ) #define IMPLEMENT_DYNAMIC_CLASS2_XTI( name , basename , basename2, unit) \ - _IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2 , unit) \ + _IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2 , unit, NULL) \ _TYPEINFO_CLASSES(name, NULL , NULL)