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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 if (nSize > 1) | 656 if (nSize > 1) |
657 bFDF = params[1].ToBool(); | 657 bFDF = params[1].ToBool(); |
658 if (nSize > 2) | 658 if (nSize > 2) |
659 bEmpty = params[2].ToBool(); | 659 bEmpty = params[2].ToBool(); |
660 if (nSize > 3) | 660 if (nSize > 3) |
661 aFields.Attach(params[3].ToV8Array()); | 661 aFields.Attach(params[3].ToV8Array()); |
662 } | 662 } |
663 else if (v.GetType() == VT_object) | 663 else if (v.GetType() == VT_object) |
664 { | 664 { |
665 JSObject pObj = params[0].ToV8Object(); | 665 JSObject pObj = params[0].ToV8Object(); |
666 » » v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate, pObj
, L"cURL"); | 666 » » v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate, pObj,
L"cURL"); |
667 if (!pValue.IsEmpty()) | 667 if (!pValue.IsEmpty()) |
668 strURL = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValu
e)).ToCFXWideString(); | 668 strURL = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValu
e)).ToCFXWideString(); |
669 pValue = JS_GetObjectElement(isolate, pObj, L"bFDF"); | 669 pValue = JS_GetObjectElement(isolate, pObj, L"bFDF"); |
670 bFDF = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool
(); | 670 bFDF = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool
(); |
671 pValue = JS_GetObjectElement(isolate, pObj, L"bEmpty"); | 671 pValue = JS_GetObjectElement(isolate, pObj, L"bEmpty"); |
672 bEmpty = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBo
ol(); | 672 bEmpty = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBo
ol(); |
673 pValue = JS_GetObjectElement(isolate, pObj,L"aFields"); | 673 pValue = JS_GetObjectElement(isolate, pObj,L"aFields"); |
674 aFields.Attach(CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)
).ToV8Array()); | 674 aFields.Attach(CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)
).ToV8Array()); |
675 } | 675 } |
676 | 676 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 cSubject = params[4].ToCFXWideString(); | 789 cSubject = params[4].ToCFXWideString(); |
790 if (params.size() >= 6) | 790 if (params.size() >= 6) |
791 cMsg = params[5].ToCFXWideString(); | 791 cMsg = params[5].ToCFXWideString(); |
792 | 792 |
793 v8::Isolate* isolate = GetIsolate(cc); | 793 v8::Isolate* isolate = GetIsolate(cc); |
794 | 794 |
795 if(params.size() >= 1 && params[0].GetType() == VT_object) | 795 if(params.size() >= 1 && params[0].GetType() == VT_object) |
796 { | 796 { |
797 JSObject pObj = params[0].ToV8Object(); | 797 JSObject pObj = params[0].ToV8Object(); |
798 | 798 |
799 » » v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,
L"bUI"); | 799 » » v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,
L"bUI"); |
800 bUI = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToInt(); | 800 bUI = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToInt(); |
801 | 801 |
802 pValue = JS_GetObjectElement(isolate,pObj, L"cTo"); | 802 pValue = JS_GetObjectElement(isolate,pObj, L"cTo"); |
803 cTo = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWide
String(); | 803 cTo = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWide
String(); |
804 | 804 |
805 pValue = JS_GetObjectElement(isolate,pObj, L"cCc"); | 805 pValue = JS_GetObjectElement(isolate,pObj, L"cCc"); |
806 cCc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWide
String(); | 806 cCc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWide
String(); |
807 | 807 |
808 pValue = JS_GetObjectElement(isolate,pObj, L"cBcc"); | 808 pValue = JS_GetObjectElement(isolate,pObj, L"cBcc"); |
809 cBcc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWid
eString(); | 809 cBcc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWid
eString(); |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1856 int nEnd = 0; | 1856 int nEnd = 0; |
1857 | 1857 |
1858 if (iSize < 1) | 1858 if (iSize < 1) |
1859 { | 1859 { |
1860 } | 1860 } |
1861 else if (iSize == 1) | 1861 else if (iSize == 1) |
1862 { | 1862 { |
1863 if (params[0].GetType() == VT_object) | 1863 if (params[0].GetType() == VT_object) |
1864 { | 1864 { |
1865 JSObject pObj = params[0].ToV8Object(); | 1865 JSObject pObj = params[0].ToV8Object(); |
1866 » » » v8::Handle<v8::Value> pValue = JS_GetObjectElement(isola
te, pObj, L"nStart"); | 1866 » » » v8::Local<v8::Value> pValue = JS_GetObjectElement(isolat
e, pObj, L"nStart"); |
1867 nStart = CJS_Value(m_isolate, pValue, GET_VALUE_TYPE(pValue)).ToInt(
); | 1867 nStart = CJS_Value(m_isolate, pValue, GET_VALUE_TYPE(pValue)).ToInt(
); |
1868 | 1868 |
1869 pValue = JS_GetObjectElement(isolate, pObj, L"nEnd"); | 1869 pValue = JS_GetObjectElement(isolate, pObj, L"nEnd"); |
1870 nEnd = CJS_Value(m_isolate, pValue, GET_VALUE_TYPE(pValu
e)).ToInt(); | 1870 nEnd = CJS_Value(m_isolate, pValue, GET_VALUE_TYPE(pValu
e)).ToInt(); |
1871 } | 1871 } |
1872 else | 1872 else |
1873 { | 1873 { |
1874 nStart = params[0].ToInt(); | 1874 nStart = params[0].ToInt(); |
1875 } | 1875 } |
1876 } | 1876 } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 { | 1961 { |
1962 m_DelayData.RemoveAt(DelArray[j]); | 1962 m_DelayData.RemoveAt(DelArray[j]); |
1963 } | 1963 } |
1964 } | 1964 } |
1965 | 1965 |
1966 CJS_Document* Document::GetCJSDoc() const | 1966 CJS_Document* Document::GetCJSDoc() const |
1967 { | 1967 { |
1968 return static_cast<CJS_Document*>(m_pJSObject); | 1968 return static_cast<CJS_Document*>(m_pJSObject); |
1969 } | 1969 } |
1970 | 1970 |
OLD | NEW |