pango 1.0.3-x86-mingw32 → 1.1.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) 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. data/lib/1.8/pango.so +0 -0
  41. data/lib/1.9/pango.so +0 -0
  42. data/vendor/local/bin/libpango-1.0-0.dll +0 -0
  43. data/vendor/local/bin/libpangocairo-1.0-0.dll +0 -0
  44. data/vendor/local/bin/libpangoft2-1.0-0.dll +0 -0
  45. data/vendor/local/bin/libpangowin32-1.0-0.dll +0 -0
  46. data/vendor/local/bin/pango-querymodules.exe +0 -0
  47. data/vendor/local/bin/pango-view.exe +0 -0
  48. data/vendor/local/etc/pango/pango.modules +1 -1
  49. data/vendor/local/include/pango-1.0/pango/pango-attributes.h +1 -1
  50. data/vendor/local/include/pango-1.0/pango/pango-context.h +3 -3
  51. data/vendor/local/include/pango-1.0/pango/pango-features.h +3 -3
  52. data/vendor/local/include/pango-1.0/pango/pango-font.h +3 -3
  53. data/vendor/local/include/pango-1.0/pango/pango-language.h +3 -3
  54. data/vendor/local/include/pango-1.0/pango/pango-layout.h +6 -1
  55. data/vendor/local/include/pango-1.0/pango/pango-renderer.h +1 -1
  56. data/vendor/local/include/pango-1.0/pango/pango-script.h +6 -6
  57. data/vendor/local/include/pango-1.0/pango/pango-utils.h +6 -6
  58. data/vendor/local/lib/libpango-1.0.dll.a +0 -0
  59. data/vendor/local/lib/libpangocairo-1.0.dll.a +0 -0
  60. data/vendor/local/lib/libpangoft2-1.0.dll.a +0 -0
  61. data/vendor/local/lib/libpangowin32-1.0.dll.a +0 -0
  62. data/vendor/local/lib/pango-1.0.def +2 -0
  63. data/vendor/local/lib/pango-1.0.lib +0 -0
  64. data/vendor/local/lib/pangocairo-1.0.lib +0 -0
  65. data/vendor/local/lib/pangoft2-1.0.lib +0 -0
  66. data/vendor/local/lib/pangowin32-1.0.def +1 -1
  67. data/vendor/local/lib/pangowin32-1.0.lib +0 -0
  68. data/vendor/local/lib/pkgconfig/pango.pc +1 -1
  69. data/vendor/local/lib/pkgconfig/pangocairo.pc +1 -1
  70. data/vendor/local/lib/pkgconfig/pangoft2.pc +1 -1
  71. data/vendor/local/lib/pkgconfig/pangowin32.pc +1 -1
  72. data/vendor/local/manifest/{pango-dev_1.28.3-1_win32.mft → pango-dev_1.29.4-1_win32.mft} +5 -5
  73. data/vendor/local/manifest/{pango_1.28.3-1_win32.mft → pango_1.29.4-1_win32.mft} +2 -2
  74. data/vendor/local/share/doc/{pango-1.28.3 → pango-1.29.4}/COPYING +0 -0
  75. data/vendor/local/share/doc/{pango-dev-1.28.3 → pango-dev-1.29.4}/COPYING +0 -0
  76. data/vendor/local/share/gtk-doc/html/pango/PangoEngineLang.html +9 -10
  77. data/vendor/local/share/gtk-doc/html/pango/PangoEngineShape.html +25 -27
  78. data/vendor/local/share/gtk-doc/html/pango/PangoFcDecoder.html +19 -28
  79. data/vendor/local/share/gtk-doc/html/pango/PangoFcFont.html +42 -60
  80. data/vendor/local/share/gtk-doc/html/pango/PangoFcFontMap.html +97 -147
  81. data/vendor/local/share/gtk-doc/html/pango/PangoMarkupFormat.html +6 -6
  82. data/vendor/local/share/gtk-doc/html/pango/index-1.10.html +3 -3
  83. data/vendor/local/share/gtk-doc/html/pango/index-1.12.html +3 -3
  84. data/vendor/local/share/gtk-doc/html/pango/index-1.14.html +3 -3
  85. data/vendor/local/share/gtk-doc/html/pango/index-1.16.html +5 -5
  86. data/vendor/local/share/gtk-doc/html/pango/index-1.18.html +3 -5
  87. data/vendor/local/share/gtk-doc/html/pango/index-1.2.html +3 -3
  88. data/vendor/local/share/gtk-doc/html/pango/index-1.20.html +3 -3
  89. data/vendor/local/share/gtk-doc/html/pango/index-1.22.html +5 -5
  90. data/vendor/local/share/gtk-doc/html/pango/index-1.24.html +3 -3
  91. data/vendor/local/share/gtk-doc/html/pango/index-1.26.html +4 -4
  92. data/vendor/local/share/gtk-doc/html/pango/index-1.28.html +8 -11
  93. data/vendor/local/share/gtk-doc/html/pango/index-1.30.html +38 -0
  94. data/vendor/local/share/gtk-doc/html/pango/index-1.4.html +3 -3
  95. data/vendor/local/share/gtk-doc/html/pango/index-1.6.html +4 -4
  96. data/vendor/local/share/gtk-doc/html/pango/index-1.8.html +4 -4
  97. data/vendor/local/share/gtk-doc/html/pango/index-all.html +38 -40
  98. data/vendor/local/share/gtk-doc/html/pango/index-deprecated.html +3 -3
  99. data/vendor/local/share/gtk-doc/html/pango/index.html +6 -5
  100. data/vendor/local/share/gtk-doc/html/pango/index.sgml +71 -34
  101. data/vendor/local/share/gtk-doc/html/pango/lowlevel.html +3 -3
  102. data/vendor/local/share/gtk-doc/html/pango/pango-ATSUI-Fonts.html +4 -66
  103. data/vendor/local/share/gtk-doc/html/pango/pango-Bidirectional-Text.html +52 -50
  104. data/vendor/local/share/gtk-doc/html/pango/pango-Cairo-Rendering.html +217 -278
  105. data/vendor/local/share/gtk-doc/html/pango/pango-Coverage-Maps.html +40 -41
  106. data/vendor/local/share/gtk-doc/html/pango/pango-Engines.html +37 -49
  107. data/vendor/local/share/gtk-doc/html/pango/pango-Fonts.html +481 -628
  108. data/vendor/local/share/gtk-doc/html/pango/pango-FreeType-Fonts-and-Rendering.html +76 -118
  109. data/vendor/local/share/gtk-doc/html/pango/pango-Glyph-Storage.html +302 -452
  110. data/vendor/local/share/gtk-doc/html/pango/pango-Layout-Objects.html +492 -517
  111. data/vendor/local/share/gtk-doc/html/pango/pango-Miscellaneous-Utilities.html +134 -164
  112. data/vendor/local/share/gtk-doc/html/pango/pango-Modules.html +34 -45
  113. data/vendor/local/share/gtk-doc/html/pango/pango-OpenType-Font-Handling.html +244 -359
  114. data/vendor/local/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html +117 -122
  115. data/vendor/local/share/gtk-doc/html/pango/pango-Tab-Stops.html +112 -120
  116. data/vendor/local/share/gtk-doc/html/pango/pango-Text-Attributes.html +394 -523
  117. data/vendor/local/share/gtk-doc/html/pango/pango-Text-Processing.html +269 -364
  118. data/vendor/local/share/gtk-doc/html/pango/pango-Version-Checking.html +26 -40
  119. data/vendor/local/share/gtk-doc/html/pango/pango-Vertical-Text.html +72 -75
  120. data/vendor/local/share/gtk-doc/html/pango/pango-Win32-Fonts-and-Rendering.html +97 -145
  121. data/vendor/local/share/gtk-doc/html/pango/pango-X-Fonts-and-Rendering.html +114 -188
  122. data/vendor/local/share/gtk-doc/html/pango/pango-Xft-Fonts-and-Rendering.html +114 -176
  123. data/vendor/local/share/gtk-doc/html/pango/pango-hierarchy.html +42 -8
  124. data/vendor/local/share/gtk-doc/html/pango/pango-pango-renderer.html +106 -150
  125. data/vendor/local/share/gtk-doc/html/pango/pango-querymodules.html +3 -3
  126. data/vendor/local/share/gtk-doc/html/pango/pango.devhelp2 +35 -35
  127. data/vendor/local/share/gtk-doc/html/pango/pango.html +3 -3
  128. data/vendor/local/share/gtk-doc/html/pango/rendering.html +3 -3
  129. data/vendor/local/share/gtk-doc/html/pango/style.css +2 -1
  130. data/vendor/local/share/gtk-doc/html/pango/tools.html +3 -3
  131. data/vendor/local/share/man/man1/pango-querymodules.1 +12 -3
  132. data/vendor/local/share/man/man1/pango-view.1 +2 -2
  133. data/vendor/local/src/dieterv/packaging/pango_1.29.4-1_win32.log +806 -0
  134. data/vendor/local/src/{tml/packaging/pango_1.28.3-1_win32.sh → dieterv/packaging/pango_1.29.4-1_win32.sh} +7 -7
  135. metadata +19 -19
  136. data/ChangeLog +0 -721
  137. data/ext/pango/rbpangoinits.c +0 -72
  138. data/ext/pango/rbpangomain.c +0 -202
  139. data/vendor/local/share/gtk-doc/html/pango/pango.devhelp +0 -799
  140. data/vendor/local/src/tml/packaging/pango_1.28.3-1_win32.log +0 -950
