1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/fontbutton.h>
4 #include <gtkmm/private/fontbutton_p.h>
11 * Copyright 2003 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/gtkfontbutton.h>
40 const Glib::SignalProxyInfo FontButton_signal_font_set_info =
43 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
44 (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
47 } // anonymous namespace
53 Gtk::FontButton* wrap(GtkFontButton* object, bool take_copy)
55 return dynamic_cast<Gtk::FontButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
58 } /* namespace Glib */
64 /* The *_Class implementation: */
66 const Glib::Class& FontButton_Class::init()
68 if(!gtype_) // create the GType if necessary
70 // Glib::Class has to know the class init function to clone custom types.
71 class_init_func_ = &FontButton_Class::class_init_function;
73 // This is actually just optimized away, apparently with no harm.
74 // Make sure that the parent type has been created.
75 //CppClassParent::CppObjectType::get_type();
77 // Create the wrapper type, with the same class/instance size as the base type.
78 register_derived_type(gtk_font_button_get_type());
80 // Add derived versions of interfaces, if the C type implements any interfaces:
86 void FontButton_Class::class_init_function(void* g_class, void* class_data)
88 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
89 CppClassParent::class_init_function(klass, class_data);
91 klass->font_set = &font_set_callback;
95 void FontButton_Class::font_set_callback(GtkFontButton* self)
97 CppObjectType *const obj = dynamic_cast<CppObjectType*>(
98 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
100 // Non-gtkmmproc-generated custom classes implicitly call the default
101 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
102 // generated classes can use this optimisation, which avoids the unnecessary
103 // parameter conversions if there is no possibility of the virtual function
105 if(obj && obj->is_derived_())
107 try // Trap C++ exceptions which would normally be lost because this is a C callback.
109 // Call the virtual member method, which derived classes might override.
114 Glib::exception_handlers_invoke();
119 BaseClassType *const base = static_cast<BaseClassType*>(
120 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
123 // Call the original underlying C function:
124 if(base && base->font_set)
125 (*base->font_set)(self);
130 Glib::ObjectBase* FontButton_Class::wrap_new(GObject* o)
132 return manage(new FontButton((GtkFontButton*)(o)));
137 /* The implementation: */
139 FontButton::FontButton(const Glib::ConstructParams& construct_params)
141 Gtk::Button(construct_params)
145 FontButton::FontButton(GtkFontButton* castitem)
147 Gtk::Button((GtkButton*)(castitem))
151 FontButton::~FontButton()
156 FontButton::CppClassType FontButton::fontbutton_class_; // initialize static member
158 GType FontButton::get_type()
160 return fontbutton_class_.init().get_type();
163 GType FontButton::get_base_type()
165 return gtk_font_button_get_type();
169 FontButton::FontButton()
171 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
172 Gtk::Button(Glib::ConstructParams(fontbutton_class_.init()))
176 FontButton::FontButton(const Glib::ustring& fontname)
178 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
179 Gtk::Button(Glib::ConstructParams(fontbutton_class_.init(), "fontname", fontname.c_str(), (char*) 0))
183 Glib::ustring FontButton::get_title() const
185 return Glib::convert_const_gchar_ptr_to_ustring(gtk_font_button_get_title(const_cast<GtkFontButton*>(gobj())));
188 void FontButton::set_title(const Glib::ustring& title)
190 gtk_font_button_set_title(gobj(), title.c_str());
193 bool FontButton::get_use_font() const
195 return gtk_font_button_get_use_font(const_cast<GtkFontButton*>(gobj()));
198 void FontButton::set_use_font(bool use_font)
200 gtk_font_button_set_use_font(gobj(), static_cast<int>(use_font));
203 bool FontButton::get_use_size() const
205 return gtk_font_button_get_use_size(const_cast<GtkFontButton*>(gobj()));
208 void FontButton::set_use_size(bool use_size)
210 gtk_font_button_set_use_size(gobj(), static_cast<int>(use_size));
213 Glib::ustring FontButton::get_font_name() const
215 return Glib::convert_const_gchar_ptr_to_ustring(gtk_font_button_get_font_name(const_cast<GtkFontButton*>(gobj())));
218 bool FontButton::set_font_name(const Glib::ustring& fontname)
220 return gtk_font_button_set_font_name(gobj(), fontname.c_str());
223 bool FontButton::get_show_style() const
225 return gtk_font_button_get_show_style(const_cast<GtkFontButton*>(gobj()));
228 void FontButton::set_show_style(bool show_style)
230 gtk_font_button_set_show_style(gobj(), static_cast<int>(show_style));
233 bool FontButton::get_show_size() const
235 return gtk_font_button_get_show_size(const_cast<GtkFontButton*>(gobj()));
238 void FontButton::set_show_size(bool show_size)
240 gtk_font_button_set_show_size(gobj(), static_cast<int>(show_size));
244 Glib::SignalProxy0< void > FontButton::signal_font_set()
246 return Glib::SignalProxy0< void >(this, &FontButton_signal_font_set_info);
250 Glib::PropertyProxy<Glib::ustring> FontButton::property_title()
252 return Glib::PropertyProxy<Glib::ustring>(this, "title");
255 Glib::PropertyProxy_ReadOnly<Glib::ustring> FontButton::property_title() const
257 return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "title");
260 Glib::PropertyProxy<Glib::ustring> FontButton::property_font_name()
262 return Glib::PropertyProxy<Glib::ustring>(this, "font-name");
265 Glib::PropertyProxy_ReadOnly<Glib::ustring> FontButton::property_font_name() const
267 return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "font-name");
270 Glib::PropertyProxy<bool> FontButton::property_use_font()
272 return Glib::PropertyProxy<bool>(this, "use-font");
275 Glib::PropertyProxy_ReadOnly<bool> FontButton::property_use_font() const
277 return Glib::PropertyProxy_ReadOnly<bool>(this, "use-font");
280 Glib::PropertyProxy<bool> FontButton::property_use_size()
282 return Glib::PropertyProxy<bool>(this, "use-size");
285 Glib::PropertyProxy_ReadOnly<bool> FontButton::property_use_size() const
287 return Glib::PropertyProxy_ReadOnly<bool>(this, "use-size");
290 Glib::PropertyProxy<bool> FontButton::property_show_style()
292 return Glib::PropertyProxy<bool>(this, "show-style");
295 Glib::PropertyProxy_ReadOnly<bool> FontButton::property_show_style() const
297 return Glib::PropertyProxy_ReadOnly<bool>(this, "show-style");
300 Glib::PropertyProxy<bool> FontButton::property_show_size()
302 return Glib::PropertyProxy<bool>(this, "show-size");
305 Glib::PropertyProxy_ReadOnly<bool> FontButton::property_show_size() const
307 return Glib::PropertyProxy_ReadOnly<bool>(this, "show-size");
311 void Gtk::FontButton::on_font_set()
313 BaseClassType *const base = static_cast<BaseClassType*>(
314 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
317 if(base && base->font_set)
318 (*base->font_set)(gobj());