1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/radiotoolbutton.h>
4 #include <gtkmm/private/radiotoolbutton_p.h>
11 * Copyright 1998-2002 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <gtk/gtkradiotoolbutton.h>
30 typedef Gtk::RadioToolButton::Group Group; //So that the generate get_group return type is parsed.
35 RadioToolButton::RadioToolButton(Group& group, const Glib::ustring& label)
37 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
38 Gtk::ToggleToolButton(Glib::ConstructParams(radiotoolbutton_class_.init(), "label", label.c_str(), (char*) 0))
43 RadioToolButton::RadioToolButton(Group& group, const Gtk::StockID& stock_id)
45 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
46 Gtk::ToggleToolButton(Glib::ConstructParams(radiotoolbutton_class_.init(), "stock_id", (stock_id).get_c_str(), (char*) 0))
48 //Based on the source of gtk_radio_tool_button_new_from_stock():
52 /* This would look too much like a copy constructor:
53 RadioToolButton::RadioToolButton(RadioToolButton& group, const Gtk::StockID& stock_id)
55 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
56 Gtk::ToggleToolButton(Glib::ConstructParams(radiotoolbutton_class_.init(), "stock_id", (stock_id).get_c_str(), (char*) 0))
58 //Based on the source of gtk_radio_tool_button_new_with_stock_from_widget():
59 Gtk::RadioButtonGroup radiogroup = group.get_group();
60 set_group(radiogroup);
64 RadioToolButton::RadioToolButton(Widget& icon_widget, const Glib::ustring& label)
66 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
67 Gtk::ToggleToolButton(Glib::ConstructParams(radiotoolbutton_class_.init(), "icon_widget", (icon_widget).gobj(), "label", label.c_str(), (char*) 0))
77 } // anonymous namespace
83 Gtk::RadioToolButton* wrap(GtkRadioToolButton* object, bool take_copy)
85 return dynamic_cast<Gtk::RadioToolButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
88 } /* namespace Glib */
94 /* The *_Class implementation: */
96 const Glib::Class& RadioToolButton_Class::init()
98 if(!gtype_) // create the GType if necessary
100 // Glib::Class has to know the class init function to clone custom types.
101 class_init_func_ = &RadioToolButton_Class::class_init_function;
103 // This is actually just optimized away, apparently with no harm.
104 // Make sure that the parent type has been created.
105 //CppClassParent::CppObjectType::get_type();
107 // Create the wrapper type, with the same class/instance size as the base type.
108 register_derived_type(gtk_radio_tool_button_get_type());
110 // Add derived versions of interfaces, if the C type implements any interfaces:
116 void RadioToolButton_Class::class_init_function(void* g_class, void* class_data)
118 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
119 CppClassParent::class_init_function(klass, class_data);
124 Glib::ObjectBase* RadioToolButton_Class::wrap_new(GObject* o)
126 return manage(new RadioToolButton((GtkRadioToolButton*)(o)));
131 /* The implementation: */
133 RadioToolButton::RadioToolButton(const Glib::ConstructParams& construct_params)
135 Gtk::ToggleToolButton(construct_params)
139 RadioToolButton::RadioToolButton(GtkRadioToolButton* castitem)
141 Gtk::ToggleToolButton((GtkToggleToolButton*)(castitem))
145 RadioToolButton::~RadioToolButton()
150 RadioToolButton::CppClassType RadioToolButton::radiotoolbutton_class_; // initialize static member
152 GType RadioToolButton::get_type()
154 return radiotoolbutton_class_.init().get_type();
157 GType RadioToolButton::get_base_type()
159 return gtk_radio_tool_button_get_type();
163 RadioToolButton::RadioToolButton()
165 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
166 Gtk::ToggleToolButton(Glib::ConstructParams(radiotoolbutton_class_.init()))
170 Group RadioToolButton::get_group()
172 return Group(gtk_radio_tool_button_get_group(gobj()));
175 void RadioToolButton::set_group(Group& group)
177 gtk_radio_tool_button_set_group(gobj(), group.group_);