@@ -1,20 +1,31 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangocolor.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 14:27:11 $
8
-
9
- Copyright (C) 2002,2003 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) ((PangoColor*)RVAL2BOXED(self, PANGO_TYPE_COLOR))
2
+ /*
3
+ * Copyright (C) 2011 Ruby-GNOME2 Project Team
4
+ * Copyright (C) 2002,2003 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 cColor
25
+ #define _SELF(self) (RVAL2PANGOCOLOR(self))
15
26
 
16
27
  static VALUE
17
- color_initialize(VALUE self, VALUE red, VALUE green, VALUE blue)
28
+ rg_initialize(VALUE self, VALUE red, VALUE green, VALUE blue)
18
29
  {
19
30
  PangoColor c;
20
31
  c.red = NUM2INT(red);
@@ -26,52 +37,52 @@ color_initialize(VALUE self, VALUE red, VALUE green, VALUE blue)
26
37
  }
27
38
 
28
39
  static VALUE
29
- color_parse(VALUE self, VALUE spec)
40
+ rg_parse(VALUE self, VALUE spec)
30
41
  {
31
42
  return CBOOL2RVAL(pango_color_parse(_SELF(self), RVAL2CSTR(spec)));
32
43
  }
33
44
 
34
45
  static VALUE
35
- color_red(VALUE self)
46
+ rg_red(VALUE self)
36
47
  {
37
48
  return INT2FIX(_SELF(self)->red);
38
49
  }
39
50
 
40
51
  static VALUE
41
- color_set_red(VALUE self, VALUE red)
52
+ rg_set_red(VALUE self, VALUE red)
42
53
  {
43
54
  _SELF(self)->red = NUM2INT(red);
44
55
  return self;
45
56
  }
46
57
 
47
58
  static VALUE
48
- color_green(VALUE self)
59
+ rg_green(VALUE self)
49
60
  {
50
61
  return INT2FIX(_SELF(self)->green);
51
62
  }
52
63
 
53
64
  static VALUE
54
- color_set_green(VALUE self, VALUE green)
65
+ rg_set_green(VALUE self, VALUE green)
55
66
  {
56
67
  _SELF(self)->green = NUM2INT(green);
57
68
  return self;
58
69
  }
59
70
 
60
71
  static VALUE
61
- color_blue(VALUE self)
72
+ rg_blue(VALUE self)
62
73
  {
63
74
  return INT2FIX(_SELF(self)->blue);
64
75
  }
65
76
 
66
77
  static VALUE
67
- color_set_blue(VALUE self, VALUE blue)
78
+ rg_set_blue(VALUE self, VALUE blue)
68
79
  {
69
80
  _SELF(self)->blue = NUM2INT(blue);
70
81
  return self;
71
82
  }
72
83
 
73
84
  static VALUE
74
- color_to_a(VALUE self)
85
+ rg_to_a(VALUE self)
75
86
  {
76
87
  PangoColor *c = _SELF(self);
77
88
  return rb_ary_new3(3, INT2FIX(c->red),
@@ -79,7 +90,7 @@ color_to_a(VALUE self)
79
90
  }
80
91
 
81
92
  static VALUE
82
- color_equal(VALUE self, VALUE other)
93
+ rg_operator_color_equal(VALUE self, VALUE other)
83
94
  {
84
95
  PangoColor* c1 = _SELF(self);
85
96
  PangoColor* c2 = _SELF(other);
@@ -89,20 +100,20 @@ color_equal(VALUE self, VALUE other)
89
100
  }
90
101
 
91
102
  void
92
- Init_pango_color()
103
+ Init_pango_color(VALUE mPango)
93
104
  {
94
- VALUE pColor = G_DEF_CLASS(PANGO_TYPE_COLOR, "Color", mPango);
95
-
96
- rb_define_method(pColor, "initialize", color_initialize, 3);
97
- rb_define_method(pColor, "parse", color_parse, 1);
98
- rb_define_method(pColor, "red", color_red, 0);
99
- rb_define_method(pColor, "set_red", color_set_red, 1);
100
- rb_define_method(pColor, "green", color_green, 0);
101
- rb_define_method(pColor, "set_green", color_set_green, 1);
102
- rb_define_method(pColor, "blue", color_blue, 0);
103
- rb_define_method(pColor, "set_blue", color_set_blue, 1);
104
- rb_define_method(pColor, "to_a", color_to_a, 0);
105
- rb_define_method(pColor, "==", color_equal, 1);
106
-
107
- G_DEF_SETTERS(pColor);
105
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_COLOR, "Color", mPango);
106
+
107
+ RG_DEF_METHOD(initialize, 3);
108
+ RG_DEF_METHOD(parse, 1);
109
+ RG_DEF_METHOD(red, 0);
110
+ RG_DEF_METHOD(set_red, 1);
111
+ RG_DEF_METHOD(green, 0);
112
+ RG_DEF_METHOD(set_green, 1);
113
+ RG_DEF_METHOD(blue, 0);
114
+ RG_DEF_METHOD(set_blue, 1);
115
+ RG_DEF_METHOD(to_a, 0);
116
+ RG_DEF_METHOD_OPERATOR("==", color_equal, 1);
117
+
118
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
108
119
  }
@@ -1,26 +1,35 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangocontext.c -
5
-
6
- $Author: ggc $
7
- $Date: 2006/06/22 19:52:54 $
8
-
9
- Copyright (C) 2002-2005 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
13
-
14
- #define _SELF(self) (PANGO_CONTEXT(RVAL2GOBJ(self)))
15
- #define RVAL2DESC(v) ((PangoFontDescription*)RVAL2BOXED(v, PANGO_TYPE_FONT_DESCRIPTION))
16
- #define RVAL2LANG(v) ((PangoLanguage*)RVAL2BOXED(v, 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 cContext
25
+ #define _SELF(self) (RVAL2PANGOCONTEXT(self))
17
26
 
18
27
  static VALUE
19
- rcontext_itemize(int argc, VALUE *argv, VALUE self)
28
+ rg_itemize(int argc, VALUE *argv, VALUE self)
20
29
  {
21
30
  VALUE arg1, arg2, arg3, arg4, arg5, arg6;
22
31
  GList* list;
23
-
32
+
24
33
  rb_scan_args(argc, argv, "42", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6);
25
34
 
26
35
  if (TYPE(arg1) == T_STRING) {
@@ -28,25 +37,25 @@ rcontext_itemize(int argc, VALUE *argv, VALUE self)
28
37
  RVAL2CSTR(arg1), /* text */
