Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / cellview.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/cellview.h>
4 #include <gtkmm/private/cellview_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /* 
10  *
11  * Copyright 1998-2002 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28 #include <gtkmm/cellrenderertext.h>
29 #include <gtkmm/cellrendererpixbuf.h>
30 #include <gtk/gtkcellview.h>
31
32 namespace Gtk
33 {
34
35 CellView::CellView(const Glib::ustring& text, bool use_markup)
36 :
37   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
38   Gtk::Widget(Glib::ConstructParams(cellview_class_.init(), (char*) 0))
39 {
40   Gtk::CellRendererText* cell = Gtk::manage(new Gtk::CellRendererText());
41   
42   if(use_markup)
43     cell->property_markup() = text;
44   else
45     cell->property_text() = text;
46   
47   pack_start(*cell);
48 }
49
50 CellView::CellView(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
51 :
52   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
53   Gtk::Widget(Glib::ConstructParams(cellview_class_.init(), (char*) 0))
54 {
55   Gtk::CellRendererPixbuf* cell = Gtk::manage(new Gtk::CellRendererPixbuf());
56   cell->property_pixbuf() = pixbuf;
57   
58   pack_start(*cell);
59 }
60
61
62 } //namespace Gtk
63
64
65 namespace
66 {
67 } // anonymous namespace
68
69
70 namespace Glib
71 {
72
73 Gtk::CellView* wrap(GtkCellView* object, bool take_copy)
74 {
75   return dynamic_cast<Gtk::CellView *> (Glib::wrap_auto ((GObject*)(object), take_copy));
76 }
77
78 } /* namespace Glib */
79
80 namespace Gtk
81 {
82
83
84 /* The *_Class implementation: */
85
86 const Glib::Class& CellView_Class::init()
87 {
88   if(!gtype_) // create the GType if necessary
89   {
90     // Glib::Class has to know the class init function to clone custom types.
91     class_init_func_ = &CellView_Class::class_init_function;
92
93     // This is actually just optimized away, apparently with no harm.
94     // Make sure that the parent type has been created.
95     //CppClassParent::CppObjectType::get_type();
96
97     // Create the wrapper type, with the same class/instance size as the base type.
98     register_derived_type(gtk_cell_view_get_type());
99
100     // Add derived versions of interfaces, if the C type implements any interfaces:
101   CellLayout::add_interface(get_type());
102   }
103
104   return *this;
105 }
106
107 void CellView_Class::class_init_function(void* g_class, void* class_data)
108 {
109   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
110   CppClassParent::class_init_function(klass, class_data);
111
112 }
113
114
115 Glib::ObjectBase* CellView_Class::wrap_new(GObject* o)
116 {
117   return manage(new CellView((GtkCellView*)(o)));
118
119 }
120
121
122 /* The implementation: */
123
124 CellView::CellView(const Glib::ConstructParams& construct_params)
125 :
126   Gtk::Widget(construct_params)
127 {
128   }
129
130 CellView::CellView(GtkCellView* castitem)
131 :
132   Gtk::Widget((GtkWidget*)(castitem))
133 {
134   }
135
136 CellView::~CellView()
137 {
138   destroy_();
139 }
140
141 CellView::CppClassType CellView::cellview_class_; // initialize static member
142
143 GType CellView::get_type()
144 {
145   return cellview_class_.init().get_type();
146 }
147
148 GType CellView::get_base_type()
149 {
150   return gtk_cell_view_get_type();
151 }
152
153
154 CellView::CellView()
155 :
156   Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
157   Gtk::Widget(Glib::ConstructParams(cellview_class_.init()))
158 {
159   }
160
161 void CellView::set_model(const Glib::RefPtr<TreeModel>& model)
162 {
163   gtk_cell_view_set_model(gobj(), Glib::unwrap(model));
164 }
165
166 void CellView::set_displayed_row(const TreeModel::Path& path)
167 {
168   gtk_cell_view_set_displayed_row(gobj(), const_cast<GtkTreePath*>((path).gobj()));
169 }
170
171 TreeModel::Path CellView::get_displayed_row() const
172 {
173   return Gtk::TreePath(gtk_cell_view_get_displayed_row(const_cast<GtkCellView*>(gobj())), false);
174 }
175
176 bool CellView::get_size_of_row(const TreeModel::Path& path, Requisition& requisition) const
177 {
178   return gtk_cell_view_get_size_of_row(const_cast<GtkCellView*>(gobj()), const_cast<GtkTreePath*>((path).gobj()), (GtkRequisition*)(&requisition));
179 }
180
181 void CellView::set_background_color(const Gdk::Color& color)
182 {
183   gtk_cell_view_set_background_color(gobj(), (color).gobj());
184 }
185
186 Glib::ListHandle<CellRenderer*> CellView::get_cell_renderers()
187 {
188   return Glib::ListHandle<CellRenderer*>(gtk_cell_view_get_cell_renderers(gobj()), Glib::OWNERSHIP_SHALLOW);
189 }
190
191 Glib::ListHandle<const CellRenderer*> CellView::get_cell_renderers() const
192 {
193   return Glib::ListHandle<const CellRenderer*>(gtk_cell_view_get_cell_renderers(const_cast<GtkCellView*>(gobj())), Glib::OWNERSHIP_SHALLOW);
194 }
195
196
197 } // namespace Gtk
198
199