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
@@ -1,33 +1,44 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002,2003 Masao Mutoh <mutoh@highway.ne.jp>
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
+ */
3
21
 
4
- rbpangofontface.c -
22
+ #include "rbpangoprivate.h"
5
23
 
6
- $Author: mutoh $
7
- $Date: 2006/12/10 15:13:10 $
8
-
9
- Copyright (C) 2002,2003 Masao Mutoh <mutoh@highway.ne.jp>
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) (PANGO_FONT_FACE(RVAL2GOBJ(self)))
24
+ #define RG_TARGET_NAMESPACE cFontFace
25
+ #define _SELF(self) (RVAL2PANGOFONTFACE(self))
15
26
 
16
27
  static VALUE
17
- font_face_get_face_name(VALUE self)
28
+ rg_name(VALUE self)
18
29
  {
19
30
  return CSTR2RVAL(pango_font_face_get_face_name(_SELF(self)));
20
31
  }
21
32
 
22
33
  static VALUE
23
- font_face_describe(VALUE self)
34
+ rg_describe(VALUE self)
24
35
  {
25
- return BOXED2RVAL(pango_font_face_describe(_SELF(self)), PANGO_TYPE_FONT_DESCRIPTION);
36
+ return PANGOFONTDESCRIPTION2RVAL(pango_font_face_describe(_SELF(self)));
26
37
  }
27
38
 
28
39
  #if PANGO_CHECK_VERSION(1,4,0)
29
40
  static VALUE
30
- font_face_list_sizes(VALUE self)
41
+ rg_sizes(VALUE self)
31
42
  {
32
43
  int n_sizes;
33
44
  int* sizes;
@@ -48,14 +59,14 @@ font_face_list_sizes(VALUE self)
48
59
  #endif
49
60
 
50
61
  void
51
- Init_pango_font_face()
62
+ Init_pango_font_face(VALUE mPango)
52
63
  {
53
- VALUE pFace = G_DEF_CLASS(PANGO_TYPE_FONT_FACE, "FontFace", mPango);
54
-
55
- rb_define_method(pFace, "name", font_face_get_face_name, 0);
56
- rb_define_method(pFace, "describe", font_face_describe, 0);
64
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_FACE, "FontFace", mPango);
65
+
66
+ RG_DEF_METHOD(name, 0);
67
+ RG_DEF_METHOD(describe, 0);
57
68
  #if PANGO_CHECK_VERSION(1,4,0)
58
- rb_define_method(pFace, "sizes", font_face_list_sizes, 0);
69
+ RG_DEF_METHOD(sizes, 0);
59
70
  #endif
60
71
  G_DEF_CLASS3("PangoFcFace", "FcFace", mPango);
61
72
  G_DEF_CLASS3("PangoFT2Face", "FT2Face", mPango);
@@ -1,34 +1,45 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
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
+ */
3
21
 
4
- rbpangofontfamily.c -
22
+ #include "rbpangoprivate.h"
5
23
 
6
- $Author: mutoh $
7
- $Date: 2006/12/10 15:13:10 $
8
-
9
- Copyright (C) 2002-2005 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) (PANGO_FONT_FAMILY(RVAL2GOBJ(self)))
24
+ #define RG_TARGET_NAMESPACE cFontFamily
25
+ #define _SELF(self) (RVAL2PANGOFONTFAMILY(self))
15
26
 
16
27
  static VALUE
17
- font_family_get_name(VALUE self)
28
+ rg_name(VALUE self)
18
29
  {
19
30
  return CSTR2RVAL(pango_font_family_get_name(_SELF(self)));
20
31
  }
21
32
 
22
33
  #ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
23
34
  static VALUE
24
- font_family_is_monospace(VALUE self)
35
+ rg_monospace_p(VALUE self)
25
36
  {
26
37
  return CBOOL2RVAL(pango_font_family_is_monospace(_SELF(self)));
27
38
  }
28
39
  #endif
29
40
 
30
41
  static VALUE
31
- font_family_list_faces(VALUE self)
42
+ rg_faces(VALUE self)
32
43
  {
33
44
  int n_faces;
34
45
  PangoFontFace** faces;
@@ -49,15 +60,15 @@ font_family_list_faces(VALUE self)
49
60
  }
50
61
 
51
62
  void
