Ardour  9.0-pre0-350-gf17a656217
Gtk::TreeStore Class Reference

#include <treestore.h>

Inheritance diagram for Gtk::TreeStore:
[legend]

Public Member Functions

virtual ~TreeStore ()
 
GtkTreeStoregobj ()
 Provides access to the underlying C GObject. More...
 
const GtkTreeStoregobj () const
 Provides access to the underlying C GObject. More...
 
GtkTreeStoregobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
void set_column_types (const TreeModelColumnRecord &columns)
 
iterator erase (const iterator &iter)
 
iterator insert (const iterator &iter)
 
iterator insert_after (const iterator &iter)
 
iterator prepend ()
 
iterator prepend (const TreeNodeChildren &node)
 
iterator append ()
 
iterator append (const TreeNodeChildren &node)
 
void iter_swap (const iterator &a, const iterator &b)
 
void move (const iterator &source, const iterator &destination)
 
void reorder (const TreeNodeChildren &node, const Glib::ArrayHandle< int > &new_order)
 
void clear ()
 
bool is_ancestor (const iterator &iter, const iterator &descendant) const
 
int iter_depth (const iterator &iter) const
 
bool iter_is_valid (const iterator &iter) const
 
- Public Member Functions inherited from Gtk::TreeModel
virtual ~TreeModel ()
 
GtkTreeModelgobj ()
 Provides access to the underlying C GObject. More...
 
const GtkTreeModelgobj () const
 Provides access to the underlying C GObject. More...
 
iterator get_iter (const Path &path)
 
iterator get_iter (const Glib::ustring &path_string)
 
Children children ()
 This returns an STL-like container API, for iterating over the rows. More...
 
Children children () const
 This returns an STL-like container API, for iterating over the rows. More...
 
void foreach_iter (const SlotForeachIter &slot)
 
void foreach_path (const SlotForeachPath &slot)
 
void foreach (const SlotForeachPathAndIter &slot)
 
TreeModelFlags get_flags () const
 
int get_n_columns () const
 
GType get_column_type (int index) const
 
TreeModel::Path get_path (const iterator &iter) const
 
void row_changed (const Path &path, const iterator &iter)
 
void row_inserted (const Path &path, const iterator &iter)
 
void row_has_child_toggled (const Path &path, const iterator &iter)
 
void row_deleted (const Path &path)
 
void rows_reordered (const Path &path, const iterator &iter, const Glib::ArrayHandle< int > &new_order)
 
void rows_reordered (const Path &path, const Glib::ArrayHandle< int > &new_order)
 
void rows_reordered (const Path &path, const iterator &iter, int *new_order)
 
Glib::ustring get_string (const iterator &iter) const
 
Glib::SignalProxy2< void, const TreeModel::Path &, const TreeModel::iterator & > signal_row_changed ()
 
Glib::SignalProxy2< void, const TreeModel::Path &, const TreeModel::iterator & > signal_row_inserted ()
 
Glib::SignalProxy2< void, const TreeModel::Path &, const TreeModel::iterator & > signal_row_has_child_toggled ()
 
Glib::SignalProxy1< void, const TreeModel::Path & > signal_row_deleted ()
 
Glib::SignalProxy3< void, const TreeModel::Path &, const TreeModel::iterator &, int * > signal_rows_reordered ()
 
- Public Member Functions inherited from Gtk::TreeSortable
virtual ~TreeSortable ()
 
GtkTreeSortablegobj ()
 Provides access to the underlying C GObject. More...
 
const GtkTreeSortablegobj () const
 Provides access to the underlying C GObject. More...
 
bool get_sort_column_id (int &sort_column_id, SortType &order) const
 
void set_sort_column (const TreeModelColumnBase &sort_column_id, SortType order)
 
void set_sort_column (int sort_column_id, SortType order)
 
void set_sort_column_id (const TreeModelColumnBase &sort_column_id, SortType order)
 
void set_sort_column_id (int sort_column_id, SortType order)
 
void set_sort_func (const TreeModelColumnBase &sort_column, const SlotCompare &slot)
 
void set_sort_func (int sort_column_id, const SlotCompare &slot)
 
void set_default_sort_func (const SlotCompare &slot)
 
void unset_default_sort_func ()
 
bool has_default_sort_func () const
 
void sort_column_changed ()
 
