From 2da7bd4d78897bed52fe1304694f4e970db65e58 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 17 Feb 2015 13:21:34 -0800 Subject: Tidy up JS_Defines.h This is a purely mechanical change, no new functionality. - Expand some macros which were merely a short-cut to save typing but reduced transparency. - Put GET_VALUE_TYPE() implementation into a .cpp file. This is a portion of the patch from issue 908033002 at patchset 40001 (http://crrev.com/908033002#ps40001) R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/927263003 --- fpdfsdk/src/javascript/Document.cpp | 142 ++++++++++++++-------------- fpdfsdk/src/javascript/Field.cpp | 156 +++++++++++++++---------------- fpdfsdk/src/javascript/Icon.cpp | 2 +- fpdfsdk/src/javascript/PublicMethods.cpp | 44 ++++----- fpdfsdk/src/javascript/app.cpp | 66 ++++++------- fpdfsdk/src/javascript/color.cpp | 6 +- fpdfsdk/src/javascript/console.cpp | 8 +- fpdfsdk/src/javascript/event.cpp | 40 ++++---- fpdfsdk/src/javascript/global.cpp | 27 +++++- fpdfsdk/src/javascript/report.cpp | 4 +- fpdfsdk/src/javascript/util.cpp | 10 +- 11 files changed, 265 insertions(+), 240 deletions(-) (limited to 'fpdfsdk/src/javascript') diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 701107f69f..c9f17ba75c 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -190,7 +190,7 @@ Document::~Document() } //the total number of fileds in document. -FX_BOOL Document::numFields(OBJ_PROP_PARAMS) +FX_BOOL Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting()) return FALSE; @@ -207,7 +207,7 @@ FX_BOOL Document::numFields(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Document::dirty(OBJ_PROP_PARAMS) +FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -233,7 +233,7 @@ FX_BOOL Document::dirty(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Document::ADBE(OBJ_PROP_PARAMS) +FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -248,7 +248,7 @@ FX_BOOL Document::ADBE(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Document::pageNum(OBJ_PROP_PARAMS) +FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -293,31 +293,31 @@ FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj) return TRUE; } -FX_BOOL Document::addAnnot(OBJ_METHOD_PARAMS) +FX_BOOL Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Not supported. return TRUE; } -FX_BOOL Document::addField(OBJ_METHOD_PARAMS) +FX_BOOL Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Not supported. return TRUE; } -FX_BOOL Document::exportAsText(OBJ_METHOD_PARAMS) +FX_BOOL Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Document::exportAsFDF(OBJ_METHOD_PARAMS) +FX_BOOL Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Document::exportAsXFDF(OBJ_METHOD_PARAMS) +FX_BOOL Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; @@ -327,7 +327,7 @@ FX_BOOL Document::exportAsXFDF(OBJ_METHOD_PARAMS) //comment: //note: the paremter cName, this is clue how to treat if the cName is not a valiable filed name in this document -FX_BOOL Document::getField(OBJ_METHOD_PARAMS) +FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = GetIsolate(cc); ASSERT(m_pDocument != NULL); @@ -368,7 +368,7 @@ FX_BOOL Document::getField(OBJ_METHOD_PARAMS) } //Gets the name of the nth field in the document -FX_BOOL Document::getNthFieldName(OBJ_METHOD_PARAMS) +FX_BOOL Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -389,19 +389,19 @@ FX_BOOL Document::getNthFieldName(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::importAnFDF(OBJ_METHOD_PARAMS) +FX_BOOL Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Document::importAnXFDF(OBJ_METHOD_PARAMS) +FX_BOOL Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Document::importTextData(OBJ_METHOD_PARAMS) +FX_BOOL Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; @@ -412,7 +412,7 @@ FX_BOOL Document::importTextData(OBJ_METHOD_PARAMS) //note: //int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,string cSubject,string cms); -FX_BOOL Document::mailForm(OBJ_METHOD_PARAMS) +FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -447,7 +447,7 @@ FX_BOOL Document::mailForm(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::print(OBJ_METHOD_PARAMS) +FX_BOOL Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -524,7 +524,7 @@ FX_BOOL Document::print(OBJ_METHOD_PARAMS) //comment: //note: if the filed name is not retional, adobe is dumb for it. -FX_BOOL Document::removeField(OBJ_METHOD_PARAMS) +FX_BOOL Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -578,7 +578,7 @@ FX_BOOL Document::removeField(OBJ_METHOD_PARAMS) //comment: //note: if the fields names r not rational, aodbe is dumb for it. -FX_BOOL Document::resetForm(OBJ_METHOD_PARAMS) +FX_BOOL Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -639,14 +639,14 @@ FX_BOOL Document::resetForm(OBJ_METHOD_PARAMS) } -FX_BOOL Document::saveAs(OBJ_METHOD_PARAMS) +FX_BOOL Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Document::submitForm(OBJ_METHOD_PARAMS) +FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -773,12 +773,12 @@ FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFo return FALSE; } -FX_BOOL Document::bookmarkRoot(OBJ_PROP_PARAMS) +FX_BOOL Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::mailDoc(OBJ_METHOD_PARAMS) +FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -836,7 +836,7 @@ FX_BOOL Document::mailDoc(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::author(OBJ_PROP_PARAMS) +FX_BOOL Document::author(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -860,7 +860,7 @@ FX_BOOL Document::author(OBJ_PROP_PARAMS) } } -FX_BOOL Document::info(OBJ_PROP_PARAMS) +FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -919,7 +919,7 @@ FX_BOOL Document::info(OBJ_PROP_PARAMS) } } -FX_BOOL Document::creationDate(OBJ_PROP_PARAMS) +FX_BOOL Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -944,7 +944,7 @@ FX_BOOL Document::creationDate(OBJ_PROP_PARAMS) } } -FX_BOOL Document::creator(OBJ_PROP_PARAMS) +FX_BOOL Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -968,7 +968,7 @@ FX_BOOL Document::creator(OBJ_PROP_PARAMS) } } -FX_BOOL Document::delay(OBJ_PROP_PARAMS) +FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -1010,7 +1010,7 @@ FX_BOOL Document::delay(OBJ_PROP_PARAMS) } } -FX_BOOL Document::keywords(OBJ_PROP_PARAMS) +FX_BOOL Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1034,7 +1034,7 @@ FX_BOOL Document::keywords(OBJ_PROP_PARAMS) } } -FX_BOOL Document::modDate(OBJ_PROP_PARAMS) +FX_BOOL Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1058,7 +1058,7 @@ FX_BOOL Document::modDate(OBJ_PROP_PARAMS) } } -FX_BOOL Document::producer(OBJ_PROP_PARAMS) +FX_BOOL Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1082,7 +1082,7 @@ FX_BOOL Document::producer(OBJ_PROP_PARAMS) } } -FX_BOOL Document::subject(OBJ_PROP_PARAMS) +FX_BOOL Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1106,7 +1106,7 @@ FX_BOOL Document::subject(OBJ_PROP_PARAMS) } } -FX_BOOL Document::title(OBJ_PROP_PARAMS) +FX_BOOL Document::title(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1133,7 +1133,7 @@ FX_BOOL Document::title(OBJ_PROP_PARAMS) } } -FX_BOOL Document::numPages(OBJ_PROP_PARAMS) +FX_BOOL Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -1147,14 +1147,14 @@ FX_BOOL Document::numPages(OBJ_PROP_PARAMS) } } -FX_BOOL Document::external(OBJ_PROP_PARAMS) +FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { //In Chrome case,should always return true. vp << TRUE; return TRUE; } -FX_BOOL Document::filesize(OBJ_PROP_PARAMS) +FX_BOOL Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -1162,17 +1162,17 @@ FX_BOOL Document::filesize(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Document::mouseX(OBJ_PROP_PARAMS) +FX_BOOL Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::mouseY(OBJ_PROP_PARAMS) +FX_BOOL Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::baseURL(OBJ_PROP_PARAMS) +FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -1186,7 +1186,7 @@ FX_BOOL Document::baseURL(OBJ_PROP_PARAMS) } } -FX_BOOL Document::calculate(OBJ_PROP_PARAMS) +FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1211,7 +1211,7 @@ FX_BOOL Document::calculate(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Document::documentFileName(OBJ_PROP_PARAMS) +FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting()) return FALSE; @@ -1280,7 +1280,7 @@ CFX_WideString Document::CutString(CFX_WideString cbFrom) return cbRet; } -FX_BOOL Document::path(OBJ_PROP_PARAMS) +FX_BOOL Document::path(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting()) return FALSE; @@ -1289,22 +1289,22 @@ FX_BOOL Document::path(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Document::pageWindowRect(OBJ_PROP_PARAMS) +FX_BOOL Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::layout(OBJ_PROP_PARAMS) +FX_BOOL Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::addLink(OBJ_METHOD_PARAMS) +FX_BOOL Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::closeDoc(OBJ_METHOD_PARAMS) +FX_BOOL Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1315,41 +1315,41 @@ FX_BOOL Document::closeDoc(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::getPageBox(OBJ_METHOD_PARAMS) +FX_BOOL Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::getAnnot(OBJ_METHOD_PARAMS) +FX_BOOL Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::getAnnots(OBJ_METHOD_PARAMS) +FX_BOOL Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { vRet.SetNull(); return TRUE; } -FX_BOOL Document::getAnnot3D(OBJ_METHOD_PARAMS) +FX_BOOL Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { vRet.SetNull(); return TRUE; } -FX_BOOL Document::getAnnots3D(OBJ_METHOD_PARAMS) +FX_BOOL Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { vRet = VT_undefined; return TRUE; } -FX_BOOL Document::getOCGs(OBJ_METHOD_PARAMS) +FX_BOOL Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::getLinks(OBJ_METHOD_PARAMS) +FX_BOOL Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } @@ -1460,7 +1460,7 @@ void IconTree::DeleteIconElement(CFX_WideString swIconName) } } -FX_BOOL Document::addIcon(OBJ_METHOD_PARAMS) +FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() != 2)return FALSE; @@ -1489,7 +1489,7 @@ FX_BOOL Document::addIcon(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::icons(OBJ_PROP_PARAMS) +FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsSetting()) return FALSE; @@ -1529,7 +1529,7 @@ FX_BOOL Document::icons(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Document::getIcon(OBJ_METHOD_PARAMS) +FX_BOOL Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() != 1)return FALSE; if(!m_pIconTree) @@ -1565,7 +1565,7 @@ FX_BOOL Document::getIcon(OBJ_METHOD_PARAMS) return FALSE; } -FX_BOOL Document::removeIcon(OBJ_METHOD_PARAMS) +FX_BOOL Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() != 1)return FALSE; if(!m_pIconTree) @@ -1574,18 +1574,18 @@ FX_BOOL Document::removeIcon(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::createDataObject(OBJ_METHOD_PARAMS) +FX_BOOL Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not implemented. return TRUE; } -FX_BOOL Document::media(OBJ_PROP_PARAMS) +FX_BOOL Document::media(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::calculateNow(OBJ_METHOD_PARAMS) +FX_BOOL Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1599,12 +1599,12 @@ FX_BOOL Document::calculateNow(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::Collab(OBJ_PROP_PARAMS) +FX_BOOL Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::getPageNthWord(OBJ_METHOD_PARAMS) +FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1666,7 +1666,7 @@ FX_BOOL Document::getPageNthWord(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::getPageNthWordQuads(OBJ_METHOD_PARAMS) +FX_BOOL Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1675,7 +1675,7 @@ FX_BOOL Document::getPageNthWordQuads(OBJ_METHOD_PARAMS) return FALSE; } -FX_BOOL Document::getPageNumWords(OBJ_METHOD_PARAMS) +FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1721,7 +1721,7 @@ FX_BOOL Document::getPageNumWords(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::getPrintParams(OBJ_METHOD_PARAMS) +FX_BOOL Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -1811,7 +1811,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex return swRet; } -FX_BOOL Document::zoom(OBJ_PROP_PARAMS) +FX_BOOL Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; @@ -1827,12 +1827,12 @@ FX_BOOL Document::zoom(OBJ_PROP_PARAMS) (refW, ReflowWidth) */ -FX_BOOL Document::zoomType(OBJ_PROP_PARAMS) +FX_BOOL Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Document::deletePages(OBJ_METHOD_PARAMS) +FX_BOOL Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = GetIsolate(cc); ASSERT(m_pDocument != NULL); @@ -1885,25 +1885,25 @@ FX_BOOL Document::deletePages(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Document::extractPages(OBJ_METHOD_PARAMS) +FX_BOOL Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Document::insertPages(OBJ_METHOD_PARAMS) +FX_BOOL Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Document::replacePages(OBJ_METHOD_PARAMS) +FX_BOOL Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Document::getURL(OBJ_METHOD_PARAMS) +FX_BOOL Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 7a9f9a0a14..e75b6dcbc1 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -377,7 +377,7 @@ CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField) /* ---------------------------------------- property ---------------------------------------- */ -FX_BOOL Field::alignment(OBJ_PROP_PARAMS) +FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -437,7 +437,7 @@ void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::borderStyle(OBJ_PROP_PARAMS) +FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -558,7 +558,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw } } -FX_BOOL Field::buttonAlignX(OBJ_PROP_PARAMS) +FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -609,7 +609,7 @@ void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& s //Not supported. } -FX_BOOL Field::buttonAlignY(OBJ_PROP_PARAMS) +FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -660,7 +660,7 @@ void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& s //Not supported. } -FX_BOOL Field::buttonFitBounds(OBJ_PROP_PARAMS) +FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -707,7 +707,7 @@ void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString //Not supported. } -FX_BOOL Field::buttonPosition(OBJ_PROP_PARAMS) +FX_BOOL Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -752,7 +752,7 @@ void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& //Not supported. } -FX_BOOL Field::buttonScaleHow(OBJ_PROP_PARAMS) +FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -802,7 +802,7 @@ void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& //Not supported. } -FX_BOOL Field::buttonScaleWhen(OBJ_PROP_PARAMS) +FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -864,7 +864,7 @@ void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString //Not supported. } -FX_BOOL Field::calcOrderIndex(OBJ_PROP_PARAMS) +FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -913,7 +913,7 @@ void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& //Not supported. } -FX_BOOL Field::charLimit(OBJ_PROP_PARAMS) +FX_BOOL Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -955,7 +955,7 @@ void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::comb(OBJ_PROP_PARAMS) +FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1001,7 +1001,7 @@ void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa //Not supported. } -FX_BOOL Field::commitOnSelChange(OBJ_PROP_PARAMS) +FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1047,7 +1047,7 @@ void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideStri //Not supported. } -FX_BOOL Field::currentValueIndices(OBJ_PROP_PARAMS) +FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1152,7 +1152,7 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideSt } } -FX_BOOL Field::defaultStyle(OBJ_PROP_PARAMS) +FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { // MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT); return FALSE; @@ -1175,7 +1175,7 @@ void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& s //Not supported. } -FX_BOOL Field::defaultValue(OBJ_PROP_PARAMS) +FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1219,7 +1219,7 @@ void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& s //Not supported. } -FX_BOOL Field::doNotScroll(OBJ_PROP_PARAMS) +FX_BOOL Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1265,7 +1265,7 @@ void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& sw //Not supported. } -FX_BOOL Field::doNotSpellCheck(OBJ_PROP_PARAMS) +FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1309,7 +1309,7 @@ void Field::SetDelay(FX_BOOL bDelay) } } -FX_BOOL Field::delay(OBJ_PROP_PARAMS) +FX_BOOL Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsSetting()) { @@ -1327,7 +1327,7 @@ FX_BOOL Field::delay(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::display(OBJ_PROP_PARAMS) +FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1498,7 +1498,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel } } -FX_BOOL Field::doc(OBJ_PROP_PARAMS) +FX_BOOL Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pJSDoc != NULL); @@ -1509,7 +1509,7 @@ FX_BOOL Field::doc(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::editable(OBJ_PROP_PARAMS) +FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1542,7 +1542,7 @@ FX_BOOL Field::editable(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::exportValues(OBJ_PROP_PARAMS) +FX_BOOL Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1591,7 +1591,7 @@ FX_BOOL Field::exportValues(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::fileSelect(OBJ_PROP_PARAMS) +FX_BOOL Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1624,7 +1624,7 @@ FX_BOOL Field::fileSelect(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::fillColor(OBJ_PROP_PARAMS) +FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1702,7 +1702,7 @@ void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::hidden(OBJ_PROP_PARAMS) +FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1833,7 +1833,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField } } -FX_BOOL Field::highlight(OBJ_PROP_PARAMS) +FX_BOOL Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1897,7 +1897,7 @@ void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::lineWidth(OBJ_PROP_PARAMS) +FX_BOOL Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -1995,7 +1995,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi } } -FX_BOOL Field::multiline(OBJ_PROP_PARAMS) +FX_BOOL Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2041,7 +2041,7 @@ void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::multipleSelection(OBJ_PROP_PARAMS) +FX_BOOL Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2087,7 +2087,7 @@ void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideStri //Not supported. } -FX_BOOL Field::name(OBJ_PROP_PARAMS) +FX_BOOL Field::name(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting()) return FALSE; @@ -2100,7 +2100,7 @@ FX_BOOL Field::name(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::numItems(OBJ_PROP_PARAMS) +FX_BOOL Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); @@ -2120,7 +2120,7 @@ FX_BOOL Field::numItems(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::page(OBJ_PROP_PARAMS) +FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting()) return FALSE; @@ -2165,7 +2165,7 @@ FX_BOOL Field::page(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::password(OBJ_PROP_PARAMS) +FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2211,7 +2211,7 @@ void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::print(OBJ_PROP_PARAMS) +FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2298,7 +2298,7 @@ FX_BOOL Field::print(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::radiosInUnison(OBJ_PROP_PARAMS) +FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2331,7 +2331,7 @@ FX_BOOL Field::radiosInUnison(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::readonly(OBJ_PROP_PARAMS) +FX_BOOL Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2361,7 +2361,7 @@ FX_BOOL Field::readonly(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::rect(OBJ_PROP_PARAMS) +FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2516,7 +2516,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa } } -FX_BOOL Field::required(OBJ_PROP_PARAMS) +FX_BOOL Field::required(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2550,7 +2550,7 @@ FX_BOOL Field::required(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::richText(OBJ_PROP_PARAMS) +FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2596,7 +2596,7 @@ void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::richValue(OBJ_PROP_PARAMS) +FX_BOOL Field::richValue(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; if (vp.IsSetting()) @@ -2616,7 +2616,7 @@ void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::rotation(OBJ_PROP_PARAMS) +FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2659,7 +2659,7 @@ void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::strokeColor(OBJ_PROP_PARAMS) +FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2738,7 +2738,7 @@ void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& sw //Not supported. } -FX_BOOL Field::style(OBJ_PROP_PARAMS) +FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2810,12 +2810,12 @@ void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN //Not supported. } -FX_BOOL Field::submitName(OBJ_PROP_PARAMS) +FX_BOOL Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Field::textColor(OBJ_PROP_PARAMS) +FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2878,7 +2878,7 @@ void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFi //Not supported. } -FX_BOOL Field::textFont(OBJ_PROP_PARAMS) +FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2935,7 +2935,7 @@ void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::textSize(OBJ_PROP_PARAMS) +FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -2984,7 +2984,7 @@ void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::type(OBJ_PROP_PARAMS) +FX_BOOL Field::type(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3031,7 +3031,7 @@ FX_BOOL Field::type(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL Field::userName(OBJ_PROP_PARAMS) +FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3071,7 +3071,7 @@ void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFie //Not supported. } -FX_BOOL Field::value(OBJ_PROP_PARAMS) +FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3291,7 +3291,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN } } -FX_BOOL Field::valueAsString(OBJ_PROP_PARAMS) +FX_BOOL Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3341,7 +3341,7 @@ FX_BOOL Field::valueAsString(OBJ_PROP_PARAMS) /* --------------------------------- methods --------------------------------- */ -FX_BOOL Field::browseForFileToSubmit(OBJ_METHOD_PARAMS) +FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3372,7 +3372,7 @@ FX_BOOL Field::browseForFileToSubmit(OBJ_METHOD_PARAMS) } -FX_BOOL Field::buttonGetCaption(OBJ_METHOD_PARAMS) +FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3408,7 +3408,7 @@ FX_BOOL Field::buttonGetCaption(OBJ_METHOD_PARAMS) //#pragma warning(disable: 4800) -FX_BOOL Field::buttonGetIcon(OBJ_METHOD_PARAMS) +FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3463,7 +3463,7 @@ FX_BOOL Field::buttonGetIcon(OBJ_METHOD_PARAMS) //#pragma warning(default: 4800) -FX_BOOL Field::buttonImportIcon(OBJ_METHOD_PARAMS) +FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { #if 0 ASSERT(m_pDocument != NULL); @@ -3506,17 +3506,17 @@ FX_BOOL Field::buttonImportIcon(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Field::buttonSetCaption(OBJ_METHOD_PARAMS) +FX_BOOL Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::buttonSetIcon(OBJ_METHOD_PARAMS) +FX_BOOL Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::checkThisBox(OBJ_METHOD_PARAMS) +FX_BOOL Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3554,12 +3554,12 @@ FX_BOOL Field::checkThisBox(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Field::clearItems(OBJ_METHOD_PARAMS) +FX_BOOL Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Field::defaultIsChecked(OBJ_METHOD_PARAMS) +FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3599,7 +3599,7 @@ FX_BOOL Field::defaultIsChecked(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Field::deleteItemAt(OBJ_METHOD_PARAMS) +FX_BOOL Field::deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } @@ -3613,7 +3613,7 @@ int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2) } -FX_BOOL Field::getArray(OBJ_METHOD_PARAMS) +FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3666,7 +3666,7 @@ FX_BOOL Field::getArray(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Field::getItemAt(OBJ_METHOD_PARAMS) +FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3709,17 +3709,17 @@ FX_BOOL Field::getItemAt(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Field::getLock(OBJ_METHOD_PARAMS) +FX_BOOL Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::insertItemAt(OBJ_METHOD_PARAMS) +FX_BOOL Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Field::isBoxChecked(OBJ_METHOD_PARAMS) +FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3754,7 +3754,7 @@ FX_BOOL Field::isBoxChecked(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Field::isDefaultChecked(OBJ_METHOD_PARAMS) +FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3788,12 +3788,12 @@ FX_BOOL Field::isDefaultChecked(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Field::setAction(OBJ_METHOD_PARAMS) +FX_BOOL Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Field::setFocus(OBJ_METHOD_PARAMS) +FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { ASSERT(m_pDocument != NULL); @@ -3847,47 +3847,47 @@ FX_BOOL Field::setFocus(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL Field::setItems(OBJ_METHOD_PARAMS) +FX_BOOL Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL Field::setLock(OBJ_METHOD_PARAMS) +FX_BOOL Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::signatureGetModifications(OBJ_METHOD_PARAMS) +FX_BOOL Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::signatureGetSeedValue(OBJ_METHOD_PARAMS) +FX_BOOL Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::signatureInfo(OBJ_METHOD_PARAMS) +FX_BOOL Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::signatureSetSeedValue(OBJ_METHOD_PARAMS) +FX_BOOL Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::signatureSign(OBJ_METHOD_PARAMS) +FX_BOOL Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::signatureValidate(OBJ_METHOD_PARAMS) +FX_BOOL Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL Field::source(OBJ_PROP_PARAMS) +FX_BOOL Field::source(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp index 286980c205..333d1f864a 100644 --- a/fpdfsdk/src/javascript/Icon.cpp +++ b/fpdfsdk/src/javascript/Icon.cpp @@ -57,7 +57,7 @@ CFX_WideString Icon::GetIconName() return m_swIconName; } -FX_BOOL Icon::name(OBJ_PROP_PARAMS) +FX_BOOL Icon::name(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if(!vp.IsGetting())return FALSE; diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index 3eb8a09ee7..9affe41576 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -1050,7 +1050,7 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideStr /* -------------------------------------------------------------------------- */ //function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) -FX_BOOL CJS_PublicMethods::AFNumber_Format(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { #if _FX_OS_ != _FX_ANDROID_ v8::Isolate* isolate = ::GetIsolate(cc); @@ -1259,7 +1259,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(OBJ_METHOD_PARAMS) } //function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) -FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1391,7 +1391,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(OBJ_METHOD_PARAMS) } //function AFPercent_Format(nDec, sepStyle) -FX_BOOL CJS_PublicMethods::AFPercent_Format(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { #if _FX_OS_ != _FX_ANDROID_ CJS_Context* pContext = (CJS_Context *)cc; @@ -1510,13 +1510,13 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(OBJ_METHOD_PARAMS) return TRUE; } //AFPercent_Keystroke(nDec, sepStyle) -FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return AFNumber_Keystroke(cc,params,vRet,sError); } //function AFDate_FormatEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_FormatEx(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1625,7 +1625,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) } //AFDate_KeystrokeEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1661,7 +1661,7 @@ FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL CJS_PublicMethods::AFDate_Format(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -1692,7 +1692,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(OBJ_METHOD_PARAMS) } //AFDate_KeystrokeEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_Keystroke(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -1723,7 +1723,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(OBJ_METHOD_PARAMS) } //function AFTime_Format(ptf) -FX_BOOL CJS_PublicMethods::AFTime_Format(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -1750,7 +1750,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(OBJ_METHOD_PARAMS) return AFDate_FormatEx(cc,newParams,vRet,sError); } -FX_BOOL CJS_PublicMethods::AFTime_Keystroke(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); if (params.size() != 1) @@ -1776,18 +1776,18 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(OBJ_METHOD_PARAMS) return AFDate_KeystrokeEx(cc,newParams,vRet,sError); } -FX_BOOL CJS_PublicMethods::AFTime_FormatEx(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return AFDate_FormatEx(cc,params,vRet,sError); } -FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return AFDate_KeystrokeEx(cc,params,vRet,sError); } //function AFSpecial_Format(psf) -FX_BOOL CJS_PublicMethods::AFSpecial_Format(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1840,7 +1840,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(OBJ_METHOD_PARAMS) //function AFSpecial_KeystrokeEx(mask) -FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -1940,7 +1940,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(OBJ_METHOD_PARAMS) //function AFSpecial_Keystroke(psf) -FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -1999,7 +1999,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(OBJ_METHOD_PARAMS) return AFSpecial_KeystrokeEx(cc,params2,vRet,sError); } -FX_BOOL CJS_PublicMethods::AFMergeChange(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -2039,7 +2039,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL CJS_PublicMethods::AFParseDateEx(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -2069,7 +2069,7 @@ FX_BOOL CJS_PublicMethods::AFParseDateEx(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL CJS_PublicMethods::AFSimple(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() != 3) { @@ -2084,7 +2084,7 @@ FX_BOOL CJS_PublicMethods::AFSimple(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL CJS_PublicMethods::AFMakeNumber(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() != 1) { @@ -2098,7 +2098,7 @@ FX_BOOL CJS_PublicMethods::AFMakeNumber(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL CJS_PublicMethods::AFSimple_Calculate(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); @@ -2222,7 +2222,7 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(OBJ_METHOD_PARAMS) /* This function validates the current event to ensure that its value is ** within the specified range. */ -FX_BOOL CJS_PublicMethods::AFRange_Validate(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context *)cc; ASSERT(pContext != NULL); @@ -2272,7 +2272,7 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL CJS_PublicMethods::AFExtractNums(OBJ_METHOD_PARAMS) +FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = ::GetIsolate(cc); CJS_Context* pContext = (CJS_Context*)cc; diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index c1dd41faff..ccdd8ab3df 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -133,7 +133,7 @@ app::~app(void) m_aTimer.RemoveAll(); } -FX_BOOL app::activeDocs(OBJ_PROP_PARAMS) +FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -191,7 +191,7 @@ FX_BOOL app::activeDocs(OBJ_PROP_PARAMS) return FALSE; } -FX_BOOL app::calculate(OBJ_PROP_PARAMS) +FX_BOOL app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsSetting()) { @@ -229,7 +229,7 @@ FX_BOOL app::calculate(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL app::formsVersion(OBJ_PROP_PARAMS) +FX_BOOL app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -240,7 +240,7 @@ FX_BOOL app::formsVersion(OBJ_PROP_PARAMS) return FALSE; } -FX_BOOL app::viewerType(OBJ_PROP_PARAMS) +FX_BOOL app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -251,7 +251,7 @@ FX_BOOL app::viewerType(OBJ_PROP_PARAMS) return FALSE; } -FX_BOOL app::viewerVariation(OBJ_PROP_PARAMS) +FX_BOOL app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -262,7 +262,7 @@ FX_BOOL app::viewerVariation(OBJ_PROP_PARAMS) return FALSE; } -FX_BOOL app::viewerVersion(OBJ_PROP_PARAMS) +FX_BOOL app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -273,7 +273,7 @@ FX_BOOL app::viewerVersion(OBJ_PROP_PARAMS) return FALSE; } -FX_BOOL app::platform(OBJ_PROP_PARAMS) +FX_BOOL app::platform(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -284,7 +284,7 @@ FX_BOOL app::platform(OBJ_PROP_PARAMS) return FALSE; } -FX_BOOL app::language(OBJ_PROP_PARAMS) +FX_BOOL app::language(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsGetting()) { @@ -299,7 +299,7 @@ FX_BOOL app::language(OBJ_PROP_PARAMS) //comment: need reader support //note: //CFDF_Document * CPDFDoc_Environment::NewFDF(); -FX_BOOL app::newFDF(OBJ_METHOD_PARAMS) +FX_BOOL app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } @@ -308,12 +308,12 @@ FX_BOOL app::newFDF(OBJ_METHOD_PARAMS) //note: as defined in js reference, the proto of this function's fourth parmeters, how old an fdf document while do not show it. //CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv); -FX_BOOL app::openFDF(OBJ_METHOD_PARAMS) +FX_BOOL app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL app::alert(OBJ_METHOD_PARAMS) +FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { int iSize = params.size(); if (iSize < 1) @@ -438,7 +438,7 @@ FX_BOOL app::alert(OBJ_METHOD_PARAMS) } -FX_BOOL app::beep(OBJ_METHOD_PARAMS) +FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() == 1) { @@ -456,22 +456,22 @@ FX_BOOL app::beep(OBJ_METHOD_PARAMS) } } -FX_BOOL app::findComponent(OBJ_METHOD_PARAMS) +FX_BOOL app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } -FX_BOOL app::popUpMenuEx(OBJ_METHOD_PARAMS) +FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL app::fs(OBJ_PROP_PARAMS) +FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return FALSE; } -FX_BOOL app::setInterval(OBJ_METHOD_PARAMS) +FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() > 2 || params.size() == 0) { @@ -520,7 +520,7 @@ FX_BOOL app::setInterval(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS) +FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() > 2 || params.size() == 0) { @@ -571,7 +571,7 @@ FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS) +FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -619,7 +619,7 @@ FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS) +FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -667,7 +667,7 @@ FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL app::execMenuItem(OBJ_METHOD_PARAMS) +FX_BOOL app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } @@ -707,19 +707,19 @@ void app::RunJsScript(CJS_Runtime* pRuntime,const CFX_WideString& wsScript) } } -FX_BOOL app::goBack(OBJ_METHOD_PARAMS) +FX_BOOL app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Not supported. return TRUE; } -FX_BOOL app::goForward(OBJ_METHOD_PARAMS) +FX_BOOL app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Not supported. return TRUE; } -FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS) +FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -783,13 +783,13 @@ FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS) return FALSE; } -FX_BOOL app::launchURL(OBJ_METHOD_PARAMS) +FX_BOOL app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL app::runtimeHighlight(OBJ_PROP_PARAMS) +FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (vp.IsSetting()) { @@ -803,18 +803,18 @@ FX_BOOL app::runtimeHighlight(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL app::fullscreen(OBJ_PROP_PARAMS) +FX_BOOL app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return FALSE; } -FX_BOOL app::popUpMenu(OBJ_METHOD_PARAMS) +FX_BOOL app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL app::browseForDoc(OBJ_METHOD_PARAMS) +FX_BOOL app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; @@ -846,17 +846,17 @@ CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) return sRet; } -FX_BOOL app::newDoc(OBJ_METHOD_PARAMS) +FX_BOOL app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL app::openDoc(OBJ_METHOD_PARAMS) +FX_BOOL app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return FALSE; } -FX_BOOL app::response(OBJ_METHOD_PARAMS) +FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { CFX_WideString swQuestion = L""; CFX_WideString swLabel = L""; @@ -936,12 +936,12 @@ FX_BOOL app::response(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL app::media(OBJ_PROP_PARAMS) +FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return FALSE; } -FX_BOOL app::execDialog(OBJ_METHOD_PARAMS) +FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp index 3841706743..536a64e610 100644 --- a/fpdfsdk/src/javascript/color.cpp +++ b/fpdfsdk/src/javascript/color.cpp @@ -156,7 +156,7 @@ void color::ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color) } #define JS_IMPLEMENT_COLORPROP(prop, var)\ -FX_BOOL color::prop(OBJ_PROP_PARAMS)\ +FX_BOOL color::prop(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError)\ {\ CJS_Context* pContext = (CJS_Context*)cc;\ v8::Isolate* isolate = pContext->GetJSRuntime()->GetIsolate();\ @@ -188,7 +188,7 @@ JS_IMPLEMENT_COLORPROP(dkGray, m_crDKGray) JS_IMPLEMENT_COLORPROP(gray, m_crGray) JS_IMPLEMENT_COLORPROP(ltGray, m_crLTGray) -FX_BOOL color::convert(OBJ_METHOD_PARAMS) +FX_BOOL color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = GetIsolate(cc); int iSize = params.size(); @@ -229,7 +229,7 @@ FX_BOOL color::convert(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL color::equal(OBJ_METHOD_PARAMS) +FX_BOOL color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = GetIsolate(cc); if (params.size() < 2) return FALSE; diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp index 350b4e1dcc..d79ac3405d 100644 --- a/fpdfsdk/src/javascript/console.cpp +++ b/fpdfsdk/src/javascript/console.cpp @@ -42,7 +42,7 @@ console::~console() { } -FX_BOOL console::clear(OBJ_METHOD_PARAMS) +FX_BOOL console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { @@ -50,7 +50,7 @@ FX_BOOL console::clear(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL console::hide(OBJ_METHOD_PARAMS) +FX_BOOL console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { @@ -59,7 +59,7 @@ FX_BOOL console::hide(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL console::println(OBJ_METHOD_PARAMS) +FX_BOOL console::println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() < 1) { @@ -69,7 +69,7 @@ FX_BOOL console::println(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL console::show(OBJ_METHOD_PARAMS) +FX_BOOL console::show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { return TRUE; } diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp index 5188765a04..196ab327d8 100644 --- a/fpdfsdk/src/javascript/event.cpp +++ b/fpdfsdk/src/javascript/event.cpp @@ -56,7 +56,7 @@ event::~event(void) { } -FX_BOOL event::change(OBJ_PROP_PARAMS) +FX_BOOL event::change(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -76,7 +76,7 @@ FX_BOOL event::change(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::changeEx(OBJ_PROP_PARAMS) +FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -89,7 +89,7 @@ FX_BOOL event::changeEx(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::commitKey(OBJ_PROP_PARAMS) +FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -102,7 +102,7 @@ FX_BOOL event::commitKey(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::fieldFull(OBJ_PROP_PARAMS) +FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -119,7 +119,7 @@ FX_BOOL event::fieldFull(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::keyDown(OBJ_PROP_PARAMS) +FX_BOOL event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -135,7 +135,7 @@ FX_BOOL event::keyDown(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::modifier(OBJ_PROP_PARAMS) +FX_BOOL event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -151,7 +151,7 @@ FX_BOOL event::modifier(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::name(OBJ_PROP_PARAMS) +FX_BOOL event::name(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -164,7 +164,7 @@ FX_BOOL event::name(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::rc(OBJ_PROP_PARAMS) +FX_BOOL event::rc(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -183,7 +183,7 @@ FX_BOOL event::rc(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::richChange(OBJ_PROP_PARAMS) +FX_BOOL event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; if (vp.IsSetting()) @@ -196,7 +196,7 @@ FX_BOOL event::richChange(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::richChangeEx(OBJ_PROP_PARAMS) +FX_BOOL event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; if (vp.IsSetting()) @@ -210,7 +210,7 @@ FX_BOOL event::richChangeEx(OBJ_PROP_PARAMS) } -FX_BOOL event::richValue(OBJ_PROP_PARAMS) +FX_BOOL event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { return TRUE; if (vp.IsSetting()) @@ -223,7 +223,7 @@ FX_BOOL event::richValue(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::selEnd(OBJ_PROP_PARAMS) +FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -247,7 +247,7 @@ FX_BOOL event::selEnd(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::selStart(OBJ_PROP_PARAMS) +FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -270,7 +270,7 @@ FX_BOOL event::selStart(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::shift(OBJ_PROP_PARAMS) +FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -286,7 +286,7 @@ FX_BOOL event::shift(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::source(OBJ_PROP_PARAMS) +FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -299,7 +299,7 @@ FX_BOOL event::source(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::target(OBJ_PROP_PARAMS) +FX_BOOL event::target(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -312,7 +312,7 @@ FX_BOOL event::target(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::targetName(OBJ_PROP_PARAMS) +FX_BOOL event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -325,7 +325,7 @@ FX_BOOL event::targetName(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::type(OBJ_PROP_PARAMS) +FX_BOOL event::type(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; @@ -338,7 +338,7 @@ FX_BOOL event::type(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::value(OBJ_PROP_PARAMS) +FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -361,7 +361,7 @@ FX_BOOL event::value(OBJ_PROP_PARAMS) return TRUE; } -FX_BOOL event::willCommit(OBJ_PROP_PARAMS) +FX_BOOL event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) { if (!vp.IsGetting())return FALSE; diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index b45fd04558..587ba85219 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -268,7 +268,7 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS return FALSE; } -FX_BOOL global_alternate::setPersistent(OBJ_METHOD_PARAMS) +FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { if (params.size() != 2) { @@ -615,3 +615,28 @@ FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR propname, int nType, return TRUE; } + +FXJSVALUETYPE GET_VALUE_TYPE(v8::Handle p) +{ + const unsigned int nHash = JS_CalcHash(JS_GetTypeof(p)); + + if (nHash == JSCONST_nUndefHash) + return VT_undefined; + if (nHash == JSCONST_nNullHash) + return VT_null; + if (nHash == JSCONST_nStringHash) + return VT_string; + if (nHash == JSCONST_nNumberHash) + return VT_number; + if (nHash == JSCONST_nBoolHash) + return VT_boolean; + if (nHash == JSCONST_nDateHash) + return VT_date; + if (nHash == JSCONST_nObjectHash) + return VT_object; + if (nHash == JSCONST_nFXobjHash) + return VT_fxobject; + + return VT_unknown; +} + diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp index 189ab87d32..24b7aee405 100644 --- a/fpdfsdk/src/javascript/report.cpp +++ b/fpdfsdk/src/javascript/report.cpp @@ -36,13 +36,13 @@ Report::~Report() } -FX_BOOL Report::writeText(OBJ_METHOD_PARAMS) +FX_BOOL Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; } -FX_BOOL Report::save(OBJ_METHOD_PARAMS) +FX_BOOL Report::save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { // Unsafe, not supported. return TRUE; diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index 83fb32cb82..a53bb17507 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -137,7 +137,7 @@ int util::ParstDataType(std::wstring* sFormat) return -1; } -FX_BOOL util::printf(OBJ_METHOD_PARAMS) +FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { int iSize = params.size(); if (iSize < 1) @@ -202,7 +202,7 @@ FX_BOOL util::printf(OBJ_METHOD_PARAMS) return TRUE; } -FX_BOOL util::printd(OBJ_METHOD_PARAMS) +FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = GetIsolate(cc); @@ -464,7 +464,7 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur cPurpose = cFormat; } -FX_BOOL util::printx(OBJ_METHOD_PARAMS) +FX_BOOL util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { int iSize = params.size(); if (iSize<2) @@ -578,7 +578,7 @@ void util::printx(const std::string &cFormat,const std::string &cSource2,std::st } } -FX_BOOL util::scand(OBJ_METHOD_PARAMS) +FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { v8::Isolate* isolate = GetIsolate(cc); int iSize = params.size(); @@ -635,7 +635,7 @@ FX_INT64 FX_atoi64(const char *nptr) return total; /* return result, negated if necessary */ } -FX_BOOL util::byteToChar(OBJ_METHOD_PARAMS) +FX_BOOL util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError) { int iSize = params.size(); if (iSize == 0) -- cgit v1.2.3