Ardour  9.0-pre0-582-g084a23a80d
Gtk::TreePath Class Reference

#include <treepath.h>

Public Types

typedef unsigned int size_type
 
typedef int difference_type
 
typedef int value_type
 
typedef int & reference
 
typedef const int & const_reference
 
typedef int * iterator
 
typedef const int * const_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 TreePath ()
 
 TreePath (GtkTreePath *gobject, bool make_a_copy=true)
 
 TreePath (const TreePath &other)
 
TreePathoperator= (const TreePath &other)
 
 ~TreePath ()
 
void swap (TreePath &other)
 
GtkTreePathgobj ()
 Provides access to the underlying C instance. More...
 
const GtkTreePathgobj () const
 Provides access to the underlying C instance. More...
 
GtkTreePathgobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. More...
 
 TreePath (size_type n, value_type value=0)
 
 TreePath (const Glib::ustring &path)
 
 TreePath (const TreeModel::iterator &iter)
 
template<class In >
 TreePath (In pbegin, In pend)
 
void clear ()
 
TreePathoperator= (const TreeModel::iterator &iter)
 
 operator bool () const
 
template<class In >
void assign (In pbegin, In pend)
 
template<class In >
void append (In pbegin, In pend)
 
void push_back (int index)
 
void push_front (int index)
 
size_type size () const
 
bool empty () const
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void next ()
 
bool prev ()
 
bool up ()
 
void down ()
 
bool is_ancestor (const TreePath &descendant) const
 
bool is_descendant (const TreePath &ancestor) const
 
Glib::ustring to_string () const
 
void append_index (int index)
 
void prepend_index (int index)
 
int get_depth () const
 
Glib::ArrayHandle< int > get_indices () const
 
bool set_in_selection_data (SelectionData &selection_data, const Glib::RefPtr< const TreeModel > &model) const
 

Static Public Member Functions

static GType get_type () G_GNUC_CONST
 
static bool get_from_selection_data (const SelectionData &selection_data, Glib::RefPtr< TreeModel > &model, TreePath &path)
 
static bool get_from_selection_data (const SelectionData &selection_data, TreePath &path)
 See description in the other overload. More...
 

Protected Attributes

GtkTreePathgobject_
 

Related Functions

(Note that these are not member functions.)

bool operator== (const TreePath &lhs, const TreePath &rhs)
 
bool operator!= (const TreePath &lhs, const TreePath &rhs)
 
bool operator< (const TreePath &lhs, const TreePath &rhs)
 
bool operator> (const TreePath &lhs, const TreePath &rhs)
 
bool operator<= (const TreePath &lhs, const TreePath &rhs)
 
bool operator>= (const TreePath &lhs, const TreePath &rhs)
 
void swap (TreePath &lhs, TreePath &rhs)
 
Gtk::TreePath wrap (GtkTreePath *object, bool take_copy=false)
 

Detailed Description

A path is essentially a potential node. It is a location on a model that may or may not actually correspond to a node on a specific model.

A Path can be converted into either an array of unsigned integers or a string. The string form is a list of numbers separated by a colon. Each number refers to the offset at that level. Thus, the path "0" refers to the root node and the path "2:4" refers to the fifth child of the third node.

Typedefed as Gtk::TreeModel::Path.

Definition at line 56 of file treepath.h.

Member Typedef Documentation

◆ const_iterator

typedef const int* Gtk::TreePath::const_iterator

Definition at line 104 of file treepath.h.

◆ const_reference

typedef const int& Gtk::TreePath::const_reference

Definition at line 100 of file treepath.h.

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> Gtk::TreePath::const_reverse_iterator

Definition at line 109 of file treepath.h.

◆ difference_type

Definition at line 96 of file treepath.h.

◆ iterator

Definition at line 103 of file treepath.h.

◆ reference

Definition at line 99 of file treepath.h.

◆ reverse_iterator

typedef std::reverse_iterator<iterator> Gtk::TreePath::reverse_iterator

Definition at line 108 of file treepath.h.

◆ size_type

typedef unsigned int Gtk::TreePath::size_type

Definition at line 95 of file treepath.h.

◆ value_type

Definition at line 98 of file treepath.h.

Constructor & Destructor Documentation

◆ TreePath() [1/7]

