pango 3.1.6-x64-mingw32 → 3.1.7-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/ext/pango/pango.def +1 -0
- data/ext/pango/rb-pango-attr-iterator.c +60 -0
- data/ext/pango/rb-pango-attr-list.c +10 -0
- data/ext/pango/rb-pango-attribute.c +413 -34
- data/ext/pango/rb-pango-conversions.h +9 -0
- data/ext/pango/rb-pango-private.h +2 -0
- data/ext/pango/rb-pango-scale.c +53 -0
- data/ext/pango/rb-pango.c +2 -0
- data/lib/2.2/pango.so +0 -0
- data/lib/2.3/pango.so +0 -0
- data/lib/2.4/pango.so +0 -0
- data/lib/pango/attr-type.rb +27 -0
- data/lib/pango/deprecated.rb +33 -0
- data/lib/pango/loader.rb +3 -8
- data/test/test-attr-iterator.rb +36 -0
- data/vendor/local/bin/derb.exe +0 -0
- data/vendor/local/bin/genbrk.exe +0 -0
- data/vendor/local/bin/genccode.exe +0 -0
- data/vendor/local/bin/gencfu.exe +0 -0
- data/vendor/local/bin/gencmn.exe +0 -0
- data/vendor/local/bin/gencnval.exe +0 -0
- data/vendor/local/bin/gendict.exe +0 -0
- data/vendor/local/bin/gennorm2.exe +0 -0
- data/vendor/local/bin/genrb.exe +0 -0
- data/vendor/local/bin/gensprep.exe +0 -0
- data/vendor/local/bin/hb-ot-shape-closure.exe +0 -0
- data/vendor/local/bin/hb-shape.exe +0 -0
- data/vendor/local/bin/hb-view.exe +0 -0
- data/vendor/local/bin/icuinfo.exe +0 -0
- data/vendor/local/bin/icupkg.exe +0 -0
- data/vendor/local/bin/libgraphene-1.0-0.dll +0 -0
- data/vendor/local/bin/libharfbuzz-0.dll +0 -0
- data/vendor/local/bin/libpango-1.0-0.dll +0 -0
- data/vendor/local/bin/libpangocairo-1.0-0.dll +0 -0
- data/vendor/local/bin/libpangoft2-1.0-0.dll +0 -0
- data/vendor/local/bin/libpangowin32-1.0-0.dll +0 -0
- data/vendor/local/bin/makeconv.exe +0 -0
- data/vendor/local/bin/pango-view.exe +0 -0
- data/vendor/local/bin/pkgdata.exe +0 -0
- data/vendor/local/bin/uconv.exe +0 -0
- data/vendor/local/include/pango-1.0/pango/pango-features.h +2 -2
- data/vendor/local/include/pango-1.0/pango/pango-version-macros.h +135 -128
- data/vendor/local/lib/icudt.dll +0 -0
- data/vendor/local/lib/icudt58.dll +0 -0
- data/vendor/local/lib/icuin.dll +0 -0
- data/vendor/local/lib/icuin58.dll +0 -0
- data/vendor/local/lib/icuio.dll +0 -0
- data/vendor/local/lib/icuio58.dll +0 -0
- data/vendor/local/lib/icutest.dll +0 -0
- data/vendor/local/lib/icutest58.dll +0 -0
- data/vendor/local/lib/icutu.dll +0 -0
- data/vendor/local/lib/icutu58.dll +0 -0
- data/vendor/local/lib/icuuc.dll +0 -0
- data/vendor/local/lib/icuuc58.dll +0 -0
- data/vendor/local/lib/libgraphene-1.0.dll.a +0 -0
- data/vendor/local/lib/libharfbuzz.dll.a +0 -0
- data/vendor/local/lib/libicudt.dll.a +0 -0
- data/vendor/local/lib/libicuin.dll.a +0 -0
- data/vendor/local/lib/libicuio.dll.a +0 -0
- data/vendor/local/lib/libicutest.dll.a +0 -0
- data/vendor/local/lib/libicutu.dll.a +0 -0
- data/vendor/local/lib/libicuuc.dll.a +0 -0
- data/vendor/local/lib/libpango-1.0.dll.a +0 -0
- data/vendor/local/lib/libpango-1.0.la +1 -1
- data/vendor/local/lib/libpangocairo-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangocairo-1.0.la +1 -1
- data/vendor/local/lib/libpangoft2-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangoft2-1.0.la +1 -1
- data/vendor/local/lib/libpangowin32-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangowin32-1.0.la +1 -1
- data/vendor/local/lib/pkgconfig/pango.pc +1 -1
- data/vendor/local/lib/pkgconfig/pangocairo.pc +1 -1
- data/vendor/local/lib/pkgconfig/pangoft2.pc +1 -1
- data/vendor/local/lib/pkgconfig/pangowin32.pc +1 -1
- data/vendor/local/share/gtk-doc/html/pango/PangoRenderer.html +1 -1
- data/vendor/local/share/gtk-doc/html/pango/index.html +1 -1
- data/vendor/local/share/gtk-doc/html/pango/pango-Bidirectional-Text.html +1 -1
- data/vendor/local/share/gtk-doc/html/pango/pango-Cairo-Rendering.html +1 -1
- data/vendor/local/share/gtk-doc/html/pango/pango-Coverage-Maps.html +1 -1
- data/vendor/local/share/gtk-doc/html/pango/pango-Fonts.html +5 -5
- data/vendor/local/share/gtk-doc/html/pango/pango-Glyph-Storage.html +1 -1
- data/vendor/local/share/gtk-doc/html/pango/pango-Layout-Objects.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Tab-Stops.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Text-Attributes.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Text-Processing.html +3 -3
- data/vendor/local/share/gtk-doc/html/pango/pango-Version-Checking.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Vertical-Text.html +1 -1
- data/vendor/local/share/gtk-doc/html/pango/pango-hierarchy.html +4 -4
- data/vendor/local/share/man/man1/pango-view.1 +1 -1
- metadata +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c283522af1939763e53927bae6ec63af600dd715
|
4
|
+
data.tar.gz: 0b6455ade30dd425765921b2a8bb363babbbced8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76a73377c16a17eaf5bf46a7a329f6dbd25d01a8477eaaa69c6d8147924f5e6ac0a80786114231833946fdab390225c0eb863ae8458769735587b3cc49a7c7f7
|
7
|
+
data.tar.gz: f1d429645f9fe6177575868d3f722b94f5c65747bf4714fe16d027fbad22e9ae85a7f1e17eee32b0964b6021c6074a479011a4c8fd7fab389265d53341d104fb
|
data/Rakefile
CHANGED
data/ext/pango/pango.def
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2017 Ruby-GNOME2 Project Team
|
4
|
+
*
|
5
|
+
* This library is free software; you can redistribute it and/or
|
6
|
+
* modify it under the terms of the GNU Lesser General Public
|
7
|
+
* License as published by the Free Software Foundation; either
|
8
|
+
* version 2.1 of the License, or (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This library is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
* Lesser General Public License for more details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
16
|
+
* License along with this library; if not, write to the Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
+
* MA 02110-1301 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "rb-pango-private.h"
|
22
|
+
|
23
|
+
#define RG_TARGET_NAMESPACE cAttrIterator
|
24
|
+
#define _SELF(self) (RVAL2PANGOATTRITERATOR(self))
|
25
|
+
|
26
|
+
G_DEFINE_BOXED_TYPE(PangoAttrIterator,
|
27
|
+
pango_attr_iterator,
|
28
|
+
pango_attr_iterator_copy,
|
29
|
+
pango_attr_iterator_destroy);
|
30
|
+
|
31
|
+
static VALUE
|
32
|
+
rg_attrs(VALUE self)
|
33
|
+
{
|
34
|
+
GSList *attrs;
|
35
|
+
GSList *node;
|
36
|
+
VALUE rb_attrs;
|
37
|
+
|
38
|
+
attrs = pango_attr_iterator_get_attrs(_SELF(self));
|
39
|
+
rb_attrs = rb_ary_new();
|
40
|
+
for (node = attrs; node; node = g_slist_next(node)) {
|
41
|
+
PangoAttribute *attr = node->data;
|
42
|
+
VALUE rb_attr;
|
43
|
+
|
44
|
+
rb_attr = rbpango_attribute_to_ruby(attr);
|
45
|
+
rb_ary_push(rb_attrs, rb_attr);
|
46
|
+
}
|
47
|
+
g_slist_free(attrs);
|
48
|
+
|
49
|
+
return rb_attrs;
|
50
|
+
}
|
51
|
+
|
52
|
+
void
|
53
|
+
rbpango_attr_iterator_init(VALUE mPango)
|
54
|
+
{
|
55
|
+
VALUE RG_TARGET_NAMESPACE;
|
56
|
+
|
57
|
+
RG_TARGET_NAMESPACE =
|
58
|
+
G_DEF_CLASS(PANGO_TYPE_ATTR_ITERATOR, "AttrIterator", mPango);
|
59
|
+
RG_DEF_METHOD(attrs, 0);
|
60
|
+
}
|
@@ -52,6 +52,15 @@ rg_insert_before(VALUE self, VALUE rb_attribute)
|
|
52
52
|
return self;
|
53
53
|
}
|
54
54
|
|
55
|
+
static VALUE
|
56
|
+
rg_iterator(VALUE self)
|
57
|
+
{
|
58
|
+
PangoAttrIterator *iterator;
|
59
|
+
|
60
|
+
iterator = pango_attr_list_get_iterator(RVAL2PANGOATTRLIST(self));
|
61
|
+
return PANGOATTRITERATOR2RVAL(iterator);
|
62
|
+
}
|
63
|
+
|
55
64
|
void
|
56
65
|
rbpango_attr_list_init(VALUE mPango)
|
57
66
|
{
|
@@ -61,4 +70,5 @@ rbpango_attr_list_init(VALUE mPango)
|
|
61
70
|
|
62
71
|
RG_DEF_METHOD(insert, 1);
|
63
72
|
RG_DEF_METHOD(insert_before, 1);
|
73
|
+
RG_DEF_METHOD(iterator, 0);
|
64
74
|
}
|
@@ -20,12 +20,150 @@
|
|
20
20
|
|
21
21
|
#include "rb-pango-private.h"
|
22
22
|
|
23
|
+
VALUE
|
24
|
+
rbpango_attribute_to_ruby(PangoAttribute *attribute)
|
25
|
+
{
|
26
|
+
VALUE rb_attr_type;
|
27
|
+
ID id_to_class;
|
28
|
+
VALUE klass;
|
29
|
+
|
30
|
+
rb_attr_type = GENUM2RVAL(attribute->klass->type, PANGO_TYPE_ATTR_TYPE);
|
31
|
+
CONST_ID(id_to_class, "to_class");
|
32
|
+
klass = rb_funcall(rb_attr_type, id_to_class, 0);
|
33
|
+
return Data_Wrap_Struct(klass,
|
34
|
+
NULL,
|
35
|
+
pango_attribute_destroy,
|
36
|
+
pango_attribute_copy(attribute));
|
37
|
+
}
|
38
|
+
|
39
|
+
PangoAttribute *
|
40
|
+
rbpango_attribute_from_ruby(VALUE rb_attribute)
|
41
|
+
{
|
42
|
+
PangoAttribute *attribute;
|
43
|
+
|
44
|
+
Data_Get_Struct(rb_attribute, PangoAttribute, attribute);
|
45
|
+
|
46
|
+
return attribute;
|
47
|
+
}
|
48
|
+
|
23
49
|
static VALUE
|
24
50
|
rbpango_attribute_allocate(VALUE klass)
|
25
51
|
{
|
26
52
|
return Data_Wrap_Struct(klass, NULL, pango_attribute_destroy, 0);
|
27
53
|
}
|
28
54
|
|
55
|
+
static VALUE
|
56
|
+
rbpango_attr_bool_get_value(VALUE self)
|
57
|
+
{
|
58
|
+
PangoAttribute *attribute;
|
59
|
+
|
60
|
+
attribute = rbpango_attribute_from_ruby(self);
|
61
|
+
|
62
|
+
return CBOOL2RVAL(((PangoAttrInt *)attribute)->value);
|
63
|
+
}
|
64
|
+
|
65
|
+
static VALUE
|
66
|
+
rbpango_attr_language_initialize(VALUE self, VALUE rb_language)
|
67
|
+
{
|
68
|
+
PangoLanguage *language;
|
69
|
+
|
70
|
+
language = RVAL2PANGOLANGUAGE(rb_language);
|
71
|
+
DATA_PTR(self) = pango_attr_language_new(language);
|
72
|
+
|
73
|
+
return Qnil;
|
74
|
+
}
|
75
|
+
|
76
|
+
static VALUE
|
77
|
+
rbpango_attr_family_initialize(VALUE self, VALUE rb_family)
|
78
|
+
{
|
79
|
+
DATA_PTR(self) = pango_attr_family_new(RVAL2CSTR(rb_family));
|
80
|
+
|
81
|
+
return Qnil;
|
82
|
+
}
|
83
|
+
|
84
|
+
static VALUE
|
85
|
+
rbpango_attr_style_initialize(VALUE self, VALUE rb_style)
|
86
|
+
{
|
87
|
+
DATA_PTR(self) = pango_attr_style_new(RVAL2PANGOSTYLE(rb_style));
|
88
|
+
|
89
|
+
return Qnil;
|
90
|
+
}
|
91
|
+
|
92
|
+
static VALUE
|
93
|
+
rbpango_attr_style_get_value(VALUE self)
|
94
|
+
{
|
95
|
+
PangoAttribute *attribute;
|
96
|
+
|
97
|
+
attribute = rbpango_attribute_from_ruby(self);
|
98
|
+
|
99
|
+
return PANGOSTYLE2RVAL(((PangoAttrInt *)attribute)->value);
|
100
|
+
}
|
101
|
+
|
102
|
+
static VALUE
|
103
|
+
rbpango_attr_weight_initialize(VALUE self, VALUE rb_weight)
|
104
|
+
{
|
105
|
+
DATA_PTR(self) = pango_attr_weight_new(RVAL2PANGOWEIGHT(rb_weight));
|
106
|
+
|
107
|
+
return Qnil;
|
108
|
+
}
|
109
|
+
|
110
|
+
static VALUE
|
111
|
+
rbpango_attr_weight_get_value(VALUE self)
|
112
|
+
{
|
113
|
+
PangoAttribute *attribute;
|
114
|
+
|
115
|
+
attribute = rbpango_attribute_from_ruby(self);
|
116
|
+
|
117
|
+
return PANGOWEIGHT2RVAL(((PangoAttrInt *)attribute)->value);
|
118
|
+
}
|
119
|
+
|
120
|
+
static VALUE
|
121
|
+
rbpango_attr_variant_initialize(VALUE self, VALUE rb_variant)
|
122
|
+
{
|
123
|
+
DATA_PTR(self) = pango_attr_variant_new(RVAL2PANGOVARIANT(rb_variant));
|
124
|
+
|
125
|
+
return Qnil;
|
126
|
+
}
|
127
|
+
|
128
|
+
static VALUE
|
129
|
+
rbpango_attr_variant_get_value(VALUE self)
|
130
|
+
{
|
131
|
+
PangoAttribute *attribute;
|
132
|
+
|
133
|
+
attribute = rbpango_attribute_from_ruby(self);
|
134
|
+
|
135
|
+
return PANGOVARIANT2RVAL(((PangoAttrInt *)attribute)->value);
|
136
|
+
}
|
137
|
+
|
138
|
+
static VALUE
|
139
|
+
rbpango_attr_stretch_initialize(VALUE self, VALUE rb_stretch)
|
140
|
+
{
|
141
|
+
DATA_PTR(self) = pango_attr_stretch_new(RVAL2PANGOSTRETCH(rb_stretch));
|
142
|
+
|
143
|
+
return Qnil;
|
144
|
+
}
|
145
|
+
|
146
|
+
static VALUE
|
147
|
+
rbpango_attr_stretch_get_value(VALUE self)
|
148
|
+
{
|
149
|
+
PangoAttribute *attribute;
|
150
|
+
|
151
|
+
attribute = rbpango_attribute_from_ruby(self);
|
152
|
+
|
153
|
+
return PANGOSTRETCH2RVAL(((PangoAttrInt *)attribute)->value);
|
154
|
+
}
|
155
|
+
|
156
|
+
static VALUE
|
157
|
+
rbpango_attr_size_initialize(VALUE self, VALUE rb_size)
|
158
|
+
{
|
159
|
+
gint size;
|
160
|
+
|
161
|
+
size = NUM2INT(rb_size);
|
162
|
+
DATA_PTR(self) = pango_attr_size_new(size);
|
163
|
+
|
164
|
+
return Qnil;
|
165
|
+
}
|
166
|
+
|
29
167
|
static VALUE
|
30
168
|
rbpango_attr_font_desc_initialize(VALUE self, VALUE rb_font_desc)
|
31
169
|
{
|
@@ -48,20 +186,61 @@ rbpango_attr_font_desc_initialize(VALUE self, VALUE rb_font_desc)
|
|
48
186
|
}
|
49
187
|
|
50
188
|
static VALUE
|
51
|
-
|
189
|
+
rbpango_attr_foregound_initialize(VALUE self,
|
190
|
+
VALUE rb_red,
|
191
|
+
VALUE rb_green,
|
192
|
+
VALUE rb_blue)
|
52
193
|
{
|
53
|
-
DATA_PTR(self) =
|
194
|
+
DATA_PTR(self) = pango_attr_foreground_new(NUM2UINT(rb_red),
|
195
|
+
NUM2UINT(rb_green),
|
196
|
+
NUM2UINT(rb_blue));
|
54
197
|
|
55
198
|
return Qnil;
|
56
199
|
}
|
57
200
|
|
58
201
|
static VALUE
|
59
|
-
|
202
|
+
rbpango_attr_background_initialize(VALUE self,
|
203
|
+
VALUE rb_red,
|
204
|
+
VALUE rb_green,
|
205
|
+
VALUE rb_blue)
|
60
206
|
{
|
61
|
-
|
207
|
+
DATA_PTR(self) = pango_attr_background_new(NUM2UINT(rb_red),
|
208
|
+
NUM2UINT(rb_green),
|
209
|
+
NUM2UINT(rb_blue));
|
62
210
|
|
63
|
-
|
64
|
-
|
211
|
+
return Qnil;
|
212
|
+
}
|
213
|
+
|
214
|
+
static VALUE
|
215
|
+
rbpango_attr_underline_initialize(VALUE self, VALUE rb_underline)
|
216
|
+
{
|
217
|
+
DATA_PTR(self) = pango_attr_underline_new(RVAL2PANGOUNDERLINE(rb_underline));
|
218
|
+
|
219
|
+
return Qnil;
|
220
|
+
}
|
221
|
+
|
222
|
+
static VALUE
|
223
|
+
rbpango_attr_underline_get_value(VALUE self)
|
224
|
+
{
|
225
|
+
PangoAttribute *attribute;
|
226
|
+
|
227
|
+
attribute = rbpango_attribute_from_ruby(self);
|
228
|
+
|
229
|
+
return PANGOUNDERLINE2RVAL(((PangoAttrInt *)attribute)->value);
|
230
|
+
}
|
231
|
+
|
232
|
+
static VALUE
|
233
|
+
rbpango_attr_strikethrough_initialize(VALUE self, VALUE rb_strikethrough)
|
234
|
+
{
|
235
|
+
DATA_PTR(self) = pango_attr_strikethrough_new(RVAL2CBOOL(rb_strikethrough));
|
236
|
+
|
237
|
+
return Qnil;
|
238
|
+
}
|
239
|
+
|
240
|
+
static VALUE
|
241
|
+
rbpango_attr_rise_initialize(VALUE self, VALUE rb_rise)
|
242
|
+
{
|
243
|
+
DATA_PTR(self) = pango_attr_rise_new(NUM2INT(rb_rise));
|
65
244
|
|
66
245
|
return Qnil;
|
67
246
|
}
|
@@ -102,17 +281,126 @@ rbpango_attr_shape_get_data(VALUE self)
|
|
102
281
|
|
103
282
|
Data_Get_Struct(self, PangoAttrShape, attr_shape);
|
104
283
|
rb_data = (VALUE)(attr_shape->data);
|
105
|
-
rb_p(rb_data);
|
106
284
|
return rb_data;
|
107
285
|
}
|
108
286
|
|
109
287
|
static VALUE
|
110
|
-
|
288
|
+
rbpango_attr_scale_initialize(VALUE self, VALUE rb_scale)
|
111
289
|
{
|
112
|
-
|
290
|
+
DATA_PTR(self) = pango_attr_scale_new(NUM2DBL(rb_scale));
|
113
291
|
|
114
|
-
|
115
|
-
|
292
|
+
return Qnil;
|
293
|
+
}
|
294
|
+
|
295
|
+
static VALUE
|
296
|
+
rbpango_attr_fallback_initialize(VALUE self, VALUE rb_enable_fallback)
|
297
|
+
{
|
298
|
+
DATA_PTR(self) = pango_attr_fallback_new(RVAL2CBOOL(rb_enable_fallback));
|
299
|
+
|
300
|
+
return Qnil;
|
301
|
+
}
|
302
|
+
|
303
|
+
static VALUE
|
304
|
+
rbpango_attr_letter_spacing_initialize(VALUE self, VALUE rb_letter_spacing)
|
305
|
+
{
|
306
|
+
DATA_PTR(self) = pango_attr_letter_spacing_new(NUM2INT(rb_letter_spacing));
|
307
|
+
|
308
|
+
return Qnil;
|
309
|
+
}
|
310
|
+
|
311
|
+
static VALUE
|
312
|
+
rbpango_attr_underline_color_initialize(VALUE self,
|
313
|
+
VALUE rb_red,
|
314
|
+
VALUE rb_green,
|
315
|
+
VALUE rb_blue)
|
316
|
+
{
|
317
|
+
DATA_PTR(self) = pango_attr_underline_color_new(NUM2UINT(rb_red),
|
318
|
+
NUM2UINT(rb_green),
|
319
|
+
NUM2UINT(rb_blue));
|
320
|
+
|
321
|
+
return Qnil;
|
322
|
+
}
|
323
|
+
|
324
|
+
static VALUE
|
325
|
+
rbpango_attr_strikethrough_color_initialize(VALUE self,
|
326
|
+
VALUE rb_red,
|
327
|
+
VALUE rb_green,
|
328
|
+
VALUE rb_blue)
|
329
|
+
{
|
330
|
+
DATA_PTR(self) = pango_attr_strikethrough_color_new(NUM2UINT(rb_red),
|
331
|
+
NUM2UINT(rb_green),
|
332
|
+
NUM2UINT(rb_blue));
|
333
|
+
|
334
|
+
return Qnil;
|
335
|
+
}
|
336
|
+
|
337
|
+
static VALUE
|
338
|
+
rbpango_attr_absolute_size_initialize(VALUE self, VALUE rb_absolute_size)
|
339
|
+
{
|
340
|
+
DATA_PTR(self) = pango_attr_size_new_absolute(NUM2INT(rb_absolute_size));
|
341
|
+
|
342
|
+
return Qnil;
|
343
|
+
}
|
344
|
+
|
345
|
+
static VALUE
|
346
|
+
rbpango_attr_gravity_initialize(VALUE self, VALUE rb_gravity)
|
347
|
+
{
|
348
|
+
DATA_PTR(self) = pango_attr_gravity_new(RVAL2PANGOGRAVITY(rb_gravity));
|
349
|
+
|
350
|
+
return Qnil;
|
351
|
+
}
|
352
|
+
|
353
|
+
static VALUE
|
354
|
+
rbpango_attr_gravity_get_value(VALUE self)
|
355
|
+
{
|
356
|
+
PangoAttribute *attribute;
|
357
|
+
|
358
|
+
attribute = rbpango_attribute_from_ruby(self);
|
359
|
+
|
360
|
+
return PANGOGRAVITY2RVAL(((PangoAttrInt *)attribute)->value);
|
361
|
+
}
|
362
|
+
|
363
|
+
static VALUE
|
364
|
+
rbpango_attr_gravity_hint_initialize(VALUE self, VALUE rb_gravity_hint)
|
365
|
+
{
|
366
|
+
PangoGravityHint hint;
|
367
|
+
|
368
|
+
hint = RVAL2PANGOGRAVITYHINT(rb_gravity_hint);
|
369
|
+
DATA_PTR(self) = pango_attr_gravity_hint_new(hint);
|
370
|
+
|
371
|
+
return Qnil;
|
372
|
+
}
|
373
|
+
|
374
|
+
static VALUE
|
375
|
+
rbpango_attr_gravity_hint_get_value(VALUE self)
|
376
|
+
{
|
377
|
+
PangoAttribute *attribute;
|
378
|
+
|
379
|
+
attribute = rbpango_attribute_from_ruby(self);
|
380
|
+
|
381
|
+
return PANGOGRAVITYHINT2RVAL(((PangoAttrInt *)attribute)->value);
|
382
|
+
}
|
383
|
+
|
384
|
+
static VALUE
|
385
|
+
rbpango_attr_font_features_initialize(VALUE self, VALUE rb_font_features)
|
386
|
+
{
|
387
|
+
DATA_PTR(self) = pango_attr_font_features_new(RVAL2CSTR(rb_font_features));
|
388
|
+
|
389
|
+
return Qnil;
|
390
|
+
}
|
391
|
+
|
392
|
+
static VALUE
|
393
|
+
rbpango_attr_foreground_alpha_initialize(VALUE self, VALUE rb_alpha)
|
394
|
+
{
|
395
|
+
DATA_PTR(self) = pango_attr_foreground_alpha_new(NUM2UINT(rb_alpha));
|
396
|
+
|
397
|
+
return Qnil;
|
398
|
+
}
|
399
|
+
|
400
|
+
static VALUE
|
401
|
+
rbpango_attr_background_alpha_initialize(VALUE self, VALUE rb_alpha)
|
402
|
+
{
|
403
|
+
DATA_PTR(self) = pango_attr_background_alpha_new(NUM2UINT(rb_alpha));
|
116
404
|
|
117
405
|
return Qnil;
|
118
406
|
}
|
@@ -121,45 +409,136 @@ void
|
|
121
409
|
rbpango_attribute_init(VALUE mPango)
|
122
410
|
{
|
123
411
|
VALUE cAttribute;
|
412
|
+
VALUE cAttrString;
|
413
|
+
VALUE cAttrColor;
|
414
|
+
VALUE cAttrInt;
|
415
|
+
VALUE cAttrBool;
|
416
|
+
VALUE cAttrFloat;
|
417
|
+
VALUE cAttrLanguage;
|
418
|
+
VALUE cAttrFamily;
|
419
|
+
VALUE cAttrStyle;
|
420
|
+
VALUE cAttrWeight;
|
421
|
+
VALUE cAttrVariant;
|
422
|
+
VALUE cAttrStretch;
|
423
|
+
VALUE cAttrSize;
|
424
|
+
VALUE cAttrFontDesc;
|
425
|
+
VALUE cAttrForeground;
|
426
|
+
VALUE cAttrBackground;
|
427
|
+
VALUE cAttrUnderline;
|
428
|
+
VALUE cAttrStrikethrough;
|
429
|
+
VALUE cAttrRise;
|
430
|
+
VALUE cAttrShape;
|
431
|
+
VALUE cAttrScale;
|
432
|
+
VALUE cAttrFallback;
|
433
|
+
VALUE cAttrLetterSpacing;
|
434
|
+
VALUE cAttrUnderlineColor;
|
435
|
+
VALUE cAttrStrikethroughColor;
|
436
|
+
VALUE cAttrAbsoluteSize;
|
437
|
+
VALUE cAttrGravity;
|
438
|
+
VALUE cAttrGravityHint;
|
439
|
+
VALUE cAttrFontFeatures;
|
440
|
+
VALUE cAttrForegroundAlpha;
|
441
|
+
VALUE cAttrBackgroundAlpha;
|
124
442
|
|
125
443
|
cAttribute = rb_define_class_under(mPango, "Attribute", rb_cData);
|
126
444
|
rb_define_alloc_func(cAttribute, rbpango_attribute_allocate);
|
127
445
|
|
128
|
-
#define
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
446
|
+
#define DEFINE_ABSTRACT_ATTRIBUTE_BEGIN(ClassName, parent) do { \
|
447
|
+
c ## ClassName = rb_define_class_under(mPango, \
|
448
|
+
#ClassName, \
|
449
|
+
parent);
|
450
|
+
|
451
|
+
#define DEFINE_ABSTRACT_ATTRIBUTE_END() \
|
133
452
|
} while (FALSE)
|
134
453
|
|
135
|
-
#define
|
136
|
-
|
454
|
+
#define DEFINE_ABSTRACT_ATTRIBUTE(ClassName, parent) \
|
455
|
+
DEFINE_ABSTRACT_ATTRIBUTE_BEGIN(ClassName, parent) { \
|
456
|
+
} DEFINE_ABSTRACT_ATTRIBUTE_END()
|
457
|
+
|
458
|
+
#define DEFINE_ATTRIBUTE_BEGIN(ClassName, \
|
459
|
+
parent, \
|
460
|
+
method_name, \
|
461
|
+
n_initialize_args) do { \
|
137
462
|
c ## ClassName = rb_define_class_under(mPango, \
|
138
463
|
#ClassName, \
|
139
|
-
|
464
|
+
parent); \
|
140
465
|
rb_define_method(c ## ClassName, "initialize", \
|
141
466
|
rbpango_ ## method_name ## _initialize, \
|
142
467
|
n_initialize_args); \
|
143
468
|
|
144
|
-
#define DEFINE_ATTRIBUTE_END
|
469
|
+
#define DEFINE_ATTRIBUTE_END() \
|
470
|
+
} while (FALSE)
|
471
|
+
|
472
|
+
#define DEFINE_ATTRIBUTE(ClassName, \
|
473
|
+
parent, \
|
474
|
+
method_name, \
|
475
|
+
n_initialize_args) \
|
476
|
+
DEFINE_ATTRIBUTE_BEGIN(ClassName, \
|
477
|
+
parent, \
|
478
|
+
method_name, \
|
479
|
+
n_initialize_args) { \
|
480
|
+
} DEFINE_ATTRIBUTE_END();
|
145
481
|
|
146
|
-
|
147
|
-
|
148
|
-
|
482
|
+
DEFINE_ABSTRACT_ATTRIBUTE(AttrString, cAttribute);
|
483
|
+
DEFINE_ABSTRACT_ATTRIBUTE(AttrColor, cAttribute);
|
484
|
+
DEFINE_ABSTRACT_ATTRIBUTE(AttrInt, cAttribute);
|
485
|
+
DEFINE_ABSTRACT_ATTRIBUTE_BEGIN(AttrBool, cAttrInt) {
|
486
|
+
rb_define_method(cAttrBool, "value", rbpango_attr_bool_get_value, 0);
|
487
|
+
} DEFINE_ABSTRACT_ATTRIBUTE_END();
|
488
|
+
DEFINE_ABSTRACT_ATTRIBUTE(AttrFloat, cAttribute);
|
149
489
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
490
|
+
DEFINE_ATTRIBUTE(AttrLanguage, cAttribute, attr_language, 1);
|
491
|
+
DEFINE_ATTRIBUTE(AttrFamily, cAttrString, attr_family, 1);
|
492
|
+
DEFINE_ATTRIBUTE_BEGIN(AttrStyle, cAttrInt, attr_style, 1) {
|
493
|
+
rb_define_method(cAttrStyle, "value", rbpango_attr_style_get_value, 0);
|
494
|
+
} DEFINE_ATTRIBUTE_END();
|
495
|
+
DEFINE_ATTRIBUTE_BEGIN(AttrWeight, cAttrInt, attr_weight, 1) {
|
496
|
+
rb_define_method(cAttrWeight, "value", rbpango_attr_weight_get_value, 0);
|
497
|
+
} DEFINE_ATTRIBUTE_END();
|
498
|
+
DEFINE_ATTRIBUTE_BEGIN(AttrVariant, cAttrInt, attr_variant, 1) {
|
499
|
+
rb_define_method(cAttrVariant,
|
500
|
+
"value", rbpango_attr_variant_get_value, 0);
|
501
|
+
} DEFINE_ATTRIBUTE_END();
|
502
|
+
DEFINE_ATTRIBUTE_BEGIN(AttrStretch, cAttrInt, attr_stretch, 1) {
|
503
|
+
rb_define_method(cAttrStretch,
|
504
|
+
"value", rbpango_attr_stretch_get_value, 0);
|
505
|
+
} DEFINE_ATTRIBUTE_END();
|
506
|
+
DEFINE_ATTRIBUTE(AttrSize, cAttribute, attr_size, 1);
|
507
|
+
DEFINE_ATTRIBUTE(AttrFontDesc, cAttribute, attr_font_desc, 1);
|
508
|
+
DEFINE_ATTRIBUTE(AttrForeground, cAttrColor, attr_foregound, 3);
|
509
|
+
DEFINE_ATTRIBUTE(AttrBackground, cAttrColor, attr_background, 3);
|
510
|
+
DEFINE_ATTRIBUTE_BEGIN(AttrUnderline, cAttrInt, attr_underline, 1) {
|
511
|
+
rb_define_method(cAttrUnderline,
|
512
|
+
"value", rbpango_attr_underline_get_value, 0);
|
513
|
+
} DEFINE_ATTRIBUTE_END();
|
514
|
+
DEFINE_ATTRIBUTE(AttrStrikethrough, cAttrBool, attr_strikethrough, 1);
|
515
|
+
DEFINE_ATTRIBUTE(AttrRise, cAttrInt, attr_rise, 1);
|
516
|
+
DEFINE_ATTRIBUTE_BEGIN(AttrShape, cAttribute, attr_shape, -1) {
|
158
517
|
rb_define_method(cAttrShape, "data", rbpango_attr_shape_get_data, 0);
|
159
|
-
} DEFINE_ATTRIBUTE_END;
|
160
|
-
DEFINE_ATTRIBUTE(
|
161
|
-
|
518
|
+
} DEFINE_ATTRIBUTE_END();
|
519
|
+
DEFINE_ATTRIBUTE(AttrScale, cAttrFloat, attr_scale, 1);
|
520
|
+
DEFINE_ATTRIBUTE(AttrFallback, cAttrBool, attr_fallback, 1);
|
521
|
+
DEFINE_ATTRIBUTE(AttrLetterSpacing, cAttrInt, attr_letter_spacing, 1);
|
522
|
+
DEFINE_ATTRIBUTE(AttrUnderlineColor, cAttrColor, attr_underline_color, 3);
|
523
|
+
DEFINE_ATTRIBUTE(AttrStrikethroughColor, cAttrColor,
|
524
|
+
attr_strikethrough_color, 3);
|
525
|
+
DEFINE_ATTRIBUTE(AttrAbsoluteSize, cAttrSize, attr_absolute_size, 1);
|
526
|
+
DEFINE_ATTRIBUTE_BEGIN(AttrGravity, cAttrInt, attr_gravity, 1) {
|
527
|
+
rb_define_method(cAttrGravity,
|
528
|
+
"value", rbpango_attr_gravity_get_value, 0);
|
529
|
+
} DEFINE_ATTRIBUTE_END();
|
530
|
+
DEFINE_ATTRIBUTE_BEGIN(AttrGravityHint, cAttrInt, attr_gravity_hint, 1) {
|
531
|
+
rb_define_method(cAttrGravityHint,
|
532
|
+
"value", rbpango_attr_gravity_hint_get_value, 0);
|
533
|
+
} DEFINE_ATTRIBUTE_END();
|
534
|
+
DEFINE_ATTRIBUTE(AttrFontFeatures, cAttrString, attr_font_features, 1);
|
535
|
+
DEFINE_ATTRIBUTE(AttrForegroundAlpha, cAttrInt, attr_foreground_alpha, 1);
|
536
|
+
DEFINE_ATTRIBUTE(AttrBackgroundAlpha, cAttrInt, attr_background_alpha, 1);
|
162
537
|
|
163
538
|
#undef DEFINE_ABSTRACT_ATTRIBUTE
|
539
|
+
#undef DEFINE_ABSTRACT_ATTRIBUTE_BEGIN
|
540
|
+
#undef DEFINE_ABSTRACT_ATTRIBUTE_END
|
164
541
|
#undef DEFINE_ATTRIBUTE
|
542
|
+
#undef DEFINE_ATTRIBUTE_BEGIN
|
543
|
+
#undef DEFINE_ATTRIBUTE_END
|
165
544
|
}
|