-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathfunction.h
More file actions
64 lines (44 loc) · 1.45 KB
/
Copy pathfunction.h
File metadata and controls
64 lines (44 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include <nan.h>
#include <node.h>
#include <girepository.h>
#include <girffi.h>
#include "gi.h"
using v8::Function;
using v8::Local;
using v8::MaybeLocal;
using v8::String;
namespace GNodeJS {
enum ParameterType {
kNORMAL, kARRAY, kSKIP, kCALLBACK
};
struct Parameter {
ParameterType type;
GIDirection direction;
GIArgument data;
long length;
};
struct FunctionInfo {
GIFunctionInfo *info;
GIFunctionInvoker invoker;
bool is_method;
bool can_throw;
bool frees_instance; /* a *_free/*_unref method that deallocates the instance (#429) */
int n_callable_args;
int n_total_args;
int n_out_args;
int n_in_args;
Parameter* call_parameters;
Nan::Persistent<FunctionTemplate> *persistent;
FunctionInfo(GIBaseInfo* info);
~FunctionInfo();
bool Init();
bool TypeCheck (const Nan::FunctionCallbackInfo<Value> &info);
Local<Value> JsReturnValue (Local<Value> self, GITypeInfo* return_type, GIArgument* return_value, GIArgument* callable_arg_values, GITransfer return_transfer);
};
bool IsDestroyNotify (GIBaseInfo *info);
Local<Value> FunctionCall (FunctionInfo *func, const Nan::FunctionCallbackInfo<Value> &info, GIArgument *return_value = NULL, GError **error = NULL);
void FunctionInvoker (const Nan::FunctionCallbackInfo<Value> &info);
void FunctionDestroyed (const Nan::WeakCallbackInfo<FunctionInfo> &data);
Local<Function> MakeFunction (GIBaseInfo *base_info);
};