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,50 +1,60 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangofontsetsimple.c -
5
-
6
- $Author: mutoh $
7
- $Date: 2005/10/14 09:55:57 $
8
-
9
- Copyright (C) 2002,2003 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
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"
13
23
 
14
24
  #ifdef PANGO_ENABLE_BACKEND
15
25
 
16
- #define _SELF(self) (PANGO_FONTSET_SIMPLE(RVAL2GOBJ(self)))
17
- #define RVAL2LANG(v) ((PangoLanguage*)RVAL2BOXED(v, PANGO_TYPE_LANGUAGE))
26
+ #define RG_TARGET_NAMESPACE cFontsetSimple
27
+ #define _SELF(self) (RVAL2PANGOFONTSETSIMPLE(self))
18
28
 
19
29
  static VALUE
20
- fontset_simple_initialize(VALUE self, VALUE lang)
30
+ rg_initialize(VALUE self, VALUE lang)
21
31
  {
22
- G_INITIALIZE(self, pango_fontset_simple_new(RVAL2LANG(lang)));
32
+ G_INITIALIZE(self, pango_fontset_simple_new(RVAL2PANGOLANGUAGE(lang)));
23
33
  return Qnil;
24
34
  }
25
35
 
26
36
  static VALUE
27
- fontset_simple_append(VALUE self, VALUE font)
37
+ rg_append(VALUE self, VALUE font)
28
38
  {
29
- pango_fontset_simple_append(_SELF(self), PANGO_FONT(RVAL2GOBJ(font)));
39
+ pango_fontset_simple_append(_SELF(self), RVAL2PANGOFONT(font));
30
40
  return self;
31
41
  }
32
42
 
33
43
  static VALUE
34
- fontset_simple_size(VALUE self)
44
+ rg_size(VALUE self)
35
45
  {
36
46
  return INT2NUM(pango_fontset_simple_size(_SELF(self)));
37
47
  }
38
48
 
39
49
  #endif
40
50
  void
41
- Init_pango_fontset_simple()
51
+ Init_pango_fontset_simple(VALUE mPango)
42
52
  {
43
53
  #ifdef PANGO_ENABLE_BACKEND
44
- VALUE pFSimple = G_DEF_CLASS(PANGO_TYPE_FONTSET_SIMPLE, "FontsetSimple", mPango);
45
-
46
- rb_define_method(pFSimple, "initialize", fontset_simple_initialize, 1);
47
- rb_define_method(pFSimple, "append", fontset_simple_append, 1);
48
- rb_define_method(pFSimple, "size", fontset_simple_size, 0);
54
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONTSET_SIMPLE, "FontsetSimple", mPango);
55
+
56
+ RG_DEF_METHOD(initialize, 1);
57
+ RG_DEF_METHOD(append, 1);
58
+ RG_DEF_METHOD(size, 0);
49
59
  #endif
50
60
  }
@@ -1,27 +1,40 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangoglyphinfo.c -
5
-
6
- $Author: ggc $
7
- $Date: 2007/07/13 16:07:33 $
8
-
9
- Copyright (C) 2005 Masao Mutoh
10
- ************************************************/
11
-
12
- #include "rbpango.h"
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
+ */
13
21
 
14
- #define _SELF(self) ((PangoGlyphInfo*)RVAL2BOXED(self, PANGO_TYPE_GLYPH_INFO))
22
+ #include "rbpangoprivate.h"
15
23
 
24
+ #define RG_TARGET_NAMESPACE cGlyphInfo
25
+ #define _SELF(self) (RVAL2PANGOGLYPHINFO(self))
16
26
 
17
27
  /**********************************/
18
- PangoGlyphInfo*
19
- pango_glyph_info_copy (const PangoGlyphInfo* info)
28
+ static PangoGlyphInfo *
29
+ pango_glyph_info_copy(const PangoGlyphInfo *info)
20
30
  {
21
- PangoGlyphInfo* data;
22
- g_return_val_if_fail (info != NULL, NULL);
31
+ PangoGlyphInfo *data;
32
+
33
+ g_return_val_if_fail(info != NULL, NULL);
34
+
23
35
  data = g_new(PangoGlyphInfo, 1);
24
36
  *data = *info;
37
+
25
38
  return data;
26
39
  }
27
40
 
@@ -39,27 +52,27 @@ pango_glyph_info_get_type(void)
39
52
  /**********************************/
40
53
 
41
54
  static VALUE
