]> git.saurik.com Git - wxWidgets.git/commitdiff
adding new files for xti merge
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 3 Jan 2011 17:43:49 +0000 (17:43 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 3 Jan 2011 17:43:49 +0000 (17:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

28 files changed:
include/wx/rtti.h [new file with mode: 0644]
include/wx/variantbase.h [new file with mode: 0644]
include/wx/xtictor.h [new file with mode: 0644]
include/wx/xtihandler.h [new file with mode: 0644]
include/wx/xtiprop.h [new file with mode: 0644]
include/wx/xtitypes.h [new file with mode: 0644]
samples/xti/Makefile.in [new file with mode: 0644]
samples/xti/classlist.cpp [new file with mode: 0644]
samples/xti/classlist.h [new file with mode: 0644]
samples/xti/codereadercallback.cpp [new file with mode: 0644]
samples/xti/codereadercallback.h [new file with mode: 0644]
samples/xti/xti.bkl [new file with mode: 0644]
samples/xti/xti.cpp [new file with mode: 0644]
samples/xti/xti.rc [new file with mode: 0644]
src/common/bmpbtncmn.cpp [new file with mode: 0644]
src/common/checkboxcmn.cpp [new file with mode: 0644]
src/common/checklstcmn.cpp [new file with mode: 0644]
src/common/dirctrlcmn.cpp [new file with mode: 0644]
src/common/gridcmn.cpp [new file with mode: 0644]
src/common/odcombocmn.cpp [new file with mode: 0644]
src/common/panelcmn.cpp [new file with mode: 0644]
src/common/radiobtncmn.cpp [new file with mode: 0644]
src/common/scrolbarcmn.cpp [new file with mode: 0644]
src/common/slidercmn.cpp [new file with mode: 0644]
src/common/spinbtncmn.cpp [new file with mode: 0644]
src/common/statbmpcmn.cpp [new file with mode: 0644]
src/common/statboxcmn.cpp [new file with mode: 0644]
src/common/statlinecmn.cpp [new file with mode: 0644]

diff --git a/include/wx/rtti.h b/include/wx/rtti.h
new file mode 100644 (file)
index 0000000..21deb57
--- /dev/null
@@ -0,0 +1,323 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/rtti.h
+// Purpose:     old RTTI macros (use XTI when possible instead)
+// Author:      Julian Smart
+// Modified by: Ron Lee
+// Created:     01/02/97
+// RCS-ID:      $Id: rtti.h 48412 2007-08-27 17:04:02Z FM $
+// Copyright:   (c) 1997 Julian Smart
+//              (c) 2001 Ron Lee <ron@debian.org>
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_RTTIH__
+#define _WX_RTTIH__
+
+#if !wxUSE_EXTENDED_RTTI     // XTI system is meant to replace these macros
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#include "wx/memory.h"
+
+// ----------------------------------------------------------------------------
+// forward declarations
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_FWD_BASE wxObject;
+class WXDLLIMPEXP_FWD_BASE wxClassInfo;
+class WXDLLIMPEXP_FWD_BASE wxHashTable;
+class WXDLLIMPEXP_FWD_BASE wxObject;
+class WXDLLIMPEXP_FWD_BASE wxPluginLibrary;
+class WXDLLIMPEXP_FWD_BASE wxHashTable_Node;
+
+// ----------------------------------------------------------------------------
+// wxClassInfo
+// ----------------------------------------------------------------------------
+
+typedef wxObject *(*wxObjectConstructorFn)(void);
+
+class WXDLLIMPEXP_BASE wxClassInfo
+{
+    friend class WXDLLIMPEXP_FWD_BASE wxObject;
+    friend WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
+public:
+    wxClassInfo( const wxChar *className,
+                 const wxClassInfo *baseInfo1,
+                 const wxClassInfo *baseInfo2,
+                 int size,
+                 wxObjectConstructorFn ctor )
+        : m_className(className)
+        , m_objectSize(size)
+        , m_objectConstructor(ctor)
+        , m_baseInfo1(baseInfo1)
+        , m_baseInfo2(baseInfo2)
+        , m_next(sm_first)
+        {
+            sm_first = this;
+            Register();
+        }
+
+    ~wxClassInfo();
+
+    wxObject *CreateObject() const
+        { return m_objectConstructor ? (*m_objectConstructor)() : 0; }
+    bool IsDynamic() const { return (NULL != m_objectConstructor); }
+
+    const wxChar       *GetClassName() const { return m_className; }
+    const wxChar       *GetBaseClassName1() const
+        { return m_baseInfo1 ? m_baseInfo1->GetClassName() : NULL; }
+    const wxChar       *GetBaseClassName2() const
+        { return m_baseInfo2 ? m_baseInfo2->GetClassName() : NULL; }
+    const wxClassInfo  *GetBaseClass1() const { return m_baseInfo1; }
+    const wxClassInfo  *GetBaseClass2() const { return m_baseInfo2; }
+    int                 GetSize() const { return m_objectSize; }
+
+    wxObjectConstructorFn      GetConstructor() const
+        { return m_objectConstructor; }
+    static const wxClassInfo  *GetFirst() { return sm_first; }
+    const wxClassInfo         *GetNext() const { return m_next; }
+    static wxClassInfo        *FindClass(const wxString& className);
+
+        // Climb upwards through inheritance hierarchy.
+        // Dual inheritance is catered for.
+
+    bool IsKindOf(const wxClassInfo *info) const
+    {
+        return info != 0 &&
+               ( info == this ||
+                 ( m_baseInfo1 && m_baseInfo1->IsKindOf(info) ) ||
+                 ( m_baseInfo2 && m_baseInfo2->IsKindOf(info) ) );
+    }
+
+    wxDECLARE_CLASS_INFO_ITERATORS()
+
+private:
+    const wxChar            *m_className;
+    int                      m_objectSize;
+    wxObjectConstructorFn    m_objectConstructor;
+
+        // Pointers to base wxClassInfos
+
+    const wxClassInfo       *m_baseInfo1;
+    const wxClassInfo       *m_baseInfo2;
+
+        // class info object live in a linked list:
+        // pointers to its head and the next element in it
+
+    static wxClassInfo      *sm_first;
+    wxClassInfo             *m_next;
+
+    static wxHashTable      *sm_classTable;
+
+protected:
+    // registers the class
+    void Register();
+    void Unregister();
+
+    DECLARE_NO_COPY_CLASS(wxClassInfo)
+};
+
+WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name);
+
+// ----------------------------------------------------------------------------
+// Dynamic class macros
+// ----------------------------------------------------------------------------
+
+#define wxDECLARE_ABSTRACT_CLASS(name)                                        \
+    public:                                                                   \
+        static wxClassInfo ms_classInfo;                                      \
+        virtual wxClassInfo *GetClassInfo() const
+
+#define wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(name)                               \
+    wxDECLARE_NO_ASSIGN_CLASS(name);                                          \
+    wxDECLARE_DYNAMIC_CLASS(name)
+
+#define wxDECLARE_DYNAMIC_CLASS_NO_COPY(name)                                 \
+    wxDECLARE_NO_COPY_CLASS(name);                                            \
+    wxDECLARE_DYNAMIC_CLASS(name)
+
+#define wxDECLARE_DYNAMIC_CLASS(name)                                         \
+    wxDECLARE_ABSTRACT_CLASS(name);                                           \
+    static wxObject* wxCreateObject()
+
+#define wxDECLARE_CLASS(name)                                                 \
+    wxDECLARE_DYNAMIC_CLASS(name)
+
+
+// common part of the macros below
+#define wxIMPLEMENT_CLASS_COMMON(name, basename, baseclsinfo2, func)          \
+    wxClassInfo name::ms_classInfo(wxT(#name),                                \
+            &basename::ms_classInfo,                                          \
+            baseclsinfo2,                                                     \
+            (int) sizeof(name),                                               \
+            func);                                                            \
+                                                                              \
+    wxClassInfo *name::GetClassInfo() const                                   \
+        { return &name::ms_classInfo; }
+
+#define wxIMPLEMENT_CLASS_COMMON1(name, basename, func)                       \
+    wxIMPLEMENT_CLASS_COMMON(name, basename, NULL, func)
+
+#define wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, func)           \
+    wxIMPLEMENT_CLASS_COMMON(name, basename1, &basename2::ms_classInfo, func)
+
+// -----------------------------------
+// for concrete classes
+// -----------------------------------
+
+    // Single inheritance with one base class
+#define wxIMPLEMENT_DYNAMIC_CLASS(name, basename)                             \
+    wxIMPLEMENT_CLASS_COMMON1(name, basename, name::wxCreateObject)           \
+    wxObject* name::wxCreateObject()                                          \
+        { return new name; }
+
+    // Multiple inheritance with two base classes
+#define wxIMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2)                \
+    wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2,                     \
+                              name::wxCreateObject)                           \
+    wxObject* name::wxCreateObject()                                          \
+        { return new name; }
+
+// -----------------------------------
+// for abstract classes
+// -----------------------------------
+
+    // Single inheritance with one base class
+#define wxIMPLEMENT_ABSTRACT_CLASS(name, basename)                            \
+    wxIMPLEMENT_CLASS_COMMON1(name, basename, NULL)
+
+    // Multiple inheritance with two base classes
+#define wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2)               \
+    wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, NULL)
+
+#define wxIMPLEMENT_CLASS(name, basename)                                     \
+    wxIMPLEMENT_ABSTRACT_CLASS(name, basename)
+
+#define wxIMPLEMENT_CLASS2(name, basename1, basename2)                        \
+    IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2)
+
+// -----------------------------------
+// XTI-compatible macros
+// -----------------------------------
+
+#include "wx/flags.h"
+
+// these macros only do something when wxUSE_EXTENDED_RTTI=1
+// (and in that case they are defined by xti.h); however to avoid
+// to be forced to wrap these macros (in user's source files) with
+//
+//  #if wxUSE_EXTENDED_RTTI
+//  ...
+//  #endif
+//
+// blocks, we define them here as empty.
+
+#define wxEMPTY_PARAMETER_VALUE /**/
+
+#define wxBEGIN_ENUM( e ) wxEMPTY_PARAMETER_VALUE
+#define wxENUM_MEMBER( v ) wxEMPTY_PARAMETER_VALUE
+#define wxEND_ENUM( e ) wxEMPTY_PARAMETER_VALUE
+
+#define wxIMPLEMENT_SET_STREAMING(SetName,e) wxEMPTY_PARAMETER_VALUE
+
+#define wxBEGIN_FLAGS( e ) wxEMPTY_PARAMETER_VALUE
+#define wxFLAGS_MEMBER( v ) wxEMPTY_PARAMETER_VALUE
+#define wxEND_FLAGS( e ) wxEMPTY_PARAMETER_VALUE
+
+#define wxCOLLECTION_TYPE_INFO( element, collection ) wxEMPTY_PARAMETER_VALUE
+
+#define wxHANDLER(name,eventClassType) wxEMPTY_PARAMETER_VALUE
+#define wxBEGIN_HANDLERS_TABLE(theClass) wxEMPTY_PARAMETER_VALUE
+#define wxEND_HANDLERS_TABLE() wxEMPTY_PARAMETER_VALUE
+
+#define wxIMPLEMENT_DYNAMIC_CLASS_XTI( name, basename, unit ) wxIMPLEMENT_DYNAMIC_CLASS( name, basename )
+#define wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK( name, basename, unit, callback ) \
+        wxEMPTY_PARAMETER_VALUE
+
+#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI( name, basename, unit ) wxEMPTY_PARAMETER_VALUE
+
+#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( name, basename,  \
+                                                             unit, toString,    \
+                                                             fromString ) wxEMPTY_PARAMETER_VALUE
+#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_NO_BASE_XTI( name, unit ) wxEMPTY_PARAMETER_VALUE
+#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_XTI( name, basename, unit ) wxEMPTY_PARAMETER_VALUE
+
+#define wxIMPLEMENT_DYNAMIC_CLASS2_XTI( name, basename, basename2, unit) wxIMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2 )
+
+#define wxCONSTRUCTOR_0(klass) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_DUMMY(klass) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_0(klass) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_1(klass,t0,v0) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_1(klass,t0,v0) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \
+    wxEMPTY_PARAMETER_VALUE
+#define wxDIRECT_CONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \
+    wxEMPTY_PARAMETER_VALUE
+
+#define wxSETTER( property, Klass, valueType, setterMethod ) wxEMPTY_PARAMETER_VALUE
+#define wxGETTER( property, Klass, valueType, gettermethod ) wxEMPTY_PARAMETER_VALUE
+#define wxADDER( property, Klass, valueType, addermethod ) wxEMPTY_PARAMETER_VALUE
+#define wxCOLLECTION_GETTER( property, Klass, valueType, gettermethod ) wxEMPTY_PARAMETER_VALUE
+
+#define wxBEGIN_PROPERTIES_TABLE(theClass) wxEMPTY_PARAMETER_VALUE
+#define wxEND_PROPERTIES_TABLE() wxEMPTY_PARAMETER_VALUE
+#define wxHIDE_PROPERTY( pname ) wxEMPTY_PARAMETER_VALUE
+
+#define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group) \
+    wxEMPTY_PARAMETER_VALUE
+
+#define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue,    \
+                          pflags, help, group) wxEMPTY_PARAMETER_VALUE
+
+#define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group) \
+    wxGETTER( pname, class_t, type, getter ) wxEMPTY_PARAMETER_VALUE
+
+#define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue,    \
+                                   pflags, help, group)  wxEMPTY_PARAMETER_VALUE
+
+#define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter,    \
+                               flags, help, group )  wxEMPTY_PARAMETER_VALUE
+
+#define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter,   \
+                                        flags, help, group) wxEMPTY_PARAMETER_VALUE
+#define wxEVENT_PROPERTY( name, eventType, eventClass ) wxEMPTY_PARAMETER_VALUE
+
+#define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass ) wxEMPTY_PARAMETER_VALUE
+
+#define wxIMPLEMENT_PROPERTY(name, type) wxEMPTY_PARAMETER_VALUE
+
+#define wxEMPTY_HANDLERS_TABLE(name) wxEMPTY_PARAMETER_VALUE
+
+#endif // !wxUSE_EXTENDED_RTTI
+#endif // _WX_RTTIH__
diff --git a/include/wx/variantbase.h b/include/wx/variantbase.h
new file mode 100644 (file)
index 0000000..5745c92
--- /dev/null
@@ -0,0 +1,279 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        wx/variantbase.h\r
+// Purpose:     wxVariantBase class, a minimal version of wxVariant used by XTI\r
+// Author:      Julian Smart\r
+// Modified by: Francesco Montorsi\r
+// Created:     10/09/98\r
+// RCS-ID:      $Id: variant.h 44625 2007-03-07 11:35:04Z VZ $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _WX_VARIANTBASE_H_\r
+#define _WX_VARIANTBASE_H_\r
+\r
+#include "wx/defs.h"\r
+\r
+#if wxUSE_VARIANT\r
+\r
+#include "wx/string.h"\r
+#include "wx/arrstr.h"\r
+#include "wx/cpp.h"\r
+#include <typeinfo>\r
+\r
+#if wxUSE_DATETIME\r
+    #include "wx/datetime.h"\r
+#endif // wxUSE_DATETIME\r
+\r
+#include "wx/iosfwrap.h"\r
+\r
+class wxTypeInfo;\r
+class wxObject;\r
+class wxClassInfo;\r
+\r
+/*\r
+ * wxVariantData stores the actual data in a wxVariant object,\r
+ * to allow it to store any type of data.\r
+ * Derive from this to provide custom data handling.\r
+ *\r
+ * NB: To prevent addition of extra vtbl pointer to wxVariantData,\r
+ *     we don't multiple-inherit from wxObjectRefData. Instead,\r
+ *     we simply replicate the wxObject ref-counting scheme.\r
+ *\r
+ * NB: When you construct a wxVariantData, it will have refcount\r
+ *     of one. Refcount will not be further increased when\r
+ *     it is passed to wxVariant. This simulates old common\r
+ *     scenario where wxVariant took ownership of wxVariantData\r
+ *     passed to it.\r
+ *     If you create wxVariantData for other reasons than passing\r
+ *     it to wxVariant, technically you are not required to call\r
+ *     DecRef() before deleting it.\r
+ *\r
+ * TODO: in order to replace wxPropertyValue, we would need\r
+ * to consider adding constructors that take pointers to C++ variables,\r
+ * or removing that functionality from the wxProperty library.\r
+ * Essentially wxPropertyValue takes on some of the wxValidator functionality\r
+ * by storing pointers and not just actual values, allowing update of C++ data\r
+ * to be handled automatically. Perhaps there's another way of doing this without\r
+ * overloading wxVariant with unnecessary functionality.\r
+ */\r
+\r
+class WXDLLIMPEXP_BASE wxVariantData\r
+{\r
+    friend class wxVariantBase;\r
+\r
+public:\r
+    wxVariantData()\r
+        : m_count(1)\r
+    { }\r
+\r
+#if wxUSE_STD_IOSTREAM\r
+    virtual bool Write(wxSTD ostream& WXUNUSED(str)) const { return false; }\r
+    virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; }\r
+#endif\r
+    virtual bool Write(wxString& WXUNUSED(str)) const { return false; }\r
+    virtual bool Read(wxString& WXUNUSED(str)) { return false; }\r
+\r
+    // Override these to provide common functionality\r
+    virtual bool Eq(wxVariantData& data) const = 0;\r
+\r
+    // What type is it? Return a string name.\r
+    virtual wxString GetType() const = 0;\r
+\r
+    // returns the type info of the content\r
+    virtual const wxTypeInfo* GetTypeInfo() const = 0;\r
+\r
+    // If it based on wxObject return the ClassInfo.\r
+    virtual wxClassInfo* GetValueClassInfo() { return NULL; }\r
+\r
+    int GetRefCount() const \r
+        { return m_count; }\r
+    void IncRef() \r
+        { m_count++; }\r
+    void DecRef()\r
+    {\r
+        if ( --m_count == 0 )\r
+            delete this;\r
+    }\r
+\r
+protected:\r
+    // Protected dtor should make some incompatible code\r
+    // break more louder. That is, they should do data->DecRef()\r
+    // instead of delete data.\r
+    virtual ~wxVariantData() {}\r
+\r
+private:\r
+    int m_count;\r
+};\r
+\r
+template<typename T> class wxVariantDataT : public wxVariantData\r
+{\r
+public:\r
+    wxVariantDataT(const T& d) : m_data(d) {}\r
+    virtual ~wxVariantDataT() {}\r
+\r
+    // get a ref to the stored data\r
+    T & Get() { return m_data; }\r
+\r
+    // get a const ref to the stored data\r
+    const T & Get() const { return m_data; }\r
+\r
+    // set the data\r
+    void Set(const T& d) { m_data =  d; }\r
+\r
+    // Override these to provide common functionality\r
+    virtual bool Eq(wxVariantData& WXUNUSED(data)) const\r
+        { return false; /* FIXME!! */    }\r
+\r
+    // What type is it? Return a string name.\r
+    virtual wxString GetType() const\r
+        { return GetTypeInfo()->GetTypeName(); }\r
+\r
+    // return a heap allocated duplicate\r
+    //virtual wxVariantData* Clone() const { return new wxVariantDataT<T>( Get() ); }\r
+\r
+    // returns the type info of the contentc\r
+    virtual const wxTypeInfo* GetTypeInfo() const { return wxGetTypeInfo( (T*) NULL ); }\r
+\r
+private:\r
+    T m_data;\r
+};\r
+\r
+\r
+/*\r
+ * wxVariantBase can store any kind of data, but has some basic types\r
+ * built in.\r
+ */\r
+\r
+class WXDLLIMPEXP_BASE wxVariantBase\r
+{\r
+public:\r
+    wxVariantBase();\r
+    wxVariantBase(const wxVariantBase& variant);\r
+    wxVariantBase(wxVariantData* data, const wxString& name = wxEmptyString);\r
+\r
+    template<typename T> \r
+        wxVariantBase(const T& data, const wxString& name = wxEmptyString) :\r
+            m_data(new wxVariantDataT<T>(data)), m_name(name) {}\r
+\r
+    virtual ~wxVariantBase();\r
+\r
+    // generic assignment\r
+    void operator= (const wxVariantBase& variant);\r
+\r
+    // Assignment using data, e.g.\r
+    // myVariant = new wxStringVariantData("hello");\r
+    void operator= (wxVariantData* variantData);\r
+\r
+    bool operator== (const wxVariantBase& variant) const;\r
+    bool operator!= (const wxVariantBase& variant) const;\r
+\r
+    // Sets/gets name\r
+    inline void SetName(const wxString& name) { m_name = name; }\r
+    inline const wxString& GetName() const { return m_name; }\r
+\r
+    // Tests whether there is data\r
+    bool IsNull() const;\r
+\r
+    // FIXME: used by wxVariantBase code but is nice wording...\r
+    bool IsEmpty() const { return IsNull(); }\r
+\r
+    // For compatibility with wxWidgets <= 2.6, this doesn't increase\r
+    // reference count.\r
+    wxVariantData* GetData() const { return m_data; }\r
+    void SetData(wxVariantData* data) ;\r
+\r
+    // make a 'clone' of the object\r
+    void Ref(const wxVariantBase& clone);\r
+\r
+    // destroy a reference\r
+    void UnRef();\r
+\r
+    // Make NULL (i.e. delete the data)\r
+    void MakeNull();\r
+\r
+    // write contents to a string (e.g. for debugging)\r
+    wxString MakeString() const;\r
+\r
+    // Delete data and name\r
+    void Clear();\r
+\r
+    // Returns a string representing the type of the variant,\r
+    // e.g. "string", "bool", "stringlist", "list", "double", "long"\r
+    wxString GetType() const;\r
+\r
+    bool IsType(const wxString& type) const;\r
+    bool IsValueKindOf(const wxClassInfo* type) const;\r
+\r
+    // FIXME wxXTI methods:\r
+\r
+    // get the typeinfo of the stored object\r
+    const wxTypeInfo* GetTypeInfo() const \r
+    { \r
+        if (!m_data)\r
+            return NULL;\r
+        return m_data->GetTypeInfo(); \r
+    }\r
+\r
+    // get a ref to the stored data\r
+    template<typename T> T& Get(wxTEMPLATED_MEMBER_FIX(T))\r
+    {\r
+        wxVariantDataT<T> *dataptr = \r
+            wx_dynamic_cast(wxVariantDataT<T>*, m_data);\r
+        wxASSERT_MSG( dataptr, \r
+            wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) );\r
+        return dataptr->Get();\r
+    }\r
+\r
+    // get a const ref to the stored data\r
+    template<typename T> const T& Get(wxTEMPLATED_MEMBER_FIX(T)) const\r
+    {\r
+        const wxVariantDataT<T> *dataptr = \r
+            wx_dynamic_cast(const wxVariantDataT<T>*, m_data);\r
+        wxASSERT_MSG( dataptr, \r
+            wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) );\r
+        return dataptr->Get();\r
+    }\r
+\r
+    template<typename T> bool HasData(wxTEMPLATED_MEMBER_FIX(T)) const\r
+    {\r
+        const wxVariantDataT<T> *dataptr = \r
+            wx_dynamic_cast(const wxVariantDataT<T>*, m_data);\r
+        return dataptr != NULL;\r
+    }\r
+\r
+    // returns this value as string\r
+    wxString GetAsString() const;\r
+\r
+    // gets the stored data casted to a wxObject*, \r
+    // returning NULL if cast is not possible\r
+    wxObject* GetAsObject();\r
+\r
+protected:\r
+    wxVariantData*  m_data;\r
+    wxString        m_name;\r
+};\r
+\r
+#include "wx/dynarray.h"\r
+WX_DECLARE_OBJARRAY_WITH_DECL(wxVariantBase, wxVariantBaseArray, class WXDLLIMPEXP_BASE);\r
+\r
+\r
+// templated streaming, every type must have their specialization for these methods\r
+\r
+template<typename T>\r
+void wxStringReadValue( const wxString &s, T &data );\r
+\r
+template<typename T>\r
+void wxStringWriteValue( wxString &s, const T &data);\r
+\r
+template<typename T>\r
+void wxToStringConverter( const wxVariantBase &v, wxString &s wxTEMPLATED_FUNCTION_FIX(T)) \\r
+    { wxStringWriteValue( s, v.wxTEMPLATED_MEMBER_CALL(Get, T) ); }\r
+\r
+template<typename T>\r
+void wxFromStringConverter( const wxString &s, wxVariantBase &v wxTEMPLATED_FUNCTION_FIX(T)) \\r
+    { T d; wxStringReadValue( s, d ); v = wxVariantBase(d); }\r
+\r
+\r
+#endif // wxUSE_VARIANT\r
+#endif // _WX_VARIANTBASE_H_\r
diff --git a/include/wx/xtictor.h b/include/wx/xtictor.h
new file mode 100644 (file)
index 0000000..1fab31b
--- /dev/null
@@ -0,0 +1,520 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        wx/xtictor.h\r
+// Purpose:     XTI constructors\r
+// Author:      Stefan Csomor\r
+// Modified by: Francesco Montorsi\r
+// Created:     27/07/03\r
+// RCS-ID:      $Id: xti.h 47299 2007-07-10 15:58:27Z FM $\r
+// Copyright:   (c) 1997 Julian Smart\r
+//              (c) 2003 Stefan Csomor\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _XTICTOR_H_\r
+#define _XTICTOR_H_\r
+\r
+#include "wx/defs.h"\r
+\r
+#if wxUSE_EXTENDED_RTTI\r
+\r
+#include "wx/string.h"\r
+#include "wx/variant.h"\r
+\r
+class WXDLLIMPEXP_BASE wxObject;\r
+class WXDLLIMPEXP_BASE wxClassInfo;\r
+class WXDLLIMPEXP_BASE wxDynamicClassInfo;\r
+class WXDLLIMPEXP_BASE wxHashTable;\r
+class WXDLLIMPEXP_BASE wxHashTable_Node;\r
+class WXDLLIMPEXP_BASE wxObjectRefData;\r
+class WXDLLIMPEXP_BASE wxEvent;\r
+class WXDLLIMPEXP_BASE wxEvtHandler;\r
+\r
+// ----------------------------------------------------------------------------\r
+// Constructor Bridges\r
+// ----------------------------------------------------------------------------\r
+\r
+// A constructor bridge allows to call a ctor with an arbitrary number\r
+// or parameters during runtime\r
+class WXDLLIMPEXP_BASE wxObjectAllocatorAndCreator\r
+{\r
+public:\r
+    virtual ~wxObjectAllocatorAndCreator() { }\r
+    virtual bool Create(wxObject * &o, wxVariantBase *args) = 0;\r
+};\r
+\r
+// a direct constructor bridge calls the operator new for this class and\r
+// passes all params to the constructor. Needed for classes that cannot be\r
+// instantiated using alloc-create semantics\r
+class WXDLLIMPEXP_BASE wxObjectAllocator : public wxObjectAllocatorAndCreator\r
+{\r
+public:\r
+    virtual bool Create(wxObject * &o, wxVariantBase *args) = 0;\r
+};\r
+\r
+\r
+// ----------------------------------------------------------------------------\r
+// Constructor Bridges for all Numbers of Params\r
+// ----------------------------------------------------------------------------\r
+\r
+// no params\r
+\r
+template<typename Class>\r
+struct wxObjectAllocatorAndCreator_0 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create();\r
+    }\r
+};\r
+\r
+struct wxObjectAllocatorAndCreator_Dummy : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject *&, wxVariantBase *)\r
+    {\r
+        return true;\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_0(klass) \\r
+    wxObjectAllocatorAndCreator_0<klass> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { NULL }; \\r
+    const int klass::ms_constructorPropertiesCount = 0;\r
+\r
+#define wxCONSTRUCTOR_DUMMY(klass) \\r
+    wxObjectAllocatorAndCreator_Dummy constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { NULL }; \\r
+    const int klass::ms_constructorPropertiesCount = 0;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class>\r
+struct wxDirectConstructorBridge_0 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class( );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_0(klass) \\r
+    wxDirectConstructorBridge_0<klass> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { NULL }; \\r
+    const int klass::ms_constructorPropertiesCount = 0;\r
+\r
+\r
+// 1 param\r
+\r
+template<typename Class, typename T0>\r
+struct wxObjectAllocatorAndCreator_1 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0)\r
+            );\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_1(klass,t0,v0) \\r
+    wxObjectAllocatorAndCreator_1<klass,t0> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \\r
+    const int klass::ms_constructorPropertiesCount = 1;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class, typename T0>\r
+struct wxDirectConstructorBridge_1 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0)\r
+            );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_1(klass,t0,v0) \\r
+    wxDirectConstructorBridge_1<klass,t0,t1> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \\r
+    const int klass::ms_constructorPropertiesCount = 1;\r
+\r
+\r
+// 2 params\r
+\r
+template<typename Class,\r
+typename T0, typename T1>\r
+struct wxObjectAllocatorAndCreator_2 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1)\r
+            );\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \\r
+    wxObjectAllocatorAndCreator_2<klass,t0,t1> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1)  }; \\r
+    const int klass::ms_constructorPropertiesCount = 2;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class,\r
+typename T0, typename T1>\r
+struct wxDirectConstructorBridge_2 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1)\r
+            );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \\r
+    wxDirectConstructorBridge_2<klass,t0,t1> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1)  }; \\r
+    const int klass::ms_constructorPropertiesCount = 2;\r
+\r
+\r
+// 3 params\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2>\r
+struct wxObjectAllocatorAndCreator_3 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2)\r
+            );\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \\r
+    wxObjectAllocatorAndCreator_3<klass,t0,t1,t2> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2)  }; \\r
+    const int klass::ms_constructorPropertiesCount = 3;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2>\r
+struct wxDirectConstructorBridge_3 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2)\r
+            );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \\r
+    wxDirectConstructorBridge_3<klass,t0,t1,t2> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \\r
+    const int klass::ms_constructorPropertiesCount = 3;\r
+\r
+\r
+// 4 params\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3>\r
+struct wxObjectAllocatorAndCreator_4 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3)\r
+            );\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \\r
+    wxObjectAllocatorAndCreator_4<klass,t0,t1,t2,t3> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = \\r
+        { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3)  }; \\r
+    const int klass::ms_constructorPropertiesCount = 4;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3>\r
+struct wxDirectConstructorBridge_4 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3)\r
+            );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \\r
+    wxDirectConstructorBridge_4<klass,t0,t1,t2,t3> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = \\r
+        { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3)  }; \\r
+    const int klass::ms_constructorPropertiesCount = 4;\r
+\r
+\r
+// 5 params\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3, typename T4>\r
+struct wxObjectAllocatorAndCreator_5 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T4)\r
+            );\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \\r
+    wxObjectAllocatorAndCreator_5<klass,t0,t1,t2,t3,t4> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = \\r
+        { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4)  }; \\r
+    const int klass::ms_constructorPropertiesCount = 5;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3, typename T4>\r
+struct wxDirectConstructorBridge_5 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T4)\r
+            );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \\r
+    wxDirectConstructorBridge_5<klass,t0,t1,t2,t3,t4> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = \\r
+        { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \\r
+    const int klass::ms_constructorPropertiesCount = 5;\r
+\r
+\r
+// 6 params\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>\r
+struct wxObjectAllocatorAndCreator_6 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T4),\r
+            args[5].wxTEMPLATED_MEMBER_CALL(Get, T5)\r
+            );\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \\r
+    wxObjectAllocatorAndCreator_6<klass,t0,t1,t2,t3,t4,t5> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = \\r
+        { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5)  }; \\r
+    const int klass::ms_constructorPropertiesCount = 6;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>\r
+struct wxDirectConstructorBridge_6 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T4),\r
+            args[5].wxTEMPLATED_MEMBER_CALL(Get, T5)\r
+            );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \\r
+    wxDirectConstructorBridge_6<klass,t0,t1,t2,t3,t4,t5> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \\r
+        wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5)  }; \\r
+    const int klass::ms_constructorPropertiesCount = 6;\r
+\r
+\r
+// 7 params\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>\r
+struct wxObjectAllocatorAndCreator_7 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T4),\r
+            args[5].wxTEMPLATED_MEMBER_CALL(Get, T5),\r
+            args[6].wxTEMPLATED_MEMBER_CALL(Get, T6)\r
+            );\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \\r
+    wxObjectAllocatorAndCreator_7<klass,t0,t1,t2,t3,t4,t5,t6> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \\r
+        wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \\r
+    const int klass::ms_constructorPropertiesCount = 7;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>\r
+struct wxDirectConstructorBridge_7 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T4),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T5),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T6)\r
+            );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \\r
+    wxDirectConstructorBridge_7<klass,t0,t1,t2,t3,t4,t5,t6> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = \\r
+        { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \\r
+    const int klass::ms_constructorPropertiesCount = 7;\r
+\r
+\r
+// 8 params\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, \\r
+typename T6, typename T7>\r
+struct wxObjectAllocatorAndCreator_8 : public wxObjectAllocatorAndCreator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        Class *obj = wx_dynamic_cast(Class*, o);\r
+        return obj->Create(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T4),\r
+            args[5].wxTEMPLATED_MEMBER_CALL(Get, T5),\r
+            args[6].wxTEMPLATED_MEMBER_CALL(Get, T6),\r
+            args[7].wxTEMPLATED_MEMBER_CALL(Get, T7)\r
+            );\r
+    }\r
+};\r
+\r
+#define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \\r
+    wxObjectAllocatorAndCreator_8<klass,t0,t1,t2,t3,t4,t5,t6,t7> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = \\r
+        { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \\r
+    const int klass::ms_constructorPropertiesCount = 8;\r
+\r
+// direct constructor version\r
+\r
+template<typename Class,\r
+typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, \\r
+typename T6, typename T7>\r
+struct wxDirectConstructorBridge_8 : public wxObjectAllocator\r
+{\r
+    bool Create(wxObject * &o, wxVariantBase *args)\r
+    {\r
+        o = new Class(\r
+            args[0].wxTEMPLATED_MEMBER_CALL(Get, T0),\r
+            args[1].wxTEMPLATED_MEMBER_CALL(Get, T1),\r
+            args[2].wxTEMPLATED_MEMBER_CALL(Get, T2),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T3),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T4),\r
+            args[3].wxTEMPLATED_MEMBER_CALL(Get, T5),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T6),\r
+            args[4].wxTEMPLATED_MEMBER_CALL(Get, T7)\r
+            );\r
+        return o != NULL;\r
+    }\r
+};\r
+\r
+#define wxDIRECT_CONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \\r
+    wxDirectConstructorBridge_8<klass,t0,t1,t2,t3,t4,t5,t6,t7> constructor##klass; \\r
+    wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \\r
+    const wxChar *klass::ms_constructorProperties[] = \\r
+        { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \\r
+    const int klass::ms_constructorPropertiesCount = 8;\r
+\r
+#endif      // wxUSE_EXTENDED_RTTI\r
+#endif      // _XTICTOR_H_\r
diff --git a/include/wx/xtihandler.h b/include/wx/xtihandler.h
new file mode 100644 (file)
index 0000000..2da2c97
--- /dev/null
@@ -0,0 +1,110 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        wx/xtihandler.h\r
+// Purpose:     XTI handlers\r
+// Author:      Stefan Csomor\r
+// Modified by: Francesco Montorsi\r
+// Created:     27/07/03\r
+// RCS-ID:      $Id: xti.h 47299 2007-07-10 15:58:27Z FM $\r
+// Copyright:   (c) 1997 Julian Smart\r
+//              (c) 2003 Stefan Csomor\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _XTIHANDLER_H_\r
+#define _XTIHANDLER_H_\r
+\r
+#include "wx/defs.h"\r
+\r
+#if wxUSE_EXTENDED_RTTI\r
+\r
+#include "wx/string.h"\r
+\r
+class WXDLLIMPEXP_BASE wxObject;\r
+class WXDLLIMPEXP_BASE wxClassInfo;\r
+class WXDLLIMPEXP_BASE wxDynamicClassInfo;\r
+class WXDLLIMPEXP_BASE wxHashTable;\r
+class WXDLLIMPEXP_BASE wxHashTable_Node;\r
+class WXDLLIMPEXP_BASE wxObjectRefData;\r
+class WXDLLIMPEXP_BASE wxEvent;\r
+class WXDLLIMPEXP_BASE wxEvtHandler;\r
+\r
+typedef void (wxObject::*wxObjectEventFunction)(wxEvent&);\r
+\r
+// ----------------------------------------------------------------------------\r
+// Handler Info\r
+//\r
+// this describes an event sink\r
+// ----------------------------------------------------------------------------\r
+\r
+class WXDLLIMPEXP_BASE wxHandlerInfo\r
+{\r
+    friend class WXDLLIMPEXP_BASE wxDynamicClassInfo;\r
+\r
+public:\r
+    wxHandlerInfo(wxHandlerInfo* &iter,\r
+                  wxClassInfo* itsClass,\r
+                  const wxString& name,\r
+                  wxObjectEventFunction address,\r
+                  const wxClassInfo* eventClassInfo) :\r
+            m_eventFunction(address),\r
+            m_name(name),\r
+            m_eventClassInfo(eventClassInfo),\r
+            m_itsClass(itsClass)\r
+       {\r
+            Insert(iter);\r
+       }\r
+\r
+    ~wxHandlerInfo()\r
+        { Remove(); }\r
+\r
+    // return the name of this handler\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+    // return the class info of the event\r
+    const wxClassInfo *GetEventClassInfo() const { return m_eventClassInfo; }\r
+\r
+    // get the handler function pointer\r
+    wxObjectEventFunction GetEventFunction() const { return m_eventFunction; }\r
+\r
+    // returns NULL if this is the last handler of this class\r
+    wxHandlerInfo*     GetNext() const { return m_next; }\r
+\r
+    // return the class this property is declared in\r
+    const wxClassInfo*   GetDeclaringClass() const { return m_itsClass; }\r
+\r
+private:\r
+\r
+    // inserts this handler at the end of the linked chain which begins\r
+    // with "iter" handler.\r
+    void Insert(wxHandlerInfo* &iter);\r
+\r
+    // removes this handler from the linked chain of the m_itsClass handlers.\r
+    void Remove();\r
+\r
+    wxObjectEventFunction m_eventFunction;\r
+    wxString              m_name;\r
+    const wxClassInfo*    m_eventClassInfo;\r
+    wxHandlerInfo*        m_next;\r
+    wxClassInfo*          m_itsClass;\r
+};\r
+\r
+#define wxHANDLER(name,eventClassType)                                               \\r
+    static wxHandlerInfo _handlerInfo##name( first, class_t::GetClassInfoStatic(),   \\r
+                    wxT(#name), (wxObjectEventFunction) (wxEventFunction) &name,     \\r
+                    CLASSINFO( eventClassType ) );\r
+\r
+#define wxBEGIN_HANDLERS_TABLE(theClass)          \\r
+    wxHandlerInfo *theClass::GetHandlersStatic()  \\r
+    {                                             \\r
+        typedef theClass class_t;                 \\r
+        static wxHandlerInfo* first = NULL;\r
+\r
+#define wxEND_HANDLERS_TABLE()                    \\r
+    return first; }\r
+\r
+#define wxEMPTY_HANDLERS_TABLE(theClass)          \\r
+    wxBEGIN_HANDLERS_TABLE(theClass)              \\r
+    wxEND_HANDLERS_TABLE()\r
+\r
+#endif      // wxUSE_EXTENDED_RTTI\r
+#endif      // _XTIHANDLER_H_\r
diff --git a/include/wx/xtiprop.h b/include/wx/xtiprop.h
new file mode 100644 (file)
index 0000000..b2f9ea0
--- /dev/null
@@ -0,0 +1,597 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        wx/xtiprop.h\r
+// Purpose:     XTI properties\r
+// Author:      Stefan Csomor\r
+// Modified by: Francesco Montorsi\r
+// Created:     27/07/03\r
+// RCS-ID:      $Id: xti.h 47299 2007-07-10 15:58:27Z FM $\r
+// Copyright:   (c) 1997 Julian Smart\r
+//              (c) 2003 Stefan Csomor\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _XTIPROP_H_\r
+#define _XTIPROP_H_\r
+\r
+#include "wx/defs.h"\r
+\r
+#if wxUSE_EXTENDED_RTTI\r
+\r
+#include "wx/string.h"\r
+#include "wx/variant.h"\r
+#include "wx/intl.h"\r
+#include "wx/log.h"\r
+#include "wx/xtitypes.h"\r
+\r
+class WXDLLIMPEXP_BASE wxObject;\r
+class WXDLLIMPEXP_BASE wxClassInfo;\r
+class WXDLLIMPEXP_BASE wxDynamicClassInfo;\r
+class WXDLLIMPEXP_BASE wxHashTable;\r
+class WXDLLIMPEXP_BASE wxHashTable_Node;\r
+class WXDLLIMPEXP_BASE wxObjectRefData;\r
+class WXDLLIMPEXP_BASE wxEvent;\r
+class WXDLLIMPEXP_BASE wxEvtHandler;\r
+\r
+// ----------------------------------------------------------------------------\r
+// Property Accessors\r
+//\r
+// wxPropertySetter/Getter/CollectionGetter/CollectionAdder are all property\r
+// accessors which are managed by wxPropertyAccessor class which in turn is\r
+// handled by wxPropertyInfo.\r
+// ----------------------------------------------------------------------------\r
+\r
+class WXDLLIMPEXP_BASE wxPropertySetter\r
+{\r
+public:\r
+    wxPropertySetter( const wxString name ) { m_name = name; }\r
+    virtual ~wxPropertySetter() {}\r
+\r
+    virtual void Set( wxObject *object, const wxVariantBase &variantValue ) const = 0;\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+private:\r
+    wxString m_name;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyGetter\r
+{\r
+public:\r
+    wxPropertyGetter( const wxString name ) { m_name = name; }\r
+    virtual ~wxPropertyGetter() {}\r
+\r
+    virtual void Get( const wxObject *object, wxVariantBase& result) const = 0;\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+private:\r
+    wxString m_name;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyCollectionGetter\r
+{\r
+public:\r
+    wxPropertyCollectionGetter( const wxString name ) { m_name = name; }\r
+    virtual ~wxPropertyCollectionGetter() {}\r
+\r
+    virtual void Get( const wxObject *object, wxVariantBaseArray& result) const = 0;\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+private:\r
+    wxString m_name;\r
+};\r
+\r
+template<typename coll_t> void WXDLLIMPEXP_BASE \\r
+    wxCollectionToVariantArray( const coll_t& coll, wxVariantBaseArray& result );\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyCollectionAdder\r
+{\r
+public:\r
+    wxPropertyCollectionAdder( const wxString name ) { m_name = name; }\r
+    virtual ~wxPropertyCollectionAdder() {}\r
+\r
+    virtual void Add( wxObject *object, const wxVariantBase &variantValue ) const= 0;\r
+    const wxString& GetName() const { return m_name; }\r
+\r
+private:\r
+    wxString m_name;\r
+};\r
+\r
+#define wxPROPERTY_SETTER( property, Klass, valueType, setterMethod )            \\r
+class wxPropertySetter##property : public wxPropertySetter                              \\r
+{                                                                       \\r
+public:                                                                 \\r
+    wxINFUNC_CLASS_TYPE_FIX(Klass)                                      \\r
+    wxPropertySetter##property() : wxPropertySetter( wxT(#setterMethod) ) {}            \\r
+    virtual ~wxPropertySetter##property() {}                                    \\r
+                                                                        \\r
+    void Set( wxObject *object, const wxVariantBase &variantValue ) const  \\r
+    {                                                                   \\r
+        Klass *obj = dynamic_cast<Klass*>(object);                      \\r
+        if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \\r
+            obj->setterMethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType));   \\r
+        else                                                                            \\r
+            obj->setterMethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType*)); \\r
+    }                                                                                   \\r
+};\r
+\r
+#define wxPROPERTY_GETTER( property, Klass, valueType, gettermethod )           \\r
+class wxPropertyGetter##property : public wxPropertyGetter                              \\r
+{                                                                       \\r
+public:                                                                 \\r
+    wxINFUNC_CLASS_TYPE_FIX(Klass)                                      \\r
+    wxPropertyGetter##property() : wxPropertyGetter( wxT(#gettermethod) ) {}            \\r
+    virtual ~wxPropertyGetter##property() {}                                    \\r
+                                                                        \\r
+    void Get( const wxObject *object, wxVariantBase &result) const        \\r
+    {                                                                   \\r
+        const Klass *obj = dynamic_cast<const Klass*>(object);          \\r
+        result = wxVariantBase( obj->gettermethod() );                     \\r
+    }                                                                   \\r
+};\r
+\r
+#define wxPROPERTY_COLLECTION_ADDER( property, Klass, valueType, addermethod )             \\r
+class wxPropertyCollectionAdder##property : public wxPropertyCollectionAdder                                \\r
+{                                                                       \\r
+public:                                                                 \\r
+    wxINFUNC_CLASS_TYPE_FIX(Klass)                                      \\r
+    wxPropertyCollectionAdder##property() : wxPropertyCollectionAdder( wxT(#addermethod) ) {}               \\r
+    virtual ~wxPropertyCollectionAdder##property() {}                                     \\r
+                                                                        \\r
+    void Add( wxObject *object, const wxVariantBase &variantValue ) const  \\r
+    {                                                                   \\r
+        Klass *obj = dynamic_cast<Klass*>(object);                      \\r
+        if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \\r
+            obj->addermethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType));    \\r
+        else                                                                            \\r
+            obj->addermethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType*));  \\r
+    }                                                                                   \\r
+};\r
+\r
+#define wxPROPERTY_COLLECTION_GETTER( property, Klass, valueType, gettermethod )    \\r
+class wxPropertyCollectionGetter##property : public wxPropertyCollectionGetter              \\r
+{                                                                           \\r
+public:                                                                     \\r
+    wxINFUNC_CLASS_TYPE_FIX(Klass)                                          \\r
+    wxPropertyCollectionGetter##property() : wxPropertyCollectionGetter( wxT(#gettermethod) ) {} \\r
+    virtual ~wxPropertyCollectionGetter##property() {}                              \\r
+                                                                            \\r
+    void Get( const wxObject *object, wxVariantBaseArray &result) const       \\r
+    {                                                                       \\r
+        const Klass *obj = dynamic_cast<const Klass*>(object);              \\r
+        wxCollectionToVariantArray( obj->gettermethod(), result );         \\r
+    }                                                                       \\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyAccessor\r
+{\r
+public:\r
+    wxPropertyAccessor( wxPropertySetter *setter, wxPropertyGetter *getter, \r
+                        wxPropertyCollectionAdder *adder, wxPropertyCollectionGetter *collectionGetter )\r
+    { m_setter = setter; m_getter = getter; m_adder = adder; \r
+      m_collectionGetter = collectionGetter; }\r
+\r
+    virtual ~wxPropertyAccessor() {}\r
+\r
+    // Setting a simple property (non-collection)\r
+    virtual void SetProperty(wxObject *object, const wxVariantBase &value) const\r
+    { \r
+        if ( m_setter ) \r
+            m_setter->Set( object, value ); \r
+        else \r
+            wxLogError( _("SetProperty called w/o valid setter") ); \r
+    }\r
+\r
+    // Getting a simple property (non-collection)\r
+    virtual void GetProperty(const wxObject *object, wxVariantBase &result) const\r
+    { \r
+        if ( m_getter ) \r
+            m_getter->Get( object, result ); \r
+        else \r
+            wxLogError( _("GetProperty called w/o valid getter") ); \r
+    }\r
+\r
+    // Adding an element to a collection property\r
+    virtual void AddToPropertyCollection(wxObject *object, const wxVariantBase &value) const\r
+    { \r
+        if ( m_adder ) \r
+            m_adder->Add( object, value ); \r
+        else \r
+            wxLogError( _("AddToPropertyCollection called w/o valid adder") ); \r
+    }\r
+\r
+    // Getting a collection property\r
+    virtual void GetPropertyCollection( const wxObject *obj, wxVariantBaseArray &result) const\r
+    { \r
+        if ( m_collectionGetter ) \r
+            m_collectionGetter->Get( obj, result); \r
+        else \r
+            wxLogError( _("GetPropertyCollection called w/o valid collection getter") ); \r
+    }\r
+\r
+    virtual bool HasSetter() const { return m_setter != NULL; }\r
+    virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL; }\r
+    virtual bool HasGetter() const { return m_getter != NULL; }\r
+    virtual bool HasAdder() const { return m_adder != NULL; }\r
+\r
+    virtual const wxString& GetCollectionGetterName() const\r
+        { return m_collectionGetter->GetName(); }\r
+    virtual const wxString&  GetGetterName() const\r
+        { return m_getter->GetName(); }\r
+    virtual const wxString& GetSetterName() const\r
+        { return m_setter->GetName(); }\r
+    virtual const wxString& GetAdderName() const\r
+        { return m_adder->GetName(); }\r
+\r
+protected:\r
+    wxPropertySetter *m_setter;\r
+    wxPropertyCollectionAdder *m_adder;\r
+    wxPropertyGetter *m_getter;\r
+    wxPropertyCollectionGetter* m_collectionGetter;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxGenericPropertyAccessor : public wxPropertyAccessor\r
+{\r
+public:\r
+    wxGenericPropertyAccessor( const wxString &propName );\r
+    virtual ~wxGenericPropertyAccessor();\r
+\r
+    void RenameProperty( const wxString& WXUNUSED_UNLESS_DEBUG(oldName),\r
+        const wxString& newName )\r
+    {\r
+        wxASSERT( oldName == m_propertyName ); m_propertyName = newName;\r
+    }\r
+\r
+    virtual bool HasSetter() const { return true; }\r
+    virtual bool HasGetter() const { return true; }\r
+    virtual bool HasAdder() const { return false; }\r
+    virtual bool HasCollectionGetter() const { return false; }\r
+\r
+    virtual const wxString&  GetGetterName() const\r
+        { return m_getterName; }\r
+    virtual const wxString& GetSetterName() const\r
+        { return m_setterName; }\r
+\r
+    virtual void SetProperty(wxObject *object, const wxVariantBase &value) const;\r
+    virtual void GetProperty(const wxObject *object, wxVariantBase &value) const;\r
+\r
+    // Adding an element to a collection property\r
+    virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), \r
+                                         const wxVariantBase &WXUNUSED(value)) const\r
+    { \r
+        wxLogError( _("AddToPropertyCollection called on a generic accessor") ); \r
+    }\r
+\r
+    // Getting a collection property\r
+    virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), \r
+                                        wxVariantBaseArray &WXUNUSED(result)) const\r
+    { \r
+        wxLogError ( _("GetPropertyCollection called on a generic accessor") ); \r
+    }\r
+\r
+private:\r
+    struct wxGenericPropertyAccessorInternal;\r
+    wxGenericPropertyAccessorInternal* m_data;\r
+    wxString m_propertyName;\r
+    wxString m_setterName;\r
+    wxString m_getterName;\r
+};\r
+\r
+typedef long wxPropertyInfoFlags;\r
+enum \r
+{\r
+    // will be removed in future releases\r
+    wxPROP_DEPRECATED       = 0x00000001,\r
+\r
+    // object graph property, will be streamed with priority (after constructor properties)\r
+    wxPROP_OBJECT_GRAPH     = 0x00000002,\r
+\r
+    // this will only be streamed out and in as enum/set, the internal representation \r
+    // is still a long\r
+    wxPROP_ENUM_STORE_LONG  = 0x00000004,\r
+\r
+    // don't stream out this property, needed eg to avoid streaming out children \r
+    // that are always created by their parents\r
+    wxPROP_DONT_STREAM      = 0x00000008\r
+};\r
+\r
+\r
+// ----------------------------------------------------------------------------\r
+// Property Support\r
+//\r
+// wxPropertyInfo is used to inquire of the property by name.  It doesn't\r
+// provide access to the property, only information about it.  If you\r
+// want access, look at wxPropertyAccessor.\r
+// ----------------------------------------------------------------------------\r
+\r
+class WXDLLIMPEXP_BASE wxPropertyInfo\r
+{\r
+    friend class WXDLLIMPEXP_BASE wxDynamicClassInfo;\r
+\r
+public:\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+                   wxClassInfo* itsClass,\r
+                   const wxString& name,\r
+                   const wxString& typeName,\r
+                   wxPropertyAccessor *accessor,\r
+                   wxVariantBase dv,\r
+                   wxPropertyInfoFlags flags = 0,\r
+                   const wxString& helpString = wxEmptyString,\r
+                   const wxString& groupString = wxEmptyString) :\r
+                   m_itsClass(itsClass),\r
+           m_name(name),\r
+           m_typeInfo(NULL),\r
+           m_typeName(typeName),\r
+           m_collectionElementTypeInfo(NULL),\r
+           m_accessor(accessor),\r
+           m_defaultValue(dv),\r
+           m_flags(flags),\r
+           m_helpString(helpString),\r
+           m_groupString(groupString)\r
+       {\r
+           Insert(iter);\r
+       }\r
+\r
+#if wxUSE_UNICODE\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+                   wxClassInfo* itsClass,\r
+                   const wxString& name,\r
+                   const char* typeName,\r
+                   wxPropertyAccessor *accessor,\r
+                   wxVariantBase dv,\r
+                   wxPropertyInfoFlags flags = 0,\r
+                   const wxString& helpString = wxEmptyString,\r
+                   const wxString& groupString = wxEmptyString) :\r
+                   m_itsClass(itsClass),\r
+           m_name(name),\r
+           m_typeInfo(NULL),\r
+           m_typeName(wxString::FromAscii(typeName)),\r
+           m_collectionElementTypeInfo(NULL),\r
+           m_accessor(accessor),\r
+           m_defaultValue(dv),\r
+           m_flags(flags),\r
+           m_helpString(helpString),\r
+           m_groupString(groupString)\r
+       {\r
+           Insert(iter);\r
+       }\r
+#endif\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+                   wxClassInfo* itsClass,\r
+                   const wxString& name,\r
+                   wxEventSourceTypeInfo* type,\r
+                   wxPropertyAccessor *accessor,\r
+                   wxVariantBase dv,\r
+                   wxPropertyInfoFlags flags = 0,\r
+                   const wxString& helpString = wxEmptyString,\r
+                   const wxString& groupString = wxEmptyString) :\r
+           m_itsClass(itsClass),\r
+           m_name(name),\r
+           m_typeInfo(type),\r
+           m_collectionElementTypeInfo(NULL),\r
+           m_accessor(accessor),\r
+           m_defaultValue(dv),\r
+           m_flags(flags),\r
+           m_helpString(helpString),\r
+           m_groupString(groupString)\r
+       {\r
+           Insert(iter);\r
+       }\r
+\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+                    wxClassInfo* itsClass, const wxString& name,\r
+                    const wxString& collectionTypeName,\r
+                    const wxString& elementTypeName,\r
+                    wxPropertyAccessor *accessor,\r
+                    wxPropertyInfoFlags flags = 0,\r
+                    const wxString& helpString = wxEmptyString,\r
+                    const wxString& groupString = wxEmptyString) :\r
+        m_itsClass(itsClass),\r
+        m_name(name),\r
+        m_typeInfo(NULL),\r
+        m_typeName(collectionTypeName),\r
+        m_collectionElementTypeInfo(NULL),\r
+        m_collectionElementTypeName(elementTypeName),\r
+        m_accessor(accessor),\r
+        m_flags(flags),\r
+        m_helpString(helpString),\r
+        m_groupString(groupString)\r
+    {\r
+        Insert(iter);\r
+    }\r
+\r
+#if wxUSE_UNICODE\r
+    wxPropertyInfo(wxPropertyInfo* &iter,\r
+            wxClassInfo* itsClass, const wxString& name,\r
+            const char* collectionTypeName,\r
+            const char* elementTypeName,\r
+            wxPropertyAccessor *accessor,\r
+            wxPropertyInfoFlags flags = 0,\r
+            const wxString& helpString = wxEmptyString,\r
+            const wxString& groupString = wxEmptyString) :\r
+        m_itsClass(itsClass),\r
+        m_name(name),\r
+        m_typeInfo(NULL),\r
+        m_typeName(wxString::FromAscii(collectionTypeName)),\r
+        m_collectionElementTypeInfo(NULL),\r
+        m_collectionElementTypeName(wxString::FromAscii(elementTypeName)),\r
+        m_accessor(accessor),\r
+        m_flags(flags),\r
+        m_helpString(helpString),\r
+        m_groupString(groupString)\r
+    {\r
+        Insert(iter);\r
+    }\r
+#endif\r
+    ~wxPropertyInfo()\r
+        { Remove(); }\r
+\r
+    // return the class this property is declared in\r
+    const wxClassInfo*  GetDeclaringClass() const { return m_itsClass; }\r
+\r
+    // return the name of this property\r
+    const wxString&     GetName() const { return m_name; }\r
+\r
+    // returns the flags of this property\r
+    wxPropertyInfoFlags GetFlags() const { return m_flags; }\r
+\r
+    // returns the short help string of this property\r
+    const wxString&     GetHelpString() const { return m_helpString; }\r
+\r
+    // returns the group string of this property\r
+    const wxString&     GetGroupString() const { return m_groupString; }\r
+\r
+    // return the element type info of this property (for collections, otherwise NULL)\r
+    const wxTypeInfo *  GetCollectionElementTypeInfo() const\r
+    {\r
+        if ( m_collectionElementTypeInfo == NULL )\r
+            m_collectionElementTypeInfo = wxTypeInfo::FindType(m_collectionElementTypeName);\r
+        return m_collectionElementTypeInfo;\r
+    }\r
+\r
+    // return the type info of this property\r
+    const wxTypeInfo *  GetTypeInfo() const\r
+    {\r
+        if ( m_typeInfo == NULL )\r
+            m_typeInfo = wxTypeInfo::FindType(m_typeName);\r
+        return m_typeInfo;\r
+    }\r
+\r
+    // return the accessor for this property\r
+    wxPropertyAccessor* GetAccessor() const { return m_accessor; }\r
+\r
+    // returns NULL if this is the last property of this class\r
+    wxPropertyInfo*     GetNext() const { return m_next; }\r
+\r
+    // returns the default value of this property, its kind may be wxT_VOID if it is not valid\r
+    wxVariantBase          GetDefaultValue() const { return m_defaultValue; }\r
+\r
+private:\r
+\r
+    // inserts this property at the end of the linked chain which begins\r
+    // with "iter" property.\r
+    void Insert(wxPropertyInfo* &iter);\r
+\r
+    // removes this property from the linked chain of the m_itsClass properties.\r
+    void Remove();\r
+\r
+    wxClassInfo*        m_itsClass;\r
+    wxString            m_name;\r
+    mutable wxTypeInfo* m_typeInfo;\r
+    wxString            m_typeName;\r
+    mutable wxTypeInfo* m_collectionElementTypeInfo;\r
+    wxString            m_collectionElementTypeName;\r
+    wxPropertyAccessor* m_accessor;\r
+    wxVariantBase          m_defaultValue;\r
+    wxPropertyInfoFlags m_flags;\r
+    wxString            m_helpString;\r
+    wxString            m_groupString;\r
+    wxPropertyInfo*     m_next;\r
+\r
+    // FIXME: what's this comment about??\r
+    // string representation of the default value\r
+    // to be assigned by the designer to the property\r
+    // when the component is dropped on the container.\r
+};\r
+\r
+WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo*, wxPropertyInfoMap, \r
+                                      class WXDLLIMPEXP_BASE );\r
+\r
+#define wxBEGIN_PROPERTIES_TABLE(theClass)                      \\r
+    wxPropertyInfo *theClass::GetPropertiesStatic()             \\r
+    {                                                           \\r
+        typedef theClass class_t;                               \\r
+        static wxPropertyInfo* first = NULL;\r
+\r
+#define wxEND_PROPERTIES_TABLE() \\r
+    return first; }\r
+\r
+#define wxHIDE_PROPERTY( pname )                                                      \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(void).name(), NULL, wxVariantBase(), wxPROP_DONT_STREAM, \\r
+            wxEmptyString, wxEmptyString );\r
+\r
+#define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group)    \\r
+    wxPROPERTY_SETTER( pname, class_t, type, setter )                                 \\r
+    static wxPropertySetter##pname _setter##pname;                                    \\r
+    wxPROPERTY_GETTER( pname, class_t, type, getter )                                 \\r
+    static wxPropertyGetter##pname _getter##pname;                                    \\r
+    static wxPropertyAccessor _accessor##pname( &_setter##pname,                      \\r
+                                                &_getter##pname, NULL, NULL );        \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(type).name(), &_accessor##pname,                      \\r
+            wxVariantBase(defaultValue), flags, group, help );\r
+\r
+#define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue,            \\r
+                          pflags, help, group)                                        \\r
+    wxPROPERTY_SETTER( pname, class_t, type, setter )                                 \\r
+    static wxPropertySetter##pname _setter##pname;                                    \\r
+    wxPROPERTY_GETTER( pname, class_t, type, getter )                                 \\r
+    static wxPropertyGetter##pname _getter##pname;                                    \\r
+    static wxPropertyAccessor _accessor##pname( &_setter##pname,                      \\r
+                                                &_getter##pname, NULL, NULL );        \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(flags).name(), &_accessor##pname,                     \\r
+            wxVariantBase(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group );\r
+\r
+#define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group)    \\r
+    wxPROPERTY_GETTER( pname, class_t, type, getter )                                 \\r
+    static wxPropertyGetter##pname _getter##pname;                                    \\r
+    static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL );  \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(type).name(),&_accessor##pname,                       \\r
+            wxVariantBase(defaultValue), flags, help, group );\r
+\r
+#define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue,           \\r
+                                   pflags, help, group)                               \\r
+    wxPROPERTY_GETTER( pname, class_t, type, getter )                                 \\r
+    static wxPropertyGetter##pname _getter##pname;                                    \\r
+    static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL );  \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(flags).name(),&_accessor##pname,                      \\r
+            wxVariantBase(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group );\r
+\r
+#define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter,           \\r
+                               flags, help, group )                                   \\r
+    wxPROPERTY_COLLECTION_ADDER( pname, class_t, addelemtype, adder )                 \\r
+    static wxPropertyCollectionAdder##pname _adder##pname;                            \\r
+    wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter )                  \\r
+    static wxPropertyCollectionGetter##pname _collectionGetter##pname;                \\r
+    static wxPropertyAccessor _accessor##pname( NULL, NULL,&_adder##pname,            \\r
+                                                &_collectionGetter##pname );          \\r
+    static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \\r
+            wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(),          \\r
+            &_accessor##pname, flags, help, group );\r
+\r
+#define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter,         \\r
+                                        flags, help, group)                           \\r
+    wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter )                  \\r
+    static wxPropertyCollectionGetter##pname _collectionGetter##pname;                \\r
+    static wxPropertyAccessor _accessor##pname( NULL, NULL, NULL,                     \\r
+                                                &_collectionGetter##pname );          \\r
+    static wxPropertyInfo _propertyInfo##pname( first,class_t::GetClassInfoStatic(),  \\r
+        wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(),              \\r
+        &_accessor##pname, flags, help, group  );\r
+\r
+#define wxEVENT_PROPERTY( name, eventType, eventClass )                               \\r
+    static wxEventSourceTypeInfo _typeInfo##name( eventType, CLASSINFO( eventClass ) );  \\r
+    static wxPropertyInfo _propertyInfo##name( first,class_t::GetClassInfoStatic(),   \\r
+        wxT(#name), &_typeInfo##name, NULL, wxVariantBase() );\r
+\r
+#define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass )          \\r
+    static wxEventSourceTypeInfo _typeInfo##name( eventType, lastEventType,              \\r
+                                               CLASSINFO( eventClass ) );             \\r
+    static wxPropertyInfo _propertyInfo##name( first, class_t::GetClassInfoStatic(),  \\r
+        wxT(#name), &_typeInfo##name, NULL, wxVariantBase() );\r
+\r
+// ----------------------------------------------------------------------------\r
+// Implementation Helper for Simple Properties\r
+// ----------------------------------------------------------------------------\r
+\r
+#define wxIMPLEMENT_PROPERTY(name, type)                \\r
+private:                                                \\r
+    type m_##name;                                      \\r
+public:                                                 \\r
+  void  Set##name( type const & p) { m_##name = p; }    \\r
+  type const & Get##name() const  { return m_##name; }\r
+\r
+#endif      // wxUSE_EXTENDED_RTTI\r
+#endif      // _XTIPROP_H_\r
diff --git a/include/wx/xtitypes.h b/include/wx/xtitypes.h
new file mode 100644 (file)
index 0000000..81331a8
--- /dev/null
@@ -0,0 +1,581 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        wx/xtitypes.h\r
+// Purpose:     enum, set, basic types support\r
+// Author:      Stefan Csomor\r
+// Modified by: Francesco Montorsi\r
+// Created:     27/07/03\r
+// RCS-ID:      $Id: xti.h 47299 2007-07-10 15:58:27Z FM $\r
+// Copyright:   (c) 1997 Julian Smart\r
+//              (c) 2003 Stefan Csomor\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _XTITYPES_H_\r
+#define _XTITYPES_H_\r
+\r
+#include "wx/defs.h"\r
+\r
+#if wxUSE_EXTENDED_RTTI\r
+\r
+#include "wx/string.h"\r
+#include "wx/hashmap.h"\r
+#include "wx/arrstr.h"\r
+#include "wx/flags.h"\r
+#include "wx/intl.h"\r
+#include "wx/log.h"\r
+#include <typeinfo>\r
+\r
+class WXDLLIMPEXP_BASE wxClassInfo;\r
+\r
+// ----------------------------------------------------------------------------\r
+// Enum Support\r
+//\r
+// In the header files XTI requires no change from pure c++ code, however in the\r
+// implementation, an enum needs to be enumerated eg:\r
+//\r
+// wxBEGIN_ENUM( wxFlavor )\r
+//   wxENUM_MEMBER( Vanilla )\r
+//   wxENUM_MEMBER( Chocolate )\r
+//   wxENUM_MEMBER( Strawberry )\r
+// wxEND_ENUM( wxFlavor )\r
+// ----------------------------------------------------------------------------\r
+\r
+struct WXDLLIMPEXP_BASE wxEnumMemberData\r
+{\r
+    const wxChar*   m_name;\r
+    int             m_value;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxEnumData\r
+{\r
+public:\r
+    wxEnumData( wxEnumMemberData* data );\r
+\r
+    // returns true if the member has been found and sets the int value\r
+    // pointed to accordingly (if ptr != null )\r
+    // if not found returns false, value left unchanged\r
+    bool HasEnumMemberValue( const wxChar *name, int *value = NULL ) const;\r
+\r
+    // returns the value of the member, if not found in debug mode an\r
+    // assert is issued, in release 0 is returned\r
+    int GetEnumMemberValue(const wxChar *name ) const;\r
+\r
+    // returns the name of the enum member having the passed in value\r
+    // returns an emtpy string if not found\r
+    const wxChar *GetEnumMemberName(int value) const;\r
+\r
+    // returns the number of members in this enum\r
+    int GetEnumCount() const { return m_count; }\r
+\r
+    // returns the value of the nth member\r
+    int GetEnumMemberValueByIndex( int n ) const;\r
+\r
+    // returns the value of the nth member\r
+    const wxChar *GetEnumMemberNameByIndex( int n ) const;\r
+\r
+private:\r
+    wxEnumMemberData *m_members;\r
+    int m_count;\r
+};\r
+\r
+#define wxBEGIN_ENUM( e ) \\r
+    wxEnumMemberData s_enumDataMembers##e[] = {\r
+\r
+#define wxENUM_MEMBER( v ) { wxT(#v), v },\r
+\r
+#define wxEND_ENUM( e )                                                 \\r
+        { NULL, 0 } };                                                 \\r
+    wxEnumData s_enumData##e( s_enumDataMembers##e );                   \\r
+    wxEnumData *wxGetEnumData(e) { return &s_enumData##e; }             \\r
+    template<> void wxStringReadValue(const wxString& s, e &data )     \\r
+        { data = (e) s_enumData##e.GetEnumMemberValue(s); }             \\r
+    template<> void wxStringWriteValue(wxString &s, const e &data )    \\r
+        { s = s_enumData##e.GetEnumMemberName((int)data); }             \\r
+    void FromLong##e( long data, wxVariantBase& result )                  \\r
+        { result = wxVariantBase((e)data); }                               \\r
+    void ToLong##e( const wxVariantBase& data, long &result )             \\r
+        { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, e); }      \\r
+                                                                        \\r
+    wxTO_STRING_IMP( e )                                                \\r
+    wxFROM_STRING_IMP( e )                                              \\r
+    wxEnumTypeInfo s_typeInfo##e(wxT_ENUM, &s_enumData##e,            \\r
+            &wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e,      \\r
+            &FromLong##e, typeid(e).name() );\r
+\r
+\r
+// ----------------------------------------------------------------------------\r
+// Set Support\r
+//\r
+// in the header :\r
+//\r
+// enum wxFlavor\r
+// {\r
+//  Vanilla,\r
+//  Chocolate,\r
+//  Strawberry,\r
+// };\r
+//\r
+// typedef wxBitset<wxFlavor> wxCoupe;\r
+//\r
+// in the implementation file :\r
+//\r
+// wxBEGIN_ENUM( wxFlavor )\r
+//  wxENUM_MEMBER( Vanilla )\r
+//  wxENUM_MEMBER( Chocolate )\r
+//  wxENUM_MEMBER( Strawberry )\r
+// wxEND_ENUM( wxFlavor )\r
+//\r
+// wxIMPLEMENT_SET_STREAMING( wxCoupe, wxFlavor )\r
+//\r
+// implementation note: no partial specialization for streaming, but a delegation \r
+//                      to a different class\r
+//\r
+// ----------------------------------------------------------------------------\r
+\r
+// in order to remove dependancy on string tokenizer\r
+void WXDLLIMPEXP_BASE wxSetStringToArray( const wxString &s, wxArrayString &array );\r
+\r
+template<typename e>\r
+void wxSetFromString(const wxString &s, wxBitset<e> &data )\r
+{\r
+    wxEnumData* edata = wxGetEnumData((e) 0);\r
+    data.reset();\r
+\r
+    wxArrayString array;\r
+    wxSetStringToArray( s, array );\r
+    wxString flag;\r
+    for ( int i = 0; i < array.Count(); ++i )\r
+    {\r
+        flag = array[i];\r
+        int ivalue;\r
+        if ( edata->HasEnumMemberValue( flag, &ivalue ) )\r
+        {\r
+            data.set( (e) ivalue );\r
+        }\r
+    }\r
+}\r
+\r
+template<typename e>\r
+void wxSetToString( wxString &s, const wxBitset<e> &data )\r
+{\r
+    wxEnumData* edata = wxGetEnumData((e) 0);\r
+    int count = edata->GetEnumCount();\r
+    int i;\r
+    s.Clear();\r
+    for ( i = 0; i < count; i++ )\r
+    {\r
+        e value = (e) edata->GetEnumMemberValueByIndex(i);\r
+        if ( data.test( value ) )\r
+        {\r
+            // this could also be done by the templated calls\r
+            if ( !s.empty() )\r
+                s += wxT("|");\r
+            s += edata->GetEnumMemberNameByIndex(i);\r
+        }\r
+    }\r
+}\r
+\r
+#define wxIMPLEMENT_SET_STREAMING(SetName,e)                                    \\r
+    template<> void wxStringReadValue(const wxString &s, wxBitset<e> &data )   \\r
+        { wxSetFromString( s, data ); }                                        \\r
+    template<> void wxStringWriteValue( wxString &s, const wxBitset<e> &data ) \\r
+        { wxSetToString( s, data ); }                                          \\r
+    void FromLong##SetName( long data, wxVariantBase& result )                    \\r
+        { result = wxVariantBase(SetName((unsigned long)data)); }                  \\r
+    void ToLong##SetName( const wxVariantBase& data, long &result )               \\r
+        { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, SetName).to_ulong(); } \\r
+    wxTO_STRING_IMP( SetName )                                                  \\r
+    wxFROM_STRING_IMP( SetName )                                                \\r
+    wxEnumTypeInfo s_typeInfo##SetName(wxT_SET, &s_enumData##e,               \\r
+            &wxTO_STRING( SetName ), &wxFROM_STRING( SetName ),               \\r
+            &ToLong##SetName, &FromLong##SetName, typeid(SetName).name() );\r
+\r
+template<typename e>\r
+void wxFlagsFromString(const wxString &s, e &data )\r
+{\r
+    wxEnumData* edata = wxGetEnumData((e*) 0);\r
+    data.m_data = 0;\r
+\r
+    wxArrayString array;\r
+    wxSetStringToArray( s, array );\r
+    wxString flag;\r
+    for ( size_t i = 0; i < array.Count(); ++i )\r
+    {\r
+        flag = array[i];\r
+        int ivalue;\r
+        if ( edata->HasEnumMemberValue( flag, &ivalue ) )\r
+        {\r
+            data.m_data |= ivalue;\r
+        }\r
+    }\r
+}\r
+\r
+template<typename e>\r
+void wxFlagsToString( wxString &s, const e& data )\r
+{\r
+    wxEnumData* edata = wxGetEnumData((e*) 0);\r
+    int count = edata->GetEnumCount();\r
+    int i;\r
+    s.Clear();\r
+    long dataValue = data.m_data;\r
+    for ( i = 0; i < count; i++ )\r
+    {\r
+        int value = edata->GetEnumMemberValueByIndex(i);\r
+        // make this to allow for multi-bit constants to work\r
+        if ( value && ( dataValue & value ) == value )\r
+        {\r
+            // clear the flags we just set\r
+            dataValue &= ~value;\r
+            // this could also be done by the templated calls\r
+            if ( !s.empty() )\r
+                s +=wxT("|");\r
+            s += edata->GetEnumMemberNameByIndex(i);\r
+        }\r
+    }\r
+}\r
+\r
+#define wxBEGIN_FLAGS( e ) \\r
+    wxEnumMemberData s_enumDataMembers##e[] = {\r
+\r
+#define wxFLAGS_MEMBER( v ) { wxT(#v), v },\r
+\r
+#define wxEND_FLAGS( e )                                                \\r
+        { NULL, 0 } };                                                 \\r
+    wxEnumData s_enumData##e( s_enumDataMembers##e );                   \\r
+    wxEnumData *wxGetEnumData(e*) { return &s_enumData##e; }            \\r
+    template<>  void wxStringReadValue(const wxString &s, e &data )    \\r
+        { wxFlagsFromString<e>( s, data ); }                           \\r
+    template<>  void wxStringWriteValue( wxString &s, const e& data )  \\r
+        { wxFlagsToString<e>( s, data ); }                             \\r
+    void FromLong##e( long data, wxVariantBase& result )                  \\r
+        { result = wxVariantBase(e(data)); }                               \\r
+    void ToLong##e( const wxVariantBase& data, long &result )             \\r
+        { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, e).m_data; } \\r
+    wxTO_STRING_IMP( e )                                                \\r
+    wxFROM_STRING_IMP( e )                                              \\r
+    wxEnumTypeInfo s_typeInfo##e(wxT_SET, &s_enumData##e,             \\r
+            &wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e,      \\r
+            &FromLong##e, typeid(e).name() );\r
+\r
+// ----------------------------------------------------------------------------\r
+// Type Information\r
+// ----------------------------------------------------------------------------\r
+\r
+//  All data exposed by the RTTI is characterized using the following classes.\r
+//  The first characterization is done by wxTypeKind. All enums up to and including\r
+//  wxT_CUSTOM represent so called simple types. These cannot be divided any further.\r
+//  They can be converted to and from wxStrings, that's all.\r
+//  Other wxTypeKinds can instead be splitted recursively into smaller parts until\r
+//  the simple types are reached.\r
+\r
+enum wxTypeKind\r
+{\r
+    wxT_VOID = 0,   // unknown type\r
+    wxT_BOOL,\r
+    wxT_CHAR,\r
+    wxT_UCHAR,\r
+    wxT_INT,\r
+    wxT_UINT,\r
+    wxT_LONG,\r
+    wxT_ULONG,\r
+    wxT_FLOAT,\r
+    wxT_DOUBLE,\r
+    wxT_STRING,     // must be wxString\r
+    wxT_SET,        // must be wxBitset<> template\r
+    wxT_ENUM,\r
+    wxT_CUSTOM,     // user defined type (e.g. wxPoint)\r
+\r
+    wxT_LAST_SIMPLE_TYPE_KIND = wxT_CUSTOM,\r
+\r
+    wxT_OBJECT_PTR, // object reference\r
+    wxT_OBJECT,     // embedded object\r
+    wxT_COLLECTION, // collection\r
+\r
+    wxT_DELEGATE,   // for connecting against an event source\r
+\r
+    wxT_LAST_TYPE_KIND = wxT_DELEGATE // sentinel for bad data, asserts, debugging\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxVariantBase;\r
+class WXDLLIMPEXP_BASE wxTypeInfo;\r
+\r
+WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxTypeInfo*, wxTypeInfoMap, class WXDLLIMPEXP_BASE );\r
+\r
+class WXDLLIMPEXP_BASE wxTypeInfo\r
+{\r
+public:\r
+    typedef void (*wxVariant2StringFnc)( const wxVariantBase& data, wxString &result );\r
+    typedef void (*wxString2VariantFnc)( const wxString& data, wxVariantBase &result );\r
+\r
+    wxTypeInfo(wxTypeKind kind,\r
+               wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL,\r
+               const wxString &name = wxEmptyString):\r
+            m_toString(to), m_fromString(from), m_kind(kind), m_name(name)\r
+    {\r
+        Register();\r
+    }\r
+#if wxUSE_UNICODE\r
+    wxTypeInfo(wxTypeKind kind,\r
+               wxVariant2StringFnc to, wxString2VariantFnc from,\r
+               const char *name):\r
+            m_toString(to), m_fromString(from), m_kind(kind), \r
+            m_name(wxString::FromAscii(name))\r
+    {\r
+        Register();\r
+    }\r
+#endif\r
+\r
+    virtual ~wxTypeInfo()\r
+    {\r
+        Unregister();\r
+    }\r
+\r
+    // return the kind of this type (wxT_... constants)\r
+    wxTypeKind GetKind() const { return m_kind; }\r
+\r
+    // returns the unique name of this type\r
+    const wxString& GetTypeName() const { return m_name; }\r
+\r
+    // is this type a delegate type\r
+    bool IsDelegateType() const { return m_kind == wxT_DELEGATE; }\r
+\r
+    // is this type a custom type\r
+    bool IsCustomType() const { return m_kind == wxT_CUSTOM; }\r
+\r
+    // is this type an object type\r
+    bool IsObjectType() const { return m_kind == wxT_OBJECT || m_kind == wxT_OBJECT_PTR; }\r
+\r
+    // can the content of this type be converted to and from strings ?\r
+    bool HasStringConverters() const { return m_toString != NULL && m_fromString != NULL; }\r
+\r
+    // convert a wxVariantBase holding data of this type into a string\r
+    void ConvertToString( const wxVariantBase& data, wxString &result ) const\r
+    { \r
+        if ( m_toString ) \r
+            (*m_toString)( data, result ); \r
+        else \r
+            wxLogError( wxGetTranslation(_T("String conversions not supported")) ); \r
+    }\r
+\r
+    // convert a string into a wxVariantBase holding the corresponding data in this type\r
+    void ConvertFromString( const wxString& data, wxVariantBase &result ) const\r
+    { \r
+        if( m_fromString ) \r
+            (*m_fromString)( data, result ); \r
+        else \r
+            wxLogError( wxGetTranslation(_T("String conversions not supported")) ); \r
+    }\r
+\r
+    // statics:\r
+\r
+#if wxUSE_UNICODE\r
+    static wxTypeInfo *FindType(const char *typeName) \r
+        { return FindType( wxString::FromAscii(typeName) ); }\r
+#endif\r
+    static wxTypeInfo *FindType(const wxChar *typeName);\r
+    static wxTypeInfo *FindType(const wxString& typeName)\r
+        {\r
+#if wxUSE_UNICODE\r
+            return FindType( typeName.wchar_str() );\r
+#else\r
+            return FindType( typeName.char_str() );\r
+#endif\r
+        }\r
+\r
+private:\r
+    void Register();\r
+    void Unregister();\r
+\r
+    wxVariant2StringFnc m_toString;\r
+    wxString2VariantFnc m_fromString;\r
+\r
+    wxTypeKind m_kind;\r
+    wxString m_name;\r
+\r
+    // the static list of all types we know about\r
+    static wxTypeInfoMap* ms_typeTable;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxBuiltInTypeInfo : public wxTypeInfo\r
+{\r
+public:\r
+    wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to = NULL, \r
+                       wxString2VariantFnc from = NULL, \r
+                       const wxString &name = wxEmptyString ) :\r
+            wxTypeInfo( kind, to, from, name )\r
+       { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); }\r
+\r
+#if wxUSE_UNICODE\r
+    wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to, \r
+                       wxString2VariantFnc from , const char *name  ) :\r
+            wxTypeInfo( kind, to, from, name )\r
+       { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); }\r
+#endif\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxCustomTypeInfo : public wxTypeInfo\r
+{\r
+public:\r
+    wxCustomTypeInfo( const wxString &name, wxVariant2StringFnc to, \r
+                      wxString2VariantFnc from ) :\r
+            wxTypeInfo( wxT_CUSTOM, to, from, name )\r
+       {}\r
+\r
+#if wxUSE_UNICODE\r
+    wxCustomTypeInfo( const char *name , wxVariant2StringFnc to, \r
+                      wxString2VariantFnc from ) :\r
+            wxTypeInfo( wxT_CUSTOM, to, from, name )\r
+       {}\r
+#endif\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxEnumTypeInfo : public wxTypeInfo\r
+{\r
+public:\r
+    typedef void (*converterToLong_t)( const wxVariantBase& data, long &result );\r
+    typedef void (*converterFromLong_t)( long data, wxVariantBase &result );\r
+\r
+    wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to,\r
+                    wxString2VariantFnc from, converterToLong_t toLong,\r
+                    converterFromLong_t fromLong, const wxString &name  ) :\r
+        wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong )\r
+    { \r
+        wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET,\r
+                      wxT("Illegal Kind for Enum Type")); \r
+        m_enumInfo = enumInfo; \r
+    }\r
+\r
+#if wxUSE_UNICODE\r
+    wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to,\r
+                    wxString2VariantFnc from, converterToLong_t toLong,\r
+                    converterFromLong_t fromLong, const char * name ) :\r
+        wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong )\r
+    {\r
+        wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET, \r
+                      wxT("Illegal Kind for Enum Type")); \r
+        m_enumInfo = enumInfo; \r
+    }\r
+#endif\r
+    const wxEnumData* GetEnumData() const { return m_enumInfo; }\r
+\r
+    // convert a wxVariantBase holding data of this type into a long\r
+    void ConvertToLong( const wxVariantBase& data, long &result ) const\r
+    { \r
+        if( m_toLong ) \r
+            (*m_toLong)( data, result ); \r
+        else \r
+            wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ); \r
+    }\r
+\r
+    // convert a long into a wxVariantBase holding the corresponding data in this type\r
+    void ConvertFromLong( long data, wxVariantBase &result ) const\r
+    { \r
+        if( m_fromLong ) \r
+            (*m_fromLong)( data, result ); \r
+        else \r
+            wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ); \r
+    }\r
+\r
+private:\r
+    converterToLong_t m_toLong;\r
+    converterFromLong_t m_fromLong;\r
+\r
+    wxEnumData *m_enumInfo; // Kind == wxT_ENUM or Kind == wxT_SET\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxClassTypeInfo : public wxTypeInfo\r
+{\r
+public:\r
+    wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, \r
+                     wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL, \r
+                     const wxString &name = wxEmptyString);\r
+\r
+#if wxUSE_UNICODE\r
+    wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, wxVariant2StringFnc to,\r
+                     wxString2VariantFnc from , const char *name );\r
+#endif\r
+\r
+    const wxClassInfo *GetClassInfo() const { return m_classInfo; }\r
+\r
+private:\r
+    wxClassInfo *m_classInfo; // Kind == wxT_OBJECT - could be NULL\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxCollectionTypeInfo : public wxTypeInfo\r
+{\r
+public:\r
+    wxCollectionTypeInfo( const wxString &elementName, wxVariant2StringFnc to,\r
+                          wxString2VariantFnc from , const wxString &name) :\r
+            wxTypeInfo( wxT_COLLECTION, to, from, name )\r
+       { m_elementTypeName = elementName; m_elementType = NULL; }\r
+\r
+#if wxUSE_UNICODE\r
+    wxCollectionTypeInfo( const char *elementName, wxVariant2StringFnc to, \r
+                          wxString2VariantFnc from , const char *name ) :\r
+            wxTypeInfo( wxT_COLLECTION, to, from, name )\r
+       { m_elementTypeName = wxString::FromAscii( elementName ); m_elementType = NULL; }\r
+#endif\r
+\r
+    const wxTypeInfo* GetElementType() const\r
+    {\r
+        if ( m_elementType == NULL )\r
+            m_elementType = wxTypeInfo::FindType( m_elementTypeName );\r
+        return m_elementType; \r
+    }\r
+\r
+private:\r
+    mutable wxTypeInfo * m_elementType;\r
+    wxString    m_elementTypeName;\r
+};\r
+\r
+class WXDLLIMPEXP_BASE wxEventSourceTypeInfo : public wxTypeInfo\r
+{\r
+public:\r
+    wxEventSourceTypeInfo( int eventType, wxClassInfo* eventClass, \r
+                        wxVariant2StringFnc to = NULL, \r
+                        wxString2VariantFnc from = NULL );\r
+    wxEventSourceTypeInfo( int eventType, int lastEventType, wxClassInfo* eventClass, \r
+                        wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL );\r
+\r
+    int GetEventType() const { return m_eventType; }\r
+    int GetLastEventType() const { return m_lastEventType; }\r
+    const wxClassInfo* GetEventClass() const { return m_eventClass; }\r
+\r
+private:\r
+    const wxClassInfo *m_eventClass; // (extended will merge into classinfo)\r
+    int m_eventType;\r
+    int m_lastEventType;\r
+};\r
+\r
+template<typename T> const wxTypeInfo* wxGetTypeInfo( T * ) \\r
+    { return wxTypeInfo::FindType(typeid(T).name()); }\r
+\r
+// this macro is for usage with custom, non-object derived classes and structs, \r
+// wxPoint is such a custom type\r
+\r
+#if wxUSE_FUNC_TEMPLATE_POINTER\r
+    #define wxCUSTOM_TYPE_INFO( e, toString, fromString ) \\r
+        wxCustomTypeInfo s_typeInfo##e(typeid(e).name(), &toString, &fromString);\r
+#else\r
+    #define wxCUSTOM_TYPE_INFO( e, toString, fromString )             \\r
+        void ToString##e( const wxVariantBase& data, wxString &result )   \\r
+            { toString(data, result); }                                 \\r
+        void FromString##e( const wxString& data, wxVariantBase &result ) \\r
+            { fromString(data, result); }                               \\r
+        wxCustomTypeInfo s_typeInfo##e(typeid(e).name(),               \\r
+                                       &ToString##e, &FromString##e);\r
+#endif\r
+\r
+#define wxCOLLECTION_TYPE_INFO( element, collection )                      \\r
+    wxCollectionTypeInfo s_typeInfo##collection( typeid(element).name(),   \\r
+                                NULL, NULL, typeid(collection).name() );\r
+\r
+// sometimes a compiler invents specializations that are nowhere called, \r
+// use this macro to satisfy the refs, currently we don't have to play \r
+// tricks, but if we will have to according to the compiler, we will use \r
+// that macro for that\r
+\r
+#define wxILLEGAL_TYPE_SPECIALIZATION( a )\r
+\r
+#endif      // wxUSE_EXTENDED_RTTI\r
+#endif      // _XTITYPES_H_\r
diff --git a/samples/xti/Makefile.in b/samples/xti/Makefile.in
new file mode 100644 (file)
index 0000000..7f3fdea
--- /dev/null
@@ -0,0 +1,204 @@
+# =========================================================================
+#     This makefile was generated by
+#     Bakefile 0.2.2 (http://www.bakefile.org)
+#     Do not modify, all changes will be overwritten!
+# =========================================================================
+
+
+@MAKE_SET@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+INSTALL = @INSTALL@
+EXEEXT = @EXEEXT@
+WINDRES = @WINDRES@
+REZ = @REZ@
+SETFILE = @SETFILE@
+NM = @NM@
+BK_DEPS = @BK_DEPS@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+LIBS = @LIBS@
+LDFLAGS_GUI = @LDFLAGS_GUI@
+CXX = @CXX@
+CXXFLAGS = @CXXFLAGS@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+WX_LIB_FLAVOUR = @WX_LIB_FLAVOUR@
+TOOLKIT = @TOOLKIT@
+TOOLKIT_LOWERCASE = @TOOLKIT_LOWERCASE@
+TOOLKIT_VERSION = @TOOLKIT_VERSION@
+TOOLCHAIN_FULLNAME = @TOOLCHAIN_FULLNAME@
+EXTRALIBS = @EXTRALIBS@
+EXTRALIBS_XML = @EXTRALIBS_XML@
+EXTRALIBS_GUI = @EXTRALIBS_GUI@
+CXXWARNINGS = @CXXWARNINGS@
+HOST_SUFFIX = @HOST_SUFFIX@
+SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@
+SAMPLES_RPATH_POSTLINK = @SAMPLES_RPATH_POSTLINK@
+wx_top_builddir = @wx_top_builddir@
+
+### Variables: ###
+
+DESTDIR = 
+WX_RELEASE = 2.9
+WX_VERSION = $(WX_RELEASE).0
+LIBDIRNAME = $(wx_top_builddir)/lib
+XTI_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
+       $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \
+       -I$(srcdir) $(__DLLFLAG_p) -I$(srcdir)/../../samples $(CXXWARNINGS) \
+       $(CPPFLAGS) $(CXXFLAGS)
+XTI_OBJECTS =  \
+       $(__xti___win32rc) \
+       $(__xti_os2_lib_res) \
+       xti_xti.o \
+       xti_classlist.o \
+       xti_codereadercallback.o
+
+### Conditionally set variables: ###
+
+@COND_DEPS_TRACKING_0@CXXC = $(CXX)
+@COND_DEPS_TRACKING_1@CXXC = $(BK_DEPS) $(CXX)
+@COND_USE_GUI_0@PORTNAME = base
+@COND_USE_GUI_1@PORTNAME = $(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)
+@COND_TOOLKIT_MAC@WXBASEPORT = _carbon
+@COND_BUILD_DEBUG_DEBUG_FLAG_DEFAULT@WXDEBUGFLAG = d
+@COND_DEBUG_FLAG_1@WXDEBUGFLAG = d
+@COND_UNICODE_1@WXUNICODEFLAG = u
+@COND_WXUNIV_1@WXUNIVNAME = univ
+@COND_MONOLITHIC_0@EXTRALIBS_FOR_BASE = $(EXTRALIBS)
+@COND_MONOLITHIC_1@EXTRALIBS_FOR_BASE = $(EXTRALIBS) $(EXTRALIBS_GUI)
+@COND_MONOLITHIC_0@EXTRALIBS_FOR_GUI = $(EXTRALIBS_GUI)
+@COND_MONOLITHIC_1@EXTRALIBS_FOR_GUI = 
+@COND_PLATFORM_MAC_1@__xti___mac_setfilecmd = $(SETFILE) -a C xti$(EXEEXT)
+@COND_PLATFORM_MAC_1@__xti___mac_rezcmd = $(__MACOSX_RESOURCES_p_1)
+@COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
+@COND_WXUNIV_1@__WXUNIV_DEFINE_p_1 = -d __WXUNIVERSAL__
+@COND_WXUNIV_1@__WXUNIV_DEFINE_p_2 = --define __WXUNIVERSAL__
+@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS
+@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p_1 = -d wxNO_EXCEPTIONS
+@COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p_2 = --define wxNO_EXCEPTIONS
+@COND_USE_RTTI_0@__RTTI_DEFINE_p = -DwxNO_RTTI
+@COND_USE_RTTI_0@__RTTI_DEFINE_p_1 = -d wxNO_RTTI
+@COND_USE_RTTI_0@__RTTI_DEFINE_p_2 = --define wxNO_RTTI
+@COND_USE_THREADS_0@__THREAD_DEFINE_p = -DwxNO_THREADS
+@COND_USE_THREADS_0@__THREAD_DEFINE_p_1 = -d wxNO_THREADS
+@COND_USE_THREADS_0@__THREAD_DEFINE_p_2 = --define wxNO_THREADS
+@COND_SHARED_1@__DLLFLAG_p = -DWXUSINGDLL
+@COND_SHARED_1@__DLLFLAG_p_1 = -d WXUSINGDLL
+@COND_SHARED_1@__DLLFLAG_p_2 = --define WXUSINGDLL
+COND_PLATFORM_OS2_1___xti___os2_emxbindcmd = $(NM) xti$(EXEEXT) | if grep -q \
+       pmwin.763 ; then emxbind -ep xti$(EXEEXT) ; fi
+@COND_PLATFORM_OS2_1@__xti___os2_emxbindcmd = $(COND_PLATFORM_OS2_1___xti___os2_emxbindcmd)
+@COND_TOOLKIT_MSW@__RCDEFDIR_p = -i \
+@COND_TOOLKIT_MSW@     $(LIBDIRNAME)/wx/include/$(TOOLCHAIN_FULLNAME)
+@COND_TOOLKIT_MSW@__RCDEFDIR_p_1 = --include-dir \
+@COND_TOOLKIT_MSW@     $(LIBDIRNAME)/wx/include/$(TOOLCHAIN_FULLNAME)
+@COND_PLATFORM_WIN32_1@__xti___win32rc = xti_sample_rc.o
+@COND_PLATFORM_OS2_1@__xti_os2_lib_res = \
+@COND_PLATFORM_OS2_1@  $(top_srcdir)/include/wx/os2/wx.res
+@COND_PLATFORM_MACOSX_1@__xti_bundle___depname = xti_bundle
+@COND_TOOLKIT_COCOA@____xti_BUNDLE_TGT_REF_DEP = xti.app/Contents/PkgInfo
+@COND_TOOLKIT_MAC@____xti_BUNDLE_TGT_REF_DEP = xti.app/Contents/PkgInfo
+COND_MONOLITHIC_0___WXLIB_CORE_p = \
+       -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_MONOLITHIC_0@__WXLIB_CORE_p = $(COND_MONOLITHIC_0___WXLIB_CORE_p)
+COND_MONOLITHIC_0___WXLIB_XML_p = \
+       -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_xml-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_MONOLITHIC_0@__WXLIB_XML_p = $(COND_MONOLITHIC_0___WXLIB_XML_p)
+COND_MONOLITHIC_0___WXLIB_BASE_p = \
+       -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_MONOLITHIC_0@__WXLIB_BASE_p = $(COND_MONOLITHIC_0___WXLIB_BASE_p)
+COND_MONOLITHIC_1___WXLIB_MONO_p = \
+       -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_MONOLITHIC_1@__WXLIB_MONO_p = $(COND_MONOLITHIC_1___WXLIB_MONO_p)
+@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@__LIB_TIFF_p \
+@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@ = \
+@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@ -lwxtiff$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@__LIB_JPEG_p \
+@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@ = \
+@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@ -lwxjpeg$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@__LIB_PNG_p \
+@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@  = \
+@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@  -lwxpng$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_WXUSE_ZLIB_BUILTIN@__LIB_ZLIB_p = \
+@COND_WXUSE_ZLIB_BUILTIN@      -lwxzlib$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_WXUSE_ODBC_BUILTIN@__LIB_ODBC_p = \
+@COND_WXUSE_ODBC_BUILTIN@      -lwxodbc$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+COND_WXUSE_REGEX_BUILTIN___LIB_REGEX_p = \
+       -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+@COND_WXUSE_REGEX_BUILTIN@__LIB_REGEX_p = $(COND_WXUSE_REGEX_BUILTIN___LIB_REGEX_p)
+@COND_WXUSE_EXPAT_BUILTIN@__LIB_EXPAT_p = \
+@COND_WXUSE_EXPAT_BUILTIN@     -lwxexpat$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)
+COND_TOOLKIT_MAC___MACOSX_RESOURCES_p_1 = $(REZ) -d __DARWIN__ -t APPL -d \
+       __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) \
+       $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) -i $(srcdir) $(__DLLFLAG_p_1) -i \
+       $(srcdir)/../../samples $(__RCDEFDIR_p) -i $(top_srcdir)/include -o \
+       xti$(EXEEXT) Carbon.r sample.r
+@COND_TOOLKIT_MAC@__MACOSX_RESOURCES_p_1 = $(COND_TOOLKIT_MAC___MACOSX_RESOURCES_p_1)
+
+### Targets: ###
+
+all: xti$(EXEEXT) $(__xti_bundle___depname)
+
+install: all
+
+uninstall: 
+
+install-strip: install
+
+clean: 
+       rm -rf ./.deps ./.pch
+       rm -f ./*.o
+       rm -f xti$(EXEEXT)
+       rm -rf xti.app
+
+distclean: clean
+       rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
+
+xti$(EXEEXT): $(XTI_OBJECTS) $(__xti___win32rc)
+       $(CXX) -o $@ $(XTI_OBJECTS) $(LDFLAGS)   -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(SAMPLES_RPATH_FLAG)  $(LIBS) $(__WXLIB_CORE_p)  $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_BASE_p)  $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE)
+       $(__xti___mac_rezcmd)
+       $(__xti___mac_setfilecmd)
+       $(__xti___os2_emxbindcmd)
+       $(SAMPLES_RPATH_POSTLINK)
+
+xti.app/Contents/PkgInfo: xti$(EXEEXT) $(top_srcdir)/src/mac/carbon/Info.plist.in $(top_srcdir)/src/mac/carbon/wxmac.icns
+       mkdir -p xti.app/Contents
+       mkdir -p xti.app/Contents/MacOS
+       mkdir -p xti.app/Contents/Resources
+       
+       
+       sed -e "s/IDENTIFIER/`echo $(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`/" \
+       -e "s/EXECUTABLE/xti/" \
+       -e "s/VERSION/$(WX_VERSION)/" \
+       $(top_srcdir)/src/mac/carbon/Info.plist.in >xti.app/Contents/Info.plist
+       
+       
+       echo -n "APPL????" >xti.app/Contents/PkgInfo
+       
+       
+       ln -f xti$(EXEEXT) xti.app/Contents/MacOS/xti
+       
+       
+       cp -f $(top_srcdir)/src/mac/carbon/wxmac.icns xti.app/Contents/Resources/wxmac.icns
+
+@COND_PLATFORM_MACOSX_1@xti_bundle: $(____xti_BUNDLE_TGT_REF_DEP)
+
+xti_sample_rc.o: $(srcdir)/../../samples/sample.rc
+       $(WINDRES) -i$< -o$@    --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_2)  $(__EXCEPTIONS_DEFINE_p_2) $(__RTTI_DEFINE_p_2) $(__THREAD_DEFINE_p_2)   --include-dir $(srcdir) $(__DLLFLAG_p_2) --include-dir $(srcdir)/../../samples $(__RCDEFDIR_p_1) --include-dir $(top_srcdir)/include
+
+xti_xti.o: $(srcdir)/xti.cpp
+       $(CXXC) -c -o $@ $(XTI_CXXFLAGS) $(srcdir)/xti.cpp
+
+xti_classlist.o: $(srcdir)/classlist.cpp
+       $(CXXC) -c -o $@ $(XTI_CXXFLAGS) $(srcdir)/classlist.cpp
+
+xti_codereadercallback.o: $(srcdir)/codereadercallback.cpp
+       $(CXXC) -c -o $@ $(XTI_CXXFLAGS) $(srcdir)/codereadercallback.cpp
+
+
+# Include dependency info, if present:
+@IF_GNU_MAKE@-include .deps/*.d
+
+.PHONY: all install uninstall clean distclean xti_bundle
diff --git a/samples/xti/classlist.cpp b/samples/xti/classlist.cpp
new file mode 100644 (file)
index 0000000..2c84834
--- /dev/null
@@ -0,0 +1,560 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        classlist.cpp
+// Purpose:     ClassListDialog implementation
+// Author:      Francesco Montorsi
+// Modified by: 
+// Created:     03/06/2007 14:49:55
+// RCS-ID:      $Id: classlist.cpp 48186 2007-08-19 19:59:54Z FM $
+// Copyright:   (c) 2007 Francesco Montorsi
+// Licence:     wxWidgets license
+/////////////////////////////////////////////////////////////////////////////
+
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+#include "classlist.h"
+
+#if !wxUSE_EXTENDED_RTTI
+    #error This sample requires XTI (eXtended RTTI) enabled
+#endif
+
+// IMPLEMENT_DYNAMIC_CLASS( ClassListDialog, wxDialog )  -- see the header
+BEGIN_EVENT_TABLE( ClassListDialog, wxDialog )
+    EVT_LISTBOX( ID_LISTBOX, ClassListDialog::OnListboxSelected )
+    EVT_TREE_SEL_CHANGED( ID_TREECTRL, ClassListDialog::OnTreectrlSelChanged )
+    EVT_CHOICEBOOK_PAGE_CHANGED( ID_LISTMODE, ClassListDialog::OnChoiceBookPageChange )
+
+    EVT_CHECKBOX( ID_SHOW_ONLY_XTI, ClassListDialog::OnShowOnlyXTICheckbox )
+    EVT_CHECKBOX( ID_SHOW_PROPERTIES_RECURSIVELY, ClassListDialog::OnShowRecursiveInfoCheckbox )
+END_EVENT_TABLE()
+
+// defined later
+wxString DumpClassInfo(const wxClassInfo*, bool recursive);
+
+
+// ----------------------------------------------------------------------------
+// ClassListDialog
+// ----------------------------------------------------------------------------
+
+ClassListDialog::ClassListDialog()
+{
+    Init();
+}
+
+ClassListDialog::ClassListDialog( wxWindow* parent, wxWindowID id, 
+                                      const wxString& caption, const wxPoint& pos, 
+                                      const wxSize& size, long style )
+{
+    Init();
+    Create(parent, id, caption, pos, size, style);
+}
+
+bool ClassListDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, 
+                                const wxPoint& pos, const wxSize& size, long style )
+{
+    SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
+    wxDialog::Create( parent, id, caption, pos, size, style );
+
+    CreateControls();
+    if (GetSizer())
+    {
+        GetSizer()->SetSizeHints(this);
+    }
+    Centre();
+
+    return true;
+}
+
+ClassListDialog::~ClassListDialog()
+{
+}
+
+void ClassListDialog::Init()
+{
+    m_pClassCountText = NULL;
+    m_pRawListBox = NULL;
+    m_pParentTreeCtrl = NULL;
+    m_pSizeListBox = NULL;
+    m_pTextCtrl = NULL;
+}
+
+void ClassListDialog::CreateControls()
+{
+    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
+    this->SetSizer(itemBoxSizer2);
+
+    wxStaticText* itemStaticText3 = new wxStaticText( this, wxID_STATIC, _("This is the list of wxWidgets classes registered in the XTI system.\nNote that not all wxWidgets classes are registered nor all registered classes are completely _described_ using XTI metadata."), wxDefaultPosition, wxDefaultSize, 0 );
+    itemBoxSizer2->Add(itemStaticText3, 0, wxALIGN_LEFT|wxALL, 5);
+
+    // filters
+    wxBoxSizer* filters = new wxBoxSizer(wxHORIZONTAL);
+    itemBoxSizer2->Add(filters, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
+    filters->Add(new wxCheckBox(this, ID_SHOW_ONLY_XTI, 
+                                wxT("Show only classes with eXtended infos")));
+    filters->AddSpacer(10);
+    filters->Add(new wxCheckBox(this, ID_SHOW_PROPERTIES_RECURSIVELY,
+                                wxT("Show properties of parent classes")));
+
+    // show how many have we filtered out
+    m_pClassCountText = new wxStaticText( this, wxID_STATIC, 
+                wxT("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
+                wxDefaultPosition, wxDefaultSize, 0 );
+    m_pClassCountText->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma")));
+    itemBoxSizer2->Add(m_pClassCountText, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);
+
+    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
+    itemBoxSizer2->Add(itemBoxSizer5, 1, wxGROW, 5);
+
+    m_pChoiceBook = new wxChoicebook( this, ID_LISTMODE, wxDefaultPosition, wxDefaultSize, wxCHB_DEFAULT );
+
+    // raw-list page
+    wxPanel* itemPanel7 = new wxPanel( m_pChoiceBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
+    wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
+    itemPanel7->SetSizer(itemBoxSizer8);
+
+    wxArrayString m_pRawListBoxStrings;
+    m_pRawListBox = new wxListBox( itemPanel7, ID_LISTBOX, wxDefaultPosition, wxDefaultSize, m_pRawListBoxStrings, wxLB_SINGLE );
+    itemBoxSizer8->Add(m_pRawListBox, 1, wxGROW, 5);
+
+    m_pChoiceBook->AddPage(itemPanel7, _("Raw list"));
+
+    // by-size page
+    wxPanel* itemPanel13 = new wxPanel( m_pChoiceBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
+    wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxHORIZONTAL);
+    itemPanel13->SetSizer(itemBoxSizer14);
+
+    wxArrayString m_pSizeListBoxStrings;
+    m_pSizeListBox = new wxListBox( itemPanel13, ID_LISTBOX, wxDefaultPosition, wxDefaultSize, m_pSizeListBoxStrings, wxLB_SINGLE );
+    itemBoxSizer14->Add(m_pSizeListBox, 1, wxGROW, 5);
+
+    m_pChoiceBook->AddPage(itemPanel13, _("Classes by size"));
+
+    // tree page
+    wxPanel* itemPanel10 = new wxPanel( m_pChoiceBook, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
+    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
+    itemPanel10->SetSizer(itemBoxSizer11);
+
+    m_pParentTreeCtrl = new wxTreeCtrl( itemPanel10, ID_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_HAS_BUTTONS |wxTR_SINGLE );
+    itemBoxSizer11->Add(m_pParentTreeCtrl, 1, wxGROW, 5);
+
+    m_pChoiceBook->AddPage(itemPanel10, _("Classes by parent"));
+
+
+    itemBoxSizer5->Add(m_pChoiceBook, 0, wxGROW|wxALL, 5);
+
+    m_pTextCtrl = new wxTextCtrl( this, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(500, -1), wxTE_MULTILINE|wxTE_READONLY );
+    itemBoxSizer5->Add(m_pTextCtrl, 3, wxGROW|wxALL, 5);
+
+    wxStdDialogButtonSizer* itemStdDialogButtonSizer17 = new wxStdDialogButtonSizer;
+
+    itemBoxSizer2->Add(itemStdDialogButtonSizer17, 0, wxGROW|wxALL, 5);
+    wxButton* itemButton18 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
+    itemStdDialogButtonSizer17->AddButton(itemButton18);
+
+    wxButton* itemButton19 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
+    itemStdDialogButtonSizer17->AddButton(itemButton19);
+
+    itemStdDialogButtonSizer17->Realize();
+
+    InitControls();
+}
+
+int ClassListDialog::AddClassesWithParent(const wxClassInfo *parent, const wxTreeItemId &id)
+{
+    const wxClassInfo *ci = wxClassInfo::GetFirst();
+    int count = 0;
+    while (ci)
+    {
+        // is this class derived from the given parent?
+        if (wxString(ci->GetBaseClassName1()) == parent->GetClassName() ||
+            wxString(ci->GetBaseClassName2()) == parent->GetClassName())
+        {
+            wxTreeItemId child = m_pParentTreeCtrl->AppendItem(id, ci->GetClassName());
+            
+            // update the name of this child with the count of the children classes
+            int ret = AddClassesWithParent(ci, child);
+            m_pParentTreeCtrl->SetItemText(child,
+                                     m_pParentTreeCtrl->GetItemText(child) +
+                                     wxString::Format(wxT(" [%d]"), ret));
+            count += ret+1;
+        }
+        
+        ci = ci->GetNext();
+    }
+
+    // reorder all the children we've just added
+    m_pParentTreeCtrl->SortChildren(id);
+
+    return count;
+}
+
+int GetSizeOfClass(const wxString &cn)
+{
+    const wxClassInfo *ci = wxClassInfo::FindClass(cn);
+    if (ci)
+        return ci->GetSize();
+    return 0;
+}
+
+int CompareClassSizes(const wxString &class1, const wxString &class2)
+{
+    return GetSizeOfClass(class1) - GetSizeOfClass(class2);
+}
+
+void ClassListDialog::InitControls()
+{
+    // create a wxArrayString with the names of all classes:
+    const wxClassInfo *ci = wxClassInfo::GetFirst();
+    wxArrayString arr;
+    while (ci)
+    {
+        arr.Add(ci->GetClassName());
+        ci = ci->GetNext();
+    }
+
+    arr.Sort();     // sort alphabetically
+
+    // now add it to the raw-mode listbox
+    for (unsigned int i=0; i<arr.GetCount(); i++)
+        if (!IsToDiscard(arr[i]))
+            m_pRawListBox->Append(arr[i]);
+    m_nCount = m_pRawListBox->GetCount();
+
+    // sort again using size as sortkey
+    arr.Sort((wxArrayString::CompareFunction)CompareClassSizes);
+
+    // now add it to the size-mode listbox
+    for (unsigned int i=0; i<arr.GetCount(); i++)
+        if (!IsToDiscard(arr[i]))
+            m_pSizeListBox->Append(arr[i]);
+
+    // add root item to parent-mode treectrl
+    wxTreeItemId id = m_pParentTreeCtrl->AddRoot(_T("wxObject"));
+
+    // recursively add all leaves to the treectrl
+    int count = AddClassesWithParent(CLASSINFO(wxObject), id);
+    m_pParentTreeCtrl->SetItemText(id, m_pParentTreeCtrl->GetItemText(id) +
+                                 wxString::Format(wxT(" [%d]"), count));
+
+    // initially expand the root item
+    m_pParentTreeCtrl->Expand(id);
+
+    m_nTotalCount = arr.GetCount();
+    UpdateFilterText();
+
+    // don't leave blank the XTI info display
+    m_pChoiceBook->ChangeSelection(0);
+    m_pRawListBox->Select(0);
+    UpdateClassInfo(m_pRawListBox->GetStringSelection());
+}
+
+bool ClassListDialog::IsToDiscard(const wxString &classname) const
+{
+    wxCheckBox *cb = wx_static_cast(wxCheckBox*, FindWindow(ID_SHOW_ONLY_XTI));
+    if (!cb || !cb->IsChecked())
+        return false;
+
+    // check if this class has XTI infos
+    wxClassInfo *info = wxClassInfo::FindClass(classname);
+    if (!info)
+        return false;
+    if (info->GetFirstProperty() != NULL || info->GetFirstHandler() != NULL)
+        return false;       // has XTI info
+    return true;            // no XTI info
+}
+
+void ClassListDialog::UpdateFilterText()
+{
+    // tell the user how many registered classes are present and
+    // how many are we showing
+    m_pClassCountText->SetLabel(
+        wxString::Format(
+            wxT("Showing %d classes on a total of %d registered classes in wxXTI."), 
+            m_nCount, m_nTotalCount));
+}
+
+void ClassListDialog::UpdateClassInfo(const wxString &itemName)
+{
+    wxString classname = itemName.BeforeFirst(_T(' '));
+    wxCheckBox *cb = wx_static_cast(wxCheckBox*, FindWindow(ID_SHOW_PROPERTIES_RECURSIVELY));
+
+    m_pTextCtrl->SetValue(
+        DumpClassInfo(wxClassInfo::FindClass(classname), cb->IsChecked()));
+}
+
+
+// ----------------------------------------------------------------------------
+// ClassListDialog - event handlers
+// ----------------------------------------------------------------------------
+
+void ClassListDialog::OnShowOnlyXTICheckbox( wxCommandEvent& WXUNUSED(event) )
+{
+    m_pRawListBox->Clear();
+    m_pParentTreeCtrl->DeleteAllItems();
+    m_pSizeListBox->Clear();
+
+    InitControls();
+}
+
+void ClassListDialog::OnShowRecursiveInfoCheckbox( wxCommandEvent& WXUNUSED(event) )
+{
+    m_pRawListBox->Clear();
+    m_pParentTreeCtrl->DeleteAllItems();
+    m_pSizeListBox->Clear();
+
+    InitControls();
+}
+
+void ClassListDialog::OnListboxSelected( wxCommandEvent& event )
+{
+    UpdateClassInfo(event.GetString());
+}
+
+void ClassListDialog::OnTreectrlSelChanged( wxTreeEvent& event )
+{
+    UpdateClassInfo(m_pParentTreeCtrl->GetItemText(event.GetItem()));
+}
+
+void ClassListDialog::OnChoiceBookPageChange( wxChoicebookEvent& event )
+{
+    switch (event.GetSelection())
+    {
+    case 0:
+        if (m_pRawListBox->GetCount())
+        {
+            m_pRawListBox->Select(0);
+            UpdateClassInfo(m_pRawListBox->GetStringSelection());
+        }
+        break;
+    case 1:
+        if (m_pSizeListBox->GetCount())
+        {
+            m_pSizeListBox->Select(0);
+            UpdateClassInfo(m_pSizeListBox->GetStringSelection());
+        }
+        break;
+    case 2:
+        {
+            wxTreeItemId root = m_pParentTreeCtrl->GetRootItem();
+            if (root.IsOk())
+            {
+                m_pParentTreeCtrl->SelectItem(root);
+                UpdateClassInfo(m_pParentTreeCtrl->GetItemText(root));
+            }
+        }
+        break;
+    }
+}
+
+
+
+// ----------------------------------------------------------------------------
+// dump functions
+// ----------------------------------------------------------------------------
+
+wxString DumpStr(const wxString &str)
+{
+    if (str.empty())
+        return wxT("none");
+    return str;
+}
+
+wxString DumpTypeInfo(const wxTypeInfo *ti)
+{
+    if (!ti)
+        return _T("none");
+
+    return DumpStr(ti->GetTypeName());
+}
+
+wxString DumpPropertyAccessor(const wxPropertyAccessor *acc, int indent)
+{
+    wxString ind = _T("\n") + wxString(indent, wxT(' '));
+    wxString infostr;
+
+    if (!acc)
+        return ind + _T("no property accessors");
+    
+    if (acc->HasSetter())
+        infostr << ind << _T("setter name: ") << acc->GetSetterName();
+    if (acc->HasCollectionGetter())
+        infostr << ind << _T("collection getter name: ") << acc->GetCollectionGetterName();
+    if (acc->HasGetter())
+        infostr << ind << _T("getter name: ") << acc->GetGetterName();
+    if (acc->HasAdder())
+        infostr << ind << _T("adder name: ") << acc->GetAdderName();
+
+    return infostr;
+}
+
+wxString DumpPropertyInfo(const wxPropertyInfo *prop, int indent)
+{
+    wxString ind = _T("\n") + wxString(indent, wxT(' '));
+    wxString infostr;
+
+    if (!prop)
+        return ind + _T("none");
+
+    infostr << ind << _T("flags: ");
+    if (prop->GetFlags() & wxPROP_DEPRECATED)
+        infostr << _T("wxPROP_DEPRECATED,");
+    if (prop->GetFlags() & wxPROP_OBJECT_GRAPH)
+        infostr << _T("wxPROP_OBJECT_GRAPH,");
+    if (prop->GetFlags() & wxPROP_ENUM_STORE_LONG)
+        infostr << _T("wxPROP_ENUM_STORE_LONG,");
+    if (prop->GetFlags() & wxPROP_DONT_STREAM)
+        infostr << _T("wxPROP_DONT_STREAM,");
+
+    if (prop->GetFlags() == 0)
+        infostr << _T("none");
+    else
+        infostr.RemoveLast();       // remove last comma
+
+    infostr << ind << _T("help string: ") << DumpStr(prop->GetHelpString());
+    infostr << ind << _T("group string: ") << DumpStr(prop->GetGroupString());
+
+    infostr << ind << _T("collection element type: ") << DumpTypeInfo(prop->GetCollectionElementTypeInfo());
+    infostr << ind << _T("type: ") << DumpTypeInfo(prop->GetTypeInfo());
+
+    infostr << ind << _T("default value: ") << DumpStr(prop->GetDefaultValue().GetAsString());
+    infostr << DumpPropertyAccessor(prop->GetAccessor(), indent+1);
+
+    return infostr;
+}
+
+wxString DumpHandlerInfo(const wxHandlerInfo *phdlr, int indent)
+{
+    wxString ind = _T("\n") + wxString(indent, wxT(' '));
+    wxString infostr;
+
+    if (!phdlr)
+        return ind + _T("none");
+
+    infostr << ind << _T("event class: ") << 
+        (phdlr->GetEventClassInfo() ? phdlr->GetEventClassInfo()->GetClassName() : wxT("none"));
+
+    return infostr;
+}
+
+int DumpProperties(const wxClassInfo *info, wxString& infostr, bool recursive)
+{
+    const wxPropertyInfo *prop;
+    int pcount;
+    for (prop = info->GetFirstProperty(), pcount = 0;
+         prop;
+         prop = prop->GetNext(), pcount++)
+    {
+        infostr << _T("\n\n  [") << pcount+1 << _T("] Property: ") << prop->GetName();
+        infostr << DumpPropertyInfo(prop, 4);
+    }
+
+    if (pcount == 0)
+        infostr << _T("\n None");
+
+    if (recursive)
+    {
+        const wxClassInfo **parent = info->GetParents();
+        wxString str;
+
+        for (int i=0; parent[i] != NULL; i++)
+        {
+            int ppcount = DumpProperties(parent[i], str, recursive);
+            if (ppcount)
+            {
+                pcount += ppcount;
+                infostr << _T("\n\n  ") << parent[i]->GetClassName() << _T(" PARENT'S PROPERTIES:");
+                infostr << str;
+            }
+        }
+    }
+
+    return pcount;
+}
+
+int DumpHandlers(const wxClassInfo *info, wxString& infostr, bool recursive)
+{
+    const wxHandlerInfo *h;
+    int hcount;
+    for (h = info->GetFirstHandler(), hcount = 0;
+         h;
+         h = h->GetNext(), hcount++)
+    {
+        infostr << _T("\n\n  [") << hcount+1 << _T("] Handler: ") << h->GetName();
+        infostr << DumpHandlerInfo(h, 4);
+    }
+
+    if (hcount == 0)
+        infostr << _T("\n None");
+
+    if (recursive)
+    {
+        const wxClassInfo **parent = info->GetParents();
+        wxString str;
+
+        for (int i=0; parent[i] != NULL; i++)
+        {
+            int hhcount = DumpHandlers(parent[i], str, recursive);
+            if (hhcount)
+            {
+                hcount += hhcount;
+                infostr << _T("\n\n  ") << parent[i]->GetClassName() << _T(" PARENT'S HANDLERS:");
+                infostr << str;
+            }
+        }
+    }
+
+    return hcount;
+}
+
+wxString DumpClassInfo(const wxClassInfo *info, bool recursive)
+{
+    wxString infostr;
+
+    if (!info)
+        return wxEmptyString;
+
+    // basic stuff:
+
+    infostr << _T("\n BASIC RTTI INFO ABOUT ") << info->GetClassName();
+    infostr << _T("\n =================================================");
+    infostr << _T("\n  Base class #1: ") << DumpStr(info->GetBaseClassName1());
+    infostr << _T("\n  Base class #2: ") << DumpStr(info->GetBaseClassName2());
+    infostr << _T("\n  Include file: ") << DumpStr(info->GetIncludeName());
+    infostr << _T("\n  Size: ") << info->GetSize();
+    infostr << _T("\n  Dynamic: ") << (info->IsDynamic() ? _T("true") : _T("false"));
+
+
+    // advanced stuff:
+
+    infostr << _T("\n\n\n ADVANCED RTTI INFO ABOUT ") << info->GetClassName();
+    infostr << _T("\n =================================================\n");
+    infostr << _T("\n PROPERTIES");
+    infostr << _T("\n -----------------------------------------");
+    int pcount = DumpProperties(info, infostr, recursive);
+    infostr << _T("\n\n HANDLERS");
+    infostr << _T("\n -----------------------------------------");
+    int hcount = DumpHandlers(info, infostr, recursive);
+
+    if (pcount+hcount == 0)
+        infostr << _T("\n\n no advanced info\n");
+    else
+    {
+        infostr << _T("\n\n Total count of properties: ") << pcount;
+        infostr << _T("\n Total count of handlers: ") << hcount << _T("\n");
+    }
+
+    return infostr;
+}
diff --git a/samples/xti/classlist.h b/samples/xti/classlist.h
new file mode 100644 (file)
index 0000000..dcb416f
--- /dev/null
@@ -0,0 +1,108 @@
+////////////////////////////////////////////////////
+// Name:        classlist.h
+// Purpose:     ClassListDialog definition
+// Author:      Francesco Montorsi
+// Modified by: 
+// Created:     03/06/2007 14:49:55
+// RCS-ID:      $Id: classlist.h 47845 2007-08-01 12:53:50Z FM $
+// Copyright:   (c) 2007 Francesco Montorsi
+// Licence:     wxWidgets license
+////////////////////////////////////////////////////
+
+#ifndef _CLASSLIST_H_
+#define _CLASSLIST_H_
+
+
+// ----------------------------------------------------------------------------
+// includes
+// ----------------------------------------------------------------------------
+
+#include "wx/choicebk.h"
+#include "wx/treectrl.h"
+
+// ----------------------------------------------------------------------------
+// IDs
+// ----------------------------------------------------------------------------
+
+#define ID_LISTMODE 10006
+#define ID_LISTBOX 10003
+#define ID_PANEL 10007
+#define ID_TREECTRL 10008
+#define ID_TEXTCTRL 10004
+#define ID_SHOW_ONLY_XTI 10005
+#define ID_SHOW_PROPERTIES_RECURSIVELY 10002
+#define SYMBOL_CLASSLISTDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
+#define SYMBOL_CLASSLISTDIALOG_TITLE _("wxWidgets class list")
+#define SYMBOL_CLASSLISTDIALOG_IDNAME wxID_ANY
+#define SYMBOL_CLASSLISTDIALOG_SIZE wxSize(400, 300)
+#define SYMBOL_CLASSLISTDIALOG_POSITION wxDefaultPosition
+
+
+// ----------------------------------------------------------------------------
+// ClassListDialog
+// ----------------------------------------------------------------------------
+
+class ClassListDialog: public wxDialog
+{    
+    // we explicitely don't want to use the following macro:
+    //     DECLARE_DYNAMIC_CLASS( ClassListDialog )
+    // as otherwise the ClassListDialog class would appear in the list
+    // shown by this dialog!
+    DECLARE_EVENT_TABLE()
+
+public:
+    // Constructors
+    ClassListDialog();
+    ClassListDialog( wxWindow* parent, wxWindowID id = SYMBOL_CLASSLISTDIALOG_IDNAME, 
+                       const wxString& caption = SYMBOL_CLASSLISTDIALOG_TITLE, 
+                       const wxPoint& pos = SYMBOL_CLASSLISTDIALOG_POSITION, 
+                       const wxSize& size = SYMBOL_CLASSLISTDIALOG_SIZE, 
+                       long style = SYMBOL_CLASSLISTDIALOG_STYLE );
+
+    // Creation
+    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CLASSLISTDIALOG_IDNAME, 
+                 const wxString& caption = SYMBOL_CLASSLISTDIALOG_TITLE, 
+                 const wxPoint& pos = SYMBOL_CLASSLISTDIALOG_POSITION, 
+                 const wxSize& size = SYMBOL_CLASSLISTDIALOG_SIZE, 
+                 long style = SYMBOL_CLASSLISTDIALOG_STYLE );
+
+    // Destructor
+    ~ClassListDialog();
+
+public:     // misc
+
+    void Init();
+    void CreateControls();
+    void InitControls();
+
+    void UpdateClassInfo(const wxString &itemName);
+    void UpdateFilterText();
+    bool IsToDiscard(const wxString &classname) const;
+
+    int AddClassesWithParent(const wxClassInfo *parent, const wxTreeItemId &id);
+
+public:     // event handlers
+
+    void OnListboxSelected( wxCommandEvent& event );
+    void OnTreectrlSelChanged( wxTreeEvent& event );
+    void OnChoiceBookPageChange( wxChoicebookEvent& event );
+    void OnShowOnlyXTICheckbox( wxCommandEvent& event );
+    void OnShowRecursiveInfoCheckbox( wxCommandEvent& event );
+
+    // Should we show tooltips?
+    static bool ShowToolTips();
+
+protected:
+    wxChoicebook* m_pChoiceBook;
+    wxStaticText* m_pClassCountText;
+    wxListBox* m_pRawListBox;
+    wxTreeCtrl* m_pParentTreeCtrl;
+    wxListBox* m_pSizeListBox;
+    wxTextCtrl* m_pTextCtrl;
+
+    int m_nTotalCount;   // number of classes in wxXTI system
+    int m_nCount;       // number of shown classes
+};
+
+#endif
+    // _CLASSLIST_H_
diff --git a/samples/xti/codereadercallback.cpp b/samples/xti/codereadercallback.cpp
new file mode 100644 (file)
index 0000000..0ba0bd2
--- /dev/null
@@ -0,0 +1,276 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/xtistrm.cpp\r
+// Purpose:     streaming runtime metadata information\r
+// Author:      Stefan Csomor\r
+// Modified by:\r
+// Created:     27/07/03\r
+// RCS-ID:      $Id: xtistrm.cpp 47828 2007-07-31 19:26:56Z FM $\r
+// Copyright:   (c) 2003 Stefan Csomor\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#include "wx/xtistrm.h"\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/object.h"\r
+    #include "wx/hash.h"\r
+    #include "wx/event.h"\r
+#endif\r
+\r
+#include <map>\r
+#include <vector>\r
+#include <string>\r
+using namespace std;\r
+\r
+#include "wx/tokenzr.h"\r
+#include "wx/txtstrm.h"\r
+#include "codereadercallback.h"\r
+\r
+#if !wxUSE_EXTENDED_RTTI\r
+    #error This sample requires XTI (eXtended RTTI) enabled\r
+#endif\r
+\r
+// ----------------------------------------------------------------------------\r
+// wxObjectCodeReaderCallback - depersisting to code\r
+// ----------------------------------------------------------------------------\r
+\r
+struct wxObjectCodeReaderCallback::wxObjectCodeReaderCallbackInternal\r
+{\r
+#if wxUSE_UNICODE\r
+    map<int,wstring> m_objectNames;\r
+#else\r
+    map<int,string> m_objectNames;\r
+#endif\r
+\r
+    void SetObjectName(int objectID, const wxString &name )\r
+    {\r
+        if ( m_objectNames.find(objectID) != m_objectNames.end() )\r
+        {\r
+            wxLogError( _("Passing a already registered object to SetObjectName") );\r
+            return ;\r
+        }\r
+        m_objectNames[objectID] = (const wxChar *)name;\r
+    }\r
+\r
+    wxString GetObjectName( int objectID )\r
+    {\r
+        if ( objectID == wxNullObjectID )\r
+            return wxT("NULL");\r
+\r
+        if ( m_objectNames.find(objectID) == m_objectNames.end() )\r
+        {\r
+            wxLogError( _("Passing an unkown object to GetObject") );\r
+            return wxEmptyString;\r
+        }\r
+        return wxString( m_objectNames[objectID].c_str() );\r
+    }\r
+};\r
+\r
+wxObjectCodeReaderCallback::wxObjectCodeReaderCallback(wxTextOutputStream *out)\r
+: m_fp(out)\r
+{\r
+    m_data = new wxObjectCodeReaderCallbackInternal;\r
+}\r
+\r
+wxObjectCodeReaderCallback::~wxObjectCodeReaderCallback()\r
+{\r
+    delete m_data;\r
+}\r
+\r
+void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *classInfo,\r
+                                       wxVariantBaseArray &WXUNUSED(metadata))\r
+{\r
+    wxString objectName = wxString::Format( wxT("LocalObject_%d"), objectID );\r
+    m_fp->WriteString( wxString::Format( wxT("\t%s *%s = new %s;\n"),\r
+        classInfo->GetClassName(),\r
+        objectName.c_str(),\r
+        classInfo->GetClassName()) );\r
+    m_data->SetObjectName( objectID, objectName );\r
+}\r
+\r
+void wxObjectCodeReaderCallback::DestroyObject(int objectID, wxClassInfo *WXUNUSED(classInfo))\r
+{\r
+    m_fp->WriteString( wxString::Format( wxT("\tdelete %s;\n"),\r
+        m_data->GetObjectName( objectID).c_str() ) );\r
+}\r
+\r
+wxString wxObjectCodeReaderCallback::ValueAsCode( const wxVariantBase &param )\r
+{\r
+    wxString value;\r
+    const wxTypeInfo* type = param.GetTypeInfo();\r
+    if ( type->GetKind() == wxT_CUSTOM )\r
+    {\r
+        const wxCustomTypeInfo* cti = wx_dynamic_cast(const wxCustomTypeInfo*, type);\r
+        if ( cti )\r
+        {\r
+            value.Printf( wxT("%s(%s)"), cti->GetTypeName().c_str(),\r
+                          param.GetAsString().c_str() );\r
+        }\r
+        else\r
+        {\r
+            wxLogError ( _("Internal error, illegal wxCustomTypeInfo") );\r
+        }\r
+    }\r
+    else if ( type->GetKind() == wxT_STRING )\r
+    {\r
+        value.Printf( wxT("\"%s\""),param.GetAsString().c_str() );\r
+    }\r
+    else\r
+    {\r
+        value.Printf( wxT("%s"), param.GetAsString().c_str() );\r
+    }\r
+    return value;\r
+}\r
+\r
+void wxObjectCodeReaderCallback::CreateObject(int objectID,\r
+                                     const wxClassInfo *WXUNUSED(classInfo),\r
+                                     int paramCount,\r
+                                     wxVariantBase *params,\r
+                                     int *objectIDValues,\r
+                                     const wxClassInfo **WXUNUSED(objectClassInfos),\r
+                                     wxVariantBaseArray &WXUNUSED(metadata)\r
+                                     )\r
+{\r
+    int i;\r
+    m_fp->WriteString( wxString::Format( wxT("\t%s->Create("), \r
+                       m_data->GetObjectName(objectID).c_str() ) );\r
+    for (i = 0; i < paramCount; i++)\r
+    {\r
+        if ( objectIDValues[i] != wxInvalidObjectID )\r
+        {\r
+            wxString str = \r
+                wxString::Format( wxT("%s"), \r
+                                  m_data->GetObjectName( objectIDValues[i] ).c_str() );\r
+            m_fp->WriteString( str );\r
+        }\r
+        else\r
+        {\r
+            m_fp->WriteString( \r
+                wxString::Format( wxT("%s"), ValueAsCode(params[i]).c_str() ) );\r
+        }\r
+        if (i < paramCount - 1)\r
+            m_fp->WriteString( wxT(", "));\r
+    }\r
+    m_fp->WriteString( wxT(");\n") );\r
+}\r
+\r
+void wxObjectCodeReaderCallback::ConstructObject(int objectID,\r
+                                     const wxClassInfo *classInfo,\r
+                                     int paramCount,\r
+                                     wxVariantBase *params,\r
+                                     int *objectIDValues,\r
+                                     const wxClassInfo **WXUNUSED(objectClassInfos),\r
+                                     wxVariantBaseArray &WXUNUSED(metadata)\r
+                                     )\r
+{\r
+    wxString objectName = wxString::Format( wxT("LocalObject_%d"), objectID );\r
+    m_fp->WriteString( wxString::Format( wxT("\t%s *%s = new %s("),\r
+        classInfo->GetClassName(),\r
+        objectName.c_str(),\r
+        classInfo->GetClassName()) );\r
+    m_data->SetObjectName( objectID, objectName );\r
+\r
+    int i;\r
+    for (i = 0; i < paramCount; i++)\r
+    {\r
+        if ( objectIDValues[i] != wxInvalidObjectID )\r
+            m_fp->WriteString( wxString::Format( wxT("%s"), \r
+                               m_data->GetObjectName( objectIDValues[i] ).c_str() ) );\r
+        else\r
+        {\r
+            m_fp->WriteString( \r
+                wxString::Format( wxT("%s"), ValueAsCode(params[i]).c_str() ) );\r
+        }\r
+        if (i < paramCount - 1)\r
+            m_fp->WriteString( wxT(", ") );\r
+    }\r
+    m_fp->WriteString( wxT(");\n") );\r
+}\r
+\r
+void wxObjectCodeReaderCallback::SetProperty(int objectID,\r
+                                    const wxClassInfo *WXUNUSED(classInfo),\r
+                                    const wxPropertyInfo* propertyInfo,\r
+                                    const wxVariantBase &value)\r
+{\r
+    m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"),\r
+        m_data->GetObjectName(objectID).c_str(),\r
+        propertyInfo->GetAccessor()->GetSetterName().c_str(),\r
+        ValueAsCode(value).c_str()) );\r
+}\r
+\r
+void wxObjectCodeReaderCallback::SetPropertyAsObject(int objectID,\r
+                                            const wxClassInfo *WXUNUSED(classInfo),\r
+                                            const wxPropertyInfo* propertyInfo,\r
+                                            int valueObjectId)\r
+{\r
+    if ( propertyInfo->GetTypeInfo()->GetKind() == wxT_OBJECT )\r
+        m_fp->WriteString( wxString::Format( wxT("\t%s->%s(*%s);\n"),\r
+        m_data->GetObjectName(objectID).c_str(),\r
+        propertyInfo->GetAccessor()->GetSetterName().c_str(),\r
+        m_data->GetObjectName( valueObjectId).c_str() ) );\r
+    else\r
+        m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"),\r
+        m_data->GetObjectName(objectID).c_str(),\r
+        propertyInfo->GetAccessor()->GetSetterName().c_str(),\r
+        m_data->GetObjectName( valueObjectId).c_str() ) );\r
+}\r
+\r
+void wxObjectCodeReaderCallback::AddToPropertyCollection( int objectID,\r
+                                                const wxClassInfo *WXUNUSED(classInfo),\r
+                                                const wxPropertyInfo* propertyInfo,\r
+                                                const wxVariantBase &value)\r
+{\r
+    m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"),\r
+        m_data->GetObjectName(objectID).c_str(),\r
+        propertyInfo->GetAccessor()->GetAdderName().c_str(),\r
+        ValueAsCode(value).c_str()) );\r
+}\r
+\r
+// sets the corresponding property (value is an object)\r
+void wxObjectCodeReaderCallback::\r
+    AddToPropertyCollectionAsObject(int WXUNUSED(objectID),\r
+                                    const wxClassInfo *WXUNUSED(classInfo),\r
+                                    const wxPropertyInfo* WXUNUSED(propertyInfo),\r
+                                    int WXUNUSED(valueObjectId))\r
+{\r
+    // TODO\r
+}\r
+\r
+void wxObjectCodeReaderCallback::SetConnect(int eventSourceObjectID,\r
+                                   const wxClassInfo *WXUNUSED(eventSourceClassInfo),\r
+                                   const wxPropertyInfo *delegateInfo,\r
+                                   const wxClassInfo *eventSinkClassInfo,\r
+                                   const wxHandlerInfo* handlerInfo,\r
+                                   int eventSinkObjectID )\r
+{\r
+    wxString ehsource = m_data->GetObjectName( eventSourceObjectID );\r
+    wxString ehsink = m_data->GetObjectName(eventSinkObjectID);\r
+    wxString ehsinkClass = eventSinkClassInfo->GetClassName();\r
+    const wxEventSourceTypeInfo *delegateTypeInfo = \r
+        wx_dynamic_cast(const wxEventSourceTypeInfo*, delegateInfo->GetTypeInfo());\r
+    if ( delegateTypeInfo )\r
+    {\r
+        int eventType = delegateTypeInfo->GetEventType();\r
+        wxString handlerName = handlerInfo->GetName();\r
+\r
+        wxString code =\r
+            wxString::Format( \r
+                wxT("\t%s->Connect( %s->GetId(), %d, ")\r
+                wxT("(wxObjectEventFunction)(wxEventFunction) & %s::%s, NULL, %s );"),\r
+                ehsource.c_str(), ehsource.c_str(), eventType, ehsinkClass.c_str(),\r
+                handlerName.c_str(), ehsink.c_str() );\r
+\r
+        m_fp->WriteString( code );\r
+    }\r
+    else\r
+    {\r
+        wxLogError(_("delegate has no type info"));\r
+    }\r
+}\r
diff --git a/samples/xti/codereadercallback.h b/samples/xti/codereadercallback.h
new file mode 100644 (file)
index 0000000..b0b8df9
--- /dev/null
@@ -0,0 +1,104 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        wx/xtistrm.h\r
+// Purpose:     streaming runtime metadata information (extended class info)\r
+// Author:      Stefan Csomor\r
+// Modified by:\r
+// Created:     27/07/03\r
+// RCS-ID:      $Id: xtistrm.h 47827 2007-07-31 19:25:09Z FM $\r
+// Copyright:   (c) 2003 Stefan Csomor\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef _CODEDEPERSISTER_\r
+#define _CODEDEPERSISTER_\r
+\r
+#include "wx/defs.h"\r
+\r
+/*\r
+wxObjectCodeReaderCallback implements the callbacks that will depersist\r
+an object into a C++ initialization function.\r
+*/\r
+\r
+class WXDLLIMPEXP_BASE wxTextOutputStream;\r
+\r
+class WXDLLIMPEXP_BASE wxObjectCodeReaderCallback: public wxObjectWriterCallback\r
+{\r
+private:\r
+    struct wxObjectCodeReaderCallbackInternal;\r
+    wxObjectCodeReaderCallbackInternal * m_data;\r
+    wxTextOutputStream *m_fp;\r
+    wxString ValueAsCode( const wxVariantBase &param );\r
+\r
+public:\r
+    wxObjectCodeReaderCallback(wxTextOutputStream *out);\r
+    virtual ~wxObjectCodeReaderCallback();\r
+\r
+    // allocate the new object on the heap, that object will have the passed in ID\r
+    virtual void AllocateObject(int objectID, wxClassInfo *classInfo,\r
+        wxVariantBaseArray &metadata);\r
+\r
+    // initialize the already allocated object having the ID objectID \r
+    // with the Create method creation parameters which are objects are \r
+    // having their Ids passed in objectIDValues having objectId <> wxInvalidObjectID\r
+\r
+    virtual void CreateObject(int objectID,\r
+        const wxClassInfo *classInfo,\r
+        int paramCount,\r
+        wxVariantBase *variantValues,\r
+        int *objectIDValues,\r
+        const wxClassInfo **objectClassInfos,\r
+        wxVariantBaseArray &metadata\r
+        );\r
+\r
+    // construct the new object on the heap, that object will have the \r
+    // passed in ID (for objects that don't support allocate-create type \r
+    // of creation) creation parameters which are objects are having their \r
+    // Ids passed in objectIDValues having objectId <> wxInvalidObjectID\r
+\r
+    virtual void ConstructObject(int objectID,\r
+        const wxClassInfo *classInfo,\r
+        int paramCount,\r
+        wxVariantBase *VariantValues,\r
+        int *objectIDValues,\r
+        const wxClassInfo **objectClassInfos,\r
+        wxVariantBaseArray &metadata);\r
+\r
+    // destroy the heap-allocated object having the ID objectID, this may \r
+    // be used if an object is embedded in another object and set via value \r
+    // semantics, so the intermediate object can be destroyed after safely\r
+    virtual void DestroyObject(int objectID, wxClassInfo *classInfo);\r
+\r
+    // set the corresponding property\r
+    virtual void SetProperty(int objectID,\r
+        const wxClassInfo *classInfo,\r
+        const wxPropertyInfo* propertyInfo,\r
+        const wxVariantBase &variantValue);\r
+\r
+    // sets the corresponding property (value is an object)\r
+    virtual void SetPropertyAsObject(int objectId,\r
+        const wxClassInfo *classInfo,\r
+        const wxPropertyInfo* propertyInfo,\r
+        int valueObjectId);\r
+\r
+    // adds an element to a property collection\r
+    virtual void AddToPropertyCollection( int objectID,\r
+        const wxClassInfo *classInfo,\r
+        const wxPropertyInfo* propertyInfo,\r
+        const wxVariantBase &VariantValue);\r
+\r
+    // sets the corresponding property (value is an object)\r
+    virtual void AddToPropertyCollectionAsObject(int objectID,\r
+        const wxClassInfo *classInfo,\r
+        const wxPropertyInfo* propertyInfo,\r
+        int valueObjectId);\r
+\r
+    // sets the corresponding event handler\r
+    virtual void SetConnect(int eventSourceObjectID,\r
+        const wxClassInfo *eventSourceClassInfo,\r
+        const wxPropertyInfo *delegateInfo,\r
+        const wxClassInfo *eventSinkClassInfo,\r
+        const wxHandlerInfo* handlerInfo,\r
+        int eventSinkObjectID );\r
+};\r
+\r
+#endif\r
diff --git a/samples/xti/xti.bkl b/samples/xti/xti.bkl
new file mode 100644 (file)
index 0000000..dd37d90
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" ?>
+<!-- $Id: xti.bkl 48186 2007-08-19 19:59:54Z FM $ -->
+
+<makefile>
+
+    <include file="../../build/bakefiles/common_samples.bkl"/>
+
+    <exe id="xti" template="wx_sample" template_append="wx_append">
+        <sources>xti.cpp classlist.cpp codereadercallback.cpp</sources>
+        
+        <wx-lib>core</wx-lib>
+        <wx-lib>xml</wx-lib>
+        <wx-lib>base</wx-lib>
+    </exe>
+
+</makefile>
diff --git a/samples/xti/xti.cpp b/samples/xti/xti.cpp
new file mode 100644 (file)
index 0000000..2d56115
--- /dev/null
@@ -0,0 +1,735 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        xti.cpp
+// Purpose:     eXtended RTTI support sample
+// Author:      Stefan Csomor, Francesco Montorsi
+// Modified by:
+// Created:     13/5/2007
+// RCS-ID:      $Id: xti.cpp 48407 2007-08-26 23:17:23Z FM $
+// Copyright:   (c) Stefan Csomor, Francesco Montorsi
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+// for all others, include the necessary headers (this file is usually all you
+// need because it includes almost all "standard" wxWidgets headers)
+#ifndef WX_PRECOMP
+    #include "wx/wx.h"
+#endif
+
+#include "wx/wx.h"
+#include "wx/variant.h"
+#include "wx/xml/xml.h"
+#include "wx/frame.h"
+#include "wx/notebook.h"
+#include "wx/event.h"
+#include "wx/spinbutt.h"
+#include "wx/spinctrl.h"
+
+#include "wx/xtistrm.h"
+#include "wx/xtixml.h"
+#include "wx/txtstrm.h"
+#include "wx/wfstream.h"
+#include "wx/sstream.h"
+#include "wx/spinctrl.h"
+
+#include "classlist.h"
+#include "codereadercallback.h"
+
+#if !wxUSE_EXTENDED_RTTI
+    #error This sample requires XTI (eXtended RTTI) enabled
+#endif
+
+
+// ----------------------------------------------------------------------------
+// resources
+// ----------------------------------------------------------------------------
+
+#if !defined(__WXMSW__) && !defined(__WXPM__)
+    #include "../sample.xpm"
+#endif
+
+// ----------------------------------------------------------------------------
+// private classes
+// ----------------------------------------------------------------------------
+
+// Define a new application type, each program should derive a class from wxApp
+class MyApp : public wxApp
+{
+public:
+    virtual bool OnInit();
+};
+
+// Define a new frame type: this is going to be our main frame
+class MyFrame : public wxFrame
+{
+public:
+    // ctor(s)
+    MyFrame(const wxString& title);
+
+    void OnPersist(wxCommandEvent& event);
+    void OnDepersist(wxCommandEvent& event);
+    void OnGenerateCode(wxCommandEvent& event);
+    void OnDumpClasses(wxCommandEvent& event);
+    void OnQuit(wxCommandEvent& event);
+    void OnAbout(wxCommandEvent& event);
+
+private:
+    // any class wishing to process wxWidgets events must use this macro
+    wxDECLARE_EVENT_TABLE()
+};
+
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// IDs for the controls and the menu commands
+enum
+{
+    // menu items
+    Minimal_Persist = wxID_HIGHEST,
+    Minimal_Depersist,
+    Minimal_GenerateCode,
+    Minimal_DumpClasses,
+    Minimal_Quit = wxID_EXIT,
+    Minimal_About = wxID_ABOUT
+};
+
+// ----------------------------------------------------------------------------
+// event tables and other macros for wxWidgets
+// ----------------------------------------------------------------------------
+
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+    EVT_MENU(Minimal_Persist, MyFrame::OnPersist)
+    EVT_MENU(Minimal_Depersist, MyFrame::OnDepersist)
+    EVT_MENU(Minimal_GenerateCode, MyFrame::OnGenerateCode)
+    EVT_MENU(Minimal_DumpClasses, MyFrame::OnDumpClasses)
+    EVT_MENU(Minimal_Quit,  MyFrame::OnQuit)
+    EVT_MENU(Minimal_About, MyFrame::OnAbout)
+END_EVENT_TABLE()
+
+wxIMPLEMENT_APP(MyApp)
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+void RegisterFrameRTTI();
+
+// ----------------------------------------------------------------------------
+// the application class
+// ----------------------------------------------------------------------------
+
+bool MyApp::OnInit()
+{
+    if ( !wxApp::OnInit() )
+        return false;
+
+    RegisterFrameRTTI();
+
+    // create the main application window
+    MyFrame *frame = new MyFrame(_T("Extended RTTI sample"));
+
+    // and show it (the frames, unlike simple controls, are not shown when
+    // created initially)
+    frame->Show(true);
+
+    // success: wxApp::OnRun() will be called which will enter the main message
+    // loop and the application will run. If we returned false here, the
+    // application would exit immediately.
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// main frame
+// ----------------------------------------------------------------------------
+
+MyFrame::MyFrame(const wxString& title)
+    : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(300, 200))
+{
+    // set the frame icon
+    SetIcon(wxICON(sample));
+
+#if wxUSE_MENUS
+    // create a menu bar
+    wxMenu *fileMenu = new wxMenu;
+
+    // the "About" item should be in the help menu
+    wxMenu *helpMenu = new wxMenu;
+    helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog"));
+
+    fileMenu->Append(Minimal_Persist, _T("Persist a wxFrame to XML..."), 
+                    _T("Creates a wxFrame using wxXTI and saves its description as XML"));
+    fileMenu->Append(Minimal_Depersist, _T("Depersist XML file..."), 
+                    _T("Loads the description of wxFrame from XML"));
+    fileMenu->Append(Minimal_GenerateCode, _T("Generate code for a wxFrame saved to XML..."), 
+                    _T("Generates the C++ code which belong to a persisted wxFrame"));
+    fileMenu->AppendSeparator();
+    fileMenu->Append(Minimal_DumpClasses, _T("Dump registered classes..."), 
+                    _T("Dumps the description of all wxWidgets classes registered in XTI"));
+    fileMenu->AppendSeparator();
+    fileMenu->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+
+    // now append the freshly created menu to the menu bar...
+    wxMenuBar *menuBar = new wxMenuBar();
+    menuBar->Append(fileMenu, _T("&File"));
+    menuBar->Append(helpMenu, _T("&Help"));
+
+    // ... and attach this menu bar to the frame
+    SetMenuBar(menuBar);
+#endif // wxUSE_MENUS
+
+#if wxUSE_STATUSBAR
+    // create a status bar just for fun (by default with 1 pane only)
+    CreateStatusBar(2);
+    SetStatusText(_T("Welcome to wxWidgets!"));
+#endif // wxUSE_STATUSBAR
+}
+
+
+
+// ----------------------------------------------------------------------------
+// XTI sample code
+// ----------------------------------------------------------------------------
+
+// this is the kind of source code that would end up being generated by a 
+// designer corresponding to the information we are setting up via RTTI 
+// in the CreateFrameRTTI function:
+//
+//  class MyXTIFrame : public wxFrame
+//  {
+//  public:
+//       //   construction
+//      MyXTIFrame()
+//      {
+//          Init();
+//          m_button = NULL;
+//      }
+//
+//      bool Create(wxWindow *parent,
+//                  wxWindowID id,
+//                  const wxString& title,
+//                  const wxPoint& pos = wxDefaultPosition,
+//                  const wxSize& size = wxDefaultSize,
+//                  long style = wxDEFAULT_FRAME_STYLE,
+//                  const wxString& name = wxFrameNameStr)
+//      {
+//          return wxFrame::Create( parent, id, title, pos, size, style, name );
+//      }
+//
+//      void SetButton( wxButton * button ) { m_button = button; }
+//      wxButton* GetButton() const { return m_button; }
+//
+//      void ButtonClickHandler( wxEvent & WXUNUSED(event) )
+//      {
+//          wxMessageBox( "Button Clicked ", "Hi!", wxOK );
+//      }
+//
+//  protected:
+//      wxButton* m_button;
+//
+//      DECLARE_EVENT_TABLE()
+//      DECLARE_DYNAMIC_CLASS_NO_COPY(MyXTIFrame)
+//  };
+//
+//  IMPLEMENT_DYNAMIC_CLASS_XTI(MyXTIFrame, MyXTIFrame, "x.h")
+//
+//  WX_BEGIN_PROPERTIES_TABLE(MyXTIFrame)
+//      WX_PROPERTY( Button, wxButton*, SetButton, GetButton, )
+//  WX_END_PROPERTIES_TABLE()
+//
+//  WX_BEGIN_HANDLERS_TABLE(MyXTIFrame)
+//      WX_HANDLER( ButtonClickHandler, wxCommandEvent )
+//  WX_END_HANDLERS_TABLE()
+//
+//  WX_CONSTRUCTOR_5( MyXTIFrame, wxWindow*, Parent, wxWindowID, Id,
+//                    wxString, Title, wxPoint, Position, wxSize, Size )
+//
+//  BEGIN_EVENT_TABLE(MyXTIFrame, wxFrame)
+//  END_EVENT_TABLE()
+
+// the following class "persists" (i.e. saves) a wxFrame into a wxObjectWriter
+
+class MyDesignerPersister : public wxObjectReaderCallback
+{
+public:
+    MyDesignerPersister( wxDynamicObject * frame)
+    {
+        m_frame = frame;
+    }
+
+    virtual bool BeforeWriteDelegate( wxObjectWriter *WXUNUSED(writer),
+                                    const wxObject *object,  
+                                    const wxClassInfo* WXUNUSED(classInfo), 
+                                    const wxPropertyInfo *propInfo, 
+                                    const wxObject *&eventSink, 
+                                    const wxHandlerInfo* &handlerInfo )  
+    {
+        // this approach would be used it the handler would not 
+        // be connected really in the designer, so we have to supply 
+        // the information
+        if ( object == m_frame->GetProperty(wxT("Button")).GetAsObject() && 
+             propInfo == wxCLASSINFO( wxButton )->FindPropertyInfo("OnClick") )
+        {
+            eventSink = m_frame;
+            handlerInfo = m_frame->GetClassInfo()->
+                FindHandlerInfo("ButtonClickHandler");
+            return true;
+        }
+        return false;
+    }
+
+private:
+    wxDynamicObject *m_frame;
+};
+
+// sometimes linkers (at least MSVC and GCC ones) optimize the final EXE 
+// even in debug mode pruning the object files which he "thinks" are useless;
+// thus the classes defined in those files won't be available in the XTI
+// table and the program will fail to allocate them.
+// The following macro implements a simple hack to ensure that a given
+// class is linked in.
+//
+// TODO: in wx/link.h there are already similar macros (also more "optimized":
+//       don't need the creation of fake object) which however require to use
+//       the wxFORCE_LINK_THIS_MODULE() macro inside the source files corresponding
+//       to the class being discarded.
+//
+#define wxENSURE_CLASS_IS_LINKED(x)     { x test; }
+
+void RegisterFrameRTTI()
+{
+    // set up the RTTI info for a class (MyXTIFrame) which
+    // is not defined anywhere in this program
+    wxDynamicClassInfo *dyninfo = 
+        wx_dynamic_cast( wxDynamicClassInfo *, wxClassInfo::FindClass(wxT("MyXTIFrame")));
+    if ( dyninfo == NULL )
+    {
+        dyninfo = new wxDynamicClassInfo(wxT("myxtiframe.h"),
+                            wxT("MyXTIFrame"), 
+                            CLASSINFO(wxFrame) );
+
+        // this class has a property named "Button" and the relative handler:
+        dyninfo->AddProperty("Button", wxGetTypeInfo((wxButton**) NULL));
+        dyninfo->AddHandler("ButtonClickHandler", 
+            NULL /* no instance of the handler method */, CLASSINFO( wxEvent ) );
+    }
+}
+
+wxDynamicObject* CreateFrameRTTI()
+{
+    int baseID = 100;
+    wxVariantBase Params[10];
+
+    // the class is now part of XTI internal table so that we can
+    // get a pointer to it just searching it like any other class:
+    wxFrame* frame;
+    wxClassInfo *info = wxClassInfo::FindClass(wxT("MyXTIFrame"));
+    wxASSERT( info );
+    wxDynamicObject* frameWrapper = 
+        wx_dynamic_cast(wxDynamicObject*, info->CreateObject() );
+    Params[0] = wxVariantBase((wxWindow*)(NULL));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString(wxT("This is a frame created from XTI")));
+    Params[3] = wxVariantBase(wxPoint(-1,-1));
+    Params[4] = wxVariantBase(wxSize(400,300));
+    Params[5] = wxVariantBase((long)wxDEFAULT_FRAME_STYLE);
+    wxASSERT( info->Create(frameWrapper, 6, Params ));
+    frame = wx_dynamic_cast(wxFrame*, frameWrapper->GetSuperClassInstance());
+
+    // now build a notebook inside it:
+    wxNotebook* notebook;
+    info = wxClassInfo::FindClass("wxNotebook");
+    wxASSERT( info );
+    notebook = wxDynamicCast( info->CreateObject(), wxNotebook );
+    Params[0] = wxVariantBase((wxWindow*)frame);
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxPoint( 10, 10 ));
+    Params[3] = wxVariantBase(wxDefaultSize);
+    Params[4] = wxVariantBase((long)0);
+    wxASSERT( info->Create(notebook, 5, Params ));
+
+    // button page
+
+    wxPanel* panel;
+    info = wxClassInfo::FindClass("wxPanel");
+    wxASSERT( info );
+    panel = wxDynamicCast( info->CreateObject(), wxPanel );
+    Params[0] = wxVariantBase((wxWindow*)(notebook));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxPoint(-1,-1));
+    Params[3] = wxVariantBase(wxSize(-1,-1));
+    Params[4] = wxVariantBase((long)0);
+    Params[5] = wxVariantBase(wxString(wxT("Hello")));
+    wxASSERT( info->Create(panel, 6, Params ));
+    notebook->AddPage( panel, "Buttons" );
+
+    wxButton* button;
+    info = wxClassInfo::FindClass("wxButton");
+    wxASSERT( info );
+    button = wxDynamicCast( info->CreateObject(), wxButton );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString(wxT("Click Me!")));
+    Params[3] = wxVariantBase(wxPoint( 10, 10 ));
+    Params[4] = wxVariantBase(wxSize(-1,-1));
+    Params[5] = wxVariantBase((long)0);
+    wxASSERT( info->Create(button, 6, Params ));
+    frameWrapper->SetProperty( "Button", wxVariantBase( button ) );
+
+    // other controls page
+
+    info = wxClassInfo::FindClass("wxPanel");
+    wxASSERT( info );
+    panel = wxDynamicCast( info->CreateObject(), wxPanel );
+    Params[0] = wxVariantBase((wxWindow*)(notebook));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxPoint(-1,-1));
+    Params[3] = wxVariantBase(wxSize(-1,-1));
+    Params[4] = wxVariantBase((long)0);
+    Params[5] = wxVariantBase(wxString(wxT("Hello")));
+    wxASSERT( info->Create(panel, 6, Params ));
+    notebook->AddPage( panel, "Other Standard controls" );
+
+    wxControl* control;
+    info = wxClassInfo::FindClass("wxCheckBox");
+    wxASSERT( info );
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString(wxT("A Checkbox")));
+    Params[3] = wxVariantBase(wxPoint( 10, 10 ));
+    Params[4] = wxVariantBase(wxSize(-1,-1));
+    Params[5] = wxVariantBase((long)0);
+    wxASSERT( info->Create(control, 6, Params ));
+
+    info = wxClassInfo::FindClass("wxRadioButton");
+    wxASSERT( info );
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString(wxT("A Radiobutton")));
+    Params[3] = wxVariantBase(wxPoint( 10, 30 ));
+    Params[4] = wxVariantBase(wxSize(-1,-1));
+    Params[5] = wxVariantBase((long)0);
+    wxASSERT( info->Create(control, 6, Params ));
+
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString(wxT("Another One")));
+    Params[3] = wxVariantBase(wxPoint( 10, 50 ));
+    wxASSERT( info->Create(control, 6, Params ));
+
+    info = wxClassInfo::FindClass("wxStaticText");
+    wxASSERT( info );
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString(wxT("A Static Text!")));
+    Params[3] = wxVariantBase(wxPoint( 10, 70 ));
+    Params[4] = wxVariantBase(wxSize(-1,-1));
+    Params[5] = wxVariantBase((long)0);
+    wxASSERT( info->Create(control, 6, Params ));
+
+    info = wxClassInfo::FindClass("wxStaticBox");
+    wxASSERT( info );
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString(wxT("A Static Box")));
+    Params[3] = wxVariantBase(wxPoint( 10, 90 ));
+    Params[4] = wxVariantBase(wxSize(100,80));
+    Params[5] = wxVariantBase((long)0);
+    wxASSERT( info->Create(control, 6, Params ));
+
+    info = wxClassInfo::FindClass("wxTextCtrl");
+    wxASSERT( info );
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString(wxT("A Text Control")));
+    Params[3] = wxVariantBase(wxPoint( 10, 200 ));
+    Params[4] = wxVariantBase(wxSize(-1,-1));
+    Params[5] = wxVariantBase((long)0);
+    wxASSERT( info->Create(control, 6, Params ));
+
+    // spins and gauges page
+
+    info = wxClassInfo::FindClass("wxPanel");
+    wxASSERT( info );
+    panel = wxDynamicCast( info->CreateObject(), wxPanel );
+    Params[0] = wxVariantBase((wxWindow*)(notebook));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxPoint(-1,-1));
+    Params[3] = wxVariantBase(wxSize(-1,-1));
+    Params[4] = wxVariantBase((long)0);
+    Params[5] = wxVariantBase(wxString(wxT("Hello")));
+    wxASSERT( info->Create(panel, 6, Params ));
+    notebook->AddPage( panel, "Spins and Sliders" );
+
+    wxENSURE_CLASS_IS_LINKED(wxSpinButton);
+
+    info = wxClassInfo::FindClass("wxSpinButton");
+    wxASSERT( info );
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxPoint( 10, 10 ));
+    Params[3] = wxVariantBase(wxSize(-1,-1));
+    Params[4] = wxVariantBase((long)wxSP_VERTICAL | wxSP_ARROW_KEYS);
+    wxASSERT( info->Create(control, 5, Params ));
+
+    wxENSURE_CLASS_IS_LINKED(wxSpinCtrl);
+
+    info = wxClassInfo::FindClass("wxSpinCtrl");
+    wxASSERT( info );
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase(wxString("20"));
+    Params[3] = wxVariantBase(wxPoint( 40, 10 ));
+    Params[4] = wxVariantBase(wxSize(40,-1));
+    Params[5] = wxVariantBase((long) wxSP_ARROW_KEYS);
+    wxASSERT( info->Create(control, 6, Params ));
+
+    // MSVC likes to exclude from link wxGauge...
+    wxENSURE_CLASS_IS_LINKED(wxGauge)
+    wxENSURE_CLASS_IS_LINKED(wxCheckBox)
+    wxENSURE_CLASS_IS_LINKED(wxSpinCtrl)
+
+#ifdef __WXMSW__
+    // under wxMSW wxGauge is simply #defined to wxGauge95
+    info = wxClassInfo::FindClass("wxGauge95");
+#else
+    info = wxClassInfo::FindClass("wxGauge");
+#endif
+    wxASSERT( info );
+    control = wxDynamicCast( info->CreateObject(), wxControl );
+    Params[0] = wxVariantBase((wxWindow*)(panel));
+    Params[1] = wxVariantBase(wxWindowID(baseID++));
+    Params[2] = wxVariantBase((int) 100);
+    Params[3] = wxVariantBase(wxPoint( 10, 50 ));
+    Params[4] = wxVariantBase(wxSize(-1,-1));
+    Params[5] = wxVariantBase((long) wxGA_HORIZONTAL);
+    wxASSERT( info->Create(control, 6, Params ));
+    wx_dynamic_cast(wxGauge*, control)->SetValue(20);
+
+    return frameWrapper;
+}
+
+bool SaveFrameRTTI(const wxString &testFileName, wxDynamicObject *frame)
+{
+    // setup the XML document
+    wxXmlDocument xml;
+    wxXmlNode *root = new wxXmlNode(wxXML_ELEMENT_NODE, 
+                                    "TestXTI", "This is the content");
+    xml.SetRoot(root);
+
+    // setup the XTI writer and persister
+    wxObjectXmlWriter writer(root);
+    MyDesignerPersister persister(frame);
+
+    // write the given wxObject into the XML document
+    wxVariantBaseArray empty;
+    writer.WriteObject( frame, frame->GetClassInfo(), &persister, 
+                        wxString("myTestFrame"), empty );
+
+    return xml.Save(testFileName);
+}
+
+wxDynamicObject* LoadFrameRTTI(const wxString &fileName)
+{
+    // load the XML document
+    wxXmlDocument xml;
+    if (!xml.Load(fileName))
+        return NULL;
+
+    wxXmlNode *root = xml.GetRoot();
+    if (root->GetName() != "TestXTI")
+        return NULL;
+
+    // now depersist the wxFrame we saved into it using wxObjectRuntimeReaderCallback
+    wxObjectRuntimeReaderCallback Callbacks;
+    wxObjectXmlReader Reader( root );
+    int obj = Reader.ReadObject( wxString("myTestFrame"), &Callbacks );
+    return (wxDynamicObject*)Callbacks.GetObject( obj );
+}
+
+bool GenerateFrameRTTICode(const wxString &inFileName, const wxString &outFileName)
+{
+    // is loading the streamed out component from xml and writing code that  
+    // will create the same component 
+
+    wxFFileOutputStream fos( outFileName );
+    wxTextOutputStream tos( fos );
+    if (!fos.IsOk())
+        return false;
+
+    wxXmlDocument xml;
+    if (!xml.Load(inFileName))
+        return false;
+
+    wxXmlNode *root = xml.GetRoot();
+    if (root->GetName() != "TestXTI")
+        return false;
+
+    // read the XML file using the wxObjectCodeReaderCallback
+    wxObjectCodeReaderCallback Callbacks(&tos);
+    wxObjectXmlReader Reader(root);
+
+    // ReadObject will return the ID of the object read??
+    Reader.ReadObject( wxString("myTestFrame"), &Callbacks );
+
+    return true;
+}
+
+
+
+
+// ----------------------------------------------------------------------------
+// MyFrame event handlers
+// ----------------------------------------------------------------------------
+
+void MyFrame::OnPersist(wxCommandEvent& WXUNUSED(event))
+{
+    // first create a frame using XTI calls
+    wxDynamicObject *frame = CreateFrameRTTI();
+    if (!frame)
+    {
+        wxLogError(wxT("Cannot create the XTI frame!"));
+        return;
+    }
+
+    // show the frame we're going to save to the user
+    wxFrame *trueFrame = wx_dynamic_cast(wxFrame *, frame->GetSuperClassInstance() );
+    trueFrame->Show();
+
+    // ask the user where to save it
+    wxFileDialog dlg(this, wxT("Where should the frame be saved?"),
+                     wxEmptyString, wxT("test.xml"), wxT("XML files (*.xml)|*.xml"), 
+                     wxFD_SAVE);
+    if (dlg.ShowModal() == wxID_CANCEL)
+        return;
+
+    // then save it to a test XML file
+    if (!SaveFrameRTTI(dlg.GetPath(), frame))
+    {
+        wxLogError(wxT("Cannot save the XTI frame into '%s'"), dlg.GetPath());
+        return;
+    }
+
+    // now simply delete it
+    delete frame;
+}
+
+void MyFrame::OnDepersist(wxCommandEvent& WXUNUSED(event))
+{
+    // ask the user which file to load
+    wxFileDialog dlg(this, wxT("Which file contains the frame to depersist?"),
+                     wxEmptyString, wxT("test.xml"), wxT("XML files (*.xml)|*.xml"), 
+                     wxFD_OPEN);
+    if (dlg.ShowModal() == wxID_CANCEL)
+        return;
+
+    wxObject *frame = LoadFrameRTTI(dlg.GetPath());
+    if (!frame)
+    {
+        wxLogError(wxT("Could not depersist the wxFrame from '%s'"), dlg.GetPath());
+        return;
+    }
+
+    wxFrame *trueFrame = wx_dynamic_cast(wxFrame*, frame );
+    if ( !trueFrame )
+    {
+        wxDynamicObject* dyno = wx_dynamic_cast(wxDynamicObject*, frame );
+        if ( dyno )
+            trueFrame = wx_dynamic_cast(wxFrame *, dyno->GetSuperClassInstance() );
+    }
+
+    if ( trueFrame )
+        trueFrame->Show();
+    else
+        wxLogError(wxT("Could not show the frame"));
+}
+
+void MyFrame::OnGenerateCode(wxCommandEvent& WXUNUSED(event))
+{
+    // ask the user which file to load
+    wxFileDialog dlg(this, wxT("Which file contains the frame to work on?"),
+                     wxEmptyString, wxT("test.xml"), wxT("XML files (*.xml)|*.xml"), 
+                     wxFD_OPEN);
+    if (dlg.ShowModal() == wxID_CANCEL)
+        return;
+
+    // ask the user which file to load
+    wxFileDialog dlg2(this, wxT("Where should the C++ code be saved?"),
+                      wxEmptyString, wxT("test.cpp"), wxT("Source files (*.cpp)|*.cpp"), 
+                      wxFD_SAVE);
+    if (dlg2.ShowModal() == wxID_CANCEL)
+        return;
+
+    // do generate code
+    if (!GenerateFrameRTTICode(dlg.GetPath(), dlg2.GetPath()))
+    {
+        wxLogError(wxT("Could not generate the code for the frame!"));
+        return;
+    }
+
+    // show the generated code
+    {
+        wxFileInputStream f(dlg2.GetPath());
+        wxStringOutputStream str;
+        f.Read(str);
+
+        wxDialog dlg(this, wxID_ANY, wxT("Generated code"), 
+                     wxDefaultPosition, wxDefaultSize,
+                     wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE);
+        wxPanel *panel = new wxPanel(&dlg);
+        wxSizer *sz = new wxBoxSizer(wxVERTICAL);
+        sz->Add(new wxTextCtrl(panel, wxID_ANY, str.GetString(), 
+                               wxDefaultPosition, wxDefaultSize, 
+                               wxTE_MULTILINE|wxTE_READONLY|wxTE_DONTWRAP),
+                1, wxGROW|wxALL, 5);
+        sz->Add(new wxButton(panel, wxID_OK), 0, wxALIGN_RIGHT|wxALL, 5);
+        panel->SetSizerAndFit(sz);
+        dlg.ShowModal();
+    }
+}
+
+void MyFrame::OnDumpClasses(wxCommandEvent& WXUNUSED(event))
+{
+    ClassListDialog dlg(this);
+    dlg.ShowModal();
+}
+
+void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
+{
+    // true is to force the frame to close
+    Close(true);
+}
+
+void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
+{
+    wxMessageBox(wxString::Format(
+                    _T("Welcome to %s!\n")
+                    _T("\n")
+                    _T("This sample demonstrates wxWidgets eXtended RTTI (XTI) system."),
+                    wxVERSION_STRING
+                ),
+                _T("About wxWidgets XTI sample"),
+                wxOK | wxICON_INFORMATION,
+                this);
+}
diff --git a/samples/xti/xti.rc b/samples/xti/xti.rc
new file mode 100644 (file)
index 0000000..b862bd2
--- /dev/null
@@ -0,0 +1,3 @@
+mondrian ICON "sample.ico"
+#include "wx/msw/wx.rc"
+
diff --git a/src/common/bmpbtncmn.cpp b/src/common/bmpbtncmn.cpp
new file mode 100644 (file)
index 0000000..821f231
--- /dev/null
@@ -0,0 +1,93 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/bmpbtncmn.cpp\r
+// Purpose:     wxBitmapButton common code\r
+// Author:      Julian Smart\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: bmpbuttn.cpp 45338 2007-04-08 22:18:35Z VZ $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_BMPBUTTON\r
+\r
+#include "wx/bmpbuttn.h"\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/log.h"\r
+    #include "wx/dcmemory.h"\r
+    #include "wx/image.h"\r
+#endif\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxBitmapButtonStyle )\r
+wxBEGIN_FLAGS( wxBitmapButtonStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+    wxFLAGS_MEMBER(wxBU_AUTODRAW)\r
+    wxFLAGS_MEMBER(wxBU_LEFT)\r
+    wxFLAGS_MEMBER(wxBU_RIGHT)\r
+    wxFLAGS_MEMBER(wxBU_TOP)\r
+    wxFLAGS_MEMBER(wxBU_BOTTOM)\r
+wxEND_FLAGS( wxBitmapButtonStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxBitmapButton, wxButton, "wx/bmpbuttn.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxBitmapButton)\r
+    wxPROPERTY_FLAGS( WindowStyle, wxBitmapButtonStyle, long, \\r
+                      SetWindowStyleFlag, GetWindowStyleFlag, \\r
+                      wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), \\r
+                      wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxBitmapButton)\r
+\r
+wxCONSTRUCTOR_5( wxBitmapButton, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxBitmap, Bitmap, wxPoint, Position, wxSize, Size )\r
+\r
+/*\r
+TODO PROPERTIES :\r
+\r
+long "style" , wxBU_AUTODRAW\r
+bool "default" , 0\r
+bitmap "selected" ,\r
+bitmap "focus" ,\r
+bitmap "disabled" ,\r
+*/\r
+\r
+#endif // wxUSE_BMPBUTTON\r
diff --git a/src/common/checkboxcmn.cpp b/src/common/checkboxcmn.cpp
new file mode 100644 (file)
index 0000000..867239b
--- /dev/null
@@ -0,0 +1,89 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/checkboxcmn.cpp\r
+// Purpose:     wxCheckBox common code\r
+// Author:      Julian Smart\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: checkbox.cpp 45492 2007-04-16 00:53:05Z VZ $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_CHECKBOX\r
+\r
+#include "wx/checkbox.h"\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxCheckBoxStyle )\r
+wxBEGIN_FLAGS( wxCheckBoxStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxNO_BORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+wxEND_FLAGS( wxCheckBoxStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckBox, wxControl, "wx/checkbox.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxCheckBox)\r
+    wxEVENT_PROPERTY( Click, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEvent )\r
+\r
+    wxPROPERTY( Font, wxFont, SetFont, GetFont, wxEMPTY_PARAMETER_VALUE, \\r
+                0 /*flags*/, wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString(), \\r
+                0 /*flags*/, wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Value,bool, SetValue, GetValue, wxEMPTY_PARAMETER_VALUE, \\r
+                0 /*flags*/, wxT("Helpstring"), wxT("group"))\r
+\r
+    wxPROPERTY_FLAGS( WindowStyle, wxCheckBoxStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxCheckBox)\r
+\r
+wxCONSTRUCTOR_6( wxCheckBox, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxString, Label, wxPoint, Position, wxSize, Size, long, WindowStyle )\r
+\r
+\r
+#endif // wxUSE_CHECKBOX\r
diff --git a/src/common/checklstcmn.cpp b/src/common/checklstcmn.cpp
new file mode 100644 (file)
index 0000000..f84aed2
--- /dev/null
@@ -0,0 +1,103 @@
+///////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/checklstcmn.cpp\r
+// Purpose:     wxCheckListBox common code\r
+// Author:      Vadim Zeitlin\r
+// Modified by:\r
+// Created:     16.11.97\r
+// RCS-ID:      $Id: checklst.cpp 45515 2007-04-17 01:19:43Z VZ $\r
+// Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>\r
+// Licence:     wxWindows licence\r
+///////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_CHECKLISTBOX && wxUSE_OWNER_DRAWN\r
+\r
+#include "wx/checklst.h"\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/msw/wrapcctl.h"\r
+    #include "wx/object.h"\r
+    #include "wx/colour.h"\r
+    #include "wx/font.h"\r
+    #include "wx/bitmap.h"\r
+    #include "wx/window.h"\r
+    #include "wx/listbox.h"\r
+    #include "wx/dcmemory.h"\r
+    #include "wx/settings.h"\r
+    #include "wx/log.h"\r
+#endif\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxCheckListBoxStyle )\r
+wxBEGIN_FLAGS( wxCheckListBoxStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+    wxFLAGS_MEMBER(wxLB_SINGLE)\r
+    wxFLAGS_MEMBER(wxLB_MULTIPLE)\r
+    wxFLAGS_MEMBER(wxLB_EXTENDED)\r
+    wxFLAGS_MEMBER(wxLB_HSCROLL)\r
+    wxFLAGS_MEMBER(wxLB_ALWAYS_SB)\r
+    wxFLAGS_MEMBER(wxLB_NEEDED_SB)\r
+    wxFLAGS_MEMBER(wxLB_SORT)\r
+    wxFLAGS_MEMBER(wxLB_OWNERDRAW)\r
+\r
+wxEND_FLAGS( wxCheckListBoxStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckListBox, wxListBox, "wx/checklst.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxCheckListBox)\r
+    wxEVENT_PROPERTY( Toggle, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEvent )\r
+    wxPROPERTY_FLAGS( WindowStyle, wxCheckListBoxStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, wxLB_OWNERDRAW /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxCheckListBox)\r
+\r
+wxCONSTRUCTOR_4( wxCheckListBox, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxPoint, Position, wxSize, Size )\r
+\r
+\r
+#endif\r
diff --git a/src/common/dirctrlcmn.cpp b/src/common/dirctrlcmn.cpp
new file mode 100644 (file)
index 0000000..9a1974b
--- /dev/null
@@ -0,0 +1,85 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/dirctrlcmn.cpp\r
+// Purpose:     wxGenericDirCtrl common code\r
+// Author:      Harm van der Heijden, Robert Roebling, Julian Smart\r
+// Modified by:\r
+// Created:     12/12/98\r
+// RCS-ID:      $Id: dirctrlg.cpp 45395 2007-04-11 00:23:19Z VZ $\r
+// Copyright:   (c) Harm van der Heijden, Robert Roebling and Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_DIRDLG || wxUSE_FILEDLG\r
+\r
+#include "wx/generic/dirctrlg.h"\r
+\r
+//-----------------------------------------------------------------------------\r
+// XTI\r
+//-----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxGenericDirCtrlStyle )\r
+wxBEGIN_FLAGS( wxGenericDirCtrlStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+    wxFLAGS_MEMBER(wxDIRCTRL_DIR_ONLY)\r
+    wxFLAGS_MEMBER(wxDIRCTRL_3D_INTERNAL)\r
+    wxFLAGS_MEMBER(wxDIRCTRL_SELECT_FIRST)\r
+    wxFLAGS_MEMBER(wxDIRCTRL_SHOW_FILTERS)\r
+wxEND_FLAGS( wxGenericDirCtrlStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxGenericDirCtrl, wxControl, "wx/dirctrl.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxGenericDirCtrl)\r
+    wxHIDE_PROPERTY( Children )\r
+\r
+    wxPROPERTY( DefaultPath, wxString, SetDefaultPath, GetDefaultPath, \\r
+                wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Filter, wxString, SetFilter, GetFilter, wxEMPTY_PARAMETER_VALUE, \\r
+                0 /*flags*/, wxT("Helpstring"), wxT("group") )\r
+    wxPROPERTY( DefaultFilter, int, SetFilterIndex, GetFilterIndex, \\r
+                wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), wxT("group") )\r
+\r
+    wxPROPERTY_FLAGS( WindowStyle, wxGenericDirCtrlStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0, wxT("Helpstring"), \\r
+                      wxT("group") )\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxGenericDirCtrl)\r
+\r
+wxCONSTRUCTOR_8( wxGenericDirCtrl, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxString, DefaultPath, wxPoint, Position, wxSize, Size, \\r
+                 long, WindowStyle, wxString, Filter, int, DefaultFilter )\r
+\r
+#endif // wxUSE_DIRDLG || wxUSE_FILEDLG\r
diff --git a/src/common/gridcmn.cpp b/src/common/gridcmn.cpp
new file mode 100644 (file)
index 0000000..ac75bfc
--- /dev/null
@@ -0,0 +1,89 @@
+///////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/gridcmn.cpp\r
+// Purpose:     wxGrid common code\r
+// Author:      Michael Bedward (based on code by Julian Smart, Robin Dunn)\r
+// Modified by: Robin Dunn, Vadim Zeitlin, Santiago Palacios\r
+// Created:     1/08/1999\r
+// RCS-ID:      $Id: grid.cpp 45814 2007-05-05 10:16:40Z RR $\r
+// Copyright:   (c) Michael Bedward (mbedward@ozemail.com.au)\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// For compilers that support precompilation, includes "wx/wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_GRID\r
+\r
+#include "wx/grid.h"\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/utils.h"\r
+    #include "wx/dcclient.h"\r
+    #include "wx/settings.h"\r
+    #include "wx/log.h"\r
+    #include "wx/textctrl.h"\r
+    #include "wx/checkbox.h"\r
+    #include "wx/combobox.h"\r
+    #include "wx/valtext.h"\r
+    #include "wx/intl.h"\r
+    #include "wx/math.h"\r
+    #include "wx/listbox.h"\r
+#endif\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxGridStyle )\r
+wxBEGIN_FLAGS( wxGridStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB)\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+wxEND_FLAGS( wxGridStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxGrid, wxScrolledWindow, "wx/grid.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxGrid)\r
+    wxHIDE_PROPERTY( Children )\r
+    wxPROPERTY_FLAGS( WindowStyle, wxGridStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxGrid)\r
+\r
+wxCONSTRUCTOR_5( wxGrid, wxWindow*, Parent, wxWindowID, Id, wxPoint, Position, \\r
+                 wxSize, Size, long, WindowStyle )\r
+\r
+/*\r
+ TODO : Expose more information of a list's layout, etc. via appropriate objects (e.g., NotebookPageInfo)\r
+*/\r
+\r
+#endif // wxUSE_GRID\r
diff --git a/src/common/odcombocmn.cpp b/src/common/odcombocmn.cpp
new file mode 100644 (file)
index 0000000..1f6f5fe
--- /dev/null
@@ -0,0 +1,55 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/odcombocmn.cpp\r
+// Purpose:     wxOwnerDrawnComboBox common code\r
+// Author:      Jaakko Salli\r
+// Modified by:\r
+// Created:     Apr-30-2006\r
+// RCS-ID:      $Id: odcombo.cpp 45397 2007-04-11 10:32:01Z MBN $\r
+// Copyright:   (c) 2005 Jaakko Salli\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_ODCOMBOBOX\r
+\r
+#include "wx/odcombo.h"\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/log.h"\r
+    #include "wx/combobox.h"\r
+    #include "wx/dcclient.h"\r
+    #include "wx/settings.h"\r
+    #include "wx/dialog.h"\r
+#endif\r
+\r
+#include "wx/combo.h"\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS2_XTI(wxOwnerDrawnComboBox, wxComboCtrl, \\r
+                               wxControlWithItems, "wx/odcombo.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxOwnerDrawnComboBox)\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxOwnerDrawnComboBox)\r
+\r
+wxCONSTRUCTOR_5( wxOwnerDrawnComboBox , wxWindow* , Parent , wxWindowID , \\r
+                 Id , wxString , Value , wxPoint , Position , wxSize , Size )\r
+\r
+#endif // wxUSE_ODCOMBOBOX\r
diff --git a/src/common/panelcmn.cpp b/src/common/panelcmn.cpp
new file mode 100644 (file)
index 0000000..60192f1
--- /dev/null
@@ -0,0 +1,87 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/panelcmn.cpp\r
+// Purpose:     wxPanel common code\r
+// Author:      Julian Smart, Robert Roebling, Vadim Zeitlin\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: panelg.cpp 45056 2007-03-25 22:41:11Z VZ $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/object.h"\r
+    #include "wx/font.h"\r
+    #include "wx/colour.h"\r
+    #include "wx/settings.h"\r
+    #include "wx/log.h"\r
+    #include "wx/panel.h"\r
+    #include "wx/containr.h"\r
+#endif\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxPanelStyle )\r
+wxBEGIN_FLAGS( wxPanelStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB)\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+wxEND_FLAGS( wxPanelStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxPanel, wxWindow, "wx/panel.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxPanel)\r
+    wxPROPERTY_FLAGS( WindowStyle, wxPanelStyle, long, \\r
+                      SetWindowStyleFlag, GetWindowStyleFlag, \\r
+                      wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+    // style wxTAB_TRAVERSAL\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxPanel)\r
+\r
+wxCONSTRUCTOR_6( wxPanel, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxPoint, Position, wxSize, Size, long, WindowStyle, \\r
+                 wxString, Name)\r
+\r
+\r
diff --git a/src/common/radiobtncmn.cpp b/src/common/radiobtncmn.cpp
new file mode 100644 (file)
index 0000000..a50e707
--- /dev/null
@@ -0,0 +1,93 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/radiobtncmn.cpp\r
+// Purpose:     wxRadioButton common code\r
+// Author:      Julian Smart\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: radiobut.cpp 41144 2006-09-10 23:08:13Z VZ $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_RADIOBTN\r
+\r
+#include "wx/radiobut.h"\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/settings.h"\r
+    #include "wx/dcscreen.h"\r
+#endif\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxRadioButtonStyle )\r
+wxBEGIN_FLAGS( wxRadioButtonStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+    wxFLAGS_MEMBER(wxRB_GROUP)\r
+wxEND_FLAGS( wxRadioButtonStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioButton, wxControl, "wx/radiobut.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxRadioButton)\r
+    wxEVENT_PROPERTY( Click, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEvent )\r
+    wxPROPERTY( Font, wxFont, SetFont, GetFont , wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString(), 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group") )\r
+    wxPROPERTY( Value,bool, SetValue, GetValue, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group") )\r
+    wxPROPERTY_FLAGS( WindowStyle, wxRadioButtonStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxRadioButton)\r
+\r
+wxCONSTRUCTOR_6( wxRadioButton, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxString, Label, wxPoint, Position, wxSize, Size, long, WindowStyle )\r
+\r
+\r
+#endif // wxUSE_RADIOBTN\r
diff --git a/src/common/scrolbarcmn.cpp b/src/common/scrolbarcmn.cpp
new file mode 100644 (file)
index 0000000..6cedc3a
--- /dev/null
@@ -0,0 +1,90 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/scrolbarcmn.cpp\r
+// Purpose:     wxScrollBar common code\r
+// Author:      Julian Smart\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: scrolbar.cpp 39476 2006-05-30 13:43:18Z ABX $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_SCROLLBAR\r
+\r
+#include "wx/scrolbar.h"\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/utils.h"\r
+    #include "wx/settings.h"\r
+#endif\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxScrollBarStyle )\r
+wxBEGIN_FLAGS( wxScrollBarStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+    wxFLAGS_MEMBER(wxSB_HORIZONTAL)\r
+    wxFLAGS_MEMBER(wxSB_VERTICAL)\r
+wxEND_FLAGS( wxScrollBarStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxScrollBar, wxControl, "wx/scrolbar.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxScrollBar)\r
+    wxEVENT_RANGE_PROPERTY( Scroll, wxEVT_SCROLL_TOP, \\r
+                            wxEVT_SCROLL_CHANGED, wxScrollEvent )\r
+\r
+    wxPROPERTY( ThumbPosition, int, SetThumbPosition, GetThumbPosition, 0, \\r
+                0 /*flags*/, wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Range, int, SetRange, GetRange, 0, \\r
+                0 /*flags*/, wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( ThumbSize, int, SetThumbSize, GetThumbSize, 0, \\r
+                0 /*flags*/, wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( PageSize, int, SetPageSize, GetPageSize, 0, \\r
+                0 /*flags*/, wxT("Helpstring"), wxT("group"))\r
+\r
+    wxPROPERTY_FLAGS( WindowStyle, wxScrollBarStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxScrollBar)\r
+\r
+wxCONSTRUCTOR_5( wxScrollBar, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxPoint, Position, wxSize, Size, long, WindowStyle )\r
+\r
+#endif // wxUSE_SCROLLBAR\r
diff --git a/src/common/slidercmn.cpp b/src/common/slidercmn.cpp
new file mode 100644 (file)
index 0000000..ecec156
--- /dev/null
@@ -0,0 +1,108 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/slidercmn.cpp\r
+// Purpose:     wxSlider common code\r
+// Author:      Julian Smart\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: slider95.cpp 41054 2006-09-07 19:01:45Z ABX $\r
+// Copyright:   (c) Julian Smart 1998\r
+//                  Vadim Zeitlin 2004\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_SLIDER\r
+\r
+#include "wx/slider.h"\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxSliderStyle )\r
+wxBEGIN_FLAGS( wxSliderStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+    wxFLAGS_MEMBER(wxSL_HORIZONTAL)\r
+    wxFLAGS_MEMBER(wxSL_VERTICAL)\r
+    wxFLAGS_MEMBER(wxSL_AUTOTICKS)\r
+    wxFLAGS_MEMBER(wxSL_LABELS)\r
+    wxFLAGS_MEMBER(wxSL_LEFT)\r
+    wxFLAGS_MEMBER(wxSL_TOP)\r
+    wxFLAGS_MEMBER(wxSL_RIGHT)\r
+    wxFLAGS_MEMBER(wxSL_BOTTOM)\r
+    wxFLAGS_MEMBER(wxSL_BOTH)\r
+    wxFLAGS_MEMBER(wxSL_SELRANGE)\r
+    wxFLAGS_MEMBER(wxSL_INVERSE)\r
+wxEND_FLAGS( wxSliderStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxSlider, wxControl, "wx/slider.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxSlider)\r
+    wxEVENT_RANGE_PROPERTY( Scroll, wxEVT_SCROLL_TOP, wxEVT_SCROLL_CHANGED, wxScrollEvent )\r
+    wxEVENT_PROPERTY( Updated, wxEVT_COMMAND_SLIDER_UPDATED, wxCommandEvent )\r
+\r
+    wxPROPERTY( Value, int, SetValue, GetValue, 0, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Minimum, int, SetMin, GetMin, 0, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Maximum, int, SetMax, GetMax, 0, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( PageSize, int, SetPageSize, GetLineSize, 1, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( LineSize, int, SetLineSize, GetLineSize, 1, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( ThumbLength, int, SetThumbLength, GetThumbLength, 1, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+\r
+    wxPROPERTY_FLAGS( WindowStyle, wxSliderStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxSlider)\r
+\r
+wxCONSTRUCTOR_8( wxSlider, wxWindow*, Parent, wxWindowID, Id, int, Value, \\r
+                 int, Minimum, int, Maximum, wxPoint, Position, wxSize, Size, \\r
+                 long, WindowStyle )\r
+\r
+#endif // wxUSE_SLIDER\r
diff --git a/src/common/spinbtncmn.cpp b/src/common/spinbtncmn.cpp
new file mode 100644 (file)
index 0000000..ed6848d
--- /dev/null
@@ -0,0 +1,100 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/spinbtncmn.cpp\r
+// Purpose:     wxSpinButton common code\r
+// Author:      Julian Smart\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: spinbutt.cpp 44657 2007-03-07 22:56:34Z VZ $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#ifndef WX_PRECOMP\r
+    #include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"\r
+    #include "wx/app.h"\r
+#endif\r
+\r
+#if wxUSE_SPINBTN\r
+\r
+#include "wx/spinbutt.h"\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxSpinButtonStyle )\r
+wxBEGIN_FLAGS( wxSpinButtonStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+    wxFLAGS_MEMBER(wxSP_HORIZONTAL)\r
+    wxFLAGS_MEMBER(wxSP_VERTICAL)\r
+    wxFLAGS_MEMBER(wxSP_ARROW_KEYS)\r
+    wxFLAGS_MEMBER(wxSP_WRAP)\r
+wxEND_FLAGS( wxSpinButtonStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinButton, wxControl, "wx/spinbut.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxSpinButton)\r
+    wxEVENT_RANGE_PROPERTY( Spin, wxEVT_SCROLL_TOP, wxEVT_SCROLL_CHANGED, wxSpinEvent )\r
+\r
+    wxPROPERTY( Value, int, SetValue, GetValue, 0, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Min, int, SetMin, GetMin, 0, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY( Max, int, SetMax, GetMax, 0, 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+\r
+    wxPROPERTY_FLAGS( WindowStyle, wxSpinButtonStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxSpinButton)\r
+\r
+wxCONSTRUCTOR_5( wxSpinButton, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxPoint, Position, wxSize, Size, long, WindowStyle )\r
+\r
+IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)\r
+\r
+\r
+#endif // wxUSE_SPINBTN\r
diff --git a/src/common/statbmpcmn.cpp b/src/common/statbmpcmn.cpp
new file mode 100644 (file)
index 0000000..acc10b3
--- /dev/null
@@ -0,0 +1,85 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/statbmpcmn.cpp\r
+// Purpose:     wxStaticBitmap common code\r
+// Author:      Julian Smart\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: statbmp.cpp 42816 2006-10-31 08:50:17Z RD $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ===========================================================================\r
+// declarations\r
+// ===========================================================================\r
+\r
+// ---------------------------------------------------------------------------\r
+// headers\r
+// ---------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_STATBMP\r
+\r
+#include "wx/statbmp.h"\r
+\r
+// ---------------------------------------------------------------------------\r
+// XTI\r
+// ---------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxStaticBitmapStyle )\r
+wxBEGIN_FLAGS( wxStaticBitmapStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+wxEND_FLAGS( wxStaticBitmapStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBitmap, wxControl, "wx/statbmp.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxStaticBitmap)\r
+    wxPROPERTY_FLAGS( WindowStyle, wxStaticBitmapStyle, long, \\r
+                      SetWindowStyleFlag, GetWindowStyleFlag, \\r
+                      wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), \\r
+                      wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxStaticBitmap)\r
+\r
+wxCONSTRUCTOR_5( wxStaticBitmap, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxBitmap, Bitmap, wxPoint, Position, wxSize, Size )\r
+\r
+/*\r
+    TODO PROPERTIES :\r
+        bitmap\r
+*/\r
+\r
+#endif // wxUSE_STATBMP\r
diff --git a/src/common/statboxcmn.cpp b/src/common/statboxcmn.cpp
new file mode 100644 (file)
index 0000000..6916286
--- /dev/null
@@ -0,0 +1,81 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/statboxcmn.cpp\r
+// Purpose:     wxStaticBox common code\r
+// Author:      Julian Smart\r
+// Modified by:\r
+// Created:     04/01/98\r
+// RCS-ID:      $Id: statbox.cpp 45008 2007-03-22 02:28:06Z VZ $\r
+// Copyright:   (c) Julian Smart\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#if wxUSE_STATBOX\r
+\r
+#include "wx/statbox.h"\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxStaticBoxStyle )\r
+wxBEGIN_FLAGS( wxStaticBoxStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+wxEND_FLAGS( wxStaticBoxStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBox, wxControl, "wx/statbox.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxStaticBox)\r
+    wxPROPERTY( Label, wxString, SetLabel, GetLabel, wxString(), 0 /*flags*/, \\r
+                wxT("Helpstring"), wxT("group"))\r
+    wxPROPERTY_FLAGS( WindowStyle, wxStaticBoxStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxStaticBox)\r
+\r
+wxCONSTRUCTOR_6( wxStaticBox, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxString, Label, wxPoint, Position, wxSize, Size, \\r
+                 long, WindowStyle )\r
+\r
+#endif // wxUSE_STATBOX\r
diff --git a/src/common/statlinecmn.cpp b/src/common/statlinecmn.cpp
new file mode 100644 (file)
index 0000000..af1c825
--- /dev/null
@@ -0,0 +1,80 @@
+/////////////////////////////////////////////////////////////////////////////\r
+// Name:        src/common/statlinecmn.cpp\r
+// Purpose:     wxStaticLine common code\r
+// Author:      Vadim Zeitlin\r
+// Created:     28.06.99\r
+// Version:     $Id: statline.cpp 41054 2006-09-07 19:01:45Z ABX $\r
+// Copyright:   (c) 1998 Vadim Zeitlin\r
+// Licence:     wxWindows licence\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+// ============================================================================\r
+// declarations\r
+// ============================================================================\r
+\r
+// ----------------------------------------------------------------------------\r
+// headers\r
+// ----------------------------------------------------------------------------\r
+\r
+// For compilers that support precompilation, includes "wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+    #pragma hdrstop\r
+#endif\r
+\r
+#include "wx/statline.h"\r
+\r
+#if wxUSE_STATLINE\r
+\r
+// ----------------------------------------------------------------------------\r
+// XTI\r
+// ----------------------------------------------------------------------------\r
+\r
+wxDEFINE_FLAGS( wxStaticLineStyle )\r
+wxBEGIN_FLAGS( wxStaticLineStyle )\r
+    // new style border flags, we put them first to\r
+    // use them for streaming out\r
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)\r
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)\r
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)\r
+    wxFLAGS_MEMBER(wxBORDER_RAISED)\r
+    wxFLAGS_MEMBER(wxBORDER_STATIC)\r
+    wxFLAGS_MEMBER(wxBORDER_NONE)\r
+\r
+    // old style border flags\r
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)\r
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)\r
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)\r
+    wxFLAGS_MEMBER(wxRAISED_BORDER)\r
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)\r
+    wxFLAGS_MEMBER(wxBORDER)\r
+\r
+    // standard window styles\r
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)\r
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)\r
+    wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)\r
+    wxFLAGS_MEMBER(wxWANTS_CHARS)\r
+    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)\r
+    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )\r
+    wxFLAGS_MEMBER(wxVSCROLL)\r
+    wxFLAGS_MEMBER(wxHSCROLL)\r
+\r
+    wxFLAGS_MEMBER(wxLI_HORIZONTAL)\r
+    wxFLAGS_MEMBER(wxLI_VERTICAL)\r
+wxEND_FLAGS( wxStaticLineStyle )\r
+\r
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine, wxControl, "wx/statline.h")\r
+\r
+wxBEGIN_PROPERTIES_TABLE(wxStaticLine)\r
+    wxPROPERTY_FLAGS( WindowStyle, wxStaticLineStyle, long, SetWindowStyleFlag, \\r
+                      GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \\r
+                      wxT("Helpstring"), wxT("group")) // style\r
+wxEND_PROPERTIES_TABLE()\r
+\r
+wxEMPTY_HANDLERS_TABLE(wxStaticLine)\r
+\r
+wxCONSTRUCTOR_5( wxStaticLine, wxWindow*, Parent, wxWindowID, Id, \\r
+                 wxPoint, Position, wxSize, Size, long, WindowStyle)\r
+\r
+#endif // wxUSE_STATLINE\r