template<> void wxStringWriteValue(wxString &s , const e &data ) \
{ \
s = s_enumData##e.GetEnumMemberName((int)data) ; \
+ } \
+ template<> const wxTypeInfo* wxGetTypeInfo( e ** ){ static wxBuiltInTypeInfo s_typeInfo(wxT_VOID ) ; assert(0) ; return &s_typeInfo ; } \
+ template<> void wxStringReadValue(const wxString& , e* & ) \
+ { \
+ assert(0) ; \
+ } \
+ template<> void wxStringWriteValue(wxString &s , e* const & ) \
+ { \
+ assert(0) ; \
}
// ----------------------------------------------------------------------------
// this macro is for usage with custom, non-object derived classes and structs, wxPoint is such a custom type
#define WX_CUSTOM_TYPE_INFO( e ) \
- template<> const wxTypeInfo* wxGetTypeInfo( e * ){ static wxCustomTypeInfo s_typeInfo(#e) ; return &s_typeInfo ; } \
+ template<> const wxTypeInfo* wxGetTypeInfo( e ** ){ static wxBuiltInTypeInfo s_typeInfo(wxT_VOID) ; assert(0) ; return &s_typeInfo ; } \
+ template<> const wxTypeInfo* wxGetTypeInfo( e * ){ static wxCustomTypeInfo s_typeInfo(#e) ; return &s_typeInfo ; }
// ----------------------------------------------------------------------------
// value streaming
// templated streaming, every type must have their specialization for these methods
template<typename T>
-void wxStringReadValue( const wxString &s , T &data ) ;
+void wxStringReadValue( const wxString &s , T &data );
template<typename T>
-void wxStringWriteValue( wxString &s , const T &data) ;
+void wxStringWriteValue( wxString &s , const T &data);
// for simple types this default implementation is ok, composited structures will have to
// loop through their properties
virtual wxxVariant GetProperty (wxObject *object, const wxChar *PropertyName);
// we must be able to cast variants to wxObject pointers, templates seem not to be suitable
- wxObject* VariantToInstance( wxxVariant &data ) const
+ wxObject* VariantToInstance( wxxVariant &data ) const
{ if ( data.GetTypeInfo()->GetKind() == wxT_OBJECT )
- return m_variantToObjectConverter( data ) ;
+ return m_variantToObjectConverter( data ) ;
else
return m_variantOfPtrToObjectConverter( data ) ;
}
{ return &name::sm_class##name; }
#define DECLARE_DYNAMIC_CLASS(name) \
- _DECLARE_DYNAMIC_CLASS(name) \
- static wxConstructorBridge* sm_constructor##name ; \
- static const wxChar * sm_constructorProperties##name[] ; \
- static const int sm_constructorPropertiesCount##name ;
+static wxConstructorBridge* sm_constructor##name ; \
+static const wxChar * sm_constructorProperties##name[] ; \
+static const int sm_constructorPropertiesCount##name ; \
+ _DECLARE_DYNAMIC_CLASS(name)
#define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \
DECLARE_NO_ASSIGN_CLASS(name) \
template<> void wxStringWriteValue(wxString & , name const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
template<> void wxStringReadValue(const wxString & , name * & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") ) ;}\
template<> void wxStringWriteValue(wxString & , name* const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringReadValue(const wxString & , name ** & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringWriteValue(wxString & , name** const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> const wxTypeInfo* wxGetTypeInfo( name *** ){ static wxBuiltInTypeInfo s_typeInfo(wxT_VOID ) ; wxASSERT_MSG(0 , wxT("illegal specialization called") ) ; return &s_typeInfo ; } \
template<> const wxTypeInfo* wxGetTypeInfo( name * ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT , &name::sm_class##name) ; return &s_typeInfo ; } \
template<> const wxTypeInfo* wxGetTypeInfo( name ** ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
template<> void wxStringWriteValue(wxString & , name const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
template<> void wxStringReadValue(const wxString & , name * & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") ) ;}\
template<> void wxStringWriteValue(wxString & , name* const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringReadValue(const wxString & , name ** & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringWriteValue(wxString & , name** const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> const wxTypeInfo* wxGetTypeInfo( name *** ){ static wxBuiltInTypeInfo s_typeInfo(wxT_VOID ) ; wxASSERT_MSG(0 , wxT("illegal specialization called") ) ; return &s_typeInfo ; } \
template<> const wxTypeInfo* wxGetTypeInfo( name * ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT , &name::sm_class##name) ; return &s_typeInfo ; } \
template<> const wxTypeInfo* wxGetTypeInfo( name ** ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
0 , 0 , 0 ); \
template<> void wxStringReadValue(const wxString & , name * & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
template<> void wxStringWriteValue(wxString & , name* const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringReadValue(const wxString & , name ** & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringWriteValue(wxString & , name** const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> const wxTypeInfo* wxGetTypeInfo( name *** ){ static wxBuiltInTypeInfo s_typeInfo(wxT_VOID ) ; wxASSERT_MSG(0 , wxT("illegal specialization called") ) ; return &s_typeInfo ; } \
+ template<> const wxTypeInfo* wxGetTypeInfo( name * ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT , &name::sm_class##name) ; return &s_typeInfo ; } \
template<> const wxTypeInfo* wxGetTypeInfo( name ** ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
// this is for subclasses that still do not derive from wxobject
0 , 0 , 0 ); \
template<> void wxStringReadValue(const wxString & , name * & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
template<> void wxStringWriteValue(wxString & , name* const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringReadValue(const wxString & , name ** & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringWriteValue(wxString & , name** const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> const wxTypeInfo* wxGetTypeInfo( name *** ){ static wxBuiltInTypeInfo s_typeInfo(wxT_VOID ) ; wxASSERT_MSG(0 , wxT("illegal specialization called") ) ; return &s_typeInfo ; } \
+ template<> const wxTypeInfo* wxGetTypeInfo( name * ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT , &name::sm_class##name) ; return &s_typeInfo ; } \
template<> const wxTypeInfo* wxGetTypeInfo( name ** ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
+
// Multiple inheritance with two base classes
#define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit) \
name::sm_constructorPropertiesCount##name , wxVariantToObjectConverter##name , wxObjectToVariantConverter##name); \
template<> void wxStringReadValue(const wxString & , name * & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
template<> void wxStringWriteValue(wxString & , name* const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringReadValue(const wxString & , name ** & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringWriteValue(wxString & , name** const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> const wxTypeInfo* wxGetTypeInfo( name *** ){ static wxBuiltInTypeInfo s_typeInfo(wxT_VOID ) ; wxASSERT_MSG(0 , wxT("illegal specialization called") ) ; return &s_typeInfo ; } \
+ template<> const wxTypeInfo* wxGetTypeInfo( name * ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT , &name::sm_class##name) ; return &s_typeInfo ; } \
template<> const wxTypeInfo* wxGetTypeInfo( name ** ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
#define IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2) \
0 , wxVariantOfPtrToObjectConverter##name ,wxVariantToObjectConverter##name , wxObjectToVariantConverter##name); \
template<> void wxStringReadValue(const wxString & , name * & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
template<> void wxStringWriteValue(wxString & , name* const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
- template<> const wxTypeInfo* wxGetTypeInfo( name ** ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
+ template<> void wxStringReadValue(const wxString & , name ** & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> void wxStringWriteValue(wxString & , name** const & ){wxASSERT_MSG( 0 , wxT("Illegal Spezialication Called") );}\
+ template<> const wxTypeInfo* wxGetTypeInfo( name * ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT , &name::sm_class##name) ; return &s_typeInfo ; } \
+ template<> const wxTypeInfo* wxGetTypeInfo( name ** ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; } \
+ template<> const wxTypeInfo* wxGetTypeInfo( name *** ){ static wxBuiltInTypeInfo s_typeInfo(wxT_VOID) ; assert(0) ; return &s_typeInfo ; }
#define IMPLEMENT_ABSTRACT_CLASS( name , basename ) \
_IMPLEMENT_ABSTRACT_CLASS( name , basename ) \
assert(0) ;
}
+// unsigned char *
+
+template<> const wxTypeInfo* wxGetTypeInfo( unsigned char ** )
+{
+ assert(0) ;
+ static wxBuiltInTypeInfo s_typeInfo( wxT_VOID ) ;
+ return &s_typeInfo ;
+}
+
+template<> void wxStringReadValue(const wxString & , unsigned char* & )
+{
+ assert(0) ;
+}
+
+template<> void wxStringWriteValue(wxString & , unsigned char * const & )
+{
+ assert(0) ;
+}
+
+// int *
+
+template<> const wxTypeInfo* wxGetTypeInfo( int ** )
+{
+ assert(0) ;
+ static wxBuiltInTypeInfo s_typeInfo( wxT_VOID ) ;
+ return &s_typeInfo ;
+}
+
+template<> void wxStringReadValue(const wxString & , int* & )
+{
+ assert(0) ;
+}
+
+template<> void wxStringWriteValue(wxString & , int * const & )
+{
+ assert(0) ;
+}
+
+// bool *
+
+template<> const wxTypeInfo* wxGetTypeInfo( bool ** )
+{
+ assert(0) ;
+ static wxBuiltInTypeInfo s_typeInfo( wxT_VOID ) ;
+ return &s_typeInfo ;
+}
+
+template<> void wxStringReadValue(const wxString & , bool* & )
+{
+ assert(0) ;
+}
+
+template<> void wxStringWriteValue(wxString & , bool * const & )
+{
+ assert(0) ;
+}
+
+// long *
+
+template<> const wxTypeInfo* wxGetTypeInfo( long ** )
+{
+ assert(0) ;
+ static wxBuiltInTypeInfo s_typeInfo( wxT_VOID ) ;
+ return &s_typeInfo ;
+}
+
+template<> void wxStringReadValue(const wxString & , long* & )
+{
+ assert(0) ;
+}
+
+template<> void wxStringWriteValue(wxString & , long * const & )
+{
+ assert(0) ;
+}
+
+// wxString *
+
+template<> const wxTypeInfo* wxGetTypeInfo( wxString ** )
+{
+ assert(0) ;
+ static wxBuiltInTypeInfo s_typeInfo( wxT_VOID ) ;
+ return &s_typeInfo ;
+}
+
+template<> void wxStringReadValue(const wxString & , wxString* & )
+{
+ assert(0) ;
+}
+
+template<> void wxStringWriteValue(wxString & , wxString * const & )
+{
+ assert(0) ;
+}
+
+
// ----------------------------------------------------------------------------
// value streaming
// ----------------------------------------------------------------------------
s = wxString::Format("%d,%d", data.x , data.y ) ;
}
+template<> void wxStringReadValue(const wxString & , wxPoint* & )
+{
+ assert(0) ;
+}
+
+template<> void wxStringWriteValue(wxString & , wxPoint* const & )
+{
+ assert(0) ;
+}
+
WX_CUSTOM_TYPE_INFO(wxPoint)
template<> void wxStringReadValue(const wxString &s , wxSize &data )
s = wxString::Format("%d,%d", data.x , data.y ) ;
}
+template<> void wxStringReadValue(const wxString & , wxSize* & )
+{
+ assert(0) ;
+}
+
+template<> void wxStringWriteValue(wxString & , wxSize * const & )
+{
+ assert(0) ;
+}
+
WX_CUSTOM_TYPE_INFO(wxSize)
/*