pango 3.1.2 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81dda8d141ed08f5b87af59503e32fb3d25d4f34
4
- data.tar.gz: f43b49f350c5cb009ddcfd29b8525089c72a3220
3
+ metadata.gz: 8c57ea7d52d980ae3b887f1f6abc7f00b9a86841
4
+ data.tar.gz: 85fe14530b41c09a0a1f30c2c1f0f73fe695cf6c
5
5
  SHA512:
6
- metadata.gz: 04f1130e8d4283cbe97d4368ef50776115edd5963c76c05b6da4f9ebe0be9d5c9b9660c02feb35b4cc5fd63bea47f92730a9f746799bcd9d85013df2cd6aab7c
7
- data.tar.gz: b92720c3c3260a78f91cd6ecb1eb6158b7d30c17e1ec132377b7e8fcbb0639e7577101ef9eb8045ff7ece17ba133a610adb2c3836fd9f95f96c7e1d93fc60c41
6
+ metadata.gz: 7e171882505f9dcbb917446a2c15f0cd2a6d8bc0ce98775447959e0f0416ab485dc3b82675e6acfe86b28b475c04629557efd38543273d17471b993a778fa9dd
7
+ data.tar.gz: 461292b4efa83ff59992661e343c7dfd33fc947f1e175540d49fdb01d337c66e3aa3ff0150a57bbd8fb439ab52376000e3b572093de9315db74868907b0e70a8
@@ -94,6 +94,18 @@ rbpango_attr_shape_initialize(int argc, VALUE *argv, VALUE self)
94
94
  return Qnil;
95
95
  }
96
96
 
97
+ static VALUE
98
+ rbpango_attr_shape_get_data(VALUE self)
99
+ {
100
+ PangoAttrShape *attr_shape;
101
+ VALUE rb_data;
102
+
103
+ Data_Get_Struct(self, PangoAttrShape, attr_shape);
104
+ rb_data = (VALUE)(attr_shape->data);
105
+ rb_p(rb_data);
106
+ return rb_data;
107
+ }
108
+
97
109
  static VALUE
98
110
  rbpango_attr_size_initialize(VALUE self, VALUE rb_size)
99
111
  {
@@ -120,8 +132,7 @@ rbpango_attribute_init(VALUE mPango)
120
132
  cAttribute); \
121
133
  } while (FALSE)
122
134
 
123
- #define DEFINE_ATTRIBUTE(ClassName, method_name, n_initialize_args) \
124
- do { \
135
+ #define DEFINE_ATTRIBUTE_BEGIN(ClassName, method_name, n_initialize_args) \
125
136
  VALUE c ## ClassName; \
126
137
  c ## ClassName = rb_define_class_under(mPango, \
127
138
  #ClassName, \
@@ -129,7 +140,12 @@ rbpango_attribute_init(VALUE mPango)
129
140
  rb_define_method(c ## ClassName, "initialize", \
130
141
  rbpango_ ## method_name ## _initialize, \
131
142
  n_initialize_args); \
132
- } while (FALSE)
143
+
144
+ #define DEFINE_ATTRIBUTE_END \
145
+
146
+ #define DEFINE_ATTRIBUTE(ClassName, method_name, n_initialize_args) \
147
+ DEFINE_ATTRIBUTE_BEGIN(ClassName, method_name, n_initialize_args) { \
148
+ } DEFINE_ATTRIBUTE_END;
133
149
 
134
150
  DEFINE_ABSTRACT_ATTRIBUTE(AttrBool);
135
151
  DEFINE_ABSTRACT_ATTRIBUTE(AttrColor);
@@ -138,7 +154,9 @@ rbpango_attribute_init(VALUE mPango)
138
154
  DEFINE_ATTRIBUTE(AttrFontFeatures, attr_font_features, 1);
139
155
  DEFINE_ABSTRACT_ATTRIBUTE(AttrInt);
140
156
  DEFINE_ATTRIBUTE(AttrLanguage, attr_language, 1);
141
- DEFINE_ATTRIBUTE(AttrShape, attr_shape, -1);
157
+ DEFINE_ATTRIBUTE_BEGIN(AttrShape, attr_shape, -1) {
158
+ rb_define_method(cAttrShape, "data", rbpango_attr_shape_get_data, 0);
159
+ } DEFINE_ATTRIBUTE_END;
142
160
  DEFINE_ATTRIBUTE(AttrSize, attr_size, 1);
143
161
  DEFINE_ABSTRACT_ATTRIBUTE(AttrString);
144
162
 
@@ -20,13 +20,24 @@
20
20
 
21
21
  #include "rb-pango-private.h"
22
22
 
23
+ #define RG_TARGET_NAMESPACE mPango
24
+
25
+ static VALUE
26
+ rg_s_pixels(G_GNUC_UNUSED VALUE self, VALUE pixels)
27
+ {
28
+ return rb_float_new(PANGO_PIXELS(NUM2DBL(pixels)));
29
+ }
30
+
23
31
  void
24
32
  Init_pango(void)
