2005-05-13 16:47:18 -04:00
|
|
|
// Generated by gtkmmproc -- DO NOT MODIFY!
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
#include <gtkmm/container.h>
|
|
|
|
#include <gtkmm/private/container_p.h>
|
|
|
|
|
|
|
|
// -*- c++ -*-
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/* Copyright 1998-2002 The gtkmm Development Team
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free
|
|
|
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gtkmm/adjustment.h>
|
|
|
|
#include <gtk/gtkcontainer.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static void container_foreach_callback(GtkWidget* widget_gobj, void* data)
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
try
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Gtk::Container::ForeachSlot& slot = *static_cast<Gtk::Container::ForeachSlot*>(data);
|
|
|
|
Gtk::Widget *const widget = Glib::wrap(widget_gobj);
|
|
|
|
|
|
|
|
g_return_if_fail(widget != 0);
|
|
|
|
|
|
|
|
slot(*widget);
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Copy of generated callback:
|
|
|
|
static void Container_signal_remove_callback_normal(GtkContainer* self, GtkWidget* p0,void* data)
|
|
|
|
{
|
|
|
|
using namespace Gtk;
|
|
|
|
typedef sigc::slot< void,Widget* > SlotType;
|
|
|
|
|
|
|
|
// Do not try to call a signal on a disassociated wrapper.
|
|
|
|
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
|
|
|
|
{
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
|
|
|
|
(*static_cast<SlotType*>(slot))(Glib::wrap(p0)
|
|
|
|
);
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void Container_signal_remove_callback(GtkContainer* self, GtkWidget* p0, void* data)
|
|
|
|
{
|
|
|
|
//GTKMM_LIFECYCLE
|
|
|
|
|
|
|
|
#ifdef GLIBMM_DEBUG_REFCOUNTING
|
|
|
|
g_warning("Container_signal_remove_callback()");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//Don't call wrap() on a GTK+ instance whose gtkmm instance has been deleted - just call the original C callback.
|
|
|
|
const bool gtkmm_child_already_deleted = Glib::_gobject_cppinstance_already_deleted((GObject*)p0);
|
|
|
|
|
|
|
|
if(!gtkmm_child_already_deleted)
|
|
|
|
{
|
|
|
|
//Call the regular, generated callback:
|
|
|
|
Container_signal_remove_callback_normal(self, p0, data);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//Do nothing.
|
|
|
|
}
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
} // anonymous namespace
|
|
|
|
|
|
|
|
|
|
|
|
namespace Gtk
|
|
|
|
{
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
|
|
|
//Copy of generated callback:
|
|
|
|
void Container_Class::remove_callback_normal(GtkContainer* self, GtkWidget* p0)
|
|
|
|
{
|
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType*>(
|
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
|
|
|
if(obj && obj->is_derived_())
|
|
|
|
{
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->on_remove(Glib::wrap(p0)
|
|
|
|
);
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->remove)
|
|
|
|
(*base->remove)(self, p0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Custom hand-coded callback:
|
|
|
|
void Container_Class::remove_callback(GtkContainer* self, GtkWidget* p0)
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
//GTKMM_LIFECYCLE
|
|
|
|
|
|
|
|
#ifdef GLIBMM_DEBUG_REFCOUNTING
|
|
|
|
g_warning("Container_Class::remove_callback_custom() C self=%p: C child=%p\n", (void*)self, (void*)p0);
|
|
|
|
g_warning("gtypename self: %s\n, gtypename child: %s", G_OBJECT_TYPE_NAME(G_OBJECT(self)), G_OBJECT_TYPE_NAME(G_OBJECT(p0)));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//Don't call wrap() on a GTK+ instance whose gtkmm instance has been deleted - just call the original C callback.
|
2007-11-12 18:44:49 -05:00
|
|
|
const bool gtkmm_child_already_deleted = Glib::_gobject_cppinstance_already_deleted((GObject*)p0);
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
if(!gtkmm_child_already_deleted)
|
|
|
|
{
|
|
|
|
//Call the regular, generated callback:
|
2007-11-12 18:44:49 -05:00
|
|
|
Container_Class::remove_callback_normal(self, p0);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
//Call the original underlying C function:
|
|
|
|
if(base && base->remove)
|
|
|
|
(*base->remove)(self, p0);
|
|
|
|
}
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
void Container::foreach(const Container::ForeachSlot& slot)
|
|
|
|
{
|
|
|
|
ForeachSlot slot_copy (slot);
|
|
|
|
gtk_container_foreach(gobj(), &container_foreach_callback, &slot_copy);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Container::add(Widget& widget)
|
|
|
|
{
|
|
|
|
gtk_container_add(gobj(), widget.gobj());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Container::has_focus_chain() const
|
|
|
|
{
|
|
|
|
return gtk_container_get_focus_chain(const_cast<GtkContainer*>(gobj()), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
Glib::ListHandle<Widget*> Container::get_focus_chain()
|
|
|
|
{
|
|
|
|
GList* list = 0;
|
|
|
|
gtk_container_get_focus_chain(gobj(), &list);
|
|
|
|
|
|
|
|
return Glib::ListHandle<Widget*>(list, Glib::OWNERSHIP_SHALLOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
Glib::ListHandle<const Widget*> Container::get_focus_chain() const
|
|
|
|
{
|
|
|
|
GList* list = 0;
|
|
|
|
gtk_container_get_focus_chain(const_cast<GtkContainer*>(gobj()), &list);
|
|
|
|
|
|
|
|
return Glib::ListHandle<const Widget*>(list, Glib::OWNERSHIP_SHALLOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Container::show_all_children(bool recursive)
|
|
|
|
{
|
|
|
|
// Plain C version if this turns out to be performance-critical:
|
|
|
|
//GtkCallback callback = (GtkCallback) ((recursive) ? >k_widget_show_all : >k_widget_show);
|
|
|
|
//gtk_container_foreach(gobj(), callback, 0);
|
|
|
|
|
|
|
|
// This could also be done with get_children() and an explicit loop,
|
|
|
|
// if any problems should arise. In gtkmm-1.2, foreach() is known to
|
|
|
|
// cause segfaults eventually, but it seems to work now.
|
|
|
|
|
|
|
|
foreach(sigc::mem_fun((recursive) ? &Widget::show_all : &Widget::show));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Container::remove(Widget& widget)
|
|
|
|
{
|
|
|
|
//If this is a managed widget,
|
|
|
|
//then do an extra ref so that it will
|
|
|
|
//not be destroyed when adding to another container
|
|
|
|
//This should leave it in much the same state as when it was instantiated,
|
|
|
|
//before being added to the first container.
|
|
|
|
if(widget.is_managed_())
|
|
|
|
widget.reference();
|
|
|
|
|
|
|
|
gtk_container_remove(gobj(), widget.gobj());
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
// static
|
|
|
|
void Container_Class::destroy_callback(GtkObject* self)
|
|
|
|
{
|
|
|
|
#ifdef GLIBMM_DEBUG_REFCOUNTING
|
|
|
|
g_warning("Container_Class::destroy_callback() gobject_=%10X\n", self);
|
|
|
|
if(self)
|
|
|
|
g_warning("gtypename: %s\n", G_OBJECT_TYPE_NAME(G_OBJECT(self)));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//Call the normal C destroy implementation, such as gtk_button_destroy:
|
|
|
|
//This will chain to gtk_container_destroy(), which will gtk_widget_destroy() any remaining child widgets.
|
|
|
|
GtkObjectClass *const base = static_cast<GtkObjectClass*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)));
|
|
|
|
|
|
|
|
if(base->destroy)
|
|
|
|
(*base->destroy)(self);
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
} // namespace Gtk
|
|
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
|
|
|
static void Container_signal_add_callback(GtkContainer* self, GtkWidget* p0,void* data)
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
using namespace Gtk;
|
|
|
|
typedef sigc::slot< void,Widget* > SlotType;
|
|
|
|
|
|
|
|
// Do not try to call a signal on a disassociated wrapper.
|
|
|
|
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
try
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
|
|
|
|
(*static_cast<SlotType*>(slot))(Glib::wrap(p0)
|
|
|
|
);
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static const Glib::SignalProxyInfo Container_signal_add_info =
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
"add",
|
|
|
|
(GCallback) &Container_signal_add_callback,
|
|
|
|
(GCallback) &Container_signal_add_callback
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static const Glib::SignalProxyInfo Container_signal_remove_info =
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
"remove",
|
|
|
|
(GCallback) &Container_signal_remove_callback,
|
|
|
|
(GCallback) &Container_signal_remove_callback
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static const Glib::SignalProxyInfo Container_signal_check_resize_info =
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
"check_resize",
|
|
|
|
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
|
|
|
|
(GCallback) &Glib::SignalProxyNormal::slot0_void_callback
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static void Container_signal_set_focus_child_callback(GtkContainer* self, GtkWidget* p0,void* data)
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
using namespace Gtk;
|
|
|
|
typedef sigc::slot< void,Widget* > SlotType;
|
|
|
|
|
|
|
|
// Do not try to call a signal on a disassociated wrapper.
|
|
|
|
if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
try
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
|
|
|
|
(*static_cast<SlotType*>(slot))(Glib::wrap(p0)
|
|
|
|
);
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
static const Glib::SignalProxyInfo Container_signal_set_focus_child_info =
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
|
|
|
"set_focus_child",
|
|
|
|
(GCallback) &Container_signal_set_focus_child_callback,
|
|
|
|
(GCallback) &Container_signal_set_focus_child_callback
|
|
|
|
};
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
} // anonymous namespace
|
|
|
|
|
|
|
|
|
|
|
|
namespace Glib
|
|
|
|
{
|
|
|
|
|
|
|
|
Gtk::Container* wrap(GtkContainer* object, bool take_copy)
|
|
|
|
{
|
|
|
|
return dynamic_cast<Gtk::Container *> (Glib::wrap_auto ((GObject*)(object), take_copy));
|
|
|
|
}
|
|
|
|
|
|
|
|
} /* namespace Glib */
|
|
|
|
|
|
|
|
namespace Gtk
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/* The *_Class implementation: */
|
|
|
|
|
|
|
|
const Glib::Class& Container_Class::init()
|
|
|
|
{
|
|
|
|
if(!gtype_) // create the GType if necessary
|
|
|
|
{
|
|
|
|
// Glib::Class has to know the class init function to clone custom types.
|
|
|
|
class_init_func_ = &Container_Class::class_init_function;
|
|
|
|
|
|
|
|
// This is actually just optimized away, apparently with no harm.
|
|
|
|
// Make sure that the parent type has been created.
|
|
|
|
//CppClassParent::CppObjectType::get_type();
|
|
|
|
|
|
|
|
// Create the wrapper type, with the same class/instance size as the base type.
|
|
|
|
register_derived_type(gtk_container_get_type());
|
|
|
|
|
|
|
|
// Add derived versions of interfaces, if the C type implements any interfaces:
|
|
|
|
}
|
|
|
|
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Container_Class::class_init_function(void* g_class, void* class_data)
|
|
|
|
{
|
|
|
|
BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
|
|
|
|
CppClassParent::class_init_function(klass, class_data);
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
klass->child_type = &child_type_vfunc_callback;
|
|
|
|
klass->forall = &forall_vfunc_callback;
|
|
|
|
klass->composite_name = &composite_name_vfunc_callback;
|
|
|
|
klass->set_child_property = &set_child_property_vfunc_callback;
|
|
|
|
klass->get_child_property = &get_child_property_vfunc_callback;
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
|
|
|
|
|
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
klass->add = &add_callback;
|
|
|
|
klass->remove = &remove_callback;
|
|
|
|
klass->check_resize = &check_resize_callback;
|
|
|
|
klass->set_focus_child = &set_focus_child_callback;
|
|
|
|
reinterpret_cast<GtkObjectClass*>(klass)->destroy = &destroy_callback;
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
|
|
|
}
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
GtkType Container_Class::child_type_vfunc_callback(GtkContainer* self)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
return obj->child_type_vfunc();
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->child_type)
|
|
|
|
return (*base->child_type)(self);
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
typedef GtkType RType;
|
|
|
|
return RType();
|
|
|
|
}
|
|
|
|
void Container_Class::forall_vfunc_callback(GtkContainer* self, gboolean include_internals, GtkCallback callback, gpointer callback_data)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->forall_vfunc(include_internals, callback, callback_data);
|
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->forall)
|
|
|
|
(*base->forall)(self, include_internals, callback, callback_data);
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
gchar* Container_Class::composite_name_vfunc_callback(GtkContainer* self, GtkWidget* child)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
return obj->composite_name_vfunc(child);
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->composite_name)
|
|
|
|
return (*base->composite_name)(self, child);
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
typedef gchar* RType;
|
|
|
|
return RType();
|
|
|
|
}
|
|
|
|
void Container_Class::set_child_property_vfunc_callback(GtkContainer* self, GtkWidget* child, guint property_id, const GValue* value, GParamSpec* pspec)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->set_child_property_vfunc(child, property_id, value, pspec);
|
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->set_child_property)
|
|
|
|
(*base->set_child_property)(self, child, property_id, value, pspec);
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
void Container_Class::get_child_property_vfunc_callback(GtkContainer* self, GtkWidget* child, guint property_id, GValue* value, GParamSpec* pspec)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->get_child_property_vfunc(child, property_id, value, pspec);
|
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->get_child_property)
|
|
|
|
(*base->get_child_property)(self, child, property_id, value, pspec);
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
void Container_Class::add_callback(GtkContainer* self, GtkWidget* p0)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->on_add(Glib::wrap(p0)
|
2005-05-13 16:47:18 -04:00
|
|
|
);
|
2007-12-18 01:05:55 -05:00
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
2007-12-18 01:05:55 -05:00
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->add)
|
|
|
|
(*base->add)(self, p0);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
void Container_Class::check_resize_callback(GtkContainer* self)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->on_check_resize();
|
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
2007-12-18 01:05:55 -05:00
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->check_resize)
|
|
|
|
(*base->check_resize)(self);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
void Container_Class::set_focus_child_callback(GtkContainer* self, GtkWidget* p0)
|
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
|
|
|
|
|
|
|
|
// Non-gtkmmproc-generated custom classes implicitly call the default
|
|
|
|
// Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
|
|
|
|
// generated classes can use this optimisation, which avoids the unnecessary
|
|
|
|
// parameter conversions if there is no possibility of the virtual function
|
|
|
|
// being overridden:
|
2007-12-18 01:05:55 -05:00
|
|
|
if(obj_base && obj_base->is_derived_())
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
|
|
|
|
if(obj) // This can be NULL during destruction.
|
2005-05-13 16:47:18 -04:00
|
|
|
{
|
2007-12-18 01:05:55 -05:00
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
try // Trap C++ exceptions which would normally be lost because this is a C callback.
|
|
|
|
{
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
// Call the virtual member method, which derived classes might override.
|
|
|
|
obj->on_set_focus_child(Glib::wrap(p0)
|
2005-05-13 16:47:18 -04:00
|
|
|
);
|
2007-12-18 01:05:55 -05:00
|
|
|
return;
|
|
|
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
|
|
|
}
|
|
|
|
catch(...)
|
|
|
|
{
|
|
|
|
Glib::exception_handlers_invoke();
|
|
|
|
}
|
|
|
|
#endif //GLIBMM_EXCEPTIONS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
}
|
2007-12-18 01:05:55 -05:00
|
|
|
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
2005-05-13 16:47:18 -04:00
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
2007-12-18 01:05:55 -05:00
|
|
|
// Call the original underlying C function:
|
|
|
|
if(base && base->set_focus_child)
|
|
|
|
(*base->set_focus_child)(self, p0);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
Glib::ObjectBase* Container_Class::wrap_new(GObject* o)
|
|
|
|
{
|
|
|
|
return manage(new Container((GtkContainer*)(o)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* The implementation: */
|
|
|
|
|
|
|
|
Container::Container(const Glib::ConstructParams& construct_params)
|
|
|
|
:
|
|
|
|
Gtk::Widget(construct_params)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Container::Container(GtkContainer* castitem)
|
|
|
|
:
|
|
|
|
Gtk::Widget((GtkWidget*)(castitem))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Container::~Container()
|
|
|
|
{
|
|
|
|
destroy_();
|
|
|
|
}
|
|
|
|
|
|
|
|
Container::CppClassType Container::container_class_; // initialize static member
|
|
|
|
|
|
|
|
GType Container::get_type()
|
|
|
|
{
|
|
|
|
return container_class_.init().get_type();
|
|
|
|
}
|
|
|
|
|
|
|
|
GType Container::get_base_type()
|
|
|
|
{
|
|
|
|
return gtk_container_get_type();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Container::set_border_width(guint border_width)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_set_border_width(gobj(), border_width);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
guint Container::get_border_width() const
|
|
|
|
{
|
|
|
|
return gtk_container_get_border_width(const_cast<GtkContainer*>(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Container::set_resize_mode(ResizeMode resize_mode)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_set_resize_mode(gobj(), ((GtkResizeMode)(resize_mode)));
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
ResizeMode Container::get_resize_mode() const
|
|
|
|
{
|
|
|
|
return ((ResizeMode)(gtk_container_get_resize_mode(const_cast<GtkContainer*>(gobj()))));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Container::check_resize()
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_check_resize(gobj());
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Glib::ListHandle<Widget*> Container::get_children()
|
|
|
|
{
|
|
|
|
return Glib::ListHandle<Widget*>(gtk_container_get_children(gobj()), Glib::OWNERSHIP_SHALLOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
Glib::ListHandle<const Widget*> Container::get_children() const
|
|
|
|
{
|
|
|
|
return Glib::ListHandle<const Widget*>(gtk_container_get_children(const_cast<GtkContainer*>(gobj())), Glib::OWNERSHIP_SHALLOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Container::propagate_expose(Widget& child, GdkEventExpose* event)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_propagate_expose(gobj(), (child).gobj(), event);
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Container::set_focus_chain(const Glib::ListHandle<Widget*>& focusable_widgets)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_set_focus_chain(gobj(), focusable_widgets.data());
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Container::unset_focus_chain()
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_unset_focus_chain(gobj());
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Container::set_reallocate_redraws(bool needs_redraws)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_set_reallocate_redraws(gobj(), static_cast<int>(needs_redraws));
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Container::set_focus_child(Widget& widget)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_set_focus_child(gobj(), (widget).gobj());
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Container::set_focus_vadjustment(Adjustment& adjustment)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_set_focus_vadjustment(gobj(), (adjustment).gobj());
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Adjustment* Container::get_focus_vadjustment()
|
|
|
|
{
|
|
|
|
return Glib::wrap(gtk_container_get_focus_vadjustment(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
const Adjustment* Container::get_focus_vadjustment() const
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
return const_cast<Container*>(this)->get_focus_vadjustment();
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Container::set_focus_hadjustment(Adjustment& adjustment)
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_set_focus_hadjustment(gobj(), (adjustment).gobj());
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Adjustment* Container::get_focus_hadjustment()
|
|
|
|
{
|
|
|
|
return Glib::wrap(gtk_container_get_focus_hadjustment(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
const Adjustment* Container::get_focus_hadjustment() const
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
return const_cast<Container*>(this)->get_focus_hadjustment();
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void Container::resize_children()
|
|
|
|
{
|
2007-11-12 18:44:49 -05:00
|
|
|
gtk_container_resize_children(gobj());
|
2005-05-13 16:47:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
GType Container::child_type() const
|
|
|
|
{
|
|
|
|
return gtk_container_child_type(const_cast<GtkContainer*>(gobj()));
|
|
|
|
}
|
|
|
|
|
|
|
|
Container::Container()
|
|
|
|
:
|
2007-12-18 01:05:55 -05:00
|
|
|
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
|
|
|
|
Glib::ObjectBase(0),
|
2005-05-13 16:47:18 -04:00
|
|
|
Gtk::Widget(Glib::ConstructParams(container_class_.init()))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Glib::SignalProxy1< void,Widget* > Container::signal_add()
|
|
|
|
{
|
|
|
|
return Glib::SignalProxy1< void,Widget* >(this, &Container_signal_add_info);
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::SignalProxy1< void,Widget* > Container::signal_remove()
|
|
|
|
{
|
|
|
|
return Glib::SignalProxy1< void,Widget* >(this, &Container_signal_remove_info);
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::SignalProxy0< void > Container::signal_check_resize()
|
|
|
|
{
|
|
|
|
return Glib::SignalProxy0< void >(this, &Container_signal_check_resize_info);
|
|
|
|
}
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::SignalProxy1< void,Widget* > Container::signal_set_focus_child()
|
|
|
|
{
|
|
|
|
return Glib::SignalProxy1< void,Widget* >(this, &Container_signal_set_focus_child_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<guint> Container::property_border_width()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<guint>(this, "border-width");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<guint> Container::property_border_width() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<guint>(this, "border-width");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy<ResizeMode> Container::property_resize_mode()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy<ResizeMode>(this, "resize-mode");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_ReadOnly<ResizeMode> Container::property_resize_mode() const
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_ReadOnly<ResizeMode>(this, "resize-mode");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
Glib::PropertyProxy_WriteOnly<Widget*> Container::property_child()
|
|
|
|
{
|
|
|
|
return Glib::PropertyProxy_WriteOnly<Widget*>(this, "child");
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_PROPERTIES_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
void Gtk::Container::on_add(Widget* widget)
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->add)
|
|
|
|
(*base->add)(gobj(),(GtkWidget*)Glib::unwrap(widget));
|
|
|
|
}
|
|
|
|
void Gtk::Container::on_remove(Widget* widget)
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->remove)
|
|
|
|
(*base->remove)(gobj(),(GtkWidget*)Glib::unwrap(widget));
|
|
|
|
}
|
|
|
|
void Gtk::Container::on_check_resize()
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->check_resize)
|
|
|
|
(*base->check_resize)(gobj());
|
|
|
|
}
|
|
|
|
void Gtk::Container::on_set_focus_child(Widget* widget)
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->set_focus_child)
|
|
|
|
(*base->set_focus_child)(gobj(),(GtkWidget*)Glib::unwrap(widget));
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
2007-11-12 18:44:49 -05:00
|
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
GtkType Gtk::Container::child_type_vfunc() const
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->child_type)
|
|
|
|
return (*base->child_type)(const_cast<GtkContainer*>(gobj()));
|
|
|
|
|
|
|
|
typedef GtkType RType;
|
|
|
|
return RType();
|
|
|
|
}
|
|
|
|
void Gtk::Container::forall_vfunc(gboolean include_internals, GtkCallback callback, gpointer callback_data)
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->forall)
|
|
|
|
(*base->forall)(gobj(),include_internals,callback,callback_data);
|
|
|
|
}
|
|
|
|
char* Gtk::Container::composite_name_vfunc(GtkWidget* child)
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->composite_name)
|
|
|
|
return (*base->composite_name)(gobj(),child);
|
|
|
|
|
|
|
|
typedef char* RType;
|
|
|
|
return RType();
|
|
|
|
}
|
|
|
|
void Gtk::Container::set_child_property_vfunc(GtkWidget* child, guint property_id, const GValue* value, GParamSpec* pspec)
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->set_child_property)
|
|
|
|
(*base->set_child_property)(gobj(),child,property_id,value,pspec);
|
|
|
|
}
|
|
|
|
void Gtk::Container::get_child_property_vfunc(GtkWidget* child, guint property_id, GValue* value, GParamSpec* pspec) const
|
|
|
|
{
|
|
|
|
BaseClassType *const base = static_cast<BaseClassType*>(
|
|
|
|
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
|
|
|
|
);
|
|
|
|
|
|
|
|
if(base && base->get_child_property)
|
|
|
|
(*base->get_child_property)(const_cast<GtkContainer*>(gobj()),child,property_id,value,pspec);
|
|
|
|
}
|
2007-11-12 18:44:49 -05:00
|
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
2005-05-13 16:47:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace Gtk
|
|
|
|
|
|
|
|
|