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 "fpdfsdk/javascript/app.h" | 7 #include "fpdfsdk/javascript/app.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 return FALSE; | 376 return FALSE; |
377 } | 377 } |
378 | 378 |
379 CFX_WideString script = params.size() > 0 ? params[0].ToCFXWideString() : L""; | 379 CFX_WideString script = params.size() > 0 ? params[0].ToCFXWideString() : L""; |
380 if (script.IsEmpty()) { | 380 if (script.IsEmpty()) { |
381 sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE); | 381 sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE); |
382 return TRUE; | 382 return TRUE; |
383 } | 383 } |
384 | 384 |
385 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 385 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
386 FX_DWORD dwInterval = params.size() > 1 ? params[1].ToInt() : 1000; | 386 uint32_t dwInterval = params.size() > 1 ? params[1].ToInt() : 1000; |
387 | 387 |
388 CPDFDoc_Environment* pApp = pRuntime->GetReaderApp(); | 388 CPDFDoc_Environment* pApp = pRuntime->GetReaderApp(); |
389 ASSERT(pApp); | 389 ASSERT(pApp); |
390 CJS_Timer* pTimer = | 390 CJS_Timer* pTimer = |
391 new CJS_Timer(this, pApp, pRuntime, 0, script, dwInterval, 0); | 391 new CJS_Timer(this, pApp, pRuntime, 0, script, dwInterval, 0); |
392 m_aTimer.Add(pTimer); | 392 m_aTimer.Add(pTimer); |
393 | 393 |
394 v8::Local<v8::Object> pRetObj = FXJS_NewFxDynamicObj( | 394 v8::Local<v8::Object> pRetObj = FXJS_NewFxDynamicObj( |
395 pRuntime->GetIsolate(), pRuntime, CJS_TimerObj::g_nObjDefnID); | 395 pRuntime->GetIsolate(), pRuntime, CJS_TimerObj::g_nObjDefnID); |
396 CJS_TimerObj* pJS_TimerObj = | 396 CJS_TimerObj* pJS_TimerObj = |
(...skipping 17 matching lines...) Expand all Loading... |
414 CJS_Context* pContext = (CJS_Context*)cc; | 414 CJS_Context* pContext = (CJS_Context*)cc; |
415 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 415 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
416 | 416 |
417 CFX_WideString script = params.size() > 0 ? params[0].ToCFXWideString() : L""; | 417 CFX_WideString script = params.size() > 0 ? params[0].ToCFXWideString() : L""; |
418 if (script.IsEmpty()) { | 418 if (script.IsEmpty()) { |
419 sError = | 419 sError = |
420 JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE); | 420 JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE); |
421 return TRUE; | 421 return TRUE; |
422 } | 422 } |
423 | 423 |
424 FX_DWORD dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000; | 424 uint32_t dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000; |
425 | 425 |
426 CPDFDoc_Environment* pApp = pRuntime->GetReaderApp(); | 426 CPDFDoc_Environment* pApp = pRuntime->GetReaderApp(); |
427 ASSERT(pApp); | 427 ASSERT(pApp); |
428 | 428 |
429 CJS_Timer* pTimer = | 429 CJS_Timer* pTimer = |
430 new CJS_Timer(this, pApp, pRuntime, 1, script, dwTimeOut, dwTimeOut); | 430 new CJS_Timer(this, pApp, pRuntime, 1, script, dwTimeOut, dwTimeOut); |
431 m_aTimer.Add(pTimer); | 431 m_aTimer.Add(pTimer); |
432 | 432 |
433 v8::Local<v8::Object> pRetObj = FXJS_NewFxDynamicObj( | 433 v8::Local<v8::Object> pRetObj = FXJS_NewFxDynamicObj( |
434 pRuntime->GetIsolate(), pRuntime, CJS_TimerObj::g_nObjDefnID); | 434 pRuntime->GetIsolate(), pRuntime, CJS_TimerObj::g_nObjDefnID); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { | 741 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { |
742 return FALSE; | 742 return FALSE; |
743 } | 743 } |
744 | 744 |
745 FX_BOOL app::execDialog(IJS_Context* cc, | 745 FX_BOOL app::execDialog(IJS_Context* cc, |
746 const std::vector<CJS_Value>& params, | 746 const std::vector<CJS_Value>& params, |
747 CJS_Value& vRet, | 747 CJS_Value& vRet, |
748 CFX_WideString& sError) { | 748 CFX_WideString& sError) { |
749 return TRUE; | 749 return TRUE; |
750 } | 750 } |
OLD | NEW |