| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 | 127 |
| 128 app::~app(void) | 128 app::~app(void) |
| 129 { | 129 { |
| 130 for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++) | 130 for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++) |
| 131 delete m_aTimer[i]; | 131 delete m_aTimer[i]; |
| 132 | 132 |
| 133 m_aTimer.RemoveAll(); | 133 m_aTimer.RemoveAll(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 FX_BOOL app::activeDocs(OBJ_PROP_PARAMS) | 136 FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
| 137 { | 137 { |
| 138 if (vp.IsGetting()) | 138 if (vp.IsGetting()) |
| 139 { | 139 { |
| 140 | 140 |
| 141 CJS_Context* pContext = (CJS_Context *)cc; | 141 CJS_Context* pContext = (CJS_Context *)cc; |
| 142 ASSERT(pContext != NULL); | 142 ASSERT(pContext != NULL); |
| 143 | 143 |
| 144 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); | 144 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); |
| 145 ASSERT(pApp != NULL); | 145 ASSERT(pApp != NULL); |
| 146 | 146 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 if (aDocs.GetLength() > 0) | 185 if (aDocs.GetLength() > 0) |
| 186 vp << aDocs; | 186 vp << aDocs; |
| 187 else | 187 else |
| 188 vp.SetNull(); | 188 vp.SetNull(); |
| 189 return TRUE; | 189 return TRUE; |
| 190 } | 190 } |
| 191 return FALSE; | 191 return FALSE; |
| 192 } | 192 } |
| 193 | 193 |
| 194 FX_BOOL app::calculate(OBJ_PROP_PARAMS) | 194 FX_BOOL app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sEr
ror) |
| 195 { | 195 { |
| 196 if (vp.IsSetting()) | 196 if (vp.IsSetting()) |
| 197 { | 197 { |
| 198 bool bVP; | 198 bool bVP; |
| 199 vp >> bVP; | 199 vp >> bVP; |
| 200 m_bCalculate = (FX_BOOL)bVP; | 200 m_bCalculate = (FX_BOOL)bVP; |
| 201 | 201 |
| 202 CJS_Context* pContext = (CJS_Context*)cc; | 202 CJS_Context* pContext = (CJS_Context*)cc; |
| 203 ASSERT(pContext != NULL); | 203 ASSERT(pContext != NULL); |
| 204 | 204 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 222 // } | 222 // } |
| 223 } | 223 } |
| 224 else | 224 else |
| 225 { | 225 { |
| 226 vp << (bool)m_bCalculate; | 226 vp << (bool)m_bCalculate; |
| 227 } | 227 } |
| 228 | 228 |
| 229 return TRUE; | 229 return TRUE; |
| 230 } | 230 } |
| 231 | 231 |
| 232 FX_BOOL app::formsVersion(OBJ_PROP_PARAMS) | 232 FX_BOOL app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
| 233 { | 233 { |
| 234 if (vp.IsGetting()) | 234 if (vp.IsGetting()) |
| 235 { | 235 { |
| 236 vp << JS_NUM_FORMSVERSION; | 236 vp << JS_NUM_FORMSVERSION; |
| 237 return TRUE; | 237 return TRUE; |
| 238 } | 238 } |
| 239 | 239 |
| 240 return FALSE; | 240 return FALSE; |
| 241 } | 241 } |
| 242 | 242 |
| 243 FX_BOOL app::viewerType(OBJ_PROP_PARAMS) | 243 FX_BOOL app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
| 244 { | 244 { |
| 245 if (vp.IsGetting()) | 245 if (vp.IsGetting()) |
| 246 { | 246 { |
| 247 vp << L"unknown"; | 247 vp << L"unknown"; |
| 248 return TRUE; | 248 return TRUE; |
| 249 } | 249 } |
| 250 | 250 |
| 251 return FALSE; | 251 return FALSE; |
| 252 } | 252 } |
| 253 | 253 |
| 254 FX_BOOL app::viewerVariation(OBJ_PROP_PARAMS) | 254 FX_BOOL app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorStrin
g& sError) |
| 255 { | 255 { |
| 256 if (vp.IsGetting()) | 256 if (vp.IsGetting()) |
| 257 { | 257 { |
| 258 vp << JS_STR_VIEWERVARIATION; | 258 vp << JS_STR_VIEWERVARIATION; |
| 259 return TRUE; | 259 return TRUE; |
| 260 } | 260 } |
| 261 | 261 |
| 262 return FALSE; | 262 return FALSE; |
| 263 } | 263 } |
| 264 | 264 |
| 265 FX_BOOL app::viewerVersion(OBJ_PROP_PARAMS) | 265 FX_BOOL app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString&
sError) |
| 266 { | 266 { |
| 267 if (vp.IsGetting()) | 267 if (vp.IsGetting()) |
| 268 { | 268 { |
| 269 vp << JS_STR_VIEWERVERSION; | 269 vp << JS_STR_VIEWERVERSION; |
| 270 return TRUE; | 270 return TRUE; |
| 271 } | 271 } |
| 272 | 272 |
| 273 return FALSE; | 273 return FALSE; |
| 274 } | 274 } |
| 275 | 275 |
| 276 FX_BOOL app::platform(OBJ_PROP_PARAMS) | 276 FX_BOOL app::platform(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sErr
or) |
| 277 { | 277 { |
| 278 if (vp.IsGetting()) | 278 if (vp.IsGetting()) |
| 279 { | 279 { |
| 280 vp << JS_STR_PLATFORM; | 280 vp << JS_STR_PLATFORM; |
| 281 return TRUE; | 281 return TRUE; |
| 282 } | 282 } |
| 283 | 283 |
| 284 return FALSE; | 284 return FALSE; |
| 285 } | 285 } |
| 286 | 286 |
| 287 FX_BOOL app::language(OBJ_PROP_PARAMS) | 287 FX_BOOL app::language(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sErr
or) |
| 288 { | 288 { |
| 289 if (vp.IsGetting()) | 289 if (vp.IsGetting()) |
| 290 { | 290 { |
| 291 vp << JS_STR_LANGUANGE; | 291 vp << JS_STR_LANGUANGE; |
| 292 return TRUE; | 292 return TRUE; |
| 293 } | 293 } |
| 294 | 294 |
| 295 return FALSE; | 295 return FALSE; |
| 296 } | 296 } |
| 297 | 297 |
| 298 //creates a new fdf object that contains no data | 298 //creates a new fdf object that contains no data |
| 299 //comment: need reader support | 299 //comment: need reader support |
| 300 //note: | 300 //note: |
| 301 //CFDF_Document * CPDFDoc_Environment::NewFDF(); | 301 //CFDF_Document * CPDFDoc_Environment::NewFDF(); |
| 302 FX_BOOL app::newFDF(OBJ_METHOD_PARAMS) | 302 FX_BOOL app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 303 { | 303 { |
| 304 return TRUE; | 304 return TRUE; |
| 305 } | 305 } |
| 306 //opens a specified pdf document and returns its document object | 306 //opens a specified pdf document and returns its document object |
| 307 //comment:need reader support | 307 //comment:need reader support |
| 308 //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. | 308 //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. |
| 309 //CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv); | 309 //CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv); |
| 310 | 310 |
| 311 FX_BOOL app::openFDF(OBJ_METHOD_PARAMS) | 311 FX_BOOL app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 312 { | 312 { |
| 313 return TRUE; | 313 return TRUE; |
| 314 } | 314 } |
| 315 | 315 |
| 316 FX_BOOL app::alert(OBJ_METHOD_PARAMS) | 316 FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
Ret, JS_ErrorString& sError) |
| 317 { | 317 { |
| 318 int iSize = params.size(); | 318 int iSize = params.size(); |
| 319 if (iSize < 1) | 319 if (iSize < 1) |
| 320 return FALSE; | 320 return FALSE; |
| 321 | 321 |
| 322 CFX_WideString swMsg = L""; | 322 CFX_WideString swMsg = L""; |
| 323 CFX_WideString swTitle = L""; | 323 CFX_WideString swTitle = L""; |
| 324 int iIcon = 0; | 324 int iIcon = 0; |
| 325 int iType = 0; | 325 int iType = 0; |
| 326 | 326 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 431 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| 432 ASSERT(pRuntime != NULL); | 432 ASSERT(pRuntime != NULL); |
| 433 pRuntime->BeginBlock(); | 433 pRuntime->BeginBlock(); |
| 434 vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc),swMsg,swTitle,
iType,iIcon); | 434 vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc),swMsg,swTitle,
iType,iIcon); |
| 435 pRuntime->EndBlock(); | 435 pRuntime->EndBlock(); |
| 436 | 436 |
| 437 return TRUE; | 437 return TRUE; |
| 438 } | 438 } |
| 439 | 439 |
| 440 | 440 |
| 441 FX_BOOL app::beep(OBJ_METHOD_PARAMS) | 441 FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
et, JS_ErrorString& sError) |
| 442 { | 442 { |
| 443 if (params.size() == 1) | 443 if (params.size() == 1) |
| 444 { | 444 { |
| 445 CJS_Context* pContext = (CJS_Context*)cc; | 445 CJS_Context* pContext = (CJS_Context*)cc; |
| 446 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 446 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| 447 CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp(); | 447 CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp(); |
| 448 pEnv->JS_appBeep((int)params[0]); | 448 pEnv->JS_appBeep((int)params[0]); |
| 449 | 449 |
| 450 return TRUE; | 450 return TRUE; |
| 451 } | 451 } |
| 452 else | 452 else |
| 453 { | 453 { |
| 454 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 454 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 455 return FALSE; | 455 return FALSE; |
| 456 } | 456 } |
| 457 } | 457 } |
| 458 | 458 |
| 459 FX_BOOL app::findComponent(OBJ_METHOD_PARAMS) | 459 FX_BOOL app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
| 460 { | 460 { |
| 461 return TRUE; | 461 return TRUE; |
| 462 } | 462 } |
| 463 | 463 |
| 464 FX_BOOL app::popUpMenuEx(OBJ_METHOD_PARAMS) | 464 FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
lue& vRet, JS_ErrorString& sError) |
| 465 { | 465 { |
| 466 return FALSE; | 466 return FALSE; |
| 467 } | 467 } |
| 468 | 468 |
| 469 FX_BOOL app::fs(OBJ_PROP_PARAMS) | 469 FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) |
| 470 { | 470 { |
| 471 return FALSE; | 471 return FALSE; |
| 472 } | 472 } |
| 473 | 473 |
| 474 FX_BOOL app::setInterval(OBJ_METHOD_PARAMS) | 474 FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
lue& vRet, JS_ErrorString& sError) |
| 475 { | 475 { |
| 476 if (params.size() > 2 || params.size() == 0) | 476 if (params.size() > 2 || params.size() == 0) |
| 477 { | 477 { |
| 478 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 478 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 479 return FALSE; | 479 return FALSE; |
| 480 } | 480 } |
| 481 | 481 |
| 482 CJS_Context* pContext = (CJS_Context*)cc; | 482 CJS_Context* pContext = (CJS_Context*)cc; |
| 483 ASSERT(pContext != NULL); | 483 ASSERT(pContext != NULL); |
| 484 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 484 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 513 TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject(); | 513 TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject(); |
| 514 ASSERT(pTimerObj != NULL); | 514 ASSERT(pTimerObj != NULL); |
| 515 | 515 |
| 516 pTimerObj->SetTimer(pTimer); | 516 pTimerObj->SetTimer(pTimer); |
| 517 | 517 |
| 518 vRet = pRetObj; | 518 vRet = pRetObj; |
| 519 | 519 |
| 520 return TRUE; | 520 return TRUE; |
| 521 } | 521 } |
| 522 | 522 |
| 523 FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS) | 523 FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, JS_ErrorString& sError) |
| 524 { | 524 { |
| 525 if (params.size() > 2 || params.size() == 0) | 525 if (params.size() > 2 || params.size() == 0) |
| 526 { | 526 { |
| 527 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 527 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 528 return FALSE; | 528 return FALSE; |
| 529 } | 529 } |
| 530 | 530 |
| 531 CJS_Context* pContext = (CJS_Context*)cc; | 531 CJS_Context* pContext = (CJS_Context*)cc; |
| 532 ASSERT(pContext != NULL); | 532 ASSERT(pContext != NULL); |
| 533 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 533 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 564 TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject(); | 564 TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject(); |
| 565 ASSERT(pTimerObj != NULL); | 565 ASSERT(pTimerObj != NULL); |
| 566 | 566 |
| 567 pTimerObj->SetTimer(pTimer); | 567 pTimerObj->SetTimer(pTimer); |
| 568 | 568 |
| 569 vRet = pRetObj; | 569 vRet = pRetObj; |
| 570 | 570 |
| 571 return TRUE; | 571 return TRUE; |
| 572 } | 572 } |
| 573 | 573 |
| 574 FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS) | 574 FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
| 575 { | 575 { |
| 576 CJS_Context* pContext = (CJS_Context*)cc; | 576 CJS_Context* pContext = (CJS_Context*)cc; |
| 577 ASSERT(pContext != NULL); | 577 ASSERT(pContext != NULL); |
| 578 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 578 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| 579 ASSERT(pRuntime != NULL); | 579 ASSERT(pRuntime != NULL); |
| 580 | 580 |
| 581 if (params.size() != 1) | 581 if (params.size() != 1) |
| 582 { | 582 { |
| 583 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 583 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 584 return FALSE; | 584 return FALSE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 612 } | 612 } |
| 613 } | 613 } |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 } | 616 } |
| 617 } | 617 } |
| 618 | 618 |
| 619 return TRUE; | 619 return TRUE; |
| 620 } | 620 } |
| 621 | 621 |
| 622 FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS) | 622 FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
Value& vRet, JS_ErrorString& sError) |
| 623 { | 623 { |
| 624 CJS_Context* pContext = (CJS_Context*)cc; | 624 CJS_Context* pContext = (CJS_Context*)cc; |
| 625 ASSERT(pContext != NULL); | 625 ASSERT(pContext != NULL); |
| 626 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 626 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
| 627 ASSERT(pRuntime != NULL); | 627 ASSERT(pRuntime != NULL); |
| 628 | 628 |
| 629 if (params.size() != 1) | 629 if (params.size() != 1) |
| 630 { | 630 { |
| 631 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); | 631 sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAME
RROR); |
| 632 return FALSE; | 632 return FALSE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 660 } | 660 } |
| 661 } | 661 } |
| 662 } | 662 } |
| 663 } | 663 } |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 | 666 |
| 667 return TRUE; | 667 return TRUE; |
| 668 } | 668 } |
| 669 | 669 |
| 670 FX_BOOL app::execMenuItem(OBJ_METHOD_PARAMS) | 670 FX_BOOL app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
| 671 { | 671 { |
| 672 return FALSE; | 672 return FALSE; |
| 673 } | 673 } |
| 674 | 674 |
| 675 void app::TimerProc(CJS_Timer* pTimer) | 675 void app::TimerProc(CJS_Timer* pTimer) |
| 676 { | 676 { |
| 677 ASSERT(pTimer != NULL); | 677 ASSERT(pTimer != NULL); |
| 678 | 678 |
| 679 switch (pTimer->GetType()) | 679 switch (pTimer->GetType()) |
| 680 { | 680 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 700 { | 700 { |
| 701 IFXJS_Context* pContext = pRuntime->NewContext(); | 701 IFXJS_Context* pContext = pRuntime->NewContext(); |
| 702 ASSERT(pContext != NULL); | 702 ASSERT(pContext != NULL); |
| 703 pContext->OnExternal_Exec(); | 703 pContext->OnExternal_Exec(); |
| 704 CFX_WideString wtInfo; | 704 CFX_WideString wtInfo; |
| 705 pContext->RunScript(wsScript,wtInfo); | 705 pContext->RunScript(wsScript,wtInfo); |
| 706 pRuntime->ReleaseContext(pContext); | 706 pRuntime->ReleaseContext(pContext); |
| 707 } | 707 } |
| 708 } | 708 } |
| 709 | 709 |
| 710 FX_BOOL app::goBack(OBJ_METHOD_PARAMS) | 710 FX_BOOL app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 711 { | 711 { |
| 712 // Not supported. | 712 // Not supported. |
| 713 return TRUE; | 713 return TRUE; |
| 714 } | 714 } |
| 715 | 715 |
| 716 FX_BOOL app::goForward(OBJ_METHOD_PARAMS) | 716 FX_BOOL app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
e& vRet, JS_ErrorString& sError) |
| 717 { | 717 { |
| 718 // Not supported. | 718 // Not supported. |
| 719 return TRUE; | 719 return TRUE; |
| 720 } | 720 } |
| 721 | 721 |
| 722 FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS) | 722 FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 723 { | 723 { |
| 724 CJS_Context* pContext = (CJS_Context*)cc; | 724 CJS_Context* pContext = (CJS_Context*)cc; |
| 725 ASSERT(pContext != NULL); | 725 ASSERT(pContext != NULL); |
| 726 | 726 |
| 727 v8::Isolate* isolate = GetIsolate(cc); | 727 v8::Isolate* isolate = GetIsolate(cc); |
| 728 | 728 |
| 729 FX_BOOL bUI = TRUE; | 729 FX_BOOL bUI = TRUE; |
| 730 CFX_WideString cTo = L""; | 730 CFX_WideString cTo = L""; |
| 731 CFX_WideString cCc = L""; | 731 CFX_WideString cCc = L""; |
| 732 CFX_WideString cBcc = L""; | 732 CFX_WideString cBcc = L""; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 | 776 |
| 777 pRuntime->BeginBlock(); | 777 pRuntime->BeginBlock(); |
| 778 pApp->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_
str(), cBcc.c_str(), cMsg.c_str()); | 778 pApp->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_
str(), cBcc.c_str(), cMsg.c_str()); |
| 779 ////////////////////////////////////////////////////////////////////////
/////////////////////// | 779 ////////////////////////////////////////////////////////////////////////
/////////////////////// |
| 780 pRuntime->EndBlock(); | 780 pRuntime->EndBlock(); |
| 781 | 781 |
| 782 //return bRet; | 782 //return bRet; |
| 783 return FALSE; | 783 return FALSE; |
| 784 } | 784 } |
| 785 | 785 |
| 786 FX_BOOL app::launchURL(OBJ_METHOD_PARAMS) | 786 FX_BOOL app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
e& vRet, JS_ErrorString& sError) |
| 787 { | 787 { |
| 788 // Unsafe, not supported. | 788 // Unsafe, not supported. |
| 789 return TRUE; | 789 return TRUE; |
| 790 } | 790 } |
| 791 | 791 |
| 792 FX_BOOL app::runtimeHighlight(OBJ_PROP_PARAMS) | 792 FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorStri
ng& sError) |
| 793 { | 793 { |
| 794 if (vp.IsSetting()) | 794 if (vp.IsSetting()) |
| 795 { | 795 { |
| 796 vp>>m_bRuntimeHighLight; | 796 vp>>m_bRuntimeHighLight; |
| 797 } | 797 } |
| 798 else | 798 else |
| 799 { | 799 { |
| 800 vp<<m_bRuntimeHighLight; | 800 vp<<m_bRuntimeHighLight; |
| 801 } | 801 } |
| 802 | 802 |
| 803 return TRUE; | 803 return TRUE; |
| 804 } | 804 } |
| 805 | 805 |
| 806 FX_BOOL app::fullscreen(OBJ_PROP_PARAMS) | 806 FX_BOOL app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sE
rror) |
| 807 { | 807 { |
| 808 return FALSE; | 808 return FALSE; |
| 809 } | 809 } |
| 810 | 810 |
| 811 FX_BOOL app::popUpMenu(OBJ_METHOD_PARAMS) | 811 FX_BOOL app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
e& vRet, JS_ErrorString& sError) |
| 812 { | 812 { |
| 813 return FALSE; | 813 return FALSE; |
| 814 } | 814 } |
| 815 | 815 |
| 816 | 816 |
| 817 FX_BOOL app::browseForDoc(OBJ_METHOD_PARAMS) | 817 FX_BOOL app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, JS_ErrorString& sError) |
| 818 { | 818 { |
| 819 // Unsafe, not supported. | 819 // Unsafe, not supported. |
| 820 return TRUE; | 820 return TRUE; |
| 821 } | 821 } |
| 822 | 822 |
| 823 CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) | 823 CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) |
| 824 { | 824 { |
| 825 CFX_WideString sRet = L"/"; | 825 CFX_WideString sRet = L"/"; |
| 826 | 826 |
| 827 for (int i=0,sz=sOldPath.GetLength(); i<sz; i++) | 827 for (int i=0,sz=sOldPath.GetLength(); i<sz; i++) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 839 else | 839 else |
| 840 { | 840 { |
| 841 sRet += c; | 841 sRet += c; |
| 842 } | 842 } |
| 843 } | 843 } |
| 844 } | 844 } |
| 845 | 845 |
| 846 return sRet; | 846 return sRet; |
| 847 } | 847 } |
| 848 | 848 |
| 849 FX_BOOL app::newDoc(OBJ_METHOD_PARAMS) | 849 FX_BOOL app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 850 { | 850 { |
| 851 return FALSE; | 851 return FALSE; |
| 852 } | 852 } |
| 853 | 853 |
| 854 FX_BOOL app::openDoc(OBJ_METHOD_PARAMS) | 854 FX_BOOL app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet, JS_ErrorString& sError) |
| 855 { | 855 { |
| 856 return FALSE; | 856 return FALSE; |
| 857 } | 857 } |
| 858 | 858 |
| 859 FX_BOOL app::response(OBJ_METHOD_PARAMS) | 859 FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
& vRet, JS_ErrorString& sError) |
| 860 { | 860 { |
| 861 CFX_WideString swQuestion = L""; | 861 CFX_WideString swQuestion = L""; |
| 862 CFX_WideString swLabel = L""; | 862 CFX_WideString swLabel = L""; |
| 863 CFX_WideString swTitle = L"PDF"; | 863 CFX_WideString swTitle = L"PDF"; |
| 864 CFX_WideString swDefault = L""; | 864 CFX_WideString swDefault = L""; |
| 865 bool bPassWord = false; | 865 bool bPassWord = false; |
| 866 | 866 |
| 867 v8::Isolate* isolate = GetIsolate(cc); | 867 v8::Isolate* isolate = GetIsolate(cc); |
| 868 | 868 |
| 869 int iLength = params.size(); | 869 int iLength = params.size(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 return FALSE; | 929 return FALSE; |
| 930 } | 930 } |
| 931 if (nLengthBytes > MAX_INPUT_BYTES) | 931 if (nLengthBytes > MAX_INPUT_BYTES) |
| 932 nLengthBytes = MAX_INPUT_BYTES; | 932 nLengthBytes = MAX_INPUT_BYTES; |
| 933 | 933 |
| 934 vRet = CFX_WideString::FromUTF16LE((unsigned short*)pBuff, nLengthBytes
/ sizeof(unsigned short)); | 934 vRet = CFX_WideString::FromUTF16LE((unsigned short*)pBuff, nLengthBytes
/ sizeof(unsigned short)); |
| 935 delete[] pBuff; | 935 delete[] pBuff; |
| 936 return TRUE; | 936 return TRUE; |
| 937 } | 937 } |
| 938 | 938 |
| 939 FX_BOOL app::media(OBJ_PROP_PARAMS) | 939 FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError) |
| 940 { | 940 { |
| 941 return FALSE; | 941 return FALSE; |
| 942 } | 942 } |
| 943 | 943 |
| 944 FX_BOOL app::execDialog(OBJ_METHOD_PARAMS) | 944 FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, JS_ErrorString& sError) |
| 945 { | 945 { |
| 946 return TRUE; | 946 return TRUE; |
| 947 } | 947 } |
| OLD | NEW |