1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/treemodel.h>
5 #include <gtkmm/private/treemodel_p.h>
7 #include <gtk/gtktypebuiltins.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/treeiter.h>
29 #include <gtkmm/treepath.h>
30 #include <gtk/gtktreestore.h>
31 #include <gtk/gtktreemodel.h>
36 static gboolean proxy_foreach_iter_callback(GtkTreeModel* model, GtkTreePath*, GtkTreeIter* iter, void* data)
38 typedef Gtk::TreeModel::SlotForeachIter SlotType;
39 SlotType& slot = *static_cast<SlotType*>(data);
41 #ifdef GLIBMM_EXCEPTIONS_ENABLED
44 #endif //GLIBMM_EXCEPTIONS_ENABLED
45 return slot(Gtk::TreeModel::iterator(model, iter));
46 #ifdef GLIBMM_EXCEPTIONS_ENABLED
50 Glib::exception_handlers_invoke();
52 #endif //GLIBMM_EXCEPTIONS_ENABLED
57 static gboolean proxy_foreach_path_callback(GtkTreeModel*, GtkTreePath* path, GtkTreeIter*, void* data)
59 typedef Gtk::TreeModel::SlotForeachPath SlotType;
60 SlotType& slot = *static_cast<SlotType*>(data);
62 #ifdef GLIBMM_EXCEPTIONS_ENABLED
65 #endif //GLIBMM_EXCEPTIONS_ENABLED
66 return slot(Gtk::TreeModel::Path(path, true));
67 #ifdef GLIBMM_EXCEPTIONS_ENABLED
71 Glib::exception_handlers_invoke();
73 #endif //GLIBMM_EXCEPTIONS_ENABLED
78 static gboolean proxy_foreach_path_and_iter_callback(GtkTreeModel* model, GtkTreePath* path,
79 GtkTreeIter* iter, void* data)
81 typedef Gtk::TreeModel::SlotForeachPathAndIter SlotType;
82 SlotType& slot = *static_cast<SlotType*>(data);
84 #ifdef GLIBMM_EXCEPTIONS_ENABLED
87 #endif //GLIBMM_EXCEPTIONS_ENABLED
88 return slot(Gtk::TreeModel::Path(path, true), Gtk::TreeModel::iterator(model, iter));
89 #ifdef GLIBMM_EXCEPTIONS_ENABLED
93 Glib::exception_handlers_invoke();
95 #endif //GLIBMM_EXCEPTIONS_ENABLED
100 } //anonymous namespace
103 //Help the code generator, so that it doesn't have to fully qualify this type:
104 typedef Gtk::TreeModel::iterator iterator;
109 TreeModel::iterator TreeModel::get_iter(const Path& path)
111 Gtk::TreeModel::iterator iter(this);
112 gtk_tree_model_get_iter(gobj(), iter.gobj(), const_cast<GtkTreePath*>(path.gobj()));
116 TreeModel::iterator TreeModel::get_iter(const Glib::ustring& path_string)
118 Gtk::TreeModel::iterator iter (this);
119 gtk_tree_model_get_iter_from_string(gobj(), iter.gobj(), path_string.c_str());
123 TreeModel::Children TreeModel::children()
125 return TreeNodeChildren(this);
128 TreeModel::Children TreeModel::children() const
130 //TODO: Remove the const when we have a real const TreeNodeChildren, when we have a real const_iterator.
131 return TreeNodeChildren(const_cast<TreeModel*>(this));
134 void TreeModel::set_value_impl(const iterator&, int, const Glib::ValueBase&)
136 g_assert_not_reached();
139 void TreeModel::get_value_impl(const iterator& row, int column, Glib::ValueBase& value) const
141 gtk_tree_model_get_value(
142 const_cast<GtkTreeModel*>(gobj()),
143 const_cast<GtkTreeIter*>(row.gobj()),
144 column, value.gobj());
147 void TreeModel::foreach_iter(const SlotForeachIter& slot)
149 SlotForeachIter slot_copy (slot);
150 gtk_tree_model_foreach(gobj(), &proxy_foreach_iter_callback, &slot_copy);
153 void TreeModel::foreach_path(const SlotForeachPath& slot)
155 SlotForeachPath slot_copy (slot);
156 gtk_tree_model_foreach(gobj(), &proxy_foreach_path_callback, &slot_copy);
159 void TreeModel::foreach(const SlotForeachPathAndIter& slot)
161 SlotForeachPathAndIter slot_copy (slot);
162 gtk_tree_model_foreach(gobj(), &proxy_foreach_path_and_iter_callback, &slot_copy);
165 bool TreeModel::iter_is_valid(const iterator& iter) const
167 //This method is overriden in TreeStore and ListStore.
168 //This implementation will only be used as a default for custom derived TreeModels,
169 //and when we wrap a C GtkTreeModel with a Gtk::TreeModel instance, without knowing what derived C type it is.
171 // This check is almost the same as the private VALID_ITER() macro in gtkliststore.c and
173 return (!iter.is_end_ && iter.gobj()->stamp != 0);
176 #ifdef GLIBMM_VFUNCS_ENABLED
178 // Custom vfunc callbacks, because the C++ vfuncs have different parameters and return types
179 // that can not be generated automatically:
180 gboolean TreeModel_Class::iter_next_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
182 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
183 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
185 // Non-gtkmmproc-generated custom classes implicitly call the default
186 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
187 // generated classes can use this optimisation, which avoids the unnecessary
188 // parameter conversions if there is no possibility of the virtual function
190 if(obj && obj->is_derived_())
192 #ifdef GLIBMM_EXCEPTIONS_ENABLED
193 try // Trap C++ exceptions which would normally be lost because this is a C callback.
195 #endif //GLIBMM_EXCEPTIONS_ENABLED
196 // Call the virtual member method, which derived classes might override.
197 TreeModel::iterator iter_input = TreeModel::iterator(self, iter);
198 TreeModel::iterator iter_next( self, iter ); //Copies iter by value.
199 gboolean test = obj->iter_next_vfunc(iter_input, iter_next);
201 //Copy the new iter value to the C output parameter:
203 *iter = *(iter_next.gobj());
206 #ifdef GLIBMM_EXCEPTIONS_ENABLED
210 Glib::exception_handlers_invoke();
212 #endif //GLIBMM_EXCEPTIONS_ENABLED
216 BaseClassType *const base = static_cast<BaseClassType*>(
217 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
218 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
222 // Call the original underlying C function:
223 if(base && base->iter_next)
224 return (*base->iter_next)(self, iter);
227 typedef gboolean RType;
232 bool TreeModel::iter_next_vfunc(const iterator& iter, iterator& iter_next) const
234 //Call the default C implementation:
236 BaseClassType *const base = static_cast<BaseClassType*>(
237 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
238 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
242 if(base && base->iter_next)
244 TreeModel::iterator iter_copy = iter;
245 gboolean test = (*base->iter_next)(const_cast<GtkTreeModel*>(gobj()), iter_copy.gobj());
247 iter_next = iter_copy;
255 gboolean TreeModel_Class::get_iter_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreePath* path)
257 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
258 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
260 // Non-gtkmmproc-generated custom classes implicitly call the default
261 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
262 // generated classes can use this optimisation, which avoids the unnecessary
263 // parameter conversions if there is no possibility of the virtual function
265 if(obj && obj->is_derived_())
267 #ifdef GLIBMM_EXCEPTIONS_ENABLED
268 try // Trap C++ exceptions which would normally be lost because this is a C callback.
270 #endif //GLIBMM_EXCEPTIONS_ENABLED
271 // Call the virtual member method, which derived classes might override.
272 Gtk::TreeModel::iterator iter_out(self, iter); //copies the iter by value.
273 gboolean test = obj->get_iter_vfunc(Gtk::TreePath(path, true), iter_out);
275 //Copy the new iter value to the C output parameter:
277 *iter = *(iter_out.gobj());
280 #ifdef GLIBMM_EXCEPTIONS_ENABLED
284 Glib::exception_handlers_invoke();
286 #endif //GLIBMM_EXCEPTIONS_ENABLED
290 BaseClassType *const base = static_cast<BaseClassType*>(
291 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
292 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
295 // Call the original underlying C function:
296 if(base && base->get_iter)
297 return (*base->get_iter)(self, iter, const_cast<GtkTreePath*>(path));
300 typedef gboolean RType;
304 bool TreeModel::get_iter_vfunc(const Path& path, iterator& iter) const
306 //Call the default C implementation:
308 BaseClassType *const base = static_cast<BaseClassType*>(
309 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
310 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
314 if(base && base->get_iter)
316 return (*base->get_iter)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreePath*>(path.gobj()) );
322 gboolean TreeModel_Class::iter_children_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* parent)
324 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
325 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
327 // Non-gtkmmproc-generated custom classes implicitly call the default
328 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
329 // generated classes can use this optimisation, which avoids the unnecessary
330 // parameter conversions if there is no possibility of the virtual function
332 if(obj && obj->is_derived_())
334 #ifdef GLIBMM_EXCEPTIONS_ENABLED
335 try // Trap C++ exceptions which would normally be lost because this is a C callback.
337 #endif //GLIBMM_EXCEPTIONS_ENABLED
338 // Call the virtual member method, which derived classes might override.
339 Gtk::TreeModel::iterator iter_out(self, iter); //copies the iter by value.
341 gboolean test = false;
344 //Deal with this case, which is documented in the C docs as:
345 //" If @parent is %NULL returns the first node, equivalent to
346 // <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal> "
347 test = obj->iter_nth_root_child_vfunc(0, iter_out);
352 Gtk::TreeModel::iterator parent_cpp(self, parent);
353 test = obj->iter_children_vfunc(parent_cpp, iter_out);
356 //Copy the new iter value to the C output parameter:
358 *iter = *(iter_out.gobj());
361 #ifdef GLIBMM_EXCEPTIONS_ENABLED
365 Glib::exception_handlers_invoke();
367 #endif //GLIBMM_EXCEPTIONS_ENABLED
371 BaseClassType *const base = static_cast<BaseClassType*>(
372 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
373 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
376 // Call the original underlying C function:
377 if(base && base->iter_children)
378 return (*base->iter_children)(self, iter, parent);
381 typedef gboolean RType;
385 bool TreeModel::iter_children_vfunc(const iterator& parent, iterator& iter) const
387 //Call the default C implementation:
389 BaseClassType *const base = static_cast<BaseClassType*>(
390 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
391 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
395 if(base && base->iter_children)
397 return (*base->iter_children)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(parent.gobj()) );
403 gboolean TreeModel_Class::iter_parent_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* child)
405 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
406 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
408 // Non-gtkmmproc-generated custom classes implicitly call the default
409 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
410 // generated classes can use this optimisation, which avoids the unnecessary
411 // parameter conversions if there is no possibility of the virtual function
413 if(obj && obj->is_derived_())
415 #ifdef GLIBMM_EXCEPTIONS_ENABLED
416 try // Trap C++ exceptions which would normally be lost because this is a C callback.
418 #endif //GLIBMM_EXCEPTIONS_ENABLED
419 // Call the virtual member method, which derived classes might override.
420 Gtk::TreeModel::iterator iter_out(self, iter);
421 Gtk::TreeModel::iterator child_cpp(self, child);
422 gboolean test = obj->iter_parent_vfunc(child_cpp, iter_out);
424 //Copy the new iter value to the C output parameter:
426 *iter = *(iter_out.gobj());
429 #ifdef GLIBMM_EXCEPTIONS_ENABLED
433 Glib::exception_handlers_invoke();
435 #endif //GLIBMM_EXCEPTIONS_ENABLED
439 BaseClassType *const base = static_cast<BaseClassType*>(
440 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
441 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
444 // Call the original underlying C function:
445 if(base && base->iter_parent)
446 return (*base->iter_parent)(self, iter, child);
449 typedef gboolean RType;
453 bool TreeModel::iter_parent_vfunc(const iterator& child, iterator& iter) const
455 //Call the default C implementation:
457 BaseClassType *const base = static_cast<BaseClassType*>(
458 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
459 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
463 if(base && base->iter_parent)
465 return (*base->iter_parent)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(child.gobj()) );
471 gboolean TreeModel_Class::iter_nth_child_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* parent, int n)
473 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
474 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
476 // Non-gtkmmproc-generated custom classes implicitly call the default
477 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
478 // generated classes can use this optimisation, which avoids the unnecessary
479 // parameter conversions if there is no possibility of the virtual function
481 if(obj && obj->is_derived_())
483 #ifdef GLIBMM_EXCEPTIONS_ENABLED
484 try // Trap C++ exceptions which would normally be lost because this is a C callback.
486 #endif //GLIBMM_EXCEPTIONS_ENABLED
487 // Call the virtual member method, which derived classes might override.
488 Gtk::TreeModel::iterator iter_out(self, iter);
490 gboolean test = false;
493 // Deal with this special case, docuemnted in the C docs as:
494 // "As a special case, if @parent is %NULL, then the nth root node is set.":
495 test = obj->iter_nth_root_child_vfunc(n, iter_out);
500 Gtk::TreeModel::iterator parent_cpp(self, parent);
501 test = obj->iter_nth_child_vfunc(parent_cpp, n, iter_out);
504 //Copy the new iter value to the C output parameter:
506 *iter = *(iter_out.gobj());
509 #ifdef GLIBMM_EXCEPTIONS_ENABLED
513 Glib::exception_handlers_invoke();
515 #endif //GLIBMM_EXCEPTIONS_ENABLED
519 BaseClassType *const base = static_cast<BaseClassType*>(
520 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
521 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
524 // Call the original underlying C function:
525 if(base && base->iter_nth_child)
526 return (*base->iter_nth_child)(self, iter, parent, n);
529 typedef gboolean RType;
533 bool TreeModel::iter_nth_child_vfunc(const iterator& parent, int n, iterator& iter) const
535 //Call the default C implementation:
537 BaseClassType *const base = static_cast<BaseClassType*>(
538 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
539 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
543 if(base && base->iter_nth_child)
545 return (*base->iter_nth_child)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(parent.gobj()), n );
551 //See the implementation of iter_children_vfunc_callback() and iter_nth_child_vfunc_callback()
552 //to find out why this virtual function exists:
553 bool TreeModel::iter_nth_root_child_vfunc(int n, iterator& iter) const
555 //Call the default C implementation:
557 BaseClassType *const base = static_cast<BaseClassType*>(
558 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
559 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
563 if(base && base->iter_nth_child)
565 //This means that iter_nth_child(0) might be called by iter_children_vfunc_callback(),
566 //but hopefully that's exactly the same thing. TODO: Ask why both vfuncs exist. murrayc.
567 return (*base->iter_nth_child)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), 0 /* the null parent */, n );
573 gboolean TreeModel_Class::iter_n_children_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
575 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
576 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
578 // Non-gtkmmproc-generated custom classes implicitly call the default
579 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
580 // generated classes can use this optimisation, which avoids the unnecessary
581 // parameter conversions if there is no possibility of the virtual function
583 if(obj && obj->is_derived_())
585 #ifdef GLIBMM_EXCEPTIONS_ENABLED
586 try // Trap C++ exceptions which would normally be lost because this is a C callback.
588 #endif //GLIBMM_EXCEPTIONS_ENABLED
589 // Call the virtual member method, which derived classes might override.
591 //Deal with the case that iter is null, as described in the C docs:
593 return obj->iter_n_children_vfunc( Gtk::TreeModel::iterator(self, iter) );
595 return obj->iter_n_root_children_vfunc();
596 #ifdef GLIBMM_EXCEPTIONS_ENABLED
600 Glib::exception_handlers_invoke();
602 #endif //GLIBMM_EXCEPTIONS_ENABLED
606 BaseClassType *const base = static_cast<BaseClassType*>(
607 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
608 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
611 // Call the original underlying C function:
612 if(base && base->iter_n_children)
613 return (*base->iter_n_children)(self, iter);
616 typedef gboolean RType;
620 int TreeModel::iter_n_children_vfunc(const iterator& iter) const
622 BaseClassType *const base = static_cast<BaseClassType*>(
623 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
624 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
627 if(base && base->iter_n_children)
628 return (*base->iter_n_children)(const_cast<GtkTreeModel*>(gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
634 int TreeModel::iter_n_root_children_vfunc() const
636 BaseClassType *const base = static_cast<BaseClassType*>(
637 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
638 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
641 if(base && base->iter_n_children)
642 return (*base->iter_n_children)(const_cast<GtkTreeModel*>(gobj()), 0 /* null iter to mean root node, as described in C docs */);
648 #endif //GLIBMM_VFUNCS_ENABLED
651 void TreeModel::rows_reordered(const Path& path, const iterator& iter, const Glib::ArrayHandle<int>& new_order)
653 //The size of the array seems to be based on the known number of children. murrayc.
654 gtk_tree_model_rows_reordered(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()), const_cast<int*>(new_order.data()));
657 void TreeModel::rows_reordered(const Path& path, const Glib::ArrayHandle<int>& new_order)
659 //The size of the array seems to be based on the known number of children. murrayc.
660 gtk_tree_model_rows_reordered(gobj(), const_cast<GtkTreePath*>((path).gobj()), 0, const_cast<int*>(new_order.data()));
670 static void TreeModel_signal_row_changed_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
673 typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
675 // Do not try to call a signal on a disassociated wrapper.
676 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
678 #ifdef GLIBMM_EXCEPTIONS_ENABLED
681 #endif //GLIBMM_EXCEPTIONS_ENABLED
682 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
683 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
684 , Gtk::TreeModel::iterator(self, iter)
686 #ifdef GLIBMM_EXCEPTIONS_ENABLED
690 Glib::exception_handlers_invoke();
692 #endif //GLIBMM_EXCEPTIONS_ENABLED
696 static const Glib::SignalProxyInfo TreeModel_signal_row_changed_info =
699 (GCallback) &TreeModel_signal_row_changed_callback,
700 (GCallback) &TreeModel_signal_row_changed_callback
704 static void TreeModel_signal_row_inserted_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
707 typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
709 // Do not try to call a signal on a disassociated wrapper.
710 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
712 #ifdef GLIBMM_EXCEPTIONS_ENABLED
715 #endif //GLIBMM_EXCEPTIONS_ENABLED
716 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
717 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
718 , Gtk::TreeModel::iterator(self, iter)
720 #ifdef GLIBMM_EXCEPTIONS_ENABLED
724 Glib::exception_handlers_invoke();
726 #endif //GLIBMM_EXCEPTIONS_ENABLED
730 static const Glib::SignalProxyInfo TreeModel_signal_row_inserted_info =
733 (GCallback) &TreeModel_signal_row_inserted_callback,
734 (GCallback) &TreeModel_signal_row_inserted_callback
738 static void TreeModel_signal_row_has_child_toggled_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
741 typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
743 // Do not try to call a signal on a disassociated wrapper.
744 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
746 #ifdef GLIBMM_EXCEPTIONS_ENABLED
749 #endif //GLIBMM_EXCEPTIONS_ENABLED
750 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
751 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
752 , Gtk::TreeModel::iterator(self, iter)
754 #ifdef GLIBMM_EXCEPTIONS_ENABLED
758 Glib::exception_handlers_invoke();
760 #endif //GLIBMM_EXCEPTIONS_ENABLED
764 static const Glib::SignalProxyInfo TreeModel_signal_row_has_child_toggled_info =
766 "row_has_child_toggled",
767 (GCallback) &TreeModel_signal_row_has_child_toggled_callback,
768 (GCallback) &TreeModel_signal_row_has_child_toggled_callback
772 static void TreeModel_signal_row_deleted_callback(GtkTreeModel* self, GtkTreePath* path,void* data)
775 typedef sigc::slot< void,const TreeModel::Path& > SlotType;
777 // Do not try to call a signal on a disassociated wrapper.
778 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
780 #ifdef GLIBMM_EXCEPTIONS_ENABLED
783 #endif //GLIBMM_EXCEPTIONS_ENABLED
784 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
785 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
787 #ifdef GLIBMM_EXCEPTIONS_ENABLED
791 Glib::exception_handlers_invoke();
793 #endif //GLIBMM_EXCEPTIONS_ENABLED
797 static const Glib::SignalProxyInfo TreeModel_signal_row_deleted_info =
800 (GCallback) &TreeModel_signal_row_deleted_callback,
801 (GCallback) &TreeModel_signal_row_deleted_callback
805 static void TreeModel_signal_rows_reordered_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,gint* new_order,void* data)
808 typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator&,int* > SlotType;
810 // Do not try to call a signal on a disassociated wrapper.
811 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
813 #ifdef GLIBMM_EXCEPTIONS_ENABLED
816 #endif //GLIBMM_EXCEPTIONS_ENABLED
817 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
818 (*static_cast<SlotType*>(slot))(Gtk::TreePath(path, true)
819 , Gtk::TreeModel::iterator(self, iter)
822 #ifdef GLIBMM_EXCEPTIONS_ENABLED
826 Glib::exception_handlers_invoke();
828 #endif //GLIBMM_EXCEPTIONS_ENABLED
832 static const Glib::SignalProxyInfo TreeModel_signal_rows_reordered_info =
835 (GCallback) &TreeModel_signal_rows_reordered_callback,
836 (GCallback) &TreeModel_signal_rows_reordered_callback
840 } // anonymous namespace
843 GType Glib::Value<Gtk::TreeModelFlags>::value_type()
845 return gtk_tree_model_flags_get_type();
852 Glib::RefPtr<Gtk::TreeModel> wrap(GtkTreeModel* object, bool take_copy)
854 return Glib::RefPtr<Gtk::TreeModel>( dynamic_cast<Gtk::TreeModel*> (Glib::wrap_auto_interface<Gtk::TreeModel> ((GObject*)(object), take_copy)) );
855 //We use dynamic_cast<> in case of multiple inheritance.
865 /* The *_Class implementation: */
867 const Glib::Interface_Class& TreeModel_Class::init()
869 if(!gtype_) // create the GType if necessary
871 // Glib::Interface_Class has to know the interface init function
872 // in order to add interfaces to implementing types.
873 class_init_func_ = &TreeModel_Class::iface_init_function;
875 // We can not derive from another interface, and it is not necessary anyway.
876 gtype_ = gtk_tree_model_get_type();
882 void TreeModel_Class::iface_init_function(void* g_iface, void*)
884 BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
886 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
887 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
888 g_assert(klass != 0);
890 #ifdef GLIBMM_VFUNCS_ENABLED
891 klass->get_flags = &get_flags_vfunc_callback;
892 klass->get_n_columns = &get_n_columns_vfunc_callback;
893 klass->get_column_type = &get_column_type_vfunc_callback;
894 klass->iter_next = &iter_next_vfunc_callback;
895 klass->get_iter = &get_iter_vfunc_callback;
896 klass->iter_children = &iter_children_vfunc_callback;
897 klass->iter_parent = &iter_parent_vfunc_callback;
898 klass->iter_nth_child = &iter_nth_child_vfunc_callback;
899 klass->iter_n_children = &iter_n_children_vfunc_callback;
900 klass->iter_has_child = &iter_has_child_vfunc_callback;
901 klass->ref_node = &ref_node_vfunc_callback;
902 klass->unref_node = &unref_node_vfunc_callback;
903 klass->get_path = &get_path_vfunc_callback;
904 klass->get_value = &get_value_vfunc_callback;
905 #endif //GLIBMM_VFUNCS_ENABLED
907 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
908 klass->row_changed = &row_changed_callback;
909 klass->row_inserted = &row_inserted_callback;
910 klass->row_has_child_toggled = &row_has_child_toggled_callback;
911 klass->row_deleted = &row_deleted_callback;
912 klass->rows_reordered = &rows_reordered_callback;
913 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
916 #ifdef GLIBMM_VFUNCS_ENABLED
917 GtkTreeModelFlags TreeModel_Class::get_flags_vfunc_callback(GtkTreeModel* self)
919 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
920 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
922 // Non-gtkmmproc-generated custom classes implicitly call the default
923 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
924 // generated classes can use this optimisation, which avoids the unnecessary
925 // parameter conversions if there is no possibility of the virtual function
927 if(obj_base && obj_base->is_derived_())
929 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
930 if(obj) // This can be NULL during destruction.
932 #ifdef GLIBMM_EXCEPTIONS_ENABLED
933 try // Trap C++ exceptions which would normally be lost because this is a C callback.
935 #endif //GLIBMM_EXCEPTIONS_ENABLED
936 // Call the virtual member method, which derived classes might override.
937 return ((GtkTreeModelFlags)(obj->get_flags_vfunc()));
938 #ifdef GLIBMM_EXCEPTIONS_ENABLED
942 Glib::exception_handlers_invoke();
944 #endif //GLIBMM_EXCEPTIONS_ENABLED
948 BaseClassType *const base = static_cast<BaseClassType*>(
949 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
950 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
953 // Call the original underlying C function:
954 if(base && base->get_flags)
955 return (*base->get_flags)(self);
958 typedef GtkTreeModelFlags RType;
961 gint TreeModel_Class::get_n_columns_vfunc_callback(GtkTreeModel* self)
963 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
964 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
966 // Non-gtkmmproc-generated custom classes implicitly call the default
967 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
968 // generated classes can use this optimisation, which avoids the unnecessary
969 // parameter conversions if there is no possibility of the virtual function
971 if(obj_base && obj_base->is_derived_())
973 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
974 if(obj) // This can be NULL during destruction.
976 #ifdef GLIBMM_EXCEPTIONS_ENABLED
977 try // Trap C++ exceptions which would normally be lost because this is a C callback.
979 #endif //GLIBMM_EXCEPTIONS_ENABLED
980 // Call the virtual member method, which derived classes might override.
981 return obj->get_n_columns_vfunc();
982 #ifdef GLIBMM_EXCEPTIONS_ENABLED
986 Glib::exception_handlers_invoke();
988 #endif //GLIBMM_EXCEPTIONS_ENABLED
992 BaseClassType *const base = static_cast<BaseClassType*>(
993 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
994 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
997 // Call the original underlying C function:
998 if(base && base->get_n_columns)
999 return (*base->get_n_columns)(self);
1005 GType TreeModel_Class::get_column_type_vfunc_callback(GtkTreeModel* self, gint index)
1007 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1008 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1010 // Non-gtkmmproc-generated custom classes implicitly call the default
1011 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1012 // generated classes can use this optimisation, which avoids the unnecessary
1013 // parameter conversions if there is no possibility of the virtual function
1014 // being overridden:
1015 if(obj_base && obj_base->is_derived_())
1017 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1018 if(obj) // This can be NULL during destruction.
1020 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1021 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1023 #endif //GLIBMM_EXCEPTIONS_ENABLED
1024 // Call the virtual member method, which derived classes might override.
1025 return obj->get_column_type_vfunc(index
1027 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1031 Glib::exception_handlers_invoke();
1033 #endif //GLIBMM_EXCEPTIONS_ENABLED
1037 BaseClassType *const base = static_cast<BaseClassType*>(
1038 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1039 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1042 // Call the original underlying C function:
1043 if(base && base->get_column_type)
1044 return (*base->get_column_type)(self, index);
1047 typedef GType RType;
1050 gboolean TreeModel_Class::iter_has_child_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1052 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1053 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1055 // Non-gtkmmproc-generated custom classes implicitly call the default
1056 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1057 // generated classes can use this optimisation, which avoids the unnecessary
1058 // parameter conversions if there is no possibility of the virtual function
1059 // being overridden:
1060 if(obj_base && obj_base->is_derived_())
1062 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1063 if(obj) // This can be NULL during destruction.
1065 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1066 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1068 #endif //GLIBMM_EXCEPTIONS_ENABLED
1069 // Call the virtual member method, which derived classes might override.
1070 return static_cast<int>(obj->iter_has_child_vfunc(Gtk::TreeModel::iterator(self, iter)
1072 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1076 Glib::exception_handlers_invoke();
1078 #endif //GLIBMM_EXCEPTIONS_ENABLED
1082 BaseClassType *const base = static_cast<BaseClassType*>(
1083 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1084 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1087 // Call the original underlying C function:
1088 if(base && base->iter_has_child)
1089 return (*base->iter_has_child)(self, iter);
1092 typedef gboolean RType;
1095 void TreeModel_Class::ref_node_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1097 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1098 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1100 // Non-gtkmmproc-generated custom classes implicitly call the default
1101 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1102 // generated classes can use this optimisation, which avoids the unnecessary
1103 // parameter conversions if there is no possibility of the virtual function
1104 // being overridden:
1105 if(obj_base && obj_base->is_derived_())
1107 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1108 if(obj) // This can be NULL during destruction.
1110 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1111 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1113 #endif //GLIBMM_EXCEPTIONS_ENABLED
1114 // Call the virtual member method, which derived classes might override.
1115 obj->ref_node_vfunc(Gtk::TreeModel::iterator(self, iter)
1118 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1122 Glib::exception_handlers_invoke();
1124 #endif //GLIBMM_EXCEPTIONS_ENABLED
1128 BaseClassType *const base = static_cast<BaseClassType*>(
1129 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1130 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1133 // Call the original underlying C function:
1134 if(base && base->ref_node)
1135 (*base->ref_node)(self, iter);
1138 void TreeModel_Class::unref_node_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1140 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1141 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1143 // Non-gtkmmproc-generated custom classes implicitly call the default
1144 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1145 // generated classes can use this optimisation, which avoids the unnecessary
1146 // parameter conversions if there is no possibility of the virtual function
1147 // being overridden:
1148 if(obj_base && obj_base->is_derived_())
1150 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1151 if(obj) // This can be NULL during destruction.
1153 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1154 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1156 #endif //GLIBMM_EXCEPTIONS_ENABLED
1157 // Call the virtual member method, which derived classes might override.
1158 obj->unref_node_vfunc(Gtk::TreeModel::iterator(self, iter)
1161 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1165 Glib::exception_handlers_invoke();
1167 #endif //GLIBMM_EXCEPTIONS_ENABLED
1171 BaseClassType *const base = static_cast<BaseClassType*>(
1172 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1173 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1176 // Call the original underlying C function:
1177 if(base && base->unref_node)
1178 (*base->unref_node)(self, iter);
1181 GtkTreePath* TreeModel_Class::get_path_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1183 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1184 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1186 // Non-gtkmmproc-generated custom classes implicitly call the default
1187 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1188 // generated classes can use this optimisation, which avoids the unnecessary
1189 // parameter conversions if there is no possibility of the virtual function
1190 // being overridden:
1191 if(obj_base && obj_base->is_derived_())
1193 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1194 if(obj) // This can be NULL during destruction.
1196 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1197 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1199 #endif //GLIBMM_EXCEPTIONS_ENABLED
1200 // Call the virtual member method, which derived classes might override.
1201 return (obj->get_path_vfunc(Gtk::TreeModel::iterator(self, iter)
1203 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1207 Glib::exception_handlers_invoke();
1209 #endif //GLIBMM_EXCEPTIONS_ENABLED
1213 BaseClassType *const base = static_cast<BaseClassType*>(
1214 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1215 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1218 // Call the original underlying C function:
1219 if(base && base->get_path)
1220 return (*base->get_path)(self, iter);
1223 typedef GtkTreePath* RType;
1226 void TreeModel_Class::get_value_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, gint column, GValue* value)
1228 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1229 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1231 // Non-gtkmmproc-generated custom classes implicitly call the default
1232 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1233 // generated classes can use this optimisation, which avoids the unnecessary
1234 // parameter conversions if there is no possibility of the virtual function
1235 // being overridden:
1236 if(obj_base && obj_base->is_derived_())
1238 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1239 if(obj) // This can be NULL during destruction.
1241 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1242 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1244 #endif //GLIBMM_EXCEPTIONS_ENABLED
1245 // Call the virtual member method, which derived classes might override.
1246 obj->get_value_vfunc(Gtk::TreeModel::iterator(self, iter)
1248 , *reinterpret_cast<Glib::ValueBase*>(value)
1251 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1255 Glib::exception_handlers_invoke();
1257 #endif //GLIBMM_EXCEPTIONS_ENABLED
1261 BaseClassType *const base = static_cast<BaseClassType*>(
1262 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1263 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1266 // Call the original underlying C function:
1267 if(base && base->get_value)
1268 (*base->get_value)(self, iter, column, value);
1271 #endif //GLIBMM_VFUNCS_ENABLED
1273 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1274 void TreeModel_Class::row_changed_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1276 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1277 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1279 // Non-gtkmmproc-generated custom classes implicitly call the default
1280 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1281 // generated classes can use this optimisation, which avoids the unnecessary
1282 // parameter conversions if there is no possibility of the virtual function
1283 // being overridden:
1284 if(obj_base && obj_base->is_derived_())
1286 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1287 if(obj) // This can be NULL during destruction.
1289 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1290 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1292 #endif //GLIBMM_EXCEPTIONS_ENABLED
1293 // Call the virtual member method, which derived classes might override.
1294 obj->on_row_changed(Gtk::TreePath(path, true)
1295 , Gtk::TreeModel::iterator(self, iter)
1298 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1302 Glib::exception_handlers_invoke();
1304 #endif //GLIBMM_EXCEPTIONS_ENABLED
1308 BaseClassType *const base = static_cast<BaseClassType*>(
1309 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1310 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1313 // Call the original underlying C function:
1314 if(base && base->row_changed)
1315 (*base->row_changed)(self, path, iter);
1317 void TreeModel_Class::row_inserted_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1319 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1320 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1322 // Non-gtkmmproc-generated custom classes implicitly call the default
1323 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1324 // generated classes can use this optimisation, which avoids the unnecessary
1325 // parameter conversions if there is no possibility of the virtual function
1326 // being overridden:
1327 if(obj_base && obj_base->is_derived_())
1329 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1330 if(obj) // This can be NULL during destruction.
1332 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1333 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1335 #endif //GLIBMM_EXCEPTIONS_ENABLED
1336 // Call the virtual member method, which derived classes might override.
1337 obj->on_row_inserted(Gtk::TreePath(path, true)
1338 , Gtk::TreeModel::iterator(self, iter)
1341 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1345 Glib::exception_handlers_invoke();
1347 #endif //GLIBMM_EXCEPTIONS_ENABLED
1351 BaseClassType *const base = static_cast<BaseClassType*>(
1352 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1353 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1356 // Call the original underlying C function:
1357 if(base && base->row_inserted)
1358 (*base->row_inserted)(self, path, iter);
1360 void TreeModel_Class::row_has_child_toggled_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1362 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1363 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1365 // Non-gtkmmproc-generated custom classes implicitly call the default
1366 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1367 // generated classes can use this optimisation, which avoids the unnecessary
1368 // parameter conversions if there is no possibility of the virtual function
1369 // being overridden:
1370 if(obj_base && obj_base->is_derived_())
1372 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1373 if(obj) // This can be NULL during destruction.
1375 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1376 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1378 #endif //GLIBMM_EXCEPTIONS_ENABLED
1379 // Call the virtual member method, which derived classes might override.
1380 obj->on_row_has_child_toggled(Gtk::TreePath(path, true)
1381 , Gtk::TreeModel::iterator(self, iter)
1384 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1388 Glib::exception_handlers_invoke();
1390 #endif //GLIBMM_EXCEPTIONS_ENABLED
1394 BaseClassType *const base = static_cast<BaseClassType*>(
1395 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1396 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1399 // Call the original underlying C function:
1400 if(base && base->row_has_child_toggled)
1401 (*base->row_has_child_toggled)(self, path, iter);
1403 void TreeModel_Class::row_deleted_callback(GtkTreeModel* self, GtkTreePath* path)
1405 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1406 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1408 // Non-gtkmmproc-generated custom classes implicitly call the default
1409 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1410 // generated classes can use this optimisation, which avoids the unnecessary
1411 // parameter conversions if there is no possibility of the virtual function
1412 // being overridden:
1413 if(obj_base && obj_base->is_derived_())
1415 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1416 if(obj) // This can be NULL during destruction.
1418 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1419 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1421 #endif //GLIBMM_EXCEPTIONS_ENABLED
1422 // Call the virtual member method, which derived classes might override.
1423 obj->on_row_deleted(Gtk::TreePath(path, true)
1426 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1430 Glib::exception_handlers_invoke();
1432 #endif //GLIBMM_EXCEPTIONS_ENABLED
1436 BaseClassType *const base = static_cast<BaseClassType*>(
1437 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1438 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1441 // Call the original underlying C function:
1442 if(base && base->row_deleted)
1443 (*base->row_deleted)(self, path);
1445 void TreeModel_Class::rows_reordered_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter, gint* new_order)
1447 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1448 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1450 // Non-gtkmmproc-generated custom classes implicitly call the default
1451 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
1452 // generated classes can use this optimisation, which avoids the unnecessary
1453 // parameter conversions if there is no possibility of the virtual function
1454 // being overridden:
1455 if(obj_base && obj_base->is_derived_())
1457 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1458 if(obj) // This can be NULL during destruction.
1460 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1461 try // Trap C++ exceptions which would normally be lost because this is a C callback.
1463 #endif //GLIBMM_EXCEPTIONS_ENABLED
1464 // Call the virtual member method, which derived classes might override.
1465 obj->on_rows_reordered(Gtk::TreePath(path, true)
1466 , Gtk::TreeModel::iterator(self, iter)
1470 #ifdef GLIBMM_EXCEPTIONS_ENABLED
1474 Glib::exception_handlers_invoke();
1476 #endif //GLIBMM_EXCEPTIONS_ENABLED
1480 BaseClassType *const base = static_cast<BaseClassType*>(
1481 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1482 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
1485 // Call the original underlying C function:
1486 if(base && base->rows_reordered)
1487 (*base->rows_reordered)(self, path, iter, new_order);
1489 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1492 Glib::ObjectBase* TreeModel_Class::wrap_new(GObject* object)
1494 return new TreeModel((GtkTreeModel*)(object));
1498 /* The implementation: */
1500 TreeModel::TreeModel()
1502 Glib::Interface(treemodel_class_.init())
1505 TreeModel::TreeModel(GtkTreeModel* castitem)
1507 Glib::Interface((GObject*)(castitem))
1510 TreeModel::~TreeModel()
1514 void TreeModel::add_interface(GType gtype_implementer)
1516 treemodel_class_.init().add_interface(gtype_implementer);
1519 TreeModel::CppClassType TreeModel::treemodel_class_; // initialize static member
1521 GType TreeModel::get_type()
1523 return treemodel_class_.init().get_type();
1526 GType TreeModel::get_base_type()
1528 return gtk_tree_model_get_type();
1532 TreeModelFlags TreeModel::get_flags() const
1534 return ((TreeModelFlags)(gtk_tree_model_get_flags(const_cast<GtkTreeModel*>(gobj()))));
1537 int TreeModel::get_n_columns() const
1539 return gtk_tree_model_get_n_columns(const_cast<GtkTreeModel*>(gobj()));
1542 GType TreeModel::get_column_type(int index) const
1544 return gtk_tree_model_get_column_type(const_cast<GtkTreeModel*>(gobj()), index);
1547 TreeModel::Path TreeModel::get_path(const iterator& iter) const
1549 return Gtk::TreePath(gtk_tree_model_get_path(const_cast<GtkTreeModel*>(gobj()), const_cast<GtkTreeIter*>((iter).gobj())), false);
1552 void TreeModel::row_changed(const Path& path, const iterator& iter)
1554 gtk_tree_model_row_changed(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
1557 void TreeModel::row_inserted(const Path& path, const iterator& iter)
1559 gtk_tree_model_row_inserted(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
1562 void TreeModel::row_has_child_toggled(const Path& path, const iterator& iter)
1564 gtk_tree_model_row_has_child_toggled(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
1567 void TreeModel::row_deleted(const Path& path)
1569 gtk_tree_model_row_deleted(gobj(), const_cast<GtkTreePath*>((path).gobj()));
1572 void TreeModel::rows_reordered(const Path& path, const iterator& iter, int* new_order)
1574 gtk_tree_model_rows_reordered(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()), new_order);
1577 Glib::ustring TreeModel::get_string(const iterator& iter) const
1579 return Glib::convert_return_gchar_ptr_to_ustring(gtk_tree_model_get_string_from_iter(const_cast<GtkTreeModel*>(gobj()), const_cast<GtkTreeIter*>((iter).gobj())));
1583 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_changed()
1585 return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_changed_info);
1589 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_inserted()
1591 return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_inserted_info);
1595 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_has_child_toggled()
1597 return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_has_child_toggled_info);
1601 Glib::SignalProxy1< void,const TreeModel::Path& > TreeModel::signal_row_deleted()
1603 return Glib::SignalProxy1< void,const TreeModel::Path& >(this, &TreeModel_signal_row_deleted_info);
1607 Glib::SignalProxy3< void,const TreeModel::Path&,const TreeModel::iterator&,int* > TreeModel::signal_rows_reordered()
1609 return Glib::SignalProxy3< void,const TreeModel::Path&,const TreeModel::iterator&,int* >(this, &TreeModel_signal_rows_reordered_info);
1613 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1614 void Gtk::TreeModel::on_row_changed(const TreeModel::Path& path, const TreeModel::iterator& iter)
1616 BaseClassType *const base = static_cast<BaseClassType*>(
1617 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1618 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1621 if(base && base->row_changed)
1622 (*base->row_changed)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1624 void Gtk::TreeModel::on_row_inserted(const TreeModel::Path& path, const TreeModel::iterator& iter)
1626 BaseClassType *const base = static_cast<BaseClassType*>(
1627 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1628 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1631 if(base && base->row_inserted)
1632 (*base->row_inserted)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1634 void Gtk::TreeModel::on_row_has_child_toggled(const TreeModel::Path& path, const TreeModel::iterator& iter)
1636 BaseClassType *const base = static_cast<BaseClassType*>(
1637 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1638 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1641 if(base && base->row_has_child_toggled)
1642 (*base->row_has_child_toggled)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1644 void Gtk::TreeModel::on_row_deleted(const TreeModel::Path& path)
1646 BaseClassType *const base = static_cast<BaseClassType*>(
1647 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1648 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1651 if(base && base->row_deleted)
1652 (*base->row_deleted)(gobj(),const_cast<GtkTreePath*>((path).gobj()));
1654 void Gtk::TreeModel::on_rows_reordered(const TreeModel::Path& path, const TreeModel::iterator& iter, int* new_order)
1656 BaseClassType *const base = static_cast<BaseClassType*>(
1657 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1658 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1661 if(base && base->rows_reordered)
1662 (*base->rows_reordered)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()),new_order);
1664 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1666 #ifdef GLIBMM_VFUNCS_ENABLED
1667 TreeModelFlags Gtk::TreeModel::get_flags_vfunc() const
1669 BaseClassType *const base = static_cast<BaseClassType*>(
1670 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1671 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1674 if(base && base->get_flags)
1675 return ((TreeModelFlags)((*base->get_flags)(const_cast<GtkTreeModel*>(gobj()))));
1677 typedef TreeModelFlags RType;
1680 int Gtk::TreeModel::get_n_columns_vfunc() const
1682 BaseClassType *const base = static_cast<BaseClassType*>(
1683 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1684 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1687 if(base && base->get_n_columns)
1688 return (*base->get_n_columns)(const_cast<GtkTreeModel*>(gobj()));
1693 GType Gtk::TreeModel::get_column_type_vfunc(int index) const
1695 BaseClassType *const base = static_cast<BaseClassType*>(
1696 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1697 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1700 if(base && base->get_column_type)
1701 return (*base->get_column_type)(const_cast<GtkTreeModel*>(gobj()),index);
1703 typedef GType RType;
1706 bool Gtk::TreeModel::iter_has_child_vfunc(const iterator& iter) const
1708 BaseClassType *const base = static_cast<BaseClassType*>(
1709 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1710 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1713 if(base && base->iter_has_child)
1714 return (*base->iter_has_child)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1719 void Gtk::TreeModel::ref_node_vfunc(const iterator& iter) const
1721 BaseClassType *const base = static_cast<BaseClassType*>(
1722 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1723 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1726 if(base && base->ref_node)
1727 (*base->ref_node)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1729 void Gtk::TreeModel::unref_node_vfunc(const iterator& iter) const
1731 BaseClassType *const base = static_cast<BaseClassType*>(
1732 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1733 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1736 if(base && base->unref_node)
1737 (*base->unref_node)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1739 TreeModel::Path Gtk::TreeModel::get_path_vfunc(const iterator& iter) const
1741 BaseClassType *const base = static_cast<BaseClassType*>(
1742 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1743 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1746 if(base && base->get_path)
1747 return Gtk::TreePath((*base->get_path)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj())), false);
1749 typedef TreeModel::Path RType;
1752 void Gtk::TreeModel::get_value_vfunc(const iterator& iter, int column, Glib::ValueBase& value) const
1754 BaseClassType *const base = static_cast<BaseClassType*>(
1755 g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
1756 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
1759 if(base && base->get_value)
1760 (*base->get_value)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()),column,(value).gobj());
1762 #endif //GLIBMM_VFUNCS_ENABLED