gobject-introspection 3.0.9-x64-mingw32 → 3.1.0-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 +2 -2
- data/ext/gobject-introspection/rb-gi-argument.c +205 -47
- data/ext/gobject-introspection/rb-gi-constructor-info.c +9 -15
- data/ext/gobject-introspection/rb-gi-function-info.c +147 -46
- data/ext/gobject-introspection/rb-gi-method-info.c +5 -3
- data/ext/gobject-introspection/rb-gi-private.h +3 -1
- data/lib/2.2/gobject_introspection.so +0 -0
- data/lib/2.3/gobject_introspection.so +0 -0
- data/lib/gi.rb +19 -0
- data/lib/gobject-introspection.rb +10 -0
- data/lib/gobject-introspection/callable-info.rb +19 -5
- data/lib/gobject-introspection/loader.rb +113 -82
- data/vendor/local/bin/g-ir-compiler.exe +0 -0
- data/vendor/local/bin/g-ir-generate.exe +0 -0
- data/vendor/local/bin/g-ir-inspect.exe +0 -0
- data/vendor/local/bin/libgirepository-1.0-1.dll +0 -0
- data/vendor/local/lib/girepository-1.0/GIRepository-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/GLib-2.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/Gio-2.0.typelib +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/annotationparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.py +2 -1
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ast.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/cachestore.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/codegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/__init__.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/counter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/collections/ordereddict.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docmain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/docwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/dumper.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/gdumpparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/girwriter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/introspectablepass.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/libtoolimporter.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/maintransformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/message.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/msvccompiler.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/msvccompiler.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/shlibs.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/sourcescanner.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/testcodegen.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/transformer.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/utils.pyo +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyc +0 -0
- data/vendor/local/lib/gobject-introspection/giscanner/xmlwriter.pyo +0 -0
- data/vendor/local/lib/libgirepository-1.0.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.dll.a +0 -0
- data/vendor/local/lib/libgirepository-1.0.la +2 -2
- data/vendor/local/lib/pkgconfig/gobject-introspection-1.0.pc +1 -1
- data/vendor/local/lib/pkgconfig/gobject-introspection-no-export-1.0.pc +1 -1
- data/vendor/local/share/gir-1.0/GIRepository-2.0.gir +10 -4
- data/vendor/local/share/gir-1.0/GLib-2.0.gir +939 -162
- data/vendor/local/share/gir-1.0/GObject-2.0.gir +389 -565
- data/vendor/local/share/gir-1.0/Gio-2.0.gir +594 -173
- data/vendor/local/share/gobject-introspection-1.0/gdump.c +8 -1
- data/vendor/local/share/gobject-introspection-1.0/tests/regress.h +13 -0
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ee5d78c0de22a2e01e57020eec6c61dd66d9b95
|
4
|
+
data.tar.gz: 1440200d25f98954ac84f066c83dd3303532ea2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a251544fd4f6839535dd4f7bc80b2d480d3bc7732f83c13f7934ee66798f1b0cc988338e2706812ec5f65bc5089185f253c22d2d4ad4f2dda52c3a5271fd9c52
|
7
|
+
data.tar.gz: a3b1cad486eb121c8802b2721b0b75f06c58c5dcb8938f79d7d267deadc975a42372932fc65c736c5c7e6521cd7ea92a9b6d04aeb81520de1ba226de6efb01bd
|
data/Rakefile
CHANGED
@@ -32,7 +32,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
|
|
32
32
|
:name => "glib",
|
33
33
|
:download_site => :gnome,
|
34
34
|
:label => "GLib",
|
35
|
-
:version => "2.
|
35
|
+
:version => "2.50.2",
|
36
36
|
:compression_method => "xz",
|
37
37
|
:windows => {
|
38
38
|
:build => false,
|
@@ -47,7 +47,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
|
|
47
47
|
:name => "gobject-introspection",
|
48
48
|
:download_site => :gnome,
|
49
49
|
:label => "gobject-introspection",
|
50
|
-
:version => "1.
|
50
|
+
:version => "1.50.0",
|
51
51
|
:compression_method => "xz",
|
52
52
|
:windows => {
|
53
53
|
:configure_args => [
|
@@ -537,27 +537,6 @@ rb_gi_array_argument_to_ruby(GIArgument *array_argument,
|
|
537
537
|
return rb_array;
|
538
538
|
}
|
539
539
|
|
540
|
-
static VALUE
|
541
|
-
interface_variant_to_ruby(GVariant *variant)
|
542
|
-
{
|
543
|
-
VALUE rb_value = Qnil;
|
544
|
-
const GVariantType *type;
|
545
|
-
|
546
|
-
type = g_variant_get_type(variant);
|
547
|
-
if (g_variant_type_equal(type, G_VARIANT_TYPE_STRING)) {
|
548
|
-
const char *value;
|
549
|
-
g_variant_get(variant, "s", &value);
|
550
|
-
rb_value = CSTR2RVAL(value);
|
551
|
-
} else {
|
552
|
-
rb_raise(rb_eNotImpError,
|
553
|
-
"TODO: GIArgument(interface)[GVariant][%.*s] -> Ruby",
|
554
|
-
(int)g_variant_type_get_string_length(type),
|
555
|
-
g_variant_type_peek_string(type));
|
556
|
-
}
|
557
|
-
|
558
|
-
return rb_value;
|
559
|
-
}
|
560
|
-
|
561
540
|
static VALUE
|
562
541
|
rb_gi_argument_to_ruby_interface(GIArgument *argument,
|
563
542
|
gboolean duplicate,
|
@@ -599,7 +578,7 @@ rb_gi_argument_to_ruby_interface(GIArgument *argument,
|
|
599
578
|
rb_interface = rb_enc_str_new(data, size, rb_ascii8bit_encoding());
|
600
579
|
} else if (gtype == G_TYPE_VARIANT) {
|
601
580
|
GVariant *variant = argument->v_pointer;
|
602
|
-
rb_interface =
|
581
|
+
rb_interface = rbg_variant_to_ruby(variant);
|
603
582
|
} else {
|
604
583
|
rb_interface = BOXED2RVAL(argument->v_pointer, gtype);
|
605
584
|
}
|
@@ -1214,6 +1193,58 @@ rb_gi_argument_to_ruby(GIArgument *argument,
|
|
1214
1193
|
return rb_argument;
|
1215
1194
|
}
|
1216
1195
|
|
1196
|
+
static void
|
1197
|
+
rb_gi_out_argument_init_array_c(GIArgument *argument,
|
1198
|
+
G_GNUC_UNUSED GIArgInfo *arg_info,
|
1199
|
+
G_GNUC_UNUSED GITypeInfo *array_type_info,
|
1200
|
+
GITypeInfo *element_type_info)
|
1201
|
+
{
|
1202
|
+
GITypeTag element_type_tag;
|
1203
|
+
|
1204
|
+
element_type_tag = g_type_info_get_tag(element_type_info);
|
1205
|
+
|
1206
|
+
switch (element_type_tag) {
|
1207
|
+
case GI_TYPE_TAG_VOID:
|
1208
|
+
case GI_TYPE_TAG_BOOLEAN:
|
1209
|
+
case GI_TYPE_TAG_INT8:
|
1210
|
+
case GI_TYPE_TAG_UINT8:
|
1211
|
+
case GI_TYPE_TAG_INT16:
|
1212
|
+
case GI_TYPE_TAG_UINT16:
|
1213
|
+
case GI_TYPE_TAG_INT32:
|
1214
|
+
case GI_TYPE_TAG_UINT32:
|
1215
|
+
case GI_TYPE_TAG_INT64:
|
1216
|
+
case GI_TYPE_TAG_UINT64:
|
1217
|
+
case GI_TYPE_TAG_FLOAT:
|
1218
|
+
case GI_TYPE_TAG_DOUBLE:
|
1219
|
+
case GI_TYPE_TAG_GTYPE:
|
1220
|
+
g_base_info_unref(element_type_info);
|
1221
|
+
rb_raise(rb_eNotImpError,
|
1222
|
+
"TODO: allocates GIArgument(array)[c][%s] for output",
|
1223
|
+
g_type_tag_to_string(element_type_tag));
|
1224
|
+
break;
|
1225
|
+
case GI_TYPE_TAG_UTF8:
|
1226
|
+
argument->v_pointer = xmalloc(sizeof(gchar **));
|
1227
|
+
break;
|
1228
|
+
case GI_TYPE_TAG_FILENAME:
|
1229
|
+
case GI_TYPE_TAG_ARRAY:
|
1230
|
+
case GI_TYPE_TAG_INTERFACE:
|
1231
|
+
case GI_TYPE_TAG_GLIST:
|
1232
|
+
case GI_TYPE_TAG_GSLIST:
|
1233
|
+
case GI_TYPE_TAG_GHASH:
|
1234
|
+
case GI_TYPE_TAG_ERROR:
|
1235
|
+
case GI_TYPE_TAG_UNICHAR:
|
1236
|
+
g_base_info_unref(element_type_info);
|
1237
|
+
rb_raise(rb_eNotImpError,
|
1238
|
+
"TODO: allocates GIArgument(array)[c][%s] for output",
|
1239
|
+
g_type_tag_to_string(element_type_tag));
|
1240
|
+
break;
|
1241
|
+
default:
|
1242
|
+
g_base_info_unref(element_type_info);
|
1243
|
+
g_assert_not_reached();
|
1244
|
+
break;
|
1245
|
+
}
|
1246
|
+
}
|
1247
|
+
|
1217
1248
|
static void
|
1218
1249
|
rb_gi_out_argument_init_array_array_interface(GIArgument *argument,
|
1219
1250
|
G_GNUC_UNUSED GIArgInfo *arg_info,
|
@@ -1348,16 +1379,18 @@ rb_gi_out_argument_init_array(GIArgument *argument, GIArgInfo *arg_info,
|
|
1348
1379
|
{
|
1349
1380
|
GIArrayType array_type;
|
1350
1381
|
GITypeInfo *element_type_info;
|
1382
|
+
GITypeTag element_type_tag;
|
1351
1383
|
|
1352
1384
|
array_type = g_type_info_get_array_type(array_type_info);
|
1353
1385
|
element_type_info = g_type_info_get_param_type(array_type_info, 0);
|
1386
|
+
element_type_tag = g_type_info_get_tag(element_type_info);
|
1354
1387
|
|
1355
1388
|
switch (array_type) {
|
1356
1389
|
case GI_ARRAY_TYPE_C:
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1390
|
+
rb_gi_out_argument_init_array_c(argument,
|
1391
|
+
arg_info,
|
1392
|
+
array_type_info,
|
1393
|
+
element_type_info);
|
1361
1394
|
break;
|
1362
1395
|
case GI_ARRAY_TYPE_ARRAY:
|
1363
1396
|
rb_gi_out_argument_init_array_array(argument,
|
@@ -1369,13 +1402,13 @@ rb_gi_out_argument_init_array(GIArgument *argument, GIArgInfo *arg_info,
|
|
1369
1402
|
g_base_info_unref(element_type_info);
|
1370
1403
|
rb_raise(rb_eNotImpError,
|
1371
1404
|
"TODO: allocates GIArgument(array)[ptr-array][%s] for output",
|
1372
|
-
g_type_tag_to_string(
|
1405
|
+
g_type_tag_to_string(element_type_tag));
|
1373
1406
|
break;
|
1374
1407
|
case GI_ARRAY_TYPE_BYTE_ARRAY:
|
1375
1408
|
g_base_info_unref(element_type_info);
|
1376
1409
|
rb_raise(rb_eNotImpError,
|
1377
1410
|
"TODO: allocates GIArgument(array)[byte-array][%s] for output",
|
1378
|
-
g_type_tag_to_string(
|
1411
|
+
g_type_tag_to_string(element_type_tag));
|
1379
1412
|
break;
|
1380
1413
|
default:
|
1381
1414
|
g_base_info_unref(element_type_info);
|
@@ -1709,35 +1742,101 @@ rb_gi_out_argument_to_ruby(GIArgument *argument,
|
|
1709
1742
|
args_metadata);
|
1710
1743
|
}
|
1711
1744
|
|
1745
|
+
|
1746
|
+
static void
|
1747
|
+
rb_gi_out_argument_fin_array_c(GIArgument *argument,
|
1748
|
+
G_GNUC_UNUSED GIArgInfo *arg_info,
|
1749
|
+
G_GNUC_UNUSED GITypeInfo *array_type_info,
|
1750
|
+
GITypeInfo *element_type_info)
|
1751
|
+
{
|
1752
|
+
GITypeTag element_type_tag;
|
1753
|
+
|
1754
|
+
element_type_tag = g_type_info_get_tag(element_type_info);
|
1755
|
+
|
1756
|
+
switch (element_type_tag) {
|
1757
|
+
case GI_TYPE_TAG_VOID:
|
1758
|
+
case GI_TYPE_TAG_BOOLEAN:
|
1759
|
+
case GI_TYPE_TAG_INT8:
|
1760
|
+
case GI_TYPE_TAG_UINT8:
|
1761
|
+
case GI_TYPE_TAG_INT16:
|
1762
|
+
case GI_TYPE_TAG_UINT16:
|
1763
|
+
case GI_TYPE_TAG_INT32:
|
1764
|
+
case GI_TYPE_TAG_UINT32:
|
1765
|
+
case GI_TYPE_TAG_INT64:
|
1766
|
+
case GI_TYPE_TAG_UINT64:
|
1767
|
+
case GI_TYPE_TAG_FLOAT:
|
1768
|
+
case GI_TYPE_TAG_DOUBLE:
|
1769
|
+
case GI_TYPE_TAG_GTYPE:
|
1770
|
+
g_base_info_unref(element_type_info);
|
1771
|
+
rb_raise(rb_eNotImpError,
|
1772
|
+
"TODO: free out GIArgument(array)[c][%s]",
|
1773
|
+
g_type_tag_to_string(element_type_tag));
|
1774
|
+
break;
|
1775
|
+
case GI_TYPE_TAG_UTF8:
|
1776
|
+
xfree(argument->v_pointer);
|
1777
|
+
break;
|
1778
|
+
case GI_TYPE_TAG_FILENAME:
|
1779
|
+
case GI_TYPE_TAG_ARRAY:
|
1780
|
+
case GI_TYPE_TAG_INTERFACE:
|
1781
|
+
case GI_TYPE_TAG_GLIST:
|
1782
|
+
case GI_TYPE_TAG_GSLIST:
|
1783
|
+
case GI_TYPE_TAG_GHASH:
|
1784
|
+
case GI_TYPE_TAG_ERROR:
|
1785
|
+
case GI_TYPE_TAG_UNICHAR:
|
1786
|
+
g_base_info_unref(element_type_info);
|
1787
|
+
rb_raise(rb_eNotImpError,
|
1788
|
+
"TODO: free out GIArgument(array)[c][%s]",
|
1789
|
+
g_type_tag_to_string(element_type_tag));
|
1790
|
+
break;
|
1791
|
+
default:
|
1792
|
+
g_base_info_unref(element_type_info);
|
1793
|
+
g_assert_not_reached();
|
1794
|
+
break;
|
1795
|
+
}
|
1796
|
+
}
|
1797
|
+
|
1712
1798
|
static void
|
1713
1799
|
rb_gi_out_argument_fin_array(GIArgument *argument,
|
1714
|
-
|
1800
|
+
GIArgInfo *arg_info,
|
1715
1801
|
GITypeInfo *array_type_info)
|
1716
1802
|
{
|
1717
1803
|
GIArrayType array_type;
|
1804
|
+
GITypeInfo *element_type_info;
|
1805
|
+
GITypeTag element_type_tag;
|
1718
1806
|
|
1719
1807
|
array_type = g_type_info_get_array_type(array_type_info);
|
1808
|
+
element_type_info = g_type_info_get_param_type(array_type_info, 0);
|
1809
|
+
element_type_tag = g_type_info_get_tag(element_type_info);
|
1720
1810
|
|
1721
1811
|
switch (array_type) {
|
1722
1812
|
case GI_ARRAY_TYPE_C:
|
1723
|
-
|
1724
|
-
|
1813
|
+
rb_gi_out_argument_fin_array_c(argument,
|
1814
|
+
arg_info,
|
1815
|
+
array_type_info,
|
1816
|
+
element_type_info);
|
1725
1817
|
break;
|
1726
1818
|
case GI_ARRAY_TYPE_ARRAY:
|
1727
1819
|
g_array_free(argument->v_pointer, TRUE);
|
1728
1820
|
break;
|
1729
1821
|
case GI_ARRAY_TYPE_PTR_ARRAY:
|
1822
|
+
g_base_info_unref(element_type_info);
|
1730
1823
|
rb_raise(rb_eNotImpError,
|
1731
|
-
"TODO: free out GIArgument(array)[ptr-array]"
|
1824
|
+
"TODO: free out GIArgument(array)[ptr-array][%s]",
|
1825
|
+
g_type_tag_to_string(element_type_tag));
|
1732
1826
|
break;
|
1733
1827
|
case GI_ARRAY_TYPE_BYTE_ARRAY:
|
1828
|
+
g_base_info_unref(element_type_info);
|
1734
1829
|
rb_raise(rb_eNotImpError,
|
1735
|
-
"TODO: free out GIArgument(array)[byte-array]"
|
1830
|
+
"TODO: free out GIArgument(array)[byte-array][%s]",
|
1831
|
+
g_type_tag_to_string(element_type_tag));
|
1736
1832
|
break;
|
1737
1833
|
default:
|
1834
|
+
g_base_info_unref(element_type_info);
|
1738
1835
|
g_assert_not_reached();
|
1739
1836
|
break;
|
1740
1837
|
}
|
1838
|
+
|
1839
|
+
g_base_info_unref(element_type_info);
|
1741
1840
|
}
|
1742
1841
|
|
1743
1842
|
void
|
@@ -2265,6 +2364,7 @@ rb_gi_return_argument_free_everything(GIArgument *argument,
|
|
2265
2364
|
type_tag = g_type_info_get_tag(type_info);
|
2266
2365
|
switch (type_tag) {
|
2267
2366
|
case GI_TYPE_TAG_VOID:
|
2367
|
+
break;
|
2268
2368
|
case GI_TYPE_TAG_BOOLEAN:
|
2269
2369
|
case GI_TYPE_TAG_INT8:
|
2270
2370
|
case GI_TYPE_TAG_UINT8:
|
@@ -2633,16 +2733,16 @@ rb_gi_value_argument_from_ruby(GIArgument *argument, GITypeInfo *type_info,
|
|
2633
2733
|
argument->v_boolean = RVAL2CBOOL(rb_argument);
|
2634
2734
|
break;
|
2635
2735
|
case GI_TYPE_TAG_INT8:
|
2636
|
-
argument->v_int8 =
|
2736
|
+
argument->v_int8 = NUM2CHR(rb_argument);
|
2637
2737
|
break;
|
2638
2738
|
case GI_TYPE_TAG_UINT8:
|
2639
|
-
argument->v_uint8 =
|
2739
|
+
argument->v_uint8 = (guint8)NUM2CHR(rb_argument);
|
2640
2740
|
break;
|
2641
2741
|
case GI_TYPE_TAG_INT16:
|
2642
|
-
argument->v_int16 =
|
2742
|
+
argument->v_int16 = NUM2SHORT(rb_argument);
|
2643
2743
|
break;
|
2644
2744
|
case GI_TYPE_TAG_UINT16:
|
2645
|
-
argument->v_uint16 =
|
2745
|
+
argument->v_uint16 = NUM2USHORT(rb_argument);
|
2646
2746
|
break;
|
2647
2747
|
case GI_TYPE_TAG_INT32:
|
2648
2748
|
argument->v_int32 = NUM2INT(rb_argument);
|
@@ -3005,6 +3105,38 @@ set_in_array_length_argument(GIArgument *argument,
|
|
3005
3105
|
}
|
3006
3106
|
}
|
3007
3107
|
|
3108
|
+
static void
|
3109
|
+
set_in_array_int8_arguments_from_ruby(GIArgument *array_argument,
|
3110
|
+
VALUE rb_number_array)
|
3111
|
+
{
|
3112
|
+
gint8 *numbers;
|
3113
|
+
gint i, n_args;
|
3114
|
+
|
3115
|
+
n_args = RARRAY_LEN(rb_number_array);
|
3116
|
+
numbers = ALLOC_N(gint8, n_args);
|
3117
|
+
for (i = 0; i < n_args; i++) {
|
3118
|
+
numbers[i] = NUM2CHR(RARRAY_PTR(rb_number_array)[i]);
|
3119
|
+
}
|
3120
|
+
|
3121
|
+
array_argument->v_pointer = numbers;
|
3122
|
+
}
|
3123
|
+
|
3124
|
+
static void
|
3125
|
+
set_in_array_uint8_arguments_from_ruby(GIArgument *array_argument,
|
3126
|
+
VALUE rb_number_array)
|
3127
|
+
{
|
3128
|
+
guint8 *numbers;
|
3129
|
+
gint i, n_args;
|
3130
|
+
|
3131
|
+
n_args = RARRAY_LEN(rb_number_array);
|
3132
|
+
numbers = ALLOC_N(guint8, n_args);
|
3133
|
+
for (i = 0; i < n_args; i++) {
|
3134
|
+
numbers[i] = (guint8)NUM2CHR(RARRAY_PTR(rb_number_array)[i]);
|
3135
|
+
}
|
3136
|
+
|
3137
|
+
array_argument->v_pointer = numbers;
|
3138
|
+
}
|
3139
|
+
|
3008
3140
|
static void
|
3009
3141
|
set_in_array_int16_arguments_from_ruby(GIArgument *array_argument,
|
3010
3142
|
VALUE rb_number_array)
|
@@ -3015,7 +3147,7 @@ set_in_array_int16_arguments_from_ruby(GIArgument *array_argument,
|
|
3015
3147
|
n_args = RARRAY_LEN(rb_number_array);
|
3016
3148
|
numbers = ALLOC_N(gint16, n_args);
|
3017
3149
|
for (i = 0; i < n_args; i++) {
|
3018
|
-
numbers[i] =
|
3150
|
+
numbers[i] = NUM2SHORT(RARRAY_PTR(rb_number_array)[i]);
|
3019
3151
|
}
|
3020
3152
|
|
3021
3153
|
array_argument->v_pointer = numbers;
|
@@ -3031,7 +3163,7 @@ set_in_array_uint16_arguments_from_ruby(GIArgument *array_argument,
|
|
3031
3163
|
n_args = RARRAY_LEN(rb_number_array);
|
3032
3164
|
numbers = ALLOC_N(guint16, n_args);
|
3033
3165
|
for (i = 0; i < n_args; i++) {
|
3034
|
-
numbers[i] =
|
3166
|
+
numbers[i] = NUM2USHORT(RARRAY_PTR(rb_number_array)[i]);
|
3035
3167
|
}
|
3036
3168
|
|
3037
3169
|
array_argument->v_pointer = numbers;
|
@@ -3296,10 +3428,28 @@ in_array_c_argument_from_ruby(GIArgument *array_argument,
|
|
3296
3428
|
g_type_tag_to_string(element_type_tag));
|
3297
3429
|
break;
|
3298
3430
|
case GI_TYPE_TAG_INT8:
|
3431
|
+
if (RB_TYPE_P(rb_argument, RUBY_T_STRING)) {
|
3432
|
+
array_argument->v_pointer = RSTRING_PTR(rb_argument);
|
3433
|
+
set_in_array_length_argument(length_argument, length_type_info,
|
3434
|
+
RSTRING_LEN(rb_argument));
|
3435
|
+
} else {
|
3436
|
+
rb_argument = rbg_to_array(rb_argument);
|
3437
|
+
set_in_array_int8_arguments_from_ruby(array_argument, rb_argument);
|
3438
|
+
set_in_array_length_argument(length_argument, length_type_info,
|
3439
|
+
RARRAY_LEN(rb_argument));
|
3440
|
+
}
|
3441
|
+
break;
|
3299
3442
|
case GI_TYPE_TAG_UINT8:
|
3300
|
-
|
3301
|
-
|
3302
|
-
|
3443
|
+
if (RB_TYPE_P(rb_argument, RUBY_T_STRING)) {
|
3444
|
+
array_argument->v_pointer = RSTRING_PTR(rb_argument);
|
3445
|
+
set_in_array_length_argument(length_argument, length_type_info,
|
3446
|
+
RSTRING_LEN(rb_argument));
|
3447
|
+
} else {
|
3448
|
+
rb_argument = rbg_to_array(rb_argument);
|
3449
|
+
set_in_array_uint8_arguments_from_ruby(array_argument, rb_argument);
|
3450
|
+
set_in_array_length_argument(length_argument, length_type_info,
|
3451
|
+
RARRAY_LEN(rb_argument));
|
3452
|
+
}
|
3303
3453
|
break;
|
3304
3454
|
case GI_TYPE_TAG_INT16:
|
3305
3455
|
rb_argument = rbg_to_array(rb_argument);
|
@@ -3571,7 +3721,8 @@ rb_gi_in_array_argument_from_ruby(GIArgument *array_argument,
|
|
3571
3721
|
}
|
3572
3722
|
|
3573
3723
|
static void
|
3574
|
-
rb_gi_value_argument_free_array_c(
|
3724
|
+
rb_gi_value_argument_free_array_c(VALUE rb_argument,
|
3725
|
+
GIArgument *argument,
|
3575
3726
|
G_GNUC_UNUSED GITypeInfo *type_info,
|
3576
3727
|
GITypeInfo *element_type_info)
|
3577
3728
|
{
|
@@ -3587,7 +3738,11 @@ rb_gi_value_argument_free_array_c(GIArgument *argument,
|
|
3587
3738
|
break;
|
3588
3739
|
case GI_TYPE_TAG_INT8:
|
3589
3740
|
case GI_TYPE_TAG_UINT8:
|
3590
|
-
|
3741
|
+
if (RB_TYPE_P(rb_argument, RUBY_T_STRING)) {
|
3742
|
+
/* Do nothing */
|
3743
|
+
} else {
|
3744
|
+
xfree(argument->v_pointer);
|
3745
|
+
}
|
3591
3746
|
break;
|
3592
3747
|
case GI_TYPE_TAG_INT16:
|
3593
3748
|
case GI_TYPE_TAG_UINT16:
|
@@ -3627,7 +3782,9 @@ rb_gi_value_argument_free_array_c(GIArgument *argument,
|
|
3627
3782
|
}
|
3628
3783
|
|
3629
3784
|
static void
|
3630
|
-
rb_gi_value_argument_free_array(
|
3785
|
+
rb_gi_value_argument_free_array(VALUE rb_argument,
|
3786
|
+
GIArgument *argument,
|
3787
|
+
GITypeInfo *type_info)
|
3631
3788
|
{
|
3632
3789
|
GIArrayType array_type;
|
3633
3790
|
GITypeInfo *element_type_info;
|
@@ -3636,7 +3793,8 @@ rb_gi_value_argument_free_array(GIArgument *argument, GITypeInfo *type_info)
|
|
3636
3793
|
element_type_info = g_type_info_get_param_type(type_info, 0);
|
3637
3794
|
switch (array_type) {
|
3638
3795
|
case GI_ARRAY_TYPE_C:
|
3639
|
-
rb_gi_value_argument_free_array_c(
|
3796
|
+
rb_gi_value_argument_free_array_c(rb_argument,
|
3797
|
+
argument,
|
3640
3798
|
type_info,
|
3641
3799
|
element_type_info);
|
3642
3800
|
break;
|
@@ -3706,7 +3864,7 @@ rb_gi_value_argument_free(VALUE rb_argument,
|
|
3706
3864
|
case GI_TYPE_TAG_FILENAME:
|
3707
3865
|
break;
|
3708
3866
|
case GI_TYPE_TAG_ARRAY:
|
3709
|
-
rb_gi_value_argument_free_array(argument, type_info);
|
3867
|
+
rb_gi_value_argument_free_array(rb_argument, argument, type_info);
|
3710
3868
|
break;
|
3711
3869
|
case GI_TYPE_TAG_INTERFACE:
|
3712
3870
|
rb_gi_value_argument_free_interface(rb_argument, argument, type_info);
|
@@ -86,37 +86,31 @@ initialize_receiver(VALUE receiver, GITypeInfo *info, GIArgument *value)
|
|
86
86
|
}
|
87
87
|
|
88
88
|
static VALUE
|
89
|
-
rg_invoke(VALUE self, VALUE
|
89
|
+
rg_invoke(VALUE self, VALUE rb_receiver, VALUE rb_arguments)
|
90
90
|
{
|
91
91
|
GIFunctionInfo *info;
|
92
92
|
GICallableInfo *callable_info;
|
93
|
-
VALUE receiver;
|
94
93
|
GIArgument return_value;
|
95
94
|
GITypeInfo return_value_info;
|
96
95
|
|
97
96
|
info = SELF(self);
|
98
97
|
callable_info = (GICallableInfo *)info;
|
99
98
|
|
100
|
-
|
101
|
-
|
102
|
-
if (NIL_P(receiver)) {
|
103
|
-
receiver = rb_hash_delete(rb_options, rb_str_new_cstr("receiver"));
|
104
|
-
}
|
105
|
-
if (NIL_P(receiver)) {
|
106
|
-
rb_raise(rb_eArgError,
|
107
|
-
"receiver is missing: %s",
|
108
|
-
RBG_INSPECT(rb_options));
|
99
|
+
if (NIL_P(rb_receiver)) {
|
100
|
+
rb_raise(rb_eArgError, "receiver is missing");
|
109
101
|
}
|
110
102
|
/* TODO: use rb_protect */
|
111
103
|
rb_gi_function_info_invoke_raw(info,
|
112
|
-
|
104
|
+
self,
|
105
|
+
Qnil,
|
106
|
+
rb_arguments,
|
113
107
|
&return_value,
|
114
108
|
NULL);
|
115
109
|
|
116
110
|
g_callable_info_load_return_type(callable_info, &return_value_info);
|
117
|
-
initialize_receiver(
|
111
|
+
initialize_receiver(rb_receiver, &return_value_info, &return_value);
|
118
112
|
|
119
|
-
return
|
113
|
+
return rb_receiver;
|
120
114
|
}
|
121
115
|
|
122
116
|
void
|
@@ -129,5 +123,5 @@ rb_gi_constructor_info_init(VALUE rb_mGI, VALUE rb_cGIFunctionInfo)
|
|
129
123
|
"ConstructorInfo", rb_mGI,
|
130
124
|
rb_cGIFunctionInfo);
|
131
125
|
|
132
|
-
RG_DEF_METHOD(invoke,
|
126
|
+
RG_DEF_METHOD(invoke, 2);
|
133
127
|
}
|