Added --enable-extended_rtti configure switch (defaults to disabled).
authorMattia Barbon <mbarbon@cpan.org>
Wed, 11 Apr 2007 10:32:01 +0000 (10:32 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Wed, 11 Apr 2007 10:32:01 +0000 (10:32 +0000)
  Fix compilation when WXINTL_NO_GETTEXT_MACRO is defined.
  Added wx/flags.h to installed files.
  Fix XTI compilation after wxString changes.
  Fix 'virtual functions but non-virtual destructor' GCC warnings.
  Minimal XTI definition for wxOwnerDrawnComboBox (cut'n'paste
from wxComboBox, will need to be completed).
  Requires rerunning bakefile and autoconf.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/bakefiles/files.bkl
configure.in
include/wx/xti.h
include/wx/xtistrm.h
src/common/xtistrm.cpp
src/common/xtixml.cpp
src/generic/odcombo.cpp

index 4e2ba30fbde5dbe3f62c4f8ec30c9d80409014f2..b38075c69d306c2fabac169b4f452be21cda1048 100644 (file)
@@ -399,6 +399,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     wx/event.h
     wx/except.h
     wx/features.h
+    wx/flags.h
     wx/ffile.h
     wx/file.h
     wx/fileconf.h
index f8ce2d75ece07739a2dbf9529dce14a88a106c53..06a9b8a14421f7581a660b1559a2f7154034ed2b 100644 (file)
@@ -369,6 +369,7 @@ DEBUG_CONFIGURE=0
 if test $DEBUG_CONFIGURE = 1; then
   DEFAULT_wxUSE_UNIVERSAL=no
   DEFAULT_wxUSE_STL=no
+  DEFAULT_wxUSE_EXTENDED_RTTI=no
 
   DEFAULT_wxUSE_NANOX=no
 
@@ -594,6 +595,7 @@ if test $DEBUG_CONFIGURE = 1; then
 else
   DEFAULT_wxUSE_UNIVERSAL=no
   DEFAULT_wxUSE_STL=no
+  DEFAULT_wxUSE_EXTENDED_RTTI=no
 
   DEFAULT_wxUSE_NANOX=no
 
@@ -909,6 +911,7 @@ WX_ARG_ENABLE(shared,      [  --enable-shared         create shared library code
 WX_ARG_ENABLE(optimise,    [  --enable-optimise       create optimised code], wxUSE_OPTIMISE)
 WX_ARG_ENABLE(debug,       [  --enable-debug          same as debug_flag and debug_info], wxUSE_DEBUG)
 WX_ARG_ENABLE(stl,         [  --enable-stl            use STL for containers], wxUSE_STL)
+WX_ARG_ENABLE(extended_rtti, [  --enable-extended_rtti  use extended RTTI (XTI)], wxUSE_EXTENDED_RTTI)
 if test "$USE_OS2" = "1"; then
     DEFAULT_wxUSE_OMF=no
     WX_ARG_ENABLE(omf,     [  --enable-omf            use OMF object format], wxUSE_OMF)
@@ -5703,6 +5706,10 @@ if test "$wxUSE_STL" = "yes"; then
   AC_DEFINE(wxUSE_STL)
 fi
 
+if test "$wxUSE_EXTENDED_RTTI" = "yes"; then
+  AC_DEFINE(wxUSE_EXTENDED_RTTI)
+fi
+
 if test "$wxUSE_APPLE_IEEE" = "yes"; then
   AC_DEFINE(wxUSE_APPLE_IEEE)
 fi
index 7b2be4c003ff8830adb7bb603bd8301afc4defef..f603574c32a9bf32c19953a3704ceaf4ad264b90 100644 (file)
@@ -421,16 +421,24 @@ public :
     // convert a wxxVariant holding data of this type into a string
     void ConvertToString( const wxxVariant& data , wxString &result ) const
 
-    { if ( m_toString ) (*m_toString)( data , result ) ; else wxLogError( _("String conversions not supported") ) ; }
+    { if ( m_toString ) (*m_toString)( data , result ) ; else wxLogError( wxGetTranslation(_T("String conversions not supported")) ) ; }
 
     // convert a string into a wxxVariant holding the corresponding data in this type
     void ConvertFromString( const wxString& data , wxxVariant &result ) const
-    { if( m_fromString ) (*m_fromString)( data , result ) ; else wxLogError( _("String conversions not supported") ) ; }
+    { if( m_fromString ) (*m_fromString)( data , result ) ; else wxLogError( wxGetTranslation(_T("String conversions not supported")) ) ; }
 
 #if wxUSE_UNICODE
     static wxTypeInfo        *FindType(const char *typeName) { return FindType( wxString::FromAscii(typeName) ) ; }
 #endif
     static wxTypeInfo        *FindType(const wxChar *typeName);
+    static wxTypeInfo        *FindType(const wxString typeName)
+    {
+#if wxUSE_UNICODE
+        return FindType( typeName.wchar_str() );
+#else
+        return FindType( typeName.char_str() );
+#endif
+    }
 
 private :
 
@@ -494,11 +502,11 @@ public :
     // convert a wxxVariant holding data of this type into a long
     void ConvertToLong( const wxxVariant& data , long &result ) const
 
-    { if( m_toLong ) (*m_toLong)( data , result ) ; else wxLogError( _("Long Conversions not supported") ) ; }
+    { if( m_toLong ) (*m_toLong)( data , result ) ; else wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ) ; }
 
     // convert a long into a wxxVariant holding the corresponding data in this type
     void ConvertFromLong( long data , wxxVariant &result ) const
-    { if( m_fromLong ) (*m_fromLong)( data , result ) ; else wxLogError( _("Long Conversions not supported") ) ;}
+    { if( m_fromLong ) (*m_fromLong)( data , result ) ; else wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ) ;}
 
 private :
     converterToLong_t m_toLong ;
@@ -834,19 +842,19 @@ public :
 
     // Setting a simple property (non-collection)
     virtual void SetProperty(wxObject *object, const wxxVariant &value) const
-    { if ( m_setter ) m_setter->Set( object , value ) ; else wxLogError( _("SetProperty called w/o valid setter") ) ;}
+    { if ( m_setter ) m_setter->Set( object , value ) ; else wxLogError( wxGetTranslation(_T("SetProperty called w/o valid setter")) ) ;}
 
     // Getting a simple property (non-collection)
     virtual void GetProperty(const wxObject *object, wxxVariant &result) const
-    { if ( m_getter ) m_getter->Get( object , result ) ; else wxLogError( _("GetProperty called w/o valid getter") ) ;}
+    { if ( m_getter ) m_getter->Get( object , result ) ; else wxLogError( wxGetTranslation(_T("GetProperty called w/o valid getter")) ) ;}
 
     // Adding an element to a collection property
     virtual void AddToPropertyCollection(wxObject *object, const wxxVariant &value) const
-    { if ( m_adder ) m_adder->Add( object , value ) ; else wxLogError( _("AddToPropertyCollection called w/o valid adder") ) ;}
+    { if ( m_adder ) m_adder->Add( object , value ) ; else wxLogError( wxGetTranslation(_T("AddToPropertyCollection called w/o valid adder")) ) ;}
 
     // Getting a collection property
     virtual void GetPropertyCollection( const wxObject *obj, wxxVariantArray &result) const
-    { if ( m_collectionGetter ) m_collectionGetter->Get( obj , result) ; else wxLogError( _("GetPropertyCollection called w/o valid collection getter") ) ;}
+    { if ( m_collectionGetter ) m_collectionGetter->Get( obj , result) ; else wxLogError( wxGetTranslation(_T("GetPropertyCollection called w/o valid collection getter")) ) ;}
 
     virtual bool HasSetter() const { return m_setter != NULL ; }
     virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL ; }
