cairo 1.8.1 → 1.8.3
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/NEWS +16 -0
- data/Rakefile +14 -15
- data/{src → ext/cairo}/cairo.def +0 -0
- data/ext/cairo/extconf.rb +80 -0
- data/{src → ext/cairo}/rb_cairo.c +1 -1
- data/{src → ext/cairo}/rb_cairo.h +0 -0
- data/{src → ext/cairo}/rb_cairo_constants.c +0 -0
- data/{src → ext/cairo}/rb_cairo_context.c +0 -0
- data/{src → ext/cairo}/rb_cairo_exception.c +0 -0
- data/{src → ext/cairo}/rb_cairo_font_extents.c +0 -0
- data/{src → ext/cairo}/rb_cairo_font_face.c +0 -0
- data/{src → ext/cairo}/rb_cairo_font_options.c +0 -0
- data/{src → ext/cairo}/rb_cairo_glyph.c +0 -0
- data/{src → ext/cairo}/rb_cairo_matrix.c +0 -0
- data/{src → ext/cairo}/rb_cairo_path.c +0 -0
- data/{src → ext/cairo}/rb_cairo_pattern.c +0 -0
- data/{src → ext/cairo}/rb_cairo_private.c +1 -1
- data/{src → ext/cairo}/rb_cairo_private.h +0 -0
- data/{src → ext/cairo}/rb_cairo_scaled_font.c +0 -0
- data/{src → ext/cairo}/rb_cairo_surface.c +0 -0
- data/{src → ext/cairo}/rb_cairo_text_cluster.c +0 -0
- data/{src → ext/cairo}/rb_cairo_text_extents.c +0 -0
- data/extconf.rb +30 -141
- data/{src/lib → lib}/cairo.rb +7 -2
- data/{src/lib → lib}/cairo/color.rb +14 -2
- data/{src/lib → lib}/cairo/colors.rb +0 -0
- data/{src/lib → lib}/cairo/constants.rb +0 -0
- data/{src/lib → lib}/cairo/context.rb +0 -0
- data/{src/lib → lib}/cairo/context/blur.rb +0 -0
- data/{src/lib → lib}/cairo/context/circle.rb +0 -0
- data/{src/lib → lib}/cairo/context/color.rb +0 -0
- data/{src/lib → lib}/cairo/context/path.rb +0 -0
- data/{src/lib → lib}/cairo/context/rectangle.rb +0 -0
- data/{src/lib → lib}/cairo/context/triangle.rb +0 -0
- data/{src/lib → lib}/cairo/paper.rb +0 -0
- data/{src/lib → lib}/cairo/papers.rb +0 -0
- data/{src/lib → lib}/cairo/path.rb +0 -0
- data/{src/lib → lib}/cairo/point.rb +0 -0
- data/pkg-config.rb +6 -1
- data/test/run-test.rb +3 -3
- data/test/test_color.rb +17 -0
- metadata +72 -260
- data/ChangeLog +0 -1662
- data/README +0 -82
- data/doc/doc.css +0 -91
- data/doc/en/cairo-antialias.html +0 -38
- data/doc/en/cairo-clip-not-representable-error.html +0 -47
- data/doc/en/cairo-color-base.html +0 -69
- data/doc/en/cairo-color-cmyk.html +0 -157
- data/doc/en/cairo-color-hsv.html +0 -137
- data/doc/en/cairo-color-rgb.html +0 -142
- data/doc/en/cairo-color-x11.html +0 -173
- data/doc/en/cairo-color.html +0 -238
- data/doc/en/cairo-content.html +0 -37
- data/doc/en/cairo-context-blur.html +0 -39
- data/doc/en/cairo-context-circle.html +0 -39
- data/doc/en/cairo-context-color.html +0 -39
- data/doc/en/cairo-context-path.html +0 -44
- data/doc/en/cairo-context-rectangle.html +0 -39
- data/doc/en/cairo-context-triangle.html +0 -39
- data/doc/en/cairo-context.html +0 -643
- data/doc/en/cairo-error.html +0 -44
- data/doc/en/cairo-extend.html +0 -38
- data/doc/en/cairo-file-not-found.html +0 -47
- data/doc/en/cairo-fill-rule.html +0 -36
- data/doc/en/cairo-filter.html +0 -40
- data/doc/en/cairo-font-extents.html +0 -129
- data/doc/en/cairo-font-face.html +0 -38
- data/doc/en/cairo-font-options.html +0 -139
- data/doc/en/cairo-font-slant.html +0 -37
- data/doc/en/cairo-font-type-mismatch.html +0 -47
- data/doc/en/cairo-font-weight.html +0 -36
- data/doc/en/cairo-format.html +0 -46
- data/doc/en/cairo-glyph.html +0 -99
- data/doc/en/cairo-gradient-pattern.html +0 -74
- data/doc/en/cairo-hint-metrics.html +0 -37
- data/doc/en/cairo-hint-style.html +0 -39
- data/doc/en/cairo-image-surface.html +0 -82
- data/doc/en/cairo-invalid-clusters.html +0 -47
- data/doc/en/cairo-invalid-content-error.html +0 -47
- data/doc/en/cairo-invalid-dash-error.html +0 -47
- data/doc/en/cairo-invalid-dsc-comment-error.html +0 -47
- data/doc/en/cairo-invalid-format-error.html +0 -47
- data/doc/en/cairo-invalid-index-error.html +0 -47
- data/doc/en/cairo-invalid-matrix-error.html +0 -47
- data/doc/en/cairo-invalid-path-data-error.html +0 -47
- data/doc/en/cairo-invalid-pop-group-error.html +0 -47
- data/doc/en/cairo-invalid-restore-error.html +0 -47
- data/doc/en/cairo-invalid-slant.html +0 -47
- data/doc/en/cairo-invalid-status-error.html +0 -47
- data/doc/en/cairo-invalid-stride-error.html +0 -47
- data/doc/en/cairo-invalid-string-error.html +0 -47
- data/doc/en/cairo-invalid-visual-error.html +0 -47
- data/doc/en/cairo-invalid-weight.html +0 -47
- data/doc/en/cairo-line-cap.html +0 -37
- data/doc/en/cairo-line-join.html +0 -37
- data/doc/en/cairo-linear-pattern.html +0 -60
- data/doc/en/cairo-matrix.html +0 -259
- data/doc/en/cairo-negative-count.html +0 -47
- data/doc/en/cairo-no-current-point-error.html +0 -47
- data/doc/en/cairo-null-pointer-error.html +0 -47
- data/doc/en/cairo-operator.html +0 -48
- data/doc/en/cairo-paper-parse-error.html +0 -47
- data/doc/en/cairo-paper-unknown-paper-name.html +0 -66
- data/doc/en/cairo-paper-unknown-unit.html +0 -66
- data/doc/en/cairo-paper-unrecognized-paper-description.html +0 -66
- data/doc/en/cairo-paper.html +0 -184
- data/doc/en/cairo-path-close-path.html +0 -49
- data/doc/en/cairo-path-curve-to.html +0 -49
- data/doc/en/cairo-path-data-type.html +0 -38
- data/doc/en/cairo-path-data.html +0 -98
- data/doc/en/cairo-path-line-to.html +0 -49
- data/doc/en/cairo-path-move-to.html +0 -49
- data/doc/en/cairo-path.html +0 -155
- data/doc/en/cairo-pattern-type-mismatch-error.html +0 -47
- data/doc/en/cairo-pattern.html +0 -99
- data/doc/en/cairo-pdf-surface.html +0 -57
- data/doc/en/cairo-point.html +0 -74
- data/doc/en/cairo-ps-level.html +0 -49
- data/doc/en/cairo-ps-surface.html +0 -92
- data/doc/en/cairo-quartz-image-surface.html +0 -57
- data/doc/en/cairo-quartz-surface.html +0 -57
- data/doc/en/cairo-radial-pattern.html +0 -60
- data/doc/en/cairo-read-error.html +0 -47
- data/doc/en/cairo-rectangle.html +0 -89
- data/doc/en/cairo-scaled-font.html +0 -94
- data/doc/en/cairo-solid-pattern.html +0 -62
- data/doc/en/cairo-subpixel-order.html +0 -39
- data/doc/en/cairo-surface-finished-error.html +0 -47
- data/doc/en/cairo-surface-pattern.html +0 -57
- data/doc/en/cairo-surface-type-mismatch-error.html +0 -47
- data/doc/en/cairo-surface.html +0 -121
- data/doc/en/cairo-svg-surface.html +0 -77
- data/doc/en/cairo-svg-version.html +0 -49
- data/doc/en/cairo-temp-file-error.html +0 -47
- data/doc/en/cairo-text-cluster-flag.html +0 -35
- data/doc/en/cairo-text-cluster.html +0 -84
- data/doc/en/cairo-text-extents.html +0 -144
- data/doc/en/cairo-toy-font-face.html +0 -67
- data/doc/en/cairo-user-font-error.html +0 -47
- data/doc/en/cairo-user-font-face-text-to-glyphs-data.html +0 -94
- data/doc/en/cairo-user-font-face.html +0 -72
- data/doc/en/cairo-user-font-immutable.html +0 -47
- data/doc/en/cairo-win32-printing-surface.html +0 -57
- data/doc/en/cairo-win32-surface.html +0 -62
- data/doc/en/cairo-write-error.html +0 -47
- data/doc/en/cairo.html +0 -131
- data/doc/en/index.html +0 -1154
- data/doc/index.html +0 -18
- data/doc/ja/cairo-antialias.html +0 -57
- data/doc/ja/cairo-clip-not-representable-error.html +0 -56
- data/doc/ja/cairo-color-base.html +0 -75
- data/doc/ja/cairo-color-cmyk.html +0 -152
- data/doc/ja/cairo-color-hsv.html +0 -135
- data/doc/ja/cairo-color-rgb.html +0 -145
- data/doc/ja/cairo-color-x11.html +0 -183
- data/doc/ja/cairo-color.html +0 -317
- data/doc/ja/cairo-content.html +0 -51
- data/doc/ja/cairo-context-blur.html +0 -53
- data/doc/ja/cairo-context-circle.html +0 -54
- data/doc/ja/cairo-context-color.html +0 -52
- data/doc/ja/cairo-context-path.html +0 -77
- data/doc/ja/cairo-context-rectangle.html +0 -60
- data/doc/ja/cairo-context-triangle.html +0 -47
- data/doc/ja/cairo-context.html +0 -1542
- data/doc/ja/cairo-error.html +0 -56
- data/doc/ja/cairo-extend.html +0 -56
- data/doc/ja/cairo-file-not-found.html +0 -51
- data/doc/ja/cairo-fill-rule.html +0 -58
- data/doc/ja/cairo-filter.html +0 -43
- data/doc/ja/cairo-font-extents.html +0 -164
- data/doc/ja/cairo-font-face.html +0 -55
- data/doc/ja/cairo-font-options.html +0 -189
- data/doc/ja/cairo-font-slant.html +0 -50
- data/doc/ja/cairo-font-type-mismatch.html +0 -52
- data/doc/ja/cairo-font-weight.html +0 -47
- data/doc/ja/cairo-format.html +0 -81
- data/doc/ja/cairo-glyph.html +0 -115
- data/doc/ja/cairo-gradient-pattern.html +0 -119
- data/doc/ja/cairo-hint-metrics.html +0 -57
- data/doc/ja/cairo-hint-style.html +0 -64
- data/doc/ja/cairo-image-surface.html +0 -131
- data/doc/ja/cairo-invalid-clusters.html +0 -55
- data/doc/ja/cairo-invalid-content-error.html +0 -54
- data/doc/ja/cairo-invalid-dash-error.html +0 -54
- data/doc/ja/cairo-invalid-dsc-comment-error.html +0 -54
- data/doc/ja/cairo-invalid-format-error.html +0 -54
- data/doc/ja/cairo-invalid-index-error.html +0 -54
- data/doc/ja/cairo-invalid-matrix-error.html +0 -54
- data/doc/ja/cairo-invalid-path-data-error.html +0 -54
- data/doc/ja/cairo-invalid-pop-group-error.html +0 -54
- data/doc/ja/cairo-invalid-restore-error.html +0 -55
- data/doc/ja/cairo-invalid-slant.html +0 -57
- data/doc/ja/cairo-invalid-status-error.html +0 -55
- data/doc/ja/cairo-invalid-stride-error.html +0 -55
- data/doc/ja/cairo-invalid-string-error.html +0 -54
- data/doc/ja/cairo-invalid-visual-error.html +0 -57
- data/doc/ja/cairo-invalid-weight.html +0 -57
- data/doc/ja/cairo-line-cap.html +0 -50
- data/doc/ja/cairo-line-join.html +0 -53
- data/doc/ja/cairo-linear-pattern.html +0 -87
- data/doc/ja/cairo-matrix.html +0 -354
- data/doc/ja/cairo-negative-count.html +0 -52
- data/doc/ja/cairo-no-current-point-error.html +0 -54
- data/doc/ja/cairo-null-pointer-error.html +0 -54
- data/doc/ja/cairo-operator.html +0 -51
- data/doc/ja/cairo-paper-parse-error.html +0 -55
- data/doc/ja/cairo-paper-unknown-paper-name.html +0 -76
- data/doc/ja/cairo-paper-unknown-unit.html +0 -75
- data/doc/ja/cairo-paper-unrecognized-paper-description.html +0 -76
- data/doc/ja/cairo-paper.html +0 -357
- data/doc/ja/cairo-path-close-path.html +0 -57
- data/doc/ja/cairo-path-curve-to.html +0 -70
- data/doc/ja/cairo-path-data-type.html +0 -53
- data/doc/ja/cairo-path-data.html +0 -127
- data/doc/ja/cairo-path-line-to.html +0 -62
- data/doc/ja/cairo-path-move-to.html +0 -62
- data/doc/ja/cairo-path.html +0 -144
- data/doc/ja/cairo-pattern-type-mismatch-error.html +0 -56
- data/doc/ja/cairo-pattern.html +0 -128
- data/doc/ja/cairo-pdf-surface.html +0 -86
- data/doc/ja/cairo-point.html +0 -90
- data/doc/ja/cairo-ps-level.html +0 -62
- data/doc/ja/cairo-ps-surface.html +0 -214
- data/doc/ja/cairo-quartz-image-surface.html +0 -75
- data/doc/ja/cairo-quartz-surface.html +0 -93
- data/doc/ja/cairo-radial-pattern.html +0 -93
- data/doc/ja/cairo-read-error.html +0 -55
- data/doc/ja/cairo-rectangle.html +0 -109
- data/doc/ja/cairo-scaled-font.html +0 -180
- data/doc/ja/cairo-solid-pattern.html +0 -87
- data/doc/ja/cairo-subpixel-order.html +0 -57
- data/doc/ja/cairo-surface-finished-error.html +0 -54
- data/doc/ja/cairo-surface-pattern.html +0 -68
- data/doc/ja/cairo-surface-type-mismatch-error.html +0 -56
- data/doc/ja/cairo-surface.html +0 -213
- data/doc/ja/cairo-svg-surface.html +0 -114
- data/doc/ja/cairo-svg-version.html +0 -66
- data/doc/ja/cairo-temp-file-error.html +0 -50
- data/doc/ja/cairo-text-cluster-flag.html +0 -46
- data/doc/ja/cairo-text-cluster.html +0 -102
- data/doc/ja/cairo-text-extents.html +0 -163
- data/doc/ja/cairo-toy-font-face.html +0 -107
- data/doc/ja/cairo-user-font-error.html +0 -55
- data/doc/ja/cairo-user-font-face-text-to-glyphs-data.html +0 -156
- data/doc/ja/cairo-user-font-face.html +0 -268
- data/doc/ja/cairo-user-font-immutable.html +0 -54
- data/doc/ja/cairo-win32-printing-surface.html +0 -80
- data/doc/ja/cairo-win32-surface.html +0 -100
- data/doc/ja/cairo-write-error.html +0 -55
- data/doc/ja/cairo.html +0 -177
- data/doc/ja/index.html +0 -1156
- data/src/tml/make/libpng_1.2.32-1_win32.log +0 -269
- data/src/tml/make/libpng_1.2.32-1_win32.sh +0 -63
- data/test/example_d.exe +0 -0
- data/test/minigzip_d.exe +0 -0
- data/test/testzlib_d.exe +0 -0
- data/test/untgz_d.exe +0 -0
data/NEWS
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
Release 1.8.3 (2010-08-26) Kouhei Sutou <kou@cozmixng.org>)
|
2
|
+
===========================================================
|
3
|
+
|
4
|
+
Features
|
5
|
+
--------
|
6
|
+
* Support cairo 1.8.10.
|
7
|
+
* Support Ruby 1.9.2. (reported by Tasuku SUENAGA and kimura wataru)
|
8
|
+
* Fix RGV -> HSV conversion. (patch by Yuta Taniguchi)
|
9
|
+
* Support Cairo::Color as Hash key.
|
10
|
+
|
11
|
+
Thanks
|
12
|
+
------
|
13
|
+
* Yuta Taniguchi
|
14
|
+
* Tasuku SUENAGA
|
15
|
+
* kimura wataru
|
16
|
+
|
1
17
|
Release 1.8.1 (2009-12-13) Kouhei Sutou <kou@cozmixng.org>)
|
2
18
|
===========================================================
|
3
19
|
|
data/Rakefile
CHANGED
@@ -6,14 +6,15 @@ require 'find'
|
|
6
6
|
require 'fileutils'
|
7
7
|
require 'rubygems'
|
8
8
|
require 'hoe'
|
9
|
+
require 'rake/extensiontask'
|
9
10
|
|
10
11
|
base_dir = File.join(File.dirname(__FILE__))
|
11
12
|
truncate_base_dir = Proc.new do |x|
|
12
13
|
x.gsub(/^#{Regexp.escape(base_dir + File::SEPARATOR)}/, '')
|
13
14
|
end
|
14
15
|
|
15
|
-
cairo_ext_dir = File.join(base_dir, '
|
16
|
-
cairo_lib_dir = File.join(
|
16
|
+
cairo_ext_dir = File.join(base_dir, 'ext', 'cairo')
|
17
|
+
cairo_lib_dir = File.join(base_dir, 'lib')
|
17
18
|
$LOAD_PATH.unshift(cairo_ext_dir)
|
18
19
|
$LOAD_PATH.unshift(cairo_lib_dir)
|
19
20
|
ENV["RUBYLIB"] = "#{cairo_lib_dir}:#{cairo_ext_dir}:#{ENV['RUBYLIB']}"
|
@@ -23,17 +24,14 @@ def guess_rcairo_version
|
|
23
24
|
Cairo.bindings_version
|
24
25
|
end
|
25
26
|
|
26
|
-
cairo_win32_dir = "cairo"
|
27
|
-
FileUtils.rm_rf(cairo_win32_dir)
|
28
|
-
|
29
27
|
manifest = File.join(base_dir, "Manifest.txt")
|
30
28
|
manifest_contents = []
|
31
29
|
base_dir_included_components = %w(AUTHORS COPYING ChangeLog GPL
|
32
|
-
NEWS README Rakefile
|
30
|
+
NEWS README.doc Rakefile
|
33
31
|
extconf.rb pkg-config.rb)
|
34
32
|
excluded_components = %w(.cvsignore .gdb_history CVS depend Makefile pkg
|
35
|
-
.test-result)
|
36
|
-
excluded_suffixes = %w(.png .ps .pdf .o .so .a .txt .~)
|
33
|
+
.test-result .gitignore .git vendor)
|
34
|
+
excluded_suffixes = %w(.png .ps .pdf .o .so .a .txt .~ .log)
|
37
35
|
Find.find(base_dir) do |target|
|
38
36
|
target = truncate_base_dir[target]
|
39
37
|
components = target.split(File::SEPARATOR)
|
@@ -76,8 +74,8 @@ project = Hoe.spec('cairo') do |project|
|
|
76
74
|
project.url = 'http://cairographics.org/rcairo'
|
77
75
|
project.test_globs = []
|
78
76
|
project.spec_extras = {
|
79
|
-
:extensions => ['extconf.rb'],
|
80
|
-
:require_paths => ['
|
77
|
+
:extensions => ['ext/cairo/extconf.rb'],
|
78
|
+
:require_paths => ['lib'],
|
81
79
|
:has_rdoc => false,
|
82
80
|
}
|
83
81
|
platform = ENV["FORCE_PLATFORM"]
|
@@ -91,12 +89,13 @@ end
|
|
91
89
|
|
92
90
|
project.spec.dependencies.delete_if {|dependency| dependency.name == "hoe"}
|
93
91
|
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
Rake::ExtensionTask.new("cairo", project.spec) do |ext|
|
93
|
+
ext.cross_compile = true
|
94
|
+
ext.cross_platform = 'x86-mingw32'
|
95
|
+
end
|
97
96
|
|
98
|
-
|
99
|
-
|
97
|
+
if /mswin32/ =~ project.spec.platform.to_s
|
98
|
+
cairo_win32_dir = File.join(base_dir, "vendor", "local")
|
100
99
|
cairo_files = []
|
101
100
|
Find.find(cairo_win32_dir) do |f|
|
102
101
|
cairo_files << f
|
data/{src → ext/cairo}/cairo.def
RENAMED
File without changes
|
@@ -0,0 +1,80 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# vim: filetype=ruby:expandtab:shiftwidth=2:tabstop=8:softtabstop=2 :
|
3
|
+
|
4
|
+
require 'pathname'
|
5
|
+
require 'English'
|
6
|
+
require 'mkmf'
|
7
|
+
require 'fileutils'
|
8
|
+
|
9
|
+
base_dir = (Pathname(__FILE__).dirname + ".." + "..").expand_path
|
10
|
+
$LOAD_PATH.unshift(base_dir.to_s)
|
11
|
+
|
12
|
+
require 'pkg-config'
|
13
|
+
|
14
|
+
checking_for(checking_message("GCC")) do
|
15
|
+
if macro_defined?("__GNUC__", "")
|
16
|
+
$CFLAGS += ' -Wall'
|
17
|
+
true
|
18
|
+
else
|
19
|
+
false
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
package = "cairo"
|
24
|
+
module_name = "cairo"
|
25
|
+
major, minor, micro = 1, 2, 0
|
26
|
+
|
27
|
+
PKGConfig.have_package(package, major, minor, micro) or exit 1
|
28
|
+
|
29
|
+
checking_for(checking_message("Win32 OS")) do
|
30
|
+
case RUBY_PLATFORM
|
31
|
+
when /cygwin|mingw|mswin32/
|
32
|
+
$defs << "-DRUBY_CAIRO_PLATFORM_WIN32"
|
33
|
+
import_library_name = "libruby-#{module_name}.a"
|
34
|
+
$DLDFLAGS << " -Wl,--out-implib=#{import_library_name}"
|
35
|
+
$cleanfiles << import_library_name
|
36
|
+
local_cairo_install_dir = base_dir + "vendor" + "local"
|
37
|
+
$CFLAGS += " -I#{local_cairo_install_dir}/include"
|
38
|
+
local_cairo_lib_dir = local_cairo_install_dir + "lib"
|
39
|
+
["cairo.lib", "libcairo.dll.a"].each do |libcairo_base|
|
40
|
+
libcairo = local_cairo_lib_dir + libcairo_base
|
41
|
+
if libcairo.exist?
|
42
|
+
$LDFLAGS += " -L#{local_cairo_lib_dir}"
|
43
|
+
break
|
44
|
+
end
|
45
|
+
end
|
46
|
+
true
|
47
|
+
else
|
48
|
+
false
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
checking_for(checking_message("Mac OS X")) do
|
53
|
+
case RUBY_PLATFORM
|
54
|
+
when /darwin/
|
55
|
+
if have_macro("CAIRO_HAS_QUARTZ_SURFACE", ["cairo.h"])
|
56
|
+
checking_for("RubyCocoa") do
|
57
|
+
begin
|
58
|
+
require 'osx/cocoa'
|
59
|
+
$defs << "-DHAVE_RUBY_COCOA"
|
60
|
+
$DLDFLAGS << " -Wl,-framework,RubyCocoa"
|
61
|
+
true
|
62
|
+
rescue LoadError
|
63
|
+
false
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
true
|
68
|
+
else
|
69
|
+
false
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
$defs << "-DRB_CAIRO_COMPILATION"
|
74
|
+
|
75
|
+
have_header("ruby/st.h") unless have_macro("HAVE_RUBY_ST_H", "ruby.h")
|
76
|
+
have_header("ruby/io.h") unless have_macro("HAVE_RUBY_IO_H", "ruby.h")
|
77
|
+
have_func("rb_errinfo", "ruby.h")
|
78
|
+
have_type("enum ruby_value_type", "ruby.h")
|
79
|
+
|
80
|
+
create_makefile(module_name)
|
@@ -76,7 +76,7 @@ Init_cairo ()
|
|
76
76
|
|
77
77
|
rb_define_const (rb_mCairo, "BINDINGS_VERSION",
|
78
78
|
rb_ary_new3 (4,
|
79
|
-
INT2FIX (1), INT2FIX (8), INT2FIX (
|
79
|
+
INT2FIX (1), INT2FIX (8), INT2FIX (3), Qnil));
|
80
80
|
|
81
81
|
rb_define_module_function (rb_mCairo, "satisfied_version?",
|
82
82
|
rb_cairo_satisfied_version, -1);
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/extconf.rb
CHANGED
@@ -1,156 +1,45 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# vim: filetype=ruby:expandtab:shiftwidth=2:tabstop=8:softtabstop=2 :
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
require 'English'
|
3
|
+
require 'pathname'
|
7
4
|
require 'mkmf'
|
8
|
-
require '
|
5
|
+
require 'rbconfig'
|
9
6
|
require 'fileutils'
|
10
7
|
|
11
|
-
|
12
|
-
|
13
|
-
STDOUT.flush
|
14
|
-
if macro_defined?("__GNUC__", "")
|
15
|
-
STDOUT.print "yes\n"
|
16
|
-
$CFLAGS += ' -Wall'
|
17
|
-
$cc_is_gcc = true
|
18
|
-
else
|
19
|
-
STDOUT.print "no\n"
|
20
|
-
$cc_is_gcc = false
|
21
|
-
end
|
8
|
+
base_dir = Pathname(__FILE__).dirname.expand_path
|
9
|
+
ext_dir = base_dir + "ext" + "cairo"
|
22
10
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
if win32_os
|
27
|
-
$defs << "-DRUBY_CAIRO_PLATFORM_WIN32"
|
28
|
-
if $cc_is_gcc
|
29
|
-
if /^2\./ =~ `#{Config::CONFIG['CC']} -dumpversion`.chomp
|
30
|
-
$CFLAGS += ' -fnative-struct'
|
31
|
-
else
|
32
|
-
$CFLAGS += ' -mms-bitfields'
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
win32_os
|
37
|
-
end
|
38
|
-
end
|
11
|
+
ruby = File.join(RbConfig::CONFIG['bindir'],
|
12
|
+
RbConfig::CONFIG['ruby_install_name'] +
|
13
|
+
RbConfig::CONFIG["EXEEXT"])
|
39
14
|
|
40
|
-
|
41
|
-
|
42
|
-
when /cygwin|mingw/
|
43
|
-
filename = File.join(*([directory, "libruby-#{target_name}.a"].compact))
|
44
|
-
if RUBY_VERSION > "1.8.0"
|
45
|
-
$DLDFLAGS << ",--out-implib=#{filename}"
|
46
|
-
elsif RUBY_VERSION > "1.8"
|
47
|
-
$DLDFLAGS.gsub!(/ -Wl,--out-implib=[^ ]+/, '')
|
48
|
-
$DLDFLAGS << " -Wl,--out-implib=#{filename}"
|
49
|
-
else
|
50
|
-
$DLDFLAGS.gsub!(/ --output-lib\s+[^ ]+/, '')
|
51
|
-
$DLDFLAGS << " --output-lib #{filename}"
|
52
|
-
end
|
53
|
-
$cleanfiles << filename
|
54
|
-
when /mswin32/
|
55
|
-
$DLDFLAGS.gsub!(/ --output-lib\s+[^ ]+/, '')
|
56
|
-
$DLDFLAGS.gsub!(/ \/IMPLIB:[^ ]+/, '')
|
57
|
-
$DLDFLAGS << " /IMPLIB:$(IMPLIB)"
|
58
|
-
when /darwin/
|
59
|
-
if have_macro("CAIRO_HAS_QUARTZ_SURFACE", ["cairo.h"])
|
60
|
-
checking_for("RubyCocoa") do
|
61
|
-
begin
|
62
|
-
require 'osx/cocoa'
|
63
|
-
$defs << "-DHAVE_RUBY_COCOA"
|
64
|
-
$DLDFLAGS << " -Wl,-framework,RubyCocoa"
|
65
|
-
true
|
66
|
-
rescue LoadError
|
67
|
-
false
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
15
|
+
Dir.chdir(ext_dir.to_s) do
|
16
|
+
system(ruby, "extconf.rb")
|
72
17
|
end
|
73
18
|
|
19
|
+
create_makefile("cairo")
|
20
|
+
FileUtils.mv("Makefile", "Makefile.lib")
|
74
21
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
PKGConfig.have_package(pkg, major, minor, micro) or exit 1
|
22
|
+
File.open("Makefile", "w") do |makefile|
|
23
|
+
makefile.puts(<<-EOM)
|
24
|
+
all:
|
25
|
+
$(MAKE) $(MAKEFLAGS) -C ext/cairo
|
26
|
+
$(MAKE) $(MAKEFLAGS) -f Makefile.lib
|
82
27
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
have_type("enum ruby_value_type", "ruby.h")
|
28
|
+
install:
|
29
|
+
$(MAKE) $(MAKEFLAGS) -C ext/cairo install
|
30
|
+
$(MAKE) $(MAKEFLAGS) -f Makefile.lib install
|
87
31
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
$defs << "-DRB_CAIRO_COMPILATION"
|
92
|
-
create_makefile(modname, srcdir)
|
32
|
+
site-install:
|
33
|
+
$(MAKE) $(MAKEFLAGS) -C ext/cairo site-install
|
34
|
+
$(MAKE) $(MAKEFLAGS) -f Makefile.lib site-install
|
93
35
|
|
94
|
-
|
36
|
+
clean:
|
37
|
+
$(MAKE) $(MAKEFLAGS) -C ext/cairo clean
|
38
|
+
$(MAKE) $(MAKEFLAGS) -f Makefile.lib clean
|
95
39
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
if wine
|
102
|
-
line.gsub!(/\s+gcc\b/, " i586-mingw32msvc-gcc")
|
103
|
-
line.gsub!(/C:/, "$(HOME)/.wine/drive_c")
|
104
|
-
line.gsub!(/Z:/, "")
|
105
|
-
end
|
106
|
-
|
107
|
-
case line
|
108
|
-
when /^DLLIB\s*=\s*/
|
109
|
-
dllib = $POSTMATCH
|
110
|
-
f.puts("DLLIB = #{ext_dir_name}/#{dllib}")
|
111
|
-
f.puts("IMPLIB = #{ext_dir_name}/libruby-#{dllib.gsub(/\..+?$/, '.lib')}")
|
112
|
-
when /^(SRCS)\s*=\s*/
|
113
|
-
name = $1
|
114
|
-
vars = $POSTMATCH.split.collect {|var| "$(srcdir)/#{var}"}.join(" ")
|
115
|
-
f.puts("#{name} = #{vars}")
|
116
|
-
when /^(OBJS|CLEANLIBS|CLEANOBJS)\s*=\s*/
|
117
|
-
name = $1
|
118
|
-
vars = $POSTMATCH.split.collect {|var| "#{ext_dir_name}/#{var}"}
|
119
|
-
objs = vars if name == "OBJS"
|
120
|
-
vars = vars.join(" ")
|
121
|
-
f.puts("#{name} = #{vars}")
|
122
|
-
when /^LDSHARED\s*=/
|
123
|
-
def_file = "#{ext_dir_name}/#{target_name}.def"
|
124
|
-
line.gsub!(/\b-shared\b/, "-shared #{def_file}") if wine
|
125
|
-
f.puts(line)
|
126
|
-
when /^\t\$\(CC\)/
|
127
|
-
if PKGConfig.msvc?
|
128
|
-
output_option = "-Fo"
|
129
|
-
else
|
130
|
-
output_option = "-o"
|
131
|
-
end
|
132
|
-
unless /#{Regexp.escape(output_option)}/ =~ line
|
133
|
-
line = "#{line.chomp} #{output_option}$@"
|
134
|
-
end
|
135
|
-
co = line
|
136
|
-
f.puts(line)
|
137
|
-
else
|
138
|
-
f.puts(line)
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
if co and !objs.empty?
|
143
|
-
f.puts
|
144
|
-
if PKGConfig.msvc?
|
145
|
-
f.puts "{$(srcdir)}.c{#{ext_dir_name}}.obj:"
|
146
|
-
f.puts co
|
147
|
-
else
|
148
|
-
objs.each do |obj|
|
149
|
-
f.puts "#{obj}: $(srcdir)/#{File.basename(obj).sub(/\..+?$/, '.c')}"
|
150
|
-
f.puts co
|
151
|
-
end
|
152
|
-
end
|
153
|
-
end
|
40
|
+
distclean:
|
41
|
+
$(MAKE) $(MAKEFLAGS) -C ext/cairo distclean
|
42
|
+
$(MAKE) $(MAKEFLAGS) -f Makefile.lib distclean
|
43
|
+
@rm -f Makefile.lib
|
44
|
+
EOM
|
154
45
|
end
|
155
|
-
|
156
|
-
FileUtils.mkdir_p(ext_dir_name)
|
data/{src/lib → lib}/cairo.rb
RENAMED
@@ -3,7 +3,7 @@
|
|
3
3
|
if /mingw|mswin|mswin32/ =~ RUBY_PLATFORM
|
4
4
|
require 'pathname'
|
5
5
|
base_dir = Pathname(File.dirname(__FILE__))
|
6
|
-
base_dir = base_dir.parent
|
6
|
+
base_dir = base_dir.parent + "vendor" + "local"
|
7
7
|
if base_dir.exist?
|
8
8
|
base_dir = base_dir.to_s.gsub(/\//, "\\")
|
9
9
|
ENV['PATH'] = %w(bin lib).collect do |dir|
|
@@ -39,7 +39,12 @@ end
|
|
39
39
|
require 'cairo/color'
|
40
40
|
require 'cairo/paper'
|
41
41
|
|
42
|
-
|
42
|
+
begin
|
43
|
+
major, minor, micro, = RUBY_VERSION.split(/\./)
|
44
|
+
require "#{major}.#{minor}/cairo.so"
|
45
|
+
rescue LoadError
|
46
|
+
require 'cairo.so'
|
47
|
+
end
|
43
48
|
require 'cairo/constants'
|
44
49
|
|
45
50
|
module Cairo
|
@@ -88,6 +88,18 @@ module Cairo
|
|
88
88
|
@blue = b
|
89
89
|
end
|
90
90
|
|
91
|
+
def hash
|
92
|
+
to_s.hash
|
93
|
+
end
|
94
|
+
|
95
|
+
def eql?(other)
|
96
|
+
self == other
|
97
|
+
end
|
98
|
+
|
99
|
+
def ==(other)
|
100
|
+
other.is_a?(self.class) and other.to_s == to_s
|
101
|
+
end
|
102
|
+
|
91
103
|
def to_a
|
92
104
|
[@red, @green, @blue, @alpha]
|
93
105
|
end
|
@@ -123,10 +135,10 @@ module Cairo
|
|
123
135
|
when @red
|
124
136
|
numerator = @green - @blue
|
125
137
|
angle = 0
|
126
|
-
when @
|
138
|
+
when @green
|
127
139
|
numerator = @blue - @red
|
128
140
|
angle = 120
|
129
|
-
when @
|
141
|
+
when @blue
|
130
142
|
numerator = @red - @green
|
131
143
|
angle = 240
|
132
144
|
end
|