- i->m_next = this ;
- }
- }
-
- wxClassInfo* m_itsClass ;
- wxString m_name ;
- mutable wxTypeInfo* m_typeInfo ;
- wxString m_typeName ;
- mutable wxTypeInfo* m_collectionElementTypeInfo ;
- wxString m_collectionElementTypeName ;
- wxPropertyAccessor* m_accessor ;
- wxxVariant m_defaultValue;
- wxPropertyInfoFlags m_flags ;
- wxString m_helpString ;
- wxString m_groupString ;
- // string representation of the default value
- // to be assigned by the designer to the property
- // when the component is dropped on the container.
- wxPropertyInfo* m_next ;
-};
-
-WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo* , wxPropertyInfoMap , class WXDLLIMPEXP_BASE ) ;
-
-#define wxBEGIN_PROPERTIES_TABLE(theClass) \
- wxPropertyInfo *theClass::GetPropertiesStatic() \
-{ \
- typedef theClass class_t; \
- static wxPropertyInfo* first = NULL ;
-
-#define wxEND_PROPERTIES_TABLE() \
- return first ; }
-
-#define wxHIDE_PROPERTY( pname ) \
- static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(void).name() ,NULL , wxxVariant() , wxPROP_DONT_STREAM , wxEmptyString , wxEmptyString ) ;
-
-#define wxPROPERTY( pname , type , setter , getter , defaultValue , flags , help , group) \
- wxSETTER( pname , class_t , type , setter ) \
- static wxSetter##pname _setter##pname ; \
- wxGETTER( pname , class_t , type , getter ) \
- static wxGetter##pname _getter##pname ; \
- static wxPropertyAccessor _accessor##pname( &_setter##pname , &_getter##pname , NULL , NULL ) ; \
- static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(type).name() ,&_accessor##pname , wxxVariant(defaultValue) , flags , group , help ) ;
-
-#define wxPROPERTY_FLAGS( pname , flags , type , setter , getter ,defaultValue , pflags , help , group) \
- wxSETTER( pname , class_t , type , setter ) \
- static wxSetter##pname _setter##pname ; \
- wxGETTER( pname , class_t , type , getter ) \
- static wxGetter##pname _getter##pname ; \
- static wxPropertyAccessor _accessor##pname( &_setter##pname , &_getter##pname , NULL , NULL ) ; \
- static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(flags).name() ,&_accessor##pname , wxxVariant(defaultValue), wxPROP_ENUM_STORE_LONG | pflags , help , group ) ;
-
-#define wxREADONLY_PROPERTY( pname , type , getter ,defaultValue , flags , help , group) \
- wxGETTER( pname , class_t , type , getter ) \
- static wxGetter##pname _getter##pname ; \
- static wxPropertyAccessor _accessor##pname( NULL , &_getter##pname , NULL , NULL ) ; \
- static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(type).name() ,&_accessor##pname , wxxVariant(defaultValue), flags , help , group ) ;
-
-#define wxREADONLY_PROPERTY_FLAGS( pname , flags , type , getter ,defaultValue , pflags , help , group) \
- wxGETTER( pname , class_t , type , getter ) \
- static wxGetter##pname _getter##pname ; \
- static wxPropertyAccessor _accessor##pname( NULL , &_getter##pname , NULL , NULL ) ; \
- static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(flags).name() ,&_accessor##pname , wxxVariant(defaultValue), wxPROP_ENUM_STORE_LONG | pflags , help , group ) ;
-
-#define wxPROPERTY_COLLECTION( pname , colltype , addelemtype , adder , getter , flags , help , group ) \
- wxADDER( pname , class_t , addelemtype , adder ) \
- static wxAdder##pname _adder##pname ; \
- wxCOLLECTION_GETTER( pname , class_t , colltype , getter ) \
- static wxCollectionGetter##pname _collectionGetter##pname ; \
- static wxPropertyAccessor _accessor##pname( NULL , NULL ,&_adder##pname , &_collectionGetter##pname ) ; \
- static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(colltype).name() ,typeid(addelemtype).name() ,&_accessor##pname , flags , help , group ) ;
-
-#define wxREADONLY_PROPERTY_COLLECTION( pname , colltype , addelemtype , getter , flags , help , group) \
- wxCOLLECTION_GETTER( pname , class_t , colltype , getter ) \
- static wxCollectionGetter##pname _collectionGetter##pname ; \
- static wxPropertyAccessor _accessor##pname( NULL , NULL , NULL , &_collectionGetter##pname ) ; \
- static wxPropertyInfo _propertyInfo##pname( first ,class_t::GetClassInfoStatic() , wxT(#pname) , typeid(colltype).name() ,typeid(addelemtype).name() ,&_accessor##pname , flags , help , group ) ;
-
-
-#define wxEVENT_PROPERTY( name , eventType , eventClass ) \
- static wxDelegateTypeInfo _typeInfo##name( eventType , CLASSINFO( eventClass ) ) ; \
- static wxPropertyInfo _propertyInfo##name( first ,class_t::GetClassInfoStatic() , wxT(#name) , &_typeInfo##name , NULL , wxxVariant() ) ; \
-
-#define wxEVENT_RANGE_PROPERTY( name , eventType , lastEventType , eventClass ) \
- static wxDelegateTypeInfo _typeInfo##name( eventType , lastEventType , CLASSINFO( eventClass ) ) ; \
- static wxPropertyInfo _propertyInfo##name( first , class_t::GetClassInfoStatic() , wxT(#name) , &_typeInfo##name , NULL , wxxVariant() ) ; \
-
-// ----------------------------------------------------------------------------
-// Implementation Helper for Simple Properties
-// ----------------------------------------------------------------------------
-
-#define wxIMPLEMENT_PROPERTY(name, type) \
-private:\
- type m_##name; \
-public: \
- void Set##name( type const & p) { m_##name = p; } \
- type const & Get##name() const { return m_##name; }
-
-// ----------------------------------------------------------------------------
-// Handler Info
-//
-// this is describing an event sink
-// ----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_BASE wxHandlerInfo
-{
- friend class WXDLLIMPEXP_BASE wxDynamicClassInfo ;
-public :
- wxHandlerInfo(wxHandlerInfo* &iter,
- wxClassInfo* itsClass,
- const wxString& name,
- wxObjectEventFunction address,
- const wxClassInfo* eventClassInfo) :
- m_eventFunction(address),
- m_name(name),
- m_eventClassInfo(eventClassInfo) ,
- m_itsClass(itsClass)
- {
- m_next = NULL ;
- if ( iter == NULL )
- iter = this ;
- else
- {
- wxHandlerInfo* i = iter ;
- while( i->m_next )
- i = i->m_next ;
-
- i->m_next = this ;
- }
- }
-
- ~wxHandlerInfo() ;
-
- // return the name of this handler
- const wxString& GetName() const { return m_name ; }
-
- // return the class info of the event
- const wxClassInfo *GetEventClassInfo() const { return m_eventClassInfo ; }
-
- // get the handler function pointer
- wxObjectEventFunction GetEventFunction() const { return m_eventFunction ; }
-
- // returns NULL if this is the last handler of this class
- wxHandlerInfo* GetNext() const { return m_next ; }
-
- // return the class this property is declared in
- const wxClassInfo* GetDeclaringClass() const { return m_itsClass ; }
-
-private :
- wxObjectEventFunction m_eventFunction ;
- wxString m_name;
- const wxClassInfo* m_eventClassInfo ;
- wxHandlerInfo* m_next ;
- wxClassInfo* m_itsClass ;
-};
-
-#define wxHANDLER(name,eventClassType) \
- static wxHandlerInfo _handlerInfo##name( first , class_t::GetClassInfoStatic() , wxT(#name) , (wxObjectEventFunction) (wxEventFunction) &name , CLASSINFO( eventClassType ) ) ;
-
-#define wxBEGIN_HANDLERS_TABLE(theClass) \
- wxHandlerInfo *theClass::GetHandlersStatic() \
-{ \
- typedef theClass class_t; \
- static wxHandlerInfo* first = NULL ;
-
-#define wxEND_HANDLERS_TABLE() \
- return first ; }
-
-// ----------------------------------------------------------------------------
-// Constructor Bridges
-//
-// allow to set up constructors with params during runtime
-// ----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_BASE wxConstructorBridge
-{
-public :
- virtual ~wxConstructorBridge() {};
- virtual void Create(wxObject * &o, wxxVariant *args) = 0;
-};
-
-// a direct constructor bridge calls the operator new for this class and
-// passes all params to the constructor. needed for classes that cannot be
-// instantiated using alloc-create semantics
-class WXDLLIMPEXP_BASE wxDirectConstructorBrigde : public wxConstructorBridge
-{
-public :
- virtual void Create(wxObject * &o, wxxVariant *args) = 0;
-} ;
-
-// Creator Bridges for all Numbers of Params
-
-// no params
-
-template<typename Class>
-struct wxConstructorBridge_0 : public wxConstructorBridge
-{
- void Create(wxObject * &o, wxxVariant *)
- {
- Class *obj = dynamic_cast<Class*>(o);
- obj->Create();
- }
-};
-
-struct wxConstructorBridge_Dummy : public wxConstructorBridge
-{
- void Create(wxObject *&, wxxVariant *)
- {
- }
-} ;
-
-#define wxCONSTRUCTOR_0(klass) \
- wxConstructorBridge_0<klass> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { NULL } ; \
- const int klass::ms_constructorPropertiesCount = 0 ;
-
-#define wxCONSTRUCTOR_DUMMY(klass) \
- wxConstructorBridge_Dummy constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { NULL } ; \
- const int klass::ms_constructorPropertiesCount = 0 ;
-
-// 1 param
-
-template<typename Class, typename T0>
-struct wxConstructorBridge_1 : public wxConstructorBridge
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- Class *obj = dynamic_cast<Class*>(o);
- obj->Create(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0)
- );
- }
-};
-
-#define wxCONSTRUCTOR_1(klass,t0,v0) \
- wxConstructorBridge_1<klass,t0> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) } ; \
- const int klass::ms_constructorPropertiesCount = 1 ;
-
-// 2 params
-
-template<typename Class,
-typename T0, typename T1>
-struct wxConstructorBridge_2 : public wxConstructorBridge
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- Class *obj = dynamic_cast<Class*>(o);
- obj->Create(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1)
- );
- }
-};
-
-#define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \
- wxConstructorBridge_2<klass,t0,t1> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) } ; \
- const int klass::ms_constructorPropertiesCount = 2;
-
-// direct constructor version
-
-template<typename Class,
-typename T0, typename T1>
-struct wxDirectConstructorBridge_2 : public wxDirectConstructorBrigde
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- o = new Class(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1)
- );
- }
-};
-
-#define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \
- wxDirectConstructorBridge_2<klass,t0,t1> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) } ; \
- const int klass::ms_constructorPropertiesCount = 2;
-
-
-// 3 params
-
-template<typename Class,
-typename T0, typename T1, typename T2>
-struct wxConstructorBridge_3 : public wxConstructorBridge
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- Class *obj = dynamic_cast<Class*>(o);
- obj->Create(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) ,
- args[2].wxTEMPLATED_MEMBER_CALL(Get , T2)
- );
- }
-};
-
-#define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
- wxConstructorBridge_3<klass,t0,t1,t2> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) } ; \
- const int klass::ms_constructorPropertiesCount = 3 ;
-
-// direct constructor version
-
-template<typename Class,
-typename T0, typename T1, typename T2>
-struct wxDirectConstructorBridge_3 : public wxDirectConstructorBrigde
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- o = new Class(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) ,
- args[2].wxTEMPLATED_MEMBER_CALL(Get , T2)
- );
- }
-};
-
-#define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
- wxDirectConstructorBridge_3<klass,t0,t1,t2> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) } ; \
- const int klass::ms_constructorPropertiesCount = 3;
-
-// 4 params
-
-template<typename Class,
-typename T0, typename T1, typename T2, typename T3>
-struct wxConstructorBridge_4 : public wxConstructorBridge
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- Class *obj = dynamic_cast<Class*>(o);
- obj->Create(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) ,
- args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) ,
- args[3].wxTEMPLATED_MEMBER_CALL(Get , T3)
- );
- }
-};
-
-#define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \
- wxConstructorBridge_4<klass,t0,t1,t2,t3> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) } ; \
- const int klass::ms_constructorPropertiesCount = 4 ;
-
-// 5 params
-
-template<typename Class,
-typename T0, typename T1, typename T2, typename T3, typename T4>
-struct wxConstructorBridge_5 : public wxConstructorBridge
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- Class *obj = dynamic_cast<Class*>(o);
- obj->Create(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) ,
- args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) ,
- args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) ,
- args[4].wxTEMPLATED_MEMBER_CALL(Get , T4)
- );
- }
-};
-
-#define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \
- wxConstructorBridge_5<klass,t0,t1,t2,t3,t4> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) } ; \
- const int klass::ms_constructorPropertiesCount = 5;
-
-// 6 params
-
-template<typename Class,
-typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
-struct wxConstructorBridge_6 : public wxConstructorBridge
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- Class *obj = dynamic_cast<Class*>(o);
- obj->Create(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) ,
- args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) ,
- args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) ,
- args[4].wxTEMPLATED_MEMBER_CALL(Get , T4) ,
- args[5].wxTEMPLATED_MEMBER_CALL(Get , T5)
- );
- }
-};
-
-#define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \
- wxConstructorBridge_6<klass,t0,t1,t2,t3,t4,t5> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) , wxT(#v5) } ; \
- const int klass::ms_constructorPropertiesCount = 6;
-
-// direct constructor version
-
-template<typename Class,
-typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
-struct wxDirectConstructorBridge_6 : public wxDirectConstructorBrigde
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- o = new Class(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) ,
- args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) ,
- args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) ,
- args[4].wxTEMPLATED_MEMBER_CALL(Get , T4) ,
- args[5].wxTEMPLATED_MEMBER_CALL(Get , T5)
- );
- }
-};
-
-#define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \
- wxDirectConstructorBridge_6<klass,t0,t1,t2,t3,t4,t5> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) , wxT(#v5) } ; \
- const int klass::ms_constructorPropertiesCount = 6;
-
-// 7 params
-
-template<typename Class,
-typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-struct wxConstructorBridge_7 : public wxConstructorBridge
-{
- void Create(wxObject * &o, wxxVariant *args)
- {
- Class *obj = dynamic_cast<Class*>(o);
- obj->Create(
- args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) ,
- args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) ,
- args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) ,
- args[4].wxTEMPLATED_MEMBER_CALL(Get , T4) ,
- args[5].wxTEMPLATED_MEMBER_CALL(Get , T5) ,
- args[6].wxTEMPLATED_MEMBER_CALL(Get , T6)
- );
- }
-};
-
-#define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \
- wxConstructorBridge_7<klass,t0,t1,t2,t3,t4,t5,t6> constructor##klass ; \
- wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \
- const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) , wxT(#v5) , wxT(#v6) } ; \
- const int klass::ms_constructorPropertiesCount = 7;
-
-// 8 params