From ba038bc14bfeb4d011d57f388871f7f14c4c3c22 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 8 Oct 2015 12:03:00 -0700 Subject: Merge to XFA: Rename IFXJS_Runtime and IFXJS_Context to IJS_. Merge conflicts in: fpdfsdk/src/javascript/Document.cpp fpdfsdk/src/javascript/JS_Define.h New code in: fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp (cherry picked from commit 213a172779fddbd7e588ee2e2b3906ccc47d6896) Original Review URL: https://codereview.chromium.org/1386173002 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1395713002 . --- fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp | 2 +- fpdfsdk/src/fsdk_actionhandler.cpp | 24 ++-- fpdfsdk/src/fsdk_baseform.cpp | 8 +- fpdfsdk/src/fsdk_mgr.cpp | 6 +- fpdfsdk/src/javascript/Document.cpp | 146 +++++++++++------------ fpdfsdk/src/javascript/Document.h | 160 ++++++++++++------------- fpdfsdk/src/javascript/Field.cpp | 160 +++++++++++++------------ fpdfsdk/src/javascript/Field.h | 194 +++++++++++++------------------ fpdfsdk/src/javascript/Icon.cpp | 4 +- fpdfsdk/src/javascript/Icon.h | 2 +- fpdfsdk/src/javascript/JS_Context.h | 4 +- fpdfsdk/src/javascript/JS_Define.h | 50 ++++---- fpdfsdk/src/javascript/JS_Object.h | 2 +- fpdfsdk/src/javascript/JS_Runtime.cpp | 8 +- fpdfsdk/src/javascript/JS_Runtime.h | 10 +- fpdfsdk/src/javascript/PublicMethods.cpp | 46 ++++---- fpdfsdk/src/javascript/PublicMethods.h | 44 +++---- fpdfsdk/src/javascript/app.cpp | 72 ++++++------ fpdfsdk/src/javascript/app.h | 72 ++++++------ fpdfsdk/src/javascript/color.cpp | 8 +- fpdfsdk/src/javascript/color.h | 28 ++--- fpdfsdk/src/javascript/console.cpp | 8 +- fpdfsdk/src/javascript/console.h | 8 +- fpdfsdk/src/javascript/event.cpp | 42 ++++--- fpdfsdk/src/javascript/event.h | 52 ++++----- fpdfsdk/src/javascript/global.cpp | 8 +- fpdfsdk/src/javascript/global.h | 8 +- fpdfsdk/src/javascript/report.cpp | 4 +- fpdfsdk/src/javascript/report.h | 4 +- fpdfsdk/src/javascript/util.cpp | 12 +- fpdfsdk/src/javascript/util.h | 10 +- fpdfsdk/src/jsapi/fxjs_v8.cpp | 12 +- 32 files changed, 570 insertions(+), 648 deletions(-) (limited to 'fpdfsdk/src') diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp index 249efae759..cef65acd1b 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp @@ -1338,6 +1338,6 @@ FX_BOOL CPDFXFA_Document::GetGlobalProperty(IXFA_Doc* hDoc, } FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, FXJSE_HVALUE hValue, - IFXJS_Runtime* runTime) { + IJS_Runtime* runTime) { return runTime->GetHValueByName(utf8Name, hValue); } diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp index c2e26f7501..6cb37b9c80 100644 --- a/fpdfsdk/src/fsdk_actionhandler.cpp +++ b/fpdfsdk/src/fsdk_actionhandler.cpp @@ -149,12 +149,12 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, if (pEnv->IsJSInitiated()) { CFX_WideString swJS = action.GetJavaScript(); if (!swJS.IsEmpty()) { - IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime(); //???? + IJS_Runtime* pRuntime = pDocument->GetJsRuntime(); //???? ASSERT(pRuntime != NULL); pRuntime->SetReaderDocument(pDocument); - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); pContext->OnLink_MouseUp(pDocument); @@ -292,12 +292,12 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction( if (pEnv->IsJSInitiated()) { CFX_WideString swJS = action.GetJavaScript(); if (!swJS.IsEmpty()) { - IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime(); + IJS_Runtime* pRuntime = pDocument->GetJsRuntime(); ASSERT(pRuntime != NULL); pRuntime->SetReaderDocument(pDocument); - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); // switch (type) @@ -388,12 +388,12 @@ FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, if (pEnv->IsJSInitiated()) { CFX_WideString swJS = action.GetJavaScript(); if (!swJS.IsEmpty()) { - IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime(); + IJS_Runtime* pRuntime = pDocument->GetJsRuntime(); ASSERT(pRuntime != NULL); pRuntime->SetReaderDocument(pDocument); - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); pContext->OnBookmark_MouseUp(pBookmark); @@ -556,12 +556,12 @@ void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument, ASSERT(pDocument != NULL); - IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime(); + IJS_Runtime* pRuntime = pDocument->GetJsRuntime(); ASSERT(pRuntime != NULL); pRuntime->SetReaderDocument(pDocument); - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); switch (type) { @@ -616,12 +616,12 @@ void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript( const CFX_WideString& script) { ASSERT(pDocument != NULL); - IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime(); + IJS_Runtime* pRuntime = pDocument->GetJsRuntime(); ASSERT(pRuntime != NULL); pRuntime->SetReaderDocument(pDocument); - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); pContext->OnDoc_Open(pDocument, sScriptName); @@ -641,12 +641,12 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript( const CFX_WideString& script) { ASSERT(pDocument != NULL); - IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime(); + IJS_Runtime* pRuntime = pDocument->GetJsRuntime(); ASSERT(pRuntime != NULL); pRuntime->SetReaderDocument(pDocument); - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); switch (type) { diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index 83e0a9ac64..81b4ef409f 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -2432,7 +2432,7 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField) { m_bBusy = TRUE; if (IsCalculateEnabled()) { - IFXJS_Runtime* pRuntime = m_pDocument->GetJsRuntime(); + IJS_Runtime* pRuntime = m_pDocument->GetJsRuntime(); ASSERT(pRuntime != NULL); pRuntime->SetReaderDocument(m_pDocument); @@ -2450,7 +2450,7 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField) { if (action) { CFX_WideString csJS = action.GetJavaScript(); if (!csJS.IsEmpty()) { - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); CFX_WideString sOldValue = pField->GetValue(); @@ -2492,7 +2492,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, return sValue; } - IFXJS_Runtime* pRuntime = m_pDocument->GetJsRuntime(); + IJS_Runtime* pRuntime = m_pDocument->GetJsRuntime(); ASSERT(pRuntime != NULL); pRuntime->SetReaderDocument(m_pDocument); @@ -2515,7 +2515,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, if (!script.IsEmpty()) { CFX_WideString Value = sValue; - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); pContext->OnField_Format(pFormField, Value, TRUE); diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index c6395bfc83..4c684cfb69 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -376,11 +376,11 @@ void CPDFDoc_Environment::JS_docmailForm(void* mailData, } } -IFXJS_Runtime* CPDFDoc_Environment::GetJSRuntime() { +IJS_Runtime* CPDFDoc_Environment::GetJSRuntime() { if (!IsJSInitiated()) return NULL; if (!m_pJSRuntime) - m_pJSRuntime.reset(IFXJS_Runtime::Create(this)); + m_pJSRuntime.reset(IJS_Runtime::Create(this)); return m_pJSRuntime.get(); } @@ -626,7 +626,7 @@ FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag) { return dwPermissions & nFlag; } -IFXJS_Runtime* CPDFSDK_Document::GetJsRuntime() { +IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { ASSERT(m_pEnv != NULL); return m_pEnv->GetJSRuntime(); } diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index fe417ce1fc..04a3b80e3d 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -20,7 +20,7 @@ #include "app.h" #include "resource.h" -static v8::Isolate* GetIsolate(IFXJS_Context* cc) { +static v8::Isolate* GetIsolate(IJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -140,7 +140,7 @@ END_JS_STATIC_METHOD() IMPLEMENT_JS_CLASS(CJS_Document, Document) -FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc) { +FX_BOOL CJS_Document::InitInstance(IJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -182,7 +182,7 @@ Document::~Document() { } // the total number of fileds in document. -FX_BOOL Document::numFields(IFXJS_Context* cc, +FX_BOOL Document::numFields(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -196,7 +196,7 @@ FX_BOOL Document::numFields(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::dirty(IFXJS_Context* cc, +FX_BOOL Document::dirty(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -220,7 +220,7 @@ FX_BOOL Document::dirty(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::ADBE(IFXJS_Context* cc, +FX_BOOL Document::ADBE(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -233,7 +233,7 @@ FX_BOOL Document::ADBE(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::pageNum(IFXJS_Context* cc, +FX_BOOL Document::pageNum(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -260,7 +260,7 @@ FX_BOOL Document::pageNum(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::addAnnot(IFXJS_Context* cc, +FX_BOOL Document::addAnnot(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -268,7 +268,7 @@ FX_BOOL Document::addAnnot(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::addField(IFXJS_Context* cc, +FX_BOOL Document::addField(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -276,7 +276,7 @@ FX_BOOL Document::addField(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::exportAsText(IFXJS_Context* cc, +FX_BOOL Document::exportAsText(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -284,7 +284,7 @@ FX_BOOL Document::exportAsText(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::exportAsFDF(IFXJS_Context* cc, +FX_BOOL Document::exportAsFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -292,7 +292,7 @@ FX_BOOL Document::exportAsFDF(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::exportAsXFDF(IFXJS_Context* cc, +FX_BOOL Document::exportAsXFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -305,7 +305,7 @@ FX_BOOL Document::exportAsXFDF(IFXJS_Context* cc, // 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(IFXJS_Context* cc, +FX_BOOL Document::getField(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -338,7 +338,7 @@ FX_BOOL Document::getField(IFXJS_Context* cc, } // Gets the name of the nth field in the document -FX_BOOL Document::getNthFieldName(IFXJS_Context* cc, +FX_BOOL Document::getNthFieldName(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -364,7 +364,7 @@ FX_BOOL Document::getNthFieldName(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::importAnFDF(IFXJS_Context* cc, +FX_BOOL Document::importAnFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -372,7 +372,7 @@ FX_BOOL Document::importAnFDF(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::importAnXFDF(IFXJS_Context* cc, +FX_BOOL Document::importAnXFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -380,7 +380,7 @@ FX_BOOL Document::importAnXFDF(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::importTextData(IFXJS_Context* cc, +FX_BOOL Document::importTextData(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -395,7 +395,7 @@ FX_BOOL Document::importTextData(IFXJS_Context* cc, // int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string // cbcc,string cSubject,string cms); -FX_BOOL Document::mailForm(IFXJS_Context* cc, +FX_BOOL Document::mailForm(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -436,7 +436,7 @@ FX_BOOL Document::mailForm(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::print(IFXJS_Context* cc, +FX_BOOL Document::print(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -504,7 +504,7 @@ FX_BOOL Document::print(IFXJS_Context* cc, // comment: // note: if the filed name is not retional, adobe is dumb for it. -FX_BOOL Document::removeField(IFXJS_Context* cc, +FX_BOOL Document::removeField(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -562,7 +562,7 @@ FX_BOOL Document::removeField(IFXJS_Context* cc, // comment: // note: if the fields names r not rational, aodbe is dumb for it. -FX_BOOL Document::resetForm(IFXJS_Context* cc, +FX_BOOL Document::resetForm(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -617,7 +617,7 @@ FX_BOOL Document::resetForm(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::saveAs(IFXJS_Context* cc, +FX_BOOL Document::saveAs(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -625,7 +625,7 @@ FX_BOOL Document::saveAs(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::submitForm(IFXJS_Context* cc, +FX_BOOL Document::submitForm(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -725,13 +725,13 @@ FX_BOOL Document::ExtractFolderName(CPDFSDK_Document* pDoc, return FALSE; } -FX_BOOL Document::bookmarkRoot(IFXJS_Context* cc, +FX_BOOL Document::bookmarkRoot(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::mailDoc(IFXJS_Context* cc, +FX_BOOL Document::mailDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -796,7 +796,7 @@ FX_BOOL Document::mailDoc(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::author(IFXJS_Context* cc, +FX_BOOL Document::author(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -821,7 +821,7 @@ FX_BOOL Document::author(IFXJS_Context* cc, } } -FX_BOOL Document::info(IFXJS_Context* cc, +FX_BOOL Document::info(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -883,7 +883,7 @@ FX_BOOL Document::info(IFXJS_Context* cc, } } -FX_BOOL Document::creationDate(IFXJS_Context* cc, +FX_BOOL Document::creationDate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = @@ -905,7 +905,7 @@ FX_BOOL Document::creationDate(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::creator(IFXJS_Context* cc, +FX_BOOL Document::creator(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = @@ -927,7 +927,7 @@ FX_BOOL Document::creator(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::delay(IFXJS_Context* cc, +FX_BOOL Document::delay(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -955,7 +955,7 @@ FX_BOOL Document::delay(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::keywords(IFXJS_Context* cc, +FX_BOOL Document::keywords(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = @@ -977,7 +977,7 @@ FX_BOOL Document::keywords(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::modDate(IFXJS_Context* cc, +FX_BOOL Document::modDate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = @@ -999,7 +999,7 @@ FX_BOOL Document::modDate(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::producer(IFXJS_Context* cc, +FX_BOOL Document::producer(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = @@ -1021,7 +1021,7 @@ FX_BOOL Document::producer(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::subject(IFXJS_Context* cc, +FX_BOOL Document::subject(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CPDF_Dictionary* pDictionary = @@ -1043,7 +1043,7 @@ FX_BOOL Document::subject(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::title(IFXJS_Context* cc, +FX_BOOL Document::title(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL) @@ -1068,7 +1068,7 @@ FX_BOOL Document::title(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::numPages(IFXJS_Context* cc, +FX_BOOL Document::numPages(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -1080,7 +1080,7 @@ FX_BOOL Document::numPages(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::external(IFXJS_Context* cc, +FX_BOOL Document::external(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { // In Chrome case,should always return true. @@ -1090,7 +1090,7 @@ FX_BOOL Document::external(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::filesize(IFXJS_Context* cc, +FX_BOOL Document::filesize(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -1102,19 +1102,19 @@ FX_BOOL Document::filesize(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::mouseX(IFXJS_Context* cc, +FX_BOOL Document::mouseX(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::mouseY(IFXJS_Context* cc, +FX_BOOL Document::mouseY(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::baseURL(IFXJS_Context* cc, +FX_BOOL Document::baseURL(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -1125,7 +1125,7 @@ FX_BOOL Document::baseURL(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::calculate(IFXJS_Context* cc, +FX_BOOL Document::calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1149,7 +1149,7 @@ FX_BOOL Document::calculate(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::documentFileName(IFXJS_Context* cc, +FX_BOOL Document::documentFileName(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -1213,7 +1213,7 @@ CFX_WideString Document::CutString(CFX_WideString cbFrom) { return cbRet; } -FX_BOOL Document::path(IFXJS_Context* cc, +FX_BOOL Document::path(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -1225,26 +1225,26 @@ FX_BOOL Document::path(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::pageWindowRect(IFXJS_Context* cc, +FX_BOOL Document::pageWindowRect(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::layout(IFXJS_Context* cc, +FX_BOOL Document::layout(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::addLink(IFXJS_Context* cc, +FX_BOOL Document::addLink(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::closeDoc(IFXJS_Context* cc, +FX_BOOL Document::closeDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1252,21 +1252,21 @@ FX_BOOL Document::closeDoc(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::getPageBox(IFXJS_Context* cc, +FX_BOOL Document::getPageBox(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::getAnnot(IFXJS_Context* cc, +FX_BOOL Document::getAnnot(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::getAnnots(IFXJS_Context* cc, +FX_BOOL Document::getAnnots(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1274,7 +1274,7 @@ FX_BOOL Document::getAnnots(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::getAnnot3D(IFXJS_Context* cc, +FX_BOOL Document::getAnnot3D(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1282,7 +1282,7 @@ FX_BOOL Document::getAnnot3D(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::getAnnots3D(IFXJS_Context* cc, +FX_BOOL Document::getAnnots3D(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1290,14 +1290,14 @@ FX_BOOL Document::getAnnots3D(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::getOCGs(IFXJS_Context* cc, +FX_BOOL Document::getOCGs(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::getLinks(IFXJS_Context* cc, +FX_BOOL Document::getLinks(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1388,7 +1388,7 @@ void IconTree::DeleteIconElement(CFX_WideString swIconName) { } } -FX_BOOL Document::addIcon(IFXJS_Context* cc, +FX_BOOL Document::addIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1428,7 +1428,7 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::icons(IFXJS_Context* cc, +FX_BOOL Document::icons(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -1474,7 +1474,7 @@ FX_BOOL Document::icons(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::getIcon(IFXJS_Context* cc, +FX_BOOL Document::getIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1518,7 +1518,7 @@ FX_BOOL Document::getIcon(IFXJS_Context* cc, return FALSE; } -FX_BOOL Document::removeIcon(IFXJS_Context* cc, +FX_BOOL Document::removeIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1534,7 +1534,7 @@ FX_BOOL Document::removeIcon(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::createDataObject(IFXJS_Context* cc, +FX_BOOL Document::createDataObject(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1542,13 +1542,13 @@ FX_BOOL Document::createDataObject(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::media(IFXJS_Context* cc, +FX_BOOL Document::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::calculateNow(IFXJS_Context* cc, +FX_BOOL Document::calculateNow(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1566,13 +1566,13 @@ FX_BOOL Document::calculateNow(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::Collab(IFXJS_Context* cc, +FX_BOOL Document::Collab(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, +FX_BOOL Document::getPageNthWord(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1634,7 +1634,7 @@ FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::getPageNthWordQuads(IFXJS_Context* cc, +FX_BOOL Document::getPageNthWordQuads(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1646,7 +1646,7 @@ FX_BOOL Document::getPageNthWordQuads(IFXJS_Context* cc, return FALSE; } -FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, +FX_BOOL Document::getPageNumWords(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1690,7 +1690,7 @@ FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::getPrintParams(IFXJS_Context* cc, +FX_BOOL Document::getPrintParams(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1779,7 +1779,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, return swRet; } -FX_BOOL Document::zoom(IFXJS_Context* cc, +FX_BOOL Document::zoom(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; @@ -1795,13 +1795,13 @@ FX_BOOL Document::zoom(IFXJS_Context* cc, (refW, ReflowWidth) */ -FX_BOOL Document::zoomType(IFXJS_Context* cc, +FX_BOOL Document::zoomType(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Document::deletePages(IFXJS_Context* cc, +FX_BOOL Document::deletePages(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1852,7 +1852,7 @@ FX_BOOL Document::deletePages(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::extractPages(IFXJS_Context* cc, +FX_BOOL Document::extractPages(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1860,7 +1860,7 @@ FX_BOOL Document::extractPages(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::insertPages(IFXJS_Context* cc, +FX_BOOL Document::insertPages(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1868,7 +1868,7 @@ FX_BOOL Document::insertPages(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::replacePages(IFXJS_Context* cc, +FX_BOOL Document::replacePages(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1876,7 +1876,7 @@ FX_BOOL Document::replacePages(IFXJS_Context* cc, return TRUE; } -FX_BOOL Document::getURL(IFXJS_Context* cc, +FX_BOOL Document::getURL(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { diff --git a/fpdfsdk/src/javascript/Document.h b/fpdfsdk/src/javascript/Document.h index cc92b8d399..516045e35b 100644 --- a/fpdfsdk/src/javascript/Document.h +++ b/fpdfsdk/src/javascript/Document.h @@ -73,219 +73,203 @@ class Document : public CJS_EmbedObj { ~Document() override; public: - FX_BOOL ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL bookmarkRoot(IFXJS_Context* cc, + FX_BOOL ADBE(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL author(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL baseURL(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL bookmarkRoot(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL calculate(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL creationDate(IFXJS_Context* cc, + FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL Collab(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL creationDate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL documentFileName(IFXJS_Context* cc, + FX_BOOL creator(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL delay(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL dirty(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL documentFileName(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL external(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL filesize(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL keywords(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL numFields(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL numPages(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL pageWindowRect(IFXJS_Context* cc, + FX_BOOL external(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL filesize(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL icons(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL info(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL keywords(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL layout(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL modDate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL mouseX(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL mouseY(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL numFields(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL numPages(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL pageNum(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL pageWindowRect(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL producer(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL zoomType(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); + FX_BOOL path(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL producer(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL subject(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL title(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL zoom(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL zoomType(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL addAnnot(IFXJS_Context* cc, + FX_BOOL addAnnot(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL addField(IFXJS_Context* cc, + FX_BOOL addField(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL addLink(IFXJS_Context* cc, + FX_BOOL addLink(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL addIcon(IFXJS_Context* cc, + FX_BOOL addIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL calculateNow(IFXJS_Context* cc, + FX_BOOL calculateNow(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL closeDoc(IFXJS_Context* cc, + FX_BOOL closeDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL createDataObject(IFXJS_Context* cc, + FX_BOOL createDataObject(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL deletePages(IFXJS_Context* cc, + FX_BOOL deletePages(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL exportAsText(IFXJS_Context* cc, + FX_BOOL exportAsText(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL exportAsFDF(IFXJS_Context* cc, + FX_BOOL exportAsFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL exportAsXFDF(IFXJS_Context* cc, + FX_BOOL exportAsXFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL extractPages(IFXJS_Context* cc, + FX_BOOL extractPages(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getAnnot(IFXJS_Context* cc, + FX_BOOL getAnnot(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getAnnots(IFXJS_Context* cc, + FX_BOOL getAnnots(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getAnnot3D(IFXJS_Context* cc, + FX_BOOL getAnnot3D(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getAnnots3D(IFXJS_Context* cc, + FX_BOOL getAnnots3D(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getField(IFXJS_Context* cc, + FX_BOOL getField(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getIcon(IFXJS_Context* cc, + FX_BOOL getIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getLinks(IFXJS_Context* cc, + FX_BOOL getLinks(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getNthFieldName(IFXJS_Context* cc, + FX_BOOL getNthFieldName(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getOCGs(IFXJS_Context* cc, + FX_BOOL getOCGs(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getPageBox(IFXJS_Context* cc, + FX_BOOL getPageBox(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getPageNthWord(IFXJS_Context* cc, + FX_BOOL getPageNthWord(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getPageNthWordQuads(IFXJS_Context* cc, + FX_BOOL getPageNthWordQuads(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getPageNumWords(IFXJS_Context* cc, + FX_BOOL getPageNumWords(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getPrintParams(IFXJS_Context* cc, + FX_BOOL getPrintParams(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getURL(IFXJS_Context* cc, + FX_BOOL getURL(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL importAnFDF(IFXJS_Context* cc, + FX_BOOL importAnFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL importAnXFDF(IFXJS_Context* cc, + FX_BOOL importAnXFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL importTextData(IFXJS_Context* cc, + FX_BOOL importTextData(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL insertPages(IFXJS_Context* cc, + FX_BOOL insertPages(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL mailForm(IFXJS_Context* cc, + FX_BOOL mailForm(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL print(IFXJS_Context* cc, + FX_BOOL print(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL removeField(IFXJS_Context* cc, + FX_BOOL removeField(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL replacePages(IFXJS_Context* cc, + FX_BOOL replacePages(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL resetForm(IFXJS_Context* cc, + FX_BOOL resetForm(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL saveAs(IFXJS_Context* cc, + FX_BOOL saveAs(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL submitForm(IFXJS_Context* cc, + FX_BOOL submitForm(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL mailDoc(IFXJS_Context* cc, + FX_BOOL mailDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL removeIcon(IFXJS_Context* cc, + FX_BOOL removeIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); @@ -326,7 +310,7 @@ class CJS_Document : public CJS_Object { ~CJS_Document() override {} // CJS_Object - FX_BOOL InitInstance(IFXJS_Context* cc) override; + FX_BOOL InitInstance(IJS_Context* cc) override; DECLARE_JS_CLASS(); diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 59e3108050..80cff1a11f 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -110,7 +110,7 @@ END_JS_STATIC_METHOD() IMPLEMENT_JS_CLASS(CJS_Field, Field) -FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc) { +FX_BOOL CJS_Field::InitInstance(IJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -358,7 +358,7 @@ CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField) { /* ---------------------------------------- property * ---------------------------------------- */ -FX_BOOL Field::alignment(IFXJS_Context* cc, +FX_BOOL Field::alignment(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -417,7 +417,7 @@ void Field::SetAlignment(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::borderStyle(IFXJS_Context* cc, +FX_BOOL Field::borderStyle(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -534,7 +534,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, } } -FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, +FX_BOOL Field::buttonAlignX(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -586,7 +586,7 @@ void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, +FX_BOOL Field::buttonAlignY(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -638,7 +638,7 @@ void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, +FX_BOOL Field::buttonFitBounds(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -686,7 +686,7 @@ void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::buttonPosition(IFXJS_Context* cc, +FX_BOOL Field::buttonPosition(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -732,7 +732,7 @@ void Field::SetButtonPosition(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, +FX_BOOL Field::buttonScaleHow(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -783,7 +783,7 @@ void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, +FX_BOOL Field::buttonScaleWhen(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -845,7 +845,7 @@ void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, +FX_BOOL Field::calcOrderIndex(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -895,7 +895,7 @@ void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::charLimit(IFXJS_Context* cc, +FX_BOOL Field::charLimit(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -936,7 +936,7 @@ void Field::SetCharLimit(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::comb(IFXJS_Context* cc, +FX_BOOL Field::comb(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -981,7 +981,7 @@ void Field::SetComb(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, +FX_BOOL Field::commitOnSelChange(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1028,7 +1028,7 @@ void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, +FX_BOOL Field::currentValueIndices(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1123,7 +1123,7 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, } } -FX_BOOL Field::defaultStyle(IFXJS_Context* cc, +FX_BOOL Field::defaultStyle(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { // MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT); @@ -1146,7 +1146,7 @@ void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::defaultValue(IFXJS_Context* cc, +FX_BOOL Field::defaultValue(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1189,7 +1189,7 @@ void Field::SetDefaultValue(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::doNotScroll(IFXJS_Context* cc, +FX_BOOL Field::doNotScroll(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1234,7 +1234,7 @@ void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, +FX_BOOL Field::doNotSpellCheck(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1276,7 +1276,7 @@ void Field::SetDelay(FX_BOOL bDelay) { } } -FX_BOOL Field::delay(IFXJS_Context* cc, +FX_BOOL Field::delay(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -1293,7 +1293,7 @@ FX_BOOL Field::delay(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::display(IFXJS_Context* cc, +FX_BOOL Field::display(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1447,9 +1447,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, } } -FX_BOOL Field::doc(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError) { +FX_BOOL Field::doc(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) { return FALSE; } @@ -1457,7 +1455,7 @@ FX_BOOL Field::doc(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::editable(IFXJS_Context* cc, +FX_BOOL Field::editable(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1488,7 +1486,7 @@ FX_BOOL Field::editable(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::exportValues(IFXJS_Context* cc, +FX_BOOL Field::exportValues(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1534,7 +1532,7 @@ FX_BOOL Field::exportValues(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::fileSelect(IFXJS_Context* cc, +FX_BOOL Field::fileSelect(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1563,7 +1561,7 @@ FX_BOOL Field::fileSelect(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::fillColor(IFXJS_Context* cc, +FX_BOOL Field::fillColor(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1636,7 +1634,7 @@ void Field::SetFillColor(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::hidden(IFXJS_Context* cc, +FX_BOOL Field::hidden(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1754,7 +1752,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, } } -FX_BOOL Field::highlight(IFXJS_Context* cc, +FX_BOOL Field::highlight(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1818,7 +1816,7 @@ void Field::SetHighlight(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::lineWidth(IFXJS_Context* cc, +FX_BOOL Field::lineWidth(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1913,7 +1911,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, } } -FX_BOOL Field::multiline(IFXJS_Context* cc, +FX_BOOL Field::multiline(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -1958,7 +1956,7 @@ void Field::SetMultiline(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::multipleSelection(IFXJS_Context* cc, +FX_BOOL Field::multipleSelection(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2004,7 +2002,7 @@ void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::name(IFXJS_Context* cc, +FX_BOOL Field::name(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -2020,7 +2018,7 @@ FX_BOOL Field::name(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::numItems(IFXJS_Context* cc, +FX_BOOL Field::numItems(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CFX_PtrArray FieldArray; @@ -2043,7 +2041,7 @@ FX_BOOL Field::numItems(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::page(IFXJS_Context* cc, +FX_BOOL Field::page(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -2090,7 +2088,7 @@ FX_BOOL Field::page(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::password(IFXJS_Context* cc, +FX_BOOL Field::password(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2135,7 +2133,7 @@ void Field::SetPassword(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::print(IFXJS_Context* cc, +FX_BOOL Field::print(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2220,7 +2218,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, +FX_BOOL Field::radiosInUnison(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2253,7 +2251,7 @@ FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::readonly(IFXJS_Context* cc, +FX_BOOL Field::readonly(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2283,7 +2281,7 @@ FX_BOOL Field::readonly(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::rect(IFXJS_Context* cc, +FX_BOOL Field::rect(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2430,7 +2428,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, } } -FX_BOOL Field::required(IFXJS_Context* cc, +FX_BOOL Field::required(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2463,7 +2461,7 @@ FX_BOOL Field::required(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::richText(IFXJS_Context* cc, +FX_BOOL Field::richText(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2508,7 +2506,7 @@ void Field::SetRichText(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::richValue(IFXJS_Context* cc, +FX_BOOL Field::richValue(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; @@ -2528,7 +2526,7 @@ void Field::SetRichValue(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::rotation(IFXJS_Context* cc, +FX_BOOL Field::rotation(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2571,7 +2569,7 @@ void Field::SetRotation(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::strokeColor(IFXJS_Context* cc, +FX_BOOL Field::strokeColor(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2646,7 +2644,7 @@ void Field::SetStrokeColor(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::style(IFXJS_Context* cc, +FX_BOOL Field::style(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2717,13 +2715,13 @@ void Field::SetStyle(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::submitName(IFXJS_Context* cc, +FX_BOOL Field::submitName(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; } -FX_BOOL Field::textColor(IFXJS_Context* cc, +FX_BOOL Field::textColor(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2787,7 +2785,7 @@ void Field::SetTextColor(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::textFont(IFXJS_Context* cc, +FX_BOOL Field::textFont(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2844,7 +2842,7 @@ void Field::SetTextFont(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::textSize(IFXJS_Context* cc, +FX_BOOL Field::textSize(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2894,7 +2892,7 @@ void Field::SetTextSize(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::type(IFXJS_Context* cc, +FX_BOOL Field::type(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2943,7 +2941,7 @@ FX_BOOL Field::type(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::userName(IFXJS_Context* cc, +FX_BOOL Field::userName(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -2982,7 +2980,7 @@ void Field::SetUserName(CPDFSDK_Document* pDocument, // Not supported. } -FX_BOOL Field::value(IFXJS_Context* cc, +FX_BOOL Field::value(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3166,7 +3164,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument, } } -FX_BOOL Field::valueAsString(IFXJS_Context* cc, +FX_BOOL Field::valueAsString(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3214,7 +3212,7 @@ FX_BOOL Field::valueAsString(IFXJS_Context* cc, /* --------------------------------- methods --------------------------------- */ -FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, +FX_BOOL Field::browseForFileToSubmit(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3244,7 +3242,7 @@ FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, +FX_BOOL Field::buttonGetCaption(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3284,7 +3282,7 @@ FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, //#pragma warning(disable: 4800) -FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, +FX_BOOL Field::buttonGetIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3333,7 +3331,7 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, +FX_BOOL Field::buttonImportIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3378,21 +3376,21 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::buttonSetCaption(IFXJS_Context* cc, +FX_BOOL Field::buttonSetCaption(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::buttonSetIcon(IFXJS_Context* cc, +FX_BOOL Field::buttonSetIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::checkThisBox(IFXJS_Context* cc, +FX_BOOL Field::checkThisBox(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3433,14 +3431,14 @@ FX_BOOL Field::checkThisBox(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::clearItems(IFXJS_Context* cc, +FX_BOOL Field::clearItems(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, +FX_BOOL Field::defaultIsChecked(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3476,7 +3474,7 @@ FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::deleteItemAt(IFXJS_Context* cc, +FX_BOOL Field::deleteItemAt(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3490,7 +3488,7 @@ int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2) { return ps1->Compare(*ps2); } -FX_BOOL Field::getArray(IFXJS_Context* cc, +FX_BOOL Field::getArray(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3538,7 +3536,7 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::getItemAt(IFXJS_Context* cc, +FX_BOOL Field::getItemAt(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3579,21 +3577,21 @@ FX_BOOL Field::getItemAt(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::getLock(IFXJS_Context* cc, +FX_BOOL Field::getLock(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::insertItemAt(IFXJS_Context* cc, +FX_BOOL Field::insertItemAt(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, +FX_BOOL Field::isBoxChecked(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3628,7 +3626,7 @@ FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, +FX_BOOL Field::isDefaultChecked(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3662,14 +3660,14 @@ FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::setAction(IFXJS_Context* cc, +FX_BOOL Field::setAction(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL Field::setFocus(IFXJS_Context* cc, +FX_BOOL Field::setFocus(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -3722,63 +3720,63 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, return TRUE; } -FX_BOOL Field::setItems(IFXJS_Context* cc, +FX_BOOL Field::setItems(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL Field::setLock(IFXJS_Context* cc, +FX_BOOL Field::setLock(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::signatureGetModifications(IFXJS_Context* cc, +FX_BOOL Field::signatureGetModifications(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::signatureGetSeedValue(IFXJS_Context* cc, +FX_BOOL Field::signatureGetSeedValue(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::signatureInfo(IFXJS_Context* cc, +FX_BOOL Field::signatureInfo(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::signatureSetSeedValue(IFXJS_Context* cc, +FX_BOOL Field::signatureSetSeedValue(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::signatureSign(IFXJS_Context* cc, +FX_BOOL Field::signatureSign(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::signatureValidate(IFXJS_Context* cc, +FX_BOOL Field::signatureValidate(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL Field::source(IFXJS_Context* cc, +FX_BOOL Field::source(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { diff --git a/fpdfsdk/src/javascript/Field.h b/fpdfsdk/src/javascript/Field.h index daf47d5c37..b263241712 100644 --- a/fpdfsdk/src/javascript/Field.h +++ b/fpdfsdk/src/javascript/Field.h @@ -92,238 +92,202 @@ class Field : public CJS_EmbedObj { Field(CJS_Object* pJSObject); ~Field() override; - FX_BOOL alignment(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL borderStyle(IFXJS_Context* cc, + FX_BOOL alignment(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL borderStyle(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL buttonAlignX(IFXJS_Context* cc, + FX_BOOL buttonAlignX(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL buttonAlignY(IFXJS_Context* cc, + FX_BOOL buttonAlignY(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL buttonFitBounds(IFXJS_Context* cc, + FX_BOOL buttonFitBounds(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL buttonPosition(IFXJS_Context* cc, + FX_BOOL buttonPosition(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL buttonScaleHow(IFXJS_Context* cc, + FX_BOOL buttonScaleHow(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL buttonScaleWhen(IFXJS_Context* cc, + FX_BOOL buttonScaleWhen(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL calcOrderIndex(IFXJS_Context* cc, + FX_BOOL calcOrderIndex(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL charLimit(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL commitOnSelChange(IFXJS_Context* cc, + FX_BOOL charLimit(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL comb(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL commitOnSelChange(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL currentValueIndices(IFXJS_Context* cc, + FX_BOOL currentValueIndices(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL defaultStyle(IFXJS_Context* cc, + FX_BOOL defaultStyle(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL defaultValue(IFXJS_Context* cc, + FX_BOOL defaultValue(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL doNotScroll(IFXJS_Context* cc, + FX_BOOL doNotScroll(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL doNotSpellCheck(IFXJS_Context* cc, + FX_BOOL doNotSpellCheck(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL editable(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL exportValues(IFXJS_Context* cc, + FX_BOOL delay(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL display(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL doc(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL editable(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL exportValues(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL fileSelect(IFXJS_Context* cc, + FX_BOOL fileSelect(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL fillColor(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL highlight(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL lineWidth(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL multiline(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL multipleSelection(IFXJS_Context* cc, + FX_BOOL fillColor(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL hidden(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL highlight(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL lineWidth(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL multiline(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL multipleSelection(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL numItems(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL password(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL radiosInUnison(IFXJS_Context* cc, + FX_BOOL name(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL numItems(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL page(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL password(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL print(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL radiosInUnison(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL readonly(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL required(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL richText(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL richValue(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL rotation(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL strokeColor(IFXJS_Context* cc, + FX_BOOL readonly(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL rect(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL required(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL richText(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL richValue(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL rotation(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL strokeColor(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL submitName(IFXJS_Context* cc, + FX_BOOL style(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL submitName(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL textColor(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL textFont(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL textSize(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL userName(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL valueAsString(IFXJS_Context* cc, + FX_BOOL textColor(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL textFont(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL textSize(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL type(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL userName(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL value(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL valueAsString(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL source(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL browseForFileToSubmit(IFXJS_Context* cc, + FX_BOOL browseForFileToSubmit(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL buttonGetCaption(IFXJS_Context* cc, + FX_BOOL buttonGetCaption(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL buttonGetIcon(IFXJS_Context* cc, + FX_BOOL buttonGetIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL buttonImportIcon(IFXJS_Context* cc, + FX_BOOL buttonImportIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL buttonSetCaption(IFXJS_Context* cc, + FX_BOOL buttonSetCaption(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL buttonSetIcon(IFXJS_Context* cc, + FX_BOOL buttonSetIcon(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL checkThisBox(IFXJS_Context* cc, + FX_BOOL checkThisBox(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL clearItems(IFXJS_Context* cc, + FX_BOOL clearItems(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL defaultIsChecked(IFXJS_Context* cc, + FX_BOOL defaultIsChecked(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL deleteItemAt(IFXJS_Context* cc, + FX_BOOL deleteItemAt(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getArray(IFXJS_Context* cc, + FX_BOOL getArray(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getItemAt(IFXJS_Context* cc, + FX_BOOL getItemAt(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL getLock(IFXJS_Context* cc, + FX_BOOL getLock(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL insertItemAt(IFXJS_Context* cc, + FX_BOOL insertItemAt(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL isBoxChecked(IFXJS_Context* cc, + FX_BOOL isBoxChecked(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL isDefaultChecked(IFXJS_Context* cc, + FX_BOOL isDefaultChecked(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL setAction(IFXJS_Context* cc, + FX_BOOL setAction(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL setFocus(IFXJS_Context* cc, + FX_BOOL setFocus(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL setItems(IFXJS_Context* cc, + FX_BOOL setItems(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL setLock(IFXJS_Context* cc, + FX_BOOL setLock(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL signatureGetModifications(IFXJS_Context* cc, + FX_BOOL signatureGetModifications(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL signatureGetSeedValue(IFXJS_Context* cc, + FX_BOOL signatureGetSeedValue(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL signatureInfo(IFXJS_Context* cc, + FX_BOOL signatureInfo(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL signatureSetSeedValue(IFXJS_Context* cc, + FX_BOOL signatureSetSeedValue(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL signatureSign(IFXJS_Context* cc, + FX_BOOL signatureSign(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL signatureValidate(IFXJS_Context* cc, + FX_BOOL signatureValidate(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); @@ -537,7 +501,7 @@ class CJS_Field : public CJS_Object { CJS_Field(v8::Local pObject) : CJS_Object(pObject) {} ~CJS_Field(void) override {} - FX_BOOL InitInstance(IFXJS_Context* cc) override; + FX_BOOL InitInstance(IJS_Context* cc) override; DECLARE_JS_CLASS(); JS_STATIC_PROP(alignment, Field); diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp index 044a38ee2e..5dfa7a08d4 100644 --- a/fpdfsdk/src/javascript/Icon.cpp +++ b/fpdfsdk/src/javascript/Icon.cpp @@ -47,9 +47,7 @@ CFX_WideString Icon::GetIconName() { return m_swIconName; } -FX_BOOL Icon::name(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError) { +FX_BOOL Icon::name(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) return FALSE; diff --git a/fpdfsdk/src/javascript/Icon.h b/fpdfsdk/src/javascript/Icon.h index c1880601dc..6ea3153974 100644 --- a/fpdfsdk/src/javascript/Icon.h +++ b/fpdfsdk/src/javascript/Icon.h @@ -14,7 +14,7 @@ class Icon : public CJS_EmbedObj { Icon(CJS_Object* pJSObject); ~Icon() override; - FX_BOOL name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL name(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); void SetStream(CPDF_Stream* pIconStream); CPDF_Stream* GetStream(); void SetIconName(CFX_WideString name); diff --git a/fpdfsdk/src/javascript/JS_Context.h b/fpdfsdk/src/javascript/JS_Context.h index b1e1bcee2c..7fbcbec876 100644 --- a/fpdfsdk/src/javascript/JS_Context.h +++ b/fpdfsdk/src/javascript/JS_Context.h @@ -14,12 +14,12 @@ class CJS_EventHandler; class CJS_Runtime; -class CJS_Context : public IFXJS_Context { +class CJS_Context : public IJS_Context { public: explicit CJS_Context(CJS_Runtime* pRuntime); ~CJS_Context() override; - // IFXJS_Context + // IJS_Context FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info) override; void OnApp_Init() override; diff --git a/fpdfsdk/src/javascript/JS_Define.h b/fpdfsdk/src/javascript/JS_Define.h index eaad4708d8..2ea278d802 100644 --- a/fpdfsdk/src/javascript/JS_Define.h +++ b/fpdfsdk/src/javascript/JS_Define.h @@ -72,16 +72,16 @@ struct JSMethodSpec { ; template + FX_BOOL (C::*M)(IJS_Context*, CJS_PropValue&, CFX_WideString&)> void JSPropGetter(const char* prop_name_string, const char* class_name_string, v8::Local property, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = (CJS_Object*)FXJS_GetPrivate(isolate, info.Holder()); C* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); CFX_WideString sError; @@ -96,17 +96,17 @@ void JSPropGetter(const char* prop_name_string, } template + FX_BOOL (C::*M)(IJS_Context*, CJS_PropValue&, CFX_WideString&)> void JSPropSetter(const char* prop_name_string, const char* class_name_string, v8::Local property, v8::Local value, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = (CJS_Object*)FXJS_GetPrivate(isolate, info.Holder()); C* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); CFX_WideString sError; @@ -133,7 +133,7 @@ void JSPropSetter(const char* prop_name_string, } template @@ -141,10 +141,10 @@ void JSMethod(const char* method_name_string, const char* class_name_string, const v8::FunctionCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Parameters parameters; for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) { parameters.push_back(CJS_Value(isolate, info[i], CJS_Value::VT_unknown)); @@ -242,17 +242,17 @@ void JSMethod(const char* method_name_string, DefineMethods(pIsolate); \ } -#define DECLARE_JS_CLASS_RICH_PART() \ - static void JSConstructor(IFXJS_Context* cc, v8::Local obj); \ - static void JSDestructor(v8::Local obj); \ - static void DefineProps(v8::Isolate* pIsoalte); \ - static void DefineMethods(v8::Isolate* pIsoalte); \ - static JSPropertySpec JS_Class_Properties[]; \ +#define DECLARE_JS_CLASS_RICH_PART() \ + static void JSConstructor(IJS_Context* cc, v8::Local obj); \ + static void JSDestructor(v8::Local obj); \ + static void DefineProps(v8::Isolate* pIsoalte); \ + static void DefineMethods(v8::Isolate* pIsoalte); \ + static JSPropertySpec JS_Class_Properties[]; \ static JSMethodSpec JS_Class_Methods[]; #define IMPLEMENT_JS_CLASS_RICH_PART(js_class_name, class_alternate, \ class_name) \ - void js_class_name::JSConstructor(IFXJS_Context* cc, \ + void js_class_name::JSConstructor(IJS_Context* cc, \ v8::Local obj) { \ CJS_Object* pObj = new js_class_name(obj); \ pObj->SetEmbedObject(new class_alternate(pObj)); \ @@ -363,10 +363,10 @@ void JSSpecialPropGet(const char* class_name, v8::Local property, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = reinterpret_cast(FXJS_GetPrivate(isolate, info.Holder())); Alt* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); @@ -389,10 +389,10 @@ void JSSpecialPropPut(const char* class_name, v8::Local value, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = reinterpret_cast(FXJS_GetPrivate(isolate, info.Holder())); Alt* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); @@ -412,10 +412,10 @@ void JSSpecialPropDel(const char* class_name, v8::Local property, const v8::PropertyCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Object* pJSObj = reinterpret_cast(FXJS_GetPrivate(isolate, info.Holder())); Alt* pObj = reinterpret_cast(pJSObj->GetEmbedObject()); @@ -430,17 +430,17 @@ void JSSpecialPropDel(const char* class_name, } } -template void JSGlobalFunc(const char* func_name_string, const v8::FunctionCallbackInfo& info) { v8::Isolate* isolate = info.GetIsolate(); - IFXJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); + IJS_Runtime* pRuntime = FXJS_GetRuntimeFromIsolate(isolate); if (!pRuntime) return; - IFXJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); + IJS_Context* pRuntimeContext = pRuntime->GetCurrentContext(); CJS_Parameters parameters; for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) { parameters.push_back(CJS_Value(isolate, info[i], CJS_Value::VT_unknown)); diff --git a/fpdfsdk/src/javascript/JS_Object.h b/fpdfsdk/src/javascript/JS_Object.h index 82d1da9ee9..563a316bd6 100644 --- a/fpdfsdk/src/javascript/JS_Object.h +++ b/fpdfsdk/src/javascript/JS_Object.h @@ -49,7 +49,7 @@ class CJS_Object { virtual FX_BOOL IsType(const FX_CHAR* sClassName) { return TRUE; } virtual CFX_ByteString GetClassName() { return ""; } - virtual FX_BOOL InitInstance(IFXJS_Context* cc) { return TRUE; } + virtual FX_BOOL InitInstance(IJS_Context* cc) { return TRUE; } virtual FX_BOOL ExitInstance() { return TRUE; } v8::Local ToV8Object() { return m_pV8Object.Get(m_pIsolate); } diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index bc5443daf6..f97b454993 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -32,7 +32,7 @@ /* ------------------------------ CJS_Runtime ------------------------------ */ v8::Global& _getGlobalObjectTemplate(v8::Isolate* pIsolate); -IFXJS_Runtime* IFXJS_Runtime::Create(CPDFDoc_Environment* pEnv) { +IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { return new CJS_Runtime(pEnv); } @@ -145,13 +145,13 @@ void CJS_Runtime::DefineJSObjects() { CJS_PrintParamsObj::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_DYNAMIC); } -IFXJS_Context* CJS_Runtime::NewContext() { +IJS_Context* CJS_Runtime::NewContext() { CJS_Context* p = new CJS_Context(this); m_ContextArray.Add(p); return p; } -void CJS_Runtime::ReleaseContext(IFXJS_Context* pContext) { +void CJS_Runtime::ReleaseContext(IJS_Context* pContext) { CJS_Context* pJSContext = (CJS_Context*)pContext; for (int i = 0, sz = m_ContextArray.GetSize(); i < sz; i++) { @@ -163,7 +163,7 @@ void CJS_Runtime::ReleaseContext(IFXJS_Context* pContext) { } } -IFXJS_Context* CJS_Runtime::GetCurrentContext() { +IJS_Context* CJS_Runtime::GetCurrentContext() { if (!m_ContextArray.GetSize()) return NULL; return m_ContextArray.GetAt(m_ContextArray.GetSize() - 1); diff --git a/fpdfsdk/src/javascript/JS_Runtime.h b/fpdfsdk/src/javascript/JS_Runtime.h index 1034ae8c8b..86e425ebe8 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.h +++ b/fpdfsdk/src/javascript/JS_Runtime.h @@ -17,7 +17,7 @@ class CJS_Context; -class CJS_Runtime : public IFXJS_Runtime { +class CJS_Runtime : public IJS_Runtime { public: class Observer { public: @@ -32,10 +32,10 @@ class CJS_Runtime : public IFXJS_Runtime { explicit CJS_Runtime(CPDFDoc_Environment* pApp); ~CJS_Runtime() override; - // IFXJS_Runtime - IFXJS_Context* NewContext() override; - void ReleaseContext(IFXJS_Context* pContext) override; - IFXJS_Context* GetCurrentContext() override; + // IJS_Runtime + IJS_Context* NewContext() override; + void ReleaseContext(IJS_Context* pContext) override; + IJS_Context* GetCurrentContext() override; void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override; CPDFSDK_Document* GetReaderDocument() override { return m_pDocument; } diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index f5686a7129..4e068ec568 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -19,7 +19,7 @@ #include "resource.h" #include "util.h" -static v8::Isolate* GetIsolate(IFXJS_Context* cc) { +static v8::Isolate* GetIsolate(IJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -906,7 +906,7 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, // function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, // bCurrencyPrepend) -FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1091,7 +1091,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, // function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, // bCurrencyPrepend) -FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1210,7 +1210,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, } // function AFPercent_Format(nDec, sepStyle) -FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFPercent_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1308,7 +1308,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, return TRUE; } // AFPercent_Keystroke(nDec, sepStyle) -FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1316,7 +1316,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, } // function AFDate_FormatEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1432,7 +1432,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) { } // AFDate_KeystrokeEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1468,7 +1468,7 @@ FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, return TRUE; } -FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFDate_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1508,7 +1508,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, } // AFDate_KeystrokeEx(cFormat) -FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1548,7 +1548,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, } // function AFTime_Format(ptf) -FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFTime_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1574,7 +1574,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, return AFDate_FormatEx(cc, newParams, vRet, sError); } -FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1599,14 +1599,14 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, return AFDate_KeystrokeEx(cc, newParams, vRet, sError); } -FX_BOOL CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFTime_FormatEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return AFDate_FormatEx(cc, params, vRet, sError); } -FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1614,7 +1614,7 @@ FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, } // function AFSpecial_Format(psf) -FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFSpecial_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1665,7 +1665,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, } // function AFSpecial_KeystrokeEx(mask) -FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1758,7 +1758,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, } // function AFSpecial_Keystroke(psf) -FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1816,7 +1816,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, return AFSpecial_KeystrokeEx(cc, params2, vRet, sError); } -FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFMergeChange(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1858,7 +1858,7 @@ FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, return TRUE; } -FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFParseDateEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1888,7 +1888,7 @@ FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, return TRUE; } -FX_BOOL CJS_PublicMethods::AFSimple(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFSimple(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1905,7 +1905,7 @@ FX_BOOL CJS_PublicMethods::AFSimple(IFXJS_Context* cc, return TRUE; } -FX_BOOL CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFMakeNumber(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -1920,7 +1920,7 @@ FX_BOOL CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, return TRUE; } -FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -2034,7 +2034,7 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, /* This function validates the current event to ensure that its value is ** within the specified range. */ -FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFRange_Validate(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -2081,7 +2081,7 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, return TRUE; } -FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, +FX_BOOL CJS_PublicMethods::AFExtractNums(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { diff --git a/fpdfsdk/src/javascript/PublicMethods.h b/fpdfsdk/src/javascript/PublicMethods.h index 47885b428b..0c9c9b4682 100644 --- a/fpdfsdk/src/javascript/PublicMethods.h +++ b/fpdfsdk/src/javascript/PublicMethods.h @@ -15,91 +15,91 @@ class CJS_PublicMethods : public CJS_Object { ~CJS_PublicMethods() override {} public: - static FX_BOOL AFNumber_Format(IFXJS_Context* cc, + static FX_BOOL AFNumber_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFNumber_Keystroke(IFXJS_Context* cc, + static FX_BOOL AFNumber_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFPercent_Format(IFXJS_Context* cc, + static FX_BOOL AFPercent_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFPercent_Keystroke(IFXJS_Context* cc, + static FX_BOOL AFPercent_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFDate_FormatEx(IFXJS_Context* cc, + static FX_BOOL AFDate_FormatEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFDate_KeystrokeEx(IFXJS_Context* cc, + static FX_BOOL AFDate_KeystrokeEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFDate_Format(IFXJS_Context* cc, + static FX_BOOL AFDate_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFDate_Keystroke(IFXJS_Context* cc, + static FX_BOOL AFDate_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFTime_FormatEx(IFXJS_Context* cc, + static FX_BOOL AFTime_FormatEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); // - static FX_BOOL AFTime_KeystrokeEx(IFXJS_Context* cc, + static FX_BOOL AFTime_KeystrokeEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFTime_Format(IFXJS_Context* cc, + static FX_BOOL AFTime_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFTime_Keystroke(IFXJS_Context* cc, + static FX_BOOL AFTime_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFSpecial_Format(IFXJS_Context* cc, + static FX_BOOL AFSpecial_Format(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFSpecial_Keystroke(IFXJS_Context* cc, + static FX_BOOL AFSpecial_Keystroke(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFSpecial_KeystrokeEx(IFXJS_Context* cc, + static FX_BOOL AFSpecial_KeystrokeEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); // - static FX_BOOL AFSimple(IFXJS_Context* cc, + static FX_BOOL AFSimple(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFMakeNumber(IFXJS_Context* cc, + static FX_BOOL AFMakeNumber(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFSimple_Calculate(IFXJS_Context* cc, + static FX_BOOL AFSimple_Calculate(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFRange_Validate(IFXJS_Context* cc, + static FX_BOOL AFRange_Validate(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFMergeChange(IFXJS_Context* cc, + static FX_BOOL AFMergeChange(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFParseDateEx(IFXJS_Context* cc, + static FX_BOOL AFParseDateEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFExtractNums(IFXJS_Context* cc, + static FX_BOOL AFExtractNums(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index ae9001f04c..8e21febcc6 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -18,7 +18,7 @@ #include "JS_Value.h" #include "resource.h" -static v8::Isolate* GetIsolate(IFXJS_Context* cc) { +static v8::Isolate* GetIsolate(IJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; CJS_Runtime* pRuntime = pContext->GetJSRuntime(); return pRuntime->GetIsolate(); @@ -110,7 +110,7 @@ app::~app() { m_aTimer.RemoveAll(); } -FX_BOOL app::activeDocs(IFXJS_Context* cc, +FX_BOOL app::activeDocs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -145,7 +145,7 @@ FX_BOOL app::activeDocs(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::calculate(IFXJS_Context* cc, +FX_BOOL app::calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -165,7 +165,7 @@ FX_BOOL app::calculate(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::formsVersion(IFXJS_Context* cc, +FX_BOOL app::formsVersion(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -176,7 +176,7 @@ FX_BOOL app::formsVersion(IFXJS_Context* cc, return FALSE; } -FX_BOOL app::viewerType(IFXJS_Context* cc, +FX_BOOL app::viewerType(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -187,7 +187,7 @@ FX_BOOL app::viewerType(IFXJS_Context* cc, return FALSE; } -FX_BOOL app::viewerVariation(IFXJS_Context* cc, +FX_BOOL app::viewerVariation(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -198,7 +198,7 @@ FX_BOOL app::viewerVariation(IFXJS_Context* cc, return FALSE; } -FX_BOOL app::viewerVersion(IFXJS_Context* cc, +FX_BOOL app::viewerVersion(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -215,7 +215,7 @@ FX_BOOL app::viewerVersion(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::platform(IFXJS_Context* cc, +FX_BOOL app::platform(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -226,7 +226,7 @@ FX_BOOL app::platform(IFXJS_Context* cc, return FALSE; } -FX_BOOL app::language(IFXJS_Context* cc, +FX_BOOL app::language(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsGetting()) { @@ -241,7 +241,7 @@ FX_BOOL app::language(IFXJS_Context* cc, // comment: need reader support // note: // CFDF_Document * CPDFDoc_Environment::NewFDF(); -FX_BOOL app::newFDF(IFXJS_Context* cc, +FX_BOOL app::newFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -253,14 +253,14 @@ FX_BOOL app::newFDF(IFXJS_Context* cc, // parmeters, how old an fdf document while do not show it. // CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv); -FX_BOOL app::openFDF(IFXJS_Context* cc, +FX_BOOL app::openFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL app::alert(IFXJS_Context* cc, +FX_BOOL app::alert(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -359,7 +359,7 @@ FX_BOOL app::alert(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::beep(IFXJS_Context* cc, +FX_BOOL app::beep(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -375,25 +375,25 @@ FX_BOOL app::beep(IFXJS_Context* cc, return FALSE; } -FX_BOOL app::findComponent(IFXJS_Context* cc, +FX_BOOL app::findComponent(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, +FX_BOOL app::popUpMenuEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { +FX_BOOL app::fs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return FALSE; } -FX_BOOL app::setInterval(IFXJS_Context* cc, +FX_BOOL app::setInterval(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -429,7 +429,7 @@ FX_BOOL app::setInterval(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::setTimeOut(IFXJS_Context* cc, +FX_BOOL app::setTimeOut(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -470,7 +470,7 @@ FX_BOOL app::setTimeOut(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::clearTimeOut(IFXJS_Context* cc, +FX_BOOL app::clearTimeOut(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -506,7 +506,7 @@ FX_BOOL app::clearTimeOut(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::clearInterval(IFXJS_Context* cc, +FX_BOOL app::clearInterval(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -542,7 +542,7 @@ FX_BOOL app::clearInterval(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::execMenuItem(IFXJS_Context* cc, +FX_BOOL app::execMenuItem(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -573,7 +573,7 @@ void app::RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript) { ASSERT(pRuntime != NULL); if (!pRuntime->IsBlocking()) { - IFXJS_Context* pContext = pRuntime->NewContext(); + IJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); pContext->OnExternal_Exec(); CFX_WideString wtInfo; @@ -582,7 +582,7 @@ void app::RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript) { } } -FX_BOOL app::goBack(IFXJS_Context* cc, +FX_BOOL app::goBack(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -590,7 +590,7 @@ FX_BOOL app::goBack(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::goForward(IFXJS_Context* cc, +FX_BOOL app::goForward(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -598,7 +598,7 @@ FX_BOOL app::goForward(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::mailMsg(IFXJS_Context* cc, +FX_BOOL app::mailMsg(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -667,7 +667,7 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc, return FALSE; } -FX_BOOL app::launchURL(IFXJS_Context* cc, +FX_BOOL app::launchURL(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -675,7 +675,7 @@ FX_BOOL app::launchURL(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, +FX_BOOL app::runtimeHighlight(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -687,20 +687,20 @@ FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::fullscreen(IFXJS_Context* cc, +FX_BOOL app::fullscreen(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return FALSE; } -FX_BOOL app::popUpMenu(IFXJS_Context* cc, +FX_BOOL app::popUpMenu(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL app::browseForDoc(IFXJS_Context* cc, +FX_BOOL app::browseForDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -726,21 +726,21 @@ CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) { return sRet; } -FX_BOOL app::newDoc(IFXJS_Context* cc, +FX_BOOL app::newDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL app::openDoc(IFXJS_Context* cc, +FX_BOOL app::openDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return FALSE; } -FX_BOOL app::response(IFXJS_Context* cc, +FX_BOOL app::response(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -820,13 +820,11 @@ FX_BOOL app::response(IFXJS_Context* cc, return TRUE; } -FX_BOOL app::media(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError) { +FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return FALSE; } -FX_BOOL app::execDialog(IFXJS_Context* cc, +FX_BOOL app::execDialog(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { diff --git a/fpdfsdk/src/javascript/app.h b/fpdfsdk/src/javascript/app.h index 4cf1eca1b2..59f5050911 100644 --- a/fpdfsdk/src/javascript/app.h +++ b/fpdfsdk/src/javascript/app.h @@ -42,120 +42,114 @@ class app : public CJS_EmbedObj { ~app() override; public: - FX_BOOL activeDocs(IFXJS_Context* cc, + FX_BOOL activeDocs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL calculate(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL formsVersion(IFXJS_Context* cc, + FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL formsVersion(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL fullscreen(IFXJS_Context* cc, + FX_BOOL fs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL fullscreen(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL language(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL platform(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL runtimeHighlight(IFXJS_Context* cc, + FX_BOOL language(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL platform(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL runtimeHighlight(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL viewerType(IFXJS_Context* cc, + FX_BOOL viewerType(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL viewerVariation(IFXJS_Context* cc, + FX_BOOL viewerVariation(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL viewerVersion(IFXJS_Context* cc, + FX_BOOL viewerVersion(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL alert(IFXJS_Context* cc, + FX_BOOL alert(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL beep(IFXJS_Context* cc, + FX_BOOL beep(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL browseForDoc(IFXJS_Context* cc, + FX_BOOL browseForDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL clearInterval(IFXJS_Context* cc, + FX_BOOL clearInterval(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL clearTimeOut(IFXJS_Context* cc, + FX_BOOL clearTimeOut(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL execDialog(IFXJS_Context* cc, + FX_BOOL execDialog(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL execMenuItem(IFXJS_Context* cc, + FX_BOOL execMenuItem(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL findComponent(IFXJS_Context* cc, + FX_BOOL findComponent(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL goBack(IFXJS_Context* cc, + FX_BOOL goBack(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL goForward(IFXJS_Context* cc, + FX_BOOL goForward(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL launchURL(IFXJS_Context* cc, + FX_BOOL launchURL(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL mailMsg(IFXJS_Context* cc, + FX_BOOL mailMsg(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL newFDF(IFXJS_Context* cc, + FX_BOOL newFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL newDoc(IFXJS_Context* cc, + FX_BOOL newDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL openDoc(IFXJS_Context* cc, + FX_BOOL openDoc(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL openFDF(IFXJS_Context* cc, + FX_BOOL openFDF(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL popUpMenuEx(IFXJS_Context* cc, + FX_BOOL popUpMenuEx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL popUpMenu(IFXJS_Context* cc, + FX_BOOL popUpMenu(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL response(IFXJS_Context* cc, + FX_BOOL response(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL setInterval(IFXJS_Context* cc, + FX_BOOL setInterval(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL setTimeOut(IFXJS_Context* cc, + FX_BOOL setTimeOut(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp index da6fc60076..791785a626 100644 --- a/fpdfsdk/src/javascript/color.cpp +++ b/fpdfsdk/src/javascript/color.cpp @@ -14,7 +14,7 @@ #include "JS_Context.h" #include "JS_Runtime.h" -static v8::Isolate* GetIsolate(IFXJS_Context* cc) { +static v8::Isolate* GetIsolate(IJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -140,7 +140,7 @@ void color::ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color) { } #define JS_IMPLEMENT_COLORPROP(prop, var) \ - FX_BOOL color::prop(IFXJS_Context* cc, CJS_PropValue& vp, \ + FX_BOOL color::prop(IJS_Context* cc, CJS_PropValue& vp, \ CFX_WideString& sError) { \ CJS_Context* pContext = (CJS_Context*)cc; \ v8::Isolate* isolate = pContext->GetJSRuntime()->GetIsolate(); \ @@ -170,7 +170,7 @@ JS_IMPLEMENT_COLORPROP(dkGray, m_crDKGray) JS_IMPLEMENT_COLORPROP(gray, m_crGray) JS_IMPLEMENT_COLORPROP(ltGray, m_crLTGray) -FX_BOOL color::convert(IFXJS_Context* cc, +FX_BOOL color::convert(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -207,7 +207,7 @@ FX_BOOL color::convert(IFXJS_Context* cc, return TRUE; } -FX_BOOL color::equal(IFXJS_Context* cc, +FX_BOOL color::equal(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { diff --git a/fpdfsdk/src/javascript/color.h b/fpdfsdk/src/javascript/color.h index 12b1f7a01b..3a6356ae75 100644 --- a/fpdfsdk/src/javascript/color.h +++ b/fpdfsdk/src/javascript/color.h @@ -15,26 +15,26 @@ class color : public CJS_EmbedObj { color(CJS_Object* pJSObject); ~color() override; - FX_BOOL black(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL blue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL cyan(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL dkGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL gray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL green(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL ltGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL magenta(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL transparent(IFXJS_Context* cc, + FX_BOOL black(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL blue(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL cyan(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL dkGray(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL gray(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL green(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL ltGray(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL magenta(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL red(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL transparent(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL white(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL yellow(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL convert(IFXJS_Context* cc, + FX_BOOL convert(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL equal(IFXJS_Context* cc, + FX_BOOL equal(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp index a44d239552..ebd7162650 100644 --- a/fpdfsdk/src/javascript/console.cpp +++ b/fpdfsdk/src/javascript/console.cpp @@ -34,21 +34,21 @@ console::console(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {} console::~console() {} -FX_BOOL console::clear(IFXJS_Context* cc, +FX_BOOL console::clear(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL console::hide(IFXJS_Context* cc, +FX_BOOL console::hide(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { return TRUE; } -FX_BOOL console::println(IFXJS_Context* cc, +FX_BOOL console::println(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -58,7 +58,7 @@ FX_BOOL console::println(IFXJS_Context* cc, return TRUE; } -FX_BOOL console::show(IFXJS_Context* cc, +FX_BOOL console::show(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { diff --git a/fpdfsdk/src/javascript/console.h b/fpdfsdk/src/javascript/console.h index b3cdf268c2..535fe9e94e 100644 --- a/fpdfsdk/src/javascript/console.h +++ b/fpdfsdk/src/javascript/console.h @@ -15,19 +15,19 @@ class console : public CJS_EmbedObj { ~console() override; public: - FX_BOOL clear(IFXJS_Context* cc, + FX_BOOL clear(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL hide(IFXJS_Context* cc, + FX_BOOL hide(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL println(IFXJS_Context* cc, + FX_BOOL println(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL show(IFXJS_Context* cc, + FX_BOOL show(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp index 0d02503c96..a6bd5dca1f 100644 --- a/fpdfsdk/src/javascript/event.cpp +++ b/fpdfsdk/src/javascript/event.cpp @@ -52,7 +52,7 @@ event::event(CJS_Object* pJsObject) : CJS_EmbedObj(pJsObject) {} event::~event() { } -FX_BOOL event::change(IFXJS_Context* cc, +FX_BOOL event::change(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -70,7 +70,7 @@ FX_BOOL event::change(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::changeEx(IFXJS_Context* cc, +FX_BOOL event::changeEx(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -85,7 +85,7 @@ FX_BOOL event::changeEx(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::commitKey(IFXJS_Context* cc, +FX_BOOL event::commitKey(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -100,7 +100,7 @@ FX_BOOL event::commitKey(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::fieldFull(IFXJS_Context* cc, +FX_BOOL event::fieldFull(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -119,7 +119,7 @@ FX_BOOL event::fieldFull(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::keyDown(IFXJS_Context* cc, +FX_BOOL event::keyDown(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -137,7 +137,7 @@ FX_BOOL event::keyDown(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::modifier(IFXJS_Context* cc, +FX_BOOL event::modifier(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -155,7 +155,7 @@ FX_BOOL event::modifier(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::name(IFXJS_Context* cc, +FX_BOOL event::name(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -170,9 +170,7 @@ FX_BOOL event::name(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::rc(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError) { +FX_BOOL event::rc(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -187,7 +185,7 @@ FX_BOOL event::rc(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::richChange(IFXJS_Context* cc, +FX_BOOL event::richChange(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; @@ -198,7 +196,7 @@ FX_BOOL event::richChange(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::richChangeEx(IFXJS_Context* cc, +FX_BOOL event::richChangeEx(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; @@ -209,7 +207,7 @@ FX_BOOL event::richChangeEx(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::richValue(IFXJS_Context* cc, +FX_BOOL event::richValue(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { return TRUE; @@ -220,7 +218,7 @@ FX_BOOL event::richValue(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::selEnd(IFXJS_Context* cc, +FX_BOOL event::selEnd(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -241,7 +239,7 @@ FX_BOOL event::selEnd(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::selStart(IFXJS_Context* cc, +FX_BOOL event::selStart(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -261,7 +259,7 @@ FX_BOOL event::selStart(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::shift(IFXJS_Context* cc, +FX_BOOL event::shift(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -279,7 +277,7 @@ FX_BOOL event::shift(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::source(IFXJS_Context* cc, +FX_BOOL event::source(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -294,7 +292,7 @@ FX_BOOL event::source(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::target(IFXJS_Context* cc, +FX_BOOL event::target(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -309,7 +307,7 @@ FX_BOOL event::target(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::targetName(IFXJS_Context* cc, +FX_BOOL event::targetName(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -324,7 +322,7 @@ FX_BOOL event::targetName(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::type(IFXJS_Context* cc, +FX_BOOL event::type(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) @@ -339,7 +337,7 @@ FX_BOOL event::type(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::value(IFXJS_Context* cc, +FX_BOOL event::value(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Context* pContext = (CJS_Context*)cc; @@ -360,7 +358,7 @@ FX_BOOL event::value(IFXJS_Context* cc, return TRUE; } -FX_BOOL event::willCommit(IFXJS_Context* cc, +FX_BOOL event::willCommit(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { if (!vp.IsGetting()) diff --git a/fpdfsdk/src/javascript/event.h b/fpdfsdk/src/javascript/event.h index 8efa2dfbb8..7ebe571f86 100644 --- a/fpdfsdk/src/javascript/event.h +++ b/fpdfsdk/src/javascript/event.h @@ -15,44 +15,32 @@ class event : public CJS_EmbedObj { ~event() override; public: - FX_BOOL change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL changeEx(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL commitKey(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL fieldFull(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL modifier(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL richChange(IFXJS_Context* cc, + FX_BOOL change(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL changeEx(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL commitKey(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL fieldFull(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL keyDown(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL modifier(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL name(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL rc(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL richChange(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL richChangeEx(IFXJS_Context* cc, + FX_BOOL richChangeEx(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL richValue(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL selStart(IFXJS_Context* cc, - CJS_PropValue& vp, - CFX_WideString& sError); - FX_BOOL shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL targetName(IFXJS_Context* cc, + FX_BOOL richValue(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL selEnd(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL selStart(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL shift(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL source(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL target(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL targetName(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL willCommit(IFXJS_Context* cc, + FX_BOOL type(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL value(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL willCommit(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); }; diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index cd4545d3cb..7e508fce18 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -88,7 +88,7 @@ END_JS_STATIC_METHOD() IMPLEMENT_SPECIAL_JS_CLASS(CJS_Global, JSGlobalAlternate, global); -FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc) { +FX_BOOL CJS_Global::InitInstance(IJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -119,7 +119,7 @@ FX_BOOL JSGlobalAlternate::QueryProperty(const FX_WCHAR* propname) { return CFX_WideString(propname) != L"setPersistent"; } -FX_BOOL JSGlobalAlternate::DelProperty(IFXJS_Context* cc, +FX_BOOL JSGlobalAlternate::DelProperty(IJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError) { auto it = m_mapGlobal.find(CFX_ByteString::FromUnicode(propname)); @@ -130,7 +130,7 @@ FX_BOOL JSGlobalAlternate::DelProperty(IFXJS_Context* cc, return TRUE; } -FX_BOOL JSGlobalAlternate::DoProperty(IFXJS_Context* cc, +FX_BOOL JSGlobalAlternate::DoProperty(IJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError) { @@ -209,7 +209,7 @@ FX_BOOL JSGlobalAlternate::DoProperty(IFXJS_Context* cc, return FALSE; } -FX_BOOL JSGlobalAlternate::setPersistent(IFXJS_Context* cc, +FX_BOOL JSGlobalAlternate::setPersistent(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { diff --git a/fpdfsdk/src/javascript/global.h b/fpdfsdk/src/javascript/global.h index ac79ff2f3d..5ae9c9f9db 100644 --- a/fpdfsdk/src/javascript/global.h +++ b/fpdfsdk/src/javascript/global.h @@ -40,16 +40,16 @@ class JSGlobalAlternate : public CJS_EmbedObj { JSGlobalAlternate(CJS_Object* pJSObject); ~JSGlobalAlternate() override; - FX_BOOL setPersistent(IFXJS_Context* cc, + FX_BOOL setPersistent(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL QueryProperty(const FX_WCHAR* propname); - FX_BOOL DoProperty(IFXJS_Context* cc, + FX_BOOL DoProperty(IJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL DelProperty(IFXJS_Context* cc, + FX_BOOL DelProperty(IJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError); void Initial(CPDFDoc_Environment* pApp); @@ -83,7 +83,7 @@ class CJS_Global : public CJS_Object { ~CJS_Global() override {} // CJS_Object - FX_BOOL InitInstance(IFXJS_Context* cc) override; + FX_BOOL InitInstance(IJS_Context* cc) override; DECLARE_SPECIAL_JS_CLASS(); JS_SPECIAL_STATIC_METHOD(setPersistent, JSGlobalAlternate, global); diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp index 629b74972c..269a038319 100644 --- a/fpdfsdk/src/javascript/report.cpp +++ b/fpdfsdk/src/javascript/report.cpp @@ -30,7 +30,7 @@ Report::Report(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {} Report::~Report() {} -FX_BOOL Report::writeText(IFXJS_Context* cc, +FX_BOOL Report::writeText(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -38,7 +38,7 @@ FX_BOOL Report::writeText(IFXJS_Context* cc, return TRUE; } -FX_BOOL Report::save(IFXJS_Context* cc, +FX_BOOL Report::save(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { diff --git a/fpdfsdk/src/javascript/report.h b/fpdfsdk/src/javascript/report.h index 798106bb11..51b1c78303 100644 --- a/fpdfsdk/src/javascript/report.h +++ b/fpdfsdk/src/javascript/report.h @@ -15,11 +15,11 @@ class Report : public CJS_EmbedObj { ~Report() override; public: - FX_BOOL save(IFXJS_Context* cc, + FX_BOOL save(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL writeText(IFXJS_Context* cc, + FX_BOOL writeText(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index c83aa6f5bc..6a48c09a08 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -20,7 +20,7 @@ #include #endif -static v8::Isolate* GetIsolate(IFXJS_Context* cc) { +static v8::Isolate* GetIsolate(IJS_Context* cc) { CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); @@ -124,7 +124,7 @@ int util::ParstDataType(std::wstring* sFormat) { return -1; } -FX_BOOL util::printf(IFXJS_Context* cc, +FX_BOOL util::printf(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -187,7 +187,7 @@ FX_BOOL util::printf(IFXJS_Context* cc, return TRUE; } -FX_BOOL util::printd(IFXJS_Context* cc, +FX_BOOL util::printd(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -400,7 +400,7 @@ void util::printd(const std::wstring& cFormat2, cPurpose = cFormat; } -FX_BOOL util::printx(IFXJS_Context* cc, +FX_BOOL util::printx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -500,7 +500,7 @@ void util::printx(const std::string& cFormat, } } -FX_BOOL util::scand(IFXJS_Context* cc, +FX_BOOL util::scand(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { @@ -551,7 +551,7 @@ int64_t FX_atoi64(const char* nptr) { return sign == '-' ? -total : total; } -FX_BOOL util::byteToChar(IFXJS_Context* cc, +FX_BOOL util::byteToChar(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { diff --git a/fpdfsdk/src/javascript/util.h b/fpdfsdk/src/javascript/util.h index 8d0d5bd562..1affeac8ad 100644 --- a/fpdfsdk/src/javascript/util.h +++ b/fpdfsdk/src/javascript/util.h @@ -17,23 +17,23 @@ class util : public CJS_EmbedObj { ~util() override; public: - FX_BOOL printd(IFXJS_Context* cc, + FX_BOOL printd(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL printf(IFXJS_Context* cc, + FX_BOOL printf(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL printx(IFXJS_Context* cc, + FX_BOOL printx(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL scand(IFXJS_Context* cc, + FX_BOOL scand(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - FX_BOOL byteToChar(IFXJS_Context* cc, + FX_BOOL byteToChar(IJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index a10eb2ae81..eae1bb414a 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -268,8 +268,8 @@ void FXJS_DefineGlobalConst(v8::Isolate* pIsolate, } void FXJS_InitializeRuntime(v8::Isolate* pIsolate, - IFXJS_Runtime* pFXRuntime, - IFXJS_Context* context, + IJS_Runtime* pFXRuntime, + IJS_Context* context, v8::Global& v8PersistentContext) { if (pIsolate == g_isolate) ++g_isolate_ref_count; @@ -351,14 +351,14 @@ void FXJS_ReleaseRuntime(v8::Isolate* pIsolate, delete pData; } -IFXJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate) { +IJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate) { v8::Local context = pIsolate->GetCurrentContext(); - return static_cast( + return static_cast( context->GetAlignedPointerFromEmbedderData(kPerContextDataIndex)); } int FXJS_Execute(v8::Isolate* pIsolate, - IFXJS_Context* pJSContext, + IJS_Context* pJSContext, const wchar_t* script, long length, FXJSErr* pError) { @@ -387,7 +387,7 @@ int FXJS_Execute(v8::Isolate* pIsolate, } v8::Local FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, - IFXJS_Context* pJSContext, + IJS_Context* pJSContext, int nObjDefnID) { v8::Isolate::Scope isolate_scope(pIsolate); v8::Local context = pIsolate->GetCurrentContext(); -- cgit v1.2.3