Glib::SignalProxy0< void > signal_sort_column_changed ()
 
- Public Member Functions inherited from Gtk::TreeDragSource
virtual ~TreeDragSource ()
 
GtkTreeDragSourcegobj ()
 Provides access to the underlying C GObject. More...
 
const GtkTreeDragSourcegobj () const
 Provides access to the underlying C GObject. More...
 
bool row_draggable (const TreeModel::Path &path) const
 
bool drag_data_get (const TreeModel::Path &path, SelectionData &selection_data)
 
bool drag_data_delete (const TreeModel::Path &path)
 
- Public Member Functions inherited from Gtk::TreeDragDest
virtual ~TreeDragDest ()
 
GtkTreeDragDestgobj ()
 Provides access to the underlying C GObject. More...
 
const GtkTreeDragDestgobj () const
 Provides access to the underlying C GObject. More...
 
bool drag_data_received (const TreeModel::Path &dest, const SelectionData &selection_data)
 
bool row_drop_possible (const TreeModel::Path &dest_path, const SelectionData &selection_data) const
 

Static Public Member Functions

static GType get_type () G_GNUC_CONST
 
static Glib::RefPtr< TreeStorecreate (const TreeModelColumnRecord &columns)
 
- Static Public Member Functions inherited from Gtk::TreeModel
static void add_interface (GType gtype_implementer)
 
static GType get_type () G_GNUC_CONST
 
- Static Public Member Functions inherited from Gtk::TreeSortable
static void add_interface (GType gtype_implementer)
 
static GType get_type () G_GNUC_CONST
 
- Static Public Member Functions inherited from Gtk::TreeDragSource
static void add_interface (GType gtype_implementer)
 
static GType get_type () G_GNUC_CONST
 
- Static Public Member Functions inherited from Gtk::TreeDragDest
static void add_interface (GType gtype_implementer)
 
static GType get_type () G_GNUC_CONST
 

Protected Member Functions

 TreeStore ()
 
 TreeStore (const TreeModelColumnRecord &columns)
 
virtual void set_value_impl (const iterator &row, int column, const Glib::ValueBase &value)
 
- Protected Member Functions inherited from Gtk::TreeModel
 TreeModel ()
 
virtual TreeModelFlags get_flags_vfunc () const
 
virtual int get_n_columns_vfunc () const
 
virtual GType get_column_type_vfunc (int index) const
 
virtual bool iter_next_vfunc (const iterator &iter, iterator &iter_next) const
 
virtual bool get_iter_vfunc (const Path &path, iterator &iter) const
 
virtual bool iter_children_vfunc (const iterator &parent, iterator &iter) const
 
virtual bool iter_parent_vfunc (const iterator &child, iterator &iter) const
 
virtual bool iter_nth_child_vfunc (const iterator &parent, int n, iterator &iter) const
 
virtual bool iter_nth_root_child_vfunc (int n, iterator &iter) const
 
virtual bool iter_has_child_vfunc (const iterator &iter) const
 
virtual int iter_n_children_vfunc (const iterator &iter) const
 
virtual int iter_n_root_children_vfunc () const
 
virtual void ref_node_vfunc (const iterator &iter) const
 
virtual void unref_node_vfunc (const iterator &iter) const
 
virtual TreeModel::Path get_path_vfunc (const iterator &iter) const
 
virtual void get_value_vfunc (const iterator &iter, int column, Glib::ValueBase &value) const
 
virtual void get_value_impl (const iterator &row, int column, Glib::ValueBase &value) const
 
virtual void on_row_changed (const TreeModel::Path &path, const TreeModel::iterator &iter)
 This is a default handler for the signal signal_row_changed(). More...
 
virtual void on_row_inserted (const TreeModel::Path &path, const TreeModel::iterator &iter)
 This is a default handler for the signal signal_row_inserted(). More...
 
virtual void on_row_has_child_toggled (const TreeModel::Path &path, const TreeModel::iterator &iter)
 This is a default handler for the signal signal_row_has_child_toggled(). More...
 
virtual void on_row_deleted (const TreeModel::Path &path)
 This is a default handler for the signal signal_row_deleted(). More...
 
virtual void on_rows_reordered (const TreeModel::Path &path, const TreeModel::iterator &iter, int *new_order)
 This is a default handler for the signal signal_rows_reordered(). More...
 
