cairo 1.12.1 → 1.12.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of cairo might be problematic. Click here for more details.
- data/Gemfile +1 -1
- data/NEWS +23 -0
- data/ext/cairo/extconf.rb +121 -1
- data/ext/cairo/rb_cairo.h +1 -1
- data/ext/cairo/rb_cairo_device.c +35 -0
- data/ext/cairo/rb_cairo_pattern.c +81 -7
- data/ext/cairo/rb_cairo_surface.c +632 -444
- data/lib/cairo.rb +3 -0
- data/lib/cairo/device.rb +13 -0
- data/lib/cairo/pattern.rb +12 -0
- data/lib/cairo/surface.rb +11 -0
- data/test/cairo-test-utils.rb +12 -6
- data/test/run-test.rb +1 -1
- data/test/test_raster_source_pattern.rb +15 -1
- metadata +102 -69
data/lib/cairo.rb
CHANGED
data/lib/cairo/device.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module Cairo
|
2
|
+
if const_defined?(:Device)
|
3
|
+
class Device
|
4
|
+
class << self
|
5
|
+
def supported?(type)
|
6
|
+
supported_predicate = "#{type.to_s.downcase}_supported?"
|
7
|
+
return false unless respond_to?(supported_predicate)
|
8
|
+
send(supported_predicate)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Cairo
|
2
|
+
class Pattern
|
3
|
+
class << self
|
4
|
+
def supported?(type)
|
5
|
+
type = type.to_s.gsub(/([a-z])([A-Z])/, '\\1_\\2').downcase
|
6
|
+
supported_predicate = "#{type}_supported?"
|
7
|
+
return false unless respond_to?(supported_predicate)
|
8
|
+
send(supported_predicate)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/test/cairo-test-utils.rb
CHANGED
@@ -18,16 +18,22 @@ module CairoTestUtils
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def only_device(name)
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
only_cairo_version(1, 10)
|
22
|
+
|
23
|
+
unless Cairo::Device.supported?(name)
|
24
|
+
omit("Only for #{name} device available")
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
27
28
|
def only_surface(name)
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
unless Cairo::Surface.supported?(name)
|
30
|
+
omit("Only for #{name} device available")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def only_pattern(name)
|
35
|
+
unless Cairo::Pattern.supported?(name)
|
36
|
+
omit("Only for #{name} device available")
|
31
37
|
end
|
32
38
|
end
|
33
39
|
end
|
data/test/run-test.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
require "cairo"
|
2
2
|
require "tempfile"
|
3
3
|
|
4
|
-
class
|
4
|
+
class RasterSourcePatternTest < Test::Unit::TestCase
|
5
5
|
include CairoTestUtils
|
6
6
|
|
7
|
+
def setup
|
8
|
+
only_pattern("RasterSource")
|
9
|
+
end
|
10
|
+
|
7
11
|
def test_acquire_and_release
|
8
12
|
Cairo::ImageSurface.new(100, 100) do |surface|
|
9
13
|
Cairo::Context.new(surface) do |context|
|
@@ -36,6 +40,11 @@ class RasterPatternSourceTest < Test::Unit::TestCase
|
|
36
40
|
end
|
37
41
|
|
38
42
|
class SnapshotTest < self
|
43
|
+
def setup
|
44
|
+
super
|
45
|
+
only_surface("Recording")
|
46
|
+
end
|
47
|
+
|
39
48
|
def test_success
|
40
49
|
Cairo::RecordingSurface.new(0, 0, 100, 100) do |surface|
|
41
50
|
Cairo::Context.new(surface) do |context|
|
@@ -75,6 +84,11 @@ class RasterPatternSourceTest < Test::Unit::TestCase
|
|
75
84
|
end
|
76
85
|
|
77
86
|
class CopyTest < self
|
87
|
+
def setup
|
88
|
+
super
|
89
|
+
only_surface("Script")
|
90
|
+
end
|
91
|
+
|
78
92
|
def test_success
|
79
93
|
output = StringIO.new
|
80
94
|
device = Cairo::ScriptDevice.new(output)
|
metadata
CHANGED
@@ -1,80 +1,102 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cairo
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 35
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 12
|
9
|
+
- 2
|
10
|
+
version: 1.12.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Kouhei Sutou
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2012-06-03 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
22
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
22
|
-
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 3
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
name: pkg-config
|
23
31
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
32
|
+
type: :runtime
|
33
|
+
requirement: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
28
36
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
33
|
-
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
hash: 3
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
name: bundler
|
34
45
|
prerelease: false
|
35
|
-
version_requirements: *12214300
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: test-unit-notify
|
38
|
-
requirement: &12213780 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ! '>='
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '0'
|
44
46
|
type: :development
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
name: rake-compiler
|
49
|
-
requirement: &12213240 !ruby/object:Gem::Requirement
|
47
|
+
requirement: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
version: "0"
|
58
|
+
name: test-unit-notify
|
56
59
|
prerelease: false
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
60
|
+
type: :development
|
61
|
+
requirement: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
61
64
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
hash: 3
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
version: "0"
|
72
|
+
name: rake-compiler
|
73
|
+
prerelease: false
|
66
74
|
type: :development
|
75
|
+
requirement: *id004
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
name: packnga
|
67
87
|
prerelease: false
|
68
|
-
|
88
|
+
type: :development
|
89
|
+
requirement: *id005
|
69
90
|
description: Ruby bindings for cairo
|
70
|
-
email:
|
91
|
+
email:
|
71
92
|
- kou@cozmixng.org
|
72
93
|
executables: []
|
73
|
-
|
94
|
+
|
95
|
+
extensions:
|
74
96
|
- ext/cairo/extconf.rb
|
75
|
-
extra_rdoc_files:
|
97
|
+
extra_rdoc_files:
|
76
98
|
- README.rdoc
|
77
|
-
files:
|
99
|
+
files:
|
78
100
|
- AUTHORS
|
79
101
|
- COPYING
|
80
102
|
- GPL
|
@@ -84,9 +106,11 @@ files:
|
|
84
106
|
- ext/cairo/extconf.rb
|
85
107
|
- Rakefile
|
86
108
|
- lib/cairo/color.rb
|
109
|
+
- lib/cairo/pattern.rb
|
87
110
|
- lib/cairo/papers.rb
|
88
111
|
- lib/cairo/point.rb
|
89
112
|
- lib/cairo/context.rb
|
113
|
+
- lib/cairo/device.rb
|
90
114
|
- lib/cairo/colors.rb
|
91
115
|
- lib/cairo/context/circle.rb
|
92
116
|
- lib/cairo/context/rectangle.rb
|
@@ -95,6 +119,7 @@ files:
|
|
95
119
|
- lib/cairo/context/triangle.rb
|
96
120
|
- lib/cairo/context/path.rb
|
97
121
|
- lib/cairo/path.rb
|
122
|
+
- lib/cairo/surface.rb
|
98
123
|
- lib/cairo/constants.rb
|
99
124
|
- lib/cairo/paper.rb
|
100
125
|
- lib/cairo.rb
|
@@ -155,31 +180,39 @@ files:
|
|
155
180
|
- test/test_font_options.rb
|
156
181
|
- test/test_constants.rb
|
157
182
|
homepage: http://cairographics.org/rcairo
|
158
|
-
licenses:
|
183
|
+
licenses:
|
159
184
|
- Ruby's
|
160
185
|
post_install_message:
|
161
186
|
rdoc_options: []
|
162
|
-
|
187
|
+
|
188
|
+
require_paths:
|
163
189
|
- lib
|
164
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
190
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
165
191
|
none: false
|
166
|
-
requirements:
|
167
|
-
- -
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
|
170
|
-
|
192
|
+
requirements:
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
hash: 3
|
196
|
+
segments:
|
197
|
+
- 0
|
198
|
+
version: "0"
|
199
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
200
|
none: false
|
172
|
-
requirements:
|
173
|
-
- -
|
174
|
-
- !ruby/object:Gem::Version
|
175
|
-
|
201
|
+
requirements:
|
202
|
+
- - ">="
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
hash: 3
|
205
|
+
segments:
|
206
|
+
- 0
|
207
|
+
version: "0"
|
176
208
|
requirements: []
|
209
|
+
|
177
210
|
rubyforge_project: cairo
|
178
|
-
rubygems_version: 1.8.
|
211
|
+
rubygems_version: 1.8.15
|
179
212
|
signing_key:
|
180
213
|
specification_version: 3
|
181
214
|
summary: Ruby bindings for cairo
|
182
|
-
test_files:
|
215
|
+
test_files:
|
183
216
|
- test/test_surface.rb
|
184
217
|
- test/test_scaled_font.rb
|
185
218
|
- test/test_recording_surface.rb
|