summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/event.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2015-08-04 12:19:10 -0700
committerNico Weber <thakis@chromium.org>2015-08-04 12:19:10 -0700
commitb048f791a15f2da781a01eba5b09eb9d389f9c11 (patch)
tree6850a73c18bbc41eaf4b1fdc6b3c96646d45587b /fpdfsdk/src/javascript/event.cpp
parentc8eeed31f217d99a706b0cbf5e4ce0bcc12beb64 (diff)
downloadpdfium-b048f791a15f2da781a01eba5b09eb9d389f9c11.tar.xz
clang-format all pdfium code.
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163' | \ xargs ../../buildtools/mac/clang-format -i See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 .
Diffstat (limited to 'fpdfsdk/src/javascript/event.cpp')
-rw-r--r--fpdfsdk/src/javascript/event.cpp590
1 files changed, 295 insertions, 295 deletions
diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp
index f57b1fb607..4bcdcce3a0 100644
--- a/fpdfsdk/src/javascript/event.cpp
+++ b/fpdfsdk/src/javascript/event.cpp
@@ -21,359 +21,359 @@ BEGIN_JS_STATIC_CONST(CJS_Event)
END_JS_STATIC_CONST()
BEGIN_JS_STATIC_PROP(CJS_Event)
- JS_STATIC_PROP_ENTRY(change)
- JS_STATIC_PROP_ENTRY(changeEx)
- JS_STATIC_PROP_ENTRY(commitKey)
- JS_STATIC_PROP_ENTRY(fieldFull)
- JS_STATIC_PROP_ENTRY(keyDown)
- JS_STATIC_PROP_ENTRY(modifier)
- JS_STATIC_PROP_ENTRY(name)
- JS_STATIC_PROP_ENTRY(rc)
- JS_STATIC_PROP_ENTRY(richChange)
- JS_STATIC_PROP_ENTRY(richChangeEx)
- JS_STATIC_PROP_ENTRY(richValue)
- JS_STATIC_PROP_ENTRY(selEnd)
- JS_STATIC_PROP_ENTRY(selStart)
- JS_STATIC_PROP_ENTRY(shift)
- JS_STATIC_PROP_ENTRY(source)
- JS_STATIC_PROP_ENTRY(target)
- JS_STATIC_PROP_ENTRY(targetName)
- JS_STATIC_PROP_ENTRY(type)
- JS_STATIC_PROP_ENTRY(value)
- JS_STATIC_PROP_ENTRY(willCommit)
+JS_STATIC_PROP_ENTRY(change)
+JS_STATIC_PROP_ENTRY(changeEx)
+JS_STATIC_PROP_ENTRY(commitKey)
+JS_STATIC_PROP_ENTRY(fieldFull)
+JS_STATIC_PROP_ENTRY(keyDown)
+JS_STATIC_PROP_ENTRY(modifier)
+JS_STATIC_PROP_ENTRY(name)
+JS_STATIC_PROP_ENTRY(rc)
+JS_STATIC_PROP_ENTRY(richChange)
+JS_STATIC_PROP_ENTRY(richChangeEx)
+JS_STATIC_PROP_ENTRY(richValue)
+JS_STATIC_PROP_ENTRY(selEnd)
+JS_STATIC_PROP_ENTRY(selStart)
+JS_STATIC_PROP_ENTRY(shift)
+JS_STATIC_PROP_ENTRY(source)
+JS_STATIC_PROP_ENTRY(target)
+JS_STATIC_PROP_ENTRY(targetName)
+JS_STATIC_PROP_ENTRY(type)
+JS_STATIC_PROP_ENTRY(value)
+JS_STATIC_PROP_ENTRY(willCommit)
END_JS_STATIC_PROP()
BEGIN_JS_STATIC_METHOD(CJS_Event)
END_JS_STATIC_METHOD()
-IMPLEMENT_JS_CLASS(CJS_Event,event)
+IMPLEMENT_JS_CLASS(CJS_Event, event)
-event::event(CJS_Object * pJsObject) : CJS_EmbedObj(pJsObject)
-{
-}
+event::event(CJS_Object* pJsObject) : CJS_EmbedObj(pJsObject) {}
-event::~event(void)
-{
-}
+event::~event(void) {}
-FX_BOOL event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- CFX_WideString &wChange = pEvent->Change();
- if (vp.IsSetting())
- {
- if (vp.GetType() == VT_string)
- vp >> wChange;
- }
- else
- {
- vp << wChange;
- }
- return TRUE;
+FX_BOOL event::change(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ CFX_WideString& wChange = pEvent->Change();
+ if (vp.IsSetting()) {
+ if (vp.GetType() == VT_string)
+ vp >> wChange;
+ } else {
+ vp << wChange;
+ }
+ return TRUE;
}
-FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
+FX_BOOL event::changeEx(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
- vp << pEvent->ChangeEx();
- return TRUE;
+ vp << pEvent->ChangeEx();
+ return TRUE;
}
-FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
+FX_BOOL event::commitKey(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
- vp << pEvent->CommitKey();
- return TRUE;
+ vp << pEvent->CommitKey();
+ return TRUE;
}
-FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (!vp.IsGetting() && wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
- return FALSE;
-
- if (pEvent->FieldFull())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
+FX_BOOL event::fieldFull(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (!vp.IsGetting() &&
+ wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0)
+ return FALSE;
+
+ if (pEvent->FieldFull())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
}
-FX_BOOL event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (pEvent->KeyDown())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
+FX_BOOL event::keyDown(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (pEvent->KeyDown())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
}
-FX_BOOL event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (pEvent->Modifier())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
+FX_BOOL event::modifier(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (pEvent->Modifier())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
}
-FX_BOOL event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
+FX_BOOL event::name(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
- vp << pEvent->Name();
- return TRUE;
+ vp << pEvent->Name();
+ return TRUE;
}
-FX_BOOL event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- FX_BOOL &bRc = pEvent->Rc();
- if (vp.IsSetting())
- {
- vp>>bRc;
- }
- else
- {
- vp<<bRc;
- }
- return TRUE;
+FX_BOOL event::rc(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ FX_BOOL& bRc = pEvent->Rc();
+ if (vp.IsSetting()) {
+ vp >> bRc;
+ } else {
+ vp << bRc;
+ }
+ return TRUE;
}
-FX_BOOL event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- return TRUE;
- if (vp.IsSetting())
- {
- }
- else
- {
- ;
- }
- return TRUE;
+FX_BOOL event::richChange(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ return TRUE;
+ if (vp.IsSetting()) {
+ } else {
+ ;
+ }
+ return TRUE;
}
-FX_BOOL event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- return TRUE;
- if (vp.IsSetting())
- {
- }
- else
- {
- ;
- }
- return TRUE;
+FX_BOOL event::richChangeEx(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ return TRUE;
+ if (vp.IsSetting()) {
+ } else {
+ ;
+ }
+ return TRUE;
}
-
-FX_BOOL event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- return TRUE;
- if (vp.IsSetting())
- {
- }
- else
- {
- ;
- }
- return TRUE;
+FX_BOOL event::richValue(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ return TRUE;
+ if (vp.IsSetting()) {
+ } else {
+ ;
+ }
+ return TRUE;
}
-FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
- {
- return TRUE;
- }
-
- int &iSelEnd = pEvent->SelEnd();
- if (vp.IsSetting())
- {
- vp >> iSelEnd;
- }
- else
- {
- vp << iSelEnd;
- }
- return TRUE;
+FX_BOOL event::selEnd(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0) {
+ return TRUE;
+ }
+
+ int& iSelEnd = pEvent->SelEnd();
+ if (vp.IsSetting()) {
+ vp >> iSelEnd;
+ } else {
+ vp << iSelEnd;
+ }
+ return TRUE;
}
-FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
- {
- return TRUE;
- }
- int &iSelStart = pEvent->SelStart();
- if (vp.IsSetting())
- {
- vp >> iSelStart;
- }
- else
- {
- vp << iSelStart;
- }
- return TRUE;
+FX_BOOL event::selStart(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0) {
+ return TRUE;
+ }
+ int& iSelStart = pEvent->SelStart();
+ if (vp.IsSetting()) {
+ vp >> iSelStart;
+ } else {
+ vp << iSelStart;
+ }
+ return TRUE;
}
-FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (pEvent->Shift())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
+FX_BOOL event::shift(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (pEvent->Shift())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
}
-FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
+FX_BOOL event::source(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
- vp << pEvent->Source()->GetJSObject();
- return TRUE;
+ vp << pEvent->Source()->GetJSObject();
+ return TRUE;
}
-FX_BOOL event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
+FX_BOOL event::target(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
- vp<<pEvent->Target_Field()->GetJSObject();
- return TRUE;
+ vp << pEvent->Target_Field()->GetJSObject();
+ return TRUE;
}
-FX_BOOL event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
+FX_BOOL event::targetName(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
- vp << pEvent->TargetName();
- return TRUE;
+ vp << pEvent->TargetName();
+ return TRUE;
}
-FX_BOOL event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
+FX_BOOL event::type(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
- vp << pEvent->Type();
- return TRUE;
+ vp << pEvent->Type();
+ return TRUE;
}
-FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (wcscmp((const wchar_t*)pEvent->Type(),L"Field") != 0)
- return FALSE;
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString & val = pEvent->Value();
- if (vp.IsSetting())
- {
- vp >> val;
- }
- else
- {
- vp << val;
- }
- return TRUE;
+FX_BOOL event::value(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (wcscmp((const wchar_t*)pEvent->Type(), L"Field") != 0)
+ return FALSE;
+ if (!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString& val = pEvent->Value();
+ if (vp.IsSetting()) {
+ vp >> val;
+ } else {
+ vp << val;
+ }
+ return TRUE;
}
-FX_BOOL event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (pEvent->WillCommit())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
+FX_BOOL event::willCommit(IFXJS_Context* cc,
+ CJS_PropValue& vp,
+ CFX_WideString& sError) {
+ if (!vp.IsGetting())
+ return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (pEvent->WillCommit())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
}
-