52
- Init_pango_font_family()
63
+ Init_pango_font_family(VALUE mPango)
53
64
  {
54
- VALUE pFamily = G_DEF_CLASS(PANGO_TYPE_FONT_FAMILY, "FontFamily", mPango);
55
-
56
- rb_define_method(pFamily, "name", font_family_get_name, 0);
65
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_FAMILY, "FontFamily", mPango);
66
+
67
+ RG_DEF_METHOD(name, 0);
57
68
  #ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
58
- rb_define_method(pFamily, "monospace?", font_family_is_monospace, 0);
69
+ RG_DEF_METHOD_P(monospace, 0);
59
70
  #endif
60
- rb_define_method(pFamily, "faces", font_family_list_faces, 0);
71
+ RG_DEF_METHOD(faces, 0);
61
72
 
62
73
  G_DEF_CLASS3("PangoFcFamily", "FcFamily", mPango);
63
74
  G_DEF_CLASS3("PangoFT2Family", "FT2Family", mPango);
@@ -1,23 +1,32 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangofontmap.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2006/12/10 15:13:10 $
8
-
9
- Copyright (C) 2002-2005 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) (PANGO_FONT_MAP(RVAL2GOBJ(self)))
15
- #define RVAL2DESC(d) ((PangoFontDescription*)RVAL2BOXED(d, PANGO_TYPE_FONT_DESCRIPTION))
16
- #define RVAL2LANG(l) ((PangoLanguage*)RVAL2BOXED(l, PANGO_TYPE_LANGUAGE))
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 cFontMap
25
+ #define _SELF(self) (RVAL2PANGOFONTMAP(self))
17
26
 
18
27
  /*
19
28
  static VALUE
20
- font_map_initialize(VALUE self)
29
+ rg_initialize(VALUE self)
21
30
  {
22
31
  G_INITIALIZE(self, pango_ft2_font_map_new());
23
32
  return Qnil;
@@ -25,24 +34,24 @@ font_map_initialize(VALUE self)
25
34
  */
26
35
 
27
36
  static VALUE
28
- font_map_load_font(VALUE self, VALUE context, VALUE desc)
37
+ rg_load_font(VALUE self, VALUE context, VALUE desc)
29
38
  {
30
39
  return GOBJ2RVAL(pango_font_map_load_font(_SELF(self),
31
- PANGO_CONTEXT(RVAL2GOBJ(context)),
32
- RVAL2DESC(desc)));
40
+ RVAL2PANGOCONTEXT(context),
41
+ RVAL2PANGOFONTDESCRIPTION(desc)));
33
42
  }
34
43
 
35
44
  static VALUE
36
- font_map_load_fontset(VALUE self, VALUE context, VALUE desc, VALUE lang)
45
+ rg_load_fontset(VALUE self, VALUE context, VALUE desc, VALUE lang)
37
46
  {
38
47
  return GOBJ2RVAL(pango_font_map_load_fontset(_SELF(self),
39
- PANGO_CONTEXT(RVAL2GOBJ(context)),
40
- RVAL2DESC(desc),
41
- RVAL2LANG(lang)));
48
+ RVAL2PANGOCONTEXT(context),
49
+ RVAL2PANGOFONTDESCRIPTION(desc),
50
+ RVAL2PANGOLANGUAGE(lang)));
42
51
  }
43
52
 
44
53
  static VALUE
