pango 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/ext/pango/extconf.rb +3 -0
  2. data/ext/pango/rbpango.c +312 -12
  3. data/ext/pango/rbpango.h +33 -22
  4. data/ext/pango/rbpangoanalysis.c +98 -58
  5. data/ext/pango/rbpangoattribute.c +94 -85
  6. data/ext/pango/rbpangoattriterator.c +39 -28
  7. data/ext/pango/rbpangoattrlist.c +42 -32
  8. data/ext/pango/rbpangocairo.c +38 -172
  9. data/ext/pango/rbpangocairocontext.c +151 -0
  10. data/ext/pango/rbpangocolor.c +49 -38
  11. data/ext/pango/rbpangocontext.c +109 -102
  12. data/ext/pango/rbpangoconversions.h +111 -0
  13. data/ext/pango/rbpangocoverage.c +45 -37
  14. data/ext/pango/rbpangoengine.c +22 -12
  15. data/ext/pango/rbpangofont.c +52 -43
  16. data/ext/pango/rbpangofontdescription.c +102 -91
  17. data/ext/pango/rbpangofontface.c +32 -21
  18. data/ext/pango/rbpangofontfamily.c +31 -20
  19. data/ext/pango/rbpangofontmap.c +44 -36
  20. data/ext/pango/rbpangofontmetrics.c +41 -30
  21. data/ext/pango/rbpangofontset.c +32 -21
  22. data/ext/pango/rbpangofontsetsimple.c +34 -24
  23. data/ext/pango/rbpangoglyphinfo.c +48 -35
  24. data/ext/pango/rbpangoglyphitem.c +43 -33
  25. data/ext/pango/rbpangoglyphstring.c +59 -59
  26. data/ext/pango/rbpangogravity.c +34 -23
  27. data/ext/pango/rbpangoitem.c +43 -34
  28. data/ext/pango/rbpangolanguage.c +44 -34
  29. data/ext/pango/rbpangolayout.c +167 -160
  30. data/ext/pango/rbpangolayoutiter.c +70 -59
  31. data/ext/pango/rbpangolayoutline.c +106 -71
  32. data/ext/pango/rbpangologattr.c +42 -31
  33. data/ext/pango/rbpangomatrix.c +47 -35
  34. data/ext/pango/rbpangoprivate.h +53 -0
  35. data/ext/pango/rbpangorectangle.c +58 -49
  36. data/ext/pango/rbpangorenderer.c +81 -70
  37. data/ext/pango/rbpangoscript.c +37 -27
  38. data/ext/pango/rbpangoscriptiter.c +32 -22
  39. data/ext/pango/rbpangotabarray.c +48 -37
  40. metadata +12 -12
  41. data/ChangeLog +0 -721
  42. data/ext/pango/rbpangoinits.c +0 -72
  43. data/ext/pango/rbpangomain.c +0 -202