29
38
  NUM2INT(arg2), /* start_index */
30
39
  NUM2INT(arg3), /* length */
31
- (PangoAttrList*)RVAL2BOXED(arg4, PANGO_TYPE_ATTR_LIST), /* attrs */
32
- NIL_P(arg5) ? NULL : (PangoAttrIterator*)RVAL2BOXED(arg5, PANGO_TYPE_ATTR_ITERATOR)); /* cached_iter */
40
+ RVAL2PANGOATTRLIST(arg4), /* attrs */
41
+ NIL_P(arg5) ? NULL : RVAL2PANGOATTRITERATOR(arg5)); /* cached_iter */
33
42
  } else {
34
43
  #ifdef HAVE_PANGO_ITEMIZE_WITH_BASE_DIR
35
44
  list = pango_itemize_with_base_dir(_SELF(self),
36
- RVAL2GENUM(arg1, PANGO_TYPE_DIRECTION), /* base_dir */
45
+ RVAL2PANGODIRECTION(arg1), /* base_dir */
37
46
  RVAL2CSTR(arg2), /* text */
38
47
  NUM2INT(arg3), /* start_index */
39
48
  NUM2INT(arg4), /* length */
40
- (PangoAttrList*)RVAL2BOXED(arg5, PANGO_TYPE_ATTR_LIST), /* attrs */
41
- NIL_P(arg6) ? NULL : (PangoAttrIterator*)RVAL2BOXED(arg6, PANGO_TYPE_ATTR_ITERATOR)); /* cached_iter */
49
+ RVAL2PANGOATTRLIST(arg5), /* attrs */
50
+ NIL_P(arg6) ? NULL : RVAL2PANGOATTRITERATOR(arg6)); /* cached_iter */
42
51
  #else
