X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/45212047969548b7d4a848e3a9c6cfdcb0484104..194142ed6fec5b7bc09e19b093db3e5d56f3ebc4:/src/common/xti.cpp diff --git a/src/common/xti.cpp b/src/common/xti.cpp index 082bcd498c..992dc46bef 100644 --- a/src/common/xti.cpp +++ b/src/common/xti.cpp @@ -10,7 +10,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "xti.h" #endif @@ -166,63 +166,18 @@ template<> const wxTypeInfo* wxGetTypeInfo( wxString * ) // this are compiler induced specialization which are never used anywhere -// char const * - -template<> const wxTypeInfo* wxGetTypeInfo( char const ** ) -{ - assert(0) ; - static wxBuiltInTypeInfo s_typeInfo( wxT_VOID ) ; - return &s_typeInfo ; -} - -template<> void wxStringReadValue(const wxString & , const char* & ) -{ - assert(0) ; -} - -template<> void wxStringWriteValue(wxString & , char const * const & ) -{ - assert(0) ; -} - -// char * - -template<> const wxTypeInfo* wxGetTypeInfo( char ** ) -{ - assert(0) ; - static wxBuiltInTypeInfo s_typeInfo( wxT_VOID ) ; - return &s_typeInfo ; -} - -template<> void wxStringReadValue(const wxString & , char* & ) -{ - assert(0) ; -} - -template<> void wxStringWriteValue(wxString & , char * const & ) -{ - assert(0) ; -} +WX_ILLEGAL_TYPE_SPECIALIZATION( char const * ) +WX_ILLEGAL_TYPE_SPECIALIZATION( char * ) +WX_ILLEGAL_TYPE_SPECIALIZATION( unsigned char * ) +WX_ILLEGAL_TYPE_SPECIALIZATION( int * ) +WX_ILLEGAL_TYPE_SPECIALIZATION( bool * ) +WX_ILLEGAL_TYPE_SPECIALIZATION( long * ) +WX_ILLEGAL_TYPE_SPECIALIZATION( wxString * ) // ---------------------------------------------------------------------------- // value streaming // ---------------------------------------------------------------------------- -// convenience function (avoids including xml headers in users code) - -void wxXmlAddContentToNode( wxXmlNode* node , const wxString& data ) -{ - node->AddChild(new wxXmlNode(wxXML_TEXT_NODE, "value", data ) ); -} - -wxString wxXmlGetContentFromNode( wxXmlNode *node ) -{ - if ( node->GetChildren() ) - return node->GetChildren()->GetContent() ; - else - return wxEmptyString ; -} - // streamer specializations // for all built-in types @@ -260,7 +215,7 @@ template<> void wxStringReadValue(const wxString &s , unsigned char &data ) { int intdata ; wxSscanf(s, _T("%d"), &intdata ) ; - data = unsigned char(intdata) ; + data = (unsigned char)(intdata) ; } template<> void wxStringWriteValue(wxString &s , const unsigned char &data ) @@ -370,6 +325,16 @@ template<> void wxStringWriteValue(wxString &s , const wxPoint &data ) 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 ) @@ -382,6 +347,16 @@ template<> void wxStringWriteValue(wxString &s , const 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) /* @@ -432,24 +407,6 @@ void wxSetStringToArray( const wxString &s , wxArrayString &array ) // wxClassInfo // ---------------------------------------------------------------------------- - -void wxClassInfo::Register(const char *WXUNUSED(name), wxClassInfo *WXUNUSED(info)) -{ - /* - if (!ExtendedTypeMap) - ExtendedTypeMap = new ClassMap; - (*ExtendedTypeMap)[string(Name)] = Info; - */ -} - -void wxClassInfo::Unregister(const char *WXUNUSED(name)) -{ - /* - assert(ExtendedTypeMap); - ExtendedTypeMap->erase(Name); - */ -} - const wxPropertyAccessor *wxClassInfo::FindAccessor(const char *PropertyName) { const wxPropertyInfo* info = FindPropertyInfo( PropertyName ) ; @@ -525,7 +482,7 @@ wxxVariant wxClassInfo::GetProperty(wxObject *object, const char *propertyName) VARIANT TO OBJECT */ -wxObject* wxxVariant::GetAsObject() +wxObject* wxxVariant::GetAsObject() { const wxClassTypeInfo *ti = dynamic_cast( m_data->GetTypeInfo() ) ; if ( ti )