X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bddd7a8d8953cf4c09e56c13e1bfcc594ba0267e..ed0769cdabaff7365d3068a5b73e527b4ca8ce14:/include/wx/object.h diff --git a/include/wx/object.h b/include/wx/object.h index 92f759609d..bbc627fe60 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -28,6 +28,14 @@ class WXDLLIMPEXP_BASE wxObject; #if wxUSE_DYNAMIC_CLASSES +#ifndef wxUSE_EXTENDED_RTTI +#define wxUSE_EXTENDED_RTTI 0 +#endif + +#if wxUSE_EXTENDED_RTTI +#include "wx/xti.h" +#else + // ---------------------------------------------------------------------------- // conditional compilation // ---------------------------------------------------------------------------- @@ -104,6 +112,7 @@ public: static void CleanUpClasses(); + public: const wxChar *m_className; const wxChar *m_baseClassName1; @@ -145,6 +154,14 @@ WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name); virtual wxClassInfo *GetClassInfo() const \ { return &name::sm_class##name; } +#define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \ + DECLARE_NO_ASSIGN_CLASS(name) \ + DECLARE_DYNAMIC_CLASS(name) + +#define DECLARE_DYNAMIC_CLASS_NO_COPY(name) \ + DECLARE_NO_COPY_CLASS(name) \ + DECLARE_DYNAMIC_CLASS(name) + #define DECLARE_ABSTRACT_CLASS(name) DECLARE_DYNAMIC_CLASS(name) #define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name) @@ -190,6 +207,9 @@ WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name); #define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS #define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2 +#endif // !wxUSE_EXTENDED_RTTI + + // ----------------------------------- // for pluggable classes // ----------------------------------- @@ -257,7 +277,6 @@ name##PluginSentinel m_pluginsentinel; #define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \ IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) - #define CLASSINFO(name) (&name::sm_class##name) #else // !wxUSE_DYNAMIC_CLASSES @@ -290,7 +309,6 @@ name##PluginSentinel m_pluginsentinel; #endif // wxUSE_DYNAMIC_CLASSES - #define wxIS_KIND_OF(obj, className) obj->IsKindOf(&className::sm_class##className) // Just seems a bit nicer-looking (pretend it's not a macro) @@ -398,16 +416,16 @@ class WXDLLIMPEXP_BASE wxObject private: void InitFrom(const wxObject& other); - + public: wxObject() { m_refData = NULL; } virtual ~wxObject() { UnRef(); } - + wxObject(const wxObject& other) { InitFrom(other); } - + wxObject& operator=(const wxObject& other) { if ( this != &other )