43
52
  rb_warn("Pango::Context#itemize(base_dir, text, start_index, length, attrs, cached_iter) isn't supported on this environment.");
44
53
  list = pango_itemize(_SELF(self),
45
54
  RVAL2CSTR(arg1), /* text */
46
55
  NUM2INT(arg2), /* start_index */
47
56
  NUM2INT(arg3), /* length */
48
- (PangoAttrList*)RVAL2BOXED(arg4, PANGO_TYPE_ATTR_LIST), /* attrs */
49
- NIL_P(arg5) ? NULL : (PangoAttrIterator*)RVAL2BOXED(arg5, PANGO_TYPE_ATTR_ITERATOR)); /* cached_iter */
57
+ RVAL2PANGOATTRLIST(arg4), /* attrs */
58
+ NIL_P(arg5) ? NULL : RVAL2PANGOATTRITERATOR(arg5)); /* cached_iter */
50
59
  #endif
51
60
  }
52
61
  return GLIST2ARY2F(list, PANGO_TYPE_ITEM);
@@ -58,22 +67,22 @@ GList* pango_reorder_items (GList *logical_items);
58
67
 
59
68
  #ifdef PANGO_ENABLE_BACKEND
60
69
  static VALUE
61
- rcontext_initialize(VALUE self)
70
+ rg_initialize(VALUE self)
62
71
  {
63
72
  G_INITIALIZE(self, pango_context_new());
64
73
  return Qnil;
65
74
  }