Gtk::TreePath::TreePath ( )

◆ TreePath() [2/7]

Gtk::TreePath::TreePath ( GtkTreePath gobject,
bool  make_a_copy = true 
)
explicit

◆ TreePath() [3/7]

Gtk::TreePath::TreePath ( const TreePath other)

◆ ~TreePath()

Gtk::TreePath::~TreePath ( )

◆ TreePath() [4/7]

Gtk::TreePath::TreePath ( size_type  n,
value_type  value = 0 
)
explicit

◆ TreePath() [5/7]

Gtk::TreePath::TreePath ( const Glib::ustring &  path)
explicit

◆ TreePath() [6/7]

Gtk::TreePath::TreePath ( const TreeModel::iterator iter)
explicit

◆ TreePath() [7/7]

template<class In >
Gtk::TreePath::TreePath ( In  pbegin,
In  pend 
)
inline

Member Function Documentation

◆ append()

template<class In >
void Gtk::TreePath::append ( In  pbegin,
In  pend 
)

◆ append_index()

void Gtk::TreePath::append_index ( int  index)

Appends a new index to a path. As a result, the depth of the path is increased.

Parameters
indexThe index.

◆ assign()

template<class In >
void Gtk::TreePath::assign ( In  pbegin,
In  pend 
)
inline

◆ back() [1/2]

reference Gtk::TreePath::back ( )
inline

Definition at line 174 of file treepath.h.

◆ back() [2/2]

const_reference Gtk::TreePath::back ( ) const
inline

Definition at line 175 of file treepath.h.

◆ begin() [1/2]

iterator Gtk::TreePath::begin ( )

◆ begin() [2/2]

const_iterator Gtk::TreePath::begin ( ) const

◆ clear()

void Gtk::TreePath::clear ( )

◆ down()

void Gtk::TreePath::down ( )

Moves path to point to the first child of the current path.

◆ empty()

bool Gtk::TreePath::empty ( ) const

◆ end() [1/2]

iterator Gtk::TreePath::end ( )

◆ end() [2/2]

const_iterator Gtk::TreePath::end ( ) const

◆ front() [1/2]

reference Gtk::TreePath::front ( )
inline

Definition at line 172 of file treepath.h.

◆ front() [2/2]

const_reference Gtk::TreePath::front ( ) const
inline

Definition at line 173 of file treepath.h.

◆ get_depth()

int Gtk::TreePath::get_depth ( ) const

Returns the current depth of path.

Returns
The depth of path.

◆ get_from_selection_data() [1/2]

static bool Gtk::TreePath::get_from_selection_data ( const SelectionData selection_data,
Glib::RefPtr< TreeModel > &  model,
TreePath path 
)
static

Obtains a Gtk::TreeModel and Gtk::TreeModel::Path from selection data of target type "GTK_TREE_MODEL_ROW". Normally called from a drag_data_received handler. This function can only be used if selection_data originates from the same process that's calling this function, because a pointer to the tree model is being passed around. If you aren't in the same process, then you'll get memory corruption. In the Gtk::TreeDragDest drag_data_received signal handler, you can assume that selection data of type "GTK_TREE_MODEL_ROW" is from the current process.

Parameters
selection_dataa SelectionData
modela Gtk::TreeModel
patha row in model
Returns
true if the selection_data had target type "GTK_TREE_MODEL_ROW" and is otherwise valid

◆ get_from_selection_data() [2/2]

static bool Gtk::TreePath::get_from_selection_data ( const SelectionData selection_data,
TreePath path 
)
static

See description in the other overload.

◆ get_indices()

Glib::ArrayHandle<int> Gtk::TreePath::get_indices ( ) const

◆ get_type()

static GType Gtk::TreePath::get_type ( )
static

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

◆ gobj() [1/2]

GtkTreePath* Gtk::TreePath::gobj ( )
inline

Provides access to the underlying C instance.

Definition at line 80 of file treepath.h.

◆ gobj() [2/2]

const GtkTreePath* Gtk::TreePath::gobj ( ) const
inline

Provides access to the underlying C instance.

Definition at line 83 of file treepath.h.

◆ gobj_copy()

GtkTreePath* Gtk::TreePath::gobj_copy ( ) const

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

◆ is_ancestor()