45
- font_map_list_families(VALUE self)
54
+ rg_families(VALUE self)
46
55
  {
47
56
  int n_families;
48
57
  PangoFontFamily** families;
@@ -64,25 +73,25 @@ font_map_list_families(VALUE self)
64
73
 
65
74
  #if PANGO_CHECK_VERSION(1,4,0)
66
75
  static VALUE
67
- font_map_get_shape_engine_type(VALUE self)
76
+ rg_shape_engine_type(VALUE self)
68
77
  {
69
78
  return CSTR2RVAL(pango_font_map_get_shape_engine_type(_SELF(self)));
70
79
  }
71
80
  #endif
72
81
 
73
82
  void
74
- Init_pango_font_map()
83
+ Init_pango_font_map(VALUE mPango)
75
84
  {
76
- VALUE pMap = G_DEF_CLASS(PANGO_TYPE_FONT_MAP, "FontMap", mPango);
77
-
78
- /*
79
- rb_define_method(pMap, "initialize", font_map_initialize, 0);
80
- */
81
- rb_define_method(pMap, "load_font", font_map_load_font, 2);
82
- rb_define_method(pMap, "load_fontset", font_map_load_fontset, 3);
83
- rb_define_method(pMap, "families", font_map_list_families, 0);
85
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_MAP, "FontMap", mPango);
86
+
87
+ /*
88
+ RG_DEF_METHOD(initialize, 0);
89
+ */
90
+ RG_DEF_METHOD(load_font, 2);
91
+ RG_DEF_METHOD(load_fontset, 3);
92
+ RG_DEF_METHOD(families, 0);
84
93
  #if PANGO_CHECK_VERSION(1,4,0)
85
- rb_define_method(pMap, "shape_engine_type", font_map_get_shape_engine_type, 0);
94
+ RG_DEF_METHOD(shape_engine_type, 0);
86
95
  #endif
87
96
 
88
97
  G_DEF_CLASS3("PangoFcFontMap", "FcFontMap", mPango);
@@ -96,4 +105,3 @@ Init_pango_font_map()
96
105
  G_DEF_CLASS3("PangoATSUIFontMap", "ATSUIFontMap", mPango);
97
106
  #endif
98
107
  }
99
-
@@ -1,77 +1,88 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
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
+ */
3
21
 
4
- rbpangofontmetrics.c -
22
+ #include "rbpangoprivate.h"
5
23
 
6
- $Author: mutoh $
7
- $Date: 2005/02/13 17:31:33 $
8
-
9
- Copyright (C) 2002-2005 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) ((PangoFontMetrics*)RVAL2BOXED(self, PANGO_TYPE_FONT_METRICS))
24
+ #define RG_TARGET_NAMESPACE cFontMetrics
25
+ #define _SELF(self) (RVAL2PANGOFONTMETRICS(self))
15
26
 
16
27
  static VALUE
17
- font_metrics_get_ascent(VALUE self)
28
+ rg_ascent(VALUE self)
18
29
  {
19
30
  return INT2NUM(pango_font_metrics_get_ascent(_SELF(self)));
20
31
  }
21
32
 
22
33
  static VALUE
23
- font_metrics_get_descent(VALUE self)
34
+ rg_descent(VALUE self)
24
35
  {
25
36
  return INT2NUM(pango_font_metrics_get_descent(_SELF(self)));
26
37
  }
27
38
 
28
39
  static VALUE
29
- font_metrics_get_approximate_char_width(VALUE self)
40
+ rg_approximate_char_width(VALUE self)
30
41
  {
31
42
  return INT2NUM(pango_font_metrics_get_approximate_char_width(_SELF(self)));
32
43
  }
33
44
 
34
45
  static VALUE
35
- font_metrics_get_approximate_digit_width(VALUE self)
46
+ rg_approximate_digit_width(VALUE self)
36
47
  {
37
48
  return INT2NUM(pango_font_metrics_get_approximate_digit_width(_SELF(self)));
38
49
  }
39
50
 
40
51
  #if PANGO_CHECK_VERSION(1,6,0)
41
52
  static VALUE
42
- font_metrics_get_underline_thickness(VALUE self)
53
+ rg_underline_thickness(VALUE self)
43
54
  {
44
55
  return INT2NUM(pango_font_metrics_get_underline_thickness(_SELF(self)));
45
56
  }
46
57
  static VALUE
47
- font_metrics_get_underline_position(VALUE self)
58
+ rg_underline_position(VALUE self)
48
59
  {
49
60
  return INT2NUM(pango_font_metrics_get_underline_position(_SELF(self)));
50
61
  }
51
62
  static VALUE
52
- font_metrics_get_strikethrough_thickness(VALUE self)
63
+ rg_strikethrough_thickness(VALUE self)
53
64
  {
54
65
  return INT2NUM(pango_font_metrics_get_strikethrough_thickness(_SELF(self)));
55
66
  }
56
67
  static VALUE
57
- font_metrics_get_strikethrough_position(VALUE self)
68
+ rg_strikethrough_position(VALUE self)
58
69
  {
59
70
  return INT2NUM(pango_font_metrics_get_strikethrough_position(_SELF(self)));
60
71
  }
61
72
  #endif
62
73
  void