25
33
  {
26
- VALUE mPango;
34
+ VALUE RG_TARGET_NAMESPACE;
35
+
36
+ RG_TARGET_NAMESPACE = rb_define_module("Pango");
37
+
38
+ RG_DEF_SMETHOD(pixels, 1);
27
39
 
28
- mPango = rb_define_module("Pango");
29
- rbpango_attribute_init(mPango);
30
- rbpango_attr_list_init(mPango);
31
- rbpango_context_init(mPango);
40
+ rbpango_attribute_init(RG_TARGET_NAMESPACE);
41
+ rbpango_attr_list_init(RG_TARGET_NAMESPACE);
42
+ rbpango_context_init(RG_TARGET_NAMESPACE);
32
43
  }
@@ -15,6 +15,23 @@
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
  module Pango
18
+ extend GLib::Deprecatable
19
+
20
+ define_deprecated_enums :Alignment, "ALIGN"
21
+ define_deprecated_enums :CoverageLevel, "COVERAGE"
22
+ define_deprecated_enums :Direction, "DIRECTION"
23
+ define_deprecated_enums :WrapMode, "WRAP"
24
+ define_deprecated_enums :FontMask, "FONT_MASK"
25
+ define_deprecated_enums :Stretch, "STRETCH"
26
+ define_deprecated_enums :Style, "STYLE"
27
+ define_deprecated_enums :Variant, "VARIANT"
28
+ define_deprecated_enums :Weight, "WEIGHT"
29
+ define_deprecated_enums :TabAlign, "TAB"
30
+ define_deprecated_enums :Underline, "UNDERLINE"
31
+ define_deprecated_enums :Script, "SCRIPT"
32
+ define_deprecated_enums :EllipsizeMode, "ELLIPSIZE"
33
+ define_deprecated_enums :RenderPart, "PART"
34
+
18
35
  class Context
19
36
  extend GLib::Deprecatable
20
37
 
@@ -31,7 +48,10 @@ module Pango
31
48
  extend GLib::Deprecatable
32
49
 
33
50
  define_deprecated_enums :Alignment, "ALIGN"
51
+ define_deprecated_const :Alignment, "Pango::Alignment"
34
52
  define_deprecated_enums :WrapMode, "WRAP"
53
+ define_deprecated_const :WrapMode, "Pango::WrapMode"
35
54
  define_deprecated_enums :EllipsizeMode, "ELLIPSIZE"
55
+ define_deprecated_const :EllipsizeMode, "Pango::EllipsizeMode"
36
56
  end
37
57
  end
@@ -28,13 +28,13 @@ module Pango
28
28
 
29
29
  alias_method :set_text_raw, :set_text
30
30
  def set_text(text)
31
- set_text_raw(text, text.length)
31
+ set_text_raw(text, text.bytesize)
32
32
  end
33
33
  alias_method :text=, :set_text
34
34
 
35
35
  alias_method :set_markup_raw, :set_markup
36
36
  def set_markup(markup)
37
- set_markup_raw(markup, markup.length)
37
+ set_markup_raw(markup, markup.bytesize)
38
38
  end
39
39
  alias_method :markup=, :set_markup
40
40
  end
@@ -49,6 +49,14 @@ module Pango
49
49
  end
50
50
  end
51
51
 
52
+ def load_field_reader(info, i, field_info, klass, name, method_name)
53
+ case klass.name
54
+ when "Pango::AttrShape"
55
+ return if klass.method_defined?(method_name)
56
+ end
57
+ super
58
+ end
59
+
52
60
  def load_method_info(info, klass, method_name)
53
61
  case klass.name
54
62
  when "Pango::Matrix"
@@ -39,14 +39,14 @@ class TestLayout < Test::Unit::TestCase
39
39
  end
40
40
 
41
41
  def test_set_text
42
- text = "Hello <b>World</b>!"
42
+ text = "こんにちは <b>World</b>!"
43
43
  @layout.text = text
44
44
  assert_equal(text, @layout.text)
45
45
  end
46
46
 
47
47
  def test_set_markup
48
- markup = "Hello <b>World</b>!"
48
+ markup = "こんにちは <b>World</b>!"
49
49
  @layout.markup = markup
50
- assert_equal("Hello World!", @layout.text)
50
+ assert_equal("こんにちは World!", @layout.text)
51
51
  end
52
52
  end
@@ -0,0 +1,23 @@
1
+ # Copyright (C) 2017 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestPango < Test::Unit::TestCase
18
+ include PangoTestUtils
19
+
20
+ def test_pixels
21
+ assert_in_delta(29, Pango.pixels(29 * Pango::SCALE), 0.00001)
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pango
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-26 00:00:00.000000000 Z
11
+ date: 2017-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.2
33
+ version: 3.1.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.2
40
+ version: 3.1.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: gobject-introspection
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 3.1.2
47
+ version: 3.1.3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 3.1.2
54
+ version: 3.1.3
55
55
  description: Ruby/Pango is a Ruby binding of pango-1.x.
56
56
  email: ruby-gnome2-devel-en@lists.sourceforge.net
57
57
  executables: []
@@ -97,6 +97,7 @@ files:
97
97
  - test/test-log-attr.rb
98
98
  - test/test-markup.rb
99
99
  - test/test-matrix.rb
100
+ - test/test-pango.rb
100
101
  - test/test-rectangle.rb
101
102
  - test/test-version.rb
102
103
  homepage: http://ruby-gnome2.sourceforge.jp/