From 6a6e72f98f3ec919b9dda32374543d90e69b4b2d Mon Sep 17 00:00:00 2001 From: Julian Hille Date: Sat, 7 Sep 2024 12:16:41 +0200 Subject: [PATCH] Add typing for newer node v8 versions where setAccessor have been replaced with setNativeProperty --- src/FormXObjectDriver.cpp | 2 +- src/FormXObjectDriver.h | 2 +- src/ImageXObjectDriver.cpp | 2 +- src/ImageXObjectDriver.h | 2 +- src/InfoDictionaryDriver.cpp | 28 ++++++++++++++-------------- src/InfoDictionaryDriver.h | 28 ++++++++++++++-------------- src/PDFBooleanDriver.cpp | 2 +- src/PDFBooleanDriver.h | 2 +- src/PDFHexStringDriver.cpp | 2 +- src/PDFHexStringDriver.h | 2 +- src/PDFIntegerDriver.cpp | 2 +- src/PDFIntegerDriver.h | 2 +- src/PDFLiteralStringDriver.cpp | 2 +- src/PDFLiteralStringDriver.h | 2 +- src/PDFNameDriver.cpp | 2 +- src/PDFNameDriver.h | 2 +- src/PDFNullDriver.cpp | 2 +- src/PDFNullDriver.h | 2 +- src/PDFPageDriver.cpp | 24 ++++++++++++------------ src/PDFPageDriver.h | 24 ++++++++++++------------ src/PDFRealDriver.cpp | 2 +- src/PDFRealDriver.h | 2 +- src/PDFSymbolDriver.cpp | 2 +- src/PDFSymbolDriver.h | 2 +- src/nodes.h | 8 +++++--- 25 files changed, 77 insertions(+), 75 deletions(-) diff --git a/src/FormXObjectDriver.cpp b/src/FormXObjectDriver.cpp index 7108dea8..7976c1a5 100644 --- a/src/FormXObjectDriver.cpp +++ b/src/FormXObjectDriver.cpp @@ -72,7 +72,7 @@ METHOD_RETURN_TYPE FormXObjectDriver::New(const ARGS_TYPE& args) SET_FUNCTION_RETURN_VALUE(args.This()) } -METHOD_RETURN_TYPE FormXObjectDriver::GetID(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE FormXObjectDriver::GetID(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/FormXObjectDriver.h b/src/FormXObjectDriver.h index 6116aa90..c59ffada 100644 --- a/src/FormXObjectDriver.h +++ b/src/FormXObjectDriver.h @@ -43,7 +43,7 @@ class FormXObjectDriver : public node::ObjectWrap PDFWriterDriver* mPDFWriterDriver; static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetID(v8::Local property, const PROPERTY_TYPE& info); + static METHOD_RETURN_TYPE GetID(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE& info); static METHOD_RETURN_TYPE GetContentContext(const ARGS_TYPE& args); static METHOD_RETURN_TYPE GetResourcesDictionary(const ARGS_TYPE& args); static METHOD_RETURN_TYPE GetContentStream(const ARGS_TYPE& args); diff --git a/src/ImageXObjectDriver.cpp b/src/ImageXObjectDriver.cpp index 7a2532b9..3ce70691 100644 --- a/src/ImageXObjectDriver.cpp +++ b/src/ImageXObjectDriver.cpp @@ -61,7 +61,7 @@ METHOD_RETURN_TYPE ImageXObjectDriver::New(const ARGS_TYPE& args) SET_FUNCTION_RETURN_VALUE(args.This()) } -METHOD_RETURN_TYPE ImageXObjectDriver::GetID(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE ImageXObjectDriver::GetID(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/ImageXObjectDriver.h b/src/ImageXObjectDriver.h index 8205b9c3..98f6d56b 100644 --- a/src/ImageXObjectDriver.h +++ b/src/ImageXObjectDriver.h @@ -38,5 +38,5 @@ class ImageXObjectDriver : public node::ObjectWrap ImageXObjectDriver(); static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetID(v8::Local property, const PROPERTY_TYPE& info); + static METHOD_RETURN_TYPE GetID(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE& info); }; \ No newline at end of file diff --git a/src/InfoDictionaryDriver.cpp b/src/InfoDictionaryDriver.cpp index 0d953249..80836b19 100644 --- a/src/InfoDictionaryDriver.cpp +++ b/src/InfoDictionaryDriver.cpp @@ -72,7 +72,7 @@ METHOD_RETURN_TYPE InfoDictionaryDriver::New(const ARGS_TYPE& args) SET_FUNCTION_RETURN_VALUE(args.This()) } -METHOD_RETURN_TYPE InfoDictionaryDriver::GetTitle(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE InfoDictionaryDriver::GetTitle(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -88,7 +88,7 @@ METHOD_RETURN_TYPE InfoDictionaryDriver::GetTitle(Local property, const SET_ACCESSOR_RETURN_VALUE(NEW_STRING(infoDictionaryDriver->InfoDictionaryInstance->Title.ToUTF8String().c_str())) } -void InfoDictionaryDriver::SetTitle(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void InfoDictionaryDriver::SetTitle(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; @@ -100,7 +100,7 @@ void InfoDictionaryDriver::SetTitle(Local property, Local value, infoDictionaryDriver->InfoDictionaryInstance->Title.FromUTF8(*UTF_8_VALUE(value->TO_STRING())); } -METHOD_RETURN_TYPE InfoDictionaryDriver::GetAuthor(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE InfoDictionaryDriver::GetAuthor(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -116,7 +116,7 @@ METHOD_RETURN_TYPE InfoDictionaryDriver::GetAuthor(Local property, const SET_ACCESSOR_RETURN_VALUE(NEW_STRING(infoDictionaryDriver->InfoDictionaryInstance->Author.ToUTF8String().c_str())) } -void InfoDictionaryDriver::SetAuthor(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void InfoDictionaryDriver::SetAuthor(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; @@ -128,7 +128,7 @@ void InfoDictionaryDriver::SetAuthor(Local property, Local value, infoDictionaryDriver->InfoDictionaryInstance->Author.FromUTF8(*UTF_8_VALUE(value->TO_STRING())); } -METHOD_RETURN_TYPE InfoDictionaryDriver::GetSubject(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE InfoDictionaryDriver::GetSubject(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -144,7 +144,7 @@ METHOD_RETURN_TYPE InfoDictionaryDriver::GetSubject(Local property, cons SET_ACCESSOR_RETURN_VALUE(NEW_STRING(infoDictionaryDriver->InfoDictionaryInstance->Subject.ToUTF8String().c_str())) } -void InfoDictionaryDriver::SetSubject(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void InfoDictionaryDriver::SetSubject(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; InfoDictionaryDriver* infoDictionaryDriver = ObjectWrap::Unwrap(info.Holder()); @@ -155,7 +155,7 @@ void InfoDictionaryDriver::SetSubject(Local property, Local value infoDictionaryDriver->InfoDictionaryInstance->Subject.FromUTF8(*UTF_8_VALUE(value->TO_STRING())); } -METHOD_RETURN_TYPE InfoDictionaryDriver::GetKeywords(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE InfoDictionaryDriver::GetKeywords(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -171,7 +171,7 @@ METHOD_RETURN_TYPE InfoDictionaryDriver::GetKeywords(Local property, con SET_ACCESSOR_RETURN_VALUE(NEW_STRING(infoDictionaryDriver->InfoDictionaryInstance->Keywords.ToUTF8String().c_str())) } -void InfoDictionaryDriver::SetKeywords(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void InfoDictionaryDriver::SetKeywords(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; InfoDictionaryDriver* infoDictionaryDriver = ObjectWrap::Unwrap(info.Holder()); @@ -182,7 +182,7 @@ void InfoDictionaryDriver::SetKeywords(Local property, Local valu infoDictionaryDriver->InfoDictionaryInstance->Keywords.FromUTF8(*UTF_8_VALUE(value->TO_STRING())); } -METHOD_RETURN_TYPE InfoDictionaryDriver::GetCreator(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE InfoDictionaryDriver::GetCreator(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -198,7 +198,7 @@ METHOD_RETURN_TYPE InfoDictionaryDriver::GetCreator(Local property, cons SET_ACCESSOR_RETURN_VALUE(NEW_STRING(infoDictionaryDriver->InfoDictionaryInstance->Creator.ToUTF8String().c_str())) } -void InfoDictionaryDriver::SetCreator(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void InfoDictionaryDriver::SetCreator(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; InfoDictionaryDriver* infoDictionaryDriver = ObjectWrap::Unwrap(info.Holder()); @@ -209,7 +209,7 @@ void InfoDictionaryDriver::SetCreator(Local property, Local value infoDictionaryDriver->InfoDictionaryInstance->Creator.FromUTF8(*UTF_8_VALUE(value->TO_STRING())); } -METHOD_RETURN_TYPE InfoDictionaryDriver::GetProducer(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE InfoDictionaryDriver::GetProducer(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -225,7 +225,7 @@ METHOD_RETURN_TYPE InfoDictionaryDriver::GetProducer(Local property, con SET_ACCESSOR_RETURN_VALUE(NEW_STRING(infoDictionaryDriver->InfoDictionaryInstance->Producer.ToUTF8String().c_str())) } -void InfoDictionaryDriver::SetProducer(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void InfoDictionaryDriver::SetProducer(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; InfoDictionaryDriver* infoDictionaryDriver = ObjectWrap::Unwrap(info.Holder()); @@ -236,7 +236,7 @@ void InfoDictionaryDriver::SetProducer(Local property, Local valu infoDictionaryDriver->InfoDictionaryInstance->Producer.FromUTF8(*UTF_8_VALUE(value->TO_STRING())); } -METHOD_RETURN_TYPE InfoDictionaryDriver::GetTrapped(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE InfoDictionaryDriver::GetTrapped(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -252,7 +252,7 @@ METHOD_RETURN_TYPE InfoDictionaryDriver::GetTrapped(Local property, cons SET_ACCESSOR_RETURN_VALUE(NEW_NUMBER(infoDictionaryDriver->InfoDictionaryInstance->Trapped)) } -void InfoDictionaryDriver::SetTrapped(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void InfoDictionaryDriver::SetTrapped(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; InfoDictionaryDriver* infoDictionaryDriver = ObjectWrap::Unwrap(info.Holder()); diff --git a/src/InfoDictionaryDriver.h b/src/InfoDictionaryDriver.h index 3a1ff419..71de8cf0 100644 --- a/src/InfoDictionaryDriver.h +++ b/src/InfoDictionaryDriver.h @@ -39,20 +39,20 @@ class InfoDictionaryDriver : public node::ObjectWrap static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetTitle(v8::Local property, const PROPERTY_TYPE &info); - static void SetTitle(v8::Local property,v8::Local value,const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetAuthor(v8::Local property, const PROPERTY_TYPE &info); - static void SetAuthor(v8::Local property, v8::Local value, const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetSubject(v8::Local property, const PROPERTY_TYPE &info); - static void SetSubject(v8::Local property, v8::Local value, const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetKeywords(v8::Local property, const PROPERTY_TYPE &info); - static void SetKeywords(v8::Local property, v8::Local value, const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetCreator(v8::Local property, const PROPERTY_TYPE &info); - static void SetCreator(v8::Local property, v8::Local value, const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetProducer(v8::Local property, const PROPERTY_TYPE &info); - static void SetProducer(v8::Local property, v8::Local value, const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetTrapped(v8::Local property, const PROPERTY_TYPE &info); - static void SetTrapped(v8::Local property, v8::Local value, const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetTitle(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetTitle(SET_ACCESSOR_METHOD_NAME_TYPE property,v8::Local value,const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetAuthor(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetAuthor(SET_ACCESSOR_METHOD_NAME_TYPE property, v8::Local value, const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetSubject(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetSubject(SET_ACCESSOR_METHOD_NAME_TYPE property, v8::Local value, const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetKeywords(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetKeywords(SET_ACCESSOR_METHOD_NAME_TYPE property, v8::Local value, const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetCreator(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetCreator(SET_ACCESSOR_METHOD_NAME_TYPE property, v8::Local value, const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetProducer(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetProducer(SET_ACCESSOR_METHOD_NAME_TYPE property, v8::Local value, const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetTrapped(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetTrapped(SET_ACCESSOR_METHOD_NAME_TYPE property, v8::Local value, const PROPERTY_SETTER_TYPE &info); // for dates i'm giving only setters. it's too bording to provide readers. you are the ones setting it for @#$@# sake. diff --git a/src/PDFBooleanDriver.cpp b/src/PDFBooleanDriver.cpp index 96cd241d..99f5c405 100644 --- a/src/PDFBooleanDriver.cpp +++ b/src/PDFBooleanDriver.cpp @@ -60,7 +60,7 @@ PDFObject* PDFBooleanDriver::GetObject() return TheObject.GetPtr(); } -METHOD_RETURN_TYPE PDFBooleanDriver::GetValue(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFBooleanDriver::GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFBooleanDriver.h b/src/PDFBooleanDriver.h index d256b080..1846080a 100644 --- a/src/PDFBooleanDriver.h +++ b/src/PDFBooleanDriver.h @@ -38,5 +38,5 @@ class PDFBooleanDriver : public PDFObjectDriver static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetValue(v8::Local property, const PROPERTY_TYPE &info); + static METHOD_RETURN_TYPE GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); }; \ No newline at end of file diff --git a/src/PDFHexStringDriver.cpp b/src/PDFHexStringDriver.cpp index 61aff5fe..c0f98ec1 100644 --- a/src/PDFHexStringDriver.cpp +++ b/src/PDFHexStringDriver.cpp @@ -63,7 +63,7 @@ PDFObject* PDFHexStringDriver::GetObject() return TheObject.GetPtr(); } -METHOD_RETURN_TYPE PDFHexStringDriver::GetValue(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFHexStringDriver::GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFHexStringDriver.h b/src/PDFHexStringDriver.h index e67652d8..68c93ffa 100644 --- a/src/PDFHexStringDriver.h +++ b/src/PDFHexStringDriver.h @@ -39,7 +39,7 @@ class PDFHexStringDriver : public PDFObjectDriver static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetValue(v8::Local property, const PROPERTY_TYPE&info); + static METHOD_RETURN_TYPE GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE&info); static METHOD_RETURN_TYPE ToText(const ARGS_TYPE& args); static METHOD_RETURN_TYPE ToBytesArray(const ARGS_TYPE& args); }; \ No newline at end of file diff --git a/src/PDFIntegerDriver.cpp b/src/PDFIntegerDriver.cpp index 5b418b85..cf6e4626 100644 --- a/src/PDFIntegerDriver.cpp +++ b/src/PDFIntegerDriver.cpp @@ -57,7 +57,7 @@ PDFObject* PDFIntegerDriver::GetObject() return TheObject.GetPtr(); } -METHOD_RETURN_TYPE PDFIntegerDriver::GetValue(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFIntegerDriver::GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFIntegerDriver.h b/src/PDFIntegerDriver.h index a3e41c12..a9d6f608 100644 --- a/src/PDFIntegerDriver.h +++ b/src/PDFIntegerDriver.h @@ -37,5 +37,5 @@ class PDFIntegerDriver : public PDFObjectDriver private: static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetValue(v8::Local property, const PROPERTY_TYPE &info); + static METHOD_RETURN_TYPE GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); }; \ No newline at end of file diff --git a/src/PDFLiteralStringDriver.cpp b/src/PDFLiteralStringDriver.cpp index 0cec8a9d..ce99ba75 100644 --- a/src/PDFLiteralStringDriver.cpp +++ b/src/PDFLiteralStringDriver.cpp @@ -64,7 +64,7 @@ PDFObject* PDFLiteralStringDriver::GetObject() return TheObject.GetPtr(); } -METHOD_RETURN_TYPE PDFLiteralStringDriver::GetValue(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFLiteralStringDriver::GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFLiteralStringDriver.h b/src/PDFLiteralStringDriver.h index b35dd6c9..0f043be6 100644 --- a/src/PDFLiteralStringDriver.h +++ b/src/PDFLiteralStringDriver.h @@ -38,7 +38,7 @@ class PDFLiteralStringDriver : public PDFObjectDriver static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetValue(v8::Local property, const PROPERTY_TYPE &info); + static METHOD_RETURN_TYPE GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); static METHOD_RETURN_TYPE ToText(const ARGS_TYPE& args); static METHOD_RETURN_TYPE ToBytesArray(const ARGS_TYPE& args); }; \ No newline at end of file diff --git a/src/PDFNameDriver.cpp b/src/PDFNameDriver.cpp index 01ea12b0..f5969c80 100644 --- a/src/PDFNameDriver.cpp +++ b/src/PDFNameDriver.cpp @@ -59,7 +59,7 @@ PDFObject* PDFNameDriver::GetObject() return TheObject.GetPtr(); } -METHOD_RETURN_TYPE PDFNameDriver::GetValue(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFNameDriver::GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFNameDriver.h b/src/PDFNameDriver.h index d413dd19..838d90e0 100644 --- a/src/PDFNameDriver.h +++ b/src/PDFNameDriver.h @@ -36,5 +36,5 @@ class PDFNameDriver : public PDFObjectDriver private: static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetValue(v8::Local property, const PROPERTY_TYPE &info); + static METHOD_RETURN_TYPE GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); }; \ No newline at end of file diff --git a/src/PDFNullDriver.cpp b/src/PDFNullDriver.cpp index e84043b0..08c062d6 100644 --- a/src/PDFNullDriver.cpp +++ b/src/PDFNullDriver.cpp @@ -60,7 +60,7 @@ PDFObject* PDFNullDriver::GetObject() return TheObject.GetPtr(); } -METHOD_RETURN_TYPE PDFNullDriver::GetValue(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFNullDriver::GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFNullDriver.h b/src/PDFNullDriver.h index 71b30403..fc8cec3e 100644 --- a/src/PDFNullDriver.h +++ b/src/PDFNullDriver.h @@ -37,5 +37,5 @@ class PDFNullDriver : public PDFObjectDriver private: static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetValue(v8::Local property, const PROPERTY_TYPE &info); + static METHOD_RETURN_TYPE GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); }; \ No newline at end of file diff --git a/src/PDFPageDriver.cpp b/src/PDFPageDriver.cpp index 7e352353..c5f34ae3 100644 --- a/src/PDFPageDriver.cpp +++ b/src/PDFPageDriver.cpp @@ -91,7 +91,7 @@ METHOD_RETURN_TYPE PDFPageDriver::New(const ARGS_TYPE& args) SET_FUNCTION_RETURN_VALUE(args.This()) } -METHOD_RETURN_TYPE PDFPageDriver::GetMediaBox(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFPageDriver::GetMediaBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -108,7 +108,7 @@ METHOD_RETURN_TYPE PDFPageDriver::GetMediaBox(Local property, const PROP SET_ACCESSOR_RETURN_VALUE(mediaBox) } -METHOD_RETURN_TYPE PDFPageDriver::GetCropBox(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFPageDriver::GetCropBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -134,7 +134,7 @@ METHOD_RETURN_TYPE PDFPageDriver::GetCropBox(Local property, const PROPE } } -METHOD_RETURN_TYPE PDFPageDriver::GetBleedBox(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFPageDriver::GetBleedBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -160,7 +160,7 @@ METHOD_RETURN_TYPE PDFPageDriver::GetBleedBox(Local property, const PROP } } -METHOD_RETURN_TYPE PDFPageDriver::GetTrimBox(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFPageDriver::GetTrimBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -186,7 +186,7 @@ METHOD_RETURN_TYPE PDFPageDriver::GetTrimBox(Local property, const PROPE } } -METHOD_RETURN_TYPE PDFPageDriver::GetArtBox(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFPageDriver::GetArtBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -212,7 +212,7 @@ METHOD_RETURN_TYPE PDFPageDriver::GetArtBox(Local property, const PROPER } } -void PDFPageDriver::SetMediaBox(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void PDFPageDriver::SetMediaBox(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -232,7 +232,7 @@ void PDFPageDriver::SetMediaBox(Local property, Local value, cons } -METHOD_RETURN_TYPE PDFPageDriver::GetRotate(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFPageDriver::GetRotate(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -252,7 +252,7 @@ METHOD_RETURN_TYPE PDFPageDriver::GetRotate(Local property, const PROPER } } -void PDFPageDriver::SetRotate(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void PDFPageDriver::SetRotate(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -267,7 +267,7 @@ void PDFPageDriver::SetRotate(Local property, Local value, const } -void PDFPageDriver::SetCropBox(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void PDFPageDriver::SetCropBox(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -287,7 +287,7 @@ void PDFPageDriver::SetCropBox(Local property, Local value, const } -void PDFPageDriver::SetBleedBox(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void PDFPageDriver::SetBleedBox(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -307,7 +307,7 @@ void PDFPageDriver::SetBleedBox(Local property, Local value, cons } -void PDFPageDriver::SetTrimBox(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void PDFPageDriver::SetTrimBox(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; @@ -327,7 +327,7 @@ void PDFPageDriver::SetTrimBox(Local property, Local value, const } -void PDFPageDriver::SetArtBox(Local property, Local value, const PROPERTY_SETTER_TYPE &info) +void PDFPageDriver::SetArtBox(SET_ACCESSOR_METHOD_NAME_TYPE property, Local value, const PROPERTY_SETTER_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFPageDriver.h b/src/PDFPageDriver.h index 30a46e45..6a6e84e2 100644 --- a/src/PDFPageDriver.h +++ b/src/PDFPageDriver.h @@ -47,17 +47,17 @@ class PDFPageDriver : public node::ObjectWrap static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetMediaBox(v8::Local property, const PROPERTY_TYPE &info); - static void SetMediaBox(v8::Local property,v8::Local value,const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetBleedBox(v8::Local property, const PROPERTY_TYPE &info); - static void SetBleedBox(v8::Local property,v8::Local value,const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetCropBox(v8::Local property, const PROPERTY_TYPE &info); - static void SetCropBox(v8::Local property,v8::Local value,const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetTrimBox(v8::Local property, const PROPERTY_TYPE &info); - static void SetTrimBox(v8::Local property,v8::Local value,const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetArtBox(v8::Local property, const PROPERTY_TYPE &info); - static void SetArtBox(v8::Local property,v8::Local value,const PROPERTY_SETTER_TYPE &info); - static METHOD_RETURN_TYPE GetRotate(v8::Local property, const PROPERTY_TYPE &info); - static void SetRotate(v8::Local property,v8::Local value,const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetMediaBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetMediaBox(SET_ACCESSOR_METHOD_NAME_TYPE property,v8::Local value,const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetBleedBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetBleedBox(SET_ACCESSOR_METHOD_NAME_TYPE property,v8::Local value,const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetCropBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetCropBox(SET_ACCESSOR_METHOD_NAME_TYPE property,v8::Local value,const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetTrimBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetTrimBox(SET_ACCESSOR_METHOD_NAME_TYPE property,v8::Local value,const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetArtBox(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetArtBox(SET_ACCESSOR_METHOD_NAME_TYPE property,v8::Local value,const PROPERTY_SETTER_TYPE &info); + static METHOD_RETURN_TYPE GetRotate(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); + static void SetRotate(SET_ACCESSOR_METHOD_NAME_TYPE property,v8::Local value,const PROPERTY_SETTER_TYPE &info); static METHOD_RETURN_TYPE GetResourcesDictionary(const ARGS_TYPE& args); }; \ No newline at end of file diff --git a/src/PDFRealDriver.cpp b/src/PDFRealDriver.cpp index f79bdba3..37668dd4 100644 --- a/src/PDFRealDriver.cpp +++ b/src/PDFRealDriver.cpp @@ -58,7 +58,7 @@ PDFObject* PDFRealDriver::GetObject() return TheObject.GetPtr(); } -METHOD_RETURN_TYPE PDFRealDriver::GetValue(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFRealDriver::GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFRealDriver.h b/src/PDFRealDriver.h index 26dc4d5e..c8c22560 100644 --- a/src/PDFRealDriver.h +++ b/src/PDFRealDriver.h @@ -36,5 +36,5 @@ class PDFRealDriver : public PDFObjectDriver private: static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetValue(v8::Local property, const PROPERTY_TYPE &info); + static METHOD_RETURN_TYPE GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); }; \ No newline at end of file diff --git a/src/PDFSymbolDriver.cpp b/src/PDFSymbolDriver.cpp index e1096175..4c241aff 100644 --- a/src/PDFSymbolDriver.cpp +++ b/src/PDFSymbolDriver.cpp @@ -59,7 +59,7 @@ PDFObject* PDFSymbolDriver::GetObject() return TheObject.GetPtr(); } -METHOD_RETURN_TYPE PDFSymbolDriver::GetValue(Local property, const PROPERTY_TYPE &info) +METHOD_RETURN_TYPE PDFSymbolDriver::GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info) { CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; diff --git a/src/PDFSymbolDriver.h b/src/PDFSymbolDriver.h index 4fcae958..de833832 100644 --- a/src/PDFSymbolDriver.h +++ b/src/PDFSymbolDriver.h @@ -36,5 +36,5 @@ class PDFSymbolDriver : public PDFObjectDriver private: static METHOD_RETURN_TYPE New(const ARGS_TYPE& args); - static METHOD_RETURN_TYPE GetValue(v8::Local property, const PROPERTY_TYPE &info); + static METHOD_RETURN_TYPE GetValue(SET_ACCESSOR_METHOD_NAME_TYPE property, const PROPERTY_TYPE &info); }; \ No newline at end of file diff --git a/src/nodes.h b/src/nodes.h index ff49839f..4ccc126b 100644 --- a/src/nodes.h +++ b/src/nodes.h @@ -32,10 +32,12 @@ #define NEW_OBJECT Object::New(isolate) #if NODE_MODULE_VERSION < NODE_21_0_0_MODULE_VERSION #define SET_ACCESSOR_METHOD(t,s,f) t->InstanceTemplate()->SetAccessor(NEW_STRING(s), f); - #define SET_ACCESSOR_METHODS(t,s,f,g) t->InstanceTemplate()->SetAccessor(NEW_STRING(s), f,g); + #define SET_ACCESSOR_METHODS(t,s,f,g) t->InstanceTemplate()->SetAccessor(NEW_STRING(s), f, g); + #define SET_ACCESSOR_METHOD_NAME_TYPE v8::Local #else - #define SET_ACCESSOR_METHOD(t,s,f) t->InstanceTemplate()->SetNativeDataProperty(NEW_STRING(s), NEW_FUNCTION_TEMPLATE(f)) - #define SET_ACCESSOR_METHODS(t,s,f,g) t->InstanceTemplate()->SetNativeDataProperty(NEW_STRING(s), NEW_FUNCTION_TEMPLATE(f), NEW_FUNCTION_TEMPLATE(g)) + #define SET_ACCESSOR_METHOD(t,s,f) t->InstanceTemplate()->SetNativeDataProperty(NEW_STRING(s), f) + #define SET_ACCESSOR_METHODS(t,s,f,g) t->InstanceTemplate()->SetNativeDataProperty(NEW_STRING(s), f, g) + #define SET_ACCESSOR_METHOD_NAME_TYPE v8::Local #endif #define SET_CONSTRUCTOR_EXPORT(s,c) EXPORTS_SET(exports,NEW_STRING(s),c->GetFunction(GET_CURRENT_CONTEXT).ToLocalChecked()) #define SET_PROTOTYPE_METHOD(t, s, f) NODE_SET_PROTOTYPE_METHOD(t,s,f)