cairo 1.10.2-x86-mingw32 → 1.12.0-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.
- data/AUTHORS +4 -1
- data/Gemfile +1 -11
- data/NEWS +28 -0
- data/README.rdoc +3 -2
- data/Rakefile +5 -46
- data/ext/cairo/cairo.def +9 -0
- data/ext/cairo/rb_cairo.h +7 -2
- data/ext/cairo/rb_cairo_constants.c +43 -7
- data/ext/cairo/rb_cairo_context.c +1 -1
- data/ext/cairo/rb_cairo_device.c +31 -5
- data/ext/cairo/rb_cairo_exception.c +21 -1
- data/ext/cairo/rb_cairo_pattern.c +579 -1
- data/ext/cairo/rb_cairo_surface.c +159 -7
- data/lib/1.8/cairo.so +0 -0
- data/lib/1.9/cairo.so +0 -0
- data/test/test_raster_source_pattern.rb +148 -0
- data/test/test_recording_surface.rb +2 -4
- data/test/test_xml_surface.rb +2 -1
- metadata +90 -22
data/AUTHORS
CHANGED
data/Gemfile
CHANGED
data/NEWS
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
Release 1.12.0 (2012-03-25) Kouhei Sutou <kou@cozmixng.org>)
|
2
|
+
============================================================
|
3
|
+
|
4
|
+
Improvements
|
5
|
+
------------
|
6
|
+
|
7
|
+
* Supported cairo 1.12.0.
|
8
|
+
* Cairo::Surface#supported_mime_type?
|
9
|
+
* Cairo::Surface#create_similar_image
|
10
|
+
* Cairo::Surface#map_to_image
|
11
|
+
* Cairo::Surface#unmap_to_image
|
12
|
+
* Cairo::RecordingSurface#extents
|
13
|
+
* Cairo::MeshPattern
|
14
|
+
* Cairo::RasterSourcePattern
|
15
|
+
* Cairo::MimeType::UNIQUE_ID
|
16
|
+
* Supported glesv2 surface.
|
17
|
+
|
18
|
+
Fixes
|
19
|
+
-----
|
20
|
+
|
21
|
+
* Fixed a bug that Cairo::HINT_METRICS_ON can't be specified. #8
|
22
|
+
[Vasily Fedoseyev]
|
23
|
+
|
24
|
+
Thanks
|
25
|
+
------
|
26
|
+
|
27
|
+
* Vasily Fedoseyev
|
28
|
+
|
1
29
|
Release 1.10.2 (2011-11-20) Kouhei Sutou <kou@cozmixng.org>)
|
2
30
|
============================================================
|
3
31
|
|
data/README.rdoc
CHANGED
@@ -13,7 +13,7 @@ http://cairographics.org/
|
|
13
13
|
== Dependencies
|
14
14
|
|
15
15
|
* ruby >= 1.8 (1.9.2 also supported!)
|
16
|
-
* cairo >= 1.2.0 (1.
|
16
|
+
* cairo >= 1.2.0 (1.12.0 also supported!)
|
17
17
|
|
18
18
|
== Install
|
19
19
|
|
@@ -51,7 +51,7 @@ Options to extconf.rb:
|
|
51
51
|
|
52
52
|
== Windows
|
53
53
|
|
54
|
-
cairo-X.Y.Z-x86-
|
54
|
+
cairo-X.Y.Z-x86-mingw32.gem includes cairo related binaries.
|
55
55
|
|
56
56
|
* cairo related binaries:
|
57
57
|
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
|
@@ -114,3 +114,4 @@ http://cairographics.org/cgi-bin/mailman/listinfo/cairo
|
|
114
114
|
* Mamoru Tasaka: reports a bug.
|
115
115
|
* Nikolai Weibull: reports problems.
|
116
116
|
* Will Bryant: reports a bug.
|
117
|
+
* Vasily Fedoseyev: fixes a bug.
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'fileutils'
|
|
7
7
|
require 'rubygems'
|
8
8
|
require 'rubygems/package_task'
|
9
9
|
require 'yard'
|
10
|
-
require '
|
10
|
+
require 'bundler/gem_helper'
|
11
11
|
require 'rake/extensiontask'
|
12
12
|
require 'packnga'
|
13
13
|
|
@@ -19,50 +19,9 @@ $LOAD_PATH.unshift(cairo_ext_dir)
|
|
19
19
|
$LOAD_PATH.unshift(cairo_lib_dir)
|
20
20
|
ENV["RUBYLIB"] = "#{cairo_lib_dir}:#{cairo_ext_dir}:#{ENV['RUBYLIB']}"
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
rb_cairo_h.each_line do |line|
|
26
|
-
case line
|
27
|
-
when /\A#define RB_CAIRO_VERSION_([A-Z]+) (\d+)/
|
28
|
-
version[$1.downcase] = $2
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
[version["major"], version["minor"], version["micro"]].join(".")
|
33
|
-
end
|
34
|
-
|
35
|
-
ENV["VERSION"] ||= guess_rcairo_version(cairo_ext_dir)
|
36
|
-
version = ENV["VERSION"].dup
|
37
|
-
spec = nil
|
38
|
-
Jeweler::Tasks.new do |_spec|
|
39
|
-
spec = _spec
|
40
|
-
spec.name = "cairo"
|
41
|
-
spec.version = version
|
42
|
-
spec.rubyforge_project = 'cairo'
|
43
|
-
spec.homepage = 'http://cairographics.org/rcairo'
|
44
|
-
authors = File.join(base_dir, "AUTHORS")
|
45
|
-
spec.authors = File.readlines(authors).collect do |line|
|
46
|
-
if /\s*<[^<>]*>$/ =~ line
|
47
|
-
$PREMATCH
|
48
|
-
else
|
49
|
-
nil
|
50
|
-
end
|
51
|
-
end.compact
|
52
|
-
spec.email = ['cairo@cairographics.org']
|
53
|
-
spec.summary = 'Ruby bindings for cairo'
|
54
|
-
spec.description = "Ruby bindings for cairo"
|
55
|
-
spec.license = "Ruby's"
|
56
|
-
spec.files = FileList["{lib,samples}/**/*.rb",
|
57
|
-
"ext/**/{*.def,depend,*.rb,*.c,*.h}",
|
58
|
-
"AUTHORS", "COPYING", "GPL", "Gemfile",
|
59
|
-
"NEWS", "README.rdoc", "Rakefile"]
|
60
|
-
spec.test_files = FileList["test/**/*.rb"]
|
61
|
-
end
|
62
|
-
|
63
|
-
Rake::Task["release"].prerequisites.clear
|
64
|
-
Jeweler::RubygemsDotOrgTasks.new do
|
65
|
-
end
|
22
|
+
helper = Bundler::GemHelper.new(base_dir)
|
23
|
+
helper.install
|
24
|
+
spec = helper.gemspec
|
66
25
|
|
67
26
|
Gem::PackageTask.new(spec) do |pkg|
|
68
27
|
pkg.need_tar_gz = true
|
@@ -138,7 +97,7 @@ end
|
|
138
97
|
|
139
98
|
# for releasing
|
140
99
|
task :dist do
|
141
|
-
sh "./dist.sh", version
|
100
|
+
sh "./dist.sh", spec.version
|
142
101
|
end
|
143
102
|
|
144
103
|
# for documentation
|
data/ext/cairo/cairo.def
CHANGED
@@ -2,6 +2,7 @@ EXPORTS
|
|
2
2
|
Init_cairo
|
3
3
|
rb_mCairo DATA
|
4
4
|
rb_cCairo_Context DATA
|
5
|
+
rb_cCairo_Rectangle DATA
|
5
6
|
rb_cCairo_Path DATA
|
6
7
|
rb_cCairo_PathData DATA
|
7
8
|
rb_cCairo_PathMoveTo DATA
|
@@ -10,12 +11,16 @@ EXPORTS
|
|
10
11
|
rb_cCairo_PathClosePath DATA
|
11
12
|
rb_cCairo_Matrix DATA
|
12
13
|
rb_cCairo_Region DATA
|
14
|
+
|
13
15
|
rb_cCairo_Pattern DATA
|
14
16
|
rb_cCairo_SolidPattern DATA
|
15
17
|
rb_cCairo_SurfacePattern DATA
|
16
18
|
rb_cCairo_GradientPattern DATA
|
17
19
|
rb_cCairo_LinearPattern DATA
|
18
20
|
rb_cCairo_RadialPattern DATA
|
21
|
+
rb_cCairo_MeshPattern DATA
|
22
|
+
rb_cCairo_RasterSourcePattern DATA
|
23
|
+
|
19
24
|
rb_cCairo_FontFace DATA
|
20
25
|
rb_cCairo_ToyFontFace DATA
|
21
26
|
rb_cCairo_UserFontFace DATA
|
@@ -46,6 +51,8 @@ EXPORTS
|
|
46
51
|
rb_cCairo_XMLSurface DATA
|
47
52
|
rb_cCairo_SkiaSurface DATA
|
48
53
|
rb_cCairo_SubSurface DATA
|
54
|
+
rb_cCairo_CoglSurface DATA
|
55
|
+
|
49
56
|
rb_cCairo_Device DATA
|
50
57
|
rb_cCairo_DRMDevice DATA
|
51
58
|
rb_cCairo_GLDevice DATA
|
@@ -53,6 +60,8 @@ EXPORTS
|
|
53
60
|
rb_cCairo_XCBDevice DATA
|
54
61
|
rb_cCairo_XlibDevice DATA
|
55
62
|
rb_cCairo_XMLDevice DATA
|
63
|
+
rb_cCairo_CoglDevice DATA
|
64
|
+
rb_cCairo_Win32Device DATA
|
56
65
|
|
57
66
|
rb_mCairo_Operator DATA
|
58
67
|
rb_mCairo_Antialias DATA
|
data/ext/cairo/rb_cairo.h
CHANGED
@@ -72,11 +72,12 @@ RB_CAIRO_BEGIN_DECLS
|
|
72
72
|
#endif
|
73
73
|
|
74
74
|
#define RB_CAIRO_VERSION_MAJOR 1
|
75
|
-
#define RB_CAIRO_VERSION_MINOR
|
76
|
-
#define RB_CAIRO_VERSION_MICRO
|
75
|
+
#define RB_CAIRO_VERSION_MINOR 12
|
76
|
+
#define RB_CAIRO_VERSION_MICRO 0
|
77
77
|
|
78
78
|
RB_CAIRO_VAR VALUE rb_mCairo;
|
79
79
|
RB_CAIRO_VAR VALUE rb_cCairo_Context;
|
80
|
+
RB_CAIRO_VAR VALUE rb_cCairo_Rectangle;
|
80
81
|
RB_CAIRO_VAR VALUE rb_cCairo_Point;
|
81
82
|
RB_CAIRO_VAR VALUE rb_cCairo_Path;
|
82
83
|
RB_CAIRO_VAR VALUE rb_cCairo_PathData;
|
@@ -92,6 +93,8 @@ RB_CAIRO_VAR VALUE rb_cCairo_SurfacePattern;
|
|
92
93
|
RB_CAIRO_VAR VALUE rb_cCairo_GradientPattern;
|
93
94
|
RB_CAIRO_VAR VALUE rb_cCairo_LinearPattern;
|
94
95
|
RB_CAIRO_VAR VALUE rb_cCairo_RadialPattern;
|
96
|
+
RB_CAIRO_VAR VALUE rb_cCairo_MeshPattern;
|
97
|
+
RB_CAIRO_VAR VALUE rb_cCairo_RasterSourcePattern;
|
95
98
|
RB_CAIRO_VAR VALUE rb_cCairo_FontFace;
|
96
99
|
RB_CAIRO_VAR VALUE rb_cCairo_ToyFontFace;
|
97
100
|
RB_CAIRO_VAR VALUE rb_cCairo_UserFontFace;
|
@@ -161,6 +164,8 @@ RB_CAIRO_VAR VALUE rb_mCairo_Color;
|
|
161
164
|
RB_CAIRO_VAR VALUE rb_cCairo_Color_Base;
|
162
165
|
RB_CAIRO_VAR VALUE rb_cCairo_Paper;
|
163
166
|
|
167
|
+
#define RVAL2POINTER(obj) ((void *)(obj))
|
168
|
+
#define POINTER2RVAL(pointer) ((VALUE)(pointer))
|
164
169
|
|
165
170
|
#define RVAL2CRCONTEXT(obj) (rb_cairo_context_from_ruby_object(obj))
|
166
171
|
#define CRCONTEXT2RVAL(cr) (rb_cairo_context_to_ruby_object(cr))
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* $Author: kou $
|
6
6
|
* $Date: 2008-09-19 12:56:27 $
|
7
7
|
*
|
8
|
-
* Copyright 2005-
|
8
|
+
* Copyright 2005-2012 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
|
*
|
@@ -48,7 +48,11 @@ VALUE rb_mCairo_RegionOverlap = Qnil;
|
|
48
48
|
#endif
|
49
49
|
|
50
50
|
#define CAIRO_ANTIALIAS_MIN CAIRO_ANTIALIAS_DEFAULT
|
51
|
-
#
|
51
|
+
#if CAIRO_CHECK_VERSION(1, 11, 4)
|
52
|
+
# define CAIRO_ANTIALIAS_MAX CAIRO_ANTIALIAS_BEST
|
53
|
+
#else
|
54
|
+
# define CAIRO_ANTIALIAS_MAX CAIRO_ANTIALIAS_SUBPIXEL
|
55
|
+
#endif
|
52
56
|
|
53
57
|
#define CAIRO_FILL_RULE_MIN CAIRO_FILL_RULE_WINDING
|
54
58
|
#define CAIRO_FILL_RULE_MAX CAIRO_FILL_RULE_EVEN_ODD
|
@@ -72,7 +76,7 @@ VALUE rb_mCairo_RegionOverlap = Qnil;
|
|
72
76
|
#define CAIRO_HINT_STYLE_MAX CAIRO_HINT_STYLE_FULL
|
73
77
|
|
74
78
|
#define CAIRO_HINT_METRICS_MIN CAIRO_HINT_METRICS_DEFAULT
|
75
|
-
#define CAIRO_HINT_METRICS_MAX
|
79
|
+
#define CAIRO_HINT_METRICS_MAX CAIRO_HINT_METRICS_ON
|
76
80
|
|
77
81
|
#define CAIRO_PATH_MIN CAIRO_PATH_MOVE_TO
|
78
82
|
#define CAIRO_PATH_MAX CAIRO_PATH_CLOSE_PATH
|
@@ -80,8 +84,16 @@ VALUE rb_mCairo_RegionOverlap = Qnil;
|
|
80
84
|
#define CAIRO_CONTENT_MIN CAIRO_CONTENT_COLOR
|
81
85
|
#define CAIRO_CONTENT_MAX CAIRO_CONTENT_COLOR_ALPHA
|
82
86
|
|
83
|
-
#
|
84
|
-
#define
|
87
|
+
#if CAIRO_CHECK_VERSION(1, 10, 0)
|
88
|
+
# define CAIRO_FORMAT_MIN CAIRO_FORMAT_INVALID
|
89
|
+
#else
|
90
|
+
# define CAIRO_FORMAT_MIN CAIRO_FORMAT_ARGB32
|
91
|
+
#endif
|
92
|
+
#if CAIRO_CHECK_VERSION(1, 11, 4)
|
93
|
+
# define CAIRO_FORMAT_MAX CAIRO_FORMAT_RGB30
|
94
|
+
#else
|
95
|
+
# define CAIRO_FORMAT_MAX CAIRO_FORMAT_RGB16_565
|
96
|
+
#endif
|
85
97
|
|
86
98
|
#define CAIRO_EXTEND_MIN CAIRO_EXTEND_NONE
|
87
99
|
#define CAIRO_EXTEND_MAX CAIRO_EXTEND_PAD
|
@@ -101,8 +113,14 @@ VALUE rb_mCairo_RegionOverlap = Qnil;
|
|
101
113
|
#define CAIRO_TEXT_CLUSTER_FLAG_MIN 0
|
102
114
|
#define CAIRO_TEXT_CLUSTER_FLAG_MAX CAIRO_TEXT_CLUSTER_FLAG_BACKWARD
|
103
115
|
|
104
|
-
#
|
105
|
-
#define
|
116
|
+
#if CAIRO_CHECK_VERSION(1, 11, 4)
|
117
|
+
# define CAIRO_SCRIPT_MODE_MIN CAIRO_SCRIPT_MODE_ASCII
|
118
|
+
# define CAIRO_SCRIPT_MODE_MAX CAIRO_SCRIPT_MODE_BINARY
|
119
|
+
#else
|
120
|
+
# define CAIRO_SCRIPT_MODE_MIN CAIRO_SCRIPT_MODE_BINARY
|
121
|
+
# define CAIRO_SCRIPT_MODE_MAX CAIRO_SCRIPT_MODE_ASCII
|
122
|
+
#endif
|
123
|
+
|
106
124
|
|
107
125
|
#define CAIRO_REGION_OVERLAP_MIN CAIRO_REGION_OVERLAP_IN
|
108
126
|
#define CAIRO_REGION_OVERLAP_MAX CAIRO_REGION_OVERLAP_PART
|
@@ -386,6 +404,14 @@ Init_cairo_constants (void)
|
|
386
404
|
INT2FIX (CAIRO_ANTIALIAS_GRAY));
|
387
405
|
rb_define_const (rb_mCairo_Antialias, "SUBPIXEL",
|
388
406
|
INT2FIX (CAIRO_ANTIALIAS_SUBPIXEL));
|
407
|
+
#if CAIRO_CHECK_VERSION(1, 11, 4)
|
408
|
+
rb_define_const (rb_mCairo_Antialias, "FAST",
|
409
|
+
INT2FIX (CAIRO_ANTIALIAS_FAST));
|
410
|
+
rb_define_const (rb_mCairo_Antialias, "GOOD",
|
411
|
+
INT2FIX (CAIRO_ANTIALIAS_GOOD));
|
412
|
+
rb_define_const (rb_mCairo_Antialias, "BEST",
|
413
|
+
INT2FIX (CAIRO_ANTIALIAS_BEST));
|
414
|
+
#endif
|
389
415
|
|
390
416
|
|
391
417
|
/* cairo_fill_rule_t */
|
@@ -510,6 +536,10 @@ Init_cairo_constants (void)
|
|
510
536
|
INT2FIX (CAIRO_FORMAT_A1));
|
511
537
|
rb_define_const (rb_mCairo_Format, "RGB16_565",
|
512
538
|
INT2FIX (CAIRO_FORMAT_RGB16_565));
|
539
|
+
#if CAIRO_CHECK_VERSION(1, 11, 4)
|
540
|
+
rb_define_const (rb_mCairo_Format, "RGB30",
|
541
|
+
INT2FIX (CAIRO_FORMAT_RGB30));
|
542
|
+
#endif
|
513
543
|
|
514
544
|
#if CAIRO_CHECK_VERSION(1, 5, 8)
|
515
545
|
rb_define_singleton_method (rb_mCairo_Format, "stride_for_width",
|
@@ -616,7 +646,13 @@ Init_cairo_constants (void)
|
|
616
646
|
rb_str_new2 (CAIRO_MIME_TYPE_JP2));
|
617
647
|
rb_define_const (rb_mCairo_MimeType, "URI",
|
618
648
|
rb_str_new2 (CAIRO_MIME_TYPE_URI));
|
649
|
+
#endif
|
650
|
+
#if CAIRO_CHECK_VERSION(1, 11, 4)
|
651
|
+
rb_define_const (rb_mCairo_MimeType, "UNIQUE_ID",
|
652
|
+
rb_str_new2 (CAIRO_MIME_TYPE_UNIQUE_ID));
|
653
|
+
#endif
|
619
654
|
|
655
|
+
#if CAIRO_CHECK_VERSION(1, 10, 0)
|
620
656
|
rb_mCairo_RegionOverlap = rb_define_module_under (rb_mCairo, "RegionOverlap");
|
621
657
|
|
622
658
|
rb_define_const (rb_mCairo_RegionOverlap, "IN",
|
@@ -23,6 +23,7 @@
|
|
23
23
|
#endif
|
24
24
|
|
25
25
|
VALUE rb_cCairo_Context;
|
26
|
+
VALUE rb_cCairo_Rectangle;
|
26
27
|
|
27
28
|
static ID cr_id_surface, cr_id_source;
|
28
29
|
static ID cr_id_plus, cr_id_minus, cr_id_multi, cr_id_div;
|
@@ -33,7 +34,6 @@ static cairo_user_data_key_t cr_object_holder_key;
|
|
33
34
|
static VALUE cr_get_current_point (VALUE self);
|
34
35
|
|
35
36
|
#if CAIRO_CHECK_VERSION(1, 3, 0)
|
36
|
-
static VALUE rb_cCairo_Rectangle;
|
37
37
|
static ID at_x, at_y, at_width, at_height;
|
38
38
|
|
39
39
|
static VALUE
|
data/ext/cairo/rb_cairo_device.c
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
/*
|
3
3
|
* Ruby Cairo Binding
|
4
4
|
*
|
5
|
-
* Copyright 2010 Kouhei Sutou <kou@cozmixng.org>
|
5
|
+
* Copyright 2010-2012 Kouhei Sutou <kou@cozmixng.org>
|
6
6
|
*
|
7
7
|
* This file is made available under the same terms as Ruby
|
8
8
|
*
|
@@ -33,6 +33,8 @@ VALUE rb_cCairo_ScriptDevice = Qnil;
|
|
33
33
|
VALUE rb_cCairo_XCBDevice = Qnil;
|
34
34
|
VALUE rb_cCairo_XlibDevice = Qnil;
|
35
35
|
VALUE rb_cCairo_XMLDevice = Qnil;
|
36
|
+
VALUE rb_cCairo_CoglDevice = Qnil;
|
37
|
+
VALUE rb_cCairo_Win32Device = Qnil;
|
36
38
|
|
37
39
|
#if CAIRO_CHECK_VERSION(1, 10, 0)
|
38
40
|
|
@@ -75,6 +77,14 @@ cr_device_get_klass (cairo_device_t *device)
|
|
75
77
|
case CAIRO_DEVICE_TYPE_XML:
|
76
78
|
klass = rb_cCairo_XMLDevice;
|
77
79
|
break;
|
80
|
+
# if CAIRO_CHECK_VERSION(1, 11, 4)
|
81
|
+
case CAIRO_DEVICE_TYPE_COGL:
|
82
|
+
klass = rb_cCairo_CoglDevice;
|
83
|
+
break;
|
84
|
+
case CAIRO_DEVICE_TYPE_WIN32:
|
85
|
+
klass = rb_cCairo_Win32Device;
|
86
|
+
break;
|
87
|
+
# endif
|
78
88
|
default:
|
79
89
|
klass = rb_cCairo_Device;
|
80
90
|
break;
|
@@ -376,10 +386,15 @@ Init_cairo_device (void)
|
|
376
386
|
|
377
387
|
RB_CAIRO_DEF_SETTERS (rb_cCairo_Device);
|
378
388
|
|
379
|
-
|
389
|
+
rb_cCairo_DRMDevice =
|
390
|
+
rb_define_class_under (rb_mCairo, "DRMDevice", rb_cCairo_Device);
|
391
|
+
|
392
|
+
rb_cCairo_GLDevice =
|
393
|
+
rb_define_class_under (rb_mCairo, "GLDevice", rb_cCairo_Device);
|
394
|
+
|
380
395
|
rb_cCairo_ScriptDevice =
|
381
396
|
rb_define_class_under (rb_mCairo, "ScriptDevice", rb_cCairo_Device);
|
382
|
-
|
397
|
+
# ifdef CAIRO_HAS_SCRIPT_SURFACE
|
383
398
|
rb_define_method (rb_cCairo_ScriptDevice, "initialize",
|
384
399
|
cr_script_device_initialize, 1);
|
385
400
|
|
@@ -397,10 +412,15 @@ Init_cairo_device (void)
|
|
397
412
|
RB_CAIRO_DEF_SETTERS (rb_cCairo_ScriptDevice);
|
398
413
|
# endif
|
399
414
|
|
400
|
-
|
415
|
+
rb_cCairo_XCBDevice =
|
416
|
+
rb_define_class_under (rb_mCairo, "XCBDevice", rb_cCairo_Device);
|
417
|
+
|
418
|
+
rb_cCairo_XlibDevice =
|
419
|
+
rb_define_class_under (rb_mCairo, "XlibDevice", rb_cCairo_Device);
|
420
|
+
|
401
421
|
rb_cCairo_XMLDevice =
|
402
422
|
rb_define_class_under (rb_mCairo, "XMLDevice", rb_cCairo_Device);
|
403
|
-
|
423
|
+
# ifdef CAIRO_HAS_XML_SURFACE
|
404
424
|
rb_define_method (rb_cCairo_XMLDevice, "initialize",
|
405
425
|
cr_xml_device_initialize, 1);
|
406
426
|
|
@@ -410,5 +430,11 @@ Init_cairo_device (void)
|
|
410
430
|
RB_CAIRO_DEF_SETTERS (rb_cCairo_XMLDevice);
|
411
431
|
# endif
|
412
432
|
|
433
|
+
rb_cCairo_CoglDevice =
|
434
|
+
rb_define_class_under (rb_mCairo, "CoglDevice", rb_cCairo_Device);
|
435
|
+
|
436
|
+
rb_cCairo_Win32Device =
|
437
|
+
rb_define_class_under (rb_mCairo, "Win32Device", rb_cCairo_Device);
|
438
|
+
|
413
439
|
#endif
|
414
440
|
}
|
@@ -57,6 +57,10 @@ static VALUE rb_eCairo_UserFontNotImplemented;
|
|
57
57
|
static VALUE rb_eCairo_DeviceTypeMismatch;
|
58
58
|
static VALUE rb_eCairo_DeviceError;
|
59
59
|
#endif
|
60
|
+
#if CAIRO_CHECK_VERSION(1, 11, 2)
|
61
|
+
static VALUE rb_eCairo_InvalidMeshConstruction;
|
62
|
+
static VALUE rb_eCairo_DeviceFinished;
|
63
|
+
#endif
|
60
64
|
|
61
65
|
void
|
62
66
|
rb_cairo_check_status (cairo_status_t status)
|
@@ -179,10 +183,18 @@ rb_cairo_check_status (cairo_status_t status)
|
|
179
183
|
case CAIRO_STATUS_DEVICE_ERROR:
|
180
184
|
rb_raise (rb_eCairo_DeviceError, "%s", string);
|
181
185
|
break;
|
186
|
+
#endif
|
187
|
+
#if CAIRO_CHECK_VERSION(1, 11, 2)
|
188
|
+
case CAIRO_STATUS_INVALID_MESH_CONSTRUCTION:
|
189
|
+
rb_raise (rb_eCairo_InvalidMeshConstruction, "%s", string);
|
190
|
+
break;
|
191
|
+
case CAIRO_STATUS_DEVICE_FINISHED:
|
192
|
+
rb_raise (rb_eCairo_DeviceFinished, "%s", string);
|
193
|
+
break;
|
194
|
+
#endif
|
182
195
|
case CAIRO_STATUS_LAST_STATUS:
|
183
196
|
rb_raise (rb_eArgError, "bug: %s: %d", string, status);
|
184
197
|
break;
|
185
|
-
#endif
|
186
198
|
}
|
187
199
|
}
|
188
200
|
|
@@ -402,4 +414,12 @@ Init_cairo_exception ()
|
|
402
414
|
rb_define_class_under (rb_mCairo, "DeviceError",
|
403
415
|
rb_eCairo_Error);
|
404
416
|
#endif
|
417
|
+
#if CAIRO_CHECK_VERSION(1, 11, 2)
|
418
|
+
rb_eCairo_InvalidMeshConstruction =
|
419
|
+
rb_define_class_under (rb_mCairo, "InvalidMeshConstruction",
|
420
|
+
rb_eArgError);
|
421
|
+
rb_eCairo_DeviceFinished =
|
422
|
+
rb_define_class_under (rb_mCairo, "DeviceFinished",
|
423
|
+
rb_eCairo_Error);
|
424
|
+
#endif
|
405
425
|
}
|