MIDI branch becomes trunk
[ardour.git] / libs / gtkmm2 / pango / pangomm / fontfamily.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <pangomm/fontfamily.h>
4 #include <pangomm/private/fontfamily_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /* 
10  *
11  * Copyright 2001      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 namespace Pango
29 {
30
31 Glib::ArrayHandle< Glib::RefPtr<FontFace> > FontFamily::list_faces() const
32 {
33   //Get the array:
34   PangoFontFace** pFontFaces = 0;
35   int n_fonts = 0;
36   pango_font_family_list_faces(const_cast<PangoFontFamily*>(gobj()), &pFontFaces, &n_fonts);
37
38   return Glib::ArrayHandle<Glib::RefPtr <FontFace> > (pFontFaces, n_fonts, Glib::OWNERSHIP_SHALLOW);
39 }
40
41 } /* namespace Pango */
42
43
44 namespace
45 {
46 } // anonymous namespace
47
48
49 namespace Glib
50 {
51
52 Glib::RefPtr<Pango::FontFamily> wrap(PangoFontFamily* object, bool take_copy)
53 {
54   return Glib::RefPtr<Pango::FontFamily>( dynamic_cast<Pango::FontFamily*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
55   //We use dynamic_cast<> in case of multiple inheritance.
56 }
57
58 } /* namespace Glib */
59
60
61 namespace Pango
62 {
63
64
65 /* The *_Class implementation: */
66
67 const Glib::Class& FontFamily_Class::init()
68 {
69   if(!gtype_) // create the GType if necessary
70   {
71     // Glib::Class has to know the class init function to clone custom types.
72     class_init_func_ = &FontFamily_Class::class_init_function;
73
74     // This is actually just optimized away, apparently with no harm.
75     // Make sure that the parent type has been created.
76     //CppClassParent::CppObjectType::get_type();
77
78     // Create the wrapper type, with the same class/instance size as the base type.
79     register_derived_type(pango_font_family_get_type());
80
81     // Add derived versions of interfaces, if the C type implements any interfaces:
82   }
83
84   return *this;
85 }
86
87 void FontFamily_Class::class_init_function(void* g_class, void* class_data)
88 {
89   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
90   CppClassParent::class_init_function(klass, class_data);
91
92 }
93
94
95 Glib::ObjectBase* FontFamily_Class::wrap_new(GObject* object)
96 {
97   return new FontFamily((PangoFontFamily*)object);
98 }
99
100
101 /* The implementation: */
102
103 PangoFontFamily* FontFamily::gobj_copy()
104 {
105   reference();
106   return gobj();
107 }
108
109 FontFamily::FontFamily(const Glib::ConstructParams& construct_params)
110 :
111   Glib::Object(construct_params)
112 {}
113
114 FontFamily::FontFamily(PangoFontFamily* castitem)
115 :
116   Glib::Object((GObject*)(castitem))
117 {}
118
119 FontFamily::~FontFamily()
120 {}
121
122
123 FontFamily::CppClassType FontFamily::fontfamily_class_; // initialize static member
124
125 GType FontFamily::get_type()
126 {
127   return fontfamily_class_.init().get_type();
128 }
129
130 GType FontFamily::get_base_type()
131 {
132   return pango_font_family_get_type();
133 }
134
135
136 Glib::ustring FontFamily::get_name() const
137 {
138   return Glib::convert_const_gchar_ptr_to_ustring(pango_font_family_get_name(const_cast<PangoFontFamily*>(gobj())));
139 }
140
141 bool FontFamily::is_monospace() const
142 {
143   return pango_font_family_is_monospace(const_cast<PangoFontFamily*>(gobj()));
144 }
145
146
147 } // namespace Pango
148
149