Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / fontbutton.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/fontbutton.h>
4 #include <gtkmm/private/fontbutton_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /*
10  *
11  * Copyright 2003 The gtkmm Development Team
12  *
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.
17  *
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.
22  *
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.
26  */
27
28 #include <gtk/gtkfontbutton.h>
29
30 namespace Gtk
31 {
32
33
34 } // namespace Gtk
35
36
37 namespace
38 {
39
40 const Glib::SignalProxyInfo FontButton_signal_font_set_info =
41 {
42   "font-set",
43   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
44   (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
45 };
46
47 } // anonymous namespace
48
49
50 namespace Glib
51 {
52
53 Gtk::FontButton* wrap(GtkFontButton* object, bool take_copy)
54 {
55   return dynamic_cast<Gtk::FontButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
56 }
57
58 } /* namespace Glib */
59
60 namespace Gtk
61 {
62
63
64 /* The *_Class implementation: */
65
66 const Glib::Class& FontButton_Class::init()
67 {
68   if(!gtype_) // create the GType if necessary
69   {
70     // Glib::Class has to know the class init function to clone custom types.
71     class_init_func_ = &FontButton_Class::class_init_function;
72
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();
76
77     // Create the wrapper type, with the same class/instance size as the base type.
78     register_derived_type(gtk_font_button_get_type());
79
80     // Add derived versions of interfaces, if the C type implements any interfaces:
81   }
82
83   return *this;
84 }
85
86 void FontButton_Class::class_init_function(void* g_class, void* class_data)
87 {
88   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
89   CppClassParent::class_init_function(klass, class_data);
90
91   klass->font_set = &font_set_callback;
92 }
93
94
95 void FontButton_Class::font_set_callback(GtkFontButton* self)
96 {
97   CppObjectType *const obj = dynamic_cast<CppObjectType*>(
98       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
99
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
104   // being overridden:
105   if(obj && obj->is_derived_())
106   {
107     try // Trap C++ exceptions which would normally be lost because this is a C callback.
108     {
109       // Call the virtual member method, which derived classes might override.
110       obj->on_font_set();
111     }
112     catch(...)
113     {
114       Glib::exception_handlers_invoke();
115     }
116   }
117   else
118   {
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).
121     );
122
123     // Call the original underlying C function:
124     if(base && base->font_set)
125       (*base->font_set)(self);
126   }
127 }
128
129
130 Glib::ObjectBase* FontButton_Class::wrap_new(GObject* o)
131 {
132   return manage(new FontButton((GtkFontButton*)(o)));
133
134 }
135
136
137 /* The implementation: */
138
139 FontButton::FontButton(const Glib::ConstructParams& construct_params)
140 :
141   Gtk::Button(construct_params)
142 {
143   }
144
145 FontButton::FontButton(GtkFontButton* castitem)
146 :
147   Gtk::Button((GtkButton*)(castitem))
148 {
149   }
150
151 FontButton::~FontButton()
152 {
153   destroy_();
154 }
155
156 FontButton::CppClassType FontButton::fontbutton_class_; // initialize static member
157
158 GType FontButton::get_type()
159 {
160   return fontbutton_class_.init().get_type();
161 }
162
163 GType FontButton::get_base_type()
164 {
165   return gtk_font_button_get_type();
166 }
167
168
169 FontButton::FontButton()
170 :
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()))
173 {
174   }
175
176 FontButton::FontButton(const Glib::ustring& fontname)
177 :
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))
180 {
181   }
182
183 Glib::ustring FontButton::get_title() const
184 {
185   return Glib::convert_const_gchar_ptr_to_ustring(gtk_font_button_get_title(const_cast<GtkFontButton*>(gobj())));
186 }
187
188 void FontButton::set_title(const Glib::ustring& title)
189 {
190   gtk_font_button_set_title(gobj(), title.c_str());
191 }
192
193 bool FontButton::get_use_font() const
194 {
195   return gtk_font_button_get_use_font(const_cast<GtkFontButton*>(gobj()));
196 }
197
198 void FontButton::set_use_font(bool use_font)
199 {
200   gtk_font_button_set_use_font(gobj(), static_cast<int>(use_font));
201 }
202
203 bool FontButton::get_use_size() const
204 {
205   return gtk_font_button_get_use_size(const_cast<GtkFontButton*>(gobj()));
206 }
207
208 void FontButton::set_use_size(bool use_size)
209 {
210   gtk_font_button_set_use_size(gobj(), static_cast<int>(use_size));
211 }
212
213 Glib::ustring FontButton::get_font_name() const
214 {
215   return Glib::convert_const_gchar_ptr_to_ustring(gtk_font_button_get_font_name(const_cast<GtkFontButton*>(gobj())));
216 }
217
218 bool FontButton::set_font_name(const Glib::ustring& fontname)
219 {
220   return gtk_font_button_set_font_name(gobj(), fontname.c_str());
221 }
222
223 bool FontButton::get_show_style() const
224 {
225   return gtk_font_button_get_show_style(const_cast<GtkFontButton*>(gobj()));
226 }
227
228 void FontButton::set_show_style(bool show_style)
229 {
230   gtk_font_button_set_show_style(gobj(), static_cast<int>(show_style));
231 }
232
233 bool FontButton::get_show_size() const
234 {
235   return gtk_font_button_get_show_size(const_cast<GtkFontButton*>(gobj()));
236 }
237
238 void FontButton::set_show_size(bool show_size)
239 {
240   gtk_font_button_set_show_size(gobj(), static_cast<int>(show_size));
241 }
242
243
244 Glib::SignalProxy0< void > FontButton::signal_font_set()
245 {
246   return Glib::SignalProxy0< void >(this, &FontButton_signal_font_set_info);
247 }
248
249
250 Glib::PropertyProxy<Glib::ustring> FontButton::property_title() 
251 {
252   return Glib::PropertyProxy<Glib::ustring>(this, "title");
253 }
254
255 Glib::PropertyProxy_ReadOnly<Glib::ustring> FontButton::property_title() const
256 {
257   return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "title");
258 }
259
260 Glib::PropertyProxy<Glib::ustring> FontButton::property_font_name() 
261 {
262   return Glib::PropertyProxy<Glib::ustring>(this, "font-name");
263 }
264
265 Glib::PropertyProxy_ReadOnly<Glib::ustring> FontButton::property_font_name() const
266 {
267   return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "font-name");
268 }
269
270 Glib::PropertyProxy<bool> FontButton::property_use_font() 
271 {
272   return Glib::PropertyProxy<bool>(this, "use-font");
273 }
274
275 Glib::PropertyProxy_ReadOnly<bool> FontButton::property_use_font() const
276 {
277   return Glib::PropertyProxy_ReadOnly<bool>(this, "use-font");
278 }
279
280 Glib::PropertyProxy<bool> FontButton::property_use_size() 
281 {
282   return Glib::PropertyProxy<bool>(this, "use-size");
283 }
284
285 Glib::PropertyProxy_ReadOnly<bool> FontButton::property_use_size() const
286 {
287   return Glib::PropertyProxy_ReadOnly<bool>(this, "use-size");
288 }
289
290 Glib::PropertyProxy<bool> FontButton::property_show_style() 
291 {
292   return Glib::PropertyProxy<bool>(this, "show-style");
293 }
294
295 Glib::PropertyProxy_ReadOnly<bool> FontButton::property_show_style() const
296 {
297   return Glib::PropertyProxy_ReadOnly<bool>(this, "show-style");
298 }
299
300 Glib::PropertyProxy<bool> FontButton::property_show_size() 
301 {
302   return Glib::PropertyProxy<bool>(this, "show-size");
303 }
304
305 Glib::PropertyProxy_ReadOnly<bool> FontButton::property_show_size() const
306 {
307   return Glib::PropertyProxy_ReadOnly<bool>(this, "show-size");
308 }
309
310
311 void Gtk::FontButton::on_font_set()
312 {
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).
315   );
316
317   if(base && base->font_set)
318     (*base->font_set)(gobj());
319 }
320
321
322 } // namespace Gtk
323
324