66
75
 
67
76
  static VALUE
68
- rcontext_set_font_map(VALUE self, VALUE font_map)
77
+ rg_set_font_map(VALUE self, VALUE font_map)
69
78
  {
70
- pango_context_set_font_map(_SELF(self), PANGO_FONT_MAP(RVAL2GOBJ(font_map)));
79
+ pango_context_set_font_map(_SELF(self), RVAL2PANGOFONTMAP(font_map));
71
80
  return self;
72
81
  }
73
82
 
74
83
  #if PANGO_CHECK_VERSION(1,6,0)
75
84
  static VALUE
76
- rcontext_get_font_map(VALUE self)
85
+ rg_font_map(VALUE self)
77
86
  {
78
87
  return GOBJ2RVAL(pango_context_get_font_map(_SELF(self)));
79
88
  }
@@ -81,120 +90,119 @@ rcontext_get_font_map(VALUE self)
81
90
  #endif /* PANGO_ENABLE_BACKEND */
82
91
 
83
92
  static VALUE
84
- rcontext_get_font_description(VALUE self)
93
+ rg_font_description(VALUE self)
85
94
  {
86
95
  PangoFontDescription* ret = pango_context_get_font_description(_SELF(self));
87
- return BOXED2RVAL(ret, PANGO_TYPE_FONT_DESCRIPTION);
96
+ return PANGOFONTDESCRIPTION2RVAL(ret);
88
97
  }
89
98
 
90
99
  static VALUE
91
- rcontext_set_font_description(VALUE self, VALUE desc)
100
+ rg_set_font_description(VALUE self, VALUE desc)
92
101
  {
93
- pango_context_set_font_description(_SELF(self), RVAL2DESC(desc));
102
+ pango_context_set_font_description(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc));
94
103
  return self;
95
104
  }
96
105
 
97
106
  static VALUE
98
- rcontext_get_language(VALUE self)
107
+ rg_language(VALUE self)
99
108
  {
100
109
  PangoLanguage* ret = pango_context_get_language(_SELF(self));
101
- return BOXED2RVAL(ret, PANGO_TYPE_LANGUAGE);
110
+ return PANGOLANGUAGE2RVAL(ret);
102
111
  }
103
112
 
104
113
  static VALUE
105
- rcontext_set_language(VALUE self, VALUE lang)
114
+ rg_set_language(VALUE self, VALUE lang)
106
115
  {
107
116
  pango_context_set_language(_SELF(self),
108
- RVAL2LANG(lang));
117
+ RVAL2PANGOLANGUAGE(lang));
109
118
  return self;
110
119
  }
111
120
 
112
121
  static VALUE
113
- rcontext_get_base_dir(VALUE self)
122
+ rg_base_dir(VALUE self)
114
123
  {
115
- return GENUM2RVAL(pango_context_get_base_dir(_SELF(self)), PANGO_TYPE_DIRECTION);
124
+ return PANGODIRECTION2RVAL(pango_context_get_base_dir(_SELF(self)));
116
125
  }
