pango 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +27 -5
- data/ext/pango/depend +2 -2
- data/ext/pango/extconf.rb +32 -28
- data/ext/pango/pango.def +0 -16
- data/ext/pango/rb-pango-attr-list.c +64 -0
- data/ext/pango/rb-pango-attribute.c +147 -0
- data/ext/pango/rb-pango-context.c +79 -0
- data/ext/pango/{rbpangoconversions.h → rb-pango-conversions.h} +4 -6
- data/ext/pango/rb-pango-private.h +27 -0
- data/ext/pango/rb-pango.c +32 -0
- data/ext/pango/rb-pango.h +29 -0
- data/extconf.rb +25 -9
- data/lib/pango.rb +24 -68
- data/lib/pango/cairo-loader.rb +63 -0
- data/lib/pango/color.rb +31 -0
- data/lib/pango/deprecated.rb +37 -0
- data/lib/pango/font-description.rb +29 -0
- data/lib/pango/language.rb +29 -0
- data/lib/pango/layout.rb +41 -0
- data/lib/pango/loader.rb +87 -0
- data/lib/pango/markup.rb +31 -0
- data/lib/pango/matrix.rb +64 -0
- data/lib/pango/rectangle.rb +28 -0
- data/lib/pango/version.rb +30 -0
- data/test/pango-test-utils.rb +7 -7
- data/test/run-test.rb +34 -8
- data/test/test-attr-list.rb +28 -0
- data/test/test-color.rb +1 -3
- data/test/test-context.rb +4 -4
- data/test/test-enum.rb +37 -0
- data/test/test-font-description.rb +31 -0
- data/test/test-language.rb +2 -1
- data/test/test-layout.rb +12 -0
- data/test/test-markup.rb +30 -0
- data/test/test-matrix.rb +131 -5
- data/test/test-rectangle.rb +16 -3
- metadata +42 -56
- data/README +0 -32
- data/ext/pango/rbpango.c +0 -356
- data/ext/pango/rbpango.h +0 -95
- data/ext/pango/rbpangoanalysis.c +0 -218
- data/ext/pango/rbpangoattribute.c +0 -506
- data/ext/pango/rbpangoattriterator.c +0 -141
- data/ext/pango/rbpangoattrlist.c +0 -101
- data/ext/pango/rbpangocairo.c +0 -122
- data/ext/pango/rbpangocairocontext.c +0 -131
- data/ext/pango/rbpangocolor.c +0 -120
- data/ext/pango/rbpangocontext.c +0 -344
- data/ext/pango/rbpangocoverage.c +0 -106
- data/ext/pango/rbpangoengine.c +0 -73
- data/ext/pango/rbpangofont.c +0 -110
- data/ext/pango/rbpangofontdescription.c +0 -282
- data/ext/pango/rbpangofontface.c +0 -73
- data/ext/pango/rbpangofontfamily.c +0 -79
- data/ext/pango/rbpangofontmap.c +0 -102
- data/ext/pango/rbpangofontmetrics.c +0 -85
- data/ext/pango/rbpangofontset.c +0 -69
- data/ext/pango/rbpangofontsetsimple.c +0 -60
- data/ext/pango/rbpangoglyphinfo.c +0 -123
- data/ext/pango/rbpangoglyphitem.c +0 -125
- data/ext/pango/rbpangoglyphstring.c +0 -151
- data/ext/pango/rbpangogravity.c +0 -54
- data/ext/pango/rbpangoitem.c +0 -95
- data/ext/pango/rbpangolanguage.c +0 -94
- data/ext/pango/rbpangolayout.c +0 -583
- data/ext/pango/rbpangolayoutiter.c +0 -189
- data/ext/pango/rbpangolayoutline.c +0 -243
- data/ext/pango/rbpangologattr.c +0 -109
- data/ext/pango/rbpangomatrix.c +0 -143
- data/ext/pango/rbpangoprivate.h +0 -49
- data/ext/pango/rbpangorectangle.c +0 -170
- data/ext/pango/rbpangorenderer.c +0 -193
- data/ext/pango/rbpangoscript.c +0 -84
- data/ext/pango/rbpangoscriptiter.c +0 -92
- data/ext/pango/rbpangotabarray.c +0 -128
- data/sample/attribute.rb +0 -82
- data/sample/break.rb +0 -28
- data/sample/gdk_layout.rb +0 -27
- data/sample/glyphstring.rb +0 -61
- data/sample/item.rb +0 -37
- data/sample/label.rb +0 -23
- data/sample/layout.rb +0 -102
- data/sample/pango_cairo.rb +0 -66
- data/sample/parse.rb +0 -33
- data/sample/sample.txt +0 -10
- data/sample/script.rb +0 -23
@@ -0,0 +1,29 @@
|
|
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
|
+
module Pango
|
18
|
+
class Language
|
19
|
+
class << self
|
20
|
+
def new(name=nil)
|
21
|
+
if name
|
22
|
+
from_string(name)
|
23
|
+
else
|
24
|
+
super
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/pango/layout.rb
ADDED
@@ -0,0 +1,41 @@
|
|
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
|
+
module Pango
|
18
|
+
class Layout
|
19
|
+
alias_method :set_font_description_raw, :set_font_description
|
20
|
+
def set_font_description(description)
|
21
|
+
unless description.is_a?(FontDescription)
|
22
|
+
description = FontDescription.new(description)
|
23
|
+
end
|
24
|
+
set_font_description_raw(description)
|
25
|
+
end
|
26
|
+
remove_method :font_description=
|
27
|
+
alias_method :font_description=, :set_font_description
|
28
|
+
|
29
|
+
alias_method :set_text_raw, :set_text
|
30
|
+
def set_text(text)
|
31
|
+
set_text_raw(text, text.length)
|
32
|
+
end
|
33
|
+
alias_method :text=, :set_text
|
34
|
+
|
35
|
+
alias_method :set_markup_raw, :set_markup
|
36
|
+
def set_markup(markup)
|
37
|
+
set_markup_raw(markup, markup.length)
|
38
|
+
end
|
39
|
+
alias_method :markup=, :set_markup
|
40
|
+
end
|
41
|
+
end
|
data/lib/pango/loader.rb
ADDED
@@ -0,0 +1,87 @@
|
|
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
|
+
module Pango
|
18
|
+
class Loader < GObjectIntrospection::Loader
|
19
|
+
private
|
20
|
+
def pre_load(repository, namespace)
|
21
|
+
@pending_attribute_infos = []
|
22
|
+
end
|
23
|
+
|
24
|
+
def post_load(repository, namespace)
|
25
|
+
require_extension
|
26
|
+
@pending_attribute_infos.each do |info|
|
27
|
+
name = rubyish_class_name(info)
|
28
|
+
klass = @base_module.const_get(name)
|
29
|
+
load_fields(info, klass)
|
30
|
+
load_methods(info, klass)
|
31
|
+
end
|
32
|
+
require_libraries
|
33
|
+
end
|
34
|
+
|
35
|
+
def load_struct_info(info)
|
36
|
+
case info.name
|
37
|
+
when /Class\z/
|
38
|
+
super
|
39
|
+
when "Attribute"
|
40
|
+
@pending_attribute_infos << info
|
41
|
+
when /\AAttr[A-Z]/
|
42
|
+
if info.name == "AttrIterator"
|
43
|
+
super
|
44
|
+
else
|
45
|
+
@pending_attribute_infos << info
|
46
|
+
end
|
47
|
+
else
|
48
|
+
super
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def load_method_info(info, klass, method_name)
|
53
|
+
case klass.name
|
54
|
+
when "Pango::Matrix"
|
55
|
+
case method_name
|
56
|
+
when "translate", "scale", "rotate", "concat"
|
57
|
+
method_name += "!"
|
58
|
+
end
|
59
|
+
when "Pango::AttrList"
|
60
|
+
return if klass.method_defined?(method_name)
|
61
|
+
end
|
62
|
+
super(info, klass, method_name)
|
63
|
+
end
|
64
|
+
|
65
|
+
def require_extension
|
66
|
+
begin
|
67
|
+
major, minor, _ = RUBY_VERSION.split(/\./)
|
68
|
+
require "#{major}.#{minor}/pango.so"
|
69
|
+
rescue LoadError
|
70
|
+
require "pango.so"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def require_libraries
|
75
|
+
require "pango/color"
|
76
|
+
require "pango/font-description"
|
77
|
+
require "pango/language"
|
78
|
+
require "pango/layout"
|
79
|
+
require "pango/rectangle"
|
80
|
+
require "pango/markup"
|
81
|
+
require "pango/matrix"
|
82
|
+
require "pango/version"
|
83
|
+
|
84
|
+
require "pango/deprecated"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
data/lib/pango/markup.rb
ADDED
@@ -0,0 +1,31 @@
|
|
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
|
+
module Pango
|
18
|
+
class << self
|
19
|
+
alias_method :parse_markup_raw, :parse_markup
|
20
|
+
def parse_markup(markup_text, accel_marker=nil)
|
21
|
+
success, attr_list, text, accel_char =
|
22
|
+
parse_markup_raw(markup_text,
|
23
|
+
markup_text.bytesize,
|
24
|
+
accel_marker)
|
25
|
+
return nil unless success
|
26
|
+
|
27
|
+
accel_char = nil if accel_char.empty?
|
28
|
+
[attr_list, text, accel_char]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/pango/matrix.rb
ADDED
@@ -0,0 +1,64 @@
|
|
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
|
+
module Pango
|
18
|
+
class Matrix
|
19
|
+
alias_method :initialize_raw, :initialize
|
20
|
+
def initialize(xx=nil, xy=nil, yx=nil, yy=nil, x0=nil, y0=nil)
|
21
|
+
initialize_raw
|
22
|
+
self.xx = xx || 1.0
|
23
|
+
self.xy = xy || 0.0
|
24
|
+
self.yx = yx || 0.0
|
25
|
+
self.yy = yy || 1.0
|
26
|
+
self.x0 = x0 || 0.0
|
27
|
+
self.y0 = y0 || 0.0
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_a
|
31
|
+
[
|
32
|
+
xx, xy,
|
33
|
+
yx, yy,
|
34
|
+
x0,
|
35
|
+
y0,
|
36
|
+
]
|
37
|
+
end
|
38
|
+
|
39
|
+
def translate(tx, ty)
|
40
|
+
copied_matrix = dup
|
41
|
+
copied_matrix.translate!(tx, ty)
|
42
|
+
copied_matrix
|
43
|
+
end
|
44
|
+
|
45
|
+
def scale(scale_x, scale_y)
|
46
|
+
copied_matrix = dup
|
47
|
+
copied_matrix.scale!(scale_x, scale_y)
|
48
|
+
copied_matrix
|
49
|
+
end
|
50
|
+
|
51
|
+
def rotate(degree)
|
52
|
+
copied_matrix = dup
|
53
|
+
copied_matrix.rotate!(degree)
|
54
|
+
copied_matrix
|
55
|
+
end
|
56
|
+
|
57
|
+
def concat(matrix)
|
58
|
+
copied_matrix = dup
|
59
|
+
copied_matrix.concat!(matrix)
|
60
|
+
copied_matrix
|
61
|
+
end
|
62
|
+
alias_method :+, :concat
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,28 @@
|
|
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
|
+
module Pango
|
18
|
+
class Rectangle
|
19
|
+
alias_method :initialize_raw, :initialize
|
20
|
+
def initialize(x, y, width, height)
|
21
|
+
initialize_raw
|
22
|
+
self.x = x
|
23
|
+
self.y = y
|
24
|
+
self.width = width
|
25
|
+
self.height = height
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,30 @@
|
|
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
|
+
module Pango
|
18
|
+
module Version
|
19
|
+
STRING = Pango.version_string
|
20
|
+
MAJOR, MINOR, MICRO = STRING.split(".").collect(&:to_i)
|
21
|
+
|
22
|
+
class << self
|
23
|
+
def or_later?(major, minor, micro=nil)
|
24
|
+
micro ||= 0
|
25
|
+
message = Pango.version_check(major, minor, micro)
|
26
|
+
message.nil?
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/test/pango-test-utils.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module PangoTestUtils
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
private
|
3
|
+
def only_pango_version(major, minor, micro=nil)
|
4
|
+
micro ||= 0
|
5
|
+
unless Pango::Version.or_later?(major, minor, micro)
|
6
|
+
omit("Require Pango >= #{major}.#{minor}.#{micro}")
|
7
|
+
end
|
8
|
+
end
|
9
9
|
end
|
data/test/run-test.rb
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (C) 2017 Ruby-GNOME2 Project Team
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2
18
|
|
3
19
|
$VERBOSE = true
|
4
20
|
|
@@ -6,23 +22,33 @@ ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
|
|
6
22
|
ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
|
7
23
|
|
8
24
|
glib_base = File.join(ruby_gnome2_base, "glib2")
|
25
|
+
gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
|
26
|
+
cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject")
|
9
27
|
pango_base = File.join(ruby_gnome2_base, "pango")
|
10
28
|
|
11
29
|
$LOAD_PATH.unshift(File.join(glib_base, "test"))
|
12
|
-
require 'glib-test-init'
|
13
30
|
|
14
|
-
[
|
15
|
-
|
16
|
-
|
17
|
-
|
31
|
+
modules = [
|
32
|
+
[glib_base, "glib2"],
|
33
|
+
[gobject_introspection_base, "gobject-introspection"],
|
34
|
+
[cairo_gobject_base, "cairo-gobject"],
|
35
|
+
[pango_base, "pango"],
|
36
|
+
]
|
37
|
+
modules.each do |target, module_name|
|
38
|
+
makefile = File.join(target, "Makefile")
|
39
|
+
if File.exist?(makefile) and system("which make > /dev/null")
|
40
|
+
`make -C #{target.dump} > /dev/null` or exit(false)
|
41
|
+
$LOAD_PATH.unshift(File.join(target, "ext", module_name))
|
18
42
|
end
|
19
|
-
$LOAD_PATH.unshift(File.join(target, "ext", module_name))
|
20
43
|
$LOAD_PATH.unshift(File.join(target, "lib"))
|
21
44
|
end
|
22
45
|
|
46
|
+
$LOAD_PATH.unshift(File.join(glib_base, "test"))
|
47
|
+
require "glib-test-init"
|
48
|
+
|
23
49
|
$LOAD_PATH.unshift(File.join(pango_base, "test"))
|
24
|
-
require
|
50
|
+
require "pango-test-utils"
|
25
51
|
|
26
|
-
require
|
52
|
+
require "pango"
|
27
53
|
|
28
54
|
exit Test::Unit::AutoRunner.run(true, File.join(pango_base, "test"))
|
@@ -0,0 +1,28 @@
|
|
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 TestAttrList < Test::Unit::TestCase
|
18
|
+
include PangoTestUtils
|
19
|
+
|
20
|
+
def setup
|
21
|
+
@attrs = Pango::AttrList.new
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_insert
|
25
|
+
attribute = Pango::AttrLanguage.new(Pango::Language.default)
|
26
|
+
@attrs.insert(attribute)
|
27
|
+
end
|
28
|
+
end
|
data/test/test-color.rb
CHANGED
data/test/test-context.rb
CHANGED
@@ -41,13 +41,13 @@ class TestContext < Test::Unit::TestCase
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_set_base_dir
|
44
|
-
@context.base_dir =
|
45
|
-
assert_equal(Pango::
|
44
|
+
@context.base_dir = :ltr
|
45
|
+
assert_equal(Pango::Direction::LTR, @context.base_dir)
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_set_gravity
|
49
|
-
@context.gravity_hint =
|
50
|
-
assert_equal(Pango::
|
49
|
+
@context.gravity_hint = :strong
|
50
|
+
assert_equal(Pango::GravityHint::STRONG, @context.gravity_hint)
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_set_matrix
|