bool Gtk::TreePath::is_ancestor ( const TreePath descendant) const

Returns true if descendant is a descendant of path.

Parameters
descendantAnother Gtk::TreePath.
Returns
true if descendant is contained inside path.

◆ is_descendant()

bool Gtk::TreePath::is_descendant ( const TreePath ancestor) const

Returns true if path is a descendant of ancestor.

Parameters
ancestorAnother Gtk::TreePath.
Returns
true if ancestor contains path somewhere below it.

◆ next()

void Gtk::TreePath::next ( )

Moves the path to point to the next node at the current depth.

◆ operator bool()

Gtk::TreePath::operator bool ( ) const

Checks that the path is not empty, by calling empty().

◆ operator=() [1/2]

TreePath& Gtk::TreePath::operator= ( const TreeModel::iterator iter)

◆ operator=() [2/2]

TreePath& Gtk::TreePath::operator= ( const TreePath other)

◆ operator[]() [1/2]

reference Gtk::TreePath::operator[] ( size_type  i)

◆ operator[]() [2/2]

const_reference Gtk::TreePath::operator[] ( size_type  i) const

◆ prepend_index()

void Gtk::TreePath::prepend_index ( int  index)

Prepends a new index to a path. As a result, the depth of the path is increased.

Parameters
indexThe index.

◆ prev()

bool Gtk::TreePath::prev ( )

Moves the path to point to the previous node at the current depth, if it exists.

Returns
true if path has a previous node, and the move was made.

◆ push_back()

void Gtk::TreePath::push_back ( int  index)

Appends a new index to a path. As a result, the depth of the path is increased.

Parameters
indexThe index.

◆ push_front()

void Gtk::TreePath::push_front ( int  index)

Prepends a new index to a path. As a result, the depth of the path is increased.

Parameters
indexThe index.

◆ rbegin() [1/2]

reverse_iterator Gtk::TreePath::rbegin ( )
inline

Definition at line 167 of file treepath.h.

◆ rbegin() [2/2]

const_reverse_iterator Gtk::TreePath::rbegin ( ) const
inline

Definition at line 169 of file treepath.h.

◆ rend() [1/2]

reverse_iterator Gtk::TreePath::rend ( )
inline

Definition at line 168 of file treepath.h.

◆ rend() [2/2]

const_reverse_iterator Gtk::TreePath::rend ( ) const
inline

Definition at line 170 of file treepath.h.

◆ set_in_selection_data()

bool Gtk::TreePath::set_in_selection_data ( SelectionData selection_data,
const Glib::RefPtr< const TreeModel > &  model 
) const

Sets selection data of target type "GTK_TREE_MODEL_ROW". Normally used in a drag_data_get signal handler.

Parameters
selection_datasome SelectionData
modela Gtk::TreeModel
Returns
true if the selection_data had the proper target type to allow us to set a tree row

◆ size()

size_type Gtk::TreePath::size ( ) const

◆ swap()

void Gtk::TreePath::swap ( TreePath other)

◆ to_string()

Glib::ustring Gtk::TreePath::to_string ( ) const

Generates a string representation of the path. This string is a ':' separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.

Returns
The string.

◆ up()

bool Gtk::TreePath::up ( )

Moves the path to point to its parent node, if it has a parent.

Returns
true if path has a parent, and the move was made.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const TreePath lhs,
const TreePath rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
Returns
The result

◆ operator<()

bool operator< ( const TreePath lhs,
const TreePath rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
Returns
The result

◆ operator<=()

bool operator<= ( const TreePath lhs,
const TreePath rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
Returns
The result

◆ operator==()

bool operator== ( const TreePath lhs,
const TreePath rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
Returns
The result

◆ operator>()

bool operator> ( const TreePath lhs,
const TreePath rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
Returns
The result

◆ operator>=()

bool operator>= ( const TreePath lhs,
const TreePath rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
Returns
The result

◆ swap()

void swap ( TreePath lhs,
TreePath rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side

Definition at line 412 of file treepath.h.

◆ wrap()

Gtk::TreePath wrap ( GtkTreePath 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.

Member Data Documentation

◆ gobject_

GtkTreePath* Gtk::TreePath::gobject_
protected

Definition at line 89 of file treepath.h.


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