117
126
 
118
127
  static VALUE
119
- rcontext_set_base_dir(VALUE self, VALUE direction)
128
+ rg_set_base_dir(VALUE self, VALUE direction)
120
129
  {
121
- pango_context_set_base_dir(_SELF(self), RVAL2GENUM(direction, PANGO_TYPE_DIRECTION));
130
+ pango_context_set_base_dir(_SELF(self), RVAL2PANGODIRECTION(direction));
122
131
  return self;
123
132
  }
124
133
 
125
134
  #if PANGO_CHECK_VERSION(1,16,0)
126
135
  static VALUE
127
- rcontext_get_base_gravity(VALUE self)
136
+ rg_base_gravity(VALUE self)
128
137
  {
129
- return GENUM2RVAL(pango_context_get_base_gravity(_SELF(self)), PANGO_TYPE_GRAVITY);
138
+ return PANGOGRAVITY2RVAL(pango_context_get_base_gravity(_SELF(self)));
130
139
  }
131
140
 
132
141
  static VALUE
133
- rcontext_set_base_gravity(VALUE self, VALUE gravity)
142
+ rg_set_base_gravity(VALUE self, VALUE gravity)
134
143
  {
135
- pango_context_set_base_gravity(_SELF(self), RVAL2GENUM(gravity, PANGO_TYPE_GRAVITY));
144
+ pango_context_set_base_gravity(_SELF(self), RVAL2PANGOGRAVITY(gravity));
136
145
  return self;
137
146
  }
138
147
 
139
148
  static VALUE
140
- rcontext_get_gravity_hint(VALUE self)
149
+ rg_gravity_hint(VALUE self)
141
150
  {
142
- return GENUM2RVAL(pango_context_get_gravity_hint(_SELF(self)), PANGO_TYPE_GRAVITY_HINT);
151
+ return PANGOGRAVITYHINT2RVAL(pango_context_get_gravity_hint(_SELF(self)));
143
152
  }
144
153
 
145
154
  static VALUE
146
- rcontext_set_gravity_hint(VALUE self, VALUE gravity_hint)
155
+ rg_set_gravity_hint(VALUE self, VALUE gravity_hint)
147
156
  {
148
- pango_context_set_gravity_hint(_SELF(self), RVAL2GENUM(gravity_hint, PANGO_TYPE_GRAVITY_HINT));
157
+ pango_context_set_gravity_hint(_SELF(self), RVAL2PANGOGRAVITYHINT(gravity_hint));
149
158
  return self;
150
159
  }
151
160
  #endif
152
161
 
153
162
  #if PANGO_CHECK_VERSION(1,6,0)
154
163
  static VALUE
155
- rcontext_get_matrix(VALUE self)
164
+ rg_matrix(VALUE self)
156
165
  {
157
166
  const PangoMatrix* matrix = pango_context_get_matrix(_SELF(self));
158
- return BOXED2RVAL((PangoMatrix*)matrix, PANGO_TYPE_MATRIX);
167
+ return PANGOMATRIX2RVAL((PangoMatrix*)matrix);
159
168
  }
160
169
 
161
170
  static VALUE
162
- rcontext_set_matrix(VALUE self, VALUE matrix)
171
+ rg_set_matrix(VALUE self, VALUE matrix)
163
172
  {
164
173
  pango_context_set_matrix(_SELF(self),
165
- (PangoMatrix*)RVAL2BOXED(matrix, PANGO_TYPE_MATRIX));
174
+ RVAL2PANGOMATRIX(matrix));
166
175
  return self;
167
176
  }
168
177
  #endif
169
178
 
170
179
  static VALUE
171
- rcontext_load_font(VALUE self, VALUE desc)
180
+ rg_load_font(VALUE self, VALUE desc)
172
181
  {
173
- return GOBJ2RVAL(pango_context_load_font(_SELF(self), RVAL2DESC(desc)));
182
+ return GOBJ2RVAL(pango_context_load_font(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc)));
174
183
  }
175
184
 
176
185
  static VALUE
177
- rcontext_load_fontset(VALUE self, VALUE desc, VALUE lang)
186
+ rg_load_fontset(VALUE self, VALUE desc, VALUE lang)
178
187
  {
179
188
  return GOBJ2RVAL(pango_context_load_fontset(_SELF(self),
180
- RVAL2DESC(desc), RVAL2LANG(lang)));
189
+ RVAL2PANGOFONTDESCRIPTION(desc), RVAL2PANGOLANGUAGE(lang)));
181
190
  }