@@ -0,0 +1,111 @@
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
+ * MA 02110-1301 USA
19
+ */
20
+
21
+ #ifndef __PANGOCONVERSIONS_H__
22
+ #define __PANGOCONVERSIONS_H__
23
+
24
+ #define RVAL2PANGOCAIROFONTMAP(o) (PANGO_CAIRO_FONT_MAP(RVAL2GOBJ(o)))
25
+ #define RVAL2PANGOCONTEXT(o) (PANGO_CONTEXT(RVAL2GOBJ(o)))
26
+ #define RVAL2PANGOENGINE(o) (PANGO_ENGINE(RVAL2GOBJ(o)))
27
+ #define RVAL2PANGOENGINELANG(o) (PANGO_ENGINE_LANG(RVAL2GOBJ(o)))
28
+ #define RVAL2PANGOENGINESHAPE(o) (PANGO_ENGINE_SHAPE(RVAL2GOBJ(o)))
29
+ #define RVAL2PANGOFONT(o) (PANGO_FONT(RVAL2GOBJ(o)))
30
+ #define RVAL2PANGOFONTSET(o) (PANGO_FONTSET(RVAL2GOBJ(o)))
31
+ #define RVAL2PANGOFONTSETSIMPLE(o) (PANGO_FONTSET_SIMPLE(RVAL2GOBJ(o)))
32
+ #define RVAL2PANGOFONTFACE(o) (PANGO_FONT_FACE(RVAL2GOBJ(o)))
33
+ #define RVAL2PANGOFONTFAMILY(o) (PANGO_FONT_FAMILY(RVAL2GOBJ(o)))
34
+ #define RVAL2PANGOFONTMAP(o) (PANGO_FONT_MAP(RVAL2GOBJ(o)))
35
+ #define RVAL2PANGOLAYOUT(o) (PANGO_LAYOUT(RVAL2GOBJ(o)))
36
+ #define RVAL2PANGORENDERER(o) (PANGO_RENDERER(RVAL2GOBJ(o)))
37
+
38
+ #define RVAL2PANGOANALYSIS(o) ((PangoAnalysis*)RVAL2BOXED(o, PANGO_TYPE_ANALYSIS))
39
+ #define PANGOANALYSIS2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ANALYSIS))
40
+ #define RVAL2PANGOATTRITERATOR(o) ((PangoAttrIterator*)RVAL2BOXED(o, PANGO_TYPE_ATTR_ITERATOR))
41
+ #define PANGOATTRITERATOR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ATTR_ITERATOR))
42
+ #define RVAL2PANGOATTRLIST(o) ((PangoAttrList*)RVAL2BOXED(o, PANGO_TYPE_ATTR_LIST))
43
+ #define PANGOATTRLIST2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ATTR_LIST))
44
+ #define RVAL2PANGOCOLOR(o) ((PangoColor*)RVAL2BOXED(o, PANGO_TYPE_COLOR))
45
+ #define PANGOCOLOR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_COLOR))
46
+ #define RVAL2PANGOCOVERAGE(o) ((PangoCoverage*)RVAL2BOXED(o, PANGO_TYPE_COVERAGE))
47
+ #define PANGOCOVERAGE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_COVERAGE))
48
+ #define RVAL2PANGOFONTDESCRIPTION(o) ((PangoFontDescription*)RVAL2BOXED(o, PANGO_TYPE_FONT_DESCRIPTION))
49
+ #define PANGOFONTDESCRIPTION2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_FONT_DESCRIPTION))
50
+ #define RVAL2PANGOFONTMETRICS(o) ((PangoFontMetrics*)RVAL2BOXED(o, PANGO_TYPE_FONT_METRICS))
51
+ #define PANGOFONTMETRICS2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_FONT_METRICS))
52
+ #define RVAL2PANGOGLYPHINFO(o) ((PangoGlyphInfo*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_INFO))
53
+ #define PANGOGLYPHINFO2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_INFO))
54
+ #define RVAL2PANGOGLYPHITEM(o) ((PangoGlyphItem*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_ITEM))
55
+ #define PANGOGLYPHITEM2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_ITEM))
56
+ #define RVAL2PANGOGLYPHSTRING(o) ((PangoGlyphString*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_STRING))
57
+ #define PANGOGLYPHSTRING2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_STRING))
58
+ #define RVAL2PANGOITEM(o) ((PangoItem*)RVAL2BOXED(o, PANGO_TYPE_ITEM))
59
+ #define PANGOITEM2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ITEM))
60
+ #define RVAL2PANGOLANGUAGE(o) ((PangoLanguage*)RVAL2BOXED(o, PANGO_TYPE_LANGUAGE))
61
+ #define PANGOLANGUAGE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LANGUAGE))
62
+ #define RVAL2PANGOLAYOUTITER(o) ((PangoLayoutIter*)RVAL2BOXED(o, PANGO_TYPE_LAYOUT_ITER))
63
+ #define PANGOLAYOUTITER2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LAYOUT_ITER))
64
+ #define RVAL2PANGOLAYOUTLINE(o) ((PangoLayoutLine*)RVAL2BOXED(o, PANGO_TYPE_LAYOUT_LINE))
65
+ #define PANGOLAYOUTLINE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LAYOUT_LINE))
66
+ #define RVAL2PANGOLOGATTR(o) ((PangoLogAttr*)RVAL2BOXED(o, PANGO_TYPE_LOG_ATTR))
67
+ #define PANGOLOGATTR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LOG_ATTR))
68
+ #define RVAL2PANGOMATRIX(o) ((PangoMatrix*)RVAL2BOXED(o, PANGO_TYPE_MATRIX))
69
+ #define PANGOMATRIX2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_MATRIX))
70
+ #define RVAL2PANGORECTANGLE(o) ((PangoRectangle*)RVAL2BOXED(o, PANGO_TYPE_RECTANGLE))
71
+ #define PANGORECTANGLE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_RECTANGLE))
72
+ #define RVAL2PANGOSCRIPTITER(o) ((PangoScriptIter*)RVAL2BOXED(o, PANGO_TYPE_SCRIPT_ITER))
73
+ #define PANGOSCRIPTITER2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_SCRIPT_ITER))
74
+ #define RVAL2PANGOTABARRAY(o) ((PangoTabArray*)RVAL2BOXED(o, PANGO_TYPE_TAB_ARRAY))
75
+ #define PANGOTABARRAY2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_TAB_ARRAY))
76
+
77
+ #define RVAL2PANGOALIGNMENT(o) (RVAL2GENUM(o, PANGO_TYPE_ALIGNMENT))
78
+ #define PANGOALIGNMENT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_ALIGNMENT))
79
+ #define RVAL2PANGOCOVERAGELEVEL(o) (RVAL2GENUM(o, PANGO_TYPE_COVERAGE_LEVEL))
80
+ #define PANGOCOVERAGELEVEL2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_COVERAGE_LEVEL))
81
+ #define RVAL2PANGODIRECTION(o) (RVAL2GENUM(o, PANGO_TYPE_DIRECTION))
82
+ #define PANGODIRECTION2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_DIRECTION))
83
+ #define RVAL2PANGOELLIPSIZEMODE(o) (RVAL2GENUM(o, PANGO_TYPE_ELLIPSIZE_MODE))
84
+ #define PANGOELLIPSIZEMODE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_ELLIPSIZE_MODE))
85
+ #define RVAL2PANGOGRAVITY(o) (RVAL2GENUM(o, PANGO_TYPE_GRAVITY))
86
+ #define PANGOGRAVITY2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_GRAVITY))
87
+ #define RVAL2PANGOGRAVITYHINT(o) (RVAL2GENUM(o, PANGO_TYPE_GRAVITY_HINT))
88
+ #define PANGOGRAVITYHINT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_GRAVITY_HINT))
89
+ #define RVAL2PANGORENDERPART(o) (RVAL2GENUM(o, PANGO_TYPE_RENDER_PART))
90
+ #define PANGORENDERPART2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_RENDER_PART))
91
+ #define RVAL2PANGOSCRIPT(o) (RVAL2GENUM(o, PANGO_TYPE_SCRIPT))
92
+ #define PANGOSCRIPT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_SCRIPT))
93
+ #define RVAL2PANGOSTRETCH(o) (RVAL2GENUM(o, PANGO_TYPE_STRETCH))
94
+ #define PANGOSTRETCH2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_STRETCH))
95
+ #define RVAL2PANGOSTYLE(o) (RVAL2GENUM(o, PANGO_TYPE_STYLE))
96
+ #define PANGOSTYLE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_STYLE))
97
+ #define RVAL2PANGOTABALIGN(o) (RVAL2GENUM(o, PANGO_TYPE_TAB_ALIGN))
98
+ #define PANGOTABALIGN2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_TAB_ALIGN))
99
+ #define RVAL2PANGOUNDERLINE(o) (RVAL2GENUM(o, PANGO_TYPE_UNDERLINE))
100
+ #define PANGOUNDERLINE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_UNDERLINE))
101
+ #define RVAL2PANGOVARIANT(o) (RVAL2GENUM(o, PANGO_TYPE_VARIANT))
102
+ #define PANGOVARIANT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_VARIANT))
103
+ #define RVAL2PANGOWEIGHT(o) (RVAL2GENUM(o, PANGO_TYPE_WEIGHT))
104
+ #define PANGOWEIGHT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_WEIGHT))
105
+ #define RVAL2PANGOWRAPMODE(o) (RVAL2GENUM(o, PANGO_TYPE_WRAP_MODE))
106
+ #define PANGOWRAPMODE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_WRAP_MODE))
107
+
108
+ #define RVAL2PANGOFONTMASK(o) (RVAL2GFLAGS(o, PANGO_TYPE_FONT_MASK))
109
+ #define PANGOFONTMASK2RVAL(o) (GFLAGS2RVAL(o, PANGO_TYPE_FONT_MASK))
110
+
111
+ #endif /* __PANGOCONVERSIONS_H__ */
@@ -1,18 +1,28 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangocoverage.c -
5
-
6
- $Author: sakai $
7
- $Date: 2007/07/08 02:53:10 $
8
-
9
- Copyright (C) 2005 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) ((PangoCoverage*)RVAL2BOXED(self, PANGO_TYPE_COVERAGE))
15
-
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2005 Masao Mutoh
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
20
+ */
21
+
22
+ #include "rbpangoprivate.h"
23
+
24
+ #define RG_TARGET_NAMESPACE cCoverage
25
+ #define _SELF(self) (RVAL2PANGOCOVERAGE(self))
16
26
 
