diff options
Diffstat (limited to 'fpdfsdk/include/javascript')
-rw-r--r-- | fpdfsdk/include/javascript/Document.h | 162 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/Field.h | 172 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/IJavaScript.h | 58 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/Icon.h | 2 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/JS_Context.h | 62 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/JS_Define.h | 10 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/JS_EventHandler.h | 80 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/JS_GlobalData.h | 6 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/JS_Object.h | 14 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/JS_Runtime.h | 12 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/JS_Value.h | 18 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/PublicMethods.h | 68 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/app.h | 70 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/color.h | 28 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/console.h | 8 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/event.h | 40 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/global.h | 18 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/report.h | 4 | ||||
-rw-r--r-- | fpdfsdk/include/javascript/util.h | 10 |
19 files changed, 421 insertions, 421 deletions
diff --git a/fpdfsdk/include/javascript/Document.h b/fpdfsdk/include/javascript/Document.h index eae3e0730d..b6447fda2a 100644 --- a/fpdfsdk/include/javascript/Document.h +++ b/fpdfsdk/include/javascript/Document.h @@ -16,14 +16,14 @@ public: virtual ~PrintParamsObj(){} public: - bool bUI; + FX_BOOL bUI; int nStart; int nEnd; - bool bSilent; - bool bShrinkToFit; - bool bPrintAsImage; - bool bReverse; - bool bAnnotations; + FX_BOOL bSilent; + FX_BOOL bShrinkToFit; + FX_BOOL bPrintAsImage; + FX_BOOL bReverse; + FX_BOOL bAnnotations; }; class CJS_PrintParamsObj : public CJS_Object @@ -85,84 +85,84 @@ public: virtual ~Document(); public: - bool ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + 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, 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, 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, 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, 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); - bool addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); public: void AttachDoc(CPDFSDK_Document* pDoc); CPDFSDK_Document* GetReaderDoc(); - static bool ExtractFileName(CPDFSDK_Document* pDoc, CFX_ByteString& strFileName); - static bool ExtractFolderName(CPDFSDK_Document* pDoc, CFX_ByteString& strFolderName); + static FX_BOOL ExtractFileName(CPDFSDK_Document* pDoc, CFX_ByteString& strFileName); + static FX_BOOL ExtractFolderName(CPDFSDK_Document* pDoc, CFX_ByteString& strFolderName); void AddDelayData(CJS_DelayData* pData); void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex); void AddDelayAnnotData(CJS_AnnotObj *pData); @@ -176,7 +176,7 @@ private: bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect); int CountWords(CPDF_TextObject* pTextObj); CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); - bool ParserParams(JSObject *pObj,CJS_AnnotObj& annotobj); + FX_BOOL ParserParams(JSObject *pObj,CJS_AnnotObj& annotobj); v8::Isolate* m_isolate; IconTree* m_pIconTree; @@ -193,7 +193,7 @@ public: CJS_Document(JSFXObject pObject) : CJS_Object(pObject) {}; virtual ~CJS_Document(){}; - virtual bool InitInstance(IFXJS_Context* cc); + virtual FX_BOOL InitInstance(IFXJS_Context* cc); DECLARE_JS_CLASS(CJS_Document); diff --git a/fpdfsdk/include/javascript/Field.h b/fpdfsdk/include/javascript/Field.h index 2a6ba7d1ce..70d1d39b48 100644 --- a/fpdfsdk/include/javascript/Field.h +++ b/fpdfsdk/include/javascript/Field.h @@ -103,85 +103,85 @@ public: Field(CJS_Object* pJSObject); virtual ~Field(void); - bool alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL calcOrderIndex(IFXJS_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, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL doNotSpellCheck(IFXJS_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, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL fileSelect(IFXJS_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, 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, 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, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL submitName(IFXJS_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, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); public: static void SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string); @@ -225,9 +225,9 @@ public: const CFX_WideString& sName, const CPDF_Rect& rcCoords); public: static void UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, - bool bChangeMark, bool bResetAP, bool bRefresh); + FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh); static void UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl, - bool bChangeMark, bool bResetAP, bool bRefresh); + FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh); static CPDFSDK_Widget* GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl); static void GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldsArray); @@ -235,14 +235,14 @@ public: static void DoDelay(CPDFSDK_Document* pDocument, CJS_DelayData* pData); public: - bool AttachField(Document* pDocument, const CFX_WideString& csFieldName); - void SetDelay(bool bDelay); + FX_BOOL AttachField(Document* pDocument, const CFX_WideString& csFieldName); + void SetDelay(FX_BOOL bDelay); void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;} protected: void ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &strFieldName,int & iControlNo); void GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& FieldsArray); CPDF_FormControl* GetSmartFieldControl(CPDF_FormField* pFormField); - bool ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel); + FX_BOOL ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel); void AddDelay_Int(enum FIELD_PROP prop, int32_t n); void AddDelay_Bool(enum FIELD_PROP prop,bool b); @@ -259,9 +259,9 @@ public: CPDFSDK_Document* m_pDocument; CFX_WideString m_FieldName; int m_nFormControlIndex; - bool m_bCanSet; + FX_BOOL m_bCanSet; - bool m_bDelay; + FX_BOOL m_bDelay; v8::Isolate* m_isolate; }; @@ -271,7 +271,7 @@ public: CJS_Field(JSFXObject pObject) : CJS_Object(pObject) {}; virtual ~CJS_Field(void){}; - virtual bool InitInstance(IFXJS_Context* cc); + virtual FX_BOOL InitInstance(IFXJS_Context* cc); DECLARE_JS_CLASS(CJS_Field); diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h index 37e12dccf8..783b249ff6 100644 --- a/fpdfsdk/include/javascript/IJavaScript.h +++ b/fpdfsdk/include/javascript/IJavaScript.h @@ -19,8 +19,8 @@ class IFXJS_Context { public: virtual ~IFXJS_Context() { } - virtual bool Compile(const CFX_WideString& script, CFX_WideString& info) = 0; - virtual bool RunScript(const CFX_WideString& script, CFX_WideString& info) = 0; + virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info) = 0; + virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info) = 0; virtual void OnApp_Init() = 0; @@ -36,32 +36,32 @@ public: virtual void OnPage_InView(CPDFSDK_Document* pTarget) = 0; virtual void OnPage_OutView(CPDFSDK_Document* pTarget) = 0; - virtual void OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField* pTarget) = 0; - virtual void OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField* pTarget) = 0; - virtual void OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField* pTarget) = 0; - virtual void OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField* pTarget) = 0; - virtual void OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0; - virtual void OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0; + virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; + virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; + virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; + virtual void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0; + virtual void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0; + virtual void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0; - virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc) = 0; - virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit) = 0; + virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0; + virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit) = 0; virtual void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx, - bool KeyDown, bool bModifier, int &nSelEnd,int &nSelStart, bool bShift, - CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit, - bool bFieldFull, bool &bRc) = 0; - virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, bool bKeyDown, - bool bModifier, bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc) = 0; - - virtual void OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; - virtual void OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0; + FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift, + CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, + FX_BOOL bFieldFull, FX_BOOL &bRc) = 0; + virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, + FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0; + + virtual void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; + virtual void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0; virtual void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark) = 0; virtual void OnLink_MouseUp(CPDFSDK_Document* pTarget) = 0; @@ -71,7 +71,7 @@ public: virtual void OnConsole_Exec() = 0; virtual void OnExternal_Exec() = 0; - virtual void EnableMessageBox(bool bEnable) = 0; + virtual void EnableMessageBox(FX_BOOL bEnable) = 0; }; class IFXJS_Runtime @@ -94,7 +94,7 @@ class CJS_GlobalData; class CJS_RuntimeFactory { public: - CJS_RuntimeFactory():m_bInit(false),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {} + CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {} ~CJS_RuntimeFactory(); IFXJS_Runtime* NewJSRuntime(CPDFDoc_Environment* pApp); void DeleteJSRuntime(IFXJS_Runtime* pRuntime); @@ -104,7 +104,7 @@ public: CJS_GlobalData* NewGlobalData(CPDFDoc_Environment* pApp); void ReleaseGlobalData(); private: - bool m_bInit; + FX_BOOL m_bInit; int m_nRef; CJS_GlobalData* m_pGlobalData; int32_t m_nGlobalDataCount; diff --git a/fpdfsdk/include/javascript/Icon.h b/fpdfsdk/include/javascript/Icon.h index 367db7bc49..0298005f00 100644 --- a/fpdfsdk/include/javascript/Icon.h +++ b/fpdfsdk/include/javascript/Icon.h @@ -14,7 +14,7 @@ class Icon : public CJS_EmbedObj public: Icon(CJS_Object* pJSObject); virtual ~Icon(); - bool name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL name(IFXJS_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/include/javascript/JS_Context.h b/fpdfsdk/include/javascript/JS_Context.h index 79d01a02f8..2e2cf37a5e 100644 --- a/fpdfsdk/include/javascript/JS_Context.h +++ b/fpdfsdk/include/javascript/JS_Context.h @@ -21,8 +21,8 @@ public: virtual ~CJS_Context(); public: - virtual bool Compile(const CFX_WideString& script, CFX_WideString& info); - virtual bool RunScript(const CFX_WideString& script, CFX_WideString& info); + virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info); + virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info); public: virtual void OnApp_Init(); @@ -39,32 +39,32 @@ public: virtual void OnPage_InView(CPDFSDK_Document* pTarget); virtual void OnPage_OutView(CPDFSDK_Document* pTarget); - virtual void OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField *pTarget); - virtual void OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget); - virtual void OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget); - virtual void OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget); - virtual void OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value); - virtual void OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value); + virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); + virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); + virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); + virtual void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); + virtual void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value); + virtual void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value); - virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc); - virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit); + virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc); + virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit); virtual void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx, - bool bKeyDown, bool bModifier, int &nSelEnd,int &nSelStart, bool bShift, - CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit, - bool bFieldFull, bool &bRc); - virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, bool bKeyDown, - bool bModifier, bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc); - - virtual void OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - virtual void OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); + FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift, + CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, + FX_BOOL bFieldFull, FX_BOOL &bRc); + virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, + FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc); + + virtual void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + virtual void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); virtual void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark); virtual void OnLink_MouseUp(CPDFSDK_Document* pTarget); @@ -74,14 +74,14 @@ public: virtual void OnConsole_Exec(); virtual void OnExternal_Exec(); - virtual void EnableMessageBox(bool bEnable) {m_bMsgBoxEnable = bEnable;} - bool IsMsgBoxEnabled() const {return m_bMsgBoxEnable;} + virtual void EnableMessageBox(FX_BOOL bEnable) {m_bMsgBoxEnable = bEnable;} + FX_BOOL IsMsgBoxEnabled() const {return m_bMsgBoxEnable;} public: CPDFDoc_Environment* GetReaderApp(); CJS_Runtime* GetJSRuntime(){return m_pRuntime;} - bool DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info); + FX_BOOL DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info); CJS_EventHandler* GetEventHandler(){return m_pEventHandler;}; CPDFSDK_Document* GetReaderDocument(); @@ -90,8 +90,8 @@ private: CJS_Runtime* m_pRuntime; CJS_EventHandler* m_pEventHandler; - bool m_bBusy; - bool m_bMsgBoxEnable; + FX_BOOL m_bBusy; + FX_BOOL m_bMsgBoxEnable; }; #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_CONTEXT_H_ diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h index 087f489126..f1b36bf3d0 100644 --- a/fpdfsdk/include/javascript/JS_Define.h +++ b/fpdfsdk/include/javascript/JS_Define.h @@ -51,7 +51,7 @@ struct JSMethodSpec /* ======================================== PROP CALLBACK ============================================ */ -template <class C, bool (C::*M)(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)> +template <class C, FX_BOOL (C::*M)(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)> void JSPropGetter(const char* prop_name_string, const char* class_name_string, v8::Local<v8::String> property, @@ -74,7 +74,7 @@ void JSPropGetter(const char* prop_name_string, info.GetReturnValue().Set((v8::Local<v8::Value>)value); } -template <class C, bool (C::*M)(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)> +template <class C, FX_BOOL (C::*M)(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)> void JSPropSetter(const char* prop_name_string, const char* class_name_string, v8::Local<v8::String> property, @@ -113,7 +113,7 @@ void JSPropSetter(const char* prop_name_string, /* ========================================= METHOD CALLBACK =========================================== */ -template <class C, bool (C::*M)(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)> +template <class C, FX_BOOL (C::*M)(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)> void JSMethod(const char* method_name_string, const char* class_name_string, const v8::FunctionCallbackInfo<v8::Value>& info) { @@ -240,7 +240,7 @@ void JSSpecialPropQuery(const char *, v8::Local<v8::String> property,const v8::P CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length()); CJS_Object* pJSObj = reinterpret_cast<CJS_Object*>(JS_GetPrivate(isolate, info.Holder())); Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject()); - bool bRet = pObj->QueryProperty(propname.c_str()); + FX_BOOL bRet = pObj->QueryProperty(propname.c_str()); info.GetReturnValue().Set(bRet ? 4 : 0); } @@ -382,7 +382,7 @@ int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\ /* ======================================== GLOBAL METHODS ============================================ */ -template <bool (*F)(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)> +template <FX_BOOL (*F)(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)> void JSGlobalFunc(const char *func_name_string, const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Isolate* isolate = info.GetIsolate(); diff --git a/fpdfsdk/include/javascript/JS_EventHandler.h b/fpdfsdk/include/javascript/JS_EventHandler.h index 9977462094..62afb829e7 100644 --- a/fpdfsdk/include/javascript/JS_EventHandler.h +++ b/fpdfsdk/include/javascript/JS_EventHandler.h @@ -79,32 +79,32 @@ public: void OnPage_InView(CPDFSDK_Document* pTarget); void OnPage_OutView(CPDFSDK_Document* pTarget); - void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc); - void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit); + void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc); + void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit); void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx, - bool KeyDown, bool bModifier, int &nSelEnd,int &nSelStart, bool bShift, - CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit, - bool bFieldFull, bool &bRc); - void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, bool bKeyDown, - bool bModifier, bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc); - - void OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField *pTarget); - void OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget); - void OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget); - void OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget); - void OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value); - void OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value); - - void OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); - void OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen); + FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift, + CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, + FX_BOOL bFieldFull, FX_BOOL &bRc); + void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, + FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc); + + void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); + void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); + void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); + void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); + void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value); + void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value); + + void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); + void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen); void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark); void OnLink_MouseUp(CPDFSDK_Document* pTarget); @@ -117,25 +117,25 @@ public: public: void Initial(JS_EVENT_T type); void Destroy(); - bool IsValid(); + FX_BOOL IsValid(); CFX_WideString& Change(); CFX_WideString ChangeEx(); int CommitKey(); - bool FieldFull(); - bool KeyDown(); - bool Modifier(); + FX_BOOL FieldFull(); + FX_BOOL KeyDown(); + FX_BOOL Modifier(); const FX_WCHAR* Name(); const FX_WCHAR* Type(); - bool& Rc(); + FX_BOOL& Rc(); int& SelEnd(); int& SelStart(); - bool Shift(); + FX_BOOL Shift(); Field* Source(); Field* Target_Field(); CFX_WideString& Value(); - bool WillCommit(); + FX_BOOL WillCommit(); CFX_WideString TargetName(); JS_EVENT_T EventType() {return m_eEventType;}; @@ -143,7 +143,7 @@ public: public: CJS_Context* m_pJSContext; JS_EVENT_T m_eEventType; - bool m_bValid; + FX_BOOL m_bValid; CFX_WideString m_strTargetName; CFX_WideString m_strSourceName; @@ -151,18 +151,18 @@ public: CFX_WideString m_WideStrChangeDu; CFX_WideString m_WideStrChangeEx; int m_nCommitKey; - bool m_bKeyDown; - bool m_bModifier; - bool m_bShift; + FX_BOOL m_bKeyDown; + FX_BOOL m_bModifier; + FX_BOOL m_bShift; int* m_pISelEnd; int m_nSelEndDu; int* m_pISelStart; int m_nSelStartDu; - bool m_bWillCommit; + FX_BOOL m_bWillCommit; CFX_WideString* m_pValue; - bool m_bFieldFull; - bool* m_pbRc; - bool m_bRcDu; + FX_BOOL m_bFieldFull; + FX_BOOL* m_pbRc; + FX_BOOL m_bRcDu; CPDFSDK_Document* m_pSourceDoc; CPDF_Bookmark* m_pTargetBookMark; diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h index 987de95666..b3637b93d5 100644 --- a/fpdfsdk/include/javascript/JS_GlobalData.h +++ b/fpdfsdk/include/javascript/JS_GlobalData.h @@ -56,7 +56,7 @@ public: virtual ~CJS_GlobalData_Element(){} CJS_KeyValue data; - bool bPersistent; + FX_BOOL bPersistent; }; class CJS_GlobalData @@ -72,8 +72,8 @@ public: void SetGlobalVariableObject(const FX_CHAR* propname, const CJS_GlobalVariableArray& array); void SetGlobalVariableNull(const FX_CHAR* propname); - bool SetGlobalVariablePersistent(const FX_CHAR* propname, bool bPersistent); - bool DeleteGlobalVariable(const FX_CHAR* propname); + FX_BOOL SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent); + FX_BOOL DeleteGlobalVariable(const FX_CHAR* propname); int32_t GetSize() const; CJS_GlobalData_Element* GetAt(int index) const; diff --git a/fpdfsdk/include/javascript/JS_Object.h b/fpdfsdk/include/javascript/JS_Object.h index f8ec90e3c4..3898d184d1 100644 --- a/fpdfsdk/include/javascript/JS_Object.h +++ b/fpdfsdk/include/javascript/JS_Object.h @@ -48,11 +48,11 @@ public: void MakeWeak(); void Dispose(); - virtual bool IsType(const FX_CHAR* sClassName){return true;}; + virtual FX_BOOL IsType(const FX_CHAR* sClassName){return TRUE;}; virtual CFX_ByteString GetClassName(){return "";}; - virtual bool InitInstance(IFXJS_Context* cc){return true;}; - virtual bool ExitInstance(){return true;}; + virtual FX_BOOL InitInstance(IFXJS_Context* cc){return TRUE;}; + virtual FX_BOOL ExitInstance(){return TRUE;}; operator JSFXObject () {return v8::Local<v8::Object>::New(m_pIsolate, m_pObject);} operator CJS_EmbedObj* (){return m_pEmbedObj;}; @@ -172,7 +172,7 @@ public: CJS_Timer(CJS_EmbedObj * pObj,CPDFDoc_Environment* pApp): m_nTimerID(0), m_pEmbedObj(pObj), - m_bProcessing(false), + m_bProcessing(FALSE), m_dwStartTime(0), m_dwTimeOut(0), m_dwElapse(0), @@ -265,9 +265,9 @@ public: { if (!pTimer->m_bProcessing) { - pTimer->m_bProcessing = true; + pTimer->m_bProcessing = TRUE; if (pTimer->m_pEmbedObj) pTimer->m_pEmbedObj->TimerProc(pTimer); - pTimer->m_bProcessing = false; + pTimer->m_bProcessing = FALSE; } else { @@ -279,7 +279,7 @@ public: private: FX_UINT m_nTimerID; CJS_EmbedObj* m_pEmbedObj; - bool m_bProcessing; + FX_BOOL m_bProcessing; //data FX_DWORD m_dwStartTime; diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h index b9ad6efc47..8fdfa8b733 100644 --- a/fpdfsdk/include/javascript/JS_Runtime.h +++ b/fpdfsdk/include/javascript/JS_Runtime.h @@ -44,15 +44,15 @@ public: CPDFDoc_Environment * GetReaderApp(){return m_pApp;} - bool InitJSObjects(); + FX_BOOL InitJSObjects(); - bool AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType); + FX_BOOL AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType); void RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType); void RemoveEventsInLoop(CJS_FieldEvent* pStart); - void BeginBlock(){m_bBlocking = true;} - void EndBlock(){m_bBlocking = false;} - bool IsBlocking(){return m_bBlocking;} + void BeginBlock(){m_bBlocking = TRUE;} + void EndBlock(){m_bBlocking = FALSE;} + FX_BOOL IsBlocking(){return m_bBlocking;} operator IJS_Runtime*() {return (IJS_Runtime*)m_isolate;} v8::Isolate* GetIsolate(){return m_isolate;}; @@ -63,7 +63,7 @@ protected: CFX_ArrayTemplate<CJS_Context*> m_ContextArray; CPDFDoc_Environment* m_pApp; CPDFSDK_Document* m_pDocument; - bool m_bBlocking; + FX_BOOL m_bBlocking; CJS_FieldEvent* m_pFieldEventPath; v8::Isolate* m_isolate; diff --git a/fpdfsdk/include/javascript/JS_Value.h b/fpdfsdk/include/javascript/JS_Value.h index 035cef064d..6186817fa5 100644 --- a/fpdfsdk/include/javascript/JS_Value.h +++ b/fpdfsdk/include/javascript/JS_Value.h @@ -63,12 +63,12 @@ public: void operator = (const FX_CHAR* pStr); void operator = (CJS_Value value); - bool IsArrayObject() const; - bool IsDateObject() const; + FX_BOOL IsArrayObject() const; + FX_BOOL IsDateObject() const; FXJSVALUETYPE GetType() const; - bool ConvertToArray(CJS_Array &) const; - bool ConvertToDate(CJS_Date &) const; + FX_BOOL ConvertToArray(CJS_Array &) const; + FX_BOOL ConvertToDate(CJS_Date &) const; v8::Isolate* GetIsolate() {return m_isolate;} protected: @@ -95,8 +95,8 @@ public: CJS_PropValue(v8::Isolate* isolate); ~CJS_PropValue(); public: - bool IsSetting(); - bool IsGetting(); + FX_BOOL IsSetting(); + FX_BOOL IsGetting(); void operator<<(int); void operator>>(int&) const; void operator<<(bool); @@ -122,7 +122,7 @@ public: void StartSetting(); void StartGetting(); private: - bool m_bIsSetting; + FX_BOOL m_bIsSetting; }; class CJS_Array @@ -135,7 +135,7 @@ public: void GetElement(unsigned index,CJS_Value &value); void SetElement(unsigned index,CJS_Value value); int GetLength(); - bool IsAttached(); + FX_BOOL IsAttached(); operator v8::Local<v8::Array>(); v8::Isolate* GetIsolate() {return m_isolate;} @@ -179,7 +179,7 @@ public: static double MakeDate(int year, int mon, int mday,int hour, int min, int sec,int ms); - bool IsValidDate(); + FX_BOOL IsValidDate(); protected: v8::Local<v8::Value> m_pDate; diff --git a/fpdfsdk/include/javascript/PublicMethods.h b/fpdfsdk/include/javascript/PublicMethods.h index 7fca363a11..cff9e11479 100644 --- a/fpdfsdk/include/javascript/PublicMethods.h +++ b/fpdfsdk/include/javascript/PublicMethods.h @@ -16,28 +16,28 @@ public: virtual ~CJS_PublicMethods(void){}; public: - static bool AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); // - static bool AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);// - static bool AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static bool AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); // + static FX_BOOL AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);// + static FX_BOOL AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); public: JS_STATIC_GLOBAL_FUN(AFNumber_Format); @@ -68,13 +68,13 @@ public: public: static int ParseStringInteger(const CFX_WideString & string,int nStart,int & nSkip, int nMaxStep); static CFX_WideString ParseStringString(const CFX_WideString& string, int nStart, int& nSkip); - static double MakeRegularDate(const CFX_WideString & value,const CFX_WideString & format, bool& bWrongFormat); + static double MakeRegularDate(const CFX_WideString & value,const CFX_WideString & format, FX_BOOL& bWrongFormat); static CFX_WideString MakeFormatDate(double dDate,const CFX_WideString & format); - static bool ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, bool & bDot); + static FX_BOOL ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot); static double ParseStringToNumber(const FX_WCHAR* swSource); - static double ParseNormalDate(const CFX_WideString & value, bool& bWrongFormat); + static double ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat); static double MakeInterDate(CFX_WideString strValue); - static double ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits, bool& bDot, bool& bSign, bool& bKXJS); + static double ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS); public: static CFX_WideString StrLTrim(const FX_WCHAR* pStr); @@ -85,16 +85,16 @@ public: static CFX_ByteString StrRTrim(const FX_CHAR* pStr); static CFX_ByteString StrTrim(const FX_CHAR* pStr); - static bool IsNumber(const FX_CHAR* string); - static bool IsNumber(const FX_WCHAR* string); + static FX_BOOL IsNumber(const FX_CHAR* string); + static FX_BOOL IsNumber(const FX_WCHAR* string); - static bool IsDigit(char ch); - static bool IsDigit(wchar_t ch); - static bool IsAlphabetic(wchar_t ch); - static bool IsAlphaNumeric(wchar_t ch); + static FX_BOOL IsDigit(char ch); + static FX_BOOL IsDigit(wchar_t ch); + static FX_BOOL IsAlphabetic(wchar_t ch); + static FX_BOOL IsAlphaNumeric(wchar_t ch); - static bool maskSatisfied(wchar_t c_Change,wchar_t c_Mask); - static bool isReservedMaskChar(wchar_t ch); + static FX_BOOL maskSatisfied(wchar_t c_Change,wchar_t c_Mask); + static FX_BOOL isReservedMaskChar(wchar_t ch); static double AF_Simple(const FX_WCHAR* sFuction, double dValue1, double dValue2); static CJS_Array AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Value val); diff --git a/fpdfsdk/include/javascript/app.h b/fpdfsdk/include/javascript/app.h index ffd7edb4d4..ac90e62b0d 100644 --- a/fpdfsdk/include/javascript/app.h +++ b/fpdfsdk/include/javascript/app.h @@ -110,41 +110,41 @@ public: virtual ~app(); public: - bool activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - - - bool alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL activeDocs(IFXJS_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, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL fullscreen(IFXJS_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, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + + + FX_BOOL alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); private: // FX_DWORD AppGetTickCount(); diff --git a/fpdfsdk/include/javascript/color.h b/fpdfsdk/include/javascript/color.h index ab7bbae088..df863b552f 100644 --- a/fpdfsdk/include/javascript/color.h +++ b/fpdfsdk/include/javascript/color.h @@ -16,21 +16,21 @@ public: color(CJS_Object* pJSObject); virtual ~color(void); - bool black(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool blue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool cyan(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool dkGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool gray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool green(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool ltGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool magenta(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool transparent(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + 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, 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); - bool convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); public: static void ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array); diff --git a/fpdfsdk/include/javascript/console.h b/fpdfsdk/include/javascript/console.h index 424f0e246b..0cbc291b44 100644 --- a/fpdfsdk/include/javascript/console.h +++ b/fpdfsdk/include/javascript/console.h @@ -16,10 +16,10 @@ public: virtual ~console(void); public: - bool clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); }; class CJS_Console : public CJS_Object diff --git a/fpdfsdk/include/javascript/event.h b/fpdfsdk/include/javascript/event.h index e980a96e74..91a38ba487 100644 --- a/fpdfsdk/include/javascript/event.h +++ b/fpdfsdk/include/javascript/event.h @@ -16,26 +16,26 @@ public: virtual ~event(void); public: - bool change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + 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, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL richChangeEx(IFXJS_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, 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, CJS_PropValue& vp, CFX_WideString& sError); }; diff --git a/fpdfsdk/include/javascript/global.h b/fpdfsdk/include/javascript/global.h index 4c6ccd97b0..83e07f67c3 100644 --- a/fpdfsdk/include/javascript/global.h +++ b/fpdfsdk/include/javascript/global.h @@ -19,10 +19,10 @@ struct js_global_data { nType = 0; dData = 0; - bData = false; + bData = FALSE; sData = ""; - bPersistent = false; - bDeleted = false; + bPersistent = FALSE; + bDeleted = FALSE; } ~js_global_data() @@ -45,12 +45,12 @@ public: virtual ~global_alternate(); public: - bool setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); public: - bool QueryProperty(const FX_WCHAR* propname); - bool DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue & vp, CFX_WideString & sError); - bool DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString & sError); + FX_BOOL QueryProperty(const FX_WCHAR* propname); + FX_BOOL DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue & vp, CFX_WideString & sError); + FX_BOOL DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString & sError); void Initial(CPDFDoc_Environment* pApp); @@ -58,7 +58,7 @@ private: void UpdateGlobalPersistentVariables(); void CommitGlobalPersisitentVariables(); void DestroyGlobalPersisitentVariables(); - bool SetGlobalVariables(const FX_CHAR* propname, int nType, + FX_BOOL SetGlobalVariables(const FX_CHAR* propname, int nType, double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent); void ObjectToArray(v8::Local<v8::Object> pObj, CJS_GlobalVariableArray& array); @@ -78,7 +78,7 @@ public: CJS_Global(JSFXObject pObject) : CJS_Object(pObject) {}; virtual ~CJS_Global(void){}; - virtual bool InitInstance(IFXJS_Context* cc); + virtual FX_BOOL InitInstance(IFXJS_Context* cc); DECLARE_SPECIAL_JS_CLASS(CJS_Global); diff --git a/fpdfsdk/include/javascript/report.h b/fpdfsdk/include/javascript/report.h index e54583385f..56f742ce08 100644 --- a/fpdfsdk/include/javascript/report.h +++ b/fpdfsdk/include/javascript/report.h @@ -16,8 +16,8 @@ public: virtual ~Report(); public: - bool save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); }; class CJS_Report : public CJS_Object diff --git a/fpdfsdk/include/javascript/util.h b/fpdfsdk/include/javascript/util.h index a2d6749eec..ca4db349da 100644 --- a/fpdfsdk/include/javascript/util.h +++ b/fpdfsdk/include/javascript/util.h @@ -18,11 +18,11 @@ public: virtual ~util(void); public: - bool printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - bool byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + FX_BOOL byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); public: static void printd(const std::wstring &cFormat,CJS_Date Date,bool bXFAPicture, std::wstring &cPurpose); |