182
191
 
183
192
  static VALUE
184
- rcontext_get_metrics(int argc, VALUE *argv, VALUE self)
193
+ rg_get_metrics(int argc, VALUE *argv, VALUE self)
185
194
  {
186
195
  VALUE desc, lang;
187
196
 
188
197
  rb_scan_args(argc, argv, "11", &desc, &lang);
189
198
 
190
- return BOXED2RVAL(pango_context_get_metrics(_SELF(self),
191
- RVAL2DESC(desc),
192
- NIL_P(lang) ? NULL : RVAL2LANG(lang)),
193
- PANGO_TYPE_FONT_METRICS);
199
+ return PANGOFONTMETRICS2RVAL(pango_context_get_metrics(_SELF(self),
200
+ RVAL2PANGOFONTDESCRIPTION(desc),
201
+ NIL_P(lang) ? NULL : RVAL2PANGOLANGUAGE(lang)));
194
202
  }
195
203
 
196
204
  static VALUE
197
- rcontext_list_families(VALUE self)
205
+ rg_families(VALUE self)
198
206
  {
199
207
  int n_families;
200
208
  PangoFontFamily** families;
@@ -215,9 +223,9 @@ rcontext_list_families(VALUE self)
215
223
  }
216
224
 
217
225
  #if PANGO_CHECK_VERSION(1,10,0)
218
- # if HAVE_RB_CAIRO_H
226
+ # ifdef HAVE_RB_CAIRO_H
219
227
  static VALUE
220
- rcontext_set_font_options(VALUE self, VALUE options)
228
+ rg_set_font_options(VALUE self, VALUE options)
221
229
  {
222
230
  if (NIL_P(options))
223
231
  pango_cairo_context_set_font_options(_SELF(self), NULL);
@@ -228,7 +236,7 @@ rcontext_set_font_options(VALUE self, VALUE options)
228
236
  }
229
237
 
230
238
  static VALUE
231
- rcontext_get_font_options(VALUE self)
239
+ rg_font_options(VALUE self)
232
240
  {
233
241
  const cairo_font_options_t *options;
234
242
  options = pango_cairo_context_get_font_options(_SELF(self));
@@ -239,78 +247,77 @@ rcontext_get_font_options(VALUE self)
239
247
  }
240
248
 
241
249
  static VALUE
242
- rcontext_set_resolution(VALUE self, VALUE dpi)
250
+ rg_set_resolution(VALUE self, VALUE dpi)
243
251
  {
244
252
  pango_cairo_context_set_resolution(_SELF(self), NUM2DBL(dpi));
245
253
  return self;
246
254
  }
247
255
 
248
256
  static VALUE
249
- rcontext_get_resolution(VALUE self)
257
+ rg_resolution(VALUE self)
250
258
  {
251
259
  return rb_float_new(pango_cairo_context_get_resolution(_SELF(self)));
252
260
  }
253
261
  # endif
254
262
  #endif
255
263
 
256
-
257
264
  static VALUE
258
- rcontext_list_families_old(VALUE self)
265
+ rg_list_families(VALUE self)
259
266
  {
260
267
  rb_warn("Deprecated. Use Pango::Context#families instead.");
261
- return rcontext_list_families(self);
268
+ return rg_families(self);
262
269
  }
263
270
 
264
271
  void
265
- Init_pango_context()
272
+ Init_pango_context(VALUE mPango)
266
273
  {
267
- VALUE pContext = G_DEF_CLASS(PANGO_TYPE_CONTEXT, "Context", mPango);
274
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_CONTEXT, "Context", mPango);
268
275
 
269
- rb_define_method(pContext, "itemize", rcontext_itemize, -1);
276
+ RG_DEF_METHOD(itemize, -1);
270
277
 
271
278
  #ifdef PANGO_ENABLE_BACKEND
272
- rb_define_method(pContext, "initialize", rcontext_initialize, 0);
273
- rb_define_method(pContext, "set_font_map", rcontext_set_font_map, 1);
279
+ RG_DEF_METHOD(initialize, 0);
280
+ RG_DEF_METHOD(set_font_map, 1);
274
281
  #if PANGO_CHECK_VERSION(1,6,0)
