From b1670b5cca9a59dfb612ef9eb891a70dd716bf9c Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 16 Feb 2017 17:01:00 -0800 Subject: Pass CJS_Runtime to JS callbacks. This is much more convenient, since only a fraction of them need an IJS_EventContext, which can be obtained from the CJS_Runtime. Make GetCurrentEventContext() specific to CJS_Runtime, and return the concrete type. This saves a lot of casting. Change-Id: If79a3bcbf44de513f3caace153099234cc313d47 Reviewed-on: https://pdfium-review.googlesource.com/2793 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/javascript/app.h | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'fpdfsdk/javascript/app.h') diff --git a/fpdfsdk/javascript/app.h b/fpdfsdk/javascript/app.h index 6cd68d3813..9e11b82419 100644 --- a/fpdfsdk/javascript/app.h +++ b/fpdfsdk/javascript/app.h @@ -41,120 +41,120 @@ class app : public CJS_EmbedObj { explicit app(CJS_Object* pJSObject); ~app() override; - bool activeDocs(IJS_EventContext* cc, + bool activeDocs(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool calculate(IJS_EventContext* cc, + bool calculate(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool formsVersion(IJS_EventContext* cc, + bool formsVersion(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool fs(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool fullscreen(IJS_EventContext* cc, + bool fs(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool fullscreen(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool language(IJS_EventContext* cc, + bool language(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool media(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); - bool platform(IJS_EventContext* cc, + bool media(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); + bool platform(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool runtimeHighlight(IJS_EventContext* cc, + bool runtimeHighlight(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool viewerType(IJS_EventContext* cc, + bool viewerType(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool viewerVariation(IJS_EventContext* cc, + bool viewerVariation(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool viewerVersion(IJS_EventContext* cc, + bool viewerVersion(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError); - bool alert(IJS_EventContext* cc, + bool alert(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool beep(IJS_EventContext* cc, + bool beep(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool browseForDoc(IJS_EventContext* cc, + bool browseForDoc(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool clearInterval(IJS_EventContext* cc, + bool clearInterval(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool clearTimeOut(IJS_EventContext* cc, + bool clearTimeOut(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool execDialog(IJS_EventContext* cc, + bool execDialog(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool execMenuItem(IJS_EventContext* cc, + bool execMenuItem(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool findComponent(IJS_EventContext* cc, + bool findComponent(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool goBack(IJS_EventContext* cc, + bool goBack(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool goForward(IJS_EventContext* cc, + bool goForward(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool launchURL(IJS_EventContext* cc, + bool launchURL(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool mailMsg(IJS_EventContext* cc, + bool mailMsg(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool newFDF(IJS_EventContext* cc, + bool newFDF(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool newDoc(IJS_EventContext* cc, + bool newDoc(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool openDoc(IJS_EventContext* cc, + bool openDoc(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool openFDF(IJS_EventContext* cc, + bool openFDF(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool popUpMenuEx(IJS_EventContext* cc, + bool popUpMenuEx(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool popUpMenu(IJS_EventContext* cc, + bool popUpMenu(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool response(IJS_EventContext* cc, + bool response(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool setInterval(IJS_EventContext* cc, + bool setInterval(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); - bool setTimeOut(IJS_EventContext* cc, + bool setTimeOut(CJS_Runtime* pRuntime, const std::vector& params, CJS_Value& vRet, CFX_WideString& sError); -- cgit v1.2.3