cairo 1.16.2 → 1.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eac6096f7ad06e67fb313f0b9afdfcca2fbfe9fe4f8a3d7ae4e3de5d0d539ce6
4
- data.tar.gz: 432ee21e533650fc59bb9ef65de42710b66f7493beedd2e0623ed65c1ab8f513
3
+ metadata.gz: f4d45ddf05c3bd2840bdc6f85f17b134625cc5d5fabcc47a1c182fd2868d37c5
4
+ data.tar.gz: b3f5c9fe2a34a496fece236be896d82c2a7d0615fab0d3a86158db36e592c7fe
5
5
  SHA512:
6
- metadata.gz: 3cbf91510b8febca95349591625e8f462c24492bf4f4f23be909a261d249d4ae582abda2f178098194a5d7bc14001318b0c322c7ddad02caffd3ba801f16fc5a
7
- data.tar.gz: 8e867e4a005d7fce79a0a9604e6b9e2e614b5ac3d16a944ae188c79965af2da0522fbd7115bf32952c3cc9e6b8327417e778b156f056264833f17569a32158e3
6
+ metadata.gz: f78c4b463a008645ca76fd791e8bb9f40d56712a1883a7414e228a9977e47447e58bbe479cc5de25e0ca8b36dd4e383b0ba061c7e7a4fadaaacb744acc4d5979
7
+ data.tar.gz: 566f60ce9e7bb301fa972fa37f28e1d7107e735b3e9178714c845d60955d1b64fe01e0ca8d1efc36291f8b927a9ee2c44cf11b68e1811465f55b1dfee619b9ea
data/NEWS CHANGED
@@ -1,5 +1,102 @@
1
+ Release 1.17.4 (2021-01-17) Sutou Kouhei <kou@cozmixng.org>
2
+ ===========================================================
3
+
4
+ Improvements
5
+ ------------
6
+
7
+ * Added support for Red Colors.
8
+
9
+ Release 1.16.6 (2020-07-23) Sutou Kouhei <kou@cozmixng.org>
10
+ ===========================================================
11
+
12
+ Improvements
13
+ ------------
14
+
15
+ * Specified GPL 2.0 or later explicitly in gemspec.
16
+ [GitHub#62][Reported by Gabriel Mazetto]
17
+
18
+ * Added more metadata to gem.
19
+ [GitHub#63][Patch by Gabriel Mazetto]
20
+
21
+ Fixes
22
+ -----
23
+
24
+ * Windows: Fixed a link error.
25
+ [GitHub#ruby-gnome/ruby-gnome#1402][Reported by dsisnero]
26
+
27
+ Thanks
28
+ ------
29
+
30
+ * Gabriel Mazetto
31
+
32
+ * dsisnero
33
+
34
+ Release 1.16.5 (2020-02-03) Sutou Kouhei <kou@cozmixng.org>
35
+ ===========================================================
36
+
37
+ Improvements
38
+ ------------
39
+
40
+ * Added Cairo::Context#raw_address for integration with other
41
+ libraries.
42
+ [GitHub#59][Reported by kojix2]
43
+
44
+ Fixes
45
+ -----
46
+
47
+ * Changed to use only ASCII for color name.
48
+ [GitHub#57][Reported by spoolkitamura]
49
+
50
+ * Fixed the number of arguments of the following methods:
51
+
52
+ * Cairo::Surface#copy_page
53
+
54
+ * Cairo::Surface#show_page
55
+
56
+ Thanks
57
+ ------
58
+
59
+ * spoolkitamura
60
+
61
+ * kojix2
62
+
63
+ Release 1.16.4 (2019-03-09) Kouhei Sutou <kou@cozmixng.org>
64
+ ===========================================================
65
+
66
+ Fixes
67
+ -----
68
+
69
+ * Removed Skia related code entirely.
70
+
71
+ Release 1.16.3 (2019-03-09) Kouhei Sutou <kou@cozmixng.org>
72
+ ===========================================================
73
+
74
+ Improvements
75
+ ------------
76
+
77
+ * Improved Cairo::Poinst#distance performance.
78
+ [GitHub#53][Patch by scivola]
79
+
80
+ * Added support for building with cairo and GLib 2.60 installed by
81
+ Homebrew.
82
+
83
+ * Updated colors. There are some backward incompatibility. Sorry.
84
+
85
+ Fixes
86
+ -----
87
+
88
+ * Fixed Cairo::Color::RGB#to_s.
89
+ [GitHub#55][Patch by spoolkitamura]
90
+
91
+ Thanks
92
+ ------
93
+
94
+ * scivola
95
+
96
+ * spoolkitamura.
97
+
1
98
  Release 1.16.2 (2018-10-31) Kouhei Sutou <kou@cozmixng.org>
2
- ============================================================
99
+ ===========================================================
3
100
 
4
101
  Improvements
5
102
  ------------
@@ -8,7 +105,7 @@ Improvements
8
105
  MSYS2 packages.
9
106
 
10
107
  Release 1.16.1 (2018-10-31) Kouhei Sutou <kou@cozmixng.org>
11
- ============================================================
108
+ ===========================================================
12
109
 
13
110
  Improvements
14
111
  ------------
@@ -16,7 +113,7 @@ Improvements
16
113
  * Added Cairo::Context#destroyed?.
17
114
 
18
115
  Release 1.16.0 (2018-10-28) Kouhei Sutou <kou@cozmixng.org>
19
- ============================================================
116
+ ===========================================================
20
117
 
21
118
  Improvements
22
119
  ------------
data/Rakefile CHANGED
@@ -1,13 +1,6 @@
1
1
  # -*- coding: utf-8; mode: ruby -*-
2
2
 
3
- require "English"
4
-
5
- require "find"
6
- require "fileutils"
7
- require "open-uri"
8
3
  require "rubygems"
9
- require "rubygems/package_task"
10
- require "yard"
11
4
  require "bundler/gem_helper"
12
5
  require "packnga"
13
6
 
@@ -32,6 +25,7 @@ Packnga::ReleaseTask.new(spec) do |task|
32
25
  end
33
26
 
34
27
  # for releasing
28
+ desc "Release to cairographics.org"
35
29
  task :dist do
36
30
  sh "./dist.sh", spec.version.to_s
37
31
  end
@@ -50,7 +50,6 @@ EXPORTS
50
50
  rb_cCairo_DRMSurface DATA
51
51
  rb_cCairo_TeeSurface DATA
52
52
  rb_cCairo_XMLSurface DATA
53
- rb_cCairo_SkiaSurface DATA
54
53
  rb_cCairo_SubSurface DATA
55
54
  rb_cCairo_CoglSurface DATA
56
55
 
@@ -22,21 +22,11 @@ package = "cairo"
22
22
  module_name = "cairo"
23
23
  major, minor, micro = 1, 2, 0
24
24
 
25
- base_dir = Pathname(__FILE__).dirname.parent.parent
26
- checking_for(checking_message("Win32 OS")) do
27
- case RUBY_PLATFORM
28
- when /mingw|mswin32/
29
- $defs << "-DRUBY_CAIRO_PLATFORM_WIN32"
30
- import_library_name = "libruby-#{module_name}.a"
31
- $DLDFLAGS << " -Wl,--out-implib=#{import_library_name}"
32
- $cleanfiles << import_library_name
33
- binary_base_dir = base_dir + "vendor" + "local"
34
- if with_config('vendor-override', binary_base_dir.exist?)
35
- $CFLAGS += " -I#{binary_base_dir}/include"
36
- pkg_config_dir = binary_base_dir + "lib" + "pkgconfig"
37
- PKGConfig.add_path(pkg_config_dir.to_s)
38
- PKGConfig.set_override_variable("prefix", binary_base_dir.to_s)
39
- end
25
+ checking_for(checking_message("Homebrew")) do
26
+ platform = NativePackageInstaller::Platform.detect
27
+ if platform.is_a?(NativePackageInstaller::Platform::Homebrew)
28
+ libffi_prefix = `brew --prefix libffi`.chomp
29
+ PKGConfig.add_path("#{libffi_prefix}/lib/pkgconfig")
40
30
  true
41
31
  else
42
32
  false
@@ -58,17 +48,18 @@ def required_pkg_config_package(package_info, native_package_info=nil)
58
48
  end
59
49
 
60
50
  unless required_pkg_config_package([package, major, minor, micro],
51
+ :arch_linux => "cairo",
61
52
  :debian => "libcairo2-dev",
62
- :redhat => "cairo-devel",
63
53
  :homebrew => "cairo",
64
54
  :macports => "cairo",
65
- :msys2 => "cairo")
55
+ :msys2 => "cairo",
56
+ :redhat => "cairo-devel")
66
57
  exit(false)
67
58
  end
68
59
 
69
60
  PKGConfig.have_package("cairo-ft")
70
61
 
71
- checking_for(checking_message("Mac OS X")) do
62
+ checking_for(checking_message("macOS")) do
72
63
  case RUBY_PLATFORM
73
64
  when /darwin/
74
65
  if have_macro("CAIRO_HAS_QUARTZ_SURFACE", ["cairo.h"])
@@ -5,7 +5,7 @@
5
5
  * $Author: kou $
6
6
  * $Date: 2008-09-19 12:56:27 $
7
7
  *
8
- * Copyright 2006-2018 Kouhei Sutou <kou@cozmixng.org>
8
+ * Copyright 2006-2021 Sutou Kouhei <kou@cozmixng.org>
9
9
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
10
10
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
11
11
  *
@@ -53,17 +53,9 @@
53
53
 
54
54
  RB_CAIRO_BEGIN_DECLS
55
55
 
56
- #if defined(RUBY_CAIRO_PLATFORM_WIN32) && !defined(RB_CAIRO_PLATFORM_WIN32)
57
- # define RB_CAIRO_PLATFORM_WIN32 RUBY_CAIRO_PLATFORM_WIN32
58
- #endif
59
-
60
- #if defined(RUBY_CAIRO_STATIC_COMPILATION) && !defined(RB_CAIRO_STATIC_COMPILATION)
61
- # define RB_CAIRO_STATIC_COMPILATION RUBY_CAIRO_STATIC_COMPILATION
62
- #endif
63
-
64
- #if defined(RB_CAIRO_PLATFORM_WIN32) && !defined(RB_CAIRO_STATIC_COMPILATION)
56
+ #ifdef __WIN32__
65
57
  # ifdef RB_CAIRO_COMPILATION
66
- # define RB_CAIRO_VAR __declspec(dllexport)
58
+ # define RB_CAIRO_VAR extern __declspec(dllexport)
67
59
  # else
68
60
  # define RB_CAIRO_VAR extern __declspec(dllimport)
69
61
  # endif
@@ -72,8 +64,8 @@ RB_CAIRO_BEGIN_DECLS
72
64
  #endif
73
65
 
74
66
  #define RB_CAIRO_VERSION_MAJOR 1
75
- #define RB_CAIRO_VERSION_MINOR 16
76
- #define RB_CAIRO_VERSION_MICRO 2
67
+ #define RB_CAIRO_VERSION_MINOR 17
68
+ #define RB_CAIRO_VERSION_MICRO 4
77
69
 
78
70
  RB_CAIRO_VAR VALUE rb_mCairo;
79
71
  RB_CAIRO_VAR VALUE rb_cCairo_Context;
@@ -125,7 +117,6 @@ RB_CAIRO_VAR VALUE rb_cCairo_GLTextureSurface;
125
117
  RB_CAIRO_VAR VALUE rb_cCairo_DRMSurface;
126
118
  RB_CAIRO_VAR VALUE rb_cCairo_TeeSurface;
127
119
  RB_CAIRO_VAR VALUE rb_cCairo_XMLSurface;
128
- RB_CAIRO_VAR VALUE rb_cCairo_SkiaSurface;
129
120
  RB_CAIRO_VAR VALUE rb_cCairo_SubSurface;
130
121
  RB_CAIRO_VAR VALUE rb_cCairo_Device;
131
122
  RB_CAIRO_VAR VALUE rb_cCairo_DRMDevice;
@@ -5,7 +5,7 @@
5
5
  * $Author: kou $
6
6
  * $Date: 2008-09-19 12:56:27 $
7
7
  *
8
- * Copyright 2005-2017 Kouhei Sutou <kou@cozmixng.org>
8
+ * Copyright 2005-2019 Kouhei Sutou <kou@cozmixng.org>
9
9
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
10
10
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
11
11
  *
@@ -92,7 +92,9 @@ VALUE rb_mCairo_SVGUnit = Qnil;
92
92
  #else
93
93
  # define CAIRO_FORMAT_MIN CAIRO_FORMAT_ARGB32
94
94
  #endif
95
- #if CAIRO_CHECK_VERSION(1, 11, 4)
95
+ #if CAIRO_CHECK_VERSION(1, 17, 2)
96
+ # define CAIRO_FORMAT_MAX CAIRO_FORMAT_RGBA128F
97
+ #elif CAIRO_CHECK_VERSION(1, 11, 4)
96
98
  # define CAIRO_FORMAT_MAX CAIRO_FORMAT_RGB30
97
99
  #else
98
100
  # define CAIRO_FORMAT_MAX CAIRO_FORMAT_RGB16_565
@@ -566,6 +568,12 @@ Init_cairo_constants (void)
566
568
  rb_define_const (rb_mCairo_Format, "RGB30",
567
569
  INT2FIX (CAIRO_FORMAT_RGB30));
568
570
  #endif
571
+ #if CAIRO_CHECK_VERSION(1, 17, 2)
572
+ rb_define_const (rb_mCairo_Format, "RGB96F",
573
+ INT2FIX (CAIRO_FORMAT_RGB96F));
574
+ rb_define_const (rb_mCairo_Format, "RGBA128F",
575
+ INT2FIX (CAIRO_FORMAT_RGBA128F));
576
+ #endif
569
577
 
570
578
  #if CAIRO_CHECK_VERSION(1, 5, 8)
571
579
  rb_define_singleton_method (rb_mCairo_Format, "stride_for_width",
@@ -5,7 +5,7 @@
5
5
  * $Author: kou $
6
6
  * $Date: 2008-09-26 13:52:08 $
7
7
  *
8
- * Copyright 2005-2018 Kouhei Sutou <kou@cozmixng.org>
8
+ * Copyright 2005-2019 Kouhei Sutou <kou@cozmixng.org>
9
9
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
10
10
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
11
11
  *
@@ -240,6 +240,12 @@ cr_to_ptr (VALUE self)
240
240
  1, PTR2NUM (_SELF));
241
241
  }
242
242
 
243
+ static VALUE
244
+ cr_raw_address (VALUE self)
245
+ {
246
+ return PTR2NUM (_SELF);
247
+ }
248
+
243
249
 
244
250
  static VALUE
245
251
  cr_restore (VALUE self)
@@ -351,7 +357,7 @@ cr_set_source_rgb (int argc, VALUE *argv, VALUE self)
351
357
  if (n == 1 && rb_cairo__is_kind_of (red, rb_cArray))
352
358
  {
353
359
  VALUE ary = red;
354
- n = RARRAY_LEN (ary);
360
+ n = (int) RARRAY_LEN (ary);
355
361
  red = rb_ary_entry (ary, 0);
356
362
  green = rb_ary_entry (ary, 1);
357
363
  blue = rb_ary_entry (ary, 2);
@@ -388,7 +394,7 @@ cr_set_source_rgba (int argc, VALUE *argv, VALUE self)
388
394
  if (n == 1 && rb_cairo__is_kind_of (red, rb_cArray))
389
395
  {
390
396
  VALUE ary = red;
391
- n = RARRAY_LEN (ary);
397
+ n = (int) RARRAY_LEN (ary);
392
398
  red = rb_ary_entry (ary, 0);
393
399
  green = rb_ary_entry (ary, 1);
394
400
  blue = rb_ary_entry (ary, 2);
@@ -567,7 +573,7 @@ cr_set_dash (int argc, VALUE *argv, VALUE self)
567
573
  {
568
574
  int i, length;
569
575
  double *values;
570
- length = RARRAY_LEN (dash_array);
576
+ length = (int) RARRAY_LEN (dash_array);
571
577
  values = ALLOCA_N (double, length);
572
578
  if (!values)
573
579
  {
@@ -1323,7 +1329,7 @@ cr_show_text_glyphs (VALUE self, VALUE rb_utf8, VALUE rb_glyphs,
1323
1329
 
1324
1330
  cr = _SELF;
1325
1331
  utf8 = RSTRING_PTR (rb_utf8);
1326
- utf8_len = RSTRING_LEN (rb_utf8);
1332
+ utf8_len = (int) RSTRING_LEN (rb_utf8);
1327
1333
  rb_cairo__glyphs_from_ruby_object (rb_glyphs, &glyphs, &num_glyphs);
1328
1334
  rb_cairo__text_clusters_from_ruby_object (rb_clusters,
1329
1335
  &clusters, &num_clusters);
@@ -1874,6 +1880,8 @@ Init_cairo_context (void)
1874
1880
 
1875
1881
  rb_define_method (rb_cCairo_Context, "to_ptr", cr_to_ptr, 0);
1876
1882
 
1883
+ rb_define_method (rb_cCairo_Context, "raw_address", cr_raw_address, 0);
1884
+
1877
1885
  #if CAIRO_CHECK_VERSION(1, 15, 4)
1878
1886
  /* Logical structure tagging functions */
1879
1887
  {
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  * Ruby Cairo Binding
4
4
  *
5
- * Copyright 2010-2012 Kouhei Sutou <kou@cozmixng.org>
5
+ * Copyright 2010-2019 Kouhei Sutou <kou@cozmixng.org>
6
6
  *
7
7
  * This file is made available under the same terms as Ruby
8
8
  *
@@ -343,7 +343,7 @@ cr_script_device_write_comment (VALUE self, VALUE comment)
343
343
  device = _SELF;
344
344
  cairo_script_write_comment (device,
345
345
  StringValuePtr (comment),
346
- RSTRING_LEN (comment));
346
+ (int) RSTRING_LEN (comment));
347
347
  cr_device_check_status (device);
348
348
  return Qnil;
349
349
  }
@@ -5,6 +5,7 @@
5
5
  * $Author: kou $
6
6
  * $Date: 2008-09-26 14:13:58 $
7
7
  *
8
+ * Copyright 2003-2019 Sutou Kouhei <kou@cozmixng.org>
8
9
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
9
10
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
10
11
  *
@@ -148,7 +149,11 @@ cr_font_face_freetype_supported_p (VALUE klass)
148
149
 
149
150
  #ifdef CAIRO_HAS_FT_FONT
150
151
  static VALUE
151
- cr_freetype_done_library (VALUE data)
152
+ cr_freetype_done_library (VALUE yielded_arg,
153
+ VALUE callback_arg,
154
+ int argc,
155
+ const VALUE *argv,
156
+ VALUE block_arg)
152
157
  {
153
158
  cr_freetype_finishing = CR_TRUE;
154
159
  if (cr_freetype_n_faces == 0)
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  * Ruby Cairo Binding
4
4
  *
5
- * Copyright 2005-2010 Kouhei Sutou <kou@cozmixng.org>
5
+ * Copyright 2005-2019 Kouhei Sutou <kou@cozmixng.org>
6
6
  *
7
7
  * This file is made available under the same terms as Ruby
8
8
  *
@@ -44,11 +44,11 @@ rb_cairo__io_closure_free (void *closure)
44
44
  }
45
45
 
46
46
  static VALUE
47
- rb_cairo__io_func_rescue (VALUE io_closure)
47
+ rb_cairo__io_func_rescue (VALUE io_closure, VALUE error)
48
48
  {
49
49
  rb_cairo__io_callback_closure_t *closure;
50
50
  closure = (rb_cairo__io_callback_closure_t *)io_closure;
51
- closure->error = RB_ERRINFO;
51
+ closure->error = error;
52
52
  return Qnil;
53
53
  }
54
54
 
@@ -70,7 +70,7 @@ rb_cairo__io_write_func_invoke (VALUE write_closure)
70
70
  VALUE output, data;
71
71
  long written_bytes;
72
72
  rb_cairo__io_callback_closure_t *closure;
73
- unsigned int length;
73
+ long length;
74
74
 
75
75
  closure = (rb_cairo__io_callback_closure_t *)write_closure;
76
76
 
@@ -118,7 +118,7 @@ rb_cairo__io_read_func_invoke (VALUE read_closure)
118
118
  {
119
119
  VALUE input, result;
120
120
  rb_cairo__io_callback_closure_t *closure;
121
- unsigned int length, rest;
121
+ long length, rest;
122
122
 
123
123
  closure = (rb_cairo__io_callback_closure_t *)read_closure;
124
124
  input = closure->target;
@@ -133,7 +133,7 @@ rb_cairo__io_read_func_invoke (VALUE read_closure)
133
133
  rb_cairo__io_id_read, 1, INT2NUM (rest)));
134
134
  }
135
135
 
136
- memcpy ((void *)closure->data, (const void *)StringValuePtr (result), length);
136
+ memcpy ((void *)closure->data, (const void *) StringValuePtr (result), length);
137
137
 
138
138
  return Qnil;
139
139
  }
@@ -5,7 +5,7 @@
5
5
  * $Author: kou $
6
6
  * $Date: 2008-06-12 10:59:54 $
7
7
  *
8
- * Copyright 2012 Kouhei Sutou <kou@cozmixng.org>
8
+ * Copyright 2012-2019 Kouhei Sutou <kou@cozmixng.org>
9
9
  * Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
10
10
  * Copyright 2004-2005 MenTaLguY <mental@rydia.com>
11
11
  *
@@ -208,7 +208,7 @@ cr_solid_pattern_initialize (int argc, VALUE *argv, VALUE self)
208
208
  (RARRAY_LEN (red) == 3 || RARRAY_LEN (red) == 4))
209
209
  {
210
210
  VALUE ary = red;
211
- n = RARRAY_LEN (ary);
211
+ n = (int) RARRAY_LEN (ary);
212
212
 
213
213
  red = rb_ary_entry (ary, 0);
214
214
  green = rb_ary_entry (ary, 1);
@@ -315,7 +315,7 @@ cr_gradient_pattern_add_color_stop_generic (int argc, VALUE *argv, VALUE self)
315
315
  if (n == 2 && rb_cairo__is_kind_of (red, rb_cArray))
316
316
  {
317
317
  VALUE ary = red;
318
- n = RARRAY_LEN (ary) + 1;
318
+ n = (int) RARRAY_LEN (ary) + 1;
319
319
 
320
320
  red = rb_ary_entry (ary, 0);
321
321
  green = rb_ary_entry (ary, 1);