- Protected Member Functions inherited from Gtk::TreeSortable
 TreeSortable ()
 
virtual bool get_sort_column_id_vfunc (int *sort_column_id, SortType *order) const
 
virtual void set_sort_column_id_vfunc (int sort_column_id, SortType order)
 
virtual void set_sort_func_vfunc (int sort_column_id, GtkTreeIterCompareFunc func, void *data, GDestroyNotify destroy)
 
virtual void set_default_sort_func_vfunc (GtkTreeIterCompareFunc func, void *data, GDestroyNotify destroy)
 
virtual bool has_default_sort_func_vfunc () const
 
virtual void sort_column_changed_vfunc () const
 
virtual void on_sort_column_changed ()
 This is a default handler for the signal signal_sort_column_changed(). More...
 
- Protected Member Functions inherited from Gtk::TreeDragSource
 TreeDragSource ()
 
virtual bool row_draggable_vfunc (const TreeModel::Path &path) const
 
virtual bool drag_data_get_vfunc (const TreeModel::Path &path, SelectionData &selection_data) const
 
virtual bool drag_data_delete_vfunc (const TreeModel::Path &path)
 
- Protected Member Functions inherited from Gtk::TreeDragDest
 TreeDragDest ()
 
virtual bool drag_data_received_vfunc (const TreeModel::Path &dest, const SelectionData &selection_data)
 
virtual bool row_drop_possible_vfunc (const TreeModel::Path &dest, const SelectionData &selection_data) const
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::TreeStorewrap (GtkTreeStore *object, bool take_copy=false)
 

Additional Inherited Members

- Public Types inherited from Gtk::TreeModel
typedef TreeModelColumnRecord ColumnRecord
 
typedef TreeNodeChildren Children
 
typedef Children::iterator iterator
 
typedef Children::reverse_iterator reverse_iterator
 
typedef Children::const_iterator const_iterator
 
typedef Children::const_reverse_iterator const_reverse_iterator
 
typedef TreeRow Row
 
typedef TreePath Path
 
typedef TreeRowReference RowReference
 
typedef sigc::slot< bool, const TreeModel::iterator & > SlotForeachIter
 
typedef sigc::slot< bool, const TreeModel::Path & > SlotForeachPath
 
typedef sigc::slot< bool, const TreeModel::Path &, const TreeModel::iterator & > SlotForeachPathAndIter
 
- Public Types inherited from Gtk::TreeSortable
enum  { DEFAULT_SORT_COLUMN_ID = -1 , DEFAULT_UNSORTED_COLUMN_ID = -2 }
 
typedef sigc::slot< int, const Gtk::TreeModel::iterator &, const Gtk::TreeModel::iterator & > SlotCompare
 

Detailed Description

Definition at line 57 of file treestore.h.

Constructor & Destructor Documentation

◆ ~TreeStore()

virtual Gtk::TreeStore::~TreeStore ( )
virtual

◆ TreeStore() [1/2]

Gtk::TreeStore::TreeStore ( )
protected

When using this constructor, you must use set_column_types() immediately afterwards. This can be useful when deriving from this class, with a fixed TreeModelColumnRecord that is a member of the class. There is no create() method that corresponds to this constructor, because this constructor should only be used by derived classes.

◆ TreeStore() [2/2]

Gtk::TreeStore::TreeStore ( const TreeModelColumnRecord columns)
explicitprotected

Member Function Documentation

◆ append() [1/2]

iterator Gtk::TreeStore::append ( )

Creates a new row at the end of the top-level. The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also insert() and prepend().

Returns
An iterator to the new row.

◆ append() [2/2]

iterator Gtk::TreeStore::append ( const TreeNodeChildren node)

Creates a new row at the end of the row's children. The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also insert() and prepend().

Parameters
nodeThe list of the parent row's children, as returned by Gtk::TreeModel::iterator::children().
Returns
An iterator to the new row.

◆ clear()

void Gtk::TreeStore::clear ( )

Removes all rows from tree_store

◆ create()

static Glib::RefPtr<TreeStore> Gtk::TreeStore::create ( const TreeModelColumnRecord columns)
static

Instantiate a new TreeStore.

Parameters
columnsThe column types for this tree model.
Returns
The new TreeStore.

◆ erase()

