1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | #include "PDFBooleanDriver.h"
|
21 | #include "RefCountPtr.h"
|
22 | #include "ConstructorsHolder.h"
|
23 |
|
24 | using namespace v8;
|
25 |
|
26 |
|
27 |
|
28 | DEF_SUBORDINATE_INIT(PDFBooleanDriver::Init)
|
29 | {
|
30 | CREATE_ISOLATE_CONTEXT;
|
31 |
|
32 | Local<FunctionTemplate> t = NEW_FUNCTION_TEMPLATE_EXTERNAL(New);
|
33 |
|
34 | t->SetClassName(NEW_STRING("PDFBoolean"));
|
35 | t->InstanceTemplate()->SetInternalFieldCount(1);
|
36 |
|
37 | SET_ACCESSOR_METHOD(t, "value", GetValue);
|
38 | PDFObjectDriver::Init(t);
|
39 |
|
40 |
|
41 | EXPOSE_EXTERNAL_FOR_INIT(ConstructorsHolder, holder)
|
42 | SET_CONSTRUCTOR(holder->PDFBoolean_constructor, t);
|
43 | SET_CONSTRUCTOR_TEMPLATE(holder->PDFBoolean_constructor_template, t);
|
44 | }
|
45 |
|
46 | METHOD_RETURN_TYPE PDFBooleanDriver::New(const ARGS_TYPE& args)
|
47 | {
|
48 | CREATE_ISOLATE_CONTEXT;
|
49 | CREATE_ESCAPABLE_SCOPE;
|
50 | EXPOSE_EXTERNAL_ARGS(ConstructorsHolder, externalHolder)
|
51 |
|
52 | PDFBooleanDriver* driver = new PDFBooleanDriver();
|
53 | driver->holder = externalHolder;
|
54 | driver->Wrap(args.This());
|
55 | SET_FUNCTION_RETURN_VALUE(args.This())
|
56 | }
|
57 |
|
58 | PDFObject* PDFBooleanDriver::GetObject()
|
59 | {
|
60 | return TheObject.GetPtr();
|
61 | }
|
62 |
|
63 | METHOD_RETURN_TYPE PDFBooleanDriver::GetValue(Local<String> property, const PROPERTY_TYPE &info)
|
64 | {
|
65 | CREATE_ISOLATE_CONTEXT;
|
66 | CREATE_ESCAPABLE_SCOPE;
|
67 |
|
68 | Local<Boolean> result = NEW_BOOLEAN(ObjectWrap::Unwrap<PDFBooleanDriver>(info.Holder())->TheObject->GetValue());
|
69 |
|
70 |
|
71 | SET_ACCESSOR_RETURN_VALUE(result)
|
72 | }
|
73 |
|
74 |
|