| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../include/javascript/JavaScript.h" | 7 #include "../../include/javascript/JavaScript.h" |
| 8 #include "../../include/javascript/IJavaScript.h" | 8 #include "../../include/javascript/IJavaScript.h" |
| 9 #include "../../include/javascript/JS_Define.h" | 9 #include "../../include/javascript/JS_Define.h" |
| 10 #include "../../include/javascript/JS_Object.h" | 10 #include "../../include/javascript/JS_Object.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 127 } |
| 128 | 128 |
| 129 app::~app(void) | 129 app::~app(void) |
| 130 { | 130 { |
| 131 for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++) | 131 for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++) |
| 132 delete m_aTimer[i]; | 132 delete m_aTimer[i]; |
| 133 | 133 |
| 134 m_aTimer.RemoveAll(); | 134 m_aTimer.RemoveAll(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 FX_BOOL app::activeDocs(OBJ_PROP_PARAMS) | 137 FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
| 138 { | 138 { |
| 139 if (vp.IsGetting()) | 139 if (vp.IsGetting()) |
| 140 { | 140 { |
| 141 | 141 |
| 142 CJS_Context* pContext = (CJS_Context *)cc; | 142 CJS_Context* pContext = (CJS_Context *)cc; |
| 143 ASSERT(pContext != NULL); | 143 ASSERT(pContext != NULL); |
| 144 | 144 |
| 145 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); | 145 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); |
| 146 ASSERT(pApp != NULL); | 146 ASSERT(pApp != NULL); |
| 147 | 147 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 if (aDocs.GetLength() > 0) | 186 if (aDocs.GetLength() > 0) |
| 187 vp << aDocs; | 187 vp << aDocs; |
| 188 else | 188 else |
| 189 vp.SetNull(); | 189 vp.SetNull(); |
| 190 return TRUE; | 190 return TRUE; |
| 191 } | 191 } |
| 192 return FALSE; | 192 return FALSE; |
| 193 } | 193 } |
| 194 | 194 |
| 195 FX_BOOL app::calculate(OBJ_PROP_PARAMS) | 195 FX_BOOL app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sEr
ror) |
| 196 { | 196 { |
| 197 if (vp.IsSetting()) | 197 if (vp.IsSetting()) |
| 198 { | 198 { |
| 199 bool bVP; | 199 bool bVP; |
| 200 vp >> bVP; | 200 vp >> bVP; |
| 201 m_bCalculate = (FX_BOOL)bVP; | 201 m_bCalculate = (FX_BOOL)bVP; |
| 202 | 202 |
| 203 CJS_Context* pContext = (CJS_Context*)cc; | 203 CJS_Context* pContext = (CJS_Context*)cc; |
| 204 ASSERT(pContext != NULL); | 204 ASSERT(pContext != NULL); |
| 205 | 205 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 223 // } | 223 // } |
| 224 } | 224 } |
| 225 else | 225 else |
| 226 { | 226 { |
| 227 vp << (bool)m_bCalculate; | 227 vp << (bool)m_bCalculate; |
| 228 } | 228 } |
| 229 | 229 |
| 230 return TRUE; | 230 return TRUE; |
| 231 } | 231 } |
| 232 | 232 |
| 233 FX_BOOL app::formsVersion(OBJ_PROP_PARAMS) | 233 FX_BOOL app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
| 234 { | 234 { |
| 235 if (vp.IsGetting()) | 235 if (vp.IsGetting()) |
| 236 { | 236 { |
| 237 vp << JS_NUM_FORMSVERSION; | 237 vp << JS_NUM_FORMSVERSION; |
| 238 return TRUE; | 238 return TRUE; |
| 239 } | 239 } |
| 240 | 240 |
| 241 return FALSE; | 241 return FALSE; |
| 242 } | 242 } |
| 243 | 243 |
| 244 FX_BOOL app::viewerType(OBJ_PROP_PARAMS) | 244 FX_BOOL app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
| 245 { | 245 { |
| 246 if (vp.IsGetting()) | 246 if (vp.IsGetting()) |
| 247 { | 247 { |
| 248 vp << L"unknown"; | 248 vp << L"unknown"; |
| 249 return TRUE; | 249 return TRUE; |
| 250 } | 250 } |
| 251 | 251 |
| 252 return FALSE; | 252 return FALSE; |
| 253 } | 253 } |
| 254 | 254 |
| 255 FX_BOOL app::viewerVariation(OBJ_PROP_PARAMS) | 255 FX_BOOL app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorStrin
g& sError) |
| 256 { | 256 { |
| 257 if (vp.IsGetting()) | 257 if (vp.IsGetting()) |
| 258 { | 258 { |
| 259 vp << JS_STR_VIEWERVARIATION; | 259 vp << JS_STR_VIEWERVARIATION; |
| 260 return TRUE; | 260 return TRUE; |
| 261 } | 261 } |
| 262 | 262 |
| 263 return FALSE; | 263 return FALSE; |
| 264 } | 264 } |
| 265 | 265 |
| 266 FX_BOOL app::viewerVersion(OBJ_PROP_PARAMS) | 266 FX_BOOL app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
| 267 { | 267 { |
| 268 if (vp.IsGetting()) | 268 if (vp.IsGetting()) |
| 269 { | 269 { |
| 270 CJS_Context* pContext = (CJS_Context *)cc; | 270 CJS_Context* pContext = (CJS_Context *)cc; |
| 271 ASSERT(pContext != NULL); | 271 ASSERT(pContext != NULL); |
| 272 | 272 |
| 273 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); | 273 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); |
| 274 ASSERT(pApp != NULL); | 274 ASSERT(pApp != NULL); |
| 275 | 275 |
| 276 CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument(); | 276 CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument(); |
| 277 | 277 |
| 278 CPDFXFA_Document* pDoc = pCurDoc->GetDocument(); | 278 CPDFXFA_Document* pDoc = pCurDoc->GetDocument(); |
| 279 if (pDoc->GetDocType() == 1 || pDoc->GetDocType() == 2) | 279 if (pDoc->GetDocType() == 1 || pDoc->GetDocType() == 2) |
| 280 vp << JS_STR_VIEWERVERSION_XFA; | 280 vp << JS_STR_VIEWERVERSION_XFA; |
| 281 else | 281 else |
| 282 vp << JS_STR_VIEWERVERSION; | 282 vp << JS_STR_VIEWERVERSION; |
| 283 return TRUE; | 283 return TRUE; |
| 284 } | 284 } |
| 285 | 285 |
| 286 return FALSE; | 286 return FALSE; |
| 287 } | 287 } |
| 288 | 288 |
| 289 FX_BOOL app::platform(OBJ_PROP_PARAMS) | 289 FX_BOOL app::platform(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sErr
or) |
| 290 { | 290 { |
| 291 if (vp.IsGetting()) | 291 if (vp.IsGetting()) |
| 292 { | 292 { |
| 293 vp << JS_STR_PLATFORM; | 293 vp << JS_STR_PLATFORM; |
| 294 return TRUE; | 294 return TRUE; |
| 295 } | 295 } |
| 296 | 296 |
| 297 return FALSE; | 297 return FALSE; |
| 298 } | 298 } |
| 299 | 299 |
| 300 FX_BOOL app::language(OBJ_PROP_PARAMS) | 300 FX_BOOL app::language(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sErr
or) |
| 301 { | 301 { |
| 302 if (vp.IsGetting()) | 302 if (vp.IsGetting()) |
| 303 { | 303 { |
| 304 vp << JS_STR_LANGUANGE; | 304 vp << JS_STR_LANGUANGE; |
| 305 return TRUE; | 305 return TRUE; |
| 306 } | 306 } |
| 307 | 307 |
| 308 return FALSE; | 308 return FALSE; |
| 309 } | 309 } |
| 310 | 310 |
| 311 //creates a new fdf object that contains no data | 311 //creates a new fdf object that contains no data |
| 312 //comment: need reader support | 312 //comment: need reader support |
| 313 //note: | 313 //note: |
| 314 //CFDF_Document * CPDFDoc_Environment::NewFDF(); | 314 //CFDF_Document * CPDFDoc_Environment::NewFDF(); |
| 315 FX_BOOL app::newFDF(OBJ_METHOD_PARAMS) | 315 FX_BOOL app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 316 { | 316 { |
| 317 return TRUE; | 317 return TRUE; |
| 318 } | 318 } |
| 319 //opens a specified pdf document and returns its document object | 319 //opens a specified pdf document and returns its document object |
| 320 //comment:need reader support | 320 //comment:need reader support |
| 321 //note: as defined in js reference, the proto of this function's fourth parmeter
s, how old an fdf document while do not show it. | 321 //note: as defined in js reference, the proto of this function's fourth parmeter
s, how old an fdf document while do not show it. |
| 322 //CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv); | 322 //CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv); |
| 323 | 323 |
| 324 FX_BOOL app::openFDF(OBJ_METHOD_PARAMS) | 324 FX_BOOL app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 325 { | 325 { |
| 326 return TRUE; | 326 return TRUE; |
| 327 } | 327 } |
| 328 | 328 |
| 329 FX_BOOL app::alert(OBJ_METHOD_PARAMS) | 329 FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
Ret, JS_ErrorString& sError) |
| 330 { | 330 { |
| 331 int iSize = params.size(); | 331 int iSize = params.size(); |
| 332 if (iSize < 1) | 332 if (iSize < 1) |
| 333 return FALSE; | 333 return FALSE; |
| 334 | 334 |
| 335 CFX_WideString swMsg = L""; | 335 CFX_WideString swMsg = L""; |
| 336 CFX_WideString swTitle = L""; | 336 CFX_WideString swTitle = L""; |
| 337 int iIcon = 0; | 337 int iIcon = 0; |
| 338 int iType = 0; | 338 int iType = 0; |
| 339 | 339 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 444 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| 445 ASSERT(pRuntime != NULL); | 445 ASSERT(pRuntime != NULL); |
| 446 pRuntime->BeginBlock(); | 446 pRuntime->BeginBlock(); |
| 447 vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc),swMsg,swTitle,
iType,iIcon); | 447 vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc),swMsg,swTitle,
iType,iIcon); |
| 448 pRuntime->EndBlock(); | 448 pRuntime->EndBlock(); |
| 449 | 449 |
| 450 return TRUE; | 450 return TRUE; |
| 451 } | 451 } |
| 452 | 452 |
| 453 | 453 |
| 454 FX_BOOL app::beep(OBJ_METHOD_PARAMS) | 454 FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
et, JS_ErrorString& sError) |
| 455 { | 455 { |
| 456 if (params.size() == 1) | 456 if (params.size() == 1) |
| 457 { | 457 { |
| 458 CJS_Context* pContext = (CJS_Context*)cc; | 458 CJS_Context* pContext = (CJS_Context*)cc; |
| 459 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 459 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| 460 CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp(); | 460 CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp(); |
| 461 pEnv->JS_appBeep((int)params[0]); | 461 pEnv->JS_appBeep((int)params[0]); |
| 462 | 462 |
| 463 return TRUE; | 463 return TRUE; |
| 464 } | 464 } |
| 465 else | 465 else |
| 466 { | 466 { |
| 467 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 467 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 468 return FALSE; | 468 return FALSE; |
| 469 } | 469 } |
| 470 } | 470 } |
| 471 | 471 |
| 472 FX_BOOL app::findComponent(OBJ_METHOD_PARAMS) | 472 FX_BOOL app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
| 473 { | 473 { |
| 474 return TRUE; | 474 return TRUE; |
| 475 } | 475 } |
| 476 | 476 |
| 477 FX_BOOL app::popUpMenuEx(OBJ_METHOD_PARAMS) | 477 FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
lue& vRet, JS_ErrorString& sError) |
| 478 { | 478 { |
| 479 return FALSE; | 479 return FALSE; |
| 480 } | 480 } |
| 481 | 481 |
| 482 FX_BOOL app::fs(OBJ_PROP_PARAMS) | 482 FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) |
| 483 { | 483 { |
| 484 return FALSE; | 484 return FALSE; |
| 485 } | 485 } |
| 486 | 486 |
| 487 FX_BOOL app::setInterval(OBJ_METHOD_PARAMS) | 487 FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
lue& vRet, JS_ErrorString& sError) |
| 488 { | 488 { |
| 489 if (params.size() > 2 || params.size() == 0) | 489 if (params.size() > 2 || params.size() == 0) |
| 490 { | 490 { |
| 491 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 491 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 492 return FALSE; | 492 return FALSE; |
| 493 } | 493 } |
| 494 | 494 |
| 495 CJS_Context* pContext = (CJS_Context*)cc; | 495 CJS_Context* pContext = (CJS_Context*)cc; |
| 496 ASSERT(pContext != NULL); | 496 ASSERT(pContext != NULL); |
| 497 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 497 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 526 TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject(); | 526 TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject(); |
| 527 ASSERT(pTimerObj != NULL); | 527 ASSERT(pTimerObj != NULL); |
| 528 | 528 |
| 529 pTimerObj->SetTimer(pTimer); | 529 pTimerObj->SetTimer(pTimer); |
| 530 | 530 |
| 531 vRet = pRetObj; | 531 vRet = pRetObj; |
| 532 | 532 |
| 533 return TRUE; | 533 return TRUE; |
| 534 } | 534 } |
| 535 | 535 |
| 536 FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS) | 536 FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, JS_ErrorString& sError) |
| 537 { | 537 { |
| 538 if (params.size() > 2 || params.size() == 0) | 538 if (params.size() > 2 || params.size() == 0) |
| 539 { | 539 { |
| 540 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 540 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 541 return FALSE; | 541 return FALSE; |
| 542 } | 542 } |
| 543 | 543 |
| 544 CJS_Context* pContext = (CJS_Context*)cc; | 544 CJS_Context* pContext = (CJS_Context*)cc; |
| 545 ASSERT(pContext != NULL); | 545 ASSERT(pContext != NULL); |
| 546 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 546 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 577 TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject(); | 577 TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject(); |
| 578 ASSERT(pTimerObj != NULL); | 578 ASSERT(pTimerObj != NULL); |
| 579 | 579 |
| 580 pTimerObj->SetTimer(pTimer); | 580 pTimerObj->SetTimer(pTimer); |
| 581 | 581 |
| 582 vRet = pRetObj; | 582 vRet = pRetObj; |
| 583 | 583 |
| 584 return TRUE; | 584 return TRUE; |
| 585 } | 585 } |
| 586 | 586 |
| 587 FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS) | 587 FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
| 588 { | 588 { |
| 589 CJS_Context* pContext = (CJS_Context*)cc; | 589 CJS_Context* pContext = (CJS_Context*)cc; |
| 590 ASSERT(pContext != NULL); | 590 ASSERT(pContext != NULL); |
| 591 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 591 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| 592 ASSERT(pRuntime != NULL); | 592 ASSERT(pRuntime != NULL); |
| 593 | 593 |
| 594 if (params.size() != 1) | 594 if (params.size() != 1) |
| 595 { | 595 { |
| 596 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 596 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 597 return FALSE; | 597 return FALSE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 625 } | 625 } |
| 626 } | 626 } |
| 627 } | 627 } |
| 628 } | 628 } |
| 629 } | 629 } |
| 630 } | 630 } |
| 631 | 631 |
| 632 return TRUE; | 632 return TRUE; |
| 633 } | 633 } |
| 634 | 634 |
| 635 FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS) | 635 FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
| 636 { | 636 { |
| 637 CJS_Context* pContext = (CJS_Context*)cc; | 637 CJS_Context* pContext = (CJS_Context*)cc; |
| 638 ASSERT(pContext != NULL); | 638 ASSERT(pContext != NULL); |
| 639 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 639 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| 640 ASSERT(pRuntime != NULL); | 640 ASSERT(pRuntime != NULL); |
| 641 | 641 |
| 642 if (params.size() != 1) | 642 if (params.size() != 1) |
| 643 { | 643 { |
| 644 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 644 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 645 return FALSE; | 645 return FALSE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 673 } | 673 } |
| 674 } | 674 } |
| 675 } | 675 } |
| 676 } | 676 } |
| 677 } | 677 } |
| 678 } | 678 } |
| 679 | 679 |
| 680 return TRUE; | 680 return TRUE; |
| 681 } | 681 } |
| 682 | 682 |
| 683 FX_BOOL app::execMenuItem(OBJ_METHOD_PARAMS) | 683 FX_BOOL app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
| 684 { | 684 { |
| 685 return FALSE; | 685 return FALSE; |
| 686 } | 686 } |
| 687 | 687 |
| 688 void app::TimerProc(CJS_Timer* pTimer) | 688 void app::TimerProc(CJS_Timer* pTimer) |
| 689 { | 689 { |
| 690 ASSERT(pTimer != NULL); | 690 ASSERT(pTimer != NULL); |
| 691 | 691 |
| 692 switch (pTimer->GetType()) | 692 switch (pTimer->GetType()) |
| 693 { | 693 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 713 { | 713 { |
| 714 IFXJS_Context* pContext = pRuntime->NewContext(); | 714 IFXJS_Context* pContext = pRuntime->NewContext(); |
| 715 ASSERT(pContext != NULL); | 715 ASSERT(pContext != NULL); |
| 716 pContext->OnExternal_Exec(); | 716 pContext->OnExternal_Exec(); |
| 717 CFX_WideString wtInfo; | 717 CFX_WideString wtInfo; |
| 718 pContext->RunScript(wsScript,wtInfo); | 718 pContext->RunScript(wsScript,wtInfo); |
| 719 pRuntime->ReleaseContext(pContext); | 719 pRuntime->ReleaseContext(pContext); |
| 720 } | 720 } |
| 721 } | 721 } |
| 722 | 722 |
| 723 FX_BOOL app::goBack(OBJ_METHOD_PARAMS) | 723 FX_BOOL app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 724 { | 724 { |
| 725 // Not supported. | 725 // Not supported. |
| 726 return TRUE; | 726 return TRUE; |
| 727 } | 727 } |
| 728 | 728 |
| 729 FX_BOOL app::goForward(OBJ_METHOD_PARAMS) | 729 FX_BOOL app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
e& vRet, JS_ErrorString& sError) |
| 730 { | 730 { |
| 731 // Not supported. | 731 // Not supported. |
| 732 return TRUE; | 732 return TRUE; |
| 733 } | 733 } |
| 734 | 734 |
| 735 FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS) | 735 FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 736 { | 736 { |
| 737 CJS_Context* pContext = (CJS_Context*)cc; | 737 CJS_Context* pContext = (CJS_Context*)cc; |
| 738 ASSERT(pContext != NULL); | 738 ASSERT(pContext != NULL); |
| 739 | 739 |
| 740 v8::Isolate* isolate = GetIsolate(cc); | 740 v8::Isolate* isolate = GetIsolate(cc); |
| 741 | 741 |
| 742 FX_BOOL bUI = TRUE; | 742 FX_BOOL bUI = TRUE; |
| 743 CFX_WideString cTo = L""; | 743 CFX_WideString cTo = L""; |
| 744 CFX_WideString cCc = L""; | 744 CFX_WideString cCc = L""; |
| 745 CFX_WideString cBcc = L""; | 745 CFX_WideString cBcc = L""; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 | 789 |
| 790 pRuntime->BeginBlock(); | 790 pRuntime->BeginBlock(); |
| 791 pApp->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_
str(), cBcc.c_str(), cMsg.c_str()); | 791 pApp->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_
str(), cBcc.c_str(), cMsg.c_str()); |
| 792 ////////////////////////////////////////////////////////////////////////
/////////////////////// | 792 ////////////////////////////////////////////////////////////////////////
/////////////////////// |
| 793 pRuntime->EndBlock(); | 793 pRuntime->EndBlock(); |
| 794 | 794 |
| 795 //return bRet; | 795 //return bRet; |
| 796 return FALSE; | 796 return FALSE; |
| 797 } | 797 } |
| 798 | 798 |
| 799 FX_BOOL app::launchURL(OBJ_METHOD_PARAMS) | 799 FX_BOOL app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
e& vRet, JS_ErrorString& sError) |
| 800 { | 800 { |
| 801 // Unsafe, not supported. | 801 // Unsafe, not supported. |
| 802 return TRUE; | 802 return TRUE; |
| 803 } | 803 } |
| 804 | 804 |
| 805 FX_BOOL app::runtimeHighlight(OBJ_PROP_PARAMS) | 805 FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorStri
ng& sError) |
| 806 { | 806 { |
| 807 if (vp.IsSetting()) | 807 if (vp.IsSetting()) |
| 808 { | 808 { |
| 809 vp>>m_bRuntimeHighLight; | 809 vp>>m_bRuntimeHighLight; |
| 810 } | 810 } |
| 811 else | 811 else |
| 812 { | 812 { |
| 813 vp<<m_bRuntimeHighLight; | 813 vp<<m_bRuntimeHighLight; |
| 814 } | 814 } |
| 815 | 815 |
| 816 return TRUE; | 816 return TRUE; |
| 817 } | 817 } |
| 818 | 818 |
| 819 FX_BOOL app::fullscreen(OBJ_PROP_PARAMS) | 819 FX_BOOL app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
| 820 { | 820 { |
| 821 return FALSE; | 821 return FALSE; |
| 822 } | 822 } |
| 823 | 823 |
| 824 FX_BOOL app::popUpMenu(OBJ_METHOD_PARAMS) | 824 FX_BOOL app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
e& vRet, JS_ErrorString& sError) |
| 825 { | 825 { |
| 826 return FALSE; | 826 return FALSE; |
| 827 } | 827 } |
| 828 | 828 |
| 829 | 829 |
| 830 FX_BOOL app::browseForDoc(OBJ_METHOD_PARAMS) | 830 FX_BOOL app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
| 831 { | 831 { |
| 832 // Unsafe, not supported. | 832 // Unsafe, not supported. |
| 833 return TRUE; | 833 return TRUE; |
| 834 } | 834 } |
| 835 | 835 |
| 836 CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) | 836 CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) |
| 837 { | 837 { |
| 838 CFX_WideString sRet = L"/"; | 838 CFX_WideString sRet = L"/"; |
| 839 | 839 |
| 840 for (int i=0,sz=sOldPath.GetLength(); i<sz; i++) | 840 for (int i=0,sz=sOldPath.GetLength(); i<sz; i++) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 852 else | 852 else |
| 853 { | 853 { |
| 854 sRet += c; | 854 sRet += c; |
| 855 } | 855 } |
| 856 } | 856 } |
| 857 } | 857 } |
| 858 | 858 |
| 859 return sRet; | 859 return sRet; |
| 860 } | 860 } |
| 861 | 861 |
| 862 FX_BOOL app::newDoc(OBJ_METHOD_PARAMS) | 862 FX_BOOL app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 863 { | 863 { |
| 864 return FALSE; | 864 return FALSE; |
| 865 } | 865 } |
| 866 | 866 |
| 867 FX_BOOL app::openDoc(OBJ_METHOD_PARAMS) | 867 FX_BOOL app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 868 { | 868 { |
| 869 return FALSE; | 869 return FALSE; |
| 870 } | 870 } |
| 871 | 871 |
| 872 FX_BOOL app::response(OBJ_METHOD_PARAMS) | 872 FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
& vRet, JS_ErrorString& sError) |
| 873 { | 873 { |
| 874 CFX_WideString swQuestion = L""; | 874 CFX_WideString swQuestion = L""; |
| 875 CFX_WideString swLabel = L""; | 875 CFX_WideString swLabel = L""; |
| 876 CFX_WideString swTitle = L"PDF"; | 876 CFX_WideString swTitle = L"PDF"; |
| 877 CFX_WideString swDefault = L""; | 877 CFX_WideString swDefault = L""; |
| 878 bool bPassWord = false; | 878 bool bPassWord = false; |
| 879 | 879 |
| 880 v8::Isolate* isolate = GetIsolate(cc); | 880 v8::Isolate* isolate = GetIsolate(cc); |
| 881 | 881 |
| 882 int iLength = params.size(); | 882 int iLength = params.size(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 return FALSE; | 942 return FALSE; |
| 943 } | 943 } |
| 944 if (nLengthBytes > MAX_INPUT_BYTES) | 944 if (nLengthBytes > MAX_INPUT_BYTES) |
| 945 nLengthBytes = MAX_INPUT_BYTES; | 945 nLengthBytes = MAX_INPUT_BYTES; |
| 946 | 946 |
| 947 vRet = CFX_WideString::FromUTF16LE((unsigned short*)pBuff, nLengthBytes
/ sizeof(unsigned short)); | 947 vRet = CFX_WideString::FromUTF16LE((unsigned short*)pBuff, nLengthBytes
/ sizeof(unsigned short)); |
| 948 delete[] pBuff; | 948 delete[] pBuff; |
| 949 return TRUE; | 949 return TRUE; |
| 950 } | 950 } |
| 951 | 951 |
| 952 FX_BOOL app::media(OBJ_PROP_PARAMS) | 952 FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) |
| 953 { | 953 { |
| 954 return FALSE; | 954 return FALSE; |
| 955 } | 955 } |
| 956 | 956 |
| 957 FX_BOOL app::execDialog(OBJ_METHOD_PARAMS) | 957 FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, JS_ErrorString& sError) |
| 958 { | 958 { |
| 959 return TRUE; | 959 return TRUE; |
| 960 } | 960 } |
| OLD | NEW |