1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/treerowreference.h>
4 #include <gtkmm/private/treerowreference_p.h>
9 /* Copyright (C) 2002 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <gtk/gtktreemodel.h>
32 TreeRowReference::TreeRowReference(const Glib::RefPtr<TreeModel>& model, const TreeModel::Path& path)
34 gobject_ ( gtk_tree_row_reference_new(model->gobj(), const_cast<GtkTreePath*>(path.gobj())) )
37 TreeRowReference::operator bool() const
47 } // anonymous namespace
53 Gtk::TreeRowReference wrap(GtkTreeRowReference* object, bool take_copy)
55 return Gtk::TreeRowReference(object, take_copy);
66 GType TreeRowReference::get_type()
68 return gtk_tree_row_reference_get_type();
71 TreeRowReference::TreeRowReference()
73 gobject_ (0) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
76 TreeRowReference::TreeRowReference(const TreeRowReference& other)
78 gobject_ ((other.gobject_) ? gtk_tree_row_reference_copy(other.gobject_) : 0)
81 TreeRowReference::TreeRowReference(GtkTreeRowReference* gobject, bool make_a_copy)
83 // For BoxedType wrappers, make_a_copy is true by default. The static
84 // BoxedType wrappers must always take a copy, thus make_a_copy = true
85 // ensures identical behaviour if the default argument is used.
86 gobject_ ((make_a_copy && gobject) ? gtk_tree_row_reference_copy(gobject) : gobject)
89 TreeRowReference& TreeRowReference::operator=(const TreeRowReference& other)
91 TreeRowReference temp (other);
96 TreeRowReference::~TreeRowReference()
99 gtk_tree_row_reference_free(gobject_);
102 void TreeRowReference::swap(TreeRowReference& other)
104 GtkTreeRowReference *const temp = gobject_;
105 gobject_ = other.gobject_;
106 other.gobject_ = temp;
109 GtkTreeRowReference* TreeRowReference::gobj_copy() const
111 return gtk_tree_row_reference_copy(gobject_);
115 TreeModel::Path TreeRowReference::get_path() const
117 return Gtk::TreePath(gtk_tree_row_reference_get_path(const_cast<GtkTreeRowReference*>(gobj())), false);
120 bool TreeRowReference::is_valid() const
122 return gtk_tree_row_reference_valid(const_cast<GtkTreeRowReference*>(gobj()));