pango 1.0.0-x86-mingw32 → 1.0.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,17 @@
1
+ 2011-09-16 Nikolai Weibull <now@bitwi.se>
2
+
3
+ * lib/pango.rb: Remove unused variable.
4
+
5
+ 2011-09-12 Nikolai Weibull <now@bitwi.se>
6
+
7
+ * ext/pango/*.c: Call StringValue() before calling
8
+ RSTRING_PTR()/RSTRING_LEN(); also use RSTRING_PTR() instead of
9
+ RVAL2CSTR() if StringValue() has already been called on the value.
10
+
11
+ 2011-09-09 Nikolai Weibull <now@bitwi.se>
12
+
13
+ * ext/pango/*.c: Fix all RVAL2CSTR calls.
14
+
1
15
  2011-02-26 Kouhei Sutou <kou@cozmixng.org>
2
16
 
3
17
  * ext/pango/extconf.rb: remove needless add_distcleanfile.
@@ -27,7 +27,7 @@ pango_get_attribute_klass(VALUE attr_type)
27
27
  {
28
28
  VALUE type = Qnil;
29
29
  if (TYPE(attr_type) == T_STRING){
30
- char* strtype = RVAL2CSTR(attr_type);
30
+ const char *strtype = RVAL2CSTR(attr_type);
31
31
  if (strcmp(strtype, "Attribute") == 0){
32
32
  type = pattr;
33
33
  } else if (strcmp(strtype, "AttrString") == 0){
@@ -75,7 +75,7 @@ static VALUE
75
75
  coverage_s_from_bytes(VALUE self, VALUE bytes)
76
76
  {
77
77
  StringValue(bytes);
78
- return BOXED2RVAL(pango_coverage_from_bytes((guchar*)RVAL2CSTR(bytes),
78
+ return BOXED2RVAL(pango_coverage_from_bytes((guchar *)RSTRING_PTR(bytes),
79
79
  RSTRING_LEN(bytes)),
80
80
  PANGO_TYPE_COVERAGE);
81
81
  }
@@ -66,7 +66,9 @@ rglyph_index_to_x(VALUE self, VALUE text, VALUE analysis, VALUE index, VALUE tra
66
66
  StringValue(text);
67
67
 
68
68
  pango_glyph_string_index_to_x(_SELF(self),
69
- RVAL2CSTR(text),
69
+ /* NOTE: This is a bug in the signature of
70
+ * pango_glyph_string_index_to_x */
71
+ (char *)RSTRING_PTR(text),
70
72
  RSTRING_LEN(text),
71
73
  (PangoAnalysis*)RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS),
72
74
  NUM2INT(index), RVAL2CBOOL(trailing),
@@ -82,7 +84,10 @@ rglyph_x_to_index(VALUE self, VALUE text, VALUE analysis, VALUE x_pos)
82
84
 
83
85
  StringValue(text);
84
86
  pango_glyph_string_x_to_index(_SELF(self),
85
- RVAL2CSTR(text), RSTRING_LEN(text),
87
+ /* NOTE: This is a bug in the signature of
88
+ * pango_glyph_string_index_to_x */
89
+ (char *)RSTRING_PTR(text),
90
+ RSTRING_LEN(text),
86
91
  (PangoAnalysis*)RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS),
87
92
  NUM2INT(x_pos),
88
93
  &index, &trailing);
@@ -92,9 +97,9 @@ rglyph_x_to_index(VALUE self, VALUE text, VALUE analysis, VALUE x_pos)
92
97
  static VALUE
93
98
  rglyph_get_logical_widgths(VALUE self, VALUE text, VALUE embedding_level)