63
- Init_pango_font_metrics()
74
+ Init_pango_font_metrics(VALUE mPango)
64
75
  {
65
- VALUE pMetrics = G_DEF_CLASS(PANGO_TYPE_FONT_METRICS, "FontMetrics", mPango);
66
-
67
- rb_define_method(pMetrics, "ascent", font_metrics_get_ascent, 0);
68
- rb_define_method(pMetrics, "descent", font_metrics_get_descent, 0);
69
- rb_define_method(pMetrics, "approximate_char_width", font_metrics_get_approximate_char_width, 0);
70
- rb_define_method(pMetrics, "approximate_digit_width", font_metrics_get_approximate_digit_width, 0);
76
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_METRICS, "FontMetrics", mPango);
77
+
78
+ RG_DEF_METHOD(ascent, 0);
79
+ RG_DEF_METHOD(descent, 0);
80
+ RG_DEF_METHOD(approximate_char_width, 0);
81
+ RG_DEF_METHOD(approximate_digit_width, 0);
71
82
  #if PANGO_CHECK_VERSION(1,6,0)
72
- rb_define_method(pMetrics, "underline_thickness", font_metrics_get_underline_thickness, 0);
73
- rb_define_method(pMetrics, "underline_position", font_metrics_get_underline_position, 0);
74
- rb_define_method(pMetrics, "strikethrough_thickness", font_metrics_get_strikethrough_thickness, 0);
75
- rb_define_method(pMetrics, "strikethrough_position", font_metrics_get_strikethrough_position, 0);
83
+ RG_DEF_METHOD(underline_thickness, 0);
84
+ RG_DEF_METHOD(underline_position, 0);
85
+ RG_DEF_METHOD(strikethrough_thickness, 0);
86
+ RG_DEF_METHOD(strikethrough_position, 0);
76
87
  #endif
77
88
  }
@@ -1,30 +1,41 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
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
+ */
3
21
 
4
- rbpangofontset.c -
22
+ #include "rbpangoprivate.h"
5
23
 
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) (PANGO_FONTSET(RVAL2GOBJ(self)))
24
+ #define RG_TARGET_NAMESPACE cFontset
25
+ #define _SELF(self) (RVAL2PANGOFONTSET(self))
15
26
 
16
27
  static ID id_call;
17
28
 
18
29
  static VALUE
19
- fontset_get_font(VALUE self, VALUE wc)
30
+ rg_get_font(VALUE self, VALUE wc)
20
31
  {
21
32
  return GOBJ2RVAL(pango_fontset_get_font(_SELF(self), NUM2UINT(wc)));
22
33
  }
23
34
 
24
35
  static VALUE
25
- fontset_get_metrics(VALUE self)
36
+ rg_metrics(VALUE self)
26
37
  {
27
- return BOXED2RVAL(pango_fontset_get_metrics(_SELF(self)), PANGO_TYPE_FONT_METRICS);
38
+ return PANGOFONTMETRICS2RVAL(pango_fontset_get_metrics(_SELF(self)));
28
39
  }
29
40
 
30
41
  #if PANGO_CHECK_VERSION(1,4,0)
@@ -36,7 +47,7 @@ fontset_each(PangoFontset *fontset, PangoFont *font, gpointer func)
36
47
  }
37
48
 
38
49
  static VALUE
39
- fontset_foreach(VALUE self)
50
+ rg_each(VALUE self)
40
51
  {
41
52
  VALUE func = rb_block_proc();
42
53
  G_RELATIVE(self, func);
@@ -48,15 +59,15 @@ fontset_foreach(VALUE self)
48
59
  #endif
49
60
 
50
61
  void
51
- Init_pango_fontset()
62
+ Init_pango_fontset(VALUE mPango)
52
63
  {
53
- VALUE pFontSet = G_DEF_CLASS(PANGO_TYPE_FONTSET, "Fontset", mPango);
54
-
64
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONTSET, "Fontset", mPango);
65
+
55
66
  id_call = rb_intern("call");
56
67
 
57
- rb_define_method(pFontSet, "get_font", fontset_get_font, 1);
58
- rb_define_method(pFontSet, "metrics", fontset_get_metrics, 0);
68
+ RG_DEF_METHOD(get_font, 1);
69
+ RG_DEF_METHOD(metrics, 0);
59
70
  #if PANGO_CHECK_VERSION(1,4,0)
60
- rb_define_method(pFontSet, "each", fontset_foreach, 0);
71
+ RG_DEF_METHOD(each, 0);
61
72
  #endif
62
73
  }