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