iterator Gtk::TreeStore::erase ( const iterator iter)

Removes the given row from the list store.

Parameters
iterThe iterator to the row to be removed.
Returns
An iterator to the next row, or end() if there is none.

◆ get_type()

static GType Gtk::TreeStore::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GtkTreeStore* Gtk::TreeStore::gobj ( )
inline

Provides access to the underlying C GObject.

Definition at line 101 of file treestore.h.

◆ gobj() [2/2]

const GtkTreeStore* Gtk::TreeStore::gobj ( ) const
inline

Provides access to the underlying C GObject.

Definition at line 104 of file treestore.h.

◆ gobj_copy()

GtkTreeStore* Gtk::TreeStore::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ insert()

iterator Gtk::TreeStore::insert ( const iterator iter)

Creates a new row before the position. If iter is end() then a new row will be appended to the list. The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also prepend() and append().

Parameters
iterAn iterator to the row before which the new row will be inserted.
Returns
An iterator to the new row.

◆ insert_after()

iterator Gtk::TreeStore::insert_after ( const iterator iter)

Creates a new row after the position. If iter is end() then a new row will be prepended to the list. The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also prepend() and append().

Parameters
iterAn iterator to the row after which the new row will be inserted.
Returns
An iterator to the new row.

◆ is_ancestor()

bool Gtk::TreeStore::is_ancestor ( const iterator iter,
const iterator descendant 
) const

Returns true if iter is an ancestor of descendant. That is, iter is the parent (or grandparent or great-grandparent) of descendant.

Parameters
iterA valid Gtk::TreeIter.
descendantA valid Gtk::TreeIter.
Returns
true, if iter is an ancestor of descendant.

◆ iter_depth()

int Gtk::TreeStore::iter_depth ( const iterator iter) const

Returns the depth of iter. This will be 0 for anything on the root level, 1 for anything down a level, etc.

Parameters
iterA valid Gtk::TreeIter.
Returns
The depth of iter.

◆ iter_is_valid()

bool Gtk::TreeStore::iter_is_valid ( const iterator iter) const
virtual

WARNING: This function is slow. Only use it for debugging and/or testing purposes.

Checks if the given iter is a valid iter for this Gtk::TreeStore.

Parameters
iterA Gtk::TreeIter.
Returns
true if the iter is valid, false if the iter is invalid.

Reimplemented from Gtk::TreeModel.

◆ iter_swap()

void Gtk::TreeStore::iter_swap ( const iterator a,
const iterator b 
)

Swaps a and b in the same level of tree_store. Note that this function only works with unsorted stores.

Parameters
aA Gtk::TreeIter.
bAnother Gtk::TreeIter.

◆ move()

void Gtk::TreeStore::move ( const iterator source,
const iterator destination 
)

Moves source to the position at destination. source and destination should be at the same level. Note that this function only works with unsorted stores.

Parameters
sourceThe row that should be moved.
destinationThe position to move to.

◆ prepend() [1/2]

iterator Gtk::TreeStore::prepend ( )

Creates a new row at the start of the top-level. The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also insert() and append().

Returns
An iterator to the new row.

◆ prepend() [2/2]

iterator Gtk::TreeStore::prepend ( const TreeNodeChildren node)

Creates a new row at the start of the row's children. The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also insert() and append().

Parameters
nodeThe list of the parent row's children, as returned by Gtk::TreeModel::iterator::children().
Returns
An iterator to the new row.

◆ reorder()

void Gtk::TreeStore::reorder ( const TreeNodeChildren node,
const Glib::ArrayHandle< int > &  new_order 
)

Reorders the children of node to follow the order indicated by new_order. Note that this function only works with unsorted stores.

◆ set_column_types()

void Gtk::TreeStore::set_column_types ( const TreeModelColumnRecord columns)

◆ set_value_impl()

virtual void Gtk::TreeStore::set_value_impl ( const iterator row,
int  column,
const Glib::ValueBase &  value 
)
protectedvirtual

Override and implement this in a derived TreeModel class, so that Row::operator() and Row::set_value() work. You can probably just implement this by calling set_value_vfunc(). Your implementation of set_value_impl() should also call row_changed() after changing the value.

Reimplemented from Gtk::TreeModel.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gtk::TreeStore > wrap ( GtkTreeStore object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: