gobject-introspection 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gobject-introspection/rb-gi-argument.c +81 -48
- data/ext/gobject-introspection/rb-gi-loader.c +12 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43fb9034b06bbabd0681a877e2bdad9ee92ecd44
|
4
|
+
data.tar.gz: cc096dc7cefc3c80b9b55bb615aca413aca24b07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efce6549fc4ec94824e903654200252ff5a805528e35e9a5a7befbf1c3940a13aa748538e6be53049fd3548ed4de9036b0cb09c6d6b7f80b40796d493ba231ee
|
7
|
+
data.tar.gz: 929fa23d59f2b783779911a1783e3e0416804a87497dbb2e32ed800e5ab176917869d070daae7fa09f3dd6bcdb48c0f7851c96134b6352eba514645a9f7cdc42
|
@@ -1366,67 +1366,70 @@ rb_gi_out_argument_init(GIArgument *argument, GIArgInfo *arg_info)
|
|
1366
1366
|
g_arg_info_load_type(arg_info, &type_info);
|
1367
1367
|
type_tag = g_type_info_get_tag(&type_info);
|
1368
1368
|
switch (type_tag) {
|
1369
|
-
|
1369
|
+
case GI_TYPE_TAG_VOID:
|
1370
|
+
if (g_type_info_is_pointer(&type_info)) {
|
1371
|
+
argument->v_pointer = ALLOC(gpointer);
|
1372
|
+
}
|
1370
1373
|
break;
|
1371
|
-
|
1374
|
+
case GI_TYPE_TAG_BOOLEAN:
|
1372
1375
|
argument->v_pointer = ALLOC(gboolean);
|
1373
1376
|
break;
|
1374
|
-
|
1377
|
+
case GI_TYPE_TAG_INT8:
|
1375
1378
|
argument->v_pointer = ALLOC(gint8);
|
1376
1379
|
break;
|
1377
|
-
|
1380
|
+
case GI_TYPE_TAG_UINT8:
|
1378
1381
|
argument->v_pointer = ALLOC(guint8);
|
1379
1382
|
break;
|
1380
|
-
|
1383
|
+
case GI_TYPE_TAG_INT16:
|
1381
1384
|
argument->v_pointer = ALLOC(gint16);
|
1382
1385
|
break;
|
1383
|
-
|
1386
|
+
case GI_TYPE_TAG_UINT16:
|
1384
1387
|
argument->v_pointer = ALLOC(guint16);
|
1385
1388
|
break;
|
1386
|
-
|
1389
|
+
case GI_TYPE_TAG_INT32:
|
1387
1390
|
argument->v_pointer = ALLOC(gint32);
|
1388
1391
|
break;
|
1389
|
-
|
1392
|
+
case GI_TYPE_TAG_UINT32:
|
1390
1393
|
argument->v_pointer = ALLOC(guint32);
|
1391
1394
|
break;
|
1392
|
-
|
1395
|
+
case GI_TYPE_TAG_INT64:
|
1393
1396
|
argument->v_pointer = ALLOC(gint64);
|
1394
1397
|
break;
|
1395
|
-
|
1398
|
+
case GI_TYPE_TAG_UINT64:
|
1396
1399
|
argument->v_pointer = ALLOC(guint64);
|
1397
1400
|
break;
|
1398
|
-
|
1401
|
+
case GI_TYPE_TAG_FLOAT:
|
1399
1402
|
argument->v_pointer = ALLOC(gfloat);
|
1400
1403
|
break;
|
1401
|
-
|
1404
|
+
case GI_TYPE_TAG_DOUBLE:
|
1402
1405
|
argument->v_pointer = ALLOC(gdouble);
|
1403
1406
|
break;
|
1404
|
-
|
1407
|
+
case GI_TYPE_TAG_GTYPE:
|
1405
1408
|
argument->v_pointer = ALLOC(GType);
|
1406
1409
|
break;
|
1407
|
-
|
1408
|
-
|
1410
|
+
case GI_TYPE_TAG_UTF8:
|
1411
|
+
case GI_TYPE_TAG_FILENAME:
|
1409
1412
|
argument->v_pointer = ALLOC(gchar *);
|
1410
1413
|
break;
|
1411
|
-
|
1414
|
+
case GI_TYPE_TAG_ARRAY:
|
1412
1415
|
rb_gi_out_argument_init_array(argument, arg_info, &type_info);
|
1413
1416
|
break;
|
1414
|
-
|
1417
|
+
case GI_TYPE_TAG_INTERFACE:
|
1415
1418
|
rb_gi_out_argument_init_interface(argument, arg_info, &type_info);
|
1416
1419
|
break;
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
+
case GI_TYPE_TAG_GLIST:
|
1421
|
+
case GI_TYPE_TAG_GSLIST:
|
1422
|
+
case GI_TYPE_TAG_GHASH:
|
1420
1423
|
argument->v_pointer = ALLOC(gpointer);
|
1421
1424
|
break;
|
1422
|
-
|
1425
|
+
case GI_TYPE_TAG_ERROR:
|
1423
1426
|
argument->v_pointer = ALLOC(GError *);
|
1424
1427
|
memset(argument->v_pointer, 0, sizeof(GError *));
|
1425
1428
|
break;
|
1426
|
-
|
1429
|
+
case GI_TYPE_TAG_UNICHAR:
|
1427
1430
|
argument->v_pointer = ALLOC(gunichar);
|
1428
1431
|
break;
|
1429
|
-
|
1432
|
+
default:
|
1430
1433
|
g_assert_not_reached();
|
1431
1434
|
break;
|
1432
1435
|
}
|
@@ -1448,53 +1451,56 @@ rb_gi_out_argument_to_ruby(GIArgument *argument,
|
|
1448
1451
|
g_arg_info_load_type(arg_info, &type_info);
|
1449
1452
|
type_tag = g_type_info_get_tag(&type_info);
|
1450
1453
|
switch (type_tag) {
|
1451
|
-
|
1454
|
+
case GI_TYPE_TAG_VOID:
|
1455
|
+
if (g_type_info_is_pointer(&type_info)) {
|
1456
|
+
normalized_argument.v_pointer = *((gpointer *)(argument->v_pointer));
|
1457
|
+
}
|
1452
1458
|
break;
|
1453
|
-
|
1459
|
+
case GI_TYPE_TAG_BOOLEAN:
|
1454
1460
|
normalized_argument.v_boolean = *((gboolean *)(argument->v_pointer));
|
1455
1461
|
break;
|
1456
|
-
|
1462
|
+
case GI_TYPE_TAG_INT8:
|
1457
1463
|
normalized_argument.v_int8 = *((gint8 *)(argument->v_pointer));
|
1458
1464
|
break;
|
1459
|
-
|
1465
|
+
case GI_TYPE_TAG_UINT8:
|
1460
1466
|
normalized_argument.v_uint8 = *((guint8 *)(argument->v_pointer));
|
1461
1467
|
break;
|
1462
|
-
|
1468
|
+
case GI_TYPE_TAG_INT16:
|
1463
1469
|
normalized_argument.v_int16 = *((gint16 *)(argument->v_pointer));
|
1464
1470
|
break;
|
1465
|
-
|
1471
|
+
case GI_TYPE_TAG_UINT16:
|
1466
1472
|
normalized_argument.v_uint16 = *((guint16 *)(argument->v_pointer));
|
1467
1473
|
break;
|
1468
|
-
|
1474
|
+
case GI_TYPE_TAG_INT32:
|
1469
1475
|
normalized_argument.v_int32 = *((gint32 *)(argument->v_pointer));
|
1470
1476
|
break;
|
1471
|
-
|
1477
|
+
case GI_TYPE_TAG_UINT32:
|
1472
1478
|
normalized_argument.v_uint32 = *((guint32 *)(argument->v_pointer));
|
1473
1479
|
break;
|
1474
|
-
|
1480
|
+
case GI_TYPE_TAG_INT64:
|
1475
1481
|
normalized_argument.v_int64 = *((gint64 *)(argument->v_pointer));
|
1476
1482
|
break;
|
1477
|
-
|
1483
|
+
case GI_TYPE_TAG_UINT64:
|
1478
1484
|
normalized_argument.v_uint64 = *((guint64 *)(argument->v_pointer));
|
1479
1485
|
break;
|
1480
|
-
|
1486
|
+
case GI_TYPE_TAG_FLOAT:
|
1481
1487
|
normalized_argument.v_float = *((gfloat *)(argument->v_pointer));
|
1482
1488
|
break;
|
1483
|
-
|
1489
|
+
case GI_TYPE_TAG_DOUBLE:
|
1484
1490
|
normalized_argument.v_double = *((gdouble *)(argument->v_pointer));
|
1485
1491
|
break;
|
1486
|
-
|
1492
|
+
case GI_TYPE_TAG_GTYPE:
|
1487
1493
|
normalized_argument.v_size = *((GType *)(argument->v_pointer));
|
1488
1494
|
break;
|
1489
|
-
|
1490
|
-
|
1495
|
+
case GI_TYPE_TAG_UTF8:
|
1496
|
+
case GI_TYPE_TAG_FILENAME:
|
1491
1497
|
normalized_argument.v_string = *((gchar **)(argument->v_pointer));
|
1492
1498
|
break;
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1499
|
+
case GI_TYPE_TAG_ARRAY:
|
1500
|
+
case GI_TYPE_TAG_INTERFACE:
|
1501
|
+
case GI_TYPE_TAG_GLIST:
|
1502
|
+
case GI_TYPE_TAG_GSLIST:
|
1503
|
+
case GI_TYPE_TAG_GHASH:
|
1498
1504
|
if (g_arg_info_is_caller_allocates(arg_info)) {
|
1499
1505
|
duplicate = TRUE;
|
1500
1506
|
normalized_argument.v_pointer = argument->v_pointer;
|
@@ -1502,13 +1508,13 @@ rb_gi_out_argument_to_ruby(GIArgument *argument,
|
|
1502
1508
|
normalized_argument.v_pointer = *((gpointer *)(argument->v_pointer));
|
1503
1509
|
}
|
1504
1510
|
break;
|
1505
|
-
|
1511
|
+
case GI_TYPE_TAG_ERROR:
|
1506
1512
|
normalized_argument.v_pointer = *((GError **)(argument->v_pointer));
|
1507
1513
|
break;
|
1508
|
-
|
1514
|
+
case GI_TYPE_TAG_UNICHAR:
|
1509
1515
|
normalized_argument.v_uint32 = *((guint32 *)(argument->v_pointer));
|
1510
1516
|
break;
|
1511
|
-
|
1517
|
+
default:
|
1512
1518
|
g_assert_not_reached();
|
1513
1519
|
break;
|
1514
1520
|
}
|
@@ -2396,6 +2402,34 @@ rb_gi_value_argument_from_ruby_void(GIArgument *argument, GITypeInfo *type_info,
|
|
2396
2402
|
}
|
2397
2403
|
}
|
2398
2404
|
|
2405
|
+
static GType
|
2406
|
+
rb_gi_value_argument_from_ruby_gtype(VALUE rb_argument)
|
2407
|
+
{
|
2408
|
+
ID id_gtype;
|
2409
|
+
VALUE rb_gtype;
|
2410
|
+
|
2411
|
+
if (RB_TYPE_P(rb_argument, RUBY_T_STRING)) {
|
2412
|
+
GType gtype;
|
2413
|
+
gtype = g_type_from_name(RVAL2CSTR(rb_argument));
|
2414
|
+
if (gtype == 0) {
|
2415
|
+
rb_raise(rb_eArgError,
|
2416
|
+
"unknown GType name: <%s>",
|
2417
|
+
RVAL2CSTR(rb_argument));
|
2418
|
+
}
|
2419
|
+
return gtype;
|
2420
|
+
}
|
2421
|
+
|
2422
|
+
CONST_ID(id_gtype, "gtype");
|
2423
|
+
|
2424
|
+
if (rb_respond_to(rb_argument, id_gtype)) {
|
2425
|
+
rb_gtype = rb_funcall(rb_argument, id_gtype, 0);
|
2426
|
+
} else {
|
2427
|
+
rb_gtype = rb_argument;
|
2428
|
+
}
|
2429
|
+
|
2430
|
+
return NUM2ULONG(rb_gtype);
|
2431
|
+
}
|
2432
|
+
|
2399
2433
|
GIArgument *
|
2400
2434
|
rb_gi_value_argument_from_ruby(GIArgument *argument, GITypeInfo *type_info,
|
2401
2435
|
VALUE rb_argument, VALUE self)
|
@@ -2443,8 +2477,7 @@ rb_gi_value_argument_from_ruby(GIArgument *argument, GITypeInfo *type_info,
|
|
2443
2477
|
argument->v_double = NUM2DBL(rb_argument);
|
2444
2478
|
break;
|
2445
2479
|
case GI_TYPE_TAG_GTYPE:
|
2446
|
-
|
2447
|
-
argument->v_size = NUM2ULONG(rb_argument);
|
2480
|
+
argument->v_size = rb_gi_value_argument_from_ruby_gtype(rb_argument);
|
2448
2481
|
break;
|
2449
2482
|
case GI_TYPE_TAG_UTF8:
|
2450
2483
|
/* TODO: support UTF-8 convert like rb_argument.encode("UTF-8"). */
|
@@ -236,6 +236,17 @@ rg_s_reference_gobject(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass)
|
|
236
236
|
return Qnil;
|
237
237
|
}
|
238
238
|
|
239
|
+
static VALUE
|
240
|
+
rg_s_instantiate_gobject_pointer(G_GNUC_UNUSED VALUE klass,
|
241
|
+
VALUE rb_gobject_pointer)
|
242
|
+
{
|
243
|
+
GObject *gobject;
|
244
|
+
|
245
|
+
gobject = GUINT_TO_POINTER(NUM2ULONG(rb_gobject_pointer));
|
246
|
+
|
247
|
+
return GOBJ2RVAL(gobject);
|
248
|
+
}
|
249
|
+
|
239
250
|
void
|
240
251
|
rb_gi_loader_init(VALUE rb_mGI)
|
241
252
|
{
|
@@ -253,4 +264,5 @@ rb_gi_loader_init(VALUE rb_mGI)
|
|
253
264
|
RG_DEF_SMETHOD(register_constant_rename_map, 2);
|
254
265
|
RG_DEF_SMETHOD(start_callback_dispatch_thread, 0);
|
255
266
|
RG_DEF_SMETHOD(reference_gobject, -1);
|
267
|
+
RG_DEF_SMETHOD(instantiate_gobject_pointer, 1);
|
256
268
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gobject-introspection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME2 Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glib2
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0.
|
19
|
+
version: 3.0.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.0.
|
26
|
+
version: 3.0.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: test-unit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|