summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_EventHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript/JS_EventHandler.cpp')
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index 1056c446f4..1769e3053f 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -20,21 +20,21 @@
CJS_EventHandler::CJS_EventHandler(CJS_Context * pContext) :
m_pJSContext(pContext),
m_eEventType(JET_UNKNOWN),
- m_bValid(false),
+ m_bValid(FALSE),
m_pWideStrChange(NULL),
m_nCommitKey(-1),
- m_bKeyDown(false),
- m_bModifier(false),
- m_bShift(false),
+ m_bKeyDown(FALSE),
+ m_bModifier(FALSE),
+ m_bShift(FALSE),
m_pISelEnd(NULL),
m_nSelEndDu(0),
m_pISelStart(NULL),
m_nSelStartDu(0),
- m_bWillCommit(false),
+ m_bWillCommit(FALSE),
m_pValue(NULL),
- m_bFieldFull(false),
+ m_bFieldFull(FALSE),
m_pbRc(NULL),
- m_bRcDu(false),
+ m_bRcDu(FALSE),
m_pSourceDoc(NULL),
m_pTargetBookMark(NULL),
m_pTargetDoc(NULL),
@@ -121,7 +121,7 @@ void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc)
m_pTargetDoc = pDoc;
}
-void CJS_EventHandler::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEENTER);
@@ -132,7 +132,7 @@ void CJS_EventHandler::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_Form
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEEXIT);
@@ -142,7 +142,7 @@ void CJS_EventHandler::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormF
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEDOWN);
m_eEventType = JET_FIELD_MOUSEDOWN;
@@ -153,7 +153,7 @@ void CJS_EventHandler::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormF
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEUP);
@@ -163,7 +163,7 @@ void CJS_EventHandler::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormFie
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_FOCUS);
@@ -175,7 +175,7 @@ void CJS_EventHandler::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField
m_pValue = (CFX_WideString*)&Value;
}
-void CJS_EventHandler::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_BLUR);
@@ -188,11 +188,11 @@ void CJS_EventHandler::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField*
}
void CJS_EventHandler::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)
+ const CFX_WideString& strChangeEx, 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)
{
Initial(JET_FIELD_KEYSTROKE);
@@ -213,8 +213,8 @@ void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
}
void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- bool bKeyDown, bool bModifier, bool bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc)
+ FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
{
Initial(JET_FIELD_VALIDATE);
@@ -230,7 +230,7 @@ void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_Wid
}
void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget,
- CFX_WideString& Value, bool& bRc)
+ CFX_WideString& Value, FX_BOOL& bRc)
{
Initial(JET_FIELD_CALCULATE);
@@ -244,7 +244,7 @@ void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField
void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
CFX_WideString& Value,
- bool bWillCommit)
+ FX_BOOL bWillCommit)
{
Initial(JET_FIELD_FORMAT);
@@ -255,7 +255,7 @@ void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
m_bWillCommit = bWillCommit;
}
-void CJS_EventHandler::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_FOCUS);
@@ -264,7 +264,7 @@ void CJS_EventHandler::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_BLUR);
@@ -273,7 +273,7 @@ void CJS_EventHandler::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot*
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_OPEN);
@@ -282,7 +282,7 @@ void CJS_EventHandler::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot*
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_CLOSE);
@@ -291,7 +291,7 @@ void CJS_EventHandler::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEDOWN);
@@ -300,7 +300,7 @@ void CJS_EventHandler::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_A
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEUP);
@@ -309,7 +309,7 @@ void CJS_EventHandler::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Ann
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEENTER);
@@ -318,7 +318,7 @@ void CJS_EventHandler::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEEXIT);
@@ -327,7 +327,7 @@ void CJS_EventHandler::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_A
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_INVIEW);
@@ -336,7 +336,7 @@ void CJS_EventHandler::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Anno
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_OUTVIEW);
@@ -395,33 +395,33 @@ void CJS_EventHandler::Initial(JS_EVENT_T type)
m_WideStrChangeDu = L"";
m_WideStrChangeEx = L"";
m_nCommitKey = -1;
- m_bKeyDown = false;
- m_bModifier = false;
- m_bShift = false;
+ m_bKeyDown = FALSE;
+ m_bModifier = FALSE;
+ m_bShift = FALSE;
m_pISelEnd = NULL;
m_nSelEndDu = 0;
m_pISelStart = NULL;
m_nSelStartDu = 0;
- m_bWillCommit = false;
+ m_bWillCommit = FALSE;
m_pValue = NULL;
- m_bFieldFull = false;
+ m_bFieldFull = FALSE;
m_pbRc = NULL;
- m_bRcDu = false;
+ m_bRcDu = FALSE;
m_pSourceDoc = NULL;
m_pTargetBookMark = NULL;
m_pTargetDoc = NULL;
m_pTargetAnnot = NULL;
- m_bValid = true;
+ m_bValid = TRUE;
}
void CJS_EventHandler::Destroy()
{
- m_bValid = false;
+ m_bValid = FALSE;
}
-bool CJS_EventHandler::IsValid()
+FX_BOOL CJS_EventHandler::IsValid()
{
return m_bValid;
}
@@ -444,17 +444,17 @@ int CJS_EventHandler::CommitKey()
return m_nCommitKey;
}
-bool CJS_EventHandler::FieldFull()
+FX_BOOL CJS_EventHandler::FieldFull()
{
return m_bFieldFull;
}
-bool CJS_EventHandler::KeyDown()
+FX_BOOL CJS_EventHandler::KeyDown()
{
return m_bKeyDown;
}
-bool CJS_EventHandler::Modifier()
+FX_BOOL CJS_EventHandler::Modifier()
{
return m_bModifier;
}
@@ -555,7 +555,7 @@ const FX_WCHAR* CJS_EventHandler::Type()
return L"";
}
-bool& CJS_EventHandler::Rc()
+FX_BOOL& CJS_EventHandler::Rc()
{
if (m_pbRc) {
return *m_pbRc;
@@ -579,7 +579,7 @@ int & CJS_EventHandler::SelStart()
return m_nSelStartDu;
}
-bool CJS_EventHandler::Shift()
+FX_BOOL CJS_EventHandler::Shift()
{
return m_bShift;
}
@@ -591,9 +591,9 @@ Field* CJS_EventHandler::Source()
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
- ASSERT(pDocObj.IsEmpty() == false);
+ ASSERT(pDocObj.IsEmpty() == FALSE);
JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pFieldObj.IsEmpty() == false);
+ ASSERT(pFieldObj.IsEmpty() == FALSE);
CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
ASSERT(pJSDocument != NULL);
@@ -625,9 +625,9 @@ Field* CJS_EventHandler::Target_Field()
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
- ASSERT(pDocObj.IsEmpty() == false);
+ ASSERT(pDocObj.IsEmpty() == FALSE);
JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pFieldObj.IsEmpty() == false);
+ ASSERT(pFieldObj.IsEmpty() == FALSE);
CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
ASSERT(pJSDocument != NULL);
@@ -653,7 +653,7 @@ CFX_WideString& CJS_EventHandler::Value()
return *m_pValue;
}
-bool CJS_EventHandler::WillCommit()
+FX_BOOL CJS_EventHandler::WillCommit()
{
return m_bWillCommit;
}