| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 int iType = 0; | 333 int iType = 0; |
| 334 | 334 |
| 335 v8::Isolate* isolate = GetIsolate(cc); | 335 v8::Isolate* isolate = GetIsolate(cc); |
| 336 | 336 |
| 337 if (iSize == 1) | 337 if (iSize == 1) |
| 338 { | 338 { |
| 339 if (params[0].GetType() == VT_object) | 339 if (params[0].GetType() == VT_object) |
| 340 { | 340 { |
| 341 JSObject pObj = params[0].ToV8Object(); | 341 JSObject pObj = params[0].ToV8Object(); |
| 342 { | 342 { |
| 343 » » » » v8::Handle<v8::Value> pValue = JS_GetObjectEleme
nt(isolate, pObj, L"cMsg"); | 343 » » » » v8::Local<v8::Value> pValue = JS_GetObjectElemen
t(isolate, pObj, L"cMsg"); |
| 344 swMsg = CJS_Value(isolate, pValue, VT_unknown).T
oCFXWideString(); | 344 swMsg = CJS_Value(isolate, pValue, VT_unknown).T
oCFXWideString(); |
| 345 | 345 |
| 346 pValue = JS_GetObjectElement(isolate, pObj, L"cT
itle"); | 346 pValue = JS_GetObjectElement(isolate, pObj, L"cT
itle"); |
| 347 swTitle = CJS_Value(isolate, pValue, VT_unknown)
.ToCFXWideString(); | 347 swTitle = CJS_Value(isolate, pValue, VT_unknown)
.ToCFXWideString(); |
| 348 | 348 |
| 349 pValue = JS_GetObjectElement(isolate, pObj, L"nI
con"); | 349 pValue = JS_GetObjectElement(isolate, pObj, L"nI
con"); |
| 350 iIcon = CJS_Value(isolate, pValue, VT_unknown).T
oInt(); | 350 iIcon = CJS_Value(isolate, pValue, VT_unknown).T
oInt(); |
| 351 | 351 |
| 352 pValue = JS_GetObjectElement(isolate, pObj, L"nT
ype"); | 352 pValue = JS_GetObjectElement(isolate, pObj, L"nT
ype"); |
| 353 iType = CJS_Value(isolate, pValue, VT_unknown).T
oInt(); | 353 iType = CJS_Value(isolate, pValue, VT_unknown).T
oInt(); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 CFX_WideString cSubject = L""; | 721 CFX_WideString cSubject = L""; |
| 722 CFX_WideString cMsg = L""; | 722 CFX_WideString cMsg = L""; |
| 723 | 723 |
| 724 if (params.size() < 1) | 724 if (params.size() < 1) |
| 725 return FALSE; | 725 return FALSE; |
| 726 | 726 |
| 727 if (params[0].GetType() == VT_object) | 727 if (params[0].GetType() == VT_object) |
| 728 { | 728 { |
| 729 JSObject pObj = params[0].ToV8Object(); | 729 JSObject pObj = params[0].ToV8Object(); |
| 730 | 730 |
| 731 » » v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate, pObj
, L"bUI"); | 731 » » v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate, pObj,
L"bUI"); |
| 732 bUI = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool(
); | 732 bUI = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool(
); |
| 733 | 733 |
| 734 pValue = JS_GetObjectElement(isolate, pObj, L"cTo"); | 734 pValue = JS_GetObjectElement(isolate, pObj, L"cTo"); |
| 735 cTo = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWi
deString(); | 735 cTo = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWi
deString(); |
| 736 | 736 |
| 737 pValue = JS_GetObjectElement(isolate, pObj, L"cCc"); | 737 pValue = JS_GetObjectElement(isolate, pObj, L"cCc"); |
| 738 cCc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWi
deString(); | 738 cCc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWi
deString(); |
| 739 | 739 |
| 740 pValue = JS_GetObjectElement(isolate, pObj, L"cBcc"); | 740 pValue = JS_GetObjectElement(isolate, pObj, L"cBcc"); |
| 741 cBcc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXW
ideString(); | 741 cBcc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXW
ideString(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 CFX_WideString swTitle = L"PDF"; | 855 CFX_WideString swTitle = L"PDF"; |
| 856 CFX_WideString swDefault = L""; | 856 CFX_WideString swDefault = L""; |
| 857 bool bPassWord = false; | 857 bool bPassWord = false; |
| 858 | 858 |
| 859 v8::Isolate* isolate = GetIsolate(cc); | 859 v8::Isolate* isolate = GetIsolate(cc); |
| 860 | 860 |
| 861 int iLength = params.size(); | 861 int iLength = params.size(); |
| 862 if (iLength > 0 && params[0].GetType() == VT_object) | 862 if (iLength > 0 && params[0].GetType() == VT_object) |
| 863 { | 863 { |
| 864 JSObject pObj = params[0].ToV8Object(); | 864 JSObject pObj = params[0].ToV8Object(); |
| 865 » » v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,
L"cQuestion"); | 865 » » v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,L
"cQuestion"); |
| 866 swQuestion = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).To
CFXWideString(); | 866 swQuestion = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).To
CFXWideString(); |
| 867 | 867 |
| 868 pValue = JS_GetObjectElement(isolate,pObj,L"cTitle"); | 868 pValue = JS_GetObjectElement(isolate,pObj,L"cTitle"); |
| 869 swTitle = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFX
WideString(); | 869 swTitle = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFX
WideString(); |
| 870 | 870 |
| 871 pValue = JS_GetObjectElement(isolate,pObj,L"cDefault"); | 871 pValue = JS_GetObjectElement(isolate,pObj,L"cDefault"); |
| 872 swDefault = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToC
FXWideString(); | 872 swDefault = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToC
FXWideString(); |
| 873 | 873 |
| 874 pValue = JS_GetObjectElement(isolate,pObj,L"cLabel"); | 874 pValue = JS_GetObjectElement(isolate,pObj,L"cLabel"); |
| 875 swLabel = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFX
WideString(); | 875 swLabel = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFX
WideString(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 | 931 |
| 932 FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) | 932 FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) |
| 933 { | 933 { |
| 934 return FALSE; | 934 return FALSE; |
| 935 } | 935 } |
| 936 | 936 |
| 937 FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, CFX_WideString& sError) | 937 FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ue& vRet, CFX_WideString& sError) |
| 938 { | 938 { |
| 939 return TRUE; | 939 return TRUE; |
| 940 } | 940 } |
| OLD | NEW |