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.

Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/NEWS +23 -0
  3. data/Rakefile +20 -11
  4. data/ext/cairo/rb_cairo.c +1 -0
  5. data/ext/cairo/rb_cairo.h +1 -1
  6. data/ext/cairo/rb_cairo_context.c +6 -38
  7. data/ext/cairo/rb_cairo_private.h +1 -0
  8. data/ext/cairo/rb_cairo_rectangle.c +83 -0
  9. data/ext/cairo/rb_cairo_surface.c +52 -20
  10. data/lib/2.0/cairo.so +0 -0
  11. data/lib/2.1/cairo.so +0 -0
  12. data/vendor/local/bin/fc-cache.exe +0 -0
  13. data/vendor/local/bin/fc-cat.exe +0 -0
  14. data/vendor/local/bin/fc-list.exe +0 -0
  15. data/vendor/local/bin/fc-match.exe +0 -0
  16. data/vendor/local/bin/fc-pattern.exe +0 -0
  17. data/vendor/local/bin/fc-query.exe +0 -0
  18. data/vendor/local/bin/fc-scan.exe +0 -0
  19. data/vendor/local/bin/fc-validate.exe +0 -0
  20. data/vendor/local/bin/freetype-config +12 -3
  21. data/vendor/local/bin/libcairo-2.dll +0 -0
  22. data/vendor/local/bin/libcairo-gobject-2.dll +0 -0
  23. data/vendor/local/bin/libcairo-script-interpreter-2.dll +0 -0
  24. data/vendor/local/bin/libfontconfig-1.dll +0 -0
  25. data/vendor/local/bin/libfreetype-6.dll +0 -0
  26. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  27. data/vendor/local/bin/libpixman-1-0.dll +0 -0
  28. data/vendor/local/bin/libpng-config +1 -1
  29. data/vendor/local/bin/libpng16-16.dll +0 -0
  30. data/vendor/local/bin/libpng16-config +1 -1
  31. data/vendor/local/bin/libwinpthread-1.dll +0 -0
  32. data/vendor/local/bin/libxml2-2.dll +0 -0
  33. data/vendor/local/bin/png-fix-itxt.exe +0 -0
  34. data/vendor/local/bin/pngfix.exe +0 -0
  35. data/vendor/local/bin/xmlcatalog.exe +0 -0
  36. data/vendor/local/bin/xmllint.exe +0 -0
  37. data/vendor/local/bin/zlib1.dll +0 -0
  38. data/vendor/local/etc/fonts/conf.d/30-metric-aliases.conf +51 -2
  39. data/vendor/local/etc/fonts/fonts.conf +1 -1
  40. data/vendor/local/include/fontconfig/fontconfig.h +4 -1
  41. data/vendor/local/include/freetype2/config/ftconfig.h +2 -2
  42. data/vendor/local/include/freetype2/config/ftoption.h +13 -0
  43. data/vendor/local/include/freetype2/freetype.h +42 -2
  44. data/vendor/local/include/freetype2/ftautoh.h +46 -1
  45. data/vendor/local/include/freetype2/ftbdf.h +3 -2
  46. data/vendor/local/include/freetype2/ftchapters.h +1 -0
  47. data/vendor/local/include/freetype2/ftoutln.h +4 -1
  48. data/vendor/local/include/libpng16/png.h +41 -101
  49. data/vendor/local/include/libpng16/pngconf.h +33 -6
  50. data/vendor/local/include/libpng16/pnglibconf.h +1 -1
  51. data/vendor/local/include/png.h +41 -101
  52. data/vendor/local/include/pngconf.h +33 -6
  53. data/vendor/local/include/pnglibconf.h +1 -1
  54. data/vendor/local/lib/fontconfig.def +1 -0
  55. data/vendor/local/lib/libcairo-gobject.a +0 -0
  56. data/vendor/local/lib/libcairo-gobject.dll.a +0 -0
  57. data/vendor/local/lib/libcairo-script-interpreter.a +0 -0
  58. data/vendor/local/lib/libcairo-script-interpreter.dll.a +0 -0
  59. data/vendor/local/lib/libcairo.a +0 -0
  60. data/vendor/local/lib/libcairo.dll.a +0 -0
  61. data/vendor/local/lib/libfontconfig.dll.a +0 -0
  62. data/vendor/local/lib/libfontconfig.la +1 -1
  63. data/vendor/local/lib/libfreetype.a +0 -0
  64. data/vendor/local/lib/libfreetype.dll.a +0 -0
  65. data/vendor/local/lib/libfreetype.la +3 -3
  66. data/vendor/local/lib/libpixman-1.a +0 -0
  67. data/vendor/local/lib/libpixman-1.dll.a +0 -0
  68. data/vendor/local/lib/libpng.a +0 -0
  69. data/vendor/local/lib/libpng.dll.a +0 -0
  70. data/vendor/local/lib/libpng.la +2 -2
  71. data/vendor/local/lib/libpng16.a +0 -0
  72. data/vendor/local/lib/libpng16.dll.a +0 -0
  73. data/vendor/local/lib/libpng16.la +2 -2
  74. data/vendor/local/lib/libxml2.a +0 -0
  75. data/vendor/local/lib/libxml2.dll.a +0 -0
  76. data/vendor/local/lib/libz.a +0 -0
  77. data/vendor/local/lib/libz.dll.a +0 -0
  78. data/vendor/local/lib/pkgconfig/fontconfig.pc +4 -4
  79. data/vendor/local/lib/pkgconfig/freetype2.pc +4 -2
  80. data/vendor/local/lib/pkgconfig/libpng.pc +1 -1
  81. data/vendor/local/lib/pkgconfig/libpng16.pc +1 -1
  82. data/vendor/local/share/fontconfig/conf.avail/10-no-sub-pixel.conf +1 -1
  83. data/vendor/local/share/fontconfig/conf.avail/30-metric-aliases.conf +51 -2
  84. data/vendor/local/share/license/fontconfig/README +55 -2
  85. data/vendor/local/share/license/freetype/README +6 -6
  86. data/vendor/local/share/license/libpng/README +2 -2
  87. data/vendor/local/share/man/man1/freetype-config.1 +108 -0
  88. data/vendor/local/share/man/man3/libpng.3 +244 -55
  89. data/vendor/local/share/man/man3/libpngpf.3 +2 -2
  90. data/vendor/local/share/man/man5/png.5 +1 -1
  91. data/vendor/local/share/xml/fontconfig/fonts.dtd +1 -1
  92. metadata +75 -75
  93. data/lib/1.9/cairo.so +0 -0
  94. data/vendor/local/lib/libfontconfig.a +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7b04f850e93e5c53cf9fcefd1676a5fae30f535
