1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gtkmm/container.h>
5 #include <gtkmm/private/container_p.h>
10 /* Copyright 1998-2002 The gtkmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <gtkmm/adjustment.h>
28 #include <gtk/gtkcontainer.h>
34 static void container_foreach_callback(GtkWidget* widget_gobj, void* data)
36 #ifdef GLIBMM_EXCEPTIONS_ENABLED
39 #endif //GLIBMM_EXCEPTIONS_ENABLED
40 Gtk::Container::ForeachSlot& slot = *static_cast<Gtk::Container::ForeachSlot*>(data);
41 Gtk::Widget *const widget = Glib::wrap(widget_gobj);
43 g_return_if_fail(widget != 0);
46 #ifdef GLIBMM_EXCEPTIONS_ENABLED
50 Glib::exception_handlers_invoke();
52 #endif //GLIBMM_EXCEPTIONS_ENABLED
56 //Copy of generated callback:
57 static void Container_signal_remove_callback_normal(GtkContainer* self, GtkWidget* p0,void* data)
60 typedef sigc::slot< void,Widget* > SlotType;
62 // Do not try to call a signal on a disassociated wrapper.
63 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
65 #ifdef GLIBMM_EXCEPTIONS_ENABLED
68 #endif //GLIBMM_EXCEPTIONS_ENABLED
69 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
70 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
72 #ifdef GLIBMM_EXCEPTIONS_ENABLED
76 Glib::exception_handlers_invoke();
78 #endif //GLIBMM_EXCEPTIONS_ENABLED
82 static void Container_signal_remove_callback(GtkContainer* self, GtkWidget* p0, void* data)
86 #ifdef GLIBMM_DEBUG_REFCOUNTING
87 g_warning("Container_signal_remove_callback()");
90 //Don't call wrap() on a GTK+ instance whose gtkmm instance has been deleted - just call the original C callback.
91 const bool gtkmm_child_already_deleted = Glib::_gobject_cppinstance_already_deleted((GObject*)p0);
93 if(!gtkmm_child_already_deleted)
95 //Call the regular, generated callback:
96 Container_signal_remove_callback_normal(self, p0, data);
104 } // anonymous namespace
110 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
111 //Copy of generated callback:
112 void Container_Class::remove_callback_normal(GtkContainer* self, GtkWidget* p0)
114 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
115 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
117 // Non-gtkmmproc-generated custom classes implicitly call the default
118 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
119 // generated classes can use this optimisation, which avoids the unnecessary
120 // parameter conversions if there is no possibility of the virtual function
122 if(obj && obj->is_derived_())
124 #ifdef GLIBMM_EXCEPTIONS_ENABLED
125 try // Trap C++ exceptions which would normally be lost because this is a C callback.
127 #endif //GLIBMM_EXCEPTIONS_ENABLED
128 // Call the virtual member method, which derived classes might override.
129 obj->on_remove(Glib::wrap(p0)
131 #ifdef GLIBMM_EXCEPTIONS_ENABLED
135 Glib::exception_handlers_invoke();
137 #endif //GLIBMM_EXCEPTIONS_ENABLED
141 BaseClassType *const base = static_cast<BaseClassType*>(
142 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
145 // Call the original underlying C function:
146 if(base && base->remove)
147 (*base->remove)(self, p0);
151 //Custom hand-coded callback:
152 void Container_Class::remove_callback(GtkContainer* self, GtkWidget* p0)
156 #ifdef GLIBMM_DEBUG_REFCOUNTING
157 g_warning("Container_Class::remove_callback_custom() C self=%p: C child=%p\n", (void*)self, (void*)p0);
158 g_warning("gtypename self: %s\n, gtypename child: %s", G_OBJECT_TYPE_NAME(G_OBJECT(self)), G_OBJECT_TYPE_NAME(G_OBJECT(p0)));
161 //Don't call wrap() on a GTK+ instance whose gtkmm instance has been deleted - just call the original C callback.
162 const bool gtkmm_child_already_deleted = Glib::_gobject_cppinstance_already_deleted((GObject*)p0);
164 if(!gtkmm_child_already_deleted)
166 //Call the regular, generated callback:
167 Container_Class::remove_callback_normal(self, p0);
171 BaseClassType *const base = static_cast<BaseClassType*>(
172 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
175 //Call the original underlying C function:
176 if(base && base->remove)
177 (*base->remove)(self, p0);
180 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
182 void Container::foreach(const Container::ForeachSlot& slot)
184 ForeachSlot slot_copy (slot);
185 gtk_container_foreach(gobj(), &container_foreach_callback, &slot_copy);
188 void Container::add(Widget& widget)
190 gtk_container_add(gobj(), widget.gobj());
193 bool Container::has_focus_chain() const
195 return gtk_container_get_focus_chain(const_cast<GtkContainer*>(gobj()), 0);
198 Glib::ListHandle<Widget*> Container::get_focus_chain()
201 gtk_container_get_focus_chain(gobj(), &list);
203 return Glib::ListHandle<Widget*>(list, Glib::OWNERSHIP_SHALLOW);
206 Glib::ListHandle<const Widget*> Container::get_focus_chain() const
209 gtk_container_get_focus_chain(const_cast<GtkContainer*>(gobj()), &list);
211 return Glib::ListHandle<const Widget*>(list, Glib::OWNERSHIP_SHALLOW);
215 void Container::show_all_children(bool recursive)
217 // Plain C version if this turns out to be performance-critical:
218 //GtkCallback callback = (GtkCallback) ((recursive) ? >k_widget_show_all : >k_widget_show);
219 //gtk_container_foreach(gobj(), callback, 0);
221 // This could also be done with get_children() and an explicit loop,
222 // if any problems should arise. In gtkmm-1.2, foreach() is known to
223 // cause segfaults eventually, but it seems to work now.
225 foreach(sigc::mem_fun((recursive) ? &Widget::show_all : &Widget::show));
228 void Container::remove(Widget& widget)
230 //If this is a managed widget,
231 //then do an extra ref so that it will
232 //not be destroyed when adding to another container
233 //This should leave it in much the same state as when it was instantiated,
234 //before being added to the first container.
235 if(widget.is_managed_())
238 gtk_container_remove(gobj(), widget.gobj());
241 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
243 void Container_Class::destroy_callback(GtkObject* self)
245 #ifdef GLIBMM_DEBUG_REFCOUNTING
246 g_warning("Container_Class::destroy_callback() gobject_=%10X\n", self);
248 g_warning("gtypename: %s\n", G_OBJECT_TYPE_NAME(G_OBJECT(self)));
251 //Call the normal C destroy implementation, such as gtk_button_destroy:
252 //This will chain to gtk_container_destroy(), which will gtk_widget_destroy() any remaining child widgets.
253 GtkObjectClass *const base = static_cast<GtkObjectClass*>(
254 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)));
257 (*base->destroy)(self);
259 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
268 static void Container_signal_add_callback(GtkContainer* self, GtkWidget* p0,void* data)
271 typedef sigc::slot< void,Widget* > SlotType;
273 // Do not try to call a signal on a disassociated wrapper.
274 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
276 #ifdef GLIBMM_EXCEPTIONS_ENABLED
279 #endif //GLIBMM_EXCEPTIONS_ENABLED
280 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
281 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
283 #ifdef GLIBMM_EXCEPTIONS_ENABLED
287 Glib::exception_handlers_invoke();
289 #endif //GLIBMM_EXCEPTIONS_ENABLED
293 static const Glib::SignalProxyInfo Container_signal_add_info =
296 (GCallback) &Container_signal_add_callback,
297 (GCallback) &Container_signal_add_callback
301 static const Glib::SignalProxyInfo Container_signal_remove_info =
304 (GCallback) &Container_signal_remove_callback,
305 (GCallback) &Container_signal_remove_callback
309 static const Glib::SignalProxyInfo Container_signal_check_resize_info =
312 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
313 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
317 static void Container_signal_set_focus_child_callback(GtkContainer* self, GtkWidget* p0,void* data)
320 typedef sigc::slot< void,Widget* > SlotType;
322 // Do not try to call a signal on a disassociated wrapper.
323 if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
325 #ifdef GLIBMM_EXCEPTIONS_ENABLED
328 #endif //GLIBMM_EXCEPTIONS_ENABLED
329 if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
330 (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
332 #ifdef GLIBMM_EXCEPTIONS_ENABLED
336 Glib::exception_handlers_invoke();
338 #endif //GLIBMM_EXCEPTIONS_ENABLED
342 static const Glib::SignalProxyInfo Container_signal_set_focus_child_info =
345 (GCallback) &Container_signal_set_focus_child_callback,
346 (GCallback) &Container_signal_set_focus_child_callback
350 } // anonymous namespace
356 Gtk::Container* wrap(GtkContainer* object, bool take_copy)
358 return dynamic_cast<Gtk::Container *> (Glib::wrap_auto ((GObject*)(object), take_copy));
361 } /* namespace Glib */
367 /* The *_Class implementation: */
369 const Glib::Class& Container_Class::init()
371 if(!gtype_) // create the GType if necessary
373 // Glib::Class has to know the class init function to clone custom types.
374 class_init_func_ = &Container_Class::class_init_function;
376 // This is actually just optimized away, apparently with no harm.
377 // Make sure that the parent type has been created.
378 //CppClassParent::CppObjectType::get_type();
380 // Create the wrapper type, with the same class/instance size as the base type.
381 register_derived_type(gtk_container_get_type());
383 // Add derived versions of interfaces, if the C type implements any interfaces:
389 void Container_Class::class_init_function(void* g_class, void* class_data)
391 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
392 CppClassParent::class_init_function(klass, class_data);
394 #ifdef GLIBMM_VFUNCS_ENABLED
395 klass->child_type = &child_type_vfunc_callback;
396 klass->forall = &forall_vfunc_callback;
397 klass->composite_name = &composite_name_vfunc_callback;
398 klass->set_child_property = &set_child_property_vfunc_callback;
399 klass->get_child_property = &get_child_property_vfunc_callback;
400 #endif //GLIBMM_VFUNCS_ENABLED
402 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
403 klass->add = &add_callback;
404 klass->remove = &remove_callback;
405 klass->check_resize = &check_resize_callback;
406 klass->set_focus_child = &set_focus_child_callback;
407 reinterpret_cast<GtkObjectClass*>(klass)->destroy = &destroy_callback;
408 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
411 #ifdef GLIBMM_VFUNCS_ENABLED
412 GtkType Container_Class::child_type_vfunc_callback(GtkContainer* self)
414 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
415 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
417 // Non-gtkmmproc-generated custom classes implicitly call the default
418 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
419 // generated classes can use this optimisation, which avoids the unnecessary
420 // parameter conversions if there is no possibility of the virtual function
422 if(obj_base && obj_base->is_derived_())
424 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
425 if(obj) // This can be NULL during destruction.
427 #ifdef GLIBMM_EXCEPTIONS_ENABLED
428 try // Trap C++ exceptions which would normally be lost because this is a C callback.
430 #endif //GLIBMM_EXCEPTIONS_ENABLED
431 // Call the virtual member method, which derived classes might override.
432 return obj->child_type_vfunc();
433 #ifdef GLIBMM_EXCEPTIONS_ENABLED
437 Glib::exception_handlers_invoke();
439 #endif //GLIBMM_EXCEPTIONS_ENABLED
443 BaseClassType *const base = static_cast<BaseClassType*>(
444 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
447 // Call the original underlying C function:
448 if(base && base->child_type)
449 return (*base->child_type)(self);
452 typedef GtkType RType;
455 void Container_Class::forall_vfunc_callback(GtkContainer* self, gboolean include_internals, GtkCallback callback, gpointer callback_data)
457 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
458 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
460 // Non-gtkmmproc-generated custom classes implicitly call the default
461 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
462 // generated classes can use this optimisation, which avoids the unnecessary
463 // parameter conversions if there is no possibility of the virtual function
465 if(obj_base && obj_base->is_derived_())
467 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
468 if(obj) // This can be NULL during destruction.
470 #ifdef GLIBMM_EXCEPTIONS_ENABLED
471 try // Trap C++ exceptions which would normally be lost because this is a C callback.
473 #endif //GLIBMM_EXCEPTIONS_ENABLED
474 // Call the virtual member method, which derived classes might override.
475 obj->forall_vfunc(include_internals, callback, callback_data);
477 #ifdef GLIBMM_EXCEPTIONS_ENABLED
481 Glib::exception_handlers_invoke();
483 #endif //GLIBMM_EXCEPTIONS_ENABLED
487 BaseClassType *const base = static_cast<BaseClassType*>(
488 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
491 // Call the original underlying C function:
492 if(base && base->forall)
493 (*base->forall)(self, include_internals, callback, callback_data);
496 gchar* Container_Class::composite_name_vfunc_callback(GtkContainer* self, GtkWidget* child)
498 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
499 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
501 // Non-gtkmmproc-generated custom classes implicitly call the default
502 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
503 // generated classes can use this optimisation, which avoids the unnecessary
504 // parameter conversions if there is no possibility of the virtual function
506 if(obj_base && obj_base->is_derived_())
508 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
509 if(obj) // This can be NULL during destruction.
511 #ifdef GLIBMM_EXCEPTIONS_ENABLED
512 try // Trap C++ exceptions which would normally be lost because this is a C callback.
514 #endif //GLIBMM_EXCEPTIONS_ENABLED
515 // Call the virtual member method, which derived classes might override.
516 return obj->composite_name_vfunc(child);
517 #ifdef GLIBMM_EXCEPTIONS_ENABLED
521 Glib::exception_handlers_invoke();
523 #endif //GLIBMM_EXCEPTIONS_ENABLED
527 BaseClassType *const base = static_cast<BaseClassType*>(
528 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
531 // Call the original underlying C function:
532 if(base && base->composite_name)
533 return (*base->composite_name)(self, child);
536 typedef gchar* RType;
539 void Container_Class::set_child_property_vfunc_callback(GtkContainer* self, GtkWidget* child, guint property_id, const GValue* value, GParamSpec* pspec)
541 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
542 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
544 // Non-gtkmmproc-generated custom classes implicitly call the default
545 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
546 // generated classes can use this optimisation, which avoids the unnecessary
547 // parameter conversions if there is no possibility of the virtual function
549 if(obj_base && obj_base->is_derived_())
551 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
552 if(obj) // This can be NULL during destruction.
554 #ifdef GLIBMM_EXCEPTIONS_ENABLED
555 try // Trap C++ exceptions which would normally be lost because this is a C callback.
557 #endif //GLIBMM_EXCEPTIONS_ENABLED
558 // Call the virtual member method, which derived classes might override.
559 obj->set_child_property_vfunc(child, property_id, value, pspec);
561 #ifdef GLIBMM_EXCEPTIONS_ENABLED
565 Glib::exception_handlers_invoke();
567 #endif //GLIBMM_EXCEPTIONS_ENABLED
571 BaseClassType *const base = static_cast<BaseClassType*>(
572 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
575 // Call the original underlying C function:
576 if(base && base->set_child_property)
577 (*base->set_child_property)(self, child, property_id, value, pspec);
580 void Container_Class::get_child_property_vfunc_callback(GtkContainer* self, GtkWidget* child, guint property_id, GValue* value, GParamSpec* pspec)
582 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
583 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
585 // Non-gtkmmproc-generated custom classes implicitly call the default
586 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
587 // generated classes can use this optimisation, which avoids the unnecessary
588 // parameter conversions if there is no possibility of the virtual function
590 if(obj_base && obj_base->is_derived_())
592 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
593 if(obj) // This can be NULL during destruction.
595 #ifdef GLIBMM_EXCEPTIONS_ENABLED
596 try // Trap C++ exceptions which would normally be lost because this is a C callback.
598 #endif //GLIBMM_EXCEPTIONS_ENABLED
599 // Call the virtual member method, which derived classes might override.
600 obj->get_child_property_vfunc(child, property_id, value, pspec);
602 #ifdef GLIBMM_EXCEPTIONS_ENABLED
606 Glib::exception_handlers_invoke();
608 #endif //GLIBMM_EXCEPTIONS_ENABLED
612 BaseClassType *const base = static_cast<BaseClassType*>(
613 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
616 // Call the original underlying C function:
617 if(base && base->get_child_property)
618 (*base->get_child_property)(self, child, property_id, value, pspec);
621 #endif //GLIBMM_VFUNCS_ENABLED
623 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
624 void Container_Class::add_callback(GtkContainer* self, GtkWidget* p0)
626 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
627 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
629 // Non-gtkmmproc-generated custom classes implicitly call the default
630 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
631 // generated classes can use this optimisation, which avoids the unnecessary
632 // parameter conversions if there is no possibility of the virtual function
634 if(obj_base && obj_base->is_derived_())
636 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
637 if(obj) // This can be NULL during destruction.
639 #ifdef GLIBMM_EXCEPTIONS_ENABLED
640 try // Trap C++ exceptions which would normally be lost because this is a C callback.
642 #endif //GLIBMM_EXCEPTIONS_ENABLED
643 // Call the virtual member method, which derived classes might override.
644 obj->on_add(Glib::wrap(p0)
647 #ifdef GLIBMM_EXCEPTIONS_ENABLED
651 Glib::exception_handlers_invoke();
653 #endif //GLIBMM_EXCEPTIONS_ENABLED
657 BaseClassType *const base = static_cast<BaseClassType*>(
658 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
661 // Call the original underlying C function:
662 if(base && base->add)
663 (*base->add)(self, p0);
665 void Container_Class::check_resize_callback(GtkContainer* self)
667 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
668 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
670 // Non-gtkmmproc-generated custom classes implicitly call the default
671 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
672 // generated classes can use this optimisation, which avoids the unnecessary
673 // parameter conversions if there is no possibility of the virtual function
675 if(obj_base && obj_base->is_derived_())
677 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
678 if(obj) // This can be NULL during destruction.
680 #ifdef GLIBMM_EXCEPTIONS_ENABLED
681 try // Trap C++ exceptions which would normally be lost because this is a C callback.
683 #endif //GLIBMM_EXCEPTIONS_ENABLED
684 // Call the virtual member method, which derived classes might override.
685 obj->on_check_resize();
687 #ifdef GLIBMM_EXCEPTIONS_ENABLED
691 Glib::exception_handlers_invoke();
693 #endif //GLIBMM_EXCEPTIONS_ENABLED
697 BaseClassType *const base = static_cast<BaseClassType*>(
698 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
701 // Call the original underlying C function:
702 if(base && base->check_resize)
703 (*base->check_resize)(self);
705 void Container_Class::set_focus_child_callback(GtkContainer* self, GtkWidget* p0)
707 Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
708 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
710 // Non-gtkmmproc-generated custom classes implicitly call the default
711 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
712 // generated classes can use this optimisation, which avoids the unnecessary
713 // parameter conversions if there is no possibility of the virtual function
715 if(obj_base && obj_base->is_derived_())
717 CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
718 if(obj) // This can be NULL during destruction.
720 #ifdef GLIBMM_EXCEPTIONS_ENABLED
721 try // Trap C++ exceptions which would normally be lost because this is a C callback.
723 #endif //GLIBMM_EXCEPTIONS_ENABLED
724 // Call the virtual member method, which derived classes might override.
725 obj->on_set_focus_child(Glib::wrap(p0)
728 #ifdef GLIBMM_EXCEPTIONS_ENABLED
732 Glib::exception_handlers_invoke();
734 #endif //GLIBMM_EXCEPTIONS_ENABLED
738 BaseClassType *const base = static_cast<BaseClassType*>(
739 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
742 // Call the original underlying C function:
743 if(base && base->set_focus_child)
744 (*base->set_focus_child)(self, p0);
746 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
749 Glib::ObjectBase* Container_Class::wrap_new(GObject* o)
751 return manage(new Container((GtkContainer*)(o)));
756 /* The implementation: */
758 Container::Container(const Glib::ConstructParams& construct_params)
760 Gtk::Widget(construct_params)
764 Container::Container(GtkContainer* castitem)
766 Gtk::Widget((GtkWidget*)(castitem))
770 Container::~Container()
775 Container::CppClassType Container::container_class_; // initialize static member
777 GType Container::get_type()
779 return container_class_.init().get_type();
782 GType Container::get_base_type()
784 return gtk_container_get_type();
788 void Container::set_border_width(guint border_width)
790 gtk_container_set_border_width(gobj(), border_width);
793 guint Container::get_border_width() const
795 return gtk_container_get_border_width(const_cast<GtkContainer*>(gobj()));
798 void Container::set_resize_mode(ResizeMode resize_mode)
800 gtk_container_set_resize_mode(gobj(), ((GtkResizeMode)(resize_mode)));
803 ResizeMode Container::get_resize_mode() const
805 return ((ResizeMode)(gtk_container_get_resize_mode(const_cast<GtkContainer*>(gobj()))));
808 void Container::check_resize()
810 gtk_container_check_resize(gobj());
813 Glib::ListHandle<Widget*> Container::get_children()
815 return Glib::ListHandle<Widget*>(gtk_container_get_children(gobj()), Glib::OWNERSHIP_SHALLOW);
818 Glib::ListHandle<const Widget*> Container::get_children() const
820 return Glib::ListHandle<const Widget*>(gtk_container_get_children(const_cast<GtkContainer*>(gobj())), Glib::OWNERSHIP_SHALLOW);
823 void Container::propagate_expose(Widget& child, GdkEventExpose* event)
825 gtk_container_propagate_expose(gobj(), (child).gobj(), event);
828 void Container::set_focus_chain(const Glib::ListHandle<Widget*>& focusable_widgets)
830 gtk_container_set_focus_chain(gobj(), focusable_widgets.data());
833 void Container::unset_focus_chain()
835 gtk_container_unset_focus_chain(gobj());
838 void Container::set_reallocate_redraws(bool needs_redraws)
840 gtk_container_set_reallocate_redraws(gobj(), static_cast<int>(needs_redraws));
843 void Container::set_focus_child(Widget& widget)
845 gtk_container_set_focus_child(gobj(), (widget).gobj());
848 void Container::set_focus_vadjustment(Adjustment& adjustment)
850 gtk_container_set_focus_vadjustment(gobj(), (adjustment).gobj());
853 Adjustment* Container::get_focus_vadjustment()
855 return Glib::wrap(gtk_container_get_focus_vadjustment(gobj()));
858 const Adjustment* Container::get_focus_vadjustment() const
860 return const_cast<Container*>(this)->get_focus_vadjustment();
863 void Container::set_focus_hadjustment(Adjustment& adjustment)
865 gtk_container_set_focus_hadjustment(gobj(), (adjustment).gobj());
868 Adjustment* Container::get_focus_hadjustment()
870 return Glib::wrap(gtk_container_get_focus_hadjustment(gobj()));
873 const Adjustment* Container::get_focus_hadjustment() const
875 return const_cast<Container*>(this)->get_focus_hadjustment();
878 void Container::resize_children()
880 gtk_container_resize_children(gobj());
883 GType Container::child_type() const
885 return gtk_container_child_type(const_cast<GtkContainer*>(gobj()));
888 Container::Container()
890 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
892 Gtk::Widget(Glib::ConstructParams(container_class_.init()))
897 Glib::SignalProxy1< void,Widget* > Container::signal_add()
899 return Glib::SignalProxy1< void,Widget* >(this, &Container_signal_add_info);
903 Glib::SignalProxy1< void,Widget* > Container::signal_remove()
905 return Glib::SignalProxy1< void,Widget* >(this, &Container_signal_remove_info);
909 Glib::SignalProxy0< void > Container::signal_check_resize()
911 return Glib::SignalProxy0< void >(this, &Container_signal_check_resize_info);
915 Glib::SignalProxy1< void,Widget* > Container::signal_set_focus_child()
917 return Glib::SignalProxy1< void,Widget* >(this, &Container_signal_set_focus_child_info);
921 #ifdef GLIBMM_PROPERTIES_ENABLED
922 Glib::PropertyProxy<guint> Container::property_border_width()
924 return Glib::PropertyProxy<guint>(this, "border-width");
926 #endif //GLIBMM_PROPERTIES_ENABLED
928 #ifdef GLIBMM_PROPERTIES_ENABLED
929 Glib::PropertyProxy_ReadOnly<guint> Container::property_border_width() const
931 return Glib::PropertyProxy_ReadOnly<guint>(this, "border-width");
933 #endif //GLIBMM_PROPERTIES_ENABLED
935 #ifdef GLIBMM_PROPERTIES_ENABLED
936 Glib::PropertyProxy<ResizeMode> Container::property_resize_mode()
938 return Glib::PropertyProxy<ResizeMode>(this, "resize-mode");
940 #endif //GLIBMM_PROPERTIES_ENABLED
942 #ifdef GLIBMM_PROPERTIES_ENABLED
943 Glib::PropertyProxy_ReadOnly<ResizeMode> Container::property_resize_mode() const
945 return Glib::PropertyProxy_ReadOnly<ResizeMode>(this, "resize-mode");
947 #endif //GLIBMM_PROPERTIES_ENABLED
949 #ifdef GLIBMM_PROPERTIES_ENABLED
950 Glib::PropertyProxy_WriteOnly<Widget*> Container::property_child()
952 return Glib::PropertyProxy_WriteOnly<Widget*>(this, "child");
954 #endif //GLIBMM_PROPERTIES_ENABLED
957 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
958 void Gtk::Container::on_add(Widget* widget)
960 BaseClassType *const base = static_cast<BaseClassType*>(
961 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
964 if(base && base->add)
965 (*base->add)(gobj(),(GtkWidget*)Glib::unwrap(widget));
967 void Gtk::Container::on_remove(Widget* widget)
969 BaseClassType *const base = static_cast<BaseClassType*>(
970 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
973 if(base && base->remove)
974 (*base->remove)(gobj(),(GtkWidget*)Glib::unwrap(widget));
976 void Gtk::Container::on_check_resize()
978 BaseClassType *const base = static_cast<BaseClassType*>(
979 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
982 if(base && base->check_resize)
983 (*base->check_resize)(gobj());
985 void Gtk::Container::on_set_focus_child(Widget* widget)
987 BaseClassType *const base = static_cast<BaseClassType*>(
988 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
991 if(base && base->set_focus_child)
992 (*base->set_focus_child)(gobj(),(GtkWidget*)Glib::unwrap(widget));
994 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
996 #ifdef GLIBMM_VFUNCS_ENABLED
997 GtkType Gtk::Container::child_type_vfunc() const
999 BaseClassType *const base = static_cast<BaseClassType*>(
1000 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1003 if(base && base->child_type)
1004 return (*base->child_type)(const_cast<GtkContainer*>(gobj()));
1006 typedef GtkType RType;
1009 void Gtk::Container::forall_vfunc(gboolean include_internals, GtkCallback callback, gpointer callback_data)
1011 BaseClassType *const base = static_cast<BaseClassType*>(
1012 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1015 if(base && base->forall)
1016 (*base->forall)(gobj(),include_internals,callback,callback_data);
1018 char* Gtk::Container::composite_name_vfunc(GtkWidget* child)
1020 BaseClassType *const base = static_cast<BaseClassType*>(
1021 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1024 if(base && base->composite_name)
1025 return (*base->composite_name)(gobj(),child);
1027 typedef char* RType;
1030 void Gtk::Container::set_child_property_vfunc(GtkWidget* child, guint property_id, const GValue* value, GParamSpec* pspec)
1032 BaseClassType *const base = static_cast<BaseClassType*>(
1033 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1036 if(base && base->set_child_property)
1037 (*base->set_child_property)(gobj(),child,property_id,value,pspec);
1039 void Gtk::Container::get_child_property_vfunc(GtkWidget* child, guint property_id, GValue* value, GParamSpec* pspec) const
1041 BaseClassType *const base = static_cast<BaseClassType*>(
1042 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
1045 if(base && base->get_child_property)
1046 (*base->get_child_property)(const_cast<GtkContainer*>(gobj()),child,property_id,value,pspec);
1048 #endif //GLIBMM_VFUNCS_ENABLED