]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/xtiprop.h
adding new files for xti merge
[wxWidgets.git] / include / wx / xtiprop.h
diff --git a/include/wx/xtiprop.h b/include/wx/xtiprop.h
new file mode 100644 (file)
index 0000000..b2f9ea0
--- /dev/null
@@ -0,0 +1,597 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        wx/xtiprop.h\r
+// Purpose:     XTI properties\r
+// Author:      Stefan Csomor\r
+// Modified by: Francesco Montorsi\r
+// Created:     27/07/03\r
+// RCS-ID:      $Id: xti.h 47299 2007-07-10 15:58:27Z FM $\r
+// Copyright:   (c) 1997 Julian Smart\r
+//              (c) 2003 Stefan Csomor\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _XTIPROP_H_\r
+#define _XTIPROP_H_\r
+\r
+#include "wx/defs.h"\r
+\r
+#if wxUSE_EXTENDED_RTTI\r
+\r
+#include "wx/string.h"\r
+#include "wx/variant.h"\r
+#include "wx/intl.h"\r
+#include "wx/log.h"\r
+#include "wx/xtitypes.h"\r
+\r
+class WXDLLIMPEXP_BASE wxObject;\r
+class WXDLLIMPEXP_BASE wxClassInfo;\r
+class WXDLLIMPEXP_BASE wxDynamicClassInfo;\r
+class WXDLLIMPEXP_BASE wxHashTable;\r
+class WXDLLIMPEXP_BASE wxHashTable_Node;\r
+class WXDLLIMPEXP_BASE wxObjectRefData;\r
+class WXDLLIMPEXP_BASE wxEvent;\r
+class WXDLLIMPEXP_BASE wxEvtHandler;\r
+\r
+// ----------------------------------------------------------------------------\r
+// Property Accessors\r
+//\r
+// wxPropertySetter/Getter/CollectionGetter/CollectionAdder are all property\r
+// accessors which are managed by wxPropertyAccessor class which in turn is\r
+// handled by wxPropertyInfo.\r
+// ----------------------------------------------------------------------------\r
+\r
+class WXDLLIMPEXP_BASE wxPropertySetter\r
+{\r
+public:\r
+    wxPropertySetter( const wxString name ) { m_name = name; }\r
+    virtual ~wxPropertySetter() {}\r
+\r
+    virtual void Set( wxObject *object, const wxVariantBase &variantValue ) const = 0;\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+private:\r
+    wxString m_name;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyGetter\r
+{\r
+public:\r
+    wxPropertyGetter( const wxString name ) { m_name = name; }\r
+    virtual ~wxPropertyGetter() {}\r
+\r
+    virtual void Get( const wxObject *object, wxVariantBase& result) const = 0;\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+private:\r
+    wxString m_name;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyCollectionGetter\r
+{\r
+public:\r
+    wxPropertyCollectionGetter( const wxString name ) { m_name = name; }\r
+    virtual ~wxPropertyCollectionGetter() {}\r
+\r
+    virtual void Get( const wxObject *object, wxVariantBaseArray& result) const = 0;\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+private:\r
+    wxString m_name;\r
+};\r
+\r
+template<typename coll_t> void WXDLLIMPEXP_BASE \\r
+    wxCollectionToVariantArray( const coll_t& coll, wxVariantBaseArray& result );\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyCollectionAdder\r
+{\r
+public:\r
+    wxPropertyCollectionAdder( const wxString name ) { m_name = name; }\r
+    virtual ~wxPropertyCollectionAdder() {}\r
+\r
+    virtual void Add( wxObject *object, const wxVariantBase &variantValue ) const= 0;\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+private:\r
+    wxString m_name;\r
+};\r
+\r
+#define wxPROPERTY_SETTER( property, Klass, valueType, setterMethod )            \\r
+class wxPropertySetter##property : public wxPropertySetter                              \\r
+{                                                                       \\r
+public:                                                                 \\r
+    wxINFUNC_CLASS_TYPE_FIX(Klass)                                      \\r
+    wxPropertySetter##property() : wxPropertySetter( wxT(#setterMethod) ) {}            \\r
+    virtual ~wxPropertySetter##property() {}                                    \\r
+                                                                        \\r
+    void Set( wxObject *object, const wxVariantBase &variantValue ) const  \\r
+    {                                                                   \\r
+        Klass *obj = dynamic_cast<Klass*>(object);                      \\r
+        if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \\r
+            obj->setterMethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType));   \\r
+        else                                                                            \\r
+            obj->setterMethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType*)); \\r
+    }                                                                                   \\r
+};\r
+\r
+#define wxPROPERTY_GETTER( property, Klass, valueType, gettermethod )           \\r
+class wxPropertyGetter##property : public wxPropertyGetter                              \\r
+{                                                                       \\r
+public:                                                                 \\r
+    wxINFUNC_CLASS_TYPE_FIX(Klass)                                      \\r
+    wxPropertyGetter##property() : wxPropertyGetter( wxT(#gettermethod) ) {}            \\r
+    virtual ~wxPropertyGetter##property() {}                                    \\r
+                                                                        \\r
+    void Get( const wxObject *object, wxVariantBase &result) const        \\r
+    {                                                                   \\r
+        const Klass *obj = dynamic_cast<const Klass*>(object);          \\r
+        result = wxVariantBase( obj->gettermethod() );                     \\r
+    }                                                                   \\r
+};\r
+\r
+#define wxPROPERTY_COLLECTION_ADDER( property, Klass, valueType, addermethod )             \\r
+class wxPropertyCollectionAdder##property : public wxPropertyCollectionAdder                                \\r
+{                                                                       \\r
+public:                                                                 \\r
+    wxINFUNC_CLASS_TYPE_FIX(Klass)                                      \\r
+    wxPropertyCollectionAdder##property() : wxPropertyCollectionAdder( wxT(#addermethod) ) {}               \\r
+    virtual ~wxPropertyCollectionAdder##property() {}                                     \\r
+                                                                        \\r
+    void Add( wxObject *object, const wxVariantBase &variantValue ) const  \\r
+    {                                                                   \\r
+        Klass *obj = dynamic_cast<Klass*>(object);                      \\r
+        if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \\r
+            obj->addermethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType));    \\r
+        else                                                                            \\r
+            obj->addermethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType*));  \\r
+    }                                                                                   \\r
+};\r
+\r
+#define wxPROPERTY_COLLECTION_GETTER( property, Klass, valueType, gettermethod )    \\r
+class wxPropertyCollectionGetter##property : public wxPropertyCollectionGetter              \\r
+{                                                                           \\r
+public:                                                                     \\r
+    wxINFUNC_CLASS_TYPE_FIX(Klass)                                          \\r
+    wxPropertyCollectionGetter##property() : wxPropertyCollectionGetter( wxT(#gettermethod) ) {} \\r
+    virtual ~wxPropertyCollectionGetter##property() {}                              \\r
+                                                                            \\r
+    void Get( const wxObject *object, wxVariantBaseArray &result) const       \\r
+    {                                                                       \\r
+        const Klass *obj = dynamic_cast<const Klass*>(object);              \\r
+        wxCollectionToVariantArray( obj->gettermethod(), result );         \\r
+    }                                                                       \\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyAccessor\r
+{\r
+public:\r
+    wxPropertyAccessor( wxPropertySetter *setter, wxPropertyGetter *getter, \r
+                        wxPropertyCollectionAdder *adder, wxPropertyCollectionGetter *collectionGetter )\r
+    { m_setter = setter; m_getter = getter; m_adder = adder; \r
+      m_collectionGetter = collectionGetter; }\r
+\r
+    virtual ~wxPropertyAccessor() {}\r
+\r
+    // Setting a simple property (non-collection)\r
+    virtual void SetProperty(wxObject *object, const wxVariantBase &value) const\r
+    { \r
+        if ( m_setter ) \r
+            m_setter->Set( object, value ); \r
+        else \r
+            wxLogError( _("SetProperty called w/o valid setter") ); \r
+    }\r
+\r
+    // Getting a simple property (non-collection)\r
+    virtual void GetProperty(const wxObject *object, wxVariantBase &result) const\r
+    { \r
+        if ( m_getter ) \r
+            m_getter->Get( object, result ); \r
+        else \r
+            wxLogError( _("GetProperty called w/o valid getter") ); \r
+    }\r
+\r
+    // Adding an element to a collection property\r
+    virtual void AddToPropertyCollection(wxObject *object, const wxVariantBase &value) const\r
+    { \r
+        if ( m_adder ) \r
+            m_adder->Add( object, value ); \r
+        else \r
+            wxLogError( _("AddToPropertyCollection called w/o valid adder") ); \r
+    }\r
+\r
+    // Getting a collection property\r
+    virtual void GetPropertyCollection( const wxObject *obj, wxVariantBaseArray &result) const\r
+    { \r
+        if ( m_collectionGetter ) \r
+            m_collectionGetter->Get( obj, result); \r
+        else \r
+            wxLogError( _("GetPropertyCollection called w/o valid collection getter") ); \r
+    }\r
+\r
+    virtual bool HasSetter() const { return m_setter != NULL; }\r
+    virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL; }\r
+    virtual bool HasGetter() const { return m_getter != NULL; }\r
+    virtual bool HasAdder() const { return m_adder != NULL; }\r
+\r
+    virtual const wxString& GetCollectionGetterName() const\r
+        { return m_collectionGetter->GetName(); }\r
+    virtual const wxString&  GetGetterName() const\r
+        { return m_getter->GetName(); }\r
+    virtual const wxString& GetSetterName() const\r
+        { return m_setter->GetName(); }\r
+    virtual const wxString& GetAdderName() const\r
+        { return m_adder->GetName(); }\r
+\r
+protected:\r
+    wxPropertySetter *m_setter;\r
+    wxPropertyCollectionAdder *m_adder;\r
+    wxPropertyGetter *m_getter;\r
+    wxPropertyCollectionGetter* m_collectionGetter;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxGenericPropertyAccessor : public wxPropertyAccessor\r
+{\r
+public:\r
+    wxGenericPropertyAccessor( const wxString &propName );\r
+    virtual ~wxGenericPropertyAccessor();\r
+\r
+    void RenameProperty( const wxString& WXUNUSED_UNLESS_DEBUG(oldName),\r
+        const wxString& newName )\r
+    {\r
+        wxASSERT( oldName == m_propertyName ); m_propertyName = newName;\r
+    }\r
+\r
+    virtual bool HasSetter() const { return true; }\r
+    virtual bool HasGetter() const { return true; }\r
+    virtual bool HasAdder() const { return false; }\r
+    virtual bool HasCollectionGetter() const { return false; }\r
+\r
+    virtual const wxString&  GetGetterName() const\r
+        { return m_getterName; }\r
+    virtual const wxString& GetSetterName() const\r
+        { return m_setterName; }\r
+\r
+    virtual void SetProperty(wxObject *object, const wxVariantBase &value) const;\r
+    virtual void GetProperty(const wxObject *object, wxVariantBase &value) const;\r
+\r
+    // Adding an element to a collection property\r
+    virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), \r
+                                         const wxVariantBase &WXUNUSED(value)) const\r
+    { \r
+        wxLogError( _("AddToPropertyCollection called on a generic accessor") ); \r
+    }\r
+\r
+    // Getting a collection property\r
+    virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), \r
+                                        wxVariantBaseArray &WXUNUSED(result)) const\r
+    { \r
+        wxLogError ( _("GetPropertyCollection called on a generic accessor") ); \r
+    }\r
+\r
+private:\r
+    struct wxGenericPropertyAccessorInternal;\r
+    wxGenericPropertyAccessorInternal* m_data;\r
+    wxString m_propertyName;\r
+    wxString m_setterName;\r
+    wxString m_getterName;\r
+};\r
+\r
+typedef long wxPropertyInfoFlags;\r
+enum \r
+{\r
+    // will be removed in future releases\r
+    wxPROP_DEPRECATED       = 0x00000001,\r
+\r
+    // object graph property, will be streamed with priority (after constructor properties)\r
+    wxPROP_OBJECT_GRAPH     = 0x00000002,\r
+\r
+    // this will only be streamed out and in as enum/set, the internal representation \r
+    // is still a long\r
+    wxPROP_ENUM_STORE_LONG  = 0x00000004,\r
+\r
+    // don't stream out this property, needed eg to avoid streaming out children \r
+    // that are always created by their parents\r
+    wxPROP_DONT_STREAM      = 0x00000008\r
+};\r
+\r
+\r
+// ----------------------------------------------------------------------------\r
+// Property Support\r
+//\r
+// wxPropertyInfo is used to inquire of the property by name.  It doesn't\r
+// provide access to the property, only information about it.  If you\r
+// want access, look at wxPropertyAccessor.\r
+// ----------------------------------------------------------------------------\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyInfo\r
+{\r
+    friend class WXDLLIMPEXP_BASE wxDynamicClassInfo;\r
+\r
+public:\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+                   wxClassInfo* itsClass,\r
+                   const wxString& name,\r
+                   const wxString& typeName,\r
+                   wxPropertyAccessor *accessor,\r
+                   wxVariantBase dv,\r
+                   wxPropertyInfoFlags flags = 0,\r
+                   const wxString& helpString = wxEmptyString,\r
+                   const wxString& groupString = wxEmptyString) :\r
+                   m_itsClass(itsClass),\r
+           m_name(name),\r
+           m_typeInfo(NULL),\r
+           m_typeName(typeName),\r
+           m_collectionElementTypeInfo(NULL),\r
+           m_accessor(accessor),\r
+           m_defaultValue(dv),\r
+           m_flags(flags),\r
+           m_helpString(helpString),\r
+           m_groupString(groupString)\r
+       {\r
+           Insert(iter);\r
+       }\r
+\r
+#if wxUSE_UNICODE\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+                   wxClassInfo* itsClass,\r
+                   const wxString& name,\r
+                   const char* typeName,\r
+                   wxPropertyAccessor *accessor,\r
+                   wxVariantBase dv,\r
+                   wxPropertyInfoFlags flags = 0,\r
+                   const wxString& helpString = wxEmptyString,\r
+                   const wxString& groupString = wxEmptyString) :\r
+                   m_itsClass(itsClass),\r
+           m_name(name),\r
+           m_typeInfo(NULL),\r
+           m_typeName(wxString::FromAscii(typeName)),\r
+           m_collectionElementTypeInfo(NULL),\r
+           m_accessor(accessor),\r
+           m_defaultValue(dv),\r
+           m_flags(flags),\r
+           m_helpString(helpString),\r
+           m_groupString(groupString)\r
+       {\r
+           Insert(iter);\r
+       }\r
+#endif\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+                   wxClassInfo* itsClass,\r
+                   const wxString& name,\r
+                   wxEventSourceTypeInfo* type,\r
+                   wxPropertyAccessor *accessor,\r
+                   wxVariantBase dv,\r
+                   wxPropertyInfoFlags flags = 0,\r
+                   const wxString& helpString = wxEmptyString,\r
+                   const wxString& groupString = wxEmptyString) :\r
+           m_itsClass(itsClass),\r
+           m_name(name),\r
+           m_typeInfo(type),\r
+           m_collectionElementTypeInfo(NULL),\r
+           m_accessor(accessor),\r
+           m_defaultValue(dv),\r
+           m_flags(flags),\r
+           m_helpString(helpString),\r
+           m_groupString(groupString)\r
+       {\r
+           Insert(iter);\r
+       }\r
+\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+                    wxClassInfo* itsClass, const wxString& name,\r
+                    const wxString& collectionTypeName,\r
+                    const wxString& elementTypeName,\r
+                    wxPropertyAccessor *accessor,\r
+                    wxPropertyInfoFlags flags = 0,\r
+                    const wxString& helpString = wxEmptyString,\r
+                    const wxString& groupString = wxEmptyString) :\r
+        m_itsClass(itsClass),\r
+        m_name(name),\r
+        m_typeInfo(NULL),\r
+        m_typeName(collectionTypeName),\r
+        m_collectionElementTypeInfo(NULL),\r
+        m_collectionElementTypeName(elementTypeName),\r
+        m_accessor(accessor),\r
+        m_flags(flags),\r
+        m_helpString(helpString),\r
+        m_groupString(groupString)\r
+    {\r
+        Insert(iter);\r
+    }\r
+\r
+#if wxUSE_UNICODE\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+            wxClassInfo* itsClass, const wxString& name,\r
+            const char* collectionTypeName,\r
+            const char* elementTypeName,\r
+            wxPropertyAccessor *accessor,\r
+            wxPropertyInfoFlags flags = 0,\r
+            const wxString& helpString = wxEmptyString,\r
+            const wxString& groupString = wxEmptyString) :\r
+        m_itsClass(itsClass),\r
+        m_name(name),\r
+        m_typeInfo(NULL),\r
+        m_typeName(wxString::FromAscii(collectionTypeName)),\r
+        m_collectionElementTypeInfo(NULL),\r
+        m_collectionElementTypeName(wxString::FromAscii(elementTypeName)),\r
+        m_accessor(accessor),\r
+        m_flags(flags),\r
+        m_helpString(helpString),\r
+        m_groupString(groupString)\r
+    {\r
+        Insert(iter);\r
+    }\r
+#endif\r
+    ~wxPropertyInfo()\r
+        { Remove(); }\r
+\r
+    // return the class this property is declared in\r
+    const wxClassInfo*  GetDeclaringClass() const { return m_itsClass; }\r
+\r
+    // return the name of this property\r
+    const wxString&     GetName() const { return m_name; }\r
+\r
+    // returns the flags of this property\r
+    wxPropertyInfoFlags GetFlags() const { return m_flags; }\r
+\r
+    // returns the short help string of this property\r
+    const wxString&     GetHelpString() const { return m_helpString; }\r
+\r
+    // returns the group string of this property\r
+    const wxString&     GetGroupString() const { return m_groupString; }\r
+\r
+    // return the element type info of this property (for collections, otherwise NULL)\r
+    const wxTypeInfo *  GetCollectionElementTypeInfo() const\r
+    {\r
+        if ( m_collectionElementTypeInfo == NULL )\r
+            m_collectionElementTypeInfo = wxTypeInfo::FindType(m_collectionElementTypeName);\r
+        return m_collectionElementTypeInfo;\r
+    }\r
+\r
+    // return the type info of this property\r
+    const wxTypeInfo *  GetTypeInfo() const\r
+    {\r
+        if ( m_typeInfo == NULL )\r
+            m_typeInfo = wxTypeInfo::FindType(m_typeName);\r
+        return m_typeInfo;\r
+    }\r
+\r
+    // return the accessor for this property\r
+    wxPropertyAccessor* GetAccessor() const { return m_accessor; }\r
+\r
+    // returns NULL if this is the last property of this class\r
+    wxPropertyInfo*     GetNext() const { return m_next; }\r
+\r
+    // returns the default value of this property, its kind may be wxT_VOID if it is not valid\r
+    wxVariantBase          GetDefaultValue() const { return m_defaultValue; }\r
+\r
+private:\r
+\r
+    // inserts this property at the end of the linked chain which begins\r
+    // with "iter" property.\r
+    void Insert(wxPropertyInfo* &iter);\r
+\r
+    // removes this property from the linked chain of the m_itsClass properties.\r
+    void Remove();\r
+\r
+    wxClassInfo*        m_itsClass;\r
+    wxString            m_name;\r
+    mutable wxTypeInfo* m_typeInfo;\r
+    wxString            m_typeName;\r
+    mutable wxTypeInfo* m_collectionElementTypeInfo;\r
+    wxString            m_collectionElementTypeName;\r
+    wxPropertyAccessor* m_accessor;\r
+    wxVariantBase          m_defaultValue;\r
+    wxPropertyInfoFlags m_flags;\r
+    wxString            m_helpString;\r
+    wxString            m_groupString;\r
+    wxPropertyInfo*     m_next;\r
+\r
+    // FIXME: what's this comment about??\r
+    // string representation of the default value\r
+    // to be assigned by the designer to the property\r
+    // when the component is dropped on the container.\r
+};\r
+\r
+WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo*, wxPropertyInfoMap, \r
+                                      class WXDLLIMPEXP_BASE );\r
+\r
+#define wxBEGIN_PROPERTIES_TABLE(theClass)                      \\r
+    wxPropertyInfo *theClass::GetPropertiesStatic()             \\r
+    {                                                           \\r
+        typedef theClass class_t;                               \\r
+        static wxPropertyInfo* first = NULL;\r
+\r
+#define wxEND_PROPERTIES_TABLE() \\r
+    return first; }\r
+\r
+#define wxHIDE_PROPERTY( pname )                                                      \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(void).name(), NULL, wxVariantBase(), wxPROP_DONT_STREAM, \\r
+            wxEmptyString, wxEmptyString );\r
+\r
+#define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group)    \\r
+    wxPROPERTY_SETTER( pname, class_t, type, setter )                                 \\r
+    static wxPropertySetter##pname _setter##pname;                                    \\r
+    wxPROPERTY_GETTER( pname, class_t, type, getter )                                 \\r
+    static wxPropertyGetter##pname _getter##pname;                                    \\r
+    static wxPropertyAccessor _accessor##pname( &_setter##pname,                      \\r
+                                                &_getter##pname, NULL, NULL );        \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(type).name(), &_accessor##pname,                      \\r
+            wxVariantBase(defaultValue), flags, group, help );\r
+\r
+#define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue,            \\r
+                          pflags, help, group)                                        \\r
+    wxPROPERTY_SETTER( pname, class_t, type, setter )                                 \\r
+    static wxPropertySetter##pname _setter##pname;                                    \\r
+    wxPROPERTY_GETTER( pname, class_t, type, getter )                                 \\r
+    static wxPropertyGetter##pname _getter##pname;                                    \\r
+    static wxPropertyAccessor _accessor##pname( &_setter##pname,                      \\r
+                                                &_getter##pname, NULL, NULL );        \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(flags).name(), &_accessor##pname,                     \\r
+            wxVariantBase(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group );\r
+\r
+#define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group)    \\r
+    wxPROPERTY_GETTER( pname, class_t, type, getter )                                 \\r
+    static wxPropertyGetter##pname _getter##pname;                                    \\r
+    static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL );  \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(type).name(),&_accessor##pname,                       \\r
+            wxVariantBase(defaultValue), flags, help, group );\r
+\r
+#define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue,           \\r
+                                   pflags, help, group)                               \\r
+    wxPROPERTY_GETTER( pname, class_t, type, getter )                                 \\r
+    static wxPropertyGetter##pname _getter##pname;                                    \\r
+    static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL );  \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(flags).name(),&_accessor##pname,                      \\r
+            wxVariantBase(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group );\r
+\r
+#define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter,           \\r
+                               flags, help, group )                                   \\r
+    wxPROPERTY_COLLECTION_ADDER( pname, class_t, addelemtype, adder )                 \\r
+    static wxPropertyCollectionAdder##pname _adder##pname;                            \\r
+    wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter )                  \\r
+    static wxPropertyCollectionGetter##pname _collectionGetter##pname;                \\r
+    static wxPropertyAccessor _accessor##pname( NULL, NULL,&_adder##pname,            \\r
+                                                &_collectionGetter##pname );          \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(),          \\r
+            &_accessor##pname, flags, help, group );\r
+\r
+#define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter,         \\r
+                                        flags, help, group)                           \\r
+    wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter )                  \\r
+    static wxPropertyCollectionGetter##pname _collectionGetter##pname;                \\r
+    static wxPropertyAccessor _accessor##pname( NULL, NULL, NULL,                     \\r
+                                                &_collectionGetter##pname );          \\r
+    static wxPropertyInfo _propertyInfo##pname( first,class_t::GetClassInfoStatic(),  \\r
+        wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(),              \\r
+        &_accessor##pname, flags, help, group  );\r
+\r
+#define wxEVENT_PROPERTY( name, eventType, eventClass )                               \\r
+    static wxEventSourceTypeInfo _typeInfo##name( eventType, CLASSINFO( eventClass ) );  \\r
+    static wxPropertyInfo _propertyInfo##name( first,class_t::GetClassInfoStatic(),   \\r
+        wxT(#name), &_typeInfo##name, NULL, wxVariantBase() );\r
+\r
+#define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass )          \\r
+    static wxEventSourceTypeInfo _typeInfo##name( eventType, lastEventType,              \\r
+                                               CLASSINFO( eventClass ) );             \\r
+    static wxPropertyInfo _propertyInfo##name( first, class_t::GetClassInfoStatic(),  \\r
+        wxT(#name), &_typeInfo##name, NULL, wxVariantBase() );\r
+\r
+// ----------------------------------------------------------------------------\r
+// Implementation Helper for Simple Properties\r
+// ----------------------------------------------------------------------------\r
+\r
+#define wxIMPLEMENT_PROPERTY(name, type)                \\r
+private:                                                \\r
+    type m_##name;                                      \\r
+public:                                                 \\r
+  void  Set##name( type const & p) { m_##name = p; }    \\r
+  type const & Get##name() const  { return m_##name; }\r
+\r
+#endif      // wxUSE_EXTENDED_RTTI\r
+#endif      // _XTIPROP_H_\r