1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/treemodel.h>
4 #include <gtkmm/private/treemodel_p.h>
6 #include <gtk/gtktypebuiltins.h>
10 /* Copyright 1998-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 <gtkmm/treeiter.h>
28 #include <gtkmm/treepath.h>
29 #include <gtk/gtktreestore.h>
30 #include <gtk/gtktreemodel.h>
35 gboolean proxy_foreach_iter_callback(GtkTreeModel* model, GtkTreePath*, GtkTreeIter* iter, void* data)
37 typedef Gtk::TreeModel::SlotForeachIter SlotType;
38 SlotType& slot = *static_cast<SlotType*>(data);
42 return slot(Gtk::TreeModel::iterator(model, iter));
46 Glib::exception_handlers_invoke();
52 gboolean proxy_foreach_path_callback(GtkTreeModel*, GtkTreePath* path, GtkTreeIter*, void* data)
54 typedef Gtk::TreeModel::SlotForeachPath SlotType;
55 SlotType& slot = *static_cast<SlotType*>(data);
59 return slot(Gtk::TreeModel::Path(path, true));
63 Glib::exception_handlers_invoke();
69 gboolean proxy_foreach_path_and_iter_callback(GtkTreeModel* model, GtkTreePath* path,
70 GtkTreeIter* iter, void* data)
72 typedef Gtk::TreeModel::SlotForeachPathAndIter SlotType;
73 SlotType& slot = *static_cast<SlotType*>(data);
77 return slot(Gtk::TreeModel::Path(path, true), Gtk::TreeModel::iterator(model, iter));
81 Glib::exception_handlers_invoke();
87 } //anonymous namespace
90 //Help the code generator, so that it doesn't have to fully qualify this type:
91 typedef Gtk::TreeModel::iterator iterator;
96 TreeModel::iterator TreeModel::get_iter(const Path& path)
98 Gtk::TreeModel::iterator iter(this);
99 gtk_tree_model_get_iter(gobj(), iter.gobj(), const_cast<GtkTreePath*>(path.gobj()));
103 TreeModel::iterator TreeModel::get_iter(const Glib::ustring& path_string)
105 Gtk::TreeModel::iterator iter (this);
106 gtk_tree_model_get_iter_from_string(gobj(), iter.gobj(), path_string.c_str());
110 TreeModel::Children TreeModel::children()
112 return TreeNodeChildren(this);
115 TreeModel::Children TreeModel::children() const
117 //TODO: Remove the const when we have a real const TreeNodeChildren, when we have a real const_iterator.
118 return TreeNodeChildren(const_cast<TreeModel*>(this));
121 void TreeModel::set_value_impl(const iterator&, int, const Glib::ValueBase&)
123 g_assert_not_reached();
126 void TreeModel::get_value_impl(const iterator& row, int column, Glib::ValueBase& value) const
128 gtk_tree_model_get_value(
129 const_cast<GtkTreeModel*>(gobj()),
130 const_cast<GtkTreeIter*>(row.gobj()),
131 column, value.gobj());
134 void TreeModel::foreach_iter(const SlotForeachIter& slot)
136 SlotForeachIter slot_copy (slot);
137 gtk_tree_model_foreach(gobj(), &proxy_foreach_iter_callback, &slot_copy);
140 void TreeModel::foreach_path(const SlotForeachPath& slot)
142 SlotForeachPath slot_copy (slot);
143 gtk_tree_model_foreach(gobj(), &proxy_foreach_path_callback, &slot_copy);
146 void TreeModel::foreach(const SlotForeachPathAndIter& slot)
148 SlotForeachPathAndIter slot_copy (slot);
149 gtk_tree_model_foreach(gobj(), &proxy_foreach_path_and_iter_callback, &slot_copy);
152 bool TreeModel::iter_is_valid(const iterator& iter) const
154 //This method is overriden in TreeStore and ListStore.
155 //This implementation will only be used as a default for custom derived TreeModels,
156 //and when we wrap a C GtkTreeModel with a Gtk::TreeModel instance, without knowing what derived C type it is.
158 // This check is almost the same as the private VALID_ITER() macro in gtkliststore.c and
160 return (!iter.is_end_ && iter.gobj()->stamp != 0);
163 // Custom vfunc callbacks, because the C++ vfuncs have different parameters and return types
164 // that can not be generated automatically:
165 gboolean TreeModel_Class::iter_next_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
167 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
168 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
170 // Non-gtkmmproc-generated custom classes implicitly call the default
171 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
172 // generated classes can use this optimisation, which avoids the unnecessary
173 // parameter conversions if there is no possibility of the virtual function
175 if(obj && obj->is_derived_())
177 try // Trap C++ exceptions which would normally be lost because this is a C callback.
179 // Call the virtual member method, which derived classes might override.
180 TreeModel::iterator iter_input = TreeModel::iterator(self, iter);
181 TreeModel::iterator iter_next( self, iter ); //Copies iter by value.
182 gboolean test = obj->iter_next_vfunc(iter_input, iter_next);
184 //Copy the new iter value to the C output parameter:
186 *iter = *(iter_next.gobj());
192 Glib::exception_handlers_invoke();
197 BaseClassType *const base = static_cast<BaseClassType*>(
198 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
199 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
203 // Call the original underlying C function:
204 if(base && base->iter_next)
205 return (*base->iter_next)(self, iter);
208 typedef gboolean RType;
213 bool TreeModel::iter_next_vfunc(const iterator& iter, iterator& iter_next) const
215 //Call the default C implementation:
217 BaseClassType *const base = static_cast<BaseClassType*>(
218 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
219 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
223 if(base && base->iter_next)
225 TreeModel::iterator iter_copy = iter;
226 gboolean test = (*base->iter_next)(const_cast<GtkTreeModel*>(gobj()), iter_copy.gobj());
228 iter_next = iter_copy;
236 gboolean TreeModel_Class::get_iter_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreePath* path)
238 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
239 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
241 // Non-gtkmmproc-generated custom classes implicitly call the default
242 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
243 // generated classes can use this optimisation, which avoids the unnecessary
244 // parameter conversions if there is no possibility of the virtual function
246 if(obj && obj->is_derived_())
248 try // Trap C++ exceptions which would normally be lost because this is a C callback.
250 // Call the virtual member method, which derived classes might override.
251 Gtk::TreeModel::iterator iter_out(self, iter); //copies the iter by value.
252 gboolean test = obj->get_iter_vfunc(Gtk::TreePath(path, true), iter_out);
254 //Copy the new iter value to the C output parameter:
256 *iter = *(iter_out.gobj());
262 Glib::exception_handlers_invoke();
267 BaseClassType *const base = static_cast<BaseClassType*>(
268 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
269 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
272 // Call the original underlying C function:
273 if(base && base->get_iter)
274 return (*base->get_iter)(self, iter, const_cast<GtkTreePath*>(path));
277 typedef gboolean RType;
281 bool TreeModel::get_iter_vfunc(const Path& path, iterator& iter) const
283 //Call the default C implementation:
285 BaseClassType *const base = static_cast<BaseClassType*>(
286 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
287 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
291 if(base && base->get_iter)
293 return (*base->get_iter)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreePath*>(path.gobj()) );
299 gboolean TreeModel_Class::iter_children_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* parent)
301 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
302 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
304 // Non-gtkmmproc-generated custom classes implicitly call the default
305 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
306 // generated classes can use this optimisation, which avoids the unnecessary
307 // parameter conversions if there is no possibility of the virtual function
309 if(obj && obj->is_derived_())
311 try // Trap C++ exceptions which would normally be lost because this is a C callback.
313 // Call the virtual member method, which derived classes might override.
314 Gtk::TreeModel::iterator iter_out(self, iter); //copies the iter by value.
316 gboolean test = false;
319 //Deal with this case, which is documented in the C docs as:
320 //" If @parent is %NULL returns the first node, equivalent to
321 // <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal> "
322 test = obj->iter_nth_root_child_vfunc(0, iter_out);
327 Gtk::TreeModel::iterator parent_cpp(self, parent);
328 test = obj->iter_children_vfunc(parent_cpp, iter_out);
331 //Copy the new iter value to the C output parameter:
333 *iter = *(iter_out.gobj());
339 Glib::exception_handlers_invoke();
344 BaseClassType *const base = static_cast<BaseClassType*>(
345 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
346 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
349 // Call the original underlying C function:
350 if(base && base->iter_children)
351 return (*base->iter_children)(self, iter, parent);
354 typedef gboolean RType;
358 bool TreeModel::iter_children_vfunc(const iterator& parent, iterator& iter) const
360 //Call the default C implementation:
362 BaseClassType *const base = static_cast<BaseClassType*>(
363 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
364 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
368 if(base && base->iter_children)
370 return (*base->iter_children)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(parent.gobj()) );
376 gboolean TreeModel_Class::iter_parent_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* child)
378 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
379 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
381 // Non-gtkmmproc-generated custom classes implicitly call the default
382 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
383 // generated classes can use this optimisation, which avoids the unnecessary
384 // parameter conversions if there is no possibility of the virtual function
386 if(obj && obj->is_derived_())
388 try // Trap C++ exceptions which would normally be lost because this is a C callback.
390 // Call the virtual member method, which derived classes might override.
391 Gtk::TreeModel::iterator iter_out(self, iter);
392 Gtk::TreeModel::iterator child_cpp(self, child);
393 gboolean test = obj->iter_parent_vfunc(child_cpp, iter_out);
395 //Copy the new iter value to the C output parameter:
397 *iter = *(iter_out.gobj());
403 Glib::exception_handlers_invoke();
408 BaseClassType *const base = static_cast<BaseClassType*>(
409 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
410 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
413 // Call the original underlying C function:
414 if(base && base->iter_parent)
415 return (*base->iter_parent)(self, iter, child);
418 typedef gboolean RType;
422 bool TreeModel::iter_parent_vfunc(const iterator& child, iterator& iter) const
424 //Call the default C implementation:
426 BaseClassType *const base = static_cast<BaseClassType*>(
427 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
428 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
432 if(base && base->iter_parent)
434 return (*base->iter_parent)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(child.gobj()) );
440 gboolean TreeModel_Class::iter_nth_child_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* parent, int n)
442 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
443 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
445 // Non-gtkmmproc-generated custom classes implicitly call the default
446 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
447 // generated classes can use this optimisation, which avoids the unnecessary
448 // parameter conversions if there is no possibility of the virtual function
450 if(obj && obj->is_derived_())
452 try // Trap C++ exceptions which would normally be lost because this is a C callback.
454 // Call the virtual member method, which derived classes might override.
455 Gtk::TreeModel::iterator iter_out(self, iter);
457 gboolean test = false;
460 // Deal with this special case, docuemnted in the C docs as:
461 // "As a special case, if @parent is %NULL, then the nth root node is set.":
462 test = obj->iter_nth_root_child_vfunc(n, iter_out);
467 Gtk::TreeModel::iterator parent_cpp(self, parent);
468 test = obj->iter_nth_child_vfunc(parent_cpp, n, iter_out);
471 //Copy the new iter value to the C output parameter:
473 *iter = *(iter_out.gobj());
479 Glib::exception_handlers_invoke();
484 BaseClassType *const base = static_cast<BaseClassType*>(
485 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
486 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
489 // Call the original underlying C function:
490 if(base && base->iter_nth_child)
491 return (*base->iter_nth_child)(self, iter, parent, n);
494 typedef gboolean RType;
498 bool TreeModel::iter_nth_child_vfunc(const iterator& parent, int n, iterator& iter) const
500 //Call the default C implementation:
502 BaseClassType *const base = static_cast<BaseClassType*>(
503 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
504 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
508 if(base && base->iter_nth_child)
510 return (*base->iter_nth_child)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(parent.gobj()), n );
516 //See the implementation of iter_children_vfunc_callback() and iter_nth_child_vfunc_callback()
517 //to find out why this virtual function exists:
518 bool TreeModel::iter_nth_root_child_vfunc(int n, iterator& iter) const
520 //Call the default C implementation:
522 BaseClassType *const base = static_cast<BaseClassType*>(
523 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
524 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
528 if(base && base->iter_nth_child)
530 //This means that iter_nth_child(0) might be called by iter_children_vfunc_callback(),
531 //but hopefully that's exactly the same thing. TODO: Ask why both vfuncs exist. murrayc.
532 return (*base->iter_nth_child)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), 0 /* the null parent */, n );
538 gboolean TreeModel_Class::iter_n_children_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
540 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
541 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
543 // Non-gtkmmproc-generated custom classes implicitly call the default
544 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
545 // generated classes can use this optimisation, which avoids the unnecessary
546 // parameter conversions if there is no possibility of the virtual function
548 if(obj && obj->is_derived_())
550 try // Trap C++ exceptions which would normally be lost because this is a C callback.
552 // Call the virtual member method, which derived classes might override.
554 //Deal with the case that iter is null, as described in the C docs:
556 return obj->iter_n_children_vfunc( Gtk::TreeModel::iterator(self, iter) );
558 return obj->iter_n_root_children_vfunc();
562 Glib::exception_handlers_invoke();
567 BaseClassType *const base = static_cast<BaseClassType*>(
568 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
569 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
572 // Call the original underlying C function:
573 if(base && base->iter_n_children)
574 return (*base->iter_n_children)(self, iter);
577 typedef gboolean RType;
581 int TreeModel::iter_n_children_vfunc(const iterator& iter) const
583 BaseClassType *const base = static_cast<BaseClassType*>(
584 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
585 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
588 if(base && base->iter_n_children)
589 return (*base->iter_n_children)(const_cast<GtkTreeModel*>(gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
595 int TreeModel::iter_n_root_children_vfunc() const
597 BaseClassType *const base = static_cast<BaseClassType*>(
598 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
599 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
602 if(base && base->iter_n_children)
603 return (*base->iter_n_children)(const_cast<GtkTreeModel*>(gobj()), 0 /* null iter to mean root node, as described in C docs */);
610 void TreeModel::rows_reordered(const Path& path, const iterator& iter, const Glib::ArrayHandle<int>& new_order)
612 //The size of the array seems to be based on the known number of children. murrayc.
613 gtk_tree_model_rows_reordered(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()), const_cast<int*>(new_order.data()));
623 void TreeModel_signal_row_changed_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
626 typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
628 // Do not try to call a signal on a disassociated wrapper.
629 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
633 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
634 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
635 , Gtk::TreeModel::iterator(self, iter)
640 Glib::exception_handlers_invoke();
645 const Glib::SignalProxyInfo TreeModel_signal_row_changed_info =
648 (GCallback) &TreeModel_signal_row_changed_callback,
649 (GCallback) &TreeModel_signal_row_changed_callback
653 void TreeModel_signal_row_inserted_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
656 typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
658 // Do not try to call a signal on a disassociated wrapper.
659 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
663 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
664 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
665 , Gtk::TreeModel::iterator(self, iter)
670 Glib::exception_handlers_invoke();
675 const Glib::SignalProxyInfo TreeModel_signal_row_inserted_info =
678 (GCallback) &TreeModel_signal_row_inserted_callback,
679 (GCallback) &TreeModel_signal_row_inserted_callback
683 void TreeModel_signal_row_has_child_toggled_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
686 typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
688 // Do not try to call a signal on a disassociated wrapper.
689 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
693 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
694 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
695 , Gtk::TreeModel::iterator(self, iter)
700 Glib::exception_handlers_invoke();
705 const Glib::SignalProxyInfo TreeModel_signal_row_has_child_toggled_info =
707 "row_has_child_toggled",
708 (GCallback) &TreeModel_signal_row_has_child_toggled_callback,
709 (GCallback) &TreeModel_signal_row_has_child_toggled_callback
713 void TreeModel_signal_row_deleted_callback(GtkTreeModel* self, GtkTreePath* path,void* data)
716 typedef sigc::slot< void,const TreeModel::Path& > SlotType;
718 // Do not try to call a signal on a disassociated wrapper.
719 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
723 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
724 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
729 Glib::exception_handlers_invoke();
734 const Glib::SignalProxyInfo TreeModel_signal_row_deleted_info =
737 (GCallback) &TreeModel_signal_row_deleted_callback,
738 (GCallback) &TreeModel_signal_row_deleted_callback
742 void TreeModel_signal_rows_reordered_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,gint* new_order,void* data)
745 typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator&,int* > SlotType;
747 // Do not try to call a signal on a disassociated wrapper.
748 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
752 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
753 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
754 , Gtk::TreeModel::iterator(self, iter)
760 Glib::exception_handlers_invoke();
765 const Glib::SignalProxyInfo TreeModel_signal_rows_reordered_info =
768 (GCallback) &TreeModel_signal_rows_reordered_callback,
769 (GCallback) &TreeModel_signal_rows_reordered_callback
772 } // anonymous namespace
775 GType Glib::Value<Gtk::TreeModelFlags>::value_type()
777 return gtk_tree_model_flags_get_type();
784 Glib::RefPtr<Gtk::TreeModel> wrap(GtkTreeModel* object, bool take_copy)
786 return Glib::RefPtr<Gtk::TreeModel>( dynamic_cast<Gtk::TreeModel*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
787 //We use dynamic_cast<> in case of multiple inheritance.
797 /* The *_Class implementation: */
799 const Glib::Interface_Class& TreeModel_Class::init()
801 if(!gtype_) // create the GType if necessary
803 // Glib::Interface_Class has to know the interface init function
804 // in order to add interfaces to implementing types.
805 class_init_func_ = &TreeModel_Class::iface_init_function;
807 // We can not derive from another interface, and it is not necessary anyway.
808 gtype_ = gtk_tree_model_get_type();
814 void TreeModel_Class::iface_init_function(void* g_iface, void*)
816 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
818 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
819 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
820 g_assert(klass != 0);
822 klass->get_flags = &get_flags_vfunc_callback;
823 klass->get_n_columns = &get_n_columns_vfunc_callback;
824 klass->get_column_type = &get_column_type_vfunc_callback;
825 klass->iter_next = &iter_next_vfunc_callback;
826 klass->get_iter = &get_iter_vfunc_callback;
827 klass->iter_children = &iter_children_vfunc_callback;
828 klass->iter_parent = &iter_parent_vfunc_callback;
829 klass->iter_nth_child = &iter_nth_child_vfunc_callback;
830 klass->iter_n_children = &iter_n_children_vfunc_callback;
831 klass->iter_has_child = &iter_has_child_vfunc_callback;
832 klass->ref_node = &ref_node_vfunc_callback;
833 klass->unref_node = &unref_node_vfunc_callback;
834 klass->get_path = &get_path_vfunc_callback;
835 klass->get_value = &get_value_vfunc_callback;
836 klass->row_changed = &row_changed_callback;
837 klass->row_inserted = &row_inserted_callback;
838 klass->row_has_child_toggled = &row_has_child_toggled_callback;
839 klass->row_deleted = &row_deleted_callback;
840 klass->rows_reordered = &rows_reordered_callback;
843 GtkTreeModelFlags TreeModel_Class::get_flags_vfunc_callback(GtkTreeModel* self)
845 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
846 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
848 // Non-gtkmmproc-generated custom classes implicitly call the default
849 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
850 // generated classes can use this optimisation, which avoids the unnecessary
851 // parameter conversions if there is no possibility of the virtual function
853 if(obj && obj->is_derived_())
855 try // Trap C++ exceptions which would normally be lost because this is a C callback.
857 // Call the virtual member method, which derived classes might override.
858 return ((GtkTreeModelFlags)(obj->get_flags_vfunc()));
862 Glib::exception_handlers_invoke();
867 BaseClassType *const base = static_cast<BaseClassType*>(
868 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
869 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
872 // Call the original underlying C function:
873 if(base && base->get_flags)
874 return (*base->get_flags)(self);
877 typedef GtkTreeModelFlags RType;
881 gint TreeModel_Class::get_n_columns_vfunc_callback(GtkTreeModel* self)
883 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
884 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
886 // Non-gtkmmproc-generated custom classes implicitly call the default
887 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
888 // generated classes can use this optimisation, which avoids the unnecessary
889 // parameter conversions if there is no possibility of the virtual function
891 if(obj && obj->is_derived_())
893 try // Trap C++ exceptions which would normally be lost because this is a C callback.
895 // Call the virtual member method, which derived classes might override.
896 return obj->get_n_columns_vfunc();
900 Glib::exception_handlers_invoke();
905 BaseClassType *const base = static_cast<BaseClassType*>(
906 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
907 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
910 // Call the original underlying C function:
911 if(base && base->get_n_columns)
912 return (*base->get_n_columns)(self);
919 GType TreeModel_Class::get_column_type_vfunc_callback(GtkTreeModel* self, gint index)
921 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
922 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
924 // Non-gtkmmproc-generated custom classes implicitly call the default
925 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
926 // generated classes can use this optimisation, which avoids the unnecessary
927 // parameter conversions if there is no possibility of the virtual function
929 if(obj && obj->is_derived_())
931 try // Trap C++ exceptions which would normally be lost because this is a C callback.
933 // Call the virtual member method, which derived classes might override.
934 return obj->get_column_type_vfunc(index
939 Glib::exception_handlers_invoke();
944 BaseClassType *const base = static_cast<BaseClassType*>(
945 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
946 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
949 // Call the original underlying C function:
950 if(base && base->get_column_type)
951 return (*base->get_column_type)(self, index);
958 gboolean TreeModel_Class::iter_has_child_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
960 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
961 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
963 // Non-gtkmmproc-generated custom classes implicitly call the default
964 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
965 // generated classes can use this optimisation, which avoids the unnecessary
966 // parameter conversions if there is no possibility of the virtual function
968 if(obj && obj->is_derived_())
970 try // Trap C++ exceptions which would normally be lost because this is a C callback.
972 // Call the virtual member method, which derived classes might override.
973 return static_cast<int>(obj->iter_has_child_vfunc(Gtk::TreeModel::iterator(self, iter)
978 Glib::exception_handlers_invoke();
983 BaseClassType *const base = static_cast<BaseClassType*>(
984 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
985 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
988 // Call the original underlying C function:
989 if(base && base->iter_has_child)
990 return (*base->iter_has_child)(self, iter);
993 typedef gboolean RType;
997 void TreeModel_Class::ref_node_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
999 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1000 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1002 // Non-gtkmmproc-generated custom classes implicitly call the default
1003 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1004 // generated classes can use this optimisation, which avoids the unnecessary
1005 // parameter conversions if there is no possibility of the virtual function
1006 // being overridden:
1007 if(obj && obj->is_derived_())
1009 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1011 // Call the virtual member method, which derived classes might override.
1012 obj->ref_node_vfunc(Gtk::TreeModel::iterator(self, iter)
1017 Glib::exception_handlers_invoke();
1022 BaseClassType *const base = static_cast<BaseClassType*>(
1023 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1024 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1027 // Call the original underlying C function:
1028 if(base && base->ref_node)
1029 (*base->ref_node)(self, iter);
1033 void TreeModel_Class::unref_node_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1035 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1036 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1038 // Non-gtkmmproc-generated custom classes implicitly call the default
1039 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1040 // generated classes can use this optimisation, which avoids the unnecessary
1041 // parameter conversions if there is no possibility of the virtual function
1042 // being overridden:
1043 if(obj && obj->is_derived_())
1045 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1047 // Call the virtual member method, which derived classes might override.
1048 obj->unref_node_vfunc(Gtk::TreeModel::iterator(self, iter)
1053 Glib::exception_handlers_invoke();
1058 BaseClassType *const base = static_cast<BaseClassType*>(
1059 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1060 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1063 // Call the original underlying C function:
1064 if(base && base->unref_node)
1065 (*base->unref_node)(self, iter);
1069 GtkTreePath* TreeModel_Class::get_path_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1071 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1072 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1074 // Non-gtkmmproc-generated custom classes implicitly call the default
1075 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1076 // generated classes can use this optimisation, which avoids the unnecessary
1077 // parameter conversions if there is no possibility of the virtual function
1078 // being overridden:
1079 if(obj && obj->is_derived_())
1081 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1083 // Call the virtual member method, which derived classes might override.
1084 return (obj->get_path_vfunc(Gtk::TreeModel::iterator(self, iter)
1089 Glib::exception_handlers_invoke();
1094 BaseClassType *const base = static_cast<BaseClassType*>(
1095 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1096 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1099 // Call the original underlying C function:
1100 if(base && base->get_path)
1101 return (*base->get_path)(self, iter);
1104 typedef GtkTreePath* RType;
1108 void TreeModel_Class::get_value_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, gint column, GValue* value)
1110 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1111 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1113 // Non-gtkmmproc-generated custom classes implicitly call the default
1114 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1115 // generated classes can use this optimisation, which avoids the unnecessary
1116 // parameter conversions if there is no possibility of the virtual function
1117 // being overridden:
1118 if(obj && obj->is_derived_())
1120 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1122 // Call the virtual member method, which derived classes might override.
1123 obj->get_value_vfunc(Gtk::TreeModel::iterator(self, iter)
1125 , *reinterpret_cast<Glib::ValueBase*>(value)
1130 Glib::exception_handlers_invoke();
1135 BaseClassType *const base = static_cast<BaseClassType*>(
1136 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1137 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1140 // Call the original underlying C function:
1141 if(base && base->get_value)
1142 (*base->get_value)(self, iter, column, value);
1147 void TreeModel_Class::row_changed_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1149 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1150 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1152 // Non-gtkmmproc-generated custom classes implicitly call the default
1153 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1154 // generated classes can use this optimisation, which avoids the unnecessary
1155 // parameter conversions if there is no possibility of the virtual function
1156 // being overridden:
1157 if(obj && obj->is_derived_())
1159 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1161 // Call the virtual member method, which derived classes might override.
1162 obj->on_row_changed(Gtk::TreePath(path, true)
1163 , Gtk::TreeModel::iterator(self, iter)
1168 Glib::exception_handlers_invoke();
1173 BaseClassType *const base = static_cast<BaseClassType*>(
1174 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1175 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1178 // Call the original underlying C function:
1179 if(base && base->row_changed)
1180 (*base->row_changed)(self, path, iter);
1184 void TreeModel_Class::row_inserted_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1186 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1187 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1189 // Non-gtkmmproc-generated custom classes implicitly call the default
1190 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1191 // generated classes can use this optimisation, which avoids the unnecessary
1192 // parameter conversions if there is no possibility of the virtual function
1193 // being overridden:
1194 if(obj && obj->is_derived_())
1196 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1198 // Call the virtual member method, which derived classes might override.
1199 obj->on_row_inserted(Gtk::TreePath(path, true)
1200 , Gtk::TreeModel::iterator(self, iter)
1205 Glib::exception_handlers_invoke();
1210 BaseClassType *const base = static_cast<BaseClassType*>(
1211 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1212 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1215 // Call the original underlying C function:
1216 if(base && base->row_inserted)
1217 (*base->row_inserted)(self, path, iter);
1221 void TreeModel_Class::row_has_child_toggled_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1223 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1224 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1226 // Non-gtkmmproc-generated custom classes implicitly call the default
1227 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1228 // generated classes can use this optimisation, which avoids the unnecessary
1229 // parameter conversions if there is no possibility of the virtual function
1230 // being overridden:
1231 if(obj && obj->is_derived_())
1233 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1235 // Call the virtual member method, which derived classes might override.
1236 obj->on_row_has_child_toggled(Gtk::TreePath(path, true)
1237 , Gtk::TreeModel::iterator(self, iter)
1242 Glib::exception_handlers_invoke();
1247 BaseClassType *const base = static_cast<BaseClassType*>(
1248 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1249 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1252 // Call the original underlying C function:
1253 if(base && base->row_has_child_toggled)
1254 (*base->row_has_child_toggled)(self, path, iter);
1258 void TreeModel_Class::row_deleted_callback(GtkTreeModel* self, GtkTreePath* path)
1260 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1261 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1263 // Non-gtkmmproc-generated custom classes implicitly call the default
1264 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1265 // generated classes can use this optimisation, which avoids the unnecessary
1266 // parameter conversions if there is no possibility of the virtual function
1267 // being overridden:
1268 if(obj && obj->is_derived_())
1270 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1272 // Call the virtual member method, which derived classes might override.
1273 obj->on_row_deleted(Gtk::TreePath(path, true)
1278 Glib::exception_handlers_invoke();
1283 BaseClassType *const base = static_cast<BaseClassType*>(
1284 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1285 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1288 // Call the original underlying C function:
1289 if(base && base->row_deleted)
1290 (*base->row_deleted)(self, path);
1294 void TreeModel_Class::rows_reordered_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter, gint* new_order)
1296 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
1297 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1299 // Non-gtkmmproc-generated custom classes implicitly call the default
1300 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1301 // generated classes can use this optimisation, which avoids the unnecessary
1302 // parameter conversions if there is no possibility of the virtual function
1303 // being overridden:
1304 if(obj && obj->is_derived_())
1306 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1308 // Call the virtual member method, which derived classes might override.
1309 obj->on_rows_reordered(Gtk::TreePath(path, true)
1310 , Gtk::TreeModel::iterator(self, iter)
1316 Glib::exception_handlers_invoke();
1321 BaseClassType *const base = static_cast<BaseClassType*>(
1322 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1323 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1326 // Call the original underlying C function:
1327 if(base && base->rows_reordered)
1328 (*base->rows_reordered)(self, path, iter, new_order);
1333 Glib::ObjectBase* TreeModel_Class::wrap_new(GObject* object)
1335 return new TreeModel((GtkTreeModel*)(object));
1339 /* The implementation: */
1341 TreeModel::TreeModel()
1343 Glib::Interface(treemodel_class_.init())
1346 TreeModel::TreeModel(GtkTreeModel* castitem)
1348 Glib::Interface((GObject*)(castitem))
1351 TreeModel::~TreeModel()
1355 void TreeModel::add_interface(GType gtype_implementer)
1357 treemodel_class_.init().add_interface(gtype_implementer);
1360 TreeModel::CppClassType TreeModel::treemodel_class_; // initialize static member
1362 GType TreeModel::get_type()
1364 return treemodel_class_.init().get_type();
1367 GType TreeModel::get_base_type()
1369 return gtk_tree_model_get_type();
1373 TreeModelFlags TreeModel::get_flags() const
1375 return ((TreeModelFlags)(gtk_tree_model_get_flags(const_cast<GtkTreeModel*>(gobj()))));
1378 int TreeModel::get_n_columns() const
1380 return gtk_tree_model_get_n_columns(const_cast<GtkTreeModel*>(gobj()));
1383 GType TreeModel::get_column_type(int index) const
1385 return gtk_tree_model_get_column_type(const_cast<GtkTreeModel*>(gobj()), index);
1388 TreeModel::Path TreeModel::get_path(const iterator& iter) const
1390 return Gtk::TreePath(gtk_tree_model_get_path(const_cast<GtkTreeModel*>(gobj()), const_cast<GtkTreeIter*>((iter).gobj())), false);
1393 void TreeModel::row_changed(const Path& path, const iterator& iter)
1395 gtk_tree_model_row_changed(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
1398 void TreeModel::row_inserted(const Path& path, const iterator& iter)
1400 gtk_tree_model_row_inserted(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
1403 void TreeModel::row_has_child_toggled(const Path& path, const iterator& iter)
1405 gtk_tree_model_row_has_child_toggled(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
1408 void TreeModel::row_deleted(const Path& path)
1410 gtk_tree_model_row_deleted(gobj(), const_cast<GtkTreePath*>((path).gobj()));
1413 void TreeModel::rows_reordered(const Path& path, const iterator& iter, int* new_order)
1415 gtk_tree_model_rows_reordered(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()), new_order);
1418 Glib::ustring TreeModel::get_string(const iterator& iter) const
1420 return Glib::convert_return_gchar_ptr_to_ustring(gtk_tree_model_get_string_from_iter(const_cast<GtkTreeModel*>(gobj()), const_cast<GtkTreeIter*>((iter).gobj())));
1424 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_changed()
1426 return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_changed_info);
1429 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_inserted()
1431 return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_inserted_info);
1434 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_has_child_toggled()
1436 return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_has_child_toggled_info);
1439 Glib::SignalProxy1< void,const TreeModel::Path& > TreeModel::signal_row_deleted()
1441 return Glib::SignalProxy1< void,const TreeModel::Path& >(this, &TreeModel_signal_row_deleted_info);
1444 Glib::SignalProxy3< void,const TreeModel::Path&,const TreeModel::iterator&,int* > TreeModel::signal_rows_reordered()
1446 return Glib::SignalProxy3< void,const TreeModel::Path&,const TreeModel::iterator&,int* >(this, &TreeModel_signal_rows_reordered_info);
1450 void Gtk::TreeModel::on_row_changed(const TreeModel::Path& path, const TreeModel::iterator& iter)
1452 BaseClassType *const base = static_cast<BaseClassType*>(
1453 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1454 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1457 if(base && base->row_changed)
1458 (*base->row_changed)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1461 void Gtk::TreeModel::on_row_inserted(const TreeModel::Path& path, const TreeModel::iterator& iter)
1463 BaseClassType *const base = static_cast<BaseClassType*>(
1464 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1465 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1468 if(base && base->row_inserted)
1469 (*base->row_inserted)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1472 void Gtk::TreeModel::on_row_has_child_toggled(const TreeModel::Path& path, const TreeModel::iterator& iter)
1474 BaseClassType *const base = static_cast<BaseClassType*>(
1475 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1476 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1479 if(base && base->row_has_child_toggled)
1480 (*base->row_has_child_toggled)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1483 void Gtk::TreeModel::on_row_deleted(const TreeModel::Path& path)
1485 BaseClassType *const base = static_cast<BaseClassType*>(
1486 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1487 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1490 if(base && base->row_deleted)
1491 (*base->row_deleted)(gobj(),const_cast<GtkTreePath*>((path).gobj()));
1494 void Gtk::TreeModel::on_rows_reordered(const TreeModel::Path& path, const TreeModel::iterator& iter, int* new_order)
1496 BaseClassType *const base = static_cast<BaseClassType*>(
1497 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1498 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1501 if(base && base->rows_reordered)
1502 (*base->rows_reordered)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()),new_order);
1506 TreeModelFlags Gtk::TreeModel::get_flags_vfunc() const
1508 BaseClassType *const base = static_cast<BaseClassType*>(
1509 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1510 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1513 if(base && base->get_flags)
1514 return ((TreeModelFlags)((*base->get_flags)(const_cast<GtkTreeModel*>(gobj()))));
1516 typedef TreeModelFlags RType;
1520 int Gtk::TreeModel::get_n_columns_vfunc() const
1522 BaseClassType *const base = static_cast<BaseClassType*>(
1523 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1524 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1527 if(base && base->get_n_columns)
1528 return (*base->get_n_columns)(const_cast<GtkTreeModel*>(gobj()));
1534 GType Gtk::TreeModel::get_column_type_vfunc(int index) const
1536 BaseClassType *const base = static_cast<BaseClassType*>(
1537 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1538 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1541 if(base && base->get_column_type)
1542 return (*base->get_column_type)(const_cast<GtkTreeModel*>(gobj()),index);
1544 typedef GType RType;
1548 bool Gtk::TreeModel::iter_has_child_vfunc(const iterator& iter) const
1550 BaseClassType *const base = static_cast<BaseClassType*>(
1551 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1552 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1555 if(base && base->iter_has_child)
1556 return (*base->iter_has_child)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1562 void Gtk::TreeModel::ref_node_vfunc(const iterator& iter) const
1564 BaseClassType *const base = static_cast<BaseClassType*>(
1565 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1566 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1569 if(base && base->ref_node)
1570 (*base->ref_node)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1573 void Gtk::TreeModel::unref_node_vfunc(const iterator& iter) const
1575 BaseClassType *const base = static_cast<BaseClassType*>(
1576 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1577 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1580 if(base && base->unref_node)
1581 (*base->unref_node)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1584 TreeModel::Path Gtk::TreeModel::get_path_vfunc(const iterator& iter) const
1586 BaseClassType *const base = static_cast<BaseClassType*>(
1587 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1588 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1591 if(base && base->get_path)
1592 return Gtk::TreePath((*base->get_path)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj())), false);
1594 typedef TreeModel::Path RType;
1598 void Gtk::TreeModel::get_value_vfunc(const iterator& iter, int column, Glib::ValueBase& value) const
1600 BaseClassType *const base = static_cast<BaseClassType*>(
1601 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1602 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1605 if(base && base->get_value)
1606 (*base->get_value)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()),column,(value).gobj());