added more specializations for bcc32

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-08-05 21:25:58 +00:00
parent e93c6860ed
commit f0b7eadf88
2 changed files with 159 additions and 10 deletions

View File

@@ -117,6 +117,15 @@ private :
template<> void wxStringWriteValue(wxString &s , const e &data ) \ template<> void wxStringWriteValue(wxString &s , const e &data ) \
{ \ { \
s = s_enumData##e.GetEnumMemberName((int)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) ; \
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -304,7 +313,8 @@ template<typename T> const wxTypeInfo* wxGetTypeInfo( wxSet<T> * )
// this macro is for usage with custom, non-object derived classes and structs, wxPoint is such a custom type // 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 ) \ #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 // value streaming
@@ -322,10 +332,10 @@ wxString wxXmlGetContentFromNode( wxXmlNode *node ) ;
// templated streaming, every type must have their specialization for these methods // templated streaming, every type must have their specialization for these methods
template<typename T> template<typename T>
void wxStringReadValue( const wxString &s , T &data ) ; void wxStringReadValue( const wxString &s , T &data );
template<typename T> 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 // for simple types this default implementation is ok, composited structures will have to
// loop through their properties // loop through their properties
@@ -1152,10 +1162,10 @@ WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name);
{ return &name::sm_class##name; } { return &name::sm_class##name; }
#define DECLARE_DYNAMIC_CLASS(name) \ #define DECLARE_DYNAMIC_CLASS(name) \
_DECLARE_DYNAMIC_CLASS(name) \ static wxConstructorBridge* sm_constructor##name ; \
static wxConstructorBridge* sm_constructor##name ; \ static const wxChar * sm_constructorProperties##name[] ; \
static const wxChar * sm_constructorProperties##name[] ; \ static const int sm_constructorPropertiesCount##name ; \
static const int sm_constructorPropertiesCount##name ; _DECLARE_DYNAMIC_CLASS(name)
#define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \ #define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \
DECLARE_NO_ASSIGN_CLASS(name) \ DECLARE_NO_ASSIGN_CLASS(name) \
@@ -1189,6 +1199,9 @@ wxxVariant wxObjectToVariantConverter##name ( wxObject *data ) { return wxxVaria
template<> void wxStringWriteValue(wxString & , name const & ){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 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 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 , &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 wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
@@ -1208,6 +1221,9 @@ wxxVariant wxObjectToVariantConverter##name ( wxObject *data ) { return wxxVaria
template<> void wxStringWriteValue(wxString & , name const & ){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 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 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 , &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 wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
@@ -1240,6 +1256,10 @@ _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name , basename , unit )
0 , 0 , 0 ); \ 0 , 0 , 0 ); \
template<> void wxStringReadValue(const wxString & , name * & ){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 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<> 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 // this is for subclasses that still do not derive from wxobject
@@ -1253,8 +1273,13 @@ _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name , basename , unit )
0 , 0 , 0 ); \ 0 , 0 , 0 ); \
template<> void wxStringReadValue(const wxString & , name * & ){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 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<> const wxTypeInfo* wxGetTypeInfo( name ** ){ static wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &name::sm_class##name) ; return &s_typeInfo ; }
// Multiple inheritance with two base classes // Multiple inheritance with two base classes
#define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit) \ #define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit) \
@@ -1270,6 +1295,10 @@ _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name , basename , unit )
name::sm_constructorPropertiesCount##name , wxVariantToObjectConverter##name , wxObjectToVariantConverter##name); \ name::sm_constructorPropertiesCount##name , wxVariantToObjectConverter##name , wxObjectToVariantConverter##name); \
template<> void wxStringReadValue(const wxString & , name * & ){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 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<> 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) \ #define IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2) \
@@ -1299,7 +1328,11 @@ wxxVariant wxObjectToVariantConverter##name ( wxObject *data ) { return wxxVaria
0 , wxVariantOfPtrToObjectConverter##name ,wxVariantToObjectConverter##name , wxObjectToVariantConverter##name); \ 0 , wxVariantOfPtrToObjectConverter##name ,wxVariantToObjectConverter##name , wxObjectToVariantConverter##name); \
template<> void wxStringReadValue(const wxString & , name * & ){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 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 ) \ #define IMPLEMENT_ABSTRACT_CLASS( name , basename ) \
_IMPLEMENT_ABSTRACT_CLASS( name , basename ) \ _IMPLEMENT_ABSTRACT_CLASS( name , basename ) \

View File

@@ -204,6 +204,102 @@ template<> void wxStringWriteValue(wxString & , char * const & )
assert(0) ; 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 // value streaming
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -370,6 +466,16 @@ template<> void wxStringWriteValue(wxString &s , const wxPoint &data )
s = wxString::Format("%d,%d", data.x , data.y ) ; 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) WX_CUSTOM_TYPE_INFO(wxPoint)
template<> void wxStringReadValue(const wxString &s , wxSize &data ) template<> void wxStringReadValue(const wxString &s , wxSize &data )
@@ -382,6 +488,16 @@ template<> void wxStringWriteValue(wxString &s , const wxSize &data )
s = wxString::Format("%d,%d", data.x , data.y ) ; 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) WX_CUSTOM_TYPE_INFO(wxSize)
/* /*