// Generated by gtkmmproc -- DO NOT MODIFY! #include #include // -*- 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 namespace Gtk { ToolButton::ToolButton(const Glib::ustring& label) : Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations. Gtk::ToolItem(Glib::ConstructParams(toolbutton_class_.init(), "label", label.c_str(), (char*) 0)) { } } // namespace Gtk namespace { static const Glib::SignalProxyInfo ToolButton_signal_clicked_info = { "clicked", (GCallback) &Glib::SignalProxyNormal::slot0_void_callback, (GCallback) &Glib::SignalProxyNormal::slot0_void_callback }; } // anonymous namespace namespace Glib { Gtk::ToolButton* wrap(GtkToolButton* object, bool take_copy) { return dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)); } } /* namespace Glib */ namespace Gtk { /* The *_Class implementation: */ const Glib::Class& ToolButton_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_ = &ToolButton_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_tool_button_get_type()); // Add derived versions of interfaces, if the C type implements any interfaces: } return *this; } void ToolButton_Class::class_init_function(void* g_class, void* class_data) { BaseClassType *const klass = static_cast(g_class); CppClassParent::class_init_function(klass, class_data); #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED klass->clicked = &clicked_callback; #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED } #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED void ToolButton_Class::clicked_callback(GtkToolButton* self) { CppObjectType *const obj = dynamic_cast( 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_clicked(); #ifdef GLIBMM_EXCEPTIONS_ENABLED } catch(...) { Glib::exception_handlers_invoke(); } #endif //GLIBMM_EXCEPTIONS_ENABLED } else { BaseClassType *const base = static_cast( 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->clicked) (*base->clicked)(self); } } #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED Glib::ObjectBase* ToolButton_Class::wrap_new(GObject* o) { return manage(new ToolButton((GtkToolButton*)(o))); } /* The implementation: */ ToolButton::ToolButton(const Glib::ConstructParams& construct_params) : Gtk::ToolItem(construct_params) { } ToolButton::ToolButton(GtkToolButton* castitem) : Gtk::ToolItem((GtkToolItem*)(castitem)) { } ToolButton::~ToolButton() { destroy_(); } ToolButton::CppClassType ToolButton::toolbutton_class_; // initialize static member GType ToolButton::get_type() { return toolbutton_class_.init().get_type(); } GType ToolButton::get_base_type() { return gtk_tool_button_get_type(); } ToolButton::ToolButton() : Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations. Gtk::ToolItem(Glib::ConstructParams(toolbutton_class_.init())) { } ToolButton::ToolButton(const Gtk::StockID& stock_id) : Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations. Gtk::ToolItem(Glib::ConstructParams(toolbutton_class_.init(), "stock_id", (stock_id).get_c_str(), (char*) 0)) { } ToolButton::ToolButton(Widget& icon_widget, const Glib::ustring& label) : Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations. Gtk::ToolItem(Glib::ConstructParams(toolbutton_class_.init(), "icon_widget", (icon_widget).gobj(), "label", label.c_str(), (char*) 0)) { } void ToolButton::set_label(const Glib::ustring& label) { gtk_tool_button_set_label(gobj(), label.c_str()); } Glib::ustring ToolButton::get_label() const { return Glib::convert_const_gchar_ptr_to_ustring(gtk_tool_button_get_label(const_cast(gobj()))); } void ToolButton::set_use_underline(bool use_underline) { gtk_tool_button_set_use_underline(gobj(), static_cast(use_underline)); } bool ToolButton::get_use_underline() const { return gtk_tool_button_get_use_underline(const_cast(gobj())); } void ToolButton::set_stock_id(const Gtk::StockID& stock_id) { gtk_tool_button_set_stock_id(gobj(), (stock_id).get_c_str()); } Glib::ustring ToolButton::get_stock_id() const { return Glib::convert_const_gchar_ptr_to_ustring(gtk_tool_button_get_stock_id(const_cast(gobj()))); } void ToolButton::set_icon_name(const Glib::ustring& icon_name) { gtk_tool_button_set_icon_name(gobj(), icon_name.c_str()); } Glib::ustring ToolButton::get_icon_name() const { return Glib::convert_const_gchar_ptr_to_ustring(gtk_tool_button_get_icon_name(const_cast(gobj()))); } void ToolButton::set_icon_widget(Widget& icon_widget) { gtk_tool_button_set_icon_widget(gobj(), (icon_widget).gobj()); } Widget* ToolButton::get_icon_widget() { return Glib::wrap(gtk_tool_button_get_icon_widget(gobj())); } const Widget* ToolButton::get_icon_widget() const { return const_cast(this)->get_icon_widget(); } void ToolButton::set_label_widget(Widget& label_widget) { gtk_tool_button_set_label_widget(gobj(), (label_widget).gobj()); } Widget* ToolButton::get_label_widget() { return Glib::wrap(gtk_tool_button_get_label_widget(gobj())); } const Widget* ToolButton::get_label_widget() const { return const_cast(this)->get_label_widget(); } Glib::SignalProxy0< void > ToolButton::signal_clicked() { return Glib::SignalProxy0< void >(this, &ToolButton_signal_clicked_info); } #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy ToolButton::property_label() { return Glib::PropertyProxy(this, "label"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly ToolButton::property_label() const { return Glib::PropertyProxy_ReadOnly(this, "label"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy ToolButton::property_use_underline() { return Glib::PropertyProxy(this, "use-underline"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly ToolButton::property_use_underline() const { return Glib::PropertyProxy_ReadOnly(this, "use-underline"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy ToolButton::property_label_widget() { return Glib::PropertyProxy(this, "label-widget"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly ToolButton::property_label_widget() const { return Glib::PropertyProxy_ReadOnly(this, "label-widget"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy ToolButton::property_stock_id() { return Glib::PropertyProxy(this, "stock-id"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly ToolButton::property_stock_id() const { return Glib::PropertyProxy_ReadOnly(this, "stock-id"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy ToolButton::property_icon_widget() { return Glib::PropertyProxy(this, "icon-widget"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_PROPERTIES_ENABLED Glib::PropertyProxy_ReadOnly ToolButton::property_icon_widget() const { return Glib::PropertyProxy_ReadOnly(this, "icon-widget"); } #endif //GLIBMM_PROPERTIES_ENABLED #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED void Gtk::ToolButton::on_clicked() { BaseClassType *const base = static_cast( 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->clicked) (*base->clicked)(gobj()); } #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED #ifdef GLIBMM_VFUNCS_ENABLED #endif //GLIBMM_VFUNCS_ENABLED } // namespace Gtk