Upgrade gtkmm to 2.10.8, glibmm to 2.13.3 and add cairomm 1.2.4
[ardour.git] / libs / gtkmm2 / pango / pangomm / font.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <pangomm/font.h>
5 #include <pangomm/private/font_p.h>
6
7 // -*- c++ -*-
8 /* $Id$ */
9
10 /* 
11  *
12  * Copyright 1998-1999 The Gtk-- Development Team
13  * Copyright 2001      Free Software Foundation
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Library General Public
17  * License as published by the Free Software Foundation; either
18  * version 2 of the License, or (at your option) any later version.
19  *
20  * This library is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  * Library General Public License for more details.
24  *
25  * You should have received a copy of the GNU Library General Public
26  * License along with this library; if not, write to the Free
27  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28  */
29
30 #include <pangomm/fontmap.h>
31
32 namespace Pango
33 {
34
35 FontMetrics Font::get_metrics() const
36 {
37   return FontMetrics(pango_font_get_metrics(const_cast<PangoFont*>(gobj()), 0));
38 }
39
40 Rectangle Font::get_glyph_ink_extents(Glyph glyph) const
41 {
42   Rectangle ink_rect;
43   pango_font_get_glyph_extents(const_cast<PangoFont*>(gobj()), glyph, ink_rect.gobj(), 0);
44   return ink_rect;
45 }
46
47 Rectangle Font::get_glyph_logical_extents(Glyph glyph) const
48 {
49   Rectangle logical_rect;
50   pango_font_get_glyph_extents(const_cast<PangoFont*>(gobj()), glyph, 0, logical_rect.gobj());
51   return logical_rect;
52 }
53
54 } /* namespace Pango */
55
56
57 namespace
58 {
59 } // anonymous namespace
60
61
62 namespace Glib
63 {
64
65 Glib::RefPtr<Pango::Font> wrap(PangoFont* object, bool take_copy)
66 {
67   return Glib::RefPtr<Pango::Font>( dynamic_cast<Pango::Font*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
68   //We use dynamic_cast<> in case of multiple inheritance.
69 }
70
71 } /* namespace Glib */
72
73
74 namespace Pango
75 {
76
77
78 /* The *_Class implementation: */
79
80 const Glib::Class& Font_Class::init()
81 {
82   if(!gtype_) // create the GType if necessary
83   {
84     // Glib::Class has to know the class init function to clone custom types.
85     class_init_func_ = &Font_Class::class_init_function;
86
87     // This is actually just optimized away, apparently with no harm.
88     // Make sure that the parent type has been created.
89     //CppClassParent::CppObjectType::get_type();
90
91     // Create the wrapper type, with the same class/instance size as the base type.
92     register_derived_type(pango_font_get_type());
93
94     // Add derived versions of interfaces, if the C type implements any interfaces:
95   }
96
97   return *this;
98 }
99
100 void Font_Class::class_init_function(void* g_class, void* class_data)
101 {
102   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
103   CppClassParent::class_init_function(klass, class_data);
104
105 #ifdef GLIBMM_VFUNCS_ENABLED
106 #endif //GLIBMM_VFUNCS_ENABLED
107
108 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
109 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
110 }
111
112 #ifdef GLIBMM_VFUNCS_ENABLED
113 #endif //GLIBMM_VFUNCS_ENABLED
114
115 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
116 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
117
118
119 Glib::ObjectBase* Font_Class::wrap_new(GObject* object)
120 {
121   return new Font((PangoFont*)object);
122 }
123
124
125 /* The implementation: */
126
127 PangoFont* Font::gobj_copy()
128 {
129   reference();
130   return gobj();
131 }
132
133 Font::Font(const Glib::ConstructParams& construct_params)
134 :
135   Glib::Object(construct_params)
136 {}
137
138 Font::Font(PangoFont* castitem)
139 :
140   Glib::Object((GObject*)(castitem))
141 {}
142
143 Font::~Font()
144 {}
145
146
147 Font::CppClassType Font::font_class_; // initialize static member
148
149 GType Font::get_type()
150 {
151   return font_class_.init().get_type();
152 }
153
154 GType Font::get_base_type()
155 {
156   return pango_font_get_type();
157 }
158
159
160 FontDescription Font::describe() const
161 {
162   return FontDescription((pango_font_describe(const_cast<PangoFont*>(gobj()))));
163 }
164
165 FontDescription Font::describe_with_absolute_size() const
166 {
167   return FontDescription((pango_font_describe_with_absolute_size(const_cast<PangoFont*>(gobj()))));
168 }
169
170 Glib::RefPtr<Coverage> Font::get_coverage(const Language& language) const
171 {
172   return Glib::wrap(pango_font_get_coverage(const_cast<PangoFont*>(gobj()), const_cast<PangoLanguage*>((language).gobj())));
173 }
174
175 FontMetrics Font::get_metrics(const Language& language) const
176 {
177   return FontMetrics((pango_font_get_metrics(const_cast<PangoFont*>(gobj()), const_cast<PangoLanguage*>((language).gobj()))));
178 }
179
180 void Font::get_glyph_extents(Glyph glyph, Rectangle& ink_rect, Rectangle& logical_rect) const
181 {
182 pango_font_get_glyph_extents(const_cast<PangoFont*>(gobj()), glyph, (ink_rect).gobj(), (logical_rect).gobj()); 
183 }
184
185 Glib::RefPtr<FontMap> Font::get_font_map()
186 {
187   return Glib::wrap(pango_font_get_font_map(gobj()));
188 }
189
190 Glib::RefPtr<const FontMap> Font::get_font_map() const
191 {
192   return const_cast<Font*>(this)->get_font_map();
193 }
194
195
196 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
197 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
198
199 #ifdef GLIBMM_VFUNCS_ENABLED
200 #endif //GLIBMM_VFUNCS_ENABLED
201
202
203 } // namespace Pango
204
205