add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / treemodel.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <gtkmm/treemodel.h>
5 #include <gtkmm/private/treemodel_p.h>
6
7 #include <gtk/gtktypebuiltins.h>
8 // -*- c++ -*-
9 /* $Id$ */
10
11 /* Copyright 1998-2002 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28 #include <gtkmm/treeiter.h>
29 #include <gtkmm/treepath.h>
30 #include <gtk/gtktreestore.h>
31 #include <gtk/gtktreemodel.h>
32
33 namespace
34 {
35
36 static gboolean proxy_foreach_iter_callback(GtkTreeModel* model, GtkTreePath*, GtkTreeIter* iter, void* data)
37 {
38   typedef Gtk::TreeModel::SlotForeachIter SlotType;
39   SlotType& slot = *static_cast<SlotType*>(data);
40
41   #ifdef GLIBMM_EXCEPTIONS_ENABLED
42   try
43   {
44   #endif //GLIBMM_EXCEPTIONS_ENABLED
45     return slot(Gtk::TreeModel::iterator(model, iter));
46   #ifdef GLIBMM_EXCEPTIONS_ENABLED
47   }
48   catch(...)
49   {
50     Glib::exception_handlers_invoke();
51   }
52   #endif //GLIBMM_EXCEPTIONS_ENABLED
53
54   return 1;
55 }
56
57 static gboolean proxy_foreach_path_callback(GtkTreeModel*, GtkTreePath* path, GtkTreeIter*, void* data)
58 {
59   typedef Gtk::TreeModel::SlotForeachPath SlotType;
60   SlotType& slot = *static_cast<SlotType*>(data);
61
62   #ifdef GLIBMM_EXCEPTIONS_ENABLED
63   try
64   {
65   #endif //GLIBMM_EXCEPTIONS_ENABLED
66     return slot(Gtk::TreeModel::Path(path, true));
67   #ifdef GLIBMM_EXCEPTIONS_ENABLED
68   }
69   catch(...)
70   {
71     Glib::exception_handlers_invoke();
72   }
73   #endif //GLIBMM_EXCEPTIONS_ENABLED
74
75   return 1;
76 }
77
78 static gboolean proxy_foreach_path_and_iter_callback(GtkTreeModel* model, GtkTreePath* path,
79                                               GtkTreeIter* iter, void* data)
80 {
81   typedef Gtk::TreeModel::SlotForeachPathAndIter SlotType;
82   SlotType& slot = *static_cast<SlotType*>(data);
83
84   #ifdef GLIBMM_EXCEPTIONS_ENABLED
85   try
86   {
87   #endif //GLIBMM_EXCEPTIONS_ENABLED
88     return slot(Gtk::TreeModel::Path(path, true), Gtk::TreeModel::iterator(model, iter));
89   #ifdef GLIBMM_EXCEPTIONS_ENABLED
90   }
91   catch(...)
92   {
93     Glib::exception_handlers_invoke();
94   }
95   #endif //GLIBMM_EXCEPTIONS_ENABLED
96
97   return 1;
98 }
99
100 } //anonymous namespace
101
102
103 //Help the code generator, so that it doesn't have to fully qualify this type:
104 typedef Gtk::TreeModel::iterator iterator;
105
106 namespace Gtk
107 {
108
109 TreeModel::iterator TreeModel::get_iter(const Path& path)
110 {
111   Gtk::TreeModel::iterator iter(this);
112   gtk_tree_model_get_iter(gobj(), iter.gobj(), const_cast<GtkTreePath*>(path.gobj()));
113   return iter;
114 }
115
116 TreeModel::iterator TreeModel::get_iter(const Glib::ustring& path_string)
117 {
118   Gtk::TreeModel::iterator iter (this);
119   gtk_tree_model_get_iter_from_string(gobj(), iter.gobj(), path_string.c_str());
120   return iter;
121 }
122
123 TreeModel::Children TreeModel::children()
124 {
125   return TreeNodeChildren(this);
126 }
127
128 TreeModel::Children TreeModel::children() const
129 {              
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));
132 }
133
134 void TreeModel::set_value_impl(const iterator&, int, const Glib::ValueBase&)
135 {
136   g_assert_not_reached();
137 }
138
139 void TreeModel::get_value_impl(const iterator& row, int column, Glib::ValueBase& value) const
140 {
141   gtk_tree_model_get_value(
142       const_cast<GtkTreeModel*>(gobj()),
143       const_cast<GtkTreeIter*>(row.gobj()),
144       column, value.gobj());
145 }
146
147 void TreeModel::foreach_iter(const SlotForeachIter& slot)
148 {
149   SlotForeachIter slot_copy (slot);
150   gtk_tree_model_foreach(gobj(), &proxy_foreach_iter_callback, &slot_copy);
151 }
152
153 void TreeModel::foreach_path(const SlotForeachPath& slot)
154 {
155   SlotForeachPath slot_copy (slot);
156   gtk_tree_model_foreach(gobj(), &proxy_foreach_path_callback, &slot_copy);
157 }
158
159 void TreeModel::foreach(const SlotForeachPathAndIter& slot)
160 {
161   SlotForeachPathAndIter slot_copy (slot);
162   gtk_tree_model_foreach(gobj(), &proxy_foreach_path_and_iter_callback, &slot_copy);
163 }
164
165 bool TreeModel::iter_is_valid(const iterator& iter) const
166 {
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.
170   
171   // This check is almost the same as the private VALID_ITER() macro in gtkliststore.c and
172   // gtktreestore.c.
173   return (!iter.is_end_ && iter.gobj()->stamp != 0);
174 }
175
176 #ifdef GLIBMM_VFUNCS_ENABLED
177
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)
181 {
182   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
183       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
184
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
189   // being overridden:
190   if(obj && obj->is_derived_())
191   {
192     #ifdef GLIBMM_EXCEPTIONS_ENABLED
193     try // Trap C++ exceptions which would normally be lost because this is a C callback.
194     {
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);
200
201       //Copy the new iter value to the C output parameter:
202       if(test)
203         *iter = *(iter_next.gobj());
204
205       return test;
206     #ifdef GLIBMM_EXCEPTIONS_ENABLED
207     }
208     catch(...)
209     {
210       Glib::exception_handlers_invoke();
211     }
212     #endif //GLIBMM_EXCEPTIONS_ENABLED
213   }
214   else
215   {
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.
219       )
220     );
221
222     // Call the original underlying C function:
223     if(base && base->iter_next)
224       return (*base->iter_next)(self, iter);
225   }
226
227   typedef gboolean RType;
228   return RType();
229 }
230
231
232 bool TreeModel::iter_next_vfunc(const iterator& iter, iterator& iter_next) const
233 {
234   //Call the default C implementation:
235   
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.
239     )
240   );
241
242   if(base && base->iter_next)
243   {
244     TreeModel::iterator iter_copy = iter;
245     gboolean test = (*base->iter_next)(const_cast<GtkTreeModel*>(gobj()), iter_copy.gobj());
246     if(test)
247       iter_next = iter_copy;
248
249     return test;
250   }
251
252   return bool();
253 }
254
255 gboolean TreeModel_Class::get_iter_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreePath* path)
256 {
257   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
258       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
259
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
264   // being overridden:
265   if(obj && obj->is_derived_())
266   {
267     #ifdef GLIBMM_EXCEPTIONS_ENABLED
268     try // Trap C++ exceptions which would normally be lost because this is a C callback.
269     {
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);
274
275       //Copy the new iter value to the C output parameter:
276       if(test)
277         *iter = *(iter_out.gobj());
278
279       return test;
280     #ifdef GLIBMM_EXCEPTIONS_ENABLED
281     }
282     catch(...)
283     {
284       Glib::exception_handlers_invoke();
285     }
286     #endif //GLIBMM_EXCEPTIONS_ENABLED
287   }
288   else
289   {
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.
293 )    );
294
295     // Call the original underlying C function:
296     if(base && base->get_iter)
297       return (*base->get_iter)(self, iter, const_cast<GtkTreePath*>(path));
298   }
299
300   typedef gboolean RType;
301   return RType();
302 }
303
304 bool TreeModel::get_iter_vfunc(const Path& path, iterator& iter) const
305 {
306   //Call the default C implementation:
307
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.
311     )
312   );
313
314   if(base && base->get_iter)
315   {
316     return (*base->get_iter)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreePath*>(path.gobj()) );
317   }
318
319   return bool();
320 }
321
322 gboolean TreeModel_Class::iter_children_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* parent)
323 {
324   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
325       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
326
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
331   // being overridden:
332   if(obj && obj->is_derived_())
333   {
334     #ifdef GLIBMM_EXCEPTIONS_ENABLED
335     try // Trap C++ exceptions which would normally be lost because this is a C callback.
336     {
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.
340
341       gboolean test = false;
342       if(!parent)
343       {
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);
348       }
349       else
350       {
351         //Normal case: 
352          Gtk::TreeModel::iterator parent_cpp(self, parent);
353          test = obj->iter_children_vfunc(parent_cpp, iter_out);
354       }
355
356       //Copy the new iter value to the C output parameter:
357       if(test)
358         *iter = *(iter_out.gobj());
359         
360       return test;
361     #ifdef GLIBMM_EXCEPTIONS_ENABLED
362     }
363     catch(...)
364     {
365       Glib::exception_handlers_invoke();
366     }
367     #endif //GLIBMM_EXCEPTIONS_ENABLED
368   }
369   else
370   {
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.
374 )    );
375
376     // Call the original underlying C function:
377     if(base && base->iter_children)
378       return (*base->iter_children)(self, iter, parent);
379   }
380
381   typedef gboolean RType;
382   return RType();
383 }
384
385 bool TreeModel::iter_children_vfunc(const iterator& parent, iterator& iter) const
386 {
387   //Call the default C implementation:
388
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.
392     )
393   );
394
395   if(base && base->iter_children)
396   {
397     return (*base->iter_children)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(parent.gobj()) );
398   }
399
400   return bool();
401 }
402
403 gboolean TreeModel_Class::iter_parent_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* child)
404 {
405   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
406       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
407
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
412   // being overridden:
413   if(obj && obj->is_derived_())
414   {
415     #ifdef GLIBMM_EXCEPTIONS_ENABLED
416     try // Trap C++ exceptions which would normally be lost because this is a C callback.
417     {
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);
423
424       //Copy the new iter value to the C output parameter:
425       if(test)
426         *iter = *(iter_out.gobj());
427
428       return test;
429     #ifdef GLIBMM_EXCEPTIONS_ENABLED
430     }
431     catch(...)
432     {
433       Glib::exception_handlers_invoke();
434     }
435     #endif //GLIBMM_EXCEPTIONS_ENABLED
436   }
437   else
438   {
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.
442 )    );
443
444     // Call the original underlying C function:
445     if(base && base->iter_parent)
446       return (*base->iter_parent)(self, iter, child);
447   }
448
449   typedef gboolean RType;
450   return RType();
451 }
452
453 bool TreeModel::iter_parent_vfunc(const iterator& child, iterator& iter) const
454 {
455   //Call the default C implementation:
456
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.
460     )
461   );
462
463   if(base && base->iter_parent)
464   {
465     return (*base->iter_parent)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(child.gobj()) );
466   }
467
468   return bool();
469 }
470
471 gboolean TreeModel_Class::iter_nth_child_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, GtkTreeIter* parent, int n)
472 {
473   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
474       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
475
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
480   // being overridden:
481   if(obj && obj->is_derived_())
482   {
483     #ifdef GLIBMM_EXCEPTIONS_ENABLED
484     try // Trap C++ exceptions which would normally be lost because this is a C callback.
485     {
486     #endif //GLIBMM_EXCEPTIONS_ENABLED
487       // Call the virtual member method, which derived classes might override.
488       Gtk::TreeModel::iterator iter_out(self, iter);
489
490       gboolean test = false;
491       if(!parent)
492       {
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);
496       }
497       else
498       {
499         //The normal case:
500         Gtk::TreeModel::iterator parent_cpp(self, parent);
501         test = obj->iter_nth_child_vfunc(parent_cpp, n, iter_out);
502       }
503
504       //Copy the new iter value to the C output parameter:
505       if(test)
506         *iter = *(iter_out.gobj());
507
508       return test;
509     #ifdef GLIBMM_EXCEPTIONS_ENABLED
510     }
511     catch(...)
512     {
513       Glib::exception_handlers_invoke();
514     }
515     #endif //GLIBMM_EXCEPTIONS_ENABLED
516   }
517   else
518   {
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.
522 )    );
523
524     // Call the original underlying C function:
525     if(base && base->iter_nth_child)
526       return (*base->iter_nth_child)(self, iter, parent, n);
527   }
528
529   typedef gboolean RType;
530   return RType();
531 }
532
533 bool TreeModel::iter_nth_child_vfunc(const iterator& parent, int n, iterator& iter) const
534 {
535   //Call the default C implementation:
536
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.
540     )
541   );
542
543   if(base && base->iter_nth_child)
544   {
545     return (*base->iter_nth_child)( const_cast<GtkTreeModel*>(gobj()), iter.gobj(), const_cast<GtkTreeIter*>(parent.gobj()), n );
546   }
547
548   return bool();
549 }
550
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
554 {
555   //Call the default C implementation:
556
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.
560     )
561   );
562
563   if(base && base->iter_nth_child)
564   {
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 );
568   }
569
570   return bool();
571 }
572
573 gboolean TreeModel_Class::iter_n_children_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
574 {
575   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
576       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
577
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
582   // being overridden:
583   if(obj && obj->is_derived_())
584   {
585     #ifdef GLIBMM_EXCEPTIONS_ENABLED
586     try // Trap C++ exceptions which would normally be lost because this is a C callback.
587     {
588     #endif //GLIBMM_EXCEPTIONS_ENABLED
589       // Call the virtual member method, which derived classes might override.
590
591       //Deal with the case that iter is null, as described in the C docs:
592       if(iter)
593         return obj->iter_n_children_vfunc( Gtk::TreeModel::iterator(self, iter) );
594       else
595         return obj->iter_n_root_children_vfunc();
596     #ifdef GLIBMM_EXCEPTIONS_ENABLED
597     }
598     catch(...)
599     {
600       Glib::exception_handlers_invoke();
601     }
602     #endif //GLIBMM_EXCEPTIONS_ENABLED
603   }
604   else
605   {
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.
609 )    );
610
611     // Call the original underlying C function:
612     if(base && base->iter_n_children)
613       return (*base->iter_n_children)(self, iter);
614   }
615
616   typedef gboolean RType;
617   return RType();
618 }
619
620 int TreeModel::iter_n_children_vfunc(const iterator& iter) const
621 {
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.
625 )  );
626
627   if(base && base->iter_n_children)
628     return (*base->iter_n_children)(const_cast<GtkTreeModel*>(gobj()), const_cast<GtkTreeIter*>((iter).gobj()));
629
630   typedef int RType;
631   return RType();
632 }
633
634 int TreeModel::iter_n_root_children_vfunc() const
635 {
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.
639 )  );
640
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 */);
643
644   typedef int RType;
645   return RType();
646 }
647
648 #endif //GLIBMM_VFUNCS_ENABLED
649
650
651 void TreeModel::rows_reordered(const Path& path, const iterator& iter, const Glib::ArrayHandle<int>& new_order)
652 {
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()));
655 }
656  
657 void TreeModel::rows_reordered(const Path& path, const Glib::ArrayHandle<int>& new_order)
658 {
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()));
661 }
662
663 } // namespace Gtk
664
665
666 namespace
667 {
668
669
670 static void TreeModel_signal_row_changed_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
671 {
672   using namespace Gtk;
673   typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
674
675   // Do not try to call a signal on a disassociated wrapper.
676   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
677   {
678     #ifdef GLIBMM_EXCEPTIONS_ENABLED
679     try
680     {
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)
685 );
686     #ifdef GLIBMM_EXCEPTIONS_ENABLED
687     }
688     catch(...)
689     {
690       Glib::exception_handlers_invoke();
691     }
692     #endif //GLIBMM_EXCEPTIONS_ENABLED
693   }
694 }
695
696 static const Glib::SignalProxyInfo TreeModel_signal_row_changed_info =
697 {
698   "row_changed",
699   (GCallback) &TreeModel_signal_row_changed_callback,
700   (GCallback) &TreeModel_signal_row_changed_callback
701 };
702
703
704 static void TreeModel_signal_row_inserted_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
705 {
706   using namespace Gtk;
707   typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
708
709   // Do not try to call a signal on a disassociated wrapper.
710   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
711   {
712     #ifdef GLIBMM_EXCEPTIONS_ENABLED
713     try
714     {
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)
719 );
720     #ifdef GLIBMM_EXCEPTIONS_ENABLED
721     }
722     catch(...)
723     {
724       Glib::exception_handlers_invoke();
725     }
726     #endif //GLIBMM_EXCEPTIONS_ENABLED
727   }
728 }
729
730 static const Glib::SignalProxyInfo TreeModel_signal_row_inserted_info =
731 {
732   "row_inserted",
733   (GCallback) &TreeModel_signal_row_inserted_callback,
734   (GCallback) &TreeModel_signal_row_inserted_callback
735 };
736
737
738 static void TreeModel_signal_row_has_child_toggled_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,void* data)
739 {
740   using namespace Gtk;
741   typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator& > SlotType;
742
743   // Do not try to call a signal on a disassociated wrapper.
744   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
745   {
746     #ifdef GLIBMM_EXCEPTIONS_ENABLED
747     try
748     {
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)
753 );
754     #ifdef GLIBMM_EXCEPTIONS_ENABLED
755     }
756     catch(...)
757     {
758       Glib::exception_handlers_invoke();
759     }
760     #endif //GLIBMM_EXCEPTIONS_ENABLED
761   }
762 }
763
764 static const Glib::SignalProxyInfo TreeModel_signal_row_has_child_toggled_info =
765 {
766   "row_has_child_toggled",
767   (GCallback) &TreeModel_signal_row_has_child_toggled_callback,
768   (GCallback) &TreeModel_signal_row_has_child_toggled_callback
769 };
770
771
772 static void TreeModel_signal_row_deleted_callback(GtkTreeModel* self, GtkTreePath* path,void* data)
773 {
774   using namespace Gtk;
775   typedef sigc::slot< void,const TreeModel::Path& > SlotType;
776
777   // Do not try to call a signal on a disassociated wrapper.
778   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
779   {
780     #ifdef GLIBMM_EXCEPTIONS_ENABLED
781     try
782     {
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)
786 );
787     #ifdef GLIBMM_EXCEPTIONS_ENABLED
788     }
789     catch(...)
790     {
791       Glib::exception_handlers_invoke();
792     }
793     #endif //GLIBMM_EXCEPTIONS_ENABLED
794   }
795 }
796
797 static const Glib::SignalProxyInfo TreeModel_signal_row_deleted_info =
798 {
799   "row_deleted",
800   (GCallback) &TreeModel_signal_row_deleted_callback,
801   (GCallback) &TreeModel_signal_row_deleted_callback
802 };
803
804
805 static void TreeModel_signal_rows_reordered_callback(GtkTreeModel* self, GtkTreePath* path,GtkTreeIter* iter,gint* new_order,void* data)
806 {
807   using namespace Gtk;
808   typedef sigc::slot< void,const TreeModel::Path&,const TreeModel::iterator&,int* > SlotType;
809
810   // Do not try to call a signal on a disassociated wrapper.
811   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
812   {
813     #ifdef GLIBMM_EXCEPTIONS_ENABLED
814     try
815     {
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)
820 , new_order
821 );
822     #ifdef GLIBMM_EXCEPTIONS_ENABLED
823     }
824     catch(...)
825     {
826       Glib::exception_handlers_invoke();
827     }
828     #endif //GLIBMM_EXCEPTIONS_ENABLED
829   }
830 }
831
832 static const Glib::SignalProxyInfo TreeModel_signal_rows_reordered_info =
833 {
834   "rows_reordered",
835   (GCallback) &TreeModel_signal_rows_reordered_callback,
836   (GCallback) &TreeModel_signal_rows_reordered_callback
837 };
838
839
840 } // anonymous namespace
841
842 // static
843 GType Glib::Value<Gtk::TreeModelFlags>::value_type()
844 {
845   return gtk_tree_model_flags_get_type();
846 }
847
848
849 namespace Glib
850 {
851
852 Glib::RefPtr<Gtk::TreeModel> wrap(GtkTreeModel* object, bool take_copy)
853 {
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.
856 }
857
858 } // namespace Glib
859
860
861 namespace Gtk
862 {
863
864
865 /* The *_Class implementation: */
866
867 const Glib::Interface_Class& TreeModel_Class::init()
868 {
869   if(!gtype_) // create the GType if necessary
870   {
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;
874
875     // We can not derive from another interface, and it is not necessary anyway.
876     gtype_ = gtk_tree_model_get_type();
877   }
878
879   return *this;
880 }
881
882 void TreeModel_Class::iface_init_function(void* g_iface, void*)
883 {
884   BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
885
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); 
889
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
906
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
914 }
915
916 #ifdef GLIBMM_VFUNCS_ENABLED
917 GtkTreeModelFlags TreeModel_Class::get_flags_vfunc_callback(GtkTreeModel* self)
918 {
919   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
920       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
921
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
926   // being overridden:
927   if(obj_base && obj_base->is_derived_())
928   {
929     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
930     if(obj) // This can be NULL during destruction.
931     {
932       #ifdef GLIBMM_EXCEPTIONS_ENABLED
933       try // Trap C++ exceptions which would normally be lost because this is a C callback.
934       {
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
939       }
940       catch(...)
941       {
942         Glib::exception_handlers_invoke();
943       }
944       #endif //GLIBMM_EXCEPTIONS_ENABLED
945     }
946   }
947   
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.
951 )  );
952
953   // Call the original underlying C function:
954   if(base && base->get_flags)
955     return (*base->get_flags)(self);
956
957
958   typedef GtkTreeModelFlags RType;
959   return RType();
960 }
961 gint TreeModel_Class::get_n_columns_vfunc_callback(GtkTreeModel* self)
962 {
963   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
964       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
965
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
970   // being overridden:
971   if(obj_base && obj_base->is_derived_())
972   {
973     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
974     if(obj) // This can be NULL during destruction.
975     {
976       #ifdef GLIBMM_EXCEPTIONS_ENABLED
977       try // Trap C++ exceptions which would normally be lost because this is a C callback.
978       {
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
983       }
984       catch(...)
985       {
986         Glib::exception_handlers_invoke();
987       }
988       #endif //GLIBMM_EXCEPTIONS_ENABLED
989     }
990   }
991   
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.
995 )  );
996
997   // Call the original underlying C function:
998   if(base && base->get_n_columns)
999     return (*base->get_n_columns)(self);
1000
1001
1002   typedef gint RType;
1003   return RType();
1004 }
1005 GType TreeModel_Class::get_column_type_vfunc_callback(GtkTreeModel* self, gint index)
1006 {
1007   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1008       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1009
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_())
1016   {
1017     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1018     if(obj) // This can be NULL during destruction.
1019     {
1020       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1021       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1022       {
1023       #endif //GLIBMM_EXCEPTIONS_ENABLED
1024         // Call the virtual member method, which derived classes might override.
1025         return obj->get_column_type_vfunc(index
1026 );
1027       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1028       }
1029       catch(...)
1030       {
1031         Glib::exception_handlers_invoke();
1032       }
1033       #endif //GLIBMM_EXCEPTIONS_ENABLED
1034     }
1035   }
1036   
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.
1040 )  );
1041
1042   // Call the original underlying C function:
1043   if(base && base->get_column_type)
1044     return (*base->get_column_type)(self, index);
1045
1046
1047   typedef GType RType;
1048   return RType();
1049 }
1050 gboolean TreeModel_Class::iter_has_child_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1051 {
1052   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1053       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1054
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_())
1061   {
1062     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1063     if(obj) // This can be NULL during destruction.
1064     {
1065       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1066       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1067       {
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)
1071 ));
1072       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1073       }
1074       catch(...)
1075       {
1076         Glib::exception_handlers_invoke();
1077       }
1078       #endif //GLIBMM_EXCEPTIONS_ENABLED
1079     }
1080   }
1081   
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.
1085 )  );
1086
1087   // Call the original underlying C function:
1088   if(base && base->iter_has_child)
1089     return (*base->iter_has_child)(self, iter);
1090
1091
1092   typedef gboolean RType;
1093   return RType();
1094 }
1095 void TreeModel_Class::ref_node_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1096 {
1097   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1098       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1099
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_())
1106   {
1107     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1108     if(obj) // This can be NULL during destruction.
1109     {
1110       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1111       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1112       {
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)
1116 );
1117         return;
1118       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1119       }
1120       catch(...)
1121       {
1122         Glib::exception_handlers_invoke();
1123       }
1124       #endif //GLIBMM_EXCEPTIONS_ENABLED
1125     }
1126   }
1127   
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.
1131 )  );
1132
1133   // Call the original underlying C function:
1134   if(base && base->ref_node)
1135     (*base->ref_node)(self, iter);
1136
1137 }
1138 void TreeModel_Class::unref_node_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1139 {
1140   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1141       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1142
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_())
1149   {
1150     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1151     if(obj) // This can be NULL during destruction.
1152     {
1153       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1154       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1155       {
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)
1159 );
1160         return;
1161       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1162       }
1163       catch(...)
1164       {
1165         Glib::exception_handlers_invoke();
1166       }
1167       #endif //GLIBMM_EXCEPTIONS_ENABLED
1168     }
1169   }
1170   
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.
1174 )  );
1175
1176   // Call the original underlying C function:
1177   if(base && base->unref_node)
1178     (*base->unref_node)(self, iter);
1179
1180 }
1181 GtkTreePath* TreeModel_Class::get_path_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter)
1182 {
1183   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1184       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1185
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_())
1192   {
1193     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1194     if(obj) // This can be NULL during destruction.
1195     {
1196       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1197       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1198       {
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)
1202 )).gobj_copy();
1203       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1204       }
1205       catch(...)
1206       {
1207         Glib::exception_handlers_invoke();
1208       }
1209       #endif //GLIBMM_EXCEPTIONS_ENABLED
1210     }
1211   }
1212   
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.
1216 )  );
1217
1218   // Call the original underlying C function:
1219   if(base && base->get_path)
1220     return (*base->get_path)(self, iter);
1221
1222
1223   typedef GtkTreePath* RType;
1224   return RType();
1225 }
1226 void TreeModel_Class::get_value_vfunc_callback(GtkTreeModel* self, GtkTreeIter* iter, gint column, GValue* value)
1227 {
1228   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1229       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1230
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_())
1237   {
1238     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1239     if(obj) // This can be NULL during destruction.
1240     {
1241       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1242       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1243       {
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)
1247 , column
1248 , *reinterpret_cast<Glib::ValueBase*>(value)
1249 );
1250         return;
1251       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1252       }
1253       catch(...)
1254       {
1255         Glib::exception_handlers_invoke();
1256       }
1257       #endif //GLIBMM_EXCEPTIONS_ENABLED
1258     }
1259   }
1260   
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.
1264 )  );
1265
1266   // Call the original underlying C function:
1267   if(base && base->get_value)
1268     (*base->get_value)(self, iter, column, value);
1269
1270 }
1271 #endif //GLIBMM_VFUNCS_ENABLED
1272
1273 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1274 void TreeModel_Class::row_changed_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1275 {
1276   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1277       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1278
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_())
1285   {
1286     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1287     if(obj) // This can be NULL during destruction.
1288     {
1289       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1290       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1291       {
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)
1296 );
1297         return;
1298       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1299       }
1300       catch(...)
1301       {
1302         Glib::exception_handlers_invoke();
1303       }
1304       #endif //GLIBMM_EXCEPTIONS_ENABLED
1305     }
1306   }
1307   
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.
1311 )    );
1312
1313   // Call the original underlying C function:
1314   if(base && base->row_changed)
1315     (*base->row_changed)(self, path, iter);
1316 }
1317 void TreeModel_Class::row_inserted_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1318 {
1319   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1320       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1321
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_())
1328   {
1329     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1330     if(obj) // This can be NULL during destruction.
1331     {
1332       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1333       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1334       {
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)
1339 );
1340         return;
1341       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1342       }
1343       catch(...)
1344       {
1345         Glib::exception_handlers_invoke();
1346       }
1347       #endif //GLIBMM_EXCEPTIONS_ENABLED
1348     }
1349   }
1350   
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.
1354 )    );
1355
1356   // Call the original underlying C function:
1357   if(base && base->row_inserted)
1358     (*base->row_inserted)(self, path, iter);
1359 }
1360 void TreeModel_Class::row_has_child_toggled_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter)
1361 {
1362   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1363       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1364
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_())
1371   {
1372     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1373     if(obj) // This can be NULL during destruction.
1374     {
1375       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1376       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1377       {
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)
1382 );
1383         return;
1384       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1385       }
1386       catch(...)
1387       {
1388         Glib::exception_handlers_invoke();
1389       }
1390       #endif //GLIBMM_EXCEPTIONS_ENABLED
1391     }
1392   }
1393   
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.
1397 )    );
1398
1399   // Call the original underlying C function:
1400   if(base && base->row_has_child_toggled)
1401     (*base->row_has_child_toggled)(self, path, iter);
1402 }
1403 void TreeModel_Class::row_deleted_callback(GtkTreeModel* self, GtkTreePath* path)
1404 {
1405   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1406       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1407
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_())
1414   {
1415     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1416     if(obj) // This can be NULL during destruction.
1417     {
1418       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1419       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1420       {
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)
1424 );
1425         return;
1426       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1427       }
1428       catch(...)
1429       {
1430         Glib::exception_handlers_invoke();
1431       }
1432       #endif //GLIBMM_EXCEPTIONS_ENABLED
1433     }
1434   }
1435   
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.
1439 )    );
1440
1441   // Call the original underlying C function:
1442   if(base && base->row_deleted)
1443     (*base->row_deleted)(self, path);
1444 }
1445 void TreeModel_Class::rows_reordered_callback(GtkTreeModel* self, GtkTreePath* path, GtkTreeIter* iter, gint* new_order)
1446 {
1447   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
1448       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
1449
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_())
1456   {
1457     CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
1458     if(obj) // This can be NULL during destruction.
1459     {
1460       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1461       try // Trap C++ exceptions which would normally be lost because this is a C callback.
1462       {
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)
1467 , new_order
1468 );
1469         return;
1470       #ifdef GLIBMM_EXCEPTIONS_ENABLED
1471       }
1472       catch(...)
1473       {
1474         Glib::exception_handlers_invoke();
1475       }
1476       #endif //GLIBMM_EXCEPTIONS_ENABLED
1477     }
1478   }
1479   
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.
1483 )    );
1484
1485   // Call the original underlying C function:
1486   if(base && base->rows_reordered)
1487     (*base->rows_reordered)(self, path, iter, new_order);
1488 }
1489 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1490
1491
1492 Glib::ObjectBase* TreeModel_Class::wrap_new(GObject* object)
1493 {
1494   return new TreeModel((GtkTreeModel*)(object));
1495 }
1496
1497
1498 /* The implementation: */
1499
1500 TreeModel::TreeModel()
1501 :
1502   Glib::Interface(treemodel_class_.init())
1503 {}
1504
1505 TreeModel::TreeModel(GtkTreeModel* castitem)
1506 :
1507   Glib::Interface((GObject*)(castitem))
1508 {}
1509
1510 TreeModel::~TreeModel()
1511 {}
1512
1513 // static
1514 void TreeModel::add_interface(GType gtype_implementer)
1515 {
1516   treemodel_class_.init().add_interface(gtype_implementer);
1517 }
1518
1519 TreeModel::CppClassType TreeModel::treemodel_class_; // initialize static member
1520
1521 GType TreeModel::get_type()
1522 {
1523   return treemodel_class_.init().get_type();
1524 }
1525
1526 GType TreeModel::get_base_type()
1527 {
1528   return gtk_tree_model_get_type();
1529 }
1530
1531
1532 TreeModelFlags TreeModel::get_flags() const
1533 {
1534   return ((TreeModelFlags)(gtk_tree_model_get_flags(const_cast<GtkTreeModel*>(gobj()))));
1535 }
1536
1537 int TreeModel::get_n_columns() const
1538 {
1539   return gtk_tree_model_get_n_columns(const_cast<GtkTreeModel*>(gobj()));
1540 }
1541
1542 GType TreeModel::get_column_type(int index) const
1543 {
1544   return gtk_tree_model_get_column_type(const_cast<GtkTreeModel*>(gobj()), index);
1545 }
1546
1547 TreeModel::Path TreeModel::get_path(const iterator& iter) const
1548 {
1549   return Gtk::TreePath(gtk_tree_model_get_path(const_cast<GtkTreeModel*>(gobj()), const_cast<GtkTreeIter*>((iter).gobj())), false);
1550 }
1551
1552 void TreeModel::row_changed(const Path& path, const iterator& iter)
1553 {
1554 gtk_tree_model_row_changed(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj())); 
1555 }
1556
1557 void TreeModel::row_inserted(const Path& path, const iterator& iter)
1558 {
1559 gtk_tree_model_row_inserted(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj())); 
1560 }
1561
1562 void TreeModel::row_has_child_toggled(const Path& path, const iterator& iter)
1563 {
1564 gtk_tree_model_row_has_child_toggled(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj())); 
1565 }
1566
1567 void TreeModel::row_deleted(const Path& path)
1568 {
1569 gtk_tree_model_row_deleted(gobj(), const_cast<GtkTreePath*>((path).gobj())); 
1570 }
1571
1572 void TreeModel::rows_reordered(const Path& path, const iterator& iter, int* new_order)
1573 {
1574 gtk_tree_model_rows_reordered(gobj(), const_cast<GtkTreePath*>((path).gobj()), const_cast<GtkTreeIter*>((iter).gobj()), new_order); 
1575 }
1576
1577 Glib::ustring TreeModel::get_string(const iterator& iter) const
1578 {
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())));
1580 }
1581
1582
1583 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_changed()
1584 {
1585   return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_changed_info);
1586 }
1587
1588
1589 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_inserted()
1590 {
1591   return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_inserted_info);
1592 }
1593
1594
1595 Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& > TreeModel::signal_row_has_child_toggled()
1596 {
1597   return Glib::SignalProxy2< void,const TreeModel::Path&,const TreeModel::iterator& >(this, &TreeModel_signal_row_has_child_toggled_info);
1598 }
1599
1600
1601 Glib::SignalProxy1< void,const TreeModel::Path& > TreeModel::signal_row_deleted()
1602 {
1603   return Glib::SignalProxy1< void,const TreeModel::Path& >(this, &TreeModel_signal_row_deleted_info);
1604 }
1605
1606
1607 Glib::SignalProxy3< void,const TreeModel::Path&,const TreeModel::iterator&,int* > TreeModel::signal_rows_reordered()
1608 {
1609   return Glib::SignalProxy3< void,const TreeModel::Path&,const TreeModel::iterator&,int* >(this, &TreeModel_signal_rows_reordered_info);
1610 }
1611
1612
1613 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1614 void Gtk::TreeModel::on_row_changed(const TreeModel::Path& path, const TreeModel::iterator& iter)
1615 {
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.
1619 )  );
1620
1621   if(base && base->row_changed)
1622     (*base->row_changed)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1623 }
1624 void Gtk::TreeModel::on_row_inserted(const TreeModel::Path& path, const TreeModel::iterator& iter)
1625 {
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.
1629 )  );
1630
1631   if(base && base->row_inserted)
1632     (*base->row_inserted)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1633 }
1634 void Gtk::TreeModel::on_row_has_child_toggled(const TreeModel::Path& path, const TreeModel::iterator& iter)
1635 {
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.
1639 )  );
1640
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()));
1643 }
1644 void Gtk::TreeModel::on_row_deleted(const TreeModel::Path& path)
1645 {
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.
1649 )  );
1650
1651   if(base && base->row_deleted)
1652     (*base->row_deleted)(gobj(),const_cast<GtkTreePath*>((path).gobj()));
1653 }
1654 void Gtk::TreeModel::on_rows_reordered(const TreeModel::Path& path, const TreeModel::iterator& iter, int* new_order)
1655 {
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.
1659 )  );
1660
1661   if(base && base->rows_reordered)
1662     (*base->rows_reordered)(gobj(),const_cast<GtkTreePath*>((path).gobj()),const_cast<GtkTreeIter*>((iter).gobj()),new_order);
1663 }
1664 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
1665
1666 #ifdef GLIBMM_VFUNCS_ENABLED
1667 TreeModelFlags Gtk::TreeModel::get_flags_vfunc() const
1668 {
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.
1672 )  );
1673
1674   if(base && base->get_flags)
1675     return ((TreeModelFlags)((*base->get_flags)(const_cast<GtkTreeModel*>(gobj()))));
1676
1677   typedef TreeModelFlags RType;
1678   return RType();
1679 }
1680 int Gtk::TreeModel::get_n_columns_vfunc() const
1681 {
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.
1685 )  );
1686
1687   if(base && base->get_n_columns)
1688     return (*base->get_n_columns)(const_cast<GtkTreeModel*>(gobj()));
1689
1690   typedef int RType;
1691   return RType();
1692 }
1693 GType Gtk::TreeModel::get_column_type_vfunc(int index) const
1694 {
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.
1698 )  );
1699
1700   if(base && base->get_column_type)
1701     return (*base->get_column_type)(const_cast<GtkTreeModel*>(gobj()),index);
1702
1703   typedef GType RType;
1704   return RType();
1705 }
1706 bool Gtk::TreeModel::iter_has_child_vfunc(const iterator& iter) const
1707 {
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.
1711 )  );
1712
1713   if(base && base->iter_has_child)
1714     return (*base->iter_has_child)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1715
1716   typedef bool RType;
1717   return RType();
1718 }
1719 void Gtk::TreeModel::ref_node_vfunc(const iterator& iter) const
1720 {
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.
1724 )  );
1725
1726   if(base && base->ref_node)
1727     (*base->ref_node)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1728 }
1729 void Gtk::TreeModel::unref_node_vfunc(const iterator& iter) const
1730 {
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.
1734 )  );
1735
1736   if(base && base->unref_node)
1737     (*base->unref_node)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()));
1738 }
1739 TreeModel::Path Gtk::TreeModel::get_path_vfunc(const iterator& iter) const
1740 {
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.
1744 )  );
1745
1746   if(base && base->get_path)
1747     return Gtk::TreePath((*base->get_path)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj())), false);
1748
1749   typedef TreeModel::Path RType;
1750   return RType();
1751 }
1752 void Gtk::TreeModel::get_value_vfunc(const iterator& iter, int column, Glib::ValueBase& value) const
1753 {
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.
1757 )  );
1758
1759   if(base && base->get_value)
1760     (*base->get_value)(const_cast<GtkTreeModel*>(gobj()),const_cast<GtkTreeIter*>((iter).gobj()),column,(value).gobj());
1761 }
1762 #endif //GLIBMM_VFUNCS_ENABLED
1763
1764
1765 } // namespace Gtk
1766
1767