cairo 1.12.8-x86-mingw32 → 1.12.9-x86-mingw32
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.
- checksums.yaml +4 -4
- data/NEWS +23 -0
- data/Rakefile +20 -11
- data/ext/cairo/rb_cairo.c +1 -0
- data/ext/cairo/rb_cairo.h +1 -1
- data/ext/cairo/rb_cairo_context.c +6 -38
- data/ext/cairo/rb_cairo_private.h +1 -0
- data/ext/cairo/rb_cairo_rectangle.c +83 -0
- data/ext/cairo/rb_cairo_surface.c +52 -20
- data/lib/2.0/cairo.so +0 -0
- data/lib/2.1/cairo.so +0 -0
- data/vendor/local/bin/fc-cache.exe +0 -0
- data/vendor/local/bin/fc-cat.exe +0 -0
- data/vendor/local/bin/fc-list.exe +0 -0
- data/vendor/local/bin/fc-match.exe +0 -0
- data/vendor/local/bin/fc-pattern.exe +0 -0
- data/vendor/local/bin/fc-query.exe +0 -0
- data/vendor/local/bin/fc-scan.exe +0 -0
- data/vendor/local/bin/fc-validate.exe +0 -0
- data/vendor/local/bin/freetype-config +12 -3
- data/vendor/local/bin/libcairo-2.dll +0 -0
- data/vendor/local/bin/libcairo-gobject-2.dll +0 -0
- data/vendor/local/bin/libcairo-script-interpreter-2.dll +0 -0
- data/vendor/local/bin/libfontconfig-1.dll +0 -0
- data/vendor/local/bin/libfreetype-6.dll +0 -0
- data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
- data/vendor/local/bin/libpixman-1-0.dll +0 -0
- data/vendor/local/bin/libpng-config +1 -1
- data/vendor/local/bin/libpng16-16.dll +0 -0
- data/vendor/local/bin/libpng16-config +1 -1
- data/vendor/local/bin/libwinpthread-1.dll +0 -0
- data/vendor/local/bin/libxml2-2.dll +0 -0
- data/vendor/local/bin/png-fix-itxt.exe +0 -0
- data/vendor/local/bin/pngfix.exe +0 -0
- data/vendor/local/bin/xmlcatalog.exe +0 -0
- data/vendor/local/bin/xmllint.exe +0 -0
- data/vendor/local/bin/zlib1.dll +0 -0
- data/vendor/local/etc/fonts/conf.d/30-metric-aliases.conf +51 -2
- data/vendor/local/etc/fonts/fonts.conf +1 -1
- data/vendor/local/include/fontconfig/fontconfig.h +4 -1
- data/vendor/local/include/freetype2/config/ftconfig.h +2 -2
- data/vendor/local/include/freetype2/config/ftoption.h +13 -0
- data/vendor/local/include/freetype2/freetype.h +42 -2
- data/vendor/local/include/freetype2/ftautoh.h +46 -1
- data/vendor/local/include/freetype2/ftbdf.h +3 -2
- data/vendor/local/include/freetype2/ftchapters.h +1 -0
- data/vendor/local/include/freetype2/ftoutln.h +4 -1
- data/vendor/local/include/libpng16/png.h +41 -101
- data/vendor/local/include/libpng16/pngconf.h +33 -6
- data/vendor/local/include/libpng16/pnglibconf.h +1 -1
- data/vendor/local/include/png.h +41 -101
- data/vendor/local/include/pngconf.h +33 -6
- data/vendor/local/include/pnglibconf.h +1 -1
- data/vendor/local/lib/fontconfig.def +1 -0
- data/vendor/local/lib/libcairo-gobject.a +0 -0
- data/vendor/local/lib/libcairo-gobject.dll.a +0 -0
- data/vendor/local/lib/libcairo-script-interpreter.a +0 -0
- data/vendor/local/lib/libcairo-script-interpreter.dll.a +0 -0
- data/vendor/local/lib/libcairo.a +0 -0
- data/vendor/local/lib/libcairo.dll.a +0 -0
- data/vendor/local/lib/libfontconfig.dll.a +0 -0
- data/vendor/local/lib/libfontconfig.la +1 -1
- data/vendor/local/lib/libfreetype.a +0 -0
- data/vendor/local/lib/libfreetype.dll.a +0 -0
- data/vendor/local/lib/libfreetype.la +3 -3
- data/vendor/local/lib/libpixman-1.a +0 -0
- data/vendor/local/lib/libpixman-1.dll.a +0 -0
- data/vendor/local/lib/libpng.a +0 -0
- data/vendor/local/lib/libpng.dll.a +0 -0
- data/vendor/local/lib/libpng.la +2 -2
- data/vendor/local/lib/libpng16.a +0 -0
- data/vendor/local/lib/libpng16.dll.a +0 -0
- data/vendor/local/lib/libpng16.la +2 -2
- data/vendor/local/lib/libxml2.a +0 -0
- data/vendor/local/lib/libxml2.dll.a +0 -0
- data/vendor/local/lib/libz.a +0 -0
- data/vendor/local/lib/libz.dll.a +0 -0
- data/vendor/local/lib/pkgconfig/fontconfig.pc +4 -4
- data/vendor/local/lib/pkgconfig/freetype2.pc +4 -2
- data/vendor/local/lib/pkgconfig/libpng.pc +1 -1
- data/vendor/local/lib/pkgconfig/libpng16.pc +1 -1
- data/vendor/local/share/fontconfig/conf.avail/10-no-sub-pixel.conf +1 -1
- data/vendor/local/share/fontconfig/conf.avail/30-metric-aliases.conf +51 -2
- data/vendor/local/share/license/fontconfig/README +55 -2
- data/vendor/local/share/license/freetype/README +6 -6
- data/vendor/local/share/license/libpng/README +2 -2
- data/vendor/local/share/man/man1/freetype-config.1 +108 -0
- data/vendor/local/share/man/man3/libpng.3 +244 -55
- data/vendor/local/share/man/man3/libpngpf.3 +2 -2
- data/vendor/local/share/man/man5/png.5 +1 -1
- data/vendor/local/share/xml/fontconfig/fonts.dtd +1 -1
- metadata +75 -75
- data/lib/1.9/cairo.so +0 -0
- data/vendor/local/lib/libfontconfig.a +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95cad002f4b037e88d556ed364319b036ab73774
|
4
|
+
data.tar.gz: e311b379d3cca8ae09290f6a6853160f0b6b84ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 627f0a7065903eba9ff54e6fd27e74a5afe63b75619563220fe89c8796263bae1f6b73ae07adb1ccba90457773db39683fc60b8e21054c6953eef9980eff7281
|
7
|
+
data.tar.gz: 019c64c84064e5315ca9021df33d5f332b98ca7d52feb071640ac0ecb7bd8d50f897c33573525b58e933f8c9b46452933d9139606f97148eb15e1da346d85618
|
data/NEWS
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
Release 1.12.9 (2014-04-05) Kouhei Sutou <kou@cozmixng.org>
|
2
|
+
===========================================================
|
3
|
+
|
4
|
+
Improvements
|
5
|
+
------------
|
6
|
+
|
7
|
+
* Supported cocoa gem. [Patch by Patrick Hanevold]
|
8
|
+
* Made Cairo::Rectangle based on cairo_rectangle_int_t. It improves
|
9
|
+
Ruby/GDK3 integration.
|
10
|
+
|
11
|
+
Fixes
|
12
|
+
-----
|
13
|
+
|
14
|
+
* Fixed a bug that Cairo::Context isn't GC-ed without explicit
|
15
|
+
Cairo::Context#destroy.
|
16
|
+
[ruby-gnome2-devel-en][Reported by Detlef Reichl]
|
17
|
+
|
18
|
+
Thanks
|
19
|
+
------
|
20
|
+
|
21
|
+
* Patrick Hanevold
|
22
|
+
* Detlef Reichl
|
23
|
+
|
1
24
|
Release 1.12.8 (2013-12-23) Kouhei Sutou <kou@cozmixng.org>
|
2
25
|
===========================================================
|
3
26
|
|
data/Rakefile
CHANGED
@@ -36,7 +36,11 @@ end
|
|
36
36
|
|
37
37
|
binary_dir = File.join("vendor", "local")
|
38
38
|
Rake::ExtensionTask.new("cairo", spec) do |ext|
|
39
|
-
|
39
|
+
if ENV["RCAIRO_WINDOWS_64"] == "yes"
|
40
|
+
ext.cross_platform = ["x64-mingw32"]
|
41
|
+
else
|
42
|
+
ext.cross_platform = ["x86-mingw32"]
|
43
|
+
end
|
40
44
|
ext.cross_compile = true
|
41
45
|
ext.cross_compiling do |_spec|
|
42
46
|
if /mingw|mswin/ =~ _spec.platform.to_s
|
@@ -131,7 +135,11 @@ class Package < Struct.new(:name,
|
|
131
135
|
end
|
132
136
|
|
133
137
|
def build_host
|
134
|
-
"
|
138
|
+
if ENV["RCAIRO_WINDOWS_64"] == "yes"
|
139
|
+
"x86_64-w64-mingw32"
|
140
|
+
else
|
141
|
+
"i686-w64-mingw32"
|
142
|
+
end
|
135
143
|
end
|
136
144
|
|
137
145
|
def configure_args
|
@@ -178,11 +186,13 @@ class WindowsTask
|
|
178
186
|
namespace :windows do
|
179
187
|
namespace :gcc do
|
180
188
|
namespace :dll do
|
189
|
+
binary_path = install_dir + "bin"
|
190
|
+
directory binary_path.to_s
|
181
191
|
desc "Bundle GCC related DLLs"
|
182
|
-
task :bundle do
|
192
|
+
task :bundle => binary_path do
|
183
193
|
dll_names = ["libgcc_s_sjlj-1.dll", "libwinpthread-1.dll"]
|
184
194
|
dll_names.each do |dll_name|
|
185
|
-
cp(absolete_gcc_dll_path(dll_name),
|
195
|
+
cp(absolete_gcc_dll_path(dll_name), binary_path)
|
186
196
|
end
|
187
197
|
end
|
188
198
|
end
|
@@ -413,16 +423,16 @@ windows_task = WindowsTask.new(spec) do |task|
|
|
413
423
|
},
|
414
424
|
{
|
415
425
|
:name => "libpng",
|
416
|
-
:version => "1.6.
|
417
|
-
:download_base_url => "http://sourceforge.net/projects/libpng/files/libpng16/1.6.
|
426
|
+
:version => "1.6.10",
|
427
|
+
:download_base_url => "http://sourceforge.net/projects/libpng/files/libpng16/1.6.10",
|
418
428
|
:windows => {
|
419
429
|
:built_file => "bin/libpng16-16.dll",
|
420
430
|
},
|
421
431
|
},
|
422
432
|
{
|
423
433
|
:name => "freetype",
|
424
|
-
:version => "2.5.
|
425
|
-
:download_base_url => "http://sourceforge.net/projects/freetype/files/freetype2/2.5.
|
434
|
+
:version => "2.5.3",
|
435
|
+
:download_base_url => "http://sourceforge.net/projects/freetype/files/freetype2/2.5.3",
|
426
436
|
:compression_method => "bz2",
|
427
437
|
:windows => {
|
428
438
|
:built_file => "bin/libfreetype-6.dll",
|
@@ -442,7 +452,7 @@ windows_task = WindowsTask.new(spec) do |task|
|
|
442
452
|
},
|
443
453
|
{
|
444
454
|
:name => "fontconfig",
|
445
|
-
:version => "2.11.
|
455
|
+
:version => "2.11.1",
|
446
456
|
:download_base_url => "http://www.freedesktop.org/software/fontconfig/release",
|
447
457
|
:compression_method => "bz2",
|
448
458
|
:windows => {
|
@@ -452,8 +462,7 @@ windows_task = WindowsTask.new(spec) do |task|
|
|
452
462
|
"--disable-docs",
|
453
463
|
],
|
454
464
|
:patches => [
|
455
|
-
"fontconfig-2.11.
|
456
|
-
"fontconfig-2.11.0-disable-test.diff",
|
465
|
+
"fontconfig-2.11.1-disable-mktemp-s.diff",
|
457
466
|
],
|
458
467
|
:need_autoreconf => true,
|
459
468
|
},
|
data/ext/cairo/rb_cairo.c
CHANGED
data/ext/cairo/rb_cairo.h
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
#include "rb_cairo.h"
|
17
17
|
#include "rb_cairo_private.h"
|
18
|
+
#include "rb_cairo_io.h"
|
18
19
|
|
19
20
|
#ifdef HAVE_RUBY_ST_H
|
20
21
|
# include <ruby/st.h>
|
@@ -23,7 +24,6 @@
|
|
23
24
|
#endif
|
24
25
|
|
25
26
|
VALUE rb_cCairo_Context;
|
26
|
-
VALUE rb_cCairo_Rectangle;
|
27
27
|
|
28
28
|
static ID cr_id_surface, cr_id_source;
|
29
29
|
static ID cr_id_plus, cr_id_minus, cr_id_multi, cr_id_div;
|
@@ -33,22 +33,6 @@ static cairo_user_data_key_t cr_object_holder_key;
|
|
33
33
|
|
34
34
|
static VALUE cr_get_current_point (VALUE self);
|
35
35
|
|
36
|
-
#if CAIRO_CHECK_VERSION(1, 3, 0)
|
37
|
-
static ID at_x, at_y, at_width, at_height;
|
38
|
-
|
39
|
-
static VALUE
|
40
|
-
cr_rectangle_initialize (VALUE self, VALUE x, VALUE y,
|
41
|
-
VALUE width, VALUE height)
|
42
|
-
{
|
43
|
-
rb_ivar_set (self, at_x, x);
|
44
|
-
rb_ivar_set (self, at_y, y);
|
45
|
-
rb_ivar_set (self, at_width, width);
|
46
|
-
rb_ivar_set (self, at_height, height);
|
47
|
-
|
48
|
-
return Qnil;
|
49
|
-
}
|
50
|
-
#endif
|
51
|
-
|
52
36
|
static inline void
|
53
37
|
cr_check_status (cairo_t *context)
|
54
38
|
{
|
@@ -154,10 +138,11 @@ cr_initialize (VALUE self, VALUE target)
|
|
154
138
|
cr = cairo_create (RVAL2CRSURFACE (target));
|
155
139
|
cr_check_status (cr);
|
156
140
|
rb_ivar_set (self, cr_id_surface, target);
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
141
|
+
if (rb_ivar_defined (target, rb_cairo__io_id_output))
|
142
|
+
cr_set_user_data (cr,
|
143
|
+
&cr_object_holder_key,
|
144
|
+
cr_object_holder_new (self),
|
145
|
+
cr_object_holder_free);
|
161
146
|
DATA_PTR (self) = cr;
|
162
147
|
if (rb_block_given_p ())
|
163
148
|
result = rb_ensure (rb_yield, self, cr_destroy_with_destroy_check, self);
|
@@ -1533,23 +1518,6 @@ Init_cairo_context (void)
|
|
1533
1518
|
cr_id_multi = rb_intern ("*");
|
1534
1519
|
cr_id_div = rb_intern ("/");
|
1535
1520
|
|
1536
|
-
#if CAIRO_CHECK_VERSION(1, 3, 0)
|
1537
|
-
rb_cCairo_Rectangle =
|
1538
|
-
rb_define_class_under (rb_mCairo, "Rectangle", rb_cObject);
|
1539
|
-
at_x = rb_intern ("@x");
|
1540
|
-
at_y = rb_intern ("@y");
|
1541
|
-
at_width = rb_intern ("@width");
|
1542
|
-
at_height = rb_intern ("@height");
|
1543
|
-
|
1544
|
-
rb_define_attr (rb_cCairo_Rectangle, "x", CR_TRUE, CR_TRUE);
|
1545
|
-
rb_define_attr (rb_cCairo_Rectangle, "y", CR_TRUE, CR_TRUE);
|
1546
|
-
rb_define_attr (rb_cCairo_Rectangle, "width", CR_TRUE, CR_TRUE);
|
1547
|
-
rb_define_attr (rb_cCairo_Rectangle, "height", CR_TRUE, CR_TRUE);
|
1548
|
-
|
1549
|
-
rb_define_method (rb_cCairo_Rectangle, "initialize",
|
1550
|
-
cr_rectangle_initialize, 4);
|
1551
|
-
#endif
|
1552
|
-
|
1553
1521
|
rb_cCairo_Context =
|
1554
1522
|
rb_define_class_under (rb_mCairo, "Context", rb_cObject);
|
1555
1523
|
|
@@ -48,6 +48,7 @@ extern void Init_cairo_io (void);
|
|
48
48
|
extern void Init_cairo_constants (void);
|
49
49
|
|
50
50
|
extern void Init_cairo_context (void);
|
51
|
+
extern void Init_cairo_rectangle (void);
|
51
52
|
extern void Init_cairo_path (void);
|
52
53
|
extern void Init_cairo_matrix (void);
|
53
54
|
extern void Init_cairo_region (void);
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/* -*- c-file-style: "gnu"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Ruby Cairo Binding
|
4
|
+
*
|
5
|
+
* Copyright 2005-2014 Kouhei Sutou <kou@cozmixng.org>
|
6
|
+
*
|
7
|
+
* This file is made available under the same terms as Ruby
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
|
11
|
+
#include "rb_cairo.h"
|
12
|
+
|
13
|
+
VALUE rb_cCairo_Rectangle;
|
14
|
+
|
15
|
+
#define _SELF ((cairo_rectangle_int_t *)DATA_PTR (self))
|
16
|
+
|
17
|
+
#if CAIRO_CHECK_VERSION(1, 10, 0)
|
18
|
+
static VALUE
|
19
|
+
cr_rectangle_allocate (VALUE klass)
|
20
|
+
{
|
21
|
+
return Data_Wrap_Struct (klass, NULL, xfree, NULL);
|
22
|
+
}
|
23
|
+
|
24
|
+
static VALUE
|
25
|
+
cr_rectangle_initialize (VALUE self, VALUE x, VALUE y,
|
26
|
+
VALUE width, VALUE height)
|
27
|
+
{
|
28
|
+
cairo_rectangle_int_t *rectangle;
|
29
|
+
|
30
|
+
rectangle = ALLOC (cairo_rectangle_int_t);
|
31
|
+
DATA_PTR (self) = rectangle;
|
32
|
+
|
33
|
+
rectangle->x = NUM2INT (x);
|
34
|
+
rectangle->y = NUM2INT (y);
|
35
|
+
rectangle->width = NUM2INT (width);
|
36
|
+
rectangle->height = NUM2INT (height);
|
37
|
+
|
38
|
+
return Qnil;
|
39
|
+
}
|
40
|
+
|
41
|
+
# define DEFINE_RECTANGLE_ACCESSOR(name) \
|
42
|
+
static VALUE \
|
43
|
+
cr_rectangle_get_ ## name (VALUE self) \
|
44
|
+
{ \
|
45
|
+
return INT2NUM (_SELF->name); \
|
46
|
+
} \
|
47
|
+
\
|
48
|
+
static VALUE \
|
49
|
+
cr_rectangle_set_ ## name (VALUE self, VALUE value) \
|
50
|
+
{ \
|
51
|
+
_SELF->name = NUM2INT (value); \
|
52
|
+
return self; \
|
53
|
+
}
|
54
|
+
|
55
|
+
DEFINE_RECTANGLE_ACCESSOR(x)
|
56
|
+
DEFINE_RECTANGLE_ACCESSOR(y)
|
57
|
+
DEFINE_RECTANGLE_ACCESSOR(width)
|
58
|
+
DEFINE_RECTANGLE_ACCESSOR(height)
|
59
|
+
|
60
|
+
# undef DEFINE_RECTANGLE_ACCESSOR
|
61
|
+
#endif
|
62
|
+
|
63
|
+
void
|
64
|
+
Init_cairo_rectangle (void)
|
65
|
+
{
|
66
|
+
#if CAIRO_CHECK_VERSION(1, 10, 0)
|
67
|
+
rb_cCairo_Rectangle =
|
68
|
+
rb_define_class_under (rb_mCairo, "Rectangle", rb_cObject);
|
69
|
+
rb_define_alloc_func (rb_cCairo_Rectangle, cr_rectangle_allocate);
|
70
|
+
|
71
|
+
rb_define_method (rb_cCairo_Rectangle, "initialize",
|
72
|
+
cr_rectangle_initialize, 4);
|
73
|
+
|
74
|
+
rb_define_method (rb_cCairo_Rectangle, "x", cr_rectangle_get_x, 0);
|
75
|
+
rb_define_method (rb_cCairo_Rectangle, "x=", cr_rectangle_set_x, 1);
|
76
|
+
rb_define_method (rb_cCairo_Rectangle, "y", cr_rectangle_get_y, 0);
|
77
|
+
rb_define_method (rb_cCairo_Rectangle, "y=", cr_rectangle_set_y, 1);
|
78
|
+
rb_define_method (rb_cCairo_Rectangle, "width", cr_rectangle_get_width, 0);
|
79
|
+
rb_define_method (rb_cCairo_Rectangle, "width=", cr_rectangle_set_width, 1);
|
80
|
+
rb_define_method (rb_cCairo_Rectangle, "height", cr_rectangle_get_height, 0);
|
81
|
+
rb_define_method (rb_cCairo_Rectangle, "height=", cr_rectangle_set_height, 1);
|
82
|
+
#endif
|
83
|
+
}
|
@@ -2,10 +2,8 @@
|
|
2
2
|
/*
|
3
3
|
* Ruby Cairo Binding
|
4
4
|
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
* Copyright 2005-2012 Kouhei Sutou <kou@cozmixng.org>
|
5
|
+
* Copyright 2005-2014 Kouhei Sutou <kou@cozmixng.org>
|
6
|
+
* Copyright 2014 Patrick Hanevold <patrick.hanevold@gmail.com>
|
9
7
|
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
|
10
8
|
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
|
11
9
|
*
|
@@ -55,11 +53,9 @@ enum ruby_value_type {
|
|
55
53
|
# undef T_DATA
|
56
54
|
# include <cairo-quartz.h>
|
57
55
|
# define T_DATA RUBY_T_DATA
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
# define RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE
|
62
|
-
# endif
|
56
|
+
# define RB_CAIRO_HAS_QUARTZ_SURFACE
|
57
|
+
# ifdef RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE_TYPE
|
58
|
+
# define RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE
|
63
59
|
# endif
|
64
60
|
#endif
|
65
61
|
|
@@ -106,6 +102,10 @@ VALUE rb_cCairo_CoglSurface = Qnil;
|
|
106
102
|
static ID cr_id_parse;
|
107
103
|
static ID cr_id_size;
|
108
104
|
static ID cr_id_set_unit;
|
105
|
+
static ID cr_id_x;
|
106
|
+
static ID cr_id_y;
|
107
|
+
static ID cr_id_width;
|
108
|
+
static ID cr_id_height;
|
109
109
|
static cairo_user_data_key_t cr_closure_key;
|
110
110
|
static cairo_user_data_key_t cr_object_holder_key;
|
111
111
|
static cairo_user_data_key_t cr_finished_key;
|
@@ -571,10 +571,10 @@ cr_surface_map_to_image (int argc, VALUE *argv, VALUE self)
|
|
571
571
|
extents = &extents_value;
|
572
572
|
if (rb_cairo__is_kind_of (rb_extents, rb_cCairo_Rectangle))
|
573
573
|
{
|
574
|
-
extents->x = NUM2INT (
|
575
|
-
extents->y = NUM2INT (
|
576
|
-
extents->width = NUM2INT (
|
577
|
-
extents->height = NUM2INT (
|
574
|
+
extents->x = NUM2INT (rb_funcall (rb_extents, cr_id_x, 0));
|
575
|
+
extents->y = NUM2INT (rb_funcall (rb_extents, cr_id_y, 0));
|
576
|
+
extents->width = NUM2INT (rb_funcall (rb_extents, cr_id_width, 0));
|
577
|
+
extents->height = NUM2INT (rb_funcall (rb_extents, cr_id_height, 0));
|
578
578
|
}
|
579
579
|
else
|
580
580
|
{
|
@@ -1211,7 +1211,10 @@ cr_quartz_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
1211
1211
|
cairo_surface_t *surface = NULL;
|
1212
1212
|
cairo_format_t format = CAIRO_FORMAT_ARGB32;
|
1213
1213
|
VALUE arg1, arg2, arg3, rb_width, rb_height;
|
1214
|
+
#ifdef HAVE_RUBY_COCOA
|
1214
1215
|
static VALUE rb_cOSXCGContextRef = Qnil;
|
1216
|
+
#endif
|
1217
|
+
static VALUE rb_cFFIPointer = Qnil;
|
1215
1218
|
|
1216
1219
|
rb_scan_args (argc, argv, "21", &arg1, &arg2, &arg3);
|
1217
1220
|
|
@@ -1232,20 +1235,45 @@ cr_quartz_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
1232
1235
|
format = RVAL2CRFORMAT (arg1);
|
1233
1236
|
break;
|
1234
1237
|
default:
|
1238
|
+
#ifdef HAVE_RUBY_COCOA
|
1235
1239
|
if (NIL_P (rb_cOSXCGContextRef))
|
1236
1240
|
rb_cOSXCGContextRef =
|
1237
1241
|
rb_const_get (rb_const_get (rb_cObject, rb_intern ("OSX")),
|
1238
1242
|
rb_intern ("CGContextRef"));
|
1243
|
+
#endif
|
1239
1244
|
|
1245
|
+
if (NIL_P (rb_cFFIPointer))
|
1246
|
+
rb_cFFIPointer =
|
1247
|
+
rb_const_get (rb_const_get (rb_cObject, rb_intern ("FFI")),
|
1248
|
+
rb_intern ("Pointer"));
|
1249
|
+
|
1250
|
+
#ifdef HAVE_RUBY_COCOA
|
1240
1251
|
if (RTEST (rb_obj_is_kind_of (arg1, rb_cOSXCGContextRef)))
|
1241
|
-
|
1252
|
+
{
|
1253
|
+
rbobj_to_nsobj (arg1, &objc_object);
|
1254
|
+
}
|
1242
1255
|
else
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1256
|
+
#endif
|
1257
|
+
{
|
1258
|
+
if (RTEST (rb_obj_is_kind_of (arg1, rb_cFFIPointer)))
|
1259
|
+
{
|
1260
|
+
VALUE rb_objc_pointer;
|
1261
|
+
rb_objc_pointer = rb_funcall (arg1,
|
1262
|
+
rb_intern ("address"),
|
1263
|
+
0);
|
1264
|
+
objc_object = NUM2ULONG (rb_objc_pointer);
|
1265
|
+
}
|
1266
|
+
else
|
1267
|
+
{
|
1268
|
+
rb_raise (rb_eArgError,
|
1269
|
+
"invalid argument (expect "
|
1270
|
+
"(width, height), "
|
1271
|
+
"(format, width, height), "
|
1272
|
+
"(cg_context, width, height) or "
|
1273
|
+
"(ffi_pointer, width, height)): %s",
|
1274
|
+
rb_cairo__inspect (rb_ary_new3 (3, arg1, arg2, arg3)));
|
1275
|
+
}
|
1276
|
+
}
|
1249
1277
|
break;
|
1250
1278
|
}
|
1251
1279
|
|
@@ -1893,6 +1921,10 @@ Init_cairo_surface (void)
|
|
1893
1921
|
cr_id_parse = rb_intern ("parse");
|
1894
1922
|
cr_id_size = rb_intern ("size");
|
1895
1923
|
cr_id_set_unit = rb_intern ("unit=");
|
1924
|
+
cr_id_x = rb_intern ("x");
|
1925
|
+
cr_id_y = rb_intern ("y");
|
1926
|
+
cr_id_width = rb_intern ("width");
|
1927
|
+
cr_id_height = rb_intern ("height");
|
1896
1928
|
|
1897
1929
|
rb_cCairo_Surface =
|
1898
1930
|
rb_define_class_under (rb_mCairo, "Surface", rb_cObject);
|
data/lib/2.0/cairo.so
CHANGED
Binary file
|
data/lib/2.1/cairo.so
CHANGED
Binary file
|
Binary file
|
data/vendor/local/bin/fc-cat.exe
CHANGED
Binary file
|
Binary file
|