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_EventHandler.h" | 9 #include "../../include/javascript/JS_EventHandler.h" |
10 #include "../../include/javascript/JS_Runtime.h" | 10 #include "../../include/javascript/JS_Runtime.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 323 } |
324 | 324 |
325 v8::Handle<v8::Context> CJS_Runtime::NewJSContext() | 325 v8::Handle<v8::Context> CJS_Runtime::NewJSContext() |
326 { | 326 { |
327 return v8::Local<v8::Context>::New(m_isolate, m_context); | 327 return v8::Local<v8::Context>::New(m_isolate, m_context); |
328 } | 328 } |
329 | 329 |
330 CFX_WideString ChangeObjName(const CFX_WideString& str) | 330 CFX_WideString ChangeObjName(const CFX_WideString& str) |
331 { | 331 { |
332 CFX_WideString sRet = str; | 332 CFX_WideString sRet = str; |
333 » sRet.Replace((FX_LPCWSTR)L"_", (FX_LPCWSTR)L"."); | 333 » sRet.Replace(L"_", L"."); |
334 return sRet; | 334 return sRet; |
335 } | 335 } |
336 | 336 |
337 void CJS_Runtime::GetObjectNames(CFX_WideStringArray& array) | 337 void CJS_Runtime::GetObjectNames(CFX_WideStringArray& array) |
338 { | 338 { |
339 array.RemoveAll(); | 339 array.RemoveAll(); |
340 | 340 |
341 array.Add(CJS_Border::m_pClassName); | 341 array.Add(CJS_Border::m_pClassName); |
342 array.Add(CJS_Display::m_pClassName); | 342 array.Add(CJS_Display::m_pClassName); |
343 array.Add(CJS_Font::m_pClassName); | 343 array.Add(CJS_Font::m_pClassName); |
344 array.Add(CJS_Highlight::m_pClassName); | 344 array.Add(CJS_Highlight::m_pClassName); |
345 array.Add(CJS_Position::m_pClassName); | 345 array.Add(CJS_Position::m_pClassName); |
346 array.Add(CJS_ScaleHow::m_pClassName); | 346 array.Add(CJS_ScaleHow::m_pClassName); |
347 array.Add(CJS_ScaleWhen::m_pClassName); | 347 array.Add(CJS_ScaleWhen::m_pClassName); |
348 array.Add(CJS_Style::m_pClassName); | 348 array.Add(CJS_Style::m_pClassName); |
349 array.Add(CJS_Zoomtype::m_pClassName); | 349 array.Add(CJS_Zoomtype::m_pClassName); |
350 | 350 |
351 array.Add(CJS_App::m_pClassName); | 351 array.Add(CJS_App::m_pClassName); |
352 » array.Add((FX_LPCWSTR)"this"); | 352 » array.Add(L"this"); |
353 array.Add(CJS_Event::m_pClassName); | 353 array.Add(CJS_Event::m_pClassName); |
354 | 354 |
355 array.Add(CJS_Global::m_pClassName); | 355 array.Add(CJS_Global::m_pClassName); |
356 array.Add(CJS_Util::m_pClassName); | 356 array.Add(CJS_Util::m_pClassName); |
357 } | 357 } |
358 | 358 |
359 void CJS_Runtime::GetObjectConsts(const CFX_WideString& sObjName, CFX_WideString
Array& array) | 359 void CJS_Runtime::GetObjectConsts(const CFX_WideString& sObjName, CFX_WideString
Array& array) |
360 { | 360 { |
361 JSConstSpec* pConsts = NULL; | 361 JSConstSpec* pConsts = NULL; |
362 int nSize = 0; | 362 int nSize = 0; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 return v8::Isolate::GetCurrent() == m_isolate; | 469 return v8::Isolate::GetCurrent() == m_isolate; |
470 } | 470 } |
471 void CJS_Runtime::Exit() | 471 void CJS_Runtime::Exit() |
472 { | 472 { |
473 if(m_isolate) m_isolate->Exit(); | 473 if(m_isolate) m_isolate->Exit(); |
474 } | 474 } |
475 void CJS_Runtime::Enter() | 475 void CJS_Runtime::Enter() |
476 { | 476 { |
477 if(m_isolate) m_isolate->Enter(); | 477 if(m_isolate) m_isolate->Enter(); |
478 } | 478 } |
OLD | NEW |