94
99
  {
95
- int* logical_widths = NULL;
100
+ int *logical_widths = NULL;
96
101
  int len, array_len, i;
97
- char* gtext;
102
+ const char *gtext;
98
103
  VALUE ret;
99
104
 
100
105
  gtext = RVAL2CSTR(text);
@@ -32,7 +32,8 @@ extern void Init_pangorenderer();
32
32
  extern void Init_pango_script();
33
33
  extern void Init_pango_script_iter();
34
34
  extern void Init_pango_array();
35
- void Init_pango_inits()
35
+ void
36
+ Init_pango_inits()
36
37
  {
37
38
  Init_pango_analysis();
38
39
  Init_pango_attribute();
@@ -43,7 +43,10 @@ layout_context_changed(VALUE self)
43
43
  static VALUE
44
44
  layout_set_text(VALUE self, VALUE text)
45
45
  {
46
- pango_layout_set_text(_SELF(self), RVAL2CSTR(text), RSTRING_LEN(text));
46
+ StringValue(text);
47
+
48
+ pango_layout_set_text(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text));
49
+
47
50
  return self;
48
51
  }
49
52
 
@@ -61,13 +64,15 @@ layout_set_markup(int argc, VALUE *argv, VALUE self)
61
64
 
62
65
  rb_scan_args(argc, argv, "11", &markup, &accel_marker);
63
66
 
67
+ StringValue(markup);
68
+
64
69
  if (NIL_P(accel_marker)){
65
70
  pango_layout_set_markup(_SELF(self),
66
- RVAL2CSTR(markup),
71
+ RSTRING_PTR(markup),
67
72
  RSTRING_LEN(markup));
68
73
  } else {
69
74
  pango_layout_set_markup_with_accel(_SELF(self),
70
- RVAL2CSTR(markup),
75
+ RSTRING_PTR(markup),
71
76
  RSTRING_LEN(markup),
72
77
  NUM2CHR(accel_marker), &accel_char);
73
78
  }
@@ -77,7 +82,10 @@ layout_set_markup(int argc, VALUE *argv, VALUE self)
77
82
  static VALUE
78
83
  layout_set_markup_eq(VALUE self, VALUE markup)
79
84
  {
80
- pango_layout_set_markup(_SELF(self), RVAL2CSTR(markup), RSTRING_LEN(markup));
85
+ StringValue(markup);
86
+
87
+ pango_layout_set_markup(_SELF(self), RSTRING_PTR(markup), RSTRING_LEN(markup));
88
+
81
89
  return markup;
82
90
  }
83
91
 
@@ -15,20 +15,10 @@
15
15
 
16
16
  /**********************************/
17
17
  #ifndef HAVE_PANGO_LAYOUT_ITER_GET_TYPE
18
- static PangoLayoutIter*
18
+ static PangoLayoutIter *
19
19
  layout_iter_copy(const PangoLayoutIter *ref)
20
20
  {
21
- #if PANGO_CHECK_VERSION(1,6,0)
22
- PangoLayoutIter* new_ref;
23
- g_return_val_if_fail (ref != NULL, NULL);
24
- /* This may be broken on pango-1.2.x, but
25
- for backward compatibility. */
26
- new_ref = g_new(PangoLayoutIter, 1);
27
- *new_ref = *ref;
28
- return new_ref;
29
- #else
30
- return (PangoLayoutIter*)ref;
31
- #endif
21
+ return (PangoLayoutIter *)ref;
32
22
  }
33
23
 
34
24
  GType
@@ -45,7 +45,7 @@ static VALUE
45
45
  rpango_find_base_dir(VALUE self, VALUE text)
46
46
  {
47
47
  StringValue(text);
48
- return GENUM2RVAL(pango_find_base_dir(RVAL2CSTR(text), RSTRING_LEN(text)),
48
+ return GENUM2RVAL(pango_find_base_dir(RSTRING_PTR(text), RSTRING_LEN(text)),
49
49
  PANGO_TYPE_DIRECTION);
50
50
  }
51
51
  #endif
@@ -55,19 +55,18 @@ rpango_break(VALUE self, VALUE text, VALUE analysis)
55
55
  {
56
56
  gint i, len;
57
57
  glong attrs_len;
58
- PangoLogAttr* attrs;
59
- gchar* gtext;
58
+ PangoLogAttr *attrs;
59
+ const gchar *gtext;
60
60
  VALUE ret;
61
61
 
62
- StringValue(text);
62
+ gtext = StringValuePtr(text);
63
63
  len = RSTRING_LEN(text);
64
- gtext = RVAL2CSTR(text);
65
64
  attrs_len = g_utf8_strlen(gtext, (gssize)len) + 1l;
66
65
  attrs = g_new0(PangoLogAttr, attrs_len);
67
66
 
68
- pango_break((const gchar*)gtext, len,
69
- NIL_P(analysis) ? NULL : RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS),
70
- attrs, attrs_len);
67
+ pango_break(gtext, len,
68
+ NIL_P(analysis) ? NULL : RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS),
69
+ attrs, attrs_len);
71
70
 
72
71
  ret = rb_ary_new();
73
72
  for (i = 0; i < attrs_len; i++){
@@ -82,17 +81,16 @@ rpango_get_log_attrs(VALUE self, VALUE text, VALUE level, VALUE language)
82
81
  {
83
82
  gint i, len;
84
83
  glong attrs_len;
85
- PangoLogAttr* attrs;
86
- gchar* gtext;
84
+ PangoLogAttr *attrs;
85
+ const gchar *gtext;
87
86
  VALUE ret;
88
87
 
89
- StringValue(text);
88
+ gtext = StringValuePtr(text);
90
89
  len = RSTRING_LEN(text);
91
- gtext = RVAL2CSTR(text);
92
90
  attrs_len = g_utf8_strlen(gtext, (gssize)len) + 1l;
93
91
  attrs = g_new0(PangoLogAttr, attrs_len);
94
92
 
95
- pango_get_log_attrs((const gchar*)gtext, len, NUM2INT(level),
93
+ pango_get_log_attrs(gtext, len, NUM2INT(level),
96
94
  RVAL2BOXED(language, PANGO_TYPE_LANGUAGE),
97
95
  attrs, attrs_len);
98
96
 
@@ -109,7 +107,8 @@ rpango_find_paragraph_boundary(VALUE self, VALUE text)
109
107
  {
110
108
  gint paragraph_delimiter_index, next_paragraph_start;
111
109
 
112
- pango_find_paragraph_boundary(RVAL2CSTR(text), RSTRING_LEN(text),
110
+ StringValue(text);
111
+ pango_find_paragraph_boundary(RSTRING_PTR(text), RSTRING_LEN(text),
113
112
  &paragraph_delimiter_index,
114
113
  &next_paragraph_start);
115
114
  return rb_ary_new3(2, INT2NUM(paragraph_delimiter_index),
@@ -131,7 +130,7 @@ rpango_shape(VALUE self, VALUE text, VALUE analysis)
131
130
  VALUE ret;
132
131
  PangoGlyphString* glyphs = pango_glyph_string_new();
133
132
  StringValue(text);
134
- pango_shape(RVAL2CSTR(text), RSTRING_LEN(text), RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS), glyphs);
133
+ pango_shape(RSTRING_PTR(text), RSTRING_LEN(text), RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS), glyphs);
135
134
  ret = BOXED2RVAL(glyphs, PANGO_TYPE_GLYPH_STRING);
136
135
  pango_glyph_string_free (glyphs);
137
136
  return ret;
@@ -155,7 +154,8 @@ rpango_parse_markup(int argc, VALUE *argv, VALUE self)
155
154
 
156
155
  if (NIL_P(markup_text)) rb_raise(rb_eRuntimeError, "1st argument can't accept nil");
157
156
 
158
- ret = pango_parse_markup(RVAL2CSTR(markup_text),
157
+ StringValue(markup_text);
158
+ ret = pango_parse_markup(RSTRING_PTR(markup_text),
159
159
  RSTRING_LEN(markup_text),
160
160
  NIL_P(accel_marker) ? 0 : NUM2CHR(accel_marker),
161
161
  &pattr_list, &gtext, &accel_char, &error);
@@ -48,7 +48,7 @@ rbpango_scriptiter_initialize(VALUE self, VALUE text)
48
48
  PangoScriptIter* iter;
49
49
 
50
50
  StringValue(text);
51
- iter = pango_script_iter_new(RVAL2CSTR(text), RSTRING_LEN(text));
51
+ iter = pango_script_iter_new(RSTRING_PTR(text), RSTRING_LEN(text));
52
52
  G_INITIALIZE(self, iter);
53
53
  return Qnil;
54
54
  }
data/lib/1.8/pango.so CHANGED
Binary file
data/lib/1.9/pango.so CHANGED
Binary file
data/lib/pango.rb CHANGED
@@ -22,7 +22,7 @@ vendor_dir = base_dir + "vendor" + "local"
22
22
  vendor_bin_dir = vendor_dir + "bin"
23
23
  GLib.prepend_environment_path(vendor_bin_dir)
24
24
  begin
25
- major, minor, micro, = RUBY_VERSION.split(/\./)
25
+ major, minor, _ = RUBY_VERSION.split(/\./)
26
26
  require "#{major}.#{minor}/pango.so"
27
27
  rescue LoadError
28
28
  require "pango.so"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pango
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: x86-mingw32
12
12
  authors:
13
13
  - The Ruby-GNOME2 Proejct Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-13 00:00:00 Z
18
+ date: 2011-09-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: cairo
@@ -41,12 +41,12 @@ dependencies:
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- hash: 23
44
+ hash: 21
45
45
  segments:
46
46
  - 1
47
47
  - 0
48
- - 0
49
- version: 1.0.0
48
+ - 1
49
+ version: 1.0.1
50
50
  type: :runtime
51
51
  version_requirements: *id002
52
52
  description: Ruby/Pango is a Ruby binding of pango-1.x.