Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / treerowreference.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/treerowreference.h>
4 #include <gtkmm/private/treerowreference_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /* Copyright (C) 2002 The gtkmm Development Team
10  *
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.
15  *
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.
20  *
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.
24  */
25
26 #include <gtk/gtktreemodel.h>
27
28
29 namespace Gtk
30 {
31
32 TreeRowReference::TreeRowReference(const Glib::RefPtr<TreeModel>& model, const TreeModel::Path& path)
33 :
34   gobject_ ( gtk_tree_row_reference_new(model->gobj(), const_cast<GtkTreePath*>(path.gobj())) )
35 {}
36
37 TreeRowReference::operator bool() const
38 {
39   return is_valid();
40 }
41
42 } // namespace Gtk
43
44
45 namespace
46 {
47 } // anonymous namespace
48
49
50 namespace Glib
51 {
52
53 Gtk::TreeRowReference wrap(GtkTreeRowReference* object, bool take_copy)
54 {
55   return Gtk::TreeRowReference(object, take_copy);
56 }
57
58 } // namespace Glib
59
60
61 namespace Gtk
62 {
63
64
65 // static
66 GType TreeRowReference::get_type()
67 {
68   return gtk_tree_row_reference_get_type();
69 }
70
71 TreeRowReference::TreeRowReference()
72 :
73   gobject_ (0) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
74 {}
75
76 TreeRowReference::TreeRowReference(const TreeRowReference& other)
77 :
78   gobject_ ((other.gobject_) ? gtk_tree_row_reference_copy(other.gobject_) : 0)
79 {}
80
81 TreeRowReference::TreeRowReference(GtkTreeRowReference* gobject, bool make_a_copy)
82 :
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)
87 {}
88
89 TreeRowReference& TreeRowReference::operator=(const TreeRowReference& other)
90 {
91   TreeRowReference temp (other);
92   swap(temp);
93   return *this;
94 }
95
96 TreeRowReference::~TreeRowReference()
97 {
98   if(gobject_)
99     gtk_tree_row_reference_free(gobject_);
100 }
101
102 void TreeRowReference::swap(TreeRowReference& other)
103 {
104   GtkTreeRowReference *const temp = gobject_;
105   gobject_ = other.gobject_;
106   other.gobject_ = temp;
107 }
108
109 GtkTreeRowReference* TreeRowReference::gobj_copy() const
110 {
111   return gtk_tree_row_reference_copy(gobject_);
112 }
113
114
115 TreeModel::Path TreeRowReference::get_path() const
116 {
117   return Gtk::TreePath(gtk_tree_row_reference_get_path(const_cast<GtkTreeRowReference*>(gobj())), false);
118 }
119
120 bool TreeRowReference::is_valid() const
121 {
122   return gtk_tree_row_reference_valid(const_cast<GtkTreeRowReference*>(gobj()));
123 }
124
125
126 } // namespace Gtk
127
128