//!
//! \addtogroup linuxui Linux UI
//! @{
//! 

#ifndef _LAYER_TREE_H_
#define _LAYER_TREE_H_

#include <gtkmm/scrolledwindow.h>
#include <gtkmm/treeview.h>

#include "treemodel_wrapper.h"
#include "workbench/wb_context_ui.h"

class LayerTree : public Gtk::ScrolledWindow
{
  wb::WBContextUI *_wbui;
  wb::LayerTreeBE *_layer_tree;
  Gtk::TreeView _tree;
  Glib::RefPtr<TreeModelWrapper> _model;
  Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > *_column;
  
  Glib::RefPtr<Gdk::Pixbuf> _selected_icon;
  Glib::RefPtr<Gdk::Pixbuf> _unselected_icon;
  Glib::RefPtr<Gdk::Pixbuf> _mixed_icon;
  
  bool reexpand_node(const Gtk::TreePath &path);
  void reexpand_nodes();

  void get_tree_value(const Gtk::TreeModel::iterator &iter, int column, Glib::ValueBase& value);

  void activate_row(const Gtk::TreePath &path, Gtk::TreeViewColumn *column);
  
public:
  LayerTree(wb::WBContextUI *wbui);
  ~LayerTree();

  void refresh();
};


#endif /* _LAYER_TREE_H_ */

//!                                                                                                                                     
//! @}                                                                                                                                  
//!