42
- gi_initialize(VALUE self)
55
+ rg_initialize(VALUE self)
43
56
  {
44
57
  G_INITIALIZE(self, g_new0(PangoGlyphInfo, 1));
45
58
  return Qnil;
46
59
  }
47
60
 
48
61
  static VALUE
49
- gi_glyph(VALUE self)
62
+ rg_glyph(VALUE self)
50
63
  {
51
64
  return UINT2NUM(_SELF(self)->glyph);
52
65
  }
53
66
 
54
67
  static VALUE
55
- gi_set_glyph(VALUE self, VALUE val)
68
+ rg_set_glyph(VALUE self, VALUE val)
56
69
  {
57
70
  _SELF(self)->glyph = NUM2UINT(val);
58
71
  return self;
59
72
  }
60
73
 
61
74
  static VALUE
62
- gi_geometry(VALUE self)
75
+ rg_geometry(VALUE self)
63
76
  {
64
77
  PangoGlyphGeometry geo = _SELF(self)->geometry;
65
78
 
@@ -68,7 +81,7 @@ gi_geometry(VALUE self)
68
81
  }
69
82
 
70
83
  static VALUE
71
- gi_set_geometry(VALUE self, VALUE width, VALUE x_offset, VALUE y_offset)
84
+ rg_set_geometry(VALUE self, VALUE width, VALUE x_offset, VALUE y_offset)
72
85
  {
73
86
  PangoGlyphGeometry geo = _SELF(self)->geometry;
74
87
 
@@ -83,30 +96,30 @@ gi_set_geometry(VALUE self, VALUE width, VALUE x_offset, VALUE y_offset)
83
96
  This method may be changed in the future following Pango implementation.
84
97
  */
85
98
  static VALUE
86
- gi_attr_is_cluster_start(VALUE self)
99
+ rg_cluster_start_p(VALUE self)
87
100
  {
88
101
  return CBOOL2RVAL(_SELF(self)->attr.is_cluster_start);
89
102
  }
90
103
 
91
104
  static VALUE
92
- gi_attr_set_is_cluster_start(VALUE self, VALUE val)
105
+ rg_set_cluster_start(VALUE self, VALUE val)
93
106
  {
94
107
  _SELF(self)->attr.is_cluster_start = RVAL2CBOOL(val);
95
108
  return self;
96
109
  }
97
110
 
98
111
  void
99
- Init_pango_glyph_info()
112
+ Init_pango_glyph_info(VALUE mPango)
100
113
  {
101
- VALUE pInfo = G_DEF_CLASS(PANGO_TYPE_GLYPH_INFO, "GlyphInfo", mPango);
102
-
103
- rb_define_method(pInfo, "initialize", gi_initialize, 0);
104
- rb_define_method(pInfo, "glyph", gi_glyph, 0);
105
- rb_define_method(pInfo, "set_glyph", gi_set_glyph, 1);
106
- rb_define_method(pInfo, "geometry", gi_geometry, 0);
107
- rb_define_method(pInfo, "set_geometry", gi_set_geometry, 3);
108
- rb_define_method(pInfo, "cluster_start?", gi_attr_is_cluster_start, 0);
109
- rb_define_method(pInfo, "set_cluster_start", gi_attr_set_is_cluster_start, 1);
110
-
111
- G_DEF_SETTERS(pInfo);
114
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_INFO, "GlyphInfo", mPango);
115
+
116
+ RG_DEF_METHOD(initialize, 0);
117
+ RG_DEF_METHOD(glyph, 0);
118
+ RG_DEF_METHOD(set_glyph, 1);
119
+ RG_DEF_METHOD(geometry, 0);
120
+ RG_DEF_METHOD(set_geometry, 3);
121
+ RG_DEF_METHOD_P(cluster_start, 0);
122
+ RG_DEF_METHOD(set_cluster_start, 1);
123
+
124
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
112
125
  }
@@ -1,18 +1,29 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangoglyphitem.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"
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"
13
23
 
14
24
  #if PANGO_CHECK_VERSION(1,2,0)
15
- #define _SELF(r) ((PangoGlyphItem*)RVAL2BOXED(r, PANGO_TYPE_GLYPH_ITEM))
25
+ #define RG_TARGET_NAMESPACE cGlyphItem
26
+ #define _SELF(r) (RVAL2PANGOGLYPHITEM(r))
16
27
 
17
28
  /**********************************/
18
29
  #ifndef HAVE_PANGO_GLYPH_ITEM_GET_TYPE
@@ -53,50 +64,50 @@ pango_glyph_item_get_type(void)
53
64
  /**********************************/
54
65
 
55
66
  static VALUE
