]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
1. wxShell fixes: now really uses shell (it wasn't different from wxExecute!)
[wxWidgets.git] / include / wx / list.h
index cb08945a0a7b1e3456422bce8ac62543c76667e6..f42942f4420b4072ee0dcc6332833fd52ed76602 100644 (file)
@@ -65,10 +65,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
-typedef int (*wxSortCompareFunction)(const void *elem1, const void *elem2);
+typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
 
 //
-typedef int (*wxListIterateFunction)(void *current);
+typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
 
 // -----------------------------------------------------------------------------
 // key stuff: a list may be optionally keyed on integer or string key
@@ -186,7 +186,8 @@ private:
 // -----------------------------------------------------------------------------
 class WXDLLEXPORT wxListBase : public wxObject
 {
-friend class wxNodeBase; // should be able to call DetachNode()
+friend class wxNodeBase;        // should be able to call DetachNode()
+friend class wxHashTableBase;   // should be able to call untyped Find()
 public:
     // default ctor & dtor
     wxListBase(wxKeyType keyType = wxKEY_NONE) { Init(keyType); }
@@ -267,6 +268,10 @@ protected:
     wxNodeBase *Append(void *object);
         // insert a new item at the beginning of the list
     wxNodeBase *Insert(void *object) { return Insert( (wxNodeBase*)NULL, object); }
+        // insert a new item at the given position
+    wxNodeBase *Insert(size_t pos, void *object)
+        { return pos == GetCount() ? Append(object)
+                                   : Insert(Item(pos), object); }
         // insert before given node or at front of list if prev == NULL
     wxNodeBase *Insert(wxNodeBase *prev, void *object);
 
@@ -349,7 +354,7 @@ private:
 //     retrieved from it.
 
 #define WX_DECLARE_LIST_3(T, Tbase, name, nodetype)                         \
-    typedef int (*wxSortFuncFor_##name)(const T *, const T *);              \
+    typedef int (*wxSortFuncFor_##name)(const T **, const T **);            \
                                                                             \
     class WXDLLEXPORT nodetype : public wxNodeBase                          \
     {                                                                       \
@@ -402,6 +407,8 @@ private:
             { return (nodetype *)wxListBase::Append(object); }              \
         nodetype *Insert(Tbase *object)                                     \
             { return (nodetype *)Insert((nodetype*)NULL, object); }         \
+        nodetype *Insert(size_t pos, Tbase *object)                         \
+            { return (nodetype *)wxListBase::Insert(pos, object); }         \
         nodetype *Insert(nodetype *prev, Tbase *object)                     \
             { return (nodetype *)wxListBase::Insert(prev, object); }        \
                                                                             \
@@ -438,7 +445,7 @@ private:
                                     (nodetype *)prev, (nodetype *)next,     \
                                     (T *)data, key);                        \
             }                                                               \
-    };
+    }
 
 #define WX_DECLARE_LIST_2(elementtype, listname, nodename)                  \
     WX_DECLARE_LIST_3(elementtype, elementtype, listname, nodename)