17
27
  /**********************************/
18
28
  GType
@@ -29,36 +39,35 @@ pango_coverage_get_type(void)
29
39
  /**********************************/
30
40
 
31
41
  static VALUE
32
- coverage_initialize(VALUE self)
42
+ rg_initialize(VALUE self)
33
43
  {
34
44
  G_INITIALIZE(self, pango_coverage_new());
35
45
  return Qnil;
36
46
  }
37
47
 
38
48
  static VALUE
39
- coverage_get_level(VALUE self, VALUE index_)
49
+ rg_get_level(VALUE self, VALUE index_)
40
50
  {
41
- return GENUM2RVAL(pango_coverage_get(_SELF(self), NUM2INT(index_)),
42
- PANGO_TYPE_COVERAGE_LEVEL);
51
+ return PANGOCOVERAGELEVEL2RVAL(pango_coverage_get(_SELF(self), NUM2INT(index_)));
43
52
  }
44
53
 
45
54
  static VALUE
46
- coverage_max(VALUE self, VALUE other)
55
+ rg_max_bang(VALUE self, VALUE other)
47
56
  {
48
57
  pango_coverage_max(_SELF(self), _SELF(other));
49
58
  return self;
50
59
  }
51
60
 
52
61
  static VALUE
53
- coverage_set(VALUE self, VALUE index_, VALUE level)
62
+ rg_set(VALUE self, VALUE index_, VALUE level)
54
63
  {
55
64
  pango_coverage_set(_SELF(self), NUM2INT(index_),
56
- RVAL2GENUM(level, PANGO_TYPE_COVERAGE_LEVEL));
65
+ RVAL2PANGOCOVERAGELEVEL(level));
57
66
  return self;
58
67
  }
59
68
 
60
69
  static VALUE
61
- coverage_to_bytes(VALUE self)
70
+ rg_to_bytes(VALUE self)
62
71
  {
63
72
  guchar* bytes;
64
73
  int n_bytes;
@@ -72,27 +81,26 @@ coverage_to_bytes(VALUE self)
72
81
  }
73
82
 
74
83
  static VALUE
75
- coverage_s_from_bytes(VALUE self, VALUE bytes)
84
+ rg_s_from_bytes(G_GNUC_UNUSED VALUE self, VALUE bytes)
76
85
  {
77
86
  StringValue(bytes);
78
- return BOXED2RVAL(pango_coverage_from_bytes((guchar *)RSTRING_PTR(bytes),
79
- RSTRING_LEN(bytes)),
80
- PANGO_TYPE_COVERAGE);
87
+ return PANGOCOVERAGE2RVAL(pango_coverage_from_bytes((guchar *)RSTRING_PTR(bytes),
88
+ RSTRING_LEN(bytes)));
81
89
  }
82
90
 
83
91
  void