4
- data.tar.gz: ab13f9e5d3a5615929e037d2387f90e3357fead2
3
+ metadata.gz: 95cad002f4b037e88d556ed364319b036ab73774
4
+ data.tar.gz: e311b379d3cca8ae09290f6a6853160f0b6b84ac
5
5
  SHA512:
6
- metadata.gz: 7ba953a0cf48df0419119d71534c550043c6bf67c62520fd1437e437b3e0de2aece0967a4ddc29041c35c2a31eadf9e46f072c584e1b971bd8aaeefaab699d7f
7
- data.tar.gz: eced3fe2a0b44a5f6b2bbf6d732d9bc37ea5c588deaa16a8731865e1ac437b41e89dc5ee5ecd84a0b9c6fb59b07578abc08f15cce39aa3bda8f043ff27b3587f
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
- ext.cross_platform = ["x86-mingw32"]
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
- "i686-w64-mingw32"
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), install_dir + "bin")
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.8",
417
- :download_base_url => "http://sourceforge.net/projects/libpng/files/libpng16/1.6.8",
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.2",
425
- :download_base_url => "http://sourceforge.net/projects/freetype/files/freetype2/2.5.2",
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.0",
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.0-disable-mktemp-s.diff",
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
@@ -93,6 +93,7 @@ Init_cairo ()
93
93
  Init_cairo_constants ();
94
94
 
95
95
  Init_cairo_context ();
96
+ Init_cairo_rectangle ();
96
97
  Init_cairo_path ();
97
98
  Init_cairo_matrix ();
98
99
  Init_cairo_region ();
data/ext/cairo/rb_cairo.h CHANGED
@@ -73,7 +73,7 @@ RB_CAIRO_BEGIN_DECLS
73
73
 
74
74
  #define RB_CAIRO_VERSION_MAJOR 1
75
75
  #define RB_CAIRO_VERSION_MINOR 12
76
- #define RB_CAIRO_VERSION_MICRO 8
76
+ #define RB_CAIRO_VERSION_MICRO 9
77
77
 
78
78
  RB_CAIRO_VAR VALUE rb_mCairo;
79
79
  RB_CAIRO_VAR VALUE rb_cCairo_Context;
@@ -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
- cr_set_user_data (cr,
158
- &cr_object_holder_key,
159
- cr_object_holder_new(self),
160
- cr_object_holder_free);
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
- * $Author: kou $
6
- * $Date: 2008-11-01 14:23:14 $
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
- # ifdef HAVE_RUBY_COCOA
59
- # define RB_CAIRO_HAS_QUARTZ_SURFACE
60
- # ifdef RB_CAIRO_HAS_QUARTZ_IMAGE_SURFACE_TYPE
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 (rb_iv_get (rb_extents, "@x"));
575
- extents->y = NUM2INT (rb_iv_get (rb_extents, "@y"));
576
- extents->width = NUM2INT (rb_iv_get (rb_extents, "@width"));
577
- extents->height = NUM2INT (rb_iv_get (rb_extents, "@height"));
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
- rbobj_to_nsobj (arg1, &objc_object);
1252
+ {
1253
+ rbobj_to_nsobj (arg1, &objc_object);
1254
+ }
1242
1255
  else
1243
- rb_raise (rb_eArgError,
1244
- "invalid argument (expect "
1245
- "(width, height), "
1246
- "(format, width, height) or "
1247
- "(cg_context, width, height)): %s",
1248
- rb_cairo__inspect (rb_ary_new3 (3, arg1, arg2, arg3)));
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
Binary file
Binary file