275
- rb_define_method(pContext, "font_map", rcontext_get_font_map, 0);
282
+ RG_DEF_METHOD(font_map, 0);
276
283
  #endif
277
284
  #endif /* PANGO_ENABLE_BACKEND */
278
- rb_define_method(pContext, "font_description", rcontext_get_font_description, 0);
279
- rb_define_method(pContext, "set_font_description", rcontext_set_font_description, 1);
280
- rb_define_method(pContext, "language", rcontext_get_language, 0);
281
- rb_define_method(pContext, "set_language", rcontext_set_language, 1);
282
- rb_define_method(pContext, "base_dir", rcontext_get_base_dir, 0);
283
- rb_define_method(pContext, "set_base_dir", rcontext_set_base_dir, 1);
285
+ RG_DEF_METHOD(font_description, 0);
286
+ RG_DEF_METHOD(set_font_description, 1);
287
+ RG_DEF_METHOD(language, 0);
288
+ RG_DEF_METHOD(set_language, 1);
289
+ RG_DEF_METHOD(base_dir, 0);
290
+ RG_DEF_METHOD(set_base_dir, 1);
284
291
  #if PANGO_CHECK_VERSION(1,16,0)
285
- rb_define_method(pContext, "base_gravity", rcontext_get_base_gravity, 0);
286
- rb_define_method(pContext, "set_base_gravity", rcontext_set_base_gravity, 1);
287
- rb_define_method(pContext, "gravity_hint", rcontext_get_gravity_hint, 0);
288
- rb_define_method(pContext, "set_gravity_hint", rcontext_set_gravity_hint, 1);
292
+ RG_DEF_METHOD(base_gravity, 0);
293
+ RG_DEF_METHOD(set_base_gravity, 1);
294
+ RG_DEF_METHOD(gravity_hint, 0);
295
+ RG_DEF_METHOD(set_gravity_hint, 1);
289
296
  #endif
290
297
  #if PANGO_CHECK_VERSION(1,6,0)
291
- rb_define_method(pContext, "matrix", rcontext_get_matrix, 0);
292
- rb_define_method(pContext, "set_matrix", rcontext_set_matrix, 1);
298
+ RG_DEF_METHOD(matrix, 0);
299
+ RG_DEF_METHOD(set_matrix, 1);
293
300
  #endif
294
- rb_define_method(pContext, "load_font", rcontext_load_font, 1);
295
- rb_define_method(pContext, "load_fontset", rcontext_load_fontset, 2);
296
- rb_define_method(pContext, "get_metrics", rcontext_get_metrics, -1);
297
- rb_define_method(pContext, "families", rcontext_list_families, 0);
301
+ RG_DEF_METHOD(load_font, 1);
302
+ RG_DEF_METHOD(load_fontset, 2);
303
+ RG_DEF_METHOD(get_metrics, -1);
304
+ RG_DEF_METHOD(families, 0);
298
305
 
299
306
  #if PANGO_CHECK_VERSION(1,10,0)
300
- # if HAVE_RB_CAIRO_H
301
- rb_define_method(pContext, "set_font_options", rcontext_set_font_options, 1);
302
- rb_define_method(pContext, "font_options", rcontext_get_font_options, 0);
303
- rb_define_method(pContext, "set_resolution", rcontext_set_resolution, 1);
304
- rb_define_method(pContext, "resolution", rcontext_get_resolution, 0);
307
+ # ifdef HAVE_RB_CAIRO_H
308
+ RG_DEF_METHOD(set_font_options, 1);
309
+ RG_DEF_METHOD(font_options, 0);
310
+ RG_DEF_METHOD(set_resolution, 1);
311
+ RG_DEF_METHOD(resolution, 0);
305
312
  # endif
306
313
  #endif
307
-
314
+
308
315
  /* This will remove 2 or 3 releases later since 0.14.0. */
309
- rb_define_method(pContext, "list_families", rcontext_list_families_old, 0);
316
+ RG_DEF_METHOD(list_families, 0);
310
317
 
311
- G_DEF_SETTERS(pContext);
318
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
312
319
 
313
320
  /* PangoDirection */
314
- G_DEF_CLASS(PANGO_TYPE_DIRECTION, "Direction", pContext);
315
- G_DEF_CONSTANTS(pContext, PANGO_TYPE_DIRECTION, "PANGO_");
321
+ G_DEF_CLASS(PANGO_TYPE_DIRECTION, "Direction", RG_TARGET_NAMESPACE);
322
+ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_DIRECTION, "PANGO_");
316
323
  }