56
- glyph_item_get_item(VALUE self)
67
+ rg_item(VALUE self)
57
68
  {
58
69
  PangoItem* item = _SELF(self)->item;
59
- return BOXED2RVAL(item, PANGO_TYPE_ITEM);
70
+ return PANGOITEM2RVAL(item);
60
71
  }
61
72
 
62
73
  static VALUE
63
- glyph_item_get_glyphs(VALUE self)
74
+ rg_glyphs(VALUE self)
64
75
  {
65
76
  PangoGlyphString* glyphs = _SELF(self)->glyphs;
66
- return BOXED2RVAL(glyphs, PANGO_TYPE_GLYPH_STRING);
77
+ return PANGOGLYPHSTRING2RVAL(glyphs);
67
78
  }
68
79
 
69
80
  static VALUE
70
- glyph_item_split(VALUE self, VALUE text, VALUE split_index)
81
+ rg_split(VALUE self, VALUE text, VALUE split_index)
71
82
  {
72
- return BOXED2RVAL(pango_glyph_item_split(_SELF(self), RVAL2CSTR(text),
73
- NUM2INT(split_index)), PANGO_TYPE_GLYPH_ITEM);
83
+ return PANGOGLYPHITEM2RVAL(pango_glyph_item_split(_SELF(self), RVAL2CSTR(text),
84
+ NUM2INT(split_index)));
74
85
  }
75
86
 
76
87
  static VALUE
77
- glyph_item_apply_attrs(VALUE self, VALUE text, VALUE attrs)
88
+ rg_appy_attrs(VALUE self, VALUE text, VALUE attrs)
78
89
  {
79
90
  GSList* list = pango_glyph_item_apply_attrs(_SELF(self), RVAL2CSTR(text),
80
- (PangoAttrList*)RVAL2BOXED(attrs, PANGO_TYPE_ATTR_LIST));
91
+ RVAL2PANGOATTRLIST(attrs));
81
92
 
82
93
  VALUE ret = rb_ary_new();
83
94
 
84
95
  while (list) {
85
- rb_ary_push(ret, BOXED2RVAL(list->data, PANGO_TYPE_GLYPH_ITEM));
96
+ rb_ary_push(ret, PANGOGLYPHITEM2RVAL(list->data));
86
97
  pango_glyph_item_free(list->data);
87
98
  list = list->next;
88
99
  }
89
-
100
+
90
101
  g_slist_free(list);
91
102
  return ret;
92
103
  }
93
104
 
94
105
  #if PANGO_CHECK_VERSION(1,6,0)
95
106
  static VALUE
96
- glyph_item_letter_space(VALUE self, VALUE text, VALUE log_attrs, VALUE letter_spacing)
107
+ rg_letter_space(VALUE self, VALUE text, VALUE log_attrs, VALUE letter_spacing)
97
108
  {
98
109
  pango_glyph_item_letter_space(_SELF(self), RVAL2CSTR(text),
99
- (PangoLogAttr*)RVAL2BOXED(log_attrs, PANGO_TYPE_LOG_ATTR),
110
+ RVAL2PANGOLOGATTR(log_attrs),
100
111
  NUM2INT(letter_spacing));
101
112
  return self;
102
113
  }
@@ -104,20 +115,19 @@ glyph_item_letter_space(VALUE self, VALUE text, VALUE log_attrs, VALUE letter_sp
104
115
  #endif
105
116
 
106
117
  void
107
- Init_pango_glyph_item()
118
+ Init_pango_glyph_item(VALUE mPango)
108
119
  {
109
120
  #if PANGO_CHECK_VERSION(1,2,0)
110
- VALUE pItem = G_DEF_CLASS(PANGO_TYPE_GLYPH_ITEM, "GlyphItem", mPango);
121
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_ITEM, "GlyphItem", mPango);
111
122
 
112
- rb_define_method(pItem, "item", glyph_item_get_item, 0);
113
- rb_define_method(pItem, "glyphs", glyph_item_get_glyphs, 0);
123
+ RG_DEF_METHOD(item, 0);
124
+ RG_DEF_METHOD(glyphs, 0);
114
125
 
115
- rb_define_method(pItem, "split", glyph_item_split, 2);
116
- rb_define_method(pItem, "appy_attrs", glyph_item_apply_attrs, 2);
126
+ RG_DEF_METHOD(split, 2);
127
+ RG_DEF_METHOD(appy_attrs, 2);
117
128
 
118
129
  #if PANGO_CHECK_VERSION(1,6,0)
119
- rb_define_method(pItem, "letter_space", glyph_item_letter_space, 3);
130
+ RG_DEF_METHOD(letter_space, 3);
120
131
  #endif
121
132
  #endif
122
133
  }
