pango 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +2 -2
- data/Rakefile +7 -5
- data/ext/pango/extconf.rb +4 -4
- data/ext/pango/rbpango.c +0 -9
- data/ext/pango/rbpango.h +2 -10
- data/ext/pango/rbpangoanalysis.c +0 -4
- data/ext/pango/rbpangoattribute.c +1 -26
- data/ext/pango/rbpangoattrlist.c +0 -4
- data/ext/pango/rbpangocairo.c +13 -12
- data/ext/pango/rbpangocairocontext.c +6 -26
- data/ext/pango/rbpangocontext.c +2 -14
- data/ext/pango/rbpangofont.c +0 -12
- data/ext/pango/rbpangofontdescription.c +0 -5
- data/ext/pango/rbpangofontface.c +0 -6
- data/ext/pango/rbpangofontfamily.c +0 -3
- data/ext/pango/rbpangofontmap.c +0 -4
- data/ext/pango/rbpangofontmetrics.c +1 -4
- data/ext/pango/rbpangofontset.c +0 -4
- data/ext/pango/rbpangoglyphitem.c +0 -8
- data/ext/pango/rbpangoglyphstring.c +0 -4
- data/ext/pango/rbpangoitem.c +0 -16
- data/ext/pango/rbpangolanguage.c +0 -5
- data/ext/pango/rbpangolayout.c +36 -19
- data/ext/pango/rbpangolayoutline.c +0 -33
- data/ext/pango/rbpangologattr.c +0 -5
- data/ext/pango/rbpangomatrix.c +0 -10
- data/ext/pango/rbpangoprivate.h +0 -4
- data/ext/pango/rbpangorenderer.c +0 -6
- data/ext/pango/rbpangoscript.c +0 -4
- data/ext/pango/rbpangoscriptiter.c +0 -5
- data/test/{test_layout.rb → test-layout.rb} +14 -0
- metadata +13 -19
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 786851f050fc3fb306d8d80dcd242ed00e9635b4
|
4
|
+
data.tar.gz: bac0269f3a51230f584eaa3b290fbd4364c30976
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6d55f2227171ce2552be8649370d23b0ec2bd180f35ed1b97fd78e2aacfa4253c7340635e42131e1200bb6b9152e0ecc4231dcc2ee045dcf622061dbf5af3cb9
|
7
|
+
data.tar.gz: ccc426bacaafec319ae8781fa262e534b0c5238ac85503870eb240fbf7e94e068c45f003faa5ec3d47d1b0aa0306bae222c1241c145e68eaa0bdd9865d88b520
|
data/README
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Ruby/Pango
|
2
2
|
==========
|
3
|
-
Ruby/Pango is a Ruby binding of pango-1.x.
|
3
|
+
Ruby/Pango is a Ruby binding of pango-1.14.x.
|
4
4
|
|
5
5
|
Requirements
|
6
6
|
------------
|
@@ -12,7 +12,7 @@ Requirements
|
|
12
12
|
|
13
13
|
Install
|
14
14
|
-------
|
15
|
-
0. install ruby-1.
|
15
|
+
0. install ruby-1.9.x or later, GLib, Pango-1.14.x or later, Ruby/GLib2, Ruby/GTK2
|
16
16
|
(and cairo/rcairo).
|
17
17
|
1. ruby extconf.rb
|
18
18
|
(To use rcairo on Win32, set CAIRO_PATH as a environment variable first)
|
data/Rakefile
CHANGED
@@ -15,20 +15,21 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
|
|
15
15
|
:name => "harfbuzz",
|
16
16
|
:download_base_url => "http://www.freedesktop.org/software/harfbuzz/release",
|
17
17
|
:label => "HarfBuzz",
|
18
|
-
:version => "0.9.
|
18
|
+
:version => "0.9.25",
|
19
19
|
:compression_method => "bz2",
|
20
20
|
:windows => {
|
21
|
+
:configure_args => [
|
22
|
+
],
|
21
23
|
:patches => [
|
22
|
-
"harfbuzz-0.9.17-disable-uniscribe.diff",
|
23
24
|
],
|
24
|
-
:
|
25
|
+
:built_file => "bin/libharfbuzz-0.dll",
|
25
26
|
},
|
26
27
|
},
|
27
28
|
{
|
28
29
|
:name => "pango",
|
29
30
|
:download_site => :gnome,
|
30
31
|
:label => "pango",
|
31
|
-
:version => "1.
|
32
|
+
:version => "1.36.1",
|
32
33
|
:compression_method => "xz",
|
33
34
|
:windows => {
|
34
35
|
:configure_args => [
|
@@ -37,6 +38,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
|
|
37
38
|
:patches => [
|
38
39
|
"pango-1.34.0-enable-fc-font.diff",
|
39
40
|
],
|
41
|
+
:built_file => "bin/libpango-1.0-0.dll",
|
40
42
|
},
|
41
43
|
},
|
42
44
|
]
|
@@ -47,7 +49,7 @@ namespace :gcc do
|
|
47
49
|
namespace :dll do
|
48
50
|
desc "Bundle GCC related DLLs"
|
49
51
|
task(:bundle) do
|
50
|
-
dlls = ["
|
52
|
+
dlls = ["libstdc++-6.dll"]
|
51
53
|
dlls.each do |dll|
|
52
54
|
host = package_task.windows.build_host
|
53
55
|
binary_dir = package_task.windows.absolute_binary_dir
|
data/ext/pango/extconf.rb
CHANGED
@@ -54,11 +54,13 @@ rcairo_source_dir_names.each do |rcairo_source_dir_name|
|
|
54
54
|
break
|
55
55
|
end
|
56
56
|
end
|
57
|
-
check_cairo(rcairo_options)
|
57
|
+
unless check_cairo(rcairo_options)
|
58
|
+
exit(false)
|
59
|
+
end
|
58
60
|
|
59
61
|
setup_win32(module_name, base_dir)
|
60
62
|
|
61
|
-
unless required_pkg_config_package(package_id,
|
63
|
+
unless required_pkg_config_package([package_id, 1, 14, 0],
|
62
64
|
:debian => "libpango1.0-dev",
|
63
65
|
:redhat => "pango-devel",
|
64
66
|
:homebrew => "pango",
|
@@ -76,8 +78,6 @@ end
|
|
76
78
|
|
77
79
|
pango_header = "pango/pango.h"
|
78
80
|
have_func("pango_layout_iter_get_type", pango_header)
|
79
|
-
have_func("pango_layout_set_ellipsize", pango_header)
|
80
|
-
have_func("pango_layout_get_font_description", pango_header)
|
81
81
|
have_func("pango_render_part_get_type", pango_header)
|
82
82
|
have_func("pango_attr_strikethrough_color_new", pango_header)
|
83
83
|
have_func("pango_attr_underline_color_new", pango_header)
|
data/ext/pango/rbpango.c
CHANGED
@@ -75,7 +75,6 @@ rg_s_reorder_items(G_GNUC_UNUSED VALUE self, VALUE attrs)
|
|
75
75
|
rpango_reorder_items_ensure, (VALUE)&args);
|
76
76
|
}
|
77
77
|
|
78
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
79
78
|
static VALUE
|
80
79
|
rg_s_unichar_direction(G_GNUC_UNUSED VALUE self, VALUE ch)
|
81
80
|
{
|
@@ -88,7 +87,6 @@ rg_s_find_base_dir(G_GNUC_UNUSED VALUE self, VALUE text)
|
|
88
87
|
StringValue(text);
|
89
88
|
return PANGODIRECTION2RVAL(pango_find_base_dir(RSTRING_PTR(text), RSTRING_LEN(text)));
|
90
89
|
}
|
91
|
-
#endif
|
92
90
|
|
93
91
|
struct rbg_pangologattrs2rval_free_args {
|
94
92
|
PangoLogAttr *attrs;
|
@@ -255,11 +253,7 @@ rg_s_pixels(G_GNUC_UNUSED VALUE self, VALUE pixels)
|
|
255
253
|
static VALUE
|
256
254
|
rg_s_cairo_available_p(G_GNUC_UNUSED VALUE self)
|
257
255
|
{
|
258
|
-
#ifdef CAIRO_AVAILABLE
|
259
256
|
return Qtrue;
|
260
|
-
#else
|
261
|
-
return Qfalse;
|
262
|
-
#endif
|
263
257
|
}
|
264
258
|
|
265
259
|
void
|
@@ -274,11 +268,8 @@ Init_pango(void)
|
|
274
268
|
INT2FIX(PANGO_MICRO_VERSION)));
|
275
269
|
|
276
270
|
RG_DEF_SMETHOD(reorder_items, 1);
|
277
|
-
|
278
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
279
271
|
RG_DEF_SMETHOD(unichar_direction, 1);
|
280
272
|
RG_DEF_SMETHOD(find_base_dir, 1);
|
281
|
-
#endif
|
282
273
|
RG_DEF_SMETHOD(break, 2);
|
283
274
|
RG_DEF_SMETHOD(get_log_attrs, 3);
|
284
275
|
RG_DEF_SMETHOD(find_paragraph_boundary, 1);
|
data/ext/pango/rbpango.h
CHANGED
@@ -31,12 +31,10 @@
|
|
31
31
|
#include "rbgobject.h"
|
32
32
|
#include "rbpangoversion.h"
|
33
33
|
#include "rbpangoconversions.h"
|
34
|
-
|
35
|
-
#if PANGO_CHECK_VERSION(1,10,0)
|
36
34
|
#include <pango/pangocairo.h>
|
37
|
-
|
35
|
+
|
36
|
+
#ifdef HAVE_RB_CAIRO_H
|
38
37
|
#include <rb_cairo.h>
|
39
|
-
# endif
|
40
38
|
#endif
|
41
39
|
|
42
40
|
#if defined(G_PLATFORM_WIN32) && !defined(RUBY_PANGO_STATIC_COMPILATION)
|
@@ -70,10 +68,7 @@ RUBY_PANGO_VAR VALUE mPango;
|
|
70
68
|
#ifndef PANGO_TYPE_GLYPH_ITEM
|
71
69
|
# define PANGO_TYPE_GLYPH_ITEM (pango_glyph_item_get_type())
|
72
70
|
#endif
|
73
|
-
|
74
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
75
71
|
#define PANGO_TYPE_SCRIPT_ITER (pango_script_iter_get_type())
|
76
|
-
#endif
|
77
72
|
|
78
73
|
#define ATTR2RVAL(attr) (pango_make_attribute(attr))
|
79
74
|
#define RVAL2ATTR(attr) (pango_get_attribute(attr))
|
@@ -95,10 +90,7 @@ extern GType pango_glyph_info_get_type(void);
|
|
95
90
|
#ifndef HAVE_PANGO_GLYPH_ITEM_GET_TYPE
|
96
91
|
extern GType pango_glyph_item_get_type(void);
|
97
92
|
#endif
|
98
|
-
|
99
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
100
93
|
extern GType pango_script_iter_get_type(void);
|
101
|
-
#endif
|
102
94
|
|
103
95
|
extern VALUE pango_get_attribute_klass(VALUE attr_type);
|
104
96
|
extern void pango_add_attribute(int attr_type, VALUE klass);
|
data/ext/pango/rbpangoanalysis.c
CHANGED
@@ -56,7 +56,6 @@ rg_initialize(VALUE self)
|
|
56
56
|
return Qnil;
|
57
57
|
}
|
58
58
|
|
59
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
60
59
|
static VALUE
|
61
60
|
rg_set_shape_engine(VALUE self, VALUE engine)
|
62
61
|
{
|
@@ -100,7 +99,6 @@ rg_lang_engine(VALUE self)
|
|
100
99
|
}
|
101
100
|
return ret;
|
102
101
|
}
|
103
|
-
#endif
|
104
102
|
|
105
103
|
static VALUE
|
106
104
|
rg_set_font(VALUE self, VALUE font)
|
@@ -204,12 +202,10 @@ Init_pango_analysis(VALUE mPango)
|
|
204
202
|
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ANALYSIS, "Analysis", mPango);
|
205
203
|
|
206
204
|
RG_DEF_METHOD(initialize, 0);
|
207
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
208
205
|
RG_DEF_METHOD(set_shape_engine, 1);
|
209
206
|
RG_DEF_METHOD(shape_engine, 0);
|
210
207
|
RG_DEF_METHOD(set_lang_engine, 1);
|
211
208
|
RG_DEF_METHOD(lang_engine, 0);
|
212
|
-
#endif
|
213
209
|
RG_DEF_METHOD(set_font, 1);
|
214
210
|
RG_DEF_METHOD(font, 0);
|
215
211
|
RG_DEF_METHOD(set_level, 1);
|
@@ -274,14 +274,13 @@ attr_AttrSize_initialize(VALUE self, VALUE size)
|
|
274
274
|
DATA_PTR(self) = pango_attr_size_new(NUM2INT(size));
|
275
275
|
return Qnil;
|
276
276
|
}
|
277
|
-
|
277
|
+
|
278
278
|
static VALUE
|
279
279
|
attr_AttrAbsoluteSize_initialize(VALUE self, VALUE size)
|
280
280
|
{
|
281
281
|
DATA_PTR(self) = pango_attr_size_new_absolute(NUM2INT(size));
|
282
282
|
return Qnil;
|
283
283
|
}
|
284
|
-
#endif
|
285
284
|
|
286
285
|
#if PANGO_CHECK_VERSION(1,16,0)
|
287
286
|
static VALUE
|
@@ -357,18 +356,11 @@ attr_AttrShape_initialize(int argc, VALUE *argv, VALUE self)
|
|
357
356
|
RVAL2PANGORECTANGLE(ink_rect),
|
358
357
|
RVAL2PANGORECTANGLE(logical_rect));
|
359
358
|
} else {
|
360
|
-
#if PANGO_CHECK_VERSION(1,8,0)
|
361
359
|
G_RELATIVE(self, data);
|
362
360
|
DATA_PTR(self) = pango_attr_shape_new_with_data(
|
363
361
|
RVAL2PANGORECTANGLE(ink_rect),
|
364
362
|
RVAL2PANGORECTANGLE(logical_rect),
|
365
363
|
(gpointer)data, NULL, NULL);
|
366
|
-
#else
|
367
|
-
rb_warning("not supported in Pango-1.6.x. the 3rd parameter was ignored.");
|
368
|
-
DATA_PTR(self) = pango_attr_shape_new(
|
369
|
-
RVAL2PANGORECTANGLE(ink_rect),
|
370
|
-
RVAL2PANGORECTANGLE(logical_rect));
|
371
|
-
#endif
|
372
364
|
}
|
373
365
|
|
374
366
|
return Qnil;
|
@@ -381,20 +373,15 @@ attr_AttrScale_initialize(VALUE self, VALUE scale)
|
|
381
373
|
return Qnil;
|
382
374
|
}
|
383
375
|
|
384
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
385
376
|
static VALUE
|
386
377
|
attr_AttrFallback_initialize(VALUE self, VALUE enable_fallback)
|
387
378
|
{
|
388
379
|
DATA_PTR(self) = pango_attr_fallback_new(RVAL2CBOOL(enable_fallback));
|
389
380
|
return Qnil;
|
390
381
|
}
|
391
|
-
#endif
|
392
382
|
|
393
383
|
MAKE_ATTRINT_INIT(AttrRise, rise);
|
394
|
-
|
395
|
-
#if PANGO_CHECK_VERSION(1,6,0)
|
396
384
|
MAKE_ATTRINT_INIT(AttrLetterSpacing, letter_spacing);
|
397
|
-
#endif
|
398
385
|
|
399
386
|
#define MAKE_ATTR(gtype, name, parent, num)\
|
400
387
|
tmpklass = rb_define_class_under(mPango, #name, parent);\
|
@@ -450,9 +437,7 @@ Init_pango_attribute(VALUE mPango)
|
|
450
437
|
MAKE_ATTR(PANGO_ATTR_VARIANT, AttrVariant, pattrint, 1);
|
451
438
|
MAKE_ATTR(PANGO_ATTR_STRETCH, AttrStretch, pattrint, 1);
|
452
439
|
MAKE_ATTR(PANGO_ATTR_SIZE, AttrSize, pattrint, 1);
|
453
|
-
#if PANGO_CHECK_VERSION(1,8,1)
|
454
440
|
MAKE_ATTR(PANGO_ATTR_ABSOLUTE_SIZE, AttrAbsoluteSize, pattrint, 1);
|
455
|
-
#endif
|
456
441
|
#if PANGO_CHECK_VERSION(1,16,0)
|
457
442
|
MAKE_ATTR(PANGO_ATTR_GRAVITY, AttrGravity, pattrint, 1);
|
458
443
|
MAKE_ATTR(PANGO_ATTR_GRAVITY_HINT, AttrGravityHint, pattrint, 1);
|
@@ -474,9 +459,7 @@ Init_pango_attribute(VALUE mPango)
|
|
474
459
|
MAKE_ATTR(PANGO_ATTR_STRIKETHROUGH_COLOR, AttrStrikethroughColor, pattrcolor, 3);
|
475
460
|
#endif
|
476
461
|
MAKE_ATTR(PANGO_ATTR_RISE, AttrRise, pattrint, 1);
|
477
|
-
#if PANGO_CHECK_VERSION(1,6,0)
|
478
462
|
MAKE_ATTR(PANGO_ATTR_LETTER_SPACING, AttrLetterSpacing, pattrint, 1);
|
479
|
-
#endif
|
480
463
|
MAKE_ATTR(PANGO_ATTR_SHAPE, AttrShape, RG_TARGET_NAMESPACE, -1);
|
481
464
|
rbg_define_method(tmpklass, "ink_rect", attr_shape_ink_rect, 0);
|
482
465
|
rbg_define_method(tmpklass, "logical_rect", attr_shape_logical_rect, 0);
|
@@ -490,9 +473,7 @@ Init_pango_attribute(VALUE mPango)
|
|
490
473
|
rb_define_const(tmpklass, "LARGE", rb_float_new(PANGO_SCALE_LARGE));
|
491
474
|
rb_define_const(tmpklass, "X_LARGE", rb_float_new(PANGO_SCALE_X_LARGE));
|
492
475
|
rb_define_const(tmpklass, "XX_LARGE", rb_float_new(PANGO_SCALE_XX_LARGE));
|
493
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
494
476
|
MAKE_ATTR(PANGO_ATTR_FALLBACK, AttrFallback, pattrbool, 1);
|
495
|
-
#endif
|
496
477
|
/* PangoAttrType */
|
497
478
|
G_DEF_CLASS(PANGO_TYPE_ATTR_TYPE, "Type", RG_TARGET_NAMESPACE);
|
498
479
|
#define INT2ATTRTYPE(x) rbgobj_make_enum((x), PANGO_TYPE_ATTR_TYPE)
|
@@ -509,16 +490,10 @@ Init_pango_attribute(VALUE mPango)
|
|
509
490
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_BACKGROUND", INT2ATTRTYPE(PANGO_ATTR_BACKGROUND));
|
510
491
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_UNDERLINE", INT2ATTRTYPE(PANGO_ATTR_UNDERLINE));
|
511
492
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRIKETHROUGH", INT2ATTRTYPE(PANGO_ATTR_STRIKETHROUGH));
|
512
|
-
#if PANGO_CHECK_VERSION(1,8,0)
|
513
493
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRIKETHROUGH_COLOR", INT2ATTRTYPE(PANGO_ATTR_STRIKETHROUGH_COLOR));
|
514
|
-
#endif
|
515
494
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_RISE", INT2ATTRTYPE(PANGO_ATTR_RISE));
|
516
495
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_SHAPE", INT2ATTRTYPE(PANGO_ATTR_SHAPE));
|
517
496
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_SCALE", INT2ATTRTYPE(PANGO_ATTR_SCALE));
|
518
|
-
#if PANGO_CHECK_VERSION(1,8,0)
|
519
497
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FALLBACK", INT2ATTRTYPE(PANGO_ATTR_FALLBACK));
|
520
|
-
#endif
|
521
|
-
#if PANGO_CHECK_VERSION(1,6,0)
|
522
498
|
rb_define_const(RG_TARGET_NAMESPACE, "TYPE_LETTER_SPACING", INT2ATTRTYPE(PANGO_ATTR_LETTER_SPACING));
|
523
|
-
#endif
|
524
499
|
}
|
data/ext/pango/rbpangoattrlist.c
CHANGED
@@ -61,7 +61,6 @@ rg_splice(VALUE self, VALUE other, VALUE pos, VALUE len)
|
|
61
61
|
return self;
|
62
62
|
}
|
63
63
|
|
64
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
65
64
|
static gboolean
|
66
65
|
filter_func(PangoAttribute *attr, gpointer data)
|
67
66
|
{
|
@@ -77,7 +76,6 @@ rg_filter(VALUE self)
|
|
77
76
|
(PangoAttrFilterFunc)filter_func,
|
78
77
|
(gpointer)func));
|
79
78
|
}
|
80
|
-
#endif
|
81
79
|
|
82
80
|
static VALUE
|
83
81
|
rg_iterator(VALUE self)
|
@@ -97,9 +95,7 @@ Init_pango_attrlist(VALUE mPango)
|
|
97
95
|
RG_DEF_METHOD(insert_before, 1);
|
98
96
|
RG_DEF_METHOD(change, 1);
|
99
97
|
RG_DEF_METHOD(splice, 3);
|
100
|
-
#if PANGO_CHECK_VERSION(1,4,0)
|
101
98
|
RG_DEF_METHOD(filter, 0);
|
102
|
-
#endif
|
103
99
|
RG_DEF_METHOD(iterator, 0);
|
104
100
|
|
105
101
|
}
|
data/ext/pango/rbpangocairo.c
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C)
|
4
|
-
* Copyright (C) 2006 Ruby-GNOME2 Project Team
|
3
|
+
* Copyright (C) 2006-2013 Ruby-GNOME2 Project Team
|
5
4
|
* Copyright (C) 2005 Kouhei Sutou
|
6
5
|
*
|
7
6
|
* This library is free software; you can redistribute it and/or
|
@@ -22,8 +21,6 @@
|
|
22
21
|
|
23
22
|
#include "rbpangoprivate.h"
|
24
23
|
|
25
|
-
#ifdef CAIRO_AVAILABLE
|
26
|
-
|
27
24
|
#define RG_TARGET_NAMESPACE cCairoFontMap
|
28
25
|
#define _SELF(self) (RVAL2PANGOCAIROFONTMAP(self))
|
29
26
|
|
@@ -63,14 +60,14 @@ rg_s_default(G_GNUC_UNUSED VALUE klass)
|
|
63
60
|
return GOBJ2RVAL(pango_cairo_font_map_get_default());
|
64
61
|
}
|
65
62
|
|
66
|
-
#
|
63
|
+
#if PANGO_CHECK_VERSION(1, 22, 0)
|
67
64
|
static VALUE
|
68
65
|
rg_s_set_default(VALUE klass, VALUE font_map)
|
69
66
|
{
|
70
67
|
pango_cairo_font_map_set_default(RVAL2GOBJ(font_map));
|
71
68
|
return klass;
|
72
69
|
}
|
73
|
-
#
|
70
|
+
#endif
|
74
71
|
|
75
72
|
static VALUE
|
76
73
|
rg_set_resolution(VALUE self, VALUE dpi)
|
@@ -88,15 +85,20 @@ rg_resolution(VALUE self)
|
|
88
85
|
static VALUE
|
89
86
|
rg_create_context(VALUE self)
|
90
87
|
{
|
91
|
-
|
92
|
-
}
|
88
|
+
PangoContext *pango_context;
|
93
89
|
|
90
|
+
#if PANGO_CHECK_VERSION(1, 22, 0)
|
91
|
+
pango_context = pango_font_map_create_context(PANGO_FONT_MAP(_SELF(self)));
|
92
|
+
#else
|
93
|
+
pango_context = pango_cairo_font_map_create_context(_SELF(self));
|
94
94
|
#endif
|
95
95
|
|
96
|
+
return GOBJ2RVAL_UNREF(pango_context);
|
97
|
+
}
|
98
|
+
|
96
99
|
void
|
97
100
|
Init_pango_cairo(VALUE mPango)
|
98
101
|
{
|
99
|
-
#ifdef CAIRO_AVAILABLE
|
100
102
|
VALUE RG_TARGET_NAMESPACE;
|
101
103
|
|
102
104
|
/* Pango::CairoFontMap */
|
@@ -104,12 +106,11 @@ Init_pango_cairo(VALUE mPango)
|
|
104
106
|
|
105
107
|
RG_DEF_SMETHOD(create, -1);
|
106
108
|
RG_DEF_SMETHOD(default, 0);
|
107
|
-
#
|
109
|
+
#if PANGO_CHECK_VERSION(1, 22, 0)
|
108
110
|
RG_DEF_SMETHOD(set_default, 1);
|
109
|
-
#
|
111
|
+
#endif
|
110
112
|
|
111
113
|
RG_DEF_METHOD(set_resolution, 1);
|
112
114
|
RG_DEF_METHOD(resolution, 0);
|
113
115
|
RG_DEF_METHOD(create_context, 0);
|
114
|
-
#endif
|
115
116
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
2
|
/*
|
3
|
-
* Copyright (C)
|
4
|
-
* Copyright (C) 2006 Ruby-GNOME2 Project Team
|
3
|
+
* Copyright (C) 2006-2013 Ruby-GNOME2 Project Team
|
5
4
|
* Copyright (C) 2005 Kouhei Sutou
|
6
5
|
*
|
7
6
|
* This library is free software; you can redistribute it and/or
|
@@ -22,12 +21,6 @@
|
|
22
21
|
|
23
22
|
#include "rbpangoprivate.h"
|
24
23
|
|
25
|
-
#if PANGO_CHECK_VERSION(1,10,0) && defined(HAVE_RB_CAIRO_H)
|
26
|
-
# define CAIRO_AVAILABLE 1
|
27
|
-
#endif
|
28
|
-
|
29
|
-
#ifdef CAIRO_AVAILABLE
|
30
|
-
|
31
24
|
#define RG_TARGET_NAMESPACE rb_cCairo_Context
|
32
25
|
|
33
26
|
static VALUE
|
@@ -75,16 +68,14 @@ rg_show_pango_layout(VALUE self, VALUE layout)
|
|
75
68
|
return self;
|
76
69
|
}
|
77
70
|
|
78
|
-
#if PANGO_CHECK_VERSION(1,14,0)
|
79
71
|
static VALUE
|
80
72
|
rg_show_pango_error_underline(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
|
81
73
|
{
|
82
|
-
pango_cairo_show_error_underline(RVAL2CRCONTEXT(self),
|
83
|
-
NUM2DBL(x), NUM2DBL(y),
|
74
|
+
pango_cairo_show_error_underline(RVAL2CRCONTEXT(self),
|
75
|
+
NUM2DBL(x), NUM2DBL(y),
|
84
76
|
NUM2DBL(width), NUM2DBL(height));
|
85
77
|
return self;
|
86
78
|
}
|
87
|
-
#endif
|
88
79
|
|
89
80
|
/* Rendering to a path */
|
90
81
|
static VALUE
|
@@ -110,23 +101,18 @@ rg_pango_layout_path(VALUE self, VALUE layout)
|
|
110
101
|
return self;
|
111
102
|
}
|
112
103
|
|
113
|
-
#if PANGO_CHECK_VERSION(1,14,0)
|
114
104
|
static VALUE
|
115
105
|
rg_pango_error_underline_path(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height)
|
116
106
|
{
|
117
|
-
pango_cairo_error_underline_path(RVAL2CRCONTEXT(self),
|
118
|
-
NUM2DBL(x), NUM2DBL(y),
|
107
|
+
pango_cairo_error_underline_path(RVAL2CRCONTEXT(self),
|
108
|
+
NUM2DBL(x), NUM2DBL(y),
|
119
109
|
NUM2DBL(width), NUM2DBL(height));
|
120
110
|
return self;
|
121
111
|
}
|
122
|
-
#endif
|
123
|
-
|
124
|
-
#endif
|
125
112
|
|
126
113
|
void
|
127
|
-
Init_pango_cairo_context(VALUE mPango)
|
114
|
+
Init_pango_cairo_context(G_GNUC_UNUSED VALUE mPango)
|
128
115
|
{
|
129
|
-
#ifdef CAIRO_AVAILABLE
|
130
116
|
/* Cairo::Context */
|
131
117
|
RG_DEF_METHOD(update_pango_context, 1);
|
132
118
|
/* Convenience */
|
@@ -136,16 +122,10 @@ Init_pango_cairo_context(VALUE mPango)
|
|
136
122
|
RG_DEF_METHOD(show_pango_glyph_string, 2);
|
137
123
|
RG_DEF_METHOD(show_pango_layout_line, 1);
|
138
124
|
RG_DEF_METHOD(show_pango_layout, 1);
|
139
|
-
#if PANGO_CHECK_VERSION(1,14,0)
|
140
125
|
RG_DEF_METHOD(show_pango_error_underline, 4);
|
141
|
-
#endif
|
142
126
|
/* Rendering to a path */
|
143
127
|
RG_DEF_METHOD(pango_glyph_string_path, 2);
|
144
128
|
RG_DEF_METHOD(pango_layout_line_path, 1);
|
145
129
|
RG_DEF_METHOD(pango_layout_path, 1);
|
146
|
-
|
147
|
-
#if PANGO_CHECK_VERSION(1,14,0)
|
148
130
|
RG_DEF_METHOD(pango_error_underline_path, 4);
|
149
|
-
#endif
|
150
|
-
#endif
|
151
131
|
}
|