node-gtk 0.8.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/binding.gyp +36 -17
- package/lib/binding/node-v93-linux-x64/node_gtk.node +0 -0
- package/lib/bootstrap.js +0 -21
- package/package.json +9 -9
- package/scripts/ci.sh +0 -0
- package/src/boxed.cc +3 -3
- package/src/callback.cc +8 -9
- package/src/closure.cc +5 -5
- package/src/closure.h +2 -2
- package/src/debug.cc +2 -2
- package/src/function.cc +225 -333
- package/src/function.h +1 -2
- package/src/gi.cc +17 -35
- package/src/gobject.cc +9 -5
- package/src/loop.cc +9 -0
- package/src/modules/cairo/context.cc +102 -106
- package/src/modules/cairo/generator.js +1 -5
- package/src/type.cc +5 -5
- package/src/value.cc +114 -35
- package/src/value.h +1 -1
- package/CHANGELOG.md +0 -25
package/src/function.h
CHANGED
|
@@ -16,7 +16,7 @@ using v8::String;
|
|
|
16
16
|
namespace GNodeJS {
|
|
17
17
|
|
|
18
18
|
enum ParameterType {
|
|
19
|
-
|
|
19
|
+
kNORMAL, kARRAY, kSKIP, kCALLBACK
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
struct Parameter {
|
|
@@ -58,7 +58,6 @@ void FunctionInvoker (const Nan::FunctionCallbackInfo<Value> &info);
|
|
|
58
58
|
void FunctionDestroyed (const v8::WeakCallbackInfo<FunctionInfo> &data);
|
|
59
59
|
|
|
60
60
|
Local<Function> MakeFunction (GIBaseInfo *base_info);
|
|
61
|
-
MaybeLocal<Function> MakeVirtualFunction(GIBaseInfo *info, GType implementor);
|
|
62
61
|
|
|
63
62
|
|
|
64
63
|
};
|
package/src/gi.cc
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#include <
|
|
1
|
+
#include <girepository.h>
|
|
2
2
|
#include <node.h>
|
|
3
3
|
#include <nan.h>
|
|
4
4
|
|
|
@@ -168,23 +168,6 @@ NAN_METHOD(MakeFunction) {
|
|
|
168
168
|
info.GetReturnValue().Set(fn);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
NAN_METHOD(MakeVirtualFunction) {
|
|
172
|
-
if (info.Length() < 2 || !info[0]->IsObject() || !info[1]->IsNumber()) {
|
|
173
|
-
Nan::ThrowTypeError("Incorrect arguments. Expecting (GIBaseInfo, GType)");
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
BaseInfo gi_info(info[0]);
|
|
178
|
-
GType implementor = (gulong) Nan::To<int64_t> (info[1]).ToChecked();
|
|
179
|
-
|
|
180
|
-
MaybeLocal<Function> maybeFn = GNodeJS::MakeVirtualFunction(*gi_info, implementor);
|
|
181
|
-
|
|
182
|
-
if (maybeFn.IsEmpty())
|
|
183
|
-
return;
|
|
184
|
-
|
|
185
|
-
info.GetReturnValue().Set(maybeFn.ToLocalChecked());
|
|
186
|
-
}
|
|
187
|
-
|
|
188
171
|
NAN_METHOD(MakeObjectClass) {
|
|
189
172
|
BaseInfo gi_info(info[0]);
|
|
190
173
|
auto klass = GNodeJS::MakeClass(*gi_info);
|
|
@@ -362,23 +345,22 @@ NAN_METHOD(RegisterVFunc) {
|
|
|
362
345
|
void InitModule(Local<Object> exports, Local<Value> module, void *priv) {
|
|
363
346
|
GNodeJS::AsyncCallEnvironment::Initialize();
|
|
364
347
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
NAN_EXPORT(exports, RegisterVFunc);
|
|
348
|
+
Nan::Export(exports, "Bootstrap", Bootstrap);
|
|
349
|
+
Nan::Export(exports, "GetModuleCache", GetModuleCache);
|
|
350
|
+
Nan::Export(exports, "GetBaseClass", GetBaseClass);
|
|
351
|
+
Nan::Export(exports, "GetTypeSize", GetTypeSize);
|
|
352
|
+
Nan::Export(exports, "GetConstantValue", GetConstantValue);
|
|
353
|
+
Nan::Export(exports, "MakeBoxedClass", MakeBoxedClass);
|
|
354
|
+
Nan::Export(exports, "MakeObjectClass", MakeObjectClass);
|
|
355
|
+
Nan::Export(exports, "MakeFunction", MakeFunction);
|
|
356
|
+
Nan::Export(exports, "StructFieldGetter", StructFieldGetter);
|
|
357
|
+
Nan::Export(exports, "StructFieldSetter", StructFieldSetter);
|
|
358
|
+
Nan::Export(exports, "ObjectPropertyGetter", ObjectPropertyGetter);
|
|
359
|
+
Nan::Export(exports, "ObjectPropertySetter", ObjectPropertySetter);
|
|
360
|
+
Nan::Export(exports, "StartLoop", StartLoop);
|
|
361
|
+
Nan::Export(exports, "GetLoopStack", GetLoopStack);
|
|
362
|
+
Nan::Export(exports, "RegisterClass", RegisterClass);
|
|
363
|
+
Nan::Export(exports, "RegisterVFunc", RegisterVFunc);
|
|
382
364
|
|
|
383
365
|
Nan::Set(exports, UTF8("System"), GNodeJS::System::GetModule());
|
|
384
366
|
Nan::Set(exports, UTF8("Cairo"), GNodeJS::Cairo::GetModule());
|
package/src/gobject.cc
CHANGED
|
@@ -87,7 +87,11 @@ static GObject* CreateGObjectFromObject(GType gtype, Local<Value> object) {
|
|
|
87
87
|
|
|
88
88
|
out:
|
|
89
89
|
g_strfreev ((gchar**) names);
|
|
90
|
+
|
|
91
|
+
for (int i = 0; i < n_properties; i++)
|
|
92
|
+
g_value_unset(&values[i]);
|
|
90
93
|
g_free (values);
|
|
94
|
+
|
|
91
95
|
g_type_class_unref (klass);
|
|
92
96
|
|
|
93
97
|
return gobject;
|
|
@@ -346,7 +350,7 @@ NAN_METHOD(SignalConnect) {
|
|
|
346
350
|
guint signalId;
|
|
347
351
|
GQuark detail;
|
|
348
352
|
GClosure *gclosure;
|
|
349
|
-
|
|
353
|
+
gulong handler_id;
|
|
350
354
|
|
|
351
355
|
const char *signalName = *Nan::Utf8String (TO_STRING (info[0]));
|
|
352
356
|
if (!g_signal_parse_name(signalName, gtype, &signalId, &detail, FALSE)) {
|
|
@@ -386,7 +390,7 @@ NAN_METHOD(SignalDisconnect) {
|
|
|
386
390
|
}
|
|
387
391
|
|
|
388
392
|
gpointer instance = static_cast<gpointer>(gobject);
|
|
389
|
-
|
|
393
|
+
gulong handler_id = TO_LONG (info[0]);
|
|
390
394
|
g_signal_handler_disconnect (instance, handler_id);
|
|
391
395
|
|
|
392
396
|
info.GetReturnValue().Set((double)handler_id);
|
|
@@ -443,7 +447,7 @@ NAN_METHOD(SignalEmit) {
|
|
|
443
447
|
g_value_set_object(&args[0], gobject);
|
|
444
448
|
|
|
445
449
|
failed = false;
|
|
446
|
-
for (
|
|
450
|
+
for (guint i = 0; i < signal_query.n_params; i++) {
|
|
447
451
|
GValue *gvalue = &args[i + 1];
|
|
448
452
|
|
|
449
453
|
g_value_init(gvalue, signal_query.param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE);
|
|
@@ -466,7 +470,7 @@ NAN_METHOD(SignalEmit) {
|
|
|
466
470
|
}
|
|
467
471
|
}
|
|
468
472
|
|
|
469
|
-
for (
|
|
473
|
+
for (guint i = 0; i < argc; i++) {
|
|
470
474
|
g_value_unset(&args[i]);
|
|
471
475
|
}
|
|
472
476
|
}
|
|
@@ -486,7 +490,7 @@ NAN_METHOD(GObjectToString) {
|
|
|
486
490
|
char *className = *Nan::Utf8String(self->GetConstructorName());
|
|
487
491
|
void *address = self->GetAlignedPointerFromInternalField(0);
|
|
488
492
|
|
|
489
|
-
char *str = g_strdup_printf("[%s:%s %#zx]", typeName, className, (
|
|
493
|
+
char *str = g_strdup_printf("[%s:%s %#zx]", typeName, className, (size_t)address);
|
|
490
494
|
|
|
491
495
|
info.GetReturnValue().Set(UTF8(str));
|
|
492
496
|
g_free(str);
|
package/src/loop.cc
CHANGED
|
@@ -92,9 +92,14 @@ static GSourceFuncs uv_loop_source_funcs = {
|
|
|
92
92
|
static GSource *loop_source_new (uv_loop_t *loop) {
|
|
93
93
|
struct uv_loop_source *source = (struct uv_loop_source *) g_source_new (&uv_loop_source_funcs, sizeof (*source));
|
|
94
94
|
source->loop = loop;
|
|
95
|
+
#if OS_WINDOWS
|
|
96
|
+
// FIXME
|
|
97
|
+
// https://github.com/nodejs/node/issues/36015
|
|
98
|
+
#else
|
|
95
99
|
g_source_add_unix_fd (&source->source,
|
|
96
100
|
uv_backend_fd (loop),
|
|
97
101
|
(GIOCondition) (G_IO_IN | G_IO_OUT | G_IO_ERR));
|
|
102
|
+
#endif
|
|
98
103
|
return &source->source;
|
|
99
104
|
}
|
|
100
105
|
|
|
@@ -133,7 +138,11 @@ static void CallNextTickCallback() {
|
|
|
133
138
|
|
|
134
139
|
void CallMicrotaskHandlers () {
|
|
135
140
|
CallNextTickCallback();
|
|
141
|
+
#if V8_MAJOR_VERSION >= 9
|
|
142
|
+
Isolate::GetCurrent()->PerformMicrotaskCheckpoint();
|
|
143
|
+
#else
|
|
136
144
|
Isolate::GetCurrent()->RunMicrotasks();
|
|
145
|
+
#endif
|
|
137
146
|
}
|
|
138
147
|
|
|
139
148
|
void StartLoop() {
|
|
@@ -1336,119 +1336,115 @@ NAN_METHOD(tagEnd) {
|
|
|
1336
1336
|
}
|
|
1337
1337
|
#endif
|
|
1338
1338
|
|
|
1339
|
-
#define SET_METHOD(tpl, name) Nan::SetPrototypeMethod(tpl, #name, name)
|
|
1340
|
-
|
|
1341
1339
|
static void AttachMethods(Local<FunctionTemplate> tpl) {
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1340
|
+
SET_PROTOTYPE_METHOD(tpl, status);
|
|
1341
|
+
SET_PROTOTYPE_METHOD(tpl, save);
|
|
1342
|
+
SET_PROTOTYPE_METHOD(tpl, restore);
|
|
1343
|
+
SET_PROTOTYPE_METHOD(tpl, getTarget);
|
|
1344
|
+
SET_PROTOTYPE_METHOD(tpl, pushGroup);
|
|
1345
|
+
SET_PROTOTYPE_METHOD(tpl, pushGroupWithContent);
|
|
1346
|
+
SET_PROTOTYPE_METHOD(tpl, popGroup);
|
|
1347
|
+
SET_PROTOTYPE_METHOD(tpl, popGroupToSource);
|
|
1348
|
+
SET_PROTOTYPE_METHOD(tpl, getGroupTarget);
|
|
1349
|
+
SET_PROTOTYPE_METHOD(tpl, setSourceRgb);
|
|
1350
|
+
SET_PROTOTYPE_METHOD(tpl, setSourceRgba);
|
|
1351
|
+
SET_PROTOTYPE_METHOD(tpl, setSource);
|
|
1352
|
+
SET_PROTOTYPE_METHOD(tpl, setSourceSurface);
|
|
1353
|
+
SET_PROTOTYPE_METHOD(tpl, getSource);
|
|
1354
|
+
SET_PROTOTYPE_METHOD(tpl, setAntialias);
|
|
1355
|
+
SET_PROTOTYPE_METHOD(tpl, getAntialias);
|
|
1356
|
+
SET_PROTOTYPE_METHOD(tpl, getDashCount);
|
|
1357
|
+
SET_PROTOTYPE_METHOD(tpl, getDash);
|
|
1358
|
+
SET_PROTOTYPE_METHOD(tpl, setFillRule);
|
|
1359
|
+
SET_PROTOTYPE_METHOD(tpl, getFillRule);
|
|
1360
|
+
SET_PROTOTYPE_METHOD(tpl, setLineCap);
|
|
1361
|
+
SET_PROTOTYPE_METHOD(tpl, getLineCap);
|
|
1362
|
+
SET_PROTOTYPE_METHOD(tpl, setLineJoin);
|
|
1363
|
+
SET_PROTOTYPE_METHOD(tpl, getLineJoin);
|
|
1364
|
+
SET_PROTOTYPE_METHOD(tpl, setLineWidth);
|
|
1365
|
+
SET_PROTOTYPE_METHOD(tpl, getLineWidth);
|
|
1366
|
+
SET_PROTOTYPE_METHOD(tpl, setMiterLimit);
|
|
1367
|
+
SET_PROTOTYPE_METHOD(tpl, getMiterLimit);
|
|
1368
|
+
SET_PROTOTYPE_METHOD(tpl, setOperator);
|
|
1369
|
+
SET_PROTOTYPE_METHOD(tpl, getOperator);
|
|
1370
|
+
SET_PROTOTYPE_METHOD(tpl, setTolerance);
|
|
1371
|
+
SET_PROTOTYPE_METHOD(tpl, getTolerance);
|
|
1372
|
+
SET_PROTOTYPE_METHOD(tpl, clip);
|
|
1373
|
+
SET_PROTOTYPE_METHOD(tpl, clipPreserve);
|
|
1374
|
+
SET_PROTOTYPE_METHOD(tpl, clipExtents);
|
|
1375
|
+
SET_PROTOTYPE_METHOD(tpl, inClip);
|
|
1376
|
+
SET_PROTOTYPE_METHOD(tpl, resetClip);
|
|
1377
|
+
SET_PROTOTYPE_METHOD(tpl, copyClipRectangleList);
|
|
1378
|
+
SET_PROTOTYPE_METHOD(tpl, fill);
|
|
1379
|
+
SET_PROTOTYPE_METHOD(tpl, fillPreserve);
|
|
1380
|
+
SET_PROTOTYPE_METHOD(tpl, fillExtents);
|
|
1381
|
+
SET_PROTOTYPE_METHOD(tpl, inFill);
|
|
1382
|
+
SET_PROTOTYPE_METHOD(tpl, mask);
|
|
1383
|
+
SET_PROTOTYPE_METHOD(tpl, maskSurface);
|
|
1384
|
+
SET_PROTOTYPE_METHOD(tpl, paint);
|
|
1385
|
+
SET_PROTOTYPE_METHOD(tpl, paintWithAlpha);
|
|
1386
|
+
SET_PROTOTYPE_METHOD(tpl, stroke);
|
|
1387
|
+
SET_PROTOTYPE_METHOD(tpl, strokePreserve);
|
|
1388
|
+
SET_PROTOTYPE_METHOD(tpl, strokeExtents);
|
|
1389
|
+
SET_PROTOTYPE_METHOD(tpl, inStroke);
|
|
1390
|
+
SET_PROTOTYPE_METHOD(tpl, copyPage);
|
|
1391
|
+
SET_PROTOTYPE_METHOD(tpl, showPage);
|
|
1392
|
+
SET_PROTOTYPE_METHOD(tpl, getReferenceCount);
|
|
1393
|
+
SET_PROTOTYPE_METHOD(tpl, copyPath);
|
|
1394
|
+
SET_PROTOTYPE_METHOD(tpl, copyPathFlat);
|
|
1395
|
+
SET_PROTOTYPE_METHOD(tpl, appendPath);
|
|
1396
|
+
SET_PROTOTYPE_METHOD(tpl, hasCurrentPoint);
|
|
1397
|
+
SET_PROTOTYPE_METHOD(tpl, getCurrentPoint);
|
|
1398
|
+
SET_PROTOTYPE_METHOD(tpl, newPath);
|
|
1399
|
+
SET_PROTOTYPE_METHOD(tpl, newSubPath);
|
|
1400
|
+
SET_PROTOTYPE_METHOD(tpl, closePath);
|
|
1401
|
+
SET_PROTOTYPE_METHOD(tpl, arc);
|
|
1402
|
+
SET_PROTOTYPE_METHOD(tpl, arcNegative);
|
|
1403
|
+
SET_PROTOTYPE_METHOD(tpl, curveTo);
|
|
1404
|
+
SET_PROTOTYPE_METHOD(tpl, lineTo);
|
|
1405
|
+
SET_PROTOTYPE_METHOD(tpl, moveTo);
|
|
1406
|
+
SET_PROTOTYPE_METHOD(tpl, rectangle);
|
|
1407
|
+
SET_PROTOTYPE_METHOD(tpl, glyphPath);
|
|
1408
|
+
SET_PROTOTYPE_METHOD(tpl, textPath);
|
|
1409
|
+
SET_PROTOTYPE_METHOD(tpl, relCurveTo);
|
|
1410
|
+
SET_PROTOTYPE_METHOD(tpl, relLineTo);
|
|
1411
|
+
SET_PROTOTYPE_METHOD(tpl, relMoveTo);
|
|
1412
|
+
SET_PROTOTYPE_METHOD(tpl, pathExtents);
|
|
1413
|
+
SET_PROTOTYPE_METHOD(tpl, showText);
|
|
1414
|
+
SET_PROTOTYPE_METHOD(tpl, showGlyphs);
|
|
1415
|
+
SET_PROTOTYPE_METHOD(tpl, showTextGlyphs);
|
|
1416
|
+
SET_PROTOTYPE_METHOD(tpl, fontExtents);
|
|
1417
|
+
SET_PROTOTYPE_METHOD(tpl, textExtents);
|
|
1418
|
+
SET_PROTOTYPE_METHOD(tpl, glyphExtents);
|
|
1419
|
+
SET_PROTOTYPE_METHOD(tpl, selectFontFace);
|
|
1420
|
+
SET_PROTOTYPE_METHOD(tpl, setFontSize);
|
|
1421
|
+
SET_PROTOTYPE_METHOD(tpl, setFontMatrix);
|
|
1422
|
+
SET_PROTOTYPE_METHOD(tpl, getFontMatrix);
|
|
1423
|
+
SET_PROTOTYPE_METHOD(tpl, setFontOptions);
|
|
1424
|
+
SET_PROTOTYPE_METHOD(tpl, getFontOptions);
|
|
1425
|
+
SET_PROTOTYPE_METHOD(tpl, setFontFace);
|
|
1426
|
+
SET_PROTOTYPE_METHOD(tpl, getFontFace);
|
|
1427
|
+
SET_PROTOTYPE_METHOD(tpl, setScaledFont);
|
|
1428
|
+
SET_PROTOTYPE_METHOD(tpl, getScaledFont);
|
|
1429
|
+
SET_PROTOTYPE_METHOD(tpl, translate);
|
|
1430
|
+
SET_PROTOTYPE_METHOD(tpl, scale);
|
|
1431
|
+
SET_PROTOTYPE_METHOD(tpl, rotate);
|
|
1432
|
+
SET_PROTOTYPE_METHOD(tpl, transform);
|
|
1433
|
+
SET_PROTOTYPE_METHOD(tpl, setMatrix);
|
|
1434
|
+
SET_PROTOTYPE_METHOD(tpl, getMatrix);
|
|
1435
|
+
SET_PROTOTYPE_METHOD(tpl, identityMatrix);
|
|
1436
|
+
SET_PROTOTYPE_METHOD(tpl, userToDevice);
|
|
1437
|
+
SET_PROTOTYPE_METHOD(tpl, userToDeviceDistance);
|
|
1438
|
+
SET_PROTOTYPE_METHOD(tpl, deviceToUser);
|
|
1439
|
+
SET_PROTOTYPE_METHOD(tpl, deviceToUserDistance);
|
|
1442
1440
|
#if CAIRO_VERSION_MAJOR >= 1 && CAIRO_VERSION_MINOR >= 16
|
|
1443
|
-
|
|
1441
|
+
SET_PROTOTYPE_METHOD(tpl, tagBegin);
|
|
1444
1442
|
#endif
|
|
1445
1443
|
#if CAIRO_VERSION_MAJOR >= 1 && CAIRO_VERSION_MINOR >= 16
|
|
1446
|
-
|
|
1444
|
+
SET_PROTOTYPE_METHOD(tpl, tagEnd);
|
|
1447
1445
|
#endif
|
|
1448
1446
|
}
|
|
1449
1447
|
|
|
1450
|
-
#undef SET_METHOD
|
|
1451
|
-
|
|
1452
1448
|
/* </ auto-generated */
|
|
1453
1449
|
|
|
1454
1450
|
static void InstanceDestroyed(const Nan::WeakCallbackInfo<ContextInfo> &info);
|
|
@@ -521,8 +521,6 @@ function getReturn(fn, outArguments) {
|
|
|
521
521
|
|
|
522
522
|
function getAttachMethods(name, functions) {
|
|
523
523
|
return unindent(`
|
|
524
|
-
#define SET_METHOD(tpl, name) Nan::SetPrototypeMethod(tpl, #name, name)
|
|
525
|
-
|
|
526
524
|
static void AttachMethods(Local<FunctionTemplate> tpl) {
|
|
527
525
|
${functions.map(fn =>
|
|
528
526
|
(fn.attributes.version ? (() => {
|
|
@@ -533,12 +531,10 @@ function getAttachMethods(name, functions) {
|
|
|
533
531
|
(micro ? 'CAIRO_VERSION_MICRO >= ' + micro : undefined),
|
|
534
532
|
].filter(Boolean).join(' && ') + '\n '
|
|
535
533
|
})() : '')
|
|
536
|
-
+ `
|
|
534
|
+
+ `SET_PROTOTYPE_METHOD(tpl, ${getJSName(fn.name)});`
|
|
537
535
|
+ (fn.attributes.version ? '\n #endif' : '')
|
|
538
536
|
).join('\n ')}
|
|
539
537
|
}
|
|
540
|
-
|
|
541
|
-
#undef SET_METHOD
|
|
542
538
|
`)
|
|
543
539
|
}
|
|
544
540
|
|
package/src/type.cc
CHANGED
|
@@ -256,13 +256,13 @@ GITypeTag GetStorageType (GITypeInfo *type_info) {
|
|
|
256
256
|
GITypeTag type_tag = g_type_info_get_tag (type_info);
|
|
257
257
|
|
|
258
258
|
if (type_tag == GI_TYPE_TAG_INTERFACE) {
|
|
259
|
-
GIBaseInfo *
|
|
260
|
-
GIInfoType
|
|
259
|
+
GIBaseInfo *iface = g_type_info_get_interface (type_info);
|
|
260
|
+
GIInfoType iface_type = g_base_info_get_type (iface);
|
|
261
261
|
|
|
262
|
-
if (
|
|
263
|
-
type_tag = g_enum_info_get_storage_type ((GIEnumInfo *)
|
|
262
|
+
if (iface_type == GI_INFO_TYPE_ENUM || iface_type == GI_INFO_TYPE_FLAGS)
|
|
263
|
+
type_tag = g_enum_info_get_storage_type ((GIEnumInfo *)iface);
|
|
264
264
|
|
|
265
|
-
g_base_info_unref (
|
|
265
|
+
g_base_info_unref (iface);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
return type_tag;
|