- wxxVariantDataT(const T& d) : m_data(d) {}
- virtual ~wxxVariantDataT() {}
-
- // get a ref to the stored data
- T & Get() { return m_data; }
-
- // get a const ref to the stored data
- const T & Get() const { return m_data; }
-
- // set the data
- void Set(const T& d) { m_data = d; }
-
- // return a heap allocated duplicate
- virtual wxxVariantData* Clone() const { return new wxxVariantDataT<T>( Get() ) ; }
-
- // returns the type info of the contentc
- virtual const wxTypeInfo* GetTypeInfo() const { return wxGetTypeInfo( (T*) NULL ) ; }
-private:
- T m_data;
-};
-
-class WXDLLIMPEXP_BASE wxxVariant
-{
-public :
- wxxVariant() { m_data = NULL ; }
- wxxVariant( wxxVariantData* data , const wxString& name = wxT("") ) : m_data(data) , m_name(name) {}
- wxxVariant( const wxxVariant &d ) { if ( d.m_data ) m_data = d.m_data->Clone() ; else m_data = NULL ; m_name = d.m_name ; }
-
- template<typename T> wxxVariant( const T& data , const wxString& name = wxT("") ) :
- m_data(new wxxVariantDataT<T>(data) ), m_name(name) {}
-
- ~wxxVariant() { delete m_data ; }
-
- // get a ref to the stored data
- template<typename T> T& Get(WX_TEMPLATED_MEMBER_FIX(T))
- {
- wxxVariantDataT<T> *dataptr = dynamic_cast<wxxVariantDataT<T>*> (m_data) ;
- wxASSERT_MSG( dataptr , wxT("Cast not possible") ) ;
- return dataptr->Get() ;
- }
-
- // get a ref to the stored data
- template<typename T> const T& Get(WX_TEMPLATED_MEMBER_FIX(T)) const
- {
- const wxxVariantDataT<T> *dataptr = dynamic_cast<const wxxVariantDataT<T>*> (m_data) ;
- wxASSERT_MSG( dataptr , wxT("Cast not possible") ) ;
- return dataptr->Get() ;
- }
-
- template<typename T> bool HasData() const
- {
- const wxxVariantDataT<T> *dataptr = dynamic_cast<const wxxVariantDataT<T>*> (m_data) ;
- return dataptr != NULL ;
- }
-
- // stores the data
- template<typename T> void Set(const T& data) const
- {
- delete m_data ;
- m_data = new wxxVariantDataT<T>(data) ;
- }
-
- wxxVariant& operator=(const wxxVariant &d)
- {
- m_data = d.m_data->Clone() ;
- m_name = d.m_name ;
- return *this ;
- }
-
- // gets the stored data casted to a wxObject* , returning NULL if cast is not possible
- wxObject* GetAsObject() ;
-
- // get the typeinfo of the stored object
- const wxTypeInfo* GetTypeInfo() const { return m_data->GetTypeInfo() ; }
-
- // returns this value as string
- wxString GetAsString() const
- {
- wxString s ;
- GetTypeInfo()->ConvertToString( *this , s ) ;
- return s ;
- }
- const wxString& GetName() const { return m_name ; }
-private :
- wxxVariantData* m_data ;
- wxString m_name ;
-} ;
-
-#include <wx/dynarray.h>
-
-WX_DECLARE_OBJARRAY_WITH_DECL(wxxVariant, wxxVariantArray, class WXDLLIMPEXP_BASE);
-
-// templated streaming, every type must have their specialization for these methods
-
-template<typename T>
-void wxStringReadValue( const wxString &s , T &data );
-
-template<typename T>
-void wxStringWriteValue( wxString &s , const T &data);
-
-template<typename T>
-void wxToStringConverter( const wxxVariant &v, wxString &s) { wxStringWriteValue( s , v.WX_TEMPLATED_MEMBER_CALL(Get , T) ) ; }
-
-template<typename T>
-void wxFromStringConverter( const wxString &s, wxxVariant &v) { T d ; wxStringReadValue( s , d ) ; v = wxxVariant(d) ; } \
-
-// ----------------------------------------------------------------------------
-// Property Support
-//
-// wxPropertyInfo is used to inquire of the property by name. It doesn't
-// provide access to the property, only information about it. If you
-// want access, look at wxPropertyAccessor.
-// ----------------------------------------------------------------------------
-
-class wxSetter
-{
-public :
- wxSetter( const wxString name ) { m_name = name ; }
- virtual void Set( wxObject *object, const wxxVariant &variantValue ) const = 0;
- const wxString& GetName() const { return m_name ; }
-private :
- wxString m_name ;
-} ;
-
-class wxGetter
-{
-public :
- wxGetter( const wxString name ) { m_name = name ; }
- virtual void Get( const wxObject *object , wxxVariant& result) const = 0;
- const wxString& GetName() const { return m_name ; }
-private :
- wxString m_name ;
-} ;
-
-class wxCollectionGetter
-{
-public :
- wxCollectionGetter( const wxString name ) { m_name = name ; }
- virtual void Get( const wxObject *object , wxxVariantArray& result) const = 0;
- const wxString& GetName() const { return m_name ; }
-private :
- wxString m_name ;
-} ;
-
-template<typename coll_t> void wxCollectionToVariantArray( const coll_t& coll , wxxVariantArray& result ) ;
-
-class wxAdder
-{
-public :
- wxAdder( const wxString name ) { m_name = name ; }
- virtual void Add( wxObject *object, const wxxVariant &variantValue ) const= 0;
- const wxString& GetName() const { return m_name ; }
-private :
- wxString m_name ;
-} ;
-
-
-
-#define WX_SETTER( property, Klass, valueType, setterMethod ) \
-class wxSetter##property : public wxSetter \
-{ \
-public: \
- wxSetter##property() : wxSetter( #setterMethod ) {} \
- void Set( wxObject *object, const wxxVariant &variantValue ) const \
-{ \
- Klass *obj = dynamic_cast<Klass*>(object) ; \
- if ( variantValue.HasData<valueType>() ) \
- obj->setterMethod(variantValue.Get<valueType>()) ; \
- else \
- obj->setterMethod(*variantValue.Get<valueType*>()) ; \
-} \
-} ;
-
-#define WX_GETTER( property, Klass, valueType , gettermethod ) \
-class wxGetter##property : public wxGetter \
-{ \
-public : \
- wxGetter##property() : wxGetter( #gettermethod ) {} \
- void Get( const wxObject *object , wxxVariant &result) const \
-{ \
- const Klass *obj = dynamic_cast<const Klass*>(object) ; \
- result = wxxVariant( obj->gettermethod() ) ; \
-} \
-} ;
-
-#define WX_ADDER( property, Klass, valueType , addermethod ) \
-class wxAdder##property : public wxAdder \
-{ \
-public: \
- wxAdder##property() : wxAdder( #addermethod ) {} \
- void Add( wxObject *object, const wxxVariant &variantValue ) const \
-{ \
- Klass *obj = dynamic_cast<Klass*>(object) ; \
- if ( variantValue.HasData<valueType>() ) \
- obj->addermethod(variantValue.Get<valueType>()) ; \
- else \
- obj->addermethod(*variantValue.Get<valueType*>()) ; \
-} \
-} ;
-
-#define WX_COLLECTION_GETTER( property, Klass, valueType , gettermethod ) \
-class wxCollectionGetter##property : public wxCollectionGetter \
-{ \
-public : \
- wxCollectionGetter##property() : wxCollectionGetter( #gettermethod ) {} \
- void Get( const wxObject *object , wxxVariantArray &result) const \
-{ \
- const Klass *obj = dynamic_cast<const Klass*>(object) ; \
- wxCollectionToVariantArray( obj->gettermethod() , result ) ; \
-} \
-} ;
-
-class WXDLLIMPEXP_BASE wxPropertyAccessor
-{
-public :
- wxPropertyAccessor( wxSetter *setter , wxGetter *getter , wxAdder *adder , wxCollectionGetter *collectionGetter )
- { m_setter = setter ; m_getter = getter ; m_adder = adder ; m_collectionGetter = collectionGetter ;}
-
- virtual ~wxPropertyAccessor() {}
-
- // Setting a simple property (non-collection)
- virtual void SetProperty(wxObject *object, const wxxVariant &value) const
- { wxASSERT_MSG(m_setter,wxT("SetProperty called w/o valid setter") ) ; m_setter->Set( object , value ) ;}
-
- // Getting a simple property (non-collection)
- virtual void GetProperty(const wxObject *object, wxxVariant &result) const
- { wxASSERT_MSG(m_getter,wxT("GetProperty called w/o valid getter") ) ; m_getter->Get( object , result ) ;}
-
- // Adding an element to a collection property
- virtual void AddToPropertyCollection(wxObject *object, const wxxVariant &value) const
- { wxASSERT_MSG(m_adder,wxT("AddToPropertyCollection called w/o valid adder") ) ; m_adder->Add( object , value ) ;}
-
- // Getting a collection property
- virtual void GetPropertyCollection( const wxObject *obj, wxxVariantArray &result) const
- { wxASSERT_MSG(m_collectionGetter,wxT("GetPropertyCollection called w/o valid collection getter") ) ; m_collectionGetter->Get( obj , result) ;}
-
- virtual bool HasSetter() const { return m_setter != NULL ; }
- virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL ; }
- virtual bool HasGetter() const { return m_getter != NULL ; }
- virtual bool HasAdder() const { return m_adder != NULL ; }
-
- virtual const wxString& GetCollectionGetterName() const
- { return m_collectionGetter->GetName() ; }
- virtual const wxString& GetGetterName() const
- { return m_getter->GetName() ; }
- virtual const wxString& GetSetterName() const
- { return m_setter->GetName() ; }
- virtual const wxString& GetAdderName() const
- { return m_adder->GetName() ; }
- /*
- virtual wxxVariant ReadValue( const wxString &value ) const ;
- virtual void WriteValue( wxString& value , const wxObject *o ) const ;
- */
-protected :
- wxSetter *m_setter ;
- wxAdder *m_adder ;
- wxGetter *m_getter ;
- wxCollectionGetter* m_collectionGetter ;
-};
-
-class WXDLLIMPEXP_BASE wxGenericPropertyAccessor : public wxPropertyAccessor
-{
-public :
- wxGenericPropertyAccessor( const wxString &propName ) ;
- ~wxGenericPropertyAccessor() ;
-
- virtual bool HasSetter() const { return true ; }
- virtual bool HasGetter() const { return true ; }
- virtual bool HasAdder() const { return false ; }
- virtual bool HasCollectionGetter() const { return false ; }
-
- virtual const wxString& GetGetterName() const
- { return m_getterName ; }
- virtual const wxString& GetSetterName() const
- { return m_setterName ; }
-
- virtual void SetProperty(wxObject *object, const wxxVariant &value) const ;
- virtual void GetProperty(const wxObject *object, wxxVariant &value) const ;
-
- // Adding an element to a collection property
- virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), const wxxVariant &WXUNUSED(value)) const
- { wxASSERT_MSG(0,wxT("AddToPropertyCollection called on a generic accessor") ) ;}
-
- // Getting a collection property
- virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), wxxVariantArray &WXUNUSED(result)) const
- { wxASSERT_MSG(0,wxT("GetPropertyCollection called on a generic accessor") ) ;}
-private :
- struct wxGenericPropertyAccessorInternal ;
- wxGenericPropertyAccessorInternal* m_data ;
- wxString m_propertyName ;
- wxString m_setterName ;
- wxString m_getterName ;
-} ;
-
-typedef long wxPropertyInfoFlags ;
-enum {
- // will be removed in future releases
- wxPROP_DEPRECATED = 0x00000001 ,
- // object graph property, will be streamed with priority (after constructor properties)
- wxPROP_OBJECT_GRAPH = 0x00000002 ,
- // this will only be streamed out and in as enum/set, the internal representation is still a long
- wxPROP_ENUM_STORE_LONG = 0x00000004 ,
- // don't stream out this property, needed eg to avoid streaming out children that are always created by their parents
- wxPROP_DONT_STREAM = 0x00000008 ,
-} ;
-
-class WXDLLIMPEXP_BASE wxPropertyInfo
-{
-public :
- wxPropertyInfo( wxPropertyInfo* &iter , const wxClassInfo* itsClass , const wxString& name , const wxTypeInfo* typeInfo , wxPropertyAccessor *accessor , wxxVariant dv , wxPropertyInfoFlags flags = 0 , const wxString& helpString=wxEmptyString, const wxString& groupString=wxEmptyString ) :
- m_name( name ) , m_itsClass( itsClass ) , m_typeInfo( typeInfo ) , m_accessor( accessor ) , m_defaultValue( dv ) , m_collectionElementTypeInfo(NULL) , m_helpString (helpString ) , m_groupString( groupString ) , m_flags(flags)
- {
- Insert(iter) ;
- }
-
- wxPropertyInfo( wxPropertyInfo* &iter , const wxClassInfo* itsClass , const wxString& name , const wxTypeInfo* collTypeInfo , const wxTypeInfo* elemTypeInfo , wxPropertyAccessor *accessor , wxPropertyInfoFlags flags = 0 , const wxString& helpString=wxEmptyString, const wxString& groupString=wxEmptyString ) :
- m_name( name ) , m_itsClass( itsClass ) , m_typeInfo( collTypeInfo ) , m_accessor( accessor ) , m_collectionElementTypeInfo(elemTypeInfo) , m_helpString (helpString ) , m_groupString( groupString ) , m_flags(flags)
- {
- Insert(iter) ;
- }
-
- // return the class this property is declared in
- const wxClassInfo* GetDeclaringClass() const { return m_itsClass ; }
-
- // return the name of this property
- const wxString& GetName() const { return m_name ; }
-
- // returns the flags of this property
- wxPropertyInfoFlags GetFlags() const { return m_flags ;}
-
- // returns the short help string of this property
- const wxString& GetHelpString() const { return m_helpString ; }
-
- // returns the group string of this property
- const wxString& GetGroupString() const { return m_groupString ; }
-
- // return the element type info of this property (for collections, otherwise NULL)
- const wxTypeInfo * GetCollectionElementTypeInfo() const { return m_collectionElementTypeInfo ; }
-
- // return the type info of this property
- const wxTypeInfo * GetTypeInfo() const { return m_typeInfo ; }
-
- // return the accessor for this property
- wxPropertyAccessor* GetAccessor() const { return m_accessor ; }
-
- // returns NULL if this is the last property of this class
- wxPropertyInfo* GetNext() const { return m_next ; }
-
- // returns the default value of this property, its kind may be wxT_VOID if it is not valid
- wxxVariant GetDefaultValue() const { return m_defaultValue ; }
-private :
- void Insert(wxPropertyInfo* &iter)
- {
- m_next = NULL ;
- if ( iter == NULL )
- iter = this ;
- else
- {
- wxPropertyInfo* i = iter ;
- while( i->m_next )
- i = i->m_next ;
-
- i->m_next = this ;
- }
- }
-
- wxString m_name;
- wxString m_typeName ;
- wxString m_groupString ;
- wxString m_helpString ;
- const wxClassInfo* m_itsClass ;
- wxPropertyInfoFlags m_flags ;
- const wxTypeInfo* m_typeInfo ;
- const wxTypeInfo* m_collectionElementTypeInfo ;
- wxPropertyAccessor* m_accessor ;
- wxxVariant m_defaultValue;
- // 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_EXPORTED_STRING_HASH_MAP( wxPropertyInfo* , wxPropertyInfoMap ) ;
-
-#define WX_BEGIN_PROPERTIES_TABLE(theClass) \
- wxPropertyInfo *theClass::GetPropertiesStatic() \
-{ \
- typedef theClass class_t; \
- static wxPropertyInfo* first = NULL ;
-
-#define WX_END_PROPERTIES_TABLE() \
- return first ; }
-
-#define WX_HIDE_PROPERTY( name ) \
- static wxPropertyInfo _propertyInfo##name( first , class_t::GetClassInfoStatic() , #name , wxGetTypeInfo( (void*) NULL ) ,NULL , wxxVariant() , wxPROP_DONT_STREAM , wxEmptyString , wxEmptyString ) ;
-
-#define WX_PROPERTY( name , type , setter , getter ,defaultValue , flags , help , group) \
- WX_SETTER( name , class_t , type , setter ) \
- static wxSetter##name _setter##name ; \
- WX_GETTER( name , class_t , type , getter ) \
- static wxGetter##name _getter##name ; \
- static wxPropertyAccessor _accessor##name( &_setter##name , &_getter##name , NULL , NULL ) ; \
- static wxPropertyInfo _propertyInfo##name( first , class_t::GetClassInfoStatic() , #name , wxGetTypeInfo( (type*) NULL ) ,&_accessor##name , wxxVariant(defaultValue) , flags , group , help ) ;
-
-#define WX_PROPERTY_FLAGS( name , flags , type , setter , getter ,defaultValue , pflags , help , group) \
- WX_SETTER( name , class_t , type , setter ) \
- static wxSetter##name _setter##name ; \
- WX_GETTER( name , class_t , type , getter ) \
- static wxGetter##name _getter##name ; \
- static wxPropertyAccessor _accessor##name( &_setter##name , &_getter##name , NULL , NULL ) ; \
- static wxPropertyInfo _propertyInfo##name( first , class_t::GetClassInfoStatic() , #name , wxGetTypeInfo( (flags*) NULL ) ,&_accessor##name , wxxVariant(defaultValue), wxPROP_ENUM_STORE_LONG | pflags , help , group ) ;
-
-#define WX_READONLY_PROPERTY( name , type , getter ,defaultValue , flags , help , group) \
- WX_GETTER( name , class_t , type , getter ) \
- static wxGetter##name _getter##name ; \
- static wxPropertyAccessor _accessor##name( NULL , &_getter##name , NULL , NULL ) ; \
- static wxPropertyInfo _propertyInfo##name( first , class_t::GetClassInfoStatic() , #name , wxGetTypeInfo( (type*) NULL ) ,&_accessor##name , wxxVariant(defaultValue), flags , help , group ) ;
-
-#define WX_PROPERTY_COLLECTION( name , colltype , addelemtype , adder , getter , flags , help , group ) \
- WX_ADDER( name , class_t , addelemtype , adder ) \
- static wxAdder##name _adder##name ; \
- WX_COLLECTION_GETTER( name , class_t , colltype , getter ) \
- static wxCollectionGetter##name _collectionGetter##name ; \
- static wxPropertyAccessor _accessor##name( NULL , NULL ,&_adder##name , &_collectionGetter##name ) ; \
- static wxPropertyInfo _propertyInfo##name( first , class_t::GetClassInfoStatic() , #name , wxGetTypeInfo( (colltype*) NULL ) ,wxGetTypeInfo( (addelemtype*) NULL ) ,&_accessor##name , flags , help , group ) ;
-
-#define WX_READONLY_PROPERTY_COLLECTION( name , colltype , addelemtype , getter , flags , help , group) \
- WX_COLLECTION_GETTER( name , class_t , colltype , getter ) \
- static wxCollectionGetter##name _collectionGetter##name ; \
- static wxPropertyAccessor _accessor##name( NULL , NULL , NULL , &_collectionGetter##name ) ; \
- static wxPropertyInfo _propertyInfo##name( first ,class_t::GetClassInfoStatic() , #name , wxGetTypeInfo( (colltype*) NULL ) ,wxGetTypeInfo( (addelemtype*) NULL ) ,&_accessor##name , flags , help , group ) ;
-/*
-#define WX_PROPERTY_COLLECTION( name , colltype , addelemtype , adder , getter ) \
-static wxPropertyCollectionAccessorT<class_t , colltype , addelemtype > _accessor##name( &adder , &getter , #adder , #getter ) ; \
-static wxPropertyInfo _propertyInfo##name( first , #name , wxGetTypeInfo( (colltype*) NULL ) ,wxGetTypeInfo( (addelemtype*) NULL ) ,&_accessor##name ) ;
-
-#define WX_READONLY_PROPERTY_COLLECTION( name , colltype , addelemtype , getter ) \
-static wxPropertyCollectionAccessorT<class_t , colltype , addelemtype > _accessor##name( &getter , #getter ) ; \
-static wxPropertyInfo _propertyInfo##name( first , #name , wxGetTypeInfo( (colltype*) NULL ) ,wxGetTypeInfo( (addelemtype*) NULL ) ,&_accessor##name ) ;
-*/
-
-
-
-#define WX_DELEGATE( name , eventType , eventClass ) \
- static wxDelegateTypeInfo _typeInfo##name( eventType , CLASSINFO( eventClass ) ) ; \
- static wxPropertyInfo _propertyInfo##name( first ,class_t::GetClassInfoStatic() , #name , &_typeInfo##name , NULL , wxxVariant() ) ; \
-
-// ----------------------------------------------------------------------------
-// Handler Info
-//
-// this is describing an event sink
-// ----------------------------------------------------------------------------
-
-class wxHandlerInfo
-{
-public :
- wxHandlerInfo( wxHandlerInfo* &iter , const wxString& name , wxObjectEventFunction address , const wxClassInfo* eventClassInfo ) :
- m_name( name ) , m_eventClassInfo( eventClassInfo ) , m_eventFunction( address )
- {
- m_next = NULL ;
- if ( iter == NULL )
- iter = this ;
- else
- {
- wxHandlerInfo* i = iter ;
- while( i->m_next )
- i = i->m_next ;
-
- i->m_next = this ;
- }
- }
-
- // 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 ; }
-private :
- wxObjectEventFunction m_eventFunction ;
- wxString m_name;
- const wxClassInfo* m_eventClassInfo ;
- wxHandlerInfo* m_next ;
-};
-
-#define WX_HANDLER(name,eventClassType) \
- static wxHandlerInfo _handlerInfo##name( first , #name , (wxObjectEventFunction) (wxEventFunction) &name , CLASSINFO( eventClassType ) ) ;
-
-#define WX_BEGIN_HANDLERS_TABLE(theClass) \
- wxHandlerInfo *theClass::GetHandlersStatic() \
-{ \
- typedef theClass class_t; \
- static wxHandlerInfo* first = NULL ;
-
-#define WX_END_HANDLERS_TABLE() \
- return first ; }
-
-// ----------------------------------------------------------------------------
-// Constructor Bridges
-//
-// allow to set up constructors with params during runtime
-// ----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_BASE 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 WX_CONSTRUCTOR_0(klass) \
- wxConstructorBridge_0<klass> constructor##klass ; \
- wxConstructorBridge* klass::sm_constructor##klass = &constructor##klass ; \
- const wxChar *klass::sm_constructorProperties##klass[] = { NULL } ; \
- const int klass::sm_constructorPropertiesCount##klass = 0 ;
-
-#define WX_CONSTRUCTOR_DUMMY(klass) \
- wxConstructorBridge_Dummy constructor##klass ; \
- wxConstructorBridge* klass::sm_constructor##klass = &constructor##klass ; \
- const wxChar *klass::sm_constructorProperties##klass[] = { NULL } ; \
- const int klass::sm_constructorPropertiesCount##klass = 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].WX_TEMPLATED_MEMBER_CALL(Get , T0)
- );
- }
-};
-
-#define WX_CONSTRUCTOR_1(klass,t0,v0) \
- wxConstructorBridge_1<klass,t0> constructor##klass ; \
- wxConstructorBridge* klass::sm_constructor##klass = &constructor##klass ; \
- const wxChar *klass::sm_constructorProperties##klass[] = { #v0 } ; \
- const int klass::sm_constructorPropertiesCount##klass = 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].WX_TEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].WX_TEMPLATED_MEMBER_CALL(Get , T1)
- );
- }
-};
-
-#define WX_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \
- wxConstructorBridge_2<klass,t0,t1> constructor##klass ; \
- wxConstructorBridge* klass::sm_constructor##klass = &constructor##klass ; \
- const wxChar *klass::sm_constructorProperties##klass[] = { #v0 , #v1 } ; \
- const int klass::sm_constructorPropertiesCount##klass = 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].WX_TEMPLATED_MEMBER_CALL(Get , T0) ,
- args[1].WX_TEMPLATED_MEMBER_CALL(Get , T1) ,
- args[2].WX_TEMPLATED_MEMBER_CALL(Get , T2)
- );
- }
-};
-
-#define WX_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
- wxConstructorBridge_3<klass,t0,t1,t2> constructor##klass ; \
- wxConstructorBridge* klass::sm_constructor##klass = &constructor##klass ; \
- const wxChar *klass::sm_constructorProperties##klass[] = { #v0 , #v1 , #v2 } ; \
- const int klass::sm_constructorPropertiesCount##klass = 3 ;
-
-// 4 params