cairo 1.17.7 → 1.17.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS +14 -0
- data/ext/cairo/rb_cairo.h +2 -2
- data/ext/cairo/rb_cairo_context.c +5 -5
- data/ext/cairo/rb_cairo_device.c +2 -2
- data/ext/cairo/rb_cairo_font_extents.c +1 -1
- data/ext/cairo/rb_cairo_font_face.c +3 -3
- data/ext/cairo/rb_cairo_font_options.c +1 -1
- data/ext/cairo/rb_cairo_glyph.c +1 -1
- data/ext/cairo/rb_cairo_matrix.c +1 -1
- data/ext/cairo/rb_cairo_path.c +1 -1
- data/ext/cairo/rb_cairo_pattern.c +6 -6
- data/ext/cairo/rb_cairo_quartz_surface.c +2 -2
- data/ext/cairo/rb_cairo_rectangle.c +2 -2
- data/ext/cairo/rb_cairo_region.c +1 -1
- data/ext/cairo/rb_cairo_scaled_font.c +1 -1
- data/ext/cairo/rb_cairo_surface.c +18 -13
- data/ext/cairo/rb_cairo_text_cluster.c +1 -1
- data/ext/cairo/rb_cairo_text_extents.c +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dffa934fa956305e9ed3ba9a9a5c92956c61c09277ea1723ceb69c1bee1b5c72
|
4
|
+
data.tar.gz: c4a6b1aa7bc5e3e00ca1bb388272d75c726fb20a1366dcbc2f15513d06177cbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 163b19b0d0fdbfadd8117629b95fbd51f97a84617bc77366eb5083b4e631bc3eb863c1daa51ce6e79fd0cfbe462f69215b6bc3548c9a3960e95861c799f53515
|
7
|
+
data.tar.gz: c266cd0dc3e254bccecae19b9f8dfb688c55404cd348446d2e34d67d263e07b1244851292aa1d8c1140e30bfa8162af1135855b99eb1da7af54c9d67d77aefba
|
data/NEWS
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
Release 1.17.8 (2022-09-01) Sutou Kouhei <kou@cozmixng.org>
|
2
|
+
===========================================================
|
3
|
+
|
4
|
+
Improvements
|
5
|
+
------------
|
6
|
+
|
7
|
+
* Added support for Pathname for Cairo::Surface#write_to_png.
|
8
|
+
[GitHub#37][Reported by scivola]
|
9
|
+
|
10
|
+
Thanks
|
11
|
+
------
|
12
|
+
|
13
|
+
* scivola
|
14
|
+
|
1
15
|
Release 1.17.7 (2022-07-31) Sutou Kouhei <kou@cozmixng.org>
|
2
16
|
===========================================================
|
3
17
|
|
data/ext/cairo/rb_cairo.h
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
* $Author: kou $
|
6
6
|
* $Date: 2008-09-19 12:56:27 $
|
7
7
|
*
|
8
|
-
* Copyright 2006-
|
8
|
+
* Copyright 2006-2022 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
|
*
|
@@ -65,7 +65,7 @@ RB_CAIRO_BEGIN_DECLS
|
|
65
65
|
|
66
66
|
#define RB_CAIRO_VERSION_MAJOR 1
|
67
67
|
#define RB_CAIRO_VERSION_MINOR 17
|
68
|
-
#define RB_CAIRO_VERSION_MICRO
|
68
|
+
#define RB_CAIRO_VERSION_MICRO 8
|
69
69
|
|
70
70
|
RB_CAIRO_VAR VALUE rb_mCairo;
|
71
71
|
RB_CAIRO_VAR VALUE rb_cCairo_Context;
|
@@ -126,20 +126,20 @@ cr_destroy (VALUE self)
|
|
126
126
|
cr_set_user_data (cr, &cr_object_holder_key, NULL, NULL);
|
127
127
|
cairo_destroy (cr);
|
128
128
|
|
129
|
-
|
129
|
+
RTYPEDDATA_DATA (self) = NULL;
|
130
130
|
return Qnil;
|
131
131
|
}
|
132
132
|
|
133
133
|
static VALUE
|
134
134
|
cr_destroyed (VALUE self)
|
135
135
|
{
|
136
|
-
return CBOOL2RVAL (
|
136
|
+
return CBOOL2RVAL (RTYPEDDATA_DATA (self) == NULL);
|
137
137
|
}
|
138
138
|
|
139
139
|
static VALUE
|
140
140
|
cr_destroy_with_destroy_check (VALUE self)
|
141
141
|
{
|
142
|
-
if (
|
142
|
+
if (RTYPEDDATA_DATA (self))
|
143
143
|
cr_destroy (self);
|
144
144
|
return Qnil;
|
145
145
|
}
|
@@ -202,7 +202,7 @@ cr_s_wrap (VALUE self, VALUE pointer)
|
|
202
202
|
|
203
203
|
rb_cr = rb_obj_alloc (self);
|
204
204
|
cairo_reference (cr);
|
205
|
-
|
205
|
+
RTYPEDDATA_DATA (rb_cr) = cr;
|
206
206
|
rb_ivar_set (rb_cr, cr_id_surface, Qnil);
|
207
207
|
|
208
208
|
if (rb_block_given_p ())
|
@@ -232,7 +232,7 @@ cr_initialize (VALUE self, VALUE target)
|
|
232
232
|
&cr_object_holder_key,
|
233
233
|
cr_object_holder_new (self),
|
234
234
|
cr_object_holder_free);
|
235
|
-
|
235
|
+
RTYPEDDATA_DATA (self) = cr;
|
236
236
|
if (rb_block_given_p ())
|
237
237
|
result = rb_ensure (rb_yield, self, cr_destroy_with_destroy_check, self);
|
238
238
|
return result;
|
data/ext/cairo/rb_cairo_device.c
CHANGED
@@ -215,7 +215,7 @@ cr_device_destroy (VALUE self)
|
|
215
215
|
|
216
216
|
device = _SELF;
|
217
217
|
cairo_device_destroy (device);
|
218
|
-
|
218
|
+
RTYPEDDATA_DATA (self) = NULL;
|
219
219
|
|
220
220
|
return self;
|
221
221
|
}
|
@@ -335,7 +335,7 @@ cr_ ## type ## _device_initialize (VALUE self, \
|
|
335
335
|
} \
|
336
336
|
\
|
337
337
|
cr_device_check_status (device); \
|
338
|
-
|
338
|
+
RTYPEDDATA_DATA (self) = device; \
|
339
339
|
if (rb_block_given_p ()) \
|
340
340
|
yield_and_finish (self); \
|
341
341
|
return Qnil; \
|
@@ -283,7 +283,7 @@ cr_freetype_font_face_initialize (VALUE self, VALUE path)
|
|
283
283
|
rb_cairo_check_status (status);
|
284
284
|
}
|
285
285
|
|
286
|
-
|
286
|
+
RTYPEDDATA_DATA (self) = face;
|
287
287
|
|
288
288
|
return Qnil;
|
289
289
|
}
|
@@ -332,7 +332,7 @@ cr_toy_font_face_initialize (int argc, VALUE *argv, VALUE self)
|
|
332
332
|
|
333
333
|
face = cairo_toy_font_face_create (family, slant, weight);
|
334
334
|
cr_font_face_check_status (face);
|
335
|
-
|
335
|
+
RTYPEDDATA_DATA (self) = face;
|
336
336
|
|
337
337
|
return Qnil;
|
338
338
|
}
|
@@ -758,7 +758,7 @@ cr_user_font_face_initialize (VALUE self)
|
|
758
758
|
rb_ivar_set (self, cr_id_text_to_glyphs, Qnil);
|
759
759
|
rb_ivar_set (self, cr_id_unicode_to_glyph, Qnil);
|
760
760
|
|
761
|
-
|
761
|
+
RTYPEDDATA_DATA (self) = face;
|
762
762
|
|
763
763
|
return Qnil;
|
764
764
|
}
|
data/ext/cairo/rb_cairo_glyph.c
CHANGED
data/ext/cairo/rb_cairo_matrix.c
CHANGED
data/ext/cairo/rb_cairo_path.c
CHANGED
@@ -259,7 +259,7 @@ cr_solid_pattern_initialize (int argc, VALUE *argv, VALUE self)
|
|
259
259
|
}
|
260
260
|
|
261
261
|
cr_pattern_check_status (pattern);
|
262
|
-
|
262
|
+
RTYPEDDATA_DATA (self) = pattern;
|
263
263
|
return Qnil;
|
264
264
|
}
|
265
265
|
|
@@ -270,7 +270,7 @@ cr_surface_pattern_initialize (VALUE self, VALUE surface)
|
|
270
270
|
|
271
271
|
pattern = cairo_pattern_create_for_surface (RVAL2CRSURFACE (surface));
|
272
272
|
cr_pattern_check_status (pattern);
|
273
|
-
|
273
|
+
RTYPEDDATA_DATA (self) = pattern;
|
274
274
|
return Qnil;
|
275
275
|
}
|
276
276
|
|
@@ -283,7 +283,7 @@ cr_linear_pattern_initialize (VALUE self, VALUE x0, VALUE y0,
|
|
283
283
|
pattern = cairo_pattern_create_linear (NUM2DBL (x0), NUM2DBL (y0),
|
284
284
|
NUM2DBL (x1), NUM2DBL (y1));
|
285
285
|
cr_pattern_check_status (pattern);
|
286
|
-
|
286
|
+
RTYPEDDATA_DATA (self) = pattern;
|
287
287
|
return Qnil;
|
288
288
|
}
|
289
289
|
|
@@ -298,7 +298,7 @@ cr_radial_pattern_initialize (VALUE self, VALUE cx0, VALUE cy0, VALUE radius0,
|
|
298
298
|
NUM2DBL (cx1), NUM2DBL (cy1),
|
299
299
|
NUM2DBL (radius1));
|
300
300
|
cr_pattern_check_status (pattern);
|
301
|
-
|
301
|
+
RTYPEDDATA_DATA (self) = pattern;
|
302
302
|
return Qnil;
|
303
303
|
}
|
304
304
|
|
@@ -526,7 +526,7 @@ cr_mesh_pattern_initialize (VALUE self)
|
|
526
526
|
|
527
527
|
pattern = cairo_pattern_create_mesh ();
|
528
528
|
cr_pattern_check_status (pattern);
|
529
|
-
|
529
|
+
RTYPEDDATA_DATA (self) = pattern;
|
530
530
|
return Qnil;
|
531
531
|
}
|
532
532
|
|
@@ -924,7 +924,7 @@ cr_raster_source_pattern_initialize (int argc, VALUE *argv, VALUE self)
|
|
924
924
|
content, width, height);
|
925
925
|
cr_pattern_check_status (pattern);
|
926
926
|
|
927
|
-
|
927
|
+
RTYPEDDATA_DATA (self) = pattern;
|
928
928
|
rb_iv_set (self, "@acquire", Qnil);
|
929
929
|
rb_iv_set (self, "@release", Qnil);
|
930
930
|
rb_iv_set (self, "@snapshot", Qnil);
|
@@ -134,7 +134,7 @@ cr_quartz_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
134
134
|
}
|
135
135
|
|
136
136
|
rb_cairo_surface_check_status (surface);
|
137
|
-
|
137
|
+
RTYPEDDATA_DATA (self) = surface;
|
138
138
|
if (rb_block_given_p ())
|
139
139
|
rb_cairo__surface_yield_and_finish (self);
|
140
140
|
return Qnil;
|
@@ -169,7 +169,7 @@ cr_quartz_image_surface_initialize (VALUE self, VALUE image_surface)
|
|
169
169
|
|
170
170
|
surface = cairo_quartz_image_surface_create (RVAL2CRSURFACE (image_surface));
|
171
171
|
rb_cairo_surface_check_status (surface);
|
172
|
-
|
172
|
+
RTYPEDDATA_DATA (self) = surface;
|
173
173
|
rb_ivar_set (self, cr_id_image_surface, image_surface);
|
174
174
|
if (rb_block_given_p ())
|
175
175
|
rb_cairo__surface_yield_and_finish (self);
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
VALUE rb_cCairo_Rectangle;
|
14
14
|
|
15
|
-
#define _SELF ((cairo_rectangle_int_t *)
|
15
|
+
#define _SELF ((cairo_rectangle_int_t *)RTYPEDDATA_DATA (self))
|
16
16
|
|
17
17
|
#if CAIRO_CHECK_VERSION(1, 10, 0)
|
18
18
|
static const rb_data_type_t cr_rectangle_type = {
|
@@ -39,7 +39,7 @@ cr_rectangle_initialize (VALUE self, VALUE x, VALUE y,
|
|
39
39
|
cairo_rectangle_int_t *rectangle;
|
40
40
|
|
41
41
|
rectangle = ALLOC (cairo_rectangle_int_t);
|
42
|
-
|
42
|
+
RTYPEDDATA_DATA (self) = rectangle;
|
43
43
|
|
44
44
|
rectangle->x = NUM2INT (x);
|
45
45
|
rectangle->y = NUM2INT (y);
|
data/ext/cairo/rb_cairo_region.c
CHANGED
@@ -106,7 +106,7 @@ cr_region_initialize (int argc, VALUE *argv, VALUE self)
|
|
106
106
|
region = cairo_region_create_rectangles (rectangles, argc);
|
107
107
|
}
|
108
108
|
cr_region_check_status (region);
|
109
|
-
|
109
|
+
RTYPEDDATA_DATA (self) = region;
|
110
110
|
return Qnil;
|
111
111
|
}
|
112
112
|
|
@@ -280,7 +280,7 @@ cr_surface_destroy (VALUE self)
|
|
280
280
|
|
281
281
|
surface = _SELF;
|
282
282
|
cr_surface_destroy_raw (surface);
|
283
|
-
|
283
|
+
RTYPEDDATA_DATA (self) = NULL;
|
284
284
|
|
285
285
|
return self;
|
286
286
|
}
|
@@ -534,7 +534,7 @@ cr_surface_finish (VALUE self)
|
|
534
534
|
cairo_surface_finish (surface);
|
535
535
|
cairo_surface_set_user_data (surface, &cr_finished_key, (void *)CR_TRUE, NULL);
|
536
536
|
cairo_surface_set_user_data (surface, &cr_object_holder_key, NULL, NULL);
|
537
|
-
|
537
|
+
RTYPEDDATA_DATA (self) = NULL;
|
538
538
|
|
539
539
|
if (closure && !NIL_P (closure->error))
|
540
540
|
rb_exc_raise (closure->error);
|
@@ -750,6 +750,11 @@ cr_surface_write_to_png (VALUE self, VALUE filename)
|
|
750
750
|
static VALUE
|
751
751
|
cr_surface_write_to_png_generic (VALUE self, VALUE target)
|
752
752
|
{
|
753
|
+
if (rb_respond_to (target, rb_cairo__io_id_to_path) &&
|
754
|
+
!rb_respond_to (target, rb_cairo__io_id_to_io))
|
755
|
+
{
|
756
|
+
target = rb_funcall (target, rb_cairo__io_id_to_path, 0);
|
757
|
+
}
|
753
758
|
if (rb_respond_to (target, rb_cairo__io_id_write))
|
754
759
|
return cr_surface_write_to_png_stream (self, target);
|
755
760
|
else
|
@@ -1015,7 +1020,7 @@ cr_image_surface_create_from_png_generic (VALUE klass, VALUE target)
|
|
1015
1020
|
|
1016
1021
|
rb_cairo_surface_check_status (surface);
|
1017
1022
|
rb_surface = cr_surface_allocate (klass);
|
1018
|
-
|
1023
|
+
RTYPEDDATA_DATA (rb_surface) = surface;
|
1019
1024
|
return rb_surface;
|
1020
1025
|
}
|
1021
1026
|
#endif
|
@@ -1072,7 +1077,7 @@ cr_image_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
1072
1077
|
rb_cairo__inspect (rb_ary_new3 (4, arg1, arg2, arg3, arg4)));
|
1073
1078
|
|
1074
1079
|
rb_cairo_surface_check_status (surface);
|
1075
|
-
|
1080
|
+
RTYPEDDATA_DATA (self) = surface;
|
1076
1081
|
rb_cairo_surface_adjust_memory_usage (surface, CR_TRUE);
|
1077
1082
|
if (rb_block_given_p ())
|
1078
1083
|
rb_cairo__surface_yield_and_finish (self);
|
@@ -1193,7 +1198,7 @@ cr_ ## type ## _surface_initialize (int argc, VALUE *argv, VALUE self) \
|
|
1193
1198
|
} \
|
1194
1199
|
\
|
1195
1200
|
rb_cairo_surface_check_status (surface); \
|
1196
|
-
|
1201
|
+
RTYPEDDATA_DATA (self) = surface; \
|
1197
1202
|
if (rb_block_given_p ()) \
|
1198
1203
|
rb_cairo__surface_yield_and_finish (self); \
|
1199
1204
|
return Qnil; \
|
@@ -1534,7 +1539,7 @@ cr_win32_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
1534
1539
|
if (!surface)
|
1535
1540
|
rb_cairo_check_status (CAIRO_STATUS_INVALID_FORMAT);
|
1536
1541
|
rb_cairo_surface_check_status (surface);
|
1537
|
-
|
1542
|
+
RTYPEDDATA_DATA (self) = surface;
|
1538
1543
|
if (rb_block_given_p ())
|
1539
1544
|
rb_cairo__surface_yield_and_finish (self);
|
1540
1545
|
return Qnil;
|
@@ -1610,7 +1615,7 @@ cr_win32_printing_surface_initialize (VALUE self, VALUE hdc)
|
|
1610
1615
|
|
1611
1616
|
surface = cairo_win32_printing_surface_create (NUM2PTR (hdc));
|
1612
1617
|
rb_cairo_surface_check_status (surface);
|
1613
|
-
|
1618
|
+
RTYPEDDATA_DATA (self) = surface;
|
1614
1619
|
if (rb_block_given_p ())
|
1615
1620
|
rb_cairo__surface_yield_and_finish (self);
|
1616
1621
|
return Qnil;
|
@@ -1665,7 +1670,7 @@ cr_script_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
1665
1670
|
surface = cairo_script_surface_create (device, content, width, height);
|
1666
1671
|
|
1667
1672
|
rb_cairo_surface_check_status (surface);
|
1668
|
-
|
1673
|
+
RTYPEDDATA_DATA (self) = surface;
|
1669
1674
|
if (rb_block_given_p ())
|
1670
1675
|
rb_cairo__surface_yield_and_finish (self);
|
1671
1676
|
return Qnil;
|
@@ -1720,7 +1725,7 @@ cr_recording_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
1720
1725
|
|
1721
1726
|
surface = cairo_recording_surface_create (content, &extents);
|
1722
1727
|
rb_cairo_surface_check_status (surface);
|
1723
|
-
|
1728
|
+
RTYPEDDATA_DATA (self) = surface;
|
1724
1729
|
if (rb_block_given_p ())
|
1725
1730
|
rb_cairo__surface_yield_and_finish (self);
|
1726
1731
|
return Qnil;
|
@@ -1797,7 +1802,7 @@ cr_gl_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
1797
1802
|
surface = cairo_gl_surface_create (device, content, width, height);
|
1798
1803
|
|
1799
1804
|
rb_cairo_surface_check_status (surface);
|
1800
|
-
|
1805
|
+
RTYPEDDATA_DATA (self) = surface;
|
1801
1806
|
if (rb_block_given_p ())
|
1802
1807
|
rb_cairo__surface_yield_and_finish (self);
|
1803
1808
|
return Qnil;
|
@@ -1844,7 +1849,7 @@ cr_gl_texture_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
1844
1849
|
height);
|
1845
1850
|
|
1846
1851
|
rb_cairo_surface_check_status (surface);
|
1847
|
-
|
1852
|
+
RTYPEDDATA_DATA (self) = surface;
|
1848
1853
|
if (rb_block_given_p ())
|
1849
1854
|
rb_cairo__surface_yield_and_finish (self);
|
1850
1855
|
return Qnil;
|
@@ -1894,7 +1899,7 @@ cr_tee_surface_initialize (VALUE self, VALUE master)
|
|
1894
1899
|
|
1895
1900
|
surface = cairo_tee_surface_create (RVAL2CRSURFACE (master));
|
1896
1901
|
rb_cairo_surface_check_status (surface);
|
1897
|
-
|
1902
|
+
RTYPEDDATA_DATA (self) = surface;
|
1898
1903
|
rb_iv_set (self, "surfaces", rb_ary_new3 (1, master));
|
1899
1904
|
if (rb_block_given_p ())
|
1900
1905
|
rb_cairo__surface_yield_and_finish (self);
|
@@ -2016,7 +2021,7 @@ cr_xml_surface_initialize (int argc, VALUE *argv, VALUE self)
|
|
2016
2021
|
surface = cairo_xml_surface_create (device, content, width, height);
|
2017
2022
|
|
2018
2023
|
rb_cairo_surface_check_status (surface);
|
2019
|
-
|
2024
|
+
RTYPEDDATA_DATA (self) = surface;
|
2020
2025
|
if (rb_block_given_p ())
|
2021
2026
|
rb_cairo__surface_yield_and_finish (self);
|
2022
2027
|
return Qnil;
|
@@ -81,7 +81,7 @@ cr_text_cluster_initialize (VALUE self, VALUE num_bytes, VALUE num_glyphs)
|
|
81
81
|
cluster->num_bytes = NUM2INT (num_bytes);
|
82
82
|
cluster->num_glyphs = NUM2INT (num_glyphs);
|
83
83
|
|
84
|
-
|
84
|
+
RTYPEDDATA_DATA (self) = cluster;
|
85
85
|
return Qnil;
|
86
86
|
}
|
87
87
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cairo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.17.
|
4
|
+
version: 1.17.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: native-package-installer
|
@@ -219,7 +219,7 @@ metadata:
|
|
219
219
|
mailing_list_uri: https://cairographics.org/cgi-bin/mailman/listinfo/cairo
|
220
220
|
source_code_uri: https://github.com/rcairo/rcairo
|
221
221
|
msys2_mingw_dependencies: cairo
|
222
|
-
post_install_message:
|
222
|
+
post_install_message:
|
223
223
|
rdoc_options: []
|
224
224
|
require_paths:
|
225
225
|
- lib
|
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
236
|
requirements:
|
237
237
|
- cairo >= 1.2.0
|
238
238
|
rubygems_version: 3.4.0.dev
|
239
|
-
signing_key:
|
239
|
+
signing_key:
|
240
240
|
specification_version: 4
|
241
241
|
summary: Ruby bindings for cairo
|
242
242
|
test_files:
|