1 // Generated by gmmproc 2.49.5 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <pangomm/attributes.h>
7 #include <pangomm/private/attributes_p.h>
8
9 #include <pango/pango-enum-types.h>
10
11 /*
12 *
13 * Copyright 2002 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 Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 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 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser 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 namespace Pango
31 {
32
Attribute()33 Attribute::Attribute()
34 :
35 gobject_(0)
36 {}
37
Attribute(const Attribute & src)38 Attribute::Attribute(const Attribute& src)
39 :
40 gobject_(src.gobject_ ? pango_attribute_copy(src.gobject_) : 0)
41 {}
42
Attribute(PangoAttribute * castitem,bool take_copy)43 Attribute::Attribute(PangoAttribute* castitem, bool take_copy)
44 {
45 if(take_copy)
46 {
47 if(castitem)
48 gobject_ = pango_attribute_copy(castitem);
49 else
50 gobject_ = 0;
51 }
52 else
53 {
54 // It was given to us by a function which has already made a copy for us to keep.
55 gobject_ = castitem;
56 }
57 }
58
~Attribute()59 Attribute::~Attribute()
60 {
61 if(gobject_)
62 pango_attribute_destroy(gobject_);
63 gobject_ = 0;
64 }
65
operator =(const Attribute & src)66 Attribute& Attribute::operator=(const Attribute& src)
67 {
68 PangoAttribute *const new_gobject = (src.gobject_ ? pango_attribute_copy(src.gobject_) : 0);
69
70 if(gobject_)
71 pango_attribute_destroy(gobject_);
72 gobject_ = new_gobject;
73
74 return *this;
75 }
76
get_type() const77 AttrType Attribute::get_type() const
78 {
79 return (AttrType) ((gobject_) ? gobj()->klass->type : PANGO_ATTR_INVALID);
80 }
81
register_type(const Glib::ustring & name)82 AttrType Attribute::register_type(const Glib::ustring& name)
83 {
84 return (AttrType)pango_attr_type_register(name.c_str());
85 }
86
create_attr_family(const Glib::ustring & family)87 AttrString Attribute::create_attr_family(const Glib::ustring& family)
88 {
89 return Glib::wrap((PangoAttrString*)pango_attr_family_new(family.c_str()));
90 }
91
create_attr_language(const Language & language)92 AttrLanguage Attribute::create_attr_language(const Language& language)
93 {
94 return Glib::wrap((PangoAttrLanguage*)pango_attr_language_new(const_cast<PangoLanguage*>(language.gobj())));
95 }
96
create_attr_foreground(guint16 red,guint16 green,guint16 blue)97 AttrColor Attribute::create_attr_foreground(guint16 red, guint16 green, guint16 blue)
98 {
99 return Glib::wrap((PangoAttrColor*)pango_attr_foreground_new(red, green, blue));
100 }
101
create_attr_background(guint16 red,guint16 green,guint16 blue)102 AttrColor Attribute::create_attr_background(guint16 red, guint16 green, guint16 blue)
103 {
104 return Glib::wrap((PangoAttrColor*)pango_attr_background_new(red, green, blue));
105 }
106
create_attr_foreground_alpha(guint16 alpha)107 AttrInt Attribute::create_attr_foreground_alpha(guint16 alpha)
108 {
109 return Glib::wrap((PangoAttrInt*)pango_attr_foreground_alpha_new(alpha));
110 }
111
create_attr_background_alpha(guint16 alpha)112 AttrInt Attribute::create_attr_background_alpha(guint16 alpha)
113 {
114 return Glib::wrap((PangoAttrInt*)pango_attr_background_alpha_new(alpha));
115 }
116
create_attr_size(int size)117 AttrInt Attribute::create_attr_size(int size)
118 {
119 return Glib::wrap((PangoAttrInt*)pango_attr_size_new(size));
120 }
121
create_attr_style(Style style)122 AttrInt Attribute::create_attr_style(Style style)
123 {
124 return Glib::wrap((PangoAttrInt*)pango_attr_style_new((PangoStyle)style));
125 }
126
create_attr_weight(Weight weight)127 AttrInt Attribute::create_attr_weight(Weight weight)
128 {
129 return Glib::wrap((PangoAttrInt*)pango_attr_weight_new((PangoWeight)weight));
130 }
131
create_attr_variant(Variant variant)132 AttrInt Attribute::create_attr_variant(Variant variant)
133 {
134 return Glib::wrap((PangoAttrInt*)pango_attr_variant_new((PangoVariant)variant));
135 }
136
create_attr_stretch(Stretch stretch)137 AttrInt Attribute::create_attr_stretch(Stretch stretch)
138 {
139 return Glib::wrap((PangoAttrInt*)pango_attr_stretch_new((PangoStretch)stretch));
140 }
141
create_attr_font_desc(const FontDescription & desc)142 AttrFontDesc Attribute::create_attr_font_desc(const FontDescription& desc)
143 {
144 return Glib::wrap((PangoAttrFontDesc*)pango_attr_font_desc_new(desc.gobj()));
145 }
146
create_attr_underline(Underline underline)147 AttrInt Attribute::create_attr_underline(Underline underline)
148 {
149 return Glib::wrap((PangoAttrInt*)pango_attr_underline_new((PangoUnderline)underline));
150 }
151
create_attr_strikethrough(bool strikethrough)152 AttrInt Attribute::create_attr_strikethrough(bool strikethrough)
153 {
154 return Glib::wrap((PangoAttrInt*)pango_attr_strikethrough_new(strikethrough));
155 }
156
create_attr_rise(int rise)157 AttrInt Attribute::create_attr_rise(int rise)
158 {
159 return Glib::wrap((PangoAttrInt*)pango_attr_rise_new(rise));
160 }
161
create_attr_scale(double scale_factor)162 AttrFloat Attribute::create_attr_scale(double scale_factor)
163 {
164 return Glib::wrap((PangoAttrFloat*)pango_attr_scale_new(scale_factor));
165 }
166
create_attr_shape(const Rectangle & ink_rect,const Rectangle & logical_rect)167 AttrShape Attribute::create_attr_shape(const Rectangle& ink_rect, const Rectangle& logical_rect)
168 {
169 return Glib::wrap((PangoAttrShape*)pango_attr_shape_new(ink_rect.gobj(), logical_rect.gobj()));
170 }
171
172
AttrString()173 AttrString::AttrString()
174 {}
175
AttrString(const AttrString & src)176 AttrString::AttrString(const AttrString& src)
177 :
178 Attribute(src)
179 {}
180
AttrString(PangoAttrString * castitem,bool take_copy)181 AttrString::AttrString(PangoAttrString* castitem, bool take_copy)
182 :
183 Attribute((PangoAttribute*)castitem, take_copy)
184 {}
185
operator =(const AttrString & src)186 AttrString& AttrString::operator=(const AttrString& src)
187 {
188 Attribute::operator=(src);
189 return *this;
190 }
191
set_string(const Glib::ustring & str)192 void AttrString::set_string(const Glib::ustring& str)
193 {
194 g_free(gobj()->value);
195 gobj()->value = g_strdup(str.c_str());
196 }
197
198
AttrLanguage()199 AttrLanguage::AttrLanguage()
200 {}
201
AttrLanguage(const AttrLanguage & src)202 AttrLanguage::AttrLanguage(const AttrLanguage& src)
203 :
204 Attribute(src)
205 {}
206
AttrLanguage(PangoAttrLanguage * castitem,bool take_copy)207 AttrLanguage::AttrLanguage(PangoAttrLanguage* castitem, bool take_copy)
208 :
209 Attribute((PangoAttribute*)castitem, take_copy)
210 {}
211
operator =(const AttrLanguage & src)212 AttrLanguage& AttrLanguage::operator=(const AttrLanguage& src)
213 {
214 Attribute::operator=(src);
215 return *this;
216 }
217
218
AttrColor()219 AttrColor::AttrColor()
220 {}
221
AttrColor(const AttrColor & src)222 AttrColor::AttrColor(const AttrColor& src)
223 :
224 Attribute(src)
225 {}
226
AttrColor(PangoAttrColor * castitem,bool take_copy)227 AttrColor::AttrColor(PangoAttrColor* castitem, bool take_copy)
228 :
229 Attribute((PangoAttribute*)castitem, take_copy)
230 {}
231
operator =(const AttrColor & src)232 AttrColor& AttrColor::operator=(const AttrColor& src)
233 {
234 Attribute::operator=(src);
235 return *this;
236 }
237
238
AttrInt()239 AttrInt::AttrInt()
240 {}
241
AttrInt(const AttrInt & src)242 AttrInt::AttrInt(const AttrInt& src)
243 :
244 Attribute(src)
245 {}
246
AttrInt(PangoAttrInt * castitem,bool take_copy)247 AttrInt::AttrInt(PangoAttrInt* castitem, bool take_copy)
248 :
249 Attribute((PangoAttribute*)castitem, take_copy)
250 {}
251
operator =(const AttrInt & src)252 AttrInt& AttrInt::operator=(const AttrInt& src)
253 {
254 Attribute::operator=(src);
255 return *this;
256 }
257
258
AttrFloat()259 AttrFloat::AttrFloat()
260 {}
261
AttrFloat(const AttrFloat & src)262 AttrFloat::AttrFloat(const AttrFloat& src)
263 :
264 Attribute(src)
265 {}
266
AttrFloat(PangoAttrFloat * castitem,bool take_copy)267 AttrFloat::AttrFloat(PangoAttrFloat* castitem, bool take_copy)
268 :
269 Attribute((PangoAttribute*)castitem, take_copy)
270 {}
271
operator =(const AttrFloat & src)272 AttrFloat& AttrFloat::operator=(const AttrFloat& src)
273 {
274 Attribute::operator=(src);
275 return *this;
276 }
277
278
AttrFontDesc()279 AttrFontDesc::AttrFontDesc()
280 {}
281
AttrFontDesc(const AttrFontDesc & src)282 AttrFontDesc::AttrFontDesc(const AttrFontDesc& src)
283 :
284 Attribute(src)
285 {}
286
AttrFontDesc(PangoAttrFontDesc * castitem,bool take_copy)287 AttrFontDesc::AttrFontDesc(PangoAttrFontDesc* castitem, bool take_copy)
288 :
289 Attribute((PangoAttribute*)castitem, take_copy)
290 {}
291
operator =(const AttrFontDesc & src)292 AttrFontDesc& AttrFontDesc::operator=(const AttrFontDesc& src)
293 {
294 Attribute::operator=(src);
295 return *this;
296 }
297
set_desc(const FontDescription & desc)298 void AttrFontDesc::set_desc(const FontDescription& desc)
299 {
300 pango_font_description_free(gobj()->desc);
301 gobj()->desc = pango_font_description_copy(desc.gobj());
302 }
303
304
AttrShape()305 AttrShape::AttrShape()
306 {}
307
AttrShape(const AttrShape & src)308 AttrShape::AttrShape(const AttrShape& src)
309 :
310 Attribute(src)
311 {}
312
AttrShape(PangoAttrShape * castitem,bool take_copy)313 AttrShape::AttrShape(PangoAttrShape* castitem, bool take_copy)
314 :
315 Attribute((PangoAttribute*)castitem, take_copy)
316 {}
317
operator =(const AttrShape & src)318 AttrShape& AttrShape::operator=(const AttrShape& src)
319 {
320 Attribute::operator=(src);
321 return *this;
322 }
323
324 } //namespace Pango
325
326
327 namespace Glib
328 {
329
wrap(PangoAttribute * object,bool take_copy)330 Pango::Attribute wrap(PangoAttribute* object, bool take_copy)
331 {
332 return Pango::Attribute(object, take_copy);
333 }
334
wrap(PangoAttrString * object,bool take_copy)335 Pango::AttrString wrap(PangoAttrString* object, bool take_copy)
336 {
337 return Pango::AttrString(object, take_copy);
338 }
339
wrap(PangoAttrLanguage * object,bool take_copy)340 Pango::AttrLanguage wrap(PangoAttrLanguage* object, bool take_copy)
341 {
342 return Pango::AttrLanguage(object, take_copy);
343 }
344
wrap(PangoAttrColor * object,bool take_copy)345 Pango::AttrColor wrap(PangoAttrColor* object, bool take_copy)
346 {
347 return Pango::AttrColor(object, take_copy);
348 }
349
wrap(PangoAttrInt * object,bool take_copy)350 Pango::AttrInt wrap(PangoAttrInt* object, bool take_copy)
351 {
352 return Pango::AttrInt(object, take_copy);
353 }
354
wrap(PangoAttrFloat * object,bool take_copy)355 Pango::AttrFloat wrap(PangoAttrFloat* object, bool take_copy)
356 {
357 return Pango::AttrFloat(object, take_copy);
358 }
359
wrap(PangoAttrFontDesc * object,bool take_copy)360 Pango::AttrFontDesc wrap(PangoAttrFontDesc* object, bool take_copy)
361 {
362 return Pango::AttrFontDesc(object, take_copy);
363 }
364
wrap(PangoAttrShape * object,bool take_copy)365 Pango::AttrShape wrap(PangoAttrShape* object, bool take_copy)
366 {
367 return Pango::AttrShape(object, take_copy);
368 }
369
370 } //namespace Glib
371
372
373 namespace
374 {
375 } // anonymous namespace
376
377 // static
value_type()378 GType Glib::Value<Pango::AttrType>::value_type()
379 {
380 return pango_attr_type_get_type();
381 }
382
383 // static
value_type()384 GType Glib::Value<Pango::Underline>::value_type()
385 {
386 return pango_underline_get_type();
387 }
388
389
390 namespace Pango
391 {
392
393
get_start_index() const394 unsigned int Attribute::get_start_index() const
395 {
396 return gobj()->start_index;
397 }
398
get_end_index() const399 unsigned int Attribute::get_end_index() const
400 {
401 return gobj()->end_index;
402 }
403
set_start_index(const unsigned int & value)404 void Attribute::set_start_index(const unsigned int& value)
405 {
406 gobj()->start_index = value;
407 }
408
set_end_index(const unsigned int & value)409 void Attribute::set_end_index(const unsigned int& value)
410 {
411 gobj()->end_index = value;
412 }
413
equal(const Attribute & attr2) const414 bool Attribute::equal(const Attribute& attr2) const
415 {
416 return pango_attribute_equal(const_cast<PangoAttribute*>(gobj()), (attr2).gobj());
417 }
418
419
420 } // namespace Pango
421
422
423 namespace Pango
424 {
425
426
get_string() const427 Glib::ustring AttrString::get_string() const
428 {
429 return Glib::convert_const_gchar_ptr_to_ustring(gobj()->value);
430 }
431
432
433 } // namespace Pango
434
435
436 namespace Pango
437 {
438
439
get_language() const440 Language AttrLanguage::get_language() const
441 {
442 return Language(gobj()->value);
443 }
444
set_language(const Language & value)445 void AttrLanguage::set_language(const Language& value)
446 {
447 gobj()->value = const_cast<PangoLanguage*>((value).gobj());
448 }
449
450
451 } // namespace Pango
452
453
454 namespace Pango
455 {
456
457
get_color() const458 Color AttrColor::get_color() const
459 {
460 return Color(&(gobj()->color));
461 }
462
set_color(const Color & value)463 void AttrColor::set_color(const Color& value)
464 {
465 gobj()->color = *(value).gobj();
466 }
467
468
469 } // namespace Pango
470
471
472 namespace Pango
473 {
474
475
get_value() const476 int AttrInt::get_value() const
477 {
478 return gobj()->value;
479 }
480
set_value(const int & value)481 void AttrInt::set_value(const int& value)
482 {
483 gobj()->value = value;
484 }
485
486
487 } // namespace Pango
488
489
490 namespace Pango
491 {
492
493
get_value() const494 double AttrFloat::get_value() const
495 {
496 return gobj()->value;
497 }
498
set_value(const double & value)499 void AttrFloat::set_value(const double& value)
500 {
501 gobj()->value = value;
502 }
503
504
505 } // namespace Pango
506
507
508 namespace Pango
509 {
510
511
get_desc() const512 FontDescription AttrFontDesc::get_desc() const
513 {
514 return FontDescription((gobj()->desc));
515 }
516
517
518 } // namespace Pango
519
520
521 namespace Pango
522 {
523
524
get_ink_rect() const525 Rectangle AttrShape::get_ink_rect() const
526 {
527 return Rectangle(&(gobj()->ink_rect));
528 }
529
get_logical_rect() const530 Rectangle AttrShape::get_logical_rect() const
531 {
532 return Rectangle(&(gobj()->logical_rect));
533 }
534
set_ink_rect(const Rectangle & value)535 void AttrShape::set_ink_rect(const Rectangle& value)
536 {
537 gobj()->ink_rect = *(value).gobj();
538 }
539
set_logical_rect(const Rectangle & value)540 void AttrShape::set_logical_rect(const Rectangle& value)
541 {
542 gobj()->logical_rect = *(value).gobj();
543 }
544
545
546 } // namespace Pango
547
548
549