]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
Fixed typo in my last commit (it did break socket detection code :-( ).
[wxWidgets.git] / include / wx / list.h
index 00d6126db2870bc16b7b1fb87cdfc501f19824e5..791870083debb26293dd6c292b4f4f2fc009557e 100644 (file)
@@ -64,7 +64,10 @@ enum wxKeyType
 // type of compare function for list sort operation (as in 'qsort'): it should
 // return a negative value, 0 or positive value if the first element is less
 // than, equal or greater than the second
 // type of compare function for list sort operation (as in 'qsort'): it should
 // return a negative value, 0 or positive value if the first element is less
 // than, equal or greater than the second
+extern "C"
+{
 typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
 typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
+}
 
 //
 typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
 
 //
 typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
@@ -128,6 +131,8 @@ private:
 
 WXDLLEXPORT_DATA(extern wxListKey) wxDefaultListKey;
 
 
 WXDLLEXPORT_DATA(extern wxListKey) wxDefaultListKey;
 
+class WXDLLEXPORT wxListBase;
+
 class WXDLLEXPORT wxNodeBase
 {
 friend class wxListBase;
 class WXDLLEXPORT wxNodeBase
 {
 friend class wxListBase;
@@ -183,6 +188,7 @@ private:
 // -----------------------------------------------------------------------------
 // a double-linked list class
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // a double-linked list class
 // -----------------------------------------------------------------------------
+
 class WXDLLEXPORT wxListBase : public wxObject
 {
 friend class wxNodeBase;        // should be able to call DetachNode()
 class WXDLLEXPORT wxListBase : public wxObject
 {
 friend class wxNodeBase;        // should be able to call DetachNode()
@@ -440,7 +446,7 @@ private:
             { wxListBase::Sort((wxSortCompareFunction)func); }              \
                                                                             \
     protected:                                                              \
             { wxListBase::Sort((wxSortCompareFunction)func); }              \
                                                                             \
     protected:                                                              \
-        wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next,          \
+        virtual wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next,  \
                                void *data,                                  \
                                const wxListKey& key = wxDefaultListKey)     \
             {                                                               \
                                void *data,                                  \
                                const wxListKey& key = wxDefaultListKey)     \
             {                                                               \
@@ -493,9 +499,8 @@ class WXDLLEXPORT wxList : public wxObjectList
 {
 public:
     wxList(int key_type = wxKEY_NONE) : wxObjectList((wxKeyType)key_type) { }
 {
 public:
     wxList(int key_type = wxKEY_NONE) : wxObjectList((wxKeyType)key_type) { }
-#ifdef __DARWIN__
+    // this destructor is required for Darwin
    ~wxList() { }
    ~wxList() { }
-#endif
 
     wxList& operator=(const wxList& list)
         { return (wxList&)wxListBase::operator=(list); }
 
     wxList& operator=(const wxList& list)
         { return (wxList&)wxListBase::operator=(list); }
@@ -504,6 +509,9 @@ public:
     void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
 
     wxNode *Member(wxObject *object) const { return (wxNode *)Find(object); }
     void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
 
     wxNode *Member(wxObject *object) const { return (wxNode *)Find(object); }
+
+private:
+    DECLARE_DYNAMIC_CLASS(wxList)
 };
 
 // -----------------------------------------------------------------------------
 };
 
 // -----------------------------------------------------------------------------
@@ -541,6 +549,8 @@ public:
 
 private:
     void DoCopy(const wxStringList&); // common part of copy ctor and operator=
 
 private:
     void DoCopy(const wxStringList&); // common part of copy ctor and operator=
+
+    DECLARE_DYNAMIC_CLASS(wxStringList)
 };
 
 #endif // wxLIST_COMPATIBILITY
 };
 
 #endif // wxLIST_COMPATIBILITY