123
-
@@ -1,34 +1,45 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangoglyphstring.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) ((PangoGlyphString*)(RVAL2BOXED(self, PANGO_TYPE_GLYPH_STRING)))
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 cGlyphString
25
+ #define _SELF(self) (RVAL2PANGOGLYPHSTRING(self))
15
26
 
16
27
  static VALUE
17
- rglyph_initialize(VALUE self)
28
+ rg_initialize(VALUE self)
18
29
  {
19
30
  G_INITIALIZE(self, pango_glyph_string_new());
20
31
  return Qnil;
21
32
  }
22
33
 
23
34
  static VALUE
24
- rglyph_set_size(VALUE self, VALUE len)
35
+ rg_set_size(VALUE self, VALUE len)
25
36
  {
26
37
  pango_glyph_string_set_size(_SELF(self), NUM2INT(len));
27
38
  return self;
28
39
  }
29
40
 
30
41
  static VALUE
31
- rglyph_extents(int argc, VALUE *argv, VALUE self)
42
+ rg_extents(int argc, VALUE *argv, VALUE self)
32
43
  {
33
44
  VALUE font, start_index, end_index;
34
45
  PangoRectangle ink_rect;
@@ -38,29 +49,29 @@ rglyph_extents(int argc, VALUE *argv, VALUE self)
38
49
 
39
50
  if (NIL_P(start_index)){
40
51
  pango_glyph_string_extents(_SELF(self),
41
- PANGO_FONT(RVAL2GOBJ(font)),
52
+ RVAL2PANGOFONT(font),
42
53
  &ink_rect, &logical_rect);
43
54
  } else {
44
55
  pango_glyph_string_extents_range(_SELF(self),
45
56
  NUM2INT(start_index), NUM2INT(end_index),
46
- PANGO_FONT(RVAL2GOBJ(font)),
57
+ RVAL2PANGOFONT(font),
47
58
  &ink_rect, &logical_rect);
48
59
  }
49
60
 
50
- return rb_assoc_new(BOXED2RVAL(&ink_rect, PANGO_TYPE_RECTANGLE),
51
- BOXED2RVAL(&logical_rect, PANGO_TYPE_RECTANGLE));
61
+ return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
62
+ PANGORECTANGLE2RVAL(&logical_rect));
52
63
  }
53
64
 
54
65
  #if PANGO_CHECK_VERSION(1,14,0)
55
66
  static VALUE
56
- rglyph_get_width(VALUE self)
67
+ rg_width(VALUE self)
57
68
  {
58
69
  return INT2NUM(pango_glyph_string_get_width(_SELF(self)));
59
70
  }
60
71
  #endif
61
72
 
62
73
  static VALUE
63
- rglyph_index_to_x(VALUE self, VALUE text, VALUE analysis, VALUE index, VALUE trailing)
74
+ rg_index_to_x(VALUE self, VALUE text, VALUE analysis, VALUE index, VALUE trailing)
64
75
  {
65
76
  int x_pos;
66
77
  StringValue(text);
@@ -70,14 +81,14 @@ rglyph_index_to_x(VALUE self, VALUE text, VALUE analysis, VALUE index, VALUE tra
70
81
  * pango_glyph_string_index_to_x */
71
82
  (char *)RSTRING_PTR(text),
72
83
  RSTRING_LEN(text),
73
- (PangoAnalysis*)RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS),
84
+ RVAL2PANGOANALYSIS(analysis),
74
85
  NUM2INT(index), RVAL2CBOOL(trailing),
75
86
  &x_pos);
76
87
  return INT2NUM(x_pos);
77
88
  }
78
89
 
79
90
  static VALUE
80
- rglyph_x_to_index(VALUE self, VALUE text, VALUE analysis, VALUE x_pos)
91
+ rg_x_to_index(VALUE self, VALUE text, VALUE analysis, VALUE x_pos)
81
92
  {
82
93
  int index;
83
94
  int trailing;
@@ -88,41 +99,30 @@ rglyph_x_to_index(VALUE self, VALUE text, VALUE analysis, VALUE x_pos)
88
99
  * pango_glyph_string_index_to_x */
89
100
  (char *)RSTRING_PTR(text),
90
101
  RSTRING_LEN(text),
91
- (PangoAnalysis*)RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS),
102
+ RVAL2PANGOANALYSIS(analysis),
92
103
  NUM2INT(x_pos),
