]> git.saurik.com Git - wxWidgets.git/commitdiff
rearranging xti code
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 8 Jan 2011 08:03:42 +0000 (08:03 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 8 Jan 2011 08:03:42 +0000 (08:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
include/wx/object.h
include/wx/xti2.h
include/wx/xtitypes.h

index 14afcf2f7e2825a0e2a50ef20ed206d1c1ccda6f..46c07376d7a6b0aba41496ae316179b2371ffe8d 100644 (file)
@@ -1440,7 +1440,7 @@ typedef double wxDouble;
 #endif
 
 /*  ---------------------------------------------------------------------------- */
-/*  XTI workarounds for dummy compilers */
+/*  template workarounds for buggy compilers */
 /*  ---------------------------------------------------------------------------- */
 
 #if defined(__GNUC__) && !wxCHECK_GCC_VERSION( 3, 4 )
@@ -1478,56 +1478,6 @@ typedef double wxDouble;
 #  define wxINFUNC_CLASS_TYPE_FIX( type )
 #endif
 
-#if wxUSE_FUNC_TEMPLATE_POINTER
-#  define wxTO_STRING(type) wxToStringConverter<type>
-#  define wxTO_STRING_IMP(type)
-#  define wxFROM_STRING(type) wxFromStringConverter<type>
-#  define wxFROM_STRING_IMP(type)
-#else
-#  define wxTO_STRING(type) ToString##type
-#  define wxTO_STRING_IMP(type) \
-    inline void ToString##type( const wxAny& data, wxString &result ) \
-        { wxToStringConverter<type>(data, result); }
-
-#  define wxFROM_STRING(type) FromString##type
-#  define wxFROM_STRING_IMP(type) \
-    inline void FromString##type( const wxString& data, wxAny &result ) \
-        { wxFromStringConverter<type>(data, result); }
-#endif
-
-// XTI helper macro. This one is used both by xti.h and rtti.h and
-// thus needs to go in a common header to avoid redundancy.
-#define wxDECLARE_CLASS_INFO_ITERATORS()                                     \
-    class WXDLLIMPEXP_BASE const_iterator                                    \
-    {                                                                        \
-        typedef wxHashTable_Node Node;                                       \
-    public:                                                                  \
-        typedef const wxClassInfo* value_type;                               \
-        typedef const value_type& const_reference;                           \
-        typedef const_iterator itor;                                         \
-        typedef value_type* ptr_type;                                        \
-                                                                             \
-        Node* m_node;                                                        \
-        wxHashTable* m_table;                                                \
-    public:                                                                  \
-        typedef const_reference reference_type;                              \
-        typedef ptr_type pointer_type;                                       \
-                                                                             \
-        const_iterator(Node* node, wxHashTable* table)                       \
-            : m_node(node), m_table(table) { }                               \
-        const_iterator() : m_node(NULL), m_table(NULL) { }                   \
-        value_type operator*() const;                                        \
-        itor& operator++();                                                  \
-        const itor operator++(int);                                          \
-        bool operator!=(const itor& it) const                                \
-            { return it.m_node != m_node; }                                  \
-        bool operator==(const itor& it) const                                \
-            { return it.m_node == m_node; }                                  \
-    };                                                                       \
-                                                                             \
-    static const_iterator begin_classinfo();                                 \
-    static const_iterator end_classinfo()
-
 /*  ---------------------------------------------------------------------------- */
 /*  Geometric flags */
 /*  ---------------------------------------------------------------------------- */
index ef260e496cecdc084104105c9cb3a996bc8004f0..78de2533309b6cc81980150861caba1095ad2c14 100644 (file)
 
 #include "wx/memory.h"
 
+#define wxDECLARE_CLASS_INFO_ITERATORS()                                     \
+class WXDLLIMPEXP_BASE const_iterator                                    \
+    {                                                                        \
+    typedef wxHashTable_Node Node;                                       \
+    public:                                                                  \
+    typedef const wxClassInfo* value_type;                               \
+    typedef const value_type& const_reference;                           \
+    typedef const_iterator itor;                                         \
+    typedef value_type* ptr_type;                                        \
+    \
+    Node* m_node;                                                        \
+    wxHashTable* m_table;                                                \
+    public:                                                                  \
+    typedef const_reference reference_type;                              \
+    typedef ptr_type pointer_type;                                       \
+    \
+    const_iterator(Node* node, wxHashTable* table)                       \
+    : m_node(node), m_table(table) { }                               \
+    const_iterator() : m_node(NULL), m_table(NULL) { }                   \
+    value_type operator*() const;                                        \
+    itor& operator++();                                                  \
+    const itor operator++(int);                                          \
+    bool operator!=(const itor& it) const                                \
+            { return it.m_node != m_node; }                                  \
+            bool operator==(const itor& it) const                                \
+            { return it.m_node == m_node; }                                  \
+    };                                                                       \
+    \
+    static const_iterator begin_classinfo();                                 \
+    static const_iterator end_classinfo()
+
 // based on the value of wxUSE_EXTENDED_RTTI symbol,
 // only one of the RTTI system will be compiled:
 // - the "old" one (defined by rtti.h) or
index 5786a86f936897c615bd675bdefac83d6b6f8bcd..4e26e2a16cf28ef4e995ace2d1428dccf15f7874 100644 (file)
 
 #if wxUSE_EXTENDED_RTTI
 
+// ----------------------------------------------------------------------------
+// wxDynamicObject class, its instances connect to a 'super class instance'
+// ----------------------------------------------------------------------------
+
 class WXDLLIMPEXP_BASE wxDynamicObject : public wxObject
 {
     friend class WXDLLIMPEXP_FWD_BASE wxDynamicClassInfo ;
@@ -57,6 +61,27 @@ private :
     wxDynamicObjectInternal *m_data;
 };
 
+// ----------------------------------------------------------------------------
+// String conversion templates supporting older compilers
+// ----------------------------------------------------------------------------
+
+#if wxUSE_FUNC_TEMPLATE_POINTER
+#  define wxTO_STRING(type) wxToStringConverter<type>
+#  define wxTO_STRING_IMP(type)
+#  define wxFROM_STRING(type) wxFromStringConverter<type>
+#  define wxFROM_STRING_IMP(type)
+#else
+#  define wxTO_STRING(type) ToString##type
+#  define wxTO_STRING_IMP(type) \
+    inline void ToString##type( const wxAny& data, wxString &result ) \
+{ wxToStringConverter<type>(data, result); }
+
+#  define wxFROM_STRING(type) FromString##type
+#  define wxFROM_STRING_IMP(type) \
+    inline void FromString##type( const wxString& data, wxAny &result ) \
+{ wxFromStringConverter<type>(data, result); }
+#endif
+
 #include "wx/xtiprop.h"
 #include "wx/xtictor.h"
 
index f13bb7f80426f9a0d7700cb8599aab2a8182d280..783fe97826c96de7e0af9b11a467ed46c7140e42 100644 (file)
@@ -83,11 +83,6 @@ private:
 
 #define wxENUM_MEMBER( v ) { wxT(#v), v },
 
-/*
-WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<e>)                 \
-WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<e*>)                 \
-*/
-
 #define wxEND_ENUM( e )                                                 \
         { NULL, 0 } };                                                 \
     wxEnumData s_enumData##e( s_enumDataMembers##e );                   \
@@ -137,7 +132,6 @@ WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<e*>)                 \
 //
 // ----------------------------------------------------------------------------
 
