1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/treerowreference.h>
5 #include <gtkmm/private/treerowreference_p.h>
10 /* Copyright (C) 2002 The gtkmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <gtk/gtktreemodel.h>
33 TreeRowReference::TreeRowReference(const Glib::RefPtr<TreeModel>& model, const TreeModel::Path& path)
35 gobject_ ( gtk_tree_row_reference_new(model->gobj(), const_cast<GtkTreePath*>(path.gobj())) )
38 TreeRowReference::operator bool() const
48 } // anonymous namespace
54 Gtk::TreeRowReference wrap(GtkTreeRowReference* object, bool take_copy)
56 return Gtk::TreeRowReference(object, take_copy);
67 GType TreeRowReference::get_type()
69 return gtk_tree_row_reference_get_type();
72 TreeRowReference::TreeRowReference()
74 gobject_ (0) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
77 TreeRowReference::TreeRowReference(const TreeRowReference& other)
79 gobject_ ((other.gobject_) ? gtk_tree_row_reference_copy(other.gobject_) : 0)
82 TreeRowReference::TreeRowReference(GtkTreeRowReference* gobject, bool make_a_copy)
84 // For BoxedType wrappers, make_a_copy is true by default. The static
85 // BoxedType wrappers must always take a copy, thus make_a_copy = true
86 // ensures identical behaviour if the default argument is used.
87 gobject_ ((make_a_copy && gobject) ? gtk_tree_row_reference_copy(gobject) : gobject)
90 TreeRowReference& TreeRowReference::operator=(const TreeRowReference& other)
92 TreeRowReference temp (other);
97 TreeRowReference::~TreeRowReference()
100 gtk_tree_row_reference_free(gobject_);
103 void TreeRowReference::swap(TreeRowReference& other)
105 GtkTreeRowReference *const temp = gobject_;
106 gobject_ = other.gobject_;
107 other.gobject_ = temp;
110 GtkTreeRowReference* TreeRowReference::gobj_copy() const
112 return gtk_tree_row_reference_copy(gobject_);
116 TreeModel::Path TreeRowReference::get_path() const
118 return Gtk::TreePath(gtk_tree_row_reference_get_path(const_cast<GtkTreeRowReference*>(gobj())), false);
121 Glib::RefPtr<TreeModel> TreeRowReference::get_model()
123 return Glib::wrap(gtk_tree_row_reference_get_model(gobj()));
126 Glib::RefPtr<const TreeModel> TreeRowReference::get_model() const
128 return const_cast<TreeRowReference*>(this)->get_model();
131 bool TreeRowReference::is_valid() const
133 return gtk_tree_row_reference_valid(const_cast<GtkTreeRowReference*>(gobj()));