93
104
  &index, &trailing);
94
105
  return rb_assoc_new(INT2NUM(index), CBOOL2RVAL(trailing));
95
106
  }
96
107
 
97
108
  static VALUE
98
- rglyph_get_logical_widgths(VALUE self, VALUE text, VALUE embedding_level)
109
+ rg_get_logical_widths(VALUE self, VALUE rbtext, VALUE rbembedding_level)
99
110
  {
100
- int *logical_widths = NULL;
101
- int len, array_len, i;
102
- const char *gtext;
103
- VALUE ret;
104
-
105
- gtext = RVAL2CSTR(text);
106
- len = RSTRING_LEN(text);
107
-
108
- array_len = g_utf8_strlen(gtext, len);
109
-
110
- logical_widths = g_new(PangoGlyphUnit, array_len);
111
-
112
- pango_glyph_string_get_logical_widths(_SELF(self), gtext, len,
113
- NUM2INT(embedding_level),
111
+ PangoGlyphString *glyphs = _SELF(self);
112
+ const char *text = RVAL2CSTR(rbtext);
113
+ long length = RSTRING_LEN(rbtext);
114
+ int embedding_level = NUM2INT(rbembedding_level);
115
+ glong n = g_utf8_strlen(text, length);
116
+ int *logical_widths = g_new(int, n);
117
+
118
+ pango_glyph_string_get_logical_widths(glyphs, text, length, embedding_level,
114
119
  logical_widths);
115
120
 
116
- ret = rb_ary_new();
117
- for (i = 0; i < array_len; i++){
118
- rb_ary_push(ret, INT2NUM(logical_widths[i]));
119
- }
120
-
121
- return ret;
121
+ return GINTS2RVAL_FREE(logical_widths, n);
122
122
  }
123
123
 
124
124
  static VALUE
125
- rglyph_get_glyphs(VALUE self)
125
+ rg_glyphs(VALUE self)
126
126
  {
127
127
  int i;
128
128
  PangoGlyphInfo** glyphs = &_SELF(self)->glyphs;
@@ -131,27 +131,27 @@ rglyph_get_glyphs(VALUE self)
131
131
  VALUE ret = rb_ary_new();
132
132
  for (i = 0; i < _SELF(self)->num_glyphs; i++) {
133
133
  rb_ary_push(ret,
134
- rb_assoc_new(BOXED2RVAL(glyphs[i], PANGO_TYPE_GLYPH_INFO),
134
+ rb_assoc_new(PANGOGLYPHINFO2RVAL(glyphs[i]),
135
135
  INT2NUM(log_clusters[i])));
136
136
  }
137
137
  return ret;
138
138
  }
139
139
 
140
140
  void
141
- Init_pango_glyph_string()
141
+ Init_pango_glyph_string(VALUE mPango)
142
142
  {
143
- VALUE pGlyph = G_DEF_CLASS(PANGO_TYPE_GLYPH_STRING, "GlyphString", mPango);
143
+ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_STRING, "GlyphString", mPango);
144
144
 
145
- rb_define_method(pGlyph, "initialize", rglyph_initialize, 0);
146
- rb_define_method(pGlyph, "set_size", rglyph_set_size, 1);
147
- rb_define_method(pGlyph, "extents", rglyph_extents, -1);
145
+ RG_DEF_METHOD(initialize, 0);
146
+ RG_DEF_METHOD(set_size, 1);
147
+ RG_DEF_METHOD(extents, -1);
148
148
  #if PANGO_CHECK_VERSION(1,14,0)
149
- rb_define_method(pGlyph, "width", rglyph_get_width, 0);
149
+ RG_DEF_METHOD(width, 0);
150
150
  #endif
151
- rb_define_method(pGlyph, "index_to_x", rglyph_index_to_x, 4);
152
- rb_define_method(pGlyph, "x_to_index", rglyph_x_to_index, 3);
153
- rb_define_method(pGlyph, "get_logical_widths", rglyph_get_logical_widgths, 2);
154
- rb_define_method(pGlyph, "glyphs", rglyph_get_glyphs, 0);
151
+ RG_DEF_METHOD(index_to_x, 4);
152
+ RG_DEF_METHOD(x_to_index, 3);
153
+ RG_DEF_METHOD(get_logical_widths, 2);
154
+ RG_DEF_METHOD(glyphs, 0);
155
155
 
156
- G_DEF_SETTERS(pGlyph);
156
+ G_DEF_SETTERS(RG_TARGET_NAMESPACE);
157
157
  }