@@ -895,11 +903,11 @@ public :
 
     // Adding an element to a collection property
     virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), const wxxVariant &WXUNUSED(value)) const
-    { wxLogError( _("AddToPropertyCollection called on a generic accessor") ) ;}
+    { wxLogError( wxGetTranslation(_T("AddToPropertyCollection called on a generic accessor")) ) ;}
 
     // Getting a collection property
     virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), wxxVariantArray &WXUNUSED(result)) const
-    { wxLogError ( _("GetPropertyCollection called on a generic accessor") ) ;}
+    { wxLogError ( wxGetTranslation(_T("GetPropertyCollection called on a generic accessor")) ) ;}
 private :
     struct wxGenericPropertyAccessorInternal ;
     wxGenericPropertyAccessorInternal* m_data ;
@@ -1267,6 +1275,7 @@ private :
 class WXDLLIMPEXP_BASE wxConstructorBridge
 {
 public :
+    virtual ~wxConstructorBridge() {};
     virtual void Create(wxObject * &o, wxxVariant *args) = 0;
 };
 
@@ -1665,7 +1674,7 @@ public:
     {
         if ( ParamCount != m_constructorPropertiesCount )
         {
-            wxLogError( _("Illegal Parameter Count for ConstructObject Method") ) ;
+            wxLogError( wxGetTranslation(_T("Illegal Parameter Count for ConstructObject Method")) ) ;
             return NULL ;
         }
         wxObject *object = NULL ;
@@ -1733,7 +1742,7 @@ public:
     {
         if ( ParamCount != m_constructorPropertiesCount )
         {
-            wxLogError( _("Illegal Parameter Count for Create Method") ) ;
+            wxLogError( wxGetTranslation(_T("Illegal Parameter Count for Create Method")) ) ;
             return ;
         }
         m_constructor->Create( object , Params ) ;
@@ -2016,7 +2025,7 @@ private :
     (int) sizeof(name),                              \
     (wxObjectConstructorFn) wxConstructorFor##name   ,   \
     name::GetPropertiesStatic(),name::GetHandlersStatic(),name::ms_constructor , name::ms_constructorProperties ,     \
-    name::ms_constructorPropertiesCount , wxVariantToObjectConverter##name , wxObjectToVariantConverter##name);    \
+    name::ms_constructorPropertiesCount , wxVariantToObjectConverter##name , NULL, wxObjectToVariantConverter##name);    \
 
 #define IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2) \
     _IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2 , "") \
index 1af026cfe9d17d20594357af15e45a218bdd83bf..023675a6f581d0ec5f3291786b54fa766aadf4bc 100644 (file)
@@ -45,6 +45,8 @@ class WXDLLIMPEXP_BASE wxReader ;
 class WXDLLIMPEXP_BASE wxPersister
 {
 public :
+    virtual ~wxPersister() {}
+
     // will be called before an object is written, may veto by returning false
     virtual bool BeforeWriteObject( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object) , const wxClassInfo *WXUNUSED(classInfo) , wxxVariantArray &WXUNUSED(metadata)) { return true ; }
 
@@ -186,6 +188,8 @@ private :
 class WXDLLIMPEXP_BASE wxDepersister
 {
 public :
+    virtual ~wxDepersister() {}
+
     // allocate the new object on the heap, that object will have the passed in ID
     virtual void AllocateObject(int objectID, wxClassInfo *classInfo, wxxVariantArray &metadata) = 0;
 
index e304fd3fc23470089eb279fe4f25a53b73bef528..20d21f6f5b366a5e5758d605ff9481ca61f7a529 100644 (file)
@@ -389,7 +389,7 @@ bool wxReader::HasObjectClassInfo( int objectID )
     if ( objectID == wxNullObjectID || objectID == wxInvalidObjectID )
     {
         wxLogError( _("Invalid or Null Object ID passed to HasObjectClassInfo" ) ) ;
-        return NULL ;
+        return false ;
     }
     return m_data->m_classInfos.find(objectID) != m_data->m_classInfos.end() ;
 }
index 91b094d6ebb9657cd68b142564c7df13c727b7f2..ed5039461b1a8d4f2e01f0647db27c080d7c4bfd 100644 (file)
@@ -306,8 +306,8 @@ int wxXmlReader::ReadComponent(wxXmlNode *node, wxDepersister *callbacks)
     {
         wxString name ;
         children->GetPropVal( wxT("name") , &name ) ;
-        propertyNames.push_back( name.c_str() ) ;
-        propertyNodes[name.c_str()] = children->GetChildren() ;
+        propertyNames.push_back( (const wxChar*)name.c_str() ) ;
+        propertyNodes[(const wxChar*)name.c_str()] = children->GetChildren() ;
         children = children->GetNext() ;
     }
 
index 1aef60c99cb75b8dc7ce8181412cfb157909b351..34940a642713a593ab967c182c3af826a73df2ec 100644 (file)
@@ -797,7 +797,19 @@ BEGIN_EVENT_TABLE(wxOwnerDrawnComboBox, wxComboCtrl)
 END_EVENT_TABLE()
 
 
+#if wxUSE_EXTENDED_RTTI
+IMPLEMENT_DYNAMIC_CLASS2_XTI(wxOwnerDrawnComboBox, wxComboCtrl, wxControlWithItems, "wx/odcombo.h")
+
+wxBEGIN_PROPERTIES_TABLE(wxOwnerDrawnComboBox)
+wxEND_PROPERTIES_TABLE()
+
+wxBEGIN_HANDLERS_TABLE(wxOwnerDrawnComboBox)
+wxEND_HANDLERS_TABLE()
+
+wxCONSTRUCTOR_5( wxOwnerDrawnComboBox , wxWindow* , Parent , wxWindowID , Id , wxString , Value , wxPoint , Position , wxSize , Size )
+#else
 IMPLEMENT_DYNAMIC_CLASS2(wxOwnerDrawnComboBox, wxComboCtrl, wxControlWithItems)
+#endif
 
 void wxOwnerDrawnComboBox::Init()
 {