| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 JS_STATIC_CONST_ENTRY_STRING(L"refW", L"ReflowWidth") | 125 JS_STATIC_CONST_ENTRY_STRING(L"refW", L"ReflowWidth") |
| 126 END_JS_STATIC_CONST() | 126 END_JS_STATIC_CONST() |
| 127 | 127 |
| 128 IMPLEMENT_JS_CLASS_CONST(CJS_Zoomtype, zoomtype) | 128 IMPLEMENT_JS_CLASS_CONST(CJS_Zoomtype, zoomtype) |
| 129 | 129 |
| 130 /* ------------------------------ CJS_GlobalConsts ------------------------- */ | 130 /* ------------------------------ CJS_GlobalConsts ------------------------- */ |
| 131 | 131 |
| 132 static void DefineGlobalConstString(v8::Isolate* pIsolate, | 132 static void DefineGlobalConstString(v8::Isolate* pIsolate, |
| 133 const wchar_t* pConstName, | 133 const wchar_t* pConstName, |
| 134 const wchar_t* pValue) { | 134 const wchar_t* pValue) { |
| 135 JS_DefineGlobalConst(pIsolate, pConstName, JS_NewString(pIsolate, pValue)); | 135 FXJS_DefineGlobalConst(pIsolate, pConstName, |
| 136 FXJS_NewString(pIsolate, pValue)); |
| 136 } | 137 } |
| 137 | 138 |
| 138 void CJS_GlobalConsts::DefineJSObjects(v8::Isolate* pIsolate) { | 139 void CJS_GlobalConsts::DefineJSObjects(v8::Isolate* pIsolate) { |
| 139 DefineGlobalConstString( | 140 DefineGlobalConstString( |
| 140 pIsolate, L"IDS_GREATER_THAN", | 141 pIsolate, L"IDS_GREATER_THAN", |
| 141 L"Invalid value: must be greater than or equal to % s."); | 142 L"Invalid value: must be greater than or equal to % s."); |
| 142 DefineGlobalConstString( | 143 DefineGlobalConstString( |
| 143 pIsolate, L"IDS_GT_AND_LT", | 144 pIsolate, L"IDS_GT_AND_LT", |
| 144 L"Invalid value: must be greater than or equal to % s " | 145 L"Invalid value: must be greater than or equal to % s " |
| 145 L"and less than or equal to % s."); | 146 L"and less than or equal to % s."); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 169 void DefineGlobalConstStringArray(v8::Isolate* pIsolate, | 170 void DefineGlobalConstStringArray(v8::Isolate* pIsolate, |
| 170 const wchar_t* sConstName, | 171 const wchar_t* sConstName, |
| 171 const wchar_t** pValues, | 172 const wchar_t** pValues, |
| 172 size_t nValues) { | 173 size_t nValues) { |
| 173 CJS_Array array(pIsolate); | 174 CJS_Array array(pIsolate); |
| 174 for (size_t i = 0; i < nValues; ++i) { | 175 for (size_t i = 0; i < nValues; ++i) { |
| 175 array.SetElement(i, CJS_Value(pIsolate, pValues[i])); | 176 array.SetElement(i, CJS_Value(pIsolate, pValues[i])); |
| 176 } | 177 } |
| 177 CJS_PropValue prop(pIsolate); | 178 CJS_PropValue prop(pIsolate); |
| 178 prop << array; | 179 prop << array; |
| 179 JS_DefineGlobalConst(pIsolate, sConstName, prop.ToV8Value()); | 180 FXJS_DefineGlobalConst(pIsolate, sConstName, prop.ToV8Value()); |
| 180 } | 181 } |
| 181 | 182 |
| 182 void CJS_GlobalArrays::DefineJSObjects(v8::Isolate* pIsolate) { | 183 void CJS_GlobalArrays::DefineJSObjects(v8::Isolate* pIsolate) { |
| 183 { | 184 { |
| 184 const FX_WCHAR* ArrayName = L"RE_NUMBER_ENTRY_DOT_SEP"; | 185 const FX_WCHAR* ArrayName = L"RE_NUMBER_ENTRY_DOT_SEP"; |
| 185 const FX_WCHAR* ArrayContent[] = {L"[+-]?\\d*\\.?\\d*"}; | 186 const FX_WCHAR* ArrayContent[] = {L"[+-]?\\d*\\.?\\d*"}; |
| 186 DefineGlobalConstStringArray(pIsolate, ArrayName, ArrayContent, | 187 DefineGlobalConstStringArray(pIsolate, ArrayName, ArrayContent, |
| 187 FX_ArraySize(ArrayContent)); | 188 FX_ArraySize(ArrayContent)); |
| 188 } | 189 } |
| 189 | 190 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } | 286 } |
| 286 | 287 |
| 287 { | 288 { |
| 288 const FX_WCHAR* ArrayName = L"RE_SSN_COMMIT"; | 289 const FX_WCHAR* ArrayName = L"RE_SSN_COMMIT"; |
| 289 const FX_WCHAR* ArrayContent[] = { | 290 const FX_WCHAR* ArrayContent[] = { |
| 290 L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"}; | 291 L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"}; |
| 291 DefineGlobalConstStringArray(pIsolate, ArrayName, ArrayContent, | 292 DefineGlobalConstStringArray(pIsolate, ArrayName, ArrayContent, |
| 292 FX_ArraySize(ArrayContent)); | 293 FX_ArraySize(ArrayContent)); |
| 293 } | 294 } |
| 294 } | 295 } |
| OLD | NEW |