84
- Init_pango_coverage()
92
+ Init_pango_coverage(VALUE mPango)
85
93
  {
86
- VALUE pCoverage = G_DEF_CLASS(PANGO_TYPE_COVERAGE, "Coverage", mPango);
87
-
88
- rb_define_method(pCoverage, "initialize", coverage_initialize, 0);
89
- rb_define_method(pCoverage, "get_level", coverage_get_level, 0);
90
- rb_define_method(pCoverage, "max!", coverage_max, 1);
91
- rb_define_method(pCoverage, "set", coverage_set, 2);
92
- rb_define_method(pCoverage, "to_bytes", coverage_to_bytes, 0);
93
- rb_define_singleton_method(pCoverage, "from_bytes", coverage_s_from_bytes, 1);
94
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_COVERAGE, "Coverage", mPango);
95
+
96
+ RG_DEF_METHOD(initialize, 0);
97
+ RG_DEF_METHOD(get_level, 0);
98
+ RG_DEF_METHOD_BANG(max, 1);
99
+ RG_DEF_METHOD(set, 2);
100
+ RG_DEF_METHOD(to_bytes, 0);
101
+ RG_DEF_SMETHOD(from_bytes, 1);
94
102
 
95
103
  /* PangoCoverageLevel */
96
- G_DEF_CLASS(PANGO_TYPE_COVERAGE_LEVEL, "Level", pCoverage);
97
- G_DEF_CONSTANTS(pCoverage, PANGO_TYPE_COVERAGE_LEVEL, "PANGO_COVERAGE_");
104
+ G_DEF_CLASS(PANGO_TYPE_COVERAGE_LEVEL, "Level", RG_TARGET_NAMESPACE);
105
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_COVERAGE_LEVEL, "PANGO_COVERAGE_");
98
106
  }
@@ -1,19 +1,29 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangoengine.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2005/10/15 04:32:01 $
8
-
9
- Copyright (C) 2005 Masao Mutoh
10
- ************************************************/
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2005 Masao Mutoh
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
20
+ */
11
21
 
12
- #include "rbpango.h"
22
+ #include "rbpangoprivate.h"
13
23
 
14
24
  #ifdef PANGO_TYPE_ENGINE
15
25
 
16
- #define _SELF(self) (PANGO_ENGINE(RVAL2GOBJ(self)))
26
+ #define _SELF(self) (RVAL2PANGOENGINE(self))
17
27
 
18
28
  /* FIXME
19
29
  static VALUE
@@ -47,7 +57,7 @@ PangoEngine* script_engine_create (const char *id);
47
57
  #endif
48
58
 
49
59
  void
50
- Init_pango_engine()
60
+ Init_pango_engine(VALUE mPango)
51
61
  {
52
62
  #ifdef PANGO_TYPE_ENGINE
53
63
  G_DEF_CLASS(PANGO_TYPE_ENGINE, "Engine", mPango);
@@ -1,103 +1,112 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangofont.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 16:07:33 $
8
-
9
- Copyright (C) 2002-2006 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) (PANGO_FONT(RVAL2GOBJ(self)))
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002-2006 Masao Mutoh
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
20
+ */
21
+
22
+ #include "rbpangoprivate.h"
23
+
24
+ #define RG_TARGET_NAMESPACE cFont
25
+ #define _SELF(self) (RVAL2PANGOFONT(self))
15
26
 
16
27
  static VALUE
17
- font_find_shaper(VALUE self, VALUE language, VALUE ch)
28
+ rg_find_shaper(VALUE self, VALUE language, VALUE ch)
18
29
  {
19
30
  return GOBJ2RVAL(pango_font_find_shaper(_SELF(self),
20
- (PangoLanguage*)RVAL2BOXED(language, PANGO_TYPE_LANGUAGE),
31
+ RVAL2PANGOLANGUAGE(language),
21
32
  NUM2UINT(ch)));
22
33
  }
23
34
 
24
35
  static VALUE
25
- font_describe(int argc, VALUE *argv, VALUE self)
36
+ rg_describe(int argc, VALUE *argv, VALUE self)
26
37
  {
27
38
  VALUE desc, absolute_size;
28
39
  rb_scan_args(argc, argv, "01", &absolute_size);
29
40
 
30
41
  if (NIL_P(absolute_size) || ! RVAL2CBOOL(absolute_size)){
31
- desc = BOXED2RVAL(pango_font_describe(_SELF(self)), PANGO_TYPE_FONT_DESCRIPTION);
42
+ desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe(_SELF(self)));
32
43
  } else {
33
44
  #if PANGO_CHECK_VERSION(1,14,0)
34
- desc = BOXED2RVAL(pango_font_describe_with_absolute_size(_SELF(self)),
35
- PANGO_TYPE_FONT_DESCRIPTION);
45
+ desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe_with_absolute_size(_SELF(self)));
36
46
  #else
37
47
  rb_warning("Pango::Font#describe(absolute) has been supported since GTK+-2.10.x. Use Pango::Font#describe() instead.");
38
- desc = BOXED2RVAL(pango_font_describe(_SELF(self)), PANGO_TYPE_FONT_DESCRIPTION);
48
+ desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe(_SELF(self)));
39
49
  #endif
40
50
  }
41
51
  return desc;
42
52
  }
43
53
 
44
54
  static VALUE
