| 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 #ifndef _IJAVASCRIPT_H_ | 7 #ifndef _IJAVASCRIPT_H_ |
| 8 #define _IJAVASCRIPT_H_ | 8 #define _IJAVASCRIPT_H_ |
| 9 | 9 |
| 10 namespace v8 { | |
| 11 class Platform; | |
| 12 } | |
| 13 | |
| 14 class IFXJS_Context | 10 class IFXJS_Context |
| 15 { | 11 { |
| 16 public: | 12 public: |
| 17 virtual ~IFXJS_Context() { } | 13 virtual ~IFXJS_Context() { } |
| 18 virtual FX_BOOL Compile(const CFX_WideString& sc
ript, CFX_WideString& info) = 0; | 14 virtual FX_BOOL Compile(const CFX_WideString& sc
ript, CFX_WideString& info) = 0; |
| 19 virtual FX_BOOL RunScript(const CFX_WideString&
script, CFX_WideString& info) = 0; | 15 virtual FX_BOOL RunScript(const CFX_WideString&
script, CFX_WideString& info) = 0; |
| 20 | 16 |
| 21 virtual void OnApp_Init() = 0; | 17 virtual void OnApp_Init() = 0; |
| 22 | 18 |
| 23 virtual void OnDoc_Open(CPDFSDK_Document* pDo
c, const CFX_WideString& strTargetName) = 0; | 19 virtual void OnDoc_Open(CPDFSDK_Document* pDo
c, const CFX_WideString& strTargetName) = 0; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 protected: | 90 protected: |
| 95 ~IFXJS_Runtime() { } | 91 ~IFXJS_Runtime() { } |
| 96 }; | 92 }; |
| 97 | 93 |
| 98 class CPDFDoc_Environment; | 94 class CPDFDoc_Environment; |
| 99 class CJS_GlobalData; | 95 class CJS_GlobalData; |
| 100 | 96 |
| 101 class CJS_RuntimeFactory | 97 class CJS_RuntimeFactory |
| 102 { | 98 { |
| 103 public: | 99 public: |
| 104 » CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlo
balDataCount(0),m_platform(NULL) {} | 100 » CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlo
balDataCount(0) {} |
| 105 ~CJS_RuntimeFactory(); | 101 ~CJS_RuntimeFactory(); |
| 106 IFXJS_Runtime* NewJSRuntime(CPDFDoc_Env
ironment* pApp); | 102 IFXJS_Runtime* NewJSRuntime(CPDFDoc_Env
ironment* pApp); |
| 107 void DeleteJSRuntime(
IFXJS_Runtime* pRuntime); | 103 void DeleteJSRuntime(
IFXJS_Runtime* pRuntime); |
| 108 void AddRef(); | 104 void AddRef(); |
| 109 void Release(); | 105 void Release(); |
| 110 | 106 |
| 111 CJS_GlobalData* NewGlobalData(CPDFDoc_En
vironment* pApp); | 107 CJS_GlobalData* NewGlobalData(CPDFDoc_En
vironment* pApp); |
| 112 void ReleaseGlobalDat
a(); | 108 void ReleaseGlobalDat
a(); |
| 113 private: | 109 private: |
| 114 FX_BOOL m_bInit; | 110 FX_BOOL m_bInit; |
| 115 int m_nRef; | 111 int m_nRef; |
| 116 CJS_GlobalData* m_pGlobalData; | 112 CJS_GlobalData* m_pGlobalData; |
| 117 FX_INT32 m_nGlobalDataCou
nt; | 113 FX_INT32 m_nGlobalDataCou
nt; |
| 118 v8::Platform* m_platform; | |
| 119 }; | 114 }; |
| 120 | 115 |
| 121 #endif //_IJAVASCRIPT_H_ | 116 #endif //_IJAVASCRIPT_H_ |
| 122 | 117 |
| OLD | NEW |