summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/event.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-02-16 17:01:00 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-21 15:18:27 +0000
commitb1670b5cca9a59dfb612ef9eb891a70dd716bf9c (patch)
treee624b1ca93721894ff29a14bb52443bf4f952cf6 /fpdfsdk/javascript/event.h
parent026f3d306d339585612d63a9f6ac5ed8839a3179 (diff)
downloadpdfium-b1670b5cca9a59dfb612ef9eb891a70dd716bf9c.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/event.h')
-rw-r--r--fpdfsdk/javascript/event.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/fpdfsdk/javascript/event.h b/fpdfsdk/javascript/event.h
index 54ba3f0a07..2be8a0adb2 100644
--- a/fpdfsdk/javascript/event.h
+++ b/fpdfsdk/javascript/event.h
@@ -15,44 +15,46 @@ class event : public CJS_EmbedObj {
~event() override;
public:
- bool change(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool changeEx(IJS_EventContext* cc,
+ bool change(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool changeEx(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool commitKey(IJS_EventContext* cc,
+ bool commitKey(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool fieldFull(IJS_EventContext* cc,
+ bool fieldFull(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool keyDown(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool modifier(IJS_EventContext* cc,
+ bool keyDown(CJS_Runtime* pRuntime,
+ CJS_PropValue& vp,
+ CFX_WideString& sError);
+ bool modifier(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool name(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool rc(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool richChange(IJS_EventContext* cc,
+ bool name(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool rc(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool richChange(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool richChangeEx(IJS_EventContext* cc,
+ bool richChangeEx(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool richValue(IJS_EventContext* cc,
+ bool richValue(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool selEnd(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool selStart(IJS_EventContext* cc,
+ bool selEnd(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool selStart(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool shift(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool source(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool target(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool targetName(IJS_EventContext* cc,
+ bool shift(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool source(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool target(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool targetName(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
- bool type(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool value(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool willCommit(IJS_EventContext* cc,
+ bool type(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool value(CJS_Runtime* pRuntime, CJS_PropValue& vp, CFX_WideString& sError);
+ bool willCommit(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CFX_WideString& sError);
};