45
- font_get_coverage(VALUE self, VALUE language)
55
+ rg_get_coverage(VALUE self, VALUE language)
46
56
  {
47
57
  PangoCoverage* c = pango_font_get_coverage(_SELF(self),
48
- (PangoLanguage*)RVAL2BOXED(language, PANGO_TYPE_LANGUAGE));
49
- return BOXED2RVAL(c, PANGO_TYPE_COVERAGE);
58
+ RVAL2PANGOLANGUAGE(language));
59
+ return PANGOCOVERAGE2RVAL(c);
50
60
  }
51
61
 
52
62
  static VALUE
53
- font_get_glyph_extents(VALUE self, VALUE glyph)
63
+ rg_get_glyph_extents(VALUE self, VALUE glyph)
54
64
  {
55
65
  PangoRectangle ink_rect, logical_rect;
56
66
  pango_font_get_glyph_extents(_SELF(self),
57
67
  NUM2UINT(glyph),
58
68
  &ink_rect, &logical_rect);
59
69
 
60
- return rb_assoc_new(BOXED2RVAL(&ink_rect, PANGO_TYPE_RECTANGLE),
61
- BOXED2RVAL(&logical_rect, PANGO_TYPE_RECTANGLE));
62
-
70
+ return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
71
+ PANGORECTANGLE2RVAL(&logical_rect));
72
+
63
73
  }
64
74
 
65
75
  static VALUE
66
- font_get_metrics(int argc, VALUE *argv, VALUE self)
76
+ rg_metrics(int argc, VALUE *argv, VALUE self)
67
77
  {
68
78
  VALUE language;
69
79
  PangoLanguage* lang = NULL;
70
-
80
+
71
81
  rb_scan_args(argc, argv, "01", &language);
72
-
82
+
73
83
  if (!NIL_P(language))
74
- lang = (PangoLanguage*)RVAL2BOXED(language, PANGO_TYPE_LANGUAGE);
84
+ lang = RVAL2PANGOLANGUAGE(language);
75
85
 
76
- return BOXED2RVAL(pango_font_get_metrics(_SELF(self), lang),
77
- PANGO_TYPE_FONT_METRICS);
86
+ return PANGOFONTMETRICS2RVAL(pango_font_get_metrics(_SELF(self), lang));
78
87
  }
79
88
 
80
89
  #if PANGO_CHECK_VERSION(1,9,0)
81
90
  static VALUE
82
- font_get_font_map(VALUE self)
91
+ rg_font_map(VALUE self)
83
92
  {
84
93
  return GOBJ2RVAL(pango_font_get_font_map(_SELF(self)));
85
94
  }
86
95
  #endif
87
96
 
88
97
  void
89
- Init_pango_font()
98
+ Init_pango_font(VALUE mPango)
90
99
  {
91
- VALUE pFont = G_DEF_CLASS(PANGO_TYPE_FONT, "Font", mPango);
92
-
93
- rb_define_method(pFont, "find_shaper", font_find_shaper, 2);
94
- rb_define_method(pFont, "describe", font_describe, -1);
95
- rb_define_method(pFont, "get_coverage", font_get_coverage, 1);
96
- rb_define_method(pFont, "get_glyph_extents", font_get_glyph_extents, 1);
97
- rb_define_method(pFont, "metrics", font_get_metrics, -1);
100
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT, "Font", mPango);
101
+
102
+ RG_DEF_METHOD(find_shaper, 2);
103
+ RG_DEF_METHOD(describe, -1);
104
+ RG_DEF_METHOD(get_coverage, 1);
105
+ RG_DEF_METHOD(get_glyph_extents, 1);
106
+ RG_DEF_METHOD(metrics, -1);
98
107
 
99
108
  #if PANGO_CHECK_VERSION(1,9,0)
100
- rb_define_method(pFont, "font_map", font_get_font_map, 0);
109
+ RG_DEF_METHOD(font_map, 0);
101
110
  #endif
102
111
 
103
112
  G_DEF_CLASS3("PangoXFont", "XFont", mPango);
@@ -1,20 +1,31 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangofontdescription.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 16:07:33 $
8
-
9
- Copyright (C) 2002-2005 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) ((PangoFontDescription*)RVAL2BOXED(self, PANGO_TYPE_FONT_DESCRIPTION))
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002-2005 Masao Mutoh
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ * MA 02110-1301 USA
20
+ */
21
+
22
+ #include "rbpangoprivate.h"
23
+
24
+ #define RG_TARGET_NAMESPACE cFontDescription
25
+ #define _SELF(self) (RVAL2PANGOFONTDESCRIPTION(self))
15
26
 
16
27
  static VALUE
