]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/utils/var_tree.hpp
* all: don't rebuild the whole playtree when an item is updated
[vlc] / modules / gui / skins2 / utils / var_tree.hpp
index 39a1835842983bbf38994f2f6a061ef3a9846808..101d3188aa440ea537332fe3c591c5fdf0e2ca55 100644 (file)
 class VarTree: public Variable, public Subject<VarTree>
 {
     public:
-        VarTree( intf_thread_t *pIntf, VarTree *pParent );
+        VarTree( intf_thread_t *pIntf );
+
+        VarTree( intf_thread_t *pIntf, VarTree *pParent, int id,
+                 const UStringPtr &rcString, bool selected, bool playing,
+                 bool expanded, void *pData );
+
         virtual ~VarTree();
 
         /// Get the variable type
         virtual const string &getType() const { return m_type; }
 
         /// Add a pointer on string in the children's list
-        virtual void add( const UStringPtr &rcString,
-                          bool selected = true,
-                          bool playing = true,
-                          bool expanded = true,
-                          void *pData = NULL );
+        virtual void add( int id, const UStringPtr &rcString, bool selected,
+                          bool playing, bool expanded, void *pData );
 
         /// Remove the selected item from the children's list
         virtual void delSelected();
@@ -54,6 +56,8 @@ class VarTree: public Variable, public Subject<VarTree>
         /// Remove all elements from the children's list
         virtual void clear();
 
+        /// FIXME should be private
+        int m_id;
         UStringPtr m_cString;
         bool m_selected;
         bool m_playing;
@@ -126,9 +130,10 @@ class VarTree: public Variable, public Subject<VarTree>
         /// Given an iterator to a visible item, return the next visible item
         Iterator getNextVisibleItem( Iterator it );
 
-    private:
-//        intf_thread_t *pIntf;
+        /// Find a children node with the given id
+        Iterator findById( int id );
 
+    private:
         /// List of children
         list<VarTree> m_children;