1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/cellview.h>
4 #include <gtkmm/private/cellview_p.h>
11 * Copyright 1998-2002 The gtkmm Development Team
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.
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.
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.
28 #include <gtkmm/cellrenderertext.h>
29 #include <gtkmm/cellrendererpixbuf.h>
30 #include <gtk/gtkcellview.h>
35 CellView::CellView(const Glib::ustring& text, bool use_markup)
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))
40 Gtk::CellRendererText* cell = Gtk::manage(new Gtk::CellRendererText());
43 cell->property_markup() = text;
45 cell->property_text() = text;
50 CellView::CellView(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
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))
55 Gtk::CellRendererPixbuf* cell = Gtk::manage(new Gtk::CellRendererPixbuf());
56 cell->property_pixbuf() = pixbuf;
67 } // anonymous namespace
73 Gtk::CellView* wrap(GtkCellView* object, bool take_copy)
75 return dynamic_cast<Gtk::CellView *> (Glib::wrap_auto ((GObject*)(object), take_copy));
78 } /* namespace Glib */
84 /* The *_Class implementation: */
86 const Glib::Class& CellView_Class::init()
88 if(!gtype_) // create the GType if necessary
90 // Glib::Class has to know the class init function to clone custom types.
91 class_init_func_ = &CellView_Class::class_init_function;
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();
97 // Create the wrapper type, with the same class/instance size as the base type.
98 register_derived_type(gtk_cell_view_get_type());
100 // Add derived versions of interfaces, if the C type implements any interfaces:
101 CellLayout::add_interface(get_type());
107 void CellView_Class::class_init_function(void* g_class, void* class_data)
109 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
110 CppClassParent::class_init_function(klass, class_data);
115 Glib::ObjectBase* CellView_Class::wrap_new(GObject* o)
117 return manage(new CellView((GtkCellView*)(o)));
122 /* The implementation: */
124 CellView::CellView(const Glib::ConstructParams& construct_params)
126 Gtk::Widget(construct_params)
130 CellView::CellView(GtkCellView* castitem)
132 Gtk::Widget((GtkWidget*)(castitem))
136 CellView::~CellView()
141 CellView::CppClassType CellView::cellview_class_; // initialize static member
143 GType CellView::get_type()
145 return cellview_class_.init().get_type();
148 GType CellView::get_base_type()
150 return gtk_cell_view_get_type();
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()))
161 void CellView::set_model(const Glib::RefPtr<TreeModel>& model)
163 gtk_cell_view_set_model(gobj(), Glib::unwrap(model));
166 void CellView::set_displayed_row(const TreeModel::Path& path)
168 gtk_cell_view_set_displayed_row(gobj(), const_cast<GtkTreePath*>((path).gobj()));
171 TreeModel::Path CellView::get_displayed_row() const
173 return Gtk::TreePath(gtk_cell_view_get_displayed_row(const_cast<GtkCellView*>(gobj())), false);
176 bool CellView::get_size_of_row(const TreeModel::Path& path, Requisition& requisition) const
178 return gtk_cell_view_get_size_of_row(const_cast<GtkCellView*>(gobj()), const_cast<GtkTreePath*>((path).gobj()), (GtkRequisition*)(&requisition));
181 void CellView::set_background_color(const Gdk::Color& color)
183 gtk_cell_view_set_background_color(gobj(), (color).gobj());
186 Glib::ListHandle<CellRenderer*> CellView::get_cell_renderers()
188 return Glib::ListHandle<CellRenderer*>(gtk_cell_view_get_cell_renderers(gobj()), Glib::OWNERSHIP_SHALLOW);
191 Glib::ListHandle<const CellRenderer*> CellView::get_cell_renderers() const
193 return Glib::ListHandle<const CellRenderer*>(gtk_cell_view_get_cell_renderers(const_cast<GtkCellView*>(gobj())), Glib::OWNERSHIP_SHALLOW);