17
- font_desc_initialize(int argc, VALUE *argv, VALUE self)
28
+ rg_initialize(int argc, VALUE *argv, VALUE self)
18
29
  {
19
30
  VALUE str;
20
31
  PangoFontDescription *description;
@@ -22,7 +33,7 @@ font_desc_initialize(int argc, VALUE *argv, VALUE self)
22
33
  rb_scan_args(argc, argv, "01", &str);
23
34
 
24
35
  if (NIL_P(str)) {
25
- description = pango_font_description_new();
36
+ description = pango_font_description_new();
26
37
  } else {
27
38
  description = pango_font_description_from_string(RVAL2CSTR(str));
28
39
  }
@@ -40,13 +51,13 @@ PangoFontDescription* pango_font_description_copy_static
40
51
  */
41
52
 
42
53
  static VALUE
43
- font_desc_hash(VALUE self)
54
+ rg_hash(VALUE self)
44
55
  {
45
56
  return UINT2NUM(pango_font_description_hash(_SELF(self)));
46
57
  }
47
58
 
48
59
  static VALUE
49
- font_desc_equal(VALUE self, VALUE other)
60
+ rg_operator_font_desc_equal(VALUE self, VALUE other)
50
61
  {
51
62
  return CBOOL2RVAL(pango_font_description_equal(_SELF(self), _SELF(other)));
52
63
  }
@@ -57,7 +68,7 @@ void pango_font_descriptions_free (PangoFontDescription **descs,
57
68
  */
58
69
 
59
70
  static VALUE
60
- font_desc_set_family(VALUE self, VALUE family)
71
+ rg_set_family(VALUE self, VALUE family)
61
72
  {
62
73
  pango_font_description_set_family(_SELF(self), RVAL2CSTR(family));
63
74
  return self;
@@ -69,87 +80,87 @@ void pango_font_description_set_family_static
69
80
  */
70
81
 
71
82
  static VALUE
72
- font_desc_get_family(VALUE self)
83
+ rg_family(VALUE self)
73
84
  {
74
85
  return CSTR2RVAL(pango_font_description_get_family(_SELF(self)));
75
86
  }
76
87
 
77
88
  static VALUE
78
- font_desc_set_style(VALUE self, VALUE style)
89
+ rg_set_style(VALUE self, VALUE style)
79
90
  {
80
- pango_font_description_set_style(_SELF(self), RVAL2GENUM(style, PANGO_TYPE_STYLE));
91
+ pango_font_description_set_style(_SELF(self), RVAL2PANGOSTYLE(style));
81
92
  return self;
82
93
  }
83
94
 
84
95
  static VALUE
85
- font_desc_get_style(VALUE self)
96
+ rg_style(VALUE self)
86
97
  {
87
- return GENUM2RVAL(pango_font_description_get_style(_SELF(self)), PANGO_TYPE_STYLE);
98
+ return PANGOSTYLE2RVAL(pango_font_description_get_style(_SELF(self)));
88
99
  }
89
100
 
90
101
  static VALUE
91
- font_desc_set_variant(VALUE self, VALUE variant)
102
+ rg_set_variant(VALUE self, VALUE variant)
92
103
  {
93
- pango_font_description_set_variant(_SELF(self), RVAL2GENUM(variant, PANGO_TYPE_VARIANT));
104
+ pango_font_description_set_variant(_SELF(self), RVAL2PANGOVARIANT(variant));
94
105
  return self;
95
106
  }
96
107
 
97
108
  static VALUE
98
- font_desc_get_variant(VALUE self)
109
+ rg_variant(VALUE self)
99
110
  {
100
- return GENUM2RVAL(pango_font_description_get_variant(_SELF(self)), PANGO_TYPE_VARIANT);
111
+ return PANGOVARIANT2RVAL(pango_font_description_get_variant(_SELF(self)));
101
112
  }
102
113
 
103
114
  static VALUE
104
- font_desc_set_weight(VALUE self, VALUE weight)
115
+ rg_set_weight(VALUE self, VALUE weight)
105
116
  {
106
117
  pango_font_description_set_weight(_SELF(self),
107
- RVAL2GENUM(weight, PANGO_TYPE_WEIGHT));
118
+ RVAL2PANGOWEIGHT(weight));
108
119
  return self;
109
120
  }
110
121
 
111
122
  static VALUE
112
- font_desc_get_weight(VALUE self)
123
+ rg_weight(VALUE self)
113
124
  {
114
- return GENUM2RVAL(pango_font_description_get_weight(_SELF(self)), PANGO_TYPE_WEIGHT);
125
+ return PANGOWEIGHT2RVAL(pango_font_description_get_weight(_SELF(self)));
115
126
  }
116
127
 
117
128
  static VALUE
118
- font_desc_set_stretch(VALUE self, VALUE stretch)
129
+ rg_set_stretch(VALUE self, VALUE stretch)
119
130
  {
120
- pango_font_description_set_stretch(_SELF(self), RVAL2GENUM(stretch, PANGO_TYPE_STRETCH));
131
+ pango_font_description_set_stretch(_SELF(self), RVAL2PANGOSTRETCH(stretch));
121
132
  return self;
122
133
  }
123
134
 
124
135
  static VALUE
125
- font_desc_get_stretch(VALUE self)
136
+ rg_stretch(VALUE self)
126
137
  {
127
- return GENUM2RVAL(pango_font_description_get_stretch(_SELF(self)), PANGO_TYPE_STRETCH);
138
+ return PANGOSTRETCH2RVAL(pango_font_description_get_stretch(_SELF(self)));
128
139
  }
129
140
 
130
141
  static VALUE
131
- font_desc_set_size(VALUE self, VALUE size)
142
+ rg_set_size(VALUE self, VALUE size)
132
143
  {
133
144
  pango_font_description_set_size(_SELF(self), NUM2INT(size));
134
145
  return self;
135
146
  }
136
147
 
137
148
  static VALUE
138
- font_desc_get_size(VALUE self)
149
+ rg_size(VALUE self)
139
150
  {
140
151
  return INT2NUM(pango_font_description_get_size(_SELF(self)));
141
152
  }
142
153
 
143
154
  #if PANGO_CHECK_VERSION(1,8,0)
144
155
  static VALUE
145
- font_desc_set_absolute_size(VALUE self, VALUE size)
156
+ rg_set_absolute_size(VALUE self, VALUE size)
146
157
  {
147
158
  pango_font_description_set_absolute_size(_SELF(self), NUM2INT(size));
148
159
  return self;
149
160
  }
150
161
 
151
162
  static VALUE
152
- font_desc_get_size_is_absolute(VALUE self)
163
+ rg_size_is_absolute_p(VALUE self)
153
164
  {
154
165
  return CBOOL2RVAL(pango_font_description_get_size_is_absolute(_SELF(self)));
155
166
  }
@@ -157,34 +168,34 @@ font_desc_get_size_is_absolute(VALUE self)
157
168
 
158
169
  #if PANGO_CHECK_VERSION(1,16,0)
159
170
  static VALUE
160
- font_desc_get_gravity(VALUE self)
171
+ rg_gravity(VALUE self)
161
172
  {
162
- return GENUM2RVAL(pango_font_description_get_gravity(_SELF(self)), PANGO_TYPE_GRAVITY);
173
+ return PANGOGRAVITY2RVAL(pango_font_description_get_gravity(_SELF(self)));
163
174
  }
164
175
 
165
176
  static VALUE
166
- font_desc_set_gravity(VALUE self, VALUE gravity)
177
+ rg_set_gravity(VALUE self, VALUE gravity)
167
178
  {
168
- pango_font_description_set_gravity(_SELF(self), RVAL2GENUM(gravity, PANGO_TYPE_GRAVITY));
179
+ pango_font_description_set_gravity(_SELF(self), RVAL2PANGOGRAVITY(gravity));
169
180
  return self;
170
181
  }
171
182
  #endif
172
183
 
173
184
  static VALUE
174
- font_desc_get_set_fields(VALUE self)
185
+ rg_set_fields(VALUE self)
175
186
  {
176
- return GFLAGS2RVAL(pango_font_description_get_set_fields(_SELF(self)), PANGO_TYPE_FONT_MASK);
187
+ return PANGOFONTMASK2RVAL(pango_font_description_get_set_fields(_SELF(self)));
177
188
  }
178
189
 
179
190
  static VALUE
180
- font_desc_unset_fields(VALUE self, VALUE to_unset)
191
+ rg_unset_fields(VALUE self, VALUE to_unset)
181
192
  {
182
- pango_font_description_unset_fields(_SELF(self), RVAL2GFLAGS(to_unset, PANGO_TYPE_FONT_MASK));
193
+ pango_font_description_unset_fields(_SELF(self), RVAL2PANGOFONTMASK(to_unset));
183
194
  return self;
184
195
  }
185
196
 
186
197
  static VALUE
187
- font_desc_merge(VALUE self, VALUE desc_to_merge, VALUE replace_existing)
198
+ rg_merge(VALUE self, VALUE desc_to_merge, VALUE replace_existing)
188
199
  {
189
200
  pango_font_description_merge(_SELF(self), _SELF(desc_to_merge),
190
201
  RVAL2CBOOL(replace_existing));
@@ -199,7 +210,7 @@ void pango_font_description_merge_static
199
210
  */
200
211
 
201
212
  static VALUE
202
- font_desc_better_match(VALUE self, VALUE old_match, VALUE new_match)
213
+ rg_better_match(VALUE self, VALUE old_match, VALUE new_match)
203
214
  {
204
215
  return CBOOL2RVAL(pango_font_description_better_match(_SELF(self),
205
216
  _SELF(old_match),
@@ -207,73 +218,73 @@ font_desc_better_match(VALUE self, VALUE old_match, VALUE new_match)
207
218
  }
208
219
 
209
220
  static VALUE
210
- font_desc_to_string(VALUE self)
221
+ rg_to_str(VALUE self)
211
222
  {
212
223
  return CSTR2RVAL(pango_font_description_to_string(_SELF(self)));
213
224
  }
214
225
 
215
226
  static VALUE
216
- font_desc_to_filename(VALUE self)
227
+ rg_to_filename(VALUE self)
217
228
  {
218
229
  return CSTR2RVAL(pango_font_description_to_filename(_SELF(self)));
219
230
  }
220
231
 
221
232
  void
222
- Init_pango_font_description()
233
+ Init_pango_font_description(VALUE mPango)
223
234
  {
224
- VALUE pFontDesc = G_DEF_CLASS(PANGO_TYPE_FONT_DESCRIPTION, "FontDescription", mPango);
225
-
226
- rb_define_method(pFontDesc, "initialize", font_desc_initialize, -1);
227
- rb_define_method(pFontDesc, "hash", font_desc_hash, 0);
228
- rb_define_method(pFontDesc, "==", font_desc_equal, 1);
229
- rb_define_method(pFontDesc, "set_family", font_desc_set_family, 1);
230
- rb_define_method(pFontDesc, "family", font_desc_get_family, 0);
231
- rb_define_method(pFontDesc, "set_style", font_desc_set_style, 1);
232
- rb_define_method(pFontDesc, "style", font_desc_get_style, 0);
233
- rb_define_method(pFontDesc, "set_variant", font_desc_set_variant, 1);
234
- rb_define_method(pFontDesc, "variant", font_desc_get_variant, 0);
235
- rb_define_method(pFontDesc, "set_weight", font_desc_set_weight, 1);
236
- rb_define_method(pFontDesc, "weight", font_desc_get_weight, 0);
237
- rb_define_method(pFontDesc, "set_stretch", font_desc_set_stretch, 1);
238
- rb_define_method(pFontDesc, "stretch", font_desc_get_stretch, 0);
239
- rb_define_method(pFontDesc, "set_size", font_desc_set_size, 1);
240
- rb_define_method(pFontDesc, "size", font_desc_get_size, 0);
235
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_DESCRIPTION, "FontDescription", mPango);
236
+
237
+ RG_DEF_METHOD(initialize, -1);
238
+ RG_DEF_METHOD(hash, 0);
239
+ RG_DEF_METHOD_OPERATOR("==", font_desc_equal, 1);
240
+ RG_DEF_METHOD(set_family, 1);
241
+ RG_DEF_METHOD(family, 0);
242
+ RG_DEF_METHOD(set_style, 1);
243
+ RG_DEF_METHOD(style, 0);
244
+ RG_DEF_METHOD(set_variant, 1);
245
+ RG_DEF_METHOD(variant, 0);
246
+ RG_DEF_METHOD(set_weight, 1);
247
+ RG_DEF_METHOD(weight, 0);
248
+ RG_DEF_METHOD(set_stretch, 1);
249
+ RG_DEF_METHOD(stretch, 0);
250
+ RG_DEF_METHOD(set_size, 1);
251
+ RG_DEF_METHOD(size, 0);
241
252
 
242
253
  #if PANGO_CHECK_VERSION(1,8,0)
243
- rb_define_method(pFontDesc, "set_absolute_size", font_desc_set_absolute_size, 1);
244
- rb_define_method(pFontDesc, "size_is_absolute?", font_desc_get_size_is_absolute, 0);
254
+ RG_DEF_METHOD(set_absolute_size, 1);
255
+ RG_DEF_METHOD_P(size_is_absolute, 0);
245
256
  #endif
246
257
  #if PANGO_CHECK_VERSION(1,16,0)
247
- rb_define_method(pFontDesc, "set_gravity", font_desc_set_gravity, 1);
248
- rb_define_method(pFontDesc, "gravity", font_desc_get_gravity, 0);
258
+ RG_DEF_METHOD(set_gravity, 1);
259
+ RG_DEF_METHOD(gravity, 0);
249
260
  #endif
250
- rb_define_method(pFontDesc, "set_fields", font_desc_get_set_fields, 0);
251
- rb_define_method(pFontDesc, "unset_fields", font_desc_unset_fields, 1);
252
- rb_define_method(pFontDesc, "merge", font_desc_merge, 2);
253
- rb_define_method(pFontDesc, "better_match", font_desc_better_match, 2);
254
- rb_define_method(pFontDesc, "to_str", font_desc_to_string, 0);
255
- rb_define_alias(pFontDesc, "to_s", "to_str");
256
- rb_define_method(pFontDesc, "to_filename", font_desc_to_filename, 0);
261
+ RG_DEF_METHOD(set_fields, 0);
262
+ RG_DEF_METHOD(unset_fields, 1);
263
+ RG_DEF_METHOD(merge, 2);
264
+ RG_DEF_METHOD(better_match, 2);
265
+ RG_DEF_METHOD(to_str, 0);
266
+ RG_DEF_ALIAS("to_s", "to_str");
267
+ RG_DEF_METHOD(to_filename, 0);
257
268
 
258
- G_DEF_SETTERS(pFontDesc);
269
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
259
270
 
260
271
  /* PangoStyle */
261
- G_DEF_CLASS(PANGO_TYPE_STYLE, "Style", pFontDesc);
262
- G_DEF_CONSTANTS(pFontDesc, PANGO_TYPE_STYLE, "PANGO_");
272
+ G_DEF_CLASS(PANGO_TYPE_STYLE, "Style", RG_TARGET_NAMESPACE);
273
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_STYLE, "PANGO_");
263
274
 
264
275
  /* PangoWeight */
265
- G_DEF_CLASS(PANGO_TYPE_WEIGHT, "Weight", pFontDesc);
266
- G_DEF_CONSTANTS(pFontDesc, PANGO_TYPE_WEIGHT, "PANGO_");
276
+ G_DEF_CLASS(PANGO_TYPE_WEIGHT, "Weight", RG_TARGET_NAMESPACE);
277
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_WEIGHT, "PANGO_");
267
278
 
268
279
  /* PangoVariant */
269
- G_DEF_CLASS(PANGO_TYPE_VARIANT, "Variant", pFontDesc);
270
- G_DEF_CONSTANTS(pFontDesc, PANGO_TYPE_VARIANT, "PANGO_");
280
+ G_DEF_CLASS(PANGO_TYPE_VARIANT, "Variant", RG_TARGET_NAMESPACE);
281
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_VARIANT, "PANGO_");
271
282
 
272
283
  /* PangoStretch */
273
- G_DEF_CLASS(PANGO_TYPE_STRETCH, "Stretch", pFontDesc);
274
- G_DEF_CONSTANTS(pFontDesc, PANGO_TYPE_STRETCH, "PANGO_");
284
+ G_DEF_CLASS(PANGO_TYPE_STRETCH, "Stretch", RG_TARGET_NAMESPACE);
285
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_STRETCH, "PANGO_");
275
286
 
276
287
  /* PangoFontMask */
277
- G_DEF_CLASS(PANGO_TYPE_FONT_MASK, "FontMask", pFontDesc);
278
- G_DEF_CONSTANTS(pFontDesc, PANGO_TYPE_FONT_MASK, "PANGO_");
288
+ G_DEF_CLASS(PANGO_TYPE_FONT_MASK, "FontMask", RG_TARGET_NAMESPACE);
289
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_FONT_MASK, "PANGO_");
279
290
  }