-// in order to remove dependancy on string tokenizer
 void WXDLLIMPEXP_BASE wxSetStringToArray( const wxString &s, wxArrayString &array );
 
 template<typename e>
@@ -244,11 +238,6 @@ void wxFlagsToString( wxString &s, const e& data )
 
 #define wxFLAGS_MEMBER( v ) { wxT(#v), v },
 
-/*
-WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<e>)                 \
-WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<e*>)                 \
-*/
-
 #define wxEND_FLAGS( e )                                                \
         { NULL, 0 } };                                                 \
     wxEnumData s_enumData##e( s_enumDataMembers##e );                   \
@@ -326,7 +315,7 @@ public:
     {
         Register();
     }
-#if wxUSE_UNICODE
+#if 0 // wxUSE_UNICODE
     wxTypeInfo(wxTypeKind kind,
                wxVariant2StringFnc to, wxString2VariantFnc from,
                const char *name):
@@ -381,21 +370,6 @@ public:
     // statics:
 
     static wxTypeInfo *FindType( const wxString& typeName );
-#if 0 // TODO
-#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
-        }
-#endif
 private:
     void Register();
     void Unregister();
@@ -419,7 +393,7 @@ public:
             wxTypeInfo( kind, to, from, name )
        { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); }
 
-#if wxUSE_UNICODE
+#if 0 // wxUSE_UNICODE
     wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to, 
                        wxString2VariantFnc from , const char *name  ) :
             wxTypeInfo( kind, to, from, name )
@@ -435,7 +409,7 @@ public:
             wxTypeInfo( wxT_CUSTOM, to, from, name )
        {}
 
-#if wxUSE_UNICODE
+#if 0 // wxUSE_UNICODE
     wxCustomTypeInfo( const char *name , wxVariant2StringFnc to, 
                       wxString2VariantFnc from ) :
             wxTypeInfo( wxT_CUSTOM, to, from, name )
@@ -459,7 +433,7 @@ public:
         m_enumInfo = enumInfo; 
     }
 
-#if wxUSE_UNICODE
+#if 0 //wxUSE_UNICODE
     wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to,
                     wxString2VariantFnc from, converterToLong_t toLong,
                     converterFromLong_t fromLong, const char * name ) :
@@ -504,7 +478,7 @@ public:
                      wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL, 
                      const wxString &name = wxEmptyString);
 
-#if wxUSE_UNICODE
+#if 0 // wxUSE_UNICODE
     wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, wxVariant2StringFnc to,
                      wxString2VariantFnc from , const char *name );
 #endif
@@ -523,7 +497,7 @@ public:
             wxTypeInfo( wxT_COLLECTION, to, from, name )
        { m_elementTypeName = elementName; m_elementType = NULL; }
 
-#if wxUSE_UNICODE
+#if 0 // wxUSE_UNICODE
     wxCollectionTypeInfo( const char *elementName, wxVariant2StringFnc to, 
                           wxString2VariantFnc from , const char *name ) :
             wxTypeInfo( wxT_COLLECTION, to, from, name )